text stringlengths 2 1.04M | meta dict |
|---|---|
require 'spec_helper'
describe "jmaxml/quake_regions", type: :feature, dbscope: :example do
let(:site) { cms_site }
let(:node) { create :rss_node_weather_xml, cur_site: site }
let(:index_path) { jmaxml_quake_regions_path(site, node) }
context "basic crud" do
let(:code) { unique_id }
let(:name) { unique_id }
let(:yomi1) { unique_id }
let(:yomi2) { unique_id }
before { login_cms_user }
it do
#
# create
#
visit index_path
click_on I18n.t('ss.links.new')
within 'form' do
fill_in 'item[code]', with: code
fill_in 'item[name]', with: name
fill_in 'item[yomi]', with: yomi1
click_on I18n.t('ss.buttons.save')
end
expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'), wait: 60)
expect(Jmaxml::QuakeRegion.count).to eq 1
Jmaxml::QuakeRegion.first.tap do |region|
expect(region.code).to eq code
expect(region.name).to eq name
expect(region.yomi).to eq yomi1
end
#
# update
#
visit index_path
click_on name
click_on I18n.t('ss.links.edit')
within 'form' do
fill_in 'item[yomi]', with: yomi2
click_on I18n.t('ss.buttons.save')
end
expect(page).to have_css('#notice', text: I18n.t('ss.notice.saved'), wait: 60)
expect(Jmaxml::QuakeRegion.count).to eq 1
Jmaxml::QuakeRegion.first.tap do |region|
expect(region.code).to eq code
expect(region.name).to eq name
expect(region.yomi).to eq yomi2
end
#
# delete
#
visit index_path
click_on name
click_on I18n.t('ss.links.delete')
within 'form' do
click_on I18n.t('ss.buttons.delete')
end
expect(page).to have_css('#notice', text: I18n.t('ss.notice.deleted'), wait: 60)
expect(Jmaxml::QuakeRegion.count).to eq 0
end
end
context 'search' do
let!(:region) { create :jmaxml_region_c126 }
before { login_cms_user }
it do
visit index_path
expect(page).to have_css('.list-item .title', text: region.name)
fill_in 's[keyword]', with: region.name
click_on I18n.t('ss.buttons.search')
expect(page).to have_css('.list-item .title', text: region.name)
visit index_path
fill_in 's[keyword]', with: unique_id
click_on I18n.t('ss.buttons.search')
expect(page).to have_no_css('.list-item .title', text: region.name)
end
end
end
| {
"content_hash": "6bf81f0a047dbc15ee9c13b0b27e1189",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 86,
"avg_line_length": 26.795698924731184,
"alnum_prop": 0.5898876404494382,
"repo_name": "shirasagi/shirasagi",
"id": "58dc467f93f00271fbe0ce67c45b95278c1ee4f2",
"size": "2492",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "spec/features/jmaxml/quake_regions_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "82226"
},
{
"name": "HTML",
"bytes": "3237226"
},
{
"name": "JavaScript",
"bytes": "11966681"
},
{
"name": "Ruby",
"bytes": "12375064"
},
{
"name": "SCSS",
"bytes": "526557"
},
{
"name": "Shell",
"bytes": "20130"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe "Stashes" do
before :each do
user = FactoryGirl.create(:user)
user.add_role :admin
Stash.refresh_cache
sign_in_user(user)
visit '/stashes'
end
after :each do
reset_fake_sensu!
end
it "should show the stashes page" do
page.should have_content "Stashes"
end
it "should show the correct stash count" do
page.should have_content "Stashes (#{Stash.all.count})"
end
it "should show stashes and correct data" do
page.should have_content "tester"
page.should have_content "Never"
page.should have_content "43 years ago"
end
it "should have a delete link" do
page.should have_button "Delete"
end
pending "should allow deletion of a stash", :js => true do
page.should have_selector("#silence-i-424242-tokens", :text => "Delete")
find("#silence-i-424242-tokens", :text => "Delete").click
page.should_not have_selector("#silence-i-424242-tokens", :text => "Delete")
end
end
| {
"content_hash": "17a43afd407c7c2739264cdda53d7c02",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 80,
"avg_line_length": 24.146341463414632,
"alnum_prop": 0.6747474747474748,
"repo_name": "sensu/sensu-admin",
"id": "2fdbb3edec32f841e92c015736fd721da97d528d",
"size": "990",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/features/stashes_features_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9053"
},
{
"name": "CoffeeScript",
"bytes": "15810"
},
{
"name": "HTML",
"bytes": "69465"
},
{
"name": "JavaScript",
"bytes": "10029"
},
{
"name": "Ruby",
"bytes": "114333"
}
],
"symlink_target": ""
} |
namespace mojo {
class ServiceFactory;
}
namespace content {
class UtilityServiceFactory;
// This class represents the background thread where the utility task runs.
class UtilityThreadImpl : public UtilityThread,
public ChildThreadImpl {
public:
explicit UtilityThreadImpl(base::RepeatingClosure quit_closure);
// Constructor used when running in single process mode.
explicit UtilityThreadImpl(const InProcessChildThreadParams& params);
UtilityThreadImpl(const UtilityThreadImpl&) = delete;
UtilityThreadImpl& operator=(const UtilityThreadImpl&) = delete;
~UtilityThreadImpl() override;
void Shutdown() override;
// UtilityThread:
void ReleaseProcess() override;
void EnsureBlinkInitialized() override;
#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
void EnsureBlinkInitializedWithSandboxSupport() override;
#endif
// Handles an incoming service interface receiver from a browser-side
// ServiceProcessHost. This is called only if `receiver` didn't first match
// any registered IO-thread service handlers in this process. If successful,
// `termination_callback` will eventually be invoked when the new service
// instance terminates.
//
// If there is no matching service, `receiver` is discarded and
// `termination_callback` is invoked immediately.
void HandleServiceRequest(mojo::GenericPendingReceiver receiver,
base::OnceClosure termination_callback);
private:
void EnsureBlinkInitializedInternal(bool sandbox_support);
void Init();
// ChildThreadImpl:
void RunServiceDeprecated(
const std::string& service_name,
mojo::ScopedMessagePipeHandle service_pipe) override;
// blink::Platform implementation if needed.
std::unique_ptr<blink::Platform> blink_platform_impl_;
// Helper to handle incoming RunServiceDeprecated calls. Note that this is
// deprecated and only remains in support of some embedders which haven't
// migrated away from Service Manager-based services yet.
std::unique_ptr<UtilityServiceFactory> service_factory_;
// The ServiceFactory used to handle incoming service requests from a
// browser-side ServiceProcessHost. Any service registered here will run on
// the main thread of its service process.
std::unique_ptr<mojo::ServiceFactory> main_thread_services_;
};
} // namespace content
#endif // CONTENT_UTILITY_UTILITY_THREAD_IMPL_H_
| {
"content_hash": "0c207cc8c1ee62c3634a44581a3ffc7b",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 78,
"avg_line_length": 37.215384615384615,
"alnum_prop": 0.7552707730467135,
"repo_name": "scheib/chromium",
"id": "696efa4ba08e992eeec8d6a1ed59c912fdd7d854",
"size": "2978",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "content/utility/utility_thread_impl.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
'use strict';
var _ = require('lodash');
function validateAst(validators, ast) {
return _(validators)
.map(function(validationConfig, configName) {
var validator = validationConfig.validator;
var configParam = validationConfig.param;
var validationResults = _.compact([].concat(validator(ast, configParam)));
return validationResults.length ? _.zipObject([[configName, validationResults]]) : {};
})
.reduce(_.partial(_.merge, {}));
}
module.exports = validateAst; | {
"content_hash": "ee80f2ce0014fb62f18c3c9d81099223",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 98,
"avg_line_length": 27.3,
"alnum_prop": 0.6318681318681318,
"repo_name": "NickHeiner/editorconfig-lint",
"id": "d67165eec350f8176268802e25a362cf4201406b",
"size": "546",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/core/validate-ast.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CoffeeScript",
"bytes": "477"
},
{
"name": "JavaScript",
"bytes": "16122"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 Saksham.
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.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/black" />
<corners android:radius="4dp" />
</shape> | {
"content_hash": "f5f0875e25d1305a2322c630d9ebc6b2",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 74,
"avg_line_length": 40.578947368421055,
"alnum_prop": 0.7341115434500648,
"repo_name": "DawnImpulse/Wallup",
"id": "bcfdced480d06d0209044fa5d7735f75cdc65fe1",
"size": "771",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/res/drawable/view_category_next_button.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "256946"
}
],
"symlink_target": ""
} |
/**
* pubfood
*/
'use strict';
/*eslint no-unused-vars: 0*/
/*eslint no-undef: 0*/
describe('API - Tests', function () {
require('./objects');
require('./callbacks');
require('./donecallbacktimeout');
require('./customparams');
require('./buildtargeting');
require('./events');
require('./transformoperator');
require('./auctionrun');
require('./providererrors');
require('./timeoutforceddone');
});
| {
"content_hash": "6c5972c8ed590bcc8d08af16331086fd",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 37,
"avg_line_length": 22.263157894736842,
"alnum_prop": 0.6335697399527187,
"repo_name": "pubfood/pubfood",
"id": "249b492c91692ee6956e77459869f3566d21a51c",
"size": "423",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/api/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "695"
},
{
"name": "JavaScript",
"bytes": "308729"
}
],
"symlink_target": ""
} |
// ***********************************************************************
// Copyright (c) 2010 Charlie Poole
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ***********************************************************************
namespace BenchmarkSuite.Framework.Interfaces
{
/// <summary>
/// The TestStatus enum indicates the result of running a test
/// </summary>
public enum TestStatus
{
/// <summary>
/// The test was inconclusive
/// </summary>
Inconclusive,
/// <summary>
/// The test has skipped
/// </summary>
Skipped,
/// <summary>
/// The test succeeded
/// </summary>
Passed,
/// <summary>
/// The test failed
/// </summary>
Failed
}
}
| {
"content_hash": "835f16c4ff1f50c903c7a3de20fb1bef",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 75,
"avg_line_length": 33.94117647058823,
"alnum_prop": 0.6539572501444252,
"repo_name": "xplicit/BenchmarkSuite",
"id": "30eda879d86380e4a420fdbd48816460340e5e05",
"size": "1733",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/BenchmarkSuite/Interfaces/TestStatus.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "805339"
}
],
"symlink_target": ""
} |
package storm.xmlbinder.binder;
/*
* This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/4.0/.
*/
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import storm.xmlbinder.XmlBinderException;
/**
* This binder just ignore the element.
* Useful when child element is more useful.
*
* @author Storm <j-storm@hotmail.fr>
*/
public class NullBinder extends AbstractBinder
{
/**
* Construct an instance.
*/
public NullBinder()
{
super("");
}
/*
* (non-Javadoc)
* @see storm.xmlbinder.binder.AbstractBinder#read(java.lang.Object, java.lang.String)
*/
@Override
public Object read(Object _data, String _content) throws XmlBinderException
{
return _data;
}
/*
* (non-Javadoc)
* @see storm.xmlbinder.binder.AbstractBinder#write(java.lang.Object, org.w3c.dom.Node, org.w3c.dom.Document)
*/
@Override
public void write(Object _data, Node _node, Document _document) throws XmlBinderException
{
//do nothing
}
}
| {
"content_hash": "ec804bbc339799a3531620930ec26f29",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 116,
"avg_line_length": 22.46938775510204,
"alnum_prop": 0.7166212534059946,
"repo_name": "india-rose/android-writing",
"id": "57f7d679bafadcceb1023d48669e9f87543e3177",
"size": "1101",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "app/libs/storm/xmlbinder/binder/NullBinder.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "134844"
}
],
"symlink_target": ""
} |
var logger = require('../utils/logger').instance()
module.exports = function(app) {
// We don't want to leave a trace on the visitor's machine
// so we turn off caching
app.set('staticMaxAge', 0);
// Log a heartbeat every 10 seconds (we don't need to fill any logs here..)
setInterval(function() {
logger.prod("heartbeat");
}, 1000);
app.set('protocol', 'https');
app.set('host', 'tipbox.in');
app.use(function(req, res, next) {
// Forces the browser to use HTTPS by default on next request https://tools.ietf.org/html/rfc6797
res.setHeader("Strict-Transport-Security", "max-age=31536000; includeSubDomains");
next();
});
};
| {
"content_hash": "1d3a87a1d6e7b6150499baa476982059",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 101,
"avg_line_length": 27.833333333333332,
"alnum_prop": 0.6616766467065869,
"repo_name": "xdamman/tipbox",
"id": "eb0a753e8d1301830d01a70c0acbeceecf4a1f8a",
"size": "668",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "server/config/tipbox.in.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "75065"
},
{
"name": "HTML",
"bytes": "60832"
},
{
"name": "JavaScript",
"bytes": "90777"
},
{
"name": "Makefile",
"bytes": "440"
}
],
"symlink_target": ""
} |
export * from './find';
| {
"content_hash": "d81fa16a63f42ffc12987d6ce568f558",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 23,
"avg_line_length": 24,
"alnum_prop": 0.5833333333333334,
"repo_name": "evanliomain/taninsam",
"id": "833bbb3fefb7bf4bf93b9081e69d8abfaa6f1ba3",
"size": "24",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/find/index.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "3418"
},
{
"name": "TypeScript",
"bytes": "111991"
}
],
"symlink_target": ""
} |
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 3.0.7
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package com.badlogic.gdx.physics.bullet.collision;
import com.badlogic.gdx.physics.bullet.BulletBase;
import com.badlogic.gdx.physics.bullet.linearmath.*;
import com.badlogic.gdx.math.Vector3;
import com.badlogic.gdx.math.Quaternion;
import com.badlogic.gdx.math.Matrix3;
import com.badlogic.gdx.math.Matrix4;
public class RayResultCallback extends BulletBase {
private long swigCPtr;
protected RayResultCallback(final String className, long cPtr, boolean cMemoryOwn) {
super(className, cPtr, cMemoryOwn);
swigCPtr = cPtr;
}
/** Construct a new RayResultCallback, normally you should not need this constructor it's intended for low-level usage. */
public RayResultCallback(long cPtr, boolean cMemoryOwn) {
this("RayResultCallback", cPtr, cMemoryOwn);
construct();
}
@Override
protected void reset(long cPtr, boolean cMemoryOwn) {
if (!destroyed)
destroy();
super.reset(swigCPtr = cPtr, cMemoryOwn);
}
public static long getCPtr(RayResultCallback obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
@Override
protected void finalize() throws Throwable {
if (!destroyed)
destroy();
super.finalize();
}
@Override protected synchronized void delete() {
if (swigCPtr != 0) {
if (swigCMemOwn) {
swigCMemOwn = false;
CollisionJNI.delete_RayResultCallback(swigCPtr);
}
swigCPtr = 0;
}
super.delete();
}
protected void swigDirectorDisconnect() {
swigCMemOwn = false;
delete();
}
public void swigReleaseOwnership() {
swigCMemOwn = false;
CollisionJNI.RayResultCallback_change_ownership(this, swigCPtr, false);
}
public void swigTakeOwnership() {
swigCMemOwn = true;
CollisionJNI.RayResultCallback_change_ownership(this, swigCPtr, true);
}
public void setClosestHitFraction(float value) {
CollisionJNI.RayResultCallback_closestHitFraction_set(swigCPtr, this, value);
}
public float getClosestHitFraction() {
return CollisionJNI.RayResultCallback_closestHitFraction_get(swigCPtr, this);
}
public void setCollisionObject(btCollisionObject value) {
CollisionJNI.RayResultCallback_collisionObject_set(swigCPtr, this, btCollisionObject.getCPtr(value), value);
}
public btCollisionObject getCollisionObject() {
return btCollisionObject.getInstance(CollisionJNI.RayResultCallback_collisionObject_get(swigCPtr, this), false);
}
public void setCollisionFilterGroup(short value) {
CollisionJNI.RayResultCallback_collisionFilterGroup_set(swigCPtr, this, value);
}
public short getCollisionFilterGroup() {
return CollisionJNI.RayResultCallback_collisionFilterGroup_get(swigCPtr, this);
}
public void setCollisionFilterMask(short value) {
CollisionJNI.RayResultCallback_collisionFilterMask_set(swigCPtr, this, value);
}
public short getCollisionFilterMask() {
return CollisionJNI.RayResultCallback_collisionFilterMask_get(swigCPtr, this);
}
public void setFlags(long value) {
CollisionJNI.RayResultCallback_flags_set(swigCPtr, this, value);
}
public long getFlags() {
return CollisionJNI.RayResultCallback_flags_get(swigCPtr, this);
}
public boolean hasHit() {
return CollisionJNI.RayResultCallback_hasHit(swigCPtr, this);
}
public RayResultCallback() {
this(CollisionJNI.new_RayResultCallback(), true);
CollisionJNI.RayResultCallback_director_connect(this, swigCPtr, swigCMemOwn, true);
}
public boolean needsCollision(btBroadphaseProxy proxy0) {
return (getClass() == RayResultCallback.class) ? CollisionJNI.RayResultCallback_needsCollision(swigCPtr, this, btBroadphaseProxy.getCPtr(proxy0), proxy0) : CollisionJNI.RayResultCallback_needsCollisionSwigExplicitRayResultCallback(swigCPtr, this, btBroadphaseProxy.getCPtr(proxy0), proxy0);
}
public float addSingleResult(LocalRayResult rayResult, boolean normalInWorldSpace) {
return CollisionJNI.RayResultCallback_addSingleResult(swigCPtr, this, LocalRayResult.getCPtr(rayResult), rayResult, normalInWorldSpace);
}
}
| {
"content_hash": "a56135aaf2c93df6072fe38304e7b9a1",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 294,
"avg_line_length": 32.744360902255636,
"alnum_prop": 0.7322617680826636,
"repo_name": "PedroRomanoBarbosa/libgdx",
"id": "a63c9b2a8612636a450b4f79a671895e1412f87a",
"size": "4355",
"binary": false,
"copies": "18",
"ref": "refs/heads/master",
"path": "extensions/gdx-bullet/jni/swig-src/collision/com/badlogic/gdx/physics/bullet/collision/RayResultCallback.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "3962"
},
{
"name": "C",
"bytes": "8474436"
},
{
"name": "C++",
"bytes": "10640250"
},
{
"name": "CMake",
"bytes": "50546"
},
{
"name": "CSS",
"bytes": "58714"
},
{
"name": "DIGITAL Command Language",
"bytes": "35809"
},
{
"name": "GLSL",
"bytes": "92079"
},
{
"name": "Groff",
"bytes": "2333"
},
{
"name": "HTML",
"bytes": "1125248"
},
{
"name": "Java",
"bytes": "12932853"
},
{
"name": "JavaScript",
"bytes": "72"
},
{
"name": "Lua",
"bytes": "1354"
},
{
"name": "Makefile",
"bytes": "176754"
},
{
"name": "Objective-C",
"bytes": "67438"
},
{
"name": "Objective-C++",
"bytes": "58296"
},
{
"name": "OpenEdge ABL",
"bytes": "15076"
},
{
"name": "Perl",
"bytes": "12797"
},
{
"name": "Python",
"bytes": "182748"
},
{
"name": "Ragel in Ruby Host",
"bytes": "29592"
},
{
"name": "Shell",
"bytes": "354262"
}
],
"symlink_target": ""
} |
<!-- This file is machine generated: DO NOT EDIT! -->
# TensorFlow Python reference documentation
* **[Building Graphs](../../api_docs/python/framework.md)**:
* [`add_to_collection`](../../api_docs/python/framework.md#add_to_collection)
* [`as_dtype`](../../api_docs/python/framework.md#as_dtype)
* [`container`](../../api_docs/python/framework.md#container)
* [`control_dependencies`](../../api_docs/python/framework.md#control_dependencies)
* [`convert_to_tensor`](../../api_docs/python/framework.md#convert_to_tensor)
* [`convert_to_tensor_or_indexed_slices`](../../api_docs/python/framework.md#convert_to_tensor_or_indexed_slices)
* [`device`](../../api_docs/python/framework.md#device)
* [`DeviceSpec`](../../api_docs/python/framework.md#DeviceSpec)
* [`Dimension`](../../api_docs/python/framework.md#Dimension)
* [`DType`](../../api_docs/python/framework.md#DType)
* [`get_collection`](../../api_docs/python/framework.md#get_collection)
* [`get_collection_ref`](../../api_docs/python/framework.md#get_collection_ref)
* [`get_default_graph`](../../api_docs/python/framework.md#get_default_graph)
* [`get_seed`](../../api_docs/python/framework.md#get_seed)
* [`Graph`](../../api_docs/python/framework.md#Graph)
* [`GraphKeys`](../../api_docs/python/framework.md#GraphKeys)
* [`import_graph_def`](../../api_docs/python/framework.md#import_graph_def)
* [`load_file_system_library`](../../api_docs/python/framework.md#load_file_system_library)
* [`load_op_library`](../../api_docs/python/framework.md#load_op_library)
* [`name_scope`](../../api_docs/python/framework.md#name_scope)
* [`NoGradient`](../../api_docs/python/framework.md#NoGradient)
* [`NotDifferentiable`](../../api_docs/python/framework.md#NotDifferentiable)
* [`op_scope`](../../api_docs/python/framework.md#op_scope)
* [`Operation`](../../api_docs/python/framework.md#Operation)
* [`register_tensor_conversion_function`](../../api_docs/python/framework.md#register_tensor_conversion_function)
* [`RegisterGradient`](../../api_docs/python/framework.md#RegisterGradient)
* [`RegisterShape`](../../api_docs/python/framework.md#RegisterShape)
* [`reset_default_graph`](../../api_docs/python/framework.md#reset_default_graph)
* [`Tensor`](../../api_docs/python/framework.md#Tensor)
* [`TensorShape`](../../api_docs/python/framework.md#TensorShape)
* **[Asserts and boolean checks.](../../api_docs/python/check_ops.md)**:
* [`assert_equal`](../../api_docs/python/check_ops.md#assert_equal)
* [`assert_greater`](../../api_docs/python/check_ops.md#assert_greater)
* [`assert_greater_equal`](../../api_docs/python/check_ops.md#assert_greater_equal)
* [`assert_integer`](../../api_docs/python/check_ops.md#assert_integer)
* [`assert_less`](../../api_docs/python/check_ops.md#assert_less)
* [`assert_less_equal`](../../api_docs/python/check_ops.md#assert_less_equal)
* [`assert_negative`](../../api_docs/python/check_ops.md#assert_negative)
* [`assert_non_negative`](../../api_docs/python/check_ops.md#assert_non_negative)
* [`assert_non_positive`](../../api_docs/python/check_ops.md#assert_non_positive)
* [`assert_positive`](../../api_docs/python/check_ops.md#assert_positive)
* [`assert_proper_iterable`](../../api_docs/python/check_ops.md#assert_proper_iterable)
* [`assert_rank`](../../api_docs/python/check_ops.md#assert_rank)
* [`assert_rank_at_least`](../../api_docs/python/check_ops.md#assert_rank_at_least)
* [`assert_type`](../../api_docs/python/check_ops.md#assert_type)
* [`is_non_decreasing`](../../api_docs/python/check_ops.md#is_non_decreasing)
* [`is_numeric_tensor`](../../api_docs/python/check_ops.md#is_numeric_tensor)
* [`is_strictly_increasing`](../../api_docs/python/check_ops.md#is_strictly_increasing)
* **[Constants, Sequences, and Random Values](../../api_docs/python/constant_op.md)**:
* [`constant`](../../api_docs/python/constant_op.md#constant)
* [`fill`](../../api_docs/python/constant_op.md#fill)
* [`linspace`](../../api_docs/python/constant_op.md#linspace)
* [`multinomial`](../../api_docs/python/constant_op.md#multinomial)
* [`ones`](../../api_docs/python/constant_op.md#ones)
* [`ones_like`](../../api_docs/python/constant_op.md#ones_like)
* [`random_crop`](../../api_docs/python/constant_op.md#random_crop)
* [`random_gamma`](../../api_docs/python/constant_op.md#random_gamma)
* [`random_normal`](../../api_docs/python/constant_op.md#random_normal)
* [`random_shuffle`](../../api_docs/python/constant_op.md#random_shuffle)
* [`random_uniform`](../../api_docs/python/constant_op.md#random_uniform)
* [`range`](../../api_docs/python/constant_op.md#range)
* [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
* [`truncated_normal`](../../api_docs/python/constant_op.md#truncated_normal)
* [`zeros`](../../api_docs/python/constant_op.md#zeros)
* [`zeros_like`](../../api_docs/python/constant_op.md#zeros_like)
* **[Variables](../../api_docs/python/state_ops.md)**:
* [`all_variables`](../../api_docs/python/state_ops.md#all_variables)
* [`assert_variables_initialized`](../../api_docs/python/state_ops.md#assert_variables_initialized)
* [`assign`](../../api_docs/python/state_ops.md#assign)
* [`assign_add`](../../api_docs/python/state_ops.md#assign_add)
* [`assign_sub`](../../api_docs/python/state_ops.md#assign_sub)
* [`constant_initializer`](../../api_docs/python/state_ops.md#constant_initializer)
* [`count_up_to`](../../api_docs/python/state_ops.md#count_up_to)
* [`device`](../../api_docs/python/state_ops.md#device)
* [`export_meta_graph`](../../api_docs/python/state_ops.md#export_meta_graph)
* [`fixed_size_partitioner`](../../api_docs/python/state_ops.md#fixed_size_partitioner)
* [`get_checkpoint_state`](../../api_docs/python/state_ops.md#get_checkpoint_state)
* [`get_variable`](../../api_docs/python/state_ops.md#get_variable)
* [`get_variable_scope`](../../api_docs/python/state_ops.md#get_variable_scope)
* [`import_meta_graph`](../../api_docs/python/state_ops.md#import_meta_graph)
* [`IndexedSlices`](../../api_docs/python/state_ops.md#IndexedSlices)
* [`initialize_all_tables`](../../api_docs/python/state_ops.md#initialize_all_tables)
* [`initialize_all_variables`](../../api_docs/python/state_ops.md#initialize_all_variables)
* [`initialize_local_variables`](../../api_docs/python/state_ops.md#initialize_local_variables)
* [`initialize_variables`](../../api_docs/python/state_ops.md#initialize_variables)
* [`is_variable_initialized`](../../api_docs/python/state_ops.md#is_variable_initialized)
* [`latest_checkpoint`](../../api_docs/python/state_ops.md#latest_checkpoint)
* [`local_variables`](../../api_docs/python/state_ops.md#local_variables)
* [`make_template`](../../api_docs/python/state_ops.md#make_template)
* [`min_max_variable_partitioner`](../../api_docs/python/state_ops.md#min_max_variable_partitioner)
* [`model_variables`](../../api_docs/python/state_ops.md#model_variables)
* [`moving_average_variables`](../../api_docs/python/state_ops.md#moving_average_variables)
* [`no_regularizer`](../../api_docs/python/state_ops.md#no_regularizer)
* [`ones_initializer`](../../api_docs/python/state_ops.md#ones_initializer)
* [`random_normal_initializer`](../../api_docs/python/state_ops.md#random_normal_initializer)
* [`random_uniform_initializer`](../../api_docs/python/state_ops.md#random_uniform_initializer)
* [`report_uninitialized_variables`](../../api_docs/python/state_ops.md#report_uninitialized_variables)
* [`Saver`](../../api_docs/python/state_ops.md#Saver)
* [`scatter_add`](../../api_docs/python/state_ops.md#scatter_add)
* [`scatter_div`](../../api_docs/python/state_ops.md#scatter_div)
* [`scatter_mul`](../../api_docs/python/state_ops.md#scatter_mul)
* [`scatter_sub`](../../api_docs/python/state_ops.md#scatter_sub)
* [`scatter_update`](../../api_docs/python/state_ops.md#scatter_update)
* [`sparse_mask`](../../api_docs/python/state_ops.md#sparse_mask)
* [`trainable_variables`](../../api_docs/python/state_ops.md#trainable_variables)
* [`truncated_normal_initializer`](../../api_docs/python/state_ops.md#truncated_normal_initializer)
* [`uniform_unit_scaling_initializer`](../../api_docs/python/state_ops.md#uniform_unit_scaling_initializer)
* [`update_checkpoint_state`](../../api_docs/python/state_ops.md#update_checkpoint_state)
* [`Variable`](../../api_docs/python/state_ops.md#Variable)
* [`variable_axis_size_partitioner`](../../api_docs/python/state_ops.md#variable_axis_size_partitioner)
* [`variable_op_scope`](../../api_docs/python/state_ops.md#variable_op_scope)
* [`variable_scope`](../../api_docs/python/state_ops.md#variable_scope)
* [`VariableScope`](../../api_docs/python/state_ops.md#VariableScope)
* [`zeros_initializer`](../../api_docs/python/state_ops.md#zeros_initializer)
* **[Tensor Transformations](../../api_docs/python/array_ops.md)**:
* [`batch_to_space`](../../api_docs/python/array_ops.md#batch_to_space)
* [`batch_to_space_nd`](../../api_docs/python/array_ops.md#batch_to_space_nd)
* [`bitcast`](../../api_docs/python/array_ops.md#bitcast)
* [`boolean_mask`](../../api_docs/python/array_ops.md#boolean_mask)
* [`cast`](../../api_docs/python/array_ops.md#cast)
* [`concat`](../../api_docs/python/array_ops.md#concat)
* [`depth_to_space`](../../api_docs/python/array_ops.md#depth_to_space)
* [`dynamic_partition`](../../api_docs/python/array_ops.md#dynamic_partition)
* [`dynamic_stitch`](../../api_docs/python/array_ops.md#dynamic_stitch)
* [`expand_dims`](../../api_docs/python/array_ops.md#expand_dims)
* [`extract_image_patches`](../../api_docs/python/array_ops.md#extract_image_patches)
* [`gather`](../../api_docs/python/array_ops.md#gather)
* [`gather_nd`](../../api_docs/python/array_ops.md#gather_nd)
* [`meshgrid`](../../api_docs/python/array_ops.md#meshgrid)
* [`one_hot`](../../api_docs/python/array_ops.md#one_hot)
* [`pack`](../../api_docs/python/array_ops.md#pack)
* [`pad`](../../api_docs/python/array_ops.md#pad)
* [`rank`](../../api_docs/python/array_ops.md#rank)
* [`required_space_to_batch_paddings`](../../api_docs/python/array_ops.md#required_space_to_batch_paddings)
* [`reshape`](../../api_docs/python/array_ops.md#reshape)
* [`reverse`](../../api_docs/python/array_ops.md#reverse)
* [`reverse_sequence`](../../api_docs/python/array_ops.md#reverse_sequence)
* [`saturate_cast`](../../api_docs/python/array_ops.md#saturate_cast)
* [`sequence_mask`](../../api_docs/python/array_ops.md#sequence_mask)
* [`shape`](../../api_docs/python/array_ops.md#shape)
* [`shape_n`](../../api_docs/python/array_ops.md#shape_n)
* [`size`](../../api_docs/python/array_ops.md#size)
* [`slice`](../../api_docs/python/array_ops.md#slice)
* [`space_to_batch`](../../api_docs/python/array_ops.md#space_to_batch)
* [`space_to_batch_nd`](../../api_docs/python/array_ops.md#space_to_batch_nd)
* [`space_to_depth`](../../api_docs/python/array_ops.md#space_to_depth)
* [`split`](../../api_docs/python/array_ops.md#split)
* [`squeeze`](../../api_docs/python/array_ops.md#squeeze)
* [`strided_slice`](../../api_docs/python/array_ops.md#strided_slice)
* [`string_to_number`](../../api_docs/python/array_ops.md#string_to_number)
* [`tile`](../../api_docs/python/array_ops.md#tile)
* [`to_bfloat16`](../../api_docs/python/array_ops.md#to_bfloat16)
* [`to_double`](../../api_docs/python/array_ops.md#to_double)
* [`to_float`](../../api_docs/python/array_ops.md#to_float)
* [`to_int32`](../../api_docs/python/array_ops.md#to_int32)
* [`to_int64`](../../api_docs/python/array_ops.md#to_int64)
* [`transpose`](../../api_docs/python/array_ops.md#transpose)
* [`unique_with_counts`](../../api_docs/python/array_ops.md#unique_with_counts)
* [`unpack`](../../api_docs/python/array_ops.md#unpack)
* **[Math](../../api_docs/python/math_ops.md)**:
* [`abs`](../../api_docs/python/math_ops.md#abs)
* [`accumulate_n`](../../api_docs/python/math_ops.md#accumulate_n)
* [`acos`](../../api_docs/python/math_ops.md#acos)
* [`add`](../../api_docs/python/math_ops.md#add)
* [`add_n`](../../api_docs/python/math_ops.md#add_n)
* [`argmax`](../../api_docs/python/math_ops.md#argmax)
* [`argmin`](../../api_docs/python/math_ops.md#argmin)
* [`asin`](../../api_docs/python/math_ops.md#asin)
* [`atan`](../../api_docs/python/math_ops.md#atan)
* [`batch_matmul`](../../api_docs/python/math_ops.md#batch_matmul)
* [`betainc`](../../api_docs/python/math_ops.md#betainc)
* [`ceil`](../../api_docs/python/math_ops.md#ceil)
* [`cholesky`](../../api_docs/python/math_ops.md#cholesky)
* [`cholesky_solve`](../../api_docs/python/math_ops.md#cholesky_solve)
* [`complex`](../../api_docs/python/math_ops.md#complex)
* [`complex_abs`](../../api_docs/python/math_ops.md#complex_abs)
* [`conj`](../../api_docs/python/math_ops.md#conj)
* [`cos`](../../api_docs/python/math_ops.md#cos)
* [`cross`](../../api_docs/python/math_ops.md#cross)
* [`cumprod`](../../api_docs/python/math_ops.md#cumprod)
* [`cumsum`](../../api_docs/python/math_ops.md#cumsum)
* [`diag`](../../api_docs/python/math_ops.md#diag)
* [`diag_part`](../../api_docs/python/math_ops.md#diag_part)
* [`digamma`](../../api_docs/python/math_ops.md#digamma)
* [`div`](../../api_docs/python/math_ops.md#div)
* [`edit_distance`](../../api_docs/python/math_ops.md#edit_distance)
* [`einsum`](../../api_docs/python/math_ops.md#einsum)
* [`erf`](../../api_docs/python/math_ops.md#erf)
* [`erfc`](../../api_docs/python/math_ops.md#erfc)
* [`exp`](../../api_docs/python/math_ops.md#exp)
* [`fft`](../../api_docs/python/math_ops.md#fft)
* [`fft2d`](../../api_docs/python/math_ops.md#fft2d)
* [`fft3d`](../../api_docs/python/math_ops.md#fft3d)
* [`floor`](../../api_docs/python/math_ops.md#floor)
* [`floordiv`](../../api_docs/python/math_ops.md#floordiv)
* [`ifft`](../../api_docs/python/math_ops.md#ifft)
* [`ifft2d`](../../api_docs/python/math_ops.md#ifft2d)
* [`ifft3d`](../../api_docs/python/math_ops.md#ifft3d)
* [`igamma`](../../api_docs/python/math_ops.md#igamma)
* [`igammac`](../../api_docs/python/math_ops.md#igammac)
* [`imag`](../../api_docs/python/math_ops.md#imag)
* [`inv`](../../api_docs/python/math_ops.md#inv)
* [`invert_permutation`](../../api_docs/python/math_ops.md#invert_permutation)
* [`lbeta`](../../api_docs/python/math_ops.md#lbeta)
* [`lgamma`](../../api_docs/python/math_ops.md#lgamma)
* [`listdiff`](../../api_docs/python/math_ops.md#listdiff)
* [`log`](../../api_docs/python/math_ops.md#log)
* [`matmul`](../../api_docs/python/math_ops.md#matmul)
* [`matrix_band_part`](../../api_docs/python/math_ops.md#matrix_band_part)
* [`matrix_determinant`](../../api_docs/python/math_ops.md#matrix_determinant)
* [`matrix_diag`](../../api_docs/python/math_ops.md#matrix_diag)
* [`matrix_diag_part`](../../api_docs/python/math_ops.md#matrix_diag_part)
* [`matrix_inverse`](../../api_docs/python/math_ops.md#matrix_inverse)
* [`matrix_set_diag`](../../api_docs/python/math_ops.md#matrix_set_diag)
* [`matrix_solve`](../../api_docs/python/math_ops.md#matrix_solve)
* [`matrix_solve_ls`](../../api_docs/python/math_ops.md#matrix_solve_ls)
* [`matrix_transpose`](../../api_docs/python/math_ops.md#matrix_transpose)
* [`matrix_triangular_solve`](../../api_docs/python/math_ops.md#matrix_triangular_solve)
* [`maximum`](../../api_docs/python/math_ops.md#maximum)
* [`minimum`](../../api_docs/python/math_ops.md#minimum)
* [`mod`](../../api_docs/python/math_ops.md#mod)
* [`mul`](../../api_docs/python/math_ops.md#mul)
* [`neg`](../../api_docs/python/math_ops.md#neg)
* [`polygamma`](../../api_docs/python/math_ops.md#polygamma)
* [`pow`](../../api_docs/python/math_ops.md#pow)
* [`real`](../../api_docs/python/math_ops.md#real)
* [`reduce_all`](../../api_docs/python/math_ops.md#reduce_all)
* [`reduce_any`](../../api_docs/python/math_ops.md#reduce_any)
* [`reduce_logsumexp`](../../api_docs/python/math_ops.md#reduce_logsumexp)
* [`reduce_max`](../../api_docs/python/math_ops.md#reduce_max)
* [`reduce_mean`](../../api_docs/python/math_ops.md#reduce_mean)
* [`reduce_min`](../../api_docs/python/math_ops.md#reduce_min)
* [`reduce_prod`](../../api_docs/python/math_ops.md#reduce_prod)
* [`reduce_sum`](../../api_docs/python/math_ops.md#reduce_sum)
* [`round`](../../api_docs/python/math_ops.md#round)
* [`rsqrt`](../../api_docs/python/math_ops.md#rsqrt)
* [`scalar_mul`](../../api_docs/python/math_ops.md#scalar_mul)
* [`segment_max`](../../api_docs/python/math_ops.md#segment_max)
* [`segment_mean`](../../api_docs/python/math_ops.md#segment_mean)
* [`segment_min`](../../api_docs/python/math_ops.md#segment_min)
* [`segment_prod`](../../api_docs/python/math_ops.md#segment_prod)
* [`segment_sum`](../../api_docs/python/math_ops.md#segment_sum)
* [`self_adjoint_eig`](../../api_docs/python/math_ops.md#self_adjoint_eig)
* [`self_adjoint_eigvals`](../../api_docs/python/math_ops.md#self_adjoint_eigvals)
* [`sign`](../../api_docs/python/math_ops.md#sign)
* [`sin`](../../api_docs/python/math_ops.md#sin)
* [`sparse_segment_mean`](../../api_docs/python/math_ops.md#sparse_segment_mean)
* [`sparse_segment_sqrt_n`](../../api_docs/python/math_ops.md#sparse_segment_sqrt_n)
* [`sparse_segment_sum`](../../api_docs/python/math_ops.md#sparse_segment_sum)
* [`sqrt`](../../api_docs/python/math_ops.md#sqrt)
* [`square`](../../api_docs/python/math_ops.md#square)
* [`squared_difference`](../../api_docs/python/math_ops.md#squared_difference)
* [`sub`](../../api_docs/python/math_ops.md#sub)
* [`svd`](../../api_docs/python/math_ops.md#svd)
* [`tan`](../../api_docs/python/math_ops.md#tan)
* [`trace`](../../api_docs/python/math_ops.md#trace)
* [`transpose`](../../api_docs/python/math_ops.md#transpose)
* [`truediv`](../../api_docs/python/math_ops.md#truediv)
* [`unique`](../../api_docs/python/math_ops.md#unique)
* [`unsorted_segment_sum`](../../api_docs/python/math_ops.md#unsorted_segment_sum)
* [`where`](../../api_docs/python/math_ops.md#where)
* [`zeta`](../../api_docs/python/math_ops.md#zeta)
* **[Strings](../../api_docs/python/string_ops.md)**:
* [`as_string`](../../api_docs/python/string_ops.md#as_string)
* [`decode_base64`](../../api_docs/python/string_ops.md#decode_base64)
* [`encode_base64`](../../api_docs/python/string_ops.md#encode_base64)
* [`reduce_join`](../../api_docs/python/string_ops.md#reduce_join)
* [`string_join`](../../api_docs/python/string_ops.md#string_join)
* [`string_split`](../../api_docs/python/string_ops.md#string_split)
* [`string_to_hash_bucket`](../../api_docs/python/string_ops.md#string_to_hash_bucket)
* [`string_to_hash_bucket_fast`](../../api_docs/python/string_ops.md#string_to_hash_bucket_fast)
* [`string_to_hash_bucket_strong`](../../api_docs/python/string_ops.md#string_to_hash_bucket_strong)
* **[Histograms](../../api_docs/python/histogram_ops.md)**:
* [`histogram_fixed_width`](../../api_docs/python/histogram_ops.md#histogram_fixed_width)
* **[Control Flow](../../api_docs/python/control_flow_ops.md)**:
* [`add_check_numerics_ops`](../../api_docs/python/control_flow_ops.md#add_check_numerics_ops)
* [`Assert`](../../api_docs/python/control_flow_ops.md#Assert)
* [`case`](../../api_docs/python/control_flow_ops.md#case)
* [`check_numerics`](../../api_docs/python/control_flow_ops.md#check_numerics)
* [`cond`](../../api_docs/python/control_flow_ops.md#cond)
* [`count_up_to`](../../api_docs/python/control_flow_ops.md#count_up_to)
* [`equal`](../../api_docs/python/control_flow_ops.md#equal)
* [`greater`](../../api_docs/python/control_flow_ops.md#greater)
* [`greater_equal`](../../api_docs/python/control_flow_ops.md#greater_equal)
* [`group`](../../api_docs/python/control_flow_ops.md#group)
* [`identity`](../../api_docs/python/control_flow_ops.md#identity)
* [`is_finite`](../../api_docs/python/control_flow_ops.md#is_finite)
* [`is_inf`](../../api_docs/python/control_flow_ops.md#is_inf)
* [`is_nan`](../../api_docs/python/control_flow_ops.md#is_nan)
* [`less`](../../api_docs/python/control_flow_ops.md#less)
* [`less_equal`](../../api_docs/python/control_flow_ops.md#less_equal)
* [`logical_and`](../../api_docs/python/control_flow_ops.md#logical_and)
* [`logical_not`](../../api_docs/python/control_flow_ops.md#logical_not)
* [`logical_or`](../../api_docs/python/control_flow_ops.md#logical_or)
* [`logical_xor`](../../api_docs/python/control_flow_ops.md#logical_xor)
* [`no_op`](../../api_docs/python/control_flow_ops.md#no_op)
* [`not_equal`](../../api_docs/python/control_flow_ops.md#not_equal)
* [`Print`](../../api_docs/python/control_flow_ops.md#Print)
* [`select`](../../api_docs/python/control_flow_ops.md#select)
* [`tuple`](../../api_docs/python/control_flow_ops.md#tuple)
* [`verify_tensor_all_finite`](../../api_docs/python/control_flow_ops.md#verify_tensor_all_finite)
* [`where`](../../api_docs/python/control_flow_ops.md#where)
* [`while_loop`](../../api_docs/python/control_flow_ops.md#while_loop)
* **[Higher Order Functions](../../api_docs/python/functional_ops.md)**:
* [`foldl`](../../api_docs/python/functional_ops.md#foldl)
* [`foldr`](../../api_docs/python/functional_ops.md#foldr)
* [`map_fn`](../../api_docs/python/functional_ops.md#map_fn)
* [`scan`](../../api_docs/python/functional_ops.md#scan)
* **[TensorArray Operations](../../api_docs/python/tensor_array_ops.md)**:
* [`concat`](../../api_docs/python/tensor_array_ops.md#concat)
* [`gather`](../../api_docs/python/tensor_array_ops.md#gather)
* [`pack`](../../api_docs/python/tensor_array_ops.md#pack)
* [`split`](../../api_docs/python/tensor_array_ops.md#split)
* [`TensorArray`](../../api_docs/python/tensor_array_ops.md#TensorArray)
* [`unpack`](../../api_docs/python/tensor_array_ops.md#unpack)
* **[Tensor Handle Operations](../../api_docs/python/session_ops.md)**:
* [`delete_session_tensor`](../../api_docs/python/session_ops.md#delete_session_tensor)
* [`get_session_handle`](../../api_docs/python/session_ops.md#get_session_handle)
* [`get_session_tensor`](../../api_docs/python/session_ops.md#get_session_tensor)
* **[Images](../../api_docs/python/image.md)**:
* [`adjust_brightness`](../../api_docs/python/image.md#adjust_brightness)
* [`adjust_contrast`](../../api_docs/python/image.md#adjust_contrast)
* [`adjust_hue`](../../api_docs/python/image.md#adjust_hue)
* [`adjust_saturation`](../../api_docs/python/image.md#adjust_saturation)
* [`central_crop`](../../api_docs/python/image.md#central_crop)
* [`convert_image_dtype`](../../api_docs/python/image.md#convert_image_dtype)
* [`crop_and_resize`](../../api_docs/python/image.md#crop_and_resize)
* [`crop_to_bounding_box`](../../api_docs/python/image.md#crop_to_bounding_box)
* [`decode_jpeg`](../../api_docs/python/image.md#decode_jpeg)
* [`decode_png`](../../api_docs/python/image.md#decode_png)
* [`draw_bounding_boxes`](../../api_docs/python/image.md#draw_bounding_boxes)
* [`encode_jpeg`](../../api_docs/python/image.md#encode_jpeg)
* [`encode_png`](../../api_docs/python/image.md#encode_png)
* [`extract_glimpse`](../../api_docs/python/image.md#extract_glimpse)
* [`flip_left_right`](../../api_docs/python/image.md#flip_left_right)
* [`flip_up_down`](../../api_docs/python/image.md#flip_up_down)
* [`grayscale_to_rgb`](../../api_docs/python/image.md#grayscale_to_rgb)
* [`hsv_to_rgb`](../../api_docs/python/image.md#hsv_to_rgb)
* [`non_max_suppression`](../../api_docs/python/image.md#non_max_suppression)
* [`pad_to_bounding_box`](../../api_docs/python/image.md#pad_to_bounding_box)
* [`per_image_whitening`](../../api_docs/python/image.md#per_image_whitening)
* [`random_brightness`](../../api_docs/python/image.md#random_brightness)
* [`random_contrast`](../../api_docs/python/image.md#random_contrast)
* [`random_flip_left_right`](../../api_docs/python/image.md#random_flip_left_right)
* [`random_flip_up_down`](../../api_docs/python/image.md#random_flip_up_down)
* [`random_hue`](../../api_docs/python/image.md#random_hue)
* [`random_saturation`](../../api_docs/python/image.md#random_saturation)
* [`resize_area`](../../api_docs/python/image.md#resize_area)
* [`resize_bicubic`](../../api_docs/python/image.md#resize_bicubic)
* [`resize_bilinear`](../../api_docs/python/image.md#resize_bilinear)
* [`resize_image_with_crop_or_pad`](../../api_docs/python/image.md#resize_image_with_crop_or_pad)
* [`resize_images`](../../api_docs/python/image.md#resize_images)
* [`resize_nearest_neighbor`](../../api_docs/python/image.md#resize_nearest_neighbor)
* [`rgb_to_grayscale`](../../api_docs/python/image.md#rgb_to_grayscale)
* [`rgb_to_hsv`](../../api_docs/python/image.md#rgb_to_hsv)
* [`rot90`](../../api_docs/python/image.md#rot90)
* [`sample_distorted_bounding_box`](../../api_docs/python/image.md#sample_distorted_bounding_box)
* [`transpose_image`](../../api_docs/python/image.md#transpose_image)
* **[Sparse Tensors](../../api_docs/python/sparse_ops.md)**:
* [`shape`](../../api_docs/python/sparse_ops.md#shape)
* [`sparse_add`](../../api_docs/python/sparse_ops.md#sparse_add)
* [`sparse_concat`](../../api_docs/python/sparse_ops.md#sparse_concat)
* [`sparse_fill_empty_rows`](../../api_docs/python/sparse_ops.md#sparse_fill_empty_rows)
* [`sparse_maximum`](../../api_docs/python/sparse_ops.md#sparse_maximum)
* [`sparse_merge`](../../api_docs/python/sparse_ops.md#sparse_merge)
* [`sparse_minimum`](../../api_docs/python/sparse_ops.md#sparse_minimum)
* [`sparse_reduce_sum`](../../api_docs/python/sparse_ops.md#sparse_reduce_sum)
* [`sparse_reduce_sum_sparse`](../../api_docs/python/sparse_ops.md#sparse_reduce_sum_sparse)
* [`sparse_reorder`](../../api_docs/python/sparse_ops.md#sparse_reorder)
* [`sparse_reset_shape`](../../api_docs/python/sparse_ops.md#sparse_reset_shape)
* [`sparse_reshape`](../../api_docs/python/sparse_ops.md#sparse_reshape)
* [`sparse_retain`](../../api_docs/python/sparse_ops.md#sparse_retain)
* [`sparse_softmax`](../../api_docs/python/sparse_ops.md#sparse_softmax)
* [`sparse_split`](../../api_docs/python/sparse_ops.md#sparse_split)
* [`sparse_tensor_dense_matmul`](../../api_docs/python/sparse_ops.md#sparse_tensor_dense_matmul)
* [`sparse_tensor_to_dense`](../../api_docs/python/sparse_ops.md#sparse_tensor_to_dense)
* [`sparse_to_dense`](../../api_docs/python/sparse_ops.md#sparse_to_dense)
* [`sparse_to_indicator`](../../api_docs/python/sparse_ops.md#sparse_to_indicator)
* [`sparse_transpose`](../../api_docs/python/sparse_ops.md#sparse_transpose)
* [`SparseTensor`](../../api_docs/python/sparse_ops.md#SparseTensor)
* [`SparseTensorValue`](../../api_docs/python/sparse_ops.md#SparseTensorValue)
* **[Inputs and Readers](../../api_docs/python/io_ops.md)**:
* [`batch`](../../api_docs/python/io_ops.md#batch)
* [`batch_join`](../../api_docs/python/io_ops.md#batch_join)
* [`ConditionalAccumulator`](../../api_docs/python/io_ops.md#ConditionalAccumulator)
* [`ConditionalAccumulatorBase`](../../api_docs/python/io_ops.md#ConditionalAccumulatorBase)
* [`decode_csv`](../../api_docs/python/io_ops.md#decode_csv)
* [`decode_json_example`](../../api_docs/python/io_ops.md#decode_json_example)
* [`decode_raw`](../../api_docs/python/io_ops.md#decode_raw)
* [`FIFOQueue`](../../api_docs/python/io_ops.md#FIFOQueue)
* [`FixedLenFeature`](../../api_docs/python/io_ops.md#FixedLenFeature)
* [`FixedLengthRecordReader`](../../api_docs/python/io_ops.md#FixedLengthRecordReader)
* [`FixedLenSequenceFeature`](../../api_docs/python/io_ops.md#FixedLenSequenceFeature)
* [`IdentityReader`](../../api_docs/python/io_ops.md#IdentityReader)
* [`input_producer`](../../api_docs/python/io_ops.md#input_producer)
* [`limit_epochs`](../../api_docs/python/io_ops.md#limit_epochs)
* [`match_filenames_once`](../../api_docs/python/io_ops.md#match_filenames_once)
* [`matching_files`](../../api_docs/python/io_ops.md#matching_files)
* [`PaddingFIFOQueue`](../../api_docs/python/io_ops.md#PaddingFIFOQueue)
* [`parse_example`](../../api_docs/python/io_ops.md#parse_example)
* [`parse_single_example`](../../api_docs/python/io_ops.md#parse_single_example)
* [`parse_tensor`](../../api_docs/python/io_ops.md#parse_tensor)
* [`placeholder`](../../api_docs/python/io_ops.md#placeholder)
* [`placeholder_with_default`](../../api_docs/python/io_ops.md#placeholder_with_default)
* [`PriorityQueue`](../../api_docs/python/io_ops.md#PriorityQueue)
* [`QueueBase`](../../api_docs/python/io_ops.md#QueueBase)
* [`RandomShuffleQueue`](../../api_docs/python/io_ops.md#RandomShuffleQueue)
* [`range_input_producer`](../../api_docs/python/io_ops.md#range_input_producer)
* [`read_file`](../../api_docs/python/io_ops.md#read_file)
* [`ReaderBase`](../../api_docs/python/io_ops.md#ReaderBase)
* [`shuffle_batch`](../../api_docs/python/io_ops.md#shuffle_batch)
* [`shuffle_batch_join`](../../api_docs/python/io_ops.md#shuffle_batch_join)
* [`size`](../../api_docs/python/io_ops.md#size)
* [`slice_input_producer`](../../api_docs/python/io_ops.md#slice_input_producer)
* [`sparse_placeholder`](../../api_docs/python/io_ops.md#sparse_placeholder)
* [`SparseConditionalAccumulator`](../../api_docs/python/io_ops.md#SparseConditionalAccumulator)
* [`string_input_producer`](../../api_docs/python/io_ops.md#string_input_producer)
* [`TextLineReader`](../../api_docs/python/io_ops.md#TextLineReader)
* [`TFRecordReader`](../../api_docs/python/io_ops.md#TFRecordReader)
* [`VarLenFeature`](../../api_docs/python/io_ops.md#VarLenFeature)
* [`WholeFileReader`](../../api_docs/python/io_ops.md#WholeFileReader)
* **[Data IO (Python functions)](../../api_docs/python/python_io.md)**:
* [`tf_record_iterator`](../../api_docs/python/python_io.md#tf_record_iterator)
* [`TFRecordWriter`](../../api_docs/python/python_io.md#TFRecordWriter)
* **[Neural Network](../../api_docs/python/nn.md)**:
* [`atrous_conv2d`](../../api_docs/python/nn.md#atrous_conv2d)
* [`avg_pool`](../../api_docs/python/nn.md#avg_pool)
* [`avg_pool3d`](../../api_docs/python/nn.md#avg_pool3d)
* [`batch_normalization`](../../api_docs/python/nn.md#batch_normalization)
* [`bias_add`](../../api_docs/python/nn.md#bias_add)
* [`bidirectional_dynamic_rnn`](../../api_docs/python/nn.md#bidirectional_dynamic_rnn)
* [`bidirectional_rnn`](../../api_docs/python/nn.md#bidirectional_rnn)
* [`compute_accidental_hits`](../../api_docs/python/nn.md#compute_accidental_hits)
* [`conv1d`](../../api_docs/python/nn.md#conv1d)
* [`conv2d`](../../api_docs/python/nn.md#conv2d)
* [`conv2d_transpose`](../../api_docs/python/nn.md#conv2d_transpose)
* [`conv3d`](../../api_docs/python/nn.md#conv3d)
* [`conv3d_transpose`](../../api_docs/python/nn.md#conv3d_transpose)
* [`convolution`](../../api_docs/python/nn.md#convolution)
* [`crelu`](../../api_docs/python/nn.md#crelu)
* [`ctc_beam_search_decoder`](../../api_docs/python/nn.md#ctc_beam_search_decoder)
* [`ctc_greedy_decoder`](../../api_docs/python/nn.md#ctc_greedy_decoder)
* [`ctc_loss`](../../api_docs/python/nn.md#ctc_loss)
* [`depthwise_conv2d`](../../api_docs/python/nn.md#depthwise_conv2d)
* [`depthwise_conv2d_native`](../../api_docs/python/nn.md#depthwise_conv2d_native)
* [`dilation2d`](../../api_docs/python/nn.md#dilation2d)
* [`dropout`](../../api_docs/python/nn.md#dropout)
* [`dynamic_rnn`](../../api_docs/python/nn.md#dynamic_rnn)
* [`elu`](../../api_docs/python/nn.md#elu)
* [`embedding_lookup`](../../api_docs/python/nn.md#embedding_lookup)
* [`embedding_lookup_sparse`](../../api_docs/python/nn.md#embedding_lookup_sparse)
* [`erosion2d`](../../api_docs/python/nn.md#erosion2d)
* [`fixed_unigram_candidate_sampler`](../../api_docs/python/nn.md#fixed_unigram_candidate_sampler)
* [`fractional_avg_pool`](../../api_docs/python/nn.md#fractional_avg_pool)
* [`fractional_max_pool`](../../api_docs/python/nn.md#fractional_max_pool)
* [`in_top_k`](../../api_docs/python/nn.md#in_top_k)
* [`l2_loss`](../../api_docs/python/nn.md#l2_loss)
* [`l2_normalize`](../../api_docs/python/nn.md#l2_normalize)
* [`learned_unigram_candidate_sampler`](../../api_docs/python/nn.md#learned_unigram_candidate_sampler)
* [`local_response_normalization`](../../api_docs/python/nn.md#local_response_normalization)
* [`log_poisson_loss`](../../api_docs/python/nn.md#log_poisson_loss)
* [`log_softmax`](../../api_docs/python/nn.md#log_softmax)
* [`log_uniform_candidate_sampler`](../../api_docs/python/nn.md#log_uniform_candidate_sampler)
* [`max_pool`](../../api_docs/python/nn.md#max_pool)
* [`max_pool3d`](../../api_docs/python/nn.md#max_pool3d)
* [`max_pool_with_argmax`](../../api_docs/python/nn.md#max_pool_with_argmax)
* [`moments`](../../api_docs/python/nn.md#moments)
* [`nce_loss`](../../api_docs/python/nn.md#nce_loss)
* [`normalize_moments`](../../api_docs/python/nn.md#normalize_moments)
* [`pool`](../../api_docs/python/nn.md#pool)
* [`raw_rnn`](../../api_docs/python/nn.md#raw_rnn)
* [`relu`](../../api_docs/python/nn.md#relu)
* [`relu6`](../../api_docs/python/nn.md#relu6)
* [`rnn`](../../api_docs/python/nn.md#rnn)
* [`sampled_softmax_loss`](../../api_docs/python/nn.md#sampled_softmax_loss)
* [`separable_conv2d`](../../api_docs/python/nn.md#separable_conv2d)
* [`sigmoid`](../../api_docs/python/nn.md#sigmoid)
* [`sigmoid_cross_entropy_with_logits`](../../api_docs/python/nn.md#sigmoid_cross_entropy_with_logits)
* [`softmax`](../../api_docs/python/nn.md#softmax)
* [`softmax_cross_entropy_with_logits`](../../api_docs/python/nn.md#softmax_cross_entropy_with_logits)
* [`softplus`](../../api_docs/python/nn.md#softplus)
* [`softsign`](../../api_docs/python/nn.md#softsign)
* [`sparse_softmax_cross_entropy_with_logits`](../../api_docs/python/nn.md#sparse_softmax_cross_entropy_with_logits)
* [`state_saving_rnn`](../../api_docs/python/nn.md#state_saving_rnn)
* [`sufficient_statistics`](../../api_docs/python/nn.md#sufficient_statistics)
* [`tanh`](../../api_docs/python/nn.md#tanh)
* [`top_k`](../../api_docs/python/nn.md#top_k)
* [`uniform_candidate_sampler`](../../api_docs/python/nn.md#uniform_candidate_sampler)
* [`weighted_cross_entropy_with_logits`](../../api_docs/python/nn.md#weighted_cross_entropy_with_logits)
* [`weighted_moments`](../../api_docs/python/nn.md#weighted_moments)
* **[Neural Network RNN Cells](../../api_docs/python/rnn_cell.md)**:
* [`BasicLSTMCell`](../../api_docs/python/rnn_cell.md#BasicLSTMCell)
* [`BasicRNNCell`](../../api_docs/python/rnn_cell.md#BasicRNNCell)
* [`DropoutWrapper`](../../api_docs/python/rnn_cell.md#DropoutWrapper)
* [`EmbeddingWrapper`](../../api_docs/python/rnn_cell.md#EmbeddingWrapper)
* [`GRUCell`](../../api_docs/python/rnn_cell.md#GRUCell)
* [`InputProjectionWrapper`](../../api_docs/python/rnn_cell.md#InputProjectionWrapper)
* [`LSTMCell`](../../api_docs/python/rnn_cell.md#LSTMCell)
* [`LSTMStateTuple`](../../api_docs/python/rnn_cell.md#LSTMStateTuple)
* [`MultiRNNCell`](../../api_docs/python/rnn_cell.md#MultiRNNCell)
* [`OutputProjectionWrapper`](../../api_docs/python/rnn_cell.md#OutputProjectionWrapper)
* [`RNNCell`](../../api_docs/python/rnn_cell.md#RNNCell)
* **[Running Graphs](../../api_docs/python/client.md)**:
* [`AbortedError`](../../api_docs/python/client.md#AbortedError)
* [`AlreadyExistsError`](../../api_docs/python/client.md#AlreadyExistsError)
* [`CancelledError`](../../api_docs/python/client.md#CancelledError)
* [`DataLossError`](../../api_docs/python/client.md#DataLossError)
* [`DeadlineExceededError`](../../api_docs/python/client.md#DeadlineExceededError)
* [`FailedPreconditionError`](../../api_docs/python/client.md#FailedPreconditionError)
* [`get_default_session`](../../api_docs/python/client.md#get_default_session)
* [`InteractiveSession`](../../api_docs/python/client.md#InteractiveSession)
* [`InternalError`](../../api_docs/python/client.md#InternalError)
* [`InvalidArgumentError`](../../api_docs/python/client.md#InvalidArgumentError)
* [`NotFoundError`](../../api_docs/python/client.md#NotFoundError)
* [`OpError`](../../api_docs/python/client.md#OpError)
* [`OutOfRangeError`](../../api_docs/python/client.md#OutOfRangeError)
* [`PermissionDeniedError`](../../api_docs/python/client.md#PermissionDeniedError)
* [`ResourceExhaustedError`](../../api_docs/python/client.md#ResourceExhaustedError)
* [`Session`](../../api_docs/python/client.md#Session)
* [`UnauthenticatedError`](../../api_docs/python/client.md#UnauthenticatedError)
* [`UnavailableError`](../../api_docs/python/client.md#UnavailableError)
* [`UnimplementedError`](../../api_docs/python/client.md#UnimplementedError)
* [`UnknownError`](../../api_docs/python/client.md#UnknownError)
* **[Training](../../api_docs/python/train.md)**:
* [`AdadeltaOptimizer`](../../api_docs/python/train.md#AdadeltaOptimizer)
* [`AdagradDAOptimizer`](../../api_docs/python/train.md#AdagradDAOptimizer)
* [`AdagradOptimizer`](../../api_docs/python/train.md#AdagradOptimizer)
* [`AdamOptimizer`](../../api_docs/python/train.md#AdamOptimizer)
* [`add_queue_runner`](../../api_docs/python/train.md#add_queue_runner)
* [`AggregationMethod`](../../api_docs/python/train.md#AggregationMethod)
* [`assert_global_step`](../../api_docs/python/train.md#assert_global_step)
* [`audio_summary`](../../api_docs/python/train.md#audio_summary)
* [`CheckpointSaverHook`](../../api_docs/python/train.md#CheckpointSaverHook)
* [`ChiefSessionCreator`](../../api_docs/python/train.md#ChiefSessionCreator)
* [`clip_by_average_norm`](../../api_docs/python/train.md#clip_by_average_norm)
* [`clip_by_global_norm`](../../api_docs/python/train.md#clip_by_global_norm)
* [`clip_by_norm`](../../api_docs/python/train.md#clip_by_norm)
* [`clip_by_value`](../../api_docs/python/train.md#clip_by_value)
* [`ClusterSpec`](../../api_docs/python/train.md#ClusterSpec)
* [`Coordinator`](../../api_docs/python/train.md#Coordinator)
* [`do_quantize_training_on_graphdef`](../../api_docs/python/train.md#do_quantize_training_on_graphdef)
* [`exponential_decay`](../../api_docs/python/train.md#exponential_decay)
* [`ExponentialMovingAverage`](../../api_docs/python/train.md#ExponentialMovingAverage)
* [`FtrlOptimizer`](../../api_docs/python/train.md#FtrlOptimizer)
* [`generate_checkpoint_state_proto`](../../api_docs/python/train.md#generate_checkpoint_state_proto)
* [`get_global_step`](../../api_docs/python/train.md#get_global_step)
* [`global_norm`](../../api_docs/python/train.md#global_norm)
* [`global_step`](../../api_docs/python/train.md#global_step)
* [`GradientDescentOptimizer`](../../api_docs/python/train.md#GradientDescentOptimizer)
* [`gradients`](../../api_docs/python/train.md#gradients)
* [`histogram_summary`](../../api_docs/python/train.md#histogram_summary)
* [`image_summary`](../../api_docs/python/train.md#image_summary)
* [`LoggingTensorHook`](../../api_docs/python/train.md#LoggingTensorHook)
* [`LooperThread`](../../api_docs/python/train.md#LooperThread)
* [`merge_all_summaries`](../../api_docs/python/train.md#merge_all_summaries)
* [`merge_summary`](../../api_docs/python/train.md#merge_summary)
* [`MomentumOptimizer`](../../api_docs/python/train.md#MomentumOptimizer)
* [`MonitoredSession`](../../api_docs/python/train.md#MonitoredSession)
* [`MonitoredTrainingSession`](../../api_docs/python/train.md#MonitoredTrainingSession)
* [`NanLossDuringTrainingError`](../../api_docs/python/train.md#NanLossDuringTrainingError)
* [`NanTensorHook`](../../api_docs/python/train.md#NanTensorHook)
* [`Optimizer`](../../api_docs/python/train.md#Optimizer)
* [`QueueRunner`](../../api_docs/python/train.md#QueueRunner)
* [`replica_device_setter`](../../api_docs/python/train.md#replica_device_setter)
* [`RMSPropOptimizer`](../../api_docs/python/train.md#RMSPropOptimizer)
* [`Scaffold`](../../api_docs/python/train.md#Scaffold)
* [`scalar_summary`](../../api_docs/python/train.md#scalar_summary)
* [`Server`](../../api_docs/python/train.md#Server)
* [`SessionCreator`](../../api_docs/python/train.md#SessionCreator)
* [`SessionManager`](../../api_docs/python/train.md#SessionManager)
* [`SessionRunArgs`](../../api_docs/python/train.md#SessionRunArgs)
* [`SessionRunContext`](../../api_docs/python/train.md#SessionRunContext)
* [`SessionRunHook`](../../api_docs/python/train.md#SessionRunHook)
* [`SessionRunValues`](../../api_docs/python/train.md#SessionRunValues)
* [`start_queue_runners`](../../api_docs/python/train.md#start_queue_runners)
* [`StepCounterHook`](../../api_docs/python/train.md#StepCounterHook)
* [`stop_gradient`](../../api_docs/python/train.md#stop_gradient)
* [`StopAtStepHook`](../../api_docs/python/train.md#StopAtStepHook)
* [`summary_iterator`](../../api_docs/python/train.md#summary_iterator)
* [`SummarySaverHook`](../../api_docs/python/train.md#SummarySaverHook)
* [`SummaryWriter`](../../api_docs/python/train.md#SummaryWriter)
* [`Supervisor`](../../api_docs/python/train.md#Supervisor)
* [`WorkerSessionCreator`](../../api_docs/python/train.md#WorkerSessionCreator)
* [`write_graph`](../../api_docs/python/train.md#write_graph)
* [`zero_fraction`](../../api_docs/python/train.md#zero_fraction)
* **[Wraps python functions](../../api_docs/python/script_ops.md)**:
* [`py_func`](../../api_docs/python/script_ops.md#py_func)
* **[Summary Operations](../../api_docs/python/summary.md)**:
* [`scalar`](../../api_docs/python/summary.md#scalar)
* [`tensor_summary`](../../api_docs/python/summary.md#tensor_summary)
* **[Testing](../../api_docs/python/test.md)**:
* [`assert_equal_graph_def`](../../api_docs/python/test.md#assert_equal_graph_def)
* [`compute_gradient`](../../api_docs/python/test.md#compute_gradient)
* [`compute_gradient_error`](../../api_docs/python/test.md#compute_gradient_error)
* [`get_temp_dir`](../../api_docs/python/test.md#get_temp_dir)
* [`is_built_with_cuda`](../../api_docs/python/test.md#is_built_with_cuda)
* [`main`](../../api_docs/python/test.md#main)
* **[BayesFlow Entropy (contrib)](../../api_docs/python/contrib.bayesflow.entropy.md)**:
* [`elbo_ratio`](../../api_docs/python/contrib.bayesflow.entropy.md#elbo_ratio)
* [`entropy_shannon`](../../api_docs/python/contrib.bayesflow.entropy.md#entropy_shannon)
* [`renyi_alpha`](../../api_docs/python/contrib.bayesflow.entropy.md#renyi_alpha)
* [`renyi_ratio`](../../api_docs/python/contrib.bayesflow.entropy.md#renyi_ratio)
* **[BayesFlow Monte Carlo (contrib)](../../api_docs/python/contrib.bayesflow.monte_carlo.md)**:
* [`expectation`](../../api_docs/python/contrib.bayesflow.monte_carlo.md#expectation)
* [`expectation_importance_sampler`](../../api_docs/python/contrib.bayesflow.monte_carlo.md#expectation_importance_sampler)
* [`expectation_importance_sampler_logspace`](../../api_docs/python/contrib.bayesflow.monte_carlo.md#expectation_importance_sampler_logspace)
* **[BayesFlow Stochastic Graph (contrib)](../../api_docs/python/contrib.bayesflow.stochastic_graph.md)**:
* [`surrogate_loss`](../../api_docs/python/contrib.bayesflow.stochastic_graph.md#surrogate_loss)
* **[BayesFlow Stochastic Tensors (contrib)](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md)**:
* [`BaseStochasticTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#BaseStochasticTensor)
* [`BernoulliTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#BernoulliTensor)
* [`BernoulliWithSigmoidPTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#BernoulliWithSigmoidPTensor)
* [`BetaTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#BetaTensor)
* [`BetaWithSoftplusABTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#BetaWithSoftplusABTensor)
* [`BinomialTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#BinomialTensor)
* [`CategoricalTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#CategoricalTensor)
* [`Chi2Tensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#Chi2Tensor)
* [`Chi2WithAbsDfTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#Chi2WithAbsDfTensor)
* [`DirichletMultinomialTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#DirichletMultinomialTensor)
* [`DirichletTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#DirichletTensor)
* [`ExponentialTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#ExponentialTensor)
* [`ExponentialWithSoftplusLamTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#ExponentialWithSoftplusLamTensor)
* [`GammaTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#GammaTensor)
* [`GammaWithSoftplusAlphaBetaTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#GammaWithSoftplusAlphaBetaTensor)
* [`get_current_value_type`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#get_current_value_type)
* [`InverseGammaTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#InverseGammaTensor)
* [`InverseGammaWithSoftplusAlphaBetaTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#InverseGammaWithSoftplusAlphaBetaTensor)
* [`LaplaceTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#LaplaceTensor)
* [`LaplaceWithSoftplusScaleTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#LaplaceWithSoftplusScaleTensor)
* [`MeanValue`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MeanValue)
* [`MixtureTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MixtureTensor)
* [`MultinomialTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MultinomialTensor)
* [`MultivariateNormalCholeskyTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MultivariateNormalCholeskyTensor)
* [`MultivariateNormalDiagPlusVDVTTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MultivariateNormalDiagPlusVDVTTensor)
* [`MultivariateNormalDiagTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MultivariateNormalDiagTensor)
* [`MultivariateNormalDiagWithSoftplusStDevTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MultivariateNormalDiagWithSoftplusStDevTensor)
* [`MultivariateNormalFullTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#MultivariateNormalFullTensor)
* [`NormalTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#NormalTensor)
* [`NormalWithSoftplusSigmaTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#NormalWithSoftplusSigmaTensor)
* [`ObservedStochasticTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#ObservedStochasticTensor)
* [`PoissonTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#PoissonTensor)
* [`QuantizedDistributionTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#QuantizedDistributionTensor)
* [`SampleAndReshapeValue`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#SampleAndReshapeValue)
* [`SampleValue`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#SampleValue)
* [`StochasticTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#StochasticTensor)
* [`StudentTTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#StudentTTensor)
* [`StudentTWithAbsDfSoftplusSigmaTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#StudentTWithAbsDfSoftplusSigmaTensor)
* [`TransformedDistributionTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#TransformedDistributionTensor)
* [`UniformTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#UniformTensor)
* [`value_type`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#value_type)
* [`WishartCholeskyTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#WishartCholeskyTensor)
* [`WishartFullTensor`](../../api_docs/python/contrib.bayesflow.stochastic_tensor.md#WishartFullTensor)
* **[BayesFlow Variational Inference (contrib)](../../api_docs/python/contrib.bayesflow.variational_inference.md)**:
* [`elbo`](../../api_docs/python/contrib.bayesflow.variational_inference.md#elbo)
* [`elbo_with_log_joint`](../../api_docs/python/contrib.bayesflow.variational_inference.md#elbo_with_log_joint)
* [`ELBOForms`](../../api_docs/python/contrib.bayesflow.variational_inference.md#ELBOForms)
* [`register_prior`](../../api_docs/python/contrib.bayesflow.variational_inference.md#register_prior)
* **[CRF (contrib)](../../api_docs/python/contrib.crf.md)**:
* [`crf_binary_score`](../../api_docs/python/contrib.crf.md#crf_binary_score)
* [`crf_log_likelihood`](../../api_docs/python/contrib.crf.md#crf_log_likelihood)
* [`crf_log_norm`](../../api_docs/python/contrib.crf.md#crf_log_norm)
* [`crf_sequence_score`](../../api_docs/python/contrib.crf.md#crf_sequence_score)
* [`crf_unary_score`](../../api_docs/python/contrib.crf.md#crf_unary_score)
* [`CrfForwardRnnCell`](../../api_docs/python/contrib.crf.md#CrfForwardRnnCell)
* [`viterbi_decode`](../../api_docs/python/contrib.crf.md#viterbi_decode)
* **[Statistical distributions (contrib)](../../api_docs/python/contrib.distributions.md)**:
* [`Bernoulli`](../../api_docs/python/contrib.distributions.md#Bernoulli)
* [`BernoulliWithSigmoidP`](../../api_docs/python/contrib.distributions.md#BernoulliWithSigmoidP)
* [`Beta`](../../api_docs/python/contrib.distributions.md#Beta)
* [`BetaWithSoftplusAB`](../../api_docs/python/contrib.distributions.md#BetaWithSoftplusAB)
* [`Binomial`](../../api_docs/python/contrib.distributions.md#Binomial)
* [`Categorical`](../../api_docs/python/contrib.distributions.md#Categorical)
* [`Chi2`](../../api_docs/python/contrib.distributions.md#Chi2)
* [`Chi2WithAbsDf`](../../api_docs/python/contrib.distributions.md#Chi2WithAbsDf)
* [`Dirichlet`](../../api_docs/python/contrib.distributions.md#Dirichlet)
* [`DirichletMultinomial`](../../api_docs/python/contrib.distributions.md#DirichletMultinomial)
* [`Distribution`](../../api_docs/python/contrib.distributions.md#Distribution)
* [`Exponential`](../../api_docs/python/contrib.distributions.md#Exponential)
* [`ExponentialWithSoftplusLam`](../../api_docs/python/contrib.distributions.md#ExponentialWithSoftplusLam)
* [`Gamma`](../../api_docs/python/contrib.distributions.md#Gamma)
* [`GammaWithSoftplusAlphaBeta`](../../api_docs/python/contrib.distributions.md#GammaWithSoftplusAlphaBeta)
* [`InverseGamma`](../../api_docs/python/contrib.distributions.md#InverseGamma)
* [`InverseGammaWithSoftplusAlphaBeta`](../../api_docs/python/contrib.distributions.md#InverseGammaWithSoftplusAlphaBeta)
* [`kl`](../../api_docs/python/contrib.distributions.md#kl)
* [`Laplace`](../../api_docs/python/contrib.distributions.md#Laplace)
* [`LaplaceWithSoftplusScale`](../../api_docs/python/contrib.distributions.md#LaplaceWithSoftplusScale)
* [`matrix_diag_transform`](../../api_docs/python/contrib.distributions.md#matrix_diag_transform)
* [`Mixture`](../../api_docs/python/contrib.distributions.md#Mixture)
* [`Multinomial`](../../api_docs/python/contrib.distributions.md#Multinomial)
* [`MultivariateNormalCholesky`](../../api_docs/python/contrib.distributions.md#MultivariateNormalCholesky)
* [`MultivariateNormalDiag`](../../api_docs/python/contrib.distributions.md#MultivariateNormalDiag)
* [`MultivariateNormalDiagPlusVDVT`](../../api_docs/python/contrib.distributions.md#MultivariateNormalDiagPlusVDVT)
* [`MultivariateNormalDiagWithSoftplusStDev`](../../api_docs/python/contrib.distributions.md#MultivariateNormalDiagWithSoftplusStDev)
* [`MultivariateNormalFull`](../../api_docs/python/contrib.distributions.md#MultivariateNormalFull)
* [`Normal`](../../api_docs/python/contrib.distributions.md#Normal)
* [`normal_conjugates_known_sigma_posterior`](../../api_docs/python/contrib.distributions.md#normal_conjugates_known_sigma_posterior)
* [`normal_conjugates_known_sigma_predictive`](../../api_docs/python/contrib.distributions.md#normal_conjugates_known_sigma_predictive)
* [`NormalWithSoftplusSigma`](../../api_docs/python/contrib.distributions.md#NormalWithSoftplusSigma)
* [`Poisson`](../../api_docs/python/contrib.distributions.md#Poisson)
* [`QuantizedDistribution`](../../api_docs/python/contrib.distributions.md#QuantizedDistribution)
* [`RegisterKL`](../../api_docs/python/contrib.distributions.md#RegisterKL)
* [`StudentT`](../../api_docs/python/contrib.distributions.md#StudentT)
* [`StudentTWithAbsDfSoftplusSigma`](../../api_docs/python/contrib.distributions.md#StudentTWithAbsDfSoftplusSigma)
* [`TransformedDistribution`](../../api_docs/python/contrib.distributions.md#TransformedDistribution)
* [`Uniform`](../../api_docs/python/contrib.distributions.md#Uniform)
* [`WishartCholesky`](../../api_docs/python/contrib.distributions.md#WishartCholesky)
* [`WishartFull`](../../api_docs/python/contrib.distributions.md#WishartFull)
* **[FFmpeg (contrib)](../../api_docs/python/contrib.ffmpeg.md)**:
* [`decode_audio`](../../api_docs/python/contrib.ffmpeg.md#decode_audio)
* [`encode_audio`](../../api_docs/python/contrib.ffmpeg.md#encode_audio)
* **[Framework (contrib)](../../api_docs/python/contrib.framework.md)**:
* [`add_arg_scope`](../../api_docs/python/contrib.framework.md#add_arg_scope)
* [`add_model_variable`](../../api_docs/python/contrib.framework.md#add_model_variable)
* [`arg_scope`](../../api_docs/python/contrib.framework.md#arg_scope)
* [`arg_scoped_arguments`](../../api_docs/python/contrib.framework.md#arg_scoped_arguments)
* [`assert_global_step`](../../api_docs/python/contrib.framework.md#assert_global_step)
* [`assert_or_get_global_step`](../../api_docs/python/contrib.framework.md#assert_or_get_global_step)
* [`assert_same_float_dtype`](../../api_docs/python/contrib.framework.md#assert_same_float_dtype)
* [`assert_scalar_int`](../../api_docs/python/contrib.framework.md#assert_scalar_int)
* [`assign_from_checkpoint`](../../api_docs/python/contrib.framework.md#assign_from_checkpoint)
* [`assign_from_checkpoint_fn`](../../api_docs/python/contrib.framework.md#assign_from_checkpoint_fn)
* [`assign_from_values`](../../api_docs/python/contrib.framework.md#assign_from_values)
* [`assign_from_values_fn`](../../api_docs/python/contrib.framework.md#assign_from_values_fn)
* [`convert_to_tensor_or_sparse_tensor`](../../api_docs/python/contrib.framework.md#convert_to_tensor_or_sparse_tensor)
* [`create_global_step`](../../api_docs/python/contrib.framework.md#create_global_step)
* [`deprecated`](../../api_docs/python/contrib.framework.md#deprecated)
* [`deprecated_arg_values`](../../api_docs/python/contrib.framework.md#deprecated_arg_values)
* [`deprecated_args`](../../api_docs/python/contrib.framework.md#deprecated_args)
* [`get_global_step`](../../api_docs/python/contrib.framework.md#get_global_step)
* [`get_graph_from_inputs`](../../api_docs/python/contrib.framework.md#get_graph_from_inputs)
* [`get_local_variables`](../../api_docs/python/contrib.framework.md#get_local_variables)
* [`get_model_variables`](../../api_docs/python/contrib.framework.md#get_model_variables)
* [`get_or_create_global_step`](../../api_docs/python/contrib.framework.md#get_or_create_global_step)
* [`get_unique_variable`](../../api_docs/python/contrib.framework.md#get_unique_variable)
* [`get_variables`](../../api_docs/python/contrib.framework.md#get_variables)
* [`get_variables_by_name`](../../api_docs/python/contrib.framework.md#get_variables_by_name)
* [`get_variables_by_suffix`](../../api_docs/python/contrib.framework.md#get_variables_by_suffix)
* [`get_variables_to_restore`](../../api_docs/python/contrib.framework.md#get_variables_to_restore)
* [`has_arg_scope`](../../api_docs/python/contrib.framework.md#has_arg_scope)
* [`is_non_decreasing`](../../api_docs/python/contrib.framework.md#is_non_decreasing)
* [`is_numeric_tensor`](../../api_docs/python/contrib.framework.md#is_numeric_tensor)
* [`is_strictly_increasing`](../../api_docs/python/contrib.framework.md#is_strictly_increasing)
* [`is_tensor`](../../api_docs/python/contrib.framework.md#is_tensor)
* [`local_variable`](../../api_docs/python/contrib.framework.md#local_variable)
* [`model_variable`](../../api_docs/python/contrib.framework.md#model_variable)
* [`reduce_sum_n`](../../api_docs/python/contrib.framework.md#reduce_sum_n)
* [`variable`](../../api_docs/python/contrib.framework.md#variable)
* [`VariableDeviceChooser`](../../api_docs/python/contrib.framework.md#VariableDeviceChooser)
* [`with_same_shape`](../../api_docs/python/contrib.framework.md#with_same_shape)
* [`with_shape`](../../api_docs/python/contrib.framework.md#with_shape)
* [`zero_initializer`](../../api_docs/python/contrib.framework.md#zero_initializer)
* **[Graph Editor (contrib)](../../api_docs/python/contrib.graph_editor.md)**:
* [`add_control_inputs`](../../api_docs/python/contrib.graph_editor.md#add_control_inputs)
* [`assign_renamed_collections_handler`](../../api_docs/python/contrib.graph_editor.md#assign_renamed_collections_handler)
* [`bypass`](../../api_docs/python/contrib.graph_editor.md#bypass)
* [`check_cios`](../../api_docs/python/contrib.graph_editor.md#check_cios)
* [`compute_boundary_ts`](../../api_docs/python/contrib.graph_editor.md#compute_boundary_ts)
* [`connect`](../../api_docs/python/contrib.graph_editor.md#connect)
* [`ControlOutputs`](../../api_docs/python/contrib.graph_editor.md#ControlOutputs)
* [`copy`](../../api_docs/python/contrib.graph_editor.md#copy)
* [`copy_op_handler`](../../api_docs/python/contrib.graph_editor.md#copy_op_handler)
* [`copy_with_input_replacements`](../../api_docs/python/contrib.graph_editor.md#copy_with_input_replacements)
* [`detach`](../../api_docs/python/contrib.graph_editor.md#detach)
* [`detach_control_inputs`](../../api_docs/python/contrib.graph_editor.md#detach_control_inputs)
* [`detach_control_outputs`](../../api_docs/python/contrib.graph_editor.md#detach_control_outputs)
* [`detach_inputs`](../../api_docs/python/contrib.graph_editor.md#detach_inputs)
* [`detach_outputs`](../../api_docs/python/contrib.graph_editor.md#detach_outputs)
* [`filter_ops`](../../api_docs/python/contrib.graph_editor.md#filter_ops)
* [`filter_ops_from_regex`](../../api_docs/python/contrib.graph_editor.md#filter_ops_from_regex)
* [`filter_ts`](../../api_docs/python/contrib.graph_editor.md#filter_ts)
* [`filter_ts_from_regex`](../../api_docs/python/contrib.graph_editor.md#filter_ts_from_regex)
* [`get_backward_walk_ops`](../../api_docs/python/contrib.graph_editor.md#get_backward_walk_ops)
* [`get_consuming_ops`](../../api_docs/python/contrib.graph_editor.md#get_consuming_ops)
* [`get_forward_walk_ops`](../../api_docs/python/contrib.graph_editor.md#get_forward_walk_ops)
* [`get_generating_ops`](../../api_docs/python/contrib.graph_editor.md#get_generating_ops)
* [`get_name_scope_ops`](../../api_docs/python/contrib.graph_editor.md#get_name_scope_ops)
* [`get_ops_ios`](../../api_docs/python/contrib.graph_editor.md#get_ops_ios)
* [`get_tensors`](../../api_docs/python/contrib.graph_editor.md#get_tensors)
* [`get_walks_intersection_ops`](../../api_docs/python/contrib.graph_editor.md#get_walks_intersection_ops)
* [`get_walks_union_ops`](../../api_docs/python/contrib.graph_editor.md#get_walks_union_ops)
* [`get_within_boundary_ops`](../../api_docs/python/contrib.graph_editor.md#get_within_boundary_ops)
* [`graph_replace`](../../api_docs/python/contrib.graph_editor.md#graph_replace)
* [`keep_t_if_possible_handler`](../../api_docs/python/contrib.graph_editor.md#keep_t_if_possible_handler)
* [`make_list_of_op`](../../api_docs/python/contrib.graph_editor.md#make_list_of_op)
* [`make_list_of_t`](../../api_docs/python/contrib.graph_editor.md#make_list_of_t)
* [`make_placeholder_from_dtype_and_shape`](../../api_docs/python/contrib.graph_editor.md#make_placeholder_from_dtype_and_shape)
* [`make_placeholder_from_tensor`](../../api_docs/python/contrib.graph_editor.md#make_placeholder_from_tensor)
* [`make_view`](../../api_docs/python/contrib.graph_editor.md#make_view)
* [`make_view_from_scope`](../../api_docs/python/contrib.graph_editor.md#make_view_from_scope)
* [`matcher`](../../api_docs/python/contrib.graph_editor.md#matcher)
* [`op_type`](../../api_docs/python/contrib.graph_editor.md#op_type)
* [`OpMatcher`](../../api_docs/python/contrib.graph_editor.md#OpMatcher)
* [`ops`](../../api_docs/python/contrib.graph_editor.md#ops)
* [`ph`](../../api_docs/python/contrib.graph_editor.md#ph)
* [`placeholder_name`](../../api_docs/python/contrib.graph_editor.md#placeholder_name)
* [`remove_control_inputs`](../../api_docs/python/contrib.graph_editor.md#remove_control_inputs)
* [`replace_t_with_placeholder_handler`](../../api_docs/python/contrib.graph_editor.md#replace_t_with_placeholder_handler)
* [`reroute_a2b`](../../api_docs/python/contrib.graph_editor.md#reroute_a2b)
* [`reroute_a2b_inputs`](../../api_docs/python/contrib.graph_editor.md#reroute_a2b_inputs)
* [`reroute_a2b_outputs`](../../api_docs/python/contrib.graph_editor.md#reroute_a2b_outputs)
* [`reroute_a2b_ts`](../../api_docs/python/contrib.graph_editor.md#reroute_a2b_ts)
* [`reroute_b2a`](../../api_docs/python/contrib.graph_editor.md#reroute_b2a)
* [`reroute_b2a_inputs`](../../api_docs/python/contrib.graph_editor.md#reroute_b2a_inputs)
* [`reroute_b2a_outputs`](../../api_docs/python/contrib.graph_editor.md#reroute_b2a_outputs)
* [`reroute_b2a_ts`](../../api_docs/python/contrib.graph_editor.md#reroute_b2a_ts)
* [`select_ops`](../../api_docs/python/contrib.graph_editor.md#select_ops)
* [`select_ops_and_ts`](../../api_docs/python/contrib.graph_editor.md#select_ops_and_ts)
* [`select_ts`](../../api_docs/python/contrib.graph_editor.md#select_ts)
* [`sgv`](../../api_docs/python/contrib.graph_editor.md#sgv)
* [`sgv_scope`](../../api_docs/python/contrib.graph_editor.md#sgv_scope)
* [`SubGraphView`](../../api_docs/python/contrib.graph_editor.md#SubGraphView)
* [`swap`](../../api_docs/python/contrib.graph_editor.md#swap)
* [`swap_inputs`](../../api_docs/python/contrib.graph_editor.md#swap_inputs)
* [`swap_outputs`](../../api_docs/python/contrib.graph_editor.md#swap_outputs)
* [`swap_ts`](../../api_docs/python/contrib.graph_editor.md#swap_ts)
* [`transform_op_if_inside_handler`](../../api_docs/python/contrib.graph_editor.md#transform_op_if_inside_handler)
* [`transform_op_in_place`](../../api_docs/python/contrib.graph_editor.md#transform_op_in_place)
* [`Transformer`](../../api_docs/python/contrib.graph_editor.md#Transformer)
* [`ts`](../../api_docs/python/contrib.graph_editor.md#ts)
* **[Layers (contrib)](../../api_docs/python/contrib.layers.md)**:
* [`apply_regularization`](../../api_docs/python/contrib.layers.md#apply_regularization)
* [`avg_pool2d`](../../api_docs/python/contrib.layers.md#avg_pool2d)
* [`batch_norm`](../../api_docs/python/contrib.layers.md#batch_norm)
* [`convolution2d`](../../api_docs/python/contrib.layers.md#convolution2d)
* [`convolution2d_in_plane`](../../api_docs/python/contrib.layers.md#convolution2d_in_plane)
* [`convolution2d_transpose`](../../api_docs/python/contrib.layers.md#convolution2d_transpose)
* [`flatten`](../../api_docs/python/contrib.layers.md#flatten)
* [`fully_connected`](../../api_docs/python/contrib.layers.md#fully_connected)
* [`l1_regularizer`](../../api_docs/python/contrib.layers.md#l1_regularizer)
* [`l2_regularizer`](../../api_docs/python/contrib.layers.md#l2_regularizer)
* [`layer_norm`](../../api_docs/python/contrib.layers.md#layer_norm)
* [`max_pool2d`](../../api_docs/python/contrib.layers.md#max_pool2d)
* [`one_hot_encoding`](../../api_docs/python/contrib.layers.md#one_hot_encoding)
* [`optimize_loss`](../../api_docs/python/contrib.layers.md#optimize_loss)
* [`repeat`](../../api_docs/python/contrib.layers.md#repeat)
* [`safe_embedding_lookup_sparse`](../../api_docs/python/contrib.layers.md#safe_embedding_lookup_sparse)
* [`separable_convolution2d`](../../api_docs/python/contrib.layers.md#separable_convolution2d)
* [`stack`](../../api_docs/python/contrib.layers.md#stack)
* [`sum_regularizer`](../../api_docs/python/contrib.layers.md#sum_regularizer)
* [`summarize_activation`](../../api_docs/python/contrib.layers.md#summarize_activation)
* [`summarize_activations`](../../api_docs/python/contrib.layers.md#summarize_activations)
* [`summarize_collection`](../../api_docs/python/contrib.layers.md#summarize_collection)
* [`summarize_tensor`](../../api_docs/python/contrib.layers.md#summarize_tensor)
* [`summarize_tensors`](../../api_docs/python/contrib.layers.md#summarize_tensors)
* [`unit_norm`](../../api_docs/python/contrib.layers.md#unit_norm)
* [`variance_scaling_initializer`](../../api_docs/python/contrib.layers.md#variance_scaling_initializer)
* [`xavier_initializer`](../../api_docs/python/contrib.layers.md#xavier_initializer)
* [`xavier_initializer_conv2d`](../../api_docs/python/contrib.layers.md#xavier_initializer_conv2d)
* **[Learn (contrib)](../../api_docs/python/contrib.learn.md)**:
* [`BaseEstimator`](../../api_docs/python/contrib.learn.md#BaseEstimator)
* [`DNNClassifier`](../../api_docs/python/contrib.learn.md#DNNClassifier)
* [`DNNRegressor`](../../api_docs/python/contrib.learn.md#DNNRegressor)
* [`Estimator`](../../api_docs/python/contrib.learn.md#Estimator)
* [`evaluate`](../../api_docs/python/contrib.learn.md#evaluate)
* [`extract_dask_data`](../../api_docs/python/contrib.learn.md#extract_dask_data)
* [`extract_dask_labels`](../../api_docs/python/contrib.learn.md#extract_dask_labels)
* [`extract_pandas_data`](../../api_docs/python/contrib.learn.md#extract_pandas_data)
* [`extract_pandas_labels`](../../api_docs/python/contrib.learn.md#extract_pandas_labels)
* [`extract_pandas_matrix`](../../api_docs/python/contrib.learn.md#extract_pandas_matrix)
* [`infer`](../../api_docs/python/contrib.learn.md#infer)
* [`LinearClassifier`](../../api_docs/python/contrib.learn.md#LinearClassifier)
* [`LinearRegressor`](../../api_docs/python/contrib.learn.md#LinearRegressor)
* [`ModeKeys`](../../api_docs/python/contrib.learn.md#ModeKeys)
* [`NanLossDuringTrainingError`](../../api_docs/python/contrib.learn.md#NanLossDuringTrainingError)
* [`read_batch_examples`](../../api_docs/python/contrib.learn.md#read_batch_examples)
* [`read_batch_features`](../../api_docs/python/contrib.learn.md#read_batch_features)
* [`read_batch_record_features`](../../api_docs/python/contrib.learn.md#read_batch_record_features)
* [`run_feeds`](../../api_docs/python/contrib.learn.md#run_feeds)
* [`run_n`](../../api_docs/python/contrib.learn.md#run_n)
* [`RunConfig`](../../api_docs/python/contrib.learn.md#RunConfig)
* [`TensorFlowEstimator`](../../api_docs/python/contrib.learn.md#TensorFlowEstimator)
* [`TensorFlowRNNClassifier`](../../api_docs/python/contrib.learn.md#TensorFlowRNNClassifier)
* [`TensorFlowRNNRegressor`](../../api_docs/python/contrib.learn.md#TensorFlowRNNRegressor)
* [`train`](../../api_docs/python/contrib.learn.md#train)
* **[Monitors (contrib)](../../api_docs/python/contrib.learn.monitors.md)**:
* [`BaseMonitor`](../../api_docs/python/contrib.learn.monitors.md#BaseMonitor)
* [`CaptureVariable`](../../api_docs/python/contrib.learn.monitors.md#CaptureVariable)
* [`CheckpointSaver`](../../api_docs/python/contrib.learn.monitors.md#CheckpointSaver)
* [`EveryN`](../../api_docs/python/contrib.learn.monitors.md#EveryN)
* [`ExportMonitor`](../../api_docs/python/contrib.learn.monitors.md#ExportMonitor)
* [`get_default_monitors`](../../api_docs/python/contrib.learn.monitors.md#get_default_monitors)
* [`GraphDump`](../../api_docs/python/contrib.learn.monitors.md#GraphDump)
* [`LoggingTrainable`](../../api_docs/python/contrib.learn.monitors.md#LoggingTrainable)
* [`NanLoss`](../../api_docs/python/contrib.learn.monitors.md#NanLoss)
* [`PrintTensor`](../../api_docs/python/contrib.learn.monitors.md#PrintTensor)
* [`RunHookAdapterForMonitors`](../../api_docs/python/contrib.learn.monitors.md#RunHookAdapterForMonitors)
* [`StepCounter`](../../api_docs/python/contrib.learn.monitors.md#StepCounter)
* [`StopAtStep`](../../api_docs/python/contrib.learn.monitors.md#StopAtStep)
* [`SummarySaver`](../../api_docs/python/contrib.learn.monitors.md#SummarySaver)
* [`SummaryWriterCache`](../../api_docs/python/contrib.learn.monitors.md#SummaryWriterCache)
* [`ValidationMonitor`](../../api_docs/python/contrib.learn.monitors.md#ValidationMonitor)
* **[Losses (contrib)](../../api_docs/python/contrib.losses.md)**:
* [`absolute_difference`](../../api_docs/python/contrib.losses.md#absolute_difference)
* [`add_loss`](../../api_docs/python/contrib.losses.md#add_loss)
* [`compute_weighted_loss`](../../api_docs/python/contrib.losses.md#compute_weighted_loss)
* [`cosine_distance`](../../api_docs/python/contrib.losses.md#cosine_distance)
* [`get_losses`](../../api_docs/python/contrib.losses.md#get_losses)
* [`get_regularization_losses`](../../api_docs/python/contrib.losses.md#get_regularization_losses)
* [`get_total_loss`](../../api_docs/python/contrib.losses.md#get_total_loss)
* [`hinge_loss`](../../api_docs/python/contrib.losses.md#hinge_loss)
* [`log_loss`](../../api_docs/python/contrib.losses.md#log_loss)
* [`mean_pairwise_squared_error`](../../api_docs/python/contrib.losses.md#mean_pairwise_squared_error)
* [`mean_squared_error`](../../api_docs/python/contrib.losses.md#mean_squared_error)
* [`sigmoid_cross_entropy`](../../api_docs/python/contrib.losses.md#sigmoid_cross_entropy)
* [`softmax_cross_entropy`](../../api_docs/python/contrib.losses.md#softmax_cross_entropy)
* [`sparse_softmax_cross_entropy`](../../api_docs/python/contrib.losses.md#sparse_softmax_cross_entropy)
* [`sum_of_pairwise_squares`](../../api_docs/python/contrib.losses.md#sum_of_pairwise_squares)
* [`sum_of_squares`](../../api_docs/python/contrib.losses.md#sum_of_squares)
* **[RNN (contrib)](../../api_docs/python/contrib.rnn.md)**:
* [`AttentionCellWrapper`](../../api_docs/python/contrib.rnn.md#AttentionCellWrapper)
* [`CoupledInputForgetGateLSTMCell`](../../api_docs/python/contrib.rnn.md#CoupledInputForgetGateLSTMCell)
* [`FusedRNNCell`](../../api_docs/python/contrib.rnn.md#FusedRNNCell)
* [`FusedRNNCellAdaptor`](../../api_docs/python/contrib.rnn.md#FusedRNNCellAdaptor)
* [`GridLSTMCell`](../../api_docs/python/contrib.rnn.md#GridLSTMCell)
* [`GRUBlockCell`](../../api_docs/python/contrib.rnn.md#GRUBlockCell)
* [`LayerNormBasicLSTMCell`](../../api_docs/python/contrib.rnn.md#LayerNormBasicLSTMCell)
* [`LSTMBlockCell`](../../api_docs/python/contrib.rnn.md#LSTMBlockCell)
* [`LSTMBlockFusedCell`](../../api_docs/python/contrib.rnn.md#LSTMBlockFusedCell)
* [`LSTMBlockWrapper`](../../api_docs/python/contrib.rnn.md#LSTMBlockWrapper)
* [`stack_bidirectional_dynamic_rnn`](../../api_docs/python/contrib.rnn.md#stack_bidirectional_dynamic_rnn)
* [`stack_bidirectional_rnn`](../../api_docs/python/contrib.rnn.md#stack_bidirectional_rnn)
* [`TimeFreqLSTMCell`](../../api_docs/python/contrib.rnn.md#TimeFreqLSTMCell)
* [`TimeReversedFusedRNN`](../../api_docs/python/contrib.rnn.md#TimeReversedFusedRNN)
* **[Metrics (contrib)](../../api_docs/python/contrib.metrics.md)**:
* [`accuracy`](../../api_docs/python/contrib.metrics.md#accuracy)
* [`aggregate_metric_map`](../../api_docs/python/contrib.metrics.md#aggregate_metric_map)
* [`aggregate_metrics`](../../api_docs/python/contrib.metrics.md#aggregate_metrics)
* [`auc_using_histogram`](../../api_docs/python/contrib.metrics.md#auc_using_histogram)
* [`confusion_matrix`](../../api_docs/python/contrib.metrics.md#confusion_matrix)
* [`set_difference`](../../api_docs/python/contrib.metrics.md#set_difference)
* [`set_intersection`](../../api_docs/python/contrib.metrics.md#set_intersection)
* [`set_size`](../../api_docs/python/contrib.metrics.md#set_size)
* [`set_union`](../../api_docs/python/contrib.metrics.md#set_union)
* [`streaming_accuracy`](../../api_docs/python/contrib.metrics.md#streaming_accuracy)
* [`streaming_auc`](../../api_docs/python/contrib.metrics.md#streaming_auc)
* [`streaming_concat`](../../api_docs/python/contrib.metrics.md#streaming_concat)
* [`streaming_covariance`](../../api_docs/python/contrib.metrics.md#streaming_covariance)
* [`streaming_mean`](../../api_docs/python/contrib.metrics.md#streaming_mean)
* [`streaming_mean_absolute_error`](../../api_docs/python/contrib.metrics.md#streaming_mean_absolute_error)
* [`streaming_mean_cosine_distance`](../../api_docs/python/contrib.metrics.md#streaming_mean_cosine_distance)
* [`streaming_mean_iou`](../../api_docs/python/contrib.metrics.md#streaming_mean_iou)
* [`streaming_mean_relative_error`](../../api_docs/python/contrib.metrics.md#streaming_mean_relative_error)
* [`streaming_mean_squared_error`](../../api_docs/python/contrib.metrics.md#streaming_mean_squared_error)
* [`streaming_pearson_correlation`](../../api_docs/python/contrib.metrics.md#streaming_pearson_correlation)
* [`streaming_percentage_less`](../../api_docs/python/contrib.metrics.md#streaming_percentage_less)
* [`streaming_precision`](../../api_docs/python/contrib.metrics.md#streaming_precision)
* [`streaming_recall`](../../api_docs/python/contrib.metrics.md#streaming_recall)
* [`streaming_recall_at_k`](../../api_docs/python/contrib.metrics.md#streaming_recall_at_k)
* [`streaming_root_mean_squared_error`](../../api_docs/python/contrib.metrics.md#streaming_root_mean_squared_error)
* [`streaming_sensitivity_at_specificity`](../../api_docs/python/contrib.metrics.md#streaming_sensitivity_at_specificity)
* [`streaming_sparse_average_precision_at_k`](../../api_docs/python/contrib.metrics.md#streaming_sparse_average_precision_at_k)
* [`streaming_sparse_precision_at_k`](../../api_docs/python/contrib.metrics.md#streaming_sparse_precision_at_k)
* [`streaming_sparse_recall_at_k`](../../api_docs/python/contrib.metrics.md#streaming_sparse_recall_at_k)
* [`streaming_specificity_at_sensitivity`](../../api_docs/python/contrib.metrics.md#streaming_specificity_at_sensitivity)
* **[Training (contrib)](../../api_docs/python/contrib.training.md)**:
* [`batch_sequences_with_states`](../../api_docs/python/contrib.training.md#batch_sequences_with_states)
* [`bucket`](../../api_docs/python/contrib.training.md#bucket)
* [`bucket_by_sequence_length`](../../api_docs/python/contrib.training.md#bucket_by_sequence_length)
* [`NextQueuedSequenceBatch`](../../api_docs/python/contrib.training.md#NextQueuedSequenceBatch)
* [`resample_at_rate`](../../api_docs/python/contrib.training.md#resample_at_rate)
* [`SequenceQueueingStateSaver`](../../api_docs/python/contrib.training.md#SequenceQueueingStateSaver)
* [`stratified_sample`](../../api_docs/python/contrib.training.md#stratified_sample)
* [`stratified_sample_unknown_dist`](../../api_docs/python/contrib.training.md#stratified_sample_unknown_dist)
* [`weighted_resample`](../../api_docs/python/contrib.training.md#weighted_resample)
* **[Utilities (contrib)](../../api_docs/python/contrib.util.md)**:
* [`constant_value`](../../api_docs/python/contrib.util.md#constant_value)
* [`make_ndarray`](../../api_docs/python/contrib.util.md#make_ndarray)
* [`make_tensor_proto`](../../api_docs/python/contrib.util.md#make_tensor_proto)
* [`ops_used_by_graph_def`](../../api_docs/python/contrib.util.md#ops_used_by_graph_def)
* [`stripped_op_list_for_graph`](../../api_docs/python/contrib.util.md#stripped_op_list_for_graph)
* **[Copying Graph Elements (contrib)](../../api_docs/python/contrib.copy_graph.md)**:
* [`copy_op_to_graph`](../../api_docs/python/contrib.copy_graph.md#copy_op_to_graph)
* [`copy_variable_to_graph`](../../api_docs/python/contrib.copy_graph.md#copy_variable_to_graph)
* [`get_copied_op`](../../api_docs/python/contrib.copy_graph.md#get_copied_op)
| {
"content_hash": "60558f593ddd1c0204062d31ffdea8cc",
"timestamp": "",
"source": "github",
"line_count": 1021,
"max_line_length": 161,
"avg_line_length": 75.03917727717923,
"alnum_prop": 0.6802062259348691,
"repo_name": "ikaee/bfr-attendant",
"id": "b1fdb12342767df1441fc81c86da9ef34c507cdb",
"size": "76615",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "facerecognitionlibrary/jni-build/jni/include/tensorflow/g3doc/api_docs/python/index.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "112228"
},
{
"name": "C++",
"bytes": "14927312"
},
{
"name": "CMake",
"bytes": "115804"
},
{
"name": "CSS",
"bytes": "774"
},
{
"name": "Go",
"bytes": "73471"
},
{
"name": "HTML",
"bytes": "506677"
},
{
"name": "Java",
"bytes": "1265103"
},
{
"name": "JavaScript",
"bytes": "13064"
},
{
"name": "Jupyter Notebook",
"bytes": "1833623"
},
{
"name": "Makefile",
"bytes": "239047"
},
{
"name": "Objective-C",
"bytes": "7056"
},
{
"name": "Objective-C++",
"bytes": "64656"
},
{
"name": "Protocol Buffer",
"bytes": "143092"
},
{
"name": "Python",
"bytes": "14053361"
},
{
"name": "Shell",
"bytes": "271483"
},
{
"name": "TypeScript",
"bytes": "695271"
}
],
"symlink_target": ""
} |
<?php
namespace WellCommerce\Bundle\AppBundle\Service\Tax\Helper;
/**
* Interface TaxHelperInterface
*
* @author Adam Piotrowski <adam@wellcommerce.org>
*/
interface TaxHelperInterface
{
public function calculateNetPrice(float $grossPrice, float $taxRate): float;
}
| {
"content_hash": "8ececd441a8fcc485e7bde6e14530bf1",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 80,
"avg_line_length": 19.857142857142858,
"alnum_prop": 0.7589928057553957,
"repo_name": "diversantvlz/WellCommerce",
"id": "dfe6b3f111aedaee766f5ef2deb55199159216dc",
"size": "567",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/WellCommerce/Bundle/AppBundle/Service/Tax/Helper/TaxHelperInterface.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "2766"
},
{
"name": "CSS",
"bytes": "510559"
},
{
"name": "HTML",
"bytes": "296382"
},
{
"name": "JavaScript",
"bytes": "5595098"
},
{
"name": "PHP",
"bytes": "2691745"
}
],
"symlink_target": ""
} |
import '../../helpers/toggler';
import controller from '../../helpers/controller';
import action from '../../helpers/action';
import eventListener from '../../helpers/eventListener';
function MainNavigation() {
function init() {
}
return {
init,
}
}
controller.add('MainNavigation', MainNavigation);
| {
"content_hash": "ceda5717892199584bb19279eb0e3ae5",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 56,
"avg_line_length": 21,
"alnum_prop": 0.6793650793650794,
"repo_name": "daytona/lds",
"id": "afe1538a1836d8a52cb20fb6a17b1305831729eb",
"size": "316",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lds-styleguide/src/modules/MainNavigation/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "78224"
},
{
"name": "HTML",
"bytes": "76123"
},
{
"name": "JavaScript",
"bytes": "261065"
}
],
"symlink_target": ""
} |
<?php
namespace frontend\tests\functional;
use frontend\tests\FunctionalTester;
class SignupCest
{
protected $formId = '#form-signup';
public function _before(FunctionalTester $I)
{
$I->amOnRoute('site/signup');
}
public function signupWithEmptyFields(FunctionalTester $I)
{
$I->see('Signup', 'h1');
$I->see('Please fill out the following fields to signup:');
$I->submitForm($this->formId, []);
$I->seeValidationError('Username cannot be blank.');
$I->seeValidationError('Email cannot be blank.');
$I->seeValidationError('Password cannot be blank.');
}
public function signupWithWrongEmail(FunctionalTester $I)
{
$I->submitForm(
$this->formId, [
'SignupForm[username]' => 'tester',
'SignupForm[email]' => 'ttttt',
'SignupForm[password]' => 'tester_password',
]
);
$I->dontSee('Username cannot be blank.', '.help-block');
$I->dontSee('Password cannot be blank.', '.help-block');
$I->see('Email is not a valid email address.', '.help-block');
}
public function signupSuccessfully(FunctionalTester $I)
{
$I->submitForm($this->formId, [
'SignupForm[username]' => 'tester',
'SignupForm[email]' => 'tester.email@example.com',
'SignupForm[password]' => 'tester_password',
]);
$I->seeRecord('common\models\User', [
'username' => 'tester',
'email' => 'tester.email@example.com',
'status' => \common\models\User::STATUS_INACTIVE
]);
$I->seeEmailIsSent();
$I->see('Thank you for registration. Please check your inbox for verification email.');
}
}
| {
"content_hash": "ce062fd96e3a3348d06153c03b5bac75",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 95,
"avg_line_length": 30.135593220338983,
"alnum_prop": 0.5736782902137233,
"repo_name": "erycamel/yii2-app-advanced",
"id": "ae35d8a952ff7c256a47a0af246d54f7b29e2e8a",
"size": "1778",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "frontend/tests/functional/SignupCest.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Batchfile",
"bytes": "970"
},
{
"name": "CSS",
"bytes": "3820"
},
{
"name": "Dockerfile",
"bytes": "327"
},
{
"name": "PHP",
"bytes": "117053"
},
{
"name": "Shell",
"bytes": "3176"
}
],
"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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.kie</groupId>
<artifactId>kie-dmn</artifactId>
<version>8.15.0-SNAPSHOT</version>
</parent>
<artifactId>kie-dmn-openapi</artifactId>
<name>KIE :: Decision Model Notation :: OpenAPI (OAS) utilities</name>
<description>Internal utility to generate OpenAPI (OAS) schema and related metadata information</description>
<properties>
<java.module.name>org.kie.dmn.openapi</java.module.name>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-dmn-core</artifactId>
<classifier>tests</classifier>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.smallrye</groupId>
<artifactId>smallrye-open-api-core</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-dmn-api</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-dmn-model</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-dmn-feel</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-dmn-core</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- prepare for JDK11 -->
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-xjc</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-dmn-core</artifactId>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.networknt</groupId>
<artifactId>json-schema-validator</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| {
"content_hash": "af0ac13fc364036ef5f6f763b66b6cfc",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 205,
"avg_line_length": 30.635514018691588,
"alnum_prop": 0.6510067114093959,
"repo_name": "manstis/drools",
"id": "7876786ae69f8e57419e5c215e2b1fcd81134b45",
"size": "3278",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "kie-dmn/kie-dmn-openapi/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "16697"
},
{
"name": "Batchfile",
"bytes": "2554"
},
{
"name": "CSS",
"bytes": "1412"
},
{
"name": "GAP",
"bytes": "198078"
},
{
"name": "HTML",
"bytes": "6163"
},
{
"name": "Java",
"bytes": "36835383"
},
{
"name": "Python",
"bytes": "4555"
},
{
"name": "Ruby",
"bytes": "491"
},
{
"name": "Shell",
"bytes": "1120"
},
{
"name": "XSLT",
"bytes": "24302"
}
],
"symlink_target": ""
} |
Rails.application.routes.draw do
match 'users/change_password', to: "users#change_password", via: [:get,:post]
match 'users/roles', to: 'users#roles', via: [:get,:post]
resource :users, only: [:create, :reset_password, :set_role, :set_status], via: [:post,:get]
get 'session', to: 'sessions#destroy'
resource :session
match ':controller(/:action(/:id))', via: [:get, :post], controller: /[^\/]+_configurations/, id: /[^\/]+/
match ':controller(/:action(/:id))', via: [:get, :post]
root 'patients#index'
end
| {
"content_hash": "6bba8f57bac8f5b421713f72aa0cadca",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 108,
"avg_line_length": 43.75,
"alnum_prop": 0.64,
"repo_name": "RSNA/isn-edge-server-token",
"id": "f9622f357cd55b6e39469f969153cecee6787721",
"size": "525",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "config/routes.rb",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "71135"
},
{
"name": "Gherkin",
"bytes": "11112"
},
{
"name": "HTML",
"bytes": "68605"
},
{
"name": "JavaScript",
"bytes": "23503"
},
{
"name": "Ruby",
"bytes": "243073"
},
{
"name": "Shell",
"bytes": "2116"
}
],
"symlink_target": ""
} |
The purpose of this funding opportunity is to fund direct services for victims of crime under at least one of the three following focus areas: child abuse (minors and adults survivors of child abuse), financial crime, and impaired driving. Applicants may request a minimum of \$75,000 to a maximum of \$500,000 in federal funding for use over a 12-month period. The term of the grant agreement will commence upon its effective date. Based on program performance and fund availability, ICJIA may recommend allocation of funding to support an additional 24 months.
##FOCUS AREAS:
###Child Abuse:
Crimes committed by a parent, immediate family member, person responsible for the child's welfare, individual residing in the same home as the child, or a paramour of the child's parent in violation of Illinois criminal statutes that result in physical or emotional harm to a minor. Covered in this funding opportunity will be minor victims and adult survivors of child abuse as defined here.
Child trafficking and involuntary servitude and bullying will not be addressed with this opportunity.
Childhood exposure to violence is not the primary intent of this opportunity, however, services for such secondary victimization are allowable if the need is identified during the provision of child abuse services.
###Financial Crime:
Identity theft or the financial exploitation of elders and persons with disabilities.
###Impaired Driving:
Impaired driving occurs when a driver operates a motor vehicle while under the influence of alcohol, drugs, or other intoxicating compounds. This funding opportunity serves victims of motor vehicle accidents caused by impaired drivers and victims of motor vehicle accidents caused by drivers using electronic communication or video devices while driving which result in death or great bodily harm.
See [Notice of Funding Opportunity](UNMETNEEDSNOFOwattachments.pdf), for program design, staff, and training requirements.
##ELIGIBILITY
###Ineligible agencies
The following types of agencies are NOT eligible for this funding opportunity:
- Criminal justice entities, such as law enforcement, prosecution and/or court-referred services such as Court Appointed Special Advocates (CASA). Funding for criminal justice-based victim services may be offered in a future funding opportunity.
- Under the Child Abuse Focus Area, sub-recipients of funding from Child Advocacy Centers of Illinois, the Illinois Coalition of Domestic Violence, and of the Illinois Coalition Against Sexual Assault are not eligible for funding.
###Eligible agencies and GATA compliance
This solicitation is open to Illinois public agencies and non-profits that have completed the GATA pre-qualification process and received approval of their ICQ from a state cognizant agency by the date of application. In addition, applicants must meet the VOCA eligibility criteria listed on pages 23-25 of the Notice of Funding Opportunity.
Please note applicants must Pre-register and obtain an approved Internal Control Questionnaire
####Pre- Registration
All applicants must be pre-qualified through the Grant Accountability and Transparency Act (GATA) Grantee Portal, http://www.grants.illinois.gov. During pre-qualification, Dun and Bradstreet verifications are performed, including a check of Debarred and Suspended status and good standing with the Illinois Secretary of State.
####Approved Internal Control Questionnaire
The pre-qualification process also includes a financial and administrative risk assessment using an Internal Controls Questionnaire (ICQ). The ICQ must be submitted through the GATA portal and approved by a State cognizant agency by the date of application submission in order for an application to be reviewed. All applications will be pre-screened for completeness and ICQ approval. Applications from agencies that do not have an approved ICQ will not be reviewed.
##NOTICE OF FUNDING OPPORTUNITY
Read the Notice of Funding Opportunity at https://grants.icjia.cloud/.
###Deadline
Applications are due at 11:59 p.m., Monday, July 19, 2017. Completed application materials must be emailed to [cja.vocagrantsunit@illinois.gov](cja.vocagrantsunit@illinois.gov).
###NOTICE OF INTENT
Agencies interested in submitting an application MUST complete an online Notice of Intent form by 11:59 p.m., July 7, 2017.
[NOTICE OF INTENT ](https://www.surveygizmo.com/s3/3570808/VOCA-Child-Abuse-Financial-Crime-and-Impaired-Driving-Notice-of-Intent)
####Available Funds
Applicants may request a minimum of \$75,000 to a maximum of $500,000 in federal funding for use over a 12-month period. Agreements that result from this funding opportunity are contingent upon and subject to the availability of funds.
####Period of Performance
The projected period of performance for awards resulting from this opportunity is October 1, 2017, through September 30, 2018. Contingent on satisfactory performance, ICJIA may support 24 additional months of funding for each project.
####Contact Information
Questions may be submitted via email at [cja.vocagrantsunit@illinois.gov](cja.vocagrantsunit@illinois.gov).
The deadline for submitting questions is 11:59 p.m., July 10, 2017. All substantive questions and responses will be posted on the Authority website at https://gata.icjia.cloud/. Due to the competitive nature of this solicitation, applicants may not discuss this opportunity directly or indirectly with any Authority employee other than the respondent of this email address. Only written answers to
questions shall be binding on the state.
###Mandatory Applicant Technical Assistance Video
Applicants must view a mandatory pre-recorded video on the ICJIA website at https://grants.icjia.cloud/. The webinar will be available for viewing beginning at 1:30 p.m. on June 5, 2017. The applicant must certify viewing this recording. Information provided during this video will be unofficial and not binding on the State.
[VIEW MANDATORY TECHNICAL ASSISTANCE VIDEO](https://www.youtube.com/channel/UCtZMzk8D3P4OixYTwsfPeKA)
[WEBINAR CERTIFICATION](https://www.surveygizmo.com/s3/3606957/NOFO-VOCA-Child-Abuse-Financial-Crime-and-Impaired-Driving-Technical-Assistance-Webinar-Certification)
##TIMELINE:
|Task| |Date|
|----------| |:---------|
|Release of NOFO and open application period| |June 5, 2017|
|Notice of Intent due| |July 7, 2017|
|Last date for question submission| |July 10, 2017|
|Application deadline| |11:59 p.m., Monday July 19, 2017|
|Budget Committee review| |September 28, 2017|
|Award and rejection letters sent| |By September 28, 2017|
|Start Program Performance Period| |October 1, 2017|
###Reporting
Funded agencies will be required to submit to ICJIA quarterly fiscal and data reports.
##APPLICATION MATERIALS:
Completed application materials must be emailed to cja.vocagrantsunit@illinois.gov by 11:59 p.m., July 19, 2017, to be considered for funding. Proposals will not be accepted by mail, fax, or in-person. Incomplete applications will not be reviewed. Late submissions will not be reviewed.
Agencies are encouraged to submit their applications 72 hours in advance of the deadline to avoid unforeseen technical difficulties. Technical difficulties should be reported immediately to ICJIA at cja.vocagrantsunit@illinois.gov.
####Required documents####
|Document| |PDF| |Word| |Excel|
|------------| |:------------:| |:-----------:| |----------:|
|Completed and signed Uniform State Grant Application for each agency requesting funding. This document will need to be signed and scanned.| |X|
|Completed Program Narrative in Word that meets program requirements outlined in Section A. Applicant’s narrative must be submitted in Word and formatted in the posted Program Narrative. Application should be 20 pages maximum, drafted in Times New Roman 12-point font and double-spaced with 1 inch margins. Please number pages.|| | |X|
|Completed VOCA SAR form| |X|
|One completed Budget/Budget Narrative in Excel for each funded agency.| | | | | |X|
|Completed Logic Model| | | |X|
####Additional Documents
The following documents are required to facilitate efficient grant processing but will not be used in determining eligibility.
|Document| |PDF| |Word| |Excel|
|------------| |:------------:| |:-----------:| |----------:|
|Completed Eligibility Requirements Certification Form| |X|
|Completed Self-Certification form| |X|
|Completed Fiscal Information Sheet-leave award amount and agreement number blank| |X|
|Completed and signed Audit Information Sheet-leave award amount and agreement number blank| |X|
|Completed and signed Debarment certification| |X|
|Completed and signed EEOP certifications| |X|
|Completed Civil Rights certifications| |X|
|Programmatic Risk Assessment. This Excel document will need to be submitted unsigned electronically with the application. A signed scanned version will be due if application is approved for funding.| | | | | |X|
|Non-supplanting Certification| |X|
|Mandatory Forms Checklist| |X|
####Non-Profit Agency Required Documents####
|Document| |PDF| |Word| |Excel|
|------------| |:------------:| |:-----------:| |----------:|
|United States Internal Revenue Service 501(c)(3) determination letter for nonprofit organizations.| |X|
|Self-Report Statement of Faith Based Organization| |X|
|Proof of Good Standing from the Illinois Secretary of State| |X|
###Download application documents
[Uniform Application](ICJIAUniformApplicationforGrantAssistanceVOCAUnmetNeeds052617.docx)
[Unmet Needs Program Narrative](UnmetNeedsProposalNarrative.docx)
[Uniform Budget Template](ICJIAVOCAUnmetNeedsNOFObudgetbudgetnarrativetemplate052617.xlsx)
[VOCA SAR Form](VOCASAR.docx)
[Self-Certification](SelfCertification.docx)
[Fiscal Info Sheet](FiscsalInforamtionSheet.docx)
[Audit Info Sheet](AuditinfoSheet.docx)
[Certification on Lobbying, Debarment etc](CertfiicationLobbyingDebarmentallgrants.ped)
[EEOP Certificate](EEOPCert.docx)
[Civil Rights Compliance Certificate](CivilRightsComplianceCertification.docx)
[Non supplanting Certificate](Non-supplantingCertificationallgrants.docx)
[Mandatory Forms Checklist](MandatoryFormsChecklist.docx)
[Faith Based Self Report Form](FaithBasedOrganizationSelfReport.docx)
[LogicModel](LogicModel.docx)
[Programmatic Risk Assessment Questionnaire](ProgrammaticRiskAssessmentQuestionnaire.xlsx)
| {
"content_hash": "b0049b0a2dd113186f27bc1f4cea632f",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 562,
"avg_line_length": 71.4041095890411,
"alnum_prop": 0.7854196642685851,
"repo_name": "ICJIA/icjia-gata",
"id": "06939cff2a976856c19c278bdcf9e99b6e48eebb",
"size": "10567",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "static/grants/2017UnmetNeeds/ICJIAunmetNeedsWebcontentrevised070617.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "52120"
},
{
"name": "HTML",
"bytes": "76230"
},
{
"name": "JavaScript",
"bytes": "58119"
},
{
"name": "Vue",
"bytes": "532841"
}
],
"symlink_target": ""
} |
#include <stdint.h>
#include "iostat_darwin.h"
#define IOKIT 1 /* to get io_name_t in device_types.h */
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOBlockStorageDriver.h>
#include <IOKit/storage/IOMedia.h>
#include <IOKit/IOBSD.h>
static int getdrivestat(io_registry_entry_t d, DriveStats *stat);
static int fillstat(io_registry_entry_t d, DriveStats *stat);
int
readdrivestat(DriveStats a[], int n)
{
mach_port_t port;
CFMutableDictionaryRef match;
io_iterator_t drives;
io_registry_entry_t d;
kern_return_t status;
int na, rv;
IOMasterPort(bootstrap_port, &port);
match = IOServiceMatching("IOMedia");
CFDictionaryAddValue(match, CFSTR(kIOMediaWholeKey), kCFBooleanTrue);
status = IOServiceGetMatchingServices(port, match, &drives);
if(status != KERN_SUCCESS)
return -1;
na = 0;
while(na < n && (d=IOIteratorNext(drives)) > 0){
rv = getdrivestat(d, &a[na]);
if(rv < 0)
return -1;
if(rv > 0)
na++;
IOObjectRelease(d);
}
IOObjectRelease(drives);
return na;
}
static int
getdrivestat(io_registry_entry_t d, DriveStats *stat)
{
io_registry_entry_t parent;
kern_return_t status;
CFDictionaryRef props;
CFStringRef name;
CFNumberRef num;
int rv;
memset(stat, 0, sizeof *stat);
status = IORegistryEntryGetParentEntry(d, kIOServicePlane, &parent);
if(status != KERN_SUCCESS)
return -1;
if(!IOObjectConformsTo(parent, "IOBlockStorageDriver")){
IOObjectRelease(parent);
return 0;
}
status = IORegistryEntryCreateCFProperties(d, (CFMutableDictionaryRef *)&props, kCFAllocatorDefault, kNilOptions);
if(status != KERN_SUCCESS){
IOObjectRelease(parent);
return -1;
}
name = (CFStringRef)CFDictionaryGetValue(props, CFSTR(kIOBSDNameKey));
CFStringGetCString(name, stat->name, NAMELEN, CFStringGetSystemEncoding());
num = (CFNumberRef)CFDictionaryGetValue(props, CFSTR(kIOMediaSizeKey));
CFNumberGetValue(num, kCFNumberSInt64Type, &stat->size);
num = (CFNumberRef)CFDictionaryGetValue(props, CFSTR(kIOMediaPreferredBlockSizeKey));
CFNumberGetValue(num, kCFNumberSInt64Type, &stat->blocksize);
CFRelease(props);
rv = fillstat(parent, stat);
IOObjectRelease(parent);
if(rv < 0)
return -1;
return 1;
}
static struct {
char *key;
size_t off;
} statstab[] = {
{kIOBlockStorageDriverStatisticsBytesReadKey, offsetof(DriveStats, read)},
{kIOBlockStorageDriverStatisticsBytesWrittenKey, offsetof(DriveStats, written)},
{kIOBlockStorageDriverStatisticsReadsKey, offsetof(DriveStats, nread)},
{kIOBlockStorageDriverStatisticsWritesKey, offsetof(DriveStats, nwrite)},
{kIOBlockStorageDriverStatisticsTotalReadTimeKey, offsetof(DriveStats, readtime)},
{kIOBlockStorageDriverStatisticsTotalWriteTimeKey, offsetof(DriveStats, writetime)},
{kIOBlockStorageDriverStatisticsLatentReadTimeKey, offsetof(DriveStats, readlat)},
{kIOBlockStorageDriverStatisticsLatentWriteTimeKey, offsetof(DriveStats, writelat)},
};
static int
fillstat(io_registry_entry_t d, DriveStats *stat)
{
CFDictionaryRef props, v;
CFNumberRef num;
kern_return_t status;
typeof(statstab[0]) *bp, *ep;
status = IORegistryEntryCreateCFProperties(d, (CFMutableDictionaryRef *)&props, kCFAllocatorDefault, kNilOptions);
if(status != KERN_SUCCESS)
return -1;
v = (CFDictionaryRef)CFDictionaryGetValue(props, CFSTR(kIOBlockStorageDriverStatisticsKey));
if(v == NULL){
CFRelease(props);
return -1;
}
ep = &statstab[sizeof(statstab)/sizeof(statstab[0])];
for(bp = &statstab[0]; bp < ep; bp++){
CFStringRef s;
s = CFStringCreateWithCString(kCFAllocatorDefault, bp->key, CFStringGetSystemEncoding());
num = (CFNumberRef)CFDictionaryGetValue(v, s);
if(num)
CFNumberGetValue(num, kCFNumberSInt64Type, ((char*)stat)+bp->off);
CFRelease(s);
}
CFRelease(props);
return 0;
}
| {
"content_hash": "0266dbc237ee378840110c3cada309a2",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 115,
"avg_line_length": 29.515625,
"alnum_prop": 0.7551614610905241,
"repo_name": "knweiss/node_exporter",
"id": "4371ea491edd45e7fd3201d706965e89753d8ef7",
"size": "3778",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "vendor/github.com/lufia/iostat/iostat_darwin.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "3845"
},
{
"name": "Go",
"bytes": "332844"
},
{
"name": "Makefile",
"bytes": "3001"
},
{
"name": "Python",
"bytes": "7250"
},
{
"name": "Shell",
"bytes": "14936"
}
],
"symlink_target": ""
} |
/**
*
*/
package com.varone.web.resource;
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import org.apache.log4j.Logger;
import com.google.gson.Gson;
import com.varone.web.exception.VarOneException;
import com.varone.web.exception.VarOneExceptionParser;
import com.varone.web.facade.SparkMonitorFacade;
import com.varone.web.vo.DefaultNodeVO;
/**
* @author allen
*
*/
@Produces(MediaType.APPLICATION_JSON)
@Path("/nodes")
public class NodeResource {
private Logger logger = Logger.getLogger(NodeResource.class.getName());
@GET
@Path("/")
public String fetchNodes(){
logger.info("start fetchNodes method ...");
try{
SparkMonitorFacade facade = new SparkMonitorFacade();
List<String> nodes = facade.getNodeLists();
Gson gson = new Gson();
String toJson = gson.toJson(nodes);
logger.debug("toJson = " + toJson);
logger.info("finish fetchNodes method ...");
return toJson;
}catch(Exception e){
VarOneExceptionParser parser = new VarOneExceptionParser();
String errorMessage = parser.parse(e);
logger.error(errorMessage);
throw new VarOneException(errorMessage);
}
}
@GET
@Path("/{node}")
public String fetchNodeDashBoard(@PathParam("node") String node,
@QueryParam("metrics") String metrics, @QueryParam("period") String period){
logger.info("start fetchNodeDashBoard method ...");
logger.debug("node = " + node + " metrics = " + metrics + " period = " + period);
try{
SparkMonitorFacade facade = new SparkMonitorFacade();
List<String> metricsAsList = new ArrayList<String>();
if(metrics != null){
String[] metricsArr = metrics.split(",");
for(String metric: metricsArr){
if(!metric.trim().equals(""))
metricsAsList.add(metric);
}
}
DefaultNodeVO nodeDashBoard = facade.getNodeDashBoard(node, metricsAsList, period);
Gson gson = new Gson();
String toJson = gson.toJson(nodeDashBoard);
logger.debug("toJson = " + toJson);
logger.info("finish fetchNodeDashBoard method ...");
return toJson;
}catch(Exception e){
VarOneExceptionParser parser = new VarOneExceptionParser();
String errorMessage = parser.parse(e);
logger.error(errorMessage);
throw new VarOneException(errorMessage);
}
}
}
| {
"content_hash": "b5e283c10cfe1c05bbf06f08c5e2a564",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 86,
"avg_line_length": 29.641975308641975,
"alnum_prop": 0.7109537692628072,
"repo_name": "SparkMonitor/varOne",
"id": "44fce4b22987f5c3836da6d5ff9759315234153d",
"size": "2401",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "varOne-server/src/main/java/com/varone/web/resource/NodeResource.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7525"
},
{
"name": "HTML",
"bytes": "1756"
},
{
"name": "Java",
"bytes": "286153"
},
{
"name": "JavaScript",
"bytes": "102439"
},
{
"name": "Protocol Buffer",
"bytes": "1958"
},
{
"name": "Shell",
"bytes": "5893"
}
],
"symlink_target": ""
} |
'use strict';
var path = require('path');
var ComponentGenerator = require('../component-generator');
var RatUtils = require('../../utils/rat-utils');
function ControllerGenerator() {
ComponentGenerator.apply(this, arguments);
this.componentType = 'controller';
this.argument('controllerName', {
type: String,
require: true
});
}
ControllerGenerator.prototype.initializing = function() {
ControllerGenerator.__super__.initializing.call(this);
this.componentInfo = RatUtils.generateControllerNames(this.controllerName, this.appPrefix);
};
ControllerGenerator.prototype.prompting = function() {
ControllerGenerator.__super__.prompting.call(this);
};
ControllerGenerator.prototype.configuring = function() {
ControllerGenerator.__super__.configuring.call(this);
// Custom stuff goes here
this.componentOutputPath = path.join(this.relativeDestinationPath, this.componentInfo.fileName);
this.templates.push({
sourcePath: path.join(this.componentType, '_' + this.componentType + '.ts'),
outputPath: this.componentOutputPath
});
};
ControllerGenerator.prototype.writting = function() {
ControllerGenerator.__super__.writting.call(this);
};
module.exports = ComponentGenerator.extend(ControllerGenerator.prototype);
| {
"content_hash": "8622c69b54c618bb1358599880fdbdb3",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 98,
"avg_line_length": 30,
"alnum_prop": 0.7484126984126984,
"repo_name": "ealves-pt/G-RAT",
"id": "c7158508a470cc312a111927d72fc0fa9d98e2a7",
"size": "1260",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "generators/controller/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "608"
},
{
"name": "JavaScript",
"bytes": "42553"
},
{
"name": "TypeScript",
"bytes": "18713"
}
],
"symlink_target": ""
} |
<?php
namespace PHPExiftool\Driver\Tag\Qualcomm;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class LADetect extends AbstractTag
{
protected $Id = 'la_detect';
protected $Name = 'LADetect';
protected $FullName = 'Qualcomm::Main';
protected $GroupName = 'Qualcomm';
protected $g0 = 'MakerNotes';
protected $g1 = 'Qualcomm';
protected $g2 = 'Camera';
protected $Type = '?';
protected $Writable = false;
protected $Description = 'LA Detect';
protected $flag_Permanent = true;
}
| {
"content_hash": "76c5f5f88a342a6cbef0b98a3fc2179b",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 46,
"avg_line_length": 16.43243243243243,
"alnum_prop": 0.6611842105263158,
"repo_name": "romainneutron/PHPExiftool",
"id": "6f03808d41395f88d31c6bcee057c14e46be1fd6",
"size": "830",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/PHPExiftool/Driver/Tag/Qualcomm/LADetect.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "22042446"
}
],
"symlink_target": ""
} |
for i in /Applications/*
do
soft_plist="$i"/Contents/Info.plist
if [[ -f $soft_plist ]]; then
/usr/libexec/plistbuddy -c Print:CFBundleExecutable: "$i"/Contents/Info.plist
/usr/libexec/plistbuddy -c Print:CFBundleShortVersionString: "$i"/Contents/Info.plist
else
echo $soft_plist
fi
done
| {
"content_hash": "97b8475f86ed155f428db44e4e8f5eca",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 88,
"avg_line_length": 30.7,
"alnum_prop": 0.7100977198697068,
"repo_name": "sharkspeed/dororis",
"id": "dbb69212d13a34aa0d1934c10281f7d6c518cb02",
"size": "307",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "languages/little_code/applescript/tmp/show_apps.sh",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Agda",
"bytes": "152"
},
{
"name": "AppleScript",
"bytes": "4936"
},
{
"name": "Assembly",
"bytes": "6654"
},
{
"name": "C",
"bytes": "568507"
},
{
"name": "C#",
"bytes": "2446"
},
{
"name": "C++",
"bytes": "15567"
},
{
"name": "CSS",
"bytes": "74090"
},
{
"name": "Clojure",
"bytes": "986"
},
{
"name": "CoffeeScript",
"bytes": "1055"
},
{
"name": "Crystal",
"bytes": "13171"
},
{
"name": "Dart",
"bytes": "22343"
},
{
"name": "Elixir",
"bytes": "27938"
},
{
"name": "Fortran",
"bytes": "400"
},
{
"name": "Go",
"bytes": "117383"
},
{
"name": "HTML",
"bytes": "780346"
},
{
"name": "Haskell",
"bytes": "33977"
},
{
"name": "Idris",
"bytes": "167"
},
{
"name": "Java",
"bytes": "105613"
},
{
"name": "JavaScript",
"bytes": "1453348"
},
{
"name": "Kotlin",
"bytes": "24078"
},
{
"name": "Lex",
"bytes": "1156"
},
{
"name": "Makefile",
"bytes": "22596"
},
{
"name": "Mako",
"bytes": "1976"
},
{
"name": "Objective-C",
"bytes": "1500"
},
{
"name": "PHP",
"bytes": "868941"
},
{
"name": "Python",
"bytes": "553417"
},
{
"name": "Racket",
"bytes": "11698"
},
{
"name": "Roff",
"bytes": "3741"
},
{
"name": "Ruby",
"bytes": "129923"
},
{
"name": "Rust",
"bytes": "27692"
},
{
"name": "Scala",
"bytes": "791"
},
{
"name": "Shell",
"bytes": "17297"
},
{
"name": "Smarty",
"bytes": "421"
},
{
"name": "Swift",
"bytes": "197600"
},
{
"name": "TeX",
"bytes": "3875"
},
{
"name": "TypeScript",
"bytes": "24815"
},
{
"name": "Vim script",
"bytes": "6936"
},
{
"name": "Vue",
"bytes": "32921"
},
{
"name": "Zig",
"bytes": "634"
}
],
"symlink_target": ""
} |
/*jshint -W055 *//* non standard constructor name */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
}
else if (typeof module === 'object' && module.exports) {
module.exports = factory(require('jquery'));
}
else {
factory(root.jQuery);
}
}(this, function($) {
"use strict";
/*
* Plugin class
*/
var jQCloud = function (element, word_array, options) {
this.$element = $(element);
this.word_array = word_array || [];
this.options = options;
this.sizeGenerator = null;
this.colorGenerator = null;
// Data used internally
this.data = {
placed_words: [],
timeouts: {},
namespace: null,
step: null,
angle: null,
aspect_ratio: null,
max_weight: null,
min_weight: null,
sizes: [],
colors: []
};
this.initialize();
};
jQCloud.DEFAULTS = {
width: 100,
height: 100,
center: { x: 0.5, y: 0.5 },
steps: 10,
delay: null,
shape: 'elliptic',
classPattern: 'w{n}',
encodeURI: true,
removeOverflowing: true,
afterCloudRender: null,
autoResize: false,
colors: null,
fontSize: null,
template: null
};
jQCloud.prototype = {
initialize: function() {
// Set/Get dimensions
if (this.options.width) {
this.$element.width(this.options.width);
}
else {
this.options.width = this.$element.width();
}
if (this.options.height) {
this.$element.height(this.options.height);
}
else {
this.options.height = this.$element.height();
}
// Default options value
this.options = $.extend(true, {}, jQCloud.DEFAULTS, this.options);
// Ensure delay
if (this.options.delay === null) {
this.options.delay = this.word_array.length > 50 ? 10 : 0;
}
// Backward compatibility
if (this.options.center.x > 1) {
this.options.center.x = this.options.center.x / this.options.width;
this.options.center.y = this.options.center.y / this.options.height;
}
// Create colorGenerator function from options
// Direct function
if (typeof this.options.colors == 'function') {
this.colorGenerator = this.options.colors;
}
// Array of sizes
else if ($.isArray(this.options.colors)) {
var cl = this.options.colors.length;
if (cl > 0) {
// Fill the sizes array to X items
if (cl < this.options.steps) {
for (var i=cl; i<this.options.steps; i++) {
this.options.colors[i] = this.options.colors[cl-1];
}
}
this.colorGenerator = function(weight) {
return this.options.colors[this.options.steps - weight];
};
}
}
// Create sizeGenerator function from options
// Direct function
if (typeof this.options.fontSize == 'function') {
this.sizeGenerator = this.options.fontSize;
}
// Object with 'from' and 'to'
else if ($.isPlainObject(this.options.fontSize)) {
this.sizeGenerator = function(width, height, weight) {
var max = width * this.options.fontSize.from,
min = width * this.options.fontSize.to;
return Math.round(min + (max - min) * 1.0 / (this.options.steps-1) * (weight - 1)) + 'px';
};
}
// Array of sizes
else if ($.isArray(this.options.fontSize)) {
var sl = this.options.fontSize.length;
if (sl > 0) {
// Fill the sizes array to X items
if (sl < this.options.steps) {
for (var j=sl; j<this.options.steps; j++) {
this.options.fontSize[j] = this.options.fontSize[sl-1];
}
}
this.sizeGenerator = function(width, height, weight) {
return this.options.fontSize[this.options.steps - weight];
};
}
}
this.data.angle = Math.random() * 6.28;
this.data.step = (this.options.shape === 'rectangular') ? 18.0 : 2.0;
this.data.aspect_ratio = this.options.width / this.options.height;
this.clearTimeouts();
// Namespace word ids to avoid collisions between multiple clouds
this.data.namespace = (this.$element.attr('id') || Math.floor((Math.random()*1000000)).toString(36)) + '_word_';
this.$element.addClass('jqcloud');
// Container's CSS position cannot be 'static'
if (this.$element.css('position') === 'static') {
this.$element.css('position', 'relative');
}
// Delay execution so that the browser can render the page before the computatively intensive word cloud drawing
this.createTimeout($.proxy(this.drawWordCloud, this), 10);
// Attach window resize event
if (this.options.autoResize) {
$(window).on('resize', throttle(this.resize, 50, this));
}
},
// Helper function to keep track of timeouts so they can be destroyed
createTimeout: function(callback, time) {
var timeout = setTimeout($.proxy(function(){
delete this.data.timeouts[timeout];
callback();
}, this), time);
this.data.timeouts[timeout] = true;
},
// Destroy all timeouts
clearTimeouts: function() {
$.each(this.data.timeouts, function(key){
clearTimeout(key);
});
this.data.timeouts = {};
},
// Pairwise overlap detection
overlapping: function(a, b) {
if (Math.abs(2.0*a.left + a.width - 2.0*b.left - b.width) < a.width + b.width) {
if (Math.abs(2.0*a.top + a.height - 2.0*b.top - b.height) < a.height + b.height) {
return true;
}
}
return false;
},
// Helper function to test if an element overlaps others
hitTest: function(elem) {
// Check elements for overlap one by one, stop and return false as soon as an overlap is found
for(var i=0, l=this.data.placed_words.length; i<l; i++) {
if (this.overlapping(elem, this.data.placed_words[i])) {
return true;
}
}
return false;
},
// Initialize the drawing of the whole cloud
drawWordCloud: function() {
var i, l;
this.$element.children('[id^="' + this.data.namespace + '"]').remove();
if (this.word_array.length === 0) {
return;
}
// Make sure every weight is a number before sorting
for (i=0, l=this.word_array.length; i<l; i++) {
this.word_array[i].weight = parseFloat(this.word_array[i].weight, 10);
}
// Sort word_array from the word with the highest weight to the one with the lowest
this.word_array.sort(function(a, b) {
return b.weight - a.weight;
});
// Kepp trace of bounds
this.data.max_weight = this.word_array[0].weight;
this.data.min_weight = this.word_array[this.word_array.length - 1].weight;
// Generate colors
this.data.colors = [];
if (this.colorGenerator) {
for (i=0; i<this.options.steps; i++) {
this.data.colors.push(this.colorGenerator(i+1));
}
}
// Generate font sizes
this.data.sizes = [];
if (this.sizeGenerator) {
for (i=0; i<this.options.steps; i++) {
this.data.sizes.push(this.sizeGenerator(this.options.width, this.options.height, i+1));
}
}
// Iterate drawOneWord on every word, immediately or with delay
if (this.options.delay > 0){
this.drawOneWordDelayed();
}
else {
for (i=0, l=this.word_array.length; i<l; i++) {
this.drawOneWord(i, this.word_array[i]);
}
if (typeof this.options.afterCloudRender === 'function') {
this.options.afterCloudRender.call(this.$element);
}
}
},
// Function to draw a word, by moving it in spiral until it finds a suitable empty place
drawOneWord: function(index, word) {
var word_id = this.data.namespace + index,
word_selector = '#' + word_id,
// option.shape == 'elliptic'
angle = this.data.angle,
radius = 0.0,
// option.shape == 'rectangular'
steps_in_direction = 0.0,
quarter_turns = 0.0,
weight = Math.floor(this.options.steps / 2),
word_span,
word_size,
word_style;
// Create word attr object
word.attr = $.extend({}, word.html, { id: word_id });
// Linearly map the original weight to a discrete scale from 1 to 10
// Only if weights are different
if (this.data.max_weight != this.data.min_weight) {
weight = Math.round((word.weight - this.data.min_weight) * 1.0 * (this.options.steps-1) / (this.data.max_weight - this.data.min_weight)) + 1;
}
word_span = $('<span>').attr(word.attr);
// Apply class
if (this.options.classPattern) {
word_span.addClass(this.options.classPattern.replace('{n}', weight));
}
// Apply color
if (this.data.colors.length) {
word_span.css('color', this.data.colors[weight-1]);
}
// Apply color from word property
if (word.color) {
word_span.css('color', word.color);
}
// Apply size
if (this.data.sizes.length) {
word_span.css('font-size', this.data.sizes[weight-1]);
}
//Render using template function if provided.
if (this.options.template) {
word_span.html(this.options.template(word));
} else if (word.link) {
// Append link if word.link attribute was set
// If link is a string, then use it as the link href
if (typeof word.link === 'string') {
word.link = { href: word.link };
}
if (this.options.encodeURI) {
word.link.href = encodeURI(word.link.href).replace(/'/g, '%27');
}
word_span.append($('<a>').attr(word.link).text(word.text));
}
else {
word_span.text(word.text);
}
// Bind handlers to words
if (word.handlers) {
word_span.on(word.handlers);
}
this.$element.append(word_span);
word_size = {
width: word_span.outerWidth(),
height: word_span.outerHeight()
};
word_size.left = this.options.center.x*this.options.width - word_size.width / 2.0;
word_size.top = this.options.center.y*this.options.height - word_size.height / 2.0;
// Save a reference to the style property, for better performance
word_style = word_span[0].style;
word_style.position = 'absolute';
word_style.left = word_size.left + 'px';
word_style.top = word_size.top + 'px';
while(this.hitTest(word_size)) {
// option shape is 'rectangular' so move the word in a rectangular spiral
if (this.options.shape === 'rectangular') {
steps_in_direction++;
if (steps_in_direction * this.data.step > (1 + Math.floor(quarter_turns / 2.0)) * this.data.step * ((quarter_turns % 4 % 2) === 0 ? 1 : this.data.aspect_ratio)) {
steps_in_direction = 0.0;
quarter_turns++;
}
switch(quarter_turns % 4) {
case 1:
word_size.left += this.data.step * this.data.aspect_ratio + Math.random() * 2.0;
break;
case 2:
word_size.top -= this.data.step + Math.random() * 2.0;
break;
case 3:
word_size.left -= this.data.step * this.data.aspect_ratio + Math.random() * 2.0;
break;
case 0:
word_size.top += this.data.step + Math.random() * 2.0;
break;
}
}
// Default settings: elliptic spiral shape
else {
radius += this.data.step;
angle += (index % 2 === 0 ? 1 : -1) * this.data.step;
word_size.left = this.options.center.x*this.options.width - (word_size.width / 2.0) + (radius*Math.cos(angle)) * this.data.aspect_ratio;
word_size.top = this.options.center.y*this.options.height + radius*Math.sin(angle) - (word_size.height / 2.0);
}
word_style.left = word_size.left + 'px';
word_style.top = word_size.top + 'px';
}
// Don't render word if part of it would be outside the container
if (this.options.removeOverflowing && (
word_size.left < 0 || word_size.top < 0 ||
(word_size.left + word_size.width) > this.options.width ||
(word_size.top + word_size.height) > this.options.height
)
) {
word_span.remove();
return;
}
// Save position for further usage
this.data.placed_words.push(word_size);
if (typeof word.afterWordRender === 'function') {
word.afterWordRender.call(word_span);
}
},
// Draw one word then recall the function after a delay
drawOneWordDelayed: function(index) {
index = index || 0;
// if not visible then do not attempt to draw
if (!this.$element.is(':visible')) {
this.createTimeout($.proxy(function(){
this.drawOneWordDelayed(index);
}, this), 10);
return;
}
if (index < this.word_array.length) {
this.drawOneWord(index, this.word_array[index]);
this.createTimeout($.proxy(function(){
this.drawOneWordDelayed(index + 1);
}, this), this.options.delay);
}
else {
if (typeof this.options.afterCloudRender == 'function') {
this.options.afterCloudRender.call(this.$element);
}
}
},
// Destroy any data and objects added by the plugin
destroy: function() {
this.clearTimeouts();
this.$element.removeClass('jqcloud');
this.$element.removeData('jqcloud');
this.$element.children('[id^="' + this.data.namespace + '"]').remove();
},
// Update the list of words
update: function(word_array) {
this.word_array = word_array;
this.data.placed_words = [];
this.clearTimeouts();
this.drawWordCloud();
},
resize: function() {
var new_size = {
width: this.$element.width(),
height: this.$element.height()
};
if (new_size.width != this.options.width || new_size.height != this.options.height) {
this.options.width = new_size.width;
this.options.height = new_size.height;
this.data.aspect_ratio = this.options.width / this.options.height;
this.update(this.word_array);
}
},
};
/*
* Apply throttling to a callback
* @param callback {function}
* @param delay {int} milliseconds
* @param context {object|null}
* @return {function}
*/
function throttle(callback, delay, context) {
var state = {
pid: null,
last: 0
};
return function() {
var elapsed = new Date().getTime() - state.last,
args = arguments,
that = this;
function exec() {
state.last = new Date().getTime();
return callback.apply(context || that, Array.prototype.slice.call(args));
}
if (elapsed > delay) {
return exec();
}
else {
clearTimeout(state.pid);
state.pid = setTimeout(exec, delay - elapsed);
}
};
}
/*
* jQuery plugin
*/
$.fn.jQCloud = function(word_array, option) {
var args = arguments;
return this.each(function () {
var $this = $(this),
data = $this.data('jqcloud');
if (!data && word_array === 'destroy') {
// Don't even try to initialize when called with 'destroy'
return;
}
if (!data) {
var options = typeof option === 'object' ? option : {};
$this.data('jqcloud', (data = new jQCloud(this, word_array, options)));
}
else if (typeof word_array === 'string') {
data[word_array].apply(data, Array.prototype.slice.call(args, 1));
}
});
};
$.fn.jQCloud.defaults = {
set: function(options) {
$.extend(true, jQCloud.DEFAULTS, options);
},
get: function(key) {
var options = jQCloud.DEFAULTS;
if (key) {
options = options[key];
}
return $.extend(true, {}, options);
}
};
}));
| {
"content_hash": "90264e3e6dbbc5d83e76fc28b6c9eafa",
"timestamp": "",
"source": "github",
"line_count": 535,
"max_line_length": 172,
"avg_line_length": 30.386915887850467,
"alnum_prop": 0.5632035430891308,
"repo_name": "AMoo-Miki/cdnjs",
"id": "316c9690f7aa1729bd48818950101bdc7107c292",
"size": "16532",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajax/libs/jqcloud2/2.0.3/jqcloud.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
title: "GREENHOUSE TOURS"
date: "2000-01-01 20:01:30 -06:00"
categories:
- winter
- adult
subtitle: ""
layout: "events"
event-image: "greenhouse-tour.jpg"
event-dates: "THURSDAY, JANUARY 30"
event-location: "Red Butte Garden Greenhouses"
button-type: "register"
tickets-link: ""
registration-info: "N/A"
instructor-info: "<strong>Eric Cook</strong>, <em>RBG Greenhouse Coordinator &</em><br /><strong>Scott Mower</strong>, <em>RBG Designer & Horticulturist</em>"
member-cost: "Free"
public-cost: "Garden Admission"
event-notes: ""
tickets-button: "hide"
published: false
---
<div class="tan-bg">
<br />
<h4 class="text-center green">Tour Times</h4>
<p class="text-center bold">THURSDAY, JANUARY 30 @ 10-11:30AM or 1-2:30PM<br />
<p class="text-center">REGISTRATION REQUIRED</p>
<br />
</div>
<br />
<p class="text-center">Step out of the cold and into the warmth of Red Butte Garden's greenhouses. Join us for a behind-the-scenes tour of our state-of-the-art greenhouses where we grow 100% of the Garden's annuals and container plants, as well as the plants found in the Orangerie and Visitor Center. Get a sneak peek at what is to come this spring.</p>
<br />
<div class="row-fluid">
<div class="col-sm-6">
<h4 class="text-center green">Session 1</h4>
<p class="text-center date">10 - 11:30AM</p>
<center>
<a href="https://55218.blackbaudhosting.com/55218/Greenhouse-Tour---Session-1-30Jan2020">{%include register-button.html%}</a>
</center>
</div>
<div class="col-sm-6">
<h4 class="text-center green">Session 2</h4>
<p class="text-center date">1 - 2:30PM</p>
<center>
<a href="https://55218.blackbaudhosting.com/55218/Greenhouse-Tour---Session-2-30Jan2020">{%include register-button.html%}</a>
</center>
</div>
</div>
<br />
<br />
| {
"content_hash": "af7ba4ced4595263b41576b3c1e55b9f",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 354,
"avg_line_length": 33.58181818181818,
"alnum_prop": 0.6713589604764483,
"repo_name": "redbuttegarden/redbuttegarden.github.io",
"id": "f5a913782b86bfcecf649bc555bab3224f328a39",
"size": "1851",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "events/_posts/1977-05-25-greenhouse-tours.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "61814"
},
{
"name": "HTML",
"bytes": "3602951"
},
{
"name": "JavaScript",
"bytes": "34082"
},
{
"name": "Ruby",
"bytes": "1273"
},
{
"name": "Shell",
"bytes": "190"
}
],
"symlink_target": ""
} |
describe.skip('Struck.computed', function () {
var count = 0;
var counter = function() { count++; };
var noop = function() {};
var instance, baseobj;
beforeEach(function() {
count = 0;
});
it('should return a property', function() {
instance = Struck.EventObject.extend({
name: 'Borg',
properName: new Struck.computed('name', function() {
return 'Mr. ' + this.get('name');
})
}).create();
instance.get('properName').should.equal('Mr. Borg');
});
it('should listen for property changes and self-update', function() {
instance = Struck.EventObject.extend({
name: 'Borg',
properName: new Struck.computed('name', function() {
return 'Mr. ' + this.get('name');
})
}).create();
instance.get('properName').should.equal('Mr. Borg');
instance.set('name', 'Roboto');
instance.get('properName').should.equal('Mr. Roboto');
});
it.skip('should accept a single property to track', function() {
instance = Struck.EventObject.extend({
name: 'Borg',
properName: Struck.computed('name', function() {
return 'Mr. ' + this.get('name');
})
}).create();
instance.set('name', 'Roboto');
instance.get('properName').should.equal('Mr. Roboto');
});
it.skip('should accept an array of properties to track', function() {
instance = Struck.EventObject.extend({
first: 'Thomas',
last: 'Selleck',
fullName: Struck.computed(['first', 'last'], function() {
return this.get('first') + this.get('last');
})
}).create();
instance.set('first', 'Tom');
instance.get('fullName').should.equal('Tom Selleck');
});
it.skip('should accept multiple argments of properties to track', function() {
instance = Struck.EventObject.extend({
first: 'Thomas',
last: 'Selleck',
fullName: Struck.computed('first', 'last', function() {
return this.get('first') + this.get('last');
})
}).create();
instance.set('first', 'Tom');
instance.get('fullName').should.equal('Tom Selleck');
});
it.skip('should accept computed properties to track', function() {
instance = Struck.EventObject.extend({
first: 'Thomas',
last: 'Selleck',
fullName: Struck.computed('first', 'last', function() {
return [this.get('first'), this.get('last')].join();
}),
formalName: Struck.computed('fullName', function() {
return ['Mr', this.get('fullName')].join();
})
}).create();
instance.set('first', 'Tom');
instance.get('fullName').should.equal('Tom Selleck');
instance.get('formalName').should.equal('Tom Selleck');
});
}); | {
"content_hash": "3de2f48c6b52c7f3f9e619a1f7ef4900",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 79,
"avg_line_length": 28.761363636363637,
"alnum_prop": 0.6297905966021335,
"repo_name": "krambuhl/Struck",
"id": "b435c15d374a3dae31e82973ab227be793961609",
"size": "2531",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "test/computed.test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9790"
},
{
"name": "JavaScript",
"bytes": "60740"
}
],
"symlink_target": ""
} |
<?php
/**
* Just a footer. Everything gets closed here and some information is display.
* @package fourtwenty
* @link http://codex.wordpress.org/Theme_Development#Footer_.28footer.php.29
*/
?>
<div id="footer">
<div class="container">
<div class="row">
<div class="col-md-4"><a href="http://wordpress.org"><?php _e('Proudly powered by WordPress *cough*', 'fourtwenty'); ?></a></div>
<!-- You should probably remove this or note your theme... -->
<div class="col-md-4 col-md-offset-4 text-right"><a href="https://github.com/infyhr/fourtwenty">Fourtwenty!</a></div>
</div>
</div>
</div>
<!-- All javascript gets called by wp_footer(); (Including Bootstrap) -->
<?php wp_footer(); ?>
</body>
</html> | {
"content_hash": "5df14d8ba5d4aa115a2181d4ea12757d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 141,
"avg_line_length": 31.833333333333332,
"alnum_prop": 0.6138743455497382,
"repo_name": "infyhr/fourtwenty",
"id": "a89c9f6195b61c30eef7355324517c4d4164e073",
"size": "764",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "footer.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "2756"
},
{
"name": "PHP",
"bytes": "40769"
}
],
"symlink_target": ""
} |
<div>
<a href="http://github.com/zenit/zenit">
<img src="https://drive.google.com/uc?export=download&id=0B9WchF8WhEn9bjAxaGxKWko4d2s">
</a>
</div>
[](https://travis-ci.org/zenit/zenit)
[](https://github.com/zenit/zenit/blob/master/package.json)
:warning: This is currently under extremely active development, and you probably shouldn't use it unless you like broken software.
**Zenit** is an open-source database administration tool built on the modern web with [Electron](https://github.com/atom/electron) and [Polymer](https://github.com/polymer/polymer). In addition to the features that zenit can offer, it can be easily extended.
## License
MIT © [Iegor Azuaga](https://github.com/iiegor)
| {
"content_hash": "ed4bb1104c02bc786ffbd218c1b6eb89",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 258,
"avg_line_length": 52.125,
"alnum_prop": 0.7434052757793765,
"repo_name": "iiegor/zenit",
"id": "af7592d0c4d79d7f74f87d629bdc9797ba38c0ac",
"size": "835",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7595"
},
{
"name": "HTML",
"bytes": "14048"
},
{
"name": "JavaScript",
"bytes": "8087"
}
],
"symlink_target": ""
} |
namespace content {
class RenderViewHost;
}
class Profile;
namespace chromeos {
enum AccessibilityNotificationType {
ACCESSIBILITY_MANAGER_SHUTDOWN,
ACCESSIBILITY_TOGGLE_HIGH_CONTRAST_MODE,
ACCESSIBILITY_TOGGLE_LARGE_CURSOR,
ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER,
ACCESSIBILITY_TOGGLE_SPOKEN_FEEDBACK,
ACCESSIBILITY_TOGGLE_VIRTUAL_KEYBOARD,
ACCESSIBILITY_BRAILLE_DISPLAY_CONNECTION_STATE_CHANGED
};
struct AccessibilityStatusEventDetails {
AccessibilityStatusEventDetails(
AccessibilityNotificationType notification_type,
bool enabled,
ui::AccessibilityNotificationVisibility notify);
AccessibilityStatusEventDetails(
AccessibilityNotificationType notification_type,
bool enabled,
ui::MagnifierType magnifier_type,
ui::AccessibilityNotificationVisibility notify);
AccessibilityNotificationType notification_type;
bool enabled;
ui::MagnifierType magnifier_type;
ui::AccessibilityNotificationVisibility notify;
};
typedef base::Callback<void(const AccessibilityStatusEventDetails&)>
AccessibilityStatusCallback;
typedef base::CallbackList<void(const AccessibilityStatusEventDetails&)>
AccessibilityStatusCallbackList;
typedef AccessibilityStatusCallbackList::Subscription
AccessibilityStatusSubscription;
class ChromeVoxPanelWidgetObserver;
// AccessibilityManager changes the statuses of accessibility features
// watching profile notifications and pref-changes.
// TODO(yoshiki): merge MagnificationManager with AccessibilityManager.
class AccessibilityManager
: public content::NotificationObserver,
public extensions::api::braille_display_private::BrailleObserver,
public extensions::ExtensionRegistryObserver,
public ash::SessionStateObserver,
public ash::ShellObserver,
public input_method::InputMethodManager::Observer {
public:
// Creates an instance of AccessibilityManager, this should be called once,
// because only one instance should exist at the same time.
static void Initialize();
// Deletes the existing instance of AccessibilityManager.
static void Shutdown();
// Returns the existing instance. If there is no instance, returns NULL.
static AccessibilityManager* Get();
// On a user's first login into a device, any a11y features enabled/disabled
// by the user on the login screen are enabled/disabled in the user's profile.
// This class watches for profile changes and copies settings into the user's
// profile when it detects a login with a newly created profile.
class PrefHandler {
public:
explicit PrefHandler(const char* pref_path);
virtual ~PrefHandler();
// Should be called from AccessibilityManager::SetProfile().
void HandleProfileChanged(Profile* previous_profile,
Profile* current_profile);
private:
const char* pref_path_;
DISALLOW_COPY_AND_ASSIGN(PrefHandler);
};
// Returns true when the accessibility menu should be shown.
bool ShouldShowAccessibilityMenu();
// Returns true when cursor compositing should be enabled.
bool ShouldEnableCursorCompositing();
// Enables or disables the large cursor.
void EnableLargeCursor(bool enabled);
// Returns true if the large cursor is enabled, or false if not.
bool IsLargeCursorEnabled();
// Enables or disable Sticky Keys.
void EnableStickyKeys(bool enabled);
// Returns true if Incognito mode is allowed, or false if not.
bool IsIncognitoAllowed();
// Returns true if the Sticky Keys is enabled, or false if not.
bool IsStickyKeysEnabled();
// Enables or disables spoken feedback. Enabling spoken feedback installs the
// ChromeVox component extension.
void EnableSpokenFeedback(bool enabled,
ui::AccessibilityNotificationVisibility notify);
// Returns true if spoken feedback is enabled, or false if not.
bool IsSpokenFeedbackEnabled();
// Toggles whether Chrome OS spoken feedback is on or off.
void ToggleSpokenFeedback(ui::AccessibilityNotificationVisibility notify);
// Enables or disables the high contrast mode for Chrome.
void EnableHighContrast(bool enabled);
// Returns true if High Contrast is enabled, or false if not.
bool IsHighContrastEnabled();
// Enables or disables autoclick.
void EnableAutoclick(bool enabled);
// Returns true if autoclick is enabled.
bool IsAutoclickEnabled();
// Set the delay for autoclicking after stopping the cursor in milliseconds.
void SetAutoclickDelay(int delay_ms);
// Returns the autoclick delay in milliseconds.
int GetAutoclickDelay() const;
// Enables or disables the virtual keyboard.
void EnableVirtualKeyboard(bool enabled);
// Returns true if the virtual keyboard is enabled, otherwise false.
bool IsVirtualKeyboardEnabled();
// Returns true if a braille display is connected to the system, otherwise
// false.
bool IsBrailleDisplayConnected() const;
// SessionStateObserver overrides:
void ActiveUserChanged(const AccountId& account_id) override;
// ShellObserver overrides:
void OnAppTerminating() override;
void SetProfileForTest(Profile* profile);
static void SetBrailleControllerForTest(
extensions::api::braille_display_private::BrailleController* controller);
// Enables/disables system sounds.
void EnableSystemSounds(bool system_sounds_enabled);
// Initiates play of shutdown sound and returns it's duration.
base::TimeDelta PlayShutdownSound();
// Injects ChromeVox scripts into given |render_view_host|.
void InjectChromeVox(content::RenderViewHost* render_view_host);
// Register a callback to be notified when the status of an accessibility
// option changes.
scoped_ptr<AccessibilityStatusSubscription> RegisterCallback(
const AccessibilityStatusCallback& cb);
// Notify registered callbacks of a status change in an accessibility setting.
void NotifyAccessibilityStatusChanged(
AccessibilityStatusEventDetails& details);
// Notify accessibility when locale changes occur.
void OnLocaleChanged();
// Plays an earcon. Earcons are brief and distinctive sounds that indicate
// when their mapped event has occurred. The sound key enums can be found in
// chromeos/audio/chromeos_sounds.h.
void PlayEarcon(int sound_key);
// Called by our widget observer when the ChromeVoxPanel is closing.
void OnChromeVoxPanelClosing();
void OnChromeVoxPanelDestroying();
// Profile having the a11y context.
Profile* profile() { return profile_; }
// Extension id of extension receiving keyboard events.
void SetKeyboardListenerExtensionId(const std::string& id,
content::BrowserContext* context);
const std::string& keyboard_listener_extension_id() {
return keyboard_listener_extension_id_;
}
// Whether keyboard listener extension gets to capture keys.
void set_keyboard_listener_capture(bool val) {
keyboard_listener_capture_ = val;
}
bool keyboard_listener_capture() { return keyboard_listener_capture_; }
protected:
AccessibilityManager();
~AccessibilityManager() override;
private:
void LoadChromeVox();
void LoadChromeVoxToUserScreen(const base::Closure& done_cb);
void LoadChromeVoxToLockScreen(const base::Closure& done_cb);
void UnloadChromeVox();
void UnloadChromeVoxFromLockScreen();
void PostLoadChromeVox(Profile* profile);
void PostUnloadChromeVox(Profile* profile);
void UpdateLargeCursorFromPref();
void UpdateStickyKeysFromPref();
void UpdateSpokenFeedbackFromPref();
void UpdateHighContrastFromPref();
void UpdateAutoclickFromPref();
void UpdateAutoclickDelayFromPref();
void UpdateVirtualKeyboardFromPref();
void CheckBrailleState();
void ReceiveBrailleDisplayState(
scoped_ptr<extensions::api::braille_display_private::DisplayState> state);
void UpdateBrailleImeState();
void SetProfile(Profile* profile);
void UpdateChromeOSAccessibilityHistograms();
// content::NotificationObserver
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
// extensions::api::braille_display_private::BrailleObserver implementation.
// Enables spoken feedback if a braille display becomes available.
void OnBrailleDisplayStateChanged(
const extensions::api::braille_display_private::DisplayState&
display_state) override;
void OnBrailleKeyEvent(
const extensions::api::braille_display_private::KeyEvent& event) override;
// ExtensionRegistryObserver implementation.
void OnExtensionUnloaded(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
extensions::UnloadedExtensionInfo::Reason reason) override;
void OnShutdown(extensions::ExtensionRegistry* registry) override;
// InputMethodManager::Observer
void InputMethodChanged(input_method::InputMethodManager* manager,
Profile* profile,
bool show_message) override;
// Profile which has the current a11y context.
Profile* profile_;
// Profile which ChromeVox is currently loaded to. If NULL, ChromeVox is not
// loaded to any profile.
bool chrome_vox_loaded_on_lock_screen_;
bool chrome_vox_loaded_on_user_screen_;
content::NotificationRegistrar notification_registrar_;
scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;
scoped_ptr<PrefChangeRegistrar> local_state_pref_change_registrar_;
scoped_ptr<ash::ScopedSessionStateObserver> session_state_observer_;
PrefHandler large_cursor_pref_handler_;
PrefHandler spoken_feedback_pref_handler_;
PrefHandler high_contrast_pref_handler_;
PrefHandler autoclick_pref_handler_;
PrefHandler autoclick_delay_pref_handler_;
PrefHandler virtual_keyboard_pref_handler_;
bool large_cursor_enabled_;
bool sticky_keys_enabled_;
bool spoken_feedback_enabled_;
bool high_contrast_enabled_;
bool autoclick_enabled_;
int autoclick_delay_ms_;
bool virtual_keyboard_enabled_;
ui::AccessibilityNotificationVisibility spoken_feedback_notification_;
bool should_speak_chrome_vox_announcements_on_user_screen_;
bool system_sounds_enabled_;
AccessibilityStatusCallbackList callback_list_;
bool braille_display_connected_;
ScopedObserver<extensions::api::braille_display_private::BrailleController,
AccessibilityManager> scoped_braille_observer_;
bool braille_ime_current_;
ChromeVoxPanel* chromevox_panel_;
scoped_ptr<ChromeVoxPanelWidgetObserver> chromevox_panel_widget_observer_;
std::string keyboard_listener_extension_id_;
bool keyboard_listener_capture_;
// Listen to extension unloaded notifications.
ScopedObserver<extensions::ExtensionRegistry,
extensions::ExtensionRegistryObserver>
extension_registry_observer_;
base::WeakPtrFactory<AccessibilityManager> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(AccessibilityManager);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_ACCESSIBILITY_MANAGER_H_
| {
"content_hash": "cb8313695b9961706fbf5a28bebc81e6",
"timestamp": "",
"source": "github",
"line_count": 316,
"max_line_length": 80,
"avg_line_length": 35.04746835443038,
"alnum_prop": 0.7601805869074492,
"repo_name": "Bysmyyr/chromium-crosswalk",
"id": "92b33ea8dde5d9d0f34c928a0f5834df72dd9ba1",
"size": "12228",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chrome/browser/chromeos/accessibility/accessibility_manager.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
/* *
*
* (c) 2009-2021 Øystein Moseng
*
* Main keyboard navigation handling.
*
* License: www.highcharts.com/license
*
* !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
*
* */
'use strict';
import H from '../Core/Globals.js';
var doc = H.doc, win = H.win;
import MenuComponent from './Components/MenuComponent.js';
import U from '../Core/Utilities.js';
var addEvent = U.addEvent, fireEvent = U.fireEvent;
import EventProvider from './Utils/EventProvider.js';
import HTMLUtilities from './Utils/HTMLUtilities.js';
var getElement = HTMLUtilities.getElement;
/* *
*
* Class
*
* */
/**
* The KeyboardNavigation class, containing the overall keyboard navigation
* logic for the chart.
*
* @requires module:modules/accessibility
*
* @private
* @class
* @param {Highcharts.Chart} chart
* Chart object
* @param {object} components
* Map of component names to AccessibilityComponent objects.
* @name Highcharts.KeyboardNavigation
*/
var KeyboardNavigation = /** @class */ (function () {
/* *
*
* Constructor
*
* */
function KeyboardNavigation(chart, components) {
/* *
*
* Properties
*
* */
this.chart = void 0;
this.components = void 0;
this.currentModuleIx = NaN;
this.eventProvider = void 0;
this.exitAnchor = void 0;
this.modules = [];
this.tabindexContainer = void 0;
this.init(chart, components);
}
/* *
*
* Functions
*
* */
/* eslint-disable valid-jsdoc */
/**
* Initialize the class
* @private
* @param {Highcharts.Chart} chart
* Chart object
* @param {object} components
* Map of component names to AccessibilityComponent objects.
*/
KeyboardNavigation.prototype.init = function (chart, components) {
var _this = this;
var ep = this.eventProvider = new EventProvider();
this.chart = chart;
this.components = components;
this.modules = [];
this.currentModuleIx = 0;
this.update();
ep.addEvent(this.tabindexContainer, 'keydown', function (e) { return _this.onKeydown(e); });
ep.addEvent(this.tabindexContainer, 'focus', function (e) { return _this.onFocus(e); });
['mouseup', 'touchend'].forEach(function (eventName) {
return ep.addEvent(doc, eventName, function () { return _this.onMouseUp(); });
});
['mousedown', 'touchstart'].forEach(function (eventName) {
return ep.addEvent(chart.renderTo, eventName, function () {
_this.isClickingChart = true;
});
});
ep.addEvent(chart.renderTo, 'mouseover', function () {
_this.pointerIsOverChart = true;
});
ep.addEvent(chart.renderTo, 'mouseout', function () {
_this.pointerIsOverChart = false;
});
};
/**
* Update the modules for the keyboard navigation.
* @param {Array<string>} [order]
* Array specifying the tab order of the components.
*/
KeyboardNavigation.prototype.update = function (order) {
var a11yOptions = this.chart.options.accessibility, keyboardOptions = a11yOptions && a11yOptions.keyboardNavigation, components = this.components;
this.updateContainerTabindex();
if (keyboardOptions &&
keyboardOptions.enabled &&
order &&
order.length) {
// We (still) have keyboard navigation. Update module list
this.modules = order.reduce(function (modules, componentName) {
var navModules = components[componentName].getKeyboardNavigation();
return modules.concat(navModules);
}, []);
this.updateExitAnchor();
}
else {
this.modules = [];
this.currentModuleIx = 0;
this.removeExitAnchor();
}
};
/**
* Function to run on container focus
* @private
* @param {global.FocusEvent} e Browser focus event.
*/
KeyboardNavigation.prototype.onFocus = function (e) {
var chart = this.chart;
var focusComesFromChart = (e.relatedTarget &&
chart.container.contains(e.relatedTarget));
// Init keyboard nav if tabbing into chart
if (!this.exiting &&
!this.tabbingInBackwards &&
!this.isClickingChart &&
!focusComesFromChart &&
this.modules[0]) {
this.modules[0].init(1);
}
this.exiting = false;
};
/**
* Reset chart navigation state if we click outside the chart and it's
* not already reset.
* @private
*/
KeyboardNavigation.prototype.onMouseUp = function () {
delete this.isClickingChart;
if (!this.keyboardReset && !this.pointerIsOverChart) {
var chart = this.chart, curMod = this.modules &&
this.modules[this.currentModuleIx || 0];
if (curMod && curMod.terminate) {
curMod.terminate();
}
if (chart.focusElement) {
chart.focusElement.removeFocusBorder();
}
this.currentModuleIx = 0;
this.keyboardReset = true;
}
};
/**
* Function to run on keydown
* @private
* @param {global.KeyboardEvent} ev Browser keydown event.
*/
KeyboardNavigation.prototype.onKeydown = function (ev) {
var e = ev || win.event, curNavModule = (this.modules &&
this.modules.length &&
this.modules[this.currentModuleIx]);
var preventDefault;
// Used for resetting nav state when clicking outside chart
this.keyboardReset = false;
// Used for sending focus out of the chart by the modules.
this.exiting = false;
// If there is a nav module for the current index, run it.
// Otherwise, we are outside of the chart in some direction.
if (curNavModule) {
var response = curNavModule.run(e);
if (response === curNavModule.response.success) {
preventDefault = true;
}
else if (response === curNavModule.response.prev) {
preventDefault = this.prev();
}
else if (response === curNavModule.response.next) {
preventDefault = this.next();
}
if (preventDefault) {
e.preventDefault();
e.stopPropagation();
}
}
};
/**
* Go to previous module.
* @private
*/
KeyboardNavigation.prototype.prev = function () {
return this.move(-1);
};
/**
* Go to next module.
* @private
*/
KeyboardNavigation.prototype.next = function () {
return this.move(1);
};
/**
* Move to prev/next module.
* @private
* @param {number} direction
* Direction to move. +1 for next, -1 for prev.
* @return {boolean}
* True if there was a valid module in direction.
*/
KeyboardNavigation.prototype.move = function (direction) {
var curModule = this.modules && this.modules[this.currentModuleIx];
if (curModule && curModule.terminate) {
curModule.terminate(direction);
}
// Remove existing focus border if any
if (this.chart.focusElement) {
this.chart.focusElement.removeFocusBorder();
}
this.currentModuleIx += direction;
var newModule = this.modules && this.modules[this.currentModuleIx];
if (newModule) {
if (newModule.validate && !newModule.validate()) {
return this.move(direction); // Invalid module, recurse
}
if (newModule.init) {
newModule.init(direction); // Valid module, init it
return true;
}
}
// No module
this.currentModuleIx = 0; // Reset counter
// Set focus to chart or exit anchor depending on direction
this.exiting = true;
if (direction > 0) {
this.exitAnchor.focus();
}
else {
this.tabindexContainer.focus();
}
return false;
};
/**
* We use an exit anchor to move focus out of chart whenever we want, by
* setting focus to this div and not preventing the default tab action. We
* also use this when users come back into the chart by tabbing back, in
* order to navigate from the end of the chart.
* @private
*/
KeyboardNavigation.prototype.updateExitAnchor = function () {
var endMarkerId = 'highcharts-end-of-chart-marker-' + this.chart.index, endMarker = getElement(endMarkerId);
this.removeExitAnchor();
if (endMarker) {
this.makeElementAnExitAnchor(endMarker);
this.exitAnchor = endMarker;
}
else {
this.createExitAnchor();
}
};
/**
* Chart container should have tabindex if navigation is enabled.
* @private
*/
KeyboardNavigation.prototype.updateContainerTabindex = function () {
var a11yOptions = this.chart.options.accessibility, keyboardOptions = a11yOptions && a11yOptions.keyboardNavigation, shouldHaveTabindex = !(keyboardOptions && keyboardOptions.enabled === false), chart = this.chart, container = chart.container;
var tabindexContainer;
if (chart.renderTo.hasAttribute('tabindex')) {
container.removeAttribute('tabindex');
tabindexContainer = chart.renderTo;
}
else {
tabindexContainer = container;
}
this.tabindexContainer = tabindexContainer;
var curTabindex = tabindexContainer.getAttribute('tabindex');
if (shouldHaveTabindex && !curTabindex) {
tabindexContainer.setAttribute('tabindex', '0');
}
else if (!shouldHaveTabindex) {
chart.container.removeAttribute('tabindex');
}
};
/**
* @private
*/
KeyboardNavigation.prototype.makeElementAnExitAnchor = function (el) {
var chartTabindex = this.tabindexContainer.getAttribute('tabindex') || 0;
el.setAttribute('class', 'highcharts-exit-anchor');
el.setAttribute('tabindex', chartTabindex);
el.setAttribute('aria-hidden', false);
// Handle focus
this.addExitAnchorEventsToEl(el);
};
/**
* Add new exit anchor to the chart.
*
* @private
*/
KeyboardNavigation.prototype.createExitAnchor = function () {
var chart = this.chart, exitAnchor = this.exitAnchor = doc.createElement('div');
chart.renderTo.appendChild(exitAnchor);
this.makeElementAnExitAnchor(exitAnchor);
};
/**
* @private
*/
KeyboardNavigation.prototype.removeExitAnchor = function () {
if (this.exitAnchor && this.exitAnchor.parentNode) {
this.exitAnchor.parentNode
.removeChild(this.exitAnchor);
delete this.exitAnchor;
}
};
/**
* @private
*/
KeyboardNavigation.prototype.addExitAnchorEventsToEl = function (element) {
var chart = this.chart, keyboardNavigation = this;
this.eventProvider.addEvent(element, 'focus', function (ev) {
var e = ev || win.event, focusComesFromChart = (e.relatedTarget &&
chart.container.contains(e.relatedTarget)), comingInBackwards = !(focusComesFromChart || keyboardNavigation.exiting);
if (comingInBackwards) {
// Focus the container instead
keyboardNavigation.tabbingInBackwards = true;
keyboardNavigation.tabindexContainer.focus();
delete keyboardNavigation.tabbingInBackwards;
e.preventDefault();
// Move to last valid keyboard nav module
// Note the we don't run it, just set the index
if (keyboardNavigation.modules &&
keyboardNavigation.modules.length) {
keyboardNavigation.currentModuleIx =
keyboardNavigation.modules.length - 1;
var curModule = keyboardNavigation.modules[keyboardNavigation.currentModuleIx];
// Validate the module
if (curModule &&
curModule.validate && !curModule.validate()) {
// Invalid. Try moving backwards to find next valid.
keyboardNavigation.prev();
}
else if (curModule) {
// We have a valid module, init it
curModule.init(-1);
}
}
}
else {
// Don't skip the next focus, we only skip once.
keyboardNavigation.exiting = false;
}
});
};
/**
* Remove all traces of keyboard navigation.
* @private
*/
KeyboardNavigation.prototype.destroy = function () {
this.removeExitAnchor();
this.eventProvider.removeAddedEvents();
this.chart.container.removeAttribute('tabindex');
};
return KeyboardNavigation;
}());
/* *
*
* Class Namespace
*
* */
(function (KeyboardNavigation) {
/* *
*
* Declarations
*
* */
/* *
*
* Construction
*
* */
var composedItems = [];
/* *
*
* Functions
*
* */
/* eslint-disable valid-jsdoc */
/**
* @private
*/
function compose(ChartClass) {
MenuComponent.compose(ChartClass);
if (composedItems.indexOf(ChartClass) === -1) {
composedItems.push(ChartClass);
var chartProto = ChartClass.prototype;
chartProto.dismissPopupContent = chartDismissPopupContent;
}
if (composedItems.indexOf(doc) === -1) {
composedItems.push(doc);
addEvent(doc, 'keydown', documentOnKeydown);
}
return ChartClass;
}
KeyboardNavigation.compose = compose;
/**
* Dismiss popup content in chart, including export menu and tooltip.
* @private
*/
function chartDismissPopupContent() {
var chart = this;
fireEvent(this, 'dismissPopupContent', {}, function () {
if (chart.tooltip) {
chart.tooltip.hide(0);
}
chart.hideExportMenu();
});
}
/**
* Add event listener to document to detect ESC key press and dismiss
* hover/popup content.
* @private
*/
function documentOnKeydown(e) {
var keycode = e.which || e.keyCode;
var esc = 27;
if (keycode === esc && H.charts) {
H.charts.forEach(function (chart) {
if (chart && chart.dismissPopupContent) {
chart.dismissPopupContent();
}
});
}
}
})(KeyboardNavigation || (KeyboardNavigation = {}));
/* *
*
* Default Export
*
* */
export default KeyboardNavigation;
| {
"content_hash": "22a12ab5fc8b35455cff85bf836a9603",
"timestamp": "",
"source": "github",
"line_count": 448,
"max_line_length": 251,
"avg_line_length": 33.982142857142854,
"alnum_prop": 0.5699553336836574,
"repo_name": "cdnjs/cdnjs",
"id": "4124dc4b4810b7f49b6300ea5b3658b1e1c96d30",
"size": "15225",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajax/libs/highcharts/9.3.1/es-modules/Accessibility/KeyboardNavigation.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
import json
import requests
from hanlder import RequestHandler as BaseRequestHandler
import tornado.web
from ..utils import deal_errors, get_local_time
from .forms import BlogWriterForm
class RequestHandler(BaseRequestHandler):
def q(self, query_string, query_variables={},headers={}):
sid = self.get_secure_cookie('SID')
url = "http://127.0.0.1:3000/graphql"
if sid:
if 'Authorization' not in headers:
headers['Authorization'] = 'OOC ' + sid.decode()
s = requests.Session()
r = s.post(url, json={"query": query_string, "variables": query_variables}, headers=headers)
print("r.text=",r.text)
return r.json()
class IndexHandler(RequestHandler):
BLOG_LIST_QUERY = '''
query Blogs(
$first: Int
$sort_by: String
$sort_direction: String
$after: String
){
blog{id,...F1}
}
fragment F1 on BlogApi{
articles(
first: $first
sort_by: $sort_by
sort_direction: $sort_direction
after: $after
) {
edges {
node {
id
author {
nickname
}
title
body
body_markup
user_id
updated
uid
tags {
name
}
}
}
pageInfo {
hasPreviousPage
startCursor
endCursor
hasNextPage
}
}
}
'''
def get(self):
bloglist_query_variables = {
"first": self.get_argument("first", 4),
"sort_by": "updated",
"sort_direction": "desc",
"after": self.get_argument("after", "")
}
bloglist_query_variables = json.dumps(bloglist_query_variables)
r = self.q(self.BLOG_LIST_QUERY, bloglist_query_variables)
print("index==>blog_list",r)
blog_list = r.get("data").get("blog").get("articles").get("edges")
self.render('index.html', blog_list=blog_list, get_local_time=get_local_time )
class BlogShowHandler(RequestHandler):
BLOG_SHOW_QUERY = '''
query Blog(
$uid: String!
){
blog{id,...F1}
}
fragment F1 on BlogApi{
article: article_u (
uid: $uid
) {
title
body: body_html
tags {
name
}
}
}
'''
def get(self, UID):
blogshow_query_variables = {
"uid": UID,
}
blogshow_query_variables = json.dumps(blogshow_query_variables)
r = self.q(self.BLOG_SHOW_QUERY, blogshow_query_variables)
# print('r--->',r)
blog = r.get("data").get("blog").get("article")
self.render('blog/blog_show.html', blog=blog)
| {
"content_hash": "ec998aebcb44eb1c120bead216666f1a",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 100,
"avg_line_length": 24.267857142857142,
"alnum_prop": 0.5342163355408388,
"repo_name": "nuanri/hiblog",
"id": "7b439a13bf2a49997d7235ce2774aa1317bb8fc8",
"size": "2735",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/blog/views.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "308893"
},
{
"name": "HTML",
"bytes": "121225"
},
{
"name": "JavaScript",
"bytes": "457295"
},
{
"name": "Python",
"bytes": "52385"
}
],
"symlink_target": ""
} |
/* $This file is distributed under the terms of the license in LICENSE$ */
package edu.cornell.mannlib.vedit.validator.impl;
import java.util.Iterator;
import org.apache.jena.iri.IRI;
import org.apache.jena.iri.IRIFactory;
import org.apache.jena.iri.Violation;
import edu.cornell.mannlib.vedit.validator.ValidationObject;
import edu.cornell.mannlib.vedit.validator.Validator;
public class UrlValidator implements Validator {
public ValidationObject validate (Object obj) throws IllegalArgumentException {
ValidationObject vo = new ValidationObject();
if (!(obj instanceof String)){
throw new IllegalArgumentException("Expected instance of String");
}
IRIFactory factory = IRIFactory.jenaImplementation();
IRI iri = factory.create((String) obj);
if (iri.hasViolation(false) ) {
StringBuilder errorStr = new StringBuilder();
Iterator<Violation> violIt = iri.violations(false);
while(violIt.hasNext()) {
errorStr.append(violIt.next().getShortMessage()).append(" ");
}
vo.setValid(false);
vo.setMessage("Please enter a valid URL. " + errorStr);
} else {
vo.setValid(true);
}
vo.setValidatedObject(obj);
return vo;
}
}
| {
"content_hash": "b9189621b9d3392cd12718e6ca8afcbc",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 83,
"avg_line_length": 32.34146341463415,
"alnum_prop": 0.6568627450980392,
"repo_name": "vivo-project/Vitro",
"id": "edaa7743ebd8edf0cdb02e16ec1122cc4612d260",
"size": "1326",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "api/src/main/java/edu/cornell/mannlib/vedit/validator/impl/UrlValidator.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ActionScript",
"bytes": "22844"
},
{
"name": "CSS",
"bytes": "155404"
},
{
"name": "FreeMarker",
"bytes": "373347"
},
{
"name": "HTML",
"bytes": "61363"
},
{
"name": "Java",
"bytes": "7485398"
},
{
"name": "JavaScript",
"bytes": "2110935"
},
{
"name": "Shell",
"bytes": "913"
},
{
"name": "XSLT",
"bytes": "4546"
}
],
"symlink_target": ""
} |
"use strict";
const conversions = require("webidl-conversions");
const utils = require("./utils.js");
const impl = utils.implSymbol;
const HTMLElement = require("./HTMLElement.js");
function HTMLMeterElement() {
throw new TypeError("Illegal constructor");
}
Object.setPrototypeOf(HTMLMeterElement.prototype, HTMLElement.interface.prototype);
Object.setPrototypeOf(HTMLMeterElement, HTMLElement.interface);
Object.defineProperty(HTMLMeterElement, "prototype", {
value: HTMLMeterElement.prototype,
writable: false,
enumerable: false,
configurable: false
});
Object.defineProperty(HTMLMeterElement.prototype, Symbol.toStringTag, {
value: "HTMLMeterElement",
writable: false,
enumerable: false,
configurable: true
});
const iface = {
// When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()`
// method into this array. It allows objects that directly implements *those* interfaces to be recognized as
// implementing this mixin interface.
_mixedIntoPredicates: [],
is(obj) {
if (obj) {
if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) {
return true;
}
for (const isMixedInto of module.exports._mixedIntoPredicates) {
if (isMixedInto(obj)) {
return true;
}
}
}
return false;
},
isImpl(obj) {
if (obj) {
if (obj instanceof Impl.implementation) {
return true;
}
const wrapper = utils.wrapperForImpl(obj);
for (const isMixedInto of module.exports._mixedIntoPredicates) {
if (isMixedInto(wrapper)) {
return true;
}
}
}
return false;
},
convert(obj, { context = "The provided value" } = {}) {
if (module.exports.is(obj)) {
return utils.implForWrapper(obj);
}
throw new TypeError(`${context} is not of type 'HTMLMeterElement'.`);
},
create(constructorArgs, privateData) {
let obj = Object.create(HTMLMeterElement.prototype);
obj = this.setup(obj, constructorArgs, privateData);
return obj;
},
createImpl(constructorArgs, privateData) {
let obj = Object.create(HTMLMeterElement.prototype);
obj = this.setup(obj, constructorArgs, privateData);
return utils.implForWrapper(obj);
},
_internalSetup(obj) {
HTMLElement._internalSetup(obj);
},
setup(obj, constructorArgs, privateData) {
if (!privateData) privateData = {};
privateData.wrapper = obj;
this._internalSetup(obj);
Object.defineProperty(obj, impl, {
value: new Impl.implementation(constructorArgs, privateData),
writable: false,
enumerable: false,
configurable: true
});
obj[impl][utils.wrapperSymbol] = obj;
if (Impl.init) {
Impl.init(obj[impl], privateData);
}
return obj;
},
interface: HTMLMeterElement,
expose: {
Window: { HTMLMeterElement }
}
}; // iface
module.exports = iface;
const Impl = require("../nodes/HTMLMeterElement-impl.js");
| {
"content_hash": "ef4addf6925aab2aa67c0e29664a6ef5",
"timestamp": "",
"source": "github",
"line_count": 109,
"max_line_length": 113,
"avg_line_length": 27.513761467889907,
"alnum_prop": 0.6705568522840947,
"repo_name": "ani2404/ee6761cloud",
"id": "0005cf513b3a4f07e0d3ef215236d32429b78508",
"size": "2999",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "node_modules/jsdom/lib/jsdom/living/generated/HTMLMeterElement.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "50238"
},
{
"name": "HTML",
"bytes": "3393"
},
{
"name": "Java",
"bytes": "4064"
},
{
"name": "JavaScript",
"bytes": "288626"
},
{
"name": "Python",
"bytes": "31948"
}
],
"symlink_target": ""
} |
package controllers
import (
"github.com/ulricqin/beego-blog/models"
"github.com/ulricqin/beego-blog/models/blog"
"github.com/ulricqin/beego-blog/models/catalog"
)
type ArticleController struct {
AdminController
}
func (this *ArticleController) Draft() {
var blogs []*models.Blog
blog.Blogs().Filter("Status", 0).All(&blogs)
this.Data["Blogs"] = blogs
this.Layout = "layout/admin.html"
this.TplNames = "article/draft.html"
}
func (this *ArticleController) Add() {
this.Data["Catalogs"] = catalog.All()
this.Data["IsPost"] = true
this.Layout = "layout/admin.html"
this.TplNames = "article/add.html"
this.JsStorage("deleteKey", "post/new")
}
func (this *ArticleController) DoAdd() {
title := this.GetString("title")
ident := this.GetString("ident")
keywords := this.GetString("keywords")
catalog_id := this.GetIntWithDefault("catalog_id", -1)
aType := this.GetIntWithDefault("type", -1)
status := this.GetIntWithDefault("status", -1)
content := this.GetString("content")
if catalog_id == -1 || aType == -1 || status == -1 {
this.Ctx.WriteString("catalog || type || status is illegal")
return
}
if title == "" || ident == "" {
this.Ctx.WriteString("title or ident is blank")
return
}
cp := catalog.OneById(int64(catalog_id))
if cp == nil {
this.Ctx.WriteString("catalog_id not exists")
return
}
b := &models.Blog{Ident: ident, Title: title, Keywords: keywords, CatalogId: int64(catalog_id), Type: int8(aType), Status: int8(status)}
_, err := blog.Save(b, content)
if err != nil {
this.Ctx.WriteString(err.Error())
return
}
this.JsStorage("deleteKey", "post/new")
this.Redirect("/catalog/"+cp.Ident, 302)
}
func (this *ArticleController) Edit() {
id, err := this.GetInt("id")
if err != nil {
this.Ctx.WriteString("get param id fail")
return
}
b := blog.OneById(int64(id))
if b == nil {
this.Ctx.WriteString("no such article")
return
}
this.Data["Content"] = blog.ReadBlogContent(b).Content
this.Data["Blog"] = b
this.Data["Catalogs"] = catalog.All()
this.Layout = "layout/admin.html"
this.TplNames = "article/edit.html"
}
func (this *ArticleController) DoEdit() {
id, err := this.GetInt("id")
if err != nil {
this.Ctx.WriteString("get param id fail")
return
}
b := blog.OneById(int64(id))
if b == nil {
this.Ctx.WriteString("no such article")
return
}
title := this.GetString("title")
ident := this.GetString("ident")
keywords := this.GetString("keywords")
catalog_id := this.GetIntWithDefault("catalog_id", -1)
aType := this.GetIntWithDefault("type", -1)
status := this.GetIntWithDefault("status", -1)
content := this.GetString("content")
if catalog_id == -1 || aType == -1 || status == -1 {
this.Ctx.WriteString("catalog || type || status is illegal")
return
}
if title == "" || ident == "" {
this.Ctx.WriteString("title or ident is blank")
return
}
cp := catalog.OneById(int64(catalog_id))
if cp == nil {
this.Ctx.WriteString("catalog_id not exists")
return
}
b.Ident = ident
b.Title = title
b.Keywords = keywords
b.CatalogId = int64(catalog_id)
b.Type = int8(aType)
b.Status = int8(status)
err = blog.Update(b, content)
if err != nil {
this.Ctx.WriteString(err.Error())
return
}
this.JsStorage("deleteKey", "post/edit")
this.Redirect("/catalog/"+cp.Ident, 302)
}
func (this *ArticleController) Del() {
id, err := this.GetInt("id")
if err != nil {
this.Ctx.WriteString("get param id fail")
return
}
b := blog.OneById(int64(id))
if b == nil {
this.Ctx.WriteString("no such article")
return
}
err = blog.Del(b)
if err != nil {
this.Ctx.WriteString(err.Error())
return
}
this.Ctx.WriteString("del success")
return
}
| {
"content_hash": "50a182c05ad26b8cda9498c59d7079a0",
"timestamp": "",
"source": "github",
"line_count": 163,
"max_line_length": 137,
"avg_line_length": 22.625766871165645,
"alnum_prop": 0.6635032537960954,
"repo_name": "fsxchen/beego-blog",
"id": "70c069e04136499b090d5659255b388d0dd029ea",
"size": "3688",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "controllers/article_controller.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "13944"
},
{
"name": "Go",
"bytes": "27297"
},
{
"name": "HTML",
"bytes": "25482"
},
{
"name": "Shell",
"bytes": "84"
}
],
"symlink_target": ""
} |
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600,700|Raleway:300,400,500,600,700" rel="stylesheet">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/validator/6.0.0/validator.min.js"></script>
<!--
Notice the use of %PUBLIC_URL% in the tag above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<body>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start`.
To create a production bundle, use `npm run build`.
-->
</body>
</html>
| {
"content_hash": "6ea77dcd038111bed3dc2f380a3dd628",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 131,
"avg_line_length": 38,
"alnum_prop": 0.6787280701754386,
"repo_name": "codemargonda-master/ccc-system",
"id": "2c99db2eeee9434d12723f41c9721af9100ac1a7",
"size": "1824",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "frontend/app/public/index.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "24333"
},
{
"name": "HTML",
"bytes": "2738"
},
{
"name": "JavaScript",
"bytes": "85240"
}
],
"symlink_target": ""
} |
<?php
namespace Fracture\Http;
use Exception;
use ReflectionClass;
use PHPUnit_Framework_TestCase;
class UploadedFileTest extends PHPUnit_Framework_TestCase
{
/**
* @dataProvider provideSimpleTypes
*
* @covers Fracture\Http\UploadedFile::__construct
* @covers Fracture\Http\UploadedFile::getMimeType
* @covers Fracture\Http\UploadedFile::prepare
* @covers Fracture\Http\UploadedFile::hasProperExtension
* @covers Fracture\Http\UploadedFile::isDubious
* @covers Fracture\Http\UploadedFile::getPath
*/
public function testUploadTypes($params, $type, $validity)
{
$instance = $this->getMock('Fracture\Http\UploadedFile', ['seemsTampered'], [$params]);
$instance->expects($this->once())
->method('seemsTampered')
->will($this->returnValue(false));
$instance->prepare();
$this->assertEquals($type, $instance->getMimeType());
$this->assertEquals($validity, $instance->hasProperExtension());
}
public function provideSimpleTypes()
{
return include FIXTURE_PATH . '/uploads-type.php';
}
/**
* @dataProvider provideSimpleValidationList
*
* @covers Fracture\Http\UploadedFile::__construct
* @covers Fracture\Http\UploadedFile::isValid
* @covers Fracture\Http\UploadedFile::prepare
* @covers Fracture\Http\UploadedFile::isDubious
* @covers Fracture\Http\UploadedFile::getPath
*/
public function testUploadValidity($params, $result)
{
$instance = $this->getMock('Fracture\Http\UploadedFile', ['seemsTampered'], [$params]);
$instance->expects($this->any())
->method('seemsTampered')
->will($this->returnValue(false));
$instance->prepare();
$this->assertEquals($result, $instance->isValid());
}
public function provideSimpleValidationList()
{
return include FIXTURE_PATH . '/uploads-validity.php';
}
/**
* @dataProvider provideUploadExtensions
*
* @covers Fracture\Http\UploadedFile::__construct
* @covers Fracture\Http\UploadedFile::getExtension
*/
public function testUploadExtensions($params, $result)
{
$instance = new UploadedFile($params);
$this->assertEquals($result, $instance->getExtension());
}
public function provideUploadExtensions()
{
return include FIXTURE_PATH . '/uploads-extensions.php';
}
/**
* @covers Fracture\Http\UploadedFile::__construct
* @covers Fracture\Http\UploadedFile::getName
* @covers Fracture\Http\UploadedFile::getMimeType
* @covers Fracture\Http\UploadedFile::getSize
*/
public function testSimpleGetters()
{
$params = [
'name' => 'simple.png',
'type' => 'image/png',
'tmp_name' => FIXTURE_PATH . '/files/simple.png',
'error' => UPLOAD_ERR_OK,
'size' => 74,
];
$instance = new UploadedFile($params);
$this->assertEquals($params['name'], $instance->getName());
$this->assertEquals($params['type'], $instance->getMimeType());
$this->assertEquals($params['size'], $instance->getSize());
}
}
| {
"content_hash": "761fab4129b33ca67c5c298c587b8c64",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 95,
"avg_line_length": 30.296296296296298,
"alnum_prop": 0.6194987775061125,
"repo_name": "teresko/http",
"id": "4905c6d074cd868ee3ab496f81bb648897a52929",
"size": "3272",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "tests/unit/Fracture/Http/UploadedFileTest.php",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "PHP",
"bytes": "110729"
}
],
"symlink_target": ""
} |
import platform
from support import Group
from support import meta_service
from clastic import Application
from clastic import render_basic
PORT = 8888
META_PORT = 8889
def home_handler():
return 'Welcome to SuPPort!'
def main():
app = Application([('/', home_handler, render_basic)])
meta_app = meta_service.create_meta_app()
wsgi_apps = [(app, ('0.0.0.0', PORT), False),
(meta_app, ('0.0.0.0', META_PORT), False)]
if platform.system() == 'Windows':
group = Group(wsgi_apps=wsgi_apps)
else:
group = Group(wsgi_apps=wsgi_apps,
prefork=True,
num_workers=2,
daemonize=True)
group.serve_forever()
if __name__ == '__main__':
main()
| {
"content_hash": "c1fa596a9a7fe0080b117ccd43c6f07f",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 59,
"avg_line_length": 23.272727272727273,
"alnum_prop": 0.5768229166666666,
"repo_name": "paypal/support",
"id": "33af43dca6093a23c8355f9685fe578ab52c20bf",
"size": "769",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/basic_wsgi.py",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "HTML",
"bytes": "1332"
},
{
"name": "Jupyter Notebook",
"bytes": "62314"
},
{
"name": "Python",
"bytes": "200095"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.cloudwatch.model;
/**
* <p>
* The <code>AlarmHistoryItem</code> data type contains descriptive information about the history of a specific alarm. If you call DescribeAlarmHistory,
* Amazon CloudWatch returns this data type as part of the DescribeAlarmHistoryResult data type.
* </p>
*/
public class AlarmHistoryItem {
/**
* The descriptive name for the alarm.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*/
private String alarmName;
/**
* The time stamp for the alarm history item.
*/
private java.util.Date timestamp;
/**
* The type of alarm history item.
* <p>
* <b>Constraints:</b><br/>
* <b>Allowed Values: </b>ConfigurationUpdate, StateUpdate, Action
*/
private String historyItemType;
/**
* A human-readable summary of the alarm history.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*/
private String historySummary;
/**
* Machine-readable data about the alarm in JSON format.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 4095<br/>
*/
private String historyData;
/**
* The descriptive name for the alarm.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*
* @return The descriptive name for the alarm.
*/
public String getAlarmName() {
return alarmName;
}
/**
* The descriptive name for the alarm.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*
* @param alarmName The descriptive name for the alarm.
*/
public void setAlarmName(String alarmName) {
this.alarmName = alarmName;
}
/**
* The descriptive name for the alarm.
* <p>
* Returns a reference to this object so that method calls can be chained together.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*
* @param alarmName The descriptive name for the alarm.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public AlarmHistoryItem withAlarmName(String alarmName) {
this.alarmName = alarmName;
return this;
}
/**
* The time stamp for the alarm history item.
*
* @return The time stamp for the alarm history item.
*/
public java.util.Date getTimestamp() {
return timestamp;
}
/**
* The time stamp for the alarm history item.
*
* @param timestamp The time stamp for the alarm history item.
*/
public void setTimestamp(java.util.Date timestamp) {
this.timestamp = timestamp;
}
/**
* The time stamp for the alarm history item.
* <p>
* Returns a reference to this object so that method calls can be chained together.
*
* @param timestamp The time stamp for the alarm history item.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public AlarmHistoryItem withTimestamp(java.util.Date timestamp) {
this.timestamp = timestamp;
return this;
}
/**
* The type of alarm history item.
* <p>
* <b>Constraints:</b><br/>
* <b>Allowed Values: </b>ConfigurationUpdate, StateUpdate, Action
*
* @return The type of alarm history item.
*
* @see HistoryItemType
*/
public String getHistoryItemType() {
return historyItemType;
}
/**
* The type of alarm history item.
* <p>
* <b>Constraints:</b><br/>
* <b>Allowed Values: </b>ConfigurationUpdate, StateUpdate, Action
*
* @param historyItemType The type of alarm history item.
*
* @see HistoryItemType
*/
public void setHistoryItemType(String historyItemType) {
this.historyItemType = historyItemType;
}
/**
* The type of alarm history item.
* <p>
* Returns a reference to this object so that method calls can be chained together.
* <p>
* <b>Constraints:</b><br/>
* <b>Allowed Values: </b>ConfigurationUpdate, StateUpdate, Action
*
* @param historyItemType The type of alarm history item.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see HistoryItemType
*/
public AlarmHistoryItem withHistoryItemType(String historyItemType) {
this.historyItemType = historyItemType;
return this;
}
/**
* The type of alarm history item.
* <p>
* <b>Constraints:</b><br/>
* <b>Allowed Values: </b>ConfigurationUpdate, StateUpdate, Action
*
* @param historyItemType The type of alarm history item.
*
* @see HistoryItemType
*/
public void setHistoryItemType(HistoryItemType historyItemType) {
this.historyItemType = historyItemType.toString();
}
/**
* The type of alarm history item.
* <p>
* Returns a reference to this object so that method calls can be chained together.
* <p>
* <b>Constraints:</b><br/>
* <b>Allowed Values: </b>ConfigurationUpdate, StateUpdate, Action
*
* @param historyItemType The type of alarm history item.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*
* @see HistoryItemType
*/
public AlarmHistoryItem withHistoryItemType(HistoryItemType historyItemType) {
this.historyItemType = historyItemType.toString();
return this;
}
/**
* A human-readable summary of the alarm history.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*
* @return A human-readable summary of the alarm history.
*/
public String getHistorySummary() {
return historySummary;
}
/**
* A human-readable summary of the alarm history.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*
* @param historySummary A human-readable summary of the alarm history.
*/
public void setHistorySummary(String historySummary) {
this.historySummary = historySummary;
}
/**
* A human-readable summary of the alarm history.
* <p>
* Returns a reference to this object so that method calls can be chained together.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 255<br/>
*
* @param historySummary A human-readable summary of the alarm history.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public AlarmHistoryItem withHistorySummary(String historySummary) {
this.historySummary = historySummary;
return this;
}
/**
* Machine-readable data about the alarm in JSON format.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 4095<br/>
*
* @return Machine-readable data about the alarm in JSON format.
*/
public String getHistoryData() {
return historyData;
}
/**
* Machine-readable data about the alarm in JSON format.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 4095<br/>
*
* @param historyData Machine-readable data about the alarm in JSON format.
*/
public void setHistoryData(String historyData) {
this.historyData = historyData;
}
/**
* Machine-readable data about the alarm in JSON format.
* <p>
* Returns a reference to this object so that method calls can be chained together.
* <p>
* <b>Constraints:</b><br/>
* <b>Length: </b>1 - 4095<br/>
*
* @param historyData Machine-readable data about the alarm in JSON format.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public AlarmHistoryItem withHistoryData(String historyData) {
this.historyData = historyData;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (alarmName != null) sb.append("AlarmName: " + alarmName + ", ");
if (timestamp != null) sb.append("Timestamp: " + timestamp + ", ");
if (historyItemType != null) sb.append("HistoryItemType: " + historyItemType + ", ");
if (historySummary != null) sb.append("HistorySummary: " + historySummary + ", ");
if (historyData != null) sb.append("HistoryData: " + historyData + ", ");
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAlarmName() == null) ? 0 : getAlarmName().hashCode());
hashCode = prime * hashCode + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode());
hashCode = prime * hashCode + ((getHistoryItemType() == null) ? 0 : getHistoryItemType().hashCode());
hashCode = prime * hashCode + ((getHistorySummary() == null) ? 0 : getHistorySummary().hashCode());
hashCode = prime * hashCode + ((getHistoryData() == null) ? 0 : getHistoryData().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof AlarmHistoryItem == false) return false;
AlarmHistoryItem other = (AlarmHistoryItem)obj;
if (other.getAlarmName() == null ^ this.getAlarmName() == null) return false;
if (other.getAlarmName() != null && other.getAlarmName().equals(this.getAlarmName()) == false) return false;
if (other.getTimestamp() == null ^ this.getTimestamp() == null) return false;
if (other.getTimestamp() != null && other.getTimestamp().equals(this.getTimestamp()) == false) return false;
if (other.getHistoryItemType() == null ^ this.getHistoryItemType() == null) return false;
if (other.getHistoryItemType() != null && other.getHistoryItemType().equals(this.getHistoryItemType()) == false) return false;
if (other.getHistorySummary() == null ^ this.getHistorySummary() == null) return false;
if (other.getHistorySummary() != null && other.getHistorySummary().equals(this.getHistorySummary()) == false) return false;
if (other.getHistoryData() == null ^ this.getHistoryData() == null) return false;
if (other.getHistoryData() != null && other.getHistoryData().equals(this.getHistoryData()) == false) return false;
return true;
}
}
| {
"content_hash": "36173f2926e7700b57b3901e25ba93b4",
"timestamp": "",
"source": "github",
"line_count": 351,
"max_line_length": 152,
"avg_line_length": 31.752136752136753,
"alnum_prop": 0.5956034096007178,
"repo_name": "XidongHuang/aws-sdk-for-java",
"id": "7150c6db0c75264775a97916234fc864a3e36c2d",
"size": "11732",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "src/main/java/com/amazonaws/services/cloudwatch/model/AlarmHistoryItem.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "33052271"
}
],
"symlink_target": ""
} |
(function(){
Template.__checkName("layout");
Template["layout"] = new Template("Template.layout", (function() {
var view = this;
return Spacebars.include(view.lookupTemplate("ionBody"), function() {
return [ "\n ", Blaze._TemplateWith(function() {
return {
"class": Spacebars.call("bar-positive")
};
}, function() {
return Spacebars.include(view.lookupTemplate("ionNavBar"));
}), "\n ", Spacebars.include(view.lookupTemplate("ionNavView"), function() {
return [ "\n ", Spacebars.include(view.lookupTemplate("yield")), "\n " ];
}), "\n " ];
});
}));
}).call(this);
| {
"content_hash": "30b00d0ea529c5da44ffb96a7b49a591",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 87,
"avg_line_length": 35.22222222222222,
"alnum_prop": 0.5946372239747634,
"repo_name": "csemrm/assignment",
"id": "aa424a1fac2167fc9b61b676e1dea7e0b5379dd1",
"size": "634",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": ".meteor/local/build/programs/web.browser/app/client/template.layout.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1058168"
},
{
"name": "HTML",
"bytes": "7172"
},
{
"name": "JavaScript",
"bytes": "5677514"
}
],
"symlink_target": ""
} |
set -euxo pipefail
export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/$CABALVER/bin:$HOME/.cabal/bin:$PATH
ghc --version
cabal --version
if [ "$CABALVER" = "1.18" ]
then
TEST=--enable-tests
else
TEST=--run-tests
fi
if [ "$BACKEND" = "none" ]
then
cabal install --force-reinstalls $TEST $(cat sources.txt)
else
if [ "$BACKEND" = "postgresql" ]
then
psql -c 'create database persistent;' -U postgres
elif [ "$BACKEND" = "mysql" ]
then
mysql -e 'create database persistent;'
elif [ "$BACKEND" = "zookeeper" ]
then
#sudo add-apt-repository -y ppa:yandex-sysmon/zookeeper-3.4
#sudo apt-get update
#sudo apt-get install -y libzookeeper-mt-dev zookeeperd
#sudo mkdir -p /var/log/zookeeper
#sudo chmod -R 777 /var/log/zookeeper
#sudo chmod 666 /etc/zookeeper/conf/zoo.cfg
#echo maxClientCnxns=128 >> /etc/zookeeper/conf/zoo.cfg
#sudo service zookeeper restart
#sleep 10
/usr/share/zookeeper/bin/zkCli.sh create /persistent null
fi
cd persistent-test
cabal install --force-reinstalls --only-dependencies --enable-tests -f$BACKEND
# Make sure we get regular output sent to Travis to avoid it canceling our
# builds
cabal configure --enable-tests -f$BACKEND
cabal build
cabal test
fi
| {
"content_hash": "73732526f2675214638e1371af58f01f",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 82,
"avg_line_length": 29.02173913043478,
"alnum_prop": 0.6479400749063671,
"repo_name": "jasonzoladz/persistent",
"id": "744662d310a57c6a9b886de2019d96c0fde7d317",
"size": "1356",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "travis/run.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "5749101"
},
{
"name": "C++",
"bytes": "380214"
},
{
"name": "Haskell",
"bytes": "592807"
},
{
"name": "Shell",
"bytes": "2070"
}
],
"symlink_target": ""
} |
#ifndef ASF_H
#define ASF_H
/*
* This file includes all API header files for the selected drivers from ASF.
* Note: There might be duplicate includes required by more than one driver.
*
* The file is automatically generated and will be re-written when
* running the ASF driver selector tool. Any changes will be discarded.
*/
// From module: Compiler abstraction layer and code utilities
#include <compiler.h>
#include <status_codes.h>
// From module: FAT file system
#include <fat.h>
#include <file.h>
#include <fs_com.h>
#include <navigation.h>
// From module: FLASHC - Flash Controller
#include <flashc.h>
// From module: GPIO - General-Purpose Input/Output
#include <gpio.h>
// From module: Generic board support
#include <board.h>
// From module: Interrupt management - UC3 implementation
#include <interrupt.h>
// From module: Memory Control Access Interface
#include <ctrl_access.h>
// From module: PM Power Manager - UC3 C0/C1/C2 implementation
#include <power_clocks_lib.h>
#include <sleep.h>
// From module: Part identification macros
#include <parts.h>
// From module: SCIF System Control Interface - UC3C implementation
#include <scif_uc3c.h>
// From module: SPI - Serial Peripheral Interface
#include <spi.h>
// From module: UC3C-EK
#include <led.h>
// From module: USART - Universal Synchronous/Asynchronous Receiver/Transmitter
#include <usart.h>
// From module: USART Debug strings
#include <print_funcs.h>
#endif // ASF_H
| {
"content_hash": "0296d9f2370e4ce6a916653db25101d7",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 79,
"avg_line_length": 24.75409836065574,
"alnum_prop": 0.7132450331125828,
"repo_name": "femtoio/femto-usb-blink-example",
"id": "a3507663cc885c1c10e7177d3d4bf0c73f8dfb2b",
"size": "3302",
"binary": false,
"copies": "6",
"ref": "refs/heads/master",
"path": "blinky/blinky/asf-3.21.0/avr32/services/fs/fat/fat_example/at32uc3c0512c_uc3c_ek/gcc/asf.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "178794"
},
{
"name": "C",
"bytes": "251878780"
},
{
"name": "C++",
"bytes": "47991929"
},
{
"name": "CSS",
"bytes": "2147"
},
{
"name": "HTML",
"bytes": "107322"
},
{
"name": "JavaScript",
"bytes": "588817"
},
{
"name": "Logos",
"bytes": "570108"
},
{
"name": "Makefile",
"bytes": "64558964"
},
{
"name": "Matlab",
"bytes": "10660"
},
{
"name": "Objective-C",
"bytes": "15780083"
},
{
"name": "Perl",
"bytes": "12845"
},
{
"name": "Python",
"bytes": "67293"
},
{
"name": "Scilab",
"bytes": "88572"
},
{
"name": "Shell",
"bytes": "126729"
}
],
"symlink_target": ""
} |
package com.ctrip.xpipe.redis.keeper.applier;
import com.ctrip.xpipe.api.endpoint.Endpoint;
import com.ctrip.xpipe.api.lifecycle.Lifecycle;
import com.ctrip.xpipe.gtid.GtidSet;
import com.ctrip.xpipe.redis.core.entity.ApplierInstanceMeta;
import com.ctrip.xpipe.redis.keeper.RedisServer;
/**
* @author Slight
* <p>
* Jun 10, 2022 11:38
*/
public interface ApplierServer extends Lifecycle, RedisServer {
enum STATE { NONE, ACTIVE, BACKUP }
int getListeningPort();
ApplierInstanceMeta getApplierInstanceMeta();
void setStateActive(Endpoint endpoint, GtidSet gtidSet);
void setStateBackup();
STATE getState();
Endpoint getUpstreamEndpoint();
}
| {
"content_hash": "6cc0ff109ffc42bea27e2a956e0a1b13",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 63,
"avg_line_length": 22.766666666666666,
"alnum_prop": 0.7496339677891655,
"repo_name": "ctripcorp/x-pipe",
"id": "6787252338504d22a3f645223ee5869f0460a6c9",
"size": "683",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "redis/redis-keeper/src/main/java/com/ctrip/xpipe/redis/keeper/applier/ApplierServer.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1933"
},
{
"name": "Dockerfile",
"bytes": "1061"
},
{
"name": "HTML",
"bytes": "182469"
},
{
"name": "Java",
"bytes": "9045838"
},
{
"name": "JavaScript",
"bytes": "1615"
},
{
"name": "Python",
"bytes": "10427"
},
{
"name": "Shell",
"bytes": "73728"
},
{
"name": "TypeScript",
"bytes": "235225"
}
],
"symlink_target": ""
} |
class ApplicationController < ActionController::Base
# protect_from_forgery
before_action :authenticate_user!
end
| {
"content_hash": "2b48bf82f5405e66f4aa60a730ca691c",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 52,
"avg_line_length": 29.5,
"alnum_prop": 0.8050847457627118,
"repo_name": "bitgaming/devise_google_authenticator",
"id": "b89a27e6e16949a1d1eae6bb25edea2c9431a026",
"size": "118",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/rails_app/app/controllers/application_controller.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "350"
},
{
"name": "CoffeeScript",
"bytes": "229"
},
{
"name": "HTML",
"bytes": "3974"
},
{
"name": "JavaScript",
"bytes": "463"
},
{
"name": "Ruby",
"bytes": "65858"
},
{
"name": "SCSS",
"bytes": "1193"
}
],
"symlink_target": ""
} |
package examples
// FastIntSizer defines an interface for sizing methods on int collections.
type FastIntSizer interface {
// IsEmpty tests whether FastIntCollection is empty.
IsEmpty() bool
// NonEmpty tests whether FastIntCollection is empty.
NonEmpty() bool
// Size returns the number of items in the collection - an alias of Len().
Size() int
}
// FastIntMkStringer defines an interface for stringer methods on int collections.
type FastIntMkStringer interface {
// String implements the Stringer interface to render the collection as a comma-separated string enclosed
// in square brackets.
String() string
// MkString concatenates the values as a string using a supplied separator. No enclosing marks are added.
MkString(sep string) string
// MkString3 concatenates the values as a string, using the prefix, separator and suffix supplied.
MkString3(before, between, after string) string
// implements json.Marshaler interface {
MarshalJSON() ([]byte, error)
// implements json.Unmarshaler interface {
UnmarshalJSON(b []byte) error
// StringList gets a collection of strings that depicts all the elements.
StringList() []string
}
// FastIntCollection defines an interface for common collection methods on int.
type FastIntCollection interface {
FastIntSizer
FastIntMkStringer
// IsSequence returns true for lists and queues.
IsSequence() bool
// IsSet returns false for lists and queues.
IsSet() bool
// ToSlice returns a shallow copy as a plain slice.
ToSlice() []int
// ToInterfaceSlice returns a shallow copy as a slice of arbitrary type.
ToInterfaceSlice() []interface{}
// Exists verifies that one or more elements of FastIntCollection return true for the predicate p.
Exists(p func(int) bool) bool
// Forall verifies that all elements of FastIntCollection return true for the predicate p.
Forall(p func(int) bool) bool
// Foreach iterates over FastIntCollection and executes the function f against each element.
Foreach(f func(int))
// Find returns the first int that returns true for the predicate p.
// False is returned if none match.
Find(p func(int) bool) (int, bool)
// Send returns a channel that will send all the elements in order. Can be used with the plumbing code, for example.
// A goroutine is created to send the elements; this only terminates when all the elements have been consumed
Send() <-chan int
// CountBy gives the number elements of FastIntCollection that return true for the predicate p.
CountBy(p func(int) bool) int
// Contains determines whether a given item is already in the collection, returning true if so.
Contains(v int) bool
// ContainsAll determines whether the given items are all in the collection, returning true if so.
ContainsAll(v ...int) bool
// Clear the entire collection.
Clear()
// Add adds items to the current collection.
Add(more ...int)
// Min returns the minimum value of all the items in the collection. Panics if there are no elements.
Min() int
// Max returns the minimum value of all the items in the collection. Panics if there are no elements.
Max() int
// MinBy returns an element of FastIntCollection containing the minimum value, when compared to other elements
// using a passed func defining ‘less’. In the case of multiple items being equally minimal, the first such
// element is returned. Panics if there are no elements.
MinBy(less func(int, int) bool) int
// MaxBy returns an element of FastIntCollection containing the maximum value, when compared to other elements
// using a passed func defining ‘less’. In the case of multiple items being equally maximal, the first such
// element is returned. Panics if there are no elements.
MaxBy(less func(int, int) bool) int
// Fold aggregates all the values in the collection using a supplied function, starting from some initial value.
Fold(initial int, fn func(int, int) int) int
// Sum returns the sum of all the elements in the collection.
Sum() int
}
// FastIntSequence defines an interface for sequence methods on int.
type FastIntSequence interface {
FastIntCollection
// Head gets the first element in the sequence. Head plus Tail include the whole sequence. Head is the opposite of Last.
Head() int
// HeadOption gets the first element in the sequence, if possible.
HeadOption() (int, bool)
// Last gets the last element in the sequence. Init plus Last include the whole sequence. Last is the opposite of Head.
Last() int
// LastOption gets the last element in the sequence, if possible.
LastOption() (int, bool)
}
| {
"content_hash": "482c4528bb436312f8fc613c582c6bf3",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 121,
"avg_line_length": 36.766129032258064,
"alnum_prop": 0.760473788111428,
"repo_name": "rickb777/runtemplate",
"id": "c572cdd965e5869de2870cb9ab2f8b0da1d31271",
"size": "4818",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/fast_int_collection.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "73519"
},
{
"name": "Shell",
"bytes": "4907"
},
{
"name": "Smarty",
"bytes": "494313"
}
],
"symlink_target": ""
} |
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { AccountsList } from './account/accounts_list.component';
import { AccountForm } from './account/account_form.component';
import { AccountService } from './account/account.services';
import { LoggerService } from './util/logger.service';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent, AccountsList, AccountForm ],
bootstrap: [ AppComponent ],
providers: [ AccountService, LoggerService ]
})
export class AppModule { }
| {
"content_hash": "21a99eec85edcf3e93073a3162ca5fe9",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 65,
"avg_line_length": 39.0625,
"alnum_prop": 0.7104,
"repo_name": "jollylengkono/quickstart-master",
"id": "266fe3e53aa142c14ba0f94f02375988ff43f739",
"size": "625",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/app/app.module.ts",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "327"
},
{
"name": "HTML",
"bytes": "2738"
},
{
"name": "JavaScript",
"bytes": "14954"
},
{
"name": "TypeScript",
"bytes": "6174"
}
],
"symlink_target": ""
} |
/**************************************************************************//**
* @file core_cm7.h
* @brief CMSIS Cortex-M7 Core Peripheral Access Layer Header File
* @version V5.1.6
* @date 04. June 2021
******************************************************************************/
/*
* Copyright (c) 2009-2021 Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* 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
*
* 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.
*/
#if defined ( __ICCARM__ )
#pragma system_include /* treat file as system include file for MISRA check */
#elif defined (__clang__)
#pragma clang system_header /* treat file as system include file */
#endif
#ifndef __CORE_CM7_H_GENERIC
#define __CORE_CM7_H_GENERIC
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
\page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions
CMSIS violates the following MISRA-C:2004 rules:
\li Required Rule 8.5, object/function definition in header file.<br>
Function definitions in header files are used to allow 'inlining'.
\li Required Rule 18.4, declaration of union type or object of union type: '{...}'.<br>
Unions are used for effective representation of core registers.
\li Advisory Rule 19.7, Function-like macro defined.<br>
Function-like macros are used to allow more efficient code.
*/
/*******************************************************************************
* CMSIS definitions
******************************************************************************/
/**
\ingroup Cortex_M7
@{
*/
#include "cmsis_version.h"
/* CMSIS CM7 definitions */
#define __CM7_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */
#define __CM7_CMSIS_VERSION_SUB ( __CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */
#define __CM7_CMSIS_VERSION ((__CM7_CMSIS_VERSION_MAIN << 16U) | \
__CM7_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */
#define __CORTEX_M (7U) /*!< Cortex-M Core */
/** __FPU_USED indicates whether an FPU is used or not.
For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions.
*/
#if defined ( __CC_ARM )
#if defined __TARGET_FPU_VFP
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#define __FPU_USED 0U
#endif
#else
#define __FPU_USED 0U
#endif
#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#if defined __ARM_FP
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
#warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#define __FPU_USED 0U
#endif
#else
#define __FPU_USED 0U
#endif
#elif defined ( __GNUC__ )
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#define __FPU_USED 0U
#endif
#else
#define __FPU_USED 0U
#endif
#elif defined ( __ICCARM__ )
#if defined __ARMVFP__
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#define __FPU_USED 0U
#endif
#else
#define __FPU_USED 0U
#endif
#elif defined ( __TI_ARM__ )
#if defined __TI_VFP_SUPPORT__
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#define __FPU_USED 0U
#endif
#else
#define __FPU_USED 0U
#endif
#elif defined ( __TASKING__ )
#if defined __FPU_VFP__
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#define __FPU_USED 0U
#endif
#else
#define __FPU_USED 0U
#endif
#elif defined ( __CSMC__ )
#if ( __CSMC__ & 0x400U)
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#define __FPU_USED 0U
#endif
#else
#define __FPU_USED 0U
#endif
#endif
#include "cmsis_compiler.h" /* CMSIS compiler specific defines */
#ifdef __cplusplus
}
#endif
#endif /* __CORE_CM7_H_GENERIC */
#ifndef __CMSIS_GENERIC
#ifndef __CORE_CM7_H_DEPENDANT
#define __CORE_CM7_H_DEPENDANT
#ifdef __cplusplus
extern "C" {
#endif
/* check device defines and use defaults */
#if defined __CHECK_DEVICE_DEFINES
#ifndef __CM7_REV
#define __CM7_REV 0x0000U
#warning "__CM7_REV not defined in device header file; using default!"
#endif
#ifndef __FPU_PRESENT
#define __FPU_PRESENT 0U
#warning "__FPU_PRESENT not defined in device header file; using default!"
#endif
#ifndef __MPU_PRESENT
#define __MPU_PRESENT 0U
#warning "__MPU_PRESENT not defined in device header file; using default!"
#endif
#ifndef __ICACHE_PRESENT
#define __ICACHE_PRESENT 0U
#warning "__ICACHE_PRESENT not defined in device header file; using default!"
#endif
#ifndef __DCACHE_PRESENT
#define __DCACHE_PRESENT 0U
#warning "__DCACHE_PRESENT not defined in device header file; using default!"
#endif
#ifndef __DTCM_PRESENT
#define __DTCM_PRESENT 0U
#warning "__DTCM_PRESENT not defined in device header file; using default!"
#endif
#ifndef __VTOR_PRESENT
#define __VTOR_PRESENT 1U
#warning "__VTOR_PRESENT not defined in device header file; using default!"
#endif
#ifndef __NVIC_PRIO_BITS
#define __NVIC_PRIO_BITS 3U
#warning "__NVIC_PRIO_BITS not defined in device header file; using default!"
#endif
#ifndef __Vendor_SysTickConfig
#define __Vendor_SysTickConfig 0U
#warning "__Vendor_SysTickConfig not defined in device header file; using default!"
#endif
#endif
/* IO definitions (access restrictions to peripheral registers) */
/**
\defgroup CMSIS_glob_defs CMSIS Global Defines
<strong>IO Type Qualifiers</strong> are used
\li to specify the access to peripheral variables.
\li for automatic generation of peripheral register debug information.
*/
#ifdef __cplusplus
#define __I volatile /*!< Defines 'read only' permissions */
#else
#define __I volatile const /*!< Defines 'read only' permissions */
#endif
#define __O volatile /*!< Defines 'write only' permissions */
#define __IO volatile /*!< Defines 'read / write' permissions */
/* following defines should be used for structure members */
#define __IM volatile const /*! Defines 'read only' structure member permissions */
#define __OM volatile /*! Defines 'write only' structure member permissions */
#define __IOM volatile /*! Defines 'read / write' structure member permissions */
/*@} end of group Cortex_M7 */
/*******************************************************************************
* Register Abstraction
Core Register contain:
- Core Register
- Core NVIC Register
- Core SCB Register
- Core SysTick Register
- Core Debug Register
- Core MPU Register
- Core FPU Register
******************************************************************************/
/**
\defgroup CMSIS_core_register Defines and Type Definitions
\brief Type definitions and defines for Cortex-M processor based devices.
*/
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_CORE Status and Control Registers
\brief Core Register type definitions.
@{
*/
/**
\brief Union type to access the Application Program Status Register (APSR).
*/
typedef union
{
struct
{
uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */
uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */
uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
} b; /*!< Structure used for bit access */
uint32_t w; /*!< Type used for word access */
} APSR_Type;
/* APSR Register Definitions */
#define APSR_N_Pos 31U /*!< APSR: N Position */
#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */
#define APSR_Z_Pos 30U /*!< APSR: Z Position */
#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */
#define APSR_C_Pos 29U /*!< APSR: C Position */
#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */
#define APSR_V_Pos 28U /*!< APSR: V Position */
#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */
#define APSR_Q_Pos 27U /*!< APSR: Q Position */
#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */
#define APSR_GE_Pos 16U /*!< APSR: GE Position */
#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */
/**
\brief Union type to access the Interrupt Program Status Register (IPSR).
*/
typedef union
{
struct
{
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */
} b; /*!< Structure used for bit access */
uint32_t w; /*!< Type used for word access */
} IPSR_Type;
/* IPSR Register Definitions */
#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */
#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */
/**
\brief Union type to access the Special-Purpose Program Status Registers (xPSR).
*/
typedef union
{
struct
{
uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */
uint32_t _reserved0:1; /*!< bit: 9 Reserved */
uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */
uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */
uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */
uint32_t T:1; /*!< bit: 24 Thumb bit */
uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */
uint32_t Q:1; /*!< bit: 27 Saturation condition flag */
uint32_t V:1; /*!< bit: 28 Overflow condition code flag */
uint32_t C:1; /*!< bit: 29 Carry condition code flag */
uint32_t Z:1; /*!< bit: 30 Zero condition code flag */
uint32_t N:1; /*!< bit: 31 Negative condition code flag */
} b; /*!< Structure used for bit access */
uint32_t w; /*!< Type used for word access */
} xPSR_Type;
/* xPSR Register Definitions */
#define xPSR_N_Pos 31U /*!< xPSR: N Position */
#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */
#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */
#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */
#define xPSR_C_Pos 29U /*!< xPSR: C Position */
#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */
#define xPSR_V_Pos 28U /*!< xPSR: V Position */
#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */
#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */
#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */
#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */
#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */
#define xPSR_T_Pos 24U /*!< xPSR: T Position */
#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */
#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */
#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */
#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */
#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */
#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */
#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */
/**
\brief Union type to access the Control Registers (CONTROL).
*/
typedef union
{
struct
{
uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */
uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */
uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */
uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */
} b; /*!< Structure used for bit access */
uint32_t w; /*!< Type used for word access */
} CONTROL_Type;
/* CONTROL Register Definitions */
#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */
#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */
#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */
#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */
#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */
#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */
/*@} end of group CMSIS_CORE */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC)
\brief Type definitions for the NVIC Registers
@{
*/
/**
\brief Structure type to access the Nested Vectored Interrupt Controller (NVIC).
*/
typedef struct
{
__IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */
uint32_t RESERVED0[24U];
__IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */
uint32_t RESERVED1[24U];
__IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */
uint32_t RESERVED2[24U];
__IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */
uint32_t RESERVED3[24U];
__IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */
uint32_t RESERVED4[56U];
__IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */
uint32_t RESERVED5[644U];
__OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */
} NVIC_Type;
/* Software Triggered Interrupt Register Definitions */
#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */
#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */
/*@} end of group CMSIS_NVIC */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_SCB System Control Block (SCB)
\brief Type definitions for the System Control Block Registers
@{
*/
/**
\brief Structure type to access the System Control Block (SCB).
*/
typedef struct
{
__IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */
__IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */
__IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */
__IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */
__IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */
__IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */
__IOM uint8_t SHPR[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */
__IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */
__IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */
__IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */
__IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */
__IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */
__IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */
__IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */
__IM uint32_t ID_PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */
__IM uint32_t ID_DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */
__IM uint32_t ID_AFR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */
__IM uint32_t ID_MFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */
__IM uint32_t ID_ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */
uint32_t RESERVED0[1U];
__IM uint32_t CLIDR; /*!< Offset: 0x078 (R/ ) Cache Level ID register */
__IM uint32_t CTR; /*!< Offset: 0x07C (R/ ) Cache Type register */
__IM uint32_t CCSIDR; /*!< Offset: 0x080 (R/ ) Cache Size ID Register */
__IOM uint32_t CSSELR; /*!< Offset: 0x084 (R/W) Cache Size Selection Register */
__IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */
uint32_t RESERVED3[93U];
__OM uint32_t STIR; /*!< Offset: 0x200 ( /W) Software Triggered Interrupt Register */
uint32_t RESERVED4[15U];
__IM uint32_t MVFR0; /*!< Offset: 0x240 (R/ ) Media and VFP Feature Register 0 */
__IM uint32_t MVFR1; /*!< Offset: 0x244 (R/ ) Media and VFP Feature Register 1 */
__IM uint32_t MVFR2; /*!< Offset: 0x248 (R/ ) Media and VFP Feature Register 2 */
uint32_t RESERVED5[1U];
__OM uint32_t ICIALLU; /*!< Offset: 0x250 ( /W) I-Cache Invalidate All to PoU */
uint32_t RESERVED6[1U];
__OM uint32_t ICIMVAU; /*!< Offset: 0x258 ( /W) I-Cache Invalidate by MVA to PoU */
__OM uint32_t DCIMVAC; /*!< Offset: 0x25C ( /W) D-Cache Invalidate by MVA to PoC */
__OM uint32_t DCISW; /*!< Offset: 0x260 ( /W) D-Cache Invalidate by Set-way */
__OM uint32_t DCCMVAU; /*!< Offset: 0x264 ( /W) D-Cache Clean by MVA to PoU */
__OM uint32_t DCCMVAC; /*!< Offset: 0x268 ( /W) D-Cache Clean by MVA to PoC */
__OM uint32_t DCCSW; /*!< Offset: 0x26C ( /W) D-Cache Clean by Set-way */
__OM uint32_t DCCIMVAC; /*!< Offset: 0x270 ( /W) D-Cache Clean and Invalidate by MVA to PoC */
__OM uint32_t DCCISW; /*!< Offset: 0x274 ( /W) D-Cache Clean and Invalidate by Set-way */
__OM uint32_t BPIALL; /*!< Offset: 0x278 ( /W) Branch Predictor Invalidate All */
uint32_t RESERVED7[5U];
__IOM uint32_t ITCMCR; /*!< Offset: 0x290 (R/W) Instruction Tightly-Coupled Memory Control Register */
__IOM uint32_t DTCMCR; /*!< Offset: 0x294 (R/W) Data Tightly-Coupled Memory Control Registers */
__IOM uint32_t AHBPCR; /*!< Offset: 0x298 (R/W) AHBP Control Register */
__IOM uint32_t CACR; /*!< Offset: 0x29C (R/W) L1 Cache Control Register */
__IOM uint32_t AHBSCR; /*!< Offset: 0x2A0 (R/W) AHB Slave Control Register */
uint32_t RESERVED8[1U];
__IOM uint32_t ABFSR; /*!< Offset: 0x2A8 (R/W) Auxiliary Bus Fault Status Register */
} SCB_Type;
/* SCB CPUID Register Definitions */
#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */
#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */
#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */
#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */
#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */
#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */
#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */
/* SCB Interrupt Control State Register Definitions */
#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */
#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */
#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */
#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */
#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */
#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */
#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */
#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */
#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */
#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */
#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */
/* SCB Vector Table Offset Register Definitions */
#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */
#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
/* SCB Application Interrupt and Reset Control Register Definitions */
#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */
#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */
#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */
#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */
#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */
#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */
#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */
#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */
/* SCB System Control Register Definitions */
#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */
#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */
#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */
#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
/* SCB Configuration Control Register Definitions */
#define SCB_CCR_BP_Pos 18U /*!< SCB CCR: Branch prediction enable bit Position */
#define SCB_CCR_BP_Msk (1UL << SCB_CCR_BP_Pos) /*!< SCB CCR: Branch prediction enable bit Mask */
#define SCB_CCR_IC_Pos 17U /*!< SCB CCR: Instruction cache enable bit Position */
#define SCB_CCR_IC_Msk (1UL << SCB_CCR_IC_Pos) /*!< SCB CCR: Instruction cache enable bit Mask */
#define SCB_CCR_DC_Pos 16U /*!< SCB CCR: Cache enable bit Position */
#define SCB_CCR_DC_Msk (1UL << SCB_CCR_DC_Pos) /*!< SCB CCR: Cache enable bit Mask */
#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */
#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */
#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */
#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */
#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */
#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */
#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */
/* SCB System Handler Control and State Register Definitions */
#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */
#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */
#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */
#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */
#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */
#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */
#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */
#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */
#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */
#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */
#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */
#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */
#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */
#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */
#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */
#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */
#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */
#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */
#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */
#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */
#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */
#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */
#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */
#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */
/* SCB Configurable Fault Status Register Definitions */
#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */
#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */
#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */
#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */
#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */
#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */
#define SCB_CFSR_MMARVALID_Pos (SCB_CFSR_MEMFAULTSR_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */
#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */
#define SCB_CFSR_MLSPERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */
#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */
#define SCB_CFSR_MSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */
#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */
#define SCB_CFSR_MUNSTKERR_Pos (SCB_CFSR_MEMFAULTSR_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */
#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */
#define SCB_CFSR_DACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */
#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */
#define SCB_CFSR_IACCVIOL_Pos (SCB_CFSR_MEMFAULTSR_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */
#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */
/* BusFault Status Register (part of SCB Configurable Fault Status Register) */
#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */
#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */
#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */
#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */
#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */
#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */
#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */
#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */
#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */
#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */
#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */
#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */
#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */
#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */
/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */
#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */
#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */
#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */
#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */
#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */
#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */
#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */
#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */
#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */
#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */
#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */
#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */
/* SCB Hard Fault Status Register Definitions */
#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */
#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */
#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */
#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */
#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */
#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */
/* SCB Debug Fault Status Register Definitions */
#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */
#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */
#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */
#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */
#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */
#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */
/* SCB Cache Level ID Register Definitions */
#define SCB_CLIDR_LOUU_Pos 27U /*!< SCB CLIDR: LoUU Position */
#define SCB_CLIDR_LOUU_Msk (7UL << SCB_CLIDR_LOUU_Pos) /*!< SCB CLIDR: LoUU Mask */
#define SCB_CLIDR_LOC_Pos 24U /*!< SCB CLIDR: LoC Position */
#define SCB_CLIDR_LOC_Msk (7UL << SCB_CLIDR_LOC_Pos) /*!< SCB CLIDR: LoC Mask */
/* SCB Cache Type Register Definitions */
#define SCB_CTR_FORMAT_Pos 29U /*!< SCB CTR: Format Position */
#define SCB_CTR_FORMAT_Msk (7UL << SCB_CTR_FORMAT_Pos) /*!< SCB CTR: Format Mask */
#define SCB_CTR_CWG_Pos 24U /*!< SCB CTR: CWG Position */
#define SCB_CTR_CWG_Msk (0xFUL << SCB_CTR_CWG_Pos) /*!< SCB CTR: CWG Mask */
#define SCB_CTR_ERG_Pos 20U /*!< SCB CTR: ERG Position */
#define SCB_CTR_ERG_Msk (0xFUL << SCB_CTR_ERG_Pos) /*!< SCB CTR: ERG Mask */
#define SCB_CTR_DMINLINE_Pos 16U /*!< SCB CTR: DminLine Position */
#define SCB_CTR_DMINLINE_Msk (0xFUL << SCB_CTR_DMINLINE_Pos) /*!< SCB CTR: DminLine Mask */
#define SCB_CTR_IMINLINE_Pos 0U /*!< SCB CTR: ImInLine Position */
#define SCB_CTR_IMINLINE_Msk (0xFUL /*<< SCB_CTR_IMINLINE_Pos*/) /*!< SCB CTR: ImInLine Mask */
/* SCB Cache Size ID Register Definitions */
#define SCB_CCSIDR_WT_Pos 31U /*!< SCB CCSIDR: WT Position */
#define SCB_CCSIDR_WT_Msk (1UL << SCB_CCSIDR_WT_Pos) /*!< SCB CCSIDR: WT Mask */
#define SCB_CCSIDR_WB_Pos 30U /*!< SCB CCSIDR: WB Position */
#define SCB_CCSIDR_WB_Msk (1UL << SCB_CCSIDR_WB_Pos) /*!< SCB CCSIDR: WB Mask */
#define SCB_CCSIDR_RA_Pos 29U /*!< SCB CCSIDR: RA Position */
#define SCB_CCSIDR_RA_Msk (1UL << SCB_CCSIDR_RA_Pos) /*!< SCB CCSIDR: RA Mask */
#define SCB_CCSIDR_WA_Pos 28U /*!< SCB CCSIDR: WA Position */
#define SCB_CCSIDR_WA_Msk (1UL << SCB_CCSIDR_WA_Pos) /*!< SCB CCSIDR: WA Mask */
#define SCB_CCSIDR_NUMSETS_Pos 13U /*!< SCB CCSIDR: NumSets Position */
#define SCB_CCSIDR_NUMSETS_Msk (0x7FFFUL << SCB_CCSIDR_NUMSETS_Pos) /*!< SCB CCSIDR: NumSets Mask */
#define SCB_CCSIDR_ASSOCIATIVITY_Pos 3U /*!< SCB CCSIDR: Associativity Position */
#define SCB_CCSIDR_ASSOCIATIVITY_Msk (0x3FFUL << SCB_CCSIDR_ASSOCIATIVITY_Pos) /*!< SCB CCSIDR: Associativity Mask */
#define SCB_CCSIDR_LINESIZE_Pos 0U /*!< SCB CCSIDR: LineSize Position */
#define SCB_CCSIDR_LINESIZE_Msk (7UL /*<< SCB_CCSIDR_LINESIZE_Pos*/) /*!< SCB CCSIDR: LineSize Mask */
/* SCB Cache Size Selection Register Definitions */
#define SCB_CSSELR_LEVEL_Pos 1U /*!< SCB CSSELR: Level Position */
#define SCB_CSSELR_LEVEL_Msk (7UL << SCB_CSSELR_LEVEL_Pos) /*!< SCB CSSELR: Level Mask */
#define SCB_CSSELR_IND_Pos 0U /*!< SCB CSSELR: InD Position */
#define SCB_CSSELR_IND_Msk (1UL /*<< SCB_CSSELR_IND_Pos*/) /*!< SCB CSSELR: InD Mask */
/* SCB Software Triggered Interrupt Register Definitions */
#define SCB_STIR_INTID_Pos 0U /*!< SCB STIR: INTID Position */
#define SCB_STIR_INTID_Msk (0x1FFUL /*<< SCB_STIR_INTID_Pos*/) /*!< SCB STIR: INTID Mask */
/* SCB D-Cache Invalidate by Set-way Register Definitions */
#define SCB_DCISW_WAY_Pos 30U /*!< SCB DCISW: Way Position */
#define SCB_DCISW_WAY_Msk (3UL << SCB_DCISW_WAY_Pos) /*!< SCB DCISW: Way Mask */
#define SCB_DCISW_SET_Pos 5U /*!< SCB DCISW: Set Position */
#define SCB_DCISW_SET_Msk (0x1FFUL << SCB_DCISW_SET_Pos) /*!< SCB DCISW: Set Mask */
/* SCB D-Cache Clean by Set-way Register Definitions */
#define SCB_DCCSW_WAY_Pos 30U /*!< SCB DCCSW: Way Position */
#define SCB_DCCSW_WAY_Msk (3UL << SCB_DCCSW_WAY_Pos) /*!< SCB DCCSW: Way Mask */
#define SCB_DCCSW_SET_Pos 5U /*!< SCB DCCSW: Set Position */
#define SCB_DCCSW_SET_Msk (0x1FFUL << SCB_DCCSW_SET_Pos) /*!< SCB DCCSW: Set Mask */
/* SCB D-Cache Clean and Invalidate by Set-way Register Definitions */
#define SCB_DCCISW_WAY_Pos 30U /*!< SCB DCCISW: Way Position */
#define SCB_DCCISW_WAY_Msk (3UL << SCB_DCCISW_WAY_Pos) /*!< SCB DCCISW: Way Mask */
#define SCB_DCCISW_SET_Pos 5U /*!< SCB DCCISW: Set Position */
#define SCB_DCCISW_SET_Msk (0x1FFUL << SCB_DCCISW_SET_Pos) /*!< SCB DCCISW: Set Mask */
/* Instruction Tightly-Coupled Memory Control Register Definitions */
#define SCB_ITCMCR_SZ_Pos 3U /*!< SCB ITCMCR: SZ Position */
#define SCB_ITCMCR_SZ_Msk (0xFUL << SCB_ITCMCR_SZ_Pos) /*!< SCB ITCMCR: SZ Mask */
#define SCB_ITCMCR_RETEN_Pos 2U /*!< SCB ITCMCR: RETEN Position */
#define SCB_ITCMCR_RETEN_Msk (1UL << SCB_ITCMCR_RETEN_Pos) /*!< SCB ITCMCR: RETEN Mask */
#define SCB_ITCMCR_RMW_Pos 1U /*!< SCB ITCMCR: RMW Position */
#define SCB_ITCMCR_RMW_Msk (1UL << SCB_ITCMCR_RMW_Pos) /*!< SCB ITCMCR: RMW Mask */
#define SCB_ITCMCR_EN_Pos 0U /*!< SCB ITCMCR: EN Position */
#define SCB_ITCMCR_EN_Msk (1UL /*<< SCB_ITCMCR_EN_Pos*/) /*!< SCB ITCMCR: EN Mask */
/* Data Tightly-Coupled Memory Control Register Definitions */
#define SCB_DTCMCR_SZ_Pos 3U /*!< SCB DTCMCR: SZ Position */
#define SCB_DTCMCR_SZ_Msk (0xFUL << SCB_DTCMCR_SZ_Pos) /*!< SCB DTCMCR: SZ Mask */
#define SCB_DTCMCR_RETEN_Pos 2U /*!< SCB DTCMCR: RETEN Position */
#define SCB_DTCMCR_RETEN_Msk (1UL << SCB_DTCMCR_RETEN_Pos) /*!< SCB DTCMCR: RETEN Mask */
#define SCB_DTCMCR_RMW_Pos 1U /*!< SCB DTCMCR: RMW Position */
#define SCB_DTCMCR_RMW_Msk (1UL << SCB_DTCMCR_RMW_Pos) /*!< SCB DTCMCR: RMW Mask */
#define SCB_DTCMCR_EN_Pos 0U /*!< SCB DTCMCR: EN Position */
#define SCB_DTCMCR_EN_Msk (1UL /*<< SCB_DTCMCR_EN_Pos*/) /*!< SCB DTCMCR: EN Mask */
/* AHBP Control Register Definitions */
#define SCB_AHBPCR_SZ_Pos 1U /*!< SCB AHBPCR: SZ Position */
#define SCB_AHBPCR_SZ_Msk (7UL << SCB_AHBPCR_SZ_Pos) /*!< SCB AHBPCR: SZ Mask */
#define SCB_AHBPCR_EN_Pos 0U /*!< SCB AHBPCR: EN Position */
#define SCB_AHBPCR_EN_Msk (1UL /*<< SCB_AHBPCR_EN_Pos*/) /*!< SCB AHBPCR: EN Mask */
/* L1 Cache Control Register Definitions */
#define SCB_CACR_FORCEWT_Pos 2U /*!< SCB CACR: FORCEWT Position */
#define SCB_CACR_FORCEWT_Msk (1UL << SCB_CACR_FORCEWT_Pos) /*!< SCB CACR: FORCEWT Mask */
#define SCB_CACR_ECCEN_Pos 1U /*!< \deprecated SCB CACR: ECCEN Position */
#define SCB_CACR_ECCEN_Msk (1UL << SCB_CACR_ECCEN_Pos) /*!< \deprecated SCB CACR: ECCEN Mask */
#define SCB_CACR_ECCDIS_Pos 1U /*!< SCB CACR: ECCDIS Position */
#define SCB_CACR_ECCDIS_Msk (1UL << SCB_CACR_ECCDIS_Pos) /*!< SCB CACR: ECCDIS Mask */
#define SCB_CACR_SIWT_Pos 0U /*!< SCB CACR: SIWT Position */
#define SCB_CACR_SIWT_Msk (1UL /*<< SCB_CACR_SIWT_Pos*/) /*!< SCB CACR: SIWT Mask */
/* AHBS Control Register Definitions */
#define SCB_AHBSCR_INITCOUNT_Pos 11U /*!< SCB AHBSCR: INITCOUNT Position */
#define SCB_AHBSCR_INITCOUNT_Msk (0x1FUL << SCB_AHBSCR_INITCOUNT_Pos) /*!< SCB AHBSCR: INITCOUNT Mask */
#define SCB_AHBSCR_TPRI_Pos 2U /*!< SCB AHBSCR: TPRI Position */
#define SCB_AHBSCR_TPRI_Msk (0x1FFUL << SCB_AHBSCR_TPRI_Pos) /*!< SCB AHBSCR: TPRI Mask */
#define SCB_AHBSCR_CTL_Pos 0U /*!< SCB AHBSCR: CTL Position*/
#define SCB_AHBSCR_CTL_Msk (3UL /*<< SCB_AHBSCR_CTL_Pos*/) /*!< SCB AHBSCR: CTL Mask */
/* Auxiliary Bus Fault Status Register Definitions */
#define SCB_ABFSR_AXIMTYPE_Pos 8U /*!< SCB ABFSR: AXIMTYPE Position*/
#define SCB_ABFSR_AXIMTYPE_Msk (3UL << SCB_ABFSR_AXIMTYPE_Pos) /*!< SCB ABFSR: AXIMTYPE Mask */
#define SCB_ABFSR_EPPB_Pos 4U /*!< SCB ABFSR: EPPB Position*/
#define SCB_ABFSR_EPPB_Msk (1UL << SCB_ABFSR_EPPB_Pos) /*!< SCB ABFSR: EPPB Mask */
#define SCB_ABFSR_AXIM_Pos 3U /*!< SCB ABFSR: AXIM Position*/
#define SCB_ABFSR_AXIM_Msk (1UL << SCB_ABFSR_AXIM_Pos) /*!< SCB ABFSR: AXIM Mask */
#define SCB_ABFSR_AHBP_Pos 2U /*!< SCB ABFSR: AHBP Position*/
#define SCB_ABFSR_AHBP_Msk (1UL << SCB_ABFSR_AHBP_Pos) /*!< SCB ABFSR: AHBP Mask */
#define SCB_ABFSR_DTCM_Pos 1U /*!< SCB ABFSR: DTCM Position*/
#define SCB_ABFSR_DTCM_Msk (1UL << SCB_ABFSR_DTCM_Pos) /*!< SCB ABFSR: DTCM Mask */
#define SCB_ABFSR_ITCM_Pos 0U /*!< SCB ABFSR: ITCM Position*/
#define SCB_ABFSR_ITCM_Msk (1UL /*<< SCB_ABFSR_ITCM_Pos*/) /*!< SCB ABFSR: ITCM Mask */
/*@} end of group CMSIS_SCB */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB)
\brief Type definitions for the System Control and ID Register not in the SCB
@{
*/
/**
\brief Structure type to access the System Control and ID Register not in the SCB.
*/
typedef struct
{
uint32_t RESERVED0[1U];
__IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */
__IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */
} SCnSCB_Type;
/* Interrupt Controller Type Register Definitions */
#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */
#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */
/* Auxiliary Control Register Definitions */
#define SCnSCB_ACTLR_DISDYNADD_Pos 26U /*!< ACTLR: DISDYNADD Position */
#define SCnSCB_ACTLR_DISDYNADD_Msk (1UL << SCnSCB_ACTLR_DISDYNADD_Pos) /*!< ACTLR: DISDYNADD Mask */
#define SCnSCB_ACTLR_DISISSCH1_Pos 21U /*!< ACTLR: DISISSCH1 Position */
#define SCnSCB_ACTLR_DISISSCH1_Msk (0x1FUL << SCnSCB_ACTLR_DISISSCH1_Pos) /*!< ACTLR: DISISSCH1 Mask */
#define SCnSCB_ACTLR_DISDI_Pos 16U /*!< ACTLR: DISDI Position */
#define SCnSCB_ACTLR_DISDI_Msk (0x1FUL << SCnSCB_ACTLR_DISDI_Pos) /*!< ACTLR: DISDI Mask */
#define SCnSCB_ACTLR_DISCRITAXIRUR_Pos 15U /*!< ACTLR: DISCRITAXIRUR Position */
#define SCnSCB_ACTLR_DISCRITAXIRUR_Msk (1UL << SCnSCB_ACTLR_DISCRITAXIRUR_Pos) /*!< ACTLR: DISCRITAXIRUR Mask */
#define SCnSCB_ACTLR_DISBTACALLOC_Pos 14U /*!< ACTLR: DISBTACALLOC Position */
#define SCnSCB_ACTLR_DISBTACALLOC_Msk (1UL << SCnSCB_ACTLR_DISBTACALLOC_Pos) /*!< ACTLR: DISBTACALLOC Mask */
#define SCnSCB_ACTLR_DISBTACREAD_Pos 13U /*!< ACTLR: DISBTACREAD Position */
#define SCnSCB_ACTLR_DISBTACREAD_Msk (1UL << SCnSCB_ACTLR_DISBTACREAD_Pos) /*!< ACTLR: DISBTACREAD Mask */
#define SCnSCB_ACTLR_DISITMATBFLUSH_Pos 12U /*!< ACTLR: DISITMATBFLUSH Position */
#define SCnSCB_ACTLR_DISITMATBFLUSH_Msk (1UL << SCnSCB_ACTLR_DISITMATBFLUSH_Pos) /*!< ACTLR: DISITMATBFLUSH Mask */
#define SCnSCB_ACTLR_DISRAMODE_Pos 11U /*!< ACTLR: DISRAMODE Position */
#define SCnSCB_ACTLR_DISRAMODE_Msk (1UL << SCnSCB_ACTLR_DISRAMODE_Pos) /*!< ACTLR: DISRAMODE Mask */
#define SCnSCB_ACTLR_FPEXCODIS_Pos 10U /*!< ACTLR: FPEXCODIS Position */
#define SCnSCB_ACTLR_FPEXCODIS_Msk (1UL << SCnSCB_ACTLR_FPEXCODIS_Pos) /*!< ACTLR: FPEXCODIS Mask */
#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */
#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */
#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */
#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */
/*@} end of group CMSIS_SCnotSCB */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_SysTick System Tick Timer (SysTick)
\brief Type definitions for the System Timer Registers.
@{
*/
/**
\brief Structure type to access the System Timer (SysTick).
*/
typedef struct
{
__IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */
__IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */
__IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */
__IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */
} SysTick_Type;
/* SysTick Control / Status Register Definitions */
#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */
#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */
#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */
#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */
#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */
/* SysTick Reload Register Definitions */
#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */
#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */
/* SysTick Current Register Definitions */
#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */
#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */
/* SysTick Calibration Register Definitions */
#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */
#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */
#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */
#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */
/*@} end of group CMSIS_SysTick */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM)
\brief Type definitions for the Instrumentation Trace Macrocell (ITM)
@{
*/
/**
\brief Structure type to access the Instrumentation Trace Macrocell Register (ITM).
*/
typedef struct
{
__OM union
{
__OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */
__OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */
__OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */
} PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */
uint32_t RESERVED0[864U];
__IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */
uint32_t RESERVED1[15U];
__IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */
uint32_t RESERVED2[15U];
__IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */
uint32_t RESERVED3[32U];
uint32_t RESERVED4[43U];
__OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */
__IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */
uint32_t RESERVED5[6U];
__IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */
__IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */
__IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */
__IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */
__IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */
__IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */
__IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */
__IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */
__IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */
__IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */
__IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */
__IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */
} ITM_Type;
/* ITM Trace Privilege Register Definitions */
#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */
#define ITM_TPR_PRIVMASK_Msk (0xFFFFFFFFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */
/* ITM Trace Control Register Definitions */
#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */
#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */
#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */
#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */
#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */
#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */
#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */
#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */
#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */
#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */
#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */
#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */
#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */
#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */
#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */
#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */
#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */
#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */
/* ITM Lock Status Register Definitions */
#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */
#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */
#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */
#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */
#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */
#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */
/*@}*/ /* end of group CMSIS_ITM */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_DWT Data Watchpoint and Trace (DWT)
\brief Type definitions for the Data Watchpoint and Trace (DWT)
@{
*/
/**
\brief Structure type to access the Data Watchpoint and Trace Register (DWT).
*/
typedef struct
{
__IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
__IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
__IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */
__IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */
__IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */
__IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */
__IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */
__IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */
__IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */
__IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */
__IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */
uint32_t RESERVED0[1U];
__IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */
__IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */
__IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */
uint32_t RESERVED1[1U];
__IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */
__IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */
__IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */
uint32_t RESERVED2[1U];
__IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */
__IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */
__IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */
uint32_t RESERVED3[981U];
__OM uint32_t LAR; /*!< Offset: 0xFB0 ( W) Lock Access Register */
__IM uint32_t LSR; /*!< Offset: 0xFB4 (R ) Lock Status Register */
} DWT_Type;
/* DWT Control Register Definitions */
#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */
#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */
#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */
#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */
#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */
#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */
#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */
#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */
#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */
#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */
#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */
#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */
#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */
#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */
#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */
#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */
#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */
#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */
#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */
#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */
#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */
#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */
#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */
#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */
#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */
#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */
#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */
#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */
#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */
#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */
#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */
#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */
#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */
#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */
#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */
#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */
/* DWT CPI Count Register Definitions */
#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */
#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */
/* DWT Exception Overhead Count Register Definitions */
#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */
#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */
/* DWT Sleep Count Register Definitions */
#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */
#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */
/* DWT LSU Count Register Definitions */
#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */
#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */
/* DWT Folded-instruction Count Register Definitions */
#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */
#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */
/* DWT Comparator Mask Register Definitions */
#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */
#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */
/* DWT Comparator Function Register Definitions */
#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */
#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */
#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */
#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */
#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */
#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */
#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */
#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */
#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */
#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */
#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */
#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */
#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */
#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */
#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */
#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */
#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */
#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */
/*@}*/ /* end of group CMSIS_DWT */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_TPI Trace Port Interface (TPI)
\brief Type definitions for the Trace Port Interface (TPI)
@{
*/
/**
\brief Structure type to access the Trace Port Interface Register (TPI).
*/
typedef struct
{
__IM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */
__IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */
uint32_t RESERVED0[2U];
__IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */
uint32_t RESERVED1[55U];
__IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */
uint32_t RESERVED2[131U];
__IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */
__IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */
__IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */
uint32_t RESERVED3[759U];
__IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER Register */
__IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */
__IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */
uint32_t RESERVED4[1U];
__IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */
__IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */
__IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */
uint32_t RESERVED5[39U];
__IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */
__IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */
uint32_t RESERVED7[8U];
__IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */
__IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */
} TPI_Type;
/* TPI Asynchronous Clock Prescaler Register Definitions */
#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */
#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */
/* TPI Selected Pin Protocol Register Definitions */
#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */
#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */
/* TPI Formatter and Flush Status Register Definitions */
#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */
#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */
#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */
#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */
#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */
#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */
#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */
#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */
/* TPI Formatter and Flush Control Register Definitions */
#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */
#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */
#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */
#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */
/* TPI TRIGGER Register Definitions */
#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */
#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */
/* TPI Integration ETM Data Register Definitions (FIFO0) */
#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */
#define TPI_FIFO0_ITM_ATVALID_Msk (0x1UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */
#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */
#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */
#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */
#define TPI_FIFO0_ETM_ATVALID_Msk (0x1UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */
#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */
#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */
#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */
#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */
#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */
#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */
#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */
#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */
/* TPI ITATBCTR2 Register Definitions */
#define TPI_ITATBCTR2_ATREADY2_Pos 0U /*!< TPI ITATBCTR2: ATREADY2 Position */
#define TPI_ITATBCTR2_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY2_Pos*/) /*!< TPI ITATBCTR2: ATREADY2 Mask */
#define TPI_ITATBCTR2_ATREADY1_Pos 0U /*!< TPI ITATBCTR2: ATREADY1 Position */
#define TPI_ITATBCTR2_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY1_Pos*/) /*!< TPI ITATBCTR2: ATREADY1 Mask */
/* TPI Integration ITM Data Register Definitions (FIFO1) */
#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */
#define TPI_FIFO1_ITM_ATVALID_Msk (0x1UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */
#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */
#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */
#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */
#define TPI_FIFO1_ETM_ATVALID_Msk (0x1UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */
#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */
#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */
#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */
#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */
#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */
#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */
#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */
#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */
/* TPI ITATBCTR0 Register Definitions */
#define TPI_ITATBCTR0_ATREADY2_Pos 0U /*!< TPI ITATBCTR0: ATREADY2 Position */
#define TPI_ITATBCTR0_ATREADY2_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY2_Pos*/) /*!< TPI ITATBCTR0: ATREADY2 Mask */
#define TPI_ITATBCTR0_ATREADY1_Pos 0U /*!< TPI ITATBCTR0: ATREADY1 Position */
#define TPI_ITATBCTR0_ATREADY1_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY1_Pos*/) /*!< TPI ITATBCTR0: ATREADY1 Mask */
/* TPI Integration Mode Control Register Definitions */
#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */
#define TPI_ITCTRL_Mode_Msk (0x3UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */
/* TPI DEVID Register Definitions */
#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */
#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */
#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */
#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */
#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */
#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */
#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */
#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */
#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */
#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */
#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */
#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */
/* TPI DEVTYPE Register Definitions */
#define TPI_DEVTYPE_SubType_Pos 4U /*!< TPI DEVTYPE: SubType Position */
#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */
#define TPI_DEVTYPE_MajorType_Pos 0U /*!< TPI DEVTYPE: MajorType Position */
#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */
/*@}*/ /* end of group CMSIS_TPI */
#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_MPU Memory Protection Unit (MPU)
\brief Type definitions for the Memory Protection Unit (MPU)
@{
*/
/**
\brief Structure type to access the Memory Protection Unit (MPU).
*/
typedef struct
{
__IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */
__IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */
__IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */
__IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */
__IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */
__IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */
__IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */
__IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */
__IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */
__IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */
__IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */
} MPU_Type;
#define MPU_TYPE_RALIASES 4U
/* MPU Type Register Definitions */
#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */
#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */
#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */
#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */
/* MPU Control Register Definitions */
#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */
#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */
#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */
#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */
/* MPU Region Number Register Definitions */
#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */
#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */
/* MPU Region Base Address Register Definitions */
#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */
#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */
#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */
#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */
#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */
/* MPU Region Attribute and Size Register Definitions */
#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */
#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */
#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */
#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */
#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */
#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */
#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */
#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */
#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */
#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */
#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */
#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */
#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */
#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */
#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */
#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */
#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */
#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */
#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */
#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */
/*@} end of group CMSIS_MPU */
#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_FPU Floating Point Unit (FPU)
\brief Type definitions for the Floating Point Unit (FPU)
@{
*/
/**
\brief Structure type to access the Floating Point Unit (FPU).
*/
typedef struct
{
uint32_t RESERVED0[1U];
__IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */
__IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */
__IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */
__IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */
__IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */
__IM uint32_t MVFR2; /*!< Offset: 0x018 (R/ ) Media and FP Feature Register 2 */
} FPU_Type;
/* Floating-Point Context Control Register Definitions */
#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */
#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */
#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */
#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */
#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */
#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */
#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */
#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */
#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */
#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */
#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */
#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */
#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */
#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */
#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */
#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */
#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */
#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */
/* Floating-Point Context Address Register Definitions */
#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */
#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */
/* Floating-Point Default Status Control Register Definitions */
#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */
#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */
#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */
#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */
#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */
#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */
#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */
#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */
/* Media and FP Feature Register 0 Definitions */
#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */
#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */
#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */
#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */
#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */
#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */
#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */
#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */
#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */
#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */
#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */
#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */
#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */
#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */
#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */
#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */
/* Media and FP Feature Register 1 Definitions */
#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */
#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */
#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */
#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */
#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */
#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */
#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */
#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */
/* Media and FP Feature Register 2 Definitions */
#define FPU_MVFR2_VFP_Misc_Pos 4U /*!< MVFR2: VFP Misc bits Position */
#define FPU_MVFR2_VFP_Misc_Msk (0xFUL << FPU_MVFR2_VFP_Misc_Pos) /*!< MVFR2: VFP Misc bits Mask */
/*@} end of group CMSIS_FPU */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug)
\brief Type definitions for the Core Debug Registers
@{
*/
/**
\brief Structure type to access the Core Debug Register (CoreDebug).
*/
typedef struct
{
__IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */
__OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */
__IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */
__IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */
} CoreDebug_Type;
/* Debug Halting Control and Status Register Definitions */
#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */
#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */
#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */
#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */
#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */
#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */
#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */
#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */
#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */
#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */
#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */
#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */
#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
/* Debug Core Register Selector Register Definitions */
#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */
#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */
#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */
/* Debug Exception and Monitor Control Register Definitions */
#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */
#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */
#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */
#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */
#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */
#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */
#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */
#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */
#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */
#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */
#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */
#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */
#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */
#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */
#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */
#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */
#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */
#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */
#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */
#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */
#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */
#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */
#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */
#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
/*@} end of group CMSIS_CoreDebug */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_core_bitfield Core register bit field macros
\brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk).
@{
*/
/**
\brief Mask and shift a bit field value for use in a register bit range.
\param[in] field Name of the register bit field.
\param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type.
\return Masked and shifted value.
*/
#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk)
/**
\brief Mask and shift a register value to extract a bit filed value.
\param[in] field Name of the register bit field.
\param[in] value Value of register. This parameter is interpreted as an uint32_t type.
\return Masked and shifted bit field value.
*/
#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos)
/*@} end of group CMSIS_core_bitfield */
/**
\ingroup CMSIS_core_register
\defgroup CMSIS_core_base Core Definitions
\brief Definitions for base addresses, unions, and structures.
@{
*/
/* Memory mapping of Core Hardware */
#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */
#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */
#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */
#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */
#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */
#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */
#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */
#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */
#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */
#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */
#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */
#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */
#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */
#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */
#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */
#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
#define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */
#define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */
#endif
#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */
#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */
/*@} */
/*******************************************************************************
* Hardware Abstraction Layer
Core Function Interface contains:
- Core NVIC Functions
- Core SysTick Functions
- Core Debug Functions
- Core Register Access Functions
******************************************************************************/
/**
\defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference
*/
/* ########################## NVIC functions #################################### */
/**
\ingroup CMSIS_Core_FunctionInterface
\defgroup CMSIS_Core_NVICFunctions NVIC Functions
\brief Functions that manage interrupts and exceptions via the NVIC.
@{
*/
#ifdef CMSIS_NVIC_VIRTUAL
#ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE
#define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h"
#endif
#include CMSIS_NVIC_VIRTUAL_HEADER_FILE
#else
#define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping
#define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping
#define NVIC_EnableIRQ __NVIC_EnableIRQ
#define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ
#define NVIC_DisableIRQ __NVIC_DisableIRQ
#define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ
#define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ
#define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ
#define NVIC_GetActive __NVIC_GetActive
#define NVIC_SetPriority __NVIC_SetPriority
#define NVIC_GetPriority __NVIC_GetPriority
#define NVIC_SystemReset __NVIC_SystemReset
#endif /* CMSIS_NVIC_VIRTUAL */
#ifdef CMSIS_VECTAB_VIRTUAL
#ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE
#define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h"
#endif
#include CMSIS_VECTAB_VIRTUAL_HEADER_FILE
#else
#define NVIC_SetVector __NVIC_SetVector
#define NVIC_GetVector __NVIC_GetVector
#endif /* (CMSIS_VECTAB_VIRTUAL) */
#define NVIC_USER_IRQ_OFFSET 16
/* The following EXC_RETURN values are saved the LR on exception entry */
#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */
#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */
#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */
#define EXC_RETURN_HANDLER_FPU (0xFFFFFFE1UL) /* return to Handler mode, uses MSP after return, restore floating-point state */
#define EXC_RETURN_THREAD_MSP_FPU (0xFFFFFFE9UL) /* return to Thread mode, uses MSP after return, restore floating-point state */
#define EXC_RETURN_THREAD_PSP_FPU (0xFFFFFFEDUL) /* return to Thread mode, uses PSP after return, restore floating-point state */
/**
\brief Set Priority Grouping
\details Sets the priority grouping field using the required unlock sequence.
The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field.
Only values from 0..7 are used.
In case of a conflict between priority grouping and available
priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
\param [in] PriorityGroup Priority grouping field.
*/
__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
{
uint32_t reg_value;
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
reg_value = SCB->AIRCR; /* read old register configuration */
reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */
reg_value = (reg_value |
((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
(PriorityGroupTmp << SCB_AIRCR_PRIGROUP_Pos) ); /* Insert write key and priority group */
SCB->AIRCR = reg_value;
}
/**
\brief Get Priority Grouping
\details Reads the priority grouping field from the NVIC Interrupt Controller.
\return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field).
*/
__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void)
{
return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos));
}
/**
\brief Enable Interrupt
\details Enables a device specific interrupt in the NVIC interrupt controller.
\param [in] IRQn Device specific interrupt number.
\note IRQn must not be negative.
*/
__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
__COMPILER_BARRIER();
NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
__COMPILER_BARRIER();
}
}
/**
\brief Get Interrupt Enable status
\details Returns a device specific interrupt enable status from the NVIC interrupt controller.
\param [in] IRQn Device specific interrupt number.
\return 0 Interrupt is not enabled.
\return 1 Interrupt is enabled.
\note IRQn must not be negative.
*/
__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
return((uint32_t)(((NVIC->ISER[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
}
else
{
return(0U);
}
}
/**
\brief Disable Interrupt
\details Disables a device specific interrupt in the NVIC interrupt controller.
\param [in] IRQn Device specific interrupt number.
\note IRQn must not be negative.
*/
__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
NVIC->ICER[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
__DSB();
__ISB();
}
}
/**
\brief Get Pending Interrupt
\details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt.
\param [in] IRQn Device specific interrupt number.
\return 0 Interrupt status is not pending.
\return 1 Interrupt status is pending.
\note IRQn must not be negative.
*/
__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
return((uint32_t)(((NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
}
else
{
return(0U);
}
}
/**
\brief Set Pending Interrupt
\details Sets the pending bit of a device specific interrupt in the NVIC pending register.
\param [in] IRQn Device specific interrupt number.
\note IRQn must not be negative.
*/
__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
NVIC->ISPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
}
}
/**
\brief Clear Pending Interrupt
\details Clears the pending bit of a device specific interrupt in the NVIC pending register.
\param [in] IRQn Device specific interrupt number.
\note IRQn must not be negative.
*/
__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
NVIC->ICPR[(((uint32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL));
}
}
/**
\brief Get Active Interrupt
\details Reads the active register in the NVIC and returns the active bit for the device specific interrupt.
\param [in] IRQn Device specific interrupt number.
\return 0 Interrupt status is not active.
\return 1 Interrupt status is active.
\note IRQn must not be negative.
*/
__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
return((uint32_t)(((NVIC->IABR[(((uint32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL));
}
else
{
return(0U);
}
}
/**
\brief Set Interrupt Priority
\details Sets the priority of a device specific interrupt or a processor exception.
The interrupt number can be positive to specify a device specific interrupt,
or negative to specify a processor exception.
\param [in] IRQn Interrupt number.
\param [in] priority Priority to set.
\note The priority cannot be set for every processor exception.
*/
__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
{
if ((int32_t)(IRQn) >= 0)
{
NVIC->IP[((uint32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
}
else
{
SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL);
}
}
/**
\brief Get Interrupt Priority
\details Reads the priority of a device specific interrupt or a processor exception.
The interrupt number can be positive to specify a device specific interrupt,
or negative to specify a processor exception.
\param [in] IRQn Interrupt number.
\return Interrupt Priority.
Value is aligned automatically to the implemented priority bits of the microcontroller.
*/
__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn)
{
if ((int32_t)(IRQn) >= 0)
{
return(((uint32_t)NVIC->IP[((uint32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS)));
}
else
{
return(((uint32_t)SCB->SHPR[(((uint32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS)));
}
}
/**
\brief Encode Priority
\details Encodes the priority for an interrupt with the given priority group,
preemptive priority value, and subpriority value.
In case of a conflict between priority grouping and available
priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
\param [in] PriorityGroup Used priority group.
\param [in] PreemptPriority Preemptive priority value (starting from 0).
\param [in] SubPriority Subpriority value (starting from 0).
\return Encoded priority. Value can be used in the function \ref NVIC_SetPriority().
*/
__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
{
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
uint32_t PreemptPriorityBits;
uint32_t SubPriorityBits;
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
return (
((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) |
((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL)))
);
}
/**
\brief Decode Priority
\details Decodes an interrupt priority value with a given priority group to
preemptive priority value and subpriority value.
In case of a conflict between priority grouping and available
priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
\param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority().
\param [in] PriorityGroup Used priority group.
\param [out] pPreemptPriority Preemptive priority value (starting from 0).
\param [out] pSubPriority Subpriority value (starting from 0).
*/
__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority)
{
uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */
uint32_t PreemptPriorityBits;
uint32_t SubPriorityBits;
PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp);
SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS));
*pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL);
*pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL);
}
/**
\brief Set Interrupt Vector
\details Sets an interrupt vector in SRAM based interrupt vector table.
The interrupt number can be positive to specify a device specific interrupt,
or negative to specify a processor exception.
VTOR must been relocated to SRAM before.
\param [in] IRQn Interrupt number
\param [in] vector Address of interrupt handler function
*/
__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector)
{
uint32_t *vectors = (uint32_t *)SCB->VTOR;
vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector;
__DSB();
}
/**
\brief Get Interrupt Vector
\details Reads an interrupt vector from interrupt vector table.
The interrupt number can be positive to specify a device specific interrupt,
or negative to specify a processor exception.
\param [in] IRQn Interrupt number.
\return Address of interrupt handler function
*/
__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn)
{
uint32_t *vectors = (uint32_t *)SCB->VTOR;
return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET];
}
/**
\brief System Reset
\details Initiates a system reset request to reset the MCU.
*/
__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void)
{
__DSB(); /* Ensure all outstanding memory accesses included
buffered write are completed before reset */
SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) |
(SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */
__DSB(); /* Ensure completion of memory access */
for(;;) /* wait until reset */
{
__NOP();
}
}
/*@} end of CMSIS_Core_NVICFunctions */
/* ########################## MPU functions #################################### */
#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U)
#include "mpu_armv7.h"
#endif
/* ########################## FPU functions #################################### */
/**
\ingroup CMSIS_Core_FunctionInterface
\defgroup CMSIS_Core_FpuFunctions FPU Functions
\brief Function that provides FPU type.
@{
*/
/**
\brief get FPU type
\details returns the FPU type
\returns
- \b 0: No FPU
- \b 1: Single precision FPU
- \b 2: Double + Single precision FPU
*/
__STATIC_INLINE uint32_t SCB_GetFPUType(void)
{
uint32_t mvfr0;
mvfr0 = SCB->MVFR0;
if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x220U)
{
return 2U; /* Double + Single precision FPU */
}
else if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U)
{
return 1U; /* Single precision FPU */
}
else
{
return 0U; /* No FPU */
}
}
/*@} end of CMSIS_Core_FpuFunctions */
/* ########################## Cache functions #################################### */
#if ((defined (__ICACHE_PRESENT) && (__ICACHE_PRESENT == 1U)) || \
(defined (__DCACHE_PRESENT) && (__DCACHE_PRESENT == 1U)))
#include "cachel1_armv7.h"
#endif
/* ################################## SysTick function ############################################ */
/**
\ingroup CMSIS_Core_FunctionInterface
\defgroup CMSIS_Core_SysTickFunctions SysTick Functions
\brief Functions that configure the System.
@{
*/
#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U)
/**
\brief System Tick Configuration
\details Initializes the System Timer and its interrupt, and starts the System Tick Timer.
Counter is in free running mode to generate periodic interrupts.
\param [in] ticks Number of ticks between two interrupts.
\return 0 Function succeeded.
\return 1 Function failed.
\note When the variable <b>__Vendor_SysTickConfig</b> is set to 1, then the
function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
must contain a vendor-specific implementation of this function.
*/
__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks)
{
if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk)
{
return (1UL); /* Reload value impossible */
}
SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */
// LK NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */
SysTick->VAL = 0UL; /* Load the SysTick Counter Value */
SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
SysTick_CTRL_TICKINT_Msk |
SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
return (0UL); /* Function successful */
}
#endif
/*@} end of CMSIS_Core_SysTickFunctions */
/* ##################################### Debug In/Output function ########################################### */
/**
\ingroup CMSIS_Core_FunctionInterface
\defgroup CMSIS_core_DebugFunctions ITM Functions
\brief Functions that access the ITM debug interface.
@{
*/
extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */
#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */
/**
\brief ITM Send Character
\details Transmits a character via the ITM channel 0, and
\li Just returns when no debugger is connected that has booked the output.
\li Is blocking when a debugger is connected, but the previous character sent has not been transmitted.
\param [in] ch Character to transmit.
\returns Character to transmit.
*/
__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch)
{
if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */
((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */
{
while (ITM->PORT[0U].u32 == 0UL)
{
__NOP();
}
ITM->PORT[0U].u8 = (uint8_t)ch;
}
return (ch);
}
/**
\brief ITM Receive Character
\details Inputs a character via the external variable \ref ITM_RxBuffer.
\return Received character.
\return -1 No character pending.
*/
__STATIC_INLINE int32_t ITM_ReceiveChar (void)
{
int32_t ch = -1; /* no character available */
if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY)
{
ch = ITM_RxBuffer;
ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
}
return (ch);
}
/**
\brief ITM Check Character
\details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer.
\return 0 No character available.
\return 1 Character available.
*/
__STATIC_INLINE int32_t ITM_CheckChar (void)
{
if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY)
{
return (0); /* no character available */
}
else
{
return (1); /* character available */
}
}
/*@} end of CMSIS_core_DebugFunctions */
#ifdef __cplusplus
}
#endif
#endif /* __CORE_CM7_H_DEPENDANT */
#endif /* __CMSIS_GENERIC */
| {
"content_hash": "83d5e1d051cc6e5310795db630073e79",
"timestamp": "",
"source": "github",
"line_count": 2366,
"max_line_length": 178,
"avg_line_length": 58.729078613694,
"alnum_prop": 0.5210610782063,
"repo_name": "hollanderic/lkstuff",
"id": "3a45a63bb93beaf29cb13d14b826302698a02028",
"size": "138953",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "external/arch/arm/arm-m/CMSIS/Include/core_cm7.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "151748"
},
{
"name": "C",
"bytes": "3329180"
},
{
"name": "C++",
"bytes": "260157"
},
{
"name": "Makefile",
"bytes": "140057"
},
{
"name": "Python",
"bytes": "27738"
},
{
"name": "Shell",
"bytes": "23559"
},
{
"name": "Tcl",
"bytes": "288"
}
],
"symlink_target": ""
} |
package org.terracotta.nomad.server;
public enum NomadServerRequest {
PREPARE,
COMMIT,
ROLLBACK,
TAKEOVER
}
| {
"content_hash": "9efcd97ae8e95265b56f4186e70ecf0d",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 36,
"avg_line_length": 13.11111111111111,
"alnum_prop": 0.7457627118644068,
"repo_name": "chrisdennis/terracotta-platform",
"id": "d16eb88e04c6748869d202f7ad4aeeb7978e85b8",
"size": "712",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "common/nomad/src/main/java/org/terracotta/nomad/server/NomadServerRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "3991"
},
{
"name": "Java",
"bytes": "4856161"
},
{
"name": "Shell",
"bytes": "3663"
}
],
"symlink_target": ""
} |
class CreateNodes < ActiveRecord::Migration
def self.up
create_table :nodes do |t|
t.string :ip_address
t.string :hostname
t.string :description
t.string :services
t.string :status
t.timestamps
end
end
def self.down
drop_table :nodes
end
end
| {
"content_hash": "7c1b0c631010f688ac7cae72b1a5b71b",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 43,
"avg_line_length": 18.6875,
"alnum_prop": 0.6354515050167224,
"repo_name": "unilogic/zackup",
"id": "8953cce83f072f44cb4e2b161f039f5e0b0dc4e2",
"size": "299",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20090525222956_create_nodes.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "243829"
},
{
"name": "Ruby",
"bytes": "140663"
}
],
"symlink_target": ""
} |
<?php
namespace PowerTools;
/**
* The scanner.
*
* This scans over an input stream.
*/
class HTML5_Parser_Scanner {
const CHARS_HEX = 'abcdefABCDEF01234567890';
const CHARS_ALNUM = 'abcdefAghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890';
const CHARS_ALPHA = 'abcdefAghijklmnopqrstuvwxyABCDEFGHIJKLMNOPQRSTUVWXYZ';
protected $is;
// Flipping this to true will give minisculely more debugging info.
public $debug = false;
/**
* Create a new Scanner.
*
* @param HTML5_Inputstream_Interface $input
* An HTML5_Inputstream_Interface to be scanned.
*/
public function __construct($input) {
$this->is = $input;
}
/**
* Get the current position.
*
* @return int The current intiger byte position.
*/
public function position() {
return $this->is->key();
}
/**
* Take a peek at the next character in the data.
*
* @return string The next character.
*/
public function peek() {
return $this->is->peek();
}
/**
* Get the next character.
*
* Note: This advances the pointer.
*
* @return string The next character.
*/
public function next() {
$this->is->next();
if ($this->is->valid()) {
if ($this->debug)
fprintf(STDOUT, "> %s\n", $this->is->current());
return $this->is->current();
}
return false;
}
/**
* Get the current character.
*
* Note, this does not advance the pointer.
*
* @return string The current character.
*/
public function current() {
if ($this->is->valid()) {
return $this->is->current();
}
return false;
}
/**
* Silently consume N chars.
*/
public function consume($count = 1) {
for ($i = 0; $i < $count; ++$i) {
$this->next();
}
}
/**
* Unconsume some of the data.
* This moves the data pointer backwards.
*
* @param int $howMany
* The number of characters to move the pointer back.
*/
public function unconsume($howMany = 1) {
$this->is->unconsume($howMany);
}
/**
* Get the next group of that contains hex characters.
*
* Note, along with getting the characters the pointer in the data will be
* moved as well.
*
* @return string The next group that is hex characters.
*/
public function getHex() {
return $this->is->charsWhile(static::CHARS_HEX);
}
/**
* Get the next group of characters that are ASCII Alpha characters.
*
* Note, along with getting the characters the pointer in the data will be
* moved as well.
*
* @return string The next group of ASCII alpha characters.
*/
public function getAsciiAlpha() {
return $this->is->charsWhile(static::CHARS_ALPHA);
}
/**
* Get the next group of characters that are ASCII Alpha characters and numbers.
*
* Note, along with getting the characters the pointer in the data will be
* moved as well.
*
* @return string The next group of ASCII alpha characters and numbers.
*/
public function getAsciiAlphaNum() {
return $this->is->charsWhile(static::CHARS_ALNUM);
}
/**
* Get the next group of numbers.
*
* Note, along with getting the characters the pointer in the data will be
* moved as well.
*
* @return string The next group of numbers.
*/
public function getNumeric() {
return $this->is->charsWhile('0123456789');
}
/**
* Consume whitespace.
*
* Whitespace in HTML5 is: formfeed, tab, newline, space.
*/
public function whitespace() {
return $this->is->charsWhile("\n\t\f ");
}
/**
* Returns the current line that is being consumed.
*
* @return int The current line number.
*/
public function currentLine() {
return $this->is->currentLine();
}
/**
* Read chars until something in the mask is encountered.
*/
public function charsUntil($mask) {
return $this->is->charsUntil($mask);
}
/**
* Read chars as long as the mask matches.
*/
public function charsWhile($mask) {
return $this->is->charsWhile($mask);
}
/**
* Returns the current column of the current line that the tokenizer is at.
*
* Newlines are column 0. The first char after a newline is column 1.
*
* @return int The column number.
*/
public function columnOffset() {
return $this->is->columnOffset();
}
/**
* Get all characters until EOF.
*
* This consumes characters until the EOF.
*
* @return int The number of characters remaining.
*/
public function remainingChars() {
return $this->is->remainingChars();
}
}
| {
"content_hash": "c09052bb544215c2b998a7753fb4ee0d",
"timestamp": "",
"source": "github",
"line_count": 204,
"max_line_length": 90,
"avg_line_length": 24.480392156862745,
"alnum_prop": 0.5718862635162195,
"repo_name": "PHPPowertools/HTML5",
"id": "5a9fa5f792b7317132ac6da46366a8104c23729b",
"size": "8484",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "src/PowerTools/HTML5/Parser/Scanner.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "321238"
}
],
"symlink_target": ""
} |
zip cybercat-another_autumn.zip -9 -r bower_components images lib models music src index.html FILE_ID.DIZ
| {
"content_hash": "358caec86bad4861866ddd15210dd24d",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 105,
"avg_line_length": 53.5,
"alnum_prop": 0.794392523364486,
"repo_name": "Suva/AnotherAutumn",
"id": "159df84b5bd11f84ad7e6e231a8b2328203549f1",
"size": "120",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "build.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "2568"
},
{
"name": "JavaScript",
"bytes": "106293"
},
{
"name": "PHP",
"bytes": "226"
},
{
"name": "Python",
"bytes": "3162"
},
{
"name": "Shell",
"bytes": "120"
}
],
"symlink_target": ""
} |
require 'spec_helper'
describe Signifyd::Case do
let(:hash) { SignifydRequests.valid_case }
let(:json) { JSON.dump(hash) }
let(:case_id) { (rand * 1000).ceil }
let(:order_id) { 'unique_id'}
let(:investigation) { "{\"investigationId\":#{case_id}}" }
let(:retrieved_case) {"{\"orderId\":#{case_id}}" }
context '.create' do
context 'when creating a case with a valid API key' do
context 'and passing the correct parameters' do
before {
Signifyd.api_key = SIGNIFYD_API_KEY
stub_request(:post, "https://#{Signifyd.api_key}@api.signifyd.com/v2/cases").
with(:body => json, :headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>json.size, 'Content-Type'=>'application/json', 'User-Agent'=>'Signifyd Ruby v2'}).
to_return(:status => 201, :body => investigation, :headers => {})
}
after {
Signifyd.api_key = nil
}
subject {
Signifyd::Case.create(hash)
}
it { should be_true }
it { should_not be_nil }
it { expect(subject[:code]).to eq(201) }
it { expect(subject[:body][:investigationId]).to eq(JSON.parse(investigation)[:investigationId]) }
end
context 'and passing incorrect or nil parameters' do
before {
Signifyd.api_key = SIGNIFYD_API_KEY
}
after {
Signifyd.api_key = nil
}
it { lambda { Signifyd::Case.create() }.should raise_error }
end
end
context 'when creating a case with an invalid API key' do
it { lambda { Signifyd::Case.create(hash) }.should raise_error }
end
end
context '.update' do
context 'when updating a case' do
context 'and the proper case_id and parameters have been sent' do
before {
Signifyd.api_key = SIGNIFYD_API_KEY
stub_request(:put, "https://#{Signifyd.api_key}@api.signifyd.com/v2/cases/#{case_id}").
with(:body => json, :headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>json.size, 'Content-Type'=>'application/json', 'User-Agent'=>'Signifyd Ruby v2'}).
to_return(:status => 200, :body => investigation, :headers => {})
}
after {
Signifyd.api_key = nil
}
subject {
Signifyd::Case.update(case_id, hash)
}
it { should be_true }
it { should_not be_nil }
it { expect(subject[:code]).to eq(200) }
it { expect(subject[:body][:investigationId]).to eq(JSON.parse(investigation)[:investigationId]) }
end
context 'and incorrect parameters have been passed' do
before {
Signifyd.api_key = SIGNIFYD_API_KEY
}
after {
Signifyd.api_key = nil
}
it { lambda { Signifyd::Case.update(case_id, {}) }.should raise_error }
end
end
end
describe '#find' do
before :each do
Signifyd.api_key = SIGNIFYD_API_KEY
end
after :each do
Signifyd.api_key = nil
end
context 'when case with orderId exists' do
it 'should return case in hash format' do
stub_request(:get, "https://#{Signifyd.api_key}@api.signifyd.com/v2/orders/#{order_id}/case").
with(:body => {}, :headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>2, 'Content-Type'=>'application/json', 'User-Agent'=>'Signifyd Ruby v2'}).
to_return(:status => 200, :body => retrieved_case, :headers => {})
subject = Signifyd::Case.find({order_id: order_id})
expect(subject).to be_true
expect(subject[:code]).to eq(200)
expect(subject[:body][:orderId]).to eq(JSON.parse(retrieved_case)[:orderId])
end
end
context 'when case with orderID does not exist' do
it 'should raise exception' do
exception = RestClient::ExceptionWithResponse.new('test')
exception.should_receive(:http_code).and_return(400)
exception.should_receive(:http_body).and_return('as')
stub_request(:get, "https://#{Signifyd.api_key}@api.signifyd.com/v2/orders/#{order_id}/case").
with(:body => {}, :headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>2, 'Content-Type'=>'application/json', 'User-Agent'=>'Signifyd Ruby v2'}).
to_raise(exception)
expect {Signifyd::Case.find({order_id: order_id})}.to raise_error(Signifyd::InvalidRequestError)
end
end
end
end
| {
"content_hash": "67a0aaffea030f8072d3fccbcbe57340",
"timestamp": "",
"source": "github",
"line_count": 126,
"max_line_length": 222,
"avg_line_length": 36.57142857142857,
"alnum_prop": 0.5907118055555556,
"repo_name": "eric-surfeasy/signifyd-ruby",
"id": "d95737e81ba65c504b297ed46fe6bdbd9f48c2f7",
"size": "4608",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/lib/signifyd/case_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "52403"
}
],
"symlink_target": ""
} |
<?php
namespace Concrete\Core\Summary\Template;
use Concrete\Core\Entity\Summary\Category;
use Concrete\Core\Entity\Summary\Template;
use Concrete\Core\Summary\Data\Collection;
use Doctrine\ORM\EntityManager;
/**
* Responsible for taking a summary category handle, retrieving all the possible templates available for that handle
* taking a collection of summary data fields, and returning only those templates that are available given their
* summary field requirements
*/
class Filterer
{
/**
* @var EntityManager
*/
protected $entityManager;
public function __construct(EntityManager $entityManager)
{
$this->entityManager = $entityManager;
}
/**
* @param string $categoryHandle
* @param Collection $collection
* @return Template[]
*/
public function getTemplates(string $categoryHandle, Collection $collection)
{
// First, retrieve the category entity
$return = [];
$category = $this->entityManager->getRepository(Category::class)
->findOneByHandle($categoryHandle);
if ($category) {
// Now, get templates assigned to this category
$templates = $this->entityManager->getRepository(Template::class)
->findByCategory($category);
if ($templates) {
foreach($templates as $template) {
$include = true;
$fields = $template->getFields();
if ($fields) {
foreach ($fields as $field) {
$templateField = $field->getField();
if ($field->isRequired() && !$collection->containsField($templateField)) {
$include = false;
}
}
}
if ($include) {
$return[] = $template;
}
}
}
}
return $return;
}
}
| {
"content_hash": "3f9ab01759fa549df7c39f968ead47ce",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 116,
"avg_line_length": 32.82258064516129,
"alnum_prop": 0.544963144963145,
"repo_name": "hissy/concrete5",
"id": "599f8e049e35e3938f4b0699a3c8abeb1473807b",
"size": "2035",
"binary": false,
"copies": "10",
"ref": "refs/heads/upstream",
"path": "concrete/src/Summary/Template/Filterer.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "74"
},
{
"name": "CSS",
"bytes": "140170"
},
{
"name": "HTML",
"bytes": "312828"
},
{
"name": "Hack",
"bytes": "45"
},
{
"name": "JavaScript",
"bytes": "902321"
},
{
"name": "Less",
"bytes": "472475"
},
{
"name": "PHP",
"bytes": "14907009"
},
{
"name": "PowerShell",
"bytes": "4292"
},
{
"name": "SCSS",
"bytes": "787311"
},
{
"name": "Shell",
"bytes": "6727"
}
],
"symlink_target": ""
} |
import coreUtils from '@opentripplanner/core-utils'
import {
CREATE_ACCOUNT_PLACES_PATH,
PERSIST_TO_LOCAL_STORAGE,
PERSIST_TO_OTP_MIDDLEWARE,
PLACES_PATH
} from './constants'
import { getFormattedPlaces } from './i18n'
import { isBlank } from './ui'
const { toSentenceCase } = coreUtils.itinerary
/**
* Determines whether a loggedInUser is a new user
* that needs to complete the new account wizard.
*/
export function isNewUser(loggedInUser) {
return !loggedInUser.hasConsentedToTerms
}
// Helper functions to determine if
// a location is home or work.
export const isHome = (loc) => loc.type === 'home'
export const isWork = (loc) => loc.type === 'work'
export const isHomeOrWork = (loc) => isHome(loc) || isWork(loc)
/**
* An index of common place types (excluding Home and Work),
* each type including a display name and the FontAwesome icon name.
* Add the supported place types below as needed.
*/
export const CUSTOM_PLACE_TYPES = {
custom: {
icon: 'map-marker',
type: 'custom'
},
dining: {
icon: 'cutlery',
type: 'dining'
}
}
/**
* The above, with Home and Work locations added.
*/
export const PLACE_TYPES = {
...CUSTOM_PLACE_TYPES,
home: {
icon: 'home',
type: 'home'
},
work: {
icon: 'briefcase',
type: 'work'
}
}
/**
* Moves the 'home' and 'work' locations of the provided user to the beginning of
* the savedLocations list, so they are always shown at the top of the FavoritePlacesPane.
*/
export function positionHomeAndWorkFirst(userData) {
// Note: cloning is not necessary as the data is obtained from fetch.
const { savedLocations = [] } = userData
const homeLocation = savedLocations.find(isHome) || PLACE_TYPES.home
const workLocation = savedLocations.find(isWork) || PLACE_TYPES.work
const reorderedLocations = [
homeLocation,
workLocation,
...savedLocations.filter(
(loc) => loc !== homeLocation && loc !== workLocation
)
]
userData.savedLocations = reorderedLocations
}
/**
* Returns the persistence.strategy string if the following apply in config.yml, null otherwise:
* - persistence is defined,
* - persistence.enabled is true,
* - persistence.strategy is defined.
*/
function getPersistenceStrategy(persistence) {
return persistence?.enabled && persistence?.strategy
}
/**
* @returns true if the persistence strategy is OTP middleware, false otherwise.
*/
export function isOtpMiddleware(persistence) {
return getPersistenceStrategy(persistence) === PERSIST_TO_OTP_MIDDLEWARE
}
/**
* Constructs information regarding the persistence strategy.
*/
export function getPersistenceMode(persistence) {
const persistenceStrategy = getPersistenceStrategy(persistence)
return {
isLocalStorage: persistenceStrategy === PERSIST_TO_LOCAL_STORAGE,
isOtpMiddleware: persistenceStrategy === PERSIST_TO_OTP_MIDDLEWARE
}
}
/**
* Convert a LocationField entry to a persisted user savedLocations:
* - The icon for "Work" places is changed to 'briefcase',
* - The address attribute is filled with the 'name' if available.
*/
export function convertToPlace(location) {
const { icon, id, lat, lon, name, type } = location
return {
address: name,
icon: isWork(location) ? 'briefcase' : icon,
id,
lat,
lon,
name,
type
}
}
/**
* Convert an entry from persisted user savedLocations into LocationField locations:
* - The icon for "Work" places is changed to 'work',
* - The name attribute is filled with the place address.
*/
export function convertToLegacyLocation(place) {
const { address, icon, id, lat, lon, name, type } = place
return {
icon: isWork(place) ? 'work' : icon,
id,
lat,
lon,
name: address || name,
type
}
}
/**
* Obtains the saved and recent locations based on the redux state.
*/
export function getUserLocations(state) {
let saved = []
let recent = []
const { persistence } = state.otp.config
const { localUser, loggedInUser } = state.user
const persistenceMode = getPersistenceMode(persistence)
if (persistenceMode.isOtpMiddleware && loggedInUser) {
saved = loggedInUser.savedLocations
.filter((place) => !isBlank(place.address))
.map(convertToLegacyLocation)
} else if (persistenceMode.isLocalStorage) {
saved = localUser.savedLocations
recent = localUser.recentPlaces
}
return {
recent,
saved
}
}
/**
* Obtains the base path for editing a place depending on whether user is creating a new account.
*/
export function getPlaceBasePath(isCreating) {
return isCreating ? CREATE_ACCOUNT_PLACES_PATH : PLACES_PATH
}
/**
* Constructs the detail text of a favorite place.
* That text is typically the address of a location
* or, for unset home or work locations, a prompt for
* the user to set the address, as in:
* Home
* 123 Main Street
* or
* Home
* Set your home address
*/
export function getPlaceDetail(place, intl) {
return (
place.address ||
// intl.formatMessage is used because this text can appear in tooltips.
intl.formatMessage(
{ id: 'components.FavoritePlaceList.setAddressForPlaceType' },
{ placeType: getFormattedPlaces(place.type, intl) }
)
)
}
/**
* Constructs the main text of a favorite place.
* That text is typically the nickname a location
* or, for home or work locations, the corresponding localized text,
* as in:
* Home
* 123 Main Street
* or
* Mom's house
* 123 Main Street
*/
export function getPlaceMainText(place, intl) {
// Use toSentenceCase (and not text-transform: capitalize)
// to change the first character of the work and home locations only (which come in lowercase).
// TODO: Combine with similar code in @opentripplanner/location-field/options.tsx/LocationName
return isHomeOrWork(place)
? toSentenceCase(getFormattedPlaces(place.type, intl))
: place.name || place.address
}
| {
"content_hash": "66a54b7308c74722b03295ec86c5505a",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 97,
"avg_line_length": 27.333333333333332,
"alnum_prop": 0.7005420054200542,
"repo_name": "opentripplanner/otp-react-redux",
"id": "cfa475a777bc0fd07722d1d606a9189edd8d908f",
"size": "5904",
"binary": false,
"copies": "1",
"ref": "refs/heads/dev",
"path": "lib/util/user.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "44244"
},
{
"name": "HTML",
"bytes": "774"
},
{
"name": "JavaScript",
"bytes": "831589"
},
{
"name": "Shell",
"bytes": "69"
},
{
"name": "TypeScript",
"bytes": "205098"
}
],
"symlink_target": ""
} |
"""
Unit tests for pyspark.sql; additional tests are implemented as doctests in
individual modules.
"""
import os
import sys
import pydoc
import shutil
import tempfile
import pickle
import functools
import time
import datetime
import py4j
if sys.version_info[:2] <= (2, 6):
try:
import unittest2 as unittest
except ImportError:
sys.stderr.write('Please install unittest2 to test with Python 2.6 or earlier')
sys.exit(1)
else:
import unittest
from pyspark.sql import SQLContext, HiveContext, Column, Row
from pyspark.sql.types import *
from pyspark.sql.types import UserDefinedType, _infer_type
from pyspark.tests import ReusedPySparkTestCase
from pyspark.sql.functions import UserDefinedFunction, sha2
from pyspark.sql.window import Window
from pyspark.sql.utils import AnalysisException, IllegalArgumentException
class UTCOffsetTimezone(datetime.tzinfo):
"""
Specifies timezone in UTC offset
"""
def __init__(self, offset=0):
self.ZERO = datetime.timedelta(hours=offset)
def utcoffset(self, dt):
return self.ZERO
def dst(self, dt):
return self.ZERO
class ExamplePointUDT(UserDefinedType):
"""
User-defined type (UDT) for ExamplePoint.
"""
@classmethod
def sqlType(self):
return ArrayType(DoubleType(), False)
@classmethod
def module(cls):
return 'pyspark.sql.tests'
@classmethod
def scalaUDT(cls):
return 'org.apache.spark.sql.test.ExamplePointUDT'
def serialize(self, obj):
return [obj.x, obj.y]
def deserialize(self, datum):
return ExamplePoint(datum[0], datum[1])
class ExamplePoint:
"""
An example class to demonstrate UDT in Scala, Java, and Python.
"""
__UDT__ = ExamplePointUDT()
def __init__(self, x, y):
self.x = x
self.y = y
def __repr__(self):
return "ExamplePoint(%s,%s)" % (self.x, self.y)
def __str__(self):
return "(%s,%s)" % (self.x, self.y)
def __eq__(self, other):
return isinstance(other, self.__class__) and \
other.x == self.x and other.y == self.y
class PythonOnlyUDT(UserDefinedType):
"""
User-defined type (UDT) for ExamplePoint.
"""
@classmethod
def sqlType(self):
return ArrayType(DoubleType(), False)
@classmethod
def module(cls):
return '__main__'
def serialize(self, obj):
return [obj.x, obj.y]
def deserialize(self, datum):
return PythonOnlyPoint(datum[0], datum[1])
@staticmethod
def foo():
pass
@property
def props(self):
return {}
class PythonOnlyPoint(ExamplePoint):
"""
An example class to demonstrate UDT in only Python
"""
__UDT__ = PythonOnlyUDT()
class MyObject(object):
def __init__(self, key, value):
self.key = key
self.value = value
class DataTypeTests(unittest.TestCase):
# regression test for SPARK-6055
def test_data_type_eq(self):
lt = LongType()
lt2 = pickle.loads(pickle.dumps(LongType()))
self.assertEqual(lt, lt2)
# regression test for SPARK-7978
def test_decimal_type(self):
t1 = DecimalType()
t2 = DecimalType(10, 2)
self.assertTrue(t2 is not t1)
self.assertNotEqual(t1, t2)
t3 = DecimalType(8)
self.assertNotEqual(t2, t3)
# regression test for SPARK-10392
def test_datetype_equal_zero(self):
dt = DateType()
self.assertEqual(dt.fromInternal(0), datetime.date(1970, 1, 1))
class SQLContextTests(ReusedPySparkTestCase):
def test_get_or_create(self):
sqlCtx = SQLContext.getOrCreate(self.sc)
self.assertTrue(SQLContext.getOrCreate(self.sc) is sqlCtx)
def test_new_session(self):
sqlCtx = SQLContext.getOrCreate(self.sc)
sqlCtx.setConf("test_key", "a")
sqlCtx2 = sqlCtx.newSession()
sqlCtx2.setConf("test_key", "b")
self.assertEqual(sqlCtx.getConf("test_key", ""), "a")
self.assertEqual(sqlCtx2.getConf("test_key", ""), "b")
class SQLTests(ReusedPySparkTestCase):
@classmethod
def setUpClass(cls):
ReusedPySparkTestCase.setUpClass()
cls.tempdir = tempfile.NamedTemporaryFile(delete=False)
os.unlink(cls.tempdir.name)
cls.sqlCtx = SQLContext(cls.sc)
cls.testData = [Row(key=i, value=str(i)) for i in range(100)]
rdd = cls.sc.parallelize(cls.testData, 2)
cls.df = rdd.toDF()
@classmethod
def tearDownClass(cls):
ReusedPySparkTestCase.tearDownClass()
shutil.rmtree(cls.tempdir.name, ignore_errors=True)
def test_row_should_be_read_only(self):
row = Row(a=1, b=2)
self.assertEqual(1, row.a)
def foo():
row.a = 3
self.assertRaises(Exception, foo)
row2 = self.sqlCtx.range(10).first()
self.assertEqual(0, row2.id)
def foo2():
row2.id = 2
self.assertRaises(Exception, foo2)
def test_range(self):
self.assertEqual(self.sqlCtx.range(1, 1).count(), 0)
self.assertEqual(self.sqlCtx.range(1, 0, -1).count(), 1)
self.assertEqual(self.sqlCtx.range(0, 1 << 40, 1 << 39).count(), 2)
self.assertEqual(self.sqlCtx.range(-2).count(), 0)
self.assertEqual(self.sqlCtx.range(3).count(), 3)
def test_duplicated_column_names(self):
df = self.sqlCtx.createDataFrame([(1, 2)], ["c", "c"])
row = df.select('*').first()
self.assertEqual(1, row[0])
self.assertEqual(2, row[1])
self.assertEqual("Row(c=1, c=2)", str(row))
# Cannot access columns
self.assertRaises(AnalysisException, lambda: df.select(df[0]).first())
self.assertRaises(AnalysisException, lambda: df.select(df.c).first())
self.assertRaises(AnalysisException, lambda: df.select(df["c"]).first())
def test_explode(self):
from pyspark.sql.functions import explode
d = [Row(a=1, intlist=[1, 2, 3], mapfield={"a": "b"})]
rdd = self.sc.parallelize(d)
data = self.sqlCtx.createDataFrame(rdd)
result = data.select(explode(data.intlist).alias("a")).select("a").collect()
self.assertEqual(result[0][0], 1)
self.assertEqual(result[1][0], 2)
self.assertEqual(result[2][0], 3)
result = data.select(explode(data.mapfield).alias("a", "b")).select("a", "b").collect()
self.assertEqual(result[0][0], "a")
self.assertEqual(result[0][1], "b")
def test_and_in_expression(self):
self.assertEqual(4, self.df.filter((self.df.key <= 10) & (self.df.value <= "2")).count())
self.assertRaises(ValueError, lambda: (self.df.key <= 10) and (self.df.value <= "2"))
self.assertEqual(14, self.df.filter((self.df.key <= 3) | (self.df.value < "2")).count())
self.assertRaises(ValueError, lambda: self.df.key <= 3 or self.df.value < "2")
self.assertEqual(99, self.df.filter(~(self.df.key == 1)).count())
self.assertRaises(ValueError, lambda: not self.df.key == 1)
def test_udf_with_callable(self):
d = [Row(number=i, squared=i**2) for i in range(10)]
rdd = self.sc.parallelize(d)
data = self.sqlCtx.createDataFrame(rdd)
class PlusFour:
def __call__(self, col):
if col is not None:
return col + 4
call = PlusFour()
pudf = UserDefinedFunction(call, LongType())
res = data.select(pudf(data['number']).alias('plus_four'))
self.assertEqual(res.agg({'plus_four': 'sum'}).collect()[0][0], 85)
def test_udf_with_partial_function(self):
d = [Row(number=i, squared=i**2) for i in range(10)]
rdd = self.sc.parallelize(d)
data = self.sqlCtx.createDataFrame(rdd)
def some_func(col, param):
if col is not None:
return col + param
pfunc = functools.partial(some_func, param=4)
pudf = UserDefinedFunction(pfunc, LongType())
res = data.select(pudf(data['number']).alias('plus_four'))
self.assertEqual(res.agg({'plus_four': 'sum'}).collect()[0][0], 85)
def test_udf(self):
self.sqlCtx.registerFunction("twoArgs", lambda x, y: len(x) + y, IntegerType())
[row] = self.sqlCtx.sql("SELECT twoArgs('test', 1)").collect()
self.assertEqual(row[0], 5)
def test_udf2(self):
self.sqlCtx.registerFunction("strlen", lambda string: len(string), IntegerType())
self.sqlCtx.createDataFrame(self.sc.parallelize([Row(a="test")])).registerTempTable("test")
[res] = self.sqlCtx.sql("SELECT strlen(a) FROM test WHERE strlen(a) > 1").collect()
self.assertEqual(4, res[0])
def test_udf_with_array_type(self):
d = [Row(l=list(range(3)), d={"key": list(range(5))})]
rdd = self.sc.parallelize(d)
self.sqlCtx.createDataFrame(rdd).registerTempTable("test")
self.sqlCtx.registerFunction("copylist", lambda l: list(l), ArrayType(IntegerType()))
self.sqlCtx.registerFunction("maplen", lambda d: len(d), IntegerType())
[(l1, l2)] = self.sqlCtx.sql("select copylist(l), maplen(d) from test").collect()
self.assertEqual(list(range(3)), l1)
self.assertEqual(1, l2)
def test_broadcast_in_udf(self):
bar = {"a": "aa", "b": "bb", "c": "abc"}
foo = self.sc.broadcast(bar)
self.sqlCtx.registerFunction("MYUDF", lambda x: foo.value[x] if x else '')
[res] = self.sqlCtx.sql("SELECT MYUDF('c')").collect()
self.assertEqual("abc", res[0])
[res] = self.sqlCtx.sql("SELECT MYUDF('')").collect()
self.assertEqual("", res[0])
def test_basic_functions(self):
rdd = self.sc.parallelize(['{"foo":"bar"}', '{"foo":"baz"}'])
df = self.sqlCtx.jsonRDD(rdd)
df.count()
df.collect()
df.schema
# cache and checkpoint
self.assertFalse(df.is_cached)
df.persist()
df.unpersist()
df.cache()
self.assertTrue(df.is_cached)
self.assertEqual(2, df.count())
df.registerTempTable("temp")
df = self.sqlCtx.sql("select foo from temp")
df.count()
df.collect()
def test_apply_schema_to_row(self):
df = self.sqlCtx.jsonRDD(self.sc.parallelize(["""{"a":2}"""]))
df2 = self.sqlCtx.createDataFrame(df.map(lambda x: x), df.schema)
self.assertEqual(df.collect(), df2.collect())
rdd = self.sc.parallelize(range(10)).map(lambda x: Row(a=x))
df3 = self.sqlCtx.createDataFrame(rdd, df.schema)
self.assertEqual(10, df3.count())
def test_serialize_nested_array_and_map(self):
d = [Row(l=[Row(a=1, b='s')], d={"key": Row(c=1.0, d="2")})]
rdd = self.sc.parallelize(d)
df = self.sqlCtx.createDataFrame(rdd)
row = df.head()
self.assertEqual(1, len(row.l))
self.assertEqual(1, row.l[0].a)
self.assertEqual("2", row.d["key"].d)
l = df.map(lambda x: x.l).first()
self.assertEqual(1, len(l))
self.assertEqual('s', l[0].b)
d = df.map(lambda x: x.d).first()
self.assertEqual(1, len(d))
self.assertEqual(1.0, d["key"].c)
row = df.map(lambda x: x.d["key"]).first()
self.assertEqual(1.0, row.c)
self.assertEqual("2", row.d)
def test_infer_schema(self):
d = [Row(l=[], d={}, s=None),
Row(l=[Row(a=1, b='s')], d={"key": Row(c=1.0, d="2")}, s="")]
rdd = self.sc.parallelize(d)
df = self.sqlCtx.createDataFrame(rdd)
self.assertEqual([], df.map(lambda r: r.l).first())
self.assertEqual([None, ""], df.map(lambda r: r.s).collect())
df.registerTempTable("test")
result = self.sqlCtx.sql("SELECT l[0].a from test where d['key'].d = '2'")
self.assertEqual(1, result.head()[0])
df2 = self.sqlCtx.createDataFrame(rdd, samplingRatio=1.0)
self.assertEqual(df.schema, df2.schema)
self.assertEqual({}, df2.map(lambda r: r.d).first())
self.assertEqual([None, ""], df2.map(lambda r: r.s).collect())
df2.registerTempTable("test2")
result = self.sqlCtx.sql("SELECT l[0].a from test2 where d['key'].d = '2'")
self.assertEqual(1, result.head()[0])
def test_infer_nested_schema(self):
NestedRow = Row("f1", "f2")
nestedRdd1 = self.sc.parallelize([NestedRow([1, 2], {"row1": 1.0}),
NestedRow([2, 3], {"row2": 2.0})])
df = self.sqlCtx.inferSchema(nestedRdd1)
self.assertEqual(Row(f1=[1, 2], f2={u'row1': 1.0}), df.collect()[0])
nestedRdd2 = self.sc.parallelize([NestedRow([[1, 2], [2, 3]], [1, 2]),
NestedRow([[2, 3], [3, 4]], [2, 3])])
df = self.sqlCtx.inferSchema(nestedRdd2)
self.assertEqual(Row(f1=[[1, 2], [2, 3]], f2=[1, 2]), df.collect()[0])
from collections import namedtuple
CustomRow = namedtuple('CustomRow', 'field1 field2')
rdd = self.sc.parallelize([CustomRow(field1=1, field2="row1"),
CustomRow(field1=2, field2="row2"),
CustomRow(field1=3, field2="row3")])
df = self.sqlCtx.inferSchema(rdd)
self.assertEqual(Row(field1=1, field2=u'row1'), df.first())
def test_create_dataframe_from_objects(self):
data = [MyObject(1, "1"), MyObject(2, "2")]
df = self.sqlCtx.createDataFrame(data)
self.assertEqual(df.dtypes, [("key", "bigint"), ("value", "string")])
self.assertEqual(df.first(), Row(key=1, value="1"))
def test_select_null_literal(self):
df = self.sqlCtx.sql("select null as col")
self.assertEqual(Row(col=None), df.first())
def test_apply_schema(self):
from datetime import date, datetime
rdd = self.sc.parallelize([(127, -128, -32768, 32767, 2147483647, 1.0,
date(2010, 1, 1), datetime(2010, 1, 1, 1, 1, 1),
{"a": 1}, (2,), [1, 2, 3], None)])
schema = StructType([
StructField("byte1", ByteType(), False),
StructField("byte2", ByteType(), False),
StructField("short1", ShortType(), False),
StructField("short2", ShortType(), False),
StructField("int1", IntegerType(), False),
StructField("float1", FloatType(), False),
StructField("date1", DateType(), False),
StructField("time1", TimestampType(), False),
StructField("map1", MapType(StringType(), IntegerType(), False), False),
StructField("struct1", StructType([StructField("b", ShortType(), False)]), False),
StructField("list1", ArrayType(ByteType(), False), False),
StructField("null1", DoubleType(), True)])
df = self.sqlCtx.createDataFrame(rdd, schema)
results = df.map(lambda x: (x.byte1, x.byte2, x.short1, x.short2, x.int1, x.float1, x.date1,
x.time1, x.map1["a"], x.struct1.b, x.list1, x.null1))
r = (127, -128, -32768, 32767, 2147483647, 1.0, date(2010, 1, 1),
datetime(2010, 1, 1, 1, 1, 1), 1, 2, [1, 2, 3], None)
self.assertEqual(r, results.first())
df.registerTempTable("table2")
r = self.sqlCtx.sql("SELECT byte1 - 1 AS byte1, byte2 + 1 AS byte2, " +
"short1 + 1 AS short1, short2 - 1 AS short2, int1 - 1 AS int1, " +
"float1 + 1.5 as float1 FROM table2").first()
self.assertEqual((126, -127, -32767, 32766, 2147483646, 2.5), tuple(r))
from pyspark.sql.types import _parse_schema_abstract, _infer_schema_type
rdd = self.sc.parallelize([(127, -32768, 1.0, datetime(2010, 1, 1, 1, 1, 1),
{"a": 1}, (2,), [1, 2, 3])])
abstract = "byte1 short1 float1 time1 map1{} struct1(b) list1[]"
schema = _parse_schema_abstract(abstract)
typedSchema = _infer_schema_type(rdd.first(), schema)
df = self.sqlCtx.createDataFrame(rdd, typedSchema)
r = (127, -32768, 1.0, datetime(2010, 1, 1, 1, 1, 1), {"a": 1}, Row(b=2), [1, 2, 3])
self.assertEqual(r, tuple(df.first()))
def test_struct_in_map(self):
d = [Row(m={Row(i=1): Row(s="")})]
df = self.sc.parallelize(d).toDF()
k, v = list(df.head().m.items())[0]
self.assertEqual(1, k.i)
self.assertEqual("", v.s)
def test_convert_row_to_dict(self):
row = Row(l=[Row(a=1, b='s')], d={"key": Row(c=1.0, d="2")})
self.assertEqual(1, row.asDict()['l'][0].a)
df = self.sc.parallelize([row]).toDF()
df.registerTempTable("test")
row = self.sqlCtx.sql("select l, d from test").head()
self.assertEqual(1, row.asDict()["l"][0].a)
self.assertEqual(1.0, row.asDict()['d']['key'].c)
def test_udt(self):
from pyspark.sql.types import _parse_datatype_json_string, _infer_type, _verify_type
from pyspark.sql.tests import ExamplePointUDT, ExamplePoint
def check_datatype(datatype):
pickled = pickle.loads(pickle.dumps(datatype))
assert datatype == pickled
scala_datatype = self.sqlCtx._ssql_ctx.parseDataType(datatype.json())
python_datatype = _parse_datatype_json_string(scala_datatype.json())
assert datatype == python_datatype
check_datatype(ExamplePointUDT())
structtype_with_udt = StructType([StructField("label", DoubleType(), False),
StructField("point", ExamplePointUDT(), False)])
check_datatype(structtype_with_udt)
p = ExamplePoint(1.0, 2.0)
self.assertEqual(_infer_type(p), ExamplePointUDT())
_verify_type(ExamplePoint(1.0, 2.0), ExamplePointUDT())
self.assertRaises(ValueError, lambda: _verify_type([1.0, 2.0], ExamplePointUDT()))
check_datatype(PythonOnlyUDT())
structtype_with_udt = StructType([StructField("label", DoubleType(), False),
StructField("point", PythonOnlyUDT(), False)])
check_datatype(structtype_with_udt)
p = PythonOnlyPoint(1.0, 2.0)
self.assertEqual(_infer_type(p), PythonOnlyUDT())
_verify_type(PythonOnlyPoint(1.0, 2.0), PythonOnlyUDT())
self.assertRaises(ValueError, lambda: _verify_type([1.0, 2.0], PythonOnlyUDT()))
def test_infer_schema_with_udt(self):
from pyspark.sql.tests import ExamplePoint, ExamplePointUDT
row = Row(label=1.0, point=ExamplePoint(1.0, 2.0))
df = self.sqlCtx.createDataFrame([row])
schema = df.schema
field = [f for f in schema.fields if f.name == "point"][0]
self.assertEqual(type(field.dataType), ExamplePointUDT)
df.registerTempTable("labeled_point")
point = self.sqlCtx.sql("SELECT point FROM labeled_point").head().point
self.assertEqual(point, ExamplePoint(1.0, 2.0))
row = Row(label=1.0, point=PythonOnlyPoint(1.0, 2.0))
df = self.sqlCtx.createDataFrame([row])
schema = df.schema
field = [f for f in schema.fields if f.name == "point"][0]
self.assertEqual(type(field.dataType), PythonOnlyUDT)
df.registerTempTable("labeled_point")
point = self.sqlCtx.sql("SELECT point FROM labeled_point").head().point
self.assertEqual(point, PythonOnlyPoint(1.0, 2.0))
def test_apply_schema_with_udt(self):
from pyspark.sql.tests import ExamplePoint, ExamplePointUDT
row = (1.0, ExamplePoint(1.0, 2.0))
schema = StructType([StructField("label", DoubleType(), False),
StructField("point", ExamplePointUDT(), False)])
df = self.sqlCtx.createDataFrame([row], schema)
point = df.head().point
self.assertEqual(point, ExamplePoint(1.0, 2.0))
row = (1.0, PythonOnlyPoint(1.0, 2.0))
schema = StructType([StructField("label", DoubleType(), False),
StructField("point", PythonOnlyUDT(), False)])
df = self.sqlCtx.createDataFrame([row], schema)
point = df.head().point
self.assertEqual(point, PythonOnlyPoint(1.0, 2.0))
def test_udf_with_udt(self):
from pyspark.sql.tests import ExamplePoint, ExamplePointUDT
row = Row(label=1.0, point=ExamplePoint(1.0, 2.0))
df = self.sqlCtx.createDataFrame([row])
self.assertEqual(1.0, df.map(lambda r: r.point.x).first())
udf = UserDefinedFunction(lambda p: p.y, DoubleType())
self.assertEqual(2.0, df.select(udf(df.point)).first()[0])
udf2 = UserDefinedFunction(lambda p: ExamplePoint(p.x + 1, p.y + 1), ExamplePointUDT())
self.assertEqual(ExamplePoint(2.0, 3.0), df.select(udf2(df.point)).first()[0])
row = Row(label=1.0, point=PythonOnlyPoint(1.0, 2.0))
df = self.sqlCtx.createDataFrame([row])
self.assertEqual(1.0, df.map(lambda r: r.point.x).first())
udf = UserDefinedFunction(lambda p: p.y, DoubleType())
self.assertEqual(2.0, df.select(udf(df.point)).first()[0])
udf2 = UserDefinedFunction(lambda p: PythonOnlyPoint(p.x + 1, p.y + 1), PythonOnlyUDT())
self.assertEqual(PythonOnlyPoint(2.0, 3.0), df.select(udf2(df.point)).first()[0])
def test_parquet_with_udt(self):
from pyspark.sql.tests import ExamplePoint, ExamplePointUDT
row = Row(label=1.0, point=ExamplePoint(1.0, 2.0))
df0 = self.sqlCtx.createDataFrame([row])
output_dir = os.path.join(self.tempdir.name, "labeled_point")
df0.write.parquet(output_dir)
df1 = self.sqlCtx.parquetFile(output_dir)
point = df1.head().point
self.assertEqual(point, ExamplePoint(1.0, 2.0))
row = Row(label=1.0, point=PythonOnlyPoint(1.0, 2.0))
df0 = self.sqlCtx.createDataFrame([row])
df0.write.parquet(output_dir, mode='overwrite')
df1 = self.sqlCtx.parquetFile(output_dir)
point = df1.head().point
self.assertEqual(point, PythonOnlyPoint(1.0, 2.0))
def test_column_operators(self):
ci = self.df.key
cs = self.df.value
c = ci == cs
self.assertTrue(isinstance((- ci - 1 - 2) % 3 * 2.5 / 3.5, Column))
rcc = (1 + ci), (1 - ci), (1 * ci), (1 / ci), (1 % ci), (1 ** ci), (ci ** 1)
self.assertTrue(all(isinstance(c, Column) for c in rcc))
cb = [ci == 5, ci != 0, ci > 3, ci < 4, ci >= 0, ci <= 7]
self.assertTrue(all(isinstance(c, Column) for c in cb))
cbool = (ci & ci), (ci | ci), (~ci)
self.assertTrue(all(isinstance(c, Column) for c in cbool))
css = cs.like('a'), cs.rlike('a'), cs.asc(), cs.desc(), cs.startswith('a'), cs.endswith('a')
self.assertTrue(all(isinstance(c, Column) for c in css))
self.assertTrue(isinstance(ci.cast(LongType()), Column))
def test_column_select(self):
df = self.df
self.assertEqual(self.testData, df.select("*").collect())
self.assertEqual(self.testData, df.select(df.key, df.value).collect())
self.assertEqual([Row(value='1')], df.where(df.key == 1).select(df.value).collect())
def test_freqItems(self):
vals = [Row(a=1, b=-2.0) if i % 2 == 0 else Row(a=i, b=i * 1.0) for i in range(100)]
df = self.sc.parallelize(vals).toDF()
items = df.stat.freqItems(("a", "b"), 0.4).collect()[0]
self.assertTrue(1 in items[0])
self.assertTrue(-2.0 in items[1])
def test_aggregator(self):
df = self.df
g = df.groupBy()
self.assertEqual([99, 100], sorted(g.agg({'key': 'max', 'value': 'count'}).collect()[0]))
self.assertEqual([Row(**{"AVG(key#0)": 49.5})], g.mean().collect())
from pyspark.sql import functions
self.assertEqual((0, u'99'),
tuple(g.agg(functions.first(df.key), functions.last(df.value)).first()))
self.assertTrue(95 < g.agg(functions.approxCountDistinct(df.key)).first()[0])
self.assertEqual(100, g.agg(functions.countDistinct(df.value)).first()[0])
def test_corr(self):
import math
df = self.sc.parallelize([Row(a=i, b=math.sqrt(i)) for i in range(10)]).toDF()
corr = df.stat.corr("a", "b")
self.assertTrue(abs(corr - 0.95734012) < 1e-6)
def test_cov(self):
df = self.sc.parallelize([Row(a=i, b=2 * i) for i in range(10)]).toDF()
cov = df.stat.cov("a", "b")
self.assertTrue(abs(cov - 55.0 / 3) < 1e-6)
def test_crosstab(self):
df = self.sc.parallelize([Row(a=i % 3, b=i % 2) for i in range(1, 7)]).toDF()
ct = df.stat.crosstab("a", "b").collect()
ct = sorted(ct, key=lambda x: x[0])
for i, row in enumerate(ct):
self.assertEqual(row[0], str(i))
self.assertTrue(row[1], 1)
self.assertTrue(row[2], 1)
def test_math_functions(self):
df = self.sc.parallelize([Row(a=i, b=2 * i) for i in range(10)]).toDF()
from pyspark.sql import functions
import math
def get_values(l):
return [j[0] for j in l]
def assert_close(a, b):
c = get_values(b)
diff = [abs(v - c[k]) < 1e-6 for k, v in enumerate(a)]
return sum(diff) == len(a)
assert_close([math.cos(i) for i in range(10)],
df.select(functions.cos(df.a)).collect())
assert_close([math.cos(i) for i in range(10)],
df.select(functions.cos("a")).collect())
assert_close([math.sin(i) for i in range(10)],
df.select(functions.sin(df.a)).collect())
assert_close([math.sin(i) for i in range(10)],
df.select(functions.sin(df['a'])).collect())
assert_close([math.pow(i, 2 * i) for i in range(10)],
df.select(functions.pow(df.a, df.b)).collect())
assert_close([math.pow(i, 2) for i in range(10)],
df.select(functions.pow(df.a, 2)).collect())
assert_close([math.pow(i, 2) for i in range(10)],
df.select(functions.pow(df.a, 2.0)).collect())
assert_close([math.hypot(i, 2 * i) for i in range(10)],
df.select(functions.hypot(df.a, df.b)).collect())
def test_rand_functions(self):
df = self.df
from pyspark.sql import functions
rnd = df.select('key', functions.rand()).collect()
for row in rnd:
assert row[1] >= 0.0 and row[1] <= 1.0, "got: %s" % row[1]
rndn = df.select('key', functions.randn(5)).collect()
for row in rndn:
assert row[1] >= -4.0 and row[1] <= 4.0, "got: %s" % row[1]
# If the specified seed is 0, we should use it.
# https://issues.apache.org/jira/browse/SPARK-9691
rnd1 = df.select('key', functions.rand(0)).collect()
rnd2 = df.select('key', functions.rand(0)).collect()
self.assertEqual(sorted(rnd1), sorted(rnd2))
rndn1 = df.select('key', functions.randn(0)).collect()
rndn2 = df.select('key', functions.randn(0)).collect()
self.assertEqual(sorted(rndn1), sorted(rndn2))
def test_between_function(self):
df = self.sc.parallelize([
Row(a=1, b=2, c=3),
Row(a=2, b=1, c=3),
Row(a=4, b=1, c=4)]).toDF()
self.assertEqual([Row(a=2, b=1, c=3), Row(a=4, b=1, c=4)],
df.filter(df.a.between(df.b, df.c)).collect())
def test_struct_type(self):
from pyspark.sql.types import StructType, StringType, StructField
struct1 = StructType().add("f1", StringType(), True).add("f2", StringType(), True, None)
struct2 = StructType([StructField("f1", StringType(), True),
StructField("f2", StringType(), True, None)])
self.assertEqual(struct1, struct2)
struct1 = StructType().add("f1", StringType(), True).add("f2", StringType(), True, None)
struct2 = StructType([StructField("f1", StringType(), True)])
self.assertNotEqual(struct1, struct2)
struct1 = (StructType().add(StructField("f1", StringType(), True))
.add(StructField("f2", StringType(), True, None)))
struct2 = StructType([StructField("f1", StringType(), True),
StructField("f2", StringType(), True, None)])
self.assertEqual(struct1, struct2)
struct1 = (StructType().add(StructField("f1", StringType(), True))
.add(StructField("f2", StringType(), True, None)))
struct2 = StructType([StructField("f1", StringType(), True)])
self.assertNotEqual(struct1, struct2)
# Catch exception raised during improper construction
try:
struct1 = StructType().add("name")
self.assertEqual(1, 0)
except ValueError:
self.assertEqual(1, 1)
def test_save_and_load(self):
df = self.df
tmpPath = tempfile.mkdtemp()
shutil.rmtree(tmpPath)
df.write.json(tmpPath)
actual = self.sqlCtx.read.json(tmpPath)
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
schema = StructType([StructField("value", StringType(), True)])
actual = self.sqlCtx.read.json(tmpPath, schema)
self.assertEqual(sorted(df.select("value").collect()), sorted(actual.collect()))
df.write.json(tmpPath, "overwrite")
actual = self.sqlCtx.read.json(tmpPath)
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
df.write.save(format="json", mode="overwrite", path=tmpPath,
noUse="this options will not be used in save.")
actual = self.sqlCtx.read.load(format="json", path=tmpPath,
noUse="this options will not be used in load.")
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
defaultDataSourceName = self.sqlCtx.getConf("spark.sql.sources.default",
"org.apache.spark.sql.parquet")
self.sqlCtx.sql("SET spark.sql.sources.default=org.apache.spark.sql.json")
actual = self.sqlCtx.load(path=tmpPath)
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
self.sqlCtx.sql("SET spark.sql.sources.default=" + defaultDataSourceName)
shutil.rmtree(tmpPath)
def test_save_and_load_builder(self):
df = self.df
tmpPath = tempfile.mkdtemp()
shutil.rmtree(tmpPath)
df.write.json(tmpPath)
actual = self.sqlCtx.read.json(tmpPath)
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
schema = StructType([StructField("value", StringType(), True)])
actual = self.sqlCtx.read.json(tmpPath, schema)
self.assertEqual(sorted(df.select("value").collect()), sorted(actual.collect()))
df.write.mode("overwrite").json(tmpPath)
actual = self.sqlCtx.read.json(tmpPath)
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
df.write.mode("overwrite").options(noUse="this options will not be used in save.")\
.option("noUse", "this option will not be used in save.")\
.format("json").save(path=tmpPath)
actual =\
self.sqlCtx.read.format("json")\
.load(path=tmpPath, noUse="this options will not be used in load.")
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
defaultDataSourceName = self.sqlCtx.getConf("spark.sql.sources.default",
"org.apache.spark.sql.parquet")
self.sqlCtx.sql("SET spark.sql.sources.default=org.apache.spark.sql.json")
actual = self.sqlCtx.load(path=tmpPath)
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
self.sqlCtx.sql("SET spark.sql.sources.default=" + defaultDataSourceName)
shutil.rmtree(tmpPath)
def test_help_command(self):
# Regression test for SPARK-5464
rdd = self.sc.parallelize(['{"foo":"bar"}', '{"foo":"baz"}'])
df = self.sqlCtx.jsonRDD(rdd)
# render_doc() reproduces the help() exception without printing output
pydoc.render_doc(df)
pydoc.render_doc(df.foo)
pydoc.render_doc(df.take(1))
def test_access_column(self):
df = self.df
self.assertTrue(isinstance(df.key, Column))
self.assertTrue(isinstance(df['key'], Column))
self.assertTrue(isinstance(df[0], Column))
self.assertRaises(IndexError, lambda: df[2])
self.assertRaises(AnalysisException, lambda: df["bad_key"])
self.assertRaises(TypeError, lambda: df[{}])
def test_column_name_with_non_ascii(self):
df = self.sqlCtx.createDataFrame([(1,)], ["数量"])
self.assertEqual(StructType([StructField("数量", LongType(), True)]), df.schema)
self.assertEqual("DataFrame[数量: bigint]", str(df))
self.assertEqual([("数量", 'bigint')], df.dtypes)
self.assertEqual(1, df.select("数量").first()[0])
self.assertEqual(1, df.select(df["数量"]).first()[0])
def test_access_nested_types(self):
df = self.sc.parallelize([Row(l=[1], r=Row(a=1, b="b"), d={"k": "v"})]).toDF()
self.assertEqual(1, df.select(df.l[0]).first()[0])
self.assertEqual(1, df.select(df.l.getItem(0)).first()[0])
self.assertEqual(1, df.select(df.r.a).first()[0])
self.assertEqual("b", df.select(df.r.getField("b")).first()[0])
self.assertEqual("v", df.select(df.d["k"]).first()[0])
self.assertEqual("v", df.select(df.d.getItem("k")).first()[0])
def test_field_accessor(self):
df = self.sc.parallelize([Row(l=[1], r=Row(a=1, b="b"), d={"k": "v"})]).toDF()
self.assertEqual(1, df.select(df.l[0]).first()[0])
self.assertEqual(1, df.select(df.r["a"]).first()[0])
self.assertEqual(1, df.select(df["r.a"]).first()[0])
self.assertEqual("b", df.select(df.r["b"]).first()[0])
self.assertEqual("b", df.select(df["r.b"]).first()[0])
self.assertEqual("v", df.select(df.d["k"]).first()[0])
def test_infer_long_type(self):
longrow = [Row(f1='a', f2=100000000000000)]
df = self.sc.parallelize(longrow).toDF()
self.assertEqual(df.schema.fields[1].dataType, LongType())
# this saving as Parquet caused issues as well.
output_dir = os.path.join(self.tempdir.name, "infer_long_type")
df.saveAsParquetFile(output_dir)
df1 = self.sqlCtx.parquetFile(output_dir)
self.assertEqual('a', df1.first().f1)
self.assertEqual(100000000000000, df1.first().f2)
self.assertEqual(_infer_type(1), LongType())
self.assertEqual(_infer_type(2**10), LongType())
self.assertEqual(_infer_type(2**20), LongType())
self.assertEqual(_infer_type(2**31 - 1), LongType())
self.assertEqual(_infer_type(2**31), LongType())
self.assertEqual(_infer_type(2**61), LongType())
self.assertEqual(_infer_type(2**71), LongType())
def test_filter_with_datetime(self):
time = datetime.datetime(2015, 4, 17, 23, 1, 2, 3000)
date = time.date()
row = Row(date=date, time=time)
df = self.sqlCtx.createDataFrame([row])
self.assertEqual(1, df.filter(df.date == date).count())
self.assertEqual(1, df.filter(df.time == time).count())
self.assertEqual(0, df.filter(df.date > date).count())
self.assertEqual(0, df.filter(df.time > time).count())
def test_filter_with_datetime_timezone(self):
dt1 = datetime.datetime(2015, 4, 17, 23, 1, 2, 3000, tzinfo=UTCOffsetTimezone(0))
dt2 = datetime.datetime(2015, 4, 17, 23, 1, 2, 3000, tzinfo=UTCOffsetTimezone(1))
row = Row(date=dt1)
df = self.sqlCtx.createDataFrame([row])
self.assertEqual(0, df.filter(df.date == dt2).count())
self.assertEqual(1, df.filter(df.date > dt2).count())
self.assertEqual(0, df.filter(df.date < dt2).count())
def test_time_with_timezone(self):
day = datetime.date.today()
now = datetime.datetime.now()
ts = time.mktime(now.timetuple())
# class in __main__ is not serializable
from pyspark.sql.tests import UTCOffsetTimezone
utc = UTCOffsetTimezone()
utcnow = datetime.datetime.utcfromtimestamp(ts) # without microseconds
# add microseconds to utcnow (keeping year,month,day,hour,minute,second)
utcnow = datetime.datetime(*(utcnow.timetuple()[:6] + (now.microsecond, utc)))
df = self.sqlCtx.createDataFrame([(day, now, utcnow)])
day1, now1, utcnow1 = df.first()
self.assertEqual(day1, day)
self.assertEqual(now, now1)
self.assertEqual(now, utcnow1)
def test_decimal(self):
from decimal import Decimal
schema = StructType([StructField("decimal", DecimalType(10, 5))])
df = self.sqlCtx.createDataFrame([(Decimal("3.14159"),)], schema)
row = df.select(df.decimal + 1).first()
self.assertEqual(row[0], Decimal("4.14159"))
tmpPath = tempfile.mkdtemp()
shutil.rmtree(tmpPath)
df.write.parquet(tmpPath)
df2 = self.sqlCtx.read.parquet(tmpPath)
row = df2.first()
self.assertEqual(row[0], Decimal("3.14159"))
def test_dropna(self):
schema = StructType([
StructField("name", StringType(), True),
StructField("age", IntegerType(), True),
StructField("height", DoubleType(), True)])
# shouldn't drop a non-null row
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', 50, 80.1)], schema).dropna().count(),
1)
# dropping rows with a single null value
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', None, 80.1)], schema).dropna().count(),
0)
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', None, 80.1)], schema).dropna(how='any').count(),
0)
# if how = 'all', only drop rows if all values are null
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', None, 80.1)], schema).dropna(how='all').count(),
1)
self.assertEqual(self.sqlCtx.createDataFrame(
[(None, None, None)], schema).dropna(how='all').count(),
0)
# how and subset
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', 50, None)], schema).dropna(how='any', subset=['name', 'age']).count(),
1)
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', None, None)], schema).dropna(how='any', subset=['name', 'age']).count(),
0)
# threshold
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', None, 80.1)], schema).dropna(thresh=2).count(),
1)
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', None, None)], schema).dropna(thresh=2).count(),
0)
# threshold and subset
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', 50, None)], schema).dropna(thresh=2, subset=['name', 'age']).count(),
1)
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', None, 180.9)], schema).dropna(thresh=2, subset=['name', 'age']).count(),
0)
# thresh should take precedence over how
self.assertEqual(self.sqlCtx.createDataFrame(
[(u'Alice', 50, None)], schema).dropna(
how='any', thresh=2, subset=['name', 'age']).count(),
1)
def test_fillna(self):
schema = StructType([
StructField("name", StringType(), True),
StructField("age", IntegerType(), True),
StructField("height", DoubleType(), True)])
# fillna shouldn't change non-null values
row = self.sqlCtx.createDataFrame([(u'Alice', 10, 80.1)], schema).fillna(50).first()
self.assertEqual(row.age, 10)
# fillna with int
row = self.sqlCtx.createDataFrame([(u'Alice', None, None)], schema).fillna(50).first()
self.assertEqual(row.age, 50)
self.assertEqual(row.height, 50.0)
# fillna with double
row = self.sqlCtx.createDataFrame([(u'Alice', None, None)], schema).fillna(50.1).first()
self.assertEqual(row.age, 50)
self.assertEqual(row.height, 50.1)
# fillna with string
row = self.sqlCtx.createDataFrame([(None, None, None)], schema).fillna("hello").first()
self.assertEqual(row.name, u"hello")
self.assertEqual(row.age, None)
# fillna with subset specified for numeric cols
row = self.sqlCtx.createDataFrame(
[(None, None, None)], schema).fillna(50, subset=['name', 'age']).first()
self.assertEqual(row.name, None)
self.assertEqual(row.age, 50)
self.assertEqual(row.height, None)
# fillna with subset specified for numeric cols
row = self.sqlCtx.createDataFrame(
[(None, None, None)], schema).fillna("haha", subset=['name', 'age']).first()
self.assertEqual(row.name, "haha")
self.assertEqual(row.age, None)
self.assertEqual(row.height, None)
def test_bitwise_operations(self):
from pyspark.sql import functions
row = Row(a=170, b=75)
df = self.sqlCtx.createDataFrame([row])
result = df.select(df.a.bitwiseAND(df.b)).collect()[0].asDict()
self.assertEqual(170 & 75, result['(a & b)'])
result = df.select(df.a.bitwiseOR(df.b)).collect()[0].asDict()
self.assertEqual(170 | 75, result['(a | b)'])
result = df.select(df.a.bitwiseXOR(df.b)).collect()[0].asDict()
self.assertEqual(170 ^ 75, result['(a ^ b)'])
result = df.select(functions.bitwiseNOT(df.b)).collect()[0].asDict()
self.assertEqual(~75, result['~b'])
def test_expr(self):
from pyspark.sql import functions
row = Row(a="length string", b=75)
df = self.sqlCtx.createDataFrame([row])
result = df.select(functions.expr("length(a)")).collect()[0].asDict()
self.assertEqual(13, result["'length(a)"])
def test_replace(self):
schema = StructType([
StructField("name", StringType(), True),
StructField("age", IntegerType(), True),
StructField("height", DoubleType(), True)])
# replace with int
row = self.sqlCtx.createDataFrame([(u'Alice', 10, 10.0)], schema).replace(10, 20).first()
self.assertEqual(row.age, 20)
self.assertEqual(row.height, 20.0)
# replace with double
row = self.sqlCtx.createDataFrame(
[(u'Alice', 80, 80.0)], schema).replace(80.0, 82.1).first()
self.assertEqual(row.age, 82)
self.assertEqual(row.height, 82.1)
# replace with string
row = self.sqlCtx.createDataFrame(
[(u'Alice', 10, 80.1)], schema).replace(u'Alice', u'Ann').first()
self.assertEqual(row.name, u"Ann")
self.assertEqual(row.age, 10)
# replace with subset specified by a string of a column name w/ actual change
row = self.sqlCtx.createDataFrame(
[(u'Alice', 10, 80.1)], schema).replace(10, 20, subset='age').first()
self.assertEqual(row.age, 20)
# replace with subset specified by a string of a column name w/o actual change
row = self.sqlCtx.createDataFrame(
[(u'Alice', 10, 80.1)], schema).replace(10, 20, subset='height').first()
self.assertEqual(row.age, 10)
# replace with subset specified with one column replaced, another column not in subset
# stays unchanged.
row = self.sqlCtx.createDataFrame(
[(u'Alice', 10, 10.0)], schema).replace(10, 20, subset=['name', 'age']).first()
self.assertEqual(row.name, u'Alice')
self.assertEqual(row.age, 20)
self.assertEqual(row.height, 10.0)
# replace with subset specified but no column will be replaced
row = self.sqlCtx.createDataFrame(
[(u'Alice', 10, None)], schema).replace(10, 20, subset=['name', 'height']).first()
self.assertEqual(row.name, u'Alice')
self.assertEqual(row.age, 10)
self.assertEqual(row.height, None)
def test_capture_analysis_exception(self):
self.assertRaises(AnalysisException, lambda: self.sqlCtx.sql("select abc"))
self.assertRaises(AnalysisException, lambda: self.df.selectExpr("a + b"))
# RuntimeException should not be captured
self.assertRaises(py4j.protocol.Py4JJavaError, lambda: self.sqlCtx.sql("abc"))
def test_capture_illegalargument_exception(self):
self.assertRaisesRegexp(IllegalArgumentException, "Setting negative mapred.reduce.tasks",
lambda: self.sqlCtx.sql("SET mapred.reduce.tasks=-1"))
df = self.sqlCtx.createDataFrame([(1, 2)], ["a", "b"])
self.assertRaisesRegexp(IllegalArgumentException, "1024 is not in the permitted values",
lambda: df.select(sha2(df.a, 1024)).collect())
def test_with_column_with_existing_name(self):
keys = self.df.withColumn("key", self.df.key).select("key").collect()
self.assertEqual([r.key for r in keys], list(range(100)))
# regression test for SPARK-10417
def test_column_iterator(self):
def foo():
for x in self.df.key:
break
self.assertRaises(TypeError, foo)
# add test for SPARK-10577 (test broadcast join hint)
def test_functions_broadcast(self):
from pyspark.sql.functions import broadcast
df1 = self.sqlCtx.createDataFrame([(1, "1"), (2, "2")], ("key", "value"))
df2 = self.sqlCtx.createDataFrame([(1, "1"), (2, "2")], ("key", "value"))
# equijoin - should be converted into broadcast join
plan1 = df1.join(broadcast(df2), "key")._jdf.queryExecution().executedPlan()
self.assertEqual(1, plan1.toString().count("BroadcastHashJoin"))
# no join key -- should not be a broadcast join
plan2 = df1.join(broadcast(df2))._jdf.queryExecution().executedPlan()
self.assertEqual(0, plan2.toString().count("BroadcastHashJoin"))
# planner should not crash without a join
broadcast(df1)._jdf.queryExecution().executedPlan()
class HiveContextSQLTests(ReusedPySparkTestCase):
@classmethod
def setUpClass(cls):
ReusedPySparkTestCase.setUpClass()
cls.tempdir = tempfile.NamedTemporaryFile(delete=False)
try:
cls.sc._jvm.org.apache.hadoop.hive.conf.HiveConf()
except py4j.protocol.Py4JError:
cls.tearDownClass()
raise unittest.SkipTest("Hive is not available")
except TypeError:
cls.tearDownClass()
raise unittest.SkipTest("Hive is not available")
os.unlink(cls.tempdir.name)
_scala_HiveContext =\
cls.sc._jvm.org.apache.spark.sql.hive.test.TestHiveContext(cls.sc._jsc.sc())
cls.sqlCtx = HiveContext(cls.sc, _scala_HiveContext)
cls.testData = [Row(key=i, value=str(i)) for i in range(100)]
cls.df = cls.sc.parallelize(cls.testData).toDF()
@classmethod
def tearDownClass(cls):
ReusedPySparkTestCase.tearDownClass()
shutil.rmtree(cls.tempdir.name, ignore_errors=True)
def test_save_and_load_table(self):
df = self.df
tmpPath = tempfile.mkdtemp()
shutil.rmtree(tmpPath)
df.write.saveAsTable("savedJsonTable", "json", "append", path=tmpPath)
actual = self.sqlCtx.createExternalTable("externalJsonTable", tmpPath, "json")
self.assertEqual(sorted(df.collect()),
sorted(self.sqlCtx.sql("SELECT * FROM savedJsonTable").collect()))
self.assertEqual(sorted(df.collect()),
sorted(self.sqlCtx.sql("SELECT * FROM externalJsonTable").collect()))
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
self.sqlCtx.sql("DROP TABLE externalJsonTable")
df.write.saveAsTable("savedJsonTable", "json", "overwrite", path=tmpPath)
schema = StructType([StructField("value", StringType(), True)])
actual = self.sqlCtx.createExternalTable("externalJsonTable", source="json",
schema=schema, path=tmpPath,
noUse="this options will not be used")
self.assertEqual(sorted(df.collect()),
sorted(self.sqlCtx.sql("SELECT * FROM savedJsonTable").collect()))
self.assertEqual(sorted(df.select("value").collect()),
sorted(self.sqlCtx.sql("SELECT * FROM externalJsonTable").collect()))
self.assertEqual(sorted(df.select("value").collect()), sorted(actual.collect()))
self.sqlCtx.sql("DROP TABLE savedJsonTable")
self.sqlCtx.sql("DROP TABLE externalJsonTable")
defaultDataSourceName = self.sqlCtx.getConf("spark.sql.sources.default",
"org.apache.spark.sql.parquet")
self.sqlCtx.sql("SET spark.sql.sources.default=org.apache.spark.sql.json")
df.write.saveAsTable("savedJsonTable", path=tmpPath, mode="overwrite")
actual = self.sqlCtx.createExternalTable("externalJsonTable", path=tmpPath)
self.assertEqual(sorted(df.collect()),
sorted(self.sqlCtx.sql("SELECT * FROM savedJsonTable").collect()))
self.assertEqual(sorted(df.collect()),
sorted(self.sqlCtx.sql("SELECT * FROM externalJsonTable").collect()))
self.assertEqual(sorted(df.collect()), sorted(actual.collect()))
self.sqlCtx.sql("DROP TABLE savedJsonTable")
self.sqlCtx.sql("DROP TABLE externalJsonTable")
self.sqlCtx.sql("SET spark.sql.sources.default=" + defaultDataSourceName)
shutil.rmtree(tmpPath)
def test_window_functions(self):
df = self.sqlCtx.createDataFrame([(1, "1"), (2, "2"), (1, "2"), (1, "2")], ["key", "value"])
w = Window.partitionBy("value").orderBy("key")
from pyspark.sql import functions as F
sel = df.select(df.value, df.key,
F.max("key").over(w.rowsBetween(0, 1)),
F.min("key").over(w.rowsBetween(0, 1)),
F.count("key").over(w.rowsBetween(float('-inf'), float('inf'))),
F.rowNumber().over(w),
F.rank().over(w),
F.denseRank().over(w),
F.ntile(2).over(w))
rs = sorted(sel.collect())
expected = [
("1", 1, 1, 1, 1, 1, 1, 1, 1),
("2", 1, 1, 1, 3, 1, 1, 1, 1),
("2", 1, 2, 1, 3, 2, 1, 1, 1),
("2", 2, 2, 2, 3, 3, 3, 2, 2)
]
for r, ex in zip(rs, expected):
self.assertEqual(tuple(r), ex[:len(r)])
def test_window_functions_without_partitionBy(self):
df = self.sqlCtx.createDataFrame([(1, "1"), (2, "2"), (1, "2"), (1, "2")], ["key", "value"])
w = Window.orderBy("key", df.value)
from pyspark.sql import functions as F
sel = df.select(df.value, df.key,
F.max("key").over(w.rowsBetween(0, 1)),
F.min("key").over(w.rowsBetween(0, 1)),
F.count("key").over(w.rowsBetween(float('-inf'), float('inf'))),
F.rowNumber().over(w),
F.rank().over(w),
F.denseRank().over(w),
F.ntile(2).over(w))
rs = sorted(sel.collect())
expected = [
("1", 1, 1, 1, 4, 1, 1, 1, 1),
("2", 1, 1, 1, 4, 2, 2, 2, 1),
("2", 1, 2, 1, 4, 3, 2, 2, 2),
("2", 2, 2, 2, 4, 4, 4, 3, 2)
]
for r, ex in zip(rs, expected):
self.assertEqual(tuple(r), ex[:len(r)])
if __name__ == "__main__":
unittest.main()
| {
"content_hash": "65d7e1c7fcc50da158aa39473656fa88",
"timestamp": "",
"source": "github",
"line_count": 1207,
"max_line_length": 100,
"avg_line_length": 43.34051367025683,
"alnum_prop": 0.5859458632818474,
"repo_name": "pronix/spark",
"id": "f465e1fa209419478f10b6d7944a008e0f1f72ba",
"size": "53147",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "python/pyspark/sql/tests.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "26730"
},
{
"name": "C",
"bytes": "1493"
},
{
"name": "CSS",
"bytes": "15314"
},
{
"name": "Groff",
"bytes": "5379"
},
{
"name": "Java",
"bytes": "1736009"
},
{
"name": "JavaScript",
"bytes": "69325"
},
{
"name": "Makefile",
"bytes": "7767"
},
{
"name": "Python",
"bytes": "1625694"
},
{
"name": "R",
"bytes": "474164"
},
{
"name": "Scala",
"bytes": "14642450"
},
{
"name": "Shell",
"bytes": "140679"
},
{
"name": "Thrift",
"bytes": "2016"
}
],
"symlink_target": ""
} |
module DbStructureWriter
module Generate
attr_accessor :tables
class << self
def html
str = Template.generate(table_list)
file_put(str)
end
private
def table_list
@tables ||= ActiveRecord::Base.connection.tables
end
def file_put(str)
puts 'file put'
file_path = "./db/#{Rails.application.class.parent_name}_db_tables.html".downcase
f = File.open(file_path, 'w')
f.puts str
f.close
p "generated #{file_path}"
end
end
end
end
| {
"content_hash": "29e263670599bb3ed04ed4ebaf1d7f89",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 89,
"avg_line_length": 19.310344827586206,
"alnum_prop": 0.5696428571428571,
"repo_name": "narikei/db_structure_writer",
"id": "398c691e5f364829c6b29b436d553fd4aa1955fe",
"size": "560",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/db_structure_writer/generate.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "4682"
}
],
"symlink_target": ""
} |
package org.apache.isis.core.metamodel.facets.propparam.specification;
import org.apache.isis.applib.spec.Specification;
public class SpecificationRequiresFirstLetterToBeUpperCase implements Specification {
@Override
public String satisfies(final Object obj) {
if (!(obj instanceof String)) {
return null;
}
final String str = (String) obj;
if (str.length() < 0) {
return "Must contain at least one letter";
}
final char firstLetter = str.charAt(0);
return Character.isUpperCase(firstLetter) ? null : "Must start with upper case";
}
}
| {
"content_hash": "7ee4d11d925c3049b88e78034b7df9df",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 88,
"avg_line_length": 28.772727272727273,
"alnum_prop": 0.6587677725118484,
"repo_name": "sanderginn/isis",
"id": "50a94214b10249cc32db8d89cd8caef4a8bd1012",
"size": "1458",
"binary": false,
"copies": "8",
"ref": "refs/heads/master",
"path": "core/metamodel/src/test/java/org/apache/isis/core/metamodel/facets/propparam/specification/SpecificationRequiresFirstLetterToBeUpperCase.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "53186"
},
{
"name": "Gherkin",
"bytes": "2142"
},
{
"name": "Groovy",
"bytes": "28310"
},
{
"name": "HTML",
"bytes": "440293"
},
{
"name": "Java",
"bytes": "11960104"
},
{
"name": "JavaScript",
"bytes": "115833"
},
{
"name": "Shell",
"bytes": "15120"
}
],
"symlink_target": ""
} |
<?php
namespace Oro\Bundle\AttachmentBundle\Api\Processor;
use Gaufrette\Exception\FileNotFound;
use Psr\Log\LoggerInterface;
use Oro\Component\ChainProcessor\ContextInterface;
use Oro\Component\ChainProcessor\ProcessorInterface;
use Oro\Bundle\ApiBundle\Processor\CustomizeLoadedData\CustomizeLoadedDataContext;
use Oro\Bundle\AttachmentBundle\Manager\FileManager;
/**
* Computes a value of "content" field for File entity.
*/
class ComputeFileContent implements ProcessorInterface
{
/** @var FileManager */
protected $fileManager;
/** @var LoggerInterface */
protected $logger;
/**
* @param FileManager $fileManager
* @param LoggerInterface $logger
*/
public function __construct(FileManager $fileManager, LoggerInterface $logger)
{
$this->fileManager = $fileManager;
$this->logger = $logger;
}
/**
* {@inheritdoc}
*/
public function process(ContextInterface $context)
{
/** @var CustomizeLoadedDataContext $context */
$data = $context->getResult();
if (!is_array($data)) {
return;
}
$config = $context->getConfig();
if (null === $config) {
return;
}
$contentField = $config->getField('content');
if (!$contentField || $contentField->isExcluded()) {
return;
}
if (empty($data['filename'])) {
return;
}
$content = $this->getFileContent($data['filename']);
if (null !== $content) {
$data[$contentField->getPropertyPath()] = $content;
$context->setResult($data);
}
}
/**
* @param string $fileName
*
* @return string|null
*/
protected function getFileContent($fileName)
{
$content = null;
try {
$content = $this->fileManager->getContent($fileName);
} catch (FileNotFound $e) {
$this->logger->error(
sprintf('The content for "%s" file cannot be loaded.', $fileName),
['exception' => $e]
);
}
if (null !== $content) {
$content = base64_encode($content);
}
return $content;
}
}
| {
"content_hash": "48ec9f1db843cef5f321370482e52ed1",
"timestamp": "",
"source": "github",
"line_count": 90,
"max_line_length": 82,
"avg_line_length": 24.966666666666665,
"alnum_prop": 0.5723186470850022,
"repo_name": "Djamy/platform",
"id": "6187fb610e1a86a26aebe9658af754572afbebc6",
"size": "2247",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/Oro/Bundle/AttachmentBundle/Api/Processor/ComputeFileContent.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "542736"
},
{
"name": "Gherkin",
"bytes": "73480"
},
{
"name": "HTML",
"bytes": "1633049"
},
{
"name": "JavaScript",
"bytes": "3284434"
},
{
"name": "PHP",
"bytes": "35536269"
}
],
"symlink_target": ""
} |
Simple GUI for AtomicParsley
| {
"content_hash": "d5390c865b4480f77f5f985632916375",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 28,
"avg_line_length": 29,
"alnum_prop": 0.8620689655172413,
"repo_name": "garethflowers/retagit",
"id": "cfd0acd6d71aa2913a37182a19be60ee82de6db8",
"size": "40",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "159374"
}
],
"symlink_target": ""
} |
package net.fortuna.ical4j.model.property;
import net.fortuna.ical4j.model.*;
import net.fortuna.ical4j.model.parameter.Value;
import net.fortuna.ical4j.validate.PropertyValidator;
import net.fortuna.ical4j.validate.ValidationException;
import net.fortuna.ical4j.validate.ValidationResult;
import java.io.IOException;
import java.net.URISyntaxException;
import java.text.ParseException;
import java.time.temporal.TemporalAmount;
/**
* $Id$
* <p/>
* Created: [Apr 6, 2004]
* <p/>
* Defines a TRIGGER iCalendar component property.
* <p/>
* <pre>
* 4.8.6.3 Trigger
*
* Property Name: TRIGGER
*
* Purpose: This property specifies when an alarm will trigger.
*
* Value Type: The default value type is DURATION. The value type can be
* set to a DATE-TIME value type, in which case the value MUST specify a
* UTC formatted DATE-TIME value.
*
* Property Parameters: Non-standard, value data type, time zone
* identifier or trigger relationship property parameters can be
* specified on this property. The trigger relationship property
* parameter MUST only be specified when the value type is DURATION.
*
* Conformance: This property MUST be specified in the "VALARM" calendar
* component.
*
* Description: Within the "VALARM" calendar component, this property
* defines when the alarm will trigger. The default value type is
* DURATION, specifying a relative time for the trigger of the alarm.
* The default duration is relative to the start of an event or to-do
* that the alarm is associated with. The duration can be explicitly set
*
* to trigger from either the end or the start of the associated event
* or to-do with the "RELATED" parameter. A value of START will set the
* alarm to trigger off the start of the associated event or to-do. A
* value of END will set the alarm to trigger off the end of the
* associated event or to-do.
*
* Either a positive or negative duration may be specified for the
* "TRIGGER" property. An alarm with a positive duration is triggered
* after the associated start or end of the event or to-do. An alarm
* with a negative duration is triggered before the associated start or
* end of the event or to-do.
*
* The "RELATED" property parameter is not valid if the value type of
* the property is set to DATE-TIME (i.e., for an absolute date and time
* alarm trigger). If a value type of DATE-TIME is specified, then the
* property value MUST be specified in the UTC time format. If an
* absolute trigger is specified on an alarm for a recurring event or
* to-do, then the alarm will only trigger for the specified absolute
* date/time, along with any specified repeating instances.
*
* If the trigger is set relative to START, then the "DTSTART" property
* MUST be present in the associated "VEVENT" or "VTODO" calendar
* component. If an alarm is specified for an event with the trigger set
* relative to the END, then the "DTEND" property or the "DSTART" and
* "DURATION' properties MUST be present in the associated "VEVENT"
* calendar component. If the alarm is specified for a to-do with a
* trigger set relative to the END, then either the "DUE" property or
* the "DSTART" and "DURATION' properties MUST be present in the
* associated "VTODO" calendar component.
*
* Alarms specified in an event or to-do which is defined in terms of a
* DATE value type will be triggered relative to 00:00:00 UTC on the
* specified date. For example, if "DTSTART:19980205, then the duration
* trigger will be relative to19980205T000000Z.
*
* Format Definition: The property is defined by the following notation:
*
* trigger = "TRIGGER" (trigrel / trigabs)
*
* trigrel = *(
*
* ; the following are optional,
* ; but MUST NOT occur more than once
*
* (";" "VALUE" "=" "DURATION") /
* (";" trigrelparam) /
*
* ; the following is optional,
* ; and MAY occur more than once
*
* (";" xparam)
* ) ":" dur-value
*
* trigabs = 1*(
*
* ; the following is REQUIRED,
* ; but MUST NOT occur more than once
*
* (";" "VALUE" "=" "DATE-TIME") /
*
* ; the following is optional,
* ; and MAY occur more than once
*
* (";" xparam)
*
* ) ":" date-time
* </pre>
*
* @author Ben Fortuna
*/
public class Trigger extends UtcProperty {
private static final long serialVersionUID = 5049421499261722194L;
private TemporalAmountAdapter duration;
/**
* Default constructor.
*/
public Trigger() {
super(TRIGGER, new Factory());
}
/**
* @param aList a list of parameters for this component
* @param aValue a value string for this component
*/
public Trigger(final ParameterList aList, final String aValue) {
super(TRIGGER, aList, new Factory());
setValue(aValue);
}
/**
* @param duration a duration in milliseconds
*/
@Deprecated
public Trigger(final Dur duration) {
this(TemporalAmountAdapter.from(duration).getDuration());
}
/**
* @param duration a duration in milliseconds
*/
public Trigger(final TemporalAmount duration) {
super(TRIGGER, new Factory());
setDuration(duration);
}
/**
* @param aList a list of parameters for this component
* @param duration a duration in milliseconds
*/
@Deprecated
public Trigger(final ParameterList aList, final Dur duration) {
this(aList, TemporalAmountAdapter.from(duration).getDuration());
}
/**
* @param aList a list of parameters for this component
* @param duration a duration in milliseconds
*/
public Trigger(final ParameterList aList, final TemporalAmount duration) {
super(TRIGGER, aList, new Factory());
setDuration(duration);
}
/**
* @param dateTime a date representation of a date-time
*/
public Trigger(final DateTime dateTime) {
super(TRIGGER, new Factory());
setDateTime(dateTime);
}
/**
* @param aList a list of parameters for this component
* @param dateTime a date representation of a date-time
*/
public Trigger(final ParameterList aList, final DateTime dateTime) {
super(TRIGGER, aList, new Factory());
setDateTime(dateTime);
}
/**
* {@inheritDoc}
*/
@Override
public ValidationResult validate() throws ValidationException {
ValidationResult result = super.validate();
if (Value.DATE_TIME.equals(getParameter(Parameter.VALUE))) {
result = result.merge(PropertyValidator.TRIGGER_ABS.validate(this));
} else {
result = result.merge(PropertyValidator.TRIGGER_REL.validate(this));
}
return result;
}
/**
* @return Returns the duration.
*/
public final TemporalAmount getDuration() {
if (duration != null) {
return duration.getDuration();
}
return null;
}
/**
* {@inheritDoc}
*/
@Override
public final void setValue(final String aValue) {
try {
super.setValue(aValue);
duration = null;
} catch (ParseException pe) {
duration = TemporalAmountAdapter.parse(aValue);
super.setDateTime(null);
}
}
/**
* {@inheritDoc}
*/
@Override
public final String getValue() {
if (duration != null) {
return duration.toString();
}
return super.getValue();
}
/**
* @param dateTime The dateTime to set.
*/
@Override
public final void setDateTime(final DateTime dateTime) {
super.setDateTime(dateTime);
duration = null;
getParameters().replace(Value.DATE_TIME);
}
/**
* @param duration The duration to set.
*/
public final void setDuration(final TemporalAmount duration) {
this.duration = new TemporalAmountAdapter(duration);
super.setDateTime(null);
// duration is the default value type for Trigger..
if (getParameter(Parameter.VALUE) != null) {
getParameters().replace(Value.DURATION);
}
}
public static class Factory extends Content.Factory implements PropertyFactory<Trigger> {
private static final long serialVersionUID = 1L;
public Factory() {
super(TRIGGER);
}
@Override
public Trigger createProperty(final ParameterList parameters, final String value)
throws IOException, URISyntaxException, ParseException {
return new Trigger(parameters, value);
}
@Override
public Trigger createProperty() {
return new Trigger();
}
}
}
| {
"content_hash": "753b40455e8c3377f97e2bdb662392ec",
"timestamp": "",
"source": "github",
"line_count": 279,
"max_line_length": 96,
"avg_line_length": 34.58064516129032,
"alnum_prop": 0.6194029850746269,
"repo_name": "ical4j/ical4j",
"id": "15bcda6bdb0e59b49702ae6d38bac79916835986",
"size": "11215",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "src/main/java/net/fortuna/ical4j/model/property/Trigger.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Groovy",
"bytes": "420886"
},
{
"name": "HTML",
"bytes": "6874"
},
{
"name": "Java",
"bytes": "2329519"
},
{
"name": "Makefile",
"bytes": "1377"
},
{
"name": "Shell",
"bytes": "56847"
}
],
"symlink_target": ""
} |
package class
import (
. "github.com/etheriqa/crescent/game"
)
func NewClassMage() *Class {
var q, w, e, r Ability
class := &Class{
Name: "Mage",
Health: 930,
HealthRegeneration: 23,
Mana: 580,
ManaRegeneration: 33,
Armor: DefaultArmor,
MagicResistance: DefaultMagicResistance,
CriticalStrikeChance: DefaultCriticalStrikeChance,
CriticalStrikeFactor: DefaultCriticalStrikeFactor,
CooldownReduction: DefaultCooldownReduction,
DamageThreatFactor: DefaultDamageThreatFactor,
HealingThreatFactor: DefaultHealingThreatFactor,
Abilities: []*Ability{&q, &w, &e, &r},
}
q = Ability{
Name: "Frost Bolt",
Description: "Deals magic damage / Reduces 10 armor for 8 seconds to target / 20% chance to reset cooldown for Icicle",
TargetType: TargetTypeEnemy,
HealthCost: 0,
ManaCost: 0,
ActivationDuration: 2 * Second,
CooldownDuration: 0,
DisableTypes: []DisableType{
DisableTypeSilence,
DisableTypeStun,
},
Perform: func(g Game, s Subject, o *Unit) {
c := UnitCorrection{
Armor: -10,
}
g.Correction(o, c, q.Name, 1, 8*Second)
_, _, _, err := MakeMagicDamage(s, o, 155).Perform(g)
if err != nil {
Logger().Fatal(err)
}
if g.Rand().Float64() > 0.1 {
return
}
g.ResetCooldown(s.Subject(), &w)
},
}
w = Ability{
Name: "Icicle",
Description: "Grants a magic damage over time effect for 10 seconds to target / 20% chance to reset cooldown for Absolute Zero",
TargetType: TargetTypeEnemy,
HealthCost: 0,
ManaCost: 31,
ActivationDuration: 2 * Second,
CooldownDuration: 8 * Second,
DisableTypes: []DisableType{
DisableTypeSilence,
DisableTypeStun,
},
Perform: func(g Game, s Subject, o *Unit) {
g.DoT(MakeMagicDamage(s, o, 15), w.Name, 10*Second)
if g.Rand().Float64() > 0.2 {
return
}
g.ResetCooldown(s.Subject(), &e)
},
}
e = Ability{
Name: "Absolute Zero",
Description: "Deals magic damage",
TargetType: TargetTypeEnemy,
HealthCost: 0,
ManaCost: 49,
ActivationDuration: 2 * Second,
CooldownDuration: 18 * Second,
DisableTypes: []DisableType{
DisableTypeSilence,
DisableTypeStun,
},
Perform: func(g Game, s Subject, o *Unit) {
_, _, _, err := MakeMagicDamage(s, o, 420).Perform(g)
if err != nil {
Logger().Fatal(err)
}
},
}
r = Ability{
Name: "Blizzard",
Description: "Deals magic damage to all enemies / Grants magic damage over time effects to all enemies",
TargetType: TargetTypeNone,
HealthCost: 0,
ManaCost: 252,
ActivationDuration: 2 * Second,
CooldownDuration: 60 * Second,
DisableTypes: []DisableType{
DisableTypeSilence,
DisableTypeStun,
},
Perform: func(g Game, s Subject, o *Unit) {
g.UnitQuery().EachEnemy(s.Subject(), func(enemy *Unit) {
_, _, _, err := MakeMagicDamage(s, enemy, 800).Perform(g)
if err != nil {
Logger().Fatal(err)
}
if enemy.IsDead() {
return
}
g.DoT(MakeMagicDamage(s, enemy, 10), r.Name, 10*Second)
})
},
}
return class
}
| {
"content_hash": "8ceeab54c0a90606bc736a7e72a45056",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 137,
"avg_line_length": 28.28448275862069,
"alnum_prop": 0.6080463273392258,
"repo_name": "etheriqa/crescent",
"id": "c700ae3d3d710382357b71714e0db9147e807503",
"size": "3281",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "class/mage.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "129673"
},
{
"name": "Makefile",
"bytes": "591"
}
],
"symlink_target": ""
} |
<?php
// this check prevents access to debug front controllers that are deployed by accident to production servers.
// feel free to remove this, extend it, or make something more sophisticated.
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
'127.0.0.1',
'::1',
))) {
header('HTTP/1.0 403 Forbidden');
die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel('dev', true);
$kernel->loadClassCache();
$kernel->handle(Request::createFromGlobals())->send(); | {
"content_hash": "5dc65921bb29441d4e3694102f5b6b2f",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 109,
"avg_line_length": 34.3,
"alnum_prop": 0.6880466472303207,
"repo_name": "mremolt/reisebuero-symfony",
"id": "2a635b7c65e30a3d323bcbf187794b492be2dd6c",
"size": "686",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "web/app_dev.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "91943"
},
{
"name": "Shell",
"bytes": "2623"
}
],
"symlink_target": ""
} |
module Dockmaster
# This class holds data for the documentation processor
class ProcessData
attr_accessor :level, :intern, :final, :final_line, :cache_final, :cache_intern
attr_accessor :intern_line, :activity
end
end
| {
"content_hash": "936a837d3c121a3689e3071e62e74169",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 83,
"avg_line_length": 33.142857142857146,
"alnum_prop": 0.7413793103448276,
"repo_name": "chrisblutz/dockmaster",
"id": "d53d8e97d5e8bb4ab216b03bd1448567f3cc1302",
"size": "232",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/dockmaster/docs/process_data.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "29"
},
{
"name": "Ruby",
"bytes": "89879"
}
],
"symlink_target": ""
} |
- Jeff Marshall for the initial idea | {
"content_hash": "7ccd536a056a34c0a166d41fe0ba562d",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 36,
"avg_line_length": 36,
"alnum_prop": 0.8055555555555556,
"repo_name": "wikicause/wikicause",
"id": "e510024a35613186c0b731e98beb8967c1dbe286",
"size": "36",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CONTRIBUTIONS.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8471"
},
{
"name": "JavaScript",
"bytes": "17551"
}
],
"symlink_target": ""
} |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.6">
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="variables_a.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Cargando...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Buscando...</div>
<div class="SRStatus" id="NoMatches">Nada coincide</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
| {
"content_hash": "eaab427ae51a179e28afd4ff28bb6138",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 121,
"avg_line_length": 39.23076923076923,
"alnum_prop": 0.707843137254902,
"repo_name": "guillegalor/PracticasED",
"id": "d95f53d95d6dc86f543bd0a2e0737509085fd79c",
"size": "1020",
"binary": false,
"copies": "16",
"ref": "refs/heads/master",
"path": "Practicafinal/conecta4_v2.1/doc/html/search/variables_a.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "300030"
},
{
"name": "CSS",
"bytes": "8922"
},
{
"name": "HTML",
"bytes": "151642"
},
{
"name": "JavaScript",
"bytes": "89616"
},
{
"name": "Makefile",
"bytes": "10071"
},
{
"name": "TeX",
"bytes": "758815"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>float: Not compatible</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.12.0 / float - 8.9.0</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
float
<small>
8.9.0
<span class="label label-info">Not compatible</span>
</small>
</h1>
<p><em><script>document.write(moment("2020-08-26 04:03:56 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2020-08-26 04:03:56 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.12.0 Formal proof management system
num 1.3 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.10.0 The OCaml compiler (virtual package)
ocaml-base-compiler 4.10.0 Official release 4.10.0
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.8.1 A library manager for OCaml
# opam file:
opam-version: "2.0"
maintainer: "Hugo.Herbelin@inria.fr"
homepage: "https://github.com/coq-contribs/float"
license: "LGPL 2.1"
build: [make "-j%{jobs}%"]
install: [make "install"]
remove: ["rm" "-R" "%{lib}%/coq/user-contrib/Float"]
depends: [
"ocaml"
"coq" {>= "8.9" & < "8.10~"}
]
tags: [
"keyword: floating point arithmetic"
"category: Computer Science/Data Types and Data Structures"
"date: 2001"
]
authors: [
"Laurent Théry"
"Sylvie Boldo"
]
bug-reports: "https://github.com/coq-contribs/float/issues"
dev-repo: "git+https://github.com/coq-contribs/float.git"
synopsis: "Library for floating point numbers"
description: """
A library for floating point numbers."""
flags: light-uninstall
url {
src: "https://github.com/coq-contribs/float/archive/v8.9.0.tar.gz"
checksum: "md5=b2b20e8c2d447937e826d391dbce703f"
}
</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-float.8.9.0 coq.8.12.0</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.12.0).
The following dependencies couldn't be met:
- coq-float -> coq < 8.10~ -> ocaml < 4.10
base of this switch (use `--unlock-base' to force)
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-float.8.9.0</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
<small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small>
</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": "5226cae9f640877864a3d49a2e005f3f",
"timestamp": "",
"source": "github",
"line_count": 169,
"max_line_length": 157,
"avg_line_length": 39.52662721893491,
"alnum_prop": 0.5335329341317365,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "de2b73830260db0da570b6e51670acf0aad07718",
"size": "6683",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.10.0-2.0.6/released/8.12.0/float/8.9.0.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
using namespace dlib;
using namespace std;
#pragma region template
#define load_image_dataset_array_template_sub(__TYPE__, error, type, __TYPE_OUT__, ...) \
do {\
dlib::array<array2d<__TYPE__>> tmp_images;\
std::vector<std::vector<__TYPE_OUT__>> tmp_locs;\
\
dlib::load_image_dataset(tmp_images, tmp_locs, std::string(filename, filename_length));\
\
array_copy2(__TYPE__, tmp_images, images);\
std::vector<std::vector<__TYPE_OUT__*>*>* ret_locs = static_cast<std::vector<std::vector<__TYPE_OUT__*>*>*>(object_locations);\
for (int i = 0; i < tmp_locs.size(); i++)\
{\
std::vector<__TYPE_OUT__>& tmp_vec = tmp_locs[i];\
std::vector<__TYPE_OUT__*>* vec = new std::vector<__TYPE_OUT__*>();\
for (int j = 0; j < tmp_vec.size(); j++)\
{\
__TYPE_OUT__& m = tmp_vec[j];\
vec->push_back(new __TYPE_OUT__(m));\
}\
ret_locs->push_back(vec);\
}\
} while (0)
#define load_image_dataset_array_full_object_detection_template(__TYPE__, error, type, ...) \
load_image_dataset_array_template_sub(__TYPE__, error, type, dlib::full_object_detection, __VA_ARGS__)
#define load_image_dataset_template_sub(__TYPE__, error, __ELEMENT_TYPE__, __ROWS__, __COLUMNS__, __TYPE_OUT__, ...) \
do {\
std::vector<matrix<__TYPE__>> tmp_images;\
std::vector<std::vector<__TYPE_OUT__>> tmp_locs;\
dlib::load_image_dataset(tmp_images, tmp_locs, std::string(filename, filename_length));\
std::vector<matrix<__TYPE__>*>* ret_images = static_cast<std::vector<matrix<__TYPE__>*>*>(images);\
for (int i = 0; i < tmp_images.size(); i++)\
{\
matrix<__TYPE__>& m = tmp_images[i];\
ret_images->push_back(new matrix<__TYPE__>(m));\
}\
std::vector<std::vector<__TYPE_OUT__*>*>* ret_locs = static_cast<std::vector<std::vector<__TYPE_OUT__*>*>*>(object_locations);\
for (int i = 0; i < tmp_locs.size(); i++)\
{\
std::vector<__TYPE_OUT__>& tmp_vec = tmp_locs[i];\
std::vector<__TYPE_OUT__*>* vec = new std::vector<__TYPE_OUT__*>();\
for (int j = 0; j < tmp_vec.size(); j++)\
{\
__TYPE_OUT__& m = tmp_vec[j];\
vec->push_back(new __TYPE_OUT__(m));\
}\
ret_locs->push_back(vec);\
}\
} while (0)
#define load_image_dataset_mmod_rect_template(__TYPE__, error, __ELEMENT_TYPE__, __ROWS__, __COLUMNS__, ...) \
load_image_dataset_template_sub(__TYPE__, error, __ELEMENT_TYPE__, __ROWS__, __COLUMNS__, dlib::mmod_rect, __VA_ARGS__)
#define load_image_dataset_rectangle_template(__TYPE__, error, __ELEMENT_TYPE__, __ROWS__, __COLUMNS__, ...) \
load_image_dataset_template_sub(__TYPE__, error, __ELEMENT_TYPE__, __ROWS__, __COLUMNS__, dlib::rectangle, __VA_ARGS__)
#pragma endregion template
DLLEXPORT int load_image_dataset_array_full_object_detection(array2d_type type,
void* images,
void* object_locations,
const char* filename,
const int filename_length)
{
int error = ERR_OK;
array2d_nonalpha_template(type,
error,
load_image_dataset_array_full_object_detection_template,
images,
object_locations,
filename,
filename_length);
return error;
}
DLLEXPORT int load_image_dataset_mmod_rect(matrix_element_type type,
void* images,
void* object_locations,
const char* filename,
const int filename_length)
{
int error = ERR_OK;
matrix_nonalpha_template(type,
error,
matrix_template_size_template,
load_image_dataset_mmod_rect_template,
0,
0,
images,
object_locations,
filename,
filename_length);
return error;
}
DLLEXPORT int load_image_dataset_rectangle(matrix_element_type type,
void* images,
void* object_locations,
const char* filename,
const int filename_length)
{
int error = ERR_OK;
matrix_nonalpha_template(type,
error,
matrix_template_size_template,
load_image_dataset_rectangle_template,
0,
0,
images,
object_locations,
filename,
filename_length);
return error;
}
#endif | {
"content_hash": "4b10808bcb644dd51ebead244b86fb03",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 131,
"avg_line_length": 40.90551181102362,
"alnum_prop": 0.4667949951876805,
"repo_name": "takuya-takeuchi/DlibDotNet",
"id": "9bd76bf320b1114162f9371d08cd8d5abde3e7cd",
"size": "5489",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/DlibDotNet.Native/dlib/data_io/load_image_dataset.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "1780"
},
{
"name": "C",
"bytes": "18358"
},
{
"name": "C#",
"bytes": "3299357"
},
{
"name": "C++",
"bytes": "1301036"
},
{
"name": "CMake",
"bytes": "14376"
},
{
"name": "Dockerfile",
"bytes": "50520"
},
{
"name": "Makefile",
"bytes": "1687"
},
{
"name": "PowerShell",
"bytes": "129499"
},
{
"name": "Shell",
"bytes": "4132"
}
],
"symlink_target": ""
} |
<?php
/**
* eOS_Sniffs_Functions_FunctionCallSignatureSniff.
*
* @category PHP
* @package PHP_CodeSniffer
* @author Greg Sherwood <gsherwood@squiz.net>
* @author Marc McIntyre <mmcintyre@squiz.net>
* @author Alexandru G. <alex@gentle.ro>
* @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600)
* @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
* @version Release: @package_version@
* @link http://pear.php.net/package/PHP_CodeSniffer
*/
class eOS_Sniffs_Functions_FunctionCallSignatureSniff implements PHP_CodeSniffer_Sniff
{
/**
* The number of spaces code should be indented.
*
* @var int
*/
public $indent = 4;
/**
* If TRUE, multiple arguments can be defined per line in a multi-line call.
*
* @var bool
*/
public $allowMultipleArguments = true;
/**
* How many spaces should follow the opening bracket.
*
* @var int
*/
public $requiredSpacesAfterOpen = 0;
/**
* How many spaces should precede the closing bracket.
*
* @var int
*/
public $requiredSpacesBeforeClose = 0;
/**
* Returns an array of tokens this test wants to listen for.
*
* @return array
*/
public function register()
{
return array(T_STRING);
}//end register()
/**
* Processes this test, when one of its tokens is encountered.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
*
* @return void
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$this->requiredSpacesAfterOpen = (int) $this->requiredSpacesAfterOpen;
$this->requiredSpacesBeforeClose = (int) $this->requiredSpacesBeforeClose;
$tokens = $phpcsFile->getTokens();
// Find the next non-empty token.
$openBracket = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);
if ($tokens[$openBracket]['code'] !== T_OPEN_PARENTHESIS) {
// Not a function call.
return;
}
if (isset($tokens[$openBracket]['parenthesis_closer']) === false) {
// Not a function call.
return;
}
// Find the previous non-empty token.
$search = PHP_CodeSniffer_Tokens::$emptyTokens;
$search[] = T_BITWISE_AND;
$previous = $phpcsFile->findPrevious($search, ($stackPtr - 1), null, true);
if ($tokens[$previous]['code'] === T_FUNCTION) {
// It's a function definition, not a function call.
return;
}
$closeBracket = $tokens[$openBracket]['parenthesis_closer'];
if (($stackPtr + 1) === $openBracket) {
// Checking this: $value = my_function[*](...).
$error = 'Space before opening parenthesis of function call is required';
$phpcsFile->addError($error, $stackPtr, 'SpaceBeforeOpenBracket');
}
$next = $phpcsFile->findNext(T_WHITESPACE, ($closeBracket + 1), null, true);
if ($tokens[$next]['code'] === T_SEMICOLON) {
if (in_array($tokens[($closeBracket + 1)]['code'], PHP_CodeSniffer_Tokens::$emptyTokens) === true) {
$error = 'Space after closing parenthesis of function call prohibited';
$phpcsFile->addError($error, $closeBracket, 'SpaceAfterCloseBracket');
}
}
// Check if this is a single line or multi-line function call.
if ($this->isMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens) === true) {
$this->processMultiLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
} else {
$this->processSingleLineCall($phpcsFile, $stackPtr, $openBracket, $tokens);
}
}//end process()
/**
* Processes single-line calls.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param int $openBracket The position of the opening bracket
* in the stack passed in $tokens.
* @param array $tokens The stack of tokens that make up
* the file.
*
* @return void
*/
public function isMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens)
{
$closeBracket = $tokens[$openBracket]['parenthesis_closer'];
if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) {
return true;
}
return false;
}//end isMultiLineCall()
/**
* Processes single-line calls.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param int $openBracket The position of the opening bracket
* in the stack passed in $tokens.
* @param array $tokens The stack of tokens that make up
* the file.
*
* @return void
*/
public function processSingleLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens)
{
$closer = $tokens[$openBracket]['parenthesis_closer'];
if ($openBracket === ($closer - 1)) {
return;
}
if ($this->requiredSpacesAfterOpen === 0 && $tokens[($openBracket + 1)]['code'] === T_WHITESPACE) {
// Checking this: $value = my_function([*]...).
$error = 'Space after opening parenthesis of function call prohibited';
$phpcsFile->addError($error, $stackPtr, 'SpaceAfterOpenBracket');
} else if ($this->requiredSpacesAfterOpen > 0) {
$spaceAfterOpen = 0;
if ($tokens[($openBracket + 1)]['code'] === T_WHITESPACE) {
$spaceAfterOpen = strlen($tokens[($openBracket + 1)]['content']);
}
if ($spaceAfterOpen !== $this->requiredSpacesAfterOpen) {
$error = 'Expected %s spaces after opening bracket; %s found';
$data = array(
$this->requiredSpacesAfterOpen,
$spaceAfterOpen,
);
$phpcsFile->addError($error, $stackPtr, 'SpaceAfterOpenBracket', $data);
}
}
// Checking this: $value = my_function(...[*]).
$spaceBeforeClose = 0;
if ($tokens[($closer - 1)]['code'] === T_WHITESPACE) {
$spaceBeforeClose = strlen($tokens[($closer - 1)]['content']);
}
if ($spaceBeforeClose !== $this->requiredSpacesBeforeClose) {
$error = 'Expected %s spaces before closing bracket; %s found';
$data = array(
$this->requiredSpacesBeforeClose,
$spaceBeforeClose,
);
$phpcsFile->addError($error, $stackPtr, 'SpaceBeforeCloseBracket', $data);
}
}//end processSingleLineCall()
/**
* Processes multi-line calls.
*
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
* @param int $stackPtr The position of the current token
* in the stack passed in $tokens.
* @param int $openBracket The position of the openning bracket
* in the stack passed in $tokens.
* @param array $tokens The stack of tokens that make up
* the file.
*
* @return void
*/
public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens)
{
// We need to work out how far indented the function
// call itself is, so we can work out how far to
// indent the arguments.
$functionIndent = 0;
for ($i = ($stackPtr - 1); $i >= 0; $i--) {
if ($tokens[$i]['line'] !== $tokens[$stackPtr]['line']) {
$i++;
break;
}
}
if ($i > 0 && $tokens[$i]['code'] === T_WHITESPACE) {
$functionIndent = strlen($tokens[$i]['content']);
}
// Each line between the parenthesis should be indented n spaces.
$closeBracket = $tokens[$openBracket]['parenthesis_closer'];
$lastLine = $tokens[$openBracket]['line'];
for ($i = ($openBracket + 1); $i < $closeBracket; $i++) {
// Skip nested function calls.
if ($tokens[$i]['code'] === T_OPEN_PARENTHESIS) {
$i = $tokens[$i]['parenthesis_closer'];
$lastLine = $tokens[$i]['line'];
continue;
}
if ($tokens[$i]['line'] !== $lastLine) {
$lastLine = $tokens[$i]['line'];
// Ignore heredoc indentation.
if (in_array($tokens[$i]['code'], PHP_CodeSniffer_Tokens::$heredocTokens) === true) {
continue;
}
// Ignore multi-line string indentation.
if (in_array($tokens[$i]['code'], PHP_CodeSniffer_Tokens::$stringTokens) === true) {
if ($tokens[$i]['code'] === $tokens[($i - 1)]['code']) {
continue;
}
}
// We changed lines, so this should be a whitespace indent token, but first make
// sure it isn't a blank line because we don't need to check indent unless there
// is actually some code to indent.
if ($tokens[$i]['code'] === T_WHITESPACE) {
$nextCode = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closeBracket + 1), true);
if ($tokens[$nextCode]['line'] !== $lastLine) {
$error = 'Empty lines are not allowed in multi-line function calls';
$phpcsFile->addError($error, $i, 'EmptyLine');
continue;
}
} else {
$nextCode = $i;
}
// Check if the next line contains an object operator, if so rely on
// the ObjectOperatorIndentSniff to test the indent.
if ($tokens[$nextCode]['type'] === 'T_OBJECT_OPERATOR') {
continue;
}
if ($nextCode === $closeBracket) {
// Closing brace needs to be indented to the same level
// as the function call.
$expectedIndent = $functionIndent;
} else {
$expectedIndent = ($functionIndent + $this->indent);
}
if ($tokens[$i]['code'] !== T_WHITESPACE) {
// Just check if it is a multi-line block comment. If so, we can
// calculate the indent from the whitespace before the content.
if ($tokens[$i]['code'] === T_COMMENT
&& $tokens[($i - 1)]['code'] === T_COMMENT
) {
$trimmed = ltrim($tokens[$i]['content']);
$foundIndent = (strlen($tokens[$i]['content']) - strlen($trimmed));
} else {
$foundIndent = 0;
}
} else {
$foundIndent = strlen($tokens[$i]['content']);
}
if ($expectedIndent !== $foundIndent) {
$error = 'Multi-line function call not indented correctly; expected %s spaces but found %s';
$data = array(
$expectedIndent,
$foundIndent,
);
$phpcsFile->addError($error, $i, 'Indent', $data);
}
}//end if
// Skip the rest of a closure.
if ($tokens[$i]['code'] === T_CLOSURE) {
$i = $tokens[$i]['scope_closer'];
$lastLine = $tokens[$i]['line'];
continue;
}
// Skip the rest of a short array.
if ($tokens[$i]['code'] === T_OPEN_SHORT_ARRAY) {
$i = $tokens[$i]['bracket_closer'];
$lastLine = $tokens[$i]['line'];
continue;
}
if ($this->allowMultipleArguments === false && $tokens[$i]['code'] === T_COMMA) {
// Comma has to be the last token on the line.
$next = $phpcsFile->findNext(array(T_WHITESPACE, T_COMMENT), ($i + 1), $closeBracket, true);
if ($next !== false
&& $tokens[$i]['line'] === $tokens[$next]['line']
) {
$error = 'Only one argument is allowed per line in a multi-line function call';
$phpcsFile->addError($error, $next, 'MultipleArguments');
}
}
}//end for
if ($tokens[($openBracket + 1)]['content'] !== $phpcsFile->eolChar) {
$error = 'Opening parenthesis of a multi-line function call must be the last content on the line';
$phpcsFile->addError($error, $stackPtr, 'ContentAfterOpenBracket');
}
$prev = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBracket - 1), null, true);
if ($tokens[$prev]['line'] === $tokens[$closeBracket]['line']) {
$error = 'Closing parenthesis of a multi-line function call must be on a line by itself';
$phpcsFile->addError($error, $closeBracket, 'CloseBracketLine');
}
}//end processMultiLineCall()
}//end class
| {
"content_hash": "d30d514b4502d4edb9a9307ae4d2157d",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 112,
"avg_line_length": 39.88515406162465,
"alnum_prop": 0.5083222136385982,
"repo_name": "vimishor/eos-coding-standard",
"id": "3054be574c4c42d7231ec57d1bb08fc400cb7da8",
"size": "14725",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Sniffs/Functions/FunctionCallSignatureSniff.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "PHP",
"bytes": "22212"
}
],
"symlink_target": ""
} |
package rlVizLib.utilities;
import java.util.StringTokenizer;
/**
* @deprecated We're now goign to use task spec stuff from the RLGlue Java Codec.
* @author btanner
*/
public class TaskSpecObject {
public double version;
public char episodic;
public int obs_dim;
public int num_discrete_obs_dims;
public int num_continuous_obs_dims;
public char[] obs_types;
public double[] obs_mins;
public double[] obs_maxs;
public int action_dim;
public int num_discrete_action_dims;
public int num_continuous_action_dims;
public char[] action_types;
public double[] action_mins;
public double[] action_maxs;
public double reward_max;
public double reward_min;
static final int parser_version = 2;
//Test program
public static void main(String[] args) throws Exception {
String taskSpec = "2:e:2_[f,f]_[-1.2,0.6]_[-0.07,0.07]:1_[i]_[0,2]";
TaskSpecObject taskObject = new TaskSpecObject(taskSpec);
System.err.println(taskObject);
}
// Empty constructor is for environment building a task spec
public TaskSpecObject() {
}
//As we discussed, the TaskSpecObject should parse in its constructor
public TaskSpecObject(String taskSpecString) {
/* Break the task spec into its four component parts
* The version number
* The task style (episodic/continuous)
* The observation data
* The action data
*/
taskSpecString = this.removeWhiteSpace(taskSpecString);
StringTokenizer tokenizer = new StringTokenizer(taskSpecString, ":");
String versionString = tokenizer.nextToken();
String taskStyle = tokenizer.nextToken();
String observationString = tokenizer.nextToken();
String actionString = tokenizer.nextToken();
String rewardString;
version = Double.parseDouble(versionString);
// Task specs of version > 1 have reward info that needs to be parsed
if (version >= parser_version) {
if (tokenizer.hasMoreTokens()) {
rewardString = tokenizer.nextToken();
} else {
rewardString = "[]";
}
} else {
System.err.println("WARNING: task spec parser is version: " + parser_version + " Your task spec is: " + version);
System.err.println("Attempting to parse anyway!");
rewardString = "";
}
episodic = taskStyle.charAt(0);
// check to make sure this is a valid task type
if (episodic != 'e' && episodic != 'c') {
System.err.println("Invalid task type. Specify episodic (e) or continuous (c)");
System.exit(1);
}
try {
parseObservations(observationString);
parseActions(actionString);
if (version >= parser_version) {
parseRewards(rewardString);
}
constraintCheck();
} catch (Exception e) {
System.err.println("Error parsing the Task Spec");
System.err.println("Task Spec was: " + taskSpecString);
System.err.println("Exception was: " + e);
e.printStackTrace();
}
}
protected void parseObservationTypesAndDimensions(String obsTypesString) throws Exception {
// Discard the [ ] around the types string
obsTypesString = obsTypesString.substring(1, obsTypesString.length() - 1);
// Split up the observation types
StringTokenizer obsTypesTokenizer = new StringTokenizer(obsTypesString, ",");
/* Parse the data out of obsTypesString.
* Allocate and fill the obs_types array, and set the number
* of discrete and continuous observation dimensions.
*/
this.obs_types = new char[obsTypesTokenizer.countTokens()];
this.num_discrete_obs_dims = 0;
this.num_continuous_obs_dims = 0;
/* We get the observation type from the tokenizer,
* add it to the obs_types array, and update the discrete and continuous dimensions
*/
int currentObservationTypeIndex = 0;
while (obsTypesTokenizer.hasMoreTokens()) {
char obsType = obsTypesTokenizer.nextToken().charAt(0);
this.obs_types[currentObservationTypeIndex] = obsType;
switch (obsType) {
case 'i':
this.num_discrete_obs_dims += 1;
break;
case 'f':
this.num_continuous_obs_dims += 1;
break;
default:
throw new Exception("Unknown Observation Type: " + obsType);
}
currentObservationTypeIndex += 1;
}
}
protected void parseObservationRanges(StringTokenizer observationTokenizer) {
// Now we can allocate our obs mins and obs maxs arrays
this.obs_mins = new double[this.obs_types.length];
this.obs_maxs = new double[this.obs_types.length];
int currentRange = 0;
while (observationTokenizer.hasMoreTokens()) {
String observationRange = observationTokenizer.nextToken();
if (this.rangeKnown(observationRange)) {
//observationRange = observationRange.substring(1, observationRange.length() - 1);
StringTokenizer rangeTokenizer = new StringTokenizer(observationRange, ",");
this.obs_mins[currentRange] = this.validValue(rangeTokenizer.nextToken());
this.obs_maxs[currentRange] = this.validValue(rangeTokenizer.nextToken());
} else {
this.obs_mins[currentRange] = Double.NaN;
this.obs_maxs[currentRange] = Double.NaN;
}
currentRange += 1;
}
}
protected void parseActionTypesAndDimensions(String actionTypesString) throws Exception {
// Discard the [ ] around the types string
actionTypesString = actionTypesString.substring(1, actionTypesString.length() - 1);
// Split up the observation types
StringTokenizer actionTypesTokenizer = new StringTokenizer(actionTypesString, ",");
/* Parse the data out of obsTypesString.
* Allocate and fill the obs_types array, and set the number
* of discrete and continuous observation dimensions.
*/
this.action_types = new char[actionTypesTokenizer.countTokens()];
this.num_discrete_action_dims = 0;
this.num_continuous_action_dims = 0;
/* We get the observation type from the tokenizer,
* add it to the obs_types array, and update the discrete and continuous dimensions
*/
int currentActionTypeIndex = 0;
while (actionTypesTokenizer.hasMoreTokens()) {
char actionType = actionTypesTokenizer.nextToken().charAt(0);
this.action_types[currentActionTypeIndex] = actionType;
switch (actionType) {
case 'i':
this.num_discrete_action_dims += 1;
break;
case 'f':
this.num_continuous_action_dims += 1;
break;
default:
throw new Exception("Unknown Action Type: " + actionType);
}
currentActionTypeIndex += 1;
}
}
protected void parseActionRanges(StringTokenizer actionTokenizer) {
// Now we can allocate our obs mins and obs maxs arrays
this.action_mins = new double[this.action_types.length];
this.action_maxs = new double[this.action_types.length];
int currentRange = 0;
while (actionTokenizer.hasMoreTokens()) {
String actionRange = actionTokenizer.nextToken();
if (this.rangeKnown(actionRange)) {
//actionRange = actionRange.substring(1, actionRange.length() - 1);
StringTokenizer rangeTokenizer = new StringTokenizer(actionRange, ",");
this.action_mins[currentRange] = this.validValue(rangeTokenizer.nextToken());
//System.err.print(rangeTokenizer.nextToken() + "\n");
this.action_maxs[currentRange] = this.validValue(rangeTokenizer.nextToken());
} else {
this.action_mins[currentRange] = Double.NaN;
this.action_maxs[currentRange] = Double.NaN;
}
currentRange += 1;
}
}
protected void parseObservations(String observationString) throws Exception {
/* Break the observation into its three component parts
* The number of dimensions to the observation
* The types of the observation
* The ranges of the observations
*/
StringTokenizer observationTokenizer = new StringTokenizer(observationString, "_");
String obsDimensionString = observationTokenizer.nextToken();
String obsTypesString = observationTokenizer.nextToken();
this.obs_dim = Integer.parseInt(obsDimensionString);
parseObservationTypesAndDimensions(obsTypesString);
parseObservationRanges(observationTokenizer);
}
protected void parseActions(String actionString) throws Exception {
StringTokenizer actionTokenizer = new StringTokenizer(actionString, "_");
String actionDimensionString = actionTokenizer.nextToken();
String actionTypesString = actionTokenizer.nextToken();
this.action_dim = Integer.parseInt(actionDimensionString);
parseActionTypesAndDimensions(actionTypesString);
parseActionRanges(actionTokenizer);
}
protected void parseRewards(String rewardString) throws Exception {
//if both min and max rewards are defined
if (this.rangeKnown(rewardString)) {
//rewardString = rewardString.substring(1, rewardString.length()-1);
StringTokenizer rewardTokenizer = new StringTokenizer(rewardString, ",");
this.reward_min = this.validValue(rewardTokenizer.nextToken());
this.reward_max = this.validValue(rewardTokenizer.nextToken());
} else {
this.reward_min = Double.NaN;
this.reward_max = Double.NaN;
}
}
protected double validValue(String valueString) {
if (valueString.equalsIgnoreCase("[-inf")) {
return Double.NEGATIVE_INFINITY;
} else if (valueString.equalsIgnoreCase("inf]")) {
return Double.POSITIVE_INFINITY;
} else if (valueString.equals("[")) {
return Double.NaN;
} else if (valueString.equals("]")) {
return Double.NaN;
} else {
if (valueString.charAt(0) == '[') {
valueString = valueString.substring(1);
} else if (valueString.charAt(valueString.length() - 1) == ']') {
if (valueString.length() == 1) {
return Double.NaN;
}
valueString = valueString.substring(0, valueString.length() - 1);
}
return Double.parseDouble(valueString);
}
}
protected boolean rangeKnown(String valueRange) {
if (valueRange.equals("[,]")) {
return false;
} else if (valueRange.equals("[]")) {
return false;
} else {
return true;
}
}
protected String removeWhiteSpace(String input) {
StringTokenizer whiteTokens = new StringTokenizer(input, " ");
String output = whiteTokens.nextToken();
while (whiteTokens.hasMoreTokens()) {
output += whiteTokens.nextToken();
}
return output;
}
protected void constraintCheck() throws Exception {
for (int i = 0; i < this.obs_dim; i++) {
if (this.obs_mins[i] > this.obs_maxs[i]) {
throw new Exception("Observation min>max at index: " + i);
}
}
for (int i = 0; i < this.action_dim; i++) {
if (this.action_mins[i] > this.action_maxs[i]) {
throw new Exception("Action min>max at index: " + i);
}
}
if (this.reward_min > this.reward_max) {
throw new Exception("Reward min>max: " + this.reward_min);
}
}
//check if obs_min[index] is negative infinity
public boolean isObsMinNegInfinity(int index) {
return (this.obs_mins[index] == Double.NEGATIVE_INFINITY);
}
//check if action_min[index] is negative infinity
public boolean isActionMinNegInfinity(int index) {
return (this.action_mins[index] == Double.NEGATIVE_INFINITY);
}
//check if obs_max[index] is positive infinity
public boolean isObsMaxPosInfinity(int index) {
return (this.obs_maxs[index] == Double.POSITIVE_INFINITY);
}
//check if action_max[index] is positive infinity
public boolean isActionMaxPosInfinity(int index) {
return (this.action_maxs[index] == Double.POSITIVE_INFINITY);
}
//check if the value range for observation[index] is known
public boolean isObsMinUnknown(int index) {
return new Double(obs_mins[index]).isNaN();
}
public boolean isObsMaxUnknown(int index) {
return new Double(obs_maxs[index]).isNaN();
}
//check if the value range for action[index] is known
public boolean isActionMinUnknown(int index) {
return new Double(action_mins[index]).isNaN();
}
public boolean isActionMaxUnknown(int index) {
return new Double(action_maxs[index]).isNaN();
}
public boolean isMinRewardNegInf() {
return new Double(reward_min).isInfinite();
}
public boolean isMaxRewardInf() {
return new Double(reward_max).isInfinite();
}
public boolean isMinRewardUnknown() {
return new Double(reward_min).isNaN();
}
public boolean isMaxRewardUnknown() {
return new Double(reward_max).isNaN();
}
public String toString() {
String obs_types_string = "";
for (int i = 0; i < obs_types.length; ++i) {
obs_types_string += obs_types[i] + " ";
}
String obs_mins_string = "";
for (int i = 0; i < obs_mins.length; ++i) {
obs_mins_string += obs_mins[i] + " ";
}
String obs_maxs_string = "";
for (int i = 0; i < obs_maxs.length; ++i) {
obs_maxs_string += obs_maxs[i] + " ";
}
String action_types_string = "";
for (int i = 0; i < action_types.length; ++i) {
action_types_string += action_types[i] + " ";
}
String action_mins_string = "";
for (int i = 0; i < action_mins.length; ++i) {
action_mins_string += action_mins[i] + " ";
}
String action_maxs_string = "";
for (int i = 0; i < action_maxs.length; ++i) {
action_maxs_string += action_maxs[i] + " ";
}
String taskSpecObject = "version: " + version + "\n" +
"episodic: " + episodic + "\n" +
"obs_dim: " + obs_dim + "\n" +
"num_discrete_obs_dims: " + num_discrete_obs_dims + "\n" +
"num_continuous_obs_dims: " + num_continuous_obs_dims + "\n" +
"obs_types: " + obs_types_string + "\n" +
"obs_mins: " + obs_mins_string + "\n" +
"obs_maxs: " + obs_maxs_string + "\n" +
"action_dim: " + action_dim + "\n" +
"num_discrete_action_dims: " + num_discrete_action_dims + "\n" +
"num_continuous_action_dims: " + num_continuous_action_dims + "\n" +
"action_types: " + action_types_string + "\n" +
"action_mins: " + action_mins_string + "\n" +
"action_maxs: " + action_maxs_string + "\n" +
"reward_min: " + this.reward_min + "\n" +
"reward_max: " + this.reward_max;
return taskSpecObject;
}
}
| {
"content_hash": "91828a2a472a3f6eaeea7ccdfff99eb6",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 125,
"avg_line_length": 38.66585956416465,
"alnum_prop": 0.5910201014465527,
"repo_name": "Norbygyerek/rl-viz",
"id": "918a5c7d8a478acbea4f2ca207cd489e70402941",
"size": "15969",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "projects/rlVizLibJava/src/rlVizLib/utilities/TaskSpecObject.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "6037"
},
{
"name": "C++",
"bytes": "38903"
},
{
"name": "CSS",
"bytes": "3606"
},
{
"name": "HTML",
"bytes": "1153077"
},
{
"name": "Java",
"bytes": "610375"
},
{
"name": "Makefile",
"bytes": "21900"
},
{
"name": "Python",
"bytes": "1066"
},
{
"name": "Shell",
"bytes": "4298"
}
],
"symlink_target": ""
} |
class TInfoSinkBase;
class RestrictFragmentShaderTiming : TDependencyGraphTraverser {
public:
RestrictFragmentShaderTiming(TInfoSinkBase& sink);
void enforceRestrictions(const TDependencyGraph& graph);
int numErrors() const { return mNumErrors; }
virtual void visitArgument(TGraphArgument* parameter);
virtual void visitSelection(TGraphSelection* selection);
virtual void visitLoop(TGraphLoop* loop);
virtual void visitLogicalOp(TGraphLogicalOp* logicalOp);
private:
void beginError(const TIntermNode* node);
void validateUserDefinedFunctionCallUsage(const TDependencyGraph& graph);
bool isSamplingOp(const TIntermAggregate* intermFunctionCall) const;
TInfoSinkBase& mSink;
int mNumErrors;
typedef std::set<TString> StringSet;
StringSet mSamplingOps;
};
#endif // COMPILER_TIMING_RESTRICT_FRAGMENT_SHADER_TIMING_H_
| {
"content_hash": "685bc8bbd2c4a97350ff0df169535a11",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 77,
"avg_line_length": 33.76923076923077,
"alnum_prop": 0.7790432801822323,
"repo_name": "xin3liang/platform_external_chromium_org_third_party_angle",
"id": "e77d8c21cbc81428c2dc798c5aa14dac73941ac7",
"size": "1283",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/compiler/translator/timing/RestrictFragmentShaderTiming.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C",
"bytes": "543301"
},
{
"name": "C++",
"bytes": "4959179"
},
{
"name": "Objective-C",
"bytes": "5714"
},
{
"name": "Python",
"bytes": "24178"
},
{
"name": "Shell",
"bytes": "10467"
}
],
"symlink_target": ""
} |
define([
'./auth.controller',
'./logout-link.directive',
'angular-ui-router',
'@shared/alt-auth'
], function(authController, logoutLinkDirective) {
return {
init: function(module) {
/* @ngInject */
module.config(function($stateProvider) {
$stateProvider
.state('login', {
url: '/login',
templateUrl: 'highpine/components/auth/login.tpl.html',
controller: 'HpAuthController',
data: {
documentTitle: 'Sign in',
guestAccess: true
}
});
});
module.controller('HpAuthController', authController);
module.directive('logoutLink', logoutLinkDirective);
},
run: function(module, $injector) {
let Auth = $injector.get('Auth');
let $transitions = $injector.get('$transitions');
$transitions.onStart({}, transition => {
let toState = transition.to();
let guestAccessAllowed = toState.data && toState.data.guestAccess;
Auth.verify().then((res) => res, function() {
if (guestAccessAllowed) {
return;
}
transition.router.stateService.target('login');
});
});
}
};
}); | {
"content_hash": "a2bb24d749bf5595eb168e4268d06155",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 82,
"avg_line_length": 36.51219512195122,
"alnum_prop": 0.4562458249832999,
"repo_name": "highpine/highpine",
"id": "efce93e99c0dbd3a5c29631758a27df2e0e50e42",
"size": "1497",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/client/src/highpine/components/auth/setup.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "11784"
},
{
"name": "HTML",
"bytes": "23484"
},
{
"name": "JavaScript",
"bytes": "172599"
},
{
"name": "Shell",
"bytes": "459"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_27) on Fri Mar 01 17:38:33 CET 2013 -->
<TITLE>
ch.unifr.pai.mindmap.client.interaction.longclick Class Hierarchy
</TITLE>
<META NAME="date" CONTENT="2013-03-01">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ch.unifr.pai.mindmap.client.interaction.longclick Class Hierarchy";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../ch/unifr/pai/mindmap/client/components/websearch/package-tree.html"><B>PREV</B></A>
<A HREF="../../../../../../../ch/unifr/pai/mindmap/client/mindmap/package-tree.html"><B>NEXT</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?ch/unifr/pai/mindmap/client/interaction/longclick/package-tree.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
Hierarchy For Package ch.unifr.pai.mindmap.client.interaction.longclick
</H2>
</CENTER>
<DL>
<DT><B>Package Hierarchies:</B><DD><A HREF="../../../../../../../overview-tree.html">All Packages</A></DL>
<HR>
<H2>
Class Hierarchy
</H2>
<UL>
<LI TYPE="circle">java.lang.Object<UL>
<LI TYPE="circle">ch.unifr.pai.mindmap.client.interaction.longclick.<A HREF="../../../../../../../ch/unifr/pai/mindmap/client/interaction/longclick/LongClick.html" title="class in ch.unifr.pai.mindmap.client.interaction.longclick"><B>LongClick</B></A><LI TYPE="circle">ch.unifr.pai.mindmap.client.interaction.longclick.<A HREF="../../../../../../../ch/unifr/pai/mindmap/client/interaction/longclick/LongClick.LongClickInfo.html" title="class in ch.unifr.pai.mindmap.client.interaction.longclick"><B>LongClick.LongClickInfo</B></A><LI TYPE="circle">com.google.gwt.user.client.Timer<UL>
<LI TYPE="circle">ch.unifr.pai.mindmap.client.interaction.longclick.<A HREF="../../../../../../../ch/unifr/pai/mindmap/client/interaction/longclick/LongClick.LongClickTimer.html" title="class in ch.unifr.pai.mindmap.client.interaction.longclick"><B>LongClick.LongClickTimer</B></A></UL>
</UL>
</UL>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../ch/unifr/pai/mindmap/client/components/websearch/package-tree.html"><B>PREV</B></A>
<A HREF="../../../../../../../ch/unifr/pai/mindmap/client/mindmap/package-tree.html"><B>NEXT</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../../index.html?ch/unifr/pai/mindmap/client/interaction/longclick/package-tree.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>
| {
"content_hash": "d169c400e5909fad53ba60d539d87ce6",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 584,
"avg_line_length": 46.251612903225805,
"alnum_prop": 0.6205886455572605,
"repo_name": "olinux/twice",
"id": "7aa5fd9ebcc095eee37109b1119e6e8c42d289cf",
"size": "7169",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "MindMap/doc/ch/unifr/pai/mindmap/client/interaction/longclick/package-tree.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "47360"
},
{
"name": "Java",
"bytes": "649198"
},
{
"name": "Python",
"bytes": "251450"
},
{
"name": "Shell",
"bytes": "1938"
}
],
"symlink_target": ""
} |
<readable><title>3720366614_dfa8fe1088</title><content>
A small black dog is standing on two feet and wearing a pink tutu .
Small dog in costume stands on hind legs to reach dangling flowers .
The dog is jumping up beside a red wall .
The small brown and black down is wearing a pink tutu .
The small dog wearing a tutu stands on its hind legs .
</content></readable> | {
"content_hash": "cefa43d5bf1263b56b625d8dc4b09e2e",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 68,
"avg_line_length": 52.42857142857143,
"alnum_prop": 0.771117166212534,
"repo_name": "kevint2u/audio-collector",
"id": "107207febd7f66bba85f9040896b43e4a30e8a2b",
"size": "367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "captions/xml/3720366614_dfa8fe1088.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1015"
},
{
"name": "HTML",
"bytes": "18349"
},
{
"name": "JavaScript",
"bytes": "109819"
},
{
"name": "Python",
"bytes": "3260"
},
{
"name": "Shell",
"bytes": "4319"
}
],
"symlink_target": ""
} |
#include "config.hpp"
#include "init_resources.hpp"
#include "application.hpp"
#include "main_window.hpp"
#include <cppdevtk/gui/message_box.hpp>
#include <cppdevtk/base/cassert.hpp>
#include <cppdevtk/base/verify.h>
#include <cppdevtk/base/logger.hpp>
#include <cppdevtk/base/qiostream.hpp>
#include <cppdevtk/base/exception.hpp>
#include <cppdevtk/base/stdexcept.hpp>
#include <cppdevtk/base/info_tr.hpp>
#include <QtCore/QtDebug>
#include <QtCore/QString>
#include <QtCore/QDir>
#ifndef CPPDEVTK_SHARED
# include <QtCore/QtPlugin>
#endif
#include <QtGui/QIcon>
#include <QtCore/QtGlobal>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
# include <QtCore/Qt>
#endif
#include <cstdlib>
#ifndef CPPDEVTK_SHARED
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
Q_IMPORT_PLUGIN(QICOPlugin)
#else
Q_IMPORT_PLUGIN(qico)
#endif
#endif
#if (!CPPDEVTK_PLATFORM_ANDROID)
#define CPPDEVTK_COUT ::cppdevtk::base::qcout
#define CPPDEVTK_CERR ::cppdevtk::base::qcerr
#else
#define CPPDEVTK_COUT qDebug()
#define CPPDEVTK_CERR qCritical()
#endif
using ::cppdevtk::test_localization::Application;
using ::cppdevtk::gui::MessageBox;
using ::cppdevtk::base::qcerr;
using ::cppdevtk::base::Exception;
using ::std::exception;
#if (CPPDEVTK_PLATFORM_ANDROID)
__attribute__((visibility("default")))
#endif
int main(int argc, char* argv[]) try {
# if (CPPDEVTK_ENABLE_LOG_TO_FILE)
const bool kIsLogFileMsgHandlerInstalled = ::cppdevtk::base::InstallLogFileMsgHandler(::cppdevtk::base::GetLogFileName());
# endif
::cppdevtk::test_localization::InitResources();
CPPDEVTK_ASSERT(Application::quitOnLastWindowClosed());
Application::SetInfo(CPPDEVTK_COMPANY_SHORT_NAME_SANITIZED, CPPDEVTK_COMPANY_HOMEPAGE,
CPPDEVTK_SHORT_NAME_SANITIZED, CPPDEVTK_VERSION_STRING, CPPDEVTK_TEST_LOCALIZATION_SHORT_NAME_SANITIZED);
Application::SetQmInfo(":/cppdevtk/test_localization/res/tr", "tr_");
CPPDEVTK_ASSERT(Application::GetNumberOfSupportedLanguages() > 1);
# if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
Application::setAttribute(Qt::AA_EnableHighDpiScaling);
# endif
Application application(argc, argv);
Application::setWindowIcon(QIcon(":/cppdevtk/test_localization/res/ico/application.ico"));
# if (CPPDEVTK_ENABLE_LOG_TO_FILE)
if (kIsLogFileMsgHandlerInstalled) {
MessageBox::Information(application.GetDefaultWindow(), CPPDEVTK_TEST_LOCALIZATION_SHORT_NAME_TR,
QString("Log file: %1").arg(QDir::toNativeSeparators(::cppdevtk::base::GetLogFileName())));
}
else {
MessageBox::Critical(application.GetDefaultWindow(), CPPDEVTK_TEST_LOCALIZATION_SHORT_NAME_TR,
"InstallLogFileMsgHandler() failed");
}
# endif
# if (CPPDEVTK_ENABLE_QT_SOLUTIONS)
if (application.isRunning()) {
if (!application.sendMessage("", 5000)) {
MessageBox::Warning(application.GetDefaultWindow(),
Application::translate(CPPDEVTK_TEST_LOCALIZATION_TR_CTX, CPPDEVTK_TEST_LOCALIZATION_SHORT_NAME_TR),
Application::translate("main", "Another instance is running but it is not responding!"));
}
return EXIT_SUCCESS;
}
# endif
try {
::cppdevtk::test_localization::MainWindow mainWindow;
mainWindow.show();
return application.exec();
}
catch (const exception& exc) {
CPPDEVTK_LOG_ERROR("caught ::std::exception: " << Exception::GetDetailedInfo(exc));
MessageBox::Critical(application.GetDefaultWindow(),
Application::translate(CPPDEVTK_TEST_LOCALIZATION_TR_CTX, CPPDEVTK_TEST_LOCALIZATION_SHORT_NAME_TR),
Application::translate("main", "Caught exception: %1").arg(exc.what()), exc);
CPPDEVTK_ASSERT((dynamic_cast<const ::cppdevtk::base::LogicException*>(&exc) == NULL)
&& (dynamic_cast<const ::std::logic_error*>(&exc) == NULL));
return EXIT_FAILURE;
}
catch (...) {
CPPDEVTK_LOG_ERROR("caught unknown exception!");
MessageBox::Critical(application.GetDefaultWindow(),
Application::translate(CPPDEVTK_TEST_LOCALIZATION_TR_CTX, CPPDEVTK_TEST_LOCALIZATION_SHORT_NAME_TR),
Application::translate("main", "Caught unknown exception!"));
return EXIT_FAILURE;
}
}
catch (const exception& exc) {
const QString kErrMsg = QString("caught ::std::exception: %1\nDetails: %2").arg(
exc.what(), Exception::GetDetailedInfo(exc));
CPPDEVTK_LOG_ERROR(kErrMsg);
CPPDEVTK_CERR << "Error: " << kErrMsg << endl;
CPPDEVTK_ASSERT((dynamic_cast<const ::cppdevtk::base::LogicException*>(&exc) == NULL)
&& (dynamic_cast<const ::std::logic_error*>(&exc) == NULL));
return EXIT_FAILURE;
}
catch (...) {
const QString kErrMsg("caught unknown exception!!!");
CPPDEVTK_LOG_ERROR(kErrMsg);
CPPDEVTK_CERR << "Error: " << kErrMsg << endl;
return EXIT_FAILURE;
}
| {
"content_hash": "3eebdc0f77865f089ea0cf8a91f83c25",
"timestamp": "",
"source": "github",
"line_count": 146,
"max_line_length": 123,
"avg_line_length": 32.62328767123287,
"alnum_prop": 0.7062775561620828,
"repo_name": "CoSoSys/cppdevtk",
"id": "01b2148e78c7847b603e15e091aa9e037ef14e76",
"size": "5814",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/test_localization/main.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "1117"
},
{
"name": "C",
"bytes": "52984"
},
{
"name": "C++",
"bytes": "3219284"
},
{
"name": "Makefile",
"bytes": "2522"
},
{
"name": "Objective-C++",
"bytes": "7574"
},
{
"name": "QMake",
"bytes": "304258"
},
{
"name": "Shell",
"bytes": "799"
}
],
"symlink_target": ""
} |
package com.amazonaws.services.gamelift.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/CreateScript" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateScriptRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
* <p>
* Descriptive label that is associated with a script. Script names do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*/
private String name;
/**
* <p>
* Version that is associated with a build or script. Version strings do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*/
private String version;
/**
* <p>
* Location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the <code>ObjectVersion</code> parameter to specify an earlier version.
* </p>
*/
private S3Location storageLocation;
/**
* <p>
* Data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or
* multiple files. Maximum size of a zip file is 5 MB.
* </p>
* <p>
* When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be prepended
* with the string "fileb://" to indicate that the file data is a binary object. For example:
* <code>--zip-file fileb://myRealtimeScript.zip</code>.
* </p>
*/
private java.nio.ByteBuffer zipFile;
/**
* <p>
* Descriptive label that is associated with a script. Script names do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*
* @param name
* Descriptive label that is associated with a script. Script names do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
*/
public void setName(String name) {
this.name = name;
}
/**
* <p>
* Descriptive label that is associated with a script. Script names do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*
* @return Descriptive label that is associated with a script. Script names do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
*/
public String getName() {
return this.name;
}
/**
* <p>
* Descriptive label that is associated with a script. Script names do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*
* @param name
* Descriptive label that is associated with a script. Script names do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateScriptRequest withName(String name) {
setName(name);
return this;
}
/**
* <p>
* Version that is associated with a build or script. Version strings do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*
* @param version
* Version that is associated with a build or script. Version strings do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
*/
public void setVersion(String version) {
this.version = version;
}
/**
* <p>
* Version that is associated with a build or script. Version strings do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*
* @return Version that is associated with a build or script. Version strings do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
*/
public String getVersion() {
return this.version;
}
/**
* <p>
* Version that is associated with a build or script. Version strings do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* </p>
*
* @param version
* Version that is associated with a build or script. Version strings do not need to be unique. You can use
* <a>UpdateScript</a> to change this value later.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateScriptRequest withVersion(String version) {
setVersion(version);
return this;
}
/**
* <p>
* Location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the <code>ObjectVersion</code> parameter to specify an earlier version.
* </p>
*
* @param storageLocation
* Location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The
* storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN
* that allows Amazon GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same
* region where you want to create a new script. By default, Amazon GameLift uploads the latest version of
* the zip file; if you have S3 object versioning turned on, you can use the <code>ObjectVersion</code>
* parameter to specify an earlier version.
*/
public void setStorageLocation(S3Location storageLocation) {
this.storageLocation = storageLocation;
}
/**
* <p>
* Location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the <code>ObjectVersion</code> parameter to specify an earlier version.
* </p>
*
* @return Location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The
* storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN
* that allows Amazon GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same
* region where you want to create a new script. By default, Amazon GameLift uploads the latest version of
* the zip file; if you have S3 object versioning turned on, you can use the <code>ObjectVersion</code>
* parameter to specify an earlier version.
*/
public S3Location getStorageLocation() {
return this.storageLocation;
}
/**
* <p>
* Location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage
* location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon
* GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same region where you want to
* create a new script. By default, Amazon GameLift uploads the latest version of the zip file; if you have S3
* object versioning turned on, you can use the <code>ObjectVersion</code> parameter to specify an earlier version.
* </p>
*
* @param storageLocation
* Location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The
* storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN
* that allows Amazon GameLift to access the Amazon S3 storage location. The S3 bucket must be in the same
* region where you want to create a new script. By default, Amazon GameLift uploads the latest version of
* the zip file; if you have S3 object versioning turned on, you can use the <code>ObjectVersion</code>
* parameter to specify an earlier version.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateScriptRequest withStorageLocation(S3Location storageLocation) {
setStorageLocation(storageLocation);
return this;
}
/**
* <p>
* Data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or
* multiple files. Maximum size of a zip file is 5 MB.
* </p>
* <p>
* When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be prepended
* with the string "fileb://" to indicate that the file data is a binary object. For example:
* <code>--zip-file fileb://myRealtimeScript.zip</code>.
* </p>
* <p>
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
* </p>
* <p>
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
* </p>
*
* @param zipFile
* Data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or
* multiple files. Maximum size of a zip file is 5 MB.</p>
* <p>
* When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be
* prepended with the string "fileb://" to indicate that the file data is a binary object. For example:
* <code>--zip-file fileb://myRealtimeScript.zip</code>.
*/
public void setZipFile(java.nio.ByteBuffer zipFile) {
this.zipFile = zipFile;
}
/**
* <p>
* Data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or
* multiple files. Maximum size of a zip file is 5 MB.
* </p>
* <p>
* When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be prepended
* with the string "fileb://" to indicate that the file data is a binary object. For example:
* <code>--zip-file fileb://myRealtimeScript.zip</code>.
* </p>
* <p>
* {@code ByteBuffer}s are stateful. Calling their {@code get} methods changes their {@code position}. We recommend
* using {@link java.nio.ByteBuffer#asReadOnlyBuffer()} to create a read-only view of the buffer with an independent
* {@code position}, and calling {@code get} methods on this rather than directly on the returned {@code ByteBuffer}.
* Doing so will ensure that anyone else using the {@code ByteBuffer} will not be affected by changes to the
* {@code position}.
* </p>
*
* @return Data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or
* multiple files. Maximum size of a zip file is 5 MB.</p>
* <p>
* When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be
* prepended with the string "fileb://" to indicate that the file data is a binary object. For example:
* <code>--zip-file fileb://myRealtimeScript.zip</code>.
*/
public java.nio.ByteBuffer getZipFile() {
return this.zipFile;
}
/**
* <p>
* Data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or
* multiple files. Maximum size of a zip file is 5 MB.
* </p>
* <p>
* When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be prepended
* with the string "fileb://" to indicate that the file data is a binary object. For example:
* <code>--zip-file fileb://myRealtimeScript.zip</code>.
* </p>
* <p>
* The AWS SDK for Java performs a Base64 encoding on this field before sending this request to the AWS service.
* Users of the SDK should not perform Base64 encoding on this field.
* </p>
* <p>
* Warning: ByteBuffers returned by the SDK are mutable. Changes to the content or position of the byte buffer will
* be seen by all objects that have a reference to this object. It is recommended to call ByteBuffer.duplicate() or
* ByteBuffer.asReadOnlyBuffer() before using or reading from the buffer. This behavior will be changed in a future
* major version of the SDK.
* </p>
*
* @param zipFile
* Data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or
* multiple files. Maximum size of a zip file is 5 MB.</p>
* <p>
* When using the AWS CLI tool to create a script, this parameter is set to the zip file name. It must be
* prepended with the string "fileb://" to indicate that the file data is a binary object. For example:
* <code>--zip-file fileb://myRealtimeScript.zip</code>.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateScriptRequest withZipFile(java.nio.ByteBuffer zipFile) {
setZipFile(zipFile);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getVersion() != null)
sb.append("Version: ").append(getVersion()).append(",");
if (getStorageLocation() != null)
sb.append("StorageLocation: ").append(getStorageLocation()).append(",");
if (getZipFile() != null)
sb.append("ZipFile: ").append(getZipFile());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateScriptRequest == false)
return false;
CreateScriptRequest other = (CreateScriptRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getVersion() == null ^ this.getVersion() == null)
return false;
if (other.getVersion() != null && other.getVersion().equals(this.getVersion()) == false)
return false;
if (other.getStorageLocation() == null ^ this.getStorageLocation() == null)
return false;
if (other.getStorageLocation() != null && other.getStorageLocation().equals(this.getStorageLocation()) == false)
return false;
if (other.getZipFile() == null ^ this.getZipFile() == null)
return false;
if (other.getZipFile() != null && other.getZipFile().equals(this.getZipFile()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getVersion() == null) ? 0 : getVersion().hashCode());
hashCode = prime * hashCode + ((getStorageLocation() == null) ? 0 : getStorageLocation().hashCode());
hashCode = prime * hashCode + ((getZipFile() == null) ? 0 : getZipFile().hashCode());
return hashCode;
}
@Override
public CreateScriptRequest clone() {
return (CreateScriptRequest) super.clone();
}
}
| {
"content_hash": "a7d8b1e664eac23a5565c86b71de1392",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 121,
"avg_line_length": 46.36553524804177,
"alnum_prop": 0.6478770131771596,
"repo_name": "jentfoo/aws-sdk-java",
"id": "03fd3445e0a1a9940fa2968e8b9da41a37451550",
"size": "18338",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-gamelift/src/main/java/com/amazonaws/services/gamelift/model/CreateScriptRequest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "270"
},
{
"name": "FreeMarker",
"bytes": "173637"
},
{
"name": "Gherkin",
"bytes": "25063"
},
{
"name": "Java",
"bytes": "356214839"
},
{
"name": "Scilab",
"bytes": "3924"
},
{
"name": "Shell",
"bytes": "295"
}
],
"symlink_target": ""
} |
@implementation SIRSI
- (BOOL) update
{
[browser go: catalogueURL];
// Logout first
//
// * Usually this isn't needed.
// * Need it for us.pa.BucksCountyLibraryNetwork start from Oct 2011.
// The newer systems could be keeping users logged in
if ([browser clickLink: @"Logout"])
{
[Debug logError: @"Logged out"];
[browser go: catalogueURL];
}
// Find the account page link. There a many potential link names so
// try them all until one matches
if ([browser clickFirstLink: [self accountLinkLabels]] == NO)
{
[Debug logError: @"Can't find account page link"];
return NO;
}
// Find the link to the checkouts page
if ([browser clickFirstLink: [self reviewLinkLabels]] == NO)
{
[Debug logError: @"Can't find review checkouts page link"];
return NO;
}
// The Yarra Plenty Regional Library implementation has two forms on the page.
// The main form is named "accessform" and the secondary one in the
// navigation bar is called "loginform"
if ([browser submitFormNamed: @"accessform" entries: self.authenticationAttributes] == NO
&& [browser submitFormNamed: @"AUTO" entries: self.authenticationAttributes] == NO)
{
[Debug logError: @"Failed to login"];
return NO;
}
[self authenticationOK];
// [browser go: [Test fileURLFor: @"SIRSI/20100309_fairfax_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20090621_main_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20100829_los_angeles_county_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20100821_santa_monica_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20101127_tln_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20110115_niles_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20110129_montgomery_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20110403_northvancouver_loans.html"]];
// [browser go: [Test fileURLFor: @"SIRSI/20110827_montgomery_loans.html"]];
[self parse];
return YES;
}
- (void) parse
{
[self parseLoans1];
if (loansCount == 0) [self parseLoans2];
if (loansCount == 0) [self parseLoans3];
if (loansCount == 0) [self parseLoans4];
[self parseHolds1];
if (holdsCount == 0) [self parseHolds4];
if (holdsCount == 0) [self parseHolds5];
}
- (void) parseLoans1
{
[Debug log: @"Parsing loans (format 1)"];
NSScanner *scanner = browser.scanner;
HTMLElement *element;
[scanner scanPassHead];
if ( [scanner scanNextElementWithName: @"form" attributeKey: @"id" attributeValue: @"renewitems" intoElement: &element]
|| [scanner scanNextElementWithName: @"form" attributeKey: @"name" attributeValue: @"renewitems" intoElement: &element])
{
NSArray *columns = [element.scanner analyseLoanTableColumns];
if (loansTableColumns) columns = loansTableColumns;
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: nil delegate: self];
[self addLoans: rows];
}
}
- (void) parseLoans2
{
[Debug log: @"Parsing loans (format 2)"];
NSScanner *scanner = browser.scanner;
HTMLElement *element;
[scanner scanPassHead];
if ( [scanner scanPassElementWithName: @"a" attributeKey: @"name" attributeValue: @"charges"]
&& [scanner scanNextElementWithName: @"table" intoElement: &element])
{
NSArray *columns = [NSArray arrayWithObjects: @"title", @"author", @"dueDate", nil];
if (loansTableColumns) columns = loansTableColumns;
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: nil delegate: self];
[self addLoans: rows];
}
}
// -----------------------------------------------------------------------------
//
// Secondary loans parsing.
//
// * Used by Niles Public Library District (us.il.NilesPublicLibraryDistrict)
//
// -----------------------------------------------------------------------------
- (void) parseLoans3
{
[Debug log: @"Parsing loans (format 3)"];
NSScanner *scanner = browser.scanner;
HTMLElement *element;
[scanner scanPassHead];
if ([scanner scanPassElementWithName: @"a" attributeKey: @"name" attributeValue: @"charges"]
&& [scanner scanNextElementWithName: @"table" intoElement: &element])
{
NSArray *columns = [element.scanner analyseLoanTableColumns];
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: nil delegate: self];
[self addLoans: rows];
}
}
// -----------------------------------------------------------------------------
//
// Secondary loans parsing.
//
// * Used by Santa Cruz
//
// -----------------------------------------------------------------------------
- (void) parseLoans4
{
[Debug log: @"Parsing loans (format 4)"];
NSScanner *scanner = browser.scanner;
HTMLElement *element;
[scanner scanPassHead];
// * "Description" is used by Santa Cruz library for the title/author
scannerSettings.loanColumnsDictionary = [OrderedDictionary dictionaryWithObjectsAndKeys:
@"titleAndAuthor", @"Description",
nil
];
if ( [scanner scanPassString: @"Items checked out"]
&& [scanner scanNextElementWithName: @"table" intoElement: &element])
{
NSArray *columns = [element.scanner analyseLoanTableColumns];
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: nil delegate: self];
[self addLoans: rows];
}
}
- (void) parseHolds1
{
[Debug log: @"Parsing holds (format 1)"];
NSScanner *scanner = browser.scanner;
HTMLElement *element;
[scanner scanPassHead];
// Holds (ready for pickup)
if ( [scanner scanPassElementWithName: @"a" attributeKey: @"name" attributeValue: @"avail_holds"]
&& [scanner scanNextElementWithName: @"table" intoElement: &element])
{
NSArray *columns = [element.scanner analyseHoldTableColumns];
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: nil delegate: self];
[self addHoldsReadyForPickup: rows];
}
// * The "Availability" column means queue position for the outstanding holds
// * "Queue Position" is used by Calgary library
scannerSettings.holdColumnsDictionary = [OrderedDictionary dictionaryWithObjectsAndKeys:
@"queuePosition", @"Availability",
@"queuePosition", @"Queue Position",
nil
];
// Holds (just outstanding or combined holds list)
if ( [scanner scanPassElementWithName: @"a" attributeKey: @"name" attributeValue: @"holds"]
&& [scanner scanNextElementWithName: @"table" intoElement: &element])
{
NSArray *columns = [element.scanner analyseHoldTableColumns];
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: nil delegate: self];
[self addHolds: rows];
}
}
// -----------------------------------------------------------------------------
//
// Matching holds parsing for parseLoans4.
//
// -----------------------------------------------------------------------------
- (void) parseHolds4
{
[Debug log: @"Parsing holds (format 4)"];
NSScanner *scanner = browser.scanner;
HTMLElement *element;
[scanner scanPassHead];
scannerSettings.holdColumnsDictionary = [OrderedDictionary dictionaryWithObjectsAndKeys:
@"titleAndAuthor", @"Description",
@"queueDescription", @"Request List Information",
nil
];
if ( [scanner scanPassString: @"Titles on request"]
&& [scanner scanNextElementWithName: @"table" intoElement: &element])
{
NSArray *columns = [element.scanner analyseHoldTableColumns];
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: nil delegate: self];
[self addHolds: rows];
}
}
// -----------------------------------------------------------------------------
//
// Based on format in CLEVNET.
//
// * Column called Available that has "Y" when ready and empty otherwise.
//
// -----------------------------------------------------------------------------
- (void) parseHolds5
{
[Debug log: @"Parsing holds (format 5)"];
NSScanner *scanner = browser.scanner;
HTMLElement *element;
[scanner scanPassHead];
scannerSettings.holdColumnsDictionary = [OrderedDictionary dictionaryWithObjectsAndKeys:
@"queuePosition", @"Position in Queue",
@"readyForPickup", @"Available",
nil
];
// Holds (just outstanding or combined holds list)
if ( [scanner scanPassElementWithName: @"a" attributeKey: @"name" attributeValue: @"requests"]
&& [scanner scanNextElementWithName: @"table" intoElement: &element])
{
NSArray *columns = [element.scanner analyseHoldTableColumns];
NSArray *rows = [element.scanner tableWithColumns: columns ignoreRows: [NSArray arrayWithObject: @"Position in Queue"] delegate: self];
[self addHolds: rows];
}
}
// -----------------------------------------------------------------------------
//
// The various account link labels.
//
// -----------------------------------------------------------------------------
- (NSArray *) accountLinkLabels
{
return [NSArray arrayWithObjects:
@"My Account",
@"Your Account",
@"My Library Card",
@"my.account",
@"My Library Record", // au.nsw.MooreCollegeLibrary
@"RBUSERV.gif",
@"Account Info/Renew", // us.md.AnneArundelCountyPublicLibrary
nil
];
}
// -----------------------------------------------------------------------------
//
// THe various review my account link labels.
//
// -----------------------------------------------------------------------------
- (NSArray *) reviewLinkLabels
{
return [NSArray arrayWithObjects:
@"User Status Inquiry",
@"Review My Account",
@"Review Your Account",
@"Review My Card",
@"Review Checkouts",
@"Renew materials/manage holds",
@"Checkouts",
@"ACCOUNT SUMMARY",
@"SUMMARY (holds, bills)", // ca.bc.NorthVancouverCityLibrary
@"View My Record", // au.nsw.MooreCollegeLibrary
@"Review/Renew", // us.ct.CONNECT
@"Renew materials", // us.ca.CountyOfLosAngelesPublicLibrary
nil
];
}
// -----------------------------------------------------------------------------
//
// The account page URL.
//
// -----------------------------------------------------------------------------
- (URL *) myAccountURL
{
[browser go: myAccountCatalogueURL];
if ([browser clickFirstLink: [self accountLinkLabels]] == NO)
{
[Debug logError: @"Can't find account page link"];
return nil;
}
if ([browser clickFirstLink: [self reviewLinkLabels]] == NO)
{
[Debug logError: @"Can't find review account page link"];
return nil;
}
return [browser linkToSubmitFormNamed: @"accessform" entries: self.authenticationAttributes];
}
@end | {
"content_hash": "21bebf236d7f1ef3c41f65a7e0df9f7c",
"timestamp": "",
"source": "github",
"line_count": 322,
"max_line_length": 138,
"avg_line_length": 31.928571428571427,
"alnum_prop": 0.6304834160101157,
"repo_name": "8-P/librarybooksapp",
"id": "74f8b639e9efa801181e587296e921bffd63b014",
"size": "10607",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "shared/opac/SIRSI.m",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "1326151"
},
{
"name": "C++",
"bytes": "51726"
},
{
"name": "HTML",
"bytes": "43092"
},
{
"name": "Objective-C",
"bytes": "1115460"
},
{
"name": "Perl",
"bytes": "1597"
}
],
"symlink_target": ""
} |
<?xml version="1.0"?>
<!DOCTYPE import-control PUBLIC "-//Puppy Crawl//DTD Import Control 1.0//EN"
"http://www.puppycrawl.com/dtds/import_control_1_0.dtd">
<!--
vim:filetype=xml:ts=4
-->
<!--
Copyright (c) 2006, 2007
Conor McDermottroe. 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. Neither the name of the author nor the names of any contributors to
the software may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDERS 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.
-->
<import-control pkg="com.mcdermottroe.exemplar">
<!-- Blanket allows for everything -->
<allow pkg="java.io" />
<allow pkg="java.lang" />
<allow pkg="java.text" />
<allow pkg="java.util" />
<!-- Specific allowed Java classes -->
<allow class="java.net.URL" />
<!-- Specific allowed Exemplar classes -->
<allow class="com.mcdermottroe.exemplar.Constants" />
<allow class="com.mcdermottroe.exemplar.CopyException" />
<allow class="com.mcdermottroe.exemplar.Copyable" />
<allow class="com.mcdermottroe.exemplar.DBC" />
<allow class="com.mcdermottroe.exemplar.Exception" />
<allow class="com.mcdermottroe.exemplar.Utils" />
<allow class="com.mcdermottroe.exemplar.model.XMLDocumentType" />
<allow class="com.mcdermottroe.exemplar.ui.Log" />
<allow class="com.mcdermottroe.exemplar.ui.Message" />
<allow class="com.mcdermottroe.exemplar.ui.Options" />
<allow pkg="com.mcdermottroe.exemplar.utils" />
<allow pkg="com.mcdermottroe.exemplar.Constants" />
<!-- Per-subpackage rules -->
<subpackage name="generated">
<subpackage name="schema">
<allow pkg="org.xml.sax" />
<allow pkg="com.mcdermottroe.exemplar.generated.schema.support" />
</subpackage>
</subpackage>
<subpackage name="input">
<subpackage name="schema">
<allow class="org.xml.sax.SAXException" />
<allow pkg="com.mcdermottroe.exemplar.generated.schema" />
<allow pkg="com.mcdermottroe.exemplar.input" />
<allow pkg="com.mcdermottroe.exemplar.input.schema.type" />
<allow pkg="com.mcdermottroe.exemplar.model" />
</subpackage>
</subpackage>
<subpackage name="output">
<allow class="com.mcdermottroe.exemplar.output.OutputException" />
<allow class="com.mcdermottroe.exemplar.output.OutputUtils" />
<allow class="com.mcdermottroe.exemplar.output.XMLParserGeneratorException" />
<allow class="com.mcdermottroe.exemplar.output.XMLParserSourceGenerator" />
<allow pkg="com.mcdermottroe.exemplar.model" />
<subpackage name="java">
<allow class="com.mcdermottroe.exemplar.output.XMLParserGenerator" />
<allow class="com.mcdermottroe.exemplar.output.java.XMLJavaSourceGenerator" />
</subpackage>
</subpackage>
<subpackage name="ui">
<allow pkg="com.mcdermottroe.exemplar.ui.options" />
<allow class="com.mcdermottroe.exemplar.Exception" />
<allow class="com.mcdermottroe.exemplar.input.InputException" />
<allow class="com.mcdermottroe.exemplar.input.InputUtils" />
<allow class="com.mcdermottroe.exemplar.input.ParserException" />
<allow class="com.mcdermottroe.exemplar.output.OutputException" />
<allow class="com.mcdermottroe.exemplar.output.OutputUtils" />
<allow class="com.mcdermottroe.exemplar.ui.MessageException" />
<subpackage name="ant">
<allow pkg="org.apache.tools.ant" />
</subpackage>
<subpackage name="cli">
<allow class="com.mcdermottroe.exemplar.ui.LogLevel" />
</subpackage>
</subpackage>
<subpackage name="utils">
<allow class="java.math.BigInteger" />
<allow class="java.net.MalformedURLException" />
</subpackage>
</import-control>
| {
"content_hash": "f8cd5f8f2a9bfa3d2283e1b162c9291f",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 81,
"avg_line_length": 44.9622641509434,
"alnum_prop": 0.7454888795635753,
"repo_name": "conormcd/exemplar",
"id": "e1c1e14fc1a2102e558601acfdbc6ab80f971f65",
"size": "4766",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/checkstyle/import-control.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "1609415"
},
{
"name": "JavaScript",
"bytes": "89405"
},
{
"name": "Perl",
"bytes": "2756"
},
{
"name": "Shell",
"bytes": "27104"
}
],
"symlink_target": ""
} |
set -euo pipefail
SOURCE_DIR=$1
NEW_CHECKSUM=$(./falco -c ${SOURCE_DIR}/falco.yaml --list -N | sha256sum | awk '{print $1}')
CUR_CHECKSUM=$(grep FALCO_FIELDS_CHECKSUM "${SOURCE_DIR}/userspace/engine/falco_engine_version.h" | awk '{print $3}' | sed -e 's/"//g')
if [ "$NEW_CHECKSUM" != "$CUR_CHECKSUM" ]; then
echo "Set of fields supported has changed (new checksum $NEW_CHECKSUM != old checksum $CUR_CHECKSUM)."
echo "Update checksum and/or version in falco_engine_version.h."
exit 1
fi
exit 0
| {
"content_hash": "20e40570a7ed4a239d8e1f96e05c356e",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 135,
"avg_line_length": 36.42857142857143,
"alnum_prop": 0.6725490196078432,
"repo_name": "draios/falco",
"id": "4d7d27fb7cad2547d2ab8615695ba06aeb2d3a56",
"size": "527",
"binary": false,
"copies": "1",
"ref": "refs/heads/refactor/rule-loader",
"path": "userspace/falco/verify_engine_fields.sh",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "1350"
},
{
"name": "C++",
"bytes": "104874"
},
{
"name": "CMake",
"bytes": "26165"
},
{
"name": "Dockerfile",
"bytes": "8043"
},
{
"name": "Go",
"bytes": "2317"
},
{
"name": "HTML",
"bytes": "3610"
},
{
"name": "Lua",
"bytes": "46226"
},
{
"name": "Makefile",
"bytes": "1135"
},
{
"name": "Puppet",
"bytes": "2044"
},
{
"name": "Python",
"bytes": "36986"
},
{
"name": "R",
"bytes": "3792"
},
{
"name": "Ruby",
"bytes": "1069"
},
{
"name": "Shell",
"bytes": "36296"
}
],
"symlink_target": ""
} |
public class PokemonCard extends Card{
public String pokemon_type;
private int stage;
private int hp;
private String evolves_from_pokemon;
private String[] listAttack = new String[2];
public PokemonCard(String card_name, String card_type,
int collector_card_number,String pokemon_type,int hp){
super(card_name, card_type, collector_card_number);
this.card_type=card_type;
this.pokemon_type=pokemon_type;
this.hp=hp;
}
public String toString() {
return ("name:"+this.card_name+" type:"+this.card_type+" energy:"+this.pokemon_type+
" collector_number:" + this.collector_card_number+" description:"+this.getDescription());
}
}
| {
"content_hash": "f13879fda3358215fba89b026d6d61ee",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 93,
"avg_line_length": 30,
"alnum_prop": 0.7212121212121212,
"repo_name": "corann95/Pokedeck",
"id": "ad6f2a78d5f046d6098e20b0b15a537435637ed9",
"size": "662",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Pokedeck/src/PokemonCard.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "15086"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
International Plant Names Index
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "b8e8d4a88a23c0d53d13a712195adda9",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 31,
"avg_line_length": 9.692307692307692,
"alnum_prop": 0.7063492063492064,
"repo_name": "mdoering/backbone",
"id": "5357be979f04218afe7d67dc57f707279c8370ff",
"size": "182",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Lamiales/Lamiaceae/Satureja/Satureja punctata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
require_once('./config/accesscontrol.php');
require_once('./utilities.php');
// Set up/check session and get database password etc.
require_once('./config/MySQL.php');
session_start();
sessionAuthenticate();
$mysql = mysql_connect($mysql_host, $mysql_user, $mysql_password);
if (!mysql_select_db($mysql_database))
showerror();
check_location(27, $mysql);
?>
<html>
<head>
<title>52 Weeks of Primeval</title>
<link rel="stylesheet" href="./styles/default.css" type="text/css">
</head>
<body>
<?php
print_header($mysql);
$phase = get_user_phase($mysql);
?>
<div class=main>
<?php
print_standard_start($mysql);
?>
<div class=location>
<img src=assets/location27.png>
<h2>A Freshwater Lake</h2>
<p>You in the middle of a freshwater lake in which giant fish are swimming. You can see huge trees lining the shores of the lake. The air is warm and humid.</p>
<?php
$action_done = get_value_from_users("action_done", $mysql);
if (!$action_done) {
print "<p><b>You will need a boat otherwise you will be swept out of the anomaly again!</b></p>";
}
?>
</div>
</body>
</html> | {
"content_hash": "4485c2374e8f7aace11fcf212766c187",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 162,
"avg_line_length": 22.645833333333332,
"alnum_prop": 0.6899724011039559,
"repo_name": "louiseadennis/primeval_game",
"id": "f0ec9afc671913704b98ae6c65760c25dc7e74fc",
"size": "1087",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "www/location27.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1210"
},
{
"name": "PHP",
"bytes": "163799"
}
],
"symlink_target": ""
} |
require 'sequel'
DB = Sequel.connect('sqlite://application.db')
# make a new table for posts
DB.run('CREATE TABLE posts(id INTEGER PRIMARY KEY AUTOINCREMENT, time TEXT,name TEXT(10), msg TEXT(140))') | {
"content_hash": "7ffab8cd9ca25cdbfc8a62d0a6b91a31",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 106,
"avg_line_length": 40,
"alnum_prop": 0.745,
"repo_name": "AlexTalker/lite-twitter",
"id": "65b52e3311bec54343f6798055e3033ffdebe231",
"size": "200",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "install.rb",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Ruby",
"bytes": "2363"
}
],
"symlink_target": ""
} |
// TypeScript Version: 2.0
/// <reference types="@stdlib/types"/>
import { Shape, Order, typedndarray, float64ndarray, float32ndarray, int32ndarray, int16ndarray, int8ndarray, uint32ndarray, uint16ndarray, uint8ndarray, uint8cndarray, complex128ndarray, complex64ndarray, DataType } from '@stdlib/types/ndarray';
/**
* Interface describing function options.
*/
interface Options {
/**
* Array order (either 'row-major' (C-style) or 'column-major' (Fortran-style)).
*
* ## Notes
*
* - If provided, this option overrides the input array's inferred order.
*/
order?: Order;
}
/**
* Interface describing function options.
*/
interface Float64Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'float64';
}
/**
* Interface describing function options.
*/
interface Float32Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'float32';
}
/**
* Interface describing function options.
*/
interface Complex128Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'complex128';
}
/**
* Interface describing function options.
*/
interface Complex64Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'complex64';
}
/**
* Interface describing function options.
*/
interface Int32Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'int32';
}
/**
* Interface describing function options.
*/
interface Int16Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'int16';
}
/**
* Interface describing function options.
*/
interface Int8Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'int8';
}
/**
* Interface describing function options.
*/
interface Uint32Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'uint32';
}
/**
* Interface describing function options.
*/
interface Uint16Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'uint16';
}
/**
* Interface describing function options.
*/
interface Uint8Options extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'uint8';
}
/**
* Interface describing function options.
*/
interface Uint8COptions extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: 'uint8c';
}
/**
* Interface describing function options.
*/
interface OptionsWithDType extends Options {
/**
* Underlying data type.
*
* ## Notes
*
* - This option overrides the input array's inferred data type.
*/
dtype: DataType;
}
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': float64'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'float64'
*/
declare function zeros( shape: Shape | number, options: Float64Options ): float64ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': float32'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'float32'
*/
declare function zeros( shape: Shape | number, options: Float32Options ): float32ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': complex128'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'complex128'
*/
declare function zeros( shape: Shape | number, options: Complex128Options ): complex128ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': complex64'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'complex64'
*/
declare function zeros( shape: Shape | number, options: Complex64Options ): complex64ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': int32'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'int32'
*/
declare function zeros( shape: Shape | number, options: Int32Options ): int32ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': int16'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'int16'
*/
declare function zeros( shape: Shape | number, options: Int16Options ): int16ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': int8'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'int8'
*/
declare function zeros( shape: Shape | number, options: Int8Options ): int8ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': uint32'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'uint32'
*/
declare function zeros( shape: Shape | number, options: Uint32Options ): uint32ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': uint16'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'uint16'
*/
declare function zeros( shape: Shape | number, options: Uint16Options ): uint16ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': uint8'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'uint8'
*/
declare function zeros( shape: Shape | number, options: Uint8Options ): uint8ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ], {
* 'dtype': uint8c'
* });
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'uint8c'
*/
declare function zeros( shape: Shape | number, options: Uint8COptions ): uint8cndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type (default: 'float64')
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ] );
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'float64'
*/
declare function zeros( shape: Shape | number, options?: Options ): float64ndarray; // tslint:disable-line:max-line-length
/**
* Creates a zero-filled array having a specified shape and data type.
*
* @param shape - array shape
* @param options - options
* @param options.dtype - underlying data type (default: 'float64')
* @param options.order - specifies whether an array is row-major (C-style) or column-major (Fortran-style) (default: 'row-major')
* @returns zero-filled array
*
* @example
* var arr = zeros( [ 2, 2 ] );
* // returns <ndarray>
*
* var sh = arr.shape;
* // returns [ 2, 2 ]
*
* var dt = arr.dtype;
* // returns 'float64'
*/
declare function zeros( shape: Shape | number, options?: OptionsWithDType ): typedndarray<number>; // tslint:disable-line:max-line-length unified-signatures
// EXPORTS //
export = zeros;
| {
"content_hash": "e355df1600002071ecc622a7180eb496",
"timestamp": "",
"source": "github",
"line_count": 489,
"max_line_length": 246,
"avg_line_length": 24.43353783231084,
"alnum_prop": 0.673167057248075,
"repo_name": "stdlib-js/stdlib",
"id": "2c220e90ff52c03ccf12d9c71f655656e199e43a",
"size": "12563",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "lib/node_modules/@stdlib/ndarray/zeros/docs/types/index.d.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Awk",
"bytes": "21739"
},
{
"name": "C",
"bytes": "15336495"
},
{
"name": "C++",
"bytes": "1349482"
},
{
"name": "CSS",
"bytes": "58039"
},
{
"name": "Fortran",
"bytes": "198059"
},
{
"name": "HTML",
"bytes": "56181"
},
{
"name": "Handlebars",
"bytes": "16114"
},
{
"name": "JavaScript",
"bytes": "85975525"
},
{
"name": "Julia",
"bytes": "1508654"
},
{
"name": "Makefile",
"bytes": "4806816"
},
{
"name": "Python",
"bytes": "3343697"
},
{
"name": "R",
"bytes": "576612"
},
{
"name": "Shell",
"bytes": "559315"
},
{
"name": "TypeScript",
"bytes": "19309407"
},
{
"name": "WebAssembly",
"bytes": "5980"
}
],
"symlink_target": ""
} |
<?php
namespace AerialShip\SamlSPBundle\Bridge;
use AerialShip\LightSaml\Binding\BindingDetector;
use Symfony\Component\HttpFoundation\Request;
class BindingManager extends BindingDetector
{
/**
* @param Request $request
* @return null|string
*/
public function getBindingType(Request $request)
{
$bindingRequest = $this->getBindingRequest($request);
$bindingType = $this->getBinding($bindingRequest);
return $bindingType;
}
/**
* @param Request $request
* @param $bindingType
* @return \AerialShip\LightSaml\Model\Protocol\Message|null
*/
public function receive(Request $request, &$bindingType = null)
{
$result = null;
$bindingRequest = $this->getBindingRequest($request);
$bindingType = $this->getBinding($bindingRequest);
if ($bindingType) {
$binding = $this->instantiate($bindingType);
$result = $binding->receive($bindingRequest);
}
return $result;
}
/**
* @param Request $request
* @return \AerialShip\LightSaml\Binding\Request
*/
public function getBindingRequest(Request $request)
{
$result = new \AerialShip\LightSaml\Binding\Request();
// must be taken unmodified from server since getQueryString() capitalized urlenocoded escape chars, ie. %2f becomes %2F
$result->setQueryString($request->server->get('QUERY_STRING'));
$result->setGet($request->query->all());
$result->setPost($request->request->all());
$result->setRequestMethod($request->getMethod());
return $result;
}
}
| {
"content_hash": "3560b5ca3371894f1bbfa8127a5667ca",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 128,
"avg_line_length": 30.48148148148148,
"alnum_prop": 0.6391251518833536,
"repo_name": "rlustin/SamlSPBundle",
"id": "966436a5857961b392afb9a77e70cf22acdae74c",
"size": "1646",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "src/AerialShip/SamlSPBundle/Bridge/BindingManager.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "513"
},
{
"name": "PHP",
"bytes": "230433"
},
{
"name": "Shell",
"bytes": "1246"
}
],
"symlink_target": ""
} |
<div class="desktop-layout" data-options="dxLayout : { name: 'desktop', platform: 'generic' } " >
<div class="page">
<div class="wrapper">
<header>
<div class="logo" />
</header>
</div>
<div class="main-menu dx-desktop-layout-main-menu">
<div class="wrapper">
<nav id="navBar" data-bind="dxNavBar: {}" data-options="dxCommandContainer : { id: 'global-navigation', contentCssPosition: 'static' }" ></nav>
</div>
</div>
<div class="toolbar dx-desktop-layout-toolbar">
<div class="wrapper" data-options="dxContentPlaceholder : { name: 'header', contentCssPosition: 'static' } " >
<div data-bind="dxToolbar: { items: [{ text: title, location: 'before', template: 'titleTemplate' }] }"
data-options="dxCommandContainer : { id: 'desktop-toolbar' }"
>
<div data-options="dxTemplate:{name:'titleTemplate'}">
<h2 data-bind="text: text"></h2>
</div>
</div>
</div>
</div>
<div class="wrapper">
<div class="content-wrapper">
<div class="content" data-options="dxContentPlaceholder : { name: 'content', contentCssPosition: 'static' } " ></div>
</div>
<div class="footer-gap"></div>
</div>
<footer>
<div class="wrapper copyright dx-desktop-layout-copyright">2015 © Copyright Text</div>
</footer>
</div>
</div>
| {
"content_hash": "f0014b32c7847acc2cf6c1d613d02ae5",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 159,
"avg_line_length": 45.91428571428571,
"alnum_prop": 0.5164903546981954,
"repo_name": "AliakseiFutryn/asp-dotnet-core-samples",
"id": "eb61753d8fa34c23fc113d7a1731a44ed4a720c2",
"size": "1609",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "FinancialAnalyst/FinancialAnalyst.Core/wwwroot/lib/old/devextreme/layouts/Desktop/DesktopLayout.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "195487"
},
{
"name": "CSS",
"bytes": "6963329"
},
{
"name": "HTML",
"bytes": "72454"
},
{
"name": "JavaScript",
"bytes": "25938613"
},
{
"name": "PowerShell",
"bytes": "471"
},
{
"name": "Ruby",
"bytes": "1030"
},
{
"name": "Shell",
"bytes": "4053"
}
],
"symlink_target": ""
} |
namespace syncer {
class SyncData;
}
namespace sync_pb {
class AppSpecifics;
class ExtensionSpecifics;
}
namespace extensions {
class Extension;
// A class that encapsulates the synced properties of an App or Extension.
// Corresponds to an ExtensionSpecifics or an AppSpecifics proto (note that an
// AppSpecifics itself includes an ExtensionSpecifics).
class ExtensionSyncData {
public:
struct LinkedAppIconInfo {
LinkedAppIconInfo();
~LinkedAppIconInfo();
GURL url;
int size;
};
// Extension constructor.
ExtensionSyncData(const Extension& extension,
bool enabled,
int disable_reasons,
bool incognito_enabled,
bool remote_install);
// App constructor.
ExtensionSyncData(const Extension& extension,
bool enabled,
int disable_reasons,
bool incognito_enabled,
bool remote_install,
const syncer::StringOrdinal& app_launch_ordinal,
const syncer::StringOrdinal& page_ordinal,
extensions::LaunchType launch_type);
ExtensionSyncData(const ExtensionSyncData& other);
~ExtensionSyncData();
// For constructing an ExtensionSyncData from received sync data.
// May return null if the sync data was invalid.
static std::unique_ptr<ExtensionSyncData> CreateFromSyncData(
const syncer::SyncData& sync_data);
static std::unique_ptr<ExtensionSyncData> CreateFromSyncChange(
const syncer::SyncChange& sync_change);
// Retrieve sync data from this class.
syncer::SyncData GetSyncData() const;
syncer::SyncChange GetSyncChange(
syncer::SyncChange::SyncChangeType change_type) const;
bool is_app() const { return is_app_; }
const std::string& id() const { return id_; }
// Version-independent properties (i.e., used even when the version of the
// currently-installed extension doesn't match |version|).
bool uninstalled() const { return uninstalled_; }
bool enabled() const { return enabled_; }
void set_enabled(bool enabled) { enabled_ = enabled; }
bool supports_disable_reasons() const { return supports_disable_reasons_; }
int disable_reasons() const { return disable_reasons_; }
bool incognito_enabled() const { return incognito_enabled_; }
bool remote_install() const { return remote_install_; }
// Version-dependent properties (i.e., should be used only when the
// version of the currently-installed extension matches |version|).
const base::Version& version() const { return version_; }
void set_version(const base::Version& version) { version_ = version; }
const GURL& update_url() const { return update_url_; }
// Used only for debugging.
const std::string& name() const { return name_; }
// Everything below is App-specific - only set for Apps, not Extensions.
// These ordinals aren't necessarily valid. Some applications don't have
// valid ordinals because they don't appear on the new tab page.
const syncer::StringOrdinal& app_launch_ordinal() const {
return app_launch_ordinal_;
}
const syncer::StringOrdinal& page_ordinal() const { return page_ordinal_; }
extensions::LaunchType launch_type() const { return launch_type_; }
const std::string& bookmark_app_url() const { return bookmark_app_url_; }
const std::string& bookmark_app_description() const {
return bookmark_app_description_;
}
const std::string& bookmark_app_scope() const { return bookmark_app_scope_; }
const std::string& bookmark_app_icon_color() const {
return bookmark_app_icon_color_;
}
base::Optional<SkColor> bookmark_app_theme_color() const {
return bookmark_app_theme_color_;
}
const std::vector<LinkedAppIconInfo>& linked_icons() const {
return linked_icons_;
}
private:
FRIEND_TEST_ALL_PREFIXES(ExtensionSyncDataTest,
ExtensionSyncDataForExtension);
ExtensionSyncData();
// Populate this class from sync inputs. Return true if the input was valid.
bool PopulateFromSyncData(const syncer::SyncData& sync_data);
bool PopulateFromExtensionSpecifics(
const sync_pb::ExtensionSpecifics& specifics);
bool PopulateFromAppSpecifics(const sync_pb::AppSpecifics& specifics);
// Convert an ExtensionSyncData back out to a sync ExtensionSpecifics.
void ToExtensionSpecifics(sync_pb::ExtensionSpecifics* specifics) const;
// Convert an ExtensionSyncData back out to a sync AppSpecifics.
void ToAppSpecifics(sync_pb::AppSpecifics* specifics) const;
bool is_app_;
std::string id_;
bool uninstalled_;
bool enabled_;
// |supports_disable_reasons_| is true if the optional |disable_reasons_| was
// set to some value in the extension_specifics.proto. If not,
// |disable_reasons_| is given a default value and |supports_disable_reasons_|
// is false.
bool supports_disable_reasons_;
int disable_reasons_;
bool incognito_enabled_;
bool remote_install_;
base::Version version_;
GURL update_url_;
std::string name_;
// App-specific fields.
syncer::StringOrdinal app_launch_ordinal_;
syncer::StringOrdinal page_ordinal_;
extensions::LaunchType launch_type_;
std::string bookmark_app_url_;
std::string bookmark_app_description_;
std::string bookmark_app_scope_;
std::string bookmark_app_icon_color_;
base::Optional<SkColor> bookmark_app_theme_color_;
std::vector<LinkedAppIconInfo> linked_icons_;
};
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_
| {
"content_hash": "93ee1f8d5eb9d7edc98362a2553444a9",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 80,
"avg_line_length": 36.453947368421055,
"alnum_prop": 0.7036635986284064,
"repo_name": "endlessm/chromium-browser",
"id": "a07ce491aea6c2f694d8077875ae55b258309085",
"size": "6162",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "chrome/browser/extensions/extension_sync_data.h",
"mode": "33188",
"license": "bsd-3-clause",
"language": [],
"symlink_target": ""
} |
/**
* Created by praveen on 17.09.15.
* Handles review add operations
*/
angular.module('UserApp').controller('ReviewListCtrl', function ($scope, config, $http, $location, $routeParams) {
$scope.ready = 0;
$scope.courseid = $routeParams.id;
$scope.params = {
stars : [1, 2, 3, 4, 5],
getClass: function(ind, val){
var index = parseInt(ind);
var value = parseInt(val);
if(index > value)
return 'fa-star-o';
switch (value){
case 1:
return 'fa-star star-1';
case 2:
return 'fa-star star-2';
case 3:
return 'fa-star star-3';
case 4:
return 'fa-star star-4';
case 5:
return 'fa-star star-5';
}
},
getHint: function(val){
var value = parseInt(val);
switch (value){
case 1:
return 'Very hard';
case 2:
return 'Hard';
case 3:
return 'Moderate';
case 4:
return 'Easy';
case 5:
return 'Very easy';
}
}
};
// Build a review list request
var req = {
method: 'GET',
url: config.apiUrl + '/review/search?'
+ 'courseid=' + $scope.courseid
};
// Send it
$http(req)
.then(
function(response){ // Success callback
$data = response.data;
$scope.reviews = $data.reviews;
$scope.ready = 1;
},
function(response){ //Error callback
console.log(response);
}
);
$scope.user = {
getProfile : function(emailhash){
return 'https://secure.gravatar.com/' + emailhash;
},
getImage : function(emailhash){
return 'https://secure.gravatar.com/avatar/' + emailhash + '?d=mm';
}
};
}); | {
"content_hash": "58e9c6c3125e6d308d0bf82d4d1b751c",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 114,
"avg_line_length": 26.76923076923077,
"alnum_prop": 0.43582375478927204,
"repo_name": "praveendath92/coursestats",
"id": "49fd93f9fa4461ea2fb7a8a5855e29cd4cebf25b",
"size": "2088",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/user/js/reviewlist.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "4783"
},
{
"name": "HTML",
"bytes": "45335"
},
{
"name": "JavaScript",
"bytes": "51871"
},
{
"name": "PHP",
"bytes": "32070"
},
{
"name": "Python",
"bytes": "4046"
},
{
"name": "Shell",
"bytes": "198"
}
],
"symlink_target": ""
} |
<?php
/**
* OAuth setup model
*
* @category Mage
* @package Mage_Oauth
* @author Magento Core Team <core@magentocommerce.com>
*/
class Mage_Oauth_Model_Resource_Setup extends Mage_Core_Model_Resource_Setup
{
}
| {
"content_hash": "9b48905029d9447843cbded5a72e460c",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 76,
"avg_line_length": 17.692307692307693,
"alnum_prop": 0.6695652173913044,
"repo_name": "tagalpha/library",
"id": "2c7fb6fcd35338ffb346112a783497b8448563e7",
"size": "1182",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "app/code/core/Mage/Oauth/Model/Resource/Setup.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "20063"
},
{
"name": "ApacheConf",
"bytes": "8117"
},
{
"name": "Batchfile",
"bytes": "1036"
},
{
"name": "CSS",
"bytes": "1805855"
},
{
"name": "HTML",
"bytes": "5531269"
},
{
"name": "JavaScript",
"bytes": "1295882"
},
{
"name": "PHP",
"bytes": "45317581"
},
{
"name": "PowerShell",
"bytes": "1028"
},
{
"name": "Ruby",
"bytes": "288"
},
{
"name": "Shell",
"bytes": "19717"
},
{
"name": "XSLT",
"bytes": "2066"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Login Page - Photon Admin Panel Theme</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<link rel="shortcut icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/favicon.ico"/>
<link rel="apple-touch-icon" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/iosicon.png"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/css/css_compiled/photon-min.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/css/css_compiled/photon-min-part2.css?v1.1" media="all"/>
<link rel="stylesheet" href="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/css/css_compiled/photon-responsive-min.css?v1.1" media="all"/>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie-only-min.css?v1.1" />
<![endif]-->
<!--[if lt IE 9]>
<link rel="stylesheet" type="text/css" href="css/css_compiled/ie8-only-min.css?v1.1" />
<script type="text/javascript" src="js/plugins/excanvas.js"></script>
<script type="text/javascript" src="js/plugins/html5shiv.js"></script>
<script type="text/javascript" src="js/plugins/respond.min.js"></script>
<script type="text/javascript" src="js/plugins/fixFontIcons.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/bootstrap/bootstrap.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/modernizr.custom.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.pnotify.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/less-1.3.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/xbreadcrumbs.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.maskedinput-1.3.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.autotab-1.1b.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/charCount.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.textareaCounter.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/elrte.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/elrte.en.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/select2.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery-picklist.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.validate.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/additional-methods.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.form.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.metadata.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.mockjax.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.uniform.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.tagsinput.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.rating.pack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/farbtastic.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.timeentry.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.jstree.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/dataTables.bootstrap.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.mCustomScrollbar.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.stack.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.pie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.flot.resize.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/raphael.2.1.0.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/justgage.1.0.1.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.qrcode.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.clock.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.countdown.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.jqtweet.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/jquery.cookie.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/bootstrap-fileupload.min.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/prettify/prettify.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/bootstrapSwitch.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/plugins/mfupload.js"></script>
<script type="text/javascript" src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/js/common.js"></script>
</head>
<body class="body-login">
<div class="nav-fixed-topright" style="visibility: hidden">
<ul class="nav nav-user-menu">
<li class="user-sub-menu-container">
<a href="javascript:;">
<i class="user-icon"></i><span class="nav-user-selection">Theme Options</span><i class="icon-menu-arrow"></i>
</a>
<ul class="nav user-sub-menu">
<li class="light">
<a href="javascript:;">
<i class='icon-photon stop'></i>Light Version
</a>
</li>
<li class="dark">
<a href="javascript:;">
<i class='icon-photon stop'></i>Dark Version
</a>
</li>
</ul>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon mail"></i>
</a>
</li>
<li>
<a href="javascript:;">
<i class="icon-photon comment_alt2_stroke"></i>
<div class="notification-count">12</div>
</a>
</li>
</ul>
</div>
<script>
$(function(){
setTimeout(function(){
$('.nav-fixed-topright').removeAttr('style');
}, 300);
$(window).scroll(function(){
if($('.breadcrumb-container').length){
var scrollState = $(window).scrollTop();
if (scrollState > 0) $('.nav-fixed-topright').addClass('nav-released');
else $('.nav-fixed-topright').removeClass('nav-released')
}
});
$('.user-sub-menu-container').on('click', function(){
$(this).toggleClass('active-user-menu');
});
$('.user-sub-menu .light').on('click', function(){
if ($('body').is('.light-version')) return;
$('body').addClass('light-version');
setTimeout(function() {
$.cookie('themeColor', 'light', {
expires: 7,
path: '/'
});
}, 500);
});
$('.user-sub-menu .dark').on('click', function(){
if ($('body').is('.light-version')) {
$('body').removeClass('light-version');
$.cookie('themeColor', 'dark', {
expires: 7,
path: '/'
});
}
});
});
</script>
<div class="container-login">
<div class="form-centering-wrapper">
<div class="form-window-login">
<div class="form-window-login-logo">
<div class="login-logo">
<img src="http://photonui.orangehilldev.com/css/css_compiled/@%7BphotonImagePath%7Dplugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/images/photon/login-logo@2x.png" alt="Photon UI"/>
</div>
<h2 class="login-title">Welcome to Photon UI!</h2>
<div class="login-member">Not a Member? <a href="charCount.js.html#">Sign Up »</a>
<a href="charCount.js.html#" class="btn btn-facebook"><i class="icon-fb"></i>Login with Facebook<i class="icon-fb-arrow"></i></a>
</div>
<div class="login-or">Or</div>
<div class="login-input-area">
<form method="POST" action="dashboard.php">
<span class="help-block">Login With Your Photon Account</span>
<input type="text" name="email" placeholder="Email">
<input type="password" name="password" placeholder="Password">
<button type="submit" class="btn btn-large btn-success btn-login">Login</button>
</form>
<a href="charCount.js.html#" class="forgot-pass">Forgot Your Password?</a>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1936460-27']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
| {
"content_hash": "b0b9eea5a4ac0583844558877879fc2f",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 246,
"avg_line_length": 88.6043956043956,
"alnum_prop": 0.7471784695522758,
"repo_name": "user-tony/photon-rails",
"id": "bb1df624431decb8c8c22e406c8f77c9a970fe85",
"size": "16126",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/assets/css/css_compiled/@{photonImagePath}plugins/elrte/css/css_compiled/js/plugins/prettify/js/plugins/prettify/js/plugins/charCount.js.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "291750913"
},
{
"name": "JavaScript",
"bytes": "59305"
},
{
"name": "Ruby",
"bytes": "203"
},
{
"name": "Shell",
"bytes": "99"
}
],
"symlink_target": ""
} |
layout: page
title: Aeon Chemical Award Ceremony
date: 2016-05-24
author: Lisa Jackson
tags: weekly links, java
status: published
summary: Pellentesque mi lectus, rhoncus id enim nec, sodales laoreet.
banner: images/banner/leisure-03.jpg
booking:
startDate: 10/25/2018
endDate: 10/26/2018
ctyhocn: PWMDTHX
groupCode: ACAC
published: true
---
Duis faucibus ex sed consequat ultricies. Praesent mollis metus libero. Fusce faucibus nisi vel nibh commodo fermentum. Sed a odio vel nunc ornare gravida. Praesent condimentum vestibulum felis. Nunc fermentum massa at odio bibendum, quis vehicula libero scelerisque. Nunc iaculis arcu vel orci faucibus varius. Praesent rutrum tincidunt magna, sed fermentum est maximus eget. Pellentesque quis arcu dui. Nulla sapien mauris, imperdiet vel vulputate id, mollis vel libero. Cras quam felis, ornare nec ligula sed, tincidunt convallis enim. Maecenas tempor efficitur lorem, eu dapibus velit. Cras feugiat, mi ut fermentum aliquam, metus orci sodales risus, id luctus magna neque a lacus.
Nunc imperdiet sem non elit aliquam, a eleifend magna feugiat. Nunc nec dui egestas, porttitor nibh eu, lobortis arcu. Duis ut ex urna. In hac habitasse platea dictumst. Vivamus semper tellus purus, vel finibus odio porta in. Aliquam pulvinar accumsan pellentesque. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
1 Vivamus in nisl sed nisi pretium sagittis
1 In tempor nibh sit amet nisl tincidunt, eu dapibus lectus finibus
1 Proin in ipsum non tortor auctor molestie ac id risus
1 Fusce a diam ultricies, iaculis quam ac, pellentesque ligula
1 Sed cursus neque quis rhoncus convallis.
Morbi lectus nibh, tincidunt eu egestas vitae, luctus quis metus. Sed at ante pharetra, viverra purus eget, tincidunt ante. Integer vehicula lectus vel molestie imperdiet. Maecenas porttitor lorem sit amet nisi molestie iaculis. Vivamus nisl mi, iaculis id magna sit amet, elementum mollis metus. Integer rhoncus, tortor nec accumsan ullamcorper, tellus leo egestas enim, et posuere dolor nibh et tellus. Mauris pretium sapien eu venenatis dapibus. Nullam facilisis sem nec porttitor dignissim. Morbi dignissim turpis ut ligula tempus, pretium posuere justo pretium. Nam eu molestie orci. Aliquam gravida maximus ante, ac ultrices odio consectetur non. Nunc vel luctus dui. Nam id lorem massa.
| {
"content_hash": "f5aa13e1272bf3419f92002f00db041d",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 693,
"avg_line_length": 94.32,
"alnum_prop": 0.8087362171331637,
"repo_name": "KlishGroup/prose-pogs",
"id": "56b772f77df65cd832479cd0955fb1b986465927",
"size": "2362",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "pogs/P/PWMDTHX/ACAC/index.md",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package com.example.msf.msf.Presenters.Outcomes.Types;
import com.example.msf.msf.API.Auth;
import com.example.msf.msf.API.Interface;
import com.example.msf.msf.API.Models.Outcome;
import com.example.msf.msf.API.Models.OutcomeType;
import com.example.msf.msf.LoginActivity;
import java.util.List;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;
/**
* Created by Thandile on 2016/11/05.
*/
public class OutcomeInteractor implements Callback<List<OutcomeType>> {
private OnOutcomesInteractorFinishedListener listener;
public OutcomeInteractor(OnOutcomesInteractorFinishedListener listener) {
this.listener = listener;
}
public void loadRecentOutcomes(){
Interface communicatorInterface = Auth.getInterface(LoginActivity.username, LoginActivity.password);
communicatorInterface.getOutcomeTypes(this);
}
@Override
public void success(List<OutcomeType> outcomes, Response response) {
listener.onNetworkSuccess(outcomes, response);
}
@Override
public void failure(RetrofitError error) {
listener.onNetworkFailure(error);
}
}
| {
"content_hash": "9a5725d9f9f6d978a8200be74c175444",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 108,
"avg_line_length": 28.21951219512195,
"alnum_prop": 0.7579948141745895,
"repo_name": "thandile/msf_communique",
"id": "582dce823e13db209c9c6f35999548f20c465a36",
"size": "1157",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/example/msf/msf/Presenters/Outcomes/Types/OutcomeInteractor.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "839311"
}
],
"symlink_target": ""
} |
/* Plugin based off of Tokenizing Autocomplete by James Smith (http://loopj.com) */
(function ($) {
// Default settings
var DEFAULT_SETTINGS = {
// Search settings
method: "GET",
contentType: "json",
queryParam: "value",
searchDelay: 300,
minChars: 1,
propertyToSearch: "name",
jsonContainer: null,
// Display settings
hintText: "Type in a search term",
noResultsText: "No results",
searchingText: "Searching...",
deleteText: "×",
animateDropdown: true,
// Tokenization settings
tokenLimit: null,
tokenDelimiter: ",",
preventDuplicates: false,
// Output settings
tokenValue: "id",
// Prepopulation settings
prePopulate: null,
processPrePopulate: false,
// Manipulation settings
idPrefix: "token-input-",
// Formatters
resultsFormatter: function(item){ return "<li>" + item[this.propertyToSearch]+ "</li>" },
tokenFormatter: function(item) { return "<li><p>" + item[this.propertyToSearch] + "</p></li>" },
// Callbacks
onResult: null,
onAdd: null,
onDelete: null,
onReady: null
};
// Default classes to use when theming
var DEFAULT_CLASSES = {
tokenList: "token-input-list",
tokenListFocus: "token-input-list-focus",
token: "token-input-token",
tokenDelete: "token-input-delete-token",
selectedToken: "token-input-selected-token",
highlightedToken: "token-input-highlighted-token",
dropdown: "token-input-dropdown",
dropdownItem: "token-input-dropdown-item",
dropdownItem2: "token-input-dropdown-item2",
selectedDropdownItem: "token-input-selected-dropdown-item",
inputToken: "token-input-input-token"
};
// Input box position "enum"
var POSITION = {
BEFORE: 0,
AFTER: 1,
END: 2
};
// Keys "enum"
var KEY = {
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
ESCAPE: 27,
SPACE: 32,
PAGE_UP: 33,
PAGE_DOWN: 34,
END: 35,
HOME: 36,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
NUMPAD_ENTER: 108,
COMMA: 188,
SEMICOLON: 186,
SEMICOLONFIREFOX: 59
};
// Additional public (exposed) methods
var methods = {
init: function(url_or_data_or_function, options) {
var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
return this.each(function () {
$(this).data("tokenInputObject", new $.TokenList(this, url_or_data_or_function, settings));
});
},
clear: function() {
this.data("tokenInputObject").clear();
return this;
},
add: function(item) {
this.data("tokenInputObject").add(item);
return this;
},
remove: function(item) {
this.data("tokenInputObject").remove(item);
return this;
},
get: function() {
return this.data("tokenInputObject").getTokens();
}
}
// Expose the .tokenInput function to jQuery as a plugin
$.fn.tokenInput = function (method) {
// Method calling and initialization logic
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else {
return methods.init.apply(this, arguments);
}
};
// TokenList class for each input
$.TokenList = function (input, url_or_data, settings) {
//
// Initialization
//
isReadOnly = ($(input).attr("readonly")) ? true : false;
// Configure the data source
if ($.type(url_or_data) === "string" || $.type(url_or_data) === "function") {
// Set the url to query against
settings.url = url_or_data;
// If the URL is a function, evaluate it here to do our initalization work
var url = computeURL();
// Make a smart guess about cross-domain if it wasn't explicitly specified
if (settings.crossDomain === undefined) {
if (url.indexOf("://") === -1) {
settings.crossDomain = false;
} else {
settings.crossDomain = (location.href.split(/\/+/g)[1] !== url.split(/\/+/g)[1]);
}
}
} else if (typeof(url_or_data) === "object") {
// Set the local data to search through
settings.local_data = url_or_data;
}
// Build class names
if (settings.classes) {
// Use custom class names
settings.classes = $.extend({}, DEFAULT_CLASSES, settings.classes);
} else if (settings.theme) {
// Use theme-suffixed default class names
settings.classes = {};
$.each(DEFAULT_CLASSES, function(key, value) {
settings.classes[key] = value + "-" + settings.theme;
});
} else {
settings.classes = DEFAULT_CLASSES;
}
// Save the tokens
var saved_tokens = [];
// Keep track of the number of tokens in the list
var token_count = 0;
// Basic cache to save on db hits
var cache = new $.TokenList.Cache();
// Keep track of the timeout, old vals
var timeout;
var input_val;
// Create a new text input an attach keyup events
var input_box = $("<input type=\"text\" autocomplete=\"off\">")
.css({
outline: "none"
})
.attr("id", settings.idPrefix + input.id)
.attr("placeholder", input.placeholder)
.focus(function () {
if (settings.tokenLimit === null || settings.tokenLimit !== token_count) {
if (!isReadOnly) {
show_dropdown_hint();
}
}
})
.blur(function () {
hide_dropdown();
$(this).closest('ul').removeClass(settings.classes.tokenListFocus);
var val = $(this).val().replace(/^,|,$/g,'').replace(/^;|;$/g,'');
if (val) {
var item = {
'id': val,
'name': val
};
add_token(item);
hidden_input.change();
}
$(this).val("");
})
.bind("keyup keydown blur update", resize_input)
.keydown(function (event) {
var previous_token;
var next_token;
switch(event.keyCode) {
case KEY.LEFT:
case KEY.RIGHT:
case KEY.UP:
case KEY.DOWN:
if (!$(this).val()) {
previous_token = input_token.prev();
next_token = input_token.next();
if ((previous_token.length && previous_token.get(0) === selected_token) || (next_token.length && next_token.get(0) === selected_token)) {
// Check if there is a previous/next token and it is selected
if (event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) {
deselect_token($(selected_token), POSITION.BEFORE);
} else {
deselect_token($(selected_token), POSITION.AFTER);
}
} else if ((event.keyCode === KEY.LEFT || event.keyCode === KEY.UP) && previous_token.length) {
// We are moving left, select the previous token if it exists
select_token($(previous_token.get(0)));
} else if ((event.keyCode === KEY.RIGHT || event.keyCode === KEY.DOWN) && next_token.length) {
// We are moving right, select the next token if it exists
select_token($(next_token.get(0)));
}
} else {
var dropdown_item = null;
if (event.keyCode === KEY.DOWN || event.keyCode === KEY.RIGHT) {
dropdown_item = $(selected_dropdown_item).next();
} else {
dropdown_item = $(selected_dropdown_item).prev();
}
if (dropdown_item.length) {
select_dropdown_item(dropdown_item);
}
return false;
}
break;
case KEY.BACKSPACE:
previous_token = input_token.prev();
if (!$(this).val().length) {
if (selected_token) {
delete_token($(selected_token));
hidden_input.change();
} else if (previous_token.length) {
select_token($(previous_token.get(0)));
}
return false;
} else if ($(this).val().length === 1) {
hide_dropdown();
} else {
// set a timeout just long enough to let this function finish.
setTimeout(function(){do_search();}, 5);
}
break;
case KEY.TAB:
case KEY.ENTER:
case KEY.NUMPAD_ENTER:
case KEY.COMMA:
case KEY.SEMICOLON:
case KEY.SEMICOLONFIREFOX:
if (selected_dropdown_item && $(selected_dropdown_item).data("tokeninput") !== undefined) {
add_token($(selected_dropdown_item).data("tokeninput"));
hidden_input.change();
return false;
} else if (event.keyCode === KEY.ENTER
|| event.keyCode === KEY.COMMA
|| event.keyCode === KEY.SEMICOLON
|| event.keyCode === KEY.SEMICOLONFIREFOX)
{
var val = $(this).val().replace(/^,|,$/g,'').replace(/^;|;$/g,'');
if (val) {
var item = {
'id': val,
'name': val
};
add_token(item);
hidden_input.change();
return false;
}
return false;
}
break;
case KEY.ESCAPE:
hide_dropdown();
return true;
default:
if (String.fromCharCode(event.which)) {
// set a timeout just long enough to let this function finish.
setTimeout(function(){do_search();}, 5);
}
break;
}
});
if (isReadOnly) {
input_box.attr("disabled", "disabled");
}
// Keep a reference to the original input box
var hidden_input = $(input)
.hide()
.val("")
.focus(function () {
input_box.focus();
})
.blur(function () {
input_box.blur();
});
// Keep a reference to the selected token and dropdown item
var selected_token = null;
var selected_token_index = 0;
var selected_dropdown_item = null;
// The list to store the token items in
var token_list = $("<ul />")
.addClass(settings.classes.tokenList)
.click(function (event) {
$(this).addClass(settings.classes.tokenListFocus);
var li = $(event.target).closest("li");
if (li && li.get(0) && $.data(li.get(0), "tokeninput")) {
toggle_select_token(li);
} else {
// Deselect selected token
if (selected_token) {
deselect_token($(selected_token), POSITION.END);
}
// Focus input box
input_box.focus();
}
})
.mouseover(function (event) {
var li = $(event.target).closest("li");
if (li && selected_token !== this) {
li.addClass(settings.classes.highlightedToken);
}
})
.mouseout(function (event) {
var li = $(event.target).closest("li");
if (li && selected_token !== this) {
li.removeClass(settings.classes.highlightedToken);
}
})
.insertBefore(hidden_input);
// The token holding the input box
var input_token = $("<li />")
.addClass(settings.classes.inputToken)
.appendTo(token_list)
.append(input_box);
// The list to store the dropdown items in
var dropdown = $("<div>")
.addClass(settings.classes.dropdown)
.css('width', (token_list.outerWidth(true)-2))
.appendTo("body")
.hide();
// Magic element to help us resize the text input
var input_resizer = $("<tester/>")
.insertAfter(input_box)
.css({
position: "absolute",
top: -9999,
left: -9999,
width: "auto",
fontSize: input_box.css("fontSize"),
fontFamily: input_box.css("fontFamily"),
fontWeight: input_box.css("fontWeight"),
letterSpacing: input_box.css("letterSpacing"),
whiteSpace: "nowrap"
});
// Pre-populate list if items exist
hidden_input.val("");
var li_data = settings.prePopulate || hidden_input.data("pre");
if (settings.processPrePopulate && $.isFunction(settings.onResult)) {
li_data = settings.onResult.call(hidden_input, li_data);
}
if (li_data && li_data.length) {
$.each(li_data, function (index, value) {
insert_token(value);
checkTokenLimit();
});
}
// Initialization is done
if ($.isFunction(settings.onReady)) {
settings.onReady.call();
}
//
// Public functions
//
this.clear = function() {
token_list.children("li").each(function() {
if ($(this).children("input").length === 0) {
delete_token($(this));
}
});
}
this.add = function(item) {
add_token(item);
}
this.remove = function(item) {
token_list.children("li").each(function() {
if ($(this).children("input").length === 0) {
var currToken = $(this).data("tokeninput");
var match = true;
for (var prop in item) {
if (item[prop] !== currToken[prop]) {
match = false;
break;
}
}
if (match) {
delete_token($(this));
}
}
});
}
this.getTokens = function() {
return saved_tokens;
}
//
// Private functions
//
function checkTokenLimit() {
if (settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
input_box.hide();
hide_dropdown();
return;
}
}
function resize_input() {
if (input_val === (input_val = input_box.val())) {return;}
// Enter new content into resizer and resize input accordingly
var escaped = input_val.replace(/&/g, '&').replace(/\s/g,' ').replace(/</g, '<').replace(/>/g, '>');
input_resizer.html(escaped);
//input_box.width(input_resizer.width() + 30);
//$(input_box.parent()).width(input_resizer.width() + 30);
}
function is_printable_character(keycode) {
return ((keycode >= 48 && keycode <= 90) // 0-1a-z
|| (keycode >= 96 && keycode <= 111) // numpad 0-9 + - / * .
|| (keycode >= 186 && keycode <= 192) // ; = , - . / ^
|| (keycode >= 219 && keycode <= 222)); // ( \ ) '
}
// Inner function to a token to the list
function insert_token(item) {
var this_token = settings.tokenFormatter(item);
this_token = $(this_token)
.addClass(settings.classes.token);
for (var key in item)
{
this_token.attr('data-' + key, item[key].replace('"', '"'));
}
this_token
.insertBefore(input_token);
// The 'delete token' button
if (!isReadOnly)
{
$("<span>" + settings.deleteText + "</span>")
.addClass(settings.classes.tokenDelete)
.appendTo(this_token)
.click(function () {
delete_token($(this).parent());
hidden_input.change();
return false;
});
}
// Store data on the token
var token_data = {"id": item.id};
token_data[settings.propertyToSearch] = item[settings.propertyToSearch];
$.data(this_token.get(0), "tokeninput", item);
// Save this token for duplicate checking
saved_tokens = saved_tokens.slice(0,selected_token_index).concat([token_data]).concat(saved_tokens.slice(selected_token_index));
selected_token_index++;
// Update the hidden input
update_hidden_input(saved_tokens, hidden_input);
token_count += 1;
// Check the token limit
if (settings.tokenLimit !== null && token_count >= settings.tokenLimit) {
input_box.hide();
hide_dropdown();
}
return this_token;
}
// Add a token to the token list based on user input
function add_token (item) {
var callback = settings.onAdd;
// See if the token already exists and select it if we don't want duplicates
if (token_count > 0 && settings.preventDuplicates) {
var found_existing_token = null;
token_list.children().each(function () {
var existing_token = $(this);
var existing_data = $.data(existing_token.get(0), "tokeninput");
if (existing_data && existing_data.id === item.id) {
found_existing_token = existing_token;
return false;
}
});
if (found_existing_token) {
select_token(found_existing_token);
input_token.insertAfter(found_existing_token);
input_box.focus();
return;
}
}
// Insert the new tokens
if (settings.tokenLimit == null || token_count < settings.tokenLimit) {
item.name = item.name.replace(',', ' ');
insert_token(item);
checkTokenLimit();
}
// Clear input box
input_box.val("");
// Don't show the help dropdown, they've got the idea
hide_dropdown();
// Execute the onAdd callback if defined
if ($.isFunction(callback)) {
callback.call(hidden_input,item);
}
}
// Select a token in the token list
function select_token (token) {
token.addClass(settings.classes.selectedToken);
selected_token = token.get(0);
// Hide input box
input_box.val("");
// Hide dropdown if it is visible (eg if we clicked to select token)
hide_dropdown();
}
// Deselect a token in the token list
function deselect_token (token, position) {
token.removeClass(settings.classes.selectedToken);
selected_token = null;
if (position === POSITION.BEFORE) {
input_token.insertBefore(token);
selected_token_index--;
} else if (position === POSITION.AFTER) {
input_token.insertAfter(token);
selected_token_index++;
} else {
input_token.appendTo(token_list);
selected_token_index = token_count;
}
// Show the input box and give it focus again
input_box.focus();
}
// Toggle selection of a token in the token list
function toggle_select_token(token) {
var previous_selected_token = selected_token;
if (selected_token) {
deselect_token($(selected_token), POSITION.END);
}
if (previous_selected_token === token.get(0)) {
deselect_token(token, POSITION.END);
} else {
select_token(token);
}
}
// Delete a token from the token list
function delete_token (token) {
// Remove the id from the saved list
var token_data = $.data(token.get(0), "tokeninput");
var callback = settings.onDelete;
var index = token.prevAll().length;
if (index > selected_token_index) {
index--;
}
// Delete the token
token.remove();
selected_token = null;
// Show the input box and give it focus again
input_box.focus();
// Remove this token from the saved list
saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));
if (index < selected_token_index) {
selected_token_index--;
}
// Update the hidden input
update_hidden_input(saved_tokens, hidden_input);
token_count -= 1;
if (settings.tokenLimit !== null) {
input_box
.show()
.val("")
.focus();
}
// Execute the onDelete callback if defined
if ($.isFunction(callback)) {
callback.call(hidden_input,token_data);
}
}
// Update the hidden input box value
function update_hidden_input(saved_tokens, hidden_input) {
var token_values = $.map(saved_tokens, function (el) {
return el[settings.tokenValue];
});
hidden_input.val(token_values.join(settings.tokenDelimiter));
}
// Hide and clear the results dropdown
function hide_dropdown () {
dropdown.hide().empty();
selected_dropdown_item = null;
}
function show_dropdown() {
dropdown
.css({
position: "absolute",
top: $(token_list).offset().top + $(token_list).outerHeight(),
left: $(token_list).offset().left,
zindex: 999,
width: (token_list.outerWidth(true)-2)
})
.show();
}
function show_dropdown_searching () {
if (settings.searchingText) {
dropdown.html("<p>"+settings.searchingText+"</p>");
show_dropdown();
}
}
function show_dropdown_hint () {
if (settings.hintText) {
dropdown.html("<p>"+settings.hintText+"</p>");
show_dropdown();
}
}
function quote_re_term(term) {
return term.replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]', 'g'), '\\$&');
}
// Highlight the query part of the search term
function highlight_term(value, term) {
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + quote_re_term(term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<b>$1</b>");
}
function find_value_and_highlight_term(template, value, term) {
return template.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + quote_re_term(value) + ")(?![^<>]*>)(?![^&;]+;)", "g"), highlight_term(value, term));
}
// Populate the results dropdown with some results
function populate_dropdown (query, results) {
if (results && results.length) {
dropdown.empty();
var dropdown_ul = $("<ul>")
.appendTo(dropdown)
.mouseover(function (event) {
select_dropdown_item($(event.target).closest("li"));
})
.mousedown(function (event) {
add_token($(event.target).closest("li").data("tokeninput"));
hidden_input.change();
return false;
})
.hide();
$.each(results, function(index, value) {
var this_li = settings.resultsFormatter(value);
this_li = find_value_and_highlight_term(this_li ,value[settings.propertyToSearch], query);
this_li = $(this_li).appendTo(dropdown_ul);
if (index % 2) {
this_li.addClass(settings.classes.dropdownItem);
} else {
this_li.addClass(settings.classes.dropdownItem2);
}
if (index === 0) {
select_dropdown_item(this_li);
}
$.data(this_li.get(0), "tokeninput", value);
});
show_dropdown();
if (settings.animateDropdown) {
dropdown_ul.slideDown("fast");
} else {
dropdown_ul.show();
}
} else {
if (settings.noResultsText) {
dropdown.html("<p>"+settings.noResultsText+"</p>");
show_dropdown();
}
}
}
// Highlight an item in the results dropdown
function select_dropdown_item (item) {
if (item) {
if (selected_dropdown_item) {
deselect_dropdown_item($(selected_dropdown_item));
}
item.addClass(settings.classes.selectedDropdownItem);
selected_dropdown_item = item.get(0);
}
}
// Remove highlighting from an item in the results dropdown
function deselect_dropdown_item (item) {
item.removeClass(settings.classes.selectedDropdownItem);
selected_dropdown_item = null;
}
// Do a search and show the "searching" dropdown if the input is longer
// than settings.minChars
function do_search() {
var query = input_box.val().toLowerCase();
if (query && query.length) {
if (selected_token) {
deselect_token($(selected_token), POSITION.AFTER);
}
if (query.length >= settings.minChars) {
show_dropdown_searching();
clearTimeout(timeout);
timeout = setTimeout(function(){
run_search(query);
}, settings.searchDelay);
} else {
hide_dropdown();
}
}
}
// Do the actual search
function run_search(query) {
var cache_key = query + computeURL();
var cached_results = cache.get(cache_key);
if (cached_results) {
populate_dropdown(query, cached_results);
} else {
// Are we doing an ajax search or local data search?
if (settings.url) {
var url = computeURL();
// Extract exisiting get params
var ajax_params = {};
ajax_params.data = {};
if (url.indexOf("?") > -1) {
var parts = url.split("?");
ajax_params.url = parts[0];
var param_array = parts[1].split("&");
$.each(param_array, function (index, value) {
var kv = value.split("=");
ajax_params.data[kv[0]] = kv[1];
});
} else {
ajax_params.url = url;
}
// Prepare the request
ajax_params.data[settings.queryParam] = query;
ajax_params.type = settings.method;
ajax_params.dataType = settings.contentType;
if (settings.crossDomain) {
ajax_params.dataType = "jsonp";
}
// Attach the success callback
ajax_params.success = function(results) {
if ($.isFunction(settings.onResult)) {
results = settings.onResult.call(hidden_input, results);
}
cache.add(cache_key, settings.jsonContainer ? results[settings.jsonContainer] : results);
// only populate the dropdown if the results are associated with the active search query
if (input_box.val().toLowerCase() === query) {
populate_dropdown(query, settings.jsonContainer ? results[settings.jsonContainer] : results);
}
};
// Make the request
$.ajax(ajax_params);
} else if (settings.local_data) {
// Do the search through local data
var results = $.grep(settings.local_data, function (row) {
return row[settings.propertyToSearch].toLowerCase().indexOf(query.toLowerCase()) > -1;
});
if ($.isFunction(settings.onResult)) {
results = settings.onResult.call(hidden_input, results);
}
cache.add(cache_key, results);
populate_dropdown(query, results);
}
}
}
// compute the dynamic URL
function computeURL() {
var url = settings.url;
if (typeof settings.url == 'function') {
url = settings.url.call();
}
return url;
}
};
// Really basic cache for the results
$.TokenList.Cache = function (options) {
var settings = $.extend({
max_size: 500
}, options);
var data = {};
var size = 0;
var flush = function () {
data = {};
size = 0;
};
this.add = function (query, results) {
if (size > settings.max_size) {
flush();
}
if (!data[query]) {
size += 1;
}
data[query] = results;
};
this.get = function (query) {
return data[query];
};
};
}(jQuery));
//-----------------------------------------------------------
// Ensure we have our namespace
//-----------------------------------------------------------
if (!HUB) {
var HUB = {};
}
if (!HUB.Plugins) {
HUB.Plugins = {};
}
//----------------------------------------------------------
// Tag Autocompleter
//----------------------------------------------------------
if (!jq) {
var jq = $;
}
HUB.Plugins.Autocomplete = {
writeSelectList: function(members, id) {
var $ = jq,
sel = $('#' + id);
if (!sel.length) {
return;
}
sel
.find('option')
.remove()
.end();
sel.append('<option value="">(none)</option>');
for (var i=0; i<members.length; i++)
{
sel.append('<option value="' + members[i].username + '">' + members[i].name + '</option>');
}
},
initialize: function() {
var $ = jq;
//var head = document.head;
var head = document.getElementsByTagName('head')[0];
var styles = document.createElement('link');
styles.type = 'text/css';
styles.rel = 'stylesheet';
styles.href = plgAutocompleterCss; //$('#plgAutocompleterCss').val();
if (!styles.href) {
styles.href = '/core/plugins/hubzero/autocompleter/assets/css/autocompleter.css';
}
head.appendChild(styles);
$('.autocomplete').each(function(i, input) {
// Set some defaults
var option = 'tags',
type = 'multi',
actkn = '',
tagger = null,
id = null,
wsel = null,
showid = false,
cls = '',
hint = '',
limit = null,
storeRecent = true;
id = $(input).attr('id');
if (!id) {
return;
}
if ($(input).attr('data-options')) {
var params = $(input).attr('data-options').split(',');
if (params) {
option = params[0];
type = params[1];
wsel = params[2];
}
}
// Set the CSS class for the type of autocompleter (affects colors)
switch (option)
{
case 'members':
cls = 'acm';
hint = 'Type in name or email';
showid = true;
break;
case 'groups':
cls = 'acg';
hint = 'Type in a search term';
break;
case 'tags':
default:
cls = 'act';
hint = 'Type in a search term';
break;
}
if ($('#actkn')) {
actkn = '&admin=true';
}
// Are multiple entries allowable?
if (type == 'multi') {
limit = null;
} else {
limit = 1;
}
// recent use storage
var recentStorageKey = 'autocompleter.recent.' + option;
value = $('#'+id).val();
var data = [];
if (value) {
if (value.indexOf(',') == -1) {
var values = [value];
} else {
var values = value.split(',');
}
$(values).each(function(i, v) {
v = v.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
var id = null,
name = null;
if (option != 'tags' && v.match(/(.+?) \((.+?)\)/ig)) {
id = v.replace(/(.+?) \((.+?)\)/ig, '$2');
name = v.replace(/(.+?) \((.+?)\)/ig, '$1');
}
id = (id) ? id : v;
name = (name) ? name : id;
data[i] = {
'id': id,
'name': name
};
});
}
var src = $(input).attr('data-script');
src = src ? src : '/index.php';
$('#'+id).tokenInput(src + '?option=com_'+option+'&no_html=1&task=autocomplete'+actkn, {
theme: cls,
hintText: hint,
prePopulate: data,
tokenLimit: limit,
preventDuplicates: true,
resultsFormatter: function(item){
if (option != 'tags') {
var html = "<li>";
if (item['picture']) {
html += '<img src="'+item['picture']+'" width="30" height="30" alt="picture" />';
}
html += item[this.propertyToSearch]+ " ("+item['id']+")";
if (item['org']) {
html += '<span>' + item['org'] + '</span>';
}
if (item['picture']) {
html += '<div style="display:inline;clear:left;"></div>';
}
html += "</li>";
return html;
}
return "<li>" + item[this.propertyToSearch]+ "</li>";
},
onResult: function(results)
{
// if we want to use recent & we have stored recent items
if (storeRecent && localStorage && localStorage.getItem(recentStorageKey))
{
// get recent items
var topResults = [];
var recent = JSON.parse(localStorage.getItem(recentStorageKey));
var items = recent.items;
// loop through each recent item & get its value
// if we have one in the results set
for (var i =0; i < items.length; i++)
{
for (var j=0; j < results.length; j++)
{
// if found push to top results &
// remove from original result set
var id = results[j].id;
if (items[i] == id)
{
topResults.push(results[j]);
results.splice(j, 1);
}
}
}
// get top results in reverse order because of how
// we are going to prepend to results array as we iterate
topResults = topResults.reverse();
for (var i=0, n=topResults.length; i < n; i++)
{
results.unshift(topResults[i]);
}
}
// return original results of local storage is not
// eligible or user has not existing recent usage
return results;
},
onAdd: function(item)
{
// pasting in comma separated items
if (item.name.indexOf(',') > -1 || item.name.indexOf(';') > -1)
{
// remove original item
$('#'+id).tokenInput('remove', {id:item.id});
// split by comma
var items = item.name.split(/,|;/g);
for (var i = 0, n = items.length; i < n; i++)
{
// add each individual item
var item = items[i].trim();
$('#'+id).tokenInput('add', {
id: item,
name: item
});
}
}
if (wsel) {
$.getJSON('/index.php?option=com_groups&no_html=1&task=memberslist&group=' + $('#'+id).val(), function(data) {
HUB.Plugins.Autocomplete.writeSelectList(data.members, wsel);
});
}
// if we want to store recent &
// we have local storage
if (storeRecent && localStorage)
{
// check to see if we have existing recent items
if (recent = localStorage.getItem(recentStorageKey))
{
// parse and add ids to list
recent = JSON.parse(recent);
// make sure it only exists once
// removes it from current location
var index = recent.items.indexOf(item.id);
if (index != -1)
{
recent.items.splice(index, 1);
}
// adds to top of list
recent.items.unshift(item.id);
}
else
{
//otherwise create new list
var recent = { items: [item.id] };
}
// set list of recent to local storage
localStorage.setItem(recentStorageKey, JSON.stringify(recent));
}
}
});
});
}
}
jQuery(document).ready(function(jq){
HUB.Plugins.Autocomplete.initialize();
});
| {
"content_hash": "fbff6940c9a74c59d6ffc9f8b457787b",
"timestamp": "",
"source": "github",
"line_count": 1190,
"max_line_length": 149,
"avg_line_length": 25.558823529411764,
"alnum_prop": 0.5999013644583265,
"repo_name": "zooley/hubzero-cms",
"id": "7af9c2268e12fc938b56c2017de61104afb0921d",
"size": "30563",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "core/plugins/hubzero/autocompleter/assets/js/autocompleter.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "171251"
},
{
"name": "AngelScript",
"bytes": "1638"
},
{
"name": "CSS",
"bytes": "2719736"
},
{
"name": "HTML",
"bytes": "1289374"
},
{
"name": "JavaScript",
"bytes": "12613354"
},
{
"name": "PHP",
"bytes": "24941743"
},
{
"name": "Shell",
"bytes": "10678"
},
{
"name": "TSQL",
"bytes": "572"
}
],
"symlink_target": ""
} |
/*****************************************************************************
BotanUtil.h
Botan convenience functions
*****************************************************************************/
#ifndef _SOFTHSM_V2_BOTANUTIL_H
#define _SOFTHSM_V2_BOTANUTIL_H
#include "config.h"
#include "ByteString.h"
#include <botan/bigint.h>
#if defined(WITH_ECC) || defined(WITH_GOST)
#include <botan/ec_group.h>
#endif
namespace BotanUtil
{
// Convert a Botan BigInt to a ByteString
ByteString bigInt2ByteString(const Botan::BigInt& bigInt);
ByteString bigInt2ByteStringPrefix(const Botan::BigInt& bigInt, size_t size);
// Convert a ByteString to a Botan BigInt
Botan::BigInt byteString2bigInt(const ByteString& byteString);
#if defined(WITH_ECC) || defined(WITH_GOST)
// Convert a Botan EC group to a ByteString
ByteString ecGroup2ByteString(const Botan::EC_Group& ecGroup);
// Convert a ByteString to a Botan EC group
Botan::EC_Group byteString2ECGroup(const ByteString& byteString);
// Convert a Botan EC point to a ByteString
ByteString ecPoint2ByteString(const Botan::PointGFp& ecPoint);
// Convert a ByteString to a Botan EC point in the given EC group
Botan::PointGFp byteString2ECPoint(const ByteString& byteString, const Botan::EC_Group& ecGroup);
#endif
}
#endif // !_SOFTHSM_V2_BOTANUTIL_H
| {
"content_hash": "43c5bef1eac7e167b825879d26fbde6d",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 98,
"avg_line_length": 30.045454545454547,
"alnum_prop": 0.6724659606656581,
"repo_name": "Doctor-love/SoftHSMv2",
"id": "67f6ca63e397c2fca0498099996d6882195f7bfb",
"size": "2672",
"binary": false,
"copies": "3",
"ref": "refs/heads/develop",
"path": "src/lib/crypto/BotanUtil.h",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C",
"bytes": "120994"
},
{
"name": "C++",
"bytes": "2530691"
},
{
"name": "Groff",
"bytes": "8274"
},
{
"name": "Perl",
"bytes": "27654"
},
{
"name": "Python",
"bytes": "31570"
},
{
"name": "Shell",
"bytes": "54462"
}
],
"symlink_target": ""
} |
FROM balenalib/spacely-tx2-fedora:34-build
RUN dnf -y update \
&& dnf clean all \
&& dnf -y install \
gzip \
java-1.8.0-openjdk \
java-1.8.0-openjdk-devel \
tar \
&& dnf clean all
# set JAVA_HOME
ENV JAVA_HOME /usr/lib/jvm/java-openjdk
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Fedora 34 \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nOpenJDK v8-jre \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo $'#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "c02c6fb409fe0f77288f53d165836f30",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 675,
"avg_line_length": 59.09090909090909,
"alnum_prop": 0.7107692307692308,
"repo_name": "nghiant2710/base-images",
"id": "4f7278e9fc197d281ad8605bf4a250a0e520a647",
"size": "1321",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "balena-base-images/openjdk/spacely-tx2/fedora/34/8-jre/build/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
<?php
namespace PHPExiftool\Driver\Tag\ExifIFD;
use JMS\Serializer\Annotation\ExclusionPolicy;
use PHPExiftool\Driver\AbstractTag;
/**
* @ExclusionPolicy("all")
*/
class ISO extends AbstractTag
{
protected $Id = 34855;
protected $Name = 'ISO';
protected $FullName = 'Exif::Main';
protected $GroupName = 'ExifIFD';
protected $g0 = 'EXIF';
protected $g1 = 'IFD0';
protected $g2 = 'Image';
protected $Type = 'int16u';
protected $Writable = true;
protected $Description = 'ISO';
protected $local_g1 = 'ExifIFD';
}
| {
"content_hash": "b4842095cf34e9fd4e5b0fac9f1a4a6e",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 46,
"avg_line_length": 15.45945945945946,
"alnum_prop": 0.6451048951048951,
"repo_name": "romainneutron/PHPExiftool",
"id": "4930c28053053a742d175d9a2fa571a14c113bf6",
"size": "794",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/PHPExiftool/Driver/Tag/ExifIFD/ISO.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "22042446"
}
],
"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 (version 1.7.0_11) on Thu Aug 29 10:57:47 CEST 2013 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>com.googlecode.ipv6 (Java IPv6 Library 0.15 API)</title>
<meta name="date" content="2013-08-29">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<h1 class="bar"><a href="../../../com/googlecode/ipv6/package-summary.html" target="classFrame">com.googlecode.ipv6</a></h1>
<div class="indexContainer">
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="IPv6Address.html" title="class in com.googlecode.ipv6" target="classFrame">IPv6Address</a></li>
<li><a href="IPv6AddressHelpers.html" title="class in com.googlecode.ipv6" target="classFrame">IPv6AddressHelpers</a></li>
<li><a href="IPv6AddressPool.html" title="class in com.googlecode.ipv6" target="classFrame">IPv6AddressPool</a></li>
<li><a href="IPv6AddressRange.html" title="class in com.googlecode.ipv6" target="classFrame">IPv6AddressRange</a></li>
<li><a href="IPv6Network.html" title="class in com.googlecode.ipv6" target="classFrame">IPv6Network</a></li>
<li><a href="IPv6NetworkHelpers.html" title="class in com.googlecode.ipv6" target="classFrame">IPv6NetworkHelpers</a></li>
<li><a href="IPv6NetworkMask.html" title="class in com.googlecode.ipv6" target="classFrame">IPv6NetworkMask</a></li>
</ul>
</div>
</body>
</html>
| {
"content_hash": "c977c5f2ea79e3e381d769d6b3e1b6b6",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 124,
"avg_line_length": 59.73076923076923,
"alnum_prop": 0.716677398583387,
"repo_name": "snoopy7713/java-ipv6",
"id": "e81292c58c6cec988925866d721f04ccac3fcaf2",
"size": "1553",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "artifacts/0.15/doc/apidocs/com/googlecode/ipv6/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "158728"
},
{
"name": "Java",
"bytes": "1539271"
}
],
"symlink_target": ""
} |
module Sneakers
module Metrics
class StatsdMetrics
def initialize(conn)
@connection = conn
end
def increment(metric)
@connection.incrememnt(metric)
end
def timing(metric, &block)
start = Time.now
block.call
@connection.timing(metric, ((Time.now - start)*1000).floor)
end
end
end
end
| {
"content_hash": "06c21b78efde02b7cffeccaf64450b57",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 67,
"avg_line_length": 17.857142857142858,
"alnum_prop": 0.592,
"repo_name": "willbarrett/sneakers07",
"id": "a1e2603baac28460a1194f6e27798faa66aafbc9",
"size": "375",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "lib/sneakers/metrics/statsd_metrics.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "37980"
}
],
"symlink_target": ""
} |
package org.kuali.rice.krad.uif.util;
import org.junit.Test;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
/**
* ScriptUtilsTest tests {@link ScriptUtils}
*
* @author Kuali Rice Team (rice.collab@kuali.org)
*/
public class ScriptUtilsTest {
@Test
/**
* tests {@link ScriptUtils#escapeHtml(String)}
*/
public void testEscapeHtml() throws Exception {
assertEquals("wasn't", ScriptUtils.escapeHtml("wasn't"));
assertEquals("\\u0022wasn't\\u0022", ScriptUtils.escapeHtml("\"wasn't\""));
}
@Test
/**
* tests {@link ScriptUtils#escapeHtml(java.util.List)}
*/
public void testEscapeHtmlStringList() {
String[] escaped = {"wasn't", "\\u0022wasn't\\u0022"};
String[] unEscaped = {"wasn't", "\"wasn't\""};
assertEquals(Arrays.asList(escaped), ScriptUtils.escapeHtml(Arrays.asList(unEscaped)));
List<String> nullList = null;
assertNull(ScriptUtils.escapeHtml(nullList));
List<String> emptyList = Collections.emptyList();
assertEquals(emptyList, ScriptUtils.escapeHtml(emptyList));
}
@Test
/**
* tests {@link ScriptUtils#convertToJsValue(String)} for a function value
*/
public void testConvertToJSValue_function() {
// test for white space
String jsFunction = "\n function () {alert('1 + 1 ' is 1 + 1);} \n\n";
assertEquals("function was not converted to js value as expected", jsFunction, ScriptUtils.convertToJsValue(jsFunction));
}
@Test
/**
* tests {@link ScriptUtils#convertToJsValue(String)} for numeric values
*/
public void testConvertToJSValue_numeric() {
assertEquals("number was not converted to js value as expected", " -1 ", ScriptUtils.convertToJsValue(" -1 "));
assertEquals("number was not converted to js value as expected", "1.01 ", ScriptUtils.convertToJsValue("1.01 "));
assertEquals("string was not converted to js value as expected", "'1.o1 '", ScriptUtils.convertToJsValue("1.o1 "));
}
@Test
/**
* tests {@link ScriptUtils#convertToJsValue(String)} for maps and arrays
*/
public void testConvertToJSValue_mapAndArray() {
assertEquals("array was not converted to js value as expected", " [-1, 4, 5] ", ScriptUtils.convertToJsValue(" [-1, 4, 5] "));
String jsMap = " {'a':1, 'b':2} \n";
assertEquals("map was not converted to js value as expected", jsMap, ScriptUtils.convertToJsValue(jsMap));
}
/**
* Test building of event script matches the expected JavaScript
*/
@Test
public void testBuildEventHandlerScript() {
String onClickScript = "alert('A click happened');";
String onClickHandler = ScriptUtils.buildEventHandlerScript("u09", "click", onClickScript);
String expectedHandler = "jQuery('#u09').on('click', function(e) {" + onClickScript + "}); ";
assertEquals("generate event script is not correct", expectedHandler, onClickHandler);
}
}
| {
"content_hash": "053bc99fd68a7ac3794fc1ceff0c1515",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 134,
"avg_line_length": 36.80681818181818,
"alnum_prop": 0.63908613769682,
"repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua",
"id": "224df436238b428ad5d560204be6b6e8fb7d5af1",
"size": "3874",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "rice-framework/krad-web-framework/src/test/java/org/kuali/rice/krad/uif/util/ScriptUtilsTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "542248"
},
{
"name": "Groovy",
"bytes": "2403552"
},
{
"name": "HTML",
"bytes": "3275928"
},
{
"name": "Java",
"bytes": "30805440"
},
{
"name": "JavaScript",
"bytes": "2486893"
},
{
"name": "PHP",
"bytes": "15766"
},
{
"name": "PLSQL",
"bytes": "108325"
},
{
"name": "SQLPL",
"bytes": "51212"
},
{
"name": "Shell",
"bytes": "1808"
},
{
"name": "XSLT",
"bytes": "109576"
}
],
"symlink_target": ""
} |
package org.uberfire.ext.plugin.client.perspective.editor.layout.editor;
import java.util.ArrayList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.uberfire.client.mvp.ActivityBeansInfo;
import org.uberfire.ext.plugin.event.NewPluginRegistered;
import org.uberfire.ext.plugin.event.PluginUnregistered;
import org.uberfire.ext.plugin.model.Plugin;
import org.uberfire.ext.plugin.model.PluginType;
import static org.jgroups.util.Util.*;
import static org.mockito.Mockito.*;
public class ScreenLayoutDragComponentTest {
private ScreenLayoutDragComponent screenLayoutDragComponent;
private ActivityBeansInfo activityBeansInfo;
@Before
public void setup() {
screenLayoutDragComponent = spy( new ScreenLayoutDragComponent() );
activityBeansInfo = spy( new ActivityBeansInfo() );
List<String> availableWorkbenchScreensIds = new ArrayList<String>();
availableWorkbenchScreensIds.add( "screen1" );
availableWorkbenchScreensIds.add( "screen2" );
availableWorkbenchScreensIds.add( "screen3" );
doReturn( availableWorkbenchScreensIds ).when( activityBeansInfo ).getAvailableWorkbenchScreensIds();
doReturn( activityBeansInfo ).when( screenLayoutDragComponent ).getActivityBeansInfo();
screenLayoutDragComponent.setup();
}
@Test
public void newNotScreenPluginRegisteredTest() {
screenLayoutDragComponent.onNewPluginRegistered( new NewPluginRegistered( "newPlugin", PluginType.EDITOR ) );
assertEquals( 3, screenLayoutDragComponent.getAvailableWorkbenchScreensIds().size() );
}
@Test
public void existingScreenRegisteredTest() {
screenLayoutDragComponent.onNewPluginRegistered( new NewPluginRegistered( "screen1", PluginType.SCREEN ) );
assertEquals( 3, screenLayoutDragComponent.getAvailableWorkbenchScreensIds().size() );
}
@Test
public void newScreenRegisteredTest() {
screenLayoutDragComponent.onNewPluginRegistered( new NewPluginRegistered( "newScreen", PluginType.SCREEN ) );
assertEquals( 4, screenLayoutDragComponent.getAvailableWorkbenchScreensIds().size() );
}
@Test
public void notScreenPluginUnregisteredTest() {
screenLayoutDragComponent.onPluginUnregistered( new PluginUnregistered( "screen1", PluginType.EDITOR ) );
assertEquals( 3, screenLayoutDragComponent.getAvailableWorkbenchScreensIds().size() );
}
@Test
public void existingScreenUnregisteredTest() {
screenLayoutDragComponent.onPluginUnregistered( new PluginUnregistered( "screen1", PluginType.SCREEN ) );
assertEquals( 2, screenLayoutDragComponent.getAvailableWorkbenchScreensIds().size() );
}
@Test
public void unexistingScreenUnregisteredTest() {
screenLayoutDragComponent.onPluginUnregistered( new PluginUnregistered( "unexistingPlugin", PluginType.SCREEN ) );
assertEquals( 3, screenLayoutDragComponent.getAvailableWorkbenchScreensIds().size() );
}
}
| {
"content_hash": "62781ba6f722b283896f6a8cb60d49ae",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 122,
"avg_line_length": 39.33766233766234,
"alnum_prop": 0.7553648068669528,
"repo_name": "psiroky/uberfire",
"id": "45173a6205a54e675818272d277101ebf185c4b1",
"size": "3650",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "uberfire-extensions/uberfire-runtime-plugins/uberfire-runtime-plugins-client/src/test/java/org/uberfire/ext/plugin/client/perspective/editor/layout/editor/ScreenLayoutDragComponentTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "79132"
},
{
"name": "FreeMarker",
"bytes": "35014"
},
{
"name": "HTML",
"bytes": "37524"
},
{
"name": "Java",
"bytes": "7904766"
},
{
"name": "JavaScript",
"bytes": "60121"
},
{
"name": "Ruby",
"bytes": "706"
}
],
"symlink_target": ""
} |
<?php
namespace Newsletter\Test\TestCase\Controller;
use Cake\TestSuite\IntegrationTestCase;
use Newsletter\Controller\UsersController;
/**
* Newsletter\Controller\UsersController Test Case
*/
class UsersControllerTest extends IntegrationTestCase
{
/**
* Fixtures
*
* @var array
*/
public $fixtures = [
'plugin.newsletter.users'
];
/**
* Test index method
*
* @return void
*/
public function testIndex()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test view method
*
* @return void
*/
public function testView()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test add method
*
* @return void
*/
public function testAdd()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test edit method
*
* @return void
*/
public function testEdit()
{
$this->markTestIncomplete('Not implemented yet.');
}
/**
* Test delete method
*
* @return void
*/
public function testDelete()
{
$this->markTestIncomplete('Not implemented yet.');
}
}
| {
"content_hash": "9f6bb50cabb4a76bfd8977dcc78805d9",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 58,
"avg_line_length": 17.366197183098592,
"alnum_prop": 0.559610705596107,
"repo_name": "steinkel/cakefest2016",
"id": "e3bf7491874719a26c57e718537642ef4ee2e936",
"size": "1233",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "plugins/Newsletter/tests/TestCase/Controller/UsersControllerTest.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "270"
},
{
"name": "Batchfile",
"bytes": "834"
},
{
"name": "CSS",
"bytes": "9516"
},
{
"name": "PHP",
"bytes": "231018"
},
{
"name": "Shell",
"bytes": "1457"
}
],
"symlink_target": ""
} |
namespace NLog.UnitTests.LayoutRenderers
{
using NLog.Layouts;
using NLog.LayoutRenderers.Wrappers;
using Xunit;
public class Rot13Tests : NLogTestBase
{
[Fact]
public void Test1()
{
Assert.Equal("NOPQRSTUVWXYZABCDEFGHIJKLM",
Rot13LayoutRendererWrapper.DecodeRot13("ABCDEFGHIJKLMNOPQRSTUVWXYZ"));
Assert.Equal("nopqrstuvwxyzabcdefghijklm0123456789",
Rot13LayoutRendererWrapper.DecodeRot13("abcdefghijklmnopqrstuvwxyz0123456789"));
Assert.Equal("How can you tell an extrovert from an introvert at NSA? Va gur ryringbef, gur rkgebiregf ybbx ng gur BGURE thl'f fubrf.",
Rot13LayoutRendererWrapper.DecodeRot13(
"Ubj pna lbh gryy na rkgebireg sebz na vagebireg ng AFN? In the elevators, the extroverts look at the OTHER guy's shoes."));
}
[Fact]
public void Test2()
{
Layout l = "${rot13:HELLO}";
LogEventInfo lei = LogEventInfo.Create(LogLevel.Info, "aaa", "bbb");
Assert.Equal("URYYB", l.Render(lei));
}
[Fact]
public void Test3()
{
Layout l = "${rot13:text=HELLO}";
LogEventInfo lei = LogEventInfo.Create(LogLevel.Info, "aaa", "bbb");
Assert.Equal("URYYB", l.Render(lei));
}
[Fact]
public void Test4()
{
Layout l = "${rot13:${event-context:aaa}}";
LogEventInfo lei = LogEventInfo.Create(LogLevel.Info, "aaa", "bbb");
lei.Properties["aaa"] = "HELLO";
Assert.Equal("URYYB", l.Render(lei));
}
[Fact]
public void Test5()
{
LogManager.Configuration = CreateConfigurationFromString(@"
<nlog>
<targets>
<target name='debug' type='Debug' layout='${rot13:${mdc:A}}' />
<target name='debug2' type='Debug' layout='${rot13:${rot13:${mdc:A}}}' />
</targets>
<rules>
<logger name='*' levels='Trace' writeTo='debug,debug2' />
</rules>
</nlog>");
MappedDiagnosticsContext.Set("A", "Foo.Bar!");
Logger l = LogManager.GetLogger("NLog.UnitTests.LayoutRenderers.Rot13Tests");
l.Trace("aaa");
AssertDebugLastMessage("debug", "Sbb.One!");
// double rot-13 should be identity
AssertDebugLastMessage("debug2", "Foo.Bar!");
}
}
} | {
"content_hash": "1cfd62eaabb1093bc9506a88c8ebdb3f",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 152,
"avg_line_length": 37.128571428571426,
"alnum_prop": 0.5402077722200846,
"repo_name": "mikkelxn/NLog",
"id": "a5570c55e89bd9c5964b00eedf879365bc3c1fa0",
"size": "4230",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tests/NLog.UnitTests/LayoutRenderers/Rot13Tests.cs",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ASP",
"bytes": "10969"
},
{
"name": "Batchfile",
"bytes": "1191"
},
{
"name": "C#",
"bytes": "3006612"
},
{
"name": "CSS",
"bytes": "183"
},
{
"name": "HTML",
"bytes": "2811"
},
{
"name": "JavaScript",
"bytes": "1699"
},
{
"name": "Makefile",
"bytes": "3596"
},
{
"name": "Perl",
"bytes": "2493"
},
{
"name": "PowerShell",
"bytes": "1625"
},
{
"name": "Visual Basic",
"bytes": "1706"
}
],
"symlink_target": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.