text
stringlengths
2
100k
meta
dict
#pragma region License (non-CC) // This source code contains the work of the Independent JPEG Group. // Please see accompanying notice in code comments and/or readme file // for the terms of distribution and use regarding this code. #pragma endregion /* * jcdctmgr.c * * Copyright (C) 1994-1998, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file contains the forward-DCT management logic. * This code selects a particular DCT implementation to be used, * and it performs related housekeeping chores including coefficient * quantization. */ #define JPEG_INTERNALS #include "jinclude8.h" #include "jpeglib8.h" #include "jlossy8.h" /* Private declarations for lossy codec */ #include "jdct8.h" /* Private declarations for DCT subsystem */ /* Private subobject for this module */ typedef struct { /* Pointer to the DCT routine actually in use */ forward_DCT_method_ptr do_dct; /* The actual post-DCT divisors --- not identical to the quant table * entries, because of scaling (especially for an unnormalized DCT). * Each table is given in normal array order. */ DCTELEM * divisors[NUM_QUANT_TBLS]; #ifdef DCT_FLOAT_SUPPORTED /* Same as above for the floating-point case. */ float_DCT_method_ptr do_float_dct; FAST_FLOAT * float_divisors[NUM_QUANT_TBLS]; #endif } fdct_controller; typedef fdct_controller * fdct_ptr; /* * Initialize for a processing pass. * Verify that all referenced Q-tables are present, and set up * the divisor table for each one. * In the current implementation, DCT of all components is done during * the first pass, even if only some components will be output in the * first scan. Hence all components should be examined here. */ METHODDEF(void) start_pass_fdctmgr (j_compress_ptr cinfo) { j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; int ci, qtblno, i; jpeg_component_info *compptr; JQUANT_TBL * qtbl; DCTELEM * dtbl; for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; ci++, compptr++) { qtblno = compptr->quant_tbl_no; /* Make sure specified quantization table is present */ if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS || cinfo->quant_tbl_ptrs[qtblno] == NULL) ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno); qtbl = cinfo->quant_tbl_ptrs[qtblno]; /* Compute divisors for this quant table */ /* We may do this more than once for same table, but it's not a big deal */ switch (cinfo->dct_method) { #ifdef DCT_ISLOW_SUPPORTED case JDCT_ISLOW: /* For LL&M IDCT method, divisors are equal to raw quantization * coefficients multiplied by 8 (to counteract scaling). */ if (fdct->divisors[qtblno] == NULL) { fdct->divisors[qtblno] = (DCTELEM *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, DCTSIZE2 * SIZEOF(DCTELEM)); } dtbl = fdct->divisors[qtblno]; for (i = 0; i < DCTSIZE2; i++) { dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3; } break; #endif #ifdef DCT_IFAST_SUPPORTED case JDCT_IFAST: { /* For AA&N IDCT method, divisors are equal to quantization * coefficients scaled by scalefactor[row]*scalefactor[col], where * scalefactor[0] = 1 * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 * We apply a further scale factor of 8. */ #define CONST_BITS 14 static const INT16 aanscales[DCTSIZE2] = { /* precomputed values scaled up by 14 bits */ 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, 22725, 31521, 29692, 26722, 22725, 17855, 12299, 6270, 21407, 29692, 27969, 25172, 21407, 16819, 11585, 5906, 19266, 26722, 25172, 22654, 19266, 15137, 10426, 5315, 16384, 22725, 21407, 19266, 16384, 12873, 8867, 4520, 12873, 17855, 16819, 15137, 12873, 10114, 6967, 3552, 8867, 12299, 11585, 10426, 8867, 6967, 4799, 2446, 4520, 6270, 5906, 5315, 4520, 3552, 2446, 1247 }; SHIFT_TEMPS if (fdct->divisors[qtblno] == NULL) { fdct->divisors[qtblno] = (DCTELEM *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, DCTSIZE2 * SIZEOF(DCTELEM)); } dtbl = fdct->divisors[qtblno]; for (i = 0; i < DCTSIZE2; i++) { dtbl[i] = (DCTELEM) DESCALE(MULTIPLY16V16((IJG_INT32) qtbl->quantval[i], (IJG_INT32) aanscales[i]), CONST_BITS-3); } } break; #endif #ifdef DCT_FLOAT_SUPPORTED case JDCT_FLOAT: { /* For float AA&N IDCT method, divisors are equal to quantization * coefficients scaled by scalefactor[row]*scalefactor[col], where * scalefactor[0] = 1 * scalefactor[k] = cos(k*PI/16) * sqrt(2) for k=1..7 * We apply a further scale factor of 8. * What's actually stored is 1/divisor so that the inner loop can * use a multiplication rather than a division. */ FAST_FLOAT * fdtbl; int row, col; static const double aanscalefactor[DCTSIZE] = { 1.0, 1.387039845, 1.306562965, 1.175875602, 1.0, 0.785694958, 0.541196100, 0.275899379 }; if (fdct->float_divisors[qtblno] == NULL) { fdct->float_divisors[qtblno] = (FAST_FLOAT *) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, DCTSIZE2 * SIZEOF(FAST_FLOAT)); } fdtbl = fdct->float_divisors[qtblno]; i = 0; for (row = 0; row < DCTSIZE; row++) { for (col = 0; col < DCTSIZE; col++) { fdtbl[i] = (FAST_FLOAT) (1.0 / (((double) qtbl->quantval[i] * aanscalefactor[row] * aanscalefactor[col] * 8.0))); i++; } } } break; #endif default: ERREXIT(cinfo, JERR_NOT_COMPILED); break; } } } /* * Perform forward DCT on one or more blocks of a component. * * The input samples are taken from the sample_data[] array starting at * position start_row/start_col, and moving to the right for any additional * blocks. The quantized coefficients are returned in coef_blocks[]. */ METHODDEF(void) forward_DCT (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks) /* This version is used for integer DCT implementations. */ { /* This routine is heavily used, so it's worth coding it tightly. */ j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; forward_DCT_method_ptr do_dct = fdct->do_dct; DCTELEM * divisors = fdct->divisors[compptr->quant_tbl_no]; DCTELEM workspace[DCTSIZE2]; /* work area for FDCT subroutine */ JDIMENSION bi; sample_data += start_row; /* fold in the vertical offset once */ for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { /* Load data into workspace, applying unsigned->signed conversion */ { register DCTELEM *workspaceptr; register JSAMPROW elemptr; register int elemr; workspaceptr = workspace; for (elemr = 0; elemr < DCTSIZE; elemr++) { elemptr = sample_data[elemr] + start_col; #if DCTSIZE == 8 /* unroll the inner loop */ *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; #else { register int elemc; for (elemc = DCTSIZE; elemc > 0; elemc--) { *workspaceptr++ = GETJSAMPLE(*elemptr++) - CENTERJSAMPLE; } } #endif } } /* Perform the DCT */ (*do_dct) (workspace); /* Quantize/descale the coefficients, and store into coef_blocks[] */ { register DCTELEM temp, qval; register int i; register JCOEFPTR output_ptr = coef_blocks[bi]; for (i = 0; i < DCTSIZE2; i++) { qval = divisors[i]; temp = workspace[i]; /* Divide the coefficient value by qval, ensuring proper rounding. * Since C does not specify the direction of rounding for negative * quotients, we have to force the dividend positive for portability. * * In most files, at least half of the output values will be zero * (at default quantization settings, more like three-quarters...) * so we should ensure that this case is fast. On many machines, * a comparison is enough cheaper than a divide to make a special test * a win. Since both inputs will be nonnegative, we need only test * for a < b to discover whether a/b is 0. * If your machine's division is fast enough, define FAST_DIVIDE. */ #ifdef FAST_DIVIDE #define DIVIDE_BY(a,b) a /= b #else #define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0 #endif if (temp < 0) { temp = -temp; temp += qval>>1; /* for rounding */ DIVIDE_BY(temp, qval); temp = -temp; } else { temp += qval>>1; /* for rounding */ DIVIDE_BY(temp, qval); } output_ptr[i] = (JCOEF) temp; } } } } #ifdef DCT_FLOAT_SUPPORTED METHODDEF(void) forward_DCT_float (j_compress_ptr cinfo, jpeg_component_info * compptr, JSAMPARRAY sample_data, JBLOCKROW coef_blocks, JDIMENSION start_row, JDIMENSION start_col, JDIMENSION num_blocks) /* This version is used for floating-point DCT implementations. */ { /* This routine is heavily used, so it's worth coding it tightly. */ j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; fdct_ptr fdct = (fdct_ptr) lossyc->fdct_private; float_DCT_method_ptr do_dct = fdct->do_float_dct; FAST_FLOAT * divisors = fdct->float_divisors[compptr->quant_tbl_no]; FAST_FLOAT workspace[DCTSIZE2]; /* work area for FDCT subroutine */ JDIMENSION bi; sample_data += start_row; /* fold in the vertical offset once */ for (bi = 0; bi < num_blocks; bi++, start_col += DCTSIZE) { /* Load data into workspace, applying unsigned->signed conversion */ { register FAST_FLOAT *workspaceptr; register JSAMPROW elemptr; register int elemr; workspaceptr = workspace; for (elemr = 0; elemr < DCTSIZE; elemr++) { elemptr = sample_data[elemr] + start_col; #if DCTSIZE == 8 /* unroll the inner loop */ *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); *workspaceptr++ = (FAST_FLOAT)(GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); #else { register int elemc; for (elemc = DCTSIZE; elemc > 0; elemc--) { *workspaceptr++ = (FAST_FLOAT) (GETJSAMPLE(*elemptr++) - CENTERJSAMPLE); } } #endif } } /* Perform the DCT */ (*do_dct) (workspace); /* Quantize/descale the coefficients, and store into coef_blocks[] */ { register FAST_FLOAT temp; register int i; register JCOEFPTR output_ptr = coef_blocks[bi]; for (i = 0; i < DCTSIZE2; i++) { /* Apply the quantization and scaling factor */ temp = workspace[i] * divisors[i]; /* Round to nearest integer. * Since C does not specify the direction of rounding for negative * quotients, we have to force the dividend positive for portability. * The maximum coefficient size is +-16K (for 12-bit data), so this * code should work for either 16-bit or 32-bit ints. */ output_ptr[i] = (JCOEF) ((int) (temp + (FAST_FLOAT) 16384.5) - 16384); } } } } #endif /* DCT_FLOAT_SUPPORTED */ /* * Initialize FDCT manager. */ GLOBAL(void) jinit_forward_dct (j_compress_ptr cinfo) { j_lossy_c_ptr lossyc = (j_lossy_c_ptr) cinfo->codec; fdct_ptr fdct; int i; fdct = (fdct_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, SIZEOF(fdct_controller)); lossyc->fdct_private = (struct jpeg_forward_dct *) fdct; lossyc->fdct_start_pass = start_pass_fdctmgr; switch (cinfo->dct_method) { #ifdef DCT_ISLOW_SUPPORTED case JDCT_ISLOW: lossyc->fdct_forward_DCT = forward_DCT; fdct->do_dct = jpeg_fdct_islow; break; #endif #ifdef DCT_IFAST_SUPPORTED case JDCT_IFAST: lossyc->fdct_forward_DCT = forward_DCT; fdct->do_dct = jpeg_fdct_ifast; break; #endif #ifdef DCT_FLOAT_SUPPORTED case JDCT_FLOAT: lossyc->fdct_forward_DCT = forward_DCT_float; fdct->do_float_dct = jpeg_fdct_float; break; #endif default: ERREXIT(cinfo, JERR_NOT_COMPILED); break; } /* Mark divisor tables unallocated */ for (i = 0; i < NUM_QUANT_TBLS; i++) { fdct->divisors[i] = NULL; #ifdef DCT_FLOAT_SUPPORTED fdct->float_divisors[i] = NULL; #endif } }
{ "pile_set_name": "Github" }
* TLS for `manifests/swarm/docker-swarm.yml` * ruby 2.3.3 + rubygems
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (1.8.0_111) on Mon Oct 22 12:02:26 CST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>接口 com.dtstack.jlogstash.format.OutputFormat的使用 (hdfs 1.0.0 API)</title> <meta name="date" content="2018-10-22"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="\u63A5\u53E3 com.dtstack.jlogstash.format.OutputFormat\u7684\u4F7F\u7528 (hdfs 1.0.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>您的浏览器已禁用 JavaScript。</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../../com/dtstack/jlogstash/format/OutputFormat.html" title="com.dtstack.jlogstash.format中的接口">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../../index-all.html">索引</a></li> <li><a href="../../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/dtstack/jlogstash/format/class-use/OutputFormat.html" target="_top">框架</a></li> <li><a href="OutputFormat.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="接口的使用 com.dtstack.jlogstash.format.OutputFormat" class="title">接口的使用<br>com.dtstack.jlogstash.format.OutputFormat</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表程序包和解释"> <caption><span>使用<a href="../../../../../com/dtstack/jlogstash/format/OutputFormat.html" title="com.dtstack.jlogstash.format中的接口">OutputFormat</a>的程序包</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">程序包</th> <th class="colLast" scope="col">说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#com.dtstack.jlogstash.format">com.dtstack.jlogstash.format</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#com.dtstack.jlogstash.format.plugin">com.dtstack.jlogstash.format.plugin</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="com.dtstack.jlogstash.format"> <!-- --> </a> <h3><a href="../../../../../com/dtstack/jlogstash/format/package-summary.html">com.dtstack.jlogstash.format</a>中<a href="../../../../../com/dtstack/jlogstash/format/OutputFormat.html" title="com.dtstack.jlogstash.format中的接口">OutputFormat</a>的使用</h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表类和解释"> <caption><span>实现<a href="../../../../../com/dtstack/jlogstash/format/OutputFormat.html" title="com.dtstack.jlogstash.format中的接口">OutputFormat</a>的<a href="../../../../../com/dtstack/jlogstash/format/package-summary.html">com.dtstack.jlogstash.format</a>中的类</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">限定符和类型</th> <th class="colLast" scope="col">类和说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/dtstack/jlogstash/format/HdfsOutputFormat.html" title="com.dtstack.jlogstash.format中的类">HdfsOutputFormat</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="com.dtstack.jlogstash.format.plugin"> <!-- --> </a> <h3><a href="../../../../../com/dtstack/jlogstash/format/plugin/package-summary.html">com.dtstack.jlogstash.format.plugin</a>中<a href="../../../../../com/dtstack/jlogstash/format/OutputFormat.html" title="com.dtstack.jlogstash.format中的接口">OutputFormat</a>的使用</h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="使用表, 列表类和解释"> <caption><span>实现<a href="../../../../../com/dtstack/jlogstash/format/OutputFormat.html" title="com.dtstack.jlogstash.format中的接口">OutputFormat</a>的<a href="../../../../../com/dtstack/jlogstash/format/plugin/package-summary.html">com.dtstack.jlogstash.format.plugin</a>中的类</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">限定符和类型</th> <th class="colLast" scope="col">类和说明</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/dtstack/jlogstash/format/plugin/HdfsOrcOutputFormat.html" title="com.dtstack.jlogstash.format.plugin中的类">HdfsOrcOutputFormat</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>class&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../com/dtstack/jlogstash/format/plugin/HdfsTextOutputFormat.html" title="com.dtstack.jlogstash.format.plugin中的类">HdfsTextOutputFormat</a></span></code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../../overview-summary.html">概览</a></li> <li><a href="../package-summary.html">程序包</a></li> <li><a href="../../../../../com/dtstack/jlogstash/format/OutputFormat.html" title="com.dtstack.jlogstash.format中的接口">类</a></li> <li class="navBarCell1Rev">使用</li> <li><a href="../package-tree.html">树</a></li> <li><a href="../../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../../index-all.html">索引</a></li> <li><a href="../../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>上一个</li> <li>下一个</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/dtstack/jlogstash/format/class-use/OutputFormat.html" target="_top">框架</a></li> <li><a href="OutputFormat.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018. All rights reserved.</small></p> </body> </html>
{ "pile_set_name": "Github" }
// @flow import React from "react"; import map from "lodash/map"; import { Trans } from "react-i18next"; import { connect } from "react-redux"; import styled from "styled-components"; import palettes from "~/renderer/styles/palettes"; import { themeSelector } from "~/renderer/actions/general"; import { setTheme } from "~/renderer/actions/settings"; import Text from "~/renderer/components/Text"; import Track from "~/renderer/analytics/Track"; type Props = { setTheme: (?string) => void, currentTheme: string, }; type PictoProps = { palette: any, onClick: () => any, active: boolean, }; const themeLabels = { light: "theme.light", dusk: "theme.dusk", dark: "theme.dark", }; const ThemePictoContainer = styled.div.attrs(p => ({ style: { border: p.active ? `2px solid ${p.theme.colors.palette.primary.main}` : "none", transform: `scale(${p.active ? 1.17 : 1})`, backgroundColor: p.palette.background.paper, cursor: p.active ? "default" : "pointer", }, }))` margin: 16px; border-radius: 6px; display: flex; align-items: center; justify-content: center; height: 52px; width: 52px; transition: transform 300ms ease-in-out; `; const ThemePicto = ({ palette, onClick, active }: PictoProps) => ( <ThemePictoContainer onClick={onClick} active={active} palette={palette}> <svg width="48" height="48"> <defs /> <g fill="none" fillRule="evenodd"> <path fill={palette.type === "light" ? "#000" : "#FFF"} d="M16.2 5c1.1045695 0 2 .8954305 2 2v34.4c0 1.1045695-.8954305 2-2 2H7c-1.1045695 0-2-.8954305-2-2V7c0-1.1045695.8954305-2 2-2h9.2zm25.2 27.0857143c1.1045695 0 2 .8954305 2 2v.8c0 1.1045695-.8954305 2-2 2H25c-1.1045695 0-2-.8954305-2-2v-.8c0-1.1045695.8954305-2 2-2h16.4zm0-8.2285714c1.1045695 0 2 .8954305 2 2v.8c0 1.1045695-.8954305 2-2 2H25c-1.1045695 0-2-.8954305-2-2v-.8c0-1.1045695.8954305-2 2-2h16.4zM41.4 5c1.1045695 0 2 .8954305 2 2v11.4285714c0 1.1045695-.8954305 2-2 2H25c-1.1045695 0-2-.8954305-2-2V7c0-1.1045695.8954305-2 2-2h16.4z" opacity=".16" /> </g> </svg> </ThemePictoContainer> ); const ThemeSelectorContainer = styled.div` display: flex; flex-direction: row; margin-bottom: 40px; `; const ThemeContainer = styled.div` display: flex; flex-direction: column; text-align: center; `; const ThemeName = styled(Text)` transition: color ease-out 300ms; transition-delay: 300ms; cursor: pointer; `; const ThemeSelector = ({ setTheme, currentTheme }: Props) => ( <ThemeSelectorContainer> <Track event="ThemeSelector" onUpdate currentTheme={currentTheme} /> {map(palettes, (palette, paletteName: string) => ( <ThemeContainer key={paletteName} id={paletteName}> <ThemePicto onClick={() => setTheme(paletteName)} active={paletteName === currentTheme} palette={palette} /> <ThemeName ff="Inter|SemiBold" color={paletteName === currentTheme ? "palette.primary.main" : "palette.text.shade80"} fontSize={5} onClick={() => setTheme(paletteName)} > <Trans i18nKey={themeLabels[paletteName]} /> </ThemeName> </ThemeContainer> ))} </ThemeSelectorContainer> ); const mapStateToProps = state => ({ currentTheme: themeSelector(state), }); const ConnectedThemeSelector: React$ComponentType<{}> = connect(mapStateToProps, { setTheme, })(ThemeSelector); export default ConnectedThemeSelector;
{ "pile_set_name": "Github" }
/** * JavaScript Object Oriented Programming Framework * Author: Joseph Huckaby * Copyright (c) 2008 Joseph Huckaby. * Released under the LGPL v3.0: http://www.opensource.org/licenses/lgpl-3.0.html **/ function _var_exists(name) { // return true if var exists in "global" context, false otherwise try { eval('var foo = ' + name + ';'); } catch (e) { return false; } return true; } var Namespace = { // simple namespace support for classes create: function(path) { // create namespace for class var container = null; while (path.match(/^(\w+)\.?/)) { var key = RegExp.$1; path = path.replace(/^(\w+)\.?/, ""); if (!container) { if (!_var_exists(key)) eval('window.' + key + ' = {};'); eval('container = ' + key + ';'); } else { if (!container[key]) container[key] = {}; container = container[key]; } } }, prep: function(name) { // prep namespace for new class if (name.match(/^(.+)\.(\w+)$/)) { var path = RegExp.$1; name = RegExp.$2; Namespace.create(path); } return { name: name }; } }; var Class = { // simple class factory create: function(name, members) { // generate new class with optional namespace // support Prototype-style calling convention if (!name && !members) { return( function() { if (this.initialize) this.initialize.apply(this, arguments); else if (this.__construct) this.__construct.apply(this, arguments); } ); } assert(name, "Must pass name to Class.create"); if (!members) members = {}; members.__parent = null; var ns = Namespace.prep(name); // var container = ns.container; var full_name = name; name = ns.name; members.__name = name; if (!members.__construct) members.__construct = function() {}; // container[name] = members.__construct; var obj = null; eval( full_name + ' = obj = members.__construct;' ); var static_members = members.__static; if (static_members) { for (var key in static_members) { obj[key] = static_members[key]; } } obj.prototype = members; obj.extend = obj.subclass = function(name, members) { Class.subclass( this, name, members ); }; obj.set = obj.add = function(members) { Class.add( this, members ); }; }, subclass: function(parent, name, members) { // subclass an existing class assert(parent, "Must pass parent class to Class.subclass"); assert(name, "Must pass name to Class.subclass"); if (!members) members = {}; members.__name = name; members.__parent = parent.prototype; var ns = Namespace.prep(name); // var container = ns.container; var subname = ns.name; var obj = null; if (members.__construct) { // explicit subclass constructor // container[subname] = members.__construct; eval( name + ' = obj = members.__construct;' ); } else { // inherit parent's constructor var code = parent.toString(); var args = code.substring( code.indexOf("(")+1, code.indexOf(")") ); var inner_code = code.substring( code.indexOf("{")+1, code.lastIndexOf("}") ); eval('members.__construct = ' + name + ' = obj = function ('+args+') {'+inner_code+'};'); } // inherit static from parent, if applicable if (parent.prototype.__static) { for (var key in parent.prototype.__static) { obj[key] = parent.prototype.__static[key]; } } var static_members = members.__static; if (static_members) { for (var key in static_members) { obj[key] = static_members[key]; } } obj.prototype = new parent(); // for (var key in parent.prototype) container[subname].prototype[key] = parent.prototype[key]; for (var key in members) obj.prototype[key] = members[key]; obj.extend = obj.subclass = function(name, members) { Class.subclass( this, name, members ); }; obj.set = obj.add = function(members) { Class.add( this, members ); }; }, add: function(obj, members) { // add members to an existing class for (var key in members) obj.prototype[key] = members[key]; }, require: function() { // make sure classes are loaded for (var idx = 0, len = arguments.length; idx < len; idx++) { assert( !!eval('window.' + arguments[idx]) ); } return true; } }; Class.extend = Class.subclass; Class.set = Class.add; if (!window.assert) window.assert = function(fact, msg) { // very simple assert if (!fact) return alert("ASSERT FAILED! " + msg); return fact; };
{ "pile_set_name": "Github" }
--- title: accept - --- //[detekt-api](../../index.md)/[io.gitlab.arturbosch.detekt.api](../index.md)/[RuleSet](index.md)/[accept](accept.md) # accept [jvm] Brief description Visits given file with all rules of this rule set, returning a list of all code smell findings. Content ~~fun~~ [~~accept~~](accept.md)~~(~~~~file~~~~:~~ KtFile~~,~~ ~~bindingContext~~~~:~~ BindingContext~~)~~~~:~~ [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[Finding](../-finding/index.md)>
{ "pile_set_name": "Github" }
/* vi: set sw=4 ts=4: */ /* * Utility routines. * * Copyright (C) 1999-2004 by Erik Andersen <[email protected]> * * Licensed under GPLv2 or later, see file LICENSE in this source tree. */ #include "libbb.h" #if ENABLE_FEATURE_SYSLOG # include <syslog.h> #endif void FAST_FUNC bb_info_msg(const char *s, ...) { #ifdef THIS_ONE_DOESNT_DO_SINGLE_WRITE va_list p; /* va_copy is used because it is not portable * to use va_list p twice */ va_list p2; va_start(p, s); va_copy(p2, p); if (logmode & LOGMODE_STDIO) { vprintf(s, p); fputs(msg_eol, stdout); } # if ENABLE_FEATURE_SYSLOG if (logmode & LOGMODE_SYSLOG) vsyslog(LOG_INFO, s, p2); # endif va_end(p2); va_end(p); #else int used; char *msg; va_list p; if (logmode == 0) return; va_start(p, s); used = vasprintf(&msg, s, p); va_end(p); if (used < 0) return; # if ENABLE_FEATURE_SYSLOG if (logmode & LOGMODE_SYSLOG) syslog(LOG_INFO, "%s", msg); # endif if (logmode & LOGMODE_STDIO) { fflush_all(); /* used = strlen(msg); - must be true already */ msg[used++] = '\n'; full_write(STDOUT_FILENO, msg, used); } free(msg); #endif }
{ "pile_set_name": "Github" }
package com.ebay.neutrino import com.ebay.neutrino.config.{NeutrinoSettings, VirtualServer} import org.scalatest.{FlatSpec, Matchers} class NeutrinoNodeTest extends FlatSpec with Matchers { it should "provide testing for NeutrinoNode update" in { // TODO } } class NeutrinoNodesTest extends FlatSpec with Matchers with NeutrinoTestSupport { implicit val core = new NeutrinoCore(NeutrinoSettings.Empty) def server(id: String="id", host: String="www.ebay.com", post: Int=80): VirtualServer = VirtualServer(id, host, post) it should "ensure apply() maps to underlying state" in { // TODO } it should "rudmintary test of neutrino-nodes wrapper" in { val nodes = neutrinoNodes() nodes() shouldBe empty // Add a single node nodes.update(server(id="1")) nodes().size should be (1) // Add two nodes nodes.update(server(id="1"), server(id="2")) nodes().size should be (2) nodes() map (_.settings.id.toInt) should be (Seq(1,2)) // Add two nodes nodes.update(server(id="3")) nodes().size should be (1) nodes() map (_.settings.id.toInt) should be (Seq(3)) // Remove all nodes nodes.update() nodes().size should be (0) nodes() map (_.settings.id.toInt) should be (Seq()) } it should "test massive concurrency access for safety" in { // TODO ... } it should "resolve pool by name" in { } }
{ "pile_set_name": "Github" }
好奇心原文链接:[还记得众多男神联手的“罗汉”系列吗?如今女罗汉来了_娱乐_好奇心日报-韩洪刚](https://www.qdaily.com/articles/31549.html) WebArchive归档链接:[还记得众多男神联手的“罗汉”系列吗?如今女罗汉来了_娱乐_好奇心日报-韩洪刚](http://web.archive.org/web/20170726015203/http://www.qdaily.com/articles/31549.html) ![image](http://ww3.sinaimg.cn/large/007d5XDply1g3y8x3g208j30u02pbb29)
{ "pile_set_name": "Github" }
/* * Copyright © 1997-2003 by The XFree86 Project, Inc. * Copyright © 2007 Dave Airlie * Copyright © 2007-2008 Intel Corporation * Jesse Barnes <[email protected]> * Copyright 2005-2006 Luc Verhaegen * Copyright (c) 2001, Andy Ritger [email protected] * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the copyright holder(s) * and author(s) shall not be used in advertising or otherwise to promote * the sale, use or other dealings in this Software without prior written * authorization from the copyright holder(s) and author(s). */ #include <linux/list.h> #include <linux/list_sort.h> #include <linux/export.h> #include <drm/drmP.h> #include <drm/drm_crtc.h> #include <video/of_videomode.h> #include <video/videomode.h> #include <drm/drm_modes.h> #include "drm_crtc_internal.h" /** * drm_mode_debug_printmodeline - print a mode to dmesg * @mode: mode to print * * Describe @mode using DRM_DEBUG. */ void drm_mode_debug_printmodeline(const struct drm_display_mode *mode) { DRM_DEBUG_KMS("Modeline " DRM_MODE_FMT "\n", DRM_MODE_ARG(mode)); } EXPORT_SYMBOL(drm_mode_debug_printmodeline); /** * drm_mode_create - create a new display mode * @dev: DRM device * * Create a new, cleared drm_display_mode with kzalloc, allocate an ID for it * and return it. * * Returns: * Pointer to new mode on success, NULL on error. */ struct drm_display_mode *drm_mode_create(struct drm_device *dev) { struct drm_display_mode *nmode; nmode = kzalloc(sizeof(struct drm_display_mode), GFP_KERNEL); if (!nmode) return NULL; if (drm_mode_object_add(dev, &nmode->base, DRM_MODE_OBJECT_MODE)) { kfree(nmode); return NULL; } return nmode; } EXPORT_SYMBOL(drm_mode_create); /** * drm_mode_destroy - remove a mode * @dev: DRM device * @mode: mode to remove * * Release @mode's unique ID, then free it @mode structure itself using kfree. */ void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode) { if (!mode) return; drm_mode_object_unregister(dev, &mode->base); kfree(mode); } EXPORT_SYMBOL(drm_mode_destroy); /** * drm_mode_probed_add - add a mode to a connector's probed_mode list * @connector: connector the new mode * @mode: mode data * * Add @mode to @connector's probed_mode list for later use. This list should * then in a second step get filtered and all the modes actually supported by * the hardware moved to the @connector's modes list. */ void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode) { WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); list_add_tail(&mode->head, &connector->probed_modes); } EXPORT_SYMBOL(drm_mode_probed_add); /** * drm_cvt_mode -create a modeline based on the CVT algorithm * @dev: drm device * @hdisplay: hdisplay size * @vdisplay: vdisplay size * @vrefresh: vrefresh rate * @reduced: whether to use reduced blanking * @interlaced: whether to compute an interlaced mode * @margins: whether to add margins (borders) * * This function is called to generate the modeline based on CVT algorithm * according to the hdisplay, vdisplay, vrefresh. * It is based from the VESA(TM) Coordinated Video Timing Generator by * Graham Loveridge April 9, 2003 available at * http://www.elo.utfsm.cl/~elo212/docs/CVTd6r1.xls * * And it is copied from xf86CVTmode in xserver/hw/xfree86/modes/xf86cvt.c. * What I have done is to translate it by using integer calculation. * * Returns: * The modeline based on the CVT algorithm stored in a drm_display_mode object. * The display mode object is allocated with drm_mode_create(). Returns NULL * when no mode could be allocated. */ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh, bool reduced, bool interlaced, bool margins) { #define HV_FACTOR 1000 /* 1) top/bottom margin size (% of height) - default: 1.8, */ #define CVT_MARGIN_PERCENTAGE 18 /* 2) character cell horizontal granularity (pixels) - default 8 */ #define CVT_H_GRANULARITY 8 /* 3) Minimum vertical porch (lines) - default 3 */ #define CVT_MIN_V_PORCH 3 /* 4) Minimum number of vertical back porch lines - default 6 */ #define CVT_MIN_V_BPORCH 6 /* Pixel Clock step (kHz) */ #define CVT_CLOCK_STEP 250 struct drm_display_mode *drm_mode; unsigned int vfieldrate, hperiod; int hdisplay_rnd, hmargin, vdisplay_rnd, vmargin, vsync; int interlace; u64 tmp; /* allocate the drm_display_mode structure. If failure, we will * return directly */ drm_mode = drm_mode_create(dev); if (!drm_mode) return NULL; /* the CVT default refresh rate is 60Hz */ if (!vrefresh) vrefresh = 60; /* the required field fresh rate */ if (interlaced) vfieldrate = vrefresh * 2; else vfieldrate = vrefresh; /* horizontal pixels */ hdisplay_rnd = hdisplay - (hdisplay % CVT_H_GRANULARITY); /* determine the left&right borders */ hmargin = 0; if (margins) { hmargin = hdisplay_rnd * CVT_MARGIN_PERCENTAGE / 1000; hmargin -= hmargin % CVT_H_GRANULARITY; } /* find the total active pixels */ drm_mode->hdisplay = hdisplay_rnd + 2 * hmargin; /* find the number of lines per field */ if (interlaced) vdisplay_rnd = vdisplay / 2; else vdisplay_rnd = vdisplay; /* find the top & bottom borders */ vmargin = 0; if (margins) vmargin = vdisplay_rnd * CVT_MARGIN_PERCENTAGE / 1000; drm_mode->vdisplay = vdisplay + 2 * vmargin; /* Interlaced */ if (interlaced) interlace = 1; else interlace = 0; /* Determine VSync Width from aspect ratio */ if (!(vdisplay % 3) && ((vdisplay * 4 / 3) == hdisplay)) vsync = 4; else if (!(vdisplay % 9) && ((vdisplay * 16 / 9) == hdisplay)) vsync = 5; else if (!(vdisplay % 10) && ((vdisplay * 16 / 10) == hdisplay)) vsync = 6; else if (!(vdisplay % 4) && ((vdisplay * 5 / 4) == hdisplay)) vsync = 7; else if (!(vdisplay % 9) && ((vdisplay * 15 / 9) == hdisplay)) vsync = 7; else /* custom */ vsync = 10; if (!reduced) { /* simplify the GTF calculation */ /* 4) Minimum time of vertical sync + back porch interval (µs) * default 550.0 */ int tmp1, tmp2; #define CVT_MIN_VSYNC_BP 550 /* 3) Nominal HSync width (% of line period) - default 8 */ #define CVT_HSYNC_PERCENTAGE 8 unsigned int hblank_percentage; int vsyncandback_porch, vback_porch, hblank; /* estimated the horizontal period */ tmp1 = HV_FACTOR * 1000000 - CVT_MIN_VSYNC_BP * HV_FACTOR * vfieldrate; tmp2 = (vdisplay_rnd + 2 * vmargin + CVT_MIN_V_PORCH) * 2 + interlace; hperiod = tmp1 * 2 / (tmp2 * vfieldrate); tmp1 = CVT_MIN_VSYNC_BP * HV_FACTOR / hperiod + 1; /* 9. Find number of lines in sync + backporch */ if (tmp1 < (vsync + CVT_MIN_V_PORCH)) vsyncandback_porch = vsync + CVT_MIN_V_PORCH; else vsyncandback_porch = tmp1; /* 10. Find number of lines in back porch */ vback_porch = vsyncandback_porch - vsync; drm_mode->vtotal = vdisplay_rnd + 2 * vmargin + vsyncandback_porch + CVT_MIN_V_PORCH; /* 5) Definition of Horizontal blanking time limitation */ /* Gradient (%/kHz) - default 600 */ #define CVT_M_FACTOR 600 /* Offset (%) - default 40 */ #define CVT_C_FACTOR 40 /* Blanking time scaling factor - default 128 */ #define CVT_K_FACTOR 128 /* Scaling factor weighting - default 20 */ #define CVT_J_FACTOR 20 #define CVT_M_PRIME (CVT_M_FACTOR * CVT_K_FACTOR / 256) #define CVT_C_PRIME ((CVT_C_FACTOR - CVT_J_FACTOR) * CVT_K_FACTOR / 256 + \ CVT_J_FACTOR) /* 12. Find ideal blanking duty cycle from formula */ hblank_percentage = CVT_C_PRIME * HV_FACTOR - CVT_M_PRIME * hperiod / 1000; /* 13. Blanking time */ if (hblank_percentage < 20 * HV_FACTOR) hblank_percentage = 20 * HV_FACTOR; hblank = drm_mode->hdisplay * hblank_percentage / (100 * HV_FACTOR - hblank_percentage); hblank -= hblank % (2 * CVT_H_GRANULARITY); /* 14. find the total pixels per line */ drm_mode->htotal = drm_mode->hdisplay + hblank; drm_mode->hsync_end = drm_mode->hdisplay + hblank / 2; drm_mode->hsync_start = drm_mode->hsync_end - (drm_mode->htotal * CVT_HSYNC_PERCENTAGE) / 100; drm_mode->hsync_start += CVT_H_GRANULARITY - drm_mode->hsync_start % CVT_H_GRANULARITY; /* fill the Vsync values */ drm_mode->vsync_start = drm_mode->vdisplay + CVT_MIN_V_PORCH; drm_mode->vsync_end = drm_mode->vsync_start + vsync; } else { /* Reduced blanking */ /* Minimum vertical blanking interval time (µs)- default 460 */ #define CVT_RB_MIN_VBLANK 460 /* Fixed number of clocks for horizontal sync */ #define CVT_RB_H_SYNC 32 /* Fixed number of clocks for horizontal blanking */ #define CVT_RB_H_BLANK 160 /* Fixed number of lines for vertical front porch - default 3*/ #define CVT_RB_VFPORCH 3 int vbilines; int tmp1, tmp2; /* 8. Estimate Horizontal period. */ tmp1 = HV_FACTOR * 1000000 - CVT_RB_MIN_VBLANK * HV_FACTOR * vfieldrate; tmp2 = vdisplay_rnd + 2 * vmargin; hperiod = tmp1 / (tmp2 * vfieldrate); /* 9. Find number of lines in vertical blanking */ vbilines = CVT_RB_MIN_VBLANK * HV_FACTOR / hperiod + 1; /* 10. Check if vertical blanking is sufficient */ if (vbilines < (CVT_RB_VFPORCH + vsync + CVT_MIN_V_BPORCH)) vbilines = CVT_RB_VFPORCH + vsync + CVT_MIN_V_BPORCH; /* 11. Find total number of lines in vertical field */ drm_mode->vtotal = vdisplay_rnd + 2 * vmargin + vbilines; /* 12. Find total number of pixels in a line */ drm_mode->htotal = drm_mode->hdisplay + CVT_RB_H_BLANK; /* Fill in HSync values */ drm_mode->hsync_end = drm_mode->hdisplay + CVT_RB_H_BLANK / 2; drm_mode->hsync_start = drm_mode->hsync_end - CVT_RB_H_SYNC; /* Fill in VSync values */ drm_mode->vsync_start = drm_mode->vdisplay + CVT_RB_VFPORCH; drm_mode->vsync_end = drm_mode->vsync_start + vsync; } /* 15/13. Find pixel clock frequency (kHz for xf86) */ tmp = drm_mode->htotal; /* perform intermediate calcs in u64 */ tmp *= HV_FACTOR * 1000; do_div(tmp, hperiod); tmp -= drm_mode->clock % CVT_CLOCK_STEP; drm_mode->clock = tmp; /* 18/16. Find actual vertical frame frequency */ /* ignore - just set the mode flag for interlaced */ if (interlaced) { drm_mode->vtotal *= 2; drm_mode->flags |= DRM_MODE_FLAG_INTERLACE; } /* Fill the mode line name */ drm_mode_set_name(drm_mode); if (reduced) drm_mode->flags |= (DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC); else drm_mode->flags |= (DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_NHSYNC); return drm_mode; } EXPORT_SYMBOL(drm_cvt_mode); /** * drm_gtf_mode_complex - create the modeline based on the full GTF algorithm * @dev: drm device * @hdisplay: hdisplay size * @vdisplay: vdisplay size * @vrefresh: vrefresh rate. * @interlaced: whether to compute an interlaced mode * @margins: desired margin (borders) size * @GTF_M: extended GTF formula parameters * @GTF_2C: extended GTF formula parameters * @GTF_K: extended GTF formula parameters * @GTF_2J: extended GTF formula parameters * * GTF feature blocks specify C and J in multiples of 0.5, so we pass them * in here multiplied by two. For a C of 40, pass in 80. * * Returns: * The modeline based on the full GTF algorithm stored in a drm_display_mode object. * The display mode object is allocated with drm_mode_create(). Returns NULL * when no mode could be allocated. */ struct drm_display_mode * drm_gtf_mode_complex(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh, bool interlaced, int margins, int GTF_M, int GTF_2C, int GTF_K, int GTF_2J) { /* 1) top/bottom margin size (% of height) - default: 1.8, */ #define GTF_MARGIN_PERCENTAGE 18 /* 2) character cell horizontal granularity (pixels) - default 8 */ #define GTF_CELL_GRAN 8 /* 3) Minimum vertical porch (lines) - default 3 */ #define GTF_MIN_V_PORCH 1 /* width of vsync in lines */ #define V_SYNC_RQD 3 /* width of hsync as % of total line */ #define H_SYNC_PERCENT 8 /* min time of vsync + back porch (microsec) */ #define MIN_VSYNC_PLUS_BP 550 /* C' and M' are part of the Blanking Duty Cycle computation */ #define GTF_C_PRIME ((((GTF_2C - GTF_2J) * GTF_K / 256) + GTF_2J) / 2) #define GTF_M_PRIME (GTF_K * GTF_M / 256) struct drm_display_mode *drm_mode; unsigned int hdisplay_rnd, vdisplay_rnd, vfieldrate_rqd; int top_margin, bottom_margin; int interlace; unsigned int hfreq_est; int vsync_plus_bp, vback_porch; unsigned int vtotal_lines, vfieldrate_est, hperiod; unsigned int vfield_rate, vframe_rate; int left_margin, right_margin; unsigned int total_active_pixels, ideal_duty_cycle; unsigned int hblank, total_pixels, pixel_freq; int hsync, hfront_porch, vodd_front_porch_lines; unsigned int tmp1, tmp2; drm_mode = drm_mode_create(dev); if (!drm_mode) return NULL; /* 1. In order to give correct results, the number of horizontal * pixels requested is first processed to ensure that it is divisible * by the character size, by rounding it to the nearest character * cell boundary: */ hdisplay_rnd = (hdisplay + GTF_CELL_GRAN / 2) / GTF_CELL_GRAN; hdisplay_rnd = hdisplay_rnd * GTF_CELL_GRAN; /* 2. If interlace is requested, the number of vertical lines assumed * by the calculation must be halved, as the computation calculates * the number of vertical lines per field. */ if (interlaced) vdisplay_rnd = vdisplay / 2; else vdisplay_rnd = vdisplay; /* 3. Find the frame rate required: */ if (interlaced) vfieldrate_rqd = vrefresh * 2; else vfieldrate_rqd = vrefresh; /* 4. Find number of lines in Top margin: */ top_margin = 0; if (margins) top_margin = (vdisplay_rnd * GTF_MARGIN_PERCENTAGE + 500) / 1000; /* 5. Find number of lines in bottom margin: */ bottom_margin = top_margin; /* 6. If interlace is required, then set variable interlace: */ if (interlaced) interlace = 1; else interlace = 0; /* 7. Estimate the Horizontal frequency */ { tmp1 = (1000000 - MIN_VSYNC_PLUS_BP * vfieldrate_rqd) / 500; tmp2 = (vdisplay_rnd + 2 * top_margin + GTF_MIN_V_PORCH) * 2 + interlace; hfreq_est = (tmp2 * 1000 * vfieldrate_rqd) / tmp1; } /* 8. Find the number of lines in V sync + back porch */ /* [V SYNC+BP] = RINT(([MIN VSYNC+BP] * hfreq_est / 1000000)) */ vsync_plus_bp = MIN_VSYNC_PLUS_BP * hfreq_est / 1000; vsync_plus_bp = (vsync_plus_bp + 500) / 1000; /* 9. Find the number of lines in V back porch alone: */ vback_porch = vsync_plus_bp - V_SYNC_RQD; /* 10. Find the total number of lines in Vertical field period: */ vtotal_lines = vdisplay_rnd + top_margin + bottom_margin + vsync_plus_bp + GTF_MIN_V_PORCH; /* 11. Estimate the Vertical field frequency: */ vfieldrate_est = hfreq_est / vtotal_lines; /* 12. Find the actual horizontal period: */ hperiod = 1000000 / (vfieldrate_rqd * vtotal_lines); /* 13. Find the actual Vertical field frequency: */ vfield_rate = hfreq_est / vtotal_lines; /* 14. Find the Vertical frame frequency: */ if (interlaced) vframe_rate = vfield_rate / 2; else vframe_rate = vfield_rate; /* 15. Find number of pixels in left margin: */ if (margins) left_margin = (hdisplay_rnd * GTF_MARGIN_PERCENTAGE + 500) / 1000; else left_margin = 0; /* 16.Find number of pixels in right margin: */ right_margin = left_margin; /* 17.Find total number of active pixels in image and left and right */ total_active_pixels = hdisplay_rnd + left_margin + right_margin; /* 18.Find the ideal blanking duty cycle from blanking duty cycle */ ideal_duty_cycle = GTF_C_PRIME * 1000 - (GTF_M_PRIME * 1000000 / hfreq_est); /* 19.Find the number of pixels in the blanking time to the nearest * double character cell: */ hblank = total_active_pixels * ideal_duty_cycle / (100000 - ideal_duty_cycle); hblank = (hblank + GTF_CELL_GRAN) / (2 * GTF_CELL_GRAN); hblank = hblank * 2 * GTF_CELL_GRAN; /* 20.Find total number of pixels: */ total_pixels = total_active_pixels + hblank; /* 21.Find pixel clock frequency: */ pixel_freq = total_pixels * hfreq_est / 1000; /* Stage 1 computations are now complete; I should really pass * the results to another function and do the Stage 2 computations, * but I only need a few more values so I'll just append the * computations here for now */ /* 17. Find the number of pixels in the horizontal sync period: */ hsync = H_SYNC_PERCENT * total_pixels / 100; hsync = (hsync + GTF_CELL_GRAN / 2) / GTF_CELL_GRAN; hsync = hsync * GTF_CELL_GRAN; /* 18. Find the number of pixels in horizontal front porch period */ hfront_porch = hblank / 2 - hsync; /* 36. Find the number of lines in the odd front porch period: */ vodd_front_porch_lines = GTF_MIN_V_PORCH ; /* finally, pack the results in the mode struct */ drm_mode->hdisplay = hdisplay_rnd; drm_mode->hsync_start = hdisplay_rnd + hfront_porch; drm_mode->hsync_end = drm_mode->hsync_start + hsync; drm_mode->htotal = total_pixels; drm_mode->vdisplay = vdisplay_rnd; drm_mode->vsync_start = vdisplay_rnd + vodd_front_porch_lines; drm_mode->vsync_end = drm_mode->vsync_start + V_SYNC_RQD; drm_mode->vtotal = vtotal_lines; drm_mode->clock = pixel_freq; if (interlaced) { drm_mode->vtotal *= 2; drm_mode->flags |= DRM_MODE_FLAG_INTERLACE; } drm_mode_set_name(drm_mode); if (GTF_M == 600 && GTF_2C == 80 && GTF_K == 128 && GTF_2J == 40) drm_mode->flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC; else drm_mode->flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC; return drm_mode; } EXPORT_SYMBOL(drm_gtf_mode_complex); /** * drm_gtf_mode - create the modeline based on the GTF algorithm * @dev: drm device * @hdisplay: hdisplay size * @vdisplay: vdisplay size * @vrefresh: vrefresh rate. * @interlaced: whether to compute an interlaced mode * @margins: desired margin (borders) size * * return the modeline based on GTF algorithm * * This function is to create the modeline based on the GTF algorithm. * Generalized Timing Formula is derived from: * * GTF Spreadsheet by Andy Morrish (1/5/97) * available at http://www.vesa.org * * And it is copied from the file of xserver/hw/xfree86/modes/xf86gtf.c. * What I have done is to translate it by using integer calculation. * I also refer to the function of fb_get_mode in the file of * drivers/video/fbmon.c * * Standard GTF parameters:: * * M = 600 * C = 40 * K = 128 * J = 20 * * Returns: * The modeline based on the GTF algorithm stored in a drm_display_mode object. * The display mode object is allocated with drm_mode_create(). Returns NULL * when no mode could be allocated. */ struct drm_display_mode * drm_gtf_mode(struct drm_device *dev, int hdisplay, int vdisplay, int vrefresh, bool interlaced, int margins) { return drm_gtf_mode_complex(dev, hdisplay, vdisplay, vrefresh, interlaced, margins, 600, 40 * 2, 128, 20 * 2); } EXPORT_SYMBOL(drm_gtf_mode); #ifdef CONFIG_VIDEOMODE_HELPERS /** * drm_display_mode_from_videomode - fill in @dmode using @vm, * @vm: videomode structure to use as source * @dmode: drm_display_mode structure to use as destination * * Fills out @dmode using the display mode specified in @vm. */ void drm_display_mode_from_videomode(const struct videomode *vm, struct drm_display_mode *dmode) { dmode->hdisplay = vm->hactive; dmode->hsync_start = dmode->hdisplay + vm->hfront_porch; dmode->hsync_end = dmode->hsync_start + vm->hsync_len; dmode->htotal = dmode->hsync_end + vm->hback_porch; dmode->vdisplay = vm->vactive; dmode->vsync_start = dmode->vdisplay + vm->vfront_porch; dmode->vsync_end = dmode->vsync_start + vm->vsync_len; dmode->vtotal = dmode->vsync_end + vm->vback_porch; dmode->clock = vm->pixelclock / 1000; dmode->flags = 0; if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) dmode->flags |= DRM_MODE_FLAG_PHSYNC; else if (vm->flags & DISPLAY_FLAGS_HSYNC_LOW) dmode->flags |= DRM_MODE_FLAG_NHSYNC; if (vm->flags & DISPLAY_FLAGS_VSYNC_HIGH) dmode->flags |= DRM_MODE_FLAG_PVSYNC; else if (vm->flags & DISPLAY_FLAGS_VSYNC_LOW) dmode->flags |= DRM_MODE_FLAG_NVSYNC; if (vm->flags & DISPLAY_FLAGS_INTERLACED) dmode->flags |= DRM_MODE_FLAG_INTERLACE; if (vm->flags & DISPLAY_FLAGS_DOUBLESCAN) dmode->flags |= DRM_MODE_FLAG_DBLSCAN; if (vm->flags & DISPLAY_FLAGS_DOUBLECLK) dmode->flags |= DRM_MODE_FLAG_DBLCLK; drm_mode_set_name(dmode); } EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode); /** * drm_display_mode_to_videomode - fill in @vm using @dmode, * @dmode: drm_display_mode structure to use as source * @vm: videomode structure to use as destination * * Fills out @vm using the display mode specified in @dmode. */ void drm_display_mode_to_videomode(const struct drm_display_mode *dmode, struct videomode *vm) { vm->hactive = dmode->hdisplay; vm->hfront_porch = dmode->hsync_start - dmode->hdisplay; vm->hsync_len = dmode->hsync_end - dmode->hsync_start; vm->hback_porch = dmode->htotal - dmode->hsync_end; vm->vactive = dmode->vdisplay; vm->vfront_porch = dmode->vsync_start - dmode->vdisplay; vm->vsync_len = dmode->vsync_end - dmode->vsync_start; vm->vback_porch = dmode->vtotal - dmode->vsync_end; vm->pixelclock = dmode->clock * 1000; vm->flags = 0; if (dmode->flags & DRM_MODE_FLAG_PHSYNC) vm->flags |= DISPLAY_FLAGS_HSYNC_HIGH; else if (dmode->flags & DRM_MODE_FLAG_NHSYNC) vm->flags |= DISPLAY_FLAGS_HSYNC_LOW; if (dmode->flags & DRM_MODE_FLAG_PVSYNC) vm->flags |= DISPLAY_FLAGS_VSYNC_HIGH; else if (dmode->flags & DRM_MODE_FLAG_NVSYNC) vm->flags |= DISPLAY_FLAGS_VSYNC_LOW; if (dmode->flags & DRM_MODE_FLAG_INTERLACE) vm->flags |= DISPLAY_FLAGS_INTERLACED; if (dmode->flags & DRM_MODE_FLAG_DBLSCAN) vm->flags |= DISPLAY_FLAGS_DOUBLESCAN; if (dmode->flags & DRM_MODE_FLAG_DBLCLK) vm->flags |= DISPLAY_FLAGS_DOUBLECLK; } EXPORT_SYMBOL_GPL(drm_display_mode_to_videomode); /** * drm_bus_flags_from_videomode - extract information about pixelclk and * DE polarity from videomode and store it in a separate variable * @vm: videomode structure to use * @bus_flags: information about pixelclk and DE polarity will be stored here * * Sets DRM_BUS_FLAG_DE_(LOW|HIGH) and DRM_BUS_FLAG_PIXDATA_(POS|NEG)EDGE * in @bus_flags according to DISPLAY_FLAGS found in @vm */ void drm_bus_flags_from_videomode(const struct videomode *vm, u32 *bus_flags) { *bus_flags = 0; if (vm->flags & DISPLAY_FLAGS_PIXDATA_POSEDGE) *bus_flags |= DRM_BUS_FLAG_PIXDATA_POSEDGE; if (vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE) *bus_flags |= DRM_BUS_FLAG_PIXDATA_NEGEDGE; if (vm->flags & DISPLAY_FLAGS_DE_LOW) *bus_flags |= DRM_BUS_FLAG_DE_LOW; if (vm->flags & DISPLAY_FLAGS_DE_HIGH) *bus_flags |= DRM_BUS_FLAG_DE_HIGH; } EXPORT_SYMBOL_GPL(drm_bus_flags_from_videomode); #ifdef CONFIG_OF /** * of_get_drm_display_mode - get a drm_display_mode from devicetree * @np: device_node with the timing specification * @dmode: will be set to the return value * @bus_flags: information about pixelclk and DE polarity * @index: index into the list of display timings in devicetree * * This function is expensive and should only be used, if only one mode is to be * read from DT. To get multiple modes start with of_get_display_timings and * work with that instead. * * Returns: * 0 on success, a negative errno code when no of videomode node was found. */ int of_get_drm_display_mode(struct device_node *np, struct drm_display_mode *dmode, u32 *bus_flags, int index) { struct videomode vm; int ret; ret = of_get_videomode(np, &vm, index); if (ret) return ret; drm_display_mode_from_videomode(&vm, dmode); if (bus_flags) drm_bus_flags_from_videomode(&vm, bus_flags); pr_debug("%pOF: got %dx%d display mode from %s\n", np, vm.hactive, vm.vactive, np->name); drm_mode_debug_printmodeline(dmode); return 0; } EXPORT_SYMBOL_GPL(of_get_drm_display_mode); #endif /* CONFIG_OF */ #endif /* CONFIG_VIDEOMODE_HELPERS */ /** * drm_mode_set_name - set the name on a mode * @mode: name will be set in this mode * * Set the name of @mode to a standard format which is <hdisplay>x<vdisplay> * with an optional 'i' suffix for interlaced modes. */ void drm_mode_set_name(struct drm_display_mode *mode) { bool interlaced = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); snprintf(mode->name, DRM_DISPLAY_MODE_LEN, "%dx%d%s", mode->hdisplay, mode->vdisplay, interlaced ? "i" : ""); } EXPORT_SYMBOL(drm_mode_set_name); /** * drm_mode_hsync - get the hsync of a mode * @mode: mode * * Returns: * @modes's hsync rate in kHz, rounded to the nearest integer. Calculates the * value first if it is not yet set. */ int drm_mode_hsync(const struct drm_display_mode *mode) { unsigned int calc_val; if (mode->hsync) return mode->hsync; if (mode->htotal < 0) return 0; calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */ calc_val += 500; /* round to 1000Hz */ calc_val /= 1000; /* truncate to kHz */ return calc_val; } EXPORT_SYMBOL(drm_mode_hsync); /** * drm_mode_vrefresh - get the vrefresh of a mode * @mode: mode * * Returns: * @modes's vrefresh rate in Hz, rounded to the nearest integer. Calculates the * value first if it is not yet set. */ int drm_mode_vrefresh(const struct drm_display_mode *mode) { int refresh = 0; if (mode->vrefresh > 0) refresh = mode->vrefresh; else if (mode->htotal > 0 && mode->vtotal > 0) { unsigned int num, den; num = mode->clock * 1000; den = mode->htotal * mode->vtotal; if (mode->flags & DRM_MODE_FLAG_INTERLACE) num *= 2; if (mode->flags & DRM_MODE_FLAG_DBLSCAN) den *= 2; if (mode->vscan > 1) den *= mode->vscan; refresh = DIV_ROUND_CLOSEST(num, den); } return refresh; } EXPORT_SYMBOL(drm_mode_vrefresh); /** * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode * @mode: mode to query * @hdisplay: hdisplay value to fill in * @vdisplay: vdisplay value to fill in * * The vdisplay value will be doubled if the specified mode is a stereo mode of * the appropriate layout. */ void drm_mode_get_hv_timing(const struct drm_display_mode *mode, int *hdisplay, int *vdisplay) { struct drm_display_mode adjusted = *mode; drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY); *hdisplay = adjusted.crtc_hdisplay; *vdisplay = adjusted.crtc_vdisplay; } EXPORT_SYMBOL(drm_mode_get_hv_timing); /** * drm_mode_set_crtcinfo - set CRTC modesetting timing parameters * @p: mode * @adjust_flags: a combination of adjustment flags * * Setup the CRTC modesetting timing parameters for @p, adjusting if necessary. * * - The CRTC_INTERLACE_HALVE_V flag can be used to halve vertical timings of * interlaced modes. * - The CRTC_STEREO_DOUBLE flag can be used to compute the timings for * buffers containing two eyes (only adjust the timings when needed, eg. for * "frame packing" or "side by side full"). * - The CRTC_NO_DBLSCAN and CRTC_NO_VSCAN flags request that adjustment *not* * be performed for doublescan and vscan > 1 modes respectively. */ void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags) { if (!p) return; p->crtc_clock = p->clock; p->crtc_hdisplay = p->hdisplay; p->crtc_hsync_start = p->hsync_start; p->crtc_hsync_end = p->hsync_end; p->crtc_htotal = p->htotal; p->crtc_hskew = p->hskew; p->crtc_vdisplay = p->vdisplay; p->crtc_vsync_start = p->vsync_start; p->crtc_vsync_end = p->vsync_end; p->crtc_vtotal = p->vtotal; if (p->flags & DRM_MODE_FLAG_INTERLACE) { if (adjust_flags & CRTC_INTERLACE_HALVE_V) { p->crtc_vdisplay /= 2; p->crtc_vsync_start /= 2; p->crtc_vsync_end /= 2; p->crtc_vtotal /= 2; } } if (!(adjust_flags & CRTC_NO_DBLSCAN)) { if (p->flags & DRM_MODE_FLAG_DBLSCAN) { p->crtc_vdisplay *= 2; p->crtc_vsync_start *= 2; p->crtc_vsync_end *= 2; p->crtc_vtotal *= 2; } } if (!(adjust_flags & CRTC_NO_VSCAN)) { if (p->vscan > 1) { p->crtc_vdisplay *= p->vscan; p->crtc_vsync_start *= p->vscan; p->crtc_vsync_end *= p->vscan; p->crtc_vtotal *= p->vscan; } } if (adjust_flags & CRTC_STEREO_DOUBLE) { unsigned int layout = p->flags & DRM_MODE_FLAG_3D_MASK; switch (layout) { case DRM_MODE_FLAG_3D_FRAME_PACKING: p->crtc_clock *= 2; p->crtc_vdisplay += p->crtc_vtotal; p->crtc_vsync_start += p->crtc_vtotal; p->crtc_vsync_end += p->crtc_vtotal; p->crtc_vtotal += p->crtc_vtotal; break; } } p->crtc_vblank_start = min(p->crtc_vsync_start, p->crtc_vdisplay); p->crtc_vblank_end = max(p->crtc_vsync_end, p->crtc_vtotal); p->crtc_hblank_start = min(p->crtc_hsync_start, p->crtc_hdisplay); p->crtc_hblank_end = max(p->crtc_hsync_end, p->crtc_htotal); } EXPORT_SYMBOL(drm_mode_set_crtcinfo); /** * drm_mode_copy - copy the mode * @dst: mode to overwrite * @src: mode to copy * * Copy an existing mode into another mode, preserving the object id and * list head of the destination mode. */ void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src) { int id = dst->base.id; struct list_head head = dst->head; *dst = *src; dst->base.id = id; dst->head = head; } EXPORT_SYMBOL(drm_mode_copy); /** * drm_mode_duplicate - allocate and duplicate an existing mode * @dev: drm_device to allocate the duplicated mode for * @mode: mode to duplicate * * Just allocate a new mode, copy the existing mode into it, and return * a pointer to it. Used to create new instances of established modes. * * Returns: * Pointer to duplicated mode on success, NULL on error. */ struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, const struct drm_display_mode *mode) { struct drm_display_mode *nmode; nmode = drm_mode_create(dev); if (!nmode) return NULL; drm_mode_copy(nmode, mode); return nmode; } EXPORT_SYMBOL(drm_mode_duplicate); /** * drm_mode_equal - test modes for equality * @mode1: first mode * @mode2: second mode * * Check to see if @mode1 and @mode2 are equivalent. * * Returns: * True if the modes are equal, false otherwise. */ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) { if (!mode1 && !mode2) return true; if (!mode1 || !mode2) return false; /* do clock check convert to PICOS so fb modes get matched * the same */ if (mode1->clock && mode2->clock) { if (KHZ2PICOS(mode1->clock) != KHZ2PICOS(mode2->clock)) return false; } else if (mode1->clock != mode2->clock) return false; return drm_mode_equal_no_clocks(mode1, mode2); } EXPORT_SYMBOL(drm_mode_equal); /** * drm_mode_equal_no_clocks - test modes for equality * @mode1: first mode * @mode2: second mode * * Check to see if @mode1 and @mode2 are equivalent, but * don't check the pixel clocks. * * Returns: * True if the modes are equal, false otherwise. */ bool drm_mode_equal_no_clocks(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) { if ((mode1->flags & DRM_MODE_FLAG_3D_MASK) != (mode2->flags & DRM_MODE_FLAG_3D_MASK)) return false; return drm_mode_equal_no_clocks_no_stereo(mode1, mode2); } EXPORT_SYMBOL(drm_mode_equal_no_clocks); /** * drm_mode_equal_no_clocks_no_stereo - test modes for equality * @mode1: first mode * @mode2: second mode * * Check to see if @mode1 and @mode2 are equivalent, but * don't check the pixel clocks nor the stereo layout. * * Returns: * True if the modes are equal, false otherwise. */ bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2) { if (mode1->hdisplay == mode2->hdisplay && mode1->hsync_start == mode2->hsync_start && mode1->hsync_end == mode2->hsync_end && mode1->htotal == mode2->htotal && mode1->hskew == mode2->hskew && mode1->vdisplay == mode2->vdisplay && mode1->vsync_start == mode2->vsync_start && mode1->vsync_end == mode2->vsync_end && mode1->vtotal == mode2->vtotal && mode1->vscan == mode2->vscan && (mode1->flags & ~DRM_MODE_FLAG_3D_MASK) == (mode2->flags & ~DRM_MODE_FLAG_3D_MASK)) return true; return false; } EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo); static enum drm_mode_status drm_mode_validate_basic(const struct drm_display_mode *mode) { if (mode->type & ~DRM_MODE_TYPE_ALL) return MODE_BAD; if (mode->flags & ~DRM_MODE_FLAG_ALL) return MODE_BAD; if ((mode->flags & DRM_MODE_FLAG_3D_MASK) > DRM_MODE_FLAG_3D_MAX) return MODE_BAD; if (mode->clock == 0) return MODE_CLOCK_LOW; if (mode->hdisplay == 0 || mode->hsync_start < mode->hdisplay || mode->hsync_end < mode->hsync_start || mode->htotal < mode->hsync_end) return MODE_H_ILLEGAL; if (mode->vdisplay == 0 || mode->vsync_start < mode->vdisplay || mode->vsync_end < mode->vsync_start || mode->vtotal < mode->vsync_end) return MODE_V_ILLEGAL; return MODE_OK; } /** * drm_mode_validate_driver - make sure the mode is somewhat sane * @dev: drm device * @mode: mode to check * * First do basic validation on the mode, and then allow the driver * to check for device/driver specific limitations via the optional * &drm_mode_config_helper_funcs.mode_valid hook. * * Returns: * The mode status */ enum drm_mode_status drm_mode_validate_driver(struct drm_device *dev, const struct drm_display_mode *mode) { enum drm_mode_status status; status = drm_mode_validate_basic(mode); if (status != MODE_OK) return status; if (dev->mode_config.funcs->mode_valid) return dev->mode_config.funcs->mode_valid(dev, mode); else return MODE_OK; } EXPORT_SYMBOL(drm_mode_validate_driver); /** * drm_mode_validate_size - make sure modes adhere to size constraints * @mode: mode to check * @maxX: maximum width * @maxY: maximum height * * This function is a helper which can be used to validate modes against size * limitations of the DRM device/connector. If a mode is too big its status * member is updated with the appropriate validation failure code. The list * itself is not changed. * * Returns: * The mode status */ enum drm_mode_status drm_mode_validate_size(const struct drm_display_mode *mode, int maxX, int maxY) { if (maxX > 0 && mode->hdisplay > maxX) return MODE_VIRTUAL_X; if (maxY > 0 && mode->vdisplay > maxY) return MODE_VIRTUAL_Y; return MODE_OK; } EXPORT_SYMBOL(drm_mode_validate_size); /** * drm_mode_validate_ycbcr420 - add 'ycbcr420-only' modes only when allowed * @mode: mode to check * @connector: drm connector under action * * This function is a helper which can be used to filter out any YCBCR420 * only mode, when the source doesn't support it. * * Returns: * The mode status */ enum drm_mode_status drm_mode_validate_ycbcr420(const struct drm_display_mode *mode, struct drm_connector *connector) { u8 vic = drm_match_cea_mode(mode); enum drm_mode_status status = MODE_OK; struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; if (test_bit(vic, hdmi->y420_vdb_modes)) { if (!connector->ycbcr_420_allowed) status = MODE_NO_420; } return status; } EXPORT_SYMBOL(drm_mode_validate_ycbcr420); #define MODE_STATUS(status) [MODE_ ## status + 3] = #status static const char * const drm_mode_status_names[] = { MODE_STATUS(OK), MODE_STATUS(HSYNC), MODE_STATUS(VSYNC), MODE_STATUS(H_ILLEGAL), MODE_STATUS(V_ILLEGAL), MODE_STATUS(BAD_WIDTH), MODE_STATUS(NOMODE), MODE_STATUS(NO_INTERLACE), MODE_STATUS(NO_DBLESCAN), MODE_STATUS(NO_VSCAN), MODE_STATUS(MEM), MODE_STATUS(VIRTUAL_X), MODE_STATUS(VIRTUAL_Y), MODE_STATUS(MEM_VIRT), MODE_STATUS(NOCLOCK), MODE_STATUS(CLOCK_HIGH), MODE_STATUS(CLOCK_LOW), MODE_STATUS(CLOCK_RANGE), MODE_STATUS(BAD_HVALUE), MODE_STATUS(BAD_VVALUE), MODE_STATUS(BAD_VSCAN), MODE_STATUS(HSYNC_NARROW), MODE_STATUS(HSYNC_WIDE), MODE_STATUS(HBLANK_NARROW), MODE_STATUS(HBLANK_WIDE), MODE_STATUS(VSYNC_NARROW), MODE_STATUS(VSYNC_WIDE), MODE_STATUS(VBLANK_NARROW), MODE_STATUS(VBLANK_WIDE), MODE_STATUS(PANEL), MODE_STATUS(INTERLACE_WIDTH), MODE_STATUS(ONE_WIDTH), MODE_STATUS(ONE_HEIGHT), MODE_STATUS(ONE_SIZE), MODE_STATUS(NO_REDUCED), MODE_STATUS(NO_STEREO), MODE_STATUS(NO_420), MODE_STATUS(STALE), MODE_STATUS(BAD), MODE_STATUS(ERROR), }; #undef MODE_STATUS static const char *drm_get_mode_status_name(enum drm_mode_status status) { int index = status + 3; if (WARN_ON(index < 0 || index >= ARRAY_SIZE(drm_mode_status_names))) return ""; return drm_mode_status_names[index]; } /** * drm_mode_prune_invalid - remove invalid modes from mode list * @dev: DRM device * @mode_list: list of modes to check * @verbose: be verbose about it * * This helper function can be used to prune a display mode list after * validation has been completed. All modes who's status is not MODE_OK will be * removed from the list, and if @verbose the status code and mode name is also * printed to dmesg. */ void drm_mode_prune_invalid(struct drm_device *dev, struct list_head *mode_list, bool verbose) { struct drm_display_mode *mode, *t; list_for_each_entry_safe(mode, t, mode_list, head) { if (mode->status != MODE_OK) { list_del(&mode->head); if (verbose) { drm_mode_debug_printmodeline(mode); DRM_DEBUG_KMS("Not using %s mode: %s\n", mode->name, drm_get_mode_status_name(mode->status)); } drm_mode_destroy(dev, mode); } } } EXPORT_SYMBOL(drm_mode_prune_invalid); /** * drm_mode_compare - compare modes for favorability * @priv: unused * @lh_a: list_head for first mode * @lh_b: list_head for second mode * * Compare two modes, given by @lh_a and @lh_b, returning a value indicating * which is better. * * Returns: * Negative if @lh_a is better than @lh_b, zero if they're equivalent, or * positive if @lh_b is better than @lh_a. */ static int drm_mode_compare(void *priv, struct list_head *lh_a, struct list_head *lh_b) { struct drm_display_mode *a = list_entry(lh_a, struct drm_display_mode, head); struct drm_display_mode *b = list_entry(lh_b, struct drm_display_mode, head); int diff; diff = ((b->type & DRM_MODE_TYPE_PREFERRED) != 0) - ((a->type & DRM_MODE_TYPE_PREFERRED) != 0); if (diff) return diff; diff = b->hdisplay * b->vdisplay - a->hdisplay * a->vdisplay; if (diff) return diff; diff = b->vrefresh - a->vrefresh; if (diff) return diff; diff = b->clock - a->clock; return diff; } /** * drm_mode_sort - sort mode list * @mode_list: list of drm_display_mode structures to sort * * Sort @mode_list by favorability, moving good modes to the head of the list. */ void drm_mode_sort(struct list_head *mode_list) { list_sort(NULL, mode_list, drm_mode_compare); } EXPORT_SYMBOL(drm_mode_sort); /** * drm_mode_connector_list_update - update the mode list for the connector * @connector: the connector to update * * This moves the modes from the @connector probed_modes list * to the actual mode list. It compares the probed mode against the current * list and only adds different/new modes. * * This is just a helper functions doesn't validate any modes itself and also * doesn't prune any invalid modes. Callers need to do that themselves. */ void drm_mode_connector_list_update(struct drm_connector *connector) { struct drm_display_mode *pmode, *pt; WARN_ON(!mutex_is_locked(&connector->dev->mode_config.mutex)); list_for_each_entry_safe(pmode, pt, &connector->probed_modes, head) { struct drm_display_mode *mode; bool found_it = false; /* go through current modes checking for the new probed mode */ list_for_each_entry(mode, &connector->modes, head) { if (!drm_mode_equal(pmode, mode)) continue; found_it = true; /* * If the old matching mode is stale (ie. left over * from a previous probe) just replace it outright. * Otherwise just merge the type bits between all * equal probed modes. * * If two probed modes are considered equal, pick the * actual timings from the one that's marked as * preferred (in case the match isn't 100%). If * multiple or zero preferred modes are present, favor * the mode added to the probed_modes list first. */ if (mode->status == MODE_STALE) { drm_mode_copy(mode, pmode); } else if ((mode->type & DRM_MODE_TYPE_PREFERRED) == 0 && (pmode->type & DRM_MODE_TYPE_PREFERRED) != 0) { pmode->type |= mode->type; drm_mode_copy(mode, pmode); } else { mode->type |= pmode->type; } list_del(&pmode->head); drm_mode_destroy(connector->dev, pmode); break; } if (!found_it) { list_move_tail(&pmode->head, &connector->modes); } } } EXPORT_SYMBOL(drm_mode_connector_list_update); /** * drm_mode_parse_command_line_for_connector - parse command line modeline for connector * @mode_option: optional per connector mode option * @connector: connector to parse modeline for * @mode: preallocated drm_cmdline_mode structure to fill out * * This parses @mode_option command line modeline for modes and options to * configure the connector. If @mode_option is NULL the default command line * modeline in fb_mode_option will be parsed instead. * * This uses the same parameters as the fb modedb.c, except for an extra * force-enable, force-enable-digital and force-disable bit at the end:: * * <xres>x<yres>[M][R][-<bpp>][@<refresh>][i][m][eDd] * * The intermediate drm_cmdline_mode structure is required to store additional * options from the command line modline like the force-enable/disable flag. * * Returns: * True if a valid modeline has been parsed, false otherwise. */ bool drm_mode_parse_command_line_for_connector(const char *mode_option, struct drm_connector *connector, struct drm_cmdline_mode *mode) { const char *name; unsigned int namelen; bool res_specified = false, bpp_specified = false, refresh_specified = false; unsigned int xres = 0, yres = 0, bpp = 32, refresh = 0; bool yres_specified = false, cvt = false, rb = false; bool interlace = false, margins = false, was_digit = false; int i; enum drm_connector_force force = DRM_FORCE_UNSPECIFIED; #ifdef CONFIG_FB if (!mode_option) mode_option = fb_mode_option; #endif if (!mode_option) { mode->specified = false; return false; } name = mode_option; namelen = strlen(name); for (i = namelen-1; i >= 0; i--) { switch (name[i]) { case '@': if (!refresh_specified && !bpp_specified && !yres_specified && !cvt && !rb && was_digit) { refresh = simple_strtol(&name[i+1], NULL, 10); refresh_specified = true; was_digit = false; } else goto done; break; case '-': if (!bpp_specified && !yres_specified && !cvt && !rb && was_digit) { bpp = simple_strtol(&name[i+1], NULL, 10); bpp_specified = true; was_digit = false; } else goto done; break; case 'x': if (!yres_specified && was_digit) { yres = simple_strtol(&name[i+1], NULL, 10); yres_specified = true; was_digit = false; } else goto done; break; case '0' ... '9': was_digit = true; break; case 'M': if (yres_specified || cvt || was_digit) goto done; cvt = true; break; case 'R': if (yres_specified || cvt || rb || was_digit) goto done; rb = true; break; case 'm': if (cvt || yres_specified || was_digit) goto done; margins = true; break; case 'i': if (cvt || yres_specified || was_digit) goto done; interlace = true; break; case 'e': if (yres_specified || bpp_specified || refresh_specified || was_digit || (force != DRM_FORCE_UNSPECIFIED)) goto done; force = DRM_FORCE_ON; break; case 'D': if (yres_specified || bpp_specified || refresh_specified || was_digit || (force != DRM_FORCE_UNSPECIFIED)) goto done; if ((connector->connector_type != DRM_MODE_CONNECTOR_DVII) && (connector->connector_type != DRM_MODE_CONNECTOR_HDMIB)) force = DRM_FORCE_ON; else force = DRM_FORCE_ON_DIGITAL; break; case 'd': if (yres_specified || bpp_specified || refresh_specified || was_digit || (force != DRM_FORCE_UNSPECIFIED)) goto done; force = DRM_FORCE_OFF; break; default: goto done; } } if (i < 0 && yres_specified) { char *ch; xres = simple_strtol(name, &ch, 10); if ((ch != NULL) && (*ch == 'x')) res_specified = true; else i = ch - name; } else if (!yres_specified && was_digit) { /* catch mode that begins with digits but has no 'x' */ i = 0; } done: if (i >= 0) { pr_warn("[drm] parse error at position %i in video mode '%s'\n", i, name); mode->specified = false; return false; } if (res_specified) { mode->specified = true; mode->xres = xres; mode->yres = yres; } if (refresh_specified) { mode->refresh_specified = true; mode->refresh = refresh; } if (bpp_specified) { mode->bpp_specified = true; mode->bpp = bpp; } mode->rb = rb; mode->cvt = cvt; mode->interlace = interlace; mode->margins = margins; mode->force = force; return true; } EXPORT_SYMBOL(drm_mode_parse_command_line_for_connector); /** * drm_mode_create_from_cmdline_mode - convert a command line modeline into a DRM display mode * @dev: DRM device to create the new mode for * @cmd: input command line modeline * * Returns: * Pointer to converted mode on success, NULL on error. */ struct drm_display_mode * drm_mode_create_from_cmdline_mode(struct drm_device *dev, struct drm_cmdline_mode *cmd) { struct drm_display_mode *mode; if (cmd->cvt) mode = drm_cvt_mode(dev, cmd->xres, cmd->yres, cmd->refresh_specified ? cmd->refresh : 60, cmd->rb, cmd->interlace, cmd->margins); else mode = drm_gtf_mode(dev, cmd->xres, cmd->yres, cmd->refresh_specified ? cmd->refresh : 60, cmd->interlace, cmd->margins); if (!mode) return NULL; mode->type |= DRM_MODE_TYPE_USERDEF; /* fix up 1368x768: GFT/CVT can't express 1366 width due to alignment */ if (cmd->xres == 1366) drm_mode_fixup_1366x768(mode); drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); return mode; } EXPORT_SYMBOL(drm_mode_create_from_cmdline_mode); /** * drm_crtc_convert_to_umode - convert a drm_display_mode into a modeinfo * @out: drm_mode_modeinfo struct to return to the user * @in: drm_display_mode to use * * Convert a drm_display_mode into a drm_mode_modeinfo structure to return to * the user. */ void drm_mode_convert_to_umode(struct drm_mode_modeinfo *out, const struct drm_display_mode *in) { WARN(in->hdisplay > USHRT_MAX || in->hsync_start > USHRT_MAX || in->hsync_end > USHRT_MAX || in->htotal > USHRT_MAX || in->hskew > USHRT_MAX || in->vdisplay > USHRT_MAX || in->vsync_start > USHRT_MAX || in->vsync_end > USHRT_MAX || in->vtotal > USHRT_MAX || in->vscan > USHRT_MAX, "timing values too large for mode info\n"); out->clock = in->clock; out->hdisplay = in->hdisplay; out->hsync_start = in->hsync_start; out->hsync_end = in->hsync_end; out->htotal = in->htotal; out->hskew = in->hskew; out->vdisplay = in->vdisplay; out->vsync_start = in->vsync_start; out->vsync_end = in->vsync_end; out->vtotal = in->vtotal; out->vscan = in->vscan; out->vrefresh = in->vrefresh; out->flags = in->flags; out->type = in->type; strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN); out->name[DRM_DISPLAY_MODE_LEN-1] = 0; } /** * drm_crtc_convert_umode - convert a modeinfo into a drm_display_mode * @dev: drm device * @out: drm_display_mode to return to the user * @in: drm_mode_modeinfo to use * * Convert a drm_mode_modeinfo into a drm_display_mode structure to return to * the caller. * * Returns: * Zero on success, negative errno on failure. */ int drm_mode_convert_umode(struct drm_device *dev, struct drm_display_mode *out, const struct drm_mode_modeinfo *in) { if (in->clock > INT_MAX || in->vrefresh > INT_MAX) return -ERANGE; out->clock = in->clock; out->hdisplay = in->hdisplay; out->hsync_start = in->hsync_start; out->hsync_end = in->hsync_end; out->htotal = in->htotal; out->hskew = in->hskew; out->vdisplay = in->vdisplay; out->vsync_start = in->vsync_start; out->vsync_end = in->vsync_end; out->vtotal = in->vtotal; out->vscan = in->vscan; out->vrefresh = in->vrefresh; out->flags = in->flags; /* * Old xf86-video-vmware (possibly others too) used to * leave 'type' unititialized. Just ignore any bits we * don't like. It's a just hint after all, and more * useful for the kernel->userspace direction anyway. */ out->type = in->type & DRM_MODE_TYPE_ALL; strncpy(out->name, in->name, DRM_DISPLAY_MODE_LEN); out->name[DRM_DISPLAY_MODE_LEN-1] = 0; out->status = drm_mode_validate_driver(dev, out); if (out->status != MODE_OK) return -EINVAL; drm_mode_set_crtcinfo(out, CRTC_INTERLACE_HALVE_V); return 0; } /** * drm_mode_is_420_only - if a given videomode can be only supported in YCBCR420 * output format * * @display: display under action * @mode: video mode to be tested. * * Returns: * true if the mode can be supported in YCBCR420 format * false if not. */ bool drm_mode_is_420_only(const struct drm_display_info *display, const struct drm_display_mode *mode) { u8 vic = drm_match_cea_mode(mode); return test_bit(vic, display->hdmi.y420_vdb_modes); } EXPORT_SYMBOL(drm_mode_is_420_only); /** * drm_mode_is_420_also - if a given videomode can be supported in YCBCR420 * output format also (along with RGB/YCBCR444/422) * * @display: display under action. * @mode: video mode to be tested. * * Returns: * true if the mode can be support YCBCR420 format * false if not. */ bool drm_mode_is_420_also(const struct drm_display_info *display, const struct drm_display_mode *mode) { u8 vic = drm_match_cea_mode(mode); return test_bit(vic, display->hdmi.y420_cmdb_modes); } EXPORT_SYMBOL(drm_mode_is_420_also); /** * drm_mode_is_420 - if a given videomode can be supported in YCBCR420 * output format * * @display: display under action. * @mode: video mode to be tested. * * Returns: * true if the mode can be supported in YCBCR420 format * false if not. */ bool drm_mode_is_420(const struct drm_display_info *display, const struct drm_display_mode *mode) { return drm_mode_is_420_only(display, mode) || drm_mode_is_420_also(display, mode); } EXPORT_SYMBOL(drm_mode_is_420);
{ "pile_set_name": "Github" }
<?xml version="1.0"?> <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> <file source-language="en" datatype="plaintext" original="file.ext"> <body> <trans-unit id="28"> <source>This form should not contain extra fields.</source> <target>Bu formada əlavə sahə olmamalıdır.</target> </trans-unit> <trans-unit id="29"> <source>The uploaded file was too large. Please try to upload a smaller file.</source> <target>Yüklənən fayl çox böyükdür. Lütfən daha kiçik fayl yükləyin.</target> </trans-unit> <trans-unit id="30"> <source>The CSRF token is invalid. Please try to resubmit the form.</source> <target>CSRF nişanı yanlışdır. Lütfen formanı yenidən göndərin.</target> </trans-unit> </body> </file> </xliff>
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!21 &2100000 Material: serializedVersion: 6 m_ObjectHideFlags: 0 m_PrefabParentObject: {fileID: 0} m_PrefabInternal: {fileID: 0} m_Name: Blue m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} m_ShaderKeywords: _EMISSION m_LightmapFlags: 1 m_CustomRenderQueue: -1 stringTagMap: {} m_SavedProperties: serializedVersion: 2 m_TexEnvs: data: first: name: _MainTex second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _BumpMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailNormalMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _ParallaxMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _OcclusionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _EmissionMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailMask second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _DetailAlbedoMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} data: first: name: _MetallicGlossMap second: m_Texture: {fileID: 0} m_Scale: {x: 1, y: 1} m_Offset: {x: 0, y: 0} m_Floats: data: first: name: _SrcBlend second: 1 data: first: name: _DstBlend second: 0 data: first: name: _Cutoff second: .5 data: first: name: _Parallax second: .0199999996 data: first: name: _ZWrite second: 1 data: first: name: _Glossiness second: .800000012 data: first: name: _BumpScale second: 1 data: first: name: _OcclusionStrength second: 1 data: first: name: _DetailNormalMapScale second: 1 data: first: name: _UVSec second: 0 data: first: name: _Mode second: 0 data: first: name: _Metallic second: 1 m_Colors: data: first: name: _EmissionColor second: {r: .590841472, g: .732772946, b: 1.67400002, a: 1} data: first: name: _Color second: {r: 1, g: 1, b: 1, a: 1}
{ "pile_set_name": "Github" }
comment: layout: "header, diff, changes, sunburst, uncovered" coverage: range: "50..75" status: patch: false
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{D18160AA-7849-478B-88E1-8718E5486182}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>SportsStore.UnitTests</RootNamespace> <AssemblyName>SportsStore.UnitTests</AssemblyName> <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> <ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath> <IsCodedUITest>False</IsCodedUITest> <TestProjectType>UnitTest</TestProjectType> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> <Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Private>True</Private> <HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath> </Reference> <Reference Include="Moq"> <HintPath>..\packages\Moq.4.1.1309.1617\lib\net40\Moq.dll</HintPath> </Reference> <Reference Include="Ninject"> <HintPath>..\packages\Ninject.3.0.1.10\lib\net45-full\Ninject.dll</HintPath> </Reference> <Reference Include="Ninject.Web.Common"> <HintPath>..\packages\Ninject.Web.Common.3.0.0.7\lib\net45-full\Ninject.Web.Common.dll</HintPath> </Reference> <Reference Include="Ninject.Web.Mvc"> <HintPath>..\packages\Ninject.MVC3.3.0.0.6\lib\net45-full\Ninject.Web.Mvc.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Web" /> <Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath> </Reference> <Reference Include="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath> </Reference> <Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath> </Reference> <Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath> </Reference> <Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath> </Reference> <Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath> </Reference> <Reference Include="WebActivator"> <HintPath>..\packages\WebActivator.1.5.3\lib\net40\WebActivator.dll</HintPath> </Reference> </ItemGroup> <Choose> <When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'"> <ItemGroup> <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> </ItemGroup> </When> <Otherwise> <ItemGroup> <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" /> </ItemGroup> </Otherwise> </Choose> <ItemGroup> <Compile Include="App_Start\NinjectWebCommon.cs" /> <Compile Include="UnitTest1.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <None Include="packages.config" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\SportsStore.Domain\SportsStore.Domain.csproj"> <Project>{de93e48e-f76b-438a-af47-89d2cfab5724}</Project> <Name>SportsStore.Domain</Name> </ProjectReference> <ProjectReference Include="..\SportsStore.WebUI\SportsStore.WebUI.csproj"> <Project>{5620a400-2811-4719-bfc5-49e884967027}</Project> <Name>SportsStore.WebUI</Name> </ProjectReference> </ItemGroup> <Choose> <When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'"> <ItemGroup> <Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Private>False</Private> </Reference> <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Private>False</Private> </Reference> <Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Private>False</Private> </Reference> <Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL"> <Private>False</Private> </Reference> </ItemGroup> </When> </Choose> <Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project>
{ "pile_set_name": "Github" }
// Boost.Units - A C++ library for zero-overhead dimensional analysis and // unit/quantity manipulation and conversion // // Copyright (C) 2003-2008 Matthias Christian Schabel // Copyright (C) 2008 Steven Watanabe // // 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) #ifndef BOOST_UNITS_CGS_LENGTH_HPP #define BOOST_UNITS_CGS_LENGTH_HPP #include <boost/units/systems/cgs/base.hpp> namespace boost { namespace units { namespace cgs { typedef unit<length_dimension,cgs::system> length; BOOST_UNITS_STATIC_CONSTANT(centimeter,length); BOOST_UNITS_STATIC_CONSTANT(centimeters,length); BOOST_UNITS_STATIC_CONSTANT(centimetre,length); BOOST_UNITS_STATIC_CONSTANT(centimetres,length); } // namespace cgs } // namespace units } // namespace boost #endif // BOOST_UNITS_CGS_LENGTH_HPP
{ "pile_set_name": "Github" }
// Copyright Aleksey Gurtovoy 2000-2004 // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // Preprocessed version of "boost/mpl/greater.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { template< typename Tag1 , typename Tag2 > struct greater_impl : if_c< ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1) > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2) ) , aux::cast2nd_impl< greater_impl< Tag1,Tag1 >,Tag1, Tag2 > , aux::cast1st_impl< greater_impl< Tag2,Tag2 >,Tag1, Tag2 > >::type { }; /// for Digital Mars C++/compilers with no CTPS/TTP support template<> struct greater_impl< na,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename Tag > struct greater_impl< na,Tag > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename Tag > struct greater_impl< Tag,na > { template< typename U1, typename U2 > struct apply { typedef apply type; BOOST_STATIC_CONSTANT(int, value = 0); }; }; template< typename T > struct greater_tag { typedef typename T::tag type; }; template< typename BOOST_MPL_AUX_NA_PARAM(N1) , typename BOOST_MPL_AUX_NA_PARAM(N2) > struct greater : greater_impl< typename greater_tag<N1>::type , typename greater_tag<N2>::type >::template apply< N1,N2 >::type { BOOST_MPL_AUX_LAMBDA_SUPPORT(2, greater, (N1, N2)) }; BOOST_MPL_AUX_NA_SPEC2(2, 2, greater) }} namespace boost { namespace mpl { template<> struct greater_impl< integral_c_tag,integral_c_tag > { template< typename N1, typename N2 > struct apply : bool_< ( BOOST_MPL_AUX_VALUE_WKND(N1)::value > BOOST_MPL_AUX_VALUE_WKND(N2)::value ) > { }; }; }}
{ "pile_set_name": "Github" }
{ "package": "com.fillobotto.mp3tagger", "verified": false, "authors": [ "YandexStudio" ], "last_update": { "timestamp": 1573909761 }, "recommendation": "@recommended", "behaviors": [ "@abuse", "<p>", { "zh_CN": "该应用会创建一些不标准目录和文件,但开启后同样无法编辑位于非标准目录下的音频文件,因此开启后请将音频文件复制到标准目录下再进行编辑,添加专辑图时选择图片不受重定向影响,可以选择位于非标准目录下的图片。" } ] }
{ "pile_set_name": "Github" }
/* OODrawable.m Copyright (C) 2007-2013 Jens Ayton Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #import "OODrawable.h" #import "NSObjectOOExtensions.h" @implementation OODrawable - (void)renderOpaqueParts { } - (void)renderTranslucentParts { } - (BOOL)hasOpaqueParts { return NO; } - (BOOL)hasTranslucentParts { return NO; } - (GLfloat)collisionRadius { return 0.0f; } - (GLfloat)maxDrawDistance { return 0.0f; } - (BoundingBox)boundingBox { return kZeroBoundingBox; } - (void)setBindingTarget:(id<OOWeakReferenceSupport>)target { } - (void)dumpSelfState { } #ifndef NDEBUG - (NSSet *) allTextures { return nil; } - (size_t) totalSize { return [self oo_objectSize]; } #endif @end
{ "pile_set_name": "Github" }
data: pretraining: limit: 500 samples: source: /home/wichtounet/dev/mnist/train-images-idx3-ubyte reader: mnist scale: 0.00390625 training: limit: 500 samples: source: /home/wichtounet/dev/mnist/train-images-idx3-ubyte reader: mnist scale: 0.00390625 labels: source: /home/wichtounet/dev/mnist/train-labels-idx1-ubyte reader: mnist testing: samples: source: /home/wichtounet/dev/mnist/t10k-images-idx3-ubyte reader: mnist scale: 0.00390625 labels: source: /home/wichtounet/dev/mnist/t10k-labels-idx1-ubyte reader: mnist network: rbm: visible: 784 hidden: 1000 batch: 20 visible_unit: gaussian rbm: hidden: 350 batch: 20 rbm: hidden: 10 hidden_unit: softmax batch: 20 options: pretraining: epochs: 10 training: epochs: 10 batch: 20 weights: file: dbn.dat
{ "pile_set_name": "Github" }
<?php namespace Drupal\Core\Asset\Exception; /** * Defines a custom exception for an invalid libraries-extend specification. */ class InvalidLibrariesExtendSpecificationException extends \RuntimeException { }
{ "pile_set_name": "Github" }
<?php if ( ! class_exists( 'GP_Locale' ) ) : class GP_Locale { public $english_name; public $native_name; public $text_direction = 'ltr'; public $lang_code_iso_639_1 = null; public $lang_code_iso_639_2 = null; public $lang_code_iso_639_3 = null; public $country_code; public $wp_locale; public $slug; public $nplurals = 2; public $plural_expression = 'n != 1'; public $google_code = null; public $preferred_sans_serif_font_family = null; public $facebook_locale = null; // TODO: days, months, decimals, quotes private $_index_for_number; public function __construct( $args = array() ) { foreach( $args as $key => $value ) { $this->$key = $value; } } public static function __set_state( $state ) { return new GP_Locale( $state ); } /** * Make deprecated properties checkable for backwards compatibility. * * @param string $name Property to check if set. * @return bool Whether the property is set. */ public function __isset( $name ) { if ( 'rtl' == $name ) { return isset( $this->text_direction ); } } /** * Make deprecated properties readable for backwards compatibility. * * @param string $name Property to get. * @return mixed Property. */ public function __get( $name ) { if ( 'rtl' == $name ) { return ( 'rtl' === $this->text_direction ); } } public function combined_name() { /* translators: combined name for locales: 1: name in English, 2: native name */ return sprintf( _x( '%1$s/%2$s', 'locales', 'jetpack' ), $this->english_name, $this->native_name ); } public function numbers_for_index( $index, $how_many = 3, $test_up_to = 1000 ) { $numbers = array(); for( $number = 0; $number < $test_up_to; ++$number ) { if ( $this->index_for_number( $number ) == $index ) { $numbers[] = $number; if ( count( $numbers ) >= $how_many ) { break; } } } return $numbers; } public function index_for_number( $number ) { if ( ! isset( $this->_index_for_number ) ) { $gettext = new Gettext_Translations; $expression = $gettext->parenthesize_plural_exression( $this->plural_expression ); $this->_index_for_number = $gettext->make_plural_form_function( $this->nplurals, $expression ); } $f = $this->_index_for_number; return $f( $number ); } } endif; if ( ! class_exists( 'GP_Locales' ) ) : class GP_Locales { public $locales = array(); public function __construct() { $aa = new GP_Locale(); $aa->english_name = 'Afar'; $aa->native_name = 'Afaraf'; $aa->lang_code_iso_639_1 = 'aa'; $aa->lang_code_iso_639_2 = 'aar'; $aa->slug = 'aa'; $ae = new GP_Locale(); $ae->english_name = 'Avestan'; $ae->native_name = 'Avesta'; $ae->lang_code_iso_639_1 = 'ae'; $ae->lang_code_iso_639_2 = 'ave'; $ae->slug = 'ae'; $af = new GP_Locale(); $af->english_name = 'Afrikaans'; $af->native_name = 'Afrikaans'; $af->lang_code_iso_639_1 = 'af'; $af->lang_code_iso_639_2 = 'afr'; $af->country_code = 'za'; $af->wp_locale = 'af'; $af->slug = 'af'; $af->google_code = 'af'; $af->facebook_locale = 'af_ZA'; $ak = new GP_Locale(); $ak->english_name = 'Akan'; $ak->native_name = 'Akan'; $ak->lang_code_iso_639_1 = 'ak'; $ak->lang_code_iso_639_2 = 'aka'; $ak->wp_locale = 'ak'; $ak->slug = 'ak'; $ak->facebook_locale = 'ak_GH'; $am = new GP_Locale(); $am->english_name = 'Amharic'; $am->native_name = 'አማርኛ'; $am->lang_code_iso_639_1 = 'am'; $am->lang_code_iso_639_2 = 'amh'; $am->country_code = 'et'; $am->wp_locale = 'am'; $am->slug = 'am'; $am->facebook_locale = 'am_ET'; $an = new GP_Locale(); $an->english_name = 'Aragonese'; $an->native_name = 'Aragonés'; $an->lang_code_iso_639_1 = 'an'; $an->lang_code_iso_639_2 = 'arg'; $an->country_code = 'es'; $an->slug = 'an'; $ar = new GP_Locale(); $ar->english_name = 'Arabic'; $ar->native_name = 'العربية'; $ar->lang_code_iso_639_1 = 'ar'; $ar->lang_code_iso_639_2 = 'ara'; $ar->wp_locale = 'ar'; $ar->slug = 'ar'; $ar->nplurals = 6; $ar->plural_expression = 'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5'; $ar->text_direction = 'rtl'; $ar->preferred_sans_serif_font_family = 'Tahoma'; $ar->google_code = 'ar'; $ar->facebook_locale = 'ar_AR'; $arq = new GP_Locale(); $arq->english_name = 'Algerian Arabic'; $arq->native_name = 'الدارجة الجزايرية'; $arq->lang_code_iso_639_1 = 'ar'; $arq->lang_code_iso_639_3 = 'arq'; $arq->country_code = 'dz'; $arq->wp_locale = 'arq'; $arq->slug = 'arq'; $arq->nplurals = 6; $arq->plural_expression = 'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5'; $arq->text_direction = 'rtl'; $ary = new GP_Locale(); $ary->english_name = 'Moroccan Arabic'; $ary->native_name = 'العربية المغربية'; $ary->lang_code_iso_639_1 = 'ar'; $ary->lang_code_iso_639_3 = 'ary'; $ary->country_code = 'ma'; $ary->wp_locale = 'ary'; $ary->slug = 'ary'; $ary->nplurals = 6; $ary->plural_expression = 'n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5'; $ary->text_direction = 'rtl'; $as = new GP_Locale(); $as->english_name = 'Assamese'; $as->native_name = 'অসমীয়া'; $as->lang_code_iso_639_1 = 'as'; $as->lang_code_iso_639_2 = 'asm'; $as->lang_code_iso_639_3 = 'asm'; $as->country_code = 'in'; $as->wp_locale = 'as'; $as->slug = 'as'; $as->facebook_locale = 'as_IN'; $ast = new GP_Locale(); $ast->english_name = 'Asturian'; $ast->native_name = 'Asturianu'; $ast->lang_code_iso_639_2 = 'ast'; $ast->lang_code_iso_639_3 = 'ast'; $ast->country_code = 'es'; $ast->wp_locale = 'ast'; $ast->slug = 'ast'; $av = new GP_Locale(); $av->english_name = 'Avaric'; $av->native_name = 'авар мацӀ'; $av->lang_code_iso_639_1 = 'av'; $av->lang_code_iso_639_2 = 'ava'; $av->slug = 'av'; $ay = new GP_Locale(); $ay->english_name = 'Aymara'; $ay->native_name = 'aymar aru'; $ay->lang_code_iso_639_1 = 'ay'; $ay->lang_code_iso_639_2 = 'aym'; $ay->slug = 'ay'; $ay->nplurals = 1; $ay->plural_expression = '0'; $ay->facebook_locale = 'ay_BO'; $az = new GP_Locale(); $az->english_name = 'Azerbaijani'; $az->native_name = 'Azərbaycan dili'; $az->lang_code_iso_639_1 = 'az'; $az->lang_code_iso_639_2 = 'aze'; $az->country_code = 'az'; $az->wp_locale = 'az'; $az->slug = 'az'; $az->google_code = 'az'; $az->facebook_locale = 'az_AZ'; $azb = new GP_Locale(); $azb->english_name = 'South Azerbaijani'; $azb->native_name = 'گؤنئی آذربایجان'; $azb->lang_code_iso_639_1 = 'az'; $azb->lang_code_iso_639_3 = 'azb'; $azb->country_code = 'ir'; $azb->wp_locale = 'azb'; $azb->slug = 'azb'; $azb->text_direction = 'rtl'; $az_tr = new GP_Locale(); $az_tr->english_name = 'Azerbaijani (Turkey)'; $az_tr->native_name = 'Azərbaycan Türkcəsi'; $az_tr->lang_code_iso_639_1 = 'az'; $az_tr->lang_code_iso_639_2 = 'aze'; $az_tr->country_code = 'tr'; $az_tr->wp_locale = 'az_TR'; $az_tr->slug = 'az-tr'; $ba = new GP_Locale(); $ba->english_name = 'Bashkir'; $ba->native_name = 'башҡорт теле'; $ba->lang_code_iso_639_1 = 'ba'; $ba->lang_code_iso_639_2 = 'bak'; $ba->wp_locale = 'ba'; $ba->slug = 'ba'; $bal = new GP_Locale(); $bal->english_name = 'Catalan (Balear)'; $bal->native_name = 'Català (Balear)'; $bal->lang_code_iso_639_2 = 'bal'; $bal->country_code = 'es'; $bal->wp_locale = 'bal'; $bal->slug = 'bal'; $bcc = new GP_Locale(); $bcc->english_name = 'Balochi Southern'; $bcc->native_name = 'بلوچی مکرانی'; $bcc->lang_code_iso_639_3 = 'bcc'; $bcc->country_code = 'pk'; $bcc->wp_locale = 'bcc'; $bcc->slug = 'bcc'; $bcc->nplurals = 1; $bcc->plural_expression = '0'; $bcc->text_direction = 'rtl'; $be = new GP_Locale(); $be->english_name = 'Belarusian'; $be->native_name = 'Беларуская мова'; $be->lang_code_iso_639_1 = 'be'; $be->lang_code_iso_639_2 = 'bel'; $be->country_code = 'by'; $be->wp_locale = 'bel'; $be->slug = 'bel'; $be->nplurals = 3; $be->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $be->google_code = 'be'; $be->facebook_locale = 'be_BY'; $bg = new GP_Locale(); $bg->english_name = 'Bulgarian'; $bg->native_name = 'Български'; $bg->lang_code_iso_639_1 = 'bg'; $bg->lang_code_iso_639_2 = 'bul'; $bg->country_code = 'bg'; $bg->wp_locale = 'bg_BG'; $bg->slug = 'bg'; $bg->google_code = 'bg'; $bg->facebook_locale = 'bg_BG'; $bh = new GP_Locale(); $bh->english_name = 'Bihari'; $bh->native_name = 'भोजपुरी'; $bh->lang_code_iso_639_1 = 'bh'; $bh->lang_code_iso_639_2 = 'bih'; $bh->slug = 'bh'; $bi = new GP_Locale(); $bi->english_name = 'Bislama'; $bi->native_name = 'Bislama'; $bi->lang_code_iso_639_1 = 'bi'; $bi->lang_code_iso_639_2 = 'bis'; $bi->country_code = 'vu'; $bi->slug = 'bi'; $bm = new GP_Locale(); $bm->english_name = 'Bambara'; $bm->native_name = 'Bamanankan'; $bm->lang_code_iso_639_1 = 'bm'; $bm->lang_code_iso_639_2 = 'bam'; $bm->slug = 'bm'; $bn_bd = new GP_Locale(); $bn_bd->english_name = 'Bengali'; $bn_bd->native_name = 'বাংলা'; $bn_bd->lang_code_iso_639_1 = 'bn'; $bn_bd->country_code = 'bn'; $bn_bd->wp_locale = 'bn_BD'; $bn_bd->slug = 'bn'; $bn_bd->google_code = 'bn'; $bn_bd->facebook_locale = 'bn_IN'; $bo = new GP_Locale(); $bo->english_name = 'Tibetan'; $bo->native_name = 'བོད་ཡིག'; $bo->lang_code_iso_639_1 = 'bo'; $bo->lang_code_iso_639_2 = 'tib'; $bo->wp_locale = 'bo'; $bo->slug = 'bo'; $bo->nplurals = 1; $bo->plural_expression = '0'; $br = new GP_Locale(); $br->english_name = 'Breton'; $br->native_name = 'Brezhoneg'; $br->lang_code_iso_639_1 = 'br'; $br->lang_code_iso_639_2 = 'bre'; $br->lang_code_iso_639_3 = 'bre'; $br->country_code = 'fr'; $br->wp_locale = 'bre'; $br->slug = 'br'; $br->nplurals = 2; $br->plural_expression = '(n > 1)'; $br->facebook_locale = 'br_FR'; $bs = new GP_Locale(); $bs->english_name = 'Bosnian'; $bs->native_name = 'Bosanski'; $bs->lang_code_iso_639_1 = 'bs'; $bs->lang_code_iso_639_2 = 'bos'; $bs->country_code = 'ba'; $bs->wp_locale = 'bs_BA'; $bs->slug = 'bs'; $bs->nplurals = 3; $bs->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $bs->google_code = 'bs'; $bs->facebook_locale = 'bs_BA'; $ca = new GP_Locale(); $ca->english_name = 'Catalan'; $ca->native_name = 'Català'; $ca->lang_code_iso_639_1 = 'ca'; $ca->lang_code_iso_639_2 = 'cat'; $ca->wp_locale = 'ca'; $ca->slug = 'ca'; $ca->google_code = 'ca'; $ca->facebook_locale = 'ca_ES'; $ce = new GP_Locale(); $ce->english_name = 'Chechen'; $ce->native_name = 'Нохчийн мотт'; $ce->lang_code_iso_639_1 = 'ce'; $ce->lang_code_iso_639_2 = 'che'; $ce->slug = 'ce'; $ceb = new GP_Locale(); $ceb->english_name = 'Cebuano'; $ceb->native_name = 'Cebuano'; $ceb->lang_code_iso_639_2 = 'ceb'; $ceb->lang_code_iso_639_3 = 'ceb'; $ceb->country_code = 'ph'; $ceb->wp_locale = 'ceb'; $ceb->slug = 'ceb'; $ceb->facebook_locale = 'cx_PH'; $ch = new GP_Locale(); $ch->english_name = 'Chamorro'; $ch->native_name = 'Chamoru'; $ch->lang_code_iso_639_1 = 'ch'; $ch->lang_code_iso_639_2 = 'cha'; $ch->slug = 'ch'; $ckb = new GP_Locale(); $ckb->english_name = 'Kurdish (Sorani)'; $ckb->native_name = 'كوردی‎'; $ckb->lang_code_iso_639_1 = 'ku'; $ckb->lang_code_iso_639_3 = 'ckb'; $ckb->country_code = 'iq'; $ckb->wp_locale = 'ckb'; $ckb->slug = 'ckb'; $ckb->text_direction = 'rtl'; $ckb->facebook_locale = 'cb_IQ'; $co = new GP_Locale(); $co->english_name = 'Corsican'; $co->native_name = 'Corsu'; $co->lang_code_iso_639_1 = 'co'; $co->lang_code_iso_639_2 = 'cos'; $co->country_code = 'it'; $co->wp_locale = 'co'; $co->slug = 'co'; $cr = new GP_Locale(); $cr->english_name = 'Cree'; $cr->native_name = 'ᓀᐦᐃᔭᐍᐏᐣ'; $cr->lang_code_iso_639_1 = 'cr'; $cr->lang_code_iso_639_2 = 'cre'; $cr->country_code = 'ca'; $cr->slug = 'cr'; $cs = new GP_Locale(); $cs->english_name = 'Czech'; $cs->native_name = 'Čeština'; $cs->lang_code_iso_639_1 = 'cs'; $cs->lang_code_iso_639_2 = 'ces'; $cs->country_code = 'cz'; $cs->wp_locale = 'cs_CZ'; $cs->slug = 'cs'; $cs->nplurals = 3; $cs->plural_expression = '(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'; $cs->google_code = 'cs'; $cs->facebook_locale = 'cs_CZ'; $csb = new GP_Locale(); $csb->english_name = 'Kashubian'; $csb->native_name = 'Kaszëbsczi'; $csb->lang_code_iso_639_2 = 'csb'; $csb->slug = 'csb'; $csb->nplurals = 3; $csb->plural_expression = 'n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2'; $cu = new GP_Locale(); $cu->english_name = 'Church Slavic'; $cu->native_name = 'ѩзыкъ словѣньскъ'; $cu->lang_code_iso_639_1 = 'cu'; $cu->lang_code_iso_639_2 = 'chu'; $cu->slug = 'cu'; $cv = new GP_Locale(); $cv->english_name = 'Chuvash'; $cv->native_name = 'чӑваш чӗлхи'; $cv->lang_code_iso_639_1 = 'cv'; $cv->lang_code_iso_639_2 = 'chv'; $cv->country_code = 'ru'; $cv->slug = 'cv'; $cy = new GP_Locale(); $cy->english_name = 'Welsh'; $cy->native_name = 'Cymraeg'; $cy->lang_code_iso_639_1 = 'cy'; $cy->lang_code_iso_639_2 = 'cym'; $cy->country_code = 'gb'; $cy->wp_locale = 'cy'; $cy->slug = 'cy'; $cy->nplurals = 4; $cy->plural_expression = '(n==1) ? 0 : (n==2) ? 1 : (n != 8 && n != 11) ? 2 : 3'; $cy->google_code = 'cy'; $cy->facebook_locale = 'cy_GB'; $da = new GP_Locale(); $da->english_name = 'Danish'; $da->native_name = 'Dansk'; $da->lang_code_iso_639_1 = 'da'; $da->lang_code_iso_639_2 = 'dan'; $da->country_code = 'dk'; $da->wp_locale = 'da_DK'; $da->slug = 'da'; $da->google_code = 'da'; $da->facebook_locale = 'da_DK'; $de = new GP_Locale(); $de->english_name = 'German'; $de->native_name = 'Deutsch'; $de->lang_code_iso_639_1 = 'de'; $de->country_code = 'de'; $de->wp_locale = 'de_DE'; $de->slug = 'de'; $de->google_code = 'de'; $de->facebook_locale = 'de_DE'; $de_ch = new GP_Locale(); $de_ch->english_name = 'German (Switzerland)'; $de_ch->native_name = 'Deutsch (Schweiz)'; $de_ch->lang_code_iso_639_1 = 'de'; $de_ch->country_code = 'ch'; $de_ch->wp_locale = 'de_CH'; $de_ch->slug = 'de-ch'; $de_ch->google_code = 'de'; $dv = new GP_Locale(); $dv->english_name = 'Dhivehi'; $dv->native_name = 'ދިވެހި'; $dv->lang_code_iso_639_1 = 'dv'; $dv->lang_code_iso_639_2 = 'div'; $dv->country_code = 'mv'; $dv->wp_locale = 'dv'; $dv->slug = 'dv'; $dv->text_direction = 'rtl'; $dzo = new GP_Locale(); $dzo->english_name = 'Dzongkha'; $dzo->native_name = 'རྫོང་ཁ'; $dzo->lang_code_iso_639_1 = 'dz'; $dzo->lang_code_iso_639_2 = 'dzo'; $dzo->country_code = 'bt'; $dzo->wp_locale = 'dzo'; $dzo->slug = 'dzo'; $dzo->nplurals = 1; $dzo->plural_expression = '0'; $ewe = new GP_Locale(); $ewe->english_name = 'Ewe'; $ewe->native_name = 'Eʋegbe'; $ewe->lang_code_iso_639_1 = 'ee'; $ewe->lang_code_iso_639_2 = 'ewe'; $ewe->lang_code_iso_639_3 = 'ewe'; $ewe->country_code = 'gh'; $ewe->wp_locale = 'ewe'; $ewe->slug = 'ee'; $el_po = new GP_Locale(); $el_po->english_name = 'Greek (Polytonic)'; $el_po->native_name = 'Greek (Polytonic)'; // TODO $el_po->country_code = 'gr'; $el_po->slug = 'el-po'; $el = new GP_Locale(); $el->english_name = 'Greek'; $el->native_name = 'Ελληνικά'; $el->lang_code_iso_639_1 = 'el'; $el->lang_code_iso_639_2 = 'ell'; $el->country_code = 'gr'; $el->wp_locale = 'el'; $el->slug = 'el'; $el->google_code = 'el'; $el->facebook_locale = 'el_GR'; $emoji = new GP_Locale(); $emoji->english_name = 'Emoji'; $emoji->native_name = "\xf0\x9f\x8c\x8f\xf0\x9f\x8c\x8d\xf0\x9f\x8c\x8e (Emoji)"; $emoji->lang_code_iso_639_2 = 'art'; $emoji->wp_locale = 'art_xemoji'; $emoji->slug = 'art-xemoji'; $emoji->nplurals = 1; $emoji->plural_expression = '0'; $en = new GP_Locale(); $en->english_name = 'English'; $en->native_name = 'English'; $en->lang_code_iso_639_1 = 'en'; $en->country_code = 'us'; $en->wp_locale = 'en_US'; $en->slug = 'en'; $en->google_code = 'en'; $en->facebook_locale = 'en_US'; $en_au = new GP_Locale(); $en_au->english_name = 'English (Australia)'; $en_au->native_name = 'English (Australia)'; $en_au->lang_code_iso_639_1 = 'en'; $en_au->lang_code_iso_639_2 = 'eng'; $en_au->lang_code_iso_639_3 = 'eng'; $en_au->country_code = 'au'; $en_au->wp_locale = 'en_AU'; $en_au->slug = 'en-au'; $en_au->google_code = 'en'; $en_ca = new GP_Locale(); $en_ca->english_name = 'English (Canada)'; $en_ca->native_name = 'English (Canada)'; $en_ca->lang_code_iso_639_1 = 'en'; $en_ca->lang_code_iso_639_2 = 'eng'; $en_ca->lang_code_iso_639_3 = 'eng'; $en_ca->country_code = 'ca'; $en_ca->wp_locale = 'en_CA'; $en_ca->slug = 'en-ca'; $en_ca->google_code = 'en'; $en_gb = new GP_Locale(); $en_gb->english_name = 'English (UK)'; $en_gb->native_name = 'English (UK)'; $en_gb->lang_code_iso_639_1 = 'en'; $en_gb->lang_code_iso_639_2 = 'eng'; $en_gb->lang_code_iso_639_3 = 'eng'; $en_gb->country_code = 'gb'; $en_gb->wp_locale = 'en_GB'; $en_gb->slug = 'en-gb'; $en_gb->google_code = 'en'; $en_gb->facebook_locale = 'en_GB'; $en_nz = new GP_Locale(); $en_nz->english_name = 'English (New Zealand)'; $en_nz->native_name = 'English (New Zealand)'; $en_nz->lang_code_iso_639_1 = 'en'; $en_nz->lang_code_iso_639_2 = 'eng'; $en_nz->lang_code_iso_639_3 = 'eng'; $en_nz->country_code = 'nz'; $en_nz->wp_locale = 'en_NZ'; $en_nz->slug = 'en-nz'; $en_nz->google_code = 'en'; $en_za = new GP_Locale(); $en_za->english_name = 'English (South Africa)'; $en_za->native_name = 'English (South Africa)'; $en_za->lang_code_iso_639_1 = 'en'; $en_za->lang_code_iso_639_2 = 'eng'; $en_za->lang_code_iso_639_3 = 'eng'; $en_za->country_code = 'za'; $en_za->wp_locale = 'en_ZA'; $en_za->slug = 'en-za'; $en_za->google_code = 'en'; $eo = new GP_Locale(); $eo->english_name = 'Esperanto'; $eo->native_name = 'Esperanto'; $eo->lang_code_iso_639_1 = 'eo'; $eo->lang_code_iso_639_2 = 'epo'; $eo->wp_locale = 'eo'; $eo->slug = 'eo'; $eo->google_code = 'eo'; $eo->facebook_locale = 'eo_EO'; $es = new GP_Locale(); $es->english_name = 'Spanish (Spain)'; $es->native_name = 'Español'; $es->lang_code_iso_639_1 = 'es'; $es->lang_code_iso_639_2 = 'spa'; $es->lang_code_iso_639_3 = 'spa'; $es->country_code = 'es'; $es->wp_locale = 'es_ES'; $es->slug = 'es'; $es->google_code = 'es'; $es->facebook_locale = 'es_ES'; $es_ar = new GP_Locale(); $es_ar->english_name = 'Spanish (Argentina)'; $es_ar->native_name = 'Español de Argentina'; $es_ar->lang_code_iso_639_1 = 'es'; $es_ar->lang_code_iso_639_2 = 'spa'; $es_ar->lang_code_iso_639_3 = 'spa'; $es_ar->country_code = 'ar'; $es_ar->wp_locale = 'es_AR'; $es_ar->slug = 'es-ar'; $es_ar->google_code = 'es'; $es_ar->facebook_locale = 'es_LA'; $es_cl = new GP_Locale(); $es_cl->english_name = 'Spanish (Chile)'; $es_cl->native_name = 'Español de Chile'; $es_cl->lang_code_iso_639_1 = 'es'; $es_cl->lang_code_iso_639_2 = 'spa'; $es_cl->lang_code_iso_639_3 = 'spa'; $es_cl->country_code = 'cl'; $es_cl->wp_locale = 'es_CL'; $es_cl->slug = 'es-cl'; $es_cl->google_code = 'es'; $es_cl->facebook_locale = 'es_CL'; $es_co = new GP_Locale(); $es_co->english_name = 'Spanish (Colombia)'; $es_co->native_name = 'Español de Colombia'; $es_co->lang_code_iso_639_1 = 'es'; $es_co->lang_code_iso_639_2 = 'spa'; $es_co->lang_code_iso_639_3 = 'spa'; $es_co->country_code = 'co'; $es_co->wp_locale = 'es_CO'; $es_co->slug = 'es-co'; $es_co->google_code = 'es'; $es_co->facebook_locale = 'es_CO'; $es_cr = new GP_Locale(); $es_cr->english_name = 'Spanish (Costa Rica)'; $es_cr->native_name = 'Español de Costa Rica'; $es_cr->lang_code_iso_639_1 = 'es'; $es_cr->lang_code_iso_639_2 = 'spa'; $es_cr->lang_code_iso_639_3 = 'spa'; $es_cr->country_code = 'cr'; $es_cr->wp_locale = 'es_CR'; $es_cr->slug = 'es-cr'; $es_gt = new GP_Locale(); $es_gt->english_name = 'Spanish (Guatemala)'; $es_gt->native_name = 'Español de Guatemala'; $es_gt->lang_code_iso_639_1 = 'es'; $es_gt->lang_code_iso_639_2 = 'spa'; $es_gt->lang_code_iso_639_3 = 'spa'; $es_gt->country_code = 'gt'; $es_gt->wp_locale = 'es_GT'; $es_gt->slug = 'es-gt'; $es_gt->google_code = 'es'; $es_gt->facebook_locale = 'es_LA'; $es_mx = new GP_Locale(); $es_mx->english_name = 'Spanish (Mexico)'; $es_mx->native_name = 'Español de México'; $es_mx->lang_code_iso_639_1 = 'es'; $es_mx->lang_code_iso_639_2 = 'spa'; $es_mx->lang_code_iso_639_3 = 'spa'; $es_mx->country_code = 'mx'; $es_mx->wp_locale = 'es_MX'; $es_mx->slug = 'es-mx'; $es_mx->google_code = 'es'; $es_mx->facebook_locale = 'es_MX'; $es_pe = new GP_Locale(); $es_pe->english_name = 'Spanish (Peru)'; $es_pe->native_name = 'Español de Perú'; $es_pe->lang_code_iso_639_1 = 'es'; $es_pe->lang_code_iso_639_2 = 'spa'; $es_pe->lang_code_iso_639_3 = 'spa'; $es_pe->country_code = 'pe'; $es_pe->wp_locale = 'es_PE'; $es_pe->slug = 'es-pe'; $es_pe->google_code = 'es'; $es_pe->facebook_locale = 'es_LA'; $es_pr = new GP_Locale(); $es_pr->english_name = 'Spanish (Puerto Rico)'; $es_pr->native_name = 'Español de Puerto Rico'; $es_pr->lang_code_iso_639_1 = 'es'; $es_pr->lang_code_iso_639_2 = 'spa'; $es_pr->lang_code_iso_639_3 = 'spa'; $es_pr->country_code = 'pr'; $es_pr->wp_locale = 'es_PR'; $es_pr->slug = 'es-pr'; $es_pr->google_code = 'es'; $es_pr->facebook_locale = 'es_LA'; $es_us = new GP_Locale(); $es_us->english_name = 'Spanish (US)'; $es_us->native_name = 'Español de los Estados Unidos'; $es_us->lang_code_iso_639_1 = 'es'; $es_us->lang_code_iso_639_2 = 'spa'; $es_us->lang_code_iso_639_3 = 'spa'; $es_us->country_code = 'us'; $es_us->slug = 'es-us'; $es_ve = new GP_Locale(); $es_ve->english_name = 'Spanish (Venezuela)'; $es_ve->native_name = 'Español de Venezuela'; $es_ve->lang_code_iso_639_1 = 'es'; $es_ve->lang_code_iso_639_2 = 'spa'; $es_ve->lang_code_iso_639_3 = 'spa'; $es_ve->country_code = 've'; $es_ve->wp_locale = 'es_VE'; $es_ve->slug = 'es-ve'; $es_ve->google_code = 'es'; $es_ve->facebook_locale = 'es_VE'; $et = new GP_Locale(); $et->english_name = 'Estonian'; $et->native_name = 'Eesti'; $et->lang_code_iso_639_1 = 'et'; $et->lang_code_iso_639_2 = 'est'; $et->country_code = 'ee'; $et->wp_locale = 'et'; $et->slug = 'et'; $et->google_code = 'et'; $et->facebook_locale = 'et_EE'; $eu = new GP_Locale(); $eu->english_name = 'Basque'; $eu->native_name = 'Euskara'; $eu->lang_code_iso_639_1 = 'eu'; $eu->lang_code_iso_639_2 = 'eus'; $eu->country_code = 'es'; $eu->wp_locale = 'eu'; $eu->slug = 'eu'; $eu->google_code = 'eu'; $eu->facebook_locale = 'eu_ES'; $fa = new GP_Locale(); $fa->english_name = 'Persian'; $fa->native_name = 'فارسی'; $fa->lang_code_iso_639_1 = 'fa'; $fa->lang_code_iso_639_2 = 'fas'; $fa->wp_locale = 'fa_IR'; $fa->slug = 'fa'; $fa->nplurals = 1; $fa->plural_expression = '0'; $fa->text_direction = 'rtl'; $fa->google_code = 'fa'; $fa->facebook_locale = 'fa_IR'; $fa_af = new GP_Locale(); $fa_af->english_name = 'Persian (Afghanistan)'; $fa_af->native_name = '(فارسی (افغانستان'; $fa_af->lang_code_iso_639_1 = 'fa'; $fa_af->lang_code_iso_639_2 = 'fas'; $fa_af->wp_locale = 'fa_AF'; $fa_af->slug = 'fa-af'; $fa_af->nplurals = 1; $fa_af->plural_expression = '0'; $fa_af->text_direction = 'rtl'; $fa_af->google_code = 'fa'; $ff_sn = new GP_Locale(); $ff_sn->english_name = 'Fulah'; $ff_sn->native_name = 'Pulaar'; $ff_sn->lang_code_iso_639_1 = 'ff'; $ff_sn->lang_code_iso_639_2 = 'fuc'; $ff_sn->country_code = 'sn'; $ff_sn->wp_locale = 'fuc'; $ff_sn->slug = 'fuc'; $ff_sn->plural_expression = 'n!=1'; $fi = new GP_Locale(); $fi->english_name = 'Finnish'; $fi->native_name = 'Suomi'; $fi->lang_code_iso_639_1 = 'fi'; $fi->lang_code_iso_639_2 = 'fin'; $fi->country_code = 'fi'; $fi->wp_locale = 'fi'; $fi->slug = 'fi'; $fi->google_code = 'fi'; $fi->facebook_locale = 'fi_FI'; $fj = new GP_Locale(); $fj->english_name = 'Fijian'; $fj->native_name = 'Vosa Vakaviti'; $fj->lang_code_iso_639_1 = 'fj'; $fj->lang_code_iso_639_2 = 'fij'; $fj->country_code = 'fj'; $fj->slug = 'fj'; $fo = new GP_Locale(); $fo->english_name = 'Faroese'; $fo->native_name = 'Føroyskt'; $fo->lang_code_iso_639_1 = 'fo'; $fo->lang_code_iso_639_2 = 'fao'; $fo->country_code = 'fo'; $fo->wp_locale = 'fo'; $fo->slug = 'fo'; $fo->facebook_locale = 'fo_FO'; $fr = new GP_Locale(); $fr->english_name = 'French (France)'; $fr->native_name = 'Français'; $fr->lang_code_iso_639_1 = 'fr'; $fr->country_code = 'fr'; $fr->wp_locale = 'fr_FR'; $fr->slug = 'fr'; $fr->nplurals = 2; $fr->plural_expression = 'n > 1'; $fr->google_code = 'fr'; $fr->facebook_locale = 'fr_FR'; $fr_be = new GP_Locale(); $fr_be->english_name = 'French (Belgium)'; $fr_be->native_name = 'Français de Belgique'; $fr_be->lang_code_iso_639_1 = 'fr'; $fr_be->lang_code_iso_639_2 = 'fra'; $fr_be->country_code = 'be'; $fr_be->wp_locale = 'fr_BE'; $fr_be->slug = 'fr-be'; $fr_ca = new GP_Locale(); $fr_ca->english_name = 'French (Canada)'; $fr_ca->native_name = 'Français du Canada'; $fr_ca->lang_code_iso_639_1 = 'fr'; $fr_ca->lang_code_iso_639_2 = 'fra'; $fr_ca->country_code = 'ca'; $fr_ca->wp_locale = 'fr_CA'; $fr_ca->slug = 'fr-ca'; $fr_ca->facebook_locale = 'fr_CA'; $fr_ch = new GP_Locale(); $fr_ch->english_name = 'French (Switzerland)'; $fr_ch->native_name = 'Français de Suisse'; $fr_ch->lang_code_iso_639_1 = 'fr'; $fr_ch->lang_code_iso_639_2 = 'fra'; $fr_ch->country_code = 'ch'; $fr_ch->slug = 'fr-ch'; $frp = new GP_Locale(); $frp->english_name = 'Arpitan'; $frp->native_name = 'Arpitan'; $frp->lang_code_iso_639_3 = 'frp'; $frp->country_code = 'fr'; $frp->wp_locale = 'frp'; $frp->slug = 'frp'; $frp->nplurals = 2; $frp->plural_expression = 'n > 1'; $fur = new GP_Locale(); $fur->english_name = 'Friulian'; $fur->native_name = 'Friulian'; $fur->lang_code_iso_639_2 = 'fur'; $fur->lang_code_iso_639_3 = 'fur'; $fur->country_code = 'it'; $fur->wp_locale = 'fur'; $fur->slug = 'fur'; $fy = new GP_Locale(); $fy->english_name = 'Frisian'; $fy->native_name = 'Frysk'; $fy->lang_code_iso_639_1 = 'fy'; $fy->lang_code_iso_639_2 = 'fry'; $fy->country_code = 'nl'; $fy->wp_locale = 'fy'; $fy->slug = 'fy'; $fy->facebook_locale = 'fy_NL'; $ga = new GP_Locale(); $ga->english_name = 'Irish'; $ga->native_name = 'Gaelige'; $ga->lang_code_iso_639_1 = 'ga'; $ga->lang_code_iso_639_2 = 'gle'; $ga->country_code = 'ie'; $ga->slug = 'ga'; $ga->wp_locale = 'ga'; $ga->nplurals = 5; $ga->plural_expression = 'n==1 ? 0 : n==2 ? 1 : n<7 ? 2 : n<11 ? 3 : 4'; $ga->google_code = 'ga'; $ga->facebook_locale = 'ga_IE'; $gd = new GP_Locale(); $gd->english_name = 'Scottish Gaelic'; $gd->native_name = 'Gàidhlig'; $gd->lang_code_iso_639_1 = 'gd'; $gd->lang_code_iso_639_2 = 'gla'; $gd->lang_code_iso_639_3 = 'gla'; $gd->country_code = 'gb'; $gd->wp_locale = 'gd'; $gd->slug = 'gd'; $gd->nplurals = 4; $gd->plural_expression = '(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : (n > 2 && n < 20) ? 2 : 3'; $gd->google_code = 'gd'; $gl = new GP_Locale(); $gl->english_name = 'Galician'; $gl->native_name = 'Galego'; $gl->lang_code_iso_639_1 = 'gl'; $gl->lang_code_iso_639_2 = 'glg'; $gl->country_code = 'es'; $gl->wp_locale = 'gl_ES'; $gl->slug = 'gl'; $gl->google_code = 'gl'; $gl->facebook_locale = 'gl_ES'; $gn = new GP_Locale(); $gn->english_name = 'Guaraní'; $gn->native_name = 'Avañe\'ẽ'; $gn->lang_code_iso_639_1 = 'gn'; $gn->lang_code_iso_639_2 = 'grn'; $gn->wp_locale = 'gn'; $gn->slug = 'gn'; $gsw = new GP_Locale(); $gsw->english_name = 'Swiss German'; $gsw->native_name = 'Schwyzerdütsch'; $gsw->lang_code_iso_639_2 = 'gsw'; $gsw->lang_code_iso_639_3 = 'gsw'; $gsw->country_code = 'ch'; $gsw->wp_locale = 'gsw'; $gsw->slug = 'gsw'; $gu = new GP_Locale(); $gu->english_name = 'Gujarati'; $gu->native_name = 'ગુજરાતી'; $gu->lang_code_iso_639_1 = 'gu'; $gu->lang_code_iso_639_2 = 'guj'; $gu->wp_locale = 'gu'; $gu->slug = 'gu'; $gu->google_code = 'gu'; $gu->facebook_locale = 'gu_IN'; $ha = new GP_Locale(); $ha->english_name = 'Hausa (Arabic)'; $ha->native_name = 'هَوُسَ'; $ha->lang_code_iso_639_1 = 'ha'; $ha->lang_code_iso_639_2 = 'hau'; $ha->slug = 'ha'; $ha->text_direction = 'rtl'; $ha->google_code = 'ha'; $hat = new GP_Locale(); $hat->english_name = 'Haitian Creole'; $hat->native_name = 'Kreyol ayisyen'; $hat->lang_code_iso_639_1 = 'ht'; $hat->lang_code_iso_639_2 = 'hat'; $hat->lang_code_iso_639_3 = 'hat'; $hat->country_code = 'ht'; $hat->wp_locale = 'hat'; $hat->slug = 'hat'; $hau = new GP_Locale(); $hau->english_name = 'Hausa'; $hau->native_name = 'Harshen Hausa'; $hau->lang_code_iso_639_1 = 'ha'; $hau->lang_code_iso_639_2 = 'hau'; $hau->lang_code_iso_639_3 = 'hau'; $hau->country_code = 'ng'; $hau->wp_locale = 'hau'; $hau->slug = 'hau'; $hau->google_code = 'ha'; $hau->facebook_locale = 'ha_NG'; $haw = new GP_Locale(); $haw->english_name = 'Hawaiian'; $haw->native_name = 'Ōlelo Hawaiʻi'; $haw->lang_code_iso_639_2 = 'haw'; $haw->country_code = 'us'; $haw->wp_locale = 'haw_US'; $haw->slug = 'haw'; $haz = new GP_Locale(); $haz->english_name = 'Hazaragi'; $haz->native_name = 'هزاره گی'; $haz->lang_code_iso_639_3 = 'haz'; $haz->country_code = 'af'; $haz->wp_locale = 'haz'; $haz->slug = 'haz'; $haz->text_direction = 'rtl'; $he = new GP_Locale(); $he->english_name = 'Hebrew'; $he->native_name = 'עִבְרִית'; $he->lang_code_iso_639_1 = 'he'; $he->country_code = 'il'; $he->wp_locale = 'he_IL'; $he->slug = 'he'; $he->text_direction = 'rtl'; $he->google_code = 'iw'; $he->facebook_locale = 'he_IL'; $hi = new GP_Locale(); $hi->english_name = 'Hindi'; $hi->native_name = 'हिन्दी'; $hi->lang_code_iso_639_1 = 'hi'; $hi->lang_code_iso_639_2 = 'hin'; $hi->country_code = 'in'; $hi->wp_locale = 'hi_IN'; $hi->slug = 'hi'; $hi->google_code = 'hi'; $hi->facebook_locale = 'hi_IN'; $hr = new GP_Locale(); $hr->english_name = 'Croatian'; $hr->native_name = 'Hrvatski'; $hr->lang_code_iso_639_1 = 'hr'; $hr->lang_code_iso_639_2 = 'hrv'; $hr->country_code = 'hr'; $hr->wp_locale = 'hr'; $hr->slug = 'hr'; $hr->nplurals = 3; $hr->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $hr->google_code = 'hr'; $hr->facebook_locale = 'hr_HR'; $hu = new GP_Locale(); $hu->english_name = 'Hungarian'; $hu->native_name = 'Magyar'; $hu->lang_code_iso_639_1 = 'hu'; $hu->lang_code_iso_639_2 = 'hun'; $hu->country_code = 'hu'; $hu->wp_locale = 'hu_HU'; $hu->slug = 'hu'; $hu->google_code = 'hu'; $hu->facebook_locale = 'hu_HU'; $hy = new GP_Locale(); $hy->english_name = 'Armenian'; $hy->native_name = 'Հայերեն'; $hy->lang_code_iso_639_1 = 'hy'; $hy->lang_code_iso_639_2 = 'hye'; $hy->country_code = 'am'; $hy->wp_locale = 'hy'; $hy->slug = 'hy'; $hy->google_code = 'hy'; $hy->facebook_locale = 'hy_AM'; $ia = new GP_Locale(); $ia->english_name = 'Interlingua'; $ia->native_name = 'Interlingua'; $ia->lang_code_iso_639_1 = 'ia'; $ia->lang_code_iso_639_2 = 'ina'; $ia->slug = 'ia'; $id = new GP_Locale(); $id->english_name = 'Indonesian'; $id->native_name = 'Bahasa Indonesia'; $id->lang_code_iso_639_1 = 'id'; $id->lang_code_iso_639_2 = 'ind'; $id->country_code = 'id'; $id->wp_locale = 'id_ID'; $id->slug = 'id'; $id->nplurals = 2; $id->plural_expression = 'n > 1'; $id->google_code = 'id'; $id->facebook_locale = 'id_ID'; $ido = new GP_Locale(); $ido->english_name = 'Ido'; $ido->native_name = 'Ido'; $ido->lang_code_iso_639_1 = 'io'; $ido->lang_code_iso_639_2 = 'ido'; $ido->lang_code_iso_639_3 = 'ido'; $ido->wp_locale = 'ido'; $ido->slug = 'ido'; $ike = new GP_Locale(); $ike->english_name = 'Inuktitut'; $ike->native_name = 'ᐃᓄᒃᑎᑐᑦ'; $ike->lang_code_iso_639_1 = 'iu'; $ike->lang_code_iso_639_2 = 'iku'; $ike->country_code = 'ca'; $ike->slug = 'ike'; $ilo = new GP_Locale(); $ilo->english_name = 'Iloko'; $ilo->native_name = 'Pagsasao nga Iloko'; $ilo->lang_code_iso_639_2 = 'ilo'; $ilo->country_code = 'ph'; $ilo->slug = 'ilo'; $is = new GP_Locale(); $is->english_name = 'Icelandic'; $is->native_name = 'Íslenska'; $is->lang_code_iso_639_1 = 'is'; $is->lang_code_iso_639_2 = 'isl'; $is->country_code = 'is'; $is->slug = 'is'; $is->wp_locale = 'is_IS'; $is->nplurals = 2; $is->plural_expression = '(n % 100 != 1 && n % 100 != 21 && n % 100 != 31 && n % 100 != 41 && n % 100 != 51 && n % 100 != 61 && n % 100 != 71 && n % 100 != 81 && n % 100 != 91)'; $is->google_code = 'is'; $is->facebook_locale = 'is_IS'; $it = new GP_Locale(); $it->english_name = 'Italian'; $it->native_name = 'Italiano'; $it->lang_code_iso_639_1 = 'it'; $it->lang_code_iso_639_2 = 'ita'; $it->country_code = 'it'; $it->wp_locale = 'it_IT'; $it->slug = 'it'; $it->google_code = 'it'; $it->facebook_locale = 'it_IT'; $ja = new GP_Locale(); $ja->english_name = 'Japanese'; $ja->native_name = '日本語'; $ja->lang_code_iso_639_1 = 'ja'; $ja->country_code = 'jp'; $ja->wp_locale = 'ja'; $ja->slug = 'ja'; $ja->google_code = 'ja'; $ja->facebook_locale = 'ja_JP'; $ja->nplurals = 1; $ja->plural_expression = '0'; $jv = new GP_Locale(); $jv->english_name = 'Javanese'; $jv->native_name = 'Basa Jawa'; $jv->lang_code_iso_639_1 = 'jv'; $jv->lang_code_iso_639_2 = 'jav'; $jv->country_code = 'id'; $jv->wp_locale = 'jv_ID'; $jv->slug = 'jv'; $jv->google_code = 'jw'; $jv->facebook_locale = 'jv_ID'; $ka = new GP_Locale(); $ka->english_name = 'Georgian'; $ka->native_name = 'ქართული'; $ka->lang_code_iso_639_1 = 'ka'; $ka->lang_code_iso_639_2 = 'kat'; $ka->country_code = 'ge'; $ka->wp_locale = 'ka_GE'; $ka->slug = 'ka'; $ka->nplurals = 1; $ka->plural_expression = '0'; $ka->google_code = 'ka'; $ka->facebook_locale = 'ka_GE'; $kab = new GP_Locale(); $kab->english_name = 'Kabyle'; $kab->native_name = 'Taqbaylit'; $kab->lang_code_iso_639_2 = 'kab'; $kab->lang_code_iso_639_3 = 'kab'; $kab->country_code = 'dz'; $kab->wp_locale = 'kab'; $kab->slug = 'kab'; $kab->nplurals = 2; $kab->plural_expression = '(n > 1)'; $kal = new GP_Locale(); $kal->english_name = 'Greenlandic'; $kal->native_name = 'Kalaallisut'; $kal->lang_code_iso_639_1 = 'kl'; $kal->lang_code_iso_639_2 = 'kal'; $kal->lang_code_iso_639_3 = 'kal'; $kal->country_code = 'gl'; $kal->wp_locale = 'kal'; $kal->slug = 'kal'; $kin = new GP_Locale(); $kin->english_name = 'Kinyarwanda'; $kin->native_name = 'Ikinyarwanda'; $kin->lang_code_iso_639_1 = 'rw'; $kin->lang_code_iso_639_2 = 'kin'; $kin->lang_code_iso_639_3 = 'kin'; $kin->wp_locale = 'kin'; $kin->country_code = 'rw'; $kin->slug = 'kin'; $kin->facebook_locale = 'rw_RW'; $kk = new GP_Locale(); $kk->english_name = 'Kazakh'; $kk->native_name = 'Қазақ тілі'; $kk->lang_code_iso_639_1 = 'kk'; $kk->lang_code_iso_639_2 = 'kaz'; $kk->country_code = 'kz'; $kk->wp_locale = 'kk'; $kk->slug = 'kk'; $kk->google_code = 'kk'; $kk->facebook_locale = 'kk_KZ'; $km = new GP_Locale(); $km->english_name = 'Khmer'; $km->native_name = 'ភាសាខ្មែរ'; $km->lang_code_iso_639_1 = 'km'; $km->lang_code_iso_639_2 = 'khm'; $km->country_code = 'kh'; $km->wp_locale = 'km'; $km->slug = 'km'; $km->nplurals = 1; $km->plural_expression = '0'; $km->google_code = 'km'; $km->facebook_locale = 'km_KH'; $kmr = new GP_Locale(); $kmr->english_name = 'Kurdish (Kurmanji)'; $kmr->native_name = 'Kurdî'; $kmr->lang_code_iso_639_1 = 'ku'; $kmr->lang_code_iso_639_3 = 'kmr'; $kmr->country_code = 'tr'; $kmr->slug = 'kmr'; $kmr->facebook_locale = 'ku_TR'; $kn = new GP_Locale(); $kn->english_name = 'Kannada'; $kn->native_name = 'ಕನ್ನಡ'; $kn->lang_code_iso_639_1 = 'kn'; $kn->lang_code_iso_639_2 = 'kan'; $kn->country_code = 'in'; $kn->wp_locale = 'kn'; $kn->slug = 'kn'; $kn->google_code = 'kn'; $kn->facebook_locale = 'kn_IN'; $ko = new GP_Locale(); $ko->english_name = 'Korean'; $ko->native_name = '한국어'; $ko->lang_code_iso_639_1 = 'ko'; $ko->lang_code_iso_639_2 = 'kor'; $ko->country_code = 'kr'; $ko->wp_locale = 'ko_KR'; $ko->slug = 'ko'; $ko->nplurals = 1; $ko->plural_expression = '0'; $ko->google_code = 'ko'; $ko->facebook_locale = 'ko_KR'; $ks = new GP_Locale(); $ks->english_name = 'Kashmiri'; $ks->native_name = 'कश्मीरी'; $ks->lang_code_iso_639_1 = 'ks'; $ks->lang_code_iso_639_2 = 'kas'; $ks->slug = 'ks'; $kir = new GP_Locale(); $kir->english_name = 'Kyrgyz'; $kir->native_name = 'Кыргызча'; $kir->lang_code_iso_639_1 = 'ky'; $kir->lang_code_iso_639_2 = 'kir'; $kir->lang_code_iso_639_3 = 'kir'; $kir->country_code = 'kg'; $kir->wp_locale = 'kir'; $kir->slug = 'kir'; $kir->nplurals = 1; $kir->plural_expression = '0'; $kir->google_code = 'ky'; $la = new GP_Locale(); $la->english_name = 'Latin'; $la->native_name = 'Latine'; $la->lang_code_iso_639_1 = 'la'; $la->lang_code_iso_639_2 = 'lat'; $la->slug = 'la'; $la->google_code = 'la'; $la->facebook_locale = 'la_VA'; $lb = new GP_Locale(); $lb->english_name = 'Luxembourgish'; $lb->native_name = 'Lëtzebuergesch'; $lb->lang_code_iso_639_1 = 'lb'; $lb->country_code = 'lu'; $lb->wp_locale = 'lb_LU'; $lb->slug = 'lb'; $li = new GP_Locale(); $li->english_name = 'Limburgish'; $li->native_name = 'Limburgs'; $li->lang_code_iso_639_1 = 'li'; $li->lang_code_iso_639_2 = 'lim'; $li->lang_code_iso_639_3 = 'lim'; $li->country_code = 'nl'; $li->wp_locale = 'li'; $li->slug = 'li'; $li->facebook_locale = 'li_NL'; $lin = new GP_Locale(); $lin->english_name = 'Lingala'; $lin->native_name = 'Ngala'; $lin->lang_code_iso_639_1 = 'ln'; $lin->lang_code_iso_639_2 = 'lin'; $lin->country_code = 'cd'; $lin->wp_locale = 'lin'; $lin->slug = 'lin'; $lin->nplurals = 2; $lin->plural_expression = 'n>1'; $lin->facebook_locale = 'ln_CD'; $lmo = new GP_Locale(); $lmo->english_name = 'Lombard'; $lmo->native_name = 'Lombardo'; $lmo->lang_code_iso_639_3 = 'lmo'; $lmo->country_code = 'it'; $lmo->wp_locale = 'lmo'; $lmo->slug = 'lmo'; $lo = new GP_Locale(); $lo->english_name = 'Lao'; $lo->native_name = 'ພາສາລາວ'; $lo->lang_code_iso_639_1 = 'lo'; $lo->lang_code_iso_639_2 = 'lao'; $lo->country_code = 'LA'; $lo->wp_locale = 'lo'; $lo->slug = 'lo'; $lo->nplurals = 1; $lo->plural_expression = '0'; $lo->google_code = 'lo'; $lo->facebook_locale = 'lo_LA'; $lt = new GP_Locale(); $lt->english_name = 'Lithuanian'; $lt->native_name = 'Lietuvių kalba'; $lt->lang_code_iso_639_1 = 'lt'; $lt->lang_code_iso_639_2 = 'lit'; $lt->country_code = 'lt'; $lt->wp_locale = 'lt_LT'; $lt->slug = 'lt'; $lt->nplurals = 3; $lt->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2)'; $lt->google_code = 'lt'; $lt->facebook_locale = 'lt_LT'; $lug = new GP_Locale(); $lug->english_name = 'Luganda'; $lug->native_name = 'Oluganda'; $lug->lang_code_iso_639_1 = 'lg'; $lug->lang_code_iso_639_2 = 'lug'; $lug->lang_code_iso_639_3 = 'lug'; $lug->country_code = 'ug'; $lug->wp_locale = 'lug'; $lug->slug = 'lug'; $lv = new GP_Locale(); $lv->english_name = 'Latvian'; $lv->native_name = 'Latviešu valoda'; $lv->lang_code_iso_639_1 = 'lv'; $lv->lang_code_iso_639_2 = 'lav'; $lv->country_code = 'lv'; $lv->wp_locale = 'lv'; $lv->slug = 'lv'; $lv->nplurals = 3; $lv->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2)'; $lv->google_code = 'lv'; $lv->facebook_locale = 'lv_LV'; $me = new GP_Locale(); $me->english_name = 'Montenegrin'; $me->native_name = 'Crnogorski jezik'; $me->lang_code_iso_639_1 = 'me'; $me->country_code = 'me'; $me->wp_locale = 'me_ME'; $me->slug = 'me'; $me->nplurals = 3; $me->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $mfe = new GP_Locale(); $mfe->english_name = 'Mauritian Creole'; $mfe->native_name = 'Kreol Morisien'; $mfe->lang_code_iso_639_3 = 'mfe'; $mfe->country_code = 'mu'; $mfe->wp_locale = 'mfe'; $mfe->slug = 'mfe'; $mfe->nplurals = 1; $mfe->plural_expression = '0'; $mg = new GP_Locale(); $mg->english_name = 'Malagasy'; $mg->native_name = 'Malagasy'; $mg->lang_code_iso_639_1 = 'mg'; $mg->lang_code_iso_639_2 = 'mlg'; $mg->country_code = 'mg'; $mg->wp_locale = 'mg_MG'; $mg->slug = 'mg'; $mg->google_code = 'mg'; $mg->facebook_locale = 'mg_MG'; $mhr = new GP_Locale(); $mhr->english_name = 'Mari (Meadow)'; $mhr->native_name = 'Олык марий'; $mhr->lang_code_iso_639_3 = 'mhr'; $mhr->country_code = 'ru'; $mhr->slug = 'mhr'; $mk = new GP_Locale(); $mk->english_name = 'Macedonian'; $mk->native_name = 'Македонски јазик'; $mk->lang_code_iso_639_1 = 'mk'; $mk->lang_code_iso_639_2 = 'mkd'; $mk->country_code = 'mk'; $mk->wp_locale = 'mk_MK'; $mk->slug = 'mk'; $mk->nplurals = 2; $mk->plural_expression = 'n==1 || n%10==1 ? 0 : 1'; $mk->google_code = 'mk'; $mk->facebook_locale = 'mk_MK'; $ml = new GP_Locale(); $ml->english_name = 'Malayalam'; $ml->native_name = 'മലയാളം'; $ml->lang_code_iso_639_1 = 'ml'; $ml->lang_code_iso_639_2 = 'mal'; $ml->country_code = 'in'; $ml->wp_locale = 'ml_IN'; $ml->slug = 'ml'; $ml->google_code = 'ml'; $ml->facebook_locale = 'ml_IN'; $mlt = new GP_Locale(); $mlt->english_name = 'Maltese'; $mlt->native_name = 'Malti'; $mlt->lang_code_iso_639_1 = 'mt'; $mlt->lang_code_iso_639_2 = 'mlt'; $mlt->lang_code_iso_639_3 = 'mlt'; $mlt->country_code = 'mt'; $mlt->wp_locale = 'mlt'; $mlt->slug = 'mlt'; $mlt->nplurals = 4; $mlt->plural_expression = '(n==1 ? 0 : n==0 || ( n%100>1 && n%100<11) ? 1 : (n%100>10 && n%100<20 ) ? 2 : 3)'; $mlt->google_code = 'mt'; $mlt->facebook_locale = 'mt_MT'; $mn = new GP_Locale(); $mn->english_name = 'Mongolian'; $mn->native_name = 'Монгол'; $mn->lang_code_iso_639_1 = 'mn'; $mn->lang_code_iso_639_2 = 'mon'; $mn->country_code = 'mn'; $mn->wp_locale = 'mn'; $mn->slug = 'mn'; $mn->google_code = 'mn'; $mn->facebook_locale = 'mn_MN'; $mr = new GP_Locale(); $mr->english_name = 'Marathi'; $mr->native_name = 'मराठी'; $mr->lang_code_iso_639_1 = 'mr'; $mr->lang_code_iso_639_2 = 'mar'; $mr->wp_locale = 'mr'; $mr->slug = 'mr'; $mr->google_code = 'mr'; $mr->facebook_locale = 'mr_IN'; $mri = new GP_Locale(); $mri->english_name = 'Maori'; $mri->native_name = 'Te Reo Māori'; $mri->lang_code_iso_639_1 = 'mi'; $mri->lang_code_iso_639_3 = 'mri'; $mri->country_code = 'nz'; $mri->slug = 'mri'; $mri->wp_locale = 'mri'; $mri->nplurals = 2; $mri->plural_expression = '(n > 1)'; $mri->google_code = 'mi'; $mrj = new GP_Locale(); $mrj->english_name = 'Mari (Hill)'; $mrj->native_name = 'Кырык мары'; $mrj->lang_code_iso_639_3 = 'mrj'; $mrj->country_code = 'ru'; $mrj->slug = 'mrj'; $ms = new GP_Locale(); $ms->english_name = 'Malay'; $ms->native_name = 'Bahasa Melayu'; $ms->lang_code_iso_639_1 = 'ms'; $ms->lang_code_iso_639_2 = 'msa'; $ms->wp_locale = 'ms_MY'; $ms->slug = 'ms'; $ms->nplurals = 1; $ms->plural_expression = '0'; $ms->google_code = 'ms'; $ms->facebook_locale = 'ms_MY'; $mwl = new GP_Locale(); $mwl->english_name = 'Mirandese'; $mwl->native_name = 'Mirandés'; $mwl->lang_code_iso_639_2 = 'mwl'; $mwl->slug = 'mwl'; $my = new GP_Locale(); $my->english_name = 'Myanmar (Burmese)'; $my->native_name = 'ဗမာစာ'; $my->lang_code_iso_639_1 = 'my'; $my->lang_code_iso_639_2 = 'mya'; $my->country_code = 'mm'; $my->wp_locale = 'my_MM'; $my->slug = 'mya'; $my->google_code = 'my'; $ne = new GP_Locale(); $ne->english_name = 'Nepali'; $ne->native_name = 'नेपाली'; $ne->lang_code_iso_639_1 = 'ne'; $ne->lang_code_iso_639_2 = 'nep'; $ne->country_code = 'np'; $ne->wp_locale = 'ne_NP'; $ne->slug = 'ne'; $ne->google_code = 'ne'; $ne->facebook_locale = 'ne_NP'; $nb = new GP_Locale(); $nb->english_name = 'Norwegian (Bokmål)'; $nb->native_name = 'Norsk bokmål'; $nb->lang_code_iso_639_1 = 'nb'; $nb->lang_code_iso_639_2 = 'nob'; $nb->country_code = 'no'; $nb->wp_locale = 'nb_NO'; $nb->slug = 'nb'; $nb->google_code = 'no'; $nb->facebook_locale = 'nb_NO'; $nl = new GP_Locale(); $nl->english_name = 'Dutch'; $nl->native_name = 'Nederlands'; $nl->lang_code_iso_639_1 = 'nl'; $nl->lang_code_iso_639_2 = 'nld'; $nl->country_code = 'nl'; $nl->wp_locale = 'nl_NL'; $nl->slug = 'nl'; $nl->google_code = 'nl'; $nl->facebook_locale = 'nl_NL'; $nl_be = new GP_Locale(); $nl_be->english_name = 'Dutch (Belgium)'; $nl_be->native_name = 'Nederlands (België)'; $nl_be->lang_code_iso_639_1 = 'nl'; $nl_be->lang_code_iso_639_2 = 'nld'; $nl_be->country_code = 'be'; $nl_be->wp_locale = 'nl_BE'; $nl_be->slug = 'nl-be'; $nl_be->google_code = 'nl'; $nn = new GP_Locale(); $nn->english_name = 'Norwegian (Nynorsk)'; $nn->native_name = 'Norsk nynorsk'; $nn->lang_code_iso_639_1 = 'nn'; $nn->lang_code_iso_639_2 = 'nno'; $nn->country_code = 'no'; $nn->wp_locale = 'nn_NO'; $nn->slug = 'nn'; $nn->google_code = 'no'; $nn->facebook_locale = 'nn_NO'; $no = new GP_Locale(); $no->english_name = 'Norwegian'; $no->native_name = 'Norsk'; $no->lang_code_iso_639_1 = 'no'; $no->lang_code_iso_639_2 = 'nor'; $no->country_code = 'no'; $no->slug = 'no'; $no->google_code = 'no'; $oci = new GP_Locale(); $oci->english_name = 'Occitan'; $oci->native_name = 'Occitan'; $oci->lang_code_iso_639_1 = 'oc'; $oci->lang_code_iso_639_2 = 'oci'; $oci->country_code = 'fr'; $oci->wp_locale = 'oci'; $oci->slug = 'oci'; $oci->nplurals = 2; $oci->plural_expression = '(n > 1)'; $orm = new GP_Locale(); $orm->english_name = 'Oromo'; $orm->native_name = 'Afaan Oromo'; $orm->lang_code_iso_639_1 = 'om'; $orm->lang_code_iso_639_2 = 'orm'; $orm->lang_code_iso_639_3 = 'orm'; $orm->slug = 'orm'; $orm->plural_expression = '(n > 1)'; $ory = new GP_Locale(); $ory->english_name = 'Oriya'; $ory->native_name = 'ଓଡ଼ିଆ'; $ory->lang_code_iso_639_1 = 'or'; $ory->lang_code_iso_639_2 = 'ory'; $ory->country_code = 'in'; $ory->wp_locale = 'ory'; $ory->slug = 'ory'; $ory->facebook_locale = 'or_IN'; $os = new GP_Locale(); $os->english_name = 'Ossetic'; $os->native_name = 'Ирон'; $os->lang_code_iso_639_1 = 'os'; $os->lang_code_iso_639_2 = 'oss'; $os->wp_locale = 'os'; $os->slug = 'os'; $pa = new GP_Locale(); $pa->english_name = 'Punjabi'; $pa->native_name = 'ਪੰਜਾਬੀ'; $pa->lang_code_iso_639_1 = 'pa'; $pa->lang_code_iso_639_2 = 'pan'; $pa->country_code = 'in'; $pa->wp_locale = 'pa_IN'; $pa->slug = 'pa'; $pa->google_code = 'pa'; $pa->facebook_locale = 'pa_IN'; $pap = new GP_Locale(); $pap->english_name = 'Papiamento'; $pap->native_name = 'Papiamentu'; $pap->lang_code_iso_639_2 = 'pap'; $pap->lang_code_iso_639_3 = 'pap'; $pap->country_code = 'cw'; $pap->wp_locale = 'pap'; $pap->slug = 'pap'; $pirate = new GP_Locale(); $pirate->english_name = 'English (Pirate)'; $pirate->native_name = 'English (Pirate)'; $pirate->lang_code_iso_639_2 = 'art'; $pirate->wp_locale = 'art_xpirate'; $pirate->slug = 'pirate'; $pirate->google_code = 'xx-pirate'; $pirate->facebook_locale = 'en_PI'; $pl = new GP_Locale(); $pl->english_name = 'Polish'; $pl->native_name = 'Polski'; $pl->lang_code_iso_639_1 = 'pl'; $pl->lang_code_iso_639_2 = 'pol'; $pl->country_code = 'pl'; $pl->wp_locale = 'pl_PL'; $pl->slug = 'pl'; $pl->nplurals = 3; $pl->plural_expression = '(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $pl->google_code = 'pl'; $pl->facebook_locale = 'pl_PL'; $pt_br = new GP_Locale(); $pt_br->english_name = 'Portuguese (Brazil)'; $pt_br->native_name = 'Português do Brasil'; $pt_br->lang_code_iso_639_1 = 'pt'; $pt_br->lang_code_iso_639_2 = 'por'; $pt_br->country_code = 'br'; $pt_br->wp_locale = 'pt_BR'; $pt_br->slug = 'pt-br'; $pt_br->nplurals = 2; $pt_br->plural_expression = '(n > 1)'; $pt_br->google_code = 'pt-BR'; $pt_br->facebook_locale = 'pt_BR'; $pt = new GP_Locale(); $pt->english_name = 'Portuguese (Portugal)'; $pt->native_name = 'Português'; $pt->lang_code_iso_639_1 = 'pt'; $pt->country_code = 'pt'; $pt->wp_locale = 'pt_PT'; $pt->slug = 'pt'; $pt->google_code = 'pt-PT'; $pt->facebook_locale = 'pt_PT'; $ps = new GP_Locale(); $ps->english_name = 'Pashto'; $ps->native_name = 'پښتو'; $ps->lang_code_iso_639_1 = 'ps'; $ps->lang_code_iso_639_2 = 'pus'; $ps->country_code = 'af'; $ps->wp_locale = 'ps'; $ps->slug = 'ps'; $ps->text_direction = 'rtl'; $ps->facebook_locale = 'ps_AF'; $rhg = new GP_Locale(); $rhg->english_name = 'Rohingya'; $rhg->native_name = 'Ruáinga'; $rhg->lang_code_iso_639_3 = 'rhg'; $rhg->country_code = 'mm'; $rhg->wp_locale = 'rhg'; $rhg->slug = 'rhg'; $rhg->nplurals = 1; $rhg->plural_expression = '0'; $ro = new GP_Locale(); $ro->english_name = 'Romanian'; $ro->native_name = 'Română'; $ro->lang_code_iso_639_1 = 'ro'; $ro->lang_code_iso_639_2 = 'ron'; $ro->country_code = 'ro'; $ro->wp_locale = 'ro_RO'; $ro->slug = 'ro'; $ro->nplurals = 3; $ro->plural_expression = '(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2)'; $ro->google_code = 'ro'; $ro->facebook_locale = 'ro_RO'; $roh = new GP_Locale(); $roh->english_name = 'Romansh'; $roh->native_name = 'Rumantsch'; $roh->lang_code_iso_639_2 = 'rm'; $roh->lang_code_iso_639_3 = 'roh'; $roh->country_code = 'ch'; $roh->wp_locale = 'roh'; $roh->slug = 'roh'; $ru = new GP_Locale(); $ru->english_name = 'Russian'; $ru->native_name = 'Русский'; $ru->lang_code_iso_639_1 = 'ru'; $ru->lang_code_iso_639_2 = 'rus'; $ru->country_code = 'ru'; $ru->wp_locale = 'ru_RU'; $ru->slug = 'ru'; $ru->nplurals = 3; $ru->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $ru->google_code = 'ru'; $ru->facebook_locale = 'ru_RU'; $rue = new GP_Locale(); $rue->english_name = 'Rusyn'; $rue->native_name = 'Русиньскый'; $rue->lang_code_iso_639_3 = 'rue'; $rue->wp_locale = 'rue'; $rue->slug = 'rue'; $rue->nplurals = 3; $rue->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $rup = new GP_Locale(); $rup->english_name = 'Aromanian'; $rup->native_name = 'Armãneashce'; $rup->lang_code_iso_639_2 = 'rup'; $rup->lang_code_iso_639_3 = 'rup'; $rup->country_code = 'mk'; $rup->wp_locale = 'rup_MK'; $rup->slug = 'rup'; $sah = new GP_Locale(); $sah->english_name = 'Sakha'; $sah->native_name = 'Сахалыы'; $sah->lang_code_iso_639_2 = 'sah'; $sah->lang_code_iso_639_3 = 'sah'; $sah->country_code = 'ru'; $sah->wp_locale = 'sah'; $sah->slug = 'sah'; $sa_in = new GP_Locale(); $sa_in->english_name = 'Sanskrit'; $sa_in->native_name = 'भारतम्'; $sa_in->lang_code_iso_639_1 = 'sa'; $sa_in->lang_code_iso_639_2 = 'san'; $sa_in->lang_code_iso_639_3 = 'san'; $sa_in->country_code = 'in'; $sa_in->wp_locale = 'sa_IN'; $sa_in->slug = 'sa-in'; $sa_in->facebook_locale = 'sa_IN'; $scn = new GP_Locale(); $scn->english_name = 'Sicilian'; $scn->native_name = 'Sicilianu'; $scn->lang_code_iso_639_3 = 'scn'; $scn->country_code = 'it'; $scn->wp_locale = 'scn'; $scn->slug = 'scn'; $si = new GP_Locale(); $si->english_name = 'Sinhala'; $si->native_name = 'සිංහල'; $si->lang_code_iso_639_1 = 'si'; $si->lang_code_iso_639_2 = 'sin'; $si->country_code = 'lk'; $si->wp_locale = 'si_LK'; $si->slug = 'si'; $si->google_code = 'si'; $si->facebook_locale = 'si_LK'; $sk = new GP_Locale(); $sk->english_name = 'Slovak'; $sk->native_name = 'Slovenčina'; $sk->lang_code_iso_639_1 = 'sk'; $sk->lang_code_iso_639_2 = 'slk'; $sk->country_code = 'sk'; $sk->slug = 'sk'; $sk->wp_locale = 'sk_SK'; $sk->nplurals = 3; $sk->plural_expression = '(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2'; $sk->google_code = 'sk'; $sk->facebook_locale = 'sk_SK'; $skr = new GP_Locale(); $skr->english_name = 'Saraiki'; $skr->native_name = 'سرائیکی'; $skr->lang_code_iso_639_3 = 'skr'; $skr->country_code = 'pk'; $skr->wp_locale = 'skr'; $skr->slug = 'skr'; $skr->nplurals = 2; $skr->plural_expression = '(n > 1)'; $skr->text_direction = 'rtl'; $sl = new GP_Locale(); $sl->english_name = 'Slovenian'; $sl->native_name = 'Slovenščina'; $sl->lang_code_iso_639_1 = 'sl'; $sl->lang_code_iso_639_2 = 'slv'; $sl->country_code = 'si'; $sl->wp_locale = 'sl_SI'; $sl->slug = 'sl'; $sl->nplurals = 4; $sl->plural_expression = '(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3)'; $sl->google_code = 'sl'; $sl->facebook_locale = 'sl_SI'; $sna = new GP_Locale(); $sna->english_name = 'Shona'; $sna->native_name = 'ChiShona'; $sna->lang_code_iso_639_1 = 'sn'; $sna->lang_code_iso_639_3 = 'sna'; $sna->country_code = 'zw'; $sna->wp_locale = 'sna'; $sna->slug = 'sna'; $snd = new GP_Locale(); $snd->english_name = 'Sindhi'; $snd->native_name = 'سنڌي'; $snd->lang_code_iso_639_1 = 'sd'; $snd->lang_code_iso_639_2 = 'sd'; $snd->lang_code_iso_639_3 = 'snd'; $snd->country_code = 'pk'; $snd->wp_locale = 'snd'; $snd->slug = 'snd'; $snd->text_direction = 'rtl'; $so = new GP_Locale(); $so->english_name = 'Somali'; $so->native_name = 'Afsoomaali'; $so->lang_code_iso_639_1 = 'so'; $so->lang_code_iso_639_2 = 'som'; $so->lang_code_iso_639_3 = 'som'; $so->country_code = 'so'; $so->wp_locale = 'so_SO'; $so->slug = 'so'; $so->google_code = 'so'; $so->facebook_locale = 'so_SO'; $sq = new GP_Locale(); $sq->english_name = 'Albanian'; $sq->native_name = 'Shqip'; $sq->lang_code_iso_639_1 = 'sq'; $sq->lang_code_iso_639_2 = 'sqi'; $sq->wp_locale = 'sq'; $sq->country_code = 'al'; $sq->slug = 'sq'; $sq->google_code = 'sq'; $sq->facebook_locale = 'sq_AL'; $sq_xk = new GP_Locale(); $sq_xk->english_name = 'Shqip (Kosovo)'; $sq_xk->native_name = 'Për Kosovën Shqip'; $sq_xk->lang_code_iso_639_1 = 'sq'; $sq_xk->country_code = 'xk'; // Temporary country code until Kosovo is assigned an ISO code. $sq_xk->wp_locale = 'sq_XK'; $sq_xk->slug = 'sq-xk'; $sr = new GP_Locale(); $sr->english_name = 'Serbian'; $sr->native_name = 'Српски језик'; $sr->lang_code_iso_639_1 = 'sr'; $sr->lang_code_iso_639_2 = 'srp'; $sr->country_code = 'rs'; $sr->wp_locale = 'sr_RS'; $sr->slug = 'sr'; $sr->nplurals = 3; $sr->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $sr->google_code = 'sr'; $sr->facebook_locale = 'sr_RS'; $srd = new GP_Locale(); $srd->english_name = 'Sardinian'; $srd->native_name = 'Sardu'; $srd->lang_code_iso_639_1 = 'sc'; $srd->lang_code_iso_639_2 = 'srd'; $srd->country_code = 'it'; $srd->wp_locale = 'srd'; $srd->slug = 'srd'; $srd->facebook_locale = 'sc_IT'; $ssw = new GP_Locale(); $ssw->english_name = 'Swati'; $ssw->native_name = 'SiSwati'; $ssw->lang_code_iso_639_1 = 'ss'; $ssw->lang_code_iso_639_2 = 'ssw'; $ssw->lang_code_iso_639_3 = 'ssw'; $ssw->country_code = 'sz'; $ssw->wp_locale = 'ssw'; $ssw->slug = 'ssw'; $su = new GP_Locale(); $su->english_name = 'Sundanese'; $su->native_name = 'Basa Sunda'; $su->lang_code_iso_639_1 = 'su'; $su->lang_code_iso_639_2 = 'sun'; $su->country_code = 'id'; $su->wp_locale = 'su_ID'; $su->slug = 'su'; $su->nplurals = 1; $su->plural_expression = '0'; $su->google_code = 'su'; $sv = new GP_Locale(); $sv->english_name = 'Swedish'; $sv->native_name = 'Svenska'; $sv->lang_code_iso_639_1 = 'sv'; $sv->lang_code_iso_639_2 = 'swe'; $sv->country_code = 'se'; $sv->wp_locale = 'sv_SE'; $sv->slug = 'sv'; $sv->google_code = 'sv'; $sv->facebook_locale = 'sv_SE'; $sw = new GP_Locale(); $sw->english_name = 'Swahili'; $sw->native_name = 'Kiswahili'; $sw->lang_code_iso_639_1 = 'sw'; $sw->lang_code_iso_639_2 = 'swa'; $sw->wp_locale = 'sw'; $sw->slug = 'sw'; $sw->google_code = 'sw'; $sw->facebook_locale = 'sw_KE'; $syr = new GP_Locale(); $syr->english_name = 'Syriac'; $syr->native_name = 'Syriac'; $syr->lang_code_iso_639_3 = 'syr'; $syr->country_code = 'iq'; $syr->wp_locale = 'syr'; $syr->slug = 'syr'; $szl = new GP_Locale(); $szl->english_name = 'Silesian'; $szl->native_name = 'Ślōnskŏ gŏdka'; $szl->lang_code_iso_639_3 = 'szl'; $szl->country_code = 'pl'; $szl->wp_locale = 'szl'; $szl->slug = 'szl'; $szl->nplurals = 3; $szl->plural_expression = '(n==1 ? 0 : n%10>=2 && n%10<=4 && n%100==20 ? 1 : 2)'; $szl->facebook_locale = 'sz_PL'; $ta = new GP_Locale(); $ta->english_name = 'Tamil'; $ta->native_name = 'தமிழ்'; $ta->lang_code_iso_639_1 = 'ta'; $ta->lang_code_iso_639_2 = 'tam'; $ta->country_code = 'in'; $ta->wp_locale = 'ta_IN'; $ta->slug = 'ta'; $ta->google_code = 'ta'; $ta->facebook_locale = 'ta_IN'; $ta_lk = new GP_Locale(); $ta_lk->english_name = 'Tamil (Sri Lanka)'; $ta_lk->native_name = 'தமிழ்'; $ta_lk->lang_code_iso_639_1 = 'ta'; $ta_lk->lang_code_iso_639_2 = 'tam'; $ta_lk->country_code = 'lk'; $ta_lk->wp_locale = 'ta_LK'; $ta_lk->slug = 'ta-lk'; $ta_lk->google_code = 'ta'; $tah = new GP_Locale(); $tah->english_name = 'Tahitian'; $tah->native_name = 'Reo Tahiti'; $tah->lang_code_iso_639_1 = 'ty'; $tah->lang_code_iso_639_2 = 'tah'; $tah->lang_code_iso_639_3 = 'tah'; $tah->country_code = 'fr'; $tah->wp_locale = 'tah'; $tah->slug = 'tah'; $tah->nplurals = 2; $tah->plural_expression = '(n > 1)'; $te = new GP_Locale(); $te->english_name = 'Telugu'; $te->native_name = 'తెలుగు'; $te->lang_code_iso_639_1 = 'te'; $te->lang_code_iso_639_2 = 'tel'; $te->wp_locale = 'te'; $te->slug = 'te'; $te->google_code = 'te'; $te->facebook_locale = 'te_IN'; $tg = new GP_Locale(); $tg->english_name = 'Tajik'; $tg->native_name = 'Тоҷикӣ'; $tg->lang_code_iso_639_1 = 'tg'; $tg->lang_code_iso_639_2 = 'tgk'; $tah->country_code = 'tj'; $tg->wp_locale = 'tg'; $tg->slug = 'tg'; $tg->google_code = 'tg'; $tg->facebook_locale = 'tg_TJ'; $th = new GP_Locale(); $th->english_name = 'Thai'; $th->native_name = 'ไทย'; $th->lang_code_iso_639_1 = 'th'; $th->lang_code_iso_639_2 = 'tha'; $th->wp_locale = 'th'; $th->slug = 'th'; $th->nplurals = 1; $th->plural_expression = '0'; $th->google_code = 'th'; $th->facebook_locale = 'th_TH'; $tir = new GP_Locale(); $tir->english_name = 'Tigrinya'; $tir->native_name = 'ትግርኛ'; $tir->lang_code_iso_639_1 = 'ti'; $tir->lang_code_iso_639_2 = 'tir'; $tir->country_code = 'er'; $tir->wp_locale = 'tir'; $tir->slug = 'tir'; $tir->nplurals = 1; $tir->plural_expression = '0'; $tlh = new GP_Locale(); $tlh->english_name = 'Klingon'; $tlh->native_name = 'TlhIngan'; $tlh->lang_code_iso_639_2 = 'tlh'; $tlh->slug = 'tlh'; $tlh->nplurals = 1; $tlh->plural_expression = '0'; $tlh->facebook_locale = 'tl_ST'; $tl = new GP_Locale(); $tl->english_name = 'Tagalog'; $tl->native_name = 'Tagalog'; $tl->lang_code_iso_639_1 = 'tl'; $tl->lang_code_iso_639_2 = 'tgl'; $tl->country_code = 'ph'; $tl->wp_locale = 'tl'; $tl->slug = 'tl'; $tl->google_code = 'tl'; $tl->facebook_locale = 'tl_PH'; $tr = new GP_Locale(); $tr->english_name = 'Turkish'; $tr->native_name = 'Türkçe'; $tr->lang_code_iso_639_1 = 'tr'; $tr->lang_code_iso_639_2 = 'tur'; $tr->country_code = 'tr'; $tr->wp_locale = 'tr_TR'; $tr->slug = 'tr'; $tr->nplurals = 2; $tr->plural_expression = '(n > 1)'; $tr->google_code = 'tr'; $tr->facebook_locale = 'tr_TR'; $tt_ru = new GP_Locale(); $tt_ru->english_name = 'Tatar'; $tt_ru->native_name = 'Татар теле'; $tt_ru->lang_code_iso_639_1 = 'tt'; $tt_ru->lang_code_iso_639_2 = 'tat'; $tt_ru->country_code = 'ru'; $tt_ru->wp_locale = 'tt_RU'; $tt_ru->slug = 'tt'; $tt_ru->nplurals = 1; $tt_ru->plural_expression = '0'; $tt_ru->facebook_locale = 'tt_RU'; $tuk = new GP_Locale(); $tuk->english_name = 'Turkmen'; $tuk->native_name = 'Türkmençe'; $tuk->lang_code_iso_639_1 = 'tk'; $tuk->lang_code_iso_639_2 = 'tuk'; $tuk->country_code = 'tm'; $tuk->wp_locale = 'tuk'; $tuk->slug = 'tuk'; $tuk->nplurals = 2; $tuk->plural_expression = '(n > 1)'; $tuk->facebook_locale = 'tk_TM'; $twd = new GP_Locale(); $twd->english_name = 'Tweants'; $twd->native_name = 'Twents'; $twd->lang_code_iso_639_3 = 'twd'; $twd->country_code = 'nl'; $twd->wp_locale = 'twd'; $twd->slug = 'twd'; $tzm = new GP_Locale(); $tzm->english_name = 'Tamazight (Central Atlas)'; $tzm->native_name = 'ⵜⴰⵎⴰⵣⵉⵖⵜ'; $tzm->lang_code_iso_639_2 = 'tzm'; $tzm->country_code = 'ma'; $tzm->wp_locale = 'tzm'; $tzm->slug = 'tzm'; $tzm->nplurals = 2; $tzm->plural_expression = '(n > 1)'; $udm = new GP_Locale(); $udm->english_name = 'Udmurt'; $udm->native_name = 'Удмурт кыл'; $udm->lang_code_iso_639_2 = 'udm'; $udm->slug = 'udm'; $ug = new GP_Locale(); $ug->english_name = 'Uighur'; $ug->native_name = 'ئۇيغۇرچە'; $ug->lang_code_iso_639_1 = 'ug'; $ug->lang_code_iso_639_2 = 'uig'; $ug->country_code = 'cn'; $ug->wp_locale = 'ug_CN'; $ug->slug = 'ug'; $ug->text_direction = 'rtl'; $uk = new GP_Locale(); $uk->english_name = 'Ukrainian'; $uk->native_name = 'Українська'; $uk->lang_code_iso_639_1 = 'uk'; $uk->lang_code_iso_639_2 = 'ukr'; $uk->country_code = 'ua'; $uk->wp_locale = 'uk'; $uk->slug = 'uk'; $uk->nplurals = 3; $uk->plural_expression = '(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)'; $uk->google_code = 'uk'; $uk->facebook_locale = 'uk_UA'; $ur = new GP_Locale(); $ur->english_name = 'Urdu'; $ur->native_name = 'اردو'; $ur->lang_code_iso_639_1 = 'ur'; $ur->lang_code_iso_639_2 = 'urd'; $ur->country_code = 'pk'; $ur->wp_locale = 'ur'; $ur->slug = 'ur'; $ur->text_direction = 'rtl'; $ur->google_code = 'ur'; $ur->facebook_locale = 'ur_PK'; $uz = new GP_Locale(); $uz->english_name = 'Uzbek'; $uz->native_name = 'O‘zbekcha'; $uz->lang_code_iso_639_1 = 'uz'; $uz->lang_code_iso_639_2 = 'uzb'; $uz->country_code = 'uz'; $uz->wp_locale = 'uz_UZ'; $uz->slug = 'uz'; $uz->nplurals = 1; $uz->plural_expression = '0'; $uz->google_code = 'uz'; $uz->facebook_locale = 'uz_UZ'; $vec = new GP_Locale(); $vec->english_name = 'Venetian'; $vec->native_name = 'Vèneta'; $vec->lang_code_iso_639_2 = 'roa'; $vec->lang_code_iso_639_3 = 'vec'; $vec->country_code = 'it'; $vec->slug = 'vec'; $vi = new GP_Locale(); $vi->english_name = 'Vietnamese'; $vi->native_name = 'Tiếng Việt'; $vi->lang_code_iso_639_1 = 'vi'; $vi->lang_code_iso_639_2 = 'vie'; $vi->country_code = 'vn'; $vi->wp_locale = 'vi'; $vi->slug = 'vi'; $vi->nplurals = 1; $vi->plural_expression = '0'; $vi->google_code = 'vi'; $vi->facebook_locale = 'vi_VN'; $wa = new GP_Locale(); $wa->english_name = 'Walloon'; $wa->native_name = 'Walon'; $wa->lang_code_iso_639_1 = 'wa'; $wa->lang_code_iso_639_2 = 'wln'; $wa->country_code = 'be'; $wa->wp_locale = 'wa'; $wa->slug = 'wa'; $xho = new GP_Locale(); $xho->english_name = 'Xhosa'; $xho->native_name = 'isiXhosa'; $xho->lang_code_iso_639_1 = 'xh'; $xho->lang_code_iso_639_2 = 'xho'; $xho->lang_code_iso_639_3 = 'xho'; $xho->country_code = 'za'; $xho->wp_locale = 'xho'; $xho->slug = 'xho'; $xho->google_code = 'xh'; $xho->facebook_locale = 'xh_ZA'; $xmf = new GP_Locale(); $xmf->english_name = 'Mingrelian'; $xmf->native_name = 'მარგალური ნინა'; $xmf->lang_code_iso_639_3 = 'xmf'; $xmf->country_code = 'ge'; $xmf->wp_locale = 'xmf'; $xmf->slug = 'xmf'; $yi = new GP_Locale(); $yi->english_name = 'Yiddish'; $yi->native_name = 'ייִדיש'; $yi->lang_code_iso_639_1 = 'yi'; $yi->lang_code_iso_639_2 = 'yid'; $yi->slug = 'yi'; $yi->text_direction = 'rtl'; $yi->google_code = 'yi'; $yor = new GP_Locale(); $yor->english_name = 'Yoruba'; $yor->native_name = 'Yorùbá'; $yor->lang_code_iso_639_1 = 'yo'; $yor->lang_code_iso_639_2 = 'yor'; $yor->lang_code_iso_639_3 = 'yor'; $yor->country_code = 'ng'; $yor->wp_locale = 'yor'; $yor->slug = 'yor'; $yor->google_code = 'yo'; $yor->facebook_locale = 'yo_NG'; $zh_cn = new GP_Locale(); $zh_cn->english_name = 'Chinese (China)'; $zh_cn->native_name = '简体中文'; $zh_cn->lang_code_iso_639_1 = 'zh'; $zh_cn->lang_code_iso_639_2 = 'zho'; $zh_cn->country_code = 'cn'; $zh_cn->wp_locale = 'zh_CN'; $zh_cn->slug = 'zh-cn'; $zh_cn->nplurals = 1; $zh_cn->plural_expression = '0'; $zh_cn->google_code = 'zh-CN'; $zh_cn->facebook_locale = 'zh_CN'; $zh_hk = new GP_Locale(); $zh_hk->english_name = 'Chinese (Hong Kong)'; $zh_hk->native_name = '香港中文版 '; $zh_hk->lang_code_iso_639_1 = 'zh'; $zh_hk->lang_code_iso_639_2 = 'zho'; $zh_hk->country_code = 'hk'; $zh_hk->wp_locale = 'zh_HK'; $zh_hk->slug = 'zh-hk'; $zh_hk->nplurals = 1; $zh_hk->plural_expression = '0'; $zh_hk->facebook_locale = 'zh_HK'; $zh_sg = new GP_Locale(); $zh_sg->english_name = 'Chinese (Singapore)'; $zh_sg->native_name = '中文'; $zh_sg->lang_code_iso_639_1 = 'zh'; $zh_sg->lang_code_iso_639_2 = 'zho'; $zh_sg->country_code = 'sg'; $zh_sg->wp_locale = 'zh_SG'; $zh_sg->slug = 'zh-sg'; $zh_sg->nplurals = 1; $zh_sg->plural_expression = '0'; $zh_tw = new GP_Locale(); $zh_tw->english_name = 'Chinese (Taiwan)'; $zh_tw->native_name = '繁體中文'; $zh_tw->lang_code_iso_639_1 = 'zh'; $zh_tw->lang_code_iso_639_2 = 'zho'; $zh_tw->country_code = 'tw'; $zh_tw->slug = 'zh-tw'; $zh_tw->wp_locale= 'zh_TW'; $zh_tw->nplurals = 1; $zh_tw->plural_expression = '0'; $zh_tw->google_code = 'zh-TW'; $zh_tw->facebook_locale = 'zh_TW'; $zh = new GP_Locale(); $zh->english_name = 'Chinese'; $zh->native_name = '中文'; $zh->lang_code_iso_639_1 = 'zh'; $zh->lang_code_iso_639_2 = 'zho'; $zh->slug = 'zh'; $zh->nplurals = 1; $zh->plural_expression = '0'; $zul = new GP_Locale(); $zul->english_name = 'Zulu'; $zul->native_name = 'isiZulu'; $zul->lang_code_iso_639_1 = 'zu'; $zul->lang_code_iso_639_2 = 'zul'; $zul->lang_code_iso_639_3 = 'zul'; $zul->country_code = 'za'; $zul->wp_locale = 'zul'; $zul->slug = 'zul'; $zul->google_code = 'zu'; foreach( get_defined_vars() as $locale ) { $this->locales[ $locale->slug ] = $locale; } } public static function &instance() { if ( ! isset( $GLOBALS['gp_locales'] ) ) $GLOBALS['gp_locales'] = new GP_Locales; return $GLOBALS['gp_locales']; } public static function locales() { $instance = GP_Locales::instance(); return $instance->locales; } public static function exists( $slug ) { $instance = GP_Locales::instance(); return isset( $instance->locales[ $slug ] ); } public static function by_slug( $slug ) { $instance = GP_Locales::instance(); return isset( $instance->locales[ $slug ] )? $instance->locales[ $slug ] : null; } public static function by_field( $field_name, $field_value ) { $instance = GP_Locales::instance(); $result = false; foreach( $instance->locales() as $locale ) { if ( isset( $locale->$field_name ) && $locale->$field_name == $field_value ) { $result = $locale; break; } } return $result; } } endif;
{ "pile_set_name": "Github" }
/* * Copyright (c) 2016 Maxime Ripard. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * 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. */ #ifndef _CCU_NKMP_H_ #define _CCU_NKMP_H_ #include <linux/clk-provider.h> #include "ccu_common.h" #include "ccu_div.h" #include "ccu_mult.h" /* * struct ccu_nkmp - Definition of an N-K-M-P clock * * Clocks based on the formula parent * N * K >> P / M */ struct ccu_nkmp { u32 enable; u32 lock; struct ccu_mult_internal n; struct ccu_mult_internal k; struct ccu_div_internal m; struct ccu_div_internal p; struct ccu_common common; }; #define SUNXI_CCU_NKMP_WITH_GATE_LOCK(_struct, _name, _parent, _reg, \ _nshift, _nwidth, \ _kshift, _kwidth, \ _mshift, _mwidth, \ _pshift, _pwidth, \ _gate, _lock, _flags) \ struct ccu_nkmp _struct = { \ .enable = _gate, \ .lock = _lock, \ .n = _SUNXI_CCU_MULT(_nshift, _nwidth), \ .k = _SUNXI_CCU_MULT(_kshift, _kwidth), \ .m = _SUNXI_CCU_DIV(_mshift, _mwidth), \ .p = _SUNXI_CCU_DIV(_pshift, _pwidth), \ .common = { \ .reg = _reg, \ .hw.init = CLK_HW_INIT(_name, \ _parent, \ &ccu_nkmp_ops, \ _flags), \ }, \ } static inline struct ccu_nkmp *hw_to_ccu_nkmp(struct clk_hw *hw) { struct ccu_common *common = hw_to_ccu_common(hw); return container_of(common, struct ccu_nkmp, common); } extern const struct clk_ops ccu_nkmp_ops; #endif /* _CCU_NKMP_H_ */
{ "pile_set_name": "Github" }
/** * @author Richard Davey <[email protected]> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var Centroid = require('./Centroid'); var Offset = require('./Offset'); /** * @callback CenterFunction * * @param {Phaser.Geom.Triangle} triangle - The Triangle to return the center coordinates of. * * @return {Phaser.Math.Vector2} The center point of the Triangle according to the function. */ /** * Positions the Triangle so that it is centered on the given coordinates. * * @function Phaser.Geom.Triangle.CenterOn * @since 3.0.0 * * @generic {Phaser.Geom.Triangle} O - [triangle,$return] * * @param {Phaser.Geom.Triangle} triangle - The triangle to be positioned. * @param {number} x - The horizontal coordinate to center on. * @param {number} y - The vertical coordinate to center on. * @param {CenterFunction} [centerFunc] - The function used to center the triangle. Defaults to Centroid centering. * * @return {Phaser.Geom.Triangle} The Triangle that was centered. */ var CenterOn = function (triangle, x, y, centerFunc) { if (centerFunc === undefined) { centerFunc = Centroid; } // Get the center of the triangle var center = centerFunc(triangle); // Difference var diffX = x - center.x; var diffY = y - center.y; return Offset(triangle, diffX, diffY); }; module.exports = CenterOn;
{ "pile_set_name": "Github" }
#include "script_component.hpp" /* * Author: Rocko, Ruthberg * Deploy tactical ladder * * Arguments: * 0: unit <OBJECT> * * Return Value: * None * * Example: * [_unit] call ace_tacticalladder_fnc_deployTL * * Public: No */ params ["_unit"]; if (backpack _unit != 'ACE_TacticalLadder_Pack') exitWith {}; removeBackpack _unit; private _pos = _unit modelToWorld [0,0,0]; private _offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8}; _pos set [0, (_pos select 0) + (sin getDir _unit) * _offset]; _pos set [1, (_pos select 1) + (cos getDir _unit) * _offset]; _pos set [2, [_unit] call CBA_fnc_realHeight]; private _ladder = "ACE_TacticalLadder" createVehicle _pos; _ladder setPos _pos; _ladder setDir getDir _unit; _unit reveal _ladder;
{ "pile_set_name": "Github" }
/****************************************************************************** * * Copyright(c) 2007 - 2017 Realtek Corporation. * * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. * * 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. * *****************************************************************************/ #ifndef __HAL_IC_CFG_H__ #define __HAL_IC_CFG_H__ #define RTL8188E_SUPPORT 0 #define RTL8812A_SUPPORT 0 #define RTL8821A_SUPPORT 0 #define RTL8723B_SUPPORT 0 #define RTL8723D_SUPPORT 0 #define RTL8192E_SUPPORT 0 #define RTL8192F_SUPPORT 0 #define RTL8814A_SUPPORT 0 #define RTL8195A_SUPPORT 0 #define RTL8197F_SUPPORT 0 #define RTL8703B_SUPPORT 0 #define RTL8188F_SUPPORT 0 #define RTL8822B_SUPPORT 0 #define RTL8821B_SUPPORT 0 #define RTL8821C_SUPPORT 0 #define RTL8710B_SUPPORT 0 #define RTL8814B_SUPPORT 0 #define RTL8824B_SUPPORT 0 #define RTL8198F_SUPPORT 0 #define RTL8195B_SUPPORT 0 #define RTL8822C_SUPPORT 0 #define RTL8812F_SUPPORT 0 #define RTL8197G_SUPPORT 0 #define RTL8721D_SUPPORT 0 /*#if (RTL8188E_SUPPORT==1)*/ #define RATE_ADAPTIVE_SUPPORT 0 #define POWER_TRAINING_ACTIVE 0 #ifdef CONFIG_MULTIDRV #endif #ifdef CONFIG_RTL8188E #undef RTL8188E_SUPPORT #undef RATE_ADAPTIVE_SUPPORT #undef POWER_TRAINING_ACTIVE #define RTL8188E_SUPPORT 1 #define RATE_ADAPTIVE_SUPPORT 1 #define POWER_TRAINING_ACTIVE 1 #endif #ifdef CONFIG_RTL8812A #undef RTL8812A_SUPPORT #define RTL8812A_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8821A #undef RTL8821A_SUPPORT #define RTL8821A_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8192E #undef RTL8192E_SUPPORT #define RTL8192E_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8192F #undef RTL8192F_SUPPORT #define RTL8192F_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #ifndef CONFIG_RTW_MAC_HIDDEN_RPT #define CONFIG_RTW_MAC_HIDDEN_RPT #endif /*#define CONFIG_AMPDU_PRETX_CD*/ /*#define DBG_LA_MODE*/ #ifdef CONFIG_P2P_PS #define CONFIG_P2P_PS_NOA_USE_MACID_SLEEP #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8723B #undef RTL8723B_SUPPORT #define RTL8723B_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8723D #undef RTL8723D_SUPPORT #define RTL8723D_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #ifndef CONFIG_RTW_MAC_HIDDEN_RPT #define CONFIG_RTW_MAC_HIDDEN_RPT #endif #ifndef CONFIG_RTW_CUSTOMER_STR #define CONFIG_RTW_CUSTOMER_STR #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8814A #undef RTL8814A_SUPPORT #define RTL8814A_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #define CONFIG_FW_CORRECT_BCN #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8703B #undef RTL8703B_SUPPORT #define RTL8703B_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #ifndef CONFIG_RTW_MAC_HIDDEN_RPT #define CONFIG_RTW_MAC_HIDDEN_RPT #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8188F #undef RTL8188F_SUPPORT #define RTL8188F_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #ifndef CONFIG_RTW_MAC_HIDDEN_RPT #define CONFIG_RTW_MAC_HIDDEN_RPT #endif #ifndef CONFIG_RTW_CUSTOMER_STR #define CONFIG_RTW_CUSTOMER_STR #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8188GTV #undef RTL8188F_SUPPORT #define RTL8188F_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #ifndef CONFIG_RTW_MAC_HIDDEN_RPT #define CONFIG_RTW_MAC_HIDDEN_RPT #endif #ifndef CONFIG_RTW_CUSTOMER_STR #define CONFIG_RTW_CUSTOMER_STR #endif #define CONFIG_RTS_FULL_BW #endif #ifdef CONFIG_RTL8822B #undef RTL8822B_SUPPORT #define RTL8822B_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif /* CONFIG_FW_C2H_PKT */ #define RTW_TX_PA_BIAS /* Adjust TX PA Bias from eFuse */ #define CONFIG_DFS /* Enable 5G band 2&3 channel */ #define RTW_AMPDU_AGG_RETRY_AND_NEW #ifdef CONFIG_WOWLAN #define CONFIG_GTK_OL /*#define CONFIG_ARP_KEEP_ALIVE*/ #ifdef CONFIG_GPIO_WAKEUP #ifndef WAKEUP_GPIO_IDX #define WAKEUP_GPIO_IDX 6 /* WIFI Chip Side */ #endif /* !WAKEUP_GPIO_IDX */ #endif /* CONFIG_GPIO_WAKEUP */ #endif /* CONFIG_WOWLAN */ #ifdef CONFIG_CONCURRENT_MODE #define CONFIG_AP_PORT_SWAP #define CONFIG_FW_MULTI_PORT_SUPPORT #endif /* CONFIG_CONCURRENT_MODE */ /* * Beamforming related definition */ /* Beamforming mechanism is on driver not phydm, always disable it */ #define BEAMFORMING_SUPPORT 0 /* Only support new beamforming mechanism */ #ifdef CONFIG_BEAMFORMING #define RTW_BEAMFORMING_VERSION_2 #endif /* CONFIG_BEAMFORMING */ #ifndef CONFIG_RTW_MAC_HIDDEN_RPT #define CONFIG_RTW_MAC_HIDDEN_RPT #endif /* CONFIG_RTW_MAC_HIDDEN_RPT */ #ifndef DBG_RX_DFRAME_RAW_DATA #define DBG_RX_DFRAME_RAW_DATA #endif /* DBG_RX_DFRAME_RAW_DATA */ #ifndef RTW_IQK_FW_OFFLOAD #define RTW_IQK_FW_OFFLOAD #endif /* RTW_IQK_FW_OFFLOAD */ /* Checksum offload feature */ /*#define CONFIG_TCP_CSUM_OFFLOAD_TX*/ /* not ready */ #define CONFIG_TCP_CSUM_OFFLOAD_RX #define CONFIG_ADVANCE_OTA #ifdef CONFIG_MCC_MODE #define CONFIG_MCC_MODE_V2 #endif /* CONFIG_MCC_MODE */ #if defined(CONFIG_TDLS) && defined(CONFIG_TDLS_CH_SW) #define CONFIG_TDLS_CH_SW_V2 #endif #ifndef RTW_CHANNEL_SWITCH_OFFLOAD #ifdef CONFIG_TDLS_CH_SW_V2 #define RTW_CHANNEL_SWITCH_OFFLOAD #endif #endif /* RTW_CHANNEL_SWITCH_OFFLOAD */ #if defined(CONFIG_RTW_MESH) && !defined(RTW_PER_CMD_SUPPORT_FW) /* Supported since fw v22.1 */ #define RTW_PER_CMD_SUPPORT_FW #endif /* RTW_PER_CMD_SUPPORT_FW */ #define CONFIG_SUPPORT_FIFO_DUMP #define CONFIG_HW_P0_TSF_SYNC #define CONFIG_BCN_RECV_TIME #ifdef CONFIG_P2P_PS #define CONFIG_P2P_PS_NOA_USE_MACID_SLEEP #endif #define CONFIG_RTS_FULL_BW #endif /* CONFIG_RTL8822B */ #ifdef CONFIG_RTL8821C #undef RTL8821C_SUPPORT #define RTL8821C_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #ifdef CONFIG_NO_FW #ifdef CONFIG_RTW_MAC_HIDDEN_RPT #undef CONFIG_RTW_MAC_HIDDEN_RPT #endif #else #ifndef CONFIG_RTW_MAC_HIDDEN_RPT #define CONFIG_RTW_MAC_HIDDEN_RPT #endif #endif #define LOAD_FW_HEADER_FROM_DRIVER #define CONFIG_PHY_CAPABILITY_QUERY #ifdef CONFIG_CONCURRENT_MODE #define CONFIG_AP_PORT_SWAP #define CONFIG_FW_MULTI_PORT_SUPPORT #endif #define CONFIG_SUPPORT_FIFO_DUMP #ifndef RTW_IQK_FW_OFFLOAD #define RTW_IQK_FW_OFFLOAD #endif /* RTW_IQK_FW_OFFLOAD */ /*#define CONFIG_AMPDU_PRETX_CD*/ /*#define DBG_PRE_TX_HANG*/ /* Beamforming related definition */ /* Beamforming mechanism is on driver not phydm, always disable it */ #define BEAMFORMING_SUPPORT 0 /* Only support new beamforming mechanism */ #ifdef CONFIG_BEAMFORMING #define RTW_BEAMFORMING_VERSION_2 #endif /* CONFIG_BEAMFORMING */ #define CONFIG_HW_P0_TSF_SYNC #define CONFIG_BCN_RECV_TIME #ifdef CONFIG_P2P_PS #define CONFIG_P2P_PS_NOA_USE_MACID_SLEEP #endif #define CONFIG_RTS_FULL_BW #endif /*CONFIG_RTL8821C*/ #ifdef CONFIG_RTL8710B #undef RTL8710B_SUPPORT #define RTL8710B_SUPPORT 1 #ifndef CONFIG_FW_C2H_PKT #define CONFIG_FW_C2H_PKT #endif #define CONFIG_RTS_FULL_BW #endif #endif /*__HAL_IC_CFG_H__*/
{ "pile_set_name": "Github" }
"""distutils.file_util Utility functions for operating on single files. """ __revision__ = "$Id: file_util.py 86238 2010-11-06 04:06:18Z eric.araujo $" import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = {None: 'copying', 'hard': 'hard linking', 'sym': 'symbolically linking'} def _copy_file_contents(src, dst, buffer_size=16*1024): """Copy the file 'src' to 'dst'. Both must be filenames. Any error opening either file, reading from 'src', or writing to 'dst', raises DistutilsFileError. Data is read/written in chunks of 'buffer_size' bytes (default 16k). No attempt is made to handle anything apart from regular files. """ # Stolen from shutil module in the standard library, but with # custom error-handling added. fsrc = None fdst = None try: try: fsrc = open(src, 'rb') except os.error, (errno, errstr): raise DistutilsFileError("could not open '%s': %s" % (src, errstr)) if os.path.exists(dst): try: os.unlink(dst) except os.error, (errno, errstr): raise DistutilsFileError( "could not delete '%s': %s" % (dst, errstr)) try: fdst = open(dst, 'wb') except os.error, (errno, errstr): raise DistutilsFileError( "could not create '%s': %s" % (dst, errstr)) while 1: try: buf = fsrc.read(buffer_size) except os.error, (errno, errstr): raise DistutilsFileError( "could not read from '%s': %s" % (src, errstr)) if not buf: break try: fdst.write(buf) except os.error, (errno, errstr): raise DistutilsFileError( "could not write to '%s': %s" % (dst, errstr)) finally: if fdst: fdst.close() if fsrc: fsrc.close() def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0, link=None, verbose=1, dry_run=0): """Copy a file 'src' to 'dst'. If 'dst' is a directory, then 'src' is copied there with the same name; otherwise, it must be a filename. (If the file exists, it will be ruthlessly clobbered.) If 'preserve_mode' is true (the default), the file's mode (type and permission bits, or whatever is analogous on the current platform) is copied. If 'preserve_times' is true (the default), the last-modified and last-access times are copied as well. If 'update' is true, 'src' will only be copied if 'dst' does not exist, or if 'dst' does exist but is older than 'src'. 'link' allows you to make hard links (os.link) or symbolic links (os.symlink) instead of copying: set it to "hard" or "sym"; if it is None (the default), files are copied. Don't set 'link' on systems that don't support it: 'copy_file()' doesn't check if hard or symbolic linking is available. Under Mac OS, uses the native file copy function in macostools; on other systems, uses '_copy_file_contents()' to copy file contents. Return a tuple (dest_name, copied): 'dest_name' is the actual name of the output file, and 'copied' is true if the file was copied (or would have been copied, if 'dry_run' true). """ # XXX if the destination file already exists, we clobber it if # copying, but blow up if linking. Hmmm. And I don't know what # macostools.copyfile() does. Should definitely be consistent, and # should probably blow up if destination exists and we would be # changing it (ie. it's not already a hard/soft link to src OR # (not update) and (src newer than dst). from distutils.dep_util import newer from stat import ST_ATIME, ST_MTIME, ST_MODE, S_IMODE if not os.path.isfile(src): raise DistutilsFileError( "can't copy '%s': doesn't exist or not a regular file" % src) if os.path.isdir(dst): dir = dst dst = os.path.join(dst, os.path.basename(src)) else: dir = os.path.dirname(dst) if update and not newer(src, dst): if verbose >= 1: log.debug("not copying %s (output up-to-date)", src) return dst, 0 try: action = _copy_action[link] except KeyError: raise ValueError("invalid value '%s' for 'link' argument" % link) if verbose >= 1: if os.path.basename(dst) == os.path.basename(src): log.info("%s %s -> %s", action, src, dir) else: log.info("%s %s -> %s", action, src, dst) if dry_run: return (dst, 1) # If linking (hard or symbolic), use the appropriate system call # (Unix only, of course, but that's the caller's responsibility) if link == 'hard': if not (os.path.exists(dst) and os.path.samefile(src, dst)): os.link(src, dst) elif link == 'sym': if not (os.path.exists(dst) and os.path.samefile(src, dst)): os.symlink(src, dst) # Otherwise (non-Mac, not linking), copy the file contents and # (optionally) copy the times and mode. else: _copy_file_contents(src, dst) if preserve_mode or preserve_times: st = os.stat(src) # According to David Ascher <[email protected]>, utime() should be done # before chmod() (at least under NT). if preserve_times: os.utime(dst, (st[ST_ATIME], st[ST_MTIME])) if preserve_mode and hasattr(os, 'chmod'): os.chmod(dst, S_IMODE(st[ST_MODE])) return (dst, 1) # XXX I suspect this is Unix-specific -- need porting help! def move_file (src, dst, verbose=1, dry_run=0): """Move a file 'src' to 'dst'. If 'dst' is a directory, the file will be moved into it with the same name; otherwise, 'src' is just renamed to 'dst'. Return the new full name of the file. Handles cross-device moves on Unix using 'copy_file()'. What about other systems??? """ from os.path import exists, isfile, isdir, basename, dirname import errno if verbose >= 1: log.info("moving %s -> %s", src, dst) if dry_run: return dst if not isfile(src): raise DistutilsFileError("can't move '%s': not a regular file" % src) if isdir(dst): dst = os.path.join(dst, basename(src)) elif exists(dst): raise DistutilsFileError( "can't move '%s': destination '%s' already exists" % (src, dst)) if not isdir(dirname(dst)): raise DistutilsFileError( "can't move '%s': destination '%s' not a valid path" % \ (src, dst)) copy_it = 0 try: os.rename(src, dst) except os.error, (num, msg): if num == errno.EXDEV: copy_it = 1 else: raise DistutilsFileError( "couldn't move '%s' to '%s': %s" % (src, dst, msg)) if copy_it: copy_file(src, dst, verbose=verbose) try: os.unlink(src) except os.error, (num, msg): try: os.unlink(dst) except os.error: pass raise DistutilsFileError( ("couldn't move '%s' to '%s' by copy/delete: " + "delete '%s' failed: %s") % (src, dst, src, msg)) return dst def write_file (filename, contents): """Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. """ f = open(filename, "w") try: for line in contents: f.write(line + "\n") finally: f.close()
{ "pile_set_name": "Github" }
package com.alorma.github.sdk.services.pullrequest; import com.alorma.github.sdk.bean.info.IssueInfo; import com.alorma.github.sdk.services.client.GithubListClient; import core.repositories.CommitFile; import java.util.List; import retrofit.RestAdapter; public class GetPullRequestFiles extends GithubListClient<List<CommitFile>> { private IssueInfo info; private int page; public GetPullRequestFiles(IssueInfo info) { super(); this.info = info; } public GetPullRequestFiles(IssueInfo info, int page) { super(); this.info = info; this.page = page; } @Override protected ApiSubscriber getApiObservable(RestAdapter restAdapter) { return new ApiSubscriber() { @Override protected void call(RestAdapter restAdapter) { PullRequestsService pullRequestsService = restAdapter.create(PullRequestsService.class); if (page == 0) { pullRequestsService.files(info.repoInfo.owner, info.repoInfo.name, info.num, this); } else { pullRequestsService.files(info.repoInfo.owner, info.repoInfo.name, info.num, page, this); } } }; } }
{ "pile_set_name": "Github" }
/* * Copyright (C) by Argonne National Laboratory * See COPYRIGHT in top-level directory */ #include <mpi.h> #include <stdlib.h> #include <stdio.h> #include "mpitest.h" /* tests multiple invocations of Keyval_free on the same keyval */ int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra); int delete_fn(MPI_Comm comm, int keyval, void *attr, void *extra) { MPI_Keyval_free(&keyval); return MPI_SUCCESS; } int main(int argc, char **argv) { MPI_Comm duped; int keyval = MPI_KEYVAL_INVALID; int keyval_copy = MPI_KEYVAL_INVALID; int errs = 0; MTest_Init(&argc, &argv); MPI_Comm_dup(MPI_COMM_SELF, &duped); MPI_Keyval_create(MPI_NULL_COPY_FN, delete_fn, &keyval, NULL); keyval_copy = keyval; MPI_Attr_put(MPI_COMM_SELF, keyval, NULL); MPI_Attr_put(duped, keyval, NULL); MPI_Comm_free(&duped); /* first MPI_Keyval_free */ MPI_Keyval_free(&keyval); /* second MPI_Keyval_free */ MPI_Keyval_free(&keyval_copy); /* third MPI_Keyval_free */ MTest_Finalize(errs); return MTestReturnValue(errs); }
{ "pile_set_name": "Github" }
/* Copyright 2016 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package fields import "k8s.io/apimachinery/pkg/selection" // Requirements is AND of all requirements. type Requirements []Requirement // Requirement contains a field, a value, and an operator that relates the field and value. // This is currently for reading internal selection information of field selector. type Requirement struct { Operator selection.Operator Field string Value string }
{ "pile_set_name": "Github" }
// // _RXKVOObserver.h // RxCocoa // // Created by Krunoslav Zaher on 7/11/15. // Copyright © 2015 Krunoslav Zaher. All rights reserved. // #import <Foundation/Foundation.h> /** ################################################################################ This file is part of RX private API ################################################################################ */ typedef void (^KVOCallback)(id); // Exists because if written in Swift, reading unowned is disabled during dealloc process @interface _RXKVOObserver : NSObject -(instancetype)initWithTarget:(id)target retainTarget:(BOOL)retainTarget keyPath:(NSString*)keyPath options:(NSKeyValueObservingOptions)options callback:(KVOCallback)callback; -(void)dispose; @end
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <WebApplicationTest> <TestDescription name="MediaWiki SVG cross-site scripting vulnerability" version="0.1" released="20080307" updated="20151126" protocol="FTP" mayproxy="false" affects="server" severity="high" alert="success" type="Configuration"> <WASPDescription BindAlertToFile="0" CrawlerProcessingMode="ParseOnly" TargetFormat="" Target="" ModuleName="" Request="" Response="" FullResponse="" DetailsFormat="" Details="" AuthType="0" AuthName="" AuthPass="" CompInfo="" DetaliedInformation="" AlertTags="xss" CVE="" CWE="CWE-79" CVSSVer="2.0" CVSSScore="4.4" CVSSDescr="AV:N/AC:M/Au:N/C:N/I:P/A:N" CVSSScoreTemp="4.5" CVSSScoreEnv="4.3" CVSS3Descr="CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"></WASPDescription> <Copyright></Copyright> <Description>MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia. SecuriTeam Secure Disclosure discovered a vulnerability in the way MediaWiki handles SVG files that may allow attackers to cause it to display arbitrary javascript code to users that are presented with an embedded SVG file. The vulnerability is triggered through the use of an encoded ENTITY that doesn't get properly filtered out for malicious content.</Description> <ApplicableTo> <Platform> <OS>*</OS> <Arch>*</Arch> </Platform> <WebServer>*</WebServer> <ApplicationServer>*</ApplicationServer> </ApplicableTo> <Impact>Malicious users may inject JavaScript, VBScript, ActiveX, HTML or Flash into a vulnerable application to fool a user in order to gather data from them. An attacker can steal the session cookie and take over the account, impersonating the user. It is also possible to modify the content of the page presented to the user.</Impact> <Recommendation>The vulnerability has been fixed in MediaWiki version 1.24.2. It's recommended to upgrade to this version or the latest MediaWiki version.</Recommendation> <Reference database="MediaWiki SVG XSS" URL="https://blogs.securiteam.com/index.php/archives/2669"></Reference> </TestDescription> </WebApplicationTest>
{ "pile_set_name": "Github" }
require 'react/ext/string' require 'react/ext/hash' require 'active_support/core_ext/class/attribute' require 'react/callbacks' require 'react/rendering_context' require 'hyper-store' require 'react/state_wrapper' require 'react/component/api' require 'react/component/class_methods' require 'react/component/props_wrapper' module Hyperloop class Component module Mixin def self.included(base) base.include(Hyperloop::Store::Mixin) base.include(React::Component::API) base.include(React::Callbacks) base.include(React::Component::Tags) base.include(React::Component::DslInstanceMethods) base.include(React::Component::ShouldComponentUpdate) base.class_eval do class_attribute :initial_state define_callback :before_mount define_callback :after_mount define_callback :before_receive_props define_callback :before_update define_callback :after_update define_callback :before_unmount define_callback :after_error end base.extend(React::Component::ClassMethods) end def self.deprecation_warning(message) React::Component.deprecation_warning(name, message) end def deprecation_warning(message) React::Component.deprecation_warning(self.class.name, message) end def initialize(native_element) @native = native_element init_store end def emit(event_name, *args) if React::Event::BUILT_IN_EVENTS.include?(built_in_event_name = "on#{event_name.to_s.event_camelize}") params[built_in_event_name].call(*args) else params["on_#{event_name}"].call(*args) end end def component_will_mount React::IsomorphicHelpers.load_context(true) if React::IsomorphicHelpers.on_opal_client? React::State.set_state_context_to(self) { run_callback(:before_mount) } end def component_did_mount React::State.set_state_context_to(self) do run_callback(:after_mount) React::State.update_states_to_observe end end def component_will_receive_props(next_props) # need to rethink how this works in opal-react, or if its actually that useful within the react.rb environment # for now we are just using it to clear processed_params React::State.set_state_context_to(self) { self.run_callback(:before_receive_props, next_props) } @_receiving_props = true end def component_will_update(next_props, next_state) React::State.set_state_context_to(self) { self.run_callback(:before_update, next_props, next_state) } params._reset_all_others_cache if @_receiving_props @_receiving_props = false end def component_did_update(prev_props, prev_state) React::State.set_state_context_to(self) do self.run_callback(:after_update, prev_props, prev_state) React::State.update_states_to_observe end end def component_will_unmount React::State.set_state_context_to(self) do self.run_callback(:before_unmount) React::State.remove end end def component_did_catch(error, info) React::State.set_state_context_to(self) do self.run_callback(:after_error, error, info) end end attr_reader :waiting_on_resources def update_react_js_state(object, name, value) if object name = "#{object.class}.#{name}" unless object == self # Date.now() has only millisecond precision, if several notifications of # observer happen within a millisecond, updates may get lost. # to mitigate this the Math.random() appends some random number # this way notifactions will happen as expected by the rest of hyperloop set_state( '***_state_updated_at-***' => `Date.now() + Math.random()`, name => value ) else set_state name => value end end def set_state_synchronously? @native.JS[:__opalInstanceSyncSetState] end def render raise 'no render defined' end unless method_defined?(:render) def _render_wrapper React::State.set_state_context_to(self, true) do element = React::RenderingContext.render(nil) { render || '' } @waiting_on_resources = element.waiting_on_resources if element.respond_to? :waiting_on_resources element end end def watch(value, &on_change) Observable.new(value, on_change) end def define_state(*args, &block) React::State.initialize_states(self, self.class.define_state(*args, &block)) end end end end module React module Component def self.included(base) # note this is turned off during old style testing: See the spec_helper deprecation_warning base, "The module name React::Component has been deprecated. Use Hyperloop::Component::Mixin instead." base.include Hyperloop::Component::Mixin end def self.deprecation_warning(name, message) @deprecation_messages ||= [] message = "Warning: Deprecated feature used in #{name}. #{message}" unless @deprecation_messages.include? message @deprecation_messages << message React::IsomorphicHelpers.log message, :warning end end end module ComponentNoNotice def self.included(base) base.include Hyperloop::Component::Mixin end end end module React end
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res-auto" xmlns:android1="http://schemas.android.com/apk/res/android"> <PreferenceSmallCategory /> <com.tencent.mm.plugin.subapp.ui.pluginapp.AddFriendSearchPreference android:key="find_friends_by_input" /> <com.tencent.mm.ui.base.preference.PreferenceInfoCategory android:key="find_friends_info" /> <PreferenceSmallCategory /> <com.tencent.mm.plugin.subapp.ui.pluginapp.AddFriendItemPreference android:summary="@string/ar1" android:title="@string/ar0" android:icon="@raw/addfriend_icon_rada" android:key="find_friends_by_radar" /> <com.tencent.mm.plugin.subapp.ui.pluginapp.AddFriendItemPreference android:summary="@string/ar4" android:title="@string/ar3" android:icon="@raw/default_chatroom" android:key="find_friends_create_pwdgroup" /> <com.tencent.mm.plugin.subapp.ui.pluginapp.AddFriendItemPreference android:summary="@string/aqz" android:title="@string/aqy" android:icon="@raw/addfriend_icon_qrscan" android:key="find_friends_by_qrcode" /> <com.tencent.mm.plugin.subapp.ui.pluginapp.AddFriendItemPreference android:summary="@string/aqw" android:title="@string/aqu" android:icon="@raw/default_fmessage" android:key="find_friends_by_other_way" /> <com.tencent.mm.plugin.subapp.ui.pluginapp.AddFriendItemPreference android:summary="@string/ar2" android:title="@string/al4" android:icon="@raw/default_servicebrand_contact" android:key="find_friends_by_web" /> <PreferenceCategory /> </PreferenceScreen>
{ "pile_set_name": "Github" }
using System; using Titanium.Web.Proxy.Models; namespace Titanium.Web.Proxy.Extensions { internal static class UriExtensions { public static string GetOriginalPathAndQuery(this Uri uri) { string leftPart = uri.GetLeftPart(UriPartial.Authority); if (uri.OriginalString.StartsWith(leftPart)) return uri.OriginalString.Substring(leftPart.Length); return uri.IsWellFormedOriginalString() ? uri.PathAndQuery : uri.GetComponents(UriComponents.PathAndQuery, UriFormat.Unescaped); } public static ByteString GetScheme(ByteString str) { if (str.Length < 3) { return ByteString.Empty; } // regex: "^[a-z]*://" int i; for (i = 0; i < str.Length - 3; i++) { byte ch = str[i]; if (ch == ':') { break; } if (ch < 'A' || ch > 'z' || (ch > 'Z' && ch < 'a')) // ASCII letter { return ByteString.Empty; } } if (str[i++] != ':') { return ByteString.Empty; } if (str[i++] != '/') { return ByteString.Empty; } if (str[i] != '/') { return ByteString.Empty; } return new ByteString(str.Data.Slice(0, i - 2)); } } }
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wicket="http://wicket.sourceforge.net/"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Wicket Examples - GMap Panel</title> <style type="text/css"> v\:* { behavior:url(#default#VML); } </style> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <span wicket:id="mainNavigation" /> Trigger events on the map. <br/> <ol> <li> <a wicket:id="resize">Resize map (Correct)</a> </li> <li> <a wicket:id="resizeWrong">Resize map (Wrong)</a> </li> </ol> <div> <div wicket:id="map" style="width: 500px; height: 350px; boder: 1px red solid;">topPanel</div> </div> </body> </html>
{ "pile_set_name": "Github" }
// *************************************************************************** // * // * Copyright (C) 2014 International Business Machines // * Corporation and others. All Rights Reserved. // * Tool: org.unicode.cldr.icu.NewLdml2IcuConverter // * Source File: <path>/common/main/en_IO.xml // * // *************************************************************************** en_IO{ %%Parent{"en_GB"} Version{"2.1.6.69"} }
{ "pile_set_name": "Github" }
75,false,0,\N,0,0,0.0,0.0,04/01/09,0,2009-04-01 00:00:00.0 76,true,1,1,\N,10,1.1,10.1,04/01/09,1,2009-04-01 00:01:00.0 77,false,2,2,2,\N,2.2,20.2,04/01/09,2,2009-04-01 00:02:00.10 78,true,3,3,3,30,\N,30.299999999999997,04/01/09,3,2009-04-01 00:03:00.30 79,false,4,4,4,40,4.4,\N,04/01/09,4,2009-04-01 00:04:00.60 80,true,5,5,5,50,5.5,50.5,\N,5,2009-04-01 00:05:00.100 81,false,6,6,6,60,6.6,60.599999999999994,04/01/09,\N,2009-04-01 00:06:00.150 82,true,7,7,7,70,7.7,70.7,04/01/09,7,\N 83,\N,8,8,8,80,8.8,80.8,04/01/09,8,2009-04-01 00:08:00.280 84,true,\N,9,9,90,9.9,90.89999999999999,04/01/09,9,2009-04-01 00:09:00.360 85,false,0,\N,0,0,0.0,0.0,04/02/09,0,2009-04-02 00:10:00.450 86,true,1,1,\N,10,1.1,10.1,04/02/09,1,2009-04-02 00:11:00.450 87,false,2,2,2,\N,2.2,20.2,04/02/09,2,2009-04-02 00:12:00.460 88,true,3,3,3,30,\N,30.299999999999997,04/02/09,3,2009-04-02 00:13:00.480 89,false,4,4,4,40,4.4,\N,04/02/09,4,2009-04-02 00:14:00.510 90,true,5,5,5,50,5.5,50.5,\N,5,2009-04-02 00:15:00.550 91,false,6,6,6,60,6.6,60.599999999999994,04/02/09,\N,2009-04-02 00:16:00.600 92,true,7,7,7,70,7.7,70.7,04/02/09,7,\N 93,\N,8,8,8,80,8.8,80.8,04/02/09,8,2009-04-02 00:18:00.730 94,true,\N,9,9,90,9.9,90.89999999999999,04/02/09,9,2009-04-02 00:19:00.810 95,false,0,\N,0,0,0.0,0.0,04/03/09,0,2009-04-03 00:20:00.900 96,true,1,1,\N,10,1.1,10.1,04/03/09,1,2009-04-03 00:21:00.900 97,false,2,2,2,\N,2.2,20.2,04/03/09,2,2009-04-03 00:22:00.910 98,true,3,3,3,30,\N,30.299999999999997,04/03/09,3,2009-04-03 00:23:00.930 99,false,4,4,4,40,4.4,\N,04/03/09,4,2009-04-03 00:24:00.960
{ "pile_set_name": "Github" }
running setUp super setUp. manager := WAServerManager new. adaptor := WATestServerAdaptor manager: manager. adaptor port: 12345. adaptor running. self assert: adaptor isRunning. self assert: (manager adaptors includes: adaptor)
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2009 Christopher Schmidt 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) ==============================================================================*/ #ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_IMPL_HPP #define BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_IMPL_HPP #include <boost/fusion/support/config.hpp> #include <boost/fusion/sequence/intrinsic/at.hpp> #include <boost/type_traits/is_const.hpp> namespace boost { namespace fusion { namespace extension { template <typename> struct deref_impl; template <> struct deref_impl<map_iterator_tag> { template <typename It> struct apply { typedef typename result_of::at< typename mpl::if_< is_const<typename It::seq_type> , typename It::seq_type::storage_type const , typename It::seq_type::storage_type >::type , typename It::index >::type type; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED static type call(It const& it) { return fusion::at<typename It::index>(it.seq->get_data()); } }; }; }}} #endif
{ "pile_set_name": "Github" }
/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef __ecp_h_ #define __ecp_h_ #include "ecl-priv.h" /* Checks if point P(px, py) is at infinity. Uses affine coordinates. */ mp_err ec_GFp_pt_is_inf_aff(const mp_int *px, const mp_int *py); /* Sets P(px, py) to be the point at infinity. Uses affine coordinates. */ mp_err ec_GFp_pt_set_inf_aff(mp_int *px, mp_int *py); /* Computes R = P + Q where R is (rx, ry), P is (px, py) and Q is (qx, * qy). Uses affine coordinates. */ mp_err ec_GFp_pt_add_aff(const mp_int *px, const mp_int *py, const mp_int *qx, const mp_int *qy, mp_int *rx, mp_int *ry, const ECGroup *group); /* Computes R = P - Q. Uses affine coordinates. */ mp_err ec_GFp_pt_sub_aff(const mp_int *px, const mp_int *py, const mp_int *qx, const mp_int *qy, mp_int *rx, mp_int *ry, const ECGroup *group); /* Computes R = 2P. Uses affine coordinates. */ mp_err ec_GFp_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx, mp_int *ry, const ECGroup *group); /* Validates a point on a GFp curve. */ mp_err ec_GFp_validate_point(const mp_int *px, const mp_int *py, const ECGroup *group); #ifdef ECL_ENABLE_GFP_PT_MUL_AFF /* Computes R = nP where R is (rx, ry) and P is (px, py). The parameters * a, b and p are the elliptic curve coefficients and the prime that * determines the field GFp. Uses affine coordinates. */ mp_err ec_GFp_pt_mul_aff(const mp_int *n, const mp_int *px, const mp_int *py, mp_int *rx, mp_int *ry, const ECGroup *group); #endif /* Converts a point P(px, py) from affine coordinates to Jacobian * projective coordinates R(rx, ry, rz). */ mp_err ec_GFp_pt_aff2jac(const mp_int *px, const mp_int *py, mp_int *rx, mp_int *ry, mp_int *rz, const ECGroup *group); /* Converts a point P(px, py, pz) from Jacobian projective coordinates to * affine coordinates R(rx, ry). */ mp_err ec_GFp_pt_jac2aff(const mp_int *px, const mp_int *py, const mp_int *pz, mp_int *rx, mp_int *ry, const ECGroup *group); /* Checks if point P(px, py, pz) is at infinity. Uses Jacobian * coordinates. */ mp_err ec_GFp_pt_is_inf_jac(const mp_int *px, const mp_int *py, const mp_int *pz); /* Sets P(px, py, pz) to be the point at infinity. Uses Jacobian * coordinates. */ mp_err ec_GFp_pt_set_inf_jac(mp_int *px, mp_int *py, mp_int *pz); /* Computes R = P + Q where R is (rx, ry, rz), P is (px, py, pz) and Q is * (qx, qy, qz). Uses Jacobian coordinates. */ mp_err ec_GFp_pt_add_jac_aff(const mp_int *px, const mp_int *py, const mp_int *pz, const mp_int *qx, const mp_int *qy, mp_int *rx, mp_int *ry, mp_int *rz, const ECGroup *group); /* Computes R = 2P. Uses Jacobian coordinates. */ mp_err ec_GFp_pt_dbl_jac(const mp_int *px, const mp_int *py, const mp_int *pz, mp_int *rx, mp_int *ry, mp_int *rz, const ECGroup *group); #ifdef ECL_ENABLE_GFP_PT_MUL_JAC /* Computes R = nP where R is (rx, ry) and P is (px, py). The parameters * a, b and p are the elliptic curve coefficients and the prime that * determines the field GFp. Uses Jacobian coordinates. */ mp_err ec_GFp_pt_mul_jac(const mp_int *n, const mp_int *px, const mp_int *py, mp_int *rx, mp_int *ry, const ECGroup *group); #endif /* Computes R(x, y) = k1 * G + k2 * P(x, y), where G is the generator * (base point) of the group of points on the elliptic curve. Allows k1 = * NULL or { k2, P } = NULL. Implemented using mixed Jacobian-affine * coordinates. Input and output values are assumed to be NOT * field-encoded and are in affine form. */ mp_err ec_GFp_pts_mul_jac(const mp_int *k1, const mp_int *k2, const mp_int *px, const mp_int *py, mp_int *rx, mp_int *ry, const ECGroup *group); /* Computes R = nP where R is (rx, ry) and P is the base point. Elliptic * curve points P and R can be identical. Uses mixed Modified-Jacobian * co-ordinates for doubling and Chudnovsky Jacobian coordinates for * additions. Assumes input is already field-encoded using field_enc, and * returns output that is still field-encoded. Uses 5-bit window NAF * method (algorithm 11) for scalar-point multiplication from Brown, * Hankerson, Lopez, Menezes. Software Implementation of the NIST Elliptic * Curves Over Prime Fields. */ mp_err ec_GFp_pt_mul_jm_wNAF(const mp_int *n, const mp_int *px, const mp_int *py, mp_int *rx, mp_int *ry, const ECGroup *group); #endif /* __ecp_h_ */
{ "pile_set_name": "Github" }
import Foundation public let post0027_openSourcingGen = BlogPost( author: .pointfree, blurb: """ Today we are open sourcing Gen: a lightweight wrapper around Swift's randomness API's that makes randomness more composable, transformable and controllable! """, contentBlocks: [ .init( content: "", timestamp: nil, type: .image(src: "https://d1iqsrac68iyd8.cloudfront.net/posts/0027-open-sourcing-gen/cover.jpg") ), .init( content: """ --- > Today we are open sourcing [Gen](https://github.com/pointfreeco/swift-gen): a lightweight wrapper around Swift's randomness API's that makes randomness more composable, transformable and controllable! --- We are excited to announce the 0.1.0 release of [Gen](https://github.com/pointfreeco/swift-gen), a new API for expressing randomness in Swift. Its focus is on composability (combining multiple forms of randomness into new forms of randomness), transformability (applying functions to randomness), and controllability (deterministic pseudo-randomness for times we need it). With these three features you can break down large, complex forms of randomness into smaller, simpler pieces, _and_ you can write tests for it! ## Motivation Swift’s randomness API is powerful and simple to use. It allows us to create random values from many basic types, such as booleans and numeric types, and it allows us to randomly shuffle arrays and pluck random elements from collections. However, it does not make it easy for us to extend the randomness API. For example, while it may gives us ways of generating random booleans, numeric values, and even ways to shuffle arrays and pluck random elements from arrays, it says nothing about creating random strings, random collections of values, or random values from our own data types. Further, the API is not very composable, which would allow us to create complex types of randomness from simpler pieces. One primarily uses the API by calling static `random` functions on types, such as `Int.random(in: 0...9)`, but there is no guidance on how to generate new types of randomness from existing randomness. ## `Gen` `Gen` is a lightweight wrapper over Swift’s randomness APIs that makes it easy to build custom generators of any kind of value. Most often you will reach for one of the static variables inside `Gen` to get access to a `Gen` value: """, timestamp: nil, type: .paragraph ), .init( content: """ Gen.bool // Gen<Bool> """, timestamp: nil, type: .code(lang: .swift) ), .init( content: """ Rather than immediately producing a random value, `Gen` describes a random value that can be produced by calling its `run` method: """, timestamp: nil, type: .paragraph ), .init( content: """ let myGen = Gen.bool // Gen<Bool> myGen.run() // true myGen.run() // true myGen.run() // false """, timestamp: nil, type: .code(lang: .swift) ), .init( content: """ Every random function that comes with Swift is also available as a static function on `Gen`: """, timestamp: nil, type: .paragraph ), .init( content: """ // Swift's API Int.random(in: 0...9) // 4 // Gen's API Gen.int(in: 0...9).run() // 6 """, timestamp: nil, type: .code(lang: .swift) ), .init( content: """ The reason it is powerful to wrap randomness in the `Gen` type is that we can make the `Gen` type composable. For example, a generator of integers can be turned into a generator of numeric strings with a simple application of the `map` function: """, timestamp: nil, type: .paragraph ), .init( content: """ let digit = Gen.int(in: 0...9) // Gen<Int> let stringDigit = digit.map(String.init) // Gen<String> stringDigit.run() // "7" stringDigit.run() // "1" stringDigit.run() // "3" """, timestamp: nil, type: .code(lang: .swift) ), .init( content: """ Already this is a form of randomness that Swift's API's do not provide out of the box. Gen provides many operators for generating new types of randomness, such as `map`, `flatMap` and `zip`, as well as helper functions for generating random arrays, sets, dictionaries, string, distributions and more! A random password generator, for example, is just a few operators away. """, timestamp: nil, type: .paragraph ), .init( content: """ // Take a generator of random letters and numbers. let password = Gen.letterOrNumber // Generate 6-character strings of them. .string(of: .always(6)) // Generate 3 segments of these strings. .array(of: .always(3)) // And join them. .map { $0.joined(separator: "-") } password.run() // "9BiGYA-fmvsOf-VYDtDv" password.run() // "dS2MGr-FQSuC4-ZLEicl" password.run() // "YusZGF-HILrCo-rNGfCA" """, timestamp: nil, type: .code(lang: .swift) ), .init( content: """ But composability isn't the only reason the `Gen` type shines. By delaying the creation of random values until the `run` method is invoked, we allow ourselves to control randomness in circumstances where we need determinism, such as tests. The `run` method has an overload that takes a `RandomNumberGenerator` value, which is Swift's protocol that powers their randomness API. By default it uses the `SystemRandomNumberGenerator`, which is a good source of randomness, but we can also provide a seedable "pseudo" random number generator, so that we can get predictable results in tests: """, timestamp: nil, type: .paragraph ), .init( content: """ var lcrng = LCRNG(seed: 0) Gen.int(in: 0...9).run(using: &lcrng) // "8" Gen.int(in: 0...9).run(using: &lcrng) // "1" Gen.int(in: 0...9).run(using: &lcrng) // "7" lcrng.seed = 0 Gen.int(in: 0...9).run(using: &lcrng) // "8" Gen.int(in: 0...9).run(using: &lcrng) // "1" Gen.int(in: 0...9).run(using: &lcrng) // "7" """, timestamp: nil, type: .code(lang: .swift) ), .init( content: """ This means you don't have to sacrifice testability when leveraging randomness in your application. ## Learn more The `Gen` type has been explored on [Point-Free](https://www.pointfree.com) numerous times. We [began](https://www.pointfree.co/episodes/ep30-composable-randomness) by showing that randomness can be made composable by expressiong it as a function. This allowed us to define `map`, `flatMap` and `zip` operations on randomness, which helped us create very complex forms of randomness for just a few small, simple pieces. In order to show just how powerful composable randomness is, we wrote a [blog post](https://www.pointfree.co/blog/posts/19-random-zalgo-generator) demonstrating how to create a [Zalgo text](http://www.eeemo.net) generator. This consisted of defining small generators that do a specific thing, such as generating special unicode characters, and the piecing them together to finally give us the generator that allows us to create bizarre strings such as: P̵̙̬̬̝̹̰̜ͧ̿o̎ĩͪͪ͗n͓̪̝̓t̊̏̾̊̆-̦̲̥͉F̠͖͈̮̾́ͨ͐͝r̸͋̆̅̅ͪ̚ë̝͑ͣ̒̏̈́̉e̟̺̪͕̹͆ͩͯ̑ͣ͂̉. Then we showed how randomness can be made controllable ([part 1](https://www.pointfree.co/episodes/ep47-predictable-randomness-part-1) and [part 2](https://www.pointfree.co/episodes/ep48-predictable-randomness-part-2)) by slightly tweaking `Gen` definition so that it took a `RandomNumberGenerator`, which is the Swift protocol that powers all of Swift's randomness API's. This allowed us to keep all of `Gen`'s nice compositional properties while also allowing us to plug in our own random number generators. In particular, we can use a deterministic, seedable, pseudo-random number generator in tests so that we can still test code that invokes randomness API's. ## Try it out today! The official 0.1.0 release of [Gen](http://github.com/pointfreeco/swift-gen) is on GitHub now, and we have more improvements and refinements coming soon. We hope that Gen will help you control the complexity in your applications that arises from randomness, both by making the randomness simpler to understand _and_ easier to test. """, timestamp: nil, type: .paragraph ), ], coverImage: "https://d1iqsrac68iyd8.cloudfront.net/posts/0027-open-sourcing-gen/cover.jpg", id: 27, publishedAt: .init(timeIntervalSince1970: 1552888800), title: "Open Sourcing Gen" )
{ "pile_set_name": "Github" }
package org.zarroboogs.weibo.widget; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.webkit.WebView; import android.widget.Button; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.ProgressBar; import org.zarroboogs.weibo.R; import org.zarroboogs.weibo.support.utils.Utility; import java.io.File; public class WeiboDetailImageView extends FrameLayout { protected ImageView mImageView; private WebView webView; private ProgressBar pb; private Button retry; public WeiboDetailImageView(Context context) { super(context); } public WeiboDetailImageView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public WeiboDetailImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); LayoutInflater inflate = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View v = inflate.inflate(R.layout.weibodetailimageview_layout, this, true); mImageView = (ImageView) v.findViewById(R.id.imageview); mImageView.setImageDrawable(new ColorDrawable(Color.TRANSPARENT)); webView = (WebView) v.findViewById(R.id.gif); pb = (ProgressBar) v.findViewById(R.id.imageview_pb); retry = (Button) v.findViewById(R.id.retry); } public void setImageDrawable(Drawable drawable) { mImageView.setImageDrawable(drawable); } public void setImageBitmap(Bitmap bm) { mImageView.setImageBitmap(bm); } public ImageView getImageView() { return mImageView; } public void setProgress(int value, int max) { pb.setVisibility(View.VISIBLE); pb.setMax(max); pb.setProgress(value); } public ProgressBar getProgressBar() { return pb; } public Button getRetryButton() { return retry; } public void setGif(String bitmapPath) { webView.setVisibility(View.VISIBLE); if (webView.getTag() != null) return; webView.setBackgroundColor(getResources().getColor(R.color.transparent)); webView.getSettings().setJavaScriptEnabled(true); webView.getSettings().setUseWideViewPort(true); webView.getSettings().setLoadWithOverviewMode(true); webView.getSettings().setBuiltInZoomControls(false); webView.getSettings().setDisplayZoomControls(false); webView.getSettings().setSupportZoom(false); webView.setVerticalScrollBarEnabled(false); webView.setHorizontalScrollBarEnabled(false); BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(bitmapPath, options); int width = Math.max(Utility.dip2px(200), options.outWidth); int height = width * options.outHeight / options.outWidth; ViewGroup.LayoutParams layoutParams = webView.getLayoutParams(); layoutParams.width = width; layoutParams.height = height; webView.setLayoutParams(layoutParams); File file = new File(bitmapPath); String str1 = "file://" + file.getAbsolutePath().replace("/mnt/sdcard/", "/sdcard/"); String str2 = "<html>\n<head>\n <style>\n html,body{background:transparent;margin:0;padding:0;} *{-webkit-tap-highlight-color:rgba(0, 0, 0, 0);}\n </style>\n <script type=\"text/javascript\">\n var imgUrl = \"" + str1 + "\";" + " var objImage = new Image();\n" + " var realWidth = 0;\n" + " var realHeight = 0;\n" + "\n" + " function onLoad() {\n" + " objImage.onload = function() {\n" + " realWidth = objImage.width;\n" + " realHeight = objImage.height;\n" + "\n" + " document.gagImg.src = imgUrl;\n" + " onResize();\n" + " }\n" + " objImage.src = imgUrl;\n" + " }\n" + "\n" + " function onResize() {\n" + " var scale = 1;\n" + " var newWidth = document.gagImg.width;\n" + " if (realWidth > newWidth) {\n" + " scale = realWidth / newWidth;\n" + " } else {\n" + " scale = newWidth / realWidth;\n" + " }\n" + "\n" + " hiddenHeight = Math.ceil(30 * scale);\n" + " document.getElementById('hiddenBar').style.height = hiddenHeight + \"px\";\n" + " document.getElementById('hiddenBar').style.marginTop = -hiddenHeight + \"px\";\n" + " }\n" + " </script>\n" + "</head>\n" + "<body onload=\"onLoad()\" onresize=\"onResize()\" onclick=\"Android.toggleOverlayDisplay();\">\n" + " <table style=\"width: 100%;height:100%;\">\n" + " <tr style=\"width: 100%;\">\n" + " <td valign=\"middle\" align=\"center\" style=\"width: 100%;\">\n" + " <div style=\"display:block\">\n" + " <img name=\"gagImg\" src=\"\" width=\"100%\" style=\"\" />\n" + " </div>\n" + " <div id=\"hiddenBar\" style=\"position:absolute; width: 100%; background: transparent;\"></div>\n" + " </td>\n" + " </tr>\n" + " </table>\n" + "</body>\n" + "</html>"; webView.loadDataWithBaseURL("file:///android_asset/", str2, "text/html", "utf-8", null); webView.setTag(new Object()); } }
{ "pile_set_name": "Github" }
/* @theme: custom; */ .notification-flash { .notification.notification_lg { margin-left: 0; } }
{ "pile_set_name": "Github" }
<resources> <style name="AppTheme" parent="android:Theme.Light" /> </resources>
{ "pile_set_name": "Github" }
(module PinHeader_1x31_P2.00mm_Vertical_SMD_Pin1Left (layer F.Cu) (tedit 59FED667) (descr "surface-mounted straight pin header, 1x31, 2.00mm pitch, single row, style 1 (pin 1 left)") (tags "Surface mounted pin header SMD 1x31 2.00mm single row style1 pin1 left") (attr smd) (fp_text reference REF** (at 0 -32.06) (layer F.SilkS) (effects (font (size 1 1) (thickness 0.15))) ) (fp_text value PinHeader_1x31_P2.00mm_Vertical_SMD_Pin1Left (at 0 32.06) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (fp_line (start 1 31) (end -1 31) (layer F.Fab) (width 0.1)) (fp_line (start -0.25 -31) (end 1 -31) (layer F.Fab) (width 0.1)) (fp_line (start -1 31) (end -1 -30.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 -30.25) (end -0.25 -31) (layer F.Fab) (width 0.1)) (fp_line (start 1 -31) (end 1 31) (layer F.Fab) (width 0.1)) (fp_line (start -1 -30.25) (end -2.1 -30.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -30.25) (end -2.1 -29.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -29.75) (end -1 -29.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 -26.25) (end -2.1 -26.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -26.25) (end -2.1 -25.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -25.75) (end -1 -25.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 -22.25) (end -2.1 -22.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -22.25) (end -2.1 -21.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -21.75) (end -1 -21.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 -18.25) (end -2.1 -18.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -18.25) (end -2.1 -17.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -17.75) (end -1 -17.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 -14.25) (end -2.1 -14.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -14.25) (end -2.1 -13.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -13.75) (end -1 -13.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 -10.25) (end -2.1 -10.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -10.25) (end -2.1 -9.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -9.75) (end -1 -9.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 -6.25) (end -2.1 -6.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -6.25) (end -2.1 -5.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -5.75) (end -1 -5.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 -2.25) (end -2.1 -2.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -2.25) (end -2.1 -1.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 -1.75) (end -1 -1.75) (layer F.Fab) (width 0.1)) (fp_line (start -1 1.75) (end -2.1 1.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 1.75) (end -2.1 2.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 2.25) (end -1 2.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 5.75) (end -2.1 5.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 5.75) (end -2.1 6.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 6.25) (end -1 6.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 9.75) (end -2.1 9.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 9.75) (end -2.1 10.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 10.25) (end -1 10.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 13.75) (end -2.1 13.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 13.75) (end -2.1 14.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 14.25) (end -1 14.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 17.75) (end -2.1 17.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 17.75) (end -2.1 18.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 18.25) (end -1 18.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 21.75) (end -2.1 21.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 21.75) (end -2.1 22.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 22.25) (end -1 22.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 25.75) (end -2.1 25.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 25.75) (end -2.1 26.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 26.25) (end -1 26.25) (layer F.Fab) (width 0.1)) (fp_line (start -1 29.75) (end -2.1 29.75) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 29.75) (end -2.1 30.25) (layer F.Fab) (width 0.1)) (fp_line (start -2.1 30.25) (end -1 30.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 -28.25) (end 2.1 -28.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -28.25) (end 2.1 -27.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -27.75) (end 1 -27.75) (layer F.Fab) (width 0.1)) (fp_line (start 1 -24.25) (end 2.1 -24.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -24.25) (end 2.1 -23.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -23.75) (end 1 -23.75) (layer F.Fab) (width 0.1)) (fp_line (start 1 -20.25) (end 2.1 -20.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -20.25) (end 2.1 -19.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -19.75) (end 1 -19.75) (layer F.Fab) (width 0.1)) (fp_line (start 1 -16.25) (end 2.1 -16.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -16.25) (end 2.1 -15.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -15.75) (end 1 -15.75) (layer F.Fab) (width 0.1)) (fp_line (start 1 -12.25) (end 2.1 -12.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -12.25) (end 2.1 -11.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -11.75) (end 1 -11.75) (layer F.Fab) (width 0.1)) (fp_line (start 1 -8.25) (end 2.1 -8.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -8.25) (end 2.1 -7.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -7.75) (end 1 -7.75) (layer F.Fab) (width 0.1)) (fp_line (start 1 -4.25) (end 2.1 -4.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -4.25) (end 2.1 -3.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -3.75) (end 1 -3.75) (layer F.Fab) (width 0.1)) (fp_line (start 1 -0.25) (end 2.1 -0.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 -0.25) (end 2.1 0.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 0.25) (end 1 0.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 3.75) (end 2.1 3.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 3.75) (end 2.1 4.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 4.25) (end 1 4.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 7.75) (end 2.1 7.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 7.75) (end 2.1 8.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 8.25) (end 1 8.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 11.75) (end 2.1 11.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 11.75) (end 2.1 12.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 12.25) (end 1 12.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 15.75) (end 2.1 15.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 15.75) (end 2.1 16.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 16.25) (end 1 16.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 19.75) (end 2.1 19.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 19.75) (end 2.1 20.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 20.25) (end 1 20.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 23.75) (end 2.1 23.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 23.75) (end 2.1 24.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 24.25) (end 1 24.25) (layer F.Fab) (width 0.1)) (fp_line (start 1 27.75) (end 2.1 27.75) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 27.75) (end 2.1 28.25) (layer F.Fab) (width 0.1)) (fp_line (start 2.1 28.25) (end 1 28.25) (layer F.Fab) (width 0.1)) (fp_line (start -1.06 -31.06) (end 1.06 -31.06) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 31.06) (end 1.06 31.06) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -31.06) (end 1.06 -28.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -30.685) (end -2.29 -30.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -31.06) (end -1.06 -30.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 30.685) (end 1.06 31.06) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -27.315) (end 1.06 -24.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -23.315) (end 1.06 -20.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -19.315) (end 1.06 -16.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -15.315) (end 1.06 -12.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -11.315) (end 1.06 -8.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -7.315) (end 1.06 -4.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 -3.315) (end 1.06 -0.685) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 0.685) (end 1.06 3.315) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 4.685) (end 1.06 7.315) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 8.685) (end 1.06 11.315) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 12.685) (end 1.06 15.315) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 16.685) (end 1.06 19.315) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 20.685) (end 1.06 23.315) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 24.685) (end 1.06 27.315) (layer F.SilkS) (width 0.12)) (fp_line (start 1.06 28.685) (end 1.06 31.06) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -29.315) (end -1.06 -26.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -25.315) (end -1.06 -22.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -21.315) (end -1.06 -18.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -17.315) (end -1.06 -14.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -13.315) (end -1.06 -10.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -9.315) (end -1.06 -6.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -5.315) (end -1.06 -2.685) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 -1.315) (end -1.06 1.315) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 2.685) (end -1.06 5.315) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 6.685) (end -1.06 9.315) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 10.685) (end -1.06 13.315) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 14.685) (end -1.06 17.315) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 18.685) (end -1.06 21.315) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 22.685) (end -1.06 25.315) (layer F.SilkS) (width 0.12)) (fp_line (start -1.06 26.685) (end -1.06 29.315) (layer F.SilkS) (width 0.12)) (fp_line (start -2.85 -31.5) (end -2.85 31.5) (layer F.CrtYd) (width 0.05)) (fp_line (start -2.85 31.5) (end 2.85 31.5) (layer F.CrtYd) (width 0.05)) (fp_line (start 2.85 31.5) (end 2.85 -31.5) (layer F.CrtYd) (width 0.05)) (fp_line (start 2.85 -31.5) (end -2.85 -31.5) (layer F.CrtYd) (width 0.05)) (pad 1 smd rect (at -1.175 -30) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 3 smd rect (at -1.175 -26) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 5 smd rect (at -1.175 -22) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 7 smd rect (at -1.175 -18) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 9 smd rect (at -1.175 -14) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 11 smd rect (at -1.175 -10) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 13 smd rect (at -1.175 -6) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 15 smd rect (at -1.175 -2) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 17 smd rect (at -1.175 2) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 19 smd rect (at -1.175 6) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 21 smd rect (at -1.175 10) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 23 smd rect (at -1.175 14) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 25 smd rect (at -1.175 18) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 27 smd rect (at -1.175 22) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 29 smd rect (at -1.175 26) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 31 smd rect (at -1.175 30) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 2 smd rect (at 1.175 -28) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 4 smd rect (at 1.175 -24) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 6 smd rect (at 1.175 -20) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 8 smd rect (at 1.175 -16) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 10 smd rect (at 1.175 -12) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 12 smd rect (at 1.175 -8) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 14 smd rect (at 1.175 -4) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 16 smd rect (at 1.175 0) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 18 smd rect (at 1.175 4) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 20 smd rect (at 1.175 8) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 22 smd rect (at 1.175 12) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 24 smd rect (at 1.175 16) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 26 smd rect (at 1.175 20) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 28 smd rect (at 1.175 24) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (pad 30 smd rect (at 1.175 28) (size 2.35 0.85) (layers F.Cu F.Mask F.Paste)) (fp_text user %R (at 0 0 90) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15))) ) (model ${KISYS3DMOD}/Connector_PinHeader_2.00mm.3dshapes/PinHeader_1x31_P2.00mm_Vertical_SMD_Pin1Left.wrl (at (xyz 0 0 0)) (scale (xyz 1 1 1)) (rotate (xyz 0 0 0)) ) )
{ "pile_set_name": "Github" }
{ "line": 28, "character": 30, "expected": { "title": "Mark 'secureParameter' as Untainted", "edits": [ { "range": { "start": { "line": 28, "character": 30 }, "end": { "line": 28, "character": 37 } }, "newText": "<@untainted> args[0]" } ] } }
{ "pile_set_name": "Github" }
<div ng-form="AccountForm" bh-account-select-multiple ng-model-options="{ updateOn: 'default' }"> <div class="form-group"> <label class="control-label" translate> {{ ::$ctrl.label }} </label> <ng-transclude></ng-transclude> <ui-select multiple name="accounts" ng-model="$ctrl.accountIds" on-select = "$ctrl.onSelect($item, $model)" on-remove = "$ctrl.handleChange($model)" ng-required="$ctrl.required"> <ui-select-match placeholder="{{ 'FORM.PLACEHOLDERS.ACCOUNT' | translate }}"> <span><strong>{{$item.number}}</strong> {{$item.label}}</span> </ui-select-match> <ui-select-choices ui-select-focus-patch ui-disable-choice="account.type_id === $ctrl.TITLE_ACCOUNT_ID" repeat="account.id as account in $ctrl.accounts | filter: { 'hrlabel' : $select.search }"> <strong ng-bind-html="account.number | highlight:$select.search"></strong> <span ng-bind-html="account.label | highlight:$select.search"></span> </ui-select-choices> </ui-select> <div class="help-block" ng-messages="AccountForm.accounts.$error" ng-show="AccountForm.$submitted && AccountForm.account_id.$invalid"> <div ng-messages-include="modules/templates/messages.tmpl.html"></div> </div> </div> </div>
{ "pile_set_name": "Github" }
../../guestbin/swan-prep ipsec start /testing/pluto/bin/wait-until-pluto-started ipsec whack --globalstatus
{ "pile_set_name": "Github" }
get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) project(${PROJECT_NAME}) add_executable(${PROJECT_NAME} main.cpp) target_link_libraries(${PROJECT_NAME} igl::core igl::opengl igl::opengl_glfw tutorials)
{ "pile_set_name": "Github" }
package org.apache.helix; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.helix.model.IdealState.IdealStateProperty; import org.apache.helix.model.IdealState.RebalanceMode; import org.apache.helix.tools.TestCommand; import org.apache.helix.tools.TestCommand.CommandType; import org.apache.helix.tools.TestExecutor; import org.apache.helix.tools.TestExecutor.ZnodePropertyType; import org.apache.helix.tools.TestTrigger; import org.apache.helix.tools.ZnodeOpArg; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.AssertJUnit; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; public class TestZnodeModify extends ZkUnitTestBase { private static Logger logger = LoggerFactory.getLogger(TestZnodeModify.class); private final String PREFIX = "/" + getShortClassName(); @Test() public void testBasic() throws Exception { logger.info("RUN: " + new Date(System.currentTimeMillis())); List<TestCommand> commandList = new ArrayList<>(); // test case for the basic flow, no timeout, no data trigger String pathChild1 = PREFIX + "/basic_child1"; String pathChild2 = PREFIX + "/basic_child2"; TestCommand command; ZnodeOpArg arg; arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "+", "key1", "simpleValue1"); command = new TestCommand(CommandType.MODIFY, arg); commandList.add(command); List<String> list = new ArrayList<>(); list.add("listValue1"); list.add("listValue2"); arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.LIST, "+", "key2", list); command = new TestCommand(CommandType.MODIFY, arg); commandList.add(command); ZNRecord record = getExampleZNRecord(); arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", record); command = new TestCommand(CommandType.MODIFY, arg); commandList.add(command); arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "==", "key1"); command = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 0, "simpleValue1"), arg); commandList.add(command); arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.LIST, "==", "key2"); command = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 0, list), arg); commandList.add(command); arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "=="); command = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 0, record), arg); commandList.add(command); Map<TestCommand, Boolean> results = TestExecutor.executeTest(commandList, ZK_ADDR); for (Map.Entry<TestCommand, Boolean> entry : results.entrySet()) { Assert.assertTrue(entry.getValue()); } logger.info("END: " + new Date(System.currentTimeMillis())); } @Test() public void testDataTrigger() throws Exception { logger.info("RUN: " + new Date(System.currentTimeMillis())); List<TestCommand> commandList = new ArrayList<>(); // test case for data trigger, no timeout String pathChild1 = PREFIX + "/data_trigger_child1"; String pathChild2 = PREFIX + "/data_trigger_child2"; ZnodeOpArg arg; TestCommand command; ZnodeOpArg arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "+", "key1", "simpleValue1-new"); TestCommand command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 0, "simpleValue1"), arg1); commandList.add(command1); ZNRecord record = getExampleZNRecord(); ZNRecord recordNew = new ZNRecord(record); recordNew.setSimpleField(IdealStateProperty.REBALANCE_MODE.toString(), RebalanceMode.SEMI_AUTO.toString()); arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", recordNew); command = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 3000, record), arg); commandList.add(command); arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", record); command = new TestCommand(CommandType.MODIFY, new TestTrigger(1000), arg); commandList.add(command); arg = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "!=", "key1"); command = new TestCommand(CommandType.VERIFY, new TestTrigger(3100, 0, "simpleValue1-new"), arg); commandList.add(command); arg = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "=="); command = new TestCommand(CommandType.VERIFY, new TestTrigger(3100, 0, recordNew), arg); commandList.add(command); Map<TestCommand, Boolean> results = TestExecutor.executeTest(commandList, ZK_ADDR); boolean result = results.remove(command1); AssertJUnit.assertFalse(result); for (Map.Entry<TestCommand, Boolean> entry : results.entrySet()) { Assert.assertTrue(entry.getValue()); } logger.info("END: " + new Date(System.currentTimeMillis())); } @Test() public void testTimeout() throws Exception { logger.info("RUN: " + new Date(System.currentTimeMillis())); List<TestCommand> commandList = new ArrayList<>(); // test case for timeout, no data trigger String pathChild1 = PREFIX + "/timeout_child1"; String pathChild2 = PREFIX + "/timeout_child2"; ZnodeOpArg arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "+", "key1", "simpleValue1-new"); TestCommand command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 1000, "simpleValue1"), arg1); commandList.add(command1); ZNRecord record = getExampleZNRecord(); ZNRecord recordNew = new ZNRecord(record); recordNew.setSimpleField(IdealStateProperty.REBALANCE_MODE.toString(), RebalanceMode.SEMI_AUTO.toString()); arg1 = new ZnodeOpArg(pathChild2, ZnodePropertyType.ZNODE, "+", recordNew); command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 500, record), arg1); commandList.add(command1); arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.SIMPLE, "==", "key1"); command1 = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 500, "simpleValue1-new"), arg1); commandList.add(command1); arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.ZNODE, "=="); command1 = new TestCommand(CommandType.VERIFY, new TestTrigger(1000, 500, recordNew), arg1); commandList.add(command1); Map<TestCommand, Boolean> results = TestExecutor.executeTest(commandList, ZK_ADDR); for (Map.Entry<TestCommand, Boolean> entry : results.entrySet()) { Assert.assertFalse(entry.getValue()); } logger.info("END: " + new Date(System.currentTimeMillis())); } @Test() public void testDataTriggerWithTimeout() throws Exception { logger.info("RUN: " + new Date(System.currentTimeMillis())); List<TestCommand> commandList = new ArrayList<>(); // test case for data trigger with timeout final String pathChild1 = PREFIX + "/dataTriggerWithTimeout_child1"; final ZNRecord record = getExampleZNRecord(); ZNRecord recordNew = new ZNRecord(record); recordNew.setSimpleField(IdealStateProperty.REBALANCE_MODE.toString(), RebalanceMode.SEMI_AUTO.toString()); ZnodeOpArg arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.ZNODE, "+", recordNew); TestCommand command1 = new TestCommand(CommandType.MODIFY, new TestTrigger(0, 8000, record), arg1); commandList.add(command1); arg1 = new ZnodeOpArg(pathChild1, ZnodePropertyType.ZNODE, "=="); command1 = new TestCommand(CommandType.VERIFY, new TestTrigger(9000, 500, recordNew), arg1); commandList.add(command1); // start a separate thread to change znode at pathChild1 new Thread(() -> { try { Thread.sleep(3000); _gZkClient.createPersistent(pathChild1, true); _gZkClient.writeData(pathChild1, record); } catch (InterruptedException e) { logger.error("Interrupted sleep", e); } }).start(); Map<TestCommand, Boolean> results = TestExecutor.executeTest(commandList, ZK_ADDR); for (Map.Entry<TestCommand, Boolean> entry : results.entrySet()) { Assert.assertTrue(entry.getValue()); } } @BeforeClass() public void beforeClass() { System.out .println("START " + getShortClassName() + " at " + new Date(System.currentTimeMillis())); if (_gZkClient.exists(PREFIX)) { _gZkClient.deleteRecursively(PREFIX); } } @AfterClass public void afterClass() { if (_gZkClient.exists(PREFIX)) { _gZkClient.deleteRecursively(PREFIX); } System.out .println("END " + getShortClassName() + " at " + new Date(System.currentTimeMillis())); } private ZNRecord getExampleZNRecord() { ZNRecord record = new ZNRecord("TestDB"); record.setSimpleField(IdealStateProperty.REBALANCE_MODE.toString(), RebalanceMode.CUSTOMIZED.toString()); Map<String, String> map = new HashMap<>(); map.put("localhost_12918", "MASTER"); map.put("localhost_12919", "SLAVE"); record.setMapField("TestDB_0", map); List<String> list = new ArrayList<>(); list.add("localhost_12918"); list.add("localhost_12919"); record.setListField("TestDB_0", list); return record; } }
{ "pile_set_name": "Github" }
-- -- Copyright (c) 2014 Red Hat, Inc. -- -- This software is licensed to you under the GNU General Public License, -- version 2 (GPLv2). There is NO WARRANTY for this software, express or -- implied, including the implied warranties of MERCHANTABILITY or FITNESS -- FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 -- along with this software; if not, see -- http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. -- -- Red Hat trademarks are not licensed under GPLv2. No permission is -- granted to use or replicate Red Hat trademarks that are incorporated -- in this software or its documentation. -- -- -- -- insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ia32'), LOOKUP_CHANNEL_ARCH('channel-ia32')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ia64'), LOOKUP_CHANNEL_ARCH('channel-ia32')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ia64'), LOOKUP_CHANNEL_ARCH('channel-ia64')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ia32-deb'), LOOKUP_CHANNEL_ARCH('channel-ia32-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ia64-deb'), LOOKUP_CHANNEL_ARCH('channel-ia32-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ia64-deb'), LOOKUP_CHANNEL_ARCH('channel-ia64-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-sparc'), LOOKUP_CHANNEL_ARCH('channel-sparc')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-sparc-deb'), LOOKUP_CHANNEL_ARCH('channel-sparc-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-alpha'), LOOKUP_CHANNEL_ARCH('channel-alpha')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-alpha-deb'), LOOKUP_CHANNEL_ARCH('channel-alpha-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-s390'), LOOKUP_CHANNEL_ARCH('channel-s390')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-s390-deb'), LOOKUP_CHANNEL_ARCH('channel-s390-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-s390x'), LOOKUP_CHANNEL_ARCH('channel-s390')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-s390x'), LOOKUP_CHANNEL_ARCH('channel-s390x')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-iSeries'), LOOKUP_CHANNEL_ARCH('channel-iSeries')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-pSeries'), LOOKUP_CHANNEL_ARCH('channel-pSeries')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-x86_64'), LOOKUP_CHANNEL_ARCH('channel-ia32')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-x86_64'), LOOKUP_CHANNEL_ARCH('channel-x86_64')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-amd64-deb'), LOOKUP_CHANNEL_ARCH('channel-ia32-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-amd64-deb'), LOOKUP_CHANNEL_ARCH('channel-amd64-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ppc'), LOOKUP_CHANNEL_ARCH('channel-ppc')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-powerpc-deb'), LOOKUP_CHANNEL_ARCH('channel-powerpc-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-arm'), LOOKUP_CHANNEL_ARCH('channel-arm')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-armhfp'), LOOKUP_CHANNEL_ARCH('channel-armhfp')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-arm-deb'), LOOKUP_CHANNEL_ARCH('channel-arm-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-mips-deb'), LOOKUP_CHANNEL_ARCH('channel-mips-deb')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-aarch64'), LOOKUP_CHANNEL_ARCH('channel-aarch64')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-ppc64le'), LOOKUP_CHANNEL_ARCH('channel-ppc64le')); insert into rhnChildChannelArchCompat (parent_arch_id, child_arch_id) values (LOOKUP_CHANNEL_ARCH('channel-arm64-deb'), LOOKUP_CHANNEL_ARCH('channel-arm64-deb')); commit;
{ "pile_set_name": "Github" }
#ifndef __glplatform_h_ #define __glplatform_h_ /* ** Copyright 2017-2020 The Khronos Group Inc. ** SPDX-License-Identifier: Apache-2.0 */ /* Platform-specific types and definitions for OpenGL ES 1.X gl.h * * Adopters may modify khrplatform.h and this file to suit their platform. * Please contribute modifications back to Khronos as pull requests on the * public github repository: * https://github.com/KhronosGroup/OpenGL-Registry */ #include <KHR/khrplatform.h> #ifndef GL_API #define GL_API KHRONOS_APICALL #endif #ifndef GL_APIENTRY #define GL_APIENTRY KHRONOS_APIENTRY #endif #endif /* __glplatform_h_ */
{ "pile_set_name": "Github" }
/*************************************************** * 版权声明 * * 本操作系统名为:MINE * 该操作系统未经授权不得以盈利或非盈利为目的进行开发, * 只允许个人学习以及公开交流使用 * * 代码最终所有权及解释权归田宇所有; * * 本模块作者: 田宇 * EMail: [email protected] * * ***************************************************/ #include "interrupt.h" #include "linkage.h" #include "lib.h" #include "printk.h" #include "memory.h" #include "gate.h" #include "ptrace.h" #include "cpu.h" #include "APIC.h" #include "schedule.h" #include "SMP.h" /* */ void IOAPIC_enable(unsigned long irq) { unsigned long value = 0; value = ioapic_rte_read((irq - 32) * 2 + 0x10); value = value & (~0x10000UL); ioapic_rte_write((irq - 32) * 2 + 0x10,value); } void IOAPIC_disable(unsigned long irq) { unsigned long value = 0; value = ioapic_rte_read((irq - 32) * 2 + 0x10); value = value | 0x10000UL; ioapic_rte_write((irq - 32) * 2 + 0x10,value); } unsigned long IOAPIC_install(unsigned long irq,void * arg) { struct IO_APIC_RET_entry *entry = (struct IO_APIC_RET_entry *)arg; ioapic_rte_write((irq - 32) * 2 + 0x10,*(unsigned long *)entry); return 1; } void IOAPIC_uninstall(unsigned long irq) { ioapic_rte_write((irq - 32) * 2 + 0x10,0x10000UL); } void IOAPIC_level_ack(unsigned long irq) { __asm__ __volatile__( "movq $0x00, %%rdx \n\t" "movq $0x00, %%rax \n\t" "movq $0x80b, %%rcx \n\t" "wrmsr \n\t" :::"memory"); *ioapic_map.virtual_EOI_address = 0; } void IOAPIC_edge_ack(unsigned long irq) { __asm__ __volatile__( "movq $0x00, %%rdx \n\t" "movq $0x00, %%rax \n\t" "movq $0x80b, %%rcx \n\t" "wrmsr \n\t" :::"memory"); } void Local_APIC_edge_level_ack(unsigned long irq) { __asm__ __volatile__( "movq $0x00, %%rdx \n\t" "movq $0x00, %%rax \n\t" "movq $0x80b, %%rcx \n\t" "wrmsr \n\t" :::"memory"); } /* */ unsigned long ioapic_rte_read(unsigned char index) { unsigned long ret; *ioapic_map.virtual_index_address = index + 1; io_mfence(); ret = *ioapic_map.virtual_data_address; ret <<= 32; io_mfence(); *ioapic_map.virtual_index_address = index; io_mfence(); ret |= *ioapic_map.virtual_data_address; io_mfence(); return ret; } /* */ void ioapic_rte_write(unsigned char index,unsigned long value) { *ioapic_map.virtual_index_address = index; io_mfence(); *ioapic_map.virtual_data_address = value & 0xffffffff; value >>= 32; io_mfence(); *ioapic_map.virtual_index_address = index + 1; io_mfence(); *ioapic_map.virtual_data_address = value & 0xffffffff; io_mfence(); } /* */ void IOAPIC_pagetable_remap() { unsigned long * tmp; unsigned char * IOAPIC_addr = (unsigned char *)Phy_To_Virt(0xfec00000); ioapic_map.physical_address = 0xfec00000; ioapic_map.virtual_index_address = IOAPIC_addr; ioapic_map.virtual_data_address = (unsigned int *)(IOAPIC_addr + 0x10); ioapic_map.virtual_EOI_address = (unsigned int *)(IOAPIC_addr + 0x40); tmp = Phy_To_Virt(Get_gdt() + (((unsigned long)IOAPIC_addr >> PAGE_GDT_SHIFT) & 0x1ff)); if (*tmp == 0) { unsigned long * virtual = kmalloc(PAGE_4K_SIZE,0); memset(virtual,0,PAGE_4K_SIZE); set_mpl4t(tmp,mk_mpl4t(Virt_To_Phy(virtual),PAGE_KERNEL_GDT)); } color_printk(YELLOW,BLACK,"1:%#018lx\t%#018lx\n",(unsigned long)tmp,(unsigned long)*tmp); tmp = Phy_To_Virt((unsigned long *)(*tmp & (~ 0xfffUL)) + (((unsigned long)IOAPIC_addr >> PAGE_1G_SHIFT) & 0x1ff)); if(*tmp == 0) { unsigned long * virtual = kmalloc(PAGE_4K_SIZE,0); memset(virtual,0,PAGE_4K_SIZE); set_pdpt(tmp,mk_pdpt(Virt_To_Phy(virtual),PAGE_KERNEL_Dir)); } color_printk(YELLOW,BLACK,"2:%#018lx\t%#018lx\n",(unsigned long)tmp,(unsigned long)*tmp); tmp = Phy_To_Virt((unsigned long *)(*tmp & (~ 0xfffUL)) + (((unsigned long)IOAPIC_addr >> PAGE_2M_SHIFT) & 0x1ff)); set_pdt(tmp,mk_pdt(ioapic_map.physical_address,PAGE_KERNEL_Page | PAGE_PWT | PAGE_PCD)); color_printk(BLUE,BLACK,"3:%#018lx\t%#018lx\n",(unsigned long)tmp,(unsigned long)*tmp); color_printk(BLUE,BLACK,"ioapic_map.physical_address:%#010x\t\t\n",ioapic_map.physical_address); color_printk(BLUE,BLACK,"ioapic_map.virtual_address:%#018lx\t\t\n",(unsigned long)ioapic_map.virtual_index_address); flush_tlb(); } /* */ void Local_APIC_init() { unsigned int x,y; unsigned int a,b,c,d; //check APIC & x2APIC support get_cpuid(1,0,&a,&b,&c,&d); //void get_cpuid(unsigned int Mop,unsigned int Sop,unsigned int * a,unsigned int * b,unsigned int * c,unsigned int * d) color_printk(WHITE,BLACK,"CPUID\t01,eax:%#010x,ebx:%#010x,ecx:%#010x,edx:%#010x\n",a,b,c,d); if((1<<9) & d) color_printk(WHITE,BLACK,"HW support APIC&xAPIC\t"); else color_printk(WHITE,BLACK,"HW NO support APIC&xAPIC\t"); if((1<<21) & c) color_printk(WHITE,BLACK,"HW support x2APIC\n"); else color_printk(WHITE,BLACK,"HW NO support x2APIC\n"); //enable xAPIC & x2APIC __asm__ __volatile__( "movq $0x1b, %%rcx \n\t" "rdmsr \n\t" "bts $10, %%rax \n\t" "bts $11, %%rax \n\t" "wrmsr \n\t" "movq $0x1b, %%rcx \n\t" "rdmsr \n\t" :"=a"(x),"=d"(y) : :"memory"); color_printk(WHITE,BLACK,"eax:%#010x,edx:%#010x\t",x,y); if(x&0xc00) color_printk(WHITE,BLACK,"xAPIC & x2APIC enabled\n"); //enable SVR[8] __asm__ __volatile__( "movq $0x80f, %%rcx \n\t" "rdmsr \n\t" "bts $8, %%rax \n\t" "bts $12, %%rax\n\t" "wrmsr \n\t" "movq $0x80f, %%rcx \n\t" "rdmsr \n\t" :"=a"(x),"=d"(y) : :"memory"); color_printk(WHITE,BLACK,"eax:%#010x,edx:%#010x\t",x,y); if(x&0x100) color_printk(WHITE,BLACK,"SVR[8] enabled\n"); if(x&0x1000) color_printk(WHITE,BLACK,"SVR[12] enabled\n"); //get local APIC ID __asm__ __volatile__( "movq $0x802, %%rcx \n\t" "rdmsr \n\t" :"=a"(x),"=d"(y) : :"memory"); color_printk(WHITE,BLACK,"eax:%#010x,edx:%#010x\tx2APIC ID:%#010x\n",x,y,x); //get local APIC version __asm__ __volatile__( "movq $0x803, %%rcx \n\t" "rdmsr \n\t" :"=a"(x),"=d"(y) : :"memory"); color_printk(WHITE,BLACK,"local APIC Version:%#010x,Max LVT Entry:%#010x,SVR(Suppress EOI Broadcast):%#04x\t",x & 0xff,(x >> 16 & 0xff) + 1,x >> 24 & 0x1); if((x & 0xff) < 0x10) color_printk(WHITE,BLACK,"82489DX discrete APIC\n"); else if( ((x & 0xff) >= 0x10) && ((x & 0xff) <= 0x15) ) color_printk(WHITE,BLACK,"Integrated APIC\n"); //mask all LVT __asm__ __volatile__( "movq $0x82f, %%rcx \n\t" //CMCI "wrmsr \n\t" "movq $0x832, %%rcx \n\t" //Timer "wrmsr \n\t" "movq $0x833, %%rcx \n\t" //Thermal Monitor "wrmsr \n\t" "movq $0x834, %%rcx \n\t" //Performance Counter "wrmsr \n\t" "movq $0x835, %%rcx \n\t" //LINT0 "wrmsr \n\t" "movq $0x836, %%rcx \n\t" //LINT1 "wrmsr \n\t" "movq $0x837, %%rcx \n\t" //Error "wrmsr \n\t" : :"a"(0x10000),"d"(0x00) :"memory"); color_printk(GREEN,BLACK,"Mask ALL LVT\n"); //TPR __asm__ __volatile__( "movq $0x808, %%rcx \n\t" "rdmsr \n\t" :"=a"(x),"=d"(y) : :"memory"); color_printk(GREEN,BLACK,"Set LVT TPR:%#010x\t",x); //PPR __asm__ __volatile__( "movq $0x80a, %%rcx \n\t" "rdmsr \n\t" :"=a"(x),"=d"(y) : :"memory"); color_printk(GREEN,BLACK,"Set LVT PPR:%#010x\n",x); } /* */ void IOAPIC_init() { int i ; // I/O APIC // I/O APIC ID *ioapic_map.virtual_index_address = 0x00; io_mfence(); *ioapic_map.virtual_data_address = 0x0f000000; io_mfence(); color_printk(GREEN,BLACK,"Get IOAPIC ID REG:%#010x,ID:%#010x\n",*ioapic_map.virtual_data_address, *ioapic_map.virtual_data_address >> 24 & 0xf); io_mfence(); // I/O APIC Version *ioapic_map.virtual_index_address = 0x01; io_mfence(); color_printk(GREEN,BLACK,"Get IOAPIC Version REG:%#010x,MAX redirection enties:%#08d\n",*ioapic_map.virtual_data_address ,((*ioapic_map.virtual_data_address >> 16) & 0xff) + 1); //RTE for(i = 0x10;i < 0x40;i += 2) ioapic_rte_write(i,0x10020 + ((i - 0x10) >> 1)); color_printk(GREEN,BLACK,"I/O APIC Redirection Table Entries Set Finished.\n"); } /* */ void APIC_IOAPIC_init() { // init trap abort fault int i ; unsigned int x; unsigned int * p = NULL; IOAPIC_pagetable_remap(); for(i = 32;i < 56;i++) { set_intr_gate(i , 0 , interrupt[i - 32]); } //mask 8259A color_printk(GREEN,BLACK,"MASK 8259A\n"); io_out8(0x21,0xff); io_out8(0xa1,0xff); //enable IMCR io_out8(0x22,0x70); io_out8(0x23,0x01); //init local apic Local_APIC_init(); //init ioapic IOAPIC_init(); //get RCBA address io_out32(0xcf8,0x8000f8f0); x = io_in32(0xcfc); color_printk(RED,BLACK,"Get RCBA Address:%#010x\n",x); x = x & 0xffffc000; color_printk(RED,BLACK,"Get RCBA Address:%#010x\n",x); //get OIC address if(x > 0xfec00000 && x < 0xfee00000) { p = (unsigned int *)Phy_To_Virt(x + 0x31feUL); } //enable IOAPIC x = (*p & 0xffffff00) | 0x100; io_mfence(); *p = x; io_mfence(); memset(interrupt_desc,0,sizeof(irq_desc_T)*NR_IRQS); //open IF eflages // sti(); } /* */ void do_IRQ(struct pt_regs * regs,unsigned long nr) //regs:rsp,nr { switch(nr & 0x80) { case 0x00: { irq_desc_T * irq = &interrupt_desc[nr - 32]; if(irq->handler != NULL) irq->handler(nr,irq->parameter,regs); if(irq->controller != NULL && irq->controller->ack != NULL) irq->controller->ack(nr); } break; case 0x80: // color_printk(RED,BLACK,"SMP IPI:%d,CPU:%d\n",nr,SMP_cpu_id()); Local_APIC_edge_level_ack(nr); { irq_desc_T * irq = &SMP_IPI_desc[nr - 200]; if(irq->handler != NULL) irq->handler(nr,irq->parameter,regs); } break; default: color_printk(RED,BLACK,"do_IRQ receive:%d\n",nr); break; } }
{ "pile_set_name": "Github" }
class A implements Comparable<A> { int foo() { return 1; // Noncompliant [[sc=12;ec=13]] {{Remove this method and declare a constant for this value.}} } String bar() { return ""; // Noncompliant [[sc=12;ec=14]] {{Remove this method and declare a constant for this value.}} } char qix() { return 'c'; // Noncompliant [[sc=12;ec=15]] {{Remove this method and declare a constant for this value.}} } Object lum() { return new Object(); // Compliant } int gul() { System.out.println("foo"); return 1; } abstract void bom(); void bah(){ return; } void tol(){ System.out.println(""); } @Override public String toString() { return ""; // compliant, this method is an override } // removed @Override annotation public int compareTo(A o) { return 0; // Compliant - method is an override } long gro() { return 1L; // Noncompliant [[sc=12;ec=14]] {{Remove this method and declare a constant for this value.}} } @MyAnnotation long puf() { return 1L; // Compliant } } @interface MyAnnotation {} interface B { default String defaultMethodReturningConstant() { return ""; } }
{ "pile_set_name": "Github" }
--- layout: documentation title: ReactiveX - TakeLast operator id: takeLast --- <ol class="breadcrumb"> <li><a href="{{ site.url }}/documentation/operators.html">Operators</a></li> <li><a href="{{ site.url }}/documentation/operators.html#filtering">Filtering</a></li> <li class="active">TakeLast</li> </ol> <h1>TakeLast</h1> <h3>emit only the final <i>n</i> items emitted by an Observable</h3> <figure class="rxmarbles-figure"> <rx-marbles key="takeLast"></rx-marbles> <figcaption><p> You can emit only the final <i>n</i> items emitted by an Observable and ignore those items that come before them, by modifying the Observable with the <span class="operator">TakeLast</span> operator. </p></figcaption> </figure> <h4>See Also</h4> <ul> <li><a href="last.html"><span class="operator">Last</span></a></li> <li><a href="skip.html"><span class="operator">Skip</span></a></li> <li><a href="skiplast.html"><span class="operator">SkipLast</span></a></li> <li><a href="skipuntil.html"><span class="operator">SkipUntil</span></a></li> <li><a href="skipwhile.html"><span class="operator">SkipWhile</span></a></li> <li><a href="take.html"><span class="operator">Take</span></a></li> <li><a href="takeuntil.html"><span class="operator">TakeUntil</span></a></li> <li><a href="takewhile.html"><span class="operator">TakeWhile</span></a></li> <li><a href="http://www.introtorx.com/Content/v1.0.10621.0/05_Filtering.html#SkipLastTakeLast"><cite>Introduction to Rx</cite>: SkipLast and TakeLast</a></li> <li><a href="http://rxmarbles.com/#takeLast">RxMarbles: <code>takeLast</code></a></li> </ul> <h2>Language-Specific Information:</h2> <div class="panel-group operators-by-language" id="accordion" role="tablist" aria-multiselectable="true"> {% lang_operator RxClojure next %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator RxCpp %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator RxGroovy takeLast takeLastBuffer %} <figure> <img src="images/takeLast.n.png" style="width:100%;" alt="takeLast" /> <figcaption><p> You can emit only the final <i>n</i> items emitted by an Observable and ignore those items that precede them, by modifying the Observable with the <code>takeLast(<i>n</i>)</code> operator. Note that this will delay the emission of any item from the source Observable until the source Observable completes. </p> <h4>Sample Code</h4> <div class="code groovy"><pre> numbers = Observable.from([1, 2, 3, 4, 5, 6, 7, 8, 9]); numbers.takeLast(2).subscribe( { println(it); }, // onNext { println("Error: " + it.getMessage()); }, // onError { println("Sequence complete"); } // onCompleted );</pre></div> <div class="output"><pre> 8 9 Sequence complete</pre></div> <p> This variant of <code>takeLast</code> does not by default operate on any particular <a href="../scheduler.html">Scheduler</a>. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(int)"><code>takeLast(int)</code></a></li> </ul></figcaption> </figure> <figure> <img src="images/takeLast.t.png" style="width:100%;" alt="takeLast" /> <figcaption><p> There is also a variant of <code>takeLast</code> that takes a temporal duration rather than a quantity of items. It emits only those items that are emitted during that final duration of the source Observable&#8217;s lifespan. You set this duration by passing in a length of time and the time units this length is denominated in as parameters to <code>takeLast</code>. </p><p> Note that this will delay the emission of any item from the source Observable until the source Observable completes. </p><p> This variant of <code>takeLast</code> by default operates on the <code>computation</code> <a href="../scheduler.html">Scheduler</a>, but you may also pass in a Scheduler of your choosing as an optional third parameter. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(long,%20java.util.concurrent.TimeUnit)"><code>takeLast(long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLast(long,TimeUnit,Scheduler)</code></a></li> </ul></figcaption> </figure> <figure> <img src="images/takeLast.tn.png" style="width:100%;" alt="takeLast" /> <figcaption><p> There is also a variant that combines the two methods. It emits the minimum of the number of items emitted during a specified time window <em>or</em> a particular count of items. </p><p> This variant of <code>takeLast</code> by default operates on the <code>computation</code> <a href="../scheduler.html">Scheduler</a>, but you may also pass in a Scheduler of your choosing as an optional fourth parameter. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(int,%20long,%20java.util.concurrent.TimeUnit)"><code>takeLast(int,long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(int,%20long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLast(int,long,TimeUnit,Scheduler)</code></a></li> </ul></figcaption> </figure> <figure> <img src="images/takeLastBuffer.png" style="width:100%;" alt="takeLastBuffer" /> <figcaption><p> There is also an operator called <code>takeLastBuffer</code>. It exists in the same set of variants as described above for <code>takeLast</code>, and only differs in behavior by emitting its items not individually but collected into a single <code>List</code> of items that is emitted as a single item. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(int)"><code>takeLastBuffer(int)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(long,%20java.util.concurrent.TimeUnit)"><code>takeLastBuffer(long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLastBuffer(long,TimeUnit,Scheduler)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(int,%20long,%20java.util.concurrent.TimeUnit)"><code>takeLastBuffer(int,long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(int,%20long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLastBuffer(int,long,TimeUnit,Scheduler)</code></a></li> </ul></figcaption> </figure> {% endlang_operator %} {% lang_operator RxJava&nbsp;1․x takeLast takeLastBuffer %} <figure> <img src="images/takeLast.n.png" style="width:100%;" alt="takeLast" /> <figcaption><p> You can emit only the final <i>n</i> items emitted by an Observable and ignore those items that precede them, by modifying the Observable with the <code>takeLast(<i>n</i>)</code> operator. Note that this will delay the emission of any item from the source Observable until the source Observable completes. </p><p> This variant of <code>takeLast</code> does not by default operate on any particular <a href="../scheduler.html">Scheduler</a>. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(int)"><code>takeLast(int)</code></a></li> </ul></figcaption> </figure> <figure> <img src="images/takeLast.t.png" style="width:100%;" alt="takeLast" /> <figcaption><p> There is also a variant of <code>takeLast</code> that takes a temporal duration rather than a quantity of items. It emits only those items that are emitted during that final duration of the source Observable&#8217;s lifespan. You set this duration by passing in a length of time and the time units this length is denominated in as parameters to <code>takeLast</code>. </p><p> Note that this will delay the emission of any item from the source Observable until the source Observable completes. </p><p> This variant of <code>takeLast</code> by default operates on the <code>computation</code> <a href="../scheduler.html">Scheduler</a>, but you may also pass in a Scheduler of your choosing as an optional third parameter. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(long,%20java.util.concurrent.TimeUnit)"><code>takeLast(long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLast(long,TimeUnit,Scheduler)</code></a></li> </ul></figcaption> </figure> <figure> <img src="images/takeLast.tn.png" style="width:100%;" alt="takeLast" /> <figcaption><p> There is also a variant that combines the two methods. It emits the minimum of the number of items emitted during a specified time window <em>or</em> a particular count of items. </p><p> This variant of <code>takeLast</code> by default operates on the <code>computation</code> <a href="../scheduler.html">Scheduler</a>, but you may also pass in a Scheduler of your choosing as an optional fourth parameter. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(int,%20long,%20java.util.concurrent.TimeUnit)"><code>takeLast(int,long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLast(int,%20long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLast(int,long,TimeUnit,Scheduler)</code></a></li> </ul></figcaption> </figure> <figure> <img src="images/takeLastBuffer.png" style="width:100%;" alt="takeLastBuffer" /> <figcaption><p> There is also an operator called <code>takeLastBuffer</code>. It exists in the same set of variants as described above for <code>takeLast</code>, and only differs in behavior by emitting its items not individually but collected into a single <code>List</code> of items that is emitted as a single item. </p> <ul> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(int)"><code>takeLastBuffer(int)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(long,%20java.util.concurrent.TimeUnit)"><code>takeLastBuffer(long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLastBuffer(long,TimeUnit,Scheduler)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(int,%20long,%20java.util.concurrent.TimeUnit)"><code>takeLastBuffer(int,long,TimeUnit)</code></a></li> <li>Javadoc: <a href="http://reactivex.io/RxJava/javadoc/rx/Observable.html#takeLastBuffer(int,%20long,%20java.util.concurrent.TimeUnit,%20rx.Scheduler)"><code>takeLastBuffer(int,long,TimeUnit,Scheduler)</code></a></li> </ul></figcaption> </figure> {% endlang_operator %} {% lang_operator RxJava&nbsp;2․x takeLast %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator RxJS takeLast takeLastBuffer takeLastBufferWithTime takeLastWithTime %} <figure> <img src="images/takeLast.n.png" style="width:100%;" alt="takeLast" /> <figcaption><p> You can emit only the final <i>n</i> items emitted by an Observable and ignore those items that precede them, by modifying the Observable with the <code>takeLast(<i>n</i>)</code> operator. Note that this will delay the emission of any item from the source Observable until that Observable completes. </p> <h4>Sample Code</h4> <div class="code javascript"><pre> var source = Rx.Observable.range(0, 5) .takeLast(3); var subscription = source.subscribe( function (x) { console.log('Next: ' + x); }, function (err) { console.log('Error: ' + err); }, function () { console.log('Completed'); });</pre></div> <div class="output"><pre> Next: 2 Next: 3 Next: 4 Completed</pre></div> <p> <code>takeLast</code> is found in each of the following distributions: </p> <ul> <li><code>rx.js</code></li> <li><code>rx.alljs</code></li> <li><code>rx.all.compatjs</code></li> <li><code>rx.compat.js</code></li> <li><code>rx.lite.js</code></li> <li><code>rx.lite.compat.js</code></li> </ul> </figcaption> </figure> <figure> <img src="images/takeLastWithTime.png" style="width:100%;" alt="takeLastWithTime" /> <figcaption><p> The <code>takeLastWithTime</code> operator takes a temporal duration rather than a quantity of items. It emits only those items that are emitted during that final duration of the source Observable&#8217;s lifespan. You set this duration by passing in a number of milliseconds as a parameter to <code>takeLastWithTime</code>. </p><p> Note that the mechanism by which this is implemented will delay the emission of any item from the source Observable until that Observable completes. </p><p> <code>takeLastWithTime</code> by default operates the timer on the <code>timeout</code> <a href="../scheduler.html">Scheduler</a> and emits items on the <code>currentThread</code> Scheduler, but you may also pass in Schedulers of your choosing to override these, as an optional second and third parameters, respectively. </p> <h4>Sample Code</h4> <div class="code javascript"><pre> var source = Rx.Observable.timer(0, 1000) .take(10) .takeLastWithTime(5000); var subscription = source.subscribe( function (x) { console.log('Next: ' + x); }, function (err) { console.log('Error: ' + err); }, function () { console.log('Completed'); });</pre></div> <div class="output"><pre> Next: 5 Next: 6 Next: 7 Next: 8 Next: 9 Completed</pre></div> <p> <code>takeLastWithTime</code> is found in each of the following distributions: </p> <ul> <li><code>rx.all.js</code></li> <li><code>rx.all.compat.js</code></li> <li><code>rx.time.js</code> (requires <code>rx.js</code> or <code>rx.compat.js</code>)</li> <li><code>rx.lite.js</code></li> <li><code>rx.lite.compat.js</code></li> </ul> </figcaption> </figure> <figure> <img src="images/takeLastBuffer.png" style="width:100%;" alt="takeLastBuffer" /> <figcaption><p> There is also an operator called <code>takeLastBuffer</code>. It differs in behavior from <code>takeLast</code> by emitting its items not individually but collected into a single array of items that is emitted as a single item. </p> <h4>Sample Code</h4> <div class="code javascript"><pre> var source = Rx.Observable.range(0, 5) .takeLastBuffer(3); var subscription = source.subscribe( function (x) { console.log('Next: ' + x); }, function (err) { console.log('Error: ' + err); }, function () { console.log('Completed'); });</pre></div> <div class="output"><pre> Next: 2,3,4 Completed</pre></div> <p> <code>takeLastBuffer</code> is found in each of the following distributions: <ul> <li><code>rx.js</code></li> <li><code>rx.all.js</code></li> <li><code>rx.all.compat.js</code></li> <li><code>rx.compat.js</code></li> <li><code>rx.lite.js</code></li> <li><code>rx.lite.compat.js</code></li> </ul> </figcaption> </figure> <figure> <img src="images/takeLastBufferWithTime.png" style="width:100%;" alt="takeLastBufferWithTime" /> <figcaption><p> <code>takeLastBuffer</code> also has its duration-based variant, <code>takeLastBufferWithTime</code>, which is similar to <code>takeLastWithTime</code> except that it emits its items not individually but collected into a single array of items that is emitted as a single item. </p> <h4>Sample Code</h4> <div class="code javascript"><pre> var source = Rx.Observable .timer(0, 1000) .take(10) .takeLastBufferWithTime(5000); var subscription = source.subscribe( function (x) { console.log('Next: ' + x); }, function (err) { console.log('Error: ' + err); }, function () { console.log('Completed'); });</pre></div> <div class="output"><pre> Next: 5,6,7,8,9 Completed</pre></div> <p> <code>takeLastBufferWithTime</code> is found in each of the following distributions: <ul> <li><code>rx.js</code></li> <li><code>rx.all.js</code></li> <li><code>rx.all.compat.js</code></li> <li><code>rx.compat.js</code></li> <li><code>rx.time.js</code> (requires <code>rx.js</code> or <code>rx.compat.js</code>)</li> <li><code>rx.lite.js</code></li> <li><code>rx.lite.compat.js</code></li> </ul> </figcaption> </figure> {% endlang_operator %} {% lang_operator RxKotlin takeLast takeLastBuffer %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator Rx.NET TakeLast %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator RxPHP takeLast %} <figure class="variant"> <figcaption> <p> RxPHP implements this operator as <code>takeLast</code>. </p> <p> Returns a specified number of contiguous elements from the end of an observable sequence. </p> <h4>Sample Code</h4> <div class="code php"> <pre> //from https://github.com/ReactiveX/RxPHP/blob/master/demo/take/takeLast.php $source = \Rx\Observable::range(0, 5) ->takeLast(3); $source->subscribe($stdoutObserver); </pre> </div> <div class="output"> <pre> Next value: 2 Next value: 3 Next value: 4 Complete! </pre> </div> </figcaption> </figure> {% endlang_operator %} {% lang_operator RxPY take_last take_last_buffer take_last_with_time %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator Rx.rb take_last take_last_buffer %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator RxScala tail takeRight %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} {% lang_operator RxSwift takeLast %} <p> <span style="color:#ff0000">TBD</span> </p> {% endlang_operator %} </div>
{ "pile_set_name": "Github" }
.\" $OpenBSD: vi.in,v 1.8 2004/02/20 20:05:05 jmc Exp $ .\" .\" Copyright (c) 1980, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)vi.in 8.5 (Berkeley) 8/18/96 .\" .if n \{\ .po 5n .ll 70n .\} .nr LL 6.5i .nr FL 6.5i .EH 'USD:11-%''An Introduction to Display Editing with Vi' .OH 'An Introduction to Display Editing with Vi''USD:11-%' .\" .bd S 3 .if t .ds dg \(dg .if n .ds dg + .if t .ds dd \(dd .if n .ds dd ++ .\".RP .TL An Introduction to Display Editing with Vi .AU William Joy .AU Mark Horton .AI Computer Science Division Department of Electrical Engineering and Computer Science University of California, Berkeley Berkeley, Ca. 94720 .AB .PP .I Vi (visual) is a display oriented interactive text editor. When using .I vi the screen of your terminal acts as a window into the file which you are editing. Changes which you make to the file are reflected in what you see. .PP Using .I vi you can insert new text any place in the file quite easily. Most of the commands to .I vi move the cursor around in the file. There are commands to move the cursor forward and backward in units of characters, words, sentences and paragraphs. A small set of operators, like .B d for delete and .B c for change, are combined with the motion commands to form operations such as delete word or change paragraph, in a simple and natural way. This regularity and the mnemonic assignment of commands to keys makes the editor command set easy to remember and to use. .PP .I Vi will work on a large number of display terminals, and new terminals are easily driven after editing a terminal description file. While it is advantageous to have an intelligent terminal which can locally insert and delete lines and characters from the display, the editor will function quite well on dumb terminals over slow phone lines. The editor makes allowance for the low bandwidth in these situations and uses smaller window sizes and different display updating algorithms to make best use of the limited speed available. .PP It is also possible to use the command set of .I vi on hardcopy terminals, storage tubes and ``glass tty's'' using a one-line editing window; thus .I vi 's command set is available on all terminals. The full command set of the more traditional, line oriented editor .I ex is available within .I vi ; it is quite simple to switch between the two modes of editing. .AE .NH 1 Getting started .PP .FS The financial support of an \s-2IBM\s0 Graduate Fellowship and the National Science Foundation under grants MCS74-07644-A03 and MCS78-07291 is gratefully acknowledged. .FE This document provides a quick introduction to .I vi . (Pronounced \fIvee-eye\fP.) You should be running .I vi on a file you are familiar with while you are reading this. The first part of this document (sections 1 through 5) describes the basics of using .I vi . Some topics of special interest are presented in section 6, and some nitty-gritty details of how the editor functions are saved for section 7 to avoid cluttering the presentation here. .PP There is also a short appendix here, which gives for each character the special meanings which this character has in \fIvi\fR. Attached to this document should be a quick reference card. This card summarizes the commands of .I vi in a very compact format. You should have the card handy while you are learning .I vi . .NH 2 Specifying terminal type .PP Before you start .I vi you can tell the system what kind of terminal you are using. Here is a (necessarily incomplete) list of terminal type codes. If your terminal does not appear here, you should consult with one of the staff members on your system to find out the code for your terminal. If your terminal does not have a code, one can be assigned and a description for the terminal can be created. .LP .TS center; ab ab ab a a a. Code Full name Type _ 2621 Hewlett-Packard 2621A/P Intelligent 2645 Hewlett-Packard 264x Intelligent act4 Microterm ACT-IV Dumb act5 Microterm ACT-V Dumb adm3a Lear Siegler ADM-3a Dumb adm31 Lear Siegler ADM-31 Intelligent c100 Human Design Concept 100 Intelligent dm1520 Datamedia 1520 Dumb dm2500 Datamedia 2500 Intelligent dm3025 Datamedia 3025 Intelligent fox Perkin-Elmer Fox Dumb h1500 Hazeltine 1500 Intelligent h19 Heathkit h19 Intelligent i100 Infoton 100 Intelligent mime Imitating a smart act4 Intelligent t1061 Teleray 1061 Intelligent vt52 Dec VT-52 Dumb .TE .PP Suppose for example that you have a Hewlett-Packard HP2621A terminal. The code used by the system for this terminal is `2621'. In this case you can use one of the following commands to tell the system the type of your terminal: .DS I % setenv TERM 2621 .DE This command works with the .I csh shell. If you are using the standard Bourne shell .I sh then you should give the command: .DS I $ export TERM=2621 .DE .PP If you want to arrange to have your terminal type set up automatically when you log in, you can use the .I tset (1) program. If you dial in on a .I mime , but often use hardwired ports, a typical line for your .I .login file (if you use csh) would be .DS I % setenv TERM `tset - -d mime` .DE or for your .I .profile file (if you use sh) .DS I $ export TERM=`tset - -d mime` .DE .I Tset knows which terminals are hardwired to each port and needs only to be told that when you dial in you are probably on a .I mime . .I Tset is usually used to change the erase and kill characters, too. .NH 2 Editing a file .PP After telling the system which kind of terminal you have, you should make a copy of a file you are familiar with, and run .I vi on this file, giving the command .DS I % vi name .DE replacing \fIname\fR with the name of the copy file you just created. The screen should clear and the text of your file should appear on the screen. If something else happens refer to the footnote.\*(dd .FS \*(dd If you gave the system an incorrect terminal type code then the editor may have just made a mess out of your screen. This happens when it sends control codes for one kind of terminal to some other kind of terminal. In this case hit the keys \fB:q\fR (colon and the q key) and then hit the \s-2RETURN\s0 key. This should get you back to the command level interpreter. Figure out what you did wrong (ask someone else if necessary) and try again. Another thing which can go wrong is that you typed the wrong file name and the editor just printed an error diagnostic. In this case you should follow the above procedure for getting out of the editor and try again, this time spelling the file name correctly. If the editor doesn't seem to respond to the commands which you type here, try sending an interrupt to it by hitting the \s-2DEL\s0 or \s-2RUB\s0 key on your terminal, and then hitting the \fB:q\fR command again followed by a carriage return. .sp .FE .NH 2 The editor's copy: the buffer .PP The editor does not directly modify the file which you are editing. Rather, the editor makes a copy of this file, in a place called the .I buffer , and remembers the file's name. You do not affect the contents of the file unless and until you write the changes you make back into the original file. .NH 2 Notational conventions .PP In our examples, input which must be typed as is will be presented in \fBbold face\fR. Text which should be replaced with appropriate input will be given in \fIitalics\fR. We will represent special characters in \s-2SMALL CAPITALS\s0. .NH 2 Arrow keys .PP The editor command set is independent of the terminal you are using. On most terminals with cursor positioning keys, these keys will also work within the editor. If you don't have cursor positioning keys, or even if you do, you can use the \fBh j k\fR and \fBl\fR keys as cursor positioning keys (these are labelled with arrows on an .I adm3a). * .PP (Particular note for the HP2621: on this terminal the function keys must be \fIshifted\fR (ick) to send to the machine, otherwise they only act locally. Unshifted use will leave the cursor positioned incorrectly.) .FS * As we will see later, .B h moves back to the left (like control-h which is a backspace), .B j moves down (in the same column), .B k moves up (in the same column), and .B l moves to the right. .FE .NH 2 Special characters: \s-2ESC\s0, \s-2CR\s0 and \s-2DEL\s0 .PP Several of these special characters are very important, so be sure to find them right now. Look on your keyboard for a key labelled \s-2ESC\s0 or \s-2ALT\s0. It should be near the upper left corner of your terminal. Try hitting this key a few times. The editor will ring the bell to indicate that it is in a quiescent state.\*(dd .FS \*(dd On smart terminals where it is possible, the editor will quietly flash the screen rather than ringing the bell. .FE Partially formed commands are cancelled by \s-2ESC\s0, and when you insert text in the file you end the text insertion with \s-2ESC\s0. This key is a fairly harmless one to hit, so you can just hit it if you don't know what is going on until the editor rings the bell. .PP The \s-2CR\s0 or \s-2RETURN\s0 key is important because it is used to terminate certain commands. It is usually at the right side of the keyboard, and is the same command used at the end of each shell command. .PP Another very useful key is the \s-2DEL\s0 or \s-2RUB\s0 key, which generates an interrupt, telling the editor to stop what it is doing. It is a forceful way of making the editor listen to you, or to return it to the quiescent state if you don't know or don't like what is going on. Try hitting the `/' key on your terminal. This key is used when you want to specify a string to be searched for. The cursor should now be positioned at the bottom line of the terminal after a `/' printed as a prompt. You can get the cursor back to the current position by hitting the \s-2DEL\s0 or \s-2RUB\s0 key; try this now.* .FS * Backspacing over the `/' will also cancel the search. .FE From now on we will simply refer to hitting the \s-2DEL\s0 or \s-2RUB\s0 key as ``sending an interrupt.''** .FS ** On some systems, this interruptibility comes at a price: you cannot type ahead when the editor is computing with the cursor on the bottom line. .FE .PP The editor often echoes your commands on the last line of the terminal. If the cursor is on the first position of this last line, then the editor is performing a computation, such as computing a new position in the file after a search or running a command to reformat part of the buffer. When this is happening you can stop the editor by sending an interrupt. .NH 2 Getting out of the editor .PP After you have worked with this introduction for a while, and you wish to do something else, you can give the command \fBZZ\fP to the editor. This will write the contents of the editor's buffer back into the file you are editing, if you made any changes, and then quit from the editor. You can also end an editor session by giving the command \fB:q!\fR\s-2CR\s0;\*(dg .FS \*(dg All commands which read from the last display line can also be terminated with a \s-2ESC\s0 as well as an \s-2CR\s0. .FE this is a dangerous but occasionally essential command which ends the editor session and discards all your changes. You need to know about this command in case you change the editor's copy of a file you wish only to look at. Be very careful not to give this command when you really want to save the changes you have made. .NH 1 Moving around in the file .NH 2 Scrolling and paging .PP The editor has a number of commands for moving around in the file. The most useful of these is generated by hitting the control and D keys at the same time, a control-D or `^D'. We will use this two character notation for referring to these control keys from now on. .\" You may have a key labelled `^' on your terminal; .\" `^' is exclusively used as part of the `^x' notation for control characters. .PP As you know now if you tried hitting \fB^D\fR, this command scrolls down in the file. The \fBD\fR thus stands for down. Many editor commands are mnemonic and this makes them much easier to remember. For instance the command to scroll up is \fB^U\fR. Many dumb terminals can't scroll up at all, in which case hitting \fB^U\fR clears the screen and refreshes it with a line which is farther back in the file at the top. .PP If you want to see more of the file below where you are, you can hit \fB^E\fR to expose one more line at the bottom of the screen, leaving the cursor where it is. The command \fB^Y\fR (which is hopelessly non-mnemonic, but next to \fB^U\fR on the keyboard) exposes one more line at the top of the screen. .PP There are other ways to move around in the file; the keys \fB^F\fR and \fB^B\fR move forward and backward a page, keeping a couple of lines of continuity between screens so that it is possible to read through a file using these rather than \fB^D\fR and \fB^U\fR if you wish. .PP Notice the difference between scrolling and paging. If you are trying to read the text in a file, hitting \fB^F\fR to move forward a page will leave you only a little context to look back at. Scrolling on the other hand leaves more context, and happens more smoothly. You can continue to read the text as scrolling is taking place. .NH 2 Searching, goto, and previous context .PP Another way to position yourself in the file is by giving the editor a string to search for. Type the character \fB/\fR followed by a string of characters terminated by \s-2CR\s0. The editor will position the cursor at the next occurrence of this string. Try hitting \fBn\fR to then go to the next occurrence of this string. The character \fB?\fR will search backwards from where you are, and is otherwise like \fB/\fR.\*(dg .FS \*(dg These searches will normally wrap around the end of the file, and thus find the string even if it is not on a line in the direction you search provided it is anywhere else in the file. You can disable this wraparound in scans by giving the command \fB:se nowrapscan\fR\s-2CR\s0, or more briefly \fB:se nows\fR\s-2CR\s0. .FE .PP If the search string you give the editor is not present in the file, the editor will print a diagnostic on the last line of the screen, and the cursor will be returned to its initial position. .PP If you wish the search to match only at the beginning of a line, begin the search string with an \fB^\fR. To match only at the end of a line, end the search string with a \fB$\fR. Thus \fB/^search\fR\s-2CR\s0 will search for the word `search' at the beginning of a line, and \fB/last$\fR\s-2CR\s0 searches for the word `last' at the end of a line.* .FS *Actually, the string you give to search for here can be a .I "regular expression" in the sense of the editors .I ex (1) and .I ed (1). If you don't wish to learn about this yet, you can disable this more general facility by doing \fB:se\ nomagic\fR\s-2CR\s0; by putting this command in EXINIT in your environment, you can have this always be in effect (more about .I EXINIT later.) .FE .PP The command \fBG\fR, when preceded by a number will position the cursor at that line in the file. Thus \fB1G\fR will move the cursor to the first line of the file. If you give \fBG\fR no count, then it moves to the end of the file. .PP If you are near the end of the file, and the last line is not at the bottom of the screen, the editor will place only the character `~' on each remaining line. This indicates that the last line in the file is on the screen; that is, the `~' lines are past the end of the file. .PP You can find out the state of the file you are editing by typing a \fB^G\fR. The editor will show you the name of the file you are editing, the number of the current line, the number of lines in the buffer, and the percentage of the way through the buffer which you are. Try doing this now, and remember the number of the line you are on. Give a \fBG\fR command to get to the end and then another \fBG\fR command to get back where you were. .PP You can also get back to a previous position by using the command \fB\(ga\(ga\fR (two back quotes). This is often more convenient than \fBG\fR because it requires no advance preparation. Try giving a \fBG\fR or a search with \fB/\fR or \fB?\fR and then a \fB\(ga\(ga\fR to get back to where you were. If you accidentally hit \fBn\fR or any command which moves you far away from a context of interest, you can quickly get back by hitting \fB\(ga\(ga\fR. .NH 2 Moving around on the screen .PP Now try just moving the cursor around on the screen. If your terminal has arrow keys (4 or 5 keys with arrows going in each direction) try them and convince yourself that they work. If you don't have working arrow keys, you can always use .B h , .B j , .B k , and .B l . Experienced users of .I vi prefer these keys to arrow keys, because they are usually right underneath their fingers. .PP Hit the \fB+\fR key. Each time you do, notice that the cursor advances to the next line in the file, at the first non-white position on the line. The \fB\-\fR key is like \fB+\fR but goes the other way. .PP These are very common keys for moving up and down lines in the file. Notice that if you go off the bottom or top with these keys then the screen will scroll down (and up if possible) to bring a line at a time into view. The \s-2RETURN\s0 key has the same effect as the \fB+\fR key. .PP .I Vi also has commands to take you to the top, middle and bottom of the screen. \fBH\fR will take you to the top (home) line on the screen. Try preceding it with a number as in \fB3H\fR. This will take you to the third line on the screen. Many .I vi commands take preceding numbers and do interesting things with them. Try \fBM\fR, which takes you to the middle line on the screen, and \fBL\fR, which takes you to the last line on the screen. \fBL\fR also takes counts, thus \fB5L\fR will take you to the fifth line from the bottom. .NH 2 Moving within a line .PP Now try picking a word on some line on the screen, not the first word on the line. move the cursor using \s-2RETURN\s0 and \fB\-\fR to be on the line where the word is. Try hitting the \fBw\fR key. This will advance the cursor to the next word on the line. Try hitting the \fBb\fR key to back up words in the line. Also try the \fBe\fR key which advances you to the end of the current word rather than to the beginning of the next word. Also try \s-2SPACE\s0 (the space bar) which moves right one character and the \s-2BS\s0 (backspace or \fB^H\fR) key which moves left one character. The key \fBh\fR works as \fB^H\fR does and is useful if you don't have a \s-2BS\s0 key. (Also, as noted just above, \fBl\fR will move to the right.) .PP If the line had punctuation in it you may have noticed that that the \fBw\fR and \fBb\fR keys stopped at each group of punctuation. You can also go back and forwards words without stopping at punctuation by using \fBW\fR and \fBB\fR rather than the lower case equivalents. Think of these as bigger words. Try these on a few lines with punctuation to see how they differ from the lower case \fBw\fR and \fBb\fR. .PP The word keys wrap around the end of line, rather than stopping at the end. Try moving to a word on a line below where you are by repeatedly hitting \fBw\fR. .NH 2 Summary .IP .TS lw(.50i)b a. \fR\s-2SPACE\s0\fP advance the cursor one position ^B backwards to previous page ^D scrolls down in the file ^E exposes another line at the bottom ^F forward to next page ^G tell what is going on ^H backspace the cursor ^N next line, same column ^P previous line, same column ^U scrolls up in the file ^Y exposes another line at the top + next line, at the beginning \- previous line, at the beginning / scan for a following string forwards ? scan backwards B back a word, ignoring punctuation G go to specified line, last default H home screen line M middle screen line L last screen line W forward a word, ignoring punctuation b back a word e end of current word n scan for next instance of \fB/\fR or \fB?\fR pattern w word after this word .TE .NH 2 View .PP If you want to use the editor to look at a file, rather than to make changes, invoke it as .I view instead of .I vi . This will set the .I readonly option which will prevent you from accidently overwriting the file. .sp .NH 1 Making simple changes .NH 2 Inserting .PP One of the most useful commands is the \fBi\fR (insert) command. After you type \fBi\fR, everything you type until you hit \s-2ESC\s0 is inserted into the file. Try this now; position yourself to some word in the file and try inserting text before this word. If you are on an dumb terminal it will seem, for a minute, that some of the characters in your line have been overwritten, but they will reappear when you hit \s-2ESC\s0. .PP Now try finding a word which can, but does not, end in an `s'. Position yourself at this word and type \fBe\fR (move to end of word), then \fBa\fR for append and then `s\s-2ESC\s0' to terminate the textual insert. This sequence of commands can be used to easily pluralize a word. .PP Try inserting and appending a few times to make sure you understand how this works; \fBi\fR placing text to the left of the cursor, \fBa\fR to the right. .PP It is often the case that you want to add new lines to the file you are editing, before or after some specific line in the file. Find a line where this makes sense and then give the command \fBo\fR to create a new line after the line you are on, or the command \fBO\fR to create a new line before the line you are on. After you create a new line in this way, text you type up to an \s-2ESC\s0 is inserted on the new line. .PP Many related editor commands are invoked by the same letter key and differ only in that one is given by a lower case key and the other is given by an upper case key. In these cases, the upper case key often differs from the lower case key in its sense of direction, with the upper case key working backward and/or up, while the lower case key moves forward and/or down. .PP Whenever you are typing in text, you can give many lines of input or just a few characters. To type in more than one line of text, hit a \s-2RETURN\s0 at the middle of your input. A new line will be created for text, and you can continue to type. If you are on a slow and dumb terminal the editor may choose to wait to redraw the tail of the screen, and will let you type over the existing screen lines. This avoids the lengthy delay which would occur if the editor attempted to keep the tail of the screen always up to date. The tail of the screen will be fixed up, and the missing lines will reappear, when you hit \s-2ESC\s0. .PP While you are inserting new text, you can use the characters you normally use at the system command level (usually \fB^H\fR or \fB#\fR) to backspace over the last character which you typed, and the character which you use to kill input lines (usually \fB@\fR, \fB^X\fR, or \fB^U\fR) to erase the input you have typed on the current line.\*(dg .FS \*(dg In fact, the character \fB^H\fR (backspace) always works to erase the last input character here, regardless of what your erase character is. .FE The character \fB^W\fR will erase a whole word and leave you after the space after the previous word; it is useful for quickly backing up in an insert. .PP Notice that when you backspace during an insertion the characters you backspace over are not erased; the cursor moves backwards, and the characters remain on the display. This is often useful if you are planning to type in something similar. In any case the characters disappear when when you hit \s-2ESC\s0; if you want to get rid of them immediately, hit an \s-2ESC\s0 and then \fBa\fR again. .PP Notice also that you can't erase characters which you didn't insert, and that you can't backspace around the end of a line. If you need to back up to the previous line to make a correction, just hit \s-2ESC\s0 and move the cursor back to the previous line. After making the correction you can return to where you were and use the insert or append command again. .sp .5 .NH 2 Making small corrections .PP You can make small corrections in existing text quite easily. Find a single character which is wrong or just pick any character. Use the arrow keys to find the character, or get near the character with the word motion keys and then either backspace (hit the \s-2BS\s0 key or \fB^H\fR or even just \fBh\fR) or \s-2SPACE\s0 (using the space bar) until the cursor is on the character which is wrong. If the character is not needed then hit the \fBx\fP key; this deletes the character from the file. It is analogous to the way you \fBx\fP out characters when you make mistakes on a typewriter (except it's not as messy). .PP If the character is incorrect, you can replace it with the correct character by giving the command \fBr\fR\fIc\fR, where \fIc\fR is replaced by the correct character. Finally if the character which is incorrect should be replaced by more than one character, give the command \fBs\fR which substitutes a string of characters, ending with \s-2ESC\s0, for it. If there are a small number of characters which are wrong you can precede \fBs\fR with a count of the number of characters to be replaced. Counts are also useful with \fBx\fR to specify the number of characters to be deleted. .NH 2 More corrections: operators .PP You already know almost enough to make changes at a higher level. All you need to know now is that the .B d key acts as a delete operator. Try the command .B dw to delete a word. Try hitting \fB.\fR a few times. Notice that this repeats the effect of the \fBdw\fR. The command \fB.\fR repeats the last command which made a change. You can remember it by analogy with an ellipsis `\fB...\fR'. .PP Now try \fBdb\fR. This deletes a word backwards, namely the preceding word. Try \fBd\fR\s-2SPACE\s0. This deletes a single character, and is equivalent to the \fBx\fR command. .PP Another very useful operator is .B c or change. The command .B cw thus changes the text of a single word. You follow it by the replacement text ending with an \s-2ESC\s0. Find a word which you can change to another, and try this now. Notice that the end of the text to be changed was marked with the character `$' so that you can see this as you are typing in the new material. .sp .5 .NH 2 Operating on lines .PP It is often the case that you want to operate on lines. Find a line which you want to delete, and type \fBdd\fR, the .B d operator twice. This will delete the line. If you are on a dumb terminal, the editor may just erase the line on the screen, replacing it with a line with only an @ on it. This line does not correspond to any line in your file, but only acts as a place holder. It helps to avoid a lengthy redraw of the rest of the screen which would be necessary to close up the hole created by the deletion on a terminal without a delete line capability. .PP Try repeating the .B c operator twice; this will change a whole line, erasing its previous contents and replacing them with text you type up to an \s-2ESC\s0.\*(dg .FS \*(dg The command \fBS\fR is a convenient synonym for for \fBcc\fR, by analogy with \fBs\fR. Think of \fBS\fR as a substitute on lines, while \fBs\fR is a substitute on characters. .FE .PP You can delete or change more than one line by preceding the .B dd or .B cc with a count, i.e. \fB5dd\fR deletes 5 lines. You can also give a command like \fBdL\fR to delete all the lines up to and including the last line on the screen, or \fBd3L\fR to delete through the third from the bottom line. Try some commands like this now.* .FS * One subtle point here involves using the \fB/\fR search after a \fBd\fR. This will normally delete characters from the current position to the point of the match. If what is desired is to delete whole lines including the two points, give the pattern as \fB/pat/+0\fR, a line address. .FE Notice that the editor lets you know when you change a large number of lines so that you can see the extent of the change. The editor will also always tell you when a change you make affects text which you cannot see. .NH 2 Undoing .PP Now suppose that the last change which you made was incorrect; you could use the insert, delete and append commands to put the correct material back. However, since it is often the case that we regret a change or make a change incorrectly, the editor provides a .B u (undo) command to reverse the last change which you made. Try this a few times, and give it twice in a row to notice that a .B u also undoes a .B u . .PP The undo command lets you reverse only a single change. After you make a number of changes to a line, you may decide that you would rather have the original state of the line back. The .B U command restores the current line to the state before you started changing it. Additionally, an unlimited number of changes may be reversed by following a .B u with a .B . . Each subsequent .B . will undo one more change. .PP You can recover text which you delete, even if undo will not bring it back; see the section on recovering lost text below. .NH 2 Summary .IP .TS lw(.50i)b a. \fB\s-2SPACE\s0\fP advance the cursor one position ^H backspace the cursor \fBwerase\fP (usually ^W), erase a word during an insert \fBerase\fP (usually DEL or ^H), erases a character during an insert \fBkill\fP (usually ^U), kills the insert on this line \fB.\fP repeats the changing command O opens and inputs new lines, above the current U undoes the changes you made to the current line a appends text after the cursor c changes the object you specify to the following text d deletes the object you specify i inserts text before the cursor o opens and inputs new lines, below the current u undoes the last change .TE .NH 1 Moving about; rearranging and duplicating text .NH 2 Low level character motions .PP Now move the cursor to a line where there is a punctuation or a bracketing character such as a parenthesis or a comma or period. Try the command \fBf\fR\fIx\fR, where \fIx\fR is this character. This command finds the next \fIx\fR character to the right of the cursor in the current line. Try then hitting a \fB;\fR, which finds the next instance of the same character. By using the \fBf\fR command and then a sequence of \fB;\fR's you can often get to a particular place in a line much faster than with a sequence of word motions or \s-2SPACE\s0s. There is also an \fBF\fR command, which is like \fBf\fR, but searches backward. The \fB;\fR command repeats \fBF\fR also. .PP When you are operating on the text in a line it is often desirable to deal with the characters up to, but not including, the first instance of a character. Try \fBdf\fR\fIx\fR for some \fIx\fR now and notice that the text up to (and including) the \fIx\fR character is deleted. Undo this with \fBu\fR and then try \fBdt\fR\fIx\fR; the \fBt\fR here stands for to, i.e. delete up to the next \fIx\fR, but not the \fIx\fR. The command \fBT\fR is the reverse of \fBt\fR. .PP When working with the text of a single line, a \fB^\fR moves the cursor to the first non-white position on the line, and a \fB$\fR moves it to the end of the line. Thus \fB$a\fR will append new text at the end of the current line. .PP Your file may have tab (\fB^I\fR) characters in it. These characters are represented as a number of spaces expanding to a tab stop, where tab stops are every 8 positions.* .FS * This is settable by a command of the form \fB:se ts=\fR\fIx\fR\s-2CR\s0, where \fIx\fR is 4 to set tabstops every four columns. This has an effect on the screen representation within the editor. .FE When the cursor is at a tab, it sits on the last of the several spaces which represent that tab. Try moving the cursor back and forth over tabs so you understand how this works. .PP On rare occasions, your file may have nonprinting characters in it. These characters are displayed in the same way they are represented in this document, that is with a two character code, the first character of which is `^'. On the screen non-printing characters resemble a `^' character adjacent to another, but spacing or backspacing over the character will reveal that the two characters are, like the spaces representing a tab character, a single character. .PP The editor sometimes discards control characters, depending on the character and the setting of the .I beautify option, if you attempt to insert them in your file. You can get a control character in the file by beginning an insert and then typing a \fB^V\fR before the control character. The \fB^V\fR quotes the following character, causing it to be inserted directly into the file. .PP .NH 2 Higher level text objects .PP In working with a document it is often advantageous to work in terms of sentences, paragraphs, and sections. The operations \fB(\fR and \fB)\fR move to the beginning of the previous and next sentences respectively. Thus the command \fBd)\fR will delete the rest of the current sentence; likewise \fBd(\fR will delete the previous sentence if you are at the beginning of the current sentence, or the current sentence up to where you are if you are not at the beginning of the current sentence. .PP A sentence is defined to end at a `.', `!' or `?' which is followed by either the end of a line, or by two spaces. Any number of closing `)', `]', `"' and `\(aa' characters may appear after the `.', `!' or `?' before the spaces or end of line. .PP The operations \fB{\fR and \fB}\fR move over paragraphs and the operations \fB[[\fR and \fB]]\fR move over sections.\*(dg .FS \*(dg The \fB[[\fR and \fB]]\fR operations require the operation character to be doubled because they can move the cursor far from where it currently is. While it is easy to get back with the command \fB\(ga\(ga\fP, these commands would still be frustrating if they were easy to hit accidentally. .FE .PP A paragraph begins after each empty line, and also at each of a set of paragraph macros, specified by the pairs of characters in the definition of the string valued option \fIparagraphs\fR. The default setting for this option defines the paragraph macros of the \fI\-ms\fR and \fI\-mm\fR macro packages, i.e. the `.IP', `.LP', `.PP' and `.QP', `.P' and `.LI' macros.\*(dd .FS \*(dd You can easily change or extend this set of macros by assigning a different string to the \fIparagraphs\fR option in your EXINIT. See section 6.2 for details. The `.bp' directive is also considered to start a paragraph. .FE Each paragraph boundary is also a sentence boundary. The sentence and paragraph commands can be given counts to operate over groups of sentences and paragraphs. .PP Sections in the editor begin after each macro in the \fIsections\fR option, normally `.NH', `.SH', `.H' and `.HU', and each line with a formfeed \fB^L\fR in the first column. Section boundaries are always line and paragraph boundaries also. .PP Try experimenting with the sentence and paragraph commands until you are sure how they work. If you have a large document, try looking through it using the section commands. The section commands interpret a preceding count as a different window size in which to redraw the screen at the new location, and this window size is the base size for newly drawn windows until another size is specified. This is very useful if you are on a slow terminal and are looking for a particular section. You can give the first section command a small count to then see each successive section heading in a small window. .NH 2 Rearranging and duplicating text .PP The editor has a single unnamed buffer where the last deleted or changed away text is saved, and a set of named buffers \fBa\fR\-\fBz\fR which you can use to save copies of text and to move text around in your file and between files. .PP The operator .B y yanks a copy of the object which follows into the unnamed buffer. If preceded by a buffer name, \fB"\fR\fIx\fR\|\fBy\fR, where \fIx\fR here is replaced by a letter \fBa\-z\fR, it places the text in the named buffer. The text can then be put back in the file with the commands .B p and .B P ; \fBp\fR puts the text after or below the cursor, while \fBP\fR puts the text before or above the cursor. .PP If the text which you yank forms a part of a line, or is an object such as a sentence which partially spans more than one line, then when you put the text back, it will be placed after the cursor (or before if you use \fBP\fR). If the yanked text forms whole lines, they will be put back as whole lines, without changing the current line. In this case, the put acts much like an \fBo\fR or \fBO\fR command. .PP Try the command \fBYP\fR. This makes a copy of the current line and leaves you on this copy, which is placed before the current line. The command \fBY\fR is a convenient abbreviation for \fByy\fR. The command \fBYp\fR will also make a copy of the current line, and place it after the current line. You can give \fBY\fR a count of lines to yank, and thus duplicate several lines; try \fB3YP\fR. .PP To move text within the buffer, you need to delete it in one place, and put it back in another. You can precede a delete operation by the name of a buffer in which the text is to be stored as in \fB"a5dd\fR deleting 5 lines into the named buffer \fIa\fR. You can then move the cursor to the eventual resting place of these lines and do a \fB"ap\fR or \fB"aP\fR to put them back. In fact, you can switch and edit another file before you put the lines back, by giving a command of the form \fB:e \fR\fIname\fR\s-2CR\s0 where \fIname\fR is the name of the other file you want to edit. You will have to write back the contents of the current editor buffer (or discard them) if you have made changes before the editor will let you switch to the other file. An ordinary delete command saves the text in the unnamed buffer, so that an ordinary put can move it elsewhere. However, the unnamed buffer is lost when you change files, so to move text from one file to another you should use a named buffer. .NH 2 Summary. .IP .TS lw(.50i)b a. ^ first non-white on line $ end of line ) forward sentence } forward paragraph ]] forward section ( backward sentence { backward paragraph [[ backward section f\fIx\fR find \fIx\fR forward in line p put text back, after cursor or below current line y yank operator, for copies and moves t\fIx\fR up to \fIx\fR forward, for operators F\fIx\fR f backward in line P put text back, before cursor or above current line T\fIx\fR t backward in line .TE .ne 1i .NH 1 High level commands .NH 2 Writing, quitting, editing new files .PP So far we have seen how to enter .I vi and to write out our file using either \fBZZ\fR or \fB:w\fR\s-2CR\s0. The first exits from the editor, (writing if changes were made), the second writes and stays in the editor. .PP If you have changed the editor's copy of the file but do not wish to save your changes, either because you messed up the file or decided that the changes are not an improvement to the file, then you can give the command \fB:q!\fR\s-2CR\s0 to quit from the editor without writing the changes. You can also reedit the same file (starting over) by giving the command \fB:e!\fR\s-2CR\s0. These commands should be used only rarely, and with caution, as it is not possible to recover the changes you have made after you discard them in this manner. .PP You can edit a different file without leaving the editor by giving the command \fB:e\fR\ \fIname\fR\s-2CR\s0. If you have not written out your file before you try to do this, then the editor will tell you this, and delay editing the other file. You can then give the command \fB:w\fR\s-2CR\s0 to save your work and then the \fB:e\fR\ \fIname\fR\s-2CR\s0 command again, or carefully give the command \fB:e!\fR\ \fIname\fR\s-2CR\s0, which edits the other file discarding the changes you have made to the current file. To have the editor automatically save changes, include .I "set autowrite" in your EXINIT, and use \fB:n\fP instead of \fB:e\fP. .NH 2 Escaping to a shell .PP You can get to a shell to execute a single command by giving a .I vi command of the form \fB:!\fIcmd\fR\s-2CR\s0. The system will run the single command .I cmd and when the command finishes, the editor will ask you to hit a \s-2RETURN\s0 to continue. When you have finished looking at the output on the screen, you should hit \s-2RETURN\s0 and the editor will clear the screen and redraw it. You can then continue editing. You can also give another \fB:\fR command when it asks you for a \s-2RETURN\s0; in this case the screen will not be redrawn. .PP If you wish to execute more than one command in the shell, then you can give the command \fB:sh\fR\s-2CR\s0. This will give you a new shell, and when you finish with the shell, ending it by typing a \fB^D\fR, the editor will clear the screen and continue. .PP On systems which support it, \fB^Z\fP will suspend the editor and return to the (top level) shell. When the editor is resumed, the screen will be redrawn. .NH 2 Marking and returning .PP The command \fB\(ga\(ga\fR returned to the previous place after a motion of the cursor by a command such as \fB/\fR, \fB?\fR or \fBG\fR. You can also mark lines in the file with single letter tags and return to these marks later by naming the tags. Try marking the current line with the command \fBm\fR\fIx\fR, where you should pick some letter for \fIx\fR, say `a'. Then move the cursor to a different line (any way you like) and hit \fB\(gaa\fR. The cursor will return to the place which you marked. Marks last only until you edit another file. .PP When using operators such as .B d and referring to marked lines, it is often desirable to delete whole lines rather than deleting to the exact position in the line marked by \fBm\fR. In this case you can use the form \fB\(aa\fR\fIx\fR rather than \fB\(ga\fR\fIx\fR. Used without an operator, \fB\(aa\fR\fIx\fR will move to the first non-white character of the marked line; similarly \fB\(aa\(aa\fR moves to the first non-white character of the line containing the previous context mark \fB\(ga\(ga\fR. .NH 2 Adjusting the screen .PP If the screen image is messed up because of a transmission error to your terminal, or because some program other than the editor wrote output to your terminal, you can hit a \fB^L\fR, the \s-2ASCII\s0 form-feed character, to cause the screen to be refreshed. .PP On a dumb terminal, if there are @ lines in the middle of the screen as a result of line deletion, you may get rid of these lines by typing \fB^R\fR to cause the editor to retype the screen, closing up these holes. .PP Finally, if you wish to place a certain line on the screen at the top, middle, or bottom of the screen, you can position the cursor to that line, and then give a \fBz\fR command. You should follow the \fBz\fR command with a \s-2RETURN\s0 if you want the line to appear at the top of the window, a \fB.\fR if you want it at the center, or a \fB\-\fR if you want it at the bottom. .NH 1 Special topics .NH 2 Editing on slow terminals .PP When you are on a slow terminal, it is important to limit the amount of output which is generated to your screen so that you will not suffer long delays, waiting for the screen to be refreshed. We have already pointed out how the editor optimizes the updating of the screen during insertions on dumb terminals to limit the delays, and how the editor erases lines to @ when they are deleted on dumb terminals. .\" .PP .\" The use of the slow terminal insertion mode is controlled by the .\" .I slowopen .\" option. You can force the editor to use this mode even on faster terminals .\" by giving the command \fB:se slow\fR\s-2CR\s0. If your system is sluggish, .\" this helps lessen the amount of output coming to your terminal. .\" You can disable this option by \fB:se noslow\fR\s-2CR\s0. .\" .PP .\" The editor can simulate an intelligent terminal on a dumb one. Try .\" giving the command \fB:se redraw\fR\s-2CR\s0. This simulation generates .\" a great deal of output and is generally tolerable only on lightly loaded .\" systems and fast terminals. You can disable this by giving the command .\" \fB:se noredraw\fR\s-2CR\s0. .PP The editor also makes editing more pleasant at low speed by starting editing in a small window, and letting the window expand as you edit. This works particularly well on intelligent terminals. The editor can expand the window easily when you insert in the middle of the screen on these terminals. If possible, try the editor on an intelligent terminal to see how this works. .PP You can control the size of the window which is redrawn each time the screen is cleared by giving window sizes as argument to the commands which cause large screen motions: .DS .B ": / ? [[ ]] \(ga \(aa" .DE Thus if you are searching for a particular instance of a common string in a file, you can precede the first search command by a small number, say 3, and the editor will draw three line windows around each instance of the string which it locates. .PP You can easily expand or contract the window, placing the current line as you choose, by giving a number on a \fBz\fR command, after the \fBz\fR and before the following \s-2RETURN\s0, \fB.\fR or \fB\-\fR. Thus the command \fBz5.\fR redraws the screen with the current line in the center of a five line window.\*(dg .FS \*(dg Note that the command \fB5z.\fR has an entirely different effect, placing line 5 in the center of a new window. .FE .PP If the editor is redrawing or otherwise updating large portions of the display, you can interrupt this updating by hitting a \s-2DEL\s0 or \s-2RUB\s0 as usual. If you do this you may partially confuse the editor about what is displayed on the screen. You can still edit the text on the screen if you wish; clear up the confusion by hitting a \fB^L\fR; or move or search again, ignoring the current state of the display. .\" .PP .\" See section 7.8 on \fIopen\fR mode for another way to use the .\" .I vi .\" command set on slow terminals. .NH 2 Options, set, and editor startup files .PP The editor has a set of options, some of which have been mentioned above. The most useful options are given in the following table. .PP The options are of three kinds: numeric options, string options, and toggle options. You can set numeric and string options by a statement of the form .DS \fBset\fR \fIopt\fR\fB=\fR\fIval\fR .DE and toggle options can be set or unset by statements of one of the forms .DS \fBset\fR \fIopt\fR \fBset\fR \fBno\fR\fIopt\fR .DE .KF .TS lb lb lb lb l l l a. Name Default Description _ autoindent noai Supply indentation automatically autowrite noaw Auto write before \fB:n\fR, \fB:ta\fR, \fB^^\fR, \fB!\fR ignorecase noic Ignore case in searching list nolist Tabs print as ^I; end of lines $ magic magic . [ and * are special in scans number nonu Lines prefixed with line numbers paragraphs para=IPLPPPQPP LIpplpipbp Macros which start paragraphs ruler noruler Display a row/column ruler. sections sect=NHSHH HUnhsh Macros which start new sections shiftwidth sw=8 Shift distance for <, >, \fB^D\fP and \fB^T\fR showmatch nosm Show matching \fB(\fP or \fB{\fP term $TERM The kind of terminal being used .TE .KE These statements can be placed in your EXINIT in your environment, or given while you are running .I vi by preceding them with a \fB:\fR and following them with a \s-2CR\s0. .PP You can get a list of all options which you have changed by the command \fB:set\fR\s-2CR\s0, or the value of a single option by the command \fB:set\fR \fIopt\fR\fB?\fR\s-2CR\s0. A list of all possible options and their values is generated by \fB:set all\fP\s-2CR\s0. Set can be abbreviated \fBse\fP. Multiple options can be placed on one line, e.g. \fB:se ai aw nu\fP\s-2CR\s0. .PP Options set by the \fBset\fP command only last while you stay in the editor. It is common to want to have certain options set whenever you use the editor. This can be accomplished by creating a list of \fIex\fP commands\*(dg .FS \*(dg All commands which start with .B : are \fIex\fP commands. .FE which are to be run every time you start up \fIex\fP or \fIvi\fP. A typical list includes a \fBset\fP command, and possibly a few \fBmap\fP commands. Since it is advisable to get these commands on one line, they can be separated with the | character, for example: .DS \fBset\fP ai aw terse|\fBmap\fP @ dd|\fBmap\fP # x .DE which sets the options \fIautoindent\fP, \fIautowrite\fP, \fIterse\fP (the .B set command), makes @ delete a line (the first .B map ), and makes # delete a character (the second .B map ). (See section 6.9 for a description of the \fBmap\fP command.) This string should be placed in the variable EXINIT in your environment. If you use the shell \fIcsh\fP, put this line in the file .I .login in your home directory: .DS I setenv EXINIT 'set ai aw terse|map @ dd|map # x' .DE If you use the standard shell \fIsh\fP, put these lines in the file .I .profile in your home directory: .DS export EXINIT='set ai aw terse|map @ dd|map # x' .DE Of course, the particulars of the line would depend on which options you wanted to set. .NH 2 Recovering lost lines .PP You might have a serious problem if you delete a number of lines and then regret that they were deleted. Despair not, the editor saves the last 9 deleted blocks of text in a set of numbered registers 1\-9. You can get the \fIn\fR'th previous deleted text back in your file by the command "\fR\fIn\fR\|\fBp\fR. The "\fR here says that a buffer name is to follow, \fIn\fR is the number of the buffer you wish to try (use the number 1 for now), and .B p is the put command, which puts text in the buffer after the cursor. If this doesn't bring back the text you wanted, hit .B u to undo this and then \fB\&.\fR (period) to repeat the put command. In general the \fB\&.\fR command will repeat the last change you made. As a special case, when the last command refers to a numbered text buffer, the \fB.\fR command increments the number of the buffer before repeating the command. Thus a sequence of the form .DS \fB"1pu.u.u.\fR .DE will, if repeated long enough, show you all the deleted text which has been saved for you. You can omit the .B u commands here to gather up all this text in the buffer, or stop after any \fB\&.\fR command to keep just the then recovered text. The command .B P can also be used rather than .B p to put the recovered text before rather than after the cursor. .NH 2 Recovering lost files .PP If the system crashes, you can recover the work you were doing to within a few changes. You will normally receive mail when you next login giving you the name of the file which has been saved for you. You should then change to the directory where you were when the system crashed and give a command of the form: .DS % vi -r name .DE replacing \fIname\fR with the name of the file which you were editing. This will recover your work to a point near where you left off.\*(dg .FS \*(dg In rare cases, some of the lines of the file may be lost. The editor will give you the numbers of these lines and the text of the lines will be replaced by the string `LOST'. These lines will almost always be among the last few which you changed. You can either choose to discard the changes which you made (if they are easy to remake) or to replace the few lost lines by hand. .FE .PP You can get a listing of the files which are saved for you by giving the command: .DS I % vi -r .DE If there is more than one instance of a particular file saved, the editor gives you the newest instance each time you recover it. You can thus get an older saved copy back by first recovering the newer copies. .PP For this feature to work, .I vi must be correctly installed by a super user on your system, and the .I mail program must exist to receive mail. The invocation ``\fIvi -r\fP'' will not always list all saved files, but they can be recovered even if they are not listed. .NH 2 Continuous text input .PP When you are typing in large amounts of text it is convenient to have lines broken near the right margin automatically. You can cause this to happen by giving the command \fB:se wm=10\fR\s-2CR\s0. This causes all lines to be broken at a space at least 10 columns from the right hand edge of the screen. .PP If the editor breaks an input line and you wish to put it back together you can tell it to join the lines with \fBJ\fR. You can give \fBJ\fR a count of the number of lines to be joined as in \fB3J\fR to join 3 lines. The editor supplies whitespace, if appropriate, at the juncture of the joined lines, and leaves the cursor at this whitespace. You can kill the whitespace with \fBx\fR if you don't want it. .NH 2 Features for editing programs .PP The editor has a number of commands for editing programs. The thing that most distinguishes editing of programs from editing of text is the desirability of maintaining an indented structure to the body of the program. The editor has an .I autoindent facility for helping you generate correctly indented programs. .PP To enable this facility you can give the command \fB:se ai\fR\s-2CR\s0. Now try opening a new line with \fBo\fR and type some characters on the line after a few tabs. If you now start another line, notice that the editor supplies whitespace at the beginning of the line to line it up with the previous line. You cannot backspace over this indentation, but you can use \fB^D\fR key to backtab over the supplied indentation. .PP Each time you type \fB^D\fR you back up one position, normally to an 8 column boundary. This amount is settable; the editor has an option called .I shiftwidth which you can set to change this value. Try giving the command \fB:se sw=4\fR\s-2CR\s0 and then experimenting with autoindent again. .PP For shifting lines in the program left and right, there are operators .B < and .B >. These shift the lines you specify right or left by one .I shiftwidth . Try .B << and .B >> which shift one line left or right, and .B <L and .B >L shifting the rest of the display left and right. .PP If you have a complicated expression and wish to see how the parentheses match, put the cursor at a left or right parenthesis and hit \fB%\fR. This will show you the matching parenthesis. This works also for braces { and }, and brackets [ and ]. .PP If you are editing C programs, you can use the \fB[[\fR and \fB]]\fR keys to advance or retreat to a line starting with a \fB{\fR, i.e. a function declaration at a time. When \fB]]\fR is used with an operator it stops after a line which starts with \fB}\fR; this is sometimes useful with \fBy]]\fR. .NH 2 Filtering portions of the buffer .PP You can run system commands over portions of the buffer using the operator \fB!\fR. You can use this to sort lines in the buffer, or to reformat portions of the buffer with a pretty-printer. Try typing in a list of random words, one per line, and ending them with a blank line. Back up to the beginning of the list, and then give the command \fB!}sort\fR\s-2CR\s0. This says to sort the next paragraph of material, and the blank line ends a paragraph. .\" .NH 2 .\" Commands for editing \s-2LISP\s0 .\" .PP .\" If you are editing a \s-2LISP\s0 program you should set the option .\" .I lisp .\" by doing .\" \fB:se\ lisp\fR\s-2CR\s0. .\" This changes the \fB(\fR and \fB)\fR commands to move backward and forward .\" over s-expressions. .\" The \fB{\fR and \fB}\fR commands are like \fB(\fR and \fB)\fR but don't .\" stop at atoms. These can be used to skip to the next list, or through .\" a comment quickly. .\" .PP .\" The .\" .I autoindent .\" option works differently for \s-2LISP\s0, supplying indent to align at .\" the first argument to the last open list. If there is no such argument .\" then the indent is two spaces more than the last level. .\" .PP .\" There is another option which is useful for typing in \s-2LISP\s0, the .\" .I showmatch .\" option. .\" Try setting it with .\" \fB:se sm\fR\s-2CR\s0 .\" and then try typing a `(' some words and then a `)'. Notice that the .\" cursor shows the position of the `(' which matches the `)' briefly. .\" This happens only if the matching `(' is on the screen, and the cursor .\" stays there for at most one second. .\" .PP .\" The editor also has an operator to realign existing lines as though they .\" had been typed in with .\" .I lisp .\" and .\" .I autoindent .\" set. This is the \fB=\fR operator. .\" Try the command \fB=%\fR at the beginning of a function. This will realign .\" all the lines of the function declaration. .\" .PP .\" When you are editing \s-2LISP\s0,, the \fB[[\fR and \fR]]\fR advance .\" and retreat to lines beginning with a \fB(\fR, and are useful for dealing .\" with entire function definitions. .NH 2 Macros .PP .I Vi has a parameterless macro facility, which lets you set it up so that when you hit a single keystroke, the editor will act as though you had hit some longer sequence of keys. You can set this up if you find yourself typing the same sequence of commands repeatedly. .PP Briefly, there are two flavors of macros: .IP a) Ones where you put the macro body in a buffer register, say \fIx\fR. You can then type \fB@x\fR to invoke the macro. The \fB@\fR may be followed by another \fB@\fR to repeat the last macro. .IP b) You can use the .I map command from .I vi (typically in your .I EXINIT ) with a command of the form: .DS :map \fIlhs\fR \fIrhs\fR\s-2CR .DE mapping .I lhs into .I rhs. There are restrictions: .I lhs should be one keystroke (either 1 character or one function key) since it must be entered within one second (unless .I notimeout is set, in which case you can type it as slowly as you wish, and .I vi will wait for you to finish it before it echoes anything). The .I lhs can be no longer than 10 characters, the .I rhs no longer than 100. To get a space, tab or newline into .I lhs or .I rhs you should escape them with a \fB^V\fR. (It may be necessary to double the \fB^V\fR if the map command is given inside .I vi , rather than in .I ex .) Spaces and tabs inside the .I rhs need not be escaped. .PP Thus to make the \fBq\fR key write and exit the editor, you can give the command .DS I :map q :wq\fB^V^V\fP\s-2CR CR\s0 .DE which means that whenever you type \fBq\fR, it will be as though you had typed the four characters \fB:wq\fR\s-2CR\s0. A \fB^V\fR's is needed because without it the \s-2CR\s0 would end the \fB:\fR command, rather than becoming part of the .I map definition. There are two .B ^V 's because from within .I vi , two .B ^V 's must be typed to get one. The first \s-2CR\s0 is part of the .I rhs , the second terminates the : command. .PP Macros can be deleted with .DS I unmap lhs .DE .PP If the .I lhs of a macro is ``#0'' through ``#9'', this maps the particular function key instead of the 2 character ``#'' sequence. So that terminals without function keys can access such definitions, the form ``#x'' will mean function key .I x on all terminals (and need not be typed within one second). The character ``#'' can be changed by using a macro in the usual way: .DS :map \fB^V^V^I\fP # .DE to use tab, for example. (This won't affect the .I map command, which still uses .B #, but just the invocation from visual mode.) .PP The .I undo command reverses an entire macro call as a unit, if it made any changes. .PP Placing a `!' after the word .B map causes the mapping to apply to input mode, rather than command mode. Thus, to arrange for \fB^T\fP to be the same as 4 spaces in input mode, you can type: .DS :map \fB^T\fP \fB^V\fP\o'b/'\o'b/'\o'b/'\o'b/' .DE where .B \o'b/' is a blank. The \fB^V\fP is necessary to prevent the blanks from being taken as whitespace between the .I lhs and .I rhs . .NH Word Abbreviations .PP A feature similar to macros in input mode is word abbreviation. This allows you to type a short word and have it expanded into a longer word or words. The commands are .B :abbreviate and .B :unabbreviate (\fB:ab\fP and .B :una ) and have the same syntax as .B :map . For example: .DS :ab eecs Electrical Engineering and Computer Sciences .DE causes the word `eecs' to always be changed into the phrase `Electrical Engineering and Computer Sciences'. Word abbreviation is different from macros in that only whole words are affected. If `eecs' were typed as part of a larger word, it would be left alone. Also, the partial word is echoed as it is typed. There is no need for an abbreviation to be a single keystroke, as it should be with a macro. .NH 2 Abbreviations .PP The editor has a number of short commands which abbreviate longer commands which we have introduced here. You can find these commands easily on the quick reference card. They often save a bit of typing and you can learn them as convenient. .NH 1 Nitty-gritty details .NH 2 Line representation in the display .PP The editor folds long logical lines onto many physical lines in the display. Commands which advance lines advance logical lines and will skip over all the segments of a line in one motion. The command \fB|\fR moves the cursor to a specific column, and may be useful for getting near the middle of a long line to split it in half. Try \fB80|\fR on a line which is more than 80 columns long.\*(dg .FS \*(dg You can make long lines very easily by using \fBJ\fR to join together short lines. .FE .PP The editor only puts full lines on the display; if there is not enough room on the display to fit a logical line, the editor leaves the physical line empty, placing only an @ on the line as a place holder. When you delete lines on a dumb terminal, the editor will often just clear the lines to @ to save time (rather than rewriting the rest of the screen.) You can always maximize the information on the screen by giving the \fB^R\fR command. .PP If you wish, you can have the editor place line numbers before each line on the display. Give the command \fB:se nu\fR\s-2CR\s0 to enable this, and the command \fB:se nonu\fR\s-2CR\s0 to turn it off. You can have tabs represented as \fB^I\fR and the ends of lines indicated with `$' by giving the command \fB:se list\fR\s-2CR\s0; \fB:se nolist\fR\s-2CR\s0 turns this off. .PP Finally, lines consisting of only the character `~' are displayed when the last line in the file is in the middle of the screen. These represent physical lines which are past the logical end of file. .NH 2 Counts .PP Most .I vi commands will use a preceding count to affect their behavior in some way. The following table gives the common ways in which the counts are used: .DS .TS l lb. new window size : / ? [[ ]] \` \' scroll amount ^D ^U line/column number z G | repeat effect \fRmost of the rest\fP .TE .DE .PP The editor maintains a notion of the current default window size. On terminals which run at speeds greater than 1200 baud the editor uses the full terminal screen. On terminals which are slower than 1200 baud (most dialup lines are in this group) the editor uses 8 lines as the default window size. At 1200 baud the default is 16 lines. .PP This size is the size used when the editor clears and refills the screen after a search or other motion moves far from the edge of the current window. The commands which take a new window size as count all often cause the screen to be redrawn. If you anticipate this, but do not need as large a window as you are currently using, you may wish to change the screen size by specifying the new size before these commands. In any case, the number of lines used on the screen will expand if you move off the top with a \fB\-\fR or similar command or off the bottom with a command such as \s-2RETURN\s0 or \fB^D\fR. The window will revert to the last specified size the next time it is cleared and refilled.\*(dg .FS \*(dg But not by a \fB^L\fR which just redraws the screen as it is. .FE .PP The scroll commands \fB^D\fR and \fB^U\fR likewise remember the amount of scroll last specified, using half the basic window size initially. The simple insert commands use a count to specify a repetition of the inserted text. Thus \fB10a+\-\-\-\-\fR\s-2ESC\s0 will insert a grid-like string of text. A few commands also use a preceding count as a line or column number. .PP Except for a few commands which ignore any counts (such as \fB^R\fR), the rest of the editor commands use a count to indicate a simple repetition of their effect. Thus \fB5w\fR advances five words on the current line, while \fB5\fR\s-2RETURN\s0 advances five lines. A very useful instance of a count as a repetition is a count given to the \fB.\fR command, which repeats the last changing command. If you do \fBdw\fR and then \fB3.\fR, you will delete first one and then three words. You can then delete two more words with \fB2.\fR. .NH 2 More file manipulation commands .PP The following table lists the file manipulation commands which you can use when you are in .I vi . .KF .DS .TS lb l. :w write back changes :wq write and quit :x write (if necessary) and quit (same as ZZ) :e \fIname\fP edit file \fIname\fR :e! reedit, discarding changes :e + \fIname\fP edit, starting at end :e +\fIn\fP edit, starting at line \fIn\fP :e # edit alternate file :w \fIname\fP write file \fIname\fP :w! \fIname\fP overwrite file \fIname\fP :\fIx,y\fPw \fIname\fP write lines \fIx\fP through \fIy\fP to \fIname\fP :r \fIname\fP read file \fIname\fP into buffer :r !\fIcmd\fP read output of \fIcmd\fP into buffer :n edit next file in argument list :n! edit next file, discarding changes to current :n \fIargs\fP specify new argument list :ta \fItag\fP edit file containing tag \fItag\fP, at \fItag\fP .TE .DE .KE All of these commands are followed by a \s-2CR\s0 or \s-2ESC\s0. The most basic commands are \fB:w\fR and \fB:e\fR. A normal editing session on a single file will end with a \fBZZ\fR command. If you are editing for a long period of time you can give \fB:w\fR commands occasionally after major amounts of editing, and then finish with a \fBZZ\fR. When you edit more than one file, you can finish with one with a \fB:w\fR and start editing a new file by giving a \fB:e\fR command, or set .I autowrite and use \fB:n\fP <file>. .PP If you make changes to the editor's copy of a file, but do not wish to write them back, then you must give an \fB!\fR after the command you would otherwise use; this forces the editor to discard any changes you have made. Use this carefully. .ne 1i .PP The \fB:e\fR command can be given a \fB+\fR argument to start at the end of the file, or a \fB+\fR\fIn\fR argument to start at line \fIn\fR\^. In actuality, \fIn\fR may be any editor command not containing a space, usefully a scan like \fB+/\fIpat\fR or \fB+?\fIpat\fR. In forming new names to the \fBe\fR command, you can use the character \fB%\fR which is replaced by the current file name, or the character \fB#\fR which is replaced by the alternate file name. The alternate file name is generally the last name you typed other than the current file. Thus if you try to do a \fB:e\fR and get a diagnostic that you haven't written the file, you can give a \fB:w\fR command and then a \fB:e #\fR command to redo the previous \fB:e\fR. .PP You can write part of the buffer to a file by finding out the lines that bound the range to be written using \fB^G\fR, and giving these numbers after the \fB:\fR and before the \fBw\fP, separated by \fB,\fR's. You can also mark these lines with \fBm\fR and then use an address of the form \fB\(aa\fR\fIx\fR\fB,\fB\(aa\fR\fIy\fR on the \fBw\fR command here. .PP You can read another file into the buffer after the current line by using the \fB:r\fR command. You can similarly read in the output from a command, just use \fB!\fR\fIcmd\fR instead of a file name. .PP If you wish to edit a set of files in succession, you can give all the names on the command line, and then edit each one in turn using the command \fB:n\fR. It is also possible to respecify the list of files to be edited by giving the \fB:n\fR command a list of file names, or a pattern to be expanded as you would have given it on the initial .I vi command. .PP If you are editing large programs, you will find the \fB:ta\fR command very useful. It utilizes a data base of function names and their locations, which can be created by programs such as .I ctags , to quickly find a function whose name you give. If the \fB:ta\fR command requires the editor to switch files, then you must \fB:w\fR or abandon any changes before switching. You can repeat the \fB:ta\fR command without any arguments to look for the same tag again. .NH 2 More about searching for strings .PP When you are searching for strings in the file with \fB/\fR and \fB?\fR, the editor normally places you at the next or previous occurrence of the string. If you are using an operator such as \fBd\fR, \fBc\fR or \fBy\fR, then you may well wish to affect lines up to the line before the line containing the pattern. You can give a search of the form \fB/\fR\fIpat\fR\fB/\-\fR\fIn\fR to refer to the \fIn\fR'th line before the next line containing \fIpat\fR, or you can use \fB+\fR instead of \fB\-\fR to refer to the lines after the one containing \fIpat\fR. If you don't give a line offset, then the editor will affect characters up to the match place, rather than whole lines; thus use ``+0'' to affect to the line which matches. .PP You can have the editor ignore the case of words in the searches it does by giving the command \fB:se ic\fR\s-2CR\s0. The command \fB:se noic\fR\s-2CR\s0 turns this off. .ne 1i .PP Strings given to searches may actually be regular expressions. If you do not want or need this facility, you should .DS set nomagic .DE in your EXINIT. In this case, only the characters \fB^\fR and \fB$\fR are special in patterns. The character \fB\e\fR is also then special (as it is most everywhere in the system), and may be used to get at the an extended pattern matching facility. It is also necessary to use a \e before a \fB/\fR in a forward scan or a \fB?\fR in a backward scan, in any case. The following table gives the extended forms when \fBmagic\fR is set. .DS .TS lb l. ^ at beginning of pattern, matches beginning of line $ at end of pattern, matches end of line \fB\&.\fR matches any character \e< matches the beginning of a word \e> matches the end of a word [\fIstr\fP] matches any single character in \fIstr\fP [^\fIstr\fP] matches any single character not in \fIstr\fP [\fIx\fP\-\fIy\fP] matches any character between \fIx\fP and \fIy\fP * matches any number of the preceding pattern .TE .DE If you use \fBnomagic\fR mode, then the \fB. [\fR and \fB*\fR primitives are given with a preceding \e. .NH 2 More about input mode .PP There are a number of characters which you can use to make corrections during input mode. These are summarized in the following table. .sp .5 .DS .TS lb l. ^H deletes the last input character ^W deletes the last input word, defined as by \fBb\fR erase your erase character, same as \fB^H\fP kill your kill character, deletes the input on this line \e escapes a following \fB^H\fP and your erase and kill \s-2ESC\s0 ends an insertion \s-2DEL\s0 interrupts an insertion, terminating it abnormally \s-2CR\s0 starts a new line ^D backtabs over \fIautoindent\fP 0^D kills all the \fIautoindent\fP ^^D same as \fB0^D\fP, but restores indent next line ^V quotes the next non-printing character into the file .TE .DE .sp .5 .PP The most usual way of making corrections to input is by typing \fB^H\fR to correct a single character, or by typing one or more \fB^W\fR's to back over incorrect words. If you use \fB#\fR as your erase character in the normal system, it will work like \fB^H\fR. .PP Your system kill character, normally \fB@\fR, \fB^X\fP or \fB^U\fR, will erase all the input you have given on the current line. In general, you can neither erase input back around a line boundary nor can you erase characters which you did not insert with this insertion command. To make corrections on the previous line after a new line has been started you can hit \s-2ESC\s0 to end the insertion, move over and make the correction, and then return to where you were to continue. The command \fBA\fR which appends at the end of the current line is often useful for continuing. .PP If you wish to type in your erase or kill character (say # or @) then you must precede it with a \fB\e\fR, just as you would do at the normal system command level. A more general way of typing non-printing characters into the file is to precede them with a \fB^V\fR. The \fB^V\fR echoes as a \fB^\fR character on which the cursor rests. This indicates that the editor expects you to type a control character. In fact you may type any character and it will be inserted into the file at that point.* .FS * This is not quite true. The implementation of the editor does not allow the \s-2NULL\s0 (\fB^@\fR) character to appear in files. Also the \s-2LF\s0 (linefeed or \fB^J\fR) character is used by the editor to separate lines in the file, so it cannot appear in the middle of a line. You can insert any other character, however, if you wait for the editor to echo the \fB^\fR before you type the character. In fact, the editor will treat a following letter as a request for the corresponding control character. This is the only way to type \fB^S\fR or \fB^Q\fP, since the system normally uses them to suspend and resume output and never gives them to the editor to process. .FE .PP If you are using \fIautoindent\fR you can backtab over the indent which it supplies by typing a \fB^D\fR. This backs up to a \fIshiftwidth\fR boundary. This only works immediately after the supplied \fIautoindent\fR. .PP When you are using \fIautoindent\fR you may wish to place a label at the left margin of a line. The way to do this easily is to type \fB^\fR and then \fB^D\fR. The editor will move the cursor to the left margin for one line, and restore the previous indent on the next. You can also type a \fB0\fR followed immediately by a \fB^D\fR if you wish to kill all the indent and not have it come back on the next line. .NH 2 Upper case only terminals .PP If your terminal has only upper case, you can still use .I vi by using the normal system convention for typing on such a terminal. Characters which you normally type are converted to lower case, and you can type upper case letters by preceding them with a \e. The characters { ~ } | \(ga are not available on such terminals, but you can escape them as \e( \e^ \e) \e! \e\(aa. These characters are represented on the display in the same way they are typed.\*(dd .FS \*(dd The \e character you give will not echo until you type another key. .FE .NH 2 Vi and ex .PP .I Vi is actually one mode of editing within the editor .I ex . When you are running .I vi you can escape to the line oriented editor of .I ex by giving the command \fBQ\fR. All of the .B : commands which were introduced above are available in .I ex. Likewise, most .I ex commands can be invoked from .I vi using \fB:\fR. Just give them without the \fB:\fR and follow them with a \s-2CR\s0. .PP In rare instances, an internal error may occur in .I vi . In this case you will get a diagnostic and be left in the command mode of .I ex . You can then save your work and quit if you wish by giving a command \fBx\fR after the \fB:\fR which \fIex\fR prompts you with, or you can reenter \fIvi\fR by giving .I ex a .I vi command. .PP There are a number of things which you can do more easily in .I ex than in .I vi. Systematic changes in line oriented material are particularly easy. You can read the advanced editing documents for the editor .I ed to find out a lot more about this style of editing. Experienced users often mix their use of .I ex command mode and .I vi command mode to speed the work they are doing. .\" .NH 2 .\" Open mode: vi on hardcopy terminals and ``glass tty's'' .\" \(dd .\" .PP .\" If you are on a hardcopy terminal or a terminal which does not have a cursor .\" which can move off the bottom line, you can still use the command set of .\" .I vi, .\" but in a different mode. .\" When you give a .\" .I vi .\" command, the editor will tell you that it is using .\" .I open .\" mode. .\" This name comes from the .\" .I open .\" command in .\" .I ex, .\" which is used to get into the same mode. .\" .PP .\" The only difference between .\" .I visual .\" mode .\" and .\" .I open .\" mode is the way in which the text is displayed. .\" .PP .\" In .\" .I open .\" mode the editor uses a single line window into the file, and moving backward .\" and forward in the file causes new lines to be displayed, always below the .\" current line. .\" Two commands of .\" .I vi .\" work differently in .\" .I open: .\" .B z .\" and .\" \fB^R\fR. .\" The .\" .B z .\" command does not take parameters, but rather draws a window of context around .\" the current line and then returns you to the current line. .\" .PP .\" If you are on a hardcopy terminal, .\" the .\" .B ^R .\" command will retype the current line. .\" On such terminals, the editor normally uses two lines to represent the .\" current line. .\" The first line is a copy of the line as you started to edit it, and you work .\" on the line below this line. .\" When you delete characters, the editor types a number of \e's to show .\" you the characters which are deleted. The editor also reprints the current .\" line soon after such changes so that you can see what the line looks .\" like again. .\" .PP .\" It is sometimes useful to use this mode on very slow terminals which .\" can support .\" .I vi .\" in the full screen mode. .\" You can do this by entering .\" .I ex .\" and using an .\" .I open .\" command. .\" .LP .SH Acknowledgements .PP Bruce Englar encouraged the early development of this display editor. Peter Kessler helped bring sanity to version 2's command layout. Bill Joy wrote versions 1 and 2.0 through 2.7, and created the framework that users see in the present editor. Mark Horton added macros and other features and made the editor work on a large number of terminals and Unix systems.
{ "pile_set_name": "Github" }
# frozen_string_literal: true describe Facts::Linux::Ruby::Platform do describe '#call_the_resolver' do subject(:fact) { Facts::Linux::Ruby::Platform.new } let(:value) { 'x86_64-linux' } before do allow(Facter::Resolvers::Ruby).to receive(:resolve).with(:platform).and_return(value) end it 'calls Facter::Resolvers::Ruby' do fact.call_the_resolver expect(Facter::Resolvers::Ruby).to have_received(:resolve).with(:platform) end it 'returns ruby platform fact' do expect(fact.call_the_resolver).to be_an_instance_of(Array).and \ contain_exactly(an_object_having_attributes(name: 'ruby.platform', value: value), an_object_having_attributes(name: 'rubyplatform', value: value, type: :legacy)) end end end
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; using Swan.Reflection; namespace Swan { /// <summary> /// Provides functionality to access <see cref="IPropertyProxy"/> objects /// associated with types. Getters and setters are stored as delegates compiled /// from constructed lambda expressions for fast access. /// </summary> public static class PropertyProxyExtensions { private static readonly object SyncLock = new object(); private static readonly Dictionary<Type, Dictionary<string, IPropertyProxy>> ProxyCache = new Dictionary<Type, Dictionary<string, IPropertyProxy>>(32); /// <summary> /// Gets the property proxies associated with a given type. /// </summary> /// <param name="t">The type to retrieve property proxies from.</param> /// <returns>A dictionary with property names as keys and <see cref="IPropertyProxy"/> objects as values.</returns> public static Dictionary<string, IPropertyProxy> PropertyProxies(this Type t) { if (t == null) throw new ArgumentNullException(nameof(t)); lock (SyncLock) { if (ProxyCache.ContainsKey(t)) return ProxyCache[t]; var properties = t.GetProperties(BindingFlags.Instance | BindingFlags.Public); var result = new Dictionary<string, IPropertyProxy>(properties.Length, StringComparer.InvariantCultureIgnoreCase); foreach (var propertyInfo in properties) result[propertyInfo.Name] = new PropertyInfoProxy(t, propertyInfo); ProxyCache[t] = result; return result; } } /// <summary> /// Gets the property proxies associated with the provided instance type. /// </summary> /// <typeparam name="T">The instance type.</typeparam> /// <param name="obj">The instance.</param> /// <returns>A dictionary with property names as keys and <see cref="IPropertyProxy"/> objects as values.</returns> public static Dictionary<string, IPropertyProxy> PropertyProxies<T>(this T obj) => (obj?.GetType() ?? typeof(T)).PropertyProxies(); /// <summary> /// Gets the property proxy given the property name. /// </summary> /// <param name="t">The associated type.</param> /// <param name="propertyName">Name of the property.</param> /// <returns>The associated <see cref="IPropertyProxy"/></returns> public static IPropertyProxy PropertyProxy(this Type t, string propertyName) { var proxies = t.PropertyProxies(); return proxies.ContainsKey(propertyName) ? proxies[propertyName] : null; } /// <summary> /// Gets the property proxy given the property name. /// </summary> /// <typeparam name="T">The type of instance to extract proxies from.</typeparam> /// <param name="obj">The instance to extract proxies from.</param> /// <param name="propertyName">Name of the property.</param> /// <returns>The associated <see cref="IPropertyProxy"/></returns> public static IPropertyProxy PropertyProxy<T>(this T obj, string propertyName) { if (propertyName == null) throw new ArgumentNullException(nameof(propertyName)); var proxies = (obj?.GetType() ?? typeof(T)).PropertyProxies(); return proxies?.ContainsKey(propertyName) == true ? proxies[propertyName] : null; } /// <summary> /// Gets the property proxy given the property name as an expression. /// </summary> /// <typeparam name="T">The instance type.</typeparam> /// <typeparam name="V">The property value type.</typeparam> /// <param name="obj">The object.</param> /// <param name="propertyExpression">The property expression.</param> /// <returns>The associated <see cref="IPropertyProxy"/></returns> public static IPropertyProxy PropertyProxy<T, V>(this T obj, Expression<Func<T, V>> propertyExpression) { if (propertyExpression == null) throw new ArgumentNullException(nameof(propertyExpression)); var proxies = (obj?.GetType() ?? typeof(T)).PropertyProxies(); var propertyName = propertyExpression.PropertyName(); return proxies?.ContainsKey(propertyName) == true ? proxies[propertyName] : null; } /// <summary> /// Reads the property value. /// </summary> /// <typeparam name="T">The type to get property proxies from.</typeparam> /// <typeparam name="V">The type of the property.</typeparam> /// <param name="obj">The instance.</param> /// <param name="propertyExpression">The property expression.</param> /// <returns> /// The value obtained from the associated <see cref="IPropertyProxy" /> /// </returns> /// <exception cref="ArgumentNullException">obj.</exception> public static V ReadProperty<T, V>(this T obj, Expression<Func<T, V>> propertyExpression) { if (obj == null) throw new ArgumentNullException(nameof(obj)); var proxy = obj.PropertyProxy(propertyExpression); return (V)(proxy?.GetValue(obj)); } /// <summary> /// Reads the property value. /// </summary> /// <typeparam name="T">The type to get property proxies from.</typeparam> /// <param name="obj">The instance.</param> /// <param name="propertyName">Name of the property.</param> /// <returns> /// The value obtained from the associated <see cref="IPropertyProxy" /> /// </returns> /// <exception cref="ArgumentNullException">obj.</exception> public static object? ReadProperty<T>(this T obj, string propertyName) { if (obj == null) throw new ArgumentNullException(nameof(obj)); var proxy = obj.PropertyProxy(propertyName); return proxy?.GetValue(obj); } /// <summary> /// Writes the property value. /// </summary> /// <typeparam name="T">The type to get property proxies from.</typeparam> /// <typeparam name="TV">The type of the property.</typeparam> /// <param name="obj">The instance.</param> /// <param name="propertyExpression">The property expression.</param> /// <param name="value">The value.</param> public static void WriteProperty<T, TV>(this T obj, Expression<Func<T, TV>> propertyExpression, TV value) { var proxy = obj.PropertyProxy(propertyExpression); proxy?.SetValue(obj, value); } /// <summary> /// Writes the property value using the property proxy. /// </summary> /// <typeparam name="T">The type to get property proxies from.</typeparam> /// <param name="obj">The instance.</param> /// <param name="propertyName">Name of the property.</param> /// <param name="value">The value.</param> public static void WriteProperty<T>(this T obj, string propertyName, object? value) { var proxy = obj.PropertyProxy(propertyName); proxy?.SetValue(obj, value); } private static string PropertyName<T, TV>(this Expression<Func<T, TV>> propertyExpression) { var memberExpression = !(propertyExpression.Body is MemberExpression) ? (propertyExpression.Body as UnaryExpression).Operand as MemberExpression : propertyExpression.Body as MemberExpression; return memberExpression.Member.Name; } } }
{ "pile_set_name": "Github" }
module.exports = function(hljs) { return { case_insensitive: true, defaultMode: { keywords: { flow: 'if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq', keyword: 'shift cd dir echo setlocal endlocal set pause copy', stream: 'prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux', winutils: 'ping net ipconfig taskkill xcopy ren del' }, contains: [ { className: 'envvar', begin: '%%[^ ]' }, { className: 'envvar', begin: '%[^ ]+?%' }, { className: 'envvar', begin: '![^ ]+?!' }, { className: 'number', begin: '\\b\\d+', relevance: 0 }, { className: 'comment', begin: '@?rem', end: '$' } ] } }; };
{ "pile_set_name": "Github" }
--TEST-- Bug #35176 (include()/require()/*_once() produce wrong error messages about main()) --INI-- html_errors=1 error_reporting=4095 --FILE-- <?php require_once('nonexisiting.php'); ?> --EXPECTF-- <br /> <b>Warning</b>: require_once(nonexisiting.php) [<a href='function.require-once.html'>function.require-once.html</a>]: failed to open stream: No such file or directory in <b>%sbug35176.php</b> on line <b>2</b><br /> <br /> <b>Fatal error</b>: require_once() [<a href='function.require.html'>function.require.html</a>]: Failed opening required 'nonexisiting.php' (%s) in <b>%sbug35176.php</b> on line <b>2</b><br />
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="items"> <xsd:complexType> <xsd:sequence> <xsd:element name="item" type="xsd:integer" minOccurs="0" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>
{ "pile_set_name": "Github" }
#define MCLBN_FP_UNIT_SIZE 6 #define MCLBN_FR_UNIT_SIZE 4 #include "she_c_impl.hpp"
{ "pile_set_name": "Github" }
require 'mxx_ru/binary_unittest' path = 'test/so_5/mchain/adv_select_mthread_read' MxxRu::setup_target( MxxRu::BinaryUnittestTarget.new( "#{path}/prj.ut.rb", "#{path}/prj.rb" ) )
{ "pile_set_name": "Github" }
approvers: - billimek - batazor reviewers: - billimek - batazor
{ "pile_set_name": "Github" }
/* * Copyright 2015 LINE Corporation * * LINE Corporation 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: * * 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. */ // ================================================================================================= // Copyright 2011 Twitter, Inc. // ------------------------------------------------------------------------------------------------- // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this work except in compliance with the License. // You may obtain a copy of the License in the LICENSE file, or 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 com.linecorp.armeria.common.thrift.text; import java.io.IOException; import java.nio.ByteBuffer; import org.apache.thrift.protocol.TMessageType; import com.fasterxml.jackson.core.Base64Variants; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonNode; /** * A type parsing helper, knows how to parse a given type either from a string * or from a JsonElement, and knows how to emit a given type to a JsonGenerator. * * <p>Clients should use the static members defined here for common types. * Should be implemented for each integral type we need to read/write. * * @author Alex Roetter * * @param <T> The type we are trying to read. */ abstract class TypedParser<T> { // Static methods clients can use. static final TypedParser<Boolean> BOOLEAN = new TypedParser<Boolean>() { @Override public Boolean readFromString(String s) { return Boolean.parseBoolean(s); } @Override public Boolean readFromJsonElement(JsonNode elem) { return elem.asBoolean(); } @Override public void writeValue(JsonGenerator jw, Boolean val) throws IOException { jw.writeBoolean(val); } }; static final TypedParser<Byte> BYTE = new TypedParser<Byte>() { @Override public Byte readFromString(String s) { return Byte.parseByte(s); } @Override public Byte readFromJsonElement(JsonNode elem) { return (byte) elem.asInt(); } @Override public void writeValue(JsonGenerator jw, Byte val) throws IOException { jw.writeNumber(val); } }; static final TypedParser<Short> SHORT = new TypedParser<Short>() { @Override public Short readFromString(String s) { return Short.parseShort(s); } @Override public Short readFromJsonElement(JsonNode elem) { return (short) elem.asInt(); } @Override public void writeValue(JsonGenerator jw, Short val) throws IOException { jw.writeNumber(val); } }; static final TypedParser<Integer> INTEGER = new TypedParser<Integer>() { @Override public Integer readFromString(String s) { return Integer.parseInt(s); } @Override public Integer readFromJsonElement(JsonNode elem) { return elem.asInt(); } @Override public void writeValue(JsonGenerator jw, Integer val) throws IOException { jw.writeNumber(val); } }; static final TypedParser<Long> LONG = new TypedParser<Long>() { @Override public Long readFromString(String s) { return Long.parseLong(s); } @Override public Long readFromJsonElement(JsonNode elem) { return elem.asLong(); } @Override public void writeValue(JsonGenerator jw, Long val) throws IOException { jw.writeNumber(val); } }; static final TypedParser<Double> DOUBLE = new TypedParser<Double>() { @Override public Double readFromString(String s) { return Double.parseDouble(s); } @Override public Double readFromJsonElement(JsonNode elem) { return elem.asDouble(); } @Override public void writeValue(JsonGenerator jw, Double val) throws IOException { jw.writeNumber(val); } }; static final TypedParser<String> STRING = new TypedParser<String>() { @Override public String readFromString(String s) { return s; } @Override public String readFromJsonElement(JsonNode elem) { return elem.asText(); } @Override public void writeValue(JsonGenerator jw, String val) throws IOException { jw.writeString(val); } }; static final TypedParser<ByteBuffer> BINARY = new TypedParser<ByteBuffer>() { @Override public ByteBuffer readFromString(String s) { return ByteBuffer.wrap(Base64Variants.getDefaultVariant().decode(s)); } @Override public ByteBuffer readFromJsonElement(JsonNode elem) { try { return ByteBuffer.wrap(elem.binaryValue()); } catch (IOException e) { throw new IllegalArgumentException("Error decoding binary value, is it valid base64?", e); } } @Override public void writeValue(JsonGenerator jw, ByteBuffer val) throws IOException { jw.writeBinary(val.array()); } }; static final TypedParser<Byte> TMESSAGE_TYPE = new TypedParser<Byte>() { @Override Byte readFromString(String s) { switch (s) { case "CALL": return TMessageType.CALL; case "REPLY": return TMessageType.REPLY; case "EXCEPTION": return TMessageType.EXCEPTION; case "ONEWAY": return TMessageType.ONEWAY; default: throw new IllegalArgumentException("Unsupported message type: " + s); } } @Override Byte readFromJsonElement(JsonNode elem) { return readFromString(elem.asText()); } @Override void writeValue(JsonGenerator jw, Byte val) throws IOException { final String serialized; switch (val.byteValue()) { case TMessageType.CALL: serialized = "CALL"; break; case TMessageType.REPLY: serialized = "REPLY"; break; case TMessageType.EXCEPTION: serialized = "EXCEPTION"; break; case TMessageType.ONEWAY: serialized = "ONEWAY"; break; default: throw new IllegalArgumentException("Unsupported message type: " + val); } jw.writeString(serialized); } }; /** * Convert from a string to the given type. */ abstract T readFromString(String s); /** * Read the given type from a JsonElement. */ abstract T readFromJsonElement(JsonNode elem); /** * Write the given type out using a JsonGenerator. */ abstract void writeValue(JsonGenerator jw, T val) throws IOException; }
{ "pile_set_name": "Github" }
{ lib , buildPythonPackage , fetchFromGitHub , colorama , pytest , pytestcov }: buildPythonPackage { pname = "typesentry"; version = "0.2.7"; # Only wheel distribution is available on PyPi. src = fetchFromGitHub { owner = "h2oai"; repo = "typesentry"; rev = "0ca8ed0e62d15ffe430545e7648c9a9b2547b49c"; sha256 = "0z615f9dxaab3bay3v27j7q99qm6l6q8xv872yvsp87sxj7apfki"; }; propagatedBuildInputs = [ colorama ]; checkInputs = [ pytest pytestcov ]; checkPhase = '' pytest ''; meta = with lib; { description = "Python 2.7 & 3.5+ runtime type-checker"; homepage = "https://github.com/h2oai/typesentry"; license = licenses.asl20; maintainers = with maintainers; [ abbradar ]; }; }
{ "pile_set_name": "Github" }
Hello, My name is [Private] (GitHub user is blangel) and I am a professor at NYU teaching course CS9053. I use GitHub to help teach my class. I use private repositories to share homework and code with students and I leverage pull requests to code review the students' submissions. This material, however, is copyrighted by myself and NYU and I make explicit to students that this material should not be copied into other repositories and publicly posted online. This is to help avoid academic dishonesty in cheating (copying past homework submissions). GitHub user CHRISlvZHANG has two repositories which violate this copyright. https://github.com/CHRISlvZHANG/CS9053-Java and https://github.com/CHRISlvZHANG/Java-NYU-Course-Lab-Series They are in fact copies of other students work (who have not agreed to this posting, one of which has logged a complaint already with GitHub, user [Private]). The user in question, CHRISlvZHANG, does not have a public email associated with his account. I have attempted to contact him (per GitHub guidelines) by opening the following pull requests asking him to take down the material: https://github.com/CHRISlvZHANG/CS9053-Java/pull/1 https://github.com/CHRISlvZHANG/Java-NYU-Course-Lab-Series/pull/1 He has not responded and so I am issuing a DMCA Complaint to take down the repositories. I have read and understand GitHub's Guide to Filing a DMCA Notice. I have verified that each of the repositories is a whole copy of copyrighted material and both should completely be removed. I have a good faith belief that use of the copyrighted materials described above on the infringing web pages is not authorized by the copyright owner, or its agent, or the law. I swear, under penalty of perjury, that the information in this notification is accurate and that I am the copyright owner, or am authorized to act on behalf of the owner, of an exclusive right that is allegedly infringed. My contact information is below: [Private] Thank you [Private]
{ "pile_set_name": "Github" }
danger.import_dangerfile(gem: 'mongoid-danger')
{ "pile_set_name": "Github" }
{ "translatorID": "43bc17ed-e994-4fdb-ac28-594c839658ca", "label": "Kommersant", "creator": "Avram Lyon", "target": "^https?://(www\\.)?kommersant\\.ru/", "minVersion": "2.1", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", "lastUpdated": "2017-01-01 16:02:40" } /*********************** BEGIN FRAMEWORK ***********************/ /** Copyright (c) 2010-2013, Erik Hetzner This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ /** * Flatten a nested array; e.g., [[1], [2,3]] -> [1,2,3] */ function flatten(a) { var retval = new Array(); for (var i in a) { var entry = a[i]; if (entry instanceof Array) { retval = retval.concat(flatten(entry)); } else { retval.push(entry); } } return retval; } var FW = { _scrapers : new Array() }; FW._Base = function () { this.callHook = function (hookName, item, doc, url) { if (typeof this['hooks'] === 'object') { var hook = this['hooks'][hookName]; if (typeof hook === 'function') { hook(item, doc, url); } } }; this.evaluateThing = function(val, doc, url) { var valtype = typeof val; if (valtype === 'object') { if (val instanceof Array) { /* map over each array val */ /* this.evaluate gets out of scope */ var parentEval = this.evaluateThing; var retval = val.map ( function(i) { return parentEval (i, doc, url); } ); return flatten(retval); } else { return val.evaluate(doc, url); } } else if (valtype === 'function') { return val(doc, url); } else { return val; } }; /* * makeItems is the function that does the work of making an item. * doc: the doc tree for the item * url: the url for the item * attachments ... * eachItem: a function to be called for each item made, with the arguments (doc, url, ...) * ret: the function to call when you are done, with no args */ this.makeItems = function (doc, url, attachments, eachItem, ret) { ret(); } }; FW.Scraper = function (init) { FW._scrapers.push(new FW._Scraper(init)); }; FW._Scraper = function (init) { for (x in init) { this[x] = init[x]; } this._singleFieldNames = [ "abstractNote", "applicationNumber", "archive", "archiveLocation", "artworkMedium", "artworkSize", "assignee", "audioFileType", "audioRecordingType", "billNumber", "blogTitle", "bookTitle", "callNumber", "caseName", "code", "codeNumber", "codePages", "codeVolume", "committee", "company", "conferenceName", "country", "court", "date", "dateDecided", "dateEnacted", "dictionaryTitle", "distributor", "docketNumber", "documentNumber", "DOI", "edition", "encyclopediaTitle", "episodeNumber", "extra", "filingDate", "firstPage", "forumTitle", "genre", "history", "institution", "interviewMedium", "ISBN", "ISSN", "issue", "issueDate", "issuingAuthority", "journalAbbreviation", "label", "language", "legalStatus", "legislativeBody", "letterType", "libraryCatalog", "manuscriptType", "mapType", "medium", "meetingName", "nameOfAct", "network", "number", "numberOfVolumes", "numPages", "pages", "patentNumber", "place", "postType", "presentationType", "priorityNumbers", "proceedingsTitle", "programTitle", "programmingLanguage", "publicLawNumber", "publicationTitle", "publisher", "references", "reportNumber", "reportType", "reporter", "reporterVolume", "rights", "runningTime", "scale", "section", "series", "seriesNumber", "seriesText", "seriesTitle", "session", "shortTitle", "studio", "subject", "system", "thesisType", "title", "type", "university", "url", "versionNumber", "videoRecordingType", "volume", "websiteTitle", "websiteType" ]; this._makeAttachments = function(doc, url, config, item) { if (config instanceof Array) { config.forEach(function (child) { this._makeAttachments(doc, url, child, item); }, this); } else if (typeof config === 'object') { /* plural or singual */ var urlsFilter = config["urls"] || config["url"]; var typesFilter = config["types"] || config["type"]; var titlesFilter = config["titles"] || config["title"]; var snapshotsFilter = config["snapshots"] || config["snapshot"]; var attachUrls = this.evaluateThing(urlsFilter, doc, url); var attachTitles = this.evaluateThing(titlesFilter, doc, url); var attachTypes = this.evaluateThing(typesFilter, doc, url); var attachSnapshots = this.evaluateThing(snapshotsFilter, doc, url); if (!(attachUrls instanceof Array)) { attachUrls = [attachUrls]; } for (var k in attachUrls) { var attachUrl = attachUrls[k]; var attachType; var attachTitle; var attachSnapshot; if (attachTypes instanceof Array) { attachType = attachTypes[k]; } else { attachType = attachTypes; } if (attachTitles instanceof Array) { attachTitle = attachTitles[k]; } else { attachTitle = attachTitles; } if (attachSnapshots instanceof Array) { attachSnapshot = attachSnapshots[k]; } else { attachSnapshot = attachSnapshots; } item["attachments"].push({ url : attachUrl, title : attachTitle, mimeType : attachType, snapshot : attachSnapshot }); } } }; this.makeItems = function (doc, url, ignore, eachItem, ret) { var item = new Zotero.Item(this.itemType); item.url = url; for (var i in this._singleFieldNames) { var field = this._singleFieldNames[i]; if (this[field]) { var fieldVal = this.evaluateThing(this[field], doc, url); if (fieldVal instanceof Array) { item[field] = fieldVal[0]; } else { item[field] = fieldVal; } } } var multiFields = ["creators", "tags"]; for (var j in multiFields) { var key = multiFields[j]; var val = this.evaluateThing(this[key], doc, url); if (val) { for (var k in val) { item[key].push(val[k]); } } } this._makeAttachments(doc, url, this["attachments"], item); eachItem(item, this, doc, url); ret(); }; }; FW._Scraper.prototype = new FW._Base; FW.MultiScraper = function (init) { FW._scrapers.push(new FW._MultiScraper(init)); }; FW._MultiScraper = function (init) { for (x in init) { this[x] = init[x]; } this._mkSelectItems = function(titles, urls) { var items = new Object; for (var i in titles) { items[urls[i]] = titles[i]; } return items; }; this._selectItems = function(titles, urls, callback) { var items = new Array(); Zotero.selectItems(this._mkSelectItems(titles, urls), function (chosen) { for (var j in chosen) { items.push(j); } callback(items); }); }; this._mkAttachments = function(doc, url, urls) { var attachmentsArray = this.evaluateThing(this['attachments'], doc, url); var attachmentsDict = new Object(); if (attachmentsArray) { for (var i in urls) { attachmentsDict[urls[i]] = attachmentsArray[i]; } } return attachmentsDict; }; /* This logic is very similar to that used by _makeAttachments in * a normal scraper, but abstracting it out would not achieve much * and would complicate it. */ this._makeChoices = function(config, doc, url, choiceTitles, choiceUrls) { if (config instanceof Array) { config.forEach(function (child) { this._makeTitlesUrls(child, doc, url, choiceTitles, choiceUrls); }, this); } else if (typeof config === 'object') { /* plural or singual */ var urlsFilter = config["urls"] || config["url"]; var titlesFilter = config["titles"] || config["title"]; var urls = this.evaluateThing(urlsFilter, doc, url); var titles = this.evaluateThing(titlesFilter, doc, url); var titlesIsArray = (titles instanceof Array); if (!(urls instanceof Array)) { urls = [urls]; } for (var k in urls) { var myUrl = urls[k]; var myTitle; if (titlesIsArray) { myTitle = titles[k]; } else { myTitle = titles; } choiceUrls.push(myUrl); choiceTitles.push(myTitle); } } }; this.makeItems = function(doc, url, ignore, eachItem, ret) { if (this.beforeFilter) { var newurl = this.beforeFilter(doc, url); if (newurl != url) { this.makeItems(doc, newurl, ignore, eachItem, ret); return; } } var titles = []; var urls = []; this._makeChoices(this["choices"], doc, url, titles, urls); var attachments = this._mkAttachments(doc, url, urls); var parentItemTrans = this.itemTrans; this._selectItems(titles, urls, function (itemsToUse) { if(!itemsToUse) { ret(); } else { var cb = function (doc1) { var url1 = doc1.documentURI; var itemTrans = parentItemTrans; if (itemTrans === undefined) { itemTrans = FW.getScraper(doc1, url1); } if (itemTrans === undefined) { /* nothing to do */ } else { itemTrans.makeItems(doc1, url1, attachments[url1], eachItem, function() {}); } }; Zotero.Utilities.processDocuments(itemsToUse, cb, ret); } }); }; }; FW._MultiScraper.prototype = new FW._Base; FW.WebDelegateTranslator = function (init) { return new FW._WebDelegateTranslator(init); }; FW._WebDelegateTranslator = function (init) { for (x in init) { this[x] = init[x]; } this.makeItems = function(doc, url, attachments, eachItem, ret) { // need for scoping var parentThis = this; var translator = Zotero.loadTranslator("web"); translator.setHandler("itemDone", function(obj, item) { eachItem(item, parentThis, doc, url); }); translator.setDocument(doc); if (this.translatorId) { translator.setTranslator(this.translatorId); translator.translate(); } else { translator.setHandler("translators", function(obj, translators) { if (translators.length) { translator.setTranslator(translators[0]); translator.translate(); } }); translator.getTranslators(); } ret(); }; }; FW._WebDelegateTranslator.prototype = new FW._Base; FW._StringMagic = function () { this._filters = new Array(); this.addFilter = function(filter) { this._filters.push(filter); return this; }; this.split = function(re) { return this.addFilter(function(s) { return s.split(re).filter(function(e) { return (e != ""); }); }); }; this.replace = function(s1, s2, flags) { return this.addFilter(function(s) { if (s.match(s1)) { return s.replace(s1, s2, flags); } else { return s; } }); }; this.prepend = function(prefix) { return this.replace(/^/, prefix); }; this.append = function(postfix) { return this.replace(/$/, postfix); }; this.remove = function(toStrip, flags) { return this.replace(toStrip, '', flags); }; this.trim = function() { return this.addFilter(function(s) { return Zotero.Utilities.trim(s); }); }; this.trimInternal = function() { return this.addFilter(function(s) { return Zotero.Utilities.trimInternal(s); }); }; this.match = function(re, group) { if (!group) group = 0; return this.addFilter(function(s) { var m = s.match(re); if (m === undefined || m === null) { return undefined; } else { return m[group]; } }); }; this.cleanAuthor = function(type, useComma) { return this.addFilter(function(s) { return Zotero.Utilities.cleanAuthor(s, type, useComma); }); }; this.key = function(field) { return this.addFilter(function(n) { return n[field]; }); }; this.capitalizeTitle = function() { return this.addFilter(function(s) { return Zotero.Utilities.capitalizeTitle(s); }); }; this.unescapeHTML = function() { return this.addFilter(function(s) { return Zotero.Utilities.unescapeHTML(s); }); }; this.unescape = function() { return this.addFilter(function(s) { return unescape(s); }); }; this._applyFilters = function(a, doc1) { for (i in this._filters) { a = flatten(a); /* remove undefined or null array entries */ a = a.filter(function(x) { return ((x !== undefined) && (x !== null)); }); for (var j = 0 ; j < a.length ; j++) { try { if ((a[j] === undefined) || (a[j] === null)) { continue; } else { a[j] = this._filters[i](a[j], doc1); } } catch (x) { a[j] = undefined; Zotero.debug("Caught exception " + x + "on filter: " + this._filters[i]); } } /* remove undefined or null array entries */ /* need this twice because they could have become undefined or null along the way */ a = a.filter(function(x) { return ((x !== undefined) && (x !== null)); }); } return flatten(a); }; }; FW.PageText = function () { return new FW._PageText(); }; FW._PageText = function() { this._filters = new Array(); this.evaluate = function (doc) { var a = [doc.documentElement.innerHTML]; a = this._applyFilters(a, doc); if (a.length == 0) { return false; } else { return a; } }; }; FW._PageText.prototype = new FW._StringMagic(); FW.Url = function () { return new FW._Url(); }; FW._Url = function () { this._filters = new Array(); this.evaluate = function (doc, url) { var a = [url]; a = this._applyFilters(a, doc); if (a.length == 0) { return false; } else { return a; } }; }; FW._Url.prototype = new FW._StringMagic(); FW.Xpath = function (xpathExpr) { return new FW._Xpath(xpathExpr); }; FW._Xpath = function (_xpath) { this._xpath = _xpath; this._filters = new Array(); this.text = function() { var filter = function(n) { if (typeof n === 'object' && n.textContent) { return n.textContent; } else { return n; } }; this.addFilter(filter); return this; }; this.sub = function(xpath) { var filter = function(n, doc) { var result = doc.evaluate(xpath, n, null, XPathResult.ANY_TYPE, null); if (result) { return result.iterateNext(); } else { return undefined; } }; this.addFilter(filter); return this; }; this.evaluate = function (doc) { var res = doc.evaluate(this._xpath, doc, null, XPathResult.ANY_TYPE, null); var resultType = res.resultType; var a = new Array(); if (resultType == XPathResult.STRING_TYPE) { a.push(res.stringValue); } else if (resultType == XPathResult.BOOLEAN_TYPE) { a.push(res.booleanValue); } else if (resultType == XPathResult.NUMBER_TYPE) { a.push(res.numberValue); } else if (resultType == XPathResult.ORDERED_NODE_ITERATOR_TYPE || resultType == XPathResult.UNORDERED_NODE_ITERATOR_TYPE) { var x; while ((x = res.iterateNext())) { a.push(x); } } a = this._applyFilters(a, doc); if (a.length == 0) { return false; } else { return a; } }; }; FW._Xpath.prototype = new FW._StringMagic(); FW.detectWeb = function (doc, url) { for (var i in FW._scrapers) { var scraper = FW._scrapers[i]; var itemType = scraper.evaluateThing(scraper['itemType'], doc, url); var v = scraper.evaluateThing(scraper['detect'], doc, url); if (v.length > 0 && v[0]) { return itemType; } } return undefined; }; FW.getScraper = function (doc, url) { var itemType = FW.detectWeb(doc, url); return FW._scrapers.filter(function(s) { return (s.evaluateThing(s['itemType'], doc, url) == itemType) && (s.evaluateThing(s['detect'], doc, url)); })[0]; }; FW.doWeb = function (doc, url) { var scraper = FW.getScraper(doc, url); scraper.makeItems(doc, url, [], function(item, scraper, doc, url) { scraper.callHook('scraperDone', item, doc, url); if (!item['title']) { item['title'] = ""; } item.complete(); }, function() { Zotero.done(); }); Zotero.wait(); }; /*********************** END FRAMEWORK ***********************/ /* ***** BEGIN LICENSE BLOCK ***** Kommersant Translator Copyright © 2011 Avram Lyon, [email protected] This file is part of Zotero. Zotero is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Zotero 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 Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with Zotero. If not, see <http://www.gnu.org/licenses/>. ***** END LICENSE BLOCK ***** */ function detectWeb(doc, url) { return FW.detectWeb(doc, url); } function doWeb(doc, url) { return FW.doWeb(doc, url); } //technically these should be (and used to be) different item types and we should account for them, but this at least makes this work again in a basic fashion /** Articles */ FW.Scraper({ itemType : 'magazineArticle', detect : FW.Xpath('//h2[@class="article_name"]'), title : FW.Xpath('//h2[@class="article_name"]').text().trim(), attachments : [ { url : FW.Url(), type : "text/html", title : "Kommersant Snapshot" } ], creators : FW.Xpath('//li[@rel="author"]/a[2]').text().split(",").cleanAuthor("author"), date : FW.Xpath('//div[contains(@class, "b-article_issue_number")]').text().match(/\d{2}\.\d{2}\.\d{4}/), issue : FW.Xpath('//div[contains(@class, "b-article_issue_number")]/a').text().match(/\d+/), abstractNote : FW.Xpath('//span[@class="b-article__intro"]').text().trimInternal(), url : FW.Url().replace(/(\?|&)stamp.+/, ""), pages : FW.Xpath('//div[contains(@class, "b-article_issue_number")]').text().match(/стр.\s*\d+/).remove(/стр.\s*/), publicationTitle : FW.Xpath('//div[contains(@class, "b-article_issue_number")]').text().match(/.+№/).remove(/№/).remove(/\. Приложение/), hooks : { "scraperDone": function (item,doc, url) { if (!item.publicationTitle) item.publicationTitle = "Коммерсантъ"; }} }); /** Search results */ FW.MultiScraper({ itemType : "multiple", detect : FW.Xpath('//div[contains(@class,"search-results_list")]'), choices : { titles : FW.Xpath('//h4[@class="article_name"]/a').text(), urls : FW.Xpath('//h4[@class="article_name"]/a').key('href').text() } }); /** BEGIN TEST CASES **/ var testCases = [ { "type": "web", "url": "http://kommersant.ru/doc/1811182", "items": [ { "itemType": "magazineArticle", "title": "В Сергее Глазьеве не хватило евразийского", "creators": [ { "firstName": "Дмитрий", "lastName": "Бутрин", "creatorType": "author" } ], "date": "08.11.2011", "abstractNote": "Как стало известно \"Ъ\", глава секретариата комиссии Таможенного союза (КТС) Сергей Глазьев с июля 2012 года может сменить работу: он не получил предложения войти в Евразийскую экономическую комиссию (ЕЭК) со стороны РФ. Действующие сотрудники КТС будут проходить аттестационную комиссию, чтобы попасть в управляющую структуру нового союза. Главная претензия к главе секретариата КТС — \"дефицит идеологии и проблемы с администрированием\": их с российской стороны будут восполнять переводом в ЕЭК сотрудников российских министерств.", "issue": "208", "libraryCatalog": "Kommersant", "pages": "1", "publicationTitle": "Газета \"Коммерсантъ\"", "url": "http://kommersant.ru/doc/1811182", "attachments": [ { "title": "Kommersant Snapshot", "mimeType": "text/html" } ], "tags": [], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "http://www.kommersant.ru/doc/1832739?stamp=634721007709478300", "items": [ { "itemType": "magazineArticle", "title": "Яблочный пуй", "creators": [], "date": "12.12.2011", "abstractNote": "За тем, как проходят российские выборы в месте, где административный ресурс по географическим причинам ослаблен, наблюдал корреспондент \"Власти\" Артем Платов.", "issue": "49", "libraryCatalog": "Kommersant", "pages": "28", "publicationTitle": "Журнал \"Коммерсантъ Власть\"", "url": "http://www.kommersant.ru/doc/1832739", "attachments": [ { "title": "Kommersant Snapshot", "mimeType": "text/html" } ], "tags": [], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "http://www.kommersant.ru/doc/1836636?themeid=589", "items": [ { "itemType": "magazineArticle", "title": "\"Это не добровольное мероприятие, не по зову сердца, а по указке, по разнарядке\"", "creators": [], "date": "12.12.2011", "libraryCatalog": "Kommersant", "publicationTitle": "Коммерсантъ", "url": "http://www.kommersant.ru/doc/1836636?themeid=589", "attachments": [ { "title": "Kommersant Snapshot", "mimeType": "text/html" } ], "tags": [], "notes": [], "seeAlso": [] } ] }, { "type": "web", "url": "http://kommersant.ru/Search/Results?places=1%2C6%2C34%2C52%2C61%2C62%2C198%2C2%2C3%2C84%2C17%2C14%2C5%2C217%2C66%2C57%2C210%2C86%2C9999&categories=20&isbankrupt=false&datestart=8.10.2011&dateend=8.11.2011&sort_type=0&sort_dir=0&region_selected=-1&results_count=300&saved_query=&saved_statement=&page=1&search_query=%CF%F3%D2%E8%CD&stamp=634721009393393053", "defer": true, "items": "multiple" } ] /** END TEST CASES **/
{ "pile_set_name": "Github" }
{ "$type": "System.Fabric.InfrastructureService.Parallel.Test.MockPolicyAgentDocumentForTenant, FabricIS.parallel.Test", "Incarnation": "1", "JobDocumentIncarnation": 1, "Jobs": [ { "$type": "System.Fabric.InfrastructureService.Parallel.Test.MockTenantJob, FabricIS.parallel.Test", "Id": "3cbd5a8b-1fa9-42b0-a4b1-aba8f0ded836", "JobStatus": "Executing", "RoleInstancesToBeImpacted": [ "Role_IN_0", "Role_IN_1" ], "JobStep": { "$type": "System.Fabric.InfrastructureService.Parallel.Test.MockJobStepInfo, FabricIS.parallel.Test", "ImpactStep": "ImpactStart", "AcknowledgementStatus": "WaitingForAcknowledgement", "CurrentlyImpactedRoleInstances": [], "ActionStatus": "NotExecuted" }, "ImpactDetail": { "$type": "System.Fabric.InfrastructureService.Parallel.Test.MockImpactInfo, FabricIS.parallel.Test", "ImpactAction": "TenantUpdate", "ImpactedResources": { "$type": "RD.Fabric.PolicyAgent.AffectedResourceImpact, FabricIS.parallel.schema", "ListOfImpactTypes": [ "Reboot" ], "DiskImpact": "Reset", "ComputeImpact": "Reset", "NetworkImpact": "Reset", "OSImpact": "Reset", "ApplicationConfigImpact": "None", "EstimatedImpactDurationInSeconds": 0 } } } ], "RoleInstanceHealthInfoIncarnation": 2, "RoleInstanceHealthInfoTimestamp": "9/15/2016 19:28:31 +00:00", "RoleInstanceHealthInfos": [ { "$type": "RD.Fabric.PolicyAgent.RoleInstanceHealthInfo, FabricIS.parallel.schema", "RoleInstanceName": "Role_IN_0", "Health": "ReadyRole" }, { "$type": "RD.Fabric.PolicyAgent.RoleInstanceHealthInfo, FabricIS.parallel.schema", "RoleInstanceName": "Role_IN_1", "Health": "StoppedVM" } ] }
{ "pile_set_name": "Github" }
// // SUAppcast.h // Sparkle // // Created by Andy Matuschak on 3/12/06. // Copyright 2006 Andy Matuschak. All rights reserved. // #ifndef SUAPPCAST_H #define SUAPPCAST_H #import <Foundation/NSURLDownload.h> #import "SUExport.h" @protocol SUAppcastDelegate; @class SUAppcastItem; SU_EXPORT @interface SUAppcast : NSObject <NSURLDownloadDelegate> @property (weak) id<SUAppcastDelegate> delegate; @property (copy) NSString *userAgentString; - (void)fetchAppcastFromURL:(NSURL *)url; @property (readonly, copy) NSArray *items; @end @protocol SUAppcastDelegate <NSObject> - (void)appcastDidFinishLoading:(SUAppcast *)appcast; - (void)appcast:(SUAppcast *)appcast failedToLoadWithError:(NSError *)error; @end #endif
{ "pile_set_name": "Github" }
// Copyright 2015 CoreOS, 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 transport import ( "net" "time" ) type rwTimeoutDialer struct { wtimeoutd time.Duration rdtimeoutd time.Duration net.Dialer } func (d *rwTimeoutDialer) Dial(network, address string) (net.Conn, error) { conn, err := d.Dialer.Dial(network, address) tconn := &timeoutConn{ rdtimeoutd: d.rdtimeoutd, wtimeoutd: d.wtimeoutd, Conn: conn, } return tconn, err }
{ "pile_set_name": "Github" }
// // WebViewJavascriptBridge.m // ExampleApp-iOS // // Created by Marcus Westin on 6/14/13. // Copyright (c) 2013 Marcus Westin. All rights reserved. // #import "WebViewJavascriptBridge.h" #if defined(supportsWKWebView) #import "WKWebViewJavascriptBridge.h" #endif #if __has_feature(objc_arc_weak) #define WVJB_WEAK __weak #else #define WVJB_WEAK __unsafe_unretained #endif @implementation WebViewJavascriptBridge { WVJB_WEAK WVJB_WEBVIEW_TYPE* _webView; // 这里使用的是弱引用 WVJB_WEAK id _webViewDelegate; long _uniqueId; WebViewJavascriptBridgeBase *_base; } /* API *****/ + (void)enableLogging { [WebViewJavascriptBridgeBase enableLogging]; } + (void)setLogMaxLength:(int)length { [WebViewJavascriptBridgeBase setLogMaxLength:length]; } // 创建 Bridge + (instancetype)bridgeForWebView:(id)webView { return [self bridge:webView]; } + (instancetype)bridge:(id)webView { // WKWebView #if defined supportsWKWebView if ([webView isKindOfClass:[WKWebView class]]) { return (WebViewJavascriptBridge*) [WKWebViewJavascriptBridge bridgeForWebView:webView]; } #endif // UIWebView(iOS) 或者 WebView(OSX) if ([webView isKindOfClass:[WVJB_WEBVIEW_TYPE class]]) { WebViewJavascriptBridge* bridge = [[self alloc] init]; // 注意:这里用的不是 WebViewJavascriptBridge 而是 self [bridge _platformSpecificSetup:webView]; // 针对不同平台进行初始设置:保存 webView,并设置 webView 的 delegate,创建 WebViewJavascriptBridgeBase 对象,并设置 WebViewJavascriptBridgeBase 的 delegate return bridge; } [NSException raise:@"BadWebViewType" format:@"Unknown web view type."]; return nil; } - (void)setWebViewDelegate:(WVJB_WEBVIEW_DELEGATE_TYPE*)webViewDelegate { _webViewDelegate = webViewDelegate; } - (void)send:(id)data { [self send:data responseCallback:nil]; } - (void)send:(id)data responseCallback:(WVJBResponseCallback)responseCallback { [_base sendData:data responseCallback:responseCallback handlerName:nil]; } - (void)callHandler:(NSString *)handlerName { [self callHandler:handlerName data:nil responseCallback:nil]; } - (void)callHandler:(NSString *)handlerName data:(id)data { [self callHandler:handlerName data:data responseCallback:nil]; } - (void)callHandler:(NSString *)handlerName data:(id)data responseCallback:(WVJBResponseCallback)responseCallback { [_base sendData:data responseCallback:responseCallback handlerName:handlerName]; } - (void)registerHandler:(NSString *)handlerName handler:(WVJBHandler)handler { _base.messageHandlers[handlerName] = [handler copy]; // 保存 handler } - (void)removeHandler:(NSString *)handlerName { [_base.messageHandlers removeObjectForKey:handlerName]; } - (void)disableJavscriptAlertBoxSafetyTimeout { [_base disableJavscriptAlertBoxSafetyTimeout]; } /* Platform agnostic internals *****************************/ - (void)dealloc { [self _platformSpecificDealloc]; _base = nil; _webView = nil; _webViewDelegate = nil; } - (NSString*) _evaluateJavascript:(NSString*)javascriptCommand { return [_webView stringByEvaluatingJavaScriptFromString:javascriptCommand]; } #if defined WVJB_PLATFORM_OSX /* Platform specific internals: OSX **********************************/ - (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView { _webView = webView; _webView.policyDelegate = self; _base = [[WebViewJavascriptBridgeBase alloc] init]; _base.delegate = self; } - (void) _platformSpecificDealloc { _webView.policyDelegate = nil; } - (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener { if (webView != _webView) { return; } NSURL *url = [request URL]; if ([_base isWebViewJavascriptBridgeURL:url]) { if ([_base isBridgeLoadedURL:url]) { [_base injectJavascriptFile]; } else if ([_base isQueueMessageURL:url]) { NSString *messageQueueString = [self _evaluateJavascript:[_base webViewJavascriptFetchQueyCommand]]; [_base flushMessageQueue:messageQueueString]; } else { [_base logUnkownMessage:url]; } [listener ignore]; } else if (_webViewDelegate && [_webViewDelegate respondsToSelector:@selector(webView:decidePolicyForNavigationAction:request:frame:decisionListener:)]) { [_webViewDelegate webView:webView decidePolicyForNavigationAction:actionInformation request:request frame:frame decisionListener:listener]; } else { [listener use]; } } #elif defined WVJB_PLATFORM_IOS /* Platform specific internals: iOS **********************************/ - (void) _platformSpecificSetup:(WVJB_WEBVIEW_TYPE*)webView { _webView = webView; _webView.delegate = self; _base = [[WebViewJavascriptBridgeBase alloc] init]; _base.delegate = self; } - (void) _platformSpecificDealloc { _webView.delegate = nil; } - (void)webViewDidFinishLoad:(UIWebView *)webView { if (webView != _webView) { return; } __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; // MARK: 这里为什么用 strong? if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidFinishLoad:)]) { [strongDelegate webViewDidFinishLoad:webView]; } } - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { if (webView != _webView) { return; } __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:didFailLoadWithError:)]) { [strongDelegate webView:webView didFailLoadWithError:error]; } } - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { if (webView != _webView) { return YES; } NSURL *url = [request URL]; __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; if ([_base isWebViewJavascriptBridgeURL:url]) { // 是不是 Bridge 的 URL if ([_base isBridgeLoadedURL:url]) { // 是不是第一次加载时的 URL [_base injectJavascriptFile]; // 注入 WebViewJavascriptBridge_JS 文件中的 JavaScript } else if ([_base isQueueMessageURL:url]) { // 是不是发送消息给 Native 的 URL NSString *messageQueueString = [self _evaluateJavascript:[_base webViewJavascriptFetchQueyCommand]]; [_base flushMessageQueue:messageQueueString]; } else { [_base logUnkownMessage:url]; } return NO; } else if (strongDelegate && [strongDelegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) { return [strongDelegate webView:webView shouldStartLoadWithRequest:request navigationType:navigationType]; } else { return YES; } } - (void)webViewDidStartLoad:(UIWebView *)webView { if (webView != _webView) { return; } __strong WVJB_WEBVIEW_DELEGATE_TYPE* strongDelegate = _webViewDelegate; if (strongDelegate && [strongDelegate respondsToSelector:@selector(webViewDidStartLoad:)]) { [strongDelegate webViewDidStartLoad:webView]; } } #endif @end
{ "pile_set_name": "Github" }
// Copyright 2016 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. load("base.js"); load("base_exec.js"); createSlowBenchmarkSuite("Exec");
{ "pile_set_name": "Github" }
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // //=============================================================================// #ifndef NPC_METROPOLICE_H #define NPC_METROPOLICE_H #ifdef _WIN32 #pragma once #endif #include "rope.h" #include "rope_shared.h" #include "ai_baseactor.h" #include "ai_basenpc.h" #include "ai_goal_police.h" #include "ai_behavior.h" #include "ai_behavior_standoff.h" #include "ai_behavior_assault.h" #include "ai_behavior_functank.h" #include "ai_behavior_actbusy.h" #include "ai_behavior_rappel.h" #include "ai_behavior_police.h" #include "ai_behavior_follow.h" #include "ai_sentence.h" #include "props.h" class CNPC_MetroPolice; class CNPC_MetroPolice : public CAI_BaseActor { DECLARE_CLASS( CNPC_MetroPolice, CAI_BaseActor ); DECLARE_DATADESC(); public: CNPC_MetroPolice(); virtual bool CreateComponents(); bool CreateBehaviors(); void Spawn( void ); void Precache( void ); Class_T Classify( void ); Disposition_t IRelationType(CBaseEntity *pTarget); float MaxYawSpeed( void ); void HandleAnimEvent( animevent_t *pEvent ); Activity NPC_TranslateActivity( Activity newActivity ); Vector EyeDirection3D( void ) { return CAI_BaseHumanoid::EyeDirection3D(); } // cops don't have eyes virtual void Event_Killed( const CTakeDamageInfo &info ); virtual void OnScheduleChange(); float GetIdealAccel( void ) const; int ObjectCaps( void ) { return UsableNPCObjectCaps(BaseClass::ObjectCaps()); } void PrecriminalUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); // These are overridden so that the cop can shove and move a non-criminal player safely CBaseEntity *CheckTraceHullAttack( float flDist, const Vector &mins, const Vector &maxs, int iDamage, int iDmgType, float forceScale, bool bDamageAnyNPC ); CBaseEntity *CheckTraceHullAttack( const Vector &vStart, const Vector &vEnd, const Vector &mins, const Vector &maxs, int iDamage, int iDmgType, float flForceScale, bool bDamageAnyNPC ); virtual int SelectSchedule( void ); virtual int SelectFailSchedule( int failedSchedule, int failedTask, AI_TaskFailureCode_t taskFailCode ); virtual int TranslateSchedule( int scheduleType ); void StartTask( const Task_t *pTask ); void RunTask( const Task_t *pTask ); virtual Vector GetActualShootTrajectory( const Vector &shootOrigin ); virtual void FireBullets( const FireBulletsInfo_t &info ); virtual bool HandleInteraction(int interactionType, void *data, CBaseCombatCharacter* sourceEnt); virtual void Weapon_Equip( CBaseCombatWeapon *pWeapon ); //virtual bool OverrideMoveFacing( const AILocalMoveGoal_t &move, float flInterval ); bool OnObstructionPreSteer( AILocalMoveGoal_t *pMoveGoal, float distClear, AIMoveResult_t *pResult ); bool ShouldBruteForceFailedNav() { return false; } virtual void GatherConditions( void ); virtual bool OverrideMoveFacing( const AILocalMoveGoal_t &move, float flInterval ); // Can't move and shoot when the enemy is an airboat virtual bool ShouldMoveAndShoot(); // TraceAttack virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator ); // Speaking virtual void SpeakSentence( int nSentenceType ); // Set up the shot regulator based on the equipped weapon virtual void OnUpdateShotRegulator( ); bool ShouldKnockOutTarget( CBaseEntity *pTarget ); void KnockOutTarget( CBaseEntity *pTarget ); void StunnedTarget( CBaseEntity *pTarget ); void AdministerJustice( void ); bool QueryHearSound( CSound *pSound ); void SetBatonState( bool state ); bool BatonActive( void ); CAI_Sentence< CNPC_MetroPolice > *GetSentences() { return &m_Sentences; } virtual bool AllowedToIgnite( void ) { return true; } void PlayFlinchGesture( void ); protected: // Determines the best type of flinch anim to play. virtual Activity GetFlinchActivity( bool bHeavyDamage, bool bGesture ); // Only move and shoot when attacking virtual bool OnBeginMoveAndShoot(); virtual void OnEndMoveAndShoot(); private: bool PlayerIsCriminal( void ); void ReleaseManhack( void ); // Speech-related methods void AnnounceTakeCoverFromDanger( CSound *pSound ); void AnnounceEnemyType( CBaseEntity *pEnemy ); void AnnounceEnemyKill( CBaseEntity *pEnemy ); void AnnounceHarrassment( ); void AnnounceOutOfAmmo( ); // Behavior-related sentences void SpeakFuncTankSentence( int nSentenceType ); void SpeakAssaultSentence( int nSentenceType ); void SpeakStandoffSentence( int nSentenceType ); virtual void LostEnemySound( void ); virtual void FoundEnemySound( void ); virtual void AlertSound( void ); virtual void PainSound( const CTakeDamageInfo &info ); virtual void DeathSound( const CTakeDamageInfo &info ); virtual void IdleSound( void ); virtual bool ShouldPlayIdleSound( void ); // Burst mode! void SetBurstMode( bool bEnable ); int OnTakeDamage_Alive( const CTakeDamageInfo &info ); int GetSoundInterests( void ); void BuildScheduleTestBits( void ); bool CanDeployManhack( void ); bool ShouldHitPlayer( const Vector &targetDir, float targetDist ); void PrescheduleThink( void ); void SetPlayerCriminalDuration( float time ); void IncrementPlayerCriminalStatus( void ); virtual bool UseAttackSquadSlots() { return true; } WeaponProficiency_t CalcWeaponProficiency( CBaseCombatWeapon *pWeapon ); // Inputs void InputEnableManhackToss( inputdata_t &inputdata ); void InputSetPoliceGoal( inputdata_t &inputdata ); void InputActivateBaton( inputdata_t &inputdata ); void NotifyDeadFriend ( CBaseEntity* pFriend ); // Stitch aiming! void AimBurstRandomly( int nMinCount, int nMaxCount, float flMinDelay, float flMaxDelay ); void AimBurstAtEnemy( float flReactionTime ); void AimBurstInFrontOfEnemy( float flReactionTime ); void AimBurstAlongSideOfEnemy( float flFollowTime ); void AimBurstBehindEnemy( float flFollowTime ); void AimBurstTightGrouping( float flShotTime ); // Anim event handlers void OnAnimEventDeployManhack( animevent_t *pEvent ); void OnAnimEventShove( void ); void OnAnimEventBatonOn( void ); void OnAnimEventBatonOff( void ); void OnAnimEventStartDeployManhack( void ); void OnAnimEventPreDeployManhack( void ); bool HasBaton( void ); // Normal schedule selection int SelectCombatSchedule(); int SelectScheduleNewEnemy(); int SelectScheduleArrestEnemy(); int SelectRangeAttackSchedule(); int SelectScheduleNoDirectEnemy(); int SelectScheduleInvestigateSound(); int SelectShoveSchedule( void ); bool TryToEnterPistolSlot( int nSquadSlot ); // Airboat schedule selection int SelectAirboatCombatSchedule(); int SelectAirboatRangeAttackSchedule(); // Handle flinching bool IsHeavyDamage( const CTakeDamageInfo &info ); // Is my enemy currently in an airboat? bool IsEnemyInAnAirboat() const; // Returns the airboat CBaseEntity *GetEnemyAirboat() const; // Compute a predicted enemy position n seconds into the future void PredictShootTargetPosition( float flDeltaTime, float flMinLeadDist, float flAddVelocity, Vector *pVecTarget, Vector *pVecTargetVel ); // Compute a predicted velocity n seconds into the future (given a known acceleration rate) void PredictShootTargetVelocity( float flDeltaTime, Vector *pVecTargetVel ); // How many shots will I fire in a particular amount of time? int CountShotsInTime( float flDeltaTime ) const; float GetTimeForShots( int nShotCount ) const; // Visualize stitch void VisualizeStitch( const Vector &vecStart, const Vector &vecEnd ); // Visualize line of death void VisualizeLineOfDeath( ); // Modify the stitch length float ComputeDistanceStitchModifier( float flDistanceToTarget ) const; // Adjusts the burst toward the target as it's being fired. void SteerBurstTowardTarget( ); // Methods to compute shot trajectory based on burst mode Vector ComputeBurstLockOnTrajectory( const Vector &shootOrigin ); Vector ComputeBurstDeliberatelyMissTrajectory( const Vector &shootOrigin ); Vector ComputeBurstTrajectory( const Vector &shootOrigin ); Vector ComputeTightBurstTrajectory( const Vector &shootOrigin ); // Are we currently firing a burst? bool IsCurrentlyFiringBurst() const; // Which entity are we actually trying to shoot at? CBaseEntity *GetShootTarget(); // Different burst steering modes void SteerBurstTowardTargetUseSpeedOnly( const Vector &vecShootAt, const Vector &vecShootAtVelocity, float flPredictTime, int nShotsTillPredict ); void SteerBurstTowardTargetUseVelocity( const Vector &vecShootAt, const Vector &vecShootAtVelocity, int nShotsTillPredict ); void SteerBurstTowardTargetUsePosition( const Vector &vecShootAt, const Vector &vecShootAtVelocity, int nShotsTillPredict ); void SteerBurstTowardPredictedPoint( const Vector &vecShootAt, const Vector &vecShootAtVelocity, int nShotsTillPredict ); void SteerBurstWithinLineOfDeath( ); // Set up the shot regulator int SetupBurstShotRegulator( float flReactionTime ); // Choose a random vector somewhere between the two specified vectors void RandomDirectionBetweenVectors( const Vector &vecStart, const Vector &vecEnd, Vector *pResult ); // Stitch selector float StitchAtWeight( float flDist, float flSpeed, float flDot, float flReactionTime, const Vector &vecTargetToGun ); float StitchAcrossWeight( float flDist, float flSpeed, float flDot, float flReactionTime ); float StitchAlongSideWeight( float flDist, float flSpeed, float flDot ); float StitchBehindWeight( float flDist, float flSpeed, float flDot ); float StitchTightWeight( float flDist, float flSpeed, const Vector &vecTargetToGun, const Vector &vecVelocity ); int SelectStitchSchedule(); // Can me enemy see me? bool CanEnemySeeMe( ); // Combat schedule selection int SelectMoveToLedgeSchedule(); // position to shoot at Vector StitchAimTarget( const Vector &posSrc, bool bNoisy ); // Should we attempt to stitch? bool ShouldAttemptToStitch(); // Deliberately aims as close as possible w/o hitting Vector AimCloseToTargetButMiss( CBaseEntity *pTarget, const Vector &shootOrigin ); // Compute the actual reaction time based on distance + speed modifiers float AimBurstAtReactionTime( float flReactonTime, float flDistToTargetSqr, float flCurrentSpeed ); int AimBurstAtSetupHitCount( float flDistToTargetSqr, float flCurrentSpeed ); // How many squad members are trying to arrest the player? int SquadArrestCount(); // He's resisting arrest! void EnemyResistingArrest(); void VPhysicsCollision( int index, gamevcollisionevent_t *pEvent ); // Rappel virtual bool IsWaitingToRappel( void ) { return m_RappelBehavior.IsWaitingToRappel(); } void BeginRappel() { m_RappelBehavior.BeginRappel(); } private: enum { BURST_NOT_ACTIVE = 0, BURST_ACTIVE, BURST_LOCK_ON_AFTER_HIT, BURST_LOCKED_ON, BURST_DELIBERATELY_MISS, BURST_TIGHT_GROUPING, }; enum { BURST_STEER_NONE = 0, BURST_STEER_TOWARD_PREDICTED_POINT, BURST_STEER_WITHIN_LINE_OF_DEATH, BURST_STEER_ADJUST_FOR_SPEED_CHANGES, BURST_STEER_EXACTLY_TOWARD_TARGET, }; enum { COND_METROPOLICE_ON_FIRE = BaseClass::NEXT_CONDITION, COND_METROPOLICE_ENEMY_RESISTING_ARREST, COND_METROPOLICE_PLAYER_TOO_CLOSE, COND_METROPOLICE_CHANGE_BATON_STATE, COND_METROPOLICE_PHYSOBJECT_ASSAULT, }; enum { SCHED_METROPOLICE_WALK = BaseClass::NEXT_SCHEDULE, SCHED_METROPOLICE_WAKE_ANGRY, SCHED_METROPOLICE_HARASS, SCHED_METROPOLICE_CHASE_ENEMY, SCHED_METROPOLICE_ESTABLISH_LINE_OF_FIRE, SCHED_METROPOLICE_DRAW_PISTOL, SCHED_METROPOLICE_DEPLOY_MANHACK, SCHED_METROPOLICE_ADVANCE, SCHED_METROPOLICE_CHARGE, SCHED_METROPOLICE_BURNING_RUN, SCHED_METROPOLICE_BURNING_STAND, SCHED_METROPOLICE_SMG_NORMAL_ATTACK, SCHED_METROPOLICE_SMG_BURST_ATTACK, SCHED_METROPOLICE_AIM_STITCH_AT_AIRBOAT, SCHED_METROPOLICE_AIM_STITCH_IN_FRONT_OF_AIRBOAT, SCHED_METROPOLICE_AIM_STITCH_TIGHTLY, SCHED_METROPOLICE_AIM_STITCH_ALONG_SIDE_OF_AIRBOAT, SCHED_METROPOLICE_AIM_STITCH_BEHIND_AIRBOAT, SCHED_METROPOLICE_ESTABLISH_STITCH_LINE_OF_FIRE, SCHED_METROPOLICE_INVESTIGATE_SOUND, SCHED_METROPOLICE_WARN_AND_ARREST_ENEMY, SCHED_METROPOLICE_ARREST_ENEMY, SCHED_METROPOLICE_ENEMY_RESISTING_ARREST, SCHED_METROPOLICE_WARN_TARGET, SCHED_METROPOLICE_HARASS_TARGET, SCHED_METROPOLICE_SUPPRESS_TARGET, SCHED_METROPOLICE_RETURN_FROM_HARASS, SCHED_METROPOLICE_SHOVE, SCHED_METROPOLICE_ACTIVATE_BATON, SCHED_METROPOLICE_DEACTIVATE_BATON, SCHED_METROPOLICE_ALERT_FACE_BESTSOUND, SCHED_METROPOLICE_RETURN_TO_PRECHASE, SCHED_METROPOLICE_SMASH_PROP, }; enum { TASK_METROPOLICE_HARASS = BaseClass::NEXT_TASK, TASK_METROPOLICE_DIE_INSTANTLY, TASK_METROPOLICE_BURST_ATTACK, TASK_METROPOLICE_STOP_FIRE_BURST, TASK_METROPOLICE_AIM_STITCH_AT_PLAYER, TASK_METROPOLICE_AIM_STITCH_AT_AIRBOAT, TASK_METROPOLICE_AIM_STITCH_TIGHTLY, TASK_METROPOLICE_AIM_STITCH_IN_FRONT_OF_AIRBOAT, TASK_METROPOLICE_AIM_STITCH_ALONG_SIDE_OF_AIRBOAT, TASK_METROPOLICE_AIM_STITCH_BEHIND_AIRBOAT, TASK_METROPOLICE_RELOAD_FOR_BURST, TASK_METROPOLICE_GET_PATH_TO_STITCH, TASK_METROPOLICE_RESET_LEDGE_CHECK_TIME, TASK_METROPOLICE_GET_PATH_TO_BESTSOUND_LOS, TASK_METROPOLICE_AIM_WEAPON_AT_ENEMY, TASK_METROPOLICE_ARREST_ENEMY, TASK_METROPOLICE_LEAD_ARREST_ENEMY, TASK_METROPOLICE_SIGNAL_FIRING_TIME, TASK_METROPOLICE_ACTIVATE_BATON, TASK_METROPOLICE_WAIT_FOR_SENTENCE, TASK_METROPOLICE_GET_PATH_TO_PRECHASE, TASK_METROPOLICE_CLEAR_PRECHASE, }; private: int m_iPistolClips; // How many clips the cop has in reserve int m_iManhacks; // How many manhacks the cop has bool m_fWeaponDrawn; // Is my weapon drawn? (ready to use) bool m_bSimpleCops; // The easy version of the cops int m_LastShootSlot; CRandSimTimer m_TimeYieldShootSlot; CSimpleSimTimer m_BatonSwingTimer; CSimpleSimTimer m_NextChargeTimer; // All related to burst firing Vector m_vecBurstTargetPos; Vector m_vecBurstDelta; int m_nBurstHits; int m_nMaxBurstHits; int m_nBurstReloadCount; Vector m_vecBurstLineOfDeathDelta; Vector m_vecBurstLineOfDeathOrigin; int m_nBurstMode; int m_nBurstSteerMode; float m_flBurstSteerDistance; float m_flBurstPredictTime; Vector m_vecBurstPredictedVelocityDir; float m_vecBurstPredictedSpeed; float m_flValidStitchTime; float m_flNextLedgeCheckTime; float m_flTaskCompletionTime; bool m_bShouldActivateBaton; float m_flBatonDebounceTime; // Minimum amount of time before turning the baton off float m_flLastPhysicsFlinchTime; float m_flLastDamageFlinchTime; // Sentences float m_flNextPainSoundTime; float m_flNextLostSoundTime; int m_nIdleChatterType; bool m_bPlayerIsNear; // Policing state bool m_bPlayerTooClose; bool m_bKeepFacingPlayer; float m_flChasePlayerTime; Vector m_vecPreChaseOrigin; float m_flPreChaseYaw; int m_nNumWarnings; int m_iNumPlayerHits; // Outputs COutputEvent m_OnStunnedPlayer; COutputEvent m_OnCupCopped; AIHANDLE m_hManhack; CHandle<CPhysicsProp> m_hBlockingProp; CAI_ActBusyBehavior m_ActBusyBehavior; CAI_StandoffBehavior m_StandoffBehavior; CAI_AssaultBehavior m_AssaultBehavior; CAI_FuncTankBehavior m_FuncTankBehavior; CAI_RappelBehavior m_RappelBehavior; CAI_PolicingBehavior m_PolicingBehavior; CAI_FollowBehavior m_FollowBehavior; CAI_Sentence< CNPC_MetroPolice > m_Sentences; int m_nRecentDamage; float m_flRecentDamageTime; // The last hit direction, measured as a yaw relative to our orientation float m_flLastHitYaw; static float gm_flTimeLastSpokePeek; public: DEFINE_CUSTOM_AI; }; #endif // NPC_METROPOLICE_H
{ "pile_set_name": "Github" }
/** * Copyright (C) 2008 Happy Fish / YuQing * * FastDFS may be copied only under the terms of the GNU General * Public License V3, which may be found in the FastDFS source kit. * Please visit the FastDFS Home Page http://www.fastken.com/ for more detail. **/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string.h> #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include "fdfs_client.h" #include "fastcommon/logger.h" int main(int argc, char *argv[]) { char *conf_filename; const char *file_type_str; char file_id[128]; int result; FDFSFileInfo file_info; if (argc < 3) { printf("Usage: %s <config_file> <file_id>\n", argv[0]); return 1; } log_init(); g_log_context.log_level = LOG_ERR; ignore_signal_pipe(); conf_filename = argv[1]; if ((result=fdfs_client_init(conf_filename)) != 0) { return result; } snprintf(file_id, sizeof(file_id), "%s", argv[2]); memset(&file_info, 0, sizeof(file_info)); result = fdfs_get_file_info_ex1(file_id, true, &file_info); if (result != 0) { fprintf(stderr, "query file info fail, " \ "error no: %d, error info: %s\n", \ result, STRERROR(result)); } else { char szDatetime[32]; switch (file_info.file_type) { case FDFS_FILE_TYPE_NORMAL: file_type_str = "normal"; break; case FDFS_FILE_TYPE_SLAVE: file_type_str = "slave"; break; case FDFS_FILE_TYPE_APPENDER: file_type_str = "appender"; break; default: file_type_str = "unkown"; break; } printf("GET FROM SERVER: %s\n\n", file_info.get_from_server ? "true" : "false"); printf("file type: %s\n", file_type_str); printf("source storage id: %d\n", file_info.source_id); printf("source ip address: %s\n", file_info.source_ip_addr); printf("file create timestamp: %s\n", formatDatetime( file_info.create_timestamp, "%Y-%m-%d %H:%M:%S", \ szDatetime, sizeof(szDatetime))); printf("file size: %"PRId64"\n", \ file_info.file_size); printf("file crc32: %d (0x%08x)\n", \ file_info.crc32, file_info.crc32); } tracker_close_all_connections(); fdfs_client_destroy(); return 0; }
{ "pile_set_name": "Github" }
/* ------------------------------------------------------------------------- * * GBK <--> UTF8 * * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION * src/backend/utils/mb/conversion_procs/utf8_and_gbk/utf8_and_gbk.c * * ------------------------------------------------------------------------- */ #include "postgres.h" #include "knl/knl_variable.h" #include "fmgr.h" #include "mb/pg_wchar.h" #include "../../Unicode/gbk_to_utf8.map" #include "../../Unicode/utf8_to_gbk.map" PG_MODULE_MAGIC; PG_FUNCTION_INFO_V1(gbk_to_utf8); PG_FUNCTION_INFO_V1(utf8_to_gbk); extern "C" Datum gbk_to_utf8(PG_FUNCTION_ARGS); extern "C" Datum utf8_to_gbk(PG_FUNCTION_ARGS); /* ---------- * conv_proc( * INTEGER, -- source encoding id * INTEGER, -- destination encoding id * CSTRING, -- source string (null terminated C string) * CSTRING, -- destination string (null terminated C string) * INTEGER -- source string length * ) returns VOID; * ---------- */ Datum gbk_to_utf8(PG_FUNCTION_ARGS) { unsigned char* src = (unsigned char*)PG_GETARG_CSTRING(2); unsigned char* dest = (unsigned char*)PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); CHECK_ENCODING_CONVERSION_ARGS(PG_GBK, PG_UTF8); LocalToUtf(src, dest, LUmapGBK, NULL, sizeof(LUmapGBK) / sizeof(pg_local_to_utf), 0, PG_GBK, len); PG_RETURN_VOID(); } Datum utf8_to_gbk(PG_FUNCTION_ARGS) { unsigned char* src = (unsigned char*)PG_GETARG_CSTRING(2); unsigned char* dest = (unsigned char*)PG_GETARG_CSTRING(3); int len = PG_GETARG_INT32(4); CHECK_ENCODING_CONVERSION_ARGS(PG_UTF8, PG_GBK); UtfToLocal(src, dest, ULmapGBK, NULL, sizeof(ULmapGBK) / sizeof(pg_utf_to_local), 0, PG_GBK, len); PG_RETURN_VOID(); }
{ "pile_set_name": "Github" }
# cookie [![Build Status](https://secure.travis-ci.org/shtylman/node-cookie.png?branch=master)](http://travis-ci.org/shtylman/node-cookie) # cookie is a basic cookie parser and serializer. It doesn't make assumptions about how you are going to deal with your cookies. It basically just provides a way to read and write the HTTP cookie headers. See [RFC6265](http://tools.ietf.org/html/rfc6265) for details about the http header for cookies. ## how? ``` npm install cookie ``` ```javascript var cookie = require('cookie'); var hdr = cookie.serialize('foo', 'bar'); // hdr = 'foo=bar'; var cookies = cookie.parse('foo=bar; cat=meow; dog=ruff'); // cookies = { foo: 'bar', cat: 'meow', dog: 'ruff' }; ``` ## more The serialize function takes a third parameter, an object, to set cookie options. See the RFC for valid values. ### path > cookie path ### expires > absolute expiration date for the cookie (Date object) ### maxAge > relative max age of the cookie from when the client receives it (seconds) ### domain > domain for the cookie ### secure > true or false ### httpOnly > true or false
{ "pile_set_name": "Github" }
#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-24' # This file 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. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see <https://www.gnu.org/licenses/>. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to <[email protected]>. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to <[email protected]>." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # ([email protected] 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval "$set_cc_for_build" cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" # If ldd exists, use it to detect musl libc. if command -v ldd >/dev/null && \ ldd --version 2>&1 | grep -q ^musl then LIBC=musl fi ;; esac # Note: order is significant - the case branches are not exclusive. case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) echo mips-dec-osf1 exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # [email protected] (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ [ "$TARGET_BINARY_INTERFACE"x = x ] then echo m88k-dg-dgux"$UNAME_RELEASE" else echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include <sys/systemcfg.h> main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/lslpp ] ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if [ "$HP_ARCH" = "" ]; then eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include <stdlib.h> #include <unistd.h> int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ "$HP_ARCH" = hppa2.0w ] then eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #include <unistd.h> int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) case "$UNAME_MACHINE" in x86) echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; i*:UWIN*:*) echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) eval "$set_cc_for_build" if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval "$set_cc_for_build" sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) if objdump -f /bin/sh | grep -q elf32-x86-64; then echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 else echo "$UNAME_MACHINE"-pc-linux-"$LIBC" fi exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL" elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <[email protected]> echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <[email protected]>. # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From [email protected]. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From [email protected]. echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From [email protected]. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-*:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; NSR-*:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk"$UNAME_RELEASE" exit ;; NSV-*:NONSTOP_KERNEL:*:*) echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; NSX-*:NONSTOP_KERNEL:*:*) echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac echo "$0: unable to guess system type" >&2 case "$UNAME_MACHINE:$UNAME_SYSTEM" in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <<EOF NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize the system type. Please install a C compiler and try again. EOF ;; esac cat >&2 <<EOF This script (version $timestamp), has failed to recognize the operating system you are using. If your script is old, overwrite *all* copies of config.guess and config.sub with the latest versions from: https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess and https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub If $0 has already been updated, send the following data and any information you think might be pertinent to [email protected] to provide the necessary information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End:
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 74dd879101fe4541a5b42619cf4f309c timeCreated: 1554344854
{ "pile_set_name": "Github" }
// Check that an onExceptionUnwind hook can force a frame to throw a different exception. load(libdir + "asserts.js"); var g = newGlobal(); var dbg = Debugger(g); dbg.onExceptionUnwind = function (frame, exc) { return { throw:"sproon" }; }; g.eval("function f() { throw 'ksnife'; }"); assertThrowsValue(g.f, "sproon");
{ "pile_set_name": "Github" }
using System; using Xamarin.Forms; using System.Globalization; namespace FormsToolkit { /// <summary> /// Inverted boolen converter. /// </summary> public class InvertedBooleanConverter : IValueConverter { /// <summary> /// Init this instance. /// </summary> public static void Init() { var time = DateTime.UtcNow; } /// <param name="value">To be added.</param> /// <param name="targetType">To be added.</param> /// <param name="parameter">To be added.</param> /// <param name="culture">To be added.</param> /// <summary> /// Convert the specified value, targetType, parameter and culture. /// </summary> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool) return !(bool)value; return value; } /// <param name="value">To be added.</param> /// <param name="targetType">To be added.</param> /// <param name="parameter">To be added.</param> /// <param name="culture">To be added.</param> /// <summary> /// Converts the back. /// </summary> /// <returns>The back.</returns> public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }
{ "pile_set_name": "Github" }
// Copyright 2016 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.9 go1.8.typealias package draw import ( "image/draw" ) // We use type aliases (new in Go 1.9) for the exported names from the standard // library's image/draw package. This is not merely syntactic sugar for // // type Drawer draw.Drawer // // as aliasing means that the types in this package, such as draw.Image and // draw.Op, are identical to the corresponding draw.Image and draw.Op types in // the standard library. In comparison, prior to Go 1.9, the code in go1_8.go // defines new types that mimic the old but are different types. // // The package documentation, in draw.go, explicitly gives the intent of this // package: // // This package is a superset of and a drop-in replacement for the // image/draw package in the standard library. // // Drop-in replacement means that I can replace all of my "image/draw" imports // with "golang.org/x/image/draw", to access additional features in this // package, and no further changes are required. That's mostly true, but not // completely true unless we use type aliases. // // Without type aliases, users might need to import both "image/draw" and // "golang.org/x/image/draw" in order to convert from two conceptually // equivalent but different (from the compiler's point of view) types, such as // from one draw.Op type to another draw.Op type, to satisfy some other // interface or function signature. // Drawer contains the Draw method. type Drawer = draw.Drawer // Image is an image.Image with a Set method to change a single pixel. type Image = draw.Image // Op is a Porter-Duff compositing operator. type Op = draw.Op const ( // Over specifies ``(src in mask) over dst''. Over Op = draw.Over // Src specifies ``src in mask''. Src Op = draw.Src ) // Quantizer produces a palette for an image. type Quantizer = draw.Quantizer
{ "pile_set_name": "Github" }
{{extend "layout.html"}} <div class='row home-top' style='margin-top:20px'> <div class='small-12 columns'> {{try:}}{{=form}}{{except:}}{{pass}} </div> </div>
{ "pile_set_name": "Github" }
import * as userSettings from 'userSettings'; import loading from 'loading'; import focusManager from 'focusManager'; import homeSections from 'homeSections'; import 'emby-itemscontainer'; class HomeTab { constructor(view, params) { this.view = view; this.params = params; this.apiClient = window.connectionManager.currentApiClient(); this.sectionsContainer = view.querySelector('.sections'); view.querySelector('.sections').addEventListener('settingschange', onHomeScreenSettingsChanged.bind(this)); } onResume(options) { if (this.sectionsRendered) { const sectionsContainer = this.sectionsContainer; if (sectionsContainer) { return homeSections.resume(sectionsContainer, options); } return Promise.resolve(); } loading.show(); const view = this.view; const apiClient = this.apiClient; this.destroyHomeSections(); this.sectionsRendered = true; return apiClient.getCurrentUser().then(function (user) { return homeSections.loadSections(view.querySelector('.sections'), apiClient, user, userSettings).then(function () { if (options.autoFocus) { focusManager.autoFocus(view); } loading.hide(); }); }); } onPause() { const sectionsContainer = this.sectionsContainer; if (sectionsContainer) { homeSections.pause(sectionsContainer); } } destroy() { this.view = null; this.params = null; this.apiClient = null; this.destroyHomeSections(); this.sectionsContainer = null; } destroyHomeSections() { const sectionsContainer = this.sectionsContainer; if (sectionsContainer) { homeSections.destroySections(sectionsContainer); } } } function onHomeScreenSettingsChanged() { this.sectionsRendered = false; if (!this.paused) { this.onResume({ refresh: true }); } } export default HomeTab;
{ "pile_set_name": "Github" }
package org.cocos2d.nodes; import javax.microedition.khronos.opengles.GL10; import org.cocos2d.config.ccConfig; import org.cocos2d.opengl.CCTexture2D; import org.cocos2d.opengl.CCTextureAtlas; import org.cocos2d.protocols.CCRGBAProtocol; import org.cocos2d.protocols.CCTextureProtocol; import org.cocos2d.types.CGSize; import org.cocos2d.types.ccBlendFunc; import org.cocos2d.types.ccColor3B; /** * AtlasNode is a subclass of CocosNode that implements CocosNodeOpacity, CocosNodeRGB and * CocosNodeSize protocols. * <p/> * It knows how to render a TextureAtlas object. * <p/> * All features from CocosNode are valid, plus the following features: * - opacity * - color (setRGB:::) * - contentSize */ /** CCAtlasNode is a subclass of CCNode that implements the CCRGBAProtocol and CCTextureProtocol protocol It knows how to render a TextureAtlas object. If you are going to render a TextureAtlas consider subclassing CCAtlasNode (or a subclass of CCAtlasNode) All features from CCNode are valid, plus the following features: - opacity and RGB colors */ public abstract class CCAtlasNode extends CCNode implements CCRGBAProtocol, CCTextureProtocol { /// texture atlas protected CCTextureAtlas textureAtlas_; /// chars per row protected int itemsPerRow; /// chars per column protected int itemsPerColumn; /// texture coordinate x increment protected float texStepX; /// texture coordinate y increment protected float texStepY; /// width of each char protected int itemWidth; /// height of each char protected int itemHeight; // blend function ccBlendFunc blendFunc_; // texture RGBA int opacity_; ccColor3B color_; ccColor3B colorUnmodified_; boolean opacityModifyRGB_; /** initializes an CCAtlasNode with an Atlas file the width and height of each item and the quantity of items to render*/ protected CCAtlasNode(String tile, int w, int h, int c) { super(); itemWidth = w; itemHeight = h; opacity_ = 255; color_ = ccColor3B.ccWHITE; colorUnmodified_ = ccColor3B.ccWHITE; opacityModifyRGB_ = true; blendFunc_ = new ccBlendFunc(ccConfig.CC_BLEND_SRC, ccConfig.CC_BLEND_DST); textureAtlas_ = new CCTextureAtlas(tile, c); updateBlendFunc(); updateOpacityModifyRGB(); calculateMaxItems(); calculateTexCoordsSteps(); } private void calculateMaxItems() { CGSize s = textureAtlas_.getTexture().getContentSize(); itemsPerColumn = (int) (s.height / itemHeight); itemsPerRow = (int) (s.width / itemWidth); } private void calculateTexCoordsSteps() { CCTexture2D tex = textureAtlas_.getTexture(); texStepX = itemWidth / (float) tex.pixelsWide(); texStepY = itemHeight / (float) tex.pixelsHigh(); } /** updates the Atlas (indexed vertex array). * Shall be overriden in subclasses */ public abstract void updateAtlasValues(); @Override public void draw(GL10 gl) { // Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY // Needed states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_TEXTURE_COORD_ARRAY // Unneeded states: GL_COLOR_ARRAY gl.glDisableClientState(GL10.GL_COLOR_ARRAY); gl.glColor4f(color_.r / 255f, color_.g / 255f, color_.b / 255f, opacity_ / 255f); boolean newBlend = false; if (blendFunc_.src != ccConfig.CC_BLEND_SRC || blendFunc_.dst != ccConfig.CC_BLEND_DST) { newBlend = true; gl.glBlendFunc(blendFunc_.src, blendFunc_.dst); } textureAtlas_.drawQuads(gl); if (newBlend) gl.glBlendFunc(ccConfig.CC_BLEND_SRC, ccConfig.CC_BLEND_DST); // is this chepear than saving/restoring color state ? // XXX: There is no need to restore the color to (255,255,255,255). Objects should use the color // XXX: that they need // glColor4ub( 255, 255, 255, 255); // restore default GL state gl.glEnableClientState(GL10.GL_COLOR_ARRAY); } /** conforms to CCRGBAProtocol protocol */ public void setOpacity(int opacity) { opacity_ = opacity; // special opacity for premultiplied textures if (opacityModifyRGB_) { setColor(opacityModifyRGB_? colorUnmodified_ : color_); } } public int getOpacity() { return opacity_; } /** conforms to CCRGBAProtocol protocol */ public void setColor(ccColor3B color) { color_ = new ccColor3B(color); colorUnmodified_ = new ccColor3B(color); if( opacityModifyRGB_ ){ color_.r = color.r * opacity_/255; color_.g = color.g * opacity_/255; color_.b = color.b * opacity_/255; } } public ccColor3B getColor() { if (opacityModifyRGB_) { return new ccColor3B(colorUnmodified_); } return new ccColor3B(color_); } // CocosNodeTexture protocol /** conforms to CCTextureProtocol protocol */ public void updateBlendFunc() { if( ! (textureAtlas_.getTexture().hasPremultipliedAlpha() )) { blendFunc_.src = GL10.GL_SRC_ALPHA; blendFunc_.dst = GL10.GL_ONE_MINUS_SRC_ALPHA; } } /** conforms to CCTextureProtocol protocol */ public void setTexture(CCTexture2D texture) { textureAtlas_.setTexture(texture); updateBlendFunc(); updateOpacityModifyRGB(); } public CCTexture2D getTexture() { return textureAtlas_.getTexture(); } public void setOpacityModifyRGB(boolean modify) { opacityModifyRGB_ = modify; } public boolean doesOpacityModifyRGB() { return opacityModifyRGB_; } public void updateOpacityModifyRGB() { opacityModifyRGB_ = textureAtlas_.getTexture().hasPremultipliedAlpha(); } }
{ "pile_set_name": "Github" }
#pragma once #include "Scenes/Platformer/Inventory/Items/Equipment/Gear/Rings/Ring.h" class EmeraldBand : public Ring { public: static EmeraldBand* create(); Item* clone() override; std::string getItemName() override; LocalizedString* getString() override; std::string getIconResource() override; std::string getSerializationKey() override; static const std::string SaveKey; protected: EmeraldBand(); virtual ~EmeraldBand(); private: typedef Ring super; };
{ "pile_set_name": "Github" }
<!DOCTYPE html> <html data-require="math"> <head> <title>Sorting Comparsion Question</title> <script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.14/require.min.js"></script> <script src="../../khan-exercises/local-only/main.js" ></script> </head> <body> <div class="exercise"> <div class="problems"> <div id="CompareTF5p"> <p class="problem">Answer TRUE or FALSE. <p class="question">In order to be able to sort, the key values must define a total order</p> <div class="solution">True</div> <ul class="choices" data-category="true"> <li>True</li> <li>False</li> </ul> <div class="hints"> <p>Sorting relies on comparisons.</p> <p>We need to be able to compare any two records and tell which one is less than the other.</p> <p>This is the essence of a total order.</p> </div> </div> </div> </div> </body> </html>
{ "pile_set_name": "Github" }
package com.wefika.calendar.manager; import org.joda.time.DateTimeConstants; import org.joda.time.LocalDate; import org.junit.Before; import org.junit.Test; import java.util.List; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; public class MonthTest { LocalDate mToday; Month mMonth; @Before public void setUp() throws Exception { mToday = LocalDate.parse("2014-10-08"); mMonth = new Month(mToday, mToday, null, null); } @Test public void testHasNextNull() throws Exception { assertTrue(mMonth.hasNext()); } @Test public void testHasNextFalse() throws Exception { LocalDate max = LocalDate.parse("2014-10-31"); Month week = new Month(mToday, mToday, null, max); assertFalse(week.hasNext()); } @Test public void testHasNextTrue() throws Exception { LocalDate max = LocalDate.parse("2014-11-01"); Month week = new Month(mToday, mToday, null, max); assertTrue(week.hasNext()); } @Test public void testHasNextYear() throws Exception { LocalDate max = LocalDate.parse("2015-10-08"); Month week = new Month(mToday, mToday, null, max); assertTrue(week.hasNext()); } @Test public void testHasPrevNull() throws Exception { assertTrue(mMonth.hasPrev()); } @Test public void testHasPreFalse() throws Exception { LocalDate min = LocalDate.parse("2014-10-01"); Month week = new Month(mToday, mToday, min, null); assertFalse(week.hasPrev()); } @Test public void testHasPrevTrue() throws Exception { LocalDate min = LocalDate.parse("2014-09-30"); Month week = new Month(mToday, mToday, min, null); assertTrue(week.hasPrev()); } @Test public void testHasPrevYear() throws Exception { LocalDate min = LocalDate.parse("2013-10-08"); Month week = new Month(mToday, mToday, min, null); assertTrue(week.hasPrev()); } @Test public void testNextFalse() throws Exception { Month month = new Month(mToday, mToday, null, mToday); assertFalse(month.next()); assertEquals(LocalDate.parse("2014-10-01"), month.getFrom()); assertEquals(LocalDate.parse("2014-10-31"), month.getTo()); } @Test public void testNext() throws Exception { assertTrue(mMonth.next()); assertEquals(LocalDate.parse("2014-11-01"), mMonth.getFrom()); assertEquals(LocalDate.parse("2014-11-30"), mMonth.getTo()); assertEquals(LocalDate.parse("2014-10-27"), mMonth.getWeeks().get(0).getFrom()); } @Test public void testPrevFalse() throws Exception { Month month = new Month(mToday, mToday, mToday, null); assertFalse(month.prev()); assertEquals(LocalDate.parse("2014-10-01"), month.getFrom()); assertEquals(LocalDate.parse("2014-10-31"), month.getTo()); assertEquals(LocalDate.parse("2014-09-29"), month.getWeeks().get(0).getFrom()); } @Test public void testPrev() throws Exception { assertTrue(mMonth.prev()); assertEquals(LocalDate.parse("2014-09-01"), mMonth.getFrom()); assertEquals(LocalDate.parse("2014-09-30"), mMonth.getTo()); assertEquals(LocalDate.parse("2014-09-01"), mMonth.getWeeks().get(0).getFrom()); } @Test public void testDeselectNull() throws Exception { mMonth.deselect(null); assertFalse(mMonth.isSelected()); } @Test public void testDeselectNotSelected() throws Exception { mMonth.deselect(mToday); assertFalse(mMonth.isSelected()); } @Test public void testDeselectNotIn() throws Exception { mMonth.select(mToday); mMonth.deselect(LocalDate.parse("2014-09-13")); assertTrue(mMonth.isSelected()); List<Week> weeks = mMonth.getWeeks(); for (int i = 0; i < weeks.size(); i++) { Week week = weeks.get(i); if (i == 1) { assertTrue(week.isSelected()); } else { assertFalse(week.isSelected()); } } } @Test public void testDeselect() throws Exception { mMonth.select(mToday); mMonth.deselect(mToday); assertFalse(mMonth.isSelected()); List<Week> weeks = mMonth.getWeeks(); for (int i = 0; i < weeks.size(); i++) { Week week = weeks.get(i); assertFalse(week.isSelected()); } } @Test public void testDeselectNotInWeek() throws Exception { mMonth.select(mToday); mMonth.deselect(LocalDate.parse("2014-10-13")); assertTrue(mMonth.isSelected()); List<Week> weeks = mMonth.getWeeks(); for (int i = 0; i < weeks.size(); i++) { Week week = weeks.get(i); if (i == 1) { assertTrue(week.isSelected()); } else { assertFalse(week.isSelected()); } } } @Test public void testSelectNull() throws Exception { assertFalse(mMonth.select(null)); assertFalse(mMonth.isSelected()); } @Test public void testSelectNotIn() throws Exception { assertFalse(mMonth.select(LocalDate.parse("2014-09-13"))); assertFalse(mMonth.isSelected()); for (Week week : mMonth.getWeeks()) { assertFalse(week.isSelected()); } } @Test public void testSelect() throws Exception { assertTrue(mMonth.select(mToday)); assertTrue(mMonth.isSelected()); List<Week> weeks = mMonth.getWeeks(); for (int i = 0; i < weeks.size(); i++) { Week week = weeks.get(i); if (i == 1) { assertTrue(week.isSelected()); } else { assertFalse(week.isSelected()); } } } @Test public void testGetSelectedIndexUnselected() throws Exception { assertEquals(-1, mMonth.getSelectedIndex()); } @Test public void testGetSelectedIndexDeselect() throws Exception { mMonth.select(mToday); mMonth.deselect(mToday); assertEquals(-1, mMonth.getSelectedIndex()); } @Test public void testGetSelectedIndex() throws Exception { mMonth.select(mToday); assertEquals(1, mMonth.getSelectedIndex()); } @Test public void testBuild() throws Exception { mMonth.build(); List<Week> weeks = mMonth.getWeeks(); LocalDate base = LocalDate.parse("2014-09-29"); assertEquals(5, weeks.size()); for (int i = 0; i < weeks.size(); i++) { assertEquals(base.plusWeeks(i), weeks.get(i).getFrom()); assertEquals(base.plusWeeks(i).withDayOfWeek(DateTimeConstants.SUNDAY), weeks.get(i).getTo()); } } @Test public void testGetFirstDayOfCurrentMonthNull() throws Exception { assertNull(mMonth.getFirstDateOfCurrentMonth(null)); } @Test public void testGetFirstDayOfCurrentMonthNotIn() throws Exception { assertNull(mMonth.getFirstDateOfCurrentMonth(LocalDate.parse("2014-09-30"))); } @Test public void testGetFirstDayOfCurrentMonthNotInYear() throws Exception { assertNull(mMonth.getFirstDateOfCurrentMonth(LocalDate.parse("2015-10-13"))); } @Test public void testGetFirstDateOfCurrentMonth() throws Exception { assertEquals(LocalDate.parse("2014-10-01"), mMonth.getFirstDateOfCurrentMonth(mToday)); } }
{ "pile_set_name": "Github" }
/*! recurrence editor theme wise definitions*/ /*! Recurrence-Editor component layout */ .e-recurrenceeditor .e-editor { display: -ms-flexbox; display: flex; -ms-flex-flow: row wrap; flex-flow: row wrap; margin-left: auto; margin-right: auto; max-width: 1240px; } .e-recurrenceeditor .e-recurrence-table { table-layout: fixed; width: 100%; } .e-recurrenceeditor .e-recurrence-table.e-repeat-content-wrapper td:last-child { width: 27%; } .e-recurrenceeditor .e-recurrence-table.e-month-expand-wrapper td:first-child { width: 24%; } .e-recurrenceeditor .e-recurrence-table .e-repeat-content { display: inline-block; font-weight: normal; padding: 18px 0 0 8px; } .e-recurrenceeditor .e-recurrence-table .e-input-wrapper { float: none; width: 100%; } .e-recurrenceeditor .e-recurrence-table .e-week-position { position: relative; right: 16px; } .e-recurrenceeditor .e-recurrence-table .e-monthday-element { padding-left: 10px; } .e-recurrenceeditor .e-icons { height: 0; } .e-recurrenceeditor .e-input-wrapper-side.e-form-left { padding: 0 8px 10px 0; } .e-recurrenceeditor .e-form-left { padding: 0 8px 16px 0; } .e-recurrenceeditor .e-form-right, .e-recurrenceeditor .e-input-wrapper-side.e-form-right { padding: 0 0 10px 8px; } .e-recurrenceeditor .e-input-wrapper { float: left; width: 50%; } .e-recurrenceeditor .e-input-wrapper div { margin-bottom: 2.5%; } .e-recurrenceeditor .e-input-wrapper.e-end-on-date, .e-recurrenceeditor .e-input-wrapper.e-end-on-count { padding-right: 0; } .e-recurrenceeditor.e-rtl .e-end-on > div, .e-recurrenceeditor.e-rtl .e-month-expander > div > div { float: right; } .e-recurrenceeditor.e-rtl .e-form-left, .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-form-left { padding: 0 0 10px 8px; } .e-recurrenceeditor.e-rtl .e-form-right, .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-form-right { padding: 0 8px 10px 0; } .e-recurrenceeditor.e-rtl .e-recurrence-table .e-monthday-element { padding-left: 0; } .e-recurrenceeditor.e-rtl .e-week-position { padding-left: 16px; right: 0; } .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-end-on .e-end-on-label, .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-non-week > .e-month-expander-label { padding-right: 0; } .e-recurrenceeditor.e-rtl .e-end-on-label { margin-bottom: 5px; } .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-end-on .e-end-on-left { padding-left: 8px; padding-right: 0; } .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-date, .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-count { padding-left: 0; padding-right: 8px; } .e-recurrenceeditor.e-rtl .e-recurrenceeditor .e-recurrence-table.e-month-expand-wrapper td:first-child { width: 0; } .e-recurrenceeditor .e-days .e-week-expander-label { font-size: 12px; font-weight: bold; margin-bottom: 8px; } .e-recurrenceeditor .e-days button { border-radius: 50%; -ms-flex-flow: row wrap; flex-flow: row wrap; height: 35px; margin: 0 8px 10px; width: 35px; } .e-recurrenceeditor .e-hide-recurrence-element { display: none; } .e-recurrenceeditor .e-half-space { width: 20%; } .e-recurrenceeditor .e-year-expander { margin-bottom: 11px; } .e-recurrenceeditor .e-month-expander tr:first-child .e-input-wrapper { margin-bottom: 11px; } .e-recurrenceeditor .e-month-expander-checkbox-wrapper.e-input-wrapper { margin-top: -3px; } .e-recurrenceeditor .e-input-wrapper-side { float: left; padding: 16px 20px 0; width: 50%; } .e-recurrenceeditor .e-input-wrapper-side.e-end-on .e-end-on-label { float: none; font-size: 12px; font-weight: bold; margin-bottom: 7px; padding-right: 16px; } .e-recurrenceeditor .e-input-wrapper-side.e-end-on .e-end-on-left { padding-right: 16px; } .e-recurrenceeditor .e-input-wrapper-side.e-non-week > .e-input-wrapper { margin: 0; } .e-recurrenceeditor .e-input-wrapper-side.e-non-week > .e-month-expander-label { font-size: 12px; font-weight: bold; margin-bottom: 7px; padding-right: 16px; } .e-recurrenceeditor .e-input-wrapper-side .e-days .e-form-left { padding-bottom: 6px; } .e-recurrenceeditor .e-input-wrapper-side .e-non-week .e-form-left { padding-bottom: 12px; } .e-recurrenceeditor .e-input-wrapper-side.e-form-right { margin-bottom: 11px; } .e-bigger .e-recurrenceeditor { padding: 0; } .e-bigger .e-recurrenceeditor .e-input-wrapper-side.e-form-left { padding: 0 12px 11px 0; } .e-bigger .e-recurrenceeditor .e-form-left { padding: 0 12px 14px 0; } .e-bigger .e-recurrenceeditor .e-form-right, .e-bigger .e-recurrenceeditor .e-input-wrapper-side.e-form-right { padding: 0 0 10px 12px; } .e-bigger .e-recurrenceeditor .e-recurrence-table .e-week-position { right: 24px; } .e-bigger .e-recurrenceeditor .e-input-wrapper-side .e-days .e-form-left { padding-bottom: 6px; } .e-bigger .e-recurrenceeditor .e-recurrence-table .e-monthday-element { padding-left: 70px; } .e-bigger .e-recurrenceeditor .e-week-position { padding-left: 55px; padding-right: 0; } .e-bigger .e-recurrenceeditor .e-input-wrapper-side.e-non-week > .e-month-expander-label { font-size: 12px; margin-bottom: 0; } .e-bigger .e-recurrenceeditor .e-end-on-label { margin-bottom: 0; } .e-bigger .e-recurrenceeditor .e-days .e-week-expander-label { font-size: 12px; margin-bottom: 8px; } .e-bigger .e-recurrenceeditor .e-input-wrapper-side .e-non-week .e-form-left { padding-bottom: 12px; } .e-bigger .e-recurrenceeditor .e-input-wrapper-side.e-end-on .e-end-on-label { font-size: 12px; margin-bottom: 1px; } .e-bigger .e-recurrenceeditor .e-month-expander tr:first-child .e-input-wrapper, .e-bigger .e-recurrenceeditor .e-year-expander, .e-bigger .e-recurrenceeditor .e-input-wrapper-side.e-form-right { margin-bottom: 11px; } .e-bigger .e-recurrenceeditor .e-recurrence-table.e-month-expand-wrapper td:first-child { width: 0; } .e-bigger .e-recurrenceeditor .e-days button { height: 40px; width: 40px; } .e-bigger .e-recurrenceeditor.e-rtl .e-form-left, .e-bigger .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-form-left { padding: 0 0 10px 12px; } .e-bigger .e-recurrenceeditor.e-rtl .e-form-right, .e-bigger .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-form-right { padding: 0 12px 10px 0; } .e-bigger .e-recurrenceeditor.e-rtl .e-recurrence-table .e-monthday-element { padding-left: 0; padding-right: 64px; } .e-bigger .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-end-on .e-end-on-label, .e-bigger .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-non-week > .e-month-expander-label { padding-right: 0; } .e-bigger .e-recurrenceeditor.e-rtl .e-end-on-label { margin-bottom: 5px; } .e-bigger .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-end-on .e-end-on-left { padding-left: 12px; padding-right: 0; } .e-bigger .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-date, .e-bigger .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-count { padding-left: 0; padding-right: 12px; } .e-bigger .e-recurrenceeditor.e-rtl .e-recurrence-table .e-week-position { right: 33px; } .e-bigger .e-recurrenceeditor.e-rtl .e-week-position { padding-left: 46px; } .e-device .e-recurrenceeditor .e-recurrence-table.e-repeat-content-wrapper td:last-child { width: 25%; } .e-device .e-recurrenceeditor .e-recurrence-table.e-month-expand-wrapper td:first-child { width: 20%; } .e-device .e-recurrenceeditor .e-week-expander-label { margin-bottom: 6px; } .e-device .e-recurrenceeditor .e-month-expander-label { font-size: 12px; margin-bottom: 5px; } .e-device .e-recurrenceeditor .e-footer-content { padding: 12px; } .e-device .e-recurrenceeditor .e-form-left, .e-device .e-recurrenceeditor .e-input-wrapper-side.e-form-left { padding: 0 3px 10px 0; } .e-device .e-recurrenceeditor .e-form-right, .e-device .e-recurrenceeditor .e-input-wrapper-side.e-form-right { padding: 0 0 10px 3px; } .e-device .e-recurrenceeditor .e-input-wrapper.e-end-on-date, .e-device .e-recurrenceeditor .e-input-wrapper.e-end-on-count { padding-left: 10px; padding-right: 0; } .e-device .e-recurrenceeditor .e-input-wrapper-side.e-end-on .e-end-on-left { padding-right: 10px; } .e-device .e-recurrenceeditor.e-end-on { padding-right: 0; } .e-device .e-recurrenceeditor.e-end-on .e-end-on-label { float: none; font-size: 12px; font-weight: bold; margin-bottom: 7px; } .e-device .e-recurrenceeditor.e-end-on .e-end-on-left { padding-right: 0; } .e-device .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-end-on .e-end-on-left { padding-right: 0; } .e-device .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-date, .e-device .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-count { padding-left: 0; padding-right: 10px; } .e-device .e-recurrenceeditor.e-rtl .e-recurrence-table .e-monthday-element { padding-left: 0; } .e-device .e-recurrenceeditor.e-rtl .e-week-position { padding-left: 16px; padding-right: 0; } .e-device .e-recurrenceeditor .e-recurrence-table .e-monthday-element { padding-left: 20px; } .e-device .e-recurrenceeditor .e-week-position { padding-left: 0; padding-right: 0; } .e-device .e-recurrenceeditor .e-week-position { padding-left: 0; } .e-device.e-recurrence-dialog .e-dlg-header-content { background: none; box-shadow: none; padding-bottom: 10px; } .e-device.e-recurrence-dialog .e-editor .e-input-wrapper-side.e-end-on .e-end-on-label { margin-bottom: 7px; } .e-device.e-recurrence-dialog .e-footer-content { padding: 16px 8px; } @media (max-width: 580px) { .e-recurrenceeditor { margin-left: auto; margin-right: auto; width: 100%; } .e-recurrenceeditor .e-editor { -ms-flex-direction: column; flex-direction: column; } .e-recurrenceeditor .e-editor > .e-input-wrapper.e-form-left { margin-top: 0; } .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-non-week > .e-month-expander-label, .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-end-on .e-end-on-label { margin-bottom: 7px; } .e-recurrenceeditor .e-editor > div { margin-top: 20px; } .e-recurrenceeditor .e-editor > .e-input-wrapper { width: 100%; } .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-end-on { width: 100%; } .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-end-on .e-input-wrapper { width: 50%; } .e-recurrenceeditor .e-editor .e-form-left, .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-form-left { padding: 0 0 10px; } .e-recurrenceeditor .e-editor .e-input-wrapper.e-end-on-date, .e-recurrenceeditor .e-editor .e-input-wrapper.e-end-on-count { padding-left: 10px; padding-right: 0; } .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-end-on .e-end-on-left { padding-right: 10px; } .e-recurrenceeditor .e-editor .e-form-right, .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-form-right { padding-left: 0; } .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-days { width: 100%; } .e-recurrenceeditor .e-editor .e-input-wrapper-side.e-non-week { width: 100%; } .e-recurrenceeditor.e-rtl .e-input-wrapper-side.e-end-on .e-end-on-left { padding-right: 0; } .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-date, .e-recurrenceeditor.e-rtl .e-input-wrapper.e-end-on-count { padding-left: 0; padding-right: 10px; } } /*! Recurrence-Editor component theme */
{ "pile_set_name": "Github" }
/***************************************************//** * @file OBPReadSpectrumExchange.cpp * @date January 2011 * @author Ocean Optics, Inc. * * LICENSE: * * SeaBreeze Copyright (C) 2014, Ocean Optics Inc * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject * to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *******************************************************/ #include "common/globals.h" #include "vendors/OceanOptics/protocols/obp/exchanges/OBPReadSpectrumExchange.h" #include "vendors/OceanOptics/protocols/obp/hints/OBPSpectrumHint.h" #include "vendors/OceanOptics/protocols/obp/constants/OBPMessageTypes.h" #include "vendors/OceanOptics/protocols/obp/exchanges/OBPMessage.h" #include "common/UShortVector.h" #include "common/ByteVector.h" using namespace seabreeze; using namespace seabreeze::oceanBinaryProtocol; using namespace std; OBPReadSpectrumExchange::OBPReadSpectrumExchange( unsigned int readoutLength, unsigned int numPixels) : OBPReadRawSpectrumExchange(readoutLength, numPixels) { } OBPReadSpectrumExchange::~OBPReadSpectrumExchange() { } Data *OBPReadSpectrumExchange::transfer(TransferHelper *helper) { Data *xfer; byte lsb; byte msb; /* This will use the superclass to transfer data from the device, and will * then strip off the message header and footer so that only the * pixel data remains. */ xfer = OBPReadRawSpectrumExchange::transfer(helper); if(NULL == xfer) { string error("Expected Transfer::transfer to produce a non-null result " "containing raw spectral data. Without this data, it is not " "possible to generate a valid formatted spectrum."); throw ProtocolException(error); } /* xfer should contain a ByteVector */ /* Extract the pixel data from the byte vector */ ByteVector *bv = static_cast<ByteVector *>(xfer); vector<byte> bytes = bv->getByteVector(); vector<unsigned short> formatted(this->numberOfPixels); for(unsigned int i = 0; i < this->numberOfPixels; i++) { lsb = bytes[i * 2]; msb = bytes[(i * 2) + 1]; formatted[i] = ((msb & 0x00FF) << 8) | (lsb & 0x00FF); } delete xfer; /* Equivalent to deleting bv and bytes */ UShortVector *retval = new UShortVector(formatted); return retval; }
{ "pile_set_name": "Github" }
/* Copyright (c) 2019 Rick (rick 'at' gibbed 'dot' us) * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would * be appreciated but is not required. * * 2. Altered source versions must be plainly marked as such, and must not * be misrepresented as being the original software. * * 3. This notice may not be removed or altered from any source * distribution. */ using System; using System.Runtime.InteropServices; namespace SAM.API { [StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)] internal struct NativeClass { public IntPtr VirtualTable; } }
{ "pile_set_name": "Github" }
/* Copyright (c) 2013-2014 Jeffrey Pfau * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <mgba-util/memory.h> #include <mgba-util/vector.h> #ifdef _WIN32 #include <windows.h> #elif defined(GEKKO) || defined(__CELLOS_LV2__) || defined(_3DS) || defined(__SWITCH__) /* stub */ #elif defined(VITA) #include <psp2/kernel/sysmem.h> #include <psp2/types.h> DECLARE_VECTOR(SceUIDList, SceUID); DEFINE_VECTOR(SceUIDList, SceUID); static struct SceUIDList uids; static bool listInit = false; #else #include <sys/mman.h> #ifndef MAP_ANONYMOUS #define MAP_ANONYMOUS 0x20 #endif #ifndef MAP_ANON #define MAP_ANON MAP_ANONYMOUS #endif #endif void* anonymousMemoryMap(size_t size) { #ifdef _WIN32 return VirtualAlloc(NULL, size, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE); #elif defined(__CELLOS_LV2__) || defined(GEKKO) || defined(_3DS) || defined(__SWITCH__) return (void*)malloc(size); #elif defined(VITA) if (!listInit) SceUIDListInit(&uids, 8); if (size & 0xFFF) { // Align to 4kB pages size += ((~size) & 0xFFF) + 1; } SceUID memblock = sceKernelAllocMemBlock("anon", SCE_KERNEL_MEMBLOCK_TYPE_USER_RW, size, 0); if (memblock < 0) return 0; *SceUIDListAppend(&uids) = memblock; void* ptr; if (sceKernelGetMemBlockBase(memblock, &ptr) < 0) return 0; return ptr; #else return mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); #endif } void mappedMemoryFree(void* memory, size_t size) { UNUSED(size); #ifdef _WIN32 // size is not useful here because we're freeing the memory, not decommitting it VirtualFree(memory, 0, MEM_RELEASE); #elif defined(__CELLOS_LV2__) || defined(GEKKO) || defined(_3DS) || defined(__SWITCH__) free(memory); #elif defined(VITA) UNUSED(size); size_t i; for (i = 0; i < SceUIDListSize(&uids); ++i) { SceUID uid = *SceUIDListGetPointer(&uids, i); void* ptr; if (sceKernelGetMemBlockBase(uid, &ptr) < 0) continue; if (ptr == memory) { sceKernelFreeMemBlock(uid); SceUIDListUnshift(&uids, i, 1); return; } } #else munmap(memory, size); #endif }
{ "pile_set_name": "Github" }
// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build arm64,linux package unix const ( SizeofPtr = 0x8 SizeofLong = 0x8 ) type ( _C_long int64 ) type Timespec struct { Sec int64 Nsec int64 } type Timeval struct { Sec int64 Usec int64 } type Timex struct { Modes uint32 Offset int64 Freq int64 Maxerror int64 Esterror int64 Status int32 Constant int64 Precision int64 Tolerance int64 Time Timeval Tick int64 Ppsfreq int64 Jitter int64 Shift int32 Stabil int64 Jitcnt int64 Calcnt int64 Errcnt int64 Stbcnt int64 Tai int32 _ [44]byte } type Time_t int64 type Tms struct { Utime int64 Stime int64 Cutime int64 Cstime int64 } type Utimbuf struct { Actime int64 Modtime int64 } type Rusage struct { Utime Timeval Stime Timeval Maxrss int64 Ixrss int64 Idrss int64 Isrss int64 Minflt int64 Majflt int64 Nswap int64 Inblock int64 Oublock int64 Msgsnd int64 Msgrcv int64 Nsignals int64 Nvcsw int64 Nivcsw int64 } type Stat_t struct { Dev uint64 Ino uint64 Mode uint32 Nlink uint32 Uid uint32 Gid uint32 Rdev uint64 _ uint64 Size int64 Blksize int32 _ int32 Blocks int64 Atim Timespec Mtim Timespec Ctim Timespec _ [2]int32 } type Dirent struct { Ino uint64 Off int64 Reclen uint16 Type uint8 Name [256]int8 _ [5]byte } type Flock_t struct { Type int16 Whence int16 Start int64 Len int64 Pid int32 _ [4]byte } const ( FADV_DONTNEED = 0x4 FADV_NOREUSE = 0x5 ) type RawSockaddr struct { Family uint16 Data [14]int8 } type RawSockaddrAny struct { Addr RawSockaddr Pad [96]int8 } type Iovec struct { Base *byte Len uint64 } type Msghdr struct { Name *byte Namelen uint32 Iov *Iovec Iovlen uint64 Control *byte Controllen uint64 Flags int32 _ [4]byte } type Cmsghdr struct { Len uint64 Level int32 Type int32 } const ( SizeofIovec = 0x10 SizeofMsghdr = 0x38 SizeofCmsghdr = 0x10 ) const ( SizeofSockFprog = 0x10 ) type PtraceRegs struct { Regs [31]uint64 Sp uint64 Pc uint64 Pstate uint64 } type FdSet struct { Bits [16]int64 } type Sysinfo_t struct { Uptime int64 Loads [3]uint64 Totalram uint64 Freeram uint64 Sharedram uint64 Bufferram uint64 Totalswap uint64 Freeswap uint64 Procs uint16 Pad uint16 Totalhigh uint64 Freehigh uint64 Unit uint32 _ [0]int8 _ [4]byte } type Ustat_t struct { Tfree int32 Tinode uint64 Fname [6]int8 Fpack [6]int8 _ [4]byte } type EpollEvent struct { Events uint32 PadFd int32 Fd int32 Pad int32 } const ( POLLRDHUP = 0x2000 ) type Sigset_t struct { Val [16]uint64 } const _C__NSIG = 0x41 type Termios struct { Iflag uint32 Oflag uint32 Cflag uint32 Lflag uint32 Line uint8 Cc [19]uint8 Ispeed uint32 Ospeed uint32 } type Taskstats struct { Version uint16 Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 Blkio_delay_total uint64 Swapin_count uint64 Swapin_delay_total uint64 Cpu_run_real_total uint64 Cpu_run_virtual_total uint64 Ac_comm [32]int8 Ac_sched uint8 Ac_pad [3]uint8 _ [4]byte Ac_uid uint32 Ac_gid uint32 Ac_pid uint32 Ac_ppid uint32 Ac_btime uint32 Ac_etime uint64 Ac_utime uint64 Ac_stime uint64 Ac_minflt uint64 Ac_majflt uint64 Coremem uint64 Virtmem uint64 Hiwater_rss uint64 Hiwater_vm uint64 Read_char uint64 Write_char uint64 Read_syscalls uint64 Write_syscalls uint64 Read_bytes uint64 Write_bytes uint64 Cancelled_write_bytes uint64 Nvcsw uint64 Nivcsw uint64 Ac_utimescaled uint64 Ac_stimescaled uint64 Cpu_scaled_run_real_total uint64 Freepages_count uint64 Freepages_delay_total uint64 Thrashing_count uint64 Thrashing_delay_total uint64 Ac_btime64 uint64 } type cpuMask uint64 const ( _NCPUBITS = 0x40 ) const ( CBitFieldMaskBit0 = 0x1 CBitFieldMaskBit1 = 0x2 CBitFieldMaskBit2 = 0x4 CBitFieldMaskBit3 = 0x8 CBitFieldMaskBit4 = 0x10 CBitFieldMaskBit5 = 0x20 CBitFieldMaskBit6 = 0x40 CBitFieldMaskBit7 = 0x80 CBitFieldMaskBit8 = 0x100 CBitFieldMaskBit9 = 0x200 CBitFieldMaskBit10 = 0x400 CBitFieldMaskBit11 = 0x800 CBitFieldMaskBit12 = 0x1000 CBitFieldMaskBit13 = 0x2000 CBitFieldMaskBit14 = 0x4000 CBitFieldMaskBit15 = 0x8000 CBitFieldMaskBit16 = 0x10000 CBitFieldMaskBit17 = 0x20000 CBitFieldMaskBit18 = 0x40000 CBitFieldMaskBit19 = 0x80000 CBitFieldMaskBit20 = 0x100000 CBitFieldMaskBit21 = 0x200000 CBitFieldMaskBit22 = 0x400000 CBitFieldMaskBit23 = 0x800000 CBitFieldMaskBit24 = 0x1000000 CBitFieldMaskBit25 = 0x2000000 CBitFieldMaskBit26 = 0x4000000 CBitFieldMaskBit27 = 0x8000000 CBitFieldMaskBit28 = 0x10000000 CBitFieldMaskBit29 = 0x20000000 CBitFieldMaskBit30 = 0x40000000 CBitFieldMaskBit31 = 0x80000000 CBitFieldMaskBit32 = 0x100000000 CBitFieldMaskBit33 = 0x200000000 CBitFieldMaskBit34 = 0x400000000 CBitFieldMaskBit35 = 0x800000000 CBitFieldMaskBit36 = 0x1000000000 CBitFieldMaskBit37 = 0x2000000000 CBitFieldMaskBit38 = 0x4000000000 CBitFieldMaskBit39 = 0x8000000000 CBitFieldMaskBit40 = 0x10000000000 CBitFieldMaskBit41 = 0x20000000000 CBitFieldMaskBit42 = 0x40000000000 CBitFieldMaskBit43 = 0x80000000000 CBitFieldMaskBit44 = 0x100000000000 CBitFieldMaskBit45 = 0x200000000000 CBitFieldMaskBit46 = 0x400000000000 CBitFieldMaskBit47 = 0x800000000000 CBitFieldMaskBit48 = 0x1000000000000 CBitFieldMaskBit49 = 0x2000000000000 CBitFieldMaskBit50 = 0x4000000000000 CBitFieldMaskBit51 = 0x8000000000000 CBitFieldMaskBit52 = 0x10000000000000 CBitFieldMaskBit53 = 0x20000000000000 CBitFieldMaskBit54 = 0x40000000000000 CBitFieldMaskBit55 = 0x80000000000000 CBitFieldMaskBit56 = 0x100000000000000 CBitFieldMaskBit57 = 0x200000000000000 CBitFieldMaskBit58 = 0x400000000000000 CBitFieldMaskBit59 = 0x800000000000000 CBitFieldMaskBit60 = 0x1000000000000000 CBitFieldMaskBit61 = 0x2000000000000000 CBitFieldMaskBit62 = 0x4000000000000000 CBitFieldMaskBit63 = 0x8000000000000000 ) type SockaddrStorage struct { Family uint16 _ [118]int8 _ uint64 } type HDGeometry struct { Heads uint8 Sectors uint8 Cylinders uint16 Start uint64 } type Statfs_t struct { Type int64 Bsize int64 Blocks uint64 Bfree uint64 Bavail uint64 Files uint64 Ffree uint64 Fsid Fsid Namelen int64 Frsize int64 Flags int64 Spare [4]int64 } type TpacketHdr struct { Status uint64 Len uint32 Snaplen uint32 Mac uint16 Net uint16 Sec uint32 Usec uint32 _ [4]byte } const ( SizeofTpacketHdr = 0x20 ) type RTCPLLInfo struct { Ctrl int32 Value int32 Max int32 Min int32 Posmult int32 Negmult int32 Clock int64 } type BlkpgPartition struct { Start int64 Length int64 Pno int32 Devname [64]uint8 Volname [64]uint8 _ [4]byte } const ( BLKPG = 0x1269 ) type XDPUmemReg struct { Addr uint64 Len uint64 Size uint32 Headroom uint32 Flags uint32 _ [4]byte } type CryptoUserAlg struct { Name [64]int8 Driver_name [64]int8 Module_name [64]int8 Type uint32 Mask uint32 Refcnt uint32 Flags uint32 } type CryptoStatAEAD struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatAKCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Verify_cnt uint64 Sign_cnt uint64 Err_cnt uint64 } type CryptoStatCipher struct { Type [64]int8 Encrypt_cnt uint64 Encrypt_tlen uint64 Decrypt_cnt uint64 Decrypt_tlen uint64 Err_cnt uint64 } type CryptoStatCompress struct { Type [64]int8 Compress_cnt uint64 Compress_tlen uint64 Decompress_cnt uint64 Decompress_tlen uint64 Err_cnt uint64 } type CryptoStatHash struct { Type [64]int8 Hash_cnt uint64 Hash_tlen uint64 Err_cnt uint64 } type CryptoStatKPP struct { Type [64]int8 Setsecret_cnt uint64 Generate_public_key_cnt uint64 Compute_shared_secret_cnt uint64 Err_cnt uint64 } type CryptoStatRNG struct { Type [64]int8 Generate_cnt uint64 Generate_tlen uint64 Seed_cnt uint64 Err_cnt uint64 } type CryptoStatLarval struct { Type [64]int8 } type CryptoReportLarval struct { Type [64]int8 } type CryptoReportHash struct { Type [64]int8 Blocksize uint32 Digestsize uint32 } type CryptoReportCipher struct { Type [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 } type CryptoReportBlkCipher struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Min_keysize uint32 Max_keysize uint32 Ivsize uint32 } type CryptoReportAEAD struct { Type [64]int8 Geniv [64]int8 Blocksize uint32 Maxauthsize uint32 Ivsize uint32 } type CryptoReportComp struct { Type [64]int8 } type CryptoReportRNG struct { Type [64]int8 Seedsize uint32 } type CryptoReportAKCipher struct { Type [64]int8 } type CryptoReportKPP struct { Type [64]int8 } type CryptoReportAcomp struct { Type [64]int8 } type LoopInfo struct { Number int32 Device uint32 Inode uint64 Rdevice uint32 Offset int32 Encrypt_type int32 Encrypt_key_size int32 Flags int32 Name [64]int8 Encrypt_key [32]uint8 Init [2]uint64 Reserved [4]int8 _ [4]byte } type TIPCSubscr struct { Seq TIPCServiceRange Timeout uint32 Filter uint32 Handle [8]int8 } type TIPCSIOCLNReq struct { Peer uint32 Id uint32 Linkname [68]int8 } type TIPCSIOCNodeIDReq struct { Peer uint32 Id [16]int8 }
{ "pile_set_name": "Github" }
# Translation of OpenERP Server. # This file contains the translation of the following modules: # * l10n_ma # # Translators: msgid "" msgstr "" "Project-Id-Version: Odoo 8.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2012-11-24 02:53+0000\n" "PO-Revision-Date: 2015-07-17 07:31+0000\n" "Last-Translator: Martin Trigaux\n" "Language-Team: Persian (http://www.transifex.com/odoo/odoo-8/language/fa/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Language: fa\n" "Plural-Forms: nplurals=1; plural=0;\n" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_imm msgid "Immobilisations" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_ach msgid "Charges Achats" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_tpl msgid "Titres de placement" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_vue msgid "Vue" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_dct msgid "Dettes à court terme" msgstr "" #. module: l10n_ma #: sql_constraint:l10n.ma.report:0 msgid "The code report must be unique !" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_stk msgid "Stocks" msgstr "" #. module: l10n_ma #: field:l10n.ma.line,code:0 msgid "Variable Name" msgstr "" #. module: l10n_ma #: field:l10n.ma.line,definition:0 msgid "Definition" msgstr "تعریف" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_dlt msgid "Dettes à long terme" msgstr "" #. module: l10n_ma #: field:l10n.ma.line,name:0 field:l10n.ma.report,name:0 msgid "Name" msgstr "نام" #. module: l10n_ma #: field:l10n.ma.report,line_ids:0 msgid "Lines" msgstr "سطرها" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_tax msgid "Taxes" msgstr "مالیات ها" #. module: l10n_ma #: field:l10n.ma.line,report_id:0 msgid "Report" msgstr "گزارش" #. module: l10n_ma #: model:ir.model,name:l10n_ma.model_l10n_ma_line msgid "Report Lines for l10n_ma" msgstr "" #. module: l10n_ma #: sql_constraint:l10n.ma.line:0 msgid "The variable name must be unique !" msgstr "" #. module: l10n_ma #: model:ir.model,name:l10n_ma.model_l10n_ma_report msgid "Report for l10n_ma_kzc" msgstr "" #. module: l10n_ma #: field:l10n.ma.report,code:0 msgid "Code" msgstr "کد" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_per msgid "Charges Personnel" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_liq msgid "Liquidité" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_pdt msgid "Produits" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_reg msgid "Régularisation" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_cp msgid "Capitaux Propres" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_cre msgid "Créances" msgstr "" #. module: l10n_ma #: model:account.account.type,name:l10n_ma.cpt_type_aut msgid "Charges Autres" msgstr ""
{ "pile_set_name": "Github" }
CXX_SOURCES := main.cpp include Makefile.rules
{ "pile_set_name": "Github" }
package store import ( "sync" "github.com/domodwyer/cryptic/encryptor" ) type rwLocker interface { sync.Locker RLock() RUnlock() } // Memory is an in-memory data store. Contents are not persisted in any way // after the process ends. type Memory struct { secrets map[string]encryptor.EncryptedData mu rwLocker } // NewMemory returns an initalised memory store. func NewMemory() *Memory { return &Memory{ secrets: map[string]encryptor.EncryptedData{}, mu: &sync.RWMutex{}, } } // Put stores data under the given name. func (s *Memory) Put(name string, data *encryptor.EncryptedData) error { if name == "" { return ErrInvalidName } if _, err := s.Get(name); err != ErrNotFound { return ErrAlreadyExists } s.mu.Lock() defer s.mu.Unlock() s.secrets[name] = *data return nil } // Get fetches the EncryptedData stored under name. func (s *Memory) Get(name string) (*encryptor.EncryptedData, error) { if name == "" { return nil, ErrInvalidName } s.mu.RLock() defer s.mu.RUnlock() d, ok := s.secrets[name] if !ok { return nil, ErrNotFound } return &d, nil } // Delete removes a secret from the memory store. func (s *Memory) Delete(name string) error { if name == "" { return ErrInvalidName } s.mu.Lock() defer s.mu.Unlock() if _, ok := s.secrets[name]; !ok { return ErrNotFound } delete(s.secrets, name) return nil }
{ "pile_set_name": "Github" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>CMSIS-DSP: Examples Directory Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="stylsheetf" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-DSP &#160;<span id="projectnumber">Version 1.4.4</span> </div> <div id="projectbrief">CMSIS DSP Software Library</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <li><a href="../../General/html/index.html"><span>CMSIS</span></a></li> <li><a href="../../Core/html/index.html"><span>CORE</span></a></li> <li><a href="../../Driver/html/index.html"><span>Driver</span></a></li> <li class="current"><a href="../../DSP/html/index.html"><span>DSP</span></a></li> <li><a href="../../RTOS/html/index.html"><span>RTOS API</span></a></li> <li><a href="../../Pack/html/index.html"><span>Pack</span></a></li> <li><a href="../../SVD/html/index.html"><span>SVD</span></a></li> </ul> </div> <!-- Generated by Doxygen 1.8.2 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('dir_50f4d4f91ce5cd72cb6928b47e85a7f8.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Examples Directory Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a> Directories</h2></td></tr> <tr class="memitem:dir_56cec670f0bb78d679862f48f54d3df2"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_56cec670f0bb78d679862f48f54d3df2.html">arm_class_marks_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_0bd53153155fe3870c529e4f415d4a7e"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_0bd53153155fe3870c529e4f415d4a7e.html">arm_convolution_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_d1d61a1361fc579da85c1b709ed868d7"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_d1d61a1361fc579da85c1b709ed868d7.html">arm_dotproduct_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_38d31328c42027cc5452e7496de7b88f"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_38d31328c42027cc5452e7496de7b88f.html">arm_fft_bin_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_dcc7392e27ceedcb8fca5c4cd07c4b5c"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_dcc7392e27ceedcb8fca5c4cd07c4b5c.html">arm_fir_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_e4eb7b834609f1fe20523c66b23e4a87"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_e4eb7b834609f1fe20523c66b23e4a87.html">arm_graphic_equalizer_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_cf417d728100a167f563acfac33cb7c7"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_cf417d728100a167f563acfac33cb7c7.html">arm_linear_interp_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_6128d62f89366c4b8843a6e619831037"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_6128d62f89366c4b8843a6e619831037.html">arm_matrix_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_e850fff378e36258e2a085808e9d898c"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_e850fff378e36258e2a085808e9d898c.html">arm_signal_converge_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_d1af19de43f00bd515b519c982d49d68"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_d1af19de43f00bd515b519c982d49d68.html">arm_sin_cos_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:dir_e04602aba7b2f9f43e3429e32fb5dc36"><td class="memItemLeft" align="right" valign="top">directory &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dir_e04602aba7b2f9f43e3429e32fb5dc36.html">arm_variance_example</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="dir_be2d3df67661aefe0e3f0071a1d6f8f1.html">DSP_Lib</a></li><li class="navelem"><a class="el" href="dir_50f4d4f91ce5cd72cb6928b47e85a7f8.html">Examples</a></li> <li class="footer">Generated on Tue Sep 23 2014 18:52:44 for CMSIS-DSP by ARM Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.2 --> </li> </ul> </div> </body> </html>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Project xmlns="http://schemas.microsoft.com/project"> <SaveVersion>12</SaveVersion> <Name>calendar-recurring-exceptions-project2007-mspdi.xml</Name> <Title>Project1</Title> <Author>Project User</Author> <CreationDate>2017-10-20T09:46:00</CreationDate> <LastSaved>2017-11-08T08:40:00</LastSaved> <ScheduleFromStart>1</ScheduleFromStart> <StartDate>2017-10-20T08:00:00</StartDate> <FinishDate>2017-10-20T08:00:00</FinishDate> <FYStartDate>1</FYStartDate> <CriticalSlackLimit>0</CriticalSlackLimit> <CurrencyDigits>2</CurrencyDigits> <CurrencySymbol>£</CurrencySymbol> <CurrencyCode>GBP</CurrencyCode> <CurrencySymbolPosition>0</CurrencySymbolPosition> <CalendarUID>1</CalendarUID> <DefaultStartTime>08:00:00</DefaultStartTime> <DefaultFinishTime>17:00:00</DefaultFinishTime> <MinutesPerDay>480</MinutesPerDay> <MinutesPerWeek>2400</MinutesPerWeek> <DaysPerMonth>20</DaysPerMonth> <DefaultTaskType>0</DefaultTaskType> <DefaultFixedCostAccrual>3</DefaultFixedCostAccrual> <DefaultStandardRate>0</DefaultStandardRate> <DefaultOvertimeRate>0</DefaultOvertimeRate> <DurationFormat>7</DurationFormat> <WorkFormat>2</WorkFormat> <EditableActualCosts>0</EditableActualCosts> <HonorConstraints>0</HonorConstraints> <InsertedProjectsLikeSummary>1</InsertedProjectsLikeSummary> <MultipleCriticalPaths>0</MultipleCriticalPaths> <NewTasksEffortDriven>0</NewTasksEffortDriven> <NewTasksEstimated>1</NewTasksEstimated> <SplitsInProgressTasks>1</SplitsInProgressTasks> <SpreadActualCost>0</SpreadActualCost> <SpreadPercentComplete>0</SpreadPercentComplete> <TaskUpdatesResource>1</TaskUpdatesResource> <FiscalYearStart>0</FiscalYearStart> <WeekStartDay>1</WeekStartDay> <MoveCompletedEndsBack>0</MoveCompletedEndsBack> <MoveRemainingStartsBack>0</MoveRemainingStartsBack> <MoveRemainingStartsForward>0</MoveRemainingStartsForward> <MoveCompletedEndsForward>0</MoveCompletedEndsForward> <BaselineForEarnedValue>0</BaselineForEarnedValue> <AutoAddNewResourcesAndTasks>1</AutoAddNewResourcesAndTasks> <CurrentDate>2017-11-08T08:00:00</CurrentDate> <MicrosoftProjectServerURL>1</MicrosoftProjectServerURL> <Autolink>0</Autolink> <NewTaskStartDate>0</NewTaskStartDate> <DefaultTaskEVMethod>0</DefaultTaskEVMethod> <ProjectExternallyEdited>0</ProjectExternallyEdited> <ExtendedCreationDate>1984-01-01T00:00:00</ExtendedCreationDate> <ActualsInSync>1</ActualsInSync> <RemoveFileProperties>0</RemoveFileProperties> <AdminProject>0</AdminProject> <OutlineCodes/> <WBSMasks/> <ExtendedAttributes/> <Calendars> <Calendar> <UID>1</UID> <Name>Standard</Name> <IsBaseCalendar>1</IsBaseCalendar> <BaseCalendarUID>-1</BaseCalendarUID> <WeekDays> <WeekDay> <DayType>1</DayType> <DayWorking>0</DayWorking> </WeekDay> <WeekDay> <DayType>2</DayType> <DayWorking>1</DayWorking> <WorkingTimes> <WorkingTime> <FromTime>08:00:00</FromTime> <ToTime>12:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>13:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> <WeekDay> <DayType>3</DayType> <DayWorking>1</DayWorking> <WorkingTimes> <WorkingTime> <FromTime>08:00:00</FromTime> <ToTime>12:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>13:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> <WeekDay> <DayType>4</DayType> <DayWorking>1</DayWorking> <WorkingTimes> <WorkingTime> <FromTime>08:00:00</FromTime> <ToTime>12:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>13:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> <WeekDay> <DayType>5</DayType> <DayWorking>1</DayWorking> <WorkingTimes> <WorkingTime> <FromTime>08:00:00</FromTime> <ToTime>12:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>13:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> <WeekDay> <DayType>6</DayType> <DayWorking>1</DayWorking> <WorkingTimes> <WorkingTime> <FromTime>08:00:00</FromTime> <ToTime>12:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>13:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> <WeekDay> <DayType>7</DayType> <DayWorking>0</DayWorking> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-01-01T00:00:00</FromDate> <ToDate>2000-01-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-02-01T00:00:00</FromDate> <ToDate>2000-02-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-02-04T00:00:00</FromDate> <ToDate>2000-02-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-02-07T00:00:00</FromDate> <ToDate>2000-02-07T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-02-10T00:00:00</FromDate> <ToDate>2000-02-10T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-03-01T00:00:00</FromDate> <ToDate>2000-03-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-03-06T00:00:00</FromDate> <ToDate>2000-03-06T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-03-11T00:00:00</FromDate> <ToDate>2000-03-11T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-03-16T00:00:00</FromDate> <ToDate>2000-03-16T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-03-21T00:00:00</FromDate> <ToDate>2000-03-21T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-04-01T00:00:00</FromDate> <ToDate>2000-04-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-04-08T00:00:00</FromDate> <ToDate>2000-04-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-04-15T00:00:00</FromDate> <ToDate>2000-04-15T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-04-22T00:00:00</FromDate> <ToDate>2000-04-22T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-04-29T00:00:00</FromDate> <ToDate>2000-04-29T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2000-05-06T00:00:00</FromDate> <ToDate>2000-05-06T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2001-01-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-02T00:00:00</FromDate> <ToDate>2001-01-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-03T00:00:00</FromDate> <ToDate>2001-01-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-04T00:00:00</FromDate> <ToDate>2001-01-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-05T00:00:00</FromDate> <ToDate>2001-01-05T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-06T00:00:00</FromDate> <ToDate>2001-01-06T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-08T00:00:00</FromDate> <ToDate>2001-01-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-15T00:00:00</FromDate> <ToDate>2001-01-15T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-16T00:00:00</FromDate> <ToDate>2001-01-16T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-24T00:00:00</FromDate> <ToDate>2001-01-24T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-01-30T00:00:00</FromDate> <ToDate>2001-01-30T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-02-01T00:00:00</FromDate> <ToDate>2001-02-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-02-09T00:00:00</FromDate> <ToDate>2001-02-09T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-02-13T00:00:00</FromDate> <ToDate>2001-02-13T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-02-14T00:00:00</FromDate> <ToDate>2001-02-14T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-02-17T00:00:00</FromDate> <ToDate>2001-02-17T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-02-18T00:00:00</FromDate> <ToDate>2001-02-18T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-03-01T00:00:00</FromDate> <ToDate>2001-03-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-03-07T00:00:00</FromDate> <ToDate>2001-03-07T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-03-16T00:00:00</FromDate> <ToDate>2001-03-16T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-03-28T00:00:00</FromDate> <ToDate>2001-03-28T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-03-29T00:00:00</FromDate> <ToDate>2001-03-29T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-03-31T00:00:00</FromDate> <ToDate>2001-03-31T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-04-08T00:00:00</FromDate> <ToDate>2001-04-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-04-20T00:00:00</FromDate> <ToDate>2001-04-20T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-04-26T00:00:00</FromDate> <ToDate>2001-04-26T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-05-12T00:00:00</FromDate> <ToDate>2001-05-12T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-05-24T00:00:00</FromDate> <ToDate>2001-05-24T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-05-25T00:00:00</FromDate> <ToDate>2001-05-25T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-05-27T00:00:00</FromDate> <ToDate>2001-05-27T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-06-23T00:00:00</FromDate> <ToDate>2001-06-23T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-06-29T00:00:00</FromDate> <ToDate>2001-06-29T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-07-15T00:00:00</FromDate> <ToDate>2001-07-15T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-08-03T00:00:00</FromDate> <ToDate>2001-08-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-08-04T00:00:00</FromDate> <ToDate>2001-08-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-09-02T00:00:00</FromDate> <ToDate>2001-09-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-09-15T00:00:00</FromDate> <ToDate>2001-09-15T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-10-21T00:00:00</FromDate> <ToDate>2001-10-21T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-10-27T00:00:00</FromDate> <ToDate>2001-10-27T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2001-12-09T00:00:00</FromDate> <ToDate>2001-12-09T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-05T00:00:00</FromDate> <ToDate>2002-01-05T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-07T00:00:00</FromDate> <ToDate>2002-01-07T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-08T00:00:00</FromDate> <ToDate>2002-01-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-13T00:00:00</FromDate> <ToDate>2002-01-13T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-16T00:00:00</FromDate> <ToDate>2002-01-16T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-24T00:00:00</FromDate> <ToDate>2002-01-24T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-25T00:00:00</FromDate> <ToDate>2002-01-25T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-01-27T00:00:00</FromDate> <ToDate>2002-01-27T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-03-04T00:00:00</FromDate> <ToDate>2002-03-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-03-17T00:00:00</FromDate> <ToDate>2002-03-17T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-04-09T00:00:00</FromDate> <ToDate>2002-04-09T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-05-06T00:00:00</FromDate> <ToDate>2002-05-06T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-05-15T00:00:00</FromDate> <ToDate>2002-05-15T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-06-27T00:00:00</FromDate> <ToDate>2002-06-27T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-07-09T00:00:00</FromDate> <ToDate>2002-07-09T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-07-26T00:00:00</FromDate> <ToDate>2002-07-26T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-08-03T00:00:00</FromDate> <ToDate>2002-08-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-09-08T00:00:00</FromDate> <ToDate>2002-09-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-09-18T00:00:00</FromDate> <ToDate>2002-09-18T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-10-08T00:00:00</FromDate> <ToDate>2002-10-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2002-11-28T00:00:00</FromDate> <ToDate>2002-11-28T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-01-01T00:00:00</FromDate> <ToDate>2003-01-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-01-04T00:00:00</FromDate> <ToDate>2003-01-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-01-15T00:00:00</FromDate> <ToDate>2003-01-15T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-01-31T00:00:00</FromDate> <ToDate>2003-01-31T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-03-01T00:00:00</FromDate> <ToDate>2003-03-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-04-24T00:00:00</FromDate> <ToDate>2003-04-24T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-05-01T00:00:00</FromDate> <ToDate>2003-05-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-05-11T00:00:00</FromDate> <ToDate>2003-05-11T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-05-21T00:00:00</FromDate> <ToDate>2003-05-21T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-06-04T00:00:00</FromDate> <ToDate>2003-06-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-07-25T00:00:00</FromDate> <ToDate>2003-07-25T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-09-25T00:00:00</FromDate> <ToDate>2003-09-25T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-10-04T00:00:00</FromDate> <ToDate>2003-10-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2003-11-04T00:00:00</FromDate> <ToDate>2003-11-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-01-11T00:00:00</FromDate> <ToDate>2004-01-11T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-01-30T00:00:00</FromDate> <ToDate>2004-01-30T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-02-26T00:00:00</FromDate> <ToDate>2004-02-26T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-03-02T00:00:00</FromDate> <ToDate>2004-03-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-04-04T00:00:00</FromDate> <ToDate>2004-04-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-04-14T00:00:00</FromDate> <ToDate>2004-04-14T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-05-01T00:00:00</FromDate> <ToDate>2004-05-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-05-20T00:00:00</FromDate> <ToDate>2004-05-20T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-07-30T00:00:00</FromDate> <ToDate>2004-07-30T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-09-04T00:00:00</FromDate> <ToDate>2004-09-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-09-12T00:00:00</FromDate> <ToDate>2004-09-12T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2004-12-04T00:00:00</FromDate> <ToDate>2004-12-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-01-28T00:00:00</FromDate> <ToDate>2005-01-28T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-02-01T00:00:00</FromDate> <ToDate>2005-02-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-02-04T00:00:00</FromDate> <ToDate>2005-02-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-03-01T00:00:00</FromDate> <ToDate>2005-03-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-03-02T00:00:00</FromDate> <ToDate>2005-03-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-04-03T00:00:00</FromDate> <ToDate>2005-04-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-04-13T00:00:00</FromDate> <ToDate>2005-04-13T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-05-08T00:00:00</FromDate> <ToDate>2005-05-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-05-19T00:00:00</FromDate> <ToDate>2005-05-19T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2005-07-02T00:00:00</FromDate> <ToDate>2005-07-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-01-08T00:00:00</FromDate> <ToDate>2006-01-08T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-02-01T00:00:00</FromDate> <ToDate>2006-02-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-02-04T00:00:00</FromDate> <ToDate>2006-02-04T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-03-02T00:00:00</FromDate> <ToDate>2006-03-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-03-07T00:00:00</FromDate> <ToDate>2006-03-07T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-04-03T00:00:00</FromDate> <ToDate>2006-04-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-04-12T00:00:00</FromDate> <ToDate>2006-04-12T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-05-18T00:00:00</FromDate> <ToDate>2006-05-18T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2006-09-10T00:00:00</FromDate> <ToDate>2006-09-10T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2007-02-01T00:00:00</FromDate> <ToDate>2007-02-01T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2007-03-02T00:00:00</FromDate> <ToDate>2007-03-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2007-03-06T00:00:00</FromDate> <ToDate>2007-03-06T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2007-04-03T00:00:00</FromDate> <ToDate>2007-04-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2007-04-11T00:00:00</FromDate> <ToDate>2007-04-11T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2007-05-13T00:00:00</FromDate> <ToDate>2007-05-13T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2007-05-17T00:00:00</FromDate> <ToDate>2007-05-17T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2008-03-02T00:00:00</FromDate> <ToDate>2008-03-02T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2008-04-03T00:00:00</FromDate> <ToDate>2008-04-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2008-04-09T00:00:00</FromDate> <ToDate>2008-04-09T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2008-05-15T00:00:00</FromDate> <ToDate>2008-05-15T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2009-04-03T00:00:00</FromDate> <ToDate>2009-04-03T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>0</DayWorking> <TimePeriod> <FromDate>2009-05-21T00:00:00</FromDate> <ToDate>2009-05-21T23:59:00</ToDate> </TimePeriod> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>1</DayWorking> <TimePeriod> <FromDate>2010-01-02T00:00:00</FromDate> <ToDate>2010-01-02T23:59:00</ToDate> </TimePeriod> <WorkingTimes> <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>14:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>1</DayWorking> <TimePeriod> <FromDate>2010-02-06T00:00:00</FromDate> <ToDate>2010-02-06T23:59:00</ToDate> </TimePeriod> <WorkingTimes> <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>14:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> <WeekDay> <DayType>0</DayType> <DayWorking>1</DayWorking> <TimePeriod> <FromDate>2010-03-06T00:00:00</FromDate> <ToDate>2010-03-06T23:59:00</ToDate> </TimePeriod> <WorkingTimes> <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>14:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> </WeekDays> <Exceptions> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2000-01-01T00:00:00</FromDate> <ToDate>2000-01-03T23:59:00</ToDate> </TimePeriod> <Occurrences>3</Occurrences> <Name>Daily 1</Name> <Type>1</Type> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2000-02-01T00:00:00</FromDate> <ToDate>2000-02-10T23:59:00</ToDate> </TimePeriod> <Occurrences>4</Occurrences> <Name>Daily 2</Name> <Type>7</Type> <Period>3</Period> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2000-03-01T00:00:00</FromDate> <ToDate>2000-03-21T23:59:00</ToDate> </TimePeriod> <Occurrences>5</Occurrences> <Name>Daily 3</Name> <Type>7</Type> <Period>5</Period> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2000-04-01T00:00:00</FromDate> <ToDate>2000-05-06T23:59:00</ToDate> </TimePeriod> <Occurrences>6</Occurrences> <Name>Daily 4</Name> <Type>7</Type> <Period>7</Period> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2001-01-15T23:59:00</ToDate> </TimePeriod> <Occurrences>3</Occurrences> <Name>Weekly 1 Monday</Name> <Type>6</Type> <Period>1</Period> <DaysOfWeek>2</DaysOfWeek> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2001-02-13T23:59:00</ToDate> </TimePeriod> <Occurrences>4</Occurrences> <Name>Weekly 2 Tuesday</Name> <Type>6</Type> <Period>2</Period> <DaysOfWeek>4</DaysOfWeek> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2001-03-28T23:59:00</ToDate> </TimePeriod> <Occurrences>5</Occurrences> <Name>Weekly 3 Wednesday</Name> <Type>6</Type> <Period>3</Period> <DaysOfWeek>8</DaysOfWeek> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2001-05-24T23:59:00</ToDate> </TimePeriod> <Occurrences>6</Occurrences> <Name>Weekly 4 Thursday</Name> <Type>6</Type> <Period>4</Period> <DaysOfWeek>16</DaysOfWeek> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2001-08-03T23:59:00</ToDate> </TimePeriod> <Occurrences>7</Occurrences> <Name>Weekly 5 Friday</Name> <Type>6</Type> <Period>5</Period> <DaysOfWeek>32</DaysOfWeek> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2001-10-27T23:59:00</ToDate> </TimePeriod> <Occurrences>8</Occurrences> <Name>Weekly 6 Saturday</Name> <Type>6</Type> <Period>6</Period> <DaysOfWeek>64</DaysOfWeek> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2001-01-01T00:00:00</FromDate> <ToDate>2002-03-17T23:59:00</ToDate> </TimePeriod> <Occurrences>9</Occurrences> <Name>Weekly 7 Sunday</Name> <Type>6</Type> <Period>7</Period> <DaysOfWeek>1</DaysOfWeek> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2002-01-01T00:00:00</FromDate> <ToDate>2002-05-06T23:59:00</ToDate> </TimePeriod> <Occurrences>3</Occurrences> <Name>Monthly Relative 1</Name> <Type>5</Type> <Period>2</Period> <MonthItem>4</MonthItem> <MonthPosition>0</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2002-01-01T00:00:00</FromDate> <ToDate>2002-10-08T23:59:00</ToDate> </TimePeriod> <Occurrences>4</Occurrences> <Name>Monthly Relative 2</Name> <Type>5</Type> <Period>3</Period> <MonthItem>5</MonthItem> <MonthPosition>1</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2002-01-01T00:00:00</FromDate> <ToDate>2003-05-21T23:59:00</ToDate> </TimePeriod> <Occurrences>5</Occurrences> <Name>Monthly Relative 3</Name> <Type>5</Type> <Period>4</Period> <MonthItem>6</MonthItem> <MonthPosition>2</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2002-01-01T00:00:00</FromDate> <ToDate>2004-02-26T23:59:00</ToDate> </TimePeriod> <Occurrences>6</Occurrences> <Name>Monthly Relative 4</Name> <Type>5</Type> <Period>5</Period> <MonthItem>7</MonthItem> <MonthPosition>3</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2002-01-01T00:00:00</FromDate> <ToDate>2005-01-28T23:59:00</ToDate> </TimePeriod> <Occurrences>7</Occurrences> <Name>Monthly Relative 5</Name> <Type>5</Type> <Period>6</Period> <MonthItem>8</MonthItem> <MonthPosition>4</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2002-01-01T00:00:00</FromDate> <ToDate>2006-02-04T23:59:00</ToDate> </TimePeriod> <Occurrences>8</Occurrences> <Name>Monthly Relative 6</Name> <Type>5</Type> <Period>7</Period> <MonthItem>9</MonthItem> <MonthPosition>0</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2002-01-01T00:00:00</FromDate> <ToDate>2007-05-13T23:59:00</ToDate> </TimePeriod> <Occurrences>9</Occurrences> <Name>Monthly Relative 7</Name> <Type>5</Type> <Period>8</Period> <MonthItem>3</MonthItem> <MonthPosition>1</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2003-01-01T00:00:00</FromDate> <ToDate>2003-05-01T23:59:00</ToDate> </TimePeriod> <Occurrences>3</Occurrences> <Name>Monthly Absolute 1</Name> <Type>4</Type> <Period>2</Period> <MonthDay>1</MonthDay> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2003-01-01T00:00:00</FromDate> <ToDate>2005-02-04T23:59:00</ToDate> </TimePeriod> <Occurrences>6</Occurrences> <Name>Monthly Absolute 2</Name> <Type>4</Type> <Period>5</Period> <MonthDay>4</MonthDay> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2004-01-01T00:00:00</FromDate> <ToDate>2007-03-06T23:59:00</ToDate> </TimePeriod> <Occurrences>4</Occurrences> <Name>Yearly Relative 1</Name> <Type>3</Type> <Month>2</Month> <MonthItem>5</MonthItem> <MonthPosition>0</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2004-01-01T00:00:00</FromDate> <ToDate>2008-04-09T23:59:00</ToDate> </TimePeriod> <Occurrences>5</Occurrences> <Name>Yearly Relative 2</Name> <Type>3</Type> <Month>3</Month> <MonthItem>6</MonthItem> <MonthPosition>1</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2004-01-01T00:00:00</FromDate> <ToDate>2009-05-21T23:59:00</ToDate> </TimePeriod> <Occurrences>6</Occurrences> <Name>Yearly Relative 3</Name> <Type>3</Type> <Month>4</Month> <MonthItem>7</MonthItem> <MonthPosition>2</MonthPosition> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2005-01-01T00:00:00</FromDate> <ToDate>2007-02-01T23:59:00</ToDate> </TimePeriod> <Occurrences>3</Occurrences> <Name>Yearly Absolute 1</Name> <Type>2</Type> <Month>1</Month> <MonthDay>1</MonthDay> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2005-01-01T00:00:00</FromDate> <ToDate>2008-03-02T23:59:00</ToDate> </TimePeriod> <Occurrences>4</Occurrences> <Name>Yearly Absolute 2</Name> <Type>2</Type> <Month>2</Month> <MonthDay>2</MonthDay> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2005-01-01T00:00:00</FromDate> <ToDate>2009-04-03T23:59:00</ToDate> </TimePeriod> <Occurrences>5</Occurrences> <Name>Yearly Absolute 3</Name> <Type>2</Type> <Month>3</Month> <MonthDay>3</MonthDay> <DayWorking>0</DayWorking> </Exception> <Exception> <EnteredByOccurrences>1</EnteredByOccurrences> <TimePeriod> <FromDate>2010-01-01T00:00:00</FromDate> <ToDate>2010-03-06T23:59:00</ToDate> </TimePeriod> <Occurrences>3</Occurrences> <Name>Recurring Working</Name> <Type>5</Type> <Period>1</Period> <MonthItem>9</MonthItem> <MonthPosition>0</MonthPosition> <DayWorking>1</DayWorking> <WorkingTimes> <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> <WorkingTime> <FromTime>14:00:00</FromTime> <ToTime>17:00:00</ToTime> </WorkingTime> </WorkingTimes> </Exception> </Exceptions> </Calendar> </Calendars> <Tasks> <Task> <UID>0</UID> <ID>0</ID> <Name>Project1</Name> <Type>1</Type> <IsNull>0</IsNull> <CreateDate>2017-10-20T08:00:00</CreateDate> <WBS>0</WBS> <OutlineNumber>0</OutlineNumber> <OutlineLevel>0</OutlineLevel> <Priority>500</Priority> <Start>2017-10-20T08:00:00</Start> <Finish>2017-10-20T08:00:00</Finish> <Duration>PT0H0M0S</Duration> <DurationFormat>53</DurationFormat> <Work>PT0H0M0S</Work> <ResumeValid>0</ResumeValid> <EffortDriven>0</EffortDriven> <Recurring>0</Recurring> <OverAllocated>0</OverAllocated> <Estimated>1</Estimated> <Milestone>0</Milestone> <Summary>1</Summary> <Critical>1</Critical> <IsSubproject>0</IsSubproject> <IsSubprojectReadOnly>0</IsSubprojectReadOnly> <ExternalTask>0</ExternalTask> <EarlyStart>2017-10-20T08:00:00</EarlyStart> <EarlyFinish>2017-10-20T08:00:00</EarlyFinish> <LateStart>2017-10-20T08:00:00</LateStart> <LateFinish>2017-10-20T08:00:00</LateFinish> <StartVariance>0</StartVariance> <FinishVariance>0</FinishVariance> <WorkVariance>0.00</WorkVariance> <FreeSlack>0</FreeSlack> <TotalSlack>0</TotalSlack> <FixedCost>0</FixedCost> <FixedCostAccrual>3</FixedCostAccrual> <PercentComplete>0</PercentComplete> <PercentWorkComplete>0</PercentWorkComplete> <Cost>0</Cost> <OvertimeCost>0</OvertimeCost> <OvertimeWork>PT0H0M0S</OvertimeWork> <ActualDuration>PT0H0M0S</ActualDuration> <ActualCost>0</ActualCost> <ActualOvertimeCost>0</ActualOvertimeCost> <ActualWork>PT0H0M0S</ActualWork> <ActualOvertimeWork>PT0H0M0S</ActualOvertimeWork> <RegularWork>PT0H0M0S</RegularWork> <RemainingDuration>PT0H0M0S</RemainingDuration> <RemainingCost>0</RemainingCost> <RemainingWork>PT0H0M0S</RemainingWork> <RemainingOvertimeCost>0</RemainingOvertimeCost> <RemainingOvertimeWork>PT0H0M0S</RemainingOvertimeWork> <ACWP>0.00</ACWP> <CV>0.00</CV> <ConstraintType>0</ConstraintType> <CalendarUID>-1</CalendarUID> <LevelAssignments>1</LevelAssignments> <LevelingCanSplit>1</LevelingCanSplit> <LevelingDelay>0</LevelingDelay> <LevelingDelayFormat>8</LevelingDelayFormat> <PreLeveledStart>1984-01-01T00:00:00</PreLeveledStart> <PreLeveledFinish>1984-01-01T00:00:00</PreLeveledFinish> <IgnoreResourceCalendar>0</IgnoreResourceCalendar> <HideBar>0</HideBar> <Rollup>0</Rollup> <BCWS>0.00</BCWS> <BCWP>0.00</BCWP> <PhysicalPercentComplete>0</PhysicalPercentComplete> <EarnedValueMethod>0</EarnedValueMethod> <IsPublished>1</IsPublished> <CommitmentType>0</CommitmentType> </Task> </Tasks> <Resources> <Resource> <UID>0</UID> <ID>0</ID> <Type>1</Type> <IsNull>0</IsNull> <WorkGroup>0</WorkGroup> <MaxUnits>1.00</MaxUnits> <PeakUnits>0.00</PeakUnits> <OverAllocated>0</OverAllocated> <CanLevel>1</CanLevel> <AccrueAt>3</AccrueAt> <Work>PT0H0M0S</Work> <RegularWork>PT0H0M0S</RegularWork> <OvertimeWork>PT0H0M0S</OvertimeWork> <ActualWork>PT0H0M0S</ActualWork> <RemainingWork>PT0H0M0S</RemainingWork> <ActualOvertimeWork>PT0H0M0S</ActualOvertimeWork> <RemainingOvertimeWork>PT0H0M0S</RemainingOvertimeWork> <PercentWorkComplete>0</PercentWorkComplete> <StandardRate>0</StandardRate> <StandardRateFormat>2</StandardRateFormat> <Cost>0</Cost> <OvertimeRate>0</OvertimeRate> <OvertimeRateFormat>2</OvertimeRateFormat> <OvertimeCost>0</OvertimeCost> <CostPerUse>0</CostPerUse> <ActualCost>0</ActualCost> <ActualOvertimeCost>0</ActualOvertimeCost> <RemainingCost>0</RemainingCost> <RemainingOvertimeCost>0</RemainingOvertimeCost> <WorkVariance>0.00</WorkVariance> <CostVariance>0</CostVariance> <SV>0.00</SV> <CV>0.00</CV> <ACWP>0.00</ACWP> <CalendarUID>2</CalendarUID> <BCWS>0.00</BCWS> <BCWP>0.00</BCWP> <IsGeneric>0</IsGeneric> <IsInactive>0</IsInactive> <IsEnterprise>0</IsEnterprise> <BookingType>0</BookingType> <CreationDate>2017-11-08T08:39:00</CreationDate> <IsCostResource>0</IsCostResource> <IsBudget>0</IsBudget> </Resource> </Resources> <Assignments/> </Project>
{ "pile_set_name": "Github" }
<?php include_once __DIR__ . '/../config/config.inc.php'; include 'style/wrapper.inc.php'; include '../lib/ntbb-session.lib.php'; $page = 'resetpassword'; $pageTitle = "Reset Password"; $token = $_REQUEST['token']; $user = $users->validatePasswordResetToken($token); if ($user) { $user = $users->getUser($user); $pageTitle = "Reset Password for " . htmlspecialchars($user['username']); } includeHeader(); ?> <div class="main"> <h1>Reset Password</h1> <?php if (!$user) { ?> <p> Your password reset link is invalid, probably because it has expired. Ask for a new one. </p> <?php } else { $action = false; if (@$_POST['act'] === 'changepass') { $action = true; if ($user['userid'] !== $_POST['userid']) die("pls no hax0r"); $newUser = [ 'userid' => $_POST['userid'], 'password' => $_POST['newpassword'], ]; if (strlen($_POST['newpassword']) < 5) { $actionerror = 'Your new password must be at least 5 characters long.'; } else if ($_POST['newpassword'] !== $_POST['cnewpassword']) { $actionerror = 'Your new passwords do not match.'; } else if (!$users->modifyUser($newUser['userid'], $newUser)) { $actionerror = 'Error changing password.'; } else { $actionsuccess = true; } } if ($action && !@$actionsuccess) echo '<p class="error"><strong>Error:</strong> '.$actionerror.'</p>'; if (@$actionsuccess) { ?> <p> The password for <?php echo htmlspecialchars($user['username']); ?> was <strong>successfully changed</strong>!. </p> <p class="mainbutton"> <a class="button greenbutton" href="http://<?= $psconfig['routes']['client'] ?>/">Play online</a> </p> <?php } else { ?> <form action="" method="post" class="form" id="passwordform" data-target="replace"> <input type="hidden" name="act" value="changepass" /> <input type="hidden" name="userid" value="<?php echo htmlspecialchars($user['userid']); ?>" /> <div class="formarea"> <div class="formrow"> <em class="label"><label>Username: </label></em> <strong><?php echo htmlspecialchars($user['username']); ?></strong> </div> <div class="formrow"> <em class="label"><label for="newpassword">New password: </label></em> <input id="newpassword" name="newpassword" type="password" size="20" class="textbox" autofocus="autofocus" /> </div> <div class="formrow"> <em class="label"><label for="cnewpassword">Confirm new password: </label></em> <input id="cnewpassword" name="cnewpassword" type="password" size="20" class="textbox" /> </div> <div class="buttonrow"> <button type="submit"><strong>Change password</strong></button> </div> </div> </form> <?php } } ?> </div> <?php includeFooter(); ?>
{ "pile_set_name": "Github" }