text
stringlengths 2
1.04M
| meta
dict |
|---|---|
#ifndef __ARCH_ARM_MACH_MSM_LPM_STATS_H
#define __ARCH_ARM_MACH_MSM_LPM_STATS_H
struct lpm_stats;
#ifdef CONFIG_MSM_IDLE_STATS
struct lpm_stats *lpm_stats_config_level(const char *name,
const char **levels, int num_levels, struct lpm_stats *parent,
struct cpumask *mask);
void lpm_stats_cluster_enter(struct lpm_stats *stats, uint32_t index);
void lpm_stats_cluster_exit(struct lpm_stats *stats, uint32_t index,
bool success);
void lpm_stats_cpu_enter(uint32_t index);
void lpm_stats_cpu_exit(uint32_t index, bool success);
void lpm_stats_suspend_enter(void);
void lpm_stats_suspend_exit(void);
#else
static inline struct lpm_stats *lpm_stats_config_level(const char *name,
const char **levels, int num_levels, struct lpm_stats *parent,
struct cpumask *mask)
{
return ERR_PTR(-ENODEV);
}
static inline void lpm_stats_cluster_enter(struct lpm_stats *stats,
uint32_t index)
{
return;
}
static inline void lpm_stats_cluster_exit(struct lpm_stats *stats,
uint32_t index, bool success)
{
return;
}
static inline void lpm_stats_cpu_enter(uint32_t index)
{
return;
}
static inline void lpm_stats_cpu_exit(uint32_t index, bool success)
{
return;
}
static inline void lpm_stats_suspend_enter(void)
{
return;
}
static inline void lpm_stats_suspend_exit(void)
{
return;
}
#endif
#endif /* __ARCH_ARM_MACH_MSM_LPM_STATS_H */
|
{
"content_hash": "793645e91382c6839d8e5f2d2e6ea651",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 72,
"avg_line_length": 22.88135593220339,
"alnum_prop": 0.7318518518518519,
"repo_name": "manuelmagix/kernel_bq_piccolo",
"id": "05f5516f4177613feaf322fefe90e6f29b30e57d",
"size": "1883",
"binary": false,
"copies": "827",
"ref": "refs/heads/master",
"path": "include/soc/qcom/lpm-stats.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "4528"
},
{
"name": "Assembly",
"bytes": "9818830"
},
{
"name": "Awk",
"bytes": "18681"
},
{
"name": "C",
"bytes": "494602785"
},
{
"name": "C++",
"bytes": "4382330"
},
{
"name": "Clojure",
"bytes": "480"
},
{
"name": "Groff",
"bytes": "22012"
},
{
"name": "Lex",
"bytes": "40805"
},
{
"name": "Makefile",
"bytes": "1373737"
},
{
"name": "Objective-C",
"bytes": "1218215"
},
{
"name": "Perl",
"bytes": "406175"
},
{
"name": "Python",
"bytes": "37296"
},
{
"name": "Scilab",
"bytes": "21433"
},
{
"name": "Shell",
"bytes": "137667"
},
{
"name": "SourcePawn",
"bytes": "4687"
},
{
"name": "UnrealScript",
"bytes": "6113"
},
{
"name": "Yacc",
"bytes": "83091"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (version 1.7.0_55) on Thu Sep 25 12:22:17 CEST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class at.irian.ankor.monitor.nop.NopRoutingTableMonitor (Ankor - Project 0.4-SNAPSHOT API)</title>
<meta name="date" content="2014-09-25">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class at.irian.ankor.monitor.nop.NopRoutingTableMonitor (Ankor - Project 0.4-SNAPSHOT API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../at/irian/ankor/monitor/nop/NopRoutingTableMonitor.html" title="class in at.irian.ankor.monitor.nop">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?at/irian/ankor/monitor/nop/class-use/NopRoutingTableMonitor.html" target="_top">Frames</a></li>
<li><a href="NopRoutingTableMonitor.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class at.irian.ankor.monitor.nop.NopRoutingTableMonitor" class="title">Uses of Class<br>at.irian.ankor.monitor.nop.NopRoutingTableMonitor</h2>
</div>
<div class="classUseContainer">No usage of at.irian.ankor.monitor.nop.NopRoutingTableMonitor</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../at/irian/ankor/monitor/nop/NopRoutingTableMonitor.html" title="class in at.irian.ankor.monitor.nop">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?at/irian/ankor/monitor/nop/class-use/NopRoutingTableMonitor.html" target="_top">Frames</a></li>
<li><a href="NopRoutingTableMonitor.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2014 <a href="https://github.com/orgs/ankor-io/teams/ankor-developers">Ankor Developers Team</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"content_hash": "e8a7355dd0aca5b49e83135507285fc7",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 175,
"avg_line_length": 39.52991452991453,
"alnum_prop": 0.6224864864864865,
"repo_name": "ankor-io/ankor-framework",
"id": "05a0f235c2273e4846eeaa8ae14579708e27e53f",
"size": "4625",
"binary": false,
"copies": "1",
"ref": "refs/heads/stable",
"path": "website/ankorsite/static/javadoc/apidocs-0.4/at/irian/ankor/monitor/nop/class-use/NopRoutingTableMonitor.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "526"
},
{
"name": "C",
"bytes": "12173"
},
{
"name": "C#",
"bytes": "157078"
},
{
"name": "CSS",
"bytes": "10636"
},
{
"name": "CoffeeScript",
"bytes": "48194"
},
{
"name": "HTML",
"bytes": "17806"
},
{
"name": "Java",
"bytes": "751745"
},
{
"name": "JavaScript",
"bytes": "290740"
},
{
"name": "Makefile",
"bytes": "811"
},
{
"name": "Objective-C",
"bytes": "114772"
},
{
"name": "PowerShell",
"bytes": "3261"
},
{
"name": "Python",
"bytes": "17835"
},
{
"name": "Shell",
"bytes": "36"
}
],
"symlink_target": ""
}
|
/* Created by MyDbUtils - 0.9.8.0 at 24-10-2015 15:36:04 */
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[VW_EmployeeDetails]'))
exec('CREATE VIEW [dbo].[VW_EmployeeDetails] AS SELECT 0 AS X')
GO
ALTER VIEW [dbo].[VW_EmployeeDetails]
AS
SELECT
e.*,
cast(case when e.LastName like '%smith' then 1 else 0 end as bit) as IsManager,
e.FirstName + ' ' + e.LastName as FullName,
cast(case when e.Assigned > 1 then 1 else 0 end as bit) as IsAssigned,
c.Code as CountryCode,
c.Name as CountryName
FROM dbo.KendoGrid_Employee as e
INNER JOIN dbo.KendoGrid_Country as c ON e.Country_Id = c.Id
GO
|
{
"content_hash": "3195cc26939410c1796e784e8d53eff5",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 99,
"avg_line_length": 36.705882352941174,
"alnum_prop": 0.7147435897435898,
"repo_name": "StefH/KendoGridBinderEx",
"id": "e3cf69400a4e84e41c0ac1d1866192bfc9b3a23e",
"size": "624",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "examples/KendoGridBinderEx.Examples.MVC/App_Data/Programmability.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "171281"
}
],
"symlink_target": ""
}
|
<?php
namespace app\models;
use Yii;
/**
* This is the model class for table "user".
*
* @property integer $id
* @property string $username
* @property string $password_hash
* @property string $auth_key
* @property string $access_token
*/
class User extends \yii\db\ActiveRecord implements \yii\web\IdentityInterface
{
public $password;
/**
* @inheritdoc
*/
public static function tableName()
{
return 'user';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['username'], 'required'],
[['password'],'required','except' => 'update'],
[['username'], 'string', 'max' => 128],
[['password'], 'string', 'max' => 20],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('app', 'ID'),
'username' => Yii::t('app', 'Username'),
'password_hash' => Yii::t('app', 'Password'),
'auth_key' => Yii::t('app', 'Auth Key'),
'access_token' => Yii::t('app', 'Access Token'),
'password' => Yii::t('app','Password'),
];
}
public function beforeSave($insert)
{
if(parent::beforeSave($insert)){
if($this->isNewRecord)
{
$this->password_hash = Yii::$app->getSecurity()->generatePasswordHash($this->password);
$this->auth_key = Yii::$app->getSecurity()->generateRandomString();
$this->access_token = Yii::$app->getSecurity()->generateRandomString();
} else {
if (!empty($this->password)){
$this->password_hash = Yii::$app->getSecurity()->generatePasswordHash($this->password);
}
}
return true;
}
else false;
}
/**
* @inheritdoc
*/
public static function findIdentity($id)
{
return self::findOne($id);
}
/**
* @inheritdoc
*/
public static function findIdentityByAccessToken($token, $type = null)
{
foreach (self::$users as $user) {
if ($user['access_token'] === $token) {
return new static($user);
}
}
return null;
}
/**
* Finds user by username
*
* @param string $username
* @return static|null
*/
public static function findByUsername($username)
{
return self::findOne(['username'=>$username]);
}
/**
* @inheritdoc
*/
public function getId()
{
return $this->id;
}
/**
* @inheritdoc
*/
public function getAuthKey()
{
return $this->auth_key;
}
/**
* @inheritdoc
*/
public function validateAuthKey($authKey)
{
return $this->auth_key === $authKey;
}
/**
* Validates password
*
* @param string $password password to validate
* @return boolean if password provided is valid for current user
*/
public function validatePassword($password)
{
return Yii::$app->getSecurity()->validatePassword($password,$this->password_hash);
}
}
|
{
"content_hash": "fa01452c48f0436b33ebdcbe93120bcc",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 107,
"avg_line_length": 22.62937062937063,
"alnum_prop": 0.5067985166872683,
"repo_name": "basp91/isics-register",
"id": "c70510799bad1a2051b4322f1ce2e45f4d9dd7a1",
"size": "3236",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "models/User.php",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "ApacheConf",
"bytes": "260"
},
{
"name": "Batchfile",
"bytes": "1030"
},
{
"name": "CSS",
"bytes": "1364"
},
{
"name": "PHP",
"bytes": "108974"
}
],
"symlink_target": ""
}
|
This is a client implementation of [NAT-PMP](http://tools.ietf.org/html/rfc6886)
For a server implementation suitable for Linux see [Stallone](https://github.com/tedjp/stallone)
Upon request NAT-PMP can open either a UDP or TCP port on the gateway and bidirectionally relay traffic to a specific external server.
## Usage
The GEM includes a command-line utility as well as Ruby classes and can be used in several ways
### To open a mapping from the command line
To open a mapping on specific ports use:
natpmp -p 1234
This command will hold the port open for the requested time, whereafter it _may_ be closed. To extend the mapping simply re-open it using the same port number.
### To run a command with a mapping
To run a command with specific port mappings:
natpmp -p 1234 'echo using the mapping && sleep 5'
The mapping will be held open until the command completes. The command string may contain the tokens %H, %P, %h and %p which will be substituted for the remote (uppercase) and local (lowercase) host (h) and ports (p). The ports can be automatically assigned by the command.
### Example Ruby Code
To open a port and run code using it:
require 'natpmp'
NATPMP.map 633, 13033, 10, :tcp do |map|
... # the mapping will be renewed until this exits
end
### Command Line Utility
The command line utility has the following options:
usage: natpmp [options] [command]
Open a port on a NAT-PMP gateway. Options:
-t, --type TYPE Type: tcp, udp (default: tcp)
-p, --port PORT Private port (default: auto)
--ttl TIME TTL if no command (default 7200 sec)
-P, --public PUBPORT External port (default: auto)
-v, --verbose Verbose
--version Version
In the command string the following substitutions will be made:
%p the local port
%h the local IP address
%P the gateway port
%H the gateway IP address
(Use %% to avoid this)
The mapping will be closed on completion of the command
-?, --help Display this screen
|
{
"content_hash": "025b70b62229b1306c394509762be5ac",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 273,
"avg_line_length": 43.58,
"alnum_prop": 0.6622303809086737,
"repo_name": "townsen/natpmp",
"id": "10e50ba079d3d1d21bba484b740fe9d64745186b",
"size": "2203",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "3486"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_151) on Wed Jun 10 10:20:13 MST 2020 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.wildfly.swarm.ee.security.detect (BOM: * : All 2.6.1.Final-SNAPSHOT API)</title>
<meta name="date" content="2020-06-10">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<h1 class="bar"><a href="../../../../../../org/wildfly/swarm/ee/security/detect/package-summary.html" target="classFrame">org.wildfly.swarm.ee.security.detect</a></h1>
<div class="indexContainer">
<h2 title="Classes">Classes</h2>
<ul title="Classes">
<li><a href="EESecurityPackageDetector.html" title="class in org.wildfly.swarm.ee.security.detect" target="classFrame">EESecurityPackageDetector</a></li>
</ul>
</div>
</body>
</html>
|
{
"content_hash": "804f4ca256cebb8f2fb01b2ca9d6b869",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 167,
"avg_line_length": 49.38095238095238,
"alnum_prop": 0.6702025072324012,
"repo_name": "wildfly-swarm/wildfly-swarm-javadocs",
"id": "56b0108bdf33319f3b223d67b88c280d73967542",
"size": "1037",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "2.6.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/ee/security/detect/package-frame.html",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
class Part < ActiveRecord::Base
attr_accessor :current_plugin
def remove_plugin!(plugin)
File.delete plugin_path(plugin) if File.file?( plugin_path(plugin) )
File.delete plugin_configuration_path(plugin) if File.file?( plugin_configuration_path(plugin) )
return true
end
def plugin_path(plugin)
File.join(RAILS_ROOT,'vendor','plugins',plugin,'app','views', PartsDir, filename_with_extention)
end
def plugin_configuration_path(plugin)
configuration_path_of plugin_path(plugin)
end
end
|
{
"content_hash": "83f2c23e067fca2f899c29ecd77e3da2",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 100,
"avg_line_length": 29,
"alnum_prop": 0.7318007662835249,
"repo_name": "niklas/Tirade",
"id": "200dab041926d68a0d51fc163dc057832c2b7786",
"size": "522",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/models/part/plugin.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "513567"
},
{
"name": "Ruby",
"bytes": "479346"
}
],
"symlink_target": ""
}
|
package com.intellij.uiDesigner;
import com.intellij.uiDesigner.radComponents.RadComponent;
import com.intellij.uiDesigner.radComponents.RadContainer;
import com.intellij.uiDesigner.radComponents.RadRootContainer;
import com.intellij.uiDesigner.designSurface.GuiEditor;
import javax.annotation.Nonnull;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
/**
* @author Anton Katilin
* @author Vladimir Kondratyev
*/
public abstract class SelectionWatcher {
private final MyPropertyChangeListener myChangeListener;
private RadRootContainer myRootContainer;
private final GuiEditor myEditor;
private final HierarchyChangeListener myHierarchyChangeListener;
public SelectionWatcher(final GuiEditor editor) {
myEditor = editor;
myChangeListener = new MyPropertyChangeListener();
myRootContainer = editor.getRootContainer();
install(myRootContainer);
myHierarchyChangeListener = new HierarchyChangeListener() {
public void hierarchyChanged() {
if (myRootContainer != editor.getRootContainer()) {
deinstall(myRootContainer);
myRootContainer = editor.getRootContainer();
install(myRootContainer);
}
}
};
editor.addHierarchyChangeListener(myHierarchyChangeListener);
}
public void dispose() {
deinstall(myRootContainer);
myEditor.removeHierarchyChangeListener(myHierarchyChangeListener);
}
private void install(@Nonnull final RadComponent component){
component.addPropertyChangeListener(myChangeListener);
if(component instanceof RadContainer){
final RadContainer container = (RadContainer)component;
for(int i = container.getComponentCount() - 1; i>= 0; i--){
install(container.getComponent(i));
}
}
}
private void deinstall(@Nonnull final RadComponent component){
component.removePropertyChangeListener(myChangeListener);
if(component instanceof RadContainer){
final RadContainer container = (RadContainer)component;
for(int i = container.getComponentCount() - 1; i>= 0; i--){
deinstall(container.getComponent(i));
}
}
}
protected abstract void selectionChanged(RadComponent component, boolean selected);
private final class MyPropertyChangeListener implements PropertyChangeListener{
public void propertyChange(final PropertyChangeEvent e) {
if(RadComponent.PROP_SELECTED.equals(e.getPropertyName())){
final Boolean selected = (Boolean)e.getNewValue();
selectionChanged((RadComponent)e.getSource(), selected.booleanValue());
}
else if(RadContainer.PROP_CHILDREN.equals(e.getPropertyName())){
final RadComponent[] oldChildren = (RadComponent[])e.getOldValue();
for(int i = oldChildren.length - 1; i >= 0; i--){
deinstall(oldChildren[i]);
}
final RadComponent[] newChildren = (RadComponent[])e.getNewValue();
for(int i = newChildren.length - 1; i >= 0; i--){
install(newChildren[i]);
}
}
}
}
}
|
{
"content_hash": "fecf81490c68ee3ae638cd9df1a2f0cb",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 85,
"avg_line_length": 35.02298850574713,
"alnum_prop": 0.722678043977683,
"repo_name": "consulo/consulo-ui-designer",
"id": "03aedae3c679bd2f977de81686b4a1d32135cdd1",
"size": "3647",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/main/java/com/intellij/uiDesigner/SelectionWatcher.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "2298"
},
{
"name": "Java",
"bytes": "2152160"
}
],
"symlink_target": ""
}
|
import { shallow } from "enzyme";
import { shallowToJson } from "enzyme-to-json";
import { nav as navActions } from "../../../../data/store";
import { TemplateWithoutData } from "../";
jest.mock("../../../../deprecated/mixins/mixins.Header", () => {});
jest.mock("../../../../data/store", () => ({
nav: {
setLevel: jest.fn(),
},
}));
const defaultProps = {
dispatch: jest.fn(),
router: {
push: jest.fn(),
},
location: {
query: {},
},
attributes: {
tags: [{}, {}],
},
autofill: {
loading: false,
person: {
campus: {
name: "Anderson",
},
home: {
zip: "29607",
},
},
campuses: [],
},
content: {
loading: false,
entries: [{}, {}],
},
};
const generateComponent = (additionalProps = {}) => {
const newProps = {
...defaultProps,
...additionalProps,
};
return <TemplateWithoutData {...newProps} />;
};
it("renders with props", () => {
const wrapper = shallow(generateComponent());
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it("renders result if tags", () => {
const wrapper = shallow(
generateComponent({
location: {
query: {
tags: [{}],
},
},
}),
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it("renders result if q", () => {
const wrapper = shallow(
generateComponent({
location: {
query: {
q: "test",
},
},
}),
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it("renders result if campuses", () => {
const wrapper = shallow(
generateComponent({
location: {
query: {
campuses: [{}],
},
},
}),
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it("renders result if schedules", () => {
const wrapper = shallow(
generateComponent({
location: {
query: {
schedules: [{}],
},
},
}),
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it("renders without attributes", () => {
const wrapper = shallow(
generateComponent({
attributes: null,
}),
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it("renders if content loading", () => {
const wrapper = shallow(
generateComponent({
content: {
loading: true,
},
}),
);
expect(shallowToJson(wrapper)).toMatchSnapshot();
});
it("updates nav on mount", () => {
const mockDispatch = jest.fn();
navActions.setLevel = jest.fn();
const wrapper = shallow(
generateComponent({
dispatch: mockDispatch,
}),
);
expect(mockDispatch).toHaveBeenCalledTimes(1);
expect(navActions.setLevel).toHaveBeenCalledTimes(1);
expect(navActions.setLevel).toHaveBeenCalledWith("TOP");
});
it("set content level nav when recieving props with location query", () => {
const mockDispatch = jest.fn();
navActions.setLevel = jest.fn();
const wrapper = shallow(
generateComponent({
dispatch: mockDispatch,
}),
);
wrapper.setProps({
location: {
query: {
q: "test",
},
},
});
expect(mockDispatch).toHaveBeenCalledTimes(2);
expect(navActions.setLevel).toHaveBeenCalledTimes(2);
expect(navActions.setLevel).toHaveBeenCalledWith("TOP");
});
it("set top level nav when recieving props without location query", () => {
const mockDispatch = jest.fn();
navActions.setLevel = jest.fn();
const wrapper = shallow(
generateComponent({
dispatch: mockDispatch,
}),
);
wrapper.setProps({
location: {
query: {},
},
});
expect(mockDispatch).toHaveBeenCalledTimes(2);
expect(navActions.setLevel).toHaveBeenCalledTimes(2);
expect(navActions.setLevel).toHaveBeenCalledWith("TOP");
});
xit("getResults resets state", () => {
const wrapper = shallow(generateComponent());
wrapper.setState({ tags: ["test"], query: "test" });
wrapper.instance().getResults();
expect(wrapper.state().tags).toEqual([]);
expect(wrapper.state().query).toBe(null);
});
it("getResults calls router with q and tags", () => {
const mockPush = jest.fn();
const wrapper = shallow(
generateComponent({
router: {
push: mockPush,
},
}),
);
wrapper.setState({ query: "one and two" });
wrapper.instance().getResults();
expect(mockPush).toHaveBeenCalledTimes(2);
});
it("inputOnChange updates tags and query", () => {
const wrapper = shallow(generateComponent());
wrapper.setState({ tags: ["one"], query: null });
wrapper.instance().inputOnChange("test", { name: "query" });
expect(wrapper.state().query).toEqual("test");
});
it("tagOnClick adds tag to state if not found", () => {
const wrapper = shallow(generateComponent());
wrapper.instance().tagOnClick("one");
expect(wrapper.state().query).toEqual("one");
});
it("tagOnClick removes tag from state if found", () => {
const wrapper = shallow(generateComponent());
wrapper.setState({ query: "one and two" });
wrapper.instance().tagOnClick("one");
expect(wrapper.state().query).toEqual("and two");
});
it("submitForm calls preventDefault", () => {
const wrapper = shallow(generateComponent());
const mockPreventDefault = jest.fn();
wrapper.instance().submitForm({
type: "click",
preventDefault: mockPreventDefault,
});
expect(mockPreventDefault).toHaveBeenCalledTimes(1);
});
// this test doesn't follow current UI pattern
// it("findByQuery calls preventDefault and blurs the search", () => {
// const mockPreventDefault = jest.fn();
// const mockBlur = jest.fn();
// const mockGetElementById = jest.fn().mockReturnValue({
// blur: mockBlur,
// });
// document.getElementById = mockGetElementById;
// const wrapper = shallow(generateComponent());
// wrapper.instance().findByQuery({
// preventDefault: mockPreventDefault,
// });
// expect(mockPreventDefault).toHaveBeenCalledTimes(1);
// expect(mockGetElementById).toHaveBeenCalledTimes(1);
// expect(mockGetElementById).toHaveBeenCalledWith("search");
// expect(mockBlur).toHaveBeenCalledTimes(1);
// });
|
{
"content_hash": "8b5fe5fa2ad7312ab34a928fc474bee4",
"timestamp": "",
"source": "github",
"line_count": 246,
"max_line_length": 76,
"avg_line_length": 24.670731707317074,
"alnum_prop": 0.6145987806887461,
"repo_name": "NewSpring/apollos-core",
"id": "e6868e3319b3ef901c75aedcbcecaa8977732ea0",
"size": "6069",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "imports/pages/groups/finder/__tests__/index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14395"
},
{
"name": "JavaScript",
"bytes": "615261"
}
],
"symlink_target": ""
}
|
using Llvm.NET.Native;
namespace Llvm.NET.Instructions
{
class SIToFP : Cast
{
internal SIToFP( LLVMValueRef valueRef )
: base( valueRef )
{
}
}
}
|
{
"content_hash": "003e068ac5b1ba7dcafd17b8f35c1569",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 48,
"avg_line_length": 17.416666666666668,
"alnum_prop": 0.5119617224880383,
"repo_name": "jelin1/llilum",
"id": "5615188371a58757532fa841740035fe977e99e2",
"size": "211",
"binary": false,
"copies": "5",
"ref": "refs/heads/dev",
"path": "Zelig/Zelig/CompileTime/Llvm.NET/Llvm.NET/Instructions/SIToFP.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "93636"
},
{
"name": "Batchfile",
"bytes": "34786"
},
{
"name": "C",
"bytes": "20007017"
},
{
"name": "C#",
"bytes": "24168129"
},
{
"name": "C++",
"bytes": "1934796"
},
{
"name": "Makefile",
"bytes": "74189"
},
{
"name": "Objective-C",
"bytes": "403"
},
{
"name": "Smalltalk",
"bytes": "170596"
}
],
"symlink_target": ""
}
|
package winstanley.psi
import com.intellij.extapi.psi.PsiFileBase
import com.intellij.openapi.fileTypes.FileType
import com.intellij.psi.FileViewProvider
import winstanley.WdlFileType
import winstanley.WdlLanguage
import org.jetbrains.annotations.NotNull
import javax.swing._
class WdlFile(@NotNull viewProvider: FileViewProvider) extends PsiFileBase(viewProvider, WdlLanguage.INSTANCE) {
@NotNull
override def getFileType: FileType = WdlFileType.INSTANCE
override def toString: String = "WDL File"
override def getIcon(flags: Int): Icon = super.getIcon(flags)
}
|
{
"content_hash": "52cfaeaa1ec6a825a9038917aaadf981",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 112,
"avg_line_length": 28.8,
"alnum_prop": 0.8177083333333334,
"repo_name": "broadinstitute/winstanley",
"id": "1cde99c4f610dd3f8cf01114487e739d19657a23",
"size": "576",
"binary": false,
"copies": "2",
"ref": "refs/heads/develop",
"path": "src/winstanley/psi/WdlFile.scala",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "186"
},
{
"name": "Lex",
"bytes": "11212"
},
{
"name": "Scala",
"bytes": "48560"
},
{
"name": "wdl",
"bytes": "19771"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>hammer-tactics: 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.14.1 / hammer-tactics - 1.3+8.10</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
hammer-tactics
<small>
1.3+8.10
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-05-02 02:27:03 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-05-02 02:27:03 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
conf-findutils 1 Virtual package relying on findutils
conf-gmp 4 Virtual package relying on a GMP lib system installation
coq 8.14.1 Formal proof management system
dune 3.1.1 Fast, portable, and opinionated build system
ocaml 4.11.2 The OCaml compiler (virtual package)
ocaml-base-compiler 4.11.2 Official release 4.11.2
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.3 A library manager for OCaml
zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers
# opam file:
opam-version: "2.0"
maintainer: "palmskog@gmail.com"
homepage: "https://github.com/lukaszcz/coqhammer"
dev-repo: "git+https://github.com/lukaszcz/coqhammer.git"
bug-reports: "https://github.com/lukaszcz/coqhammer/issues"
license: "LGPL-2.1-only"
synopsis: "Reconstruction tactics for the hammer for Coq"
description: """
Collection of tactics that are used by the hammer for Coq
to reconstruct proofs found by automated theorem provers. When the hammer
has been successfully applied to a project, only this package needs
to be installed; the hammer plugin is not required.
"""
build: [make "-j%{jobs}%" {ocaml:version >= "4.06"} "tactics"]
install: [
[make "install-tactics"]
[make "test-tactics"] {with-test}
]
depends: [
"ocaml"
"coq" {>= "8.10" & < "8.11~"}
]
conflicts: [
"coq-hammer" {!= version}
]
tags: [
"keyword:automation"
"keyword:hammer"
"keyword:tactics"
"logpath:Hammer.Tactics"
"date:2020-07-28"
]
authors: [
"Lukasz Czajka <lukaszcz@mimuw.edu.pl>"
]
url {
src: "https://github.com/lukaszcz/coqhammer/archive/refs/tags/v1.3-coq8.10.tar.gz"
checksum: "sha512=b0b725a1a8d4a470f49d72be8b156a7ecf9f2694c1228483d6eebfcef89c262128e5694010c54039449b4fe6b4b36f1184deb45cc0b7dc109aaa8dfef2f293fc"
}
</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-hammer-tactics.1.3+8.10 coq.8.14.1</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.14.1).
The following dependencies couldn't be met:
- coq-hammer-tactics -> coq < 8.11~ -> 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-hammer-tactics.1.3+8.10</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "231dee99bcc250de2a4e067cb66ebfbe",
"timestamp": "",
"source": "github",
"line_count": 179,
"max_line_length": 159,
"avg_line_length": 40.642458100558656,
"alnum_prop": 0.5540893470790378,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "7316e3781a80a947d05911fb86a76b808a6a77dc",
"size": "7300",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.11.2-2.0.7/released/8.14.1/hammer-tactics/1.3+8.10.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
#include "splashscreen.h"
#include "clientversion.h"
#include "util.h"
#include <QPainter>
#undef loop /* ugh, remove this when the #define loop is gone from util.h */
#include <QApplication>
SplashScreen::SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) :
QSplashScreen(pixmap, f)
{
// set reference point, paddings
int paddingLeftCol2 = 230;
int paddingTopCol2 = 376;
int line1 = 0;
int line2 = 13;
int line3 = 26;
float fontFactor = 1.0;
// define text to place
QString titleText = QString(QApplication::applicationName()).replace(QString("-testnet"), QString(""), Qt::CaseSensitive); // cut of testnet, place it as single object further down
QString versionText = QString("Version %1 ").arg(QString::fromStdString(FormatFullVersion()));
QString copyrightText1 = QChar(0xA9)+QString(" 2009-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The Bitcoin developers"));
QString copyrightText2 = QChar(0xA9)+QString(" 2011-%1 ").arg(COPYRIGHT_YEAR) + QString(tr("The sCoin developers"));
QString font = "Arial";
// load the bitmap for writing some text over it
QPixmap newPixmap;
if(GetBoolArg("-testnet")) {
newPixmap = QPixmap(":/images/splash_testnet");
}
else {
newPixmap = QPixmap(":/images/splash");
}
QPainter pixPaint(&newPixmap);
pixPaint.setPen(QColor(70,70,70));
pixPaint.setFont(QFont(font, 9*fontFactor));
pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line3,versionText);
// draw copyright stuff
pixPaint.setFont(QFont(font, 9*fontFactor));
pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line1,copyrightText1);
pixPaint.drawText(paddingLeftCol2,paddingTopCol2+line2,copyrightText2);
pixPaint.end();
this->setPixmap(newPixmap);
}
|
{
"content_hash": "094f54b4c7660c74e5b4a89b932691ba",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 190,
"avg_line_length": 35.57692307692308,
"alnum_prop": 0.6724324324324324,
"repo_name": "nakamotoSAMtoshi/sCoin",
"id": "33d4ef590b0b72e2fe88b4df4aec3b89cc03399a",
"size": "1850",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/qt/splashscreen.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "102799"
},
{
"name": "C++",
"bytes": "2515148"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "IDL",
"bytes": "14684"
},
{
"name": "Objective-C",
"bytes": "5864"
},
{
"name": "Python",
"bytes": "69706"
},
{
"name": "Shell",
"bytes": "9702"
},
{
"name": "TypeScript",
"bytes": "5236293"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/MinimumDepthOfBinaryTree.iml" filepath="$PROJECT_DIR$/.idea/MinimumDepthOfBinaryTree.iml" />
</modules>
</component>
</project>
|
{
"content_hash": "3b07b0b24a8a9ae9ed63d136ec0736a2",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 142,
"avg_line_length": 37.5,
"alnum_prop": 0.6966666666666667,
"repo_name": "busebd12/InterviewPreparation",
"id": "9286de9c76fffd7c167909b12075ea5b2787ab07",
"size": "300",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "LeetCode/C++/General/Easy/MinimumDepthOfBinaryTree/.idea/modules.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "9011022"
},
{
"name": "C++",
"bytes": "14785379"
},
{
"name": "CMake",
"bytes": "10099860"
},
{
"name": "Java",
"bytes": "54365"
},
{
"name": "Makefile",
"bytes": "5154401"
},
{
"name": "TeX",
"bytes": "41241"
}
],
"symlink_target": ""
}
|
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import hashlib
import os
from resource_management.core.resources import Directory
from resource_management.core.resources import File
from resource_management.core.resources.system import Execute
from resource_management.core.source import DownloadSource
from resource_management.core.source import InlineTemplate
from resource_management.core.source import Template
from resource_management.libraries.functions import format
from resource_management.libraries.functions import compare_versions
from resource_management.libraries.resources.xml_config import XmlConfig
from resource_management.core.resources.packaging import Package
from resource_management.core.shell import as_user
# TODO: see if see can remove this
def oozie(is_server=False):
import params
if is_server:
params.HdfsResource(params.oozie_hdfs_user_dir,
type="directory",
action="create_on_execute",
owner=params.oozie_user,
mode=params.oozie_hdfs_user_mode
)
params.HdfsResource(None, action="execute")
Directory(params.conf_dir,
create_parents = True,
owner = params.oozie_user,
group = params.user_group
)
XmlConfig("oozie-site.xml",
conf_dir = params.conf_dir,
configurations = params.oozie_site,
configuration_attributes=params.config['configuration_attributes']['oozie-site'],
owner = params.oozie_user,
group = params.user_group,
mode = 0660
)
File(format("{conf_dir}/oozie-env.sh"),
owner=params.oozie_user,
content=InlineTemplate(params.oozie_env_sh_template),
group=params.user_group,
)
if (params.log4j_props != None):
File(format("{params.conf_dir}/oozie-log4j.properties"),
mode=0644,
group=params.user_group,
owner=params.oozie_user,
content=params.log4j_props
)
elif (os.path.exists(format("{params.conf_dir}/oozie-log4j.properties"))):
File(format("{params.conf_dir}/oozie-log4j.properties"),
mode=0644,
group=params.user_group,
owner=params.oozie_user
)
File(format("{params.conf_dir}/adminusers.txt"),
mode=0644,
group=params.user_group,
owner=params.oozie_user,
content=Template('adminusers.txt.j2', oozie_user=params.oozie_user)
)
environment = {
"no_proxy": format("{ambari_server_hostname}")
}
if params.jdbc_driver_name == "com.mysql.jdbc.Driver" or \
params.jdbc_driver_name == "org.postgresql.Driver" or \
params.jdbc_driver_name == "oracle.jdbc.driver.OracleDriver":
File(format("/usr/lib/ambari-agent/{check_db_connection_jar_name}"),
content = DownloadSource(format("{jdk_location}/{check_db_connection_jar_name}")),
)
pass
oozie_ownership()
if is_server:
oozie_server_specific()
def download_database_library_if_needed():
"""
Downloads the library to use when connecting to the Oozie database, if
necessary. The library will be downloaded to 'params.target' unless
otherwise specified.
:param target_directory: the location where the database library will be
downloaded to.
:return:
"""
import params
# check to see if the JDBC driver name is in the list of ones that need to
# be downloaded
if params.jdbc_driver_name=="com.mysql.jdbc.Driver" or \
params.jdbc_driver_name=="oracle.jdbc.driver.OracleDriver":
File(params.downloaded_custom_connector,
content = DownloadSource(params.driver_curl_source),
)
Execute(('cp', '--remove-destination', params.downloaded_custom_connector, params.target),
#creates=params.target, TODO: uncomment after ranger_hive_plugin will not provide jdbc
path=["/bin", "/usr/bin/"],
sudo = True)
File ( params.target,
owner = params.oozie_user,
group = params.user_group
)
def oozie_ownership():
import params
File ( format("{conf_dir}/hadoop-config.xml"),
owner = params.oozie_user,
group = params.user_group
)
File ( format("{conf_dir}/oozie-default.xml"),
owner = params.oozie_user,
group = params.user_group,
mode = 0644
)
Directory ( format("{conf_dir}/action-conf"),
owner = params.oozie_user,
group = params.user_group
)
File ( format("{conf_dir}/action-conf/hive.xml"),
owner = params.oozie_user,
group = params.user_group
)
def oozie_server_specific():
import params
no_op_test = as_user(format("ls {pid_file} >/dev/null 2>&1 && ps -p `cat {pid_file}` >/dev/null 2>&1"), user=params.oozie_user)
File(params.pid_file,
action="delete",
not_if=no_op_test
)
oozie_server_directories = [format("{oozie_home}/{oozie_tmp_dir}"), params.oozie_pid_dir, params.oozie_log_dir, params.oozie_tmp_dir, params.oozie_data_dir, params.oozie_lib_dir, params.oozie_webapps_dir, params.oozie_webapps_conf_dir, params.oozie_server_dir]
Directory( oozie_server_directories,
owner = params.oozie_user,
group = params.user_group,
mode = 0755,
create_parents = True,
cd_access="a",
)
Directory(params.oozie_libext_dir,
create_parents=True,
)
hashcode_file = format("{oozie_home}/.hashcode")
hashcode = hashlib.md5(format('{oozie_home}/oozie-sharelib.tar.gz')).hexdigest()
skip_recreate_sharelib = format("test -f {hashcode_file} && test -d {oozie_home}/share && [[ `cat {hashcode_file}` == '{hashcode}' ]]")
untar_sharelib = ('tar','-xvf',format('{oozie_home}/oozie-sharelib.tar.gz'),'-C',params.oozie_home)
Execute( untar_sharelib, # time-expensive
not_if = format("{no_op_test} || {skip_recreate_sharelib}"),
sudo = True,
)
configure_cmds = []
#configure_cmds.append(('tar','-xvf',format('{oozie_home}/oozie-sharelib.tar.gz'),'-C',params.oozie_home))
#configure_cmds.append(('cp', params.ext_js_path, params.oozie_libext_dir))
#configure_cmds.append(('chown', format('{oozie_user}:{user_group}'), format('{oozie_libext_dir}/{ext_js_file}')))
configure_cmds.append(('chown', '-RL', format('{oozie_user}:{user_group}'), params.oozie_webapps_conf_dir))
Execute( configure_cmds,
not_if = no_op_test,
sudo = True,
)
if params.jdbc_driver_name=="com.mysql.jdbc.Driver" or \
params.jdbc_driver_name=="oracle.jdbc.driver.OracleDriver":
File(params.downloaded_custom_connector,
content = DownloadSource(params.driver_curl_source),
)
Execute(('cp', '--remove-destination', params.downloaded_custom_connector, params.target),
#creates=params.target, TODO: uncomment after ranger_hive_plugin will not provide jdbc
path=["/bin", "/usr/bin/"],
sudo = True)
File ( params.target,
owner = params.oozie_user,
group = params.user_group
)
#falcon el extension
if params.has_falcon_host:
Execute(format('rm -rf {oozie_libext_dir}/falcon-oozie-el-extension.jar'),)
if params.security_enabled:
Execute(format('/usr/bin/kinit -kt /etc/security/keytabs/hdfs.headless.keytab {hdfs_principal_name}'))
Execute(format('hadoop fs -get /user/falcon/temp/falcon-oozie-el-extension.jar {oozie_libext_dir}'),
not_if = no_op_test,
)
Execute(format('{sudo} chown {oozie_user}:{user_group} {oozie_libext_dir}/falcon-oozie-el-extension.jar'),
not_if = no_op_test,
)
#if params.lzo_enabled and len(params.lzo_packages_for_current_host) > 0:
# Package(params.lzo_packages_for_current_host)
# Execute(format('{sudo} cp {hadoop_lib_home}/hadoop-lzo*.jar {oozie_lib_dir}'),
# not_if = no_op_test,
# )
prepare_war_cmd_file = format("{oozie_home}/.prepare_war_cmd")
prepare_war_cmd = format("cd {oozie_tmp_dir} && {oozie_setup_sh} prepare-war {oozie_secure}")
skip_prepare_war_cmd = format("test -f {prepare_war_cmd_file} && [[ `cat {prepare_war_cmd_file}` == '{prepare_war_cmd}' ]]")
Execute(prepare_war_cmd, # time-expensive
user = params.oozie_user,
not_if = format("{no_op_test} || {skip_recreate_sharelib} && {skip_prepare_war_cmd}")
)
File(hashcode_file,
content = hashcode,
mode = 0644,
)
File(prepare_war_cmd_file,
content = prepare_war_cmd,
mode = 0644,
)
# Create hive-site and tez-site configs for oozie
Directory(params.hive_conf_dir,
create_parents = True,
owner = params.oozie_user,
group = params.user_group
)
if 'hive-site' in params.config['configurations']:
XmlConfig("hive-site.xml",
conf_dir=params.hive_conf_dir,
configurations=params.config['configurations']['hive-site'],
configuration_attributes=params.config['configuration_attributes']['hive-site'],
owner=params.oozie_user,
group=params.user_group,
mode=0640
)
'''if 'tez-site' in params.config['configurations']:
XmlConfig( "tez-site.xml",
conf_dir = params.hive_conf_dir,
configurations = params.config['configurations']['tez-site'],
configuration_attributes=params.config['configuration_attributes']['tez-site'],
owner = params.oozie_user,
group = params.user_group,
mode = 0664
)'''
Execute(('chown', '-R', format("{oozie_user}:{user_group}"), params.oozie_server_dir),
sudo=True
)
|
{
"content_hash": "a7ec4762efa7a1418fee4761cf2f710f",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 262,
"avg_line_length": 35.94964028776978,
"alnum_prop": 0.6748048829297578,
"repo_name": "arenadata/ambari",
"id": "43db1ecccf5b31c5311c2a076cf0ef895047d6c0",
"size": "10016",
"binary": false,
"copies": "1",
"ref": "refs/heads/branch-adh-1.6",
"path": "ambari-server/src/main/resources/stacks/BigInsights/4.0/services/OOZIE/package/scripts/oozie.py",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "46700"
},
{
"name": "C",
"bytes": "331204"
},
{
"name": "C#",
"bytes": "215907"
},
{
"name": "C++",
"bytes": "257"
},
{
"name": "CSS",
"bytes": "343739"
},
{
"name": "CoffeeScript",
"bytes": "8465"
},
{
"name": "Dockerfile",
"bytes": "6387"
},
{
"name": "EJS",
"bytes": "777"
},
{
"name": "FreeMarker",
"bytes": "2654"
},
{
"name": "Gherkin",
"bytes": "990"
},
{
"name": "Groovy",
"bytes": "15882"
},
{
"name": "HTML",
"bytes": "717983"
},
{
"name": "Handlebars",
"bytes": "1819641"
},
{
"name": "Java",
"bytes": "29172298"
},
{
"name": "JavaScript",
"bytes": "18571926"
},
{
"name": "Jinja",
"bytes": "1490416"
},
{
"name": "Less",
"bytes": "412933"
},
{
"name": "Makefile",
"bytes": "11111"
},
{
"name": "PHP",
"bytes": "149648"
},
{
"name": "PLpgSQL",
"bytes": "287501"
},
{
"name": "PowerShell",
"bytes": "2090340"
},
{
"name": "Python",
"bytes": "18507704"
},
{
"name": "R",
"bytes": "3943"
},
{
"name": "Ruby",
"bytes": "38590"
},
{
"name": "SCSS",
"bytes": "40072"
},
{
"name": "Shell",
"bytes": "924115"
},
{
"name": "Stylus",
"bytes": "820"
},
{
"name": "TSQL",
"bytes": "42351"
},
{
"name": "Vim script",
"bytes": "5813"
},
{
"name": "sed",
"bytes": "2303"
}
],
"symlink_target": ""
}
|
package org.elasticsearch.xpack.core.ml.job.results;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.xcontent.ConstructingObjectParser;
import org.elasticsearch.xcontent.ObjectParser.ValueType;
import org.elasticsearch.xcontent.ParseField;
import org.elasticsearch.xcontent.ToXContentObject;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xpack.core.ml.job.config.Job;
import java.io.IOException;
import java.time.Instant;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
/**
* Model ForecastRequestStats POJO.
*
* This information is produced by the autodetect process and contains
* information about errors, progress and counters. There is exactly 1 document
* per forecast request, getting updated while the request is processed.
*/
public class ForecastRequestStats implements ToXContentObject, Writeable {
/**
* Result type
*/
public static final String RESULT_TYPE_VALUE = "model_forecast_request_stats";
public static final ParseField RESULTS_FIELD = new ParseField(RESULT_TYPE_VALUE);
public static final ParseField FORECAST_ID = new ParseField("forecast_id");
public static final ParseField START_TIME = new ParseField("forecast_start_timestamp");
public static final ParseField END_TIME = new ParseField("forecast_end_timestamp");
public static final ParseField CREATE_TIME = new ParseField("forecast_create_timestamp");
public static final ParseField EXPIRY_TIME = new ParseField("forecast_expiry_timestamp");
public static final ParseField MESSAGES = new ParseField("forecast_messages");
public static final ParseField PROCESSING_TIME_MS = new ParseField("processing_time_ms");
public static final ParseField PROGRESS = new ParseField("forecast_progress");
public static final ParseField PROCESSED_RECORD_COUNT = new ParseField("processed_record_count");
public static final ParseField STATUS = new ParseField("forecast_status");
public static final ParseField MEMORY_USAGE = new ParseField("forecast_memory_bytes");
public static final ConstructingObjectParser<ForecastRequestStats, Void> STRICT_PARSER = createParser(false);
public static final ConstructingObjectParser<ForecastRequestStats, Void> LENIENT_PARSER = createParser(true);
private static ConstructingObjectParser<ForecastRequestStats, Void> createParser(boolean ignoreUnknownFields) {
ConstructingObjectParser<ForecastRequestStats, Void> parser = new ConstructingObjectParser<>(
RESULT_TYPE_VALUE,
ignoreUnknownFields,
a -> new ForecastRequestStats((String) a[0], (String) a[1])
);
parser.declareString(ConstructingObjectParser.constructorArg(), Job.ID);
parser.declareString(ConstructingObjectParser.constructorArg(), FORECAST_ID);
parser.declareString((modelForecastRequestStats, s) -> {}, Result.RESULT_TYPE);
parser.declareLong(ForecastRequestStats::setRecordCount, PROCESSED_RECORD_COUNT);
parser.declareStringArray(ForecastRequestStats::setMessages, MESSAGES);
parser.declareField(ForecastRequestStats::setTimeStamp, p -> Instant.ofEpochMilli(p.longValue()), Result.TIMESTAMP, ValueType.LONG);
parser.declareField(ForecastRequestStats::setStartTime, p -> Instant.ofEpochMilli(p.longValue()), START_TIME, ValueType.LONG);
parser.declareField(ForecastRequestStats::setEndTime, p -> Instant.ofEpochMilli(p.longValue()), END_TIME, ValueType.LONG);
parser.declareField(ForecastRequestStats::setCreateTime, p -> Instant.ofEpochMilli(p.longValue()), CREATE_TIME, ValueType.LONG);
parser.declareField(ForecastRequestStats::setExpiryTime, p -> Instant.ofEpochMilli(p.longValue()), EXPIRY_TIME, ValueType.LONG);
parser.declareDouble(ForecastRequestStats::setProgress, PROGRESS);
parser.declareLong(ForecastRequestStats::setProcessingTime, PROCESSING_TIME_MS);
parser.declareField(ForecastRequestStats::setStatus, p -> ForecastRequestStatus.fromString(p.text()), STATUS, ValueType.STRING);
parser.declareLong(ForecastRequestStats::setMemoryUsage, MEMORY_USAGE);
return parser;
}
public enum ForecastRequestStatus implements Writeable {
OK,
FAILED,
STOPPED,
STARTED,
FINISHED,
SCHEDULED;
public static ForecastRequestStatus fromString(String statusName) {
return valueOf(statusName.trim().toUpperCase(Locale.ROOT));
}
public static ForecastRequestStatus readFromStream(StreamInput in) throws IOException {
return in.readEnum(ForecastRequestStatus.class);
}
/**
* @return {@code true} if state matches any of the given {@code candidates}
*/
public boolean isAnyOf(ForecastRequestStatus... candidates) {
return Arrays.stream(candidates).anyMatch(candidate -> this == candidate);
}
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeEnum(this);
}
@Override
public String toString() {
return name().toLowerCase(Locale.ROOT);
}
}
private final String jobId;
private final String forecastId;
private long recordCount;
private List<String> messages;
private Instant timestamp = Instant.EPOCH;
private Instant startTime = Instant.EPOCH;
private Instant endTime = Instant.EPOCH;
private Instant createTime = Instant.EPOCH;
private Instant expiryTime = Instant.EPOCH;
private double progress;
private long processingTime;
private long memoryUsage;
private ForecastRequestStatus status = ForecastRequestStatus.OK;
public ForecastRequestStats(String jobId, String forecastId) {
this.jobId = Objects.requireNonNull(jobId);
this.forecastId = Objects.requireNonNull(forecastId);
}
public ForecastRequestStats(ForecastRequestStats forecastRequestStats) {
this.jobId = forecastRequestStats.jobId;
this.forecastId = forecastRequestStats.forecastId;
this.recordCount = forecastRequestStats.recordCount;
this.messages = forecastRequestStats.messages;
this.timestamp = forecastRequestStats.timestamp;
this.startTime = forecastRequestStats.startTime;
this.endTime = forecastRequestStats.endTime;
this.createTime = forecastRequestStats.createTime;
this.expiryTime = forecastRequestStats.expiryTime;
this.progress = forecastRequestStats.progress;
this.processingTime = forecastRequestStats.processingTime;
this.memoryUsage = forecastRequestStats.memoryUsage;
this.status = forecastRequestStats.status;
}
public ForecastRequestStats(StreamInput in) throws IOException {
jobId = in.readString();
forecastId = in.readString();
recordCount = in.readLong();
if (in.readBoolean()) {
messages = in.readStringList();
} else {
messages = null;
}
timestamp = in.readInstant();
startTime = in.readInstant();
endTime = in.readInstant();
createTime = in.readInstant();
expiryTime = in.readInstant();
progress = in.readDouble();
processingTime = in.readLong();
setMemoryUsage(in.readLong());
status = ForecastRequestStatus.readFromStream(in);
}
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(jobId);
out.writeString(forecastId);
out.writeLong(recordCount);
if (messages != null) {
out.writeBoolean(true);
out.writeStringCollection(messages);
} else {
out.writeBoolean(false);
}
out.writeInstant(timestamp);
out.writeInstant(startTime);
out.writeInstant(endTime);
out.writeInstant(createTime);
out.writeInstant(expiryTime);
out.writeDouble(progress);
out.writeLong(processingTime);
out.writeLong(getMemoryUsage());
status.writeTo(out);
}
@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
builder.field(Job.ID.getPreferredName(), jobId);
builder.field(Result.RESULT_TYPE.getPreferredName(), RESULT_TYPE_VALUE);
builder.field(FORECAST_ID.getPreferredName(), forecastId);
builder.field(PROCESSED_RECORD_COUNT.getPreferredName(), recordCount);
if (messages != null) {
builder.field(MESSAGES.getPreferredName(), messages);
}
if (timestamp.equals(Instant.EPOCH) == false) {
builder.field(Result.TIMESTAMP.getPreferredName(), timestamp.toEpochMilli());
}
if (startTime.equals(Instant.EPOCH) == false) {
builder.field(START_TIME.getPreferredName(), startTime.toEpochMilli());
}
if (endTime.equals(Instant.EPOCH) == false) {
builder.field(END_TIME.getPreferredName(), endTime.toEpochMilli());
}
if (createTime.equals(Instant.EPOCH) == false) {
builder.field(CREATE_TIME.getPreferredName(), createTime.toEpochMilli());
}
if (expiryTime.equals(Instant.EPOCH) == false) {
builder.field(EXPIRY_TIME.getPreferredName(), expiryTime.toEpochMilli());
}
builder.field(PROGRESS.getPreferredName(), progress);
builder.field(PROCESSING_TIME_MS.getPreferredName(), processingTime);
builder.field(MEMORY_USAGE.getPreferredName(), getMemoryUsage());
builder.field(STATUS.getPreferredName(), status);
builder.endObject();
return builder;
}
public String getJobId() {
return jobId;
}
public String getForecastId() {
return forecastId;
}
public static String documentId(String jobId, String forecastId) {
return jobId + "_model_forecast_request_stats_" + forecastId;
}
/**
* Return the document ID used for indexing. As there is 1 and only 1 document
* per forecast request, the id has no dynamic parts.
*
* @return id
*/
public String getId() {
return documentId(jobId, forecastId);
}
public void setRecordCount(long recordCount) {
this.recordCount = recordCount;
}
public long getRecordCount() {
return recordCount;
}
public List<String> getMessages() {
return messages;
}
public void setMessages(List<String> messages) {
this.messages = messages;
}
public void setTimeStamp(Instant timeStamp) {
this.timestamp = Instant.ofEpochMilli(timeStamp.toEpochMilli());
}
public Instant getTimestamp() {
return timestamp;
}
public void setStartTime(Instant startTime) {
this.startTime = Instant.ofEpochMilli(startTime.toEpochMilli());
}
public Instant getStartTime() {
return startTime;
}
public Instant getEndTime() {
return endTime;
}
public void setEndTime(Instant endTime) {
this.endTime = Instant.ofEpochMilli(endTime.toEpochMilli());
}
public void setCreateTime(Instant createTime) {
this.createTime = Instant.ofEpochMilli(createTime.toEpochMilli());
}
public Instant getCreateTime() {
return createTime;
}
public void setExpiryTime(Instant expiryTime) {
this.expiryTime = Instant.ofEpochMilli(expiryTime.toEpochMilli());
}
public Instant getExpiryTime() {
return expiryTime;
}
/**
* Progress information of the ForecastRequest in the range 0 to 1,
* while 1 means finished
*
* @return progress value
*/
public double getProgress() {
return progress;
}
public void setProgress(double progress) {
this.progress = progress;
}
public long getProcessingTime() {
return processingTime;
}
public void setProcessingTime(long processingTime) {
this.processingTime = processingTime;
}
public long getMemoryUsage() {
return memoryUsage;
}
public void setMemoryUsage(long memoryUsage) {
this.memoryUsage = memoryUsage;
}
public ForecastRequestStatus getStatus() {
return status;
}
public void setStatus(ForecastRequestStatus jobStatus) {
Objects.requireNonNull(jobStatus, "[" + STATUS.getPreferredName() + "] must not be null");
this.status = jobStatus;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (other instanceof ForecastRequestStats == false) {
return false;
}
ForecastRequestStats that = (ForecastRequestStats) other;
return Objects.equals(this.jobId, that.jobId)
&& Objects.equals(this.forecastId, that.forecastId)
&& this.recordCount == that.recordCount
&& Objects.equals(this.messages, that.messages)
&& Objects.equals(this.timestamp, that.timestamp)
&& Objects.equals(this.startTime, that.startTime)
&& Objects.equals(this.endTime, that.endTime)
&& Objects.equals(this.createTime, that.createTime)
&& Objects.equals(this.expiryTime, that.expiryTime)
&& this.progress == that.progress
&& this.processingTime == that.processingTime
&& this.memoryUsage == that.memoryUsage
&& Objects.equals(this.status, that.status);
}
@Override
public int hashCode() {
return Objects.hash(
jobId,
forecastId,
recordCount,
messages,
timestamp,
startTime,
endTime,
createTime,
expiryTime,
progress,
processingTime,
memoryUsage,
status
);
}
}
|
{
"content_hash": "f0bf5b07fa9ab5bada583e47f8fbbaa5",
"timestamp": "",
"source": "github",
"line_count": 383,
"max_line_length": 140,
"avg_line_length": 36.9556135770235,
"alnum_prop": 0.6742970185106684,
"repo_name": "GlenRSmith/elasticsearch",
"id": "3c0ceb64b51119fcfae4189e73ff9dce9e735a8a",
"size": "14406",
"binary": false,
"copies": "26",
"ref": "refs/heads/master",
"path": "x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/results/ForecastRequestStats.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "11082"
},
{
"name": "Batchfile",
"bytes": "11057"
},
{
"name": "Emacs Lisp",
"bytes": "3341"
},
{
"name": "FreeMarker",
"bytes": "45"
},
{
"name": "Groovy",
"bytes": "337461"
},
{
"name": "HTML",
"bytes": "2186"
},
{
"name": "Java",
"bytes": "43224931"
},
{
"name": "Perl",
"bytes": "11756"
},
{
"name": "Python",
"bytes": "19852"
},
{
"name": "Shell",
"bytes": "99571"
}
],
"symlink_target": ""
}
|
- [Speed up Android build by breaking remote execution on `package` task](#speed-up-android-build-by-breaking-remote-execution-on-package-task)
- [Pass break task pattern via command line argument](#pass-break-task-pattern-via-command-line-argument)
- [Show list of updates made by rsync (deletions, uploads, downloads)](#show-list-of-updates-made-by-rsync-deletions-uploads-downloads)
- [Show total transfer progress](#show-total-transfer-progress)
- [Set Gradle properties for remote build using mirakle.properties and mirakle_local.properties](#set-gradle-properties-for-remote-build-using-mirakleproperties-and-mirakle_localproperties)
- [Determine if build occurs on remote machine](#determine-if-build-occurs-on-remote-machine)
- [Print Gradle arguments of remote build](#print-gradle-arguments-of-remote-build)
Contribution is welcome!
### Speed up Android build by breaking remote execution on `package` task
The main result of Android application build is `.apk` file which contains all the code and resources of the application.
`.apk` file is a zip archive that can't be downloaded from remote machine by rsync incrementally.
Making just a small fix to codebase or adding new resource will lead to the need of downloading the whole file the size of which can be quite large.
The idea of breaking remote building process on `package` task is to stop remote build one step before archiving all the application files into `.apk` file
and let rsync incrementally download only these files that changed during the build.
One line fix usually affects one `.dex` file whose size is significantly less than size of whole `.apk` file.
Mirakle will download all the inputs of `package` task and execute it by Gradle on local machine.
```groovy
initscript {
repositories {
jcenter()
}
dependencies {
classpath "com.instamotor:mirakle:1.4.0"
}
}
apply plugin: MirakleBreakMode // <-
rootProject {
mirakle {
host "your_remote_machine"
breakOnTasks += ["package"] // this is regex pattern that matches all build flavour variations of package task.
excludeRemote += ["build/tmp", "build/generated", "build/intermediates/*", "build/kotlin"]
rsyncFromRemoteArgs += ["-i", "-c", "--compress-level=2"]
}
}
```
```
> ./gradlew assembleStagingDebug
:uploadToRemote
:executeOnRemote
Mirakle will break remote execution on task ':app:packageStagingDebug'
:downloadFromRemote
>fcst....... app/build/intermediates/dex/stagingDebug/mergeDexStagingDebug/classes2.dex
app:packageStagingDebug
Task uploadToRemote took : 0.19 secs
Task executeOnRemote took : 8.08 secs
Task downloadFromRemote took : 1.065 secs
Task app:packageStagingDebug took : 1.362 secs
```
#### Pass break task pattern via command line argument
```
> ./gradlew assembleStagingDebug --project-prop mirakle.break.task=package
```
### Show list of updates made by rsync (deletions, uploads, downloads)
```groovy
mirakle {
rsyncToRemoteArgs += ["-i"]
rsyncFromRemoteArgs += ["-i"]
}
```
```
> ./gradlew assembleStagingDebug
:uploadToRemote
.d..t....... app/src/main/
<f.st....... app/src/main/AndroidManifest.xml
:executeOnRemote
:downloadFromRemote
>f..t....... app/build/outputs/apk/staging/debug/output-metadata.json
>f.st....... app/build/outputs/apk/staging/debug/android_app-staging-debug.apk
.d..t....... app/build/outputs/logs/
>f++++++++++ app/build/outputs/logs/manifest-merger-staging-debug-report.txt
```
Explanation of each bit position and value in rsync‘s `-i` output:
```
YXcstpoguax path/to/file
|||||||||||
||||||||||╰- x: The extended attribute information changed
|||||||||╰-- a: The ACL information changed
||||||||╰--- u: The u slot is reserved for future use
|||||||╰---- g: Group is different
||||||╰----- o: Owner is different
|||||╰------ p: Permission are different
||||╰------- t: Modification time is different
|||╰-------- s: Size is different
||╰--------- c: Different checksum (for regular files), or
|| changed value (for symlinks, devices, and special files)
|╰---------- the file type:
| f: for a file,
| d: for a directory,
| L: for a symlink,
| D: for a device,
| S: for a special file (e.g. named sockets and fifos)
╰----------- the type of update being done::
<: file is being transferred to the remote host (sent)
>: file is being transferred to the local host (received)
c: local change/creation for the item, such as:
- the creation of a directory
- the changing of a symlink,
- etc.
h: the item is a hard link to another item (requires
--hard-links).
.: the item is not being updated (though it might have
attributes that are being modified)
*: means that the rest of the itemized-output area contains
a message (e.g. "deleting")
```
Examples:
```
>f.st......
> - the item is received
f - it is a regular file
s - the file size is different
t - the time stamp is different
.d..t......
. - the item is not being updated (though it might have attributes
that are being modified)
d - it is a directory
t - the time stamp is different
>f+++++++++
> - the item is received
f - a regular file
+++++++++ - this is a newly created item
```
### Show total transfer progress
```groovy
mirakle {
rsyncToRemoteArgs += ["--info=progress2"]
rsyncFromRemoteArgs += ["--info=progress2"]
}
```
```
> ./gradlew assembleStagingDebug
:uploadToRemote
:executeOnRemote
:downloadFromRemote
66,775,594 69% 17.77MB/s 0:00:03 (xfr#2, to-chk=0/40)
```
Other available `--info` flags are:
```
Use OPT or OPT1 for level 1 output, OPT2 for level 2, etc.; OPT0 silences.
BACKUP Mention files backed up
COPY Mention files copied locally on the receiving side
DEL Mention deletions on the receiving side
FLIST Mention file-list receiving/sending (levels 1-2)
MISC Mention miscellaneous information (levels 1-2)
MOUNT Mention mounts that were found or skipped
NAME Mention 1) updated file/dir names, 2) unchanged names
PROGRESS Mention 1) per-file progress or 2) total transfer progress
REMOVE Mention files removed on the sending side
SKIP Mention files that are skipped due to options used
STATS Mention statistics at end of run (levels 1-3)
SYMSAFE Mention symlinks that are unsafe
ALL Set all --info options (e.g. all4)
NONE Silence all --info options (same as all0)
HELP Output this help message
Options added for each increase in verbose level:
1) COPY,DEL,FLIST,MISC,NAME,STATS,SYMSAFE
2) BACKUP,MISC2,MOUNT,NAME2,REMOVE,SKIP
```
### Set Gradle properties for remote build using `mirakle.properties` and `mirakle_local.properties`
`PROJECT_DIR/mirakle.properties` and `PROJECT_DIR/mirakle_local.properties` can be used to pass specific Gradle properties to remote build or override existing properties.
Properties from that files have highest priority over all other properties.
Both files serves the same purpose, but `mirakle_local.properties` may be used to define user specific values and skipped from committing to VCS.
### Determine if build occurs on remote machine
Put it in `build.gradle` in project dir:
```
if (project.hasProperty('mirakle.build.on.remote')) {
...
}
```
### Print Gradle arguments of remote build
Put this into `USER_HOME/.gradle/init.d/mirakle_init.gradle` or `PROJECT_DIR/mirakle.gradle` on local machine:
```
taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(":executeOnRemote")) {
gradle.rootProject.executeOnRemote.doLast {
println("============REMOTE COMMAND===============")
println(rootProject.executeOnRemote.commandLine)
println("============REMOTE COMMAND===============")
}
}
}
```
|
{
"content_hash": "e7dc8f48f5a1008813a3e7e495c4419b",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 189,
"avg_line_length": 37.53051643192488,
"alnum_prop": 0.681761320990743,
"repo_name": "Adambl4/mirakle",
"id": "421c1c2c5d6d167306a31176b86d31ddfced7701",
"size": "8037",
"binary": false,
"copies": "1",
"ref": "refs/heads/development",
"path": "docs/TIPS_AND_TRICKS.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Kotlin",
"bytes": "97507"
},
{
"name": "Shell",
"bytes": "562"
}
],
"symlink_target": ""
}
|
package com.gs.obevo.db.api.appdata;
import org.apache.commons.lang3.Validate;
import org.eclipse.collections.api.collection.ImmutableCollection;
import org.eclipse.collections.api.multimap.ImmutableMultimap;
import org.eclipse.collections.api.multimap.Multimap;
/**
* Represents a set of privileges that should be provided to the given grantTargets (i.e. the users/groups).
* The object would be specified separately.
*/
public class Grant {
private ImmutableCollection<String> privileges;
private ImmutableMultimap<GrantTargetType, String> grantTargets;
public Grant(ImmutableCollection<String> privileges, ImmutableMultimap<GrantTargetType, String> grantTargets) {
this.privileges = Validate.notNull(privileges);
this.grantTargets = Validate.notNull(grantTargets);
}
public ImmutableCollection<String> getPrivileges() {
return this.privileges;
}
public Multimap<GrantTargetType, String> getGrantTargets() {
return grantTargets;
}
public void validate() {
if (privileges.isEmpty()) {
throw new RuntimeException("privileges cannot be empty!!!");
}
if (grantTargets.isEmpty()) {
throw new RuntimeException("grantTargets (i.e. user or group list for a grant) cannot be empty!!!");
}
}
}
|
{
"content_hash": "b118ddef93263d7b2c81378410055679",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 115,
"avg_line_length": 35.8421052631579,
"alnum_prop": 0.6960352422907489,
"repo_name": "shantstepanian/obevo",
"id": "c297cd2fcebfa672b4a9ea4fe555ac19b63b104e",
"size": "1971",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "obevo-db/src/main/java/com/gs/obevo/db/api/appdata/Grant.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2302"
},
{
"name": "FreeMarker",
"bytes": "9115"
},
{
"name": "Java",
"bytes": "2677165"
},
{
"name": "JavaScript",
"bytes": "3135"
},
{
"name": "Kotlin",
"bytes": "232754"
},
{
"name": "PLSQL",
"bytes": "19595"
},
{
"name": "PLpgSQL",
"bytes": "24497"
},
{
"name": "PowerShell",
"bytes": "3558"
},
{
"name": "SQLPL",
"bytes": "29981"
},
{
"name": "Shell",
"bytes": "11626"
}
],
"symlink_target": ""
}
|
package org.ehcache.clustered.common.internal.messages;
import org.ehcache.clustered.common.ServerSideConfiguration;
import org.ehcache.clustered.common.internal.ServerStoreConfiguration;
import org.terracotta.runnel.Struct;
import org.terracotta.runnel.StructBuilder;
import org.terracotta.runnel.decoding.StructDecoder;
import org.terracotta.runnel.encoding.StructEncoder;
import java.nio.ByteBuffer;
import static org.ehcache.clustered.common.internal.messages.EhcacheMessageType.EHCACHE_MESSAGE_TYPES_ENUM_MAPPING;
import static org.ehcache.clustered.common.internal.messages.EhcacheMessageType.MESSAGE_TYPE_FIELD_INDEX;
import static org.ehcache.clustered.common.internal.messages.EhcacheMessageType.MESSAGE_TYPE_FIELD_NAME;
import static org.ehcache.clustered.common.internal.messages.MessageCodecUtils.SERVER_STORE_NAME_FIELD;
import static org.terracotta.runnel.StructBuilder.newStructBuilder;
public class LifeCycleMessageCodec {
private static final String CONFIG_PRESENT_FIELD = "configPresent";
private static final int CONFIGURE_MESSAGE_NEXT_INDEX = 40;
private static final int VALIDATE_STORE_NEXT_INDEX = 40;
private final Struct PREPARE_FOR_DESTROY_STRUCT = newStructBuilder()
.enm(MESSAGE_TYPE_FIELD_NAME, MESSAGE_TYPE_FIELD_INDEX, EHCACHE_MESSAGE_TYPES_ENUM_MAPPING)
.build();
private final Struct validateMessageStruct;
private final Struct validateStoreMessageStruct;
private final MessageCodecUtils messageCodecUtils;
private final ConfigCodec configCodec;
public LifeCycleMessageCodec(ConfigCodec configCodec) {
this.messageCodecUtils = new MessageCodecUtils();
this.configCodec = configCodec;
StructBuilder validateMessageStructBuilderPrefix = newStructBuilder()
.enm(MESSAGE_TYPE_FIELD_NAME, MESSAGE_TYPE_FIELD_INDEX, EHCACHE_MESSAGE_TYPES_ENUM_MAPPING)
.bool(CONFIG_PRESENT_FIELD, 30);
validateMessageStruct = this.configCodec.injectServerSideConfiguration(
validateMessageStructBuilderPrefix, CONFIGURE_MESSAGE_NEXT_INDEX).getUpdatedBuilder().build();
StructBuilder validateStoreMessageStructBuilderPrefix = newStructBuilder()
.enm(MESSAGE_TYPE_FIELD_NAME, MESSAGE_TYPE_FIELD_INDEX, EHCACHE_MESSAGE_TYPES_ENUM_MAPPING)
.string(SERVER_STORE_NAME_FIELD, 30);
validateStoreMessageStruct = this.configCodec.injectServerStoreConfiguration(
validateStoreMessageStructBuilderPrefix, VALIDATE_STORE_NEXT_INDEX).getUpdatedBuilder().build();
}
public byte[] encode(LifecycleMessage message) {
switch (message.getMessageType()) {
case VALIDATE:
return encodeTierManagerValidateMessage((LifecycleMessage.ValidateStoreManager) message);
case VALIDATE_SERVER_STORE:
return encodeValidateStoreMessage((LifecycleMessage.ValidateServerStore) message);
case PREPARE_FOR_DESTROY:
return encodePrepareForDestroyMessage(message);
default:
throw new IllegalArgumentException("Unknown lifecycle message: " + message.getClass());
}
}
private byte[] encodePrepareForDestroyMessage(LifecycleMessage message) {
return PREPARE_FOR_DESTROY_STRUCT.encoder()
.enm(MESSAGE_TYPE_FIELD_NAME, message.getMessageType())
.encode().array();
}
private byte[] encodeValidateStoreMessage(LifecycleMessage.ValidateServerStore message) {
StructEncoder<Void> encoder = validateStoreMessageStruct.encoder();
messageCodecUtils.encodeMandatoryFields(encoder, message);
encoder.string(SERVER_STORE_NAME_FIELD, message.getName());
configCodec.encodeServerStoreConfiguration(encoder, message.getStoreConfiguration());
return encoder.encode().array();
}
private byte[] encodeTierManagerValidateMessage(LifecycleMessage.ValidateStoreManager message) {
StructEncoder<Void> encoder = validateMessageStruct.encoder();
ServerSideConfiguration config = message.getConfiguration();
messageCodecUtils.encodeMandatoryFields(encoder, message);
if (config == null) {
encoder.bool(CONFIG_PRESENT_FIELD, false);
} else {
encoder.bool(CONFIG_PRESENT_FIELD, true);
configCodec.encodeServerSideConfiguration(encoder, config);
}
return encoder.encode().array();
}
public EhcacheEntityMessage decode(EhcacheMessageType messageType, ByteBuffer messageBuffer) {
switch (messageType) {
case VALIDATE:
return decodeValidateMessage(messageBuffer);
case VALIDATE_SERVER_STORE:
return decodeValidateServerStoreMessage(messageBuffer);
case PREPARE_FOR_DESTROY:
return decodePrepareForDestroyMessage();
default:
throw new IllegalArgumentException("LifeCycleMessage operation not defined for : " + messageType);
}
}
private LifecycleMessage.PrepareForDestroy decodePrepareForDestroyMessage() {
return new LifecycleMessage.PrepareForDestroy();
}
private LifecycleMessage.ValidateServerStore decodeValidateServerStoreMessage(ByteBuffer messageBuffer) {
StructDecoder<Void> decoder = validateStoreMessageStruct.decoder(messageBuffer);
String storeName = decoder.string(SERVER_STORE_NAME_FIELD);
ServerStoreConfiguration config = configCodec.decodeServerStoreConfiguration(decoder);
return new LifecycleMessage.ValidateServerStore(storeName, config);
}
private LifecycleMessage.ValidateStoreManager decodeValidateMessage(ByteBuffer messageBuffer) {
StructDecoder<Void> decoder = validateMessageStruct.decoder(messageBuffer);
boolean configPresent = decoder.bool(CONFIG_PRESENT_FIELD);
ServerSideConfiguration config = null;
if (configPresent) {
config = configCodec.decodeServerSideConfiguration(decoder);
}
return new LifecycleMessage.ValidateStoreManager(config);
}
}
|
{
"content_hash": "19becc9ebf706e719aa520923627e274",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 115,
"avg_line_length": 42.088235294117645,
"alnum_prop": 0.7838923829489868,
"repo_name": "alexsnaps/ehcache3",
"id": "af1c5b5ba9a1cc4c07088591ab409384b81e8717",
"size": "6318",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "clustered/common/src/main/java/org/ehcache/clustered/common/internal/messages/LifeCycleMessageCodec.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Groovy",
"bytes": "18716"
},
{
"name": "Java",
"bytes": "6407330"
}
],
"symlink_target": ""
}
|
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class login extends CI_Controller {
public function index()
{
if($this->session->userdata('username') != null && $this->session->userdata('username') !="")
{
redirect('/dashboard','refresh');
}
$error['err'] = '';
$this->load->view('login_view',$error);
}
public function input(){
$username = $this->input->post('username');
$password = $this->input->post('password');
$this->load->model('login_model','login');
$query = $this->login->login($username,$password);
if($query == false){
$error['err'] = 'Invalid username or password';
$this->load->view('login_view',$error);
}
else if($this->session->userdata('username') != null && $this->session->userdata('username') !="")
{
redirect('/dashboard','refresh');
}
else{
$data = array (
'username' => $query->row(0)->username
);
$this->session->set_userdata($data);
redirect('/dashboard','refresh');
}
}
public function logout(){
$this->session->unset_userdata('username');
redirect('/login','refresh');
}
}
|
{
"content_hash": "136769d282b8591ec83bc7004113dddd",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 100,
"avg_line_length": 24.6,
"alnum_prop": 0.6106594399277326,
"repo_name": "rafanwij/blog",
"id": "0c6e7c77f3d109adf2ae196e803beb6408571ae8",
"size": "1107",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "application/controllers/login.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "241"
},
{
"name": "CSS",
"bytes": "101637"
},
{
"name": "HTML",
"bytes": "5459771"
},
{
"name": "JavaScript",
"bytes": "79564"
},
{
"name": "PHP",
"bytes": "1779676"
}
],
"symlink_target": ""
}
|
#ifndef __LINUX_IF_ADDR_H
#define __LINUX_IF_ADDR_H
#include <linux/types.h>
#include <linux/netlink.h>
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
struct ifaddrmsg
{
__u8 ifa_family;
__u8 ifa_prefixlen;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u8 ifa_flags;
__u8 ifa_scope;
__u32 ifa_index;
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
enum
{
IFA_UNSPEC,
IFA_ADDRESS,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFA_LOCAL,
IFA_LABEL,
IFA_BROADCAST,
IFA_ANYCAST,
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
IFA_CACHEINFO,
IFA_MULTICAST,
__IFA_MAX,
};
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFA_MAX (__IFA_MAX - 1)
#define IFA_F_SECONDARY 0x01
#define IFA_F_TEMPORARY IFA_F_SECONDARY
#define IFA_F_NODAD 0x02
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFA_F_OPTIMISTIC 0x04
#define IFA_F_DADFAILED 0x08
#define IFA_F_HOMEADDRESS 0x10
#define IFA_F_DEPRECATED 0x20
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
#define IFA_F_TENTATIVE 0x40
#define IFA_F_PERMANENT 0x80
struct ifa_cacheinfo
{
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
__u32 ifa_prefered;
__u32 ifa_valid;
__u32 cstamp;
__u32 tstamp;
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
};
#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
#endif
/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
|
{
"content_hash": "cba840bfa3daa31705653913bd6fa09a",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 91,
"avg_line_length": 31.089285714285715,
"alnum_prop": 0.713957495692131,
"repo_name": "indashnet/InDashNet.Open.UN2000",
"id": "05517a22c45e06a1da2eec3e9ce020c77bbe71cb",
"size": "2715",
"binary": false,
"copies": "11",
"ref": "refs/heads/master",
"path": "android/bionic/libc/kernel/common/linux/if_addr.h",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
}
|
<?php
require_once('models/Base.php');
require_once('models/Oferta.php');
require_once('models/CidadesOferta.php');
$objOferta = new Oferta();
$objCidades = new CidadesOferta();
$dados = $objOferta->listarOferta2('');
foreach($dados as $restDados){
$post['id_oferta'] = $restDados['id'];
$post['id_cidade'] = 1;
$objCidades->inserirEdegracaCidade($post);
}
?>
|
{
"content_hash": "dc97177d3919d0232ea4f2beffa71625",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 43,
"avg_line_length": 21.647058823529413,
"alnum_prop": 0.6820652173913043,
"repo_name": "EliakimRamos/3d3gr4c4",
"id": "7d0cce1fb8df854351186a0843aa83b65794acf2",
"size": "368",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "administrator/povoartabela.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "JavaScript",
"bytes": "504235"
},
{
"name": "PHP",
"bytes": "1292294"
}
],
"symlink_target": ""
}
|
package ru.stqa.pft.addressbook.appmanager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.Select;
import org.testng.Assert;
import ru.stqa.pft.addressbook.model.ContactData;
import ru.stqa.pft.addressbook.model.Contacts;
import java.util.List;
import static org.testng.Assert.assertTrue;
/**
* Created by Sergei on 15.04.2016.
*/
public class ContactHelper extends HelperBase {
public ContactHelper(WebDriver wd) {
super(wd);
}
public void fillClientForm(ContactData contactData, boolean creation) {
type(By.name("firstname"), contactData.getFirstName());
type(By.name("middlename"), contactData.getMiddleName());
type(By.name("lastname"), contactData.getLastName());
type(By.name("nickname"), contactData.getNickName());
type(By.name("company"), contactData.getCompany());
type(By.name("address"), contactData.getAddress());
type(By.name("home"), contactData.getHomePhone());
type(By.name("mobile"), contactData.getMobilePhone());
type(By.name("work"), contactData.getWorkPhone());
type(By.name("fax"), contactData.getFax());
type(By.name("byear"), contactData.getDate());
type(By.name("email"), contactData.getEmail());
type(By.name("email2"), contactData.getEmail2());
type(By.name("email3"), contactData.getEmail3());
if (creation) {
if (contactData.getGroups().size() > 0) {
assertTrue(contactData.getGroups().size() == 1);
new Select(wd.findElement(By.name("new_group")))
.selectByVisibleText(contactData.getGroups().iterator().next().getName());
}
} else {
Assert.assertFalse(isElementPresent(By.name("new_group")));
}
}
public void submitClientCreation() {
click(By.xpath("//div[@id='content']/form/input[21]"));
}
public void initClientGeneration() {
click(By.linkText("add new"));
contactCache = null;
}
public void deleteContact() {
click(By.xpath("//div[@id='content']/form[2]/div[2]/input"));
contactCache = null;
}
public void acceptDelete() {
wd.switchTo().alert().accept();
}
public void selectClientById(int id) {
wd.findElement(By.cssSelector("input[value = '" + id + "']")).click();
}
public void editSelectedContact() {
click(By.xpath("//table[@id='maintable']/tbody/tr[2]/td[8]/a/img"));
contactCache = null;
}
public void detailsSelectedContact() {
click(By.xpath("//table[@id='maintable']/tbody/tr[2]/td[7]/a/img"));
}
public void delete(ContactData contact) {
selectClientById(contact.getId());
deleteContact();
contactCache = null;
acceptDelete();
}
public ContactData infoFromEditForm(ContactData contact) {
initContactModificationById(contact.getId());
String firstname = wd.findElement(By.name("firstname")).getAttribute("value");
String lastname = wd.findElement(By.name("lastname")).getAttribute("value");
String home = wd.findElement(By.name("home")).getAttribute("value");
String mobile = wd.findElement(By.name("mobile")).getAttribute("value");
String work = wd.findElement(By.name("work")).getAttribute("value");
String email = wd.findElement(By.name("email")).getAttribute("value");
String email2 = wd.findElement(By.name("email2")).getAttribute("value");
String email3 = wd.findElement(By.name("email3")).getAttribute("value");
String address = wd.findElement(By.name("address")).getAttribute("value");
wd.navigate().back();
return new ContactData().withId(contact.getId()).withFirstName(firstname).withLastName(lastname)
.withHomePhone(home)
.withMobilePhone(mobile)
.withWorkPhone(work)
.withEmail(email)
.withEmail2(email2)
.withEmail3(email3)
.withAddress(address);
}
private void initContactModificationById(int id) {
wd.findElement(By.xpath(String.format("//input[@value='%s']/../../td[8]/a", id))).click();
}
private Contacts contactCache = null;
public Contacts all() {
if (contactCache != null) {
return new Contacts(contactCache);
}
contactCache = new Contacts();
List<WebElement> rows = wd.findElements(By.name("entry"));
for (WebElement row : rows) {
List<WebElement> cells = row.findElements(By.tagName("td"));
int id = Integer.parseInt(cells.get(0).findElement(By.tagName("input")).getAttribute("id"));
String lastName = cells.get(1).getText();
String firstName = cells.get(2).getText();
String address = cells.get(3).getText();
String allEmails = cells.get(4).getText();
String allPhones = cells.get(5).getText();
contactCache.add(new ContactData()
.withId(id).withFirstName(firstName).withLastName(lastName)
.withAddress(address)
.withAllPhones(allPhones)
.withAllEmails(allEmails));
}
return new Contacts(contactCache);
}
}
|
{
"content_hash": "0a075a3a525bbff835250d5e1a9618e2",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 104,
"avg_line_length": 38.4113475177305,
"alnum_prop": 0.6139217134416544,
"repo_name": "Wave2112/java_pft",
"id": "673bc4c838f66f1051952f7a82d1fa83b641116d",
"size": "5416",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addressbook-web-tests/src/test/java/ru/stqa/pft/addressbook/appmanager/ContactHelper.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "18006"
}
],
"symlink_target": ""
}
|
/**
* @module ol/util
*/
/**
* @return {?} Any return.
*/
export function abstract() {
return /** @type {?} */ ((function () {
throw new Error('Unimplemented abstract method.');
})());
}
/**
* Counter for getUid.
* @type {number}
* @private
*/
var uidCounter_ = 0;
/**
* Gets a unique ID for an object. This mutates the object so that further calls
* with the same object as a parameter returns the same value. Unique IDs are generated
* as a strictly increasing sequence. Adapted from goog.getUid.
*
* @param {Object} obj The object to get the unique ID for.
* @return {string} The unique ID for the object.
* @api
*/
export function getUid(obj) {
return obj.ol_uid || (obj.ol_uid = String(++uidCounter_));
}
/**
* OpenLayers version.
* @type {string}
*/
export var VERSION = '6.0.1-dev.1571930427950';
//# sourceMappingURL=util.js.map
|
{
"content_hash": "e6ce336ca1eefc797e28bea44c74a912",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 87,
"avg_line_length": 25,
"alnum_prop": 0.6434285714285715,
"repo_name": "cdnjs/cdnjs",
"id": "2ac6cb57a4a3fe2b5888220b443aa7b5ccbd4c1e",
"size": "875",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "ajax/libs/openlayers/6.0.1-dev.1571930427950/util.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016 Red Hat, Inc. and/or its affiliates.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>uberfire-security-management</artifactId>
<groupId>org.uberfire</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>uberfire-security-management-client</artifactId>
<packaging>jar</packaging>
<name>Uberfire Security Management - Users and groups management Client</name>
<description>Uberfire Security Management - Users and groups management Client</description>
<dependencies>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-client-all</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-security-management-api</artifactId>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-ioc</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-cdi-client</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-common</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-security-server</artifactId>
</dependency>
<dependency>
<groupId>org.jboss.errai</groupId>
<artifactId>errai-security-client</artifactId>
</dependency>
<!-- GWT and GWT Extensions -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<!-- Test scope. -->
<dependency>
<groupId>org.uberfire</groupId>
<artifactId>uberfire-testing-utils</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.gwt.gwtmockito</groupId>
<artifactId>gwtmockito</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
|
{
"content_hash": "660756523a86b2f441d4789614e701e9",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 108,
"avg_line_length": 29.439252336448597,
"alnum_prop": 0.6704761904761904,
"repo_name": "Salaboy/uberfire",
"id": "be3901cefec9f2c7e538797ebca4705f210ad7e6",
"size": "3150",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "uberfire-extensions/uberfire-security/uberfire-security-management/uberfire-security-management-client/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "56571"
},
{
"name": "FreeMarker",
"bytes": "34703"
},
{
"name": "HTML",
"bytes": "28274"
},
{
"name": "Java",
"bytes": "3849619"
},
{
"name": "JavaScript",
"bytes": "40304"
},
{
"name": "Ruby",
"bytes": "706"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_162) on Sat Feb 02 18:57:43 CET 2019 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Interface com.communote.server.core.user.security.PasswordHashFunction (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Interface com.communote.server.core.user.security.PasswordHashFunction (Communote 3.5 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?com/communote/server/core/user/security/class-use/PasswordHashFunction.html" target="_top">Frames</a></li>
<li><a href="PasswordHashFunction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Interface com.communote.server.core.user.security.PasswordHashFunction" class="title">Uses of Interface<br>com.communote.server.core.user.security.PasswordHashFunction</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.communote.server.core.user.security">com.communote.server.core.user.security</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.communote.server.core.user.security">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a> in <a href="../../../../../../../com/communote/server/core/user/security/package-summary.html">com.communote.server.core.user.security</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../com/communote/server/core/user/security/package-summary.html">com.communote.server.core.user.security</a> that implement <a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../com/communote/server/core/user/security/BcryptPasswordHashFunction.html" title="class in com.communote.server.core.user.security">BcryptPasswordHashFunction</a></span></code>
<div class="block">
bcrypt password hash function which produces a string in
<a href="http://passlib.readthedocs.io/en/stable/modular_crypt_format.html">modular crypt
format</a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../com/communote/server/core/user/security/Md5PasswordHashFunction.html" title="class in com.communote.server.core.user.security">Md5PasswordHashFunction</a></span></code>
<div class="block">Legacy implementation which uses an unsalted MD5 hash and is intended for backwards
compatibility.</div>
</td>
</tr>
</tbody>
</table>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../com/communote/server/core/user/security/package-summary.html">com.communote.server.core.user.security</a> with parameters of type <a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">UserPasswordManagementImpl.</span><code><span class="memberNameLink"><a href="../../../../../../../com/communote/server/core/user/security/UserPasswordManagementImpl.html#register-com.communote.server.core.user.security.PasswordHashFunction-">register</a></span>(<a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a> hashFunction)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">UserPasswordManagement.</span><code><span class="memberNameLink"><a href="../../../../../../../com/communote/server/core/user/security/UserPasswordManagement.html#register-com.communote.server.core.user.security.PasswordHashFunction-">register</a></span>(<a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a> hashFunction)</code>
<div class="block">Register a hash function for generating and checking password hashes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">UserPasswordManagementImpl.</span><code><span class="memberNameLink"><a href="../../../../../../../com/communote/server/core/user/security/UserPasswordManagementImpl.html#unregister-com.communote.server.core.user.security.PasswordHashFunction-">unregister</a></span>(<a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a> hashFunction)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="typeNameLabel">UserPasswordManagement.</span><code><span class="memberNameLink"><a href="../../../../../../../com/communote/server/core/user/security/UserPasswordManagement.html#unregister-com.communote.server.core.user.security.PasswordHashFunction-">unregister</a></span>(<a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">PasswordHashFunction</a> hashFunction)</code>
<div class="block">Remove a previously registered password hash function.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../com/communote/server/core/user/security/PasswordHashFunction.html" title="interface in com.communote.server.core.user.security">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?com/communote/server/core/user/security/class-use/PasswordHashFunction.html" target="_top">Frames</a></li>
<li><a href="PasswordHashFunction.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2019 <a href="https://communote.github.io/">Communote team</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"content_hash": "3c07017dc7a9adfe03c4dd5bcc19c640",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 534,
"avg_line_length": 53.78743961352657,
"alnum_prop": 0.6749595832584875,
"repo_name": "Communote/communote.github.io",
"id": "174f9a8615675dae5998b74568f9c41141a5ac53",
"size": "11134",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "generated/javadoc/com/communote/server/core/user/security/class-use/PasswordHashFunction.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "213611"
},
{
"name": "HTML",
"bytes": "526693"
},
{
"name": "JavaScript",
"bytes": "16683"
},
{
"name": "Ruby",
"bytes": "6917"
},
{
"name": "Shell",
"bytes": "513"
}
],
"symlink_target": ""
}
|
package com.one.vo;
public class Room {
private int rno;
private String rroom;
private String rname;
private int rvol;
private int rstate;
private String rnote;
public Room(int rno, String rroom, String rname, int rvol, int rstate, String rnote) {
super();
this.rno = rno;
this.rroom = rroom;
this.rname = rname;
this.rvol = rvol;
this.rstate = rstate;
this.rnote = rnote;
}
public Room(int rno, String rroom, String rname, int rvol, int rstate) {
super();
this.rno = rno;
this.rroom = rroom;
this.rname = rname;
this.rvol = rvol;
this.rstate = rstate;
}
public Room() {
super();
}
public int getRno() {
return rno;
}
public void setRno(int rno) {
this.rno = rno;
}
public String getRroom() {
return rroom;
}
public void setRroom(String rroom) {
this.rroom = rroom;
}
public String getRname() {
return rname;
}
public void setRname(String rname) {
this.rname = rname;
}
public int getRvol() {
return rvol;
}
public void setRvol(int rvol) {
this.rvol = rvol;
}
public int getRstate() {
return rstate;
}
public void setRstate(int rstate) {
this.rstate = rstate;
}
public String getRnote() {
return rnote;
}
public void setRnote(String rnote) {
this.rnote = rnote;
}
}
|
{
"content_hash": "5a69db6e0449a39fcf7734ddf9e3cb6e",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 87,
"avg_line_length": 15.5,
"alnum_prop": 0.6538158929976396,
"repo_name": "qql7267/ICSSshixi",
"id": "e7a28a11ce679befc6c91f093f5892c9d06906d6",
"size": "1271",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CoolMeeting/src/com/one/vo/Room.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "6728"
},
{
"name": "HTML",
"bytes": "306"
},
{
"name": "Java",
"bytes": "304763"
}
],
"symlink_target": ""
}
|
.class Landroid/support/v7/widget/ActionMenuView$MenuBuilderCallback;
.super Ljava/lang/Object;
.source "ActionMenuView.java"
# interfaces
.implements Landroid/support/v7/view/menu/MenuBuilder$Callback;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroid/support/v7/widget/ActionMenuView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x2
name = "MenuBuilderCallback"
.end annotation
# instance fields
.field final synthetic this$0:Landroid/support/v7/widget/ActionMenuView;
# direct methods
.method constructor <init>(Landroid/support/v7/widget/ActionMenuView;)V
.locals 0
iput-object p1, p0, Landroid/support/v7/widget/ActionMenuView$MenuBuilderCallback;->this$0:Landroid/support/v7/widget/ActionMenuView;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public onMenuItemSelected(Landroid/support/v7/view/menu/MenuBuilder;Landroid/view/MenuItem;)Z
.locals 1
iget-object v0, p0, Landroid/support/v7/widget/ActionMenuView$MenuBuilderCallback;->this$0:Landroid/support/v7/widget/ActionMenuView;
iget-object v0, v0, Landroid/support/v7/widget/ActionMenuView;->mOnMenuItemClickListener:Landroid/support/v7/widget/ActionMenuView$OnMenuItemClickListener;
if-eqz v0, :cond_0
iget-object v0, p0, Landroid/support/v7/widget/ActionMenuView$MenuBuilderCallback;->this$0:Landroid/support/v7/widget/ActionMenuView;
iget-object v0, v0, Landroid/support/v7/widget/ActionMenuView;->mOnMenuItemClickListener:Landroid/support/v7/widget/ActionMenuView$OnMenuItemClickListener;
invoke-interface {v0, p2}, Landroid/support/v7/widget/ActionMenuView$OnMenuItemClickListener;->onMenuItemClick(Landroid/view/MenuItem;)Z
move-result v0
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public onMenuModeChange(Landroid/support/v7/view/menu/MenuBuilder;)V
.locals 1
iget-object v0, p0, Landroid/support/v7/widget/ActionMenuView$MenuBuilderCallback;->this$0:Landroid/support/v7/widget/ActionMenuView;
iget-object v0, v0, Landroid/support/v7/widget/ActionMenuView;->mMenuBuilderCallback:Landroid/support/v7/view/menu/MenuBuilder$Callback;
if-eqz v0, :cond_0
iget-object v0, p0, Landroid/support/v7/widget/ActionMenuView$MenuBuilderCallback;->this$0:Landroid/support/v7/widget/ActionMenuView;
iget-object v0, v0, Landroid/support/v7/widget/ActionMenuView;->mMenuBuilderCallback:Landroid/support/v7/view/menu/MenuBuilder$Callback;
invoke-interface {v0, p1}, Landroid/support/v7/view/menu/MenuBuilder$Callback;->onMenuModeChange(Landroid/support/v7/view/menu/MenuBuilder;)V
:cond_0
return-void
.end method
|
{
"content_hash": "490396ed65c6bd1af95e0029fafdf385",
"timestamp": "",
"source": "github",
"line_count": 80,
"max_line_length": 159,
"avg_line_length": 34.575,
"alnum_prop": 0.7809110629067245,
"repo_name": "BatMan-Rom/ModdedFiles",
"id": "360e83325735d852abf57afbeca1257fc7f0266b",
"size": "2766",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "SecSettings/smali/android/support/v7/widget/ActionMenuView$MenuBuilderCallback.smali",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "GLSL",
"bytes": "15069"
},
{
"name": "HTML",
"bytes": "139176"
},
{
"name": "Smali",
"bytes": "541934400"
}
],
"symlink_target": ""
}
|
package com.intellij.javaee.run.configuration;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import com.intellij.execution.RunnerAndConfigurationSettings;
import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.RunConfiguration;
import com.intellij.javaee.appServerIntegrations.ApplicationServer;
import com.intellij.javaee.run.localRun.ExecutableObjectStartupPolicy;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiFile;
import consulo.javaee.bundle.JavaEEServerBundleType;
public abstract class J2EEConfigurationFactory
{
public static J2EEConfigurationFactory getInstance()
{
return ServiceManager.getService(J2EEConfigurationFactory.class);
}
public abstract RunConfiguration createJ2EERunConfiguration(ConfigurationFactory factory,
Project project,
ServerModel serverSpecific,
JavaEEServerBundleType integration,
boolean isLocal,
JavaCommandLineStartupPolicy startupPolicy);
public abstract RunConfiguration createJ2EERunConfiguration(ConfigurationFactory factory,
Project project,
ServerModel serverSpecific,
JavaEEServerBundleType integration,
boolean isLocal,
ExecutableObjectStartupPolicy startupPolicy);
@Nullable
public abstract RunnerAndConfigurationSettings createSettingsByFile(@Nonnull PsiFile psiFile, @Nonnull J2EEConfigurationType configurationType);
public abstract RunnerAndConfigurationSettings addAppServerConfiguration(@Nonnull Project project, @Nonnull ConfigurationFactory type, @Nonnull ApplicationServer appServer);
public abstract ConfigurationFactory createFactory(J2EEConfigurationType type, boolean isLocal, String name);
public abstract boolean isConfigurationApplicable(@Nonnull J2EEConfigurationType type, @Nonnull Project project);
}
|
{
"content_hash": "ca75de4809d5208172e254cc5197955d",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 174,
"avg_line_length": 40.80434782608695,
"alnum_prop": 0.8577517314864145,
"repo_name": "consulo/consulo-javaee",
"id": "532a7439ee71fd46c06e9f1f0eced0fc4f12faf5",
"size": "2477",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "web-server-impl/src/main/java/com/intellij/javaee/run/configuration/J2EEConfigurationFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "7068"
},
{
"name": "Java",
"bytes": "1379423"
},
{
"name": "Lex",
"bytes": "7799"
}
],
"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_65) on Thu Jan 22 19:02:37 GMT 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.apache.taverna.scufl2.xml.t2flow.jaxb.DotProduct (Apache Taverna Language APIs (Scufl2, Databundle) 0.16.1-incubating-SNAPSHOT API)</title>
<meta name="date" content="2015-01-22">
<link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.taverna.scufl2.xml.t2flow.jaxb.DotProduct (Apache Taverna Language APIs (Scufl2, Databundle) 0.16.1-incubating-SNAPSHOT API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/apache/taverna/scufl2/xml/t2flow/jaxb/class-use/DotProduct.html" target="_top">Frames</a></li>
<li><a href="DotProduct.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.taverna.scufl2.xml.t2flow.jaxb.DotProduct" class="title">Uses of Class<br>org.apache.taverna.scufl2.xml.t2flow.jaxb.DotProduct</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.taverna.scufl2.xml.t2flow.jaxb">org.apache.taverna.scufl2.xml.t2flow.jaxb</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.taverna.scufl2.xml.t2flow.jaxb">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a> in <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/package-summary.html">org.apache.taverna.scufl2.xml.t2flow.jaxb</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/package-summary.html">org.apache.taverna.scufl2.xml.t2flow.jaxb</a> declared as <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a></code></td>
<td class="colLast"><span class="strong">TopIterationNode.</span><code><strong><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/TopIterationNode.html#dot">dot</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/package-summary.html">org.apache.taverna.scufl2.xml.t2flow.jaxb</a> that return <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a></code></td>
<td class="colLast"><span class="strong">ObjectFactory.</span><code><strong><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/ObjectFactory.html#createDotProduct()">createDotProduct</a></strong>()</code>
<div class="block">Create an instance of <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb"><code>DotProduct</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a></code></td>
<td class="colLast"><span class="strong">TopIterationNode.</span><code><strong><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/TopIterationNode.html#getDot()">getDot</a></strong>()</code>
<div class="block">Gets the value of the dot property.</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/package-summary.html">org.apache.taverna.scufl2.xml.t2flow.jaxb</a> with parameters of type <a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">TopIterationNode.</span><code><strong><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/TopIterationNode.html#setDot(org.apache.taverna.scufl2.xml.t2flow.jaxb.DotProduct)">setDot</a></strong>(<a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">DotProduct</a> value)</code>
<div class="block">Sets the value of the dot property.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../../org/apache/taverna/scufl2/xml/t2flow/jaxb/DotProduct.html" title="class in org.apache.taverna.scufl2.xml.t2flow.jaxb">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../index.html?org/apache/taverna/scufl2/xml/t2flow/jaxb/class-use/DotProduct.html" target="_top">Frames</a></li>
<li><a href="DotProduct.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2015 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"content_hash": "bbc032aadc2671f1b4c62ac80f57e36d",
"timestamp": "",
"source": "github",
"line_count": 193,
"max_line_length": 442,
"avg_line_length": 52.90155440414508,
"alnum_prop": 0.6461312438785505,
"repo_name": "stain/incubator-taverna-site",
"id": "d268adf11bb5a3ed054929bccfe5c233672ffa8c",
"size": "10210",
"binary": false,
"copies": "1",
"ref": "refs/heads/trunk",
"path": "src/site/resources/javadoc/taverna-language/org/apache/taverna/scufl2/xml/t2flow/jaxb/class-use/DotProduct.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "3813"
},
{
"name": "CSS",
"bytes": "10003"
},
{
"name": "Clojure",
"bytes": "49413"
},
{
"name": "HTML",
"bytes": "82818"
},
{
"name": "M",
"bytes": "1705"
},
{
"name": "Perl",
"bytes": "3148"
},
{
"name": "Python",
"bytes": "31455"
},
{
"name": "Shell",
"bytes": "374"
}
],
"symlink_target": ""
}
|
package com.amazonaws.services.transfer.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/StopServer" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class StopServerResult extends com.amazonaws.AmazonWebServiceResult<com.amazonaws.ResponseMetadata> implements Serializable, Cloneable {
/**
* 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("{");
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof StopServerResult == false)
return false;
StopServerResult other = (StopServerResult) obj;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
return hashCode;
}
@Override
public StopServerResult clone() {
try {
return (StopServerResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
|
{
"content_hash": "a94070f1266a8ab2244f8aa86a72b549",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 143,
"avg_line_length": 28.24590163934426,
"alnum_prop": 0.6314567614625652,
"repo_name": "jentfoo/aws-sdk-java",
"id": "fcbfa0383428965f71d7db7b551bf5fbf8438b4b",
"size": "2303",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-transfer/src/main/java/com/amazonaws/services/transfer/model/StopServerResult.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": ""
}
|
name: Chuck van der Linden
twitter: chuckvdl
website: http://stackoverflow.com/users/409820/chuck-van-der-linden
location: Maltby, Washington
image: /images/contributors/chuck.jpg
active: true
---
Support sheriff at
<a href="http://stackoverflow.com/tags/watir">Stack Overflow</a><br />
Support sheriff at
<a href="http://groups.google.com/group/watir-general/">Watir General</a>
|
{
"content_hash": "57d99938e724c0343276490982e6df20",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 73,
"avg_line_length": 32.083333333333336,
"alnum_prop": 0.7584415584415585,
"repo_name": "watir/watir.github.io",
"id": "35dc9b140ba4d01d435ded353e9b0c6cf3d8438d",
"size": "389",
"binary": false,
"copies": "1",
"ref": "refs/heads/source",
"path": "_contributors/linden_chuck_van_der.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "14337"
},
{
"name": "HTML",
"bytes": "19209"
},
{
"name": "JavaScript",
"bytes": "3030"
},
{
"name": "Ruby",
"bytes": "2924"
},
{
"name": "Shell",
"bytes": "1634"
}
],
"symlink_target": ""
}
|
ALTER TABLE `apps` ADD COLUMN `features` json DEFAULT NULL AFTER `processTimeout`;
ALTER TABLE `appVersions` ADD COLUMN `features` json DEFAULT NULL AFTER `processTimeout`;
|
{
"content_hash": "be82f108ca8322a7db953423685c6f14",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 89,
"avg_line_length": 86.5,
"alnum_prop": 0.791907514450867,
"repo_name": "keboola/developer-portal",
"id": "633703a1cfd9a42ea63312b70a60088c8329de10",
"size": "173",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "migrations/sqls/20180515155000-app-features.sql",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "API Blueprint",
"bytes": "54143"
},
{
"name": "Dockerfile",
"bytes": "485"
},
{
"name": "JavaScript",
"bytes": "333663"
},
{
"name": "TSQL",
"bytes": "6925"
}
],
"symlink_target": ""
}
|
package de.brockhaus.m2m.handler.database;
import java.util.Date;
import java.util.List;
import de.brockhaus.m2m.message.M2MSensorMessage;
public interface SensorDataDAO {
void insertSensorData(M2MSensorMessage data);
void bulkInsertOfSensorData(List<M2MSensorMessage> list);
List<M2MSensorMessage> findBySensorIDAndTimeInterval(String sensorId, Date from, Date to);
List<M2MSensorMessage> findByTimeInterval(Date from, Date to);
}
|
{
"content_hash": "0441d5f2ea98cc676d42259c6c29e11f",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 91,
"avg_line_length": 24.833333333333332,
"alnum_prop": 0.8098434004474273,
"repo_name": "brockhaus-gruppe/M2M_framework",
"id": "3cc806aecd21d56cc69f4f92b7e35912f46a9468",
"size": "671",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "m2m_base/src/main/java/de/brockhaus/m2m/handler/database/SensorDataDAO.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2809"
},
{
"name": "HTML",
"bytes": "3180"
},
{
"name": "Java",
"bytes": "254022"
},
{
"name": "JavaScript",
"bytes": "4654"
}
],
"symlink_target": ""
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CSLA .NET brokered data portal host")]
[assembly: AssemblyDescription("CSLA .NET Framework")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Marimer LLC")]
[assembly: AssemblyProduct("CSLA .NET")]
[assembly: AssemblyCopyright("Copyright © 2010-14 Marimer LLC")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Mark the assembly as CLS compliant
[assembly: System.CLSCompliant(true)]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("6641203f-8e5a-4518-a4ee-d25a2a3da13a")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.5.5.3.0")]
[assembly: AssemblyFileVersion("4.5.5.3.0")]
|
{
"content_hash": "f80e332272fe4e6b192f85010c10dce9",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 84,
"avg_line_length": 39.53846153846154,
"alnum_prop": 0.7470817120622568,
"repo_name": "JasonBock/csla",
"id": "5b7b968d66d9d0fbfa9887265e0811a0880468df",
"size": "1545",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "Source/Csla.BrokeredChannel/BrokeredDataPortal.Net/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "123"
},
{
"name": "C#",
"bytes": "4381535"
},
{
"name": "HTML",
"bytes": "32383"
},
{
"name": "PowerShell",
"bytes": "22160"
},
{
"name": "Shell",
"bytes": "533"
},
{
"name": "Visual Basic",
"bytes": "25744"
}
],
"symlink_target": ""
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
SharedValueManager (POI API Documentation)
</TITLE>
<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="SharedValueManager (POI API Documentation)";
}
}
</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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SharedValueManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </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-all.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="../../../../../../org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><B>PREV CLASS</B></A>
<A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/poi/hssf/record/aggregates/SharedValueManager.html" target="_top"><B>FRAMES</B></A>
<A HREF="SharedValueManager.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.poi.hssf.record.aggregates</FONT>
<BR>
Class SharedValueManager</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.poi.hssf.record.aggregates.SharedValueManager</B>
</PRE>
<HR>
<DL>
<DT><PRE>public final class <B>SharedValueManager</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Manages various auxiliary records while constructing a
<A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><CODE>RowRecordsAggregate</CODE></A>:
<ul>
<li><A HREF="../../../../../../org/apache/poi/hssf/record/SharedFormulaRecord.html" title="class in org.apache.poi.hssf.record"><CODE>SharedFormulaRecord</CODE></A>s</li>
<li><A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record"><CODE>ArrayRecord</CODE></A>s</li>
<li><A HREF="../../../../../../org/apache/poi/hssf/record/TableRecord.html" title="class in org.apache.poi.hssf.record"><CODE>TableRecord</CODE></A>s</li>
</ul>
<P>
<P>
<DL>
<DT><B>Author:</B></DT>
<DD>Josh Micich, Vladimirs Abramovs(Vladimirs.Abramovs at exigenservices.com) - handling of ArrayRecords</DD>
</DL>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#addArrayRecord(org.apache.poi.hssf.record.ArrayRecord)">addArrayRecord</A></B>(<A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record">ArrayRecord</A> ar)</CODE>
<BR>
Add specified Array Record.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html" title="class in org.apache.poi.hssf.record.aggregates">SharedValueManager</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#create(org.apache.poi.hssf.record.SharedFormulaRecord[], org.apache.poi.ss.util.CellReference[], org.apache.poi.hssf.record.ArrayRecord[], org.apache.poi.hssf.record.TableRecord[])">create</A></B>(<A HREF="../../../../../../org/apache/poi/hssf/record/SharedFormulaRecord.html" title="class in org.apache.poi.hssf.record">SharedFormulaRecord</A>[] sharedFormulaRecords,
<A HREF="../../../../../../org/apache/poi/ss/util/CellReference.html" title="class in org.apache.poi.ss.util">CellReference</A>[] firstCells,
<A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record">ArrayRecord</A>[] arrayRecords,
<A HREF="../../../../../../org/apache/poi/hssf/record/TableRecord.html" title="class in org.apache.poi.hssf.record">TableRecord</A>[] tableRecords)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html" title="class in org.apache.poi.hssf.record.aggregates">SharedValueManager</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#createEmpty()">createEmpty</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record">ArrayRecord</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#getArrayRecord(int, int)">getArrayRecord</A></B>(int firstRow,
int firstColumn)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/hssf/record/SharedValueRecordBase.html" title="class in org.apache.poi.hssf.record">SharedValueRecordBase</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#getRecordForFirstCell(org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate)">getRecordForFirstCell</A></B>(<A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">FormulaRecordAggregate</A> agg)</CODE>
<BR>
Gets the <A HREF="../../../../../../org/apache/poi/hssf/record/SharedValueRecordBase.html" title="class in org.apache.poi.hssf.record"><CODE>SharedValueRecordBase</CODE></A> record if it should be encoded immediately after the
formula record contained in the specified <A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><CODE>FormulaRecordAggregate</CODE></A> agg.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/hssf/record/SharedFormulaRecord.html" title="class in org.apache.poi.hssf.record">SharedFormulaRecord</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#linkSharedFormulaRecord(org.apache.poi.ss.util.CellReference, org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate)">linkSharedFormulaRecord</A></B>(<A HREF="../../../../../../org/apache/poi/ss/util/CellReference.html" title="class in org.apache.poi.ss.util">CellReference</A> firstCell,
<A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">FormulaRecordAggregate</A> agg)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../../../org/apache/poi/hssf/util/CellRangeAddress8Bit.html" title="class in org.apache.poi.hssf.util">CellRangeAddress8Bit</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#removeArrayFormula(int, int)">removeArrayFormula</A></B>(int rowIndex,
int columnIndex)</CODE>
<BR>
Removes the <A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record"><CODE>ArrayRecord</CODE></A> for the cell group containing the specified cell.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html#unlink(org.apache.poi.hssf.record.SharedFormulaRecord)">unlink</A></B>(<A HREF="../../../../../../org/apache/poi/hssf/record/SharedFormulaRecord.html" title="class in org.apache.poi.hssf.record">SharedFormulaRecord</A> sharedFormulaRecord)</CODE>
<BR>
Converts all <A HREF="../../../../../../org/apache/poi/hssf/record/FormulaRecord.html" title="class in org.apache.poi.hssf.record"><CODE>FormulaRecord</CODE></A>s handled by <tt>sharedFormulaRecord</tt>
to plain unshared formulas</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="createEmpty()"><!-- --></A><H3>
createEmpty</H3>
<PRE>
public static <A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html" title="class in org.apache.poi.hssf.record.aggregates">SharedValueManager</A> <B>createEmpty</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>a new empty <A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html" title="class in org.apache.poi.hssf.record.aggregates"><CODE>SharedValueManager</CODE></A>.</DL>
</DD>
</DL>
<HR>
<A NAME="create(org.apache.poi.hssf.record.SharedFormulaRecord[], org.apache.poi.ss.util.CellReference[], org.apache.poi.hssf.record.ArrayRecord[], org.apache.poi.hssf.record.TableRecord[])"><!-- --></A><H3>
create</H3>
<PRE>
public static <A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/SharedValueManager.html" title="class in org.apache.poi.hssf.record.aggregates">SharedValueManager</A> <B>create</B>(<A HREF="../../../../../../org/apache/poi/hssf/record/SharedFormulaRecord.html" title="class in org.apache.poi.hssf.record">SharedFormulaRecord</A>[] sharedFormulaRecords,
<A HREF="../../../../../../org/apache/poi/ss/util/CellReference.html" title="class in org.apache.poi.ss.util">CellReference</A>[] firstCells,
<A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record">ArrayRecord</A>[] arrayRecords,
<A HREF="../../../../../../org/apache/poi/hssf/record/TableRecord.html" title="class in org.apache.poi.hssf.record">TableRecord</A>[] tableRecords)</PRE>
<DL>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="linkSharedFormulaRecord(org.apache.poi.ss.util.CellReference, org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate)"><!-- --></A><H3>
linkSharedFormulaRecord</H3>
<PRE>
public <A HREF="../../../../../../org/apache/poi/hssf/record/SharedFormulaRecord.html" title="class in org.apache.poi.hssf.record">SharedFormulaRecord</A> <B>linkSharedFormulaRecord</B>(<A HREF="../../../../../../org/apache/poi/ss/util/CellReference.html" title="class in org.apache.poi.ss.util">CellReference</A> firstCell,
<A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">FormulaRecordAggregate</A> agg)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>firstCell</CODE> - as extracted from the <A HREF="../../../../../../org/apache/poi/ss/formula/ptg/ExpPtg.html" title="class in org.apache.poi.ss.formula.ptg"><CODE>ExpPtg</CODE></A> from the cell's formula.
<DT><B>Returns:</B><DD>never <code>null</code></DL>
</DD>
</DL>
<HR>
<A NAME="getRecordForFirstCell(org.apache.poi.hssf.record.aggregates.FormulaRecordAggregate)"><!-- --></A><H3>
getRecordForFirstCell</H3>
<PRE>
public <A HREF="../../../../../../org/apache/poi/hssf/record/SharedValueRecordBase.html" title="class in org.apache.poi.hssf.record">SharedValueRecordBase</A> <B>getRecordForFirstCell</B>(<A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates">FormulaRecordAggregate</A> agg)</PRE>
<DL>
<DD>Gets the <A HREF="../../../../../../org/apache/poi/hssf/record/SharedValueRecordBase.html" title="class in org.apache.poi.hssf.record"><CODE>SharedValueRecordBase</CODE></A> record if it should be encoded immediately after the
formula record contained in the specified <A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/FormulaRecordAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><CODE>FormulaRecordAggregate</CODE></A> agg. Note - the
shared value record always appears after the first formula record in the group. For arrays
and tables the first formula is always the in the top left cell. However, since shared
formula groups can be sparse and/or overlap, the first formula may not actually be in the
top left cell.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the SHRFMLA, TABLE or ARRAY record for the formula cell, if it is the first cell of
a table or array region. <code>null</code> if the formula cell is not shared/array/table,
or if the specified formula is not the the first in the group.</DL>
</DD>
</DL>
<HR>
<A NAME="unlink(org.apache.poi.hssf.record.SharedFormulaRecord)"><!-- --></A><H3>
unlink</H3>
<PRE>
public void <B>unlink</B>(<A HREF="../../../../../../org/apache/poi/hssf/record/SharedFormulaRecord.html" title="class in org.apache.poi.hssf.record">SharedFormulaRecord</A> sharedFormulaRecord)</PRE>
<DL>
<DD>Converts all <A HREF="../../../../../../org/apache/poi/hssf/record/FormulaRecord.html" title="class in org.apache.poi.hssf.record"><CODE>FormulaRecord</CODE></A>s handled by <tt>sharedFormulaRecord</tt>
to plain unshared formulas
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="addArrayRecord(org.apache.poi.hssf.record.ArrayRecord)"><!-- --></A><H3>
addArrayRecord</H3>
<PRE>
public void <B>addArrayRecord</B>(<A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record">ArrayRecord</A> ar)</PRE>
<DL>
<DD>Add specified Array Record.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="removeArrayFormula(int, int)"><!-- --></A><H3>
removeArrayFormula</H3>
<PRE>
public <A HREF="../../../../../../org/apache/poi/hssf/util/CellRangeAddress8Bit.html" title="class in org.apache.poi.hssf.util">CellRangeAddress8Bit</A> <B>removeArrayFormula</B>(int rowIndex,
int columnIndex)</PRE>
<DL>
<DD>Removes the <A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record"><CODE>ArrayRecord</CODE></A> for the cell group containing the specified cell.
The caller should clear (set blank) all cells in the returned range.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the range of the array formula which was just removed. Never <code>null</code>.</DL>
</DD>
</DL>
<HR>
<A NAME="getArrayRecord(int, int)"><!-- --></A><H3>
getArrayRecord</H3>
<PRE>
public <A HREF="../../../../../../org/apache/poi/hssf/record/ArrayRecord.html" title="class in org.apache.poi.hssf.record">ArrayRecord</A> <B>getArrayRecord</B>(int firstRow,
int firstColumn)</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>the shared ArrayRecord identified by (firstRow, firstColumn). never <code>null</code>.</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<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="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/SharedValueManager.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </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-all.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="../../../../../../org/apache/poi/hssf/record/aggregates/RowRecordsAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><B>PREV CLASS</B></A>
<A HREF="../../../../../../org/apache/poi/hssf/record/aggregates/ValueRecordsAggregate.html" title="class in org.apache.poi.hssf.record.aggregates"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/poi/hssf/record/aggregates/SharedValueManager.html" target="_top"><B>FRAMES</B></A>
<A HREF="SharedValueManager.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>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright 2017 The Apache Software Foundation or
its licensors, as applicable.</i>
</BODY>
</HTML>
|
{
"content_hash": "e1309cabee8e81fe776152842765be91",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 475,
"avg_line_length": 56.80893300248139,
"alnum_prop": 0.6561981305145453,
"repo_name": "wzul/237767",
"id": "091355d60d73f28b69ce506c0c6f2b86325af955",
"size": "22894",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "Assignment_2 (OLD)/Assignment2/build/classes/ApachePOI/docs/apidocs/org/apache/poi/hssf/record/aggregates/SharedValueManager.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "31414"
},
{
"name": "HTML",
"bytes": "209051376"
},
{
"name": "Java",
"bytes": "62613"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.eagle</groupId>
<artifactId>eagle-security-userprofile-parent</artifactId>
<version>0.4.0-incubating</version>
<relativePath>../pom.xml</relativePath>
</parent>
<packaging>jar</packaging>
<artifactId>eagle-security-userprofile-common</artifactId>
<name>eagle-security-userprofile-common</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>com.googlecode.efficient-java-matrix-library</groupId>
<artifactId>ejml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.eagle</groupId>
<artifactId>eagle-security-common</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<artifactId>joda-time</artifactId>
<groupId>joda-time</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.eagle</groupId>
<artifactId>eagle-alert-process</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.eagle</groupId>
<artifactId>eagle-machinelearning-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>org.joda</groupId>
<artifactId>joda-convert</artifactId>
</dependency>
</dependencies>
<build>
<!--<sourceDirectory>.</sourceDirectory>-->
<!--<testSourceDirectory>src/test/scala</testSourceDirectory>-->
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<executions>
<execution>
<id>scala-compile-first</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useFile>false</useFile>
<disableXmlReport>true</disableXmlReport>
<includes>
<include>**/*Test.*</include>
<include>**/Test*.*</include>
<include>**/*Suite.*</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</project>
|
{
"content_hash": "bf2d9fc57d6bc234b752cae4a07e65ae",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 149,
"avg_line_length": 38.890625,
"alnum_prop": 0.5361591000401768,
"repo_name": "rlugojr/incubator-eagle",
"id": "4d351653ad8947df298fe128fe79d445859ace3d",
"size": "4978",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "eagle-security/eagle-security-userprofile/common/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "2884"
},
{
"name": "CSS",
"bytes": "18382"
},
{
"name": "Groff",
"bytes": "3975"
},
{
"name": "HTML",
"bytes": "92620"
},
{
"name": "Java",
"bytes": "3031838"
},
{
"name": "JavaScript",
"bytes": "209726"
},
{
"name": "Protocol Buffer",
"bytes": "2229"
},
{
"name": "Python",
"bytes": "23505"
},
{
"name": "Ruby",
"bytes": "12305"
},
{
"name": "Scala",
"bytes": "283646"
},
{
"name": "Shell",
"bytes": "292795"
}
],
"symlink_target": ""
}
|
Imports System
Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports Toolbox.NETMF
Imports Toolbox.NETMF.NET
' Copyright 2012-2014 Stefan Thoolen (http://www.netmftoolbox.com/)
'
' 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.
Namespace Programs
Public Module ColorDemo
''' <summary>
''' Binds to the Shell Core
''' </summary>
''' <param name="Shell">The ShellCore object</param>
Public Sub Bind(Shell As ShellCore)
AddHandler Shell.OnCommandReceived, AddressOf Shell_OnCommandReceived
End Sub
''' <summary>
''' Unbinds from the Shell Core
''' </summary>
''' <param name="Shell">The ShellCore object</param>
Public Sub Unbind(Shell As ShellCore)
RemoveHandler Shell.OnCommandReceived, AddressOf Shell_OnCommandReceived
End Sub
''' <summary>
''' Triggered when a command has been given
''' </summary>
''' <param name="Shell">Reference to the shell</param>
''' <param name="Arguments">Command line arguments</param>
''' <param name="SuspressError">Set to 'true' if you could do anything with the command</param>
''' <param name="Time">Current timestamp</param>
Private Sub Shell_OnCommandReceived(Shell As ShellCore, Arguments() As String, ByRef SuspressError As Boolean, Time As DateTime)
If Arguments(0).ToUpper() = "COLORDEMO" Then
ColorDemo.Start(Shell.Telnetserver)
SuspressError = True
ElseIf Arguments(0).ToUpper() = "HELP" Then
If Arguments.Length = 1 Then
Shell.Telnetserver.Print("COLORDEMO Shows an ANSI Color demo")
SuspressError = True
ElseIf Arguments(1).ToUpper() = "COLORDEMO" Then
Shell.Telnetserver.Print("COLORDEMO Shows an ANSI Color demo")
SuspressError = True
End If
End If
End Sub
''' <summary>
''' Actually starts the demo
''' </summary>
''' <param name="Server">Reference to the Telnet Server</param>
Private Sub Start(Server As TelnetServer)
For f As Integer = 0 To 15
For b As Integer = 0 To 7
Server.Color(CType(f, TelnetServer.Colors), CType(b, TelnetServer.Colors))
Server.Print(" " + Tools.ZeroFill(f, 2) + "," + Tools.ZeroFill(b, 2) + " ", True, True)
Next
Server.Color(TelnetServer.Colors.White, TelnetServer.Colors.Black)
Server.Print("")
Next
End Sub
End Module
End Namespace
|
{
"content_hash": "abc922b797d1c9651abbd7aba38ff55a",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 136,
"avg_line_length": 42.23376623376623,
"alnum_prop": 0.6070110701107011,
"repo_name": "JakeLardinois/NetMF.Toolbox",
"id": "0cc7f603b2d307c018b904c511b1239e8683d76f",
"size": "3252",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Samples/Visual Basic/Terminal Server/Programs/ColorDemo.vb",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "10344"
},
{
"name": "C#",
"bytes": "579329"
},
{
"name": "NSIS",
"bytes": "13310"
}
],
"symlink_target": ""
}
|
#define d 5
#define w 256
#define byte_length_nonce 8
void printf_byte_string(const u8 b[], unsigned long long int blen);
void xor_byte_string(const u8 byte1[], u8 byte2[], unsigned long long int blen);
void checksum_state_string(const u8 byte1[], u8 checksum[], unsigned long long int blen);
void KeySetupEnc(u32 mk[], u32 sk[], u8 L[], u8 Lprime[], u8 keyprime[], const u32 rk[], const u8 key[]);
void KeySetupDec(u32 mk[], u32 sk[], u32 isk[], u8 L[], u8 Lprime[], u8 keyprime[], const u32 rk[], const u8 key[]);
void PXMAC(const u32 mk[], const u32 sk[], const u8 L[], u8 v[], const u32 rk[], const u8 ad[], unsigned long long int adlen);
void CENC(const u32 rkprime[], u8 S[], u8 F[], const u8 nonce[], unsigned long long int ptlen);
void PXENC(const u32 mk[], const u32 sk[], const u8 L[], u8 V[], u8 Z[], const u32 rk[], const u8 I[], unsigned long long int ptlen);
void PXDEC(const u32 mk[], const u32 isk[], const u8 L[], u8 V[], const u8 Z[], const u32 rk[], u8 I[], unsigned long long int ctlen);
void XEXLayerEnc(const u32 rk[], const u8 Lprime[], const u8 Z[], u8 C[], unsigned long long int ctlen);
void XEXLayerDec(const u32 irk[], const u8 Lprime[], const u8 C[], u8 Z[], unsigned long long int ctlen);
void tagGen(const u32 rk[], const u8 checksum[], const u8 Lprime[], const u8 U[], const u8 F[], u8 T[], unsigned long long int ptlen);
int tagVef(const u32 rk[], const u8 checksum[], const u8 Lprime[], const u8 U[], const u8 F[], const u8 T[], unsigned long long int ptlen);
void shellaesEnc_fb(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 p[], unsigned long long int ptlen, u8 c[], u8 tag[]);
int shellaesDecVef_fb(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 c[], unsigned long long int ctlen, u8 p[], const u8 tag[]);
void shellaesEnc_short(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 p[], unsigned long long int ptlen, u8 c[], u8 tag[]);
int shellaesDec_short(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 c[], unsigned long long int ctlen, u8 p[], const u8 tag[]);
void XLS(const u32 rk[], const u8 Lprime[], const u8 p[], unsigned long long int fb_ptlen, unsigned int nfb_ptlen, u8 c[], u8 tag[]);
void XLSInv(const u32 irk[], const u8 Lprime[], const u8 c[], unsigned long long fb_ctlen, unsigned int nfb_ctlen, u8 p[], u8 tag[]);
void shellaesEnc_nfb(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 p[], unsigned long long int ptlen, u8 c[], u8 tag[]);
void shellaesEnc(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 p[], unsigned long long int ptlen, u8 c[], unsigned long long int ctlen);
int shellaesDec(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 c[], unsigned long long int ctlen, u8 p[], unsigned long long int ptlen);
|
{
"content_hash": "3715e5a1338fee8ad80075e14cf5c7e6",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 178,
"avg_line_length": 60.673469387755105,
"alnum_prop": 0.6814665321224352,
"repo_name": "mjosaarinen/brutus",
"id": "c86e68815715e5da9c6dddcc63957e4e0376ca3e",
"size": "3842",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "crypto_aead/shellaes128v1d5n64/ref/shellaes.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "15986028"
},
{
"name": "C",
"bytes": "29905916"
},
{
"name": "C++",
"bytes": "8884140"
},
{
"name": "Makefile",
"bytes": "9738"
},
{
"name": "Objective-C",
"bytes": "198516"
},
{
"name": "Shell",
"bytes": "4364"
}
],
"symlink_target": ""
}
|
using System;
using System.Data;
using System.Data.SqlClient;
using Csla;
using Csla.Data;
using System.Configuration;
using System.IO;
using System.ComponentModel;
using Csla.Validation;
namespace Northwind.CSLA.Library
{
/// <summary>
/// OrderOrderDetails Generated by MyGeneration using the CSLA Object Mapping template
/// </summary>
[Serializable()]
[TypeConverter(typeof(OrderOrderDetailsConverter))]
public partial class OrderOrderDetails : BusinessListBase<OrderOrderDetails, OrderOrderDetail>, ICustomTypeDescriptor, IVEHasBrokenRules
{
#region Business Methods
private string _ErrorMessage = string.Empty;
public string ErrorMessage
{
get { return _ErrorMessage; }
}
// Many To Many
public OrderOrderDetail this[Product myProduct]
{
get
{
foreach (OrderOrderDetail orderDetail in this)
if (orderDetail.ProductID == myProduct.ProductID)
return orderDetail;
return null;
}
}
public new System.Collections.Generic.IList<OrderOrderDetail> Items
{
get { return base.Items; }
}
public OrderOrderDetail GetItem(Product myProduct)
{
foreach (OrderOrderDetail orderDetail in this)
if (orderDetail.ProductID == myProduct.ProductID)
return orderDetail;
return null;
}
public OrderOrderDetail Add(Product myProduct)// Many to Many with required fields
{
if (!Contains(myProduct))
{
OrderOrderDetail orderDetail = OrderOrderDetail.New(myProduct);
this.Add(orderDetail);
return orderDetail;
}
else
throw new InvalidOperationException("orderDetail already exists");
}
public void Remove(Product myProduct)
{
foreach (OrderOrderDetail orderDetail in this)
{
if (orderDetail.ProductID == myProduct.ProductID)
{
Remove(orderDetail);
break;
}
}
}
public bool Contains(Product myProduct)
{
foreach (OrderOrderDetail orderDetail in this)
if (orderDetail.ProductID == myProduct.ProductID)
return true;
return false;
}
public bool ContainsDeleted(Product myProduct)
{
foreach (OrderOrderDetail orderDetail in DeletedList)
if (orderDetail.ProductID == myProduct.ProductID)
return true;
return false;
}
#endregion
#region ValidationRules
public IVEHasBrokenRules HasBrokenRules
{
get
{
IVEHasBrokenRules hasBrokenRules=null;
foreach(OrderOrderDetail orderOrderDetail in this)
if ((hasBrokenRules = orderOrderDetail.HasBrokenRules) != null) return hasBrokenRules;
return hasBrokenRules;
}
}
public BrokenRulesCollection BrokenRules
{
get
{
IVEHasBrokenRules hasBrokenRules = HasBrokenRules;
return (hasBrokenRules != null ? hasBrokenRules.BrokenRules : null);
}
}
#endregion
#region Factory Methods
internal static OrderOrderDetails New()
{
return new OrderOrderDetails();
}
internal static OrderOrderDetails Get(SafeDataReader dr)
{
return new OrderOrderDetails(dr);
}
public static OrderOrderDetails GetByOrderID(int orderID)
{
try
{
return DataPortal.Fetch<OrderOrderDetails>(new OrderIDCriteria(orderID));
}
catch (Exception ex)
{
throw new DbCslaException("Error on OrderOrderDetails.GetByOrderID", ex);
}
}
private OrderOrderDetails()
{
MarkAsChild();
}
internal OrderOrderDetails(SafeDataReader dr)
{
MarkAsChild();
Fetch(dr);
}
#endregion
#region Data Access Portal
// called to load data from the database
private void Fetch(SafeDataReader dr)
{
this.RaiseListChangedEvents = false;
while (dr.Read())
this.Add(OrderOrderDetail.Get(dr));
this.RaiseListChangedEvents = true;
}
[Serializable()]
private class OrderIDCriteria
{
public OrderIDCriteria(int orderID)
{
_OrderID = orderID;
}
private int _OrderID;
public int OrderID
{
get { return _OrderID; }
set { _OrderID = value; }
}
}
private void DataPortal_Fetch(OrderIDCriteria criteria)
{
this.RaiseListChangedEvents = false;
Database.LogInfo("OrderOrderDetails.DataPortal_FetchOrderID", GetHashCode());
try
{
using (SqlConnection cn = Database.Northwind_SqlConnection)
{
using (SqlCommand cm = cn.CreateCommand())
{
cm.CommandType = CommandType.StoredProcedure;
cm.CommandText = "getOrderDetailsByOrderID";
cm.Parameters.AddWithValue("@OrderID", criteria.OrderID);
using (SafeDataReader dr = new SafeDataReader(cm.ExecuteReader()))
{
while (dr.Read()) this.Add(new OrderOrderDetail(dr));
}
}
}
}
catch (Exception ex)
{
Database.LogException("OrderOrderDetails.DataPortal_FetchOrderID", ex);
throw new DbCslaException("OrderOrderDetails.DataPortal_Fetch", ex);
}
this.RaiseListChangedEvents = true;
}
internal void Update(Order order)
{
this.RaiseListChangedEvents = false;
try
{
// update (thus deleting) any deleted child objects
foreach (OrderOrderDetail obj in DeletedList)
obj.Delete();// TODO: Should this be SQLDelete
// now that they are deleted, remove them from memory too
DeletedList.Clear();
// add/update any current child objects
foreach (OrderOrderDetail obj in this)
{
if (obj.IsNew)
obj.Insert(order);
else
obj.Update(order);
}
}
finally
{
this.RaiseListChangedEvents = true;
}
}
#endregion
#region ICustomTypeDescriptor impl
public String GetClassName()
{ return TypeDescriptor.GetClassName(this, true); }
public AttributeCollection GetAttributes()
{ return TypeDescriptor.GetAttributes(this, true); }
public String GetComponentName()
{ return TypeDescriptor.GetComponentName(this, true); }
public TypeConverter GetConverter()
{ return TypeDescriptor.GetConverter(this, true); }
public EventDescriptor GetDefaultEvent()
{ return TypeDescriptor.GetDefaultEvent(this, true); }
public PropertyDescriptor GetDefaultProperty()
{ return TypeDescriptor.GetDefaultProperty(this, true); }
public object GetEditor(Type editorBaseType)
{ return TypeDescriptor.GetEditor(this, editorBaseType, true); }
public EventDescriptorCollection GetEvents(Attribute[] attributes)
{ return TypeDescriptor.GetEvents(this, attributes, true); }
public EventDescriptorCollection GetEvents()
{ return TypeDescriptor.GetEvents(this, true); }
public object GetPropertyOwner(PropertyDescriptor pd)
{ return this; }
/// <summary>
/// Called to get the properties of this type. Returns properties with certain
/// attributes. this restriction is not implemented here.
/// </summary>
/// <param name="attributes"></param>
/// <returns></returns>
public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{ return GetProperties(); }
/// <summary>
/// Called to get the properties of this type.
/// </summary>
/// <returns></returns>
public PropertyDescriptorCollection GetProperties()
{
// Create a collection object to hold property descriptors
PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null);
// Iterate the list
for (int i = 0; i < this.Items.Count; i++)
{
// Create a property descriptor for the item and add to the property descriptor collection
OrderOrderDetailsPropertyDescriptor pd = new OrderOrderDetailsPropertyDescriptor(this, i);
pds.Add(pd);
}
// return the property descriptor collection
return pds;
}
#endregion
} // Class
#region Property Descriptor
/// <summary>
/// Summary description for CollectionPropertyDescriptor.
/// </summary>
public partial class OrderOrderDetailsPropertyDescriptor : vlnListPropertyDescriptor
{
private OrderOrderDetail Item { get { return (OrderOrderDetail) _Item;} }
public OrderOrderDetailsPropertyDescriptor(OrderOrderDetails collection, int index):base(collection, index){;}
}
#endregion
#region Converter
internal class OrderOrderDetailsConverter : ExpandableObjectConverter
{
public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType)
{
if (destType == typeof(string) && value is OrderOrderDetails)
{
// Return department and department role separated by comma.
return ((OrderOrderDetails) value).Items.Count.ToString() + " OrderDetails";
}
return base.ConvertTo(context, culture, value, destType);
}
}
#endregion
} // Namespace
|
{
"content_hash": "534f0914fa670350edd050dd68472142",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 137,
"avg_line_length": 30.62190812720848,
"alnum_prop": 0.6980152319409185,
"repo_name": "tfreitasleal/cslacontrib",
"id": "2bf6593a0db6e5737920362828df409a27e7395b",
"size": "8666",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "branches/2010.11.001/CodeGenTemplates/MyGeneration/Samples/Northwind/Northwind/Northwind.CSLA.Library/Generated/OrderOrderDetails.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "28641"
},
{
"name": "Assembly",
"bytes": "2933"
},
{
"name": "Batchfile",
"bytes": "3396"
},
{
"name": "C#",
"bytes": "4796548"
},
{
"name": "CSS",
"bytes": "4998"
},
{
"name": "HTML",
"bytes": "423"
},
{
"name": "JavaScript",
"bytes": "17332"
},
{
"name": "PLpgSQL",
"bytes": "90627"
},
{
"name": "PowerShell",
"bytes": "31128"
},
{
"name": "SourcePawn",
"bytes": "183757"
},
{
"name": "Visual Basic",
"bytes": "687437"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections.Generic;
using System.Linq;
namespace Strilanc.PickleJar.Internal {
/// <summary>
/// CollectionUtil contains internal utility and convenience methods related to collections such as sets, lists, and enumerables.
/// </summary>
internal static class CollectionUtil {
public static IEnumerable<int> IndexesOf<T>(this IEnumerable<T> sequence, T item) {
if (sequence == null) throw new ArgumentNullException("sequence");
var i = 0;
foreach (var e in sequence) {
if (Equals(e, item)) yield return i;
i++;
}
}
public static T? NullableFirst<T>(this IEnumerable<T> sequence) where T : struct {
return sequence.Select(e => (T?)e).FirstOrDefault();
}
/// <summary>
/// Returns a dictionary with key/value pairs corresponding to items from the given sequence.
/// The key used for each item is the result of applying the given key selector function to the item.
/// The value used for each item is the item itself.
/// </summary>
public static IReadOnlyDictionary<TKey, TValue> KeyedBy<TKey, TValue>(this IEnumerable<TValue> sequence, Func<TValue, TKey> keySelector) {
return sequence.ToDictionary(keySelector, e => e);
}
public static TItem MaxBy<TItem, TCompare>(this IEnumerable<TItem> sequence, Func<TItem, TCompare> compareSelector) {
if (sequence == null) throw new ArgumentNullException("sequence");
if (compareSelector == null) throw new ArgumentNullException("compareSelector");
var comparer = Comparer<TCompare>.Default;
return sequence.Aggregate((e1, e2) => comparer.Compare(compareSelector(e1), compareSelector(e2)) >= 0 ? e1 : e2);
}
///<summary>Returns an array segment over the same data, but with the start of the range advanced by the given count and the end kept fixed.</summary>
public static ArraySegment<T> Skip<T>(this ArraySegment<T> segment, int count) {
return new ArraySegment<T>(segment.Array, segment.Offset + count, segment.Count - count);
}
///<summary>Returns an array segment over the same data, but with the end of the range stopped at the given count.</summary>
public static ArraySegment<T> Take<T>(this ArraySegment<T> segment, int count) {
if (count > segment.Count) throw new ArgumentOutOfRangeException("count");
return new ArraySegment<T>(segment.Array, segment.Offset, count);
}
///<summary>Determines if all items from the second given sequence are present in the first given sequence.</summary>
public static bool IsSameOrSubsetOf<T>(this IEnumerable<T> sequence, IEnumerable<T> other) {
var r = new HashSet<T>(other);
return sequence.All(r.Contains);
}
///<summary>Determines if the two given sequences contain the same items, not counting duplicates.</summary>
public static bool HasSameSetOfItemsAs<T>(this IEnumerable<T> sequence, IEnumerable<T> other) {
var r1 = new HashSet<T>(other);
var r2 = new HashSet<T>(sequence);
return r1.Count == r2.Count && r2.All(r1.Contains);
}
public static IEnumerable<TOut> Stream<TIn, TOut>(this IEnumerable<TIn> sequence, TOut seed, Func<TOut, TIn, TOut> acc) {
return sequence.Select(e => seed = acc(seed, e));
}
public static IEnumerable<Tuple<TIn, TStream>> StreamZip<TIn, TStream>(this IEnumerable<TIn> sequence, TStream seed, Func<TStream, TIn, TStream> acc) {
return sequence.Stream(Tuple.Create(default(TIn), seed), (a, e) => Tuple.Create(e, acc(a.Item2, e)));
}
public static bool HasSameKeyValuesAs<TKey, TValue>(this IReadOnlyDictionary<TKey, TValue> dictionary, IReadOnlyDictionary<TKey, TValue> other) {
return dictionary.Count == other.Count
&& dictionary.All(other.Contains);
}
public static byte[] Flatten(this List<byte[]> arrays) {
var size = arrays.Select(e => e.Length).Sum();
var result = new byte[size];
var offset = 0;
foreach (var array in arrays) {
array.CopyTo(result, offset);
offset += array.Length;
}
return result;
}
public static string TrimUpToOnePrefix(this string text, params string[] prefixes) {
return text.Substring(
prefixes
.Where(text.StartsWith)
.Select(e => e.Length)
.SingleOrDefault());
}
public static IEnumerable<IReadOnlyList<T>> StartNewPartitionWhen<T>(this IEnumerable<T> sequence, Func<T, bool> predicate) {
if (sequence == null) throw new ArgumentNullException("sequence");
if (predicate == null) throw new ArgumentNullException("predicate");
var curPartition = new List<T>();
foreach (var e in sequence) {
if (curPartition.Count > 0 && predicate(e)) {
yield return curPartition.ToArray();
curPartition.Clear();
}
curPartition.Add(e);
}
if (curPartition.Count > 0) {
yield return curPartition;
}
}
}
}
|
{
"content_hash": "1425c54b955c35a757886e9e8f1e1f17",
"timestamp": "",
"source": "github",
"line_count": 107,
"max_line_length": 159,
"avg_line_length": 51.05607476635514,
"alnum_prop": 0.6148636280431997,
"repo_name": "Strilanc/PickleJar",
"id": "aed5ae3abdfd2396c8bde733c69f38ddc11888fb",
"size": "5463",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "PickleJar/PickleJar/Internal/CollectionUtil.cs",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "C#",
"bytes": "174290"
}
],
"symlink_target": ""
}
|
package com.twitter.finagle.kestrel.unit
import com.google.common.cache.{CacheBuilder, CacheLoader}
import com.twitter.conversions.time._
import com.twitter.finagle.kestrel.Interpreter
import com.twitter.finagle.kestrel.protocol._
import com.twitter.finagle.memcached.util.ChannelBufferUtils._
import com.twitter.util.StateMachine.InvalidStateTransition
import com.twitter.util.Time
import java.util.concurrent.{BlockingDeque, LinkedBlockingDeque}
import org.jboss.netty.buffer.ChannelBuffer
import org.specs.SpecificationWithJUnit
class InterpreterSpec extends SpecificationWithJUnit {
"Interpreter" should {
val queues = CacheBuilder.newBuilder()
.build(new CacheLoader[ChannelBuffer, BlockingDeque[ChannelBuffer]] {
def load(k: ChannelBuffer) = new LinkedBlockingDeque[ChannelBuffer]
})
val interpreter = new Interpreter(queues)
"set & get" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(Get("name")) mustEqual
Values(Seq(Value("name", "rawr")))
}
"transactions" in {
"set & get/open & get/open" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(Open("name"))
interpreter(Open("name")) must throwA[InvalidStateTransition]
}
"set & get/abort" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(Abort("name")) must throwA[InvalidStateTransition]
}
"set & get/open & get/close" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(Open("name")) mustEqual
Values(Seq(Value("name", "rawr")))
interpreter(Close("name")) mustEqual Values(Seq())
interpreter(Open("name")) mustEqual Values(Seq())
}
"set & get/open & get/abort" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(Open("name")) mustEqual
Values(Seq(Value("name", "rawr")))
interpreter(Abort("name")) mustEqual Values(Seq())
interpreter(Open("name")) mustEqual
Values(Seq(Value("name", "rawr")))
}
}
"timeouts" in {
"set & get/t=1" in {
interpreter(Get("name", Some(1.millisecond))) mustEqual Values(Seq())
interpreter(Set("name", Time.now, "rawr"))
interpreter(Get("name", Some(1.second))) mustEqual Values(Seq(Value("name", "rawr")))
}
}
"delete" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(Delete("name"))
interpreter(Get("name")) mustEqual Values(Seq.empty)
}
"flush" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(Flush("name"))
interpreter(Get("name")) mustEqual Values(Seq.empty)
}
"flushAll" in {
interpreter(Set("name", Time.now, "rawr"))
interpreter(FlushAll())
interpreter(Get("name")) mustEqual Values(Seq.empty)
}
}
}
|
{
"content_hash": "1ad6bba295cbcddb2679873df88414bf",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 93,
"avg_line_length": 33.916666666666664,
"alnum_prop": 0.6423306423306423,
"repo_name": "stevegury/finagle",
"id": "a09d9951edb1cd50e3dc3b0b9a82b69f66fd6740",
"size": "2849",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "finagle-kestrel/src/test/scala/com/twitter/finagle/kestrel/unit/InterpreterSpec.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1326"
},
{
"name": "Java",
"bytes": "595278"
},
{
"name": "Python",
"bytes": "12212"
},
{
"name": "Ruby",
"bytes": "22132"
},
{
"name": "Scala",
"bytes": "1883404"
},
{
"name": "Shell",
"bytes": "11088"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">
<channel>
<title>Tier 3 village note bingo please</title>
<link>http://bvs.wikidot.com/forum/t-193764/tier-3-village-note-bingo-please</link>
<description>Posts in the discussion thread "Tier 3 village note bingo please" - seriitha lvl90 sannin alpha dog village</description>
<copyright></copyright>
<lastBuildDate>Sun, 10 Jul 2022 05:15:40 +0000</lastBuildDate>
<item>
<guid>http://bvs.wikidot.com/forum/t-193764#post-624111</guid>
<title>Tier 3 village note bingo please</title>
<link>http://bvs.wikidot.com/forum/t-193764/tier-3-village-note-bingo-please#post-624111</link>
<description></description>
<pubDate>Tue, 03 Nov 2009 20:41:22 +0000</pubDate>
<wikidot:authorName>Seriitha</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Seriitha in Alpha Dog village needs a note page bingo from someone else in a tier 3 village please.<br /> I'm a lvl90 sannin.</p>
]]>
</content:encoded> </item>
</channel>
</rss>
|
{
"content_hash": "4bfa37459c2680427ed8e77d7c93d1d2",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 146,
"avg_line_length": 51.391304347826086,
"alnum_prop": 0.6912013536379019,
"repo_name": "tn5421/tn5421.github.io",
"id": "1678b7bdf500444a3edeb821ded76f71de6db3d2",
"size": "1182",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "bvs.wikidot.com/feed/forum/t-193764.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "400301089"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using Newtonsoft.Json;
using Eb;
namespace Es
{
public class EntityLoaderCouchbase : EntityLoader
{
//---------------------------------------------------------------------
private IDbCouchbase mDbCouchbase;
private string mDbKey;
private ulong mEntityRpcId = 0;
//---------------------------------------------------------------------
public EntityLoaderCouchbase(EntityMgr entity_mgr, Entity parent,
string entity_type, string entity_guid, IDbCouchbase db_couchbase, bool recursive = false)
: base(entity_mgr, parent, recursive)
{
mDbCouchbase = db_couchbase;
mDbKey = entity_type + mEntityMgr.NodeTypeAsString + "_" + entity_guid;
}
//---------------------------------------------------------------------
public EntityLoaderCouchbase(EntityMgr entity_mgr, Entity parent,
string entity_type, string entity_guid, ulong entity_rpcid,
IDbCouchbase db_couchbase, bool recursive = false)
: base(entity_mgr, parent, recursive)
{
mDbCouchbase = db_couchbase;
mDbKey = entity_type + mEntityMgr.NodeTypeAsString + "_" + entity_guid;
mEntityRpcId = entity_rpcid;
}
//---------------------------------------------------------------------
public EntityLoaderCouchbase(EntityMgr entity_mgr, Entity parent, EntityData entity_data,
IDbCouchbase db_couchbase, bool recursive = false)
: base(entity_mgr, parent, recursive)
{
mDbCouchbase = db_couchbase;
mDbKey = entity_data.entity_type + mEntityMgr.NodeTypeAsString + "_" + entity_data.entity_guid;
mEntityData = entity_data;
}
//---------------------------------------------------------------------
// 运行在"ThreadSerializer"线程中
public override void handleLoad()
{
string json_data;
bool result = mDbCouchbase.executeGet(mDbKey, out json_data);
if (result)
{
mEntityData = JsonConvert.DeserializeObject<EntityData>(json_data);
if (mEntityRpcId != 0) mEntityData.entity_rpcid = mEntityRpcId;
}
else if (mEntityData == null)
{
EbLog.Error("EntityLoaderCouchbase.handleLoad() Error!mEntityData == null");
}
}
}
public class EntitySaverCouchbase : EntitySaver
{
//---------------------------------------------------------------------
private IDbCouchbase mDbCouchbase;
bool mRecursive = true;
//---------------------------------------------------------------------
public EntitySaverCouchbase(EntityMgr entity_mgr, Entity entity, IDbCouchbase db_couchbase, bool recursive = false)
: base(entity_mgr)
{
mDbCouchbase = db_couchbase;
mRecursive = recursive;
mEntityData = entity.genEntityData4SaveDb();
}
//---------------------------------------------------------------------
public EntitySaverCouchbase(EntityMgr entity_mgr)
: base(entity_mgr)
{
}
//---------------------------------------------------------------------
// 运行在"ThreadSerializer"线程中
public override void handleSave()
{
string db_key = mEntityData.entity_type + mEntityMgr.NodeTypeAsString + "_" + mEntityData.entity_guid;
string json_data = JsonConvert.SerializeObject(mEntityData);
bool result = mDbCouchbase.executeStore(db_key, json_data);
if (result)
{
}
else
{
// log error
// mLog.Error("CEntitySerializerCouchbase.handleSave() error! ");
// mLog.Error("save entity to db: entity_type=" + data.entity_type + " entity_id=" + data.entity_guid);
// mLog.Error(ret.Message);
// mLog.Error(json_map_prop);
}
}
}
}
|
{
"content_hash": "72135a0d1f73b49fa3c64d3398f7ed81",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 123,
"avg_line_length": 39.64150943396226,
"alnum_prop": 0.48810090433127085,
"repo_name": "ShuaiPointChen/def",
"id": "66d1a137152a1f36ea133262d66f9d9c3be12ca7",
"size": "4230",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Code/Es/EsEngine/EbCommonEx/EntitySerializerCouchbase.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "AGS Script",
"bytes": "5016"
},
{
"name": "C",
"bytes": "704235"
},
{
"name": "C#",
"bytes": "10505036"
},
{
"name": "C++",
"bytes": "887993"
},
{
"name": "CSS",
"bytes": "44571"
},
{
"name": "Java",
"bytes": "3580573"
},
{
"name": "JavaScript",
"bytes": "257017"
},
{
"name": "Perl",
"bytes": "298868"
},
{
"name": "Python",
"bytes": "179248"
},
{
"name": "Shell",
"bytes": "382099"
},
{
"name": "Visual Basic",
"bytes": "13005"
},
{
"name": "XSLT",
"bytes": "54326"
}
],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="utf-8" ?>
<Config xmlns="urn:Microsoft.SharePoint.PowerShell">
<Assembly Name="$SharePoint.Project.AssemblyFullName$">
<Cmdlet>
<VerbName>Install-CvrService</VerbName>
<ClassName>CvrService.Service.Cmdlets.InstallCvrServiceCmdlet</ClassName>
<HelpFile />
</Cmdlet>
<Cmdlet>
<VerbName>Uninstall-CvrService</VerbName>
<ClassName>CvrService.Service.Cmdlets.UninstallCvrServiceCmdlet</ClassName>
<HelpFile />
</Cmdlet>
<Cmdlet>
<VerbName>New-CvrServiceApplication</VerbName>
<ClassName>CvrService.Service.Cmdlets.NewCvrServiceApplicationCmdlet</ClassName>
<HelpFile />
</Cmdlet>
<Cmdlet>
<VerbName>New-CvrServiceApplicationProxy</VerbName>
<ClassName>CvrService.Service.Cmdlets.NewCvrServiceApplicationProxyCmdlet</ClassName>
<HelpFile />
</Cmdlet>
<Cmdlet>
<VerbName>Get-CvrServiceApplication</VerbName>
<ClassName>CvrService.Service.Cmdlets.GetCvrServiceApplicationCmdlet</ClassName>
<HelpFile />
</Cmdlet>
<Cmdlet>
<VerbName>Get-CvrServiceApplicationProxy</VerbName>
<ClassName>CvrService.Service.Cmdlets.GetCvrServiceApplicationProxyCmdlet</ClassName>
<HelpFile />
</Cmdlet>
<Cmdlet>
<VerbName>Remove-CvrServiceApplication</VerbName>
<ClassName>CvrService.Service.Cmdlets.RemoveCvrServiceApplicationCmdlet</ClassName>
<HelpFile />
</Cmdlet>
<Cmdlet>
<VerbName>Remove-CvrServiceApplicationProxy</VerbName>
<ClassName>CvrService.Service.Cmdlets.RemoveCvrServiceApplicationProxyCmdlet</ClassName>
<HelpFile />
</Cmdlet>
</Assembly>
</Config>
|
{
"content_hash": "b66d0934ea9cf4bfa4d3544f0445b0a5",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 94,
"avg_line_length": 37.355555555555554,
"alnum_prop": 0.7138607971445569,
"repo_name": "AndersRasmussen/SharePoint.CvrService",
"id": "715bbbfb459a1a4f52e2feeb92121c076fbe0596",
"size": "1683",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Solution/CvrService.Service/POWERSHELL/Registration/CvrService.dll.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "19528"
},
{
"name": "C#",
"bytes": "82993"
},
{
"name": "PowerShell",
"bytes": "2551"
}
],
"symlink_target": ""
}
|
"""
libweasyl common code.
The contents of this module should not depend on any other libweasyl module; it
is intended to be the base-most module that every other module can depend on.
"""
try:
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
def minimize_media(request, obj):
"""
Given :py:meth:`serialized <libweasyl.models.media.MediaItem.serialize>`
media, return a subset of its contents (reduced to only ``mediaid``,
``url``, and ``links``).
If *obj* is ``None``, ``None`` will be returned.
As a quick reminder, serialized media looks like this:
.. code-block:: json
{
"thumbnail": [
{
"display_url": "/static/media/34/44/8e/[...].png",
"sha256": "34448e4d8191351f080e3e9d0f633ccd1a569acf50f93c18ac164d9e0b553b0d",
"attributes": {
"height": 120,
"width": 120
},
"full_file_path": "/home/vagrant/weasyl3/weasyl/static/static/media/34/44/8e/[...].png",
"aspect_ratio": 1.0,
"media_type": "disk",
"file_type": "png",
"mediaid": 2421833,
"described": {},
"file_path": "static/media/34/44/8e/[...].png",
"link_attributes": {
"rating": 10
},
"file_url": "/static/media/34/44/8e/[...].png"
}
]
}
Minimizing reduces each media object so that it contains only the keys
``mediaid``, ``url``, and ``links``. ``mediaid`` is taken from the media
object verbatim; ``url`` is taken from the ``display_url`` key joined with
the *request* base URL; and ``links`` is the result of running
:py:func:`.minimize_media` on the ``described`` key.
So, minimized, the above media would be:
.. code-block:: json
{
"thumbnail": [
{
"mediaid": 2421833,
"links": {},
"url": "http://localhost/static/media/34/44/8e/[...].png"
}
]
}
Parameters:
request: The current pyramid :py:class:`~pyramid.request.Request`.
obj: A :py:meth:`serialized
<libweasyl.models.media.MediaItem.serialize>` media item to be
reduced.
Returns:
A dict or ``None``.
"""
if obj is None:
return None
base_url = request.resource_url(None)
return {
k: [
{
'mediaid': v['mediaid'],
'url': urljoin(base_url, v['display_url']),
'links': minimize_media(request, v['described']),
} for v in vs]
for k, vs in obj.items()}
|
{
"content_hash": "d1d66e43f8fd116448449a90a96e244d",
"timestamp": "",
"source": "github",
"line_count": 89,
"max_line_length": 100,
"avg_line_length": 30.146067415730336,
"alnum_prop": 0.540439806187104,
"repo_name": "dzamie/weasyl",
"id": "b81c63ed493508af23d1a450a8706dd8ae069fef",
"size": "2683",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "libweasyl/libweasyl/common.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "102056"
},
{
"name": "HTML",
"bytes": "464943"
},
{
"name": "Java",
"bytes": "304532"
},
{
"name": "JavaScript",
"bytes": "1323937"
},
{
"name": "Makefile",
"bytes": "11885"
},
{
"name": "Mako",
"bytes": "412"
},
{
"name": "Nginx",
"bytes": "1042"
},
{
"name": "Python",
"bytes": "934161"
},
{
"name": "Shell",
"bytes": "446"
}
],
"symlink_target": ""
}
|
class AddWorkflowToCompose < ActiveRecord::Migration
def change
add_reference :composes, :workflow, index: true, foreign_key: true
end
end
|
{
"content_hash": "0c55756c71ac8d49eac4103adf7957ff",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 70,
"avg_line_length": 29.4,
"alnum_prop": 0.7619047619047619,
"repo_name": "ricardobaumann/sms_test_workflow_service",
"id": "c7855d5a0fe38147bfe9c9f7ef7676e68040aa29",
"size": "147",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "db/migrate/20150624182223_add_workflow_to_compose.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "686"
},
{
"name": "HTML",
"bytes": "4900"
},
{
"name": "JavaScript",
"bytes": "661"
},
{
"name": "Ruby",
"bytes": "30757"
}
],
"symlink_target": ""
}
|
'''
New Integration Test for host where KVM VM ha located force stop and start again,
check vm self-start again.
This test is specific for 2local ps case
This test is sepcific for vr also on the disconnected host
@author: SyZhao
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.host_operations as host_ops
import zstackwoodpecker.zstack_test.zstack_test_vm as test_vm_header
import zstackwoodpecker.header.vm as vm_header
import zstackwoodpecker.operations.ha_operations as ha_ops
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.operations.config_operations as config_ops
import apibinding.inventory as inventory
import time
import os
vm = None
host_uuid = None
host_ip = None
max_attempts = None
storagechecker_timeout = None
test_stub = test_lib.lib_get_test_stub()
test_host = None
def test():
global vm
global host_uuid
global test_host
global host_ip
global max_attempts
global storagechecker_timeout
config_ops.change_global_config('localStoragePrimaryStorage', 'liveMigrationWithStorage.allow', 'true')
allow_ps_list = [inventory.LOCAL_STORAGE_TYPE]
test_lib.skip_test_when_ps_type_not_in_list(allow_ps_list)
if test_lib.lib_get_ha_enable() != 'true':
test_util.test_skip("vm ha not enabled. Skip test")
test_lib.lib_skip_if_ps_num_is_not_eq_number(2)
vm_creation_option = test_util.VmOption()
image_name = os.environ.get('imageName_net')
image_uuid = test_lib.lib_get_image_by_name(image_name).uuid
l3_name = os.environ.get('l3VlanNetworkName1')
l3_net_uuid = test_lib.lib_get_l3_by_name(l3_name).uuid
test_lib.clean_up_all_vr()
mn_ip = res_ops.query_resource(res_ops.MANAGEMENT_NODE)[0].hostName
conditions = res_ops.gen_query_conditions('type', '=', 'UserVm')
instance_offering_uuid = res_ops.query_resource(res_ops.INSTANCE_OFFERING, conditions)[0].uuid
conditions = res_ops.gen_query_conditions('state', '=', 'Enabled')
conditions = res_ops.gen_query_conditions('status', '=', 'Connected', conditions)
conditions = res_ops.gen_query_conditions('managementIp', '!=', mn_ip, conditions)
host_uuid = res_ops.query_resource(res_ops.HOST, conditions)[0].uuid
vm_creation_option.set_host_uuid(host_uuid)
vm_creation_option.set_l3_uuids([l3_net_uuid])
vm_creation_option.set_image_uuid(image_uuid)
vm_creation_option.set_instance_offering_uuid(instance_offering_uuid)
vm_creation_option.set_name('ls_vm_ha_self_start')
vm = test_vm_header.ZstackTestVm()
vm.set_creation_option(vm_creation_option)
vm.create()
test_stub.ensure_all_vrs_on_host(host_uuid)
#vm.check()
host_ip = test_lib.lib_find_host_by_vm(vm.get_vm()).managementIp
test_util.test_logger("host %s is disconnecting" %(host_ip))
ha_ops.set_vm_instance_ha_level(vm.get_vm().uuid, "NeverStop")
host_list = test_stub.get_sce_hosts(test_lib.all_scenario_config, test_lib.scenario_file)
for host in host_list:
if host.ip_ == host_ip:
test_host = host
break
if not test_host:
test_util.test_fail('there is no host with ip %s in scenario file.' %(host_ip))
test_stub.stop_host(test_host, test_lib.all_scenario_config)
vm_stop_time = None
cond = res_ops.gen_query_conditions('name', '=', 'ls_vm_ha_self_start')
cond = res_ops.gen_query_conditions('uuid', '=', vm.vm.uuid, cond)
for i in range(0, 300):
vm_stop_time = i
if res_ops.query_resource(res_ops.VM_INSTANCE, cond)[0].state == "Stopped":
test_stub.start_host(test_host, test_lib.all_scenario_config)
test_stub.recover_host_vlan(test_host, test_lib.all_scenario_config, test_lib.deploy_config)
break
time.sleep(1)
if vm_stop_time is None:
vm_stop_time = 300
for i in range(vm_stop_time, 300):
if res_ops.query_resource(res_ops.VM_INSTANCE, cond)[0].state == "Starting":
break
time.sleep(1)
else:
test_util.test_fail("vm has not been changed to running as expected within 300s.")
vm.destroy()
test_util.test_pass('Test checking VM ha and none status when force stop vm Success.')
#Will be called only if exception happens in test().
def error_cleanup():
global vm
if vm:
try:
vm.destroy()
except:
pass
def env_recover():
global test_host
try:
test_stub.start_host(test_host, test_lib.all_scenario_config)
test_stub.recover_host_vlan(test_host, test_lib.all_scenario_config, test_lib.deploy_config)
except:
pass
|
{
"content_hash": "6e3a32e4031c8429456f670366195ad9",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 107,
"avg_line_length": 38.1,
"alnum_prop": 0.6713103169796083,
"repo_name": "zstackio/zstack-woodpecker",
"id": "b44230c35cc704eea35fea07051905cf6c890ffa",
"size": "4953",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "integrationtest/vm/multihosts/ha/test_2ls_vr_vm_ha_grace_stop_host_vm_status.py",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "2356"
},
{
"name": "Go",
"bytes": "49822"
},
{
"name": "Makefile",
"bytes": "687"
},
{
"name": "Puppet",
"bytes": "875"
},
{
"name": "Python",
"bytes": "13070596"
},
{
"name": "Shell",
"bytes": "177861"
}
],
"symlink_target": ""
}
|
using OpenADK.Library;
using OpenADK.Library.Impl;
using Library.UnitTesting.Framework;
//using Library.Nunit.US;
//import com.OpenADK.Library.ADKTransportException;
//import com.OpenADK.Library.Agent;
//import com.OpenADK.Library.AgentProperties;
//import com.OpenADK.Library.impl.*;
namespace Library.UnitTesting.Framework
{
public class TestZoneImpl : ZoneImpl
{
public TestZoneImpl(string zoneId, string zoneUrl, Agent agent, AgentProperties props)
: base(zoneId, zoneUrl, agent, props)
{
}
public TestZoneImpl(string zoneId, string zoneUrl, Agent agent, AgentProperties props, MessageDispatcher dispatcher, IProtocolHandler proto)
: base(zoneId, zoneUrl, agent, props)
{
base.Dispatcher = dispatcher;
this.fProtocolHandler = proto;
}
public void SetDispatcher( MessageDispatcher dispatcher )
{
this.fDispatcher = dispatcher;
}
public IProtocolHandler Proto
{
get
{
return this.fProtocolHandler;
}
set
{
this.fProtocolHandler = value;
}
}
}//end class
}//end namespace
|
{
"content_hash": "e04bf7286b4d5e330c52f05d56f72690",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 146,
"avg_line_length": 25.847826086956523,
"alnum_prop": 0.6501261564339781,
"repo_name": "open-adk/OpenADK-csharp",
"id": "b468f79f87a330ad674476d0762a10744e3b2d5f",
"size": "1189",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nunit/framework/src/Framework/TestZoneImpl.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "16903092"
}
],
"symlink_target": ""
}
|
<?php
namespace SweetCaptcha\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class SweetCaptchaExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
$configuration = new Configuration();
$config = $this->processConfiguration($configuration, $configs);
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
$sweetCaptchaDefinition = $container->getDefinition('sweet_captcha.service');
$sweetCaptchaDefinition->replaceArgument(0, $config['id']);
$sweetCaptchaDefinition->replaceArgument(1, $config['key']);
$sweetCaptchaDefinition->replaceArgument(2, $config['secret']);
}
}
|
{
"content_hash": "092b4d18136d2d17208da97e853a56a3",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 104,
"avg_line_length": 39.2,
"alnum_prop": 0.7204081632653061,
"repo_name": "litvinok/SweetCaptchaBundle",
"id": "835f403fd87df75c81aea21ddbba86c3db8df75c",
"size": "980",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DependencyInjection/SweetCaptchaExtension.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "1885"
}
],
"symlink_target": ""
}
|
@extends('app')
@section('content')
<div class="module-wrapper edit-value-module">
<a class="back-btn" href="{{ route( 'variables.show', $dataValue->fk_var_id ) }}"><i class="fa fa-arrow-left"></i>Back to the variable</a>
<h2>Edit value</h2>
<div class="pull-right">
{!! Form::open(array('class' => 'form-inline', 'method' => 'DELETE', 'route' => array('values.destroy', $dataValue->id))) !!}
{!! Form::submit('Delete value', array('class' => 'btn btn-danger')) !!}
{!! Form::close() !!}
</div>
{!! Form::model($dataValue, [ 'class' => 'validate-form', 'method' => 'PATCH', 'route' => ['values.update', $dataValue->id]]) !!}
<div class="form-group">
{!! Form::label('value', 'Value:') !!}
{!! Form::text('value', null, array('class' => 'form-control required')) !!}
</div>
<div class="form-group">
{!! Form::label('year', 'Year:') !!}
{!! Form::text('year', $dataValue->year, array('class' => 'form-control')) !!}
</div>
<div class="form-group">
{!! Form::label('fk_ent_id', 'Entity:') !!}
{!! Form::select('fk_ent_id', $entities, $dataValue->fk_ent_id, array('class' => 'form-control')) !!}
</div>
<div class="form-group">
{!! Form::submit('Update value', ['class'=>'btn btn-success']) !!}
</div>
{!! Form::close() !!}
</div>
@endsection
|
{
"content_hash": "3176062d2c59c83bc0017a42f3293d5a",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 140,
"avg_line_length": 43.86666666666667,
"alnum_prop": 0.5585106382978723,
"repo_name": "mispy/our-world-in-data-grapher",
"id": "ecf449ae906d3c08fc03a7d707bf2f7b1a7b38d1",
"size": "1316",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "resources/views/values/edit.blade.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "360"
},
{
"name": "CSS",
"bytes": "272447"
},
{
"name": "HTML",
"bytes": "189456"
},
{
"name": "JavaScript",
"bytes": "1684882"
},
{
"name": "PHP",
"bytes": "339395"
},
{
"name": "PowerShell",
"bytes": "468"
},
{
"name": "Ruby",
"bytes": "6839"
},
{
"name": "Shell",
"bytes": "1120"
}
],
"symlink_target": ""
}
|
package org.artifactory.storage.db.fs.itest.service;
import org.artifactory.storage.db.itest.DbBaseTest;
import org.artifactory.storage.fs.service.ConfigsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.testng.annotations.Test;
import java.io.UnsupportedEncodingException;
import java.sql.SQLException;
import static org.testng.Assert.*;
/**
* Tests the {@link org.artifactory.storage.fs.service.ConfigsService}
*
* @author Yossi Shaul
*/
public class ConfigsServiceImplTest extends DbBaseTest {
@Autowired
private ConfigsService configsService;
public void addConfig() throws SQLException, UnsupportedEncodingException {
configsService.addConfig("confName", "confinput");
}
@Test(dependsOnMethods = "addConfig")
public void hasConfig() throws SQLException {
assertTrue(configsService.hasConfig("confName"));
}
@Test(dependsOnMethods = "addConfig")
public void getConfig() throws SQLException {
String data = configsService.getConfig("confName");
assertNotNull(data);
assertEquals(data, "confinput");
}
@Test(dependsOnMethods = "getConfig")
public void updateConfig() throws SQLException, UnsupportedEncodingException {
configsService.updateConfig("confName", "newdata");
String result = configsService.getConfig("confName");
assertNotNull(result);
assertEquals(result, "newdata");
}
public void hasConfigNoConfig() throws SQLException {
assertFalse(configsService.hasConfig("nosuchconfig"));
}
public void loadConfigNoConfig() throws SQLException {
assertNull(configsService.getConfig("nosuchconfig"));
}
@Test(expectedExceptions = IllegalStateException.class)
public void updateConfigNoConfig() throws SQLException, UnsupportedEncodingException {
configsService.updateConfig("nosuchconfig", "newdata");
}
@Test(dependsOnMethods = "addConfig", expectedExceptions = IllegalStateException.class)
public void addConfigExistingConfig() throws SQLException {
configsService.addConfig("confName", "jojjoh");
}
public void addOrUpdateConfig() {
boolean created = configsService.addOrUpdateConfig("artifactory", "somedata");
assertTrue(created);
assertEquals(configsService.getConfig("artifactory"), "somedata");
created = configsService.addOrUpdateConfig("artifactory", "newdata");
assertFalse(created);
assertEquals(configsService.getConfig("artifactory"), "newdata");
}
}
|
{
"content_hash": "9fa6a2a03a7f58e22a9ad90ac3ad9809",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 91,
"avg_line_length": 33.88157894736842,
"alnum_prop": 0.7254368932038835,
"repo_name": "alancnet/artifactory",
"id": "c5ffb1c0561ab94283273410478126488c4fea86",
"size": "3330",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "storage/db/src/test/java/org/artifactory/storage/db/fs/itest/service/ConfigsServiceImplTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "5927"
},
{
"name": "CSS",
"bytes": "1527354"
},
{
"name": "Groovy",
"bytes": "14386"
},
{
"name": "HTML",
"bytes": "844850"
},
{
"name": "Java",
"bytes": "13075494"
},
{
"name": "JavaScript",
"bytes": "3810535"
},
{
"name": "Shell",
"bytes": "42908"
}
],
"symlink_target": ""
}
|
package hex.tree.xgboost.util;
import water.BootstrapFreezable;
import water.Iced;
public class FeatureScore extends Iced<FeatureScore> implements BootstrapFreezable<FeatureScore> {
public static final String GAIN_KEY = "gain";
public static final String COVER_KEY = "cover";
public int _frequency = 1;
public float _gain;
public float _cover;
public void add(FeatureScore fs) {
_frequency += fs._frequency;
_gain += fs._gain;
_cover += fs._cover;
}
}
|
{
"content_hash": "a25a7a59c92dfa74f5fbe77b2909e486",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 98,
"avg_line_length": 25.85,
"alnum_prop": 0.6653771760154739,
"repo_name": "h2oai/h2o-3",
"id": "0e546f5a7832d20972bf24512e649dc7ebd528c4",
"size": "517",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/util/FeatureScore.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "12803"
},
{
"name": "CSS",
"bytes": "882321"
},
{
"name": "CoffeeScript",
"bytes": "7550"
},
{
"name": "DIGITAL Command Language",
"bytes": "106"
},
{
"name": "Dockerfile",
"bytes": "10459"
},
{
"name": "Emacs Lisp",
"bytes": "2226"
},
{
"name": "Groovy",
"bytes": "205646"
},
{
"name": "HCL",
"bytes": "36232"
},
{
"name": "HTML",
"bytes": "8018117"
},
{
"name": "HiveQL",
"bytes": "3985"
},
{
"name": "Java",
"bytes": "15981357"
},
{
"name": "JavaScript",
"bytes": "148426"
},
{
"name": "Jupyter Notebook",
"bytes": "20638329"
},
{
"name": "Makefile",
"bytes": "46043"
},
{
"name": "PHP",
"bytes": "800"
},
{
"name": "Python",
"bytes": "8188608"
},
{
"name": "R",
"bytes": "4149977"
},
{
"name": "Ruby",
"bytes": "64"
},
{
"name": "Sass",
"bytes": "23790"
},
{
"name": "Scala",
"bytes": "4845"
},
{
"name": "Shell",
"bytes": "214495"
},
{
"name": "Smarty",
"bytes": "1792"
},
{
"name": "TeX",
"bytes": "554940"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Ergebnisse der Bundestagswahl 2017: Karlsruher Wahlanzeiger</title>
<meta name="description" content="Analysen und Visualisierungen der Daten zur Bundestagswahl 2017 in Karlsruhe. Größte Änderungen, Wechselwähler, Erststimmen und mehr Statistiken.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@codeforka">
<meta name="twitter:title" content="Ergebnisse der Bundestagswahl 2017: Karlsruher Wahlanzeiger">
<meta name="twitter:description" content="Analysen und Visualisierungen der Daten zur Bundestagswahl 2017 in Karlsruhe. Größte Änderungen, Wechselwähler, Erststimmen und mehr Statistiken.">
<meta name="twitter:image" content="">
<meta property="og:type" content="article">
<meta property="og:title" content="Ergebnisse der Bundestagswahl 2017: Karlsruher Wahlanzeiger">
<meta property="og:site_name" content="OK Lab Karlsruhe">
<meta property="og:url" content="https://codeforkarlsruhe.github.io/wahlkarte/">
<meta property="og:image" content="">
<meta property="article:published_time" content="2017-09-24">
<meta property="article:author" content="https://www.facebook.com/codeforkarlsruhe/">
<script src="//d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="vendor/bootstrap-4.0.0-beta/dist/js/bootstrap.min.js"></script>
<script src="vendor/leaflet.js"></script>
<script src="vendor/bluebird.min.js"></script>
<script type="application/javascript" src="constants.js"></script>
<script type="application/javascript" src="src/global.js"></script>
<script type="application/javascript" src="src/szenarien/farbermittlung.js"></script>
<script type="application/javascript" src="src/szenarien/SzenarienConst.js"></script>
<script type="application/javascript" src="src/szenarien/szenarien.js"></script>
<script type="application/javascript" src="src/extendedTooltip/extendedTooltip.js"></script>
<script type="application/javascript" src="src/tooltip/tooltip.js"></script>
<script type="application/javascript" src="wahlkarte.js"></script>
<link rel="stylesheet" href="vendor/leaflet.css"/>
<link rel="stylesheet" href="vendor/bootstrap-4.0.0-beta/dist/css/bootstrap.min.css">
<link rel="stylesheet" href="vendor/font-awesome-4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="src/tooltip/tooltip.css">
<link rel="stylesheet" href="src/extendedTooltip/extendedTooltip.css">
<style>
html {
padding: 0;
}
body {
padding: 50px 0 0 0;
}
a {color: rgba(255,255,255,0.7);}
a:hover {color: rgba(255,255,255,1);}
.modal-body a {color: #1abc9c;}
#map {
width: 100%;
cursor: pointer;
}
@media (max-width: 991px) {
#map {
height: 75vh;
}
}
@media (min-width: 992px) {
#map {
height: calc(100vh - 50px);
position: fixed;
}
}
.map-column {
padding: 0;
}
.text-column {
padding: 0;
background-color: #1abc9c;
}
.carousel-inner {
width: 100%;
height: calc(100vh - 50px);
}
@media (max-width: 991px) {
.carousel-inner {
height: auto;
min-height: 30vh;
}
}
.carousel-item {
padding: 20px 50px 30px 50px;
}
.carousel-control-next,
.carousel-control-prev {
/* Overwrite Bootstrap's standard 15% with the
padding of .carousel-item */
width: 50px;
}
.wahl-carousel-control {
align-items: flex-start;
padding-top: 40px;
}
.wahl-carousel-caption {
color: #fff;
}
.flex{
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
}
.wahlbezirk, .district {
opacity: 0.5;
}
.wahlbezirk:hover, .district:hover
{
opacity: 1;
}
#aboutModal img {
width: 200px;
height: 200px;
float: left;
}
#navbar .container {
padding-left: 0;
padding-right: 0;
max-width: none;
}
#navbar .nav-item {
margin-left: 20px;
}
#aboutButton {
margin-left: 20px;
}
@media (max-width: 670px) {
#navbar .navbar-brand {
font-size: 15px;
}
#navbar .nav-item {
margin-left: 12px;
}
#aboutButton {
margin-left: 0;
}
#navbar .subtitle {
display: none;
}
}
#navbar .nav-item:first-child {
margin-left: 0;
}
@media (max-width: 991px) and (min-height: 425px) {
#extended-tooltip {
position: absolute;
right: 20px;
left: auto;
top: 70px;
bottom: auto;
}
}
@media (max-width: 991px) and (max-height: 424px) {
#extended-tooltip {
position: absolute;
right: 110vw;
left: auto;
}
}
@media (max-width: 524px) {
#extended-tooltip {
position: absolute;
right: 110vw;
left: auto;
}
}
</style>
</head>
<body>
<nav id="navbar" class="navbar navbar-light bg-light fixed-top justify-content-between flex-nowrap flex-row">
<div class="container">
<span class="navbar-brand"><span class="title">Karlsruher Wahlanzeiger</span><span class="subtitle">: Bundestagswahl 2017</span></span>
<ul class="nav navbar-nav flex-row float-right">
<li class="nav-item">
<a id="twitterButton" class="nav-link" href="#" target="_blank" title="Auf Twitter teilen">
<span class="fa fa-lg fa-twitter" aria-hidden="true"></span>
<span class="sr-only">Auf Twitter teilen</span>
</a>
</li>
<li class="nav-item">
<a id="facebookButton" class="nav-link" href="#" target="_blank" title="Auf Facebook teilen">
<span class="fa fa-lg fa-facebook" aria-hidden="true"></span>
<span class="sr-only">Auf Facebook teilen</span>
</a>
</li>
<li class="nav-item">
<a id="whatsappButton" class="nav-link" title="Auf WhatsApp teilen">
<span class="fa fa-lg fa-whatsapp" aria-hidden="true"></span>
<span class="sr-only">Auf WhatsApp teilen</span>
</a>
</li>
<li class="nav-item">
<a id="aboutButton" class="nav-link" data-toggle="modal" href="#aboutModal" title="Über diese Seite">
<span class="fa fa-lg fa-info-circle" aria-hidden="true"></span>
<span class="sr-only">Info</span>
</a>
</li>
</ul>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div class="map-column col-12 col-lg-9">
<div id="map"></div>
</div>
<div class="text-column col-12 col-lg-3">
<div id="szenarien-carousel" class="carousel slide" data-ride="carousel" data-interval="false">
<ol id="indicators" class="carousel-indicators"></ol>
<div id="innerCarousel" class="carousel-inner"></div>
<a class="wahl-carousel-control carousel-control-prev" href="#szenarien-carousel" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="wahl-carousel-control carousel-control-next" href="#szenarien-carousel" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</div>
<div id="extended-tooltip">
<div id="extended-tooltip-header">
<h5 id="extended-tooltip-district-name"> </h5>
<span onclick="closeInfoPanel()" class="extended-tooltip-close-button"><i class="fa fa-times-circle" aria-hidden="true"></i></span>
<ul class="nav nav-pills mb-2 mt-2" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link" id="pills-erststimme-tab" data-toggle="pill" href="#pills-erststimme" role="tab" aria-controls="pills-erststimme" aria-expanded="true">Erststimme</a>
</li>
<li class="nav-item">
<a class="nav-link active" id="pills-zweitstimme-tab" data-toggle="pill" href="#pills-zweitstimme" role="tab" aria-controls="pills-zweitstimme" aria-expanded="true">Zweitstimme</a>
</li>
</ul>
</div>
<div id="extended-tooltip-detail-district-info">
<div class="tab-content" id="pills-tabContent">
<div class="tab-pane fade" id="pills-erststimme" role="tabpanel" aria-labelledby="pills-erststimme-tab">...</div>
<div class="tab-pane fade show active" id="pills-zweitstimme" role="tabpanel" aria-labelledby="pills-zweitstimme-tab">...</div>
</div>
</div>
</div>
<div id="tool-tip">
</div>
<div class="modal fade" id="aboutModal" tabindex="-1" role="dialog" aria-labelledby="aboutModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="aboutModalLabel">Über diese Seite</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<a href="https://codefor.de/karlsruhe"><img src="img/codeforka.png"></a>
<p>Ein Projekt des <a href="https://codefor.de/karlsruhe">Open Knowledge Lab Karlsruhe</a>, inspiriert von der <a href="http://berlinwahlkarte2016.morgenpost.de/">Berlinwahlkarte</a> der Berliner Morgenpost.</p>
<p>Den Quellcode findet ihr <a href="https://github.com/codeforkarlsruhe/wahlkarte">auf GitHub</a>.</p>
<p>Wir verwenden Daten der Stadt Karlsruhe, veröffentlicht in deren <a href="https://transparenz.karlsruhe.de">Transparenzportal</a> unter der <a href="https://www.govdata.de/dl-de/by-2-0">Datenlizenz Deutschland — Namensnennung — Version 2.0</a>.</p>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>
<script src="vendor/bootstrap-4.0.0-beta/dist/js/bootstrap.min.js"></script>
</body>
</html>
|
{
"content_hash": "0687490554473343aef92795692854cd",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 271,
"avg_line_length": 42.156666666666666,
"alnum_prop": 0.5553886297145568,
"repo_name": "CodeforKarlsruhe/wahlkarte",
"id": "076c53f14d59effc536b8d266aaec22ce84ddda3",
"size": "12658",
"binary": false,
"copies": "1",
"ref": "refs/heads/gh-pages",
"path": "index.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1614"
},
{
"name": "HTML",
"bytes": "12658"
},
{
"name": "JavaScript",
"bytes": "36520"
}
],
"symlink_target": ""
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Telligent.Evolution.Mobile.Web.Services;
using System.IO;
namespace Telligent.Evolution.Mobile.Web
{
public class JavaScripts : IHttpHandler
{
IMobileConfiguration Configuration = ServiceLocator.Get<IMobileConfiguration>();
#region IHttpHandler Members
public bool IsReusable
{
get { return true; }
}
public void ProcessRequest(HttpContext context)
{
var lastModifiedDateUtc = Configuration.LastModifiedDateUtc;
if (lastModifiedDateUtc > DateTime.UtcNow)
lastModifiedDateUtc = DateTime.UtcNow;
context.Response.Cache.SetAllowResponseInBrowserHistory(true);
context.Response.Cache.SetLastModified(lastModifiedDateUtc);
context.Response.Cache.SetETag(lastModifiedDateUtc.Ticks.ToString());
context.Response.Cache.SetCacheability(HttpCacheability.Public);
context.Response.Cache.SetExpires(DateTime.UtcNow.AddHours(2));
context.Response.Cache.SetValidUntilExpires(false);
context.Response.ContentType = "text/javascript";
var scripts = Configuration.JavaScripts;
if (scripts != null)
context.Response.Write(UpdateEmbeddedFileReferences(context, string.Join("\n", scripts)));
}
#endregion
private string UpdateEmbeddedFileReferences(HttpContext context, string js)
{
return js.Replace("embeddedfile:", HttpUtility.JavaScriptStringEncode(Host.Get(Host.DefaultId).AbsoluteUrl("~/embeddedfile/")));
}
}
}
|
{
"content_hash": "7471a0953eb8f13d844df82bbeee78f2",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 140,
"avg_line_length": 31.48936170212766,
"alnum_prop": 0.775,
"repo_name": "Telligent/Mobile-SDK",
"id": "94fa5e5d7503b5cc8e20aa5e64c4a0424ab5aaeb",
"size": "1482",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/TelligentEvolution.Mobile.Web/Handlers/JavaScripts.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "113"
},
{
"name": "Batchfile",
"bytes": "1424"
},
{
"name": "C#",
"bytes": "248733"
},
{
"name": "CSS",
"bytes": "90295"
},
{
"name": "HTML",
"bytes": "115760"
},
{
"name": "JavaScript",
"bytes": "1240488"
}
],
"symlink_target": ""
}
|
using System;
using System.Runtime.Serialization;
namespace SharpRemote.CodeGeneration.Serialization.Xml
{
/// <summary>
///
/// </summary>
internal sealed class XmlFormatterConverter
: IFormatterConverter
{
public object Convert(object value, Type type)
{
throw new NotImplementedException();
}
public object Convert(object value, TypeCode typeCode)
{
throw new NotImplementedException();
}
public bool ToBoolean(object value)
{
throw new NotImplementedException();
}
public char ToChar(object value)
{
throw new NotImplementedException();
}
public sbyte ToSByte(object value)
{
throw new NotImplementedException();
}
public byte ToByte(object value)
{
throw new NotImplementedException();
}
public short ToInt16(object value)
{
throw new NotImplementedException();
}
public ushort ToUInt16(object value)
{
throw new NotImplementedException();
}
public int ToInt32(object value)
{
throw new NotImplementedException();
}
public uint ToUInt32(object value)
{
throw new NotImplementedException();
}
public long ToInt64(object value)
{
throw new NotImplementedException();
}
public ulong ToUInt64(object value)
{
throw new NotImplementedException();
}
public float ToSingle(object value)
{
throw new NotImplementedException();
}
public double ToDouble(object value)
{
throw new NotImplementedException();
}
public decimal ToDecimal(object value)
{
throw new NotImplementedException();
}
public DateTime ToDateTime(object value)
{
throw new NotImplementedException();
}
public string ToString(object value)
{
throw new NotImplementedException();
}
}
}
|
{
"content_hash": "73f48fc3ee40c64a113233fac950ddd0",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 56,
"avg_line_length": 17.804123711340207,
"alnum_prop": 0.7081644470179502,
"repo_name": "Kittyfisto/SharpRemote",
"id": "d6601c78f8ac34fecec6ba0f2daa6c5dbbe4ccdd",
"size": "1729",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "SharpRemote/CodeGeneration/Serialization/Xml/XmlFormatterConverter.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "387"
},
{
"name": "C#",
"bytes": "1902498"
},
{
"name": "C++",
"bytes": "239"
}
],
"symlink_target": ""
}
|
package com.yeleman.nutrition;
import com.yeleman.snisidroid.Constants;
import android.util.Log;
import com.orm.dsl.Ignore;
import com.yeleman.snisidroid.ReportData;
public class NutritionURENAMReportData extends ReportData {
@Ignore
private final static String TAG = Constants.getLogTag(
NutritionURENAMReportData.class.getSimpleName());
int u23o6_total_start_m = -1;
int u23o6_total_start_f = -1;
int u23o6_new_cases = -1;
int u23o6_returned = -1;
int u23o6_total_in_m = -1;
int u23o6_total_in_f = -1;
int u23o6_healed = -1;
int u23o6_deceased = -1;
int u23o6_abandon = -1;
int u23o6_not_responding = -1;
int u23o6_total_out_m = -1;
int u23o6_total_out_f = -1;
int u23o6_referred = -1;
int u23o6_total_end_m = -1;
int u23o6_total_end_f = -1;
boolean u23o6_is_complete = false;
// 23-59 months
int u59o23_total_start_m = -1;
int u59o23_total_start_f = -1;
int u59o23_new_cases = -1;
int u59o23_returned = -1;
int u59o23_total_in_m = -1;
int u59o23_total_in_f = -1;
int u59o23_healed = -1;
int u59o23_deceased = -1;
int u59o23_abandon = -1;
int u59o23_not_responding = -1;
int u59o23_total_out_m = -1;
int u59o23_total_out_f = -1;
int u59o23_referred = -1;
int u59o23_total_end_m = -1;
int u59o23_total_end_f = -1;
boolean u59o23_is_complete = false;
// 59+ months
int o59_total_start_m = -1;
int o59_total_start_f = -1;
int o59_new_cases = -1;
int o59_returned = -1;
int o59_total_in_m = -1;
int o59_total_in_f = -1;
int o59_healed = -1;
int o59_deceased = -1;
int o59_abandon = -1;
int o59_not_responding = -1;
int o59_total_out_m = -1;
int o59_total_out_f = -1;
int o59_referred = -1;
int o59_total_end_m = -1;
int o59_total_end_f = -1;
boolean o59_is_complete = false;
// Pregnant & Breast Feeding Women
int pw_total_start_f = -1;
int pw_new_cases = -1;
int pw_returned = -1;
int pw_total_in_f = -1;
int pw_healed = -1;
int pw_deceased = -1;
int pw_abandon = -1;
int pw_not_responding = -1;
int pw_total_out_f = -1;
int pw_referred = -1;
int pw_total_end_f = -1;
boolean pw_is_complete = false;
// Former SAM
int exsam_total_start_m = -1;
int exsam_total_start_f = -1;
int exsam_grand_total_in = -1;
int exsam_grand_total_out = -1;
int exsam_total_end_m = -1;
int exsam_total_end_f = -1;
boolean exsam_is_complete = false;
public NutritionURENAMReportData() {
}
public static NutritionURENAMReportData get() {
NutritionURENAMReportData report = getUniqueRecord(NutritionURENAMReportData.class);
if (report == null) {
Log.d(TAG, "No Record in DB. Creating.");
report = new NutritionURENAMReportData();
report.safeSave();
} else {
Log.d(TAG, "Record exist in Database.");
}
return report;
}
@Override
protected String buildName() {
return "Mensuel URENAM";
}
protected Boolean isComplete() {
return pw_is_complete &&
o59_is_complete &&
u23o6_is_complete &&
u59o23_is_complete &&
exsam_is_complete;
}
protected Boolean atLeastOneIsComplete() {
return pw_is_complete ||
o59_is_complete ||
u23o6_is_complete ||
u59o23_is_complete ||
exsam_is_complete;
}
protected void resetReportData() {
this.pw_is_complete = false;
this.o59_is_complete = false;
this.u23o6_is_complete = false;
this.u59o23_is_complete = false;
this.exsam_is_complete = false;
this.safeSave();
}
public String buildSMSText() {
Log.d(TAG, "buildSMSText");
return Constants.stringFromReport(u23o6_total_start_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_total_start_f) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_new_cases) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_returned) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_total_in_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_total_in_f) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_healed) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_deceased) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_abandon) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_not_responding) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_total_out_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_total_out_f) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_referred) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_total_end_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u23o6_total_end_f) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_start_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_start_f) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_new_cases) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_returned) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_in_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_in_f) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_healed) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_deceased) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_abandon) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_not_responding) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_out_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_out_f) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_referred) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_end_m) + Constants.SUB_SPACER +
Constants.stringFromReport(u59o23_total_end_f) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_start_m) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_start_f) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_new_cases) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_returned) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_in_m) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_in_f) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_healed) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_deceased) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_abandon) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_not_responding) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_out_m) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_out_f) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_referred) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_end_m) + Constants.SUB_SPACER +
Constants.stringFromReport(o59_total_end_f) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_total_start_f) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_new_cases) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_returned) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_total_in_f) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_healed) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_deceased) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_abandon) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_not_responding) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_total_out_f) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_referred) + Constants.SUB_SPACER +
Constants.stringFromReport(pw_total_end_f) + Constants.SUB_SPACER +
Constants.stringFromReport(exsam_total_start_m) + Constants.SUB_SPACER +
Constants.stringFromReport(exsam_total_start_f) + Constants.SUB_SPACER +
Constants.stringFromReport(exsam_grand_total_in) + Constants.SUB_SPACER +
Constants.stringFromReport(exsam_grand_total_out) + Constants.SUB_SPACER +
Constants.stringFromReport(exsam_total_end_m) + Constants.SUB_SPACER +
Constants.stringFromReport(exsam_total_end_f);
}
public int totalStartM() {
return Constants.integerFromReport(u23o6_total_start_m) +
Constants.integerFromReport(u59o23_total_start_m) +
Constants.integerFromReport(o59_total_start_m) +
Constants.integerFromReport(exsam_total_start_m);
}
public int totalStartF() {
return Constants.integerFromReport(u23o6_total_start_f) +
Constants.integerFromReport(u59o23_total_start_f) +
Constants.integerFromReport(o59_total_start_f) +
Constants.integerFromReport(pw_total_start_f) +
Constants.integerFromReport(exsam_total_start_f);
}
public int totalStart() {
return totalStartF() + totalStartM();
}
public int totalInM() {
return Constants.integerFromReport(u23o6_total_in_m) +
Constants.integerFromReport(u59o23_total_in_m) +
Constants.integerFromReport(o59_total_in_m);
}
public int totalInF() {
return Constants.integerFromReport(u23o6_total_in_f) +
Constants.integerFromReport(u59o23_total_in_f) +
Constants.integerFromReport(o59_total_in_f) +
Constants.integerFromReport(pw_total_in_f);
}
public int totalIn() {
return totalInF() + totalInM();
}
public int totalTransferred() { return 0; }
public int grandTotalIn() {
return totalIn() + totalTransferred()
+ Constants.integerFromReport(exsam_grand_total_in);
}
public int totalOutM() {
return Constants.integerFromReport(u23o6_total_out_m) +
Constants.integerFromReport(u59o23_total_out_m) +
Constants.integerFromReport(o59_total_out_m);
}
public int totalOutF() {
return Constants.integerFromReport(u23o6_total_out_f) +
Constants.integerFromReport(u59o23_total_out_f) +
Constants.integerFromReport(o59_total_out_f) +
Constants.integerFromReport(pw_total_out_f);
}
public int totalOut() {
return totalOutF() + totalOutM();
}
public int totalReferred() {
return Constants.integerFromReport(u23o6_referred) +
Constants.integerFromReport(u59o23_referred) +
Constants.integerFromReport(o59_referred) +
Constants.integerFromReport(pw_referred);
}
public int grandTotalOut() {
return totalOut() + totalReferred()
+ Constants.integerFromReport(exsam_grand_total_out);
}
public int totalEndM() {
return Constants.integerFromReport(u23o6_total_end_m) +
Constants.integerFromReport(u59o23_total_end_m) +
Constants.integerFromReport(o59_total_end_m) +
Constants.integerFromReport(exsam_total_end_m);
}
public int totalEndF() {
return Constants.integerFromReport(u23o6_total_end_f) +
Constants.integerFromReport(u59o23_total_end_f) +
Constants.integerFromReport(o59_total_end_f) +
Constants.integerFromReport(pw_total_end_f) +
Constants.integerFromReport(exsam_total_end_f);
}
public int totalEnd() {
return totalEndM() + totalEndF();
}
}
|
{
"content_hash": "baf2b783c90c229d5aa61a1d07bae4a0",
"timestamp": "",
"source": "github",
"line_count": 288,
"max_line_length": 92,
"avg_line_length": 42.96527777777778,
"alnum_prop": 0.6288184903830613,
"repo_name": "yeleman/SNISI-droid",
"id": "34e60408fe8a3c8766411d4a41cd1f32dc5bb04a",
"size": "12374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/yeleman/nutrition/NutritionURENAMReportData.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "365451"
}
],
"symlink_target": ""
}
|
/**
* Author : Aman Gupta
* Email Id : aman.tit10@gmail.com
* Design Pattern : Chain of Responsiblity
*/
package com.example.pattern.chain;
/**
* @author Aman Gupta (aman.tit10@gmail.com)
* @version 1.0
*/
public class ConsoleLogger extends AbstractLogger {
public ConsoleLogger(int level) {
this.level = level;
}
@Override
public void writeMessage(String message) {
System.out.println("Standard Console Logger :" + message);
}
}
|
{
"content_hash": "0eca1271483374d34f9bdd152e86880c",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 60,
"avg_line_length": 19.791666666666668,
"alnum_prop": 0.6631578947368421,
"repo_name": "AmanGupta-2210/com.example.designpatterns",
"id": "f9b5e86e9f18a5cf0aef5966e7fd2ebcdd6fac50",
"size": "475",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "com.example.designpatterns/src/main/java/com/example/pattern/chain/ConsoleLogger.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "86031"
}
],
"symlink_target": ""
}
|
#!/bin/bash -xe
# Release dev packages to PyPI
Usage() {
echo Usage:
echo "$0 [ --production ]"
exit 1
}
if [ "`dirname $0`" != "tools" ] ; then
echo Please run this script from the repo root
exit 1
fi
CheckVersion() {
# Args: <description of version type> <version number>
if ! echo "$2" | grep -q -e '[0-9]\+.[0-9]\+.[0-9]\+' ; then
echo "$1 doesn't look like 1.2.3"
exit 1
fi
}
if [ "$1" = "--production" ] ; then
version="$2"
CheckVersion Version "$version"
echo Releasing production version "$version"...
nextversion="$3"
CheckVersion "Next version" "$nextversion"
RELEASE_BRANCH="candidate-$version"
else
version=`grep "__version__" letsencrypt/__init__.py | cut -d\' -f2 | sed s/\.dev0//`
version="$version.dev$(date +%Y%m%d)1"
RELEASE_BRANCH="dev-release"
echo Releasing developer version "$version"...
fi
if [ "$RELEASE_OPENSSL_PUBKEY" = "" ] ; then
RELEASE_OPENSSL_PUBKEY="`realpath \`dirname $0\``/eff-pubkey.pem"
fi
RELEASE_GPG_KEY=${RELEASE_GPG_KEY:-A2CFB51FA275A7286234E7B24D17C995CD9775F2}
# Needed to fix problems with git signatures and pinentry
export GPG_TTY=$(tty)
# port for a local Python Package Index (used in testing)
PORT=${PORT:-1234}
# subpackages to be released
SUBPKGS=${SUBPKGS:-"acme letsencrypt-apache letsencrypt-nginx letshelp-letsencrypt"}
subpkgs_modules="$(echo $SUBPKGS | sed s/-/_/g)"
# letsencrypt_compatibility_test is not packaged because:
# - it is not meant to be used by anyone else than Let's Encrypt devs
# - it causes problems when running nosetests - the latter tries to
# run everything that matches test*, while there are no unittests
# there
tag="v$version"
mv "dist.$version" "dist.$version.$(date +%s).bak" || true
git tag --delete "$tag" || true
tmpvenv=$(mktemp -d)
virtualenv --no-site-packages -p python2 $tmpvenv
. $tmpvenv/bin/activate
# update setuptools/pip just like in other places in the repo
pip install -U setuptools
pip install -U pip # latest pip => no --pre for dev releases
pip install -U wheel # setup.py bdist_wheel
# newer versions of virtualenv inherit setuptools/pip/wheel versions
# from current env when creating a child env
pip install -U virtualenv
root_without_le="$version.$$"
root="./releases/le.$root_without_le"
echo "Cloning into fresh copy at $root" # clean repo = no artificats
git clone . $root
git rev-parse HEAD
cd $root
if [ "$RELEASE_BRANCH" != "candidate-$version" ] ; then
git branch -f "$RELEASE_BRANCH"
fi
git checkout "$RELEASE_BRANCH"
SetVersion() {
ver="$1"
for pkg_dir in $SUBPKGS letsencrypt-compatibility-test
do
sed -i "s/^version.*/version = '$ver'/" $pkg_dir/setup.py
done
sed -i "s/^__version.*/__version__ = '$ver'/" letsencrypt/__init__.py
# interactive user input
git add -p letsencrypt $SUBPKGS letsencrypt-compatibility-test
}
SetVersion "$version"
echo "Preparing sdists and wheels"
for pkg_dir in . $SUBPKGS
do
cd $pkg_dir
python setup.py clean
rm -rf build dist
python setup.py sdist
python setup.py bdist_wheel
echo "Signing ($pkg_dir)"
for x in dist/*.tar.gz dist/*.whl
do
gpg -u "$RELEASE_GPG_KEY" --detach-sign --armor --sign $x
done
cd -
done
mkdir "dist.$version"
mv dist "dist.$version/letsencrypt"
for pkg_dir in $SUBPKGS
do
mv $pkg_dir/dist "dist.$version/$pkg_dir/"
done
echo "Testing packages"
cd "dist.$version"
# start local PyPI
python -m SimpleHTTPServer $PORT &
# cd .. is NOT done on purpose: we make sure that all subpackages are
# installed from local PyPI rather than current directory (repo root)
virtualenv --no-site-packages ../venv
. ../venv/bin/activate
pip install -U setuptools
pip install -U pip
# Now, use our local PyPI. Disable cache so we get the correct KGS even if we
# (or our dependencies) have conditional dependencies implemented with if
# statements in setup.py and we have cached wheels lying around that would
# cause those ifs to not be evaluated.
pip install \
--no-cache-dir \
--extra-index-url http://localhost:$PORT \
letsencrypt $SUBPKGS
# stop local PyPI
kill $!
cd ~-
# freeze before installing anything else, so that we know end-user KGS
# make sure "twine upload" doesn't catch "kgs"
if [ -d ../kgs ] ; then
echo Deleting old kgs...
rm -rf ../kgs
fi
mkdir ../kgs
kgs="../kgs/$version"
pip freeze | tee $kgs
pip install nose
for module in letsencrypt $subpkgs_modules ; do
echo testing $module
nosetests $module
done
deactivate
# pin pip hashes of the things we just built
for pkg in acme letsencrypt letsencrypt-apache ; do
echo $pkg==$version \\
pip hash dist."$version/$pkg"/*.{whl,gz} | grep "^--hash" | python2 -c 'from sys import stdin; input = stdin.read(); print " ", input.replace("\n--hash", " \\\n --hash"),'
done > /tmp/hashes.$$
if ! wc -l /tmp/hashes.$$ | grep -qE "^\s*9 " ; then
echo Unexpected pip hash output
exit 1
fi
# perform hideous surgery on requirements.txt...
head -n -9 letsencrypt-auto-source/pieces/letsencrypt-auto-requirements.txt > /tmp/req.$$
cat /tmp/hashes.$$ >> /tmp/req.$$
cp /tmp/req.$$ letsencrypt-auto-source/pieces/letsencrypt-auto-requirements.txt
# ensure we have the latest built version of leauto
letsencrypt-auto-source/build.py
# and that it's signed correctly
while ! openssl dgst -sha256 -verify $RELEASE_OPENSSL_PUBKEY -signature \
letsencrypt-auto-source/letsencrypt-auto.sig \
letsencrypt-auto-source/letsencrypt-auto ; do
read -p "Please correctly sign letsencrypt-auto with offline-signrequest.sh"
done
# copy leauto to the root, overwriting the previous release version
cp -p letsencrypt-auto-source/letsencrypt-auto letsencrypt-auto
git add letsencrypt-auto letsencrypt-auto-source
git diff --cached
git commit --gpg-sign="$RELEASE_GPG_KEY" -m "Release $version"
git tag --local-user "$RELEASE_GPG_KEY" --sign --message "Release $version" "$tag"
cd ..
echo Now in $PWD
name=${root_without_le%.*}
ext="${root_without_le##*.}"
rev="$(git rev-parse --short HEAD)"
echo tar cJvf $name.$rev.tar.xz $name.$rev
echo gpg -U $RELEASE_GPG_KEY --detach-sign --armor $name.$rev.tar.xz
cd ~-
echo "New root: $root"
echo "KGS is at $root/kgs"
echo "Test commands (in the letstest repo):"
echo 'python multitester.py targets.yaml $AWS_KEY $USERNAME scripts/test_leauto_upgrades.sh --alt_pip $YOUR_PIP_REPO --branch public-beta'
echo 'python multitester.py targets.yaml $AWK_KEY $USERNAME scripts/test_letsencrypt_auto_certonly_standalone.sh --branch candidate-0.1.1'
echo 'python multitester.py --saveinstances targets.yaml $AWS_KEY $USERNAME scripts/test_apache2.sh'
echo "In order to upload packages run the following command:"
echo twine upload "$root/dist.$version/*/*"
if [ "$RELEASE_BRANCH" = candidate-"$version" ] ; then
SetVersion "$nextversion".dev0
letsencrypt-auto-source/build.py
git add letsencrypt-auto-source/letsencrypt-auto
git diff
git commit -m "Bump version to $nextversion"
fi
|
{
"content_hash": "dea681334065d2e6c9cad6eeb01b27a4",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 180,
"avg_line_length": 31.54954954954955,
"alnum_prop": 0.6964591661907481,
"repo_name": "mitnk/letsencrypt",
"id": "7e67d4e4ccffa82e114da771c9bd1c661209f8c4",
"size": "7004",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tools/release.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "48432"
},
{
"name": "Augeas",
"bytes": "5062"
},
{
"name": "Batchfile",
"bytes": "35037"
},
{
"name": "DIGITAL Command Language",
"bytes": "133"
},
{
"name": "Groff",
"bytes": "222"
},
{
"name": "Makefile",
"bytes": "37309"
},
{
"name": "Nginx",
"bytes": "4274"
},
{
"name": "Python",
"bytes": "1374377"
},
{
"name": "Shell",
"bytes": "124081"
}
],
"symlink_target": ""
}
|
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd">
<changeSet author="pado" id="20190826080000_00">
<createTable tableName="feature_code_list">
<column name="id" type="varchar(36)">
<constraints primaryKey="true" nullable="false"/>
</column>
<column name="code" type="VARCHAR(20)">
<constraints nullable="false"/>
</column>
<column name="feature_name" type="VARCHAR(100)">
<constraints nullable="false"/>
</column>
<column name="taken_by" type="VARCHAR(36)">
<constraints nullable="true"/>
</column>
<column name="taken_at" type="timestamp">
<constraints nullable="true"/>
</column>
</createTable>
<createIndex indexName="idx_code_feature_name"
tableName="feature_code_list"
unique="true">
<column name="code"/>
<column name="feature_name"/>
</createIndex>
<createIndex indexName="idx_taken_by_feature_name"
tableName="feature_code_list"
unique="true">
<column name="taken_by"/>
<column name="feature_name"/>
</createIndex>
</changeSet>
</databaseChangeLog>
|
{
"content_hash": "f8e650d8ae1144877ec81c63cb8325c6",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 148,
"avg_line_length": 44.432432432432435,
"alnum_prop": 0.5456204379562044,
"repo_name": "alv-ch/job-room",
"id": "8d688d9706d39fce978c30e4f92c6c509f5ced17",
"size": "1644",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "jobroom-gateway-app/src/main/resources/config/liquibase/changelog/20190826080000_code_list_feature.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "12556"
},
{
"name": "Gherkin",
"bytes": "179"
},
{
"name": "HTML",
"bytes": "205243"
},
{
"name": "Java",
"bytes": "308970"
},
{
"name": "JavaScript",
"bytes": "18178"
},
{
"name": "TypeScript",
"bytes": "236734"
}
],
"symlink_target": ""
}
|
package org.json;
/**
* The <code>JSONString</code> interface allows a <code>toJSONString()</code>
* method so that a class can change the behavior of
* <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
* and <code>JSONWriter.value(</code>Object<code>)</code>. The
* <code>toJSONString</code> method will be used instead of the default behavior
* of using the Object's <code>toString()</code> method and quoting the result.
*/
public interface JSONString {
/**
* The <code>toJSONString</code> method allows a class to produce its own JSON
* serialization.
*
* @return A strictly syntactically correct JSON text.
*/
public String toJSONString();
}
|
{
"content_hash": "adf617bd19293118220e0c7b9c0ba3d6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 81,
"avg_line_length": 36.578947368421055,
"alnum_prop": 0.7064748201438849,
"repo_name": "GreenCubes/GPatcher",
"id": "2fb1f5152c1a22877d9874b6c9cf95c42fa02187",
"size": "695",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/org/json/JSONString.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "105762"
},
{
"name": "JavaScript",
"bytes": "304"
}
],
"symlink_target": ""
}
|
<?php
/* @var $this StudentsController */
/* @var $model Students */
/* @var $form CActiveForm */
?>
<div class="wide form">
<?php $form=$this->beginWidget('CActiveForm', array(
'action'=>Yii::app()->createUrl($this->route),
'method'=>'get',
)); ?>
<div class="row">
<?php echo $form->label($model,'id'); ?>
<?php echo $form->textField($model,'id'); ?>
</div>
<div class="row">
<?php echo $form->label($model,'student_name'); ?>
<?php echo $form->textField($model,'student_name',array('size'=>60,'maxlength'=>255)); ?>
</div>
<div class="row">
<?php echo $form->label($model,'class_id'); ?>
<?php echo $form->textField($model,'class_id'); ?>
</div>
<div class="row buttons">
<?php echo CHtml::submitButton('Search'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- search-form -->
|
{
"content_hash": "d78ff87a69efb33cccefb25df0ebc878",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 91,
"avg_line_length": 23.257142857142856,
"alnum_prop": 0.5872235872235873,
"repo_name": "L1beration/Yii-Project",
"id": "e75e2bb5278c73ad365dc7a040e340ba1a91a675",
"size": "814",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Students/protected/views/students/_search.php",
"mode": "33261",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "142263"
},
{
"name": "Erlang",
"bytes": "166"
},
{
"name": "JavaScript",
"bytes": "438929"
},
{
"name": "PHP",
"bytes": "18538209"
},
{
"name": "Perl",
"bytes": "201271"
},
{
"name": "Shell",
"bytes": "6480"
}
],
"symlink_target": ""
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ThirdBit")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ThirdBit")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("edd90640-3e43-4f4b-81b0-badc6af0c01d")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
{
"content_hash": "b9beaf1a260f837345afa51e573200e3",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 38.583333333333336,
"alnum_prop": 0.7437005039596832,
"repo_name": "DanielaIvanova/01.CSharp-Fundamentals",
"id": "87505a370900c98a0e99d85417fca53aafa69b00",
"size": "1392",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "03.Operators-And-Expressions/11.ThirdBit/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "163688"
},
{
"name": "Smalltalk",
"bytes": "690"
}
],
"symlink_target": ""
}
|
{% extends "gridder_base.html" %}
{% block content %}
<div class="row">
<div class="col-md-12">
<p>You’ve successfully activated your account.</p>
</div>
</div>
{% endblock %}
|
{
"content_hash": "4dcd379d3956c763fda3c86f9f9b848c",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 58,
"avg_line_length": 21.333333333333332,
"alnum_prop": 0.5885416666666666,
"repo_name": "PDFGridder/PDFGridder",
"id": "03cf50c25d93e32ea0b19b9abc5ec90e89f59ee9",
"size": "194",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "templates/registration/activate.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "13975"
},
{
"name": "HTML",
"bytes": "68483"
},
{
"name": "JavaScript",
"bytes": "143758"
},
{
"name": "Python",
"bytes": "66624"
},
{
"name": "Shell",
"bytes": "259"
}
],
"symlink_target": ""
}
|
import * as actions from './actions'
test('modalShow', () => {
expect(actions.modalShow('test')).toEqual(expect.objectContaining({
type: actions.MODAL_SHOW,
payload: {
name: 'test',
},
}))
})
test('modalHide', () => {
expect(actions.modalHide('test')).toEqual({
type: actions.MODAL_HIDE,
payload: {
name: 'test',
},
})
})
|
{
"content_hash": "136d3a1c74c2dbccf8d78f58e60bf3c8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 69,
"avg_line_length": 19.36842105263158,
"alnum_prop": 0.5706521739130435,
"repo_name": "DimensionLab/narc",
"id": "42a4ee62ebe87654f7d1b5a3d440dedcfd0a2156",
"size": "505",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/store/modal/actions.test.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "4847806"
}
],
"symlink_target": ""
}
|
/*************************************************************************/
/* main.cpp */
/*************************************************************************/
/* This file is part of: */
/* GODOT ENGINE */
/* http://www.godotengine.org */
/*************************************************************************/
/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */
/* */
/* 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. */
/*************************************************************************/
#include "main.h"
#include "os/os.h"
#include "globals.h"
#include "splash.h"
#include "core/register_core_types.h"
#include "scene/register_scene_types.h"
#include "drivers/register_driver_types.h"
#include "servers/register_server_types.h"
#include "modules/register_module_types.h"
#include "script_debugger_local.h"
#include "script_debugger_remote.h"
#include "message_queue.h"
#include "path_remap.h"
#include "input_map.h"
#include "io/resource_loader.h"
#include "scene/main/scene_main_loop.h"
#include "script_language.h"
#include "io/resource_loader.h"
#include "bin/tests/test_main.h"
#include "os/dir_access.h"
#include "core/io/ip.h"
#include "scene/resources/packed_scene.h"
#include "scene/main/viewport.h"
#ifdef TOOLS_ENABLED
#include "tools/editor/editor_node.h"
#include "tools/editor/project_manager.h"
#include "tools/editor/console.h"
#include "tools/pck/pck_packer.h"
#endif
#include "io/file_access_network.h"
#include "tools/doc/doc_data.h"
#include "servers/spatial_sound_server.h"
#include "servers/spatial_sound_2d_server.h"
#include "servers/physics_2d_server.h"
#include "core/io/stream_peer_tcp.h"
#include "core/os/thread.h"
#include "core/io/file_access_pack.h"
#include "core/io/file_access_zip.h"
#include "translation.h"
#include "version.h"
#include "performance.h"
static Globals *globals=NULL;
static InputMap *input_map=NULL;
static bool _start_success=false;
static ScriptDebugger *script_debugger=NULL;
static MessageQueue *message_queue=NULL;
static Performance *performance = NULL;
static PathRemap *path_remap;
static PackedData *packed_data=NULL;
#ifdef MINIZIP_ENABLED
static ZipArchive *zip_packed_data=NULL;
#endif
static FileAccessNetworkClient *file_access_network_client=NULL;
static TranslationServer *translation_server = NULL;
static OS::VideoMode video_mode;
static int video_driver_idx=-1;
static int audio_driver_idx=-1;
static String locale;
static bool init_maximized=false;
static int init_screen=-1;
static String unescape_cmdline(const String& p_str) {
return p_str.replace("%20"," ");
}
//#define DEBUG_INIT
#ifdef DEBUG_INIT
#define MAIN_PRINT(m_txt) print_line(m_txt)
#else
#define MAIN_PRINT(m_txt)
#endif
void Main::print_help(const char* p_binary) {
OS::get_singleton()->print(VERSION_FULL_NAME" (c) 2008-2015 Juan Linietsky, Ariel Manzur.\n");
OS::get_singleton()->print("Usage: %s [options] [scene]\n",p_binary);
OS::get_singleton()->print("Options:\n");
OS::get_singleton()->print("\t-path [dir] : Path to a game, containing engine.cfg\n");
#ifdef TOOLS_ENABLED
OS::get_singleton()->print("\t-e,-editor : Bring up the editor instead of running the scene.\n");
#endif
OS::get_singleton()->print("\t-test [test] : Run a test.\n");
OS::get_singleton()->print("\t\t(");
const char **test_names=tests_get_names();
const char* coma = "";
while(*test_names) {
OS::get_singleton()->print("%s%s", coma, *test_names);
test_names++;
coma = ", ";
}
OS::get_singleton()->print(")\n");
OS::get_singleton()->print("\t-r WIDTHxHEIGHT\t : Request Screen Resolution\n");
OS::get_singleton()->print("\t-f\t\t : Request Fullscreen\n");
OS::get_singleton()->print("\t-vd DRIVER\t : Video Driver (");
for (int i=0;i<OS::get_singleton()->get_video_driver_count();i++) {
if (i!=0)
OS::get_singleton()->print(", ");
OS::get_singleton()->print("%s",OS::get_singleton()->get_video_driver_name(i));
}
OS::get_singleton()->print(")\n");
OS::get_singleton()->print("\t-ad DRIVER\t : Audio Driver (");
for (int i=0;i<OS::get_singleton()->get_audio_driver_count();i++) {
if (i!=0)
OS::get_singleton()->print(", ");
OS::get_singleton()->print("%s",OS::get_singleton()->get_audio_driver_name(i));
}
OS::get_singleton()->print(")\n");
OS::get_singleton()->print("\t-rthread <mode>\t : Render Thread Mode ('unsafe', 'safe', 'separate).");
OS::get_singleton()->print(")\n");
OS::get_singleton()->print("\t-s,-script [script] : Run a script.\n");
OS::get_singleton()->print("\t-d,-debug : Debug (local stdout debugger).\n");
OS::get_singleton()->print("\t-rdebug ADDRESS : Remote debug (<ip>:<port> host address).\n");
OS::get_singleton()->print("\t-fdelay [msec]: Simulate high CPU load (delay each frame by [msec]).\n");
OS::get_singleton()->print("\t-timescale [msec]: Simulate high CPU load (delay each frame by [msec]).\n");
OS::get_singleton()->print("\t-bp : breakpoint list as source::line comma separated pairs, no spaces (%%20,%%2C,etc instead).\n");
OS::get_singleton()->print("\t-v : Verbose stdout mode\n");
OS::get_singleton()->print("\t-lang [locale]: Use a specific locale\n");
OS::get_singleton()->print("\t-rfs <host/ip>[:<port>] : Remote FileSystem.\n");
OS::get_singleton()->print("\t-rfs_pass <password> : Password for Remote FileSystem.\n");
#ifdef TOOLS_ENABLED
OS::get_singleton()->print("\t-doctool FILE: Dump the whole engine api to FILE in XML format. If FILE exists, it will be merged.\n");
OS::get_singleton()->print("\t-nodocbase: Disallow dump the base types (used with -doctool).\n");
OS::get_singleton()->print("\t-optimize FILE Save an optimized copy of scene to FILE.\n");
OS::get_singleton()->print("\t-optimize_preset [preset] Use a given preset for optimization.\n");
OS::get_singleton()->print("\t-export [target] Export the project using given export target.\n");
#endif
}
Error Main::setup(const char *execpath,int argc, char *argv[],bool p_second_phase) {
RID_OwnerBase::init_rid();
OS::get_singleton()->initialize_core();
ObjectTypeDB::init();
MAIN_PRINT("Main: Initialize CORE");
register_core_types();
register_core_driver_types();
MAIN_PRINT("Main: Initialize Globals");
Thread::_main_thread_id = Thread::get_caller_ID();
globals = memnew( Globals );
input_map = memnew( InputMap );
path_remap = memnew( PathRemap );
translation_server = memnew( TranslationServer );
performance = memnew( Performance );
globals->add_singleton(Globals::Singleton("Performance",performance));
MAIN_PRINT("Main: Parse CMDLine");
/* argument parsing and main creation */
List<String> args;
List<String> main_args;
for(int i=0;i<argc;i++) {
args.push_back(String::utf8(argv[i]));
}
List<String>::Element *I=args.front();
I=args.front();
while (I) {
I->get()=unescape_cmdline(I->get().strip_escapes());
// print_line("CMD: "+I->get());
I=I->next();
}
I=args.front();
video_mode = OS::get_singleton()->get_default_video_mode();
String video_driver="";
String audio_driver="";
String game_path=".";
String debug_mode;
String debug_host;
String main_pack;
bool quiet_stdout=false;
int rtm=-1;
String remotefs;
String remotefs_pass;
String screen = "";
List<String> pack_list;
Vector<String> breakpoints;
bool use_custom_res=true;
bool force_res=false;
I=args.front();
packed_data = PackedData::get_singleton();
if (!packed_data)
packed_data = memnew(PackedData);
#ifdef MINIZIP_ENABLED
//XXX: always get_singleton() == 0x0
zip_packed_data = ZipArchive::get_singleton();
//TODO: remove this temporary fix
if (!zip_packed_data) {
zip_packed_data = memnew(ZipArchive);
}
packed_data->add_pack_source(zip_packed_data);
#endif
bool editor=false;
while(I) {
List<String>::Element *N=I->next();
if (I->get() == "-noop") {
// no op
} else if (I->get()=="-h" || I->get()=="--help" || I->get()=="/?") { // resolution
goto error;
} else if (I->get()=="-r") { // resolution
if (I->next()) {
String vm=I->next()->get();
if (vm.find("x")==-1) { // invalid parameter format
goto error;
}
int w=vm.get_slice("x",0).to_int();
int h=vm.get_slice("x",1).to_int();
if (w==0 || h==0) {
goto error;
}
video_mode.width=w;
video_mode.height=h;
force_res=true;
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-vd") { // video driver
if (I->next()) {
video_driver=I->next()->get();
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-lang") { // language
if (I->next()) {
locale=I->next()->get();
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-rfs") { // language
if (I->next()) {
remotefs=I->next()->get();
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-rfs_pass") { // language
if (I->next()) {
remotefs_pass=I->next()->get();
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-rthread") { // language
if (I->next()) {
if (I->next()->get()=="safe")
rtm=OS::RENDER_THREAD_SAFE;
else if (I->next()->get()=="unsafe")
rtm=OS::RENDER_THREAD_UNSAFE;
else if (I->next()->get()=="separate")
rtm=OS::RENDER_SEPARATE_THREAD;
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-ad") { // video driver
if (I->next()) {
audio_driver=I->next()->get();
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-f") { // fullscreen
video_mode.fullscreen=true;
} else if (I->get()=="-e" || I->get()=="-editor") { // fonud editor
editor=true;
init_maximized=true;
} else if (I->get()=="-nowindow") { // fullscreen
OS::get_singleton()->set_no_window_mode(true);
} else if (I->get()=="-quiet") { // fullscreen
quiet_stdout=true;
} else if (I->get()=="-v") { // fullscreen
OS::get_singleton()->_verbose_stdout=true;
} else if (I->get()=="-path") { // resolution
if (I->next()) {
String p = I->next()->get();
if (OS::get_singleton()->set_cwd(p)==OK) {
//nothing
} else {
game_path=I->next()->get(); //use game_path instead
}
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-bp") { // /breakpoints
if (I->next()) {
String bplist = I->next()->get();
breakpoints= bplist.split(",");
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-fdelay") { // resolution
if (I->next()) {
OS::get_singleton()->set_frame_delay(I->next()->get().to_int());
N=I->next()->next();
} else {
goto error;
}
} else if (I->get()=="-timescale") { // resolution
if (I->next()) {
OS::get_singleton()->set_time_scale(I->next()->get().to_double());
N=I->next()->next();
} else {
goto error;
}
} else if (I->get() == "-pack") {
if (I->next()) {
pack_list.push_back(I->next()->get());
N = I->next()->next();
} else {
goto error;
};
} else if (I->get() == "-main_pack") {
if (I->next()) {
main_pack=I->next()->get();
N = I->next()->next();
} else {
goto error;
};
} else if (I->get()=="-debug" || I->get()=="-d") {
debug_mode="local";
} else if (I->get()=="-editor_scene") {
if (I->next()) {
Globals::get_singleton()->set("editor_scene",game_path=I->next()->get());
} else {
goto error;
}
} else if (I->get()=="-rdebug") {
if (I->next()) {
debug_mode="remote";
debug_host=I->next()->get();
if (debug_host.find(":")==-1) //wrong host
goto error;
N=I->next()->next();
} else {
goto error;
}
} else {
//test for game path
bool gpfound=false;
if (!I->get().begins_with("-") && game_path=="") {
DirAccess* da = DirAccess::open(I->get());
if (da!=NULL) {
game_path=I->get();
gpfound=true;
memdelete(da);
}
}
if (!gpfound) {
main_args.push_back(I->get());
}
}
I=N;
}
if (debug_mode == "remote") {
ScriptDebuggerRemote *sdr = memnew( ScriptDebuggerRemote );
uint16_t debug_port = GLOBAL_DEF("debug/remote_port",6007);
if (debug_host.find(":")!=-1) {
debug_port=debug_host.get_slicec(':',1).to_int();
debug_host=debug_host.get_slicec(':',0);
}
Error derr = sdr->connect_to_host(debug_host,debug_port);
if (derr!=OK) {
memdelete(sdr);
} else {
script_debugger=sdr;
}
} else if (debug_mode=="local") {
script_debugger = memnew( ScriptDebuggerLocal );
}
if (remotefs!="") {
file_access_network_client=memnew(FileAccessNetworkClient);
int port;
if (remotefs.find(":")!=-1) {
port=remotefs.get_slicec(':',1).to_int();
remotefs=remotefs.get_slicec(':',0);
} else {
port=6010;
}
Error err = file_access_network_client->connect(remotefs,port,remotefs_pass);
if (err) {
OS::get_singleton()->printerr("Could not connect to remotefs: %s:%i\n",remotefs.utf8().get_data(),port);
goto error;
}
FileAccess::make_default<FileAccessNetwork>(FileAccess::ACCESS_RESOURCES);
}
if (script_debugger) {
//there is a debugger, parse breakpoints
for(int i=0;i<breakpoints.size();i++) {
String bp = breakpoints[i];
int sp=bp.find_last(":");
if (sp==-1) {
ERR_EXPLAIN("Invalid breakpoint: '"+bp+"', expected file:line format.");
ERR_CONTINUE(sp==-1);
}
script_debugger->insert_breakpoint(bp.substr(sp+1,bp.length()).to_int(),bp.substr(0,sp));
}
}
#ifdef TOOLS_ENABLED
if (editor) {
packed_data->set_disabled(true);
globals->set_disable_platform_override(true);
}
#endif
if (globals->setup(game_path,main_pack)!=OK) {
#ifdef TOOLS_ENABLED
editor=false;
#else
OS::get_singleton()->print("error: Couldn't load game path '%s'\n",game_path.ascii().get_data());
goto error;
#endif
}
if (editor) {
main_args.push_back("-editor");
use_custom_res=false;
}
if (bool(Globals::get_singleton()->get("application/disable_stdout"))) {
quiet_stdout=true;
}
if (bool(Globals::get_singleton()->get("application/disable_stderr"))) {
_print_error_enabled = false;
};
if (quiet_stdout)
_print_line_enabled=false;
OS::get_singleton()->set_cmdline(execpath, main_args);
#ifdef TOOLS_ENABLED
if (main_args.size()==0 && (!Globals::get_singleton()->has("application/main_loop_type")) && (!Globals::get_singleton()->has("application/main_scene") || String(Globals::get_singleton()->get("application/main_scene"))==""))
use_custom_res=false; //project manager (run without arguments)
#endif
input_map->load_from_globals();
if (video_driver=="") // specified in engine.cfg
video_driver=_GLOBAL_DEF("display/driver",Variant((const char*)OS::get_singleton()->get_video_driver_name(0)));
if (!force_res && use_custom_res && globals->has("display/width"))
video_mode.width=globals->get("display/width");
if (!force_res &&use_custom_res && globals->has("display/height"))
video_mode.height=globals->get("display/height");
if (use_custom_res && globals->has("display/fullscreen"))
video_mode.fullscreen=globals->get("display/fullscreen");
if (use_custom_res && globals->has("display/resizable"))
video_mode.resizable=globals->get("display/resizable");
if (!force_res && use_custom_res && globals->has("display/test_width") && globals->has("display/test_height")) {
int tw = globals->get("display/test_width");
int th = globals->get("display/test_height");
if (tw>0 && th>0) {
video_mode.width=tw;
video_mode.height=th;
}
}
GLOBAL_DEF("display/width",video_mode.width);
GLOBAL_DEF("display/height",video_mode.height);
GLOBAL_DEF("display/fullscreen",video_mode.fullscreen);
GLOBAL_DEF("display/resizable",video_mode.resizable);
GLOBAL_DEF("display/test_width",0);
GLOBAL_DEF("display/test_height",0);
if (rtm==-1) {
rtm=GLOBAL_DEF("render/thread_model",OS::RENDER_THREAD_SAFE);
if (rtm>=1) //hack for now
rtm=1;
}
if (rtm>=0 && rtm<3)
OS::get_singleton()->_render_thread_mode=OS::RenderThreadMode(rtm);
/* Determine Video Driver */
if (audio_driver=="") // specified in engine.cfg
audio_driver=GLOBAL_DEF("audio/driver",OS::get_singleton()->get_audio_driver_name(0));
for (int i=0;i<OS::get_singleton()->get_video_driver_count();i++) {
if (video_driver==OS::get_singleton()->get_video_driver_name(i)) {
video_driver_idx=i;
break;
}
}
if (video_driver_idx<0) {
OS::get_singleton()->alert( "Invalid Video Driver: "+video_driver );
video_driver_idx = 0;
//goto error;
}
for (int i=0;i<OS::get_singleton()->get_audio_driver_count();i++) {
if (audio_driver==OS::get_singleton()->get_audio_driver_name(i)) {
audio_driver_idx=i;
break;
}
}
if (audio_driver_idx<0) {
OS::get_singleton()->alert( "Invalid Audio Driver: "+audio_driver );
goto error;
}
{
String orientation = GLOBAL_DEF("display/orientation","landscape");
if (orientation=="portrait")
OS::get_singleton()->set_screen_orientation(OS::SCREEN_PORTRAIT);
else if (orientation=="reverse_landscape")
OS::get_singleton()->set_screen_orientation(OS::SCREEN_REVERSE_LANDSCAPE);
else if (orientation=="reverse_portrait")
OS::get_singleton()->set_screen_orientation(OS::SCREEN_REVERSE_PORTRAIT);
else if (orientation=="sensor_landscape")
OS::get_singleton()->set_screen_orientation(OS::SCREEN_SENSOR_LANDSCAPE);
else if (orientation=="sensor_portrait")
OS::get_singleton()->set_screen_orientation(OS::SCREEN_SENSOR_PORTRAIT);
else if (orientation=="sensor")
OS::get_singleton()->set_screen_orientation(OS::SCREEN_SENSOR);
else
OS::get_singleton()->set_screen_orientation(OS::SCREEN_LANDSCAPE);
}
OS::get_singleton()->set_iterations_per_second(GLOBAL_DEF("physics/fixed_fps",60));
OS::get_singleton()->set_target_fps(GLOBAL_DEF("application/target_fps",0));
if (!OS::get_singleton()->_verbose_stdout) //overrided
OS::get_singleton()->_verbose_stdout=GLOBAL_DEF("debug/verbose_stdout",false);
message_queue = memnew( MessageQueue );
Globals::get_singleton()->register_global_defaults();
if (p_second_phase)
return setup2();
return OK;
error:
video_driver="";
audio_driver="";
game_path="";
args.clear();
main_args.clear();
print_help(execpath);
if (performance)
memdelete(performance);
if (input_map)
memdelete(input_map);
if (translation_server)
memdelete( translation_server );
if (globals)
memdelete(globals);
if (script_debugger)
memdelete(script_debugger);
if (packed_data)
memdelete(packed_data);
if (file_access_network_client)
memdelete(file_access_network_client);
// Note 1: *zip_packed_data live into *packed_data
// Note 2: PackedData::~PackedData destroy this.
//#ifdef MINIZIP_ENABLED
// if (zip_packed_data)
// memdelete( zip_packed_data );
//#endif
unregister_core_types();
OS::get_singleton()->_cmdline.clear();
if (message_queue)
memdelete( message_queue);
OS::get_singleton()->finalize_core();
locale=String();
return ERR_INVALID_PARAMETER;
}
Error Main::setup2() {
OS::get_singleton()->initialize(video_mode,video_driver_idx,audio_driver_idx);
register_core_singletons();
MAIN_PRINT("Main: Setup Logo");
bool show_logo=true;
#ifdef JAVASCRIPT_ENABLED
show_logo=false;
#endif
if (init_screen!=-1) {
OS::get_singleton()->set_current_screen(init_screen);
}
if (init_maximized) {
OS::get_singleton()->set_window_maximized(true);
}
if (show_logo) { //boot logo!
String boot_logo_path=GLOBAL_DEF("application/boot_splash",String());
bool boot_logo_scale=GLOBAL_DEF("application/boot_splash_fullsize",true);
Globals::get_singleton()->set_custom_property_info("application/boot_splash",PropertyInfo(Variant::STRING,"application/boot_splash",PROPERTY_HINT_FILE,"*.png"));
Image boot_logo;
if (boot_logo_path.strip_edges()!="" && FileAccess::exists(boot_logo_path)) {
boot_logo.load(boot_logo_path);
}
if (!boot_logo.empty()) {
OS::get_singleton()->_msec_splash=OS::get_singleton()->get_ticks_msec();
Color clear = GLOBAL_DEF("render/default_clear_color",Color(0.3,0.3,0.3));
VisualServer::get_singleton()->set_default_clear_color(clear);
Color boot_bg = GLOBAL_DEF("application/boot_bg_color", clear);
VisualServer::get_singleton()->set_boot_image(boot_logo, boot_bg,boot_logo_scale);
#ifndef TOOLS_ENABLED
//no tools, so free the boot logo (no longer needed)
Globals::get_singleton()->set("application/boot_logo",Image());
#endif
} else {
#ifndef NO_DEFAULT_BOOT_LOGO
MAIN_PRINT("Main: Create botsplash");
Image splash(boot_splash_png);
MAIN_PRINT("Main: ClearColor");
VisualServer::get_singleton()->set_default_clear_color(boot_splash_bg_color);
MAIN_PRINT("Main: Image");
VisualServer::get_singleton()->set_boot_image(splash, boot_splash_bg_color,false);
#endif
MAIN_PRINT("Main: DCC");
VisualServer::get_singleton()->set_default_clear_color(GLOBAL_DEF("render/default_clear_color",Color(0.3,0.3,0.3)));
MAIN_PRINT("Main: END");
}
Image icon(app_icon_png);
OS::get_singleton()->set_icon(icon);
}
GLOBAL_DEF("application/icon",String());
Globals::get_singleton()->set_custom_property_info("application/icon",PropertyInfo(Variant::STRING,"application/icon",PROPERTY_HINT_FILE,"*.png,*.webp"));
MAIN_PRINT("Main: Load Remaps");
path_remap->load_remaps();
MAIN_PRINT("Main: Load Scene Types");
register_scene_types();
register_server_types();
#ifdef TOOLS_ENABLED
EditorNode::register_editor_types();
ObjectTypeDB::register_type<PCKPacker>(); // todo: move somewhere else
#endif
MAIN_PRINT("Main: Load Scripts, Modules, Drivers");
register_module_types();
register_driver_types();
ScriptServer::init_languages();
MAIN_PRINT("Main: Load Translations");
translation_server->setup(); //register translations, load them, etc.
if (locale!="") {
translation_server->set_locale(locale);
}
translation_server->load_translations();
_start_success=true;
locale=String();
MAIN_PRINT("Main: Done");
return OK;
}
bool Main::start() {
ERR_FAIL_COND_V(!_start_success,false);
bool editor=false;
String doc_tool;
bool doc_base=true;
String game_path;
String script;
String test;
String screen;
String optimize;
String optimize_preset;
String _export_platform;
String _import;
String _import_script;
String dumpstrings;
bool noquit=false;
bool convert_old=false;
bool export_debug=false;
List<String> args = OS::get_singleton()->get_cmdline_args();
for (int i=0;i<args.size();i++) {
if (args[i]=="-doctool" && i <(args.size()-1)) {
doc_tool=args[i+1];
i++;
}else if (args[i]=="-nodocbase") {
doc_base=false;
} else if ((args[i]=="-script" || args[i]=="-s") && i <(args.size()-1)) {
script=args[i+1];
i++;
} else if ((args[i]=="-level" || args[i]=="-l") && i <(args.size()-1)) {
OS::get_singleton()->_custom_level=args[i+1];
i++;
} else if (args[i]=="-test" && i <(args.size()-1)) {
test=args[i+1];
i++;
} else if (args[i]=="-optimize" && i <(args.size()-1)) {
optimize=args[i+1];
i++;
} else if (args[i]=="-optimize_preset" && i <(args.size()-1)) {
optimize_preset=args[i+1];
i++;
} else if (args[i]=="-export" && i <(args.size()-1)) {
editor=true; //needs editor
_export_platform=args[i+1];
i++;
} else if (args[i]=="-export_debug" && i <(args.size()-1)) {
editor=true; //needs editor
_export_platform=args[i+1];
export_debug=true;
i++;
} else if (args[i]=="-import" && i <(args.size()-1)) {
editor=true; //needs editor
_import=args[i+1];
i++;
} else if (args[i]=="-import_script" && i <(args.size()-1)) {
editor=true; //needs editor
_import_script=args[i+1];
i++;
} else if (args[i]=="-noquit" ) {
noquit=true;
} else if (args[i]=="-dumpstrings" && i <(args.size()-1)) {
editor=true; //needs editor
dumpstrings=args[i+1];
i++;
} else if (args[i]=="-editor" || args[i]=="-e") {
editor=true;
} else if (args[i]=="-convert_old") {
convert_old=true;
} else if (args[i].length() && args[i][0] != '-' && game_path == "") {
game_path=args[i];
}
}
if (editor)
Globals::get_singleton()->set("editor_active",true);
String main_loop_type;
#ifdef TOOLS_ENABLED
if(doc_tool!="") {
DocData doc;
doc.generate(doc_base);
DocData docsrc;
if (docsrc.load(doc_tool)==OK) {
print_line("Doc exists. Merging..");
doc.merge_from(docsrc);
} else {
print_line("No Doc exists. Generating empty.");
}
doc.save(doc_tool);
return false;
}
if (optimize!="")
editor=true; //need editor
#endif
if(script=="" && game_path=="" && !editor && String(GLOBAL_DEF("application/main_scene",""))!="") {
game_path=GLOBAL_DEF("application/main_scene","");
}
MainLoop *main_loop=NULL;
if (editor) {
main_loop = memnew(SceneTree);
};
if (test!="") {
#ifdef DEBUG_ENABLED
main_loop = test_main(test,args);
if (!main_loop)
return false;
#endif
} else if (script!="") {
Ref<Script> script_res = ResourceLoader::load(script);
ERR_EXPLAIN("Can't load script: "+script);
ERR_FAIL_COND_V(script_res.is_null(),false);
if( script_res->can_instance() /*&& script_res->inherits_from("SceneTreeScripted")*/) {
StringName instance_type=script_res->get_instance_base_type();
Object *obj = ObjectTypeDB::instance(instance_type);
MainLoop *script_loop = obj?obj->cast_to<MainLoop>():NULL;
if (!script_loop) {
if (obj)
memdelete(obj);
ERR_EXPLAIN("Can't load script '"+script+"', it does not inherit from a MainLoop type");
ERR_FAIL_COND_V(!script_loop,false);
}
script_loop->set_init_script(script_res);
main_loop=script_loop;
} else {
return false;
}
} else {
main_loop_type=GLOBAL_DEF("application/main_loop_type","");
}
if (!main_loop && main_loop_type=="")
main_loop_type="SceneTree";
if (!main_loop) {
if (!ObjectTypeDB::type_exists(main_loop_type)) {
OS::get_singleton()->alert("godot: error: MainLoop type doesn't exist: "+main_loop_type);
return false;
} else {
Object *ml = ObjectTypeDB::instance(main_loop_type);
if (!ml) {
ERR_EXPLAIN("Can't instance MainLoop type");
ERR_FAIL_V(false);
}
main_loop=ml->cast_to<MainLoop>();
if (!main_loop) {
memdelete(ml);
ERR_EXPLAIN("Invalid MainLoop type");
ERR_FAIL_V(false);
}
}
}
if (main_loop->is_type("SceneTree")) {
SceneTree *sml = main_loop->cast_to<SceneTree>();
#ifdef TOOLS_ENABLED
EditorNode *editor_node=NULL;
if (editor) {
editor_node = memnew( EditorNode );
sml->get_root()->add_child(editor_node);
//root_node->set_editor(editor);
//startup editor
if (_export_platform!="") {
editor_node->export_platform(_export_platform,game_path,export_debug,"",true);
game_path=""; //no load anything
}
}
#endif
if (!editor) {
//standard helpers that can be changed from main config
String stretch_mode = GLOBAL_DEF("display/stretch_mode","disabled");
String stretch_aspect = GLOBAL_DEF("display/stretch_aspect","ignore");
Size2i stretch_size = Size2(GLOBAL_DEF("display/width",0),GLOBAL_DEF("display/height",0));
SceneTree::StretchMode sml_sm=SceneTree::STRETCH_MODE_DISABLED;
if (stretch_mode=="2d")
sml_sm=SceneTree::STRETCH_MODE_2D;
else if (stretch_mode=="viewport")
sml_sm=SceneTree::STRETCH_MODE_VIEWPORT;
SceneTree::StretchAspect sml_aspect=SceneTree::STRETCH_ASPECT_IGNORE;
if (stretch_aspect=="keep")
sml_aspect=SceneTree::STRETCH_ASPECT_KEEP;
else if (stretch_aspect=="keep_width")
sml_aspect=SceneTree::STRETCH_ASPECT_KEEP_WIDTH;
else if (stretch_aspect=="keep_height")
sml_aspect=SceneTree::STRETCH_ASPECT_KEEP_HEIGHT;
sml->set_screen_stretch(sml_sm,sml_aspect,stretch_size);
sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit",true));
String appname = Globals::get_singleton()->get("application/name");
appname = TranslationServer::get_singleton()->translate(appname);
OS::get_singleton()->set_window_title(appname);
} else {
GLOBAL_DEF("display/stretch_mode","disabled");
Globals::get_singleton()->set_custom_property_info("display/stretch_mode",PropertyInfo(Variant::STRING,"display/stretch_mode",PROPERTY_HINT_ENUM,"disabled,2d,viewport"));
GLOBAL_DEF("display/stretch_aspect","ignore");
Globals::get_singleton()->set_custom_property_info("display/stretch_aspect",PropertyInfo(Variant::STRING,"display/stretch_aspect",PROPERTY_HINT_ENUM,"ignore,keep,keep_width,keep_height"));
sml->set_auto_accept_quit(GLOBAL_DEF("application/auto_accept_quit",true));
}
if (game_path!="") {
String local_game_path=game_path.replace("\\","/");
if (!local_game_path.begins_with("res://")) {
bool absolute=(local_game_path.size()>1) && (local_game_path[0]=='/' || local_game_path[1]==':');
if (!absolute) {
if (Globals::get_singleton()->is_using_datapack()) {
local_game_path="res://"+local_game_path;
} else {
int sep=local_game_path.find_last("/");
if (sep==-1) {
DirAccess *da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
local_game_path=da->get_current_dir()+"/"+local_game_path;
memdelete(da) ;
} else {
DirAccess *da = DirAccess::open(local_game_path.substr(0,sep));
if (da) {
local_game_path=da->get_current_dir()+"/"+local_game_path.substr(sep+1,local_game_path.length());;
memdelete(da);
}
}
}
}
}
local_game_path=Globals::get_singleton()->localize_path(local_game_path);
#ifdef TOOLS_ENABLED
if (editor) {
if (_import!="") {
//editor_node->import_scene(_import,local_game_path,_import_script);
if (!noquit)
sml->quit();
game_path=""; //no load anything
} else {
Error serr = editor_node->load_scene(local_game_path);
if (serr==OK) {
if (optimize!="") {
editor_node->save_optimized_copy(optimize,optimize_preset);
if (!noquit)
sml->quit();
}
if (dumpstrings!="") {
editor_node->save_translatable_strings(dumpstrings);
if (!noquit)
sml->quit();
}
}
}
//editor_node->set_edited_scene(game);
} else {
#endif
{
//autoload
List<PropertyInfo> props;
Globals::get_singleton()->get_property_list(&props);
for(List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
String s = E->get().name;
if (!s.begins_with("autoload/"))
continue;
String name = s.get_slicec('/',1);
String path = Globals::get_singleton()->get(s);
RES res = ResourceLoader::load(path);
ERR_EXPLAIN("Can't autoload: "+path);
ERR_CONTINUE(res.is_null());
Node *n=NULL;
if (res->is_type("PackedScene")) {
Ref<PackedScene> ps = res;
n=ps->instance();
} else if (res->is_type("Script")) {
Ref<Script> s = res;
StringName ibt = s->get_instance_base_type();
ERR_EXPLAIN("Script does not inherit a Node: "+path);
ERR_CONTINUE( !ObjectTypeDB::is_type(ibt,"Node") );
Object *obj = ObjectTypeDB::instance(ibt);
ERR_EXPLAIN("Cannot instance node for autoload type: "+String(ibt));
ERR_CONTINUE( obj==NULL );
n = obj->cast_to<Node>();
n->set_script(s.get_ref_ptr());
}
ERR_EXPLAIN("Path in autoload not a node or script: "+path);
ERR_CONTINUE(!n);
n->set_name(name);
sml->get_root()->add_child(n);
}
}
Node *scene=NULL;
Ref<PackedScene> scenedata = ResourceLoader::load(local_game_path);
if (scenedata.is_valid())
scene=scenedata->instance();
ERR_EXPLAIN("Failed loading scene: "+local_game_path);
ERR_FAIL_COND_V(!scene,false)
//sml->get_root()->add_child(scene);
sml->add_current_scene(scene);
String iconpath = GLOBAL_DEF("application/icon","Variant()""");
if (iconpath!="") {
Image icon;
if (icon.load(iconpath)==OK)
OS::get_singleton()->set_icon(icon);
}
//singletons
#ifdef TOOLS_ENABLED
}
#endif
}
#ifdef TOOLS_ENABLED
/*if (_export_platform!="") {
sml->quit();
}*/
/*
if (sml->get_root_node()) {
Console *console = memnew( Console );
sml->get_root_node()->cast_to<RootNode>()->set_console(console);
if (GLOBAL_DEF("console/visible_default",false).operator bool()) {
console->show();
} else {P
console->hide();
};
}
*/
if (script=="" && test=="" && game_path=="" && !editor) {
ProjectManager *pmanager = memnew( ProjectManager );
sml->get_root()->add_child(pmanager);
}
#endif
}
OS::get_singleton()->set_main_loop( main_loop );
return true;
}
uint64_t Main::last_ticks=0;
uint64_t Main::target_ticks=0;
float Main::time_accum=0;
uint32_t Main::frames=0;
uint32_t Main::frame=0;
bool Main::force_redraw_requested = false;
static uint64_t fixed_process_max=0;
static uint64_t idle_process_max=0;
bool Main::iteration() {
uint64_t ticks=OS::get_singleton()->get_ticks_usec();
uint64_t ticks_elapsed=ticks-last_ticks;
double step=(double)ticks_elapsed / 1000000.0;
float frame_slice=1.0/OS::get_singleton()->get_iterations_per_second();
// if (time_accum+step < frame_slice)
// return false;
frame+=ticks_elapsed;
last_ticks=ticks;
if (step>frame_slice*8)
step=frame_slice*8;
time_accum+=step;
float time_scale = OS::get_singleton()->get_time_scale();
bool exit=false;
int iters = 0;
while(time_accum>frame_slice) {
uint64_t fixed_begin = OS::get_singleton()->get_ticks_usec();
PhysicsServer::get_singleton()->sync();
PhysicsServer::get_singleton()->flush_queries();
Physics2DServer::get_singleton()->sync();
Physics2DServer::get_singleton()->flush_queries();
if (OS::get_singleton()->get_main_loop()->iteration( frame_slice*time_scale )) {
exit=true;
break;
}
message_queue->flush();
PhysicsServer::get_singleton()->step(frame_slice*time_scale);
Physics2DServer::get_singleton()->end_sync();
Physics2DServer::get_singleton()->step(frame_slice*time_scale);
time_accum-=frame_slice;
message_queue->flush();
//if (AudioServer::get_singleton())
// AudioServer::get_singleton()->update();
fixed_process_max=MAX(OS::get_singleton()->get_ticks_usec()-fixed_begin,fixed_process_max);
iters++;
}
uint64_t idle_begin = OS::get_singleton()->get_ticks_usec();
OS::get_singleton()->get_main_loop()->idle( step*time_scale );
message_queue->flush();
if (SpatialSoundServer::get_singleton())
SpatialSoundServer::get_singleton()->update( step*time_scale );
if (SpatialSound2DServer::get_singleton())
SpatialSound2DServer::get_singleton()->update( step*time_scale );
VisualServer::get_singleton()->sync(); //sync if still drawing from previous frames.
if (OS::get_singleton()->can_draw()) {
if ((!force_redraw_requested) && OS::get_singleton()->is_in_low_processor_usage_mode()) {
if (VisualServer::get_singleton()->has_changed()) {
VisualServer::get_singleton()->draw(); // flush visual commands
OS::get_singleton()->frames_drawn++;
}
} else {
VisualServer::get_singleton()->draw(); // flush visual commands
OS::get_singleton()->frames_drawn++;
force_redraw_requested = false;
}
}
if (AudioServer::get_singleton())
AudioServer::get_singleton()->update();
for(int i=0;i<ScriptServer::get_language_count();i++) {
ScriptServer::get_language(i)->frame();
}
idle_process_max=MAX(OS::get_singleton()->get_ticks_usec()-idle_begin,idle_process_max);
if (script_debugger)
script_debugger->idle_poll();
// x11_delay_usec(10000);
frames++;
if (frame>1000000) {
if (GLOBAL_DEF("debug/print_fps", OS::get_singleton()->is_stdout_verbose())) {
print_line("FPS: "+itos(frames));
};
OS::get_singleton()->_fps=frames;
performance->set_process_time(idle_process_max/1000000.0);
performance->set_fixed_process_time(fixed_process_max/1000000.0);
idle_process_max=0;
fixed_process_max=0;
if (GLOBAL_DEF("debug/print_metrics", false)) {
//PerformanceMetrics::print();
};
frame%=1000000;
frames=0;
}
if (OS::get_singleton()->is_in_low_processor_usage_mode() || !OS::get_singleton()->can_draw())
OS::get_singleton()->delay_usec(25000); //apply some delay to force idle time
else {
uint32_t frame_delay = OS::get_singleton()->get_frame_delay();
if (frame_delay)
OS::get_singleton()->delay_usec( OS::get_singleton()->get_frame_delay()*1000 );
}
int taret_fps = OS::get_singleton()->get_target_fps();
if (taret_fps>0) {
uint64_t time_step = 1000000L/taret_fps;
target_ticks += time_step;
uint64_t current_ticks = OS::get_singleton()->get_ticks_usec();
if (current_ticks<target_ticks) OS::get_singleton()->delay_usec(target_ticks-current_ticks);
current_ticks = OS::get_singleton()->get_ticks_usec();
target_ticks = MIN(MAX(target_ticks,current_ticks-time_step),current_ticks+time_step);
}
return exit;
}
void Main::force_redraw() {
force_redraw_requested = true;
};
void Main::cleanup() {
ERR_FAIL_COND(!_start_success);
if (script_debugger)
memdelete(script_debugger);
OS::get_singleton()->delete_main_loop();
OS::get_singleton()->_cmdline.clear();
OS::get_singleton()->_execpath="";
OS::get_singleton()->_local_clipboard="";
#ifdef TOOLS_ENABLED
EditorNode::unregister_editor_types();
#endif
unregister_driver_types();
unregister_module_types();
unregister_scene_types();
unregister_server_types();
OS::get_singleton()->finalize();
if (packed_data)
memdelete(packed_data);
if (file_access_network_client)
memdelete(file_access_network_client);
if (performance)
memdelete(performance);
if (input_map)
memdelete(input_map);
if (translation_server)
memdelete( translation_server );
if (path_remap)
memdelete(path_remap);
if (globals)
memdelete(globals);
memdelete( message_queue );
unregister_core_driver_types();
unregister_core_types();
//PerformanceMetrics::finish();
OS::get_singleton()->clear_last_error();
OS::get_singleton()->finalize_core();
}
|
{
"content_hash": "9ff12972d30c78eb13394d7cc240e310",
"timestamp": "",
"source": "github",
"line_count": 1529,
"max_line_length": 224,
"avg_line_length": 25.982995421844343,
"alnum_prop": 0.6240434957712445,
"repo_name": "gcbeyond/godot",
"id": "4cf4f3c7cdb5b76daf916998cc6001df8689d8a4",
"size": "39728",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "main/main.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ActionScript",
"bytes": "6955"
},
{
"name": "Assembly",
"bytes": "384031"
},
{
"name": "Batchfile",
"bytes": "2488"
},
{
"name": "C",
"bytes": "20880749"
},
{
"name": "C++",
"bytes": "13188295"
},
{
"name": "DIGITAL Command Language",
"bytes": "95419"
},
{
"name": "GAP",
"bytes": "3350"
},
{
"name": "GDScript",
"bytes": "86258"
},
{
"name": "GLSL",
"bytes": "56765"
},
{
"name": "HTML",
"bytes": "9365"
},
{
"name": "Java",
"bytes": "651775"
},
{
"name": "JavaScript",
"bytes": "5802"
},
{
"name": "Matlab",
"bytes": "2076"
},
{
"name": "Objective-C",
"bytes": "40272"
},
{
"name": "Objective-C++",
"bytes": "133237"
},
{
"name": "PHP",
"bytes": "1095905"
},
{
"name": "Perl",
"bytes": "1930126"
},
{
"name": "Python",
"bytes": "118627"
},
{
"name": "Shell",
"bytes": "1054"
},
{
"name": "XS",
"bytes": "4319"
},
{
"name": "eC",
"bytes": "3710"
}
],
"symlink_target": ""
}
|
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace UsingCustomMVVM.Helpers
{
public static class Json
{
public static async Task<T> ToObjectAsync<T>(string value)
{
return await Task.Run<T>(() =>
{
return JsonConvert.DeserializeObject<T>(value);
});
}
public static async Task<string> StringifyAsync(object value)
{
return await Task.Run<string>(() =>
{
return JsonConvert.SerializeObject(value);
});
}
}
}
|
{
"content_hash": "908a36e0248ef1a0b3169bafaf480d5a",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 69,
"avg_line_length": 23.44,
"alnum_prop": 0.537542662116041,
"repo_name": "CNinnovation/powercampwindows10",
"id": "03c57011fc0d0816ddd8c73f3e5601b246969d6d",
"size": "586",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "custommvvm/UsingCustomMVVM/UsingCustomMVVM/Helpers/Json.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "694683"
},
{
"name": "CSS",
"bytes": "718"
},
{
"name": "JavaScript",
"bytes": "34"
}
],
"symlink_target": ""
}
|
package lichen.creeper.core.services.jpa;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.metamodel.EntityType;
import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.ioc.MappedConfiguration;
import org.apache.tapestry5.ioc.annotations.Contribute;
import org.apache.tapestry5.ioc.services.PropertyAccess;
import org.apache.tapestry5.ioc.services.TypeCoercer;
import org.apache.tapestry5.services.ValueEncoderFactory;
import org.apache.tapestry5.services.ValueEncoderSource;
import org.slf4j.Logger;
import lichen.creeper.core.annotations.CreeperJpa;
import lichen.creeper.core.internal.jpa.JpaEntityValueEncoder;
/**
* 提供jpa中的实体对象和string的转换
* @author jcai
*/
public class CreeperJpaValueEncoderSourceModule {
@SuppressWarnings({ "rawtypes", "unchecked" })
@Contribute(ValueEncoderSource.class)
public static void provideValueEncoder(MappedConfiguration<Class<?>, ValueEncoderFactory<?>> configuration,
Logger logger,
final PropertyAccess propertyAccess,
final TypeCoercer typeCoercer,
@CreeperJpa EntityManagerFactory entityManagerFactory,
@CreeperJpa final EntityManager entityManager
){
Set<EntityType<?>> entities = entityManagerFactory.getMetamodel().getEntities();
for(final EntityType<?> entityType:entities){
if(!entityType.hasSingleIdAttribute()){
logger.warn("{} has more id attribute!",entityType.getName());
}
ValueEncoderFactory factory = new ValueEncoderFactory()
{
public ValueEncoder create(Class type)
{
return new JpaEntityValueEncoder(entityType,propertyAccess,typeCoercer,entityManager);
}
};
configuration.add(entityType.getJavaType(),factory);
}
}
}
|
{
"content_hash": "aa7ce6787271ea2fb6dc11438340d054",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 111,
"avg_line_length": 39.31481481481482,
"alnum_prop": 0.6552048987282147,
"repo_name": "ganshane/lichen",
"id": "b6f5a7293611761d5bc0aa8d3f4a46d688f5d360",
"size": "2147",
"binary": false,
"copies": "1",
"ref": "refs/heads/develop",
"path": "lichen-creeper/src/main/java/lichen/creeper/core/services/jpa/CreeperJpaValueEncoderSourceModule.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "149865"
},
{
"name": "Java",
"bytes": "588764"
},
{
"name": "Ruby",
"bytes": "7417"
},
{
"name": "Shell",
"bytes": "12415"
}
],
"symlink_target": ""
}
|
package org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.kerberos;
import java.net.URI;
import java.security.PrivilegedAction;
import java.util.Hashtable;
import java.util.List;
import javax.naming.AuthenticationException;
import javax.naming.CommunicationException;
import javax.naming.Context;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.directory.DirContext;
import javax.naming.directory.InitialDirContext;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.security.sasl.SaslException;
import org.apache.log4j.Logger;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.ipa.RHDSUserContextMapper;
import org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.ldap.LdapProviderType;
import org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.ldap.LdapSRVLocator;
import org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.ldap.RootDSEData;
/**
* JAAS Privileged action to be run when KerbersUtil successfully authenticates. This action performs ldap query to
* retrieve information on the authenticated user and prints the object GUID of that user.
*/
public class JndiAction implements PrivilegedAction {
private String userName;
private final String domainName;
private final LdapProviderType ldapProviderType;
private final StringBuffer userGuid;
private List<String> ldapServers;
private final String defaultLdapServerPort;
private final static Logger log = Logger.getLogger(JndiAction.class);
public JndiAction(String userName, String domainName, StringBuffer userGuid, LdapProviderType ldapProviderType, List<String> ldapServers, String defaultLdapServerPort) {
this.userName = userName;
this.domainName = domainName;
this.ldapProviderType = ldapProviderType;
this.userGuid = userGuid;
this.ldapServers = ldapServers;
this.defaultLdapServerPort = defaultLdapServerPort;
}
@Override
public Object run() {
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put("java.naming.ldap.attributes.binary", "objectGUID");
env.put(Context.SECURITY_AUTHENTICATION, "GSSAPI");
env.put("javax.security.sasl.qop", "auth-conf");
// Send an SRV record DNS query to retrieve all the LDAP servers in the domain
LdapSRVLocator locator = new LdapSRVLocator();
if (ldapServers == null ) {
try {
ldapServers = locator.getServersList(locator.getLdapServers(domainName));
} catch (Exception ex) {
return KerberosUtils.convertDNSException(ex);
}
}
String currentLdapServer = null;
if (ldapServers == null || ldapServers.size() == 0) {
return AuthenticationResult.CANNOT_FIND_LDAP_SERVER_FOR_DOMAIN;
}
// Goes over all the retrieved LDAP servers
for (String address : ldapServers) {
DirContext ctx = null;
try {
// Constructs an LDAP url in a format of ldap://hostname:port (based on the data in the SRV record
// This URL is not enough in order to query for user - as for querying users, we should also provide a
// base dn, for example: ldap://hostname:389/DC=abc,DC=com . However, this URL (ldap:hostname:port)
// suffices for
// getting the rootDSE information, which includes the baseDN.
URI uri = locator.constructURI("LDAP", address, defaultLdapServerPort);
try {
// Get the base DN from rootDSE
env.put(Context.PROVIDER_URL, uri.toString());
String domainDN = getDomainDN(uri.toString());
if (domainDN != null) {
// Append the base DN to the ldap URL in order to construct a full ldap URL (in form of
// ldap:hostname:port/baseDN ) to query for the user
StringBuilder ldapQueryPath = new StringBuilder(uri.toString());
ldapQueryPath.append("/").append(domainDN);
SearchControls controls = new SearchControls();
controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
// Adding all the three attributes possible, as RHDS doesn't return the nsUniqueId by default
controls.setReturningAttributes(new String[] { "nsUniqueId", "ipaUniqueId", "objectGuid",
"uniqueIdentifier", "entryuuid" });
// Added this in order to prevent a warning saying:
// "the returning obj flag wasn't set, setting it to true"
controls.setReturningObjFlag(true);
currentLdapServer = ldapQueryPath.toString();
env.put(Context.PROVIDER_URL, currentLdapServer);
// Run the LDAP query to get the user
ctx = new InitialDirContext(env);
NamingEnumeration<SearchResult> answer = executeQuery(ctx, controls, prepareQuery());
if (answer.hasMoreElements()) {
// Print the objectGUID for the user as well as URI and query path
String guid = guidFromResults(answer.next());
if (guid != null) {
userGuid.append(guid);
logQueryContext(userGuid.toString(), uri.toString(), currentLdapServer);
return AuthenticationResult.OK;
}
}
// Print user GUID and another logging info only if it was not printed previously already
logQueryContext(userGuid.toString(), uri.toString(), currentLdapServer);
System.out.println("No user in Directory was found for " + userName
+ ". Trying next LDAP server in list");
} else {
System.out.println(InstallerConstants.ERROR_PREFIX
+ " Failed to query rootDSE in order to get the baseDN. Could not query for user "
+ userName + " in domain " + domainName);
}
} finally {
if (ctx != null) {
ctx.close();
}
}
} catch (CommunicationException ex) {
handleCommunicationException(currentLdapServer, address);
} catch (AuthenticationException ex) {
handleAuthenticationException(ex);
} catch (NegativeArraySizeException ex) {
log.error("Internal Kerberos error.", ex);
return AuthenticationResult.INTERNAL_KERBEROS_ERROR;
} catch (Exception ex) {
handleGeneralException(ex);
break;
}
} // end of loop on addresses
return AuthenticationResult.NO_USER_INFORMATION_WAS_FOUND_FOR_USER;
}
protected void handleGeneralException(Exception ex) {
System.out.println("General error has occured" + ex.getMessage());
ex.printStackTrace();
}
protected void handleAuthenticationException(AuthenticationException ex) {
AuthenticationResult result = AuthenticationResult.OTHER;
KerberosReturnCodeParser parser = new KerberosReturnCodeParser();
result = parser.parse(ex.toString());
String errorMsg = result.getDetailedMessage().replace("Authentication Failed", "LDAP query Failed");
System.out.println(InstallerConstants.ERROR_PREFIX + errorMsg);
String krbLoginModuleErrorMsg = ex.getMessage();
if (ex.getRootCause() instanceof SaslException) {
SaslException saslException = (SaslException)ex.getRootCause();
krbLoginModuleErrorMsg = saslException.getMessage();
}
log.error("Error during login to kerberos. Detailed information is: " + krbLoginModuleErrorMsg);
log.debug("Error during login to kerberos. Detailed information is: ", ex);
}
protected void handleCommunicationException(String currentLdapServer, String address) {
String communicationFailureReason = null;
if (currentLdapServer != null) {
communicationFailureReason = "Cannot connect to LDAP URL: " + currentLdapServer;
} else {
if (address != null) {
communicationFailureReason = "Cannot connect to LDAP server " + address;
} else {
communicationFailureReason =
"Error in connectiong to LDAP server. LDAP server URL could not be obtained";
}
}
System.out.println(communicationFailureReason
+ ". Trying next LDAP server in list (if exists)");
}
private String guidFromResults(SearchResult sr) throws NamingException {
String guidString = "";
try {
if (ldapProviderType.equals(LdapProviderType.ipa)) {
String ipaUniqueId = (String) sr.getAttributes().get("ipaUniqueId").get();
guidString += ipaUniqueId;
} else if (ldapProviderType.equals(LdapProviderType.rhds)) {
String nsUniqueId = (String) sr.getAttributes().get("nsUniqueId").get();
guidString += RHDSUserContextMapper.getGuidFromNsUniqueId(nsUniqueId);
} else if (ldapProviderType.equals(LdapProviderType.itds)) {
String uniqueId = (String) sr.getAttributes().get("uniqueIdentifier").get();
guidString += uniqueId;
} else if (ldapProviderType.equals(LdapProviderType.openLdap)) {
String uniqueId = (String) sr.getAttributes().get("entryUUID").get();
guidString += uniqueId;
} else {
Object objectGuid = sr.getAttributes().get("objectGUID").get();
byte[] guid = (byte[]) objectGuid;
guidString += new Guid(guid, false).toString();
}
} catch (NullPointerException ne) {
System.out.println("LDAP connection successful. But no guid found");
guidString = null;
}
return guidString;
}
private String prepareQuery() {
String query;
if (ldapProviderType.equals(LdapProviderType.ipa)) {
userName = userName.split("@")[0];
query = "(&(objectClass=posixAccount)(objectClass=krbPrincipalAux)(uid=" + userName + "))";
} else if (ldapProviderType.equals(LdapProviderType.rhds)) {
userName = userName.split("@")[0];
query = "(&(objectClass=person)(uid=" + userName + "))";
} else if (ldapProviderType.equals(LdapProviderType.itds)) {
userName = userName.split("@")[0];
query = "(&(objectClass=person)(uid=" + userName + "))";
} else if (ldapProviderType.equals(LdapProviderType.openLdap)) {
userName = userName.split("@")[0];
query = "(uid=" + userName + ")";
}
else {
StringBuilder queryBase = new StringBuilder("(&(sAMAccountType=805306368)(");
if (userName.contains("@")) {
queryBase.append("userPrincipalName=" + userName);
} else {
if (userName.length() > 20) {
queryBase.append("userPrincipalName=")
.append(userName)
.append("@")
.append(domainName.toUpperCase());
} else {
queryBase.append("sAMAccountName=").append(userName);
}
}
query = queryBase.append("))").toString();
}
return query;
}
private NamingEnumeration<SearchResult> executeQuery(DirContext ctx, SearchControls controls, String query)
throws NamingException {
NamingEnumeration<SearchResult> answer = ctx.search("", query, controls);
return answer;
}
private String getDomainDN(String url) throws NamingException {
RootDSEData rootDSEData = new RootDSEData(url);
return rootDSEData.getDomainDN();
}
private void logQueryContext(String actualUserGuid, String actualUri, String actualCurrentLdapServer) {
// Log all information about query used for authentication
log.debug("User guid is: " + actualUserGuid);
log.debug("URI is: " + actualUri);
log.debug("Complete query path is: " + actualCurrentLdapServer);
}
}
|
{
"content_hash": "553a6e0e8e1d5ca37181bd9f8b1db5d7",
"timestamp": "",
"source": "github",
"line_count": 267,
"max_line_length": 173,
"avg_line_length": 48.50187265917603,
"alnum_prop": 0.6069498069498069,
"repo_name": "halober/ovirt-engine",
"id": "272a5f8ba5f908bb2c03ba4bc184cb58ccf119ec",
"size": "12950",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "backend/manager/modules/builtin-extensions/src/main/java/org/ovirt/engine/extensions/aaa/builtin/kerberosldap/utils/kerberos/JndiAction.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "251848"
},
{
"name": "Java",
"bytes": "26541598"
},
{
"name": "JavaScript",
"bytes": "890"
},
{
"name": "Python",
"bytes": "698283"
},
{
"name": "Shell",
"bytes": "105362"
},
{
"name": "XSLT",
"bytes": "54683"
}
],
"symlink_target": ""
}
|
package com.cyberfront.crdt.unittest;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.util.Collection;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.Test;
import com.cyberfront.crdt.sample.data.AbstractDataType;
import com.cyberfront.crdt.sample.manager.GenericManager;
import com.cyberfront.crdt.sample.manager.JsonManager;
import com.cyberfront.crdt.support.Support;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.github.fge.jsonpatch.diff.JsonDiff;
/**
* This contains a class used for performing unit tests designed to create a number of
* AbstractDataType instances using the factory. It is successful if it creates these
* objects and doesn't return null.
*/
public class TestCrdt {
public static class Json extends AssessmentSupport {
/** Constant defining the number of states to use in the testing */
private static final long STATE_COUNT = 1024L;
/** Logger to use when displaying state information */
private static final Logger logger = LogManager.getLogger(TestCrdt.Json.class);
/** Number of states to prepare for the testing suite */
private final long stateCount;
/** The ObjectMapper used to translate between JSON and any of the classes derived from
* com.cyberfront.crdt.unittest.data.AbstractDataType */
// @SuppressWarnings("unused")
private static final ObjectMapper mapper = new ObjectMapper();
/**
* Default constructor which initialized fields to their default values
*/
public Json() {
super();
this.stateCount = STATE_COUNT;
}
/**
* Constructor to deliberately initialize each field to the associated values provided
* @param stateCount The number of state transitions for the test
* @param trialCount Trial count to use for the test activity
* @param abbreviatedFactor Abbreviation factor to use the basis of this CreateTest instance when the abbreviated flag is set
* @param stressedFactor Stressed factor to use when the the stressed flag is set
* @param abbreviated Abbreviated flag which indicates when to divide different test parameters by the abbreviatedFactor
* @param stressed Stressed flag which indicates when to multiply different test parameters by the stressedFactor
*/
public Json(long stateCount, long trialCount, long abbreviatedFactor, long stressedFactor, boolean abbreviated, boolean stressed) {
super(trialCount, abbreviatedFactor, stressedFactor, abbreviated, stressed);
this.stateCount = stateCount;
}
/**
* Get the number of state transitions for this test suite
* @return The number of state transition for this test suite
*/
public long getStateCount() {
return this.stateCount * this.getStressedFactor() / this.getAbbreviatedFactor();
}
/**
* Test the recall ability a JSON CRDT to ensure the CRDT can reconstruct a JSON object it manages
*/
public void testRecall() {
logger.info("\n** TestCrdt.Json.testRecall: {\"count\":" + this.getTrialCount() + ", \"stateCount\":" + this.getStateCount()+ "}");
for (int trial=0; trial<this.getTrialCount(); ++trial) {
StringBuilder sb = new StringBuilder();
logger.info(" trial " + (trial+1) + " of " + this.getTrialCount() + ".");
Collection<AbstractDataType> objects = generateObjectSequence(this.stateCount, 0.1);
sb.append("{\"objects\":" + Support.convert(objects));
if (this.stateCount != objects.size()) {
sb.append("}");
System.out.println(sb.toString());
assertEquals(this.stateCount, objects.size(), "Object count mismatch: ");
}
Collection<JsonNode> documents = generateJsonSequence(objects);
sb.append(",\n\"documents\":" + Support.convert(documents));
if (this.stateCount != documents.size()) {
sb.append("}");
System.out.println(sb.toString());
assertEquals(this.stateCount, documents.size(), "Document count mismatch: ");
}
Collection<JsonNode> diffs = generateDifferenceSequence(documents);
sb.append(",\n\"diffs\":" + Support.convert(diffs));
if (this.stateCount != diffs.size()) {
sb.append("}");
System.out.println(sb.toString());
assertEquals(this.stateCount, diffs.size(), "Diference count mismatch: ");
}
Collection<JsonNode> regen = regenerateJsonSequence(diffs);
sb.append(",\n\"regen\":" + Support.convert(regen));
if (this.stateCount != regen.size()) {
sb.append("}");
System.out.println(sb.toString());
assertEquals(this.stateCount, regen.size(), "Regeneration count mismatch: ");
}
Collection<JsonNode> deviations = super.compareJsonSequence(documents, regen);
sb.append(",\n\"deviations\":" + Support.convert(deviations));
if (this.stateCount != deviations.size()) {
System.out.println(sb.toString());
assertEquals(this.stateCount, deviations.size(), "Deviation count mismatch: ");
}
for (JsonNode deviation : deviations) {
if (0 != deviation.size()) {
sb.append(",\n\"deviation\":" + (null == deviation ? "null" : deviation.toString()) + "}");
System.out.println(sb.toString());
assertEquals(0, deviation.size(), "Invalid regeneration: ");
}
}
}
logger.info(" SUCCESS");
}
/**
* Test the ability of the JsonManager to correctly encode the operations and generate the resulting object.
*/
public void testJsonCrdt() {
logger.info("\n** TestCrdt.Json.testJsonCrdt: {\"count\":" + this.getTrialCount() + ", \"stateCount\":" + this.getStateCount()+ "}");
for (int trial=0; trial<this.getTrialCount(); ++trial) {
logger.info(" trial " + (trial+1) + " of " + this.getTrialCount() + ".");
Collection<AbstractDataType> objects = generateObjectSequence(this.stateCount, 0.1);
Collection<JsonNode> documents = generateJsonSequence(objects);
long timeStamp = 0;
JsonManager mgr = new JsonManager(timeStamp);
for (JsonNode source : documents) {
mgr.update(source, timeStamp);
JsonNode target = mgr.read(timeStamp);
try {
target = mapper.readTree(target.toString());
source = mapper.readTree(source.toString());
} catch (IOException e) {
e.printStackTrace();
assertTrue(false);
}
JsonNode diff = JsonDiff.asJson(source, target);
if (0 != diff.size()) {
logger.error("timestamp: " + timeStamp);
logger.error("source: " + (null == source ? "null" : source.toString()));
logger.error("target: " + (null == target ? "null" : target.toString()));
logger.error("diff: " + (null == diff ? "null" : diff.toString()));
logger.error("mgr: " + (null == mgr ? "null" : mgr.toString()));
}
assertEquals( 0, diff.size(), "Difference Detected: ");
timeStamp += 10;
}
mgr.delete(timeStamp);
assertNull(mgr.read(timeStamp));
}
logger.info(" SUCCESS");
}
/**
* Test the ability of the CRDT to have an alternate representation and then to check the ability to reformat it as
* into its original form and then function correctly.
*/
public void testTransformation() {
logger.info("\n** TestCrdt.Json.testTransformation: {\"count\":" + this.getTrialCount() + ", \"stateCount\":" + this.getStateCount()+ "}");
for (int trial=0; trial<this.getTrialCount(); ++trial) {
logger.info(" trial " + (trial+1) + " of " + this.getTrialCount() + ".");
Collection<AbstractDataType> objects = generateObjectSequence(this.stateCount, 0.1);
Collection<JsonNode> states = generateJsonSequence(objects);
long timestamp = 0;
JsonManager mgr = new JsonManager(timestamp);
for (JsonNode source : states) {
mgr.update(source, timestamp);
JsonNode mgrDocument = getMapper().valueToTree(mgr);
String mgrString = mgrDocument.toString();
JsonNode restoredJsonMgr = null;
JsonManager restoredMgr = null;
try {
restoredJsonMgr = mapper.readerFor(JsonManager.class).readTree(mgrString);
restoredMgr = mapper.treeToValue(restoredJsonMgr, JsonManager.class);
} catch (IOException e1) {
logger.info(e1.toString());
logger.info("{\"mgr\":" + (null == mgr ? "null" : mgr.toString()) + ",");
logger.info("\"mgrDocument\":" + (null == mgrDocument ? "null" : mgrDocument.toString()) + ",");
logger.info("\"mgrString\":" + (null == mgrString ? "null" : mgrString) + ",");
logger.info("\"restoredJsonMgr\":" + (null == restoredJsonMgr ? "null" : restoredJsonMgr.toString()) + ",");
logger.info("\"restoredMgr\":" + (null == restoredMgr ? "null" : restoredMgr.toString()) + "}");
}
assertNotNull(restoredJsonMgr);
assertNotNull(restoredMgr);
JsonNode target = restoredMgr.read(timestamp);
try {
target = mapper.readTree(target.toString());
source = mapper.readTree(source.toString());
} catch (IOException e) {
e.printStackTrace();
assertTrue(false);
}
JsonNode diff = JsonDiff.asJson(target, source);
if (0 != diff.size()) {
logger.error("timestamp: " + timestamp);
logger.error("source: " + (null == source ? "null" : source.toString()));
logger.error("target: " + (null == target ? "null" : target.toString()));
logger.error("diff: " + (null == diff ? "null" : diff.toString()));
logger.error("mgr: " + (null == mgr ? "null" : mgr.toString()));
}
assertEquals(0, diff.size(), "Difference Detected: ");
timestamp += 10;
}
mgr.delete(timestamp);
assertNull(mgr.read(timestamp));
}
logger.info(" SUCCESS");
}
}
public static class Generic extends AssessmentSupport {
/** Constant defining the number of states to use in the testing */
private static final long STATE_COUNT = 1024L;
/** Logger to use when displaying state information */
private static final Logger logger = LogManager.getLogger(TestCrdt.Generic.class);
/** Number of states to prepare for the testing suite */
private final long stateCount;
/** The ObjectMapper used to translate between JSON and any of the classes derived from
* com.cyberfront.crdt.unittest.data.AbstractDataType */
// @SuppressWarnings("unused")
private static final ObjectMapper mapper = new ObjectMapper();
/**
* Default constructor which initialized fields to their default values
*/
public Generic() {
super();
this.stateCount = STATE_COUNT;
}
/**
* Constructor to deliberately initialize each field to the associated values provided
* @param stateCount Number of state transitions to model for each trial
* @param trialCount Trial count to use for the test activity
* @param abbreviatedFactor Abbreviation factor to use the basis of this CreateTest instance when the abbreviated flag is set
* @param stressedFactor Stressed factor to use when the the stressed flag is set
* @param abbreviated Abbreviated flag which indicates when to divide different test parameters by the abbreviatedFactor
* @param stressed Stressed flag which indicates when to multiply different test parameters by the stressedFactor
*/
public Generic(long stateCount, long trialCount, long abbreviatedFactor, long stressedFactor, boolean abbreviated, boolean stressed) {
super(trialCount, abbreviatedFactor, stressedFactor, abbreviated, stressed);
this.stateCount = stateCount;
}
/**
* Get the number of state transitions for this test suite
* @return The number of state transition for this test suite
*/
public long getStateCount() {
return this.stateCount * this.getStressedFactor() / this.getAbbreviatedFactor();
}
/**
* Test the ability of the JsonManager to correctly encode the operations and generate the resulting object.
*/
public void testCreateData() {
logger.info("\n** TestCrdt.Generic.testCreateData: {\"count\":" + this.getTrialCount() + ", \"stateCount\":" + this.getStateCount()+ "}");
for (int trial=0; trial<this.getTrialCount(); ++trial) {
logger.info(" trial " + (trial+1) + " of " + this.getTrialCount() + ".");
long timeStamp = 0;
Collection<AbstractDataType> states = super.generateObjectSequence(this.stateCount, 0.1);
GenericManager<AbstractDataType> mgr = null;
for (AbstractDataType source : states) {
if (null == mgr) {
mgr = new GenericManager<>(source, timeStamp);
} else {
mgr.update(source, timeStamp);
}
AbstractDataType target = mgr.read(timeStamp);
JsonNode diff = JsonDiff.asJson(mapper.valueToTree(source), mapper.valueToTree(target));
if (0 != diff.size()) {
logger.error("timestamp: " + timeStamp);
logger.error("source: " + (null == source ? "null" : source.toString()));
logger.error("target: " + (null == target ? "null" : target.toString()));
logger.error("diff: " + (null == diff ? "null" : diff.toString()));
logger.error("mgr: " + (null == mgr ? "null" : mgr.toString()));
}
assertEquals(0, diff.size(), "Difference Detected: ");
timeStamp += 10;
}
mgr.delete(timeStamp);
assertNull(mgr.read(timeStamp));
}
logger.info(" SUCCESS");
}
/**
* Test the ability of the CRDT to have an alternate representation and then to check the ability to reformat it as
* into its original form and then function correctly.
*/
public void testTransformation() {
logger.info("\n** TestCrdt.Generic.testTransformation: {\"count\":" + this.getTrialCount() + ", \"stateCount\":" + this.getStateCount()+ "}");
for (int trial=0; trial<this.getTrialCount(); ++trial) {
logger.info(" trial " + (trial+1) + " of " + this.getTrialCount() + ".");
Collection<AbstractDataType> states = super.generateObjectSequence(this.stateCount, 0.1);
GenericManager<AbstractDataType> mgr = null;
long timeStamp = 0;
for (AbstractDataType source : states) {
if (null == mgr) {
mgr = new GenericManager<>(source, timeStamp);
} else {
mgr.update(source, timeStamp);
}
AbstractDataType target = mgr.read(timeStamp);
JsonNode srcDoc = mapper.valueToTree(source);
JsonNode tgtDoc = mapper.valueToTree(target);
JsonNode diff = JsonDiff.asJson(srcDoc, tgtDoc);
if (0 != diff.size()) {
logger.error("timestamp: " + timeStamp);
logger.error("source: " + (null == source ? "null" : source.toString()));
logger.error("target: " + (null == target ? "null" : target.toString()));
logger.error("diff: " + (null == diff ? "null" : diff.toString()));
logger.error("mgr: " + (null == mgr ? "null" : mgr.toString()));
}
assertEquals( 0, diff.size(), "Difference Detected: ");
timeStamp += 10;
}
mgr.delete(timeStamp);
assertNull(mgr.read(timeStamp));
}
logger.info(" SUCCESS");
}
}
/**
* The main unit test routine used to perform the actual test execution
*/
@Test
public void testGenericOperations() {
Generic test = new Generic();
test.testCreateData();
}
/**
* The unit test for transforming the CRDT into an alternate form and transforming it back to its original form.
*/
@Test
public void testGenericTransformations() {
Generic test = new Generic();
test.testTransformation();
}
/**
* The main unit test routine used to perform the actual test execution
*/
@Test
public void testJsonOperations() {
Json test = new Json();
test.testJsonCrdt();
}
/**
* The unit tester for transforming the CRDT into an alternate form and transforming it back to its original form
*/
@Test
public void testJsonTransformations() {
Json test = new Json();
test.testTransformation();
}
/**
* Test the ability of the CRDT to recall the different states of the object for its saved states.
*/
@Test
public void testJsonRecall() {
Json test = new Json();
test.testRecall();
}
}
|
{
"content_hash": "0f5a20cdd5e3be5274feb16312a4df5e",
"timestamp": "",
"source": "github",
"line_count": 439,
"max_line_length": 145,
"avg_line_length": 36.62414578587699,
"alnum_prop": 0.6742754073889787,
"repo_name": "cyber-front/json-crdt",
"id": "41674edac15060ed90b695d35f1c15281fbf0f71",
"size": "17209",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/test/java/com/cyberfront/crdt/unittest/TestCrdt.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1764"
},
{
"name": "Java",
"bytes": "316741"
}
],
"symlink_target": ""
}
|
<div class="commune_descr limited">
<p>
Elnes est
un village
situé dans le département des Pas-de-Calais en Nord-Pas-de-Calais. Elle comptait 813 habitants en 2008.</p>
<p>À proximité de Elnes sont situées les communes de
<a href="{{VLROOT}}/immobilier/remilly-wirquin_62702/">Remilly-Wirquin</a> à 3 km, 343 habitants,
<a href="{{VLROOT}}/immobilier/esquerdes_62309/">Esquerdes</a> localisée à 4 km, 1 569 habitants,
<a href="{{VLROOT}}/immobilier/leulinghem_62504/">Leulinghem</a> localisée à 5 km, 219 habitants,
<a href="{{VLROOT}}/immobilier/wavrans-sur-laa_62882/">Wavrans-sur-l'Aa</a> localisée à 1 km, 1 297 habitants,
<a href="{{VLROOT}}/immobilier/acquin-westbecourt_62008/">Acquin-Westbécourt</a> à 4 km, 647 habitants,
<a href="{{VLROOT}}/immobilier/clety_62229/">Cléty</a> à 5 km, 628 habitants,
entre autres. De plus, Elnes est située à seulement 29 km de <a href="{{VLROOT}}/immobilier/hazebrouck_59295/">Hazebrouck</a>.</p>
<p>À Elnes, la valorisation moyenne à la vente d'un appartement s'évalue à zero € du m² en vente. La valeur moyenne d'une maison à l'achat se situe à 1 936 € du m². À la location la valeur moyenne se situe à 6,63 € du m² mensuel.</p>
<p>Si vous envisagez de demenager à Elnes, vous pourrez aisément trouver une maison à acheter. </p>
<p>Le parc d'habitations, à Elnes, se décomposait en 2011 en six appartements et 359 maisons soit
un marché relativement équilibré.</p>
</div>
|
{
"content_hash": "8d115aabf66efe677d3f0582ed1e695a",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 253,
"avg_line_length": 83.33333333333333,
"alnum_prop": 0.732,
"repo_name": "donaldinou/frontend",
"id": "ea52ee5342a9ec69a0f97284b1b9648039918b7d",
"size": "1537",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/Viteloge/CoreBundle/Resources/descriptions/62292.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ApacheConf",
"bytes": "3073"
},
{
"name": "CSS",
"bytes": "111338"
},
{
"name": "HTML",
"bytes": "58634405"
},
{
"name": "JavaScript",
"bytes": "88564"
},
{
"name": "PHP",
"bytes": "841919"
}
],
"symlink_target": ""
}
|
This program is for anyone using an Ecobee3 or similar model thermostat that supports the Ecobee API and is a Power Smart Pricing customer.
https://www.ecobee.com/
https://www.powersmartpricing.org/
The purpose of this program is to set the Ecobee thermostat to Away if the PSP price is greater than a user defined pricing point,
and will resume the programmed schedule when the price is equal or less than the user defined pricing point.
The program also requires IFTTT webhooks called PSP_Price_High_Notify and PSP_Price_Low_Notify for notifications.
Make sure the webhook event names match the names listed above and configure the applets however you like be notified.
https://ifttt.com/
IFTTT can be slow, so do not expect notification right away.
I have asked Power Smart Pricing to integrate with IFTTT, but that has not happened yet.
We could use IFTTT to control the Ecobee thermostat, but this can take 30 minutes to update after trigger.
Using the Ecobee API the update happens nearly instantly after triggering.
**Notice: The files client_id.txt, IFTTT_id.txt, and tokens.txt are only examples and contain bogas data.
These files will not work, please read below on how to configure them.
IFTTT_id.txt contains the key hash for the webhooks and can be found in Maker Webhooks settings.
client_id.txt contains your Ecobee client ID for this application and is found on your Ecobee thermostat after authorizing the application.
tokens.txt is a JSON file that contains the tokens for access and token refresh provided by Ecobee.
You will need to get the information contained in the files from Ecobee and IFTTT for your specific installation.
Please begin with the Ecobee Developers page.
https://www.ecobee.com/home/developer/api/introduction/index.shtml
If you have questions, the Ecobee Developer Community maybe able to help you.
http://developer.ecobee.com/api
This application also requires the use of CURL, so be sure to have CURL installed.
https://curl.haxx.se/
All files need to be in same directory.
Usage: psp.py -n -p price
-n Optional: Enables IFTTT notification.
-p price Required: Defines the maximum Power Smart Pricing price.
Example: psp.py -n -p 4.3
If you do not want IFTTT notifications then leave off the -n parameter.
Max Price is the Maximum Power Smart Pricing price per kWh you are willing to pay with HVAC system running normally.
If the price becomes higher than the Max Price your thermostat will be put in away mode, reducing run time until the Power Smart Pricing price is reduced to or less than the Max Price.
You may use the Ameren Electric Supply price or whatever price you prefer.
https://www.pluginillinois.org/FixedRateBreakdownAmeren.aspx
|
{
"content_hash": "ac17661c9294521e2abaa35190e148ef",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 184,
"avg_line_length": 43.88709677419355,
"alnum_prop": 0.7941933112826167,
"repo_name": "ke-mccormick/Ecobee_PSP",
"id": "1d67d88c8adbf10f9136cb56e88c9b8f5ceb0be1",
"size": "2735",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "7515"
}
],
"symlink_target": ""
}
|
This framework allows you to evaluate an Active Queue Management
implementation, such as PIE (or your own). It focuses on the queue
that is built in the router and the number of drops it causes.
It is also Explicit Congestion Control (ECN) compatible,
comparing non-ECN against ECN flows.
Your only requirement is a computer running Linux 4.10 or newer
(or actually, you should be able to use this for 3.16 and newer,
see below), and that you have Docker installed.
We currently recommend using Ubuntu 17.04, as it includes the
4.10 kernel.
Docker is no hard requirement, but you need a physical testbed
of 5 machines with networking unless you use it.
## Testbed structure
This is the structure we use for the evaluation:
```
+---------+ +--------+
Client A---| Clients |____| AQM |---Server A
Client B---| switch | | server |---Server B
+---------+ +--------+
```
This is the structure used for test traffic. In addition there
is a management network that don't affect the tests.
## Example implementation
An example is provided in
https://github.com/henrist/aqmt-example
It should let you get started with your first results within 10
minutes if you already have Docker.
## Dependencies using Docker
See [docker](./docker/README.md) subfolder for more details how
you can use it with Docker.
See below for details for how to use this without Docker, e.g.
on a physical testbed infrastructure.
## Using the framework to write tests and analyze results
See [aqmt](./aqmt/README.md) subfolder.
## Using schedulers (qdiscs) in tests
We have a special requirements for all schedulers we will be testing.
We need to modify them so they will give us precise statistics about
delay and drops.
We are using the IPv4 ID field in the packets to signal queueing delay
and drop information. See [RFC6864](https://tools.ietf.org/html/rfc6864)
for more details about the ID field.
We have provided three implementations you can look at:
- https://github.com/henrist/aqmt-fq-codel-scheduler
- https://github.com/henrist/aqmt-pfifo-scheduler
- https://github.com/henrist/aqmt-pie-scheduler
## Provided tools
A number of tools are provided to ease monitoring.
To be run on the AQM machine:
- `aqmt-aqm-monitor-node`: Runs `aqmt-monitor-node` on a given node. E.g.
`aqmt-aqm-monitor-node clienta`.
- `aqmt-aqm-monitor-setup`: Runs `aqmt-show-setup` periodically for the AQM
interface.
- `aqmt-aqm-monitor-traffic`: Runs `speedometer` for the three interfaces
on the AQM machine. Will visualize the traffic that is running.
- `aqmt-get-kernel-setup`: Will show you various ethernet and memory
settings that is currently in effect.
- `aqmt-ss-stats`: Runs `ss` on clients/servers filtering test traffic.
Can be used to investigate window sizes, memory configuration etc.
To be run on any machine:
- `aqmt-get-sysctl`: Show you the current rmem and wmem limits.
- `aqmt-kill-ssh-control-ports`: Removes the SSH control socket, can
be used if the SSH connections become stale (you don't normally need this).
- `aqmt-monitor-iface-status`: Monitors the number of packets sent/received
as well as number of drops on the interface level. If you have drops on the
interface level, other limits (such as netem limit) drops packets!
- `aqmt-show-setup`: Dumps information from `tc` and `ip`.
Run `aqmt-show-setup -h` for usage. Use it with `watch` to monitor
interfaces, e.g.: `watch -n 0.5 aqmt-show-setup -v $IFACE_AQM` on
a client/server.
Other utilities:
- `aqmt-reset-testbed`: Resets the testbed (removes the qdiscs, delay etc.)
from the AQM machine.
- `aqmt-set-sysctl-tcp-mem`: See seperate section explaining.
- `aqmt-update-nodes-vars`: See seperate section explaining.
- `aqmt-build-html-index`: Builds an HTML file with links to all individual
test flow plots for a specified result folder.
## Configuring the testbed outside a test
You can use the provided `configure-testbed.py` to set up the testbed
similar to what is done inside a test.
Use this if you want to experiment without having to run the test
framework.
When done, you can use `aqmt-reset-testbed` to remove the setup.
You will need to reset the testbed if you want to reload any
kernel modules. The framework resets before/after every test.
## Increasing the rmem and wmem tcp sizes
You normally don't need to do this.
On our test machine the default rmem and wmem values equals a maximum
TCP window size of approx 965 packets of 1500b MTU. (It's limited of the wmem,
allthough rmem defaults to approx 4780 packets.) On a 1 gigabit link, latency
above 11,6 ms will cause the utilization to drop.
To increase rmem and wmem to allow a TCP window up to approx. 5000 packets:
```bash
# from the AQM-machine
aqmt-set-sysctl-tcp-mem 5000
```
It will apply the change to all the machines.
## Vagrant and Ansible
This is work in progress where we want to use Vagrant to provision
a test environment (with Docker inside), so we have full control of the
host kernel.
https://www.vagrantup.com/docs/provisioning/ansible_local.html
## Running on a real testbed
Okay. So you don't trust Docker will give you good enough results,
or simply want everything to go over an physical environment.
The AQM-machine is the management node, where you need the framework,
define your environment and put your test scripts.
Required packages on the AQM-machine:
```bash
# on the AQM-machine
# (Ubuntu 16.10 has been used)
sudo apt install \
ethtool \
g++ \
gnuplot \
libpcap-dev \
make \
python3 \
python3-pip \
speedometer \
tmux
sudo pip3 install \
numpy \
plumbum
```
The clients and servers also need any needed package for the traffic
generation you are going to use. E.g. if you want to use iperf, you need
iperf available on the machines.
For the example repository, we are using
https://github.com/henrist/greedy which is installed by default in the
Docker container.
### SSH connections
The test scripts will connect to the other servers as root,
because it modifies the network configuration when running.
It needs ssh keys so it can SSH into the root user on all machines.
You should also set up a ControlPersist for higher efficiency when
doing remote SSH commands:
Add to `/etc/ssh/ssh_config` on the AQM machine:
```
Host 10.0.0.1 10.0.0.2 10.0.0.3
ControlMaster auto
ControlPersist yes
ControlPath ~/.ssh/socket-%r@%h:%p
AddressFamily inet
```
Replace the IPs with the ones you have on the clients/servers.
This should only be for the management network!
### Defining the environment
See the template `aqmt.env.template` and drop a modified version in
`/etc/aqmt.env`. It will be read by the framework so it knows your server
setup.
### Uploading tools and configuration to client/servers
The clients and servers needs a few scripts, as well as knowledge
of the environment.
On the AQM-machine:
```bash
# on the AQM-machine
source bin/aqmt-vars.sh
aqmt-update-nodes-data
```
### Building dependencies
We need to build some C++ programs (the ones who capture traffic and
analyze the captures):
```bash
# on the AQM-machine
make
```
### Adding ARP table entries
If you want to test for stability, you don't want the tests to be interrupted
with the network stack doing ARP requests.
```bash
# on the AQM-machine
aqmt-add-arp-entries
```
See the script for details.
|
{
"content_hash": "00b215de867fca04fe7f27a16ad12321",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 78,
"avg_line_length": 30.34156378600823,
"alnum_prop": 0.7469144174691442,
"repo_name": "henrist/aqmt",
"id": "fc18fa1c99fb866061110efbd4086a231903adf0",
"size": "7400",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "3227"
},
{
"name": "C++",
"bytes": "49605"
},
{
"name": "Dockerfile",
"bytes": "3364"
},
{
"name": "Makefile",
"bytes": "1943"
},
{
"name": "Python",
"bytes": "167599"
},
{
"name": "Shell",
"bytes": "38195"
}
],
"symlink_target": ""
}
|
/*
Added a @ViewOnly variable that will allow you to run this script as a test only and review proposed actions.
I also enhanced to perform either a reorg or rebuild, based on range of fragmentation value.
~Paul DeBrino : infinityrd.com
--INSPECT INDEXES' FILL FACTOR VALUES:
use YourDBName
select * from sys.indexes order by name
--VIEW THE DEFAULT FILL FACTOR OF YOUR SERVER:
use YourDBname
exec sp_configure 'show advanced options', 1
go
reconfigure
go
exec sp_configure 'fill factor'
go
*/
-- Specify your Database Name
--USE [[+dbname]]
--GO
-- Declare variables
SET NOCOUNT ON
DECLARE @tablename VARCHAR(128)
DECLARE @execstr VARCHAR(255)
DECLARE @objectid INT
DECLARE @indexid INT
DECLARE @frag decimal
DECLARE @maxreorg decimal
DECLARE @maxrebuild decimal
DECLARE @IdxName varchar(128)
DECLARE @ViewOnly bit
DECLARE @ReorgOptions varchar(255)
DECLARE @RebuildOptions varchar(255)
-- Set to 1 to view proposed actions, set to 0 to Execute proposed actions:
SET @ViewOnly=0
-- Decide on the maximum fragmentation to allow for a reorganize.
-- AVAILABLE OPTIONS: http://technet.microsoft.com/en-us/library/ms188388(SQL.90).aspx
SET @maxreorg = 20.0
SET @ReorgOptions = 'LOB_COMPACTION=ON'
-- Decide on the maximum fragmentation to allow for a rebuild.
SET @maxrebuild = 30.0
-- NOTE: only specifiy FILLFACTOR=x if x is something other than zero:
SET @RebuildOptions = 'PAD_INDEX=OFF, SORT_IN_TEMPDB=ON, STATISTICS_NORECOMPUTE=OFF, ALLOW_ROW_LOCKS=ON, ALLOW_PAGE_LOCKS=ON'
-- Declare a cursor.
DECLARE tables CURSOR FOR
SELECT CAST(TABLE_SCHEMA AS VARCHAR(100))
+'.'+CAST(TABLE_NAME AS VARCHAR(100))
AS Table_Name
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
-- Create the temporary table.
if exists (select name from tempdb.dbo.sysobjects where name like '#fraglist%')
drop table #fraglist
CREATE TABLE #fraglist (
ObjectName CHAR(255),
ObjectId INT,
IndexName CHAR(255),
IndexId INT,
Lvl INT,
CountPages INT,
CountRows INT,
MinRecSize INT,
MaxRecSize INT,
AvgRecSize INT,
ForRecCount INT,
Extents INT,
ExtentSwitches INT,
AvgFreeBytes INT,
AvgPageDensity INT,
ScanDensity decimal,
BestCount INT,
ActualCount INT,
LogicalFrag decimal,
ExtentFrag decimal)
-- Open the cursor.
OPEN tables
-- Loop through all the tables in the database.
FETCH NEXT
FROM tables
INTO @tablename
WHILE @@FETCH_STATUS = 0
BEGIN
-- Do the showcontig of all indexes of the table
INSERT INTO #fraglist
EXEC ('DBCC SHOWCONTIG (''' + @tablename + ''')
WITH FAST, TABLERESULTS, ALL_INDEXES, NO_INFOMSGS')
FETCH NEXT
FROM tables
INTO @tablename
END
-- Close and deallocate the cursor.
CLOSE tables
DEALLOCATE tables
-- Declare the cursor for the list of indexes to be defragged.
DECLARE indexes CURSOR FOR
SELECT ObjectName, ObjectId, IndexId, LogicalFrag, IndexName
FROM #fraglist
WHERE ((LogicalFrag >= @maxreorg) OR (LogicalFrag >= @maxrebuild))
AND INDEXPROPERTY (ObjectId, IndexName, 'IndexDepth') > 0
-- Open the cursor.
OPEN indexes
-- Loop through the indexes.
FETCH NEXT
FROM indexes
INTO @tablename, @objectid, @indexid, @frag, @IdxName
WHILE @@FETCH_STATUS = 0
BEGIN
IF (@frag >= @maxrebuild)
BEGIN
IF (@ViewOnly=1)
BEGIN
PRINT 'WOULD be executing ALTER INDEX ' + RTRIM(@IdxName) + ' ON ' + RTRIM(@tablename) + ' REBUILD WITH ( ' + @RebuildOptions + ' ) -- Fragmentation currently ' + RTRIM(CONVERT(VARCHAR(15),@frag)) + '%'
END
ELSE
BEGIN
PRINT 'Now executing ALTER INDEX ' + RTRIM(@IdxName) + ' ON ' + RTRIM(@tablename) + ' REBUILD WITH ( ' + @RebuildOptions + ' ) -- Fragmentation currently ' + RTRIM(CONVERT(VARCHAR(15),@frag)) + '%'
SELECT @execstr = 'ALTER INDEX ' + RTRIM(@IdxName) + ' ON ' + RTRIM(@tablename) + ' REBUILD WITH ( ' + @RebuildOptions + ' )'
EXEC (@execstr)
END
END
ELSE IF (@frag >= @maxreorg)
BEGIN
IF (@ViewOnly=1)
BEGIN
PRINT 'WOULD be executing ALTER INDEX ' + RTRIM(@IdxName) + ' ON ' + RTRIM(@tablename) + ' REORGANIZE WITH ( ' + @ReorgOptions + ' ) -- Fragmentation currently ' + RTRIM(CONVERT(VARCHAR(15),@frag)) + '%'
END
ELSE
BEGIN
PRINT 'Now executing ALTER INDEX ' + RTRIM(@IdxName) + ' ON ' + RTRIM(@tablename) + ' REORGANIZE WITH ( ' + @ReorgOptions + ' ) -- Fragmentation currently ' + RTRIM(CONVERT(VARCHAR(15),@frag)) + '%'
SELECT @execstr = 'ALTER INDEX ' + RTRIM(@IdxName) + ' ON ' + RTRIM(@tablename) + ' REORGANIZE WITH ( ' + @ReorgOptions + ' )'
EXEC (@execstr)
END
END
FETCH NEXT
FROM indexes
INTO @tablename, @objectid, @indexid, @frag, @IdxName
END
-- Close and deallocate the cursor.
CLOSE indexes
DEALLOCATE indexes
-- Delete the temporary table.
DROP TABLE #fraglist
--GO
|
{
"content_hash": "397c22a71c5333e9e9764f0e04e917db",
"timestamp": "",
"source": "github",
"line_count": 162,
"max_line_length": 203,
"avg_line_length": 28.067901234567902,
"alnum_prop": 0.7345502529140092,
"repo_name": "rustyhutchison/rustyhutchison.github.io",
"id": "5b3a6ed58be0e5c1b01a9c8949c76c2b5615a7f2",
"size": "4547",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "core/model/modx/processors/system/databasetable/defragment-indexes.sql",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "720933"
},
{
"name": "HTML",
"bytes": "142352"
},
{
"name": "Java",
"bytes": "14870"
},
{
"name": "JavaScript",
"bytes": "1890914"
},
{
"name": "PHP",
"bytes": "19285305"
},
{
"name": "SQLPL",
"bytes": "4547"
},
{
"name": "Smarty",
"bytes": "198133"
}
],
"symlink_target": ""
}
|
require 'test_helper'
require 'locus/collections'
class CollectionsTest < Minitest::Test
context ".find_class" do
should "properly find the class or return the collection class by default" do
assert_equal Locus::Components, Locus::Collections.find_class("components")
assert_equal Locus::Sites, Locus::Collections.find_class("sites")
assert_equal Locus::Collection, Locus::Collections.find_class("foo")
end
end
end
|
{
"content_hash": "f862c3c59727bbd2ef2357c3d8529838",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 81,
"avg_line_length": 37.166666666666664,
"alnum_prop": 0.7354260089686099,
"repo_name": "dphaener/locus-ruby",
"id": "03ca25b1e29caa65554d703737366230b4b848b8",
"size": "446",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/locus/collections_test.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "11783"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
}
|
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(factory((global.DateRangePicker = {})));
}(this, (function (exports) { 'use strict';
/**
* @file A generic set of mutation-free date functions.
*/
/**
* now returns the current date without any time values
*
* @returns {Date}
*/
function now() {
var dt = new Date();
dt.setHours(0, 0, 0, 0);
return dt;
}
/**
* dateEq compares two dates
*
* @param {Date} date1 the first date
* @param {Date} date2 the second date
* @returns {boolean}
*/
function datesEq(date1, date2) {
return (date1 && date1.toDateString()) === (date2 && date2.toDateString());
}
/**
* shiftDay shifts the specified date by n days
*
* @param {Date} dt
* @param {number} n
* @returns {Date}
*/
function shiftDay(dt, n) {
dt = new Date(dt);
dt.setDate(dt.getDate() + n);
return dt;
}
/**
* shiftMonth shifts the specified date by a specified number of months
*
* @param {Date} dt
* @param {number} n
* @param {boolean} wrap optional, if true, does not change year
* value, defaults to false
* @returns {Date}
*/
function shiftMonth(dt, n, wrap) {
dt = new Date(dt);
var dayOfMonth = dt.getDate();
var month = dt.getMonth() + n;
dt.setDate(1);
dt.setMonth(wrap ? (12 + month) % 12 : month);
dt.setDate(dayOfMonth);
// If dayOfMonth = 31, but the target month only has 30 or 29 or whatever...
// head back to the max of the target month
if (dt.getDate() < dayOfMonth) {
dt.setDate(0);
}
return dt;
}
/**
* shiftYear shifts the specified date by n years
*
* @param {Date} dt
* @param {number} n
* @returns {Date}
*/
function shiftYear(dt, n) {
dt = new Date(dt);
dt.setFullYear(dt.getFullYear() + n);
return dt;
}
/**
* setYear changes the specified date to the specified year
*
* @param {Date} dt
* @param {number} year
*/
function setYear(dt, year) {
dt = new Date(dt);
dt.setFullYear(year);
return dt;
}
/**
* setMonth changes the specified date to the specified month
*
* @param {Date} dt
* @param {number} month
*/
function setMonth(dt, month) {
return shiftMonth(dt, month - dt.getMonth());
}
/**
* dateOrParse creates a function which, given a date or string, returns a date
*
* @param {function} parse the function used to parse strings
* @returns {function}
*/
function dateOrParse(parse) {
return function (dt) {
return typeof dt === 'string' ? parse(dt) : dt;
};
}
/**
* constrainDate returns dt or min/max depending on whether dt is out of bounds (inclusive)
*
* @export
* @param {Date} dt
* @param {Date} min
* @param {Date} max
* @returns {Date}
*/
function constrainDate(dt, min, max) {
return (dt < min) ? min :
(dt > max) ? max :
dt;
}
/**
* @file Responsible for sanitizing and creating date picker options.
*/
var english = {
days: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
months: [
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
],
today: 'Today',
clear: 'Clear',
close: 'Close',
};
/**
* DatePickerOptions constructs a new date picker options object, overriding
* default values with any values specified in opts.
*
* @param {DatePickerOptions} opts
* @returns {DatePickerOptions}
*/
function DatePickerOptions(opts) {
opts = opts || {};
opts = cp(defaults(), opts);
var parse = dateOrParse(opts.parse);
opts.lang = cp(english, opts.lang);
opts.parse = parse;
opts.inRange = makeInRangeFn(opts);
opts.min = parse(opts.min || shiftYear(now(), -100));
opts.max = parse(opts.max || shiftYear(now(), 100));
opts.hilightedDate = opts.parse(opts.hilightedDate);
return opts;
}
function defaults() {
return {
lang: english,
// Possible values: dp-modal, dp-below, dp-permanent
mode: 'dp-modal',
// The date to hilight initially if the date picker has no
// initial value.
hilightedDate: now(),
format: function (dt) {
return (dt.getMonth() + 1) + '/' + dt.getDate() + '/' + dt.getFullYear();
},
parse: function (str) {
var date = new Date(str);
return isNaN(date) ? now() : date;
},
dateClass: function () { },
inRange: function () {
return true;
}
};
}
function makeInRangeFn(opts) {
var inRange = opts.inRange; // Cache this version, and return a variant
return function (dt, dp) {
return inRange(dt, dp) && opts.min <= dt && opts.max >= dt;
};
}
function cp(o1, o2) {
o2 = o2 || {};
for (var key in o2) {
o1[key] = o2[key];
}
return o1;
}
/**
* @file Helper functions for dealing with dom elements.
*/
var Key = {
left: 37,
up: 38,
right: 39,
down: 40,
enter: 13,
esc: 27,
};
/**
* on attaches an event handler to the specified element, and returns an
* off function which can be used to remove the handler.
*
* @param {string} evt the name of the event to handle
* @param {HTMLElement} el the element to attach to
* @param {function} handler the event handler
* @returns {function} the off function
*/
function on(evt, el, handler) {
el.addEventListener(evt, handler, true);
return function () {
el.removeEventListener(evt, handler, true);
};
}
var CustomEvent = shimCustomEvent();
function shimCustomEvent() {
var CustomEvent = window.CustomEvent;
if (typeof CustomEvent !== 'function') {
CustomEvent = function (event, params) {
params = params || {bubbles: false, cancelable: false, detail: undefined};
var evt = document.createEvent('CustomEvent');
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
return evt;
};
CustomEvent.prototype = window.Event.prototype;
}
return CustomEvent;
}
/**
* @file Manages the calendar / day-picker view.
*/
var dayPicker = {
onKeyDown: keyDown,
onClick: {
'dp-day': selectDay,
'dp-next': gotoNextMonth,
'dp-prev': gotoPrevMonth,
'dp-today': selectToday,
'dp-clear': clear,
'dp-close': close,
'dp-cal-month': showMonthPicker,
'dp-cal-year': showYearPicker,
},
render: render
};
/**
* view renders the calendar (day picker) as an HTML string.
*
* @param {DatePickerContext} context the date picker being rendered
* @returns {string}
*/
function render(dp) {
var opts = dp.opts;
var lang = opts.lang;
var state = dp.state;
var dayNames = lang.days;
var dayOffset = opts.dayOffset || 0;
var selectedDate = state.selectedDate;
var hilightedDate = state.hilightedDate;
var hilightedMonth = hilightedDate.getMonth();
var today = now().getTime();
return (
'<div class="dp-cal">' +
'<header class="dp-cal-header">' +
'<button tabindex="-1" type="button" class="dp-prev">Prev</button>' +
'<button tabindex="-1" type="button" class="dp-cal-month">' +
lang.months[hilightedMonth] +
'</button>' +
'<button tabindex="-1" type="button" class="dp-cal-year">' +
hilightedDate.getFullYear() +
'</button>' +
'<button tabindex="-1" type="button" class="dp-next">Next</button>' +
'</header>' +
'<div class="dp-days">' +
dayNames.map(function (name, i) {
return (
'<span class="dp-col-header">' + dayNames[(i + dayOffset) % dayNames.length] + '</span>'
);
}).join('') +
mapDays(hilightedDate, dayOffset, function (date) {
var isNotInMonth = date.getMonth() !== hilightedMonth;
var isDisabled = !opts.inRange(date);
var isToday = date.getTime() === today;
var className = 'dp-day';
className += (isNotInMonth ? ' dp-edge-day' : '');
className += (datesEq(date, hilightedDate) ? ' dp-current' : '');
className += (datesEq(date, selectedDate) ? ' dp-selected' : '');
className += (isDisabled ? ' dp-day-disabled' : '');
className += (isToday ? ' dp-day-today' : '');
className += ' ' + opts.dateClass(date, dp);
return (
'<button tabindex="-1" type="button" class="' + className + '" data-date="' + date.getTime() + '">' +
date.getDate() +
'</button>'
);
}) +
'</div>' +
'<footer class="dp-cal-footer">' +
'<button tabindex="-1" type="button" class="dp-today">' + lang.today + '</button>' +
'<button tabindex="-1" type="button" class="dp-clear">' + lang.clear + '</button>' +
'<button tabindex="-1" type="button" class="dp-close">' + lang.close + '</button>' +
'</footer>' +
'</div>'
);
}
/**
* keyDown handles the key down event for the day-picker
*
* @param {Event} e
* @param {DatePickerContext} dp
*/
function keyDown(e, dp) {
var key = e.keyCode;
var shiftBy =
(key === Key.left) ? -1 :
(key === Key.right) ? 1 :
(key === Key.up) ? -7 :
(key === Key.down) ? 7 :
0;
if (key === Key.esc) {
dp.close();
} else if (shiftBy) {
e.preventDefault();
dp.setState({
hilightedDate: shiftDay(dp.state.hilightedDate, shiftBy)
});
}
}
function selectToday(e, dp) {
dp.setState({
selectedDate: now(),
});
}
function clear(e, dp) {
dp.setState({
selectedDate: null,
});
}
function close(e, dp) {
dp.close();
}
function showMonthPicker(e, dp) {
dp.setState({
view: 'month'
});
}
function showYearPicker(e, dp) {
dp.setState({
view: 'year'
});
}
function gotoNextMonth(e, dp) {
var hilightedDate = dp.state.hilightedDate;
dp.setState({
hilightedDate: shiftMonth(hilightedDate, 1)
});
}
function gotoPrevMonth(e, dp) {
var hilightedDate = dp.state.hilightedDate;
dp.setState({
hilightedDate: shiftMonth(hilightedDate, -1)
});
}
function selectDay(e, dp) {
dp.setState({
selectedDate: new Date(parseInt(e.target.getAttribute('data-date'))),
});
}
function mapDays(currentDate, dayOffset, fn) {
var result = '';
var iter = new Date(currentDate);
iter.setDate(1);
iter.setDate(1 - iter.getDay() + dayOffset);
// If we are showing monday as the 1st of the week,
// and the monday is the 2nd of the month, the sunday won't
// show, so we need to shift backwards
if (dayOffset && iter.getDate() === dayOffset + 1) {
iter.setDate(dayOffset - 6);
}
// We are going to have 6 weeks always displayed to keep a consistent
// calendar size
for (var day = 0; day < (6 * 7); ++day) {
result += fn(iter);
iter.setDate(iter.getDate() + 1);
}
return result;
}
/**
* @file Manages the month-picker view.
*/
var monthPicker = {
onKeyDown: keyDown$1,
onClick: {
'dp-month': onChooseMonth
},
render: render$1
};
function onChooseMonth(e, dp) {
dp.setState({
hilightedDate: setMonth(dp.state.hilightedDate, parseInt(e.target.getAttribute('data-month'))),
view: 'day',
});
}
/**
* render renders the month picker as an HTML string
*
* @param {DatePickerContext} dp the date picker context
* @returns {string}
*/
function render$1(dp) {
var opts = dp.opts;
var lang = opts.lang;
var months = lang.months;
var currentDate = dp.state.hilightedDate;
var currentMonth = currentDate.getMonth();
return (
'<div class="dp-months">' +
months.map(function (month, i) {
var className = 'dp-month';
className += (currentMonth === i ? ' dp-current' : '');
return (
'<button tabindex="-1" type="button" class="' + className + '" data-month="' + i + '">' +
month +
'</button>'
);
}).join('') +
'</div>'
);
}
/**
* keyDown handles keydown events that occur in the month picker
*
* @param {Event} e
* @param {DatePickerContext} dp
*/
function keyDown$1(e, dp) {
var key = e.keyCode;
var shiftBy =
(key === Key.left) ? -1 :
(key === Key.right) ? 1 :
(key === Key.up) ? -3 :
(key === Key.down) ? 3 :
0;
if (key === Key.esc) {
dp.setState({
view: 'day',
});
} else if (shiftBy) {
e.preventDefault();
dp.setState({
hilightedDate: shiftMonth(dp.state.hilightedDate, shiftBy, true)
});
}
}
/**
* @file Manages the year-picker view.
*/
var yearPicker = {
render: render$2,
onKeyDown: keyDown$2,
onClick: {
'dp-year': onChooseYear
},
};
/**
* view renders the year picker as an HTML string.
*
* @param {DatePickerContext} dp the date picker context
* @returns {string}
*/
function render$2(dp) {
var state = dp.state;
var currentYear = state.hilightedDate.getFullYear();
var selectedYear = state.selectedDate.getFullYear();
return (
'<div class="dp-years">' +
mapYears(dp, function (year) {
var className = 'dp-year';
className += (year === currentYear ? ' dp-current' : '');
className += (year === selectedYear ? ' dp-selected' : '');
return (
'<button tabindex="-1" type="button" class="' + className + '" data-year="' + year + '">' +
year +
'</button>'
);
}) +
'</div>'
);
}
function onChooseYear(e, dp) {
dp.setState({
hilightedDate: setYear(dp.state.hilightedDate, parseInt(e.target.getAttribute('data-year'))),
view: 'day',
});
}
function keyDown$2(e, dp) {
var key = e.keyCode;
var opts = dp.opts;
var shiftBy =
(key === Key.left || key === Key.up) ? 1 :
(key === Key.right || key === Key.down) ? -1 :
0;
if (key === Key.esc) {
dp.setState({
view: 'day',
});
} else if (shiftBy) {
e.preventDefault();
var shiftedYear = shiftYear(dp.state.hilightedDate, shiftBy);
dp.setState({
hilightedDate: constrainDate(shiftedYear, opts.min, opts.max),
});
}
}
function mapYears(dp, fn) {
var result = '';
var max = dp.opts.max.getFullYear();
for (var i = max; i >= dp.opts.min.getFullYear(); --i) {
result += fn(i);
}
return result;
}
/**
* @file Utility functions for function manipulation.
*/
/**
* bufferFn buffers calls to fn so they only happen ever ms milliseconds
*
* @param {number} ms number of milliseconds
* @param {function} fn the function to be buffered
* @returns {function}
*/
function bufferFn(ms, fn) {
var timeout = undefined;
return function () {
clearTimeout(timeout);
timeout = setTimeout(fn, ms);
};
}
/**
* noop is a function which does nothing at all.
*/
function noop() { }
/**
* @file Defines the base date picker behavior, overridden by various modes.
*/
var views = {
day: dayPicker,
year: yearPicker,
month: monthPicker
};
function BaseMode(input, emit, opts) {
var detatchInputEvents; // A function that detaches all events from the input
var closing = false; // A hack to prevent calendar from re-opening when closing.
var selectedDate; // The currently selected date
var dp = {
// The root DOM element for the date picker, initialized on first open.
el: undefined,
opts: opts,
shouldFocusOnBlur: true,
shouldFocusOnRender: true,
state: initialState(),
adjustPosition: noop,
containerHTML: '<div class="dp"></div>',
attachToDom: function () {
document.body.appendChild(dp.el);
},
updateInput: function (selectedDate) {
var e = new CustomEvent('change', {bubbles: true});
e.simulated = true;
input.value = selectedDate ? opts.format(selectedDate) : '';
input.dispatchEvent(e);
},
computeSelectedDate: function () {
return opts.parse(input.value);
},
currentView: function() {
return views[dp.state.view];
},
open: function () {
if (closing) {
return;
}
if (!dp.el) {
dp.el = createContainerElement(opts, dp.containerHTML);
attachContainerEvents(dp);
}
selectedDate = constrainDate(dp.computeSelectedDate(), opts.min, opts.max);
dp.state.hilightedDate = selectedDate || opts.hilightedDate;
dp.state.view = 'day';
dp.attachToDom();
dp.render();
emit('open');
},
isVisible: function () {
return !!dp.el && !!dp.el.parentNode;
},
hasFocus: function () {
var focused = document.activeElement;
return dp.el &&
dp.el.contains(focused) &&
focused.className.indexOf('dp-focuser') < 0;
},
shouldHide: function () {
return dp.isVisible();
},
close: function (becauseOfBlur) {
var el = dp.el;
if (!dp.isVisible()) {
return;
}
if (el) {
var parent = el.parentNode;
parent && parent.removeChild(el);
}
closing = true;
if (becauseOfBlur && dp.shouldFocusOnBlur) {
focusInput(input);
}
// When we close, the input often gains refocus, which
// can then launch the date picker again, so we buffer
// a bit and don't show the date picker within N ms of closing
setTimeout(function() {
closing = false;
}, 100);
emit('close');
},
destroy: function () {
dp.close();
detatchInputEvents();
},
render: function () {
if (!dp.el) {
return;
}
var hadFocus = dp.hasFocus();
var html = dp.currentView().render(dp);
html && (dp.el.firstChild.innerHTML = html);
dp.adjustPosition();
if (hadFocus || dp.shouldFocusOnRender) {
focusCurrent(dp);
}
},
// Conceptually similar to setState in React, updates
// the view state and re-renders.
setState: function (state) {
for (var key in state) {
dp.state[key] = state[key];
}
emit('statechange');
dp.render();
},
};
detatchInputEvents = attachInputEvents(input, dp);
// Builds the initial view state
// selectedDate is a special case and causes changes to hilightedDate
// hilightedDate is set on open, so remains undefined initially
// view is the current view (day, month, year)
function initialState() {
return {
get selectedDate() {
return selectedDate;
},
set selectedDate(dt) {
if (dt && !opts.inRange(dt)) {
return;
}
if (dt) {
selectedDate = new Date(dt);
dp.state.hilightedDate = selectedDate;
} else {
selectedDate = dt;
}
dp.updateInput(selectedDate);
emit('select');
dp.close();
},
view: 'day',
};
}
return dp;
}
function createContainerElement(opts, containerHTML) {
var el = document.createElement('div');
el.className = opts.mode;
el.innerHTML = containerHTML;
return el;
}
function attachInputEvents(input, dp) {
var bufferShow = bufferFn(5, function () {
if (dp.shouldHide()) {
dp.close();
} else {
dp.open();
}
});
var off = [
on('blur', input, bufferFn(150, function () {
if (!dp.hasFocus()) {
dp.close(true);
}
})),
on('mousedown', input, function () {
if (input === document.activeElement) {
bufferShow();
}
}),
on('focus', input, bufferShow),
on('input', input, function (e) {
var date = dp.opts.parse(e.target.value);
isNaN(date) || dp.setState({
hilightedDate: date
});
}),
];
// Unregister all events that were registered above.
return function() {
off.forEach(function (f) {
f();
});
};
}
function focusCurrent(dp) {
var current = dp.el.querySelector('.dp-current');
return current && current.focus();
}
function attachContainerEvents(dp) {
var el = dp.el;
var calEl = el.querySelector('.dp');
// Hack to get iOS to show active CSS states
el.ontouchstart = noop;
function onClick(e) {
e.target.className.split(' ').forEach(function(evt) {
var handler = dp.currentView().onClick[evt];
handler && handler(e, dp);
});
}
// The calender fires a blur event *every* time we redraw
// this means we need to buffer the blur event to see if
// it still has no focus after redrawing, and only then
// do we return focus to the input. A possible other approach
// would be to set context.redrawing = true on redraw and
// set it to false in the blur event.
on('blur', calEl, bufferFn(150, function () {
if (!dp.hasFocus()) {
dp.close(true);
}
}));
on('keydown', el, function (e) {
if (e.keyCode === Key.enter) {
onClick(e);
} else {
dp.currentView().onKeyDown(e, dp);
}
});
// If the user clicks in non-focusable space, but
// still within the date picker, we don't want to
// hide, so we need to hack some things...
on('mousedown', calEl, function (e) {
e.target.focus && e.target.focus(); // IE hack
if (document.activeElement !== e.target) {
e.preventDefault();
focusCurrent(dp);
}
});
on('click', el, onClick);
}
function focusInput(input) {
// When the modal closes, we need to focus the original input so the
// user can continue tabbing from where they left off.
input.focus();
// iOS zonks out if we don't blur the input, so...
if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) {
input.blur();
}
}
/**
* @file Defines the modal date picker behavior.
*/
function ModalMode(input, emit, opts) {
var dp = BaseMode(input, emit, opts);
// In modal mode, users really shouldn't be able to type in
// the input, as all input is done via the calendar.
input.readonly = true;
// In modal mode, we need to know when the user has tabbed
// off the end of the calendar, and set focus to the original
// input. To do this, we add a special element to the DOM.
// When the user tabs off the bottom of the calendar, they
// will tab onto this element.
dp.containerHTML += '<a href="#" class="dp-focuser">.</a>';
return dp;
}
/**
* @file Defines the dropdown date picker behavior.
*/
function DropdownMode(input, emit, opts) {
var dp = BaseMode(input, emit, opts);
dp.shouldFocusOnBlur = false;
Object.defineProperty(dp, 'shouldFocusOnRender', {
get: function() {
return input !== document.activeElement;
}
});
dp.adjustPosition = function () {
autoPosition(input, dp);
};
return dp;
}
function autoPosition(input, dp) {
var inputPos = input.getBoundingClientRect();
var win = window;
adjustCalY(dp, inputPos, win);
adjustCalX(dp, inputPos, win);
dp.el.style.visibility = '';
}
function adjustCalX(dp, inputPos, win) {
var cal = dp.el;
var scrollLeft = win.pageXOffset;
var inputLeft = inputPos.left + scrollLeft;
var maxRight = win.innerWidth + scrollLeft;
var offsetWidth = cal.offsetWidth;
var calRight = inputLeft + offsetWidth;
var shiftedLeft = maxRight - offsetWidth;
var left = calRight > maxRight && shiftedLeft > 0 ? shiftedLeft : inputLeft;
cal.style.left = left + 'px';
}
function adjustCalY(dp, inputPos, win) {
var cal = dp.el;
var scrollTop = win.pageYOffset;
var inputTop = scrollTop + inputPos.top;
var calHeight = cal.offsetHeight;
var belowTop = inputTop + inputPos.height + 8;
var aboveTop = inputTop - calHeight - 8;
var isAbove = (aboveTop > 0 && belowTop + calHeight > scrollTop + win.innerHeight);
var top = isAbove ? aboveTop : belowTop;
if (cal.classList) {
cal.classList.toggle('dp-is-above', isAbove);
cal.classList.toggle('dp-is-below', !isAbove);
}
cal.style.top = top + 'px';
}
/**
* @file Defines the permanent date picker behavior.
*/
function PermanentMode(root, emit, opts) {
var dp = BaseMode(root, emit, opts);
dp.close = noop;
dp.destroy = noop;
dp.updateInput = noop;
dp.shouldFocusOnRender = false;
dp.computeSelectedDate = function () {
return opts.hilightedDate;
};
dp.attachToDom = function () {
root.appendChild(dp.el);
};
dp.open();
return dp;
}
/**
* @file Defines the various date picker modes (modal, dropdown, permanent)
*/
function Mode(input, emit, opts) {
input = input && input.tagName ? input : document.querySelector(input);
if (opts.mode === 'dp-modal') {
return ModalMode(input, emit, opts);
}
if (opts.mode === 'dp-below') {
return DropdownMode(input, emit, opts);
}
if (opts.mode === 'dp-permanent') {
return PermanentMode(input, emit, opts);
}
}
/**
* @file Defines simple event emitter behavior.
*/
/**
* Emitter constructs a new emitter object which has on/off methods.
*
* @returns {EventEmitter}
*/
function Emitter() {
var handlers = {};
function onOne(name, handler) {
(handlers[name] = (handlers[name] || [])).push(handler);
}
function onMany(fns) {
for (var name in fns) {
onOne(name, fns[name]);
}
}
return {
on: function (name, handler) {
if (handler) {
onOne(name, handler);
} else {
onMany(name);
}
return this;
},
emit: function (name, arg) {
(handlers[name] || []).forEach(function (handler) {
handler(name, arg);
});
},
off: function (name, handler) {
if (!name) {
handlers = {};
} else if (!handler) {
handlers[name] = [];
} else {
handlers[name] = (handlers[name] || []).filter(function (h) {
return h !== handler;
});
}
return this;
}
};
}
/**
* @file The root date picker file, defines public exports for the library.
*/
/**
* The date picker language configuration
* @typedef {Object} LangOptions
* @property {Array.<string>} [days] - Days of the week
* @property {Array.<string>} [months] - Months of the year
* @property {string} today - The label for the 'today' button
* @property {string} close - The label for the 'close' button
* @property {string} clear - The label for the 'clear' button
*/
/**
* The configuration options for a date picker.
*
* @typedef {Object} DatePickerOptions
* @property {LangOptions} [lang] - Configures the label text, defaults to English
* @property {('dp-modal'|'dp-below'|'dp-permanent')} [mode] - The date picker mode, defaults to 'dp-modal'
* @property {(string|Date)} [hilightedDate] - The date to hilight if no date is selected
* @property {function(string|Date):Date} [parse] - Parses a date, the complement of the "format" function
* @property {function(Date):string} [format] - Formats a date for displaying to user
* @property {function(Date):string} [dateClass] - Associates a custom CSS class with a date
* @property {function(Date):boolean} [inRange] - Indicates whether or not a date is selectable
* @property {(string|Date)} [min] - The minimum selectable date (inclusive, default 100 years ago)
* @property {(string|Date)} [max] - The maximum selectable date (inclusive, default 100 years from now)
*/
/**
* The state values for the date picker
*
* @typedef {Object} DatePickerState
* @property {string} view - The current view 'day' | 'month' | 'year'
* @property {Date} selectedDate - The date which has been selected by the user
* @property {Date} hilightedDate - The date which is currently hilighted / active
*/
/**
* An instance of TinyDatePicker
*
* @typedef {Object} DatePicker
* @property {DatePickerState} state - The values currently displayed.
* @property {function} on - Adds an event handler
* @property {function} off - Removes an event handler
* @property {function} setState - Changes the current state of the date picker
* @property {function} open - Opens the date picker
* @property {function} close - Closes the date picker
* @property {function} destroy - Destroys the date picker (removing all handlers from the input, too)
*/
/**
* TinyDatePicker constructs a new date picker for the specified input
*
* @param {HTMLElement | string} input The input or CSS selector associated with the datepicker
* @param {DatePickerOptions} opts The options for initializing the date picker
* @returns {DatePicker}
*/
function TinyDatePicker(input, opts) {
var emitter = Emitter();
var options = DatePickerOptions(opts);
var mode = Mode(input, emit, options);
var me = {
get state() {
return mode.state;
},
on: emitter.on,
off: emitter.off,
setState: mode.setState,
open: mode.open,
close: mode.close,
destroy: mode.destroy,
};
function emit(evt) {
emitter.emit(evt, me);
}
return me;
}
// A date range picker built on top of TinyDatePicker;
var TinyDatePicker$1 = TinyDatePicker;
/**
* The state values for the date range picker
*
* @typedef {Object} DateRangeState
* @property {Date} start - The start date (can be null)
* @property {Date} end - The end date (can be null)
*/
/**
* An instance of TinyDatePicker
*
* @typedef {Object} DateRangePickerInst
* @property {DateRangeState} state - The start / end dates
* @property {function} on - Adds an event handler
* @property {function} off - Removes an event handler
* @property {function} setState - Changes the current state of the date picker
*/
/**
* TinyDatePicker constructs a new date picker for the specified input
*
* @param {HTMLElement} input The input associated with the datepicker
* @returns {DateRangePickerInst}
*/
function DateRangePicker(container) {
var emitter = Emitter();
var root = renderInto(container);
var hoverDate;
var state = {
start: undefined,
end: undefined,
};
var start = TinyDatePicker(root.querySelector('.dr-cal-start'), {
mode: 'dp-permanent',
dateClass: dateClass,
});
var end = TinyDatePicker(root.querySelector('.dr-cal-end'), {
mode: 'dp-permanent',
hilightedDate: shiftMonth(start.state.hilightedDate, 1),
dateClass: dateClass,
});
var handlers = {
'statechange': onStateChange,
'select': dateSelected,
};
var me = {
state: state,
setState: setState,
on: emitter.on,
off: emitter.off,
};
start.on(handlers);
end.on(handlers);
function onStateChange(_, dp) {
var d1 = start.state.hilightedDate;
var d2 = end.state.hilightedDate;
var diff = diffMonths(d1, d2);
if (diff === 1) {
return;
}
if (dp === start) {
end.setState({
hilightedDate: shiftMonth(dp.state.hilightedDate, 1),
});
} else {
start.setState({
hilightedDate: shiftMonth(dp.state.hilightedDate, -1),
});
}
}
function dateSelected(_, dp) {
var dt = dp.state.selectedDate;
if (!state.start || state.end) {
setState({
start: dt,
end: undefined,
});
} else {
setState({
start: dt > state.start ? state.start : dt,
end: dt > state.start ? dt : state.start,
});
}
}
function setState(newState) {
for (var key in newState) {
state[key] = newState[key];
}
emitter.emit('statechange', me);
rerender();
}
function rerender() {
start.setState({});
end.setState({});
}
root.addEventListener('mouseover', function mouseOverDate(e) {
if (e.target.classList.contains('dp-day')) {
var dt = new Date(parseInt(e.target.dataset.date));
var changed = !datesEq(dt, hoverDate);
if (changed) {
hoverDate = dt;
rerender();
}
}
});
function dateClass(dt) {
var rangeClass = hoverDate &&
state.start &&
inRange(dt, state.end || hoverDate, state.start);
var selectedClass = datesEq(dt, state.start) || datesEq(dt, state.end);
return (rangeClass ? 'dr-in-range ' : '') +
(selectedClass ? 'dr-selected ' : '');
}
return me;
}
function renderInto(container) {
if (typeof container === 'string') {
container = document.querySelector(container);
}
container.innerHTML = '<div class="dr-cals">' +
'<div class="dr-cal-start"></div>' +
'<div class="dr-cal-end"></div>' +
'</div>';
return container.querySelector('.dr-cals');
}
function toMonths(dt) {
return (dt.getYear() * 12) + dt.getMonth();
}
function diffMonths(d1, d2) {
return toMonths(d2) - toMonths(d1);
}
function inRange(dt, start, end) {
return (dt < end && dt >= start) || (dt <= start && dt > end);
}
exports.TinyDatePicker = TinyDatePicker$1;
exports.DateRangePicker = DateRangePicker;
Object.defineProperty(exports, '__esModule', { value: true });
})));
|
{
"content_hash": "2ddbd68e2fa90f156f1778a30d8e2f81",
"timestamp": "",
"source": "github",
"line_count": 1347,
"max_line_length": 115,
"avg_line_length": 25.682256867112102,
"alnum_prop": 0.571573105162745,
"repo_name": "holtkamp/cdnjs",
"id": "0c2a75d1b8581f617bc2b412ae187914e53140ac",
"size": "34594",
"binary": false,
"copies": "9",
"ref": "refs/heads/master",
"path": "ajax/libs/tiny-date-picker/3.2.3/date-range-picker.js",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!--L
Copyright Oracle Inc
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cadsr-cgmdr-nci-uk/LICENSE.txt for details.
L-->
<cgMDR:Data_Element_Concept xmlns:cgMDR="http://www.cancergrid.org/schema/cgMDR" item_registration_authority_identifier="US-NCICB-CACORE" data_identifier="2193015" version="1">
<cgMDR:administered_item_administration_record>
<cgMDR:administrative_status>noPendingChanges</cgMDR:administrative_status>
<cgMDR:creation_date>2007-04-17</cgMDR:creation_date>
<cgMDR:effective_date>2007-04-17</cgMDR:effective_date>
<cgMDR:explanatory_comment>Transformed from NCICB caDSR</cgMDR:explanatory_comment>
<cgMDR:last_change_date>2007-04-17</cgMDR:last_change_date>
<cgMDR:registration_status>Standard</cgMDR:registration_status>
</cgMDR:administered_item_administration_record>
<cgMDR:administered_by>US-NCICB-CTEP-STEWARD</cgMDR:administered_by>
<cgMDR:registered_by>US-NCICB-CACORE-REGISTRAR</cgMDR:registered_by>
<cgMDR:submitted_by>US-NCICB-CTEP-SUMBMITTER</cgMDR:submitted_by>
<cgMDR:having>
<cgMDR:context_identifier>US-NCICB-CTEP-1</cgMDR:context_identifier>
<cgMDR:containing>
<cgMDR:language_section_language_identifier>
<cgMDR:country_identifier>US</cgMDR:country_identifier>
<cgMDR:language_identifier>eng</cgMDR:language_identifier>
</cgMDR:language_section_language_identifier>
<cgMDR:name>Common Toxicity Criteria Adverse Event Leukocyte</cgMDR:name>
<cgMDR:definition_text/>
<cgMDR:preferred_designation>true</cgMDR:preferred_designation>
<cgMDR:definition_source_reference/>
</cgMDR:containing>
<cgMDR:containing>
<cgMDR:language_section_language_identifier>
<cgMDR:country_identifier>US</cgMDR:country_identifier>
<cgMDR:language_identifier>eng</cgMDR:language_identifier>
</cgMDR:language_section_language_identifier>
<cgMDR:name>CTC_AE_LEUKOCYTE</cgMDR:name>
<cgMDR:definition_text/>
<cgMDR:preferred_designation>false</cgMDR:preferred_designation>
<cgMDR:definition_source_reference/>
</cgMDR:containing>
</cgMDR:having>
<cgMDR:data_element_concept_conceptual_domain>US-NCICB-CACORE-2008517-1</cgMDR:data_element_concept_conceptual_domain>
<cgMDR:data_element_concept_object_class>US-NCICB-CACORE-2206385-1</cgMDR:data_element_concept_object_class>
<cgMDR:data_element_concept_property>US-NCICB-CACORE-2192259-1</cgMDR:data_element_concept_property>
</cgMDR:Data_Element_Concept>
|
{
"content_hash": "64bee08a70e6caf4231f2d591feef804",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 176,
"avg_line_length": 56.9375,
"alnum_prop": 0.7065495792169777,
"repo_name": "NCIP/cadsr-cgmdr-nci-uk",
"id": "1ac9bd1d2c9eb28856033369e6e70813858c2b79",
"size": "2733",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "cancergrid/datasets/cancergrid-dataset/data/data_element_concept/US-NCICB-CACORE-2193015-1.xml",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "C#",
"bytes": "291811"
},
{
"name": "CSS",
"bytes": "46374"
},
{
"name": "Emacs Lisp",
"bytes": "1302"
},
{
"name": "Java",
"bytes": "12447025"
},
{
"name": "JavaScript",
"bytes": "659235"
},
{
"name": "Perl",
"bytes": "14339"
},
{
"name": "Python",
"bytes": "8079"
},
{
"name": "Shell",
"bytes": "47723"
},
{
"name": "XQuery",
"bytes": "592174"
},
{
"name": "XSLT",
"bytes": "441742"
}
],
"symlink_target": ""
}
|
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("GeeksChallenge.Web.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GeeksChallenge.Web.Tests")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("052170a2-afad-4dab-815b-077245bd496f")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
|
{
"content_hash": "04737367e165b7a12126ac6d889a8297",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 84,
"avg_line_length": 39.47222222222222,
"alnum_prop": 0.7466572836030964,
"repo_name": "adaraz/GeeksChallenge",
"id": "e03cbcd17031d53ebe4cdffd1166b526cf761ff4",
"size": "1424",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "GeeksChallenge.Web.Tests/Properties/AssemblyInfo.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "221"
},
{
"name": "C#",
"bytes": "9465"
}
],
"symlink_target": ""
}
|
#include "core/span.h"
#include "receiver/receiver.h"
#include "sampler/sampler.h"
#include "util/cmp.h"
#include "util/log.h"
#include "util/rand.h"
#include "util/string.h"
#include "util/time.h"
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/**
* @file span.c
*
* Implementation of HTrace spans.
*/
struct htrace_span *htrace_span_alloc(const char *desc,
uint64_t begin_ms, struct htrace_span_id *span_id)
{
struct htrace_span *span;
span = malloc(sizeof(*span));
if (!span) {
return NULL;
}
span->desc = strdup(desc);
if (!span->desc) {
free(span);
return NULL;
}
span->begin_ms = begin_ms;
span->end_ms = 0;
htrace_span_id_copy(&span->span_id, span_id);
span->trid = NULL;
span->num_parents = 0;
htrace_span_id_clear(&span->parent.single);
span->parent.list = NULL;
return span;
}
void htrace_span_free(struct htrace_span *span)
{
if (!span) {
return;
}
free(span->desc);
free(span->trid);
if (span->num_parents > 1) {
free(span->parent.list);
}
free(span);
}
typedef int (*qsort_fn_t)(const void *, const void *);
void htrace_span_sort_and_dedupe_parents(struct htrace_span *span)
{
int i, j, num_parents = span->num_parents;
struct htrace_span_id prev;
if (num_parents <= 1) {
return;
}
qsort(span->parent.list, num_parents, sizeof(struct htrace_span_id),
(qsort_fn_t)htrace_span_id_compare);
prev = span->parent.list[0];
htrace_span_id_copy(&prev, &span->parent.list[0]);
j = 1;
for (i = 1; i < num_parents; i++) {
if (htrace_span_id_compare(&prev, span->parent.list + i) != 0) {
htrace_span_id_copy(&prev, span->parent.list + i);
htrace_span_id_copy(span->parent.list + j, span->parent.list + i);
j++;
}
}
span->num_parents = j;
if (j == 1) {
// After deduplication, there is now only one entry. Switch to the
// optimized no-malloc representation for 1 entry.
free(span->parent.list);
span->parent.single = prev;
} else if (j != num_parents) {
// After deduplication, there are now fewer entries. Use realloc to
// shrink the size of our dynamic allocation if possible.
struct htrace_span_id *nlist =
realloc(span->parent.list, sizeof(struct htrace_span_id) * j);
if (nlist) {
span->parent.list = nlist;
}
}
}
/**
* Translate the span to a JSON string.
*
* This function can be called in two ways. With buf == NULL, we will determine
* the size of the buffer that would be required to hold a JSON string
* containing the span contents. With buf non-NULL, we will write the span
* contents to the provided buffer.
*
* @param span The span
* @param max The maximum number of bytes to write to buf.
* @param buf If non-NULL, where the string will be written.
*
* @return The number of bytes that the span json would take
* up if it were written out.
*/
static int span_json_sprintf_impl(const struct htrace_span *span,
int max, char *buf)
{
int num_parents, i, ret = 0;
const char *prefix = "";
char sbuf[HTRACE_SPAN_ID_STRING_LENGTH + 1];
// Note that we have validated the description and process ID strings to
// make sure they don't contain anything evil. So we don't need to escape
// them here.
htrace_span_id_to_str(&span->span_id, sbuf, sizeof(sbuf));
ret += fwdprintf(&buf, &max, "{\"a\":\"%s\",\"b\":%" PRId64
",\"e\":%" PRId64",", sbuf, span->begin_ms,
span->end_ms);
if (span->desc[0]) {
ret += fwdprintf(&buf, &max, "\"d\":\"%s\",", span->desc);
}
if (span->trid) {
ret += fwdprintf(&buf, &max, "\"r\":\"%s\",", span->trid);
}
num_parents = span->num_parents;
if (num_parents == 0) {
ret += fwdprintf(&buf, &max, "\"p\":[]");
} else if (num_parents == 1) {
htrace_span_id_to_str(&span->parent.single, sbuf, sizeof(sbuf));
ret += fwdprintf(&buf, &max, "\"p\":[\"%s\"]", sbuf);
} else if (num_parents > 1) {
ret += fwdprintf(&buf, &max, "\"p\":[");
for (i = 0; i < num_parents; i++) {
htrace_span_id_to_str(span->parent.list + i, sbuf, sizeof(sbuf));
ret += fwdprintf(&buf, &max, "%s\"%s\"", prefix, sbuf);
prefix = ",";
}
ret += fwdprintf(&buf, &max, "]");
}
ret += fwdprintf(&buf, &max, "}");
// Add one to 'ret' to take into account the terminating null that we
// need to write.
return ret + 1;
}
int span_json_size(const struct htrace_span *span)
{
return span_json_sprintf_impl(span, 0, NULL);
}
void span_json_sprintf(const struct htrace_span *span, int max, void *buf)
{
span_json_sprintf_impl(span, max, buf);
}
int span_write_msgpack(const struct htrace_span *span, cmp_ctx_t *ctx)
{
int i, num_parents;
uint16_t map_size =
1 + // desc
1 + // begin_ms
1 + // end_ms
1; // span_id
num_parents = span->num_parents;
if (span->trid) {
map_size++;
}
if (num_parents > 0) {
map_size++;
}
if (!cmp_write_map16(ctx, map_size)) {
return 0;
}
if (!cmp_write_fixstr(ctx, "a", 1)) {
return 0;
}
if (!htrace_span_id_write_msgpack(&span->span_id, ctx)) {
return 0;
}
if (!cmp_write_fixstr(ctx, "d", 1)) {
return 0;
}
if (!cmp_write_str16(ctx, span->desc, strlen(span->desc))) {
return 0;
}
if (!cmp_write_fixstr(ctx, "b", 1)) {
return 0;
}
if (!cmp_write_u64(ctx, span->begin_ms)) {
return 0;
}
if (!cmp_write_fixstr(ctx, "e", 1)) {
return 0;
}
if (!cmp_write_u64(ctx, span->end_ms)) {
return 0;
}
if (span->trid) {
if (!cmp_write_fixstr(ctx, "r", 1)) {
return 0;
}
if (!cmp_write_str16(ctx, span->trid, strlen(span->trid))) {
return 0;
}
}
if (num_parents > 0) {
if (!cmp_write_fixstr(ctx, "p", 1)) {
return 0;
}
if (!cmp_write_array16(ctx, num_parents)) {
return 0;
}
if (num_parents == 1) {
if (!htrace_span_id_write_msgpack(&span->parent.single, ctx)) {
return 0;
}
} else {
for (i = 0; i < num_parents; i++) {
if (!htrace_span_id_write_msgpack(span->parent.list + i, ctx)) {
return 0;
}
}
}
}
return 1;
}
// vim:ts=4:sw=4:et
|
{
"content_hash": "53a281cc249ac2781ab12a21b6661cc2",
"timestamp": "",
"source": "github",
"line_count": 240,
"max_line_length": 80,
"avg_line_length": 28.5375,
"alnum_prop": 0.5333625346765951,
"repo_name": "reta/incubator-htrace",
"id": "44f4e6c4d9db4c67ea5549f8a3b481dffa102e41",
"size": "7655",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "htrace-c/src/core/span.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "379823"
},
{
"name": "C++",
"bytes": "11127"
},
{
"name": "CMake",
"bytes": "8331"
},
{
"name": "CSS",
"bytes": "3184"
},
{
"name": "Go",
"bytes": "251720"
},
{
"name": "HTML",
"bytes": "16983"
},
{
"name": "Java",
"bytes": "380323"
},
{
"name": "JavaScript",
"bytes": "306417"
},
{
"name": "Protocol Buffer",
"bytes": "1357"
},
{
"name": "Shell",
"bytes": "13147"
},
{
"name": "Thrift",
"bytes": "3207"
}
],
"symlink_target": ""
}
|
package com.swfarm.biz.magento.bo.magentoapi;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for anonymous complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within
* this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="result" type="{urn:Magento}catalogProductEntityArray"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "result" })
@XmlRootElement(name = "catalogProductListResponseParam")
public class CatalogProductListResponseParam {
@XmlElement(required = true)
protected CatalogProductEntityArray result;
/**
* Gets the value of the result property.
*
* @return possible object is {@link CatalogProductEntityArray }
*
*/
public CatalogProductEntityArray getResult() {
return result;
}
/**
* Sets the value of the result property.
*
* @param value
* allowed object is {@link CatalogProductEntityArray }
*
*/
public void setResult(CatalogProductEntityArray value) {
this.result = value;
}
}
|
{
"content_hash": "46e77bcfdb093d43dbd5796c55112fb5",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 84,
"avg_line_length": 25.966666666666665,
"alnum_prop": 0.67201540436457,
"repo_name": "zhangqiang110/my4j",
"id": "cacb0dc78ec597a3ff0e8152921356b091fd849c",
"size": "1558",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pms/src/main/java/com/swfarm/biz/magento/bo/magentoapi/CatalogProductListResponseParam.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "41428"
}
],
"symlink_target": ""
}
|
C sketch
C metropolis hasting monte carlo
C hamiltonian monte carlo
C not really gonna use it, consider there are
C MCMCpack and STAN
C rather for fun and jot down thoughts
C
C arXiv:1808.08490v2
C MikeXL/bayes/R/mcmc.r
C
C metropolis hasting, the simplest one
C target the logged posterior function
C nmc number iterations
C nbi burnin
C chain the Markov chain
C23456789
subroutine metrop(target, nmc, nbi, chain)
call random_number(chain(1, :))
do 71 i = 2, nmc
x = chain(i-1, :)
call random_number(chain(i, :)
call random_number(metropolis)
h = exp(target(chain(i, :)) - target(x))
if h > metropolis then
C accept
else
C reject
chain(i, :) = x
end
71 continue
end subroutine metrop
C
C Hamiltonian, put out your sketchbook
C derivatives
C
subroutine ham()
do 99 i = 1, nmc
C where the magic happens
call molecular_dynamics(..., Hi, Hf)
h = exp(Hf - Hi)
call random_number(metropolis)
if h > metropolis then
C
else
C
end if
99 continue
end subroutine ham
|
{
"content_hash": "09f62ff26dd9ad5cec1ebdd5a1eb12fb",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 50,
"avg_line_length": 24.895833333333332,
"alnum_prop": 0.602510460251046,
"repo_name": "MikeXL/bayes",
"id": "ef82c9248e2bb026b06709ff1c692ad71907280b",
"size": "1195",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/mc.f",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Mathematica",
"bytes": "64486"
},
{
"name": "R",
"bytes": "10468"
},
{
"name": "TeX",
"bytes": "1762"
}
],
"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_80) on Thu Oct 15 19:27:46 UTC 2015 -->
<title>DescribeExportTasksResult (AWS SDK for Java - 1.10.27)</title>
<meta name="date" content="2015-10-15">
<link rel="stylesheet" type="text/css" href="../../../../../JavaDoc.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="DescribeExportTasksResult (AWS SDK for Java - 1.10.27)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>
<!-- Scripts for Syntax Highlighter START-->
<script id="syntaxhighlight_script_core" type="text/javascript" src = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/scripts/shCore.js">
</script>
<script id="syntaxhighlight_script_java" type="text/javascript" src = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/scripts/shBrushJava.js">
</script>
<link id="syntaxhighlight_css_core" rel="stylesheet" type="text/css" href = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/styles/shCoreDefault.css"/>
<link id="syntaxhighlight_css_theme" rel="stylesheet" type="text/css" href = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/styles/shThemeDefault.css"/>
<!-- Scripts for Syntax Highlighter END-->
<div>
<!-- BEGIN-SECTION -->
<div id="divsearch" style="float:left;">
<span id="lblsearch" for="searchQuery">
<label>Search</label>
</span>
<form id="nav-search-form" target="_parent" method="get" action="http://docs.aws.amazon.com/search/doc-search.html#facet_doc_guide=API+Reference&facet_doc_product=AWS+SDK+for+Java">
<div id="nav-searchfield-outer" class="nav-sprite">
<div class="nav-searchfield-inner nav-sprite">
<div id="nav-searchfield-width">
<input id="nav-searchfield" name="searchQuery">
</div>
</div>
</div>
<div id="nav-search-button" class="nav-sprite">
<input alt="" id="nav-search-button-inner" type="image">
</div>
<input name="searchPath" type="hidden" value="documentation-guide" />
<input name="this_doc_product" type="hidden" value="AWS SDK for Java" />
<input name="this_doc_guide" type="hidden" value="API Reference" />
<input name="doc_locale" type="hidden" value="en_us" />
</form>
</div>
<!-- END-SECTION -->
<!-- BEGIN-FEEDBACK-SECTION -->
<div id="feedback-section">
<h3>Did this page help you?</h3>
<div id="feedback-link-sectioin">
<a id="feedback_yes" target="_blank" style="display:inline;">Yes</a>
<a id="feedback_no" target="_blank" style="display:inline;">No</a>
<a id="go_cti" target="_blank" style="display:inline;">Tell us about it...</a>
</div>
</div>
<script type="text/javascript">
window.onload = function(){
/* Dynamically add feedback links */
var javadoc_root_name = "/javadoc/";
var javadoc_path = location.href.substring(0, location.href.lastIndexOf(javadoc_root_name) + javadoc_root_name.length);
var file_path = location.href.substring(location.href.lastIndexOf(javadoc_root_name) + javadoc_root_name.length);
var feedback_yes_url = javadoc_path + "javadoc-resources/feedbackyes.html?topic_id=";
var feedback_no_url = javadoc_path + "javadoc-resources/feedbackno.html?topic_id=";
var feedback_tellmore_url = "https://aws-portal.amazon.com/gp/aws/html-forms-controller/documentation/aws_doc_feedback_04?service_name=Java-Ref&file_name=";
if(file_path != "overview-frame.html") {
var file_name = file_path.replace(/[/.]/g, '_');
document.getElementById("feedback_yes").setAttribute("href", feedback_yes_url + file_name);
document.getElementById("feedback_no").setAttribute("href", feedback_no_url + file_name);
document.getElementById("go_cti").setAttribute("href", feedback_tellmore_url + file_name);
} else {
// hide the search box and the feeback links in overview-frame page,
// show "AWS SDK for Java" instead.
document.getElementById("feedback-section").outerHTML = "AWS SDK for Java";
document.getElementById("divsearch").outerHTML = "";
}
};
</script>
<!-- END-FEEDBACK-SECTION -->
</div>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksRequest.html" title="class in com.amazonaws.services.logs.model"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/amazonaws/services/logs/model/DescribeLogGroupsRequest.html" title="class in com.amazonaws.services.logs.model"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/amazonaws/services/logs/model/DescribeExportTasksResult.html" target="_top">Frames</a></li>
<li><a href="DescribeExportTasksResult.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.amazonaws.services.logs.model</div>
<h2 title="Class DescribeExportTasksResult" class="title">Class DescribeExportTasksResult</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>com.amazonaws.services.logs.model.DescribeExportTasksResult</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, java.lang.Cloneable</dd>
</dl>
<hr>
<br>
<pre>public class <span class="strong">DescribeExportTasksResult</span>
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable</pre>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../serialized-form.html#com.amazonaws.services.logs.model.DescribeExportTasksResult">Serialized Form</a></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#DescribeExportTasksResult()">DescribeExportTasksResult</a></strong>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#clone()">clone</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#equals(java.lang.Object)">equals</a></strong>(java.lang.Object obj)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.util.List<<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#getExportTasks()">getExportTasks</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#getNextToken()">getNextToken</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#hashCode()">hashCode</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#setExportTasks(java.util.Collection)">setExportTasks</a></strong>(java.util.Collection<<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>> exportTasks)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#setNextToken(java.lang.String)">setNextToken</a></strong>(java.lang.String nextToken)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#toString()">toString</a></strong>()</code>
<div class="block">Returns a string representation of this object; useful for testing and
debugging.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#withExportTasks(java.util.Collection)">withExportTasks</a></strong>(java.util.Collection<<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>> exportTasks)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#withExportTasks(com.amazonaws.services.logs.model.ExportTask...)">withExportTasks</a></strong>(<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>... exportTasks)</code>
<div class="block">
<b>NOTE:</b> This method appends the values to the existing list (if
any).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a></code></td>
<td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#withNextToken(java.lang.String)">withNextToken</a></strong>(java.lang.String nextToken)</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>getClass, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="DescribeExportTasksResult()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DescribeExportTasksResult</h4>
<pre>public DescribeExportTasksResult()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getExportTasks()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getExportTasks</h4>
<pre>public java.util.List<<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>> getExportTasks()</pre>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="setExportTasks(java.util.Collection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setExportTasks</h4>
<pre>public void setExportTasks(java.util.Collection<<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>> exportTasks)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>exportTasks</code> - </dd></dl>
</li>
</ul>
<a name="withExportTasks(com.amazonaws.services.logs.model.ExportTask...)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withExportTasks</h4>
<pre>public <a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a> withExportTasks(<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>... exportTasks)</pre>
<div class="block"><p>
<b>NOTE:</b> This method appends the values to the existing list (if
any). Use <a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#setExportTasks(java.util.Collection)"><code>setExportTasks(java.util.Collection)</code></a> or
<a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html#withExportTasks(java.util.Collection)"><code>withExportTasks(java.util.Collection)</code></a> if you want to override
the existing values.
</p></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>exportTasks</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns a reference to this object so that method calls can be
chained together.</dd></dl>
</li>
</ul>
<a name="withExportTasks(java.util.Collection)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withExportTasks</h4>
<pre>public <a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a> withExportTasks(java.util.Collection<<a href="../../../../../com/amazonaws/services/logs/model/ExportTask.html" title="class in com.amazonaws.services.logs.model">ExportTask</a>> exportTasks)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>exportTasks</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns a reference to this object so that method calls can be
chained together.</dd></dl>
</li>
</ul>
<a name="setNextToken(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setNextToken</h4>
<pre>public void setNextToken(java.lang.String nextToken)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>nextToken</code> - </dd></dl>
</li>
</ul>
<a name="getNextToken()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNextToken</h4>
<pre>public java.lang.String getNextToken()</pre>
<dl><dt><span class="strong">Returns:</span></dt><dd></dd></dl>
</li>
</ul>
<a name="withNextToken(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>withNextToken</h4>
<pre>public <a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a> withNextToken(java.lang.String nextToken)</pre>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>nextToken</code> - </dd>
<dt><span class="strong">Returns:</span></dt><dd>Returns a reference to this object so that method calls can be
chained together.</dd></dl>
</li>
</ul>
<a name="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString()</pre>
<div class="block">Returns a string representation of this object; useful for testing and
debugging.</div>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>A string representation of this object.</dd><dt><span class="strong">See Also:</span></dt><dd><code>Object.toString()</code></dd></dl>
</li>
</ul>
<a name="equals(java.lang.Object)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public boolean equals(java.lang.Object obj)</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>equals</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="hashCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public int hashCode()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="clone()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>clone</h4>
<pre>public <a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksResult.html" title="class in com.amazonaws.services.logs.model">DescribeExportTasksResult</a> clone()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>clone</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><em>
<div>
<!-- Script for Syntax Highlighter START -->
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
<!-- Script for Syntax Highlighter END -->
</div>
<script src="http://a0.awsstatic.com/chrome/js/1.0.46/jquery.1.9.js" type="text/javascript"></script>
<script>jQuery.noConflict();</script>
<script>
jQuery(function ($) {
$("div.header").prepend('<!--REGION_DISCLAIMER_DO_NOT_REMOVE-->');
});
</script>
<!-- BEGIN-URCHIN-TRACKER -->
<script src="http://l0.awsstatic.com/js/urchin.js" type="text/javascript"></script>
<script type="text/javascript">urchinTracker();</script>
<!-- END-URCHIN-TRACKER -->
<!-- SiteCatalyst code version: H.25.2. Copyright 1996-2012 Adobe, Inc. All Rights Reserved.
More info available at http://www.omniture.com -->
<script language="JavaScript" type="text/javascript" src="https://media.amazonwebservices.com/js/sitecatalyst/s_code.min.js (view-source:https://media.amazonwebservices.com/js/sitecatalyst/s_code.min.js)" />
<script language="JavaScript" type="text/javascript">
<!--
// Documentation Service Name
s.prop66='AWS SDK for Java';
s.eVar66='D=c66';
// Documentation Guide Name
s.prop65='API Reference';
s.eVar65='D=c65';
var s_code=s.t();if(s_code)document.write(s_code)
//-->
</script>
<script language="JavaScript" type="text/javascript">
<!--if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-')
//-->
</script>
<noscript>
<img src="http://amazonwebservices.d2.sc.omtrdc.net/b/ss/awsamazondev/1/H.25.2--NS/0" height="1" width="1" border="0" alt="" />
</noscript>
<!--/DO NOT REMOVE/-->
<!-- End SiteCatalyst code version: H.25.2. -->
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../com/amazonaws/services/logs/model/DescribeExportTasksRequest.html" title="class in com.amazonaws.services.logs.model"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../com/amazonaws/services/logs/model/DescribeLogGroupsRequest.html" title="class in com.amazonaws.services.logs.model"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?com/amazonaws/services/logs/model/DescribeExportTasksResult.html" target="_top">Frames</a></li>
<li><a href="DescribeExportTasksResult.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.
</small></p>
</body>
</html>
|
{
"content_hash": "9b1d1dccc796c7e4ae47da7b621799bd",
"timestamp": "",
"source": "github",
"line_count": 554,
"max_line_length": 401,
"avg_line_length": 46.227436823104696,
"alnum_prop": 0.6374463100351425,
"repo_name": "TomNong/Project2-Intel-Edison",
"id": "86294473eedc2cc2bd7c725eadbf6fb0bc4d65aa",
"size": "25610",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "documentation/javadoc/com/amazonaws/services/logs/model/DescribeExportTasksResult.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "5522"
}
],
"symlink_target": ""
}
|
module HasTags
class Tag < ::ActiveRecord::Base
#### Self referential association for contexts ####
belongs_to :context, class_name: "Tag"
has_many :tags, foreign_key: :context_id
###################################################
has_many :taggings
validates :name, uniqueness: true, presence: true
def self.top_level_tags
where(context_id: nil)
end
end
end
|
{
"content_hash": "07ec5f3fec58f86a2a382e78323aa474",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 55,
"avg_line_length": 25.3125,
"alnum_prop": 0.5703703703703704,
"repo_name": "garrettqmartin8/has_tags",
"id": "25e4bc69f94609c9621550a803c3fb03bde6b342",
"size": "405",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/has_tags/tag.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "11603"
}
],
"symlink_target": ""
}
|
Contains a quite simple lambda for geocoding addresses, that is invoked by SQS events which are sent from backend application.
## Run locally
``serverless offline start --stage dev``
This mocks a local SQS.
## Deploy
``serverless login``
``serverless decrypt --stage prod --password 'MY_PASSWORD' ``
``serverless deploy --stage prod``
## Helpful Links
https://github.com/softwaremill/elasticmq
https://github.com/AnomalyInnovations/serverless-bundle
https://github.com/FidelLimited/serverless-plugin-warmup
https://serverless.com/blog/structuring-a-real-world-serverless-app/
https://serverless.com/blog/serverless-deployment-best-practices/
https://serverless.com/blog/setup-monitoring-for-existing-serverless-projects-in-2min/
https://serverless.com/blog/serverless-microservice/
https://serverless.com/blog/common-node8-mistakes-in-lambda/
https://serverless.com/blog/unit-testing-nodejs-serverless-jest/
https://serverless.com/blog/aws-lambda-sqs-serverless-integration/
https://serverless.com/framework/docs/providers/aws/events/apigateway/
https://serverless-stack.com/#table-of-contents
https://serverless-stack.com/chapters/organizing-serverless-projects.html
https://serverless-stack.com/chapters/add-a-create-note-api.html
https://serverless-stack.com/chapters/unit-tests-in-serverless.html
https://serverless-stack.com/chapters/debugging-serverless-api-issues.html
|
{
"content_hash": "fec7088e9ec5a136e6b5ba92b0e4b910",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 126,
"avg_line_length": 32.41860465116279,
"alnum_prop": 0.796987087517934,
"repo_name": "Clemens85/runningdinner",
"id": "5edba46489c102172a51073bff2dfa9ee4c0ebb0",
"size": "1407",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "runningdinner-functions/README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9964"
},
{
"name": "HTML",
"bytes": "220884"
},
{
"name": "Java",
"bytes": "1059912"
},
{
"name": "JavaScript",
"bytes": "915942"
},
{
"name": "Less",
"bytes": "18959"
},
{
"name": "Shell",
"bytes": "3096"
},
{
"name": "TypeScript",
"bytes": "656882"
}
],
"symlink_target": ""
}
|
layout: default
title: Nossos parceiros
permalink: /partners/
---
{% include top-section.html %}
{% include partners.html %}
|
{
"content_hash": "37fc78405ef2758d8ccaccc7dfea92f4",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 30,
"avg_line_length": 15.75,
"alnum_prop": 0.7142857142857143,
"repo_name": "DevFestNordeste/2014",
"id": "4264a447599068d739cd89b81bee9e4b9436986e",
"size": "130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "partners.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "3678"
},
{
"name": "CSS",
"bytes": "150218"
},
{
"name": "HTML",
"bytes": "80903"
},
{
"name": "JavaScript",
"bytes": "31611"
},
{
"name": "Ruby",
"bytes": "1236"
}
],
"symlink_target": ""
}
|
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <misc/printk.h>
#include <stdbool.h>
#include <zephyr/types.h>
#include <stdlib.h>
#include <string.h>
#include "json.h"
struct token {
enum json_tokens type;
char *start;
char *end;
};
struct lexer {
void *(*state)(struct lexer *lexer);
unsigned char *start;
unsigned char *pos;
unsigned char *end;
struct token token;
};
struct json_obj {
struct lexer lexer;
};
struct json_obj_key_value {
const char *key;
size_t key_len;
struct token value;
};
static bool lexer_consume(struct lexer *lexer, struct token *token,
enum json_tokens empty_token)
{
if (lexer->token.type == empty_token) {
return false;
}
*token = lexer->token;
lexer->token.type = empty_token;
return true;
}
static bool lexer_next(struct lexer *lexer, struct token *token)
{
while (lexer->state) {
if (lexer_consume(lexer, token, JSON_TOK_NONE)) {
return true;
}
lexer->state = lexer->state(lexer);
}
return lexer_consume(lexer, token, JSON_TOK_EOF);
}
static void *lexer_json(struct lexer *lexer);
static void emit(struct lexer *lexer, enum json_tokens token)
{
lexer->token.type = token;
lexer->token.start = lexer->start;
lexer->token.end = lexer->pos;
lexer->start = lexer->pos;
}
static unsigned char next(struct lexer *lexer)
{
if (lexer->pos >= lexer->end) {
lexer->pos = lexer->end + 1;
return '\0';
}
return *lexer->pos++;
}
static void ignore(struct lexer *lexer)
{
lexer->start = lexer->pos;
}
static void backup(struct lexer *lexer)
{
lexer->pos--;
}
static unsigned char peek(struct lexer *lexer)
{
unsigned char chr = next(lexer);
backup(lexer);
return chr;
}
static void *lexer_string(struct lexer *lexer)
{
ignore(lexer);
while (true) {
unsigned char chr = next(lexer);
if (chr == '\0') {
emit(lexer, JSON_TOK_ERROR);
return NULL;
}
if (chr == '\\') {
switch (next(lexer)) {
case '"':
case '\\':
case '/':
case 'b':
case 'f':
case 'n':
case 'r':
case 't':
continue;
case 'u':
if (!isxdigit(next(lexer))) {
goto error;
}
if (!isxdigit(next(lexer))) {
goto error;
}
if (!isxdigit(next(lexer))) {
goto error;
}
if (!isxdigit(next(lexer))) {
goto error;
}
break;
default:
goto error;
}
}
if (chr == '"') {
backup(lexer);
emit(lexer, JSON_TOK_STRING);
next(lexer);
ignore(lexer);
return lexer_json;
}
}
error:
emit(lexer, JSON_TOK_ERROR);
return NULL;
}
static int accept_run(struct lexer *lexer, const char *run)
{
for (; *run; run++) {
if (next(lexer) != *run) {
return -EINVAL;
}
}
return 0;
}
static void *lexer_boolean(struct lexer *lexer)
{
backup(lexer);
switch (next(lexer)) {
case 't':
if (!accept_run(lexer, "rue")) {
emit(lexer, JSON_TOK_TRUE);
return lexer_json;
}
break;
case 'f':
if (!accept_run(lexer, "alse")) {
emit(lexer, JSON_TOK_FALSE);
return lexer_json;
}
break;
}
emit(lexer, JSON_TOK_ERROR);
return NULL;
}
static void *lexer_null(struct lexer *lexer)
{
if (accept_run(lexer, "ull") < 0) {
emit(lexer, JSON_TOK_ERROR);
return NULL;
}
emit(lexer, JSON_TOK_NULL);
return lexer_json;
}
static void *lexer_number(struct lexer *lexer)
{
while (true) {
unsigned char chr = next(lexer);
if (isdigit(chr) || chr == '.') {
continue;
}
backup(lexer);
emit(lexer, JSON_TOK_NUMBER);
return lexer_json;
}
}
static void *lexer_json(struct lexer *lexer)
{
while (true) {
unsigned char chr = next(lexer);
switch (chr) {
case '\0':
emit(lexer, JSON_TOK_EOF);
return NULL;
case '}':
case '{':
case '[':
case ']':
case ',':
case ':':
emit(lexer, (enum json_tokens)chr);
return lexer_json;
case '"':
return lexer_string;
case 'n':
return lexer_null;
case 't':
case 'f':
return lexer_boolean;
case '-':
if (isdigit(peek(lexer))) {
return lexer_number;
}
/* fallthrough */
default:
if (isspace(chr)) {
ignore(lexer);
continue;
}
if (isdigit(chr)) {
return lexer_number;
}
emit(lexer, JSON_TOK_ERROR);
return NULL;
}
}
}
static void lexer_init(struct lexer *lexer, char *data, size_t len)
{
lexer->state = lexer_json;
lexer->start = data;
lexer->pos = data;
lexer->end = data + len;
lexer->token.type = JSON_TOK_NONE;
}
static int obj_init(struct json_obj *json, char *data, size_t len)
{
struct token token;
lexer_init(&json->lexer, data, len);
if (!lexer_next(&json->lexer, &token)) {
return -EINVAL;
}
if (token.type != JSON_TOK_OBJECT_START) {
return -EINVAL;
}
return 0;
}
static int element_token(enum json_tokens token)
{
switch (token) {
case JSON_TOK_OBJECT_START:
case JSON_TOK_LIST_START:
case JSON_TOK_STRING:
case JSON_TOK_NUMBER:
case JSON_TOK_TRUE:
case JSON_TOK_FALSE:
return 0;
default:
return -EINVAL;
}
}
static int obj_next(struct json_obj *json,
struct json_obj_key_value *kv)
{
struct token token;
if (!lexer_next(&json->lexer, &token)) {
return -EINVAL;
}
/* Match end of object or next key */
switch (token.type) {
case JSON_TOK_OBJECT_END:
kv->key = NULL;
kv->key_len = 0;
kv->value = token;
return 0;
case JSON_TOK_COMMA:
if (!lexer_next(&json->lexer, &token)) {
return -EINVAL;
}
if (token.type != JSON_TOK_STRING) {
return -EINVAL;
}
/* fallthrough */
case JSON_TOK_STRING:
kv->key = token.start;
kv->key_len = (size_t)(token.end - token.start);
break;
default:
return -EINVAL;
}
/* Match : after key */
if (!lexer_next(&json->lexer, &token)) {
return -EINVAL;
}
if (token.type != JSON_TOK_COLON) {
return -EINVAL;
}
/* Match value */
if (!lexer_next(&json->lexer, &kv->value)) {
return -EINVAL;
}
return element_token(kv->value.type);
}
static int arr_next(struct json_obj *json, struct token *value)
{
if (!lexer_next(&json->lexer, value)) {
return -EINVAL;
}
if (value->type == JSON_TOK_LIST_END) {
return 0;
}
if (value->type == JSON_TOK_COMMA) {
if (!lexer_next(&json->lexer, value)) {
return -EINVAL;
}
}
return element_token(value->type);
}
static int decode_num(const struct token *token, s32_t *num)
{
/* FIXME: strtod() is not available in newlib/minimal libc,
* so using strtol() here.
*/
char *endptr;
char prev_end;
prev_end = *token->end;
*token->end = '\0';
errno = 0;
*num = strtol(token->start, &endptr, 10);
*token->end = prev_end;
if (errno != 0) {
return -errno;
}
if (endptr != token->end) {
return -EINVAL;
}
return 0;
}
static bool equivalent_types(enum json_tokens type1, enum json_tokens type2)
{
if (type1 == JSON_TOK_TRUE || type1 == JSON_TOK_FALSE) {
return type2 == JSON_TOK_TRUE || type2 == JSON_TOK_FALSE;
}
return type1 == type2;
}
static int obj_parse(struct json_obj *obj,
const struct json_obj_descr *descr, size_t descr_len,
void *val);
static int arr_parse(struct json_obj *obj,
const struct json_obj_descr *elem_descr,
size_t max_elements, void *field, void *val);
static int decode_value(struct json_obj *obj,
const struct json_obj_descr *descr,
struct token *value, void *field, void *val)
{
if (!equivalent_types(value->type, descr->type)) {
return -EINVAL;
}
switch (descr->type) {
case JSON_TOK_OBJECT_START:
return obj_parse(obj, descr->sub_descr,
descr->sub_descr_len,
field);
case JSON_TOK_LIST_START:
return arr_parse(obj, descr->element_descr,
descr->n_elements, field, val);
case JSON_TOK_FALSE:
case JSON_TOK_TRUE: {
bool *v = field;
*v = value->type == JSON_TOK_TRUE;
return 0;
}
case JSON_TOK_NUMBER: {
s32_t *num = field;
return decode_num(value, num);
}
case JSON_TOK_STRING: {
char **str = field;
*value->end = '\0';
*str = value->start;
return 0;
}
default:
return -EINVAL;
}
}
static ptrdiff_t get_elem_size(const struct json_obj_descr *descr)
{
switch (descr->type) {
case JSON_TOK_NUMBER:
return sizeof(s32_t);
case JSON_TOK_STRING:
return sizeof(char *);
case JSON_TOK_TRUE:
case JSON_TOK_FALSE:
return sizeof(bool);
case JSON_TOK_LIST_START:
return descr->n_elements * get_elem_size(descr->element_descr);
case JSON_TOK_OBJECT_START: {
ptrdiff_t total = 0;
size_t i;
for (i = 0; i < descr->sub_descr_len; i++) {
total += get_elem_size(&descr->sub_descr[i]);
}
return total;
}
default:
return -EINVAL;
}
}
static int arr_parse(struct json_obj *obj,
const struct json_obj_descr *elem_descr,
size_t max_elements, void *field, void *val)
{
ptrdiff_t elem_size = get_elem_size(elem_descr);
void *last_elem = (char *)field + elem_size * max_elements;
size_t *elements = (size_t *)((char *)val + elem_descr->offset);
struct token value;
assert(elem_size > 0);
*elements = 0;
while (!arr_next(obj, &value)) {
if (value.type == JSON_TOK_LIST_END) {
return 0;
}
if (decode_value(obj, elem_descr, &value, field, val) < 0) {
return -EINVAL;
}
(*elements)++;
field = (char *)field + elem_size;
if (field == last_elem) {
return -ENOSPC;
}
}
return -EINVAL;
}
static int obj_parse(struct json_obj *obj, const struct json_obj_descr *descr,
size_t descr_len, void *val)
{
struct json_obj_key_value kv;
s32_t decoded_fields = 0;
size_t i;
int ret;
while (!obj_next(obj, &kv)) {
if (kv.value.type == JSON_TOK_OBJECT_END) {
return decoded_fields;
}
for (i = 0; i < descr_len; i++) {
void *decode_field = (char *)val + descr[i].offset;
/* Field has been decoded already, skip */
if (decoded_fields & (1 << i)) {
continue;
}
/* Check if it's the i-th field */
if (kv.key_len != descr[i].field_name_len) {
continue;
}
if (memcmp(kv.key, descr[i].field_name,
descr[i].field_name_len)) {
continue;
}
/* Store the decoded value */
ret = decode_value(obj, &descr[i], &kv.value,
decode_field, val);
if (ret < 0) {
return ret;
}
decoded_fields |= 1<<i;
break;
}
}
return -EINVAL;
}
int json_obj_parse(char *payload, size_t len,
const struct json_obj_descr *descr, size_t descr_len,
void *val)
{
struct json_obj obj;
int ret;
assert(descr_len < (sizeof(ret) * CHAR_BIT - 1));
ret = obj_init(&obj, payload, len);
if (ret < 0) {
return ret;
}
return obj_parse(&obj, descr, descr_len, val);
}
static u8_t escape_as(u8_t chr)
{
switch (chr) {
case '"':
return '"';
case '\\':
return '\\';
case '\b':
return 'b';
case '\f':
return 'f';
case '\n':
return 'n';
case '\r':
return 'r';
case '\t':
return 't';
}
return 0;
}
static int json_escape_internal(const char *str,
json_append_bytes_t append_bytes,
void *data)
{
const char *cur;
int ret = 0;
for (cur = str; ret == 0 && *cur; cur++) {
u8_t escaped = escape_as(*cur);
if (escaped) {
u8_t bytes[2] = { '\\', escaped };
ret = append_bytes(bytes, 2, data);
} else {
ret = append_bytes(cur, 1, data);
}
}
return ret;
}
struct appender {
char *buffer;
size_t used;
size_t size;
};
static int append_bytes_to_buf(const u8_t *bytes, size_t len, void *data)
{
struct appender *appender = data;
if (len > appender->size - appender->used) {
return -ENOMEM;
}
memcpy(appender->buffer + appender->used, bytes, len);
appender->used += len;
appender->buffer[appender->used] = '\0';
return 0;
}
static int json_escape_buf(char *str, size_t *len, size_t buf_size)
{
char tmp_buf[buf_size + 1];
struct appender appender = { .buffer = tmp_buf, .size = buf_size };
int ret;
ret = json_escape_internal(str, append_bytes_to_buf, &appender);
if (ret < 0) {
return ret;
}
ret = append_bytes_to_buf("", 1, &appender);
if (!ret) {
memcpy(str, tmp_buf, appender.size);
if (len) {
*len = appender.size;
}
}
return ret;
}
size_t json_calc_escaped_len(const char *str, size_t len)
{
size_t escaped_len = len;
size_t pos;
for (pos = 0; pos < len; pos++) {
if (escape_as(str[pos])) {
escaped_len++;
}
}
return escaped_len;
}
ssize_t json_escape(char *str, size_t *len, size_t buf_size)
{
size_t escaped_len;
escaped_len = json_calc_escaped_len(str, *len);
if (escaped_len == *len) {
/* If no escape is necessary, don't bother using up temporary
* stack space to copy the string.
*/
return 0;
}
if (escaped_len >= buf_size) {
return -ENOMEM;
}
return json_escape_buf(str, len, escaped_len);
}
static int encode(const struct json_obj_descr *descr, const void *val,
json_append_bytes_t append_bytes, void *data);
static int arr_encode(const struct json_obj_descr *descr, const void *field,
const void *val, json_append_bytes_t append_bytes,
void *data)
{
struct json_obj_descr elem_descr = { .type = descr->type };
ptrdiff_t elem_size = get_elem_size(descr);
size_t n_elem = *(size_t *)((char *)val + descr->offset);
size_t i;
int ret;
ret = append_bytes("[", 1, data);
if (ret < 0) {
return ret;
}
for (i = 0; i < n_elem; i++) {
ret = encode(&elem_descr, field, append_bytes, data);
if (ret < 0) {
return ret;
}
if (i < n_elem - 1) {
ret = append_bytes(",", 1, data);
if (ret < 0) {
return ret;
}
}
field = (char *)field + elem_size;
}
return append_bytes("]", 1, data);
}
static int str_encode(const char **str, json_append_bytes_t append_bytes,
void *data)
{
int ret;
ret = append_bytes("\"", 1, data);
if (ret < 0) {
return ret;
}
ret = json_escape_internal(*str, append_bytes, data);
if (!ret) {
return append_bytes("\"", 1, data);
}
return ret;
}
static int num_encode(const s32_t *num, json_append_bytes_t append_bytes,
void *data)
{
char buf[3 * sizeof(s32_t)];
int ret;
ret = snprintk(buf, sizeof(buf), "%d", *num);
if (ret < 0) {
return ret;
}
if (ret >= (int)sizeof(buf)) {
return -ENOMEM;
}
return append_bytes(buf, (size_t)ret, data);
}
static int bool_encode(const bool *value, json_append_bytes_t append_bytes,
void *data)
{
if (*value) {
return append_bytes("true", 4, data);
}
return append_bytes("false", 5, data);
}
static int obj_encode(const struct json_obj_descr *descr, size_t descr_len,
const void *val, json_append_bytes_t append_bytes,
void *data);
static int encode(const struct json_obj_descr *descr, const void *val,
json_append_bytes_t append_bytes, void *data)
{
void *ptr = (char *)val + descr->offset;
switch (descr->type) {
case JSON_TOK_FALSE:
case JSON_TOK_TRUE:
return bool_encode(ptr, append_bytes, data);
case JSON_TOK_STRING:
return str_encode(ptr, append_bytes, data);
case JSON_TOK_LIST_START:
return arr_encode(descr->element_descr, ptr,
val, append_bytes, data);
case JSON_TOK_OBJECT_START:
return obj_encode(descr->sub_descr, descr->sub_descr_len,
ptr, append_bytes, data);
case JSON_TOK_NUMBER:
return num_encode(ptr, append_bytes, data);
default:
return -EINVAL;
}
}
static int obj_encode(const struct json_obj_descr *descr, size_t descr_len,
const void *val, json_append_bytes_t append_bytes,
void *data)
{
size_t i;
int ret;
ret = append_bytes("{", 1, data);
if (ret < 0) {
return ret;
}
for (i = 0; i < descr_len; i++) {
ret = str_encode((const char **)&descr[i].field_name,
append_bytes, data);
if (ret < 0) {
return ret;
}
ret = append_bytes(":", 1, data);
if (ret < 0) {
return ret;
}
ret = encode(&descr[i], val, append_bytes, data);
if (ret < 0) {
return ret;
}
if (i < descr_len - 1) {
ret = append_bytes(",", 1, data);
if (ret < 0) {
return ret;
}
}
}
return append_bytes("}", 1, data);
}
int json_obj_encode(const struct json_obj_descr *descr, size_t descr_len,
const void *val, json_append_bytes_t append_bytes,
void *data)
{
int ret;
ret = obj_encode(descr, descr_len, val, append_bytes, data);
if (ret < 0) {
return ret;
}
return append_bytes("", 1, data);
}
int json_obj_encode_buf(const struct json_obj_descr *descr, size_t descr_len,
const void *val, char *buffer, size_t buf_size)
{
struct appender appender = { .buffer = buffer, .size = buf_size };
return json_obj_encode(descr, descr_len, val, append_bytes_to_buf,
&appender);
}
static int measure_bytes(const u8_t *bytes, size_t len, void *data)
{
ssize_t *total = data;
*total += (ssize_t)len;
return 0;
}
ssize_t json_calc_encoded_len(const struct json_obj_descr *descr,
size_t descr_len, const void *val)
{
ssize_t total = 0;
int ret;
ret = json_obj_encode(descr, descr_len, val, measure_bytes, &total);
if (ret < 0) {
return ret;
}
return total;
}
|
{
"content_hash": "0a51e66581b325fde761a001d30517bb",
"timestamp": "",
"source": "github",
"line_count": 910,
"max_line_length": 78,
"avg_line_length": 18.334065934065933,
"alnum_prop": 0.615260129465356,
"repo_name": "bboozzoo/zephyr",
"id": "8b8eef06c176f25e02aeeca362eeb3aee939fdd7",
"size": "16772",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/json/json.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "321859"
},
{
"name": "C",
"bytes": "165999273"
},
{
"name": "C++",
"bytes": "2121423"
},
{
"name": "Lex",
"bytes": "11299"
},
{
"name": "Makefile",
"bytes": "176438"
},
{
"name": "Objective-C",
"bytes": "436925"
},
{
"name": "Perl",
"bytes": "269073"
},
{
"name": "Python",
"bytes": "169361"
},
{
"name": "Shell",
"bytes": "49573"
},
{
"name": "Verilog",
"bytes": "1449"
},
{
"name": "Yacc",
"bytes": "15396"
}
],
"symlink_target": ""
}
|
require_relative '../acceptance_helper'
feature 'User adds an answer',
%{
In order to help question starter
As a user
I want to answer the question
} do
context 'when logged in' do
background do
user = create(:user)
sign_in_with(user.email, user.password)
question = create(:question, user: user)
visit question_path(question)
end
context 'with valid body' do
context 'with AJAX' do
scenario 'adds answer', js: true do
within("#new-answer-form") do
fill_in 'answer_body', with: 'Это коварный вопрос. Это коварный вопрос. Это коварный вопрос.'
click_on 'Отправить ваш ответ'
end
expect(page).to have_content 'Ответ успешно создан.'
expect(page).to have_content 'Это коварный вопрос. Это коварный вопрос. Это коварный вопрос.'
end
end
context 'without AJAX' do
scenario 'adds answer' do
within("#new-answer-form") do
fill_in 'answer_body', with: 'Это коварный вопрос. Это коварный вопрос. Это коварный вопрос.'
click_on 'Отправить ваш ответ'
end
expect(page).to have_content 'Ответ успешно создан.'
expect(page).to have_content 'Это коварный вопрос. Это коварный вопрос. Это коварный вопрос.'
end
end
end
context 'with invalid body' do
context 'with AJAX' do
scenario "doesn't add answer", js: true do
fill_in 'answer_body', with: ''
within("#new-answer-form") do
click_on 'Отправить ваш ответ'
end
expect(page).to have_content 'Текст недостаточной длины'
end
end
context 'without AJAX' do
scenario "doesn't add answer" do
fill_in 'answer_body', with: ''
within("#new-answer-form") do
click_on 'Отправить ваш ответ'
end
expect(page).to have_content 'Текст недостаточной длины'
end
end
end
end
context 'when not logged in' do
scenario "can't answer question" do
question = create(:question)
visit question_path(question)
fill_in 'answer_body', with: 'Это коварный вопрос. Это коварный вопрос. Это коварный вопрос. Это коварный вопрос. Это коварный вопрос.'
within("#new-answer-form") do
click_on 'Отправить ваш ответ'
end
expect(page).to have_content 'Вам необходимо войти в систему или зарегистрироваться.'
end
end
end
|
{
"content_hash": "23493f78e7465868998d41374e997bd1",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 141,
"avg_line_length": 30.353658536585368,
"alnum_prop": 0.6159100040176778,
"repo_name": "leemour/underflow",
"id": "9a559e67af8642d2e70902e9cb967ae93059862d",
"size": "2992",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "spec/acceptance/add_answer_spec.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "8820"
},
{
"name": "CoffeeScript",
"bytes": "3151"
},
{
"name": "HTML",
"bytes": "54339"
},
{
"name": "JavaScript",
"bytes": "6739"
},
{
"name": "Ruby",
"bytes": "319843"
}
],
"symlink_target": ""
}
|
<div class="demo-container">
<h2>Hash <small class="text--secondary">Direct Match</small></h2>
<a href='#hash' id='hash-link'>Change Hash</a> |
<a href='#anotherHash' id='another-hash-link'>Change another Hash</a> |
<a href='#unregisteredHash' id='unregistered-hash-link'>unregistered Hash</a> |
<span id="currentHash"></span>
</div>
<div class="demo-container">
<h2>Hash <small class="text--secondary">Wild-Card Match</small></h2>
<a href='#wildcardHash/first' id='wildcard-hash-first'>wild card Hash 1</a> |
<a href='#wildcardHash/second' id='wildcard-hash-second'>wild card Hash 2</a> |
<span id="wildcardHash"></span>
</div>
<script>
function myHashCallback() {
document.getElementById('currentHash').innerHTML = 'Direct match: ' + location.hash;
}
function wildcardHashCallback() {
document.getElementById('wildcardHash').innerHTML = 'Wild card match: ' + location.hash;
}
skyComponents['hash-manager'].register(['hash', 'anotherHash'], myHashCallback);
skyComponents['hash-manager'].register(['wildcard/*'], wildcardHashCallback);
</script>
|
{
"content_hash": "011c6928ef3f5bb30b14a6e8e819a364",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 96,
"avg_line_length": 40.25,
"alnum_prop": 0.6708074534161491,
"repo_name": "skyglobal/hash-manager",
"id": "3b4178edca9ab12cbd3e0913d1281adafb5f42a0",
"size": "1128",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "demo/_includes/examples.html",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "CSS",
"bytes": "1065"
},
{
"name": "JavaScript",
"bytes": "47185"
}
],
"symlink_target": ""
}
|
<?php
class GoogleAuthenticationModule extends AuthenticationModule
{
private $siteid;
private $regHeadersLoaded = false;
private $adminHeaderShown = false;
private $remember;
public function __construct($siteid, $remember = true)
{
parent::__construct();
$this->siteid = $siteid;
// TODO Replace it with immediate GFC call:
// http://code.google.com/p/userbase/issues/detail?id=16
$this->remember = $remember;
}
public function getID()
{
return "google";
}
public function getLegendColor()
{
return "FF9900";
}
public function getTitle()
{
return "Other accounts using Google Friend Connect";
}
public function getUserCredentials($user)
{
$db = UserConfig::getDB();
$userid = $user->getID();
if ($stmt = $db->prepare('SELECT google_id FROM '.UserConfig::$mysql_prefix.'googlefriendconnect WHERE user_id = ?'))
{
if (!$stmt->bind_param('i', $userid))
{
throw new Exception("Can't bind parameter".$stmt->error);
}
if (!$stmt->execute())
{
throw new Exception("Can't execute statement: ".$stmt->error);
}
if (!$stmt->bind_result($google_id))
{
throw new Exception("Can't bind result: ".$stmt->error);
}
$google_ids = array();
while ($stmt->fetch() === TRUE) {
$google_ids[] = $google_id;
}
$stmt->close();
if (count($google_ids) > 0)
{
return new GoogleFriendConnectUserCredentials($this, $google_ids);
}
}
else
{
throw new Exception("Can't prepare statement: ".$db->error);
}
return null;
}
public function getTotalConnectedUsers()
{
$db = UserConfig::getDB();
$conns = 0;
if ($stmt = $db->prepare('SELECT COUNT(DISTINCT user_id) AS connst FROM '.UserConfig::$mysql_prefix.'googlefriendconnect'))
{
if (!$stmt->execute())
{
throw new Exception("Can't execute statement: ".$stmt->error);
}
if (!$stmt->bind_result($regs))
{
throw new Exception("Can't bind result: ".$stmt->error);
}
$stmt->fetch();
$stmt->close();
}
else
{
throw new Exception("Can't prepare statement: ".$db->error);
}
return $conns;
}
/*
* retrieves aggregated registrations numbers
*/
public function getDailyRegistrations()
{
$db = UserConfig::getDB();
$dailyregs = array();
if ($stmt = $db->prepare('SELECT regdate, count(*) AS reqs FROM (SELECT CAST(regtime AS DATE) AS regdate, id AS regs FROM '.UserConfig::$mysql_prefix.'users u LEFT JOIN '.UserConfig::$mysql_prefix.'googlefriendconnect g ON u.id = g.user_id WHERE g.google_id IS NOT NULL GROUP BY id) agg group by agg.regdate'))
{
if (!$stmt->execute())
{
throw new Exception("Can't execute statement: ".$stmt->error);
}
if (!$stmt->bind_result($regdate, $regs))
{
throw new Exception("Can't bind result: ".$stmt->error);
}
while($stmt->fetch() === TRUE)
{
$dailyregs[] = array('regdate' => $regdate, 'regs' => $regs);
}
$stmt->close();
}
else
{
throw new Exception("Can't prepare statement: ".$db->error);
}
return $dailyregs;
}
public function renderLoginForm($action)
{
?>
<script src="http://www.google.com/jsapi"></script>
<script src="http://www.google.com/friendconnect/script/friendconnect.js?key=notsupplied&v=0.8"></script>
<script>
google.setOnLoadCallback(function() {
google.friendconnect.container.loadOpenSocialApi({
site: '<?php echo $this->siteid?>',
onload: function(securityToken) {
if (!window.timesloaded) {
window.timesloaded = 1;
} else {
window.timesloaded++;
}
if (window.timesloaded > 1) {
document.googleloginform.submit();
}
}
});
});
</script>
<p>Sign in using your <b>OpenID</b> or an existing account with <b>Google</b>, <b>Twitter</b>, <b>Yahoo!</b> and more.</p>
<a href="#" onclick="google.friendconnect.requestSignIn(function() {document.googleloginform.submit()}); return false;"><span style="background-image: url(<?php echo UserConfig::$USERSROOTURL ?>/modules/google/google-sprite.png); background-position: 0px 0px; width: 152px; height: 21px; display: block; cursor: hand;" title="Log in using existing account via Gogle Friend Connect"></span></a>
<form action="<?php echo $action?>" method="POST" name="googleloginform">
<input type="hidden" name="login" value="Login >>>"/>
</form>
<?php
}
public function renderRegistrationForm($full = false, $action = null, $errors = null , $data = null)
{
if (is_null($action))
{
$action = UserConfig::$USERSROOTURL.'/register.php?module='.$this->getID();
}
if (!$this->regHeadersLoaded)
{
?>
<script src="http://www.google.com/jsapi"></script>
<script src="http://www.google.com/friendconnect/script/friendconnect.js?key=notsupplied&v=0.8"></script>
<script>
google.setOnLoadCallback(function() {
google.friendconnect.container.loadOpenSocialApi({
site: '<?php echo $this->siteid?>',
onload: function(securityToken) {
if (!window.timesloaded) {
window.timesloaded = 1;
} else {
window.timesloaded++;
}
if (window.timesloaded > 1) {
document.googleregform.submit();
}
}
});
});
</script>
<form action="<?php echo $action?>" method="POST" name="googleregform">
<input type="hidden" name="register" value="Register >>>"/>
</form>
<?php
$this->regHeadersLoaded = true;
}
if ($full)
{
?>
<p>Sign un using your <b>OpenID</b> or an existing account with <b>Google</b>, <b>Twitter</b>, <b>Yahoo!</b> and more.</p>
<?php
}
?>
<a href="#" onclick="google.friendconnect.requestSignIn(); return false;"><span style="background-image: url(<?php echo UserConfig::$USERSROOTURL ?>/modules/google/google-sprite.png); background-position: 0px -42px; width: 200px; height: 21px; display: block; cursor: hand;" title="Quick Sign up using existing account via Google Friend Connect"></span></a>
<?php
}
/*
* Renders user editing form
*
* Parameters:
* $action - form action to post back to
* $errors - error messages to display
* $user - user object for current user that is being edited
* $data - data submitted to the form
*/
public function renderEditUserForm($action, $errors, $user, $data)
{
$associations = $user->getGoogleFriendsConnectAssociations();
?>
<form action="<?php echo $action?>" method="POST">
<input type="hidden" name="save"value ="save"/>
<?php
foreach ($associations as $association)
{
?><div style="float: left; margin-right: 1em">
<img src="<?php echo $association['userpic']?>"/><br/>
<input type="submit" name="remove[<?php echo $association['google_id']?>]" value="remove" style="font-size: xx-small"/>
</div><?php
}
?>
</form>
<div style="clear: both"></div>
<script src="http://www.google.com/jsapi"></script>
<script src="http://www.google.com/friendconnect/script/friendconnect.js?key=notsupplied&v=0.8"></script>
<script>
google.setOnLoadCallback(function() {
google.friendconnect.container.loadOpenSocialApi({
site: '<?php echo $this->siteid?>',
onload: function(securityToken) {
if (!window.timesloaded) {
window.timesloaded = 1;
} else {
window.timesloaded++;
}
if (window.timesloaded > 1) {
document.googleeditform.submit();
}
}
});
});
</script>
<p>Connect to your <b>OpenID</b> or existing account with <b>Google</b>, <b>Twitter</b>, <b>Yahoo!</b> and more.</p>
<a href="#" onclick="google.friendconnect.requestSignIn(function() {document.googleeditform.submit()}); return false;"><span style="background-image: url(<?php echo UserConfig::$USERSROOTURL ?>/modules/google/google-sprite.png); background-position: 0px -21px; width: 218px; height: 21px; display: block; cursor: hand;" title="Connect to another account via Google Friend Connect"></span></a>
<form action="<?php echo $action?>" method="POST" name="googleeditform">
<input type="hidden" name="save" value="Save >>>"/>
</form>
<?php
}
public function processLogin($data, &$remember)
{
$remember = $this->remember;
$fcauth = $_COOKIE['fcauth'.$this->siteid];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/friendconnect/api/people/@viewer/@self?fcauth='.urlencode($fcauth));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
if (!is_null($data) &&
array_key_exists('entry', $data) &&
array_key_exists('id', $data['entry']))
{
$user = User::getUserByGoogleFriendConnectID($data['entry']['id']);
if (!is_null($user)) {
$user->recordActivity(USERBASE_ACTIVITY_LOGIN_GFC);
return $user;
} else {
return $this->processRegistration($data, $remember);
}
} else {
return false;
}
}
public function processRegistration($data, &$remember)
{
$remember = $this->remember;
$fcauth = $_COOKIE['fcauth'.$this->siteid];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/friendconnect/api/people/@viewer/@self?fcauth='.urlencode($fcauth));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
$googleid = null;
$displayName = null;
$thumbnailUrl = null;
if (!is_null($data) &&
array_key_exists('entry', $data) &&
array_key_exists('id', $data['entry']))
{
$googleid = $data['entry']['id'];
$displayName = $data['entry']['displayName'];
$thumbnailUrl = $data['entry']['thumbnailUrl'];
}
$errors = array();
if (is_null($googleid))
{
$errors['googleid'][] = 'No Google Friend Connect user id is passed';
throw new InputValidationException('No Google Friend Connect user id', 0, $errors);
}
$existing_user = User::getUserByGoogleFriendConnectID($googleid);
if (!is_null($existing_user))
{
$existing_user->recordActivity(USERBASE_ACTIVITY_LOGIN_GFC);
return $existing_user;
}
if (is_null($displayName))
{
$errors['username'][] = "User doesn't have display name";
}
if (count($errors) > 0)
{
throw new ExistingUserException('User already exists', 0, $errors);
}
// ok, let's create a user
$user = User::createNewGoogleFriendConnectUser($displayName, $googleid, $thumbnailUrl);
$user->recordActivity(USERBASE_ACTIVITY_REGISTER_GFC);
return $user;
}
/*
* Updates user information
*
* returns true if successful and false if unsuccessful
*
* throws InputValidationException if there are problems with input data
*/
public function processEditUser($user, $data)
{
// if remove, then save stores id to remove
if (array_key_exists('remove', $data))
{
$keys = array_keys($data['remove']);
if (count($keys) > 0) {
$user->removeGoogleFriendConnectAssociation($keys[0]);
}
}
else
{
$fcauth = $_COOKIE['fcauth'.$this->siteid];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/friendconnect/api/people/@viewer/@self?fcauth='.urlencode($fcauth));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);
$googleid = null;
$displayName = null;
$thumbnailUrl = null;
if (!is_null($data) &&
array_key_exists('entry', $data) &&
array_key_exists('id', $data['entry']))
{
$googleid = $data['entry']['id'];
$displayName = $data['entry']['displayName'];
$thumbnailUrl = $data['entry']['thumbnailUrl'];
}
if (is_null($googleid))
{
$errors['googleid'][] = 'No Google Friend Connect user id is passed';
throw new InputValidationException('No Google Friend Connect user id', 0, $errors);
}
$user->addGoogleFriendConnectAssociation($googleid, $thumbnailUrl);
}
return true;
}
public function getAdminHeaderHTML() {
$html = '';
if (!$this->adminHeaderShown) {
$html .= '
<script src="http://www.google.com/jsapi"></script>
<script src="http://www.google.com/friendconnect/script/friendconnect.js?key=notsupplied&v=0.8"></script>
<script>
google.setOnLoadCallback(function() {
google.friendconnect.container.loadOpenSocialApi({
site: \''.$this->siteid.'\',
onload: function(securityToken) {
if (!window.timesloaded) {
window.timesloaded = 1;
} else {
window.timesloaded++;
}
if (window.timesloaded > 1) {
document.googleloginform.submit();
}
}
});
});
</script>';
$this->adminHeaderShown = true;
}
return $html;
}
}
class GoogleFriendConnectUserCredentials extends UserCredentials {
// A list of Google Friend Connect IDs
private $google_ids;
private $module;
public function __construct($module, $google_ids) {
$this->module = $module;
$this->google_ids = $google_ids;
}
public function getUserIDs() {
return $this->google_ids;
}
public function getHTML() {
$html = $this->module->getAdminHeaderHTML();
$first = true;
foreach ($this->google_ids as $google_id) {
if ($first) {
$first = false;
} else {
$html .= ', ';
}
$html .= "<a href=\"#\" onclick=\"google.friendconnect.showMemberProfile('$google_id'); return false;\">$google_id</a>";
}
return $html;
}
}
|
{
"content_hash": "adec677954a5440beef3afb433e56fd4",
"timestamp": "",
"source": "github",
"line_count": 478,
"max_line_length": 395,
"avg_line_length": 27.468619246861923,
"alnum_prop": 0.6428789032749429,
"repo_name": "russelldavis/UserBase",
"id": "f4a437ff2fc8df62c9d3290fdbaff964b5142a99",
"size": "13130",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/google/index.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2780"
},
{
"name": "PHP",
"bytes": "285405"
}
],
"symlink_target": ""
}
|
package com.coveo.blitz.reference;
import java.io.InputStream;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
public class Utils
{
public static Map<String, String> dimensionsToMap(Set<DimensionValue> dimensions)
{
return dimensions.stream().collect(Collectors.toMap(DimensionValue::getDimension, DimensionValue::getValue));
}
public static Map<String, Long> metricsToMap(Set<MetricValue> metrics)
{
return metrics.stream().collect(Collectors.toMap(MetricValue::getMetric, MetricValue::getValue));
}
public static Path getPath(String fileName)
{
try {
return Paths.get(ClassLoader.getSystemResource(fileName).toURI());
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
public static InputStream getResourceStream(String fileName)
{
return ClassLoader.getSystemResourceAsStream(fileName);
}
}
|
{
"content_hash": "655e22ed48f6c7b879433ee3cbf1f90f",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 117,
"avg_line_length": 28.775,
"alnum_prop": 0.7193744569939183,
"repo_name": "Coveo/Blitz-2015",
"id": "00cb7ce6e05d9001387b73aee2942fd5772be66a",
"size": "1151",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "AwesomeService/coveo-blitz-reference/src/main/java/com/coveo/blitz/reference/Utils.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "49901"
},
{
"name": "C++",
"bytes": "83516"
},
{
"name": "Go",
"bytes": "59472"
},
{
"name": "Java",
"bytes": "241682"
},
{
"name": "JavaScript",
"bytes": "60882"
},
{
"name": "Python",
"bytes": "54512"
},
{
"name": "Ruby",
"bytes": "8098"
},
{
"name": "Shell",
"bytes": "782"
},
{
"name": "Thrift",
"bytes": "2859"
}
],
"symlink_target": ""
}
|
#define _FUDGEMSGIMPL_DEFINED 1
#include "fudge/message.h"
#include "fudge/platform.h"
#include "fudge/string.h"
#include "memory_internal.h"
#include "message_internal.h"
#include "fudge/header.h"
#include "reference.h"
#include "registry_internal.h"
#include <assert.h>
void FudgeField_destroy ( FudgeField * fld )
{
assert ( fld );
switch ( fld->type )
{
/* Fudge message type: free the message pointer */
case FUDGE_TYPE_FUDGE_MSG:
if ( fld->data.message )
FudgeMsg_release ( fld->data.message );
break;
/* Fudge string type: free the string pointer */
case FUDGE_TYPE_STRING:
if ( fld->data.string )
FudgeString_release ( fld->data.string );
break;
/* Primitive type: nothing needs freeing */
case FUDGE_TYPE_INDICATOR:
case FUDGE_TYPE_BOOLEAN:
case FUDGE_TYPE_BYTE:
case FUDGE_TYPE_SHORT:
case FUDGE_TYPE_INT:
case FUDGE_TYPE_LONG:
case FUDGE_TYPE_FLOAT:
case FUDGE_TYPE_DOUBLE:
case FUDGE_TYPE_DATE:
case FUDGE_TYPE_TIME:
case FUDGE_TYPE_DATETIME:
break;
/* Every other type will store its data in the bytes array */
default:
FUDGEMEMORY_FREE( ( fudge_byte * ) fld->data.bytes );
break;
}
if ( fld->name )
FudgeString_release ( fld->name );
}
typedef struct FieldVector
{
FudgeField * fields;
size_t capacity,
top;
} FieldVector;
FudgeStatus FieldVector_init ( FieldVector * vec, size_t initialcap )
{
if ( ! vec ) return FUDGE_NULL_POINTER;
vec->capacity = initialcap > 0u ? initialcap : 1u;;
vec->top = 0u;
if ( ! ( vec->fields = FUDGEMEMORY_MALLOC( FudgeField *,
sizeof ( FudgeField ) * vec->capacity ) ) )
return FUDGE_OUT_OF_MEMORY;
return FUDGE_OK;
}
FudgeStatus FieldVector_grow ( FieldVector * vec, size_t size )
{
FudgeField * newflds;
size_t newcap;
if ( size < vec->capacity )
return FUDGE_OK;
if ( ( newcap = vec->capacity * 2 ) <= size )
newcap = size + 1;
if ( ! ( newflds = FUDGEMEMORY_REALLOC( FudgeField *,
vec->fields,
sizeof ( FudgeField ) * newcap ) ) )
return FUDGE_OUT_OF_MEMORY;
vec->fields = newflds;
vec->capacity = newcap;
return FUDGE_OK;
}
FudgeStatus FieldVector_append ( FieldVector * vec, FudgeField * fld )
{
size_t newtop;
FudgeStatus status;
if ( ! ( vec && fld ) ) return FUDGE_NULL_POINTER;
if ( ( newtop = vec->top + 1 ) >= vec->capacity )
if ( (status = FieldVector_grow ( vec, newtop + 1 ) ) )
return status;
vec->fields [ vec->top ] = *fld;
vec->top = newtop;
return FUDGE_OK;
}
void FieldVector_destroy ( FieldVector * vec )
{
size_t idx;
assert ( vec && vec->fields );
for ( idx = 0u; idx < vec->top; ++idx )
FudgeField_destroy ( &( vec->fields [ idx ] ) );
FUDGEMEMORY_FREE( vec->fields );
}
struct FudgeMsgImpl
{
FudgeRefCount refcount;
FieldVector fields;
fudge_i32 width;
};
FudgeStatus FudgeMsg_addFieldData ( FudgeMsg message,
fudge_type_id type,
const FudgeString name,
const fudge_i16 * ordinal,
FudgeFieldData * data,
fudge_i32 numbytes )
{
FudgeStatus status;
FudgeField field;
const FudgeTypeDesc * typedesc = FudgeRegistry_getTypeDesc ( type );
if ( ! ( message && data ) )
return FUDGE_NULL_POINTER;
/* Adding a field will invalidate the message's width */
message->width = -1;
/* Initialise the new new */
field.type = type;
field.numbytes = numbytes;
field.flags = 0;
/* Copy across the data */
if ( typedesc->payload == FUDGE_TYPE_PAYLOAD_SUBMSG && ! data->message )
return FUDGE_NULL_POINTER;
else if ( typedesc->payload == FUDGE_TYPE_PAYLOAD_STRING && ! data->string )
return FUDGE_NULL_POINTER;
field.data = *data;
/* Set the field name (if required) */
if ( name )
{
/* Names may not have a length greater than 255 bytes (only one byte is
available for their length) */
if ( FudgeString_getSize ( name ) >= 256 )
return FUDGE_NAME_TOO_LONG;
if ( ( status = FudgeString_retain ( name ) ) != FUDGE_OK )
return status;
field.name = name;
field.flags |= FUDGE_FIELD_HAS_NAME;
}
else
field.name = 0;
/* Set the field ordinal (if required) */
if ( ordinal )
{
field.ordinal = *ordinal;
field.flags |= FUDGE_FIELD_HAS_ORDINAL;
}
else
field.ordinal = 0;
/* Append the node to the message's list */
if ( ( status = FieldVector_append ( &message->fields, &field ) ) )
{
FudgeField_destroy ( &field );
return status;
}
return FUDGE_OK;
}
FudgeStatus FudgeMsg_create ( FudgeMsg * messageptr )
{
FudgeStatus status;
if ( ! ( *messageptr = FUDGEMEMORY_MALLOC( FudgeMsg, sizeof ( struct FudgeMsgImpl ) ) ) )
return FUDGE_OUT_OF_MEMORY;
if ( ( status = FudgeRefCount_create ( &( ( *messageptr )->refcount ) ) ) )
goto release_message_and_fail;
if ( ( status = FieldVector_init ( &( *messageptr )->fields, 16 ) ) )
goto release_message_and_fail;
( *messageptr )->width = -1;
return FUDGE_OK;
release_message_and_fail:
FUDGEMEMORY_FREE( *messageptr );
return status;
}
FudgeStatus FudgeMsg_retain ( FudgeMsg message )
{
if ( ! message )
return FUDGE_NULL_POINTER;
FudgeRefCount_increment ( message->refcount );
return FUDGE_OK;
}
FudgeStatus FudgeMsg_release ( FudgeMsg message )
{
if ( ! message )
return FUDGE_NULL_POINTER;
if ( ! FudgeRefCount_decrementAndReturn ( message->refcount ) )
{
/* Last reference has been released - destroy the message and all of its fields */
FudgeStatus status;
if ( ( status = FudgeRefCount_destroy ( message->refcount ) ) != FUDGE_OK )
return status;
FieldVector_destroy ( &message->fields );
FUDGEMEMORY_FREE( message );
}
return FUDGE_OK;
}
unsigned long FudgeMsg_numFields ( FudgeMsg message )
{
return message ? message->fields.top : 0lu;
}
FudgeStatus FudgeMsg_addFieldIndicator ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal )
{
FudgeFieldData data;
if ( ! message )
return FUDGE_NULL_POINTER;
return FudgeMsg_addFieldData ( message, FUDGE_TYPE_INDICATOR, name, ordinal, &data, 0 );
}
fudge_type_id FudgeMsg_pickIntegerType ( const fudge_type_id type, const fudge_i64 value )
{
if ( type == FUDGE_TYPE_BYTE || ( value <= INT8_MAX && value >= INT8_MIN ) )
return FUDGE_TYPE_BYTE;
if ( type == FUDGE_TYPE_SHORT || ( value <= INT16_MAX && value >= INT16_MIN ) )
return FUDGE_TYPE_SHORT;
if ( type == FUDGE_TYPE_INT || ( value <= INT32_MAX && value >= INT32_MIN ) )
return FUDGE_TYPE_INT;
return FUDGE_TYPE_LONG;
}
FudgeStatus FudgeMsg_addFieldInteger ( FudgeMsg message,
const FudgeString name,
const fudge_i16 * ordinal,
fudge_type_id type,
const fudge_i64 value )
{
FudgeFieldData data;
if ( ! message )
return FUDGE_NULL_POINTER;
switch ( ( type = FudgeMsg_pickIntegerType ( type, value ) ) )
{
case FUDGE_TYPE_LONG: data.i64 = value; break;
case FUDGE_TYPE_INT: data.i32 = ( fudge_i32 ) value; break;
case FUDGE_TYPE_SHORT: data.i16 = ( fudge_i16 ) value; break;
case FUDGE_TYPE_BYTE: data.byte = ( fudge_byte ) value; break;
default:
return FUDGE_INTERNAL_PAYLOAD;
}
return FudgeMsg_addFieldData ( message, type, name, ordinal, &data, 0 );
}
#define FUDGE_ADDINTEGERFIELD_IMPL( typename, type, typeid ) \
FudgeStatus FudgeMsg_addField##typename ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal, type value ) \
{ \
return FudgeMsg_addFieldInteger ( message, name, ordinal, typeid, ( fudge_i64 ) value ); \
}
FUDGE_ADDINTEGERFIELD_IMPL( I16, fudge_i16, FUDGE_TYPE_SHORT )
FUDGE_ADDINTEGERFIELD_IMPL( I32, fudge_i32, FUDGE_TYPE_INT )
FUDGE_ADDINTEGERFIELD_IMPL( I64, fudge_i64, FUDGE_TYPE_LONG )
#define FUDGE_ADDPRIMITIVEFIELD_IMPL( typename, type, typeid, bucket ) \
FudgeStatus FudgeMsg_addField##typename ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal, type value ) \
{ \
FudgeFieldData data; \
\
if ( ! message ) \
return FUDGE_NULL_POINTER; \
data . bucket = value; \
return FudgeMsg_addFieldData ( message, typeid, name, ordinal, &data, 0 ); \
}
FUDGE_ADDPRIMITIVEFIELD_IMPL( Byte, fudge_byte, FUDGE_TYPE_BYTE, byte )
FUDGE_ADDPRIMITIVEFIELD_IMPL( Bool, fudge_bool, FUDGE_TYPE_BOOLEAN, boolean )
FUDGE_ADDPRIMITIVEFIELD_IMPL( F32, fudge_f32, FUDGE_TYPE_FLOAT, f32 )
FUDGE_ADDPRIMITIVEFIELD_IMPL( F64, fudge_f64, FUDGE_TYPE_DOUBLE, f64 )
FudgeStatus FudgeMsg_addFieldMsg ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal, FudgeMsg value )
{
FudgeStatus status;
FudgeFieldData data;
if ( ! ( message && value ) )
return FUDGE_NULL_POINTER;
if ( ( status = FudgeMsg_retain ( value ) ) != FUDGE_OK )
return status;
data.message = value;
if ( ( status = FudgeMsg_addFieldData ( message, FUDGE_TYPE_FUDGE_MSG, name, ordinal, &data, 0 ) ) != FUDGE_OK )
{
FudgeMsg_release ( value );
return status;
}
return FUDGE_OK;
}
FudgeStatus FudgeMsg_addFieldOpaque ( FudgeMsg message,
fudge_type_id type,
const FudgeString name,
const fudge_i16 * ordinal,
const fudge_byte * bytes,
fudge_i32 numbytes )
{
FudgeStatus status;
FudgeFieldData data;
if ( ( ! message ) || ( ! bytes && numbytes ) )
return FUDGE_NULL_POINTER;
if ( numbytes )
{
if ( ! ( data.bytes = FUDGEMEMORY_MALLOC( fudge_byte *, numbytes ) ) )
return FUDGE_OUT_OF_MEMORY;
memcpy ( ( fudge_byte * ) data.bytes, bytes, numbytes );
}
else
data.bytes = 0;
if ( ( status = FudgeMsg_addFieldData ( message, type, name, ordinal, &data, numbytes ) ) != FUDGE_OK )
FUDGEMEMORY_FREE( ( fudge_byte * ) data.bytes );
return status;
}
#define FUDGE_ADDARRAYFIELD_IMPL( typename, type, typeid ) \
FudgeStatus FudgeMsg_addField##typename##Array ( FudgeMsg message, \
const FudgeString name, \
const fudge_i16 * ordinal, \
const type * elements, \
fudge_i32 numelements ) \
{ \
fudge_i32 maxelements = 0x7FFFFFFF / sizeof ( type ); \
if ( numelements > maxelements ) \
return FUDGE_PAYLOAD_TOO_LONG; \
return FudgeMsg_addFieldOpaque ( message, typeid, name, ordinal, \
( const fudge_byte * ) elements, sizeof ( type ) * numelements ); \
}
FUDGE_ADDARRAYFIELD_IMPL( Byte, fudge_byte, FUDGE_TYPE_BYTE_ARRAY )
FUDGE_ADDARRAYFIELD_IMPL( I16, fudge_i16, FUDGE_TYPE_SHORT_ARRAY )
FUDGE_ADDARRAYFIELD_IMPL( I32, fudge_i32, FUDGE_TYPE_INT_ARRAY )
FUDGE_ADDARRAYFIELD_IMPL( I64, fudge_i64, FUDGE_TYPE_LONG_ARRAY )
FUDGE_ADDARRAYFIELD_IMPL( F32, fudge_f32, FUDGE_TYPE_FLOAT_ARRAY )
FUDGE_ADDARRAYFIELD_IMPL( F64, fudge_f64, FUDGE_TYPE_DOUBLE_ARRAY )
FudgeStatus FudgeMsg_addFieldString ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal, FudgeString string )
{
FudgeStatus status;
FudgeFieldData data;
size_t stringbytes;
if ( ! ( message && string ) )
return FUDGE_NULL_POINTER;
stringbytes = FudgeString_getSize ( string );
if ( stringbytes > 0x7FFFFFFF )
return FUDGE_PAYLOAD_TOO_LONG;
if ( ( status = FudgeString_retain ( string ) ) != FUDGE_OK )
return status;
data.string = string;
if ( ( status = FudgeMsg_addFieldData ( message, FUDGE_TYPE_STRING, name, ordinal, &data, ( fudge_i32 ) stringbytes ) ) != FUDGE_OK )
FudgeString_release ( string );
return status;
}
#define FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( size, typeid ) \
FudgeStatus FudgeMsg_addField##size##ByteArray ( FudgeMsg message, \
const FudgeString name, \
const fudge_i16 * ordinal, \
const fudge_byte * bytes ) \
{ \
return FudgeMsg_addFieldOpaque ( message, typeid, name, ordinal, bytes, size ); \
}
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 4, FUDGE_TYPE_BYTE_ARRAY_4 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 8, FUDGE_TYPE_BYTE_ARRAY_8 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 16, FUDGE_TYPE_BYTE_ARRAY_16 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 20, FUDGE_TYPE_BYTE_ARRAY_20 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 32, FUDGE_TYPE_BYTE_ARRAY_32 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 64, FUDGE_TYPE_BYTE_ARRAY_64 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 128, FUDGE_TYPE_BYTE_ARRAY_128 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 256, FUDGE_TYPE_BYTE_ARRAY_256 )
FUDGE_ADDFIXEDBYTEARRAYFIELD_IMPL( 512, FUDGE_TYPE_BYTE_ARRAY_512 )
FudgeStatus FudgeMsg_addFieldDate ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal, const FudgeDate * date )
{
FudgeFieldData data;
if ( ! ( message && date ) )
return FUDGE_NULL_POINTER;
data.datetime.date = *date;
return FudgeMsg_addFieldData ( message, FUDGE_TYPE_DATE, name, ordinal, &data, 0 );
return FUDGE_OK;
}
FudgeStatus FudgeMsg_addFieldTime ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal, const FudgeTime * time )
{
FudgeFieldData data;
if ( ! ( message && time ) )
return FUDGE_NULL_POINTER;
data.datetime.time = *time;
return FudgeMsg_addFieldData ( message, FUDGE_TYPE_TIME, name, ordinal, &data, 0 );
}
FudgeStatus FudgeMsg_addFieldDateTime ( FudgeMsg message, const FudgeString name, const fudge_i16 * ordinal, const FudgeDateTime * datetime )
{
FudgeFieldData data;
if ( ! ( message && datetime ) )
return FUDGE_NULL_POINTER;
data.datetime = *datetime;
return FudgeMsg_addFieldData ( message, FUDGE_TYPE_DATETIME, name, ordinal, &data, 0 );
}
FudgeStatus FudgeMsg_getFieldAtIndex ( FudgeField * field, const FudgeMsg message, unsigned long index )
{
if ( ! ( message && field ) )
return FUDGE_NULL_POINTER;
if ( index >= message->fields.top )
return FUDGE_INVALID_INDEX;
*field = message->fields.fields [ index ];
return FUDGE_OK;
}
FudgeStatus FudgeMsg_getFieldByName ( FudgeField * field, const FudgeMsg message, const FudgeString name )
{
size_t idx;
if ( ! ( message && field && name ) )
return FUDGE_NULL_POINTER;
for ( idx = 0u; idx < message->fields.top; ++idx )
if ( FudgeString_compare ( message->fields.fields [ idx ].name, name ) == 0 )
{
*field = message->fields.fields [ idx ];
return FUDGE_OK;
}
return FUDGE_INVALID_NAME;
}
FudgeStatus FudgeMsg_getFieldByOrdinal ( FudgeField * field, const FudgeMsg message, fudge_i16 ordinal )
{
size_t idx;
if ( ! ( message && field ) )
return FUDGE_NULL_POINTER;
for ( idx = 0u; idx < message->fields.top; ++idx )
if ( message->fields.fields [ idx ].flags & FUDGE_FIELD_HAS_ORDINAL
&& message->fields.fields [ idx ].ordinal == ordinal )
{
*field = message->fields.fields [ idx ];
return FUDGE_OK;
}
return FUDGE_INVALID_ORDINAL;
}
fudge_i32 FudgeMsg_getFields ( FudgeField * fields, fudge_i32 numfields, const FudgeMsg message )
{
if ( ! ( fields && message && numfields >= 0 ) )
return -1;
if ( numfields > ( fudge_i32 ) message->fields.top )
numfields = message->fields.top;
memcpy ( fields, message->fields.fields, numfields * sizeof ( FudgeField ) );
return numfields;
}
FudgeStatus FudgeMsg_setWidth ( FudgeMsg message, fudge_i32 width )
{
if ( ! message )
return FUDGE_NULL_POINTER;
message->width = width;
return FUDGE_OK;
}
fudge_i32 FudgeMsg_getWidth ( const FudgeMsg message )
{
return message ? message->width : -1;
}
|
{
"content_hash": "668d5d217a8ec3e76cd894d4b4e46d0f",
"timestamp": "",
"source": "github",
"line_count": 524,
"max_line_length": 141,
"avg_line_length": 36.31297709923664,
"alnum_prop": 0.535999579566954,
"repo_name": "vrai/Fudge-C",
"id": "4c1f4101d29d8e7433751e9e214cb533ba2079c2",
"size": "19636",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/message.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "451841"
},
{
"name": "Objective-C",
"bytes": "8087"
},
{
"name": "Python",
"bytes": "5495"
},
{
"name": "Shell",
"bytes": "315"
}
],
"symlink_target": ""
}
|
<?php
namespace TYPO3\CMS\Core\Resource\Index;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\ResourceStorage;
use TYPO3\CMS\Core\Type\File\ImageInfo;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* The New FAL Indexer
*/
class Indexer
{
/**
* @var array
*/
protected $filesToUpdate = [];
/**
* @var int[]
*/
protected $identifiedFileUids = [];
/**
* @var ResourceStorage
*/
protected $storage = null;
/**
* @var ExtractorInterface[]
*/
protected $extractionServices = null;
/**
* @param ResourceStorage $storage
*/
public function __construct(ResourceStorage $storage)
{
$this->storage = $storage;
}
/**
* Create index entry
*
* @param string $identifier
* @return File
* @throws \InvalidArgumentException
*/
public function createIndexEntry($identifier)
{
if (!isset($identifier) || !is_string($identifier) || $identifier === '') {
throw new \InvalidArgumentException('Invalid file identifier given. It must be of type string and not empty. "' . gettype($identifier) . '" given.', 1401732565);
}
$fileProperties = $this->gatherFileInformationArray($identifier);
$record = $this->getFileIndexRepository()->addRaw($fileProperties);
$fileObject = $this->getResourceFactory()->getFileObject($record['uid'], $record);
$this->extractRequiredMetaData($fileObject);
return $fileObject;
}
/**
* Update index entry
*
* @param File $fileObject
* @return void
*/
public function updateIndexEntry(File $fileObject)
{
$updatedInformation = $this->gatherFileInformationArray($fileObject->getIdentifier());
$fileObject->updateProperties($updatedInformation);
$this->getFileIndexRepository()->update($fileObject);
$this->extractRequiredMetaData($fileObject);
}
/**
* @return void
*/
public function processChangesInStorages()
{
// get all file-identifiers from the storage
$availableFiles = $this->storage->getFileIdentifiersInFolder($this->storage->getRootLevelFolder(false)->getIdentifier(), true, true);
$this->detectChangedFilesInStorage($availableFiles);
$this->processChangedAndNewFiles();
$this->detectMissingFiles();
}
/**
* @param int $maximumFileCount
* @return void
*/
public function runMetaDataExtraction($maximumFileCount = -1)
{
$fileIndexRecords = $this->getFileIndexRepository()->findInStorageWithIndexOutstanding($this->storage, $maximumFileCount);
foreach ($fileIndexRecords as $indexRecord) {
$fileObject = $this->getResourceFactory()->getFileObject($indexRecord['uid'], $indexRecord);
$this->extractMetaData($fileObject);
}
}
/**
* Extract metadata for given fileObject
*
* @param File $fileObject
*/
public function extractMetaData(File $fileObject)
{
$newMetaData = [
0 => $fileObject->_getMetaData()
];
// Loop through available extractors and fetch metadata for the given file.
foreach ($this->getExtractionServices() as $service) {
if ($this->isFileTypeSupportedByExtractor($fileObject, $service) && $service->canProcess($fileObject)) {
$newMetaData[$service->getPriority()] = $service->extractMetaData($fileObject, $newMetaData);
}
}
// Sort metadata by priority so that merging happens in order of precedence.
ksort($newMetaData);
// Merge the collected metadata.
$metaData = [];
foreach ($newMetaData as $data) {
$metaData = array_merge($metaData, $data);
}
$fileObject->_updateMetaDataProperties($metaData);
$this->getMetaDataRepository()->update($fileObject->getUid(), $metaData);
$this->getFileIndexRepository()->updateIndexingTime($fileObject->getUid());
}
/**
* Get available extraction services
*
* @return ExtractorInterface[]
*/
protected function getExtractionServices()
{
if ($this->extractionServices === null) {
$this->extractionServices = $this->getExtractorRegistry()->getExtractorsWithDriverSupport($this->storage->getDriverType());
}
return $this->extractionServices;
}
/**
* Since by now all files in filesystem have been looked at it is save to assume,
* that files that are in indexed but not touched in this run are missing
*/
protected function detectMissingFiles()
{
$indexedNotExistentFiles = $this->getFileIndexRepository()->findInStorageAndNotInUidList(
$this->storage,
$this->identifiedFileUids
);
foreach ($indexedNotExistentFiles as $record) {
if (!$this->storage->hasFile($record['identifier'])) {
$this->getFileIndexRepository()->markFileAsMissing($record['uid']);
}
}
}
/**
* Check whether the extractor service supports this file according to file type restrictions.
*
* @param File $file
* @param ExtractorInterface $extractor
* @return bool
*/
protected function isFileTypeSupportedByExtractor(File $file, ExtractorInterface $extractor)
{
$isSupported = true;
$fileTypeRestrictions = $extractor->getFileTypeRestrictions();
if (!empty($fileTypeRestrictions) && !in_array($file->getType(), $fileTypeRestrictions)) {
$isSupported = false;
}
return $isSupported;
}
/**
* Adds updated files to the processing queue
*
* @param array $fileIdentifierArray
* @return void
*/
protected function detectChangedFilesInStorage(array $fileIdentifierArray)
{
foreach ($fileIdentifierArray as $fileIdentifier) {
// skip processed files
if ($this->storage->isWithinProcessingFolder($fileIdentifier)) {
continue;
}
// Get the modification time for file-identifier from the storage
$modificationTime = $this->storage->getFileInfoByIdentifier($fileIdentifier, ['mtime']);
// Look if the the modification time in FS is higher than the one in database (key needed on timestamps)
$indexRecord = $this->getFileIndexRepository()->findOneByStorageUidAndIdentifier($this->storage->getUid(), $fileIdentifier);
if ($indexRecord !== false) {
$this->identifiedFileUids[] = $indexRecord['uid'];
if ((int)$indexRecord['modification_date'] !== $modificationTime['mtime'] || $indexRecord['missing']) {
$this->filesToUpdate[$fileIdentifier] = $indexRecord;
}
} else {
$this->filesToUpdate[$fileIdentifier] = null;
}
}
}
/**
* Processes the Files which have been detected as "changed or new"
* in the storage
*
* @return void
*/
protected function processChangedAndNewFiles()
{
foreach ($this->filesToUpdate as $identifier => $data) {
if ($data == null) {
// search for files with same content hash in indexed storage
$fileHash = $this->storage->hashFileByIdentifier($identifier, 'sha1');
$files = $this->getFileIndexRepository()->findByContentHash($fileHash);
$fileObject = null;
if (!empty($files)) {
foreach ($files as $fileIndexEntry) {
// check if file is missing then we assume it's moved/renamed
if (!$this->storage->hasFile($fileIndexEntry['identifier'])) {
$fileObject = $this->getResourceFactory()->getFileObject($fileIndexEntry['uid'], $fileIndexEntry);
$fileObject->updateProperties([
'identifier' => $identifier
]);
$this->updateIndexEntry($fileObject);
$this->identifiedFileUids[] = $fileObject->getUid();
break;
}
}
}
// create new index when no missing file with same content hash is found
if ($fileObject === null) {
$fileObject = $this->createIndexEntry($identifier);
$this->identifiedFileUids[] = $fileObject->getUid();
}
} else {
// update existing file
$fileObject = $this->getResourceFactory()->getFileObject($data['uid'], $data);
$this->updateIndexEntry($fileObject);
}
}
}
/**
* Since the core desperately needs image sizes in metadata table put them there
* This should be called after every "content" update and "record" creation
*
* @param File $fileObject
*/
protected function extractRequiredMetaData(File $fileObject)
{
// since the core desperately needs image sizes in metadata table do this manually
// prevent doing this for remote storages, remote storages must provide the data with extractors
if ($fileObject->getType() == File::FILETYPE_IMAGE && $this->storage->getDriverType() === 'Local') {
$rawFileLocation = $fileObject->getForLocalProcessing(false);
$imageInfo = GeneralUtility::makeInstance(ImageInfo::class, $rawFileLocation);
$metaData = [
'width' => $imageInfo->getWidth(),
'height' => $imageInfo->getHeight(),
];
$this->getMetaDataRepository()->update($fileObject->getUid(), $metaData);
$fileObject->_updateMetaDataProperties($metaData);
}
}
/****************************
*
* UTILITY
*
****************************/
/**
* Collects the information to be cached in sys_file
*
* @param string $identifier
* @return array
*/
protected function gatherFileInformationArray($identifier)
{
$fileInfo = $this->storage->getFileInfoByIdentifier($identifier);
$fileInfo = $this->transformFromDriverFileInfoArrayToFileObjectFormat($fileInfo);
$fileInfo['type'] = $this->getFileType($fileInfo['mime_type']);
$fileInfo['sha1'] = $this->storage->hashFileByIdentifier($identifier, 'sha1');
$fileInfo['extension'] = \TYPO3\CMS\Core\Utility\PathUtility::pathinfo($fileInfo['name'], PATHINFO_EXTENSION);
$fileInfo['missing'] = 0;
return $fileInfo;
}
/**
* Maps the mimetype to a sys_file table type
*
* @param string $mimeType
* @return string
*/
protected function getFileType($mimeType)
{
list($fileType) = explode('/', $mimeType);
switch (strtolower($fileType)) {
case 'text':
$type = File::FILETYPE_TEXT;
break;
case 'image':
$type = File::FILETYPE_IMAGE;
break;
case 'audio':
$type = File::FILETYPE_AUDIO;
break;
case 'video':
$type = File::FILETYPE_VIDEO;
break;
case 'application':
case 'software':
$type = File::FILETYPE_APPLICATION;
break;
default:
$type = File::FILETYPE_UNKNOWN;
}
return $type;
}
/**
* However it happened, the properties of a file object which
* are persisted to the database are named different than the
* properties the driver returns in getFileInfo.
* Therefore a mapping must happen.
*
* @param array $fileInfo
*
* @return array
*/
protected function transformFromDriverFileInfoArrayToFileObjectFormat(array $fileInfo)
{
$mappingInfo = [
// 'driverKey' => 'fileProperty' Key is from the driver, value is for the property in the file
'size' => 'size',
'atime' => null,
'mtime' => 'modification_date',
'ctime' => 'creation_date',
'mimetype' => 'mime_type'
];
$mappedFileInfo = [];
foreach ($fileInfo as $key => $value) {
if (array_key_exists($key, $mappingInfo)) {
if ($mappingInfo[$key] !== null) {
$mappedFileInfo[$mappingInfo[$key]] = $value;
}
} else {
$mappedFileInfo[$key] = $value;
}
}
return $mappedFileInfo;
}
/**
* Returns an instance of the FileIndexRepository
*
* @return FileIndexRepository
*/
protected function getFileIndexRepository()
{
return FileIndexRepository::getInstance();
}
/**
* Returns an instance of the FileIndexRepository
*
* @return MetaDataRepository
*/
protected function getMetaDataRepository()
{
return MetaDataRepository::getInstance();
}
/**
* Returns the ResourceFactory
*
* @return \TYPO3\CMS\Core\Resource\ResourceFactory
*/
protected function getResourceFactory()
{
return \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance();
}
/**
* Returns an instance of the FileIndexRepository
*
* @return ExtractorRegistry
*/
protected function getExtractorRegistry()
{
return ExtractorRegistry::getInstance();
}
}
|
{
"content_hash": "84065056f08eb7c012589fbfc4862998",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 173,
"avg_line_length": 34.069478908188586,
"alnum_prop": 0.578150036416606,
"repo_name": "ahmedRguei/blogTypo",
"id": "29136579eaabac687bd8e9c073e8d5eec2ba604c",
"size": "14150",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "typo3/sysext/core/Classes/Resource/Index/Indexer.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "3425"
},
{
"name": "CSS",
"bytes": "1591892"
},
{
"name": "HTML",
"bytes": "617019"
},
{
"name": "JavaScript",
"bytes": "3011598"
},
{
"name": "PHP",
"bytes": "25967799"
},
{
"name": "PLpgSQL",
"bytes": "3957"
},
{
"name": "Shell",
"bytes": "7244"
},
{
"name": "Smarty",
"bytes": "302"
},
{
"name": "TypeScript",
"bytes": "122147"
},
{
"name": "XSLT",
"bytes": "27654"
}
],
"symlink_target": ""
}
|
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-a11y-keys/core-a11y-keys.html">
<!--
A responsive modal element.
##Responsive Breakpoints
`akyral-modal` is currently built using the following breakpoints.
<pre>
<code>
0 480px 720px 944px 1264px 1920px
├─────────┼─────────────┼─────────────┼───────────┼─────────┼─────────>
· phone · phablet · tablet · desktop · hd ·
</code>
</pre>
## Using the element
### Nested content
Using the element is as simple as defining a `akyral-modal` element and nesting content
Example:
<akyral-modal>
I am content...
</akyral-modal>
### Extending
You can extend `akyral-modal` directly. Note the shadow element that will transfer akyral-modal
shadow DOM into the new element
Example:
<polymer-element name="new-modal" extends="akyral-modal">
<template>
<shadow></shadow>
</template>
<script>
Polymer('new-modal', {});
</script>
</polymer-element>
### Setting `.contents`
You can also define an empty `akryal-modal` element and set the contents at any point
Example:
<akyral-modal id="modal"></akyral-modal>
<div id="modal-contents">
I am content...
</div>
<script>
var modal = document.querySelector('#modal'),
content = document.querySelector('#modal-content');
modal.contents = content;
</script>
## Configuration
### Type
Setting a type allows you to define a visual effect to the modal. You can
choose from the following types: `drop`, `flip`, `lift`, `slide`, `swing` and
`takeover`.
Example:
<akyral-modal type="flip"></akyral-modal>
### Position
Setting a position will set the visual effect's starting position. You can
choose from the following position: `top`, `left`, `bottom`, and `right`.
A modal with a type of `takeover` is not affected by position.
Example:
<akyral-modal type="slide" position="top"></akyral-modal>
### Pinned location
Setting the `pinned` attribute will pin the element to that side on the viewport.
This will override the position attribute. Only types of `swing` and `slide` support the pinned
attribute.
Example:
<akyral-modal type="slide" position="top" pinned="top"></akyral-modal>
## Accessiblity (a11y)
## Tab ordering
By default `akyral-modal` will allow tabbing into accessible items with it. It will maintain tab
focus within the modal until the escape key has been pressed or the modal has been closed.
## Suggestions
When marking up `akyral-modal`, it is recommended that the following standards are followed.
Define a role and aria-labelledby attribute
Example:
<akyral-modal role="dialog" aria-labelledby="elementID">
<h1 id="elementID">Modal Title</h1>
</akyral-modal>
@element akyral-modal
@blurb Web component which allows for easy modal creation
@demo http://filaraujo.github.io/akyral.io/modal/index.html
@homepage https://github.com/filaraujo/akyral-modal
-->
<polymer-element name="akyral-modal">
<template>
<link rel="stylesheet" href="akyral-modal.css" />
<core-a11y-keys target="{{}}" keys="esc" on-keys-pressed="{{ close }}">
</core-a11y-keys>
<content id="content"></content>
</template>
<script>
(function() {
var authors = ['Filipe Araujo'],
targetEl,
lastFocus,
docEl = document.body || document.documentElement,
baseEl = document.createElement('akyral-modal'),
oldOverflow;
// inject core modal to page
baseEl.setAttribute('core', '');
baseEl.show = baseEl.toggle = baseEl.close = warnApi;
docEl.insertBefore(baseEl, docEl.firstChild);
/**
* The `ensureInBody` will move the element into the body
*
* @method initialize
* @private
*/
function ensureInBody() {
docEl = document.body;
if (baseEl.parentNode !== docEl) {
docEl.insertBefore(baseEl, docEl.firstChild);
}
}
/**
* The `ensureFocus` will ensure that when focus has left a modal, and that modal is
* still open it will reset focus to the modal
*
* @method ensureFocus
*/
function ensureFocus(e) {
if (baseEl.shown && !baseEl.contains(e.target)) {
targetEl.focus();
}
}
/**
* Attempting to call methods against the instance managed `akyral-modal` will result
* in calling `warnApi` instead.
*
* @method warnApi
* @private
*/
function warnApi() {
console.error('akyral-modal :: You can\'t interact with this element directly');
}
Polymer('akyral-modal', {
/**
* The `author` attribute defines the initial author, setting
* this value will add another author
*
* @attribute author
* @type string
* @default 'Filipe Araujo'
*/
set author(name) {
if (authors.indexOf(name) > 0) {
return;
}
authors = [].concat.apply(authors, [name]);
},
get author() {
return authors;
},
publish: {
/**
* The `heading` will set the modal aria-label value
*
* @attribute heading
* @type string
* @default ''
*/
heading: '',
/**
* The `pinned` will pin the element to that side on the
* viewport. Only supported by elements with type of
* `slide` and `swing`
*
* @attribute pinned
* @type string
* @default null
*/
pinned: {
reflect: true,
value: undefined
},
/**
* The `position` attribute defines the visual effect's
* starting position
*
* @attribute position
* @type string
* @default null
*/
position: {
reflect: true,
value: undefined
},
/**
* The `shown` attribute manages the visibility state of the
* modal
*
* @attribute shown
* @type boolean
* @default false
*/
shown: {
reflect: true,
value: false
},
/**
* The `type` attribute defines the visual effect of the
* modal. It defaults to `takeover` if it is not defined
*
* @attribute type
* @type string
* @default 'takeover'
*/
type: {
reflect: true,
value: 'takeover'
}
},
/**
* The `close` method will close the modal
*
* @method close
*/
close: function() {
this.shown = false;
this.removeAttribute('tabindex');
this.job('modal-remove', function() {
document.body.style.overflow = oldOverflow;
this.parentContainer.appendChild(targetEl);
targetEl.removeAttribute('content');
baseEl.removeAttribute('type');
baseEl.removeAttribute('pinned');
lastFocus.focus();
}, 200);
this.fire('modal-closed', {
modal: this
});
},
/**
* The `show` method will open the modal
*
* @method show
*/
show: function() {
targetEl = this;
targetEl.setAttribute('content', '');
lastFocus = document.activeElement;
this.tabIndex = -1;
baseEl.setAttribute('type', this.type);
baseEl.setAttribute('pinned', this.pinned);
baseEl.bind('shown', new PathObserver(this, 'shown'));
baseEl.appendChild(this);
// wait until injected, then focus
this.job('modal-shown', function() {
this.shown = true;
oldOverflow = document.body.style.overflow;
document.body.style.overflow = 'hidden';
this.fire('modal-shown', {
modal: this
});
}, 300);
this.job('modal-focus', function() {
this.focus();
}, 300);
},
/**
* The `contentsChanged` method will inject the content into the modal
*
* @method contentsChanged
*/
contentsChanged: function() {
this.appendChild(this.contents);
this.contents.eventController = this.element.findController(this.contents);
},
/**
* The `toggle` method will open and close the modal
*
* @method toggle
*/
toggle: function() {
this[this.shown ? 'close' : 'show']();
},
/**
* The <polymer-element> has been fully prepared (e.g. Shadow DOM
* created, property observers setup, event listeners attached, etc).
* It will also bind accessibility
*
* @method ready
*/
ready: function() {
this.setAttribute('role', 'dialog');
this.async(function() {
this.parentContainer = this.parentNode || document.body;
}, 100);
if (this.heading) {
this.setAttribute('aria-label', this.heading);
}
}
});
document.addEventListener('DOMContentLoaded', ensureInBody);
document.addEventListener('focus', ensureFocus, true);
}());
</script>
</polymer-element>
|
{
"content_hash": "425f727efc603950a3920d5ef982c065",
"timestamp": "",
"source": "github",
"line_count": 369,
"max_line_length": 96,
"avg_line_length": 26.317073170731707,
"alnum_prop": 0.5482442590876326,
"repo_name": "ronatgithub/diana",
"id": "74ce099a28a7b4a4dfacd08b61c4411b4f116b13",
"size": "9857",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/custom/googleform/public/assets/lib/akyral-modal/akyral-modal.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1085046"
},
{
"name": "CoffeeScript",
"bytes": "1263"
},
{
"name": "HTML",
"bytes": "897784"
},
{
"name": "JavaScript",
"bytes": "3144290"
},
{
"name": "PHP",
"bytes": "8465"
},
{
"name": "Perl",
"bytes": "48"
},
{
"name": "Shell",
"bytes": "616"
}
],
"symlink_target": ""
}
|
#include <cbmc_proof/make_common_datastructures.h>
#include "crypto/s2n_fips.h"
#include "crypto/s2n_hash.h"
void s2n_hash_allow_md5_for_fips_harness()
{
/* Non-deterministic inputs. */
struct s2n_hash_state *state = cbmc_allocate_s2n_hash_state();
/* Operation under verification. */
if (s2n_hash_allow_md5_for_fips(state) == S2N_SUCCESS) {
/* Post-conditions. */
assert(s2n_result_is_ok(s2n_hash_state_validate(state)));
assert(IMPLIES(s2n_is_in_fips_mode(), state->hash_impl->allow_md5_for_fips != NULL));
}
assert(IMPLIES(state != NULL && !s2n_is_in_fips_mode(), state->hash_impl->allow_md5_for_fips == NULL));
}
|
{
"content_hash": "9d54067e6097ad359c7b6f187fc56280",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 107,
"avg_line_length": 33.5,
"alnum_prop": 0.6522388059701493,
"repo_name": "wcs1only/s2n",
"id": "824ed602e5eb8a528207b0d6dfebf369131e9e45",
"size": "1244",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "tests/cbmc/proofs/s2n_hash_allow_md5_for_fips/s2n_hash_allow_md5_for_fips_harness.c",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "49082"
},
{
"name": "C",
"bytes": "6838895"
},
{
"name": "C++",
"bytes": "34247"
},
{
"name": "CMake",
"bytes": "28408"
},
{
"name": "Coq",
"bytes": "29938"
},
{
"name": "Dockerfile",
"bytes": "3350"
},
{
"name": "Java",
"bytes": "3240"
},
{
"name": "Makefile",
"bytes": "306201"
},
{
"name": "Perl",
"bytes": "4252"
},
{
"name": "Python",
"bytes": "456734"
},
{
"name": "Ruby",
"bytes": "6523"
},
{
"name": "Rust",
"bytes": "52336"
},
{
"name": "Shell",
"bytes": "126606"
}
],
"symlink_target": ""
}
|
FN="mgug4120a.db_3.2.3.tar.gz"
URLS=(
"https://bioconductor.org/packages/3.13/data/annotation/src/contrib/mgug4120a.db_3.2.3.tar.gz"
"https://bioarchive.galaxyproject.org/mgug4120a.db_3.2.3.tar.gz"
"https://depot.galaxyproject.org/software/bioconductor-mgug4120a.db/bioconductor-mgug4120a.db_3.2.3_src_all.tar.gz"
"https://depot.galaxyproject.org/software/bioconductor-mgug4120a.db/bioconductor-mgug4120a.db_3.2.3_src_all.tar.gz"
)
MD5="bb57e8b2efe3d038ec2a0ace0313a4e7"
# Use a staging area in the conda dir rather than temp dirs, both to avoid
# permission issues as well as to have things downloaded in a predictable
# manner.
STAGING=$PREFIX/share/$PKG_NAME-$PKG_VERSION-$PKG_BUILDNUM
mkdir -p $STAGING
TARBALL=$STAGING/$FN
SUCCESS=0
for URL in ${URLS[@]}; do
curl $URL > $TARBALL
[[ $? == 0 ]] || continue
# Platform-specific md5sum checks.
if [[ $(uname -s) == "Linux" ]]; then
if md5sum -c <<<"$MD5 $TARBALL"; then
SUCCESS=1
break
fi
else if [[ $(uname -s) == "Darwin" ]]; then
if [[ $(md5 $TARBALL | cut -f4 -d " ") == "$MD5" ]]; then
SUCCESS=1
break
fi
fi
fi
done
if [[ $SUCCESS != 1 ]]; then
echo "ERROR: post-link.sh was unable to download any of the following URLs with the md5sum $MD5:"
printf '%s\n' "${URLS[@]}"
exit 1
fi
# Install and clean up
R CMD INSTALL --library=$PREFIX/lib/R/library $TARBALL
rm $TARBALL
rmdir $STAGING
|
{
"content_hash": "6f39339b982f1ba00eaaa30e46cf75ef",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 117,
"avg_line_length": 30.73913043478261,
"alnum_prop": 0.6760961810466761,
"repo_name": "phac-nml/bioconda-recipes",
"id": "cd531415df6bd829ad794d3668d05b7fc2b54ac0",
"size": "1426",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "recipes/bioconductor-mgug4120a.db/post-link.sh",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "154"
},
{
"name": "CMake",
"bytes": "13967"
},
{
"name": "M4",
"bytes": "726"
},
{
"name": "Perl",
"bytes": "99249"
},
{
"name": "Perl 6",
"bytes": "23942"
},
{
"name": "Prolog",
"bytes": "1067"
},
{
"name": "Python",
"bytes": "385519"
},
{
"name": "Roff",
"bytes": "996"
},
{
"name": "Shell",
"bytes": "3899674"
}
],
"symlink_target": ""
}
|
package com.google.errorprone.bugpatterns;
import com.google.errorprone.CompilationTestHelper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/**
* Unit tests for {@link TruthAssertExpected} bug pattern.
*
* @author ghm@google.com (Graeme Morgan)
*/
@RunWith(JUnit4.class)
public final class TruthAssertExpectedTest {
private final CompilationTestHelper compilationHelper =
CompilationTestHelper.newInstance(TruthAssertExpected.class, getClass());
@Test
public void testPositiveCase() {
compilationHelper.addSourceFile("TruthAssertExpectedPositiveCases.java").doTest();
}
@Test
public void testNegativeCase() {
compilationHelper.addSourceFile("TruthAssertExpectedNegativeCases.java").doTest();
}
}
|
{
"content_hash": "fa8821674146ed3c087c3afb652db0a7",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 86,
"avg_line_length": 26.82758620689655,
"alnum_prop": 0.7776349614395887,
"repo_name": "cushon/error-prone",
"id": "144902a9d30db76b2ad0c30028a643e745c696d6",
"size": "1385",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "core/src/test/java/com/google/errorprone/bugpatterns/TruthAssertExpectedTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "2061"
},
{
"name": "Java",
"bytes": "7364383"
},
{
"name": "Python",
"bytes": "10499"
},
{
"name": "Shell",
"bytes": "1815"
}
],
"symlink_target": ""
}
|
describe('CheckboxRenderer', function () {
var id = 'testContainer';
beforeEach(function () {
this.$container = $('<div id="' + id + '"></div>').appendTo('body');
});
afterEach(function () {
if (this.$container) {
destroy();
this.$container.remove();
}
});
it('should render values as checkboxes', function () {
handsontable({
data : [[true],[false],[true]],
columns : [
{ type: 'checkbox' }
]
});
expect($(getRenderedValue(0, 0)).is(':checkbox')).toBe(true);
expect($(getRenderedValue(1, 0)).is(':checkbox')).toBe(true);
expect($(getRenderedValue(2, 0)).is(':checkbox')).toBe(true);
});
it('should render check checkboxes for cell which value is true', function () {
handsontable({
data : [[true],[false],[true]],
columns : [
{ type: 'checkbox' }
]
});
expect($(getRenderedContent(0, 0)).prop('checked')).toBe(true);
expect($(getRenderedContent(1, 0)).prop('checked')).toBe(false);
expect($(getRenderedContent(2, 0)).prop('checked')).toBe(true);
});
it('should use templates to check appropriate checkboxes', function () {
handsontable({
data : [['yes'],['no'],['yes']],
columns : [
{
type: 'checkbox',
checkedTemplate: 'yes',
uncheckedTemplate: 'no'
}
]
});
expect($(getRenderedContent(0, 0)).prop('checked')).toBe(true);
expect($(getRenderedContent(1, 0)).prop('checked')).toBe(false);
expect($(getRenderedContent(2, 0)).prop('checked')).toBe(true);
});
it('should reverse selection in checkboxes', function () {
handsontable({
data : [[true],[false],[true]],
columns : [
{ type: 'checkbox' }
]
});
this.$container.find(':checkbox').eq(0).trigger('click');
this.$container.find(':checkbox').eq(1).trigger('click');
this.$container.find(':checkbox').eq(2).trigger('click');
expect(getData()).toEqual([[false],[true],[false]]);
});
it('shouldn\'t uncheck checkboxes', function () {
handsontable({
data : [[true],[true],[true]],
columns : [
{ type: 'checkbox', readOnly : true }
]
});
this.$container.find(':checkbox').trigger('click');
expect(getData()).toEqual([[true],[true],[true]]);
});
it("should check single box after hitting space", function () {
handsontable({
data : [[true],[true],[true]],
columns : [
{ type: 'checkbox'}
]
});
var afterChangeCallback = jasmine.createSpy('afterChangeCallback');
addHook('afterChange', afterChangeCallback);
var checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(true);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[true], [true], [true]]);
selectCell(0, 0);
keyDown('space');
expect(checkboxes.eq(0).prop('checked')).toBe(false);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[false], [true], [true]]);
expect(afterChangeCallback.calls.length).toEqual(1);
expect(afterChangeCallback).toHaveBeenCalledWith([[0, 0, true, false]], 'edit', undefined, undefined, undefined);
});
it("should not check single box after hitting space, if cell is readOnly", function () {
handsontable({
data : [[true],[true],[true]],
columns : [
{ type: 'checkbox', readOnly: true}
]
});
var afterChangeCallback = jasmine.createSpy('afterChangeCallback');
addHook('afterChange', afterChangeCallback);
var checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(true);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[true], [true], [true]]);
selectCell(0, 0);
keyDown('space');
expect(checkboxes.eq(0).prop('checked')).toBe(true);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[true], [true], [true]]);
expect(afterChangeCallback).not.toHaveBeenCalled();
});
it("should reverse checkboxes state after hitting space, when multiple cells are selected", function () {
var hot = handsontable({
data : [[true],[false],[true]],
columns : [
{ type: 'checkbox'}
]
});
var afterChangeCallback = jasmine.createSpy('afterChangeCallback');
addHook('afterChange', afterChangeCallback);
var checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(true);
expect(checkboxes.eq(1).prop('checked')).toBe(false);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[true],[false],[true]]);
selectCell(0, 0, 2, 0);
keyDown('space');
checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(false);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(false);
expect(getData()).toEqual([[false],[true],[false]]);
expect(afterChangeCallback.calls.length).toEqual(3);
expect(afterChangeCallback.calls[0].args[0]).toEqual([[0, 0, true, false]], 'edit', undefined, undefined, undefined);
expect(afterChangeCallback.calls[1].args[0]).toEqual([[1, 0, false, true]], 'edit', undefined, undefined, undefined);
expect(afterChangeCallback.calls[2].args[0]).toEqual([[2, 0, true, false]], 'edit', undefined, undefined, undefined);
});
it("should reverse checkboxes state after hitting space, when multiple cells are selected and selStart > selEnd", function () {
handsontable({
data : [[true],[false],[true]],
columns : [
{ type: 'checkbox'}
]
});
var afterChangeCallback = jasmine.createSpy('afterChangeCallback');
addHook('afterChange', afterChangeCallback);
var checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(true);
expect(checkboxes.eq(1).prop('checked')).toBe(false);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[true],[false],[true]]);
selectCell(2, 0, 0, 0); //selStart = [2,0], selEnd = [0,0]
keyDown('space');
checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(false);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(false);
expect(getData()).toEqual([[false],[true],[false]]);
expect(afterChangeCallback.calls.length).toEqual(3);
expect(afterChangeCallback.calls[0].args[0]).toEqual([[0, 0, true, false]], 'edit', undefined, undefined, undefined);
expect(afterChangeCallback.calls[1].args[0]).toEqual([[1, 0, false, true]], 'edit', undefined, undefined, undefined);
expect(afterChangeCallback.calls[2].args[0]).toEqual([[2, 0, true, false]], 'edit', undefined, undefined, undefined);
});
it("should open cell editors of cell that does not have checkboxRenderer (#1199)", function () {
var hot = handsontable({
data : [[true, 'B0'],[true, 'B1'],[true, 'B2']],
columns : [
{ type: 'checkbox'},
{ type: 'text'}
]
});
selectCell(0, 1);
expect(hot.getActiveEditor().isOpened()).toBe(false);
keyDown('space');
expect(hot.getActiveEditor().isOpened()).toBe(true);
});
it("double click on checkbox cell should invert the value", function () {
handsontable({
data: [
[true],
[false],
[true]
],
columns: [
{ type: 'checkbox'}
]
});
mouseDoubleClick($(getCell(0, 0)));
expect(getDataAtCell(0, 0)).toBe(false);
mouseDoubleClick($(getCell(0, 0)));
expect(getDataAtCell(0, 0)).toBe(true);
mouseDoubleClick($(getCell(0, 0)));
expect(getDataAtCell(0, 0)).toBe(false);
});
it("should change checkbox state from checked to unchecked after hitting ENTER", function () {
handsontable({
data : [[true],[true],[true]],
columns : [
{ type: 'checkbox'}
]
});
var afterChangeCallback = jasmine.createSpy('afterChangeCallback');
addHook('afterChange', afterChangeCallback);
var checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(true);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[true], [true], [true]]);
selectCell(0, 0);
keyDown('enter');
expect(checkboxes.eq(0).prop('checked')).toBe(false);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(true);
expect(getData()).toEqual([[false], [true], [true]]);
expect(afterChangeCallback.calls.length).toEqual(1);
expect(afterChangeCallback).toHaveBeenCalledWith([[0, 0, true, false]], 'edit', undefined, undefined, undefined);
});
it("should change checkbox state from checked to unchecked after hitting ENTER using custom check/uncheck templates", function () {
handsontable({
data : [['yes'],['yes'],['no']],
columns : [
{
type: 'checkbox',
checkedTemplate: 'yes',
uncheckedTemplate: 'no'
}
]
});
var afterChangeCallback = jasmine.createSpy('afterChangeCallback');
addHook('afterChange', afterChangeCallback);
var checkboxes = this.$container.find(':checkbox');
expect(checkboxes.eq(0).prop('checked')).toBe(true);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(false);
expect(getData()).toEqual([['yes'], ['yes'], ['no']]);
selectCell(0, 0);
keyDown('enter');
expect(checkboxes.eq(0).prop('checked')).toBe(false);
expect(checkboxes.eq(1).prop('checked')).toBe(true);
expect(checkboxes.eq(2).prop('checked')).toBe(false);
expect(getData()).toEqual([['no'], ['yes'], ['no']]);
expect(afterChangeCallback.calls.length).toEqual(1);
expect(afterChangeCallback).toHaveBeenCalledWith([[0, 0, 'yes', 'no']], 'edit', undefined, undefined, undefined);
});
});
|
{
"content_hash": "ca9ea917f1a32500e773cdf8a831790c",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 133,
"avg_line_length": 31.775757575757577,
"alnum_prop": 0.6144382986839596,
"repo_name": "digitaltech/handsontable",
"id": "c08ff548185e80669588279b9d4db1ebaffba4a2",
"size": "10486",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "test/jasmine/spec/renderers/checkboxRendererSpec.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "114040"
},
{
"name": "JavaScript",
"bytes": "3973111"
},
{
"name": "PHP",
"bytes": "6780"
}
],
"symlink_target": ""
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Extensions Reference</title>
<link rel="stylesheet" type="text/css" href="css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="css/highlight.css" />
<meta charset='utf-8'>
<script src="js/jquery.min.js" defer></script>
<script src="js/jazzy.js" defer></script>
<script src="js/lunr.min.js" defer></script>
<script src="js/typeahead.jquery.js" defer></script>
<script src="js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Section/Extensions" class="dashAnchor"></a>
<a title="Extensions Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">BoxSDK 5.4.0 Docs</a> (99% documented)</p>
<div class="header-right">
<form role="search" action="search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</div>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="index.html">BoxSDK Reference</a>
<img id="carat" src="img/carat.png" alt=""/>
Extensions Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Classes/AuthModule.html">AuthModule</a>
</li>
<li class="nav-group-task">
<a href="Classes.html#/s:6BoxSDK0A12APIAuthErrorC">BoxAPIAuthError</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxAPIError.html">BoxAPIError</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxClient.html">BoxClient</a>
</li>
<li class="nav-group-task">
<a href="Classes.html#/s:6BoxSDK0A11CodingErrorC">BoxCodingError</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxCollection.html">BoxCollection</a>
</li>
<li class="nav-group-task">
<a href="Classes.html#/s:6BoxSDK0A12DownloadTaskC">BoxDownloadTask</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxNetworkAgent.html">BoxNetworkAgent</a>
</li>
<li class="nav-group-task">
<a href="Classes.html#/s:6BoxSDK0A12NetworkErrorC">BoxNetworkError</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxNetworkTask.html">BoxNetworkTask</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxRequest.html">BoxRequest</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxRequest/BodyType.html">– BodyType</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxSDK.html">BoxSDK</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxSDK/Constants.html">– Constants</a>
</li>
<li class="nav-group-task">
<a href="Classes/BoxSDKError.html">BoxSDKError</a>
</li>
<li class="nav-group-task">
<a href="Classes.html#/s:6BoxSDK0A10UploadTaskC">BoxUploadTask</a>
</li>
<li class="nav-group-task">
<a href="Classes/CCGAuthModule.html">CCGAuthModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/CCGAuthModule/CCGConnectionType.html">– CCGConnectionType</a>
</li>
<li class="nav-group-task">
<a href="Classes/CCGAuthSession.html">CCGAuthSession</a>
</li>
<li class="nav-group-task">
<a href="Classes/Classification.html">Classification</a>
</li>
<li class="nav-group-task">
<a href="Classes/Collaboration.html">Collaboration</a>
</li>
<li class="nav-group-task">
<a href="Classes/Collaboration/AcceptanceRequirementsStatus.html">– AcceptanceRequirementsStatus</a>
</li>
<li class="nav-group-task">
<a href="Classes/Collaboration/TermsOfServiceRequirement.html">– TermsOfServiceRequirement</a>
</li>
<li class="nav-group-task">
<a href="Classes/Collaboration/StrongPasswordRequirement.html">– StrongPasswordRequirement</a>
</li>
<li class="nav-group-task">
<a href="Classes/Collaboration/TwoFactorAuthenticationRequirement.html">– TwoFactorAuthenticationRequirement</a>
</li>
<li class="nav-group-task">
<a href="Classes/CollaborationAllowlistEntry.html">CollaborationAllowlistEntry</a>
</li>
<li class="nav-group-task">
<a href="Classes/CollaborationAllowlistExemptTarget.html">CollaborationAllowlistExemptTarget</a>
</li>
<li class="nav-group-task">
<a href="Classes/CollaborationAllowlistModule.html">CollaborationAllowlistModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/CollaborationsModule.html">CollaborationsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Collaborator.html">Collaborator</a>
</li>
<li class="nav-group-task">
<a href="Classes/Collaborator/CollaboratorType.html">– CollaboratorType</a>
</li>
<li class="nav-group-task">
<a href="Classes/CollectionsModule.html">CollectionsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Comment.html">Comment</a>
</li>
<li class="nav-group-task">
<a href="Classes/CommentsModule.html">CommentsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ConsoleLogDestination.html">ConsoleLogDestination</a>
</li>
<li class="nav-group-task">
<a href="Classes/DelegatedAuthSession.html">DelegatedAuthSession</a>
</li>
<li class="nav-group-task">
<a href="Classes/DevicePin.html">DevicePin</a>
</li>
<li class="nav-group-task">
<a href="Classes/DevicePinsModule.html">DevicePinsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/EmailAlias.html">EmailAlias</a>
</li>
<li class="nav-group-task">
<a href="Classes/Enterprise.html">Enterprise</a>
</li>
<li class="nav-group-task">
<a href="Classes/EntryContainer.html">EntryContainer</a>
</li>
<li class="nav-group-task">
<a href="Classes/EntryContainerInnerModel.html">EntryContainerInnerModel</a>
</li>
<li class="nav-group-task">
<a href="Classes/Event.html">Event</a>
</li>
<li class="nav-group-task">
<a href="Classes/EventContainer.html">EventContainer</a>
</li>
<li class="nav-group-task">
<a href="Classes/EventItem.html">EventItem</a>
</li>
<li class="nav-group-task">
<a href="Classes/EventItem/EventItemType.html">– EventItemType</a>
</li>
<li class="nav-group-task">
<a href="Classes/EventsModule.html">EventsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ExpiringEmbedLink.html">ExpiringEmbedLink</a>
</li>
<li class="nav-group-task">
<a href="Classes/File.html">File</a>
</li>
<li class="nav-group-task">
<a href="Classes/File/Permissions.html">– Permissions</a>
</li>
<li class="nav-group-task">
<a href="Classes/FileLogDestination.html">FileLogDestination</a>
</li>
<li class="nav-group-task">
<a href="Classes/FileRequest.html">FileRequest</a>
</li>
<li class="nav-group-task">
<a href="Classes/FileRequestsModule.html">FileRequestsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/FileVersion.html">FileVersion</a>
</li>
<li class="nav-group-task">
<a href="Classes/FileVersionLegalHold.html">FileVersionLegalHold</a>
</li>
<li class="nav-group-task">
<a href="Classes/FileVersionRetention.html">FileVersionRetention</a>
</li>
<li class="nav-group-task">
<a href="Classes/FilesModule.html">FilesModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Folder.html">Folder</a>
</li>
<li class="nav-group-task">
<a href="Classes/Folder/Permissions.html">– Permissions</a>
</li>
<li class="nav-group-task">
<a href="Classes/FolderLock.html">FolderLock</a>
</li>
<li class="nav-group-task">
<a href="Classes/FolderLock/LockedOperations.html">– LockedOperations</a>
</li>
<li class="nav-group-task">
<a href="Classes/FolderUploadEmail.html">FolderUploadEmail</a>
</li>
<li class="nav-group-task">
<a href="Classes/FoldersModule.html">FoldersModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Group.html">Group</a>
</li>
<li class="nav-group-task">
<a href="Classes/Group/GroupType.html">– GroupType</a>
</li>
<li class="nav-group-task">
<a href="Classes/GroupMembership.html">GroupMembership</a>
</li>
<li class="nav-group-task">
<a href="Classes/GroupMembership/ConfigurablePermissions.html">– ConfigurablePermissions</a>
</li>
<li class="nav-group-task">
<a href="Classes/GroupsModule.html">GroupsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Invite.html">Invite</a>
</li>
<li class="nav-group-task">
<a href="Classes/KeychainTokenStore.html">KeychainTokenStore</a>
</li>
<li class="nav-group-task">
<a href="Classes/LegalHoldPolicy.html">LegalHoldPolicy</a>
</li>
<li class="nav-group-task">
<a href="Classes/LegalHoldPolicy/AssignmentCounts.html">– AssignmentCounts</a>
</li>
<li class="nav-group-task">
<a href="Classes/LegalHoldPolicy/Status.html">– Status</a>
</li>
<li class="nav-group-task">
<a href="Classes/LegalHoldPolicyAssignment.html">LegalHoldPolicyAssignment</a>
</li>
<li class="nav-group-task">
<a href="Classes/LegalHoldPolicyAssignmentItem.html">LegalHoldPolicyAssignmentItem</a>
</li>
<li class="nav-group-task">
<a href="Classes/LegalHoldPolicyAssignmentItem/AssignmentItemType.html">– AssignmentItemType</a>
</li>
<li class="nav-group-task">
<a href="Classes/LegalHoldsModule.html">LegalHoldsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Lock.html">Lock</a>
</li>
<li class="nav-group-task">
<a href="Classes/MetadataCascadePolicy.html">MetadataCascadePolicy</a>
</li>
<li class="nav-group-task">
<a href="Classes/MetadataCascadePolicyModule.html">MetadataCascadePolicyModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MetadataModule.html">MetadataModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/MetadataObject.html">MetadataObject</a>
</li>
<li class="nav-group-task">
<a href="Classes/MetadataSearchFilter.html">MetadataSearchFilter</a>
</li>
<li class="nav-group-task">
<a href="Classes/MetadataTemplate.html">MetadataTemplate</a>
</li>
<li class="nav-group-task">
<a href="Classes/OAuth2Session.html">OAuth2Session</a>
</li>
<li class="nav-group-task">
<a href="Classes/Order.html">Order</a>
</li>
<li class="nav-group-task">
<a href="Classes/PagingIterator.html">PagingIterator</a>
</li>
<li class="nav-group-task">
<a href="Classes/PathCollection.html">PathCollection</a>
</li>
<li class="nav-group-task">
<a href="Classes/PollingResult.html">PollingResult</a>
</li>
<li class="nav-group-task">
<a href="Classes/PollingURLInfo.html">PollingURLInfo</a>
</li>
<li class="nav-group-task">
<a href="Classes/RecentItem.html">RecentItem</a>
</li>
<li class="nav-group-task">
<a href="Classes/RecentItem/InteractionType.html">– InteractionType</a>
</li>
<li class="nav-group-task">
<a href="Classes/RecentItemsModule.html">RecentItemsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RetentionPoliciesModule.html">RetentionPoliciesModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/RetentionPolicy.html">RetentionPolicy</a>
</li>
<li class="nav-group-task">
<a href="Classes/RetentionPolicyAssignment.html">RetentionPolicyAssignment</a>
</li>
<li class="nav-group-task">
<a href="Classes/RetentionPolicyAssignmentItem.html">RetentionPolicyAssignmentItem</a>
</li>
<li class="nav-group-task">
<a href="Classes/RetentionPolicyEntry.html">RetentionPolicyEntry</a>
</li>
<li class="nav-group-task">
<a href="Classes/Scope.html">Scope</a>
</li>
<li class="nav-group-task">
<a href="Classes/SearchModule.html">SearchModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/SearchResult.html">SearchResult</a>
</li>
<li class="nav-group-task">
<a href="Classes/SharedItem.html">SharedItem</a>
</li>
<li class="nav-group-task">
<a href="Classes/SharedItem/SharedItemType.html">– SharedItemType</a>
</li>
<li class="nav-group-task">
<a href="Classes/SharedItemsModule.html">SharedItemsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/SharedLink.html">SharedLink</a>
</li>
<li class="nav-group-task">
<a href="Classes/SharedLink/Permissions.html">– Permissions</a>
</li>
<li class="nav-group-task">
<a href="Classes/SignRequest.html">SignRequest</a>
</li>
<li class="nav-group-task">
<a href="Classes/SignRequestPrefillTag.html">SignRequestPrefillTag</a>
</li>
<li class="nav-group-task">
<a href="Classes/SignRequestSignFiles.html">SignRequestSignFiles</a>
</li>
<li class="nav-group-task">
<a href="Classes/SignRequestSigner.html">SignRequestSigner</a>
</li>
<li class="nav-group-task">
<a href="Classes/SignRequestSignerDecision.html">SignRequestSignerDecision</a>
</li>
<li class="nav-group-task">
<a href="Classes/SignRequestSignerInput.html">SignRequestSignerInput</a>
</li>
<li class="nav-group-task">
<a href="Classes/SignRequestsModule.html">SignRequestsModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/SingleTokenSession.html">SingleTokenSession</a>
</li>
<li class="nav-group-task">
<a href="Classes/StoragePoliciesModule.html">StoragePoliciesModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/StoragePolicy.html">StoragePolicy</a>
</li>
<li class="nav-group-task">
<a href="Classes/StoragePolicyAssignment.html">StoragePolicyAssignment</a>
</li>
<li class="nav-group-task">
<a href="Classes/StoragePolicyAssignment/AssignedTo.html">– AssignedTo</a>
</li>
<li class="nav-group-task">
<a href="Classes/Task.html">Task</a>
</li>
<li class="nav-group-task">
<a href="Classes/TaskAssignment.html">TaskAssignment</a>
</li>
<li class="nav-group-task">
<a href="Classes/TasksModule.html">TasksModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/TermsOfService.html">TermsOfService</a>
</li>
<li class="nav-group-task">
<a href="Classes/TermsOfServiceUserStatus.html">TermsOfServiceUserStatus</a>
</li>
<li class="nav-group-task">
<a href="Classes/TermsOfServicesModule.html">TermsOfServicesModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Token.html">Token</a>
</li>
<li class="nav-group-task">
<a href="Classes/TokenInfo.html">TokenInfo</a>
</li>
<li class="nav-group-task">
<a href="Classes/TrackingCode.html">TrackingCode</a>
</li>
<li class="nav-group-task">
<a href="Classes/TrashModule.html">TrashModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/UploadPart.html">UploadPart</a>
</li>
<li class="nav-group-task">
<a href="Classes/UploadSession.html">UploadSession</a>
</li>
<li class="nav-group-task">
<a href="Classes/UploadSession/UploadSessionEndpoints.html">– UploadSessionEndpoints</a>
</li>
<li class="nav-group-task">
<a href="Classes/User.html">User</a>
</li>
<li class="nav-group-task">
<a href="Classes/User/TrackingCode.html">– TrackingCode</a>
</li>
<li class="nav-group-task">
<a href="Classes/UserAvatarUpload.html">UserAvatarUpload</a>
</li>
<li class="nav-group-task">
<a href="Classes/UserAvatarUpload/PicUrls.html">– PicUrls</a>
</li>
<li class="nav-group-task">
<a href="Classes/UsersModule.html">UsersModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Watermark.html">Watermark</a>
</li>
<li class="nav-group-task">
<a href="Classes/WebLink.html">WebLink</a>
</li>
<li class="nav-group-task">
<a href="Classes/WebLink/Permissions.html">– Permissions</a>
</li>
<li class="nav-group-task">
<a href="Classes/WebLinksModule.html">WebLinksModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/Webhook.html">Webhook</a>
</li>
<li class="nav-group-task">
<a href="Classes/Webhook/EventTriggers.html">– EventTriggers</a>
</li>
<li class="nav-group-task">
<a href="Classes/WebhooksModule.html">WebhooksModule</a>
</li>
<li class="nav-group-task">
<a href="Classes/ZipDownload.html">ZipDownload</a>
</li>
<li class="nav-group-task">
<a href="Classes/ZipDownloadConflict.html">ZipDownloadConflict</a>
</li>
<li class="nav-group-task">
<a href="Classes/ZipDownloadConflictItem.html">ZipDownloadConflictItem</a>
</li>
<li class="nav-group-task">
<a href="Classes/ZipDownloadStatus.html">ZipDownloadStatus</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Enums/AccessibleBy.html">AccessibleBy</a>
</li>
<li class="nav-group-task">
<a href="Enums/AssignmentState.html">AssignmentState</a>
</li>
<li class="nav-group-task">
<a href="Enums/AssignmentStatus.html">AssignmentStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/AsyncHelper.html">AsyncHelper</a>
</li>
<li class="nav-group-task">
<a href="Enums/BoxSDKErrorEnum.html">BoxSDKErrorEnum</a>
</li>
<li class="nav-group-task">
<a href="Enums/CollaborationDirection.html">CollaborationDirection</a>
</li>
<li class="nav-group-task">
<a href="Enums/CollaborationItem.html">CollaborationItem</a>
</li>
<li class="nav-group-task">
<a href="Enums/CollaborationRole.html">CollaborationRole</a>
</li>
<li class="nav-group-task">
<a href="Enums/CollaborationStatus.html">CollaborationStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/CommentItem.html">CommentItem</a>
</li>
<li class="nav-group-task">
<a href="Enums/ConflictResolution.html">ConflictResolution</a>
</li>
<li class="nav-group-task">
<a href="Enums/DispositionAction.html">DispositionAction</a>
</li>
<li class="nav-group-task">
<a href="Enums/EventObserverResponse.html">EventObserverResponse</a>
</li>
<li class="nav-group-task">
<a href="Enums/EventType.html">EventType</a>
</li>
<li class="nav-group-task">
<a href="Enums/FileMetadataOperation.html">FileMetadataOperation</a>
</li>
<li class="nav-group-task">
<a href="Enums/FileRepresentationHint.html">FileRepresentationHint</a>
</li>
<li class="nav-group-task">
<a href="Enums/FileRequestStatus.html">FileRequestStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/FolderItem.html">FolderItem</a>
</li>
<li class="nav-group-task">
<a href="Enums/FolderItemsOrderBy.html">FolderItemsOrderBy</a>
</li>
<li class="nav-group-task">
<a href="Enums/FolderMetadataOperation.html">FolderMetadataOperation</a>
</li>
<li class="nav-group-task">
<a href="Enums/FolderUploadEmailAccess.html">FolderUploadEmailAccess</a>
</li>
<li class="nav-group-task">
<a href="Enums/GroupInvitabilityLevel.html">GroupInvitabilityLevel</a>
</li>
<li class="nav-group-task">
<a href="Enums/GroupMemberViewabilityLevel.html">GroupMemberViewabilityLevel</a>
</li>
<li class="nav-group-task">
<a href="Enums/GroupRole.html">GroupRole</a>
</li>
<li class="nav-group-task">
<a href="Enums/HTTPMethod.html">HTTPMethod</a>
</li>
<li class="nav-group-task">
<a href="Enums/ItemStatus.html">ItemStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/LogCategory.html">LogCategory</a>
</li>
<li class="nav-group-task">
<a href="Enums/LogLevel.html">LogLevel</a>
</li>
<li class="nav-group-task">
<a href="Enums/MetadataFilterBound.html">MetadataFilterBound</a>
</li>
<li class="nav-group-task">
<a href="Enums/MetadataScope.html">MetadataScope</a>
</li>
<li class="nav-group-task">
<a href="Enums/MetadataTemplateOperation.html">MetadataTemplateOperation</a>
</li>
<li class="nav-group-task">
<a href="Enums/NullableParameter.html">NullableParameter</a>
</li>
<li class="nav-group-task">
<a href="Enums/ObjectDeserializer.html">ObjectDeserializer</a>
</li>
<li class="nav-group-task">
<a href="Enums/OrderDirection.html">OrderDirection</a>
</li>
<li class="nav-group-task">
<a href="Enums/PagingParameter.html">PagingParameter</a>
</li>
<li class="nav-group-task">
<a href="Enums/ResponseHandler.html">ResponseHandler</a>
</li>
<li class="nav-group-task">
<a href="Enums/RetentionPolicyAssignmentItemType.html">RetentionPolicyAssignmentItemType</a>
</li>
<li class="nav-group-task">
<a href="Enums/RetentionPolicyStatus.html">RetentionPolicyStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/RetentionPolicyType.html">RetentionPolicyType</a>
</li>
<li class="nav-group-task">
<a href="Enums/RetentionType.html">RetentionType</a>
</li>
<li class="nav-group-task">
<a href="Enums/SearchContentType.html">SearchContentType</a>
</li>
<li class="nav-group-task">
<a href="Enums/SearchItemType.html">SearchItemType</a>
</li>
<li class="nav-group-task">
<a href="Enums/SearchScope.html">SearchScope</a>
</li>
<li class="nav-group-task">
<a href="Enums/SharedLinkAccess.html">SharedLinkAccess</a>
</li>
<li class="nav-group-task">
<a href="Enums/SignRequestSignerDecisionType.html">SignRequestSignerDecisionType</a>
</li>
<li class="nav-group-task">
<a href="Enums/SignRequestSignerInputContentType.html">SignRequestSignerInputContentType</a>
</li>
<li class="nav-group-task">
<a href="Enums/SignRequestSignerInputType.html">SignRequestSignerInputType</a>
</li>
<li class="nav-group-task">
<a href="Enums/SignRequestSignerRole.html">SignRequestSignerRole</a>
</li>
<li class="nav-group-task">
<a href="Enums/SignRequestStatus.html">SignRequestStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/StreamPosition.html">StreamPosition</a>
</li>
<li class="nav-group-task">
<a href="Enums/StreamType.html">StreamType</a>
</li>
<li class="nav-group-task">
<a href="Enums/SyncState.html">SyncState</a>
</li>
<li class="nav-group-task">
<a href="Enums/TaskAction.html">TaskAction</a>
</li>
<li class="nav-group-task">
<a href="Enums/TaskCompletionRule.html">TaskCompletionRule</a>
</li>
<li class="nav-group-task">
<a href="Enums/TaskItem.html">TaskItem</a>
</li>
<li class="nav-group-task">
<a href="Enums/TermsOfServiceStatus.html">TermsOfServiceStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/TermsOfServiceType.html">TermsOfServiceType</a>
</li>
<li class="nav-group-task">
<a href="Enums/ThumbnailExtension.html">ThumbnailExtension</a>
</li>
<li class="nav-group-task">
<a href="Enums/TokenScope.html">TokenScope</a>
</li>
<li class="nav-group-task">
<a href="Enums/UserRole.html">UserRole</a>
</li>
<li class="nav-group-task">
<a href="Enums/UserStatus.html">UserStatus</a>
</li>
<li class="nav-group-task">
<a href="Enums/WebhookItem.html">WebhookItem</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Extensions/Array.html">Array</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Bool.html">Bool</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Encodable.html">Encodable</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Int.html">Int</a>
</li>
<li class="nav-group-task">
<a href="Extensions/NSNumber.html">NSNumber</a>
</li>
<li class="nav-group-task">
<a href="Extensions/NSString.html">NSString</a>
</li>
<li class="nav-group-task">
<a href="Extensions/Optional.html">Optional</a>
</li>
<li class="nav-group-task">
<a href="Extensions/String.html">String</a>
</li>
<li class="nav-group-task">
<a href="Extensions/URL.html">URL</a>
</li>
<li class="nav-group-task">
<a href="Extensions.html#/c:objc(cs)NSURLSessionTask">URLSessionTask</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Protocols/BoxClientProtocol.html">BoxClientProtocol</a>
</li>
<li class="nav-group-task">
<a href="Protocols/BoxEnum.html">BoxEnum</a>
</li>
<li class="nav-group-task">
<a href="Protocols.html#/s:6BoxSDK0A10InnerModelP">BoxInnerModel</a>
</li>
<li class="nav-group-task">
<a href="Protocols/BoxModel.html">BoxModel</a>
</li>
<li class="nav-group-task">
<a href="Protocols/Cancellable.html">Cancellable</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ExpiredTokenHandling.html">ExpiredTokenHandling</a>
</li>
<li class="nav-group-task">
<a href="Protocols/LogDestination.html">LogDestination</a>
</li>
<li class="nav-group-task">
<a href="Protocols/NetworkAgentProtocol.html">NetworkAgentProtocol</a>
</li>
<li class="nav-group-task">
<a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a>
</li>
<li class="nav-group-task">
<a href="Protocols/ResourceTypeEntity.html">ResourceTypeEntity</a>
</li>
<li class="nav-group-task">
<a href="Protocols/SessionProtocol.html">SessionProtocol</a>
</li>
<li class="nav-group-task">
<a href="Protocols/TokenRefreshing.html">TokenRefreshing</a>
</li>
<li class="nav-group-task">
<a href="Protocols/TokenStore.html">TokenStore</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Structs/BoxRequestDescription.html">BoxRequestDescription</a>
</li>
<li class="nav-group-task">
<a href="Structs/BoxResponse.html">BoxResponse</a>
</li>
<li class="nav-group-task">
<a href="Structs/BoxResponseDescription.html">BoxResponseDescription</a>
</li>
<li class="nav-group-task">
<a href="Structs/BoxSDKConfiguration.html">BoxSDKConfiguration</a>
</li>
<li class="nav-group-task">
<a href="Structs/BoxURLComponents.html">BoxURLComponents</a>
</li>
<li class="nav-group-task">
<a href="Structs/ClientAnalyticsInfo.html">ClientAnalyticsInfo</a>
</li>
<li class="nav-group-task">
<a href="Structs/ConfigurablePermissionData.html">ConfigurablePermissionData</a>
</li>
<li class="nav-group-task">
<a href="Structs/FileRepresentation.html">FileRepresentation</a>
</li>
<li class="nav-group-task">
<a href="Structs/FileRepresentation/Content.html">– Content</a>
</li>
<li class="nav-group-task">
<a href="Structs/FileRepresentation/Info.html">– Info</a>
</li>
<li class="nav-group-task">
<a href="Structs/FileRepresentation/Status.html">– Status</a>
</li>
<li class="nav-group-task">
<a href="Structs/FileRepresentation/StatusEnum.html">– StatusEnum</a>
</li>
<li class="nav-group-task">
<a href="Structs/FileRequestCopyRequest.html">FileRequestCopyRequest</a>
</li>
<li class="nav-group-task">
<a href="Structs/FileRequestUpdateRequest.html">FileRequestUpdateRequest</a>
</li>
<li class="nav-group-task">
<a href="Structs/FolderEntity.html">FolderEntity</a>
</li>
<li class="nav-group-task">
<a href="Structs/LockData.html">LockData</a>
</li>
<li class="nav-group-task">
<a href="Structs/MetadataField.html">MetadataField</a>
</li>
<li class="nav-group-task">
<a href="Structs/MetadataFieldFilter.html">MetadataFieldFilter</a>
</li>
<li class="nav-group-task">
<a href="Structs/MultipartForm.html">MultipartForm</a>
</li>
<li class="nav-group-task">
<a href="Structs/SharedLinkData.html">SharedLinkData</a>
</li>
<li class="nav-group-task">
<a href="Structs/SignRequestCreateParameters.html">SignRequestCreateParameters</a>
</li>
<li class="nav-group-task">
<a href="Structs/SignRequestCreateParentFolder.html">SignRequestCreateParentFolder</a>
</li>
<li class="nav-group-task">
<a href="Structs/SignRequestCreateSigner.html">SignRequestCreateSigner</a>
</li>
<li class="nav-group-task">
<a href="Structs/SignRequestCreateSourceFile.html">SignRequestCreateSourceFile</a>
</li>
<li class="nav-group-task">
<a href="Structs/SignRequestCreateSourceFileVersion.html">SignRequestCreateSourceFileVersion</a>
</li>
<li class="nav-group-task">
<a href="Structs/UploadPartDescription.html">UploadPartDescription</a>
</li>
<li class="nav-group-task">
<a href="Structs/ZipDownloadItem.html">ZipDownloadItem</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="Typealiases.html#/s:6BoxSDK18AccessTokenClosurea">AccessTokenClosure</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:6BoxSDK16AccessTokenTuplea">AccessTokenTuple</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:6BoxSDK0A11HTTPHeadersa">BoxHTTPHeaders</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:6BoxSDK8Callbacka">Callback</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:6BoxSDK20DelegatedAuthClosurea">DelegatedAuthClosure</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:6BoxSDK15QueryParametersa">QueryParameters</a>
</li>
<li class="nav-group-task">
<a href="Typealiases.html#/s:6BoxSDK16TokenInfoClosurea">TokenInfoClosure</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Extensions</h1>
<p>The following extensions are available globally.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:SE"></a>
<a name="//apple_ref/swift/Extension/Encodable" class="dashAnchor"></a>
<a class="token" href="#/s:SE">Encodable</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/Encodable.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">extension</span> <span class="kt">Encodable</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:10Foundation3URLV"></a>
<a name="//apple_ref/swift/Extension/URL" class="dashAnchor"></a>
<a class="token" href="#/s:10Foundation3URLV">URL</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/URL.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">extension</span> <span class="kt">URL</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:objc(cs)NSURLSessionTask"></a>
<a name="//apple_ref/swift/Extension/URLSessionTask" class="dashAnchor"></a>
<a class="token" href="#/c:objc(cs)NSURLSessionTask">URLSessionTask</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">URLSessionTask</span><span class="p">:</span> <span class="kt"><a href="Protocols/Cancellable.html">Cancellable</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:SS"></a>
<a name="//apple_ref/swift/Extension/String" class="dashAnchor"></a>
<a class="token" href="#/s:SS">String</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/String.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">String</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:Si"></a>
<a name="//apple_ref/swift/Extension/Int" class="dashAnchor"></a>
<a class="token" href="#/s:Si">Int</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/Int.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Int</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:Sb"></a>
<a name="//apple_ref/swift/Extension/Bool" class="dashAnchor"></a>
<a class="token" href="#/s:Sb">Bool</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/Bool.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Bool</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:objc(cs)NSNumber"></a>
<a name="//apple_ref/swift/Extension/NSNumber" class="dashAnchor"></a>
<a class="token" href="#/c:objc(cs)NSNumber">NSNumber</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/NSNumber.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">NSNumber</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/c:objc(cs)NSString"></a>
<a name="//apple_ref/swift/Extension/NSString" class="dashAnchor"></a>
<a class="token" href="#/c:objc(cs)NSString">NSString</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/NSString.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">NSString</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:Sa"></a>
<a name="//apple_ref/swift/Extension/Array" class="dashAnchor"></a>
<a class="token" href="#/s:Sa">Array</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/Array.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Array</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span> <span class="k">where</span> <span class="kt">Element</span><span class="p">:</span> <span class="kt">StringProtocol</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:Sq"></a>
<a name="//apple_ref/swift/Extension/Optional" class="dashAnchor"></a>
<a class="token" href="#/s:Sq">Optional</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<a href="Extensions/Optional.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">extension</span> <span class="kt">Optional</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span> <span class="k">where</span> <span class="kt">Wrapped</span><span class="p">:</span> <span class="kt"><a href="Protocols/QueryParameterConvertible.html">QueryParameterConvertible</a></span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2022 <a class="link" href="https://github.com/box/box-ios-sdk" target="_blank" rel="external noopener">Box</a>. All rights reserved. (Last updated: 2022-11-08)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</html>
|
{
"content_hash": "757d00b6e11e93855fc107142a432226",
"timestamp": "",
"source": "github",
"line_count": 1158,
"max_line_length": 459,
"avg_line_length": 46.51208981001727,
"alnum_prop": 0.47956777631310227,
"repo_name": "box/box-ios-sdk",
"id": "a775a3e55156d60ecdbf9f6e08a7c6c21da07bce",
"size": "53925",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "docs/Extensions.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "480"
},
{
"name": "Ruby",
"bytes": "14855"
},
{
"name": "Shell",
"bytes": "3161"
},
{
"name": "Swift",
"bytes": "2032650"
}
],
"symlink_target": ""
}
|
<?php get_header(); ?>
<div class="container">
<div class="row">
<!-- Resume -->
<div class="col-md-9">
<section id="contactInformation" class="group">
<h1 class="text-right">Tim Wilson</h1>
<p class="text-right"><strong>Email:</strong><a href="mailto:tim@timswilson.com"> tim@timswilson.com</a></p>
<div class="text-right">
<a class="noBorder" href="http://www.linkedin.com/in/tim-s-wilson" target="_blank"><i class="fa fa-linkedin-square fa-1x" aria-hidden="true"></i></a>
<a class="noBorder" href="mailto:tim@timswilson.com"><i class="fa fa-envelope fa-1x" aria-hidden="true"></i></a>
</div>
</section>
<section id="experience" class="group">
<div class="text-center"><i class="fa fa-briefcase fa-3x fa-align-center" aria-hidden="true"></i></div>
<h3 class="text-center" style="margin-top:0px; margin-bottom:20px;">Experience</h3>
<hr>
<div id="experience1" class="subgroup">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class=" text-center lead"><strong>Precept Ministries International</strong></h4>
<p class="text-center">
<strong>ERP & CRM Administrator</strong>
<br>
<strong>August 2015 to Current</strong>
<br>
</p>
</div>
<div class="panel-body">
<ul>
<li>Worked on a team to implement Salesforce as the company's new CRM system</li>
<li>Developed solution which automatically screens new Salesforce contacts through WealthEngine's wealth identification services by using their API and four APEX classes in Salesforce.The solution was demoed to WealthEngine's API Evangelist who was so impressed he comped four licenses to their platform for the remainder of the year for the company.</li>
<li>Created custom solution which integrates Gigya's single sign-on platform into a new online store built on Shopify requiring expertise in JavaScript, jQuery, Node.js, and APIs.</li>
<li>Served as sole NetSuite Administrator supporting over 75 end users enabling them to accomplish their daily responsibilities</li>
<li>Developed and maintained over twenty NetSuite SuiteScripts and workflows</li>
<li>Worked on a team to create and maintain several integrations using Jitterbit, Workato, and Celigo integration tools.</li>
</ul>
</div>
</div>
</div>
<div id="experience2" class="subgroup">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class=" text-center lead"><strong>SuiteLaunch</strong></h4>
<p class="text-center">
<strong>NetSuite Administrator</strong>
<br>
<strong>November 2013 to August 2015</strong>
<br>
</p>
</div>
<div class="panel-body">
<ul>
<li>Assisted seven clients with implementing NetSuite's ERP / CRM business software</li>
<li>Uncovered needs from clients and delivered custom solutions to extend the native software using workflows, SuiteScript, Mass Updates, SSP Applications, custom objects / fields, saved searches, and reports</li>
<li>Trained end users on native and custom software</li>
<li>Assisted clients with website integrations, business analytics, marketing, accounting, data migration, customer service, and warehouse management among other tasks</li>
<li>Developed responsive e-commerce website leveraging NetSuite's Advanced Site Customization feature</li>
</ul>
</div>
</div>
</div>
</section>
<section id="education" class="group">
<div class="text-center"><i class="fa fa-graduation-cap fa-3x fa-align-center" aria-hidden="true"></i></div>
<h3 class="text-center" style="margin-top:0px; margin-bottom:20px;">Education</h3>
<hr>
<div id="education1" class="subgroup">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class=" text-center lead"><strong>Master of Business Administration</strong></h4>
</div>
<div class="panel-body">
<p>Bryan College </p>
<p>Graduated: May 2015</p>
</div>
</div>
</div>
<div id="education2" class="subgroup">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class=" text-center lead"><strong>Bachelor of Science in Business Administration</strong></h4>
</div>
<div class="panel-body">
<p>Major: General Management </p>
<p>Tennessee Technological University</p>
<p>Graduated: May 2010</p>
</div>
</div>
</div>
</section>
<section id="certifications" class="group">
<div class="text-center"><i class="fa fa-coffee fa-3x fa-align-center" aria-hidden="true"></i></div>
<h3 class="text-center" style="margin-top:0px; margin-bottom:20px;">Certifications</h3>
<hr>
<div class="well well-lg">
<ul>
<li>NetSuite Certified Administrator</li>
<li>Salesforce Certified Administrator</li>
<li>Salesforce Certified Advanced Administrator</li>
<li>Salesforce Certified Platform App Builder</li>
</ul>
</div>
</section>
<section id="skills" class="group">
<div class="text-center"><i class="fa fa-lightbulb-o fa-3x fa-align-center" aria-hidden="true"></i></div>
<h3 class="text-center" style="margin-top:0px; margin-bottom:20px;">Technical Skills</h3>
<hr>
<div class="well well-lg">
<div class="row">
<div class="col-sm-6">
<ul>
<li>NetSuite</li>
<li>Salesforce</li>
<li>JavaScript</li>
<li>jQuery</li>
<li>Apex</li>
</ul>
</div>
<div class="col-sm-6">
<ul>
<li>HTML</li>
<li>CSS</li>
<li>Git</li>
<li>REST / SOAP APIs</li>
<li>Node.js</li>
</ul>
</div>
</div>
</div>
</section>
</div>
<!--Side Nav Bar -->
<nav class="col-md-3 hidden-sm hidden-es bs-docs-sidebar">
<ul id="sidebar" class="nav nav-stacked fixed">
<li>
<a href="#contactInformation">Contact Information</a>
</li>
<li>
<a href="#experience">Experience</a>
<ul class="nav nav-stacked">
<li><a href="#experience1">Precept Ministries International</a></li>
<li><a href="#experience2">SuiteLaunch</a></li>
</ul>
</li>
<li>
<a href="#education">Education</a>
<ul class="nav nav-stacked">
<li><a href="#education1">Masters</a></li>
<li><a href="#education2">Undergrad</a></li>
</ul>
</li>
<li>
<a href="#certifications">Certifications</a>
</li>
<li>
<a href="#skills">Technical Skills</a>
</li>
</ul>
</nav>
</div>
</div>
<?php get_footer(); ?>
|
{
"content_hash": "6987f0391bd45a5b51be5f8bc818be02",
"timestamp": "",
"source": "github",
"line_count": 185,
"max_line_length": 367,
"avg_line_length": 38.17297297297297,
"alnum_prop": 0.5962900028320589,
"repo_name": "timswilson/Personal-Website",
"id": "40221c8b5b471aedc64bbf30ed9d3ccff6a349b0",
"size": "7062",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "bootstrap-basic-tw/page-resume.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "15988"
},
{
"name": "HTML",
"bytes": "87476"
},
{
"name": "JavaScript",
"bytes": "6765"
},
{
"name": "PHP",
"bytes": "197250"
}
],
"symlink_target": ""
}
|
// Copyright (c) Lakithu. All rights reserved.
namespace TLWebsite.API
{
using System.Web.Http;
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional });
}
}
}
|
{
"content_hash": "b8d9bfafd9ca907de5baedae28f6edf2",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 64,
"avg_line_length": 26.61904761904762,
"alnum_prop": 0.5724508050089445,
"repo_name": "TlWebsite/TLWebsite",
"id": "decc70c8e490debdab6e74ebd65d5d040569ed76",
"size": "561",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/TLWebsite.API/App_Start/WebApiConfig.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "107"
},
{
"name": "C#",
"bytes": "67670"
},
{
"name": "CSS",
"bytes": "80"
},
{
"name": "HTML",
"bytes": "2080"
},
{
"name": "JavaScript",
"bytes": "1646"
},
{
"name": "TypeScript",
"bytes": "6394"
}
],
"symlink_target": ""
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.