text
stringlengths 2
99.7k
| meta
dict |
|---|---|
/*!
* Express
* Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
var connect = require('connect')
, HTTPSServer = require('./https')
, HTTPServer = require('./http')
, Route = require('./router/route')
/**
* Re-export connect auto-loaders.
*
* This prevents the need to `require('connect')` in order
* to access core middleware, so for example `express.logger()` instead
* of `require('connect').logger()`.
*/
var exports = module.exports = connect.middleware;
/**
* Framework version.
*/
exports.version = '2.3.3';
/**
* Shortcut for `new Server(...)`.
*
* @param {Function} ...
* @return {Server}
* @api public
*/
exports.createServer = function(options){
if ('object' == typeof options) {
return new HTTPSServer(options, Array.prototype.slice.call(arguments, 1));
} else {
return new HTTPServer(Array.prototype.slice.call(arguments));
}
};
/**
* Expose constructors.
*/
exports.HTTPServer = HTTPServer;
exports.HTTPSServer = HTTPSServer;
exports.Route = Route;
/**
* View extensions.
*/
require('./view');
/**
* Response extensions.
*/
require('./response');
/**
* Request extensions.
*/
require('./request');
// Error handler title
exports.errorHandler.title = 'Express';
|
{
"pile_set_name": "Github"
}
|
#include "choose.h"
#include "gcd.h"
/*Computes the number of combinations of _n items, taken _m at a time without
overflow.
_n: The total number of items.
_m: The number taken at a time.
Return: The number of combinations of _n items taken _m at a time.*/
unsigned choose(int _n,int _m){
unsigned ret;
int i;
ret=1;
for(i=1;i<=_m;_n--,i++){
int nmi;
nmi=_n%i;
if(nmi==0)ret*=_n/i;
else if(ret%i==0)ret=(ret/i)*_n;
else{
int d;
d=gcd(i,nmi);
ret=(ret/(i/d))*(_n/d);
}
}
return ret;
}
|
{
"pile_set_name": "Github"
}
|
CREATE TABLE test_orc (key STRING)
ROW FORMAT SERDE 'org.apache.hadoop.hive.ql.io.orc.OrcSerde'
STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat';
INSERT OVERWRITE TABLE test_orc SELECT '' FROM src limit 10;
-- Test reading a column which is just empty strings
SELECT * FROM test_orc;
INSERT OVERWRITE TABLE test_orc SELECT IF (key % 3 = 0, key, '') FROM src limit 10;
-- Test reading a column which has some empty strings
SELECT * FROM test_orc ORDER BY key;
|
{
"pile_set_name": "Github"
}
|
#Wed Oct 21 11:34:03 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
|
{
"pile_set_name": "Github"
}
|
#pragma once
#include "Util.h"
namespace Linux {
class UtilRPI : public Util {
public:
UtilRPI();
static UtilRPI *from(AP_HAL::Util *util) {
return static_cast<UtilRPI*>(util);
}
/* return the Raspberry Pi version */
int get_rpi_version() const;
protected:
// Called in the constructor once
int _check_rpi_version();
private:
int _rpi_version = 0;
};
}
|
{
"pile_set_name": "Github"
}
|
#ifndef __G_SHARED_H__
#define __G_SHARED_H__
#include "bg_public.h"
#include "g_public.h"
#include "b_public.h"
#include "../ICARUS/ICARUS.h"
#include "../renderer/tr_types.h"
#include "../cgame/cg_public.h"
#include "bset.h"
#define FOFS(x) ((int)&(((gentity_t *)0)->x))
typedef enum
{
HL_NONE = 0,
HL_FOOT_RT,
HL_FOOT_LT,
HL_LEG_RT,
HL_LEG_LT,
HL_WAIST,
HL_BACK_RT,
HL_BACK_LT,
HL_BACK,
HL_CHEST_RT,
HL_CHEST_LT,
HL_CHEST,
HL_ARM_RT,
HL_ARM_LT,
HL_HAND_RT,
HL_HAND_LT,
HL_HEAD,
HL_GENERIC1,
HL_GENERIC2,
HL_GENERIC3,
HL_GENERIC4,
HL_GENERIC5,
HL_GENERIC6,
HL_MAX
};
typedef enum //# taskID_e
{
TID_CHAN_VOICE = 0, // Waiting for a voice sound to complete
TID_ANIM_UPPER, // Waiting to finish a lower anim holdtime
TID_ANIM_LOWER, // Waiting to finish a lower anim holdtime
TID_ANIM_BOTH, // Waiting to finish lower and upper anim holdtimes or normal md3 animating
TID_MOVE_NAV, // Trying to get to a navgoal or For ET_MOVERS
TID_ANGLE_FACE, // Turning to an angle or facing
TID_BSTATE, // Waiting for a certain bState to finish
TID_LOCATION, // Waiting for ent to enter a specific trigger_location
// TID_MISSIONSTATUS, // Waiting for player to finish reading MISSION STATUS SCREEN
TID_RESIZE, // Waiting for clear bbox to inflate size
TID_SHOOT, // Waiting for fire event
NUM_TIDS, // for def of taskID array
} taskID_t;
typedef enum //# material_e
{
MAT_METAL = 0, // scorched blue-grey metal
MAT_GLASS, // not a real chunk type, just plays an effect with glass sprites
MAT_ELECTRICAL, // sparks only
MAT_ELEC_METAL, // sparks/electrical type metal
MAT_DRK_STONE, // brown
MAT_LT_STONE, // tan
MAT_GLASS_METAL,// glass sprites and METAl chunk
MAT_METAL2, // electrical metal type
MAT_NONE, // no chunks
MAT_GREY_STONE, // grey
MAT_METAL3, // METAL and METAL2 chunks
MAT_CRATE1, // yellow multi-colored crate chunks
MAT_GRATE1, // grate chunks
MAT_ROPE, // for yavin trial...no chunks, just wispy bits
MAT_CRATE2, // read multi-colored crate chunks
MAT_WHITE_METAL,// white angular chunks
NUM_MATERIALS
} material_t;
//===From cg_local.h================================================
#define DEFAULT_HEADMODEL "munroscav"
#define DEFAULT_TORSOMODEL "imperial/raider"
#define DEFAULT_LEGSMODEL "imperial/raider"
// each client has an associated clientInfo_t
// that contains media references necessary to present the
// client model and other color coded effects
// this is regenerated each time a userinfo configstring changes
#define MAX_CUSTOM_BASIC_SOUNDS 14
#define MAX_CUSTOM_COMBAT_SOUNDS 17
#define MAX_CUSTOM_EXTRA_SOUNDS 36
#define MAX_CUSTOM_JEDI_SOUNDS 22
#define MAX_CUSTOM_SOUNDS (MAX_CUSTOM_JEDI_SOUNDS + MAX_CUSTOM_EXTRA_SOUNDS + MAX_CUSTOM_COMBAT_SOUNDS + MAX_CUSTOM_BASIC_SOUNDS)
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct {
qboolean infoValid;
char name[MAX_QPATH];
team_t team;
int score; // updated by score servercmds
int handicap;
qhandle_t legsModel;
qhandle_t legsSkin;
qhandle_t torsoModel;
qhandle_t torsoSkin;
qhandle_t headModel;
qhandle_t headSkin;
qboolean extensions; // do we have extra face skins ?
int animFileIndex;
sfxHandle_t sounds[MAX_CUSTOM_SOUNDS];
char *customBasicSoundDir;
char *customCombatSoundDir;
char *customExtraSoundDir;
char *customJediSoundDir;
} clientInfo_t;
//==================================================================
typedef enum
{
MOVER_POS1,
MOVER_POS2,
MOVER_1TO2,
MOVER_2TO1
} moverState_t;
// Rendering information structure
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct modelInfo_s
{
int modelIndex;
vec3_t customRGB;//Red Green Blue, 0 = don't apply
int customAlpha;//Alpha to apply, 0 = none?
} modelInfo_t;
typedef enum
{
MODEL_LEGS = 0,
MODEL_TORSO,
MODEL_HEAD,
MODEL_WEAPON1,
MODEL_WEAPON2,
MODEL_WEAPON3,
MODEL_EXTRA1,
MODEL_EXTRA2,
NUM_TARGET_MODELS
} targetModel_t;
//renderFlags
#define RF_LOCKEDANGLE 1
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct renderInfo_s
{
// Legs model, or full model on one piece entities
union
{
modelInfo_t legsModel;
modelInfo_t model;
};
union
{
char legsModelName[32]; // -slc[]
char modelName[32]; // -slc[]
};
// Models for the other pieces (not used by one piece models)
modelInfo_t torsoModel;
modelInfo_t headModel;
char torsoModelName[32]; // -slc[]
char headModelName[32]; // -slc[]
//In whole degrees, How far to let the different model parts yaw and pitch
int headYawRangeLeft;
int headYawRangeRight;
int headPitchRangeUp;
int headPitchRangeDown;
int torsoYawRangeLeft;
int torsoYawRangeRight;
int torsoPitchRangeUp;
int torsoPitchRangeDown;
int legsFrame;
int torsoFrame;
float legsFpsMod;
float torsoFpsMod;
//Fields to apply to entire model set, individual model's equivalents will modify this value
vec3_t customRGB;//Red Green Blue, 0 = don't apply
int customAlpha;//Alpha to apply, 0 = none?
//RF?
int renderFlags;
//
vec3_t muzzlePoint;
vec3_t muzzleDir;
vec3_t muzzlePointOld;
vec3_t muzzleDirOld;
//vec3_t muzzlePointNext; // Muzzle point one server frame in the future!
//vec3_t muzzleDirNext;
int mPCalcTime;//Last time muzzle point was calced
//
float lockYaw;//
//
vec3_t headPoint;//Where your tag_head is
vec3_t headAngles;//where the tag_head in the torso is pointing
vec3_t handRPoint;//where your right hand is
vec3_t handLPoint;//where your left hand is
vec3_t crotchPoint;//Where your crotch is
vec3_t footRPoint;//where your right hand is
vec3_t footLPoint;//where your left hand is
vec3_t torsoPoint;//Where your chest is
vec3_t torsoAngles;//Where the chest is pointing
vec3_t eyePoint;//Where your eyes are
vec3_t eyeAngles;//Where your eyes face
int lookTarget;//Which ent to look at with lookAngles
lookMode_t lookMode;
int lookTargetClearTime;//Time to clear the lookTarget
int lastVoiceVolume;//Last frame's voice volume
vec3_t lastHeadAngles;//Last headAngles, NOT actual facing of head model
vec3_t headBobAngles;//headAngle offsets
vec3_t targetHeadBobAngles;//head bob angles will try to get to targetHeadBobAngles
int lookingDebounceTime;//When we can stop using head looking angle behavior
float legsYaw;//yaw angle your legs are actually rendering at
} renderInfo_t;
// Movement information structure
/*
typedef struct moveInfo_s // !!!!!!!!!! LOADSAVE-affecting struct !!!!!!!!
{
vec3_t desiredAngles; // Desired facing angles
float speed; // Speed of movement
float aspeed; // Speed of angular movement
vec3_t moveDir; // Direction of movement
vec3_t velocity; // movement velocity
int flags; // Special state flags
} moveInfo_t;
*/
typedef enum {
CON_DISCONNECTED,
CON_CONNECTING,
CON_CONNECTED
} clientConnected_t;
typedef enum {
TEAM_BEGIN, // Beginning a team game, spawn at base
TEAM_ACTIVE // Now actively playing
} playerTeamStateState_t;
/*
typedef enum //# race_e
{
RACE_NONE = 0,
RACE_HUMAN,
RACE_BORG,
RACE_KLINGON,
RACE_HIROGEN,
RACE_MALON,
RACE_STASIS,
RACE_8472,
RACE_BOT,
RACE_HARVESTER,
RACE_REAVER,
RACE_AVATAR,
RACE_PARASITE,
RACE_VULCAN,
RACE_BETAZOID,
RACE_BOLIAN,
RACE_TALAXIAN,
RACE_BAJORAN,
RACE_HOLOGRAM
} race_t;
*/
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct {
playerTeamStateState_t state;
int captures;
int basedefense;
int carrierdefense;
int flagrecovery;
int fragcarrier;
int assists;
float lasthurtcarrier;
float lastreturnedflag;
float flagsince;
float lastfraggedcarrier;
} playerTeamState_t;
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct objectives_s
{
qboolean display; // A displayable objective?
int status; // Succeed or fail or pending
} objectives_t;
#define MAX_MISSION_OBJ 80
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct missionStats_s
{
int secretsFound; // # of secret areas found
int totalSecrets; // # of secret areas that could have been found
int shotsFired; // total number of shots fired
int hits; // Shots that did damage
int enemiesSpawned; // # of enemies spawned
int enemiesKilled; // # of enemies killed
int saberThrownCnt; // # of times saber was thrown
int saberBlocksCnt; // # of times saber was used to block
int legAttacksCnt; // # of times legs were hit with saber
int armAttacksCnt; // # of times arm were hit with saber
int torsoAttacksCnt; // # of times torso was hit with saber
int otherAttacksCnt; // # of times anything else on a monster was hit with saber
int forceUsed[NUM_FORCE_POWERS]; // # of times each force power was used
int weaponUsed[WP_NUM_WEAPONS]; // # of times each weapon was used
} missionStats_t;
// the auto following clients don't follow a specific client
// number, but instead follow the first two active players
#define FOLLOW_ACTIVE1 -1
#define FOLLOW_ACTIVE2 -2
// client data that stays across multiple levels or tournament restarts
// this is achieved by writing all the data to cvar strings at game shutdown
// time and reading them back at connection time. Anything added here
// MUST be dealt with in G_InitSessionData() / G_ReadSessionData() / G_WriteSessionData()
//
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct {
int missionObjectivesShown; // Number of times mission objectives have been updated
team_t sessionTeam;
objectives_t mission_objectives[MAX_MISSION_OBJ];
missionStats_t missionStats; // Various totals while on a mission
} clientSession_t;
// client data that stays across multiple respawns, but is cleared
// on each level change or team change at ClientBegin()
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
typedef struct {
clientConnected_t connected;
usercmd_t lastCommand;
qboolean localClient; // true if "ip" info key is "localhost"
char netname[34];
int maxHealth; // for handicapping
int enterTime; // level.time the client entered the game
short cmd_angles[3]; // angles sent over in the last command
playerTeamState_t teamState; // status in teamplay games
} clientPersistant_t;
#define MAX_SABER_TRAIL_SEGS 8
typedef struct
{
// Actual trail stuff
int inAction; // controls whether should we even consider starting one
int duration; // how long each trail seg stays in existence
int lastTime; // time a saber segement was last stored
vec3_t base;
vec3_t tip;
// Marks stuff
qboolean haveOldPos[2];
vec3_t oldPos[2];
vec3_t oldNormal[2]; // store this in case we don't have a connect-the-dots situation
// ..then we'll need the normal to project a mark blob onto the impact point
} saberTrail_t;
typedef enum {
BLK_NO,
BLK_TIGHT, // Block only attacks and shots around the saber itself, a bbox of around 12x12x12
BLK_WIDE // Block all attacks in an area around the player in a rough arc of 180 degrees
} saberBlockType_t;
typedef enum {
BLOCKED_NONE,
BLOCKED_PARRY_BROKEN,
BLOCKED_ATK_BOUNCE,
BLOCKED_UPPER_RIGHT,
BLOCKED_UPPER_LEFT,
BLOCKED_LOWER_RIGHT,
BLOCKED_LOWER_LEFT,
BLOCKED_TOP,
BLOCKED_UPPER_RIGHT_PROJ,
BLOCKED_UPPER_LEFT_PROJ,
BLOCKED_LOWER_RIGHT_PROJ,
BLOCKED_LOWER_LEFT_PROJ,
BLOCKED_TOP_PROJ
} saberBlockedType_t;
// !!!!!!!!!! LOADSAVE-affecting structure !!!!!!!!!!
// this structure is cleared on each ClientSpawn(),
// except for 'client->pers' and 'client->sess'
struct gclient_s {
// ps MUST be the first element, because the server expects it
playerState_t ps; // communicated by server to clients
// private to game
clientPersistant_t pers;
clientSession_t sess;
qboolean noclip;
int lastCmdTime; // level.time of last usercmd_t, for EF_CONNECTION
usercmd_t usercmd; // most recent usercmd
int buttons;
int oldbuttons;
int latched_buttons;
// sum up damage over an entire frame, so
// shotgun blasts give a single big kick
int damage_armor; // damage absorbed by armor
int damage_blood; // damage taken out of health
int damage_knockback; // impact damage
vec3_t damage_from; // origin for vector calculation
qboolean damage_fromWorld; // if true, don't use the damage_from vector
int accurateCount; // for "impressive" reward sound
// timers
int respawnTime; // can respawn when time > this, force after g_forcerespwan
int inactivityTime; // kick players when time > this
qboolean inactivityWarning; // qtrue if the five seoond warning has been given
int idleTime; // for playing idleAnims
int airOutTime;
// timeResidual is used to handle events that happen every second
// like health / armor countdowns and regeneration
int timeResidual;
// Facial Expression Timers
float facial_blink; // time before next blink. If a minus value, we are in blink mode
float facial_frown; // time before next frown. If a minus value, we are in frown mode
float facial_aux; // time before next aux. If a minus value, we are in aux mode
//Client info - updated when ClientInfoChanged is called, instead of using configstrings
clientInfo_t clientInfo;
signed char forced_forwardmove;
signed char forced_rightmove;
int fireDelay; //msec to delay calling G_FireWeapon after EV_FIREWEAPON event is called
//Used to be in gentity_t, now here.. mostly formation stuff
team_t playerTeam;
team_t enemyTeam;
// race_t race;
char *squadname;
gentity_t *team_leader;
gentity_t *leader;
gentity_t *follower;
int numFollowers;
gentity_t *formationGoal;
int nextFormGoal;
class_t NPC_class;
//FIXME: could combine these
float hiddenDist;//How close ents have to be to pick you up as an enemy
vec3_t hiddenDir;//Normalized direction in which NPCs can't see you (you are hidden)
renderInfo_t renderInfo;
saberTrail_t saberTrail;
//dismember tracker
qboolean dismembered;
char dismemberProbLegs; // probability of the legs being dismembered (located in NPC.cfg, 0 = never, 100 = always)
char dismemberProbHead; // probability of the head being dismembered (located in NPC.cfg, 0 = never, 100 = always)
char dismemberProbArms; // probability of the arms being dismembered (located in NPC.cfg, 0 = never, 100 = always)
char dismemberProbHands; // probability of the hands being dismembered (located in NPC.cfg, 0 = never, 100 = always)
char dismemberProbWaist; // probability of the waist being dismembered (located in NPC.cfg, 0 = never, 100 = always)
int standheight;
int crouchheight;
int poisonDamage; // Amount of poison damage to be given
int poisonTime; // When to apply poison damage
int slopeRecalcTime; // debouncer for slope-foot-height-diff calcing
vec3_t pushVec;
int pushVecTime;
};
#define MAX_PARMS 16
#define MAX_PARM_STRING_LENGTH MAX_QPATH//was 16, had to lengthen it so they could take a valid file path
typedef struct
{
char parm[MAX_PARMS][MAX_PARM_STRING_LENGTH];
} parms_t;
#ifdef GAME_INCLUDE
//these hold the place for the enums in functions.h so i don't have to recompile everytime it changes
#define thinkFunc_t int
#define clThinkFunc_t int
#define reachedFunc_t int
#define blockedFunc_t int
#define touchFunc_t int
#define useFunc_t int
#define painFunc_t int
#define dieFunc_t int
#define MAX_FAILED_NODES 8
typedef struct centity_s centity_t;
struct gentity_s {
entityState_t s; // communicated by server to clients
struct gclient_s *client; // NULL if not a player (unless it's NPC ( if (this->NPC != NULL) ) <sigh>... -slc)
qboolean inuse;
qboolean linked; // qfalse if not in any good cluster
int svFlags; // SVF_NOCLIENT, SVF_BROADCAST, etc
qboolean bmodel; // if false, assume an explicit mins / maxs bounding box
// only set by gi.SetBrushModel
vec3_t mins, maxs;
int contents; // CONTENTS_TRIGGER, CONTENTS_SOLID, CONTENTS_BODY, etc
// a non-solid entity should set to 0
vec3_t absmin, absmax; // derived from mins/maxs and origin + rotation
// currentOrigin will be used for all collision detection and world linking.
// it will not necessarily be the same as the trajectory evaluation for the current
// time, because each entity must be moved one at a time after time is advanced
// to avoid simultanious collision issues
vec3_t currentOrigin;
vec3_t currentAngles;
gentity_t *owner; // objects never interact with their owners, to
// prevent player missiles from immediately
// colliding with their owner
/*
Ghoul2 Insert Start
*/
// this marker thing of Jake's is used for memcpy() length calcs, so don't put any ordinary fields (like above)
// below this point or they won't work, and will mess up all sorts of stuff.
//
CGhoul2Info_v ghoul2;
/*
Ghoul2 Insert End
*/
// DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER
// EXPECTS THE FIELDS IN THAT ORDER!
//==========================================================================================
//Essential entity fields
// note: all the char* fields from here on should be left as ptrs, not declared, because of the way that ent-parsing
// works by forcing field offset ptrs as char* and using G_NewString()!! (see G_ParseField() in gmae/g_spawn.cpp -slc
//
char *classname; // set in QuakeEd
int spawnflags; // set in QuakeEd
int flags; // FL_* variables
char *model; // Normal model, or legs model on tri-models
char *model2; // Torso model
int freetime; // sv.time when the object was freed
int eventTime; // events will be cleared EVENT_VALID_MSEC after set
qboolean freeAfterEvent;
qboolean unlinkAfterEvent;
//Physics and movement fields
float physicsBounce; // 1.0 = continuous bounce, 0.0 = no bounce
int clipmask; // brushes with this content value will be collided against
// when moving. items and corpses do not collide against
// players, for instance
// moveInfo_t moveInfo; //FIXME: use this more?
float speed;
vec3_t movedir;
vec3_t lastOrigin; //Where you were last frame
vec3_t lastAngles; //Where you were looking last frame
float mass; //How heavy you are
int lastImpact; //Last time you impacted something
//Variables reflecting environment
int watertype;
int waterlevel;
//Targeting/linking fields
float angle; // set in editor, -1 = up, -2 = down
char *target;
char *target2; //For multiple targets, not used for firing/triggering/using, though, only for path branches
char *target3; //For multiple targets, not used for firing/triggering/using, though, only for path branches
char *target4; //For multiple targets, not used for firing/triggering/using, though, only for path branches
char *targetname;
char *team;
union
{
char *roff; // the roff file to use, if there is one
char *fxFile; // name of the external effect file
};
int roff_ctr; // current roff frame we are playing
int next_roff_time;
int fx_time; // timer for beam in/out effects.
//Think Functions
int nextthink;//Used to determine if it's time to call e_ThinkFunc again
thinkFunc_t e_ThinkFunc;//Called once every game frame for every ent
clThinkFunc_t e_clThinkFunc;//Think func for equivalent centity
reachedFunc_t e_ReachedFunc;// movers call this when hitting endpoint
blockedFunc_t e_BlockedFunc;
touchFunc_t e_TouchFunc;
useFunc_t e_UseFunc; //Called by G_UseTargets
painFunc_t e_PainFunc; //Called by G_Damage when damage is taken
dieFunc_t e_DieFunc; //Called by G_Damage when health reaches <= 0
//Health and damage fields
int health;
int max_health;
qboolean takedamage;
material_t material;
int damage;
int dflags;
//explosives, breakable brushes
int splashDamage; // quad will increase this without increasing radius
int splashRadius;
int methodOfDeath;
int splashMethodOfDeath;
//int hitLoc;//where you were last hit
int locationDamage[HL_MAX]; // Damage accumulated on different body locations
//Entity pointers
gentity_t *chain;
gentity_t *enemy;
gentity_t *activator;
gentity_t *teamchain; // next entity in team
gentity_t *teammaster; // master of the team
gentity_t *lastEnemy;
//Timing variables, counters and debounce times
float wait;
float random;
int delay;
qboolean alt_fire;
int count;
int bounceCount;
int fly_sound_debounce_time; // wind tunnel
int painDebounceTime;
int disconnectDebounceTime;
int attackDebounceTime;
int pushDebounceTime;
int aimDebounceTime;
int useDebounceTime;
//Unions for miscellaneous fields used under very specific circumstances
union
{
qboolean trigger_formation;
qboolean misc_dlight_active;
qboolean has_bounced; // for thermal Det. we force at least one bounce to happen before it can do proximity checks
};
//Navigation
int waypoint; //Set once per frame, if you've moved, and if someone asks
int lastWaypoint; //To make sure you don't double-back
int lastValidWaypoint; //ALWAYS valid -used for tracking someone you lost
int noWaypointTime; //Debouncer - so don't keep checking every waypoint in existance every frame that you can't find one
int combatPoint;
int failedWaypoints[MAX_FAILED_NODES];
int failedWaypointCheckTime;
//Animation
qboolean loopAnim;
int startFrame;
int endFrame;
//Script/ICARUS-related fields
CSequencer *sequencer;
CTaskManager *taskManager;
int taskID[NUM_TIDS];
parms_t *parms;
char *behaviorSet[NUM_BSETS];
char *script_targetname;
int delayScriptTime;
char *fullName;
// Ambient sound info
char *soundSet; //Only used for local sets
int setTime;
//Used by cameras to locate subjects
char *cameraGroup;
//For damage
team_t noDamageTeam;
// Ghoul2 Animation info
int playerModel;
int weaponModel;
int handRBolt;
int handLBolt;
int headBolt;
int cervicalBolt;
int chestBolt;
int gutBolt;
int torsoBolt;
int crotchBolt;
int motionBolt;
int kneeLBolt;
int kneeRBolt;
int elbowLBolt;
int elbowRBolt;
int footLBolt;
int footRBolt;
int faceBone;
int craniumBone;
int cervicalBone;
int thoracicBone;
int upperLumbarBone;
int lowerLumbarBone;
int hipsBone;
int motionBone;
int rootBone;
int footLBone;
int footRBone;
int genericBone1; // For bones special to an entity
int genericBone2;
int genericBone3;
int genericBolt1; // For bolts special to an entity
int genericBolt2;
int genericBolt3;
int genericBolt4;
int genericBolt5;
qhandle_t cinematicModel;
//==========================================================================================
//FIELDS USED EXCLUSIVELY BY SPECIFIC CLASSES OF ENTITIES
//NPC/Player entity fields
//FIXME: Make these client only?
gNPC_t *NPC;//Only allocated if the entity becomes an NPC
//Other NPC/Player-related entity fields
char *ownername;//Used by squadpaths to locate owning NPC
//FIXME: Only used by NPCs, move it to gNPC_t
int cantHitEnemyCounter;//HACK - Makes them look for another enemy on the same team if the one they're after can't be hit
//Only used by NPC_spawners
char *NPC_type;
char *NPC_targetname;
char *NPC_target;
//Variables used by movers (most likely exclusively by them)
moverState_t moverState;
int soundPos1;
int sound1to2;
int sound2to1;
int soundPos2;
int soundLoop;
gentity_t *nextTrain;
gentity_t *prevTrain;
vec3_t pos1, pos2;
vec3_t pos3;
int sounds;
char *closetarget;
char *opentarget;
char *paintarget;
int lockCount; //for maglocks- actually get put on the trigger for the door
//Variables used only by waypoints (for the most part)
float radius;
union
{
int wpIndex;
int fxID; // id of the external effect file
};
int noise_index;
vec4_t startRGBA;
union
{
vec4_t finalRGBA;
vec3_t pos4;
};
//FIXME: Are these being used anymore?
gitem_t *item; // for bonus items -
char *message; //Used by triggers to print a message when activated
float lightLevel;
//FIXME: can these be removed/condensed/absorbed?
//Rendering info
//int color;
//Force effects
int forcePushTime;
int forcePuller; //who force-pulled me (so we don't damage them if we hit them)
};
#endif //#ifdef GAME_INCLUDE
extern gentity_t g_entities[MAX_GENTITIES];
#ifndef _USRDLL
extern game_import_t gi;
#endif
// each WP_* weapon enum has an associated weaponInfo_t
// that contains media references necessary to present the
// weapon and its effects
typedef struct weaponInfo_s {
qboolean registered;
gitem_t *item;
qhandle_t handsModel; // the hands don't actually draw, they just position the weapon
qhandle_t weaponModel; //for in view
qhandle_t weaponWorldModel; //for in their hands
qhandle_t barrelModel[4];
vec3_t weaponMidpoint; // so it will rotate centered instead of by tag
qhandle_t weaponIcon; // The version of the icon with a glowy background
qhandle_t weaponIconNoAmmo; // The version of the icon with no ammo warning
qhandle_t ammoIcon;
qhandle_t ammoModel;
qhandle_t missileModel;
sfxHandle_t missileSound;
void (*missileTrailFunc)( centity_t *, const struct weaponInfo_s *wi );
qhandle_t alt_missileModel;
sfxHandle_t alt_missileSound;
void (*alt_missileTrailFunc)( centity_t *, const struct weaponInfo_s *wi );
// sfxHandle_t flashSound;
// sfxHandle_t altFlashSound;
sfxHandle_t firingSound;
sfxHandle_t altFiringSound;
sfxHandle_t stopSound;
sfxHandle_t missileHitSound;
sfxHandle_t altmissileHitSound;
sfxHandle_t chargeSound;
sfxHandle_t altChargeSound;
sfxHandle_t selectSound; // sound played when weapon is selected
} weaponInfo_t;
extern sfxHandle_t CAS_GetBModelSound( const char *name, int stage );
enum
{
EDGE_NORMAL,
EDGE_PATH,
EDGE_BLOCKED,
EDGE_FAILED,
EDGE_MOVEDIR
};
enum
{
NODE_NORMAL,
NODE_START,
NODE_GOAL,
NODE_NAVGOAL,
};
#endif // #ifndef __G_SHARED_H__
/*
structures heirarchy
centity_t cg_entities[MAX_GENTITIES]
{
entityState_t currentState, nextState
{
trajectory_t pos, apos
}
playerEntity_t pe
{
lerpFrame_t legs, torso
{
animation_t animation
}
}
gentity_t gent, g_entities[MAX_GENTITIES]
{
gentity_t owner, nextTrain, prevTrain, chain, enemy, activator, teamchain, teammaster, team_leader, leader, follower, formationGoal, lastEnemy
entityState_t s
{
trajectory_t pos, apos
}
gclient_t client
{
playerState_t ps
clientPersistant_t pers;
{
playerTeamState_t teamState; // status in teamplay games
}
clientSession_t sess
usercmd_t usercmd
clientInfo_t clientInfo
{
animation_t animation[MAX_ANIMATIONS]
animsounds_t torsoAnimSnds[MAX_ANIM_SOUNDS], legsAnimSnds[MAX_ANIM_SOUNDS]
}
}
gitem_t item
gNPC_t NPC
{
gNPCstats_t stats;
usercmd_t last_ucmd;
}
moveInfo_t moveInfo
renderInfo_t renderInfo
{
modelInfo_t torsoModel, headModel
boltOn_t boltOns[MAX_BOLT_ONS]
}
}
}
level_locals_t
{
gclient_t clients
gentity_t locationHead
interestPoint_t interestPoints[MAX_INTEREST_POINTS]
combatPoint_t combatPoints[MAX_COMBAT_POINTS]
}
*/
|
{
"pile_set_name": "Github"
}
|
&input
title='N',
zed=7.0,
rel=2,
config='[He] 2s2 2p3 3d-1'
iswitch=3,
dft='LDA',
/
&inputp
lloc=2,
pseudotype=3,
file_pseudopw='N.rel-pz-rrkjus.UPF',
author='ADC',
nlcc=.true.,
rcore=0.7,
/
8
2S 1 0 2.00 0.00 1.30 1.60 0.50
2S 1 0 0.00 0.05 1.30 1.60 0.50
2P 2 1 2.00 0.00 1.30 1.60 0.50
2P 2 1 0.00 0.05 1.30 1.60 0.50
2P 2 1 1.00 0.00 1.30 1.60 1.50
2P 2 1 0.00 0.05 1.30 1.60 1.50
3D 3 2 -2.00 0.15 1.30 1.30 1.50
3D 3 2 -2.00 0.15 1.30 1.30 2.50
|
{
"pile_set_name": "Github"
}
|
{
"name": "core-util-is",
"version": "1.0.1",
"description": "The `util.is*` functions introduced in Node v0.12.",
"main": "lib/util.js",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/core-util-is"
},
"keywords": [
"util",
"isBuffer",
"isArray",
"isNumber",
"isString",
"isRegExp",
"isThis",
"isThat",
"polyfill"
],
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"url": "http://blog.izs.me/"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/isaacs/core-util-is/issues"
},
"readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
"readmeFilename": "README.md",
"homepage": "https://github.com/isaacs/core-util-is",
"_id": "core-util-is@1.0.1",
"_from": "core-util-is@>=1.0.0 <1.1.0",
"scripts": {}
}
|
{
"pile_set_name": "Github"
}
|
#include "../Base/Node.h"
#include "PointLight.h"
namespace tzw {
class SpotLight : public PointLight
{
public:
SpotLight();
vec3 dir() const;
void setDir(const vec3 &dir);
void tick(float dt);
private:
vec3 m_dir;
};
} // namespace tzw
|
{
"pile_set_name": "Github"
}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../gameSource/objectBank.h"
#include "../gameSource/transitionBank.h"
#include "../gameSource/categoryBank.h"
#include "../gameSource/animationBank.h"
void usage() {
printf( "Usage:\n\n"
"printObjectName id\n\n" );
exit( 1 );
}
int main( int inNumArgs, char **inArgs ) {
if( inNumArgs != 2 ) {
usage();
}
char rebuilding;
initAnimationBankStart( &rebuilding );
while( initAnimationBankStep() < 1.0 );
initAnimationBankFinish();
initObjectBankStart( &rebuilding, true, true );
while( initObjectBankStep() < 1.0 );
initObjectBankFinish();
initCategoryBankStart( &rebuilding );
while( initCategoryBankStep() < 1.0 );
initCategoryBankFinish();
// auto-generate category-based transitions
initTransBankStart( &rebuilding, true, true, true, true );
while( initTransBankStep() < 1.0 );
initTransBankFinish();
int id = 0;
sscanf( inArgs[1], "%d", &id );
ObjectRecord *o = getObject( id );
if( o != NULL ) {
printf( "%s\n", o->description );
}
else {
printf( "Empty space\n" );
}
freeTransBank();
freeCategoryBank();
freeObjectBank();
freeAnimationBank();
return 1;
}
void *getSprite( int ) {
return NULL;
}
char *getSpriteTag( int ) {
return NULL;
}
char isSpriteBankLoaded() {
return false;
}
char markSpriteLive( int ) {
return false;
}
void stepSpriteBank() {
}
void drawSprite( void*, doublePair, double, double, char ) {
}
void setDrawColor( float inR, float inG, float inB, float inA ) {
}
void setDrawFade( float ) {
}
float getTotalGlobalFade() {
return 1.0f;
}
void toggleAdditiveTextureColoring( char inAdditive ) {
}
void toggleAdditiveBlend( char ) {
}
void drawSquare( doublePair, double ) {
}
void startAddingToStencil( char, char, float ) {
}
void startDrawingThroughStencil( char ) {
}
void stopStencil() {
}
// dummy implementations of these functions, which are used in editor
// and client, but not server
#include "../gameSource/spriteBank.h"
SpriteRecord *getSpriteRecord( int inSpriteID ) {
return NULL;
}
#include "../gameSource/soundBank.h"
void checkIfSoundStillNeeded( int inID ) {
}
char getSpriteHit( int inID, int inXCenterOffset, int inYCenterOffset ) {
return false;
}
char getUsesMultiplicativeBlending( int inID ) {
return false;
}
void toggleMultiplicativeBlend( char inMultiplicative ) {
}
void countLiveUse( SoundUsage inUsage ) {
}
void unCountLiveUse( SoundUsage inUsage ) {
}
// animation bank calls these only if lip sync hack is enabled, which
// it never is for server
void *loadSpriteBase( const char*, char ) {
return NULL;
}
void freeSprite( void* ) {
}
void startOutputAllFrames() {
}
void stopOutputAllFrames() {
}
|
{
"pile_set_name": "Github"
}
|
const assert = require('assert');
const fs = require('fs');
const mock = require('..');
/**
* Test setup. Not timed.
*/
exports.beforeEach = function() {
mock({
'foo-mock.txt': 'foo'
});
};
/**
* Timed test.
* @param {function(Error)} done Callback.
*/
exports.test = function(done) {
fs.readFile('foo-mock.txt', 'utf8', function(err, str) {
assert.ifError(err);
assert.equal(str, 'foo');
done();
});
};
/**
* Test teardown. Not timed.
*/
exports.afterEach = function() {
mock.restore();
};
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE
*/
package de.ilias.services.filemanager.soap.api;
import de.ilias.services.filemanager.content.ListItem;
import de.ilias.services.filemanager.content.RemoteListItem;
import de.ilias.services.filemanager.utils.FileManagerUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import javafx.scene.layout.HBox;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
* Class SoapClientObjects
*
* @author Stefan Meyer <smeyer.ilias@gmx.de>
*/
@XmlRootElement( name = "Objects")
public class SoapClientObjects {
@XmlTransient
private static Logger logger = Logger.getLogger(SoapClientObjects.class.getName());
private List<SoapClientObject> objects;
/**
* get objects
* @return
*/
@XmlElement( name = "Object")
public List<SoapClientObject> getObjects() {
if(objects == null) {
return objects = new ArrayList<SoapClientObject>();
}
return objects;
}
/**
* Get list of path elements
*
* @param includeLeaf
* @return
*/
public List<SoapClientObjectReferencePath> getFirstPath(boolean includeLeaf) {
List<SoapClientObjectReferencePath> pathList = new ArrayList<SoapClientObjectReferencePath>();
// choose first object
for(SoapClientObject obj : getObjects()) {
// choose first reference
for(SoapClientObjectReference ref : obj.getReferences()) {
pathList = ref.getPathElements();
break;
}
break;
}
// Append a leaf the leaf node as path element if desired
if(includeLeaf) {
for(SoapClientObject obj : getObjects()) {
for(SoapClientObjectReference ref : obj.getReferences()) {
SoapClientObjectReferencePath leaf = new SoapClientObjectReferencePath();
if(pathList.size() < 1) {
leaf.setTitle("Repository");
}
else {
leaf.setTitle(obj.getTitle());
}
leaf.setRefId(ref.getRefId());
leaf.setType(obj.getType());
pathList.add(leaf);
break;
}
break;
}
}
return pathList;
}
public ListItem getParentListItem() {
int minElements = 1;
Iterator objectIterator = getObjects().iterator();
while(objectIterator.hasNext()) {
SoapClientObject obj = (SoapClientObject) objectIterator.next();
Iterator refIterator = obj.getReferences().iterator();
while(refIterator.hasNext()) {
SoapClientObjectReference ref = (SoapClientObjectReference) refIterator.next();
ArrayList<SoapClientObjectReferencePath> pathElements = (ArrayList<SoapClientObjectReferencePath>) ref.getPathElements();
if(pathElements.size() >= minElements) {
SoapClientObjectReferencePath parent = pathElements.get(pathElements.size() - 1);
RemoteListItem parentItem = new RemoteListItem();
parentItem.setRefId(parent.getRefId());
parentItem.setType(parent.getType());
parentItem.setTitle(parent.getTitle());
return parentItem;
}
}
}
return null;
}
public List<File> checkNamingConflicts(List<File> files) {
ArrayList<File> conflicted = new ArrayList<File>();
for(File file : files) {
for(SoapClientObject obj : getObjects()) {
if(
file.getName().equalsIgnoreCase(obj.getTitle()) &&
(obj.getType().equals("file") || obj.getType().equals("fold") || obj.getType().equals("cat")) &&
obj.isWritable()) {
logger.info("File names are equal!");
conflicted.add(file);
}
}
}
return conflicted;
}
/**
* Check for a naming conflict e.g. when pasting files from clipboard
* @param files
* @return
*/
public HashMap<File,SoapClientObject> checkNamingConflict(List<File> files) {
HashMap<File,SoapClientObject> conflict = new HashMap<File, SoapClientObject>();
for(File file : files) {
for(SoapClientObject obj : getObjects()) {
if(
file.getName().equalsIgnoreCase(obj.getTitle()) &&
(obj.getType().equals("file") || obj.getType().equals("fold") || obj.getType().equals("cat")) &&
obj.isWritable()) {
logger.info("File names are equal!");
conflict.put(file, obj);
}
}
}
return conflict;
}
/**
* Create a unique file name
* @param file
* @return
*/
public String createUniqueName(File file) {
String newName;
for(int i = 2; i < 50; i++) {
newName = FileManagerUtils.increaseVersionName(file.getName(), i);
// Check if file exists
boolean exists = false;
for(SoapClientObject obj : getObjects()) {
if(obj.getTitle().equalsIgnoreCase(newName)) {
exists = true;
}
}
if(!exists) {
logger.info("Using new name " + newName);
return newName;
}
}
return file.getName();
}
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
OPKG_KEYS="${OPKG_KEYS:-/etc/opkg/keys}"
usage() {
cat <<EOF
Usage: $0 <command> <arguments...>
Commands:
add <file>: Add keyfile <file> to opkg trusted keys
remove <file>: Remove keyfile matching <file> from opkg trusted keys
verify <sigfile> <list>: Check list file <list> against signature file <sigfile>
EOF
exit 1
}
opkg_key_verify() {
local sigfile="$1"
local msgfile="$2"
(
zcat "$msgfile" 2>/dev/null ||
cat "$msgfile" 2>/dev/null
) | usign -V -P "$OPKG_KEYS" -q -x "$sigfile" -m -
}
opkg_key_add() {
local key="$1"
[ -n "$key" ] || usage
[ -f "$key" ] || echo "Cannot open file $1"
local fingerprint="$(usign -F -p "$key")"
mkdir -p "$OPKG_KEYS"
cp "$key" "$OPKG_KEYS/$fingerprint"
}
opkg_key_remove() {
local key="$1"
[ -n "$key" ] || usage
[ -f "$key" ] || echo "Cannot open file $1"
local fingerprint="$(usign -F -p "$key")"
rm -f "$OPKG_KEYS/$fingerprint"
}
case "$1" in
add)
shift
opkg_key_add "$@"
;;
remove)
shift
opkg_key_remove "$@"
;;
verify)
shift
opkg_key_verify "$@"
;;
*) usage ;;
esac
|
{
"pile_set_name": "Github"
}
|
/**
* \file
*
* \brief Instance description for TCC0
*
* Copyright (c) 2018 Microchip Technology Inc.
*
* \asf_license_start
*
* \page License
*
* 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 Licence 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.
*
* \asf_license_stop
*
*/
#ifndef _SAML21_TCC0_INSTANCE_
#define _SAML21_TCC0_INSTANCE_
/* ========== Register definition for TCC0 peripheral ========== */
#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
#define REG_TCC0_CTRLA (0x42001400) /**< \brief (TCC0) Control A */
#define REG_TCC0_CTRLBCLR (0x42001404) /**< \brief (TCC0) Control B Clear */
#define REG_TCC0_CTRLBSET (0x42001405) /**< \brief (TCC0) Control B Set */
#define REG_TCC0_SYNCBUSY (0x42001408) /**< \brief (TCC0) Synchronization Busy */
#define REG_TCC0_FCTRLA (0x4200140C) /**< \brief (TCC0) Recoverable Fault A Configuration */
#define REG_TCC0_FCTRLB (0x42001410) /**< \brief (TCC0) Recoverable Fault B Configuration */
#define REG_TCC0_WEXCTRL (0x42001414) /**< \brief (TCC0) Waveform Extension Configuration */
#define REG_TCC0_DRVCTRL (0x42001418) /**< \brief (TCC0) Driver Control */
#define REG_TCC0_DBGCTRL (0x4200141E) /**< \brief (TCC0) Debug Control */
#define REG_TCC0_EVCTRL (0x42001420) /**< \brief (TCC0) Event Control */
#define REG_TCC0_INTENCLR (0x42001424) /**< \brief (TCC0) Interrupt Enable Clear */
#define REG_TCC0_INTENSET (0x42001428) /**< \brief (TCC0) Interrupt Enable Set */
#define REG_TCC0_INTFLAG (0x4200142C) /**< \brief (TCC0) Interrupt Flag Status and Clear */
#define REG_TCC0_STATUS (0x42001430) /**< \brief (TCC0) Status */
#define REG_TCC0_COUNT (0x42001434) /**< \brief (TCC0) Count */
#define REG_TCC0_PATT (0x42001438) /**< \brief (TCC0) Pattern */
#define REG_TCC0_WAVE (0x4200143C) /**< \brief (TCC0) Waveform Control */
#define REG_TCC0_PER (0x42001440) /**< \brief (TCC0) Period */
#define REG_TCC0_CC0 (0x42001444) /**< \brief (TCC0) Compare and Capture 0 */
#define REG_TCC0_CC1 (0x42001448) /**< \brief (TCC0) Compare and Capture 1 */
#define REG_TCC0_CC2 (0x4200144C) /**< \brief (TCC0) Compare and Capture 2 */
#define REG_TCC0_CC3 (0x42001450) /**< \brief (TCC0) Compare and Capture 3 */
#define REG_TCC0_PATTBUF (0x42001464) /**< \brief (TCC0) Pattern Buffer */
#define REG_TCC0_WAVEBUF (0x42001468) /**< \brief (TCC0) Waveform Control Buffer */
#define REG_TCC0_PERBUF (0x4200146C) /**< \brief (TCC0) Period Buffer */
#define REG_TCC0_CCBUF0 (0x42001470) /**< \brief (TCC0) Compare and Capture Buffer 0 */
#define REG_TCC0_CCBUF1 (0x42001474) /**< \brief (TCC0) Compare and Capture Buffer 1 */
#define REG_TCC0_CCBUF2 (0x42001478) /**< \brief (TCC0) Compare and Capture Buffer 2 */
#define REG_TCC0_CCBUF3 (0x4200147C) /**< \brief (TCC0) Compare and Capture Buffer 3 */
#else
#define REG_TCC0_CTRLA (*(RwReg *)0x42001400UL) /**< \brief (TCC0) Control A */
#define REG_TCC0_CTRLBCLR (*(RwReg8 *)0x42001404UL) /**< \brief (TCC0) Control B Clear */
#define REG_TCC0_CTRLBSET (*(RwReg8 *)0x42001405UL) /**< \brief (TCC0) Control B Set */
#define REG_TCC0_SYNCBUSY (*(RoReg *)0x42001408UL) /**< \brief (TCC0) Synchronization Busy */
#define REG_TCC0_FCTRLA (*(RwReg *)0x4200140CUL) /**< \brief (TCC0) Recoverable Fault A Configuration */
#define REG_TCC0_FCTRLB (*(RwReg *)0x42001410UL) /**< \brief (TCC0) Recoverable Fault B Configuration */
#define REG_TCC0_WEXCTRL (*(RwReg *)0x42001414UL) /**< \brief (TCC0) Waveform Extension Configuration */
#define REG_TCC0_DRVCTRL (*(RwReg *)0x42001418UL) /**< \brief (TCC0) Driver Control */
#define REG_TCC0_DBGCTRL (*(RwReg8 *)0x4200141EUL) /**< \brief (TCC0) Debug Control */
#define REG_TCC0_EVCTRL (*(RwReg *)0x42001420UL) /**< \brief (TCC0) Event Control */
#define REG_TCC0_INTENCLR (*(RwReg *)0x42001424UL) /**< \brief (TCC0) Interrupt Enable Clear */
#define REG_TCC0_INTENSET (*(RwReg *)0x42001428UL) /**< \brief (TCC0) Interrupt Enable Set */
#define REG_TCC0_INTFLAG (*(RwReg *)0x4200142CUL) /**< \brief (TCC0) Interrupt Flag Status and Clear */
#define REG_TCC0_STATUS (*(RwReg *)0x42001430UL) /**< \brief (TCC0) Status */
#define REG_TCC0_COUNT (*(RwReg *)0x42001434UL) /**< \brief (TCC0) Count */
#define REG_TCC0_PATT (*(RwReg16*)0x42001438UL) /**< \brief (TCC0) Pattern */
#define REG_TCC0_WAVE (*(RwReg *)0x4200143CUL) /**< \brief (TCC0) Waveform Control */
#define REG_TCC0_PER (*(RwReg *)0x42001440UL) /**< \brief (TCC0) Period */
#define REG_TCC0_CC0 (*(RwReg *)0x42001444UL) /**< \brief (TCC0) Compare and Capture 0 */
#define REG_TCC0_CC1 (*(RwReg *)0x42001448UL) /**< \brief (TCC0) Compare and Capture 1 */
#define REG_TCC0_CC2 (*(RwReg *)0x4200144CUL) /**< \brief (TCC0) Compare and Capture 2 */
#define REG_TCC0_CC3 (*(RwReg *)0x42001450UL) /**< \brief (TCC0) Compare and Capture 3 */
#define REG_TCC0_PATTBUF (*(RwReg16*)0x42001464UL) /**< \brief (TCC0) Pattern Buffer */
#define REG_TCC0_WAVEBUF (*(RwReg *)0x42001468UL) /**< \brief (TCC0) Waveform Control Buffer */
#define REG_TCC0_PERBUF (*(RwReg *)0x4200146CUL) /**< \brief (TCC0) Period Buffer */
#define REG_TCC0_CCBUF0 (*(RwReg *)0x42001470UL) /**< \brief (TCC0) Compare and Capture Buffer 0 */
#define REG_TCC0_CCBUF1 (*(RwReg *)0x42001474UL) /**< \brief (TCC0) Compare and Capture Buffer 1 */
#define REG_TCC0_CCBUF2 (*(RwReg *)0x42001478UL) /**< \brief (TCC0) Compare and Capture Buffer 2 */
#define REG_TCC0_CCBUF3 (*(RwReg *)0x4200147CUL) /**< \brief (TCC0) Compare and Capture Buffer 3 */
#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
/* ========== Instance parameters for TCC0 peripheral ========== */
#define TCC0_CC_NUM 4 // Number of Compare/Capture units
#define TCC0_DITHERING 1 // Dithering feature implemented
#define TCC0_DMAC_ID_MC_0 12
#define TCC0_DMAC_ID_MC_1 13
#define TCC0_DMAC_ID_MC_2 14
#define TCC0_DMAC_ID_MC_3 15
#define TCC0_DMAC_ID_MC_LSB 12
#define TCC0_DMAC_ID_MC_MSB 15
#define TCC0_DMAC_ID_MC_SIZE 4
#define TCC0_DMAC_ID_OVF 11 // DMA overflow/underflow/retrigger trigger
#define TCC0_DTI 1 // Dead-Time-Insertion feature implemented
#define TCC0_EXT 31 // Coding of implemented extended features
#define TCC0_GCLK_ID 25 // Index of Generic Clock
#define TCC0_OTMX 1 // Output Matrix feature implemented
#define TCC0_OW_NUM 8 // Number of Output Waveforms
#define TCC0_PG 1 // Pattern Generation feature implemented
#define TCC0_SIZE 24
#define TCC0_SWAP 1 // DTI outputs swap feature implemented
#define TCC0_TYPE 1 // TCC type 0 : NA, 1 : Master, 2 : Slave
#endif /* _SAML21_TCC0_INSTANCE_ */
|
{
"pile_set_name": "Github"
}
|
{
"matches": "absolute-replaced-height-001-ref.xht",
"assert": "If the height, top, bottom and vertical margins of an absolute positioned inline replaced element are all 'auto', then its use value is determined for inline replaced element, its 'top' is given by its static position and both 'margin-top' and 'margin-bottom' used values are '0'. In this test, the 'height' and 'width' of the inline replaced element are 'auto' and the element also has an intrinsic height, so the intrinsic height and the intrinsic width become the used values.",
"help": [
"http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height"
],
"test_case": {
"tag": "body",
"children": [
{
"tag": "div",
"children": [
{
"tag": "img",
"style": {
"margin_bottom": "auto",
"position": "absolute",
"margin_top": "auto"
}
}
],
"style": {
"display": "block",
"width": "1in",
"border_top_style": "solid",
"border_bottom_color": "orange",
"height": "15px",
"border_top_width": "initial",
"border_top_color": "orange",
"border_bottom_style": "solid",
"unicode_bidi": "embed",
"border_bottom_width": "initial"
}
}
],
"style": {
"margin_bottom": "8px",
"margin_top": "8px",
"margin_right": "8px",
"margin_left": "8px",
"unicode_bidi": "embed",
"display": "block"
}
}
}
|
{
"pile_set_name": "Github"
}
|
---
title: "Bracketed identifier is missing closing ']'"
ms.date: 07/20/2015
f1_keywords:
- "bc30034"
- "vbc30034"
helpviewer_keywords:
- "BC30034"
ms.assetid: 46f25ddb-0d9f-48f8-8656-1a880ba8a1ba
---
# Bracketed identifier is missing closing ']'
Brackets in an escaped name must occur in matching pairs.
**Error ID:** BC30034
## To correct this error
- Place a closing bracket at the end of the escaped name.
## See also
- [Declared Element Names](../programming-guide/language-features/declared-elements/declared-element-names.md)
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing https://symfony.com/schema/routing/routing-1.0.xsd">
<route id="localized">
<default key="_controller">MyBundle:Blog:show</default>
<path locale="en">/path</path>
<path locale="fr">/route</path>
</route>
</routes>
|
{
"pile_set_name": "Github"
}
|
// $Id$
/*global JSAN, Test */
// Set up package.
if (typeof JSAN != 'undefined') JSAN.use('Test.Builder');
else {
if (typeof Test == 'undefined' || typeof Test.Builder == 'undefined')
throw new Error(
"You must load either JSAN or Test.Builder "
+ "before loading Test.Simple"
);
}
Test.Simple = {};
Test.Simple.EXPORT = ['plan', 'ok'];
Test.Simple.EXPORT_TAGS = { ':all': Test.Simple.EXPORT };
Test.Simple.VERSION = '0.29';
Test.Simple.plan = function (cmds) {
return Test.Simple.Test.plan(cmds);
};
Test.Simple.ok = function (val, desc) {
return Test.Simple.Test.ok(val, desc);
};
// Handle exporting.
if (typeof JSAN == 'undefined') Test.Builder.exporter(Test.Simple);
Test.Simple.Test = Test.Builder.instance();
|
{
"pile_set_name": "Github"
}
|
#Organize Import Order
#Fri May 09 10:41:15 PDT 2014
0=com
1=net
2=org
3=gnu
4=javax
5=java
6=junit
|
{
"pile_set_name": "Github"
}
|
# Crisp Minimal Résumé for Hexo
[](https://badge.fury.io/js/hexo-theme-crisp-minimal-resume)
Official Hexo port of Crisp Minimal Résumé.
Notice: `color` is not supported in Hexo version.
[Hexo Demo](https://crispgm.github.io/resume-hexo-example/)
## Usage
1. Install Hexo
```shell
yarn global add hexo-cli
```
2. Init Hexo
```shell
hexo new your-resume
```
3. Use Theme
```
# Clone the repo in a different folder
# e.g. /path/to/resume
git clone https://github.com/crispgm/resume.git
# Copy theme files
cp -r /path/to/resume/port-hexo /path/to/your-resume/themes/hexo-crisp-minimal-theme
# Then, change theme in `_config.yml`
```
4. Config your résumé data
Set theme:
```yaml
theme: hexo-crisp-minimal-resume
```
The `baseurl` is required in `_config.yml` if you serve this page as part of your website. And your contact information, __EDUCATION__, __SKILLS__, __EXPERIENCE__, and __PROJECTS__ data under `resume`. See example in [/port-hexo/_config.yml](/_config.yml).
5. Run and Debug
```shell
hexo server
```
## Donation
* [Buy Me A Coffee](https://www.buymeacoffee.com/crispgm)
* [PayPal](https://www.paypal.me/crispgm)
## License
[](/LICENSE)
|
{
"pile_set_name": "Github"
}
|
# Copyright 2012 Mozilla Foundation
#
# 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.
# Main toolbar buttons (tooltips and alt text for images)
previous.title=Páxina anterior
previous_label=Anterior
next.title=Páxina siguiente
next_label=Siguiente
# LOCALIZATION NOTE (page.title): The tooltip for the pageNumber input.
page.title=Páxina
# LOCALIZATION NOTE (of_pages): "{{pagesCount}}" will be replaced by a number
# representing the total number of pages in the document.
of_pages=de {{pagesCount}}
# LOCALIZATION NOTE (page_of_pages): "{{pageNumber}}" and "{{pagesCount}}"
# will be replaced by a number representing the currently visible page,
# respectively a number representing the total number of pages in the document.
page_of_pages=({{pageNumber}} de {{pagesCount}})
zoom_out.title=Reducir
zoom_out_label=Reducir
zoom_in.title=Aumentar
zoom_in_label=Aumentar
zoom.title=Tamañu
presentation_mode.title=
presentation_mode_label=
open_file.title=Abrir ficheru
open_file_label=Abrir
print.title=Imprentar
print_label=Imprentar
download.title=Descargar
download_label=Descargar
bookmark.title=Vista actual (copiar o abrir nuna nueva ventana)
bookmark_label=Vista actual
# Secondary toolbar and context menu
tools.title=Ferramientes
tools_label=Ferramientes
first_page.title=Dir a la primer páxina
first_page.label=Dir a la primer páxina
first_page_label=Dir a la primer páxina
last_page.title=Dir a la postrer páxina
last_page.label=Dir a la cabera páxina
last_page_label=Dir a la postrer páxina
page_rotate_cw.title=Xirar en sen horariu
page_rotate_cw.label=
page_rotate_cw_label=Xirar en sen horariu
page_rotate_ccw.title=Xirar en sen antihorariu
page_rotate_ccw.label=
page_rotate_ccw_label=Xirar en sen antihorariu
# Document properties dialog box
document_properties.title=Propiedaes del documentu…
document_properties_label=Propiedaes del documentu…
document_properties_file_name=Nome de ficheru:
document_properties_file_size=Tamañu de ficheru:
# LOCALIZATION NOTE (document_properties_kb): "{{size_kb}}" and "{{size_b}}"
# will be replaced by the PDF file size in kilobytes, respectively in bytes.
document_properties_kb={{size_kb}} KB ({{size_b}} bytes)
# LOCALIZATION NOTE (document_properties_mb): "{{size_mb}}" and "{{size_b}}"
# will be replaced by the PDF file size in megabytes, respectively in bytes.
document_properties_mb={{size_mb}} MB ({{size_b}} bytes)
document_properties_title=Títulu:
document_properties_author=Autor:
document_properties_subject=Asuntu:
document_properties_keywords=Pallabres clave:
document_properties_creation_date=Data de creación:
document_properties_modification_date=Data de modificación:
# LOCALIZATION NOTE (document_properties_date_string): "{{date}}" and "{{time}}"
# will be replaced by the creation/modification date, and time, of the PDF file.
document_properties_date_string={{date}}, {{time}}
document_properties_creator=Creador:
document_properties_producer=Productor PDF:
document_properties_version=Versión PDF:
document_properties_page_count=Númberu de páxines:
document_properties_close=Zarrar
print_progress_message=Tresnando documentu pa imprentar…
# LOCALIZATION NOTE (print_progress_percent): "{{progress}}" will be replaced by
# a numerical per cent value.
print_progress_percent={{progress}}%
print_progress_close=Encaboxar
# Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are
# tooltips)
toggle_sidebar.title=Camudar barra llateral
toggle_sidebar_label=Camudar barra llateral
document_outline.title=Amosar esquema del documentu (duble clic pa espander/contrayer tolos elementos)
document_outline_label=Esquema del documentu
attachments.title=Amosar axuntos
attachments_label=Axuntos
thumbs.title=Amosar miniatures
thumbs_label=Miniatures
findbar.title=Guetar nel documentu
findbar_label=Guetar
# Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number.
thumb_page_title=Páxina {{page}}
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
# number.
thumb_page_canvas=Miniatura de la páxina {{page}}
# Find panel button title and messages
find_previous.title=Alcontrar l'anterior apaición de la fras
find_previous_label=Anterior
find_next.title=Alcontrar la siguiente apaición d'esta fras
find_next_label=Siguiente
find_highlight=Remarcar toos
find_match_case_label=Coincidencia de mayús./minús.
find_reached_top=Algamóse'l principiu del documentu, siguir dende'l final
find_reached_bottom=Algamóse'l final del documentu, siguir dende'l principiu
find_not_found=Frase non atopada
# Error panel labels
error_more_info=Más información
error_less_info=Menos información
error_close=Zarrar
# LOCALIZATION NOTE (error_version_info): "{{version}}" and "{{build}}" will be
# replaced by the PDF.JS version and build ID.
error_version_info=PDF.js v{{version}} (build: {{build}})
# LOCALIZATION NOTE (error_message): "{{message}}" will be replaced by an
# english string describing the error.
error_message=Mensaxe: {{message}}
# LOCALIZATION NOTE (error_stack): "{{stack}}" will be replaced with a stack
# trace.
error_stack=Pila: {{stack}}
# LOCALIZATION NOTE (error_file): "{{file}}" will be replaced with a filename
error_file=Ficheru: {{file}}
# LOCALIZATION NOTE (error_line): "{{line}}" will be replaced with a line number
error_line=Llinia: {{line}}
rendering_error=Hebo un fallu al renderizar la páxina.
# Predefined zoom values
page_scale_width=Anchor de la páxina
page_scale_fit=Axuste de la páxina
page_scale_auto=Tamañu automáticu
page_scale_actual=Tamañu actual
# LOCALIZATION NOTE (page_scale_percent): "{{scale}}" will be replaced by a
# numerical scale value.
page_scale_percent={{scale}}%
# Loading indicator messages
loading_error_indicator=Fallu
loading_error=Hebo un fallu al cargar el PDF.
invalid_file_error=Ficheru PDF inválidu o corruptu.
missing_file_error=Nun hai ficheru PDF.
unexpected_response_error=Rempuesta inesperada del sirvidor.
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 – Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type.alt=[Anotación {{type}}]
password_label=Introduz la contraseña p'abrir esti ficheru PDF
password_invalid=Contraseña non válida. Vuelvi a intentalo.
password_ok=Aceutar
password_cancel=Encaboxar
printing_not_supported=Alvertencia: La imprentación entá nun ta sofitada dafechu nesti restolador.
printing_not_ready=Avisu: Esti PDF nun se cargó completamente pa poder imprentase.
web_fonts_disabled=Les fontes web tán desactivaes: ye imposible usar les fontes PDF embebíes.
document_colors_not_allowed=Los documentos PDF nun tienen permisu pa usar les sos colores: «Permitir que les páxines escueyan les sos colores» ta desactivao nel restolador.
|
{
"pile_set_name": "Github"
}
|
#![allow(unused_imports)]
#![allow(clippy::cognitive_complexity)]
use {
crate::{
config::{Axis, Key, KeyAction, KeyEffect, CONFIG},
layout::LayoutTag,
models::{rect::*, window_type::WindowType, windowwrapper::*, Direction, WindowState},
state::State,
wm,
xlibwrapper::action,
xlibwrapper::core::*,
xlibwrapper::masks::*,
xlibwrapper::util::keysym_lookup::*,
xlibwrapper::util::*,
xlibwrapper::xlibmodels::*,
},
notify_rust::{Notification, Timeout},
reducer::*,
std::cell::RefCell,
std::process::Command,
std::rc::Rc,
};
impl Reducer<action::KeyPress> for State {
fn reduce(&mut self, action: action::KeyPress) {
let has_mod = action.state & !CONFIG.mod_key != 0;
let mod_is_pressed = action.state & CONFIG.mod_key == CONFIG.mod_key;
let sym = self
.lib
.keycode_to_key_sym(action.keycode as u8)
.expect("failed to convert action.keycode to KeySym");
//debug!("KeyCode to string: {:?}", into_hdl_keysym(&sym));
// Valid key presses must either include mod_key or be one of the XF86 symbols.
if !mod_is_pressed && !sym.starts_with("XF86") {
return;
}
let ws_keys: Vec<u8> = (1..=9)
.map(|x| {
self.lib
.str_to_keycode(&x.to_string())
.expect("key_press 1")
})
.collect();
let mon = match self.monitors.get_mut(&self.current_monitor) {
Some(mon) => mon,
None => {
warn!("No such monitor: {}", self.current_monitor);
return;
}
};
match mon.get_client(self.focus_w) {
Some(_) => {
debug!("managed client");
managed_client(self, action, has_mod, ws_keys);
}
None if action.win == self.lib.get_root() => {
root(self, action, has_mod, ws_keys);
}
None => {}
}
}
}
fn handle_key_effect(
state: &mut State,
action: &action::KeyPress,
effect: &KeyEffect,
ws_keys: &[u8],
) -> Option<()> {
let keycode = action.keycode as u8;
match effect {
KeyEffect::Kill => {
let ww = state
.monitors
.get_mut(&state.current_monitor)?
.get_client_mut(state.focus_w)?;
ww.set_window_state(WindowState::Destroy);
debug!("destroy window");
}
KeyEffect::OpenTerm => {
spawn_process(CONFIG.term.as_str(), vec![]);
}
KeyEffect::Resize(delta, axis) => {
wm::resize_window(state, state.focus_w, axis, *delta);
}
KeyEffect::Exit => state.lib.exit(),
KeyEffect::ToggleMonocle => {
let mon = state
.monitors
.get_mut(&state.current_monitor)
.expect("ToggleMonocle get_mut monitor");
mon.swap_window(state.focus_w, |mon, ww| wm::toggle_monocle(mon, ww));
}
KeyEffect::ToggleMaximize => {
let mon = state
.monitors
.get_mut(&state.current_monitor)
.expect("ToggleMonocle get_mut monitor");
mon.swap_window(state.focus_w, |mon, ww| wm::toggle_maximize(mon, ww));
}
KeyEffect::CirculateLayout => {
//debug!("should print layout type");
cycle_layout(state);
wm::reorder(state);
}
KeyEffect::ShiftWindow(direction) => {
let ww = state
.monitors
.get_mut(&state.current_monitor)?
.get_client(state.focus_w)?;
match (ww.current_state, direction) {
(WindowState::Snapped(Direction::North), Direction::East) => {
shift_window(state, Direction::NorthEast);
}
(WindowState::Snapped(Direction::North), Direction::West) => {
shift_window(state, Direction::NorthWest);
}
(WindowState::Snapped(Direction::NorthEast), Direction::West) => {
shift_window(state, Direction::North);
}
(WindowState::Snapped(Direction::NorthEast), Direction::South) => {
shift_window(state, Direction::East);
}
(WindowState::Snapped(Direction::East), Direction::North) => {
shift_window(state, Direction::NorthEast);
}
(WindowState::Snapped(Direction::East), Direction::South) => {
shift_window(state, Direction::SouthEast);
}
(WindowState::Snapped(Direction::SouthEast), Direction::North) => {
shift_window(state, Direction::East);
}
(WindowState::Snapped(Direction::SouthEast), Direction::West) => {
shift_window(state, Direction::South);
}
(WindowState::Snapped(Direction::South), Direction::West) => {
shift_window(state, Direction::SouthWest);
}
(WindowState::Snapped(Direction::South), Direction::East) => {
shift_window(state, Direction::SouthEast);
}
(WindowState::Snapped(Direction::SouthWest), Direction::East) => {
shift_window(state, Direction::South);
}
(WindowState::Snapped(Direction::SouthWest), Direction::North) => {
shift_window(state, Direction::West);
}
(WindowState::Snapped(Direction::West), Direction::North) => {
shift_window(state, Direction::NorthWest);
}
(WindowState::Snapped(Direction::West), Direction::South) => {
shift_window(state, Direction::SouthWest);
}
(WindowState::Snapped(Direction::NorthWest), Direction::East) => {
shift_window(state, Direction::North);
}
(WindowState::Snapped(Direction::NorthWest), Direction::South) => {
shift_window(state, Direction::West);
}
_ => {
shift_window(state, *direction);
}
}
}
KeyEffect::ChangeCurrentWorkspace => {
if ws_keys.contains(&keycode) {
let ws_num = keycode_to_ws(keycode);
wm::set_current_ws(state, ws_num);
state.mouse_follow.replace(true);
}
}
KeyEffect::MoveToWorkspace => {
if ws_keys.contains(&keycode) {
let ws_num = keycode_to_ws(keycode);
wm::move_to_ws(state, state.focus_w, ws_num);
if state
.monitors
.get(&state.current_monitor)?
.get_current_layout()
!= LayoutTag::Floating
{
wm::reorder(state);
}
wm::set_current_ws(state, ws_num)?;
if state
.monitors
.get(&state.current_monitor)?
.get_current_layout()
!= LayoutTag::Floating
{
wm::reorder(state);
}
state.mouse_follow.replace(true);
}
}
KeyEffect::SwapMaster => {
swap_master(state);
}
KeyEffect::Center => {
let mon = state.monitors.get_mut(&state.current_monitor)?;
if mon.get_current_layout() != LayoutTag::Floating {
return Some(());
}
let windows = mon.place_window(state.focus_w);
for (win, rect) in windows.into_iter() {
mon.swap_window(win, |_, ww| WindowWrapper {
window_rect: rect,
previous_state: ww.current_state,
current_state: WindowState::Free,
..ww
});
}
}
KeyEffect::Reorder => {
let current_layout = state
.monitors
.get(&state.current_monitor)?
.get_current_layout();
if current_layout == LayoutTag::Floating {
wm::reorder(state);
}
}
KeyEffect::Custom(command) => {
spawn_process(&command.program, command.args.clone());
}
_ => (),
}
Some(())
}
fn managed_client(
state: &mut State,
action: action::KeyPress,
has_mod: bool,
ws_keys: Vec<u8>,
) -> Option<()> {
//debug!("Windows exists: KeyPress");
let keycode = action.keycode as u8;
for key_action in CONFIG.key_bindings.iter() {
match key_action {
KeyAction {
mod_key: Some(mk),
key: Key::Letter(key),
effect,
} if has_mod => {
if into_mod(mk) == (action.state & into_mod(mk))
&& state.lib.str_to_keycode(key) == Some(action.keycode as u8)
{
//debug!("Effect: {:?}", effect);
if handle_key_effect(state, &action, effect, &ws_keys).is_none() {
debug!("Something went wrong calling handle_key_effect in root");
}
}
}
KeyAction {
mod_key: None,
key: Key::Letter(key),
effect,
} if !has_mod => {
if state.lib.str_to_keycode(key) == Some(action.keycode as u8) {
//debug!("Effect: {:?}", effect);
if handle_key_effect(state, &action, effect, &ws_keys).is_none() {
debug!("Something went wrong calling handle_key_effect in root");
}
}
}
KeyAction {
mod_key: Some(mk),
key: Key::Number,
effect,
} if has_mod && ws_keys.contains(&keycode) => {
if into_mod(mk) == (action.state & into_mod(mk)) {
//debug!("Effect: {:?}", effect);
if handle_key_effect(state, &action, effect, &ws_keys).is_none() {
debug!("Something went wrong calling handle_key_effect in root");
}
}
}
KeyAction {
mod_key: None,
key: Key::Number,
effect,
} if !has_mod && ws_keys.contains(&keycode) => {
//debug!("Effect: {:?}", effect);
if handle_key_effect(state, &action, effect, &ws_keys).is_none() {
debug!("Something went wrong calling handle_key_effect in root");
}
}
_ => {} //debug!("nope"),
}
}
Some(())
}
fn root(
state: &mut State,
action: action::KeyPress,
has_mod: bool,
ws_keys: Vec<u8>,
) -> Option<()> {
let keycode = action.keycode as u8;
for key_action in CONFIG.key_bindings.iter() {
match key_action {
KeyAction {
mod_key: Some(mk),
key: Key::Letter(key),
effect,
} if has_mod => {
if into_mod(mk) == (action.state & into_mod(mk))
&& state.lib.str_to_keycode(key) == Some(action.keycode as u8)
{
debug!("Effect: {:?}", effect);
if handle_key_effect(state, &action, effect, &ws_keys).is_none() {
debug!("Something went wrong calling handle_key_effect in root");
}
}
}
KeyAction {
mod_key: None,
key: Key::Letter(key),
effect,
} if !has_mod => {
if state.lib.str_to_keycode(key) == Some(action.keycode as u8) {
debug!("Effect: {:?}", effect);
if handle_key_effect(state, &action, effect, &ws_keys).is_none() {
debug!("Something went wrong calling handle_key_effect in root");
}
}
}
KeyAction {
mod_key: None,
key: Key::Number,
effect,
} if !has_mod && ws_keys.contains(&keycode) => {
debug!("Effect: {:?}", effect);
if handle_key_effect(state, &action, effect, &ws_keys).is_none() {
debug!("Something went wrong calling handle_key_effect in root");
}
}
_ => debug!("nope"),
}
}
Some(())
}
fn shift_window(state: &mut State, direction: Direction) -> Option<()> {
debug!(
"state focus_w: 0x{:x}, root: 0x{:x}",
state.focus_w,
state.lib.get_root()
);
let mon = state.monitors.get_mut(&state.current_monitor)?;
let previous = mon.get_previous(state.focus_w).map(|ww| ww.window());
let next = mon.get_next(state.focus_w).map(|ww| ww.window());
let current_layout = mon.get_current_layout();
if current_layout != LayoutTag::Floating {
let newest = mon.get_newest().map(|(win, _)| *win)?;
let current_ws = mon.get_current_ws_mut()?;
let ws_focus = current_ws.focus_w;
if ws_focus != newest {
match direction {
Direction::North => {
if let Some(win) = previous {
current_ws.focus_w = win;
state.focus_w = win;
}
}
Direction::South => {
if let Some(win) = next {
current_ws.focus_w = win;
state.focus_w = win;
}
}
Direction::West => {
current_ws.focus_w = newest;
state.focus_w = newest;
}
_ => (),
}
}
if state.focus_w == newest && direction == Direction::East {
if let Some(win) = next {
current_ws.focus_w = win;
state.focus_w = win;
}
} else if state.focus_w == newest && direction != Direction::East {
debug!("window is newest but direction is: {:?}", direction);
}
return Some(());
}
if state.focus_w == state.lib.get_root() {
return Some(());
}
let windows = mon.shift_window(state.focus_w, direction);
for win in windows.into_iter() {
mon.swap_window(win.window(), |_, ww| WindowWrapper {
previous_state: ww.current_state,
current_state: WindowState::Snapped(direction),
..win
});
}
Some(())
}
fn swap_master(state: &mut State) -> Option<()> {
debug!("Swap master");
let mon = state.monitors.get_mut(&state.current_monitor)?;
let newest = mon.get_newest()?;
let (win, client) = (*newest.0, newest.1.clone());
if win != state.focus_w {
let client_toc = client.toc;
let mut tmp_toc = std::time::Instant::now();
mon.swap_window(state.focus_w, |_mon, ww| WindowWrapper {
toc: {
tmp_toc = ww.toc;
client_toc
},
..ww
})?;
mon.swap_window(win, |_mon, ww| WindowWrapper { toc: tmp_toc, ..ww })?;
wm::reorder(state);
}
Some(())
}
fn cycle_layout(state: &mut State) -> Option<()> {
let mon = state.monitors.get_mut(&state.current_monitor)?;
let ws = mon.get_current_ws_mut()?;
ws.cycle_layout();
let notify_res = Notification::new()
.summary("Layout switched")
.body(&format!("New layout: {}", ws.layout))
.icon("firefox")
.timeout(Timeout::Milliseconds(1500))
.show();
match notify_res {
Ok(_) => Some(()),
Err(e) => {
warn!("Error showing notification: {}", e);
Some(())
}
}
}
fn keycode_to_ws(keycode: u8) -> u32 {
((keycode - 10) % 10) as u32
}
fn spawn_process(bin_name: &str, args: Vec<String>) {
let mut cmd = Command::new(bin_name);
args.into_iter().for_each(|arg| {
cmd.arg(arg);
});
let _ = cmd.spawn();
}
|
{
"pile_set_name": "Github"
}
|
// Utilities
//––––––––––––––––––––––––––––––––––––––––––––––––––
.u-full-width {
width: 100%;
box-sizing: border-box;
}
.u-max-full-width {
max-width: 100%;
box-sizing: border-box;
}
.u-pull-right {
float: right;
}
.u-pull-left {
float: left;
}
|
{
"pile_set_name": "Github"
}
|
{
"id": "brown-shanty-wall",
"name": "Brown Shanty Wall",
"games": {
"nh": {
"orderable": true,
"sources": [
"Nook's Cranny"
],
"sellPrice": {
"currency": "bells",
"value": 155
},
"buyPrices": [
{
"currency": "bells",
"value": 620
}
]
}
},
"category": "Wallpaper"
}
|
{
"pile_set_name": "Github"
}
|
# e2e tests
## Create new test case
To create new test case you need to create new folder in [test-cases](./test-cases) (as a sample you may use [test-case-sample](./test-case-sample) folder).
New folder's name will be used as name of test case.
Each test case must have at least 3 files:
1. `input.ts` or `input.d.ts` - the entry point of test case (this file will used to generate typings).
1. `output.d.ts` - file with expected output - it will be used to compare with just generated (actual) typings.
1. `config.ts` - file with test case config (e.g. generator options). It must export test case config (see [test-case-config.ts](./test-cases/test-case-config.ts) for type) via `export =`.
## Run tests
```bash
# the command should be run in project root
npm run test
```
|
{
"pile_set_name": "Github"
}
|
---
http_interactions:
- request:
method: get
uri: http://ps.pndsn.com/publish/pub-a-mock-key/sub-a-mock-key/0/demo/0/%22string%22?auth=ruby-test-auth-client-one&ortt=%7B%22t%22:14660947135183042%7D&pnsdk=PubNub-Ruby/4.1.0beta2&seqn=1&uuid=ruby-test-uuid-client-one
body:
encoding: UTF-8
string: ''
headers:
User-Agent:
- HTTPClient/1.0 (2.8.0, ruby 2.3.0 (2015-12-25))
Accept:
- "*/*"
Date:
- Thu, 16 Jun 2016 16:31:53 GMT
response:
status:
code: 200
message: OK
headers:
Date:
- Thu, 16 Jun 2016 16:31:53 GMT
Content-Type:
- text/javascript; charset="UTF-8"
Content-Length:
- '30'
Connection:
- keep-alive
Cache-Control:
- no-cache
Access-Control-Allow-Origin:
- "*"
Access-Control-Allow-Methods:
- GET
body:
encoding: UTF-8
string: '[1,"Sent","14660947136181298"]'
http_version:
recorded_at: Thu, 16 Jun 2016 16:31:53 GMT
recorded_with: VCR 3.0.1
|
{
"pile_set_name": "Github"
}
|
// ISOTOPE GRID
var IsotopeGrid = function() {
var _init = function() {
// BEGIN: ISOTOPE GALLERY 1 INIT
// init isotope gallery
var $grid1 = $('.c-content-isotope-grid.c-opt-1').imagesLoaded( function() {
// init Isotope after all images have loaded
$grid1.isotope({
// options...
itemSelector: '.c-content-isotope-item',
layoutMode: 'packery',
fitWidth: true,
percentPosition: true,
});
});
// END: ISOTOPE GALLERY 1
// BEGIN: ISOTOPE GALLERY 2 INIT
// init isotope gallery
var $grid2 = $('.c-content-isotope-grid.c-opt-2').imagesLoaded( function() {
// init Isotope after all images have loaded
$grid2.isotope({
// options...
itemSelector: '.c-content-isotope-item',
layoutMode: 'packery',
fitWidth: true,
percentPosition: true,
});
});
// END: ISOTOPE GALLERY 2
// BEGIN: ISOTOPE GALLERY 3 INIT
// init isotope gallery
var $grid3 = $('.c-content-isotope-grid.c-opt-3').imagesLoaded( function() {
// init Isotope after all images have loaded
$grid3.isotope({
// options...
itemSelector: '.c-content-isotope-item',
layoutMode: 'packery',
fitWidth: true,
percentPosition: true,
});
});
// END: ISOTOPE GALLERY 3
}
return {
//main function to initiate the module
init: function() {
_init();
}
};
}();
$(document).ready(function() {
IsotopeGrid.init();
});
|
{
"pile_set_name": "Github"
}
|
--requirement=requirements-checks.txt
--requirement=requirements-tests.txt
--requirement=requirements.txt
coveralls
|
{
"pile_set_name": "Github"
}
|
function res = vl_srmd_concise(net, x)
global degpar;
n = numel(net.layers);
res = struct('x', cell(1,n+1));
res(1).x = x ;
cudnn = {'CuDNN'} ;
%cudnn = {'NoCuDNN'} ;
for i=1:n
l = net.layers{i} ;
switch l.type
case 'conv'
res(i+1).x = vl_nnconv(res(i).x, l.weights{1}, l.weights{2}, ...
'pad', l.pad, ...
'stride', l.stride, ...
'dilate', l.dilate, ...
l.opts{:}, ...
cudnn{:}) ;
case 'concat'
if size(degpar,1)~=size(res(i).x,1)
sigmaMap = bsxfun(@times,ones(size(res(i).x,1),size(res(i).x,2),1,size(res(i).x,4),'single'),permute(degpar,[3 4 1 2]));
res(i+1).x = cat(3,res(i).x,sigmaMap);
else
res(i+1).x = cat(3,res(i).x,sigmaMap);
end
case 'SubP'
res(i+1).x = vl_nnSubP(res(i).x, [],'scale',l.scale);
case 'relu'
res(i+1).x = max(res(i).x,0) ;
end
res(i).x = [] ;
end
|
{
"pile_set_name": "Github"
}
|
# DescribeSecurityGroupAttribute {#DescribeSecurityGroupAttribute .reference}
查询安全组详情。
## 请求参数 {#RequestParameter .section}
|名称|类型|是否必需|描述|
|:-|:-|:---|:-|
|Action|String|是|系统规定参数。取值:DescribeSecurityGroupAttribute|
|RegionId|String|是|安全组所属地域 ID。您可以调用 [DescribeRegions](intl.zh-CN/API参考/地域/DescribeRegions.md#) 查看最新的阿里云地域列表。|
|SecurityGroupId|String|是|安全组 ID。|
|NicType|String|否|网卡类型。取值范围:- internet:公网
- intranet:内网
默认值:internet|
|Direction|String|否|安全组规则授权方向。取值范围:- egress:安全组出方向
- ingress:安全组入方向
- all:不区分方向
默认值:all|
## 返回参数 {#ResponseParameter .section}
|名称|类型|描述|
|:-|:-|:-|
|SecurityGroupId|String|目标安全组 ID|
|SecurityGroupName|String|目标安全组名称|
|RegionId|String|地域 ID|
|Description|String|安全组描述信息|
|InnerAccessPolicy|String|安全组内网络连通策略。可能值:- Accept:内网互通
- Drop:内网隔离
|
|Permissions|[PermissionType](intl.zh-CN/API参考/数据类型/PermissionType.md#)|安全组权限规则集合|
|VpcId|String|VPC ID。如果返回 VPC ID,表示该安全组网络类型为 VPC。否则,表示是经典网络类型安全组。|
## 示例 { .section}
**请求示例**
```
https://ecs.aliyuncs.com/?Action=DescribeSecurityGroupAttribute
&RegionId=cn-hangzhou
&SecurityGroupId=sg-F876FF7BA
&<公共请求参数>
```
**返回示例**
**XML 格式**
```
<DescribeSecurityGroupAttributeResponse>
<RequestId>1651FBB6-4FBF-49FF-A9F5-DF5D696C7EC6</RequestId>
<RegionId>cn-hangzhou</RegionId>
<SecurityGroupId>C0003E8B-B930-4F59-ADC0-0E209A9012B0</SecurityGroupId>
<Description>for demo</Description>
<InnerAccessPolicy>Accept</InnerAccessPolicy>
<Permissions>
<Permission>
<IpProtocol>ALL</IpProtocol>
<PortRange>-1/-1</PortRange>
<SourceGroupId>8dsmf982</SourceGroupId>
<SourceGroupOwnerAccount>test@aliyun.com</SourceGroupOwnerAccount>
<Policy>Accept</Policy>
<NicType>intranet</NicType>
</Permission>
<Permission>
<IpProtocol>tcp</IpProtocol>
<PortRange>1/65535</PortRange>
<SourceCidrIp>0.0.0.0/0</SourceCidrIp>
<Policy>accept</Policy>
<NicType>internet</NicType>
</Permission>
</Permissions>
</DescribeSecurityGroupAttributeResponse>
```
**JSON 格式**
```
{
"RequestId": "1651FBB6-4FBF-49FF-A9F5-DF5D696C7EC6",
"RegionId": "cn-hangzhou",
"SecurityGroupId": "C0003E8B-B930-4F59-ADC0-0E209A9012B0",
"Description": "for demo",
"Permissions": {
"Permission": [{
"IpProtocol": "ALL",
"PortRange": "-1/-1",
"SourceGroupId": "8dsmf982",
"SourceGroupOwnerAccount": "test@aliyun.com"
"Policy": "Accept",
"NicType": "intranet"
},
{
"IpProtocol": "tcp",
"PortRange": "1/65535",
"SourceCidrIp": "0.0.0.0/0",
"Policy": "accept",
"NicType": "internet"
}]
}
}
```
## 错误码 {#ErrorCode .section}
以下为本接口特有的错误码。更多错误码,请访问 [API 错误中心](https://error-center.alibabacloud.com/status/product/Ecs)。
|错误代码|错误信息|HTTP 状态码|说明|
|:---|:---|:-------|:-|
|InvalidNicType.ValueNotSupported|The specified NicType does not exist.|400|指定的 `NicType` 不存在。|
|InvalidRegionId.NotFound|The specified RegionId does not exist.|404|指定的 `RegionId` 不存在。|
|InvalidSecurityGroupId.NotFound|The specified SecurityGroupId does not exist.|404|指定的 `SecurityGroupId` 不存在。|
|
{
"pile_set_name": "Github"
}
|
[D3.js in Action 2nd Edition](https://www.manning.com/books/d3js-in-action-second-edition) code and examples.
[d3.js](https://d3js.org)
Everything is a self-contained example except for Chapter 9, which requires Node and NPM.
Table of Contents
Chapter 1
* [1_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_11.html)
* [1_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_16.html)
* [1_17.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_17.html)
* [1_20.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_20.html)
* [1_21.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_21.html)
* [1_22.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_22.html)
* [1_25.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_25.html)
* [1_31.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_31.html)
* [1_32.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_32.html)
* [1_33.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_33.html)
* [1_34.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter1/1_34.html)
Chapter 2
* [2_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_11.html)
* [2_12.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_12.html)
* [2_13.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_13.html)
* [2_14.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_14.html)
* [2_15.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_15.html)
* [2_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_16.html)
* [2_17.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_17.html)
* [2_18.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_18.html)
* [2_19.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_19.html)
* [2_20.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_20.html)
* [2_21.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_21.html)
* [2_22.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_22.html)
* [2_23.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_23.html)
* [2_25.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_25.html)
* [2_27.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter2/2_27.html)
Chapter 3
* [3_2.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_2.html)
* [3_3.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_3.html)
* [3_5.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_5.html)
* [3_6.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_6.html)
* [3_9.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_9.html)
* [3_10.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_10.html)
* [3_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_11.html)
* [3_12.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_12.html)
* [3_13.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_13.html)
* [3_14.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_14.html)
* [3_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_15.html)
* [3_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_16.html)
* [3_17.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_17.html)
* [3_18.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_18.html)
* [3_19.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_19.html)
* [3_20.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_20.html)
* [3_21.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_21.html)
* [3_22.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_22.html)
* [3_23.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_23.html)
* [3_24.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter3/3_24.html)
Chapter 4
* [4_3.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_3.html)
* [4_4.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_4.html)
* [4_5.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_5.html)
* [4_7.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_7.html)
* [4_8.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_8.html)
* [4_9.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_9.html)
* [4_12.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_12.html)
* [4_13.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_13.html)
* [4_14.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_14.html)
* [4_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_16.html)
* [4_17.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_17.html)
* [4_18.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_18.html)
* [4_19.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_19.html)
* [4_20.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_20.html)
* [4_22.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_22.html)
* [4_23.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_23.html)
* [4_24.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_24.html)
* [4_25.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter4/4_25.html)
Chapter 5
* [5_2.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_2.html)
* [5_4.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_4.html)
* [5_5.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_5.html)
* [5_6.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_6.html)
* [5_7.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_7.html)
* [5_8_tween.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_8_tween.html)
* [5_9.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_9.html)
* [5_10.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_10.html)
* [5_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_11.html)
* [5_24.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_24.html)
* [5_25.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_25.html)
* [5_26.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_26.html)
* [5_28.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_28.html)
* [5_29.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_29.html)
* [5_30.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter5/5_30.html)
Chapter 6
* [6_10.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_10.html)
* [6_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_11.html)
* [6_12.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_12.html)
* [6_14.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_14.html)
* [6_15.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_15.html)
* [6_16_zoom.html](chapter6/6_16_zoom.html)
* [6_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_16.html)
* [6_17.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_17.html)
* [6_20.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_20.html)
* [6_21.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_21.html)
* [6_22.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_22.html)
* [6_23.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_23.html)
* [6_24.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter6/6_24.html)
Chapter 7
* [7_3.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_3.html)
* [7_4.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_4.html)
* [7_5.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_5.html)
* [7_6.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_6.html)
* [7_7.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_7.html)
* [7_8.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_8.html)
* [7_9.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_9.html)
* [7_10.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_10.html)
* [7_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_11.html)
* [7_13.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_13.html)
* [7_14.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_14.html)
* [7_15.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_15.html)
* [7_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_16.html)
* [7_17.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_17.html)
* [7_18.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_18.html)
* [7_19.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter7/7_19.html)
Chapter 8
* [8_3.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_3.html)
* [8_4.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_4.html)
* [8_5.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_5.html)
* [8_6.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_6.html)
* [8_7.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_7.html)
* [8_8.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_8.html)
* [8_9.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_9.html)
* [8_10.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_10.html)
* [8_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_11.html)
* [8_12.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_12.html)
* [8_13.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_13.html)
* [8_14.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_14.html)
* [8_15.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_15.html)
* [8_16.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter8/8_16.html)
[Chapter 9](chapter9)
Chapter 10
* [10_1.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_1.html)
* [10_2.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_2.html)
* [10_3.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_3.html)
* [10_4.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_4.html)
* [10_5.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_5.html)
* [10_6.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_6.html)
* [10_7.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_7.html)
* [10_8.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_8.html)
* [10_9.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_9.html)
* [10_10.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_10.html)
* [10_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_11.html)
* [10_12.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter10/10_12.html)
Chapter 11
* [11_2.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_2.html)
* [11_4.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_4.html)
* [11_5.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_5.html)
* [11_6.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_6.html)
* [11_7.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_7.html)
* [11_8.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_8.html)
* [11_9.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_9.html)
* [11_10.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_10.html)
* [11_11.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_11.html)
* [11_12.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_12.html)
* [11_13.html](https://github.com/kthotav/d3_in_action_2/tree/master/chapter11/11_13.html)
|
{
"pile_set_name": "Github"
}
|
<refentry xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:src="http://nwalsh.com/xmlns/litprog/fragment"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="5.0" xml:id="orderedlist.label.properties">
<refmeta>
<refentrytitle>orderedlist.label.properties</refentrytitle>
<refmiscinfo class="other" otherclass="datatype">attribute set</refmiscinfo>
</refmeta>
<refnamediv>
<refname>orderedlist.label.properties</refname>
<refpurpose>Properties that apply to each label inside ordered list.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<src:fragment xml:id="orderedlist.label.properties.frag"><xsl:attribute-set name="orderedlist.label.properties">
</xsl:attribute-set></src:fragment>
</refsynopsisdiv>
<refsection><info><title>Description</title></info>
<para>Properties that apply to each label inside ordered list. E.g.:</para>
<programlisting><xsl:attribute-set name="orderedlist.label.properties">
<xsl:attribute name="text-align">right</xsl:attribute>
</xsl:attribute-set></programlisting>
</refsection>
</refentry>
|
{
"pile_set_name": "Github"
}
|
# HAR Schema [![version][npm-version]][npm-url] [![License][npm-license]][license-url]
> JSON Schema for HTTP Archive ([HAR][spec]).
[![Build Status][travis-image]][travis-url]
[![Downloads][npm-downloads]][npm-url]
[![Code Climate][codeclimate-quality]][codeclimate-url]
[![Coverage Status][codeclimate-coverage]][codeclimate-url]
[![Dependency Status][dependencyci-image]][dependencyci-url]
[![Dependencies][david-image]][david-url]
## Install
```bash
npm install --only=production --save har-schema
```
## Usage
Compatible with any [JSON Schema validation tool][validator].
----
> :copyright: [ahmadnassri.com](https://www.ahmadnassri.com/) ·
> License: [ISC][license-url] ·
> Github: [@ahmadnassri](https://github.com/ahmadnassri) ·
> Twitter: [@ahmadnassri](https://twitter.com/ahmadnassri)
[license-url]: http://choosealicense.com/licenses/isc/
[travis-url]: https://travis-ci.org/ahmadnassri/har-schema
[travis-image]: https://img.shields.io/travis/ahmadnassri/har-schema.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/har-schema
[npm-license]: https://img.shields.io/npm/l/har-schema.svg?style=flat-square
[npm-version]: https://img.shields.io/npm/v/har-schema.svg?style=flat-square
[npm-downloads]: https://img.shields.io/npm/dm/har-schema.svg?style=flat-square
[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-schema
[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-schema.svg?style=flat-square
[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-schema.svg?style=flat-square
[david-url]: https://david-dm.org/ahmadnassri/har-schema
[david-image]: https://img.shields.io/david/ahmadnassri/har-schema.svg?style=flat-square
[dependencyci-url]: https://dependencyci.com/github/ahmadnassri/har-schema
[dependencyci-image]: https://dependencyci.com/github/ahmadnassri/har-schema/badge?style=flat-square
[spec]: https://github.com/ahmadnassri/har-spec/blob/master/versions/1.2.md
[validator]: https://github.com/ahmadnassri/har-validator
|
{
"pile_set_name": "Github"
}
|
[
{
"id": 181987935,
"name": "CVE-2018-18500",
"full_name": "sophoslabs\/CVE-2018-18500",
"owner": {
"login": "sophoslabs",
"id": 40878494,
"avatar_url": "https:\/\/avatars0.githubusercontent.com\/u\/40878494?v=4",
"html_url": "https:\/\/github.com\/sophoslabs"
},
"html_url": "https:\/\/github.com\/sophoslabs\/CVE-2018-18500",
"description": "PoC for CVE-2018-18500 - Firefox Use-After-Free",
"fork": false,
"created_at": "2019-04-18T00:26:10Z",
"updated_at": "2020-06-08T09:20:09Z",
"pushed_at": "2019-04-18T20:32:46Z",
"stargazers_count": 57,
"watchers_count": 57,
"forks_count": 15,
"forks": 15,
"watchers": 57,
"score": 0
}
]
|
{
"pile_set_name": "Github"
}
|
// common functions used by datahub
package alicloud
import (
"strings"
"time"
"github.com/aliyun/aliyun-datahub-sdk-go/datahub"
)
func convUint64ToDate(t uint64) string {
return time.Unix(int64(t), 0).Format("2006-01-02 15:04:05")
}
func getNow() string {
return time.Now().Format("2006-01-02 15:04:05")
}
func getRecordSchema(typeMap map[string]interface{}) (recordSchema *datahub.RecordSchema) {
recordSchema = datahub.NewRecordSchema()
for k, v := range typeMap {
recordSchema.AddField(datahub.Field{Name: string(k), Type: datahub.FieldType(v.(string))})
}
return recordSchema
}
func isRetryableDatahubError(err error) bool {
if e, ok := err.(datahub.DatahubError); ok && e.StatusCode >= 500 {
return true
}
return false
}
// It is proactive defense to the case that SDK extends new datahub objects.
const (
DoesNotExist = "does not exist"
)
func isDatahubNotExistError(err error) bool {
return IsExceptedErrors(err, []string{datahub.NoSuchProject, datahub.NoSuchTopic, datahub.NoSuchShard, datahub.NoSuchSubscription, DoesNotExist})
}
func isTerraformTestingDatahubObject(name string) bool {
prefixes := []string{
"tf_testAcc",
"tf_test_",
"testAcc",
}
for _, prefix := range prefixes {
if strings.HasPrefix(strings.ToLower(name), strings.ToLower(prefix)) {
return true
}
}
return false
}
func getDefaultRecordSchemainMap() map[string]interface{} {
return map[string]interface{}{
"string_field": "STRING",
}
}
|
{
"pile_set_name": "Github"
}
|
[class*='col-'] {
float: left;
}
*, *:after, *:before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
h3 {
text-align: center; margin-bottom: 0;
}
[class*='col-'] {
padding-right: 20px;
padding-bottom: 20px;
}
[class*='col-']:last-of-type {
padding-right: 0;
}
.grid {
margin: 0;
}
.col-1-4 {
width: 25%;
}
.module {
padding: 20px;
text-align: center;
color: #eee;
max-height: 120px;
min-width: 120px;
background-color: #607D8B;
border-radius: 2px;
}
h4 {
position: relative;
}
.module:hover {
background-color: #EEE;
cursor: pointer;
color: #607d8b;
}
.grid-pad {
padding: 10px 0;
}
.grid-pad > [class*='col-']:last-of-type {
padding-right: 20px;
}
@media (max-width: 600px) {
.module {
font-size: 10px;
max-height: 75px; }
}
@media (max-width: 1024px) {
.grid {
margin: 0;
}
.module {
min-width: 60px;
}
}
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
#block1, #block2 {
height: 20px;
background-color: green;
}
#block1 {
margin-bottom: 10px;
}
#block2 {
margin-top: 10px;
}
#table {
display: table;
}
#caption {
display: table-caption;
caption-side: top;
height: 20px;
margin: 20px 0;
background-color: blue;
}
#cell {
display: table-cell;
width: 100px;
height: 20px;
background-color: orange;
}
</style>
</head>
<body>
<div id="block1"></div>
<div id="table">
<div id="caption"></div>
<div id="cell"></div>
</div>
<div id="block2"></div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// 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)
//
// Preprocessed version of "boost/mpl/bitand.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl {
template<
typename Tag1
, typename Tag2
>
struct bitand_impl
: if_c<
( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
> BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
)
, aux::cast2nd_impl< bitand_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< bitand_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct bitand_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct bitand_impl< na,integral_c_tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct bitand_impl< integral_c_tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
BOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct bitand_tag
{
typedef typename T::tag type;
};
/// forward declaration
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct bitand_2;
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
, typename N3 = na, typename N4 = na, typename N5 = na
>
struct bitand_
: if_<
is_na<N3>
, bitand_2< N1,N2 >
, bitand_<
bitand_2< N1,N2 >
, N3, N4, N5
>
>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, bitand_
, ( N1, N2, N3, N4, N5 )
)
};
template<
typename N1
, typename N2
>
struct bitand_2
: bitand_impl<
typename bitand_tag<N1>::type
, typename bitand_tag<N2>::type
>::template apply< N1,N2 >::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, bitand_2, (N1, N2))
};
BOOST_MPL_AUX_NA_SPEC2(2, 5, bitand_)
}}
namespace boost { namespace mpl {
template<>
struct bitand_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
: integral_c<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
& BOOST_MPL_AUX_VALUE_WKND(N2)::value
)
>
{
};
};
}}
|
{
"pile_set_name": "Github"
}
|
<!-- BEGIN: main -->
<ul class="menu">
<!-- BEGIN: footer_menu -->
<li>
<a href="{FOOTER_MENU.link}">{FOOTER_MENU.title}</a>
</li>
<!-- END: footer_menu -->
</ul>
<!-- END: main -->
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. -->
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Patch
Id="CE9141E2-E628-4327-ACF7-72EF69860FA7"
AllowRemoval="yes"
Manufacturer="Microsoft"
MinorUpdateTargetRTM="yes"
MoreInfoURL="http://www.microsoft.com/"
DisplayName="Minor Upgrade Patch"
Description="Minor Upgrade Patch for Testing Purposes"
Classification="Service Pack"
>
<Media Id="100" Cabinet="patch.cab" Source="?">
<PatchBaseline Id="rtm" />
</Media>
<PatchFamily Id='MyPatchFamily' Version='1.0.0.0' Supersede='yes'>
<CustomActionRef Id="CustomAction1"/>
</PatchFamily>
</Patch>
</Wix>
|
{
"pile_set_name": "Github"
}
|
--[[ SimpleScheduler ]]--
ROT=require 'src.rot'
function love.load()
f=ROT.Display(80, 24)
s=ROT.Scheduler.Simple:new()
for i=1,3 do s:add(i, true) end
end
function love.update()
love.timer.sleep(.5)
f:writeCenter('TURN: '..s:next())
end
function love.draw() f:draw() end
--]]
|
{
"pile_set_name": "Github"
}
|
// -*- mode: c++ -*-
h=0.1;
H=1;
Point (1) = {0, 0, 0, H };
Point (2) = {10, 0, 0, H };
Point (3) = {10, 4, 0, H };
Point (4) = {0, 4, 0, H };
Point (10) = {1, 1, 0, h };
Point (11) = {3, 1, 0, h };
Point (12) = {3, 3, 0, h };
Point (13) = {1, 3, 0, h };
Point (20) = {4, 1, 0, h };
Point (21) = {6, 1, 0, h };
Point (22) = {6, 3, 0, h };
Point (23) = {4, 3, 0, h };
Point (30) = {7, 1, 0, h };
Point (31) = {9, 1, 0, h };
Point (32) = {9, 3, 0, h };
Point (33) = {7, 3, 0, h };
Line (101) = {1,2};
Line (102) = {2,3};
Line (103) = {3,4};
Line (104) = {4,1};
Line (110) = {10,11};
Line (111) = {11,12};
Line (112) = {12,13};
Line (113) = {13,10};
Line (120) = {20,21};
Line (121) = {21,22};
Line (122) = {22,23};
Line (123) = {23,20};
Line (130) = {30,31};
Line (131) = {31,32};
Line (132) = {32,33};
Line (133) = {33,30};
Line Loop (201) = {101, 102, 103, 104};
Line Loop (210) = {110, 111, 112, 113};
Line Loop (220) = {120, 121, 122, 123};
Line Loop (230) = {130, 131, 132, 133};
Plane Surface (300) = {201,-210,-220,-230};
Physical Line ("left") = {104};
Physical Line ("right") = {102};
Physical Line ("bottom") = {101};
Physical Line ("top") = {103};
Physical Line ("gamma_holes") = {110,111,112,113, 120,121,122,123, 130,131,132,133};
Physical Surface ("Omega") = {300};
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.maps</key>
<true/>
</dict>
</plist>
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/perl
$file = $ARGV[0];
open(IN,$file) || die print "Failed to open file: $file : $!";
read(IN,$buffer,1);
read(IN,$buffer2,1);
if (ord($buffer) != 0x41 && ord($buffer2) != 0x50) {
print "bad header ". $buffer ." ".$buffer2. "\n";
exit;
}
read(IN,$buffer,1);
if (ord($buffer) != 2) {
print "bad version";
exit;
}
# spare
read(IN,$buffer,1);
$a = 0;
while (read(IN,$buffer,1)) {
$pos = (tell(IN) - 1);
$size = ((ord($buffer) & 63));
read(IN,$buffer,1);
if (ord($buffer) == 0xff) {
printf("end sentinel at %u\n", $pos);
last;
}
printf("%04x: key %u size %d\n ", $pos, ord($buffer), $size + 1);
for ($i = 0; $i <= ($size); $i++) {
read(IN,$buffer,1);
printf(" %02x", ord($buffer));
}
print "\n";
}
close IN;
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* @file
* Defines an entity type.
*/
/**
* Implements hook_entity_info().
*/
function field_test_entity_info() {
// If requested, clear the field cache while this hook is being called. See
// testFieldInfoCache().
if (variable_get('field_test_clear_info_cache_in_hook_entity_info', FALSE)) {
field_info_cache_clear();
}
$bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
$test_entity_modes = array(
'full' => array(
'label' => t('Full object'),
'custom settings' => TRUE,
),
'teaser' => array(
'label' => t('Teaser'),
'custom settings' => TRUE,
),
);
return array(
'test_entity' => array(
'label' => t('Test Entity'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
'revision table' => 'test_entity_revision',
'entity keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
),
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
// This entity type doesn't get form handling for now...
'test_cacheable_entity' => array(
'label' => t('Test Entity, cacheable'),
'fieldable' => TRUE,
'field cache' => TRUE,
'entity keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
),
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
'test_entity_bundle_key' => array(
'label' => t('Test Entity with a bundle key.'),
'base table' => 'test_entity_bundle_key',
'fieldable' => TRUE,
'field cache' => FALSE,
'entity keys' => array(
'id' => 'ftid',
'bundle' => 'fttype',
),
'bundles' => array('bundle1' => array('label' => 'Bundle1'), 'bundle2' => array('label' => 'Bundle2')) + $bundles,
'view modes' => $test_entity_modes,
),
// In this case, the bundle key is not stored in the database.
'test_entity_bundle' => array(
'label' => t('Test Entity with a specified bundle.'),
'base table' => 'test_entity_bundle',
'fieldable' => TRUE,
'controller class' => 'TestEntityBundleController',
'field cache' => FALSE,
'entity keys' => array(
'id' => 'ftid',
'bundle' => 'fttype',
),
'bundles' => array('test_entity_2' => array('label' => 'Test entity 2')) + $bundles,
'view modes' => $test_entity_modes,
),
// @see EntityPropertiesTestCase::testEntityLabel()
'test_entity_no_label' => array(
'label' => t('Test entity without label'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
'entity keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
),
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
'test_entity_label' => array(
'label' => t('Test entity label'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
'entity keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
'label' => 'ftlabel',
),
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
'test_entity_label_callback' => array(
'label' => t('Test entity label callback'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
'label callback' => 'field_test_entity_label_callback',
'entity keys' => array(
'id' => 'ftid',
'revision' => 'ftvid',
'bundle' => 'fttype',
),
'bundles' => $bundles,
'view modes' => $test_entity_modes,
),
);
}
/**
* Implements hook_entity_info_alter().
*/
function field_test_entity_info_alter(&$entity_info) {
// Enable/disable field_test as a translation handler.
foreach (field_test_entity_info_translatable() as $entity_type => $translatable) {
$entity_info[$entity_type]['translation']['field_test'] = $translatable;
}
// Disable locale as a translation handler.
foreach ($entity_info as $entity_type => $info) {
$entity_info[$entity_type]['translation']['locale'] = FALSE;
}
}
/**
* Helper function to enable entity translations.
*/
function field_test_entity_info_translatable($entity_type = NULL, $translatable = NULL) {
drupal_static_reset('field_has_translation_handler');
$stored_value = &drupal_static(__FUNCTION__, array());
if (isset($entity_type)) {
$stored_value[$entity_type] = $translatable;
entity_info_cache_clear();
}
return $stored_value;
}
/**
* Creates a new bundle for test_entity entities.
*
* @param $bundle
* The machine-readable name of the bundle.
* @param $text
* The human-readable name of the bundle. If none is provided, the machine
* name will be used.
*/
function field_test_create_bundle($bundle, $text = NULL) {
$bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
$bundles += array($bundle => array('label' => $text ? $text : $bundle));
variable_set('field_test_bundles', $bundles);
$info = field_test_entity_info();
foreach ($info as $type => $type_info) {
field_attach_create_bundle($type, $bundle);
}
}
/**
* Renames a bundle for test_entity entities.
*
* @param $bundle_old
* The machine-readable name of the bundle to rename.
* @param $bundle_new
* The new machine-readable name of the bundle.
*/
function field_test_rename_bundle($bundle_old, $bundle_new) {
$bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
$bundles[$bundle_new] = $bundles[$bundle_old];
unset($bundles[$bundle_old]);
variable_set('field_test_bundles', $bundles);
$info = field_test_entity_info();
foreach ($info as $type => $type_info) {
field_attach_rename_bundle($type, $bundle_old, $bundle_new);
}
}
/**
* Deletes a bundle for test_entity objects.
*
* @param $bundle
* The machine-readable name of the bundle to delete.
*/
function field_test_delete_bundle($bundle) {
$bundles = variable_get('field_test_bundles', array('test_bundle' => array('label' => 'Test Bundle')));
unset($bundles[$bundle]);
variable_set('field_test_bundles', $bundles);
$info = field_test_entity_info();
foreach ($info as $type => $type_info) {
field_attach_delete_bundle($type, $bundle);
}
}
/**
* Creates a basic test_entity entity.
*/
function field_test_create_stub_entity($id = 1, $vid = 1, $bundle = 'test_bundle', $label = '') {
$entity = new stdClass();
// Only set id and vid properties if they don't come as NULL (creation form).
if (isset($id)) {
$entity->ftid = $id;
}
if (isset($vid)) {
$entity->ftvid = $vid;
}
$entity->fttype = $bundle;
$label = !empty($label) ? $label : $bundle . ' label';
$entity->ftlabel = $label;
return $entity;
}
/**
* Loads a test_entity.
*
* @param $ftid
* The id of the entity to load.
* @param $ftvid
* (Optional) The revision id of the entity to load. If not specified, the
* current revision will be used.
* @return
* The loaded entity.
*/
function field_test_entity_test_load($ftid, $ftvid = NULL) {
// Load basic strucure.
$query = db_select('test_entity', 'fte', array())
->condition('fte.ftid', $ftid);
if ($ftvid) {
$query->join('test_entity_revision', 'fter', 'fte.ftid = fter.ftid');
$query->addField('fte', 'ftid');
$query->addField('fte', 'fttype');
$query->addField('fter', 'ftvid');
$query->condition('fter.ftvid', $ftvid);
}
else {
$query->fields('fte');
}
$entities = $query->execute()->fetchAllAssoc('ftid');
// Attach fields.
if ($ftvid) {
field_attach_load_revision('test_entity', $entities);
}
else {
field_attach_load('test_entity', $entities);
}
return $entities[$ftid];
}
/**
* Saves a test_entity.
*
* A new entity is created if $entity->ftid and $entity->is_new are both empty.
* A new revision is created if $entity->revision is not empty.
*
* @param $entity
* The entity to save.
*/
function field_test_entity_save(&$entity) {
field_attach_presave('test_entity', $entity);
if (!isset($entity->is_new)) {
$entity->is_new = empty($entity->ftid);
}
if (!$entity->is_new && !empty($entity->revision)) {
$entity->old_ftvid = $entity->ftvid;
unset($entity->ftvid);
}
$update_entity = TRUE;
if ($entity->is_new) {
drupal_write_record('test_entity', $entity);
drupal_write_record('test_entity_revision', $entity);
$op = 'insert';
}
else {
drupal_write_record('test_entity', $entity, 'ftid');
if (!empty($entity->revision)) {
drupal_write_record('test_entity_revision', $entity);
}
else {
drupal_write_record('test_entity_revision', $entity, 'ftvid');
$update_entity = FALSE;
}
$op = 'update';
}
if ($update_entity) {
db_update('test_entity')
->fields(array('ftvid' => $entity->ftvid))
->condition('ftid', $entity->ftid)
->execute();
}
// Save fields.
$function = "field_attach_$op";
$function('test_entity', $entity);
}
/**
* Menu callback: displays the 'Add new test_entity' form.
*/
function field_test_entity_add($fttype) {
$fttype = str_replace('-', '_', $fttype);
$entity = (object)array('fttype' => $fttype);
drupal_set_title(t('Create test_entity @bundle', array('@bundle' => $fttype)), PASS_THROUGH);
return drupal_get_form('field_test_entity_form', $entity, TRUE);
}
/**
* Menu callback: displays the 'Edit exiisting test_entity' form.
*/
function field_test_entity_edit($entity) {
drupal_set_title(t('test_entity @ftid revision @ftvid', array('@ftid' => $entity->ftid, '@ftvid' => $entity->ftvid)), PASS_THROUGH);
return drupal_get_form('field_test_entity_form', $entity);
}
/**
* Test_entity form.
*/
function field_test_entity_form($form, &$form_state, $entity, $add = FALSE) {
// During initial form build, add the entity to the form state for use during
// form building and processing. During a rebuild, use what is in the form
// state.
if (!isset($form_state['test_entity'])) {
$form_state['test_entity'] = $entity;
}
else {
$entity = $form_state['test_entity'];
}
foreach (array('ftid', 'ftvid', 'fttype') as $key) {
$form[$key] = array(
'#type' => 'value',
'#value' => isset($entity->$key) ? $entity->$key : NULL,
);
}
// Add field widgets.
field_attach_form('test_entity', $entity, $form, $form_state);
if (!$add) {
$form['revision'] = array(
'#access' => user_access('administer field_test content'),
'#type' => 'checkbox',
'#title' => t('Create new revision'),
'#default_value' => FALSE,
'#weight' => 100,
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#weight' => 101,
);
return $form;
}
/**
* Validate handler for field_test_entity_form().
*/
function field_test_entity_form_validate($form, &$form_state) {
entity_form_field_validate('test_entity', $form, $form_state);
}
/**
* Submit handler for field_test_entity_form().
*/
function field_test_entity_form_submit($form, &$form_state) {
$entity = field_test_entity_form_submit_build_test_entity($form, $form_state);
$insert = empty($entity->ftid);
field_test_entity_save($entity);
$message = $insert ? t('test_entity @id has been created.', array('@id' => $entity->ftid)) : t('test_entity @id has been updated.', array('@id' => $entity->ftid));
drupal_set_message($message);
if ($entity->ftid) {
$form_state['redirect'] = 'test-entity/manage/' . $entity->ftid . '/edit';
}
else {
// Error on save.
drupal_set_message(t('The entity could not be saved.'), 'error');
$form_state['rebuild'] = TRUE;
}
}
/**
* Updates the form state's entity by processing this submission's values.
*/
function field_test_entity_form_submit_build_test_entity($form, &$form_state) {
$entity = $form_state['test_entity'];
entity_form_submit_build_entity('test_entity', $entity, $form, $form_state);
return $entity;
}
/**
* Form combining two separate entities.
*/
function field_test_entity_nested_form($form, &$form_state, $entity_1, $entity_2) {
// First entity.
foreach (array('ftid', 'ftvid', 'fttype') as $key) {
$form[$key] = array(
'#type' => 'value',
'#value' => $entity_1->$key,
);
}
field_attach_form('test_entity', $entity_1, $form, $form_state);
// Second entity.
$form['entity_2'] = array(
'#type' => 'fieldset',
'#title' => t('Second entity'),
'#tree' => TRUE,
'#parents' => array('entity_2'),
'#weight' => 50,
);
foreach (array('ftid', 'ftvid', 'fttype') as $key) {
$form['entity_2'][$key] = array(
'#type' => 'value',
'#value' => $entity_2->$key,
);
}
field_attach_form('test_entity', $entity_2, $form['entity_2'], $form_state);
$form['save'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#weight' => 100,
);
return $form;
}
/**
* Validate handler for field_test_entity_nested_form().
*/
function field_test_entity_nested_form_validate($form, &$form_state) {
$entity_1 = (object) $form_state['values'];
field_attach_form_validate('test_entity', $entity_1, $form, $form_state);
$entity_2 = (object) $form_state['values']['entity_2'];
field_attach_form_validate('test_entity', $entity_2, $form['entity_2'], $form_state);
}
/**
* Submit handler for field_test_entity_nested_form().
*/
function field_test_entity_nested_form_submit($form, &$form_state) {
$entity_1 = (object) $form_state['values'];
field_attach_submit('test_entity', $entity_1, $form, $form_state);
field_test_entity_save($entity_1);
$entity_2 = (object) $form_state['values']['entity_2'];
field_attach_submit('test_entity', $entity_2, $form['entity_2'], $form_state);
field_test_entity_save($entity_2);
drupal_set_message(t('test_entities @id_1 and @id_2 have been updated.', array('@id_1' => $entity_1->ftid, '@id_2' => $entity_2->ftid)));
}
/**
* Controller class for the test_entity_bundle entity type.
*
* This extends the DrupalDefaultEntityController class, adding required
* special handling for bundles (since they are not stored in the database).
*/
class TestEntityBundleController extends DrupalDefaultEntityController {
protected function attachLoad(&$entities, $revision_id = FALSE) {
// Add bundle information.
foreach ($entities as $key => $entity) {
$entity->fttype = 'test_entity_bundle';
$entities[$key] = $entity;
}
parent::attachLoad($entities, $revision_id);
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Locale data for 'en_GU'.
*
* This file is automatically generated by yiic cldr command.
*
* Copyright © 1991-2007 Unicode, Inc. All rights reserved.
* Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
*
* Copyright © 2008-2011 Yii Software LLC (http://www.yiiframework.com/license/)
*/
return array (
'version' => '4123',
'numberSymbols' =>
array (
'decimal' => '.',
'group' => ',',
'list' => ';',
'percentSign' => '%',
'nativeZeroDigit' => '0',
'patternDigit' => '#',
'plusSign' => '+',
'minusSign' => '-',
'exponential' => 'E',
'perMille' => '‰',
'infinity' => '∞',
'nan' => 'NaN',
),
'decimalFormat' => '#,##0.###',
'scientificFormat' => '#E0',
'percentFormat' => '#,##0%',
'currencyFormat' => '¤#,##0.00;(¤#,##0.00)',
'currencySymbols' =>
array (
'AFN' => 'Af',
'ANG' => 'NAf.',
'AOA' => 'Kz',
'ARA' => '₳',
'ARL' => '$L',
'ARM' => 'm$n',
'ARS' => 'AR$',
'AUD' => 'AU$',
'AWG' => 'Afl.',
'AZN' => 'man.',
'BAM' => 'KM',
'BBD' => 'Bds$',
'BDT' => 'Tk',
'BEF' => 'BF',
'BHD' => 'BD',
'BIF' => 'FBu',
'BMD' => 'BD$',
'BND' => 'BN$',
'BOB' => 'Bs',
'BOP' => '$b.',
'BRL' => 'R$',
'BSD' => 'BS$',
'BTN' => 'Nu.',
'BWP' => 'BWP',
'BZD' => 'BZ$',
'CAD' => 'CA$',
'CDF' => 'CDF',
'CLE' => 'Eº',
'CLP' => 'CL$',
'CNY' => 'CN¥',
'COP' => 'CO$',
'CRC' => '₡',
'CUC' => 'CUC$',
'CUP' => 'CU$',
'CVE' => 'CV$',
'CYP' => 'CY£',
'CZK' => 'Kč',
'DEM' => 'DM',
'DJF' => 'Fdj',
'DKK' => 'Dkr',
'DOP' => 'RD$',
'DZD' => 'DA',
'EEK' => 'Ekr',
'ERN' => 'Nfk',
'ESP' => 'Pts',
'ETB' => 'Br',
'EUR' => '€',
'FIM' => 'mk',
'FJD' => 'FJ$',
'FKP' => 'FK£',
'FRF' => '₣',
'GBP' => '£',
'GHC' => '₵',
'GHS' => 'GH₵',
'GIP' => 'GI£',
'GMD' => 'GMD',
'GNF' => 'FG',
'GRD' => '₯',
'GTQ' => 'GTQ',
'GYD' => 'GY$',
'HKD' => 'HK$',
'HNL' => 'HNL',
'HRK' => 'kn',
'HTG' => 'HTG',
'HUF' => 'Ft',
'IDR' => 'Rp',
'IEP' => 'IR£',
'ILP' => 'I£',
'ILS' => '₪',
'INR' => 'Rs',
'ISK' => 'Ikr',
'ITL' => 'IT₤',
'JMD' => 'J$',
'JOD' => 'JD',
'JPY' => '¥',
'KES' => 'Ksh',
'KMF' => 'CF',
'KRW' => '₩',
'KWD' => 'KD',
'KYD' => 'KY$',
'LAK' => '₭',
'LBP' => 'LB£',
'LKR' => 'SLRs',
'LRD' => 'L$',
'LSL' => 'LSL',
'LTL' => 'Lt',
'LVL' => 'Ls',
'LYD' => 'LD',
'MMK' => 'MMK',
'MNT' => '₮',
'MOP' => 'MOP$',
'MRO' => 'UM',
'MTL' => 'Lm',
'MTP' => 'MT£',
'MUR' => 'MURs',
'MXN' => 'MX$',
'MYR' => 'RM',
'MZM' => 'Mt',
'MZN' => 'MTn',
'NAD' => 'N$',
'NGN' => '₦',
'NIO' => 'C$',
'NLG' => 'fl',
'NOK' => 'Nkr',
'NPR' => 'NPRs',
'NZD' => 'NZ$',
'PAB' => 'B/.',
'PEI' => 'I/.',
'PEN' => 'S/.',
'PGK' => 'PGK',
'PHP' => '₱',
'PKR' => 'PKRs',
'PLN' => 'zł',
'PTE' => 'Esc',
'PYG' => '₲',
'QAR' => 'QR',
'RHD' => 'RH$',
'RON' => 'RON',
'RSD' => 'din.',
'SAR' => 'SR',
'SBD' => 'SI$',
'SCR' => 'SRe',
'SDD' => 'LSd',
'SEK' => 'Skr',
'SGD' => 'S$',
'SHP' => 'SH£',
'SKK' => 'Sk',
'SLL' => 'Le',
'SOS' => 'Ssh',
'SRD' => 'SR$',
'SRG' => 'Sf',
'STD' => 'Db',
'SVC' => 'SV₡',
'SYP' => 'SY£',
'SZL' => 'SZL',
'THB' => '฿',
'TMM' => 'TMM',
'TND' => 'DT',
'TOP' => 'T$',
'TRL' => 'TRL',
'TRY' => 'TL',
'TTD' => 'TT$',
'TWD' => 'NT$',
'TZS' => 'TSh',
'UAH' => '₴',
'UGX' => 'USh',
'USD' => '$',
'UYU' => '$U',
'VEF' => 'Bs.F.',
'VND' => '₫',
'VUV' => 'VT',
'WST' => 'WS$',
'XAF' => 'FCFA',
'XCD' => 'EC$',
'XOF' => 'CFA',
'XPF' => 'CFPF',
'YER' => 'YR',
'ZAR' => 'R',
'ZMK' => 'ZK',
'ZRN' => 'NZ',
'ZRZ' => 'ZRZ',
'ZWD' => 'Z$',
),
'monthNames' =>
array (
'wide' =>
array (
1 => 'January',
2 => 'February',
3 => 'March',
4 => 'April',
5 => 'May',
6 => 'June',
7 => 'July',
8 => 'August',
9 => 'September',
10 => 'October',
11 => 'November',
12 => 'December',
),
'abbreviated' =>
array (
1 => 'Jan',
2 => 'Feb',
3 => 'Mar',
4 => 'Apr',
5 => 'May',
6 => 'Jun',
7 => 'Jul',
8 => 'Aug',
9 => 'Sep',
10 => 'Oct',
11 => 'Nov',
12 => 'Dec',
),
),
'monthNamesSA' =>
array (
'narrow' =>
array (
1 => 'J',
2 => 'F',
3 => 'M',
4 => 'A',
5 => 'M',
6 => 'J',
7 => 'J',
8 => 'A',
9 => 'S',
10 => 'O',
11 => 'N',
12 => 'D',
),
),
'weekDayNames' =>
array (
'wide' =>
array (
0 => 'Sunday',
1 => 'Monday',
2 => 'Tuesday',
3 => 'Wednesday',
4 => 'Thursday',
5 => 'Friday',
6 => 'Saturday',
),
'abbreviated' =>
array (
0 => 'Sun',
1 => 'Mon',
2 => 'Tue',
3 => 'Wed',
4 => 'Thu',
5 => 'Fri',
6 => 'Sat',
),
),
'weekDayNamesSA' =>
array (
'narrow' =>
array (
0 => 'S',
1 => 'M',
2 => 'T',
3 => 'W',
4 => 'T',
5 => 'F',
6 => 'S',
),
),
'eraNames' =>
array (
'abbreviated' =>
array (
0 => 'BC',
1 => 'AD',
),
'wide' =>
array (
0 => 'Before Christ',
1 => 'Anno Domini',
),
'narrow' =>
array (
0 => 'B',
1 => 'A',
),
),
'dateFormats' =>
array (
'full' => 'EEEE, MMMM d, y',
'long' => 'MMMM d, y',
'medium' => 'MMM d, y',
'short' => 'M/d/yy',
),
'timeFormats' =>
array (
'full' => 'h:mm:ss a zzzz',
'long' => 'h:mm:ss a z',
'medium' => 'h:mm:ss a',
'short' => 'h:mm a',
),
'dateTimeFormat' => '{1} {0}',
'amName' => 'AM',
'pmName' => 'PM',
'orientation' => 'ltr',
'pluralRules' =>
array (
0 => 'n==1',
1 => 'true',
),
);
|
{
"pile_set_name": "Github"
}
|
# Set the warning/log level to 3
-W3
# output grf
-ftr
#bitmap mode
-gb
# Set the bit depth to 4 (16 colors)
-gB4
#The Transperant colour of 0xFF00FF
-gT FF00FF
##################
# Old Parameters
#-W3
# disable alpha and set opaque bit for all pixels
#-gT!
# use lz77 compression
#-gzl
# 16 bit bitmap
#-gB16
##################
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Classes
*/
include_once('classes/Aplayer.php');
include_once('classes/Bilibili.php');
include_once('classes/Cache.php');
include_once('classes/Images.php');
include_once('classes/QQ.php');
use Sakura\API\Images;
use Sakura\API\QQ;
use Sakura\API\Cache;
/**
* Router
*/
add_action('rest_api_init', function () {
register_rest_route('sakura/v1', '/image/upload', array(
'methods' => 'POST',
'callback' => 'upload_image',
));
register_rest_route('sakura/v1', '/cache_search/json', array(
'methods' => 'GET',
'callback' => 'cache_search_json',
));
register_rest_route('sakura/v1', '/image/cover', array(
'methods' => 'GET',
'callback' => 'cover_gallery',
));
register_rest_route('sakura/v1', '/image/feature', array(
'methods' => 'GET',
'callback' => 'feature_gallery',
));
register_rest_route('sakura/v1', '/database/update', array(
'methods' => 'GET',
'callback' => 'update_database',
));
register_rest_route('sakura/v1', '/qqinfo/json', array(
'methods' => 'GET',
'callback' => 'get_qq_info',
));
register_rest_route('sakura/v1', '/qqinfo/avatar', array(
'methods' => 'GET',
'callback' => 'get_qq_avatar',
));
register_rest_route('sakura/v1', '/bangumi/bilibili', array(
'methods' => 'POST',
'callback' => 'bgm_bilibili',
));
register_rest_route('sakura/v1', '/meting/aplayer', array(
'methods' => 'GET',
'callback' => 'meting_aplayer',
));
});
/**
* Image uploader response
*/
function upload_image(WP_REST_Request $request) {
// see: https://developer.wordpress.org/rest-api/requests/
// handle file params $file === $_FILES
/**
* curl \
* -F "filecomment=This is an img file" \
* -F "cmt_img_file=@screenshot.jpg" \
* https://dev.2heng.xin/wp-json/sakura/v1/image/upload
*/
// $file = $request->get_file_params();
if (!check_ajax_referer('wp_rest', '_wpnonce', false)) {
$output = array('status' => 403,
'success' => false,
'message' => 'Unauthorized client.',
'link' => "https://view.moezx.cc/images/2019/11/14/step04.md.png",
'proxy' => akina_option('cmt_image_proxy') . "https://view.moezx.cc/images/2019/11/14/step04.md.png",
);
$result = new WP_REST_Response($output, 403);
$result->set_headers(array('Content-Type' => 'application/json'));
return $result;
}
$images = new \Sakura\API\Images();
switch (akina_option("img_upload_api")) {
case 'imgur':
$image = file_get_contents($_FILES["cmt_img_file"]["tmp_name"]);
$API_Request = $images->Imgur_API($image);
break;
case 'smms':
$image = $_FILES;
$API_Request = $images->SMMS_API($image);
break;
case 'chevereto':
$image = file_get_contents($_FILES["cmt_img_file"]["tmp_name"]);
$API_Request = $images->Chevereto_API($image);
break;
}
$result = new WP_REST_Response($API_Request, $API_Request['status']);
$result->set_headers(array('Content-Type' => 'application/json'));
return $result;
}
/*
* 随机封面图 rest api
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/cover
*/
function cover_gallery() {
$imgurl = Images::cover_gallery();
$data = array('cover image');
$response = new WP_REST_Response($data);
$response->set_status(302);
$response->header('Location', $imgurl);
return $response;
}
/*
* 随机文章特色图 rest api
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/image/feature
*/
function feature_gallery() {
$imgurl = Images::feature_gallery();
$data = array('feature image');
$response = new WP_REST_Response($data);
$response->set_status(302);
$response->header('Location', $imgurl);
return $response;
}
/*
* update database rest api
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/database/update
*/
function update_database() {
if (akina_option('cover_cdn_options') == "type_1") {
$output = Cache::update_database();
$result = new WP_REST_Response($output, 200);
return $result;
} else {
return new WP_REST_Response("Invalid access", 200);
}
}
/*
* 定制实时搜索 rest api
* @rest api接口路径:https://sakura.2heng.xin/wp-json/sakura/v1/cache_search/json
* @可在cache_search_json()函数末尾通过设置 HTTP header 控制 json 缓存时间
*/
function cache_search_json() {
if (!check_ajax_referer('wp_rest', '_wpnonce', false)) {
$output = array(
'status' => 403,
'success' => false,
'message' => 'Unauthorized client.'
);
$result = new WP_REST_Response($output, 403);
} else {
$output = Cache::search_json();
$result = new WP_REST_Response($output, 200);
}
$result->set_headers(
array(
'Content-Type' => 'application/json',
'Cache-Control' => 'max-age=3600', // json 缓存控制
)
);
return $result;
}
/**
* QQ info
* https://sakura.2heng.xin/wp-json/sakura/v1/qqinfo/json
*/
function get_qq_info(WP_REST_Request $request) {
if (!check_ajax_referer('wp_rest', '_wpnonce', false)) {
$output = array(
'status' => 403,
'success' => false,
'message' => 'Unauthorized client.'
);
} elseif ($_GET['qq']) {
$qq = $_GET['qq'];
$output = QQ::get_qq_info($qq);
} else {
$output = array(
'status' => 400,
'success' => false,
'message' => 'Bad Request'
);
}
$result = new WP_REST_Response($output, $output['status']);
$result->set_headers(array('Content-Type' => 'application/json'));
return $result;
}
/**
* QQ头像链接解密
* https://sakura.2heng.xin/wp-json/sakura/v1/qqinfo/avatar
*/
function get_qq_avatar() {
$encrypted = $_GET["qq"];
$imgurl = QQ::get_qq_avatar($encrypted);
if (akina_option('qq_avatar_link') == 'type_2') {
$imgdata = file_get_contents($imgurl);
$response = new WP_REST_Response();
$response->set_headers(array(
'Content-Type' => 'image/jpeg',
'Cache-Control' => 'max-age=86400'
));
echo $imgdata;
} else {
$response = new WP_REST_Response();
$response->set_status(301);
$response->header('Location', $imgurl);
}
return $response;
}
function bgm_bilibili() {
if (!check_ajax_referer('wp_rest', '_wpnonce', false)) {
$output = array(
'status' => 403,
'success' => false,
'message' => 'Unauthorized client.'
);
$response = new WP_REST_Response($output, 403);
} else {
$page = $_GET["page"] ?: 2;
$bgm = new \Sakura\API\Bilibili();
$html = preg_replace("/\s+|\n+|\r/", ' ', $bgm->get_bgm_items($page));
$response = new WP_REST_Response($html, 200);
}
return $response;
}
function meting_aplayer() {
$type = $_GET['type'];
$id = $_GET['id'];
$wpnonce = $_GET['_wpnonce'];
$meting_pnonce = $_GET['meting_pnonce'];
if ((isset($wpnonce) && !check_ajax_referer('wp_rest', $wpnonce, false)) || (isset($nonce) && !wp_verify_nonce($nonce, $type . '#:' . $id))) {
$output = array(
'status' => 403,
'success' => false,
'message' => 'Unauthorized client.'
);
$response = new WP_REST_Response($output, 403);
} else {
$Meting_API = new \Sakura\API\Aplayer();
$data = $Meting_API->get_data($type, $id);
if ($type === 'playlist') {
$response = new WP_REST_Response($data, 200);
$response->set_headers(array('cache-control' => 'max-age=3600'));
} elseif ($type === 'lyric') {
$response = new WP_REST_Response();
$response->set_headers(array('cache-control' => 'max-age=3600'));
echo $data;
} else {
$response = new WP_REST_Response();
$response->set_status(301);
$response->header('Location', $data);
}
}
return $response;
}
|
{
"pile_set_name": "Github"
}
|
# Python Libraries
import numpy as np
import cv2
from PIL import Image
import os
# PyTorch Libraries
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.datasets as dsets
import torchvision.transforms as transforms
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1:
m.weight.data.normal_(0.0, 0.02)
m.bias.data.fill_(0)
elif classname.find('BatchNorm') != -1:
m.weight.data.normal_(1.0, 0.02)
m.bias.data.fill_(0)
# print(m)
# print("weights")
class TextEncoding(nn.Module):
def __init__(self, nt, batch_size, vocab):
super(TextEncoding, self).__init__()
self.nt = nt
self.batch_size = batch_size
self.vocab = vocab
self.sparse_layer = nn.Embedding(self.vocab, self.nt)
self.sparse_layer.cuda()
# self.rnn_model = nn.LSTM(40, 256, self.batch_size).cuda()
max_length = 1024
hidden_size = 256
n_layers = 2
# self.embedding = nn.Embedding(self.batch_size)
# self.linear_layer =
# self.linear_layer = nn.Linear()
self.rnn = nn.LSTM(max_length, hidden_size, n_layers, batch_first=True)
self.rnn.cuda()
# self.rnn.cuda()
# self.sparse_layer = nn.Embedding(self.batch_size * self.cap_length + 1, self.nt).cuda()
# self.linear_layer = nn.Linear( (self.cap_length + 1)*self.nt, self.nt ).cuda()
# self.leaky_relu = nn.LeakyReLU(0.1).cuda()
def forward(self, original_text, cap_length, h0):
# original_text = self.sparse_layer(original_text)
# original_text = original_text.float()
original_text = original_text.cuda()
original_text = self.sparse_layer(original_text)
# print(original_text)
packed_captions = torch.nn.utils.rnn.pack_padded_sequence(original_text, cap_length, batch_first=True)
# print(cap_length)
# packed_captions, lengths_padded = torch.nn.utils.rnn.pad_packed_sequence(packed_captions, batch_first=True)
# print('original text')
# print(packed_captions)
# packed_captions = packed_captions
# packed_captions = packed_captions.float()
output, h0 = self.rnn(packed_captions)
output = output.data
first_dim = len(output)
noise_z = torch.rand(128, 256)
noise_z = Variable(noise_z).cuda()
output = torch.cat([output, noise_z], 0)
return output, h0
# text encoding
def text_encoding(vocab_len, original_text, nt, nz,cap_length, batch_size):
# initialization of pytorch functions
# Word embedding here
text_embedding = nn.Embedding(batch_size * cap_length + 1, nt).cuda()
# RNN layers
# rnn = nn.LSTM(cap_length + 1, 256, batch_size).cuda()
# FC layer
linear_layer = nn.Linear((cap_length + 1) * nt, nt).cuda()
leaky_relu = nn.LeakyReLU(0.1).cuda()
# pass to fully connected layer
original_text = Variable(original_text).cuda()
original_text = text_embedding(original_text)
# print(original_text)
# original_text = original_text.float()
# print(original_text)
original_text = original_text.view(batch_size, nt, cap_length + 1)
# print(original_text)
# original_text = original_text.view(args.batch_size, )
# print(original_text)
# out, hidden_state = rnn(original_text)
# print(out)
# original_text = original_text.view(batch_size, (cap_length + 1) * nt )
# print(original_text)
output = linear_layer(original_text)
output = leaky_relu(output)
# print(output)
# noise concatenation
dim_a = len(output)
dim_b = len(output[0][:])
dim_c = len(output[:][0][0])
noise_z = torch.rand(dim_a, nz, dim_c)
noise_z = Variable(noise_z).cuda()
# print(noise_z)
output = torch.cat([output, noise_z], 1)
# print(output)
return output
# def image_encoding(image, batch_size)
# TODO: Text Decoder for sanity check
# def text_decoding(vocab, encoded_text):
# print("Decode for sanity-check")
# rnn_1 = nn.LSTM()
# return caption
# generator model
class Generator(nn.Module):
def __init__(self, nz, nt, ngf, batch_size):
# n_z -> no. of dim for noise
# n_t -> no. of dim for text features
# ngf -> no. of dim for gen filters in first conv layer
super(Generator, self).__init__()
self.batch_size = batch_size
self.nt = nt
self.nz = nz
self.model = nn.Sequential(
#TODO: Change conv to transpconv
# print(nz+nt),
# weights_init(Generator),
nn.ConvTranspose2d(4608, ngf * 8, 4), # 356, 1024
nn.BatchNorm2d(ngf * 8), # 1024
# Feature learning # 1
# for big images
nn.Conv2d(ngf * 8, ngf * 2, 1, 1, 0), # 1024, 256
nn.BatchNorm2d(ngf * 2), # 256
nn.ReLU(True),
# # nn.ReLU(True),
nn.Conv2d(ngf * 2, ngf * 2, 3, 1, 1), # 256, 256
nn.BatchNorm2d(ngf * 2), # 256
nn.ReLU(True),
nn.Conv2d(ngf * 2, ngf * 8, 3, 1, 1), # 256, 1024
nn.BatchNorm2d(ngf * 8), # 1024
nn.ReLU(True),
# nn.LeakyReLU(0.1, True),
# # TODO: conv again for bigger image
# #### start to turn into image~~~~
# # for big images
# # state size : (ngf * 8) * 4 * 4
nn.ConvTranspose2d(ngf * 8, ngf * 4, 4, 2, 1), # 1024, 512
nn.BatchNorm2d(ngf * 4), # 512
# nn.LeakyReLU(0.1, True),
# Feature learning # 2
# # # state size: (ngf * 4) * 8 * 8
nn.Conv2d(ngf * 4, ngf * 1, 1, 1, 0), # 512, 128
nn.BatchNorm2d(ngf * 1), # 128
nn.ReLU(True),
nn.Conv2d(ngf * 1, ngf * 1, 3, 1, 1), # 128, 128
nn.BatchNorm2d(ngf * 1), # 128
nn.ReLU(True),
nn.Conv2d(ngf * 1, ngf * 4, 3, 1, 1), # 128, 512
nn.BatchNorm2d(ngf * 4), # 512
nn.ReLU(True),
# # # TODO: conv again for bigger image
# # state size: (ngf * 4) * 8 * 8
nn.ConvTranspose2d(ngf * 4, ngf * 2, 4, 2, 1),
# # nn.Conv2d(ngf * 4, ngf * 2, 1, 1), # 512, 256
nn.BatchNorm2d(ngf * 2), # 256
nn.LeakyReLU(0.1, True),
# Feature learning # 3
# nn.Conv2d(ngf * 2, ngf * 1, 1, 1, 0), # 512, 128
# nn.BatchNorm2d(ngf * 1), # 128
# nn.ReLU(True),
# nn.Conv2d(ngf * 1, ngf * 1, 3, 1, 1), # 128, 128
# nn.BatchNorm2d(ngf * 1), # 128
# nn.ReLU(True),
# nn.Conv2d(ngf * 1, ngf * 2, 3, 1, 1), # 128, 512
# nn.BatchNorm2d(ngf * 2), # 512
# nn.ReLU(True),
# # state size: (ngf * 2) * 16 * 16
nn.ConvTranspose2d(ngf * 2, ngf * 1, 4, 2, 1), # 256, 128
nn.BatchNorm2d(ngf * 1), # 128
nn.LeakyReLU(0.1, True),
# # # # state size: (ngf) * 32 * 32, 2nd param is no. of channel(hardcoded)
# nn.ConvTranspose2d(ngf * 1, 3, 1, 1, 1), # 128, 3
nn.ConvTranspose2d(ngf * 1, ngf * 1, 4, 2, 1),
nn.BatchNorm2d(ngf),
nn.LeakyReLU(0.1, True),
# nn.ConvTranspose2d(ngf * 1, 3, 4, 2, 1),
nn.ConvTranspose2d(ngf * 1, 3, 1),
# # # # state size: (num_of_channel) * 64 * 64 (Imageeee~~~baby~~)
# weights_init(Generator),
# # # # activation
nn.Tanh(),
# weights_init(Generator)
)
def forward(self, x):
# a_c_dim has to match with the first conv layer
x = x.view(self.batch_size, 4608, 1, 1).cuda()
# print("Launch Generator!")
# print(x)
out = self.model(x)
# print(out)
out = out.view(self.batch_size, 3, 64, 64).cuda()
# out = out.view(16, 3, 64, 64).cuda()
return out
# discriminator model
class Discriminator(nn.Module):
def __init__(self, nz, nt, ngf, ndf, batch_size):
self.nt = nt
self.batch_size = batch_size
# n_z -> no. of dim for noise
# n_t -> no. of dim for text features
# ngf -> no. of dim for gen filters in first conv layer
# ndf -> no. of dim for discriminator filters in first conv layer
super(Discriminator, self).__init__()
# weights_init(Discriminator)
self.model = nn.Sequential(
# nn.Conv2d(3, ndf * 1, 4, 2, 1),
nn.Conv2d(3, ndf * 1, 1),
nn.LeakyReLU(0.2, True),
nn.Conv2d(ndf * 1, ndf * 2, 4, 2, 1),
nn.BatchNorm2d(ndf * 2),
nn.LeakyReLU(0.2, True),
nn.Conv2d(ndf * 2, ndf * 4, 4, 2, 1),
nn.BatchNorm2d(ndf * 4),
# nn.LeakyReLU(0.1, True),
nn.Conv2d(ndf * 4, ndf * 8, 4, 2, 1),
nn.BatchNorm2d(ndf * 8),
# nn.Conv2d(ndf * 4, ndf * 8, 4, 2, 1),
# nn.BatchNorm2d(ndf * 8),
# bigger image possibly
nn.Conv2d(ndf * 8, ndf * 2, 1, 1, 0),
nn.BatchNorm2d(ndf * 2),
nn.LeakyReLU(0.2, True),
nn.Conv2d(ndf * 2, ndf * 2, 3, 1, 1),
nn.BatchNorm2d(ndf * 2),
nn.LeakyReLU(0.2, True),
nn.Conv2d(ndf * 2, ndf * 8, 6),
# nn.Conv2d(ndf * 2, ndf * 8, 2),
# nn.Conv2d(ndf * 2, ndf * 8, 3, 3, 1),
nn.BatchNorm2d(ndf * 8),
nn.LeakyReLU(0.2, True),
)
self.model2 = nn.Sequential(
nn.Conv2d(ndf * 8 + nt, ndf * 8, 1),
nn.BatchNorm2d(ndf * 8),
nn.LeakyReLU(0.2, True),
# nn.Conv2d(ndf * 8, ndf * 4, 1),
# nn.BatchNorm2d(ndf * 4),
# nn.LeakyReLU(0.2, True),
nn.Conv2d(ndf * 8, 1, 3),
# nn.BatchNorm2d(1),
# nn.LeakyReLU(0.2, True),
# nn.Conv2d(ndf * 1, 1, 4),
nn.Sigmoid()
)
def forward(self, x, text, cap_length):
# a_c_dim has to match with the first conv layer
x = x.view(self.batch_size, 3, 64, 64)
###### model 1 #######
# text that describes generated image
out = self.model(x)
# print(out)
# out = out.view(4, 8192, 1, 1)
# print(out)
# text input layers
linear_layer2 = nn.Linear(cap_length + 1, self.nt)
linear_layer2.cuda()
# batch_norm2 = nn.BatchNorm2d(self.nt)
leaky2 = nn.LeakyReLU(0.2, True)
####### text input ##########
# print(text)
# print(cap_length)
# text_v = Variable(text)
text_v = text
text_v = text_v.float().cuda()
text_input = linear_layer2(text_v)
# text_input = batch_norm2()
text_input = leaky2(text_input)
# print(text_input)
# print("text input")
# print(len(text_input[0]))
reshape_len = len(text_input[1]) # hardcoded
# print(reshape_len)
text_input = text_input.view(self.batch_size, 1024, 1, 1).cuda() # hardcoded batchsize
padded_text = nn.functional.pad(text_input,
(1, 1, 1, 1), 'replicate').cuda()
####### concat text and output from model1 #########
# print(out)
# print(padded_text)
_cat = torch.cat((padded_text, out), 1)
# print(_cat)
####### TODO: pass whole concatenated structure to model2 ########
out = self.model2(_cat)
return out
|
{
"pile_set_name": "Github"
}
|
1.1.0 / 2014-04-12
==================
* add non-array values support
* expose internal utilities:
- `.is()`
- `.hasBody()`
- `.normalize()`
- `.match()`
1.0.1 / 2014-03-30
==================
* add `multipart` as a shorthand
|
{
"pile_set_name": "Github"
}
|
'use strict';
module.exports = concurrency => {
if (concurrency < 1) {
throw new TypeError('Expected `concurrency` to be a number from 1 and up');
}
const queue = [];
let activeCount = 0;
const next = () => {
activeCount--;
if (queue.length > 0) {
queue.shift()();
}
};
return fn => new Promise((resolve, reject) => {
const run = () => {
activeCount++;
fn().then(
val => {
resolve(val);
next();
},
err => {
reject(err);
next();
}
);
};
if (activeCount < concurrency) {
run();
} else {
queue.push(run);
}
});
};
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id: Cache.php 23775 2011-03-01 17:25:24Z ralph $
*/
/** Zend_Server_Cache */
require_once 'Zend/Server/Cache.php';
/**
* Zend_XmlRpc_Server_Cache: cache Zend_XmlRpc_Server server definition
*
* @category Zend
* @package Zend_XmlRpc
* @subpackage Server
* @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_XmlRpc_Server_Cache extends Zend_Server_Cache
{
/**
* @var array Skip system methods when caching XML-RPC server
*/
protected static $_skipMethods = array(
'system.listMethods',
'system.methodHelp',
'system.methodSignature',
'system.multicall',
);
}
|
{
"pile_set_name": "Github"
}
|
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !go1.6
package http2
import (
"crypto/tls"
"net/http"
"time"
)
func configureTransport(t1 *http.Transport) (*Transport, error) {
return nil, errTransportVersion
}
func transportExpectContinueTimeout(t1 *http.Transport) time.Duration {
return 0
}
// isBadCipher reports whether the cipher is blacklisted by the HTTP/2 spec.
func isBadCipher(cipher uint16) bool {
switch cipher {
case tls.TLS_RSA_WITH_RC4_128_SHA,
tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA,
tls.TLS_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_RSA_WITH_AES_256_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA,
tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:
// Reject cipher suites from Appendix A.
// "This list includes those cipher suites that do not
// offer an ephemeral key exchange and those that are
// based on the TLS null, stream or block cipher type"
return true
default:
return false
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubernetes 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.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"context"
"time"
v1beta1 "k8s.io/api/extensions/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
scheme "k8s.io/client-go/kubernetes/scheme"
rest "k8s.io/client-go/rest"
)
// DaemonSetsGetter has a method to return a DaemonSetInterface.
// A group's client should implement this interface.
type DaemonSetsGetter interface {
DaemonSets(namespace string) DaemonSetInterface
}
// DaemonSetInterface has methods to work with DaemonSet resources.
type DaemonSetInterface interface {
Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (*v1beta1.DaemonSet, error)
Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error)
UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (*v1beta1.DaemonSet, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.DaemonSet, error)
List(ctx context.Context, opts v1.ListOptions) (*v1beta1.DaemonSetList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error)
DaemonSetExpansion
}
// daemonSets implements DaemonSetInterface
type daemonSets struct {
client rest.Interface
ns string
}
// newDaemonSets returns a DaemonSets
func newDaemonSets(c *ExtensionsV1beta1Client, namespace string) *daemonSets {
return &daemonSets{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
func (c *daemonSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.DaemonSet, err error) {
result = &v1beta1.DaemonSet{}
err = c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
func (c *daemonSets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.DaemonSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.DaemonSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested daemonSets.
func (c *daemonSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *daemonSets) Create(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.CreateOptions) (result *v1beta1.DaemonSet, err error) {
result = &v1beta1.DaemonSet{}
err = c.client.Post().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&opts, scheme.ParameterCodec).
Body(daemonSet).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
func (c *daemonSets) Update(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) {
result = &v1beta1.DaemonSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("daemonsets").
Name(daemonSet.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(daemonSet).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *daemonSets) UpdateStatus(ctx context.Context, daemonSet *v1beta1.DaemonSet, opts v1.UpdateOptions) (result *v1beta1.DaemonSet, err error) {
result = &v1beta1.DaemonSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("daemonsets").
Name(daemonSet.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(daemonSet).
Do(ctx).
Into(result)
return
}
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
func (c *daemonSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *daemonSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("daemonsets").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched daemonSet.
func (c *daemonSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.DaemonSet, err error) {
result = &v1beta1.DaemonSet{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("daemonsets").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
|
{
"pile_set_name": "Github"
}
|
$(document).ready(function(){
module("testProcessingInstructions");
test("testProcessingInstructions", function() {
expect(1);
var input = 'data(<?target content?>) instance of xs:string';
var expected = '<span class="cm-variable cm-def">data</span>(<span class="cm-comment cm-meta"><?target content?></span>) <span class="cm-keyword">instance</span> <span class="cm-keyword">of</span> <span class="cm-atom">xs:string</span>';
$("#sandbox").html('<textarea id="editor">' + input + '</textarea>');
var editor = CodeMirror.fromTextArea($("#editor")[0]);
var result = $(".CodeMirror-lines div div pre")[0].innerHTML;
equal(result, expected);
$("#editor").html("");
});
});
|
{
"pile_set_name": "Github"
}
|
CMAKE_FIND_USE_PACKAGE_REGISTRY
-------------------------------
.. versionadded:: 3.16
Controls the default behavior of the :command:`find_package` command for
whether or not to search paths provided by the :ref:`User Package Registry`.
By default this variable is not set and the behavior will fall back
to that determined by the deprecated
:variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` variable. If that is
also not set, then :command:`find_package` will use the
:ref:`User Package Registry` unless the ``NO_CMAKE_PACKAGE_REGISTRY`` option
is provided.
This variable takes precedence over
:variable:`CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY` when both are set.
In some cases, for example to locate only system wide installations, it
is not desirable to use the :ref:`User Package Registry` when searching
for packages. If the :variable:`CMAKE_FIND_USE_PACKAGE_REGISTRY`
variable is ``FALSE``, all the :command:`find_package` commands will skip
the :ref:`User Package Registry` as if they were called with the
``NO_CMAKE_PACKAGE_REGISTRY`` argument.
See also :ref:`Disabling the Package Registry` and the
:variable:`CMAKE_FIND_USE_CMAKE_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_CMAKE_SYSTEM_PATH`,
:variable:`CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH`,
:variable:`CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY`,
and :variable:`CMAKE_FIND_USE_PACKAGE_ROOT_PATH` variables.
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/perl -w
use Carp;
use Mail::IMAPClient;
use IO::Socket::SSL;
my $ssl = new IO::Socket::SSL("louloutte.dyndns.org:993");
my $imap = Mail::IMAPClient->new();
$imap->Socket($ssl);
$imap->Debug(1);
$imap->Server('louloutte.dyndns.org');
$imap->connect() or croak "Error connecting @!";
$imap->User('MarkOv@est.belle');
$imap->Password('emhj91ly');
$imap->login();
$imap->select('Inbox');
my @messages = $imap->messages();
my $headers = $imap->parse_headers([@messages]);
$imap->logout();
|
{
"pile_set_name": "Github"
}
|
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x3fc1, 0xff3c, 0x0780,
0x18e0, 0xc318, 0x0300,
0x1830, 0xc118, 0x0300,
0x1830, 0xc018, 0x0300,
0x1818, 0xc018, 0x0300,
0x1818, 0xc218, 0x0300,
0x1818, 0xfe18, 0x0300,
0x1818, 0xc218, 0x0300,
0x1818, 0xc018, 0x0300,
0x1830, 0xc018, 0x0300,
0x1830, 0xc118, 0x1302,
0x18e0, 0xc318, 0x3306,
0x3fc1, 0xff3f, 0xf7fe,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000,
|
{
"pile_set_name": "Github"
}
|
/*
* 文 件 名: DataCleanManager.java
* 描 述: 主要功能有清除内/外缓存,清除数据库,清除sharedPreference,清除files和清除自定义目录
*/
package tk.woppo.sunday.util;
import java.io.File;
import android.content.Context;
import android.os.Environment;
/**
* 本应用数据清除管理器
*/
public class DataCleanUtil {
/**
* 清除本应用内部缓存(/data/data/com.xxx.xxx/cache)
*
* @param context
*/
public static void cleanInternalCache(Context context) {
deleteFilesByDirectory(context.getCacheDir().getAbsoluteFile());
}
/**
* 清除本应用所有数据库(/data/data/com.xxx.xxx/databases)
*
* @param context
*/
public static void cleanDatabases(Context context) {
deleteFilesByDirectory(new File("/data/data/"
+ context.getPackageName() + "/databases"));
}
/**
* 清除本应用SharedPreference(/data/data/com.xxx.xxx/shared_prefs)
*
* @param context
*/
public static void cleanSharedPreference(Context context) {
deleteFilesByDirectory(new File("/data/data/"
+ context.getPackageName() + "/shared_prefs"));
}
/**
* 按名字清除本应用数据库
*
* @param context
* @param dbName
*/
public static void cleanDatabaseByName(Context context, String dbName) {
context.deleteDatabase(dbName);
}
/**
* 清除/data/data/com.xxx.xxx/files下的内容
*
* @param context
*/
public static void cleanFiles(Context context) {
deleteFilesByDirectory(context.getFilesDir());
}
/**
* 清除/data/data/com.xxx.xxx/files下的某文件
*
* @param content
* @param filePath
*/
public static void cleanFilesFile(Context context, String filePath) {
File file = new File(context.getFilesDir() + "/" + filePath);
file.delete();
}
/**
* 清除外部cache下的内容(/mnt/sdcard/android/data/com.xxx.xxx/cache)
*
* @param context
*/
public static void cleanExternalCache(Context context) {
if (Environment.getExternalStorageState().equals(
Environment.MEDIA_MOUNTED)) {
deleteFilesByDirectory(context.getExternalCacheDir());
}
}
/**
* 清除自定义路径下的文件,使用需小心,请不要误删。而且只支持目录下的文件删除
*
* @param filePath
*/
public static void cleanCustomCache(String filePath) {
deleteFilesByDirectory(new File(filePath));
}
/**
* 清除本应用所有的数据
*
* @param context
* @param filepath
*/
public static void cleanApplicationData(Context context, String... filepath) {
cleanInternalCache(context);
cleanExternalCache(context);
cleanDatabases(context);
cleanSharedPreference(context);
cleanFiles(context);
for (String filePath : filepath) {
cleanCustomCache(filePath);
}
}
/**
* 删除方法 这里只会删除某个文件夹下的文件,如果传入的directory是个文件,将不做处理
*
* @param directory
*/
private static long deleteFilesByDirectory(File directory) {
long size = 0;
if (directory != null && directory.exists() && directory.isDirectory()) {
for (File item : directory.listFiles()) {
if (item.isDirectory()) {
deleteFilesByDirectory(item);
} else {
item.delete();
}
}
}
return size;
}
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Linq;
using System.Text;
using Signum.Engine.Maps;
using System.Reflection;
using Signum.Engine.DynamicQuery;
using Signum.Entities;
using Signum.Utilities;
using Signum.Entities.Basics;
using System.Threading;
using Signum.Utilities.Reflection;
using System.Collections.Generic;
namespace Signum.Engine.Basics
{
public static class ExceptionLogic
{
public static void Start(SchemaBuilder sb)
{
if (sb.NotDefined(MethodInfo.GetCurrentMethod()))
{
sb.Include<ExceptionEntity>()
.WithQuery(() => e => new
{
Entity = e,
e.Id,
e.CreationDate,
e.ExceptionType,
e.ExceptionMessage,
e.StackTraceHash,
});
DefaultEnvironment = "Default";
}
}
public static ExceptionEntity LogException(this Exception ex, Action<ExceptionEntity> completeContext)
{
var entity = GetEntity(ex);
completeContext(entity);
return entity.SaveForceNew();
}
public static ExceptionEntity LogException(this Exception ex)
{
var entity = GetEntity(ex);
return entity.SaveForceNew();
}
public static ExceptionEntity? GetExceptionEntity(this Exception ex)
{
var exEntity = ex.Data[ExceptionEntity.ExceptionDataKey] as ExceptionEntity;
return exEntity;
}
static ExceptionEntity GetEntity(Exception ex)
{
ExceptionEntity entity = ex.GetExceptionEntity() ?? new ExceptionEntity(ex);
entity.ExceptionType = ex.GetType().Name;
var exceptions = ex is AggregateException agex ?
agex.InnerExceptions.SelectMany(inner => inner.Follow(e => e.InnerException)).ToList() :
ex.Follow(e => e.InnerException).ToList();
string messages = exceptions.ToString(e => e.Message, "\r\n\r\n");
string stacktraces = exceptions.ToString(e => e.StackTrace, "\r\n\r\n");
entity.ExceptionMessage = messages.DefaultText("- No message - ");
entity.StackTrace = new BigStringEmbedded(stacktraces.DefaultText("- No stacktrace -"));
entity.ThreadId = Thread.CurrentThread.ManagedThreadId;
entity.ApplicationName = Schema.Current.ApplicationName;
entity.HResult = ex.HResult;
entity.Form = new BigStringEmbedded();
entity.QueryString = new BigStringEmbedded();
entity.Session = new BigStringEmbedded();
entity.Environment = CurrentEnvironment;
try
{
entity.User = UserHolder.Current?.ToLite(); //Session special situations
}
catch { }
try
{
entity.Data = new BigStringEmbedded(ex.Data.Dump());
}
catch (Exception e)
{
entity.Data = new BigStringEmbedded($@"Error Dumping Data!{e.GetType().Name}: {e.Message}{e.StackTrace}");
}
entity.Version = Schema.Current.Version.ToString();
return entity;
}
static ExceptionEntity SaveForceNew(this ExceptionEntity entity)
{
if (entity.Modified == ModifiedState.Clean)
return entity;
using (ExecutionMode.Global())
using (Transaction tr = Transaction.ForceNew())
{
entity.Save();
return tr.Commit(entity);
}
}
public static string? DefaultEnvironment { get; set; }
public static string? CurrentEnvironment { get { return overridenEnvironment.Value ?? DefaultEnvironment; } }
static readonly Variable<string?> overridenEnvironment = Statics.ThreadVariable<string?>("exceptionEnviroment");
public static IDisposable OverrideEnviroment(string? newEnviroment)
{
string? oldEnviroment = overridenEnvironment.Value;
overridenEnvironment.Value = newEnviroment;
return new Disposable(() => overridenEnvironment.Value = oldEnviroment);
}
public static event Action<DeleteLogParametersEmbedded, StringBuilder, CancellationToken>? DeleteLogs;
public static int DeleteLogsTimeOut = 10 * 60 * 1000;
public static void DeleteLogsAndExceptions(DeleteLogParametersEmbedded parameters, StringBuilder sb, CancellationToken token)
{
using (Connector.CommandTimeoutScope(DeleteLogsTimeOut))
using (var tr = Transaction.None())
{
foreach (var action in DeleteLogs.GetInvocationListTyped())
{
token.ThrowIfCancellationRequested();
action(parameters, sb, token);
}
WriteRows(sb, "Updating ExceptionEntity.Referenced = false", () => Database.Query<ExceptionEntity>().UnsafeUpdate().Set(a => a.Referenced, a => false).Execute());
token.ThrowIfCancellationRequested();
var ex = Schema.Current.Table<ExceptionEntity>();
var referenced = (FieldValue)ex.GetField(ReflectionTools.GetPropertyInfo((ExceptionEntity e) => e.Referenced));
var commands = (from t in Schema.Current.GetDatabaseTables()
from c in t.Columns.Values
where c.ReferenceTable == ex
select (table: t, command: new SqlPreCommandSimple("UPDATE ex SET {1} = 1 FROM {0} ex JOIN {2} log ON ex.Id = log.{3}"
.FormatWith(ex.Name, referenced.Name, t.Name, c.Name)))).ToList();
foreach (var p in commands)
{
token.ThrowIfCancellationRequested();
WriteRows(sb, "Updating Exceptions.Referenced from " + p.table.Name.Name, () => p.command.ExecuteNonQuery());
}
token.ThrowIfCancellationRequested();
var dateLimit = parameters.GetDateLimitDelete(typeof(ExceptionEntity).ToTypeEntity());
if (dateLimit != null)
{
Database.Query<ExceptionEntity>()
.Where(a => !a.Referenced && a.CreationDate < dateLimit)
.UnsafeDeleteChunksLog(parameters, sb, token);
}
tr.Commit();
}
}
public static void WriteRows(StringBuilder sb, string text, Func<int> makeQuery)
{
var start = PerfCounter.Ticks;
var result = makeQuery();
var end = PerfCounter.Ticks;
var ts = TimeSpan.FromMilliseconds(PerfCounter.ToMilliseconds(start, end));
sb.AppendLine($"{text}: {result} rows affected in {ts.NiceToString()}");
}
public static void UnsafeDeleteChunksLog<T>(this IQueryable<T> sources, DeleteLogParametersEmbedded parameters, StringBuilder sb, CancellationToken cancellationToken)
where T : Entity
{
WriteRows(sb, "Deleting " + typeof(T).Name, () => sources.UnsafeDeleteChunks(
parameters.ChunkSize,
parameters.MaxChunks,
pauseMilliseconds: parameters.PauseTime,
cancellationToken: cancellationToken));
}
public static void ExecuteChunksLog<T>(this IUpdateable<T> sources, DeleteLogParametersEmbedded parameters, StringBuilder sb, CancellationToken cancellationToken)
where T : Entity
{
WriteRows(sb, "Updating " + typeof(T).Name, () => sources.ExecuteChunks(
parameters.ChunkSize,
parameters.MaxChunks,
pauseMilliseconds: parameters.PauseTime,
cancellationToken: cancellationToken));
}
}
}
|
{
"pile_set_name": "Github"
}
|
# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20141222142202) do
create_table "exoplanets", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "galaxies", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "galaxies_elliptical_galaxies", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "galaxies_lenticular_galaxies", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "galaxies_spiral_galaxies", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "planets", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "rogue_planets", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
create_table "stars", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
end
|
{
"pile_set_name": "Github"
}
|
# (C) Copyright David Abrahams 2001.
# (C) Copyright MetaCommunications, Inc. 2004.
# 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)
# The following #// line will be used by the regression test table generation
# program as the column heading for HTML tables. Must not include a version
# number.
#//<a href="http://www.comeaucomputing.com/">Comeau<br>C++</a>
import common ;
import como ;
import feature ;
import generators ;
import toolset : flags ;
feature.extend-subfeature toolset como : platform : win ;
# Initializes the Comeau toolset for windows. The command is the command which
# invokes the compiler. You should either set environment variable
# COMO_XXX_INCLUDE where XXX is the used backend (as described in the
# documentation), or pass that as part of command, e.g:
#
# using como-win : 4.3 : "set COMO_BCC_INCLUDE=C:/include &&" como.exe ;
#
rule init ( version ? : command * : options * )
{
local condition = [ common.check-init-parameters como-win
: version $(version) ] ;
command = [ common.get-invocation-command como-win : como.exe :
$(command) ] ;
common.handle-options como-win : $(condition) : $(command) : $(options) ;
}
generators.register-c-compiler como-win.compile.c++ : CPP : OBJ
: <toolset>como <toolset-como:platform>win ;
generators.register-c-compiler como-win.compile.c : C : OBJ
: <toolset>como <toolset-como:platform>win ;
generators.register-linker como-win.link
: OBJ SEARCHED_LIB STATIC_LIB IMPORT_LIB
: EXE
: <toolset>como <toolset-como:platform>win ;
# Note that status of shared libraries support is not clear, so we do not define
# the link.dll generator.
generators.register-archiver como-win.archive
: OBJ : STATIC_LIB
: <toolset>como <toolset-como:platform>win ;
flags como-win C++FLAGS <exception-handling>off : --no_exceptions ;
flags como-win C++FLAGS <exception-handling>on : --exceptions ;
flags como-win CFLAGS <inlining>off : --no_inlining ;
flags como-win CFLAGS <inlining>on <inlining>full : --inlining ;
# The following seems to be VC-specific options. At least, when I uncomment
# then, Comeau with bcc as backend reports that bcc32 invocation failed.
#
#flags como-win CFLAGS <debug-symbols>on : /Zi ;
#flags como-win CFLAGS <optimization>off : /Od ;
flags como-win CFLAGS <cflags> ;
flags como-win CFLAGS : -D_WIN32 ; # Make sure that we get the Boost Win32 platform config header.
flags como-win CFLAGS <threading>multi : -D_MT ; # Make sure that our config knows that threading is on.
flags como-win C++FLAGS <cxxflags> ;
flags como-win DEFINES <define> ;
flags como-win UNDEFS <undef> ;
flags como-win HDRS <include> ;
flags como-win SYSHDRS <sysinclude> ;
flags como-win LINKFLAGS <linkflags> ;
flags como-win ARFLAGS <arflags> ;
flags como-win NO_WARN <no-warn> ;
#flags como-win STDHDRS : $(COMO_INCLUDE_PATH) ;
#flags como-win STDLIB_PATH : $(COMO_STDLIB_PATH)$(SLASH) ;
flags como-win LIBPATH <library-path> ;
flags como-win LIBRARIES <library-file> ;
flags como-win FINDLIBS <find-shared-library> ;
flags como-win FINDLIBS <find-static-library> ;
nl = "
" ;
# For como, we repeat all libraries so that dependencies are always resolved.
#
actions link bind LIBRARIES
{
$(CONFIG_COMMAND) --no_version --no_prelink_verbose $(LINKFLAGS) -o "$(<[1]:S=)" @"@($(<[1]:W).rsp:E=$(nl)"$(>)")" "$(LIBRARIES)" "$(FINDLIBS:S=.lib)"
}
actions compile.c
{
$(CONFIG_COMMAND) -c --c99 -e5 --no_version --display_error_number --diag_suppress=9,21,161,748,940,962 -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<:D=)" "$(>)"
}
actions compile.c++
{
$(CONFIG_COMMAND) -c -e5 --no_version --no_prelink_verbose --display_error_number --long_long --diag_suppress=9,21,161,748,940,962 --diag_error=461 -D__STL_LONG_LONG -U$(UNDEFS) -D$(DEFINES) $(WARN) $(CFLAGS) $(C++FLAGS) -I"$(HDRS)" -I"$(STDHDRS)" -I"$(SYSHDRS)" -o "$(<)" "$(>)"
}
actions archive
{
$(CONFIG_COMMAND) --no_version --no_prelink_verbose --prelink_object @"@($(<[1]:W).rsp:E=$(nl)"$(>)")"
lib $(ARFLAGS) /nologo /out:"$(<:S=.lib)" @"@($(<[1]:W).rsp:E=$(nl)"$(>)")"
}
|
{
"pile_set_name": "Github"
}
|
# encoding: UTF-8
module Vines
class Stream
class Component
class Start < State
def initialize(stream, success=Handshake)
super
end
def node(node)
raise StreamErrors::NotAuthorized unless stream?(node)
stream.start(node)
advance
end
end
end
end
end
|
{
"pile_set_name": "Github"
}
|
int sound_init(int, int);
void sound_play(void *, int);
void sound_deinit(void);
|
{
"pile_set_name": "Github"
}
|
@model int?
@(Html.Kendo().IntegerTextBoxFor(m => m)
.HtmlAttributes(new { style = "width:100%" })
.Min(int.MinValue)
.Max(int.MaxValue)
)
|
{
"pile_set_name": "Github"
}
|
apiVersion: v1
kind: Service
metadata:
name: weave
namespace: kube-system
annotations:
prometheus.io/scrape: 'true'
spec:
type: ClusterIP
clusterIP: None
selector:
name: weave-net
ports:
- name: weave
protocol: TCP
port: 80
targetPort: 6782
---
apiVersion: v1
kind: Service
metadata:
name: weave-npc
namespace: kube-system
annotations:
prometheus.io/scrape: 'true'
spec:
type: ClusterIP
clusterIP: None
selector:
name: weave-net
ports:
- name: weave-npc
protocol: TCP
port: 80
targetPort: 6781
|
{
"pile_set_name": "Github"
}
|
<li>
<a href="#glyphicons">Glyphicons</a>
<ul class="nav">
<li><a href="#glyphicons-glyphs">Available glyphs</a></li>
<li><a href="#glyphicons-how-to-use">How to use</a></li>
<li><a href="#glyphicons-examples">Examples</a></li>
</ul>
</li>
<li>
<a href="#dropdowns">Dropdowns</a>
<ul class="nav">
<li><a href="#dropdowns-example">Example</a></li>
<li><a href="#dropdowns-alignment">Alignment options</a></li>
<li><a href="#dropdowns-headers">Headers</a></li>
<li><a href="#dropdowns-disabled">Disabled menu items</a></li>
</ul>
</li>
<li>
<a href="#btn-groups">Button groups</a>
<ul class="nav">
<li><a href="#btn-groups-single">Basic example</a></li>
<li><a href="#btn-groups-toolbar">Button toolbar</a></li>
<li><a href="#btn-groups-sizing">Sizing</a></li>
<li><a href="#btn-groups-nested">Nesting</a></li>
<li><a href="#btn-groups-vertical">Vertical variation</a></li>
<li><a href="#btn-groups-justified">Justified link variation</a></li>
</ul>
</li>
<li>
<a href="#btn-dropdowns">Button dropdowns</a>
<ul class="nav">
<li><a href="#btn-dropdowns-single">Single button dropdowns</a></li>
<li><a href="#btn-dropdowns-split">Split button dropdowns</a></li>
<li><a href="#btn-dropdowns-sizing">Sizing</a></li>
<li><a href="#btn-dropdowns-dropup">Dropup variation</a></li>
</ul>
</li>
<li>
<a href="#input-groups">Input groups</a>
<ul class="nav">
<li><a href="#input-groups-basic">Basic example</a></li>
<li><a href="#input-groups-sizing">Sizing</a></li>
<li><a href="#input-groups-checkboxes-radios">Checkbox and radios addons</a></li>
<li><a href="#input-groups-buttons">Button addons</a></li>
<li><a href="#input-groups-buttons-dropdowns">Buttons with dropdowns</a></li>
<li><a href="#input-groups-buttons-segmented">Segmented buttons</a></li>
</ul>
</li>
<li>
<a href="#nav">Navs</a>
<ul class="nav">
<li><a href="#nav-tabs">Tabs</a></li>
<li><a href="#nav-pills">Pills</a></li>
<li><a href="#nav-justified">Justified nav</a></li>
<li><a href="#nav-disabled-links">Disabled links</a></li>
<li><a href="#nav-alignment">Alignment options</a></li>
<li><a href="#nav-dropdowns">Using dropdowns</a></li>
</ul>
</li>
<li>
<a href="#navbar">Navbar</a>
<ul class="nav">
<li><a href="#navbar-default">Default navbar</a></li>
<li><a href="#navbar-buttons">Buttons</a></li>
<li><a href="#navbar-text">Text</a></li>
<li><a href="#navbar-links">Non-nav links</a></li>
<li><a href="#navbar-component-alignment">Component alignment</a></li>
<li><a href="#navbar-fixed-top">Fixed to top</a></li>
<li><a href="#navbar-fixed-bottom">Fixed to bottom</a></li>
<li><a href="#navbar-static-top">Static top</a></li>
<li><a href="#navbar-inverted">Inverted navbar</a></li>
</ul>
</li>
<li><a href="#breadcrumbs">Breadcrumbs</a></li>
<li>
<a href="#pagination">Pagination</a>
<ul class="nav">
<li><a href="#pagination-default">Default pagination</a></li>
<li><a href="#pagination-pager">Pager</a></li>
</ul>
</li>
<li><a href="#labels">Labels</a></li>
<li><a href="#badges">Badges</a></li>
<li><a href="#jumbotron">Jumbotron</a></li>
<li><a href="#page-header">Page header</a></li>
<li>
<a href="#thumbnails">Thumbnails</a>
<ul class="nav">
<li><a href="#thumbnails-default">Default example</a></li>
<li><a href="#thumbnails-custom-content">Custom content</a></li>
</ul>
</li>
<li>
<a href="#alerts">Alerts</a>
<ul class="nav">
<li><a href="#alerts-examples">Examples</a></li>
<li><a href="#alerts-dismissable">Dismissable alerts</a></li>
<li><a href="#alerts-links">Links in alerts</a></li>
</ul>
</li>
<li>
<a href="#progress">Progress bars</a>
<ul class="nav">
<li><a href="#progress-basic">Basic example</a></li>
<li><a href="#progress-alternatives">Contextual alternatives</a></li>
<li><a href="#progress-striped">Striped</a></li>
<li><a href="#progress-animated">Animated</a></li>
<li><a href="#progress-stacked">Stacked</a></li>
</ul>
</li>
<li>
<a href="#media">Media object</a>
<ul class="nav">
<li><a href="#media-default">Default media</a></li>
<li><a href="#media-list">Media list</a></li>
</ul>
</li>
<li>
<a href="#list-group">List group</a>
<ul class="nav">
<li><a href="#list-group-basic">Basic example</a></li>
<li><a href="#list-group-badges">Badges</a></li>
<li><a href="#list-group-linked">Linked items</a></li>
<li><a href="#list-group-custom-content">Custom content</a></li>
</ul>
</li>
<li>
<a href="#panels">Panels</a>
<ul class="nav">
<li><a href="#panels-basic">Basic example</a></li>
<li><a href="#panels-heading">Panel with heading</a></li>
<li><a href="#panels-alternatives">Contextual alternatives</a></li>
<li><a href="#panels-tables">With tables</a>
<li><a href="#panels-list-group">With list groups</a>
</ul>
</li>
<li><a href="#wells">Wells</a></li>
|
{
"pile_set_name": "Github"
}
|
{
"id": "kerokerokeroppi-cake",
"name": "Kerokerokeroppi Cake",
"category": "Furniture",
"games": {
"nl": {
"orderable": false,
"interiorThemes": [
"Fairy Tale"
],
"set": "Welcome amiibo Update",
"rvs": [
"toby"
],
"buyPrices": [
{
"currency": "meow",
"value": 3
}
]
}
}
}
|
{
"pile_set_name": "Github"
}
|
// RUN: llvm-tblgen -gen-disassembler -I %p/../../include %s | FileCheck %s
// Check that we don't generate invalid code of the form "( && Cond2)" when
// emitting AssemblerPredicate conditions. In the example below, the invalid
// code would be: "return ( && (Bits & arch::AssemblerCondition2));".
include "llvm/Target/Target.td"
def archInstrInfo : InstrInfo { }
def arch : Target {
let InstructionSet = archInstrInfo;
}
def Pred1 : Predicate<"Condition1">;
def Pred2 : Predicate<"Condition2">,
AssemblerPredicate<"AssemblerCondition2">;
def foo : Instruction {
let Size = 2;
let OutOperandList = (outs);
let InOperandList = (ins);
field bits<16> Inst;
let Inst = 0xAAAA;
let AsmString = "foo";
field bits<16> SoftFail = 0;
// This is the important bit:
let Predicates = [Pred1, Pred2];
}
// CHECK: return (Bits[arch::AssemblerCondition2]);
|
{
"pile_set_name": "Github"
}
|
'use strict';
const KafkaClient = require('../../lib/kafkaClient');
const HighLevelProducer = require('../../lib/highLevelProducer');
const async = require('async');
const uuid = require('uuid');
function sendMessage (message, topic, done, attributes = 0) {
var client = new KafkaClient({ kafkaHost: '127.0.0.1:9092' });
var producer = new HighLevelProducer(client, { requireAcks: 1 });
client.on('connect', function () {
async.each(
message,
function (message, callback) {
producer.send([{ topic: topic, messages: message, key: uuid.v4(), attributes, timestamp: Date.now() }], callback);
},
function (error) {
if (error) {
done(error);
} else {
producer.close(function () {
done(null);
});
}
}
);
});
}
module.exports = sendMessage;
|
{
"pile_set_name": "Github"
}
|
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.explode = explode;
exports.verify = verify;
exports.merge = merge;
var virtualTypes = _interopRequireWildcard(require("./path/lib/virtual-types"));
var t = _interopRequireWildcard(require("@babel/types"));
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function explode(visitor) {
if (visitor._exploded) return visitor;
visitor._exploded = true;
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
const parts = nodeType.split("|");
if (parts.length === 1) continue;
const fns = visitor[nodeType];
delete visitor[nodeType];
for (const part of parts) {
visitor[part] = fns;
}
}
verify(visitor);
delete visitor.__esModule;
ensureEntranceObjects(visitor);
ensureCallbackArrays(visitor);
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
const wrapper = virtualTypes[nodeType];
if (!wrapper) continue;
const fns = visitor[nodeType];
for (const type of Object.keys(fns)) {
fns[type] = wrapCheck(wrapper, fns[type]);
}
delete visitor[nodeType];
if (wrapper.types) {
for (const type of wrapper.types) {
if (visitor[type]) {
mergePair(visitor[type], fns);
} else {
visitor[type] = fns;
}
}
} else {
mergePair(visitor, fns);
}
}
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
const fns = visitor[nodeType];
let aliases = t.FLIPPED_ALIAS_KEYS[nodeType];
const deprecratedKey = t.DEPRECATED_KEYS[nodeType];
if (deprecratedKey) {
console.trace(`Visitor defined for ${nodeType} but it has been renamed to ${deprecratedKey}`);
aliases = [deprecratedKey];
}
if (!aliases) continue;
delete visitor[nodeType];
for (const alias of aliases) {
const existing = visitor[alias];
if (existing) {
mergePair(existing, fns);
} else {
visitor[alias] = Object.assign({}, fns);
}
}
}
for (const nodeType of Object.keys(visitor)) {
if (shouldIgnoreKey(nodeType)) continue;
ensureCallbackArrays(visitor[nodeType]);
}
return visitor;
}
function verify(visitor) {
if (visitor._verified) return;
if (typeof visitor === "function") {
throw new Error("You passed `traverse()` a function when it expected a visitor object, " + "are you sure you didn't mean `{ enter: Function }`?");
}
for (const nodeType of Object.keys(visitor)) {
if (nodeType === "enter" || nodeType === "exit") {
validateVisitorMethods(nodeType, visitor[nodeType]);
}
if (shouldIgnoreKey(nodeType)) continue;
if (t.TYPES.indexOf(nodeType) < 0) {
throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type`);
}
const visitors = visitor[nodeType];
if (typeof visitors === "object") {
for (const visitorKey of Object.keys(visitors)) {
if (visitorKey === "enter" || visitorKey === "exit") {
validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
} else {
throw new Error("You passed `traverse()` a visitor object with the property " + `${nodeType} that has the invalid property ${visitorKey}`);
}
}
}
}
visitor._verified = true;
}
function validateVisitorMethods(path, val) {
const fns = [].concat(val);
for (const fn of fns) {
if (typeof fn !== "function") {
throw new TypeError(`Non-function found defined in ${path} with type ${typeof fn}`);
}
}
}
function merge(visitors, states = [], wrapper) {
const rootVisitor = {};
for (let i = 0; i < visitors.length; i++) {
const visitor = visitors[i];
const state = states[i];
explode(visitor);
for (const type of Object.keys(visitor)) {
let visitorType = visitor[type];
if (state || wrapper) {
visitorType = wrapWithStateOrWrapper(visitorType, state, wrapper);
}
const nodeVisitor = rootVisitor[type] = rootVisitor[type] || {};
mergePair(nodeVisitor, visitorType);
}
}
return rootVisitor;
}
function wrapWithStateOrWrapper(oldVisitor, state, wrapper) {
const newVisitor = {};
for (const key of Object.keys(oldVisitor)) {
let fns = oldVisitor[key];
if (!Array.isArray(fns)) continue;
fns = fns.map(function (fn) {
let newFn = fn;
if (state) {
newFn = function (path) {
return fn.call(state, path, state);
};
}
if (wrapper) {
newFn = wrapper(state.key, key, newFn);
}
if (newFn !== fn) {
newFn.toString = () => fn.toString();
}
return newFn;
});
newVisitor[key] = fns;
}
return newVisitor;
}
function ensureEntranceObjects(obj) {
for (const key of Object.keys(obj)) {
if (shouldIgnoreKey(key)) continue;
const fns = obj[key];
if (typeof fns === "function") {
obj[key] = {
enter: fns
};
}
}
}
function ensureCallbackArrays(obj) {
if (obj.enter && !Array.isArray(obj.enter)) obj.enter = [obj.enter];
if (obj.exit && !Array.isArray(obj.exit)) obj.exit = [obj.exit];
}
function wrapCheck(wrapper, fn) {
const newFn = function (path) {
if (wrapper.checkPath(path)) {
return fn.apply(this, arguments);
}
};
newFn.toString = () => fn.toString();
return newFn;
}
function shouldIgnoreKey(key) {
if (key[0] === "_") return true;
if (key === "enter" || key === "exit" || key === "shouldSkip") return true;
if (key === "blacklist" || key === "noScope" || key === "skipKeys") {
return true;
}
return false;
}
function mergePair(dest, src) {
for (const key of Object.keys(src)) {
dest[key] = [].concat(dest[key] || [], src[key]);
}
}
|
{
"pile_set_name": "Github"
}
|
<Flex justify="between" style={[tableStyle.mainWrapper, tableStyle.noData]}>
<FlexItem flex>
<ActivityIndicator animating size="large"/>
<Text style={tableStyle.noDataText}>数据加载中。。。</Text>
</FlexItem>
</Flex>
|
{
"pile_set_name": "Github"
}
|
# exception classes
class TrelbyError(Exception):
def __init__(self, msg):
Exception.__init__(self, msg)
self.msg = msg
def __str__(self):
return str(self.msg)
class ConfigError(TrelbyError):
def __init__(self, msg):
TrelbyError.__init__(self, msg)
class MiscError(TrelbyError):
def __init__(self, msg):
TrelbyError.__init__(self, msg)
|
{
"pile_set_name": "Github"
}
|
#%RAML 0.8
title: Reserved parameter
resourceTypes:
- collection:
get:
description: Get list of <<resourcePathName>> at <<resourcePath>>
/songs:
type: collection
|
{
"pile_set_name": "Github"
}
|
/* Generated by RuntimeBrowser.
*/
@protocol SFXPCInterface
@optional
- (void)deviceDiscoveryDeviceChanged:(SFDevice *)arg1 changes:(unsigned int)arg2;
- (void)deviceDiscoveryFoundDevice:(SFDevice *)arg1;
- (void)deviceDiscoveryLostDevice:(SFDevice *)arg1;
- (void)remoteInteractionSessionTextSessionDidBegin:(SFRemoteTextSessionInfo *)arg1;
- (void)remoteInteractionSessionTextSessionDidChange:(SFRemoteTextSessionInfo *)arg1;
- (void)remoteInteractionSessionTextSessionDidEnd:(SFRemoteTextSessionInfo *)arg1;
- (void)serviceError:(NSError *)arg1;
- (void)serviceReceivedEvent:(SFEventMessage *)arg1;
- (void)serviceReceivedRequest:(SFRequestMessage *)arg1;
- (void)serviceReceivedResponse:(SFResponseMessage *)arg1;
- (void)sessionError:(NSError *)arg1;
- (void)sessionReceivedEvent:(SFEventMessage *)arg1;
- (void)sessionReceivedRequest:(SFRequestMessage *)arg1;
- (void)sessionReceivedResponse:(SFResponseMessage *)arg1;
@end
|
{
"pile_set_name": "Github"
}
|
#include "ClassifierUnitTestHelper.h"
//Unit tests for the GRT SVM module
// Tests the default constructor
TEST(SVM, TestDefaultConstructor) {
GRT::ClassifierUnitTestHelper<GRT::SVM> tester;
EXPECT_TRUE( tester.testDefaultConstructor() );
}
// Tests the copy constructor
TEST(SVM, TestCopyConstructor) {
GRT::ClassifierUnitTestHelper<GRT::SVM> tester;
EXPECT_TRUE( tester.testCopyConstructor() );
}
// Tests the main train/prediction functions using a basic dataset
TEST(SVM, TestBasicTrainPredictFunctions ) {
GRT::ClassifierUnitTestHelper<GRT::SVM> tester;
EXPECT_TRUE( tester.testBasicTrainPredictFunctions() );
}
// Tests the learning algorithm on a basic dataset
TEST(SVM, TrainGaussDataset) {
GRT::ClassifierUnitTestHelper<GRT::SVM> tester;
EXPECT_TRUE( tester.testTrainGaussLinearDataset() );
}
int main(int argc, char **argv) {
::testing::InitGoogleTest( &argc, argv );
return RUN_ALL_TESTS();
}
|
{
"pile_set_name": "Github"
}
|
# Privilege
## READ_WRITE
## READ_ONLY
## REDUCE
## WRITE_DISCARD
|
{
"pile_set_name": "Github"
}
|
from __future__ import print_function
import os
import math
import json
import logging
import numpy as np
from PIL import Image
from datetime import datetime
def prepare_dirs_and_logger(config):
formatter = logging.Formatter("%(asctime)s:%(levelname)s::%(message)s")
logger = logging.getLogger()
for hdlr in logger.handlers:
logger.removeHandler(hdlr)
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger.addHandler(handler)
if config.load_checkpoint:
#if config.load_path.startswith(config.log_dir):
# config.model_dir = config.load_path
#else:
# if config.load_path.startswith(config.dataset):
# config.model_name = config.load_path
# else:
config.model_name = config.checkpoint_name
else:
config.model_name = "%s_%.6f_%.6f_%s" % (get_time(), config.d_lr, config.g_lr, config.update_k)
if not hasattr(config, 'model_dir'):
config.model_dir = os.path.join(config.log_dir, config.model_name)
config.data_path = os.path.join(config.data_dir, config.dataset)
for path in [config.log_dir, config.data_dir, config.model_dir]:
if not os.path.exists(path):
os.makedirs(path)
def get_time():
return datetime.now().strftime("%m%d_%H%M%S")
def save_config(config):
param_path = os.path.join(config.model_dir, "params.json")
print("[*] MODEL dir: %s" % config.model_dir)
print("[*] PARAM path: %s" % param_path)
with open(param_path, 'w') as fp:
json.dump(config.__dict__, fp, indent=4, sort_keys=True)
def rank(array):
return len(array.shape)
def make_grid(tensor, nrow=8, padding=2,
normalize=False, scale_each=False):
"""Code based on https://github.com/pytorch/vision/blob/master/torchvision/utils.py"""
nmaps = tensor.shape[0]
xmaps = min(nrow, nmaps)
ymaps = int(math.ceil(float(nmaps) / xmaps))
height, width = int(tensor.shape[1] + padding), int(tensor.shape[2] + padding)
grid = np.zeros([height * ymaps + 1 + padding // 2, width * xmaps + 1 + padding // 2, 3], dtype=np.uint8)
k = 0
for y in range(ymaps):
for x in range(xmaps):
if k >= nmaps:
break
h, h_width = y * height + 1 + padding // 2, height - padding
w, w_width = x * width + 1 + padding // 2, width - padding
grid[h:h+h_width, w:w+w_width] = tensor[k]
k = k + 1
return grid
def save_image(tensor, filename, nrow=8, padding=2,
normalize=False, scale_each=False):
ndarr = make_grid(tensor, nrow=nrow, padding=padding,
normalize=normalize, scale_each=scale_each)
im = Image.fromarray(ndarr)
im.save(filename)
|
{
"pile_set_name": "Github"
}
|
/* This file should be localized in Tamil */
/* Aspect Ratio */
"aspect_ratio" = "புலன் விகிதம்";
"original" = "மூலமுதலான";
"square" = "சதுர";
/* No Screenshots */
"no_screenshots_title" = "திரைக்காட்சிகள் இல்லை";
"no_screenshots_description" = "நீங்கள் உங்கள் iOS சாதனம் திரையில் உள்ளதை கைப்பற் தூக்கம் / விழித்தெழு நிலையில் முகப்பு பொத்தான்களை பயன்படுத்தவும்.";
"photo_access_denied_title" = "கலை காட்சி கூடம் அணுகல் மறுக்கப்பட்டது";
"photo_access_denied_description" = "கலை காட்சி கூடம் அணுக முடியவில்லை, அணுகல் மாற்ற அமைப்புகள் சென்று அனுமதி கொடுக்க.";
/* Open Screenshots */
"camera" = "நிழற்படக் கருவி";
"photo_library" = "கலை காட்சி கூடம்";
/* Ruler Ratio It's like 1x, 2x, 3x */
"change_scale_multiplier" = "சாதனம் அளவு விகிதத்தை மாற்ற";
/* Sharing Text */
"mail_sent" = "மின்னஞ்சல் அனுப்பப்பட்டது";
"mail_body" = "\n\n நீங்கள் தற்போது '%1$@' உடன் iOS '%2$@', பதிப்பு '%3$@' இன் '%4$@'";
"mail_device_configuration_message" = "உங்கள் சாதனம் மின்னஞ்சல் அனுப்ப உள்ளமைக்கப்படவில்லை";
"screen_ruler_bug_report" = "Screen Ruler - பிழை அறிக்கை";
"screen_ruler_feedback" = "Screen Ruler - உங்கள் கருத்து";
/* Help Tour. */
"skip" = "தவிர்";
"start_help_tour" = "உதவி சுற்றுப் பயணத்தை தொடங்கு";
"tap_to_continue" = "தொடர, திரையில் தொட்டு";
"horizontal_scale_help" = "உங்கள் தேவையை பொறுத்து உங்கள் விரல்களால் கிடைமட்ட அளவில் சரிசெய்க";
"vertical_scale_help" = "உங்கள் தேவையை பொறுத்து உங்கள் விரல்களால் செங்குத்து அளவில் சரிசெய்க";
"device_scale_help" = "சாதனம் அளவு பெருக்கியைக் தேர்வு செய்க சாதனத்தின் தெளிவுத்திறனை பொறுத்து அல்லது உங்கள் தேவையை பொறுத்து";
"double_tap_help" = "புகைப்படத்தை ஒரு விரலை பயன்படுத்தி இருமுறை தட்டினால் பெரிதாக்கவும், இரு விரல்களைப் பயன்படுத்த இருமுறை தட்டினால் சிறிதாக்கும்";
"long_tap_color_help" = "நீண்ட நேரம் அழுத்தி மற்றும் இழுத்தல் துணுக்கின் RGB வண்ண காட்ட பார்க்கலாம்";
"long_tap_scale_help" = "மேலும் விருப்பத்தேர்வுகளைக் காட்ட நீண்ட நேரம் கிடைமட்ட அல்லது செங்குத்து அளவில் அழுத்தவும்";
/* Buttons */
"back" = "பின்செல்";
"cancel" = "ரத்து";
"done" = "முடிந்தது";
"ok" = "சரி";
"open" = "திற";
/* Social Share. */
"share_photo" = "புகைப்படத்தை பகிர்";
"social_share_text" = "'%@' பாருங்கள். மொபைல் பயன்பாடு மற்றும் QA தோழர்களே iOS பயன்பாட்டை பயனர் இடைமுகம் விவரங்கள் பிரித்தெடுக்க மற்றும் திரைக்காட்சிகளுடன் விவரங்களை பார்க்க அது உண்மையில் பயனுள்ளதாக இருக்கிறது. அது உண்மையில் உன்னை மகிழ்ச்சியூட்டுவதாகும்.";
/* Resizing */
"custom" = "தனிப்பயன்";
"enter_width_and_height" = "அகலம் மற்றும் உயரத்தை உள்ளிடுக";
"height" = "உயரம்";
"width" = "அகலம்";
"resize" = "அளவை மாற்றி அமை";
"crop" = "படத்தை நுனிவெட்டு";
"resize_screenshot" = "திரைக்காட்சி அளவை மாற்றி அமை";
/* Change Scale X Y. */
"reset_scale_to_original" = "ஆரம்ப அளவிள் மீட்டமை";
"set_scale_point_location" = "அளவு புள்ளி இடத்தை அமை";
"mark_as_x_reference" = "X என குறி";
"mark_as_y_reference" = "Y என குறி";
/* Angle Calculation */
"enter_angle_title" = "Enter angle in degree";
"enter_angle_description" = "Angle should be a value between %1$d and %2$d, if it's any other value than this then we'll use modulus value of entered value from %3$d";
/* Zoom Scale */
"zoom_scale" = "பெரிதாக்க அளவுகோல்";
"minimum_percent" = "குறைந்தபட்ச அளவுகோல் (%.0f%%)";
"original_percent" = "மூலமுதலான (%.0f%%)";
"show_zoom_options" = "பெரிதாக்க விருப்பங்களை காட்டு";
/* Crop Info */
"x_y_width_height" = "X: %1$.0f, Y: %2$.0f\அகலம்: %3$.0f, உயரம்: %4$.0f";
/* RGB Colro Point */
"X: %.0f, Y: %.0f" = "X: %1$.0f, Y: %2$.0f";
"X: NA, Y: NA" = "X: பொருந்தாது, Y: பொருந்தாது";
/* Settings */
"settings" = "அமைப்புகள்";
"color_theme" = "வண்ண ஆய்வுப்பெருள்";
"natural" = "இயற்கை";
"inverted" = "எதிர் மாறான";
"social" = "சமூக";
"share_on_social_network" = "சமூக வலைப்பின்னல் பகிர்";
"rate_us_on_app_store" = "App Store இல் எங்களை மதிப்பிட";
"feedback" = "உங்கள் கருத்து";
"bug_report" = "பிழை அறிக்கை";
"terms" = "விதிமுறை";
"terms_and_conditions" = "விதிமுறைகள் மற்றும் நிபந்தனைகள்";
"open_source_libraries" = "திறந்த மூல நூலகங்கள்";
"you_are_upto_date" = "அனைத்தும் புதுப்பித்த நிலையில் உள்ளன";
"update_now" = "இப்போது புதுப்பி";
"is_open_source_at" = "திறந்தமூல மென்பொருள்:";
"infoenum_software_systems" = "InfoEnum Software Systems";
"debug" = "பிழைதிருத்து";
"developer_options" = "படைப்பாளி விருப்பங்கள்";
"open_safari?" = "சஃபாரியில் திறக்கவா?";
"show_touches" = "தொடுதலைக் காட்டு";
"in_use_memory" = "பயன்பாட்டு நினைவகத்தில் இருக்கும்";
"virtual_memory" = "மெய்நிகர் நினைவகம்";
/* Other. */
"error" = "பிழை";
"version" = "பதிப்பு";
"image_load_error" = "படத்தை ஏற்றுவதில் பிழை உள்ளது. தயவு செய்து மீண்டும் முயற்சிக்கவும்.";
/*
******************************************
// Localized App Name (show in iOS device screen)
Screen Ruler
******************************************
// App Store Localized Full Name
Screen Ruler - Pixel Perfect Screenshot Ruler
******************************************
Tamil App Store Localization not supported
*/
|
{
"pile_set_name": "Github"
}
|
#pragma once
/** @addtogroup coreSystem
*
* @{
*/
template<typename T>
/**
* An array-wrapper that will align the array along full cache lines.
*/
/*
#ifdef RUNTIME_STATIC_LINKING
class AlignedArray
#else
*/
class BOOST_EXTENSION_SIMVARS_DECL AlignedArray
/*#endif*/
{
private:
T *array;
public:
AlignedArray(int numberOfElements)
{
array = new T[numberOfElements];
}
~AlignedArray()
{
delete[] array;
}
void* operator new(size_t size)
{
//see: http://stackoverflow.com/questions/12504776/aligned-malloc-in-c
void *p1;
void **p2;
size_t alignment = 64;
int offset = alignment - 1 + sizeof(void*);
p1 = malloc(size + offset);
p2 = (void**) (((size_t) (p1) + offset) & ~(alignment - 1));
p2[-1] = p1; //line 6
if (((size_t) p2) % 64 != 0)
throw std::runtime_error("Memory was not aligned correctly!");
return p2;
}
void operator delete(void *p)
{
void* p1 = ((void**) p)[-1]; // get the pointer to the buffer we allocated
free(p1);
}
FORCE_INLINE T* get()
{
return array;
}
};
/**
* SimVars class, implements ISimVars interface
* SimVars stores all model variable in continuous block of memory
*/
/*
#ifdef RUNTIME_STATIC_LINKING
class SimVars: public ISimVars
#else*/
class BOOST_EXTENSION_SIMVARS_DECL SimVars: public ISimVars
/*#endif*/
{
public:
SimVars(size_t dim_real, size_t dim_int, size_t dim_bool, size_t dim_string, size_t dim_pre_vars, size_t dim_state_vars, size_t state_index);
SimVars(SimVars& instance);
ISimVars* clone();
virtual ~SimVars();
virtual double& initRealVar(size_t i);
virtual int& initIntVar(size_t i);
virtual bool& initBoolVar(size_t i);
virtual string& initStringVar(size_t i);
virtual double* getStateVector();
virtual double* getDerStateVector();
virtual double* getRealVarsVector() const;
virtual int* getIntVarsVector() const;
virtual bool* getBoolVarsVector() const;
virtual string* getStringVarsVector() const;
virtual void setRealVarsVector(const double* vars);
virtual void setIntVarsVector(const int* vars);
virtual void setBoolVarsVector(const bool* vars);
virtual void setStringVarsVector(const string* vars);
virtual const double& getRealVar(size_t i);
virtual const int& getIntVar(size_t i);
virtual const bool& getBoolVar(size_t i);
virtual const std::string& getStringVar(size_t i);
virtual double* initRealArrayVar(size_t size, size_t start_index);
virtual int* initIntArrayVar(size_t size, size_t start_index);
virtual bool* initBoolArrayVar(size_t size, size_t start_index);
virtual string* initStringArrayVar(size_t size, size_t start_index);
virtual void initRealAliasArray(int indices[], size_t n, double* ref_data[]);
virtual void initIntAliasArray(int indices[], size_t n, int* ref_data[]);
virtual void initBoolAliasArray(int indices[], size_t n, bool* ref_data[]);
virtual void initStringAliasArray(int indices[], size_t n, string* ref_data[]);
virtual void initRealAliasArray(std::vector<int> indices, double* ref_data[]);
virtual void initIntAliasArray(std::vector<int> indices, int* ref_data[]);
virtual void initBoolAliasArray(std::vector<int> indices, bool* ref_data[]);
virtual void initStringAliasArray(std::vector<int> indices, string* ref_data[]);
virtual void savePreVariables();
virtual void initPreVariables();
virtual double& getPreVar(const double& var);
virtual int& getPreVar(const int& var);
virtual bool& getPreVar(const bool& var);
virtual std::string& getPreVar(const std::string& var);
virtual size_t getDimString() const;
virtual size_t getDimBool() const;
virtual size_t getDimInt() const;
virtual size_t getDimPreVars() const;
virtual size_t getDimReal() const;
virtual size_t getDimStateVars() const;
virtual size_t getStateVectorIndex() const;
protected:
void create(size_t dim_real, size_t dim_int, size_t dim_bool, size_t dim_string, size_t dim_pre_vars, size_t dim_state_vars, size_t state_index);
void *alignedMalloc(size_t required_bytes, size_t alignment);
void alignedFree(void* p);
private:
double* getRealVarPtr(size_t i);
int* getIntVarPtr(size_t i);
bool* getBoolVarPtr(size_t i);
string* getStringVarPtr(size_t i);
size_t _dim_real; //number of all real variables (real algebraic vars,discrete algebraic vars, state vars, der state vars)
size_t _dim_int; // number of all integer variables (integer algebraic vars)
size_t _dim_bool; // number of all bool variables (boolean algebraic vars)
size_t _dim_string; // number of all string variables (string algebraic vars)
size_t _dim_pre_vars; //number of all pre variables (real algebraic vars,discrete algebraic vars, boolean algebraic vars, integer algebraic vars, state vars, der state vars)
size_t _dim_z; // number of all state variables
size_t _z_i; //start index of state vector in real_vars list
double *_real_vars; //array for all model real variables of size dim_real
int* _int_vars; //array for all model int variables of size dim_int
bool* _bool_vars; //array for all model bool variables of size dim_bool
string* _string_vars; //array for all model string variables of size dim_string
//Stores all variables occurred before an event
double* _pre_real_vars;
int* _pre_int_vars;
bool* _pre_bool_vars;
std::string* _pre_string_vars;
};
/** @} */ // end of coreSystem
|
{
"pile_set_name": "Github"
}
|
/**
* 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/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.api.handler;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.util.Date;
import org.junit.jupiter.api.Test;
import org.openmrs.Person;
import org.openmrs.User;
/**
* Tests the {@link PersonUnvoidHandler} class.
*/
public class PersonUnvoidHandlerTest {
/**
* @see PersonUnvoidHandler#handle(Person,User,Date,String)
*/
@Test
public void handle_shouldUnsetThePersonVoidedBit() {
UnvoidHandler<Person> handler = new PersonUnvoidHandler();
Person person = new Person();
person.setPersonVoided(true); // make sure personVoided is set
handler.handle(person, null, null, null);
assertFalse(person.getPersonVoided());
}
/**
* @see PersonUnvoidHandler#handle(Person,User,Date,String)
*/
@Test
public void handle_shouldUnsetThePersonVoider() {
UnvoidHandler<Person> handler = new PersonUnvoidHandler();
Person person = new Person();
person.setPersonVoided(true);
person.setPersonVoidedBy(new User(1));
handler.handle(person, null, null, null);
assertNull(person.getPersonVoidedBy());
}
/**
* @see PersonUnvoidHandler#handle(Person,User,Date,String)
*/
@Test
public void handle_shouldUnsetThePersonDateVoided() {
UnvoidHandler<Person> handler = new PersonUnvoidHandler();
Person person = new Person();
person.setPersonVoided(true);
person.setPersonDateVoided(new Date());
handler.handle(person, null, null, null);
assertNull(person.getPersonDateVoided());
}
/**
* @see PersonUnvoidHandler#handle(Person,User,Date,String)
*/
@Test
public void handle_shouldUnsetThePersonVoidReason() {
UnvoidHandler<Person> handler = new PersonUnvoidHandler();
Person person = new Person();
person.setPersonVoided(true);
person.setPersonVoidReason("SOME REASON");
handler.handle(person, null, null, null);
assertNull(person.getPersonVoidReason());
}
/**
* @see PersonUnvoidHandler#handle(Person,User,Date,String)
*/
@Test
public void handle_shouldOnlyActOnAlreadyVoidedObjects() {
UnvoidHandler<Person> handler = new PersonUnvoidHandler();
Person person = new Person();
person.setPersonVoided(false);
handler.handle(person, null, null, "SOME REASON");
assertNull(person.getPersonVoidReason());
}
/**
* @see PersonUnvoidHandler#handle(Person,User,Date,String)
*/
@Test
public void handle_shouldNotActOnObjectsWithADifferentPersonDateVoided() {
Date d = new Date(new Date().getTime() - 1000); // a time that isn't right now
UnvoidHandler<Person> handler = new PersonUnvoidHandler();
Person person = new Person();
person.setPersonVoided(true);
person.setPersonDateVoided(d);
handler.handle(person, null, new Date(), "SOME REASON");
assertTrue(person.getPersonVoided());
}
}
|
{
"pile_set_name": "Github"
}
|
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{C25E055D-DBB5-4B7D-863C-40B12712B0CE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ZKEACMS.Core", "ZKEACMS.Core", "{63653A41-AD32-4004-8934-D02BFAB493FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ZKEASOFT.CMS.Web", "Easy.CMS.Web\ZKEASOFT.CMS.Web.csproj", "{C2DCE03D-6FA4-4461-B5E3-761D7B0C1B0A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.CMS.Product", "Easy.CMS.Web\Modules\Product\Easy.CMS.Product.csproj", "{A333A4DA-7A52-4E32-B7CA-6ADC1990B09E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.CMS.Common", "Easy.CMS.Web\Modules\Common\Easy.CMS.Common.csproj", "{C4A0DA07-F772-4EAE-8F7E-768EF2D801A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.CMS.Article", "Easy.CMS.Web\Modules\Article\Easy.CMS.Article.csproj", "{14E79FF7-4DBA-47A7-9BED-1D775FA93E43}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.Web.CMS", "EasyFrameWork.CMS\Easy.Web.CMS.csproj", "{2E8362AE-80D6-43E0-B3BF-CAB6D888D154}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.CMS.Section", "Easy.CMS.Web\Modules\Section\Easy.CMS.Section.csproj", "{AE0623C5-EF7D-4BAC-9E9C-3E37E81A57D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.CMS.Breadcrumb", "Easy.CMS.Web\Modules\Breadcrumb\Easy.CMS.Breadcrumb.csproj", "{059B5837-2FB3-43B0-AB7F-470B44588009}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.CMS.Message", "Easy.CMS.Web\Modules\Message\Easy.CMS.Message.csproj", "{D1E0BEA0-D9BB-4330-9813-235FB8A447AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy", "EasyFrameWork\Easy.csproj", "{EDB1BAA7-EC61-4292-BBE5-3BC39EB171E4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Easy.Web", "EasyFrameWork.Web\Easy.Web.csproj", "{A1228125-F5C4-4001-AC7D-1ACCF1679828}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyZip", "EasyZip\EasyZip.csproj", "{02422207-726E-498A-8FAE-848C78BBBF97}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LayoutsCompiler", "Easy.CMS.Web\Modules\LayoutEngine\LayoutsCompiler.csproj", "{19C1529D-2F17-4100-A0BF-C905C909B568}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C2DCE03D-6FA4-4461-B5E3-761D7B0C1B0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C2DCE03D-6FA4-4461-B5E3-761D7B0C1B0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C2DCE03D-6FA4-4461-B5E3-761D7B0C1B0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C2DCE03D-6FA4-4461-B5E3-761D7B0C1B0A}.Release|Any CPU.Build.0 = Release|Any CPU
{A333A4DA-7A52-4E32-B7CA-6ADC1990B09E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A333A4DA-7A52-4E32-B7CA-6ADC1990B09E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A333A4DA-7A52-4E32-B7CA-6ADC1990B09E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A333A4DA-7A52-4E32-B7CA-6ADC1990B09E}.Release|Any CPU.Build.0 = Release|Any CPU
{C4A0DA07-F772-4EAE-8F7E-768EF2D801A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C4A0DA07-F772-4EAE-8F7E-768EF2D801A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C4A0DA07-F772-4EAE-8F7E-768EF2D801A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C4A0DA07-F772-4EAE-8F7E-768EF2D801A4}.Release|Any CPU.Build.0 = Release|Any CPU
{14E79FF7-4DBA-47A7-9BED-1D775FA93E43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14E79FF7-4DBA-47A7-9BED-1D775FA93E43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14E79FF7-4DBA-47A7-9BED-1D775FA93E43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14E79FF7-4DBA-47A7-9BED-1D775FA93E43}.Release|Any CPU.Build.0 = Release|Any CPU
{2E8362AE-80D6-43E0-B3BF-CAB6D888D154}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2E8362AE-80D6-43E0-B3BF-CAB6D888D154}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2E8362AE-80D6-43E0-B3BF-CAB6D888D154}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2E8362AE-80D6-43E0-B3BF-CAB6D888D154}.Release|Any CPU.Build.0 = Release|Any CPU
{AE0623C5-EF7D-4BAC-9E9C-3E37E81A57D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE0623C5-EF7D-4BAC-9E9C-3E37E81A57D2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE0623C5-EF7D-4BAC-9E9C-3E37E81A57D2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE0623C5-EF7D-4BAC-9E9C-3E37E81A57D2}.Release|Any CPU.Build.0 = Release|Any CPU
{059B5837-2FB3-43B0-AB7F-470B44588009}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{059B5837-2FB3-43B0-AB7F-470B44588009}.Debug|Any CPU.Build.0 = Debug|Any CPU
{059B5837-2FB3-43B0-AB7F-470B44588009}.Release|Any CPU.ActiveCfg = Release|Any CPU
{059B5837-2FB3-43B0-AB7F-470B44588009}.Release|Any CPU.Build.0 = Release|Any CPU
{D1E0BEA0-D9BB-4330-9813-235FB8A447AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D1E0BEA0-D9BB-4330-9813-235FB8A447AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D1E0BEA0-D9BB-4330-9813-235FB8A447AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D1E0BEA0-D9BB-4330-9813-235FB8A447AF}.Release|Any CPU.Build.0 = Release|Any CPU
{EDB1BAA7-EC61-4292-BBE5-3BC39EB171E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDB1BAA7-EC61-4292-BBE5-3BC39EB171E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDB1BAA7-EC61-4292-BBE5-3BC39EB171E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDB1BAA7-EC61-4292-BBE5-3BC39EB171E4}.Release|Any CPU.Build.0 = Release|Any CPU
{A1228125-F5C4-4001-AC7D-1ACCF1679828}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1228125-F5C4-4001-AC7D-1ACCF1679828}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1228125-F5C4-4001-AC7D-1ACCF1679828}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1228125-F5C4-4001-AC7D-1ACCF1679828}.Release|Any CPU.Build.0 = Release|Any CPU
{02422207-726E-498A-8FAE-848C78BBBF97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{02422207-726E-498A-8FAE-848C78BBBF97}.Debug|Any CPU.Build.0 = Debug|Any CPU
{02422207-726E-498A-8FAE-848C78BBBF97}.Release|Any CPU.ActiveCfg = Release|Any CPU
{02422207-726E-498A-8FAE-848C78BBBF97}.Release|Any CPU.Build.0 = Release|Any CPU
{19C1529D-2F17-4100-A0BF-C905C909B568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19C1529D-2F17-4100-A0BF-C905C909B568}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19C1529D-2F17-4100-A0BF-C905C909B568}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19C1529D-2F17-4100-A0BF-C905C909B568}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A333A4DA-7A52-4E32-B7CA-6ADC1990B09E} = {C25E055D-DBB5-4B7D-863C-40B12712B0CE}
{C4A0DA07-F772-4EAE-8F7E-768EF2D801A4} = {C25E055D-DBB5-4B7D-863C-40B12712B0CE}
{14E79FF7-4DBA-47A7-9BED-1D775FA93E43} = {C25E055D-DBB5-4B7D-863C-40B12712B0CE}
{2E8362AE-80D6-43E0-B3BF-CAB6D888D154} = {63653A41-AD32-4004-8934-D02BFAB493FE}
{AE0623C5-EF7D-4BAC-9E9C-3E37E81A57D2} = {C25E055D-DBB5-4B7D-863C-40B12712B0CE}
{059B5837-2FB3-43B0-AB7F-470B44588009} = {C25E055D-DBB5-4B7D-863C-40B12712B0CE}
{D1E0BEA0-D9BB-4330-9813-235FB8A447AF} = {C25E055D-DBB5-4B7D-863C-40B12712B0CE}
{EDB1BAA7-EC61-4292-BBE5-3BC39EB171E4} = {63653A41-AD32-4004-8934-D02BFAB493FE}
{A1228125-F5C4-4001-AC7D-1ACCF1679828} = {63653A41-AD32-4004-8934-D02BFAB493FE}
{02422207-726E-498A-8FAE-848C78BBBF97} = {63653A41-AD32-4004-8934-D02BFAB493FE}
{19C1529D-2F17-4100-A0BF-C905C909B568} = {63653A41-AD32-4004-8934-D02BFAB493FE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.2\lib\NET35
EndGlobalSection
EndGlobal
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Database expressions can be used to add unescaped SQL fragments to a
* [Database_Query_Builder] object.
*
* For example, you can use an expression to generate a column alias:
*
* // SELECT CONCAT(first_name, last_name) AS full_name
* $query = DB::select(array(DB::expr('CONCAT(first_name, last_name)'), 'full_name')));
*
* More examples are available on the [Query Builder](database/query/builder#database-expressions) page
*
* @package Kohana/Database
* @category Base
* @author Kohana Team
* @copyright (c) Kohana Team
* @license https://koseven.ga/LICENSE.md
*/
class Kohana_Database_Expression {
// Unquoted parameters
protected $_parameters;
// Raw expression string
protected $_value;
/**
* Sets the expression string.
*
* $expression = new Database_Expression('COUNT(users.id)');
*
* @param string $value raw SQL expression string
* @param array $parameters unquoted parameter values
* @return void
*/
public function __construct($value, $parameters = [])
{
// Set the expression string
$this->_value = $value;
$this->_parameters = $parameters;
}
/**
* Bind a variable to a parameter.
*
* @param string $param parameter key to replace
* @param mixed $var variable to use
* @return $this
*/
public function bind($param, & $var)
{
$this->_parameters[$param] =& $var;
return $this;
}
/**
* Set the value of a parameter.
*
* @param string $param parameter key to replace
* @param mixed $value value to use
* @return $this
*/
public function param($param, $value)
{
$this->_parameters[$param] = $value;
return $this;
}
/**
* Add multiple parameter values.
*
* @param array $params list of parameter values
* @return $this
*/
public function parameters(array $params)
{
$this->_parameters = $params + $this->_parameters;
return $this;
}
/**
* Get the expression value as a string.
*
* $sql = $expression->value();
*
* @return string
*/
public function value()
{
return (string) $this->_value;
}
/**
* Return the value of the expression as a string.
*
* echo $expression;
*
* @return string
* @uses Database_Expression::value
*/
public function __toString()
{
return $this->value();
}
/**
* Compile the SQL expression and return it. Replaces any parameters with
* their given values.
*
* @param mixed Database instance or name of instance
* @return string
*/
public function compile($db = NULL)
{
if ( ! is_object($db))
{
// Get the database instance
$db = Database::instance($db);
}
$value = $this->value();
if ( ! empty($this->_parameters))
{
// Quote all of the parameter values
$params = array_map([$db, 'quote'], $this->_parameters);
// Replace the values in the expression
$value = strtr($value, $params);
}
return $value;
}
} // End Database_Expression
|
{
"pile_set_name": "Github"
}
|
{
"config": {
"abort": {
"already_configured": "Konto jest ju\u017c skonfigurowane"
},
"error": {
"connection_error": "B\u0142\u0105d po\u0142\u0105czenia z Tibber.",
"invalid_access_token": "Niepoprawny token dost\u0119pu",
"timeout": "Przekroczono limit czasu \u0142\u0105czenia z Tibber."
},
"step": {
"user": {
"data": {
"access_token": "Token dost\u0119pu"
},
"description": "Wprowad\u017a token dost\u0119pu z https://developer.tibber.com/settings/accesstoken",
"title": "Tibber"
}
}
},
"title": "Tibber"
}
|
{
"pile_set_name": "Github"
}
|
{
"name": "illuminate/contracts",
"description": "The Illuminate Contracts package.",
"license": "MIT",
"homepage": "https://laravel.com",
"support": {
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"require": {
"php": "^7.1.3",
"psr/container": "~1.0",
"psr/simple-cache": "~1.0"
},
"autoload": {
"psr-4": {
"Illuminate\\Contracts\\": ""
}
},
"extra": {
"branch-alias": {
"dev-master": "5.6-dev"
}
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev"
}
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh -eu
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
URL="http://ghfvs-installer.github.com"
GIT=0
LFS=0
GHU=0
FILE=""
VERSION=""
RN=""
MSG=""
OS=""
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-h)
URL="$2"
shift
shift
;;
-p)
FILE="--path $2"
shift
shift
;;
-v)
VERSION="--version $2"
shift
shift
;;
-r)
RN="--rn $2"
shift
shift
;;
-m)
MSG="--msg $2"
shift
shift
;;
-git)
GIT=1
shift # past value
;;
-lfs)
LFS=1
shift # past value
;;
-ghu)
GHU=1
shift # past value
;;
-windows)
OS="windows"
shift # past value
;;
-mac)
OS="mac"
shift # past value
;;
-linux)
OS="linux"
shift # past value
;;
esac
done
if [ x"$GIT" = "x0" -a x"$LFS" = "x0" -a x"$GHU" = "x0" ]; then
echo "Usage: generate-package.sh [-git|-lfs|-ghu] [-windows|-mac|-linux only if -git or -lfs] [-v version] [-p path to file] [-h host url (optional)] [-r release notes file (optional)] [-m message file (optional)]"
exit 1
fi
if [ x"$GHU" = x"1" ]; then
URL="--url $URL/unity/releases"
else
URL="--url $URL/unity/git/$OS"
fi
EXEC=
if [ ! -e "/c/" ]; then
EXEC=mono
fi
if [ ! -e "build/CommandLine/CommandLine.exe" ]; then
>&2 xbuild /target:CommandLine "$DIR/GitHub.Unity.sln" /verbosity:minimal
fi
$EXEC build/CommandLine/CommandLine.exe --gen-package $VERSION $FILE $URL $RN $MSG
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://www.seleniumhq.org/" />
<title>selenium download html</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">selenium download html</td></tr>
</thead><tbody>
<tr>
<td>open</td>
<td>/download/</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>link=CHANGELOG</td>
<td></td>
</tr>
<tr>
<td>assertTitle</td>
<td></td>
<td></td>
</tr>
<tr>
<td>verifyTitle</td>
<td></td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
'use strict';
const inquirer = require('inquirer');
/** editionSetup {Array} - Inquirer question logic for first question regarding editions */
const editionSetup = [
{
type: 'input',
name: 'project_root',
message: 'Please specify a directory for your Pattern Lab project.',
default: () => './',
},
{
type: 'list',
name: 'edition',
message: 'What templating language do you want to use with Pattern Lab?',
choices: [
{
name: 'Handlebars',
value: '@pattern-lab/edition-node',
},
{
name: 'Twig (PHP)',
value: '@pattern-lab/edition-twig',
},
new inquirer.Separator(),
{
name: 'None',
value: false,
},
],
default: function() {
return {
name: 'Handlebars',
value: '@pattern-lab/edition-node',
};
},
},
];
module.exports = editionSetup;
|
{
"pile_set_name": "Github"
}
|
#!/bin/sh
if ! updates_arch=$(checkupdates 2> /dev/null | wc -l ); then
updates_arch=0
fi
if ! updates_aur=$(yay -Qum 2> /dev/null | wc -l); then
# if ! updates_aur=$(cower -u 2> /dev/null | wc -l); then
# if ! updates_aur=$(trizen -Su --aur --quiet | wc -l); then
# if ! updates_aur=$(pikaur -Qua 2> /dev/null | wc -l); then
# if ! updates_aur=$(rua upgrade --printonly 2> /dev/null | wc -l); then
updates_aur=0
fi
updates=$(("$updates_arch" + "$updates_aur"))
if [ "$updates" -gt 0 ]; then
echo "# $updates"
else
echo ""
fi
|
{
"pile_set_name": "Github"
}
|
#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#define BOOST_SHARED_PTR_HPP_INCLUDED
//
// shared_ptr.hpp
//
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
// Copyright (c) 2001-2008 Peter Dimov
//
// 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)
//
// See http://www.boost.org/libs/smart_ptr/shared_ptr.htm for documentation.
//
#include <boost/smart_ptr/shared_ptr.hpp>
#endif // #ifndef BOOST_SHARED_PTR_HPP_INCLUDED
|
{
"pile_set_name": "Github"
}
|
/**
* Welsh translation for bootstrap-datepicker
* S. Morris <s.morris@bangor.ac.uk>
*/
;(function($){
$.fn.datepicker.dates['cy'] = {
days: ["Sul", "Llun", "Mawrth", "Mercher", "Iau", "Gwener", "Sadwrn", "Sul"],
daysShort: ["Sul", "Llu", "Maw", "Mer", "Iau", "Gwe", "Sad", "Sul"],
daysMin: ["Su", "Ll", "Ma", "Me", "Ia", "Gwe", "Sa", "Su"],
months: ["Ionawr", "Chewfror", "Mawrth", "Ebrill", "Mai", "Mehefin", "Gorfennaf", "Awst", "Medi", "Hydref", "Tachwedd", "Rhagfyr"],
monthsShort: ["Ion", "Chw", "Maw", "Ebr", "Mai", "Meh", "Gor", "Aws", "Med", "Hyd", "Tach", "Rha"],
today: "Heddiw"
};
}(jQuery));
|
{
"pile_set_name": "Github"
}
|
/*
* This file Copyright (C) 2012-2015 Mnemosyne LLC
*
* It may be used under the GNU GPL versions 2 or 3
* or any future license endorsed by Mnemosyne LLC.
*
*/
#include <QApplication>
#include <QStyle>
#include <QStylePainter>
#include "FilterBarComboBox.h"
#include "StyleHelper.h"
#include "Utils.h"
namespace
{
int getHSpacing(QWidget const* w)
{
return qMax(3, w->style()->pixelMetric(QStyle::PM_LayoutHorizontalSpacing, nullptr, w));
}
} // namespace
FilterBarComboBox::FilterBarComboBox(QWidget* parent) :
QComboBox(parent)
{
setSizeAdjustPolicy(QComboBox::AdjustToContents);
}
QSize FilterBarComboBox::minimumSizeHint() const
{
QFontMetrics fm(fontMetrics());
QSize const text_size = fm.boundingRect(itemText(0)).size();
QSize const count_size = fm.boundingRect(itemData(0, CountStringRole).toString()).size();
return calculateSize(text_size, count_size);
}
QSize FilterBarComboBox::sizeHint() const
{
QFontMetrics fm(fontMetrics());
QSize max_text_size(0, 0);
QSize max_count_size(0, 0);
for (int i = 0, n = count(); i < n; ++i)
{
QSize const text_size = fm.boundingRect(itemText(i)).size();
max_text_size.setHeight(qMax(max_text_size.height(), text_size.height()));
max_text_size.setWidth(qMax(max_text_size.width(), text_size.width()));
QSize const count_size = fm.boundingRect(itemData(i, CountStringRole).toString()).size();
max_count_size.setHeight(qMax(max_count_size.height(), count_size.height()));
max_count_size.setWidth(qMax(max_count_size.width(), count_size.width()));
}
return calculateSize(max_text_size, max_count_size);
}
QSize FilterBarComboBox::calculateSize(QSize const& text_size, QSize const& count_size) const
{
int const hmargin = getHSpacing(this);
QStyleOptionComboBox option;
initStyleOption(&option);
QSize content_size = iconSize() + QSize(4, 2);
content_size.setHeight(qMax(content_size.height(), text_size.height()));
content_size.rwidth() += hmargin + text_size.width();
content_size.rwidth() += hmargin + count_size.width();
return style()->sizeFromContents(QStyle::CT_ComboBox, &option, content_size, this).expandedTo(qApp->globalStrut());
}
void FilterBarComboBox::paintEvent(QPaintEvent* e)
{
Q_UNUSED(e)
QStylePainter painter(this);
painter.setPen(palette().color(QPalette::Text));
// draw the combobox frame, focusrect and selected etc.
QStyleOptionComboBox opt;
initStyleOption(&opt);
painter.drawComplexControl(QStyle::CC_ComboBox, opt);
// draw the icon and text
QModelIndex const model_index = model()->index(currentIndex(), 0, rootModelIndex());
if (model_index.isValid())
{
QStyle* s = style();
int const hmargin = getHSpacing(this);
QRect rect = s->subControlRect(QStyle::CC_ComboBox, &opt, QStyle::SC_ComboBoxEditField, this);
rect.adjust(2, 1, -2, -1);
// draw the icon
QIcon const icon = Utils::getIconFromIndex(model_index);
if (!icon.isNull())
{
QRect const icon_rect = QStyle::alignedRect(opt.direction, Qt::AlignLeft | Qt::AlignVCenter, opt.iconSize, rect);
icon.paint(&painter, icon_rect, Qt::AlignCenter, StyleHelper::getIconMode(opt.state), QIcon::Off);
Utils::narrowRect(rect, icon_rect.width() + hmargin, 0, opt.direction);
}
// draw the count
QString text = model_index.data(CountStringRole).toString();
if (!text.isEmpty())
{
QPen const pen = painter.pen();
painter.setPen(Utils::getFadedColor(pen.color()));
QRect const text_rect = QStyle::alignedRect(opt.direction, Qt::AlignRight | Qt::AlignVCenter,
QSize(opt.fontMetrics.boundingRect(text).width(), rect.height()), rect);
painter.drawText(text_rect, Qt::AlignRight | Qt::AlignVCenter, text);
Utils::narrowRect(rect, 0, text_rect.width() + hmargin, opt.direction);
painter.setPen(pen);
}
// draw the text
text = model_index.data(Qt::DisplayRole).toString();
text = painter.fontMetrics().elidedText(text, Qt::ElideRight, rect.width());
painter.drawText(rect, Qt::AlignLeft | Qt::AlignVCenter, text);
}
}
|
{
"pile_set_name": "Github"
}
|
INSERT INTO jforum_categories (category_id, category_title, category_order, category_moderated) VALUES (1, 'c1', 0, 0)
INSERT INTO jforum_forums (forum_id, category_id, forum_name, forum_order, forum_moderated) VALUES (1, 1, 'f1.1', 0, 0)
INSERT INTO jforum_users (user_id, username, user_password, user_email, user_active, USER_ATTACHSIG, USER_ALLOWAVATAR, USER_ALLOWBBCODE, USER_ALLOWHTML, DELETED, USER_NOTIFY_ALWAYS, USER_NOTIFY_PM, USER_ALLOW_PM, RANK_ID, USER_ALLOWSMILIES, USER_POSTS, USER_VIEWEMAIL, USER_ALLOW_VIEWONLINE, USER_NOTIFY_TEXT, user_notify) VALUES (1, 'u1', 'x', 'y', 0, 0, 0, 0, 0, 0, 0, 0, 0, null, 0, 0, 0, 0, 0, 0)
INSERT INTO jforum_topics (topic_id, forum_id, topic_subject, user_id, topic_date, TOPIC_STATUS, TOPIC_REPLIES, TOPIC_VIEWS, TOPIC_TYPE, TOPIC_VOTE_ID, topic_moved_id, need_moderate,has_attachment) VALUES (1, 1, 't1.1', 1, CURRENT_TIMESTAMP, 0, 0, 0, 0, null, 0, 0,false)
INSERT INTO jforum_topics (topic_id, forum_id, topic_subject, user_id, topic_date, TOPIC_STATUS, TOPIC_REPLIES, TOPIC_VIEWS, TOPIC_TYPE, TOPIC_VOTE_ID, topic_moved_id, need_moderate,has_attachment) VALUES (2, 1, 't1.2', 1, CURRENT_TIMESTAMP, 0, 0, 0, 0, null, 0, 0,false)
INSERT INTO jforum_posts (post_id, topic_id, user_id, post_date, need_moderate, enable_bbcode, post_edit_count, attach, enable_html, enable_sig, enable_smilies) VALUES (1, 1, 1, '2008-06-11 14:54:32', 0, 0, 0, 0, 0, 0, 0)
INSERT INTO jforum_posts (post_id, topic_id, user_id, post_date, need_moderate, enable_bbcode, post_edit_count, attach, enable_html, enable_sig, enable_smilies) VALUES (2, 1, 1, '2008-06-11 14:54:33', 0, 0, 0, 0, 0, 0, 0)
INSERT INTO jforum_posts (post_id, topic_id, user_id, post_date, need_moderate, enable_bbcode, post_edit_count, attach, enable_html, enable_sig, enable_smilies) VALUES (3, 1, 1, '2008-06-11 14:54:33', 0, 0, 0, 0, 0, 0, 0)
INSERT INTO jforum_posts (post_id, topic_id, user_id, post_date, need_moderate, enable_bbcode, post_edit_count, attach, enable_html, enable_sig, enable_smilies) VALUES (4, 2, 1, '2008-06-11 14:54:34', 0, 0, 0, 0, 0, 0, 0)
|
{
"pile_set_name": "Github"
}
|
tinyMCE.addI18n('is.table_dlg',{
general_tab:"General",
advanced_tab:"Advanced",
general_props:"General properties",
advanced_props:"Advanced properties",
rowtype:"Row in table part",
title:"Insert/Modify table",
width:"Width",
height:"Height",
cols:"Cols",
rows:"Rows",
cellspacing:"Cellspacing",
cellpadding:"Cellpadding",
border:"Border",
align:"Alignment",
align_default:"Default",
align_left:"Left",
align_right:"Right",
align_middle:"Center",
row_title:"Table row properties",
cell_title:"Table cell properties",
cell_type:"Cell type",
valign:"Vertical alignment",
align_top:"Top",
align_bottom:"Bottom",
bordercolor:"Border color",
bgcolor:"Background color",
merge_cells_title:"Merge table cells",
id:"Id",
style:"Style",
langdir:"Language direction",
langcode:"Language code",
mime:"Target MIME type",
ltr:"Left to right",
rtl:"Right to left",
bgimage:"Background image",
summary:"Summary",
td:"Data",
th:"Header",
cell_cell:"Update current cell",
cell_row:"Update all cells in row",
cell_all:"Update all cells in table",
row_row:"Update current row",
row_odd:"Update odd rows in table",
row_even:"Update even rows in table",
row_all:"Update all rows in table",
thead:"Table Head",
tbody:"Table Body",
tfoot:"Table Foot",
scope:"Scope",
rowgroup:"Row Group",
colgroup:"Col Group",
col_limit:"You've exceeded the maximum number of columns of {$cols}.",
row_limit:"You've exceeded the maximum number of rows of {$rows}.",
cell_limit:"You've exceeded the maximum number of cells of {$cells}.",
missing_scope:"Are you sure you want to continue without specifying a scope for this table header cell. Without it, it may be difficult for some users with disabilities to understand the content or data displayed of the table.",
caption:"Table caption",
frame:"Frame",
frame_none:"none",
frame_groups:"groups",
frame_rows:"rows",
frame_cols:"cols",
frame_all:"all",
rules:"Rules",
rules_void:"void",
rules_above:"above",
rules_below:"below",
rules_hsides:"hsides",
rules_lhs:"lhs",
rules_rhs:"rhs",
rules_vsides:"vsides",
rules_box:"box",
rules_border:"border"
});
|
{
"pile_set_name": "Github"
}
|
//
// ATFeedback.m
// DemoApp
//
// Created by Andrew Wooster on 3/16/11.
// Copyright 2011 Apptentive, Inc.. All rights reserved.
//
#import "ATFeedback.h"
#import "ATConnect.h"
#import "ATBackend.h"
#import "ATUtilities.h"
#import "ATWebClient.h"
#if TARGET_OS_IPHONE
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
#import <CoreTelephony/CTCarrier.h>
#endif
#define kFeedbackCodingVersion 2
@interface ATFeedback (Private)
- (void)setup;
- (ATFeedbackType)feedbackTypeFromString:(NSString *)feedbackString;
- (NSString *)stringForFeedbackType:(ATFeedbackType)feedbackType;
- (NSString *)stringForSource:(ATFeedbackSource)aSource;
- (NSString *)fullPathForScreenshotFilename:(NSString *)filename;
- (void)createScreenshotSidecarIfNecessary;
- (void)deleteScreenshotSidecar;
@end
@implementation ATFeedback
@synthesize type, text, name, email, phone, source, imageSource;
- (id)init {
if ((self = [super init])) {
[self setup];
}
return self;
}
- (void)dealloc {
[extraData release], extraData = nil;
[text release], text = nil;
[name release], name = nil;
[email release], email = nil;
[phone release], phone = nil;
[screenshot release], screenshot = nil;
[screenshotFilename release], screenshotFilename = nil;
[super dealloc];
}
- (id)initWithCoder:(NSCoder *)coder {
if ((self = [super initWithCoder:coder])) {
[self setup];
int version = [coder decodeIntForKey:@"version"];
if ([coder containsValueForKey:@"source"]) {
self.source = [coder decodeIntForKey:@"source"];
} else {
self.source = ATFeedbackSourceUnknown;
}
if (version == 1) {
self.type = [self feedbackTypeFromString:[coder decodeObjectForKey:@"type"]];
self.text = [coder decodeObjectForKey:@"text"];
self.name = [coder decodeObjectForKey:@"name"];
self.email = [coder decodeObjectForKey:@"email"];
self.phone = [coder decodeObjectForKey:@"phone"];
if ([coder containsValueForKey:@"screenshot"]) {
NSData *data = [coder decodeObjectForKey:@"screenshot"];
#if TARGET_OS_IPHONE
screenshot = [[UIImage imageWithData:data] retain];
#elif TARGET_OS_MAC
screenshot = [[NSImage alloc] initWithData:data];
#endif
}
} else if (version == kFeedbackCodingVersion) {
self.type = [coder decodeIntForKey:@"type"];
self.text = [coder decodeObjectForKey:@"text"];
self.name = [coder decodeObjectForKey:@"name"];
self.email = [coder decodeObjectForKey:@"email"];
self.phone = [coder decodeObjectForKey:@"phone"];
if ([coder containsValueForKey:@"screenshot"]) {
NSData *data = [coder decodeObjectForKey:@"screenshot"];
#if TARGET_OS_IPHONE
screenshot = [[UIImage imageWithData:data] retain];
#elif TARGET_OS_MAC
screenshot = [[NSImage alloc] initWithData:data];
#endif
}
if ([coder containsValueForKey:@"screenshotFilename"]) {
screenshotFilename = [[coder decodeObjectForKey:@"screenshotFilename"] retain];
}
NSDictionary *oldExtraData = [coder decodeObjectForKey:@"extraData"];
if (oldExtraData != nil) {
[extraData addEntriesFromDictionary:oldExtraData];
}
} else {
[self release];
return nil;
}
// Upgrade screenshot data, if necessary.
[self createScreenshotSidecarIfNecessary];
if (screenshotFilename && screenshot != nil) {
[screenshot release], screenshot = nil;
}
}
return self;
}
- (void)encodeWithCoder:(NSCoder *)coder {
[super encodeWithCoder:coder];
[coder encodeInt:kFeedbackCodingVersion forKey:@"version"];
[coder encodeInt:self.type forKey:@"type"];
[coder encodeObject:self.text forKey:@"text"];
[coder encodeObject:self.name forKey:@"name"];
[coder encodeObject:self.email forKey:@"email"];
[coder encodeObject:self.phone forKey:@"phone"];
if (self.source != ATFeedbackSourceUnknown) {
[coder encodeInt:self.source forKey:@"source"];
}
[coder encodeObject:extraData forKey:@"extraData"];
[self createScreenshotSidecarIfNecessary];
[coder encodeObject:screenshotFilename forKey:@"screenshotFilename"];
}
- (NSDictionary *)apiDictionary {
NSMutableDictionary *d = [NSMutableDictionary dictionaryWithDictionary:[super apiDictionary]];
if (self.name) [d setObject:self.name forKey:@"record[user][name]"];
if (self.email) [d setObject:self.email forKey:@"record[user][email]"];
if (self.phone) [d setObject:self.phone forKey:@"record[user][phone_number]"];
if (self.text) [d setObject:self.text forKey:@"record[feedback][feedback]"];
[d setObject:[self stringForFeedbackType:self.type] forKey:@"record[feedback][type]"];
NSString *sourceString = [self stringForSource:self.source];
if (sourceString != nil) {
[d setObject:sourceString forKey:@"record[feedback][source]"];
}
if (extraData && [extraData count] > 0) {
for (NSString *key in extraData) {
NSString *fullKey = [NSString stringWithFormat:@"record[data][%@]", key];
[d setObject:[extraData objectForKey:key] forKey:fullKey];
}
}
return d;
}
- (void)addExtraDataFromDictionary:(NSDictionary *)dictionary {
[extraData addEntriesFromDictionary:dictionary];
}
- (ATAPIRequest *)requestForSendingRecord {
return [[ATWebClient sharedClient] requestForPostingFeedback:self];
}
- (void)cleanup {
[self deleteScreenshotSidecar];
[super cleanup];
}
#if TARGET_OS_IPHONE
- (void)setScreenshot:(UIImage *)aScreenshot
#elif TARGET_OS_MAC
- (void)setScreenshot:(NSImage *)aScreenshot
#endif
{
if (screenshot != aScreenshot) {
[screenshot release], screenshot = nil;
[self deleteScreenshotSidecar];
screenshot = [aScreenshot retain];
}
}
#if TARGET_OS_IPHONE
- (UIImage *)copyScreenshot
#elif TARGET_OS_MAC
- (NSImage *)copyScreenshot
#endif
{
if (screenshot) {
return [screenshot copy];
} else {
NSData *data = [self dataForScreenshot];
if (data) {
# if TARGET_OS_IPHONE
return [[UIImage imageWithData:data] retain];
# elif TARGET_OS_MAC
return [[NSImage alloc] initWithData:data];
# endif
}
}
return nil;
}
- (BOOL)hasScreenshot {
if (screenshotFilename) {
return YES;
} else if (screenshot) {
return YES;
} else {
return NO;
}
}
- (NSData *)dataForScreenshot {
NSData *result = nil;
if (![self hasScreenshot]) {
return result;
}
NSFileManager *fm = [NSFileManager defaultManager];
if (screenshotFilename && [fm fileExistsAtPath:[self fullPathForScreenshotFilename:screenshotFilename]]) {
result = [NSData dataWithContentsOfFile:[self fullPathForScreenshotFilename:screenshotFilename]];
} else if (screenshot) {
# if TARGET_OS_IPHONE
result = UIImagePNGRepresentation(screenshot);
# elif TARGET_OS_MAC
result = [ATUtilities pngRepresentationOfImage:self.screenshot];
# endif
}
return result;
}
@end
@implementation ATFeedback (Private)
- (void)setup {
if (!extraData) {
extraData = [[NSMutableDictionary alloc] init];
}
self.type = ATFeedbackTypeFeedback;
}
- (ATFeedbackType)feedbackTypeFromString:(NSString *)feedbackString {
if ([feedbackString isEqualToString:@"feedback"] || [feedbackString isEqualToString:@"suggestion"]) {
return ATFeedbackTypeFeedback;
} else if ([feedbackString isEqualToString:@"question"]) {
return ATFeedbackTypeQuestion;
} else if ([feedbackString isEqualToString:@"praise"]) {
return ATFeedbackTypePraise;
} else if ([feedbackString isEqualToString:@"bug"]) {
return ATFeedbackTypeBug;
}
return ATFeedbackTypeFeedback;
}
- (NSString *)stringForFeedbackType:(ATFeedbackType)feedbackType {
NSString *result = nil;
switch (feedbackType) {
case ATFeedbackTypeBug:
result = @"bug";
break;
case ATFeedbackTypePraise:
result = @"praise";
break;
case ATFeedbackTypeQuestion:
result = @"question";
break;
case ATFeedbackTypeFeedback:
default:
result = @"feedback";
break;
}
return result;
}
- (NSString *)stringForSource:(ATFeedbackSource)aSource {
NSString *result = nil;
switch (aSource) {
case ATFeedbackSourceEnjoymentDialog:
result = @"enjoyment_dialog";
break;
default:
break;
}
return result;
}
- (NSString *)fullPathForScreenshotFilename:(NSString *)filename {
return [[[ATBackend sharedBackend] attachmentDirectoryPath] stringByAppendingPathComponent:filename];
}
- (void)createScreenshotSidecarIfNecessary {
if (screenshot) {
if (!screenshotFilename) {
// First time this screenshot has been saved.
screenshotFilename = [[ATUtilities randomStringOfLength:20] retain];
NSString *fullPath = [self fullPathForScreenshotFilename:screenshotFilename];
NSData *screenshotData = [self dataForScreenshot];
if (![screenshotData writeToFile:fullPath atomically:YES]) {
ATLogError(@"Unable to save screenshot data to path: %@", fullPath);
}
}
}
}
- (void)deleteScreenshotSidecar {
if (screenshotFilename) {
NSFileManager *fm = [NSFileManager defaultManager];
NSString *fullPath = [self fullPathForScreenshotFilename:screenshotFilename];
NSError *error = nil;
if (![fm removeItemAtPath:fullPath error:&error]) {
ATLogError(@"Error removing screenshot at path: %@. %@", screenshotFilename, error);
return;
}
[screenshotFilename release], screenshotFilename = nil;
}
}
@end
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using Jaeger.Propagation;
using Microsoft.Extensions.Logging;
using OpenTracing.Propagation;
namespace Jaeger
{
internal class PropagationRegistry
{
private readonly ILogger _logger;
private readonly Dictionary<object, IInjector> _injectors = new Dictionary<object, IInjector>();
private readonly Dictionary<object, IExtractor> _extractors = new Dictionary<object, IExtractor>();
public PropagationRegistry(ILoggerFactory loggerFactory)
{
_logger = loggerFactory?.CreateLogger<PropagationRegistry>() ?? throw new ArgumentNullException(nameof(loggerFactory));
}
internal IInjector GetInjector<TCarrier>(IFormat<TCarrier> format)
{
return _injectors.TryGetValue(format, out var injector) ? injector : null;
}
internal IExtractor GetExtractor<TCarrier>(IFormat<TCarrier> format)
{
return _extractors.TryGetValue(format, out var extractor) ? extractor : null;
}
public void Register<TCarrier>(IFormat<TCarrier> format, Injector<TCarrier> injector)
{
_injectors[format] = new ExceptionCatchingInjectorDecorator(injector, _logger);
}
public void Register<TCarrier>(IFormat<TCarrier> format, Extractor<TCarrier> extractor)
{
_extractors[format] = new ExceptionCatchingExtractorDecorator(extractor, _logger);
}
public void Register<TCarrier>(IFormat<TCarrier> format, Codec<TCarrier> codec)
{
_injectors[format] = new ExceptionCatchingInjectorDecorator(codec, _logger);
_extractors[format] = new ExceptionCatchingExtractorDecorator(codec, _logger);
}
private sealed class ExceptionCatchingExtractorDecorator : IExtractor
{
private readonly IExtractor _decorated;
private readonly ILogger _logger;
public ExceptionCatchingExtractorDecorator(IExtractor decorated, ILogger logger)
{
_decorated = decorated ?? throw new ArgumentNullException(nameof(decorated));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
public SpanContext Extract(object carrier)
{
try
{
return _decorated.Extract(carrier);
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Error when extracting SpanContext from carrier. Handling gracefully.");
return null;
}
}
}
private sealed class ExceptionCatchingInjectorDecorator : IInjector
{
private readonly IInjector _decorated;
private readonly ILogger _logger;
public ExceptionCatchingInjectorDecorator(IInjector decorated, ILogger logger)
{
_decorated = decorated ?? throw new ArgumentNullException(nameof(decorated));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
public void Inject(SpanContext spanContext, object carrier)
{
try
{
_decorated.Inject(spanContext, carrier);
}
catch (Exception ex)
{
_logger.LogWarning(ex, "Error when injecting SpanContext into carrier. Handling gracefully.");
}
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
# Request parameter from attached device
string param_id
---
bool success
ParamValue value
|
{
"pile_set_name": "Github"
}
|
---
title: Document.SelectUnlinkedControls Method (Word)
keywords: vbawd10.chm158007846
f1_keywords:
- vbawd10.chm158007846
ms.prod: word
api_name:
- Word.Document.SelectUnlinkedControls
ms.assetid: 6d757837-0959-6754-bfae-e840ea7de339
ms.date: 06/08/2017
---
# Document.SelectUnlinkedControls Method (Word)
Returns a **[ContentControls](contentcontrols-object-word.md)** collection that represents all content controls in a document that are not linked to an XML node in the document's XML data store. Read-only.
## Syntax
_expression_ . **SelectUnlinkedControls**( **_Stream_** )
_expression_ An expression that returns a **[Document](document-object-word.md)** object.
### Parameters
|**Name**|**Required/Optional**|**Data Type**|**Description**|
|:-----|:-----|:-----|:-----|
| _Stream_|Optional| **CustomXMLPart**|A custom XML part reference. Setting this parameter filters the returned content controls to include only content controls that reference this **CustomXMLPart** in their **XMLMapping** definition.|
### Return Value
ContentControls
## See also
#### Concepts
[Document Object](document-object-word.md)
|
{
"pile_set_name": "Github"
}
|
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-1"
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# 100-》200 x\n",
"# 100-》300 y\n",
"import cv2\n",
"img=cv2.imread('image0.jpg',1)\n",
"imgInfo=img.shape\n",
"dst = img[100:200,100:300]\n",
"cv2.imshow('image',dst)\n",
"cv2.waitKey(0)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.7"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
|
{
"pile_set_name": "Github"
}
|
using System;
using System.ComponentModel.Composition;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web.Mvc;
using Thinktecture.IdentityModel.Authorization.Mvc;
using Thinktecture.IdentityServer.Models.Configuration;
using Thinktecture.IdentityServer.Repositories;
using Thinktecture.IdentityServer.Web.Areas.Admin.ViewModels;
namespace Thinktecture.IdentityServer.Web.Areas.Admin.Controllers
{
[ClaimsAuthorize(Constants.Actions.Administration, Constants.Resources.Configuration)]
public class ProtocolController : Controller
{
[Import]
public IConfigurationRepository ConfigurationRepository { get; set; }
public ProtocolController()
{
Container.Current.SatisfyImportsOnce(this);
}
public ProtocolController(IConfigurationRepository configurationRepository)
{
ConfigurationRepository = configurationRepository;
}
public ActionResult Index()
{
var vm = new ProtocolsViewModel(ConfigurationRepository);
return View("Index", vm);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Index(ProtocolsInputModel model)
{
if (ModelState.IsValid)
{
try
{
model.Update(this.ConfigurationRepository);
TempData["Message"] = Resources.ProtocolController.UpdateSuccessful;
return RedirectToAction("Index");
}
catch (ValidationException ex)
{
ModelState.AddModelError("", ex.Message);
}
catch
{
ModelState.AddModelError("", Resources.ProtocolController.ErrorUpdatingProtocols);
}
}
var vm = new ProtocolsViewModel(ConfigurationRepository);
return View("Index", vm);
}
[ChildActionOnly]
public ActionResult Menu()
{
var pvm = new ProtocolsViewModel(ConfigurationRepository);
var list = pvm.Protocols.Where(x => x.Enabled).ToArray();
if (list.Length > 0)
{
var vm = new ChildMenuViewModel();
vm.Items = list.Select(x =>
new ChildMenuItem
{
Controller = "Protocol",
Action = "Protocol",
Title = x.Name,
RouteValues = new { id = x.NameWithoutSpaces }
}).ToArray();
return PartialView("ChildMenu", vm);
}
return new EmptyResult();
}
public ActionResult Protocol(string id)
{
var vm = new ProtocolsViewModel(this.ConfigurationRepository);
var protocol = vm.GetProtocol(id);
if (protocol == null) return HttpNotFound();
if (id == "ADFSIntegration")
{
return View("ADFSIntegration", protocol);
}
return View("Protocol", protocol);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult UpdateADFSIntegration(
[Bind(Exclude = "EncryptionCertificate")] AdfsIntegrationConfiguration protocol,
[Bind(Prefix = "protocol")] AdfsIntegrationCertInputModel cert,
bool? removeCert)
{
string id = "ADFSIntegration";
if (removeCert == true)
{
protocol.EncryptionCertificate = null;
}
else if (cert.EncryptionCertificate != null)
{
protocol.EncryptionCertificate = cert.Cert;
}
else
{
protocol.EncryptionCertificate = this.ConfigurationRepository.AdfsIntegration.EncryptionCertificate;
}
if (protocol.Enabled)
{
if (protocol.SamlAuthenticationEnabled && protocol.EncryptionCertificate == null)
{
ModelState.AddModelError("protocol.EncryptionCertificate", "EncryptionCertificate required when SamlAuthenticationEnabled is enabled.");
}
if (protocol.JwtAuthenticationEnabled && protocol.EncryptionCertificate == null)
{
ModelState.AddModelError("protocol.EncryptionCertificate", "EncryptionCertificate required when JwtAuthenticationEnabled is enabled.");
}
}
if (ModelState.IsValid)
{
try
{
this.ConfigurationRepository.AdfsIntegration = protocol;
TempData["Message"] = "Update Successful";
return RedirectToAction("Protocol", new { id });
}
catch (ValidationException ex)
{
ModelState.AddModelError("", ex.Message);
}
catch
{
ModelState.AddModelError("", "Error updating protocol.");
}
}
var vm = new ProtocolsViewModel(this.ConfigurationRepository);
var orig = vm.GetProtocol(id);
return View("ADFSIntegration", orig);
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult UpdateProtocol(string id)
{
var vm = new ProtocolsViewModel(this.ConfigurationRepository);
var protocol = vm.GetProtocol(id);
if (this.TryUpdateModel(protocol.Protocol, "protocol"))
{
try
{
vm.UpdateProtocol(protocol);
TempData["Message"] = Resources.ProtocolController.UpdateSuccessful;
return RedirectToAction("Protocol", new { id });
}
catch (ValidationException ex)
{
ModelState.AddModelError("", ex.Message);
}
catch
{
ModelState.AddModelError("", Resources.ProtocolController.ErrorUpdatingProtocol);
}
}
return View("Protocol", protocol);
}
bool TryUpdateModel(object model, string prefix)
{
if (model == null)
{
throw new ArgumentNullException("model");
}
var valueProvider = this.ValueProvider;
Predicate<string> predicate = delegate(string propertyName)
{
return IsPropertyAllowed(propertyName, null, null);
};
var modelType = model.GetType();
IModelBinder binder = this.Binders.GetBinder(modelType);
ModelBindingContext context2 = new ModelBindingContext();
context2.ModelMetadata = ModelMetadataProviders.Current.GetMetadataForType(delegate
{
return model;
}, modelType);
context2.ModelName = prefix;
context2.ModelState = this.ModelState;
context2.PropertyFilter = predicate;
context2.ValueProvider = valueProvider;
ModelBindingContext bindingContext = context2;
binder.BindModel(base.ControllerContext, bindingContext);
return this.ModelState.IsValid;
}
internal static bool IsPropertyAllowed(string propertyName, string[] includeProperties, string[] excludeProperties)
{
bool flag = ((includeProperties == null) || (includeProperties.Length == 0)) || includeProperties.Contains<string>(propertyName, StringComparer.OrdinalIgnoreCase);
bool flag2 = (excludeProperties != null) && excludeProperties.Contains<string>(propertyName, StringComparer.OrdinalIgnoreCase);
return (flag && !flag2);
}
}
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.