text
stringlengths
2
100k
meta
dict
h1 { float: left; width: 274px; height: 75px; margin: 0; background-repeat: no-repeat; background-image: none; } h1 a:hover, h1 a:visited { color: green; } h1 b:hover { color: red; background-color: green; } h1 const { nosp: 3; sp: 3; }
{ "pile_set_name": "Github" }
@page @model AboutModel @{ ViewData["Title"] = "About"; } <h2>@ViewData["Title"]</h2> <h3>@Model.Message</h3> <p>Use this area to provide additional information.</p>
{ "pile_set_name": "Github" }
// @flow /** * producing the immutable data with the given argument * * if object => recurse its children * if array => new List * if string => '' * if boolean => false * if number => 0 * if toOne relation => null * if toMany relation => null * if dateTime => string */ import invariant from 'invariant'; import faker from 'faker'; import {mapSchema} from './utils'; import type {Schema, SchemaMap} from './types'; // createFakeData = (schema: Object, listLength: number) => * export default function createFakeData(root: Schema | SchemaMap, listLength: number = 0) { if (!root) { return null; } const firstLevelKeys = getFirstLevelKeys(root); return root.hasOwnProperty('type') ? loop(((root: any): Schema), ((root: any): Schema).keyName): mapSchema(((root: any): SchemaMap), loop); // Loop schema function loop(schema: Schema, key: ?string) { let result: any; switch (schema.type) { case 'object': { if (schema.ui === 'editor') { result = { html: `<p>${faker.lorem.paragraphs()}</p>` } break; } result = mapSchema(schema.items, loop); result.__typename = result.__typename || null; break; } case 'array': result = getArrayData(schema, (key: any), listLength, loop); break; case 'number': result = faker.random.number(); break; case 'geoPoint': result = { __typename: null, lat: faker.address.latitude(), lng: faker.address.longitude(), address: faker.address.city(), placeId: faker.random.uuid() }; break; case 'dateTime': result = faker.date.past().toISOString(); break; case 'file': result = { __typename: null, contentType: faker.system.mimeType(), size: faker.random.number(), name: faker.system.commonFileName(), url: faker.internet.url() }; break; case 'image': result = { __typename: null, contentType: 'image/jpeg', size: faker.random.number(), name: faker.system.commonFileName(), url: randomImg() }; break; case 'boolean': result = faker.random.boolean(); break; case 'string': { const lowerKeyName = schema.keyName && schema.keyName.toLowerCase() || ''; if (lowerKeyName.indexOf('email') > -1) { result = faker.internet.email(); } else if (lowerKeyName.indexOf('phone') > -1) { result = faker.phone.phoneNumber(); } else if (schema.ui === "textarea") { result = faker.lorem.paragraphs(); } else { result = faker.random.word(); } break; } case 'enum': { if (schema.values) { result = schema.values[getRandomNumber(0, schema.values.length - 1)]; } else { throw new Error('Enum type should have a values property.'); } break; } case 'relation': { result = getRelation(schema, firstLevelKeys, listLength); break; } case 'json': { result = {}; break; } default: invariant(true, `unsupport type ${schema.type}`); break; } return result; } } function getFirstLevelKeys(root: Schema | SchemaMap) { if ('type' in root) { return root.items ? Object.keys((root: any).items) : {}; } return Object.keys(root); } function getArrayData(schema: any, key: string, listLength: number, loop: Function) { const result = []; for (let i = 0; i < listLength; ++i) { let item; if (schema.items && schema.items.items) { item = mapSchema(schema.items.items, loop); } else { item = schema.items.hasOwnProperty('type') ? loop(schema.items, schema.items.keyName): mapSchema(schema.items, loop); } if (typeof item === 'object' && key) { item = { ...item, id: `${key}${i+1}` }; } result.push(item); } return result; } function getRelation(schema: Schema, firstLevelKeys: any, listLength: number) { const {type, to} = (schema: any).relation; const isInFirstLevel = Array.isArray(firstLevelKeys) && firstLevelKeys.indexOf(to) > -1 && listLength > 0; let result: any; switch (type) { case 'toMany': result = []; if (isInFirstLevel) { for(let i = 0; i < listLength; ++i) { if (Math.random() > 0.5 && to !== schema.keyName) { result.push(`${to}${i + 1}`); } } } break; case 'toOne': default: if (isInFirstLevel && to !== schema.keyName) { result = `${to}${getRandomNumber(1, listLength)}`; } else { result = null; } break; } return result; } export function getRandomNumber(min: number, max: number) { return Math.floor(Math.random() * (max - min)) + min; } export function randomImg() { return `https://placeimg.com/${getRandomNumber(250, 350)}/${getRandomNumber(300, 400)}/any` }
{ "pile_set_name": "Github" }
// // This file is auto-generated. Please don't modify it! // package org.opencv.features2d; import org.opencv.features2d.Feature2D; import org.opencv.features2d.ORB; // C++: class ORB /** * Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor * * described in CITE: RRKB11 . The algorithm uses FAST in pyramids to detect stable keypoints, selects * the strongest features using FAST or Harris response, finds their orientation using first-order * moments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or * k-tuples) are rotated according to the measured orientation). */ public class ORB extends Feature2D { protected ORB(long addr) { super(addr); } // internal usage only public static ORB __fromPtr__(long addr) { return new ORB(addr); } // C++: enum ScoreType public static final int HARRIS_SCORE = 0, FAST_SCORE = 1; // // C++: ORB_ScoreType cv::ORB::getScoreType() // public int getScoreType() { return getScoreType_0(nativeObj); } // // C++: static Ptr_ORB cv::ORB::create(int nfeatures = 500, float scaleFactor = 1.2f, int nlevels = 8, int edgeThreshold = 31, int firstLevel = 0, int WTA_K = 2, ORB_ScoreType scoreType = ORB::HARRIS_SCORE, int patchSize = 31, int fastThreshold = 20) // /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * @param nlevels The number of pyramid levels. The smallest level will have linear size equal to * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * @param edgeThreshold This is size of the border where the features are not detected. It should * roughly match the patchSize parameter. * @param firstLevel The level of pyramid to put source image to. Previous layers are filled * with upscaled source image. * @param WTA_K The number of points that produce each element of the oriented BRIEF descriptor. The * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * @param scoreType The default HARRIS_SCORE means that Harris algorithm is used to rank features * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * @param patchSize size of the patch used by the oriented BRIEF descriptor. Of course, on smaller * pyramid layers the perceived image area covered by a feature will be larger. * @param fastThreshold the fast threshold * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType, int patchSize, int fastThreshold) { return ORB.__fromPtr__(create_0(nfeatures, scaleFactor, nlevels, edgeThreshold, firstLevel, WTA_K, scoreType, patchSize, fastThreshold)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * @param nlevels The number of pyramid levels. The smallest level will have linear size equal to * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * @param edgeThreshold This is size of the border where the features are not detected. It should * roughly match the patchSize parameter. * @param firstLevel The level of pyramid to put source image to. Previous layers are filled * with upscaled source image. * @param WTA_K The number of points that produce each element of the oriented BRIEF descriptor. The * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * @param scoreType The default HARRIS_SCORE means that Harris algorithm is used to rank features * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * @param patchSize size of the patch used by the oriented BRIEF descriptor. Of course, on smaller * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType, int patchSize) { return ORB.__fromPtr__(create_1(nfeatures, scaleFactor, nlevels, edgeThreshold, firstLevel, WTA_K, scoreType, patchSize)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * @param nlevels The number of pyramid levels. The smallest level will have linear size equal to * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * @param edgeThreshold This is size of the border where the features are not detected. It should * roughly match the patchSize parameter. * @param firstLevel The level of pyramid to put source image to. Previous layers are filled * with upscaled source image. * @param WTA_K The number of points that produce each element of the oriented BRIEF descriptor. The * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * @param scoreType The default HARRIS_SCORE means that Harris algorithm is used to rank features * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType) { return ORB.__fromPtr__(create_2(nfeatures, scaleFactor, nlevels, edgeThreshold, firstLevel, WTA_K, scoreType)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * @param nlevels The number of pyramid levels. The smallest level will have linear size equal to * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * @param edgeThreshold This is size of the border where the features are not detected. It should * roughly match the patchSize parameter. * @param firstLevel The level of pyramid to put source image to. Previous layers are filled * with upscaled source image. * @param WTA_K The number of points that produce each element of the oriented BRIEF descriptor. The * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K) { return ORB.__fromPtr__(create_3(nfeatures, scaleFactor, nlevels, edgeThreshold, firstLevel, WTA_K)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * @param nlevels The number of pyramid levels. The smallest level will have linear size equal to * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * @param edgeThreshold This is size of the border where the features are not detected. It should * roughly match the patchSize parameter. * @param firstLevel The level of pyramid to put source image to. Previous layers are filled * with upscaled source image. * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel) { return ORB.__fromPtr__(create_4(nfeatures, scaleFactor, nlevels, edgeThreshold, firstLevel)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * @param nlevels The number of pyramid levels. The smallest level will have linear size equal to * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * @param edgeThreshold This is size of the border where the features are not detected. It should * roughly match the patchSize parameter. * with upscaled source image. * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold) { return ORB.__fromPtr__(create_5(nfeatures, scaleFactor, nlevels, edgeThreshold)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * @param nlevels The number of pyramid levels. The smallest level will have linear size equal to * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * roughly match the patchSize parameter. * with upscaled source image. * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor, int nlevels) { return ORB.__fromPtr__(create_6(nfeatures, scaleFactor, nlevels)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * roughly match the patchSize parameter. * with upscaled source image. * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures, float scaleFactor) { return ORB.__fromPtr__(create_7(nfeatures, scaleFactor)); } /** * The ORB constructor * * @param nfeatures The maximum number of features to retain. * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * roughly match the patchSize parameter. * with upscaled source image. * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create(int nfeatures) { return ORB.__fromPtr__(create_8(nfeatures)); } /** * The ORB constructor * * pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor * will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor * will mean that to cover certain scale range you will need more pyramid levels and so the speed * will suffer. * input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). * roughly match the patchSize parameter. * with upscaled source image. * default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, * so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 * random points (of course, those point coordinates are random, but they are generated from the * pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel * rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such * output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, * denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each * bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). * (the score is written to KeyPoint::score and is used to retain best nfeatures features); * FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, * but it is a little faster to compute. * pyramid layers the perceived image area covered by a feature will be larger. * @return automatically generated */ public static ORB create() { return ORB.__fromPtr__(create_9()); } // // C++: String cv::ORB::getDefaultName() // public String getDefaultName() { return getDefaultName_0(nativeObj); } // // C++: double cv::ORB::getScaleFactor() // public double getScaleFactor() { return getScaleFactor_0(nativeObj); } // // C++: int cv::ORB::getEdgeThreshold() // public int getEdgeThreshold() { return getEdgeThreshold_0(nativeObj); } // // C++: int cv::ORB::getFastThreshold() // public int getFastThreshold() { return getFastThreshold_0(nativeObj); } // // C++: int cv::ORB::getFirstLevel() // public int getFirstLevel() { return getFirstLevel_0(nativeObj); } // // C++: int cv::ORB::getMaxFeatures() // public int getMaxFeatures() { return getMaxFeatures_0(nativeObj); } // // C++: int cv::ORB::getNLevels() // public int getNLevels() { return getNLevels_0(nativeObj); } // // C++: int cv::ORB::getPatchSize() // public int getPatchSize() { return getPatchSize_0(nativeObj); } // // C++: int cv::ORB::getWTA_K() // public int getWTA_K() { return getWTA_K_0(nativeObj); } // // C++: void cv::ORB::setEdgeThreshold(int edgeThreshold) // public void setEdgeThreshold(int edgeThreshold) { setEdgeThreshold_0(nativeObj, edgeThreshold); } // // C++: void cv::ORB::setFastThreshold(int fastThreshold) // public void setFastThreshold(int fastThreshold) { setFastThreshold_0(nativeObj, fastThreshold); } // // C++: void cv::ORB::setFirstLevel(int firstLevel) // public void setFirstLevel(int firstLevel) { setFirstLevel_0(nativeObj, firstLevel); } // // C++: void cv::ORB::setMaxFeatures(int maxFeatures) // public void setMaxFeatures(int maxFeatures) { setMaxFeatures_0(nativeObj, maxFeatures); } // // C++: void cv::ORB::setNLevels(int nlevels) // public void setNLevels(int nlevels) { setNLevels_0(nativeObj, nlevels); } // // C++: void cv::ORB::setPatchSize(int patchSize) // public void setPatchSize(int patchSize) { setPatchSize_0(nativeObj, patchSize); } // // C++: void cv::ORB::setScaleFactor(double scaleFactor) // public void setScaleFactor(double scaleFactor) { setScaleFactor_0(nativeObj, scaleFactor); } // // C++: void cv::ORB::setScoreType(ORB_ScoreType scoreType) // public void setScoreType(int scoreType) { setScoreType_0(nativeObj, scoreType); } // // C++: void cv::ORB::setWTA_K(int wta_k) // public void setWTA_K(int wta_k) { setWTA_K_0(nativeObj, wta_k); } @Override protected void finalize() throws Throwable { delete(nativeObj); } // C++: ORB_ScoreType cv::ORB::getScoreType() private static native int getScoreType_0(long nativeObj); // C++: static Ptr_ORB cv::ORB::create(int nfeatures = 500, float scaleFactor = 1.2f, int nlevels = 8, int edgeThreshold = 31, int firstLevel = 0, int WTA_K = 2, ORB_ScoreType scoreType = ORB::HARRIS_SCORE, int patchSize = 31, int fastThreshold = 20) private static native long create_0(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType, int patchSize, int fastThreshold); private static native long create_1(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType, int patchSize); private static native long create_2(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K, int scoreType); private static native long create_3(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel, int WTA_K); private static native long create_4(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold, int firstLevel); private static native long create_5(int nfeatures, float scaleFactor, int nlevels, int edgeThreshold); private static native long create_6(int nfeatures, float scaleFactor, int nlevels); private static native long create_7(int nfeatures, float scaleFactor); private static native long create_8(int nfeatures); private static native long create_9(); // C++: String cv::ORB::getDefaultName() private static native String getDefaultName_0(long nativeObj); // C++: double cv::ORB::getScaleFactor() private static native double getScaleFactor_0(long nativeObj); // C++: int cv::ORB::getEdgeThreshold() private static native int getEdgeThreshold_0(long nativeObj); // C++: int cv::ORB::getFastThreshold() private static native int getFastThreshold_0(long nativeObj); // C++: int cv::ORB::getFirstLevel() private static native int getFirstLevel_0(long nativeObj); // C++: int cv::ORB::getMaxFeatures() private static native int getMaxFeatures_0(long nativeObj); // C++: int cv::ORB::getNLevels() private static native int getNLevels_0(long nativeObj); // C++: int cv::ORB::getPatchSize() private static native int getPatchSize_0(long nativeObj); // C++: int cv::ORB::getWTA_K() private static native int getWTA_K_0(long nativeObj); // C++: void cv::ORB::setEdgeThreshold(int edgeThreshold) private static native void setEdgeThreshold_0(long nativeObj, int edgeThreshold); // C++: void cv::ORB::setFastThreshold(int fastThreshold) private static native void setFastThreshold_0(long nativeObj, int fastThreshold); // C++: void cv::ORB::setFirstLevel(int firstLevel) private static native void setFirstLevel_0(long nativeObj, int firstLevel); // C++: void cv::ORB::setMaxFeatures(int maxFeatures) private static native void setMaxFeatures_0(long nativeObj, int maxFeatures); // C++: void cv::ORB::setNLevels(int nlevels) private static native void setNLevels_0(long nativeObj, int nlevels); // C++: void cv::ORB::setPatchSize(int patchSize) private static native void setPatchSize_0(long nativeObj, int patchSize); // C++: void cv::ORB::setScaleFactor(double scaleFactor) private static native void setScaleFactor_0(long nativeObj, double scaleFactor); // C++: void cv::ORB::setScoreType(ORB_ScoreType scoreType) private static native void setScoreType_0(long nativeObj, int scoreType); // C++: void cv::ORB::setWTA_K(int wta_k) private static native void setWTA_K_0(long nativeObj, int wta_k); // native support for java finalize() private static native void delete(long nativeObj); }
{ "pile_set_name": "Github" }
#!/usr/bin/env python # Copyright JS Foundation and other contributors, http://js.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. import struct MAX_BUFFER_SIZE = 256 class RawPacket(object): """ Simplified transmission layer. """ def __init__(self, protocol): self.protocol = protocol self.data_buffer = b"" def connect(self, config_size): """ Create connection. """ self.protocol.connect() self.data_buffer = b"" # It will return with the Network configurations, which has the following struct: # header [1] - size[1] # configuration [config_size] len_expected = config_size + 1 while len(self.data_buffer) < len_expected: self.data_buffer += self.protocol.receive_data() expected = struct.pack("B", config_size) if self.data_buffer[0:1] != expected: raise Exception("Unexpected configuration") result = self.data_buffer[1:len_expected] self.data_buffer = self.data_buffer[len_expected:] return result def close(self): """ Close connection. """ self.protocol.close() def send_message(self, _, data): """ Send message. """ msg_size = len(data) while msg_size > 0: bytes_send = self.protocol.send_data(data) if bytes_send < msg_size: data = data[bytes_send:] msg_size -= bytes_send def get_message(self, blocking): """ Receive message. """ # Connection was closed if self.data_buffer is None: return None while True: if len(self.data_buffer) >= 1: size = ord(self.data_buffer[0]) if size == 0: raise Exception("Unexpected data frame") if len(self.data_buffer) >= size + 1: result = self.data_buffer[1:size + 1] self.data_buffer = self.data_buffer[size + 1:] return result if not blocking and not self.protocol.ready(): return b'' received_data = self.protocol.receive_data(MAX_BUFFER_SIZE) if not received_data: return None self.data_buffer += received_data
{ "pile_set_name": "Github" }
<extend name="Public/base"/> <block name="header"> <li class="active"><a href="javascript:;">安装协议</a></li> <li class="active"><a href="javascript:;">环境检测</a></li> <li class="active"><a href="javascript:;">创建数据库</a></li> <li><a href="javascript:;">升级</a></li> <li><a href="javascript:;">完成</a></li> </block> <block name="body"> <h1>升级</h1> <p>检测到已经安装过系统,点击下一步开始进行系统升级!</p> </block> <block name="footer"> <a class="btn btn-success btn-large" href="{:U('Install/step1')}">上一步</a> <a class="btn btn-primary btn-large" href="{:U('Install/step3')}">下一步</a> </block>
{ "pile_set_name": "Github" }
/* Red Black Trees (C) 1999 Andrea Arcangeli <[email protected]> (C) 2002 David Woodhouse <[email protected]> (C) 2012 Michel Lespinasse <[email protected]> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA linux/lib/rbtree.c */ #include <linux/rbtree_augmented.h> /* * red-black trees properties: http://en.wikipedia.org/wiki/Rbtree * * 1) A node is either red or black * 2) The root is black * 3) All leaves (NULL) are black * 4) Both children of every red node are black * 5) Every simple path from root to leaves contains the same number * of black nodes. * * 4 and 5 give the O(log n) guarantee, since 4 implies you cannot have two * consecutive red nodes in a path and every red node is therefore followed by * a black. So if B is the number of black nodes on every simple path (as per * 5), then the longest possible path due to 4 is 2B. * * We shall indicate color with case, where black nodes are uppercase and red * nodes will be lowercase. Unknown color nodes shall be drawn as red within * parentheses and have some accompanying text comment. */ static inline void rb_set_black(struct rb_node *rb) { rb->__rb_parent_color |= RB_BLACK; } static inline struct rb_node *rb_red_parent(struct rb_node *red) { return (struct rb_node *)red->__rb_parent_color; } /* * Helper function for rotations: * - old's parent and color get assigned to new * - old gets assigned new as a parent and 'color' as a color. */ static inline void __rb_rotate_set_parents(struct rb_node *old, struct rb_node *new, struct rb_root *root, int color) { struct rb_node *parent = rb_parent(old); new->__rb_parent_color = old->__rb_parent_color; rb_set_parent_color(old, new, color); __rb_change_child(old, new, parent, root); } static __always_inline void __rb_insert(struct rb_node *node, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { struct rb_node *parent = rb_red_parent(node), *gparent, *tmp; while (true) { /* * Loop invariant: node is red * * If there is a black parent, we are done. * Otherwise, take some corrective action as we don't * want a red root or two consecutive red nodes. */ if (!parent) { rb_set_parent_color(node, NULL, RB_BLACK); break; } else if (rb_is_black(parent)) break; gparent = rb_red_parent(parent); tmp = gparent->rb_right; if (parent != tmp) { /* parent == gparent->rb_left */ if (tmp && rb_is_red(tmp)) { /* * Case 1 - color flips * * G g * / \ / \ * p u --> P U * / / * n n * * However, since g's parent might be red, and * 4) does not allow this, we need to recurse * at g. */ rb_set_parent_color(tmp, gparent, RB_BLACK); rb_set_parent_color(parent, gparent, RB_BLACK); node = gparent; parent = rb_parent(node); rb_set_parent_color(node, parent, RB_RED); continue; } tmp = parent->rb_right; if (node == tmp) { /* * Case 2 - left rotate at parent * * G G * / \ / \ * p U --> n U * \ / * n p * * This still leaves us in violation of 4), the * continuation into Case 3 will fix that. */ parent->rb_right = tmp = node->rb_left; node->rb_left = parent; if (tmp) rb_set_parent_color(tmp, parent, RB_BLACK); rb_set_parent_color(parent, node, RB_RED); augment_rotate(parent, node); parent = node; tmp = node->rb_right; } /* * Case 3 - right rotate at gparent * * G P * / \ / \ * p U --> n g * / \ * n U */ gparent->rb_left = tmp; /* == parent->rb_right */ parent->rb_right = gparent; if (tmp) rb_set_parent_color(tmp, gparent, RB_BLACK); __rb_rotate_set_parents(gparent, parent, root, RB_RED); augment_rotate(gparent, parent); break; } else { tmp = gparent->rb_left; if (tmp && rb_is_red(tmp)) { /* Case 1 - color flips */ rb_set_parent_color(tmp, gparent, RB_BLACK); rb_set_parent_color(parent, gparent, RB_BLACK); node = gparent; parent = rb_parent(node); rb_set_parent_color(node, parent, RB_RED); continue; } tmp = parent->rb_left; if (node == tmp) { /* Case 2 - right rotate at parent */ parent->rb_left = tmp = node->rb_right; node->rb_right = parent; if (tmp) rb_set_parent_color(tmp, parent, RB_BLACK); rb_set_parent_color(parent, node, RB_RED); augment_rotate(parent, node); parent = node; tmp = node->rb_left; } /* Case 3 - left rotate at gparent */ gparent->rb_right = tmp; /* == parent->rb_left */ parent->rb_left = gparent; if (tmp) rb_set_parent_color(tmp, gparent, RB_BLACK); __rb_rotate_set_parents(gparent, parent, root, RB_RED); augment_rotate(gparent, parent); break; } } } /* * Inline version for rb_erase() use - we want to be able to inline * and eliminate the dummy_rotate callback there */ static __always_inline void ____rb_erase_color(struct rb_node *parent, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { struct rb_node *node = NULL, *sibling, *tmp1, *tmp2; while (true) { /* * Loop invariants: * - node is black (or NULL on first iteration) * - node is not the root (parent is not NULL) * - All leaf paths going through parent and node have a * black node count that is 1 lower than other leaf paths. */ sibling = parent->rb_right; if (node != sibling) { /* node == parent->rb_left */ if (rb_is_red(sibling)) { /* * Case 1 - left rotate at parent * * P S * / \ / \ * N s --> p Sr * / \ / \ * Sl Sr N Sl */ parent->rb_right = tmp1 = sibling->rb_left; sibling->rb_left = parent; rb_set_parent_color(tmp1, parent, RB_BLACK); __rb_rotate_set_parents(parent, sibling, root, RB_RED); augment_rotate(parent, sibling); sibling = tmp1; } tmp1 = sibling->rb_right; if (!tmp1 || rb_is_black(tmp1)) { tmp2 = sibling->rb_left; if (!tmp2 || rb_is_black(tmp2)) { /* * Case 2 - sibling color flip * (p could be either color here) * * (p) (p) * / \ / \ * N S --> N s * / \ / \ * Sl Sr Sl Sr * * This leaves us violating 5) which * can be fixed by flipping p to black * if it was red, or by recursing at p. * p is red when coming from Case 1. */ rb_set_parent_color(sibling, parent, RB_RED); if (rb_is_red(parent)) rb_set_black(parent); else { node = parent; parent = rb_parent(node); if (parent) continue; } break; } /* * Case 3 - right rotate at sibling * (p could be either color here) * * (p) (p) * / \ / \ * N S --> N Sl * / \ \ * sl Sr s * \ * Sr */ sibling->rb_left = tmp1 = tmp2->rb_right; tmp2->rb_right = sibling; parent->rb_right = tmp2; if (tmp1) rb_set_parent_color(tmp1, sibling, RB_BLACK); augment_rotate(sibling, tmp2); tmp1 = sibling; sibling = tmp2; } /* * Case 4 - left rotate at parent + color flips * (p and sl could be either color here. * After rotation, p becomes black, s acquires * p's color, and sl keeps its color) * * (p) (s) * / \ / \ * N S --> P Sr * / \ / \ * (sl) sr N (sl) */ parent->rb_right = tmp2 = sibling->rb_left; sibling->rb_left = parent; rb_set_parent_color(tmp1, sibling, RB_BLACK); if (tmp2) rb_set_parent(tmp2, parent); __rb_rotate_set_parents(parent, sibling, root, RB_BLACK); augment_rotate(parent, sibling); break; } else { sibling = parent->rb_left; if (rb_is_red(sibling)) { /* Case 1 - right rotate at parent */ parent->rb_left = tmp1 = sibling->rb_right; sibling->rb_right = parent; rb_set_parent_color(tmp1, parent, RB_BLACK); __rb_rotate_set_parents(parent, sibling, root, RB_RED); augment_rotate(parent, sibling); sibling = tmp1; } tmp1 = sibling->rb_left; if (!tmp1 || rb_is_black(tmp1)) { tmp2 = sibling->rb_right; if (!tmp2 || rb_is_black(tmp2)) { /* Case 2 - sibling color flip */ rb_set_parent_color(sibling, parent, RB_RED); if (rb_is_red(parent)) rb_set_black(parent); else { node = parent; parent = rb_parent(node); if (parent) continue; } break; } /* Case 3 - right rotate at sibling */ sibling->rb_right = tmp1 = tmp2->rb_left; tmp2->rb_left = sibling; parent->rb_left = tmp2; if (tmp1) rb_set_parent_color(tmp1, sibling, RB_BLACK); augment_rotate(sibling, tmp2); tmp1 = sibling; sibling = tmp2; } /* Case 4 - left rotate at parent + color flips */ parent->rb_left = tmp2 = sibling->rb_right; sibling->rb_right = parent; rb_set_parent_color(tmp1, sibling, RB_BLACK); if (tmp2) rb_set_parent(tmp2, parent); __rb_rotate_set_parents(parent, sibling, root, RB_BLACK); augment_rotate(parent, sibling); break; } } } /* Non-inline version for rb_erase_augmented() use */ void __rb_erase_color(struct rb_node *parent, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { ____rb_erase_color(parent, root, augment_rotate); } /* * Non-augmented rbtree manipulation functions. * * We use dummy augmented callbacks here, and have the compiler optimize them * out of the rb_insert_color() and rb_erase() function definitions. */ static inline void dummy_propagate(struct rb_node *node, struct rb_node *stop) {} static inline void dummy_copy(struct rb_node *old, struct rb_node *new) {} static inline void dummy_rotate(struct rb_node *old, struct rb_node *new) {} static const struct rb_augment_callbacks dummy_callbacks = { dummy_propagate, dummy_copy, dummy_rotate }; void rb_insert_color(struct rb_node *node, struct rb_root *root) { __rb_insert(node, root, dummy_rotate); } void rb_erase(struct rb_node *node, struct rb_root *root) { struct rb_node *rebalance; rebalance = __rb_erase_augmented(node, root, &dummy_callbacks); if (rebalance) ____rb_erase_color(rebalance, root, dummy_rotate); } /* * Augmented rbtree manipulation functions. * * This instantiates the same __always_inline functions as in the non-augmented * case, but this time with user-defined callbacks. */ void __rb_insert_augmented(struct rb_node *node, struct rb_root *root, void (*augment_rotate)(struct rb_node *old, struct rb_node *new)) { __rb_insert(node, root, augment_rotate); } /* * This function returns the first node (in sort order) of the tree. */ struct rb_node *rb_first(const struct rb_root *root) { struct rb_node *n; n = root->rb_node; if (!n) return NULL; while (n->rb_left) n = n->rb_left; return n; } struct rb_node *rb_last(const struct rb_root *root) { struct rb_node *n; n = root->rb_node; if (!n) return NULL; while (n->rb_right) n = n->rb_right; return n; } struct rb_node *rb_next(const struct rb_node *node) { struct rb_node *parent; if (RB_EMPTY_NODE(node)) return NULL; /* * If we have a right-hand child, go down and then left as far * as we can. */ if (node->rb_right) { node = node->rb_right; while (node->rb_left) node=node->rb_left; return (struct rb_node *)node; } /* * No right-hand children. Everything down and left is smaller than us, * so any 'next' node must be in the general direction of our parent. * Go up the tree; any time the ancestor is a right-hand child of its * parent, keep going up. First time it's a left-hand child of its * parent, said parent is our 'next' node. */ while ((parent = rb_parent(node)) && node == parent->rb_right) node = parent; return parent; } struct rb_node *rb_prev(const struct rb_node *node) { struct rb_node *parent; if (RB_EMPTY_NODE(node)) return NULL; /* * If we have a left-hand child, go down and then right as far * as we can. */ if (node->rb_left) { node = node->rb_left; while (node->rb_right) node=node->rb_right; return (struct rb_node *)node; } /* * No left-hand children. Go up till we find an ancestor which * is a right-hand child of its parent. */ while ((parent = rb_parent(node)) && node == parent->rb_left) node = parent; return parent; } void rb_replace_node(struct rb_node *victim, struct rb_node *new, struct rb_root *root) { struct rb_node *parent = rb_parent(victim); /* Set the surrounding nodes to point to the replacement */ __rb_change_child(victim, new, parent, root); if (victim->rb_left) rb_set_parent(victim->rb_left, new); if (victim->rb_right) rb_set_parent(victim->rb_right, new); /* Copy the pointers/colour from the victim to the replacement */ *new = *victim; } static struct rb_node *rb_left_deepest_node(const struct rb_node *node) { for (;;) { if (node->rb_left) node = node->rb_left; else if (node->rb_right) node = node->rb_right; else return (struct rb_node *)node; } } struct rb_node *rb_next_postorder(const struct rb_node *node) { const struct rb_node *parent; if (!node) return NULL; parent = rb_parent(node); /* If we're sitting on node, we've already seen our children */ if (parent && node == parent->rb_left && parent->rb_right) { /* If we are the parent's left node, go to the parent's right * node then all the way down to the left */ return rb_left_deepest_node(parent->rb_right); } else /* Otherwise we are the parent's right node, and the parent * should be next */ return (struct rb_node *)parent; } struct rb_node *rb_first_postorder(const struct rb_root *root) { if (!root->rb_node) return NULL; return rb_left_deepest_node(root->rb_node); }
{ "pile_set_name": "Github" }
## The contents of this file are subject to the Common Public Attribution ## License Version 1.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://code.reddit.com/LICENSE. The License is based on the Mozilla Public ## License Version 1.1, but Sections 14 and 15 have been added to cover use of ## software over a computer network and provide for limited attribution for the ## Original Developer. In addition, Exhibit A has been modified to be ## consistent with Exhibit B. ## ## Software distributed under the License is distributed on an "AS IS" basis, ## WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for ## the specific language governing rights and limitations under the License. ## ## The Original Code is reddit. ## ## The Original Developer is the Initial Developer. The Initial Developer of ## the Original Code is reddit Inc. ## ## All portions of the code written by reddit are Copyright (c) 2006-2015 ## reddit Inc. All Rights Reserved. ############################################################################### ${unsafe(thing.content)}
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `memalign` fn in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, memalign"> <title>libc::memalign - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a> <p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'memalign', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='index.html'>libc</a>::<wbr><a class='fn' href=''>memalign</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-1496' class='srclink' href='../src/libc/unix/notbsd/mod.rs.html#377' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn memalign(align: <a class='type' href='../libc/type.size_t.html' title='libc::size_t'>size_t</a>, size: <a class='type' href='../libc/type.size_t.html' title='libc::size_t'>size_t</a>) -&gt; *mut <a class='enum' href='../libc/enum.c_void.html' title='libc::c_void'>c_void</a></pre><div class='stability'><em class='stab unstable'>Unstable (<code>libc</code>)<p>: use <code>libc</code> from crates.io</p> </em></div></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSPopUpButton.h" @class XDDiagramView; @interface XDDiagramZoomPopUpButton : NSPopUpButton { XDDiagramView *_diagramView; } + (void)initialize; - (void)_diagramViewDidChangeZoomFactor:(id)arg1; - (id)diagramView; - (void)_setDiagramView:(id)arg1; - (void)_updatePopUpButtonItems; - (void)dealloc; - (id)initWithFrame:(struct CGRect)arg1; @end
{ "pile_set_name": "Github" }
--TEST-- Test Array Variable --FILE-- <?php $a[$b]; $a[1]; $a[$b][5][3]; $a[$b][5];?> --EXPECT-- <ModuleDeclaration start="0" end="48"> <ExpressionStatement start="6" end="13"> <ArrayVariableReference start="6" end="12" type="array" name="$a"> <VariableReference start="9" end="11" name="$b"> </VariableReference> </ArrayVariableReference> </ExpressionStatement> <ExpressionStatement start="14" end="20"> <ArrayVariableReference start="14" end="19" type="array" name="$a"> <Scalar start="17" end="18" type="int" value="1"> </Scalar> </ArrayVariableReference> </ExpressionStatement> <ExpressionStatement start="21" end="34"> <ReflectionArrayVariableReference start="21" end="33"> <ReflectionArrayVariableReference start="21" end="30"> <ArrayVariableReference start="21" end="27" type="array" name="$a"> <VariableReference start="24" end="26" name="$b"> </VariableReference> </ArrayVariableReference> <Scalar start="28" end="29" type="int" value="5"> </Scalar> </ReflectionArrayVariableReference> <Scalar start="31" end="32" type="int" value="3"> </Scalar> </ReflectionArrayVariableReference> </ExpressionStatement> <ExpressionStatement start="35" end="45"> <ReflectionArrayVariableReference start="35" end="44"> <ArrayVariableReference start="35" end="41" type="array" name="$a"> <VariableReference start="38" end="40" name="$b"> </VariableReference> </ArrayVariableReference> <Scalar start="42" end="43" type="int" value="5"> </Scalar> </ReflectionArrayVariableReference> </ExpressionStatement> <EmptyStatement start="45" end="47"> </EmptyStatement> </ModuleDeclaration>
{ "pile_set_name": "Github" }
package com.luv2code.aopdemo; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; @Configuration @EnableAspectJAutoProxy @ComponentScan("com.luv2code.aopdemo") public class DemoConfig { }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.codehaus.groovy.control; //import antlr.CharScanner; //import antlr.MismatchedCharException; //import antlr.MismatchedTokenException; //import antlr.NoViableAltException; //import antlr.NoViableAltForCharException; import groovy.lang.GroovyClassLoader; import org.codehaus.groovy.GroovyBugError; import org.codehaus.groovy.ast.ASTNode; import org.codehaus.groovy.ast.ModuleNode; import org.codehaus.groovy.control.io.FileReaderSource; import org.codehaus.groovy.control.io.ReaderSource; import org.codehaus.groovy.control.io.StringReaderSource; import org.codehaus.groovy.control.io.URLReaderSource; import org.codehaus.groovy.control.messages.Message; import org.codehaus.groovy.control.messages.SimpleMessage; import org.codehaus.groovy.control.messages.SyntaxErrorMessage; import org.codehaus.groovy.syntax.Reduction; import org.codehaus.groovy.syntax.SyntaxException; import org.codehaus.groovy.tools.Utilities; import java.io.File; import java.io.IOException; import java.io.Reader; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; /** * Provides an anchor for a single source unit (usually a script file) * as it passes through the compiler system. */ public class SourceUnit extends ProcessingUnit { /** * The pluggable parser used to generate the AST - we allow * pluggability currently as we need to have Classic and JSR support */ private ParserPlugin parserPlugin; /** * Where we can get Readers for our source unit */ protected ReaderSource source; /** * A descriptive name of the source unit. This name shouldn't * be used for controlling the SourceUnit, it is only for error * messages and to determine the name of the class for * a script. */ protected String name; /** * A Concrete Syntax Tree of the source */ protected Reduction cst; /** * The root of the Abstract Syntax Tree for the source */ protected ModuleNode ast; /** * Initializes the SourceUnit from existing machinery. */ public SourceUnit(String name, ReaderSource source, CompilerConfiguration flags, GroovyClassLoader loader, ErrorCollector er) { super(flags, loader, er); this.name = name; this.source = source; } /** * Initializes the SourceUnit from the specified file. */ public SourceUnit(File source, CompilerConfiguration configuration, GroovyClassLoader loader, ErrorCollector er) { this(source.getPath(), new FileReaderSource(source, configuration), configuration, loader, er); } /** * Initializes the SourceUnit from the specified URL. */ public SourceUnit(URL source, CompilerConfiguration configuration, GroovyClassLoader loader, ErrorCollector er) { this(source.toExternalForm(), new URLReaderSource(source, configuration), configuration, loader, er); } /** * Initializes the SourceUnit for a string of source. */ public SourceUnit(String name, String source, CompilerConfiguration configuration, GroovyClassLoader loader, ErrorCollector er) { this(name, new StringReaderSource(source, configuration), configuration, loader, er); } /** * Returns the name for the SourceUnit. This name shouldn't * be used for controlling the SourceUnit, it is only for error * messages */ public String getName() { return name; } /** * Returns the Concrete Syntax Tree produced during parse()ing. */ public Reduction getCST() { return this.cst; } /** * Returns the Abstract Syntax Tree produced during convert()ing * and expanded during later phases. */ public ModuleNode getAST() { return this.ast; } /** * Convenience routine, primarily for use by the InteractiveShell, * that returns true if parse() failed with an unexpected EOF. */ public boolean failedWithUnexpectedEOF() { // Implementation note - there are several ways for the Groovy compiler // to report an unexpected EOF. Perhaps this implementation misses some. // If you find another way, please add it. if (getErrorCollector().hasErrors()) { Message last = (Message) getErrorCollector().getLastError(); Throwable cause = null; if (last instanceof SyntaxErrorMessage) { cause = ((SyntaxErrorMessage) last).getCause().getCause(); } // if (cause != null) { // if (cause instanceof NoViableAltException) { // return isEofToken(((NoViableAltException) cause).token); // } else if (cause instanceof NoViableAltForCharException) { // char badChar = ((NoViableAltForCharException) cause).foundChar; // return badChar == CharScanner.EOF_CHAR; // } else if (cause instanceof MismatchedCharException) { // char badChar = (char) ((MismatchedCharException) cause).foundChar; // return badChar == CharScanner.EOF_CHAR; // } else if (cause instanceof MismatchedTokenException) { // return isEofToken(((MismatchedTokenException) cause).token); // } // } return true; } return false; } // protected boolean isEofToken(antlr.Token token) { // return token.getType() == antlr.Token.EOF_TYPE; // } //--------------------------------------------------------------------------- // FACTORIES /** * A convenience routine to create a standalone SourceUnit on a String * with defaults for almost everything that is configurable. */ public static SourceUnit create(String name, String source) { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setTolerance(1); return new SourceUnit(name, source, configuration, null, new ErrorCollector(configuration)); } /** * A convenience routine to create a standalone SourceUnit on a String * with defaults for almost everything that is configurable. */ public static SourceUnit create(String name, String source, int tolerance) { CompilerConfiguration configuration = new CompilerConfiguration(); configuration.setTolerance(tolerance); return new SourceUnit(name, source, configuration, null, new ErrorCollector(configuration)); } //--------------------------------------------------------------------------- // PROCESSING /** * Parses the source to a CST. You can retrieve it with getCST(). */ public void parse() throws CompilationFailedException { if (this.phase > Phases.PARSING) { throw new GroovyBugError("parsing is already complete"); } if (this.phase == Phases.INITIALIZATION) { nextPhase(); } // // Create a reader on the source and run the parser. try (Reader reader = source.getReader()) { // let's recreate the parser each time as it tends to keep around state parserPlugin = getConfiguration().getPluginFactory().createParserPlugin(); cst = parserPlugin.parseCST(this, reader); } catch (IOException e) { getErrorCollector().addFatalError(new SimpleMessage(e.getMessage(), this)); } } /** * Generates an AST from the CST. You can retrieve it with getAST(). */ public void convert() throws CompilationFailedException { if (this.phase == Phases.PARSING && this.phaseComplete) { gotoPhase(Phases.CONVERSION); } if (this.phase != Phases.CONVERSION) { throw new GroovyBugError("SourceUnit not ready for convert()"); } // // Build the AST buildAST(); String property = (String) AccessController.doPrivileged((PrivilegedAction) () -> System.getProperty("groovy.ast")); if ("xml".equals(property)) { XStreamUtils.serialize(name, ast); } } public ModuleNode buildAST() { if (null != this.ast) { return this.ast; } try { this.ast = parserPlugin.buildAST(this, this.classLoader, this.cst); this.ast.setDescription(this.name); } catch (SyntaxException e) { if (this.ast == null) { // Create a dummy ModuleNode to represent a failed parse - in case a later phase attempts to use the ast this.ast = new ModuleNode(this); } getErrorCollector().addError(new SyntaxErrorMessage(e, this)); } return this.ast; } //--------------------------------------------------------------------------- // SOURCE SAMPLING /** * Returns a sampling of the source at the specified line and column, * or null if it is unavailable. */ public String getSample(int line, int column, Janitor janitor) { String sample = null; String text = source.getLine(line, janitor); if (text != null) { if (column > 0) { String marker = Utilities.repeatString(" ", column - 1) + "^"; if (column > 40) { int start = column - 30 - 1; int end = (column + 10 > text.length() ? text.length() : column + 10 - 1); sample = " " + text.substring(start, end) + Utilities.eol() + " " + marker.substring(start); } else { sample = " " + text + Utilities.eol() + " " + marker; } } else { sample = text; } } return sample; } /** * This method adds an exception to the error collector. The Exception most likely has no line number attached to it. * For this reason you should use this method sparingly. Prefer using addError for syntax errors or add an error * to the {@link ErrorCollector} directly by retrieving it with getErrorCollector(). * * @param e the exception that occurred * @throws CompilationFailedException on error */ public void addException(Exception e) throws CompilationFailedException { getErrorCollector().addException(e, this); } /** * This method adds a SyntaxException to the error collector. The exception should specify the line and column * number of the error. This method should be reserved for real errors in the syntax of the SourceUnit. If * your error is not in syntax, and is a semantic error, or more general error, then use addException or use * the error collector directly by retrieving it with getErrorCollector(). * * @param se the exception, which should have line and column information * @throws CompilationFailedException on error */ public void addError(SyntaxException se) throws CompilationFailedException { getErrorCollector().addError(se, this); } /** * Convenience wrapper for {@link ErrorCollector#addFatalError(org.codehaus.groovy.control.messages.Message)}. * * @param msg the error message * @param node the AST node * @throws CompilationFailedException on error * @since 3.0.0 */ public void addFatalError(String msg, ASTNode node) throws CompilationFailedException { getErrorCollector().addFatalError( new SyntaxErrorMessage( new SyntaxException( msg, node.getLineNumber(), node.getColumnNumber(), node.getLastLineNumber(), node.getLastColumnNumber() ), this ) ); } public void addErrorAndContinue(SyntaxException se) throws CompilationFailedException { getErrorCollector().addErrorAndContinue(se, this); } public ReaderSource getSource() { return source; } public void setSource(ReaderSource source) { this.source = source; } }
{ "pile_set_name": "Github" }
/* http://keith-wood.name/calendars.html English/UK localisation for Gregorian/Julian calendars for jQuery. Stuart. */ (function($) { $.calendars.calendars.gregorian.prototype.regional['en-GB'] = { name: 'Gregorian', epochs: ['BCE', 'CE'], monthNames: ['January','February','March','April','May','June', 'July','August','September','October','November','December'], monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], dateFormat: 'dd/mm/yyyy', firstDay: 1, isRTL: false }; if ($.calendars.calendars.julian) { $.calendars.calendars.julian.prototype.regional['en-GB'] = $.calendars.calendars.gregorian.prototype.regional['en-GB']; } })(jQuery);
{ "pile_set_name": "Github" }
2020.8.13 (2020-08-13) ====================== Bug Fixes --------- - Fixed behaviour of ``pipenv uninstall --all-dev``. From now on it does not uninstall regular packages. `#3722 <https://github.com/pypa/pipenv/issues/3722>`_ - Fix a bug that incorrect Python path will be used when ``--system`` flag is on. `#4315 <https://github.com/pypa/pipenv/issues/4315>`_ - Fix falsely flagging a Homebrew installed Python as a virtual environment `#4316 <https://github.com/pypa/pipenv/issues/4316>`_ - Fix a bug that ``pipenv uninstall`` throws an exception that does not exist. `#4321 <https://github.com/pypa/pipenv/issues/4321>`_ - Fix a bug that Pipenv can't locate the correct file of special directives in ``setup.cfg`` of an editable package. `#4335 <https://github.com/pypa/pipenv/issues/4335>`_ - Fix a bug that ``setup.py`` can't be parsed correctly when the assignment is type-annotated. `#4342 <https://github.com/pypa/pipenv/issues/4342>`_ - Fix a bug that ``pipenv graph`` throws an exception that PipenvCmdError(cmd_string, c.out, c.err, return_code). `#4388 <https://github.com/pypa/pipenv/issues/4388>`_ - Do not copy the whole directory tree of local file package. `#4403 <https://github.com/pypa/pipenv/issues/4403>`_ - Correctly detect whether Pipenv in run under an activated virtualenv. `#4412 <https://github.com/pypa/pipenv/issues/4412>`_ Vendored Libraries ------------------ - Update ``requirementslib`` to ``1.5.12``. `#4385 <https://github.com/pypa/pipenv/issues/4385>`_ - * Update ``requirements`` to ``1.5.13``. * Update ``pip-shims`` to ``0.5.3``. `#4421 <https://github.com/pypa/pipenv/issues/4421>`_ 2020.6.2 (2020-06-02) ===================== Features & Improvements ----------------------- - Pipenv will now detect existing ``venv`` and ``virtualenv`` based virtual environments more robustly. `#4276 <https://github.com/pypa/pipenv/issues/4276>`_ Bug Fixes --------- - ``+`` signs in URL authentication fragments will no longer be incorrectly replaced with space ( `` `` ) characters. `#4271 <https://github.com/pypa/pipenv/issues/4271>`_ - Fixed a regression which caused Pipenv to fail when running under ``/``. `#4273 <https://github.com/pypa/pipenv/issues/4273>`_ - ``setup.py`` files with ``version`` variables read from ``os.environ`` are now able to be parsed successfully. `#4274 <https://github.com/pypa/pipenv/issues/4274>`_ - Fixed a bug which caused Pipenv to fail to install packages in a virtual environment if those packages were already present in the system global environment. `#4276 <https://github.com/pypa/pipenv/issues/4276>`_ - Fix a bug that caused non-specific versions to be pinned in ``Pipfile.lock``. `#4278 <https://github.com/pypa/pipenv/issues/4278>`_ - Corrected a missing exception import and invalid function call invocations in ``pipenv.cli.command``. `#4286 <https://github.com/pypa/pipenv/issues/4286>`_ - Fixed an issue with resolving packages with names defined by function calls in ``setup.py``. `#4292 <https://github.com/pypa/pipenv/issues/4292>`_ - Fixed a regression with installing the current directory, or ``.``, inside a ``venv`` based virtual environment. `#4295 <https://github.com/pypa/pipenv/issues/4295>`_ - Fixed a bug with the discovery of python paths on Windows which could prevent installation of environments during ``pipenv install``. `#4296 <https://github.com/pypa/pipenv/issues/4296>`_ - Fixed an issue in the ``requirementslib`` AST parser which prevented parsing of ``setup.py`` files for dependency metadata. `#4298 <https://github.com/pypa/pipenv/issues/4298>`_ - Fix a bug where Pipenv doesn't realize the session is interactive `#4305 <https://github.com/pypa/pipenv/issues/4305>`_ Vendored Libraries ------------------ - Updated requirementslib to version ``1.5.11``. `#4292 <https://github.com/pypa/pipenv/issues/4292>`_ - Updated vendored dependencies: - **pythonfinder**: ``1.2.2`` => ``1.2.4`` - **requirementslib**: ``1.5.9`` => ``1.5.10`` `#4302 <https://github.com/pypa/pipenv/issues/4302>`_ 2020.5.28 (2020-05-28) ====================== Features & Improvements ----------------------- - ``pipenv install`` and ``pipenv sync`` will no longer attempt to install satisfied dependencies during installation. `#3057 <https://github.com/pypa/pipenv/issues/3057>`_, `#3506 <https://github.com/pypa/pipenv/issues/3506>`_ - Added support for resolution of direct-url dependencies in ``setup.py`` files to respect ``PEP-508`` style URL dependencies. `#3148 <https://github.com/pypa/pipenv/issues/3148>`_ - Added full support for resolution of all dependency types including direct URLs, zip archives, tarballs, etc. - Improved error handling and formatting. - Introduced improved cross platform stream wrappers for better ``stdout`` and ``stderr`` consistency. `#3298 <https://github.com/pypa/pipenv/issues/3298>`_ - For consistency with other commands and the ``--dev`` option description, ``pipenv lock --requirements --dev`` now emits both default and development dependencies. The new ``--dev-only`` option requests the previous behaviour (e.g. to generate a ``dev-requirements.txt`` file). `#3316 <https://github.com/pypa/pipenv/issues/3316>`_ - Pipenv will now successfully recursively lock VCS sub-dependencies. `#3328 <https://github.com/pypa/pipenv/issues/3328>`_ - Added support for ``--verbose`` output to ``pipenv run``. `#3348 <https://github.com/pypa/pipenv/issues/3348>`_ - Pipenv will now discover and resolve the intrinsic dependencies of **all** VCS dependencies, whether they are editable or not, to prevent resolution conflicts. `#3368 <https://github.com/pypa/pipenv/issues/3368>`_ - Added a new environment variable, ``PIPENV_RESOLVE_VCS``, to toggle dependency resolution off for non-editable VCS, file, and URL based dependencies. `#3577 <https://github.com/pypa/pipenv/issues/3577>`_ - Added the ability for Windows users to enable emojis by setting ``PIPENV_HIDE_EMOJIS=0``. `#3595 <https://github.com/pypa/pipenv/issues/3595>`_ - Allow overriding PIPENV_INSTALL_TIMEOUT environment variable (in seconds). `#3652 <https://github.com/pypa/pipenv/issues/3652>`_ - Allow overriding PIP_EXISTS_ACTION evironment variable (value is passed to pip install). Possible values here: https://pip.pypa.io/en/stable/reference/pip/#exists-action-option Useful when you need to `PIP_EXISTS_ACTION=i` (ignore existing packages) - great for CI environments, where you need really fast setup. `#3738 <https://github.com/pypa/pipenv/issues/3738>`_ - Pipenv will no longer forcibly override ``PIP_NO_DEPS`` on all vcs and file dependencies as resolution happens on these in a pre-lock step. `#3763 <https://github.com/pypa/pipenv/issues/3763>`_ - Improved verbose logging output during ``pipenv lock`` will now stream output to the console while maintaining a spinner. `#3810 <https://github.com/pypa/pipenv/issues/3810>`_ - Added support for automatic python installs via ``asdf`` and associated ``PIPENV_DONT_USE_ASDF`` environment variable. `#4018 <https://github.com/pypa/pipenv/issues/4018>`_ - Pyenv/asdf can now be used whether or not they are available on PATH. Setting PYENV_ROOT/ASDF_DIR in a Pipenv's .env allows Pipenv to install an interpreter without any shell customizations, so long as pyenv/asdf is installed. `#4245 <https://github.com/pypa/pipenv/issues/4245>`_ - Added ``--key`` command line parameter for including personal PyUp.io API tokens when running ``pipenv check``. `#4257 <https://github.com/pypa/pipenv/issues/4257>`_ Behavior Changes ---------------- - Make conservative checks of known exceptions when subprocess returns output, so user won't see the whole traceback - just the error. `#2553 <https://github.com/pypa/pipenv/issues/2553>`_ - Do not touch Pipfile early and rely on it so that one can do ``pipenv sync`` without a Pipfile. `#3386 <https://github.com/pypa/pipenv/issues/3386>`_ - Re-enable ``--help`` option for ``pipenv run`` command. `#3844 <https://github.com/pypa/pipenv/issues/3844>`_ - Make sure ``pipenv lock -r --pypi-mirror {MIRROR_URL}`` will respect the pypi-mirror in requirements output. `#4199 <https://github.com/pypa/pipenv/issues/4199>`_ Bug Fixes --------- - Raise `PipenvUsageError` when [[source]] does not contain url field. `#2373 <https://github.com/pypa/pipenv/issues/2373>`_ - Fixed a bug which caused editable package resolution to sometimes fail with an unhelpful setuptools-related error message. `#2722 <https://github.com/pypa/pipenv/issues/2722>`_ - Fixed an issue which caused errors due to reliance on the system utilities ``which`` and ``where`` which may not always exist on some systems. - Fixed a bug which caused periodic failures in python discovery when executables named ``python`` were not present on the target ``$PATH``. `#2783 <https://github.com/pypa/pipenv/issues/2783>`_ - Dependency resolution now writes hashes for local and remote files to the lockfile. `#3053 <https://github.com/pypa/pipenv/issues/3053>`_ - Fixed a bug which prevented ``pipenv graph`` from correctly showing all dependencies when running from within ``pipenv shell``. `#3071 <https://github.com/pypa/pipenv/issues/3071>`_ - Fixed resolution of direct-url dependencies in ``setup.py`` files to respect ``PEP-508`` style URL dependencies. `#3148 <https://github.com/pypa/pipenv/issues/3148>`_ - Fixed a bug which caused failures in warning reporting when running pipenv inside a virtualenv under some circumstances. - Fixed a bug with package discovery when running ``pipenv clean``. `#3298 <https://github.com/pypa/pipenv/issues/3298>`_ - Quote command arguments with carets (``^``) on Windows to work around unintended shell escapes. `#3307 <https://github.com/pypa/pipenv/issues/3307>`_ - Handle alternate names for UTF-8 encoding. `#3313 <https://github.com/pypa/pipenv/issues/3313>`_ - Abort pipenv before adding the non-exist package to Pipfile. `#3318 <https://github.com/pypa/pipenv/issues/3318>`_ - Don't normalize the package name user passes in. `#3324 <https://github.com/pypa/pipenv/issues/3324>`_ - Fix a bug where custom virtualenv can not be activated with pipenv shell `#3339 <https://github.com/pypa/pipenv/issues/3339>`_ - Fix a bug that ``--site-packages`` flag is not recognized. `#3351 <https://github.com/pypa/pipenv/issues/3351>`_ - Fix a bug where pipenv --clear is not working `#3353 <https://github.com/pypa/pipenv/issues/3353>`_ - Fix unhashable type error during ``$ pipenv install --selective-upgrade`` `#3384 <https://github.com/pypa/pipenv/issues/3384>`_ - Dependencies with direct ``PEP508`` compliant VCS URLs specified in their ``install_requires`` will now be successfully locked during the resolution process. `#3396 <https://github.com/pypa/pipenv/issues/3396>`_ - Fixed a keyerror which could occur when locking VCS dependencies in some cases. `#3404 <https://github.com/pypa/pipenv/issues/3404>`_ - Fixed a bug that ``ValidationError`` is thrown when some fields are missing in source section. `#3427 <https://github.com/pypa/pipenv/issues/3427>`_ - Updated the index names in lock file when source name in Pipfile is changed. `#3449 <https://github.com/pypa/pipenv/issues/3449>`_ - Fixed an issue which caused ``pipenv install --help`` to show duplicate entries for ``--pre``. `#3479 <https://github.com/pypa/pipenv/issues/3479>`_ - Fix bug causing ``[SSL: CERTIFICATE_VERIFY_FAILED]`` when Pipfile ``[[source]]`` has verify_ssl=false and url with custom port. `#3502 <https://github.com/pypa/pipenv/issues/3502>`_ - Fix ``sync --sequential`` ignoring ``pip install`` errors and logs. `#3537 <https://github.com/pypa/pipenv/issues/3537>`_ - Fix the issue that lock file can't be created when ``PIPENV_PIPFILE`` is not under working directory. `#3584 <https://github.com/pypa/pipenv/issues/3584>`_ - Pipenv will no longer inadvertently set ``editable=True`` on all vcs dependencies. `#3647 <https://github.com/pypa/pipenv/issues/3647>`_ - The ``--keep-outdated`` argument to ``pipenv install`` and ``pipenv lock`` will now drop specifier constraints when encountering editable dependencies. - In addition, ``--keep-outdated`` will retain specifiers that would otherwise be dropped from any entries that have not been updated. `#3656 <https://github.com/pypa/pipenv/issues/3656>`_ - Fixed a bug which sometimes caused pipenv to fail to respect the ``--site-packages`` flag when passed with ``pipenv install``. `#3718 <https://github.com/pypa/pipenv/issues/3718>`_ - Normalize the package names to lowercase when comparing used and in-Pipfile packages. `#3745 <https://github.com/pypa/pipenv/issues/3745>`_ - ``pipenv update --outdated`` will now correctly handle comparisons between pre/post-releases and normal releases. `#3766 <https://github.com/pypa/pipenv/issues/3766>`_ - Fixed a ``KeyError`` which could occur when pinning outdated VCS dependencies via ``pipenv lock --keep-outdated``. `#3768 <https://github.com/pypa/pipenv/issues/3768>`_ - Resolved an issue which caused resolution to fail when encountering poorly formatted ``python_version`` markers in ``setup.py`` and ``setup.cfg`` files. `#3786 <https://github.com/pypa/pipenv/issues/3786>`_ - Fix a bug that installation errors are displayed as a list. `#3794 <https://github.com/pypa/pipenv/issues/3794>`_ - Update ``pythonfinder`` to fix a problem that ``python.exe`` will be mistakenly chosen for virtualenv creation under WSL. `#3807 <https://github.com/pypa/pipenv/issues/3807>`_ - Fixed several bugs which could prevent editable VCS dependencies from being installed into target environments, even when reporting successful installation. `#3809 <https://github.com/pypa/pipenv/issues/3809>`_ - ``pipenv check --system`` should find the correct Python interpreter when ``python`` does not exist on the system. `#3819 <https://github.com/pypa/pipenv/issues/3819>`_ - Resolve the symlinks when the path is absolute. `#3842 <https://github.com/pypa/pipenv/issues/3842>`_ - Pass ``--pre`` and ``--clear`` options to ``pipenv update --outdated``. `#3879 <https://github.com/pypa/pipenv/issues/3879>`_ - Fixed a bug which prevented resolution of direct URL dependencies which have PEP508 style direct url VCS sub-dependencies with subdirectories. `#3976 <https://github.com/pypa/pipenv/issues/3976>`_ - Honor PIPENV_SPINNER environment variable `#4045 <https://github.com/pypa/pipenv/issues/4045>`_ - Fixed an issue with ``pipenv check`` failing due to an invalid API key from ``pyup.io``. `#4188 <https://github.com/pypa/pipenv/issues/4188>`_ - Fixed a bug which caused versions from VCS dependencies to be included in ``Pipfile.lock`` inadvertently. `#4217 <https://github.com/pypa/pipenv/issues/4217>`_ - Fixed a bug which caused pipenv to search non-existent virtual environments for ``pip`` when installing using ``--system``. `#4220 <https://github.com/pypa/pipenv/issues/4220>`_ - ``Requires-Python`` values specifying constraint versions of python starting from ``1.x`` will now be parsed successfully. `#4226 <https://github.com/pypa/pipenv/issues/4226>`_ - Fix a bug of ``pipenv update --outdated`` that can't print output correctly. `#4229 <https://github.com/pypa/pipenv/issues/4229>`_ - Fixed a bug which caused pipenv to prefer source distributions over wheels from ``PyPI`` during the dependency resolution phase. Fixed an issue which prevented proper build isolation using ``pep517`` based builders during dependency resolution. `#4231 <https://github.com/pypa/pipenv/issues/4231>`_ - Don't fallback to system Python when no matching Python version is found. `#4232 <https://github.com/pypa/pipenv/issues/4232>`_ Vendored Libraries ------------------ - Updated vendored dependencies: - **attrs**: ``18.2.0`` => ``19.1.0`` - **certifi**: ``2018.10.15`` => ``2019.3.9`` - **cached_property**: ``1.4.3`` => ``1.5.1`` - **cerberus**: ``1.2.0`` => ``1.3.1`` - **click-completion**: ``0.5.0`` => ``0.5.1`` - **colorama**: ``0.3.9`` => ``0.4.1`` - **distlib**: ``0.2.8`` => ``0.2.9`` - **idna**: ``2.7`` => ``2.8`` - **jinja2**: ``2.10.0`` => ``2.10.1`` - **markupsafe**: ``1.0`` => ``1.1.1`` - **orderedmultidict**: ``(new)`` => ``1.0`` - **packaging**: ``18.0`` => ``19.0`` - **parse**: ``1.9.0`` => ``1.12.0`` - **pathlib2**: ``2.3.2`` => ``2.3.3`` - **pep517**: ``(new)`` => ``0.5.0`` - **pexpect**: ``4.6.0`` => ``4.7.0`` - **pipdeptree**: ``0.13.0`` => ``0.13.2`` - **pyparsing**: ``2.2.2`` => ``2.3.1`` - **python-dotenv**: ``0.9.1`` => ``0.10.2`` - **pythonfinder**: ``1.1.10`` => ``1.2.1`` - **pytoml**: ``(new)`` => ``0.1.20`` - **requests**: ``2.20.1`` => ``2.21.0`` - **requirementslib**: ``1.3.3`` => ``1.5.0`` - **scandir**: ``1.9.0`` => ``1.10.0`` - **shellingham**: ``1.2.7`` => ``1.3.1`` - **six**: ``1.11.0`` => ``1.12.0`` - **tomlkit**: ``0.5.2`` => ``0.5.3`` - **urllib3**: ``1.24`` => ``1.25.2`` - **vistir**: ``0.3.0`` => ``0.4.1`` - **yaspin**: ``0.14.0`` => ``0.14.3`` - Removed vendored dependency **cursor**. `#3298 <https://github.com/pypa/pipenv/issues/3298>`_ - Updated ``pip_shims`` to support ``--outdated`` with new pip versions. `#3766 <https://github.com/pypa/pipenv/issues/3766>`_ - Update vendored dependencies and invocations - Update vendored and patched dependencies - Update patches on ``piptools``, ``pip``, ``pip-shims``, ``tomlkit` - Fix invocations of dependencies - Fix custom ``InstallCommand` instantiation - Update ``PackageFinder` usage - Fix ``Bool` stringify attempts from ``tomlkit` Updated vendored dependencies: - **attrs**: ```18.2.0`` => ```19.1.0`` - **certifi**: ```2018.10.15`` => ```2019.3.9`` - **cached_property**: ```1.4.3`` => ```1.5.1`` - **cerberus**: ```1.2.0`` => ```1.3.1`` - **click**: ```7.0.0`` => ```7.1.1`` - **click-completion**: ```0.5.0`` => ```0.5.1`` - **colorama**: ```0.3.9`` => ```0.4.3`` - **contextlib2**: ```(new)`` => ```0.6.0.post1`` - **distlib**: ```0.2.8`` => ```0.2.9`` - **funcsigs**: ```(new)`` => ```1.0.2`` - **importlib_metadata** ```1.3.0`` => ```1.5.1`` - **importlib-resources**: ```(new)`` => ```1.4.0`` - **idna**: ```2.7`` => ```2.9`` - **jinja2**: ```2.10.0`` => ```2.11.1`` - **markupsafe**: ```1.0`` => ```1.1.1`` - **more-itertools**: ```(new)`` => ```5.0.0`` - **orderedmultidict**: ```(new)`` => ```1.0`` - **packaging**: ```18.0`` => ```19.0`` - **parse**: ```1.9.0`` => ```1.15.0`` - **pathlib2**: ```2.3.2`` => ```2.3.3`` - **pep517**: ```(new)`` => ```0.5.0`` - **pexpect**: ```4.6.0`` => ```4.8.0`` - **pip-shims**: ```0.2.0`` => ```0.5.1`` - **pipdeptree**: ```0.13.0`` => ```0.13.2`` - **pyparsing**: ```2.2.2`` => ```2.4.6`` - **python-dotenv**: ```0.9.1`` => ```0.10.2`` - **pythonfinder**: ```1.1.10`` => ```1.2.2`` - **pytoml**: ```(new)`` => ```0.1.20`` - **requests**: ```2.20.1`` => ```2.23.0`` - **requirementslib**: ```1.3.3`` => ```1.5.4`` - **scandir**: ```1.9.0`` => ```1.10.0`` - **shellingham**: ```1.2.7`` => ```1.3.2`` - **six**: ```1.11.0`` => ```1.14.0`` - **tomlkit**: ```0.5.2`` => ```0.5.11`` - **urllib3**: ```1.24`` => ```1.25.8`` - **vistir**: ```0.3.0`` => ```0.5.0`` - **yaspin**: ```0.14.0`` => ```0.14.3`` - **zipp**: ```0.6.0`` - Removed vendored dependency **cursor**. `#4169 <https://github.com/pypa/pipenv/issues/4169>`_ - Add and update vendored dependencies to accommodate ``safety`` vendoring: - **safety** ``(none)`` => ``1.8.7`` - **dparse** ``(none)`` => ``0.5.0`` - **pyyaml** ``(none)`` => ``5.3.1`` - **urllib3** ``1.25.8`` => ``1.25.9`` - **certifi** ``2019.11.28`` => ``2020.4.5.1`` - **pyparsing** ``2.4.6`` => ``2.4.7`` - **resolvelib** ``0.2.2`` => ``0.3.0`` - **importlib-metadata** ``1.5.1`` => ``1.6.0`` - **pip-shims** ``0.5.1`` => ``0.5.2`` - **requirementslib** ``1.5.5`` => ``1.5.6`` `#4188 <https://github.com/pypa/pipenv/issues/4188>`_ - Updated vendored ``pip`` => ``20.0.2`` and ``pip-tools`` => ``5.0.0``. `#4215 <https://github.com/pypa/pipenv/issues/4215>`_ - Updated vendored dependencies to latest versions for security and bug fixes: - **requirementslib** ``1.5.8`` => ``1.5.9`` - **vistir** ``0.5.0`` => ``0.5.1`` - **jinja2** ``2.11.1`` => ``2.11.2`` - **click** ``7.1.1`` => ``7.1.2`` - **dateutil** ``(none)`` => ``2.8.1`` - **backports.functools_lru_cache** ``1.5.0`` => ``1.6.1`` - **enum34** ``1.1.6`` => ``1.1.10`` - **toml** ``0.10.0`` => ``0.10.1`` - **importlib_resources** ``1.4.0`` => ``1.5.0`` `#4226 <https://github.com/pypa/pipenv/issues/4226>`_ - Changed attrs import path in vendored dependencies to always import from ``pipenv.vendor``. `#4267 <https://github.com/pypa/pipenv/issues/4267>`_ Improved Documentation ---------------------- - Added documenation about variable expansion in ``Pipfile`` entries. `#2317 <https://github.com/pypa/pipenv/issues/2317>`_ - Consolidate all contributing docs in the rst file `#3120 <https://github.com/pypa/pipenv/issues/3120>`_ - Update the out-dated manual page. `#3246 <https://github.com/pypa/pipenv/issues/3246>`_ - Move CLI docs to its own page. `#3346 <https://github.com/pypa/pipenv/issues/3346>`_ - Replace (non-existant) video on docs index.rst with equivalent gif. `#3499 <https://github.com/pypa/pipenv/issues/3499>`_ - Clarify wording in Basic Usage example on using double quotes to escape shell redirection `#3522 <https://github.com/pypa/pipenv/issues/3522>`_ - Ensure docs show navigation on small-screen devices `#3527 <https://github.com/pypa/pipenv/issues/3527>`_ - Added a link to the TOML Spec under General Recommendations & Version Control to clarify how Pipfiles should be written. `#3629 <https://github.com/pypa/pipenv/issues/3629>`_ - Updated the documentation with the new ``pytest`` entrypoint. `#3759 <https://github.com/pypa/pipenv/issues/3759>`_ - Fix link to GIF in README.md demonstrating Pipenv's usage, and add descriptive alt text. `#3911 <https://github.com/pypa/pipenv/issues/3911>`_ - Added a line describing potential issues in fancy extension. `#3912 <https://github.com/pypa/pipenv/issues/3912>`_ - Documental description of how Pipfile works and association with Pipenv. `#3913 <https://github.com/pypa/pipenv/issues/3913>`_ - Clarify the proper value of ``python_version`` and ``python_full_version``. `#3914 <https://github.com/pypa/pipenv/issues/3914>`_ - Write description for --deploy extension and few extensions differences. `#3915 <https://github.com/pypa/pipenv/issues/3915>`_ - More documentation for ``.env`` files `#4100 <https://github.com/pypa/pipenv/issues/4100>`_ - Updated documentation to point to working links. `#4137 <https://github.com/pypa/pipenv/issues/4137>`_ - Replace docs.pipenv.org with pipenv.pypa.io `#4167 <https://github.com/pypa/pipenv/issues/4167>`_ - Added functionality to check spelling in documentation and cleaned up existing typographical issues. `#4209 <https://github.com/pypa/pipenv/issues/4209>`_ 2018.11.26 (2018-11-26) ======================= Bug Fixes --------- - Environment variables are expanded correctly before running scripts on POSIX. `#3178 <https://github.com/pypa/pipenv/issues/3178>`_ - Pipenv will no longer disable user-mode installation when the ``--system`` flag is passed in. `#3222 <https://github.com/pypa/pipenv/issues/3222>`_ - Fixed an issue with attempting to render unicode output in non-unicode locales. `#3223 <https://github.com/pypa/pipenv/issues/3223>`_ - Fixed a bug which could cause failures to occur when parsing python entries from global pyenv version files. `#3224 <https://github.com/pypa/pipenv/issues/3224>`_ - Fixed an issue which prevented the parsing of named extras sections from certain ``setup.py`` files. `#3230 <https://github.com/pypa/pipenv/issues/3230>`_ - Correctly detect the virtualenv location inside an activated virtualenv. `#3231 <https://github.com/pypa/pipenv/issues/3231>`_ - Fixed a bug which caused spinner frames to be written to standard output during locking operations which could cause redirection pipes to fail. `#3239 <https://github.com/pypa/pipenv/issues/3239>`_ - Fixed a bug that editable packages can't be uninstalled correctly. `#3240 <https://github.com/pypa/pipenv/issues/3240>`_ - Corrected an issue with installation timeouts which caused dependency resolution to fail for longer duration resolution steps. `#3244 <https://github.com/pypa/pipenv/issues/3244>`_ - Adding normal pep 508 compatible markers is now fully functional when using VCS dependencies. `#3249 <https://github.com/pypa/pipenv/issues/3249>`_ - Updated ``requirementslib`` and ``pythonfinder`` for multiple bug fixes. `#3254 <https://github.com/pypa/pipenv/issues/3254>`_ - Pipenv will now ignore hashes when installing with ``--skip-lock``. `#3255 <https://github.com/pypa/pipenv/issues/3255>`_ - Fixed an issue where pipenv could crash when multiple pipenv processes attempted to create the same directory. `#3257 <https://github.com/pypa/pipenv/issues/3257>`_ - Fixed an issue which sometimes prevented successful creation of a project Pipfile. `#3260 <https://github.com/pypa/pipenv/issues/3260>`_ - ``pipenv install`` will now unset the ``PYTHONHOME`` environment variable when not combined with ``--system``. `#3261 <https://github.com/pypa/pipenv/issues/3261>`_ - Pipenv will ensure that warnings do not interfere with the resolution process by suppressing warnings' usage of standard output and writing to standard error instead. `#3273 <https://github.com/pypa/pipenv/issues/3273>`_ - Fixed an issue which prevented variables from the environment, such as ``PIPENV_DEV`` or ``PIPENV_SYSTEM``, from being parsed and implemented correctly. `#3278 <https://github.com/pypa/pipenv/issues/3278>`_ - Clear pythonfinder cache after Python install. `#3287 <https://github.com/pypa/pipenv/issues/3287>`_ - Fixed a race condition in hash resolution for dependencies for certain dependencies with missing cache entries or fresh Pipenv installs. `#3289 <https://github.com/pypa/pipenv/issues/3289>`_ - Pipenv will now respect top-level pins over VCS dependency locks. `#3296 <https://github.com/pypa/pipenv/issues/3296>`_ Vendored Libraries ------------------ - Update vendored dependencies to resolve resolution output parsing and python finding: - ``pythonfinder 1.1.9 -> 1.1.10`` - ``requirementslib 1.3.1 -> 1.3.3`` - ``vistir 0.2.3 -> 0.2.5`` `#3280 <https://github.com/pypa/pipenv/issues/3280>`_ 2018.11.14 (2018-11-14) ======================= Features & Improvements ----------------------- - Improved exceptions and error handling on failures. `#1977 <https://github.com/pypa/pipenv/issues/1977>`_ - Added persistent settings for all CLI flags via ``PIPENV_{FLAG_NAME}`` environment variables by enabling ``auto_envvar_prefix=PIPENV`` in click (implements PEEP-0002). `#2200 <https://github.com/pypa/pipenv/issues/2200>`_ - Added improved messaging about available but skipped updates due to dependency conflicts when running ``pipenv update --outdated``. `#2411 <https://github.com/pypa/pipenv/issues/2411>`_ - Added environment variable ``PIPENV_PYUP_API_KEY`` to add ability to override the bundled PyUP.io API key. `#2825 <https://github.com/pypa/pipenv/issues/2825>`_ - Added additional output to ``pipenv update --outdated`` to indicate that the operation succeeded and all packages were already up to date. `#2828 <https://github.com/pypa/pipenv/issues/2828>`_ - Updated ``crayons`` patch to enable colors on native powershell but swap native blue for magenta. `#3020 <https://github.com/pypa/pipenv/issues/3020>`_ - Added support for ``--bare`` to ``pipenv clean``, and fixed ``pipenv sync --bare`` to actually reduce output. `#3041 <https://github.com/pypa/pipenv/issues/3041>`_ - Added windows-compatible spinner via upgraded ``vistir`` dependency. `#3089 <https://github.com/pypa/pipenv/issues/3089>`_ - - Added support for python installations managed by ``asdf``. `#3096 <https://github.com/pypa/pipenv/issues/3096>`_ - Improved runtime performance of no-op commands such as ``pipenv --venv`` by around 2/3. `#3158 <https://github.com/pypa/pipenv/issues/3158>`_ - Do not show error but success for running ``pipenv uninstall --all`` in a fresh virtual environment. `#3170 <https://github.com/pypa/pipenv/issues/3170>`_ - Improved asynchronous installation and error handling via queued subprocess parallelization. `#3217 <https://github.com/pypa/pipenv/issues/3217>`_ Bug Fixes --------- - Remote non-PyPI artifacts and local wheels and artifacts will now include their own hashes rather than including hashes from ``PyPI``. `#2394 <https://github.com/pypa/pipenv/issues/2394>`_ - Non-ascii characters will now be handled correctly when parsed by pipenv's ``ToML`` parsers. `#2737 <https://github.com/pypa/pipenv/issues/2737>`_ - Updated ``pipenv uninstall`` to respect the ``--skip-lock`` argument. `#2848 <https://github.com/pypa/pipenv/issues/2848>`_ - Fixed a bug which caused uninstallation to sometimes fail to successfully remove packages from ``Pipfiles`` with comments on preceding or following lines. `#2885 <https://github.com/pypa/pipenv/issues/2885>`_, `#3099 <https://github.com/pypa/pipenv/issues/3099>`_ - Pipenv will no longer fail when encountering python versions on Windows that have been uninstalled. `#2983 <https://github.com/pypa/pipenv/issues/2983>`_ - Fixed unnecessary extras are added when translating markers `#3026 <https://github.com/pypa/pipenv/issues/3026>`_ - Fixed a virtualenv creation issue which could cause new virtualenvs to inadvertently attempt to read and write to global site packages. `#3047 <https://github.com/pypa/pipenv/issues/3047>`_ - Fixed an issue with virtualenv path derivation which could cause errors, particularly for users on WSL bash. `#3055 <https://github.com/pypa/pipenv/issues/3055>`_ - Fixed a bug which caused ``Unexpected EOF`` errors to be thrown when ``pip`` was waiting for input from users who had put login credentials in environment variables. `#3088 <https://github.com/pypa/pipenv/issues/3088>`_ - Fixed a bug in ``requirementslib`` which prevented successful installation from mercurial repositories. `#3090 <https://github.com/pypa/pipenv/issues/3090>`_ - Fixed random resource warnings when using pyenv or any other subprocess calls. `#3094 <https://github.com/pypa/pipenv/issues/3094>`_ - - Fixed a bug which sometimes prevented cloning and parsing ``mercurial`` requirements. `#3096 <https://github.com/pypa/pipenv/issues/3096>`_ - Fixed an issue in ``delegator.py`` related to subprocess calls when using ``PopenSpawn`` to stream output, which sometimes threw unexpected ``EOF`` errors. `#3102 <https://github.com/pypa/pipenv/issues/3102>`_, `#3114 <https://github.com/pypa/pipenv/issues/3114>`_, `#3117 <https://github.com/pypa/pipenv/issues/3117>`_ - Fix the path casing issue that makes `pipenv clean` fail on Windows `#3104 <https://github.com/pypa/pipenv/issues/3104>`_ - Pipenv will avoid leaving build artifacts in the current working directory. `#3106 <https://github.com/pypa/pipenv/issues/3106>`_ - Fixed issues with broken subprocess calls leaking resource handles and causing random and sporadic failures. `#3109 <https://github.com/pypa/pipenv/issues/3109>`_ - Fixed an issue which caused ``pipenv clean`` to sometimes clean packages from the base ``site-packages`` folder or fail entirely. `#3113 <https://github.com/pypa/pipenv/issues/3113>`_ - Updated ``pythonfinder`` to correct an issue with unnesting of nested paths when searching for python versions. `#3121 <https://github.com/pypa/pipenv/issues/3121>`_ - Added additional logic for ignoring and replacing non-ascii characters when formatting console output on non-UTF-8 systems. `#3131 <https://github.com/pypa/pipenv/issues/3131>`_ - Fix virtual environment discovery when ``PIPENV_VENV_IN_PROJECT`` is set, but the in-project `.venv` is a file. `#3134 <https://github.com/pypa/pipenv/issues/3134>`_ - Hashes for remote and local non-PyPI artifacts will now be included in ``Pipfile.lock`` during resolution. `#3145 <https://github.com/pypa/pipenv/issues/3145>`_ - Fix project path hashing logic in purpose to prevent collisions of virtual environments. `#3151 <https://github.com/pypa/pipenv/issues/3151>`_ - Fix package installation when the virtual environment path contains parentheses. `#3158 <https://github.com/pypa/pipenv/issues/3158>`_ - Azure Pipelines YAML files are updated to use the latest syntax and product name. `#3164 <https://github.com/pypa/pipenv/issues/3164>`_ - Fixed new spinner success message to write only one success message during resolution. `#3183 <https://github.com/pypa/pipenv/issues/3183>`_ - Pipenv will now correctly respect the ``--pre`` option when used with ``pipenv install``. `#3185 <https://github.com/pypa/pipenv/issues/3185>`_ - Fix a bug where exception is raised when run pipenv graph in a project without created virtualenv `#3201 <https://github.com/pypa/pipenv/issues/3201>`_ - When sources are missing names, names will now be derived from the supplied URL. `#3216 <https://github.com/pypa/pipenv/issues/3216>`_ Vendored Libraries ------------------ - Updated ``pythonfinder`` to correct an issue with unnesting of nested paths when searching for python versions. `#3061 <https://github.com/pypa/pipenv/issues/3061>`_, `#3121 <https://github.com/pypa/pipenv/issues/3121>`_ - Updated vendored dependencies: - ``certifi 2018.08.24 => 2018.10.15`` - ``urllib3 1.23 => 1.24`` - ``requests 2.19.1 => 2.20.0`` - ``shellingham ``1.2.6 => 1.2.7`` - ``tomlkit 0.4.4. => 0.4.6`` - ``vistir 0.1.6 => 0.1.8`` - ``pythonfinder 0.1.2 => 0.1.3`` - ``requirementslib 1.1.9 => 1.1.10`` - ``backports.functools_lru_cache 1.5.0 (new)`` - ``cursor 1.2.0 (new)`` `#3089 <https://github.com/pypa/pipenv/issues/3089>`_ - Updated vendored dependencies: - ``requests 2.19.1 => 2.20.1`` - ``tomlkit 0.4.46 => 0.5.2`` - ``vistir 0.1.6 => 0.2.4`` - ``pythonfinder 1.1.2 => 1.1.8`` - ``requirementslib 1.1.10 => 1.3.0`` `#3096 <https://github.com/pypa/pipenv/issues/3096>`_ - Switch to ``tomlkit`` for parsing and writing. Drop ``prettytoml`` and ``contoml`` from vendors. `#3191 <https://github.com/pypa/pipenv/issues/3191>`_ - Updated ``requirementslib`` to aid in resolution of local and remote archives. `#3196 <https://github.com/pypa/pipenv/issues/3196>`_ Improved Documentation ---------------------- - Expanded development and testing documentation for contributors to get started. `#3074 <https://github.com/pypa/pipenv/issues/3074>`_ 2018.10.13 (2018-10-13) ======================= Bug Fixes --------- - Fixed a bug in ``pipenv clean`` which caused global packages to sometimes be inadvertently targeted for cleanup. `#2849 <https://github.com/pypa/pipenv/issues/2849>`_ - Fix broken backport imports for vendored vistir. `#2950 <https://github.com/pypa/pipenv/issues/2950>`_, `#2955 <https://github.com/pypa/pipenv/issues/2955>`_, `#2961 <https://github.com/pypa/pipenv/issues/2961>`_ - Fixed a bug with importing local vendored dependencies when running ``pipenv graph``. `#2952 <https://github.com/pypa/pipenv/issues/2952>`_ - Fixed a bug which caused executable discovery to fail when running inside a virtualenv. `#2957 <https://github.com/pypa/pipenv/issues/2957>`_ - Fix parsing of outline tables. `#2971 <https://github.com/pypa/pipenv/issues/2971>`_ - Fixed a bug which caused ``verify_ssl`` to fail to drop through to ``pip install`` correctly as ``trusted-host``. `#2979 <https://github.com/pypa/pipenv/issues/2979>`_ - Fixed a bug which caused canonicalized package names to fail to resolve against PyPI. `#2989 <https://github.com/pypa/pipenv/issues/2989>`_ - Enhanced CI detection to detect Azure Devops builds. `#2993 <https://github.com/pypa/pipenv/issues/2993>`_ - Fixed a bug which prevented installing pinned versions which used redirection symbols from the command line. `#2998 <https://github.com/pypa/pipenv/issues/2998>`_ - Fixed a bug which prevented installing the local directory in non-editable mode. `#3005 <https://github.com/pypa/pipenv/issues/3005>`_ Vendored Libraries ------------------ - Updated ``requirementslib`` to version ``1.1.9``. `#2989 <https://github.com/pypa/pipenv/issues/2989>`_ - Upgraded ``pythonfinder => 1.1.1`` and ``vistir => 0.1.7``. `#3007 <https://github.com/pypa/pipenv/issues/3007>`_ 2018.10.9 (2018-10-09) ====================== Features & Improvements ----------------------- - Added environment variables `PIPENV_VERBOSE` and `PIPENV_QUIET` to control output verbosity without needing to pass options. `#2527 <https://github.com/pypa/pipenv/issues/2527>`_ - Updated test-PyPI add-on to better support json-API access (forward compatibility). Improved testing process for new contributors. `#2568 <https://github.com/pypa/pipenv/issues/2568>`_ - Greatly enhanced python discovery functionality: - Added pep514 (windows launcher/finder) support for python discovery. - Introduced architecture discovery for python installations which support different architectures. `#2582 <https://github.com/pypa/pipenv/issues/2582>`_ - Added support for ``pipenv shell`` on msys and cygwin/mingw/git bash for Windows. `#2641 <https://github.com/pypa/pipenv/issues/2641>`_ - Enhanced resolution of editable and VCS dependencies. `#2643 <https://github.com/pypa/pipenv/issues/2643>`_ - Deduplicate and refactor CLI to use stateful arguments and object passing. See `this issue <https://github.com/pallets/click/issues/108>`_ for reference. `#2814 <https://github.com/pypa/pipenv/issues/2814>`_ Behavior Changes ---------------- - Virtual environment activation for ``run`` is revised to improve interpolation with other Python discovery tools. `#2503 <https://github.com/pypa/pipenv/issues/2503>`_ - Improve terminal coloring to display better in Powershell. `#2511 <https://github.com/pypa/pipenv/issues/2511>`_ - Invoke ``virtualenv`` directly for virtual environment creation, instead of depending on ``pew``. `#2518 <https://github.com/pypa/pipenv/issues/2518>`_ - ``pipenv --help`` will now include short help descriptions. `#2542 <https://github.com/pypa/pipenv/issues/2542>`_ - Add ``COMSPEC`` to fallback option (along with ``SHELL`` and ``PYENV_SHELL``) if shell detection fails, improving robustness on Windows. `#2651 <https://github.com/pypa/pipenv/issues/2651>`_ - Fallback to shell mode if `run` fails with Windows error 193 to handle non-executable commands. This should improve usability on Windows, where some users run non-executable files without specifying a command, relying on Windows file association to choose the current command. `#2718 <https://github.com/pypa/pipenv/issues/2718>`_ Bug Fixes --------- - Fixed a bug which prevented installation of editable requirements using ``ssh://`` style URLs `#1393 <https://github.com/pypa/pipenv/issues/1393>`_ - VCS Refs for locked local editable dependencies will now update appropriately to the latest hash when running ``pipenv update``. `#1690 <https://github.com/pypa/pipenv/issues/1690>`_ - ``.tar.gz`` and ``.zip`` artifacts will now have dependencies installed even when they are missing from the Lockfile. `#2173 <https://github.com/pypa/pipenv/issues/2173>`_ - The command line parser will now handle multiple ``-e/--editable`` dependencies properly via click's option parser to help mitigate future parsing issues. `#2279 <https://github.com/pypa/pipenv/issues/2279>`_ - Fixed the ability of pipenv to parse ``dependency_links`` from ``setup.py`` when ``PIP_PROCESS_DEPENDENCY_LINKS`` is enabled. `#2434 <https://github.com/pypa/pipenv/issues/2434>`_ - Fixed a bug which could cause ``-i/--index`` arguments to sometimes be incorrectly picked up in packages. This is now handled in the command line parser. `#2494 <https://github.com/pypa/pipenv/issues/2494>`_ - Fixed non-deterministic resolution issues related to changes to the internal package finder in ``pip 10``. `#2499 <https://github.com/pypa/pipenv/issues/2499>`_, `#2529 <https://github.com/pypa/pipenv/issues/2529>`_, `#2589 <https://github.com/pypa/pipenv/issues/2589>`_, `#2666 <https://github.com/pypa/pipenv/issues/2666>`_, `#2767 <https://github.com/pypa/pipenv/issues/2767>`_, `#2785 <https://github.com/pypa/pipenv/issues/2785>`_, `#2795 <https://github.com/pypa/pipenv/issues/2795>`_, `#2801 <https://github.com/pypa/pipenv/issues/2801>`_, `#2824 <https://github.com/pypa/pipenv/issues/2824>`_, `#2862 <https://github.com/pypa/pipenv/issues/2862>`_, `#2879 <https://github.com/pypa/pipenv/issues/2879>`_, `#2894 <https://github.com/pypa/pipenv/issues/2894>`_, `#2933 <https://github.com/pypa/pipenv/issues/2933>`_ - Fix subshell invocation on Windows for Python 2. `#2515 <https://github.com/pypa/pipenv/issues/2515>`_ - Fixed a bug which sometimes caused pipenv to throw a ``TypeError`` or to run into encoding issues when writing a Lockfile on python 2. `#2561 <https://github.com/pypa/pipenv/issues/2561>`_ - Improve quoting logic for ``pipenv run`` so it works better with Windows built-in commands. `#2563 <https://github.com/pypa/pipenv/issues/2563>`_ - Fixed a bug related to parsing VCS requirements with both extras and subdirectory fragments. Corrected an issue in the ``requirementslib`` parser which led to some markers being discarded rather than evaluated. `#2564 <https://github.com/pypa/pipenv/issues/2564>`_ - Fixed multiple issues with finding the correct system python locations. `#2582 <https://github.com/pypa/pipenv/issues/2582>`_ - Catch JSON decoding error to prevent exception when the lock file is of invalid format. `#2607 <https://github.com/pypa/pipenv/issues/2607>`_ - Fixed a rare bug which could sometimes cause errors when installing packages with custom sources. `#2610 <https://github.com/pypa/pipenv/issues/2610>`_ - Update requirementslib to fix a bug which could raise an ``UnboundLocalError`` when parsing malformed VCS URIs. `#2617 <https://github.com/pypa/pipenv/issues/2617>`_ - Fixed an issue which prevented passing multiple ``--ignore`` parameters to ``pipenv check``. `#2632 <https://github.com/pypa/pipenv/issues/2632>`_ - Fixed a bug which caused attempted hashing of ``ssh://`` style URIs which could cause failures during installation of private ssh repositories. - Corrected path conversion issues which caused certain editable VCS paths to be converted to ``ssh://`` URIs improperly. `#2639 <https://github.com/pypa/pipenv/issues/2639>`_ - Fixed a bug which caused paths to be formatted incorrectly when using ``pipenv shell`` in bash for windows. `#2641 <https://github.com/pypa/pipenv/issues/2641>`_ - Dependency links to private repositories defined via ``ssh://`` schemes will now install correctly and skip hashing as long as ``PIP_PROCESS_DEPENDENCY_LINKS=1``. `#2643 <https://github.com/pypa/pipenv/issues/2643>`_ - Fixed a bug which sometimes caused pipenv to parse the ``trusted_host`` argument to pip incorrectly when parsing source URLs which specify ``verify_ssl = false``. `#2656 <https://github.com/pypa/pipenv/issues/2656>`_ - Prevent crashing when a virtual environment in ``WORKON_HOME`` is faulty. `#2676 <https://github.com/pypa/pipenv/issues/2676>`_ - Fixed virtualenv creation failure when a .venv file is present in the project root. `#2680 <https://github.com/pypa/pipenv/issues/2680>`_ - Fixed a bug which could cause the ``-e/--editable`` argument on a dependency to be accidentally parsed as a dependency itself. `#2714 <https://github.com/pypa/pipenv/issues/2714>`_ - Correctly pass ``verbose`` and ``debug`` flags to the resolver subprocess so it generates appropriate output. This also resolves a bug introduced by the fix to #2527. `#2732 <https://github.com/pypa/pipenv/issues/2732>`_ - All markers are now included in ``pipenv lock --requirements`` output. `#2748 <https://github.com/pypa/pipenv/issues/2748>`_ - Fixed a bug in marker resolution which could cause duplicate and non-deterministic markers. `#2760 <https://github.com/pypa/pipenv/issues/2760>`_ - Fixed a bug in the dependency resolver which caused regular issues when handling ``setup.py`` based dependency resolution. `#2766 <https://github.com/pypa/pipenv/issues/2766>`_ - Updated vendored dependencies: - ``pip-tools`` (updated and patched to latest w/ ``pip 18.0`` compatibility) - ``pip 10.0.1 => 18.0`` - ``click 6.7 => 7.0`` - ``toml 0.9.4 => 0.10.0`` - ``pyparsing 2.2.0 => 2.2.2`` - ``delegator 0.1.0 => 0.1.1`` - ``attrs 18.1.0 => 18.2.0`` - ``distlib 0.2.7 => 0.2.8`` - ``packaging 17.1.0 => 18.0`` - ``passa 0.2.0 => 0.3.1`` - ``pip_shims 0.1.2 => 0.3.1`` - ``plette 0.1.1 => 0.2.2`` - ``pythonfinder 1.0.2 => 1.1.0`` - ``pytoml 0.1.18 => 0.1.19`` - ``requirementslib 1.1.16 => 1.1.17`` - ``shellingham 1.2.4 => 1.2.6`` - ``tomlkit 0.4.2 => 0.4.4`` - ``vistir 0.1.4 => 0.1.6`` `#2802 <https://github.com/pypa/pipenv/issues/2802>`_, `#2867 <https://github.com/pypa/pipenv/issues/2867>`_, `#2880 <https://github.com/pypa/pipenv/issues/2880>`_ - Fixed a bug where `pipenv` crashes when the `WORKON_HOME` directory does not exist. `#2877 <https://github.com/pypa/pipenv/issues/2877>`_ - Fixed pip is not loaded from pipenv's patched one but the system one `#2912 <https://github.com/pypa/pipenv/issues/2912>`_ - Fixed various bugs related to ``pip 18.1`` release which prevented locking, installation, and syncing, and dumping to a ``requirements.txt`` file. `#2924 <https://github.com/pypa/pipenv/issues/2924>`_ Vendored Libraries ------------------ - Pew is no longer vendored. Entry point ``pewtwo``, packages ``pipenv.pew`` and ``pipenv.patched.pew`` are removed. `#2521 <https://github.com/pypa/pipenv/issues/2521>`_ - Update ``pythonfinder`` to major release ``1.0.0`` for integration. `#2582 <https://github.com/pypa/pipenv/issues/2582>`_ - Update requirementslib to fix a bug which could raise an ``UnboundLocalError`` when parsing malformed VCS URIs. `#2617 <https://github.com/pypa/pipenv/issues/2617>`_ - - Vendored new libraries ``vistir`` and ``pip-shims``, ``tomlkit``, ``modutil``, and ``plette``. - Update vendored libraries: - ``scandir`` to ``1.9.0`` - ``click-completion`` to ``0.4.1`` - ``semver`` to ``2.8.1`` - ``shellingham`` to ``1.2.4`` - ``pytoml`` to ``0.1.18`` - ``certifi`` to ``2018.8.24`` - ``ptyprocess`` to ``0.6.0`` - ``requirementslib`` to ``1.1.5`` - ``pythonfinder`` to ``1.0.2`` - ``pipdeptree`` to ``0.13.0`` - ``python-dotenv`` to ``0.9.1`` `#2639 <https://github.com/pypa/pipenv/issues/2639>`_ - Updated vendored dependencies: - ``pip-tools`` (updated and patched to latest w/ ``pip 18.0`` compatibility) - ``pip 10.0.1 => 18.0`` - ``click 6.7 => 7.0`` - ``toml 0.9.4 => 0.10.0`` - ``pyparsing 2.2.0 => 2.2.2`` - ``delegator 0.1.0 => 0.1.1`` - ``attrs 18.1.0 => 18.2.0`` - ``distlib 0.2.7 => 0.2.8`` - ``packaging 17.1.0 => 18.0`` - ``passa 0.2.0 => 0.3.1`` - ``pip_shims 0.1.2 => 0.3.1`` - ``plette 0.1.1 => 0.2.2`` - ``pythonfinder 1.0.2 => 1.1.0`` - ``pytoml 0.1.18 => 0.1.19`` - ``requirementslib 1.1.16 => 1.1.17`` - ``shellingham 1.2.4 => 1.2.6`` - ``tomlkit 0.4.2 => 0.4.4`` - ``vistir 0.1.4 => 0.1.6`` `#2902 <https://github.com/pypa/pipenv/issues/2902>`_, `#2935 <https://github.com/pypa/pipenv/issues/2935>`_ Improved Documentation ---------------------- - Simplified the test configuration process. `#2568 <https://github.com/pypa/pipenv/issues/2568>`_ - Updated documentation to use working fortune cookie add-on. `#2644 <https://github.com/pypa/pipenv/issues/2644>`_ - Added additional information about troubleshooting ``pipenv shell`` by using the the ``$PIPENV_SHELL`` environment variable. `#2671 <https://github.com/pypa/pipenv/issues/2671>`_ - Added a link to ``PEP-440`` version specifiers in the documentation for additional detail. `#2674 <https://github.com/pypa/pipenv/issues/2674>`_ - Added simple example to README.md for installing from git. `#2685 <https://github.com/pypa/pipenv/issues/2685>`_ - Stopped recommending `--system` for Docker contexts. `#2762 <https://github.com/pypa/pipenv/issues/2762>`_ - Fixed the example url for doing "pipenv install -e some-repository-url#egg=something", it was missing the "egg=" in the fragment identifier. `#2792 <https://github.com/pypa/pipenv/issues/2792>`_ - Fixed link to the "be cordial" essay in the contribution documentation. `#2793 <https://github.com/pypa/pipenv/issues/2793>`_ - Clarify `pipenv install` documentation `#2844 <https://github.com/pypa/pipenv/issues/2844>`_ - Replace reference to uservoice with PEEP-000 `#2909 <https://github.com/pypa/pipenv/issues/2909>`_ 2018.7.1 (2018-07-01) ===================== Features & Improvements ----------------------- - All calls to ``pipenv shell`` are now implemented from the ground up using `shellingham <https://github.com/sarugaku/shellingham>`_, a custom library which was purpose built to handle edge cases and shell detection. `#2371 <https://github.com/pypa/pipenv/issues/2371>`_ - Added support for python 3.7 via a few small compatibility / bug fixes. `#2427 <https://github.com/pypa/pipenv/issues/2427>`_, `#2434 <https://github.com/pypa/pipenv/issues/2434>`_, `#2436 <https://github.com/pypa/pipenv/issues/2436>`_ - Added new flag ``pipenv --support`` to replace the diagnostic command ``python -m pipenv.help``. `#2477 <https://github.com/pypa/pipenv/issues/2477>`_, `#2478 <https://github.com/pypa/pipenv/issues/2478>`_ - Improved import times and CLI run times with minor tweaks. `#2485 <https://github.com/pypa/pipenv/issues/2485>`_ Bug Fixes --------- - Fixed an ongoing bug which sometimes resolved incompatible versions into the project Lockfile. `#1901 <https://github.com/pypa/pipenv/issues/1901>`_ - Fixed a bug which caused errors when creating virtualenvs which contained leading dash characters. `#2415 <https://github.com/pypa/pipenv/issues/2415>`_ - Fixed a logic error which caused ``--deploy --system`` to overwrite editable vcs packages in the Pipfile before installing, which caused any installation to fail by default. `#2417 <https://github.com/pypa/pipenv/issues/2417>`_ - Updated requirementslib to fix an issue with properly quoting markers in VCS requirements. `#2419 <https://github.com/pypa/pipenv/issues/2419>`_ - Installed new vendored jinja2 templates for ``click-completion`` which were causing template errors for users with completion enabled. `#2422 <https://github.com/pypa/pipenv/issues/2422>`_ - Added support for python 3.7 via a few small compatibility / bug fixes. `#2427 <https://github.com/pypa/pipenv/issues/2427>`_ - Fixed an issue reading package names from ``setup.py`` files in projects which imported utilities such as ``versioneer``. `#2433 <https://github.com/pypa/pipenv/issues/2433>`_ - Pipenv will now ensure that its internal package names registry files are written with unicode strings. `#2450 <https://github.com/pypa/pipenv/issues/2450>`_ - Fixed a bug causing requirements input as relative paths to be output as absolute paths or URIs. Fixed a bug affecting normalization of ``git+git@host`` URLs. `#2453 <https://github.com/pypa/pipenv/issues/2453>`_ - Pipenv will now always use ``pathlib2`` for ``Path`` based filesystem interactions by default on ``python<3.5``. `#2454 <https://github.com/pypa/pipenv/issues/2454>`_ - Fixed a bug which prevented passing proxy PyPI indexes set with ``--pypi-mirror`` from being passed to pip during virtualenv creation, which could cause the creation to freeze in some cases. `#2462 <https://github.com/pypa/pipenv/issues/2462>`_ - Using the ``python -m pipenv.help`` command will now use proper encoding for the host filesystem to avoid encoding issues. `#2466 <https://github.com/pypa/pipenv/issues/2466>`_ - The new ``jinja2`` templates for ``click_completion`` will now be included in pipenv source distributions. `#2479 <https://github.com/pypa/pipenv/issues/2479>`_ - Resolved a long-standing issue with re-using previously generated ``InstallRequirement`` objects for resolution which could cause ``PKG-INFO`` file information to be deleted, raising a ``TypeError``. `#2480 <https://github.com/pypa/pipenv/issues/2480>`_ - Resolved an issue parsing usernames from private PyPI URIs in ``Pipfiles`` by updating ``requirementslib``. `#2484 <https://github.com/pypa/pipenv/issues/2484>`_ Vendored Libraries ------------------ - All calls to ``pipenv shell`` are now implemented from the ground up using `shellingham <https://github.com/sarugaku/shellingham>`_, a custom library which was purpose built to handle edge cases and shell detection. `#2371 <https://github.com/pypa/pipenv/issues/2371>`_ - Updated requirementslib to fix an issue with properly quoting markers in VCS requirements. `#2419 <https://github.com/pypa/pipenv/issues/2419>`_ - Installed new vendored jinja2 templates for ``click-completion`` which were causing template errors for users with completion enabled. `#2422 <https://github.com/pypa/pipenv/issues/2422>`_ - Add patch to ``prettytoml`` to support Python 3.7. `#2426 <https://github.com/pypa/pipenv/issues/2426>`_ - Patched ``prettytoml.AbstractTable._enumerate_items`` to handle ``StopIteration`` errors in preparation of release of python 3.7. `#2427 <https://github.com/pypa/pipenv/issues/2427>`_ - Fixed an issue reading package names from ``setup.py`` files in projects which imported utilities such as ``versioneer``. `#2433 <https://github.com/pypa/pipenv/issues/2433>`_ - Updated ``requirementslib`` to version ``1.0.9`` `#2453 <https://github.com/pypa/pipenv/issues/2453>`_ - Unraveled a lot of old, unnecessary patches to ``pip-tools`` which were causing non-deterministic resolution errors. `#2480 <https://github.com/pypa/pipenv/issues/2480>`_ - Resolved an issue parsing usernames from private PyPI URIs in ``Pipfiles`` by updating ``requirementslib``. `#2484 <https://github.com/pypa/pipenv/issues/2484>`_ Improved Documentation ---------------------- - Added instructions for installing using Fedora's official repositories. `#2404 <https://github.com/pypa/pipenv/issues/2404>`_ 2018.6.25 (2018-06-25) ====================== Features & Improvements ----------------------- - Pipenv-created virtualenvs will now be associated with a ``.project`` folder (features can be implemented on top of this later or users may choose to use ``pipenv-pipes`` to take full advantage of this.) `#1861 <https://github.com/pypa/pipenv/issues/1861>`_ - Virtualenv names will now appear in prompts for most Windows users. `#2167 <https://github.com/pypa/pipenv/issues/2167>`_ - Added support for cmder shell paths with spaces. `#2168 <https://github.com/pypa/pipenv/issues/2168>`_ - Added nested JSON output to the ``pipenv graph`` command. `#2199 <https://github.com/pypa/pipenv/issues/2199>`_ - Dropped vendored pip 9 and vendored, patched, and migrated to pip 10. Updated patched piptools version. `#2255 <https://github.com/pypa/pipenv/issues/2255>`_ - PyPI mirror URLs can now be set to override instances of PyPI URLs by passing the ``--pypi-mirror`` argument from the command line or setting the ``PIPENV_PYPI_MIRROR`` environment variable. `#2281 <https://github.com/pypa/pipenv/issues/2281>`_ - Virtualenv activation lines will now avoid being written to some shell history files. `#2287 <https://github.com/pypa/pipenv/issues/2287>`_ - Pipenv will now only search for ``requirements.txt`` files when creating new projects, and during that time only if the user doesn't specify packages to pass in. `#2309 <https://github.com/pypa/pipenv/issues/2309>`_ - Added support for mounted drives via UNC paths. `#2331 <https://github.com/pypa/pipenv/issues/2331>`_ - Added support for Windows Subsystem for Linux bash shell detection. `#2363 <https://github.com/pypa/pipenv/issues/2363>`_ - Pipenv will now generate hashes much more quickly by resolving them in a single pass during locking. `#2384 <https://github.com/pypa/pipenv/issues/2384>`_ - ``pipenv run`` will now avoid spawning additional ``COMSPEC`` instances to run commands in when possible. `#2385 <https://github.com/pypa/pipenv/issues/2385>`_ - Massive internal improvements to requirements parsing codebase, resolver, and error messaging. `#2388 <https://github.com/pypa/pipenv/issues/2388>`_ - ``pipenv check`` now may take multiple of the additional argument ``--ignore`` which takes a parameter ``cve_id`` for the purpose of ignoring specific CVEs. `#2408 <https://github.com/pypa/pipenv/issues/2408>`_ Behavior Changes ---------------- - Pipenv will now parse & capitalize ``platform_python_implementation`` markers .. warning:: This could cause an issue if you have an out of date ``Pipfile`` which lower-cases the comparison value (e.g. ``cpython`` instead of ``CPython``). `#2123 <https://github.com/pypa/pipenv/issues/2123>`_ - Pipenv will now only search for ``requirements.txt`` files when creating new projects, and during that time only if the user doesn't specify packages to pass in. `#2309 <https://github.com/pypa/pipenv/issues/2309>`_ Bug Fixes --------- - Massive internal improvements to requirements parsing codebase, resolver, and error messaging. `#1962 <https://github.com/pypa/pipenv/issues/1962>`_, `#2186 <https://github.com/pypa/pipenv/issues/2186>`_, `#2263 <https://github.com/pypa/pipenv/issues/2263>`_, `#2312 <https://github.com/pypa/pipenv/issues/2312>`_ - Pipenv will now parse & capitalize ``platform_python_implementation`` markers. `#2123 <https://github.com/pypa/pipenv/issues/2123>`_ - Fixed a bug with parsing and grouping old-style ``setup.py`` extras during resolution `#2142 <https://github.com/pypa/pipenv/issues/2142>`_ - Fixed a bug causing pipenv graph to throw unhelpful exceptions when running against empty or non-existent environments. `#2161 <https://github.com/pypa/pipenv/issues/2161>`_ - Fixed a bug which caused ``--system`` to incorrectly abort when users were in a virtualenv. `#2181 <https://github.com/pypa/pipenv/issues/2181>`_ - Removed vendored ``cacert.pem`` which could cause issues for some users with custom certificate settings. `#2193 <https://github.com/pypa/pipenv/issues/2193>`_ - Fixed a regression which led to direct invocations of ``virtualenv``, rather than calling it by module. `#2198 <https://github.com/pypa/pipenv/issues/2198>`_ - Locking will now pin the correct VCS ref during ``pipenv update`` runs. Running ``pipenv update`` with a new vcs ref specified in the ``Pipfile`` will now properly obtain, resolve, and install the specified dependency at the specified ref. `#2209 <https://github.com/pypa/pipenv/issues/2209>`_ - ``pipenv clean`` will now correctly ignore comments from ``pip freeze`` when cleaning the environment. `#2262 <https://github.com/pypa/pipenv/issues/2262>`_ - Resolution bugs causing packages for incompatible python versions to be locked have been fixed. `#2267 <https://github.com/pypa/pipenv/issues/2267>`_ - Fixed a bug causing pipenv graph to fail to display sometimes. `#2268 <https://github.com/pypa/pipenv/issues/2268>`_ - Updated ``requirementslib`` to fix a bug in Pipfile parsing affecting relative path conversions. `#2269 <https://github.com/pypa/pipenv/issues/2269>`_ - Windows executable discovery now leverages ``os.pathext``. `#2298 <https://github.com/pypa/pipenv/issues/2298>`_ - Fixed a bug which caused ``--deploy --system`` to inadvertently create a virtualenv before failing. `#2301 <https://github.com/pypa/pipenv/issues/2301>`_ - Fixed an issue which led to a failure to unquote special characters in file and wheel paths. `#2302 <https://github.com/pypa/pipenv/issues/2302>`_ - VCS dependencies are now manually obtained only if they do not match the requested ref. `#2304 <https://github.com/pypa/pipenv/issues/2304>`_ - Added error handling functionality to properly cope with single-digit ``Requires-Python`` metadata with no specifiers. `#2377 <https://github.com/pypa/pipenv/issues/2377>`_ - ``pipenv update`` will now always run the resolver and lock before ensuring dependencies are in sync with project Lockfile. `#2379 <https://github.com/pypa/pipenv/issues/2379>`_ - Resolved a bug in our patched resolvers which could cause nondeterministic resolution failures in certain conditions. Running ``pipenv install`` with no arguments in a project with only a ``Pipfile`` will now correctly lock first for dependency resolution before installing. `#2384 <https://github.com/pypa/pipenv/issues/2384>`_ - Patched ``python-dotenv`` to ensure that environment variables always get encoded to the filesystem encoding. `#2386 <https://github.com/pypa/pipenv/issues/2386>`_ Improved Documentation ---------------------- - Update documentation wording to clarify Pipenv's overall role in the packaging ecosystem. `#2194 <https://github.com/pypa/pipenv/issues/2194>`_ - Added contribution documentation and guidelines. `#2205 <https://github.com/pypa/pipenv/issues/2205>`_ - Added instructions for supervisord compatibility. `#2215 <https://github.com/pypa/pipenv/issues/2215>`_ - Fixed broken links to development philosophy and contribution documentation. `#2248 <https://github.com/pypa/pipenv/issues/2248>`_ Vendored Libraries ------------------ - Removed vendored ``cacert.pem`` which could cause issues for some users with custom certificate settings. `#2193 <https://github.com/pypa/pipenv/issues/2193>`_ - Dropped vendored pip 9 and vendored, patched, and migrated to pip 10. Updated patched piptools version. `#2255 <https://github.com/pypa/pipenv/issues/2255>`_ - Updated ``requirementslib`` to fix a bug in Pipfile parsing affecting relative path conversions. `#2269 <https://github.com/pypa/pipenv/issues/2269>`_ - Added custom shell detection library ``shellingham``, a port of our changes to ``pew``. `#2363 <https://github.com/pypa/pipenv/issues/2363>`_ - Patched ``python-dotenv`` to ensure that environment variables always get encoded to the filesystem encoding. `#2386 <https://github.com/pypa/pipenv/issues/2386>`_ - Updated vendored libraries. The following vendored libraries were updated: * distlib from version ``0.2.6`` to ``0.2.7``. * jinja2 from version ``2.9.5`` to ``2.10``. * pathlib2 from version ``2.1.0`` to ``2.3.2``. * parse from version ``2.8.0`` to ``2.8.4``. * pexpect from version ``2.5.2`` to ``2.6.0``. * requests from version ``2.18.4`` to ``2.19.1``. * idna from version ``2.6`` to ``2.7``. * certifi from version ``2018.1.16`` to ``2018.4.16``. * packaging from version ``16.8`` to ``17.1``. * six from version ``1.10.0`` to ``1.11.0``. * requirementslib from version ``0.2.0`` to ``1.0.1``. In addition, scandir was vendored and patched to avoid importing host system binaries when falling back to pathlib2. `#2368 <https://github.com/pypa/pipenv/issues/2368>`_
{ "pile_set_name": "Github" }
package com.itmuch.cloud.study.user.feign; import com.itmuch.cloud.study.user.entity.User; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; /** * @author zhouli */ @FeignClient(name = "microservice-provider-user") public interface UserFeignClient { @GetMapping("/users/{id}") User findById(@PathVariable("id") Long id); }
{ "pile_set_name": "Github" }
{% for designerTable in tables %} {% set i = loop.index0 %} {% set t_n_url = designerTable.getDbTableString()|escape('url') %} {% set db = designerTable.getDatabaseName() %} {% set db_url = db|escape('url') %} {% set t_n = designerTable.getDbTableString() %} {% set table_name = designerTable.getTableName()|escape('html') %} <input name="t_x[{{ t_n_url }}]" type="hidden" id="t_x_{{ t_n_url }}_" /> <input name="t_y[{{ t_n_url }}]" type="hidden" id="t_y_{{ t_n_url }}_" /> <input name="t_v[{{ t_n_url }}]" type="hidden" id="t_v_{{ t_n_url }}_" /> <input name="t_h[{{ t_n_url }}]" type="hidden" id="t_h_{{ t_n_url }}_" /> <table id="{{ t_n_url }}" db_url="{{ designerTable.getDatabaseName()|escape('url') }}" table_name_url="{{ designerTable.getTableName()|escape('url') }}" cellpadding="0" cellspacing="0" class="designer_tab" style="position:absolute; left: {{- tab_pos[t_n] is defined ? tab_pos[t_n]['X'] : random(range(20, 700)) }}px; top: {{- tab_pos[t_n] is defined ? tab_pos[t_n]['Y'] : random(range(20, 550)) }}px; display: {{- tab_pos[t_n] is defined or display_page == -1 ? 'block' : 'none' }}; z-index: 1;"> <!--"--> <thead> <tr class="header"> {% if has_query %} <td class="select_all"> <input class="select_all_1" type="checkbox" style="margin: 0;" value="select_all_{{ t_n_url }}" id="select_all_{{ i }}" title="{% trans 'Select all' %}" table_name="{{ table_name }}" db_name="{{ db }}"> </td> {% endif %} <td class="small_tab" title="{% trans 'Show/hide columns' %}" id="id_hide_tbody_{{ t_n_url }}" table_name="{{ t_n_url }}">{{ tab_pos[t_n] is not defined or tab_pos[t_n]['V'] is not empty ? 'v' : '&gt;' }}</td> <td class="small_tab_pref small_tab_pref_1" db="{{ designerTable.getDatabaseName() }}" db_url="{{ designerTable.getDatabaseName()|escape('url') }}" table_name="{{ designerTable.getTableName() }}" table_name_url="{{ designerTable.getTableName()|escape('url') }}"> <img src="{{ theme.getImgPath('designer/exec_small.png') }}" title="{% trans 'See table structure' %}"> </td> <td id="id_zag_{{ t_n_url }}" class="tab_zag nowrap tab_zag_noquery" table_name="{{ t_n_url }}" query_set="{{ has_query ? 1 : 0 }}"> <span class="owner">{{ designerTable.getDatabaseName() }}</span> {{ designerTable.getTableName() }} </td> {% if has_query %} <td class="tab_zag tab_zag_query" id="id_zag_{{ t_n_url }}_2" table_name="{{ t_n_url }}"> </td> {% endif %} </tr> </thead> <tbody id="id_tbody_{{ t_n_url }}" {{- tab_pos[t_n] is defined and tab_pos[t_n]['V'] is empty ? ' style="display: none"' }}> {% set display_field = designerTable.getDisplayField() %} {% for j in 0..tab_column[t_n]['COLUMN_ID']|length - 1 %} {% set col_name = tab_column[t_n]['COLUMN_NAME'][j] %} {% set tmp_column = t_n ~ '.' ~ tab_column[t_n]['COLUMN_NAME'][j] %} {% set click_field_param = [ designerTable.getTableName()|escape('url'), tab_column[t_n]['COLUMN_NAME'][j]|url_encode ] %} {% if not designerTable.supportsForeignkeys() %} {% set click_field_param = click_field_param|merge([tables_pk_or_unique_keys[tmp_column] is defined ? 1 : 0]) %} {% else %} {# if foreign keys are supported, it's not necessary that the index is a primary key #} {% set click_field_param = click_field_param|merge([tables_all_keys[tmp_column] is defined ? 1 : 0]) %} {% endif %} {% set click_field_param = click_field_param|merge([db]) %} <tr id="id_tr_{{ designerTable.getTableName()|escape('url') }}.{{ tab_column[t_n]['COLUMN_NAME'][j] }}" class="tab_field {{- display_field == tab_column[t_n]['COLUMN_NAME'][j] ? '_3' }}" click_field_param=" {{- click_field_param|join(',') }}"> {% if has_query %} <td class="select_all"> <input class="select_all_store_col" value="{{ t_n_url }}{{ tab_column[t_n]['COLUMN_NAME'][j]|url_encode }}" type="checkbox" id="select_{{ t_n_url }}._{{ tab_column[t_n]['COLUMN_NAME'][j]|url_encode }}" style="margin: 0;" title="{{ 'Select "%s"'|trans|format(col_name) }}" id_check_all="select_all_{{ i }}" db_name="{{ db }}" table_name="{{ table_name }}" col_name="{{ col_name }}"> </td> {% endif %} <td width="10px" colspan="3" id="{{ t_n_url }}. {{- tab_column[t_n]['COLUMN_NAME'][j]|url_encode }}"> <div class="nowrap"> {% set type = columns_type[t_n ~ '.' ~ tab_column[t_n]['COLUMN_NAME'][j]] %} <img src="{{ theme.getImgPath(type) }}.png" alt="*"> {{ tab_column[t_n]['COLUMN_NAME'][j] }} : {{ tab_column[t_n]['TYPE'][j] }} </div> </td> {% if has_query %} <td class="small_tab_pref small_tab_pref_click_opt" {# Escaped 2 times to be able to use it in innerHtml #} option_col_name_modal="<strong>{{ 'Add an option for column "%s".'|trans|format(col_name)|escape('html')|escape('html') }}</strong>" db_name="{{ db }}" table_name="{{ table_name }}" col_name="{{ col_name }}" db_table_name_url="{{ t_n_url }}"> <img src="{{ theme.getImgPath('designer/exec_small.png') }}" title="{% trans 'Options' %}" /> </td> {% endif %} </tr> {% endfor %} </tbody> </table> {% endfor %}
{ "pile_set_name": "Github" }
/** Amexio Colors v2.0. Copyright (c) 2018-19 MetaMagic Global Inc, NJ, USA */ /** Theme Details -------------------------------------------------------- Theme Name : Z Ce Cas Deep Blue Theme Version : 5.11 Design Type : Material Design Release Date : April 26, 2019 Algo Name : Color Analogous Six Algo ID : 2 Author : This theme is fully autogenerated by Amexio Colors. */ :root{ --appTransparency : rgba(0,0,0,0.87); /** Theme Color in CSS Variables ------------------------------- */ --themePrimaryColor : #0914f5; --themeSecondaryColor : #740af5; --theme3rdColor : #e90af5; --theme4thColor : #f50a8b; --theme5thColor : #f50a16; --theme6thColor : #f5740a; --themePrimaryDarker : #070fab; --themePrimaryColorHSLA : hsla(237,92%,50%,0.0); --themeSecondaryColorHSLA : hsla(267,92%,50%,0.0); --theme3rdColorHSLA : hsla(297,92%,50%,0.0); --theme4thColorHSLA : hsla(327,92%,50%,0.0); --theme5thColorHSLA : hsla(357,92%,50%,0.0); --theme6thColorHSLA : hsla(27,92%,50%,0.0); --themePrimaryDarkerHSLA : hsla(237,92%,35%,0.0); /** Primary Color shades -------------------------- */ --themePrimaryColorShade0 : #000005; --themePrimaryColorShade1 : #000338; --themePrimaryColorShade2 : #00089e; --themePrimaryColorShade3 : #0512ff; --themePrimaryColorShade4 : #6b72ff; --themePrimaryColorShade5 : #d1d3ff; --themePrimaryColorShade6 : #f5f5ff; /** Theme Color Gradients -------------------------- */ --themePrimaryColorGradient : linear-gradient(to right, #000338, #000be0, #5c64ff); --themeSecondaryColorGradient : linear-gradient(to right, #190038, #6500e0, #a55cff); --theme3rdColorGradient : linear-gradient(to right, #350038, #d500e0, #f75cff); --theme4thColorGradient : linear-gradient(to right, #38001f, #e0007b, #ff5cb6); --theme5thColorGradient : linear-gradient(to right, #380003, #e0000b, #ff5c64); --theme6thColorGradient : linear-gradient(to right, #381900, #e06500, #ffa55c); --themePrimaryDarkerGradient : linear-gradient(to right, #000338, #000be0, #5c64ff); /** Theme Font Family -------------------------- */ --themeFontColor : #00021f; --themeFontFamily : Roboto,Trebuchet MS,Arial,Helvetica,sans-serif; --themePrimaryFontColor : #f5f6ff; --themeSecondaryFontColor : #f9f5ff; --theme3rdFontColor : #fffaff; --theme4thFontColor : #fffafd; --theme5thFontColor : #fffafa; --theme6thFontColor : #221001; --themePrimaryDarkerFontColor : #f5f6ff; /** Theme Additional Std CSS Colors : Light and Dark shades --- */ --amexioColorRedLight : #ff7f50; --amexioColorRedDark : #dc143c; --amexioColorGreenLight : #00ff00; --amexioColorGreenDark : #2e8b57; --amexioColorPurpleLight : #ff00ff; --amexioColorPurpleDark : #8b008b; --amexioColorBlueLight : #00bfff; --amexioColorBlueDark : #00008b; --amexioColorBrownLight : #f4a460; --amexioColorBrownDark : #800000; --amexioColorYellowLight : #ffd700; --amexioColorYellowDark : #ff9900; /** App Color CSS Variables ------------------------ */ --appBackground :#f5f5f5; --appBackgroundImage : none; --appForegroundColor :#121212; --appHeaderBGColor :#0914f5; --appHeaderFontColor :#f5f6ff; --appHeaderMenuBGColor :#0914f5; --appHeaderMenuFontColor :#f5f6ff; --appHeaderHoverBGColor :#e7e8fe; --appHeaderHoverFontColor :#030749; /** Component Color CSS Variables ------------------------ */ --componentBGColor :#ffffff; --componentFontColor :#121212; --componentHeaderBGColor :#740af5; --componentHeaderFontColor :#f9f5ff; --componentFooterBGColor :#f1e7fe; --componentFooterFontColor :#0c0118; --componentDataBGColor :#0e001f; --componentDataFontColor :#ca9eff; --componentHoverBGColor :#d8b8ff; --componentHoverFontColor :#250052; --componentActiveBGColor :#ae6bff; --componentActiveFontColor :#0e001f; --componentDisabledBGColor :#cdc2db; --componentDisabledFontColor :#7e62a3; --componentBoxShadow :0 0px 1px 0 white, 0 2px 10px 0 rgba(0, 0, 0, 0.12) } $appTransparency : var(--appTransparency); /** Theme Color Variables ------------------------------- */ $themePrimaryColor : var(--themePrimaryColor); $themeSecondaryColor : var(--themeSecondaryColor); $theme3rdColor : var(--theme3rdColor); $theme4thColor : var(--theme4thColor); $theme5thColor : var(--theme5thColor); $theme6thColor : var(--theme6thColor); $themePrimaryDarker: var(--themePrimaryDarker); /** Primary Color shades -------------------------- */ $themePrimaryColorShade0 : var(--themePrimaryColorShade0); $themePrimaryColorShade1 : var(--themePrimaryColorShade1); $themePrimaryColorShade2 : var(--themePrimaryColorShade2); $themePrimaryColorShade3 : var(--themePrimaryColorShade3); $themePrimaryColorShade4 : var(--themePrimaryColorShade4); $themePrimaryColorShade5 : var(--themePrimaryColorShade5); $themePrimaryColorShade6 : var(--themePrimaryColorShade6); /** Theme Color Gradients -------------------------- */ $themePrimaryColorGradient : var(--themePrimaryColorGradient); $themeSecondaryColorGradient : var(--themeSecondaryColorGradient); $theme3rdColorGradient : var(--theme3rdColorGradient); $theme4thColorGradient : var(--theme4thColorGradient); $theme5thColorGradient : var(--theme5thColorGradient); $theme6thColorGradient : var(--theme6thColorGradient); $themePrimaryDarkerGradient: var(--themePrimaryDarkerGradient); /** Theme Font Family -------------------------- */ $themeFontColor : var(--themeFontColor); $themeFontFamily : var(--themeFontFamily); $themePrimaryFontColor : var(--themePrimaryFontColor); $themeSecondaryFontColor : var(--themeSecondaryFontColor); $theme3rdFontColor : var(--theme3rdFontColor); $theme4thFontColor : var(--theme4thFontColor); $theme5thFontColor : var(--theme5thFontColor); $theme6thFontColor : var(--theme6thFontColor); $themePrimaryDarkerFontColor: var(--themePrimaryDarkerFontColor); /** Theme Additional Std Colors : Light and Dark shades --- */ $amexioColorRedLight : var(--amexioColorRedLight); $amexioColorRedDark : var(--amexioColorRedDark); $amexioColorGreenLight : var(--amexioColorGreenLight); $amexioColorGreenDark : var(--amexioColorGreenDark); $amexioColorPurpleLight : var(--amexioColorPurpleLight); $amexioColorPurpleDark : var(--amexioColorPurpleDark); $amexioColorBlueLight : var(--amexioColorBlueLight); $amexioColorBlueDark : var(--amexioColorBlueDark); $amexioColorBrownLight : var(--amexioColorBrownLight); $amexioColorBrownDark : var(--amexioColorBrownDark); $amexioColorYellowLight : var(--amexioColorYellowLight); $amexioColorYellowDark : var(--amexioColorYellowDark); /** App Color Variables ------------------------ */ $appBackground : var(--appBackground); $appBackgroundImage : var(--appBackgroundImage); $appForegroundColor : var(--appForegroundColor); $appHeaderBGColor : var(--appHeaderBGColor); $appHeaderFontColor : var(--appHeaderFontColor); $appHeaderMenuBGColor : var(--appHeaderMenuBGColor); $appHeaderMenuFontColor : var(--appHeaderMenuFontColor); $appHeaderHoverBGColor : var(--appHeaderHoverBGColor); $appHeaderHoverFontColor : var(--appHeaderHoverFontColor); /** Component Color Variables ------------------------ */ $componentBGColor : var(--componentBGColor); $componentFontColor : var(--componentFontColor); $componentHeaderBGColor : var(--componentHeaderBGColor); $componentHeaderFontColor : var(--componentHeaderFontColor); $componentFooterBGColor : var(--componentFooterBGColor); $componentFooterFontColor : var(--componentFooterFontColor); $componentDataBGColor : var(--componentDataBGColor); $componentDataFontColor : var(--componentDataFontColor); $componentHoverBGColor : var(--componentHoverBGColor); $componentHoverFontColor : var(--componentHoverFontColor); $componentActiveBGColor : var(--componentActiveBGColor); $componentActiveFontColor : var(--componentActiveFontColor); $componentDisabledBGColor : var(--componentDisabledBGColor); $componentDisabledFontColor : var(--componentDisabledFontColor); $componentBoxShadow : var(--componentBoxShadow); /** Amexio Colors v2.0 Updated on April 10, 2019. Amexio Support ---------------------------------- Contact : [email protected] Home : http://www.amexio.tech/ API Docs : http://api.amexio.tech/ Demos : http://demo.amexio.tech/ Source : https://github.com/meta-magic/amexio.github.io */
{ "pile_set_name": "Github" }
-- an implementation of printf function printf(...) io.write(string.format(...)) end printf("Hello %s from %s on %s\n",os.getenv"USER" or "there",_VERSION,os.date())
{ "pile_set_name": "Github" }
# Makefile for zlib # Borland C++ for Win32 # # Usage: # make -f win32/Makefile.bor # make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj # ------------ Borland C++ ------------ # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or # added to the declaration of LOC here: LOC = $(LOCAL_ZLIB) CC = bcc32 AS = bcc32 LD = bcc32 AR = tlib CFLAGS = -a -d -k- -O2 $(LOC) ASFLAGS = $(LOC) LDFLAGS = $(LOC) # variables ZLIB_LIB = zlib.lib OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj #OBJA = OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj #OBJPA= # targets all: $(ZLIB_LIB) example.exe minigzip.exe .c.obj: $(CC) -c $(CFLAGS) $< .asm.obj: $(AS) -c $(ASFLAGS) $< adler32.obj: adler32.c zlib.h zconf.h compress.obj: compress.c zlib.h zconf.h crc32.obj: crc32.c zlib.h zconf.h crc32.h deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h gzread.obj: gzread.c zlib.h zconf.h gzguts.h gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ inffast.h inffixed.h inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ inffast.h inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ inffast.h inffixed.h inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h uncompr.obj: uncompr.c zlib.h zconf.h zutil.obj: zutil.c zutil.h zlib.h zconf.h example.obj: example.c zlib.h zconf.h minigzip.obj: minigzip.c zlib.h zconf.h # For the sake of the old Borland make, # the command line is cut to fit in the MS-DOS 128 byte limit: $(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) -del $(ZLIB_LIB) $(AR) $(ZLIB_LIB) $(OBJP1) $(AR) $(ZLIB_LIB) $(OBJP2) $(AR) $(ZLIB_LIB) $(OBJPA) # testing test: example.exe minigzip.exe example echo hello world | minigzip | minigzip -d example.exe: example.obj $(ZLIB_LIB) $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) minigzip.exe: minigzip.obj $(ZLIB_LIB) $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) # cleanup clean: -del $(ZLIB_LIB) -del *.obj -del *.exe -del *.tds -del zlib.bak -del foo.gz
{ "pile_set_name": "Github" }
{ "word": "Abysmal", "definitions": [ "extremely bad", "appalling" ], "parts-of-speech": "Adjective" }
{ "pile_set_name": "Github" }
# !expects@+2 MethodDefinitionMissing: module=::Palette, method=self.nestopia_palette # !expects@+1 UnexpectedDynamicMethod: module=::Palette, method=nestopia_palette module Palette module_function # @dynamic self.defacto_palette def defacto_palette [] end # @dynamic nestopia_palette end
{ "pile_set_name": "Github" }
package com.ruoyi; import org.activiti.spring.boot.SecurityAutoConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import com.ruoyi.system.annotation.EnableRyFeignClients; import tk.mybatis.spring.annotation.MapperScan; @SpringBootApplication(exclude = {SecurityAutoConfiguration.class}) @EnableDiscoveryClient @MapperScan("com.ruoyi.*.mapper") @EnableRyFeignClients public class RuoyiActApp { public static void main(String[] args) { SpringApplication.run(RuoyiActApp.class, args); } }
{ "pile_set_name": "Github" }
<!-- Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at http://www.eclipse.org/legal/epl-2.0. This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License v. 2.0 are satisfied: GNU General Public License, version 2 with the GNU Classpath Exception, which is available at https://www.gnu.org/software/classpath/license.html. SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> <!-- monitor/monitoringStatsPage.inc --> #include "/common/shared/commonHandlers.inc" <event> <!beforeCreate gfr.getListOfRunningInstances(); setPageSessionAttribute(key="displayPropSection" value="#{true}"); gf.containedIn(list="#{pageSession.runningInstances}" testStr="#{pageSession.instanceName}" contain="#{requestScope.isInstanceRunning}"); setPageSessionAttribute(key="isMonitoringOff" value="#{false}"); if("#{requestScope.isInstanceRunning}"){ setAttribute(key="instanceRunningAlert" value="#{false}"); gfr.isMonitoringOff(); if("!#{pageSession.isMonitoringOff}") { gf.getChildrenNamesList(endpoint="#{pageSession.monitorURL}/resources", result="#{pageSession.poolsList}"); gf.getMonitoringPools(endpoint="#{sessionScope.REST_URL}/resources", poolNames = "#{pageSession.poolsList}", jdbcList="#{pageSession.jdbcList}", firstJdbc="#{pageSession.firstJdbc}", connectorList="#{pageSession.connectorList}", firstConnector="#{pageSession.firstConnector}"); addToMonitorList(oldList="#{pageSession.jdbcList}", newList="#{pageSession.connectorList}" result="#{pageSession.resourceList}"); populateResourceMonitorDropDown(ResourceList="#{resourceList}", MonitorList=>$attribute{monitorList} FirstItem=>$attribute{firstVal}); if(!#{viewVal}) { setAttribute(key="viewVal" value="#{firstVal}"); } if(!#{appVal}) { setAttribute(key="appVal" value=""); } } if("#{pageSession.isMonitoringOff}") { setPageSessionAttribute(key="displayPropSection" value="#{false}"); } } if("!#{requestScope.isInstanceRunning}"){ setPageSessionAttribute(key="displayPropSection" value="#{false}"); setAttribute(key="instanceRunningAlert" value="#{true}"); } calculateHelpUrl(pluginId="#{pluginId}", helpKey: "$resource{help_web.monitorResources}", url="#{olhLink}"); /> </event> <sun:title id="propertyContentPage" title="$resource{i18nc.resourcesMonitor}" helpText="$resource{i18nc.monitoring.webContainer.PageHelp}"> <!facet pageButtonsTop> <sun:panelGroup id="topButtons"> <sun:button id="refreshButton" text="$resource{i18n.button.Refresh}"> <!command setAttribute(key="viewVal" value="#{viewVal}"); setAttribute(key="appVal" value="#{appVal}"); if ("$pageSession{encodedInstanceName}") { setAttribute(key="instanceName" value="$pageSession{encodedInstanceName}"); } if ("$pageSession{encodedClusterName}") { setAttribute(key="clusterName" value="$pageSession{encodedClusterName}"); } gf.navigate(page="#{pageSession.selfPage}"); /> </sun:button> </sun:panelGroup> </facet> #include "/common/shared/nameSection.inc" <sun:propertySheet id="infoSheet"> <sun:propertySheetSection id="infoSheetSection"> <sun:property id="instNotRunningProp" rendered="#{instanceRunningAlert}" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" > <sun:staticText id="instNotRunning"text="$resource{i18nc.monitoring.webContainer.instanceNotRunningMsg}" /> </sun:property> <sun:property id="monDisabledProp" rendered="#{isMonitoringOff}" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" > <sun:staticText id="monDisabled" text="$resource{i18nc.monitoring.webContainer.disableMonitoringMsg}" /> </sun:property> </sun:propertySheetSection> </sun:propertySheet> <sun:propertySheet id="propertySheet"> <sun:propertySheetSection id="viewPropertySection" rendered="#{displayPropSection}"> <sun:property id="VsProp" labelAlign="left" noWrap="#{true}" overlapLabel="#{false}"> <sun:dropDown id="View" label="$resource{i18nc.monitoring.resource} : " selected="#{viewVal}" items="$attribute{monitorList}" submitForm="#{true}" immediate="#{true}" > <!command setAttribute(key="click" value="$this{component}"); setAttribute(key="viewVal" value="#{click.selected}"); if ("$pageSession{encodedInstanceName}") { setAttribute(key="instanceName" value="$pageSession{encodedInstanceName}"); } if ("$pageSession{encodedClusterName}") { setAttribute(key="clusterName" value="$pageSession{encodedClusterName}"); } gf.navigate(page="#{pageSession.selfPage}"); /> <!afterCreate getClientId(component="$this{component}" clientId=>$page{poolId}); /> </sun:dropDown> "&nbsp;&nbsp;&nbsp;&nbsp; //To provide the support for application based pool monitoring. <sun:dropDown id="appView" visible="#{hasResApps}" label="$resource{i18nc.monitoring.application} : " selected="#{appVal}" items="$attribute{resApps}" submitForm="#{true}" immediate="#{true}" > <!beforeCreate setAttribute(key="resAppsList" value={}); gf.getChildrenNamesList(endpoint="#{sessionScope.REST_URL}/applications/application", result="#{appsList}"); gf.getChildrenNamesList(endpoint="#{pageSession.monitorURL}/resources/#{viewVal}", result="#{poolAppsList}"); foreach (var="poolApp" list="#{poolAppsList}") { gf.containedIn(list="#{appsList}" testStr="#{poolApp}" contain=>$attribute{hasApp}); if(#{hasApp}) { listAdd(list="#{resAppsList}" value="#{poolApp}" result=>$attribute{resAppsList}); } } setAttribute(key="resAppsSize" value="#{resAppsList.size()}"); setAttribute(key="zero" value="$int{0}"); if(#{resAppsSize} > #{zero}) { setAttribute(key="hasResApps" value="$boolean{true}"); } if(#{resAppsSize} = #{zero}) { setAttribute(key="hasResApps" value="$boolean{false}"); } addEmptyFirstElement(in="#{resAppsList}" out="#{resAppsList}"); gf.convertListToOptionArray(list="#{resAppsList}" optionArray=>$attribute{resApps}); /> <!command setAttribute(key="click" value="$this{component}"); setAttribute(key="appVal" value="#{click.selected}"); getUIComponent(clientId="$pageSession{poolId}", component=>$attribute{poolComp}); setAttribute(key="viewVal" value="#{poolComp.selected}"); if ("$pageSession{encodedInstanceName}") { setAttribute(key="instanceName" value="$pageSession{encodedInstanceName}"); } if ("$pageSession{encodedClusterName}") { setAttribute(key="clusterName" value="$pageSession{encodedClusterName}"); } gf.navigate(page="#{pageSession.selfPage}"); /> </sun:dropDown> </sun:property> </sun:propertySheetSection> </sun:propertySheet> <!-- Table .... --> <sun:table id="resourcesTable" itemsText="$resource{i18nc.monitoring.statistics}" style="padding: 10pt" title="$resource{i18nc.monitoring}" > <!afterCreate getClientId(component="$this{component}" clientId=>$page{tableId}); /> <sun:tableRowGroup id="jdbcStats" rendered="#{hasStatsJdbc}" data={"$attribute{jdbcStatsList}"} sourceVar="td" headerText="$resource{i18nc.monitoring.JDBC} : #{jdbcHeader}" groupToggleButton="$boolean{true}" collapsed="$boolean{false}" aboveColumnHeader="$boolean{true}" emptyDataMsg="$resource{i18nc.monitoring.webContainer.NoStats}"> <!beforeCreate isPool(poolName="#{viewVal}", endpoint="#{sessionScope.REST_URL}/resources/jdbc-connection-pool", result=>$attribute{isJdbcPool}); if (#{isJdbcPool}) { if(#{appVal}) { setAttribute(key="jdbcHeader" value="#{viewVal}/#{appVal}"); } if(!#{appVal}) { setAttribute(key="jdbcHeader" value="#{viewVal}"); } getStats(endpoint="#{pageSession.monitorURL}/resources/#{viewVal}/#{appVal}", result=>$attribute{jdbcStatsList} hasStats=>$attribute{hasStatsJdbc}); } if (!#{isJdbcPool}) { setAttribute(key="hasStatsJdbc" value="#{false}"); } /> #include "/common/monitor/monitoringTableRows.inc" "<br/> </sun:tableRowGroup> <sun:tableRowGroup id="connectionPoolStats" rendered="#{hasStatsConnectionPool}" data={"$attribute{connectionPoolStatsList}"} sourceVar="td" headerText="$resource{i18nc.monitoring.ConnectorConnectionPool} : #{connectorHeader}" groupToggleButton="$boolean{true}" collapsed="$boolean{false}" aboveColumnHeader="$boolean{true}" emptyDataMsg="$resource{i18nc.monitoring.webContainer.NoStats}"> <!beforeCreate isPool(poolName="#{viewVal}", endpoint="#{sessionScope.REST_URL}/resources/connector-connection-pool", result=>$attribute{isConnectorPool}); if(#{appVal}) { setAttribute(key="connectorHeader" value="#{viewVal}/#{appVal}"); } if(!#{appVal}) { setAttribute(key="connectorHeader" value="#{viewVal}"); } if (#{isConnectorPool}) { getStats(endpoint="#{pageSession.monitorURL}/resources/#{viewVal}/#{appVal}", result=>$attribute{connectionPoolStatsList} hasStats=>$attribute{hasStatsConnectionPool}); } if (!#{isConnectorPool}) { setAttribute(key="hasStatsConnectionPool" value="#{false}"); } /> #include "/common/monitor/monitoringTableRows.inc" "<br/> </sun:tableRowGroup> </sun:table> </sun:title>
{ "pile_set_name": "Github" }
changeEmailSettingsUrl date firstName gender isCoachingEnabled loginUrl ofJob
{ "pile_set_name": "Github" }
-- Can't have recursive views drop table t; drop view r0; drop view r1; drop view r2; drop view r3; create table t (id int); create view r0 as select * from t; create view r1 as select * from r0; create view r2 as select * from r1; create view r3 as select * from r2; drop view r0; alter view r3 rename to r0; select * from r0;
{ "pile_set_name": "Github" }
/*------------------------------------- zTree Style version: 3.5.19 author: Hunter.z email: [email protected] website: http://code.google.com/p/jquerytree/ -------------------------------------*/ .ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} .ztree {margin:0; padding:5px; color:#333} .ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} .ztree li ul{ margin:0; padding:0 0 0 18px} .ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;} .ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; text-decoration:none; vertical-align:top; display: inline-block} .ztree li a:hover {text-decoration:underline} .ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} .ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} .ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; opacity:0.8; filter:alpha(opacity=80)} .ztree li a.tmpTargetNode_prev {} .ztree li a.tmpTargetNode_next {} .ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; font-size:12px; border:1px #7EC4CC solid; *border:0px} .ztree li span {line-height:16px; margin-right:2px} .ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; border:0 none; cursor: pointer;outline:none; background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} .ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} .ztree li span.button.chk.checkbox_false_full {background-position:0 0} .ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} .ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} .ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} .ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} .ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} .ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} .ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} .ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} .ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} .ztree li span.button.chk.radio_false_full {background-position:-28px 0} .ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} .ztree li span.button.chk.radio_false_part {background-position:-28px -28px} .ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} .ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} .ztree li span.button.chk.radio_true_full {background-position:-42px 0} .ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} .ztree li span.button.chk.radio_true_part {background-position:-42px -28px} .ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} .ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} .ztree li span.button.switch {width:18px; height:18px} .ztree li span.button.root_open{background-position:-92px -54px} .ztree li span.button.root_close{background-position:-74px -54px} .ztree li span.button.roots_open{background-position:-92px 0} .ztree li span.button.roots_close{background-position:-74px 0} .ztree li span.button.center_open{background-position:-92px -18px} .ztree li span.button.center_close{background-position:-74px -18px} .ztree li span.button.bottom_open{background-position:-92px -36px} .ztree li span.button.bottom_close{background-position:-74px -36px} .ztree li span.button.noline_open{background-position:-92px -72px} .ztree li span.button.noline_close{background-position:-74px -72px} .ztree li span.button.root_docu{ background:none;} .ztree li span.button.roots_docu{background-position:-56px 0} .ztree li span.button.center_docu{background-position:-56px -18px} .ztree li span.button.bottom_docu{background-position:-56px -36px} .ztree li span.button.noline_docu{ background:none;} .ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} .ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} .ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} .ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} .ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} .ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} .zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} /* level style*/ /*.ztree li span.button.level0 { display:none; } .ztree li ul.level0 { padding:0; background:none; }*/
{ "pile_set_name": "Github" }
.TH "sawfish" "1" .SH "NAME" sawfish \(em Sawfish window manager. .SH "SYNOPSIS" .PP \fBsawfish\fR .SH "DESCRIPTION" .PP Sawfish is a lisp-extensible window manager for X11. Its aim is to allow all areas of window management (decoration, manipulation) to be customized as far as is possible, yet still remain as fast as existing window managers. .SH "OPTIONS" .IP "\fB\-\-disable-nls\fP" 10 Disable internationalization of messages. .IP "\fBFILE\fP " 10 Load the Lisp file \fIFILE\fR (from the cwd if possible, implies \fI\-\-batch\fR). .IP "\fB\-\-batch\fP " 10 Batch mode: process options and exit. .IP "\fB\-\-interp\fP " 10 Interpreted mode: don't load compiled Lisp files. .IP "\fB-f, \-\-call\fP \fBFUNCTION\fP" 10 Call Lisp function \fIFUNCTION\fR. .IP "\fB-l, \-\-load\fP \fBFILE\fP" 10 Load the file of Lisp forms called \fIFUNCTION\fR. .IP "\fB\-\-version\fP" 10 Print version details. .IP "\fB\-\-no-rc\fP" 10 Don't load rc or site-init files. .IP "\fB-q, \-\-quit\fP" 10 Terminate the interpreter process. .IP "\fB-\-5-buttons\fP" 10 Support keyboard layout switching, but drop mouse buttons 6 - 8 support. .IP "\fB-\-replace\fP" 10 Replace the running window manager with Sawfish. .SS Display Options .IP "\fB\-\-display=\fIDPY\fR\fP" 10 Connect to X display \fIDPY\fR. .IP "\fB\-\-multihead\fP" 10 Fork a copy of sawfish for each screen. .IP "\fB\-\-visual=\fIVISUAL\fR\fP" 10 Preferred \fIVISUAL\fR type. .IP "\fB\-\-depth=\fIDEPTH\fR\fP" 10 Preferred color \fIDEPTH\fR. .SS Customization Files Options .IP "\fB\-\-custom-file\fP \fBFILE\fP" 10 Overrides the default custom file \fI~/.sawfish/custom\fR. .IP "\fB\-\-window-history-file\fP \fBFILE\fP" 10 Overrides the default window history file \fI~/.sawfish/window-history\fR. .IP "\fB\-\-no-rc" 10 Do not load the rc file. .SS Session Management Options .IP "\fB\-\-sm-client-id\fP \fBID\fP" 10 .IP "\fB\-\-sm-prefix\fP \fBPREFIX\fP" 10 .SS Debugging Option .IP "\fB\-\-sync" 10 Read src/display.c. Don't use it unless you're sure. .SH "SEE ALSO" .PP Sawfish is documented fully by \fIJohn Harper\fP available via the \fBInfo\fP system. .SH "AUTHOR" .PP This manual page was written by Christian Marillat [email protected] for the \fBDebian GNU/Linux\fP system (but may be used by others). .\" created by instant / docbook-to-man, Sat 02 Feb 2008, 23:15
{ "pile_set_name": "Github" }
/* * Copyright (C) 2010,2015 Broadcom * Copyright (C) 2013-2014 Lubomir Rintel * Copyright (C) 2013 Craig McGeachie * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This device provides a mechanism for writing to the mailboxes, * that are shared between the ARM and the VideoCore processor * * Parts of the driver are based on: * - arch/arm/mach-bcm2708/vcio.c file written by Gray Girling that was * obtained from branch "rpi-3.6.y" of git://github.com/raspberrypi/ * linux.git * - drivers/mailbox/bcm2835-ipc.c by Lubomir Rintel at * https://github.com/hackerspace/rpi-linux/blob/lr-raspberry-pi/drivers/ * mailbox/bcm2835-ipc.c * - documentation available on the following web site: * https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface */ #include <linux/device.h> #include <linux/dma-mapping.h> #include <linux/err.h> #include <linux/interrupt.h> #include <linux/irq.h> #include <linux/kernel.h> #include <linux/mailbox_controller.h> #include <linux/module.h> #include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/platform_device.h> #include <linux/spinlock.h> /* Mailboxes */ #define ARM_0_MAIL0 0x00 #define ARM_0_MAIL1 0x20 /* * Mailbox registers. We basically only support mailbox 0 & 1. We * deliver to the VC in mailbox 1, it delivers to us in mailbox 0. See * BCM2835-ARM-Peripherals.pdf section 1.3 for an explanation about * the placement of memory barriers. */ #define MAIL0_RD (ARM_0_MAIL0 + 0x00) #define MAIL0_POL (ARM_0_MAIL0 + 0x10) #define MAIL0_STA (ARM_0_MAIL0 + 0x18) #define MAIL0_CNF (ARM_0_MAIL0 + 0x1C) #define MAIL1_WRT (ARM_0_MAIL1 + 0x00) #define MAIL1_STA (ARM_0_MAIL1 + 0x18) /* Status register: FIFO state. */ #define ARM_MS_FULL BIT(31) #define ARM_MS_EMPTY BIT(30) /* Configuration register: Enable interrupts. */ #define ARM_MC_IHAVEDATAIRQEN BIT(0) struct bcm2835_mbox { void __iomem *regs; spinlock_t lock; struct mbox_controller controller; }; static struct bcm2835_mbox *bcm2835_link_mbox(struct mbox_chan *link) { return container_of(link->mbox, struct bcm2835_mbox, controller); } static irqreturn_t bcm2835_mbox_irq(int irq, void *dev_id) { struct bcm2835_mbox *mbox = dev_id; struct device *dev = mbox->controller.dev; struct mbox_chan *link = &mbox->controller.chans[0]; while (!(readl(mbox->regs + MAIL0_STA) & ARM_MS_EMPTY)) { u32 msg = readl(mbox->regs + MAIL0_RD); dev_dbg(dev, "Reply 0x%08X\n", msg); mbox_chan_received_data(link, &msg); } return IRQ_HANDLED; } static int bcm2835_send_data(struct mbox_chan *link, void *data) { struct bcm2835_mbox *mbox = bcm2835_link_mbox(link); u32 msg = *(u32 *)data; spin_lock(&mbox->lock); writel(msg, mbox->regs + MAIL1_WRT); dev_dbg(mbox->controller.dev, "Request 0x%08X\n", msg); spin_unlock(&mbox->lock); return 0; } static int bcm2835_startup(struct mbox_chan *link) { struct bcm2835_mbox *mbox = bcm2835_link_mbox(link); /* Enable the interrupt on data reception */ writel(ARM_MC_IHAVEDATAIRQEN, mbox->regs + MAIL0_CNF); return 0; } static void bcm2835_shutdown(struct mbox_chan *link) { struct bcm2835_mbox *mbox = bcm2835_link_mbox(link); writel(0, mbox->regs + MAIL0_CNF); } static bool bcm2835_last_tx_done(struct mbox_chan *link) { struct bcm2835_mbox *mbox = bcm2835_link_mbox(link); bool ret; spin_lock(&mbox->lock); ret = !(readl(mbox->regs + MAIL1_STA) & ARM_MS_FULL); spin_unlock(&mbox->lock); return ret; } static const struct mbox_chan_ops bcm2835_mbox_chan_ops = { .send_data = bcm2835_send_data, .startup = bcm2835_startup, .shutdown = bcm2835_shutdown, .last_tx_done = bcm2835_last_tx_done }; static struct mbox_chan *bcm2835_mbox_index_xlate(struct mbox_controller *mbox, const struct of_phandle_args *sp) { if (sp->args_count != 0) return NULL; return &mbox->chans[0]; } static int bcm2835_mbox_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; int ret = 0; struct resource *iomem; struct bcm2835_mbox *mbox; mbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL); if (mbox == NULL) return -ENOMEM; spin_lock_init(&mbox->lock); ret = devm_request_irq(dev, irq_of_parse_and_map(dev->of_node, 0), bcm2835_mbox_irq, 0, dev_name(dev), mbox); if (ret) { dev_err(dev, "Failed to register a mailbox IRQ handler: %d\n", ret); return -ENODEV; } iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mbox->regs = devm_ioremap_resource(&pdev->dev, iomem); if (IS_ERR(mbox->regs)) { ret = PTR_ERR(mbox->regs); dev_err(&pdev->dev, "Failed to remap mailbox regs: %d\n", ret); return ret; } mbox->controller.txdone_poll = true; mbox->controller.txpoll_period = 5; mbox->controller.ops = &bcm2835_mbox_chan_ops; mbox->controller.of_xlate = &bcm2835_mbox_index_xlate; mbox->controller.dev = dev; mbox->controller.num_chans = 1; mbox->controller.chans = devm_kzalloc(dev, sizeof(*mbox->controller.chans), GFP_KERNEL); if (!mbox->controller.chans) return -ENOMEM; ret = mbox_controller_register(&mbox->controller); if (ret) return ret; platform_set_drvdata(pdev, mbox); dev_info(dev, "mailbox enabled\n"); return ret; } static int bcm2835_mbox_remove(struct platform_device *pdev) { struct bcm2835_mbox *mbox = platform_get_drvdata(pdev); mbox_controller_unregister(&mbox->controller); return 0; } static const struct of_device_id bcm2835_mbox_of_match[] = { { .compatible = "brcm,bcm2835-mbox", }, {}, }; MODULE_DEVICE_TABLE(of, bcm2835_mbox_of_match); static struct platform_driver bcm2835_mbox_driver = { .driver = { .name = "bcm2835-mbox", .of_match_table = bcm2835_mbox_of_match, }, .probe = bcm2835_mbox_probe, .remove = bcm2835_mbox_remove, }; module_platform_driver(bcm2835_mbox_driver); MODULE_AUTHOR("Lubomir Rintel <[email protected]>"); MODULE_DESCRIPTION("BCM2835 mailbox IPC driver"); MODULE_LICENSE("GPL v2");
{ "pile_set_name": "Github" }
client dev tun proto udp remote hk.gw.ivpn.net 2049 auth-user-pass /config/openvpn-credentials.txt resolv-retry infinite nobind persist-tun persist-key persist-remote-ip cipher AES-256-CBC tls-cipher TLS-DHE-RSA-WITH-AES-256-CBC-SHA:TLS-DHE-DSS-WITH-AES-256-CBC-SHA:TLS-RSA-WITH-AES-256-CBC-SHA remote-cert-tls server verify-x509-name hk name-prefix key-direction 1 comp-lzo no verb 3 ;ca /etc/openvpn/ivpn/ca.crt <ca> -----BEGIN CERTIFICATE----- MIIGoDCCBIigAwIBAgIJAJjvUclXmxtnMA0GCSqGSIb3DQEBCwUAMIGMMQswCQYD VQQGEwJDSDEPMA0GA1UECAwGWnVyaWNoMQ8wDQYDVQQHDAZadXJpY2gxETAPBgNV BAoMCElWUE4ubmV0MQ0wCwYDVQQLDARJVlBOMRgwFgYDVQQDDA9JVlBOIFJvb3Qg Q0EgdjIxHzAdBgkqhkiG9w0BCQEWEHN1cHBvcnRAaXZwbi5uZXQwHhcNMjAwMjI2 MTA1MjI5WhcNNDAwMjIxMTA1MjI5WjCBjDELMAkGA1UEBhMCQ0gxDzANBgNVBAgM Blp1cmljaDEPMA0GA1UEBwwGWnVyaWNoMREwDwYDVQQKDAhJVlBOLm5ldDENMAsG A1UECwwESVZQTjEYMBYGA1UEAwwPSVZQTiBSb290IENBIHYyMR8wHQYJKoZIhvcN AQkBFhBzdXBwb3J0QGl2cG4ubmV0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC CgKCAgEAxHVeaQN3nYCLnGoEg6cY44AExbQ3W6XGKYwC9vI+HJbb1o0tAv56ryvc 6eS6BdG5q9M8fHaHEE/jw9rtznioiXPwIEmqMqFPA9k1oRIQTGX73m+zHGtRpt9P 4tGYhkvbqnN0OGI0H+j9R6cwKi7KpWIoTVibtyI7uuwgzC2nvDzVkLi63uvnCKRX cGy3VWC06uWFbqI9+QDrHHgdJA1F0wRfg0Iac7TE75yXItBMvNLbdZpge9SmplYW FQ2rVPG+n75KepJ+KW7PYfTP4Mh3R8A7h3/WRm03o3spf2aYw71t44voZ6agvslv wqGyczDytsLUny0U2zR7/mfEAyVbL8jqcWr2Df0m3TA0WxwdWvA51/RflVk9G96L ncUkoxuBT56QSMtdjbMSqRgLfz1iPsglQEaCzUSqHfQExvONhXtNgy+Pr2+wGrEu SlLMee7aUEMTFEX/vHPZanCrUVYf5Vs8vDOirZjQSHJfgZfwj3nL5VLtIq6ekDhS AdrqCTILP3V2HbgdZGWPVQxl4YmQPKo0IJpse5Kb6TF2o0i90KhORcKg7qZA40sE bYLEwqTM7VBs1FahTXsOPAoMa7xZWV1TnigF5pdVS1l51dy5S8L4ErHFEnAp242B DuTClSLVnWDdofW0EZ0OkK7V9zKyVl75dlBgxMIS0y5MsK7IWicCAwEAAaOCAQEw gf4wHQYDVR0OBBYEFHUDcMOMo35yg2A/v0uYfkDE11CXMIHBBgNVHSMEgbkwgbaA FHUDcMOMo35yg2A/v0uYfkDE11CXoYGSpIGPMIGMMQswCQYDVQQGEwJDSDEPMA0G A1UECAwGWnVyaWNoMQ8wDQYDVQQHDAZadXJpY2gxETAPBgNVBAoMCElWUE4ubmV0 MQ0wCwYDVQQLDARJVlBOMRgwFgYDVQQDDA9JVlBOIFJvb3QgQ0EgdjIxHzAdBgkq hkiG9w0BCQEWEHN1cHBvcnRAaXZwbi5uZXSCCQCY71HJV5sbZzAMBgNVHRMEBTAD AQH/MAsGA1UdDwQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAABAjRMJy+mXFLezA Z8iUgxOjNtSqkCv1aU78K1XkYUzbwNNrSIVGKfP9cqOEiComXY6nniws7QEV2IWi lcdPKm0x57recrr9TExGGOTVGB/WdmsFfn0g/HgmxNvXypzG3qulBk4qQTymICds l9vIPb1l9FSjKw1KgUVuCPaYq7xiXbZ/kZdZX49xeKtoDBrXKKhXVYoWus/S+k2I S8iCxvcp599y7LQJg5DOGlbaxFhsW4R+kfGOaegyhPvpaznguv02i7NLd99XqJhp v2jTUF5F3T23Z4KkL/wTo4zxz09DKOlELrE4ai++ilCt/mXWECXNOSNXzgszpe6W As0h9R++sH+AzJyhBfIGgPUTxHHHvxBVLj3k6VCgF7mRP2Y+rTWa6d8AGI2+Raey V9DVVH9UeSoU0Hv2JHiZL6dRERnyg8dyzKeTCke8poLIjXF+gyvI+22/xsL8jcNH i9Kji3Vpc3i0Mxzx3gu2N+PL71CwJilgqBgxj0firr3k8sFcWVSGos6RJ3IvFvTh xYx0p255WrWM01fR9TktPYEfjDT9qpIJ8OrGlNOhWhYj+a45qibXDpaDdb/uBEmf 2sSXNifjSeUyqu6cKfZvMqB7pS3l/AhuAOTT80E4sXLEoDxkFD4C78swZ8wyWRKw sWGIGABGAHwXEAoDiZ/jjFrEZT0= -----END CERTIFICATE----- </ca> <tls-auth> -----BEGIN OpenVPN Static key V1----- ac470c93ff9f5602a8aab37dee84a528 14d10f20490ad23c47d5d82120c1bf85 9e93d0696b455d4a1b8d55d40c2685c4 1ca1d0aef29a3efd27274c4ef09020a3 978fe45784b335da6df2d12db97bbb83 8416515f2a96f04715fd28949c6fe296 a925cfada3f8b8928ed7fc963c156327 2f5cf46e5e1d9c845d7703ca881497b7 e6564a9d1dea9358adffd435295479f4 7d5298fabf5359613ff5992cb57ff081 a04dfb81a26513a6b44a9b5490ad265f 8a02384832a59cc3e075ad545461060b 7bcab49bac815163cb80983dd51d5b1f d76170ffd904d8291071e96efc3fb777 856c717b148d08a510f5687b8a8285dc ffe737b98916dd15ef6235dee4266d3b -----END OpenVPN Static key V1----- </tls-auth>
{ "pile_set_name": "Github" }
SHORT L3 cache bandwidth in MBytes/s EVENTSET FIXC0 INSTR_RETIRED_ANY FIXC1 CPU_CLK_UNHALTED_CORE FIXC2 CPU_CLK_UNHALTED_REF PMC0 L2_LINES_IN_ALL PMC1 L2_TRANS_L2_WB METRICS Runtime (RDTSC) [s] time Runtime unhalted [s] FIXC1*inverseClock Clock [MHz] 1.E-06*(FIXC1/FIXC2)/inverseClock CPI FIXC1/FIXC0 L3 load bandwidth [MBytes/s] 1.0E-06*PMC0*64.0/time L3 load data volume [GBytes] 1.0E-09*PMC0*64.0 L3 evict bandwidth [MBytes/s] 1.0E-06*PMC1*64.0/time L3 evict data volume [GBytes] 1.0E-09*PMC1*64.0 L3 bandwidth [MBytes/s] 1.0E-06*(PMC0+PMC1)*64.0/time L3 data volume [GBytes] 1.0E-09*(PMC0+PMC1)*64.0 LONG Formulas: L3 load bandwidth [MBytes/s] = 1.0E-06*L2_LINES_IN_ALL*64.0/time L3 load data volume [GBytes] = 1.0E-09*L2_LINES_IN_ALL*64.0 L3 evict bandwidth [MBytes/s] = 1.0E-06*L2_TRANS_L2_WB*64.0/time L3 evict data volume [GBytes] = 1.0E-09*L2_TRANS_L2_WB*64.0 L3 bandwidth [MBytes/s] = 1.0E-06*(L2_LINES_IN_ALL+L2_TRANS_L2_WB)*64/time L3 data volume [GBytes] = 1.0E-09*(L2_LINES_IN_ALL+L2_TRANS_L2_WB)*64 - Profiling group to measure L3 cache bandwidth. The bandwidth is computed by the number of cache line allocated in the L2 and the number of modified cache lines evicted from the L2. This group also output data volume transferred between the L3 and measured cores L2 caches. Note that this bandwidth also includes data transfers due to a write allocate load on a store miss in L2.
{ "pile_set_name": "Github" }
using NexusForever.Shared.GameTable.Static; namespace NexusForever.Shared.GameTable { public class TextTableEntry { public uint Id { get; } public Language Language { get; } public string Text { get; } public TextTableEntry(Language language, uint id, string text) { Id = id; Language = language; Text = text; } } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2010 Daniel James. 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) --> <header name="example.hpp"> <para> Fake reference documentation, so that the syntax highlighter will kick in. </para> <macro name="foo"> <description> <programlisting>/* C style comment */</programlisting> <programlisting>/* Broken C style comment</programlisting> <programlisting> /* Multi-line *comment */</programlisting> <programlisting>/*/ Tricky comment */</programlisting> <programlisting>/**/</programlisting> <programlisting>/***/</programlisting> <programlisting>// Single line comment</programlisting> <programlisting>// Single line comment </programlisting> </description> </macro> </header>
{ "pile_set_name": "Github" }
/** * 捕获 HttpException 异常 * */ import { ArgumentsHost, Catch, ExceptionFilter, HttpException, Logger } from '@nestjs/common'; const logger = new Logger(); @Catch() export class HttpExceptionFilter implements ExceptionFilter { public catch(exception: HttpException, host: ArgumentsHost) { console.log(host); const ctx = host.switchToHttp(); const response = ctx.getResponse(); const request = ctx.getRequest(); const code = exception.getStatus() || '500'; let message = exception.message || '阿西吧 Error'; if (message.message) { message = message.message; } logger.error( JSON.stringify({ message, time: new Date().toLocaleString(), path: request.url }) ); response.status(code).json({ message, time: new Date().toLocaleString(), path: request.url }); } }
{ "pile_set_name": "Github" }
/* * cderror.h * * Copyright (C) 1994-1997, Thomas G. Lane. * Modified 2009 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file defines the error and message codes for the cjpeg/djpeg * applications. These strings are not needed as part of the JPEG library * proper. * Edit this file to add new codes, or to translate the message strings to * some other language. */ /* * To define the enum list of message codes, include this file without * defining macro JMESSAGE. To create a message string table, include it * again with a suitable JMESSAGE definition (see jerror.c for an example). */ #ifndef JMESSAGE #ifndef CDERROR_H #define CDERROR_H /* First time through, define the enum list */ #define JMAKE_ENUM_LIST #else /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ #define JMESSAGE(code,string) #endif /* CDERROR_H */ #endif /* JMESSAGE */ #ifdef JMAKE_ENUM_LIST typedef enum { #define JMESSAGE(code,string) code , #endif /* JMAKE_ENUM_LIST */ JMESSAGE(JMSG_FIRSTADDONCODE=1000, NULL) /* Must be first entry! */ #ifdef BMP_SUPPORTED JMESSAGE(JERR_BMP_BADCMAP, "Unsupported BMP colormap format") JMESSAGE(JERR_BMP_BADDEPTH, "Only 8- and 24-bit BMP files are supported") JMESSAGE(JERR_BMP_BADHEADER, "Invalid BMP file: bad header length") JMESSAGE(JERR_BMP_BADPLANES, "Invalid BMP file: biPlanes not equal to 1") JMESSAGE(JERR_BMP_COLORSPACE, "BMP output must be grayscale or RGB") JMESSAGE(JERR_BMP_COMPRESSED, "Sorry, compressed BMPs not yet supported") JMESSAGE(JERR_BMP_EMPTY, "Empty BMP image") JMESSAGE(JERR_BMP_NOT, "Not a BMP file - does not start with BM") JMESSAGE(JTRC_BMP, "%ux%u 24-bit BMP image") JMESSAGE(JTRC_BMP_MAPPED, "%ux%u 8-bit colormapped BMP image") JMESSAGE(JTRC_BMP_OS2, "%ux%u 24-bit OS2 BMP image") JMESSAGE(JTRC_BMP_OS2_MAPPED, "%ux%u 8-bit colormapped OS2 BMP image") #endif /* BMP_SUPPORTED */ #ifdef GIF_SUPPORTED JMESSAGE(JERR_GIF_BUG, "GIF output got confused") JMESSAGE(JERR_GIF_CODESIZE, "Bogus GIF codesize %d") JMESSAGE(JERR_GIF_COLORSPACE, "GIF output must be grayscale or RGB") JMESSAGE(JERR_GIF_IMAGENOTFOUND, "Too few images in GIF file") JMESSAGE(JERR_GIF_NOT, "Not a GIF file") JMESSAGE(JTRC_GIF, "%ux%ux%d GIF image") JMESSAGE(JTRC_GIF_BADVERSION, "Warning: unexpected GIF version number '%c%c%c'") JMESSAGE(JTRC_GIF_EXTENSION, "Ignoring GIF extension block of type 0x%02x") JMESSAGE(JTRC_GIF_NONSQUARE, "Caution: nonsquare pixels in input") JMESSAGE(JWRN_GIF_BADDATA, "Corrupt data in GIF file") JMESSAGE(JWRN_GIF_CHAR, "Bogus char 0x%02x in GIF file, ignoring") JMESSAGE(JWRN_GIF_ENDCODE, "Premature end of GIF image") JMESSAGE(JWRN_GIF_NOMOREDATA, "Ran out of GIF bits") #endif /* GIF_SUPPORTED */ #ifdef PPM_SUPPORTED JMESSAGE(JERR_PPM_COLORSPACE, "PPM output must be grayscale or RGB") JMESSAGE(JERR_PPM_NONNUMERIC, "Nonnumeric data in PPM file") JMESSAGE(JERR_PPM_NOT, "Not a PPM/PGM file") JMESSAGE(JTRC_PGM, "%ux%u PGM image") JMESSAGE(JTRC_PGM_TEXT, "%ux%u text PGM image") JMESSAGE(JTRC_PPM, "%ux%u PPM image") JMESSAGE(JTRC_PPM_TEXT, "%ux%u text PPM image") #endif /* PPM_SUPPORTED */ #ifdef RLE_SUPPORTED JMESSAGE(JERR_RLE_BADERROR, "Bogus error code from RLE library") JMESSAGE(JERR_RLE_COLORSPACE, "RLE output must be grayscale or RGB") JMESSAGE(JERR_RLE_DIMENSIONS, "Image dimensions (%ux%u) too large for RLE") JMESSAGE(JERR_RLE_EMPTY, "Empty RLE file") JMESSAGE(JERR_RLE_EOF, "Premature EOF in RLE header") JMESSAGE(JERR_RLE_MEM, "Insufficient memory for RLE header") JMESSAGE(JERR_RLE_NOT, "Not an RLE file") JMESSAGE(JERR_RLE_TOOMANYCHANNELS, "Cannot handle %d output channels for RLE") JMESSAGE(JERR_RLE_UNSUPPORTED, "Cannot handle this RLE setup") JMESSAGE(JTRC_RLE, "%ux%u full-color RLE file") JMESSAGE(JTRC_RLE_FULLMAP, "%ux%u full-color RLE file with map of length %d") JMESSAGE(JTRC_RLE_GRAY, "%ux%u grayscale RLE file") JMESSAGE(JTRC_RLE_MAPGRAY, "%ux%u grayscale RLE file with map of length %d") JMESSAGE(JTRC_RLE_MAPPED, "%ux%u colormapped RLE file with map of length %d") #endif /* RLE_SUPPORTED */ #ifdef TARGA_SUPPORTED JMESSAGE(JERR_TGA_BADCMAP, "Unsupported Targa colormap format") JMESSAGE(JERR_TGA_BADPARMS, "Invalid or unsupported Targa file") JMESSAGE(JERR_TGA_COLORSPACE, "Targa output must be grayscale or RGB") JMESSAGE(JTRC_TGA, "%ux%u RGB Targa image") JMESSAGE(JTRC_TGA_GRAY, "%ux%u grayscale Targa image") JMESSAGE(JTRC_TGA_MAPPED, "%ux%u colormapped Targa image") #else JMESSAGE(JERR_TGA_NOTCOMP, "Targa support was not compiled") #endif /* TARGA_SUPPORTED */ JMESSAGE(JERR_BAD_CMAP_FILE, "Color map file is invalid or of unsupported format") JMESSAGE(JERR_TOO_MANY_COLORS, "Output file format cannot handle %d colormap entries") JMESSAGE(JERR_UNGETC_FAILED, "ungetc failed") #ifdef TARGA_SUPPORTED JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format --- perhaps you need -targa") #else JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format") #endif JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format") #ifdef JMAKE_ENUM_LIST JMSG_LASTADDONCODE } ADDON_MESSAGE_CODE; #undef JMAKE_ENUM_LIST #endif /* JMAKE_ENUM_LIST */ /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ #undef JMESSAGE
{ "pile_set_name": "Github" }
/** * marked - a markdown parser * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed) * https://github.com/chjj/marked */ ;(function() { /** * Block-Level Grammar */ var block = { newline: /^\n+/, code: /^( {4}[^\n]+\n*)+/, fences: noop, hr: /^( *[-*_]){3,} *(?:\n+|$)/, heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/, nptable: noop, lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/, blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/, list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/, html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/, def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/, table: noop, paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/, text: /^[^\n]+/ }; block.bullet = /(?:[*+-]|\d+\.)/; block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/; block.item = replace(block.item, 'gm') (/bull/g, block.bullet) (); block.list = replace(block.list) (/bull/g, block.bullet) ('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))') ('def', '\\n+(?=' + block.def.source + ')') (); block.blockquote = replace(block.blockquote) ('def', block.def) (); block._tag = '(?!(?:' + 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code' + '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo' + '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b'; block.html = replace(block.html) ('comment', /<!--[\s\S]*?-->/) ('closed', /<(tag)[\s\S]+?<\/\1>/) ('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/) (/tag/g, block._tag) (); block.paragraph = replace(block.paragraph) ('hr', block.hr) ('heading', block.heading) ('lheading', block.lheading) ('blockquote', block.blockquote) ('tag', '<' + block._tag) ('def', block.def) (); /** * Normal Block Grammar */ block.normal = merge({}, block); /** * GFM Block Grammar */ block.gfm = merge({}, block.normal, { fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/, paragraph: /^/, heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/ }); block.gfm.paragraph = replace(block.paragraph) ('(?!', '(?!' + block.gfm.fences.source.replace('\\1', '\\2') + '|' + block.list.source.replace('\\1', '\\3') + '|') (); /** * GFM + Tables Block Grammar */ block.tables = merge({}, block.gfm, { nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/, table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/ }); /** * Block Lexer */ function Lexer(options) { this.tokens = []; this.tokens.links = {}; this.options = options || marked.defaults; this.rules = block.normal; if (this.options.gfm) { if (this.options.tables) { this.rules = block.tables; } else { this.rules = block.gfm; } } } /** * Expose Block Rules */ Lexer.rules = block; /** * Static Lex Method */ Lexer.lex = function(src, options) { var lexer = new Lexer(options); return lexer.lex(src); }; /** * Preprocessing */ Lexer.prototype.lex = function(src) { src = src .replace(/\r\n|\r/g, '\n') .replace(/\t/g, ' ') .replace(/\u00a0/g, ' ') .replace(/\u2424/g, '\n'); return this.token(src, true); }; /** * Lexing */ Lexer.prototype.token = function(src, top, bq) { var src = src.replace(/^ +$/gm, '') , next , loose , cap , bull , b , item , space , i , l; while (src) { // newline if (cap = this.rules.newline.exec(src)) { src = src.substring(cap[0].length); if (cap[0].length > 1) { this.tokens.push({ type: 'space' }); } } // code if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); cap = cap[0].replace(/^ {4}/gm, ''); this.tokens.push({ type: 'code', text: !this.options.pedantic ? cap.replace(/\n+$/, '') : cap }); continue; } // fences (gfm) if (cap = this.rules.fences.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'code', lang: cap[2], text: cap[3] || '' }); continue; } // heading if (cap = this.rules.heading.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'heading', depth: cap[1].length, text: cap[2] }); continue; } // table no leading pipe (gfm) if (top && (cap = this.rules.nptable.exec(src))) { src = src.substring(cap[0].length); item = { type: 'table', header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), cells: cap[3].replace(/\n$/, '').split('\n') }; for (i = 0; i < item.align.length; i++) { if (/^ *-+: *$/.test(item.align[i])) { item.align[i] = 'right'; } else if (/^ *:-+: *$/.test(item.align[i])) { item.align[i] = 'center'; } else if (/^ *:-+ *$/.test(item.align[i])) { item.align[i] = 'left'; } else { item.align[i] = null; } } for (i = 0; i < item.cells.length; i++) { item.cells[i] = item.cells[i].split(/ *\| */); } this.tokens.push(item); continue; } // lheading if (cap = this.rules.lheading.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'heading', depth: cap[2] === '=' ? 1 : 2, text: cap[1] }); continue; } // hr if (cap = this.rules.hr.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'hr' }); continue; } // blockquote if (cap = this.rules.blockquote.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: 'blockquote_start' }); cap = cap[0].replace(/^ *> ?/gm, ''); // Pass `top` to keep the current // "toplevel" state. This is exactly // how markdown.pl works. this.token(cap, top, true); this.tokens.push({ type: 'blockquote_end' }); continue; } // list if (cap = this.rules.list.exec(src)) { src = src.substring(cap[0].length); bull = cap[2]; this.tokens.push({ type: 'list_start', ordered: bull.length > 1 }); // Get each top-level item. cap = cap[0].match(this.rules.item); next = false; l = cap.length; i = 0; for (; i < l; i++) { item = cap[i]; // Remove the list item's bullet // so it is seen as the next token. space = item.length; item = item.replace(/^ *([*+-]|\d+\.) +/, ''); // Outdent whatever the // list item contains. Hacky. if (~item.indexOf('\n ')) { space -= item.length; item = !this.options.pedantic ? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '') : item.replace(/^ {1,4}/gm, ''); } // Determine whether the next list item belongs here. // Backpedal if it does not belong in this list. if (this.options.smartLists && i !== l - 1) { b = block.bullet.exec(cap[i + 1])[0]; if (bull !== b && !(bull.length > 1 && b.length > 1)) { src = cap.slice(i + 1).join('\n') + src; i = l - 1; } } // Determine whether item is loose or not. // Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/ // for discount behavior. loose = next || /\n\n(?!\s*$)/.test(item); if (i !== l - 1) { next = item.charAt(item.length - 1) === '\n'; if (!loose) loose = next; } this.tokens.push({ type: loose ? 'loose_item_start' : 'list_item_start' }); // Recurse. this.token(item, false, bq); this.tokens.push({ type: 'list_item_end' }); } this.tokens.push({ type: 'list_end' }); continue; } // html if (cap = this.rules.html.exec(src)) { src = src.substring(cap[0].length); this.tokens.push({ type: this.options.sanitize ? 'paragraph' : 'html', pre: !this.options.sanitizer && (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'), text: cap[0] }); continue; } // def if ((!bq && top) && (cap = this.rules.def.exec(src))) { src = src.substring(cap[0].length); this.tokens.links[cap[1].toLowerCase()] = { href: cap[2], title: cap[3] }; continue; } // table (gfm) if (top && (cap = this.rules.table.exec(src))) { src = src.substring(cap[0].length); item = { type: 'table', header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */), align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */), cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n') }; for (i = 0; i < item.align.length; i++) { if (/^ *-+: *$/.test(item.align[i])) { item.align[i] = 'right'; } else if (/^ *:-+: *$/.test(item.align[i])) { item.align[i] = 'center'; } else if (/^ *:-+ *$/.test(item.align[i])) { item.align[i] = 'left'; } else { item.align[i] = null; } } for (i = 0; i < item.cells.length; i++) { item.cells[i] = item.cells[i] .replace(/^ *\| *| *\| *$/g, '') .split(/ *\| */); } this.tokens.push(item); continue; } // top-level paragraph if (top && (cap = this.rules.paragraph.exec(src))) { src = src.substring(cap[0].length); this.tokens.push({ type: 'paragraph', text: cap[1].charAt(cap[1].length - 1) === '\n' ? cap[1].slice(0, -1) : cap[1] }); continue; } // text if (cap = this.rules.text.exec(src)) { // Top-level should never reach here. src = src.substring(cap[0].length); this.tokens.push({ type: 'text', text: cap[0] }); continue; } if (src) { throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } return this.tokens; }; /** * Inline-Level Grammar */ var inline = { escape: /^\\([\\`*{}\[\]()#+\-.!_>])/, autolink: /^<([^ >]+(@|:\/)[^ >]+)>/, url: noop, tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/, link: /^!?\[(inside)\]\(href\)/, reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/, nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/, em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/, code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/ }; inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/; inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/; inline.link = replace(inline.link) ('inside', inline._inside) ('href', inline._href) (); inline.reflink = replace(inline.reflink) ('inside', inline._inside) (); /** * Normal Inline Grammar */ inline.normal = merge({}, inline); /** * Pedantic Inline Grammar */ inline.pedantic = merge({}, inline.normal, { strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/, em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/ }); /** * GFM Inline Grammar */ inline.gfm = merge({}, inline.normal, { escape: replace(inline.escape)('])', '~|])')(), url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/, del: /^~~(?=\S)([\s\S]*?\S)~~/, text: replace(inline.text) (']|', '~]|') ('|', '|https?://|') () }); /** * GFM + Line Breaks Inline Grammar */ inline.breaks = merge({}, inline.gfm, { br: replace(inline.br)('{2,}', '*')(), text: replace(inline.gfm.text)('{2,}', '*')() }); /** * Inline Lexer & Compiler */ function InlineLexer(links, options) { this.options = options || marked.defaults; this.links = links; this.rules = inline.normal; this.renderer = this.options.renderer || new Renderer; this.renderer.options = this.options; if (!this.links) { throw new Error('Tokens array requires a `links` property.'); } if (this.options.gfm) { if (this.options.breaks) { this.rules = inline.breaks; } else { this.rules = inline.gfm; } } else if (this.options.pedantic) { this.rules = inline.pedantic; } } /** * Expose Inline Rules */ InlineLexer.rules = inline; /** * Static Lexing/Compiling Method */ InlineLexer.output = function(src, links, options) { var inline = new InlineLexer(links, options); return inline.output(src); }; /** * Lexing/Compiling */ InlineLexer.prototype.output = function(src) { var out = '' , link , text , href , cap; while (src) { // escape if (cap = this.rules.escape.exec(src)) { src = src.substring(cap[0].length); out += cap[1]; continue; } // autolink if (cap = this.rules.autolink.exec(src)) { src = src.substring(cap[0].length); if (cap[2] === '@') { text = cap[1].charAt(6) === ':' ? this.mangle(cap[1].substring(7)) : this.mangle(cap[1]); href = this.mangle('mailto:') + text; } else { text = escape(cap[1]); href = text; } out += this.renderer.link(href, null, text); continue; } // url (gfm) if (!this.inLink && (cap = this.rules.url.exec(src))) { src = src.substring(cap[0].length); text = escape(cap[1]); href = text; out += this.renderer.link(href, null, text); continue; } // tag if (cap = this.rules.tag.exec(src)) { if (!this.inLink && /^<a /i.test(cap[0])) { this.inLink = true; } else if (this.inLink && /^<\/a>/i.test(cap[0])) { this.inLink = false; } src = src.substring(cap[0].length); out += this.options.sanitize ? this.options.sanitizer ? this.options.sanitizer(cap[0]) : escape(cap[0]) : cap[0] continue; } // link if (cap = this.rules.link.exec(src)) { src = src.substring(cap[0].length); this.inLink = true; out += this.outputLink(cap, { href: cap[2], title: cap[3] }); this.inLink = false; continue; } // reflink, nolink if ((cap = this.rules.reflink.exec(src)) || (cap = this.rules.nolink.exec(src))) { src = src.substring(cap[0].length); link = (cap[2] || cap[1]).replace(/\s+/g, ' '); link = this.links[link.toLowerCase()]; if (!link || !link.href) { out += cap[0].charAt(0); src = cap[0].substring(1) + src; continue; } this.inLink = true; out += this.outputLink(cap, link); this.inLink = false; continue; } // strong if (cap = this.rules.strong.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.strong(this.output(cap[2] || cap[1])); continue; } // em if (cap = this.rules.em.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.em(this.output(cap[2] || cap[1])); continue; } // code if (cap = this.rules.code.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.codespan(escape(cap[2], true)); continue; } // br if (cap = this.rules.br.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.br(); continue; } // del (gfm) if (cap = this.rules.del.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.del(this.output(cap[1])); continue; } // text if (cap = this.rules.text.exec(src)) { src = src.substring(cap[0].length); out += this.renderer.text(escape(this.smartypants(cap[0]))); continue; } if (src) { throw new Error('Infinite loop on byte: ' + src.charCodeAt(0)); } } return out; }; /** * Compile Link */ InlineLexer.prototype.outputLink = function(cap, link) { var href = escape(link.href) , title = link.title ? escape(link.title) : null; return cap[0].charAt(0) !== '!' ? this.renderer.link(href, title, this.output(cap[1])) : this.renderer.image(href, title, escape(cap[1])); }; /** * Smartypants Transformations */ InlineLexer.prototype.smartypants = function(text) { if (!this.options.smartypants) return text; return text // em-dashes .replace(/---/g, '\u2014') // en-dashes .replace(/--/g, '\u2013') // opening singles .replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018') // closing singles & apostrophes .replace(/'/g, '\u2019') // opening doubles .replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c') // closing doubles .replace(/"/g, '\u201d') // ellipses .replace(/\.{3}/g, '\u2026'); }; /** * Mangle Links */ InlineLexer.prototype.mangle = function(text) { if (!this.options.mangle) return text; var out = '' , l = text.length , i = 0 , ch; for (; i < l; i++) { ch = text.charCodeAt(i); if (Math.random() > 0.5) { ch = 'x' + ch.toString(16); } out += '&#' + ch + ';'; } return out; }; /** * Renderer */ function Renderer(options) { this.options = options || {}; } Renderer.prototype.code = function(code, lang, escaped) { if (this.options.highlight) { var out = this.options.highlight(code, lang); if (out != null && out !== code) { escaped = true; code = out; } } if (!lang) { return '<pre><code>' + (escaped ? code : escape(code, true)) + '\n</code></pre>'; } return '<pre><code class="' + this.options.langPrefix + escape(lang, true) + '">' + (escaped ? code : escape(code, true)) + '\n</code></pre>\n'; }; Renderer.prototype.blockquote = function(quote) { return '<blockquote>\n' + quote + '</blockquote>\n'; }; Renderer.prototype.html = function(html) { return html; }; Renderer.prototype.heading = function(text, level, raw) { return '<h' + level + ' id="' + this.options.headerPrefix + raw.toLowerCase().replace(/[^\w]+/g, '-') + '">' + text + '</h' + level + '>\n'; }; Renderer.prototype.hr = function() { return this.options.xhtml ? '<hr/>\n' : '<hr>\n'; }; Renderer.prototype.list = function(body, ordered) { var type = ordered ? 'ol' : 'ul'; return '<' + type + '>\n' + body + '</' + type + '>\n'; }; Renderer.prototype.listitem = function(text) { return '<li>' + text + '</li>\n'; }; Renderer.prototype.paragraph = function(text) { return '<p>' + text + '</p>\n'; }; Renderer.prototype.table = function(header, body) { return '<table>\n' + '<thead>\n' + header + '</thead>\n' + '<tbody>\n' + body + '</tbody>\n' + '</table>\n'; }; Renderer.prototype.tablerow = function(content) { return '<tr>\n' + content + '</tr>\n'; }; Renderer.prototype.tablecell = function(content, flags) { var type = flags.header ? 'th' : 'td'; var tag = flags.align ? '<' + type + ' style="text-align:' + flags.align + '">' : '<' + type + '>'; return tag + content + '</' + type + '>\n'; }; // span level renderer Renderer.prototype.strong = function(text) { return '<strong>' + text + '</strong>'; }; Renderer.prototype.em = function(text) { return '<em>' + text + '</em>'; }; Renderer.prototype.codespan = function(text) { return '<code>' + text + '</code>'; }; Renderer.prototype.br = function() { return this.options.xhtml ? '<br/>' : '<br>'; }; Renderer.prototype.del = function(text) { return '<del>' + text + '</del>'; }; Renderer.prototype.link = function(href, title, text) { if (this.options.sanitize) { try { var prot = decodeURIComponent(unescape(href)) .replace(/[^\w:]/g, '') .toLowerCase(); } catch (e) { return ''; } if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) { return ''; } } var out = '<a href="' + href + '"'; if (title) { out += ' title="' + title + '"'; } out += '>' + text + '</a>'; return out; }; Renderer.prototype.image = function(href, title, text) { var out = '<img src="' + href + '" alt="' + text + '"'; if (title) { out += ' title="' + title + '"'; } out += this.options.xhtml ? '/>' : '>'; return out; }; Renderer.prototype.text = function(text) { return text; }; /** * Parsing & Compiling */ function Parser(options) { this.tokens = []; this.token = null; this.options = options || marked.defaults; this.options.renderer = this.options.renderer || new Renderer; this.renderer = this.options.renderer; this.renderer.options = this.options; } /** * Static Parse Method */ Parser.parse = function(src, options, renderer) { var parser = new Parser(options, renderer); return parser.parse(src); }; /** * Parse Loop */ Parser.prototype.parse = function(src) { this.inline = new InlineLexer(src.links, this.options, this.renderer); this.tokens = src.reverse(); var out = ''; while (this.next()) { out += this.tok(); } return out; }; /** * Next Token */ Parser.prototype.next = function() { return this.token = this.tokens.pop(); }; /** * Preview Next Token */ Parser.prototype.peek = function() { return this.tokens[this.tokens.length - 1] || 0; }; /** * Parse Text Tokens */ Parser.prototype.parseText = function() { var body = this.token.text; while (this.peek().type === 'text') { body += '\n' + this.next().text; } return this.inline.output(body); }; /** * Parse Current Token */ Parser.prototype.tok = function() { switch (this.token.type) { case 'space': { return ''; } case 'hr': { return this.renderer.hr(); } case 'heading': { return this.renderer.heading( this.inline.output(this.token.text), this.token.depth, this.token.text); } case 'code': { return this.renderer.code(this.token.text, this.token.lang, this.token.escaped); } case 'table': { var header = '' , body = '' , i , row , cell , flags , j; // header cell = ''; for (i = 0; i < this.token.header.length; i++) { flags = { header: true, align: this.token.align[i] }; cell += this.renderer.tablecell( this.inline.output(this.token.header[i]), { header: true, align: this.token.align[i] } ); } header += this.renderer.tablerow(cell); for (i = 0; i < this.token.cells.length; i++) { row = this.token.cells[i]; cell = ''; for (j = 0; j < row.length; j++) { cell += this.renderer.tablecell( this.inline.output(row[j]), { header: false, align: this.token.align[j] } ); } body += this.renderer.tablerow(cell); } return this.renderer.table(header, body); } case 'blockquote_start': { var body = ''; while (this.next().type !== 'blockquote_end') { body += this.tok(); } return this.renderer.blockquote(body); } case 'list_start': { var body = '' , ordered = this.token.ordered; while (this.next().type !== 'list_end') { body += this.tok(); } return this.renderer.list(body, ordered); } case 'list_item_start': { var body = ''; while (this.next().type !== 'list_item_end') { body += this.token.type === 'text' ? this.parseText() : this.tok(); } return this.renderer.listitem(body); } case 'loose_item_start': { var body = ''; while (this.next().type !== 'list_item_end') { body += this.tok(); } return this.renderer.listitem(body); } case 'html': { var html = !this.token.pre && !this.options.pedantic ? this.inline.output(this.token.text) : this.token.text; return this.renderer.html(html); } case 'paragraph': { return this.renderer.paragraph(this.inline.output(this.token.text)); } case 'text': { return this.renderer.paragraph(this.parseText()); } } }; /** * Helpers */ function escape(html, encode) { return html .replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&amp;') .replace(/</g, '&lt;') .replace(/>/g, '&gt;') .replace(/"/g, '&quot;') .replace(/'/g, '&#39;'); } function unescape(html) { // explicitly match decimal, hex, and named HTML entities return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) { n = n.toLowerCase(); if (n === 'colon') return ':'; if (n.charAt(0) === '#') { return n.charAt(1) === 'x' ? String.fromCharCode(parseInt(n.substring(2), 16)) : String.fromCharCode(+n.substring(1)); } return ''; }); } function replace(regex, opt) { regex = regex.source; opt = opt || ''; return function self(name, val) { if (!name) return new RegExp(regex, opt); val = val.source || val; val = val.replace(/(^|[^\[])\^/g, '$1'); regex = regex.replace(name, val); return self; }; } function noop() {} noop.exec = noop; function merge(obj) { var i = 1 , target , key; for (; i < arguments.length; i++) { target = arguments[i]; for (key in target) { if (Object.prototype.hasOwnProperty.call(target, key)) { obj[key] = target[key]; } } } return obj; } /** * Marked */ function marked(src, opt, callback) { if (callback || typeof opt === 'function') { if (!callback) { callback = opt; opt = null; } opt = merge({}, marked.defaults, opt || {}); var highlight = opt.highlight , tokens , pending , i = 0; try { tokens = Lexer.lex(src, opt) } catch (e) { return callback(e); } pending = tokens.length; var done = function(err) { if (err) { opt.highlight = highlight; return callback(err); } var out; try { out = Parser.parse(tokens, opt); } catch (e) { err = e; } opt.highlight = highlight; return err ? callback(err) : callback(null, out); }; if (!highlight || highlight.length < 3) { return done(); } delete opt.highlight; if (!pending) return done(); for (; i < tokens.length; i++) { (function(token) { if (token.type !== 'code') { return --pending || done(); } return highlight(token.text, token.lang, function(err, code) { if (err) return done(err); if (code == null || code === token.text) { return --pending || done(); } token.text = code; token.escaped = true; --pending || done(); }); })(tokens[i]); } return; } try { if (opt) opt = merge({}, marked.defaults, opt); return Parser.parse(Lexer.lex(src, opt), opt); } catch (e) { e.message += '\nPlease report this to https://github.com/chjj/marked.'; if ((opt || marked.defaults).silent) { return '<p>An error occured:</p><pre>' + escape(e.message + '', true) + '</pre>'; } throw e; } } /** * Options */ marked.options = marked.setOptions = function(opt) { merge(marked.defaults, opt); return marked; }; marked.defaults = { gfm: true, tables: true, breaks: false, pedantic: false, sanitize: false, sanitizer: null, mangle: true, smartLists: false, silent: false, highlight: null, langPrefix: 'lang-', smartypants: false, headerPrefix: '', renderer: new Renderer, xhtml: false }; /** * Expose */ marked.Parser = Parser; marked.parser = Parser.parse; marked.Renderer = Renderer; marked.Lexer = Lexer; marked.lexer = Lexer.lex; marked.InlineLexer = InlineLexer; marked.inlineLexer = InlineLexer.output; marked.parse = marked; if (typeof module !== 'undefined' && typeof exports === 'object') { module.exports = marked; } else if (typeof define === 'function' && define.amd) { define(function() { return marked; }); } else { this.marked = marked; } }).call(function() { return this || (typeof window !== 'undefined' ? window : global); }());
{ "pile_set_name": "Github" }
// This file is part of the "x0" project, http://github.com/christianparpart/x0> // (c) 2009-2018 Christian Parpart <[email protected]> // // Licensed under the MIT License (the "License"); you may not use this // file except in compliance with the License. You may obtain a copy of // the License at: http://opensource.org/licenses/MIT #pragma once #include <xzero/thread/Future.h> #include <xzero/http/cluster/Backend.h> #include <xzero/http/cluster/Scheduler.h> #include <xzero/http/cluster/HealthMonitor.h> #include <xzero/net/InetAddress.h> #include <xzero/TokenShaper.h> #include <xzero/Duration.h> #include <xzero/Counter.h> #include <utility> #include <istream> #include <vector> #include <list> namespace xzero { class Executor; class IniFile; class JsonWriter; } namespace xzero::http::cluster { struct HealthMonitorSettings { std::string hostHeader = "healthMonitor"; std::string requestPath = "/"; std::string fcgiScriptFilename = ""; Duration interval = 4_seconds; unsigned successThreshold = 3; std::vector<HttpStatus> successCodes = {HttpStatus::Ok}; }; struct Settings { bool enabled = true; bool stickyOfflineMode = false; bool allowXSendfile = true; bool enqueueOnUnavailable = true; size_t queueLimit = 1000; Duration queueTimeout = 30_seconds; Duration retryAfter = 30_seconds; size_t maxRetryCount = 3; Duration connectTimeout = 4_seconds; Duration readTimeout = 30_seconds; Duration writeTimeout = 8_seconds; HealthMonitorSettings healthMonitor; }; /** * Implements an HTTP reverse proxy supporting multiple backends. */ class Cluster : public Backend::EventListener { public: using RequestShaper = TokenShaper<Context>; using Bucket = RequestShaper::Node; /** * Constructs a cluster that's being loaded from a configuration file. * * @p name unique and human readable cluster name * @p storagePath path to local file for loading and storing cluster configuration. * @p executor Executor API to use for cluster operations (such as health checks) */ Cluster(const std::string& name, const std::string& storagePath, Executor* executor); Cluster(const std::string& name, const std::string& storagePath, Executor* executor, bool enabled, bool stickyOfflineMode, bool allowXSendfile, bool enqueueOnUnavailable, size_t queueLimit, Duration queueTimeout, Duration retryAfter, size_t maxRetryCount, Duration connectTimeout, Duration readTimeout, Duration writeTimeout, const std::string& healthCheckHostHeader, const std::string& healthCheckRequestPath, const std::string& healthCheckFcgiScriptFilename, Duration healthCheckInterval, unsigned healthCheckSuccessThreshold, const std::vector<HttpStatus>& healthCheckSuccessCodes); ~Cluster(); // {{{ configuration const std::string& name() const { return name_; } void setName(const std::string& name) { name_ = name; } bool isEnabled() const { return enabled_; } void setEnabled(bool value) { enabled_ = value; } void enable() { enabled_ = true; } void disable() { enabled_ = false; } bool isMutable() const { return mutable_; } void setMutable(bool value) { mutable_ = value; } bool stickyOfflineMode() const { return stickyOfflineMode_; } void setStickyOfflineMode(bool value) { stickyOfflineMode_ = value; } bool allowXSendfile() const { return allowXSendfile_; } void setAllowXSendfile(bool value) { allowXSendfile_ = value; } bool enqueueOnUnavailable() const { return enqueueOnUnavailable_; } void setEnqueueOnUnavailable(bool value) { enqueueOnUnavailable_ = value; } size_t queueLimit() const { return queueLimit_; } void setQueueLimit(size_t value) { queueLimit_ = value; } Duration queueTimeout() const { return queueTimeout_; } void setQueueTimeout(Duration value) { queueTimeout_ = value; } Duration retryAfter() const { return retryAfter_; } void setRetryAfter(Duration value) { retryAfter_ = value; } size_t maxRetryCount() const { return maxRetryCount_; } void setMaxRetryCount(size_t value) { maxRetryCount_ = value; } Duration connectTimeout() const noexcept { return connectTimeout_; } void setConnectTimeout(Duration value) { connectTimeout_ = value; } Duration readTimeout() const noexcept { return readTimeout_; } void setReadTimeout(Duration value) { readTimeout_ = value; } Duration writeTimeout() const noexcept { return writeTimeout_; } void setWriteTimeout(Duration value) { writeTimeout_ = value; } Executor* executor() const noexcept { return executor_; } TokenShaperError createBucket(const std::string& name, float rate, float ceil); Bucket* findBucket(const std::string& name) const; Bucket* rootBucket() const { return shaper()->rootNode(); } bool eachBucket(std::function<bool(Bucket*)> body); const RequestShaper* shaper() const { return &shaper_; } RequestShaper* shaper() { return &shaper_; } bool setScheduler(const std::string& scheduler); void setScheduler(std::unique_ptr<Scheduler> scheduler); Scheduler* scheduler() const { return scheduler_.get(); } /** * Adds a new member to the HTTP cluster without any capacity constrain. * * @param addr upstream TCP/IP address and port */ void addMember(const InetAddress& addr); /** * Adds a new member to the HTTP cluster. * * @param addr upstream TCP/IP address and port * @param capacity number of concurrent requests this member can handle at * most. */ void addMember(const InetAddress& addr, size_t capacity); /** * Adds a new member to the HTTP cluster. * * @param name human readable name for the given member. * @param addr upstream TCP/IP address and port * @param capacity number of concurrent requests this member can handle at * most. * @param enabled Initial enabled-state. * @param terminateProtection * @param protocol * @param healthCheckInterval */ void addMember(const std::string& name, const InetAddress& addr, size_t capacity, bool enabled, bool terminateProtection, const std::string& protocol, Duration healthCheckInterval); Backend* findMember(const std::string& name); /** * Removes member by name. * * @param name human readable name of the member to be removed. */ void removeMember(const std::string& name); // // .... FIXME: proper API namespacing. maybe cluster->healthMonitor()->{testUri, interval, consecutiveSuccessCount, ...} const std::string& healthCheckHostHeader() const noexcept { return healthCheckHostHeader_; } void setHealthCheckHostHeader(const std::string& value); const std::string& healthCheckRequestPath() const noexcept { return healthCheckRequestPath_; } void setHealthCheckRequestPath(const std::string& value); Duration healthCheckInterval() const noexcept { return healthCheckInterval_; } void setHealthCheckInterval(Duration value); unsigned healthCheckSuccessThreshold() const noexcept { return healthCheckSuccessThreshold_; } void setHealthCheckSuccessThreshold(unsigned value); const std::vector<HttpStatus>& healthCheckSuccessCodes() const noexcept { return healthCheckSuccessCodes_; } void setHealthCheckSuccessCodes(const std::vector<HttpStatus>& value); // }}} // {{{ serialization /** * Retrieves the configuration as a text string. */ std::string configuration() const; /** * Sets the cluster configuration as defined by given string. * * @see std::string configuration() const */ void setConfiguration(const std::string& configuration, const std::string& path); void saveConfiguration(); // }}} /** * Passes given request to a cluster member to be served. * * Uses the root bucket. * * @param cx request to schedule */ void schedule(Context* cx); /** * Passes given request @p cx to a cluster member to be served, * honoring given @p bucket. * * @param cx request to schedule * @param bucket a TokenShaper bucket to allocate this request into. */ void schedule(Context* cx, Bucket* bucket); /** * Serializes statistics into the json writer. */ void serialize(JsonWriter& json) const; // Backend::EventListener overrides void onEnabledChanged(Backend* member) override; void onCapacityChanged(Backend* member, size_t old) override; void onHealthChanged(Backend* member, HealthMonitor::State old) override; void onProcessingSucceed(Backend* member) override; void onProcessingFailed(Context* request) override; private: void reschedule(Context* cx); void serviceUnavailable(Context* cx, HttpStatus status = HttpStatus::ServiceUnavailable); bool verifyTryCount(Context* cx); void enqueue(Context* cx); void dequeueTo(Backend* backend); Context* dequeue(); void onTimeout(Context* cx); void loadBackend(const IniFile& settings, const std::string& key); void loadBucket(const IniFile& settings, const std::string& key); private: // cluster's human readable representative name. std::string name_; // whether this director actually load balances or raises a 503 // when being disabled temporarily. bool enabled_; bool mutable_; // whether a backend should be marked disabled if it becomes online again bool stickyOfflineMode_; // whether or not to evaluate the X-Sendfile response header. bool allowXSendfile_; // whether to enqueue or to 503 the request when the request could not // be delivered (no backend is UP). bool enqueueOnUnavailable_; // how many requests to queue in total. size_t queueLimit_; // how long a request may be queued. Duration queueTimeout_; // time a client should wait before retrying a failed request. Duration retryAfter_; // number of attempts to pass request to a backend before giving up size_t maxRetryCount_; // backend connect() timeout Duration connectTimeout_; // backend response read timeout Duration readTimeout_; // backend request write timeout Duration writeTimeout_; // Executor used for request shaping and health checking Executor* executor_; // path to the local directory this director is serialized from/to. std::string storagePath_; RequestShaper shaper_; // cluster member vector std::vector<std::unique_ptr<Backend>> members_; // health check: test URL std::string healthCheckHostHeader_; std::string healthCheckRequestPath_; std::string healthCheckFcgiScriptFilename_; // health-check: test interval Duration healthCheckInterval_; // health-check: number of consecutive success responsives before setting // a backend (back to) online. unsigned healthCheckSuccessThreshold_; // health-check: list of HTTP status codes to treat as success. std::vector<HttpStatus> healthCheckSuccessCodes_; // member scheduler std::unique_ptr<Scheduler> scheduler_; // statistical counter for accumulated cluster load (all members) Counter load_; // statistical counter of how many requests are currently queued. Counter queued_; // statistical number of how many requests has been dropped so far. std::atomic<unsigned long long> dropped_; }; } // namespace xzero::http::cluster
{ "pile_set_name": "Github" }
package org.reactfx; import static org.junit.Assert.*; import org.junit.Test; import org.reactfx.value.SuspendableVar; import org.reactfx.value.Var; public class SuspenderStreamTest { @Test public void test() { SuspendableVar<String> a = Var.newSimpleVar("foo").suspendable(); Counter counter = new Counter(); a.addListener((obs, oldVal, newVal) -> counter.inc()); EventSource<Void> src = new EventSource<>(); EventStream<Void> suspender = src.suspenderOf(a); suspender.hook(x -> a.setValue("bar")).subscribe(x -> { assertEquals(0, counter.get()); }); src.push(null); assertEquals(1, counter.get()); } }
{ "pile_set_name": "Github" }
#!/bin/sh # Based on gabors ralink wisoc implementation. rt2x00_eeprom_die() { echo "rt2x00 eeprom: " "$*" exit 1 } rt2x00_eeprom_extract() { local part=$1 local offset=$2 local count=$3 local mtd . /lib/functions.sh mtd=$(find_mtd_part $part) [ -n "$mtd" ] || \ rt2x00_eeprom_die "no mtd device found for partition $part" dd if=$mtd of=/lib/firmware/$FIRMWARE bs=1 skip=$offset count=$count || \ rt2x00_eeprom_die "failed to extract from $mtd" } [ -e /lib/firmware/$FIRMWARE ] && exit 0 . /lib/brcm63xx.sh board=$board_name case "$FIRMWARE" in "rt2x00.eeprom" ) case $board in HW556_A) rt2x00_eeprom_extract "cal_data" 130560 512 ;; *) rt2x00_eeprom_die "board $board is not supported yet" ;; esac ;; esac
{ "pile_set_name": "Github" }
// Copyright 2015 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/macros.h" #include "base/strings/string_number_conversions.h" #include "content/browser/accessibility/browser_accessibility.h" #include "content/browser/renderer_host/render_widget_host_view_child_frame.h" #include "content/browser/web_contents/web_contents_impl.h" #include "content/public/test/accessibility_notification_waiter.h" #include "content/public/test/browser_test.h" #include "content/public/test/browser_test_utils.h" #include "content/public/test/content_browser_test.h" #include "content/public/test/content_browser_test_utils.h" #include "content/public/test/hit_test_region_observer.h" #include "content/shell/browser/shell.h" #include "content/test/content_browser_test_utils_internal.h" #include "net/dns/mock_host_resolver.h" #include "net/test/embedded_test_server/embedded_test_server.h" #include "ui/accessibility/ax_node_data.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/events/event.h" #include "ui/events/event_sink.h" #include "ui/events/event_utils.h" namespace content { class TouchAccessibilityBrowserTest : public ContentBrowserTest { public: TouchAccessibilityBrowserTest() {} protected: void SetUpOnMainThread() override { host_resolver()->AddRule("*", "127.0.0.1"); SetupCrossSiteRedirector(embedded_test_server()); ASSERT_TRUE(embedded_test_server()->Start()); } void NavigateToUrlAndWaitForAccessibilityTree(const GURL& url) { AccessibilityNotificationWaiter waiter(shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kLoadComplete); EXPECT_TRUE(NavigateToURL(shell(), url)); waiter.WaitForNotification(); } void SendTouchExplorationEvent(int x, int y) { aura::Window* window = shell()->web_contents()->GetContentNativeView(); ui::EventSink* sink = window->GetHost()->event_sink(); gfx::Rect bounds = window->GetBoundsInRootWindow(); gfx::Point location(bounds.x() + x, bounds.y() + y); int flags = ui::EF_TOUCH_ACCESSIBILITY; std::unique_ptr<ui::Event> mouse_move_event( new ui::MouseEvent(ui::ET_MOUSE_MOVED, location, location, ui::EventTimeForNow(), flags, 0)); ignore_result(sink->OnEventFromSource(mouse_move_event.get())); } DISALLOW_COPY_AND_ASSIGN(TouchAccessibilityBrowserTest); }; IN_PROC_BROWSER_TEST_F(TouchAccessibilityBrowserTest, TouchExplorationSendsHoverEvents) { // Create HTML with a 7 x 5 table, each exactly 50 x 50 pixels. std::string html_url = "data:text/html," "<style>" " body { margin: 0; }" " table { border-spacing: 0; border-collapse: collapse; }" " td { width: 50px; height: 50px; padding: 0; }" "</style>" "<body>" "<table>"; int cell = 0; for (int row = 0; row < 5; ++row) { html_url += "<tr>"; for (int col = 0; col < 7; ++col) { html_url += "<td>" + base::NumberToString(cell) + "</td>"; ++cell; } html_url += "</tr>"; } html_url += "</table></body>"; NavigateToUrlAndWaitForAccessibilityTree(GURL(html_url)); // Get the BrowserAccessibilityManager. WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(shell()->web_contents()); BrowserAccessibilityManager* manager = web_contents->GetRootBrowserAccessibilityManager(); ASSERT_NE(nullptr, manager); // Loop over all of the cells in the table. For each one, send a simulated // touch exploration event in the center of that cell, and assert that we // get an accessibility hover event fired in the correct cell. AccessibilityNotificationWaiter waiter( shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kHover); for (int row = 0; row < 5; ++row) { for (int col = 0; col < 7; ++col) { std::string expected_cell_text = base::NumberToString(row * 7 + col); VLOG(1) << "Sending event in row " << row << " col " << col << " with text " << expected_cell_text; SendTouchExplorationEvent(50 * col + 25, 50 * row + 25); // Wait until we get a hover event in the expected grid cell. // Tolerate additional events, keep looping until we get the expected one. std::string cell_text; do { waiter.WaitForNotification(); int target_id = waiter.event_target_id(); BrowserAccessibility* hit = manager->GetFromID(target_id); BrowserAccessibility* child = hit->PlatformGetChild(0); ASSERT_NE(nullptr, child); cell_text = child->GetData().GetStringAttribute( ax::mojom::StringAttribute::kName); VLOG(1) << "Got hover event in cell with text: " << cell_text; } while (cell_text != expected_cell_text); } } } IN_PROC_BROWSER_TEST_F(TouchAccessibilityBrowserTest, TouchExplorationInIframe) { NavigateToUrlAndWaitForAccessibilityTree(embedded_test_server()->GetURL( "/accessibility/html/iframe-coordinates.html")); WaitForAccessibilityTreeToContainNodeWithName(shell()->web_contents(), "Ordinary Button"); // Get the BrowserAccessibilityManager for the first child frame. RenderFrameHostImpl* main_frame = static_cast<RenderFrameHostImpl*>( shell()->web_contents()->GetMainFrame()); RenderFrameHostImpl* child_frame = main_frame->frame_tree_node()->child_at(0)->current_frame_host(); BrowserAccessibilityManager* child_manager = child_frame->GetOrCreateBrowserAccessibilityManager(); ASSERT_NE(nullptr, child_manager); // Send a touch exploration event to the button in the first iframe. // A touch exploration event is just a mouse move event with // the ui::EF_TOUCH_ACCESSIBILITY flag set. AccessibilityNotificationWaiter waiter(shell()->web_contents(), ui::AXMode(), ax::mojom::Event::kHover); SendTouchExplorationEvent(50, 350); waiter.WaitForNotification(); int target_id = waiter.event_target_id(); BrowserAccessibility* hit = child_manager->GetFromID(target_id); EXPECT_EQ(ax::mojom::Role::kButton, hit->GetData().role); std::string text = hit->GetData().GetStringAttribute(ax::mojom::StringAttribute::kName); EXPECT_EQ("Ordinary Button", text); } IN_PROC_BROWSER_TEST_F(TouchAccessibilityBrowserTest, TouchExplorationInCrossSiteIframe) { NavigateToUrlAndWaitForAccessibilityTree(embedded_test_server()->GetURL( "/accessibility/html/iframe-coordinates-cross-process.html")); WaitForAccessibilityTreeToContainNodeWithName(shell()->web_contents(), "Ordinary Button"); // Get the BrowserAccessibilityManager for the first child frame. RenderFrameHostImpl* main_frame = static_cast<RenderFrameHostImpl*>( shell()->web_contents()->GetMainFrame()); RenderFrameHostImpl* child_frame = main_frame->frame_tree_node()->child_at(0)->current_frame_host(); BrowserAccessibilityManager* child_manager = child_frame->GetOrCreateBrowserAccessibilityManager(); ASSERT_NE(nullptr, child_manager); // If OOPIFs are enabled, wait until hit testing data is ready, otherwise the // touch event will not get sent to the correct renderer process. However the // |child_frame| being used here is not actually a // RenderWidgetHostViewChildFrame. WaitForHitTestData(child_frame); // Send a touch exploration event to the button in the first iframe. // A touch exploration event is just a mouse move event with // the ui::EF_TOUCH_ACCESSIBILITY flag set. AccessibilityNotificationWaiter waiter(shell()->web_contents(), ui::AXMode(), ax::mojom::Event::kHover); SendTouchExplorationEvent(50, 350); waiter.WaitForNotification(); int target_id = waiter.event_target_id(); BrowserAccessibility* hit = child_manager->GetFromID(target_id); EXPECT_EQ(ax::mojom::Role::kButton, hit->GetData().role); std::string text = hit->GetData().GetStringAttribute(ax::mojom::StringAttribute::kName); EXPECT_EQ("Ordinary Button", text); } } // namespace content
{ "pile_set_name": "Github" }
// This file is generated // Copyright (c) 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h #define {{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h {% if config.exported.export_header %} #include {{format_include(config.exported.export_header)}} {% endif %} #include {{format_include(config.exported.string_header)}} {% for namespace in config.protocol.namespace %} namespace {{namespace}} { {% endfor %} namespace {{domain.domain}} { namespace API { // ------------- Enums. {% for type in domain.types %} {% if ("enum" in type) and protocol.is_exported(domain.domain, type.id) %} namespace {{type.id}}Enum { {% for literal in type.enum %} {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelcase}}; {% endfor %} } // {{type.id}}Enum {% endif %} {% endfor %} {% for command in join_arrays(domain, ["commands", "events"]) %} {% for param in join_arrays(command, ["parameters", "returns"]) %} {% if ("enum" in param) and protocol.is_exported(domain.domain, command.name + "." + param.name) %} namespace {{command.name | to_title_case}} { namespace {{param.name | to_title_case}}Enum { {% for literal in param.enum %} {{config.exported.export_macro}} extern const char* {{ literal | dash_to_camelcase}}; {% endfor %} } // {{param.name | to_title_case}}Enum } // {{command.name | to_title_case }} {% endif %} {% endfor %} {% endfor %} // ------------- Types. {% for type in domain.types %} {% if not (type.type == "object") or not ("properties" in type) or not protocol.is_exported(domain.domain, type.id) %}{% continue %}{% endif %} class {{config.exported.export_macro}} {{type.id}} { public: virtual {{config.exported.string_out}} toJSONString() const = 0; virtual ~{{type.id}}() { } static std::unique_ptr<protocol::{{domain.domain}}::API::{{type.id}}> fromJSONString(const {{config.exported.string_in}}& json); }; {% endfor %} } // namespace API } // namespace {{domain.domain}} {% for namespace in config.protocol.namespace %} } // namespace {{namespace}} {% endfor %} #endif // !defined({{"_".join(config.protocol.namespace)}}_{{domain.domain}}_api_h)
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="NBGV_SetDefaults"> <PropertyGroup> <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects> <VersionDependsOn> GetNuPkgVersion; $(VersionDependsOn) </VersionDependsOn> <GenerateNuspecDependsOn> GetBuildVersion; $(GenerateNuspecDependsOn) </GenerateNuspecDependsOn> <GetPackageVersionDependsOn> GetBuildVersion; $(GetPackageVersionDependsOn) </GetPackageVersionDependsOn> <!-- Suppress version attribute generation in Microsoft.NET.Sdk projects to avoid build failures when two sets of attributes are emitted. --> <GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute> <GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute> <GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute> </PropertyGroup> <Import Project="Nerdbank.GitVersioning.Common.targets"/> <UsingTask AssemblyFile="$(NerdbankGitVersioningTasksPath)Nerdbank.GitVersioning.Tasks.dll" TaskName="Nerdbank.GitVersioning.Tasks.AssemblyVersionInfo"/> <UsingTask AssemblyFile="$(NerdbankGitVersioningTasksPath)Nerdbank.GitVersioning.Tasks.dll" TaskName="Nerdbank.GitVersioning.Tasks.NativeVersionInfo"/> <UsingTask AssemblyFile="$(NerdbankGitVersioningTasksPath)Nerdbank.GitVersioning.Tasks.dll" TaskName="Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables"/> <UsingTask AssemblyFile="$(NerdbankGitVersioningTasksPath)Nerdbank.GitVersioning.Tasks.dll" TaskName="Nerdbank.GitVersioning.Tasks.CompareFiles"/> <Target Name="NBGV_SetDefaults"> <!-- Workarounds for https://github.com/dotnet/Nerdbank.GitVersioning/issues/404 --> <PropertyGroup> <!-- $(TargetExt) isn't set at evaluation time for us when built in wpftmp.csproj with manual imports --> <!-- Suppress assembly version info generation if not obviously compiling an assembly. --> <GenerateAssemblyVersionInfo Condition=" '$(GenerateAssemblyVersionInfo)' == '' and '$(TargetExt)' != '.dll' and '$(TargetExt)' != '.exe'">false</GenerateAssemblyVersionInfo> <!-- Workaround the property stomping that msbuild does (see https://github.com/microsoft/msbuild/pull/4922) with manual imports. --> <PrepareForBuildDependsOn> GenerateNativeVersionInfo; $(PrepareForBuildDependsOn); </PrepareForBuildDependsOn> <PrepareResourcesDependsOn> GenerateAssemblyVersionInfo; $(PrepareResourcesDependsOn) </PrepareResourcesDependsOn> <CoreCompileDependsOn> GenerateAssemblyVersionInfo; $(CoreCompileDependsOn) </CoreCompileDependsOn> </PropertyGroup> </Target> <PropertyGroup> <!-- Consider building a tag to be more precise than the branch we're building. --> <_NBGV_BuildingRef>$(_NBGV_BuildingTag)</_NBGV_BuildingRef> <_NBGV_BuildingRef Condition=" '$(_NBGV_BuildingRef)' == '' ">$(_NBGV_BuildingBranch)</_NBGV_BuildingRef> </PropertyGroup> <Target Name="GetBuildVersion" Returns="$(BuildVersion)"> <PropertyGroup> <GitVersionBaseDirectory Condition=" '$(GitVersionBaseDirectory)' == '' ">$(MSBuildProjectDirectory)</GitVersionBaseDirectory> <NBGV_InnerGlobalProperties> GitRepoRoot=$(GitRepoRoot); PublicRelease=$(PublicRelease); BuildMetadata=@(BuildMetadata, ','); _NBGV_BuildingRef=$(_NBGV_BuildingRef); ProjectPathRelativeToGitRepoRoot=$(ProjectPathRelativeToGitRepoRoot); ProjectDirectory=$(GitVersionBaseDirectory); OverrideBuildNumberOffset=$(OverrideBuildNumberOffset); </NBGV_InnerGlobalProperties> <NBGV_CoreTargets>$(MSBuildThisFileDirectory)Nerdbank.GitVersioning.Inner.targets</NBGV_CoreTargets> </PropertyGroup> <!-- Compile a list of global properties that may vary when a project builds but that would never influence the result of the GetBuildVersion task. --> <ItemGroup> <NBGV_GlobalPropertiesToRemove Include="TargetFramework" /> </ItemGroup> <!-- Calculate version by invoking another "project" with global properties that will serve as a key into an msbuild cache to ensure we only invoke the GetBuildVersion task as many times as will produce a unique value. --> <MSBuild Projects="$(NBGV_CoreTargets)" Properties="$(NBGV_InnerGlobalProperties)" RemoveProperties="@(NBGV_GlobalPropertiesToRemove)" Targets="GetBuildVersion_Properties"> <Output TaskParameter="TargetOutputs" ItemName="NBGV_PropertyItems" /> </MSBuild> <!-- Convert each task item into a bona fide MSBuild property. --> <CreateProperty Value="%(NBGV_PropertyItems.Value)" Condition=" !%(NBGV_PropertyItems.HonorPresetValue) "> <Output TaskParameter="Value" PropertyName="%(NBGV_PropertyItems.Identity)" /> </CreateProperty> <!-- Set those properties that require special care to not overwrite prior values. --> <PropertyGroup> <CloudBuildNumber Condition=" '$(CloudBuildNumber)' == '' and %(NBGV_PropertyItems.Identity) == 'CloudBuildNumber' ">%(Value)</CloudBuildNumber> </PropertyGroup> <!-- Also get other items. --> <MSBuild Projects="$(NBGV_CoreTargets)" Properties="$(NBGV_InnerGlobalProperties)" RemoveProperties="@(NBGV_GlobalPropertiesToRemove)" Targets="GetBuildVersion_CloudBuildVersionVars"> <Output TaskParameter="TargetOutputs" ItemName="CloudBuildVersionVars" /> </MSBuild> </Target> <Target Name="SetCloudBuildVersionVars" DependsOnTargets="GetBuildVersion" AfterTargets="GetBuildVersion" Condition=" '@(CloudBuildVersionVars)' != '' "> <Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables CloudBuildVersionVars="@(CloudBuildVersionVars)"> <Output TaskParameter="MSBuildPropertyUpdates" ItemName="_MSBuildPropertyUpdates_Vars" /> </Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables> <CreateProperty Value="%(_MSBuildPropertyUpdates_Vars.Value)" Condition=" '@(_MSBuildPropertyUpdates_Vars)' != '' "> <Output TaskParameter="Value" PropertyName="%(_MSBuildPropertyUpdates_Vars.Identity)" /> </CreateProperty> </Target> <Target Name="SetCloudBuildNumberWithVersion" DependsOnTargets="GetBuildVersion" AfterTargets="GetBuildVersion" Condition=" '$(CloudBuildNumber)' != '' "> <Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables CloudBuildNumber="$(CloudBuildNumber)"> <Output TaskParameter="MSBuildPropertyUpdates" ItemName="_MSBuildPropertyUpdates_BuildNumber" /> </Nerdbank.GitVersioning.Tasks.SetCloudBuildVariables> <CreateProperty Value="%(_MSBuildPropertyUpdates_BuildNumber.Value)" Condition=" '@(_MSBuildPropertyUpdates_BuildNumber)' != '' "> <Output TaskParameter="Value" PropertyName="%(_MSBuildPropertyUpdates_BuildNumber.Identity)" /> </CreateProperty> </Target> <Target Name="GetNuGetPackageVersion" DependsOnTargets="GetBuildVersion" Returns="$(NuGetPackageVersion)" /> <Target Name="GenerateAssemblyVersionInfo" DependsOnTargets="GetBuildVersion" Condition=" '$(GenerateAssemblyVersionInfo)' != 'false' "> <PropertyGroup> <VersionSourceFile>$(IntermediateOutputPath)\$(AssemblyName).Version$(DefaultLanguageSourceExtension)</VersionSourceFile> <NewVersionSourceFile>$(VersionSourceFile).new</NewVersionSourceFile> <UltimateResourceFallbackLocation Condition=" '$(DevDivProjectSubType)' != 'portable' ">UltimateResourceFallbackLocation.MainAssembly</UltimateResourceFallbackLocation> </PropertyGroup> <MakeDir Directories="$(IntermediatePath)"/> <Nerdbank.GitVersioning.Tasks.AssemblyVersionInfo OutputFile="$(NewVersionSourceFile)" CodeLanguage="$(Language)" AssemblyVersion="$(AssemblyVersion)" AssemblyFileVersion="$(AssemblyFileVersion)" AssemblyInformationalVersion="$(AssemblyInformationalVersion)" AssemblyName="$(AssemblyName)" RootNamespace="$(RootNamespace)" AssemblyOriginatorKeyFile="$(AssemblyOriginatorKeyFile)" AssemblyTitle="$(AssemblyTitle)" AssemblyProduct="$(AssemblyProduct)" AssemblyCopyright="$(AssemblyCopyright)" AssemblyCompany="$(AssemblyCompany)" AssemblyConfiguration="$(Configuration)" PublicRelease="$(PublicRelease)" PrereleaseVersion="$(PrereleaseVersion)" GitCommitId="$(GitCommitId)" GitCommitDateTicks="$(GitCommitDateTicks)" EmitNonVersionCustomAttributes="$(NBGV_EmitNonVersionCustomAttributes)" EmitThisAssemblyClass="$(NBGV_EmitThisAssemblyClass)" /> <!-- Avoid applying the newly generated AssemblyVersionInfo.cs file to the build unless it has changed in order to allow for incremental building. --> <Nerdbank.GitVersioning.Tasks.CompareFiles OriginalItems="$(VersionSourceFile)" NewItems="$(NewVersionSourceFile)"> <Output TaskParameter="AreChanged" PropertyName="AssemblyVersionInfoChanged" /> </Nerdbank.GitVersioning.Tasks.CompareFiles> <Copy Condition=" '$(AssemblyVersionInfoChanged)' == 'true' " SourceFiles="$(NewVersionSourceFile)" DestinationFiles="$(VersionSourceFile)" /> <ItemGroup> <!-- prepend the source file so we don't break F# console apps that have a "special" last source file --> <_CompileWithVersionFile Include="$(VersionSourceFile);@(Compile)" /> <Compile Remove="@(Compile)" /> <Compile Include="@(_CompileWithVersionFile)" /> <_CompileWithVersionFile Remove="@(_CompileWithVersionFile)" /> </ItemGroup> </Target> <Target Name="GenerateNativeVersionInfo" DependsOnTargets="GetBuildVersion" Condition=" '$(Language)'=='C++' and '$(GenerateAssemblyVersionInfo)' != 'false' "> <PropertyGroup> <VersionSourceFile>$(IntermediateOutputPath)\$(AssemblyName).Version.rc</VersionSourceFile> <NewVersionSourceFile>$(VersionSourceFile).new</NewVersionSourceFile> </PropertyGroup> <MakeDir Directories="$(IntermediatePath)"/> <Nerdbank.GitVersioning.Tasks.NativeVersionInfo OutputFile="$(NewVersionSourceFile)" CodeLanguage="$(Language)" ConfigurationType="$(ConfigurationType)" AssemblyName="$(AssemblyName)" AssemblyVersion="$(AssemblyVersion)" AssemblyFileVersion="$(AssemblyFileVersion)" AssemblyInformationalVersion="$(AssemblyInformationalVersion)" AssemblyTitle="$(AssemblyTitle)" AssemblyProduct="$(AssemblyProduct)" AssemblyCopyright="$(AssemblyCopyright)" AssemblyCompany="$(AssemblyCompany)" AssemblyLanguage="$(AssemblyLanguage)" AssemblyCodepage="$(AssemblyCodepage)" TargetFileName="$(TargetFileName)" /> <!-- Avoid applying the newly generated Version.rc file to the build unless it has changed in order to allow for incremental building. --> <Nerdbank.GitVersioning.Tasks.CompareFiles OriginalItems="$(VersionSourceFile)" NewItems="$(NewVersionSourceFile)"> <Output TaskParameter="AreChanged" PropertyName="_NativeVersionInfoChanged" /> </Nerdbank.GitVersioning.Tasks.CompareFiles> <Copy Condition=" '$(_NativeVersionInfoChanged)' == 'true' " SourceFiles="$(NewVersionSourceFile)" DestinationFiles="$(VersionSourceFile)" /> <ItemGroup> <ResourceCompile Include="$(VersionSourceFile)" /> </ItemGroup> </Target> <!-- Support for pattern found in users of Tvl.NuGet.BuildTasks. --> <Target Name="SupplyNuGetManifestVersion" DependsOnTargets="GetBuildVersion" BeforeTargets="EnsureNuGetManifestMetadata"> <ItemGroup> <NuGetManifest> <Version>$(NuGetPackageVersion)</Version> </NuGetManifest> </ItemGroup> </Target> <!-- Support for NuProj projects. --> <Target Name="GetNuPkgVersion" Condition=" '$(MSBuildProjectExtension)' == '.nuproj' " DependsOnTargets="GetBuildVersion" Returns="$(NuGetPackageVersion)"> <PropertyGroup> <Version>$(NuGetPackageVersion)</Version> <NuSpecProperties>$(NuSpecProperties);$(NuGetProperties);GitCommitIdShort=$(GitCommitIdShort)</NuSpecProperties> </PropertyGroup> </Target> <!-- Support for ASP.NET Core 2.1 Razor view assemblies --> <Target Name="AddVersionFile" Condition="'@(RazorGenerate->Count())' != '0'" BeforeTargets="PrepareForRazorCompile" DependsOnTargets="GenerateAssemblyVersionInfo"> <ItemGroup> <RazorCompile Include="$(VersionSourceFile)" /> </ItemGroup> </Target> <!-- Workaround till https://github.com/NuGet/NuGet.Client/issues/1064 is merged and used. --> <Target Name="_NBGV_CalculateNuSpecVersionHelper" BeforeTargets="GenerateNuspec" DependsOnTargets="GetBuildVersion" /> </Project>
{ "pile_set_name": "Github" }
# # Copyright 2020 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package centreon::common::polycom::endpoint::snmp::mode::components::resources; use strict; use warnings; use Exporter; our $map_status; our @ISA = qw(Exporter); our @EXPORT_OK = qw($map_status); $map_status = { 1 => 'disabled', 2 => 'ok', 3 => 'failed', }; 1;
{ "pile_set_name": "Github" }
package metrics import ( "encoding/json" "io" "time" ) // MarshalJSON returns a byte slice containing a JSON representation of all // the metrics in the Registry. func (r *StandardRegistry) MarshalJSON() ([]byte, error) { return json.Marshal(r.GetAll()) } // WriteJSON writes metrics from the given registry periodically to the // specified io.Writer as JSON. func WriteJSON(r Registry, d time.Duration, w io.Writer) { for _ = range time.Tick(d) { WriteJSONOnce(r, w) } } // WriteJSONOnce writes metrics from the given registry to the specified // io.Writer as JSON. func WriteJSONOnce(r Registry, w io.Writer) { json.NewEncoder(w).Encode(r) } func (p *PrefixedRegistry) MarshalJSON() ([]byte, error) { return json.Marshal(p.GetAll()) }
{ "pile_set_name": "Github" }
package os package object watch{ /** * Efficiently watches the given `roots` folders for changes. Any time the * filesystem is modified within those folders, the `onEvent` callback is * called with the paths to the changed files or folders. * * Once the call to `watch` returns, `onEvent` is guaranteed to receive a * an event containing the path for: * * - Every file or folder that gets created, deleted, updated or moved * within the watched folders * * - For copied or moved folders, the path of the new folder as well as * every file or folder within it. * * * - For deleted or moved folders, the root folder which was deleted/moved, * but *without* the paths of every file that was within it at the * original location * * Note that `watch` does not provide any additional information about the * changes happening within the watched roots folder, apart from the path * at which the change happened. It is up to the `onEvent` handler to query * the filesystem and figure out what happened, and what it wants to do. * * `watch` currently only supports Linux and Mac-OSX, and not Windows. */ def watch(roots: Seq[os.Path], onEvent: Set[os.Path] => Unit, logger: (String, Any) => Unit = (_, _) => ()): AutoCloseable = { val watcher = System.getProperty("os.name") match{ case "Linux" => new os.watch.WatchServiceWatcher(roots, onEvent, logger) case "Mac OS X" => new os.watch.FSEventsWatcher(roots, onEvent, logger, 0.05) case osName => throw new Exception(s"watch not supported on operating system: $osName") } val thread = new Thread(() => watcher.run()) thread.setDaemon(true) thread.start() watcher } }
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.spark.api.r import org.apache.spark.SparkFunSuite class RBackendSuite extends SparkFunSuite { test("close() clears jvmObjectTracker") { val backend = new RBackend val tracker = backend.jvmObjectTracker val id = tracker.addAndGetId(new Object) backend.close() assert(tracker.get(id) === None) assert(tracker.size === 0) } }
{ "pile_set_name": "Github" }
// // HeapTest.swift // LeetcodeSwift // // Created by yansong li on 2016-11-09. // Copyright © 2016 YANSONG LI. All rights reserved. // import XCTest @testable import LeetcodeSwift class HeapTest: XCTestCase { override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the invocation of each test method in the class. super.tearDown() } func testPeak() { var testMaxHeap = Heap<Int>(sort: >) testMaxHeap.insert(10) testMaxHeap.insert(1) testMaxHeap.insert(100) XCTAssert(testMaxHeap.peak()! == 100) } func testRemove() { var testMaxHeap = Heap<Int>(sort: >) testMaxHeap.insert(10) testMaxHeap.insert(1) testMaxHeap.insert(100) XCTAssert(testMaxHeap.remove()! == 100) XCTAssert(testMaxHeap.remove()! == 10) XCTAssert(testMaxHeap.remove()! == 1) XCTAssert(testMaxHeap.remove() == nil) } func testHeapCheck() { let testMaxHeapArray = [10, 7, 2, 5, 1] XCTAssert(Heap.arrayIsMaxHeap(testMaxHeapArray)) let testNonMaxHeapArray = [1, 2, 3, 4, 5] XCTAssert(!Heap.arrayIsMaxHeap(testNonMaxHeapArray)) } func testPerformanceExample() { // This is an example of a performance test case. self.measure { // Put the code you want to measure the time of here. } } }
{ "pile_set_name": "Github" }
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "DVTLayoutView_ML.h" #import "DVTInvalidation-Protocol.h" @class DVTStackBacktrace, DVTTableView, Xcode3TargetMembershipInspector; @interface Xcode3TargetMembershipInspectorContentView : DVTLayoutView_ML <DVTInvalidation> { Xcode3TargetMembershipInspector *_inspector; DVTTableView *_targetMembershipsTableView; } + (void)initialize; - (void).cxx_destruct; - (void)setShowRoleColumn:(BOOL)arg1; - (void)layoutBottomUp; - (void)primitiveInvalidate; - (void)awakeFromNib; // Remaining properties @property(retain) DVTStackBacktrace *creationBacktrace; @property(readonly) DVTStackBacktrace *invalidationBacktrace; @property(readonly, nonatomic, getter=isValid) BOOL valid; @end
{ "pile_set_name": "Github" }
// // Box.swift // BentoMap // // Created by Michael Skiba on 2/17/16. // Copyright © 2016 Raizlabs. All rights reserved. // import Foundation /// A workaround because Swift structs do not /// allow recursive value types class Box<T> { var value: T init(value: T) { self.value = value } }
{ "pile_set_name": "Github" }
# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_INIT([minizip], [1.2.7], [bugzilla.redhat.com]) AC_CONFIG_SRCDIR([minizip.c]) AM_INIT_AUTOMAKE([foreign]) LT_INIT AC_MSG_CHECKING([whether to build example programs]) AC_ARG_ENABLE([demos], AC_HELP_STRING([--enable-demos], [build example programs])) AM_CONDITIONAL([COND_DEMOS], [test "$enable_demos" = yes]) if test "$enable_demos" = yes then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi case "${host}" in *-mingw* | mingw*) WIN32="yes" ;; *) ;; esac AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) AC_SUBST([HAVE_UNISTD_H], [0]) AC_CHECK_HEADER([unistd.h], [HAVE_UNISTD_H=1], []) AC_CONFIG_FILES([Makefile minizip.pc]) AC_OUTPUT
{ "pile_set_name": "Github" }
package us.nineworlds.serenity.emby.moshi import com.squareup.moshi.JsonAdapter import com.squareup.moshi.JsonReader import com.squareup.moshi.JsonWriter import org.joda.time.LocalDateTime import org.joda.time.format.DateTimeFormat class LocalDateJsonAdapter : JsonAdapter<LocalDateTime>() { override fun fromJson(reader: JsonReader?): LocalDateTime? { val dateTime = reader?.nextString()!!.replaceAfter(".", "") val dateformater = DateTimeFormat.forPattern("yyyy-MM-dd'T'HH':'mm':'ss'.'") // DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSS'Z'") // } else if(dateTime!!.contains("+")) { // } else { // DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSZ") // } return LocalDateTime.parse(dateTime, dateformater) } override fun toJson(writer: JsonWriter?, value: LocalDateTime?) { writer?.value(value?.toString()) } }
{ "pile_set_name": "Github" }
security: access_control: - { path: ^/admin/reset, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/admin/security/reset, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/admin/login, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: ^/admin, roles: ROLE_USER } firewalls: test: pattern: ^/ anonymous: ~ entry_point: sulu_security.authentication_entry_point form_login: check_path: sulu_admin.login_check success_handler: sulu_security.authentication_handler failure_handler: sulu_security.authentication_handler csrf_token_generator: security.csrf.token_manager logout: path: /admin/logout target: /admin/ twig: debug: "%kernel.debug%" strict_variables: "%kernel.debug%" sulu_route: mappings: AppBundle\Entity\Test: resource_key: tests generator: schema options: route_schema: "/prefix/{object['year']}/{object['title']}"
{ "pile_set_name": "Github" }
-----BEGIN CERTIFICATE----- MIID7jCCA1egAwIBAgIBADANBgkqhkiG9w0BAQQFADCBsTELMAkGA1UEBhMCREUx DDAKBgNVBAgTA05SVzETMBEGA1UEBxQKRPxzc2VsZG9yZjEWMBQGA1UEChMNZzEw IENvZGUgR21iSDEbMBkGA1UECxMSS2VyY2tob2ZmcyBUZXN0bGFiMRYwFAYDVQQD Ew1QZXRlciBQYW50aGVyMTIwMAYJKoZIhvcNAQkBFiNwZXRlci5wYW50aGVyQGtl cmNraG9mZnMuZzEwY29kZS5kZTAeFw0wMjA0MTIxNjU4MzFaFw0wMzA0MTIxNjU4 MzFaMIGxMQswCQYDVQQGEwJERTEMMAoGA1UECBMDTlJXMRMwEQYDVQQHFApE/HNz ZWxkb3JmMRYwFAYDVQQKEw1nMTAgQ29kZSBHbWJIMRswGQYDVQQLExJLZXJja2hv ZmZzIFRlc3RsYWIxFjAUBgNVBAMTDVBldGVyIFBhbnRoZXIxMjAwBgkqhkiG9w0B CQEWI3BldGVyLnBhbnRoZXJAa2VyY2tob2Zmcy5nMTBjb2RlLmRlMIGfMA0GCSqG SIb3DQEBAQUAA4GNADCBiQKBgQC/UYKEu+IZgvoUwbBaKT96SDsgnsOLkC7TWuP+ td9qyjF+tQCSUdTqRDYyP44hLH24v4h9KsVxwl5iuncJCdNmpTHL4ika+3v7arGU DmGEHZOC3mHMzD+/dfqotse7C37AEMWSXguh4x2vmSESG9wnAxCgLl78j+RIuKUE RVK55wIDAQABo4IBEjCCAQ4wHQYDVR0OBBYEFDhJ93SfqHOecsryvYN01++o7qh/ MIHeBgNVHSMEgdYwgdOAFDhJ93SfqHOecsryvYN01++o7qh/oYG3pIG0MIGxMQsw CQYDVQQGEwJERTEMMAoGA1UECBMDTlJXMRMwEQYDVQQHFApE/HNzZWxkb3JmMRYw FAYDVQQKEw1nMTAgQ29kZSBHbWJIMRswGQYDVQQLExJLZXJja2hvZmZzIFRlc3Rs YWIxFjAUBgNVBAMTDVBldGVyIFBhbnRoZXIxMjAwBgkqhkiG9w0BCQEWI3BldGVy LnBhbnRoZXJAa2VyY2tob2Zmcy5nMTBjb2RlLmRlggEAMAwGA1UdEwQFMAMBAf8w DQYJKoZIhvcNAQEEBQADgYEADoBAUnaZIjp+T60s1at/tLa03TfYT8DdTQz+p/UF MFGPz9CTqsoN7NLFoXyq+RN9FipsGEKLMif7e/buRqlcir+ntxqQFdy6EYfxfu4n Dys8JxnhjcEqXSz+uPUE8jiGho5Tkveo+hurDKZ54CVTeJtvKrWpA6YkuhmL/zRz T7Y= -----END CERTIFICATE-----
{ "pile_set_name": "Github" }
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #include "olap/rowset/segment_v2/indexed_column_reader.h" #include "gutil/strings/substitute.h" // for Substitute #include "olap/key_coder.h" #include "olap/rowset/segment_v2/encoding_info.h" // for EncodingInfo #include "olap/rowset/segment_v2/page_io.h" namespace doris { namespace segment_v2 { using strings::Substitute; Status IndexedColumnReader::load(bool use_page_cache, bool kept_in_memory) { _use_page_cache = use_page_cache; _kept_in_memory = kept_in_memory; _type_info = get_type_info((FieldType)_meta.data_type()); if (_type_info == nullptr) { return Status::NotSupported(Substitute("unsupported typeinfo, type=$0", _meta.data_type())); } RETURN_IF_ERROR(EncodingInfo::get(_type_info, _meta.encoding(), &_encoding_info)); RETURN_IF_ERROR(get_block_compression_codec(_meta.compression(), &_compress_codec)); _validx_key_coder = get_key_coder(_type_info->type()); std::unique_ptr<fs::ReadableBlock> rblock; fs::BlockManager* block_mgr = fs::fs_util::block_manager(); RETURN_IF_ERROR(block_mgr->open_block(_file_name, &rblock)); // read and parse ordinal index page when exists if (_meta.has_ordinal_index_meta()) { if (_meta.ordinal_index_meta().is_root_data_page()) { _sole_data_page = PagePointer(_meta.ordinal_index_meta().root_page()); } else { RETURN_IF_ERROR(load_index_page(rblock.get(), _meta.ordinal_index_meta().root_page(), &_ordinal_index_page_handle, &_ordinal_index_reader)); _has_index_page = true; } } // read and parse value index page when exists if (_meta.has_value_index_meta()) { if (_meta.value_index_meta().is_root_data_page()) { _sole_data_page = PagePointer(_meta.value_index_meta().root_page()); } else { RETURN_IF_ERROR(load_index_page(rblock.get(), _meta.value_index_meta().root_page(), &_value_index_page_handle, &_value_index_reader)); _has_index_page = true; } } _num_values = _meta.num_values(); return Status::OK(); } Status IndexedColumnReader::load_index_page(fs::ReadableBlock* rblock, const PagePointerPB& pp, PageHandle* handle, IndexPageReader* reader) { Slice body; PageFooterPB footer; RETURN_IF_ERROR(read_page(rblock, PagePointer(pp), handle, &body, &footer)); RETURN_IF_ERROR(reader->parse(body, footer.index_page_footer())); return Status::OK(); } Status IndexedColumnReader::read_page(fs::ReadableBlock* rblock, const PagePointer& pp, PageHandle* handle, Slice* body, PageFooterPB* footer) const { PageReadOptions opts; opts.rblock = rblock; opts.page_pointer = pp; opts.codec = _compress_codec; OlapReaderStatistics tmp_stats; opts.stats = &tmp_stats; opts.use_page_cache = _use_page_cache; opts.kept_in_memory = _kept_in_memory; return PageIO::read_and_decompress_page(opts, handle, body, footer); } /////////////////////////////////////////////////////////////////////////////// Status IndexedColumnIterator::_read_data_page(const PagePointer& pp) { PageHandle handle; Slice body; PageFooterPB footer; RETURN_IF_ERROR(_reader->read_page(_rblock.get(), pp, &handle, &body, &footer)); // parse data page // note that page_index is not used in IndexedColumnIterator, so we pass 0 return ParsedPage::create(std::move(handle), body, footer.data_page_footer(), _reader->encoding_info(), pp, 0, &_data_page); } Status IndexedColumnIterator::seek_to_ordinal(ordinal_t idx) { DCHECK(idx >= 0 && idx <= _reader->num_values()); if (!_reader->support_ordinal_seek()) { return Status::NotSupported("no ordinal index"); } // it's ok to seek past the last value if (idx == _reader->num_values()) { _current_ordinal = idx; _seeked = true; return Status::OK(); } if (_data_page == nullptr || !_data_page->contains(idx)) { // need to read the data page containing row at idx if (_reader->_has_index_page) { std::string key; KeyCoderTraits<OLAP_FIELD_TYPE_UNSIGNED_BIGINT>::full_encode_ascending(&idx, &key); RETURN_IF_ERROR(_ordinal_iter.seek_at_or_before(key)); RETURN_IF_ERROR(_read_data_page(_ordinal_iter.current_page_pointer())); _current_iter = &_ordinal_iter; } else { RETURN_IF_ERROR(_read_data_page(_reader->_sole_data_page)); } } ordinal_t offset_in_page = idx - _data_page->first_ordinal; RETURN_IF_ERROR(_data_page->data_decoder->seek_to_position_in_page(offset_in_page)); DCHECK(offset_in_page == _data_page->data_decoder->current_index()); _data_page->offset_in_page = offset_in_page; _current_ordinal = idx; _seeked = true; return Status::OK(); } Status IndexedColumnIterator::seek_at_or_after(const void* key, bool* exact_match) { if (!_reader->support_value_seek()) { return Status::NotSupported("no value index"); } if (_reader->num_values() == 0) { return Status::NotFound("value index is empty "); } bool load_data_page = false; PagePointer data_page_pp; if (_reader->_has_index_page) { // seek index to determine the data page to seek std::string encoded_key; _reader->_validx_key_coder->full_encode_ascending(key, &encoded_key); RETURN_IF_ERROR(_value_iter.seek_at_or_before(encoded_key)); data_page_pp = _value_iter.current_page_pointer(); _current_iter = &_value_iter; if (_data_page == nullptr || _data_page->page_pointer != data_page_pp) { // load when it's not the same with the current load_data_page = true; } } else if (!_data_page) { // no index page, load data page for the first time load_data_page = true; data_page_pp = PagePointer(_reader->_sole_data_page); } if (load_data_page) { RETURN_IF_ERROR(_read_data_page(data_page_pp)); } // seek inside data page RETURN_IF_ERROR(_data_page->data_decoder->seek_at_or_after_value(key, exact_match)); _data_page->offset_in_page = _data_page->data_decoder->current_index(); _current_ordinal = _data_page->first_ordinal + _data_page->offset_in_page; DCHECK(_data_page->contains(_current_ordinal)); _seeked = true; return Status::OK(); } Status IndexedColumnIterator::next_batch(size_t* n, ColumnBlockView* column_view) { DCHECK(_seeked); if (_current_ordinal == _reader->num_values()) { *n = 0; return Status::OK(); } size_t remaining = *n; while (remaining > 0) { if (!_data_page->has_remaining()) { // trying to read next data page if (!_reader->_has_index_page) { break; // no more data page } bool has_next = _current_iter->move_next(); if (!has_next) { break; // no more data page } RETURN_IF_ERROR(_read_data_page(_current_iter->current_page_pointer())); } size_t rows_to_read = std::min(_data_page->remaining(), remaining); size_t rows_read = rows_to_read; RETURN_IF_ERROR(_data_page->data_decoder->next_batch(&rows_read, column_view)); DCHECK(rows_to_read == rows_read); _data_page->offset_in_page += rows_read; _current_ordinal += rows_read; column_view->advance(rows_read); remaining -= rows_read; } *n -= remaining; _seeked = false; return Status::OK(); } } // namespace segment_v2 } // namespace doris
{ "pile_set_name": "Github" }
/* * Copyright 2002-2018 the original author or 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.web.reactive.result.view.freemarker; import java.io.IOException; import java.util.List; import freemarker.cache.ClassTemplateLoader; import freemarker.cache.TemplateLoader; import freemarker.template.Configuration; import freemarker.template.TemplateException; import org.springframework.beans.factory.InitializingBean; import org.springframework.context.ResourceLoaderAware; import org.springframework.lang.Nullable; import org.springframework.ui.freemarker.FreeMarkerConfigurationFactory; import org.springframework.util.Assert; /** * Configures FreeMarker for web usage via the "configLocation" and/or * "freemarkerSettings" and/or "templateLoaderPath" properties. * The simplest way to use this class is to specify just a "templateLoaderPath" * (e.g. "classpath:templates"); you do not need any further configuration then. * * <p>This bean must be included in the application context of any application * using {@link FreeMarkerView}. It exists purely to configure FreeMarker. * It is not meant to be referenced by application components but just internally * by {@code FreeMarkerView}. Implements {@link FreeMarkerConfig} to be found by * {@code FreeMarkerView} without depending on the bean name the configurer. * * <p>Note that you can also refer to a pre-configured FreeMarker Configuration * instance via the "configuration" property. This allows to share a FreeMarker * Configuration for web and email usage for example. * * <p>TODO: macros * * <p>This configurer registers a template loader for this package, allowing to * reference the "spring.ftl" macro library contained in this package: * * <pre class="code"> * &lt;#import "/spring.ftl" as spring/&gt; * &lt;@spring.bind "person.age"/&gt; * age is ${spring.status.value}</pre> * * Note: Spring's FreeMarker support requires FreeMarker 2.3 or higher. * * @author Rossen Stoyanchev * @since 5.0 */ public class FreeMarkerConfigurer extends FreeMarkerConfigurationFactory implements FreeMarkerConfig, InitializingBean, ResourceLoaderAware { @Nullable private Configuration configuration; public FreeMarkerConfigurer() { setDefaultEncoding("UTF-8"); } /** * Set a pre-configured Configuration to use for the FreeMarker web config, * e.g. a shared one for web and email usage. If this is not set, * FreeMarkerConfigurationFactory's properties (inherited by this class) * have to be specified. */ public void setConfiguration(Configuration configuration) { this.configuration = configuration; } /** * Initialize FreeMarkerConfigurationFactory's Configuration * if not overridden by a pre-configured FreeMarker Configuration. * <p>Sets up a ClassTemplateLoader to use for loading Spring macros. * @see #createConfiguration * @see #setConfiguration */ @Override public void afterPropertiesSet() throws IOException, TemplateException { if (this.configuration == null) { this.configuration = createConfiguration(); } } /** * This implementation registers an additional ClassTemplateLoader * for the Spring-provided macros, added to the end of the list. */ @Override protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders) { templateLoaders.add(new ClassTemplateLoader(FreeMarkerConfigurer.class, "")); } /** * Return the Configuration object wrapped by this bean. */ @Override public Configuration getConfiguration() { Assert.state(this.configuration != null, "No Configuration available"); return this.configuration; } }
{ "pile_set_name": "Github" }
base class MyBase class Child2(value: String) extends MyBase class Child1<T>(value: T) extends MyBase fun apply<T>(f: T -> T, a: T): T { f(a) } fun main(): void { f = x -> { if (true) return Child1(x); x }; y: Child2 = apply(f, Child2("FAIL")); print_raw( y.value, // boom, it's actually a Child1 now ) }
{ "pile_set_name": "Github" }
#region license /* * [Scientific Committee on Advanced Navigation] * S.C.A.N. Satellite * * SCAN_Style - Script for applying UI style elements * * Copyright (c)2014 David Grandy <[email protected]>; * Copyright (c)2014 technogeeky <[email protected]>; * Copyright (c)2014 (Your Name Here) <your email here>; see LICENSE.txt for licensing details. */ #endregion using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; namespace SCANsat.Unity.Unity { public class SCAN_Style : MonoBehaviour { public enum StyleTypes { None, Window, Box, HiddenBox, Button, HiddenButton, ToggleButton, Toggle, HorizontalSlider, TextInput, KSPToggle, VerticalScrollbar, KSPWindow, AppButton, Tooltip, VerticalSlider, Popup, } [SerializeField] private StyleTypes m_StyleType = StyleTypes.None; public StyleTypes StlyeType { get { return m_StyleType; } } private void setSelectable(Sprite normal, Sprite highlight, Sprite active, Sprite inactive) { Selectable select = GetComponent<Selectable>(); if (select == null) return; select.image.sprite = normal; select.image.type = Image.Type.Sliced; select.transition = Selectable.Transition.SpriteSwap; SpriteState spriteState = select.spriteState; spriteState.highlightedSprite = highlight; spriteState.pressedSprite = active; spriteState.disabledSprite = inactive; select.spriteState = spriteState; } public void setImage(Sprite sprite) { Image image = GetComponent<Image>(); if (image == null) return; image.sprite = sprite; } public void setButton(Sprite normal, Sprite highlight, Sprite active, Sprite inactive) { setSelectable(normal, highlight, active, inactive); } public void setToggle(Sprite normal, Sprite highlight, Sprite active, Sprite inactive, Sprite checkmark, Sprite checkmarkHover) { setSelectable(normal, highlight, active, inactive); Toggle toggle = GetComponent<Toggle>(); if (toggle == null) return; Image toggleImage = toggle.graphic as Image; if (toggleImage == null) return; toggleImage.sprite = checkmark; toggleImage.type = Image.Type.Sliced; SCAN_Toggle scan_toggle = GetComponent<SCAN_Toggle>(); if (scan_toggle != null) scan_toggle.HoverCheckmark = checkmarkHover; } public void setToggleButton(Sprite normal, Sprite highlight, Sprite active, Sprite inactive, Sprite checkmark) { setSelectable(normal, highlight, active, inactive); Toggle toggle = GetComponent<Toggle>(); if (toggle == null) return; Image toggleImage = toggle.graphic as Image; if (toggleImage == null) return; toggleImage.sprite = checkmark; toggleImage.type = Image.Type.Sliced; } public void setSlider(Sprite background, Sprite thumb, Sprite thumbHighlight, Sprite thumbActive, Sprite thumbInactive) { setSelectable(thumb, thumbHighlight, thumbActive, thumbInactive); if (background == null) return; Slider slider = GetComponent<Slider>(); if (slider == null) return; Image back = slider.GetComponentInChildren<Image>(); if (back == null) return; back.sprite = background; back.type = Image.Type.Sliced; } public void setScrollbar(Sprite background, Sprite thumb) { Image back = GetComponent<Image>(); if (back == null) return; back.sprite = background; Scrollbar scroll = GetComponent<Scrollbar>(); if (scroll == null) return; if (scroll.targetGraphic == null) return; Image scrollThumb = scroll.targetGraphic.GetComponent<Image>(); if (scrollThumb == null) return; scrollThumb.sprite = thumb; } } }
{ "pile_set_name": "Github" }
package client // import "github.com/docker/docker/client" import ( "context" "net/url" "github.com/docker/docker/api/types" ) // PluginRemove removes a plugin func (cli *Client) PluginRemove(ctx context.Context, name string, options types.PluginRemoveOptions) error { query := url.Values{} if options.Force { query.Set("force", "1") } resp, err := cli.delete(ctx, "/plugins/"+name, query, nil) ensureReaderClosed(resp) return wrapResponseError(err, resp, "plugin", name) }
{ "pile_set_name": "Github" }
package conf var ( LenStackBuf = 4096 // log LogLevel string LogPath string LogFlag int // console ConsolePort int ConsolePrompt string = "LollipopGo# " ProfilePath string // cluster ListenAddr string ConnAddrs []string PendingWriteNum int )
{ "pile_set_name": "Github" }
# SPDX-License-Identifier: GPL-2.0 # # Makefile for the linux reiser-filesystem routines. # obj-$(CONFIG_REISERFS_FS) += reiserfs.o reiserfs-objs := bitmap.o do_balan.o namei.o inode.o file.o dir.o fix_node.o \ super.o prints.o objectid.o lbalance.o ibalance.o stree.o \ hashes.o tail_conversion.o journal.o resize.o \ item_ops.o ioctl.o xattr.o lock.o ifeq ($(CONFIG_REISERFS_PROC_INFO),y) reiserfs-objs += procfs.o endif ifeq ($(CONFIG_REISERFS_FS_XATTR),y) reiserfs-objs += xattr_user.o xattr_trusted.o endif ifeq ($(CONFIG_REISERFS_FS_SECURITY),y) reiserfs-objs += xattr_security.o endif ifeq ($(CONFIG_REISERFS_FS_POSIX_ACL),y) reiserfs-objs += xattr_acl.o endif TAGS: etags *.c
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> <html> <head> </head> <frameset framespacing="0" cols="250,*" frameborder="0" noresize> <frame name="nav" src="navigation.html" target="top"> <frame name="main" src="height-width.html" target="main"> </frameset> </html>
{ "pile_set_name": "Github" }
package getter import ( "crypto/md5" "encoding/hex" "fmt" "os" "path/filepath" ) // FolderStorage is an implementation of the Storage interface that manages // modules on the disk. type FolderStorage struct { // StorageDir is the directory where the modules will be stored. StorageDir string } // Dir implements Storage.Dir func (s *FolderStorage) Dir(key string) (d string, e bool, err error) { d = s.dir(key) _, err = os.Stat(d) if err == nil { // Directory exists e = true return } if os.IsNotExist(err) { // Directory doesn't exist d = "" e = false err = nil return } // An error d = "" e = false return } // Get implements Storage.Get func (s *FolderStorage) Get(key string, source string, update bool) error { dir := s.dir(key) if !update { if _, err := os.Stat(dir); err == nil { // If the directory already exists, then we're done since // we're not updating. return nil } else if !os.IsNotExist(err) { // If the error we got wasn't a file-not-exist error, then // something went wrong and we should report it. return fmt.Errorf("Error reading module directory: %s", err) } } // Get the source. This always forces an update. return Get(dir, source) } // dir returns the directory name internally that we'll use to map to // internally. func (s *FolderStorage) dir(key string) string { sum := md5.Sum([]byte(key)) return filepath.Join(s.StorageDir, hex.EncodeToString(sum[:])) }
{ "pile_set_name": "Github" }
#ifndef __UIPROGRESS_H__ #define __UIPROGRESS_H__ #pragma once namespace DuiLib { class UILIB_API CProgressUI : public CLabelUI { public: CProgressUI(); LPCTSTR GetClass() const; LPVOID GetInterface(LPCTSTR pstrName); bool IsHorizontal(); void SetHorizontal(bool bHorizontal = true); bool IsStretchForeImage(); void SetStretchForeImage(bool bStretchForeImage = true); int GetMinValue() const; void SetMinValue(int nMin); int GetMaxValue() const; void SetMaxValue(int nMax); int GetValue() const; void SetValue(int nValue); LPCTSTR GetForeImage() const; void SetForeImage(LPCTSTR pStrImage); void SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue); void PaintStatusImage(HDC hDC); protected: bool m_bHorizontal; bool m_bStretchForeImage; int m_nMax; int m_nMin; int m_nValue; CDuiString m_sForeImage; CDuiString m_sForeImageModify; }; } // namespace DuiLib #endif // __UIPROGRESS_H__
{ "pile_set_name": "Github" }
/** * The database install script changed to support installation on cluster * servers. No significant changes need to be rolled for continuous updaters * * @version v1.7.1 * @signature 32de1766d56e43215041fa982dcb465e */ ALTER TABLE `%TABLE_PREFIX%session` CHANGE `session_id` `session_id` VARCHAR(255) collate ascii_general_ci, CHANGE `session_data` `session_data` BLOB; -- update schema signature UPDATE `%TABLE_PREFIX%config` SET `schema_signature`='32de1766d56e43215041fa982dcb465e';
{ "pile_set_name": "Github" }
// // Project home: https://github.com/jaxio/celerio-angular-quickstart // // Source code generated by Celerio, an Open Source code generator by Jaxio. // Documentation: http://www.jaxio.com/documentation/celerio/ // Source code: https://github.com/jaxio/celerio/ // Follow us on twitter: @jaxiosoft // This header can be customized in Celerio conf... // Template pack-angular:web/src/app/entities/entity-list.component.ts.e.vm // import { Component, Input, Output, OnChanges, EventEmitter, SimpleChanges} from '@angular/core'; import { Router } from '@angular/router'; import { DataTable, LazyLoadEvent } from 'primeng/primeng'; import { PageResponse } from "../../support/paging"; import { MessageService } from '../../service/message.service'; import { MatDialog } from '@angular/material'; import { ConfirmDeleteDialogComponent } from "../../support/confirm-delete-dialog.component"; import { Passport } from './passport'; import { PassportDetailComponent } from './passport-detail.component'; import { PassportService } from './passport.service'; import { User } from '../user/user'; import { UserLineComponent } from '../user/user-line.component'; @Component({ moduleId: module.id, templateUrl: 'passport-list.component.html', selector: 'passport-list' }) export class PassportListComponent { @Input() header = "Passports..."; // When 'sub' is true, it means this list is used as a one-to-many list. // It belongs to a parent entity, as a result the addNew operation // must prefill the parent entity. The prefill is not done here, instead we // emit an event. // When 'sub' is false, we display basic search criterias @Input() sub : boolean; @Output() onAddNewClicked = new EventEmitter(); passportToDelete : Passport; // basic search criterias (visible if not in 'sub' mode) example : Passport = new Passport(); // list is paginated currentPage : PageResponse<Passport> = new PageResponse<Passport>(0,0,[]); // X to one: input param is used to filter the list when displayed // as a one-to-many list by the other side. private _holder : User; constructor(private router : Router, private passportService : PassportService, private messageService : MessageService, private confirmDeleteDialog: MatDialog) { } /** * When used as a 'sub' component (to display one-to-many list), refreshes the table * content when the input changes. */ ngOnChanges(changes: SimpleChanges) { this.loadPage({ first: 0, rows: 10, sortField: null, sortOrder: null, filters: null, multiSortMeta: null }); } /** * Invoked when user presses the search button. */ search(dt : DataTable) { if (!this.sub) { dt.reset(); this.loadPage({ first: 0, rows: dt.rows, sortField: dt.sortField, sortOrder: dt.sortOrder, filters: null, multiSortMeta: dt.multiSortMeta }); } } /** * Invoked automatically by primeng datatable. */ loadPage(event : LazyLoadEvent) { this.passportService.getPage(this.example, event). subscribe( pageResponse => this.currentPage = pageResponse, error => this.messageService.error('Could not get the results', error) ); } // X to one: input param is used to filter the list when displayed // as a one-to-many list by the other side. @Input() set holder(holder : User) { if (holder == null) { return; } this._holder = holder; this.example = new Passport(); this.example.holder = new User(); this.example.holder.id = this._holder.id; } onRowSelect(event : any) { let id = event.data.id; this.router.navigate(['/passport', id]); } addNew() { if (this.sub) { this.onAddNewClicked.emit("addNew"); } else { this.router.navigate(['/passport', 'new']); } } showDeleteDialog(rowData : any) { let passportToDelete : Passport = <Passport> rowData; let dialogRef = this.confirmDeleteDialog.open(ConfirmDeleteDialogComponent); dialogRef.afterClosed().subscribe(result => { if (result === 'delete') { this.delete(passportToDelete); } }); } private delete(passportToDelete : Passport) { let id = passportToDelete.id; this.passportService.delete(id). subscribe( response => { this.currentPage.remove(passportToDelete); this.messageService.info('Deleted OK', 'Angular Rocks!'); }, error => this.messageService.error('Could not delete!', error) ); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS"> <dependencies> <deployment identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--Application--> <scene sceneID="JPo-4y-FX3"> <objects> <application id="hnw-xV-0zn" sceneMemberID="viewController"> <menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6"> <items> <menuItem title="KPCTabsControlDemo" id="1Xt-HY-uBw"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="KPCTabsControlDemo" systemMenu="apple" id="uQy-DD-JDr"> <items> <menuItem title="About KPCTabsControlDemo" id="5kV-Vb-QxS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/> <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/> <menuItem title="Services" id="NMo-om-nkz"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/> </menuItem> <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/> <menuItem title="Hide KPCTabsControlDemo" keyEquivalent="h" id="Olw-nP-bQN"> <connections> <action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/> </connections> </menuItem> <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/> </connections> </menuItem> <menuItem title="Show All" id="Kd2-mp-pUS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/> <menuItem title="Quit KPCTabsControlDemo" keyEquivalent="q" id="4sb-4s-VLi"> <connections> <action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="File" id="dMs-cI-mzQ"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="File" id="bib-Uj-vzu"> <items> <menuItem title="New" keyEquivalent="n" id="Was-JA-tGl"> <connections> <action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/> </connections> </menuItem> <menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9"> <connections> <action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/> </connections> </menuItem> <menuItem title="Open Recent" id="tXI-mr-wws"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ"> <items> <menuItem title="Clear Menu" id="vNY-rz-j42"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem isSeparatorItem="YES" id="m54-Is-iLE"/> <menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG"> <connections> <action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/> </connections> </menuItem> <menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV"> <connections> <action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/> </connections> </menuItem> <menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A"> <connections> <action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/> </connections> </menuItem> <menuItem title="Revert to Saved" id="KaW-ft-85H"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="aJh-i4-bef"/> <menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK"> <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/> <connections> <action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/> </connections> </menuItem> <menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS"> <connections> <action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Edit" id="5QF-Oa-p0T"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Edit" id="W48-6f-4Dl"> <items> <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg"> <connections> <action selector="undo:" target="Ady-hI-5gd" id="M6e-cu-g7V"/> </connections> </menuItem> <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam"> <connections> <action selector="redo:" target="Ady-hI-5gd" id="oIA-Rs-6OD"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/> <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG"> <connections> <action selector="cut:" target="Ady-hI-5gd" id="YJe-68-I9s"/> </connections> </menuItem> <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU"> <connections> <action selector="copy:" target="Ady-hI-5gd" id="G1f-GL-Joy"/> </connections> </menuItem> <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL"> <connections> <action selector="paste:" target="Ady-hI-5gd" id="UvS-8e-Qdg"/> </connections> </menuItem> <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="pasteAsPlainText:" target="Ady-hI-5gd" id="cEh-KX-wJQ"/> </connections> </menuItem> <menuItem title="Delete" id="pa3-QI-u2k"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="delete:" target="Ady-hI-5gd" id="0Mk-Ml-PaM"/> </connections> </menuItem> <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m"> <connections> <action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/> <menuItem title="Find" id="4EN-yA-p0u"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Find" id="1b7-l0-nxx"> <items> <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W"> <connections> <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="cD7-Qs-BN4"/> </connections> </menuItem> <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="WD3-Gg-5AJ"/> </connections> </menuItem> <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye"> <connections> <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="NDo-RZ-v9R"/> </connections> </menuItem> <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV"> <connections> <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="HOh-sY-3ay"/> </connections> </menuItem> <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt"> <connections> <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="U76-nv-p5D"/> </connections> </menuItem> <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd"> <connections> <action selector="centerSelectionInVisibleArea:" target="Ady-hI-5gd" id="IOG-6D-g5B"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Spelling" id="3IN-sU-3Bg"> <items> <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI"> <connections> <action selector="showGuessPanel:" target="Ady-hI-5gd" id="vFj-Ks-hy3"/> </connections> </menuItem> <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7"> <connections> <action selector="checkSpelling:" target="Ady-hI-5gd" id="fz7-VC-reM"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/> <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleContinuousSpellChecking:" target="Ady-hI-5gd" id="7w6-Qz-0kB"/> </connections> </menuItem> <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleGrammarChecking:" target="Ady-hI-5gd" id="muD-Qn-j4w"/> </connections> </menuItem> <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticSpellingCorrection:" target="Ady-hI-5gd" id="2lM-Qi-WAP"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Substitutions" id="9ic-FL-obx"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Substitutions" id="FeM-D8-WVr"> <items> <menuItem title="Show Substitutions" id="z6F-FW-3nz"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="orderFrontSubstitutionsPanel:" target="Ady-hI-5gd" id="oku-mr-iSq"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/> <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleSmartInsertDelete:" target="Ady-hI-5gd" id="3IJ-Se-DZD"/> </connections> </menuItem> <menuItem title="Smart Quotes" id="hQb-2v-fYv"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticQuoteSubstitution:" target="Ady-hI-5gd" id="ptq-xd-QOA"/> </connections> </menuItem> <menuItem title="Smart Dashes" id="rgM-f4-ycn"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticDashSubstitution:" target="Ady-hI-5gd" id="oCt-pO-9gS"/> </connections> </menuItem> <menuItem title="Smart Links" id="cwL-P1-jid"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticLinkDetection:" target="Ady-hI-5gd" id="Gip-E3-Fov"/> </connections> </menuItem> <menuItem title="Data Detectors" id="tRr-pd-1PS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticDataDetection:" target="Ady-hI-5gd" id="R1I-Nq-Kbl"/> </connections> </menuItem> <menuItem title="Text Replacement" id="HFQ-gK-NFA"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticTextReplacement:" target="Ady-hI-5gd" id="DvP-Fe-Py6"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Transformations" id="2oI-Rn-ZJC"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Transformations" id="c8a-y6-VQd"> <items> <menuItem title="Make Upper Case" id="vmV-6d-7jI"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="uppercaseWord:" target="Ady-hI-5gd" id="sPh-Tk-edu"/> </connections> </menuItem> <menuItem title="Make Lower Case" id="d9M-CD-aMd"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="lowercaseWord:" target="Ady-hI-5gd" id="iUZ-b5-hil"/> </connections> </menuItem> <menuItem title="Capitalize" id="UEZ-Bs-lqG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="capitalizeWord:" target="Ady-hI-5gd" id="26H-TL-nsh"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Speech" id="xrE-MZ-jX0"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Speech" id="3rS-ZA-NoH"> <items> <menuItem title="Start Speaking" id="Ynk-f8-cLZ"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="startSpeaking:" target="Ady-hI-5gd" id="654-Ng-kyl"/> </connections> </menuItem> <menuItem title="Stop Speaking" id="Oyz-dy-DGm"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="stopSpeaking:" target="Ady-hI-5gd" id="dX8-6p-jy9"/> </connections> </menuItem> </items> </menu> </menuItem> </items> </menu> </menuItem> <menuItem title="Format" id="jxT-CU-nIS"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Format" id="GEO-Iw-cKr"> <items> <menuItem title="Font" id="Gi5-1S-RQB"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq"> <items> <menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq"/> <menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27"/> <menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq"/> <menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S"> <connections> <action selector="underline:" target="Ady-hI-5gd" id="FYS-2b-JAY"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/> <menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL"/> <menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST"/> <menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/> <menuItem title="Kern" id="jBQ-r6-VK2"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Kern" id="tlD-Oa-oAM"> <items> <menuItem title="Use Default" id="GUa-eO-cwY"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="useStandardKerning:" target="Ady-hI-5gd" id="6dk-9l-Ckg"/> </connections> </menuItem> <menuItem title="Use None" id="cDB-IK-hbR"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="turnOffKerning:" target="Ady-hI-5gd" id="U8a-gz-Maa"/> </connections> </menuItem> <menuItem title="Tighten" id="46P-cB-AYj"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="tightenKerning:" target="Ady-hI-5gd" id="hr7-Nz-8ro"/> </connections> </menuItem> <menuItem title="Loosen" id="ogc-rX-tC1"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="loosenKerning:" target="Ady-hI-5gd" id="8i4-f9-FKE"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Ligatures" id="o6e-r0-MWq"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Ligatures" id="w0m-vy-SC9"> <items> <menuItem title="Use Default" id="agt-UL-0e3"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="useStandardLigatures:" target="Ady-hI-5gd" id="7uR-wd-Dx6"/> </connections> </menuItem> <menuItem title="Use None" id="J7y-lM-qPV"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="turnOffLigatures:" target="Ady-hI-5gd" id="iX2-gA-Ilz"/> </connections> </menuItem> <menuItem title="Use All" id="xQD-1f-W4t"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="useAllLigatures:" target="Ady-hI-5gd" id="KcB-kA-TuK"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Baseline" id="OaQ-X3-Vso"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Baseline" id="ijk-EB-dga"> <items> <menuItem title="Use Default" id="3Om-Ey-2VK"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="unscript:" target="Ady-hI-5gd" id="0vZ-95-Ywn"/> </connections> </menuItem> <menuItem title="Superscript" id="Rqc-34-cIF"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="superscript:" target="Ady-hI-5gd" id="3qV-fo-wpU"/> </connections> </menuItem> <menuItem title="Subscript" id="I0S-gh-46l"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="subscript:" target="Ady-hI-5gd" id="Q6W-4W-IGz"/> </connections> </menuItem> <menuItem title="Raise" id="2h7-ER-AoG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="raiseBaseline:" target="Ady-hI-5gd" id="4sk-31-7Q9"/> </connections> </menuItem> <menuItem title="Lower" id="1tx-W0-xDw"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="lowerBaseline:" target="Ady-hI-5gd" id="OF1-bc-KW4"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/> <menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk"> <connections> <action selector="orderFrontColorPanel:" target="Ady-hI-5gd" id="mSX-Xz-DV3"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/> <menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="copyFont:" target="Ady-hI-5gd" id="GJO-xA-L4q"/> </connections> </menuItem> <menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="pasteFont:" target="Ady-hI-5gd" id="JfD-CL-leO"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Text" id="Fal-I4-PZk"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Text" id="d9c-me-L2H"> <items> <menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1"> <connections> <action selector="alignLeft:" target="Ady-hI-5gd" id="zUv-R1-uAa"/> </connections> </menuItem> <menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb"> <connections> <action selector="alignCenter:" target="Ady-hI-5gd" id="spX-mk-kcS"/> </connections> </menuItem> <menuItem title="Justify" id="J5U-5w-g23"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="alignJustified:" target="Ady-hI-5gd" id="ljL-7U-jND"/> </connections> </menuItem> <menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4"> <connections> <action selector="alignRight:" target="Ady-hI-5gd" id="r48-bG-YeY"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/> <menuItem title="Writing Direction" id="H1b-Si-o9J"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd"> <items> <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH"> <modifierMask key="keyEquivalentModifierMask"/> </menuItem> <menuItem id="YGs-j5-SAR"> <string key="title"> Default</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/> </connections> </menuItem> <menuItem id="Lbh-J2-qVU"> <string key="title"> Left to Right</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/> </connections> </menuItem> <menuItem id="jFq-tB-4Kx"> <string key="title"> Right to Left</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="swp-gr-a21"/> <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA"> <modifierMask key="keyEquivalentModifierMask"/> </menuItem> <menuItem id="Nop-cj-93Q"> <string key="title"> Default</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/> </connections> </menuItem> <menuItem id="BgM-ve-c93"> <string key="title"> Left to Right</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/> </connections> </menuItem> <menuItem id="RB4-Sm-HuC"> <string key="title"> Right to Left</string> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/> <menuItem title="Show Ruler" id="vLm-3I-IUL"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleRuler:" target="Ady-hI-5gd" id="FOx-HJ-KwY"/> </connections> </menuItem> <menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5"> <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/> <connections> <action selector="copyRuler:" target="Ady-hI-5gd" id="71i-fW-3W2"/> </connections> </menuItem> <menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI"> <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/> <connections> <action selector="pasteRuler:" target="Ady-hI-5gd" id="cSh-wd-qM2"/> </connections> </menuItem> </items> </menu> </menuItem> </items> </menu> </menuItem> <menuItem title="View" id="H8h-7b-M4v"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="View" id="HyV-fh-RgO"> <items> <menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/> </connections> </menuItem> <menuItem title="Customize Toolbar…" id="1UK-8n-QPP"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Window" id="aUF-d1-5bR"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo"> <items> <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV"> <connections> <action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/> </connections> </menuItem> <menuItem title="Zoom" id="R4o-n2-Eq4"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/> <menuItem title="Bring All to Front" id="LE2-aR-0XJ"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Help" id="wpr-3q-Mcd"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ"> <items> <menuItem title="KPCTabsControlDemo Help" keyEquivalent="?" id="FKE-Sm-Kum"> <connections> <action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/> </connections> </menuItem> </items> </menu> </menuItem> </items> </menu> <connections> <outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/> </connections> </application> <customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="KPCTabsControlDemo" customModuleProvider="target"/> <customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="75" y="0.0"/> </scene> <!--Window Controller--> <scene sceneID="R2V-B0-nI4"> <objects> <windowController id="B8D-0N-5wS" sceneMemberID="viewController"> <window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA" customClass="WorkedAroundWindow" customModule="KPCTabsControlDemo" customModuleProvider="target"> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> <rect key="contentRect" x="502" y="299" width="480" height="600"/> <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/> <value key="minSize" type="size" width="480" height="600"/> <connections> <outlet property="delegate" destination="B8D-0N-5wS" id="4jX-LV-SRe"/> </connections> </window> <connections> <segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/> </connections> </windowController> <customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="81" y="431"/> </scene> <!--View Controller--> <scene sceneID="hIz-AP-VOD"> <objects> <viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="KPCTabsControlDemo" customModuleProvider="target" sceneMemberID="viewController"> <view key="view" id="mtO-jd-dzn"> <rect key="frame" x="0.0" y="0.0" width="480" height="600"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <splitView dividerStyle="paneSplitter" translatesAutoresizingMaskIntoConstraints="NO" id="WFz-Ln-tcg"> <rect key="frame" x="0.0" y="0.0" width="480" height="600"/> <subviews> <customView id="7wy-a7-VFr"> <rect key="frame" x="0.0" y="0.0" width="480" height="162"/> <autoresizingMask key="autoresizingMask"/> <subviews> <customView translatesAutoresizingMaskIntoConstraints="NO" id="c1G-E0-GKJ" customClass="TabsControl" customModule="KPCTabsControl"> <rect key="frame" x="0.0" y="138" width="480" height="24"/> <constraints> <constraint firstAttribute="height" constant="24" id="5gB-1a-Xtv"/> </constraints> </customView> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ag9-Gu-Del"> <rect key="frame" x="18" y="73" width="444" height="17"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Label" id="liy-ye-MXn"> <font key="font" metaFont="system"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> </subviews> <constraints> <constraint firstAttribute="trailing" secondItem="c1G-E0-GKJ" secondAttribute="trailing" id="2t9-sV-fgC"/> <constraint firstItem="ag9-Gu-Del" firstAttribute="leading" secondItem="7wy-a7-VFr" secondAttribute="leading" constant="20" symbolic="YES" id="Ch3-ai-D4E"/> <constraint firstItem="ag9-Gu-Del" firstAttribute="centerX" secondItem="7wy-a7-VFr" secondAttribute="centerX" id="Efy-dG-rXe"/> <constraint firstItem="c1G-E0-GKJ" firstAttribute="leading" secondItem="7wy-a7-VFr" secondAttribute="leading" id="GjQ-4y-ZLz"/> <constraint firstItem="ag9-Gu-Del" firstAttribute="centerY" secondItem="7wy-a7-VFr" secondAttribute="centerY" constant="-0.5" id="osS-W5-PAY"/> <constraint firstItem="c1G-E0-GKJ" firstAttribute="top" secondItem="7wy-a7-VFr" secondAttribute="top" id="pKZ-MP-vom"/> </constraints> </customView> <customView id="OFa-rZ-wN5" customClass="ColoredView" customModule="KPCTabsControlDemo" customModuleProvider="target"> <rect key="frame" x="0.0" y="172" width="480" height="208"/> <autoresizingMask key="autoresizingMask"/> <subviews> <customView translatesAutoresizingMaskIntoConstraints="NO" id="Opp-vc-gij" customClass="TabsControl" customModule="KPCTabsControl"> <rect key="frame" x="0.0" y="173" width="480" height="34"/> <constraints> <constraint firstAttribute="height" constant="34" id="kyU-fU-k2n"/> </constraints> </customView> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Mwu-MR-ItH"> <rect key="frame" x="220" y="88" width="41" height="17"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Label" id="rkg-ME-LA7"> <font key="font" metaFont="system"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> </subviews> <constraints> <constraint firstAttribute="trailing" secondItem="Opp-vc-gij" secondAttribute="trailing" id="RlY-Sy-uFp"/> <constraint firstItem="Opp-vc-gij" firstAttribute="top" secondItem="OFa-rZ-wN5" secondAttribute="top" constant="1.5" id="TUm-O7-eFb"/> <constraint firstItem="Mwu-MR-ItH" firstAttribute="centerX" secondItem="OFa-rZ-wN5" secondAttribute="centerX" id="ayA-cN-der"/> <constraint firstItem="Opp-vc-gij" firstAttribute="leading" secondItem="OFa-rZ-wN5" secondAttribute="leading" id="cfs-r4-Wif"/> <constraint firstItem="Mwu-MR-ItH" firstAttribute="centerY" secondItem="OFa-rZ-wN5" secondAttribute="centerY" constant="7.5" id="uKf-Q2-od8"/> </constraints> </customView> <customView id="vd3-gI-rm5"> <rect key="frame" x="0.0" y="390" width="480" height="210"/> <autoresizingMask key="autoresizingMask"/> <subviews> <customView translatesAutoresizingMaskIntoConstraints="NO" id="BGo-z1-7UX" customClass="TabsControl" customModule="KPCTabsControl"> <rect key="frame" x="0.0" y="186" width="480" height="24"/> <constraints> <constraint firstAttribute="height" constant="24" id="kKs-HS-9ZI"/> </constraints> </customView> <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4zx-3z-7KU"> <rect key="frame" x="18" y="97" width="444" height="17"/> <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" title="Label" id="WBd-GQ-s8h"> <font key="font" metaFont="system"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> </subviews> <constraints> <constraint firstItem="4zx-3z-7KU" firstAttribute="leading" secondItem="vd3-gI-rm5" secondAttribute="leading" constant="20" symbolic="YES" id="DQU-g0-I14"/> <constraint firstItem="BGo-z1-7UX" firstAttribute="leading" secondItem="vd3-gI-rm5" secondAttribute="leading" id="E6R-pt-A9l"/> <constraint firstItem="4zx-3z-7KU" firstAttribute="centerY" secondItem="vd3-gI-rm5" secondAttribute="centerY" constant="-0.5" id="FDC-GN-WQR"/> <constraint firstAttribute="trailing" secondItem="BGo-z1-7UX" secondAttribute="trailing" id="IxK-yi-M4G"/> <constraint firstItem="BGo-z1-7UX" firstAttribute="top" secondItem="vd3-gI-rm5" secondAttribute="top" id="TbH-bX-OMt"/> <constraint firstItem="4zx-3z-7KU" firstAttribute="centerX" secondItem="vd3-gI-rm5" secondAttribute="centerX" id="czG-K3-y66"/> </constraints> </customView> </subviews> <holdingPriorities> <real value="250"/> <real value="250"/> <real value="250"/> </holdingPriorities> </splitView> </subviews> <constraints> <constraint firstAttribute="bottom" secondItem="WFz-Ln-tcg" secondAttribute="bottom" id="Mpp-4r-TdX"/> <constraint firstAttribute="trailing" secondItem="WFz-Ln-tcg" secondAttribute="trailing" id="XEQ-Rp-SVg"/> <constraint firstItem="WFz-Ln-tcg" firstAttribute="leading" secondItem="mtO-jd-dzn" secondAttribute="leading" id="eIe-hc-32q"/> <constraint firstItem="WFz-Ln-tcg" firstAttribute="top" secondItem="mtO-jd-dzn" secondAttribute="top" id="rnI-cI-hZ9"/> </constraints> </view> <connections> <outlet property="paneChrome" destination="75v-vX-VJy" id="X5i-RS-QBi"/> <outlet property="paneDefault" destination="3kW-kt-052" id="WMz-yw-Evy"/> <outlet property="paneSafari" destination="OEp-9e-sce" id="iaM-za-YyO"/> </connections> </viewController> <customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> <customObject id="3kW-kt-052" userLabel="Default Pane View Controller" customClass="PaneViewController" customModule="KPCTabsControlDemo" customModuleProvider="target"> <connections> <outlet property="tabWidthsLabel" destination="ag9-Gu-Del" id="i2C-eM-qPP"/> <outlet property="tabsBar" destination="c1G-E0-GKJ" id="7hD-9N-hsM"/> <outlet property="view" destination="7wy-a7-VFr" id="0hm-ls-CcK"/> </connections> </customObject> <customObject id="75v-vX-VJy" userLabel="Chrome Pane View Controller" customClass="PaneViewController" customModule="KPCTabsControlDemo" customModuleProvider="target"> <connections> <outlet property="tabWidthsLabel" destination="Mwu-MR-ItH" id="MiE-3t-bPW"/> <outlet property="tabsBar" destination="Opp-vc-gij" id="zON-Zf-mSx"/> <outlet property="view" destination="OFa-rZ-wN5" id="WSC-Y7-YLL"/> </connections> </customObject> <customObject id="OEp-9e-sce" userLabel="Safari Pane View Controller" customClass="PaneViewController" customModule="KPCTabsControlDemo" customModuleProvider="target"> <connections> <outlet property="tabWidthsLabel" destination="4zx-3z-7KU" id="9FK-tB-1Jz"/> <outlet property="tabsBar" destination="BGo-z1-7UX" id="w73-Vq-Xq9"/> <outlet property="view" destination="vd3-gI-rm5" id="eUN-4h-nrj"/> </connections> </customObject> </objects> <point key="canvasLocation" x="711" y="431"/> </scene> </scenes> </document>
{ "pile_set_name": "Github" }
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.models.extensions; import com.microsoft.graph.serializer.ISerializer; import com.microsoft.graph.serializer.IJsonBackedObject; import com.microsoft.graph.serializer.AdditionalDataManager; import java.util.EnumSet; import com.google.gson.JsonObject; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; // **NOTE** This file was generated by a tool and any changes will be overwritten. /** * The class for the Change Notification Encrypted Content. */ public class ChangeNotificationEncryptedContent implements IJsonBackedObject { @SerializedName("@odata.type") @Expose public String oDataType; private transient AdditionalDataManager additionalDataManager = new AdditionalDataManager(this); @Override public final AdditionalDataManager additionalDataManager() { return additionalDataManager; } /** * The Data. * Base64-encoded encrypted data that produces a full resource respresented as JSON. The data has been encrypted with the provided dataKey using an AES/CBC/PKCS5PADDING cipher suite. */ @SerializedName("data") @Expose public String data; /** * The Data Key. * Base64-encoded symmetric key generated by Microsoft Graph to encrypt the data value and to generate the data signature. This key is encrypted with the certificate public key that was provided during the subscription. It must be decrypted with the certificate private key before it can be used to decrypt the data or verify the signature. This key has been encrypted with the following cipher suite: RSA/ECB/OAEPWithSHA1AndMGF1Padding. */ @SerializedName("dataKey") @Expose public String dataKey; /** * The Data Signature. * Base64-encoded HMAC-SHA256 hash of the data for validation purposes. */ @SerializedName("dataSignature") @Expose public String dataSignature; /** * The Encryption Certificate Id. * ID of the certificate used to encrypt the dataKey. */ @SerializedName("encryptionCertificateId") @Expose public String encryptionCertificateId; /** * The Encryption Certificate Thumbprint. * Hexadecimal representation of the thumbprint of the certificate used to encrypt the dataKey. */ @SerializedName("encryptionCertificateThumbprint") @Expose public String encryptionCertificateThumbprint; /** * The raw representation of this class */ private JsonObject rawObject; /** * The serializer */ private ISerializer serializer; /** * Gets the raw representation of this class * * @return the raw representation of this class */ public JsonObject getRawObject() { return rawObject; } /** * Gets serializer * * @return the serializer */ protected ISerializer getSerializer() { return serializer; } /** * Sets the raw JSON object * * @param serializer the serializer * @param json the JSON object to set this object to */ public void setRawObject(final ISerializer serializer, final JsonObject json) { this.serializer = serializer; rawObject = json; } }
{ "pile_set_name": "Github" }
// Copyright 2017 JanusGraph Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package org.janusgraph.blueprints.structure; import org.janusgraph.blueprints.BerkeleyGraphProvider; import org.janusgraph.core.JanusGraph; import org.apache.tinkerpop.gremlin.GraphProviderClass; import org.apache.tinkerpop.gremlin.structure.StructureStandardSuite; import org.junit.runner.RunWith; /** * @author Matthias Broecheler ([email protected]) */ @RunWith(StructureStandardSuite.class) @GraphProviderClass(provider = BerkeleyGraphProvider.class, graph = JanusGraph.class) public class BerkeleyJanusGraphStructureTest { }
{ "pile_set_name": "Github" }
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Angular Mask US Demo</title> <script src="../node_modules/angular/angular.min.js"></script> <script src="../releases/angular-input-masks-dependencies.js"></script> <script src="../releases/angular-input-masks.us.js"></script> <script> angular.module('demo', ['ui.utils.masks.us']) .controller('ctrl', function ctrl($scope) { $scope.initializedPhoneNumber = '3133536767'; }); </script> </head> <body ng-app="demo"> <form name="form" ng-controller="ctrl"> <h2>ui-us-phone-number</h2> <input id="us-phone-input" type="text" name="phoneNumberTest" ng-model="phoneNumber" ui-us-phone-number><br> <span id="us-phone-value">{{phoneNumber}}</span> - {{form.phoneNumberTest.$valid}}<br> <br> <input id="init-us-phone-input" type="text" name="initializedPhoneNumberTest" ng-model="initializedPhoneNumber" ui-us-phone-number><br> <span id="init-us-phone-value">{{initializedPhoneNumber}}</span> - {{form.initializedPhoneNumberTest.$valid}}<br> <br> </form> </body> </html>
{ "pile_set_name": "Github" }
var searchData= [ ['highlightview',['HighlightView',['../classcom_1_1ab_1_1view_1_1cropimage_1_1_highlight_view.html',1,'com::ab::view::cropimage']]] ];
{ "pile_set_name": "Github" }
/* Mantis PCI bridge driver Copyright (C) Manu Abraham ([email protected]) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <asm/io.h> #include <linux/ioport.h> #include <linux/pci.h> #include <linux/i2c.h> #include "dmxdev.h" #include "dvbdev.h" #include "dvb_demux.h" #include "dvb_frontend.h" #include "dvb_net.h" #include "mantis_common.h" #include "mantis_reg.h" #include "mantis_i2c.h" #define TRIALS 10000 static int mantis_i2c_read(struct mantis_pci *mantis, const struct i2c_msg *msg) { u32 rxd, i, stat, trials; dprintk(MANTIS_INFO, 0, " %s: Address=[0x%02x] <R>[ ", __func__, msg->addr); for (i = 0; i < msg->len; i++) { rxd = (msg->addr << 25) | (1 << 24) | MANTIS_I2C_RATE_3 | MANTIS_I2C_STOP | MANTIS_I2C_PGMODE; if (i == (msg->len - 1)) rxd &= ~MANTIS_I2C_STOP; mmwrite(MANTIS_INT_I2CDONE, MANTIS_INT_STAT); mmwrite(rxd, MANTIS_I2CDATA_CTL); /* wait for xfer completion */ for (trials = 0; trials < TRIALS; trials++) { stat = mmread(MANTIS_INT_STAT); if (stat & MANTIS_INT_I2CDONE) break; } dprintk(MANTIS_TMG, 0, "I2CDONE: trials=%d\n", trials); /* wait for xfer completion */ for (trials = 0; trials < TRIALS; trials++) { stat = mmread(MANTIS_INT_STAT); if (stat & MANTIS_INT_I2CRACK) break; } dprintk(MANTIS_TMG, 0, "I2CRACK: trials=%d\n", trials); rxd = mmread(MANTIS_I2CDATA_CTL); msg->buf[i] = (u8)((rxd >> 8) & 0xFF); dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]); } dprintk(MANTIS_INFO, 0, "]\n"); return 0; } static int mantis_i2c_write(struct mantis_pci *mantis, const struct i2c_msg *msg) { int i; u32 txd = 0, stat, trials; dprintk(MANTIS_INFO, 0, " %s: Address=[0x%02x] <W>[ ", __func__, msg->addr); for (i = 0; i < msg->len; i++) { dprintk(MANTIS_INFO, 0, "%02x ", msg->buf[i]); txd = (msg->addr << 25) | (msg->buf[i] << 8) | MANTIS_I2C_RATE_3 | MANTIS_I2C_STOP | MANTIS_I2C_PGMODE; if (i == (msg->len - 1)) txd &= ~MANTIS_I2C_STOP; mmwrite(MANTIS_INT_I2CDONE, MANTIS_INT_STAT); mmwrite(txd, MANTIS_I2CDATA_CTL); /* wait for xfer completion */ for (trials = 0; trials < TRIALS; trials++) { stat = mmread(MANTIS_INT_STAT); if (stat & MANTIS_INT_I2CDONE) break; } dprintk(MANTIS_TMG, 0, "I2CDONE: trials=%d\n", trials); /* wait for xfer completion */ for (trials = 0; trials < TRIALS; trials++) { stat = mmread(MANTIS_INT_STAT); if (stat & MANTIS_INT_I2CRACK) break; } dprintk(MANTIS_TMG, 0, "I2CRACK: trials=%d\n", trials); } dprintk(MANTIS_INFO, 0, "]\n"); return 0; } static int mantis_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num) { int ret = 0, i = 0, trials; u32 stat, data, txd; struct mantis_pci *mantis; struct mantis_hwconfig *config; mantis = i2c_get_adapdata(adapter); BUG_ON(!mantis); config = mantis->hwconfig; BUG_ON(!config); dprintk(MANTIS_DEBUG, 1, "Messages:%d", num); mutex_lock(&mantis->i2c_lock); while (i < num) { /* Byte MODE */ if ((config->i2c_mode & MANTIS_BYTE_MODE) && ((i + 1) < num) && (msgs[i].len < 2) && (msgs[i + 1].len < 2) && (msgs[i + 1].flags & I2C_M_RD)) { dprintk(MANTIS_DEBUG, 0, " Byte MODE:\n"); /* Read operation */ txd = msgs[i].addr << 25 | (0x1 << 24) | (msgs[i].buf[0] << 16) | MANTIS_I2C_RATE_3; mmwrite(txd, MANTIS_I2CDATA_CTL); /* wait for xfer completion */ for (trials = 0; trials < TRIALS; trials++) { stat = mmread(MANTIS_INT_STAT); if (stat & MANTIS_INT_I2CDONE) break; } /* check for xfer completion */ if (stat & MANTIS_INT_I2CDONE) { /* check xfer was acknowledged */ if (stat & MANTIS_INT_I2CRACK) { data = mmread(MANTIS_I2CDATA_CTL); msgs[i + 1].buf[0] = (data >> 8) & 0xff; dprintk(MANTIS_DEBUG, 0, " Byte <%d> RXD=0x%02x [%02x]\n", 0x0, data, msgs[i + 1].buf[0]); } else { /* I/O error */ dprintk(MANTIS_ERROR, 1, " I/O error, LINE:%d", __LINE__); ret = -EIO; break; } } else { /* I/O error */ dprintk(MANTIS_ERROR, 1, " I/O error, LINE:%d", __LINE__); ret = -EIO; break; } i += 2; /* Write/Read operation in one go */ } if (i < num) { if (msgs[i].flags & I2C_M_RD) ret = mantis_i2c_read(mantis, &msgs[i]); else ret = mantis_i2c_write(mantis, &msgs[i]); i++; if (ret < 0) goto bail_out; } } mutex_unlock(&mantis->i2c_lock); return num; bail_out: mutex_unlock(&mantis->i2c_lock); return ret; } static u32 mantis_i2c_func(struct i2c_adapter *adapter) { return I2C_FUNC_SMBUS_EMUL; } static struct i2c_algorithm mantis_algo = { .master_xfer = mantis_i2c_xfer, .functionality = mantis_i2c_func, }; int mantis_i2c_init(struct mantis_pci *mantis) { u32 intstat; struct i2c_adapter *i2c_adapter = &mantis->adapter; struct pci_dev *pdev = mantis->pdev; init_waitqueue_head(&mantis->i2c_wq); mutex_init(&mantis->i2c_lock); strncpy(i2c_adapter->name, "Mantis I2C", sizeof(i2c_adapter->name)); i2c_set_adapdata(i2c_adapter, mantis); i2c_adapter->owner = THIS_MODULE; i2c_adapter->algo = &mantis_algo; i2c_adapter->algo_data = NULL; i2c_adapter->timeout = 500; i2c_adapter->retries = 3; i2c_adapter->dev.parent = &pdev->dev; mantis->i2c_rc = i2c_add_adapter(i2c_adapter); if (mantis->i2c_rc < 0) return mantis->i2c_rc; dprintk(MANTIS_DEBUG, 1, "Initializing I2C .."); intstat = mmread(MANTIS_INT_STAT); mmread(MANTIS_INT_MASK); mmwrite(intstat, MANTIS_INT_STAT); dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt"); mantis_mask_ints(mantis, MANTIS_INT_I2CDONE); return 0; } EXPORT_SYMBOL_GPL(mantis_i2c_init); int mantis_i2c_exit(struct mantis_pci *mantis) { dprintk(MANTIS_DEBUG, 1, "Disabling I2C interrupt"); mantis_mask_ints(mantis, MANTIS_INT_I2CDONE); dprintk(MANTIS_DEBUG, 1, "Removing I2C adapter"); i2c_del_adapter(&mantis->adapter); return 0; } EXPORT_SYMBOL_GPL(mantis_i2c_exit);
{ "pile_set_name": "Github" }
/* =========================================================================== Doom 3 BFG Edition GPL Source Code Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company. This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Doom 3 BFG Edition Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ #ifndef __LISTWINDOW_H #define __LISTWINDOW_H class idSliderWindow; enum { TAB_TYPE_TEXT = 0, TAB_TYPE_ICON = 1 }; struct idTabRect { int x; int w; int align; int valign; int type; idVec2 iconSize; float iconVOffset; }; class idListWindow : public idWindow { public: idListWindow(idUserInterfaceLocal *gui); virtual const char* HandleEvent(const sysEvent_t *event, bool *updateVisuals); virtual void PostParse(); virtual void Draw(int time, float x, float y); virtual void Activate(bool activate, idStr &act); virtual void HandleBuddyUpdate(idWindow *buddy); virtual void StateChanged( bool redraw = false ); virtual size_t Allocated(){return idWindow::Allocated();}; virtual idWinVar* GetWinVarByName(const char *_name, bool winLookup = false, drawWin_t** owner = NULL); void UpdateList(); private: virtual bool ParseInternalVar(const char *name, idTokenParser *src); void CommonInit(); void InitScroller( bool horizontal ); void SetCurrentSel( int sel ); void AddCurrentSel( int sel ); int GetCurrentSel(); bool IsSelected( int index ); void ClearSelection( int sel ); idList<idTabRect, TAG_OLD_UI> tabInfo; int top; float sizeBias; bool horizontal; idStr tabStopStr; idStr tabAlignStr; idStr tabVAlignStr; idStr tabTypeStr; idStr tabIconSizeStr; idStr tabIconVOffsetStr; idHashTable<const idMaterial*> iconMaterials; bool multipleSel; idStrList listItems; idSliderWindow* scroller; idList<int, TAG_OLD_UI> currentSel; idStr listName; int clickTime; int typedTime; idStr typed; }; #endif // __LISTWINDOW_H
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- // Cyanide Theme for Sublime Text // https://github.com/lefoy/cyanide-theme // // by lefoy // http://lefoy.net // // based on Centurion, Afterglow, Spacefunk and Seti_UI themes // // DO NOT EDIT THIS FILE! It is automatically generated by Grunt. // Any modification you make to this file can be lost at any time. // // To change the values here, edit the file inside the "templates" folder // then run "grunt build". // // // Cyanide - Acid - Contrasted Theme // Custom color (rgb): 182,219,81 // Custom color (hex): b6db51 // Background (rgb): 18,18,18 // Background (hex): 121212 // --> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>comment</key> <string>http://lefoy.net</string> <key>name</key> <string>lefoy</string> <key>settings</key> <array> <dict> <key>settings</key> <dict> <key>background</key> <string>#121212</string> <key>caret</key> <string>#CCCCCC</string> <key>foreground</key> <string>#CCCCCC</string> <key>invisibles</key> <string>#6A6A6A</string> <key>lineHighlight</key> <string>#111111</string> <key>selection</key> <string>#252525</string> <key>gutterForeground</key> <string>#333333</string> <key>guide</key> <string>#141414</string> </dict> </dict> <dict> <key>name</key> <string>Comment</string> <key>scope</key> <string>comment</string> <key>settings</key> <dict> <key>foreground</key> <string>#444</string> </dict> </dict> <dict> <key>name</key> <string>Foreground</string> <key>scope</key> <string>keyword.operator.class, constant.other, source.php.embedded.line</string> <key>settings</key> <dict> <key>fontStyle</key> <string /> <key>foreground</key> <string>#CCCCCC</string> </dict> </dict> <dict> <key>name</key> <string>Variable, String Link, Tag Name</string> <key>scope</key> <string>variable, support.other.variable, string.other.link, entity.name.tag, entity.other.attribute-name, meta.tag, declaration.tag</string> <key>settings</key> <dict> <key>foreground</key> <string>#787878</string> </dict> </dict> <dict> <key>name</key> <string>Number, Constant, Function Argument, Tag Attribute, Embedded</string> <key>scope</key> <string>constant.numeric, constant.language, support.constant, constant.character, variable.parameter, punctuation.section.embedded, keyword.other.unit</string> <key>settings</key> <dict> <key>fontStyle</key> <string /> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>Class, Support</string> <key>scope</key> <string>entity.name.class, entity.name.type.class, support.type, support.class</string> <key>settings</key> <dict> <key>fontStyle</key> <string /> <key>foreground</key> <string>#DDD</string> </dict> </dict> <dict> <key>name</key> <string>String, Symbols, Inherited Class, Markup Heading</string> <key>scope</key> <string>string, constant.other.symbol, entity.other.inherited-class, markup.heading</string> <key>settings</key> <dict> <key>fontStyle</key> <string /> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>Operator, Misc</string> <key>scope</key> <string>keyword.operator, constant.other.color</string> <key>settings</key> <dict> <key>foreground</key> <string>#AAA</string> </dict> </dict> <dict> <key>name</key> <string>Function, Special Method, Block Level</string> <key>scope</key> <string>entity.name.function, meta.function-call, support.function, keyword.other.special-method, meta.block-level</string> <key>settings</key> <dict> <key>fontStyle</key> <string /> <key>foreground</key> <string>#EFEFEF</string> </dict> </dict> <dict> <key>name</key> <string>Keyword, Storage</string> <key>scope</key> <string>keyword, storage, storage.type, entity.name.tag.css</string> <key>settings</key> <dict> <key>fontStyle</key> <string /> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>Separator</string> <key>scope</key> <string>meta.separator</string> <key>settings</key> <dict> <key>background</key> <string>#222222</string> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>Diff foreground</string> <key>scope</key> <string>markup.inserted.diff, markup.deleted.diff, meta.diff.header.to-file, meta.diff.header.from-file</string> <key>settings</key> <dict> <key>foreground</key> <string>#555555</string> </dict> </dict> <dict> <key>name</key> <string>Diff insertion</string> <key>scope</key> <string>markup.inserted.diff, meta.diff.header.to-file</string> <key>settings</key> <dict> <key>foreground</key> <string>#718c00</string> </dict> </dict> <dict> <key>name</key> <string>Diff deletion</string> <key>scope</key> <string>markup.deleted.diff, meta.diff.header.from-file</string> <key>settings</key> <dict> <key>foreground</key> <string>#c82829</string> </dict> </dict> <dict> <key>name</key> <string>Diff header</string> <key>scope</key> <string>meta.diff.header.from-file, meta.diff.header.to-file</string> <key>settings</key> <dict> <key>foreground</key> <string>#555555</string> <key>background</key> <string>#4271ae</string> </dict> </dict> <dict> <key>name</key> <string>Diff range</string> <key>scope</key> <string>meta.diff.range</string> <key>settings</key> <dict> <key>fontStyle</key> <string>italic</string> <key>foreground</key> <string>#3e999f</string> </dict> </dict> <dict> <key>name</key> <string>GitGutter deleted</string> <key>scope</key> <string>markup.deleted.git_gutter</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>GitGutter inserted</string> <key>scope</key> <string>markup.inserted.git_gutter</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>GitGutter changed</string> <key>scope</key> <string>markup.changed.git_gutter</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>GitGutter ignored</string> <key>scope</key> <string>markup.ignored.git_gutter</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>GitGutter untracked</string> <key>scope</key> <string>markup.untracked.git_gutter</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>SublimeLinter Warning</string> <key>scope</key> <string>sublimelinter.mark.warning</string> <key>settings</key> <dict> <key>foreground</key> <string>#EDBA00</string> </dict> </dict> <dict> <key>name</key> <string>SublimeLinter Gutter Mark</string> <key>scope</key> <string>sublimelinter.gutter-mark</string> <key>settings</key> <dict> <key>foreground</key> <string>#555555</string> </dict> </dict> <dict> <key>name</key> <string>SublimeLinter Error</string> <key>scope</key> <string>sublimelinter.mark.error</string> <key>settings</key> <dict> <key>foreground</key> <string>#DA2000</string> </dict> </dict> <dict> <key>name</key> <string>File/Dir Symbols</string> <key>scope</key> <string>punctuation.definition.directory.symbol.dired, punctuation.definition.file.symbol.dired, dired.item.parent_dir</string> <key>settings</key> <dict> <key>foreground</key> <string>#919aa388</string> </dict> </dict> <dict> <key>name</key> <string>Dir Slash</string> <key>scope</key> <string>punctuation.definition.directory.slash.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#919aa388</string> </dict> </dict> <dict> <key>name</key> <string>Dir Name</string> <key>scope</key> <string>string.name.directory.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#919aa388</string> <key>fontStyle</key> <string>bold</string> </dict> </dict> <dict> <key>name</key> <string>Header</string> <key>scope</key> <string>header.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#333333</string> </dict> </dict> <dict> <key>name</key> <string>Header punctuations</string> <key>scope</key> <string>header.dired punctuation.definition.separator.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#6f798733</string> </dict> </dict> <dict> <key>name</key> <string>Header Rename Mode Title</string> <key>scope</key> <string>header.dired punctuation.definition.rename_mode</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>Marked</string> <key>scope</key> <string>dired.marked</string> <key>settings</key> <dict> <key>foreground</key> <string>#FFFFFF</string> <key>background</key> <string>#4b96d6</string> </dict> </dict> <dict> <key>name</key> <string>Help</string> <key>scope</key> <string>help.dired</string> <key>settings</key> <dict> <key>background</key> <string>#f5f7f8</string> <key>foreground</key> <string>#b6db51</string> </dict> </dict> <dict> <key>name</key> <string>Help punctuations</string> <key>scope</key> <string>punctuations.help.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#6f798766</string> </dict> </dict> <dict> <key>name</key> <string>Help shortcut punctuations</string> <key>scope</key> <string>punctuations.shortcut.help.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db5166</string> </dict> </dict> <dict> <key>name</key> <string>Help shortcut</string> <key>scope</key> <string>key.shortcut.help.dired</string> <key>settings</key> <dict> <key>fontStyle</key> <string>bold</string> <key>foreground</key> <string>#000000</string> </dict> </dict> <dict> <key>name</key> <string>Error</string> <key>scope</key> <string>string.error.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#aa0000</string> </dict> </dict> <dict> <key>name</key> <string>VCS Modified</string> <key>scope</key> <string>item.modified.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#b6db51</string> <key>background</key> <string>#0a0a0b</string> </dict> </dict> <dict> <key>name</key> <string>VCS Untracked</string> <key>scope</key> <string>item.untracked.dired</string> <key>settings</key> <dict> <key>foreground</key> <string>#fff</string> <key>background</key> <string>#0a0a0b</string> </dict> </dict> </array> <key>uuid</key> <string>DE477E5B-BD4D-46B0-BF80-2EA32A2814D5</string> </dict> </plist>
{ "pile_set_name": "Github" }
defmodule PhoenixHamlTest do use ExUnit.Case alias Phoenix.View defmodule MyApp.PageView do use Phoenix.View, root: "test/fixtures/templates" use Phoenix.HTML end test "render a haml template with layout" do html = View.render(MyApp.PageView, "new.html", message: "hi", layout: {MyApp.PageView, "application.html"} ) assert html == {:safe, [[["" | "<html>\n <body>\n "], "" | "<h2>\n New Template\n</h2>\n"] | "\n </body>\n</html>\n"]} end test "render a haml template without layout" do html = View.render(MyApp.PageView, "new.html", []) assert html == {:safe, ["" | "<h2>\n New Template\n</h2>\n"]} end end
{ "pile_set_name": "Github" }
/* * GRUB -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GRUB is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with GRUB. If not, see <http://www.gnu.org/licenses/>. */ #include <grub/i386/io.h>
{ "pile_set_name": "Github" }
package jp.kshoji.driver.midi.fragment; import android.app.Activity; import android.app.Fragment; import android.os.Bundle; import android.support.annotation.NonNull; import android.util.Log; import java.util.Collections; import java.util.HashSet; import java.util.Set; import jp.kshoji.driver.midi.activity.MidiFragmentHostActivity; import jp.kshoji.driver.midi.device.MidiOutputDevice; import jp.kshoji.driver.midi.listener.OnMidiDeviceAttachedListener; import jp.kshoji.driver.midi.listener.OnMidiDeviceDetachedListener; import jp.kshoji.driver.midi.listener.OnMidiInputEventListener; import jp.kshoji.driver.midi.util.Constants; /** * Base {@link Fragment} for using USB MIDI interface. * * @author K.Shoji */ public abstract class AbstractMidiFragment extends Fragment implements OnMidiDeviceDetachedListener, OnMidiDeviceAttachedListener, OnMidiInputEventListener { private MidiFragmentHostActivity hostActivity; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Activity activity = getActivity(); if (!(activity instanceof MidiFragmentHostActivity)) { Log.i(Constants.TAG, "activity:" + activity); throw new IllegalArgumentException("Parent Activity is not MidiFragmentHostActivity."); } this.hostActivity = (MidiFragmentHostActivity) activity; } /** * Suspends receiving/transmitting MIDI messages. * All events will be discarded until the devices being resumed. */ public final void suspendMidiDevices() { if (hostActivity != null) { hostActivity.suspendMidiDevices(); } } /** * Resumes from {@link #suspendMidiDevices()} */ public final void resumeMidiDevices() { if (hostActivity != null) { hostActivity.resumeMidiDevices(); } } /** * Get {@link MidiOutputDevice} attached with {@link MidiFragmentHostActivity} * * @return {@link Set<MidiOutputDevice>} unmodifiable */ @NonNull public final Set<MidiOutputDevice> getMidiOutputDevices() { if (hostActivity == null) { return Collections.unmodifiableSet(new HashSet<MidiOutputDevice>()); } return hostActivity.getMidiOutputDevices(); } }
{ "pile_set_name": "Github" }
// RUN: %clang_cc1 %s -emit-llvm -o - enum { tA = 0, tB = 1 }; struct MyStruct { unsigned long A; void * B; }; void bar(){ struct MyStruct MS = { tB, 0 }; }
{ "pile_set_name": "Github" }
[android-components](../../index.md) / [mozilla.components.feature.addons.migration](../index.md) / [SupportedAddonsChecker](index.md) / [registerForChecks](./register-for-checks.md) # registerForChecks `abstract fun registerForChecks(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/feature/addons/src/main/java/mozilla/components/feature/addons/migration/SupportedAddonsChecker.kt#L46) Registers for periodic checks for new available add-ons.
{ "pile_set_name": "Github" }
attribute vec4 av_Position;//定点坐标,应用传入 attribute vec2 af_Position;//采样纹理坐标,应用传入 varying vec2 v_texPo;//把获取的纹理坐标传入fragment里面 void main() { v_texPo = af_Position; gl_Position = av_Position; }
{ "pile_set_name": "Github" }
package influxdb import ( "context" "encoding/json" ) // consts for checks config. const ( CheckDefaultPageSize = 100 CheckMaxPageSize = 500 ) // Check represents the information required to generate a periodic check task. type Check interface { Valid(lang FluxLanguageService) error Type() string ClearPrivateData() SetTaskID(ID) GetTaskID() ID GetOwnerID() ID SetOwnerID(ID) GenerateFlux(lang FluxLanguageService) (string, error) json.Marshaler CRUDLogSetter SetID(id ID) SetOrgID(id ID) SetName(name string) SetDescription(description string) GetID() ID GetCRUDLog() CRUDLog GetOrgID() ID GetName() string GetDescription() string } // ops for checks error var ( OpFindCheckByID = "FindCheckByID" OpFindCheck = "FindCheck" OpFindChecks = "FindChecks" OpCreateCheck = "CreateCheck" OpUpdateCheck = "UpdateCheck" OpDeleteCheck = "DeleteCheck" ) // CheckService represents a service for managing checks. type CheckService interface { // FindCheckByID returns a single check by ID. FindCheckByID(ctx context.Context, id ID) (Check, error) // FindCheck returns the first check that matches filter. FindCheck(ctx context.Context, filter CheckFilter) (Check, error) // FindChecks returns a list of checks that match filter and the total count of matching checks. // Additional options provide pagination & sorting. FindChecks(ctx context.Context, filter CheckFilter, opt ...FindOptions) ([]Check, int, error) // CreateCheck creates a new check and sets b.ID with the new identifier. CreateCheck(ctx context.Context, c CheckCreate, userID ID) error // UpdateCheck updates the whole check. // Returns the new check state after update. UpdateCheck(ctx context.Context, id ID, c CheckCreate) (Check, error) // PatchCheck updates a single bucket with changeset. // Returns the new check state after update. PatchCheck(ctx context.Context, id ID, upd CheckUpdate) (Check, error) // DeleteCheck will delete the check by id. DeleteCheck(ctx context.Context, id ID) error } // CheckUpdate are properties than can be updated on a check type CheckUpdate struct { Name *string `json:"name,omitempty"` Status *Status `json:"status,omitempty"` Description *string `json:"description,omitempty"` } // CheckCreate represent data to create a new Check type CheckCreate struct { Check Status Status `json:"status"` } // Valid returns err is the update is invalid. func (n *CheckUpdate) Valid() error { if n.Name != nil && *n.Name == "" { return &Error{ Code: EInvalid, Msg: "Check Name can't be empty", } } if n.Description != nil && *n.Description == "" { return &Error{ Code: EInvalid, Msg: "Check Description can't be empty", } } if n.Status != nil { if err := n.Status.Valid(); err != nil { return err } } return nil } // CheckFilter represents a set of filters that restrict the returned results. type CheckFilter struct { ID *ID Name *string OrgID *ID Org *string UserResourceMappingFilter } // QueryParams Converts CheckFilter fields to url query params. func (f CheckFilter) QueryParams() map[string][]string { qp := map[string][]string{} if f.ID != nil { qp["id"] = []string{f.ID.String()} } if f.Name != nil { qp["name"] = []string{*f.Name} } if f.OrgID != nil { qp["orgID"] = []string{f.OrgID.String()} } if f.Org != nil { qp["org"] = []string{*f.Org} } return qp }
{ "pile_set_name": "Github" }
"######################################## "######################################## " Lavender Contrast (rainglow) " " https://github.com/rainglow/vim " " Copyright (c) Dayle Rees. "######################################## "######################################## "######################################## "# Settings. # "######################################## set background=dark highlight clear if exists("syntax_on") syntax reset endif let g:colors_name = "lavender-contrast" "######################################## "# Base Colors. # "######################################## hi Cursor guifg=#080709 guibg=#f8f8f0 gui=NONE hi Visual guifg=#ffffff guibg=#b657ff gui=NONE hi CursorLine guifg=NONE guibg=#100e12 gui=NONE hi CursorLineNr guifg=#544a5f guibg=#000000 gui=NONE hi CursorColumn guifg=NONE guibg=#000000 gui=NONE hi ColorColumn guifg=NONE guibg=#000000 gui=NONE hi LineNr guifg=#211d26 guibg=#000000 gui=NONE hi VertSplit guifg=#211d26 guibg=#211d26 gui=NONE hi MatchParen guifg=#b657ff guibg=NONE gui=underline hi StatusLine guifg=#e0ceed guibg=#000000 gui=bold hi StatusLineNC guifg=#e0ceed guibg=#000000 gui=NONE hi Pmenu guifg=#e0ceed guibg=#000000 gui=NONE hi PmenuSel guifg=NONE guibg=#a29dfa gui=NONE hi IncSearch guifg=#e0ceed guibg=#f25ae6 gui=NONE hi Search guifg=NONE guibg=NONE gui=underline hi Directory guifg=#a29dfa guibg=NONE gui=NONE hi Folded guifg=#d4bbe6 guibg=#000000 gui=NONE hi Normal guifg=#f5b0ef guibg=#080709 gui=NONE hi Boolean guifg=#f5b0ef guibg=NONE gui=NONE hi Character guifg=#f5b0ef guibg=NONE gui=NONE hi Comment guifg=#614e6e guibg=NONE gui=NONE hi Conditional guifg=#8e6da6 guibg=NONE gui=NONE hi Constant guifg=NONE guibg=NONE gui=NONE hi Define guifg=#a29dfa guibg=NONE gui=NONE hi DiffAdd guifg=#2e2834 guibg=#a7da1e gui=bold hi DiffDelete guifg=#2e2834 guibg=#e61f44 gui=NONE hi DiffChange guifg=#2e2834 guibg=#f7b83d gui=NONE hi DiffText guifg=#2e2834 guibg=#f7b83d gui=bold hi ErrorMsg guifg=#2e2834 guibg=#e61f44 gui=NONE hi WarningMsg guifg=#2e2834 guibg=#f7b83d gui=NONE hi Float guifg=#f25ae6 guibg=NONE gui=NONE hi Function guifg=#a29dfa guibg=NONE gui=NONE hi Identifier guifg=#e0ceed guibg=NONE gui=NONE hi Keyword guifg=#a29dfa guibg=NONE gui=NONE hi Label guifg=#f5b0ef guibg=NONE gui=NONE hi NonText guifg=#8040af guibg=#030303 gui=NONE hi Number guifg=#f25ae6 guibg=NONE gui=NONE hi Operator guifg=#e0ceed guibg=NONE gui=NONE hi PreProc guifg=#886f99 guibg=NONE gui=NONE hi Special guifg=#e0ceed guibg=NONE gui=NONE hi SpecialKey guifg=#e0ceed guibg=#a29dfa gui=NONE hi Statement guifg=#8e6da6 guibg=NONE gui=NONE hi StorageClass guifg=#b657ff guibg=NONE gui=NONE hi String guifg=#f5b0ef guibg=NONE gui=NONE hi Tag guifg=#a29dfa guibg=NONE gui=NONE hi Title guifg=#a29dfa guibg=NONE gui=bold hi Todo guifg=#886f99 guibg=NONE gui=inverse,bold hi Type guifg=NONE guibg=NONE gui=NONE hi Underlined guifg=NONE guibg=NONE gui=underline "######################################## "# Language Overrides # "######################################## hi phpIdentifier guifg=#e0ceed hi phpMethodsVar guifg=#bab2c3 hi xmlTag guifg=#a29dfa guibg=NONE gui=NONE hi xmlTagName guifg=#a29dfa guibg=NONE gui=NONE hi xmlEndTag guifg=#a29dfa guibg=NONE gui=NONE "######################################## "# Light Theme Overrides # "########################################
{ "pile_set_name": "Github" }
# coding: utf-8 # frozen_string_literal: true module ActiveInteraction class Base # @!method self.hash(*attributes, options = {}, &block) # Creates accessors for the attributes and ensures that values passed to # the attributes are Hashes. # # @!macro filter_method_params # @param block [Proc] filter methods to apply for select keys # @option options [Boolean] :strip (true) remove unknown keys # # @example # hash :order # @example # hash :order do # object :item # integer :quantity, default: 1 # end end # @private class HashFilter < Filter include Missable register :hash def cast(value, context) case value when Hash value = value.with_indifferent_access initial = strip? ? ActiveSupport::HashWithIndifferentAccess.new : value filters.each_with_object(initial) do |(name, filter), h| clean_value(h, name.to_s, filter, value, context) end else super end end def method_missing(*args, &block) # rubocop:disable Style/MethodMissing super(*args) do |klass, names, options| raise InvalidFilterError, 'missing attribute name' if names.empty? names.each do |name| filters[name] = klass.new(name, options, &block) end end end private def clean_value(h, name, filter, value, context) h[name] = filter.clean(value[name], context) rescue InvalidValueError, MissingValueError raise InvalidNestedValueError.new(name, value[name]) end def raw_default(*) value = super if value.is_a?(Hash) && !value.empty? raise InvalidDefaultError, "#{name}: #{value.inspect}" end value end # @return [Boolean] def strip? options.fetch(:strip, true) end end end
{ "pile_set_name": "Github" }
consistency_checks: - files: - aes256ctr.c - aes256ctr.h - api.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - params.h - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece348864 - files: - aes256ctr.c - aes256ctr.h - api.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - gf.c - gf.h - operations.c - params.h - scalars.inc - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece348864 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - params.h - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece348864f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - gf.c - gf.h - operations.c - params.h - scalars.inc - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece348864f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece460896 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece460896 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece460896f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece460896f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece6688128 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece6688128 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece6688128f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece6688128f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece6960119 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece6960119 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece6960119f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece6960119f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece8192128 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece8192128 - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: clean scheme: mceliece8192128f - files: - aes256ctr.c - aes256ctr.h - controlbits.c - controlbits.h - crypto_hash.h - decrypt.h - encrypt.h - operations.c - sk_gen.c - sk_gen.h source: implementation: vec scheme: mceliece8192128f
{ "pile_set_name": "Github" }
/******************************************************************************* * Copyright 2012-present Pixate, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. ******************************************************************************/ package com.pixate.freestyle.fragment; import android.content.Context; import android.media.AudioManager; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.SeekBar; import com.pixate.freestyle.R; /** * The fragment that displays forms and buttons */ public class ButtonsFragment extends Fragment { /** Seek bar */ SeekBar seekVolum1; // SeekBar seekVolum2; /** Volumn level - set 1 as default */ int m_nAlarmVolum = 1; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_buttons, null); seekVolum1 = (SeekBar) view.findViewById(R.id.seekVolum1); // seekVolum2 = (SeekBar)view.findViewById(R.id.seekVolum2); view.findViewById(R.id.txtLeft).setOnClickListener(mClickListener); view.findViewById(R.id.txtRight).setOnClickListener(mClickListener); setSeekBar(seekVolum1); // setSeekBar(seekVolum2); return view; } /** Set the volumn controling to seek bar */ private void setSeekBar(SeekBar seek) { AudioManager audioManager = (AudioManager) getActivity().getSystemService( Context.AUDIO_SERVICE); seek.setMax(audioManager.getStreamMaxVolume(AudioManager.STREAM_RING)); seek.setProgress(m_nAlarmVolum); seek.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar arg0) { } @Override public void onStartTrackingTouch(SeekBar arg0) { } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean arg2) { m_nAlarmVolum = progress; AudioManager audioManager = (AudioManager) getActivity().getSystemService( Context.AUDIO_SERVICE); audioManager.setStreamVolume(AudioManager.STREAM_RING, m_nAlarmVolum, AudioManager.FLAG_ALLOW_RINGER_MODES | AudioManager.FLAG_PLAY_SOUND); } }); } /** Defined view click listener for buttons and texts */ View.OnClickListener mClickListener = new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.txtLeft: break; case R.id.txtRight: break; } } }; }
{ "pile_set_name": "Github" }
[[table_definition_sql]] [appendix] == Table Definition SQL (Normative) === gpkg_spatial_ref_sys [[gpkg_spatial_ref_sys_sql]] .gpkg_spatial_ref_sys Table Definition SQL [cols=",",style="asciidoc"] [source,sql] ---- CREATE TABLE gpkg_spatial_ref_sys ( srs_name TEXT NOT NULL, srs_id INTEGER PRIMARY KEY, organization TEXT NOT NULL, organization_coordsys_id INTEGER NOT NULL, definition TEXT NOT NULL, description TEXT ); ---- [[sqlmm_gpkg_spatial_ref_sys_sql]] .SQL/MM View of gpkg_spatial_ref_sys Definition SQL (Informative) [cols=","] [source,sql] ---- CREATE VIEW st_spatial_ref_sys AS SELECT srs_name, srs_id, organization, organization_coordsys_id, definition, description FROM gpkg_spatial_ref_sys; ---- [[sfsql_gpkg_spatial_ref_sys_sql]] .SF/SQL View of gpkg_spatial_ref_sys Definition SQL (Informative) [cols=","] [source,sql] ---- CREATE VIEW spatial_ref_sys AS SELECT srs_id AS srid, organization AS auth_name, organization_coordsys_id AS auth_srid, definition AS srtext FROM gpkg_spatial_ref_sys; ---- === gpkg_contents [[gpkg_contents_sql]] .gpkg_contents Table Definition SQL [cols=","] [source,sql] ---- CREATE TABLE gpkg_contents ( table_name TEXT NOT NULL PRIMARY KEY, data_type TEXT NOT NULL, identifier TEXT UNIQUE, description TEXT DEFAULT '', last_change DATETIME NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')), min_x DOUBLE, min_y DOUBLE, max_x DOUBLE, max_y DOUBLE, srs_id INTEGER, CONSTRAINT fk_gc_r_srs_id FOREIGN KEY (srs_id) REFERENCES gpkg_spatial_ref_sys(srs_id) ); ---- === gpkg_geometry_columns [[gpkg_geometry_columns_sql]] .gpkg_geometry_columns Table Definition SQL [cols=","] [source,sql] ---- CREATE TABLE gpkg_geometry_columns ( table_name TEXT NOT NULL, column_name TEXT NOT NULL, geometry_type_name TEXT NOT NULL, srs_id INTEGER NOT NULL, z TINYINT NOT NULL, m TINYINT NOT NULL, CONSTRAINT pk_geom_cols PRIMARY KEY (table_name, column_name), CONSTRAINT uk_gc_table_name UNIQUE (table_name), CONSTRAINT fk_gc_tn FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name), CONSTRAINT fk_gc_srs FOREIGN KEY (srs_id) REFERENCES gpkg_spatial_ref_sys (srs_id) ); ---- [[sqlmm_gpkg_geometry_columns_sql]] .SQL/MM View of gpkg_geometry_columns Definition SQL (Informative) [cols=","] [source,sql] ---- CREATE VIEW st_geometry_columns AS SELECT table_name, column_name, "ST_" || geometry_type_name, g.srs_id, srs_name FROM gpkg_geometry_columns as g JOIN gpkg_spatial_ref_sys AS s WHERE g.srs_id = s.srs_id; ---- [[sfsql_gpkg_geometry_columns_sql]] .SF/SQL VIEW of gpkg_geometry_columns Definition SQL (Informative) [cols=","] [source,sql] ---- CREATE VIEW geometry_columns AS SELECT table_name AS f_table_name, column_name AS f_geometry_column, code4name (geometry_type_name) AS geometry_type, 2 + (CASE z WHEN 1 THEN 1 WHEN 2 THEN 1 ELSE 0 END) + (CASE m WHEN 1 THEN 1 WHEN 2 THEN 1 ELSE 0 END) AS coord_dimension, srs_id AS srid FROM gpkg_geometry_columns; ---- NOTE: Implementer must provide code4name(geometry_type_name) SQL function === sample_feature_table (Informative) [[example_feature_table_sql]] .sample_feature_table Table Definition SQL (Informative) [cols=","] [source,sql] ---- CREATE TABLE sample_feature_table ( id INTEGER PRIMARY KEY AUTOINCREMENT, geometry GEOMETRY, text_attribute TEXT, real_attribute REAL, boolean_attribute BOOLEAN, raster_or_photo BLOB ); ---- === gpkg_tile_matrix_set [[gpkg_tile_matrix_set_sql]] .gpkg_tile_matrix_set Table Creation SQL [cols=","] [source,sql] ---- CREATE TABLE gpkg_tile_matrix_set ( table_name TEXT NOT NULL PRIMARY KEY, srs_id INTEGER NOT NULL, min_x DOUBLE NOT NULL, min_y DOUBLE NOT NULL, max_x DOUBLE NOT NULL, max_y DOUBLE NOT NULL, CONSTRAINT fk_gtms_table_name FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name), CONSTRAINT fk_gtms_srs FOREIGN KEY (srs_id) REFERENCES gpkg_spatial_ref_sys (srs_id) ); ---- === gpkg_tile_matrix [[gpkg_tile_matrix_sql]] .gpkg_tile_matrix Table Creation SQL [cols=","] [source,sql] ---- CREATE TABLE gpkg_tile_matrix ( table_name TEXT NOT NULL, zoom_level INTEGER NOT NULL, matrix_width INTEGER NOT NULL, matrix_height INTEGER NOT NULL, tile_width INTEGER NOT NULL, tile_height INTEGER NOT NULL, pixel_x_size DOUBLE NOT NULL, pixel_y_size DOUBLE NOT NULL, CONSTRAINT pk_ttm PRIMARY KEY (table_name, zoom_level), CONSTRAINT fk_tmm_table_name FOREIGN KEY (table_name) REFERENCES gpkg_contents(table_name) ); ---- [cols=","] .EXAMPLE: gpkg_tile_matrix Insert Statement (Informative) [source,sql] ---- INSERT INTO gpkg_tile_matrix VALUES ( "sample_tile_pyramid", 0, 1, 1, 512, 512, 2.0, 2.0 ); ---- === sample_tile_pyramid (Informative) [[example_tiles_table_sql]] .EXAMPLE: tiles table Create Table SQL (Informative) [cols=","] [source,sql] ---- CREATE TABLE sample_tile_pyramid ( id INTEGER PRIMARY KEY AUTOINCREMENT, zoom_level INTEGER NOT NULL, tile_column INTEGER NOT NULL, tile_row INTEGER NOT NULL, tile_data BLOB NOT NULL, UNIQUE (zoom_level, tile_column, tile_row) ) ---- [[example_tiles_table_insert_sql]] .EXAMPLE: tiles table Insert Statement (Informative) [cols=","] [source,sql] ---- INSERT INTO sample_matrix_pyramid VALUES ( NULL, 1, 1, 1, "BLOB VALUE" ) ---- === gpkg_extensions [[gpkg_extensions_sql]] .gpkg_extensions Table Definition SQL [cols=","] [source,sql] ---- CREATE TABLE gpkg_extensions ( table_name TEXT, column_name TEXT, extension_name TEXT NOT NULL, definition TEXT NOT NULL, scope TEXT NOT NULL, CONSTRAINT ge_tce UNIQUE (table_name, column_name, extension_name) ); ---- === sample_attributes_table (Informative) [[example_attributes_table_sql]] .EXAMPLE: Attributes table Create Table SQL (Informative) [cols=","] [source,sql] ---- CREATE TABLE sample_attributes ( id INTEGER PRIMARY KEY AUTOINCREMENT, text_attribute TEXT, real_attribute REAL, boolean_attribute BOOLEAN, raster_or_photo BLOB ) ---- [[example_attributes_table_insert_sql]] .EXAMPLE: attributes table Insert Statement (Informative) [cols=","] [source,sql] ---- INSERT INTO sample_attributes(text_attribute, real_attribute, boolean_attribute, raster_or_photo) VALUES ( "place", 1, true, "BLOB VALUE" ) ----
{ "pile_set_name": "Github" }
import Locale from 'rmc-calendar/lib/locale/pt_BR'; export default Locale;
{ "pile_set_name": "Github" }
# PLCameraStreamingKit Release Notes for 1.1.4 ## 内容 - [简介](#简介) - [问题反馈](#问题反馈) - [记录](#记录) ## 简介 PLCameraStreamingKit 为 iOS 开发者提供直播推流 SDK。 ## 问题反馈 当你遇到任何问题时,可以通过在 GitHub 的 repo 提交 ```issues``` 来反馈问题,请尽可能的描述清楚遇到的问题,如果有错误信息也一同附带,并且在 ```Labels``` 中指明类型为 bug 或者其他。 [通过这里查看已有的 issues 和提交 Bug](https://github.com/pili-io/PLCameraStreamingKit/issues) ## 记录 ### 音频编码 - 修改了码率和采样率,现在统一使用 128kbps 和 44100KHZ,用以解决噪音的问题 - 之后会再做细分,但会尽可能避免因码率降低导致的噪音出现 ### 网络 - 对 socket 调试情况下出现的 sigpipe 进行了处理,不会再出现 - 更新了网络状态的返回情况,当不是主动调用 close 接口导致的断开都将以 error 状态通知 delegate - 之后会对网络错误具体信息进行返回,暂且缺失
{ "pile_set_name": "Github" }
/////////////////////////////////////////////////////////////////////////// // // logkafka - Collect logs and send lines to Apache Kafka v0.8+ // /////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2015 Qihoo 360 Technology Co., Ltd. All rights reserved. // // Licensed under the MIT 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://opensource.org/licenses/MIT // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // /////////////////////////////////////////////////////////////////////////// #ifndef BASE_MUTEX_H_ #define BASE_MUTEX_H_ #include <errno.h> #include <pthread.h> namespace base { class Mutex { public: Mutex() { if ((pthread_mutex_init(&m_lock, NULL) != 0)) { throw "init spin lock failed!!!"; } } ~Mutex() { pthread_mutex_destroy(&m_lock); } void lock() { pthread_mutex_lock(&m_lock); } void unlock() { pthread_mutex_unlock(&m_lock); } pthread_mutex_t& mutex() { return m_lock; } private: pthread_mutex_t m_lock; }; } // namespace base #endif // BASE_MUTEX_H_
{ "pile_set_name": "Github" }
import { UserManagedProject, UserManagedProjectFilter } from './../models/Project'; import { User, UserFilter, UserInfo } from './../models/User'; import { FFReduxActionName } from './../constants/Config'; import { createFFListActions, extend, createFFObjectActions } from '@tencent/ff-redux'; import * as ActionType from '../constants/ActionType'; import { Cluster, ClusterFilter, RootState } from '../models'; import * as WebAPI from '../WebAPI'; type GetState = () => RootState; /** 集群列表的Actions */ const FFModelUserManagedProjectActions = createFFListActions<UserManagedProject, UserManagedProjectFilter>({ actionName: FFReduxActionName.UserManagedProjects, fetcher: async (query, getState: GetState) => { let response = await WebAPI.fetchUserManagedProjects(query); return response; }, getRecord: (getState: GetState) => { return getState().userManagedProjects; }, onFinish: (record, dispatch, getState: GetState) => {} }); const FFObjectNamespaceCertInfoActions = createFFObjectActions<UserInfo, string>({ actionName: FFReduxActionName.UserInfo, fetcher: async (query, getState: GetState) => { let response = await WebAPI.fetchUserId(query); return response; }, getRecord: (getState: GetState) => { return getState().userInfo; }, onFinish: (record, dispatch, getState: GetState) => { dispatch(FFModelUserManagedProjectActions.applyFilter({ userId: record.data.uid })); } }); export const bussinessActions = { userManagedProject: FFModelUserManagedProjectActions, userInfo: FFObjectNamespaceCertInfoActions, initPlatformType: (platformType: string) => { return async (dispatch: Redux.Dispatch, getState: GetState) => { dispatch({ type: ActionType.PlatformType, payload: platformType }); }; } };
{ "pile_set_name": "Github" }
using Microsoft.Extensions.Logging; using Stryker.Core.Logging; namespace Stryker.Core.Initialisation { public class TimeoutValueCalculator { private ILogger _logger { get; set; } public TimeoutValueCalculator() { _logger = ApplicationLogging.LoggerFactory.CreateLogger<TimeoutValueCalculator>(); } public int CalculateTimeoutValue(int initialTestrunDurationMS, int extraMS) { var timeout = (int)(initialTestrunDurationMS * 1.5) + extraMS; _logger.LogInformation("Using {0} ms as testrun timeout", timeout); return timeout; } } }
{ "pile_set_name": "Github" }
// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // Author: F. Poignant, [email protected] // // file STyclotronPrimaryGeneratorAction.cc #include "STCyclotronPrimaryGeneratorAction.hh" #include "STCyclotronRun.hh" #include "G4RunManager.hh" #include "G4Event.hh" #include "G4GeneralParticleSource.hh" #include "G4ParticleTable.hh" #include "G4ParticleDefinition.hh" #include "G4SystemOfUnits.hh" #include "STCyclotronPrimaryGeneratorActionMessenger.hh" STCyclotronPrimaryGeneratorAction::STCyclotronPrimaryGeneratorAction() : G4VUserPrimaryGeneratorAction() { fMessenger = new STCyclotronPrimaryGeneratorActionMessenger(this); fParticleBeam = new G4GeneralParticleSource(); fBeamCurrent = 10.E-6 ; //ampere; //The rest of the parameters (type of particle, energy, beam shape ..) are defined in the init_beam.vis class. } STCyclotronPrimaryGeneratorAction::~STCyclotronPrimaryGeneratorAction() { delete fMessenger; delete fParticleBeam; } void STCyclotronPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent) { //Set up the number of particles per event G4double timePerEvent = 1.E-11 ; //s; G4double chargeParticle = fParticleBeam->GetParticleDefinition()->GetPDGCharge()*1.6E-19; G4double numberOfPart = std::abs(fBeamCurrent*timePerEvent/chargeParticle); G4String name = fParticleBeam->GetParticleDefinition()->GetParticleName(); G4double energy = fParticleBeam->GetParticleEnergy(); G4int fPrimariesPerEvent = (G4int)numberOfPart; if(fPrimariesPerEvent < 1){ G4cout << "Warning: number of particles per event below 0: " << numberOfPart << G4endl; return; } fParticleBeam->SetNumberOfParticles(fPrimariesPerEvent); fParticleBeam->GeneratePrimaryVertex(anEvent); STCyclotronRun* fRun = static_cast<STCyclotronRun*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun()); fRun->SetPrimariesPerEvent(fPrimariesPerEvent); fRun->SetTimePerEvent(timePerEvent); fRun->SetBeamName(name); fRun->SetBeamCurrent(fBeamCurrent); fRun->SetBeamEnergy(energy); //G4cout << "The new beam current is the following : " << fBeamCurrent << " Ampere." << G4endl; //G4cout << "Particles per event : " << numberOfParticlePerEvent << " particles." << G4endl; } void STCyclotronPrimaryGeneratorAction::SetBeamCurrent(G4double current) { if(fBeamCurrent!=current){ fBeamCurrent=current; G4cout << "The new beam current is the following : " << fBeamCurrent << " Ampere." << G4endl; } }
{ "pile_set_name": "Github" }
Дружбин Вечеслав | Software Engineer, Waves
{ "pile_set_name": "Github" }
# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=5 # ebuild generated by hackport 0.4.5.9999 CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" inherit haskell-cabal DESCRIPTION="Low-level networking interface" HOMEPAGE="https://github.com/haskell/network" SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz" LICENSE="BSD" SLOT="0/${PV}" KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" IUSE="" RDEPEND=">=dev-lang/ghc-7.4.1:= " DEPEND="${RDEPEND} >=dev-haskell/cabal-1.8 test? ( dev-haskell/hunit dev-haskell/test-framework dev-haskell/test-framework-hunit ) "
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!-- _________ _____ __________________ _____ __ ____/___________(_)______ /__ ____/______ ____(_)_______ _ / __ __ ___/__ / _ __ / _ / __ _ __ `/__ / __ __ \ / /_/ / _ / _ / / /_/ / / /_/ / / /_/ / _ / _ / / / \____/ /_/ /_/ \_,__/ \____/ \__,_/ /_/ /_/ /_/ Copyright (C) GridGain Systems. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Version: @xml.file.version --> <!-- GridGain Spring configuration file to startup grid cache. When starting a standalone GridGain node, you need to execute the following command: {GRIDGAIN_HOME}/bin/ggstart.{bat|sh} examples/config/example-cache.xml When starting GridGain from Java IDE, pass path to this file into GridGain: GridGain.start("examples/config/example-cache.xml"); --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <!-- Optional description. --> <description> Spring file for grid configuration with benchmark. </description> <!-- Configuration below demonstrates how to setup caches within grid nodes. --> <bean id="base.grid.cfg" class="org.gridgain.grid.GridConfiguration" abstract="true"> <property name="deploymentMode" value="SHARED"/> <property name="restEnabled" value="false"/> <property name="localHost" ref="localHost"/> <!-- TCP discovery SPI configuration with predefined addresses. Use the addresses list to provide IP addresses of initial nodes in the grid (at least one address must be provided). Note: ===== If running in distributed environment, you should change IP addresses to the actual IP addresses of the servers on your network. Not all addresses need to be specified, only the addresses of one or more servers which will always be started first. --> <property name="discoverySpi" ref="discoSpi"/> </bean> <beans profile="default"> <bean id="localHost" class="java.lang.String"> <constructor-arg value="127.0.0.1"/> </bean> <bean id="discoSpi" class="org.gridgain.grid.spi.discovery.tcp.GridTcpDiscoverySpi"> <property name="ackTimeout" value="5000"/> <property name="socketTimeout" value="5000"/> <property name="reconnectCount" value="5"/> <property name="heartbeatFrequency" value="15000"/> <property name="maxMissedHeartbeats" value="3"/> <property name="ipFinder"> <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.vm.GridTcpDiscoveryVmIpFinder"> <property name="addresses"> <list> <value>127.0.0.1:47500</value> </list> </property> </bean> </property> </bean> </beans> <beans profile="fosters"> <!-- Empty local host value. --> <bean id="localHost" class="java.lang.String"/> <bean id="discoSpi" class="org.gridgain.grid.spi.discovery.tcp.GridTcpDiscoverySpi"> <property name="ipFinder"> <bean class="org.gridgain.grid.spi.discovery.tcp.ipfinder.vm.GridTcpDiscoveryVmIpFinder"> <property name="addresses"> <list> <value>10.1.10.210</value> <value>10.1.10.211</value> <value>10.1.10.212</value> <value>10.1.10.213</value> <value>10.1.10.214</value> <value>10.1.10.215</value> </list> </property> </bean> </property> </bean> </beans> </beans>
{ "pile_set_name": "Github" }
//============== 分页集合========================= //Copyright 2018 何镇汐 //Licensed under the MIT license //================================================ /** * 分页集合 */ export class PagerList<T> { /** * 初始化分页集合 * @param list 分页集合 */ constructor(list?: PagerList<T>) { if (!list) return; this.page = list.page; this.pageSize = list.pageSize; this.totalCount = list.totalCount; this.pageCount = list.pageCount; this.order = list.order; this.data = list.data; } /** * 页索引,即第几页 */ page: number; /** * 每页显示行数 */ pageSize: number; /** * 总行数 */ totalCount: number; /** * 总页数 */ pageCount: number; /** * 排序条件 */ order: string; /** * 数据 */ data: T[]; /** * 初始化行号 */ initLineNumbers(): void { for (let i = 0; i < this.data.length; i++) { let line = (this.page - 1) * this.pageSize + i + 1; this.data[i]["lineNumber"] = line; } } }
{ "pile_set_name": "Github" }
class Foo { transparent inline def foo: Int = try { 1 } finally println("Hello") foo } -----
{ "pile_set_name": "Github" }
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- WScript.Echo("\uFEFFabc".trim()); WScript.Echo("abc\u0009".trim()); WScript.Echo("abc\u000B".trim()); WScript.Echo("abc\u000C".trim()); WScript.Echo("abc\u0020".trim()); WScript.Echo("abc\u00A0".trim()); WScript.Echo("abc\uFFFF".trim() == "abc\uFFFF"); WScript.Echo("\u0009abc\u0009".trim()); WScript.Echo(" \u0009abc \u0009".trim()); WScript.Echo("\u000Babc\u000B".trim()); WScript.Echo("\u000Cabc\u000C".trim()); WScript.Echo("\u0020abc\u0020".trim()); WScript.Echo("\u00A0abc\u00A0".trim()); WScript.Echo("\uFEFFabc\uFEFF".trim()); WScript.Echo("\u0009\u0009".trim() == ""); WScript.Echo("\u000B\u000B".trim() == ""); WScript.Echo("\u000C\u000C".trim() == ""); WScript.Echo("\u0009abc".trim()); WScript.Echo("\u0020\u0020".trim() == ""); WScript.Echo("\u00A0\u00A0".trim() == ""); WScript.Echo("\uFEFF\uFEFF".trim() == ""); WScript.Echo("ab\u0009c".trim()); WScript.Echo("ab\u000Bc".trim()); WScript.Echo("ab\u000Cc".trim()); WScript.Echo("ab\u0020c".trim()); WScript.Echo("ab\u0085c".trim() == "ab\u0085c"); WScript.Echo("\u000Babc".trim()); WScript.Echo("ab\u00A0c".trim() == "ab\u00A0c"); WScript.Echo("ab\u200Bc".trim() == "ab\u200Bc"); WScript.Echo("ab\uFEFFc".trim() == "ab\uFEFFc"); WScript.Echo("\u000Aabc".trim()); WScript.Echo("\u000Dabc".trim()); WScript.Echo("\u2028abc".trim()); WScript.Echo("\u2029abc".trim()); WScript.Echo("abc\u000A".trim()); WScript.Echo("abc\u000D".trim()); WScript.Echo("abc\u2028".trim()); WScript.Echo("\u000Cabc".trim()); WScript.Echo("abc\u2029".trim()); WScript.Echo("\u000Aabc\u000A".trim()); WScript.Echo("\u000Dabc\u000D".trim()); WScript.Echo("\u2028abc\u2028".trim()); WScript.Echo("\u2029abc\u2029".trim()); WScript.Echo("\u000A\u000A".trim() == ""); WScript.Echo("\u2028\u2028".trim() == ""); WScript.Echo("\u000D\u000D".trim() == ""); WScript.Echo("\u2029abc as a multiline string".trim()); WScript.Echo("\u0020abc".trim()); WScript.Echo(" ".trim() == ""); WScript.Echo("\u00A0abc".trim()); WScript.Echo("\uFEFFabc".trimLeft()); WScript.Echo("abc\u0009".trimRight()); WScript.Echo("abc\u000B".trimRight()); WScript.Echo("abc\u000C".trimRight()); WScript.Echo("abc\u0020".trimRight()); WScript.Echo("abc\u00A0".trimRight()); WScript.Echo("abc\uFFFF".trimRight() == "abc\uFFFF"); WScript.Echo("\u0009\u0009".trimLeft() == ""); WScript.Echo("\u0009\u0009".trimRight() == ""); WScript.Echo("\u000B\u000B".trimLeft() == ""); WScript.Echo("\u000C\u000C".trimLeft() == ""); WScript.Echo("\u000B\u000B".trimRight() == ""); WScript.Echo("\u000C\u000C".trimRight() == ""); WScript.Echo("\u0009abc".trimLeft()); WScript.Echo("\u0020\u0020".trimRight() == ""); WScript.Echo("\u00A0\u00A0".trimRight() == ""); WScript.Echo("\uFEFF\uFEFF".trimRight() == ""); WScript.Echo("ab\u0009c".trimRight()); WScript.Echo("ab\u000Bc".trimRight()); WScript.Echo("ab\u000Cc".trimRight()); WScript.Echo("ab\u0020c".trimRight()); WScript.Echo("ab\u0085c".trimRight() == "ab\u0085c"); WScript.Echo("\u000Babc".trimLeft()); WScript.Echo("ab\u00A0c".trimRight() == "ab\u00A0c"); WScript.Echo("ab\u200Bc".trimRight() == "ab\u200Bc"); WScript.Echo("ab\uFEFFc".trimLeft() == "ab\uFEFFc"); WScript.Echo("\u000Aabc".trimLeft()); WScript.Echo("\u000Dabc".trimLeft()); WScript.Echo("\u2028abc".trimLeft()); WScript.Echo("\u2029abc".trimLeft()); WScript.Echo("abc\u000A".trimRight()); WScript.Echo("abc\u000D".trimRight()); WScript.Echo("a\u2028".trimRight()); WScript.Echo("\u000Cabc".trimLeft()); WScript.Echo("abc\u2029".trimRight()); WScript.Echo("\u000A\u000A".trimRight() == ""); WScript.Echo("\u2028\u2028".trimLeft() == ""); WScript.Echo("\u000D\u000D".trimRight() == ""); WScript.Echo("\u2029abc as a multiline string".trimLeft()); WScript.Echo("\u0020abc".trimLeft()); WScript.Echo(" ".trimRight() == ""); WScript.Echo("\u00A0abc".trimLeft()); //implicit calls var a = 1; var b = 2; var obj = {toString: function(){ a=3; return "Hello World";}}; a = b; Object.prototype.split = String.prototype.split; var f = obj.split(); WScript.Echo (a);
{ "pile_set_name": "Github" }
(ns cmr.ous.app.routes.rest.v1 "This namespace defines the Version 1 REST routes provided by this service. Upon idnetifying a particular request as matching a given route, work is then handed off to the relevant request handler function." (:require [cmr.http.kit.app.handler :as core-handler] [cmr.ous.app.handler.collection :as collection-handler] [taoensso.timbre :as log])) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; REST API Routes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn ous-api [httpd-component] [["/service-bridge/ous/collections" { :post {:handler collection-handler/batch-generate ;; XXX CMR-4864, CMR-4863 ;; Protecting collections will be a little different than ;; protecting a single collection, since the concept-id isn't in ;; the path-params. Instead, we'll have to parse the body, ;; extract the concepts ids from that, create an ACL query ;; containing multiple concept ids, and then check those results. ;; :permission #{...?} } :options core-handler/ok}] ["/service-bridge/ous/collection/:concept-id" { :get {:handler (collection-handler/generate-urls httpd-component) :permissions #{:read}} :post {:handler (collection-handler/generate-urls httpd-component) :permissions #{:read}} :options core-handler/ok}] ["/service-bridge/ous/streaming-collection/:concept-id" { :get (collection-handler/stream-urls httpd-component)}]]) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Assembled Routes ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defn all [httpd-component] (ous-api httpd-component))
{ "pile_set_name": "Github" }
// DATA_TEMPLATE: empty_table oTest.fnStart( "oLanguage.sSearch" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "bServerSide": true, "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php" } ); var oSettings = oTable.fnSettings(); oTest.fnWaitTest( "Search language is 'Search:' by default", null, function () { return oSettings.oLanguage.sSearch == "Search:"; } ); oTest.fnTest( "A label input is used", null, function () { return $('label', oSettings.aanFeatures.f[0]).length == 1 } ); oTest.fnTest( "Search language default is in the DOM", null, function () { return $('label', oSettings.aanFeatures.f[0]).text() == "Search: "; } ); oTest.fnWaitTest( "Search language can be defined", function () { oSession.fnRestore(); oTable = $('#example').dataTable( { "bServerSide": true, "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", "oLanguage": { "sSearch": "unit test" } } ); oSettings = oTable.fnSettings(); }, function () { return oSettings.oLanguage.sSearch == "unit test"; } ); oTest.fnTest( "Info language definition is in the DOM", null, function () { return $('label', oSettings.aanFeatures.f[0]).text().indexOf('unit test') !== -1; } ); oTest.fnWaitTest( "Blank search has no space (separator) inserted", function () { oSession.fnRestore(); oTable = $('#example').dataTable( { "bServerSide": true, "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php", "oLanguage": { "sSearch": "" } } ); oSettings = oTable.fnSettings(); }, function () { return document.getElementById('example_filter').childNodes.length == 1; } ); oTest.fnComplete(); } );
{ "pile_set_name": "Github" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>No-Install Quickstart</title> <link rel="stylesheet" href="../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> <link rel="home" href="../index.html" title="Boost.Python"> <link rel="up" href="../building.html" title="Chapter&#160;2.&#160;Building and Testing"> <link rel="prev" href="background.html" title="Background"> <link rel="next" href="installing_boost_python_on_your_.html" title="Installing Boost.Python on your System"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="../images/boost.png"></td></tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="background.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../building.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="installing_boost_python_on_your_.html"><img src="../images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h3 class="title"> <a name="building.no_install_quickstart"></a><a class="link" href="no_install_quickstart.html" title="No-Install Quickstart">No-Install Quickstart</a> </h3></div></div></div> <div class="toc"><dl class="toc"> <dt><span class="section"><a href="no_install_quickstart.html#building.no_install_quickstart.basic_procedure">Basic Procedure</a></span></dt> <dt><span class="section"><a href="no_install_quickstart.html#building.no_install_quickstart.in_case_of_trouble">In Case of Trouble</a></span></dt> <dt><span class="section"><a href="no_install_quickstart.html#building.no_install_quickstart.in_case_everything_seemed_to_wor">In Case Everything Seemed to Work</a></span></dt> <dt><span class="section"><a href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project">Modifying the Example Project</a></span></dt> </dl></div> <p> There is no need to &#8220;install Boost&#8221; in order to get started using Boost.Python. These instructions use <a href="http://www.boost.org/build" target="_top">Boost.Build</a> projects, which will build those binaries as soon as they're needed. Your first tests may take a little longer while you wait for Boost.Python to build, but doing things this way will save you from worrying about build intricacies like which library binaries to use for a specific compiler configuration and figuring out the right compiler options to use yourself. </p> <div class="note"><table border="0" summary="Note"> <tr> <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td> <th align="left">Note</th> </tr> <tr><td align="left" valign="top"> <p> Of course it's possible to use other build systems to build Boost.Python and its extensions, but they are not officially supported by Boost. Moreover <span class="bold"><strong>99% of all &#8220;I can't build Boost.Python&#8221; problems come from trying to use another build system</strong></span> without first following these instructions. </p> <p> If you want to use another system anyway, we suggest that you follow these instructions, and then invoke <code class="computeroutput"><span class="identifier">bjam</span></code> with the </p> <p> <code class="computeroutput"><span class="special">-</span><span class="identifier">a</span> <span class="special">-</span><span class="identifier">o</span></code><span class="emphasis"><em>filename</em></span> </p> <p> options to dump the build commands it executes to a file, so you can see what your alternate build system needs to do. </p> </td></tr> </table></div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="building.no_install_quickstart.basic_procedure"></a><a class="link" href="no_install_quickstart.html#building.no_install_quickstart.basic_procedure" title="Basic Procedure">Basic Procedure</a> </h4></div></div></div> <p> 1. Get Boost; see sections 1 and 2 of the Boost <a href="http://www.boost.org/more/getting_started/" target="_top">Getting Started Guide</a>. </p> <p> 2. Get the <code class="computeroutput"><span class="identifier">bjam</span></code> build driver. See section 5 of the Boost <a href="http://www.boost.org/more/getting_started/" target="_top">Getting Started Guide</a>. </p> <p> 3. cd into the <code class="computeroutput"><span class="identifier">example</span><span class="special">/</span><span class="identifier">quickstart</span><span class="special">/</span></code> directory of your Boost.Python installation, which contains a small example project. </p> <p> 4. Invoke <code class="computeroutput"><span class="identifier">bjam</span></code>. Replace the &#8220;<code class="computeroutput"><span class="identifier">stage</span></code>&#8220; argument from the example invocation from section 5 of the Boost <a href="http://www.boost.org/more/getting_started/" target="_top">Getting Started Guide</a> with &#8220;<code class="computeroutput"><span class="identifier">test</span></code>,&#8220; to build all the test targets. Also add the argument &#8220;<code class="computeroutput"><span class="special">--</span><span class="identifier">verbose</span><span class="special">-</span><span class="identifier">test</span></code>&#8221; to see the output generated by the tests when they are run. On Windows, your <code class="computeroutput"><span class="identifier">bjam</span></code> invocation might look something like: </p> <pre class="programlisting"><span class="identifier">C</span><span class="special">:\\...\\</span><span class="identifier">quickstart</span><span class="special">&gt;</span> <span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">msvc</span> <span class="special">--</span><span class="identifier">verbose</span><span class="special">-</span><span class="identifier">test</span> <span class="identifier">test</span> </pre> <p> and on Unix variants, perhaps, </p> <pre class="programlisting"><span class="special">.../</span><span class="identifier">quickstart</span><span class="error">$</span> <span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">gcc</span> <span class="special">--</span><span class="identifier">verbose</span><span class="special">-</span><span class="identifier">test</span> <span class="identifier">test</span> </pre> <div class="note"><table border="0" summary="Note"> <tr> <td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.png"></td> <th align="left">Note</th> </tr> <tr><td align="left" valign="top"><p> For the sake of concision, the rest of this guide will use unix-style forward slashes in pathnames instead of the backslashes with which Windows users may be more familiar. The forward slashes should work everywhere except in <a href="http://www.boost.org/more/getting_started/windows.html#command-prompt" target="_top">Command Prompt</a> windows, where you should use backslashes. </p></td></tr> </table></div> <p> If you followed this procedure successfully, you will have built an extension module called <code class="computeroutput"><span class="identifier">extending</span></code> and tested it by running a Python script called <code class="computeroutput"><span class="identifier">test_extending</span><span class="special">.</span><span class="identifier">py</span></code>. You will also have built and run a simple application called <code class="computeroutput"><span class="identifier">embedding</span></code> that embeds python. </p> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="building.no_install_quickstart.in_case_of_trouble"></a><a class="link" href="no_install_quickstart.html#building.no_install_quickstart.in_case_of_trouble" title="In Case of Trouble">In Case of Trouble</a> </h4></div></div></div> <p> If you're seeing lots of compiler and/or linker error messages, it's probably because Boost.Build is having trouble finding your Python installation. You might want to pass the <code class="computeroutput"><span class="special">--</span><span class="identifier">debug</span><span class="special">-</span><span class="identifier">configuration</span></code> option to <code class="computeroutput"><span class="identifier">bjam</span></code> the first few times you invoke it, to make sure that Boost.Build is correctly locating all the parts of your Python installation. If it isn't, consider <a class="link" href="configuring_boost_build.html" title="Configuring Boost.Build">Configuring Boost.Build</a> as detailed below. </p> <p> If you're still having trouble, Someone on one of the following mailing lists may be able to help: </p> <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> <li class="listitem"> The <a href="http://www.boost.org/more/mailing_lists.htm#jamboost" target="_top">Boost.Build mailing list</a> for issues related to Boost.Build </li> <li class="listitem"> The <a href="http://www.boost.org/more/mailing_lists.htm#cplussig" target="_top">Boost.Python mailing list</a> for issues specifically related to Boost.Python </li> </ul></div> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="building.no_install_quickstart.in_case_everything_seemed_to_wor"></a><a class="link" href="no_install_quickstart.html#building.no_install_quickstart.in_case_everything_seemed_to_wor" title="In Case Everything Seemed to Work">In Case Everything Seemed to Work</a> </h4></div></div></div> <p> Rejoice! If you're new to Boost.Python, at this point it might be a good idea to ignore build issues for a while and concentrate on learning the library by going through the <a href="../tutorial/index.html" target="_top">Tutorial</a> and perhaps some of the <a href="../reference/index.html" target="_top">Reference Manual</a>, trying out what you've learned about the API by modifying the quickstart project. </p> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="building.no_install_quickstart.modifying_the_example_project"></a><a class="link" href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project" title="Modifying the Example Project">Modifying the Example Project</a> </h4></div></div></div> <div class="toc"><dl class="toc"> <dt><span class="section"><a href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project.relocate_the_project">Relocate the Project</a></span></dt> <dt><span class="section"><a href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project.add_new_or_change_names_of_exist">Add New or Change Names of Existing Source Files</a></span></dt> <dt><span class="section"><a href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project.change_the_name_of_your_extensio">Change the Name of your Extension Module</a></span></dt> </dl></div> <p> If you're content to keep your extension module forever in one source file called <code class="computeroutput"><span class="identifier">extending</span><span class="special">.</span><span class="identifier">cpp</span></code>, inside your Boost.Python distribution, and import it forever as <code class="computeroutput"><span class="identifier">extending</span></code>, then you can stop here. However, it's likely that you will want to make a few changes. There are a few things you can do without having to learn <a href="http://www.boost.org/build" target="_top">Boost.Build</a> in depth. </p> <p> The project you just built is specified in two files in the current directory: <code class="computeroutput"><span class="identifier">boost</span><span class="special">-</span><span class="identifier">build</span><span class="special">.</span><span class="identifier">jam</span></code>, which tells <code class="computeroutput"><span class="identifier">bjam</span></code> where it can find the interpreted code of the Boost build system, and <code class="computeroutput"><span class="identifier">Jamroot</span></code>, which describes the targets you just built. These files are heavily commented, so they should be easy to modify. Take care, however, to preserve whitespace. Punctuation such as <code class="computeroutput"><span class="special">;</span></code> will not be recognized as intended by <code class="computeroutput"><span class="identifier">bjam</span></code> if it is not surrounded by whitespace. </p> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="building.no_install_quickstart.modifying_the_example_project.relocate_the_project"></a><a class="link" href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project.relocate_the_project" title="Relocate the Project">Relocate the Project</a> </h5></div></div></div> <p> You'll probably want to copy this project elsewhere so you can change it without modifying your Boost distribution. To do that, simply </p> <p> a. copy the entire <code class="computeroutput"><span class="identifier">example</span><span class="special">/</span><span class="identifier">quickstart</span><span class="special">/</span></code> directory into a new directory. </p> <p> b. In the new copies of <code class="computeroutput"><span class="identifier">boost</span><span class="special">-</span><span class="identifier">build</span><span class="special">.</span><span class="identifier">jam</span></code> and <code class="computeroutput"><span class="identifier">Jamroot</span></code>, locate the relative path near the top of the file that is clearly marked by a comment, and edit that path so that it refers to the same directory your Boost distribution as it referred to when the file was in its original location in the <code class="computeroutput"><span class="identifier">example</span><span class="special">/</span><span class="identifier">quickstart</span><span class="special">/</span></code> directory. </p> <p> For example, if you moved the project from <code class="computeroutput"><span class="special">/</span><span class="identifier">home</span><span class="special">/</span><span class="identifier">dave</span><span class="special">/</span><span class="identifier">boost_1_34_0</span><span class="special">/</span><span class="identifier">libs</span><span class="special">/</span><span class="identifier">python</span><span class="special">/</span><span class="identifier">example</span><span class="special">/</span><span class="identifier">quickstart</span></code> to <code class="computeroutput"><span class="special">/</span><span class="identifier">home</span><span class="special">/</span><span class="identifier">dave</span><span class="special">/</span><span class="identifier">my</span><span class="special">-</span><span class="identifier">project</span></code>, you could change the first path in <code class="computeroutput"><span class="identifier">boost</span><span class="special">-</span><span class="identifier">build</span><span class="special">.</span><span class="identifier">jam</span></code> from </p> <pre class="programlisting"><span class="special">../../../../</span><span class="identifier">tools</span><span class="special">/</span><span class="identifier">build</span><span class="special">/</span><span class="identifier">src</span> </pre> <p> to </p> <pre class="programlisting"><span class="special">/</span><span class="identifier">home</span><span class="special">/</span><span class="identifier">dave</span><span class="special">/</span><span class="identifier">boost_1_34_0</span><span class="special">/</span><span class="identifier">tools</span><span class="special">/</span><span class="identifier">build</span><span class="special">/</span><span class="identifier">src</span> </pre> <p> and change the first path in <code class="computeroutput"><span class="identifier">Jamroot</span></code> from </p> <pre class="programlisting"><span class="special">../../../..</span> </pre> <p> to </p> <pre class="programlisting"><span class="special">/</span><span class="identifier">home</span><span class="special">/</span><span class="identifier">dave</span><span class="special">/</span><span class="identifier">boost_1_34_0</span> </pre> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="building.no_install_quickstart.modifying_the_example_project.add_new_or_change_names_of_exist"></a><a class="link" href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project.add_new_or_change_names_of_exist" title="Add New or Change Names of Existing Source Files">Add New or Change Names of Existing Source Files</a> </h5></div></div></div> <p> The names of additional source files involved in building your extension module or embedding application can be listed in <code class="computeroutput"><span class="identifier">Jamroot</span></code> right alongside <code class="computeroutput"><span class="identifier">extending</span><span class="special">.</span><span class="identifier">cpp</span></code> or <code class="computeroutput"><span class="identifier">embedding</span><span class="special">.</span><span class="identifier">cpp</span></code> respectively. Just be sure to leave whitespace around each filename: </p> <pre class="programlisting"><span class="error">&#8230;</span> <span class="identifier">file1</span><span class="special">.</span><span class="identifier">cpp</span> <span class="identifier">file2</span><span class="special">.</span><span class="identifier">cpp</span> <span class="identifier">file3</span><span class="special">.</span><span class="identifier">cpp</span> <span class="error">&#8230;</span> </pre> <p> Naturally, if you want to change the name of a source file you can tell Boost.Build about it by editing the name in <code class="computeroutput"><span class="identifier">Jamroot</span></code>. </p> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="building.no_install_quickstart.modifying_the_example_project.change_the_name_of_your_extensio"></a><a class="link" href="no_install_quickstart.html#building.no_install_quickstart.modifying_the_example_project.change_the_name_of_your_extensio" title="Change the Name of your Extension Module">Change the Name of your Extension Module</a> </h5></div></div></div> <p> The name of the extension module is determined by two things: </p> <div class="orderedlist"><ol class="orderedlist" type="1"> <li class="listitem"> the name in <code class="computeroutput"><span class="identifier">Jamroot</span></code> immediately following <code class="computeroutput"><span class="identifier">python</span><span class="special">-</span><span class="identifier">extension</span></code>, and </li> <li class="listitem"> the name passed to <code class="computeroutput"><span class="identifier">BOOST_PYTHON_MODULE</span></code> in <code class="computeroutput"><span class="identifier">extending</span><span class="special">.</span><span class="identifier">cpp</span></code>. </li> </ol></div> <p> To change the name of the extension module from <code class="computeroutput"><span class="identifier">extending</span></code> to <code class="computeroutput"><span class="identifier">hello</span></code>, you'd edit <code class="computeroutput"><span class="identifier">Jamroot</span></code>, changing </p> <pre class="programlisting"><span class="identifier">python</span><span class="special">-</span><span class="identifier">extension</span> <span class="identifier">extending</span> <span class="special">:</span> <span class="identifier">extending</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">;</span> </pre> <p> to </p> <pre class="programlisting"><span class="identifier">python</span><span class="special">-</span><span class="identifier">extension</span> <span class="identifier">hello</span> <span class="special">:</span> <span class="identifier">extending</span><span class="special">.</span><span class="identifier">cpp</span> <span class="special">;</span> </pre> <p> and you'd edit extending.cpp, changing </p> <pre class="programlisting"><span class="identifier">BOOST_PYTHON_MODULE</span><span class="special">(</span><span class="identifier">extending</span><span class="special">)</span> </pre> <p> to </p> <pre class="programlisting"><span class="identifier">BOOST_PYTHON_MODULE</span><span class="special">(</span><span class="identifier">hello</span><span class="special">)</span> </pre> </div> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2002-2015 David Abrahams, Stefan Seefeld<br>Copyright &#169; 2002-2015 David Abrahams, Stefan Seefeld<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="background.html"><img src="../images/prev.png" alt="Prev"></a><a accesskey="u" href="../building.html"><img src="../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../images/home.png" alt="Home"></a><a accesskey="n" href="installing_boost_python_on_your_.html"><img src="../images/next.png" alt="Next"></a> </div> </body> </html>
{ "pile_set_name": "Github" }