text
stringlengths 2
9.78k
| meta
dict |
|---|---|
{
"type": "bundle",
"id": "bundle--298fe966-72ff-41af-91bb-c56ecd399c50",
"spec_version": "2.0",
"objects": [
{
"created_by_ref": "identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5",
"object_marking_refs": [
"marking-definition--fa42a846-8d90-4e51-bc29-71d5b4802168"
],
"source_ref": "malware--6fcaf9b0-b509-4644-9f93-556222c81ed2",
"target_ref": "attack-pattern--6683aa0c-d98a-4f5b-ac57-ca7e9934a760",
"external_references": [
{
"description": "GReAT. (2019, June 26). ViceLeaker Operation: mobile espionage targeting Middle East. Retrieved November 21, 2019.",
"url": "https://securelist.com/fanning-the-flames-viceleaker-operation/90877/",
"source_name": "SecureList - ViceLeaker 2019"
},
{
"source_name": "Bitdefender - Triout 2018",
"url": "https://labs.bitdefender.com/2018/08/triout-spyware-framework-for-android-with-extensive-surveillance-capabilities/",
"description": "L. Arsene, C. Ochinca. (2018, August 20). Triout \u2013 Spyware Framework for Android with Extensive Surveillance Capabilities. Retrieved January 21, 2020."
}
],
"description": "[ViceLeaker](https://attack.mitre.org/software/S0418) can record audio from the device\u2019s microphone and can record phone calls together with the caller ID.(Citation: SecureList - ViceLeaker 2019)(Citation: Bitdefender - Triout 2018)",
"relationship_type": "uses",
"id": "relationship--f632b0bb-69ce-4678-bc3c-9ddff5a38794",
"type": "relationship",
"modified": "2020-01-21T14:20:50.474Z",
"created": "2019-11-21T16:42:48.488Z"
}
]
}
|
{
"pile_set_name": "Github"
}
|
################################################################################
#
# libcli
#
################################################################################
LIBCLI_VERSION = c63c9d35144939c8b4fa3c5394aed2e29ff517b0
LIBCLI_SITE = $(call github,dparrish,libcli,$(LIBCLI_VERSION))
LIBCLI_LICENSE = LGPL-2.1
LIBCLI_LICENSE_FILES = COPYING
LIBCLI_INSTALL_STAGING = YES
# We will pass optimisation level via CFLAGS so remove libcli default
LIBCLI_MAKE_ARGS += OPTIM=
# We can't run the test harness
LIBCLI_MAKE_ARGS += TESTS=
# Disable the static library for shared only build
ifeq ($(BR2_SHARED_LIBS),y)
LIBCLI_MAKE_ARGS += STATIC_LIB=
endif
# Disable the shared library for static only build
ifeq ($(BR2_STATIC_LIBS),y)
LIBCLI_MAKE_ARGS += DYNAMIC_LIB=
endif
define LIBCLI_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
$(LIBCLI_MAKE_ARGS)
endef
define LIBCLI_INSTALL_STAGING_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
$(LIBCLI_MAKE_ARGS) DESTDIR=$(STAGING_DIR) PREFIX=/usr install
endef
define LIBCLI_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
$(LIBCLI_MAKE_ARGS) DESTDIR=$(TARGET_DIR) PREFIX=/usr install
endef
$(eval $(generic-package))
|
{
"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">
<head>
<title>CSS Test: Grid-column with a negative value</title>
<link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
<link rel="help" href="http://dev.w3.org/csswg/css3-grid-align/#grid-declaration" />
<meta name="flags" content="ahem invalid" />
<meta name="assert" content="The 'grid-column' with a negative value is invalid and inserts the grid-item in the first column." />
<script src="../../../../libs/jquery-1.9.1.min.js"></script>
<script src="../../../../grid-layout-polyfill.js"></script>
<style type="text/css">
#test
{
color: green;
display: -ms-grid;
display: -moz-grid;
display: -o-grid;
display: -webkit-grid;
display: grid;
font: 20px/1 ahem;
height: 3em;
-ms-grid-columns: auto 1fr;
-moz-grid-columns: auto 1fr;
-o-grid-columns: auto 1fr;
-webkit-grid-columns: auto 1fr;
grid-columns: auto 1fr;
-ms-grid-rows: auto 1fr;
-moz-grid-rows: auto 1fr;
-o-grid-rows: auto 1fr;
-webkit-grid-rows: auto 1fr;
grid-rows: auto 1fr;
}
#griditem
{
color: red;
-ms-grid-column: -1;
-moz-grid-column: -1;
-o-grid-column: -1;
-webkit-grid-column: -1;
grid-column: -1;
-ms-grid-row: 1;
-moz-grid-row: 1;
-o-grid-row: 1;
-webkit-grid-row: 1;
grid-row: 1;
}
</style>
</head>
<body>
<p>Test passes if there is no red visible on the page.</p>
<div id="test">
<div id="griditem">XXXX</div>
<div>XXXXX</div>
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.tencentcloudapi.clb.v20180317.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class CreateTopicRequest extends AbstractModel{
/**
* 日志主题的名字
*/
@SerializedName("TopicName")
@Expose
private String TopicName;
/**
* 主题分区 partition个数,不传参默认创建1个,最大创建允许10个,分裂/合并操作会改变分区数量,整体上限50个。
*/
@SerializedName("PartitionCount")
@Expose
private Long PartitionCount;
/**
* Get 日志主题的名字
* @return TopicName 日志主题的名字
*/
public String getTopicName() {
return this.TopicName;
}
/**
* Set 日志主题的名字
* @param TopicName 日志主题的名字
*/
public void setTopicName(String TopicName) {
this.TopicName = TopicName;
}
/**
* Get 主题分区 partition个数,不传参默认创建1个,最大创建允许10个,分裂/合并操作会改变分区数量,整体上限50个。
* @return PartitionCount 主题分区 partition个数,不传参默认创建1个,最大创建允许10个,分裂/合并操作会改变分区数量,整体上限50个。
*/
public Long getPartitionCount() {
return this.PartitionCount;
}
/**
* Set 主题分区 partition个数,不传参默认创建1个,最大创建允许10个,分裂/合并操作会改变分区数量,整体上限50个。
* @param PartitionCount 主题分区 partition个数,不传参默认创建1个,最大创建允许10个,分裂/合并操作会改变分区数量,整体上限50个。
*/
public void setPartitionCount(Long PartitionCount) {
this.PartitionCount = PartitionCount;
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "TopicName", this.TopicName);
this.setParamSimple(map, prefix + "PartitionCount", this.PartitionCount);
}
}
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
*
* Copyright(c) 2009 - 2014 Intel Corporation. All rights reserved.
*
* 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.
*
* You should have received a copy of the GNU General Public License along with
* this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* Intel Linux Wireless <linuxwifi@intel.com>
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*
*****************************************************************************/
#if !defined(__IWLWIFI_DEVICE_TRACE_MSG) || defined(TRACE_HEADER_MULTI_READ)
#define __IWLWIFI_DEVICE_TRACE_MSG
#include <linux/tracepoint.h>
#undef TRACE_SYSTEM
#define TRACE_SYSTEM iwlwifi_msg
#define MAX_MSG_LEN 110
DECLARE_EVENT_CLASS(iwlwifi_msg_event,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf),
TP_STRUCT__entry(
__dynamic_array(char, msg, MAX_MSG_LEN)
),
TP_fast_assign(
WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
MAX_MSG_LEN, vaf->fmt,
*vaf->va) >= MAX_MSG_LEN);
),
TP_printk("%s", __get_str(msg))
);
DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_err,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf)
);
DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_warn,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf)
);
DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_info,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf)
);
DEFINE_EVENT(iwlwifi_msg_event, iwlwifi_crit,
TP_PROTO(struct va_format *vaf),
TP_ARGS(vaf)
);
TRACE_EVENT(iwlwifi_dbg,
TP_PROTO(u32 level, bool in_interrupt, const char *function,
struct va_format *vaf),
TP_ARGS(level, in_interrupt, function, vaf),
TP_STRUCT__entry(
__field(u32, level)
__field(u8, in_interrupt)
__string(function, function)
__dynamic_array(char, msg, MAX_MSG_LEN)
),
TP_fast_assign(
__entry->level = level;
__entry->in_interrupt = in_interrupt;
__assign_str(function, function);
WARN_ON_ONCE(vsnprintf(__get_dynamic_array(msg),
MAX_MSG_LEN, vaf->fmt,
*vaf->va) >= MAX_MSG_LEN);
),
TP_printk("%s", __get_str(msg))
);
#endif /* __IWLWIFI_DEVICE_TRACE_MSG */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE iwl-devtrace-msg
#include <trace/define_trace.h>
|
{
"pile_set_name": "Github"
}
|
class CreateCategoryNotifications < ActiveRecord::Migration
def change
create_table :category_notifications do |t|
t.integer :user_id, null: false
t.integer :category_id, null: false
t.text :from_email, null: false
t.text :from_name, null: false
t.text :template_name, null: false
t.text :locale, null: false
t.timestamp :sent_at
t.timestamps
end
end
end
|
{
"pile_set_name": "Github"
}
|
///////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT NOTICE
//
// The following open source license statement does not apply to any
// entity in the Exception List published by FMSoft.
//
// For more information, please visit:
//
// https://www.fmsoft.cn/exception-list
//
//////////////////////////////////////////////////////////////////////////////
/*
* This file is part of MiniGUI, a mature cross-platform windowing
* and Graphics User Interface (GUI) support system for embedded systems
* and smart IoT devices.
*
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
* Copyright (C) 1998~2002, WEI Yongming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 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 <http://www.gnu.org/licenses/>.
*
* Or,
*
* As this program is a library, any link to this program must follow
* GNU General Public License version 3 (GPLv3). If you cannot accept
* GPLv3, you need to be licensed from FMSoft.
*
* If you have got a commercial license of this program, please use it
* under the terms and conditions of the commercial license.
*
* For more information about the commercial license, please refer to
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <sys/sem.h>
#include "define.h"
#include "xxvfbhdr.h"
#include "xxvfb_common.h"
#include "xxvfb_input.h"
XXVFBInfo xInfo;
static int displayid;
static int lockId = -1;
static char* data; //shell memory address
static int my_connect(int sockfd, struct sockaddr *address, int len)
{
return connect(sockfd, address, len);
}
static Display* InitXDisplay(Display* display, int* screen, unsigned int* dis_width, unsigned int* dis_height)
{
// 和X 服务器连接
if ((display=XOpenDisplay(NULL)) == NULL )
{
printf("Cannot connect to X server %s\n",XDisplayName(NULL));
exit(-1);
}
//获得缺省的 screen_num
*screen = DefaultScreen(display);
//获得屏幕的宽度和高度
*dis_width = DisplayWidth(display, *screen);
*dis_height = DisplayHeight(display, *screen);
return display;
}
static void initLock()
{
lockId = semget( displayid, 0, 0 );
}
static void lock()
{
if ( lockId == -1 )
initLock();
{
struct sembuf sops;
sops.sem_num = 0;
sops.sem_op = -1;
sops.sem_flg = SEM_UNDO;
semop(lockId,&sops,1);
}
}
static void unlock()
{
if ( lockId >= 0 ) {
struct sembuf sops;
sops.sem_num = 0;
sops.sem_op = +1;
sops.sem_flg = SEM_UNDO;
semop(lockId,&sops,1);
}
}
static void DrawDirtyRect()
{
int width, height, length;
char* mem_data;
char* fb_data;
int bpp = (xInfo.xhdr->depth+7)/8;
if(!xInfo.xhdr->dirty) return;
lock();
if(xInfo.xhdr->dirty_rc_l < 0)
xInfo.xhdr->dirty_rc_l = 0;
if(xInfo.xhdr->dirty_rc_t < 0)
xInfo.xhdr->dirty_rc_t = 0;
if(xInfo.xhdr->dirty_rc_r > xInfo.xhdr->width)
xInfo.xhdr->dirty_rc_r = xInfo.xhdr->width;
if(xInfo.xhdr->dirty_rc_b > xInfo.xhdr->height)
xInfo.xhdr->dirty_rc_b = xInfo.xhdr->height;
width = xInfo.xhdr->dirty_rc_r - xInfo.xhdr->dirty_rc_l;
height = xInfo.xhdr->dirty_rc_b - xInfo.xhdr->dirty_rc_t;
length = bpp * width * height;
fb_data = data + xInfo.xhdr->fb_offset
+ xInfo.xhdr->pitch * xInfo.xhdr->dirty_rc_t
+ bpp * xInfo.xhdr->dirty_rc_l;
mem_data = (char*)calloc(1, length);
memcpy(mem_data,fb_data,length);
DrawImage(xInfo.xhdr->dirty_rc_l,xInfo.xhdr->dirty_rc_t,width,height,mem_data);
xInfo.xhdr->dirty = 0;
unlock();
}
static void MarkDrawAll()
{
lock();
xInfo.xhdr->dirty = True;
xInfo.xhdr->dirty_rc_l = xInfo.xhdr->dirty_rc_t = 0;
xInfo.xhdr->dirty_rc_r = xInfo.xhdr->width;
xInfo.xhdr->dirty_rc_b = xInfo.xhdr->height;
unlock();
}
static void EventProc(Display* display, Window win, GC gc, XEvent report)
{
Colormap colormap;
switch (report.type) {
//曝光事件, 窗口应重绘
case Expose:
MarkDrawAll();
break;
//窗口尺寸改变, 重新取得窗口的宽度和高度
case ConfigureNotify:
xInfo.xhdr->width = report.xconfigure.width;
xInfo.xhdr->height = report.xconfigure.height;
break;
case ButtonPress:
case ButtonRelease:
{
fprintf(stderr,"button release \n");
int x = report.xbutton.x ;
int y = report.xbutton.y ;
SendMouseData(x, y,(int)report.xbutton.button);
}
break;
case MotionNotify:
{
int x = report.xmotion.x;
int y = report.xmotion.y;
SendMouseData(x, y, (int)report.xbutton.button);
}
break;
case KeyPress:
{
int keycode = report.xkey.keycode;
int unicode = report.xkey.keycode;
setPressedKey(keycode,unicode);
if (isAlpha(keycode))
{
sendKeyboardData(unicode, keycode,
0,//e->state()&(ShiftButton|ControlButton|AltButton),
True, False);
}
else
{
sendKeyboardData(unicode, keycode,
0,//e->state()&(ShiftButton|ControlButton|AltButton),
True, False);
sendKeyboardData(unicode, keycode,
0,//e->state()&(ShiftButton|ControlButton|AltButton),
False, False);
}
}
|
{
"pile_set_name": "Github"
}
|
/**
* This file is copyright 2017 State of the Netherlands (Ministry of Interior Affairs and Kingdom Relations).
* It is made available under the terms of the GNU Affero General Public License, version 3 as published by the Free Software Foundation.
* The project of which this file is part, may be found at https://github.com/MinBZK/operatieBRP.
*/
package nl.bzk.brp.model.data.kern;
import org.springframework.roo.addon.dbre.RooDbManaged;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;
@RooJavaBean
@RooToString
@RooJpaActiveRecord(versionField = "", table = "bron", schema = "kern")
@RooDbManaged(automaticallyDelete = true)
public class Bron {
}
|
{
"pile_set_name": "Github"
}
|
# [PhantomJS](http://phantomjs.org) - Scriptable Headless WebKit
PhantomJS ([www.phantomjs.org](http://phantomjs.org)) is a headless WebKit scriptable with JavaScript or CoffeeScript. It is used by hundreds of [developers](https://github.com/ariya/phantomjs/wiki/Buzz) and dozens of [organizations](https://github.com/ariya/phantomjs/wiki/Users) for web-related development workflow.
The latest [stable release](http://phantomjs.org/release-1.9.html) is version 1.9 (codenamed <a href="http://phantomjs.org/release-names.html">"Sakura"</a>). Follow the official Twitter stream [@PhantomJS](http://twitter.com/PhantomJS) to get the frequent development updates.
**Note**: Please **do not** create a GitHub pull request **without** reading the [Contribution Guide](https://github.com/ariya/phantomjs/blob/master/CONTRIBUTING.md) first. Failure to do so may result in the rejection of the pull request.
## Use Cases
- **Headless web testing**. Lightning-fast testing without the browser is now possible! Various [test frameworks](https://github.com/ariya/phantomjs/wiki/Headless-Testing) such as Jasmine, Capybara, QUnit, Mocha, WebDriver, YUI Test, BusterJS, FuncUnit, Robot Framework, and many others are supported.
- **Page automation**. [Access and manipulate](https://github.com/ariya/phantomjs/wiki/Page-Automation) web pages with the standard DOM API, or with usual libraries like jQuery.
- **Screen capture**. Programmatically [capture web contents](https://github.com/ariya/phantomjs/wiki/Screen-Capture), including CSs, SVG and Canvas. Build server-side web graphics apps, from a screenshot service to a vector chart rasterizer.
- **Network monitoring**. Automate performance analysis, track [page loading](https://github.com/ariya/phantomjs/wiki/Network-Monitoring) and export as standard HAR format.
## Features
- **Multiplatform**, available on major operating systems: Windows, Mac OS X, Linux, other Unices.
- **Fast and native implementation** of web standards: DOM, CSS, JavaScript, Canvas, SVG. No emulation!
- **Pure headless (no X11) on Linux**, ideal for continuous integration systems. Also runs on Amazon EC2, Heroku, Iron.io.
- **Easy to install**: [Download](http://phantomjs.org/download.html), unpack, and start having fun in just 5 minutes.
## Ecosystem
PhantomJS needs not be used only as a stand-alone tool. Check also some excellent related projects:
- [CasperJS](http://casperjs.org) enables easy navigation scripting and common high-level testing.
- [Poltergeist](https://github.com/jonleighton/poltergeist) allows running Capybara tests headlessly.
- [Guard::Jasmine](https://github.com/netzpirat/guard-jasmine) automatically tests Jasmine specs on Rails when files are modified.
- [GhostDriver](http://github.com/detro/ghostdriver/) complements Selenium tests with a PhantomJS WebDriver implementation.
- [PhantomRobot](https://github.com/datakurre/phantomrobot) runs Robot Framework acceptance tests in the background via PhantomJS.
- [Mocha-PhantomJS](https://github.com/metaskills/mocha-phantomjs) run Mocha tests using PhantomJS.
and many others [related projects](https://github.com/ariya/phantomjs/wiki/Related-Projects).
## Questions?
- Explore the complete [documentation](https://github.com/ariya/phantomjs/wiki)
- Read tons of [user articles](https://github.com/ariya/phantomjs/wiki/Buzz) on using PhantomJS.
- Join the [mailing-list](http://groups.google.com/group/phantomjs) and discuss with other PhantomJS fans.
PhantomJS is free software/open source, and is distributed under the [BSD license](http://opensource.org/licenses/BSD-3-Clause). It contains third-party code, see the included `third-party.txt` file for the license information on third-party code.
PhantomJS is created and maintained by [Ariya Hidayat](http://ariya.ofilabs.com/about) (Twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)), with the help of [many contributors](https://github.com/ariya/phantomjs/contributors).
|
{
"pile_set_name": "Github"
}
|
// SPDX-License-Identifier: GPL-2.0+
/*
* Platform keyring for firmware/platform keys
*
* Copyright IBM Corporation, 2018
* Author(s): Nayna Jain <nayna@linux.ibm.com>
*/
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/cred.h>
#include <linux/err.h>
#include <linux/slab.h>
#include "../integrity.h"
/**
* add_to_platform_keyring - Add to platform keyring without validation.
* @source: Source of key
* @data: The blob holding the key
* @len: The length of the data blob
*
* Add a key to the platform keyring without checking its trust chain. This
* is available only during kernel initialisation.
*/
void __init add_to_platform_keyring(const char *source, const void *data,
size_t len)
{
key_perm_t perm;
int rc;
perm = (KEY_POS_ALL & ~KEY_POS_SETATTR) | KEY_USR_VIEW;
rc = integrity_load_cert(INTEGRITY_KEYRING_PLATFORM, source, data, len,
perm);
if (rc)
pr_info("Error adding keys to platform keyring %s\n", source);
}
/*
* Create the trusted keyrings.
*/
static __init int platform_keyring_init(void)
{
int rc;
rc = integrity_init_keyring(INTEGRITY_KEYRING_PLATFORM);
if (rc)
return rc;
pr_notice("Platform Keyring initialized\n");
return 0;
}
/*
* Must be initialised before we try and load the keys into the keyring.
*/
device_initcall(platform_keyring_init);
|
{
"pile_set_name": "Github"
}
|
tests/complex/netconvert/left_turn_noblocking_longveh/runner.py
|
{
"pile_set_name": "Github"
}
|
<component name="libraryTable">
<library name="imagepipeline-1.0.1">
<CLASSES>
<root url="file://$USER_HOME$/.android/build-cache/60f1a5f515e677243597b382d4ec69fca7476766/output/res" />
<root url="jar://$USER_HOME$/.android/build-cache/60f1a5f515e677243597b382d4ec69fca7476766/output/jars/classes.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.facebook.fresco/imagepipeline/1.0.1/6b7938b9810e73be111101ee184e01b2a4ec59c5/imagepipeline-1.0.1-sources.jar!/" />
</SOURCES>
</library>
</component>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2013, OpenCloudDB/MyCAT and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software;Designed and Developed mainly by many Chinese
* opensource volunteers. you can redistribute it and/or modify it under the
* terms of the GNU General Public License version 2 only, as published by the
* Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Any questions about this component can be directed to it's project Web address
* https://code.google.com/p/opencloudb/.
*
*/
package io.mycat.util;
import java.nio.charset.Charset;
import java.util.Date;
public class ByteUtil {
/**
* compare to number or dicamal ascii byte array, for number :123456 ,store
* to array [1,2,3,4,5,6]
*
* @param b1
* @param b2
* @return -1 means b1 < b2, or 0 means b1=b2 else return 1
*/
public static int compareNumberByte(byte[] b1, byte[] b2) {
if(b1 == null || b1.length == 0) {
return -1;
}
else if(b2 == null || b2.length == 0) {
return 1;
}
boolean isNegetive = b1[0] == 45 || b2[0] == 45;
if (isNegetive == false && b1.length != b2.length) {
return b1.length - b2.length;
}
int len = b1.length > b2.length ? b2.length : b1.length;
int result = 0;
int index = -1;
for (int i = 0; i < len; i++) {
int b1val = b1[i];
int b2val = b2[i];
if (b1val > b2val) {
result = 1;
index = i;
break;
} else if (b1val < b2val) {
index = i;
result = -1;
break;
}
}
if (index == 0) {
// first byte compare
return result;
} else {
if( b1.length != b2.length ) {
int lenDelta = b1.length - b2.length;
return isNegetive ? 0 - lenDelta : lenDelta;
} else {
return isNegetive ? 0 - result : result;
}
}
}
public static byte[] compareNumberArray2(byte[] b1, byte[] b2, int order) {
if (b1.length <= 0 && b2.length > 0) {
return b2;
}
if (b1.length > 0 && b2.length <= 0) {
return b1;
}
int len = b1.length > b2.length ? b1.length : b2.length;
for (int i = 0; i < len; i++) {
if (b1[i] != b2[i]) {
if (order == 1) {
return ((b1[i] & 0xff) - (b2[i] & 0xff)) > 0 ? b1 : b2;
} else {
return ((b1[i] & 0xff) - (b2[i] & 0xff)) > 0 ? b2 : b1;
}
}
}
return b1;
}
public static byte[] getBytes(short data) {
byte[] bytes = new byte[2];
bytes[0] = (byte) (data & 0xff);
bytes[1] = (byte) ((data & 0xff00) >> 8);
return bytes;
}
public static byte[] getBytes(char data) {
byte[] bytes = new byte[2];
bytes[0] = (byte) (data);
bytes[1] = (byte) (data >> 8);
return bytes;
}
public static byte[] getBytes(int data) {
byte[] bytes = new byte[4];
bytes[0] = (byte) (data & 0xff);
bytes[1] = (byte) ((data & 0xff00) >> 8);
bytes[2] = (byte) ((data & 0xff0000) >> 16);
bytes[3] = (byte) ((data & 0xff000000) >> 24);
return bytes;
}
public static byte[] getBytes(long data) {
byte[] bytes = new byte[8];
bytes[0] = (byte) (data & 0xff);
bytes[1] = (byte) ((data >> 8) & 0xff);
bytes[2] = (byte) ((data >> 16) & 0xff);
bytes[3] = (byte) ((data >> 24) & 0xff);
bytes[4] = (byte) ((data >> 32) & 0xff);
bytes[5] = (byte) ((data >> 40) & 0xff);
bytes[6] = (byte) ((data >> 48) & 0xff);
bytes[7] = (byte) ((data >> 56) & 0xff);
return bytes;
}
public static byte[] getBytes(float data) {
int intBits = Float.floatToIntBits(data);
return getBytes(intBits);
}
public static byte[] getBytes(double data) {
long intBits = Double.doubleToLongBits(data);
return getBytes(intBits);
}
public static byte[] getBytes(String data, String charsetName) {
Charset charset = Charset.forName(charsetName);
return data.getBytes(charset);
}
public static byte[] getBytes(String data) {
return getBytes(data, "GBK");
}
public static short getShort(byte[] bytes) {
return Short.parseShort(new String(bytes));
// return (short) ((0xff & bytes[0]) | (0xff00 & (bytes[1] << 8)));
}
public static char getChar(byte[] bytes) {
return (char) ((0xff & bytes[0]) | (0xff00 & (bytes[1] << 8)));
}
public static int getInt(byte[] bytes) {
return Integer.parseInt(new String(bytes));
// return (0xff & bytes[0]) | (0xff00 & (bytes[1] << 8)) | (0xff0000 &
// (bytes[2] << 16)) | (0xff000000 & (bytes[3] << 24));
}
public static long getLong(byte[] bytes) {
return Long.parseLong(new String(bytes));
// return(0xffL & (long)bytes[0]) | (0xff00L & ((long)bytes[1] << 8)) |
// (0xff0000L & ((long)bytes[2] << 16)) | (0xff000000L & ((long)bytes[3]
// << 24))
// | (0xff00000000L & ((long)bytes[4] << 32)) | (0xff0000000000L &
// ((long)bytes[5] << 40)) | (0xff000000000000L & ((long)bytes[6] <<
// 48)) | (0xff00000000000000L & ((long)bytes[7] << 56));
}
public static double getDouble(byte[] bytes) {
return Double.parseDouble(new String(bytes));
}
public static float getFloat(byte[] bytes) {
return Float.parseFloat(new String(bytes));
}
public static String getString(byte[] bytes, String charsetName) {
return new String(bytes, Charset.forName(charsetName));
}
public static String getString(byte
|
{
"pile_set_name": "Github"
}
|
# CAVS 17.1
# Config Info for : "aesniavx+ssse3sha-64"
# TDES Monte Carlo (Modes) Test for OFB
# State : Encrypt and Decrypt
# Mon Aug 18 09:21:18 AM
[ENCRYPT]
NumKeys = 1
KEY1 = 1310e698cd83e001
KEY2 = 1310e698cd83e001
KEY3 = 1310e698cd83e001
IV = 7837b77338efe61d
PLAINTEXT = 73c63851a9e9c02c
[DECRYPT]
NumKeys = 1
KEY1 = 949d1c0294ce3bdc
KEY2 = 949d1c0294ce3bdc
KEY3 = 949d1c0294ce3bdc
IV = 8affd755b5393365
CIPHERTEXT = 64f14ca9f4db0267
|
{
"pile_set_name": "Github"
}
|
**Are you the copyright owner or authorized to act on the copyright owner’s behalf?**
Authorized Representative
**Please provide a detailed description of the original copyrighted work that has allegedly been infringed. If possible, include a URL to where it is posted online.**
Humana.com and the underlying code that helps run the site and its internal structures.
**What files should be taken down? Please provide URLs for each file, or if the entire repository, the repository’s URL:**
https://github.com/Zabed7/Humana_MavenProject
**Have you searched for any forks of the allegedly infringing files or repositories? Each fork is a distinct repository and must be identified separately if you believe it is infringing and wish to have it taken down.**
Yes, this entire repository appears to be related to the Humana Maven Project and is housing internal code and structures for the website.
**Is the work licensed under an open source license? If so, which open source license? Are the allegedly infringing files being used under the open source license, or are they in violation of the license?**
Violations of the license.
**What would be the best solution for the alleged infringement? Are there specific changes the other person can make other than removal? Can the repository be made private?**
Please remove this repository.
**Do you have the alleged infringer’s contact information? If so, please provide it:**
https://github.com/Zabed7
**Type (or copy and paste) the following statement: "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 have taken fair use into consideration."**
"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 have taken fair use into consideration."
**Type (or copy and paste) the following statement: "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."**
"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."
**Please confirm that you have you have read our Guide to Submitting a DMCA Takedown Notice: https://help.github.com/articles/guide-to-submitting-a-dmca-takedown-notice/**
I confirm I have read them.
**So that we can get back to you, please provide either your telephone number or physical address:**
[private]
**Please type your full legal name below to sign this request:**
[private]
|
{
"pile_set_name": "Github"
}
|
Git è un "sistema di controllo versione" utilizzato da molti programmatori. Questo software può tracciare le modifiche ai file nel corso del tempo, così da poter ripristinare successivamente una specifica versione. Un po' come la funzione "revisioni" nei programmi di elaborazione di testi (come Microsoft Word o LibreOffice), ma molto più potente.
## Installare Git
<!--sec data-title="Installing Git: Windows" data-id="git_install_windows"
data-collapse=true ces-->
È possibile scaricare Git da [git-scm.com](https://git-scm.com/). Puoi saltare tutti i passaggi tranne due: nel passaggio dove ti chiede di scegliere l'editor, dovrai selezionare Nano, e nel passaggio "Regolazione della variabile di ambiente PATH", seleziona "Esegui Git e gli strumenti Unix opzionali dal prompt dei comandi di Windows" (l'opzione in basso). A parte questo, i valori predefiniti vanno bene. 'Checkout Windows-style' e 'commit Unix-style line endings' vanno bene.
Non dimenticare di riavviare il prompt dei comandi o la powershell dopo che l'installazione è terminata con successo. <!--endsec-->
<!--sec data-title="Installing Git: OS X" data-id="git_install_OSX"
data-collapse=true ces-->
Scarica Git da [git-scm.com](https://git-scm.com/) e segui le istruzioni.
> **Nota** Se stai usando OS X 10.6, 10.7 o 10.8, dovrai installare la versione di Git da qui: [Git installer for OS X Snow Leopard](https://sourceforge.net/projects/git-osx-installer/files/git-2.3.5-intel-universal-snow-leopard.dmg/download)
<!--endsec-->
<!--sec data-title="Installing Git: Debian or Ubuntu" data-id="git_install_debian_ubuntu"
data-collapse=true ces-->
{% filename %}command-line{% endfilename %}
```bash
$ sudo apt install git
```
<!--endsec-->
<!--sec data-title="Installing Git: Fedora" data-id="git_install_fedora"
data-collapse=true ces-->
{% filename %}command-line{% endfilename %}
```bash
$ sudo dnf install git
```
<!--endsec-->
<!--sec data-title="Installing Git: openSUSE" data-id="git_install_openSUSE"
data-collapse=true ces-->
{% filename %}command-line{% endfilename %}
```bash
$ sudo zypper install git
```
<!--endsec-->
|
{
"pile_set_name": "Github"
}
|
#ifndef AMGCL_RELAXATION_ILUK_HPP
#define AMGCL_RELAXATION_ILUK_HPP
/*
The MIT License
Copyright (c) 2012-2019 Denis Demidov <dennis.demidov@gmail.com>
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.
*/
/**
* \file amgcl/relaxation/iluk.hpp
* \author Denis Demidov <dennis.demidov@gmail.com>
* \brief Incomplete LU with fill-in level.
*/
#include <vector>
#include <deque>
#include <queue>
#include <cmath>
#include <amgcl/backend/builtin.hpp>
#include <amgcl/util.hpp>
#include <amgcl/relaxation/detail/ilu_solve.hpp>
namespace amgcl {
namespace relaxation {
/// ILU(k) smoother.
template <class Backend>
struct iluk {
typedef typename Backend::value_type value_type;
typedef typename Backend::matrix matrix;
typedef typename Backend::matrix_diagonal matrix_diagonal;
typedef typename Backend::vector vector;
typedef typename math::scalar_of<value_type>::type scalar_type;
typedef detail::ilu_solve<Backend> ilu_solve;
/// Relaxation parameters.
struct params {
/// Level of fill-in.
int k;
/// Damping factor.
scalar_type damping;
/// Parameters for sparse triangular system solver
typename ilu_solve::params solve;
params() : k(1), damping(1) {}
#ifndef AMGCL_NO_BOOST
params(const boost::property_tree::ptree &p)
: AMGCL_PARAMS_IMPORT_VALUE(p, k)
, AMGCL_PARAMS_IMPORT_VALUE(p, damping)
, AMGCL_PARAMS_IMPORT_CHILD(p, solve)
{
check_params(p, {"k", "damping", "solve"});
}
void get(boost::property_tree::ptree &p, const std::string &path) const {
AMGCL_PARAMS_EXPORT_VALUE(p, path, k);
AMGCL_PARAMS_EXPORT_VALUE(p, path, damping);
AMGCL_PARAMS_EXPORT_CHILD(p, path, solve);
}
#endif
} prm;
/// \copydoc amgcl::relaxation::damped_jacobi::damped_jacobi
template <class Matrix>
iluk( const Matrix &A, const params &prm, const typename Backend::params &bprm)
: prm(prm)
{
typedef typename backend::builtin<value_type>::matrix build_matrix;
const size_t n = backend::rows(A);
size_t Anz = backend::nonzeros(A);
std::vector<ptrdiff_t> Lptr; Lptr.reserve(n+1); Lptr.push_back(0);
std::vector<ptrdiff_t> Lcol; Lcol.reserve(Anz / 3);
std::vector<value_type> Lval; Lval.reserve(Anz / 3);
std::vector<ptrdiff_t> Uptr; Uptr.reserve(n+1); Uptr.push_back(0);
std::vector<ptrdiff_t> Ucol; Ucol.reserve(Anz / 3);
std::vector<value_type> Uval; Uval.reserve(Anz / 3);
std::vector<int> Ulev; Ulev.reserve(Anz / 3);
auto D = std::make_shared<backend::numa_vector<value_type> >(n, false);
sparse_vector w(n, prm.k);
for(ptrdiff_t i = 0; i < static_cast<ptrdiff_t>(n); ++i) {
w.reset(i);
for(auto a = backend::row_begin(A, i); a; ++a) {
w.add(a.col(), a.value(), 0);
}
while(!w.q.empty()) {
nonzero &a = w.next_nonzero();
a.val = a.val * (*D)[a.col];
for(ptrdiff_t j = Uptr[a.col], e = Uptr[a.col+1]; j < e; ++j) {
int lev = std::max(a.lev, Ulev[j]) + 1;
w.add(Ucol[j], -a.val * Uval[j], lev);
}
}
w.sort();
for(const nonzero &e : w.nz) {
if (e.col < i) {
Lcol.push_back(e.col);
Lval.push_back(e.val);
} else if (e.col == i) {
(*D)[i] = math::inverse(e.val);
} else {
Ucol.push_back(e.col);
Uval.push_back(e.val);
Ulev.push_back(e.lev);
}
}
Lptr.push_back(Lcol.size());
Uptr.push_back(Ucol.size());
}
ilu = std::make_shared<ilu_solve>(
std::make_shared<build_matrix>(n, n, Lptr, Lcol, Lval),
std::make_shared<build_matrix>(n, n, Uptr, Ucol, Uval),
D, prm.solve, bprm);
}
/// \copydoc amgcl::relaxation::damped_jacobi::apply_pre
template <class Matrix, class VectorRHS, class VectorX, class VectorTMP>
void apply_pre(
const Matrix &A, const VectorRHS &rhs, VectorX &x, VectorTMP &tmp
) const
{
backend::residual(rhs, A, x, tmp);
ilu->solve(tmp);
backend::axpby(prm.damping, tmp, math::identity<scalar_type>(), x);
}
/// \copydoc amgcl::relaxation::damped_jacobi::apply_post
template <class Matrix, class VectorRHS, class VectorX, class VectorTMP>
void apply_post(
const Matrix &A, const VectorRHS &rhs, VectorX &x, VectorTMP &tmp
) const
{
backend::residual(rhs, A, x, tmp);
ilu->solve(tmp);
backend::axpby(prm.damping, tmp, math::identity<scalar_type>(), x);
}
template <class Matrix, class VectorRHS, class VectorX>
void apply(const Matrix&, const VectorRHS &rhs, VectorX &x) const
{
backend::copy(rhs, x);
ilu->solve(x);
}
size_t bytes() const {
return ilu->bytes();
}
private:
std::shared_ptr<ilu_solve> ilu;
struct nonzero {
ptrdiff_t col;
value_type val;
int lev;
|
{
"pile_set_name": "Github"
}
|
{
"services": {
"repository-manager": {
"class": "./../RepositoryManager",
"arguments": ["!tagged repository"]
},
"repository-foo": {
"class": "./../RepositoryFoo",
"tags": [{ "name": "repository" }]
},
"repository-bar": {
"class": "./../RepositoryBar",
"tags": [{ "name": "repository" }]
}
}
}
|
{
"pile_set_name": "Github"
}
|
# The contents of this file are subject to the Common Public Attribution
# License Version 1.0. (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, but Sections 14 and 15 have been added to cover use of
# software over a computer network and provide for limited attribution for the
# Original Developer. In addition, Exhibit A has been modified to be consistent
# with Exhibit B.
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
# the specific language governing rights and limitations under the License.
#
# The Original Code is reddit.
#
# The Original Developer is the Initial Developer. The Initial Developer of
# the Original Code is reddit Inc.
#
# All portions of the code written by reddit are Copyright (c) 2006-2015 reddit
# Inc. All Rights Reserved.
###############################################################################
"""A delayed execution system.
The ``trylater`` module provides tools for performing an action at a set time
in the future. To use it, you must do two things.
First, make a scheduling call::
from datetime import timedelta
from r2.models.trylater import TryLater
def make_breakfast(spam):
breakfast = cook(spam)
later = timedelta(minutes=45)
# The storage layer only likes strings.
data = json.dumps(breakfast)
TryLater.schedule('wash_dishes', data, later)
Then, write the delayed code and decorate it with a hook, using the same
identifier as you used when you scheduled it::
from r2.lib import hooks
trylater_hooks = hooks.HookRegistrar()
@trylater_hooks.on('trylater.wash_dishes')
def on_dish_washing(data):
# data is an ordered dictionary of timeuuid -> data pairs.
for datum in data.values():
meal = json.loads(datum)
for dish in meal.dishes:
dish.wash()
Note: once you've scheduled a ``TryLater`` task, there's no stopping it! If
you might need to cancel your jobs later, use ``TryLaterBySubject``, which uses
almost the exact same semantics, but has a useful ``unschedule`` method.
"""
from collections import OrderedDict
from datetime import datetime, timedelta
import uuid
from pycassa.system_manager import TIME_UUID_TYPE, UTF8_TYPE
from pycassa.util import convert_uuid_to_time
from pylons import app_globals as g
from r2.lib.db import tdb_cassandra
from r2.lib.utils import tup
class TryLater(tdb_cassandra.View):
_use_db = True
_read_consistency_level = tdb_cassandra.CL.QUORUM
_write_consistency_level = tdb_cassandra.CL.QUORUM
_compare_with = TIME_UUID_TYPE
@classmethod
def process_ready_items(cls, rowkey, ready_fn):
cutoff = datetime.now(g.tz)
columns = cls._cf.xget(rowkey, include_timestamp=True)
ready_items = OrderedDict()
ready_timestamps = []
unripe_timestamps = []
for ready_time_uuid, (data, timestamp) in columns:
ready_time = convert_uuid_to_time(ready_time_uuid)
ready_datetime = datetime.fromtimestamp(ready_time, tz=g.tz)
if ready_datetime <= cutoff:
ready_items[ready_time_uuid] = data
ready_timestamps.append(timestamp)
else:
unripe_timestamps.append(timestamp)
g.stats.simple_event(
"trylater.{system}.ready".format(system=rowkey),
delta=len(ready_items),
)
g.stats.simple_event(
"trylater.{system}.pending".format(system=rowkey),
delta=len(unripe_timestamps),
)
if not ready_items:
return
try:
ready_fn(ready_items)
except:
g.stats.simple_event(
"trylater.{system}.failed".format(system=rowkey),
)
cls.cleanup(rowkey, ready_items, ready_timestamps, unripe_timestamps)
@classmethod
def cleanup(cls, rowkey, ready_items, ready_timestamps, unripe_timestamps):
"""Remove ALL ready items from the C* row"""
if (not unripe_timestamps or
min(unripe_timestamps) > max(ready_timestamps)):
# do a row/timestamp delete to avoid generating column
# tombstones
cls._cf.remove(rowkey, timestamp=max(ready_timestamps))
g.stats.simple_event(
"trylater.{system}.row_delete".format(system=rowkey),
delta=len(ready_items),
)
else:
# the columns weren't created with a fixed delay and there are some
# unripe items with older (lower) timestamps than the items we want
# to delete. fallback to deleting specific columns.
cls._cf.remove(rowkey, ready_items.keys())
g.stats.simple_event(
"trylater.{system}.column_delete".format(system=rowkey),
delta=len(ready_items),
)
@classmethod
def run(cls):
"""Run all ready items through their processing hook."""
from r2.lib import amqp
from r2.lib.hooks import all_hooks
for hook_name, hook in all_hooks().items():
if hook_name.startswith("trylater."):
rowkey = hook_name[len("trylater."):]
def ready_fn(ready_items):
return hook.call(data=ready_items)
g.log.info("Trying %s", rowkey)
cls.process_ready_items(rowkey, ready_fn)
amqp.worker.join()
g.stats.flush()
@classmethod
def search(cls, rowkey, when):
if isinstance(when, uuid.UUID):
when = convert_uuid_to_time(when)
try:
return cls._cf.get(rowkey, column_start=when, column_finish=when)
except tdb_cassandra.NotFoundException:
return {}
@classmethod
def schedule(cls, system, data, delay=None):
"""Schedule code for later execution.
system: an string identifying the hook to be executed
data: passed to the hook as an argument
delay: (optional) a datetime.timedelta indicating the desired
execution time
"""
if delay is None:
delay = timedelta(minutes=60)
key = datetime.now(g.tz) + delay
scheduled = {key: data}
cls._set_values(system, scheduled)
return scheduled
@classmethod
def unschedule(cls, rowkey, column_keys):
column_keys = tup(column_keys)
return cls._cf.remove(rowkey, column_keys)
class TryLaterBySubject(tdb_cassandra.View):
_use_db = True
_read_consistency_level = tdb_cassandra.CL.QUORUM
_write_consistency_level = tdb_cassandra.CL.QUORUM
_compare_with = UTF8_TYPE
_extra_schema_creation_args = {
"key_validation_class": UTF8_TYPE,
"default_validation_class": TIME_UUID_TYPE,
}
_value_type = 'date'
@classmethod
def schedule(cls, system, subject, data, delay, trylater_rowkey=None):
if trylater_rowkey is None:
trylater_rowkey = system
|
{
"pile_set_name": "Github"
}
|
<annotation>
<folder>less_selected</folder>
<filename>videoplayback0808.jpg</filename>
<size>
<width>1000</width>
<height>563</height>
</size>
<segmented>0</segmented>
<object>
<name>Tie Fighter</name>
<bndbox>
<xmin>181</xmin>
<ymin>181</ymin>
<xmax>192</xmax>
<ymax>192</ymax>
</bndbox>
</object>
<object>
<name>Millennium Falcon</name>
<bndbox>
<xmin>271</xmin>
<ymin>228</ymin>
<xmax>727</xmax>
<ymax>318</ymax>
</bndbox>
</object>
</annotation>
|
{
"pile_set_name": "Github"
}
|
package pflag
import (
"fmt"
"net"
"os"
"testing"
)
func setUpIP(ip *net.IP) *FlagSet {
f := NewFlagSet("test", ContinueOnError)
f.IPVar(ip, "address", net.ParseIP("0.0.0.0"), "IP Address")
return f
}
func TestIP(t *testing.T) {
testCases := []struct {
input string
success bool
expected string
}{
{"0.0.0.0", true, "0.0.0.0"},
{" 0.0.0.0 ", true, "0.0.0.0"},
{"1.2.3.4", true, "1.2.3.4"},
{"127.0.0.1", true, "127.0.0.1"},
{"255.255.255.255", true, "255.255.255.255"},
{"", false, ""},
{"0", false, ""},
{"localhost", false, ""},
{"0.0.0", false, ""},
{"0.0.0.", false, ""},
{"0.0.0.0.", false, ""},
{"0.0.0.256", false, ""},
{"0 . 0 . 0 . 0", false, ""},
}
devnull, _ := os.Open(os.DevNull)
os.Stderr = devnull
for i := range testCases {
var addr net.IP
f := setUpIP(&addr)
tc := &testCases[i]
arg := fmt.Sprintf("--address=%s", tc.input)
err := f.Parse([]string{arg})
if err != nil && tc.success == true {
t.Errorf("expected success, got %q", err)
continue
} else if err == nil && tc.success == false {
t.Errorf("expected failure")
continue
} else if tc.success {
ip, err := f.GetIP("address")
if err != nil {
t.Errorf("Got error trying to fetch the IP flag: %v", err)
}
if ip.String() != tc.expected {
t.Errorf("expected %q, got %q", tc.expected, ip.String())
}
}
}
}
|
{
"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.
// Flags: --expose-wasm
load("test/mjsunit/wasm/wasm-constants.js");
load("test/mjsunit/wasm/wasm-module-builder.js");
(function() {
var builder = new WasmModuleBuilder();
builder.addMemory(1, 1, false);
builder.addFunction("foo", kSig_i_v)
.addBody([
kExprI32Const, 00,
kExprMemorySize,
kExprBrIf, 00,
kExprMemorySize,
kExprBr, 0xe7, 0xd2, 0xf2, 0xff, 0x1d
])
.exportFunc();
assertThrows(function() { builder.instantiate(); });
})();
|
{
"pile_set_name": "Github"
}
|
/* Copyright (c) 2012 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.Collections.Generic;
namespace Gibbed.Borderlands2.GameInfo
{
public sealed class CustomizationDefinition
{
internal CustomizationDefinition()
{
}
public string ResourcePath { get; internal set; }
public string Name { get; internal set; }
public CustomizationType Type { get; internal set; }
public List<CustomizationUsage> Usage { get; internal set; }
public DownloadableContentDefinition DLC { get; internal set; }
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (c) Microsoft Corporation 2014
Copyright Rene Rivera 2015
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_PREDEF_PLAT_WINDOWS_RUNTIME_H
#define BOOST_PREDEF_PLAT_WINDOWS_RUNTIME_H
#include <boost/predef/make.h>
#include <boost/predef/os/windows.h>
#include <boost/predef/platform/windows_phone.h>
#include <boost/predef/platform/windows_store.h>
#include <boost/predef/version_number.h>
/*`
[heading `BOOST_PLAT_WINDOWS_RUNTIME`]
Deprecated.
[@https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide UWP]
for Windows Phone or Store development. This does not align to the existing development model for
UWP and is deprecated. Use one of the other `BOOST_PLAT_WINDOWS_*`definitions instead.
[table
[[__predef_symbol__] [__predef_version__]]
[[`BOOST_PLAT_WINDOWS_PHONE`] [__predef_detection__]]
[[`BOOST_PLAT_WINDOWS_STORE`] [__predef_detection__]]
]
*/
#define BOOST_PLAT_WINDOWS_RUNTIME BOOST_VERSION_NUMBER_NOT_AVAILABLE
#if BOOST_OS_WINDOWS && \
(BOOST_PLAT_WINDOWS_STORE || BOOST_PLAT_WINDOWS_PHONE)
# undef BOOST_PLAT_WINDOWS_RUNTIME
# define BOOST_PLAT_WINDOWS_RUNTIME BOOST_VERSION_NUMBER_AVAILABLE
#endif
#if BOOST_PLAT_WINDOWS_RUNTIME
# define BOOST_PLAT_WINDOWS_RUNTIME_AVAILABLE
# include <boost/predef/detail/platform_detected.h>
#endif
#define BOOST_PLAT_WINDOWS_RUNTIME_NAME "Windows Runtime"
#endif
#include <boost/predef/detail/test.h>
BOOST_PREDEF_DECLARE_TEST(BOOST_PLAT_WINDOWS_RUNTIME,BOOST_PLAT_WINDOWS_RUNTIME_NAME)
|
{
"pile_set_name": "Github"
}
|
// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineMode("rpm-changes", function() {
var headerSeperator = /^-+$/;
var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /;
var simpleEmail = /^[\w+.-]+@[\w.-]+/;
return {
token: function(stream) {
if (stream.sol()) {
if (stream.match(headerSeperator)) { return 'tag'; }
if (stream.match(headerLine)) { return 'tag'; }
}
if (stream.match(simpleEmail)) { return 'string'; }
stream.next();
return null;
}
};
});
CodeMirror.defineMIME("text/x-rpm-changes", "rpm-changes");
// Quick and dirty spec file highlighting
CodeMirror.defineMode("rpm-spec", function() {
var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/;
var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/;
var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/;
var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros
var control_flow_simple = /^%(else|endif)/; // rpm control flow macros
var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros
return {
startState: function () {
return {
controlFlow: false,
macroParameters: false,
section: false
};
},
token: function (stream, state) {
var ch = stream.peek();
if (ch == "#") { stream.skipToEnd(); return "comment"; }
if (stream.sol()) {
if (stream.match(preamble)) { return "preamble"; }
if (stream.match(section)) { return "section"; }
}
if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT'
if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}'
if (stream.match(control_flow_simple)) { return "keyword"; }
if (stream.match(control_flow_complex)) {
state.controlFlow = true;
return "keyword";
}
if (state.controlFlow) {
if (stream.match(operators)) { return "operator"; }
if (stream.match(/^(\d+)/)) { return "number"; }
if (stream.eol()) { state.controlFlow = false; }
}
if (stream.match(arch)) { return "number"; }
// Macros like '%make_install' or '%attr(0775,root,root)'
if (stream.match(/^%[\w]+/)) {
if (stream.match(/^\(/)) { state.macroParameters = true; }
return "macro";
}
if (state.macroParameters) {
if (stream.match(/^\d+/)) { return "number";}
if (stream.match(/^\)/)) {
state.macroParameters = false;
return "macro";
}
}
if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}'
//TODO: Include bash script sub-parser (CodeMirror supports that)
stream.next();
return null;
}
};
});
CodeMirror.defineMIME("text/x-rpm-spec", "rpm-spec");
});
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
// This source code is licensed under both the GPLv2 (found in the
// COPYING file in the root directory) and Apache 2.0 License
// (found in the LICENSE.Apache file in the root directory).
//
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#pragma once
#include <vector>
#include "rocksdb/db.h"
namespace rocksdb {
class SnapshotList;
// Snapshots are kept in a doubly-linked list in the DB.
// Each SnapshotImpl corresponds to a particular sequence number.
class SnapshotImpl : public Snapshot {
public:
SequenceNumber number_; // const after creation
// It indicates the smallest uncommitted data at the time the snapshot was
// taken. This is currently used by WritePrepared transactions to limit the
// scope of queries to IsInSnpashot.
SequenceNumber min_uncommitted_ = 0;
virtual SequenceNumber GetSequenceNumber() const override { return number_; }
private:
friend class SnapshotList;
// SnapshotImpl is kept in a doubly-linked circular list
SnapshotImpl* prev_;
SnapshotImpl* next_;
SnapshotList* list_; // just for sanity checks
int64_t unix_time_;
// Will this snapshot be used by a Transaction to do write-conflict checking?
bool is_write_conflict_boundary_;
};
class SnapshotList {
public:
SnapshotList() {
list_.prev_ = &list_;
list_.next_ = &list_;
list_.number_ = 0xFFFFFFFFL; // placeholder marker, for debugging
// Set all the variables to make UBSAN happy.
list_.list_ = nullptr;
list_.unix_time_ = 0;
list_.is_write_conflict_boundary_ = false;
count_ = 0;
}
// No copy-construct.
SnapshotList(const SnapshotList&) = delete;
bool empty() const { return list_.next_ == &list_; }
SnapshotImpl* oldest() const { assert(!empty()); return list_.next_; }
SnapshotImpl* newest() const { assert(!empty()); return list_.prev_; }
SnapshotImpl* New(SnapshotImpl* s, SequenceNumber seq, uint64_t unix_time,
bool is_write_conflict_boundary) {
s->number_ = seq;
s->unix_time_ = unix_time;
s->is_write_conflict_boundary_ = is_write_conflict_boundary;
s->list_ = this;
s->next_ = &list_;
s->prev_ = list_.prev_;
s->prev_->next_ = s;
s->next_->prev_ = s;
count_++;
return s;
}
// Do not responsible to free the object.
void Delete(const SnapshotImpl* s) {
assert(s->list_ == this);
s->prev_->next_ = s->next_;
s->next_->prev_ = s->prev_;
count_--;
}
// retrieve all snapshot numbers up until max_seq. They are sorted in
// ascending order.
std::vector<SequenceNumber> GetAll(
SequenceNumber* oldest_write_conflict_snapshot = nullptr,
const SequenceNumber& max_seq = kMaxSequenceNumber) const {
std::vector<SequenceNumber> ret;
if (oldest_write_conflict_snapshot != nullptr) {
*oldest_write_conflict_snapshot = kMaxSequenceNumber;
}
if (empty()) {
return ret;
}
const SnapshotImpl* s = &list_;
while (s->next_ != &list_) {
if (s->next_->number_ > max_seq) {
break;
}
ret.push_back(s->next_->number_);
if (oldest_write_conflict_snapshot != nullptr &&
*oldest_write_conflict_snapshot == kMaxSequenceNumber &&
s->next_->is_write_conflict_boundary_) {
// If this is the first write-conflict boundary snapshot in the list,
// it is the oldest
*oldest_write_conflict_snapshot = s->next_->number_;
}
s = s->next_;
}
return ret;
}
// get the sequence number of the most recent snapshot
SequenceNumber GetNewest() {
if (empty()) {
return 0;
}
return newest()->number_;
}
int64_t GetOldestSnapshotTime() const {
if (empty()) {
return 0;
} else {
return oldest()->unix_time_;
}
}
uint64_t count() const { return count_; }
private:
// Dummy head of doubly-linked list of snapshots
SnapshotImpl list_;
uint64_t count_;
};
} // namespace rocksdb
|
{
"pile_set_name": "Github"
}
|
This file was derived from
http://www.gutenberg.org/cache/epub/4650/pg4650.txt
--------
CANDIDE,
ou
L'OPTIMISME,
TRADUIT DE L'ALLEMAND
DE M. LE DOCTEUR RALPH,
AVEC LES ADDITIONS
QU'ON A TROUVÉES DANS LA POCHE DU DOCTEUR, LORSQU'IL MOURUT
À MINDEN, L'AN DE GRÂCE 1759
1759
CHAPITRE I.
Comment Candide fut élevé dans un beau château, et comment il fut
chassé d'icelui.
Il y avait en Vestphalie, dans le château de M. le baron de
Thunder-ten-tronckh, un jeune garçon à qui la nature avait donné
les moeurs les plus douces. Sa physionomie annonçait son âme.
Il avait le jugement assez droit, avec l'esprit le plus simple;
c'est, je crois, pour cette raison qu'on le nommait Candide. Les
anciens domestiques de la maison soupçonnaient qu'il était fils
de la soeur de monsieur le baron et d'un bon et honnête
gentilhomme du voisinage, que cette demoiselle ne voulut jamais
épouser parce qu'il n'avait pu prouver que soixante et onze
quartiers, et que le reste de son arbre généalogique avait été
perdu par l'injure du temps.
Monsieur le baron était un des plus puissants seigneurs de la
Westphalie, car son château avait une porte et des fenêtres. Sa
grande salle même était ornée d'une tapisserie. Tous les chiens
de ses basses-cours composaient une meute dans le besoin; ses
palefreniers étaient ses piqueurs; le vicaire du village était
son grand-aumônier. Ils l'appelaient tous monseigneur, et ils
riaient quand il fesait des contes.
Madame la baronne, qui pesait environ trois cent cinquante
livres, s'attirait par là une très grande considération, et
fesait les honneurs de la maison avec une dignité qui la rendait
encore plus respectable. Sa fille Cunégonde, âgée de dix-sept
ans, était haute en couleur, fraîche, grasse, appétissante. Le
fils du baron paraissait en tout digne de son père. Le
précepteur Pangloss[1] était l'oracle de la maison, et le petit
Candide écoutait ses leçons avec toute la bonne foi de son âge et
de son caractère.
[1] De _pan_, tout, et _glossa_, langue. B.
Pangloss enseignait la métaphysico-théologo-cosmolonigologie. Il
prouvait admirablement qu'il n'y a point d'effet sans cause, et
que, dans ce meilleur des mondes possibles, le château de
monseigneur le baron était le plus beau des châteaux, et madame
la meilleure des baronnes possibles.
Il est démontré, disait-il, que les choses ne peuvent être
autrement; car tout étant fait pour une fin, tout est
nécessairement pour la meilleure fin. Remarquez bien que les nez
ont été faits pour porter des lunettes; aussi avons-nous des
lunettes[2]. Les jambes sont visiblement instituées pour être
chaussées, et nous avons des chausses. Les pierres ont été
formées pour être taillées et pour en faire des châteaux; aussi
monseigneur a un très beau château: le plus grand baron de la
province doit être le mieux logé; et les cochons étant faits pour
être mangés, nous mangeons du porc toute l'année: par conséquent,
ceux qui ont avancé que tout est bien ont dit une sottise; il
fallait dire que tout est au mieux.
[2] Voyez tome XXVII, page 528; et dans les _Mélanges_, année
1738, le chapitre XI de la troisième partie des _Éléments de la
philosophie de Newton_; et année 1768, le chapitre X des
_Singularités de la nature_. B.
Candide écoutait attentivement, et croyait innocemment; car il
trouvait mademoiselle Cunégonde extrêmement belle, quoiqu'il ne
prît jamais la hardiesse de le lui dire. Il concluait qu'après
le bonheur d'être né baron de Thunder-ten-tronckh, le second
degré de bonheur était d'être mademoiselle Cunégonde; le
troisième, de la voir tous les jours; et le quatrième, d'entendre
maître Pangloss, le plus grand philosophe de la province, et par
conséquent de toute la terre.
Un jour Cunégonde, en se promenant auprès du château, dans le
petit bois qu'on appelait parc, vit entre des broussailles le
docteur Pangloss qui donnait une leçon de physique expérimentale
à la femme de chambre de sa mère, petite brune très jolie et très
docile. Comme mademoiselle Cunégonde avait beaucoup de
disposition pour les sciences, elle observa, sans souffler, les
expériences réitérées dont elle fut témoin; elle vit clairement
la raison suffisante du docteur, les effets et les causes, et
s'en retourna tout agitée, toute pensive, toute remplie du désir
d'être savante, songeant qu'elle pourrait bien être la raison
suffisante du jeune Candide, qui pouvait aussi être la sienne.
Elle rencontra Candide en revenant au château, et rougit: Candide
rougit aussi . Elle lui dit bonjour d'une voix entrecoupée; et
Candide lui parla sans savoir ce qu'il disait. Le lendemain,
après le dîner, comme on sortait de table, Cunégonde et Candide
se trouvèrent derrière un paravent; Cunégonde laissa tomber son
mouchoir, Candide le ramassa; elle lui prit innocemment la main;
le jeune homme baisa innocemment la main de la jeune demoiselle
avec une vivacité, une sensibilité, une grâce toute particulière;
leurs bouches se rencontrèrent, leurs yeux s'enflammèrent, leurs
genoux tremblèrent, leurs mains s'égarèrent. M. le baron de
Thunder-ten-tronckh passa auprès du paravent, et voyant cette
cause et cet effet, chassa Candide du château à grands coups de
pied dans le derrière. Cunégonde s'évanouit: elle fut souffletée
par madame la baronne dès qu'elle fut revenue à elle-même; et
tout fut consterné dans le plus beau et le plus agréable des
châteaux possibles.
CHAPITRE II
Ce que devint Candide parmi les Bulgares.
Candide, chassé du paradis terrestre, marcha longtemps sans
savoir où, pleurant, levant les yeux au ciel, les tournant
souvent vers le plus beau des châteaux qui renfermait la plus
belle des baronnettes; il se coucha sans souper au milieu des
champs entre deux sillons; la neige tombait à gros flocons.
Candide, tout transi, se traîna le lendemain vers la ville
voisine, qui s'
|
{
"pile_set_name": "Github"
}
|
from typing import Optional
from webdnn.graph.attribute import Attribute
from webdnn.graph.operator import Operator
class InplaceOperator(Attribute):
"""InplaceOperator(op, input_name, output_name)
This attribute represents that the operation can be performed as inplace for corresponding input and output variables. Note that the
operation with this attribute is not always performed as inplace. For example, if orders of input and output variables are different,
operation cannot be performed as inplace.
Attributes:
op (:class:`~webdnn.graph.operator.Operator`) : base operator
input_name (str): input names which can be operated in-place
output_name (str): output names which can be operated in-place
"""
def __init__(self, op: Operator, input_name: str, output_name: str):
self.op = op
self.input_name = input_name
self.output_name = output_name
def get_input(self):
return self.op.inputs[self.input_name]
def get_output(self):
return self.op.outputs[self.output_name]
def get_status(self):
return self.op.has_attribute(Inplace)
def toggle_status(self, inplace: Optional[bool] = None):
if inplace is None:
inplace = not self.op.has_attribute(Inplace)
if inplace:
if self.op.has_attribute(Inplace):
return
self.op.attributes.add(Inplace(self.op))
else:
if not self.op.has_attribute(Inplace):
return
self.op.attributes.remove(self.op.get_attribute(Inplace)[0])
class Inplace(Attribute):
"""Inplace(op, input_name, output_name)
Operation with this attribute is transpiled as inplace operation.
Attributes:
op (:class:`~webdnn.graph.operator.Operator`) : base operator
"""
def __init__(self, op: Operator):
self.op = op
def get_input(self):
return self.op.get_attribute(InplaceOperator)[0].get_input()
def get_output(self):
return self.op.get_attribute(InplaceOperator)[0].get_output()
|
{
"pile_set_name": "Github"
}
|
oneadmin ALL=(ALL) NOPASSWD: ONE_CEPH, ONE_HA, ONE_MARKET
|
{
"pile_set_name": "Github"
}
|
package com.wantedtech.common.xpresso.regex;
public class CA_Regex {
public Regex POSTAL_CODE = new Regex("\\b[ABCEGHJKLMNPRSTVXY][0-9][A-Z] [0-9][A-Z][0-9]\\b");
}
|
{
"pile_set_name": "Github"
}
|
#if !XB1
using System;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Threading;
using VRage.Collections;
using VRage.Game.Components;
using VRage.Profiler;
using VRage.Utils;
namespace VRage.Game.SessionComponents
{
/// <summary>
/// Communication between game and editor.
/// </summary>
[MySessionComponentDescriptor(MyUpdateOrder.BeforeSimulation)]
public class MySessionComponentExtDebug : MySessionComponentBase
{
private class MyDebugClientInfo
{
public TcpClient TcpClient;
public MyExternalDebugStructures.CommonMsgHeader LastHeader;
}
// ------------------------------------------------------------------------------------
// public members
public delegate void ReceivedMsgHandler(MyExternalDebugStructures.CommonMsgHeader messageHeader, IntPtr messageData);
// Event - received message.
public event ReceivedMsgHandler ReceivedMsg
{
add
{
m_receivedMsgHandlers.Add(value);
m_receivedMsgHandlers.ApplyAdditions();
}
remove
{
if (m_receivedMsgHandlers.Contains(value))
{
m_receivedMsgHandlers.Remove(value);
m_receivedMsgHandlers.ApplyRemovals();
}
}
}
public bool IsHandlerRegistered(ReceivedMsgHandler handler)
{
return m_receivedMsgHandlers.Contains(handler);
}
// Static reference to this session component.
public static MySessionComponentExtDebug Static = null;
public static bool ForceDisable = false;
// Static reference to this session component.
public const int GameDebugPort = 13000;
// Is any client connected?
public bool HasClients
{
get { return m_clients.Count > 0; }
}
// ------------------------------------------------------------------------------------
// private members
// Maximum message size. 10 KB limit... for now.
private const int MsgSizeLimit = 1024 * 10;
// Thread for TCP listener.
private Thread m_listenerThread;
// Tcp listener instance.
private TcpListener m_listener;
// Connected tcp clients.
private ConcurrentCachingList<MyDebugClientInfo> m_clients = new ConcurrentCachingList<MyDebugClientInfo>(1);
// Is component active (listening)?
private bool m_active = false;
// Buffer for receiving. 10 KB limit... for now.
private byte[] m_arrayBuffer = new byte[MsgSizeLimit];
// Temporary receive buffer. 10 KB limit... for now.
private IntPtr m_tempBuffer;
// Array of handlers (callback methods).
private ConcurrentCachingList<ReceivedMsgHandler> m_receivedMsgHandlers = new ConcurrentCachingList<ReceivedMsgHandler>();
// ------------------------------------------------------------------------------------
public override void LoadData()
{
if (Static != null)
{
// take data from previous instance
m_listenerThread = Static.m_listenerThread;
m_listener = Static.m_listener;
m_clients = Static.m_clients;
m_active = Static.m_active;
m_arrayBuffer = Static.m_arrayBuffer;
m_tempBuffer = Static.m_tempBuffer;
m_receivedMsgHandlers = Static.m_receivedMsgHandlers;
MySessionComponentExtDebug.Static = this;
base.LoadData();
return;
}
MySessionComponentExtDebug.Static = this;
if (m_tempBuffer == IntPtr.Zero)
m_tempBuffer = Marshal.AllocHGlobal(MsgSizeLimit);
if (!ForceDisable)
StartServer();
base.LoadData();
}
protected override void UnloadData()
{
m_receivedMsgHandlers.ClearImmediate();
base.UnloadData();
}
public void Dispose()
{
m_receivedMsgHandlers.ClearList();
if (m_active)
{
StopServer(); // do not stop server
}
if (m_tempBuffer != IntPtr.Zero)
Marshal.FreeHGlobal(m_tempBuffer);
}
/// <summary>
/// Start using this component as server (game side).
/// </summary>
private bool StartServer()
{
if (!m_active)
{
m_listenerThread = new Thread(ServerListenerProc) { IsBackground = true};
m_listenerThread.Start();
m_active = true;
return true;
}
else
{
return false;
}
}
/// <summary>
/// Stop the server on the game side. Called automatically.
/// </summary>
private void StopServer()
{
if (m_active && m_listenerThread != null)
{
m_listener.Stop();
//m_listenerThread.Interrupt(); // will stop itself
foreach (var client in m_clients)
{
if (client.TcpClient != null)
{
client.TcpClient.Client.Disconnect(true);
client.TcpClient.Close();
}
}
m_clients.ClearImmediate();
m_active = false;
}
}
/// <summary>
/// Parallel thread - listener.
/// </summary>
private void ServerListenerProc()
{
Thread.CurrentThread.Name = "External Debugging Listener";
ProfilerShort.Autocommit = false;
try
{
#if OFFICIAL_BUILD == true
m_listener = new TcpListener(IPAddress.Loopback, GameDebugPort) {ExclusiveAddressUse = false};
#else
m_listener = new TcpListener(IPAddress.Any, GameDebugPort) { ExclusiveAddressUse = false };
#endif
m_listener.Start();
}
catch (SocketException ex)
{
MyLog.Default.WriteLine("Cannot start debug listener.");
MyLog.Default.WriteLine(ex);
m_listener = null;
m_active = false;
return;
}
MyLog.Default.WriteLine("External debugger: listening...");
while (true)
{
try
{
var client = m_listener.AcceptTcpClient();
client.Client.Blocking = true;
MyLog.Default.WriteLine("External debugger: accepted client.");
m_clients.Add(new MyDebugClientInfo()
{
TcpClient = client,
LastHeader = MyExternalDebugStructures.CommonMsgHeader.Create("UNKNOWN")
});
m_clients.ApplyAdditions();
}
catch (SocketException e)
{
if (e.SocketErrorCode == SocketError.Interrupted)
{
m_listener.Stop();
m_listener = null;
MyLog.Default.WriteLine("External debugger: interrupted.");
ProfilerShort.Commit();
ProfilerShort.DestroyThread();
return;
}
else
{
if (MyLog.Default != null && MyLog.Default.LogEnabled)
MyLog.Default.WriteLine(e);
break;
}
}
}
m_listener.Stop();
m_listener = null;
ProfilerShort.Commit();
ProfilerShort.DestroyThread();
}
// Read messages coming from clients.
public override void UpdateBeforeSimulation()
{
ProfilerShort.Begin("External Debugging");
foreach (var clientInfo in m_clients)
{
if (clientInfo == null || clientInfo.TcpClient == null || clientInfo.TcpClient.Client == null || !clientInfo.TcpClient.Connected)
{
if (clientInfo != null && clientInfo.TcpClient != null && clientInfo.TcpClient.Client != null &&
clientInfo.TcpClient.Client.Connected)
{
clientInfo.TcpClient.Client.Disconnect(true);
clientInfo.TcpClient.Close();
}
m_clients.Remove(clientInfo);
continue;
}
if (clientInfo.TcpClient.Connected && clientInfo.TcpClient.Available > 0)
Read
|
{
"pile_set_name": "Github"
}
|
{
"$schema": "http://schemastore.org/schemas/json/webjob-publish-settings.json",
"webJobName": "CoreSimpleTimerJobConsole",
"startTime": null,
"endTime": null,
"jobRecurrenceFrequency": null,
"interval": null,
"runMode": "OnDemand"
}
|
{
"pile_set_name": "Github"
}
|
/** @namespace */
myProject = myProject || {};
/** @namespace */
myProject.myModule = (function () {
/** describe myPrivateVar here */
var myPrivateVar = "";
var myPrivateMethod = function () {
}
/** @scope myProject.myModule */
return {
myPublicMethod: function () {
}
};
})();
|
{
"pile_set_name": "Github"
}
|
#
# ovirt-engine-setup -- ovirt engine setup
#
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
#
"""Notifier plugin."""
import gettext
from otopi import plugin
from otopi import util
from ovirt_engine import configfile
from ovirt_engine_setup.engine import constants as oenginecons
from ovirt_setup_lib import dialog
def _(m):
return gettext.dgettext(message=m, domain='ovirt-engine-setup')
@util.export
class Plugin(plugin.PluginBase):
"""Notifier plugin."""
def __init__(self, context):
super(Plugin, self).__init__(context=context)
@plugin.event(
stage=plugin.Stages.STAGE_INIT,
)
def _init(self):
self.environment.setdefault(
oenginecons.ConfigEnv.IGNORE_VDS_GROUP_IN_NOTIFIER,
None
)
@plugin.event(
stage=plugin.Stages.STAGE_VALIDATION,
condition=lambda self: self.environment[
oenginecons.CoreEnv.ENABLE
] and not self.environment[
oenginecons.ConfigEnv.IGNORE_VDS_GROUP_IN_NOTIFIER
],
)
def _validation(self):
config = configfile.ConfigFile(
(
oenginecons.FileLocations.OVIRT_ENGINE_NOTIFIER_SERVICE_CONFIG,
),
)
filterStr = config.get('FILTER')
self.logger.debug('filterStr: %s', filterStr)
if filterStr is not None and 'VDS_GROUP' in filterStr:
ans = dialog.queryBoolean(
dialog=self.dialog,
name='OVESETUP_WAIT_NOTIFIER_FILTER',
note=_(
'Setup found filter/s in engine-notifier configuration '
'files in {conf}.d/*.conf containing the string '
'"VDS_GROUP".\n You must manually change "VDS_GROUP" to '
'"CLUSTER" throughout the notifier configuration in '
'order to get notified on cluster related events.\n Do '
'you want to continue?\n'
'(Answering "no" will stop the upgrade '
'(@VALUES@) [@DEFAULT@]: '
).format(
conf=(
oenginecons.FileLocations.
OVIRT_ENGINE_NOTIFIER_SERVICE_CONFIG
),
),
prompt=True,
default=False,
)
self.environment[
oenginecons.ConfigEnv.IGNORE_VDS_GROUP_IN_NOTIFIER
] = ans
if not ans:
raise RuntimeError(_('Aborted by user'))
# vim: expandtab tabstop=4 shiftwidth=4
|
{
"pile_set_name": "Github"
}
|
owner = SOV
controller = SOV
add_core = SOV
infra = 4
|
{
"pile_set_name": "Github"
}
|
Running on vangogh:
1) download opencv 2.4.9 to /scratch/opencv-cuda/
http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.9/opencv-2.4.9.zip
2) install it using the following commands (I used cmake version 2.8.11.2):
cd opencv-2.9.4
mkdir install
cmake -G 'Unix Makefiles' -D WITH_CUDA=ON -D CMAKE_BUILD_TYPE=DEBUG -D BUILD_SHARED_LIBS=NO -D WITH_CUBLAS=YES -D CMAKE_INSTALL_PREFIX=./install .
make -j 8
make install
3) nm -A *.a | c++filt | grep -w T
|
{
"pile_set_name": "Github"
}
|
package request
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/awsutil"
)
// WaiterResourceNotReadyErrorCode is the error code returned by a waiter when
// the waiter's max attempts have been exhausted.
const WaiterResourceNotReadyErrorCode = "ResourceNotReady"
// A WaiterOption is a function that will update the Waiter value's fields to
// configure the waiter.
type WaiterOption func(*Waiter)
// WithWaiterMaxAttempts returns the maximum number of times the waiter should
// attempt to check the resource for the target state.
func WithWaiterMaxAttempts(max int) WaiterOption {
return func(w *Waiter) {
w.MaxAttempts = max
}
}
// WaiterDelay will return a delay the waiter should pause between attempts to
// check the resource state. The passed in attempt is the number of times the
// Waiter has checked the resource state.
//
// Attempt is the number of attempts the Waiter has made checking the resource
// state.
type WaiterDelay func(attempt int) time.Duration
// ConstantWaiterDelay returns a WaiterDelay that will always return a constant
// delay the waiter should use between attempts. It ignores the number of
// attempts made.
func ConstantWaiterDelay(delay time.Duration) WaiterDelay {
return func(attempt int) time.Duration {
return delay
}
}
// WithWaiterDelay will set the Waiter to use the WaiterDelay passed in.
func WithWaiterDelay(delayer WaiterDelay) WaiterOption {
return func(w *Waiter) {
w.Delay = delayer
}
}
// WithWaiterLogger returns a waiter option to set the logger a waiter
// should use to log warnings and errors to.
func WithWaiterLogger(logger aws.Logger) WaiterOption {
return func(w *Waiter) {
w.Logger = logger
}
}
// WithWaiterRequestOptions returns a waiter option setting the request
// options for each request the waiter makes. Appends to waiter's request
// options already set.
func WithWaiterRequestOptions(opts ...Option) WaiterOption {
return func(w *Waiter) {
w.RequestOptions = append(w.RequestOptions, opts...)
}
}
// A Waiter provides the functionality to perform a blocking call which will
// wait for a resource state to be satisfied by a service.
//
// This type should not be used directly. The API operations provided in the
// service packages prefixed with "WaitUntil" should be used instead.
type Waiter struct {
Name string
Acceptors []WaiterAcceptor
Logger aws.Logger
MaxAttempts int
Delay WaiterDelay
RequestOptions []Option
NewRequest func([]Option) (*Request, error)
SleepWithContext func(aws.Context, time.Duration) error
}
// ApplyOptions updates the waiter with the list of waiter options provided.
func (w *Waiter) ApplyOptions(opts ...WaiterOption) {
for _, fn := range opts {
fn(w)
}
}
// WaiterState are states the waiter uses based on WaiterAcceptor definitions
// to identify if the resource state the waiter is waiting on has occurred.
type WaiterState int
// String returns the string representation of the waiter state.
func (s WaiterState) String() string {
switch s {
case SuccessWaiterState:
return "success"
case FailureWaiterState:
return "failure"
case RetryWaiterState:
return "retry"
default:
return "unknown waiter state"
}
}
// States the waiter acceptors will use to identify target resource states.
const (
SuccessWaiterState WaiterState = iota // waiter successful
FailureWaiterState // waiter failed
RetryWaiterState // waiter needs to be retried
)
// WaiterMatchMode is the mode that the waiter will use to match the WaiterAcceptor
// definition's Expected attribute.
type WaiterMatchMode int
// Modes the waiter will use when inspecting API response to identify target
// resource states.
const (
PathAllWaiterMatch WaiterMatchMode = iota // match on all paths
PathWaiterMatch // match on specific path
PathAnyWaiterMatch // match on any path
PathListWaiterMatch // match on list of paths
StatusWaiterMatch // match on status code
ErrorWaiterMatch // match on error
)
// String returns the string representation of the waiter match mode.
func (m WaiterMatchMode) String() string {
switch m {
case PathAllWaiterMatch:
return "pathAll"
case PathWaiterMatch:
return "path"
case PathAnyWaiterMatch:
return "pathAny"
case PathListWaiterMatch:
return "pathList"
case StatusWaiterMatch:
return "status"
case ErrorWaiterMatch:
return "error"
default:
return "unknown waiter match mode"
}
}
// WaitWithContext will make requests for the API operation using NewRequest to
// build API requests. The request's response will be compared against the
// Waiter's Acceptors to determine the successful state of the resource the
// waiter is inspecting.
//
// The passed in context must not be nil. If it is nil a panic will occur. The
// Context will be used to cancel the waiter's pending requests and retry delays.
// Use aws.BackgroundContext if no context is available.
//
// The waiter will continue until the target state defined by the Acceptors,
// or the max attempts expires.
//
// Will return the WaiterResourceNotReadyErrorCode error code if the waiter's
// retryer ShouldRetry returns false. This normally will happen when the max
// wait attempts expires.
func (w Waiter) WaitWithContext(ctx aws.Context) error {
for attempt := 1; ; attempt++ {
req, err := w.NewRequest(w.RequestOptions)
if err != nil {
waiterLogf(w.Logger, "unable to create request %v", err)
return err
}
req.Handlers.Build.PushBack(MakeAddToUserAgentFreeFormHandler("Waiter"))
err = req.Send()
// See if any of the acceptors match the request's response, or error
for _, a := range w.Acceptors {
if matched, matchErr := a.match(w.Name, w.Logger, req, err); matched {
return matchErr
}
}
// The Waiter should only check the resource state MaxAttempts times
// This is here instead of in the for loop above to prevent delaying
// unnecessary when the waiter will not retry.
if attempt == w.MaxAttempts {
break
}
// Delay to wait before inspecting the resource again
delay := w.Delay(attempt)
if sleepFn := req.Config.SleepDelay; sleepFn != nil {
// Support SleepDelay for backwards compatibility and testing
sleepFn(delay)
} else {
sleepCtxFn := w.SleepWithContext
if sleepCtxFn == nil {
sleepCtxFn = aws.SleepWithContext
}
if err := sleepCtxFn(ctx, delay); err != nil {
return awserr.New(CanceledErrorCode, "waiter context canceled", err)
}
}
}
return awserr.New(WaiterResourceNotReadyErrorCode, "exceeded wait attempts", nil)
}
// A WaiterAcceptor provides the information needed to wait for an API operation
// to complete.
type WaiterAcceptor struct {
State WaiterState
Matcher WaiterMatchMode
Argument string
Expected interface{}
}
// match returns if the acceptor found a match with the passed in request
// or error. True is returned if the acceptor made a match, error is returned
// if there was an error attempting to perform the match.
func (a *WaiterAcceptor) match(name string, l aws.Logger, req *Request, err error) (bool, error) {
result := false
var vals []interface{}
switch a.Matcher {
case PathAllWaiterMatch, PathWaiterMatch:
// Require
|
{
"pile_set_name": "Github"
}
|
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// <complex>
// void real(T val);
// void imag(T val);
#include <complex>
#include <cassert>
#include "test_macros.h"
template <class T>
void
test_constexpr()
{
#if TEST_STD_VER > 11
constexpr std::complex<T> c1;
static_assert(c1.real() == 0, "");
static_assert(c1.imag() == 0, "");
constexpr std::complex<T> c2(3);
static_assert(c2.real() == 3, "");
static_assert(c2.imag() == 0, "");
constexpr std::complex<T> c3(3, 4);
static_assert(c3.real() == 3, "");
static_assert(c3.imag() == 4, "");
#endif
}
template <class T>
void
test()
{
std::complex<T> c;
assert(c.real() == 0);
assert(c.imag() == 0);
c.real(3.5);
assert(c.real() == 3.5);
assert(c.imag() == 0);
c.imag(4.5);
assert(c.real() == 3.5);
assert(c.imag() == 4.5);
c.real(-4.5);
assert(c.real() == -4.5);
assert(c.imag() == 4.5);
c.imag(-5.5);
assert(c.real() == -4.5);
assert(c.imag() == -5.5);
test_constexpr<T> ();
}
int main(int, char**)
{
test<float>();
test<double>();
test<long double>();
test_constexpr<int> ();
return 0;
}
|
{
"pile_set_name": "Github"
}
|
/*
* Created by LuaView.
* Copyright (c) 2017, Alibaba Group. All rights reserved.
*
* This source code is licensed under the MIT.
* For the full copyright and license information,please view the LICENSE file in the root directory of this source tree.
*/
package com.taobao.luaview.view;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.ViewGroup;
import com.taobao.luaview.global.LuaView;
import com.taobao.luaview.userdata.ui.UDCustomPanel;
import com.taobao.luaview.userdata.ui.UDView;
import com.taobao.luaview.userdata.ui.UDViewGroup;
import com.taobao.luaview.util.LuaUtil;
import com.taobao.luaview.util.LuaViewUtil;
import com.taobao.luaview.view.interfaces.ILVNativeViewProvider;
import com.taobao.luaview.view.interfaces.ILVViewGroup;
import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.Varargs;
/**
* LuaView-Container
* 容器类
*
* @author song
* @date 15/8/20
*/
public abstract class LVCustomPanel extends LVViewGroup<UDCustomPanel> implements ILVViewGroup, ILVNativeViewProvider {
public LVCustomPanel(Globals globals, LuaValue metaTable, Varargs varargs) {
super(globals, metaTable, varargs);
initPanel();
}
@NonNull
public UDCustomPanel createUserdata(Globals globals, LuaValue metaTable, Varargs varargs) {
return new UDCustomPanel(this, globals, metaTable, varargs);
}
public void show() {
LVCustomPanel.this.setVisibility(View.VISIBLE);
}
public void hide() {
LVCustomPanel.this.setVisibility(View.GONE);
}
/**
* 初始化Panel
*/
public abstract void initPanel();
/**
* call LuaView 的 global functions
*
* @param objs
*/
public void callLuaFunction(String name, Object... objs) {
UDView userdata = getUserdata();
if (userdata != null) {
Globals globals = userdata.getGlobals();
if (globals != null) {
globals.callLuaFunction(name, objs);
}
}
}
/**
* 子类实现该方法,用于Lua回调该方法
*/
public void callLuaCallback(Object... objs) {
UDView userdata = getUserdata();
if (userdata != null) {
final LuaValue callback = userdata.getCallback();
LuaUtil.callFunction(callback, objs);
}
}
//获取native view
@Override
public View getNativeView() {
if (getChildCount() > 0 && getChildAt(0) != null) {
return getChildAt(0);
}
return null;
}
}
|
{
"pile_set_name": "Github"
}
|
package org.codehaus.jackson.io;
import org.codehaus.jackson.JsonEncoding;
import org.codehaus.jackson.util.BufferRecycler;
import org.codehaus.jackson.util.TextBuffer;
/**
* To limit number of configuration and state objects to pass, all
* contextual objects that need to be passed by the factory to
* readers and writers are combined under this object. One instance
* is created for each reader and writer.
*/
public final class IOContext
{
/*
/**********************************************************
/* Configuration
/**********************************************************
*/
/**
* Reference to the source object, which can be used for displaying
* location information
*/
protected final Object _sourceRef;
/**
* Encoding used by the underlying stream, if known.
*/
protected JsonEncoding _encoding;
/**
* Flag that indicates whether underlying input/output source/target
* object is fully managed by the owner of this context (parser or
* generator). If true, it is, and is to be closed by parser/generator;
* if false, calling application has to do closing (unless auto-closing
* feature is enabled for the parser/generator in question; in which
* case it acts like the owner).
*/
protected final boolean _managedResource;
/*
/**********************************************************
/* Buffer handling, recycling
/**********************************************************
*/
/**
* Recycler used for actual allocation/deallocation/reuse
*/
protected final BufferRecycler _bufferRecycler;
/**
* Reference to the allocated I/O buffer for low-level input reading,
* if any allocated.
*/
protected byte[] _readIOBuffer = null;
/**
* Reference to the allocated I/O buffer used for low-level
* encoding-related buffering.
*/
protected byte[] _writeEncodingBuffer = null;
/**
* Reference to the buffer allocated for tokenization purposes,
* in which character input is read, and from which it can be
* further returned.
*/
protected char[] _tokenCBuffer = null;
/**
* Reference to the buffer allocated for buffering it for
* output, before being encoded: generally this means concatenating
* output, then encoding when buffer fills up.
*/
protected char[] _concatCBuffer = null;
/**
* Reference temporary buffer Parser instances need if calling
* app decides it wants to access name via 'getTextCharacters' method.
* Regular text buffer can not be used as it may contain textual
* representation of the value token.
*/
protected char[] _nameCopyBuffer = null;
/*
/**********************************************************
/* Life-cycle
/**********************************************************
*/
public IOContext(BufferRecycler br, Object sourceRef, boolean managedResource)
{
_bufferRecycler = br;
_sourceRef = sourceRef;
_managedResource = managedResource;
}
public void setEncoding(JsonEncoding enc)
{
_encoding = enc;
}
/*
/**********************************************************
/* Public API, accessors
/**********************************************************
*/
public final Object getSourceReference() { return _sourceRef; }
public final JsonEncoding getEncoding() { return _encoding; }
public final boolean isResourceManaged() { return _managedResource; }
/*
/**********************************************************
/* Public API, buffer management
/**********************************************************
*/
public final TextBuffer constructTextBuffer() {
return new TextBuffer(_bufferRecycler);
}
/**
*<p>
* Note: the method can only be called once during its life cycle.
* This is to protect against accidental sharing.
*/
public final byte[] allocReadIOBuffer()
{
if (_readIOBuffer != null) {
throw new IllegalStateException("Trying to call allocReadIOBuffer() second time");
}
_readIOBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.READ_IO_BUFFER);
return _readIOBuffer;
}
public final byte[] allocWriteEncodingBuffer()
{
if (_writeEncodingBuffer != null) {
throw new IllegalStateException("Trying to call allocWriteEncodingBuffer() second time");
}
_writeEncodingBuffer = _bufferRecycler.allocByteBuffer(BufferRecycler.ByteBufferType.WRITE_ENCODING_BUFFER);
return _writeEncodingBuffer;
}
public final char[] allocTokenBuffer()
{
if (_tokenCBuffer != null) {
throw new IllegalStateException("Trying to call allocTokenBuffer() second time");
}
_tokenCBuffer = _bufferRecycler.allocCharBuffer(BufferRecycler.CharBufferType.TOKEN_BUFFER);
return _tokenCBuffer;
}
public final char[] allocConcatBuffer()
{
if (_concatCBuffer != null) {
throw new IllegalStateException("Trying to call allocConcatBuffer() second time");
}
_concatCBuffer = _bufferRecycler.allocCharBuffer(BufferRecycler.CharBufferType.CONCAT_BUFFER);
return _concatCBuffer;
}
public final char[] allocNameCopyBuffer(int minSize)
{
if (_nameCopyBuffer != null) {
throw new IllegalStateException("Trying to call allocNameCopyBuffer() second time");
}
_nameCopyBuffer = _bufferRecycler.allocCharBuffer(BufferRecycler.CharBufferType.NAME_COPY_BUFFER, minSize);
return _nameCopyBuffer;
}
/**
* Method to call when all the processing buffers can be safely
* recycled.
*/
public final void releaseReadIOBuffer(byte[] buf)
{
if (buf != null) {
/* Let's do sanity checks to ensure once-and-only-once release,
* as well as avoiding trying to release buffers not owned
*/
if (buf != _readIOBuffer) {
throw new IllegalArgumentException("Trying to release buffer not owned by the context");
}
_readIOBuffer = null;
_bufferRecycler.releaseByteBuffer(BufferRecycler.ByteBufferType.READ_IO_BUFFER, buf);
}
}
public final void releaseWriteEncodingBuffer(byte[] buf)
{
if (buf != null) {
/* Let's do sanity checks to ensure once-and-only-once release,
* as well as avoiding trying to release buffers not owned
*/
if (buf != _writeEncodingBuffer) {
throw new IllegalArgumentException("Trying to release buffer not owned by the context");
}
_writeEncodingBuffer = null;
_bufferRecycler.releaseByteBuffer(BufferRecycler.ByteBufferType.WRITE_ENCODING_BUFFER, buf);
}
}
public final void releaseTokenBuffer(char[] buf)
{
if (buf != null) {
if (buf != _tokenCBuffer) {
throw new IllegalArgumentException("Trying to release buffer not owned by the context");
}
_tokenCBuffer = null;
_bufferRecycler.releaseCharBuffer(BufferRecycler.CharBufferType.TOKEN_BUFFER, buf);
}
}
public final void releaseConcatBuffer(char[] buf)
{
if (buf != null) {
if (buf != _concatCBuffer) {
throw new IllegalArgumentException("Trying to release buffer not owned by the context");
}
_concatCBuffer = null;
_bufferRecycler.releaseCharBuffer(BufferRecycler.CharBufferType.CONCAT_BUFFER, buf);
}
}
public final void releaseNameCopyBuffer(char[] buf)
{
if (buf != null) {
if (buf != _nameCopyBuffer) {
throw new IllegalArgumentException("Trying to release buffer not owned by the context");
}
_nameCopyBuffer = null;
_bufferRecycler.releaseCharBuffer(BufferRecycler.CharBufferType.NAME_COPY_BUFFER, buf);
}
}
}
|
{
"pile_set_name": "Github"
}
|
import React, { useState, useEffect } from 'react'
import { auth } from 'lib/Store'
/**
* Sign in with username and password
*
* @param {String} role DRIVER/MANAGER. default as DRIVER
*/
export default function SignIn({ role = "DRIVER" }) {
const [formData, updateFormData] = useState({ role });
const [action, setAction] = useState(null);
function onChange(e) {
updateFormData({
...formData,
// Trimming any whitespace
[e.target.name]: e.target.value.trim()
});
};
async function postAndWait(url, data, options = {}) {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify(data),
...options,
})
const body = await response.json()
return body
}
async function onSubmit(event) {
event.preventDefault();
try {
if (action === "SIGNUP") {
const signupResponse = await postAndWait(`/api/auth/signup`, formData)
await auth.loginWithRefreshToken(signupResponse.refresh_token, true)
window.location.reload();
} else if (action === "LOGIN") {
const loginResponse = await postAndWait(`/api/auth/login`, formData)
await auth.loginWithRefreshToken(loginResponse.refresh_token, true)
window.location.reload();
}
} catch (error) {
console.log('error', error)
alert("Authentication failed. Please check your input.")
}
}
return (
<form className="container" onSubmit={onSubmit}>
<label>
Email
<input name="email" type='email' onChange={onChange} />
</label>
<label>
Password
<input name="password" type='password' onChange={onChange} />
</label>
<button type='submit' onClick={() => setAction("SIGNUP")}>Sign up</button>
<button type='submit' onClick={() => setAction("LOGIN")}>Login</button>
<style jsx>{`
.container {
min-width: 20rem;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
}
label {
display: flex;
flex-direction: column;
margin-bottom: 1rem;
}
input {
margin-top: 0.5rem;
padding: 0.5rem;
font-size: 1rem;
}
button {
margin-top: 0.5rem;
padding: 0.5rem;
font-size: 1rem;
}
`}</style>
</form>
)
}
|
{
"pile_set_name": "Github"
}
|
import clr
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
OUT = WallLocationLine.FinishFaceExterior
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>icon.png</string>
<key>CFBundleIconFiles</key>
<array>
<string>icon-iPad.png</string>
<string>icon@2x.png</string>
<string>icon.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.sadun.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
|
{
"pile_set_name": "Github"
}
|
/// <reference types="cypress" />
// Copied an example command from https://on.cypress.io/custom-commands
Cypress.Commands.add('clickLink', (label: string | number | RegExp) => {
cy.get('a').contains(label).click()
})
|
{
"pile_set_name": "Github"
}
|
.bd-testimonials
background-color: $background
.bd-testimonial
align-items: flex-start
display: flex
justify-content: center
.bd-testimonial-tweet
background-color: $scheme-main
.bd-more-loves
align-items: center
display: flex
justify-content: center
margin-top: 1.5rem
text-align: center
.button
height: auto
padding: 0.75em 1.5em
span
transform-origin: center center
transition: transform $speed $easing
&:hover
span
transform: scale(1.04)
+mobile
.bd-testimonials
padding: 1.5rem
.bd-testimonial
margin-bottom: 1.5rem
+tablet
.bd-testimonials
padding: 3rem
.bd-testimonial + .bd-testimonial
margin-top: 1.5rem
+desktop
.bd-testimonials
min-height: 595px
+widescreen
.bd-testimonials
min-height: 653px
+fullhd
.bd-testimonials
min-height: 632px
.bd-rainbow
animation: rainbow 8s ease infinite
background-image: linear-gradient(124deg, $orange, $red, $purple, $blue)
background-size: 800% 800%
.hero.bd-is-love
.title,
.subtitle
color: $scheme-main
@keyframes rainbow
0%
background-position: 1% 80%
50%
background-position: 99% 20%
100%
background-position: 1% 80%
.bd-hug
align-items: flex-start
display: flex
justify-content: center
+mobile
.bd-hug
margin: 1.5rem
.bd-embrace
text-align: center
&:not(:first-child)
margin-top: 1.5rem
&:not(:last-child)
margin-bottom: 1.5rem
.bd-embrace-button
margin-top: 0.75rem
+tablet
.bd-embrace
align-items: center
display: flex
justify-content: center
&:not(:first-child)
margin-top: 3rem
&:not(:last-child)
margin-bottom: 3rem
.bd-embrace-button
margin-left: 1.5rem
.bd-hugs
display: flex
flex-wrap: wrap
padding-bottom: 3rem
.bd-hug
margin-top: 1.5rem
width: calc(33.3333% - 1rem)
&:nth-child(1),
&:nth-child(2),
&:nth-child(3)
margin-top: 0
&:nth-child(3n-1),
&:nth-child(3n)
margin-left: 1.5rem
.bd-shoutout
background-color: $background
padding: 2rem
text-align: center
&:not(:last-child)
margin-bottom: 3rem
.bd-shoutout-text
&.title
opacity: 0.8
&.subtitle
opacity: 0.5
.bd-shoutout-button
margin-top: -0.75rem
|
{
"pile_set_name": "Github"
}
|
fileFormatVersion: 2
guid: bfa4da7810224e14da943441c756840b
folderAsset: yes
timeCreated: 1479451035
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
|
{
"pile_set_name": "Github"
}
|
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Private Browsing Tests.
*
* The Initial Developer of the Original Code is
* Ehsan Akhgari.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ehsan Akhgari <ehsan.akhgari@gmail.com> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cr = Components.results;
const Cu = Components.utils;
const kPrivateBrowsingNotification = "private-browsing";
const kPrivateBrowsingCancelVoteNotification = "private-browsing-cancel-vote";
const kPrivateBrowsingTransitionCompleteNotification = "private-browsing-transition-complete";
const kEnter = "enter";
const kExit = "exit";
const NS_APP_USER_PROFILE_50_DIR = "ProfD";
const NS_APP_HISTORY_50_FILE = "UHist";
function LOG(aMsg) {
aMsg = ("*** PRIVATEBROWSING TESTS: " + aMsg);
Cc["@mozilla.org/consoleservice;1"].getService(Ci.nsIConsoleService).
logStringMessage(aMsg);
print(aMsg);
}
function uri(spec) {
return Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).
newURI(spec, null, null);
}
// If there's no location registered for the profile direcotry, register one now.
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
var profileDir = null;
try {
profileDir = dirSvc.get(NS_APP_USER_PROFILE_50_DIR, Ci.nsIFile);
} catch (e) {}
if (!profileDir) {
// Register our own provider for the profile directory.
// It will simply return the current directory.
var provider = {
getFile: function(prop, persistent) {
persistent.value = true;
if (prop == NS_APP_USER_PROFILE_50_DIR) {
return dirSvc.get("CurProcD", Ci.nsIFile);
}
if (prop == NS_APP_HISTORY_50_FILE) {
var histFile = dirSvc.get("CurProcD", Ci.nsIFile);
histFile.append("history.dat");
return histFile;
}
throw Cr.NS_ERROR_FAILURE;
},
QueryInterface: function(iid) {
if (iid.equals(Ci.nsIDirectoryServiceProvider) ||
iid.equals(Ci.nsISupports)) {
return this;
}
throw Cr.NS_ERROR_NO_INTERFACE;
}
};
dirSvc.QueryInterface(Ci.nsIDirectoryService).registerProvider(provider);
}
// Do not attempt to restore any session since we don't have any windows
Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefBranch).
setBoolPref("browser.privatebrowsing.keep_current_session", true);
/**
* Removes any files that could make our tests fail.
*/
function cleanUp()
{
let files = [
"downloads.sqlite",
"places.sqlite",
"cookies.sqlite",
"signons.sqlite",
"permissions.sqlite"
];
for (let i = 0; i < files.length; i++) {
let file = dirSvc.get("ProfD", Ci.nsIFile);
file.append(files[i]);
if (file.exists())
file.remove(false);
}
}
cleanUp();
/**
* Finalize Places statements during quit-application in order to prevent leaks
*/
function shutdownPlaces() {
let os = Cc["@mozilla.org/observer-service;1"].
getService(Ci.nsIObserverService);
os.notifyObservers(null, "quit-application", null);
}
var PRIVATEBROWSING_CONTRACT_ID;
function run_test_on_all_services() {
var contractIDs = [
"@mozilla.org/privatebrowsing;1",
"@mozilla.org/privatebrowsing-wrapper;1"
];
for (var i = 0; i < contractIDs.length; ++i) {
PRIVATEBROWSING_CONTRACT_ID = contractIDs[i];
run_test_on_service();
cleanUp();
}
}
|
{
"pile_set_name": "Github"
}
|
package hanging_suite_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestHangingSuite(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "HangingSuite Suite")
}
|
{
"pile_set_name": "Github"
}
|
package de.zalando.play.controllers
import akka.util.ByteString
import play.api.http.Writeable
import play.api.libs.json._
import play.api.mvc.Results.{ Redirect, Status }
import play.api.mvc.{ AnyContentAsMultipartFormData, RequestHeader, Results }
import scala.language.implicitConversions
case class WriteableWrapper[T](w: Writeable[T], m: Manifest[T])
object WriteableWrapper {
implicit def writeable2wrapper[T](w: Writeable[T])(implicit m: Manifest[T]): WriteableWrapper[T] =
WriteableWrapper(w, m)
implicit val anyContentAsMultipartFormWritable: Writeable[AnyContentAsMultipartFormData] = {
MultipartFormDataWritable.singleton.map(_.mdf)
}
}
/**
* @since 28.02.2016.
*/
object ResponseWriters extends ResponseWritersBase
trait ResponseWritersBase {
type ContentType = String
def custom: Seq[WriteableWrapper[_]] = Seq.empty
case class choose[T](mimeType: ContentType) {
def apply[R <: Any](registry: Seq[WriteableWrapper[_]] = custom)(implicit m: Manifest[R]): Option[Writeable[R]] =
registry filter {
_.w.contentType.exists(_ == mimeType)
} find { p =>
m.runtimeClass.isAssignableFrom(p.m.runtimeClass)
} map {
_.asInstanceOf[WriteableWrapper[R]]
} map (_.w)
}
implicit val jsonTranslatedParsingErrorWrites = Json.writes[TranslatedParsingError]
implicit val jsonTranslatedParsingErrorsContainerWrites = Json.writes[TranslatedParsingErrorsContainer]
}
object WrappedBodyParsers extends WrappedBodyParsersBase
trait WrappedBodyParsersBase {
implicit def parser2parserWrapper[T](p: Parser[T])(implicit m: Manifest[T]): ParserWrapper[T] = ParserWrapper(p, m)
type Parser[T] = ByteString => T
case class ParserWrapper[T](p: Parser[T], m: Manifest[T])
val custom: Seq[(String, ParserWrapper[_])] = Seq.empty
def anyParser[T](implicit manifest: Manifest[T]): Seq[(String, Parser[T])] =
custom.filter(_._2.m.runtimeClass.isAssignableFrom(manifest.runtimeClass)).map { e =>
e.copy(_2 = e._2.asInstanceOf[ParserWrapper[T]].p)
}
def optionParser[T](implicit manifest: Manifest[T]): Seq[(String, Parser[Option[T]])] = anyParser[Option[T]]
}
trait ResultWrapper[ResultT] {
val emptyByteString = akka.util.CompactByteString.empty
def statusCode: Int
def result: ResultT
def toResultWithWriter(implicit writer: Writeable[ResultT]): play.api.mvc.Result =
if (statusCode / 100 == 3)
Redirect(result.toString, statusCode)
else
Status(statusCode)(result)
def writer: String => Option[Writeable[ResultT]]
def toResult(mimeType: String): Option[play.api.mvc.Result] =
if (statusCode / 100 == 3)
Option(Redirect(result.toString, statusCode))
else
writer(mimeType).map(Status(statusCode)(result)(_))
}
|
{
"pile_set_name": "Github"
}
|
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "skip/Type.h"
#include "testutil.h"
#include <gtest/gtest.h>
using namespace skip;
using namespace skip::test;
namespace {
std::vector<size_t> absOffsets(const std::vector<ssize_t>& offsets) {
std::vector<size_t> res(offsets.size());
for (size_t i = 0; i < offsets.size(); ++i)
res[i] = std::abs(offsets[i]);
return res;
}
void skipNegativeOffsets(const std::vector<ssize_t>& offsets, size_t& index) {
while ((index < offsets.size()) && (offsets[index] < 0)) {
++index;
}
}
std::vector<ssize_t> unrollOffsets(
const std::vector<ssize_t>& offsets,
size_t userByteSize,
arraysize_t arraySize) {
std::vector<ssize_t> unrolledOffsets;
for (arraysize_t i = 0; i < arraySize; ++i) {
for (auto offset : offsets) {
bool neg = offset < 0;
unrolledOffsets.push_back(
(std::abs(offset) + userByteSize * i) * (neg ? -1 : 1));
}
}
return unrolledOffsets;
}
void verifyRefs(
Type& t,
const std::vector<ssize_t>& offsets,
arraysize_t arraySize = 1) {
// Purposely create an RObj without a VTable in the hope that if Type
// incorrectly tries to access the VTable (incorrect since we already know the
// Type) it will SEGV.
// A negative offset indicates an offset that should be filled with a fakeptr.
const size_t objUserSize = t.userByteSize() * arraySize;
auto raw = std::unique_ptr<void, decltype(::free)*>(
::calloc(t.uninternedMetadataByteSize() + objUserSize, 1), ::free);
auto robj =
static_cast<RObj*>(mem::add(raw.get(), t.uninternedMetadataByteSize()));
static_cast<AObjMetadata*>(raw.get())->m_arraySize = arraySize;
std::vector<ssize_t> unrolledOffsets =
unrollOffsets(offsets, t.userByteSize(), arraySize);
// Fake up some data that looks sort of like pointers (and not nil)
for (auto offset : unrolledOffsets) {
assert(std::abs(offset) + sizeof(void*) <= objUserSize);
const ssize_t value = (offset + 1) * sizeof(void*);
*((ssize_t*)mem::add(robj, std::abs(offset))) = value;
}
size_t nextOffset = 0;
skipNegativeOffsets(unrolledOffsets, nextOffset);
t.eachValidRef(*robj, [&](RObj*& ref) {
const ssize_t off = unrolledOffsets[nextOffset];
EXPECT_EQ(&ref, mem::add(robj, off));
EXPECT_EQ((size_t)ref, (off + 1) * sizeof(void*));
++nextOffset;
skipNegativeOffsets(unrolledOffsets, nextOffset);
});
EXPECT_EQ(nextOffset, unrolledOffsets.size());
nextOffset = 0;
skipNegativeOffsets(unrolledOffsets, nextOffset);
t.forEachRef(*robj, [&](RObjOrFakePtr& ref) {
if (ref.isPtr()) {
const ssize_t off = unrolledOffsets[nextOffset];
EXPECT_EQ(&ref, mem::add(robj, off));
EXPECT_EQ((size_t)ref.asPtr(), (off + 1) * sizeof(void*));
++nextOffset;
skipNegativeOffsets(unrolledOffsets, nextOffset);
}
});
EXPECT_EQ(nextOffset, unrolledOffsets.size());
nextOffset = 0;
t.forEachRef(*robj, [&](RObjOrFakePtr& ref) {
const ssize_t off = unrolledOffsets[nextOffset];
EXPECT_EQ(&ref, mem::add(robj, std::abs(off)));
EXPECT_EQ((size_t)ref.sbits(), (off + 1) * sizeof(void*));
++nextOffset;
});
EXPECT_EQ(nextOffset, unrolledOffsets.size());
}
TEST(TypeTest, testType1) {
// Test a simple no-ref structure.
std::vector<ssize_t> refs = {};
auto t = Type::classFactory("TypeTest.testType1", 42, absOffsets(refs));
// classFactory() rounds up the byte size
EXPECT_EQ(t->userByteSize(), (size_t)48);
EXPECT_EQ(t->uninternedMetadataByteSize(), sizeof(RObjMetadata));
EXPECT_EQ(t->internedMetadataByteSize(), sizeof(IObjMetadata));
EXPECT_EQ(t->kind(), Type::Kind::refClass);
EXPECT_FALSE(t->hasRefs());
verifyRefs(*t, refs);
}
TEST(TypeTest, testType2) {
// Test a simple structure with refs.
std::vector<ssize_t> refs = {8 * 0, 8 * 1, -8 * 5, 8 * 8};
auto t = Type::classFactory("TypeTest.testType2", 100, absOffsets(refs));
// classFactory() rounds up the byte size
EXPECT_EQ(t->userByteSize(), (size_t)104);
EXPECT_EQ(t->uninternedMetadataByteSize(), sizeof(RObjMetadata));
EXPECT_EQ(t->internedMetadataByteSize(), sizeof(IObjMetadata));
EXPECT_EQ(t->kind(), Type::Kind::refClass);
EXPECT_TRUE(t->hasRefs());
verifyRefs(*t, refs);
}
TEST(TypeTest, testType3) {
// Test a really big structure with ref gaps big enough to skip mask entries.
std::vector<ssize_t> refs = {8 * 0,
8 * 17,
-8 * 67,
-8 * 82,
8 * 199,
8 * 200,
8 * 201,
8 * 254,
8 * 255,
8 * 256,
8 * 257};
auto t = Type::classFactory("TypeTest.testType3", 8 * 260, absOffsets(refs));
EXPECT_EQ(t->userByteSize(), (size_t)8 * 260);
EXPECT_EQ(t->uninternedMetadataByteSize(), sizeof(RObjMetadata));
EXPECT_EQ(t->internedMetadataByteSize(), sizeof(IObjMetadata));
EXPECT_EQ(t->kind(), Type::Kind::refClass);
EXPECT_TRUE(t->hasRefs());
verifyRefs(*t, refs);
}
TEST(TypeTest, testType4) {
// Test a really big structure with ref gaps big enough to skip mask entries.
std::vector<ssize_t> refs = {2648};
auto t = Type::classFactory("TypeTest.testType4", 6656, absOffsets(refs));
verifyRefs(*t, refs);
}
TEST(TypeTest, testType5) {
std::vector<ssize_t> refs = {-2648};
auto t = Type::classFactory("TypeTest.testType5", 6620, absOffsets(refs));
verifyRefs(*t, refs);
}
// TODO: If we add another GC mask stripe this is a reasonable test:
// TEST(TypeTest, testType6) {
// // Test freeze references
// std::vector<ssize_t> refs = {8*0, 8*8, -8*17, 8*
|
{
"pile_set_name": "Github"
}
|
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:/Users/Vikram/Documents/Android/adt-bundle-windows-x86-20130219/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
|
{
"pile_set_name": "Github"
}
|
#
# Copyright © 2012 - 2020 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 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/>.
#
"""Tests for char based quality checks."""
from unittest import TestCase
from weblate.checks.chars import (
BeginNewlineCheck,
BeginSpaceCheck,
DoubleSpaceCheck,
EndColonCheck,
EndEllipsisCheck,
EndExclamationCheck,
EndNewlineCheck,
EndQuestionCheck,
EndSemicolonCheck,
EndSpaceCheck,
EndStopCheck,
EscapedNewlineCountingCheck,
KashidaCheck,
MaxLengthCheck,
NewLineCountCheck,
PunctuationSpacingCheck,
ZeroWidthSpaceCheck,
)
from weblate.checks.tests.test_checks import CheckTestCase, MockUnit
class BeginNewlineCheckTest(CheckTestCase):
check = BeginNewlineCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("\nstring", "\nstring", "")
self.test_failure_1 = ("\nstring", " \nstring", "")
self.test_failure_2 = ("string", "\nstring", "")
class EndNewlineCheckTest(CheckTestCase):
check = EndNewlineCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string\n", "string\n", "")
self.test_failure_1 = ("string\n", "string", "")
self.test_failure_2 = ("string", "string\n", "")
class BeginSpaceCheckTest(CheckTestCase):
check = BeginSpaceCheck()
def setUp(self):
super().setUp()
self.test_good_matching = (" string", " string", "")
self.test_good_ignore = (".", " ", "")
self.test_good_none = (" The ", " ", "")
self.test_failure_1 = (" string", " string", "")
self.test_failure_2 = (" string", " string", "")
class EndSpaceCheckTest(CheckTestCase):
check = EndSpaceCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string ", "string ", "")
self.test_good_ignore = (".", " ", "")
self.test_good_none = (" The ", " ", "")
self.test_failure_1 = ("string ", "string", "")
self.test_failure_2 = ("string", "string ", "")
class DoubleSpaceCheckTest(CheckTestCase):
check = DoubleSpaceCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string string", "string string", "")
self.test_good_ignore = (" ", " ", "")
self.test_failure_1 = ("string string", "string string", "")
class EndStopCheckTest(CheckTestCase):
check = EndStopCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string.", "string.", "")
self.test_good_ignore = (".", " ", "")
self.test_failure_1 = ("string.", "string", "")
self.test_failure_2 = ("string", "string.", "")
def test_japanese(self):
self.do_test(False, ("Text:", "Text。", ""), "ja")
self.do_test(True, ("Text:", "Text", ""), "ja")
def test_hindi(self):
self.do_test(False, ("Text.", "Text।", ""), "hi")
self.do_test(True, ("Text.", "Text", ""), "hi")
def test_armenian(self):
self.do_test(False, ("Text:", "Text`", ""), "hy")
self.do_test(False, ("Text:", "Text՝", ""), "hy")
self.do_test(True, ("Text.", "Text", ""), "hy")
class EndColonCheckTest(CheckTestCase):
check = EndColonCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string:", "string:", "")
self.test_failure_1 = ("string:", "string", "")
self.test_failure_2 = ("string", "string:", "")
def test_hy(self):
self.do_test(False, ("Text:", "Texte՝", ""), "hy")
self.do_test(True, ("Text:", "Texte", ""), "hy")
self.do_test(False, ("Text", "Texte:", ""), "hy")
def test_japanese(self):
self.do_test(False, ("Text:", "Texte。", ""), "ja")
def test_japanese_ignore(self):
self.do_test(False, ("Text", "Texte", ""), "ja")
class EndQuestionCheckTest(CheckTestCase):
check = EndQuestionCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string?", "string?", "")
self.test_failure_1 = ("string?", "string", "")
self.test_failure_2 = ("string", "string?", "")
def test_hy(self):
self.do_test(False, ("Text?", "Texte՞", ""), "hy")
self.do_test(True, ("Text?", "Texte", ""), "hy")
self.do_test(False, ("Text", "Texte?", ""), "hy")
def test_greek(self):
self.do_test(False, ("Text?", "Texte;", ""), "el")
self.do_test(False, ("Text?", "Texte;", ""), "el")
def test_greek_ignore(self):
self.do_test(False, ("Text", "Texte", ""), "el")
def test_greek_wrong(self):
self.do_test(True, ("Text?", "Texte", ""), "el")
class EndExclamationCheckTest(CheckTestCase):
check = EndExclamationCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string!", "string!", "")
self.test_failure_1 = ("string!", "string", "")
self.test_failure_2 = ("string", "string!", "")
def test_hy(self):
self.do_test(False, ("Text!", "Texte՜", ""), "hy")
self.do_test(False, ("Text!", "Texte", ""), "hy")
self.do_test(False, ("Text", "Texte!", ""), "hy")
def test_eu(self):
self.do_test(False, ("Text!", "¡Texte!", ""), "eu")
class EndEllipsisCheckTest(CheckTestCase):
check = EndEllipsisCheck()
def setUp(self):
super().setUp()
self.test_good_matching = ("string…", "string…", "")
self.test_failure_1 = ("string…", "string...", "")
self.test_failure_2 = ("string.", "string…", "")
self.test_failure_3 = ("string..", "string…", "")
def test_translate(self):
self.do_test(False, ("string...", "string…", ""))
class Escaped
|
{
"pile_set_name": "Github"
}
|
package org.w3c.files;
// Downloaded from https://raw.githubusercontent.com/w3c/FileAPI/gh-pages/index.html
[Constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options),
Exposed=(Window,Worker)]
interface Blob {
readonly attribute unsigned long long size;
readonly attribute DOMString type;
readonly attribute boolean isClosed;
//slice Blob into byte-ranged chunks
Blob slice([Clamp] optional long long start,
[Clamp] optional long long end,
optional DOMString contentType);
void close();
};
dictionary BlobPropertyBag {
DOMString type = "";
};
typedef (BufferSource or Blob or USVString) BlobPart;
[Constructor(sequence<BlobPart> fileBits,
[EnsureUTF16] DOMString fileName,
optional FilePropertyBag options),
Exposed=(Window,Worker)]
interface File : Blob {
readonly attribute DOMString name;
readonly attribute long long lastModified;
};
dictionary FilePropertyBag : BlobPropertyBag {
long long lastModified;
};
[Exposed=(Window,Worker)]
interface FileList {
getter File? item(unsigned long index);
readonly attribute unsigned long length;
};
[Constructor, Exposed=(Window,Worker)]
interface FileReader: EventTarget {
// async read methods
void readAsArrayBuffer(Blob blob);
void readAsBinaryString(Blob blob);
void readAsText(Blob blob, optional DOMString label);
void readAsDataURL(Blob blob);
void abort();
// states
const unsigned short EMPTY = 0;
const unsigned short LOADING = 1;
const unsigned short DONE = 2;
readonly attribute unsigned short readyState;
// File or Blob data
readonly attribute (DOMString or ArrayBuffer)? result;
readonly attribute DOMError? error;
// event handler content attributes
attribute EventHandler onloadstart;
attribute EventHandler onprogress;
attribute EventHandler onload;
attribute EventHandler onabort;
attribute EventHandler onerror;
attribute EventHandler onloadend;
};
[Constructor, Exposed=Worker]
interface FileReaderSync {
// Synchronously return strings
ArrayBuffer readAsArrayBuffer(Blob blob);
DOMString readAsBinaryString(Blob blob);
DOMString readAsText(Blob blob, optional DOMString label);
DOMString readAsDataURL(Blob blob);
};
[Exposed=(Window,DedicatedWorker,SharedWorker)]
partial interface URL {
static DOMString createObjectURL(Blob blob);
static DOMString createFor(Blob blob);
static void revokeObjectURL(DOMString url);
};
[Constructor(optional sequence<BlobPart> blobParts, optional BlobPropertyBag options),
Exposed=(Window,Worker)]
interface Blob {
readonly attribute unsigned long long size;
readonly attribute DOMString type;
readonly attribute boolean isClosed;
//slice Blob into byte-ranged chunks
Blob slice([Clamp] optional long long start,
[Clamp] optional long long end,
optional DOMString contentType);
void close();
};
dictionary BlobPropertyBag {
DOMString type = "";
};
typedef (BufferSource or Blob or USVString) BlobPart;
[Constructor(sequence<BlobPart> fileBits,
[EnsureUTF16] DOMString fileName,
optional FilePropertyBag options),
Exposed=(Window,Worker)]
interface File : Blob {
readonly attribute DOMString name;
readonly attribute long long lastModified;
};
dictionary FilePropertyBag : BlobPropertyBag {
long long lastModified;
};
[Exposed=(Window,Worker)]
interface FileList {
getter File? item(unsigned long index);
readonly attribute unsigned long length;
};
[Constructor, Exposed=(Window,Worker)]
interface FileReader: EventTarget {
// async read methods
void readAsArrayBuffer(Blob blob);
void readAsBinaryString(Blob blob);
void readAsText(Blob blob, optional DOMString label);
void readAsDataURL(Blob blob);
void abort();
// states
const unsigned short EMPTY = 0;
const unsigned short LOADING = 1;
const unsigned short DONE = 2;
readonly attribute unsigned short readyState;
// File or Blob data
readonly attribute (DOMString or ArrayBuffer)? result;
readonly attribute DOMError? error;
// event handler content attributes
attribute EventHandler onloadstart;
attribute EventHandler onprogress;
attribute EventHandler onload;
attribute EventHandler onabort;
attribute EventHandler onerror;
attribute EventHandler onloadend;
};
[Constructor, Exposed=Worker]
interface FileReaderSync {
// Synchronously return strings
ArrayBuffer readAsArrayBuffer(Blob blob);
DOMString readAsBinaryString(Blob blob);
DOMString readAsText(Blob blob, optional DOMString label);
DOMString readAsDataURL(Blob blob);
};
[Exposed=(Window,DedicatedWorker,SharedWorker)]
partial interface URL {
static DOMString createObjectURL(Blob blob);
static DOMString createFor(Blob blob);
static void revokeObjectURL(DOMString url);
};
|
{
"pile_set_name": "Github"
}
|
<?php
$strings['plugin_title'] = 'Google Maps';
$strings['plugin_comment'] = 'Enable the functionality to show google maps';
$strings['extra_field_name_help'] = "Enter one or many extra user fields name separated by a comma (,) from which you want to obtain the locations, you can get up to 5 geolocation fields (the rest will be ignored) which will be marked with the following icons respectively:
<br><br>
<img src='//maps.google.com/mapfiles/ms/icons/red-dot.png'> <img src='//maps.google.com/mapfiles/ms/icons/blue-dot.png'> <img src='//maps.google.com/mapfiles/ms/icons/green-dot.png'> <img src='//maps.google.com/mapfiles/ms/icons/yellow-dot.png'> <img src='//maps.google.com/mapfiles/ms/icons/purple-dot.png'>
<br><br>
Follow the link below to see the map : <a href='".api_get_path(WEB_PLUGIN_PATH)."google_maps/src/map_coordinates.php'>".api_get_path(WEB_PLUGIN_PATH).'google_maps/src/map_coordinates.php</a>';
$strings['enable_api'] = 'Enable API';
$strings['api_key'] = 'Api Key';
$strings['extra_field_name'] = 'Extra field name';
$strings['UsersCoordinatesMap'] = 'Users location Map';
|
{
"pile_set_name": "Github"
}
|
# 现实可以有多美好?
## 作者: 张晓斐 赞同: 26
十八岁的那一年,高考成绩出来,加上在之前拿到的自主招生加分,幸运了进去了某所985高校读书,之所以说是幸运,是因为学校录取分与专业录取分都刚刚比自己的成绩高
一分,然后又在选专业的过程当中,又到自主招生政策保护,进入本学院最好专业入读。
从高二开始,就喜欢一个女孩儿,视她为学习上的目标,进而慢慢对她有了依赖,有了情感,发展成为喜欢,可是一直没有追上,大学有幸报了同一所大学,当然完全是巧合,同
学校不是同一个校区,但是那份炽热的感情得以延续。
之所以说是炽热,是因为当时的年纪,爱的死去活来。新生开学后的一个月,是她的生日,鲜花,蛋糕,朋友的祝福。往后的每一个节日,总是会孤零零的跑去她的校区,死活让
她收下自己买的东西。数次表白,各种被拒,仍不死心。
一次次的拧着自己,钻牛角尖,质问自己为什么追不上!!生活也陷入了同样的怪圈,事事拧着自己,顶着脑门横冲直撞。生活乱套了,整个人则全乱了。
从来一帆风顺的我开始遇到挫折,学习成绩永远在挂课的边缘,足球场上开始状态迷失,每天起床之后就是一副混混僵僵的样子。开始没有自信,自暴自弃。
生活渴望寻求改变,从大二下开始,就强制自己不再联系,到了大三上,一次偶然的机会,我们两个都带着自己的小伙伴回到一同的家乡,短暂几天快乐的玩耍,让我顿时又燃起
了那颗躁动的心,她的感觉也来的如此之快,瞬间我们俩就突然在一起了。
痛苦的半年,散也散的很突然。在那一刻,回望过去的三年,觉得自己什么都没有了,曾经引以为傲的那些东西,优秀的成绩,健硕的身体,开朗的性格,自信的心态,当然还有
爱情的希望。全都消失了,一贫如洗。
紧接而来的考研是苦行僧一般的半年,那种感觉就是自己一无所有了,然后重新从地下捡起一点点原材料,试着一步步加工出来自己内心所渴望的那些东西,艰难,漫长但是觉得
很幸福。
考研不出意料的失败了,不过并没有觉得自己跌落更深的深渊,而是突然发现,内心平静而又那么充实。开始尝试静下心来做些自己喜欢做的事情。去健身,身体开始恢复,从1
60减肥到了140,精神状态开始变好。然后找工作,尝试从最差的开始,一个个开始挑战,全部拿到offer,最终拿到最心仪企业的录入书。
然后她出现了,毫无预兆,就突然有一天我们两个进去了对方的世界,朋友的介绍网上短暂聊了十天,感觉好好,见面,牵手,表白。我觉得这是我一辈子做的最果断最明智的决
定。遇到她了,就紧紧抓住了,后来我跟她说,我觉得以前遭受的所有苦难,都是为了很好的提升自己,直到遇到你。
遇到她之后,我说我变了,她说她知道,看以前我的照片,她说我眼神中根本无光,现在的我,充满自信,眼神发亮。
现在的我过的好幸福,很知足。感谢幸福来的那么措手不及,却又让我觉得那么倍感珍惜。当然现在的我总包含那么一股子精神劲儿,你来了,我就抓紧你,不让你走了,我得做
好自己,未来的日子给你幸福。
#### 原链接: http://www.zhihu.com/question/24269892/answer/27386055
|
{
"pile_set_name": "Github"
}
|
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Operations for bucketing data into groups.
The classes and functions in this module are used to queue up data into
buckets conditional on side information (e.g. sequence length).
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.framework import tensor_shape
from tensorflow.python.framework import tensor_util
from tensorflow.python.layers import utils
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import control_flow_ops
from tensorflow.python.ops import data_flow_ops
from tensorflow.python.ops import math_ops
from tensorflow.python.summary import summary
from tensorflow.python.training import input as input_py
from tensorflow.python.training import queue_runner
# pylint: disable=protected-access
_as_original_type = input_py._as_original_type
_as_tensor_list = input_py._as_tensor_list
_restore_sparse_tensors = input_py._restore_sparse_tensors
_dtypes = input_py._dtypes
_store_sparse_tensors = input_py._store_sparse_tensors
_validate_keep_input = input_py._validate_keep_input
_shapes = input_py._shapes
_which_queue = input_py._which_queue
# pylint: enable=protected-access
def _validate_bucket(tensor_list):
tensor_list = ops.convert_n_to_tensor_or_indexed_slices(tensor_list)
if not tensor_list:
raise ValueError("Expected at least one tensor in bucket().")
return tensor_list
def bucket(tensors,
which_bucket,
batch_size,
num_buckets,
num_threads=1,
capacity=32,
bucket_capacities=None,
shapes=None,
dynamic_pad=False,
allow_smaller_final_batch=False,
keep_input=True,
shared_name=None,
name=None):
"""Lazy bucketing of input tensors according to `which_bucket`.
The argument `tensors` can be a list or a dictionary of tensors.
The value returned by the function will be of the same type
as `tensors`.
The tensors entering this function are put into the bucket given by
`which_bucket`. Each bucket has its own queue. When a bucket contains
`batch_size` elements, this minibatch is pushed onto a top queue. The
tensors returned from this function are a the result of dequeueing the
next minibatch from this top queue.
This function is implemented using several queues. A `QueueRunner` for the
queues is added to the current `Graph`'s `QUEUE_RUNNER` collection.
As the returned tensors are the result of a dequeue operation, evaluating
them will throw a `tf.errors.OutOfRangeError` when the input queue is
exhausted. If these tensors are feeding another input queue, its queue runner
will catch this exception, however, if they are used in your main thread
you are responsible for catching this yourself.
*N.B.:* If `dynamic_pad` is `False`, you must ensure that either
(i) the `shapes` argument is passed, or (ii) all of the tensors in
`tensors` must have fully-defined shapes. `ValueError` will be
raised if neither of these conditions holds.
If `dynamic_pad` is `True`, it is sufficient that the *rank* of the
tensors is known, but individual dimensions may have shape `None`.
In this case, for each enqueue the dimensions with value `None`
may have a variable length; upon dequeue, the output tensors will be padded
on the right to the maximum shape of the tensors in the current minibatch.
For numbers, this padding takes value 0. For strings, this padding is
the empty string. See `PaddingFIFOQueue` for more info.
If `allow_smaller_final_batch` is `True`, a smaller batch value than
`batch_size` is returned when the queues are closed and there are not enough
elements to fill the batch, otherwise the pending elements are discarded.
In addition, all output tensors' static shapes, as accessed via the
`get_shape()` method will have a 0th `Dimension` value of `None`, and
operations that depend on fixed batch_size would fail.
Args:
tensors: The list or dictionary of tensors, representing a single element,
to bucket. Nested lists are not supported.
which_bucket: An `int32` scalar Tensor taking a value in `[0, num_buckets)`.
batch_size: The new batch size pulled from the queue (all queues will have
the same size). If a list is passed in then each bucket will have a
different batch_size.
(python int, int32 scalar or iterable of integers of length num_buckets).
num_buckets: A python integer, the number of buckets.
num_threads: An integer. The number of threads enqueuing `tensors`.
capacity: An integer. The maximum number of minibatches in the top queue,
and also (by default) the maximum number of elements within each bucket.
bucket_capacities: (Optional) None or a list of integers, the capacities of
each bucket. If None, capacity is used (default). If specified, it must
be a list of integers of length num_buckets: the i-th element is used
as capacity for the i-th bucket queue.
shapes: (Optional) The shapes for each example. Defaults to the
inferred shapes for `tensors`.
dynamic_pad: Boolean. Allow variable dimensions in input shapes.
The given dimensions are padded upon dequeue so that tensors within a
batch have the same shapes.
allow_smaller_final_batch: (Optional) Boolean. If `True`, allow the final
batches to be smaller if there are insufficient items left in the queues.
keep_input: A `bool` scalar Tensor. If provided, this tensor controls
whether the input is added to the queue or not. If it evaluates `True`,
then `tensors` are added to the bucket; otherwise they are dropped. This
tensor essentially acts as a filtering mechanism.
shared_name: (Optional). If set, the queues will be shared under the given
name across multiple sessions.
name: (Optional) A name for the operations.
Returns:
A tuple `(bucket, outputs)` where `bucket` is
a `int32` scalar tensor and `outputs` is a list or
dictionary of batched outputs corresponding to elements of `tensors`.
Every step will receive a new bucket of outputs.
Raises:
ValueError: If the `shapes` are not specified, and cannot be
inferred from the elements of `tensors` or if batch_size is a sequence
but its length != num_buckets. Also if bucket_capacities is not None but
its length != num_buckets.
"""
batch_size_per_bucket = False
if isinstance(batch_size, (list, tuple)):
batch_size_per_bucket = True
if len(batch_size) != num_buckets:
raise ValueError(
"If batch_size is a list it must have num_buckets elements")
else:
batch_size = [batch_size] * num_buckets
if bucket_capacities is None:
bucket_capacities = [capacity] *
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `number` mod in crate `core_foundation_sys`."><meta name="keywords" content="rust, rustlang, rust-lang, number"><title>core_foundation_sys::number - Rust</title><link rel="stylesheet" type="text/css" href="../../normalize.css"><link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../dark.css"><link rel="stylesheet" type="text/css" href="../../light.css" id="themeStyle"><script src="../../storage.js"></script></head><body class="rustdoc mod"><!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><p class='location'>Module number</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#statics">Statics</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><p class='location'><a href='../index.html'>core_foundation_sys</a></p><script>window.sidebarCurrent = {name: 'number', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="../../brush.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="../../theme.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><a id="settings-menu" href="../../settings.html"><img src="../../wheel.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class='fqn'><span class='out-of-band'><span id='render-detail'><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class='inner'>−</span>]</a></span><a class='srclink' href='../../src/core_foundation_sys/number.rs.html#10-59' title='goto source code'>[src]</a></span><span class='in-band'>Module <a href='../index.html'>core_foundation_sys</a>::<wbr><a class="mod" href=''>number</a></span></h1><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class="struct" href="struct.__CFBoolean.html"
title='struct core_foundation_sys::number::__CFBoolean'>__CFBoolean</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.__CFNumber.html"
title='struct core_foundation_sys::number::__CFNumber'>__CFNumber</a></td>
<td class='docblock-short'>
</td>
</tr></table><h2 id='statics' class='section-header'><a href="#statics">Statics</a></h2>
<table>
<tr class=' module-item'>
<td><a class="static" href="static.kCFBooleanFalse.html"
title='static core_foundation_sys::number::kCFBooleanFalse'>kCFBooleanFalse</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="static" href="static.kCFBooleanTrue.html"
title='static core_foundation_sys::number::kCFBooleanTrue'>kCFBooleanTrue</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="static" href="static.kCFNumberFloat64Type.html"
title='static core_foundation_sys::number::kCFNumberFloat64Type'>kCFNumberFloat64Type</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="static" href="static.kCFNumberSInt32Type.html"
title='static core_foundation_sys::number::kCFNumberSInt32Type'>kCFNumberSInt32Type</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="static" href="static.kCFNumberSInt64Type.html"
title='static core_foundation_sys::number::kCFNumberSInt64Type'>kCFNumberSInt64Type</a></td>
<td class='docblock-short'>
</td>
</tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class="fn" href="fn.CFBooleanGetTypeID.html"
title='fn core_foundation_sys::number::CFBooleanGetTypeID'>CFBooleanGetTypeID</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.CFNumberCreate.html"
title='fn core_foundation_sys::number::CFNumberCreate'>CFNumberCreate</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.CFNumberGetTypeID.html"
title='fn core_foundation_sys::number::CFNumberGetTypeID'>CFNumberGetTypeID</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.CFNumberGetValue.html"
title='fn core_foundation_sys::number::CFNumberGetValue'>CFNumberGetValue</a><a title='unsafe function' href='#'><sup>⚠</sup></a></td>
<td class='docblock-short'>
</td>
</tr></table><h2 id='types' class='section-header'><a href="#types">Type Definitions</a></h2>
<table>
<tr class=' module-item'>
<td><a class="type" href="type.CFBooleanRef.html"
title='type core_foundation_sys::number::CFBooleanRef'>CFBooleanRef</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="type" href="type.CFNumberRef.html"
|
{
"pile_set_name": "Github"
}
|
h = 0.1;
Point(1) = {-0.4, -0.4, 0, h};
Point(2) = {8.300000000000001, -0.4, 0, h};
Point(3) = {8.300000000000001, 2.4, 0, h};
Point(4) = {-0.4, 2.4, 0, h};
Point(30) = {0, 0, 0, h};
Point(31) = {0.2, 0, 0, h};
Point(32) = {0.2, 0.9, 0, h};
Point(33) = {0.8, 0.9, 0, h};
Point(34) = {0.8, 1.1, 0, h};
Point(35) = {0.2, 1.1, 0, h};
Point(36) = {0.2, 1.8, 0, h};
Point(37) = {1, 1.8, 0, h};
Point(38) = {1, 2, 0, h};
Point(39) = {0, 2, 0, h};
Point(40) = {1.4, 0, 0, h};
Point(41) = {2.4, 0, 0, h};
Point(42) = {2.4, 0.2, 0, h};
Point(43) = {1.6, 0.2, 0, h};
Point(44) = {1.6, 0.9, 0, h};
Point(45) = {2, 0.9, 0, h};
Point(46) = {2, 1.1, 0, h};
Point(47) = {1.6, 1.1, 0, h};
Point(48) = {1.6, 1.8, 0, h};
Point(49) = {2.4, 1.8, 0, h};
Point(50) = {2.4, 2, 0, h};
Point(51) = {1.4, 2, 0, h};
Point(52) = {2.8, 0, 0, h};
Point(53) = {3.8, 0, 0, h};
Point(54) = {3.8, 0.2, 0, h};
Point(55) = {3, 0.2, 0, h};
Point(56) = {3, 0.9, 0, h};
Point(57) = {3.4, 0.9, 0, h};
Point(58) = {3.4, 1.1, 0, h};
Point(59) = {3, 1.1, 0, h};
Point(60) = {3, 1.8, 0, h};
Point(61) = {3.8, 1.8, 0, h};
Point(62) = {3.8, 2, 0, h};
Point(63) = {2.8, 2, 0, h};
Point(64) = {4.2, 0, 0, h};
Point(65) = {5.2, 0, 0, h};
Point(66) = {5.2, 0.2, 0, h};
Point(67) = {4.4, 0.2, 0, h};
Point(74) = {4.4, 2, 0, h};
Point(75) = {4.2, 2, 0, h};
Point(80) = {5.6, 0.6, 0, h};
Point(81) = {6, 0.6, 0, h};
Point(82) = {6, 0.2, 0, h};
Point(83) = {6.199999999999999, 0.2, 0, h};
Point(84) = {6.199999999999999, 0.6, 0, h};
Point(85) = {6.6, 0.6, 0, h};
Point(86) = {6.6, 0.8, 0, h};
Point(87) = {6.199999999999999, 0.8, 0, h};
Point(88) = {6.199999999999999, 1.2, 0, h};
Point(89) = {6, 1.2, 0, h};
Point(90) = {6, 0.8, 0, h};
Point(91) = {5.6, 0.8, 0, h};
Point(100) = {7, 0.6, 0, h};
Point(101) = {7.4, 0.6, 0, h};
Point(102) = {7.4, 0.2, 0, h};
Point(103) = {7.6, 0.2, 0, h};
Point(104) = {7.6, 0.6, 0, h};
Point(105) = {8, 0.6, 0, h};
Point(106) = {8, 0.8, 0, h};
Point(107) = {7.6, 0.8, 0, h};
Point(108) = {7.6, 1.2, 0, h};
Point(109) = {7.4, 1.2, 0, h};
Point(110) = {7.4, 0.8, 0, h};
Point(111) = {7, 0.8, 0, h};
Point(112) = {8.300000000000001, 2.4, 1, h};
Point(113) = {-0.4, 2.4, 1, h};
Point(117) = {-0.4, -0.4, 1, h};
Point(121) = {8.300000000000001, -0.4, 1, h};
Point(128) = {0, 2, 1, h};
Point(129) = {1, 2, 1, h};
Point(133) = {1, 1.8, 1, h};
Point(137) = {0.2, 1.8, 1, h};
Point(141) = {0.2, 1.1, 1, h};
Point(145) = {0.8, 1.1, 1, h};
Point(149) = {0.8, 0.9, 1, h};
Point(153) = {0.2, 0.9, 1, h};
Point(157) = {0.2, 0, 1, h};
Point(161) = {0, 0, 1, h};
Point(168) = {1.4, 2, 1, h};
Point(169) = {2.4, 2, 1, h};
Point(173) = {2.4, 1.8, 1, h};
Point(177) = {1.6, 1.8, 1, h};
Point(181) = {1.6, 1.1, 1, h};
Point(185) = {2, 1.1, 1, h};
Point(189) = {2, 0.9, 1, h};
Point(193) = {1.6, 0.9, 1, h};
Point(197) = {1.6, 0.2, 1, h};
Point(201) = {2.4, 0.2, 1, h};
Point(205) = {2.4, 0, 1, h};
Point(209) = {1.4, 0, 1, h};
Point(216) = {2.8, 2, 1, h};
Point(217) = {3.8, 2, 1, h};
Point(221) = {3.8, 1.8, 1, h};
Point(225) = {3, 1.8, 1, h};
Point(229) = {3, 1.1, 1, h};
Point(233) = {3.4, 1.1, 1, h};
Point(237) = {3.4, 0.9, 1, h};
Point(241) = {3, 0.9, 1, h};
Point(245) = {3, 0.2, 1, h};
Point(249) = {3.8, 0.2, 1, h};
Point(253) = {3.8, 0, 1, h};
Point(257) = {2.8, 0, 1, h};
Point(264) = {4.2, 2, 1, h};
Point(265) = {4.4, 2, 1, h};
Point(269) = {4.4, 0.2, 1, h};
Point(273) = {5.2, 0.2, 1, h};
Point(277) = {5.2, 0, 1, h};
Point(281) = {4.2, 0, 1, h};
Point(288) = {6, 1.2, 1
|
{
"pile_set_name": "Github"
}
|
@model IEnumerable<MVCMusicStore.Models.Review>
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
</p>
<table class="table">
<tr>
<th>
@Html.DisplayNameFor(model => model.Album.Title)
</th>
<th>
@Html.DisplayNameFor(model => model.Contents)
</th>
<th>
@Html.DisplayNameFor(model => model.ReviewerEmail)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Album.Title)
</td>
<td>
@Html.DisplayFor(modelItem => item.Contents)
</td>
<td>
@Html.DisplayFor(modelItem => item.ReviewerEmail)
</td>
<td>
@Html.ActionLink("Edit", "Edit", new { id=item.ReviewID }) |
@Html.ActionLink("Details", "Details", new { id=item.ReviewID }) |
@Html.ActionLink("Delete", "Delete", new { id=item.ReviewID })
</td>
</tr>
}
</table>
|
{
"pile_set_name": "Github"
}
|
/dts-v1/;
#include "bcm6348.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Comtrend CT-536+/CT-5621T";
compatible = "comtrend,ct536+", "brcm,bcm6348";
gpio-keys-polled {
compatible = "gpio-keys-polled";
#address-cells = <1>;
#size-cells = <0>;
poll-interval = <20>;
debounce-interval = <60>;
reset {
label = "reset";
gpios = <&gpio1 1 1>;
linux,code = <KEY_RESTART>;
};
};
gpio-leds {
compatible = "gpio-leds";
power_green {
label = "CT536_CT5621:green:power";
gpios = <&gpio0 0 1>;
default-state = "on";
};
adsl_fail_green {
label = "CT536_CT5621:green:adsl-fail";
gpios = <&gpio0 2 1>;
};
};
};
|
{
"pile_set_name": "Github"
}
|
#!/bin/bash
#
# urlmnt - Mount an afp/smb/ftp/webdav url as a volume in Mac OS X
#
# TO DO:
# -
# Reference:
# http://www.macosxhints.com/article.php?story=2001120201020569
# global variables
VERBOSE=0
HELP=0
# print usage instructions (help)
function usage() {
printf "Usage: urlmnt [options] url ...\n"
printf " -v verbose output\n"
printf " -h print these usage instructions\n"
}
# see if any arguments were passed in
if test $# -gt 0 ; then
# if so, step through them all and process them
print "test\n"
else
printf "You did not specify the URL of the volume to mount.\n\n"
usage
fi
|
{
"pile_set_name": "Github"
}
|
@font-face {font-family: "memberfont";
src: url('../icomoon/member/iconfont.eot'); /* IE9*/
src: url('../icomoon/member/iconfont.eot') format('embedded-opentype'), /* IE6-IE8 */
url('../icomoon/member/iconfont.woff') format('woff'), /* chrome, firefox */
url('../icomoon/member/iconfont.ttf') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
url('../icomoon/member/iconfont.svg') format('svg'); /* iOS 4.1- */
}
.memberfont {
font-family:"memberfont" !important;
font-size:20px;
font-style:normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-huiyuan:before { content: "\e604"; }
.icon-gonggaofuzhi:before { content: "\e606"; }
.icon-icon:before { content: "\e6ef"; }
.icon-vip:before { content: "\e60e"; }
.icon-huiyuan1:before { content: "\e60d"; }
.icon-huiyuan2:before { content: "\e605"; }
.icon-huiyuan3:before { content: "\e625"; }
.icon-huiyuan4:before { content: "\e66d"; }
.icon-huiyuan5:before { content: "\e64b"; }
.icon-huiyuan6:before { content: "\e62a"; }
.icon-haoyou-copy:before { content: "\e600"; }
.icon-huiyuan7:before { content: "\e612"; }
.icon-huiyuan8:before { content: "\e664"; }
.icon-my:before { content: "\e601"; }
.icon-huiyuan9:before { content: "\e637"; }
.icon-weibiaoti105:before { content: "\e694"; }
.icon-huiyuan10:before { content: "\e698"; }
.icon-huiyuan11:before { content: "\e602"; }
.icon-huiyuan12:before { content: "\e62b"; }
|
{
"pile_set_name": "Github"
}
|
{
"_from": "kind-of@^3.0.2",
"_id": "kind-of@3.2.2",
"_inBundle": false,
"_integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
"_location": "/randomatic/is-number/kind-of",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "kind-of@^3.0.2",
"name": "kind-of",
"escapedName": "kind-of",
"rawSpec": "^3.0.2",
"saveSpec": null,
"fetchSpec": "^3.0.2"
},
"_requiredBy": [
"/randomatic/is-number"
],
"_resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
"_shasum": "31ea21a734bab9bbb0f32466d893aea51e4a3c64",
"_spec": "kind-of@^3.0.2",
"_where": "/Users/toan/Tutorials/stream/api/node_modules/randomatic/node_modules/is-number",
"author": {
"name": "Jon Schlinkert",
"url": "https://github.com/jonschlinkert"
},
"bugs": {
"url": "https://github.com/jonschlinkert/kind-of/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "David Fox-Powell",
"url": "https://dtothefp.github.io/me"
},
{
"name": "Jon Schlinkert",
"url": "http://twitter.com/jonschlinkert"
},
{
"name": "Ken Sheedlo",
"url": "kensheedlo.com"
},
{
"name": "laggingreflex",
"url": "https://github.com/laggingreflex"
},
{
"name": "Miguel Mota",
"url": "https://miguelmota.com"
},
{
"name": "Peter deHaan",
"url": "http://about.me/peterdehaan"
}
],
"dependencies": {
"is-buffer": "^1.1.5"
},
"deprecated": false,
"description": "Get the native type of a value.",
"devDependencies": {
"ansi-bold": "^0.1.1",
"benchmarked": "^1.0.0",
"browserify": "^14.3.0",
"glob": "^7.1.1",
"gulp-format-md": "^0.1.12",
"mocha": "^3.3.0",
"type-of": "^2.0.1",
"typeof": "^1.0.0"
},
"engines": {
"node": ">=0.10.0"
},
"files": [
"index.js"
],
"homepage": "https://github.com/jonschlinkert/kind-of",
"keywords": [
"arguments",
"array",
"boolean",
"check",
"date",
"function",
"is",
"is-type",
"is-type-of",
"kind",
"kind-of",
"number",
"object",
"of",
"regexp",
"string",
"test",
"type",
"type-of",
"typeof",
"types"
],
"license": "MIT",
"main": "index.js",
"name": "kind-of",
"repository": {
"type": "git",
"url": "git+https://github.com/jonschlinkert/kind-of.git"
},
"scripts": {
"prepublish": "browserify -o browser.js -e index.js -s index --bare",
"test": "mocha"
},
"verb": {
"related": {
"list": [
"is-glob",
"is-number",
"is-primitive"
]
},
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"plugins": [
"gulp-format-md"
],
"lint": {
"reflinks": true
},
"reflinks": [
"verb"
]
},
"version": "3.2.2"
}
|
{
"pile_set_name": "Github"
}
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 by Bart Kiers (original author) and Alexandre Vitorelli (contributor -> ported to CSharp)
* Copyright (c) 2017 by Ivan Kochurkin (Positive Technologies):
added ECMAScript 6 support, cleared and transformed to the universal grammar.
* Copyright (c) 2018 by Juan Alvarez (contributor -> ported to Go)
* Copyright (c) 2019 by Student Main (contributor -> ES2020)
*
* 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.
*/
lexer grammar JavaScriptLexer;
channels { ERROR }
options { superClass=JavaScriptBaseLexer; }
HashBangLine: { p.IsStartOfFile()}? '#!' ~[\r\n\u2028\u2029]*; // only allowed at start
MultiLineComment: '/*' .*? '*/' -> channel(HIDDEN);
SingleLineComment: '//' ~[\r\n\u2028\u2029]* -> channel(HIDDEN);
RegularExpressionLiteral: '/' RegularExpressionFirstChar RegularExpressionChar* {p.IsRegexPossible()}? '/' IdentifierPart*;
OpenBracket: '[';
CloseBracket: ']';
OpenParen: '(';
CloseParen: ')';
OpenBrace: '{' {l.ProcessOpenBrace();};
CloseBrace: '}' {l.ProcessCloseBrace();};
SemiColon: ';';
Comma: ',';
Assign: '=';
QuestionMark: '?';
Colon: ':';
Ellipsis: '...';
Dot: '.';
PlusPlus: '++';
MinusMinus: '--';
Plus: '+';
Minus: '-';
BitNot: '~';
Not: '!';
Multiply: '*';
Divide: '/';
Modulus: '%';
Power: '**';
NullCoalesce: '??';
Hashtag: '#';
RightShiftArithmetic: '>>';
LeftShiftArithmetic: '<<';
RightShiftLogical: '>>>';
LessThan: '<';
MoreThan: '>';
LessThanEquals: '<=';
GreaterThanEquals: '>=';
Equals_: '==';
NotEquals: '!=';
IdentityEquals: '===';
IdentityNotEquals: '!==';
BitAnd: '&';
BitXOr: '^';
BitOr: '|';
And: '&&';
Or: '||';
MultiplyAssign: '*=';
DivideAssign: '/=';
ModulusAssign: '%=';
PlusAssign: '+=';
MinusAssign: '-=';
LeftShiftArithmeticAssign: '<<=';
RightShiftArithmeticAssign: '>>=';
RightShiftLogicalAssign: '>>>=';
BitAndAssign: '&=';
BitXorAssign: '^=';
BitOrAssign: '|=';
PowerAssign: '**=';
ARROW: '=>';
/// Null Literals
NullLiteral: 'null';
/// Boolean Literals
BooleanLiteral: 'true'
| 'false';
/// Numeric Literals
DecimalLiteral: DecimalIntegerLiteral '.' [0-9] [0-9_]* ExponentPart?
| '.' [0-9] [0-9_]* ExponentPart?
| DecimalIntegerLiteral ExponentPart?
;
/// Numeric Literals
HexIntegerLiteral: '0' [xX] [0-9a-fA-F] HexDigit*;
OctalIntegerLiteral: '0' [0-7]+ {!p.IsStrictMode()}?;
OctalIntegerLiteral2: '0' [oO] [0-7] [_0-7]*;
BinaryIntegerLiteral: '0' [bB] [01] [_01]*;
BigHexIntegerLiteral: '0' [xX] [0-9a-fA-F] HexDigit* 'n';
BigOctalIntegerLiteral: '0' [oO] [0-7] [_0-7]* 'n';
BigBinaryIntegerLiteral: '0' [bB] [01] [_01]* 'n';
BigDecimalIntegerLiteral: DecimalIntegerLiteral 'n';
/// Keywords
Break: 'break';
Do: 'do';
Instanceof: 'instanceof';
Typeof: 'typeof';
Case: 'case';
Else: 'else';
New: 'new';
Var: 'var';
Catch: 'catch';
Finally: 'finally';
Return: 'return';
Void: 'void';
Continue: 'continue';
For: 'for';
Switch: 'switch';
While: 'while';
Debugger: 'debugger';
Function: 'function';
This: 'this';
With: 'with';
Default: 'default';
If: 'if';
Throw: 'throw';
Delete: 'delete';
In: 'in';
Try: 'try';
As: 'as';
From: 'from';
/// Future Reserved Words
Class: 'class';
Enum: 'enum';
Extends: 'extends';
Super: 'super';
Const: 'const';
Export: 'export';
Import: 'import';
Async: 'async';
Await: 'await';
/// The following tokens are also considered to be FutureReservedWords
/// when parsing strict mode
Implements: 'implements' {p.IsStrictMode()}?;
Let: 'let' {p.IsStrictMode()}?;
Private: 'private' {p.IsStrictMode()}?;
Public: 'public' {p.IsStrictMode()}?;
Interface: 'interface' {p.IsStrictMode()}?;
Package: 'package' {p.IsStrictMode()}?;
Protected: 'protected' {p.IsStrictMode()}?;
Static: 'static' {p.IsStrictMode()}?;
Yield: 'yield' {p.IsStrictMode()}?;
/// Identifier Names and Identifiers
Identifier: IdentifierStart IdentifierPart*;
/// String Literals
StringLiteral: ('"' DoubleStringCharacter* '"'
| '\'' SingleStringCharacter* '\'') {l.ProcessStringLiteral();}
;
// TODO: `${`tmp`}`
TemplateStringLiteral: '`' ('\\`' | ~'`')* '`';
WhiteSpaces: [\t\u000B\u000C\u0020\u00A0]+ -> channel(HIDDEN);
LineTerminator: [\r\n\u2028\u2029] -> channel(HIDDEN);
/// Comments
HtmlComment: '<!--' .*? '-->' -> channel(HIDDEN);
CDataComment: '<![CDATA[' .*? ']]>' -> channel(HIDDEN);
UnexpectedCharacter: . -> channel(ERROR);
// Fragment rules
fragment DoubleStringCharacter
: ~["\\\r\n]
| '\\' E
|
{
"pile_set_name": "Github"
}
|
#pragma once
#include <switch.h>
#include <string>
#include <vector>
class Language
{
public:
enum class Type : u8
{
None,
en,
cs,
da,
de,
el,
es,
es_CO,
es_AR,
es_CL,
es_PE,
es_MX,
es_US,
fi,
fr,
fr_CA,
fr_BE,
hu,
it,
ja,
ko,
nl,
no,
pl,
pt,
pt_BR,
sv,
ru,
zh,
vi,
tr,
hi,
he,
id,
tl,
ar,
fa,
uk,
hr
};
Language() : m_type(Type::en)
{
}
Language(const Language& c)
{
m_type = c.m_type;
}
Language(const Type type)
{
m_type = type;
}
static std::vector<std::string>& list() {
static std::vector<std::string> r;
r.resize(0);
for (int i = (int)Type::en; i <= (int)Type::zh; i++) {
r.push_back(lookup(i));
}
return r;
}
Language(const std::string& s)
{
if (s == "en") { m_type = Type::en; }
else if (s == "de") { m_type = Type::de; }
else if (s == "es") { m_type = Type::es; }
else if (s == "fr") { m_type = Type::fr; }
else if (s == "it") { m_type = Type::it; }
else if (s == "ja") { m_type = Type::ja; }
else if (s == "ko") { m_type = Type::ko; }
else if (s == "nl") { m_type = Type::nl; }
else if (s == "pt") { m_type = Type::pt; }
else if (s == "ru") { m_type = Type::ru; }
else if (s == "zh") { m_type = Type::zh; }
else if (s == "sv") { m_type = Type::sv; }
else if (s == "pl") { m_type = Type::pl; }
else if (s == "no") { m_type = Type::no; }
else if (s == "hu") { m_type = Type::hu; }
else if (s == "fi") { m_type = Type::fi; }
else if (s == "el") { m_type = Type::el; }
else if (s == "da") { m_type = Type::da; }
else if (s == "cs") { m_type = Type::cs; }
else if (s == "es-CO") { m_type = Type::es_CO; }
else if (s == "es-AR") { m_type = Type::es_AR; }
else if (s == "es-CL") { m_type = Type::es_CL; }
else if (s == "es-PE") { m_type = Type::es_PE; }
else if (s == "es-MX") { m_type = Type::es_MX; }
else if (s == "es-US") { m_type = Type::es_US; }
else if (s == "fr-CA") { m_type = Type::fr_CA; }
else if (s == "fr-BE") { m_type = Type::fr_BE; }
else if (s == "pt-BR") { m_type = Type::pt_BR; }
else if (s == "vi") { m_type = Type::vi; }
else if (s == "tr") { m_type = Type::tr; }
else if (s == "hi") { m_type = Type::hi; }
else if (s == "he") { m_type = Type::he; }
else if (s == "id") { m_type = Type::id; }
else if (s == "tl") { m_type = Type::tl; }
else if (s == "ar") { m_type = Type::ar; }
else if (s == "fa") { m_type = Type::fa; }
else if (s == "uk") { m_type = Type::uk; }
else if (s == "hr") { m_type = Type::hr; }
else m_type = Type::None;
}
operator u8() const { return (u8)m_type; }
const char* c_str() const {
return lookup((int)m_type);
}
static const char* lookup(int i) {
switch (i)
{
case (int)Type::en: return "en";
case (int)Type::de: return "de";
case (int)Type::es: return "es";
case (int)Type::fr: return "fr";
case (int)Type::it: return "it";
case (int)Type::ja: return "ja";
case (int)Type::ko: return "ko";
case (int)Type::nl: return "nl";
case (int)Type::pt: return "pt";
case (int)Type::ru: return "ru";
case (int)Type::zh: return "zh";
case (int)Type::sv: return "sv";
case (int)Type::pl: return "pl";
case (int)Type::no: return "no";
case (int)Type::hu: return "hu";
case (int)Type::fi: return "fi";
case (int)Type::el: return "el";
case (int)Type::da: return "da";
case (int)Type::cs: return "cs";
case (int)Type::es_CO: return "es-CO";
case (int)Type::es_AR: return "es-AR";
case (int)Type::es_CL: return "es-CL";
case (int)Type::es_PE: return "es-PE";
case (int)Type::es_MX: return "es-MX";
case (int)Type::es_US: return "es-US";
case (int)Type::fr_CA: return "fr-CA";
case (int)Type::fr_BE: return "fr-BE";
case (int)Type::pt_BR: return "pt-BR";
case (int)Type::vi: return "vi";
case (int)Type::tr: return "tr";
case (int)Type::hi: return "hi";
case (int)Type::he: return "he";
case (int)Type::id: return "id";
case (int)Type::tl: return "tl";
case (int)Type::ar: return "ar";
case (int)Type::fa: return "fa";
case (int)Type::uk: return "uk";
case (int)Type::hr: return "hr";
}
return "";
}
std::string str() {
return std::string(c_str());
}
protected:
Type m_type;
};
#include "translate_defs.h"
const char* translate(const Translate& key);
void setCurrentLanguage(const Language& languageId);
|
{
"pile_set_name": "Github"
}
|
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture *
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 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 Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: contact@sofa-framework.org *
******************************************************************************/
#ifndef SOFA_COMPONENT_COLLISION_RIGIDCONTACTMAPPER_H
#define SOFA_COMPONENT_COLLISION_RIGIDCONTACTMAPPER_H
#include "config.h"
#include <sofa/helper/Factory.h>
#include <SofaBaseMechanics/BarycentricMapping.h>
#include <SofaBaseMechanics/IdentityMapping.h>
#include <SofaRigid/RigidMapping.h>
#include <SofaBaseMechanics/SubsetMapping.h>
#include <SofaBaseMechanics/MechanicalObject.h>
#include <sofa/simulation/Node.h>
#include <sofa/simulation/Simulation.h>
#include <SofaBaseCollision/BaseContactMapper.h>
#include <SofaBaseCollision/SphereModel.h>
#include <SofaMeshCollision/TriangleModel.h>
#include <SofaMeshCollision/LineModel.h>
#include <SofaMeshCollision/PointModel.h>
#include <SofaBaseCollision/OBBModel.h>
#include <SofaBaseCollision/RigidCapsuleModel.h>
#include <SofaBaseCollision/CylinderModel.h>
#include <SofaBaseMechanics/IdentityMapping.h>
#include <sofa/core/VecId.h>
#include <iostream>
namespace sofa
{
namespace component
{
namespace collision
{
/// Base class for all mappers using RigidMapping
template < class TCollisionModel, class DataTypes >
class RigidContactMapper : public BaseContactMapper<DataTypes>
{
public:
typedef typename DataTypes::Real Real;
typedef typename DataTypes::Coord Coord;
typedef typename DataTypes::VecCoord VecCoord;
typedef typename DataTypes::VecDeriv VecDeriv;
typedef TCollisionModel MCollisionModel;
typedef typename MCollisionModel::InDataTypes InDataTypes;
typedef core::behavior::MechanicalState<InDataTypes> InMechanicalState;
typedef core::behavior::MechanicalState<typename RigidContactMapper::DataTypes> MMechanicalState;
typedef component::container::MechanicalObject<typename RigidContactMapper::DataTypes> MMechanicalObject;
typedef mapping::RigidMapping< InDataTypes, typename RigidContactMapper::DataTypes > MMapping;
using index_type = sofa::defaulttype::index_type;
MCollisionModel* model;
simulation::Node::SPtr child;
typename MMapping::SPtr mapping;
typename MMechanicalState::SPtr outmodel;
int nbp;
protected:
RigidContactMapper();
public:
void setCollisionModel(MCollisionModel* model)
{
this->model = model;
}
void cleanup();
MMechanicalState* createMapping(const char* name="contactPoints");
void resize(std::size_t size)
{
if (mapping != nullptr)
mapping->clear(size);
if (outmodel != nullptr)
outmodel->resize(size);
nbp = 0;
}
index_type addPoint(const Coord& P, index_type index, Real&)
{
int i = nbp++;
if ((int)outmodel->getSize() <= i)
outmodel->resize(i+1);
if (mapping)
{
i = mapping->addPoint(P,index);
}
else
{
helper::WriteAccessor<Data<VecCoord> > xData = *outmodel->write(core::VecCoordId::position());
xData.wref()[i] = P;
}
return i;
}
void update()
{
if (mapping != nullptr)
{
core::BaseMapping* map = mapping.get();
map->apply(core::MechanicalParams::defaultInstance(), core::VecCoordId::position(), core::ConstVecCoordId::position());
map->applyJ(core::MechanicalParams::defaultInstance(), core::VecDerivId::velocity(), core::ConstVecDerivId::velocity());
}
}
void updateXfree()
{
if (mapping != nullptr)
{
core::BaseMapping* map = mapping.get();
map->apply(core::MechanicalParams::defaultInstance(), core::VecCoordId::freePosition(), core::ConstVecCoordId::freePosition());
map->applyJ(core::MechanicalParams::defaultInstance(), core::VecDerivId::freeVelocity(), core::ConstVecDerivId::freeVelocity());
}
}
};
template <class TVec3Types>
class ContactMapper<RigidSphereModel,TVec3Types > : public RigidContactMapper<RigidSphereModel, TVec3Types >{
public:
sofa::defaulttype::index_type addPoint(const typename TVec3Types::Coord & P, sofa::defaulttype::index_type index,typename TVec3Types::Real & r)
{
RigidSphere e(this->model, index);
const typename SphereCollisionModel<sofa::defaulttype::Rigid3Types>::DataTypes::Coord & rCenter = e.rigidCenter();
const typename TVec3Types::Coord & cP = P - rCenter.getCenter();
const defaulttype::Quaternion & ori = rCenter.getOrientation();
//r = e.r();
return RigidContactMapper<RigidSphereModel,TVec3Types >::addPoint(ori.inverseRotate(cP),index,r);
}
};
template <class TVec3Types>
class ContactMapper<OBBCollisionModel<sofa::defaulttype::Rigid3Types>,TVec3Types > : public RigidContactMapper<OBBCollisionModel<sofa::defaulttype::Rigid3Types>, TVec3Types >{
public:
sofa::defaulttype::index_type addPoint(const typename TVec3Types::Coord & P, sofa::defaulttype::index_type index,typename TVec3Types::Real & r)
{
const typename TVec3Types::Coord & cP = P - this->model->center(index);
const defaulttype::Quaternion & ori = this->model->orientation(index);
return RigidContactMapper<OBBCollisionModel<sofa::defaulttype::Rigid3Types>,TVec3Types >::addPoint(ori.inverseRotate(cP),index,r);
}
};
template <class TVec3Types>
class ContactMapper<CapsuleCollisionModel<sofa::defaulttype::Rigid3Types>,TVec3Types > : public RigidContactMapper<CapsuleCollisionModel<sofa::defaulttype::Rigid3Types>, TVec3Types >{
public:
sofa::defaulttype::index_type addPoint(const typename TVec3Types::Coord & P, sofa::defaulttype::index_type index,typename TVec3Types::Real & r)
{
const typename TVec3Types::Coord & cP = P - this->model->center(index);
const defaulttype::
|
{
"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/. */
%include ../shared.inc
%include ../../../shared/in-content/common.inc.css
xul|tabs {
padding-right: 0;
padding-left: 0;
}
xul|tab[selected] {
text-shadow: none;
}
xul|button,
xul|colorpicker[type="button"],
xul|menulist {
margin-top: 3px;
}
xul|menulist:not([editable="true"]) > xul|menupopup > xul|menuitem[checked="true"]::before,
xul|menulist:not([editable="true"]) > xul|menupopup > xul|menuitem[selected="true"]::before {
display: none;
}
xul|menulist:not([editable="true"]) > xul|*.menulist-dropmarker {
display: -moz-box;
margin-top: 1px;
margin-bottom: 1px;
}
xul|menulist > xul|menupopup xul|menu,
xul|menulist > xul|menupopup xul|menuitem,
xul|button[type="menu"] > xul|menupopup xul|menu,
xul|button[type="menu"] > xul|menupopup xul|menuitem {
-moz-padding-end: 34px;
}
xul|*.help-button > xul|*.button-box > xul|*.button-icon {
-moz-margin-start: 0;
}
xul|*.checkbox-icon {
margin-right: 0;
}
xul|*.radio-icon {
-moz-margin-end: 0;
}
xul|*.numberbox-input-box {
-moz-appearance: none;
border-width: 0;
}
xul|description {
font-size: 1.25rem;
line-height: 22px;
}
html|a:-moz-focusring,
xul|*.text-link:-moz-focusring,
xul|*.inline-link:-moz-focusring {
outline-width: 0;
box-shadow: @focusRingShadow@;
}
|
{
"pile_set_name": "Github"
}
|
import React from 'react'
import { Grid, Image } from 'semantic-ui-react'
const GridExampleRelaxedVery = () => (
<Grid relaxed='very' columns={4}>
<Grid.Column>
<Image src='/images/wireframe/image.png' />
</Grid.Column>
<Grid.Column>
<Image src='/images/wireframe/image.png' />
</Grid.Column>
<Grid.Column>
<Image src='/images/wireframe/image.png' />
</Grid.Column>
<Grid.Column>
<Image src='/images/wireframe/image.png' />
</Grid.Column>
</Grid>
)
export default GridExampleRelaxedVery
|
{
"pile_set_name": "Github"
}
|
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Perform A/B Test using REST Endpoints"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"You can test and deploy new models behind a single SageMaker Endpoint with a concept called “production variants.” These variants can differ by hardware (CPU/GPU), by data (comedy/drama movies), or by region (US West or Germany North). You can shift traffic between the models in your endpoint for canary rollouts and blue/green deployments. You can split traffic for A/B tests. And you can configure your endpoint to automatically scale your endpoints out or in based on a given metric like requests per second. As more requests come in, SageMaker will automatically scale the model prediction API to meet the demand."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"img/model_ab.png\" width=\"80%\" align=\"left\">"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can use traffic splitting to direct subsets of users to different model variants for the purpose of comparing and testing different models in live production. The goal is to see which variants perform better. Often, these tests need to run for a long period of time (weeks) to be statistically significant. The figure shows 2 different recommendation models deployed using a random 50-50 traffic split between the 2 variants."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import boto3\n",
"import sagemaker\n",
"import pandas as pd\n",
"\n",
"sess = sagemaker.Session()\n",
"bucket = sess.default_bucket()\n",
"role = sagemaker.get_execution_role()\n",
"region = boto3.Session().region_name\n",
"\n",
"sm = boto3.Session().client(service_name='sagemaker', region_name=region)\n",
"cw = boto3.Session().client(service_name='cloudwatch', region_name=region)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Clean Up Previous Endpoints to Save Resources"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%store -r autopilot_endpoint_name"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"try: \n",
" autopilot_endpoint_name\n",
" sm.delete_endpoint(\n",
" EndpointName=autopilot_endpoint_name\n",
" )\n",
" print('Autopilot Endpoint has been deleted to save resources. This is good.') \n",
"except:\n",
" print('Endpoints are cleaned up. This is good. Keep moving forward!')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%store -r training_job_name"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(training_job_name)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Copy the Model to the Notebook"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"scrolled": true
},
"outputs": [],
"source": [
"!aws s3 cp s3://$bucket/$training_job_name/output/model.tar.gz ./model.tar.gz"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!mkdir -p ./model/\n",
"!tar -xvzf ./model.tar.gz -C ./model/"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Show the Prediction Signature"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!saved_model_cli show --all --dir ./model/tensorflow/saved_model/0/"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Show `inference.py`"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pygmentize ./model/code/inference.py"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Create Variant A Model From the Training Job in a Previous Section\n",
"\n",
"Notes:\n",
"* `primary_container_image` is required because the inference and training images are different.\n",
"* By default, the training image will be used, so we need to override it. \n",
"* See https://github.com/aws/sagemaker-python-sdk/issues/1379\n",
"* If you are not using a US-based region, you may need to adapt the container image to your current region using the following table:\n",
"\n",
"https://docs.aws.amazon.com/deep-learning-containers/latest/devguide/deep-learning-containers-images.html"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import time\n",
"timestamp = '{}'.format(int(time.time()))\n",
"\n",
"model_a_name = '{}-{}-{}'.format(training_job_name, 'varianta', timestamp)\n",
"\n",
"sess.create_model_from_job(name=model_a_name,\n",
" training_job_name=training_job_name,\n",
" role=role,\n",
" image_uri='763104351884.dkr.ecr.{}.amazonaws.com/tensorflow-inference:2.3.0-cpu-py37-ubuntu18.04'.format(region))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Create Variant B Model From the Training Job in a Previous Section\n",
"Notes:\n",
"* `primary_container_image` is required because the inference and training images are different.\n",
"* By default, the training image will be used, so we need to override it. See https://github.com/aws/sagemaker-python-sdk/issues/1379\n",
"* If you are not using a US-based region, you may need to adapt the container image to your current region using the following table:\n",
"\n",
"https://docs.aws.amazon.com/deep-learning-containers/latest/devguide/deep-learning-containers-images.html"
]
},
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="cn.crap.dao.mybatis.ErrorDao" >
<resultMap id="BaseResultMap" type="cn.crap.model.Error" >
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="errorCode" property="errorCode" jdbcType="VARCHAR" />
<result column="errorMsg" property="errorMsg" jdbcType="VARCHAR" />
<result column="projectId" property="projectId" jdbcType="VARCHAR" />
<result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
<result column="status" property="status" jdbcType="TINYINT" />
<result column="sequence" property="sequence" jdbcType="INTEGER" />
</resultMap>
<sql id="Example_Where_Clause" >
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
id, errorCode, errorMsg, projectId, createTime, status, sequence
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="cn.crap.model.ErrorCriteria" >
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from error
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
<choose >
<when test="limitStart != null and limitStart != -1 and maxResults != null and maxResults != -1" >
limit ${limitStart} , ${maxResults}
</when>
<when test="limitStart != null and limitStart != -1" >
limit ${limitStart}
</when>
</choose>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from error
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from error
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="cn.crap.model.ErrorCriteria" >
delete from error
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="cn.crap.model.Error" >
insert into error (id, errorCode, errorMsg,
projectId, createTime, status,
sequence)
values (#{id,jdbcType=VARCHAR}, #{errorCode,jdbcType=VARCHAR}, #{errorMsg,jdbcType=VARCHAR},
#{projectId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{status,jdbcType=TINYINT},
#{sequence,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="cn.crap.model.Error" >
insert into error
<trim prefix="(" suffix=")" suffixOverrides="," >
id,
<if test="errorCode != null" >
errorCode,
</if>
<if test="errorMsg != null" >
errorMsg,
</if>
<if test="projectId != null" >
projectId,
</if>
<if test="createTime != null" >
createTime,
</if>
<if test="status != null" >
status,
</if>
<if test="sequence != null" >
sequence,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
#{id,jdbcType=VARCHAR},
<if test="errorCode != null" >
#{errorCode,jdbcType=VARCHAR},
</if>
<if test="errorMsg != null" >
#{errorMsg,jdbcType=VARCHAR},
</if>
<if test="projectId != null" >
#{projectId,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="status != null" >
#{status,jdbcType=TINYINT},
</if>
<if test="sequence != null" >
#{sequence,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="cn.crap.model.ErrorCriteria" resultType="java.lang.Integer" >
select count(*) from error
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
update error
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=VARCHAR},
</if>
<if test="record.errorCode != null" >
errorCode = #{record.errorCode,jdbcType=VARCHAR},
</if>
<if test="record.errorMsg != null" >
errorMsg = #{record.errorMsg,jdbcType=VARCHAR},
</if>
|
{
"pile_set_name": "Github"
}
|
[Scheme]
Name=Whimsy
ColorForeground=#b3b0d6
ColorBackground=#29283b
ColorCursor=#b3b0d6
ColorPalette=#535178;#ef6487;#5eca89;#fdd877;#65aef7;#aa7ff0;#43c1be;#ffffff;#535178;#ef6487;#5eca89;#fdd877;#65aef7;#aa7ff0;#43c1be;#ffffff
|
{
"pile_set_name": "Github"
}
|
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include "../source/codegen_source_base.h"
namespace tvm {
namespace runtime {
Module HexagonModuleCreate(std::string data, std::string fmt,
std::unordered_map<std::string, FunctionInfo> fmap, std::string asm_str,
std::string obj_str, std::string ir_str, std::string bc_str,
const std::set<std::string>& packed_c_abi) {
LOG(WARNING) << "Hexagon runtime is not enabled, return a source module...";
return codegen::DeviceSourceModuleCreate(data, fmt, fmap, "hex");
}
} // namespace runtime
} // namespace tvm
|
{
"pile_set_name": "Github"
}
|
K 13
svn:eol-style
V 6
native
END
|
{
"pile_set_name": "Github"
}
|
/**
* Converts `iterator` to an array.
*
* @private
* @param {Object} iterator The iterator to convert.
* @returns {Array} Returns the converted array.
*/
function iteratorToArray(iterator) {
var data,
result = [];
while (!(data = iterator.next()).done) {
result.push(data.value);
}
return result;
}
module.exports = iteratorToArray;
|
{
"pile_set_name": "Github"
}
|
package me.corriekay.pokegoutil.data.managers;
import java.lang.reflect.Field;
import java.nio.charset.Charset;
import me.corriekay.pokegoutil.gui.controller.LogController;
import me.corriekay.pokegoutil.utils.logging.ConsolePrintStream;
/**
* Global controller to access all settings controllers.
*/
public final class GlobalSettingsController {
private static GlobalSettingsController instance;
private LogController logController;
/**
* Instantiate a GlobalSettingsController.
*/
private GlobalSettingsController() {
consoleSetup();
}
/**
* Setup the GlobalSettingController if it has not been initialized.
*/
public static void setup() {
if (instance == null) {
instance = new GlobalSettingsController();
}
}
/**
* Get instance of GlobalSettingController.
*
* @return instance of GlobalSettingController
*/
public static GlobalSettingsController getGlobalSettingsController() {
if (instance == null) {
setup();
}
return instance;
}
/**
* Setup of console.
*/
private void consoleSetup() {
logController = new LogController();
ConsolePrintStream.setup(logController);
}
/**
* Get the log controller instance.
*
* @return log controller instance
*/
public LogController getLogController() {
return logController;
}
}
|
{
"pile_set_name": "Github"
}
|
#
# (C) Copyright 2000-2006
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
#
# SPDX-License-Identifier: GPL-2.0+
#
obj-y := conxs.o eeprom.o
|
{
"pile_set_name": "Github"
}
|
/* Tajiki (UTF-8) initialisation for the jQuery UI date picker plugin. */
/* Written by Abdurahmon Saidov (saidovab@gmail.com). */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "../datepicker" ], factory );
} else {
// Browser globals
factory( jQuery.datepicker );
}
}(function( datepicker ) {
datepicker.regional['tj'] = {
closeText: 'Идома',
prevText: '<Қафо',
nextText: 'Пеш>',
currentText: 'Имрӯз',
monthNames: ['Январ','Феврал','Март','Апрел','Май','Июн',
'Июл','Август','Сентябр','Октябр','Ноябр','Декабр'],
monthNamesShort: ['Янв','Фев','Мар','Апр','Май','Июн',
'Июл','Авг','Сен','Окт','Ноя','Дек'],
dayNames: ['якшанбе','душанбе','сешанбе','чоршанбе','панҷшанбе','ҷумъа','шанбе'],
dayNamesShort: ['якш','душ','сеш','чор','пан','ҷум','шан'],
dayNamesMin: ['Як','Дш','Сш','Чш','Пш','Ҷм','Шн'],
weekHeader: 'Хф',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
datepicker.setDefaults(datepicker.regional['tj']);
return datepicker.regional['tj'];
}));
|
{
"pile_set_name": "Github"
}
|
# About Application.cr File
#
# This is Amber application main entry point. This file is responsible for loading
# initializers, classes, and all application related code in order to have
# Amber::Server boot up.
#
# > We recommend not modifying the order of the requires since the order will
# affect the behavior of the application.
require "amber"
require "./settings"
require "./logger"
require "./i18n"
require "./database"
require "./initializers/**"
# Start Generator Dependencies: Don't modify.
# End Generator Dependencies
require "../src/controllers/application_controller"
require "../src/controllers/**"
require "./routes"
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
Name="Tuple"
Version="8.00"
ProjectType="Visual C++"
ProjectGUID="{F143DA5A-221A-3737-BCBA-F5BFD977038F}"
RootNamespace="Tuple"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<ToolFiles/>
<Configurations>
<Configuration
Name="debug_shared|Win32"
OutputDirectory="obj\$(ConfigurationName)"
IntermediateDirectory="obj\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Data\include;..\..\..\Data\SQLite\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;"
StringPooling="true"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="true"
TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings=""
AdditionalOptions=""/>
<Tool
Name="VCManagedResourceCompilerTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="iphlpapi.lib"
OutputFile="bin\Tupled.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="bin\Tupled.pdb"
SubSystem="1"
TargetMachine="1"
AdditionalOptions=""/>
<Tool
Name="VCALinkTool"/>
<Tool
Name="VCManifestTool"/>
<Tool
Name="VCXDCMakeTool"/>
<Tool
Name="VCBscMakeTool"/>
<Tool
Name="VCFxCopTool"/>
<Tool
Name="VCAppVerifierTool"/>
<Tool
Name="VCPostBuildEventTool"/>
</Configuration>
<Configuration
Name="release_shared|Win32"
OutputDirectory="obj\$(ConfigurationName)"
IntermediateDirectory="obj\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCCLCompilerTool"
Optimization="4"
InlineFunctionExpansion="1"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Data\include;..\..\..\Data\SQLite\include"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;WINVER=0x0500;"
StringPooling="true"
RuntimeLibrary="2"
BufferSecurityCheck="false"
TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
CompileAs="0"
DisableSpecificWarnings=""
AdditionalOptions=""/>
<Tool
Name="VCManagedResourceCompilerTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="iphlpapi.lib"
OutputFile="bin\Tuple.exe"
LinkIncremental="1"
AdditionalLibraryDirectories="..\..\..\lib"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
TargetMachine="1"
AdditionalOptions=""/>
<Tool
Name="VCALinkTool"/>
<Tool
Name="VCManifestTool"/>
<Tool
Name="VCXDCMakeTool"/>
<Tool
Name="VCBscMakeTool"/>
<Tool
Name="VCFxCopTool"/>
<Tool
Name="VCAppVerifierTool"/>
<Tool
Name="VCPostBuildEventTool"/>
</Configuration>
<Configuration
Name="debug_static_mt|Win32"
OutputDirectory="obj\$(ConfigurationName)"
IntermediateDirectory="obj\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCCLCompilerTool"
Optimization="4"
AdditionalIncludeDirectories=".\include;..\..\..\Foundation\include;..\..\..\XML\include;..\..\..\Util\include;..\..\..\Data\include;..\..\..\Data\SQLite\include"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;WINVER=0x0500;POCO_STATIC;"
StringPooling="true"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="true"
TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings=""
AdditionalOptions=""/>
<Tool
Name="VCManagedResourceCompilerTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="iphlpapi.lib winmm.lib iphlpapi.lib"
OutputFile="bin\static_mt\Tupled.exe"
LinkIncremental="2"
AdditionalLibraryDirectories="..\..\..\lib"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="bin\static_mt\Tupled.pdb"
SubSystem="1"
TargetMachine="1"
AdditionalOptions=""/>
<Tool
Name="VCALinkTool"/>
<Tool
Name="VCManifestTool"/>
<Tool
Name="VCXDCMakeTool"/>
<Tool
Name="VCBscMakeTool"/>
<Tool
Name="VCFxCopTool"/>
<Tool
Name="VCAppVerifierTool"/>
<Tool
Name="VCPostBuildEventTool"/>
</Configuration>
<Configuration
Name="release_static_mt|Win32"
OutputDirectory="obj\$(ConfigurationName)"
IntermediateDirectory="obj\$(ConfigurationName)"
ConfigurationType="1"
CharacterSet="2">
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCXML
|
{
"pile_set_name": "Github"
}
|
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2013. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/container for documentation.
//
//////////////////////////////////////////////////////////////////////////////
#ifndef BOOST_CONTAINER_DETAIL_UTILITIES_HPP
#define BOOST_CONTAINER_DETAIL_UTILITIES_HPP
#ifndef BOOST_CONFIG_HPP
# include <boost/config.hpp>
#endif
#if defined(BOOST_HAS_PRAGMA_ONCE)
# pragma once
#endif
// container
#include <boost/container/allocator_traits.hpp>
// container/detail
#include <boost/container/detail/iterator.hpp>
#include <boost/container/detail/iterator_to_raw_pointer.hpp>
#include <boost/container/detail/mpl.hpp>
#include <boost/container/detail/type_traits.hpp>
// move
#include <boost/move/adl_move_swap.hpp>
#include <boost/move/iterator.hpp>
#include <boost/move/utility_core.hpp>
// other
#include <boost/core/no_exceptions_support.hpp>
// std
#include <cstring> //for emmove/memcpy
namespace boost {
namespace container {
namespace container_detail {
template<class I>
struct are_elements_contiguous
{
static const bool value = false;
};
/////////////////////////
// raw pointers
/////////////////////////
template<class T>
struct are_elements_contiguous<T*>
{
static const bool value = true;
};
/////////////////////////
// move iterators
/////////////////////////
template<class It>
struct are_elements_contiguous< ::boost::move_iterator<It> >
: are_elements_contiguous<It>
{};
/////////////////////////
// predeclarations
/////////////////////////
#ifndef BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER
template<class Pointer>
class vector_iterator;
template<class Pointer>
class vector_const_iterator;
#endif //BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER
} //namespace container_detail {
} //namespace container {
namespace interprocess {
template <class PointedType, class DifferenceType, class OffsetType, std::size_t OffsetAlignment>
class offset_ptr;
} //namespace interprocess {
namespace container {
namespace container_detail {
/////////////////////////
//vector_[const_]iterator
/////////////////////////
#ifndef BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER
template<class Pointer>
struct are_elements_contiguous<boost::container::container_detail::vector_iterator<Pointer> >
{
static const bool value = true;
};
template<class Pointer>
struct are_elements_contiguous<boost::container::container_detail::vector_const_iterator<Pointer> >
{
static const bool value = true;
};
#endif //BOOST_CONTAINER_VECTOR_ITERATOR_IS_POINTER
/////////////////////////
// offset_ptr
/////////////////////////
template <class PointedType, class DifferenceType, class OffsetType, std::size_t OffsetAlignment>
struct are_elements_contiguous< ::boost::interprocess::offset_ptr<PointedType, DifferenceType, OffsetType, OffsetAlignment> >
{
static const bool value = true;
};
template <typename I, typename O>
struct are_contiguous_and_same
: boost::move_detail::and_
< are_elements_contiguous<I>
, are_elements_contiguous<O>
, is_same< typename remove_const< typename ::boost::container::iterator_traits<I>::value_type >::type
, typename ::boost::container::iterator_traits<O>::value_type
>
>
{};
template <typename I, typename O>
struct is_memtransfer_copy_assignable
: boost::move_detail::and_
< are_contiguous_and_same<I, O>
, container_detail::is_trivially_copy_assignable< typename ::boost::container::iterator_traits<I>::value_type >
>
{};
template <typename I, typename O>
struct is_memtransfer_copy_constructible
: boost::move_detail::and_
< are_contiguous_and_same<I, O>
, container_detail::is_trivially_copy_constructible< typename ::boost::container::iterator_traits<I>::value_type >
>
{};
template <typename I, typename O, typename R>
struct enable_if_memtransfer_copy_constructible
: enable_if<container_detail::is_memtransfer_copy_constructible<I, O>, R>
{};
template <typename I, typename O, typename R>
struct disable_if_memtransfer_copy_constructible
: disable_if<container_detail::is_memtransfer_copy_constructible<I, O>, R>
{};
template <typename I, typename O, typename R>
struct enable_if_memtransfer_copy_assignable
: enable_if<container_detail::is_memtransfer_copy_assignable<I, O>, R>
{};
template <typename I, typename O, typename R>
struct disable_if_memtransfer_copy_assignable
: disable_if<container_detail::is_memtransfer_copy_assignable<I, O>, R>
{};
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
inline F memmove(I f, I l, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
typedef typename boost::container::iterator_traits<I>::value_type value_type;
typename boost::container::iterator_traits<I>::difference_type n = boost::container::iterator_distance(f, l);
if(n){
std::memmove((iterator_to_raw_pointer)(r), (iterator_to_raw_pointer)(f), sizeof(value_type)*n);
boost::container::iterator_advance(r, n);
}
return r;
}
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
F memmove_n(I f, typename boost::container::iterator_traits<I>::difference_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
typedef typename boost::container::iterator_traits<I>::value_type value_type;
if(n){
std::memmove((iterator_to_raw_pointer)(r), (iterator_to_raw_pointer)(f), sizeof(value_type)*n);
boost::container::iterator_advance(r, n);
}
return r;
}
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
I memmove_n_source(I f, typename boost::container::iterator_traits<I>::difference_type n, F r) BOOST_NOEXCEPT_OR_NOTHROW
{
if(n){
typedef typename boost::container::iterator_traits<I>::value_type value_type;
std::memmove((iterator_to_raw_pointer)(r), (iterator_to_raw_pointer)(f), sizeof(value_type)*n);
boost::container::iterator_advance(f, n);
}
return f;
}
template
<typename I, // I models InputIterator
typename F> // F models ForwardIterator
I memmove_n_source_dest(I f, typename boost::container::iterator_traits<I>::difference_type n, F &r) BOOST_NOEXCEPT_OR_NOTHROW
{
typedef typename boost::
|
{
"pile_set_name": "Github"
}
|
package com.mph.retrofitutils.http;
import com.mph.retrofitutils.RetrofitService;
import retrofit2.Call;
/**
* 文件上传基类
* Created by:hcs on 2016/10/20 11:29
* e_mail:aaron1539@163.com
*/
public abstract class BaseFileUpload {
public abstract Call getFileUploadCall(RetrofitService retrofitService);
}
|
{
"pile_set_name": "Github"
}
|
{% extends "reports/standard/partials/filter_panel.html" %}
{% load hq_shared_tags %}
{% load i18n %}
{% block report_filter_actions %}
<div id="savedReports"
class="{{ report_filter_form_action_css_class }}">
<button id="apply-filters" type="submit" class="filters btn disabled"
disabled="disabled"
data-loading-text="{% trans 'Generating Report...' %}"
data-standard-text="{% trans 'Apply' %}">
{% trans 'Apply' %}
</button>
{% if not report.is_admin %}
<div class="btn-group">
<button type="button" class="btn dropdown-toggle btn-default" data-toggle="dropdown">
{% trans 'Favorites' %} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li data-bind="ifnot: reportConfigs().length">
<a href="#">{% trans "You don't have any favorites" %}</a>
</li>
<!-- ko foreach: reportConfigs -->
<li>
<a href="#" tabindex="-1"
data-bind="text: name, attr: { title: description }, click: $root.setConfigBeingViewed">
</a>
</li>
<!-- /ko -->
</ul>
</div>
<button class="btn btn-default" data-bind="click: setConfigBeingEdited">
{% trans "Save" %}...
</button>
{% endif %}
{% if report.is_emailable %}
<div style="display: inline-block; margin-left:0.5em;" class="label label-info" id="email-enabled">
<i class="fa fa-info-circle"></i> {% trans "Email Supported" %}
</div>
{% endif %}
{% include "reports/partials/save_reports_modal.html" %}
</div>
{% endblock %}
|
{
"pile_set_name": "Github"
}
|
-- Merging decision tree log ---
manifest
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:1:1-22:12
xmlns:android
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:1:11-69
package
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:2:5-25
INJECTED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml
INJECTED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml
android:versionName
INJECTED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml
INJECTED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml
android:versionCode
INJECTED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml
INJECTED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml
uses-permission#android.permission.INTERNET
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:4:5-67
android:name
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:4:22-64
application
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:6:5-20:19
MERGED from [com.android.support:appcompat-v7:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/AndroidManifest.xml:22:5-20
MERGED from [com.android.support:support-v4:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/AndroidManifest.xml:22:5-20
MERGED from [com.facebook.react:react-native:0.13.0] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.facebook.react/react-native/0.13.0/AndroidManifest.xml:13:5-20
MERGED from [org.webkit:android-jsc:r174650] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/org.webkit/android-jsc/r174650/AndroidManifest.xml:2:3-17
MERGED from [com.android.support:support-v4:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/AndroidManifest.xml:22:5-20
MERGED from [com.android.support:support-v4:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/AndroidManifest.xml:22:5-20
MERGED from [com.android.support:support-v4:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/AndroidManifest.xml:22:5-20
MERGED from [com.android.support:appcompat-v7:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/AndroidManifest.xml:22:5-20
MERGED from [com.android.support:support-v4:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/support-v4/23.0.1/AndroidManifest.xml:22:5-20
android:label
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:8:7-39
android:allowBackup
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:7:7-33
android:icon
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:9:7-41
android:theme
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:10:7-38
activity#com.abcddd.MainActivity
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:11:7-18:18
android:label
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:13:9-41
android:name
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:12:9-37
intent-filter#android.intent.action.MAIN+android.intent.category.LAUNCHER
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:14:9-17:25
action#android.intent.action.MAIN
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:15:13-65
android:name
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:15:21-62
category#android.intent.category.LAUNCHER
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:16:13-73
android:name
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:16:23-70
activity#com.facebook.react.devsupport.DevSettingsActivity
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:19:7-84
android:name
ADDED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml:19:17-81
uses-sdk
INJECTED from /Users/hugo/github/react-native-demo/android/app/src/main/AndroidManifest.xml reason: use-sdk injection requested
MERGED from [com.android.support:appcompat-v7:23.0.1] /Users/hugo/github/react-native-demo/android/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/AndroidManifest.xml:20:5-43
MERGED from [com.android.support:support-v4:23.0.1] /Users/hugo/github/react-
|
{
"pile_set_name": "Github"
}
|
/*
* eXist-db Open Source Native XML Database
* Copyright (C) 2001 The eXist-db Authors
*
* info@exist-db.org
* http://www.exist-db.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.exist.util.serializer;
import java.io.IOException;
import java.io.Writer;
import java.util.*;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.TransformerException;
import com.evolvedbinary.j8fu.lazy.LazyVal;
import org.exist.dom.QName;
import org.exist.storage.serializers.EXistOutputKeys;
import org.exist.util.CharSlice;
import org.exist.util.serializer.encodings.CharacterSet;
/**
* Write XML to a writer. This class defines methods similar to SAX. It deals
* with opening and closing tags, writing attributes and so on.
*
* @author wolf
*/
public class XMLWriter {
private final static IllegalStateException EX_CHARSET_NULL = new IllegalStateException("Charset should never be null!");
protected final static Properties defaultProperties = new Properties();
static {
defaultProperties.setProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
defaultProperties.setProperty(EXistOutputKeys.XDM_SERIALIZATION, "no");
}
protected Writer writer = null;
protected CharacterSet charSet = null;
protected boolean tagIsOpen = false;
protected boolean tagIsEmpty = true;
protected boolean declarationWritten = false;
protected boolean doctypeWritten = false;
protected Properties outputProperties;
private char[] charref = new char[10];
private static boolean[] textSpecialChars;
private static boolean[] attrSpecialChars;
private String defaultNamespace = "";
/**
* When serializing an XDM this should be true,
* otherwise false.
*
* XDM has different serialization rules
* compared to retrieving resources from the database.
*/
private boolean xdmSerialization = false;
private final Deque<QName> elementName = new ArrayDeque<>();
private LazyVal<Set<QName>> cdataSectionElements = new LazyVal<>(this::parseCdataSectionElementNames);
private boolean cdataSetionElement = false;
static {
textSpecialChars = new boolean[128];
Arrays.fill(textSpecialChars, false);
textSpecialChars['<'] = true;
textSpecialChars['>'] = true;
// textSpecialChars['\r'] = true;
textSpecialChars['&'] = true;
attrSpecialChars = new boolean[128];
Arrays.fill(attrSpecialChars, false);
attrSpecialChars['<'] = true;
attrSpecialChars['>'] = true;
attrSpecialChars['\r'] = true;
attrSpecialChars['\n'] = true;
attrSpecialChars['\t'] = true;
attrSpecialChars['&'] = true;
attrSpecialChars['"'] = true;
}
public XMLWriter() {
charSet = CharacterSet.getCharacterSet("UTF-8");
if(charSet == null) {
throw EX_CHARSET_NULL;
}
}
public XMLWriter(final Writer writer) {
this();
this.writer = writer;
}
/**
* Set the output properties.
*
* @param properties outputProperties
*/
public void setOutputProperties(final Properties properties) {
if(properties == null) {
outputProperties = defaultProperties;
} else {
outputProperties = properties;
}
final String encoding = outputProperties.getProperty(OutputKeys.ENCODING, "UTF-8");
this.charSet = CharacterSet.getCharacterSet(encoding);
if(this.charSet == null) {
throw EX_CHARSET_NULL;
}
this.xdmSerialization = outputProperties.getProperty(EXistOutputKeys.XDM_SERIALIZATION, "no").equals("yes");
}
private Set<QName> parseCdataSectionElementNames() {
final String s = outputProperties.getProperty(OutputKeys.CDATA_SECTION_ELEMENTS);
if (s == null || s.isEmpty()) {
return Collections.EMPTY_SET;
}
final Set<QName> qnames = new HashSet<>();
for (final String uriQualifiedName : s.split("\\s")) {
qnames.add(QName.fromURIQualifiedName(uriQualifiedName));
}
return qnames;
}
protected void reset() {
writer = null;
resetObjectState();
}
protected void resetObjectState() {
tagIsOpen = false;
tagIsEmpty = true;
declarationWritten = false;
doctypeWritten = false;
defaultNamespace = "";
cdataSectionElements = new LazyVal<>(this::parseCdataSectionElementNames);
}
/**
* Set a new writer. Calling this method will reset the state of the object.
*
* @param writer the writer
*/
public void setWriter(final Writer writer) {
this.writer = writer;
resetObjectState();
}
protected Writer getWriter() {
return writer;
}
public String getDefaultNamespace() {
return defaultNamespace.isEmpty() ? null : defaultNamespace;
}
public void setDefaultNamespace(final String namespace) {
defaultNamespace = namespace == null ? "" : namespace;
}
public void startDocument() throws TransformerException {
resetObjectState();
}
public void endDocument() throws TransformerException {
}
public void startElement(final String namespaceUri, final String localName, final String qname) throws TransformerException {
if(!declarationWritten) {
writeDeclaration();
}
if(!doctypeWritten) {
writeDoctype(qname);
}
try {
if(tagIsOpen) {
closeStartTag(false);
}
writer.write('<');
writer.write(qname);
tagIsOpen = true;
try {
elementName.push(QName.parse(namespaceUri, qname));
} catch (final QName.IllegalQNameException e) {
throw new TransformerException(e.getMessage(), e);
}
} catch(final IOException ioe) {
throw new TransformerException(ioe.getMessage(), ioe);
}
}
public void startElement(final QName qname) throws TransformerException {
if(!declarationWritten) {
writeDeclaration();
}
if(!doctypeWritten) {
writeDoctype(qname.getStringValue());
}
try {
if(tagIsOpen) {
closeStartTag(false);
}
writer.write('<');
if(qname.getPrefix() != null && qname.getPrefix().length() > 0) {
writer.write(qname.getPrefix());
writer.write(':');
}
writer.write(qname.getLocalPart());
tagIsOpen = true;
elementName.push(qname);
} catch(final IOException ioe) {
throw new TransformerException(ioe.getMessage(), ioe);
}
}
public void endElement(final String namespaceURI, final String localName, final String qname) throws TransformerException {
try {
if (tagIsOpen) {
closeStartTag(true);
} else {
writer.write("</");
writer.write(qname);
|
{
"pile_set_name": "Github"
}
|
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common \
unzip
RUN curl -o /tmp/go.tgz https://dl.google.com/go/go1.14.linux-amd64.tar.gz && \
tar -xvzf /tmp/go.tgz -C /tmp && \
mv /tmp/go /usr/local && \
rm -rf /tmp/go*
USER root
ENV HOME /root
ENV GOROOT /usr/local/go
ENV GOPATH $HOME/go
ENV PATH $GOPATH/bin:$GOROOT/bin:$PATH
# RUN PROTOC_ZIP=protoc-3.7.1-linux-x86_64.zip && \
# curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.7.1/$PROTOC_ZIP && \
# unzip -o $PROTOC_ZIP -d /usr/local bin/protoc && \
# unzip -o $PROTOC_ZIP -d /usr/local 'include/*' && \
# rm -f $PROTOC_ZIP
RUN apt-get update && \
apt-get install -y --no-install-recommends git
COPY get_dependencies.sh get_dependencies.sh
RUN ./get_dependencies.sh
RUN apt-get update && \
apt-get install -y --no-install-recommends python3-pip python3-setuptools
# RUN pip3 install protobuf==3.11.3
RUN pip3 install grpcio-tools==1.27.2 grpcio==1.27.2
RUN apt-get update && \
apt-get install -y --no-install-recommends jq
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
RUN pip3 install pystache==0.5.4 Click==7.0
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) by James Courtier-Dutton <James@superbug.demon.co.uk>
* Driver p16v chips
* Version: 0.25
*
* FEATURES currently supported:
* Output fixed at S32_LE, 2 channel to hw:0,0
* Rates: 44.1, 48, 96, 192.
*
* Changelog:
* 0.8
* Use separate card based buffer for periods table.
* 0.9
* Use 2 channel output streams instead of 8 channel.
* (8 channel output streams might be good for ASIO type output)
* Corrected speaker output, so Front -> Front etc.
* 0.10
* Fixed missed interrupts.
* 0.11
* Add Sound card model number and names.
* Add Analog volume controls.
* 0.12
* Corrected playback interrupts. Now interrupt per period, instead of half period.
* 0.13
* Use single trigger for multichannel.
* 0.14
* Mic capture now works at fixed: S32_LE, 96000Hz, Stereo.
* 0.15
* Force buffer_size / period_size == INTEGER.
* 0.16
* Update p16v.c to work with changed alsa api.
* 0.17
* Update p16v.c to work with changed alsa api. Removed boot_devs.
* 0.18
* Merging with snd-emu10k1 driver.
* 0.19
* One stereo channel at 24bit now works.
* 0.20
* Added better register defines.
* 0.21
* Integrated with snd-emu10k1 driver.
* 0.22
* Removed #if 0 ... #endif
* 0.23
* Implement different capture rates.
* 0.24
* Implement different capture source channels.
* e.g. When HD Capture source is set to SPDIF,
* setting HD Capture channel to 0 captures from CDROM digital input.
* setting HD Capture channel to 1 captures from SPDIF in.
* 0.25
* Include capture buffer sizes.
*
* BUGS:
* Some stability problems when unloading the snd-p16v kernel module.
* --
*
* TODO:
* SPDIF out.
* Find out how to change capture sample rates. E.g. To record SPDIF at 48000Hz.
* Currently capture fixed at 48000Hz.
*
* --
* GENERAL INFO:
* Model: SB0240
* P16V Chip: CA0151-DBS
* Audigy 2 Chip: CA0102-IAT
* AC97 Codec: STAC 9721
* ADC: Philips 1361T (Stereo 24bit)
* DAC: CS4382-K (8-channel, 24bit, 192Khz)
*
* This code was initially based on code from ALSA's emu10k1x.c which is:
* Copyright (c) by Francisco Moraes <fmoraes@nc.rr.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/moduleparam.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/info.h>
#include <sound/tlv.h>
#include <sound/emu10k1.h>
#include "p16v.h"
#define SET_CHANNEL 0 /* Testing channel outputs 0=Front, 1=Center/LFE, 2=Unknown, 3=Rear */
#define PCM_FRONT_CHANNEL 0
#define PCM_REAR_CHANNEL 1
#define PCM_CENTER_LFE_CHANNEL 2
#define PCM_SIDE_CHANNEL 3
#define CONTROL_FRONT_CHANNEL 0
#define CONTROL_REAR_CHANNEL 3
#define CONTROL_CENTER_LFE_CHANNEL 1
#define CONTROL_SIDE_CHANNEL 2
/* Card IDs:
* Class 0401: 1102:0004 (rev 04) Subsystem: 1102:2002 -> Audigy2 ZS 7.1 Model:SB0350
* Class 0401: 1102:0004 (rev 04) Subsystem: 1102:1007 -> Audigy2 6.1 Model:SB0240
* Class 0401: 1102:0004 (rev 04) Subsystem: 1102:1002 -> Audigy2 Platinum Model:SB msb0240230009266
* Class 0401: 1102:0004 (rev 04) Subsystem: 1102:2007 -> Audigy4 Pro Model:SB0380 M1SB0380472001901E
*
*/
/* hardware definition */
static struct snd_pcm_hardware snd_p16v_playback_hw = {
.info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_SYNC_START,
.formats = SNDRV_PCM_FMTBIT_S32_LE, /* Only supports 24-bit samples padded to 32 bits. */
.rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
.rate_min = 44100,
.rate_max = 192000,
.channels_min = 8,
.channels_max = 8,
.buffer_bytes_max = ((65536 - 64) * 8),
.period_bytes_min = 64,
.period_bytes_max = (65536 - 64),
.periods_min = 2,
.periods_max = 8,
.fifo_size = 0,
};
static struct snd_pcm_hardware snd_p16v_capture_hw = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S32_LE,
.rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
.rate_min = 44100,
.rate_max = 192000,
.channels_min = 2,
.channels_max = 2,
.buffer_bytes_max = (65536 - 64),
.period_bytes_min = 64,
.period_bytes_max = (65536 - 128) >> 1, /* size has to be N*64 bytes */
.periods_min = 2,
.periods_max = 2,
.fifo_size = 0,
};
static void snd_p16v_pcm_free_substream(struct snd_pcm
|
{
"pile_set_name": "Github"
}
|
// HD
@screen-xl: (@screen-md * @line-height-base);
@screen-xl-min: @screen-xl;
@container-xl: (@container-md * @line-height-base);
@component-padding: @line-height-computed;
.make-xl-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
min-height: 1px;
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
@media (min-width: @screen-lg-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
.make-xl-column-offset(@columns) {
@media (min-width: @screen-lg-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-xl-column-push(@columns) {
@media (min-width: @screen-lg-min) {
left: percentage((@columns / @grid-columns));
}
}
.make-xl-column-pull(@columns) {
@media (min-width: @screen-lg-min) {
right: percentage((@columns / @grid-columns));
}
}
@media (min-width: @screen-xl-min) {
.make-grid(xl);
}
.container {
@media (min-width: @screen-xl-min) {
width: @container-xl;
}
}
|
{
"pile_set_name": "Github"
}
|
import widget from '../mixins/widget'
import {extend} from '../utils/core'
export default {
name: 'LaLegend',
mixins: [widget],
props: {
selectable: Boolean,
/**
* ^(top|bottom|left|right)(-(start|center|end))?$
*/
placement: {
type: String,
default: 'bottom'
},
color: String
},
preload({data, parent}) {
const {placement = 'bottom'} = data
let space = [0, 0, 0, 0]
switch (placement.match(/^(\w+)-?/)[1]) {
case 'bottom':
space[2] = 50
break
case 'top':
space[0] = 50
break
case 'left':
space[3] = 100
break
case 'right':
space[1] = 100
break
default:
break
}
parent.addSpace(space)
},
computed: {
curColor() {
return this.color || this.Plane.textColor
},
position() {
return this.placement.match(/^(\w+)(-(\w+))?$/)[1]
},
align() {
return this.placement.match(/^(\w+)(-(\w+))?$/)[3]
},
pos() {
const {position, align} = this
const pos = {}
if (position === 'top' || position === 'bottom') {
switch (align) {
case 'start':
pos.left = 0
break
case 'end':
pos.right = 0
break
default:
pos.left = '50%'
pos.transform = 'translateX(-50%)'
break
}
if (position === 'top') {
pos.top = 0
} else {
pos.bottom = 0
}
} else {
switch (align) {
case 'start':
pos.top = 0
break
case 'end':
pos.bottom = 0
break
default:
pos.top = '50%'
pos.transform = 'translateY(-50%)'
break
}
if (position === 'left') {
pos.left = 0
} else {
pos.right = 0
}
}
return pos
}
},
created() {
this.$set(this.store, 'hidden', [])
},
render(h) {
const {curColor, pos, position, selectable, store} = this
const {hidden} = store
const slot = this.$scopedSlots.default
return h(
'div',
{
class: 'la-legend',
style: extend(
{
position: 'absolute'
},
pos
)
},
Object.keys(store.props).map(id =>
h(
'div',
{
style: {
display:
position === 'left' || position === 'right' ?
'block' :
'inline-block',
marginRight: '10px',
marginLeft: '5px',
color: curColor,
cursor: selectable ? 'pointer' : 'nromal'
},
on: {
click: () => {
if (!selectable) {
return
}
id = Number(id)
const index = hidden.indexOf(id)
if (index < 0) {
hidden.push(id)
} else {
hidden.splice(index, 1)
}
}
}
},
slot ?
slot({
color: store.colors[id],
label: store.labels[id],
prop: store.props[id]
}) :
[
h('span', {
style: {
backgroundColor: store.colors[id],
height: '10px',
width: '10px',
borderRadius: '50%',
display: 'inline-block',
marginRight: '5px'
}
}),
h(
'span',
{
style:
hidden.indexOf(Number(id)) > -1 ?
{
textDecoration: 'line-through'
} :
{}
},
store.labels[id]
)
]
)
)
)
}
}
|
{
"pile_set_name": "Github"
}
|
MILKDROP_PRESET_VERSION=201
PSVERSION=2
PSVERSION_WARP=2
PSVERSION_COMP=2
[preset00]
fRating=5.000
fGammaAdj=1.000
fDecay=1.000
fVideoEchoZoom=2.000
fVideoEchoAlpha=0.000
nVideoEchoOrientation=0
nWaveMode=3
bAdditiveWaves=0
bWaveDots=1
bWaveThick=0
bModWaveAlphaByVolume=1
bMaximizeWaveColor=1
bTexWrap=1
bDarkenCenter=0
bRedBlueStereo=0
bBrighten=0
bDarken=0
bSolarize=0
bInvert=0
fWaveAlpha=0.800
fWaveScale=16.217
fWaveSmoothing=0.750
fWaveParam=-0.440
fModWaveAlphaStart=0.750
fModWaveAlphaEnd=0.950
fWarpAnimSpeed=1.000
fWarpScale=1.772
fZoomExponent=4.40100
fShader=0.000
zoom=1.01100
rot=0.00300
cx=0.500
cy=0.500
dx=0.00000
dy=0.00000
warp=0.00000
sx=1.00000
sy=1.00000
wave_r=0.500
wave_g=0.500
wave_b=0.500
wave_x=0.500
wave_y=0.500
ob_size=0.010
ob_r=0.000
ob_g=0.000
ob_b=0.000
ob_a=0.000
ib_size=0.010
ib_r=0.250
ib_g=0.250
ib_b=0.250
ib_a=0.000
nMotionVectorsX=12.000
nMotionVectorsY=9.000
mv_dx=0.000
mv_dy=0.000
mv_l=0.900
mv_r=1.000
mv_g=1.000
mv_b=1.000
mv_a=0.000
b1n=0.000
b2n=0.000
b3n=0.000
b1x=1.000
b2x=1.000
b3x=1.000
b1ed=0.250
wavecode_0_enabled=0
wavecode_0_samples=512
wavecode_0_sep=0
wavecode_0_bSpectrum=0
wavecode_0_bUseDots=0
wavecode_0_bDrawThick=0
wavecode_0_bAdditive=0
wavecode_0_scaling=1.00000
wavecode_0_smoothing=0.50000
wavecode_0_r=1.000
wavecode_0_g=1.000
wavecode_0_b=1.000
wavecode_0_a=1.000
wavecode_1_enabled=0
wavecode_1_samples=512
wavecode_1_sep=0
wavecode_1_bSpectrum=0
wavecode_1_bUseDots=0
wavecode_1_bDrawThick=0
wavecode_1_bAdditive=0
wavecode_1_scaling=1.00000
wavecode_1_smoothing=0.50000
wavecode_1_r=1.000
wavecode_1_g=1.000
wavecode_1_b=1.000
wavecode_1_a=1.000
wavecode_2_enabled=0
wavecode_2_samples=512
wavecode_2_sep=0
wavecode_2_bSpectrum=0
wavecode_2_bUseDots=0
wavecode_2_bDrawThick=0
wavecode_2_bAdditive=0
wavecode_2_scaling=1.00000
wavecode_2_smoothing=0.50000
wavecode_2_r=1.000
wavecode_2_g=1.000
wavecode_2_b=1.000
wavecode_2_a=1.000
wavecode_3_enabled=0
wavecode_3_samples=512
wavecode_3_sep=0
wavecode_3_bSpectrum=0
wavecode_3_bUseDots=0
wavecode_3_bDrawThick=0
wavecode_3_bAdditive=0
wavecode_3_scaling=1.00000
wavecode_3_smoothing=0.50000
wavecode_3_r=1.000
wavecode_3_g=1.000
wavecode_3_b=1.000
wavecode_3_a=1.000
shapecode_0_enabled=0
shapecode_0_sides=4
shapecode_0_additive=1
shapecode_0_thickOutline=0
shapecode_0_textured=1
shapecode_0_num_inst=1
shapecode_0_x=0.500
shapecode_0_y=0.500
shapecode_0_rad=0.59958
shapecode_0_ang=0.00000
shapecode_0_tex_ang=0.00000
shapecode_0_tex_zoom=1.00000
shapecode_0_r=1.000
shapecode_0_g=1.000
shapecode_0_b=1.000
shapecode_0_a=1.000
shapecode_0_r2=1.000
shapecode_0_g2=1.000
shapecode_0_b2=1.000
shapecode_0_a2=0.000
shapecode_0_border_r=0.000
shapecode_0_border_g=0.000
shapecode_0_border_b=0.000
shapecode_0_border_a=0.100
shapecode_1_enabled=0
shapecode_1_sides=4
shapecode_1_additive=0
shapecode_1_thickOutline=0
shapecode_1_textured=0
shapecode_1_num_inst=1
shapecode_1_x=0.500
shapecode_1_y=0.500
shapecode_1_rad=0.10000
shapecode_1_ang=0.00000
shapecode_1_tex_ang=0.00000
shapecode_1_tex_zoom=1.00000
shapecode_1_r=1.000
shapecode_1_g=0.000
shapecode_1_b=0.000
shapecode_1_a=1.000
shapecode_1_r2=0.000
shapecode_1_g2=1.000
shapecode_1_b2=0.000
shapecode_1_a2=0.000
shapecode_1_border_r=1.000
shapecode_1_border_g=1.000
shapecode_1_border_b=1.000
shapecode_1_border_a=0.100
shapecode_2_enabled=0
shapecode_2_sides=4
shapecode_2_additive=0
shapecode_2_thickOutline=0
shapecode_2_textured=0
shapecode_2_num_inst=1
shapecode_2_x=0.500
shapecode_2_y=0.500
shapecode_2_rad=0.10000
shapecode_2_ang=0.00000
shapec
|
{
"pile_set_name": "Github"
}
|
.. _sphx_glr_auto_examples_plot_align.py:
=============================
Aligning matrices to a common space
=============================
In this example, we plot the trajectory of multivariate brain activity for
two groups of subjects that have been hyperaligned (Haxby et al, 2011). First,
we use the align tool to project all subjects in the list to a common space.
Then we average the data into two groups, and plot.
.. image:: /auto_examples/images/sphx_glr_plot_align_001.png
:align: center
.. code-block:: python
# Code source: Andrew Heusser
# License: MIT
# import
import hypertools as hyp
import numpy as np
# load example data
data = hyp.load('weights').get_data()
data = hyp.align(data, align='hyper')
# average into two groups
group1 = np.mean(data[:17], 0)
group2 = np.mean(data[18:], 0)
# plot
hyp.plot([group1[:100, :], group2[:100, :]])
**Total running time of the script:** ( 0 minutes 0.432 seconds)
.. only :: html
.. container:: sphx-glr-footer
.. container:: sphx-glr-download
:download:`Download Python source code: plot_align.py <plot_align.py>`
.. container:: sphx-glr-download
:download:`Download Jupyter notebook: plot_align.ipynb <plot_align.ipynb>`
.. only:: html
.. rst-class:: sphx-glr-signature
`Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
|
{
"pile_set_name": "Github"
}
|
#ifndef INCLUDED_CSFTYPES
# define INCLUDED_CSFTYPES
#ifdef USE_IN_GDAL
#include "cpl_port.h"
#endif
#ifdef __cplusplus
extern "C" {
#define CSF_IN_GLOBAL_NS ::
#else
#define CSF_IN_GLOBAL_NS
#endif
#ifdef CSF_V1
# error include file CSF version 2 used while CSF_V1 is defined
#endif
/* MACHINE AND OPERATING SYSTEM DEPENDENT SECTION:
* (LOOK AND CONFIGURE YOUR MACHINE/OS)
* - Retype all types for file i/o
* - Define endian mode
* - Compliance mode (POSIX/XOPEN)
*/
#ifdef THINK_C
# error read notes in csftypes.h
/* Some history:
* THINK C 3.0:
* - does not know the keyword signed
* - uses a 12-byte for double if compiled with
* the in-line 68881 option
*/
#endif
/* the only 64 bit cpu we tested on:
* -ifdef __alpha
* don't use long
* -define CSF_4BYTE_INT_SIZE_SPECIFIER long
*/
#define CSF_4BYTE_INT_SIZE_SPECIFIER
/* some old C++ compiler complains
* about signed
*/
#ifdef SIGNED_NOT_IMPL
# define CSF_SIGNED_SPECIFIER
#else
# define CSF_SIGNED_SPECIFIER signed
#endif
/* the last-character figure is the
* size in bytes of the data type
*/
typedef CSF_SIGNED_SPECIFIER char INT1;
typedef unsigned char UINT1;
#ifdef USE_IN_GDAL
typedef GInt16 INT2;
typedef GInt32 INT4;
typedef GUInt16 UINT2;
typedef GUInt32 UINT4;
#else
typedef CSF_SIGNED_SPECIFIER short int INT2;
typedef CSF_SIGNED_SPECIFIER CSF_4BYTE_INT_SIZE_SPECIFIER int INT4;
typedef unsigned short int UINT2;
typedef unsigned CSF_4BYTE_INT_SIZE_SPECIFIER int UINT4;
#endif
#ifdef __GNUC__
/* Modern versions of GCC use knowledge about strict aliasing to implement
* certain optimizations. We have some code that fails to comply to the
* strict aliasing rules (see uses of UINT_ALIASING in this header).
* These are simple cases that should not be optimized. Using
* UINT_ALIASING will prevent gcc from optimizing these expressions.
* http://dbp-consulting.com/tutorials/StrictAliasing.html
* http://ohse.de/uwe/articles/gcc-attributes.html#type-may_alias
*/
typedef UINT4 __attribute__((__may_alias__)) UINT4_ALIASING;
#else
typedef UINT4 UINT4_ALIASING;
#endif
#undef CSF_4BYTE_INT_SIZE_SPECIFIER
#undef CSF_SIGNED_SPECIFIER
typedef float REAL4; /* IEEE-754 32-bit */
typedef double REAL8; /* IEEE-754 64-bit */
/* endian mode
* DEFINE WITH -D or find here
*/
#ifndef CPU_BIG_ENDIAN
# ifndef CPU_LITTLE_ENDIAN
#ifdef USE_IN_GDAL
/* GDAL CPL STYLE */
# ifdef CPL_LSB
# define CPU_LITTLE_ENDIAN
# endif
# ifdef CPL_MSB
# define CPU_BIG_ENDIAN
# endif
#else
/* probe a few: */
#ifdef _AIX
/* IBM AIX defines this on RS/6000 */
# define CPU_BIG_ENDIAN
#endif
#ifdef sparc
/* both cc and gcc defines this in SunOS */
# define CPU_BIG_ENDIAN
#endif
/*
* #ifdef mips
* worked once on the SGI machines
* but mips has both endian architectures
* # define CPU_BIG_ENDIAN
* #endif
*/
#ifdef __alpha
/* DEC alpha defines this
* tested on OSF1 planet V4.0 1229 alpha
* in combo with egcs/gcc 2.95.2
*/
# define CPU_LITTLE_ENDIAN
#endif
#ifdef __i386__
/* linux/gcc defines this on intel 80x86 platform */
# define CPU_LITTLE_ENDIAN
#endif
#ifdef __x86_64__
/* linux/gcc defines this on intel 80x86_64 platform */
# define CPU_LITTLE_ENDIAN
#endif
#ifdef _M_X64
/* Mscc defines this on intel 80x86_64 platform */
# define CPU_LITTLE_ENDIAN
#endif
#ifdef _M_IX86
/* Borland C defines this */
/* Win32/MSC defines this on intel 80x86 platform */
# define CPU_LITTLE_ENDIAN
#endif
#ifdef __hppa
/* cc and gcc defines this on HP PA risc platform */
# define CPU_BIG_ENDIAN
#endif
/* endif probing */
# endif
/* endif no ENDIAN defined */
# endif
#endif
/* POSIX or XOPEN compliance
* The only need for the POSIX or even XOPEN superset
* over ANSI-C are
* M_PI HP-UX complained about that and it seems in XOPEN
* solution:
* M_PI is defined in situ in source files if it is not defined
* (most times in math.h)
* we probe a few systems to find if we may define it
*/
#ifdef __hpux
# ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE
# endif
#endif
/* END OF MACHINE AND OPERATING SYSTEM DEPENDENT SECTION
* NO NEED TO EDIT ANYTHING BELOW THIS POINT
*/
/* PROJECTION
*/
/* version 1 types, no longer used
*/
#define PT_XY 0 /* XY-field (= PT_YINCT2B)
*/
#define PT_UTM 1 /* Universal Transverse Mercator (= PT_YDECT2B)
*/
#define PT_LATLON 2 /* Latitude / Longitude (= PT_YDECT2B)
*/
#define PT_CART 3 /* Carthesian (= PT_YDECT2B)
*/
#define PT_RDM 4 /* Rijks Driehoek Metingen stelsel (= PT_YDECT2B)
*/
/* the only difference we make is whether Y increases from
* top to bottom or decreases from top to bottom
*/
typedef enum CSF_PT {
/* * these two can be returned by or passed to a csf2 function */
PT_YINCT2B=0, /* Y increase from top to bottom, wrong do not use */
PT_YDECT2B=1, /* Y decrease from top to bottom, correct */
/* * this one CANNOT be returned by NOR passed to a csf2 function */
PT_UNDEFINED=100 /* just some value different from the rest */
} CSF_PT;
/* DATATYPE
* A.K.A. VALUESCALE
*/
/* historical errors don't use them:
* #define VS_NOTCLASSIFIED 2
* #define VS_CONTINUES 2
*
* NOTE new VS_* types must be different from CR_* values
* VS_BOOLEAN 0xE0 => 224
* VS_NOMINAL 0xE2 => 226
* VS_ORDINAL 0xF2 => 242
* VS_SCALAR 0xEB => 235
* VS_DIRECTION 0xFB => 251
* VS_LDD 0xF0 => 240
* VS_VECTOR 0xEC => 236
* VS_VECTOR 0xEC vector, not used yet
*/
typedef enum CSF_VS {
/* * version 1 datatypes,
* these can be returned by BUT NOT passed to a csf2 function
*/
VS_NOTDETERMINED=0, /* version 1 */
VS_CLASSIFIED =1, /* version 1 */
VS_CONTINUOUS
|
{
"pile_set_name": "Github"
}
|
The class diagram for the stream classes is shown below:
*===========================* *============================*
| InputStreamCallback<S, T> | | OutputStreamCallback<S, T> |
*===========================* *============================*
| |
|-inherits from inherits from-|
| |
| |
| +-------------------------------+ +--------------------------------+ |
| | SyncInputStreamCallback<S, T> | | SyncOutputStreamCallback<S, T> | |
| +-------------------------------+ +--------------------------------+ |
| | ^ | | ^ | |
| |-inherits from | |-uses uses-| | inherits from-| |
| | | | | | | |
| | creates-| | | |-creates | |
| | | V V | | |
| | *================* *=================* | |
| | | InputStream<T> | | OutputStream<T> | | |
| | *================* *=================* | |
| | | | | |
| | |-uses uses-| | |
| | | | | |
| V V V | |
| / - - - - - - - - - - - - - - - -\ / - - - - - - - - - - - - - - - - \ |
| | SyncInputStreamCallbackBase<T> | | SyncOutputStreamCallbackBase<T> | |
| \ - - - - - - - - - - - - - - - -/ \ - - - - - - - - - - - - - - - - / |
| | | |
| |-inherits from inherits from-| |
| | | |
| V V |
| +-------------------------+ +--------------------------+ |
\-> | InputStreamCallbackBase |------\ /-----| OutputStreamCallbackBase |<-/
+-------------------------+ | | +--------------------------+
| *^ | | ^* |
uses-| | uses-| |-uses | |-uses
| | | | | |
| |-uses | | uses-| |
| |-owns | | owns-| |
V 1| | | |1 V
+--------------+ | | +------------+
/--------| StreamSource |--\ | | /--| StreamSink |---------\
| +--------------+ | | | | +------------+ |
|-uses ^ | | | | ^ uses-|
|-owns | uses-| | | |-uses | owns-|
| |-uses | | | | uses-| |
| |-owns | | | | owns-| |
V | V V V V | V
+--------------+ | +---------------+ | +--------------+
| StreamReader | \---------| StreamManager |-------/ | StreamWriter |
+--------------+ +---------------+ +--------------+
| |
| |
/--------/ \--------------\
| |
|-uses uses-|
| |
V V
/ - - - - - - - - - - - \ +-----------+
| StreamChannelCallback | | EventBase |
\ - - - - - - - - - - - / +-----------+
Legend:
/ - - - - - \ +-------+ +=====================+
| Interface | | Class | | ClassExposedToUsers |
\ - - - - - / +-------+ +=====================+
|
{
"pile_set_name": "Github"
}
|
using N2.Engine;
using N2.Web.Parts;
namespace N2.Tests.Web.Items
{
[Adapts(typeof(CustomItem))]
public class CustomZoneController : PartsAdapter
{
}
}
|
{
"pile_set_name": "Github"
}
|
class Ispell < Formula
desc "International Ispell"
homepage "http://lasr.cs.ucla.edu/geoff/ispell.html"
url "https://www.cs.hmc.edu/~geoff/tars/ispell-3.4.00.tar.gz"
mirror "https://mirrors.kernel.org/debian/pool/main/i/ispell/ispell_3.4.00.orig.tar.gz"
sha256 "5dc42e458635f218032d3ae929528e5587b1e7247564f0e9f9d77d5ccab7aec2"
bottle do
sha256 "81d9f6f9aca0f92ba3bece2ad22d0b0bca29c719304c6c5e8e59b02a3c8763da" => :el_capitan
sha256 "ff46baf7aa6daf42fddde68897bd80dbb073922b4556c502e7b0072656b48498" => :yosemite
sha256 "f1ee90dcc76682d17c2b758d2a896493448753acc0e556e9b0c8bf7ec0f552df" => :mavericks
sha256 "dbbaabbc715f6f16dfb9f2cd05755a88e471b92c63d7f87f79a940a5df8dadfb" => :mountain_lion
end
def install
ENV.deparallelize
ENV.no_optimization
# No configure script, so do this all manually
cp "local.h.macos", "local.h"
chmod 0644, "local.h"
inreplace "local.h" do |s|
s.gsub! "/usr/local", prefix
s.gsub! "/man/man", "/share/man/man"
s.gsub! "/lib", "/lib/ispell"
end
chmod 0644, "correct.c"
inreplace "correct.c", "getline", "getline_ispell"
system "make config.sh"
chmod 0644, "config.sh"
inreplace "config.sh", "/usr/share/dict", "#{share}/dict"
(lib/"ispell").mkpath
system "make", "install"
end
test do
assert_equal "BOTHER BOTHE/R BOTH/R",
`echo BOTHER | #{bin}/ispell -c`.chomp
end
end
|
{
"pile_set_name": "Github"
}
|
/*
Copyright (C) 2011 Martin S.
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.
*/
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]);
|
{
"pile_set_name": "Github"
}
|
_errorMessage() {
# ${1}: message to sent
${printf} "\033[31m * \033[0m${1}\n"
_logMessages "Error: ${1}"
}
_infoMessage() {
# ${1}: message to sent
${printf} "\033[32m * \033[0m${1}\n"
_logMessages "Info: ${1}"
}
_optionMessages() {
local -a selectedOptions=("${@}")
_warningMessage "Options selected: ${selectedOptions[*]/--mysql-password=*/--mysql-password=****}"
if [ ${assumeyes} = "false" ]; then
_questionMessage "Do you want to continue? [y/N] "
read answer
local answer=${answer:-"n"}
else
local answer="y"
fi
if [ ${answer,,} = "n" ]; then
_errorMessage "User exit"
exit 1
fi
}
_questionMessage() {
# ${1}: message to sent
${printf} "\033[34m * \033[0m${1}"
}
_warningMessage() {
# ${1}: message to sent
echo " * ${1}"
_logMessages "Warning: ${1}"
}
_endMessage() {
_infoMessage "Successful installation!"
}
|
{
"pile_set_name": "Github"
}
|
# Event 153 - ContentFramerateDetected
###### Version: 0
## Description
None
## Data Dictionary
|Standard Name|Field Name|Type|Description|Sample Value|
|---|---|---|---|---|
|TBD|object|Pointer|None|`None`|
|TBD|FrameDuration|UInt64|None|`None`|
## Tags
* etw_level_Informational
* etw_task_ContentFramerateDetected
|
{
"pile_set_name": "Github"
}
|
'use strict';
angular.module("ngLocale", [], ["$provide", function($provide) {
var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
$provide.value("$locale", {
"DATETIME_FORMATS": {
"AMPMS": [
"AM",
"PM"
],
"DAY": [
"dimanche",
"lundi",
"mardi",
"mercredi",
"jeudi",
"vendredi",
"samedi"
],
"ERANAMES": [
"avant J\u00e9sus-Christ",
"apr\u00e8s J\u00e9sus-Christ"
],
"ERAS": [
"av. J.-C.",
"ap. J.-C."
],
"FIRSTDAYOFWEEK": 0,
"MONTH": [
"janvier",
"f\u00e9vrier",
"mars",
"avril",
"mai",
"juin",
"juillet",
"ao\u00fbt",
"septembre",
"octobre",
"novembre",
"d\u00e9cembre"
],
"SHORTDAY": [
"dim.",
"lun.",
"mar.",
"mer.",
"jeu.",
"ven.",
"sam."
],
"SHORTMONTH": [
"janv.",
"f\u00e9vr.",
"mars",
"avr.",
"mai",
"juin",
"juil.",
"ao\u00fbt",
"sept.",
"oct.",
"nov.",
"d\u00e9c."
],
"WEEKENDRANGE": [
5,
6
],
"fullDate": "EEEE d MMMM y",
"longDate": "d MMMM y",
"medium": "d MMM y HH:mm:ss",
"mediumDate": "d MMM y",
"mediumTime": "HH:mm:ss",
"short": "dd/MM/y HH:mm",
"shortDate": "dd/MM/y",
"shortTime": "HH:mm"
},
"NUMBER_FORMATS": {
"CURRENCY_SYM": "\u20ac",
"DECIMAL_SEP": ",",
"GROUP_SEP": "\u00a0",
"PATTERNS": [
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 3,
"minFrac": 0,
"minInt": 1,
"negPre": "-",
"negSuf": "",
"posPre": "",
"posSuf": ""
},
{
"gSize": 3,
"lgSize": 3,
"maxFrac": 2,
"minFrac": 2,
"minInt": 1,
"negPre": "-",
"negSuf": "\u00a0\u00a4",
"posPre": "",
"posSuf": "\u00a0\u00a4"
}
]
},
"id": "fr-mc",
"pluralCat": function(n, opt_precision) { var i = n | 0; if (i == 0 || i == 1) { return PLURAL_CATEGORY.ONE; } return PLURAL_CATEGORY.OTHER;}
});
}]);
|
{
"pile_set_name": "Github"
}
|
------------------------------------------------------------------------------
-- GNAT Studio --
-- --
-- Copyright (C) 2006-2020, AdaCore --
-- --
-- This is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. This software is distributed in the hope that it will be useful, --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- --
-- TABILITY 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 distributed with this software; see file --
-- COPYING3. If not, go to http://www.gnu.org/licenses for a complete copy --
-- of the license. --
------------------------------------------------------------------------------
with Glib_Values_Utils; use Glib_Values_Utils;
with Code_Analysis_Tree_Model; use Code_Analysis_Tree_Model;
with Code_Analysis_GUI; use Code_Analysis_GUI;
with Code_Coverage; use Code_Coverage;
with GNATCOLL.VFS;
with System;
package body Code_Analysis_Tree_Model is
procedure Set_Columns_Values
(Model : Gtk_Tree_Store;
Iter : Gtk_Tree_Iter;
Icon : String;
Name : String;
Node : System.Address;
File : System.Address;
Prjoject : System.Address);
-- Set model's values.
---------------
-- Fill_Iter --
---------------
procedure Fill_Iter
(Model : Gtk_Tree_Store;
Iter : in out Gtk_Tree_Iter;
Analysis_Id : Analysis;
Bin_Mode : Boolean := False) is
begin
if Analysis_Id.Coverage_Data /= null then
Fill_Iter (Model, Iter, Analysis_Id.Coverage_Data, Bin_Mode);
else
Set_And_Clear
(Model, Iter, (Cov_Col, Cov_Sort, Cov_Bar_Txt, Cov_Bar_Val),
(1 => As_String ("n/a"),
2 => As_Int (0),
3 => As_String ("n/a"),
4 => As_Int (0)));
end if;
end Fill_Iter;
---------------
-- Fill_Iter --
---------------
procedure Fill_Iter
(Model : Gtk_Tree_Store;
Iter : in out Gtk_Tree_Iter;
Parent : Gtk_Tree_Iter;
Prj_Node : Project_Access;
File_Node : File_Access;
Subp_Node : Subprogram_Access;
Bin_Mode : Boolean := False) is
begin
Append (Model, Iter, Parent);
Set_Columns_Values
(Model, Iter,
Icon => Subp_Pixbuf_Cst,
Name => Subp_Node.Name.all,
Node => Subp_Node.all'Address,
File => File_Node.all'Address,
Prjoject => Prj_Node.all'Address);
Fill_Iter (Model, Iter, Subp_Node.Analysis_Data, Bin_Mode);
end Fill_Iter;
--------------------------------
-- Fill_Iter_With_Subprograms --
--------------------------------
procedure Fill_Iter_With_Subprograms
(Model : Gtk_Tree_Store;
Iter : in out Gtk_Tree_Iter;
Prj_Node : Project_Access;
File_Node : File_Access;
Subp_Node : Subprogram_Access;
Bin_Mode : Boolean := False) is
begin
Append (Model, Iter, Null_Iter);
Set_Columns_Values
(Model, Iter,
Icon => Subp_Pixbuf_Cst,
Name => Subp_Node.Name.all,
Node => Subp_Node.all'Address,
File => File_Node.all'Address,
Prjoject => Prj_Node.all'Address);
Fill_Iter (Model, Iter, Subp_Node.Analysis_Data, Bin_Mode);
end Fill_Iter_With_Subprograms;
---------------
-- Fill_Iter --
---------------
procedure Fill_Iter
(Model : Gtk_Tree_Store;
Iter : in out Gtk_Tree_Iter;
Sibling : in out Gtk_Tree_Iter;
Parent : Gtk_Tree_Iter;
Prj_Node : Project_Access;
File_Node : File_Access;
Bin_Mode : Boolean := False)
is
use Subprogram_Maps;
Map_Cur : Subprogram_Maps.Cursor := File_Node.Subprograms.First;
Self_Iter : Gtk_Tree_Iter;
Sort_Arr : Subprogram_Array
(1 .. Integer (File_Node.Subprograms.Length));
begin
if File_Node.Analysis_Data.Coverage_Data /= null
and then File_Node.Analysis_Data.Coverage_Data.Is_Valid
then
Insert_After (Model, Iter, Parent, Sibling);
Sibling := Iter;
else
Append (Model, Iter, Parent);
end if;
Self_Iter := Iter;
Set_Columns_Values
(Model, Iter,
Icon => File_Pixbuf_Cst,
Name => GNATCOLL.VFS.Display_Base_Name (File_Node.Name),
Node => File_Node.all'Address,
File => File_Node.all'Address,
Prjoject => Prj_Node.all'Address);
Fill_Iter (Model, Iter, File_Node.Analysis_Data, Bin_Mode);
for J in Sort_Arr'Range loop
Sort_Arr (J) := (Element (Map_Cur));
Next (Map_Cur);
end loop;
Sort_Subprograms (Sort_Arr);
for J in Sort_Arr'Range loop
Fill_Iter (Model, Iter, Self_Iter, Prj_Node, File_Node, Sort_Arr (J),
Bin_Mode);
end loop;
end Fill_Iter;
--------------------------
-- Fill_Iter_With_Files --
--------------------------
procedure Fill_Iter_With_Files
(Model : Gtk_Tree_Store;
Iter : in out Gtk_Tree_Iter;
Sibling : in out Gtk_Tree_Iter;
Prj_Node : Project_Access;
File_Node : File_Access;
Bin_Mode : Boolean := False) is
begin
if File_Node.Analysis_Data.Coverage_Data /= null
and then File_Node.Analysis_Data.Coverage_Data.Is_Valid
then
Insert_After (Model, Iter, Null_Iter, Sibling);
Sibling := Iter;
else
Append (Model, Iter, Null_Iter);
end if;
Set_Columns_Values
(Model, Iter,
Icon => File_Pixbuf_Cst,
Name => GNATCOLL.VFS.Display_Base_Name (File_Node.Name),
Node => File_Node.all'Address,
File => File_Node.all'Address,
Prjoject => Prj_Node.all'Address);
Fill_Iter (Model, Iter, File_Node.Analysis_Data, Bin_Mode);
end Fill_Iter_With_Files;
--------------------------------
-- Fill_Iter_With_Subprograms --
--------------------------------
procedure Fill_Iter_With_Subprograms
(Model : Gtk_Tree_Store;
Iter : in out Gtk_Tree_Iter;
Prj_Node : Project_Access;
File_Node : File_Access;
Bin_Mode : Boolean := False)
is
use Subprogram_Maps;
Map_Cur : Subprogram_Maps.Cursor := File_Node.Subprograms.First
|
{
"pile_set_name": "Github"
}
|
{
"name": "flipCounter",
"filename": "jquery.flipCounter.pack.js",
"version": "1.2",
"description": "Uses valid markup and an image sprite to render an analogue clock / odometer effect. Clock image is easily customizable, default options can be easily overriden, can be easily animated and extended with jQuery.easing plugin, gracefully degrades if Javascript is not available.",
"keywords": [
"flipcounter",
"number",
"end_number",
"easing",
"duration"
],
"homepage": "http://bloggingsquared.com/jquery/flipcounter/",
"author": {
"name": "Brolly.ca",
"email": "info@brolly.ca"
}
}
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.