text
stringlengths 2
14k
| meta
dict |
|---|---|
export default {
// Options.jsx
items_per_page: '/ page',
jump_to: 'Aller à',
jump_to_confirm: 'confirmer',
page: '',
// Pagination.jsx
prev_page: 'Page précédente',
next_page: 'Page suivante',
prev_5: '5 Pages précédentes',
next_5: '5 Pages suivantes',
prev_3: '3 Pages précédentes',
next_3: '3 Pages suivantes',
};
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: 0c53b5ab7f92b4c4abbee54dca09df58
timeCreated: 1445081756
licenseType: Free
TextureImporter:
fileIDToRecycleName: {}
serializedVersion: 2
mipmaps:
mipMapMode: 0
enableMipMap: 0
linearTexture: 1
correctGamma: 0
fadeOut: 0
borderMipMap: 0
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
grayScaleToAlpha: 0
generateCubemap: 0
cubemapConvolution: 0
cubemapConvolutionSteps: 4
cubemapConvolutionExponent: 1.5
seamlessCubemap: 0
textureFormat: -3
maxTextureSize: 2048
textureSettings:
filterMode: -1
aniso: 1
mipBias: -1
wrapMode: 1
nPOTScale: 0
lightmap: 0
rGBM: 0
compressionQuality: 50
allowsAlphaSplitting: 0
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spritePixelsToUnits: 100
alphaIsTransparency: 1
textureType: 2
buildTargetSettings: []
spriteSheet:
sprites: []
outline: []
spritePackingTag:
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
[Reported by leo at 03Apr14:32:42]
search_string:Assertion
search_file:errors
ignore_other_errors:1
full_description:#5412
brief_description:#5412
|
{
"pile_set_name": "Github"
}
|
/** @file st_stuff.cpp Hexen specific HUD and statusbar widgets.
*
* @authors Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2014 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 1999 Activision
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/
#if defined(WIN32) && defined(_MSC_VER)
// Something in here is incompatible with MSVC 2010 optimization.
// Symptom: automap not visible.
# pragma optimize("", off)
# pragma warning(disable : 4748)
#endif
#include "jhexen.h"
#include "st_stuff.h"
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "d_net.h"
#include "d_netsv.h"
#include "dmu_lib.h"
#include "g_common.h"
#include "hu_lib.h"
#include "hu_inventory.h"
#include "hu_stuff.h"
#include "hud/automapstyle.h"
#include "gl_drawpatch.h"
#include "p_inventory.h"
#include "p_mapsetup.h"
#include "p_tick.h" // for Pause_IsPaused
#include "player.h"
#include "r_common.h"
#include "hud/widgets/armorwidget.h"
#include "hud/widgets/automapwidget.h"
#include "hud/widgets/chainwidget.h"
#include "hud/widgets/chatwidget.h"
#include "hud/widgets/flightwidget.h"
#include "hud/widgets/fragswidget.h"
#include "hud/widgets/groupwidget.h"
#include "hud/widgets/healthwidget.h"
#include "hud/widgets/keyswidget.h"
#include "hud/widgets/playerlogwidget.h"
#include "hud/widgets/readyammowidget.h"
#include "hud/widgets/readyitemwidget.h"
#include "hud/widgets/armoriconswidget.h"
#include "hud/widgets/bluemanaiconwidget.h"
#include "hud/widgets/bluemanavialwidget.h"
#include "hud/widgets/bluemanawidget.h"
#include "hud/widgets/bootswidget.h"
#include "hud/widgets/defensewidget.h"
#include "hud/widgets/greenmanaiconwidget.h"
#include "hud/widgets/greenmanavialwidget.h"
#include "hud/widgets/greenmanawidget.h"
#include "hud/widgets/servantwidget.h"
#include "hud/widgets/weaponpieceswidget.h"
#include "hud/widgets/worldtimewidget.h"
using namespace de;
enum
{
UWG_STATUSBAR,
UWG_MAPNAME,
UWG_BOTTOMLEFT,
UWG_BOTTOMRIGHT,
UWG_BOTTOMCENTER,
UWG_BOTTOM,
UWG_TOP,
UWG_TOPCENTER,
UWG_TOPLEFT,
UWG_TOPLEFT2,
UWG_TOPLEFT3,
UWG_TOPRIGHT,
UWG_AUTOMAP,
NUM_UIWIDGET_GROUPS
};
struct hudstate_t
{
dd_bool inited;
dd_bool stopped;
int hideTics;
float hideAmount;
float alpha; ///< Fullscreen hud alpha value.
float showBar; ///< Slide statusbar amount 1.0 is fully open.
dd_bool statusbarActive; ///< Whether the statusbar is active.
int automapCheatLevel; ///< @todo Belongs in player state?
int readyItemFlashCounter;
uiwidgetid_t groupIds[NUM_UIWIDGET_GROUPS];
// Statusbar:
uiwidgetid_t sbarHealthId;
uiwidgetid_t sbarWeaponpiecesId;
uiwidgetid_t sbarBluemanaiconId;
uiwidgetid_t sbarBluemanaId;
uiwidgetid_t sbarBluemanavialId;
uiwidgetid_t sbarGreenmanaiconId;
uiwidgetid_t sbarGreenmanaId;
uiwidgetid_t sbarGreenmanavialId;
uiwidgetid_t sbarKeysId;
uiwidgetid_t sbarArmoriconsId;
uiwidgetid_t sbarChainId;
uiwidgetid_t sbarArmorId;
uiwidgetid_t sbarFragsId;
uiwidgetid_t sbarReadyitemId;
// Fullscreen:
uiwidgetid_t healthId;
uiwidgetid_t fragsId;
uiwidgetid_t bluemanaiconId;
uiwidgetid_t bluemanaId;
uiwidgetid_t greenmanaiconId;
uiwidgetid_t greenmanaId;
uiwidgetid_t readyitemId;
// Other:
uiwidgetid_t automapId;
uiwidgetid_t chatId;
uiwidgetid_t logId;
uiwidgetid_t flightId;
uiwidgetid_t bootsId;
uiwidgetid_t servantId;
uiwidgetid_t defenseId;
uiwidgetid_t worldtimeId;
};
static hudstate_t hudStates[MAXPLAYERS];
static patchid_t pStatusBar;
static patchid_t pStatusBarTop;
static patchid_t pKills;
static patchid_t pStatBar;
static patchid_t pKeyBar;
static patchid_t pInventoryBar;
static patchid_t pWeaponSlot[3]; // [Fighter, Cleric, Mage]
/**
* Draws the whole statusbar backgound.
* @todo There is a whole lot of constants in here. What if someone wants to
* replace the statusbar with new patches?
*/
void SBarBackground_Drawer(HudWidget *wi, Point2Raw const *offset)
{
#define WIDTH (ST_WIDTH)
#define HEIGHT (ST_HEIGHT)
#define ORIGINX int(-WIDTH / 2)
#define ORIGINY int(-HEIGHT * hud->showBar)
DENG2_ASSERT(wi);
hudstate_t const *hud = &hudStates[wi->player()];
int const pClass = cfg.playerClass[wi->player()]; // Original class (i.e. not pig).
int const activeHud = ST_ActiveHud(wi->player());
float const iconOpacity = (activeHud == 0? 1 : uiRendState->pageAlpha * cfg.common.statusbarOpacity);
if(ST_AutomapIsOpen(wi->player()) && cfg.common.automapHudDisplay == 0) return;
if(P_MobjIsCamera(players[wi->player()].plr->mo) && Get(DD_PLAYBACK)) return;
DGL_MatrixMode(DGL_MODELVIEW);
DGL_PushMatrix();
if(offset) DGL_Translatef(offset->x, offset->y, 0);
DGL_Scalef(cfg.common.statusbarScale, cfg.common.statusbarScale, 1);
if(!(
|
{
"pile_set_name": "Github"
}
|
class Admin::CongressMessageCampaignsController < Admin::ApplicationController
before_action :set_congress_message_campaign
allow_collaborators_to :congress_tabulation, :staffer_report
def congress_tabulation
end
def staffer_report
@bioguide_id = params[:bioguide_id]
render "admin/congress_message_campaigns/staffer_report", layout: "admin-blank"
end
private
def set_congress_message_campaign
@congress_message_campaign = CongressMessageCampaign.find(params[:id])
end
end
|
{
"pile_set_name": "Github"
}
|
package com.gameloft9.demo.dataaccess.model.system;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SysMenuTest implements Serializable{
private String id;
private String title;
private String href;
private String requestUrl;
private String code;
private String icon;
private String target;
private String parentId;
private int sort;
private String createUser;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
private String updateUser;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
}
|
{
"pile_set_name": "Github"
}
|
apache-shiro-webapp-tutorial
============================
A [step-by-step tutorial](http://shiro.apache.org/webapp-tutorial.html) showing how to secure a web app with Apache Shiro.
|
{
"pile_set_name": "Github"
}
|
--TEST--
Different calling conventions
--SKIPIF--
<?php
require_once('skipif.inc');
if (substr(PHP_OS, 0, 3) != 'WIN') die('skip for Windows only');
if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platforms only");
?>
--FILE--
<?php
$header = <<<HEADER
void __cdecl cdecl_func(int arg1, double arg2, char arg3);
void __stdcall stdcall_func(int arg1, double arg2, char arg3);
void __fastcall fastcall_func(int arg1, double arg2, char arg3);
HEADER;
$headername = __DIR__ . '/callconv.h';
$dllname = __DIR__ . "/callconv_x86.dll";
$ffi1 = FFI::cdef($header, $dllname);
$ffi1->cdecl_func(1, 2.3, 'a');
$ffi1->stdcall_func(4, 5.6, 'b');
$ffi1->fastcall_func(7, 8.9, 'c');
file_put_contents($headername, "#define FFI_LIB \"$dllname\"\n$header");
$ffi2 = FFI::load($headername);
$ffi2->cdecl_func(2, 3.4, 'a');
$ffi2->stdcall_func(5, 6.7, 'b');
$ffi2->fastcall_func(8, 9.1, 'c');
?>
--EXPECT--
cdecl: 1, 2.300000, a
stdcall: 4, 5.600000, b
fastcall: 7, 8.900000, c
cdecl: 2, 3.400000, a
stdcall: 5, 6.700000, b
fastcall: 8, 9.100000, c
--CLEAN--
<?php
unlink(__DIR__ . '/callconv.h');
?>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Sun Jul 23 15:04:19 2017
@author: zqwu
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from sklearn.kernel_ridge import KernelRidge
import numpy as np
import deepchem as dc
import tempfile
# Only for debug!
np.random.seed(123)
# Load Delaney dataset
n_features = 1024
delaney_tasks, delaney_datasets, transformers = dc.molnet.load_delaney()
train_dataset, valid_dataset, test_dataset = delaney_datasets
metric = dc.metrics.Metric(dc.metrics.pearson_r2_score, np.mean)
def model_builder(model_dir):
sklearn_model = KernelRidge(kernel="rbf", alpha=1e-3, gamma=0.05)
return dc.models.SklearnModel(sklearn_model, model_dir)
model_dir = tempfile.mkdtemp()
model = dc.models.SingletaskToMultitask(delaney_tasks, model_builder, model_dir)
model.fit(train_dataset)
model.save()
print("Evaluating model")
train_scores = model.evaluate(train_dataset, [metric], transformers)
valid_scores = model.evaluate(valid_dataset, [metric], transformers)
print("Train scores")
print(train_scores)
print("Validation scores")
print(valid_scores)
|
{
"pile_set_name": "Github"
}
|
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
],
"paths": {
"angular2-image-upload": [
"dist"
]
}
}
}
|
{
"pile_set_name": "Github"
}
|
// DigitalRune Engine - Copyright (C) DigitalRune GmbH
// This file is subject to the terms and conditions defined in
// file 'LICENSE.TXT', which is part of this source code package.
using System;
using DigitalRune.Geometry.Shapes;
using DigitalRune.Graphics.Rendering;
using Microsoft.Xna.Framework.Graphics;
namespace DigitalRune.Graphics.SceneGraph
{
/// <summary>
/// Represents an instance of a height-field-based terrain.
/// (Not available on these platforms: Xbox 360, mobile platforms)
/// </summary>
/// <remarks>
/// <para>
/// This type is not available on the following platforms: Xbox 360, mobile platforms
/// </para>
/// <para>
/// The <see cref="TerrainNode"/> represents a terrain in the <see cref="Scene"/>. The terrain
/// itself is defined by <see cref="Terrain"/>.
/// </para>
/// <para>
/// <see cref="Terrain"/>s can be shared, i.e. multiple <see cref="TerrainNode"/>s can reference
/// the same <see cref="Terrain"/> instance.
/// </para>
/// <para>
/// <strong>Material:</strong><br/>
/// The terrain node is rendered using a <see cref="Material"/> (similar to a normal
/// <see cref="Mesh"/>). If no custom material is set, a default material is used. The default
/// material supports the render passes "GBuffer" and "Material" used in the deferred lighting
/// samples.
/// </para>
/// <para>
/// <strong>Clipmaps:</strong><br/>
/// The default material renders the terrain using height and material information stored in
/// clipmaps. <see cref="BaseClipmap"/> stores information at the terrain vertex level. It usually
/// provides height, normal and hole information which define the terrain mesh.
/// <see cref="DetailClipmap"/> stores more detailed information which is used to shade the
/// terrain. It usually stores detail normals (for normal mapping), diffuse colors, specular
/// colors, heights (for parallax occlusion mapping) and other material information.
/// </para>
/// <para>
/// <strong>Renderers:</strong><br/>
/// Terrain clipmaps are created and updated (when the camera has moved) by the
/// <see cref="TerrainClipmapRenderer"/>. The <see cref="TerrainRenderer"/> renders
/// <see cref="TerrainNode"/>s to the screen.
/// </para>
/// <para>
/// <strong>Level of detail (LOD):</strong><br/>
/// When the terrain is rendered, the terrain mesh and texture resolution depends on the distance
/// from the camera. When the <see cref="TerrainRenderer"/> renders the terrain, it uses the
/// <see cref="RenderContext.LodCameraNode"/> in the <see cref="RenderContext"/>. (If no
/// <see cref="RenderContext.LodCameraNode"/> is set, the normal
/// <see cref="RenderContext.CameraNode"/> of the render context is used.
/// </para>
/// <para>
/// A terrain node should only be rendered for a single camera node because the renderer might
/// cache camera-dependent LOD data. If a scene contains two camera nodes (e.g. for 2 player
/// split screen rendering), the <see cref="RenderContext.LodCameraNode"/> should be one of these
/// two cameras. It could also be a "virtual" camera, which is e.g. between both player cameras.
/// Switching the cameras within one frame would be inefficient.
/// </para>
/// <para>
/// Alternatively, each camera could use a separate <see cref="TerrainNode"/>. When the image of
/// a camera is rendered only one terrain node should be rendered. Several terrain nodes can
/// reference the same <see cref="Terrain"/> instance.
/// </para>
/// <para>
/// <strong>Terrain shadows:</strong><br/>
/// Terrain nodes can be rendered into the shadow maps. <see cref="SceneNode.CastsShadows"/> is
/// <see langword="true"/> by default. When using the standard <see cref="ShadowCasterQuery"/>,
/// terrain nodes are only rendered into the shadow maps of <see cref="DirectionalLight"/>s.
/// </para>
/// <para>
/// <strong>Cloning:</strong><br/>
/// When a <see cref="TerrainNode"/> is cloned the properties <see cref="Terrain"/> and
/// <see cref="Material"/> are copied by reference (shallow copy). The original and the cloned
/// node will reference the same instances.
/// </para>
/// </remarks>
/// <seealso cref="DigitalRune.Graphics.Terrain"/>
public class TerrainNode : SceneNode
{
// Notes:
// - Base clipmap:
// Format HalfVector4
// (abs. height, world space normal x, world space normal z, hole flag (1 = no hole, like opacity))
// - Detail clipmap:
// Format Color
// (world space normal.x, world space normal.z, specular exponent, hole alpha)
// (diffuse rgb, alpha)
// (specular intensity, height, -, alpha)
// The unused slot could store emissive color. Using emissive for terrain is rare (e.g. could
// be used for glowing lava veins or SciFy-Tron-like glowing lines). Specular color is only
// needed for metals. In most cases specular intensity is enough.
//--------------------------------------------------------------
#region Fields
//--------------------------------------------------------------
#endregion
//--------------------------------------------------------------
#region Properties & Events
//--------------------------------------------------------------
/// <summary>
/// Gets or sets the terrain definition.
/// </summary>
/// <value>The terrain definition.</value>
/// <remarks>
/// <para>
/// Multiple <see cref="TerrainNode"/>s can reference the same <see cref="Terrain"/> instance.
/// </para>
/// </remarks>
public Terrain Terrain { get; private set; }
/// <summary>
/// Gets or sets the base clipmap which stores geometry information at the terrain mesh vertex
/// level.
/// </summary>
/// <value>
/// The base clipmap which stores geometry information at the terrain mesh vertex level.
/// </value>
/// <remarks>
/// <see cref="TerrainNode"/> for more information.
/// </remarks>
/// <exception cref="ArgumentNullException">
/// <paramref name="value"/> is <see langword="null"/>.
/// </exception>
public TerrainClipmap BaseClipmap
{
get { return _baseClipmap; }
set
{
if (value == null)
throw new ArgumentNullException("value");
_baseClipmap = value;
}
}
private TerrainClipmap _baseClipmap;
/// <summary>
/// Gets or sets the detail clipmap which stores material information used to shade the terrain.
/// </summary>
/// <value>
/// The detail clipmap which stores material information used to shade the terrain.
/// </value>
/// <remarks>
/// <see cref="TerrainNode"/> for more information.
/// </remarks>
/// <exception cref="ArgumentNullException">
/// <paramref name="value"/> is <see langword="null"/>.
/// </exception>
public TerrainClipmap DetailClipmap
{
get { return _detailClipmap; }
set
{
if (value == null)
throw new ArgumentNullException("value");
_detailClipmap = value;
}
}
private TerrainClipmap _detailClipmap;
/// <summary>
/// Gets or sets the terrain material.
/// </summary>
/// <value>The terrain material.</value>
/// <exception cref="ArgumentNullException">
/// <paramref name="value"/> is <see langword="null"/>.
/// </exception>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
public Material Material
{
get { return _material; }
set
{
if (value == null)
throw new ArgumentNullException("value");
_material
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.4.2_07) on Wed Jul 06 21:29:01 PDT 2005 -->
<TITLE>
JavaCodingStandardCheckerTokenManager (JCSC API)
</TITLE>
<META NAME="keywords" CONTENT="rj.tools.jcsc.JavaCodingStandardCheckerTokenManager class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="JavaCodingStandardCheckerTokenManager (JCSC API)";
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= 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=3 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/JavaCodingStandardCheckerTokenManager.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="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc"><B>PREV CLASS</B></A>
<A HREF="../../../rj/tools/jcsc/MethodMetric.html" title="class in rj.tools.jcsc"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="JavaCodingStandardCheckerTokenManager.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 | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <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">
rj.tools.jcsc</FONT>
<BR>
Class JavaCodingStandardCheckerTokenManager</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../resources/inherit.gif" ALT="extended by"><B>rj.tools.jcsc.JavaCodingStandardCheckerTokenManager</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc">JavaCodingStandardCheckerConstants</A></DD>
</DL>
<HR>
<DL>
<DT>public class <B>JavaCodingStandardCheckerTokenManager</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerConstants.html" title="interface in rj.tools.jcsc">JavaCodingStandardCheckerConstants</A></DL>
<P>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected char</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#curChar">curChar</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.io.PrintStream</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../rj/tools/jcsc/JavaCodingStandardCheckerTokenManager.html#debugStream">debugStream</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected <A HREF="../../../rj/tools/jcsc/JavaCharStream.html" title="class in rj.tools.jcsc">JavaChar
|
{
"pile_set_name": "Github"
}
|
<header>Adres van servers om te updaten</header>
<p>Dit veld specificeert het oude adres van de servers die worden gemodificeerd.</p>
|
{
"pile_set_name": "Github"
}
|
/*
* freeglut_structure.c
*
* Windows and menus need tree structure
*
* Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved.
* Written by Pawel W. Olszta, <olszta@sourceforge.net>
* Creation date: Sat Dec 18 1999
*
* 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
* PAWEL W. OLSZTA 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 "freeglut.h"
#include "freeglut_internal.h"
/* -- GLOBAL EXPORTS ------------------------------------------------------- */
/*
* The SFG_Structure container holds information about windows and menus
* created between glutInit() and glutMainLoop() return.
*/
SFG_Structure fgStructure = { { NULL, NULL }, /* The list of windows */
{ NULL, NULL }, /* The list of menus */
{ NULL, NULL }, /* Windows to Destroy list */
NULL, /* The current window */
NULL, /* The current menu */
NULL, /* The menu OpenGL context */
NULL, /* The game mode window */
0, /* The current new window ID */
0 }; /* The current new menu ID */
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
static void fghClearCallBacks( SFG_Window *window )
{
if( window )
{
int i;
for( i = 0; i < TOTAL_CALLBACKS; ++i )
window->CallBacks[ i ] = NULL;
}
}
/*
* This private function creates, opens and adds to the hierarchy
* a freeglut window complete with OpenGL context and stuff...
*
* If parent is set to NULL, the window created will be a topmost one.
*/
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
GLboolean positionUse, int x, int y,
GLboolean sizeUse, int w, int h,
GLboolean gameMode, GLboolean isMenu )
{
/* Have the window object created */
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
#if TARGET_HOST_UNIX_X11
window->Window.FBConfig = NULL;
#endif
fghClearCallBacks( window );
/* Initialize the object properties */
window->ID = ++fgStructure.WindowID;
window->State.OldHeight = window->State.OldWidth = -1;
fgListInit( &window->Children );
if( parent )
{
fgListAppend( &parent->Children, &window->Node );
window->Parent = parent;
}
else
fgListAppend( &fgStructure.Windows, &window->Node );
/* Set the default mouse cursor and reset the modifiers value */
window->State.Cursor = GLUT_CURSOR_INHERIT;
window->IsMenu = isMenu;
window->State.IgnoreKeyRepeat = GL_FALSE;
window->State.KeyRepeating = GL_FALSE;
window->State.IsFullscreen = GL_FALSE;
/*
* Open the window now. The fgOpenWindow() function is system
* dependant, and resides in freeglut_window.c. Uses fgState.
*/
fgOpenWindow( window, title, positionUse, x, y, sizeUse, w, h, gameMode,
(GLboolean)(parent ? GL_TRUE : GL_FALSE) );
return window;
}
/*
* This private function creates a menu and adds it to the menus list
*/
SFG_Menu* fgCreateMenu( FGCBMenu menuCallback )
{
int x = 100, y = 100, w = 100, h = 100;
SFG_Window *current_window = fgStructure.CurrentWindow;
/* Have the menu object created */
SFG_Menu* menu = (SFG_Menu *)calloc( sizeof(SFG_Menu), 1 );
menu->ParentWindow = NULL;
/* Create a window for the menu to reside in. */
fgCreateWindow( NULL, "freeglut menu", GL_TRUE, x, y, GL_TRUE, w, h,
GL_FALSE, GL_TRUE );
menu->Window = fgStructure.CurrentWindow;
glutDisplayFunc( fgDisplayMenu );
glutHideWindow( ); /* Hide the window for now */
fgSetWindow( current_window );
/* Initialize the object properties: */
menu->ID = ++fgStructure.MenuID;
menu->Callback = menuCallback;
menu->ActiveEntry = NULL;
fgListInit( &menu->Entries );
fgListAppend( &fgStructure.Menus, &menu->Node );
/* Newly created menus implicitly become current ones */
fgStructure.CurrentMenu = menu;
return menu;
}
/*
* Function to add a window to the linked list of windows to destroy.
* Subwindows are automatically added because they hang from the window
* structure.
*/
void fgAddToWindowDestroyList( SFG_Window* window )
{
SFG_WindowList *new_list_entry =
( SFG_WindowList* )malloc( sizeof(SFG_WindowList ) );
new_list_entry->window = window;
fgListAppend( &fgStructure.WindowsToDestroy, &new_list_entry->node );
/* Check if the window is the current one... */
if( fgStructure.CurrentWindow == window )
fgStructure.CurrentWindow = NULL;
/*
* Clear all window callbacks except Destroy, which will
* be invoked later. Right now, we are potentially carrying
* out a freeglut operation at the behest of a client callback,
* so we are reluctant to re-enter the client with the Destroy
* callback, right now. The others are all wiped out, however,
* to ensure that they are no longer called after this point.
*/
{
FGCBDestroy destroy = (FGCBDestroy)FETCH_WCB( *window, Destroy );
fghClearCallBacks( window );
SET_WCB( *window, Destroy, destroy );
}
}
/*
* Function to close down all the windows in the "WindowsToDestroy" list
*/
void fgCloseWindows( )
{
while( fgStructure.WindowsToDestroy.First )
{
SFG_WindowList *window_ptr = fgStructure.WindowsToDestroy.First;
fgDestroyWindow( window_ptr->window );
fgListRemove( &fgStructure.WindowsToDestroy, &window_ptr->node );
free( window_ptr );
}
}
/*
* This function destroys a window and all of its subwindows. Actually,
* another function, defined in freeglut_window.c is called, but this is
* a whole different story...
*/
void fgDestroyWindow( SFG_Window* window )
{
FREEGLUT_INTERNAL_ERROR_EXIT ( window, "Window destroy function called with null window",
"fgDestroyWindow" );
while( window->Children.First )
fgDestroyWindow( ( SFG_Window * )window->Children.First );
{
SFG_Window *activeWindow = fgStructure.CurrentWindow;
INVOKE_WCB( *window, Destroy, ( ) );
fgSetWindow( activeWindow );
}
if( window->Parent )
fgListRemove(
|
{
"pile_set_name": "Github"
}
|
config BTRFS_FS
tristate "Btrfs filesystem (EXPERIMENTAL) Unstable disk format"
depends on EXPERIMENTAL
select LIBCRC32C
select ZLIB_INFLATE
select ZLIB_DEFLATE
help
Btrfs is a new filesystem with extents, writable snapshotting,
support for multiple devices and many more features.
Btrfs is highly experimental, and THE DISK FORMAT IS NOT YET
FINALIZED. You should say N here unless you are interested in
testing Btrfs with non-critical data.
To compile this file system support as a module, choose M here. The
module will be called btrfs.
If unsure, say N.
config BTRFS_FS_POSIX_ACL
bool "Btrfs POSIX Access Control Lists"
depends on BTRFS_FS
select FS_POSIX_ACL
help
POSIX Access Control Lists (ACLs) support permissions for users and
groups beyond the owner/group/world scheme.
To learn more about Access Control Lists, visit the POSIX ACLs for
Linux website <http://acl.bestbits.at/>.
If you don't know what Access Control Lists are, say N
|
{
"pile_set_name": "Github"
}
|
// Module included in the following assemblies:
//
// * virt/virt-using-the-cli-tools.adoc
[id="virt-openshift-client-commands_{context}"]
= {product-title} client commands
The {product-title} `oc` client is a command-line utility for managing
{product-title} resources, including the virtual machine (`vm`) and virtual
machine instance (`vmi`) object types. +
[NOTE]
====
You can use the `-n <namespace>` flag to specify a different project.
====
.`oc` commands
[width="100%",cols="42%,58%",options="header",]
|===
|Command |Description
|`oc login -u <user_name>`
|Log in to the {product-title} cluster as `<user_name>`.
|`oc get <object_type>`
|Display a list of objects for the specified object type in the current project.
|`oc describe <object_type> <resource_name>`
|Display details of the specific resource in the current project.
|`oc create -f <object_config>`
|Create a resource in the current project from a filename or from stdin.
|`oc edit <object_type> <resource_name>`
|Edit a resource in the current project.
|`oc delete <object_type> <resource_name>`
|Delete a resource in the current project.
|===
|
{
"pile_set_name": "Github"
}
|
//
// LMJCircleLayout.h
// 自定义流水布局-22
//
// Created by apple on 16/7/30.
// Copyright © 2016年 NJHu. All rights reserved.
//
#import <UIKit/UIKit.h>
@class LMJCircleLayout;
@protocol LMJCircleLayoutDelegate <NSObject>
@optional
/**
返回 item 的大小, 默认 64
*/
- (CGSize)circleLayout:(LMJCircleLayout *)circleLayout collectionView:(UICollectionView *)collectionView sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
/**
返回 item 对应的半径 , 默认120
*/
- (CGFloat)circleLayout:(LMJCircleLayout *)circleLayout collectionView:(UICollectionView *)collectionView radiusForItemAtIndexPath:(NSIndexPath *)indexPath;
@end
@interface LMJCircleLayout : UICollectionViewLayout
- (instancetype)initWithDelegate:(id<LMJCircleLayoutDelegate>)delegate;
+ (instancetype)circleLayoutWithDelegate:(id<LMJCircleLayoutDelegate>)delegate;
@end
|
{
"pile_set_name": "Github"
}
|
<!doctype html>
<html>
<head>
<script type="text/javascript" src="../../js/case.js"></script>
<?php include __DIR__ . '/../../include.php'; ?>
</head>
<body class="simple">
<script type="text/javascript">
rangy.init();
function clickCancelDialogButton() {
$('.raptor-ui-cancel-dialog .ui-dialog-buttonpane .ui-button:eq(0)').trigger('click');
}
</script>
<div class="test-1">
<h1>Cancel Formatting Button 1: Basic</h1>
<div class="test-input">
<div class="editable">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui id <strong class="cms-bold">erat pellentesque</strong> et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique. Aliquam gravida mauris at
ligula {venenatis rhoncus. Suspendisse interdum, nisi nec consectetur
pulvinar, lorem augue ornare felis}, vel lacinia erat nibh in velit.
</p>
</div>
</div>
<div class="test-expected">
<div class="editable">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui id <strong class="cms-bold">erat pellentesque</strong> et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique. Aliquam gravida mauris at
ligula {venenatis rhoncus. Suspendisse interdum, nisi nec consectetur
pulvinar, lorem augue ornare felis}, vel lacinia erat nibh in velit.
</p>
</div>
</div>
</div>
<script type="text/javascript">
testEditor('.test-1', function(input) {
clickButton(input, '.raptor-ui-text-italic');
clickButton(input, '.raptor-ui-cancel');
clickCancelDialogButton();
});
</script>
<div class="test-2">
<h1>Cancel Formatting Button 2: Complex</h1>
<div class="test-input">
<div class="editable">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique. Aliquam gravida mauris at
ligula {venenatis rhoncus. Suspendisse interdum, nisi nec consectetur
pulvinar, lorem augue ornare felis}, vel lacinia erat nibh in velit.
</p>
</div>
</div>
<div class="test-expected">
<div class="editable">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique. Aliquam gravida mauris at
ligula {venenatis rhoncus. Suspendisse interdum, nisi nec consectetur
pulvinar, lorem augue ornare felis}, vel lacinia erat nibh in velit.
</p>
</div>
</div>
</div>
<script type="text/javascript">
testEditor('.test-2', function(input) {
clickButton(input, '.raptor-ui-text-italic');
clickButton(input, '.raptor-ui-align-center');
clickButton(input, '.raptor-ui-cancel');
clickCancelDialogButton();
});
</script>
<div class="test-3">
<h1>Cancel Formatting Button 3: Multi Paragraph Basic</h1>
<div class="test-input">
<div class="editable">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui {<strong class="cms-bold">id erat pellentesque et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique.</strong>
</p>
<p>
<strong class="cms-bold">Aliquam gravida mauris at
ligula venenatis rhoncus. Suspendisse</strong>} interdum, nisi nec consectetur
pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit.
</p>
</div>
</div>
<div class="test-expected">
<div class="editable">
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui {<strong class="cms-bold">id erat pellentesque et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique.</strong>
</p>
<p>
<strong class="cms-bold">Aliquam gravida mauris at
ligula venenatis rhoncus. Suspendisse</strong>} interdum, nisi nec consectetur
pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit.
</p>
</div>
</div>
</div>
<script type="text/javascript">
testEditor('.test-3', function(input) {
clickButton(input, '.raptor-ui-text-strike');
clickButton(input, '.raptor-ui-cancel');
clickCancelDialogButton();
});
</script>
<div class="test-4">
<h1>Cancel Formatting Button 4: Multi Paragraph Complex</h1>
<div class="test-input">
<div class="editable">
<p>
Lorem ipsum {dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique.
</p>
<p>
Aliquam gravida mauris at
ligula venenatis rhoncus. Suspendisse <u class="underline">interdum, nisi</u>} nec consectetur
pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit.
</p>
</div>
</div>
<div class="test-expected">
<div class="editable">
<p>
Lorem ipsum {dolor sit amet, consectetur adipiscing elit. Maecenas
convallis dui id erat pellentesque et rhoncus nunc semper. Suspendisse
malesuada hendrerit velit nec tristique.
</p>
<p>
Aliquam gravida mauris at
ligula venenatis rhoncus. Suspendisse <u class="underline">interdum, nisi</u>} nec consectetur
pulvinar, lorem augue ornare felis, vel lacinia erat nibh in velit.
</p>
</div>
</div>
</div>
<script type="text/javascript">
testEditor('.test-4', function(input) {
clickButton(input, '.raptor-ui-align-right');
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
import { getStoreStateMessage, Messages } from '../../common/messages';
import { StoreNames } from '../../common/stores/store-names';
import { ScopingActions, ScopingPayload } from '../actions/scoping-actions';
import { Interpreter } from '../interpreter';
export class ScopingActionCreator {
constructor(
private readonly interpreter: Interpreter,
private readonly scopingActions: ScopingActions,
) {}
public registerCallback(): void {
this.interpreter.registerTypeToPayloadCallback(
getStoreStateMessage(StoreNames.ScopingPanelStateStore),
this.onGetScopingState,
);
this.interpreter.registerTypeToPayloadCallback(
Messages.Scoping.AddSelector,
this.onAddSelector,
);
this.interpreter.registerTypeToPayloadCallback(
Messages.Scoping.DeleteSelector,
this.onDeleteSelector,
);
}
private onGetScopingState = (): void => {
this.scopingActions.getCurrentState.invoke(null);
};
private onAddSelector = (payload: ScopingPayload): void => {
this.scopingActions.addSelector.invoke(payload);
};
private onDeleteSelector = (payload: ScopingPayload): void => {
this.scopingActions.deleteSelector.invoke(payload);
};
}
|
{
"pile_set_name": "Github"
}
|
import UIKit
import Photos
public protocol CartDelegate: class {
func cart(_ cart: Cart, didAdd image: Image, newlyTaken: Bool)
func cart(_ cart: Cart, didRemove image: Image)
func cartDidReload(_ cart: Cart)
}
/// Cart holds selected images and videos information
public class Cart {
public var images: [Image] = []
public var video: Video?
var delegates: NSHashTable<AnyObject> = NSHashTable.weakObjects()
// MARK: - Initialization
init() {
}
// MARK: - Delegate
public func add(delegate: CartDelegate) {
delegates.add(delegate)
}
// MARK: - Logic
public func add(_ image: Image, newlyTaken: Bool = false) {
guard !images.contains(image) else { return }
images.append(image)
for case let delegate as CartDelegate in delegates.allObjects {
delegate.cart(self, didAdd: image, newlyTaken: newlyTaken)
}
}
public func remove(_ image: Image) {
guard let index = images.firstIndex(of: image) else { return }
images.remove(at: index)
for case let delegate as CartDelegate in delegates.allObjects {
delegate.cart(self, didRemove: image)
}
}
public func reload(_ images: [Image]) {
self.images = images
for case let delegate as CartDelegate in delegates.allObjects {
delegate.cartDidReload(self)
}
}
// MARK: - Reset
public func reset() {
video = nil
images.removeAll()
delegates.removeAllObjects()
}
}
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright 2014 Google Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef OS_CPU_LINUX_PPC_BYTES_LINUX_PPC_INLINE_HPP
#define OS_CPU_LINUX_PPC_BYTES_LINUX_PPC_INLINE_HPP
#if defined(VM_LITTLE_ENDIAN)
#include <byteswap.h>
// Efficient swapping of data bytes from Java byte
// ordering to native byte ordering and vice versa.
inline u2 Bytes::swap_u2(u2 x) { return bswap_16(x); }
inline u4 Bytes::swap_u4(u4 x) { return bswap_32(x); }
inline u8 Bytes::swap_u8(u8 x) { return bswap_64(x); }
#endif // VM_LITTLE_ENDIAN
#endif // OS_CPU_LINUX_PPC_BYTES_LINUX_PPC_INLINE_HPP
|
{
"pile_set_name": "Github"
}
|
require "formula"
class Iker < Formula
homepage "https://labs.portcullis.co.uk/tools/iker/"
url "https://labs.portcullis.co.uk/download/iker_v1.1.tar"
sha256 "8780805a0743f60e42ec75dd56dcdb8beb1fdafc75aab6dcdac7ba13e126e7b6"
version "1.1"
revision 2
depends_on "ike-scan"
def install
libexec.install "iker.py"
(bin/"iker.py").write <<~EOS
#!/bin/sh
/usr/bin/env python #{libexec}/iker.py "$@"
EOS
end
end
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python2
# This code was written 10 hours before the competition, yikes
# Any bugs are your problem
import socks # pip install PySocks
import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, '127.0.0.1', 4444)
socket.socket = socks.socksocket
from pwn import * # pip install pwntools
from swpag_client import Team # pip install swpag_client
import time
import traceback
import json
import sys
team = Team(None, "xxxxxxxxxxxxxxxxxxx")
def team_ip(team_host):
# 172.31.129.1 (team1) ... 172.31.129.254 (team254) ... 172.31.130.1 (team255) ...
team_number = int(team_host[4:])
minor = ((team_number - 1) % 254) + 1
major = (team_number / 255) + 129
return '172.31.{major}.{minor}'.format(major=major, minor=minor)
services = team.get_service_list()
service_flag_ids = dict()
while True:
for service in services:
if service['service_name'] != 'fantasticiot':
continue
print("Going to attack", service['service_name'])
if service['service_name'] not in service_flag_ids:
service_flag_ids[service['service_name']] = set()
targets = team.get_targets(service['service_id'])
flag_list = []
for target in targets:
flag_id = target['flag_id']
ip = team_ip(target['hostname'])
port = target['port']
if flag_id not in service_flag_ids[service['service_name']]:
try:
coinn = remote(ip, port, timeout=1)
# exploitation happens here
conn.sendline('{"service": "flag", "op": "getflag", "id": "%s", "token": ""}' % flag_id)
flag = json.loads(conn.recv().strip())['flag']
conn.close()
flag_list.append(flag)
print("HACKED")
except Exception as e:
print("Error connecting to", target['team_name'], target['hostname'], ip, port)
print(e)
service_flag_ids[service['service_name']].add(flag_id)
result = team.submit_flag(flag_list)
print result
time.sleep(10) # DOS is against the rules
|
{
"pile_set_name": "Github"
}
|
// Copyright 2019 The MediaPipe Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef MEDIAPIPE_FRAMEWORK_PACKET_TYPE_H_
#define MEDIAPIPE_FRAMEWORK_PACKET_TYPE_H_
#include <map>
#include <memory>
#include <set>
#include <string>
#include <typeinfo>
#include <vector>
#include "absl/base/macros.h"
#include "absl/strings/str_split.h"
#include "mediapipe/framework/collection.h"
#include "mediapipe/framework/packet.h"
#include "mediapipe/framework/packet_set.h"
#include "mediapipe/framework/port/status.h"
#include "mediapipe/framework/tool/validate_name.h"
#include "mediapipe/framework/type_map.h"
namespace mediapipe {
// Encapsulates the type and description of an input stream, output
// stream, or input side packet. The type to expect is set with Set<type>()
// and a packet is validated with Validate(). The PacketType can be
// set to indicate the same type as some other PacketType.
class PacketType {
public:
// Creates an uninitialized PacketType.
PacketType();
PacketType(const PacketType&) = delete;
PacketType& operator=(const PacketType&) = delete;
// False for a PacketType that has not had any Set*() function called.
bool IsInitialized() const;
// The following "Set*" functions initialize the PacketType. They can
// be called any number of times; the PacketType is initialized to
// whatever the last call is.
// Sets the packet type to accept the provided type.
template <typename T>
PacketType& Set();
// Sets the packet type to accept packets of any type. If an input or
// output stream is set to this type then the framework tries to infer
// the stream type based on the packet types of other Calculators.
// Specifically, using SetAny() still means that the stream has a type
// but this particular calculator just doesn't care what it is.
PacketType& SetAny();
// Sets the packet type to not accept any packets.
PacketType& SetNone();
// Sets the PacketType to be the same as type. This actually stores
// the pointer to the other PacketType but does not acquire ownership.
// "type" must outlive this object.
PacketType& SetSameAs(const PacketType* type);
// Marks this port as optional.
PacketType& Optional();
// Returns a pointer to the root PacketType of the "same as" equivalence
// class.
const PacketType* GetSameAs() const;
PacketType* GetSameAs();
// Returns true if this PacketType allows anything.
bool IsAny() const;
// Returns true if this PacketType allows nothing.
bool IsNone() const;
bool IsOptional() const { return optional_; }
// Returns true iff this and other are consistent, meaning they do
// not expect different types. IsAny() is consistent with anything.
// IsNone() is only consistent with IsNone() and IsAny().
bool IsConsistentWith(const PacketType& other) const;
// Returns OK if the packet contains an object of the appropriate type.
::mediapipe::Status Validate(const Packet& packet) const;
// Returns a pointer to the Registered type name, or nullptr if the type
// is not registered. Do not use this for validation, use Validate()
// instead.
const std::string* RegisteredTypeName() const;
// Returns the type name. Do not use this for validation, use
// Validate() instead.
const std::string DebugTypeName() const;
private:
// Typedef for the ValidateAsType() method in Packet that is used for
// type validation and identification.
typedef ::mediapipe::Status (Packet::*ValidateMethodType)() const;
// Records whether the packet type was set in any way.
bool initialized_;
// Don't allow any packets through.
bool no_packets_allowed_;
// Pointer to Packet::ValidateAsType<T>.
ValidateMethodType validate_method_;
// Type name as std::string.
std::string type_name_;
// The Registered type name or nullptr if the type isn't registered.
const std::string* registered_type_name_ptr_ = nullptr;
// If this is non-null then this PacketType is the same as same_as_.
// We don't do union-find optimizations in order to avoid a mutex.
const PacketType* same_as_;
// Whether the corresponding port is optional.
bool optional_ = false;
};
// An error handler class which allows a PacketTypeSet to return valid
// results while deferring errors.
//
// This class is thread compatible.
class PacketTypeSetErrorHandler {
public:
// Returns a usable PacketType. A different PacketType object is
// returned for each different invalid location and the same object
// is returned for multiple accesses to the same invalid location.
PacketType& GetFallback(const std::string& tag, int index) {
if (!missing_) {
missing_ = absl::make_unique<Missing>();
}
CHECK(!missing_->initialized_errors);
std::string key = absl::StrCat(tag, ":", index);
return missing_->entries[key];
}
// In the const setting produce a FATAL error.
const PacketType& GetFallback(const std::string& tag, int index) const {
LOG(FATAL) << "Failed to get tag \"" << tag << "\" index " << index
<< ". Unable to defer error due to const specifier.";
std::abort();
}
// Returns true if a (deferred) error has been recorded by the
// PacketTypeSet.
bool HasError() const { return missing_ != nullptr; }
// Get the error messages that have been deferred.
// This function can only be called if HasError() is true.
const std::vector<std::string>& ErrorMessages() const {
CHECK(missing_) << "ErrorMessages() can only be called if errors have "
"occurred. Call HasError() before calling this "
"function.";
if (!missing_->initialized_errors) {
for (const auto& entry : missing_->entries) {
// Optional entries that were missing are not considered errors.
if (!entry.second.IsOptional()) {
// Split them to keep the error std::string unchanged.
std::pair<std::string, std::string> tag_idx =
absl::StrSplit(entry.first, ':');
missing_->errors.push_back(absl::StrCat("Failed to get tag \"",
tag_idx.first, "\" index ",
tag_idx.second));
}
}
missing_->initialized_errors = true;
}
return missing_->errors;
}
private:
struct Missing {
// Mapping from TAG:index to PacketType objects, one for each invalid
// location that has been accessed.
std::map<std::string, PacketType> entries;
// The list of errors is only computed at the end.
std::vector<std::string> errors;
bool initialized_errors = false;
};
// Initialize lazily to save space in the common no-error case.
std::unique_ptr<Missing> missing_;
};
// A collection of PacketTypes. The types are either retrieved by index
// or by tag. The calculator must set a type for every input stream and
// input side packet that it accepts and every output stream it produces.
// Every (non-const) function in this class always returns valid values
// that can be used directly without error checking. If the types don't
// match what the user provided then an error
|
{
"pile_set_name": "Github"
}
|
Thumper References
==================
This folder contains local copies of certain important references. It is not necessary to
populate this folder but you may find it convenient to do so. These references are not included
in the repository because they are not artifacts of this project.
There are several RFCs of interest.
+ [RFC-3161](http://www.rfc-editor.org/rfc/rfc3161.txt) Internet X.509 Public Key Infrastructure
Time-Stamp Protocol (TSP). This is the primary RFC that describes the protocol implemented by
Thumper.
+ [RFC-3370](http://www.rfc-editor.org/rfc/rfc3370.txt) Cryptographic Message Syntax (CMS)
Algorithms. Information about specific algorithms has been split off from the description of
CMS itself. This allows the IETF to update to the two documents independently. This RFC is the
latest CMS algorithms document (but see the update in RFC-5754).
+ [RFC-5652](http://www.rfc-editor.org/rfc/rfc5652.txt) Cryptographic Message Syntax (CMS). CMS
describes the specific way in which encrypted and digitally signed data is represented in
various IETF standards (including TSP).
+ [RFC-5754](http://www.rfc-editor.org/rfc/rfc5754.txt) Using SHA2 Algorithms with Cryptographic
Message Syntax. This RFC updates RFC-3370 by providing details on using the SHA2 algorithm
with CMS.
+ [RFC-5816](http://www.rfc-editor.org/rfc/rfc5816.txt) ESSCertIDv2 Update for RFC 3161.
Here are some papers related to this project.
+ [Design and Implementation of a RFC3161-Enhanced Time-Stamping Service](http://crypto.nknu.edu.tw/publications/2004IWAP.pdf)
by Chung-Huang Yang, Chih-Ching Yeh, and Fang-Dar Chu.
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* 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 TencentCloud.Tsf.V20180326.Models
{
using Newtonsoft.Json;
using System.Collections.Generic;
using TencentCloud.Common;
public class DeletePkgsRequest : AbstractModel
{
/// <summary>
/// 应用ID
/// </summary>
[JsonProperty("ApplicationId")]
public string ApplicationId{ get; set; }
/// <summary>
/// 需要删除的程序包ID列表
/// </summary>
[JsonProperty("PkgIds")]
public string[] PkgIds{ get; set; }
/// <summary>
/// 程序包仓库类型
/// </summary>
[JsonProperty("RepositoryType")]
public string RepositoryType{ get; set; }
/// <summary>
/// 程序包仓库id
/// </summary>
[JsonProperty("RepositoryId")]
public string RepositoryId{ get; set; }
/// <summary>
/// For internal usage only. DO NOT USE IT.
/// </summary>
internal override void ToMap(Dictionary<string, string> map, string prefix)
{
this.SetParamSimple(map, prefix + "ApplicationId", this.ApplicationId);
this.SetParamArraySimple(map, prefix + "PkgIds.", this.PkgIds);
this.SetParamSimple(map, prefix + "RepositoryType", this.RepositoryType);
this.SetParamSimple(map, prefix + "RepositoryId", this.RepositoryId);
}
}
}
|
{
"pile_set_name": "Github"
}
|
<!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) on Thu Sep 29 14:31:09 EDT 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository (appsensor-parent 2.3.0 API)</title>
<meta name="date" content="2016-09-29">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository (appsensor-parent 2.3.0 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="header">
<h2 title="Uses of Class org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository" class="title">Uses of Class<br>org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository</h2>
</div>
<div class="classUseContainer">No usage of org.owasp.appsensor.integration.springsecurity.context.AppSensorSecurityContextRepository</div>
<p class="legalCopy"><small>Copyright © 2016 <a href="http://www.owasp.org">The Open Web Application Security Project (OWASP)</a>. All rights reserved.</small></p>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<!-- Basic Page Info -->
<meta charset="utf-8">
<title>DeskApp - Bootstrap Admin Dashboard HTML Template</title>
<!-- Site favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="vendors/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="vendors/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="vendors/images/favicon-16x16.png">
<!-- Mobile Specific Metas -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Google Font -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="vendors/styles/core.css">
<link rel="stylesheet" type="text/css" href="vendors/styles/icon-font.min.css">
<link rel="stylesheet" type="text/css" href="vendors/styles/style.css">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-119386393-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-119386393-1');
</script>
</head>
<body>
<div class="pre-loader">
<div class="pre-loader-box">
<div class="loader-logo"><img src="vendors/images/deskapp-logo.svg" alt=""></div>
<div class='loader-progress' id="progress_div">
<div class='bar' id='bar1'></div>
</div>
<div class='percent' id='percent1'>0%</div>
<div class="loading-text">
Loading...
</div>
</div>
</div>
<div class="header">
<div class="header-left">
<div class="menu-icon dw dw-menu"></div>
<div class="search-toggle-icon dw dw-search2" data-toggle="header_search"></div>
<div class="header-search">
<form>
<div class="form-group mb-0">
<i class="dw dw-search2 search-icon"></i>
<input type="text" class="form-control search-input" placeholder="Search Here">
<div class="dropdown">
<a class="dropdown-toggle no-arrow" href="#" role="button" data-toggle="dropdown">
<i class="ion-arrow-down-c"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<div class="form-group row">
<label class="col-sm-12 col-md-2 col-form-label">From</label>
<div class="col-sm-12 col-md-10">
<input class="form-control form-control-sm form-control-line" type="text">
</div>
</div>
<div class="form-group row">
<label class="col-sm-12 col-md-2 col-form-label">To</label>
<div class="col-sm-12 col-md-10">
<input class="form-control form-control-sm form-control-line" type="text">
</div>
</div>
<div class="form-group row">
<label class="col-sm-12 col-md-2 col-form-label">Subject</label>
<div class="col-sm-12 col-md-10">
<input class="form-control form-control-sm form-control-line" type="text">
</div>
</div>
<div class="text-right">
<button class="btn btn-primary">Search</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<div class="header-right">
<div class="dashboard-setting user-notification">
<div class="dropdown">
<a class="dropdown-toggle no-arrow" href="javascript:;" data-toggle="right-sidebar">
<i class="dw dw-settings2"></i>
</a>
</div>
</div>
<div class="user-notification">
<div class="dropdown">
<a class="dropdown-toggle no-arrow" href="#" role="button" data-toggle="dropdown">
<i class="icon-copy dw dw-notification"></i>
<span class="badge notification-active"></span>
</a>
<div class="dropdown-menu dropdown-menu-right">
<div class="notification-list mx-h-350 customscroll">
<ul>
<li>
<a href="#">
<img src="vendors/images/img.jpg" alt="">
<h3>John Doe</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...</p>
</a>
</li>
<li>
<a href="#">
<img src="vendors/images/photo1.jpg" alt="">
<h3>Lea R. Frith</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...</p>
</a>
</li>
<li>
<a href="#">
<img src="vendors/images/photo2.jpg" alt="">
<h3>Erik L. Richards</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...</p>
</a>
</li>
<li>
<a href="#">
<img src="vendors/images/photo3.jpg" alt="">
<h3>John Doe</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...</p>
</a>
</li>
<li>
<a href="#">
<img src="vendors/images/photo4.jpg" alt="">
<h3>Renee I. Hansen</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...</p>
</a>
</li>
<li>
<a href="#">
<img src="vendors/images/img.jpg" alt="">
<h3>Vicki M. Coleman</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed...</p>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="user-info-dropdown">
<div class="dropdown">
<a class="dropdown-toggle" href="#" role="button" data-toggle="dropdown">
<span class="user-icon">
<img src="vendors/images/photo1.jpg" alt="">
</span>
<span class="user-name">Ross C. Lopez</span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-icon-list">
<a class="dropdown-item" href="profile.html"><i class="dw dw-user1"></i> Profile</a>
<a class="dropdown-item" href="profile.html"><i class="dw dw-settings2"></i> Setting</a>
<a class="dropdown-item" href="faq
|
{
"pile_set_name": "Github"
}
|
tommy lee jones chases an innocent victim around america who is trying to prove that she did not kill her spouse .
the fugitive ?
not quite ? this is the plot for double jeopardy , another fugitive copycat without the action , excitement , and good acting that the original had .
there are other slight differences besides one movie being bad and the other good ; this time tommy lee jones plays a parole officer not a us marshall , clever huh ?
oh and the fugitive ashley judd was framed by her own husband ( bruce greenwood ) who needed to collect two million dollars in life insurance money not a one armed man .
both movies are on video .
make the wise choice and pick the fugitive .
there are so many flaws in double jeopardy , it is laughable .
while serving time in prison , libby parsons ( judd ) discovers that she can never be charged for committing the same crime twice .
learning that her husband is still alive , she decides to serve her time in prison , find him , retrieve her son , and kill her husband if necessary .
when the strict parole officer travis lehman ( jones ) stands in her way , libby decides to break the rules ( who knows why ? ) and continue her plan , despite the fact that if she gets caught , she's going back to jail .
director bruce beresford spends way too much time trying to convince the audience that libby misses her son .
every other scene , we are given a shot of libby staring and crying at his picture .
in an action movie like this , valuable time wasted on these shots takes away more opportunities for libby to get up and do something .
all that is needed in this type of movie is a short scene in which libby tells herself or a friend " i miss my son . "
nothing more , nothing less .
dr . kimble of the fugitive didn't look at one picture of his dead wife , his primary concern was to save himself .
libby at times shows this same determination but not nearly enough .
ashley judd and bruce greenwood both are excellent actors but if they continue to do movies like this , they will be typecast for the rest of their careers , kind of like their doomed co-star tommy lee jones .
winning an oscar for the fugitive must have convinced jones that audiences will never get tired of his i-do-my-job-whether-they-are-innocent-or-guilty roles .
people still pay to see his movies and he makes plenty of money so i guess he was right .
though i don't think he will win another oscar again .
the ultimate mistake in the script is what eventually becomes of libby parsons .
even if she was excused for disobeying her parole officer , the number of other crimes she commits while on the run are too numerous to count .
burglary , assault , grand theft auto are some of libby's slipups .
the message of the movie is you can break all of the small laws as long as you're innocent of the major crime .
hopefully criminals won't use double jeopardy as a reference in court for why they are innocent .
that would just be plain stupid .
|
{
"pile_set_name": "Github"
}
|
# Simp
**This page has moved to the
[leanprover-community website](https://leanprover-community.github.io/extras/simp.html).**
|
{
"pile_set_name": "Github"
}
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef EXTENSIONS_BROWSER_BLOCKED_ACTION_TYPE_H_
#define EXTENSIONS_BROWSER_BLOCKED_ACTION_TYPE_H_
namespace extensions {
// Types of actions that an extension can perform that can be blocked (typically
// while waiting for user action).
enum BlockedActionType {
BLOCKED_ACTION_NONE = 0,
BLOCKED_ACTION_SCRIPT_AT_START = 1 << 0,
BLOCKED_ACTION_SCRIPT_OTHER = 1 << 1,
BLOCKED_ACTION_WEB_REQUEST = 1 << 2,
};
} // namespace extensions
#endif // EXTENSIONS_BROWSER_BLOCKED_ACTION_TYPE_H_
|
{
"pile_set_name": "Github"
}
|
int printf(char *fmt);
int fred() {
return(5);
}
void main() {
int x;
x= fred(2);
printf("%d\n", x);
}
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_8.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
createResults();
/* @license-end */
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
/* @license-end */
--></script>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
const assert = require('assert');
module.exports = {
description: 'allows to read and modify options in the options hook',
options: {
input: 'unused',
treeshake: false,
plugins: {
name: 'test-plugin',
buildStart(options) {
assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), {
acorn: {
allowAwaitOutsideFunction: true,
ecmaVersion: 2020,
preserveParens: false,
sourceType: 'module'
},
acornInjectPlugins: [null, null, null],
context: 'undefined',
experimentalCacheExpiry: 10,
input: ['used'],
perf: false,
plugins: [
{
name: 'test-plugin'
}
],
preserveEntrySignatures: 'strict',
preserveSymlinks: false,
shimMissingExports: false,
strictDeprecations: true,
treeshake: false
});
assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion));
assert.strictEqual(this.meta.watchMode, false);
},
options(options) {
assert.deepStrictEqual(JSON.parse(JSON.stringify(options)), {
input: 'unused',
plugins: {
name: 'test-plugin'
},
strictDeprecations: true,
treeshake: false
});
assert.ok(/^\d+\.\d+\.\d+/.test(this.meta.rollupVersion));
assert.strictEqual(this.meta.watchMode, false);
return Object.assign({}, options, { input: 'used' });
}
}
}
};
|
{
"pile_set_name": "Github"
}
|
<Application
x:Class="SampleApp.WinPhone.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">
<!--Application Resources-->
<Application.Resources>
<local:LocalizedStrings xmlns:local="clr-namespace:SampleApp.WinPhone" x:Key="LocalizedStrings"/>
</Application.Resources>
<Application.ApplicationLifetimeObjects>
<!--Required object that handles lifetime events for the application-->
<shell:PhoneApplicationService
Launching="Application_Launching" Closing="Application_Closing"
Activated="Application_Activated" Deactivated="Application_Deactivated"/>
</Application.ApplicationLifetimeObjects>
</Application>
|
{
"pile_set_name": "Github"
}
|
---
title: Changing the root password on a Linux dedicated server
slug: root-password
excerpt: This guide will show you how to change the root password on a Linux dedicated server.
section: Server Management
---
**Last updated 20th June 2018**
## Objective
When you install or reinstall a distribution or operating system, you are given a root access password. We strongly recommend that you change it, as detailed in our guide to [securing a Dedicated Server](https://docs.ovh.com/gb/en/dedicated/securing-a-dedicated-server/#change-the-password-associated-with-the-root-user){.external}. You may also find that you have lost this password, and need to change it.
**This guide will take you through both scenarios and show you how to change the root password of your sever.**
## Requirements
* a [dedicated server](https://www.ovh.co.uk/dedicated_servers/){.external}
* administrative (root) access to the server via SSH
* access to the [OVH Control Panel](https://www.ovh.com/auth/?action=gotomanager){.external}
## Instructions
### Changing the password with root access
If you have root access with your current password and simply want to change it, then establish an SSH connection to the server via the command line and type the following command:
```sh
# passwd
```
Next, enter your new password twice, as shown below:
```sh
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
```
> [!primary]
>
> Please note that on a Linux distribution, the characters of your password **will not appear** as you type them.
>
### Changing a password after you have lost it
#### Step 1: Identify the system partition
After putting your server into [rescue mode](https://docs.ovh.com/gb/en/dedicated/rescue_mode/){.external}, you will need to identify the system partition. You can do this with the following command:
```sh
# fdisk -l
Disk /dev/hda 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 1305 10482381 83 Linux
/dev/hda2 1306 4800 28073587+ 83 Linux
/dev/hda3 4801 4865 522112+ 82 Linux swap / Solaris
Disk /dev/sda 8254 MB, 8254390272 bytes
16 heads, 32 sectors/track, 31488 cylinders
Units = cylinders of 512 * 512 = 262144 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 31488 8060912 c W95 FAT32 (LBA)
```
In the example above, the system partition is /dev/hda1.
> [!primary]
>
If your server has a RAID configuration, you will need to mount your raid volume.
- If you are using Softraid, your root partition will be /dev/mdX
- If you are using Hardraid, your root partition will be /dev/sdX
>
#### Step 2: Mount the system partition
Once you've identified the system partition, you can mount it with the following command:
```sh
# mount /dev/hda1 /mnt/
```
#### Step 3: Edit the root partition
The system partition is locked for editing by default so you'll need to open it for write access, which you can do with the following command:
```sh
# chroot /mnt
```
#### Step 4: Change the root password
The final step is to change the password with the following command:
```sh
# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
```
When this is done, change the boot mode on your server back to `boot from hard disk`{.action} and restart it. Your root password will now be changed.
## Go further
Join our community of users on <https://community.ovh.com/en/>.
|
{
"pile_set_name": "Github"
}
|
* master
- Fixed a regression that appears when executing an =org-mode= source
block of a previously created session. A new connection to the
session was being created before execution instead of using the old
connection. See #240.
- Fixed regression due to uppercase characters in kernel language
names, e.g. R. =emacs-jupyter= would not work at all with language
specific features.
* v0.8.2
- Fix recursive loading error caused by =jupyter-tramp.el= autoloads.
- Consider kernelspecs with spaces and uppercase characters in the kernel's
language name.
- In =org-mode=, fixed a bug where inline results where being displayed
differently from what they would have been when the results are not inline.
- When =jupyter-repl-echo-eval-p= is non-nil, ensure that any cell code not sent
to a kernel yet is preserved.
- In =org-mode=, fix a bug where if the =:session= header argument of Jupyter
source blocks is a relative file name with a =.json= suffix
and =default-directory= is a remote directory, a file on the local machine
would be read.
- Use =org-babel-jupyter-async-inline-results-pending-indicator= as a placeholder
when evaluating asynchronous inline source blocks in =org-mode=.
- Integrate better with packages like =polymode= when evaluating source blocks
in =org-mode= by considering indirect buffers. Thanks to =@dvzubarev= for
the [[https://github.com/dzop/emacs-jupyter/issues/171#issuecomment-522762377][solution]].
- Fixed usage of source block parameters when evaluating source blocks
using =#+CALL= in =org-mode=. There are many sources of source block parameters
that =org-mode= merges to produce the final set of parameters passed
to =org-babel-execute:jupyter=, previously that function would just re-compute
source block parameters. Now it uses the parameters it was given,
see =org-babel-jupyter-current-src-block-params=.
- Add support for displaying evaluation results in the current buffer using
overlays. See =jupyter-eval-use-overlays= and the relevant README sections.
- Fix =jupyter-repl-restart-kernel= to restart a kernel using a kernel manager
when one is available. Previously, restarting a kernel using that function
wouldn't work properly if the kernel was from a notebook server.
- Increase default timeout until a kernel is considered dead to 30 seconds when
communicating directly with a kernel. More specifically, if a response from a
kernel is not received after three consecutive 10 s periods on the heartbeat
channel, the kernel is considered dead. Previously the timeout was five 1 s
periods. This should fix =Kernel not alive= errors when using the REPL if the
kernel being communicated with was on a slow connection.
- Ensure that a non-default value of =url-cookie-file= is handled properly in the
notebook support.
- In =org-mode= handle ANSI control codes in stream output.
- In =org-mode= fix a regression where source block results were not being
associated with =#+CALL= Org elements.
- Add support for the Jupyter Notebook REST API. See the relevant sections in
the README.
* v0.8.1
- Add the commands =jupyter-org-(next|previous)-busy-src-block= which will jump
to the next or previous busy source block in an =org-mode= buffer. Bound to =N=
and =P= in the =Hydra= provided in =org-mode= (=C-c h=).
- Add customizable variable =jupyter-org-adjust-image-size= to avoid stretching
images when =org-image-actual-width= is set so that it falls back to a default
width for an inline image.
- Fix a message buffering issue when sending multiple requests to a kernel in
quick succession, e.g. when calling =org-babel-execute-subtree= in =org-mode=
when all Jupyter source blocks in the subtree are evaluated asynchronously.
- In =jupyter-org-insert-src-block= (1) adjust whitespace so that there is at
least one blank line before and following an inserted source block (2) do not
insert a new source block between a source block and its results, always
insert the new block after a source block's results (3) do not move past an
inlinetask, normally the current paragraph or element under =point= is moved
past before inserting a new source block.
- Fix issues with undo in the REPL when trying to undo after inserting a
newline. See #139.
- In =org-mode=, detect Org formatted table strings when a kernel returns a
=text/org= mimetype. This avoids wrapping the table in a drawer.
- If a file is opened via =emacsclient=, attempt to associate the opened buffer
with a REPL client. This is useful, e.g. when using the ~julia~ language's
~edit~ function and the =EDITOR= environment variable is set to
=emacsclient=. See ~jupyter-server-mode-set-client~ for more details.
- In =org-mode=, when inserting the results of an asynchronously evaluated
src-block, indent the results to match the surrounding indentation level.
- In =org-mode=, fix an issue when a src-block is nested within a list that
would cause the entire list to be erased when asynchronously evaluating the
src-block.
- Add new customizable variable ~jupyter-repl-echo-eval-p~ that causes the REPL
to behave similarly to comint or ESS when evaluating code. Specifically, it
causes any code that is sent to the underlying kernel to also be displayed as
a REPL input cell. The previous behavior would only display the sent code as
an input cell if it was explicitly typed in at the REPL.
- Add the new command ~jupyter-repl-clear-cells~ to clear all of the current
input and output cells in a REPL buffer. Bound to ~C-c C-o~ by default in the
REPL.
- Fix an issue where timeouts started using ~with-timeout~ would timeout when
the kernel requests input from the user. The timeouts are now suspended in
such cases.
- In =jupyter-R.el= handle the =isolated= metadata property of HTML results by
opening up an external browser to display the result.
- Allow =:session= to be a remote file name for =org-mode= source blocks. When
=:session= is a remote file name that doesn't end in =.json=, e.g.
=/ssh:ec2:jl=, a new kernel is started on the remote host using the
=jupyter kernel= command on that host. The local file name part serves to
distinguish different sessions on the remote host.
- Add the new commands ~jupyter-repl-history-previous-matching~ and
~jupyter-repl-history-next-matching~, bound to ~C-c M-r~ and ~C-c M-s~ in the
REPL.
- In ~jupyter-with-display-buffer~, ~let~ bind ~jupyter-current-client~. This
fixes an issue where kernel language specific methods were not overriding the
defaults when attempting to display the contents of =display-data= messages
received from a kernel.
- Fix a regression in ~jupyter-available-kernelspecs~ when getting the
kernelspecs on remote hosts.
- Handle empty result blocks when stripping ANSI escape sequences during export
in ~org-babel-jupyter-strip-ansi-escapes~.
- Call ~downcase~ on the language name when adding to ~org-src-lang-modes~.
This fixes an issue with the ~C++~ kernel where the corresponding mode is
~c++-mode~.
* v0.8.0
- Support Windows
- In =org-mode=, support a header argument =:pandoc t=. Whenever this header
argument is provided, certain kinds of code block results are translated into
=org-mode= syntax using
|
{
"pile_set_name": "Github"
}
|
git,dpkg -s
make,dpkg -s
bzip2,dpkg -s
automake,dpkg -s
libbz2-dev,dpkg -s
libssl-dev,dpkg -s
doxygen,dpkg -s
graphviz,dpkg -s
libgmp3-dev,dpkg -s
autotools-dev,dpkg -s
libicu-dev,dpkg -s
python2.7,dpkg -s
python2.7-dev,dpkg -s
python3,dpkg -s
python3-dev,dpkg -s
autoconf,dpkg -s
libtool,dpkg -s
curl,dpkg -s
zlib1g-dev,dpkg -s
sudo,dpkg -s
ruby,dpkg -s
libusb-1.0-0-dev,dpkg -s
libcurl4-gnutls-dev,dpkg -s
pkg-config,dpkg -s
patch,dpkg -s
|
{
"pile_set_name": "Github"
}
|
from common import *
from trezor.utils import chunks
from trezor.crypto import bip39
from trezor.messages.SignTx import SignTx
from trezor.messages.TxInputType import TxInputType
from trezor.messages.TxOutputType import TxOutputType
from trezor.messages.TxRequest import TxRequest
from trezor.messages.TxAck import TxAck
from trezor.messages.TransactionType import TransactionType
from trezor.messages.RequestType import TXINPUT, TXOUTPUT, TXFINISHED
from trezor.messages.TxRequestDetailsType import TxRequestDetailsType
from trezor.messages.TxRequestSerializedType import TxRequestSerializedType
from trezor.messages import InputScriptType
from trezor.messages import OutputScriptType
from apps.common import coins
from apps.common.seed import Keychain
from apps.wallet.sign_tx import helpers, signing
class TestSignSegwitTxNativeP2WPKH(unittest.TestCase):
# pylint: disable=C0301
def test_send_native_p2wpkh(self):
coin = coins.by_name('Testnet')
seed = bip39.seed(' '.join(['all'] * 12), '')
inp1 = TxInputType(
# 49'/1'/0'/0/0" - tb1qqzv60m9ajw8drqulta4ld4gfx0rdh82un5s65s
address_n=[49 | 0x80000000, 1 | 0x80000000, 0 | 0x80000000, 0, 0],
amount=12300000,
prev_hash=unhexlify('09144602765ce3dd8f4329445b20e3684e948709c5cdcaf12da3bb079c99448a'),
prev_index=0,
script_type=InputScriptType.SPENDWITNESS,
sequence=0xffffffff,
multisig=None,
)
out1 = TxOutputType(
address='2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp',
amount=5000000,
script_type=OutputScriptType.PAYTOADDRESS,
address_n=[],
multisig=None,
)
out2 = TxOutputType(
address='tb1q694ccp5qcc0udmfwgp692u2s2hjpq5h407urtu',
script_type=OutputScriptType.PAYTOADDRESS,
amount=12300000 - 11000 - 5000000,
address_n=[],
multisig=None,
)
tx = SignTx(coin_name='Testnet', version=None, lock_time=None, inputs_count=1, outputs_count=2)
messages = [
None,
# check fee
TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None)),
TxAck(tx=TransactionType(inputs=[inp1])),
helpers.UiConfirmForeignAddress(address_n=inp1.address_n),
True,
TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=None),
TxAck(tx=TransactionType(outputs=[out1])),
helpers.UiConfirmOutput(out1, coin),
True,
TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=1, tx_hash=None), serialized=None),
TxAck(tx=TransactionType(outputs=[out2])),
helpers.UiConfirmOutput(out2, coin),
True,
helpers.UiConfirmTotal(12300000, 11000, coin),
True,
# sign tx
TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=None),
TxAck(tx=TransactionType(inputs=[inp1])),
TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=TxRequestSerializedType(
# returned serialized inp1
serialized_tx=unhexlify('010000000001018a44999c07bba32df1cacdc50987944e68e3205b4429438fdde35c76024614090000000000ffffffff'),
)),
TxAck(tx=TransactionType(outputs=[out1])),
TxRequest(request_type=TXOUTPUT, details=TxRequestDetailsType(request_index=1, tx_hash=None), serialized=TxRequestSerializedType(
# returned serialized out1
serialized_tx=unhexlify('02404b4c000000000017a9147a55d61848e77ca266e79a39bfc85c580a6426c987'),
signature_index=None,
signature=None,
)),
TxAck(tx=TransactionType(outputs=[out2])),
# segwit
TxRequest(request_type=TXINPUT, details=TxRequestDetailsType(request_index=0, tx_hash=None), serialized=TxRequestSerializedType(
# returned serialized out2
serialized_tx=unhexlify('a8386f0000000000160014d16b8c0680c61fc6ed2e407455715055e41052f5'),
signature_index=None,
signature=None,
)),
TxAck(tx=TransactionType(inputs=[inp1])),
TxRequest(request_type=TXFINISHED, details=None, serialized=TxRequestSerializedType(
serialized_tx=unhexlify('02483045022100a7ca8f097525f9044e64376dc0a0f5d4aeb8d15d66808ba97979a0475b06b66502200597c8ebcef63e047f9aeef1a8001d3560470cf896c12f6990eec4faec599b950121033add1f0e8e3c3136f7428dd4a4de1057380bd311f5b0856e2269170b4ffa65bf00000000'),
signature_index=0,
signature=unhexlify('3045022100a7ca8f097525f9044e64376dc0a0f5d4aeb8d15d66808ba97979a0475b06b66502200597c8ebcef63e047f9aeef1a8001d3560470cf896c12f6990eec4faec599b95'),
)),
]
keychain = Keychain(seed, [[coin.curve_name]])
signer = signing.sign_tx(tx, keychain)
for request, response in chunks(messages, 2):
self.assertEqual(signer.send(request), response)
with self.assertRaises(StopIteration):
signer.send(None)
def test_send_native_p2wpkh_change(self):
coin = coins.by_name('Testnet')
seed = bip39.seed(' '.join(['all'] * 12), '')
inp1 = TxInputType(
# 49'/1'/0'/0/0" - tb1qqzv60m9ajw8drqulta4ld4gfx0rdh82un5s65s
address_n=[49 | 0x80000000, 1 | 0x80000000, 0 | 0x80000000, 0, 0],
amount=12300000,
prev_hash=unhexlify('09144602765ce3dd8f4329445b20e3684e948709c5cdcaf12da3bb079c99448a'),
prev_index=0,
script_type=InputScriptType.SPENDWITNESS,
sequence=0xffffffff,
multisig=None,
)
out1 = TxOutputType(
address='2N4Q5FhU2497BryFfUgbqkAJE87aKHUhXMp',
amount=5000000,
script_type=OutputScriptType.PAYTOADDRESS,
address_n=[],
multisig=None,
|
{
"pile_set_name": "Github"
}
|
/*
* Certificate reading application
*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.
*
* This file is part of mbed TLS (https://tls.mbed.org)
*/
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#if defined(MBEDTLS_PLATFORM_C)
#include "mbedtls/platform.h"
#else
#include <stdio.h>
#include <stdlib.h>
#define mbedtls_time time
#define mbedtls_time_t time_t
#define mbedtls_fprintf fprintf
#define mbedtls_printf printf
#endif
#if !defined(MBEDTLS_BIGNUM_C) || !defined(MBEDTLS_ENTROPY_C) || \
!defined(MBEDTLS_SSL_TLS_C) || !defined(MBEDTLS_SSL_CLI_C) || \
!defined(MBEDTLS_NET_C) || !defined(MBEDTLS_RSA_C) || \
!defined(MBEDTLS_X509_CRT_PARSE_C) || !defined(MBEDTLS_FS_IO) || \
!defined(MBEDTLS_CTR_DRBG_C)
int main( void )
{
mbedtls_printf("MBEDTLS_BIGNUM_C and/or MBEDTLS_ENTROPY_C and/or "
"MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or "
"MBEDTLS_NET_C and/or MBEDTLS_RSA_C and/or "
"MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_FS_IO and/or "
"MBEDTLS_CTR_DRBG_C not defined.\n");
return( 0 );
}
#else
#include "mbedtls/entropy.h"
#include "mbedtls/ctr_drbg.h"
#include "mbedtls/net_sockets.h"
#include "mbedtls/ssl.h"
#include "mbedtls/x509.h"
#include "mbedtls/debug.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MODE_NONE 0
#define MODE_FILE 1
#define MODE_SSL 2
#define DFL_MODE MODE_NONE
#define DFL_FILENAME "cert.crt"
#define DFL_CA_FILE ""
#define DFL_CRL_FILE ""
#define DFL_CA_PATH ""
#define DFL_SERVER_NAME "localhost"
#define DFL_SERVER_PORT "4433"
#define DFL_DEBUG_LEVEL 0
#define DFL_PERMISSIVE 0
#define USAGE_IO \
" ca_file=%%s The single file containing the top-level CA(s) you fully trust\n" \
" default: \"\" (none)\n" \
" crl_file=%%s The single CRL file you want to use\n" \
" default: \"\" (none)\n" \
" ca_path=%%s The path containing the top-level CA(s) you fully trust\n" \
" default: \"\" (none) (overrides ca_file)\n"
#define USAGE \
"\n usage: cert_app param=<>...\n" \
"\n acceptable parameters:\n" \
" mode=file|ssl default: none\n" \
" filename=%%s default: cert.crt\n" \
USAGE_IO \
" server_name=%%s default: localhost\n" \
" server_port=%%d default: 4433\n" \
" debug_level=%%d default: 0 (disabled)\n" \
" permissive=%%d default: 0 (disabled)\n" \
"\n"
/*
* global options
*/
struct options
{
int mode; /* the mode to run the application in */
const char *filename; /* filename of the certificate file */
const char *ca_file; /* the file with the CA certificate(s) */
const char *crl_file; /* the file with the CRL to use */
const char *ca_path; /* the path with the CA certificate(s) reside */
const char *server_name; /* hostname of the server (client only) */
const char *server_port; /* port on which the ssl service runs */
int debug_level; /* level of debugging */
int permissive; /* permissive parsing */
} opt;
static void my_debug( void *ctx, int level,
const char *file, int line,
const char *str )
{
((void) level);
mbedtls_fprintf( (FILE *) ctx, "%s:%04d: %s", file, line, str );
fflush( (FILE *) ctx );
}
static int my_verify( void *data, mbedtls_x509_crt *crt, int depth, uint32_t *flags )
{
char buf[1024];
((void) data);
mbedtls_printf( "\nVerify requested for (Depth %d):\n", depth );
mbedtls_x509_crt_info( buf, sizeof( buf ) - 1, "", crt );
mbedtls_printf( "%s", buf );
if ( ( *flags ) == 0 )
mbedtls_printf( " This certificate has no flags\n" );
else
{
mbedtls_x509_crt_verify_info( buf, sizeof( buf ), " ! ", *flags );
mbedtls_printf( "%s\n", buf );
}
return( 0 );
}
int main( int argc, char *argv[] )
{
int ret = 0;
mbedtls_net_context server_fd;
unsigned char buf[1024];
mbedtls_entropy_context entropy;
mbedtls_ctr_drbg_context ctr_drbg;
mbedtls_ssl_context ssl;
mbedtls_ssl_config conf;
mbedtls_x509_crt cacert;
mbedtls_x509_crl cacrl;
int i, j;
uint32_t flags;
int verify = 0;
char *p, *q;
const char *pers = "cert_app";
/*
* Set to sane values
*/
mbedtls_net_init( &server_fd );
mbedtls_ctr_drbg_init( &ctr_drbg );
mbedtls_ssl_init( &ssl );
mbedtls_ssl_config_init( &conf );
mbedtls_x509_crt_init( &cacert );
#if defined(MBEDTLS_X509_CRL_PARSE_C)
mbedtls_x509_crl_init( &cacrl );
#else
/* Zeroize structure as CRL parsing is not supported and we have to pass
it to the verify function */
memset( &cacrl, 0, sizeof(mbedtls_x509_crl) );
#endif
if( argc == 0
|
{
"pile_set_name": "Github"
}
|
/***************************************************************************/
/* */
/* cf2read.h */
/* */
/* Adobe's code for stream handling (specification). */
/* */
/* Copyright 2007-2013 Adobe Systems Incorporated. */
/* */
/* This software, and all works of authorship, whether in source or */
/* object code form as indicated by the copyright notice(s) included */
/* herein (collectively, the "Work") is made available, and may only be */
/* used, modified, and distributed under the FreeType Project License, */
/* LICENSE.TXT. Additionally, subject to the terms and conditions of the */
/* FreeType Project License, each contributor to the Work hereby grants */
/* to any individual or legal entity exercising permissions granted by */
/* the FreeType Project License and this section (hereafter, "You" or */
/* "Your") a perpetual, worldwide, non-exclusive, no-charge, */
/* royalty-free, irrevocable (except as stated in this section) patent */
/* license to make, have made, use, offer to sell, sell, import, and */
/* otherwise transfer the Work, where such license applies only to those */
/* patent claims licensable by such contributor that are necessarily */
/* infringed by their contribution(s) alone or by combination of their */
/* contribution(s) with the Work to which such contribution(s) was */
/* submitted. If You institute patent litigation against any entity */
/* (including a cross-claim or counterclaim in a lawsuit) alleging that */
/* the Work or a contribution incorporated within the Work constitutes */
/* direct or contributory patent infringement, then any patent licenses */
/* granted to You under this License for that Work shall terminate as of */
/* the date such litigation is filed. */
/* */
/* By using, modifying, or distributing the Work you indicate that you */
/* have read and understood the terms and conditions of the */
/* FreeType Project License as well as those provided in this section, */
/* and you accept them fully. */
/* */
/***************************************************************************/
#ifndef __CF2READ_H__
#define __CF2READ_H__
FT_BEGIN_HEADER
typedef struct CF2_BufferRec_
{
FT_Error* error;
const FT_Byte* start;
const FT_Byte* end;
const FT_Byte* ptr;
} CF2_BufferRec, *CF2_Buffer;
FT_LOCAL( CF2_Int )
cf2_buf_readByte( CF2_Buffer buf );
FT_LOCAL( FT_Bool )
cf2_buf_isEnd( CF2_Buffer buf );
FT_END_HEADER
#endif /* __CF2READ_H__ */
/* END */
|
{
"pile_set_name": "Github"
}
|
#ifndef HALIDE_LAMBDA_H
#define HALIDE_LAMBDA_H
#include "Func.h"
#include "Var.h"
/** \file
* Convenience functions for creating small anonymous Halide
* functions. See test/lambda.cpp for example usage. */
namespace Halide {
/** Create a zero-dimensional halide function that returns the given
* expression. The function may have more dimensions if the expression
* contains implicit arguments. */
inline Func lambda(const Expr &e) {
Func f("lambda" + Internal::unique_name('_'));
f(_) = e;
return f;
}
/** Create a 1-D halide function in the first argument that returns
* the second argument. The function may have more dimensions if the
* expression contains implicit arguments and the list of Var
* arguments contains a placeholder ("_"). */
inline Func lambda(const Var &x, const Expr &e) {
Func f("lambda" + Internal::unique_name('_'));
f(x) = e;
return f;
}
/** Create a 2-D halide function in the first two arguments that
* returns the last argument. The function may have more dimensions if
* the expression contains implicit arguments and the list of Var
* arguments contains a placeholder ("_"). */
inline Func lambda(const Var &x, const Var &y, const Expr &e) {
Func f("lambda" + Internal::unique_name('_'));
f(x, y) = e;
return f;
}
/** Create a 3-D halide function in the first three arguments that
* returns the last argument. The function may have more dimensions
* if the expression contains implicit arguments and the list of Var
* arguments contains a placeholder ("_"). */
inline Func lambda(const Var &x, const Var &y, const Var &z, const Expr &e) {
Func f("lambda" + Internal::unique_name('_'));
f(x, y, z) = e;
return f;
}
/** Create a 4-D halide function in the first four arguments that
* returns the last argument. The function may have more dimensions if
* the expression contains implicit arguments and the list of Var
* arguments contains a placeholder ("_"). */
inline Func lambda(const Var &x, const Var &y, const Var &z, const Var &w, const Expr &e) {
Func f("lambda" + Internal::unique_name('_'));
f(x, y, z, w) = e;
return f;
}
/** Create a 5-D halide function in the first five arguments that
* returns the last argument. The function may have more dimensions if
* the expression contains implicit arguments and the list of Var
* arguments contains a placeholder ("_"). */
inline Func lambda(const Var &x, const Var &y, const Var &z, const Var &w, const Var &v, const Expr &e) {
Func f("lambda" + Internal::unique_name('_'));
f(x, y, z, w, v) = e;
return f;
}
} // namespace Halide
#endif //HALIDE_LAMBDA_H
|
{
"pile_set_name": "Github"
}
|
/*
Package logrus is a structured logger for Go, completely API compatible with the standard library logger.
The simplest way to use Logrus is simply the package-level exported logger:
package main
import (
log "github.com/sirupsen/logrus"
)
func main() {
log.WithFields(log.Fields{
"animal": "walrus",
"number": 1,
"size": 10,
}).Info("A walrus appears")
}
Output:
time="2015-09-07T08:48:33Z" level=info msg="A walrus appears" animal=walrus number=1 size=10
For a full guide visit https://github.com/sirupsen/logrus
*/
package logrus
|
{
"pile_set_name": "Github"
}
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
class ItemPriceDuplicateItem(frappe.ValidationError): pass
from frappe.model.document import Document
class ItemPrice(Document):
def validate(self):
self.validate_item()
self.validate_dates()
self.update_price_list_details()
self.update_item_details()
self.check_duplicates()
def validate_item(self):
if not frappe.db.exists("Item", self.item_code):
frappe.throw(_("Item {0} not found").format(self.item_code))
def validate_dates(self):
if self.valid_from and self.valid_upto:
if self.valid_from > self.valid_upto:
frappe.throw(_("Valid From Date must be lesser than Valid Upto Date."))
def update_price_list_details(self):
if self.price_list:
price_list_details = frappe.db.get_value("Price List",
{"name": self.price_list, "enabled": 1},
["buying", "selling", "currency"])
if not price_list_details:
link = frappe.utils.get_link_to_form('Price List', self.price_list)
frappe.throw("The price list {0} does not exists or disabled".
format(link))
self.buying, self.selling, self.currency = price_list_details
def update_item_details(self):
if self.item_code:
self.item_name, self.item_description = frappe.db.get_value("Item",
self.item_code,["item_name", "description"])
def check_duplicates(self):
conditions = "where item_code=%(item_code)s and price_list=%(price_list)s and name != %(name)s"
for field in ['uom', 'valid_from',
'valid_upto', 'packing_unit', 'customer', 'supplier']:
if self.get(field):
conditions += " and {0} = %({1})s".format(field, field)
price_list_rate = frappe.db.sql("""
SELECT price_list_rate
FROM `tabItem Price`
{conditions} """.format(conditions=conditions), self.as_dict())
if price_list_rate :
frappe.throw(_("Item Price appears multiple times based on Price List, Supplier/Customer, Currency, Item, UOM, Qty and Dates."), ItemPriceDuplicateItem)
def before_save(self):
if self.selling:
self.reference = self.customer
if self.buying:
self.reference = self.supplier
if self.selling and not self.buying:
# if only selling then remove supplier
self.supplier = None
if self.buying and not self.selling:
# if only buying then remove customer
self.customer = None
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<title>GLFW: vulkan.dox File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<div class="glfwheader">
<a href="https://www.glfw.org/" id="glfwhome">GLFW</a>
<ul class="glfwnavbar">
<li><a href="https://www.glfw.org/documentation.html">Documentation</a></li>
<li><a href="https://www.glfw.org/download.html">Download</a></li>
<li><a href="https://www.glfw.org/community.html">Community</a></li>
</ul>
</div>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">vulkan.dox File Reference</div> </div>
</div><!--header-->
<div class="contents">
</div><!-- contents -->
<address class="footer">
<p>
Last update on Tue Apr 16 2019 for GLFW 3.3.0
</p>
</address>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
//===-- include/flang/Evaluate/real.h ---------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef FORTRAN_EVALUATE_REAL_H_
#define FORTRAN_EVALUATE_REAL_H_
#include "formatting.h"
#include "integer.h"
#include "rounding-bits.h"
#include "flang/Common/real.h"
#include "flang/Evaluate/common.h"
#include <cinttypes>
#include <limits>
#include <string>
// Some environments, viz. clang on Darwin, allow the macro HUGE
// to leak out of <math.h> even when it is never directly included.
#undef HUGE
namespace llvm {
class raw_ostream;
}
namespace Fortran::evaluate::value {
// LOG10(2.)*1E12
static constexpr std::int64_t ScaledLogBaseTenOfTwo{301029995664};
// Models IEEE binary floating-point numbers (IEEE 754-2008,
// ISO/IEC/IEEE 60559.2011). The first argument to this
// class template must be (or look like) an instance of Integer<>;
// the second specifies the number of effective bits (binary precision)
// in the fraction.
template <typename WORD, int PREC>
class Real : public common::RealDetails<PREC> {
public:
using Word = WORD;
static constexpr int binaryPrecision{PREC};
using Details = common::RealDetails<PREC>;
using Details::exponentBias;
using Details::exponentBits;
using Details::isImplicitMSB;
using Details::maxExponent;
using Details::significandBits;
static constexpr int bits{Word::bits};
static_assert(bits >= Details::bits);
using Fraction = Integer<binaryPrecision>; // all bits made explicit
template <typename W, int P> friend class Real;
constexpr Real() {} // +0.0
constexpr Real(const Real &) = default;
constexpr Real(const Word &bits) : word_{bits} {}
constexpr Real &operator=(const Real &) = default;
constexpr Real &operator=(Real &&) = default;
constexpr bool operator==(const Real &that) const {
return word_ == that.word_;
}
// TODO: DIM, MAX, MIN, DPROD, FRACTION,
// INT/NINT, NEAREST, OUT_OF_RANGE,
// RRSPACING/SPACING, SCALE, SET_EXPONENT
constexpr bool IsSignBitSet() const { return word_.BTEST(bits - 1); }
constexpr bool IsNegative() const {
return !IsNotANumber() && IsSignBitSet();
}
constexpr bool IsNotANumber() const {
return Exponent() == maxExponent && !GetSignificand().IsZero();
}
constexpr bool IsQuietNaN() const {
return Exponent() == maxExponent &&
GetSignificand().BTEST(significandBits - 1);
}
constexpr bool IsSignalingNaN() const {
return IsNotANumber() && !GetSignificand().BTEST(significandBits - 1);
}
constexpr bool IsInfinite() const {
return Exponent() == maxExponent && GetSignificand().IsZero();
}
constexpr bool IsZero() const {
return Exponent() == 0 && GetSignificand().IsZero();
}
constexpr bool IsSubnormal() const {
return Exponent() == 0 && !GetSignificand().IsZero();
}
constexpr Real ABS() const { // non-arithmetic, no flags returned
return {word_.IBCLR(bits - 1)};
}
constexpr Real SetSign(bool toNegative) const { // non-arithmetic
if (toNegative) {
return {word_.IBSET(bits - 1)};
} else {
return ABS();
}
}
constexpr Real SIGN(const Real &x) const { return SetSign(x.IsSignBitSet()); }
constexpr Real Negate() const { return {word_.IEOR(word_.MASKL(1))}; }
Relation Compare(const Real &) const;
ValueWithRealFlags<Real> Add(
const Real &, Rounding rounding = defaultRounding) const;
ValueWithRealFlags<Real> Subtract(
const Real &y, Rounding rounding = defaultRounding) const {
return Add(y.Negate(), rounding);
}
ValueWithRealFlags<Real> Multiply(
const Real &, Rounding rounding = defaultRounding) const;
ValueWithRealFlags<Real> Divide(
const Real &, Rounding rounding = defaultRounding) const;
// SQRT(x**2 + y**2) but computed so as to avoid spurious overflow
// TODO: needed for CABS
ValueWithRealFlags<Real> HYPOT(
const Real &, Rounding rounding = defaultRounding) const;
template <typename INT> constexpr INT EXPONENT() const {
if (Exponent() == maxExponent) {
return INT::HUGE();
} else {
return {UnbiasedExponent()};
}
}
static constexpr Real EPSILON() {
Real epsilon;
epsilon.Normalize(
false, exponentBias - binaryPrecision, Fraction::MASKL(1));
return epsilon;
}
static constexpr Real HUGE() {
Real huge;
huge.Normalize(false, maxExponent - 1, Fraction::MASKR(binaryPrecision));
return huge;
}
static constexpr Real TINY() {
Real tiny;
tiny.Normalize(false, 1, Fraction::MASKL(1)); // minimum *normal* number
return tiny;
}
static constexpr int DIGITS{binaryPrecision};
static constexpr int PRECISION{Details::decimalPrecision};
static constexpr int RANGE{Details::decimalRange};
static constexpr int MAXEXPONENT{maxExponent - 1 - exponentBias};
static constexpr int MINEXPONENT{1 - exponentBias};
constexpr Real FlushSubnormalToZero() const {
if (IsSubnormal()) {
return Real{};
}
return *this;
}
// TODO: Configurable NotANumber representations
static constexpr Real NotANumber() {
return {Word{maxExponent}
.SHIFTL(significandBits)
.IBSET(significandBits - 1)
.IBSET(significandBits - 2)};
}
static constexpr Real Infinity(bool negative) {
Word infinity{maxExponent};
infinity = infinity.SHIFTL(significandBits);
if (negative) {
infinity = infinity.IBSET(infinity.bits - 1);
}
return {infinity};
}
template <typename INT>
static ValueWithRealFlags<Real> FromInteger(
const INT &n, Rounding rounding = defaultRounding) {
bool isNegative{n.IsNegative()};
INT absN{n};
if (isNegative) {
absN = n.Negate().value; // overflow is safe to ignore
}
int leadz{absN.LEADZ()};
if (leadz >= absN.bits) {
return {}; // all bits zero -> +0.0
}
ValueWithRealFlags<Real> result;
int exponent{exponentBias + absN.bits - leadz - 1};
int bitsNeeded{absN.bits - (leadz + isImplicitMSB)};
int bitsLost{bitsNeeded - significandBits};
if (bitsLost <= 0) {
Fraction fraction{Fraction::ConvertUnsigned(absN).value};
result.flags |= result.value.Normalize(
isNegative, exponent, fraction.SHIFTL(-bitsLost));
} else {
Fraction fraction{Fraction::ConvertUnsigned(absN.SH
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>TinyXML-2: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">TinyXML-2
 <span id="projectnumber">5.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>tinyxml2</b></li><li class="navelem"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html">XMLElement</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">tinyxml2::XMLElement Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="classtinyxml2_1_1_x_m_l_element.html">tinyxml2::XMLElement</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html#a3ea8a40e788fb9ad876c28a32932c6d5">Accept</a>(XMLVisitor *visitor) const</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html">tinyxml2::XMLElement</a></td><td class="entry"><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html#a70e49ed60b11212ae35f7e354cfe1de9">Attribute</a>(const char *name, const char *value=0) const</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html">tinyxml2::XMLElement</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html#a53eda26131e1ad1031ef8ec8adb51bd8">BoolAttribute</a>(const char *name, bool defaultValue=false) const</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html">tinyxml2::XMLElement</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html#a68569f59f6382bcea7f5013ec59736d2">BoolText</a>(bool defaultValue=false) const</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html">tinyxml2::XMLElement</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_node.html#a62c71b6bf8734b5424063b8d9a61c266">DeepClone</a>(XMLDocument *target) const</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_node.html">tinyxml2::XMLNode</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html#aebd45aa7118964c30b32fe12e944628a">DeleteAttribute</a>(const char *name)</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html">tinyxml2::XMLElement</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_node.html#a363b6edbd6ebd55f8387d2b89f2b0921">DeleteChild</a>(XMLNode *node)</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_node.html">tinyxml2::XMLNode</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_node.html#a0360085cc54df5bff85d5c5da13afdce">DeleteChildren</a>()</td><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_node.html">tinyxml2::XMLNode</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="classtinyxml2_1_1_x_m_l_element.html#a10a90c505aea716bf073eea1c97f33b5">DoubleAttribute</a>(
|
{
"pile_set_name": "Github"
}
|
// Copyright 2017-2020 Fitbit, Inc
// SPDX-License-Identifier: Apache-2.0
package com.fitbit.goldengate.bindings.util
import com.fitbit.goldengate.bindings.BaseTest
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Test
import java.util.Arrays
class MemoryDataSinkTest : BaseTest() {
private val data = byteArrayOf(0x01)
@Test
fun shouldCreateSink() {
MemoryDataSink().use { sink ->
assertNotNull(sink)
assertTrue(sink.thisPointer > 0)
}
}
@Test
fun canAttachDataSource() {
MemoryDataSink().use { sink ->
MemoryDataSource(data).use { source ->
sink.attach(source.thisPointer)
}
}
}
@Test
fun shouldReceiveDataSentFromSource() {
MemoryDataSink().use { sink ->
MemoryDataSource(data).use { source ->
// attach DataSource that will send data
sink.attach(source.thisPointer)
// start sending data from DataSource
source.start()
// verify that sink gets the data sent from source
assertTrue(Arrays.equals(sink.getBufferWithSleep(), data))
}
}
}
}
/**
* Sleep is added here as data in delivered on GG loop thread and synchronously checking can be
* flaky without this sleep
*/
fun MemoryDataSink.getBufferWithSleep(millis: Long = 100): ByteArray {
Thread.sleep(millis)
return getBuffer()
}
|
{
"pile_set_name": "Github"
}
|
server.port=8080
spring.application.name=order
management.endpoints.web.exposure.include=*
logging.level.org.springframework.boot.actuate.trace.WebRequestTraceFilter: TRACE
logging.level.com.ewolff.microservice.order.logic.OrderController: TRACE
logging.level.com.ewolff.microservice.order.RandomlyFailingFilter: TRACE
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:postgresql://postgres/dborder
spring.datasource.username=dbuser
spring.datasource.password=dbpass
spring.datasource.driver-class-name=org.postgresql.Driver
spring.sleuth.baggage.remote-fields=x-request-id,x-ot-span-context
|
{
"pile_set_name": "Github"
}
|
<?xml version='1.0' encoding='utf-8'?>
<section xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" containing-doc="D.C. Code">
<num>2-303.19a</num>
<reason>Repealed</reason>
<heading>Report by Chief Procurement Officer.</heading>
<text>Repealed.</text>
<annotations>
<annotation doc="D.C. Law 6-85" type="History" path="§319a">Feb. 21, 1986, D.C. Law 6-85, § 319a</annotation>
<annotation doc="D.C. Law 16-122" type="History">as added June 8, 2006, D.C. Law 16-122, § 2(f), 53 DCR 2834</annotation>
<annotation doc="D.C. Law 18-371" type="History">Apr. 8, 2011, D.C. Law 18-371, § 1201(a), 58 DCR 1185</annotation>
</annotations>
</section>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env ruby
require 'gnuplot'
require 'yaml'
# The YAML produced by AttackRecovery.rb
input_path = ARGV[0]
output_path = ARGV[1]
data = YAML.load(File.read(input_path))
if data.keys.length != 1
puts "There are more than one key, using the 'first'."
end
files_to_distances = Hash.new { |h,k| h[k] = Array.new }
array = data[data.keys[0]]
array.each do |entry|
file = entry[:file].split('_')[0]
dist = entry[:distance]
files_to_distances[file] << dist
end
data = []
i = 0
files_to_distances.each do |file, distance_array|
print "#{i} "
distance_array.each do |d|
data << [i, d]
print "#{d} "
end
print "\n"
i += 1
end
exit
Gnuplot.open do |gp|
Gnuplot::Plot.new( gp ) do |plot|
plot.title File.basename(input_path)
# FIXME
plot.xrange "[0:10]"
plot.yrange "[0:2000]"
plot.terminal "png"
plot.output File.expand_path(output_path, __FILE__)
plot.ylabel "Distance"
plot.xlabel "Page (x Sample)"
plot.data << Gnuplot::DataSet.new( "sin(x)" ) do |ds|
ds.with = "points"
ds.title = "Distances"
end
end
end
|
{
"pile_set_name": "Github"
}
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE131_memmove_62a.cpp
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE131.label.xml
Template File: sources-sink-62a.tmpl.cpp
*/
/*
* @description
* CWE: 121 Stack Based Buffer Overflow
* BadSource: Allocate memory without using sizeof(int)
* GoodSource: Allocate memory using sizeof(int)
* Sinks: memmove
* BadSink : Copy array to data using memmove()
* Flow Variant: 62 Data flow: data flows using a C++ reference from one function to another in different source files
*
* */
#include "std_testcase.h"
namespace CWE121_Stack_Based_Buffer_Overflow__CWE131_memmove_62
{
#ifndef OMITBAD
/* bad function declaration */
void badSource(int * &data);
void bad()
{
int * data;
data = NULL;
badSource(data);
{
int source[10] = {0};
/* POTENTIAL FLAW: Possible buffer overflow if data was not allocated correctly in the source */
memmove(data, source, 10*sizeof(int));
printIntLine(data[0]);
}
}
#endif /* OMITBAD */
#ifndef OMITGOOD
/* goodG2B uses the GoodSource with the BadSink */
void goodG2BSource(int * &data);
static void goodG2B()
{
int * data;
data = NULL;
goodG2BSource(data);
{
int source[10] = {0};
/* POTENTIAL FLAW: Possible buffer overflow if data was not allocated correctly in the source */
memmove(data, source, 10*sizeof(int));
printIntLine(data[0]);
}
}
void good()
{
goodG2B();
}
#endif /* OMITGOOD */
} /* close namespace */
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
#ifdef INCLUDEMAIN
using namespace CWE121_Stack_Based_Buffer_Overflow__CWE131_memmove_62; /* so that we can use good and bad easily */
int main(int argc, char * argv[])
{
/* seed randomness */
srand( (unsigned)time(NULL) );
#ifndef OMITGOOD
printLine("Calling good()...");
good();
printLine("Finished good()");
#endif /* OMITGOOD */
#ifndef OMITBAD
printLine("Calling bad()...");
bad();
printLine("Finished bad()");
#endif /* OMITBAD */
return 0;
}
#endif
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env ruby
# This script is called by the 'forced command' directive in `/home/git/.ssh/.authorized_keys`
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..')
require 'config/boot'
# $SSH_ORIGINAL_COMMAND is set by `sshd'. It stores the originally intended command to be run by `git push'. In
# our case it is overridden by the 'forced command', so we need to reinstate it now that the 'forced command' has
# run.
RECEIVE_REPO="$(echo "$SSH_ORIGINAL_COMMAND" | parse_repo_from_ssh_command)"
repo_path="$GITHOME/$RECEIVE_REPO"
git-shell -c "$(echo "$SSH_ORIGINAL_COMMAND" | awk '{print $1}') '$RECEIVE_REPO'"
|
{
"pile_set_name": "Github"
}
|
var Jason = function(options, jason) {
var node = {
$type: "div",
class: "jason",
_body: null,
_styles: null,
$init: function() {
if (jason) {
this._update(jason);
} else {
this.classList.add("hidden");
}
this.style.minHeight = window.innerHeight;
},
$update: function() {
// Style
var b = this._body;
if (b.background) {
if (typeof b.background === 'string') {
if (/http/.test(b.background)) {
this.style.backgroundImage = "url(" + b.background + ")";
this.style.backgroundSize = "cover";
} else {
this.style.backgroundColor = b.background;
}
} else {
// advanced background
if (b.background.type === 'html') {
this.querySelector(".webcontainer")._update(b.background);
}
}
} else if (b.style && b.style.background) {
if (typeof b.style.background === 'string') {
if (/http/.test(b.style.background)) {
this.style.backgroundImage = "url(" + b.style.background + ")";
this.style.backgroundSize = "cover";
} else {
this.style.backgroundColor = b.style.background;
}
} else {
// advanced type (object type)
if (b.style.background.type === 'html') {
this.querySelector(".webcontainer")._update(b.style.background);
}
}
}
if (this._styles) {
this.querySelector("style")._update(this._styles);
}
},
_draw: function(body) {
this._body = body;
this.querySelector(".sections")._update(this._body);
this.querySelector(".layers")._update(this._body);
this.querySelector(".header")._update(this._body);
this.querySelector(".footer")._update(this._body);
},
_update: function(root){
var self = this;
// Declare mixins with '$jason.head.type = "mixin"'
if (root && root.$jason && root.$jason.head && root.$jason.head.type === "mixin") {
self.classList.add("hidden");
return;
}
Mixin.loaded = [];
Mixin.parse(root)
.then(function(root) {
var head = root.$jason.head;
var body = root.$jason.body;
if (body) {
self.classList.remove("hidden");
self._draw(body);
} else {
self.classList.add("hidden");
}
if (head) {
if (head.templates && head.templates.body && head.data) {
var parsed = ST.transform(head.templates.body, head.data);
if (parsed) {
self.classList.remove("hidden");
self._draw(parsed);
} else {
self.classList.add("hidden");
}
}
if (head.styles) {
self._styles = head.styles;
}
}
})
.catch(function(err) {
console.log("Error", err);
self.classList.add("hidden");
})
},
$components: [
Css,
Header,
Sections,
Layers,
Footer,
WebContainer
]
}
if (options) {
Object.keys(options).forEach(function(key) {
if (key === 'class') {
node.class = "jason " + options[key];
} else {
node[key] = options[key];
}
})
}
return node;
}
Components = {
slider: function(o) {
var style = undefined;
if (o.style) {
style = {
width: o.style.width ? o.style.width + 'px' : undefined,
height: o.style.height ? o.style.height + 'px' : undefined
}
}
return Utils.clean({
$type: "input",
type: "range",
value: o.value,
class: o.className,
style: Utils.clean(style)
})
},
textfield: function(o) {
var style = undefined;
if (o.style) {
style = {
background: o.style.background,
width: o.style.width ? o.style.width + 'px' : undefined,
height: o.style.height ? o.style.height + 'px' : undefined,
padding: o.style.padding ? o.style.padding + 'px' : undefined,
paddingLeft: o.style.padding_left ? o.style.padding_left + 'px' : undefined,
paddingRight: o.style.padding_right ? o.style.padding_right + 'px' : undefined,
paddingTop: o.style.padding_top ? o.style.padding_top + 'px' : undefined,
paddingBottom: o.style.padding_bottom ? o.style.padding_bottom + 'px' : undefined,
color: o.style.color,
fontFamily: o.style.font,
fontSize: o.style.size ? o.style.size + 'px' : undefined,
textAlign: o.style.align
}
}
return Utils.clean({
$type: "input",
type: o.type,
value: o.value,
class: o.className,
style: Utils.clean(style),
placeholder: o.placeholder
})
},
textarea: function(o) {
var style = undefined;
if (o.style) {
style = {
background: o.style.background,
width: o.style.width ? o.style.width + 'px' : undefined,
height: o.style.height ? o.style.height + 'px' : undefined,
padding: o.style.padding ? o.style.padding + 'px' : undefined,
paddingLeft: o.style.padding_left ? o.style.padding_left + 'px' : undefined,
paddingRight: o.style.padding_right ? o.style.padding_right + 'px' : undefined,
paddingTop: o.style.padding_top ? o.style.padding_top + 'px' : undefined,
paddingBottom: o.style.padding_bottom ? o.style.padding_bottom + 'px' : undefined,
color: o.style.color,
fontFamily: o.style.font,
fontSize: o.style.size ? o.style.size + 'px' : undefined,
textAlign: o.style.align
}
}
return Utils.clean({
$type: "textarea",
value: o.value,
class: o.className,
style: Utils.clean(style),
placeholder: o.placeholder
})
},
button: function(o) {
var style = undefined;
if (o.style) {
style = {
background: o.style.background,
width: o.style.width ? o.style.width + 'px' : undefined,
height: o.style.height ? o.style.height + 'px' : undefined,
padding: o.style.padding ? o.style.padding + 'px' : undefined,
paddingLeft: o.style.padding_left ? o.style.padding_left + 'px' : undefined,
paddingRight: o.style.padding_right ? o.style.padding_right + 'px' : undefined,
paddingTop: o.style.padding_top ? o.style.padding_top + 'px' : undefined,
paddingBottom: o.style.padding_bottom ? o.style.padding_bottom + 'px' : undefined,
borderRadius: o.style.corner_radius ? o.style.corner_radius + 'px
|
{
"pile_set_name": "Github"
}
|
public class JniTest
{
private static void Test(
String name,
Object actual,
Object expected,
String actualAsString,
String expectedAsString)
{
if (!actual.equals(expected))
{
System.out.println(String.format(
"Test: %s failed\nExpected: \"%s\", Actual: \"%s\"",
name,
expected,
actual));
JniTest.exitCode = -1;
}
else
{
System.out.println(String.format("Test: %s passed", name));
}
}
private static void Test(
String name,
String actual,
String expected)
{
JniTest.Test(name, actual, expected, actual, expected);
}
public static void main(String[] args)
{
var actualVersion = JniWrapper.get_jni_version();
var expectedVersion = 0x000A0000;
JniTest.Test(
"Get JNI Version",
actualVersion,
expectedVersion,
String.format("0x%08X", actualVersion),
String.format("0x%08X", expectedVersion));
JniTest.Test(
"Read Native String Constant",
JniWrapper.read_constant_string(),
"Hello from C");
JniTest.Test(
"Write Java String to Native Library",
JniWrapper.write_string("Hello from Java"),
"Hello from Java");
JniTest.Test(
"Write Java Char Array to Native Library",
JniWrapper.write_char_array("Hello from Java".toCharArray()),
"Hello from Java");
var helper = new JniHelper();
JniTest.Test(
"Write String Member to Native Library",
JniWrapper.write_string_member(helper),
"Set from Java");
JniWrapper.set_string_member(helper);
JniTest.Test(
"Set String Member from Native Library",
helper.stringMember,
"Set from C");
JniWrapper.execute_java_function(helper);
JniTest.Test(
"Execeute Java Function from Native Library",
helper.stringMember,
"Hello, Managed World");
helper = JniWrapper.instantiate_java_class();
JniTest.Test(
"Instantiate Java Class",
helper.stringMember,
"Instantiated from C");
JniTest.Test(
"Call Native Library to Set System Time",
JniWrapper.set_and_write_time_in_seconds(1000),
"1000");
System.exit(exitCode);
}
public static int exitCode = 0;
}
|
{
"pile_set_name": "Github"
}
|
@startuml
sprite $reddit [48x48/16] {
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000269BCDCCA740000000000000000000
00000000000000028EFFFFFFFFFFFFB50000000000000000
00000000000003BFFFFFFFFFFFFFFFFFE700000000000000
000000000001AFFFFFFFFFFFFFFFFFFFFFE5000000000000
00000000004EFFFFFFFFFFFFFFFFFFFFFFFFA10000000000
0000000007FFFFFFFFFFFFFFFFFFFFFFFFFFFD1000000000
000000008FFFFFFFFFFFFFFFFFFFFFFFFFFFFFE200000000
00000007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE10000000
0000004FFFFFFFFFFFFFFFFFFDFFFFFFDFFFFFFFC0000000
000001EFFFFFFFFFFFFFFFFFD0047BE300BFFFFFF8000000
00000AFFFFFFFFFFFFFFFFFF95FB7400002FFFFFFF200000
00003FFFFFFFFFFFFFFFFFFF69FFFFB0003FFFFFFFB00000
0000BFFFFFFFFFFFFFFFFFFF2CFFFFF501CFFFFFFFF30000
0002FFFFFFFFFFFFFFFFFFFF0FFFFFFFEFFFFFFFFFFB0000
0008FFFFFFFFFFFFFFFFFFFB3FFFFFFFFFFFFFFFFFFF1000
000EFFFFFFFFFFFFFFFFFFF87FFFFFFFFFFFFFFFFFFF6000
002FFFFFFFFFFFFFFFFFFEC38DFFFFFFFFFFFFFFFFFFA000
006FFFFFFFFFFFFFFFA5100000027DFFFFFFFFFFFFFFE000
009FFFFFFFFF735DA10000000000004D834BFFFFFFFFF100
00BFFFFFFFF4000000000000000000000000CFFFFFFFF300
00CFFFFFFFE00000000000000000000000006FFFFFFFF400
00DFFFFFFFD00000002200000000300000005FFFFFFFF500
00CFFFFFFFF3000008FF8000002EFE200000BFFFFFFFF500
00CFFFFFFFFE30001FFFF100008FFF900009FFFFFFFFF400
00AFFFFFFFFF50000FFFF000008FFF80000CFFFFFFFFF200
008FFFFFFFFF500006FF6000001CFC10000CFFFFFFFFF000
004FFFFFFFFF80000000000000000000000EFFFFFFFFC000
000FFFFFFFFFD0000000000000000000004FFFFFFFFF8000
000BFFFFFFFFF600001B20000007800000CFFFFFFFFF4000
0005FFFFFFFFFF300007EC989AEC200009FFFFFFFFFE0000
0000EFFFFFFFFFF40000047876200000AFFFFFFFFFF70000
00007FFFFFFFFFFFA10000000000004DFFFFFFFFFFF00000
00000EFFFFFFFFFFFFA4100000027DFFFFFFFFFFFF700000
000005FFFFFFFFFFFFFFFECBCDFFFFFFFFFFFFFFFD000000
000000AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3000000
0000000DFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60000000
00000001EFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF800000000
000000002DFFFFFFFFFFFFFFFFFFFFFFFFFFFF8000000000
0000000001CFFFFFFFFFFFFFFFFFFFFFFFFFF60000000000
000000000008FFFFFFFFFFFFFFFFFFFFFFFD300000000000
0000000000002BFFFFFFFFFFFFFFFFFFFF70000000000000
000000000000003BFFFFFFFFFFFFFFFE7000000000000000
000000000000000016AEFFFFFFFFC8400000000000000000
000000000000000000001345542000000000000000000000
000000000000000000000000000000000000000000000000
000000000000000000000000000000000000000000000000
}
!define FA_REDDIT(_alias) ENTITY(rectangle,black,reddit,_alias,FA REDDIT)
!define FA_REDDIT(_alias, _label) ENTITY(rectangle,black,reddit,_label, _alias,FA REDDIT)
!define FA_REDDIT(_alias, _label, _shape) ENTITY(_shape,black,reddit,_label, _alias,FA REDDIT)
!define FA_REDDIT(_alias, _label, _shape, _color) ENTITY(_shape,_color,reddit,_label, _alias,FA REDDIT)
skinparam folderBackgroundColor<<FA REDDIT>> White
@enduml
|
{
"pile_set_name": "Github"
}
|
#ifndef __ALPHA_MMU_H
#define __ALPHA_MMU_H
/* The alpha MMU context is one "unsigned long" bitmap per CPU */
typedef unsigned long mm_context_t[NR_CPUS];
#endif
|
{
"pile_set_name": "Github"
}
|
define([
"./core",
"./var/rnotwhite"
], function( jQuery, rnotwhite ) {
// String to Object options format cache
var optionsCache = {};
// Convert String-formatted options into Object-formatted ones and store in cache
function createOptions( options ) {
var object = optionsCache[ options ] = {};
jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
object[ flag ] = true;
});
return object;
}
/*
* Create a callback list using the following parameters:
*
* options: an optional list of space-separated options that will change how
* the callback list behaves or a more traditional option object
*
* By default a callback list will act like an event callback list and can be
* "fired" multiple times.
*
* Possible options:
*
* once: will ensure the callback list can only be fired once (like a Deferred)
*
* memory: will keep track of previous values and will call any callback added
* after the list has been fired right away with the latest "memorized"
* values (like a Deferred)
*
* unique: will ensure a callback can only be added once (no duplicate in the list)
*
* stopOnFalse: interrupt callings when a callback returns false
*
*/
jQuery.Callbacks = function( options ) {
// Convert options from String-formatted to Object-formatted if needed
// (we check in cache first)
options = typeof options === "string" ?
( optionsCache[ options ] || createOptions( options ) ) :
jQuery.extend( {}, options );
var // Last fire value (for non-forgettable lists)
memory,
// Flag to know if list was already fired
fired,
// Flag to know if list is currently firing
firing,
// First callback to fire (used internally by add and fireWith)
firingStart,
// End of the loop when firing
firingLength,
// Index of currently firing callback (modified by remove if needed)
firingIndex,
// Actual callback list
list = [],
// Stack of fire calls for repeatable lists
stack = !options.once && [],
// Fire callbacks
fire = function( data ) {
memory = options.memory && data;
fired = true;
firingIndex = firingStart || 0;
firingStart = 0;
firingLength = list.length;
firing = true;
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
memory = false; // To prevent further calls using add
break;
}
}
firing = false;
if ( list ) {
if ( stack ) {
if ( stack.length ) {
fire( stack.shift() );
}
} else if ( memory ) {
list = [];
} else {
self.disable();
}
}
},
// Actual Callbacks object
self = {
// Add a callback or a collection of callbacks to the list
add: function() {
if ( list ) {
// First, we save the current length
var start = list.length;
(function add( args ) {
jQuery.each( args, function( _, arg ) {
var type = jQuery.type( arg );
if ( type === "function" ) {
if ( !options.unique || !self.has( arg ) ) {
list.push( arg );
}
} else if ( arg && arg.length && type !== "string" ) {
// Inspect recursively
add( arg );
}
});
})( arguments );
// Do we need to add the callbacks to the
// current firing batch?
if ( firing ) {
firingLength = list.length;
// With memory, if we're not firing then
// we should call right away
} else if ( memory ) {
firingStart = start;
fire( memory );
}
}
return this;
},
// Remove a callback from the list
remove: function() {
if ( list ) {
jQuery.each( arguments, function( _, arg ) {
var index;
while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
list.splice( index, 1 );
// Handle firing indexes
if ( firing ) {
if ( index <= firingLength ) {
firingLength--;
}
if ( index <= firingIndex ) {
firingIndex--;
}
}
}
});
}
return this;
},
// Check if a given callback is in the list.
// If no argument is given, return whether or not list has callbacks attached.
has: function( fn ) {
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
},
// Remove all callbacks from the list
empty: function() {
list = [];
firingLength = 0;
return this;
},
// Have the list do nothing anymore
disable: function() {
list = stack = memory = undefined;
return this;
},
// Is it disabled?
disabled: function() {
return !list;
},
// Lock the list in its current state
lock: function() {
stack = undefined;
if ( !memory ) {
self.disable();
}
return this;
},
// Is it locked?
locked: function() {
return !stack;
},
// Call all callbacks with the given context and arguments
fireWith: function( context, args ) {
if ( list && ( !fired || stack ) ) {
args = args || [];
args = [ context, args.slice ? args.slice() : args ];
if ( firing ) {
stack.push( args );
} else {
fire( args );
}
}
return this;
},
// Call all the callbacks with the given arguments
fire: function() {
self.fireWith( this, arguments );
return this;
},
// To know if the callbacks have already been called at least once
fired: function() {
return !!fired;
}
};
return self;
};
return jQuery;
});
|
{
"pile_set_name": "Github"
}
|
package com.oath.micro.server.application.registry;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Supplier;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import cyclops.function.FluentFunctions;
import cyclops.reactive.ReactiveSeq;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ManifestLoader {
public final static ManifestLoader instance = new ManifestLoader();
private final Logger logger = LoggerFactory.getLogger(getClass());
Supplier<Map<String, String>> fn = FluentFunctions.of(this::manifest).memoize();
public Map<String, String> getManifest() {
return fn.get();
}
private Map<String, String> manifest() {
try {
return ReactiveSeq.of("META-INF/MANIFEST.MF")
.map(url -> this.getClass()
.getClassLoader()
.getResourceAsStream(url))
.map(this::getManifest)
.single()
.orElse(null);
} catch (Exception e) {
logger.warn("Warning : can't load manifest due to exception {}", e.getMessage());
}
return null;
}
public Map<String, String> getManifest(final InputStream input) {
final Map<String, String> retMap = new HashMap<String, String>();
try {
Manifest manifest = new Manifest();
manifest.read(input);
final Attributes attributes = manifest.getMainAttributes();
for (final Map.Entry attribute : attributes.entrySet()) {
retMap.put(attribute.getKey().toString(), attribute.getValue().toString());
}
} catch (final Exception ex) {
logger.error("Failed to load manifest ", ex);
}
return retMap;
}
}
|
{
"pile_set_name": "Github"
}
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Scenario3.aspx.cs" Inherits="Core.ContentTypesAndFieldsWeb.Pages.Scenario3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="../Scripts/jquery-1.9.1.js"></script>
<script type="text/javascript" src="../Scripts/app.js"></script>
</head>
<body style="display: none; overflow: auto;">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnableCdn="True" />
<div id="divSPChrome"></div>
<div style="left: 40px; position: absolute;">
<h1>Scenario 3: List and content types</h1>
In this scenario you'll learn how to create content type and how to associate it as default content type to a list.
<br />
<i>Notice that there's no automatic cleaning with these scenarios.</i>
<ul style="list-style-type: square;">
<li>Creation of new content type</li>
<li>Adding site columns to newly added content type</li>
<li>Associating content type to newly created list</li>
<li>Set content type as default content type for the list</li>
</ul>
<br />
Choose a list name for the newly created list which we will manipulate as needed. If list exists already, it will be also modified.
<br />
<asp:TextBox runat="server" ID="txtListName" Text="Sample" />
<br />
<br />
<asp:Button runat="server" ID="btnScenario3" Text="Run scenario 3" OnClick="btnScenario3_Click" />
<asp:Label ID="lblStatus3" runat="server" />
<br />
</div>
</form>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
//
// EndTag.cs: Provides support for accessing and modifying a collection of tags
// appearing at the end of a file.
//
// Author:
// Brian Nickel (brian.nickel@gmail.com)
//
// Copyright (C) 2007 Brian Nickel
//
// 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.
//
using System;
namespace TagLib.NonContainer
{
/// <summary>
/// This class extends <see cref="CombinedTag" />, providing support
/// for accessing and modifying a collection of tags appearing at the
/// end of a file.
/// </summary>
/// <remarks>
/// <para>This class is used by <see cref="TagLib.NonContainer.File"
/// /> to read all the tags appearing at the end of the file but
/// could be used by other classes. It currently supports ID3v1,
/// ID3v2, and APE tags.</para>
/// </remarks>
public class EndTag : CombinedTag
{
#region Private Fields
/// <summary>
/// Contains the file to operate on.
/// </summary>
readonly TagLib.File file;
/// <summary>
/// Contains the number of bytes that must be read to
/// hold all applicable indicators.
/// </summary>
static readonly int read_size = (int)Math.Max (Math.Max (Ape.Footer.Size, Id3v2.Footer.Size), Id3v1.Tag.Size);
#endregion
#region Constructors
/// <summary>
/// Constructs and initializes a new instance of <see
/// cref="EndTag" /> for a specified <see cref="TagLib.File"
/// />.
/// </summary>
/// <param name="file">
/// A <see cref="TagLib.File" /> object on which the new
/// instance will perform its operations.
/// </param>
/// <remarks>
/// Constructing a new instance does not automatically read
/// the contents from the disk. <see cref="Read" /> must be
/// called to read the tags.
/// </remarks>
public EndTag (TagLib.File file)
{
this.file = file;
}
#endregion
#region Public Properties
/// <summary>
/// Gets the total size of the tags located at the end of the
/// file by reading from the file.
/// </summary>
public long TotalSize {
get {
long start = file.Length;
while (ReadTagInfo (ref start) != TagTypes.None)
;
return file.Length - start;
}
}
#endregion
#region Public Methods
/// <summary>
/// Reads the tags stored at the end of the file into the
/// current instance.
/// </summary>
/// <returns>
/// A <see cref="long" /> value indicating the seek position
/// in the file at which the read tags begin. This also
/// marks the seek position at which the media ends.
/// </returns>
public long Read (ReadStyle style)
{
TagLib.Tag tag;
ClearTags ();
long start = file.Length;
while ((tag = ReadTag (ref start, style)) != null)
InsertTag (0, tag);
return start;
}
/// <summary>
/// Renders the tags contained in the current instance.
/// </summary>
/// <returns>
/// A <see cref="ByteVector" /> object containing the
/// physical representation of the tags stored in the current
/// instance.
/// </returns>
/// <remarks>
/// The tags are rendered in the order that they are stored
/// in the current instance.
/// </remarks>
public ByteVector Render ()
{
ByteVector data = new ByteVector ();
foreach (TagLib.Tag t in Tags) {
if (t is Ape.Tag tag)
data.Add (tag.Render ());
else if (t is Id3v2.Tag tag1)
data.Add (tag1.Render ());
else if (t is Id3v1.Tag tag2)
data.Add (tag2.Render ());
}
return data;
}
/// <summary>
/// Writes the tags contained in the current instance to the
/// end of the file that created it, overwriting the existing
/// tags.
/// </summary>
/// <returns>
/// A <see cref="long" /> value indicating the seek position
/// in the file at which the written tags begin. This also
/// marks the seek position at which the media ends.
/// </returns>
public long Write ()
{
long total_size = TotalSize;
ByteVector data = Render ();
file.Insert (data, file.Length - total_size, total_size);
return file.Length - data.Count;
}
/// <summary>
/// Removes a set of tag types from the current instance.
/// </summary>
/// <param name="types">
/// A bitwise combined <see cref="TagLib.TagTypes" /> value
/// containing tag types to be removed from the file.
/// </param>
/// <remarks>
/// In order to remove all tags from a file, pass <see
/// cref="TagTypes.AllTags" /> as <paramref name="types" />.
/// </remarks>
public void RemoveTags (TagTypes types)
{
for (int i = Tags.Length - 1; i >= 0; i--) {
var tag = Tags[i];
if (types == TagTypes.AllTags || (tag.TagTypes & types) == tag.TagTypes) {
RemoveTag (tag);
}
}
}
/// <summary>
/// Adds a tag of a specified type to the current instance,
/// optionally copying values from an existing type.
/// </summary>
/// <param name="type">
/// A <see cref="TagTypes" /> value specifying the type of
/// tag to add to the current instance. At the time of this
/// writing, this is limited to <see cref="TagTypes.Ape" />,
/// <see cref="TagTypes.Id3v1" />, and <see
/// cref="TagTypes.Id3v2" />.
/// </param>
/// <param name="copy">
/// A <see cref="TagLib.Tag" /> to copy values from using
/// <see cref="TagLib.Tag.CopyTo" />, or <see
/// langword="null" /> if no tag is to be copied.
/// </param>
/// <returns>
/// The <see cref="TagLib.Tag" /> object added to the current
/// instance, or <see langword="null" /> if it couldn't be
/// created.
/// </returns>
/// <remarks>
/// ID3v2 tags are added at the end of the current instance,
/// while other tags are added to the beginning.
/// </remarks>
public TagLib.Tag AddTag (TagTypes
|
{
"pile_set_name": "Github"
}
|
/**
* 图片上传模块
*/
const fly = require("flyio");
const request = require('../libs/request');
module.exports = async function (originUrl) {
return originUrl;
let params = {
source: originUrl,
type: "url",
action: "upload",
timestamp: new Date().getTime(),
auth_token: "a677acae12fee7248397b016ca53b702eafea751",
nsfw: 0,
album_id: "jpC"
}
let headers = {
"accept": "application/json",
"origin": "https://extraimage.net",
"pragma": "no-cache",
"referer": "https://extraimage.net/lisniuse",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"content-type": "multipart/form-data; boundary=----WebKitFormBoundaryQJy3LEdj7ESiAljn",
"cookie": "__cfduid=d2e447103eefd5df5b75e87c11d8088631547967634; _ga=GA1.2.1230322488.1565976568; PHPSESSID=m40e3l8g2d7hpgdos4nj2qlch8; _gid=GA1.2.921531165.1571365602; _gat=1"
}
let result = await fly.upload("https://extraimage.net/json", params, {
headers
});
let url = result.data.image.url;
return url;
// return request.post('https://extraimage.net/json', params, headers);
}
|
{
"pile_set_name": "Github"
}
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#ifndef C_PIXEL_VISIBILITY_H
#define C_PIXEL_VISIBILITY_H
#ifdef _WIN32
#pragma once
#endif
const float PIXELVIS_DEFAULT_PROXY_SIZE = 2.0f;
const float PIXELVIS_DEFAULT_FADE_TIME = 0.0625f;
typedef int pixelvis_handle_t;
struct pixelvis_queryparams_t
{
pixelvis_queryparams_t()
{
bSetup = false;
}
void Init( const Vector &origin, float proxySizeIn = PIXELVIS_DEFAULT_PROXY_SIZE, float proxyAspectIn = 1.0f, float fadeTimeIn = PIXELVIS_DEFAULT_FADE_TIME )
{
position = origin;
proxySize = proxySizeIn;
proxyAspect = proxyAspectIn;
fadeTime = fadeTimeIn;
bSetup = true;
bSizeInScreenspace = false;
}
Vector position;
float proxySize;
float proxyAspect;
float fadeTime;
bool bSetup;
bool bSizeInScreenspace;
};
float PixelVisibility_FractionVisible( const pixelvis_queryparams_t ¶ms, pixelvis_handle_t *queryHandle );
float StandardGlowBlend( const pixelvis_queryparams_t ¶ms, pixelvis_handle_t *queryHandle, int rendermode, int renderfx, int alpha, float *pscale );
void PixelVisibility_ShiftVisibilityViews( int iSourceViewID, int iDestViewID ); //mainly needed by portal mod to avoid a pop in visibility when teleporting the player
void PixelVisibility_EndCurrentView();
void PixelVisibility_EndScene();
float GlowSightDistance( const Vector &glowOrigin, bool bShouldTrace );
// returns true if the video hardware is doing the tests, false is traceline is doing so.
bool PixelVisibility_IsAvailable();
#endif // C_PIXEL_VISIBILITY_H
|
{
"pile_set_name": "Github"
}
|
from setuptools import setup
import re
requirements = []
with open('requirements.txt') as f:
requirements = f.read().splitlines()
version = ''
with open('discord/__init__.py') as f:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE).group(1)
if not version:
raise RuntimeError('version is not set')
if version.endswith(('a', 'b', 'rc')):
# append version identifier based on commit count
try:
import subprocess
p = subprocess.Popen(['git', 'rev-list', '--count', 'HEAD'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
version += out.decode('utf-8').strip()
p = subprocess.Popen(['git', 'rev-parse', '--short', 'HEAD'],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
if out:
version += '+g' + out.decode('utf-8').strip()
except Exception:
pass
readme = ''
with open('README.rst') as f:
readme = f.read()
extras_require = {
'voice': ['PyNaCl==1.3.0'],
'docs': [
'sphinx==1.8.5',
'sphinxcontrib_trio==1.1.1',
'sphinxcontrib-websupport',
]
}
setup(name='discord.py',
author='Rapptz',
url='https://github.com/Rapptz/discord.py',
project_urls={
"Documentation": "https://discordpy.readthedocs.io/en/latest/",
"Issue tracker": "https://github.com/Rapptz/discord.py/issues",
},
version=version,
packages=['discord', 'discord.ext.commands', 'discord.ext.tasks'],
license='MIT',
description='A Python wrapper for the Discord API',
long_description=readme,
long_description_content_type="text/x-rst",
include_package_data=True,
install_requires=requirements,
extras_require=extras_require,
python_requires='>=3.5.3',
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: MIT License',
'Intended Audience :: Developers',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Topic :: Internet',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
]
)
|
{
"pile_set_name": "Github"
}
|
package com.google.android.apps.common.testing.ui.testapp;
import static com.google.android.apps.common.testing.ui.espresso.Espresso.onView;
import static com.google.android.apps.common.testing.ui.espresso.Espresso.setFailureHandler;
import static com.google.android.apps.common.testing.ui.espresso.action.ViewActions.click;
import static com.google.android.apps.common.testing.ui.espresso.matcher.ViewMatchers.withText;
import com.google.android.apps.common.testing.ui.espresso.FailureHandler;
import com.google.android.apps.common.testing.ui.espresso.NoMatchingViewException;
import com.google.android.apps.common.testing.ui.espresso.base.DefaultFailureHandler;
import com.google.android.apps.common.testing.ui.testapp.MainActivity;
import android.content.Context;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.util.Log;
import android.view.View;
import org.hamcrest.Matcher;
/**
* A sample of how to set a non-default {@link FailureHandler}.
*/
@LargeTest
public class CustomFailureHandlerTest extends ActivityInstrumentationTestCase2<MainActivity> {
private static final String TAG = "CustomFailureHandlerTest";
@SuppressWarnings("deprecation")
public CustomFailureHandlerTest() {
// This constructor was deprecated - but we want to support lower API levels.
super("com.google.android.apps.common.testing.ui.testapp", MainActivity.class);
}
@Override
public void setUp() throws Exception {
super.setUp();
getActivity();
setFailureHandler(new CustomFailureHandler(getInstrumentation().getTargetContext()));
}
public void testWithCustomFailureHandler() {
try {
onView(withText("does not exist")).perform(click());
} catch (MySpecialException expected) {
Log.e(TAG, "Special exception is special and expected: ", expected);
}
}
/**
* A {@link FailureHandler} that re-throws {@link NoMatchingViewException} as
* {@link MySpecialException}. All other functionality is delegated to
* {@link DefaultFailureHandler}.
*/
private static class CustomFailureHandler implements FailureHandler {
private final FailureHandler delegate;
public CustomFailureHandler(Context targetContext) {
delegate = new DefaultFailureHandler(targetContext);
}
@Override
public void handle(Throwable error, Matcher<View> viewMatcher) {
try {
delegate.handle(error, viewMatcher);
} catch (NoMatchingViewException e) {
throw new MySpecialException(e);
}
}
}
private static class MySpecialException extends RuntimeException {
MySpecialException(Throwable cause) {
super(cause);
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (C) 2014 The SciGraph authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.scigraph.neo4j;
import static com.google.common.collect.Iterables.size;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import io.scigraph.neo4j.Graph;
import io.scigraph.neo4j.GraphBatchImpl;
import io.scigraph.neo4j.IdMap;
import io.scigraph.neo4j.RelationshipMap;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.mapdb.DB;
import org.mapdb.DBMaker;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.factory.GraphDatabaseFactory;
import org.neo4j.graphdb.index.ReadableIndex;
import org.neo4j.unsafe.batchinsert.BatchInserter;
import org.neo4j.unsafe.batchinsert.BatchInserters;
public class GraphBatchImplMultipleLoadTest {
private static final RelationshipType TYPE = RelationshipType.withName("type");
@Rule
public TemporaryFolder folder = new TemporaryFolder();
String path;
GraphDatabaseService graphDb;
ReadableIndex<Node> nodeIndex;
DB maker;
@Before
public void setup() throws IOException {
path = folder.newFolder().getAbsolutePath();
maker = DBMaker.newMemoryDB().make();
}
Graph getBatchGraph() throws IOException {
BatchInserter inserter = BatchInserters.inserter(new File(path));
return new GraphBatchImpl(inserter, "uri", Collections.<String>emptySet(), Collections.<String>emptySet(),
new IdMap(maker), new RelationshipMap(maker));
}
GraphDatabaseService getGraphDB() {
graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(new File(path));
return graphDb;
}
@Test
public void testMultipleInserts() throws IOException {
Graph batchGraph = getBatchGraph();
long a = batchGraph.createNode("a");
long b = batchGraph.createNode("b");
batchGraph.createRelationship(a, b, TYPE);
batchGraph.shutdown();
batchGraph = getBatchGraph();
a = batchGraph.createNode("a");
long c = batchGraph.createNode("c");
batchGraph.createRelationship(a, c, TYPE);
batchGraph.shutdown();
GraphDatabaseService graphDb = getGraphDB();
try (Transaction tx = graphDb.beginTx()) {
Iterable<Node> nodes = graphDb.getAllNodes();
assertThat(size(nodes), is(3));
Iterable<Relationship> relationships = graphDb.getAllRelationships();
assertThat(size(relationships), is(2));
tx.success();
}
}
}
|
{
"pile_set_name": "Github"
}
|
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2008 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2008 Benoit Jacob <jacob.benoit.1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef EIGEN_CWISE_H
#define EIGEN_CWISE_H
namespace Eigen {
/** \internal
* convenient macro to defined the return type of a cwise binary operation */
#define EIGEN_CWISE_BINOP_RETURN_TYPE(OP) \
CwiseBinaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType, OtherDerived>
/** \internal
* convenient macro to defined the return type of a cwise unary operation */
#define EIGEN_CWISE_UNOP_RETURN_TYPE(OP) \
CwiseUnaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType>
/** \internal
* convenient macro to defined the return type of a cwise comparison to a scalar */
#define EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(OP) \
CwiseBinaryOp<OP<typename internal::traits<ExpressionType>::Scalar>, ExpressionType, \
typename ExpressionType::ConstantReturnType >
/** \class Cwise
*
* \brief Pseudo expression providing additional coefficient-wise operations
*
* \param ExpressionType the type of the object on which to do coefficient-wise operations
*
* This class represents an expression with additional coefficient-wise features.
* It is the return type of MatrixBase::cwise()
* and most of the time this is the only way it is used.
*
* Example: \include MatrixBase_cwise_const.cpp
* Output: \verbinclude MatrixBase_cwise_const.out
*
* This class can be extended with the help of the plugin mechanism described on the page
* \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_CWISE_PLUGIN.
*
* \sa MatrixBase::cwise() const, MatrixBase::cwise()
*/
template<typename ExpressionType> class Cwise
{
public:
typedef typename internal::traits<ExpressionType>::Scalar Scalar;
typedef typename internal::conditional<internal::must_nest_by_value<ExpressionType>::ret,
ExpressionType, const ExpressionType&>::type ExpressionTypeNested;
typedef CwiseUnaryOp<internal::scalar_add_op<Scalar>, ExpressionType> ScalarAddReturnType;
inline Cwise(const ExpressionType& matrix) : m_matrix(matrix) {}
/** \internal */
inline const ExpressionType& _expression() const { return m_matrix; }
template<typename OtherDerived>
const EIGEN_CWISE_PRODUCT_RETURN_TYPE(ExpressionType,OtherDerived)
operator*(const MatrixBase<OtherDerived> &other) const;
template<typename OtherDerived>
const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_quotient_op)
operator/(const MatrixBase<OtherDerived> &other) const;
/** \deprecated ArrayBase::min() */
template<typename OtherDerived>
const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_min_op)
(min)(const MatrixBase<OtherDerived> &other) const
{ return EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_min_op)(_expression(), other.derived()); }
/** \deprecated ArrayBase::max() */
template<typename OtherDerived>
const EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_max_op)
(max)(const MatrixBase<OtherDerived> &other) const
{ return EIGEN_CWISE_BINOP_RETURN_TYPE(internal::scalar_max_op)(_expression(), other.derived()); }
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_abs_op) abs() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_abs2_op) abs2() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_square_op) square() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_cube_op) cube() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_inverse_op) inverse() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_sqrt_op) sqrt() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_exp_op) exp() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_log_op) log() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_cos_op) cos() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_sin_op) sin() const;
const EIGEN_CWISE_UNOP_RETURN_TYPE(internal::scalar_pow_op) pow(const Scalar& exponent) const;
const ScalarAddReturnType
operator+(const Scalar& scalar) const;
/** \relates Cwise */
friend const ScalarAddReturnType
operator+(const Scalar& scalar, const Cwise& mat)
{ return mat + scalar; }
ExpressionType& operator+=(const Scalar& scalar);
const ScalarAddReturnType
operator-(const Scalar& scalar) const;
ExpressionType& operator-=(const Scalar& scalar);
template<typename OtherDerived>
inline ExpressionType& operator*=(const MatrixBase<OtherDerived> &other);
template<typename OtherDerived>
inline ExpressionType& operator/=(const MatrixBase<OtherDerived> &other);
template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::less)
operator<(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::less_equal)
operator<=(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::greater)
operator>(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::greater_equal)
operator>=(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::equal_to)
operator==(const MatrixBase<OtherDerived>& other) const;
template<typename OtherDerived> const EIGEN_CWISE_BINOP_RETURN_TYPE(std::not_equal_to)
operator!=(const MatrixBase<OtherDerived>& other) const;
// comparisons to a scalar value
const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::less)
operator<(Scalar s) const;
const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::less_equal)
operator<=(Scalar s) const;
const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::greater)
operator>(Scalar s) const;
const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::greater_equal)
operator>=(Scalar s) const;
const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::equal_to)
operator==(Scalar s) const;
const EIGEN_CWISE_COMP_TO_SCALAR_RETURN_TYPE(std::not_equal_to)
operator!=(Scalar s) const;
// allow to extend Cwise outside Eigen
#ifdef EIGEN_CWISE_PLUGIN
#include EIGEN_CWISE_PLUGIN
#endif
protected:
ExpressionTypeNested m_matrix;
};
/** \returns a Cwise wrapper of *this providing additional coefficient-wise operations
*
* Example: \include MatrixBase_cwise_const.cpp
* Output: \verbinclude Matrix
|
{
"pile_set_name": "Github"
}
|
"use strict";
module.exports = function() {
var makeSelfResolutionError = function () {
return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/LhFpo0\u000a");
};
var reflect = function() {
return new Promise.PromiseInspection(this._target());
};
var apiRejection = function(msg) {
return Promise.reject(new TypeError(msg));
};
var util = require("./util.js");
var getDomain;
if (util.isNode) {
getDomain = function() {
var ret = process.domain;
if (ret === undefined) ret = null;
return ret;
};
} else {
getDomain = function() {
return null;
};
}
util.notEnumerableProp(Promise, "_getDomain", getDomain);
var UNDEFINED_BINDING = {};
var async = require("./async.js");
var errors = require("./errors.js");
var TypeError = Promise.TypeError = errors.TypeError;
Promise.RangeError = errors.RangeError;
Promise.CancellationError = errors.CancellationError;
Promise.TimeoutError = errors.TimeoutError;
Promise.OperationalError = errors.OperationalError;
Promise.RejectionError = errors.OperationalError;
Promise.AggregateError = errors.AggregateError;
var INTERNAL = function(){};
var APPLY = {};
var NEXT_FILTER = {e: null};
var tryConvertToPromise = require("./thenables.js")(Promise, INTERNAL);
var PromiseArray =
require("./promise_array.js")(Promise, INTERNAL,
tryConvertToPromise, apiRejection);
var CapturedTrace = require("./captured_trace.js")();
var isDebugging = require("./debuggability.js")(Promise, CapturedTrace);
/*jshint unused:false*/
var createContext =
require("./context.js")(Promise, CapturedTrace, isDebugging);
var CatchFilter = require("./catch_filter.js")(NEXT_FILTER);
var PromiseResolver = require("./promise_resolver.js");
var nodebackForPromise = PromiseResolver._nodebackForPromise;
var errorObj = util.errorObj;
var tryCatch = util.tryCatch;
function Promise(resolver) {
if (typeof resolver !== "function") {
throw new TypeError("the promise constructor requires a resolver function\u000a\u000a See http://goo.gl/EC22Yn\u000a");
}
if (this.constructor !== Promise) {
throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/KsIlge\u000a");
}
this._bitField = 0;
this._fulfillmentHandler0 = undefined;
this._rejectionHandler0 = undefined;
this._progressHandler0 = undefined;
this._promise0 = undefined;
this._receiver0 = undefined;
this._settledValue = undefined;
if (resolver !== INTERNAL) this._resolveFromResolver(resolver);
}
Promise.prototype.toString = function () {
return "[object Promise]";
};
Promise.prototype.caught = Promise.prototype["catch"] = function (fn) {
var len = arguments.length;
if (len > 1) {
var catchInstances = new Array(len - 1),
j = 0, i;
for (i = 0; i < len - 1; ++i) {
var item = arguments[i];
if (typeof item === "function") {
catchInstances[j++] = item;
} else {
return Promise.reject(
new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a"));
}
}
catchInstances.length = j;
fn = arguments[i];
var catchFilter = new CatchFilter(catchInstances, fn, this);
return this._then(undefined, catchFilter.doFilter, undefined,
catchFilter, undefined);
}
return this._then(undefined, fn, undefined, undefined, undefined);
};
Promise.prototype.reflect = function () {
return this._then(reflect, reflect, undefined, this, undefined);
};
Promise.prototype.then = function (didFulfill, didReject, didProgress) {
if (isDebugging() && arguments.length > 0 &&
typeof didFulfill !== "function" &&
typeof didReject !== "function") {
var msg = ".then() only accepts functions but was passed: " +
util.classString(didFulfill);
if (arguments.length > 1) {
msg += ", " + util.classString(didReject);
}
this._warn(msg);
}
return this._then(didFulfill, didReject, didProgress,
undefined, undefined);
};
Promise.prototype.done = function (didFulfill, didReject, didProgress) {
var promise = this._then(didFulfill, didReject, didProgress,
undefined, undefined);
promise._setIsFinal();
};
Promise.prototype.spread = function (didFulfill, didReject) {
return this.all()._then(didFulfill, didReject, undefined, APPLY, undefined);
};
Promise.prototype.isCancellable = function () {
return !this.isResolved() &&
this._cancellable();
};
Promise.prototype.toJSON = function () {
var ret = {
isFulfilled: false,
isRejected: false,
fulfillmentValue: undefined,
rejectionReason: undefined
};
if (this.isFulfilled()) {
ret.fulfillmentValue = this.value();
ret.isFulfilled = true;
} else if (this.isRejected()) {
ret.rejectionReason = this.reason();
ret.isRejected = true;
}
return ret;
};
Promise.prototype.all = function () {
return new PromiseArray(this).promise();
};
Promise.prototype.error = function (fn) {
return this.caught(util.originatesFromRejection, fn);
};
Promise.is = function (val) {
return val instanceof Promise;
};
Promise.fromNode = function(fn) {
var ret = new Promise(INTERNAL);
var result = tryCatch(fn)(nodebackForPromise(ret));
if (result === errorObj) {
ret._rejectCallback(result.e, true, true);
}
return ret;
};
Promise.all = function (promises) {
return new PromiseArray(promises).promise();
};
Promise.defer = Promise.pending = function () {
var promise = new Promise(INTERNAL);
return new PromiseResolver(promise);
};
Promise.cast = function (obj) {
var ret = tryConvertToPromise(obj);
if (!(ret instanceof Promise)) {
var val = ret;
ret = new Promise(INTERNAL);
ret._fulfillUnchecked(val);
}
return ret;
};
Promise.resolve = Promise.fulfilled = Promise.cast;
Promise.reject = Promise.rejected = function (reason) {
var ret = new Promise(INTERNAL);
ret._captureStackTrace();
ret._rejectCallback(reason, true);
return ret;
};
Promise.setScheduler = function(fn) {
if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a");
var prev = async._schedule;
async._schedule = fn;
return prev;
};
Promise.prototype._then = function (
didFulfill,
didReject,
didProgress,
receiver,
internalData
) {
var haveInternalData = internalData !== undefined;
var ret = haveInternalData ? internalData : new Promise(INTERNAL);
if (!haveInternalData) {
ret._propag
|
{
"pile_set_name": "Github"
}
|
<div local-class="event">
{{svg-jar @icon local-class="icon" class=(if @smallIcon "fa-svg small" "fa-svg")}}
<div>
<div local-class="badge-and-time">
<time
datetime={{to-iso-string @time}}
title={{format-time @time format="full"}}
local-class="time"
>
{{format-relative @time}}
</time>
{{#if @newBadge}}
<span local-class="new-badge">{{t "new"}}</span>
{{/if}}
</div>
<div local-class="text" data-test-text>
{{@text}}
</div>
</div>
<a href={{@url}} local-class="show-button">{{t "show"}}</a>
</div>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="paho.mqtt.java.example">
<!-- Permissions the Application Requires -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--<uses-permission android:name="android.permission.READ_PHONE_STATE" />-->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".PahoExampleActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Mqtt Service -->
<service android:name="org.eclipse.paho.android.service.MqttService">
</service>
</application>
</manifest>
|
{
"pile_set_name": "Github"
}
|
#include "ctrl.h"
#include "buffer.h"
#include <nvm_types.h>
#include <nvm_ctrl.h>
#include <nvm_aq.h>
#include <nvm_admin.h>
#include <nvm_util.h>
#include <nvm_error.h>
#include <string>
#include <memory>
#include <vector>
#include <stdexcept>
#include <cstdint>
#include <cstddef>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <unistd.h>
#include <fcntl.h>
#include <cstdlib>
using error = std::runtime_error;
using std::string;
static void initializeController(struct Controller& ctrl, uint32_t ns_id)
{
// Create admin queue reference
int status = nvm_aq_create(&ctrl.aq_ref, ctrl.ctrl, ctrl.aq_mem.get());
if (!nvm_ok(status))
{
throw error(string("Failed to reset controller: ") + nvm_strerror(status));
}
// Identify controller
status = nvm_admin_ctrl_info(ctrl.aq_ref, &ctrl.info, NVM_DMA_OFFSET(ctrl.aq_mem, 2), ctrl.aq_mem->ioaddrs[2]);
if (!nvm_ok(status))
{
throw error(nvm_strerror(status));
}
// Identify namespace
status = nvm_admin_ns_info(ctrl.aq_ref, &ctrl.ns, ns_id, NVM_DMA_OFFSET(ctrl.aq_mem, 2), ctrl.aq_mem->ioaddrs[2]);
if (!nvm_ok(status))
{
throw error(nvm_strerror(status));
}
// Get number of queues
status = nvm_admin_get_num_queues(ctrl.aq_ref, &ctrl.n_cqs, &ctrl.n_sqs);
if (!nvm_ok(status))
{
throw error(nvm_strerror(status));
}
}
#ifdef __DIS_CLUSTER__
Controller::Controller(uint64_t ctrl_id, uint32_t ns_id, uint32_t adapter, uint32_t segment_id)
: ctrl(nullptr)
, aq_ref(nullptr)
{
// Get controller reference
int status = nvm_dis_ctrl_init(&ctrl, ctrl_id, adapter);
if (!nvm_ok(status))
{
throw error(string("Failed to get controller reference: ") + nvm_strerror(status));
}
// Create admin queue memory
aq_mem = createDma(ctrl, ctrl->page_size * 3, adapter, segment_id);
initializeController(*this, ns_id);
}
#endif
Controller::Controller(const char* path, uint32_t ns_id)
: ctrl(nullptr)
, aq_ref(nullptr)
{
int fd = open(path, O_RDWR | O_NONBLOCK);
if (fd < 0)
{
throw error(string("Failed to open descriptor: ") + strerror(errno));
}
// Get controller reference
int status = nvm_ctrl_init(&ctrl, fd);
if (!nvm_ok(status))
{
throw error(string("Failed to get controller reference: ") + nvm_strerror(status));
}
// Create admin queue memory
aq_mem = createDma(ctrl, ctrl->page_size * 3);
initializeController(*this, ns_id);
close(fd);
}
Controller::~Controller()
{
nvm_aq_destroy(aq_ref);
nvm_ctrl_free(ctrl);
}
void Controller::reserveQueues()
{
reserveQueues(n_sqs, n_cqs);
}
void Controller::reserveQueues(uint16_t numSubmissionQueues)
{
reserveQueues(numSubmissionQueues, n_cqs);
}
void Controller::reserveQueues(uint16_t numSubs, uint16_t numCpls)
{
int status = nvm_admin_request_num_queues(aq_ref, &numSubs, &numCpls);
if (!nvm_ok(status))
{
throw error(string("Failed to reserve queues: ") + nvm_strerror(status));
}
n_sqs = numSubs;
n_cqs = numCpls;
}
|
{
"pile_set_name": "Github"
}
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tests.R
\name{testDispersion}
\alias{testDispersion}
\title{DHARMa dispersion tests}
\usage{
testDispersion(simulationOutput, alternative = c("two.sided", "greater",
"less"), plot = T, ...)
}
\arguments{
\item{simulationOutput}{an object of class DHARMa with simulated quantile residuals, either created via \code{\link{simulateResiduals}} or by \code{\link{createDHARMa}} for simulations created outside DHARMa}
\item{alternative}{a character string specifying whether the test should test if observations are "greater", "less" or "two.sided" compared to the simulated null hypothesis. Greater corresponds to overdispersion.}
\item{plot}{whether to plot output}
\item{...}{arguments to pass on to \code{\link{testGeneric}}}
}
\description{
This function performs a simulation-based test for over/underdispersion
}
\details{
The function implements two tests, depending on whether it is applied on a simulation with refit = F, or refit = T.
If refit = F, the function tests the sd of the data against the sd of the simulated data.
If refit = T, the function compares the approximate deviance (via squared pearson residuals) with the same quantity from the models refitted with simulated data. Applying this is much slower than the previous alternative. Given the computational cost, I would suggest that most users will be satisfied with the standard dispersion test.
}
\note{
The results of the dispersion test can can differ depending on whether it is evaluated on conditional (= conditional on fitted random effects) or unconditional (= REs are re-simulated) simulations. You can change between conditional or unconditional simulations in \code{\link{simulateResiduals}} if this is supported by the regression package that you use. The default in DHARMa is to use unconditional simulations, but I have often found that conditional simulations are more sensitive to dispersion problems. I recommend trying both, as neither test should be positive if the dispersion is correct.
}
\examples{
testData = createData(sampleSize = 100, overdispersion = 0.5, randomEffectVariance = 0)
fittedModel <- glm(observedResponse ~ Environment1 , family = "poisson", data = testData)
simulationOutput <- simulateResiduals(fittedModel = fittedModel)
# the plot function runs 4 tests
# i) KS test i) Dispersion test iii) Outlier test iv) quantile test
plot(simulationOutput, quantreg = TRUE)
# testResiduals tests distribution, dispersion and outliers
# testResiduals(simulationOutput)
####### Individual tests #######
# KS test for correct distribution of residuals
testUniformity(simulationOutput)
# Dispersion test
testDispersion(simulationOutput) # tests under and overdispersion
testDispersion(simulationOutput, alternative = "less") # only underdispersion
# if model is refitted, a different test will be called
simulationOutput2 <- simulateResiduals(fittedModel = fittedModel, refit = TRUE, seed = 12)
testDispersion(simulationOutput2)
# often useful to test dispersion per group (e.g. binomial data, see vignette)
simulationOutput3 = recalculateResiduals(simulationOutput, group = testData$group)
testDispersion(simulationOutput3)
# Outlier test (number of observations outside simulation envelope)
# Should set type = "boostrap" for exact values
testOutliers(simulationOutput, type = "binomial")
# testing zero inflation
testZeroInflation(simulationOutput)
# testing generic summaries
countOnes <- function(x) sum(x == 1) # testing for number of 1s
testGeneric(simulationOutput, summary = countOnes) # 1-inflation
testGeneric(simulationOutput, summary = countOnes, alternative = "less") # 1-deficit
means <- function(x) mean(x) # testing if mean prediction fits
testGeneric(simulationOutput, summary = means)
spread <- function(x) sd(x) # testing if mean sd fits
testGeneric(simulationOutput, summary = spread)
}
\seealso{
\code{\link{testResiduals}}, \code{\link{testUniformity}}, \code{\link{testOutliers}}, \code{\link{testZeroInflation}}, \code{\link{testGeneric}}, \code{\link{testTemporalAutocorrelation}}, \code{\link{testSpatialAutocorrelation}}, \code{\link{testQuantiles}}
}
\author{
Florian Hartig
}
|
{
"pile_set_name": "Github"
}
|
# Copyright (c) 2016 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
TESTS = dss_buffer dss_cmp dss_payload dss_print
check_PROGRAMS = $(TESTS) $(MPI_CHECKS)
LDFLAGS = $(OPAL_PKG_CONFIG_LDFLAGS)
LDADD = $(top_builddir)/opal/lib@OPAL_LIB_PREFIX@open-pal.la
|
{
"pile_set_name": "Github"
}
|
/*
** 2008 August 18
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file contains routines used for walking the parser tree and
** resolve all identifiers by associating them with a particular
** table and column.
*/
#include "sqliteInt.h"
/*
** Walk the expression tree pExpr and increase the aggregate function
** depth (the Expr.op2 field) by N on every TK_AGG_FUNCTION node.
** This needs to occur when copying a TK_AGG_FUNCTION node from an
** outer query into an inner subquery.
**
** incrAggFunctionDepth(pExpr,n) is the main routine. incrAggDepth(..)
** is a helper function - a callback for the tree walker.
*/
static int incrAggDepth(Walker *pWalker, Expr *pExpr){
if( pExpr->op==TK_AGG_FUNCTION ) pExpr->op2 += pWalker->u.n;
return WRC_Continue;
}
static void incrAggFunctionDepth(Expr *pExpr, int N){
if( N>0 ){
Walker w;
memset(&w, 0, sizeof(w));
w.xExprCallback = incrAggDepth;
w.u.n = N;
sqlite3WalkExpr(&w, pExpr);
}
}
/*
** Turn the pExpr expression into an alias for the iCol-th column of the
** result set in pEList.
**
** If the reference is followed by a COLLATE operator, then make sure
** the COLLATE operator is preserved. For example:
**
** SELECT a+b, c+d FROM t1 ORDER BY 1 COLLATE nocase;
**
** Should be transformed into:
**
** SELECT a+b, c+d FROM t1 ORDER BY (a+b) COLLATE nocase;
**
** The nSubquery parameter specifies how many levels of subquery the
** alias is removed from the original expression. The usual value is
** zero but it might be more if the alias is contained within a subquery
** of the original expression. The Expr.op2 field of TK_AGG_FUNCTION
** structures must be increased by the nSubquery amount.
*/
static void resolveAlias(
Parse *pParse, /* Parsing context */
ExprList *pEList, /* A result set */
int iCol, /* A column in the result set. 0..pEList->nExpr-1 */
Expr *pExpr, /* Transform this into an alias to the result set */
const char *zType, /* "GROUP" or "ORDER" or "" */
int nSubquery /* Number of subqueries that the label is moving */
){
Expr *pOrig; /* The iCol-th column of the result set */
Expr *pDup; /* Copy of pOrig */
sqlite3 *db; /* The database connection */
assert( iCol>=0 && iCol<pEList->nExpr );
pOrig = pEList->a[iCol].pExpr;
assert( pOrig!=0 );
db = pParse->db;
pDup = sqlite3ExprDup(db, pOrig, 0);
if( pDup!=0 ){
if( zType[0]!='G' ) incrAggFunctionDepth(pDup, nSubquery);
if( pExpr->op==TK_COLLATE ){
pDup = sqlite3ExprAddCollateString(pParse, pDup, pExpr->u.zToken);
}
ExprSetProperty(pDup, EP_Alias);
/* Before calling sqlite3ExprDelete(), set the EP_Static flag. This
** prevents ExprDelete() from deleting the Expr structure itself,
** allowing it to be repopulated by the memcpy() on the following line.
** The pExpr->u.zToken might point into memory that will be freed by the
** sqlite3DbFree(db, pDup) on the last line of this block, so be sure to
** make a copy of the token before doing the sqlite3DbFree().
*/
ExprSetProperty(pExpr, EP_Static);
sqlite3ExprDelete(db, pExpr);
memcpy(pExpr, pDup, sizeof(*pExpr));
if( !ExprHasProperty(pExpr, EP_IntValue) && pExpr->u.zToken!=0 ){
assert( (pExpr->flags & (EP_Reduced|EP_TokenOnly))==0 );
pExpr->u.zToken = sqlite3DbStrDup(db, pExpr->u.zToken);
pExpr->flags |= EP_MemToken;
}
sqlite3DbFree(db, pDup);
}
ExprSetProperty(pExpr, EP_Alias);
}
/*
** Return TRUE if the name zCol occurs anywhere in the USING clause.
**
** Return FALSE if the USING clause is NULL or if it does not contain
** zCol.
*/
static int nameInUsingClause(IdList *pUsing, const char *zCol){
if( pUsing ){
int k;
for(k=0; k<pUsing->nId; k++){
if( sqlite3StrICmp(pUsing->a[k].zName, zCol)==0 ) return 1;
}
}
return 0;
}
/*
** Subqueries stores the original database, table and column names for their
** result sets in ExprList.a[].zSpan, in the form "DATABASE.TABLE.COLUMN".
** Check to see if the zSpan given to this routine matches the zDb, zTab,
** and zCol. If any of zDb, zTab, and zCol are NULL then those fields will
** match anything.
*/
int sqlite3MatchSpanName(
const char *zSpan,
const char *zCol,
const char *zTab,
const char *zDb
){
int n;
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
if( zDb && (sqlite3StrNICmp(zSpan, zDb, n)!=0 || zDb[n]!=0) ){
return 0;
}
zSpan += n+1;
for(n=0; ALWAYS(zSpan[n]) && zSpan[n]!='.'; n++){}
if( zTab && (sqlite3StrNICmp(zSpan, zTab, n)!=0 || zTab[n]!=0) ){
return 0;
}
zSpan += n+1;
if( zCol && sqlite3StrICmp(zSpan, zCol)!=0 ){
return 0;
}
return 1;
}
/*
** Given the name of a column of the form X.Y.Z or Y.Z or just Z, look up
** that name in the set of source tables in pSrcList and make the pExpr
** expression node refer back to that source column. The following changes
** are made to pExpr:
**
** pExpr->iDb Set the index in db->aDb[] of the database X
** (even if X is implied).
** pExpr->iTable Set to the cursor number for the table obtained
** from pSrcList.
** pExpr->pTab Points to the Table structure of X.Y (even if
** X and/or Y are implied.)
** pExpr->iColumn Set to the column number within the table.
** pExpr->op Set to TK_COLUMN.
** pExpr->pLeft Any expression this points to is deleted
** pExpr->pRight Any expression this points to is deleted.
**
** The zDb variable is the name of the database (the "X"). This value may be
** NULL meaning that name is of the form Y.Z or Z. Any available database
** can be used. The zTable variable is the name of the table (the "Y"). This
** value can be NULL if zDb is also NULL. If zTable is NULL it
** means that the form of the name is Z and
|
{
"pile_set_name": "Github"
}
|
// +build darwin
// +build !cgo
package host
import (
"context"
"github.com/shirou/gopsutil/internal/common"
)
func SensorsTemperatures() ([]TemperatureStat, error) {
return SensorsTemperaturesWithContext(context.Background())
}
func SensorsTemperaturesWithContext(ctx context.Context) ([]TemperatureStat, error) {
return []TemperatureStat{}, common.ErrNotImplementedError
}
|
{
"pile_set_name": "Github"
}
|
using Playnite.Behaviors;
using Playnite.Common;
using Playnite.FullscreenApp.ViewModels;
using Playnite.Input;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Input;
namespace Playnite.FullscreenApp.Controls.Views
{
[TemplatePart(Name = "PART_MenuHost", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "PART_ItemsHost", Type = typeof(ItemsControl))]
public class GameMenu : Control
{
private FullscreenAppViewModel mainModel;
private FrameworkElement MenuHost;
private ItemsControl ItemsHost;
static GameMenu()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(GameMenu), new FrameworkPropertyMetadata(typeof(GameMenu)));
}
public GameMenu() : this(FullscreenApplication.Current?.MainModel)
{
}
public GameMenu(FullscreenAppViewModel mainModel) : base()
{
if (DesignerProperties.GetIsInDesignMode(this))
{
this.mainModel = DesignMainViewModel.DesignIntance;
}
else if (mainModel != null)
{
this.mainModel = mainModel;
}
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
if (Template != null)
{
MenuHost = Template.FindName("PART_MenuHost", this) as FrameworkElement;
if (MenuHost != null)
{
MenuHost.InputBindings.Add(new KeyBinding(mainModel.ToggleGameOptionsCommand, new KeyGesture(Key.Back)));
MenuHost.InputBindings.Add(new KeyBinding(mainModel.ToggleGameOptionsCommand, new KeyGesture(Key.Escape)));
MenuHost.InputBindings.Add(new XInputBinding(mainModel.ToggleGameOptionsCommand, XInputButton.B));
BindingTools.SetBinding(
MenuHost,
Control.DataContextProperty,
mainModel,
nameof(FullscreenAppViewModel.SelectedGameDetails));
}
ItemsHost = Template.FindName("PART_ItemsHost", this) as ItemsControl;
if (ItemsHost != null)
{
BindingTools.SetBinding(
ItemsHost,
ItemsControl.ItemsSourceProperty,
mainModel,
$"{nameof(FullscreenAppViewModel.SelectedGameDetails)}.{nameof(FullscreenAppViewModel.SelectedGameDetails.GameItems)}");
BindingTools.SetBinding(ItemsHost,
FocusBahaviors.FocusBindingProperty,
mainModel,
nameof(mainModel.GameMenuVisible));
}
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
/*******************************************************************************
* Copyright (c) 2015-2018 Skymind, Inc.
* Copyright (c) 2020 Konduit K.K.
*
* This program and the accompanying materials are made available under the
* terms of the Apache License, Version 2.0 which is available at
* https://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.
*
* SPDX-License-Identifier: Apache-2.0
******************************************************************************/
//
// @author sgazeos@gmail.com
//
#include <ops/declarable/helpers/crop_and_resize.h>
#include <ops/declarable/helpers/cpu/crop_and_resize.hpp>
#cmakedefine LIBND4J_TYPE_GEN
namespace sd {
namespace ops {
namespace helpers {
BUILD_TRIPLE_TEMPLATE(template void cropAndResizeFunctor_, (NDArray const *images, NDArray const *boxes, NDArray const *indices, NDArray const *cropSize, int method, double extrapolationVal, NDArray *crops), LIBND4J_TYPES_@FL_TYPE_INDEX@, FLOAT_TYPES, INTEGER_TYPES);
}
}
}
|
{
"pile_set_name": "Github"
}
|
(Endless program)
(In a standalone interpreter, this should probably exit)
(at the main program M99. In task, the main program M99)
(should cause an endless loop, terminated by a counter.)
(*****************************************************)
(Don't *actually* run this program infinitely!)
(Stop after)#101 = 3(loops in case of failure)
#100 = [#100 + 1] (Counter; assume it starts at 0)
O1000 if [#100 GT #101]
(PRINT, "Stopping program after #101 loops")
#100 = 0 (Reset counter)
M30 (End program)
O1000 endif
(*****************************************************)
O1 (Main program begin)
(PRINT, X Loop number #100)
G1 X1 F40 (Junk move...)
M98 P100 (Call junk subprogram)
G1 X5 (Another junk move...)
M99 (Main program endless loop)
(*****************************************************)
O100 (Junk subprogram begin)
G1 Y-4 (Subprogram junk move...)
M99 (Return to main program)
%
|
{
"pile_set_name": "Github"
}
|
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.util.datasource;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import org.apache.commons.io.input.ReaderInputStream;
import net.sourceforge.pmd.util.datasource.internal.AbstractDataSource;
/**
* DataSource implementation to read data from a Reader.
*/
public class ReaderDataSource extends AbstractDataSource {
/**
* Reader
*/
private final Reader reader;
/**
* Real or pseudo filename or path name.
*
* <p>
* Including a file suffix mapped to the correct language helps assign the
* correct parser.
* </p>
*/
private String dataSourceName;
/**
* Create the DataSource from the Reader.
*/
public ReaderDataSource(Reader reader, String dataSourceName) {
this.reader = reader;
this.dataSourceName = dataSourceName;
}
/**
* Convert the Reader into an InputStream.
* <p>
* <strong>Note:</strong> This uses the default encoding.
* </p>
*
* @return Derived InputStream
* @throws IOException
*/
@Override
public InputStream getInputStream() throws IOException {
return new ReaderInputStream(reader);
}
/**
* Return the dataSourceName via the {@link DataSource} Interface method.
*
* <p>
* Both the parameters are ignored
* </p>
*
* @param shortNames
* ignored
* @param inputFileName
* ignored
* @return
*/
@Override
public String getNiceFileName(boolean shortNames, String inputFileName) {
return getDataSourceName();
}
/**
* @return the dataSourceName
*/
public String getDataSourceName() {
return dataSourceName;
}
/**
* @param dataSourceName
* the dataSourceName to set
*/
public void setDataSourceName(String dataSourceName) {
this.dataSourceName = dataSourceName;
}
@Override
public String toString() {
return new StringBuilder(ReaderDataSource.class.getSimpleName())
.append('[')
.append(dataSourceName)
.append(']')
.toString();
}
}
|
{
"pile_set_name": "Github"
}
|
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objects = {
/* Begin PBXBuildFile section */
C90007F323B3BA710002B6A0 /* NSObject+DarkMode.m in Sources */ = {isa = PBXBuildFile; fileRef = C90007F223B3BA710002B6A0 /* NSObject+DarkMode.m */; };
C90007F623B3C5BB0002B6A0 /* NSView+HiddenDebug.m in Sources */ = {isa = PBXBuildFile; fileRef = C90007F523B3C5BB0002B6A0 /* NSView+HiddenDebug.m */; };
C90BE30D239F38EB00ADE88B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C90BE30C239F38EB00ADE88B /* AppDelegate.m */; };
C90BE310239F38EB00ADE88B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C90BE30F239F38EB00ADE88B /* ViewController.m */; };
C90BE312239F38EC00ADE88B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C90BE311239F38EC00ADE88B /* Assets.xcassets */; };
C90BE315239F38EC00ADE88B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C90BE313239F38EC00ADE88B /* Main.storyboard */; };
C90BE318239F38EC00ADE88B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C90BE317239F38EC00ADE88B /* main.m */; };
C90C77852391188400A65E42 /* SnipFocusView.m in Sources */ = {isa = PBXBuildFile; fileRef = C90C77842391188400A65E42 /* SnipFocusView.m */; };
C910457023A3AF44001D5211 /* Translate.m in Sources */ = {isa = PBXBuildFile; fileRef = C910456F23A3AF44001D5211 /* Translate.m */; };
C91C153823AB8B0600CCAEC0 /* MMTool.m in Sources */ = {isa = PBXBuildFile; fileRef = C91C153723AB8B0600CCAEC0 /* MMTool.m */; };
C91DF6B023A35E07009CB158 /* MMOrderedDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = C91DF6AE23A35E07009CB158 /* MMOrderedDictionary.m */; };
C959D33A238809B800DD8808 /* OCRResult.m in Sources */ = {isa = PBXBuildFile; fileRef = C959D339238809B800DD8808 /* OCRResult.m */; };
C9676F2B23A0908F007DD023 /* NSPasteboard+MM.m in Sources */ = {isa = PBXBuildFile; fileRef = C9676F2A23A0908F007DD023 /* NSPasteboard+MM.m */; };
C9889F6123AA0FDA00C2D127 /* GoogleTranslate.m in Sources */ = {isa = PBXBuildFile; fileRef = C9889F6023AA0FDA00C2D127 /* GoogleTranslate.m */; };
C988B28823B1F12D007C8108 /* DarkModeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C988B28723B1F12D007C8108 /* DarkModeManager.m */; };
C98C17A1239E3F4A00BD02DB /* PreferencesWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = C98C17A0239E3F4A00BD02DB /* PreferencesWindowController.m */; };
C98C17A5239E40AC00BD02DB /* GeneralViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C98C17A3239E40AC00BD02DB /* GeneralViewController.m */; };
C98C17A6239E40AC00BD02DB /* GeneralViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C98C17A4239E40AC00BD02DB /* GeneralViewController.xib */; };
C98C17AA239E410300BD02DB /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C98C17A8239E410300BD02DB /* AboutViewController.m */; };
C98C17AB239E410300BD02DB /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C98C17A9239E410300BD02DB /* AboutViewController.xib */; };
C98C17B0239E516A00BD02DB /* Shortcut.m in Sources */ = {isa = PBXBuildFile; fileRef = C98C17AF239E516A00BD02DB /* Shortcut.m */; };
C98CAE75239F4619005F7DCA /* BobHelper.app in CopyFiles */ = {isa = PBXBuildFile; fileRef = C90BE309239F38EB00ADE88B /* BobHelper.app */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
C98CFA28239F8CDB00FB7EC4 /* MMLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA21239F8CDB00FB7EC4 /* MMLog.swift */; };
C98CFA29239F8CDB00FB7EC4 /* MMFileLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA22239F8CDB00FB7EC4 /* MMFileLogFormatter.m */; };
C98CFA2A239F8CDB00FB7EC4 /* MMConsoleLogFormatter.m in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA24239F8CDB00FB7EC4 /* MMConsoleLogFormatter.m */; };
C98CFA2B239F8CDB00FB7EC4 /* MMLog.m in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA26239F8CDB00FB7EC4 /* MMLog.m */; };
C98CFA33239FA6F400FB7EC4 /* MMCrashUncaughtExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA2D239FA6F400FB7EC4 /* MMCrashUncaughtExceptionHandler.m */; };
C98CFA34239FA6F400FB7EC4 /* MMCrashSignalExceptionHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA2F239FA6F400FB7EC4 /* MMCrashSignalExceptionHandler.m */; };
C98CFA35239FA6F400FB7EC4 /* MMCrashFileTool.m in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA31239FA6F400FB7EC4 /* MMCrashFileTool.m */; };
C98CFA38239FA8E500FB7EC4 /* MMCrash.m in Sources */ = {isa = PBXBuildFile; fileRef = C98CFA37239FA8E500FB7EC4 /* MMCrash.m */; };
C99142742390FCBD0025E75E /* NSImage+MM.m in Sources */ = {isa = PBXBuildFile; fileRef = C99142732390FCBD0025E75E /* NSImage+MM.m */; };
C9986E1C2393B06C0016F569 /* NSView+MM.m in Sources */ = {isa = PBXBuildFile; fileRef = C9986E1B2393B06C0016F569 /* NSView+MM.m */; };
C9986E1F2393B09E0016F569 /* NSWindow+MM.m in Sources */ = {isa = PBXBuildFile; fileRef = C9986E1E2393B09E0016F569 /* NSWindow+MM.m */; };
C99EEB1D2385796700FEE
|
{
"pile_set_name": "Github"
}
|
@import url("../common/domButtons/DomButtonColorButtons-compat.css");
@import url("../common/domButtons/DomButtonBlackCircleCross-compat.css");
/* dojox.mobile.IconContainer */
.mblIconItemPaneHeading {
background-image: url(compat/icon-content-heading-bg.png);
}
.dj_gecko .mblIconItemPaneHeading {
background-image: -moz-linear-gradient(top, #e0e4e7 0%, #c4ccd2 50%, #bfc8ce 50%, #b4bec6 100%);
}
.dj_ie7 .mblIconAreaInner {
font-size: 60px;
}
|
{
"pile_set_name": "Github"
}
|
# Provider for Java Print Service
sun.print.PrintServiceLookupProvider
|
{
"pile_set_name": "Github"
}
|
<html>
<head>
<title>libogg - function - oggpack_writeinit</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>
<body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
<table border=0 width=100%>
<tr>
<td><p class=tiny>libogg documentation</p></td>
<td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td>
</tr>
</table>
<h1>oggpack_writeinit</h1>
<p><i>declared in "ogg/ogg.h";</i></p>
<p>This function initializes an <a href="oggpack_buffer.html">oggpack_buffer</a> for writing using the Ogg <a href="bitpacking.html">bitpacking</a> functions.
<br><br>
<table border=0 color=black cellspacing=0 cellpadding=7>
<tr bgcolor=#cccccc>
<td>
<pre><b>
void oggpack_writeinit(<a href="oggpack_buffer.html">oggpack_buffer</a> *b);
</b></pre>
</td>
</tr>
</table>
<h3>Parameters</h3>
<dl>
<dt><i>b</i></dt>
<dd>Buffer to be used for writing. This is an ordinary data buffer with some extra markers to ease bit navigation and manipulation.</dd>
</dl>
<h3>Return Values</h3>
<blockquote>
<li>
No values are returned.</li>
</blockquote>
<p>
<br><br>
<hr noshade>
<table border=0 width=100%>
<tr valign=top>
<td><p class=tiny>copyright © 2000-2011 Xiph.Org</p></td>
<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
</tr><tr>
<td><p class=tiny>libogg documentation</p></td>
<td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td>
</tr>
</table>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
# County Title
title = c_nye_pass
# Settlements
max_settlements = 1
b_amargosa_valley_CA = castle
# Misc
culture = paiute
religion = cetic
#History
|
{
"pile_set_name": "Github"
}
|
// RUN: %zap_compare_object FILE="file1.cpp"
// RUN: %zap_compare_object FILE="file2.cpp"
// RUN: %zap_compare_object FILE="file1.cpp"
// RUN: %zap_compare_object FILE="file2.cpp"
// Bug 426
|
{
"pile_set_name": "Github"
}
|
/*-
* Copyright 2007 John Birrell <jb@FreeBSD.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*
*/
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/conf.h>
#include <sys/cpuvar.h>
#include <sys/errno.h>
#include <sys/jail.h>
#include <sys/kernel.h>
#include <sys/misc.h>
#include <sys/module.h>
#include <sys/mutex.h>
cpu_core_t cpu_core[MAXCPU];
kmutex_t cpu_lock;
solaris_cpu_t solaris_cpu[MAXCPU];
int nsec_per_tick;
/*
* OpenSolaris subsystem initialisation.
*/
static void
opensolaris_load(void *dummy)
{
int i;
/*
* "Enable" all CPUs even though they may not exist just so
* that the asserts work. On FreeBSD, if a CPU exists, it is
* enabled.
*/
for (i = 0; i < MAXCPU; i++) {
solaris_cpu[i].cpuid = i;
solaris_cpu[i].cpu_flags &= CPU_ENABLE;
}
mutex_init(&cpu_lock, "OpenSolaris CPU lock", MUTEX_DEFAULT, NULL);
nsec_per_tick = NANOSEC / hz;
}
SYSINIT(opensolaris_register, SI_SUB_OPENSOLARIS, SI_ORDER_FIRST, opensolaris_load, NULL);
static void
opensolaris_unload(void)
{
mutex_destroy(&cpu_lock);
}
SYSUNINIT(opensolaris_unregister, SI_SUB_OPENSOLARIS, SI_ORDER_FIRST, opensolaris_unload, NULL);
static int
opensolaris_modevent(module_t mod __unused, int type, void *data __unused)
{
int error = 0;
switch (type) {
case MOD_LOAD:
utsname.nodename = prison0.pr_hostname;
break;
case MOD_UNLOAD:
break;
case MOD_SHUTDOWN:
break;
default:
error = EOPNOTSUPP;
break;
}
return (error);
}
DEV_MODULE(opensolaris, opensolaris_modevent, NULL);
MODULE_VERSION(opensolaris, 1);
|
{
"pile_set_name": "Github"
}
|
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtSystemKit module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
//
// W A R N I N G
// -------------
//
// This file is not part of the Qt API. It exists purely as an
// implementation detail. This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//
#ifndef QSYSTEMINFOGLOBAL_H
#define QSYSTEMINFOGLOBAL_H
#include <QtCore/qglobal.h>
/*
#ifndef QT_STATIC
# if defined(QT_BUILD_SYSTEMINFO_LIB)
# define Q_SYSTEMINFO_EXPORT Q_DECL_EXPORT
# else
# define Q_SYSTEMINFO_EXPORT Q_DECL_IMPORT
# endif
#else
# define Q_SYSTEMINFO_EXPORT
#endif
*/
#define Q_SYSTEMINFO_EXPORT
#endif // QSYSTEMINFOGLOBAL_H
|
{
"pile_set_name": "Github"
}
|
/* globals describe, expect, it */
import React from 'react'
import { mount } from 'enzyme'
import Button from './Button'
describe('Button', () => {
const wrapper = (extraProps = {}) => mount(
<Button
tabSlug='tab-1'
index={2}
className='module-search-in-between'
isLessonHighlight={false}
isLastAddButton={false}
{...extraProps}
/>
)
it('should have .lesson-highlight', () => {
const w = wrapper({ isLessonHighlight: true })
expect(w.find('button.search.lesson-highlight')).toHaveLength(1)
})
})
|
{
"pile_set_name": "Github"
}
|
"""
Halite II Python 3 starter kit
See MyBot.py for a basic usage example. In short, you should initialize() at
the start, then in a loop, call get_map() to get the current game state, then
build up a list of commands and send them with send_command_queue().
"""
from . import collision, constants, entity, game_map, networking
from .networking import Game
|
{
"pile_set_name": "Github"
}
|
/**
* Creates a unary function that invokes `func` with its argument transformed.
*
* @private
* @param {Function} func The function to wrap.
* @param {Function} transform The argument transform.
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
return function(arg) {
return func(transform(arg));
};
}
module.exports = overArg;
|
{
"pile_set_name": "Github"
}
|
---
title: Istiod
test: n/a
---
The Istiod component is the consolidated monolithic control plane binary that encapsulates the functions of Pilot, Citadel, Mixer, and Galley.
[Learn more about Istiod](/blog/2020/tradewinds-2020/#fewer-moving-parts).
|
{
"pile_set_name": "Github"
}
|
from ED6ScenarioHelper import *
def main():
# 卢安
CreateScenaFile(
FileName = 'T2402 ._SN',
MapName = 'Ruan',
Location = 'T2402.x',
MapIndex = 1,
MapDefaultBGM = "ed60015",
Flags = 0,
EntryFunctionIndex = 0xFFFF,
Reserved = 0,
IncludedScenario = [
'',
'',
'',
'',
'',
'',
'',
''
],
)
BuildStringList(
'@FileName', # 8
'梅威海道方向', # 9
)
DeclEntryPoint(
Unknown_00 = 0,
Unknown_04 = 0,
Unknown_08 = 6000,
Unknown_0C = 4,
Unknown_0E = 0,
Unknown_10 = 0,
Unknown_14 = 9500,
Unknown_18 = -10000,
Unknown_1C = 0,
Unknown_20 = 0,
Unknown_24 = 0,
Unknown_28 = 2800,
Unknown_2C = 262,
Unknown_30 = 45,
Unknown_32 = 0,
Unknown_34 = 360,
Unknown_36 = 0,
Unknown_38 = 0,
Unknown_3A = 0,
InitScenaIndex = 0,
InitFunctionIndex = 0,
EntryScenaIndex = 0,
EntryFunctionIndex = 1,
)
DeclNpc(
X = 1060,
Z = 0,
Y = -23220,
Direction = 0,
Unknown2 = 0,
Unknown3 = 0,
ChipIndex = 0x0,
NpcIndex = 0xFF,
InitFunctionIndex = -1,
InitScenaIndex = -1,
TalkFunctionIndex = -1,
TalkScenaIndex = -1,
)
ScpFunction(
"Function_0_CA", # 00, 0
"Function_1_CB", # 01, 1
)
def Function_0_CA(): pass
label("Function_0_CA")
Return()
# Function_0_CA end
def Function_1_CB(): pass
label("Function_1_CB")
OP_16(0x2, 0xFA0, 0xFFFE0C00, 0xFFFE5A20, 0x30067)
Return()
# Function_1_CB end
SaveToFile()
Try(main)
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2001-2011 Hartmut Kaiser
// Copyright (c) 2001-2011 Joel de Guzman
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#if !defined(SPIRIT_KARMA_ALTERNATIVE_MAR_01_2007_1124AM)
#define SPIRIT_KARMA_ALTERNATIVE_MAR_01_2007_1124AM
#if defined(_MSC_VER)
#pragma once
#endif
#include <boost/spirit/home/karma/domain.hpp>
#include <boost/spirit/home/karma/directive/buffer.hpp>
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/utree/utree_traits_fwd.hpp>
#include <boost/spirit/home/karma/detail/attributes.hpp>
#include <boost/spirit/home/support/detail/hold_any.hpp>
#include <boost/spirit/home/karma/detail/output_iterator.hpp>
#include <boost/spirit/home/support/container.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/variant.hpp>
#include <boost/detail/workaround.hpp>
///////////////////////////////////////////////////////////////////////////////
namespace boost { namespace spirit { namespace karma { namespace detail
{
///////////////////////////////////////////////////////////////////////////
// execute a generator if the given Attribute type is compatible
///////////////////////////////////////////////////////////////////////////
// this gets instantiated if the Attribute type is _not_ compatible with
// the generator
template <typename Component, typename Attribute, typename Expected
, typename Enable = void>
struct alternative_generate
{
template <typename OutputIterator, typename Context, typename Delimiter>
static bool
call(Component const&, OutputIterator&, Context&, Delimiter const&
, Attribute const&, bool& failed)
{
failed = true;
return false;
}
};
template <typename Component>
struct alternative_generate<Component, unused_type, unused_type>
{
template <typename OutputIterator, typename Context, typename Delimiter>
static bool
call(Component const& component, OutputIterator& sink, Context& ctx
, Delimiter const& d, unused_type, bool&)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
// return true if any of the generators succeed
return component.generate(sink, ctx, d, unused);
}
};
// this gets instantiated if there is no Attribute given for the
// alternative generator
template <typename Component, typename Expected>
struct alternative_generate<Component, unused_type, Expected>
: alternative_generate<Component, unused_type, unused_type> {};
// this gets instantiated if the generator does not expect to receive an
// Attribute (the generator is self contained).
template <typename Component, typename Attribute>
struct alternative_generate<Component, Attribute, unused_type>
: alternative_generate<Component, unused_type, unused_type> {};
// this gets instantiated if the Attribute type is compatible to the
// generator
template <typename Component, typename Attribute, typename Expected>
struct alternative_generate<Component, Attribute, Expected
, typename enable_if<
traits::compute_compatible_component<Expected, Attribute, karma::domain> >::type>
{
template <typename OutputIterator, typename Context, typename Delimiter>
static bool
call(Component const& component, OutputIterator& sink
, Context& ctx, Delimiter const& d, Attribute const& attr, bool&)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return call(component, sink, ctx, d, attr
, spirit::traits::not_is_variant<Attribute, karma::domain>());
}
template <typename OutputIterator, typename Context, typename Delimiter>
static bool
call(Component const& component, OutputIterator& sink
, Context& ctx, Delimiter const& d, Attribute const& attr, mpl::true_)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
return component.generate(sink, ctx, d, attr);
}
template <typename OutputIterator, typename Context, typename Delimiter>
static bool
call(Component const& component, OutputIterator& sink
, Context& ctx, Delimiter const& d, Attribute const& attr, mpl::false_)
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
typedef
traits::compute_compatible_component<Expected, Attribute, domain>
component_type;
// if we got passed an empty optional, just fail generation
if (!traits::has_optional_value(attr))
return false;
// make sure, the content of the passed variant matches our
// expectations
typename traits::optional_attribute<Attribute>::type attr_ =
traits::optional_value(attr);
if (!component_type::is_compatible(spirit::traits::which(attr_)))
return false;
// returns true if any of the generators succeed
typedef typename component_type::compatible_type compatible_type;
return component.generate(sink, ctx, d
, boost::get<compatible_type>(attr_));
}
};
///////////////////////////////////////////////////////////////////////////
// alternative_generate_function: a functor supplied to fusion::any which
// will be executed for every generator in a given alternative generator
// expression
///////////////////////////////////////////////////////////////////////////
template <typename OutputIterator, typename Context, typename Delimiter,
typename Attribute, typename Strict>
struct alternative_generate_function
{
alternative_generate_function(OutputIterator& sink_, Context& ctx_
, Delimiter const& d, Attribute const& attr_)
: sink(sink_), ctx(ctx_), delim(d), attr(attr_) {}
template <typename Component>
bool operator()(Component const& component)
{
typedef
typename traits::attribute_of<Component, Context>::type
expected_type;
typedef
alternative_generate<Component, Attribute, expected_type>
generate;
// wrap the given output iterator avoid output as long as one
// component fails
detail::enable_buffering<OutputIterator> buffering(sink);
bool r = false;
bool failed = false; // will be ignored
{
detail::disable_counting<OutputIterator> nocounting(sink);
r = generate::call(component, sink, ctx, delim, attr, failed);
}
if (r)
buffering.buffer_copy();
return r;
}
// avoid double buffering
template <typename Component>
bool operator()(buffer_directive<Component> const& component)
{
typedef typename
traits::attribute_of<Component, Context>::type
expected_type;
typedef alternative_generate<
buffer_directive<Component>, Attribute, expected_type>
generate;
bool failed = false; // will be ignored
return generate::call(component, sink, ctx, delim, attr, failed);
}
OutputIterator& sink;
Context& ctx;
Delimiter const& delim;
Attribute const& attr;
private:
// silence MSVC warning C4512: assignment operator could not be generated
alternative_generate_function& operator= (alternative_generate_function const&);
};
// specialization for strict alternatives
template <typename OutputIterator, typename Context, typename Delimiter,
typename Attribute>
struct alternative_generate_function<
OutputIterator, Context, Delimiter, Attribute, mpl::true_>
{
alternative_generate_
|
{
"pile_set_name": "Github"
}
|
package com.forgeessentials.teleport;
import java.util.List;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.server.permission.DefaultPermissionLevel;
import net.minecraftforge.server.permission.PermissionAPI;
import com.forgeessentials.api.UserIdent;
import com.forgeessentials.commons.selections.WarpPoint;
import com.forgeessentials.core.commands.ForgeEssentialsCommandBase;
import com.forgeessentials.core.misc.TeleportHelper;
import com.forgeessentials.core.misc.TranslatedCommandException;
public class CommandTop extends ForgeEssentialsCommandBase
{
@Override
public String getName()
{
return "fetop";
}
@Override
public String[] getDefaultAliases()
{
return new String[] { "top" };
}
@Override
public String getUsage(ICommandSender sender)
{
return "/top <player> Teleport you or another player to the top of the world.";
}
@Override
public boolean canConsoleUseCommand()
{
return true;
}
@Override
public DefaultPermissionLevel getPermissionLevel()
{
return DefaultPermissionLevel.ALL;
}
@Override
public String getPermissionNode()
{
return TeleportModule.PERM_TOP;
}
@Override
public void processCommandPlayer(MinecraftServer server, EntityPlayerMP sender, String[] args) throws CommandException
{
if (args.length == 0)
{
top(sender);
}
else if (args.length == 1 && PermissionAPI.hasPermission(sender, TeleportModule.PERM_TOP_OTHERS))
{
EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
if (player != null)
{
top(player);
}
else
throw new TranslatedCommandException("Player %s does not exist, or is not online.", args[0]);
}
else
throw new TranslatedCommandException("Improper syntax. Please try this instead: <player>");
}
@Override
public void processCommandConsole(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException
{
if (args.length == 1)
{
EntityPlayerMP player = UserIdent.getPlayerByMatchOrUsername(sender, args[0]);
if (player != null)
{
top(player);
}
else
throw new TranslatedCommandException("Player %s does not exist, or is not online.", args[0]);
}
else
throw new TranslatedCommandException("Improper syntax. Please try this instead: <player>");
}
public void top(EntityPlayerMP player) throws CommandException
{
WarpPoint point = new WarpPoint(player);
point.setY(player.world.getPrecipitationHeight(player.getPosition()).getY());
while (player.world.getBlockState(point.getBlockPos()).getBlock() == Blocks.AIR)
{
point.setY(point.getY() - 1);
}
point.setY(point.getY() + 1);
TeleportHelper.teleport(player, point);
}
@Override
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
{
if (args.length == 1)
{
return matchToPlayers(args);
}
else
{
return null;
}
}
}
|
{
"pile_set_name": "Github"
}
|
# 聊聊钱
<!-- MarkdownTOC -->
- 我最需要的理财常识书
- 第一章 理财不仅是一种行为,更是一种态度
- 1.让短期的流动资金成为你的长期投资
- 2.通货膨胀,警惕这只偷走你财富的“小恶魔”
- 3.能让你躺着也赚钱的神秘武器——复利
- 4.你不计较生活,生活就会来计较你——算算你的生活成本有多少
- 5.对沉没成本的处理,关系你的一生
- 6.信用卡让你离富翁梦越来越远
- 7.记账是个万灵药,夫妻感情都能好
- 9.花钱也要花得有技术含量
- 10.银行也可能忽悠你——理财产品陷阱大公开
- 11.想要日子过得好,就要避开理财误区
- 1.什么都会贬值,能力不会
- 3.把工资条变成你的理财小帮手
- 4.想要一本万利,那就投资人脉吧
- 1.工作,也是自我累积的过程
- 2.跳槽跳不好,荷包缩水一大半
- 3.面子是浮云,底子才是真
- 5.掌握了这些,高薪不是那么难
- 2.学学巴菲特,滚个财富大雪球
- 3.黄金是个好东西,但不懂套路会“坑爹”
- 5.别让你的公积金躺在银行睡大觉
- 6.股票,别上瘾就好
- 8.买卖外汇,其实没有那么难
- 9.期货期权,赌徒的信条
- 12.银行理财品,求一个心安理得
- 第七章 处理好生活就是一种理财
- 后记 财富眷顾有行动的人
<!-- /MarkdownTOC -->
# 我最需要的理财常识书
王华
## 第一章 理财不仅是一种行为,更是一种态度
理财不是投机,而是一种实实在在的生活态度,用心生活,就会发现理财的好处——根据每个人的家庭和财务状况,将资产进行合理规划,让资产长期、稳健增值,达成人生中的各种目标,实现财务自由!它可以让辛苦赚来的钱增值,抵御通货膨胀;也可以为自己储蓄足够的钱去享受退休养老生活。理财不仅仅关系到财富,还关系到你在面临抉择时该如何作决定。
### 1.让短期的流动资金成为你的长期投资
理财的意识对你的重要性,比你会背几个公式、懂得股市运行方式都要重要。这是学会理财的第一要诀,也是生活中“理财”的重要原则。
首先,我们必须接受的一个重要理财观念是:用长期平稳的心态进行理财得到的收益往往比用浮躁而焦虑的心态得到的收益更高。
你必须考虑较投入的资金与产生的回报之间的关系,而如何使“投入产出”最大化,正是投资理财追求的最基本目标,也是我们必须具备的理财意识。
### 2.通货膨胀,警惕这只偷走你财富的“小恶魔”
事实上,“利息”就是今天的钱和明天的钱之间的价值差,今天的钱比明天的钱更值钱的原因就在于“时间”。经过一段时间之后,今天的钱可以变成明天更多的钱。保住今天“更值钱”的现金,去花银行的钱,这本身就是一种理财,为什么不做呢?
### 3.能让你躺着也赚钱的神秘武器——复利
在理财中,复利是这样一个强大的武器,也是把高效的标尺。中国的德银财富管理公司就坚定地认为,投资理财最核心的盈利模式、财富增长最大的钥匙就是复利增长。
即使最微不足道的财富,都要用绝对谨慎的态度来进行打理。
### 4.你不计较生活,生活就会来计较你——算算你的生活成本有多少
同样的时间,每个人都要选择利润最大的工作,才算符合理财的意义。
那我们管这种成本叫作机会成本,经济学上的严格定义是:为了得到某种东西而需要放弃的另一种东西的最大价值。
举个例子,有朋友请你吃饭,表面上看你根本没掏钱,没有成本,不吃白不吃,但实际上是有各种各样的成本的。其中最重要的就是时间成本,赴约是需要付出时间的,而有这个时间你可以干工作、休息、看看书或者做做运动,这些就是你去参加这个宴会所需要付出的成本。越是名人,时间成本越高,吃饭的成本也就越高,这就是为什么请巴菲特吃一顿饭,还需要给他262万美元,人们还那么“贱”地去疯抢。
在生活中,我们会面临着各种各样的选择,这种选择很多也是来自投资理财方面的。在作出选择时,一定要考虑到这项选择的机会
|
{
"pile_set_name": "Github"
}
|
### filebench is a filesystem and storage benchmark that runs workloads
### specified using a Workload Model Language (WML). The intention is that
### an analyst can distil a production workload into a WML-equivalent and
### then execute it via filebench. It ships with a number of stock
### personalities.
###
### This configuration uses the filebench OLTP personality for a working
### set that is 2*RAM and uses buffered IO. The IO model should be similar to
### the Oracle 9i IO model and launches multiple reader, writer and logging
### processes. More can be read about the stock personalities at
### http://filebench.sourceforge.net/wiki/index.php/Pre-defined_personalities.
# MM Test Parameters
export MMTESTS="filebench"
# Test disk to setup (optional)
#export TESTDISK_RAID_DEVICES=
#export TESTDISK_RAID_MD_DEVICE=/dev/md0
#export TESTDISK_RAID_OFFSET=63
#export TESTDISK_RAID_SIZE=250019532
#export TESTDISK_RAID_TYPE=raid0
#export TESTDISK_PARTITION=/dev/sda6
#export TESTDISK_FILESYSTEM=xfs
#export TESTDISK_MKFS_PARAM="-f -d agcount=8"
#export TESTDISK_MOUNT_ARGS=inode64,delaylog,logbsize=262144,nobarrier
# List of monitors
export RUN_MONITOR=yes
export MONITORS_ALWAYS=
export MONITORS_GZIP="proc-vmstat top iotop"
export MONITORS_WITH_LATENCY="vmstat iostat"
export MONITOR_UPDATE_FREQUENCY=10
# filebench
export FILEBENCH_PERSONALITY=oltp
export FILEBENCH_ITERATIONS=3
export FILEBENCH_WORKING_SET=$((MEMTOTAL_BYTES*2))
export FILEBENCH_MIN_THREADS=1
export FILEBENCH_MAX_THREADS=1
|
{
"pile_set_name": "Github"
}
|
cluster: test
|
{
"pile_set_name": "Github"
}
|
/*
* Test program for MSA instruction CLT_S.D
*
* Copyright (C) 2019 Wave Computing, Inc.
* Copyright (C) 2019 Aleksandar Markovic <amarkovic@wavecomp.com>
* Copyright (C) 2019 RT-RK Computer Based Systems LLC
* Copyright (C) 2019 Mateja Marjanovic <mateja.marjanovic@rt-rk.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#include <sys/time.h>
#include <stdint.h>
#include "../../../../include/wrappers_msa.h"
#include "../../../../include/test_inputs_128.h"
#include "../../../../include/test_utils_128.h"
#define TEST_COUNT_TOTAL ( \
(PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
(RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
int32_t main(void)
{
char *isa_ase_name = "MSA";
char *group_name = "Int Compare";
char *instruction_name = "CLT_S.D";
int32_t ret;
uint32_t i, j;
struct timeval start, end;
double elapsed_time;
uint64_t b128_result[TEST_COUNT_TOTAL][2];
uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
{ 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 0 */
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 8 */
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 16 */
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 24 */
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, }, /* 32 */
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 40 */
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, }, /* 48 */
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 56 */
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, }, /* 64 */
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, }, /* 72 */
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
{ 0xffffffffffffffffULL, 0x0000000000000000ULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0xffffffffffffffffULL, },
{ 0x0000000000000000ULL, 0x0000000000000000ULL, },
};
reset_msa_registers();
gettimeofday(&start, NULL);
for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
do_msa_CLT_S_D(b128_pattern[i], b128_pattern[j],
b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
}
}
for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
do_msa_CLT_S_D(b128_random[i], b128_random[j],
b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
(PATTERN_INPUTS_SHORT_COUNT)) +
RANDOM_INPUTS_SHORT_COUNT * i + j]);
}
}
gettimeofday(&end, NULL);
elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
ret = check_results
|
{
"pile_set_name": "Github"
}
|
/*
* security/tomoyo/file.c
*
* Copyright (C) 2005-2011 NTT DATA CORPORATION
*/
#include "common.h"
#include <linux/slab.h>
/*
* Mapping table from "enum tomoyo_path_acl_index" to "enum tomoyo_mac_index".
*/
static const u8 tomoyo_p2mac[TOMOYO_MAX_PATH_OPERATION] = {
[TOMOYO_TYPE_EXECUTE] = TOMOYO_MAC_FILE_EXECUTE,
[TOMOYO_TYPE_READ] = TOMOYO_MAC_FILE_OPEN,
[TOMOYO_TYPE_WRITE] = TOMOYO_MAC_FILE_OPEN,
[TOMOYO_TYPE_APPEND] = TOMOYO_MAC_FILE_OPEN,
[TOMOYO_TYPE_UNLINK] = TOMOYO_MAC_FILE_UNLINK,
[TOMOYO_TYPE_GETATTR] = TOMOYO_MAC_FILE_GETATTR,
[TOMOYO_TYPE_RMDIR] = TOMOYO_MAC_FILE_RMDIR,
[TOMOYO_TYPE_TRUNCATE] = TOMOYO_MAC_FILE_TRUNCATE,
[TOMOYO_TYPE_SYMLINK] = TOMOYO_MAC_FILE_SYMLINK,
[TOMOYO_TYPE_CHROOT] = TOMOYO_MAC_FILE_CHROOT,
[TOMOYO_TYPE_UMOUNT] = TOMOYO_MAC_FILE_UMOUNT,
};
/*
* Mapping table from "enum tomoyo_mkdev_acl_index" to "enum tomoyo_mac_index".
*/
const u8 tomoyo_pnnn2mac[TOMOYO_MAX_MKDEV_OPERATION] = {
[TOMOYO_TYPE_MKBLOCK] = TOMOYO_MAC_FILE_MKBLOCK,
[TOMOYO_TYPE_MKCHAR] = TOMOYO_MAC_FILE_MKCHAR,
};
/*
* Mapping table from "enum tomoyo_path2_acl_index" to "enum tomoyo_mac_index".
*/
const u8 tomoyo_pp2mac[TOMOYO_MAX_PATH2_OPERATION] = {
[TOMOYO_TYPE_LINK] = TOMOYO_MAC_FILE_LINK,
[TOMOYO_TYPE_RENAME] = TOMOYO_MAC_FILE_RENAME,
[TOMOYO_TYPE_PIVOT_ROOT] = TOMOYO_MAC_FILE_PIVOT_ROOT,
};
/*
* Mapping table from "enum tomoyo_path_number_acl_index" to
* "enum tomoyo_mac_index".
*/
const u8 tomoyo_pn2mac[TOMOYO_MAX_PATH_NUMBER_OPERATION] = {
[TOMOYO_TYPE_CREATE] = TOMOYO_MAC_FILE_CREATE,
[TOMOYO_TYPE_MKDIR] = TOMOYO_MAC_FILE_MKDIR,
[TOMOYO_TYPE_MKFIFO] = TOMOYO_MAC_FILE_MKFIFO,
[TOMOYO_TYPE_MKSOCK] = TOMOYO_MAC_FILE_MKSOCK,
[TOMOYO_TYPE_IOCTL] = TOMOYO_MAC_FILE_IOCTL,
[TOMOYO_TYPE_CHMOD] = TOMOYO_MAC_FILE_CHMOD,
[TOMOYO_TYPE_CHOWN] = TOMOYO_MAC_FILE_CHOWN,
[TOMOYO_TYPE_CHGRP] = TOMOYO_MAC_FILE_CHGRP,
};
/**
* tomoyo_put_name_union - Drop reference on "struct tomoyo_name_union".
*
* @ptr: Pointer to "struct tomoyo_name_union".
*
* Returns nothing.
*/
void tomoyo_put_name_union(struct tomoyo_name_union *ptr)
{
tomoyo_put_group(ptr->group);
tomoyo_put_name(ptr->filename);
}
/**
* tomoyo_compare_name_union - Check whether a name matches "struct tomoyo_name_union" or not.
*
* @name: Pointer to "struct tomoyo_path_info".
* @ptr: Pointer to "struct tomoyo_name_union".
*
* Returns "struct tomoyo_path_info" if @name matches @ptr, NULL otherwise.
*/
const struct tomoyo_path_info *
tomoyo_compare_name_union(const struct tomoyo_path_info *name,
const struct tomoyo_name_union *ptr)
{
if (ptr->group)
return tomoyo_path_matches_group(name, ptr->group);
if (tomoyo_path_matches_pattern(name, ptr->filename))
return ptr->filename;
return NULL;
}
/**
* tomoyo_put_number_union - Drop reference on "struct tomoyo_number_union".
*
* @ptr: Pointer to "struct tomoyo_number_union".
*
* Returns nothing.
*/
void tomoyo_put_number_union(struct tomoyo_number_union *ptr)
{
tomoyo_put_group(ptr->group);
}
/**
* tomoyo_compare_number_union - Check whether a value matches "struct tomoyo_number_union" or not.
*
* @value: Number to check.
* @ptr: Pointer to "struct tomoyo_number_union".
*
* Returns true if @value matches @ptr, false otherwise.
*/
bool tomoyo_compare_number_union(const unsigned long value,
const struct tomoyo_number_union *ptr)
{
if (ptr->group)
return tomoyo_number_matches_group(value, value, ptr->group);
return value >= ptr->values[0] && value <= ptr->values[1];
}
/**
* tomoyo_add_slash - Add trailing '/' if needed.
*
* @buf: Pointer to "struct tomoyo_path_info".
*
* Returns nothing.
*
* @buf must be generated by tomoyo_encode() because this function does not
* allocate memory for adding '/'.
*/
static void tomoyo_add_slash(struct tomoyo_path_info *buf)
{
if (buf->is_dir)
return;
/*
* This is OK because tomoyo_encode() reserves space for appending "/".
*/
strcat((char *) buf->name, "/");
tomoyo_fill_path_info(buf);
}
/**
* tomoyo_get_realpath - Get realpath.
*
* @buf: Pointer to "struct tomoyo_path_info".
* @path: Pointer to "struct path".
*
* Returns true on success, false otherwise.
*/
static bool tomoyo_get_realpath(struct tomoyo_path_info *buf, const struct path *path)
{
buf->name = tomoyo_realpath_from_path(path);
if (buf->name) {
tomoyo_fill_path_info(buf);
return true;
}
return false;
}
/**
* tomoyo_audit_path_log - Audit path request log.
*
* @r: Pointer to "struct tomoyo_request_info".
*
* Returns 0 on success, negative value otherwise.
*/
static int tomoyo_audit_path_log(struct tomoyo_request_info *r)
{
return tomoyo_supervisor(r, "file %s %s\n", tomoyo_path_keyword
[r->param.path.operation],
r->param.path.filename->name);
}
/**
* tomoyo_audit_path2_log - Audit path/path request log.
*
* @r: Pointer to "struct tomoyo_request_info".
*
* Returns 0 on success, negative value otherwise.
*/
static int tomoyo_audit_path2_log(struct tomoyo_request_info *r)
{
return tomoyo_supervisor(r, "file %s %s %s\n", tomoyo_mac_keywords
[tomoyo
|
{
"pile_set_name": "Github"
}
|
/*################################################################################
##
## Copyright (C) 2016-2020 Keith O'Hara
##
## This file is part of the OptimLib C++ library.
##
## 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.
##
################################################################################*/
/*
* Particle Swarm Optimization (PSO) with Differentially-Perturbed Velocity (DV)
*/
#ifndef _optim_pso_dv_HPP
#define _optim_pso_dv_HPP
/**
* @brief Particle Swarm Optimization (PSO) with Differentially-Perturbed Velocity (DV)
*
* @param init_out_vals a column vector of initial values, which will be replaced by the solution upon successful completion of the optimization algorithm.
* @param opt_objfn the function to be minimized, taking three arguments:
* - \c vals_inp a vector of inputs;
* - \c grad_out a vector to store the gradient; and
* - \c opt_data additional data passed to the user-provided function.
* @param opt_data additional data passed to the user-provided function.
*
* @return a boolean value indicating successful completion of the optimization algorithm.
*/
bool
pso_dv(Vec_t& init_out_vals,
std::function<double (const Vec_t& vals_inp, Vec_t* grad_out, void* opt_data)> opt_objfn,
void* opt_data);
/**
* @brief Particle Swarm Optimization (PSO) with Differentially-Perturbed Velocity (DV)
*
* @param init_out_vals a column vector of initial values, which will be replaced by the solution upon successful completion of the optimization algorithm.
* @param opt_objfn the function to be minimized, taking three arguments:
* - \c vals_inp a vector of inputs;
* - \c grad_out a vector to store the gradient; and
* - \c opt_data additional data passed to the user-provided function.
* @param opt_data additional data passed to the user-provided function.
* @param settings parameters controlling the optimization routine.
*
* @return a boolean value indicating successful completion of the optimization algorithm.
*/
bool
pso_dv(Vec_t& init_out_vals,
std::function<double (const Vec_t& vals_inp, Vec_t* grad_out, void* opt_data)> opt_objfn,
void* opt_data,
algo_settings_t& settings);
//
// internal
namespace internal
{
bool
pso_dv_impl(Vec_t& init_out_vals,
std::function<double (const Vec_t& vals_inp, Vec_t* grad_out, void* opt_data)> opt_objfn,
void* opt_data,
algo_settings_t* settings_inp);
}
#endif
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.