text
stringlengths
2
100k
meta
dict
<?php /* * Copyright 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ /** * The "accountUserProfiles" collection of methods. * Typical usage is: * <code> * $dfareportingService = new Google_Service_Dfareporting(...); * $accountUserProfiles = $dfareportingService->accountUserProfiles; * </code> */ class Google_Service_Dfareporting_Resource_AccountUserProfiles extends Google_Service_Resource { /** * Gets one account user profile by ID. (accountUserProfiles.get) * * @param string $profileId User profile ID associated with this request. * @param string $id User profile ID. * @param array $optParams Optional parameters. * @return Google_Service_Dfareporting_AccountUserProfile */ public function get($profileId, $id, $optParams = array()) { $params = array('profileId' => $profileId, 'id' => $id); $params = array_merge($params, $optParams); return $this->call('get', array($params), "Google_Service_Dfareporting_AccountUserProfile"); } /** * Inserts a new account user profile. (accountUserProfiles.insert) * * @param string $profileId User profile ID associated with this request. * @param Google_Service_Dfareporting_AccountUserProfile $postBody * @param array $optParams Optional parameters. * @return Google_Service_Dfareporting_AccountUserProfile */ public function insert($profileId, Google_Service_Dfareporting_AccountUserProfile $postBody, $optParams = array()) { $params = array('profileId' => $profileId, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('insert', array($params), "Google_Service_Dfareporting_AccountUserProfile"); } /** * Retrieves a list of account user profiles, possibly filtered. This method * supports paging. (accountUserProfiles.listAccountUserProfiles) * * @param string $profileId User profile ID associated with this request. * @param array $optParams Optional parameters. * * @opt_param string userRoleId Select only user profiles with the specified * user role ID. * @opt_param string pageToken Value of the nextPageToken from the previous * result page. * @opt_param string ids Select only user profiles with these IDs. * @opt_param string sortOrder Order of sorted results. * @opt_param string subaccountId Select only user profiles with the specified * subaccount ID. * @opt_param string sortField Field by which to sort the list. * @opt_param bool active Select only active user profiles. * @opt_param int maxResults Maximum number of results to return. * @opt_param string searchString Allows searching for objects by name, ID or * email. Wildcards (*) are allowed. For example, "user profile*2015" will * return objects with names like "user profile June 2015", "user profile April * 2015", or simply "user profile 2015". Most of the searches also add wildcards * implicitly at the start and the end of the search string. For example, a * search string of "user profile" will match objects with name "my user * profile", "user profile 2015", or simply "user profile". * @return Google_Service_Dfareporting_AccountUserProfilesListResponse */ public function listAccountUserProfiles($profileId, $optParams = array()) { $params = array('profileId' => $profileId); $params = array_merge($params, $optParams); return $this->call('list', array($params), "Google_Service_Dfareporting_AccountUserProfilesListResponse"); } /** * Updates an existing account user profile. This method supports patch * semantics. (accountUserProfiles.patch) * * @param string $profileId User profile ID associated with this request. * @param Google_Service_Dfareporting_AccountUserProfile $postBody * @param array $optParams Optional parameters. * * @opt_param string id AccountUserProfile ID. * @return Google_Service_Dfareporting_AccountUserProfile */ public function patch($profileId, Google_Service_Dfareporting_AccountUserProfile $postBody, $optParams = array()) { $params = array('profileId' => $profileId, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('patch', array($params), "Google_Service_Dfareporting_AccountUserProfile"); } /** * Updates an existing account user profile. (accountUserProfiles.update) * * @param string $profileId User profile ID associated with this request. * @param Google_Service_Dfareporting_AccountUserProfile $postBody * @param array $optParams Optional parameters. * @return Google_Service_Dfareporting_AccountUserProfile */ public function update($profileId, Google_Service_Dfareporting_AccountUserProfile $postBody, $optParams = array()) { $params = array('profileId' => $profileId, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('update', array($params), "Google_Service_Dfareporting_AccountUserProfile"); } }
{ "pile_set_name": "Github" }
// This file is part of Poseidon. // Copyleft 2020, LH_Mouse. All wrongs reserved. #include "../precompiled.hpp" #include "worker_pool.hpp" #include "main_config.hpp" #include "../core/abstract_async_job.hpp" #include "../core/config_file.hpp" #include "../utilities.hpp" namespace poseidon { namespace { size_t do_get_size_config(const Config_File& file, const char* name, long max, size_t def) { const auto qval = file.get_int64_opt({"worker",name}); if(!qval) return def; int64_t rval = ::rocket::clamp(*qval, 1, max); if(*qval != rval) POSEIDON_LOG_WARN("Config value `worker.poll.$1` truncated to `$2`\n" "[value `$3` out of range]", name, rval, *qval); return static_cast<size_t>(rval); } struct Worker { once_flag init_once; ::pthread_t thread; mutable simple_mutex queue_mutex; condition_variable queue_avail; ::std::deque<rcptr<Abstract_Async_Job>> queue; }; } // namespace POSEIDON_STATIC_CLASS_DEFINE(Worker_Pool) { // constant data ::std::vector<Worker> m_workers; static void do_worker_init_once(Worker* qwrk) { size_t index = static_cast<size_t>(qwrk - self->m_workers.data()); auto name = format_string("worker $1", index); POSEIDON_LOG_INFO("Creating new worker thread: $1", name); simple_mutex::unique_lock lock(qwrk->queue_mutex); qwrk->thread = create_daemon_thread<do_worker_thread_loop>(name.c_str(), qwrk); } static void do_worker_thread_loop(void* param) { auto qwrk = static_cast<Worker*>(param); rcptr<Abstract_Async_Job> job; // Await a job and pop it. simple_mutex::unique_lock lock(qwrk->queue_mutex); for(;;) { job.reset(); if(qwrk->queue.empty()) { // Wait until an element becomes available. qwrk->queue_avail.wait(lock); continue; } // Pop it. job = ::std::move(qwrk->queue.front()); qwrk->queue.pop_front(); if(job->m_zombie.load()) { // Delete this job asynchronously. POSEIDON_LOG_DEBUG("Shut down asynchronous job: $1", job); continue; } if(job.unique() && !job->m_resident.load()) { // Delete this job when no other reference of it exists. POSEIDON_LOG_DEBUG("Killed orphan asynchronous job: $1", job); continue; } // Use it. break; } lock.unlock(); // Execute the job. ROCKET_ASSERT(job->state() == async_state_pending); job->m_state.store(async_state_running); POSEIDON_LOG_TRACE("Starting execution of asynchronous job `$1`", job); try { job->do_execute(); } catch(exception& stdex) { POSEIDON_LOG_WARN("Caught an exception thrown from asynchronous job:\n" "$1\n" "[job class `$2`]", stdex, typeid(*job)); } ROCKET_ASSERT(job->state() == async_state_running); job->m_state.store(async_state_finished); POSEIDON_LOG_TRACE("Finished execution of asynchronous job `$1`", job); } }; void Worker_Pool:: reload() { // Load worker settings into temporary objects. auto file = Main_Config::copy(); size_t thread_count = do_get_size_config(file, "thread_count", 256, 1); // Create the pool without creating threads. // Note the pool cannot be resized, so we only have to do this once. // No locking is needed. if(self->m_workers.empty()) self->m_workers = ::std::vector<Worker>(thread_count); } size_t Worker_Pool:: thread_count() noexcept { return self->m_workers.size(); } rcptr<Abstract_Async_Job> Worker_Pool:: insert(uptr<Abstract_Async_Job>&& ujob) { // Take ownership of `ujob`. rcptr<Abstract_Async_Job> job(ujob.release()); if(!job) POSEIDON_THROW("Null job pointer not valid"); if(!job.unique()) POSEIDON_THROW("Job pointer must be unique"); // Assign the job to a worker. if(self->m_workers.empty()) POSEIDON_THROW("No worker available"); auto qwrk = ::rocket::get_probing_origin(self->m_workers.data(), self->m_workers.data() + self->m_workers.size(), job->m_key); // Initialize the worker as necessary. qwrk->init_once.call(self->do_worker_init_once, qwrk); // Perform some initialization. No locking is needed here. job->m_state.store(async_state_pending); // Insert the job. simple_mutex::unique_lock lock(qwrk->queue_mutex); qwrk->queue.emplace_back(job); qwrk->queue_avail.notify_one(); return job; } } // namespace poseidon
{ "pile_set_name": "Github" }
// This is the SIP interface definition for the QJsonObject mapped type. // // Copyright (c) 2018 Riverbank Computing Limited <[email protected]> // // This file is part of PyQt5. // // This file may be used under the terms of the GNU General Public License // version 3.0 as published by the Free Software Foundation and appearing in // the file LICENSE included in the packaging of this file. Please review the // following information to ensure the GNU General Public License version 3.0 // requirements will be met: http://www.gnu.org/copyleft/gpl.html. // // If you do not wish to use this file under the terms of the GPL version 3.0 // then you may purchase a commercial license. For more information contact // [email protected]. // // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. %MappedType QJsonObject /TypeHint="Dict[QString, QJsonValue]", TypeHintValue="{}"/ { %TypeHeaderCode #include <qjsonobject.h> %End %ConvertFromTypeCode PyObject *d = PyDict_New(); if (!d) return 0; QJsonObject::const_iterator it = sipCpp->constBegin(); QJsonObject::const_iterator end = sipCpp->constEnd(); while (it != end) { QString *k = new QString(it.key()); PyObject *kobj = sipConvertFromNewType(k, sipType_QString, sipTransferObj); if (!kobj) { delete k; Py_DECREF(d); return 0; } QJsonValue *v = new QJsonValue(it.value()); PyObject *vobj = sipConvertFromNewType(v, sipType_QJsonValue, sipTransferObj); if (!vobj) { delete v; Py_DECREF(kobj); Py_DECREF(d); return 0; } int rc = PyDict_SetItem(d, kobj, vobj); Py_DECREF(vobj); Py_DECREF(kobj); if (rc < 0) { Py_DECREF(d); return 0; } ++it; } return d; %End %ConvertToTypeCode if (!sipIsErr) return PyDict_Check(sipPy); QJsonObject *jo = new QJsonObject; Py_ssize_t pos = 0; PyObject *kobj, *vobj; while (PyDict_Next(sipPy, &pos, &kobj, &vobj)) { int kstate; QString *k = reinterpret_cast<QString *>( sipForceConvertToType(kobj, sipType_QString, sipTransferObj, SIP_NOT_NONE, &kstate, sipIsErr)); if (*sipIsErr) { PyErr_Format(PyExc_TypeError, "a key has type '%s' but 'str' is expected", sipPyTypeName(Py_TYPE(kobj))); delete jo; return 0; } int vstate; QJsonValue *v = reinterpret_cast<QJsonValue *>( sipForceConvertToType(vobj, sipType_QJsonValue, sipTransferObj, SIP_NOT_NONE, &vstate, sipIsErr)); if (*sipIsErr) { PyErr_Format(PyExc_TypeError, "a value has type '%s' but 'QJsonValue' is expected", sipPyTypeName(Py_TYPE(vobj))); sipReleaseType(k, sipType_QString, kstate); delete jo; return 0; } jo->insert(*k, *v); sipReleaseType(v, sipType_QJsonValue, vstate); sipReleaseType(k, sipType_QString, kstate); } *sipCppPtr = jo; return sipGetState(sipTransferObj); %End };
{ "pile_set_name": "Github" }
//============================================================================ #pragma once #include "Point2.h" #include "ColorRgba.h" //============================================================================ namespace Javelin { //============================================================================ class PvrTcDecoder { public: static void DecodeRgb4Bpp(ColorRgb<unsigned char>* result, const Point2<int>& size, const void* data); static void DecodeRgba4Bpp(ColorRgba<unsigned char>* result, const Point2<int>& size, const void* data); private: static unsigned GetMortonNumber(int x, int y); }; //============================================================================ } //============================================================================
{ "pile_set_name": "Github" }
<?php /* DOMpdf had a security issue reported with it. Since Bamboo does not use the vulnerable file (this one) I've simply opted to replace it with this blank file. This way, users who are upgrading from earlier versions will replace the vulnerable file with this one... and be none-the-wiser. How sneaky of me! Reference at http://www.digitaljunkies.ca/dompdf/ */ ?>
{ "pile_set_name": "Github" }
#version 410 core layout(triangles) in; // Create as the outcome a line loop layout(line_strip, max_vertices = 4) out; void main(void) { for(int i = 0; i < gl_in.length(); ++i) { gl_Position = gl_in[i].gl_Position; EmitVertex(); } // This closes the the triangle gl_Position = gl_in[0].gl_Position; EmitVertex(); EndPrimitive(); }
{ "pile_set_name": "Github" }
We expect that the content of this directory is: - cpachecker.jar - the "lib" directory of CPAChecker
{ "pile_set_name": "Github" }
/*! @Name:layer mobile v2.0.0 弹层组件移动版 @Author:贤心 @Site:http://layer.layui.com/mobie/ @License:MIT */ layui.define(function(exports){ "use strict"; var win = window, doc = document, query = 'querySelectorAll', claname = 'getElementsByClassName', S = function(s){ return doc[query](s); }; //默认配置 var config = { type: 0 ,shade: true ,shadeClose: true ,fixed: true ,anim: 'scale' //默认动画类型 }; var ready = { extend: function(obj){ var newobj = JSON.parse(JSON.stringify(config)); for(var i in obj){ newobj[i] = obj[i]; } return newobj; }, timer: {}, end: {} }; //点触事件 ready.touch = function(elem, fn){ elem.addEventListener('click', function(e){ fn.call(this, e); }, false); }; var index = 0, classs = ['layui-m-layer'], Layer = function(options){ var that = this; that.config = ready.extend(options); that.view(); }; Layer.prototype.view = function(){ var that = this, config = that.config, layerbox = doc.createElement('div'); that.id = layerbox.id = classs[0] + index; layerbox.setAttribute('class', classs[0] + ' ' + classs[0]+(config.type || 0)); layerbox.setAttribute('index', index); //标题区域 var title = (function(){ var titype = typeof config.title === 'object'; return config.title ? '<h3 style="'+ (titype ? config.title[1] : '') +'">'+ (titype ? config.title[0] : config.title) +'</h3>' : ''; }()); //按钮区域 var button = (function(){ typeof config.btn === 'string' && (config.btn = [config.btn]); var btns = (config.btn || []).length, btndom; if(btns === 0 || !config.btn){ return ''; } btndom = '<span yes type="1">'+ config.btn[0] +'</span>' if(btns === 2){ btndom = '<span no type="0">'+ config.btn[1] +'</span>' + btndom; } return '<div class="layui-m-layerbtn">'+ btndom + '</div>'; }()); if(!config.fixed){ config.top = config.hasOwnProperty('top') ? config.top : 100; config.style = config.style || ''; config.style += ' top:'+ ( doc.body.scrollTop + config.top) + 'px'; } if(config.type === 2){ config.content = '<i></i><i class="layui-m-layerload"></i><i></i><p>'+ (config.content||'') +'</p>'; } if(config.skin) config.anim = 'up'; if(config.skin === 'msg') config.shade = false; layerbox.innerHTML = (config.shade ? '<div '+ (typeof config.shade === 'string' ? 'style="'+ config.shade +'"' : '') +' class="layui-m-layershade"></div>' : '') +'<div class="layui-m-layermain" '+ (!config.fixed ? 'style="position:static;"' : '') +'>' +'<div class="layui-m-layersection">' +'<div class="layui-m-layerchild '+ (config.skin ? 'layui-m-layer-' + config.skin + ' ' : '') + (config.className ? config.className : '') + ' ' + (config.anim ? 'layui-m-anim-' + config.anim : '') +'" ' + ( config.style ? 'style="'+config.style+'"' : '' ) +'>' + title +'<div class="layui-m-layercont">'+ config.content +'</div>' + button +'</div>' +'</div>' +'</div>'; if(!config.type || config.type === 2){ var dialogs = doc[claname](classs[0] + config.type), dialen = dialogs.length; if(dialen >= 1){ layer.close(dialogs[0].getAttribute('index')) } } document.body.appendChild(layerbox); var elem = that.elem = S('#'+that.id)[0]; config.success && config.success(elem); that.index = index++; that.action(config, elem); }; Layer.prototype.action = function(config, elem){ var that = this; //自动关闭 if(config.time){ ready.timer[that.index] = setTimeout(function(){ layer.close(that.index); }, config.time*1000); } //确认取消 var btn = function(){ var type = this.getAttribute('type'); if(type == 0){ config.no && config.no(); layer.close(that.index); } else { config.yes ? config.yes(that.index) : layer.close(that.index); } }; if(config.btn){ var btns = elem[claname]('layui-m-layerbtn')[0].children, btnlen = btns.length; for(var ii = 0; ii < btnlen; ii++){ ready.touch(btns[ii], btn); } } //点遮罩关闭 if(config.shade && config.shadeClose){ var shade = elem[claname]('layui-m-layershade')[0]; ready.touch(shade, function(){ layer.close(that.index, config.end); }); } config.end && (ready.end[that.index] = config.end); }; var layer = { v: '2.0 m', index: index, //核心方法 open: function(options){ var o = new Layer(options || {}); return o.index; }, close: function(index){ var ibox = S('#'+classs[0]+index)[0]; if(!ibox) return; ibox.innerHTML = ''; doc.body.removeChild(ibox); clearTimeout(ready.timer[index]); delete ready.timer[index]; typeof ready.end[index] === 'function' && ready.end[index](); delete ready.end[index]; }, //关闭所有layer层 closeAll: function(){ var boxs = doc[claname](classs[0]); for(var i = 0, len = boxs.length; i < len; i++){ layer.close((boxs[0].getAttribute('index')|0)); } } }; exports('layer-mobile', layer); });
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false"> <item android:drawable="@drawable/widget_location_sharing_day" android:duration="500" /> <item android:drawable="@drawable/widget_location_sharing_off_day" android:duration="500" /> </animation-list>
{ "pile_set_name": "Github" }
%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!1 &4724769416699403879 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 4724769416698970759} - component: {fileID: 4724769416696070757} - component: {fileID: 4724769416697200805} - component: {fileID: 4724769416699403876} m_Layer: 11 m_Name: mesh m_TagString: SimObjPhysics m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 --- !u!4 &4724769416698970759 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4724769416699403879} m_LocalRotation: {x: -1.2246469e-16, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.01, y: -0.067, z: 0.013} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9094620089624040116} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!33 &4724769416696070757 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4724769416699403879} m_Mesh: {fileID: 4300268, guid: a31914cd7d4a11f429bd3c0cfa659133, type: 3} --- !u!23 &4724769416697200805 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4724769416699403879} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 0ee5dc5dfb839a9469aee39e98202154, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 --- !u!64 &4724769416699403876 MeshCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4724769416699403879} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 3 m_Convex: 0 m_CookingOptions: 14 m_Mesh: {fileID: 4300268, guid: a31914cd7d4a11f429bd3c0cfa659133, type: 3} --- !u!1 &9095128290941338276 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128290941338277} m_Layer: 8 m_Name: vPoint (5) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128290941338277 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128290941338276} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.049, y: 0.05, z: -0.004} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9095128292641216375} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9095128291240147698 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128291240147699} m_Layer: 8 m_Name: vPoint (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128291240147699 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128291240147698} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.284, y: 0.14700001, z: -0.313} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9095128292641216375} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9095128291269080193 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128291269080198} - component: {fileID: 9095128291269080196} - component: {fileID: 9095128291269080199} m_Layer: 8 m_Name: Sink_14 m_TagString: SimObjPhysics m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128291269080198 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128291269080193} m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068} m_LocalPosition: {x: -2.723265, y: 0.8620176, z: 2.2319999} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 9095128291230630990} - {fileID: 9094620089624040116} - {fileID: 9095128292641216375} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &9095128291269080196 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128291269080193} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: b439f6e4ef5714ee2a3643acf37b7a9d, type: 3} m_Name: m_EditorClassIdentifier: uniqueID: Sink|-02.72|+00.86|+02.23 Type: 7 PrimaryProperty: 1 SecondaryProperties: BoundingBox: {fileID: 0} VisibilityPoints: - {fileID: 9095128291303422059} - {fileID: 9095128291276539994} - {fileID: 9095128291240147699} - {fileID: 9095128292496581905} - {fileID: 9095128292119434183} - {fileID: 9095128290941338277} ReceptacleTriggerBoxes: [] isVisible: 0 isInteractable: 0 isInAgentHand: 0 MyColliders: [] HFdynamicfriction: 0 HFstaticfriction: 0 HFbounciness: 0 HFrbdrag: 0 HFrbangulardrag: 0 salientMaterials: CurrentTemperature: 0 HowManySecondsUntilRoomTemp: 10 inMotion: 0 lastVelocity: 0 ContainedObjectReferences: [] --- !u!54 &9095128291269080199 Rigidbody: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128291269080193} serializedVersion: 2 m_Mass: 1 m_Drag: 0 m_AngularDrag: 0.05 m_UseGravity: 1 m_IsKinematic: 1 m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 --- !u!1 &9095128291276539989 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128291276539994} m_Layer: 8 m_Name: vPoint (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128291276539994 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128291276539989} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.284, y: 0.14700001, z: 0.313} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9095128292641216375} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9095128291303422058 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128291303422059} m_Layer: 8 m_Name: vPoint m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128291303422059 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128291303422058} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.284, y: 0.147, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9095128292641216375} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9095128292119434182 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128292119434183} m_Layer: 8 m_Name: vPoint (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128292119434183 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128292119434182} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.14, y: 0.14700001, z: 0.315} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9095128292641216375} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9095128292273985147 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 1386688140836170, guid: 43a08c524f4dd5a448547e12944b6bdf, type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128291230630990} - component: {fileID: 9095128292273985150} - component: {fileID: 9095128292273985145} - component: {fileID: 9095128292273985144} m_Layer: 8 m_Name: sink_14 m_TagString: SimObjPhysics m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128291230630990 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 4414527080787468, guid: 43a08c524f4dd5a448547e12944b6bdf, type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128292273985147} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9095128291269080198} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!33 &9095128292273985150 MeshFilter: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 33416735864456030, guid: 43a08c524f4dd5a448547e12944b6bdf, type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128292273985147} m_Mesh: {fileID: 4300106, guid: a31914cd7d4a11f429bd3c0cfa659133, type: 3} --- !u!23 &9095128292273985145 MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 23613202885598494, guid: 43a08c524f4dd5a448547e12944b6bdf, type: 3} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128292273985147} m_Enabled: 1 m_CastShadows: 1 m_ReceiveShadows: 1 m_DynamicOccludee: 1 m_MotionVectors: 1 m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: - {fileID: 2100000, guid: 63af714b056b0c142abc9b7248abe444, type: 2} - {fileID: 2100000, guid: b9e306ea34bc0a74fb7ebc2d046e4245, type: 2} - {fileID: 2100000, guid: 582447bdbce1f064e8f1d1651612a813, type: 2} m_StaticBatchInfo: firstSubMesh: 0 subMeshCount: 0 m_StaticBatchRoot: {fileID: 0} m_ProbeAnchor: {fileID: 0} m_LightProbeVolumeOverride: {fileID: 0} m_ScaleInLightmap: 1 m_PreserveUVs: 0 m_IgnoreNormalsForChartDetection: 0 m_ImportantGI: 0 m_StitchLightmapSeams: 0 m_SelectedEditorRenderState: 3 m_MinimumChartSize: 4 m_AutoUVMaxDistance: 0.5 m_AutoUVMaxAngle: 89 m_LightmapParameters: {fileID: 0} m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 --- !u!64 &9095128292273985144 MeshCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128292273985147} m_Material: {fileID: 0} m_IsTrigger: 0 m_Enabled: 1 serializedVersion: 3 m_Convex: 0 m_CookingOptions: 14 m_Mesh: {fileID: 4300106, guid: a31914cd7d4a11f429bd3c0cfa659133, type: 3} --- !u!1 &9095128292496581904 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128292496581905} m_Layer: 8 m_Name: vPoint (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128292496581905 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128292496581904} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.139, y: 0.14700001, z: -0.319} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9095128292641216375} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9095128292641216374 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9095128292641216375} m_Layer: 0 m_Name: VisibilityPoints m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9095128292641216375 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9095128292641216374} m_LocalRotation: {x: -0, y: -0.7071068, z: -0, w: 0.7071068} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1.0000002, y: 1, z: 1.0000002} m_Children: - {fileID: 9095128291303422059} - {fileID: 9095128291276539994} - {fileID: 9095128291240147699} - {fileID: 9095128292496581905} - {fileID: 9095128292119434183} - {fileID: 9095128290941338277} m_Father: {fileID: 9095128291269080198} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096040850353412914 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094620089624040116} - component: {fileID: 9200785450398561156} - component: {fileID: 9149405269608677534} m_Layer: 8 m_Name: SinkBasin m_TagString: SimObjPhysics m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094620089624040116 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096040850353412914} m_LocalRotation: {x: 1.2246469e-16, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.01, y: 0.067, z: -0.013} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: - {fileID: 9094458236168572790} - {fileID: 9090656023916131700} - {fileID: 9090691917715762590} - {fileID: 9094960550666772362} - {fileID: 4724769416698970759} m_Father: {fileID: 9095128291269080198} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!114 &9200785450398561156 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096040850353412914} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: b439f6e4ef5714ee2a3643acf37b7a9d, type: 3} m_Name: m_EditorClassIdentifier: uniqueID: Sink|-02.72|+00.86|+02.23|SinkBasin Type: 137 PrimaryProperty: 1 SecondaryProperties: 07000000 BoundingBox: {fileID: 0} VisibilityPoints: - {fileID: 9090693400763850456} - {fileID: 9094460286309767680} - {fileID: 9090807981294694688} - {fileID: 9090730846295885730} - {fileID: 9090808309005775672} - {fileID: 9090529704029142842} - {fileID: 9094503433962174686} - {fileID: 9094493064271809368} - {fileID: 9094943083490255002} ReceptacleTriggerBoxes: - {fileID: 9096758767573344208} isVisible: 0 isInteractable: 0 isInAgentHand: 0 MyColliders: [] HFdynamicfriction: 0 HFstaticfriction: 0 HFbounciness: 0 HFrbdrag: 0 HFrbangulardrag: 0 salientMaterials: CurrentTemperature: 0 HowManySecondsUntilRoomTemp: 10 inMotion: 0 lastVelocity: 0 ContainedObjectReferences: [] --- !u!54 &9149405269608677534 Rigidbody: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096040850353412914} serializedVersion: 2 m_Mass: 1 m_Drag: 0 m_AngularDrag: 0.05 m_UseGravity: 1 m_IsKinematic: 1 m_Interpolate: 0 m_Constraints: 0 m_CollisionDetection: 0 --- !u!1 &9096063694118127430 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9090730846295885730} m_Layer: 8 m_Name: vPoint (3) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9090730846295885730 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096063694118127430} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.016999876, y: 0.05190006, z: -0.40360016} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096231452568152296 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094493064271809368} m_Layer: 8 m_Name: vPoint (7) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094493064271809368 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096231452568152296} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.477, y: -0.111800045, z: -7.481754e-24} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096546292163779022 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9090656023916131700} m_Layer: 0 m_Name: Colliders m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9090656023916131700 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096546292163779022} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.000000010244548, y: 0.05988452, z: -0.000000013969839} m_LocalScale: {x: 0.5988194, y: 0.6212386, z: 0.20833619} m_Children: [] m_Father: {fileID: 9094620089624040116} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096558959657900644 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9090529704029142842} m_Layer: 8 m_Name: vPoint (5) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9090529704029142842 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096558959657900644} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.46199998, y: 0.05150006, z: -0.40360016} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096578988414107180 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094943083490255002} m_Layer: 8 m_Name: vPoint (8) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094943083490255002 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096578988414107180} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.463, y: -0.108300045, z: -7.481754e-24} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 8 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096587062693359620 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9090807981294694688} m_Layer: 8 m_Name: vPoint (2) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9090807981294694688 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096587062693359620} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.016999958, y: 0.041500077, z: 0.42519993} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096632553687025496 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094960550666772362} m_Layer: 0 m_Name: VisibilityPoints m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094960550666772362 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096632553687025496} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.000000010244548, y: 0.09597847, z: -0.000000013969839} m_LocalScale: {x: 0.5988194, y: 0.6212386, z: 0.20833619} m_Children: - {fileID: 9090693400763850456} - {fileID: 9094460286309767680} - {fileID: 9090807981294694688} - {fileID: 9090730846295885730} - {fileID: 9090808309005775672} - {fileID: 9090529704029142842} - {fileID: 9094503433962174686} - {fileID: 9094493064271809368} - {fileID: 9094943083490255002} m_Father: {fileID: 9094620089624040116} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096639516185484484 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9090691917715762590} m_Layer: 0 m_Name: TriggerColliders m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9090691917715762590 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096639516185484484} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.000000010244548, y: 0.05988452, z: -0.000000013969839} m_LocalScale: {x: 0.5988194, y: 0.6212386, z: 0.20833619} m_Children: - {fileID: 9094951811476644890} m_Father: {fileID: 9094620089624040116} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096700873267893898 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094951811476644890} - component: {fileID: 9138184215731792134} m_Layer: 8 m_Name: Col m_TagString: SimObjPhysics m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094951811476644890 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096700873267893898} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.018000007, y: -0.0952, z: 0} m_LocalScale: {x: 1, y: 0.0025000072, z: 1} m_Children: [] m_Father: {fileID: 9090691917715762590} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &9138184215731792134 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096700873267893898} m_Material: {fileID: 0} m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Size: {x: 1, y: 1, z: 1} m_Center: {x: 0, y: 0, z: 0} --- !u!1 &9096727569812372274 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094460286309767680} m_Layer: 8 m_Name: vPoint (1) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094460286309767680 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096727569812372274} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: -0.47100002, y: 0.03930007, z: 0.42519993} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096758767573344208 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094458236168572790} - component: {fileID: 9138009893322207276} - component: {fileID: 9200636013402726710} m_Layer: 9 m_Name: ReceptacleTriggerBox m_TagString: Receptacle m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094458236168572790 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096758767573344208} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.010778677, y: 0.032549948, z: -0.000000013038516} m_LocalScale: {x: 0.5988194, y: 0.063987546, z: 0.20833619} m_Children: [] m_Father: {fileID: 9094620089624040116} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!65 &9138009893322207276 BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096758767573344208} m_Material: {fileID: 0} m_IsTrigger: 1 m_Enabled: 1 serializedVersion: 2 m_Size: {x: 1, y: 2.334561, z: 1} m_Center: {x: 0, y: 0.6672801, z: 0} --- !u!114 &9200636013402726710 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096758767573344208} m_Enabled: 1 m_EditorHideFlags: 0 m_Script: {fileID: 11500000, guid: 5122b08936ec54929891d19a8fac4755, type: 3} m_Name: m_EditorClassIdentifier: CurrentlyContains: [] myParent: {fileID: 9095128291269080193} occupied: 0 --- !u!1 &9096793881828443872 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9090808309005775672} m_Layer: 8 m_Name: vPoint (4) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9090808309005775672 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096793881828443872} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.454, y: 0.0523, z: -0.4036} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096945872474999650 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9094503433962174686} m_Layer: 8 m_Name: vPoint (6) m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9094503433962174686 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096945872474999650} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.022, y: -0.1133, z: -0} m_LocalScale: {x: 0.99999714, y: 1.0000008, z: 1.0000191} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &9096960038230559234 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - component: {fileID: 9090693400763850456} m_Layer: 8 m_Name: vPoint m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 64 m_IsActive: 1 --- !u!4 &9090693400763850456 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 9096960038230559234} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0.489, y: 0.0401, z: 0.4252} m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 9094960550666772362} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
{ "pile_set_name": "Github" }
.full-width { width: 100%; } .shipping-card { min-width: 120px; margin: 20px auto; } .mat-radio-button { display: block; margin: 5px 0; } .row { display: flex; flex-direction: row; } .col { flex: 1; margin-right: 20px; } .col:last-child { margin-right: 0; }
{ "pile_set_name": "Github" }
/* * GeoTools - The Open Source Java GIS Toolkit * http://geotools.org * * (C) 2019, Open Source Geospatial Foundation (OSGeo) * * 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; * version 2.1 of the License. * * 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. * */ package org.geotools.gml4wcs.bindings; import javax.xml.namespace.QName; import org.geotools.gml4wcs.GML; import org.geotools.xsd.AbstractComplexBinding; import org.geotools.xsd.ElementInstance; import org.geotools.xsd.Node; /** * Binding object for the type http://www.opengis.net/gml:AbstractGeometryBaseType. * * <p> * * <pre> * <code> * &lt;complexType abstract="true" name="AbstractGeometryBaseType"&gt; * &lt;annotation&gt; * &lt;documentation&gt;Removes name, description, and metadataLink from AbstractGMLType. &lt;/documentation&gt; * &lt;/annotation&gt; * &lt;complexContent&gt; * &lt;restriction base="gml:AbstractGMLType"/&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * * </code> * </pre> * * @generated */ public class AbstractGeometryBaseTypeBinding extends AbstractComplexBinding { /** @generated */ public QName getTarget() { return GML.AbstractGeometryBaseType; } /** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Class getType() { return null; } /** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { // TODO: implement and remove call to super return super.parse(instance, node, value); } }
{ "pile_set_name": "Github" }
module Make () = struct exception Error of Source.region * string let warn at m = prerr_endline (Source.string_of_region at ^ ": warning: " ^ m) let error at m = raise (Error (at, m)) end
{ "pile_set_name": "Github" }
using System; using System.Collections.Generic; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Media; using HandyControl.Data; namespace HandyControl.Controls { [TemplatePart(Name = ElementButtonConfirm, Type = typeof(Button))] [TemplatePart(Name = ElementClockPresenter, Type = typeof(ContentPresenter))] [TemplatePart(Name = ElementCalendarPresenter, Type = typeof(ContentPresenter))] public class CalendarWithClock : Control { #region Constants private const string ElementButtonConfirm = "PART_ButtonConfirm"; private const string ElementClockPresenter = "PART_ClockPresenter"; private const string ElementCalendarPresenter = "PART_CalendarPresenter"; #endregion Constants #region Data private ContentPresenter _clockPresenter; private ContentPresenter _calendarPresenter; private Clock _clock; private Calendar _calendar; private Button _buttonConfirm; private bool _isLoaded; private IDictionary<DependencyProperty, bool> _isHandlerSuspended; #endregion Data #region Public Events public static readonly RoutedEvent SelectedDateTimeChangedEvent = EventManager.RegisterRoutedEvent("SelectedDateTimeChanged", RoutingStrategy.Direct, typeof(EventHandler<FunctionEventArgs<DateTime?>>), typeof(CalendarWithClock)); public event EventHandler<FunctionEventArgs<DateTime?>> SelectedDateTimeChanged { add => AddHandler(SelectedDateTimeChangedEvent, value); remove => RemoveHandler(SelectedDateTimeChangedEvent, value); } public event EventHandler<FunctionEventArgs<DateTime>> DisplayDateTimeChanged; public event Action Confirmed; #endregion Public Events public CalendarWithClock() { InitCalendarAndClock(); Loaded += (s, e) => { if (_isLoaded) return; _isLoaded = true; DisplayDateTime = SelectedDateTime ?? DateTime.Now; }; } #region Public Properties public static readonly DependencyProperty DateTimeFormatProperty = DependencyProperty.Register( "DateTimeFormat", typeof(string), typeof(CalendarWithClock), new PropertyMetadata("yyyy-MM-dd HH:mm:ss")); public string DateTimeFormat { get => (string)GetValue(DateTimeFormatProperty); set => SetValue(DateTimeFormatProperty, value); } public static readonly DependencyProperty ShowConfirmButtonProperty = DependencyProperty.Register( "ShowConfirmButton", typeof(bool), typeof(CalendarWithClock), new PropertyMetadata(ValueBoxes.FalseBox)); public bool ShowConfirmButton { get => (bool)GetValue(ShowConfirmButtonProperty); set => SetValue(ShowConfirmButtonProperty, ValueBoxes.BooleanBox(value)); } public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register( "SelectedDateTime", typeof(DateTime?), typeof(CalendarWithClock), new PropertyMetadata(default(DateTime?), OnSelectedDateTimeChanged)); private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var ctl = (CalendarWithClock)d; var v = (DateTime?)e.NewValue; ctl.OnSelectedDateTimeChanged(new FunctionEventArgs<DateTime?>(SelectedDateTimeChangedEvent, ctl) { Info = v }); } public DateTime? SelectedDateTime { get => (DateTime?)GetValue(SelectedDateTimeProperty); set => SetValue(SelectedDateTimeProperty, value); } public static readonly DependencyProperty DisplayDateTimeProperty = DependencyProperty.Register( "DisplayDateTime", typeof(DateTime), typeof(CalendarWithClock), new FrameworkPropertyMetadata(DateTime.MinValue, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnDisplayDateTimeChanged)); private static void OnDisplayDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var ctl = (CalendarWithClock)d; if (ctl.IsHandlerSuspended(DisplayDateTimeProperty)) return; var v = (DateTime)e.NewValue; ctl._clock.SelectedTime = v; ctl._calendar.SelectedDate = v; ctl.OnDisplayDateTimeChanged(new FunctionEventArgs<DateTime>(v)); } public DateTime DisplayDateTime { get => (DateTime)GetValue(DisplayDateTimeProperty); set => SetValue(DisplayDateTimeProperty, value); } #endregion #region Public Methods public override void OnApplyTemplate() { if (_buttonConfirm != null) { _buttonConfirm.Click -= ButtonConfirm_OnClick; } base.OnApplyTemplate(); _buttonConfirm = GetTemplateChild(ElementButtonConfirm) as Button; _clockPresenter = GetTemplateChild(ElementClockPresenter) as ContentPresenter; _calendarPresenter = GetTemplateChild(ElementCalendarPresenter) as ContentPresenter; CheckNull(); _clockPresenter.Content = _clock; _calendarPresenter.Content = _calendar; _buttonConfirm.Click += ButtonConfirm_OnClick; } #endregion #region Protected Methods protected virtual void OnSelectedDateTimeChanged(FunctionEventArgs<DateTime?> e) => RaiseEvent(e); protected virtual void OnDisplayDateTimeChanged(FunctionEventArgs<DateTime> e) { var handler = DisplayDateTimeChanged; handler?.Invoke(this, e); } #endregion Protected Methods #region Private Methods private void SetIsHandlerSuspended(DependencyProperty property, bool value) { if (value) { if (_isHandlerSuspended == null) { _isHandlerSuspended = new Dictionary<DependencyProperty, bool>(2); } _isHandlerSuspended[property] = true; } else { _isHandlerSuspended?.Remove(property); } } private void SetValueNoCallback(DependencyProperty property, object value) { SetIsHandlerSuspended(property, true); try { SetCurrentValue(property, value); } finally { SetIsHandlerSuspended(property, false); } } private bool IsHandlerSuspended(DependencyProperty property) { return _isHandlerSuspended != null && _isHandlerSuspended.ContainsKey(property); } private void CheckNull() { if (_buttonConfirm == null || _clockPresenter == null || _calendarPresenter == null) throw new Exception(); } private void ButtonConfirm_OnClick(object sender, RoutedEventArgs e) { SelectedDateTime = DisplayDateTime; Confirmed?.Invoke(); } private void InitCalendarAndClock() { _clock = new Clock { BorderThickness = new Thickness(), Background = Brushes.Transparent }; TitleElement.SetBackground(_clock, Brushes.Transparent); _clock.DisplayTimeChanged += Clock_DisplayTimeChanged; _calendar = new Calendar { BorderThickness = new Thickness(), Background = Brushes.Transparent, Focusable = false }; TitleElement.SetBackground(_calendar, Brushes.Transparent); _calendar.SelectedDatesChanged += Calendar_SelectedDatesChanged; } private void Calendar_SelectedDatesChanged(object sender, SelectionChangedEventArgs e) { Mouse.Capture(null); UpdateDisplayTime(); } private void Clock_DisplayTimeChanged(object sender, FunctionEventArgs<DateTime> e) => UpdateDisplayTime(); private void UpdateDisplayTime() { if (_calendar.SelectedDate != null) { var date = _calendar.SelectedDate.Value; var time = _clock.DisplayTime; var result = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second); SetValueNoCallback(DisplayDateTimeProperty, result); } } #endregion } }
{ "pile_set_name": "Github" }
#ifndef __COMMON__ #define __COMMON__ #include <cuda_runtime_api.h> /* * General settings */ const int WARP_SIZE = 32; const int MAX_BLOCK_SIZE = 512; /* * Utility functions */ template <typename T> __device__ __forceinline__ T WARP_SHFL_XOR(T value, int laneMask, int width = warpSize, unsigned int mask = 0xffffffff) { #if CUDART_VERSION >= 9000 return __shfl_xor_sync(mask, value, laneMask, width); #else return __shfl_xor(value, laneMask, width); #endif } __device__ __forceinline__ int getMSB(int val) { return 31 - __clz(val); } static int getNumThreads(int nElem) { int threadSizes[5] = {32, 64, 128, 256, MAX_BLOCK_SIZE}; for (int i = 0; i != 5; ++i) { if (nElem <= threadSizes[i]) { return threadSizes[i]; } } return MAX_BLOCK_SIZE; } #endif
{ "pile_set_name": "Github" }
from django.contrib import admin # Register your models here.
{ "pile_set_name": "Github" }
#ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H #define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H #include "SparseCore" #include "OrderingMethods" #include "src/Core/util/DisableStupidWarnings.h" /** * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module * * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse. * Those solvers are accessible via the following classes: * - ConjugateGradient for selfadjoint (hermitian) matrices, * - BiCGSTAB for general square matrices. * * These iterative solvers are associated with some preconditioners: * - IdentityPreconditioner - not really useful * - DiagonalPreconditioner - also called JAcobi preconditioner, work very well on diagonal dominant matrices. * - IncompleteILUT - incomplete LU factorization with dual thresholding * * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport. * * \code * #include <Eigen/IterativeLinearSolvers> * \endcode */ #include "src/misc/Solve.h" #include "src/misc/SparseSolve.h" #include "src/IterativeLinearSolvers/IterativeSolverBase.h" #include "src/IterativeLinearSolvers/BasicPreconditioners.h" #include "src/IterativeLinearSolvers/ConjugateGradient.h" #include "src/IterativeLinearSolvers/BiCGSTAB.h" #include "src/IterativeLinearSolvers/IncompleteLUT.h" #include "src/Core/util/ReenableStupidWarnings.h" #endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import "NSObject.h" @class NFAccountProxy, NFFolder, NFNote, NSString; @protocol NFLocalToRemotePusherProtocol <NSObject> - (BOOL)deleteFolderFromRemote:(NFFolder *)arg1 fromParent:(NFFolder *)arg2 accountProxy:(NFAccountProxy *)arg3 errorIsFatal:(char *)arg4; - (BOOL)moveFolderOnRemote:(NFFolder *)arg1 toParent:(NFFolder *)arg2 originalParent:(NFFolder *)arg3 accountProxy:(NFAccountProxy *)arg4 errorIsFatal:(char *)arg5; - (BOOL)updateFolderOnRemote:(NFFolder *)arg1 inParent:(NFFolder *)arg2 accountProxy:(NFAccountProxy *)arg3 errorIsFatal:(char *)arg4; - (BOOL)addFolderToRemote:(NFFolder *)arg1 inParent:(NFFolder *)arg2 accountProxy:(NFAccountProxy *)arg3 errorIsFatal:(char *)arg4; - (BOOL)deleteNoteFromRemoteWithID:(NSString *)arg1 fromFolder:(NFFolder *)arg2 accountProxy:(NFAccountProxy *)arg3 errorIsFatal:(char *)arg4; - (BOOL)moveNoteOnRemote:(NFNote *)arg1 toFolder:(NFFolder *)arg2 originalFolder:(NFFolder *)arg3 accountProxy:(NFAccountProxy *)arg4 errorIsFatal:(char *)arg5; - (BOOL)updateNoteOnRemote:(NFNote *)arg1 inFolder:(NFFolder *)arg2 accountProxy:(NFAccountProxy *)arg3 errorIsFatal:(char *)arg4; - (BOOL)addNoteToRemote:(NFNote *)arg1 inFolder:(NFFolder *)arg2 accountProxy:(NFAccountProxy *)arg3 errorIsFatal:(char *)arg4; @end
{ "pile_set_name": "Github" }
# 03 SASS In this demo we rename our css file to scss extension and add a simple SASS variable. We will learn how to add a loader that can make the SASS preprocess and then chain it to our css / style pipe. We will start from sample _01 Styles/02 Import Bootstrap_. Summary steps: - Rename `mystyles.css` to scss. - Add some SASS specific code. - Install a SASS preprocessor loader. - Add this preprocessor to the pipe (update `webpack.config.js`). # Steps to build it ## Prerequisites Prerequisites, you will need to have nodejs installed in your computer. If you want to follow this step guides you will need to take as starting point sample _02 Import Bootstrap_. ## steps - `npm install` to install previous sample packages: ``` npm install ``` - Let's start by renaming `mystyles.css` to `mystyles.scss` - Let's open `mystyles.scss` and add some sass simple code (in this case we will create a variable that will hold a blue background, this will introduce a change into our sample app, a blue background will be displayed instead of the former red one): ### ./mystyles.scss ```diff + $blue-color: teal; .red-background { - background-color: indianred; + background-color: $blue-color; } ``` - Since we have changed the extension of the css file to scss, we have to update the `webpack.config.js` file. ### ./webpack.config.js ```diff ... module.exports = { entry: { app: './students.js', appStyles: [ - './mystyles.css', + './mystyles.scss', ], ... }, ... }; ``` - Now it's time to start with the webpack plumbing. Let's install a [sass-loader](https://github.com/webpack-contrib/sass-loader) that requires [node-sass](https://github.com/sass/node-sass) as dependency: ``` npm install sass-loader --save-dev npm install node-sass --save-dev ``` - We only need one more step. Open our `webpack.config.js` and add a new entry (scss) to the loaders that will use the just installed sass-loader. Interesting to note down: we are chaining loaders, first we preprocess the scss then with the css we obtain as result we just pass the css and styles loaders we were using before. - Important here, we need to split in two loaders, first one using `sass-loader` for appStyles and second one using previous configuration for vendorStyles: ### ./webpack.config.js ```diff ... module.exports = { ... module: { rules: [ ... { - test: /\.css$/, + test: /\.scss$/, + exclude: /node_modules/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', - use: { - loader: 'css-loader', - }, + use: [ + { loader: 'css-loader', }, + { loader: 'sass-loader', }, + ], }), }, + { + test: /\.css$/, + include: /node_modules/, + loader: ExtractTextPlugin.extract({ + fallback: 'style-loader', + use: { + loader: 'css-loader', + }, + }), + }, ... ], }, ... }; ``` - If we run our app (`npm start`), we can check that now we are getting a blue background instead of a red one. ![result](../../99%20Readme%20Resources/01%20Styles/03%20SASS/result.png) - To keep maintainable our source code, let's move files under `src` folder: - Move to `./src/averageService.js`. - Move to `./src/index.html`. - Move to `./src/mystyles.scss`. - Move to `./src/students.js`. - And update `webpack.config` to set context path over `src` folder: ### ./webpack.config.js ```diff ... module.exports = { + context: path.join(basePath, 'src'), entry: { app: './students.js', appStyles: [ './mystyles.scss', ], vendor: [ 'jquery', ], vendorStyles: [ - './node_modules/bootstrap/dist/css/bootstrap.css', + '../node_modules/bootstrap/dist/css/bootstrap.css', ], }, ... }; ```
{ "pile_set_name": "Github" }
import 'dart:async'; import 'dart:convert'; import 'dart:typed_data'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'file_translation_loader.dart'; class _CustomAssetBundle extends PlatformAssetBundle { Future<String> loadString(String key, {bool cache = true}) async { final ByteData data = await load(key); if (data == null) throw FlutterError('Unable to load asset: $key'); return utf8.decode(data.buffer.asUint8List()); } } class E2EFileTranslationLoader extends FileTranslationLoader { final bool useE2E; AssetBundle customAssetBundle = _CustomAssetBundle(); E2EFileTranslationLoader( {forcedLocale, fallbackFile = "en", basePath = "assets/flutter_i18n", useCountryCode = false, this.useE2E = true, decodeStrategies}) : super( fallbackFile: fallbackFile, basePath: basePath, useCountryCode: useCountryCode, forcedLocale: forcedLocale, decodeStrategies: decodeStrategies); Future<String> loadString(final String fileName, final String extension) { return useE2E ? customAssetBundle.loadString('$basePath/$fileName.$extension') : super.loadString(fileName, extension); } }
{ "pile_set_name": "Github" }
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying file Copyright.txt or https://cmake.org/licensing#kwsys for details. */ #ifndef testConsoleBuf_hxx #define testConsoleBuf_hxx static const wchar_t cmdConsoleBufChild[] = L"testConsoleBufChild"; static const wchar_t BeforeInputEventName[] = L"BeforeInputEvent"; static const wchar_t AfterOutputEventName[] = L"AfterOutputEvent"; // यूनिकोड είναι здорово! static const wchar_t UnicodeTestString[] = L"\u092F\u0942\u0928\u093F\u0915\u094B\u0921 " L"\u03B5\u03AF\u03BD\0\u03B1\u03B9 " L"\u0437\u0434\u043E\u0440\u043E\u0432\u043E!"; #endif
{ "pile_set_name": "Github" }
/* * @ author sessionboy * @ github https://github.com/sessionboy * @ website http://sinn.boyagirl.com * @ use 统一响应请求中间件 * @ error-data 返回错误时,可携带的数据 * @ error-msg 自定义的错误提示信息 * @ error-status 错误返回码 * @ error-errdata 可返回服务器生成的错误 * @ success-data 请求成功时响应的数据 * @ success-msg 请求成功时响应的提示信息 * @ 调用ctx.error() 响应错误 * @ 调用ctx.success() 响应成功 */ module.exports = async (ctx, next) => { ctx.error = ({ data, msg, status,error }) => { ctx.status= status||400; ctx.body = { code: -200, msg, data, error }; } ctx.success = ({ data, msg }) => { ctx.body = { code: 200, msg, data }; } await next() }
{ "pile_set_name": "Github" }
usr/share/doc-base usr/share/doc/pcp-doc usr/share/doc/pcp-doc/html usr/share/doc/pcp-doc/html/diskmodel usr/share/doc/pcp-doc/html/images usr/share/doc/pcp-doc/html/importdata usr/share/doc/pcp-doc/html/pmie usr/share/doc/pcp-doc/html/pmview usr/share/pcp/demos/tutorials
{ "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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. ****************************************************************/ package org.apache.cayenne.map.event; import java.util.EventListener; /** For managing the changes in the DbAttribute. */ public interface DbAttributeListener extends EventListener { /** Attribute property changed. */ public void dbAttributeChanged(AttributeEvent e); /** New attribute has been created/added.*/ public void dbAttributeAdded(AttributeEvent e); /** Attribute has been removed.*/ public void dbAttributeRemoved(AttributeEvent e); }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> <pkgmetadata> <maintainer type="person"> <email>[email protected]</email> <name>Matthias Maier</name> </maintainer> <longdescription> Doxygen is a tool for analyzing, documenting, and reverse-engineering source code of various languages using a variety of output formats (try it and see). Doxygen supports C++, C, Java, Objective-C, Python, IDL (Corba and Microsoft flavors) and to some extent PHP, C#, and D, as well as other languages (using additional helper tools). </longdescription> <use> <flag name="clang">support for <pkg>sys-devel/clang</pkg> assisted parsing</flag> <flag name="dot">allow to create dot graphs using <pkg>media-gfx/graphviz</pkg></flag> <flag name="doxysearch">build doxyindexer and doxysearch.cgi</flag> </use> </pkgmetadata>
{ "pile_set_name": "Github" }
<!-- ~ Copyright © 2014-2020 The Android Password Store Authors. All Rights Reserved. ~ SPDX-License-Identifier: GPL-3.0-only --> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:paddingLeft="24dp" android:paddingTop="20dp" android:paddingRight="24dp" android:paddingBottom="20dp" tools:context=".MainActivityFragment"> <androidx.appcompat.widget.AppCompatTextView android:id="@+id/passwordText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:textAppearance="?android:attr/textAppearanceMedium" android:textIsSelectable="true" /> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:baselineAligned="false" android:orientation="horizontal" android:weightSum="2"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical"> <androidx.appcompat.widget.AppCompatTextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:text="@string/pwgen_include" android:textAppearance="?android:attr/textAppearanceSmall" /> <CheckBox android:id="@+id/numerals" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pwgen_numerals" /> <CheckBox android:id="@+id/symbols" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pwgen_symbols" /> <CheckBox android:id="@+id/uppercase" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pwgen_uppercase" /> <CheckBox android:id="@+id/lowercase" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pwgen_lowercase" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:orientation="vertical"> <androidx.appcompat.widget.AppCompatTextView android:id="@+id/length" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:text="@string/pwgen_length" android:textAppearance="?android:attr/textAppearanceSmall" /> <EditText android:id="@+id/lengthNumber" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:ems="10" android:inputType="number" /> <CheckBox android:id="@+id/pronounceable" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pwgen_pronounceable" /> <CheckBox android:id="@+id/ambiguous" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/pwgen_ambiguous" /> </LinearLayout> </LinearLayout> </LinearLayout> </ScrollView>
{ "pile_set_name": "Github" }
// mksyscall.pl -dragonfly -tags dragonfly,amd64 syscall_bsd.go syscall_dragonfly.go syscall_dragonfly_amd64.go // Code generated by the command above; see README.md. DO NOT EDIT. // +build dragonfly,amd64 package unix import ( "syscall" "unsafe" ) var _ syscall.Errno // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getgroups(ngid int, gid *_Gid_t) (n int, err error) { r0, _, e1 := RawSyscall(SYS_GETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setgroups(ngid int, gid *_Gid_t) (err error) { _, _, e1 := RawSyscall(SYS_SETGROUPS, uintptr(ngid), uintptr(unsafe.Pointer(gid)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func wait4(pid int, wstatus *_C_int, options int, rusage *Rusage) (wpid int, err error) { r0, _, e1 := Syscall6(SYS_WAIT4, uintptr(pid), uintptr(unsafe.Pointer(wstatus)), uintptr(options), uintptr(unsafe.Pointer(rusage)), 0, 0) wpid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) { r0, _, e1 := Syscall(SYS_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_BIND, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error) { _, _, e1 := Syscall(SYS_CONNECT, uintptr(s), uintptr(addr), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socket(domain int, typ int, proto int) (fd int, err error) { r0, _, e1 := RawSyscall(SYS_SOCKET, uintptr(domain), uintptr(typ), uintptr(proto)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error) { _, _, e1 := Syscall6(SYS_GETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(unsafe.Pointer(vallen)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error) { _, _, e1 := Syscall6(SYS_SETSOCKOPT, uintptr(s), uintptr(level), uintptr(name), uintptr(val), uintptr(vallen), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETPEERNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error) { _, _, e1 := RawSyscall(SYS_GETSOCKNAME, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Shutdown(s int, how int) (err error) { _, _, e1 := Syscall(SYS_SHUTDOWN, uintptr(s), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func socketpair(domain int, typ int, proto int, fd *[2]int32) (err error) { _, _, e1 := RawSyscall6(SYS_SOCKETPAIR, uintptr(domain), uintptr(typ), uintptr(proto), uintptr(unsafe.Pointer(fd)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_RECVFROM, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS_SENDTO, uintptr(s), uintptr(_p0), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(addrlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func recvmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_RECVMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { r0, _, e1 := Syscall(SYS_SENDMSG, uintptr(s), uintptr(unsafe.Pointer(msg)), uintptr(flags)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func kevent(kq int, change unsafe.Pointer, nchange int, event unsafe.Pointer, nevent int, timeout *Timespec) (n int, err error) { r0, _, e1 := Syscall6(SYS_KEVENT, uintptr(kq), uintptr(change), uintptr(nchange), uintptr(event), uintptr(nevent), uintptr(unsafe.Pointer(timeout))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) { var _p0 unsafe.Pointer if len(mib) > 0 { _p0 = unsafe.Pointer(&mib[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall6(SYS___SYSCTL, uintptr(_p0), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimes(path string, timeval *[2]Timeval) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UTIMES, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func futimes(fd int, timeval *[2]Timeval) (err error) { _, _, e1 := Syscall(SYS_FUTIMES, uintptr(fd), uintptr(unsafe.Pointer(timeval)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func fcntl(fd int, cmd int, arg int) (val int, err error) { r0, _, e1 := Syscall(SYS_FCNTL, uintptr(fd), uintptr(cmd), uintptr(arg)) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func poll(fds *PollFd, nfds int, timeout int) (n int, err error) { r0, _, e1 := Syscall(SYS_POLL, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(timeout)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Madvise(b []byte, behav int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MADVISE, uintptr(_p0), uintptr(len(b)), uintptr(behav)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mlockall(flags int) (err error) { _, _, e1 := Syscall(SYS_MLOCKALL, uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mprotect(b []byte, prot int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MPROTECT, uintptr(_p0), uintptr(len(b)), uintptr(prot)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Msync(b []byte, flags int) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MSYNC, uintptr(_p0), uintptr(len(b)), uintptr(flags)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlock(b []byte) (err error) { var _p0 unsafe.Pointer if len(b) > 0 { _p0 = unsafe.Pointer(&b[0]) } else { _p0 = unsafe.Pointer(&_zero) } _, _, e1 := Syscall(SYS_MUNLOCK, uintptr(_p0), uintptr(len(b)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Munlockall() (err error) { _, _, e1 := Syscall(SYS_MUNLOCKALL, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func pipe() (r int, w int, err error) { r0, r1, e1 := RawSyscall(SYS_PIPE, 0, 0, 0) r = int(r0) w = int(r1) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func extpread(fd int, p []byte, flags int, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EXTPREAD, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_EXTPWRITE, uintptr(fd), uintptr(_p0), uintptr(len(p)), uintptr(flags), uintptr(offset), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getcwd(buf []byte) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS___GETCWD, uintptr(_p0), uintptr(len(buf)), 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Access(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_ACCESS, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Adjtime(delta *Timeval, olddelta *Timeval) (err error) { _, _, e1 := Syscall(SYS_ADJTIME, uintptr(unsafe.Pointer(delta)), uintptr(unsafe.Pointer(olddelta)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chflags(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHFLAGS, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chmod(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHMOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Chroot(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_CHROOT, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Close(fd int) (err error) { _, _, e1 := Syscall(SYS_CLOSE, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup(fd int) (nfd int, err error) { r0, _, e1 := Syscall(SYS_DUP, uintptr(fd), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Dup2(from int, to int) (err error) { _, _, e1 := Syscall(SYS_DUP2, uintptr(from), uintptr(to), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Exit(code int) { Syscall(SYS_EXIT, uintptr(code), 0, 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchdir(fd int) (err error) { _, _, e1 := Syscall(SYS_FCHDIR, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchflags(fd int, flags int) (err error) { _, _, e1 := Syscall(SYS_FCHFLAGS, uintptr(fd), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmod(fd int, mode uint32) (err error) { _, _, e1 := Syscall(SYS_FCHMOD, uintptr(fd), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FCHMODAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Flock(fd int, how int) (err error) { _, _, e1 := Syscall(SYS_FLOCK, uintptr(fd), uintptr(how), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fpathconf(fd int, name int) (val int, err error) { r0, _, e1 := Syscall(SYS_FPATHCONF, uintptr(fd), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := Syscall(SYS_FSTAT, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_FSTATAT, uintptr(fd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fstatfs(fd int, stat *Statfs_t) (err error) { _, _, e1 := Syscall(SYS_FSTATFS, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Fsync(fd int) (err error) { _, _, e1 := Syscall(SYS_FSYNC, uintptr(fd), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Ftruncate(fd int, length int64) (err error) { _, _, e1 := Syscall(SYS_FTRUNCATE, uintptr(fd), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(buf) > 0 { _p0 = unsafe.Pointer(&buf[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall6(SYS_GETDIRENTRIES, uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getdtablesize() (size int) { r0, _, _ := Syscall(SYS_GETDTABLESIZE, 0, 0, 0) size = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getegid() (egid int) { r0, _, _ := RawSyscall(SYS_GETEGID, 0, 0, 0) egid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Geteuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETEUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getgid() (gid int) { r0, _, _ := RawSyscall(SYS_GETGID, 0, 0, 0) gid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgid(pid int) (pgid int, err error) { r0, _, e1 := RawSyscall(SYS_GETPGID, uintptr(pid), 0, 0) pgid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpgrp() (pgrp int) { r0, _, _ := RawSyscall(SYS_GETPGRP, 0, 0, 0) pgrp = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpid() (pid int) { r0, _, _ := RawSyscall(SYS_GETPID, 0, 0, 0) pid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getppid() (ppid int) { r0, _, _ := RawSyscall(SYS_GETPPID, 0, 0, 0) ppid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getpriority(which int, who int) (prio int, err error) { r0, _, e1 := Syscall(SYS_GETPRIORITY, uintptr(which), uintptr(who), 0) prio = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_GETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getrusage(who int, rusage *Rusage) (err error) { _, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getsid(pid int) (sid int, err error) { r0, _, e1 := RawSyscall(SYS_GETSID, uintptr(pid), 0, 0) sid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Gettimeofday(tv *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_GETTIMEOFDAY, uintptr(unsafe.Pointer(tv)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Getuid() (uid int) { r0, _, _ := RawSyscall(SYS_GETUID, 0, 0, 0) uid = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Issetugid() (tainted bool) { r0, _, _ := Syscall(SYS_ISSETUGID, 0, 0, 0) tainted = bool(r0 != 0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kill(pid int, signum syscall.Signal) (err error) { _, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Kqueue() (fd int, err error) { r0, _, e1 := Syscall(SYS_KQUEUE, 0, 0, 0) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lchown(path string, uid int, gid int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LCHOWN, uintptr(unsafe.Pointer(_p0)), uintptr(uid), uintptr(gid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Link(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_LINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { _, _, e1 := Syscall(SYS_LISTEN, uintptr(s), uintptr(backlog), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkdir(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKDIR, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mkfifo(path string, mode uint32) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKFIFO, uintptr(unsafe.Pointer(_p0)), uintptr(mode), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Mknod(path string, mode uint32, dev int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_MKNOD, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(dev)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Nanosleep(time *Timespec, leftover *Timespec) (err error) { _, _, e1 := Syscall(SYS_NANOSLEEP, uintptr(unsafe.Pointer(time)), uintptr(unsafe.Pointer(leftover)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Open(path string, mode int, perm uint32) (fd int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_OPEN, uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(perm)) fd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Pathconf(path string, name int) (val int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } r0, _, e1 := Syscall(SYS_PATHCONF, uintptr(unsafe.Pointer(_p0)), uintptr(name), 0) val = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Readlink(path string, buf []byte) (n int, err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 unsafe.Pointer if len(buf) > 0 { _p1 = unsafe.Pointer(&buf[0]) } else { _p1 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_READLINK, uintptr(unsafe.Pointer(_p0)), uintptr(_p1), uintptr(len(buf))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rename(from string, to string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(from) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(to) if err != nil { return } _, _, e1 := Syscall(SYS_RENAME, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Revoke(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_REVOKE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Rmdir(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_RMDIR, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { r0, _, e1 := Syscall6(SYS_LSEEK, uintptr(fd), 0, uintptr(offset), uintptr(whence), 0, 0) newoffset = int64(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Select(n int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (err error) { _, _, e1 := Syscall6(SYS_SELECT, uintptr(n), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setegid(egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEGID, uintptr(egid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Seteuid(euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETEUID, uintptr(euid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setgid(gid int) (err error) { _, _, e1 := RawSyscall(SYS_SETGID, uintptr(gid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setlogin(name string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(name) if err != nil { return } _, _, e1 := Syscall(SYS_SETLOGIN, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpgid(pid int, pgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETPGID, uintptr(pid), uintptr(pgid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setpriority(which int, who int, prio int) (err error) { _, _, e1 := Syscall(SYS_SETPRIORITY, uintptr(which), uintptr(who), uintptr(prio)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setregid(rgid int, egid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREGID, uintptr(rgid), uintptr(egid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setreuid(ruid int, euid int) (err error) { _, _, e1 := RawSyscall(SYS_SETREUID, uintptr(ruid), uintptr(euid), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresgid(rgid int, egid int, sgid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESGID, uintptr(rgid), uintptr(egid), uintptr(sgid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setresuid(ruid int, euid int, suid int) (err error) { _, _, e1 := RawSyscall(SYS_SETRESUID, uintptr(ruid), uintptr(euid), uintptr(suid)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setrlimit(which int, lim *Rlimit) (err error) { _, _, e1 := RawSyscall(SYS_SETRLIMIT, uintptr(which), uintptr(unsafe.Pointer(lim)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setsid() (pid int, err error) { r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0) pid = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Settimeofday(tp *Timeval) (err error) { _, _, e1 := RawSyscall(SYS_SETTIMEOFDAY, uintptr(unsafe.Pointer(tp)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Setuid(uid int) (err error) { _, _, e1 := RawSyscall(SYS_SETUID, uintptr(uid), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Stat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Statfs(path string, stat *Statfs_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_STATFS, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Symlink(path string, link string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } var _p1 *byte _p1, err = BytePtrFromString(link) if err != nil { return } _, _, e1 := Syscall(SYS_SYMLINK, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(_p1)), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Sync() (err error) { _, _, e1 := Syscall(SYS_SYNC, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Truncate(path string, length int64) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_TRUNCATE, uintptr(unsafe.Pointer(_p0)), 0, uintptr(length)) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Umask(newmask int) (oldmask int) { r0, _, _ := Syscall(SYS_UMASK, uintptr(newmask), 0, 0) oldmask = int(r0) return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Undelete(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNDELETE, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unlink(path string) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNLINK, uintptr(unsafe.Pointer(_p0)), 0, 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Unmount(path string, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_UNMOUNT, uintptr(unsafe.Pointer(_p0)), uintptr(flags), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func write(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { _p0 = unsafe.Pointer(&p[0]) } else { _p0 = unsafe.Pointer(&_zero) } r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(_p0), uintptr(len(p))) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { r0, _, e1 := Syscall9(SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0) ret = uintptr(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func munmap(addr uintptr, length uintptr) (err error) { _, _, e1 := Syscall(SYS_MUNMAP, uintptr(addr), uintptr(length), 0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func readlen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_READ, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func writelen(fd int, buf *byte, nbuf int) (n int, err error) { r0, _, e1 := Syscall(SYS_WRITE, uintptr(fd), uintptr(unsafe.Pointer(buf)), uintptr(nbuf)) n = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func accept4(fd int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (nfd int, err error) { r0, _, e1 := Syscall6(SYS_ACCEPT4, uintptr(fd), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0) nfd = int(r0) if e1 != 0 { err = errnoErr(e1) } return } // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall6(SYS_UTIMENSAT, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(times)), uintptr(flags), 0, 0) if e1 != 0 { err = errnoErr(e1) } return }
{ "pile_set_name": "Github" }
""" Green SSL module for Python 3.2 """ import ssl as ssl_orig import socket as socket_orig import errno from ..patcher import copy_attributes from ..const import READ, WRITE from ..support import get_errno copy_attributes(ssl_orig, globals(), srckeys=dir(ssl_orig)) from ..greenio import socket SSLContext_orig = ssl_orig.SSLContext SSLSocket_orig = ssl_orig.SSLSocket __patched__ = ['SSLContext', 'SSLSocket', 'wrap_socket', 'get_server_certificate'] timeout_default = object() # define module attributes to silence IDE errors CERT_NONE = ssl_orig.CERT_NONE CERT_REQUIRED = ssl_orig.CERT_REQUIRED PROTOCOL_SSLv23 = ssl_orig.PROTOCOL_SSLv23 PROTOCOL_SSLv3 = ssl_orig.PROTOCOL_SSLv3 AF_INET = ssl_orig.AF_INET SOCK_STREAM = ssl_orig.SOCK_STREAM SOL_SOCKET = socket_orig.SOL_SOCKET SO_TYPE = socket_orig.SO_TYPE SSL_ERROR_WANT_READ = ssl_orig.SSL_ERROR_WANT_READ SSL_ERROR_WANT_WRITE = ssl_orig.SSL_ERROR_WANT_WRITE SSL_ERROR_EOF = ssl_orig.SSL_ERROR_EOF _ssl = ssl_orig._ssl socket_error = ssl_orig.socket_error SSLError = ssl_orig.SSLError timeout_exc = SSLError create_connection = socket_orig.create_connection DER_cert_to_PEM_cert = ssl_orig.DER_cert_to_PEM_cert # define exceptions for convenience _timeout_exc = SSLError('timed out') _SSLErrorReadTimeout = SSLError('The read operation timed out') _SSLErrorWriteTimeout = SSLError('The write operation timed out') _SSLErrorHandshakeTimeout = SSLError('The handshake operation timed out') class SSLContext(SSLContext_orig): def wrap_socket(self, sock, server_side=False, do_handshake_on_connect=True, suppress_ragged_eofs=True, server_hostname=None): return SSLSocket(sock=sock, server_side=server_side, do_handshake_on_connect=do_handshake_on_connect, suppress_ragged_eofs=suppress_ragged_eofs, server_hostname=server_hostname, _context=self) class SSLSocket(socket): def __init__(self, sock=None, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version=PROTOCOL_SSLv23, ca_certs=None, do_handshake_on_connect=True, family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None, suppress_ragged_eofs=True, npn_protocols=None, ciphers=None, server_hostname=None, _context=None): if _context: self.context = _context else: if server_side and not certfile: raise ValueError("certfile must be specified for server-side " "operations") if keyfile and not certfile: raise ValueError("certfile must be specified") if certfile and not keyfile: keyfile = certfile self.context = SSLContext(ssl_version) self.context.verify_mode = cert_reqs if ca_certs: self.context.load_verify_locations(ca_certs) if certfile: self.context.load_cert_chain(certfile, keyfile) if npn_protocols: self.context.set_npn_protocols(npn_protocols) if ciphers: self.context.set_ciphers(ciphers) self.keyfile = keyfile self.certfile = certfile self.cert_reqs = cert_reqs self.ssl_version = ssl_version self.ca_certs = ca_certs self.ciphers = ciphers # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get # mixed in. if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: raise NotImplementedError('only stream sockets are supported') if server_side and server_hostname: raise ValueError('server_hostname can only be specified in client mode') self.server_side = server_side self.server_hostname = server_hostname self.do_handshake_on_connect = do_handshake_on_connect self.suppress_ragged_eofs = suppress_ragged_eofs connected = False if sock is not None: socket.__init__(self, family=sock.family, type=sock.type, proto=sock.proto, fileno=sock.fileno()) self.settimeout(sock.gettimeout()) # see if it's connected try: sock.getpeername() except socket_error as e: if e.errno != errno.ENOTCONN: raise else: connected = True sock.detach() elif fileno is not None: socket.__init__(self, fileno=fileno) else: socket.__init__(self, family=family, type=type, proto=proto) self._closed = False self._sslobj = None self._connected = connected if connected: # create the SSL object try: self._sslobj = self.context._wrap_socket(self, server_side, server_hostname) if do_handshake_on_connect: timeout = self.gettimeout() if timeout == 0.0: # non-blocking raise ValueError( 'do_handshake_on_connect should not be specified for non-blocking ' 'sockets') self.do_handshake() except socket_error as x: self.close() raise x def dup(self): raise NotImplemented("Can't dup() %s instances" % self.__class__.__name__) def _checkClosed(self, msg=None): # raise an exception here if you wish to check for spurious closes pass def read(self, len=1024, buffer=None): """Read up to `len` bytes :return: read data (zero-length bytes on EOF) :rtype: bytes """ while True: try: if buffer is not None: return self._sslobj.read(len, buffer) else: return self._sslobj.read(len or 1024) except SSLError as e: if get_errno(e) == SSL_ERROR_WANT_READ: if self.timeout == 0.0: raise self._trampoline(self.fileno(), READ, timeout=self.gettimeout(), timeout_exc=_SSLErrorReadTimeout) elif get_errno(e) == SSL_ERROR_WANT_WRITE: if self.timeout == 0.0: raise # note: using _SSLErrorReadTimeout rather than _SSLErrorWriteTimeout below is # intentional self._trampoline(self.fileno(), WRITE, timeout=self.gettimeout(), timeout_exc=_SSLErrorReadTimeout) except SSLError as ex: if get_errno(e) == SSL_ERROR_EOF and self.suppress_ragged_eofs: if buffer is None: return '' else: return 0 else: raise def write(self, data): """Write DATA to the underlying SSL channel. Returns number of bytes of DATA actually transmitted.""" while True: try: return self._sslobj.write(data) except SSLError as ex: if ex.args[0] == SSL_ERROR_WANT_READ: if self.timeout == 0.0: raise self._trampoline(self.fileno(), READ, timeout=self.gettimeout(), timeout_exc=_SSLErrorWriteTimeout) elif ex.args[0] == SSL_ERROR_WANT_WRITE: if self.timeout == 0.0: raise self._trampoline(self.fileno(), WRITE, timeout=self.gettimeout(), timeout_exc=_SSLErrorWriteTimeout) else: raise def getpeercert(self, binary_form=False): """Returns a formatted version of the data in the certificate provided by the other end of the SSL channel. Return None if no certificate was provided, {} if a certificate was provided, but not validated.""" self._checkClosed() return self._sslobj.peer_certificate(binary_form) def selected_npn_protocol(self): self._checkClosed() if not self._sslobj or not _ssl.HAS_NPN: return None else: return self._sslobj.selected_npn_protocol() def cipher(self): self._checkClosed() if not self._sslobj: return None else: return self._sslobj.cipher() def compression(self): self._checkClosed() if not self._sslobj: return None else: return self._sslobj.compression() def send(self, data, flags=0, timeout=timeout_default): self._checkClosed() if timeout is timeout_default: timeout = self.timeout if self._sslobj: if flags != 0: raise ValueError('non-zero flags not allowed in calls to send() on {}' .format(self.__class__)) while True: try: return self._sslobj.write(data) except SSLError as e: if get_errno(e) == SSL_ERROR_WANT_READ: if self.timeout == 0.0: return 0 self._trampoline(self.fileno(), READ, timeout=self.gettimeout(), timeout_exc=_timeout_exc) elif get_errno(e) == SSL_ERROR_WANT_WRITE: if self.timeout == 0.0: return 0 self._trampoline(self.fileno(), WRITE, timeout=self.gettimeout(), timeout_exc=_timeout_exc) else: return socket.send(self, data, flags) def sendto(self, data, flags_or_addr, addr=None): self._checkClosed() if self._sslobj: raise ValueError('sendto not allowed on instances of %s' % self.__class__) elif addr is None: return socket.sendto(self, data, flags_or_addr) else: return socket.sendto(self, data, flags_or_addr, addr) def sendmsg(self, *args, **kwargs): # Ensure programs don't send data unencrypted if they try to # use this method. raise NotImplementedError('sendmsg not allowed on instances of %s' % self.__class__) def sendall(self, data, flags=0): self._checkClosed() if self._sslobj: if flags != 0: raise ValueError( 'non-zero flags not allowed in calls to sendall() on %s' % self.__class__) amount = len(data) count = 0 while (count < amount): v = self.send(data[count:]) count += v return amount else: return socket.sendall(self, data, flags) def recv(self, buflen=1024, flags=0): self._checkClosed() if self._sslobj: if flags != 0: raise ValueError('non-zero flags not allowed in calls to recv() on {}' .format(self.__class__)) return self.read(buflen) else: return socket.recv(self, buflen, flags) def recv_into(self, buffer, nbytes=None, flags=0): self._checkClosed() if buffer and (nbytes is None): nbytes = len(buffer) elif nbytes is None: nbytes = 1024 if self._sslobj: if flags != 0: raise ValueError( 'non-zero flags not allowed in calls to recv_into() on %s' % self.__class__) return self.read(nbytes, buffer) else: return socket.recv_into(self, buffer, nbytes, flags) def recvfrom(self, buflen=1024, flags=0): self._checkClosed() if self._sslobj: raise ValueError('recvfrom not allowed on instances of %s' % self.__class__) else: return socket.recvfrom(self, buflen, flags) def recvfrom_into(self, buffer, nbytes=None, flags=0): self._checkClosed() if self._sslobj: raise ValueError('recvfrom_into not allowed on instances of %s' % self.__class__) else: return socket.recvfrom_into(self, buffer, nbytes, flags) def recvmsg(self, *args, **kwargs): raise NotImplementedError('recvmsg not allowed on instances of %s' % self.__class__) def recvmsg_into(self, *args, **kwargs): raise NotImplementedError('recvmsg_into not allowed on instances of %s' % self.__class__) def pending(self): self._checkClosed() if self._sslobj: return self._sslobj.pending() else: return 0 def shutdown(self, how): self._checkClosed() self._sslobj = None socket.shutdown(self, how) def unwrap(self): if self._sslobj: s = self._sslobj.shutdown() self._sslobj = None return s else: raise ValueError('No SSL wrapper around ' + str(self)) def _real_close(self): self._sslobj = None # self._closed = True socket._real_close(self) def do_handshake(self): """Perform a TLS/SSL handshake.""" while True: try: return self._sslobj.do_handshake() except SSLError as e: if get_errno(e) == SSL_ERROR_WANT_READ: if self.timeout == 0.0: raise self._trampoline(self.fileno(), READ, timeout=self.gettimeout(), timeout_exc=_SSLErrorHandshakeTimeout) elif get_errno(e) == SSL_ERROR_WANT_WRITE: if self.timeout == 0.0: raise self._trampoline(self.fileno(), WRITE, timeout=self.gettimeout(), timeout_exc=_SSLErrorHandshakeTimeout) def _real_connect(self, addr, connect_ex): if self.server_side: raise ValueError("can't connect in server-side mode") # Here we assume that the socket is client-side, and not # connected at the time of the call. We connect it, then wrap it. if self._connected: raise ValueError('attempt to connect already-connected SSLSocket!') self._sslobj = self.context._wrap_socket(self, False, self.server_hostname) try: if connect_ex: rc = socket.connect_ex(self, addr) else: rc = None socket.connect(self, addr) if not rc: if self.do_handshake_on_connect: self.do_handshake() self._connected = True return rc except socket_error: self._sslobj = None raise def connect(self, addr): """Connects to remote ADDR, and then wraps the connection in an SSL channel.""" self._real_connect(addr, False) def connect_ex(self, addr): """Connects to remote ADDR, and then wraps the connection in an SSL channel.""" return self._real_connect(addr, True) def accept(self): """Accepts a new connection from a remote client, and returns a tuple containing that new connection wrapped with a server-side SSL channel, and the address of the remote client.""" newsock, addr = socket.accept(self) newsock = self.context.wrap_socket(newsock, do_handshake_on_connect=self.do_handshake_on_connect, suppress_ragged_eofs=self.suppress_ragged_eofs, server_side=True) return newsock, addr def wrap_socket(sock, keyfile=None, certfile=None, server_side=False, cert_reqs=CERT_NONE, ssl_version=PROTOCOL_SSLv23, ca_certs=None, do_handshake_on_connect=True, suppress_ragged_eofs=True, ciphers=None): return SSLSocket(sock=sock, keyfile=keyfile, certfile=certfile, server_side=server_side, cert_reqs=cert_reqs, ssl_version=ssl_version, ca_certs=ca_certs, do_handshake_on_connect=do_handshake_on_connect, suppress_ragged_eofs=suppress_ragged_eofs, ciphers=ciphers) def get_server_certificate(addr, ssl_version=PROTOCOL_SSLv3, ca_certs=None): """Retrieve the certificate from the server at the specified address, and return it as a PEM-encoded string. If 'ca_certs' is specified, validate the server cert against it. If 'ssl_version' is specified, use it in the connection attempt.""" host, port = addr if (ca_certs is not None): cert_reqs = CERT_REQUIRED else: cert_reqs = CERT_NONE s = create_connection(addr) s = wrap_socket(s, ssl_version=ssl_version, cert_reqs=cert_reqs, ca_certs=ca_certs) dercert = s.getpeercert(True) s.close() return DER_cert_to_PEM_cert(dercert)
{ "pile_set_name": "Github" }
/*============================================================================= Copyright (c) 2005-2011 Joel de Guzman Copyright (c) 2011 Thomas Heller 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_PHOENIX_SCOPE_THIS_HPP #define BOOST_PHOENIX_SCOPE_THIS_HPP #include <boost/phoenix/core/limits.hpp> #include <boost/phoenix/core/actor.hpp> #include <boost/phoenix/core/environment.hpp> #include <boost/phoenix/core/expression.hpp> #include <boost/phoenix/core/meta_grammar.hpp> #include <boost/phoenix/core/terminal.hpp> #include <boost/phoenix/scope/lambda.hpp> #include <boost/type_traits/remove_pointer.hpp> BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG( (boost)(phoenix)(this_) , (meta_grammar)(meta_grammar) , BOOST_PHOENIX_LIMIT ) namespace boost { namespace phoenix { namespace detail { /* struct infinite_recursion_detected {}; struct last_non_this_actor : proto::or_< proto::when< proto::nary_expr< proto::_ , proto::_ , proto::_ > , proto::_child_c<1> > , proto::when< proto::nary_expr< proto::_ , proto::_ , proto::_ , proto::_ > , proto::_child_c<2> > > {}; */ } struct this_eval { BOOST_PROTO_CALLABLE() template <typename Sig> struct result; template <typename This, typename A0, typename Context> struct result<This(A0, Context)> { typedef typename proto::detail::uncvref< typename result_of::env< Context >::type >::type outer_env_type; typedef typename remove_pointer< typename remove_reference< typename fusion::result_of::at_c< outer_env_type , 0 >::type >::type >::type actor_type; typedef typename result_of::eval< A0 const & , Context const & >::type a0_type; typedef vector2<actor_type const *, a0_type> inner_env_type; typedef scoped_environment< inner_env_type , outer_env_type , vector0<> , detail::map_local_index_to_tuple<> > env_type; typedef typename result_of::eval< actor_type const & , typename result_of::context< inner_env_type , typename result_of::actions< Context >::type >::type >::type type; }; template <typename A0, typename Context> typename result<this_eval(A0 const&, Context const &)>::type operator()(A0 const & a0, Context const & ctx) const { //std::cout << typeid(checker).name() << "\n"; //std::cout << typeid(checker).name() << "\n"; typedef typename proto::detail::uncvref< typename result_of::env< Context >::type >::type outer_env_type; typedef typename remove_pointer< typename remove_reference< typename fusion::result_of::at_c< outer_env_type , 0 >::type >::type >::type actor_type; typedef typename result_of::eval< A0 const & , Context const & >::type a0_type; typedef vector2<actor_type const *, a0_type> inner_env_type; typedef scoped_environment< inner_env_type , outer_env_type , vector0<> , detail::map_local_index_to_tuple<> > env_type; inner_env_type inner_env = {fusion::at_c<0>(phoenix::env(ctx)), phoenix::eval(a0, ctx)}; vector0<> locals; env_type env(inner_env, phoenix::env(ctx), locals); return phoenix::eval(*fusion::at_c<0>(phoenix::env(ctx)), phoenix::context(inner_env, phoenix::actions(ctx))); //return (*fusion::at_c<0>(phoenix::env(ctx)))(eval(a0, ctx)); } }; template <typename Dummy> struct default_actions::when<rule::this_, Dummy> : call<this_eval> {}; template <typename Dummy> struct is_nullary::when<rule::this_, Dummy> : proto::make<mpl::false_()> {}; template <typename A0> typename expression::this_<A0>::type const this_(A0 const & a0) { return expression::this_<A0>::make(a0); } }} #endif
{ "pile_set_name": "Github" }
/* * Wi-Fi Direct - P2P Device Discoverability procedure * Copyright (c) 2010, Atheros Communications * * This software may be distributed under the terms of the BSD license. * See README for more details. */ #include "includes.h" #include "common.h" #include "common/ieee802_11_defs.h" #include "p2p_i.h" #include "p2p.h" static struct wpabuf * p2p_build_dev_disc_req(struct p2p_data *p2p, struct p2p_device *go, const u8 *dev_id) { struct wpabuf *buf; u8 *len; buf = wpabuf_alloc(100); if (buf == NULL) return NULL; go->dialog_token++; if (go->dialog_token == 0) go->dialog_token = 1; p2p_buf_add_public_action_hdr(buf, P2P_DEV_DISC_REQ, go->dialog_token); len = p2p_buf_add_ie_hdr(buf); p2p_buf_add_device_id(buf, dev_id); p2p_buf_add_group_id(buf, go->info.p2p_device_addr, go->oper_ssid, go->oper_ssid_len); p2p_buf_update_ie_hdr(buf, len); return buf; } void p2p_dev_disc_req_cb(struct p2p_data *p2p, int success) { p2p_dbg(p2p, "Device Discoverability Request TX callback: success=%d", success); if (!success) { /* * Use P2P find, if needed, to find the other device or to * retry device discoverability. */ p2p_set_state(p2p, P2P_CONNECT); p2p_set_timeout(p2p, 0, 100000); return; } p2p_dbg(p2p, "GO acknowledged Device Discoverability Request - wait for response"); /* * TODO: is the remain-on-channel from Action frame TX long enough for * most cases or should we try to increase its duration and/or start * another remain-on-channel if needed once the previous one expires? */ } int p2p_send_dev_disc_req(struct p2p_data *p2p, struct p2p_device *dev) { struct p2p_device *go; struct wpabuf *req; unsigned int wait_time; go = p2p_get_device(p2p, dev->member_in_go_dev); if (go == NULL || dev->oper_freq <= 0) { p2p_dbg(p2p, "Could not find peer entry for GO and frequency to send Device Discoverability Request"); return -1; } req = p2p_build_dev_disc_req(p2p, go, dev->info.p2p_device_addr); if (req == NULL) return -1; p2p_dbg(p2p, "Sending Device Discoverability Request to GO " MACSTR " for client " MACSTR, MAC2STR(go->info.p2p_device_addr), MAC2STR(dev->info.p2p_device_addr)); p2p->pending_client_disc_go = go; os_memcpy(p2p->pending_client_disc_addr, dev->info.p2p_device_addr, ETH_ALEN); p2p->pending_action_state = P2P_PENDING_DEV_DISC_REQUEST; wait_time = 1000; if (p2p->cfg->max_listen && wait_time > p2p->cfg->max_listen) wait_time = p2p->cfg->max_listen; if (p2p_send_action(p2p, dev->oper_freq, go->info.p2p_device_addr, p2p->cfg->dev_addr, go->info.p2p_device_addr, wpabuf_head(req), wpabuf_len(req), wait_time) < 0) { p2p_dbg(p2p, "Failed to send Action frame"); wpabuf_free(req); /* TODO: how to recover from failure? */ return -1; } wpabuf_free(req); return 0; } static struct wpabuf * p2p_build_dev_disc_resp(u8 dialog_token, u8 status) { struct wpabuf *buf; u8 *len; buf = wpabuf_alloc(100); if (buf == NULL) return NULL; p2p_buf_add_public_action_hdr(buf, P2P_DEV_DISC_RESP, dialog_token); len = p2p_buf_add_ie_hdr(buf); p2p_buf_add_status(buf, status); p2p_buf_update_ie_hdr(buf, len); return buf; } void p2p_dev_disc_resp_cb(struct p2p_data *p2p, int success) { p2p_dbg(p2p, "Device Discoverability Response TX callback: success=%d", success); p2p->cfg->send_action_done(p2p->cfg->cb_ctx); } static void p2p_send_dev_disc_resp(struct p2p_data *p2p, u8 dialog_token, const u8 *addr, int freq, u8 status) { struct wpabuf *resp; resp = p2p_build_dev_disc_resp(dialog_token, status); if (resp == NULL) return; p2p_dbg(p2p, "Sending Device Discoverability Response to " MACSTR " (status %u freq %d)", MAC2STR(addr), status, freq); p2p->pending_action_state = P2P_PENDING_DEV_DISC_RESPONSE; if (p2p_send_action(p2p, freq, addr, p2p->cfg->dev_addr, p2p->cfg->dev_addr, wpabuf_head(resp), wpabuf_len(resp), 200) < 0) { p2p_dbg(p2p, "Failed to send Action frame"); } wpabuf_free(resp); } void p2p_process_dev_disc_req(struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len, int rx_freq) { struct p2p_message msg; size_t g; p2p_dbg(p2p, "Received Device Discoverability Request from " MACSTR " (freq=%d)", MAC2STR(sa), rx_freq); if (p2p_parse(data, len, &msg)) return; if (msg.dialog_token == 0) { p2p_dbg(p2p, "Invalid Dialog Token 0 (must be nonzero) in Device Discoverability Request"); p2p_send_dev_disc_resp(p2p, msg.dialog_token, sa, rx_freq, P2P_SC_FAIL_INVALID_PARAMS); p2p_parse_free(&msg); return; } if (msg.device_id == NULL) { p2p_dbg(p2p, "P2P Device ID attribute missing from Device Discoverability Request"); p2p_send_dev_disc_resp(p2p, msg.dialog_token, sa, rx_freq, P2P_SC_FAIL_INVALID_PARAMS); p2p_parse_free(&msg); return; } for (g = 0; g < p2p->num_groups; g++) { if (p2p_group_go_discover(p2p->groups[g], msg.device_id, sa, rx_freq) == 0) { p2p_dbg(p2p, "Scheduled GO Discoverability Request for the target device"); /* * P2P group code will use a callback to indicate TX * status, so that we can reply to the request once the * target client has acknowledged the request or it has * timed out. */ p2p->pending_dev_disc_dialog_token = msg.dialog_token; os_memcpy(p2p->pending_dev_disc_addr, sa, ETH_ALEN); p2p->pending_dev_disc_freq = rx_freq; p2p_parse_free(&msg); return; } } p2p_dbg(p2p, "Requested client was not found in any group or did not support client discoverability"); p2p_send_dev_disc_resp(p2p, msg.dialog_token, sa, rx_freq, P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE); p2p_parse_free(&msg); } void p2p_process_dev_disc_resp(struct p2p_data *p2p, const u8 *sa, const u8 *data, size_t len) { struct p2p_message msg; struct p2p_device *go; u8 status; p2p_dbg(p2p, "Received Device Discoverability Response from " MACSTR, MAC2STR(sa)); go = p2p->pending_client_disc_go; if (go == NULL || os_memcmp(sa, go->info.p2p_device_addr, ETH_ALEN) != 0) { p2p_dbg(p2p, "Ignore unexpected Device Discoverability Response"); return; } if (p2p_parse(data, len, &msg)) return; if (msg.status == NULL) { p2p_parse_free(&msg); return; } if (msg.dialog_token != go->dialog_token) { p2p_dbg(p2p, "Ignore Device Discoverability Response with unexpected dialog token %u (expected %u)", msg.dialog_token, go->dialog_token); p2p_parse_free(&msg); return; } status = *msg.status; p2p_parse_free(&msg); p2p_dbg(p2p, "Device Discoverability Response status %u", status); if (p2p->go_neg_peer == NULL || os_memcmp(p2p->pending_client_disc_addr, p2p->go_neg_peer->info.p2p_device_addr, ETH_ALEN) != 0 || os_memcmp(p2p->go_neg_peer->member_in_go_dev, go->info.p2p_device_addr, ETH_ALEN) != 0) { p2p_dbg(p2p, "No pending operation with the client discoverability peer anymore"); return; } if (status == 0) { /* * Peer is expected to be awake for at least 100 TU; try to * connect immediately. */ p2p_dbg(p2p, "Client discoverability request succeeded"); if (p2p->state == P2P_CONNECT) { /* * Change state to force the timeout to start in * P2P_CONNECT again without going through the short * Listen state. */ p2p_set_state(p2p, P2P_CONNECT_LISTEN); p2p->cfg->send_action_done(p2p->cfg->cb_ctx); } p2p_set_timeout(p2p, 0, 0); } else { /* * Client discoverability request failed; try to connect from * timeout. */ p2p_dbg(p2p, "Client discoverability request failed"); p2p_set_timeout(p2p, 0, 500000); } } void p2p_go_disc_req_cb(struct p2p_data *p2p, int success) { p2p_dbg(p2p, "GO Discoverability Request TX callback: success=%d", success); p2p->cfg->send_action_done(p2p->cfg->cb_ctx); if (p2p->pending_dev_disc_dialog_token == 0) { p2p_dbg(p2p, "No pending Device Discoverability Request"); return; } p2p_send_dev_disc_resp(p2p, p2p->pending_dev_disc_dialog_token, p2p->pending_dev_disc_addr, p2p->pending_dev_disc_freq, success ? P2P_SC_SUCCESS : P2P_SC_FAIL_UNABLE_TO_ACCOMMODATE); p2p->pending_dev_disc_dialog_token = 0; } void p2p_process_go_disc_req(struct p2p_data *p2p, const u8 *da, const u8 *sa, const u8 *data, size_t len, int rx_freq) { unsigned int tu; struct wpabuf *ies; p2p_dbg(p2p, "Received GO Discoverability Request - remain awake for 100 TU"); ies = p2p_build_probe_resp_ies(p2p, NULL, 0); if (ies == NULL) return; /* Remain awake 100 TU on operating channel */ p2p->pending_client_disc_freq = rx_freq; tu = 100; if (p2p->cfg->start_listen(p2p->cfg->cb_ctx, rx_freq, 1024 * tu / 1000, ies) < 0) { p2p_dbg(p2p, "Failed to start listen mode for client discoverability"); } wpabuf_free(ies); }
{ "pile_set_name": "Github" }
/** * Copyright 2013-2014 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @providesModule ReactChildren */ "use strict"; var PooledClass = require("./PooledClass"); var traverseAllChildren = require("./traverseAllChildren"); var warning = require("./warning"); var twoArgumentPooler = PooledClass.twoArgumentPooler; var threeArgumentPooler = PooledClass.threeArgumentPooler; /** * PooledClass representing the bookkeeping associated with performing a child * traversal. Allows avoiding binding callbacks. * * @constructor ForEachBookKeeping * @param {!function} forEachFunction Function to perform traversal with. * @param {?*} forEachContext Context to perform context with. */ function ForEachBookKeeping(forEachFunction, forEachContext) { this.forEachFunction = forEachFunction; this.forEachContext = forEachContext; } PooledClass.addPoolingTo(ForEachBookKeeping, twoArgumentPooler); function forEachSingleChild(traverseContext, child, name, i) { var forEachBookKeeping = traverseContext; forEachBookKeeping.forEachFunction.call( forEachBookKeeping.forEachContext, child, i); } /** * Iterates through children that are typically specified as `props.children`. * * The provided forEachFunc(child, index) will be called for each * leaf child. * * @param {?*} children Children tree container. * @param {function(*, int)} forEachFunc. * @param {*} forEachContext Context for forEachContext. */ function forEachChildren(children, forEachFunc, forEachContext) { if (children == null) { return children; } var traverseContext = ForEachBookKeeping.getPooled(forEachFunc, forEachContext); traverseAllChildren(children, forEachSingleChild, traverseContext); ForEachBookKeeping.release(traverseContext); } /** * PooledClass representing the bookkeeping associated with performing a child * mapping. Allows avoiding binding callbacks. * * @constructor MapBookKeeping * @param {!*} mapResult Object containing the ordered map of results. * @param {!function} mapFunction Function to perform mapping with. * @param {?*} mapContext Context to perform mapping with. */ function MapBookKeeping(mapResult, mapFunction, mapContext) { this.mapResult = mapResult; this.mapFunction = mapFunction; this.mapContext = mapContext; } PooledClass.addPoolingTo(MapBookKeeping, threeArgumentPooler); function mapSingleChildIntoContext(traverseContext, child, name, i) { var mapBookKeeping = traverseContext; var mapResult = mapBookKeeping.mapResult; var keyUnique = !mapResult.hasOwnProperty(name); ("production" !== process.env.NODE_ENV ? warning( keyUnique, 'ReactChildren.map(...): Encountered two children with the same key, ' + '`%s`. Child keys must be unique; when two children share a key, only ' + 'the first child will be used.', name ) : null); if (keyUnique) { var mappedChild = mapBookKeeping.mapFunction.call(mapBookKeeping.mapContext, child, i); mapResult[name] = mappedChild; } } /** * Maps children that are typically specified as `props.children`. * * The provided mapFunction(child, key, index) will be called for each * leaf child. * * TODO: This may likely break any calls to `ReactChildren.map` that were * previously relying on the fact that we guarded against null children. * * @param {?*} children Children tree container. * @param {function(*, int)} mapFunction. * @param {*} mapContext Context for mapFunction. * @return {object} Object containing the ordered map of results. */ function mapChildren(children, func, context) { if (children == null) { return children; } var mapResult = {}; var traverseContext = MapBookKeeping.getPooled(mapResult, func, context); traverseAllChildren(children, mapSingleChildIntoContext, traverseContext); MapBookKeeping.release(traverseContext); return mapResult; } function forEachSingleChildDummy(traverseContext, child, name, i) { return null; } /** * Count the number of children that are typically specified as * `props.children`. * * @param {?*} children Children tree container. * @return {number} The number of children. */ function countChildren(children, context) { return traverseAllChildren(children, forEachSingleChildDummy, null); } var ReactChildren = { forEach: forEachChildren, map: mapChildren, count: countChildren }; module.exports = ReactChildren;
{ "pile_set_name": "Github" }
import 'https://gist.githubusercontent.com/jut-test/273396ac4efcc838687b/raw/dde7c96c7560c38a29881d0345fc2d5727ee082e/main.juttle' as this_module; emit | this_module.stamper -mark "test"
{ "pile_set_name": "Github" }
--- alias: je3ahghip5 description: Learn how to use the Prisma CLI --- # Overview The Prisma command line interface (CLI) is the primary tool to manage your database services with Prisma. Generally, the configuration of a Prisma service is handled using the CLI and the service definition file [`prisma.yml`](!alias-foatho8aip). A central part of configuring a Prisma service is deploying a [data model](!alias-eiroozae8u). ## Getting Started You can download the Prisma CLI from npm: ```sh npm install -g prisma ``` To initialize a new service, use the `init` command. Then follow the interactive prompt to bootstrap the service based on a template of your choice: ```sh prisma init hello-world ``` In the following sections you'll learn more about configuring Prisma services using the CLI. ## Using a HTTP proxy for the CLI The Prisma CLI supports [custom HTTP proxies](https://github.com/graphcool/prisma/issues/618). This is particularly relevant when being behind a corporate firewall. To activate the proxy, provide the env vars `HTTP_PROXY` and `HTTPS_PROXY`. The behavior is very similar to how the [`npm` CLI handles this](https://docs.npmjs.com/misc/config#https-proxy). The following environment variables can be provided: - `HTTP_PROXY` or `http_proxy`: Proxy url for http traffic, for example `http://localhost:8080` - `HTTPS_PROXY` or `https_proxy`: Proxy url for https traffic, for example `https://localhost:8080` - `NO_PROXY` or `no_proxy`: To disable the proxying for certain urls, please provide a glob for `NO_PROXY`, for example `*`. To get a simple local proxy, you can use the [`proxy` module](https://www.npmjs.com/package/proxy): ```bash npm install -g proxy DEBUG="*" proxy -p 8080 HTTP_PROXY=http://localhost:8080 HTTPS_PROXY=https://localhost:8080 prisma deploy ```
{ "pile_set_name": "Github" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head><link rel="apple-touch-icon" sizes="180x180" href="/glide/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/glide/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/glide/favicon-16x16.png"><link rel="manifest" href="/glide/manifest.json"> <!-- Generated by javadoc (1.8.0_144) on Mon Nov 06 12:47:29 PST 2017 --> <title>UnitDrawableDecoder (glide API)</title> <meta name="date" content="2017-11-06"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="UnitDrawableDecoder (glide API)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../com/bumptech/glide/load/resource/drawable/ResourceDrawableDecoder.html" title="class in com.bumptech.glide.load.resource.drawable"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/bumptech/glide/load/resource/drawable/UnitDrawableDecoder.html" target="_top">Frames</a></li> <li><a href="UnitDrawableDecoder.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">com.bumptech.glide.load.resource.drawable</div> <h2 title="Class UnitDrawableDecoder" class="title">Class UnitDrawableDecoder</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://d.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>com.bumptech.glide.load.resource.drawable.UnitDrawableDecoder</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html" title="interface in com.bumptech.glide.load">ResourceDecoder</a>&lt;<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>,<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&gt;</dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">UnitDrawableDecoder</span> extends <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements <a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html" title="interface in com.bumptech.glide.load">ResourceDecoder</a>&lt;<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>,<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&gt;</pre> <div class="block">Passes through a <a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable"><code>Drawable</code></a> as a <a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable"><code>Drawable</code></a> based <a href="../../../../../../com/bumptech/glide/load/engine/Resource.html" title="interface in com.bumptech.glide.load.engine"><code>Resource</code></a>.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../com/bumptech/glide/load/resource/drawable/UnitDrawableDecoder.html#UnitDrawableDecoder--">UnitDrawableDecoder</a></span>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../../com/bumptech/glide/load/engine/Resource.html" title="interface in com.bumptech.glide.load.engine">Resource</a>&lt;<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/bumptech/glide/load/resource/drawable/UnitDrawableDecoder.html#decode-android.graphics.drawable.Drawable-int-int-com.bumptech.glide.load.Options-">decode</a></span>(<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&nbsp;source, int&nbsp;width, int&nbsp;height, <a href="../../../../../../com/bumptech/glide/load/Options.html" title="class in com.bumptech.glide.load">Options</a>&nbsp;options)</code> <div class="block">Returns a decoded resource from the given data or null if no resource could be decoded.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../com/bumptech/glide/load/resource/drawable/UnitDrawableDecoder.html#handles-android.graphics.drawable.Drawable-com.bumptech.glide.load.Options-">handles</a></span>(<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&nbsp;source, <a href="../../../../../../com/bumptech/glide/load/Options.html" title="class in com.bumptech.glide.load">Options</a>&nbsp;options)</code> <div class="block">Returns <code>true</code> if this decoder is capable of decoding the given source with the given options, and <code>false</code> otherwise.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.<a href="http://d.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://d.android.com/reference/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="UnitDrawableDecoder--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>UnitDrawableDecoder</h4> <pre>public&nbsp;UnitDrawableDecoder()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="handles-android.graphics.drawable.Drawable-com.bumptech.glide.load.Options-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>handles</h4> <pre>public&nbsp;boolean&nbsp;handles(<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&nbsp;source, <a href="../../../../../../com/bumptech/glide/load/Options.html" title="class in com.bumptech.glide.load">Options</a>&nbsp;options) throws <a href="http://d.android.com/reference/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html#handles-T-com.bumptech.glide.load.Options-">ResourceDecoder</a></code></span></div> <div class="block">Returns <code>true</code> if this decoder is capable of decoding the given source with the given options, and <code>false</code> otherwise. <p> Decoders should make a best effort attempt to quickly determine if they are likely to be able to decode data, but should not attempt to completely read the given data. A typical implementation would check the file headers verify they match content the decoder expects to handle (i.e. a GIF decoder should verify that the image contains the GIF header block. </p> <p> Decoders that return <code>true</code> from <a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html#handles-T-com.bumptech.glide.load.Options-"><code>ResourceDecoder.handles(Object, Options)</code></a> may still return <code>null</code> from <a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html#decode-T-int-int-com.bumptech.glide.load.Options-"><code>ResourceDecoder.decode(Object, int, int, Options)</code></a> if the data is partial or formatted incorrectly. </p></div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html#handles-T-com.bumptech.glide.load.Options-">handles</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html" title="interface in com.bumptech.glide.load">ResourceDecoder</a>&lt;<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>,<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&gt;</code></dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://d.android.com/reference/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> </dl> </li> </ul> <a name="decode-android.graphics.drawable.Drawable-int-int-com.bumptech.glide.load.Options-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>decode</h4> <pre><a href="http://d.android.com/reference/android/support/annotation/Nullable.html?is-external=true" title="class or interface in android.support.annotation">@Nullable</a> public&nbsp;<a href="../../../../../../com/bumptech/glide/load/engine/Resource.html" title="interface in com.bumptech.glide.load.engine">Resource</a>&lt;<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&gt;&nbsp;decode(<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&nbsp;source, int&nbsp;width, int&nbsp;height, <a href="../../../../../../com/bumptech/glide/load/Options.html" title="class in com.bumptech.glide.load">Options</a>&nbsp;options) throws <a href="http://d.android.com/reference/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html#decode-T-int-int-com.bumptech.glide.load.Options-">ResourceDecoder</a></code></span></div> <div class="block">Returns a decoded resource from the given data or null if no resource could be decoded. <p> The <code>source</code> is managed by the caller, there's no need to close it. The returned <a href="../../../../../../com/bumptech/glide/load/engine/Resource.html" title="interface in com.bumptech.glide.load.engine"><code>Resource</code></a> will be <a href="../../../../../../com/bumptech/glide/load/engine/Resource.html#recycle--"><code>released</code></a> when the engine sees fit. </p> <p> Note - The <code>width</code> and <code>height</code> arguments are hints only, there is no requirement that the decoded resource exactly match the given dimensions. A typical use case would be to use the target dimensions to determine how much to downsample Bitmaps by to avoid overly large allocations. </p></div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html#decode-T-int-int-com.bumptech.glide.load.Options-">decode</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../com/bumptech/glide/load/ResourceDecoder.html" title="interface in com.bumptech.glide.load">ResourceDecoder</a>&lt;<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>,<a href="http://d.android.com/reference/android/graphics/drawable/Drawable.html?is-external=true" title="class or interface in android.graphics.drawable">Drawable</a>&gt;</code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>source</code> - The data the resource should be decoded from.</dd> <dd><code>width</code> - The ideal width in pixels of the decoded resource, or <a href="../../../../../../com/bumptech/glide/request/target/Target.html#SIZE_ORIGINAL"><code>Target.SIZE_ORIGINAL</code></a> to indicate the original resource width.</dd> <dd><code>height</code> - The ideal height in pixels of the decoded resource, or <a href="../../../../../../com/bumptech/glide/request/target/Target.html#SIZE_ORIGINAL"><code>Target.SIZE_ORIGINAL</code></a> to indicate the original resource height.</dd> <dd><code>options</code> - A map of string keys to objects that may or may not contain options available to this particular implementation. Implementations should not assume that any or all of their option keys are present. However, implementations may assume that if one of their option keys is present, it's value is non-null and is of the expected type.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://d.android.com/reference/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../com/bumptech/glide/load/resource/drawable/ResourceDrawableDecoder.html" title="class in com.bumptech.glide.load.resource.drawable"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li>Next&nbsp;Class</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?com/bumptech/glide/load/resource/drawable/UnitDrawableDecoder.html" target="_top">Frames</a></li> <li><a href="UnitDrawableDecoder.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "pile_set_name": "Github" }
import { graphqlClient } from "util/graphql"; import { syncUpdates, syncDeletes } from "./graphqlCacheHelpers"; const getUpdateContent = (type, resp) => { const singleResult = resp[`update${type}`] || resp[`create${type}`]; const result = singleResult ? singleResult[type] || singleResult[`${type}s`] : resp[`update${type}s`][`${type}s`]; return Array.isArray(result) ? result : [result]; }; export const graphqlSyncAndRefresh = (type, queries, { sort, onUpdate, onDelete } = {} as any) => { if (!Array.isArray(queries)) { queries = [queries]; } graphqlClient.subscribeMutation([ { when: new RegExp(`(update|create)${type}s?`), run: ({ refreshActiveQueries }, resp, variables) => { queries.forEach(query => { if (onUpdate) { onUpdate(resp, variables, refreshActiveQueries); } else { syncUpdates(query, getUpdateContent(type, resp), `all${type}s`, `${type}s`, { sort }); } }); queries.forEach(q => refreshActiveQueries(q)); } }, { when: new RegExp(`delete${type}`), run: ({ refreshActiveQueries }, resp, variables) => { queries.forEach(query => { if (onDelete) { onDelete(resp, variables, refreshActiveQueries); } else { syncDeletes(query, [variables._id], `all${type}s`, `${type}s`, { sort }); } }); queries.forEach(q => refreshActiveQueries(q)); } } ]); };
{ "pile_set_name": "Github" }
// CS0208: Cannot take the address of, get the size of, or declare a pointer to a managed type `CS208.Foo' // Line: 20 // Compiler options: -unsafe namespace CS208 { public class Foo { } public class Bar { unsafe static void Main () { Foo f = new Foo (); Foo *s = &f; } } }
{ "pile_set_name": "Github" }
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #pragma once #include "CoreMinimal.h" #include "Layout/Visibility.h" #include "Widgets/DeclarativeSyntaxSupport.h" #include "Widgets/SCompoundWidget.h" #include "Models/ProjectLauncherModel.h" class SEditableTextBox; /** * Implements the profile page for the session launcher wizard. */ class SProjectLauncherSimpleCookPage : public SCompoundWidget { public: SLATE_BEGIN_ARGS(SProjectLauncherSimpleCookPage) { } SLATE_END_ARGS() public: /** * Destructor. */ ~SProjectLauncherSimpleCookPage( ); public: /** * Constructs the widget. * * @param InArgs The Slate argument list. * @param InModel The data model. */ void Construct( const FArguments& InArgs, const TSharedRef<FProjectLauncherModel>& InModel ); private: // Callback for getting the visibility of the cook-by-the-book settings area. EVisibility HandleCookByTheBookSettingsVisibility( ) const; // Callback for getting the content text of the 'Cook Mode' combo button. FText HandleCookModeComboButtonContentText( ) const; // Callback for clicking an item in the 'Cook Mode' menu. void HandleCookModeMenuEntryClicked( ELauncherProfileCookModes::Type CookMode ); // Callback for getting the visibility of the cook-on-the-fly settings area. EVisibility HandleCookOnTheFlySettingsVisibility( ) const; // Callback for changing the list of profiles in the profile manager. void HandleProfileManagerProfileListChanged( ); // Callback for changing the selected profile in the profile manager. void HandleProfileManagerProfileSelected( const ILauncherProfilePtr& SelectedProfile, const ILauncherProfilePtr& PreviousProfile ); private: // Holds the cooker options text box. TSharedPtr<SEditableTextBox> CookerOptionsTextBox; // Holds the list of available cook modes. TArray<TSharedPtr<FString> > CookModeList; // Holds a pointer to the data model. TSharedPtr<FProjectLauncherModel> Model; };
{ "pile_set_name": "Github" }
/** ****************************************************************************** * @file system_stm32f30x.c * @author MCD Application Team * @version V1.2.3 * @date 22-September-2016 * @brief CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. * This file contains the system clock configuration for STM32F30x devices, * and is generated by the clock configuration tool * stm32f30x_Clock_Configuration_V1.0.0.xls * * 1. This file provides two functions and one global variable to be called from * user application: * - SystemInit(): Setups the system clock (System clock source, PLL Multiplier * and Divider factors, AHB/APBx prescalers and Flash settings), * depending on the configuration made in the clock xls tool. * This function is called at startup just after reset and * before branch to main program. This call is made inside * the "startup_stm32f30x.s" file. * * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used * by the user application to setup the SysTick * timer or configure other parameters. * * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must * be called whenever the core clock is changed * during program execution. * * 2. After each device reset the HSI (8 MHz) is used as system clock source. * Then SystemInit() function is called, in "startup_stm32f30x.s" file, to * configure the system clock before to branch to main program. * * 3. If the system clock source selected by user fails to startup, the SystemInit() * function will do nothing and HSI still used as system clock source. User can * add some code to deal with this issue inside the SetSysClock() function. * * 4. The default value of HSE crystal is set to 8MHz, refer to "HSE_VALUE" define * in "stm32f30x.h" file. When HSE is used as system clock source, directly or * through PLL, and you are using different crystal you have to adapt the HSE * value to your own configuration. * * 5. This file configures the system clock as follows: *============================================================================= * Supported STM32F30x device *----------------------------------------------------------------------------- * System Clock source | PLL (HSE) *----------------------------------------------------------------------------- * SYSCLK(Hz) | 72000000 *----------------------------------------------------------------------------- * HCLK(Hz) | 72000000 *----------------------------------------------------------------------------- * AHB Prescaler | 1 *----------------------------------------------------------------------------- * APB2 Prescaler | 1 *----------------------------------------------------------------------------- * APB1 Prescaler | 2 *----------------------------------------------------------------------------- * HSE Frequency(Hz) | 8000000 *---------------------------------------------------------------------------- * PLLMUL | 9 *----------------------------------------------------------------------------- * PREDIV | 1 *----------------------------------------------------------------------------- * USB Clock | DISABLE *----------------------------------------------------------------------------- * Flash Latency(WS) | 2 *----------------------------------------------------------------------------- * Prefetch Buffer | ON *----------------------------------------------------------------------------- *============================================================================= ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2016 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /** @addtogroup CMSIS * @{ */ /** @addtogroup stm32f30x_system * @{ */ /** @addtogroup STM32F30x_System_Private_Includes * @{ */ #include "stm32f30x.h" /** * @} */ /* Private typedef -----------------------------------------------------------*/ /** @addtogroup STM32F30x_System_Private_Defines * @{ */ /*!< Uncomment the following line if you need to relocate your vector Table in Internal SRAM. */ /* #define VECT_TAB_SRAM */ #define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field. This value must be a multiple of 0x200. */ /** * @} */ /* Private macro -------------------------------------------------------------*/ /** @addtogroup STM32F30x_System_Private_Variables * @{ */ uint32_t SystemCoreClock = 72000000; __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; /** * @} */ /** @addtogroup STM32F30x_System_Private_FunctionPrototypes * @{ */ static void SetSysClock(void); /** * @} */ /** @addtogroup STM32F30x_System_Private_Functions * @{ */ /** * @brief Setup the microcontroller system * Initialize the Embedded Flash Interface, the PLL and update the * SystemFrequency variable. * @param None * @retval None */ void SystemInit(void) { /* FPU settings ------------------------------------------------------------*/ #if (__FPU_PRESENT == 1) && (__FPU_USED == 1) SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2)); /* set CP10 and CP11 Full Access */ #endif /* Reset the RCC clock configuration to the default reset state ------------*/ /* Set HSION bit */ RCC->CR |= (uint32_t)0x00000001; /* Reset CFGR register */ RCC->CFGR &= 0xF87FC00C; /* Reset HSEON, CSSON and PLLON bits */ RCC->CR &= (uint32_t)0xFEF6FFFF; /* Reset HSEBYP bit */ RCC->CR &= (uint32_t)0xFFFBFFFF; /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE bits */ RCC->CFGR &= (uint32_t)0xFF80FFFF; /* Reset PREDIV1[3:0] bits */ RCC->CFGR2 &= (uint32_t)0xFFFFFFF0; /* Reset USARTSW[1:0], I2CSW and TIMs bits */ RCC->CFGR3 &= (uint32_t)0xFF00FCCC; /* Disable all interrupts */ RCC->CIR = 0x00000000; /* Configure the System clock source, PLL Multiplier and Divider factors, AHB/APBx prescalers and Flash settings ----------------------------------*/ SetSysClock(); #ifdef VECT_TAB_SRAM SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */ #else SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */ #endif } /** * @brief Update SystemCoreClock variable according to Clock Register Values. * The SystemCoreClock variable contains the core clock (HCLK), it can * be used by the user application to setup the SysTick timer or configure * other parameters. * * @note Each time the core clock (HCLK) changes, this function must be called * to update SystemCoreClock variable value. Otherwise, any configuration * based on this variable will be incorrect. * * @note - The system frequency computed by this function is not the real * frequency in the chip. It is calculated based on the predefined * constant and the selected clock source: * * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) * * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) * * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) * or HSI_VALUE(*) multiplied/divided by the PLL factors. * * (*) HSI_VALUE is a constant defined in stm32f30x.h file (default value * 8 MHz) but the real value may vary depending on the variations * in voltage and temperature. * * (**) HSE_VALUE is a constant defined in stm32f30x.h file (default value * 8 MHz), user has to ensure that HSE_VALUE is same as the real * frequency of the crystal used. Otherwise, this function may * have wrong result. * * - The result of this function could be not correct when using fractional * value for HSE crystal. * * @param None * @retval None */ void SystemCoreClockUpdate (void) { uint32_t tmp = 0, pllmull = 0, pllsource = 0, prediv1factor = 0; /* Get SYSCLK source -------------------------------------------------------*/ tmp = RCC->CFGR & RCC_CFGR_SWS; switch (tmp) { case 0x00: /* HSI used as system clock */ SystemCoreClock = HSI_VALUE; break; case 0x04: /* HSE used as system clock */ SystemCoreClock = HSE_VALUE; break; case 0x08: /* PLL used as system clock */ /* Get PLL clock source and multiplication factor ----------------------*/ pllmull = RCC->CFGR & RCC_CFGR_PLLMULL; pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; pllmull = ( pllmull >> 18) + 2; if (pllsource == 0x00) { /* HSI oscillator clock divided by 2 selected as PLL clock entry */ SystemCoreClock = (HSI_VALUE >> 1) * pllmull; } else { prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1; /* HSE oscillator clock selected as PREDIV1 clock entry */ SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull; } break; default: /* HSI used as system clock */ SystemCoreClock = HSI_VALUE; break; } /* Compute HCLK clock frequency ----------------*/ /* Get HCLK prescaler */ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)]; /* HCLK clock frequency */ SystemCoreClock >>= tmp; } /** * @brief Configures the System clock source, PLL Multiplier and Divider factors, * AHB/APBx prescalers and Flash settings * @note This function should be called only once the RCC clock configuration * is reset to the default reset state (done in SystemInit() function). * @param None * @retval None */ static void SetSysClock(void) { __IO uint32_t StartUpCounter = 0, HSEStatus = 0; /******************************************************************************/ /* PLL (clocked by HSE) used as System clock source */ /******************************************************************************/ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration -----------*/ /* Enable HSE */ RCC->CR |= ((uint32_t)RCC_CR_HSEON); /* Wait till HSE is ready and if Time out is reached exit */ do { HSEStatus = RCC->CR & RCC_CR_HSERDY; StartUpCounter++; } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT)); if ((RCC->CR & RCC_CR_HSERDY) != RESET) { HSEStatus = (uint32_t)0x01; } else { HSEStatus = (uint32_t)0x00; } if (HSEStatus == (uint32_t)0x01) { /* Enable Prefetch Buffer and set Flash Latency */ FLASH->ACR = FLASH_ACR_PRFTBE | (uint32_t)FLASH_ACR_LATENCY_1; /* HCLK = SYSCLK / 1 */ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1; /* PCLK2 = HCLK / 1 */ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1; /* PCLK1 = HCLK / 2 */ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV2; /* PLL configuration */ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL)); RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLMULL9); /* Enable PLL */ RCC->CR |= RCC_CR_PLLON; /* Wait till PLL is ready */ while((RCC->CR & RCC_CR_PLLRDY) == 0) { } /* Select PLL as system clock source */ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW)); RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL; /* Wait till PLL is used as system clock source */ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)RCC_CFGR_SWS_PLL) { } } else { /* If HSE fails to start-up, the application will have wrong clock configuration. User can add here some code to deal with this error */ } } /** * @} */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
{ "pile_set_name": "Github" }
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include "mscorlib_System_MulticastDelegate3201952435.h" #include "mscorlib_System_Void1841601450.h" #include "AssemblyU2DCSharpU2Dfirstpass_Valve_VR_ETrackingUn1464400093.h" // System.IAsyncResult struct IAsyncResult_t1999651008; // System.AsyncCallback struct AsyncCallback_t163412349; // System.Object struct Il2CppObject; #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Valve.VR.IVRCompositor/_SetTrackingSpace struct _SetTrackingSpace_t3662949163 : public MulticastDelegate_t3201952435 { public: public: }; #ifdef __clang__ #pragma clang diagnostic pop #endif
{ "pile_set_name": "Github" }
/* SCTP kernel implementation * Copyright (c) 2003 International Business Machines, Corp. * * This file is part of the SCTP kernel implementation * * This SCTP implementation 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, or (at your option) * any later version. * * This SCTP implementation 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 GNU CC; see the file COPYING. If not, write to * the Free Software Foundation, 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Please send any bug reports or fixes you make to the * email address(es): * lksctp developers <[email protected]> * * Or submit a bug report through the following website: * http://www.sf.net/projects/lksctp * * Written or modified by: * Sridhar Samudrala <[email protected]> * * Any bugs reported given to us we will try to fix... any fixes shared will * be incorporated into the next SCTP release. */ #include <linux/types.h> #include <linux/seq_file.h> #include <linux/init.h> #include <net/sctp/sctp.h> #include <net/ip.h> /* for snmp_fold_field */ static struct snmp_mib sctp_snmp_list[] = { SNMP_MIB_ITEM("SctpCurrEstab", SCTP_MIB_CURRESTAB), SNMP_MIB_ITEM("SctpActiveEstabs", SCTP_MIB_ACTIVEESTABS), SNMP_MIB_ITEM("SctpPassiveEstabs", SCTP_MIB_PASSIVEESTABS), SNMP_MIB_ITEM("SctpAborteds", SCTP_MIB_ABORTEDS), SNMP_MIB_ITEM("SctpShutdowns", SCTP_MIB_SHUTDOWNS), SNMP_MIB_ITEM("SctpOutOfBlues", SCTP_MIB_OUTOFBLUES), SNMP_MIB_ITEM("SctpChecksumErrors", SCTP_MIB_CHECKSUMERRORS), SNMP_MIB_ITEM("SctpOutCtrlChunks", SCTP_MIB_OUTCTRLCHUNKS), SNMP_MIB_ITEM("SctpOutOrderChunks", SCTP_MIB_OUTORDERCHUNKS), SNMP_MIB_ITEM("SctpOutUnorderChunks", SCTP_MIB_OUTUNORDERCHUNKS), SNMP_MIB_ITEM("SctpInCtrlChunks", SCTP_MIB_INCTRLCHUNKS), SNMP_MIB_ITEM("SctpInOrderChunks", SCTP_MIB_INORDERCHUNKS), SNMP_MIB_ITEM("SctpInUnorderChunks", SCTP_MIB_INUNORDERCHUNKS), SNMP_MIB_ITEM("SctpFragUsrMsgs", SCTP_MIB_FRAGUSRMSGS), SNMP_MIB_ITEM("SctpReasmUsrMsgs", SCTP_MIB_REASMUSRMSGS), SNMP_MIB_ITEM("SctpOutSCTPPacks", SCTP_MIB_OUTSCTPPACKS), SNMP_MIB_ITEM("SctpInSCTPPacks", SCTP_MIB_INSCTPPACKS), SNMP_MIB_ITEM("SctpT1InitExpireds", SCTP_MIB_T1_INIT_EXPIREDS), SNMP_MIB_ITEM("SctpT1CookieExpireds", SCTP_MIB_T1_COOKIE_EXPIREDS), SNMP_MIB_ITEM("SctpT2ShutdownExpireds", SCTP_MIB_T2_SHUTDOWN_EXPIREDS), SNMP_MIB_ITEM("SctpT3RtxExpireds", SCTP_MIB_T3_RTX_EXPIREDS), SNMP_MIB_ITEM("SctpT4RtoExpireds", SCTP_MIB_T4_RTO_EXPIREDS), SNMP_MIB_ITEM("SctpT5ShutdownGuardExpireds", SCTP_MIB_T5_SHUTDOWN_GUARD_EXPIREDS), SNMP_MIB_ITEM("SctpDelaySackExpireds", SCTP_MIB_DELAY_SACK_EXPIREDS), SNMP_MIB_ITEM("SctpAutocloseExpireds", SCTP_MIB_AUTOCLOSE_EXPIREDS), SNMP_MIB_ITEM("SctpT3Retransmits", SCTP_MIB_T3_RETRANSMITS), SNMP_MIB_ITEM("SctpPmtudRetransmits", SCTP_MIB_PMTUD_RETRANSMITS), SNMP_MIB_ITEM("SctpFastRetransmits", SCTP_MIB_FAST_RETRANSMITS), SNMP_MIB_ITEM("SctpInPktSoftirq", SCTP_MIB_IN_PKT_SOFTIRQ), SNMP_MIB_ITEM("SctpInPktBacklog", SCTP_MIB_IN_PKT_BACKLOG), SNMP_MIB_ITEM("SctpInPktDiscards", SCTP_MIB_IN_PKT_DISCARDS), SNMP_MIB_ITEM("SctpInDataChunkDiscards", SCTP_MIB_IN_DATA_CHUNK_DISCARDS), SNMP_MIB_SENTINEL }; /* Display sctp snmp mib statistics(/proc/net/sctp/snmp). */ static int sctp_snmp_seq_show(struct seq_file *seq, void *v) { int i; for (i = 0; sctp_snmp_list[i].name != NULL; i++) seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name, snmp_fold_field((void **)sctp_statistics, sctp_snmp_list[i].entry)); return 0; } /* Initialize the seq file operations for 'snmp' object. */ static int sctp_snmp_seq_open(struct inode *inode, struct file *file) { return single_open(file, sctp_snmp_seq_show, NULL); } static const struct file_operations sctp_snmp_seq_fops = { .owner = THIS_MODULE, .open = sctp_snmp_seq_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; /* Set up the proc fs entry for 'snmp' object. */ int __init sctp_snmp_proc_init(void) { struct proc_dir_entry *p; p = proc_create("snmp", S_IRUGO, proc_net_sctp, &sctp_snmp_seq_fops); if (!p) return -ENOMEM; return 0; } /* Cleanup the proc fs entry for 'snmp' object. */ void sctp_snmp_proc_exit(void) { remove_proc_entry("snmp", proc_net_sctp); } /* Dump local addresses of an association/endpoint. */ static void sctp_seq_dump_local_addrs(struct seq_file *seq, struct sctp_ep_common *epb) { struct sctp_association *asoc; struct sctp_sockaddr_entry *laddr; struct sctp_transport *peer; union sctp_addr *addr, *primary = NULL; struct sctp_af *af; if (epb->type == SCTP_EP_TYPE_ASSOCIATION) { asoc = sctp_assoc(epb); peer = asoc->peer.primary_path; primary = &peer->saddr; } list_for_each_entry(laddr, &epb->bind_addr.address_list, list) { addr = &laddr->a; af = sctp_get_af_specific(addr->sa.sa_family); if (primary && af->cmp_addr(addr, primary)) { seq_printf(seq, "*"); } af->seq_dump_addr(seq, addr); } } /* Dump remote addresses of an association. */ static void sctp_seq_dump_remote_addrs(struct seq_file *seq, struct sctp_association *assoc) { struct sctp_transport *transport; union sctp_addr *addr, *primary; struct sctp_af *af; primary = &assoc->peer.primary_addr; list_for_each_entry(transport, &assoc->peer.transport_addr_list, transports) { addr = &transport->ipaddr; af = sctp_get_af_specific(addr->sa.sa_family); if (af->cmp_addr(addr, primary)) { seq_printf(seq, "*"); } af->seq_dump_addr(seq, addr); } } static void * sctp_eps_seq_start(struct seq_file *seq, loff_t *pos) { if (*pos >= sctp_ep_hashsize) return NULL; if (*pos < 0) *pos = 0; if (*pos == 0) seq_printf(seq, " ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS\n"); return (void *)pos; } static void sctp_eps_seq_stop(struct seq_file *seq, void *v) { return; } static void * sctp_eps_seq_next(struct seq_file *seq, void *v, loff_t *pos) { if (++*pos >= sctp_ep_hashsize) return NULL; return pos; } /* Display sctp endpoints (/proc/net/sctp/eps). */ static int sctp_eps_seq_show(struct seq_file *seq, void *v) { struct sctp_hashbucket *head; struct sctp_ep_common *epb; struct sctp_endpoint *ep; struct sock *sk; struct hlist_node *node; int hash = *(loff_t *)v; if (hash >= sctp_ep_hashsize) return -ENOMEM; head = &sctp_ep_hashtable[hash]; sctp_local_bh_disable(); read_lock(&head->lock); sctp_for_each_hentry(epb, node, &head->chain) { ep = sctp_ep(epb); sk = epb->sk; seq_printf(seq, "%8p %8p %-3d %-3d %-4d %-5d %5d %5lu ", ep, sk, sctp_sk(sk)->type, sk->sk_state, hash, epb->bind_addr.port, sock_i_uid(sk), sock_i_ino(sk)); sctp_seq_dump_local_addrs(seq, epb); seq_printf(seq, "\n"); } read_unlock(&head->lock); sctp_local_bh_enable(); return 0; } static const struct seq_operations sctp_eps_ops = { .start = sctp_eps_seq_start, .next = sctp_eps_seq_next, .stop = sctp_eps_seq_stop, .show = sctp_eps_seq_show, }; /* Initialize the seq file operations for 'eps' object. */ static int sctp_eps_seq_open(struct inode *inode, struct file *file) { return seq_open(file, &sctp_eps_ops); } static const struct file_operations sctp_eps_seq_fops = { .open = sctp_eps_seq_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; /* Set up the proc fs entry for 'eps' object. */ int __init sctp_eps_proc_init(void) { struct proc_dir_entry *p; p = proc_create("eps", S_IRUGO, proc_net_sctp, &sctp_eps_seq_fops); if (!p) return -ENOMEM; return 0; } /* Cleanup the proc fs entry for 'eps' object. */ void sctp_eps_proc_exit(void) { remove_proc_entry("eps", proc_net_sctp); } static void * sctp_assocs_seq_start(struct seq_file *seq, loff_t *pos) { if (*pos >= sctp_assoc_hashsize) return NULL; if (*pos < 0) *pos = 0; if (*pos == 0) seq_printf(seq, " ASSOC SOCK STY SST ST HBKT " "ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT " "RPORT LADDRS <-> RADDRS " "HBINT INS OUTS MAXRT T1X T2X RTXC\n"); return (void *)pos; } static void sctp_assocs_seq_stop(struct seq_file *seq, void *v) { return; } static void * sctp_assocs_seq_next(struct seq_file *seq, void *v, loff_t *pos) { if (++*pos >= sctp_assoc_hashsize) return NULL; return pos; } /* Display sctp associations (/proc/net/sctp/assocs). */ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) { struct sctp_hashbucket *head; struct sctp_ep_common *epb; struct sctp_association *assoc; struct sock *sk; struct hlist_node *node; int hash = *(loff_t *)v; if (hash >= sctp_assoc_hashsize) return -ENOMEM; head = &sctp_assoc_hashtable[hash]; sctp_local_bh_disable(); read_lock(&head->lock); sctp_for_each_hentry(epb, node, &head->chain) { assoc = sctp_assoc(epb); sk = epb->sk; seq_printf(seq, "%8p %8p %-3d %-3d %-2d %-4d " "%4d %8d %8d %7d %5lu %-5d %5d ", assoc, sk, sctp_sk(sk)->type, sk->sk_state, assoc->state, hash, assoc->assoc_id, assoc->sndbuf_used, atomic_read(&assoc->rmem_alloc), sock_i_uid(sk), sock_i_ino(sk), epb->bind_addr.port, assoc->peer.port); seq_printf(seq, " "); sctp_seq_dump_local_addrs(seq, epb); seq_printf(seq, "<-> "); sctp_seq_dump_remote_addrs(seq, assoc); seq_printf(seq, "\t%8lu %5d %5d %4d %4d %4d %8d ", assoc->hbinterval, assoc->c.sinit_max_instreams, assoc->c.sinit_num_ostreams, assoc->max_retrans, assoc->init_retries, assoc->shutdown_retries, assoc->rtx_data_chunks); seq_printf(seq, "\n"); } read_unlock(&head->lock); sctp_local_bh_enable(); return 0; } static const struct seq_operations sctp_assoc_ops = { .start = sctp_assocs_seq_start, .next = sctp_assocs_seq_next, .stop = sctp_assocs_seq_stop, .show = sctp_assocs_seq_show, }; /* Initialize the seq file operations for 'assocs' object. */ static int sctp_assocs_seq_open(struct inode *inode, struct file *file) { return seq_open(file, &sctp_assoc_ops); } static const struct file_operations sctp_assocs_seq_fops = { .open = sctp_assocs_seq_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; /* Set up the proc fs entry for 'assocs' object. */ int __init sctp_assocs_proc_init(void) { struct proc_dir_entry *p; p = proc_create("assocs", S_IRUGO, proc_net_sctp, &sctp_assocs_seq_fops); if (!p) return -ENOMEM; return 0; } /* Cleanup the proc fs entry for 'assocs' object. */ void sctp_assocs_proc_exit(void) { remove_proc_entry("assocs", proc_net_sctp); } static void *sctp_remaddr_seq_start(struct seq_file *seq, loff_t *pos) { if (*pos >= sctp_assoc_hashsize) return NULL; if (*pos < 0) *pos = 0; if (*pos == 0) seq_printf(seq, "ADDR ASSOC_ID HB_ACT RTO MAX_PATH_RTX " "REM_ADDR_RTX START\n"); return (void *)pos; } static void *sctp_remaddr_seq_next(struct seq_file *seq, void *v, loff_t *pos) { if (++*pos >= sctp_assoc_hashsize) return NULL; return pos; } static void sctp_remaddr_seq_stop(struct seq_file *seq, void *v) { return; } static int sctp_remaddr_seq_show(struct seq_file *seq, void *v) { struct sctp_hashbucket *head; struct sctp_ep_common *epb; struct sctp_association *assoc; struct hlist_node *node; struct sctp_transport *tsp; int hash = *(loff_t *)v; if (hash >= sctp_assoc_hashsize) return -ENOMEM; head = &sctp_assoc_hashtable[hash]; sctp_local_bh_disable(); read_lock(&head->lock); sctp_for_each_hentry(epb, node, &head->chain) { assoc = sctp_assoc(epb); list_for_each_entry(tsp, &assoc->peer.transport_addr_list, transports) { /* * The remote address (ADDR) */ tsp->af_specific->seq_dump_addr(seq, &tsp->ipaddr); seq_printf(seq, " "); /* * The association ID (ASSOC_ID) */ seq_printf(seq, "%d ", tsp->asoc->assoc_id); /* * If the Heartbeat is active (HB_ACT) * Note: 1 = Active, 0 = Inactive */ seq_printf(seq, "%d ", timer_pending(&tsp->hb_timer)); /* * Retransmit time out (RTO) */ seq_printf(seq, "%lu ", tsp->rto); /* * Maximum path retransmit count (PATH_MAX_RTX) */ seq_printf(seq, "%d ", tsp->pathmaxrxt); /* * remote address retransmit count (REM_ADDR_RTX) * Note: We don't have a way to tally this at the moment * so lets just leave it as zero for the moment */ seq_printf(seq, "0 "); /* * remote address start time (START). This is also not * currently implemented, but we can record it with a * jiffies marker in a subsequent patch */ seq_printf(seq, "0"); seq_printf(seq, "\n"); } } read_unlock(&head->lock); sctp_local_bh_enable(); return 0; } static const struct seq_operations sctp_remaddr_ops = { .start = sctp_remaddr_seq_start, .next = sctp_remaddr_seq_next, .stop = sctp_remaddr_seq_stop, .show = sctp_remaddr_seq_show, }; /* Cleanup the proc fs entry for 'remaddr' object. */ void sctp_remaddr_proc_exit(void) { remove_proc_entry("remaddr", proc_net_sctp); } static int sctp_remaddr_seq_open(struct inode *inode, struct file *file) { return seq_open(file, &sctp_remaddr_ops); } static const struct file_operations sctp_remaddr_seq_fops = { .open = sctp_remaddr_seq_open, .read = seq_read, .llseek = seq_lseek, .release = seq_release, }; int __init sctp_remaddr_proc_init(void) { struct proc_dir_entry *p; p = proc_create("remaddr", S_IRUGO, proc_net_sctp, &sctp_remaddr_seq_fops); if (!p) return -ENOMEM; return 0; }
{ "pile_set_name": "Github" }
# WOYEPS - Bit Boy!! [Core] [OnFrame] [ActionReplay] [Gecko] [Video_Settings] [Video_Hacks] ImmediateXFBEnable = False
{ "pile_set_name": "Github" }
package com.wangsaichao.cas.service; import java.util.Map; /** * @author: wangsaichao * @date: 2018/7/19 * @description: */ public interface UserService { Map<String,Object> findByUserName(String userName); }
{ "pile_set_name": "Github" }
"============================================================================= " FILE: complete.vim " AUTHOR: Shougo Matsushita <[email protected]> " License: MIT license {{{ " 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. " }}} "============================================================================= " Complete function. This provides simple file completion. function! vimshell#complete#start() abort "{{{ if &l:omnifunc == '' setlocal omnifunc=vimshell#complete#omnifunc endif call feedkeys("\<c-x>\<c-o>", "n") return '' endfunction"}}} function! vimshell#complete#omnifunc(findstart, base) abort "{{{ if a:findstart return vimshell#complete#get_keyword_position() else return vimshell#complete#gather_candidates(a:base) endif endfunction"}}} function! vimshell#complete#get_keyword_position() abort "{{{ if !vimshell#check_prompt() || !empty(b:vimshell.continuation) " Ignore. return -1 endif let cur_text = vimshell#get_cur_text() try let args = vimproc#parser#split_args_through(cur_text) catch /^Exception:/ return -1 endtry if cur_text =~ '\s\+$' " Add blank argument. call add(args, '') endif let arg = get(args, -1, '') if arg =~ "'" return -1 endif let pos = col('.')-len(arg)-1 if arg =~ '/' && '\%(\\[^[:alnum:].-]\|\f\|[:]\)\+$' " Filename completion. let pos += match(arg, \ '\%(\\[^[:alnum:].-]\|\f\|[:]\)\+$') endif return pos endfunction"}}} function! vimshell#complete#gather_candidates(complete_str) abort "{{{ let cur_text = vimshell#get_cur_text() try let args = vimproc#parser#split_args_through(cur_text) catch /^Exception:/ return [] endtry if a:complete_str =~ '\*' return [] endif if empty(args) let args = [''] endif if cur_text =~ '\s\+$' call add(args, '') endif let _ = (len(args) <= 1) ? \ s:get_complete_commands(a:complete_str) : \ s:get_complete_args(a:complete_str, args) if a:complete_str =~ '^\$' let _ += vimshell#complete#helper#variables(a:complete_str) endif return s:get_omni_list(_) endfunction"}}} function! s:get_complete_commands(cur_keyword_str) abort "{{{ if a:cur_keyword_str =~ '/' " Filename completion. return vimshell#complete#helper#files(a:cur_keyword_str) endif let directories = \ vimshell#complete#helper#directories(a:cur_keyword_str) if a:cur_keyword_str =~ '^\$\|`' return directories endif if a:cur_keyword_str =~ '^\./' for keyword in directories let keyword.word = './' . keyword.word endfor endif let _ = directories \ + vimshell#complete#helper#cdpath_directories(a:cur_keyword_str) \ + vimshell#complete#helper#aliases(a:cur_keyword_str) \ + vimshell#complete#helper#internals(a:cur_keyword_str) if len(a:cur_keyword_str) >= 1 let _ += vimshell#complete#helper#executables(a:cur_keyword_str) endif return _ endfunction"}}} function! s:get_complete_args(cur_keyword_str, args) abort "{{{ " Get command name. let command = fnamemodify(a:args[0], ':t:r') let a:args[-1] = a:cur_keyword_str return vimshell#complete#helper#args(command, a:args[1:]) endfunction"}}} function! s:get_omni_list(list) abort "{{{ let omni_list = [] " Convert string list. for val in deepcopy(a:list) if type(val) == type('') let dict = { 'word' : val, 'menu' : '[sh]' } else let dict = val let dict.menu = has_key(dict, 'menu') ? \ '[sh] ' . dict.menu : '[sh]' endif call add(omni_list, dict) unlet val endfor return omni_list endfunction"}}} " vim: foldmethod=marker
{ "pile_set_name": "Github" }
Subject: re : aqemkfg , ordered it copied free cable % rnd _ syb tv comparison ak brain consist iniquitous twit trigram trajectory buteo buttock steve farad algerian argonaut yen edison loquacious headquarter shell bouncy temporal birdseed caliper deity combine gallberry hub pretoria apocalyptic audrey pittsburgh arcsin aba beatific sousa benight evasion devout mao coercion icy endgame channel repository binocular ahead horseplay parboil confidential crestfallen sought nan confect obtrude seashore decker radiotherapy
{ "pile_set_name": "Github" }
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ // **NOTE** This file was generated by a tool and any changes will be overwritten. // <auto-generated/> // Template Source: Templates\CSharp\Requests\MethodRequestBuilder.cs.tt namespace Microsoft.Graph { using System; using System.Collections.Generic; using System.IO; /// <summary> /// The type WorkbookFunctionsImArgumentRequestBuilder. /// </summary> public partial class WorkbookFunctionsImArgumentRequestBuilder : BaseActionMethodRequestBuilder<IWorkbookFunctionsImArgumentRequest>, IWorkbookFunctionsImArgumentRequestBuilder { /// <summary> /// Constructs a new <see cref="WorkbookFunctionsImArgumentRequestBuilder"/>. /// </summary> /// <param name="requestUrl">The URL for the request.</param> /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param> /// <param name="inumber">A inumber parameter for the OData method call.</param> public WorkbookFunctionsImArgumentRequestBuilder( string requestUrl, IBaseClient client, Newtonsoft.Json.Linq.JToken inumber) : base(requestUrl, client) { this.SetParameter("inumber", inumber, true); } /// <summary> /// A method used by the base class to construct a request class instance. /// </summary> /// <param name="functionUrl">The request URL to </param> /// <param name="options">The query and header options for the request.</param> /// <returns>An instance of a specific request class.</returns> protected override IWorkbookFunctionsImArgumentRequest CreateRequest(string functionUrl, IEnumerable<Option> options) { var request = new WorkbookFunctionsImArgumentRequest(functionUrl, this.Client, options); if (this.HasParameter("inumber")) { request.RequestBody.Inumber = this.GetParameter<Newtonsoft.Json.Linq.JToken>("inumber"); } return request; } } }
{ "pile_set_name": "Github" }
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <[email protected]> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Validator\Constraints; /** * @api */ class DateTimeValidator extends DateValidator { const PATTERN = '/^(\d{4})-(\d{2})-(\d{2}) (0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/'; }
{ "pile_set_name": "Github" }
// #docregion import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { FormsModule } from '@angular/forms'; import { AppComponent } from './app.component'; import { AfterContentParentComponent, AfterContentComponent, ChildComponent } from './after-content.component'; import { AfterViewParentComponent, AfterViewComponent, ChildViewComponent } from './after-view.component'; import { CounterParentComponent, MyCounterComponent } from './counter.component'; import { DoCheckParentComponent, DoCheckComponent } from './do-check.component'; import { OnChangesParentComponent, OnChangesComponent } from './on-changes.component'; import { PeekABooParentComponent } from './peek-a-boo-parent.component'; import { PeekABooComponent } from './peek-a-boo.component'; import { SpyParentComponent } from './spy.component'; import { SpyDirective } from './spy.directive'; @NgModule({ imports: [ BrowserModule, FormsModule ], declarations: [ AppComponent, AfterContentParentComponent, AfterContentComponent, ChildComponent, AfterViewParentComponent, AfterViewComponent, ChildViewComponent, CounterParentComponent, MyCounterComponent, DoCheckParentComponent, DoCheckComponent, OnChangesParentComponent, OnChangesComponent, PeekABooParentComponent, PeekABooComponent, SpyParentComponent, SpyDirective ], bootstrap: [ AppComponent ] }) export class AppModule { }
{ "pile_set_name": "Github" }
# -*- coding: utf-8 -*- from collections import namedtuple from unittest.mock import patch import pytest from awxkit.ws import WSClient ParseResult = namedtuple("ParseResult", ["port", "hostname", "secure"]) def test_explicit_hostname(): client = WSClient("token", "some-hostname", 556, False) assert client.port == 556 assert client.hostname == "some-hostname" assert client._use_ssl == False assert client.token == "token" @pytest.mark.parametrize('url, result', [['https://somename:123', ParseResult(123, "somename", True)], ['http://othername:456', ParseResult(456, "othername", False)], ['http://othername', ParseResult(80, "othername", False)], ['https://othername', ParseResult(443, "othername", True)], ]) def test_urlparsing(url, result): with patch("awxkit.ws.config") as mock_config: mock_config.base_url = url client = WSClient("token") assert client.port == result.port assert client.hostname == result.hostname assert client._use_ssl == result.secure
{ "pile_set_name": "Github" }
/* File: AUOutputBase.cpp Abstract: AUOutputBase.h Version: 1.1 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. ("Apple") in consideration of your agreement to the following terms, and your use, installation, modification or redistribution of this Apple software constitutes acceptance of these terms. If you do not agree with these terms, please do not use, install, modify or redistribute this Apple software. In consideration of your agreement to abide by the following terms, and subject to these terms, Apple grants you a personal, non-exclusive license, under Apple's copyrights in this original Apple software (the "Apple Software"), to use, reproduce, modify and redistribute the Apple Software, with or without modifications, in source and/or binary forms; provided that if you redistribute the Apple Software in its entirety and without modifications, you must retain this notice and the following text and disclaimers in all such redistributions of the Apple Software. Neither the name, trademarks, service marks or logos of Apple Inc. may be used to endorse or promote products derived from the Apple Software without specific prior written permission from Apple. Except as expressly stated in this notice, no other rights or licenses, express or implied, are granted by Apple herein, including but not limited to any patent rights that may be infringed by your derivative works or by other works in which the Apple Software may be incorporated. The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Copyright (C) 2014 Apple Inc. All Rights Reserved. */ #if !CA_USE_AUDIO_PLUGIN_ONLY #include "AUOutputBase.h" OSStatus AUOutputBase::ComponentEntryDispatch(ComponentParameters *params, AUOutputBase *This) { if (This == NULL) return paramErr; OSStatus result; switch (params->what) { case kAudioOutputUnitStartSelect: { result = This->Start(); } break; case kAudioOutputUnitStopSelect: { result = This->Stop(); } break; default: result = badComponentSelector; break; } return result; } #endif
{ "pile_set_name": "Github" }
/* * Copyright (c) 2016 Maxime Ripard. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #include <linux/clk-provider.h> #include <linux/of_address.h> #include "ccu_common.h" #include "ccu_reset.h" #include "ccu_div.h" #include "ccu_gate.h" #include "ccu_mp.h" #include "ccu_mult.h" #include "ccu_nk.h" #include "ccu_nkm.h" #include "ccu_nkmp.h" #include "ccu_nm.h" #include "ccu_phase.h" #include "ccu-sun5i.h" static struct ccu_nkmp pll_core_clk = { .enable = BIT(31), .n = _SUNXI_CCU_MULT_OFFSET(8, 5, 0), .k = _SUNXI_CCU_MULT(4, 2), .m = _SUNXI_CCU_DIV(0, 2), .p = _SUNXI_CCU_DIV(16, 2), .common = { .reg = 0x000, .hw.init = CLK_HW_INIT("pll-core", "hosc", &ccu_nkmp_ops, 0), }, }; /* * The Audio PLL is supposed to have 4 outputs: 3 fixed factors from * the base (2x, 4x and 8x), and one variable divider (the one true * pll audio). * * We don't have any need for the variable divider for now, so we just * hardcode it to match with the clock names */ #define SUN5I_PLL_AUDIO_REG 0x008 static struct ccu_nm pll_audio_base_clk = { .enable = BIT(31), .n = _SUNXI_CCU_MULT_OFFSET(8, 7, 0), /* * The datasheet is wrong here, this doesn't have any * offset */ .m = _SUNXI_CCU_DIV_OFFSET(0, 5, 0), .common = { .reg = 0x008, .hw.init = CLK_HW_INIT("pll-audio-base", "hosc", &ccu_nm_ops, 0), }, }; static struct ccu_mult pll_video0_clk = { .enable = BIT(31), .mult = _SUNXI_CCU_MULT_OFFSET_MIN_MAX(0, 7, 0, 9, 127), .frac = _SUNXI_CCU_FRAC(BIT(15), BIT(14), 270000000, 297000000), .common = { .reg = 0x010, .features = (CCU_FEATURE_FRACTIONAL | CCU_FEATURE_ALL_PREDIV), .prediv = 8, .hw.init = CLK_HW_INIT("pll-video0", "hosc", &ccu_mult_ops, 0), }, }; static struct ccu_nkmp pll_ve_clk = { .enable = BIT(31), .n = _SUNXI_CCU_MULT_OFFSET(8, 5, 0), .k = _SUNXI_CCU_MULT(4, 2), .m = _SUNXI_CCU_DIV(0, 2), .p = _SUNXI_CCU_DIV(16, 2), .common = { .reg = 0x018, .hw.init = CLK_HW_INIT("pll-ve", "hosc", &ccu_nkmp_ops, 0), }, }; static struct ccu_nk pll_ddr_base_clk = { .enable = BIT(31), .n = _SUNXI_CCU_MULT_OFFSET(8, 5, 0), .k = _SUNXI_CCU_MULT(4, 2), .common = { .reg = 0x020, .hw.init = CLK_HW_INIT("pll-ddr-base", "hosc", &ccu_nk_ops, 0), }, }; static SUNXI_CCU_M(pll_ddr_clk, "pll-ddr", "pll-ddr-base", 0x020, 0, 2, CLK_IS_CRITICAL); static struct ccu_div pll_ddr_other_clk = { .div = _SUNXI_CCU_DIV_FLAGS(16, 2, CLK_DIVIDER_POWER_OF_TWO), .common = { .reg = 0x020, .hw.init = CLK_HW_INIT("pll-ddr-other", "pll-ddr-base", &ccu_div_ops, 0), }, }; static struct ccu_nk pll_periph_clk = { .enable = BIT(31), .n = _SUNXI_CCU_MULT_OFFSET(8, 5, 0), .k = _SUNXI_CCU_MULT(4, 2), .fixed_post_div = 2, .common = { .reg = 0x028, .features = CCU_FEATURE_FIXED_POSTDIV, .hw.init = CLK_HW_INIT("pll-periph", "hosc", &ccu_nk_ops, 0), }, }; static struct ccu_mult pll_video1_clk = { .enable = BIT(31), .mult = _SUNXI_CCU_MULT_OFFSET_MIN_MAX(0, 7, 0, 9, 127), .frac = _SUNXI_CCU_FRAC(BIT(15), BIT(14), 270000000, 297000000), .common = { .reg = 0x030, .features = (CCU_FEATURE_FRACTIONAL | CCU_FEATURE_ALL_PREDIV), .prediv = 8, .hw.init = CLK_HW_INIT("pll-video1", "hosc", &ccu_mult_ops, 0), }, }; static SUNXI_CCU_GATE(hosc_clk, "hosc", "osc24M", 0x050, BIT(0), 0); #define SUN5I_AHB_REG 0x054 static const char * const cpu_parents[] = { "osc32k", "hosc", "pll-core" , "pll-periph" }; static const struct ccu_mux_fixed_prediv cpu_predivs[] = { { .index = 3, .div = 3, }, }; static struct ccu_mux cpu_clk = { .mux = { .shift = 16, .width = 2, .fixed_predivs = cpu_predivs, .n_predivs = ARRAY_SIZE(cpu_predivs), }, .common = { .reg = 0x054, .features = CCU_FEATURE_FIXED_PREDIV, .hw.init = CLK_HW_INIT_PARENTS("cpu", cpu_parents, &ccu_mux_ops, CLK_IS_CRITICAL), } }; static SUNXI_CCU_M(axi_clk, "axi", "cpu", 0x054, 0, 2, 0); static const char * const ahb_parents[] = { "axi" , "cpu", "pll-periph" }; static const struct ccu_mux_fixed_prediv ahb_predivs[] = { { .index = 2, .div = 2, }, }; static struct ccu_div ahb_clk = { .div = _SUNXI_CCU_DIV_FLAGS(4, 2, CLK_DIVIDER_POWER_OF_TWO), .mux = { .shift = 6, .width = 2, .fixed_predivs = ahb_predivs, .n_predivs = ARRAY_SIZE(ahb_predivs), }, .common = { .reg = 0x054, .hw.init = CLK_HW_INIT_PARENTS("ahb", ahb_parents, &ccu_div_ops, 0), }, }; static struct clk_div_table apb0_div_table[] = { { .val = 0, .div = 2 }, { .val = 1, .div = 2 }, { .val = 2, .div = 4 }, { .val = 3, .div = 8 }, { /* Sentinel */ }, }; static SUNXI_CCU_DIV_TABLE(apb0_clk, "apb0", "ahb", 0x054, 8, 2, apb0_div_table, 0); static const char * const apb1_parents[] = { "hosc", "pll-periph", "osc32k" }; static SUNXI_CCU_MP_WITH_MUX(apb1_clk, "apb1", apb1_parents, 0x058, 0, 5, /* M */ 16, 2, /* P */ 24, 2, /* mux */ 0); static SUNXI_CCU_GATE(axi_dram_clk, "axi-dram", "axi", 0x05c, BIT(0), 0); static SUNXI_CCU_GATE(ahb_otg_clk, "ahb-otg", "ahb", 0x060, BIT(0), 0); static SUNXI_CCU_GATE(ahb_ehci_clk, "ahb-ehci", "ahb", 0x060, BIT(1), 0); static SUNXI_CCU_GATE(ahb_ohci_clk, "ahb-ohci", "ahb", 0x060, BIT(2), 0); static SUNXI_CCU_GATE(ahb_ss_clk, "ahb-ss", "ahb", 0x060, BIT(5), 0); static SUNXI_CCU_GATE(ahb_dma_clk, "ahb-dma", "ahb", 0x060, BIT(6), 0); static SUNXI_CCU_GATE(ahb_bist_clk, "ahb-bist", "ahb", 0x060, BIT(6), 0); static SUNXI_CCU_GATE(ahb_mmc0_clk, "ahb-mmc0", "ahb", 0x060, BIT(8), 0); static SUNXI_CCU_GATE(ahb_mmc1_clk, "ahb-mmc1", "ahb", 0x060, BIT(9), 0); static SUNXI_CCU_GATE(ahb_mmc2_clk, "ahb-mmc2", "ahb", 0x060, BIT(10), 0); static SUNXI_CCU_GATE(ahb_nand_clk, "ahb-nand", "ahb", 0x060, BIT(13), 0); static SUNXI_CCU_GATE(ahb_sdram_clk, "ahb-sdram", "ahb", 0x060, BIT(14), CLK_IS_CRITICAL); static SUNXI_CCU_GATE(ahb_emac_clk, "ahb-emac", "ahb", 0x060, BIT(17), 0); static SUNXI_CCU_GATE(ahb_ts_clk, "ahb-ts", "ahb", 0x060, BIT(18), 0); static SUNXI_CCU_GATE(ahb_spi0_clk, "ahb-spi0", "ahb", 0x060, BIT(20), 0); static SUNXI_CCU_GATE(ahb_spi1_clk, "ahb-spi1", "ahb", 0x060, BIT(21), 0); static SUNXI_CCU_GATE(ahb_spi2_clk, "ahb-spi2", "ahb", 0x060, BIT(22), 0); static SUNXI_CCU_GATE(ahb_gps_clk, "ahb-gps", "ahb", 0x060, BIT(26), 0); static SUNXI_CCU_GATE(ahb_hstimer_clk, "ahb-hstimer", "ahb", 0x060, BIT(28), 0); static SUNXI_CCU_GATE(ahb_ve_clk, "ahb-ve", "ahb", 0x064, BIT(0), 0); static SUNXI_CCU_GATE(ahb_tve_clk, "ahb-tve", "ahb", 0x064, BIT(2), 0); static SUNXI_CCU_GATE(ahb_lcd_clk, "ahb-lcd", "ahb", 0x064, BIT(4), 0); static SUNXI_CCU_GATE(ahb_csi_clk, "ahb-csi", "ahb", 0x064, BIT(8), 0); static SUNXI_CCU_GATE(ahb_hdmi_clk, "ahb-hdmi", "ahb", 0x064, BIT(11), 0); static SUNXI_CCU_GATE(ahb_de_be_clk, "ahb-de-be", "ahb", 0x064, BIT(12), 0); static SUNXI_CCU_GATE(ahb_de_fe_clk, "ahb-de-fe", "ahb", 0x064, BIT(14), 0); static SUNXI_CCU_GATE(ahb_iep_clk, "ahb-iep", "ahb", 0x064, BIT(19), 0); static SUNXI_CCU_GATE(ahb_gpu_clk, "ahb-gpu", "ahb", 0x064, BIT(20), 0); static SUNXI_CCU_GATE(apb0_codec_clk, "apb0-codec", "apb0", 0x068, BIT(0), 0); static SUNXI_CCU_GATE(apb0_spdif_clk, "apb0-spdif", "apb0", 0x068, BIT(1), 0); static SUNXI_CCU_GATE(apb0_i2s_clk, "apb0-i2s", "apb0", 0x068, BIT(3), 0); static SUNXI_CCU_GATE(apb0_pio_clk, "apb0-pio", "apb0", 0x068, BIT(5), 0); static SUNXI_CCU_GATE(apb0_ir_clk, "apb0-ir", "apb0", 0x068, BIT(6), 0); static SUNXI_CCU_GATE(apb0_keypad_clk, "apb0-keypad", "apb0", 0x068, BIT(10), 0); static SUNXI_CCU_GATE(apb1_i2c0_clk, "apb1-i2c0", "apb1", 0x06c, BIT(0), 0); static SUNXI_CCU_GATE(apb1_i2c1_clk, "apb1-i2c1", "apb1", 0x06c, BIT(1), 0); static SUNXI_CCU_GATE(apb1_i2c2_clk, "apb1-i2c2", "apb1", 0x06c, BIT(2), 0); static SUNXI_CCU_GATE(apb1_uart0_clk, "apb1-uart0", "apb1", 0x06c, BIT(16), 0); static SUNXI_CCU_GATE(apb1_uart1_clk, "apb1-uart1", "apb1", 0x06c, BIT(17), 0); static SUNXI_CCU_GATE(apb1_uart2_clk, "apb1-uart2", "apb1", 0x06c, BIT(18), 0); static SUNXI_CCU_GATE(apb1_uart3_clk, "apb1-uart3", "apb1", 0x06c, BIT(19), 0); static const char * const mod0_default_parents[] = { "hosc", "pll-periph", "pll-ddr-other" }; static SUNXI_CCU_MP_WITH_MUX_GATE(nand_clk, "nand", mod0_default_parents, 0x080, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(mmc0_clk, "mmc0", mod0_default_parents, 0x088, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(mmc1_clk, "mmc1", mod0_default_parents, 0x08c, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(mmc2_clk, "mmc2", mod0_default_parents, 0x090, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(ts_clk, "ts", mod0_default_parents, 0x098, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(ss_clk, "ss", mod0_default_parents, 0x09c, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(spi0_clk, "spi0", mod0_default_parents, 0x0a0, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(spi1_clk, "spi1", mod0_default_parents, 0x0a4, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(spi2_clk, "spi2", mod0_default_parents, 0x0a8, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static SUNXI_CCU_MP_WITH_MUX_GATE(ir_clk, "ir", mod0_default_parents, 0x0b0, 0, 4, /* M */ 16, 2, /* P */ 24, 2, /* mux */ BIT(31), /* gate */ 0); static const char * const i2s_parents[] = { "pll-audio-8x", "pll-audio-4x", "pll-audio-2x", "pll-audio" }; static SUNXI_CCU_MUX_WITH_GATE(i2s_clk, "i2s", i2s_parents, 0x0b8, 16, 2, BIT(31), CLK_SET_RATE_PARENT); static const char * const spdif_parents[] = { "pll-audio-8x", "pll-audio-4x", "pll-audio-2x", "pll-audio" }; static SUNXI_CCU_MUX_WITH_GATE(spdif_clk, "spdif", spdif_parents, 0x0c0, 16, 2, BIT(31), CLK_SET_RATE_PARENT); static const char * const keypad_parents[] = { "hosc", "losc"}; static const u8 keypad_table[] = { 0, 2 }; static struct ccu_mp keypad_clk = { .enable = BIT(31), .m = _SUNXI_CCU_DIV(8, 5), .p = _SUNXI_CCU_DIV(20, 2), .mux = _SUNXI_CCU_MUX_TABLE(24, 2, keypad_table), .common = { .reg = 0x0c4, .hw.init = CLK_HW_INIT_PARENTS("keypad", keypad_parents, &ccu_mp_ops, 0), }, }; static SUNXI_CCU_GATE(usb_ohci_clk, "usb-ohci", "pll-periph", 0x0cc, BIT(6), 0); static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "pll-periph", 0x0cc, BIT(8), 0); static SUNXI_CCU_GATE(usb_phy1_clk, "usb-phy1", "pll-periph", 0x0cc, BIT(9), 0); static const char * const gps_parents[] = { "hosc", "pll-periph", "pll-video1", "pll-ve" }; static SUNXI_CCU_M_WITH_MUX_GATE(gps_clk, "gps", gps_parents, 0x0d0, 0, 3, 24, 2, BIT(31), 0); static SUNXI_CCU_GATE(dram_ve_clk, "dram-ve", "pll-ddr", 0x100, BIT(0), 0); static SUNXI_CCU_GATE(dram_csi_clk, "dram-csi", "pll-ddr", 0x100, BIT(1), 0); static SUNXI_CCU_GATE(dram_ts_clk, "dram-ts", "pll-ddr", 0x100, BIT(3), 0); static SUNXI_CCU_GATE(dram_tve_clk, "dram-tve", "pll-ddr", 0x100, BIT(5), 0); static SUNXI_CCU_GATE(dram_de_fe_clk, "dram-de-fe", "pll-ddr", 0x100, BIT(25), 0); static SUNXI_CCU_GATE(dram_de_be_clk, "dram-de-be", "pll-ddr", 0x100, BIT(26), 0); static SUNXI_CCU_GATE(dram_ace_clk, "dram-ace", "pll-ddr", 0x100, BIT(29), 0); static SUNXI_CCU_GATE(dram_iep_clk, "dram-iep", "pll-ddr", 0x100, BIT(31), 0); static const char * const de_parents[] = { "pll-video0", "pll-video1", "pll-ddr-other" }; static SUNXI_CCU_M_WITH_MUX_GATE(de_be_clk, "de-be", de_parents, 0x104, 0, 4, 24, 2, BIT(31), 0); static SUNXI_CCU_M_WITH_MUX_GATE(de_fe_clk, "de-fe", de_parents, 0x10c, 0, 4, 24, 2, BIT(31), 0); static const char * const tcon_parents[] = { "pll-video0", "pll-video1", "pll-video0-2x", "pll-video1-2x" }; static SUNXI_CCU_MUX_WITH_GATE(tcon_ch0_clk, "tcon-ch0-sclk", tcon_parents, 0x118, 24, 2, BIT(31), CLK_SET_RATE_PARENT); static SUNXI_CCU_M_WITH_MUX_GATE(tcon_ch1_sclk2_clk, "tcon-ch1-sclk2", tcon_parents, 0x12c, 0, 4, 24, 2, BIT(31), CLK_SET_RATE_PARENT); static SUNXI_CCU_M_WITH_GATE(tcon_ch1_sclk1_clk, "tcon-ch1-sclk1", "tcon-ch1-sclk2", 0x12c, 11, 1, BIT(15), CLK_SET_RATE_PARENT); static const char * const csi_parents[] = { "hosc", "pll-video0", "pll-video1", "pll-video0-2x", "pll-video1-2x" }; static const u8 csi_table[] = { 0, 1, 2, 5, 6 }; static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(csi_clk, "csi", csi_parents, csi_table, 0x134, 0, 5, 24, 2, BIT(31), 0); static SUNXI_CCU_GATE(ve_clk, "ve", "pll-ve", 0x13c, BIT(31), CLK_SET_RATE_PARENT); static SUNXI_CCU_GATE(codec_clk, "codec", "pll-audio", 0x140, BIT(31), CLK_SET_RATE_PARENT); static SUNXI_CCU_GATE(avs_clk, "avs", "hosc", 0x144, BIT(31), 0); static const char * const hdmi_parents[] = { "pll-video0", "pll-video0-2x" }; static const u8 hdmi_table[] = { 0, 2 }; static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(hdmi_clk, "hdmi", hdmi_parents, hdmi_table, 0x150, 0, 4, 24, 2, BIT(31), CLK_SET_RATE_PARENT); static const char * const gpu_parents[] = { "pll-video0", "pll-ve", "pll-ddr-other", "pll-video1", "pll-video1-2x" }; static SUNXI_CCU_M_WITH_MUX_GATE(gpu_clk, "gpu", gpu_parents, 0x154, 0, 4, 24, 3, BIT(31), 0); static const char * const mbus_parents[] = { "hosc", "pll-periph", "pll-ddr" }; static SUNXI_CCU_MP_WITH_MUX_GATE(mbus_clk, "mbus", mbus_parents, 0x15c, 0, 4, 16, 2, 24, 2, BIT(31), CLK_IS_CRITICAL); static SUNXI_CCU_GATE(iep_clk, "iep", "de-be", 0x160, BIT(31), 0); static struct ccu_common *sun5i_a10s_ccu_clks[] = { &hosc_clk.common, &pll_core_clk.common, &pll_audio_base_clk.common, &pll_video0_clk.common, &pll_ve_clk.common, &pll_ddr_base_clk.common, &pll_ddr_clk.common, &pll_ddr_other_clk.common, &pll_periph_clk.common, &pll_video1_clk.common, &cpu_clk.common, &axi_clk.common, &ahb_clk.common, &apb0_clk.common, &apb1_clk.common, &axi_dram_clk.common, &ahb_otg_clk.common, &ahb_ehci_clk.common, &ahb_ohci_clk.common, &ahb_ss_clk.common, &ahb_dma_clk.common, &ahb_bist_clk.common, &ahb_mmc0_clk.common, &ahb_mmc1_clk.common, &ahb_mmc2_clk.common, &ahb_nand_clk.common, &ahb_sdram_clk.common, &ahb_emac_clk.common, &ahb_ts_clk.common, &ahb_spi0_clk.common, &ahb_spi1_clk.common, &ahb_spi2_clk.common, &ahb_gps_clk.common, &ahb_hstimer_clk.common, &ahb_ve_clk.common, &ahb_tve_clk.common, &ahb_lcd_clk.common, &ahb_csi_clk.common, &ahb_hdmi_clk.common, &ahb_de_be_clk.common, &ahb_de_fe_clk.common, &ahb_iep_clk.common, &ahb_gpu_clk.common, &apb0_codec_clk.common, &apb0_spdif_clk.common, &apb0_i2s_clk.common, &apb0_pio_clk.common, &apb0_ir_clk.common, &apb0_keypad_clk.common, &apb1_i2c0_clk.common, &apb1_i2c1_clk.common, &apb1_i2c2_clk.common, &apb1_uart0_clk.common, &apb1_uart1_clk.common, &apb1_uart2_clk.common, &apb1_uart3_clk.common, &nand_clk.common, &mmc0_clk.common, &mmc1_clk.common, &mmc2_clk.common, &ts_clk.common, &ss_clk.common, &spi0_clk.common, &spi1_clk.common, &spi2_clk.common, &ir_clk.common, &i2s_clk.common, &spdif_clk.common, &keypad_clk.common, &usb_ohci_clk.common, &usb_phy0_clk.common, &usb_phy1_clk.common, &gps_clk.common, &dram_ve_clk.common, &dram_csi_clk.common, &dram_ts_clk.common, &dram_tve_clk.common, &dram_de_fe_clk.common, &dram_de_be_clk.common, &dram_ace_clk.common, &dram_iep_clk.common, &de_be_clk.common, &de_fe_clk.common, &tcon_ch0_clk.common, &tcon_ch1_sclk2_clk.common, &tcon_ch1_sclk1_clk.common, &csi_clk.common, &ve_clk.common, &codec_clk.common, &avs_clk.common, &hdmi_clk.common, &gpu_clk.common, &mbus_clk.common, &iep_clk.common, }; /* We hardcode the divider to 4 for now */ static CLK_FIXED_FACTOR(pll_audio_clk, "pll-audio", "pll-audio-base", 4, 1, CLK_SET_RATE_PARENT); static CLK_FIXED_FACTOR(pll_audio_2x_clk, "pll-audio-2x", "pll-audio-base", 2, 1, CLK_SET_RATE_PARENT); static CLK_FIXED_FACTOR(pll_audio_4x_clk, "pll-audio-4x", "pll-audio-base", 1, 1, CLK_SET_RATE_PARENT); static CLK_FIXED_FACTOR(pll_audio_8x_clk, "pll-audio-8x", "pll-audio-base", 1, 2, CLK_SET_RATE_PARENT); static CLK_FIXED_FACTOR(pll_video0_2x_clk, "pll-video0-2x", "pll-video0", 1, 2, CLK_SET_RATE_PARENT); static CLK_FIXED_FACTOR(pll_video1_2x_clk, "pll-video1-2x", "pll-video1", 1, 2, CLK_SET_RATE_PARENT); static struct clk_hw_onecell_data sun5i_a10s_hw_clks = { .hws = { [CLK_HOSC] = &hosc_clk.common.hw, [CLK_PLL_CORE] = &pll_core_clk.common.hw, [CLK_PLL_AUDIO_BASE] = &pll_audio_base_clk.common.hw, [CLK_PLL_AUDIO] = &pll_audio_clk.hw, [CLK_PLL_AUDIO_2X] = &pll_audio_2x_clk.hw, [CLK_PLL_AUDIO_4X] = &pll_audio_4x_clk.hw, [CLK_PLL_AUDIO_8X] = &pll_audio_8x_clk.hw, [CLK_PLL_VIDEO0] = &pll_video0_clk.common.hw, [CLK_PLL_VIDEO0_2X] = &pll_video0_2x_clk.hw, [CLK_PLL_VE] = &pll_ve_clk.common.hw, [CLK_PLL_DDR_BASE] = &pll_ddr_base_clk.common.hw, [CLK_PLL_DDR] = &pll_ddr_clk.common.hw, [CLK_PLL_DDR_OTHER] = &pll_ddr_other_clk.common.hw, [CLK_PLL_PERIPH] = &pll_periph_clk.common.hw, [CLK_PLL_VIDEO1] = &pll_video1_clk.common.hw, [CLK_PLL_VIDEO1_2X] = &pll_video1_2x_clk.hw, [CLK_CPU] = &cpu_clk.common.hw, [CLK_AXI] = &axi_clk.common.hw, [CLK_AHB] = &ahb_clk.common.hw, [CLK_APB0] = &apb0_clk.common.hw, [CLK_APB1] = &apb1_clk.common.hw, [CLK_DRAM_AXI] = &axi_dram_clk.common.hw, [CLK_AHB_OTG] = &ahb_otg_clk.common.hw, [CLK_AHB_EHCI] = &ahb_ehci_clk.common.hw, [CLK_AHB_OHCI] = &ahb_ohci_clk.common.hw, [CLK_AHB_SS] = &ahb_ss_clk.common.hw, [CLK_AHB_DMA] = &ahb_dma_clk.common.hw, [CLK_AHB_BIST] = &ahb_bist_clk.common.hw, [CLK_AHB_MMC0] = &ahb_mmc0_clk.common.hw, [CLK_AHB_MMC1] = &ahb_mmc1_clk.common.hw, [CLK_AHB_MMC2] = &ahb_mmc2_clk.common.hw, [CLK_AHB_NAND] = &ahb_nand_clk.common.hw, [CLK_AHB_SDRAM] = &ahb_sdram_clk.common.hw, [CLK_AHB_EMAC] = &ahb_emac_clk.common.hw, [CLK_AHB_TS] = &ahb_ts_clk.common.hw, [CLK_AHB_SPI0] = &ahb_spi0_clk.common.hw, [CLK_AHB_SPI1] = &ahb_spi1_clk.common.hw, [CLK_AHB_SPI2] = &ahb_spi2_clk.common.hw, [CLK_AHB_GPS] = &ahb_gps_clk.common.hw, [CLK_AHB_HSTIMER] = &ahb_hstimer_clk.common.hw, [CLK_AHB_VE] = &ahb_ve_clk.common.hw, [CLK_AHB_TVE] = &ahb_tve_clk.common.hw, [CLK_AHB_LCD] = &ahb_lcd_clk.common.hw, [CLK_AHB_CSI] = &ahb_csi_clk.common.hw, [CLK_AHB_HDMI] = &ahb_hdmi_clk.common.hw, [CLK_AHB_DE_BE] = &ahb_de_be_clk.common.hw, [CLK_AHB_DE_FE] = &ahb_de_fe_clk.common.hw, [CLK_AHB_IEP] = &ahb_iep_clk.common.hw, [CLK_AHB_GPU] = &ahb_gpu_clk.common.hw, [CLK_APB0_CODEC] = &apb0_codec_clk.common.hw, [CLK_APB0_I2S] = &apb0_i2s_clk.common.hw, [CLK_APB0_PIO] = &apb0_pio_clk.common.hw, [CLK_APB0_IR] = &apb0_ir_clk.common.hw, [CLK_APB0_KEYPAD] = &apb0_keypad_clk.common.hw, [CLK_APB1_I2C0] = &apb1_i2c0_clk.common.hw, [CLK_APB1_I2C1] = &apb1_i2c1_clk.common.hw, [CLK_APB1_I2C2] = &apb1_i2c2_clk.common.hw, [CLK_APB1_UART0] = &apb1_uart0_clk.common.hw, [CLK_APB1_UART1] = &apb1_uart1_clk.common.hw, [CLK_APB1_UART2] = &apb1_uart2_clk.common.hw, [CLK_APB1_UART3] = &apb1_uart3_clk.common.hw, [CLK_NAND] = &nand_clk.common.hw, [CLK_MMC0] = &mmc0_clk.common.hw, [CLK_MMC1] = &mmc1_clk.common.hw, [CLK_MMC2] = &mmc2_clk.common.hw, [CLK_TS] = &ts_clk.common.hw, [CLK_SS] = &ss_clk.common.hw, [CLK_SPI0] = &spi0_clk.common.hw, [CLK_SPI1] = &spi1_clk.common.hw, [CLK_SPI2] = &spi2_clk.common.hw, [CLK_IR] = &ir_clk.common.hw, [CLK_I2S] = &i2s_clk.common.hw, [CLK_KEYPAD] = &keypad_clk.common.hw, [CLK_USB_OHCI] = &usb_ohci_clk.common.hw, [CLK_USB_PHY0] = &usb_phy0_clk.common.hw, [CLK_USB_PHY1] = &usb_phy1_clk.common.hw, [CLK_GPS] = &gps_clk.common.hw, [CLK_DRAM_VE] = &dram_ve_clk.common.hw, [CLK_DRAM_CSI] = &dram_csi_clk.common.hw, [CLK_DRAM_TS] = &dram_ts_clk.common.hw, [CLK_DRAM_TVE] = &dram_tve_clk.common.hw, [CLK_DRAM_DE_FE] = &dram_de_fe_clk.common.hw, [CLK_DRAM_DE_BE] = &dram_de_be_clk.common.hw, [CLK_DRAM_ACE] = &dram_ace_clk.common.hw, [CLK_DRAM_IEP] = &dram_iep_clk.common.hw, [CLK_DE_BE] = &de_be_clk.common.hw, [CLK_DE_FE] = &de_fe_clk.common.hw, [CLK_TCON_CH0] = &tcon_ch0_clk.common.hw, [CLK_TCON_CH1_SCLK] = &tcon_ch1_sclk2_clk.common.hw, [CLK_TCON_CH1] = &tcon_ch1_sclk1_clk.common.hw, [CLK_CSI] = &csi_clk.common.hw, [CLK_VE] = &ve_clk.common.hw, [CLK_CODEC] = &codec_clk.common.hw, [CLK_AVS] = &avs_clk.common.hw, [CLK_HDMI] = &hdmi_clk.common.hw, [CLK_GPU] = &gpu_clk.common.hw, [CLK_MBUS] = &mbus_clk.common.hw, [CLK_IEP] = &iep_clk.common.hw, }, .num = CLK_NUMBER, }; static struct ccu_reset_map sun5i_a10s_ccu_resets[] = { [RST_USB_PHY0] = { 0x0cc, BIT(0) }, [RST_USB_PHY1] = { 0x0cc, BIT(1) }, [RST_GPS] = { 0x0d0, BIT(30) }, [RST_DE_BE] = { 0x104, BIT(30) }, [RST_DE_FE] = { 0x10c, BIT(30) }, [RST_TVE] = { 0x118, BIT(29) }, [RST_LCD] = { 0x118, BIT(30) }, [RST_CSI] = { 0x134, BIT(30) }, [RST_VE] = { 0x13c, BIT(0) }, [RST_GPU] = { 0x154, BIT(30) }, [RST_IEP] = { 0x160, BIT(30) }, }; static const struct sunxi_ccu_desc sun5i_a10s_ccu_desc = { .ccu_clks = sun5i_a10s_ccu_clks, .num_ccu_clks = ARRAY_SIZE(sun5i_a10s_ccu_clks), .hw_clks = &sun5i_a10s_hw_clks, .resets = sun5i_a10s_ccu_resets, .num_resets = ARRAY_SIZE(sun5i_a10s_ccu_resets), }; /* * The A13 is the A10s minus the TS, GPS, HDMI, I2S and the keypad */ static struct clk_hw_onecell_data sun5i_a13_hw_clks = { .hws = { [CLK_HOSC] = &hosc_clk.common.hw, [CLK_PLL_CORE] = &pll_core_clk.common.hw, [CLK_PLL_AUDIO_BASE] = &pll_audio_base_clk.common.hw, [CLK_PLL_AUDIO] = &pll_audio_clk.hw, [CLK_PLL_AUDIO_2X] = &pll_audio_2x_clk.hw, [CLK_PLL_AUDIO_4X] = &pll_audio_4x_clk.hw, [CLK_PLL_AUDIO_8X] = &pll_audio_8x_clk.hw, [CLK_PLL_VIDEO0] = &pll_video0_clk.common.hw, [CLK_PLL_VIDEO0_2X] = &pll_video0_2x_clk.hw, [CLK_PLL_VE] = &pll_ve_clk.common.hw, [CLK_PLL_DDR_BASE] = &pll_ddr_base_clk.common.hw, [CLK_PLL_DDR] = &pll_ddr_clk.common.hw, [CLK_PLL_DDR_OTHER] = &pll_ddr_other_clk.common.hw, [CLK_PLL_PERIPH] = &pll_periph_clk.common.hw, [CLK_PLL_VIDEO1] = &pll_video1_clk.common.hw, [CLK_PLL_VIDEO1_2X] = &pll_video1_2x_clk.hw, [CLK_CPU] = &cpu_clk.common.hw, [CLK_AXI] = &axi_clk.common.hw, [CLK_AHB] = &ahb_clk.common.hw, [CLK_APB0] = &apb0_clk.common.hw, [CLK_APB1] = &apb1_clk.common.hw, [CLK_DRAM_AXI] = &axi_dram_clk.common.hw, [CLK_AHB_OTG] = &ahb_otg_clk.common.hw, [CLK_AHB_EHCI] = &ahb_ehci_clk.common.hw, [CLK_AHB_OHCI] = &ahb_ohci_clk.common.hw, [CLK_AHB_SS] = &ahb_ss_clk.common.hw, [CLK_AHB_DMA] = &ahb_dma_clk.common.hw, [CLK_AHB_BIST] = &ahb_bist_clk.common.hw, [CLK_AHB_MMC0] = &ahb_mmc0_clk.common.hw, [CLK_AHB_MMC1] = &ahb_mmc1_clk.common.hw, [CLK_AHB_MMC2] = &ahb_mmc2_clk.common.hw, [CLK_AHB_NAND] = &ahb_nand_clk.common.hw, [CLK_AHB_SDRAM] = &ahb_sdram_clk.common.hw, [CLK_AHB_EMAC] = &ahb_emac_clk.common.hw, [CLK_AHB_SPI0] = &ahb_spi0_clk.common.hw, [CLK_AHB_SPI1] = &ahb_spi1_clk.common.hw, [CLK_AHB_SPI2] = &ahb_spi2_clk.common.hw, [CLK_AHB_HSTIMER] = &ahb_hstimer_clk.common.hw, [CLK_AHB_VE] = &ahb_ve_clk.common.hw, [CLK_AHB_TVE] = &ahb_tve_clk.common.hw, [CLK_AHB_LCD] = &ahb_lcd_clk.common.hw, [CLK_AHB_CSI] = &ahb_csi_clk.common.hw, [CLK_AHB_DE_BE] = &ahb_de_be_clk.common.hw, [CLK_AHB_DE_FE] = &ahb_de_fe_clk.common.hw, [CLK_AHB_IEP] = &ahb_iep_clk.common.hw, [CLK_AHB_GPU] = &ahb_gpu_clk.common.hw, [CLK_APB0_CODEC] = &apb0_codec_clk.common.hw, [CLK_APB0_PIO] = &apb0_pio_clk.common.hw, [CLK_APB0_IR] = &apb0_ir_clk.common.hw, [CLK_APB1_I2C0] = &apb1_i2c0_clk.common.hw, [CLK_APB1_I2C1] = &apb1_i2c1_clk.common.hw, [CLK_APB1_I2C2] = &apb1_i2c2_clk.common.hw, [CLK_APB1_UART0] = &apb1_uart0_clk.common.hw, [CLK_APB1_UART1] = &apb1_uart1_clk.common.hw, [CLK_APB1_UART2] = &apb1_uart2_clk.common.hw, [CLK_APB1_UART3] = &apb1_uart3_clk.common.hw, [CLK_NAND] = &nand_clk.common.hw, [CLK_MMC0] = &mmc0_clk.common.hw, [CLK_MMC1] = &mmc1_clk.common.hw, [CLK_MMC2] = &mmc2_clk.common.hw, [CLK_SS] = &ss_clk.common.hw, [CLK_SPI0] = &spi0_clk.common.hw, [CLK_SPI1] = &spi1_clk.common.hw, [CLK_SPI2] = &spi2_clk.common.hw, [CLK_IR] = &ir_clk.common.hw, [CLK_USB_OHCI] = &usb_ohci_clk.common.hw, [CLK_USB_PHY0] = &usb_phy0_clk.common.hw, [CLK_USB_PHY1] = &usb_phy1_clk.common.hw, [CLK_DRAM_VE] = &dram_ve_clk.common.hw, [CLK_DRAM_CSI] = &dram_csi_clk.common.hw, [CLK_DRAM_TVE] = &dram_tve_clk.common.hw, [CLK_DRAM_DE_FE] = &dram_de_fe_clk.common.hw, [CLK_DRAM_DE_BE] = &dram_de_be_clk.common.hw, [CLK_DRAM_ACE] = &dram_ace_clk.common.hw, [CLK_DRAM_IEP] = &dram_iep_clk.common.hw, [CLK_DE_BE] = &de_be_clk.common.hw, [CLK_DE_FE] = &de_fe_clk.common.hw, [CLK_TCON_CH0] = &tcon_ch0_clk.common.hw, [CLK_TCON_CH1_SCLK] = &tcon_ch1_sclk2_clk.common.hw, [CLK_TCON_CH1] = &tcon_ch1_sclk1_clk.common.hw, [CLK_CSI] = &csi_clk.common.hw, [CLK_VE] = &ve_clk.common.hw, [CLK_CODEC] = &codec_clk.common.hw, [CLK_AVS] = &avs_clk.common.hw, [CLK_GPU] = &gpu_clk.common.hw, [CLK_MBUS] = &mbus_clk.common.hw, [CLK_IEP] = &iep_clk.common.hw, }, .num = CLK_NUMBER, }; static const struct sunxi_ccu_desc sun5i_a13_ccu_desc = { .ccu_clks = sun5i_a10s_ccu_clks, .num_ccu_clks = ARRAY_SIZE(sun5i_a10s_ccu_clks), .hw_clks = &sun5i_a13_hw_clks, .resets = sun5i_a10s_ccu_resets, .num_resets = ARRAY_SIZE(sun5i_a10s_ccu_resets), }; /* * The GR8 is the A10s CCU minus the HDMI and keypad, plus SPDIF */ static struct clk_hw_onecell_data sun5i_gr8_hw_clks = { .hws = { [CLK_HOSC] = &hosc_clk.common.hw, [CLK_PLL_CORE] = &pll_core_clk.common.hw, [CLK_PLL_AUDIO_BASE] = &pll_audio_base_clk.common.hw, [CLK_PLL_AUDIO] = &pll_audio_clk.hw, [CLK_PLL_AUDIO_2X] = &pll_audio_2x_clk.hw, [CLK_PLL_AUDIO_4X] = &pll_audio_4x_clk.hw, [CLK_PLL_AUDIO_8X] = &pll_audio_8x_clk.hw, [CLK_PLL_VIDEO0] = &pll_video0_clk.common.hw, [CLK_PLL_VIDEO0_2X] = &pll_video0_2x_clk.hw, [CLK_PLL_VE] = &pll_ve_clk.common.hw, [CLK_PLL_DDR_BASE] = &pll_ddr_base_clk.common.hw, [CLK_PLL_DDR] = &pll_ddr_clk.common.hw, [CLK_PLL_DDR_OTHER] = &pll_ddr_other_clk.common.hw, [CLK_PLL_PERIPH] = &pll_periph_clk.common.hw, [CLK_PLL_VIDEO1] = &pll_video1_clk.common.hw, [CLK_PLL_VIDEO1_2X] = &pll_video1_2x_clk.hw, [CLK_CPU] = &cpu_clk.common.hw, [CLK_AXI] = &axi_clk.common.hw, [CLK_AHB] = &ahb_clk.common.hw, [CLK_APB0] = &apb0_clk.common.hw, [CLK_APB1] = &apb1_clk.common.hw, [CLK_DRAM_AXI] = &axi_dram_clk.common.hw, [CLK_AHB_OTG] = &ahb_otg_clk.common.hw, [CLK_AHB_EHCI] = &ahb_ehci_clk.common.hw, [CLK_AHB_OHCI] = &ahb_ohci_clk.common.hw, [CLK_AHB_SS] = &ahb_ss_clk.common.hw, [CLK_AHB_DMA] = &ahb_dma_clk.common.hw, [CLK_AHB_BIST] = &ahb_bist_clk.common.hw, [CLK_AHB_MMC0] = &ahb_mmc0_clk.common.hw, [CLK_AHB_MMC1] = &ahb_mmc1_clk.common.hw, [CLK_AHB_MMC2] = &ahb_mmc2_clk.common.hw, [CLK_AHB_NAND] = &ahb_nand_clk.common.hw, [CLK_AHB_SDRAM] = &ahb_sdram_clk.common.hw, [CLK_AHB_EMAC] = &ahb_emac_clk.common.hw, [CLK_AHB_TS] = &ahb_ts_clk.common.hw, [CLK_AHB_SPI0] = &ahb_spi0_clk.common.hw, [CLK_AHB_SPI1] = &ahb_spi1_clk.common.hw, [CLK_AHB_SPI2] = &ahb_spi2_clk.common.hw, [CLK_AHB_GPS] = &ahb_gps_clk.common.hw, [CLK_AHB_HSTIMER] = &ahb_hstimer_clk.common.hw, [CLK_AHB_VE] = &ahb_ve_clk.common.hw, [CLK_AHB_TVE] = &ahb_tve_clk.common.hw, [CLK_AHB_LCD] = &ahb_lcd_clk.common.hw, [CLK_AHB_CSI] = &ahb_csi_clk.common.hw, [CLK_AHB_DE_BE] = &ahb_de_be_clk.common.hw, [CLK_AHB_DE_FE] = &ahb_de_fe_clk.common.hw, [CLK_AHB_IEP] = &ahb_iep_clk.common.hw, [CLK_AHB_GPU] = &ahb_gpu_clk.common.hw, [CLK_APB0_CODEC] = &apb0_codec_clk.common.hw, [CLK_APB0_SPDIF] = &apb0_spdif_clk.common.hw, [CLK_APB0_I2S] = &apb0_i2s_clk.common.hw, [CLK_APB0_PIO] = &apb0_pio_clk.common.hw, [CLK_APB0_IR] = &apb0_ir_clk.common.hw, [CLK_APB1_I2C0] = &apb1_i2c0_clk.common.hw, [CLK_APB1_I2C1] = &apb1_i2c1_clk.common.hw, [CLK_APB1_I2C2] = &apb1_i2c2_clk.common.hw, [CLK_APB1_UART0] = &apb1_uart0_clk.common.hw, [CLK_APB1_UART1] = &apb1_uart1_clk.common.hw, [CLK_APB1_UART2] = &apb1_uart2_clk.common.hw, [CLK_APB1_UART3] = &apb1_uart3_clk.common.hw, [CLK_NAND] = &nand_clk.common.hw, [CLK_MMC0] = &mmc0_clk.common.hw, [CLK_MMC1] = &mmc1_clk.common.hw, [CLK_MMC2] = &mmc2_clk.common.hw, [CLK_TS] = &ts_clk.common.hw, [CLK_SS] = &ss_clk.common.hw, [CLK_SPI0] = &spi0_clk.common.hw, [CLK_SPI1] = &spi1_clk.common.hw, [CLK_SPI2] = &spi2_clk.common.hw, [CLK_IR] = &ir_clk.common.hw, [CLK_I2S] = &i2s_clk.common.hw, [CLK_SPDIF] = &spdif_clk.common.hw, [CLK_USB_OHCI] = &usb_ohci_clk.common.hw, [CLK_USB_PHY0] = &usb_phy0_clk.common.hw, [CLK_USB_PHY1] = &usb_phy1_clk.common.hw, [CLK_GPS] = &gps_clk.common.hw, [CLK_DRAM_VE] = &dram_ve_clk.common.hw, [CLK_DRAM_CSI] = &dram_csi_clk.common.hw, [CLK_DRAM_TS] = &dram_ts_clk.common.hw, [CLK_DRAM_TVE] = &dram_tve_clk.common.hw, [CLK_DRAM_DE_FE] = &dram_de_fe_clk.common.hw, [CLK_DRAM_DE_BE] = &dram_de_be_clk.common.hw, [CLK_DRAM_ACE] = &dram_ace_clk.common.hw, [CLK_DRAM_IEP] = &dram_iep_clk.common.hw, [CLK_DE_BE] = &de_be_clk.common.hw, [CLK_DE_FE] = &de_fe_clk.common.hw, [CLK_TCON_CH0] = &tcon_ch0_clk.common.hw, [CLK_TCON_CH1_SCLK] = &tcon_ch1_sclk2_clk.common.hw, [CLK_TCON_CH1] = &tcon_ch1_sclk1_clk.common.hw, [CLK_CSI] = &csi_clk.common.hw, [CLK_VE] = &ve_clk.common.hw, [CLK_CODEC] = &codec_clk.common.hw, [CLK_AVS] = &avs_clk.common.hw, [CLK_GPU] = &gpu_clk.common.hw, [CLK_MBUS] = &mbus_clk.common.hw, [CLK_IEP] = &iep_clk.common.hw, }, .num = CLK_NUMBER, }; static const struct sunxi_ccu_desc sun5i_gr8_ccu_desc = { .ccu_clks = sun5i_a10s_ccu_clks, .num_ccu_clks = ARRAY_SIZE(sun5i_a10s_ccu_clks), .hw_clks = &sun5i_gr8_hw_clks, .resets = sun5i_a10s_ccu_resets, .num_resets = ARRAY_SIZE(sun5i_a10s_ccu_resets), }; static void __init sun5i_ccu_init(struct device_node *node, const struct sunxi_ccu_desc *desc) { void __iomem *reg; u32 val; reg = of_io_request_and_map(node, 0, of_node_full_name(node)); if (IS_ERR(reg)) { pr_err("%s: Could not map the clock registers\n", of_node_full_name(node)); return; } /* Force the PLL-Audio-1x divider to 4 */ val = readl(reg + SUN5I_PLL_AUDIO_REG); val &= ~GENMASK(19, 16); writel(val | (3 << 16), reg + SUN5I_PLL_AUDIO_REG); /* * Use the peripheral PLL as the AHB parent, instead of CPU / * AXI which have rate changes due to cpufreq. * * This is especially a big deal for the HS timer whose parent * clock is AHB. */ val = readl(reg + SUN5I_AHB_REG); val &= ~GENMASK(7, 6); writel(val | (2 << 6), reg + SUN5I_AHB_REG); sunxi_ccu_probe(node, reg, desc); } static void __init sun5i_a10s_ccu_setup(struct device_node *node) { sun5i_ccu_init(node, &sun5i_a10s_ccu_desc); } CLK_OF_DECLARE(sun5i_a10s_ccu, "allwinner,sun5i-a10s-ccu", sun5i_a10s_ccu_setup); static void __init sun5i_a13_ccu_setup(struct device_node *node) { sun5i_ccu_init(node, &sun5i_a13_ccu_desc); } CLK_OF_DECLARE(sun5i_a13_ccu, "allwinner,sun5i-a13-ccu", sun5i_a13_ccu_setup); static void __init sun5i_gr8_ccu_setup(struct device_node *node) { sun5i_ccu_init(node, &sun5i_gr8_ccu_desc); } CLK_OF_DECLARE(sun5i_gr8_ccu, "nextthing,gr8-ccu", sun5i_gr8_ccu_setup);
{ "pile_set_name": "Github" }
#tb 0: 100/2397 #media_type 0: video #codec_id 0: rawvideo #dimensions 0: 208x232 #sar 0: 0/1 0, 0, 0, 1, 54288, 0xbb88db84
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.drawBorderTop = exports.drawBorderJoin = exports.drawBorderBottom = exports.drawBorder = undefined; var _lodash = require('lodash'); var _lodash2 = _interopRequireDefault(_lodash); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /** * @typedef drawBorder~parts * @property {string} left * @property {string} right * @property {string} body * @property {string} join */ /** * @param {number[]} columnSizeIndex * @param {drawBorder~parts} parts * @returns {string} */ const drawBorder = (columnSizeIndex, parts) => { const columns = _lodash2.default.map(columnSizeIndex, size => { return _lodash2.default.repeat(parts.body, size); }).join(parts.join); return parts.left + columns + parts.right + '\n'; }; /** * @typedef drawBorderTop~parts * @property {string} topLeft * @property {string} topRight * @property {string} topBody * @property {string} topJoin */ /** * @param {number[]} columnSizeIndex * @param {drawBorderTop~parts} parts * @returns {string} */ const drawBorderTop = (columnSizeIndex, parts) => { return drawBorder(columnSizeIndex, { body: parts.topBody, join: parts.topJoin, left: parts.topLeft, right: parts.topRight }); }; /** * @typedef drawBorderJoin~parts * @property {string} joinLeft * @property {string} joinRight * @property {string} joinBody * @property {string} joinJoin */ /** * @param {number[]} columnSizeIndex * @param {drawBorderJoin~parts} parts * @returns {string} */ const drawBorderJoin = (columnSizeIndex, parts) => { return drawBorder(columnSizeIndex, { body: parts.joinBody, join: parts.joinJoin, left: parts.joinLeft, right: parts.joinRight }); }; /** * @typedef drawBorderBottom~parts * @property {string} topLeft * @property {string} topRight * @property {string} topBody * @property {string} topJoin */ /** * @param {number[]} columnSizeIndex * @param {drawBorderBottom~parts} parts * @returns {string} */ const drawBorderBottom = (columnSizeIndex, parts) => { return drawBorder(columnSizeIndex, { body: parts.bottomBody, join: parts.bottomJoin, left: parts.bottomLeft, right: parts.bottomRight }); }; exports.drawBorder = drawBorder; exports.drawBorderBottom = drawBorderBottom; exports.drawBorderJoin = drawBorderJoin; exports.drawBorderTop = drawBorderTop;
{ "pile_set_name": "Github" }
{ "images" : [ { "idiom" : "iphone", "size" : "20x20", "scale" : "2x" }, { "idiom" : "iphone", "size" : "20x20", "scale" : "3x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "3x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "[email protected]", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
using Xamarin.Forms; namespace RadioButtonDemos { public partial class GroupedRadioButtonsPage : ContentPage { public GroupedRadioButtonsPage() { InitializeComponent(); } void OnColorsRadioButtonCheckedChanged(object sender, CheckedChangedEventArgs e) { RadioButton button = sender as RadioButton; colorLabel.Text = $"You have chosen: {button.Text}"; } void OnFruitsRadioButtonCheckedChanged(object sender, CheckedChangedEventArgs e) { RadioButton button = sender as RadioButton; fruitLabel.Text = $"You have chosen: {button.Text}"; } } }
{ "pile_set_name": "Github" }
FROM python:3-onbuild WORKDIR . RUN apt-get update && apt-get install -y \ sqlite3 \ libsqlite3-dev RUN pip3 install -U pip setuptools wheel RUN pip3 install -e . RUN echo "django-x509 Installed" WORKDIR tests/ CMD ["./docker-entrypoint.sh"] EXPOSE 8000 ENV NAME djangox509
{ "pile_set_name": "Github" }
// Copyright (c) 2012-2015 Ugorji Nwoke. All rights reserved. // Use of this source code is governed by a MIT license found in the LICENSE file. package codec // By default, this json support uses base64 encoding for bytes, because you cannot // store and read any arbitrary string in json (only unicode). // However, the user can configre how to encode/decode bytes. // // This library specifically supports UTF-8 for encoding and decoding only. // // Note that the library will happily encode/decode things which are not valid // json e.g. a map[int64]string. We do it for consistency. With valid json, // we will encode and decode appropriately. // Users can specify their map type if necessary to force it. // // Note: // - we cannot use strconv.Quote and strconv.Unquote because json quotes/unquotes differently. // We implement it here. // - Also, strconv.ParseXXX for floats and integers // - only works on strings resulting in unnecessary allocation and []byte-string conversion. // - it does a lot of redundant checks, because json numbers are simpler that what it supports. // - We parse numbers (floats and integers) directly here. // We only delegate parsing floats if it is a hairy float which could cause a loss of precision. // In that case, we delegate to strconv.ParseFloat. // // Note: // - encode does not beautify. There is no whitespace when encoding. // - rpc calls which take single integer arguments or write single numeric arguments will need care. // Top-level methods of json(End|Dec)Driver (which are implementations of (en|de)cDriver // MUST not call one-another. import ( "bytes" "encoding/base64" "fmt" "reflect" "strconv" "unicode/utf16" "unicode/utf8" ) //-------------------------------- var jsonLiterals = [...]byte{'t', 'r', 'u', 'e', 'f', 'a', 'l', 's', 'e', 'n', 'u', 'l', 'l'} var jsonFloat64Pow10 = [...]float64{ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22, } var jsonUint64Pow10 = [...]uint64{ 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, } const ( // jsonUnreadAfterDecNum controls whether we unread after decoding a number. // // instead of unreading, just update d.tok (iff it's not a whitespace char) // However, doing this means that we may HOLD onto some data which belongs to another stream. // Thus, it is safest to unread the data when done. // keep behind a constant flag for now. jsonUnreadAfterDecNum = true // If !jsonValidateSymbols, decoding will be faster, by skipping some checks: // - If we see first character of null, false or true, // do not validate subsequent characters. // - e.g. if we see a n, assume null and skip next 3 characters, // and do not validate they are ull. // P.S. Do not expect a significant decoding boost from this. jsonValidateSymbols = true // if jsonTruncateMantissa, truncate mantissa if trailing 0's. // This is important because it could allow some floats to be decoded without // deferring to strconv.ParseFloat. jsonTruncateMantissa = true // if mantissa >= jsonNumUintCutoff before multiplying by 10, this is an overflow jsonNumUintCutoff = (1<<64-1)/uint64(10) + 1 // cutoff64(base) // if mantissa >= jsonNumUintMaxVal, this is an overflow jsonNumUintMaxVal = 1<<uint64(64) - 1 // jsonNumDigitsUint64Largest = 19 ) type jsonEncDriver struct { e *Encoder w encWriter h *JsonHandle b [64]byte // scratch bs []byte // scratch se setExtWrapper c containerState noBuiltInTypes } func (e *jsonEncDriver) sendContainerState(c containerState) { // determine whether to output separators if c == containerMapKey { if e.c != containerMapStart { e.w.writen1(',') } } else if c == containerMapValue { e.w.writen1(':') } else if c == containerMapEnd { e.w.writen1('}') } else if c == containerArrayElem { if e.c != containerArrayStart { e.w.writen1(',') } } else if c == containerArrayEnd { e.w.writen1(']') } e.c = c } func (e *jsonEncDriver) EncodeNil() { e.w.writeb(jsonLiterals[9:13]) // null } func (e *jsonEncDriver) EncodeBool(b bool) { if b { e.w.writeb(jsonLiterals[0:4]) // true } else { e.w.writeb(jsonLiterals[4:9]) // false } } func (e *jsonEncDriver) EncodeFloat32(f float32) { e.w.writeb(strconv.AppendFloat(e.b[:0], float64(f), 'E', -1, 32)) } func (e *jsonEncDriver) EncodeFloat64(f float64) { // e.w.writestr(strconv.FormatFloat(f, 'E', -1, 64)) e.w.writeb(strconv.AppendFloat(e.b[:0], f, 'E', -1, 64)) } func (e *jsonEncDriver) EncodeInt(v int64) { e.w.writeb(strconv.AppendInt(e.b[:0], v, 10)) } func (e *jsonEncDriver) EncodeUint(v uint64) { e.w.writeb(strconv.AppendUint(e.b[:0], v, 10)) } func (e *jsonEncDriver) EncodeExt(rv interface{}, xtag uint64, ext Ext, en *Encoder) { if v := ext.ConvertExt(rv); v == nil { e.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil() } else { en.encode(v) } } func (e *jsonEncDriver) EncodeRawExt(re *RawExt, en *Encoder) { // only encodes re.Value (never re.Data) if re.Value == nil { e.w.writeb(jsonLiterals[9:13]) // null // e.EncodeNil() } else { en.encode(re.Value) } } func (e *jsonEncDriver) EncodeArrayStart(length int) { e.w.writen1('[') e.c = containerArrayStart } func (e *jsonEncDriver) EncodeMapStart(length int) { e.w.writen1('{') e.c = containerMapStart } func (e *jsonEncDriver) EncodeString(c charEncoding, v string) { // e.w.writestr(strconv.Quote(v)) e.quoteStr(v) } func (e *jsonEncDriver) EncodeSymbol(v string) { // e.EncodeString(c_UTF8, v) e.quoteStr(v) } func (e *jsonEncDriver) EncodeStringBytes(c charEncoding, v []byte) { // if encoding raw bytes and RawBytesExt is configured, use it to encode if c == c_RAW && e.se.i != nil { e.EncodeExt(v, 0, &e.se, e.e) return } if c == c_RAW { slen := base64.StdEncoding.EncodedLen(len(v)) if cap(e.bs) >= slen { e.bs = e.bs[:slen] } else { e.bs = make([]byte, slen) } base64.StdEncoding.Encode(e.bs, v) e.w.writen1('"') e.w.writeb(e.bs) e.w.writen1('"') } else { // e.EncodeString(c, string(v)) e.quoteStr(stringView(v)) } } func (e *jsonEncDriver) EncodeAsis(v []byte) { e.w.writeb(v) } func (e *jsonEncDriver) quoteStr(s string) { // adapted from std pkg encoding/json const hex = "0123456789abcdef" w := e.w w.writen1('"') start := 0 for i := 0; i < len(s); { if b := s[i]; b < utf8.RuneSelf { if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' { i++ continue } if start < i { w.writestr(s[start:i]) } switch b { case '\\', '"': w.writen2('\\', b) case '\n': w.writen2('\\', 'n') case '\r': w.writen2('\\', 'r') case '\b': w.writen2('\\', 'b') case '\f': w.writen2('\\', 'f') case '\t': w.writen2('\\', 't') default: // encode all bytes < 0x20 (except \r, \n). // also encode < > & to prevent security holes when served to some browsers. w.writestr(`\u00`) w.writen2(hex[b>>4], hex[b&0xF]) } i++ start = i continue } c, size := utf8.DecodeRuneInString(s[i:]) if c == utf8.RuneError && size == 1 { if start < i { w.writestr(s[start:i]) } w.writestr(`\ufffd`) i += size start = i continue } // U+2028 is LINE SEPARATOR. U+2029 is PARAGRAPH SEPARATOR. // Both technically valid JSON, but bomb on JSONP, so fix here. if c == '\u2028' || c == '\u2029' { if start < i { w.writestr(s[start:i]) } w.writestr(`\u202`) w.writen1(hex[c&0xF]) i += size start = i continue } i += size } if start < len(s) { w.writestr(s[start:]) } w.writen1('"') } //-------------------------------- type jsonNum struct { // bytes []byte // may have [+-.eE0-9] mantissa uint64 // where mantissa ends, and maybe dot begins. exponent int16 // exponent value. manOverflow bool neg bool // started with -. No initial sign in the bytes above. dot bool // has dot explicitExponent bool // explicit exponent } func (x *jsonNum) reset() { x.manOverflow = false x.neg = false x.dot = false x.explicitExponent = false x.mantissa = 0 x.exponent = 0 } // uintExp is called only if exponent > 0. func (x *jsonNum) uintExp() (n uint64, overflow bool) { n = x.mantissa e := x.exponent if e >= int16(len(jsonUint64Pow10)) { overflow = true return } n *= jsonUint64Pow10[e] if n < x.mantissa || n > jsonNumUintMaxVal { overflow = true return } return // for i := int16(0); i < e; i++ { // if n >= jsonNumUintCutoff { // overflow = true // return // } // n *= 10 // } // return } // these constants are only used withn floatVal. // They are brought out, so that floatVal can be inlined. const ( jsonUint64MantissaBits = 52 jsonMaxExponent = int16(len(jsonFloat64Pow10)) - 1 ) func (x *jsonNum) floatVal() (f float64, parseUsingStrConv bool) { // We do not want to lose precision. // Consequently, we will delegate to strconv.ParseFloat if any of the following happen: // - There are more digits than in math.MaxUint64: 18446744073709551615 (20 digits) // We expect up to 99.... (19 digits) // - The mantissa cannot fit into a 52 bits of uint64 // - The exponent is beyond our scope ie beyong 22. parseUsingStrConv = x.manOverflow || x.exponent > jsonMaxExponent || (x.exponent < 0 && -(x.exponent) > jsonMaxExponent) || x.mantissa>>jsonUint64MantissaBits != 0 if parseUsingStrConv { return } // all good. so handle parse here. f = float64(x.mantissa) // fmt.Printf(".Float: uint64 value: %v, float: %v\n", m, f) if x.neg { f = -f } if x.exponent > 0 { f *= jsonFloat64Pow10[x.exponent] } else if x.exponent < 0 { f /= jsonFloat64Pow10[-x.exponent] } return } type jsonDecDriver struct { noBuiltInTypes d *Decoder h *JsonHandle r decReader c containerState // tok is used to store the token read right after skipWhiteSpace. tok uint8 bstr [8]byte // scratch used for string \UXXX parsing b [64]byte // scratch, used for parsing strings or numbers b2 [64]byte // scratch, used only for decodeBytes (after base64) bs []byte // scratch. Initialized from b. Used for parsing strings or numbers. se setExtWrapper n jsonNum } func jsonIsWS(b byte) bool { return b == ' ' || b == '\t' || b == '\r' || b == '\n' } // // This will skip whitespace characters and return the next byte to read. // // The next byte determines what the value will be one of. // func (d *jsonDecDriver) skipWhitespace() { // // fast-path: do not enter loop. Just check first (in case no whitespace). // b := d.r.readn1() // if jsonIsWS(b) { // r := d.r // for b = r.readn1(); jsonIsWS(b); b = r.readn1() { // } // } // d.tok = b // } func (d *jsonDecDriver) uncacheRead() { if d.tok != 0 { d.r.unreadn1() d.tok = 0 } } func (d *jsonDecDriver) sendContainerState(c containerState) { if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } var xc uint8 // char expected if c == containerMapKey { if d.c != containerMapStart { xc = ',' } } else if c == containerMapValue { xc = ':' } else if c == containerMapEnd { xc = '}' } else if c == containerArrayElem { if d.c != containerArrayStart { xc = ',' } } else if c == containerArrayEnd { xc = ']' } if xc != 0 { if d.tok != xc { d.d.errorf("json: expect char '%c' but got char '%c'", xc, d.tok) } d.tok = 0 } d.c = c } func (d *jsonDecDriver) CheckBreak() bool { if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } if d.tok == '}' || d.tok == ']' { // d.tok = 0 // only checking, not consuming return true } return false } func (d *jsonDecDriver) readStrIdx(fromIdx, toIdx uint8) { bs := d.r.readx(int(toIdx - fromIdx)) d.tok = 0 if jsonValidateSymbols { if !bytes.Equal(bs, jsonLiterals[fromIdx:toIdx]) { d.d.errorf("json: expecting %s: got %s", jsonLiterals[fromIdx:toIdx], bs) return } } } func (d *jsonDecDriver) TryDecodeAsNil() bool { if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } if d.tok == 'n' { d.readStrIdx(10, 13) // ull return true } return false } func (d *jsonDecDriver) DecodeBool() bool { if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } if d.tok == 'f' { d.readStrIdx(5, 9) // alse return false } if d.tok == 't' { d.readStrIdx(1, 4) // rue return true } d.d.errorf("json: decode bool: got first char %c", d.tok) return false // "unreachable" } func (d *jsonDecDriver) ReadMapStart() int { if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } if d.tok != '{' { d.d.errorf("json: expect char '%c' but got char '%c'", '{', d.tok) } d.tok = 0 d.c = containerMapStart return -1 } func (d *jsonDecDriver) ReadArrayStart() int { if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } if d.tok != '[' { d.d.errorf("json: expect char '%c' but got char '%c'", '[', d.tok) } d.tok = 0 d.c = containerArrayStart return -1 } func (d *jsonDecDriver) ContainerType() (vt valueType) { // check container type by checking the first char if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } if b := d.tok; b == '{' { return valueTypeMap } else if b == '[' { return valueTypeArray } else if b == 'n' { return valueTypeNil } else if b == '"' { return valueTypeString } return valueTypeUnset // d.d.errorf("isContainerType: unsupported parameter: %v", vt) // return false // "unreachable" } func (d *jsonDecDriver) decNum(storeBytes bool) { // If it is has a . or an e|E, decode as a float; else decode as an int. if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } b := d.tok if !(b == '+' || b == '-' || b == '.' || (b >= '0' && b <= '9')) { d.d.errorf("json: decNum: got first char '%c'", b) return } d.tok = 0 const cutoff = (1<<64-1)/uint64(10) + 1 // cutoff64(base) const jsonNumUintMaxVal = 1<<uint64(64) - 1 n := &d.n r := d.r n.reset() d.bs = d.bs[:0] // The format of a number is as below: // parsing: sign? digit* dot? digit* e? sign? digit* // states: 0 1* 2 3* 4 5* 6 7 // We honor this state so we can break correctly. var state uint8 = 0 var eNeg bool var e int16 var eof bool LOOP: for !eof { // fmt.Printf("LOOP: b: %q\n", b) switch b { case '+': switch state { case 0: state = 2 // do not add sign to the slice ... b, eof = r.readn1eof() continue case 6: // typ = jsonNumFloat state = 7 default: break LOOP } case '-': switch state { case 0: state = 2 n.neg = true // do not add sign to the slice ... b, eof = r.readn1eof() continue case 6: // typ = jsonNumFloat eNeg = true state = 7 default: break LOOP } case '.': switch state { case 0, 2: // typ = jsonNumFloat state = 4 n.dot = true default: break LOOP } case 'e', 'E': switch state { case 0, 2, 4: // typ = jsonNumFloat state = 6 // n.mantissaEndIndex = int16(len(n.bytes)) n.explicitExponent = true default: break LOOP } case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': switch state { case 0: state = 2 fallthrough case 2: fallthrough case 4: if n.dot { n.exponent-- } if n.mantissa >= jsonNumUintCutoff { n.manOverflow = true break } v := uint64(b - '0') n.mantissa *= 10 if v != 0 { n1 := n.mantissa + v if n1 < n.mantissa || n1 > jsonNumUintMaxVal { n.manOverflow = true // n+v overflows break } n.mantissa = n1 } case 6: state = 7 fallthrough case 7: if !(b == '0' && e == 0) { e = e*10 + int16(b-'0') } default: break LOOP } default: break LOOP } if storeBytes { d.bs = append(d.bs, b) } b, eof = r.readn1eof() } if jsonTruncateMantissa && n.mantissa != 0 { for n.mantissa%10 == 0 { n.mantissa /= 10 n.exponent++ } } if e != 0 { if eNeg { n.exponent -= e } else { n.exponent += e } } // d.n = n if !eof { if jsonUnreadAfterDecNum { r.unreadn1() } else { if !jsonIsWS(b) { d.tok = b } } } // fmt.Printf("1: n: bytes: %s, neg: %v, dot: %v, exponent: %v, mantissaEndIndex: %v\n", // n.bytes, n.neg, n.dot, n.exponent, n.mantissaEndIndex) return } func (d *jsonDecDriver) DecodeInt(bitsize uint8) (i int64) { d.decNum(false) n := &d.n if n.manOverflow { d.d.errorf("json: overflow integer after: %v", n.mantissa) return } var u uint64 if n.exponent == 0 { u = n.mantissa } else if n.exponent < 0 { d.d.errorf("json: fractional integer") return } else if n.exponent > 0 { var overflow bool if u, overflow = n.uintExp(); overflow { d.d.errorf("json: overflow integer") return } } i = int64(u) if n.neg { i = -i } if chkOvf.Int(i, bitsize) { d.d.errorf("json: overflow %v bits: %s", bitsize, d.bs) return } // fmt.Printf("DecodeInt: %v\n", i) return } // floatVal MUST only be called after a decNum, as d.bs now contains the bytes of the number func (d *jsonDecDriver) floatVal() (f float64) { f, useStrConv := d.n.floatVal() if useStrConv { var err error if f, err = strconv.ParseFloat(stringView(d.bs), 64); err != nil { panic(fmt.Errorf("parse float: %s, %v", d.bs, err)) } if d.n.neg { f = -f } } return } func (d *jsonDecDriver) DecodeUint(bitsize uint8) (u uint64) { d.decNum(false) n := &d.n if n.neg { d.d.errorf("json: unsigned integer cannot be negative") return } if n.manOverflow { d.d.errorf("json: overflow integer after: %v", n.mantissa) return } if n.exponent == 0 { u = n.mantissa } else if n.exponent < 0 { d.d.errorf("json: fractional integer") return } else if n.exponent > 0 { var overflow bool if u, overflow = n.uintExp(); overflow { d.d.errorf("json: overflow integer") return } } if chkOvf.Uint(u, bitsize) { d.d.errorf("json: overflow %v bits: %s", bitsize, d.bs) return } // fmt.Printf("DecodeUint: %v\n", u) return } func (d *jsonDecDriver) DecodeFloat(chkOverflow32 bool) (f float64) { d.decNum(true) f = d.floatVal() if chkOverflow32 && chkOvf.Float32(f) { d.d.errorf("json: overflow float32: %v, %s", f, d.bs) return } return } func (d *jsonDecDriver) DecodeExt(rv interface{}, xtag uint64, ext Ext) (realxtag uint64) { if ext == nil { re := rv.(*RawExt) re.Tag = xtag d.d.decode(&re.Value) } else { var v interface{} d.d.decode(&v) ext.UpdateExt(rv, v) } return } func (d *jsonDecDriver) DecodeBytes(bs []byte, isstring, zerocopy bool) (bsOut []byte) { // if decoding into raw bytes, and the RawBytesExt is configured, use it to decode. if !isstring && d.se.i != nil { bsOut = bs d.DecodeExt(&bsOut, 0, &d.se) return } d.appendStringAsBytes() // if isstring, then just return the bytes, even if it is using the scratch buffer. // the bytes will be converted to a string as needed. if isstring { return d.bs } bs0 := d.bs slen := base64.StdEncoding.DecodedLen(len(bs0)) if slen <= cap(bs) { bsOut = bs[:slen] } else if zerocopy && slen <= cap(d.b2) { bsOut = d.b2[:slen] } else { bsOut = make([]byte, slen) } slen2, err := base64.StdEncoding.Decode(bsOut, bs0) if err != nil { d.d.errorf("json: error decoding base64 binary '%s': %v", bs0, err) return nil } if slen != slen2 { bsOut = bsOut[:slen2] } return } func (d *jsonDecDriver) DecodeString() (s string) { d.appendStringAsBytes() // if x := d.s.sc; x != nil && x.so && x.st == '}' { // map key if d.c == containerMapKey { return d.d.string(d.bs) } return string(d.bs) } func (d *jsonDecDriver) appendStringAsBytes() { if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } if d.tok != '"' { d.d.errorf("json: expect char '%c' but got char '%c'", '"', d.tok) } d.tok = 0 v := d.bs[:0] var c uint8 r := d.r for { c = r.readn1() if c == '"' { break } else if c == '\\' { c = r.readn1() switch c { case '"', '\\', '/', '\'': v = append(v, c) case 'b': v = append(v, '\b') case 'f': v = append(v, '\f') case 'n': v = append(v, '\n') case 'r': v = append(v, '\r') case 't': v = append(v, '\t') case 'u': rr := d.jsonU4(false) // fmt.Printf("$$$$$$$$$: is surrogate: %v\n", utf16.IsSurrogate(rr)) if utf16.IsSurrogate(rr) { rr = utf16.DecodeRune(rr, d.jsonU4(true)) } w2 := utf8.EncodeRune(d.bstr[:], rr) v = append(v, d.bstr[:w2]...) default: d.d.errorf("json: unsupported escaped value: %c", c) } } else { v = append(v, c) } } d.bs = v } func (d *jsonDecDriver) jsonU4(checkSlashU bool) rune { r := d.r if checkSlashU && !(r.readn1() == '\\' && r.readn1() == 'u') { d.d.errorf(`json: unquoteStr: invalid unicode sequence. Expecting \u`) return 0 } // u, _ := strconv.ParseUint(string(d.bstr[:4]), 16, 64) var u uint32 for i := 0; i < 4; i++ { v := r.readn1() if '0' <= v && v <= '9' { v = v - '0' } else if 'a' <= v && v <= 'z' { v = v - 'a' + 10 } else if 'A' <= v && v <= 'Z' { v = v - 'A' + 10 } else { d.d.errorf(`json: unquoteStr: invalid hex char in \u unicode sequence: %q`, v) return 0 } u = u*16 + uint32(v) } return rune(u) } func (d *jsonDecDriver) DecodeNaked() { z := &d.d.n // var decodeFurther bool if d.tok == 0 { var b byte r := d.r for b = r.readn1(); jsonIsWS(b); b = r.readn1() { } d.tok = b } switch d.tok { case 'n': d.readStrIdx(10, 13) // ull z.v = valueTypeNil case 'f': d.readStrIdx(5, 9) // alse z.v = valueTypeBool z.b = false case 't': d.readStrIdx(1, 4) // rue z.v = valueTypeBool z.b = true case '{': z.v = valueTypeMap // d.tok = 0 // don't consume. kInterfaceNaked will call ReadMapStart // decodeFurther = true case '[': z.v = valueTypeArray // d.tok = 0 // don't consume. kInterfaceNaked will call ReadArrayStart // decodeFurther = true case '"': z.v = valueTypeString z.s = d.DecodeString() default: // number d.decNum(true) n := &d.n // if the string had a any of [.eE], then decode as float. switch { case n.explicitExponent, n.dot, n.exponent < 0, n.manOverflow: z.v = valueTypeFloat z.f = d.floatVal() case n.exponent == 0: u := n.mantissa switch { case n.neg: z.v = valueTypeInt z.i = -int64(u) case d.h.SignedInteger: z.v = valueTypeInt z.i = int64(u) default: z.v = valueTypeUint z.u = u } default: u, overflow := n.uintExp() switch { case overflow: z.v = valueTypeFloat z.f = d.floatVal() case n.neg: z.v = valueTypeInt z.i = -int64(u) case d.h.SignedInteger: z.v = valueTypeInt z.i = int64(u) default: z.v = valueTypeUint z.u = u } } // fmt.Printf("DecodeNaked: Number: %T, %v\n", v, v) } // if decodeFurther { // d.s.sc.retryRead() // } return } //---------------------- // JsonHandle is a handle for JSON encoding format. // // Json is comprehensively supported: // - decodes numbers into interface{} as int, uint or float64 // - configurable way to encode/decode []byte . // by default, encodes and decodes []byte using base64 Std Encoding // - UTF-8 support for encoding and decoding // // It has better performance than the json library in the standard library, // by leveraging the performance improvements of the codec library and // minimizing allocations. // // In addition, it doesn't read more bytes than necessary during a decode, which allows // reading multiple values from a stream containing json and non-json content. // For example, a user can read a json value, then a cbor value, then a msgpack value, // all from the same stream in sequence. type JsonHandle struct { textEncodingType BasicHandle // RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way. // If not configured, raw bytes are encoded to/from base64 text. RawBytesExt InterfaceExt } func (h *JsonHandle) SetInterfaceExt(rt reflect.Type, tag uint64, ext InterfaceExt) (err error) { return h.SetExt(rt, tag, &setExtWrapper{i: ext}) } func (h *JsonHandle) newEncDriver(e *Encoder) encDriver { hd := jsonEncDriver{e: e, w: e.w, h: h} hd.bs = hd.b[:0] hd.se.i = h.RawBytesExt return &hd } func (h *JsonHandle) newDecDriver(d *Decoder) decDriver { // d := jsonDecDriver{r: r.(*bytesDecReader), h: h} hd := jsonDecDriver{d: d, r: d.r, h: h} hd.bs = hd.b[:0] hd.se.i = h.RawBytesExt return &hd } func (e *jsonEncDriver) reset() { e.w = e.e.w } func (d *jsonDecDriver) reset() { d.r = d.d.r } var jsonEncodeTerminate = []byte{' '} func (h *JsonHandle) rpcEncodeTerminate() []byte { return jsonEncodeTerminate } var _ decDriver = (*jsonDecDriver)(nil) var _ encDriver = (*jsonEncDriver)(nil)
{ "pile_set_name": "Github" }
Brasilia, Xxxxxxxxxx, Brilliant, Brazilian, Brassily, Brilliance
{ "pile_set_name": "Github" }
################################################################################ # Validate that huge GTID_EXECUTED values are properly handled on distributed # recovery, transactions certification and certification garbage collection # procedure. # # Test: # 0. The test requires two servers: M1 and M2. # 1. Generate a huge GTID_EXECUTED with 70043 characters length. It will be # like: # aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:10000:10002:...:120000 # 2. Set huge GTID_EXECUTED on both M1 and M2. # 3. Bootstrap start on M2. The huge GTID_EXECUTED will be exchanged on # distributed recovery process on M1. # 4. Execute some transactions and check that nothing bad happens. Validate # that data is delivered to both members. # 5. Wait for stable set propagation and certification info garbage collection. # 6. Check that stable set is properly updated after stable set propagation and # certification info garbage collection. # 7. Clean up. ################################################################################ --source include/big_test.inc --source include/have_group_replication_plugin.inc --let $rpl_skip_group_replication_start= 1 --source include/group_replication.inc --echo --echo ################################################################ --echo # 1. Generate a huge GTID_EXECUTED with 70043 characters length. --echo # It will be like: --echo # aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:10000:10002:...:120000 --let $gno= 100000 --let $gno_number= 10000 --let $gtid_executed_huge= aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa:$gno while ($gno_number > 0) { --let $gno= `SELECT $gno + 2` --let $gtid_executed_huge= $gtid_executed_huge:$gno --dec $gno_number } --echo --echo ################################################################ --echo # 2. Set huge GTID_EXECUTED on both servers. --let $rpl_connection_name= server2 --source include/rpl_connection.inc --echo Set GTID_PURGED to huge gtid executed --disable_query_log --eval SET GLOBAL GTID_PURGED= "$gtid_executed_huge" --enable_query_log --let $assert_text= GTID_EXECUTED must contain all 70043 characters --let $assert_cond= [SELECT CHAR_LENGTH(@@GLOBAL.GTID_EXECUTED)] = 70043 --source include/assert.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc --echo Set GTID_PURGED to huge gtid executed --disable_query_log --eval SET GLOBAL GTID_PURGED= "$gtid_executed_huge" --enable_query_log --let $assert_text= GTID_EXECUTED must contain all 70043 characters --let $assert_cond= [SELECT CHAR_LENGTH(@@GLOBAL.GTID_EXECUTED)] = 70043 --source include/assert.inc --echo --echo ################################################################ --echo # 3. Start Group Replication. --echo # The huge GTID_EXECUTED will be exchanged on distributed --echo # recovery process on server1. --let $rpl_connection_name= server2 --source include/rpl_connection.inc --source include/start_and_bootstrap_group_replication.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc --source include/start_group_replication.inc --echo --echo ################################################################ --echo # 4. Execute some transactions and check that nothing bad happens. --echo # Validate that data is delivered to both members. --let $rpl_connection_name= server2 --source include/rpl_connection.inc CREATE TABLE t1 (c1 INT NOT NULL PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); --source include/rpl_sync.inc --let $rpl_connection_name= server2 --source include/rpl_connection.inc --let $assert_text= 'There is a value 1 in table t1' --let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1 --source include/assert.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc --let $assert_text= 'There is a value 1 in table t1' --let $assert_cond= [SELECT COUNT(*) AS count FROM t1 WHERE t1.c1 = 1, count, 1] = 1 --source include/assert.inc --echo --echo ############################################################ --echo # 5. Wait for stable set propagation and certification info --echo # garbage collection. --let $rpl_connection_name= server2 --source include/rpl_connection.inc --let $_gtid_executed= `SELECT @@GLOBAL.GTID_EXECUTED` --let $wait_timeout= 240 --let $wait_condition= SELECT COUNT(*)=1 FROM performance_schema.replication_group_member_stats WHERE Transactions_committed_all_members = "$_gtid_executed" and member_id in (SELECT @@server_uuid) --source include/wait_condition.inc --echo --echo ############################################################ --echo # 6. Check that stable set is properly updated after stable --echo # set propagation and certification info garbage --echo # collection. --let $rpl_connection_name= server2 --source include/rpl_connection.inc --let $assert_text= 'Transactions_committed_all_members must be equal to GTID_EXECUTED' --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "[SELECT Transactions_committed_all_members from performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid)]" --source include/assert.inc --let $rpl_connection_name= server1 --source include/rpl_connection.inc --let $assert_text= 'Transactions_committed_all_members must be equal to GTID_EXECUTED' --let $assert_cond= "[SELECT @@GLOBAL.GTID_EXECUTED]" = "[SELECT Transactions_committed_all_members from performance_schema.replication_group_member_stats where member_id in (SELECT @@server_uuid)]" --source include/assert.inc --echo --echo ############################################################ --echo # 7. Clean up. DROP TABLE t1; --source include/group_replication_end.inc
{ "pile_set_name": "Github" }
package com.utkarshsinha.gyrorecorder; import android.annotation.TargetApi; import android.content.Context; import android.hardware.Camera; import android.hardware.Sensor; import android.hardware.SensorEvent; import android.hardware.SensorEventListener; import android.hardware.SensorManager; import android.media.CamcorderProfile; import android.media.MediaRecorder; import android.os.AsyncTask; import android.os.Build; import android.os.Environment; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.TextureView; import android.view.View; import android.widget.Button; import java.io.File; import java.io.IOException; import java.io.PrintStream; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; public class Recorder extends AppCompatActivity implements SensorEventListener { private TextureView mPreview; // Used for displaying the live camera preview private Camera mCamera; // Object to contact the camera hardware private MediaRecorder mMediaRecorder; // Store the camera's image stream as a video private boolean isRecording = false; // Is video being recoded? private Button btnRecord; // Button that triggers recording private SensorManager mSensorManager; private Sensor mGyro; private PrintStream mGyroFile; private long mStartTime = -1; private static String TAG = "GyroRecorder"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_recorder); mPreview = (TextureView)findViewById(R.id.texturePreview); btnRecord = (Button)findViewById(R.id.btnRecord); btnRecord.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { onCaptureClick(view); } }); mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE); mGyro = mSensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE); mSensorManager.registerListener(this, mGyro, SensorManager.SENSOR_DELAY_FASTEST); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_recorder, menu); return true; } @Override public boolean onOptionsItemSelected(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } public void onCaptureClick(View view) { if (isRecording) { // Already recording? Release camera lock for others mMediaRecorder.stop(); releaseMediaRecorder(); mCamera.lock(); isRecording = false; releaseCamera(); mGyroFile.close(); mGyroFile = null; btnRecord.setText("Start"); mStartTime = -1; } else { // We haven't been recording – create a new thread that initiates it new MediaPrepareTask().execute(null, null, null); } } private void releaseMediaRecorder() { if(mMediaRecorder != null) { mMediaRecorder.reset(); mMediaRecorder.release(); mMediaRecorder = null; mCamera.lock(); } } @TargetApi(Build.VERSION_CODES.HONEYCOMB) private boolean prepareVideoRecorder() { mCamera = Camera.open(); Camera.Parameters parameters = mCamera.getParameters(); List<Camera.Size> mSupportedPreviewSizes = parameters.getSupportedPreviewSizes(); Camera.Size optimalSize = getOptimalPreviewSize(mSupportedPreviewSizes, mPreview.getWidth(), mPreview.getHeight()); parameters.setPreviewSize(optimalSize.width, optimalSize.height); CamcorderProfile profile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH); profile.videoFrameWidth = optimalSize.width; profile.videoFrameHeight = optimalSize.height; mCamera.setParameters(parameters); try { mCamera.setPreviewTexture(mPreview.getSurfaceTexture()); } catch(IOException e) { Log.e(TAG, "Surface texture is unavailable or unsuitable" + e.getMessage()); return false; } mMediaRecorder = new MediaRecorder(); mCamera.unlock(); mMediaRecorder.setCamera(mCamera); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mMediaRecorder.setOutputFormat(profile.fileFormat); mMediaRecorder.setVideoFrameRate(profile.videoFrameRate); mMediaRecorder.setVideoSize(profile.videoFrameWidth, profile.videoFrameHeight); mMediaRecorder.setVideoEncodingBitRate(profile.videoBitRate); mMediaRecorder.setVideoEncoder(profile.videoCodec); mMediaRecorder.setOutputFile(getOutputMediaFile().toString()); try { mGyroFile = new PrintStream(getOutputGyroFile()); mGyroFile.append("gyro\n"); } catch(IOException e) { Log.d(TAG, "Unable to create acquisition file"); return false; } try { mMediaRecorder.prepare(); } catch (IllegalStateException e) { Log.d(TAG, "IllegalStateException preparing MediaRecorder: " + e.getMessage()); releaseMediaRecorder(); return false; } catch (IOException e) { Log.d(TAG, "IOException preparing MediaRecorder: " + e.getMessage()); releaseMediaRecorder(); return false; } return true; } private File getOutputGyroFile() { if(!Environment.getExternalStorageState().equalsIgnoreCase(Environment.MEDIA_MOUNTED)) { return null; } File gyroStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "Recorder"); if(!gyroStorageDir.exists()) { if(!gyroStorageDir.mkdirs()) { Log.d("Recorder", "Failed to create directory"); return null; } } String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); File gyroFile; gyroFile = new File(gyroStorageDir.getPath() + File.separator + "VID_" + timeStamp + "gyro.csv"); return gyroFile; } private Camera.Size getOptimalPreviewSize(List<Camera.Size> sizes, int w, int h) { final double ASPECT_TOLERANCE = 0.1; double targetRatio = (double)w / h; if(sizes == null) { return null; } Camera.Size optimalSize = null; double minDiff = Double.MAX_VALUE; int targetHeight = h; for (Camera.Size size : sizes) { double ratio = (double)size.width / size.height; double diff = Math.abs(ratio - targetRatio); if(Math.abs(ratio - targetRatio) > ASPECT_TOLERANCE) continue; if(Math.abs(size.height - targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height - targetHeight); } } if(optimalSize == null) { minDiff = Double.MAX_VALUE; for(Camera.Size size : sizes) { if(Math.abs(size.height-targetHeight) < minDiff) { optimalSize = size; minDiff = Math.abs(size.height-targetHeight); } } } return optimalSize; } private File getOutputMediaFile() { if(!Environment.getExternalStorageState().equalsIgnoreCase(Environment.MEDIA_MOUNTED)) { return null; } File mediaStorageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), "Recorder"); if(!mediaStorageDir.exists()) { if(!mediaStorageDir.mkdirs()) { Log.d("Recorder", "Failed to create directory"); return null; } } String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); File mediaFile; mediaFile = new File(mediaStorageDir.getPath() + File.separator + "VID_" + timeStamp + ".mp4"); return mediaFile; } private void releaseCamera() { if(mCamera != null) { mCamera.release(); mCamera = null; } } @Override protected void onPause() { super.onPause(); releaseMediaRecorder(); releaseCamera(); } @Override public void onAccuracyChanged(Sensor sensor, int accuracy) { } @Override public void onSensorChanged(SensorEvent sensorEvent) { if(isRecording) { if(mStartTime == -1) { mStartTime = sensorEvent.timestamp; } mGyroFile.append(sensorEvent.values[0] + "," + sensorEvent.values[1] + "," + sensorEvent.values[2] + "," + (sensorEvent.timestamp-mStartTime) + "\n"); } } class MediaPrepareTask extends AsyncTask<Void, Void, Boolean> { @Override protected Boolean doInBackground(Void... voids) { if(prepareVideoRecorder()) { mMediaRecorder.start(); isRecording = true; } else { releaseMediaRecorder(); return false; } return true; } @Override protected void onPostExecute(Boolean result) { if(!result) { Recorder.this.finish(); } btnRecord.setText("Stop"); } } }
{ "pile_set_name": "Github" }
django.jQuery(function($) { var type_select = $('#id_type'), vpn_specific = $('.field-vpn, .field-auto_cert'), gettext = window.gettext || function(v){ return v; }, toggle_vpn_specific = function(changed){ if (type_select.val() == 'vpn') { vpn_specific.show(); if (changed === true && $('.autovpn').length < 1 && $('#id_config').val() === '{}') { var p1 = gettext('Click on Save to automatically generate the ' + 'VPN client configuration (will be based on ' + 'the configuration of the server).'), p2 = gettext('You can then tweak the VPN client ' + 'configuration in the next step.'); $('.jsoneditor-wrapper').hide() .after('<div class="form-row autovpn"></div>'); $('.autovpn').html('<p><strong>' + p1 + '</strong></p>' + '<p><strong>' + p2 + '</strong></p>'); } } else{ vpn_specific.hide(); if ($('.autovpn').length > 0) { $('.jsoneditor-wrapper').show(); $('.autovpn').hide(); } } }; type_select.on('change', function(){ toggle_vpn_specific(true); }); toggle_vpn_specific(); });
{ "pile_set_name": "Github" }
/* * Driver for DVBSky USB2.0 receiver * * Copyright (C) 2013 Max nibble <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "dvb_usb.h" #include "m88ds3103.h" #include "ts2020.h" #include "sp2.h" #include "si2168.h" #include "si2157.h" #define DVBSKY_MSG_DELAY 0/*2000*/ #define DVBSKY_BUF_LEN 64 static int dvb_usb_dvbsky_disable_rc; module_param_named(disable_rc, dvb_usb_dvbsky_disable_rc, int, 0644); MODULE_PARM_DESC(disable_rc, "Disable inbuilt IR receiver."); DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); struct dvbsky_state { struct mutex stream_mutex; u8 ibuf[DVBSKY_BUF_LEN]; u8 obuf[DVBSKY_BUF_LEN]; u8 last_lock; struct i2c_client *i2c_client_demod; struct i2c_client *i2c_client_tuner; struct i2c_client *i2c_client_ci; /* fe hook functions*/ int (*fe_set_voltage)(struct dvb_frontend *fe, enum fe_sec_voltage voltage); int (*fe_read_status)(struct dvb_frontend *fe, enum fe_status *status); }; static int dvbsky_usb_generic_rw(struct dvb_usb_device *d, u8 *wbuf, u16 wlen, u8 *rbuf, u16 rlen) { int ret; struct dvbsky_state *state = d_to_priv(d); mutex_lock(&d->usb_mutex); if (wlen != 0) memcpy(state->obuf, wbuf, wlen); ret = dvb_usbv2_generic_rw_locked(d, state->obuf, wlen, state->ibuf, rlen); if (!ret && (rlen != 0)) memcpy(rbuf, state->ibuf, rlen); mutex_unlock(&d->usb_mutex); return ret; } static int dvbsky_stream_ctrl(struct dvb_usb_device *d, u8 onoff) { struct dvbsky_state *state = d_to_priv(d); int ret; u8 obuf_pre[3] = { 0x37, 0, 0 }; u8 obuf_post[3] = { 0x36, 3, 0 }; mutex_lock(&state->stream_mutex); ret = dvbsky_usb_generic_rw(d, obuf_pre, 3, NULL, 0); if (!ret && onoff) { msleep(20); ret = dvbsky_usb_generic_rw(d, obuf_post, 3, NULL, 0); } mutex_unlock(&state->stream_mutex); return ret; } static int dvbsky_streaming_ctrl(struct dvb_frontend *fe, int onoff) { struct dvb_usb_device *d = fe_to_d(fe); return dvbsky_stream_ctrl(d, (onoff == 0) ? 0 : 1); } /* GPIO */ static int dvbsky_gpio_ctrl(struct dvb_usb_device *d, u8 gport, u8 value) { int ret; u8 obuf[3], ibuf[2]; obuf[0] = 0x0e; obuf[1] = gport; obuf[2] = value; ret = dvbsky_usb_generic_rw(d, obuf, 3, ibuf, 1); if (ret) dev_err(&d->udev->dev, "failed=%d\n", ret); return ret; } /* I2C */ static int dvbsky_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num) { struct dvb_usb_device *d = i2c_get_adapdata(adap); int ret = 0; u8 ibuf[64], obuf[64]; if (mutex_lock_interruptible(&d->i2c_mutex) < 0) return -EAGAIN; if (num > 2) { dev_err(&d->udev->dev, "too many i2c messages[%d], max 2.", num); ret = -EOPNOTSUPP; goto i2c_error; } if (num == 1) { if (msg[0].len > 60) { dev_err(&d->udev->dev, "too many i2c bytes[%d], max 60.", msg[0].len); ret = -EOPNOTSUPP; goto i2c_error; } if (msg[0].flags & I2C_M_RD) { /* single read */ obuf[0] = 0x09; obuf[1] = 0; obuf[2] = msg[0].len; obuf[3] = msg[0].addr; ret = dvbsky_usb_generic_rw(d, obuf, 4, ibuf, msg[0].len + 1); if (ret) dev_err(&d->udev->dev, "failed=%d\n", ret); if (!ret) memcpy(msg[0].buf, &ibuf[1], msg[0].len); } else { /* write */ obuf[0] = 0x08; obuf[1] = msg[0].addr; obuf[2] = msg[0].len; memcpy(&obuf[3], msg[0].buf, msg[0].len); ret = dvbsky_usb_generic_rw(d, obuf, msg[0].len + 3, ibuf, 1); if (ret) dev_err(&d->udev->dev, "failed=%d\n", ret); } } else { if ((msg[0].len > 60) || (msg[1].len > 60)) { dev_err(&d->udev->dev, "too many i2c bytes[w-%d][r-%d], max 60.", msg[0].len, msg[1].len); ret = -EOPNOTSUPP; goto i2c_error; } /* write then read */ obuf[0] = 0x09; obuf[1] = msg[0].len; obuf[2] = msg[1].len; obuf[3] = msg[0].addr; memcpy(&obuf[4], msg[0].buf, msg[0].len); ret = dvbsky_usb_generic_rw(d, obuf, msg[0].len + 4, ibuf, msg[1].len + 1); if (ret) dev_err(&d->udev->dev, "failed=%d\n", ret); if (!ret) memcpy(msg[1].buf, &ibuf[1], msg[1].len); } i2c_error: mutex_unlock(&d->i2c_mutex); return (ret) ? ret : num; } static u32 dvbsky_i2c_func(struct i2c_adapter *adapter) { return I2C_FUNC_I2C; } static struct i2c_algorithm dvbsky_i2c_algo = { .master_xfer = dvbsky_i2c_xfer, .functionality = dvbsky_i2c_func, }; #if IS_ENABLED(CONFIG_RC_CORE) static int dvbsky_rc_query(struct dvb_usb_device *d) { u32 code = 0xffff, scancode; u8 rc5_command, rc5_system; u8 obuf[2], ibuf[2], toggle; int ret; obuf[0] = 0x10; ret = dvbsky_usb_generic_rw(d, obuf, 1, ibuf, 2); if (ret) dev_err(&d->udev->dev, "failed=%d\n", ret); if (ret == 0) code = (ibuf[0] << 8) | ibuf[1]; if (code != 0xffff) { dev_dbg(&d->udev->dev, "rc code: %x\n", code); rc5_command = code & 0x3F; rc5_system = (code & 0x7C0) >> 6; toggle = (code & 0x800) ? 1 : 0; scancode = rc5_system << 8 | rc5_command; rc_keydown(d->rc_dev, RC_TYPE_RC5, scancode, toggle); } return 0; } static int dvbsky_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc) { if (dvb_usb_dvbsky_disable_rc) { rc->map_name = NULL; return 0; } rc->allowed_protos = RC_BIT_RC5; rc->query = dvbsky_rc_query; rc->interval = 300; return 0; } #else #define dvbsky_get_rc_config NULL #endif static int dvbsky_usb_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) { struct dvb_usb_device *d = fe_to_d(fe); struct dvbsky_state *state = d_to_priv(d); u8 value; if (voltage == SEC_VOLTAGE_OFF) value = 0; else value = 1; dvbsky_gpio_ctrl(d, 0x80, value); return state->fe_set_voltage(fe, voltage); } static int dvbsky_read_mac_addr(struct dvb_usb_adapter *adap, u8 mac[6]) { struct dvb_usb_device *d = adap_to_d(adap); u8 obuf[] = { 0x1e, 0x00 }; u8 ibuf[6] = { 0 }; struct i2c_msg msg[] = { { .addr = 0x51, .flags = 0, .buf = obuf, .len = 2, }, { .addr = 0x51, .flags = I2C_M_RD, .buf = ibuf, .len = 6, } }; if (i2c_transfer(&d->i2c_adap, msg, 2) == 2) memcpy(mac, ibuf, 6); return 0; } static int dvbsky_usb_read_status(struct dvb_frontend *fe, enum fe_status *status) { struct dvb_usb_device *d = fe_to_d(fe); struct dvbsky_state *state = d_to_priv(d); int ret; ret = state->fe_read_status(fe, status); /* it need resync slave fifo when signal change from unlock to lock.*/ if ((*status & FE_HAS_LOCK) && (!state->last_lock)) dvbsky_stream_ctrl(d, 1); state->last_lock = (*status & FE_HAS_LOCK) ? 1 : 0; return ret; } static const struct m88ds3103_config dvbsky_s960_m88ds3103_config = { .i2c_addr = 0x68, .clock = 27000000, .i2c_wr_max = 33, .clock_out = 0, .ts_mode = M88DS3103_TS_CI, .ts_clk = 16000, .ts_clk_pol = 0, .agc = 0x99, .lnb_hv_pol = 1, .lnb_en_pol = 1, }; static int dvbsky_s960_attach(struct dvb_usb_adapter *adap) { struct dvbsky_state *state = adap_to_priv(adap); struct dvb_usb_device *d = adap_to_d(adap); int ret = 0; /* demod I2C adapter */ struct i2c_adapter *i2c_adapter; struct i2c_client *client; struct i2c_board_info info; struct ts2020_config ts2020_config = {}; memset(&info, 0, sizeof(struct i2c_board_info)); /* attach demod */ adap->fe[0] = dvb_attach(m88ds3103_attach, &dvbsky_s960_m88ds3103_config, &d->i2c_adap, &i2c_adapter); if (!adap->fe[0]) { dev_err(&d->udev->dev, "dvbsky_s960_attach fail.\n"); ret = -ENODEV; goto fail_attach; } /* attach tuner */ ts2020_config.fe = adap->fe[0]; ts2020_config.get_agc_pwm = m88ds3103_get_agc_pwm; strlcpy(info.type, "ts2020", I2C_NAME_SIZE); info.addr = 0x60; info.platform_data = &ts2020_config; request_module("ts2020"); client = i2c_new_device(i2c_adapter, &info); if (client == NULL || client->dev.driver == NULL) { dvb_frontend_detach(adap->fe[0]); ret = -ENODEV; goto fail_attach; } if (!try_module_get(client->dev.driver->owner)) { i2c_unregister_device(client); dvb_frontend_detach(adap->fe[0]); ret = -ENODEV; goto fail_attach; } /* delegate signal strength measurement to tuner */ adap->fe[0]->ops.read_signal_strength = adap->fe[0]->ops.tuner_ops.get_rf_strength; /* hook fe: need to resync the slave fifo when signal locks. */ state->fe_read_status = adap->fe[0]->ops.read_status; adap->fe[0]->ops.read_status = dvbsky_usb_read_status; /* hook fe: LNB off/on is control by Cypress usb chip. */ state->fe_set_voltage = adap->fe[0]->ops.set_voltage; adap->fe[0]->ops.set_voltage = dvbsky_usb_set_voltage; state->i2c_client_tuner = client; fail_attach: return ret; } static int dvbsky_usb_ci_set_voltage(struct dvb_frontend *fe, enum fe_sec_voltage voltage) { struct dvb_usb_device *d = fe_to_d(fe); struct dvbsky_state *state = d_to_priv(d); u8 value; if (voltage == SEC_VOLTAGE_OFF) value = 0; else value = 1; dvbsky_gpio_ctrl(d, 0x00, value); return state->fe_set_voltage(fe, voltage); } static int dvbsky_ci_ctrl(void *priv, u8 read, int addr, u8 data, int *mem) { struct dvb_usb_device *d = priv; int ret = 0; u8 command[4], respond[2], command_size, respond_size; command[1] = (u8)((addr >> 8) & 0xff); /*high part of address*/ command[2] = (u8)(addr & 0xff); /*low part of address*/ if (read) { command[0] = 0x71; command_size = 3; respond_size = 2; } else { command[0] = 0x70; command[3] = data; command_size = 4; respond_size = 1; } ret = dvbsky_usb_generic_rw(d, command, command_size, respond, respond_size); if (ret) goto err; if (read) *mem = respond[1]; return ret; err: dev_err(&d->udev->dev, "ci control failed=%d\n", ret); return ret; } static const struct m88ds3103_config dvbsky_s960c_m88ds3103_config = { .i2c_addr = 0x68, .clock = 27000000, .i2c_wr_max = 33, .clock_out = 0, .ts_mode = M88DS3103_TS_CI, .ts_clk = 10000, .ts_clk_pol = 1, .agc = 0x99, .lnb_hv_pol = 0, .lnb_en_pol = 1, }; static int dvbsky_s960c_attach(struct dvb_usb_adapter *adap) { struct dvbsky_state *state = adap_to_priv(adap); struct dvb_usb_device *d = adap_to_d(adap); int ret = 0; /* demod I2C adapter */ struct i2c_adapter *i2c_adapter; struct i2c_client *client_tuner, *client_ci; struct i2c_board_info info; struct sp2_config sp2_config; struct ts2020_config ts2020_config = {}; memset(&info, 0, sizeof(struct i2c_board_info)); /* attach demod */ adap->fe[0] = dvb_attach(m88ds3103_attach, &dvbsky_s960c_m88ds3103_config, &d->i2c_adap, &i2c_adapter); if (!adap->fe[0]) { dev_err(&d->udev->dev, "dvbsky_s960ci_attach fail.\n"); ret = -ENODEV; goto fail_attach; } /* attach tuner */ ts2020_config.fe = adap->fe[0]; ts2020_config.get_agc_pwm = m88ds3103_get_agc_pwm; strlcpy(info.type, "ts2020", I2C_NAME_SIZE); info.addr = 0x60; info.platform_data = &ts2020_config; request_module("ts2020"); client_tuner = i2c_new_device(i2c_adapter, &info); if (client_tuner == NULL || client_tuner->dev.driver == NULL) { ret = -ENODEV; goto fail_tuner_device; } if (!try_module_get(client_tuner->dev.driver->owner)) { ret = -ENODEV; goto fail_tuner_module; } /* attach ci controller */ memset(&sp2_config, 0, sizeof(sp2_config)); sp2_config.dvb_adap = &adap->dvb_adap; sp2_config.priv = d; sp2_config.ci_control = dvbsky_ci_ctrl; memset(&info, 0, sizeof(struct i2c_board_info)); strlcpy(info.type, "sp2", I2C_NAME_SIZE); info.addr = 0x40; info.platform_data = &sp2_config; request_module("sp2"); client_ci = i2c_new_device(&d->i2c_adap, &info); if (client_ci == NULL || client_ci->dev.driver == NULL) { ret = -ENODEV; goto fail_ci_device; } if (!try_module_get(client_ci->dev.driver->owner)) { ret = -ENODEV; goto fail_ci_module; } /* delegate signal strength measurement to tuner */ adap->fe[0]->ops.read_signal_strength = adap->fe[0]->ops.tuner_ops.get_rf_strength; /* hook fe: need to resync the slave fifo when signal locks. */ state->fe_read_status = adap->fe[0]->ops.read_status; adap->fe[0]->ops.read_status = dvbsky_usb_read_status; /* hook fe: LNB off/on is control by Cypress usb chip. */ state->fe_set_voltage = adap->fe[0]->ops.set_voltage; adap->fe[0]->ops.set_voltage = dvbsky_usb_ci_set_voltage; state->i2c_client_tuner = client_tuner; state->i2c_client_ci = client_ci; return ret; fail_ci_module: i2c_unregister_device(client_ci); fail_ci_device: module_put(client_tuner->dev.driver->owner); fail_tuner_module: i2c_unregister_device(client_tuner); fail_tuner_device: dvb_frontend_detach(adap->fe[0]); fail_attach: return ret; } static int dvbsky_t680c_attach(struct dvb_usb_adapter *adap) { struct dvbsky_state *state = adap_to_priv(adap); struct dvb_usb_device *d = adap_to_d(adap); int ret = 0; struct i2c_adapter *i2c_adapter; struct i2c_client *client_demod, *client_tuner, *client_ci; struct i2c_board_info info; struct si2168_config si2168_config; struct si2157_config si2157_config; struct sp2_config sp2_config; /* attach demod */ memset(&si2168_config, 0, sizeof(si2168_config)); si2168_config.i2c_adapter = &i2c_adapter; si2168_config.fe = &adap->fe[0]; si2168_config.ts_mode = SI2168_TS_PARALLEL; memset(&info, 0, sizeof(struct i2c_board_info)); strlcpy(info.type, "si2168", I2C_NAME_SIZE); info.addr = 0x64; info.platform_data = &si2168_config; request_module(info.type); client_demod = i2c_new_device(&d->i2c_adap, &info); if (client_demod == NULL || client_demod->dev.driver == NULL) goto fail_demod_device; if (!try_module_get(client_demod->dev.driver->owner)) goto fail_demod_module; /* attach tuner */ memset(&si2157_config, 0, sizeof(si2157_config)); si2157_config.fe = adap->fe[0]; si2157_config.if_port = 1; memset(&info, 0, sizeof(struct i2c_board_info)); strlcpy(info.type, "si2157", I2C_NAME_SIZE); info.addr = 0x60; info.platform_data = &si2157_config; request_module(info.type); client_tuner = i2c_new_device(i2c_adapter, &info); if (client_tuner == NULL || client_tuner->dev.driver == NULL) goto fail_tuner_device; if (!try_module_get(client_tuner->dev.driver->owner)) goto fail_tuner_module; /* attach ci controller */ memset(&sp2_config, 0, sizeof(sp2_config)); sp2_config.dvb_adap = &adap->dvb_adap; sp2_config.priv = d; sp2_config.ci_control = dvbsky_ci_ctrl; memset(&info, 0, sizeof(struct i2c_board_info)); strlcpy(info.type, "sp2", I2C_NAME_SIZE); info.addr = 0x40; info.platform_data = &sp2_config; request_module(info.type); client_ci = i2c_new_device(&d->i2c_adap, &info); if (client_ci == NULL || client_ci->dev.driver == NULL) goto fail_ci_device; if (!try_module_get(client_ci->dev.driver->owner)) goto fail_ci_module; state->i2c_client_demod = client_demod; state->i2c_client_tuner = client_tuner; state->i2c_client_ci = client_ci; return ret; fail_ci_module: i2c_unregister_device(client_ci); fail_ci_device: module_put(client_tuner->dev.driver->owner); fail_tuner_module: i2c_unregister_device(client_tuner); fail_tuner_device: module_put(client_demod->dev.driver->owner); fail_demod_module: i2c_unregister_device(client_demod); fail_demod_device: ret = -ENODEV; return ret; } static int dvbsky_t330_attach(struct dvb_usb_adapter *adap) { struct dvbsky_state *state = adap_to_priv(adap); struct dvb_usb_device *d = adap_to_d(adap); int ret = 0; struct i2c_adapter *i2c_adapter; struct i2c_client *client_demod, *client_tuner; struct i2c_board_info info; struct si2168_config si2168_config; struct si2157_config si2157_config; /* attach demod */ memset(&si2168_config, 0, sizeof(si2168_config)); si2168_config.i2c_adapter = &i2c_adapter; si2168_config.fe = &adap->fe[0]; si2168_config.ts_mode = SI2168_TS_PARALLEL; si2168_config.ts_clock_gapped = true; memset(&info, 0, sizeof(struct i2c_board_info)); strlcpy(info.type, "si2168", I2C_NAME_SIZE); info.addr = 0x64; info.platform_data = &si2168_config; request_module(info.type); client_demod = i2c_new_device(&d->i2c_adap, &info); if (client_demod == NULL || client_demod->dev.driver == NULL) goto fail_demod_device; if (!try_module_get(client_demod->dev.driver->owner)) goto fail_demod_module; /* attach tuner */ memset(&si2157_config, 0, sizeof(si2157_config)); si2157_config.fe = adap->fe[0]; si2157_config.if_port = 1; memset(&info, 0, sizeof(struct i2c_board_info)); strlcpy(info.type, "si2157", I2C_NAME_SIZE); info.addr = 0x60; info.platform_data = &si2157_config; request_module(info.type); client_tuner = i2c_new_device(i2c_adapter, &info); if (client_tuner == NULL || client_tuner->dev.driver == NULL) goto fail_tuner_device; if (!try_module_get(client_tuner->dev.driver->owner)) goto fail_tuner_module; state->i2c_client_demod = client_demod; state->i2c_client_tuner = client_tuner; return ret; fail_tuner_module: i2c_unregister_device(client_tuner); fail_tuner_device: module_put(client_demod->dev.driver->owner); fail_demod_module: i2c_unregister_device(client_demod); fail_demod_device: ret = -ENODEV; return ret; } static int dvbsky_identify_state(struct dvb_usb_device *d, const char **name) { dvbsky_gpio_ctrl(d, 0x04, 1); msleep(20); dvbsky_gpio_ctrl(d, 0x83, 0); dvbsky_gpio_ctrl(d, 0xc0, 1); msleep(100); dvbsky_gpio_ctrl(d, 0x83, 1); dvbsky_gpio_ctrl(d, 0xc0, 0); msleep(50); return WARM; } static int dvbsky_init(struct dvb_usb_device *d) { struct dvbsky_state *state = d_to_priv(d); /* use default interface */ /* ret = usb_set_interface(d->udev, 0, 0); if (ret) return ret; */ mutex_init(&state->stream_mutex); state->last_lock = 0; return 0; } static void dvbsky_exit(struct dvb_usb_device *d) { struct dvbsky_state *state = d_to_priv(d); struct i2c_client *client; client = state->i2c_client_tuner; /* remove I2C tuner */ if (client) { module_put(client->dev.driver->owner); i2c_unregister_device(client); } client = state->i2c_client_demod; /* remove I2C demod */ if (client) { module_put(client->dev.driver->owner); i2c_unregister_device(client); } client = state->i2c_client_ci; /* remove I2C ci */ if (client) { module_put(client->dev.driver->owner); i2c_unregister_device(client); } } /* DVB USB Driver stuff */ static struct dvb_usb_device_properties dvbsky_s960_props = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct dvbsky_state), .generic_bulk_ctrl_endpoint = 0x01, .generic_bulk_ctrl_endpoint_response = 0x81, .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY, .i2c_algo = &dvbsky_i2c_algo, .frontend_attach = dvbsky_s960_attach, .init = dvbsky_init, .get_rc_config = dvbsky_get_rc_config, .streaming_ctrl = dvbsky_streaming_ctrl, .identify_state = dvbsky_identify_state, .exit = dvbsky_exit, .read_mac_address = dvbsky_read_mac_addr, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096), } } }; static struct dvb_usb_device_properties dvbsky_s960c_props = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct dvbsky_state), .generic_bulk_ctrl_endpoint = 0x01, .generic_bulk_ctrl_endpoint_response = 0x81, .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY, .i2c_algo = &dvbsky_i2c_algo, .frontend_attach = dvbsky_s960c_attach, .init = dvbsky_init, .get_rc_config = dvbsky_get_rc_config, .streaming_ctrl = dvbsky_streaming_ctrl, .identify_state = dvbsky_identify_state, .exit = dvbsky_exit, .read_mac_address = dvbsky_read_mac_addr, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096), } } }; static struct dvb_usb_device_properties dvbsky_t680c_props = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct dvbsky_state), .generic_bulk_ctrl_endpoint = 0x01, .generic_bulk_ctrl_endpoint_response = 0x81, .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY, .i2c_algo = &dvbsky_i2c_algo, .frontend_attach = dvbsky_t680c_attach, .init = dvbsky_init, .get_rc_config = dvbsky_get_rc_config, .streaming_ctrl = dvbsky_streaming_ctrl, .identify_state = dvbsky_identify_state, .exit = dvbsky_exit, .read_mac_address = dvbsky_read_mac_addr, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096), } } }; static struct dvb_usb_device_properties dvbsky_t330_props = { .driver_name = KBUILD_MODNAME, .owner = THIS_MODULE, .adapter_nr = adapter_nr, .size_of_priv = sizeof(struct dvbsky_state), .generic_bulk_ctrl_endpoint = 0x01, .generic_bulk_ctrl_endpoint_response = 0x81, .generic_bulk_ctrl_delay = DVBSKY_MSG_DELAY, .i2c_algo = &dvbsky_i2c_algo, .frontend_attach = dvbsky_t330_attach, .init = dvbsky_init, .get_rc_config = dvbsky_get_rc_config, .streaming_ctrl = dvbsky_streaming_ctrl, .identify_state = dvbsky_identify_state, .exit = dvbsky_exit, .read_mac_address = dvbsky_read_mac_addr, .num_adapters = 1, .adapter = { { .stream = DVB_USB_STREAM_BULK(0x82, 8, 4096), } } }; static const struct usb_device_id dvbsky_id_table[] = { { DVB_USB_DEVICE(0x0572, 0x6831, &dvbsky_s960_props, "DVBSky S960/S860", RC_MAP_DVBSKY) }, { DVB_USB_DEVICE(0x0572, 0x960c, &dvbsky_s960c_props, "DVBSky S960CI", RC_MAP_DVBSKY) }, { DVB_USB_DEVICE(0x0572, 0x680c, &dvbsky_t680c_props, "DVBSky T680CI", RC_MAP_DVBSKY) }, { DVB_USB_DEVICE(0x0572, 0x0320, &dvbsky_t330_props, "DVBSky T330", RC_MAP_DVBSKY) }, { DVB_USB_DEVICE(USB_VID_TECHNOTREND, USB_PID_TECHNOTREND_TVSTICK_CT2_4400, &dvbsky_t330_props, "TechnoTrend TVStick CT2-4400", RC_MAP_TT_1500) }, { DVB_USB_DEVICE(USB_VID_TECHNOTREND, USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI, &dvbsky_t680c_props, "TechnoTrend TT-connect CT2-4650 CI", RC_MAP_TT_1500) }, { DVB_USB_DEVICE(USB_VID_TERRATEC, USB_PID_TERRATEC_H7_3, &dvbsky_t680c_props, "Terratec H7 Rev.4", RC_MAP_TT_1500) }, { } }; MODULE_DEVICE_TABLE(usb, dvbsky_id_table); static struct usb_driver dvbsky_usb_driver = { .name = KBUILD_MODNAME, .id_table = dvbsky_id_table, .probe = dvb_usbv2_probe, .disconnect = dvb_usbv2_disconnect, .suspend = dvb_usbv2_suspend, .resume = dvb_usbv2_resume, .reset_resume = dvb_usbv2_reset_resume, .no_dynamic_id = 1, .soft_unbind = 1, }; module_usb_driver(dvbsky_usb_driver); MODULE_AUTHOR("Max nibble <[email protected]>"); MODULE_DESCRIPTION("Driver for DVBSky USB"); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
$NetBSD: patch-lib_stdio.in.h,v 1.1 2015/06/30 21:39:09 richard Exp $ avoid warnings w.r.t. gets() when c++ is used --- lib/stdio.in.h.orig 2015-01-15 08:25:52.000000000 +0000 +++ lib/stdio.in.h @@ -723,7 +723,7 @@ _GL_WARN_ON_USE (getline, "getline is un so any use of gets warrants an unconditional warning; besides, C11 removed it. */ #undef gets -#if HAVE_RAW_DECL_GETS +#if HAVE_RAW_DECL_GETS && !defined(__cplusplus) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); #endif
{ "pile_set_name": "Github" }
<?php /* Copyright (C) 2011-08/2014 Alexander Zagniotov Copyright (C) 2015 Norbert Preining 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/>. */ if ( !function_exists( 'add_action' ) ) { echo "Hi there! I'm just a plugin, not much I can do when called directly."; exit; } if ( !function_exists('sgmp_enqueue_head_scripts') ): function sgmp_enqueue_head_scripts() { wp_enqueue_script( array ( 'jquery' ) ); } endif; if ( !function_exists('sgmp_google_map_admin_add_style') ): function sgmp_google_map_admin_add_style() { wp_enqueue_style('slick-google-map-style', SGMP_PLUGIN_CSS . '/sgmp.admin.css', false, SGMP_VERSION, "screen"); } endif; if ( !function_exists('sgmp_google_map_admin_add_script') ): function sgmp_google_map_admin_add_script() { if (sgmp_should_load_admin_scripts()) { $whitelist = array('localhost', '127.0.0.1'); wp_enqueue_script('sgmp-jquery-tools-tooltip', SGMP_PLUGIN_JS .'/jquery.tools.tooltip.min.js', array('jquery'), '1.2.5.a', true); $minified = ".min"; if (in_array($_SERVER['HTTP_HOST'], $whitelist)) { $minified = ""; } wp_enqueue_script('sgmp-jquery-tokeninput', SGMP_PLUGIN_JS. '/sgmp.tokeninput'.$minified.'.js', array('jquery'), SGMP_VERSION, true); /* temp fix - will probably be fixed with https://core.trac.wordpress.org/ticket/29520#comment:17 wp_enqueue_script('slick-google-map-plugin', SGMP_PLUGIN_JS. '/sgmp.admin'.$minified.'.js', array('jquery', 'media', 'wp-ajax-response'), SGMP_VERSION, true); */ wp_enqueue_script('slick-google-map-plugin', SGMP_PLUGIN_JS. '/sgmp.admin'.$minified.'.js', array('jquery', 'wp-ajax-response'), SGMP_VERSION, true); } if (sgmp_should_find_posts_scripts()) { add_action('admin_footer', 'find_posts_div', 99); } } endif; if ( !function_exists('sgmp_insert_shortcode_to_post_action_callback') ): function sgmp_insert_shortcode_to_post_action_callback() { //check_ajax_referer( "sgmp_insert_shortcode_to_post_action", "_ajax_nonce"); if (isset($_POST['postId']) && isset($_POST['shortcodeName'])) { $post = get_post($_POST['postId']); $post_content = $post->post_content; $persisted_shortcodes_json = get_option(SGMP_PERSISTED_SHORTCODES); if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "") { $persisted_shortcodes = json_decode($persisted_shortcodes_json, true); if (is_array($persisted_shortcodes) && !empty($persisted_shortcodes)) { if (isset($persisted_shortcodes[$_POST['shortcodeName']])) { $shortcode = $persisted_shortcodes[$_POST['shortcodeName']]; if (is_array($shortcode)) { $shortcode_id = substr(md5(rand()), 0, 10); $raw_code = $shortcode['code']; $cleaned_code = str_replace("TO_BE_GENERATED", $shortcode_id, $raw_code); $updated_post_attribs = array('ID' => $_POST['postId'], 'post_content' => $post_content."<br />".$cleaned_code); wp_update_post( $updated_post_attribs ); echo isset($post->post_title) && trim($post->post_title) != "" ? $post->post_title : "Titleless"; } } } } } die(); } endif; if ( !function_exists('sgmp_should_find_posts_scripts') ): function sgmp_should_find_posts_scripts() { $admin_pages = array('sgmp-saved-shortcodes'); $plugin_admin_page = isset($_REQUEST['page']) && trim($_REQUEST['page']) != "" ? $_REQUEST['page'] : ""; return in_array($plugin_admin_page, $admin_pages); } endif; if ( !function_exists('sgmp_google_map_tab_script') ): function sgmp_google_map_tab_script() { wp_enqueue_script('sgmp-jquery-tools-tabs', SGMP_PLUGIN_JS .'/jquery.tools.tabs.min.js', array('jquery'), '1.2.5', true); } endif; if ( !function_exists('sgmp_google_map_register_scripts') ): function sgmp_google_map_register_scripts() { $whitelist = array('localhost', '127.0.0.1'); $minified = ".min"; if (in_array($_SERVER['HTTP_HOST'], $whitelist)) { $minified = ""; } wp_register_script('sgmp-google-map-orchestrator-framework', SGMP_PLUGIN_JS. '/sgmp.framework'.$minified.'.js', array(), SGMP_VERSION, true); $api = SGMP_GOOGLE_API_URL; if (is_ssl()) { $api = SGMP_GOOGLE_API_URL_SSL; } wp_register_script('sgmp-google-map-jsapi', $api, array(), false, true); } endif; if ( !function_exists('sgmp_google_map_init_global_admin_html_object') ): function sgmp_google_map_init_global_admin_html_object() { if (is_admin()) { echo "<object id='global-data-placeholder' class='sgmp-data-placeholder'>".PHP_EOL; echo " <param id='sep' name='sep' value='".SGMP_SEP."' />".PHP_EOL; echo " <param id='ajaxurl' name='ajaxurl' value='".admin_url('admin-ajax.php')."' />".PHP_EOL; echo " <param id='version' name='version' value='".SGMP_VERSION."' />".PHP_EOL; $persisted_shortcodes_json = get_option(SGMP_PERSISTED_SHORTCODES); if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "" && is_array(json_decode($persisted_shortcodes_json, true))) { echo " <param id='shortcodes' name='shortcodes' value='".$persisted_shortcodes_json."' />".PHP_EOL; } else { echo " <param id='shortcodes' name='shortcodes' value='".json_encode(array())."' />".PHP_EOL; } echo " <param id='assets' name='assets' value='".SGMP_PLUGIN_ASSETS_URI."' />".PHP_EOL; echo " <param id='customMarkersUri' name='customMarkersUri' value='".SGMP_PLUGIN_IMAGES."/markers/' />".PHP_EOL; echo " <param id='defaultLocationText' name='defaultLocationText' value='Enter marker destination address or latitude,longitude here (required)' />".PHP_EOL; echo " <param id='defaultBubbleText' name='defaultBubbleText' value='Enter marker info bubble text here (optional)' />".PHP_EOL; echo "</object> ".PHP_EOL; } } endif; if ( !function_exists('sgmp_generate_global_options') ): function sgmp_generate_global_options() { $tokens_with_values = array(); $tokens_with_values['LABEL_KML'] = '[TITLE] [MSG] ([STATUS])'; $tokens_with_values['LABEL_DOCINVALID_KML'] = __('The KML file is not a valid KML, KMZ or GeoRSS document.',SGMP_NAME); $tokens_with_values['LABEL_FETCHERROR_KML'] = __('The KML file could not be fetched.',SGMP_NAME); $tokens_with_values['LABEL_LIMITS_KML'] = __('The KML file exceeds the feature limits of KmlLayer.',SGMP_NAME); $tokens_with_values['LABEL_NOTFOUND_KML'] = __('The KML file could not be found. Most likely it is an invalid URL, or the document is not publicly available.',SGMP_NAME); $tokens_with_values['LABEL_REQUESTINVALID_KML'] = __('The KmlLayer is invalid.',SGMP_NAME); $tokens_with_values['LABEL_TIMEDOUT_KML'] = __('The KML file could not be loaded within a reasonable amount of time.',SGMP_NAME); $tokens_with_values['LABEL_TOOLARGE_KML'] = __('The KML file exceeds the file size limits of KmlLayer.',SGMP_NAME); $tokens_with_values['LABEL_UNKNOWN_KML'] = __('The KML file failed to load for an unknown reason.',SGMP_NAME); $tokens_with_values = array_map('sgmp_escape_json',$tokens_with_values); $global_error_messages_json_template = sgmp_render_template_with_values($tokens_with_values, SGMP_HTML_TEMPLATE_GLOBAL_ERROR_MESSAGES); $tokens_with_values = array(); $tokens_with_values['LABEL_STREETVIEW'] = __('Street View',SGMP_NAME); $tokens_with_values['LABEL_ADDRESS'] = __('Address',SGMP_NAME); $tokens_with_values['LABEL_DIRECTIONS'] = __('Directions',SGMP_NAME); $tokens_with_values['LABEL_TOHERE'] = __('To here',SGMP_NAME); $tokens_with_values['LABEL_FROMHERE'] = __('From here',SGMP_NAME); $tokens_with_values = array_map('sgmp_escape_json',$tokens_with_values); $info_bubble_translated_template = sgmp_render_template_with_values($tokens_with_values, SGMP_HTML_TEMPLATE_INFO_BUBBLE); global $sgmp_global_map_language; $sgmp_global_map_language = (isset($sgmp_global_map_language) && $sgmp_global_map_language != '') ? $sgmp_global_map_language : "en"; $errorArray = json_decode($global_error_messages_json_template, true); $translationArray = json_decode($info_bubble_translated_template, true); $properties = array(); $properties['ajaxurl'] = admin_url('admin-ajax.php'); $properties['noBubbleDescriptionProvided'] = SGMP_NO_BUBBLE_DESC; $properties['geoValidationClientRevalidate'] = SGMP_GEO_VALIDATION_CLIENT_REVALIDATE; $properties['cssHref'] = SGMP_PLUGIN_URI."style.css?ver=".SGMP_VERSION; $properties['language'] = $sgmp_global_map_language; $properties['customMarkersUri'] = SGMP_PLUGIN_IMAGES."/markers/"; foreach($errorArray as $name => $value) { $properties[$name] = $value; } foreach($translationArray as $name => $value) { $properties[$name] = $value; } $setting_map_should_fill_viewport = get_option(SGMP_DB_SETTINGS_MAP_SHOULD_FILL_VIEWPORT); if (isset($setting_map_should_fill_viewport) && $setting_map_should_fill_viewport == "true") { $properties['mapFillViewport'] = "true"; } else { $properties['mapFillViewport'] = "false"; } $properties[SGMP_TIMESTAMP] = wp_create_nonce(SGMP_AJAX_CACHE_MAP_ACTION); $properties['ajaxCacheMapAction'] = SGMP_AJAX_CACHE_MAP_ACTION; $properties['sep'] = SGMP_SEP; echo "<script type='text/javascript'>".PHP_EOL; echo "/* <![CDATA[ */".PHP_EOL; echo "// Slick Google Map plugin v".SGMP_VERSION.PHP_EOL; echo "var SGMPGlobal = ".json_encode($properties).PHP_EOL; echo "/* ]]> */".PHP_EOL; echo "</script>".PHP_EOL; } endif; if ( !function_exists('sgmp_escape_json') ): function sgmp_escape_json( $encode ) { return str_replace( array("'",'"','&') , array('\u0027','\u0022','\u0026') , $encode ); } endif; ?>
{ "pile_set_name": "Github" }
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)) #define HAVE_STD_ATOMIC 1 #else #define HAVE_STD_ATOMIC 0 #endif #if __gnu_linux__ && __clang__ /* There is bug in clang on GNU/Linux, when it uses gcc's stdatomic.h instead of own one * and this cause compiler error. */ #undef HAVE_STD_ATOMIC #define HAVE_STD_ATOMIC 0 #endif #if HAVE_STD_ATOMIC #include <stdatomic.h> #include <assert.h> #include <pthread.h> #include <stdio.h> #define MAX_THREADS 200 #define MAX_THREAD_COUNTER 100000 atomic_int value = ATOMIC_VAR_INIT(0); int nvalue = 0; void *worker(void *arg) { (void)arg; int i; for (i = 0; i < MAX_THREAD_COUNTER; ++i) { atomic_fetch_add(&value, 1); ++nvalue; } for (i = 0; i < MAX_THREAD_COUNTER/2; ++i) { atomic_fetch_sub(&value, 15); nvalue -= 15; } for (i = 0; i < MAX_THREAD_COUNTER/2; ++i) { atomic_fetch_add(&value, 10); nvalue += 10; } for (i = 0; i < MAX_THREAD_COUNTER/2; ++i) { atomic_fetch_add(&value, 5); nvalue += 5; } return NULL; } void test() { int i; int v; pthread_t ths[MAX_THREADS]; printf("=== Starting %d threads...\n", MAX_THREADS); for (i = 0; i < MAX_THREADS; ++i) assert(pthread_create(&ths[i], NULL, &worker, NULL) == 0); printf("=== Joining %d threads...\n", MAX_THREADS); for (i = 0; i < MAX_THREADS; ++i) assert(pthread_join(ths[i], NULL) == 0); v = atomic_load(&value); printf("=== Atomic counter: %d\n", v); printf("=== Non-atomic counter: %d\n", nvalue); assert(v == MAX_THREADS * MAX_THREAD_COUNTER); } #endif /* HAVE_STD_ATOMIC */ int main() { #if HAVE_STD_ATOMIC test(); #endif return 0; }
{ "pile_set_name": "Github" }
/* * Copyright 2011 Apple Inc. * * All Rights Reserved. * * 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 on 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 (including the * next paragraph) 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 * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS * 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. */ #ifndef __compsize_h__ #define __compsize_h__ extern GLint __glColorTableParameterfv_size(GLenum pname); extern GLint __glColorTableParameteriv_size(GLenum pname); extern GLint __glConvolutionParameterfv_size(GLenum pname); extern GLint __glConvolutionParameteriv_size(GLenum pname); extern GLint __glFogfv_size(GLenum pname); extern GLint __glFogiv_size(GLenum pname); extern GLint __glLightModelfv_size(GLenum pname); extern GLint __glLightModeliv_size(GLenum pname); extern GLint __glLightfv_size(GLenum pname); extern GLint __glLightiv_size(GLenum pname); extern GLint __glMaterialfv_size(GLenum pname); extern GLint __glMaterialiv_size(GLenum pname); extern GLint __glTexEnvfv_size(GLenum e); extern GLint __glTexEnviv_size(GLenum e); extern GLint __glTexGendv_size(GLenum e); extern GLint __glTexGenfv_size(GLenum e); extern GLint __glTexGeniv_size(GLenum e); extern GLint __glTexParameterfv_size(GLenum e); extern GLint __glTexParameteriv_size(GLenum e); extern GLint __glCallLists_size(GLsizei n, GLenum type); extern GLint __glDrawPixels_size(GLenum format, GLenum type, GLsizei w, GLsizei h); extern GLint __glBitmap_size(GLsizei w, GLsizei h); extern GLint __glTexImage1D_size(GLenum format, GLenum type, GLsizei w); extern GLint __glTexImage2D_size(GLenum format, GLenum type, GLsizei w, GLsizei h); extern GLint __glTexImage3D_size(GLenum format, GLenum type, GLsizei w, GLsizei h, GLsizei d); #endif /* !__compsize_h__ */
{ "pile_set_name": "Github" }
LIBRARY ; zlib data compression and ZIP file I/O library VERSION 1.2.8 EXPORTS adler32 @1 compress @2 crc32 @3 deflate @4 deflateCopy @5 deflateEnd @6 deflateInit2_ @7 deflateInit_ @8 deflateParams @9 deflateReset @10 deflateSetDictionary @11 gzclose @12 gzdopen @13 gzerror @14 gzflush @15 gzopen @16 gzread @17 gzwrite @18 inflate @19 inflateEnd @20 inflateInit2_ @21 inflateInit_ @22 inflateReset @23 inflateSetDictionary @24 inflateSync @25 uncompress @26 zlibVersion @27 gzprintf @28 gzputc @29 gzgetc @30 gzseek @31 gzrewind @32 gztell @33 gzeof @34 gzsetparams @35 zError @36 inflateSyncPoint @37 get_crc_table @38 compress2 @39 gzputs @40 gzgets @41 inflateCopy @42 inflateBackInit_ @43 inflateBack @44 inflateBackEnd @45 compressBound @46 deflateBound @47 gzclearerr @48 gzungetc @49 zlibCompileFlags @50 deflatePrime @51 deflatePending @52 unzOpen @61 unzClose @62 unzGetGlobalInfo @63 unzGetCurrentFileInfo @64 unzGoToFirstFile @65 unzGoToNextFile @66 unzOpenCurrentFile @67 unzReadCurrentFile @68 unzOpenCurrentFile3 @69 unztell @70 unzeof @71 unzCloseCurrentFile @72 unzGetGlobalComment @73 unzStringFileNameCompare @74 unzLocateFile @75 unzGetLocalExtrafield @76 unzOpen2 @77 unzOpenCurrentFile2 @78 unzOpenCurrentFilePassword @79 zipOpen @80 zipOpenNewFileInZip @81 zipWriteInFileInZip @82 zipCloseFileInZip @83 zipClose @84 zipOpenNewFileInZip2 @86 zipCloseFileInZipRaw @87 zipOpen2 @88 zipOpenNewFileInZip3 @89 unzGetFilePos @100 unzGoToFilePos @101 fill_win32_filefunc @110 ; zlibwapi v1.2.4 added: fill_win32_filefunc64 @111 fill_win32_filefunc64A @112 fill_win32_filefunc64W @113 unzOpen64 @120 unzOpen2_64 @121 unzGetGlobalInfo64 @122 unzGetCurrentFileInfo64 @124 unzGetCurrentFileZStreamPos64 @125 unztell64 @126 unzGetFilePos64 @127 unzGoToFilePos64 @128 zipOpen64 @130 zipOpen2_64 @131 zipOpenNewFileInZip64 @132 zipOpenNewFileInZip2_64 @133 zipOpenNewFileInZip3_64 @134 zipOpenNewFileInZip4_64 @135 zipCloseFileInZipRaw64 @136 ; zlib1 v1.2.4 added: adler32_combine @140 crc32_combine @142 deflateSetHeader @144 deflateTune @145 gzbuffer @146 gzclose_r @147 gzclose_w @148 gzdirect @149 gzoffset @150 inflateGetHeader @156 inflateMark @157 inflatePrime @158 inflateReset2 @159 inflateUndermine @160 ; zlib1 v1.2.6 added: gzgetc_ @161 inflateResetKeep @163 deflateResetKeep @164 ; zlib1 v1.2.7 added: gzopen_w @165 ; zlib1 v1.2.8 added: inflateGetDictionary @166 gzvprintf @167
{ "pile_set_name": "Github" }
fileFormatVersion: 2 guid: 54ab053b5f4414ff9a8a7e81b545fe23 NativeFormatImporter: externalObjects: {} mainObjectFileID: 0 userData: assetBundleName: assetBundleVariant:
{ "pile_set_name": "Github" }
# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. # Experimental features are described in docs/process/experimental-flags.md # (Despite the name, they are not really intended for experiments.) # They are intended to enable new features or enhancements that are being # developed and are not yet shipped. Experimental feature flags are expected # to be relatively short-lived. # # ### Code Generation # # When you change this file, run the following to update analyzer and kernel: # # analyzer: # dart pkg/analyzer/tool/experiments/generate.dart # # kernel: # pkg/front_end/tool/fasta generate-experimental-flags # # ### Overview # # This document consists mostly of a map called "features". # Each entry in this map corresponds to an experiment, # and contains the following parts: # # 1. help: (required text) # A human readable description of the experiment. # # 2. enabledIn: (optional #.#) # The Dart SDK version (<major>.<minor>) in which the experiment is shipping. # # If this field is specified, then the experiment is enabled regardless of # the actual version of the SDK. If this field is omitted, then the # experiment is disabled by default, but may be enabled by specifying the # flag on the command line. (e.g. --enable-experiment=non-nullable) # # A version less than this version may be specified in a .packages file # or in a library language version override (e.g. // @dart = 2.1) # to disable this feature. For more on library language version override, see # https://github.com/dart-lang/language/blob/master/accepted/future-releases/language-versioning/language-versioning.md # # 3. expired: (optional boolean) # If true, then the experiment can no longer be enabled by specifying the # flag on the command line, and the corresponding entry is slated for # eventual removal from this file. If this field is omitted, then 'expired' # is considered to be false. # # Using the above fields, experiments pass through several states: # # Disabled: # When an experiment is first added to this file, the 'enabledIn' and # 'expired' fields are omitted and the experiment is disabled by default, # but may be enabled by specifying the flag on the command line. # The implementation teams begin building support for the feature, # guarded by the flag. Users can enable the flag and begin to try out # the feature as it is being developed. # # Experimental release: # When an experiment is released, then the 'experimentalReleaseVersion' field # is added indicating which version of the SDK contains this new language # feature for libraries and packages in mentioned in # `sdk/lib/_internal/allowed_experiments.json`. For other libraries and # packages, passing the experiment flag is still required to turn on the # experiment. # # Shipped: # When an experiment is shipped, then the 'enabledIn' field is added # indicating which version of the SDK contains this new language feature. # At this point, specifying the flag on the command line has no effect because # the experiment is enabled by default and cannot be disabled. # # Retired or Rejected: # At some point, the 'expired' field is added to the experiment indicating # that the flag is to be retired if the experiment has shipped or that the # entire experiment was rejected if the experiment has not shipped. It also # indicates that the corresponding entry is slated for eventual removal # from this file. Users specifying this flag on the command line should receive # a warning that the experiment has been retired or rejected, but the tool # should continue to run. # # In addition, there is also a value called "current-version" # specifying the version of Dart that is currently being developed. # Dart source files that don't specify their own version will be # presumed to be in this version. Experiment flags will not affect # files that specify an earlier version. # # Furthermore, most of the above was designed with language features # (spanning both CFE and Analyzer) in mind, but didn't take into account # features in individual products (e.g. in CFE that has no influence on # Analyzer). As a stepping-stone to allow for this usage as well, a "category" # is also available. If no "category" is specified it's assumed to be the # default 'language' "category" with code generated for both CFE and Analyzer, # while other categories can be tailored more specifically. current-version: '2.11.0' features: non-nullable: help: "Non Nullable by default" experimentalReleaseVersion: '2.10.0' triple-shift: help: "Triple-shift operator" variance: help: "Sound variance" nonfunction-type-aliases: help: "Type aliases define a <type>, not just a <functionType>" alternative-invalidation-strategy: help: "Alternative invalidation strategy for incremental compilation" category: "CFE" value-class: help: "Value class" # # Flags below this line are shipped, retired, or rejected, cannot be specified # on the command line, and will eventually be removed. # extension-methods: help: "Extension Methods" enabledIn: '2.6.0' constant-update-2018: help: "Enhanced constant expressions" enabledIn: '2.0.0' expired: true control-flow-collections: help: "Control Flow Collections" enabledIn: '2.0.0' expired: true set-literals: help: "Set Literals" enabledIn: '2.0.0' expired: true spread-collections: help: "Spread Collections" enabledIn: '2.0.0' expired: true
{ "pile_set_name": "Github" }
/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20 * http://trentrichardson.com/examples/timepicker * Copyright (c) 2016 Trent Richardson; Licensed MIT */ (function (factory) { if (typeof define === 'function' && define.amd) { define(['jquery', 'jquery-ui'], factory); } else { factory(jQuery); } }(function ($) { /* * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded" */ $.ui.timepicker = $.ui.timepicker || {}; if ($.ui.timepicker.version) { return; } /* * Extend jQueryUI, get it started with our version number */ $.extend($.ui, { timepicker: { version: "1.6.3" } }); /* * Timepicker manager. * Use the singleton instance of this class, $.timepicker, to interact with the time picker. * Settings for (groups of) time pickers are maintained in an instance object, * allowing multiple different settings on the same page. */ var Timepicker = function () { this.regional = []; // Available regional settings, indexed by language code this.regional[''] = { // Default regional settings currentText: 'Now', closeText: 'Done', amNames: ['AM', 'A'], pmNames: ['PM', 'P'], timeFormat: 'HH:mm', timeSuffix: '', timeOnlyTitle: 'Choose Time', timeText: 'Time', hourText: 'Hour', minuteText: 'Minute', secondText: 'Second', millisecText: 'Millisecond', microsecText: 'Microsecond', timezoneText: 'Time Zone', isRTL: false }; this._defaults = { // Global defaults for all the datetime picker instances showButtonPanel: true, timeOnly: false, timeOnlyShowDate: false, showHour: null, showMinute: null, showSecond: null, showMillisec: null, showMicrosec: null, showTimezone: null, showTime: true, stepHour: 1, stepMinute: 1, stepSecond: 1, stepMillisec: 1, stepMicrosec: 1, hour: 0, minute: 0, second: 0, millisec: 0, microsec: 0, timezone: null, hourMin: 0, minuteMin: 0, secondMin: 0, millisecMin: 0, microsecMin: 0, hourMax: 23, minuteMax: 59, secondMax: 59, millisecMax: 999, microsecMax: 999, minDateTime: null, maxDateTime: null, maxTime: null, minTime: null, onSelect: null, hourGrid: 0, minuteGrid: 0, secondGrid: 0, millisecGrid: 0, microsecGrid: 0, alwaysSetTime: true, separator: ' ', altFieldTimeOnly: true, altTimeFormat: null, altSeparator: null, altTimeSuffix: null, altRedirectFocus: true, pickerTimeFormat: null, pickerTimeSuffix: null, showTimepicker: true, timezoneList: null, addSliderAccess: false, sliderAccessArgs: null, controlType: 'slider', oneLine: false, defaultValue: null, parse: 'strict', afterInject: null }; $.extend(this._defaults, this.regional['']); }; $.extend(Timepicker.prototype, { $input: null, $altInput: null, $timeObj: null, inst: null, hour_slider: null, minute_slider: null, second_slider: null, millisec_slider: null, microsec_slider: null, timezone_select: null, maxTime: null, minTime: null, hour: 0, minute: 0, second: 0, millisec: 0, microsec: 0, timezone: null, hourMinOriginal: null, minuteMinOriginal: null, secondMinOriginal: null, millisecMinOriginal: null, microsecMinOriginal: null, hourMaxOriginal: null, minuteMaxOriginal: null, secondMaxOriginal: null, millisecMaxOriginal: null, microsecMaxOriginal: null, ampm: '', formattedDate: '', formattedTime: '', formattedDateTime: '', timezoneList: null, units: ['hour', 'minute', 'second', 'millisec', 'microsec'], support: {}, control: null, /* * Override the default settings for all instances of the time picker. * @param {Object} settings object - the new settings to use as defaults (anonymous object) * @return {Object} the manager object */ setDefaults: function (settings) { extendRemove(this._defaults, settings || {}); return this; }, /* * Create a new Timepicker instance */ _newInst: function ($input, opts) { var tp_inst = new Timepicker(), inlineSettings = {}, fns = {}, overrides, i; for (var attrName in this._defaults) { if (this._defaults.hasOwnProperty(attrName)) { var attrValue = $input.attr('time:' + attrName); if (attrValue) { try { inlineSettings[attrName] = eval(attrValue); } catch (err) { inlineSettings[attrName] = attrValue; } } } } overrides = { beforeShow: function (input, dp_inst) { if (typeof tp_inst._defaults.evnts.beforeShow === "function") { return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst); } }, onChangeMonthYear: function (year, month, dp_inst) { // Update the time as well : this prevents the time from disappearing from the $input field. // tp_inst._updateDateTime(dp_inst); if (typeof tp_inst._defaults.evnts.onChangeMonthYear === "function") { tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); } }, onClose: function (dateText, dp_inst) { if (tp_inst.timeDefined === true && $input.val() !== '') { tp_inst._updateDateTime(dp_inst); } if (typeof tp_inst._defaults.evnts.onClose === "function") { tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst); } } }; for (i in overrides) { if (overrides.hasOwnProperty(i)) { fns[i] = opts[i] || this._defaults[i] || null; } } tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, { evnts: fns, timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); }); tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) { return val.toUpperCase(); }); tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) { return val.toUpperCase(); }); // detect which units are supported tp_inst.support = detectSupport( tp_inst._defaults.timeFormat + (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') + (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : '')); // controlType is string - key to our this._controls if (typeof(tp_inst._defaults.controlType) === 'string') { if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') { tp_inst._defaults.controlType = 'select'; } tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]; } // controlType is an object and must implement create, options, value methods else { tp_inst.control = tp_inst._defaults.controlType; } // prep the timezone options var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840]; if (tp_inst._defaults.timezoneList !== null) { timezoneList = tp_inst._defaults.timezoneList; } var tzl = timezoneList.length, tzi = 0, tzv = null; if (tzl > 0 && typeof timezoneList[0] !== 'object') { for (; tzi < tzl; tzi++) { tzv = timezoneList[tzi]; timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) }; } } tp_inst._defaults.timezoneList = timezoneList; // set the default units tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : ((new Date()).getTimezoneOffset() * -1); tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour; tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute; tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second; tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec; tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec; tp_inst.ampm = ''; tp_inst.$input = $input; if (tp_inst._defaults.altField) { tp_inst.$altInput = $(tp_inst._defaults.altField); if (tp_inst._defaults.altRedirectFocus === true) { tp_inst.$altInput.css({ cursor: 'pointer' }).on("focus", function () { $input.trigger("focus"); }); } } if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) { tp_inst._defaults.minDate = new Date(); } if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) { tp_inst._defaults.maxDate = new Date(); } // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) { tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); } if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) { tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); } if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) { tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); } if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) { tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); } tp_inst.$input.on('focus', function () { tp_inst._onFocus(); }); return tp_inst; }, /* * add our sliders to the calendar */ _addTimePicker: function (dp_inst) { var currDT = PrimeFaces.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val()); this.timeDefined = this._parseTime(currDT); this._limitMinMaxDateTime(dp_inst, false); this._injectTimePicker(); this._afterInject(); }, /* * parse the time string from input value or _setTime */ _parseTime: function (timeString, withDate) { if (!this.inst) { this.inst = $.datepicker._getInst(this.$input[0]); } if (withDate || !this._defaults.timeOnly) { var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); try { var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults); if (!parseRes.timeObj) { return false; } $.extend(this, parseRes.timeObj); } catch (err) { $.timepicker.log("Error parsing the date/time string: " + err + "\ndate/time string = " + timeString + "\ntimeFormat = " + this._defaults.timeFormat + "\ndateFormat = " + dp_dateFormat); return false; } return true; } else { var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults); if (!timeObj) { return false; } $.extend(this, timeObj); return true; } }, /* * Handle callback option after injecting timepicker */ _afterInject: function() { var o = this.inst.settings; if (typeof o.afterInject === "function") { o.afterInject.call(this); } }, /* * generate and inject html for timepicker into ui datepicker */ _injectTimePicker: function () { var $dp = this.inst.dpDiv, o = this.inst.settings, tp_inst = this, litem = '', uitem = '', show = null, max = {}, gridSize = {}, size = null, i = 0, l = 0; // Prevent displaying twice if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) { var noDisplay = ' ui_tpicker_unit_hide', html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '">' + o.timeText + '</dt>' + '<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '></input></dd>'; // Create the markup for (i = 0, l = this.units.length; i < l; i++) { litem = this.units[i]; uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; // Added by Peter Medeiros: // - Figure out what the hour/minute/second max should be based on the step values. // - Example: if stepMinute is 15, then minMax is 45. max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10); gridSize[litem] = 0; html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' + '<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>'; if (show && o[litem + 'Grid'] > 0) { html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>'; if (litem === 'hour') { for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) { gridSize[litem]++; var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o); html += '<td data-for="' + litem + '">' + tmph + '</td>'; } } else { for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) { gridSize[litem]++; html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>'; } } html += '</tr></table></div>'; } html += '</dd>'; } // Timezone var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone; html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>'; html += '<dd class="ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '"></dd>'; // Create the elements from string html += '</dl></div>'; var $tp = $(html); // if we only want time picker... if (o.timeOnly === true) { $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + PrimeFaces.escapeHTML(o.timeOnlyTitle) + '</div>' + '</div>'); $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); } // add sliders, adjust grids, add events for (i = 0, l = tp_inst.units.length; i < l; i++) { litem = tp_inst.units[i]; uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; // add the slider tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]); // adjust the grid and add click event if (show && o[litem + 'Grid'] > 0) { size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']); $tp.find('.ui_tpicker_' + litem + ' table').css({ width: size + "%", marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"), marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0px', borderCollapse: 'collapse' }).find("td").on("click", function (e) { var $t = $(this), h = $t.html(), n = parseInt(h.replace(/[^0-9]/g), 10), ap = h.replace(/[^apm]/ig), f = $t.data('for'); // loses scope, so we use data-for if (f === 'hour') { if (ap.indexOf('p') !== -1 && n < 12) { n += 12; } else { if (ap.indexOf('a') !== -1 && n === 12) { n = 0; } } } tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n); tp_inst._onTimeChange(); tp_inst._onSelectHandler(); }).css({ cursor: 'pointer', width: (100 / gridSize[litem]) + '%', textAlign: 'center', overflow: 'hidden' }); } // end if grid > 0 } // end for loop // Add timezone options this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select"); $.fn.append.apply(this.timezone_select, $.map(o.timezoneList, function (val, idx) { return $("<option></option>").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val); })); if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") { var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1; if (local_timezone === this.timezone) { selectLocalTimezone(tp_inst); } else { this.timezone_select.val(this.timezone); } } else { if (typeof(this.hour) !== "undefined" && this.hour !== null && this.hour !== "") { this.timezone_select.val(o.timezone); } else { selectLocalTimezone(tp_inst); } } this.timezone_select.on('change', function () { tp_inst._onTimeChange(); tp_inst._onSelectHandler(); tp_inst._afterInject(); }); // End timezone options // inject timepicker into datepicker var $buttonPanel = $dp.find('.ui-datepicker-buttonpane'); if ($buttonPanel.length) { $buttonPanel.before($tp); } else { $dp.append($tp); } this.$timeObj = $tp.find('.ui_tpicker_time_input'); this.$timeObj.on('change', function () { var timeFormat = tp_inst.inst.settings.timeFormat; var parsedTime = $.datepicker.parseTime(timeFormat, this.value); var update = new Date(); if (parsedTime) { update.setHours(parsedTime.hour); update.setMinutes(parsedTime.minute); update.setSeconds(parsedTime.second); $.datepicker._setTime(tp_inst.inst, update); } else { this.value = tp_inst.formattedTime; this.trigger('blur'); } }); if (this.inst !== null) { var timeDefined = this.timeDefined; this._onTimeChange(); this.timeDefined = timeDefined; } // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/ if (this._defaults.addSliderAccess) { var sliderAccessArgs = this._defaults.sliderAccessArgs, rtl = this._defaults.isRTL; sliderAccessArgs.isRTL = rtl; setTimeout(function () { // fix for inline mode if ($tp.find('.ui-slider-access').length === 0) { $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs); // fix any grids since sliders are shorter var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true); if (sliderAccessWidth) { $tp.find('table:visible').each(function () { var $g = $(this), oldWidth = $g.outerWidth(), oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''), newWidth = oldWidth - sliderAccessWidth, newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%', css = { width: newWidth + 'px', marginRight: '0px', marginLeft: '0px' }; css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft; $g.css(css); }); } } }, 10); } // end slideAccess integration tp_inst._limitMinMaxDateTime(this.inst, true); } }, /* * This function tries to limit the ability to go outside the * min/max date range */ _limitMinMaxDateTime: function (dp_inst, adjustSliders) { var o = this._defaults, dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay); if (!this._defaults.showTimepicker) { return; } // No time so nothing to check here if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) { var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'), minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0); if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) { this.hourMinOriginal = o.hourMin; this.minuteMinOriginal = o.minuteMin; this.secondMinOriginal = o.secondMin; this.millisecMinOriginal = o.millisecMin; this.microsecMinOriginal = o.microsecMin; } if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) { this._defaults.hourMin = minDateTime.getHours(); if (this.hour <= this._defaults.hourMin) { this.hour = this._defaults.hourMin; this._defaults.minuteMin = minDateTime.getMinutes(); if (this.minute <= this._defaults.minuteMin) { this.minute = this._defaults.minuteMin; this._defaults.secondMin = minDateTime.getSeconds(); if (this.second <= this._defaults.secondMin) { this.second = this._defaults.secondMin; this._defaults.millisecMin = minDateTime.getMilliseconds(); if (this.millisec <= this._defaults.millisecMin) { this.millisec = this._defaults.millisecMin; this._defaults.microsecMin = minDateTime.getMicroseconds(); } else { if (this.microsec < this._defaults.microsecMin) { this.microsec = this._defaults.microsecMin; } this._defaults.microsecMin = this.microsecMinOriginal; } } else { this._defaults.millisecMin = this.millisecMinOriginal; this._defaults.microsecMin = this.microsecMinOriginal; } } else { this._defaults.secondMin = this.secondMinOriginal; this._defaults.millisecMin = this.millisecMinOriginal; this._defaults.microsecMin = this.microsecMinOriginal; } } else { this._defaults.minuteMin = this.minuteMinOriginal; this._defaults.secondMin = this.secondMinOriginal; this._defaults.millisecMin = this.millisecMinOriginal; this._defaults.microsecMin = this.microsecMinOriginal; } } else { this._defaults.hourMin = this.hourMinOriginal; this._defaults.minuteMin = this.minuteMinOriginal; this._defaults.secondMin = this.secondMinOriginal; this._defaults.millisecMin = this.millisecMinOriginal; this._defaults.microsecMin = this.microsecMinOriginal; } } if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) { var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'), maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0); if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) { this.hourMaxOriginal = o.hourMax; this.minuteMaxOriginal = o.minuteMax; this.secondMaxOriginal = o.secondMax; this.millisecMaxOriginal = o.millisecMax; this.microsecMaxOriginal = o.microsecMax; } if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) { this._defaults.hourMax = maxDateTime.getHours(); if (this.hour >= this._defaults.hourMax) { this.hour = this._defaults.hourMax; this._defaults.minuteMax = maxDateTime.getMinutes(); if (this.minute >= this._defaults.minuteMax) { this.minute = this._defaults.minuteMax; this._defaults.secondMax = maxDateTime.getSeconds(); if (this.second >= this._defaults.secondMax) { this.second = this._defaults.secondMax; this._defaults.millisecMax = maxDateTime.getMilliseconds(); if (this.millisec >= this._defaults.millisecMax) { this.millisec = this._defaults.millisecMax; this._defaults.microsecMax = maxDateTime.getMicroseconds(); } else { if (this.microsec > this._defaults.microsecMax) { this.microsec = this._defaults.microsecMax; } this._defaults.microsecMax = this.microsecMaxOriginal; } } else { this._defaults.millisecMax = this.millisecMaxOriginal; this._defaults.microsecMax = this.microsecMaxOriginal; } } else { this._defaults.secondMax = this.secondMaxOriginal; this._defaults.millisecMax = this.millisecMaxOriginal; this._defaults.microsecMax = this.microsecMaxOriginal; } } else { this._defaults.minuteMax = this.minuteMaxOriginal; this._defaults.secondMax = this.secondMaxOriginal; this._defaults.millisecMax = this.millisecMaxOriginal; this._defaults.microsecMax = this.microsecMaxOriginal; } } else { this._defaults.hourMax = this.hourMaxOriginal; this._defaults.minuteMax = this.minuteMaxOriginal; this._defaults.secondMax = this.secondMaxOriginal; this._defaults.millisecMax = this.millisecMaxOriginal; this._defaults.microsecMax = this.microsecMaxOriginal; } } if (dp_inst.settings.minTime!==null) { var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime); if (this.hour<tempMinTime.getHours()) { this.hour=this._defaults.hourMin=tempMinTime.getHours(); this.minute=this._defaults.minuteMin=tempMinTime.getMinutes(); } else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) { this.minute=this._defaults.minuteMin=tempMinTime.getMinutes(); } else { if (this._defaults.hourMin<tempMinTime.getHours()) { this._defaults.hourMin=tempMinTime.getHours(); this._defaults.minuteMin=tempMinTime.getMinutes(); } else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) { this._defaults.minuteMin=tempMinTime.getMinutes(); } else { this._defaults.minuteMin=0; } } } if (dp_inst.settings.maxTime!==null) { var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime); if (this.hour>tempMaxTime.getHours()) { this.hour=this._defaults.hourMax=tempMaxTime.getHours(); this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes(); } else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) { this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes(); } else { if (this._defaults.hourMax>tempMaxTime.getHours()) { this._defaults.hourMax=tempMaxTime.getHours(); this._defaults.minuteMax=tempMaxTime.getMinutes(); } else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) { this._defaults.minuteMax=tempMaxTime.getMinutes(); } else { this._defaults.minuteMax=59; } } } if (adjustSliders !== undefined && adjustSliders === true) { var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10), minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10), secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10), millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10), microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10); if (this.hour_slider) { this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour }); this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour)); } if (this.minute_slider) { this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute }); this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute)); } if (this.second_slider) { this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond }); this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond)); } if (this.millisec_slider) { this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec }); this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec)); } if (this.microsec_slider) { this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec }); this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec)); } } }, /* * when a slider moves, set the internal time... * on time change is also called when the time is updated in the text field */ _onTimeChange: function () { if (!this._defaults.showTimepicker) { return; } var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false, minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false, second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false, millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false, microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false, timezone = (this.timezone_select) ? this.timezone_select.val() : false, o = this._defaults, pickerTimeFormat = o.pickerTimeFormat || o.timeFormat, pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix; if (typeof(hour) === 'object') { hour = false; } if (typeof(minute) === 'object') { minute = false; } if (typeof(second) === 'object') { second = false; } if (typeof(millisec) === 'object') { millisec = false; } if (typeof(microsec) === 'object') { microsec = false; } if (typeof(timezone) === 'object') { timezone = false; } if (hour !== false) { hour = parseInt(hour, 10); } if (minute !== false) { minute = parseInt(minute, 10); } if (second !== false) { second = parseInt(second, 10); } if (millisec !== false) { millisec = parseInt(millisec, 10); } if (microsec !== false) { microsec = parseInt(microsec, 10); } if (timezone !== false) { timezone = timezone.toString(); } var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0]; // If the update was done in the input field, the input field should not be updated. // If the update was done using the sliders, update the input field. var hasChanged = ( hour !== parseInt(this.hour,10) || // sliders should all be numeric minute !== parseInt(this.minute,10) || second !== parseInt(this.second,10) || millisec !== parseInt(this.millisec,10) || microsec !== parseInt(this.microsec,10) || (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || (this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString() ); if (hasChanged) { if (hour !== false) { this.hour = hour; } if (minute !== false) { this.minute = minute; } if (second !== false) { this.second = second; } if (millisec !== false) { this.millisec = millisec; } if (microsec !== false) { this.microsec = microsec; } if (timezone !== false) { this.timezone = timezone; } if (!this.inst) { this.inst = $.datepicker._getInst(this.$input[0]); } this._limitMinMaxDateTime(this.inst, true); } if (this.support.ampm) { this.ampm = ampm; } // Updates the time within the timepicker this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o); if (this.$timeObj) { if (pickerTimeFormat === o.timeFormat) { this.$timeObj.val(this.formattedTime + pickerTimeSuffix); } else { this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix); } if (this.$timeObj[0].setSelectionRange) { var sPos = this.$timeObj[0].selectionStart; var ePos = this.$timeObj[0].selectionEnd; //this.$timeObj[0].setSelectionRange(sPos, ePos); // PrimeFaces github issue; #1421 } } this.timeDefined = true; if (hasChanged) { this._updateDateTime(); //this.$input.trigger('focus'); // may automatically open the picker on setDate } }, /* * call custom onSelect. * bind to sliders slidestop, and grid click. */ _onSelectHandler: function () { var onSelect = this._defaults.onSelect || this.inst.settings.onSelect; var inputEl = this.$input ? this.$input[0] : null; if (onSelect && inputEl) { onSelect.apply(inputEl, [this.formattedDateTime, this]); } }, /* * update our input with the new date time.. */ _updateDateTime: function (dp_inst) { dp_inst = this.inst || dp_inst; var dtTmp = (dp_inst.currentYear > 0? new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) : new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)), dt = $.datepicker._daylightSavingAdjust(dtTmp), //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)), //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)), dateFmt = $.datepicker._get(dp_inst, 'dateFormat'), formatCfg = $.datepicker._getFormatConfig(dp_inst), timeAvailable = dt !== null && this.timeDefined; this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg); var formattedDateTime = this.formattedDate; // if a slider was changed but datepicker doesn't have a value yet, set it if (dp_inst.lastVal === "") { dp_inst.currentYear = dp_inst.selectedYear; dp_inst.currentMonth = dp_inst.selectedMonth; dp_inst.currentDay = dp_inst.selectedDay; } /* * remove following lines to force every changes in date picker to change the input value * Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker. * If the user manually empty the value in the input field, the date picker will never change selected value. */ //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) { // return; //} if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) { formattedDateTime = this.formattedTime; } else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) { formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix; } this.formattedDateTime = formattedDateTime; if (!this._defaults.showTimepicker) { this.$input.val(this.formattedDate); } else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) { this.$altInput.val(this.formattedTime); this.$input.val(this.formattedDate); } else if (this.$altInput) { this.$input.val(formattedDateTime); var altFormattedDateTime = '', altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator, altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix; if (!this._defaults.timeOnly) { if (this._defaults.altFormat) { altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg); } else { altFormattedDateTime = this.formattedDate; } if (altFormattedDateTime) { altFormattedDateTime += altSeparator; } } if (this._defaults.altTimeFormat !== null) { altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix; } else { altFormattedDateTime += this.formattedTime + altTimeSuffix; } this.$altInput.val(altFormattedDateTime); } else { this.$input.val(formattedDateTime); } this.$input.trigger("change"); }, _onFocus: function () { if (!this.$input.val() && this._defaults.defaultValue) { this.$input.val(this._defaults.defaultValue); var inst = $.datepicker._getInst(this.$input.get(0)), tp_inst = $.datepicker._get(inst, 'timepicker'); if (tp_inst) { if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) { try { $.datepicker._updateDatepicker(inst); } catch (err) { $.timepicker.log(err); } } } } }, /* * Small abstraction to control types * We can add more, just be sure to follow the pattern: create, options, value */ _controls: { // slider methods slider: { create: function (tp_inst, obj, unit, val, min, max, step) { var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60 return obj.prop('slide', null).slider({ orientation: "horizontal", value: rtl ? val * -1 : val, min: rtl ? max * -1 : min, max: rtl ? min * -1 : max, step: step, slide: function (event, ui) { tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value); tp_inst._onTimeChange(); }, stop: function (event, ui) { tp_inst._onSelectHandler(); } }); }, options: function (tp_inst, obj, unit, opts, val) { if (tp_inst._defaults.isRTL) { if (typeof(opts) === 'string') { if (opts === 'min' || opts === 'max') { if (val !== undefined) { return obj.slider(opts, val * -1); } return Math.abs(obj.slider(opts)); } return obj.slider(opts); } var min = opts.min, max = opts.max; opts.min = opts.max = null; if (min !== undefined) { opts.max = min * -1; } if (max !== undefined) { opts.min = max * -1; } return obj.slider(opts); } if (typeof(opts) === 'string' && val !== undefined) { return obj.slider(opts, val); } return obj.slider(opts); }, value: function (tp_inst, obj, unit, val) { if (tp_inst._defaults.isRTL) { if (val !== undefined) { return obj.slider('value', val * -1); } return Math.abs(obj.slider('value')); } if (val !== undefined) { return obj.slider('value', val); } return obj.slider('value'); } }, // select methods select: { create: function (tp_inst, obj, unit, val, min, max, step) { var sel = '<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">', format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat; for (var i = min; i <= max; i += step) { sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>'; if (unit === 'hour') { sel += $.datepicker.formatTime(PrimeFaces.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults); } else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; } else {sel += '0' + i.toString(); } sel += '</option>'; } sel += '</select>'; obj.children('select').remove(); $(sel).appendTo(obj).on('change', function (e) { tp_inst._onTimeChange(); tp_inst._onSelectHandler(); tp_inst._afterInject(); }); return obj; }, options: function (tp_inst, obj, unit, opts, val) { var o = {}, $t = obj.children('select'); if (typeof(opts) === 'string') { if (val === undefined) { return $t.data(opts); } o[opts] = val; } else { o = opts; } return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min>=0 ? o.min : $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step')); }, value: function (tp_inst, obj, unit, val) { var $t = obj.children('select'); if (val !== undefined) { return $t.val(val); } return $t.val(); } } } // end _controls }); $.fn.extend({ /* * shorthand just to use timepicker. */ timepicker: function (o) { o = o || {}; var tmp_args = Array.prototype.slice.call(arguments); if (typeof o === 'object') { tmp_args[0] = $.extend(o, { timeOnly: true }); } return $(this).each(function () { $.fn.datetimepicker.apply($(this), tmp_args); }); }, /* * extend timepicker to datepicker */ datetimepicker: function (o) { o = o || {}; var tmp_args = arguments; if (typeof(o) === 'string') { if (o === 'getDate' || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) { return $.fn.datepicker.apply($(this[0]), tmp_args); } else { return this.each(function () { var $t = $(this); $t.datepicker.apply($t, tmp_args); }); } } else { return this.each(function () { var $t = $(this); $t.datepicker($.timepicker._newInst($t, o)._defaults); }); } } }); /* * Public Utility to parse date and time */ $.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) { var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings); if (parseRes.timeObj) { var t = parseRes.timeObj; parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec); parseRes.date.setMicroseconds(t.microsec); } return parseRes.date; }; /* * Public utility to parse time */ $.datepicker.parseTime = function (timeFormat, timeString, options) { var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}), iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1); // Strict parse requires the timeString to match the timeFormat exactly var strictParse = function (f, s, o) { // pattern for standard and localized AM/PM markers var getPatternAmpm = function (amNames, pmNames) { var markers = []; if (amNames) { $.merge(markers, amNames); } if (pmNames) { $.merge(markers, pmNames); } markers = $.map(markers, function (val) { return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&'); }); return '(' + markers.join('|') + ')?'; }; // figure out position of time elements.. cause js cant do named captures var getFormatPositions = function (timeFormat) { var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g), orders = { h: -1, m: -1, s: -1, l: -1, c: -1, t: -1, z: -1 }; if (finds) { for (var i = 0; i < finds.length; i++) { if (orders[finds[i].toString().charAt(0)] === -1) { orders[finds[i].toString().charAt(0)] = i + 1; } } } return orders; }; var regstr = '^' + f.toString() .replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) { var ml = match.length; switch (match.charAt(0).toLowerCase()) { case 'h': return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})'; case 'm': return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})'; case 's': return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})'; case 'l': return '(\\d?\\d?\\d)'; case 'c': return '(\\d?\\d?\\d)'; case 'z': return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?'; case 't': return getPatternAmpm(o.amNames, o.pmNames); default: // literal escaped in quotes return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?'; } }) .replace(/\s/g, '\\s?') + o.timeSuffix + '$', order = getFormatPositions(f), ampm = '', treg; treg = s.match(new RegExp(regstr, 'i')); var resTime = { hour: 0, minute: 0, second: 0, millisec: 0, microsec: 0 }; if (treg) { if (order.t !== -1) { if (treg[order.t] === undefined || treg[order.t].length === 0) { ampm = ''; resTime.ampm = ''; } else { ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x,i) { return x.toUpperCase(); })) !== -1 ? 'AM' : 'PM'; resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0]; } } if (order.h !== -1) { if (ampm === 'AM' && treg[order.h] === '12') { resTime.hour = 0; // 12am = 0 hour } else { if (ampm === 'PM' && treg[order.h] !== '12') { resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12 } else { resTime.hour = Number(treg[order.h]); } } } if (order.m !== -1) { resTime.minute = Number(treg[order.m]); } if (order.s !== -1) { resTime.second = Number(treg[order.s]); } if (order.l !== -1) { resTime.millisec = Number(treg[order.l]); } if (order.c !== -1) { resTime.microsec = Number(treg[order.c]); } if (order.z !== -1 && treg[order.z] !== undefined) { resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]); } return resTime; } return false; };// end strictParse // First try JS Date, if that fails, use strictParse var looseParse = function (f, s, o) { try { var d = new Date('2012-01-01 ' + s); if (isNaN(d.getTime())) { d = new Date('2012-01-01T' + s); if (isNaN(d.getTime())) { d = new Date('01/01/2012 ' + s); if (isNaN(d.getTime())) { throw "Unable to parse time with native Date: " + s; } } } return { hour: d.getHours(), minute: d.getMinutes(), second: d.getSeconds(), millisec: d.getMilliseconds(), microsec: d.getMicroseconds(), timezone: d.getTimezoneOffset() * -1 }; } catch (err) { try { return strictParse(f, s, o); } catch (err2) { $.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f); } } return false; }; // end looseParse if (typeof o.parse === "function") { return o.parse(timeFormat, timeString, o); } if (o.parse === 'loose') { return looseParse(timeFormat, timeString, o); } return strictParse(timeFormat, timeString, o); }; /** * Public utility to format the time * @param {string} format format of the time * @param {Object} time Object not a Date for timezones * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm * @returns {string} the formatted time */ $.datepicker.formatTime = function (format, time, options) { options = options || {}; options = $.extend({}, $.timepicker._defaults, options); time = $.extend({ hour: 0, minute: 0, second: 0, millisec: 0, microsec: 0, timezone: null }, time); var tmptime = format, ampmName = options.amNames[0], hour = parseInt(time.hour, 10); if (hour > 11) { ampmName = options.pmNames[0]; } tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) { switch (match) { case 'HH': return ('0' + hour).slice(-2); case 'H': return hour; case 'hh': return ('0' + convert24to12(hour)).slice(-2); case 'h': return convert24to12(hour); case 'mm': return ('0' + time.minute).slice(-2); case 'm': return time.minute; case 'ss': return ('0' + time.second).slice(-2); case 's': return time.second; case 'l': return ('00' + time.millisec).slice(-3); case 'c': return ('00' + time.microsec).slice(-3); case 'z': return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false); case 'Z': return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true); case 'T': return ampmName.charAt(0).toUpperCase(); case 'TT': return ampmName.toUpperCase(); case 't': return ampmName.charAt(0).toLowerCase(); case 'tt': return ampmName.toLowerCase(); default: return match.replace(/'/g, ""); } }); return tmptime; }; /* * the bad hack :/ override datepicker so it doesn't close on select // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378 */ $.datepicker._base_selectDate = $.datepicker._selectDate; $.datepicker._selectDate = function (id, dateStr) { var inst = this._getInst($(id)[0]), tp_inst = this._get(inst, 'timepicker'), was_inline; if (tp_inst && inst.settings.showTimepicker) { tp_inst._limitMinMaxDateTime(inst, true); was_inline = inst.inline; inst.inline = inst.stay_open = true; //This way the onSelect handler called from calendarpicker get the full dateTime this._base_selectDate(id, dateStr); inst.inline = was_inline; inst.stay_open = false; this._notifyChange(inst); this._updateDatepicker(inst); } else { this._base_selectDate(id, dateStr); } }; /* * second bad hack :/ override datepicker so it triggers an event when changing the input field * and does not redraw the datepicker on every selectDate event */ $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker; $.datepicker._updateDatepicker = function (inst) { // don't popup the datepicker if there is another instance already opened var input = inst.input[0]; if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) { return; } if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) { this._base_updateDatepicker(inst); // Reload the time control when changing something in the input text field. var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { tp_inst._addTimePicker(inst); } } }; /* * third bad hack :/ override datepicker so it allows spaces and colon in the input field */ $.datepicker._base_doKeyPress = $.datepicker._doKeyPress; $.datepicker._doKeyPress = function (event) { var inst = $.datepicker._getInst(event.target), tp_inst = $.datepicker._get(inst, 'timepicker'); if (tp_inst) { if ($.datepicker._get(inst, 'constrainInput')) { var ampm = tp_inst.support.ampm, tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone, dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')), datetimeChars = tp_inst._defaults.timeFormat.toString() .replace(/[hms]/g, '') .replace(/TT/g, ampm ? 'APM' : '') .replace(/Tt/g, ampm ? 'AaPpMm' : '') .replace(/tT/g, ampm ? 'AaPpMm' : '') .replace(/T/g, ampm ? 'AP' : '') .replace(/tt/g, ampm ? 'apm' : '') .replace(/t/g, ampm ? 'ap' : '') + " " + tp_inst._defaults.separator + tp_inst._defaults.timeSuffix + (tz ? tp_inst._defaults.timezoneList.join('') : '') + (tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) + dateChars, chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode); return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1); } } return $.datepicker._base_doKeyPress(event); }; /* * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField * Update any alternate field to synchronise with the main field. */ $.datepicker._base_updateAlternate = $.datepicker._updateAlternate; $.datepicker._updateAlternate = function (inst) { var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { var altField = tp_inst._defaults.altField; if (altField) { // update alternate field too var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat, date = this._getDate(inst), formatCfg = $.datepicker._getFormatConfig(inst), altFormattedDateTime = '', altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator, altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix, altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat; altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix; if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) { if (tp_inst._defaults.altFormat) { altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime; } else { altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime; } } $(altField).val( inst.input.val() ? altFormattedDateTime : ""); } } else { $.datepicker._base_updateAlternate(inst); } }; /* * Override key up event to sync manual input changes. */ $.datepicker._base_doKeyUp = $.datepicker._doKeyUp; $.datepicker._doKeyUp = function (event) { var inst = $.datepicker._getInst(event.target), tp_inst = $.datepicker._get(inst, 'timepicker'); if (tp_inst) { if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) { try { $.datepicker._updateDatepicker(inst); } catch (err) { $.timepicker.log(err); } } } return $.datepicker._base_doKeyUp(event); }; /* * override "Today" button to also grab the time and set it to input field. */ $.datepicker._base_gotoToday = $.datepicker._gotoToday; $.datepicker._gotoToday = function (id) { var inst = this._getInst($(id)[0]); this._base_gotoToday(id); var tp_inst = this._get(inst, 'timepicker'); if (!tp_inst) { return; } var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone); var now = new Date(); now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10)); this._setTime(inst, now); this._setDate(inst, now); tp_inst._onSelectHandler(); }; /* * Disable & enable the Time in the datetimepicker */ $.datepicker._disableTimepickerDatepicker = function (target) { var inst = this._getInst(target); if (!inst) { return; } var tp_inst = this._get(inst, 'timepicker'); $(target).datepicker('getDate'); // Init selected[Year|Month|Day] if (tp_inst) { inst.settings.showTimepicker = false; tp_inst._defaults.showTimepicker = false; tp_inst._updateDateTime(inst); } }; $.datepicker._enableTimepickerDatepicker = function (target) { var inst = this._getInst(target); if (!inst) { return; } var tp_inst = this._get(inst, 'timepicker'); $(target).datepicker('getDate'); // Init selected[Year|Month|Day] if (tp_inst) { inst.settings.showTimepicker = true; tp_inst._defaults.showTimepicker = true; tp_inst._addTimePicker(inst); // Could be disabled on page load tp_inst._updateDateTime(inst); } }; /* * Create our own set time function */ $.datepicker._setTime = function (inst, date) { var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { var defaults = tp_inst._defaults; // calling _setTime with no date sets time to defaults tp_inst.hour = date ? date.getHours() : defaults.hour; tp_inst.minute = date ? date.getMinutes() : defaults.minute; tp_inst.second = date ? date.getSeconds() : defaults.second; tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec; tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec; //check if within min/max times.. tp_inst._limitMinMaxDateTime(inst, true); tp_inst._onTimeChange(); tp_inst._updateDateTime(inst); } }; /* * Create new public method to set only time, callable as $().datepicker('setTime', date) */ $.datepicker._setTimeDatepicker = function (target, date, withDate) { var inst = this._getInst(target); if (!inst) { return; } var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { this._setDateFromField(inst); var tp_date; if (date) { if (typeof date === "string") { tp_inst._parseTime(date, withDate); tp_date = new Date(); tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec); tp_date.setMicroseconds(tp_inst.microsec); } else { tp_date = new Date(date.getTime()); tp_date.setMicroseconds(date.getMicroseconds()); } if (tp_date.toString() === 'Invalid Date') { tp_date = undefined; } this._setTime(inst, tp_date); } } }; /* * override setDate() to allow setting time too within Date object */ $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker; $.datepicker._setDateDatepicker = function (target, _date) { var inst = this._getInst(target); var date = _date; if (!inst) { return; } if (typeof(_date) === 'string') { date = new Date(_date); if (!date.getTime()) { this._base_setDateDatepicker.apply(this, arguments); date = $(target).datepicker('getDate'); } } var tp_inst = this._get(inst, 'timepicker'); var tp_date; if (date instanceof Date) { tp_date = new Date(date.getTime()); tp_date.setMicroseconds(date.getMicroseconds()); } else { tp_date = date; } // This is important if you are using the timezone option, javascript's Date // object will only return the timezone offset for the current locale, so we // adjust it accordingly. If not using timezone option this won't matter.. // If a timezone is different in tp, keep the timezone as is if (tp_inst && tp_date) { // look out for DST if tz wasn't specified if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) { tp_inst.timezone = tp_date.getTimezoneOffset() * -1; } date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone); tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone); } this._updateDatepicker(inst); this._base_setDateDatepicker.apply(this, arguments); this._setTimeDatepicker(target, tp_date, true); }; /* * override getDate() to allow getting time too within Date object */ $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker; $.datepicker._getDateDatepicker = function (target, noDefault) { var inst = this._getInst(target); if (!inst) { return; } var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { // if it hasn't yet been defined, grab from field if (inst.lastVal === undefined) { this._setDateFromField(inst, noDefault); } var date = this._getDate(inst); var currDT = null; if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) { currDT = tp_inst.$input.val() + ' ' + tp_inst.$altInput.val(); } else if (tp_inst.$input.get(0).tagName !== 'INPUT' && tp_inst.$altInput) { /** * in case the datetimepicker has been applied to a non-input tag for inline UI, * and the user has not configured the plugin to display only time in altInput, * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied) * * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values */ currDT = tp_inst.$altInput.val(); } else { currDT = tp_inst.$input.val(); } if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) { date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec); date.setMicroseconds(tp_inst.microsec); // This is important if you are using the timezone option, javascript's Date // object will only return the timezone offset for the current locale, so we // adjust it accordingly. If not using timezone option this won't matter.. if (tp_inst.timezone != null) { // look out for DST if tz wasn't specified if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) { tp_inst.timezone = date.getTimezoneOffset() * -1; } date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset())); } } return date; } return this._base_getDateDatepicker(target, noDefault); }; /* * override parseDate() because UI 1.8.14 throws an error about "Extra characters" * An option in datapicker to ignore extra format characters would be nicer. */ $.datepicker._base_parseDate = $.datepicker.parseDate; $.datepicker.parseDate = function (format, value, settings) { var date; try { date = this._base_parseDate(format, value, settings); } catch (err) { // Hack! The error message ends with a colon, a space, and // the "extra" characters. We rely on that instead of // attempting to perfectly reproduce the parsing algorithm. if (err.indexOf(":") >= 0) { date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings); $.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format); } else { throw err; } } return date; }; /* * override formatDate to set date with time to the input */ $.datepicker._base_formatDate = $.datepicker._formatDate; $.datepicker._formatDate = function (inst, day, month, year) { var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { tp_inst._updateDateTime(inst); return tp_inst.$input.val(); } return this._base_formatDate(inst); }; /* * override options setter to add time to maxDate(Time) and minDate(Time). MaxDate */ $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker; $.datepicker._optionDatepicker = function (target, name, value) { var inst = this._getInst(target), name_clone; if (!inst) { return null; } var tp_inst = this._get(inst, 'timepicker'); if (tp_inst) { var min = null, max = null, onselect = null, overrides = tp_inst._defaults.evnts, fns = {}, prop, ret, oldVal, $target; if (typeof name === 'string') { // if min/max was set with the string if (name === 'minDate' || name === 'minDateTime') { min = value; } else if (name === 'maxDate' || name === 'maxDateTime') { max = value; } else if (name === 'onSelect') { onselect = value; } else if (overrides.hasOwnProperty(name)) { if (typeof (value) === 'undefined') { return overrides[name]; } fns[name] = value; name_clone = {}; //empty results in exiting function after overrides updated } } else if (typeof name === 'object') { //if min/max was set with the JSON if (name.minDate) { min = name.minDate; } else if (name.minDateTime) { min = name.minDateTime; } else if (name.maxDate) { max = name.maxDate; } else if (name.maxDateTime) { max = name.maxDateTime; } for (prop in overrides) { if (overrides.hasOwnProperty(prop) && name[prop]) { fns[prop] = name[prop]; } } } for (prop in fns) { if (fns.hasOwnProperty(prop)) { overrides[prop] = fns[prop]; if (!name_clone) { name_clone = $.extend({}, name); } delete name_clone[prop]; } } if (name_clone && isEmptyObject(name_clone)) { return; } if (min) { //if min was set if (min === 0) { min = new Date(); } else { min = new Date(min); } tp_inst._defaults.minDate = min; tp_inst._defaults.minDateTime = min; } else if (max) { //if max was set if (max === 0) { max = new Date(); } else { max = new Date(max); } tp_inst._defaults.maxDate = max; tp_inst._defaults.maxDateTime = max; } else if (onselect) { tp_inst._defaults.onSelect = onselect; } // Datepicker will override our date when we call _base_optionDatepicker when // calling minDate/maxDate, so we will first grab the value, call // _base_optionDatepicker, then set our value back. if(min || max){ $target = $(target); oldVal = $target.datetimepicker('getDate'); ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value); $target.datetimepicker('setDate', oldVal); return ret; } } if (value === undefined) { return this._base_optionDatepicker.call($.datepicker, target, name); } return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value); }; /* * jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype, * it will return false for all objects */ var isEmptyObject = function (obj) { var prop; for (prop in obj) { if (obj.hasOwnProperty(prop)) { return false; } } return true; }; /* * jQuery extend now ignores nulls! */ var extendRemove = function (target, props) { $.extend(target, props); for (var name in props) { if (props[name] === null || props[name] === undefined) { target[name] = props[name]; } } return target; }; /* * Determine by the time format which units are supported * Returns an object of booleans for each unit */ var detectSupport = function (timeFormat) { var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals isIn = function (f, t) { // does the format contain the token? return f.indexOf(t) !== -1 ? true : false; }; return { hour: isIn(tf, 'h'), minute: isIn(tf, 'm'), second: isIn(tf, 's'), millisec: isIn(tf, 'l'), microsec: isIn(tf, 'c'), timezone: isIn(tf, 'z'), ampm: isIn(tf, 't') && isIn(timeFormat, 'h'), iso8601: isIn(timeFormat, 'Z') }; }; /* * Converts 24 hour format into 12 hour * Returns 12 hour without leading 0 */ var convert24to12 = function (hour) { hour %= 12; if (hour === 0) { hour = 12; } return String(hour); }; var computeEffectiveSetting = function (settings, property) { return settings && settings[property] ? settings[property] : $.timepicker._defaults[property]; }; /* * Splits datetime string into date and time substrings. * Throws exception when date can't be parsed * Returns {dateString: dateString, timeString: timeString} */ var splitDateTime = function (dateTimeString, timeSettings) { // The idea is to get the number separator occurrences in datetime and the time format requested (since time has // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split. var separator = computeEffectiveSetting(timeSettings, 'separator'), format = computeEffectiveSetting(timeSettings, 'timeFormat'), timeParts = format.split(separator), // how many occurrences of separator may be in our format? timePartsLen = timeParts.length, allParts = dateTimeString.split(separator), allPartsLen = allParts.length; if (allPartsLen > 1) { return { dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator), timeString: allParts.splice(0, timePartsLen).join(separator) }; } return { dateString: dateTimeString, timeString: '' }; }; /* * Internal function to parse datetime interval * Returns: {date: Date, timeObj: Object}, where * date - parsed date without time (type Date) * timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional */ var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) { var date, parts, parsedTime; parts = splitDateTime(dateTimeString, timeSettings); date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings); if (parts.timeString === '') { return { date: date }; } parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings); if (!parsedTime) { throw 'Wrong time format'; } return { date: date, timeObj: parsedTime }; }; /* * Internal function to set timezone_select to the local timezone */ var selectLocalTimezone = function (tp_inst, date) { if (tp_inst && tp_inst.timezone_select) { var now = date || new Date(); tp_inst.timezone_select.val(-now.getTimezoneOffset()); } }; /* * Create a Singleton Instance */ $.timepicker = new Timepicker(); /** * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5) * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned * @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45" * @return {string} */ $.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) { if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) { return tzMinutes; } var off = tzMinutes, minutes = off % 60, hours = (off - minutes) / 60, iso = iso8601 ? ':' : '', tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2); if (tz === '+00:00') { return 'Z'; } return tz; }; /** * Get the number in minutes that represents a timezone string * @param {string} tzString formatted like "+0500", "-1245", "Z" * @return {number} the offset minutes or the original string if it doesn't match expectations */ $.timepicker.timezoneOffsetNumber = function (tzString) { var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with "+1245" if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset return 0; } if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back return parseInt(tzString, 10); } return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus ((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes) parseInt(normalized.substr(3, 2), 10))); // minutes }; /** * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate) * @param {Date} date * @param {string} fromTimezone formatted like "+0500", "-1245" * @param {string} toTimezone formatted like "+0500", "-1245" * @return {Date} */ $.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) { var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone); var toTz = $.timepicker.timezoneOffsetNumber(toTimezone); if (!isNaN(toTz)) { date.setMinutes(date.getMinutes() + (-fromTz) - (-toTz)); } return date; }; /** * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to * enforce date range limits. * n.b. The input value must be correctly formatted (reformatting is not supported) * @param {Element} startTime * @param {Element} endTime * @param {Object} options Options for the timepicker() call * @return {jQuery} */ $.timepicker.timeRange = function (startTime, endTime, options) { return $.timepicker.handleRange('timepicker', startTime, endTime, options); }; /** * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to * enforce date range limits. * @param {Element} startTime * @param {Element} endTime * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`, * a boolean value that can be used to reformat the input values to the `dateFormat`. * @param {string} method Can be used to specify the type of picker to be added * @return {jQuery} */ $.timepicker.datetimeRange = function (startTime, endTime, options) { $.timepicker.handleRange('datetimepicker', startTime, endTime, options); }; /** * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to * enforce date range limits. * @param {Element} startTime * @param {Element} endTime * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`, * a boolean value that can be used to reformat the input values to the `dateFormat`. * @return {jQuery} */ $.timepicker.dateRange = function (startTime, endTime, options) { $.timepicker.handleRange('datepicker', startTime, endTime, options); }; /** * Calls `method` on the `startTime` and `endTime` elements, and configures them to * enforce date range limits. * @param {string} method Can be used to specify the type of picker to be added * @param {Element} startTime * @param {Element} endTime * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`, * a boolean value that can be used to reformat the input values to the `dateFormat`. * @return {jQuery} */ $.timepicker.handleRange = function (method, startTime, endTime, options) { options = $.extend({}, { minInterval: 0, // min allowed interval in milliseconds maxInterval: 0, // max allowed interval in milliseconds start: {}, // options for start picker end: {} // options for end picker }, options); // for the mean time this fixes an issue with calling getDate with timepicker() var timeOnly = false; if(method === 'timepicker'){ timeOnly = true; method = 'datetimepicker'; } function checkDates(changed, other) { var startdt = startTime[method]('getDate'), enddt = endTime[method]('getDate'), changeddt = changed[method]('getDate'); if (startdt !== null) { var minDate = new Date(startdt.getTime()), maxDate = new Date(startdt.getTime()); minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval); maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval); if (options.minInterval > 0 && minDate > enddt) { // minInterval check endTime[method]('setDate', minDate); } else if (options.maxInterval > 0 && maxDate < enddt) { // max interval check endTime[method]('setDate', maxDate); } else if (startdt > enddt) { other[method]('setDate', changeddt); } } } function selected(changed, other, option) { if (!changed.val()) { return; } var date = changed[method].call(changed, 'getDate'); if (date !== null && options.minInterval > 0) { if (option === 'minDate') { date.setMilliseconds(date.getMilliseconds() + options.minInterval); } if (option === 'maxDate') { date.setMilliseconds(date.getMilliseconds() - options.minInterval); } } if (date.getTime) { other[method].call(other, 'option', option, date); } } $.fn[method].call(startTime, $.extend({ timeOnly: timeOnly, onClose: function (dateText, inst) { checkDates($(this), endTime); }, onSelect: function (selectedDateTime) { selected($(this), endTime, 'minDate'); } }, options, options.start)); $.fn[method].call(endTime, $.extend({ timeOnly: timeOnly, onClose: function (dateText, inst) { checkDates($(this), startTime); }, onSelect: function (selectedDateTime) { selected($(this), startTime, 'maxDate'); } }, options, options.end)); checkDates(startTime, endTime); selected(startTime, endTime, 'minDate'); selected(endTime, startTime, 'maxDate'); return $([startTime.get(0), endTime.get(0)]); }; /** * Log error or data to the console during error or debugging * @param {Object} err pass any type object to log to the console during error or debugging * @return {void} */ $.timepicker.log = function () { // Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first. if (window.console && window.console.log && window.console.log.apply) { window.console.log.apply(window.console, Array.prototype.slice.call(arguments)); } }; /* * Add util object to allow access to private methods for testability. */ $.timepicker._util = { _extendRemove: extendRemove, _isEmptyObject: isEmptyObject, _convert24to12: convert24to12, _detectSupport: detectSupport, _selectLocalTimezone: selectLocalTimezone, _computeEffectiveSetting: computeEffectiveSetting, _splitDateTime: splitDateTime, _parseDateTimeInternal: parseDateTimeInternal }; /* * Microsecond support */ if (!Date.prototype.getMicroseconds) { Date.prototype.microseconds = 0; Date.prototype.getMicroseconds = function () { return this.microseconds; }; Date.prototype.setMicroseconds = function (m) { this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000)); this.microseconds = m % 1000; return this; }; } /* * Keep up with the version */ $.timepicker.version = "1.6.3"; }));
{ "pile_set_name": "Github" }
社会福祉法 (昭和二十六年三月二十九日法律第四十五号)最終改正:平成二五年六月一四日法律第四四号(最終改正までの未施行法令)平成二十四年八月二十二日法律第六十七号(未施行)   第一章 総則(第一条―第六条)  第二章 地方社会福祉審議会(第七条―第十三条)  第三章 福祉に関する事務所(第十四条―第十七条)  第四章 社会福祉主事(第十八条・第十九条)  第五章 指導監督及び訓練(第二十条・第二十一条)  第六章 社会福祉法人   第一節 通則(第二十二条―第三十条)   第二節 設立(第三十一条―第三十五条)   第三節 管理(第三十六条―第四十五条)   第四節 解散及び合併(第四十六条―第五十五条)   第五節 助成及び監督(第五十六条―第五十九条)  第七章 社会福祉事業(第六十条―第七十四条)  第八章 福祉サービスの適切な利用   第一節 情報の提供等(第七十五条―第七十九条)   第二節 福祉サービスの利用の援助等(第八十条―第八十七条)   第三節 社会福祉を目的とする事業を経営する者への支援(第八十八条)  第九章 社会福祉事業に従事する者の確保の促進   第一節 基本指針等(第八十九条―第九十二条)   第二節 福祉人材センター    第一款 都道府県福祉人材センター(第九十三条―第九十八条)    第二款 中央福祉人材センター(第九十九条―第百一条)   第三節 福利厚生センター(第百二条―第百六条)  第十章 地域福祉の推進   第一節 地域福祉計画(第百七条・第百八条)   第二節 社会福祉協議会(第百九条―第百十一条)   第三節 共同募金(第百十二条―第百二十四条)  第十一章 雑則(第百二十五条―第百三十条)  第十二章 罰則(第百三十一条―第百三十四条)    第一章 総則 (目的) 第一条  この法律は、社会福祉を目的とする事業の全分野における共通的基本事項を定め、社会福祉を目的とする他の法律と相まつて、福祉サービスの利用者の利益の保護及び地域における社会福祉(以下「地域福祉」という。)の推進を図るとともに、社会福祉事業の公明かつ適正な実施の確保及び社会福祉を目的とする事業の健全な発達を図り、もつて社会福祉の増進に資することを目的とする。 (定義) 第二条  この法律において「社会福祉事業」とは、第一種社会福祉事業及び第二種社会福祉事業をいう。 2  次に掲げる事業を第一種社会福祉事業とする。 一  生活保護法 (昭和二十五年法律第百四十四号)に規定する救護施設、更生施設その他生計困難者を無料又は低額な料金で入所させて生活の扶助を行うことを目的とする施設を経営する事業及び生計困難者に対して助葬を行う事業 二  児童福祉法 (昭和二十二年法律第百六十四号)に規定する乳児院、母子生活支援施設、児童養護施設、障害児入所施設、情緒障害児短期治療施設又は児童自立支援施設を経営する事業 三  老人福祉法 (昭和三十八年法律第百三十三号)に規定する養護老人ホーム、特別養護老人ホーム又は軽費老人ホームを経営する事業 四  障害者の日常生活及び社会生活を総合的に支援するための法律 (平成十七年法律第百二十三号)に規定する障害者支援施設を経営する事業 五  削除 六  売春防止法 (昭和三十一年法律第百十八号)に規定する婦人保護施設を経営する事業 七  授産施設を経営する事業及び生計困難者に対して無利子又は低利で資金を融通する事業 3  次に掲げる事業を第二種社会福祉事業とする。 一  生計困難者に対して、その住居で衣食その他日常の生活必需品若しくはこれに要する金銭を与え、又は生活に関する相談に応ずる事業 二  児童福祉法 に規定する障害児通所支援事業、障害児相談支援事業、児童自立生活援助事業、放課後児童健全育成事業、子育て短期支援事業、乳児家庭全戸訪問事業、養育支援訪問事業、地域子育て支援拠点事業、一時預かり事業又は小規模住居型児童養育事業、同法 に規定する助産施設、保育所、児童厚生施設又は児童家庭支援センターを経営する事業及び児童の福祉の増進について相談に応ずる事業 三  母子及び寡婦福祉法 (昭和三十九年法律第百二十九号)に規定する母子家庭等日常生活支援事業又は寡婦日常生活支援事業及び同法 に規定する母子福祉施設を経営する事業 四  老人福祉法 に規定する老人居宅介護等事業、老人デイサービス事業、老人短期入所事業、小規模多機能型居宅介護事業、認知症対応型老人共同生活援助事業又は複合型サービス福祉事業及び同法 に規定する老人デイサービスセンター、老人短期入所施設、老人福祉センター又は老人介護支援センターを経営する事業 四の二  障害者の日常生活及び社会生活を総合的に支援するための法律 に規定する障害福祉サービス事業、一般相談支援事業、特定相談支援事業又は移動支援事業及び同法 に規定する地域活動支援センター又は福祉ホームを経営する事業 五  身体障害者福祉法 (昭和二十四年法律第二百八十三号)に規定する身体障害者生活訓練等事業、手話通訳事業又は介助犬訓練事業若しくは聴導犬訓練事業、同法 に規定する身体障害者福祉センター、補装具製作施設、盲導犬訓練施設又は視聴覚障害者情報提供施設を経営する事業及び身体障害者の更生相談に応ずる事業 六  知的障害者福祉法 (昭和三十五年法律第三十七号)に規定する知的障害者の更生相談に応ずる事業 七  削除 八  生計困難者のために、無料又は低額な料金で、簡易住宅を貸し付け、又は宿泊所その他の施設を利用させる事業 九  生計困難者のために、無料又は低額な料金で診療を行う事業 十  生計困難者に対して、無料又は低額な費用で介護保険法 (平成九年法律第百二十三号)に規定する介護老人保健施設を利用させる事業 十一  隣保事業(隣保館等の施設を設け、無料又は低額な料金でこれを利用させることその他その近隣地域における住民の生活の改善及び向上を図るための各種の事業を行うものをいう。) 十二  福祉サービス利用援助事業(精神上の理由により日常生活を営むのに支障がある者に対して、無料又は低額な料金で、福祉サービス(前項各号及び前各号の事業において提供されるものに限る。以下この号において同じ。)の利用に関し相談に応じ、及び助言を行い、並びに福祉サービスの提供を受けるために必要な手続又は福祉サービスの利用に要する費用の支払に関する便宜を供与することその他の福祉サービスの適切な利用のための一連の援助を一体的に行う事業をいう。) 十三  前項各号及び前各号の事業に関する連絡又は助成を行う事業 4  この法律における「社会福祉事業」には、次に掲げる事業は、含まれないものとする。 一  更生保護事業法 (平成七年法律第八十六号)に規定する更生保護事業(以下「更生保護事業」という。) 二  実施期間が六月(前項第十三号に掲げる事業にあつては、三月)を超えない事業 三  社団又は組合の行う事業であつて、社員又は組合員のためにするもの 四  第二項各号及び前項第一号から第九号までに掲げる事業であつて、常時保護を受ける者が、入所させて保護を行うものにあつては五人、その他のものにあつては二十人(政令で定めるものにあつては、十人)に満たないもの 五  前項第十三号に掲げる事業のうち、社会福祉事業の助成を行うものであつて、助成の金額が毎年度五百万円に満たないもの又は助成を受ける社会福祉事業の数が毎年度五十に満たないもの (福祉サービスの基本的理念) 第三条  福祉サービスは、個人の尊厳の保持を旨とし、その内容は、福祉サービスの利用者が心身ともに健やかに育成され、又はその有する能力に応じ自立した日常生活を営むことができるように支援するものとして、良質かつ適切なものでなければならない。 (地域福祉の推進) 第四条  地域住民、社会福祉を目的とする事業を経営する者及び社会福祉に関する活動を行う者は、相互に協力し、福祉サービスを必要とする地域住民が地域社会を構成する一員として日常生活を営み、社会、経済、文化その他あらゆる分野の活動に参加する機会が与えられるように、地域福祉の推進に努めなければならない。 (福祉サービスの提供の原則) 第五条  社会福祉を目的とする事業を経営する者は、その提供する多様な福祉サービスについて、利用者の意向を十分に尊重し、かつ、保健医療サービスその他の関連するサービスとの有機的な連携を図るよう創意工夫を行いつつ、これを総合的に提供することができるようにその事業の実施に努めなければならない。 (福祉サービスの提供体制の確保等に関する国及び地方公共団体の責務) 第六条  国及び地方公共団体は、社会福祉を目的とする事業を経営する者と協力して、社会福祉を目的とする事業の広範かつ計画的な実施が図られるよう、福祉サービスを提供する体制の確保に関する施策、福祉サービスの適切な利用の推進に関する施策その他の必要な各般の措置を講じなければならない。    第二章 地方社会福祉審議会 (地方社会福祉審議会) 第七条  社会福祉に関する事項(児童福祉及び精神障害者福祉に関する事項を除く。)を調査審議するため、都道府県並びに地方自治法 (昭和二十二年法律第六十七号)第二百五十二条の十九第一項 の指定都市(以下「指定都市」という。)及び同法第二百五十二条の二十二第一項 の中核市(以下「中核市」という。)に社会福祉に関する審議会その他の合議制の機関(以下「地方社会福祉審議会」という。)を置くものとする。 2  地方社会福祉審議会は、都道府県知事又は指定都市若しくは中核市の長の監督に属し、その諮問に答え、又は関係行政庁に意見を具申するものとする。 (委員) 第八条  地方社会福祉審議会の委員は、都道府県又は指定都市若しくは中核市の議会の議員、社会福祉事業に従事する者及び学識経験のある者のうちから、都道府県知事又は指定都市若しくは中核市の長が任命する。 (臨時委員) 第九条  特別の事項を調査審議するため必要があるときは、地方社会福祉審議会に臨時委員を置くことができる。 2  地方社会福祉審議会の臨時委員は、都道府県又は指定都市若しくは中核市の議会の議員、社会福祉事業に従事する者及び学識経験のある者のうちから、都道府県知事又は指定都市若しくは中核市の長が任命する。 (委員長) 第十条  地方社会福祉審議会に委員の互選による委員長一人を置く。委員長は、会務を総理する。 (専門分科会) 第十一条  地方社会福祉審議会に、民生委員の適否の審査に関する事項を調査審議するため、民生委員審査専門分科会を、身体障害者の福祉に関する事項を調査審議するため、身体障害者福祉専門分科会を置く。 2  地方社会福祉審議会は、前項の事項以外の事項を調査審議するため、必要に応じ、老人福祉専門分科会その他の専門分科会を置くことができる。 (地方社会福祉審議会に関する特例) 第十二条  第七条第一項の規定にかかわらず、都道府県又は指定都市若しくは中核市は、条例で定めるところにより、地方社会福祉審議会に児童福祉に関する事項を調査審議させることができる。 2  前項の規定により地方社会福祉審議会に児童福祉に関する事項を調査審議させる場合においては、前条第一項中「置く」とあるのは、「、児童福祉に関する事項を調査審議するため、児童福祉専門分科会を置く」とする。 (政令への委任) 第十三条  この法律で定めるもののほか、地方社会福祉審議会に関し必要な事項は、政令で定める。    第三章 福祉に関する事務所 (設置) 第十四条  都道府県及び市(特別区を含む。以下同じ。)は、条例で、福祉に関する事務所を設置しなければならない。 2  都道府県及び市は、その区域(都道府県にあつては、市及び福祉に関する事務所を設ける町村の区域を除く。)をいずれかの福祉に関する事務所の所管区域としなければならない。 3  町村は、条例で、その区域を所管区域とする福祉に関する事務所を設置することができる。 4  町村は、必要がある場合には、地方自治法 の規定により一部事務組合又は広域連合を設けて、前項の事務所を設置することができる。この場合には、当該一部事務組合又は広域連合内の町村の区域をもつて、事務所の所管区域とする。 5  都道府県の設置する福祉に関する事務所は、生活保護法 、児童福祉法 及び母子及び寡婦福祉法 に定める援護又は育成の措置に関する事務のうち都道府県が処理することとされているものをつかさどるところとする。 6  市町村(特別区を含む。以下同じ。)の設置する福祉に関する事務所は、生活保護法 、児童福祉法 、母子及び寡婦福祉法 、老人福祉法 、身体障害者福祉法 及び知的障害者福祉法 に定める援護、育成又は更生の措置に関する事務のうち市町村が処理することとされているもの(政令で定めるものを除く。)をつかさどるところとする。 7  町村の福祉に関する事務所の設置又は廃止の時期は、会計年度の始期又は終期でなければならない。 8  町村は、福祉に関する事務所を設置し、又は廃止するには、あらかじめ、都道府県知事に協議しなければならない。 (組織) 第十五条  福祉に関する事務所には、長及び少なくとも次の所員を置かなければならない。ただし、所の長が、その職務の遂行に支障がない場合において、自ら現業事務の指導監督を行うときは、第一号の所員を置くことを要しない。 一  指導監督を行う所員 二  現業を行う所員 三  事務を行う所員 2  所の長は、都道府県知事又は市町村長(特別区の区長を含む。以下同じ。)の指揮監督を受けて、所務を掌理する。 3  指導監督を行う所員は、所の長の指揮監督を受けて、現業事務の指導監督をつかさどる。 4  現業を行う所員は、所の長の指揮監督を受けて、援護、育成又は更生の措置を要する者等の家庭を訪問し、又は訪問しないで、これらの者に面接し、本人の資産、環境等を調査し、保護その他の措置の必要の有無及びその種類を判断し、本人に対し生活指導を行う等の事務をつかさどる。 5  事務を行う所員は、所の長の指揮監督を受けて、所の庶務をつかさどる。 6  第一項第一号及び第二号の所員は、社会福祉主事でなければならない。 (所員の定数) 第十六条  所員の定数は、条例で定める。ただし、現業を行う所員の数は、各事務所につき、それぞれ次の各号に掲げる数を標準として定めるものとする。 一  都道府県の設置する事務所にあつては、生活保護法 の適用を受ける被保護世帯(以下「被保護世帯」という。)の数が三百九十以下であるときは、六とし、被保護世帯の数が六十五を増すごとに、これに一を加えた数 二  市の設置する事務所にあつては、被保護世帯の数が二百四十以下であるときは、三とし、被保護世帯数が八十を増すごとに、これに一を加えた数 三  町村の設置する事務所にあつては、被保護世帯の数が百六十以下であるときは、二とし、被保護世帯数が八十を増すごとに、これに一を加えた数 (服務) 第十七条  第十五条第一項第一号及び第二号の所員は、それぞれ同条第三項又は第四項に規定する職務にのみ従事しなければならない。ただし、その職務の遂行に支障がない場合に、これらの所員が、他の社会福祉又は保健医療に関する事務を行うことを妨げない。    第四章 社会福祉主事 (設置) 第十八条  都道府県、市及び福祉に関する事務所を設置する町村に、社会福祉主事を置く。 2  前項に規定する町村以外の町村は、社会福祉主事を置くことができる。 3  都道府県の社会福祉主事は、都道府県の設置する福祉に関する事務所において、生活保護法 、児童福祉法 及び母子及び寡婦福祉法 に定める援護又は育成の措置に関する事務を行うことを職務とする。 4  市及び第一項に規定する町村の社会福祉主事は、市及び同項に規定する町村に設置する福祉に関する事務所において、生活保護法 、児童福祉法 、母子及び寡婦福祉法 、老人福祉法 、身体障害者福祉法 及び知的障害者福祉法 に定める援護、育成又は更生の措置に関する事務を行うことを職務とする。 5  第二項の規定により置かれる社会福祉主事は、老人福祉法 、身体障害者福祉法 及び知的障害者福祉法 に定める援護又は更生の措置に関する事務を行うことを職務とする。 (資格等) 第十九条  社会福祉主事は、都道府県知事又は市町村長の補助機関である職員とし、年齢二十年以上の者であつて、人格が高潔で、思慮が円熟し、社会福祉の増進に熱意があり、かつ、次の各号のいずれかに該当するもののうちから任用しなければならない。 一  学校教育法 (昭和二十二年法律第二十六号)に基づく大学、旧大学令(大正七年勅令第三百八十八号)に基づく大学、旧高等学校令(大正七年勅令第三百八十九号)に基づく高等学校又は旧専門学校令(明治三十六年勅令第六十一号)に基づく専門学校において、厚生労働大臣の指定する社会福祉に関する科目を修めて卒業した者 二  厚生労働大臣の指定する養成機関又は講習会の課程を修了した者 三  社会福祉士 四  厚生労働大臣の指定する社会福祉事業従事者試験に合格した者 五  前各号に掲げる者と同等以上の能力を有すると認められる者として厚生労働省令で定めるもの 2  前項第二号の養成機関の指定に関し必要な事項は、政令で定める。    第五章 指導監督及び訓練 (指導監督) 第二十条  都道府県知事並びに指定都市及び中核市の長は、この法律、生活保護法 、児童福祉法 、母子及び寡婦福祉法 、老人福祉法 、身体障害者福祉法 及び知的障害者福祉法 の施行に関しそれぞれその所部の職員の行う事務について、その指導監督を行うために必要な計画を樹立し、及びこれを実施するよう努めなければならない。 (訓練) 第二十一条  この法律、生活保護法 、児童福祉法 、母子及び寡婦福祉法 、老人福祉法 、身体障害者福祉法 及び知的障害者福祉法 の施行に関する事務に従事する職員の素質を向上するため、都道府県知事はその所部の職員及び市町村の職員に対し、指定都市及び中核市の長はその所部の職員に対し、それぞれ必要な訓練を行わなければならない。    第六章 社会福祉法人     第一節 通則 (定義) 第二十二条  この法律において「社会福祉法人」とは、社会福祉事業を行うことを目的として、この法律の定めるところにより設立された法人をいう。 (名称) 第二十三条  社会福祉法人以外の者は、その名称中に、「社会福祉法人」又はこれに紛らわしい文字を用いてはならない。 (経営の原則) 第二十四条  社会福祉法人は、社会福祉事業の主たる担い手としてふさわしい事業を確実、効果的かつ適正に行うため、自主的にその経営基盤の強化を図るとともに、その提供する福祉サービスの質の向上及び事業経営の透明性の確保を図らなければならない。 (要件) 第二十五条  社会福祉法人は、社会福祉事業を行うに必要な資産を備えなければならない。 (公益事業及び収益事業) 第二十六条  社会福祉法人は、その経営する社会福祉事業に支障がない限り、公益を目的とする事業(以下「公益事業」という。)又はその収益を社会福祉事業若しくは公益事業(第二条第四項第四号に掲げる事業その他の政令で定めるものに限る。第五十七条第二号において同じ。)の経営に充てることを目的とする事業(以下「収益事業」という。)を行うことができる。 2  公益事業又は収益事業に関する会計は、それぞれ当該社会福祉法人の行う社会福祉事業に関する会計から区分し、特別の会計として経理しなければならない。 (住所) 第二十七条  社会福祉法人の住所は、その主たる事務所の所在地にあるものとする。 (登記) 第二十八条  社会福祉法人は、政令の定めるところにより、その設立、従たる事務所の新設、事務所の移転その他登記事項の変更、解散、合併、清算人の就任又はその変更及び清算の結了の各場合に、登記をしなければならない。 2  前項の規定により登記をしなければならない事項は、登記の後でなければ、これをもつて第三者に対抗することができない。 (準用規定) 第二十九条  一般社団法人及び一般財団法人に関する法律 (平成十八年法律第四十八号)第七十八条 (代表者の行為についての損害賠償責任)の規定は、社会福祉法人について準用する。 (所轄庁) 第三十条  社会福祉法人の所轄庁は、都道府県知事とする。ただし、次の各号に掲げる社会福祉法人の所轄庁は、当該各号に定める者とする。 一  主たる事務所が市の区域内にある社会福祉法人(次号に掲げる社会福祉法人を除く。)であつてその行う事業が当該市の区域を越えないもの 市長(特別区の区長を含む。以下同じ。) 二  第百九条第二項に規定する地区社会福祉協議会である社会福祉法人 指定都市の長 2  社会福祉法人でその行う事業が二以上の都道府県の区域にわたるものにあつては、その所轄庁は、前項本文の規定にかかわらず、厚生労働大臣とする。     第二節 設立 (申請) 第三十一条  社会福祉法人を設立しようとする者は、定款をもつて少なくとも次に掲げる事項を定め、厚生労働省令で定める手続に従い、当該定款について所轄庁の認可を受けなければならない。 一  目的 二  名称 三  社会福祉事業の種類 四  事務所の所在地 五  役員に関する事項 六  会議に関する事項 七  資産に関する事項 八  会計に関する事項 九  評議員会を置く場合には、これに関する事項 十  公益事業を行う場合には、その種類 十一  収益事業を行う場合には、その種類 十二  解散に関する事項 十三  定款の変更に関する事項 十四  公告の方法 2  設立当初の役員は、定款で定めなければならない。 3  第一項第十二号に掲げる事項中に、残余財産の帰属すべき者に関する規定を設ける場合には、その者は、社会福祉法人その他社会福祉事業を行う者のうちから選定されるようにしなければならない。 4  前条第二項の社会福祉法人に係る第一項の規定による認可の申請は、当該社会福祉法人の主たる事務所の所在地の都道府県知事を経由して行わなければならない。この場合において、当該都道府県知事は、必要な調査をし、意見を付するものとする。 (認可) 第三十二条  所轄庁は、前条第一項の規定による認可の申請があつたときは、当該申請に係る社会福祉法人の資産が第二十五条の要件に該当しているかどうか、その定款の内容及び設立の手続が、法令の規定に違反していないかどうか等を審査した上で、当該定款の認可を決定しなければならない。 (定款の補充) 第三十三条  社会福祉法人を設立しようとする者が、第三十一条第一項第二号から第十四号までの各号に掲げる事項を定めないで死亡した場合には、厚生労働大臣は、利害関係人の請求により又は職権で、これらの事項を定めなければならない。 (成立の時期) 第三十四条  社会福祉法人は、その主たる事務所の所在地において設立の登記をすることによつて成立する。 (財産目録の作成及び備置き) 第三十四条の二  社会福祉法人は、成立の時に財産目録を作成し、常にこれをその主たる事務所に備え置かなければならない。 (準用規定) 第三十五条  一般社団法人及び一般財団法人に関する法律第百五十八条 (贈与又は遺贈に関する規定の準用)及び第百六十四条 (財産の帰属時期)の規定は、社会福祉法人の設立について準用する。     第三節 管理 (役員の定数、任期、選任及び欠格) 第三十六条  社会福祉法人には、役員として、理事三人以上及び監事一人以上を置かなければならない。 2  役員の任期は、二年を超えることはできない。ただし、再任を妨げない。 3  役員のうちには、各役員について、その役員、その配偶者及び三親等以内の親族が役員の総数の二分の一を超えて含まれることになつてはならない。 4  次の各号のいずれかに該当する者は、社会福祉法人の役員になることができない。 一  成年被後見人又は被保佐人 二  生活保護法 、児童福祉法 、老人福祉法 、身体障害者福祉法 又はこの法律の規定に違反して刑に処せられ、その執行を終わり、又は執行を受けることがなくなるまでの者 三  前号に該当する者を除くほか、禁錮以上の刑に処せられ、その執行を終わり、又は執行を受けることがなくなるまでの者 四  第五十六条第四項の規定による所轄庁の解散命令により解散を命ぜられた社会福祉法人の解散当時の役員 (役員の欠員補充) 第三十七条  理事又は監事のうち、その定数の三分の一を超える者が欠けたときは、遅滞なくこれを補充しなければならない。 (理事の代表権) 第三十八条  理事は、すべて社会福祉法人の業務について、社会福祉法人を代表する。ただし、定款をもつて、その代表権を制限することができる。 (業務の決定) 第三十九条  社会福祉法人の業務は、定款に別段の定めがないときは、理事の過半数をもつて決する。 (理事の代理行為の委任) 第三十九条の二  理事は、定款によつて禁止されていないときに限り、特定の行為の代理を他人に委任することができる。 (仮理事) 第三十九条の三  理事が欠けた場合において、事務が遅滞することにより損害を生ずるおそれがあるときは、所轄庁は、利害関係人の請求により又は職権で、仮理事を選任しなければならない。 (利益相反行為) 第三十九条の四  社会福祉法人と理事との利益が相反する事項については、理事は、代理権を有しない。この場合においては、所轄庁は、利害関係人の請求により又は職権で、特別代理人を選任しなければならない。 (監事の職務) 第四十条  監事は、次に掲げる職務を行う。 一  理事の業務執行の状況を監査すること。 二  社会福祉法人の財産の状況を監査すること。 三  理事の業務執行の状況又は社会福祉法人の財産の状況について監査した結果、不整の点があることを発見したとき、これを評議員会(評議員会のないときは、所轄庁)に報告すること。 四  前号の報告をするために必要があるとき、理事に対して評議員会の招集を請求すること。 五  理事の業務執行の状況又は社会福祉法人の財産の状況について、理事に意見を述べること。 (監事の兼職禁止) 第四十一条  監事は、理事、評議員又は社会福祉法人の職員を兼ねてはならない。 (評議員会) 第四十二条  社会福祉法人に、評議員会を置くことができる。 2  評議員会は、理事の定数の二倍を超える数の評議員をもつて組織する。 3  社会福祉法人の業務に関する重要事項は、定款をもつて、評議員会の議決を要するものとすることができる。 (定款の変更) 第四十三条  定款の変更(厚生労働省令で定める事項に係るものを除く。)は、所轄庁の認可を受けなければ、その効力を生じない。 2  第三十一条第四項の規定は定款の変更の認可の申請に、第三十二条の規定は定款の変更の認可にそれぞれ準用する。 3  社会福祉法人は、第一項の厚生労働省令で定める事項に係る定款の変更をしたときは、遅滞なくその旨を所轄庁に届け出なければならない。 4  第三十条第二項の社会福祉法人に係る前項の規定による届出は、当該社会福祉法人の主たる事務所の所在地の都道府県知事を経由して行わなければならない。 (会計) 第四十四条  社会福祉法人の会計年度は、四月一日に始まり、翌年三月三十一日に終わるものとする。 2  社会福祉法人は、毎会計年度終了後二月以内に事業報告書、財産目録、貸借対照表及び収支計算書を作成しなければならない。 3  理事は、前項の書類を監事に提出しなければならない。 4  社会福祉法人は、第二項の書類及びこれに関する監事の意見を記載した書面を各事務所に備えて置き、当該社会福祉法人が提供する福祉サービスの利用を希望する者その他の利害関係人から請求があつた場合には、正当な理由がある場合を除いて、これを閲覧に供しなければならない。 第四十五条  削除     第四節 解散及び合併 (解散事由) 第四十六条  社会福祉法人は、次の事由によつて解散する。 一  理事の三分の二以上の同意及び定款でさらに評議員会の議決を要するものと定められている場合には、その議決 二  定款に定めた解散事由の発生 三  目的たる事業の成功の不能 四  合併 五  破産手続開始の決定 六  所轄庁の解散命令 2  前項第一号又は第三号に掲げる事由による解散は、所轄庁の認可又は認定がなければ、その効力を生じない。 3  清算人は、第一項第二号又は第五号に掲げる事由によつて解散した場合には、遅滞なくその旨を所轄庁に届け出なければならない。 4  第三十一条第四項の規定は、第二項の規定による認可又は認定の申請に準用する。 (社会福祉法人についての破産手続の開始) 第四十六条の二  社会福祉法人がその債務につきその財産をもつて完済することができなくなつた場合には、裁判所は、理事若しくは債権者の申立てにより又は職権で、破産手続開始の決定をする。 2  前項に規定する場合には、理事は、直ちに破産手続開始の申立てをしなければならない。 (清算中の社会福祉法人の能力) 第四十六条の三  解散した社会福祉法人は、清算の目的の範囲内において、その清算の結了に至るまではなお存続するものとみなす。 (清算人) 第四十六条の四  社会福祉法人が解散したときは、破産手続開始の決定による解散の場合を除き、理事がその清算人となる。ただし、定款に別段の定めがあるときは、この限りでない。 (裁判所による清算人の選任) 第四十六条の五  前条の規定により清算人となる者がないとき、又は清算人が欠けたため損害を生ずるおそれがあるときは、裁判所は、利害関係人若しくは検察官の請求により又は職権で、清算人を選任することができる。 (清算人の解任) 第四十六条の六  重要な事由があるときは、裁判所は、利害関係人若しくは検察官の請求により又は職権で、清算人を解任することができる。 (清算人の届出) 第四十六条の七  清算中に就職した清算人は、その氏名及び住所を所轄庁に届け出なければならない。 (清算人の職務及び権限) 第四十六条の八  清算人の職務は、次のとおりとする。 一  現務の結了 二  債権の取立て及び債務の弁済 三  残余財産の引渡し 2  清算人は、前項各号に掲げる職務を行うために必要な一切の行為をすることができる。 (債権の申出の催告等) 第四十六条の九  清算人は、その就職の日から二月以内に、少なくとも三回の公告をもつて、債権者に対し、一定の期間内にその債権の申出をすべき旨の催告をしなければならない。この場合において、その期間は、二月を下ることができない。 2  前項の公告には、債権者がその期間内に申出をしないときは清算から除斥されるべき旨を付記しなければならない。ただし、清算人は、判明している債権者を除斥することができない。 3  清算人は、判明している債権者には、各別にその申出の催告をしなければならない。 4  第一項の公告は、官報に掲載してする。 (期間経過後の債権の申出) 第四十六条の十  前条第一項の期間の経過後に申出をした債権者は、社会福祉法人の債務が完済された後まだ権利の帰属すべき者に引き渡されていない財産に対してのみ、請求をすることができる。 (清算中の社会福祉法人についての破産手続の開始) 第四十六条の十一  清算中に社会福祉法人の財産がその債務を完済するのに足りないことが明らかになつたときは、清算人は、直ちに破産手続開始の申立てをし、その旨を公告しなければならない。 2  清算人は、清算中の社会福祉法人が破産手続開始の決定を受けた場合において、破産管財人にその事務を引き継いだときは、その任務を終了したものとする。 3  前項に規定する場合において、清算中の社会福祉法人が既に債権者に支払い、又は権利の帰属すべき者に引き渡したものがあるときは、破産管財人は、これを取り戻すことができる。 4  第一項の規定による公告は、官報に掲載してする。 (残余財産の帰属) 第四十七条  解散した社会福祉法人の残余財産は、合併及び破産手続開始の決定による解散の場合を除くほか、所轄庁に対する清算結了の届出の時において、定款の定めるところにより、その帰属すべき者に帰属する。 2  前項の規定により処分されない財産は、国庫に帰属する。 (裁判所による監督) 第四十七条の二  社会福祉法人の解散及び清算は、裁判所の監督に属する。 2  裁判所は、職権で、いつでも前項の監督に必要な検査をすることができる。 3  社会福祉法人の解散及び清算を監督する裁判所は、社会福祉法人の業務を監督する官庁に対し、意見を求め、又は調査を嘱託することができる。 4  前項に規定する官庁は、同項に規定する裁判所に対し、意見を述べることができる。 (清算結了の届出) 第四十七条の三  清算が結了したときは、清算人は、その旨を所轄庁に届け出なければならない。 (解散及び清算の監督等に関する事件の管轄) 第四十七条の四  社会福祉法人の解散及び清算の監督並びに清算人に関する事件は、その主たる事務所の所在地を管轄する地方裁判所の管轄に属する。 (不服申立ての制限) 第四十七条の五  清算人の選任の裁判に対しては、不服を申し立てることができない。 (裁判所の選任する清算人の報酬) 第四十七条の六  裁判所は、第四十六条の五の規定により清算人を選任した場合には、社会福祉法人が当該清算人に対して支払う報酬の額を定めることができる。この場合においては、裁判所は、当該清算人及び監事の陳述を聴かなければならない。 第四十七条の七  削除 (検査役の選任) 第四十七条の八  裁判所は、社会福祉法人の解散及び清算の監督に必要な調査をさせるため、検査役を選任することができる。 2  第四十七条の五及び第四十七条の六の規定は、前項の規定により裁判所が検査役を選任した場合について準用する。この場合において、同条中「清算人及び監事」とあるのは、「社会福祉法人及び検査役」と読み替えるものとする。 (合併) 第四十八条  社会福祉法人は、他の社会福祉法人と合併することができる。 (合併手続) 第四十九条  社会福祉法人が合併するには、理事の三分の二以上の同意及び定款でさらに評議員会の議決を要するものと定められている場合には、その議決がなければならない。 2  合併は、所轄庁の認可を受けなければ、その効力を生じない。 3  第三十一条第四項の規定は合併の認可の申請に、第三十二条の規定は合併の認可にそれぞれ準用する。 第五十条  社会福祉法人は、前条第二項に規定する所轄庁の認可があつたときは、その認可の通知のあつた日から二週間以内に財産目録及び貸借対照表を作成しなければならない。 2  社会福祉法人は、前項の期間内に、その債権者に対し、異議があれば一定の期間内に述べるべき旨を公告し、かつ、判明している債権者に対しては、各別にこれを催告しなければならない。ただし、その期間は、二月を下ることができない。 第五十一条  債権者が、前条第二項の期間内に合併に対して異議を述べなかつたときは、合併を承認したものとみなす。 2  債権者が異議を述べたときは、社会福祉法人は、これに弁済し、若しくは相当の担保を供し、又はその債権者に弁済を受けさせることを目的として信託会社若しくは信託業務を営む金融機関に相当の財産を信託しなければならない。ただし、合併をしてもその債権者を害するおそれがないときは、この限りでない。 第五十二条  合併により社会福祉法人を設立する場合においては、定款の作成その他社会福祉法人の設立に関する事務は、各社会福祉法人において選任した者が共同して行わなければならない。 (合併の効果) 第五十三条  合併後存続する社会福祉法人又は合併によつて設立した社会福祉法人は、合併によつて消滅した社会福祉法人の一切の権利義務(当該社会福祉法人がその行う事業に関し行政庁の認可その他の処分に基づいて有する権利義務を含む。)を承継する。 (合併の時期) 第五十四条  社会福祉法人の合併は、合併後存続する社会福祉法人又は合併によつて設立する社会福祉法人の主たる事務所の所在地において登記をすることによつて、その効力を生ずる。 第五十五条  削除     第五節 助成及び監督 (一般的監督) 第五十六条  厚生労働大臣又は都道府県知事若しくは市長は、法令、法令に基づいてする行政庁の処分及び定款が遵守されているかどうかを確かめるため必要があると認めるときは、社会福祉法人からその業務又は会計の状況に関し、報告を徴し、又は当該職員に、社会福祉法人の業務及び財産の状況を検査させることができる。 2  所轄庁は、社会福祉法人が、法令、法令に基づいてする行政庁の処分若しくは定款に違反し、又はその運営が著しく適正を欠くと認めるときは、当該社会福祉法人に対し、期限を定めて、必要な措置を採るべき旨を命ずることができる。 3  社会福祉法人が前項の命令に従わないときは、所轄庁は、当該社会福祉法人に対し、期間を定めて業務の全部若しくは一部の停止を命じ、又は役員の解職を勧告することができる。 4  所轄庁は、社会福祉法人が、法令、法令に基づいてする行政庁の処分若しくは定款に違反した場合であつて他の方法により監督の目的を達することができないとき、又は正当の事由がないのに一年以上にわたつてその目的とする事業を行わないときは、解散を命ずることができる。 5  所轄庁は、第三項の規定により役員の解職を勧告しようとする場合には、当該社会福祉法人に、所轄庁の指定した職員に対して弁明する機会を与えなければならない。この場合においては、当該社会福祉法人に対し、あらかじめ、書面をもつて、弁明をなすべき日時、場所及びその勧告をなすべき理由を通知しなければならない。 6  前項の通知を受けた社会福祉法人は、代理人を出頭させ、かつ、自己に有利な証拠を提出することができる。 7  第五項の規定による弁明を聴取した者は、聴取書及び当該勧告をする必要があるかどうかについての意見を付した報告書を作成し、これを所轄庁に提出しなければならない。 (公益事業又は収益事業の停止) 第五十七条  所轄庁は、第二十六条第一項の規定により公益事業又は収益事業を行う社会福祉法人につき、次の各号のいずれかに該当する事由があると認めるときは、当該社会福祉法人に対して、その事業の停止を命ずることができる。 一  当該社会福祉法人が定款で定められた事業以外の事業を行うこと。 二  当該社会福祉法人が当該収益事業から生じた収益を当該社会福祉法人の行う社会福祉事業及び公益事業以外の目的に使用すること。 三  当該公益事業又は収益事業の継続が当該社会福祉法人の行う社会福祉事業に支障があること。 (助成及び監督) 第五十八条  国又は地方公共団体は、必要があると認めるときは、厚生労働省令又は当該地方公共団体の条例で定める手続に従い、社会福祉法人に対し、補助金を支出し、又は通常の条件よりも当該社会福祉法人に有利な条件で、貸付金を支出し、若しくはその他の財産を譲り渡し、若しくは貸し付けることができる。ただし、国有財産法 (昭和二十三年法律第七十三号)及び地方自治法第二百三十七条第二項 の規定の適用を妨げない。 2  前項の規定により、社会福祉法人に対する助成がなされたときは、厚生労働大臣又は地方公共団体の長は、その助成の目的が有効に達せられることを確保するため、当該社会福祉法人に対して、次に掲げる権限を有する。 一  事業又は会計の状況に関し報告を徴すること。 二  助成の目的に照らして、社会福祉法人の予算が不適当であると認める場合において、その予算について必要な変更をすべき旨を勧告すること。 三  社会福祉法人の役員が法令、法令に基づいてする行政庁の処分又は定款に違反した場合において、その役員を解職すべき旨を勧告すること。 3  国又は地方公共団体は、社会福祉法人が前項の規定による措置に従わなかつたときは、交付した補助金若しくは貸付金又は譲渡し、若しくは貸し付けたその他の財産の全部又は一部の返還を命ずることができる。 4  第五十六条第五項から第七項までの規定は、第二項第三号の規定により解職を勧告し、又は前項の規定により補助金若しくは貸付金の全部若しくは一部の返還を命令する場合に準用する。 (所轄庁への届出) 第五十九条  社会福祉法人は、毎会計年度終了後三月以内に、事業の概要その他の厚生労働省令で定める事項を、所轄庁に届け出なければならない。 2  第四十三条第四項の規定は、前項の場合に準用する。    第七章 社会福祉事業 (経営主体) 第六十条  社会福祉事業のうち、第一種社会福祉事業は、国、地方公共団体又は社会福祉法人が経営することを原則とする。 (事業経営の準則) 第六十一条  国、地方公共団体、社会福祉法人その他社会福祉事業を経営する者は、次に掲げるところに従い、それぞれの責任を明確にしなければならない。 一  国及び地方公共団体は、法律に基づくその責任を他の社会福祉事業を経営する者に転嫁し、又はこれらの者の財政的援助を求めないこと。 二  国及び地方公共団体は、他の社会福祉事業を経営する者に対し、その自主性を重んじ、不当な関与を行わないこと。 三  社会福祉事業を経営する者は、不当に国及び地方公共団体の財政的、管理的援助を仰がないこと。 2  前項第一号の規定は、国又は地方公共団体が、その経営する社会福祉事業について、福祉サービスを必要とする者を施設に入所させることその他の措置を他の社会福祉事業を経営する者に委託することを妨げるものではない。 (施設の設置) 第六十二条  市町村又は社会福祉法人は、施設を設置して、第一種社会福祉事業を経営しようとするときは、その事業の開始前に、その施設(以下「社会福祉施設」という。)を設置しようとする地の都道府県知事に、次に掲げる事項を届け出なければならない。 一  施設の名称及び種類 二  設置者の氏名又は名称、住所、経歴及び資産状況 三  条例、定款その他の基本約款 四  建物その他の設備の規模及び構造 五  事業開始の予定年月日 六  施設の管理者及び実務を担当する幹部職員の氏名及び経歴 七  福祉サービスを必要とする者に対する処遇の方法 2  国、都道府県、市町村及び社会福祉法人以外の者は、社会福祉施設を設置して、第一種社会福祉事業を経営しようとするときは、その事業の開始前に、その施設を設置しようとする地の都道府県知事の許可を受けなければならない。 3  前項の許可を受けようとする者は、第一項各号に掲げる事項のほか、次に掲げる事項を記載した申請書を当該都道府県知事に提出しなければならない。 一  当該事業を経営するための財源の調達及びその管理の方法 二  施設の管理者の資産状況 三  建物その他の設備の使用の権限 四  経理の方針 五  事業の経営者又は施設の管理者に事故があるときの処置 4  都道府県知事は、第二項の許可の申請があつたときは、第六十五条の規定により都道府県の条例で定める基準に適合するかどうかを審査するほか、次に掲げる基準によつて、その申請を審査しなければならない。 一  当該事業を経営するために必要な経済的基礎があること。 二  当該事業の経営者が社会的信望を有すること。 三  実務を担当する幹部職員が社会福祉事業に関する経験、熱意及び能力を有すること。 四  当該事業の経理が他の経理と分離できる等その性格が社会福祉法人に準ずるものであること。 五  脱税その他不正の目的で当該事業を経営しようとするものでないこと。 5  都道府県知事は、前項に規定する審査の結果、その申請が、同項に規定する基準に適合していると認めるときは、社会福祉施設設置の許可を与えなければならない。 6  都道府県知事は、前項の許可を与えるに当たつて、当該事業の適正な運営を確保するために必要と認める条件を付することができる。 (変更) 第六十三条  前条第一項の規定による届出をした者は、その届け出た事項に変更を生じたときは、変更の日から一月以内に、その旨を当該都道府県知事に届け出なければならない。 2  前条第二項の規定による許可を受けた者は、同条第一項第四号、第五号及び第七号並びに同条第三項第一号、第四号及び第五号に掲げる事項を変更しようとするときは、当該都道府県知事の許可を受けなければならない。 3  前条第四項から第六項までの規定は、前項の規定による許可の申請があつた場合に準用する。 (廃止) 第六十四条  第六十二条第一項の規定による届出をし、又は同条第二項の規定による許可を受けて、社会福祉事業を経営する者は、その事業を廃止しようとするときは、廃止の日の一月前までに、その旨を当該都道府県知事に届け出なければならない。 (施設の基準) 第六十五条  都道府県は、社会福祉施設の設備の規模及び構造並びに福祉サービスの提供の方法、利用者等からの苦情への対応その他の社会福祉施設の運営について、条例で基準を定めなければならない。 2  都道府県が前項の条例を定めるに当たつては、第一号から第三号までに掲げる事項については厚生労働省令で定める基準に従い定めるものとし、第四号に掲げる事項については厚生労働省令で定める基準を標準として定めるものとし、その他の事項については厚生労働省令で定める基準を参酌するものとする。 一  社会福祉施設に配置する職員及びその員数 二  社会福祉施設に係る居室の床面積 三  社会福祉施設の運営に関する事項であつて、利用者の適切な処遇及び安全の確保並びに秘密の保持に密接に関連するものとして厚生労働省令で定めるもの 四  社会福祉施設の利用定員 3  社会福祉施設の設置者は、第一項の基準を遵守しなければならない。 (管理者) 第六十六条  社会福祉施設には、専任の管理者を置かなければならない。 (施設を必要としない第一種社会福祉事業の開始) 第六十七条  市町村又は社会福祉法人は、施設を必要としない第一種社会福祉事業を開始したときは、事業開始の日から一月以内に、事業経営地の都道府県知事に次に掲げる事項を届け出なければならない。 一  経営者の名称及び主たる事務所の所在地 二  事業の種類及び内容 三  条例、定款その他の基本約款 2  国、都道府県、市町村及び社会福祉法人以外の者は、施設を必要としない第一種社会福祉事業を経営しようとするときは、その事業の開始前に、その事業を経営しようとする地の都道府県知事の許可を受けなければならない。 3  前項の許可を受けようとする者は、第一項各号並びに第六十二条第三項第一号、第四号及び第五号に掲げる事項を記載した申請書を当該都道府県知事に提出しなければならない。 4  都道府県知事は、第二項の許可の申請があつたときは、第六十二条第四項各号に掲げる基準によつて、これを審査しなければならない。 5  第六十二条第五項及び第六項の規定は、前項の場合に準用する。 (変更及び廃止) 第六十八条  前条第一項の規定による届出をし、又は同条第二項の規定による許可を受けて社会福祉事業を経営する者は、その届け出た事項又は許可申請書に記載した事項に変更を生じたときは、変更の日から一月以内に、その旨を当該都道府県知事に届け出なければならない。その事業を廃止したときも、同様とする。 (第二種社会福祉事業) 第六十九条  国及び都道府県以外の者は、第二種社会福祉事業を開始したときは、事業開始の日から一月以内に、事業経営地の都道府県知事に第六十七条第一項各号に掲げる事項を届け出なければならない。 2  前項の規定による届出をした者は、その届け出た事項に変更を生じたときは、変更の日から一月以内に、その旨を当該都道府県知事に届け出なければならない。その事業を廃止したときも、同様とする。 (調査) 第七十条  都道府県知事は、この法律の目的を達成するため、社会福祉事業を経営する者に対し、必要と認める事項の報告を求め、又は当該職員をして、施設、帳簿、書類等を検査し、その他事業経営の状況を調査させることができる。 (改善命令) 第七十一条  都道府県知事は、第六十二条第一項の規定による届出をし、又は同条第二項の規定による許可を受けて社会福祉事業を経営する者の施設が、第六十五条第一項の基準に適合しないと認められるに至つたときは、その事業を経営する者に対し、同項の基準に適合するために必要な措置を採るべき旨を命ずることができる。 (許可の取消し等) 第七十二条  都道府県知事は、第六十二条第一項、第六十七条第一項若しくは第六十九条第一項の届出をし、又は第六十二条第二項若しくは第六十七条第二項の許可を受けて社会福祉事業を経営する者が、第六十二条第六項(第六十三条第三項及び第六十七条第五項において準用する場合を含む。)の規定による条件に違反し、第六十三条第一項若しくは第二項、第六十八条若しくは第六十九条第二項の規定に違反し、第七十条の規定による報告の求めに応ぜず、若しくは虚偽の報告をし、同条の規定による当該職員の検査若しくは調査を拒み、妨げ、若しくは忌避し、前条の規定による命令に違反し、又はその事業に関し不当に営利を図り、若しくは福祉サービスの提供を受ける者の処遇につき不当な行為をしたときは、その者に対し、社会福祉事業を経営することを制限し、その停止を命じ、又は第六十二条第二項若しくは第六十七条第二項の許可を取り消すことができる。 2  都道府県知事は、第六十二条第一項、第六十七条第一項若しくは第六十九条第一項の届出をし、若しくは第七十四条に規定する他の法律に基づく届出をし、又は第六十二条第二項若しくは第六十七条第二項の許可を受け、若しくは第七十四条に規定する他の法律に基づく許可若しくは認可を受けて社会福祉事業を経営する者(次章において「社会福祉事業の経営者」という。)が、第七十七条又は第七十九条の規定に違反したときは、その者に対し、社会福祉事業を経営することを制限し、その停止を命じ、又は第六十二条第二項若しくは第六十七条第二項の許可若しくは第七十四条に規定する他の法律に基づく許可若しくは認可を取り消すことができる。 3  都道府県知事は、第六十二条第一項若しくは第二項、第六十七条第一項若しくは第二項又は第六十九条第一項の規定に違反して社会福祉事業を経営する者が、その事業に関し不当に営利を図り、若しくは福祉サービスの提供を受ける者の処遇につき不当の行為をしたときは、その者に対し、社会福祉事業を経営することを制限し、又はその停止を命ずることができる。 (市の区域内で行われる隣保事業の特例) 第七十三条  市の区域内で行われる隣保事業について第六十九条、第七十条及び前条の規定を適用する場合においては、第六十九条第一項中「及び都道府県」とあるのは「、都道府県及び市」と、「都道府県知事」とあるのは「市長」と、同条第二項、第七十条及び前条中「都道府県知事」とあるのは「市長」と読み替えるものとする。 (適用除外) 第七十四条  第六十二条から第七十一条まで並びに第七十二条第一項及び第三項の規定は、他の法律によつて、その設置又は開始につき、行政庁の許可、認可又は行政庁への届出を要するものとされている施設又は事業については、適用しない。    第八章 福祉サービスの適切な利用     第一節 情報の提供等 (情報の提供) 第七十五条  社会福祉事業の経営者は、福祉サービス(社会福祉事業において提供されるものに限る。以下この節及び次節において同じ。)を利用しようとする者が、適切かつ円滑にこれを利用することができるように、その経営する社会福祉事業に関し情報の提供を行うよう努めなければならない。 2  国及び地方公共団体は、福祉サービスを利用しようとする者が必要な情報を容易に得られるように、必要な措置を講ずるよう努めなければならない。 (利用契約の申込み時の説明) 第七十六条  社会福祉事業の経営者は、その提供する福祉サービスの利用を希望する者からの申込みがあつた場合には、その者に対し、当該福祉サービスを利用するための契約の内容及びその履行に関する事項について説明するよう努めなければならない。 (利用契約の成立時の書面の交付) 第七十七条  社会福祉事業の経営者は、福祉サービスを利用するための契約(厚生労働省令で定めるものを除く。)が成立したときは、その利用者に対し、遅滞なく、次に掲げる事項を記載した書面を交付しなければならない。 一  当該社会福祉事業の経営者の名称及び主たる事務所の所在地 二  当該社会福祉事業の経営者が提供する福祉サービスの内容 三  当該福祉サービスの提供につき利用者が支払うべき額に関する事項 四  その他厚生労働省令で定める事項 2  社会福祉事業の経営者は、前項の規定による書面の交付に代えて、政令の定めるところにより、当該利用者の承諾を得て、当該書面に記載すべき事項を電子情報処理組織を使用する方法その他の情報通信の技術を利用する方法であつて厚生労働省令で定めるものにより提供することができる。この場合において、当該社会福祉事業の経営者は、当該書面を交付したものとみなす。 (福祉サービスの質の向上のための措置等) 第七十八条  社会福祉事業の経営者は、自らその提供する福祉サービスの質の評価を行うことその他の措置を講ずることにより、常に福祉サービスを受ける者の立場に立つて良質かつ適切な福祉サービスを提供するよう努めなければならない。 2  国は、社会福祉事業の経営者が行う福祉サービスの質の向上のための措置を援助するために、福祉サービスの質の公正かつ適切な評価の実施に資するための措置を講ずるよう努めなければならない。 (誇大広告の禁止) 第七十九条  社会福祉事業の経営者は、その提供する福祉サービスについて広告をするときは、広告された福祉サービスの内容その他の厚生労働省令で定める事項について、著しく事実に相違する表示をし、又は実際のものよりも著しく優良であり、若しくは有利であると人を誤認させるような表示をしてはならない。     第二節 福祉サービスの利用の援助等 (福祉サービス利用援助事業の実施に当たつての配慮) 第八十条  福祉サービス利用援助事業を行う者は、当該事業を行うに当たつては、利用者の意向を十分に尊重するとともに、利用者の立場に立つて公正かつ適切な方法により行わなければならない。 (都道府県社会福祉協議会の行う福祉サービス利用援助事業等) 第八十一条  都道府県社会福祉協議会は、第百十条第一項各号に掲げる事業を行うほか、福祉サービス利用援助事業を行う市町村社会福祉協議会その他の者と協力して都道府県の区域内においてあまねく福祉サービス利用援助事業が実施されるために必要な事業を行うとともに、これと併せて、当該事業に従事する者の資質の向上のための事業並びに福祉サービス利用援助事業に関する普及及び啓発を行うものとする。 (社会福祉事業の経営者による苦情の解決) 第八十二条  社会福祉事業の経営者は、常に、その提供する福祉サービスについて、利用者等からの苦情の適切な解決に努めなければならない。 (運営適正化委員会) 第八十三条  都道府県の区域内において、福祉サービス利用援助事業の適正な運営を確保するとともに、福祉サービスに関する利用者等からの苦情を適切に解決するため、都道府県社会福祉協議会に、人格が高潔であつて、社会福祉に関する識見を有し、かつ、社会福祉、法律又は医療に関し学識経験を有する者で構成される運営適正化委員会を置くものとする。 (運営適正化委員会の行う福祉サービス利用援助事業に関する助言等) 第八十四条  運営適正化委員会は、第八十一条の規定により行われる福祉サービス利用援助事業の適正な運営を確保するために必要があると認めるときは、当該福祉サービス利用援助事業を行う者に対して必要な助言又は勧告をすることができる。 2  福祉サービス利用援助事業を行う者は、前項の勧告を受けたときは、これを尊重しなければならない。 (運営適正化委員会の行う苦情の解決のための相談等) 第八十五条  運営適正化委員会は、福祉サービスに関する苦情について解決の申出があつたときは、その相談に応じ、申出人に必要な助言をし、当該苦情に係る事情を調査するものとする。 2  運営適正化委員会は、前項の申出人及び当該申出人に対し福祉サービスを提供した者の同意を得て、苦情の解決のあつせんを行うことができる。 (運営適正化委員会から都道府県知事への通知) 第八十六条  運営適正化委員会は、苦情の解決に当たり、当該苦情に係る福祉サービスの利用者の処遇につき不当な行為が行われているおそれがあると認めるときは、都道府県知事に対し、速やかに、その旨を通知しなければならない。 (政令への委任) 第八十七条  この節に規定するもののほか、運営適正化委員会に関し必要な事項は、政令で定める。     第三節 社会福祉を目的とする事業を経営する者への支援 第八十八条  都道府県社会福祉協議会は、第百十条第一項各号に掲げる事業を行うほか、社会福祉を目的とする事業の健全な発達に資するため、必要に応じ、社会福祉を目的とする事業を経営する者がその行つた福祉サービスの提供に要した費用に関して地方公共団体に対して行う請求の事務の代行その他の社会福祉を目的とする事業を経営する者が当該事業を円滑に実施することができるよう支援するための事業を実施するよう努めなければならない。ただし、他に当該事業を実施する適切な者がある場合には、この限りでない。    第九章 社会福祉事業に従事する者の確保の促進     第一節 基本指針等 (基本指針) 第八十九条  厚生労働大臣は、社会福祉事業が適正に行われることを確保するため、社会福祉事業に従事する者(以下この章において「社会福祉事業従事者」という。)の確保及び国民の社会福祉に関する活動への参加の促進を図るための措置に関する基本的な指針(以下「基本指針」という。)を定めなければならない。 2  基本指針に定める事項は、次のとおりとする。 一  社会福祉事業従事者の就業の動向に関する事項 二  社会福祉事業を経営する者が行う、社会福祉事業従事者に係る処遇の改善(国家公務員及び地方公務員である者に係るものを除く。)及び資質の向上並びに新規の社会福祉事業従事者の確保に資する措置その他の社会福祉事業従事者の確保に資する措置の内容に関する事項 三  前号に規定する措置の内容に関して、その適正かつ有効な実施を図るために必要な措置の内容に関する事項 四  国民の社会福祉事業に対する理解を深め、国民の社会福祉に関する活動への参加を促進するために必要な措置の内容に関する事項 3  厚生労働大臣は、基本指針を定め、又はこれを変更しようとするときは、あらかじめ、総務大臣に協議するとともに、社会保障審議会及び都道府県の意見を聴かなければならない。 4  厚生労働大臣は、基本指針を定め、又はこれを変更したときは、遅滞なく、これを公表しなければならない。 (社会福祉事業を経営する者の講ずべき措置) 第九十条  社会福祉事業を経営する者は、前条第二項第二号に規定する措置の内容に即した措置を講ずるように努めなければならない。 2  社会福祉事業を経営する者は、前条第二項第四号に規定する措置の内容に即した措置を講ずる者に対し、必要な協力を行うように努めなければならない。 (指導及び助言) 第九十一条  国及び都道府県は、社会福祉事業を経営する者に対し、第八十九条第二項第二号に規定する措置の内容に即した措置の的確な実施に必要な指導及び助言を行うものとする。 (国及び地方公共団体の措置) 第九十二条  国は、社会福祉事業従事者の確保及び国民の社会福祉に関する活動への参加を促進するために必要な財政上及び金融上の措置その他の措置を講ずるよう努めなければならない。 2  地方公共団体は、社会福祉事業従事者の確保及び国民の社会福祉に関する活動への参加を促進するために必要な措置を講ずるよう努めなければならない。     第二節 福祉人材センター      第一款 都道府県福祉人材センター (指定等) 第九十三条  都道府県知事は、社会福祉事業に関する連絡及び援助を行うこと等により社会福祉事業従事者の確保を図ることを目的として設立された社会福祉法人であつて、次条に規定する業務を適正かつ確実に行うことができると認められるものを、その申請により、都道府県ごとに一個に限り、都道府県福祉人材センター(以下「都道府県センター」という。)として指定することができる。 2  都道府県知事は、前項の規定による指定をしたときは、当該都道府県センターの名称、住所及び事務所の所在地を公示しなければならない。 3  都道府県センターは、その名称、住所又は事務所の所在地を変更しようとするときは、あらかじめ、その旨を都道府県知事に届け出なければならない。 4  都道府県知事は、前項の規定による届出があつたときは、当該届出に係る事項を公示しなければならない。 (業務) 第九十四条  都道府県センターは、当該都道府県の区域内において、次に掲げる業務を行うものとする。 一  社会福祉事業に関する啓発活動を行うこと。 二  社会福祉事業従事者の確保に関する調査研究を行うこと。 三  社会福祉事業を経営する者に対し、第八十九条第二項第二号に規定する措置の内容に即した措置の実施に関する技術的事項について相談その他の援助を行うこと。 四  社会福祉事業の業務に関し、社会福祉事業従事者及び社会福祉事業に従事しようとする者に対して研修を行うこと。 五  社会福祉事業従事者の確保に関する連絡を行うこと。 六  社会福祉事業に従事しようとする者に対し、就業の援助を行うこと。 七  前各号に掲げるもののほか、社会福祉事業従事者の確保を図るために必要な業務を行うこと。 (他の社会福祉事業従事者の確保に関する業務を行う団体との連携) 第九十五条  都道府県センターは、前条に規定する業務を行うに当たつては、他の社会福祉事業従事者の確保に関する業務を行う団体との連携に努めなければならない。 (事業計画等) 第九十六条  都道府県センターは、毎事業年度、厚生労働省令の定めるところにより、事業計画書及び収支予算書を作成し、都道府県知事に提出しなければならない。これを変更しようとするときも、同様とする。 2  都道府県センターは、厚生労働省令の定めるところにより、毎事業年度終了後、事業報告書及び収支決算書を作成し、都道府県知事に提出しなければならない。 (監督命令) 第九十七条  都道府県知事は、この款の規定を施行するために必要な限度において、都道府県センターに対し、第九十四条に規定する業務に関し監督上必要な命令をすることができる。 (指定の取消し等) 第九十八条  都道府県知事は、都道府県センターが、次の各号のいずれかに該当するときは、第九十三条第一項の規定による指定(以下この条において「指定」という。)を取り消すことができる。 一  第九十四条に規定する業務を適正かつ確実に実施することができないと認められるとき。 二  指定に関し不正の行為があつたとき。 三  この款の規定又は当該規定に基づく命令若しくは処分に違反したとき。 2  都道府県知事は、前項の規定により指定を取り消したときは、その旨を公示しなければならない。      第二款 中央福祉人材センター (指定) 第九十九条  厚生労働大臣は、都道府県センターの業務に関する連絡及び援助を行うこと等により、都道府県センターの健全な発展を図るとともに、社会福祉事業従事者の確保を図ることを目的として設立された社会福祉法人であつて、次条に規定する業務を適正かつ確実に行うことができると認められるものを、その申請により、全国を通じて一個に限り、中央福祉人材センター(以下「中央センター」という。)として指定することができる。 (業務) 第百条  中央センターは、次に掲げる業務を行うものとする。 一  都道府県センターの業務に関する啓発活動を行うこと。 二  二以上の都道府県の区域における社会福祉事業従事者の確保に関する調査研究を行うこと。 三  社会福祉事業の業務に関し、都道府県センターの業務に従事する者に対して研修を行うこと。 四  社会福祉事業の業務に関し、社会福祉事業従事者に対して研修を行うこと。 五  都道府県センターの業務について、連絡調整を図り、及び指導その他の援助を行うこと。 六  都道府県センターの業務に関する情報及び資料を収集し、並びにこれを都道府県センターその他の関係者に対し提供すること。 七  前各号に掲げるもののほか、都道府県センターの健全な発展及び社会福祉事業従事者の確保を図るために必要な業務を行うこと。 (準用) 第百一条  第九十三条第二項から第四項まで及び第九十六条から第九十八条までの規定は、中央センターについて準用する。この場合において、これらの規定中「都道府県知事」とあるのは「厚生労働大臣」と、第九十三条第二項中「前項」とあるのは「第九十九条」と、第九十七条中「この款」とあるのは「次款」と、「第九十四条」とあるのは「第百条」と、第九十八条第一項中「第九十三条第一項」とあるのは「第九十九条」と、「第九十四条」とあるのは「第百条」と、「この款」とあるのは「次款」と読み替えるものとする。     第三節 福利厚生センター (指定) 第百二条  厚生労働大臣は、社会福祉事業に関する連絡及び助成を行うこと等により社会福祉事業従事者の福利厚生の増進を図ることを目的として設立された社会福祉法人であつて、次条に規定する業務を適正かつ確実に行うことができると認められるものを、その申請により、全国を通じて一個に限り、福利厚生センターとして指定することができる。 (業務) 第百三条  福利厚生センターは、次に掲げる業務を行うものとする。 一  社会福祉事業を経営する者に対し、社会福祉事業従事者の福利厚生に関する啓発活動を行うこと。 二  社会福祉事業従事者の福利厚生に関する調査研究を行うこと。 三  福利厚生契約(福利厚生センターが社会福祉事業を経営する者に対してその者に使用される社会福祉事業従事者の福利厚生の増進を図るための事業を行うことを約する契約をいう。以下同じ。)に基づき、社会福祉事業従事者の福利厚生の増進を図るための事業を実施すること。 四  社会福祉事業従事者の福利厚生に関し、社会福祉事業を経営する者との連絡を行い、及び社会福祉事業を経営する者に対し助成を行うこと。 五  前各号に掲げるもののほか、社会福祉事業従事者の福利厚生の増進を図るために必要な業務を行うこと。 (約款の認可等) 第百四条  福利厚生センターは、前条第三号に掲げる業務の開始前に、福利厚生契約に基づき実施する事業に関する約款(以下この条において「約款」という。)を定め、厚生労働大臣に提出してその認可を受けなければならない。これを変更しようとするときも、同様とする。 2  厚生労働大臣は、前項の認可をした約款が前条第三号に掲げる業務の適正かつ確実な実施上不適当となつたと認めるときは、その約款を変更すべきことを命ずることができる。 3  約款に記載すべき事項は、厚生労働省令で定める。 (契約の締結及び解除) 第百五条  福利厚生センターは、福利厚生契約の申込者が第六十二条第一項若しくは第二項、第六十七条第一項若しくは第二項又は第六十九条第一項(第七十三条の規定により読み替えて適用する場合を含む。)の規定に違反して社会福祉事業を経営する者であるとき、その他厚生労働省令で定める正当な理由があるときを除いては、福利厚生契約の締結を拒絶してはならない。 2  福利厚生センターは、社会福祉事業を経営する者がその事業を廃止したとき、その他厚生労働省令で定める正当な理由があるときを除いては、福利厚生契約を解除してはならない。 (準用) 第百六条  第九十三条第二項から第四項まで及び第九十六条から第九十八条までの規定は、福利厚生センターについて準用する。この場合において、これらの規定中「都道府県知事」とあるのは「厚生労働大臣」と、第九十三条第二項中「前項」とあるのは「第百二条」と、第九十六条第一項中「に提出しなければ」とあるのは「の認可を受けなければ」と、第九十七条中「この款」とあるのは「次節」と、「第九十四条」とあるのは「第百三条」と、第九十八条第一項中「第九十三条第一項」とあるのは「第百二条」と、「第九十四条」とあるのは「第百三条」と、「この款」とあるのは「次節」と、「違反した」とあるのは「違反したとき、又は第百四条第一項の認可を受けた同項に規定する約款によらないで第百三条第三号に掲げる業務を行つた」と読み替えるものとする。    第十章 地域福祉の推進     第一節 地域福祉計画 (市町村地域福祉計画) 第百七条  市町村は、地域福祉の推進に関する事項として次に掲げる事項を一体的に定める計画(以下「市町村地域福祉計画」という。)を策定し、又は変更しようとするときは、あらかじめ、住民、社会福祉を目的とする事業を経営する者その他社会福祉に関する活動を行う者の意見を反映させるために必要な措置を講ずるよう努めるとともに、その内容を公表するよう努めるものとする。 一  地域における福祉サービスの適切な利用の推進に関する事項 二  地域における社会福祉を目的とする事業の健全な発達に関する事項 三  地域福祉に関する活動への住民の参加の促進に関する事項 (都道府県地域福祉支援計画) 第百八条  都道府県は、市町村地域福祉計画の達成に資するために、各市町村を通ずる広域的な見地から、市町村の地域福祉の支援に関する事項として次に掲げる事項を一体的に定める計画(以下「都道府県地域福祉支援計画」という。)を策定し、又は変更しようとするときは、あらかじめ、公聴会の開催等住民その他の者の意見を反映させるために必要な措置を講ずるよう努めるとともに、その内容を公表するよう努めるものとする。 一  市町村の地域福祉の推進を支援するための基本的方針に関する事項 二  社会福祉を目的とする事業に従事する者の確保又は資質の向上に関する事項 三  福祉サービスの適切な利用の推進及び社会福祉を目的とする事業の健全な発達のための基盤整備に関する事項     第二節 社会福祉協議会 (市町村社会福祉協議会及び地区社会福祉協議会) 第百九条  市町村社会福祉協議会は、一又は同一都道府県内の二以上の市町村の区域内において次に掲げる事業を行うことにより地域福祉の推進を図ることを目的とする団体であつて、その区域内における社会福祉を目的とする事業を経営する者及び社会福祉に関する活動を行う者が参加し、かつ、指定都市にあつてはその区域内における地区社会福祉協議会の過半数及び社会福祉事業又は更生保護事業を経営する者の過半数が、指定都市以外の市及び町村にあつてはその区域内における社会福祉事業又は更生保護事業を経営する者の過半数が参加するものとする。 一  社会福祉を目的とする事業の企画及び実施 二  社会福祉に関する活動への住民の参加のための援助 三  社会福祉を目的とする事業に関する調査、普及、宣伝、連絡、調整及び助成 四  前三号に掲げる事業のほか、社会福祉を目的とする事業の健全な発達を図るために必要な事業 2  地区社会福祉協議会は、一又は二以上の区(地方自治法第二百五十二条の二十 に規定する区をいう。)の区域内において前項各号に掲げる事業を行うことにより地域福祉の推進を図ることを目的とする団体であつて、その区域内における社会福祉を目的とする事業を経営する者及び社会福祉に関する活動を行う者が参加し、かつ、その区域内において社会福祉事業又は更生保護事業を経営する者の過半数が参加するものとする。 3  市町村社会福祉協議会のうち、指定都市の区域を単位とするものは、第一項各号に掲げる事業のほか、その区域内における地区社会福祉協議会の相互の連絡及び事業の調整の事業を行うものとする。 4  市町村社会福祉協議会及び地区社会福祉協議会は、広域的に事業を実施することにより効果的な運営が見込まれる場合には、その区域を越えて第一項各号に掲げる事業を実施することができる。 5  関係行政庁の職員は、市町村社会福祉協議会及び地区社会福祉協議会の役員となることができる。ただし、役員の総数の五分の一を超えてはならない。 6  市町村社会福祉協議会及び地区社会福祉協議会は、社会福祉を目的とする事業を経営する者又は社会福祉に関する活動を行う者から参加の申出があつたときは、正当な理由がなければ、これを拒んではならない。 (都道府県社会福祉協議会) 第百十条  都道府県社会福祉協議会は、都道府県の区域内において次に掲げる事業を行うことにより地域福祉の推進を図ることを目的とする団体であつて、その区域内における市町村社会福祉協議会の過半数及び社会福祉事業又は更生保護事業を経営する者の過半数が参加するものとする。 一  前条第一項各号に掲げる事業であつて各市町村を通ずる広域的な見地から行うことが適切なもの 二  社会福祉を目的とする事業に従事する者の養成及び研修 三  社会福祉を目的とする事業の経営に関する指導及び助言 四  市町村社会福祉協議会の相互の連絡及び事業の調整 2  前条第五項及び第六項の規定は、都道府県社会福祉協議会について準用する。 (社会福祉協議会連合会) 第百十一条  都道府県社会福祉協議会は、相互の連絡及び事業の調整を行うため、全国を単位として、社会福祉協議会連合会を設立することができる。 2  第百九条第五項の規定は、社会福祉協議会連合会について準用する。     第三節 共同募金 (共同募金) 第百十二条  この法律において「共同募金」とは、都道府県の区域を単位として、毎年一回、厚生労働大臣の定める期間内に限つてあまねく行う寄附金の募集であつて、その区域内における地域福祉の推進を図るため、その寄附金をその区域内において社会福祉事業、更生保護事業その他の社会福祉を目的とする事業を経営する者(国及び地方公共団体を除く。以下この節において同じ。)に配分することを目的とするものをいう。 (共同募金会) 第百十三条  共同募金を行う事業は、第二条の規定にかかわらず、第一種社会福祉事業とする。 2  共同募金事業を行うことを目的として設立される社会福祉法人を共同募金会と称する。 3  共同募金会以外の者は、共同募金事業を行つてはならない。 4  共同募金会及びその連合会以外の者は、その名称中に、「共同募金会」又はこれと紛らわしい文字を用いてはならない。 (共同募金会の認可) 第百十四条  第三十条第一項の所轄庁は、共同募金会の設立の認可に当たつては、第三十二条に規定する事項のほか、次に掲げる事項をも審査しなければならない。 一  当該共同募金の区域内に都道府県社会福祉協議会が存すること。 二  特定人の意思によつて事業の経営が左右されるおそれがないものであること。 三  当該共同募金の配分を受ける者が役員、評議員又は配分委員会の委員に含まれないこと。 四  役員、評議員又は配分委員会の委員が、当該共同募金の区域内における民意を公正に代表するものであること。 (配分委員会) 第百十五条  寄附金の公正な配分に資するため、共同募金会に配分委員会を置く。 2  第三十六条第四項各号のいずれかに該当する者は、配分委員会の委員となることができない。 3  共同募金会の役員は、配分委員会の委員となることができる。ただし、委員の総数の三分の一を超えてはならない。 4  この節に規定するもののほか、配分委員会に関し必要な事項は、政令で定める。 (共同募金の性格) 第百十六条  共同募金は、寄附者の自発的な協力を基礎とするものでなければならない。 (共同募金の配分) 第百十七条  共同募金は、社会福祉を目的とする事業を経営する者以外の者に配分してはならない。 2  共同募金会は、寄附金の配分を行うに当たつては、配分委員会の承認を得なければならない。 3  共同募金会は、第百十二条に規定する期間が満了した日の属する会計年度の翌年度の末日までに、その寄附金を配分しなければならない。 4  国及び地方公共団体は、寄附金の配分について干渉してはならない。 (準備金) 第百十八条  共同募金会は、前条第三項の規定にかかわらず、災害救助法 (昭和二十二年法律第百十八号)第二条 に規定する災害の発生その他厚生労働省令で定める特別の事情がある場合に備えるため、共同募金の寄附金の額に厚生労働省令で定める割合を乗じて得た額を限度として、準備金を積み立てることができる。 2  共同募金会は、前項の災害の発生その他特別の事情があつた場合には、第百十二条の規定にかかわらず、当該共同募金会が行う共同募金の区域以外の区域において社会福祉を目的とする事業を経営する者に配分することを目的として、拠出の趣旨を定め、同項の準備金の全部又は一部を他の共同募金会に拠出することができる。 3  前項の規定による拠出を受けた共同募金会は、拠出された金額を、同項の拠出の趣旨に従い、当該共同募金会の区域において社会福祉を目的とする事業を経営する者に配分しなければならない。 4  共同募金会は、第一項に規定する準備金の積立て、第二項に規定する準備金の拠出及び前項の規定に基づく配分を行うに当たつては、配分委員会の承認を得なければならない。 (計画の公告) 第百十九条  共同募金会は、共同募金を行うには、あらかじめ、都道府県社会福祉協議会の意見を聴き、及び配分委員会の承認を得て、共同募金の目標額、受配者の範囲及び配分の方法を定め、これを公告しなければならない。 (結果の公告) 第百二十条  共同募金会は、寄附金の配分を終了したときは、一月以内に、募金の総額、配分を受けた者の氏名又は名称及び配分した額並びに第百十八条第一項の規定により新たに積み立てられた準備金の額及び準備金の総額を公告しなければならない。 2  共同募金会は、第百十八条第二項の規定により準備金を拠出した場合には、速やかに、同項の拠出の趣旨、拠出先の共同募金会及び拠出した額を公告しなければならない。 3  共同募金会は、第百十八条第三項の規定により配分を行つた場合には、配分を終了した後三月以内に、拠出を受けた総額及び拠出された金額の配分を受けた者の氏名又は名称を公告するとともに、当該拠出を行つた共同募金会に対し、拠出された金額の配分を受けた者の氏名又は名称を通知しなければならない。 (共同募金会に対する解散命令) 第百二十一条  第三十条第一項の所轄庁は、共同募金会については、第五十六条第四項の事由が生じた場合のほか、第百十四条各号に規定する基準に適合しないと認められるに至つた場合においても、解散を命ずることができる。ただし、他の方法により監督の目的を達することができない場合に限る。 (受配者の寄附金募集の禁止) 第百二十二条  共同募金の配分を受けた者は、その配分を受けた後一年間は、その事業の経営に必要な資金を得るために寄附金を募集してはならない。 第百二十三条  削除 (共同募金会連合会) 第百二十四条  共同募金会は、相互の連絡及び事業の調整を行うため、全国を単位として、共同募金会連合会を設立することができる。    第十一章 雑則 (芸能、出版物等の推薦等) 第百二十五条  社会保障審議会は、社会福祉の増進を図るため、芸能、出版物等を推薦し、又はそれらを製作し、興行し、若しくは販売する者等に対し、必要な勧告をすることができる。 (大都市等の特例) 第百二十六条  第七章及び第八章の規定により都道府県が処理することとされている事務のうち政令で定めるものは、指定都市及び中核市においては、政令の定めるところにより、指定都市又は中核市(以下「指定都市等」という。)が処理するものとする。この場合においては、これらの章中都道府県に関する規定は、指定都市等に関する規定として、指定都市等に適用があるものとする。 (事務の区分) 第百二十七条  別表の上欄に掲げる地方公共団体がそれぞれ同表の下欄に掲げる規定により処理することとされている事務は、地方自治法第二条第九項第一号 に規定する第一号 法定受託事務とする。 (権限の委任) 第百二十八条  この法律に規定する厚生労働大臣の権限は、厚生労働省令で定めるところにより、地方厚生局長に委任することができる。 2  前項の規定により地方厚生局長に委任された権限は、厚生労働省令で定めるところにより、地方厚生支局長に委任することができる。 (経過措置) 第百二十九条  この法律の規定に基づき政令を制定し、又は改廃する場合においては、その政令で、その制定又は改廃に伴い合理的に必要と判断される範囲内において、所要の経過措置(罰則に関する経過措置を含む。)を定めることができる。 (厚生労働省令への委任) 第百三十条  この法律に規定するもののほか、この法律の実施のため必要な手続その他の事項は、厚生労働省令で定める。    第十二章 罰則 第百三十一条  次の各号のいずれかに該当する者は、六月以下の懲役又は五十万円以下の罰金に処する。 一  第五十七条に規定する停止命令に違反して引き続きその事業を行つた者 二  第六十二条第二項又は第六十七条第二項の規定に違反して社会福祉事業を経営した者 三  第七十二条第一項から第三項まで(これらの規定を第七十三条の規定により読み替えて適用する場合を含む。)に規定する制限若しくは停止の命令に違反した者又は第七十二条第一項若しくは第二項の規定により許可を取り消されたにもかかわらず、引き続きその社会福祉事業を経営した者 第百三十二条  法人の代表者又は法人若しくは人の代理人、使用人その他の従業者が、その法人又は人の事業に関し、前条の違反行為をしたときは、行為者を罰するほか、その法人又はその人に対しても同条の罰金刑を科する。 第百三十三条  次の各号のいずれかに該当する場合においては、社会福祉法人の理事、監事又は清算人は、二十万円以下の過料に処する。 一  この法律に基づく政令の規定による登記をすることを怠つたとき。 二  第三十四条の二の規定による財産目録の備付けを怠り、又はこれに記載すべき事項を記載せず、若しくは虚偽の記載をしたとき。 三  第四十三条第三項の規定に違反して、届出をせず、又は虚偽の届出をしたとき。 四  第四十四条第四項の規定による同条第二項の書類及びこれに関する監事の意見を記載した書面の備付けを怠り、その書類に記載すべき事項を記載せず、又は虚偽の記載をしたとき。 五  第四十六条の二第二項又は第四十六条の十一第一項の規定による破産手続開始の申立てを怠つたとき。 六  第四十六条の九第一項又は第四十六条の十一第一項の規定による公告を怠り、又は不正の公告をしたとき。 七  第五十条又は第五十一条第二項の規定に違反したとき。 第百三十四条  第二十三条又は第百十三条第四項の規定に違反した者は、十万円以下の過料に処する。    附 則 抄 (施行期日) 1  この法律は、昭和二十六年六月一日から施行する。但し、第四章、第五章並びに附則第三項から第六項まで及び第十項の規定は、同年四月一日から、第三章及び附則第七項から第九項までの規定は、同年十月一日から施行する。 (関係法律の廃止) 2  社会事業法(昭和十三年法律第五十九号)は、廃止する。 3  社会福祉主事の設置に関する法律(昭和二十五年法律第百八十二号)は、廃止する。 (社会福祉主事に関する経過規定) 4  第四章の規定の施行の際、現に社会福祉主事の設置に関する法律による社会福祉主事に任用されている者は、この法律により任用された社会福祉主事とみなす。 5  第四章の規定の施行の際、現に社会福祉事業に従事している者で、左の各号の一に該当するものは、第十八条の規定にかかわらず、同条に規定する資格を有する者とみなす。 一  昭和二十一年一月一日以降において、二年以上、国若しくは地方公共団体の公務員又は厚生大臣の指定した団体若しくは施設の有給責任職員として社会福祉事業に関する事務に従事した経験を有する者 二  昭和二十年五月十五日以降において、三年以上、社会福祉、公衆衛生、学校教育、職業安定、婦人年少者保護又は更生保護に関する事務に従事した経験を有する者 6  社会福祉主事の設置に関する法律第二条第一項第一号又は第二号の規定によつてした厚生大臣の指定は、第十八条第一号又は第二号の規定によつてした指定とみなす。 (福祉に関する事務所に関する経過規定) 7  都道府県は、当分の間、第十四条第一項の規定にかかわらず、地方自治法第百五十五条第一項の規定による支庁又は地方事務所に、第十四条第五項に定める事務を行う組織を置くことができる。 8  第十五条から第十七条までの規定は、前項の組織に準用する。 (社会福祉法人への組織変更) 12  この法律の施行の際、現に民法第三十四条の規定により設立した法人で、社会福祉事業を経営しているもの(以下「公益法人」という。)は、昭和二十七年五月三十一日までに、その組織を変更して社会福祉法人となることができる。 (社会事業法の罰則の適用に関する経過規定) 15  この法律の施行前にした行為に対する罰則の適用については、なお従前の例による。 (国の無利子貸付け等) 16  国は、当分の間、都道府県又は指定都市等に対し、授産施設(生活保護法第七十五条第一項又は第二項の規定により国がその費用について負担し、又は補助するものを除く。)の整備で日本電信電話株式会社の株式の売払収入の活用による社会資本の整備の促進に関する特別措置法(昭和六十二年法律第八十六号。以下「社会資本整備特別措置法」という。)第二条第一項第二号に該当するものにつき、当該都道府県又は指定都市等が自ら行う場合にあつてはその要する費用に充てる資金の一部を、指定都市等以外の市町村又は社会福祉法人が行う場合にあつてはその者に対し当該都道府県又は指定都市等が補助する費用に充てる資金の一部を、予算の範囲内において、無利子で貸し付けることができる。 17  国は、当分の間、指定都市等に対し、隣保館等の施設の整備で社会資本整備特別措置法第二条第一項第二号に該当するものに要する費用に充てる資金の一部を、予算の範囲内において、無利子で貸し付けることができる。 18  国は、当分の間、都道府県に対し、隣保館等の施設の整備で社会資本整備特別措置法第二条第一項第二号に該当するものにつき、指定都市等以外の市町村に対し当該都道府県が補助する費用に充てる資金の一部を、予算の範囲内において、無利子で貸し付けることができる。 19  前三項の国の貸付金の償還期間は、五年(二年以内の据置期間を含む。)以内で政令で定める期間とする。 20  前項に定めるもののほか、附則第十六項から第十八項までの規定による貸付金の償還方法、償還期限の繰上げその他償還に関し必要な事項は、政令で定める。 21  国は、附則第十六項から第十八項までの規定により都道府県又は指定都市等に対し貸付けを行つた場合には、当該貸付けの対象である施設の整備について、当該貸付金に相当する金額の補助を行うものとし、当該補助については、当該貸付金の償還時において、当該貸付金の償還金に相当する金額を交付することにより行うものとする。 22  都道府県又は指定都市等が、附則第十六項から第十八項までの規定による貸付けを受けた無利子貸付金について、附則第十九項及び第二十項の規定に基づき定められる償還期限を繰り上げて償還を行つた場合(政令で定める場合を除く。)における前項の規定の適用については、当該償還は、当該償還期限の到来時に行われたものとみなす。    附 則 (昭和二六年五月三一日法律第一六九号) 抄 (施行期日) 1  この法律は、昭和二十六年十月一日から施行する。但し、第六条及び第二十六条の改正規定は、公布の日から、第二十七条、第二十八条、第三十八条から第四十一条まで、第四十六条及び第四十七条の改正規定並びに附則第五項及び附則第六項(社会福祉事業法第二条に関する部分を除く。)の規定は、同年六月一日から施行する。    附 則 (昭和二八年八月一五日法律第二一三号) 抄 1  この法律は、昭和二十八年九月一日から施行する。 2  この法律施行前従前の法令の規定によりなされた許可、認可その他の処分又は申請、届出その他の手続は、それぞれ改正後の相当規定に基いてなされた処分又は手続とみなす。    附 則 (昭和二八年八月一九日法律第二四〇号) 抄 1  この法律は、昭和二十九年四月一日から施行する。    附 則 (昭和二九年三月三一日法律第二八号) 抄 (施行期日) 1  この法律は、昭和二十九年四月一日から施行する。    附 則 (昭和三一年五月二四日法律第一一八号) 抄 (施行期日) 1  この法律は、昭和三十二年四月一日から施行する。    附 則 (昭和三一年六月一二日法律第一四八号) 抄 1  この法律は、地方自治法の一部を改正する法律(昭和三十一年法律第百四十七号)の施行の日から施行する。    附 則 (昭和三二年四月二五日法律第七八号) 抄 (施行期日) 1  この法律は、公布の日から施行する。    附 則 (昭和三三年四月一日法律第四四号) 抄 (施行期日) 1  この法律は、昭和三十三年四月一日から施行する。    附 則 (昭和三四年三月三一日法律第八五号) 抄 (施行期日) 1  この法律は、昭和三十四年四月一日から施行する。    附 則 (昭和三五年三月三一日法律第三七号) 抄 (施行期日) 1  この法律は、昭和三十五年四月一日から施行する。 (社会福祉事業法附則第七項に関する特例) 2  社会福祉事業法附則第七項の規定に基づき置かれた組織の長は、この法律の適用については、福祉事務所長とみなす。    附 則 (昭和三六年六月一九日法律第一五四号) 抄 (施行期日) 1  この法律は、公布の日から施行する。    附 則 (昭和三八年七月一一日法律第一三三号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して一箇月をこえない範囲内において政令で定める日から施行し、この法律による改正後の公職選挙法(昭和二十五年法律第百号)第四十九条の規定は、この法律の施行の日から起算して三箇月を経過した日後にその期日が公示され、又は告示される選挙から適用する。    附 則 (昭和三九年七月一日法律第一二九号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。    附 則 (昭和三九年七月一一日法律第一六九号) 抄 (施行期日) 1  この法律は、昭和四十年四月一日から施行する。 (経過規定) 5  前三項に定めるもののほか、この法律の施行のため必要な経過措置は、政令で定める。    附 則 (昭和四二年八月一日法律第一一一号) 抄 (施行期日) 1  この法律は、公布の日から施行する。    附 則 (昭和四二年八月一日法律第一一三号) 抄 (施行期日) 1  この法律は、公布の日から施行する。    附 則 (昭和四二年八月一九日法律第一三九号) 抄 (施行期日) 1  この法律は、昭和四十二年十月一日から施行する。 (社会福祉事業法の一部改正に伴う経過措置) 4  この法律の施行の際現に社会福祉事業法第五十七条第一項の規定による届出をし、又は同条第二項の規定による許可を受けて前項の規定による改正前の同法第二条第二項第四号に規定する事業を経営している者は、次の各号の区分に応じ、それぞれ当該各号に規定する事業に関し、同法第五十七条第一項の規定による届出をし、又は同条第二項の規定による許可を受けたものとみなす。 一  当該事業が精神薄弱者授産施設を経営する事業に相当する場合 精神薄弱者授産施設を経営する事業 二  その他の場合 精神薄弱者更生施設を経営する事業    附 則 (昭和四五年六月一日法律第一一一号) 抄 (施行期日) 1  この法律は、公布の日から施行する。    附 則 (昭和四七年七月一日法律第一一二号) 抄 (施行期日) 1  この法律は、公布の日から施行する。    附 則 (昭和五三年五月二三日法律第五五号) 抄 (施行期日等) 1  この法律は、公布の日から施行する。 2  次の各号に掲げる規定は、当該各号に掲げる審議会については、公布の日から起算して六月を経過する日までは適用しない。 一  略 二  改正後の社会福祉事業法第八条第一項の規定 地方社会福祉審議会    附 則 (昭和五六年六月一一日法律第七九号) 抄 (施行期日) 第一条  この法律は、昭和五十七年四月一日から施行する。    附 則 (昭和五八年五月一八日法律第四二号)  この法律は、昭和五十八年十月一日から施行する。    附 則 (昭和五八年一二月二日法律第七八号) 1  この法律(第一条を除く。)は、昭和五十九年七月一日から施行する。 2  この法律の施行の日の前日において法律の規定により置かれている機関等で、この法律の施行の日以後は国家行政組織法又はこの法律による改正後の関係法律の規定に基づく政令(以下「関係政令」という。)の規定により置かれることとなるものに関し必要となる経過措置その他この法律の施行に伴う関係政令の制定又は改廃に関し必要となる経過措置は、政令で定めることができる。    附 則 (昭和五九年八月七日法律第六三号) 抄 (施行期日) 第一条  この法律は、昭和五十九年十月一日から施行する。 (社会福祉事業法の一部改正に伴う経過措置) 第七条  この法律の施行の際現に前条の規定による改正前の社会福祉事業法第五十七条第一項の規定による届出をし、又は同条第二項の規定による許可を受けて前条の規定による改正前の同法第二条第二項第三号に規定する肢体不自由者更生施設、失明者更生施設、ろうあ者更生施設又は内部障害者更生施設を経営している者は、身体障害者更生施設を経営する事業に関し、前条の規定による改正後の同法(以下この条において「新事業法」という。)第五十七条第一項の規定による届出をし、又は同条第二項の規定による許可を受けたものとみなす。 2  この法律の施行の際現に身体障害者福祉ホームを経営している社会福祉法人は、この法律の施行の日から起算して三月以内に、当該施設の所在地の都道府県知事に新事業法第五十七条第一項第一号から第四号まで、第六号及び第七号に掲げる事項を届け出なければならない。 3  前項の規定による届出をしたときは、新事業法第五十七条第一項の規定による届出をしたものとみなす。 4  この法律の施行の際現に身体障害者福祉ホームを経営している者であつて、国、都道府県、市町村及び社会福祉法人以外のものについては、この法律の施行の日から起算して三月間は、新事業法第五十七条第二項の規定を適用しない。 5  前項に規定する者が、同項の期間内に当該施設の所在地の都道府県知事に第二項に規定する事項及び新事業法第五十七条第三項に掲げる事項を届け出たときは、同条第二項の規定による許可があつたものとみなす。 6  この法律の施行の際現に身体障害者福祉センターを経営している者であつて、国、都道府県及び市町村以外のものは、この法律の施行の日から起算して三月以内に、当該施設の所在地の都道府県知事に新事業法第六十二条第一項各号に掲げる事項を届け出なければならない。 7  前項の規定による届出をしたときは、新事業法第六十四条第一項の規定による届出をしたものとみなす。    附 則 (昭和六〇年七月一二日法律第九〇号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。ただし、次の各号に掲げる規定は、それぞれ当該各号に定める日から施行する。 一から四まで  略 五  第三条、第七条及び第十一条の規定、第二十四条の規定(民生委員法第十九条の改正規定を除く。附則第七条において同じ。)、第二十五条の規定(社会福祉事業法第十七条及び第二十一条の改正規定を除く。附則第七条において同じ。)、第二十八条の規定(児童福祉法第三十五条、第五十六条の二、第五十八条及び第五十八条の二の改正規定を除く。)並びに附則第七条、第十二条から第十四条まで及び第十七条の規定 公布の日から起算して六月を経過した日 (民生委員法及び社会福祉事業法の一部改正に伴う経過措置) 第七条  第二十四条の規定及び第二十五条の規定の施行前に民生委員審査会がした通告その他の行為又はこれらの規定の施行の際現に民生委員審査会に対して行つている意見の陳述その他の行為については、これらの規定の施行の日以後においては、地方社会福祉審議会がした通告その他の行為又は地方社会福祉審議会に対して行つた意見の陳述その他の行為とみなす。    附 則 (昭和六一年一二月二二日法律第一〇六号) 抄 (施行期日) 第一条  この法律は、昭和六十二年一月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  略 二  第四条の規定(前号に掲げる改正規定を除く。)、第五条の規定及び第七条の規定並びに附則第十六条、第二十四条から第二十九条まで、第三十一条及び第三十五条の規定 公布の日から起算して一年六月を超えない範囲内において政令で定める日    附 則 (昭和六一年一二月二六日法律第一〇九号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。ただし、次の各号に掲げる規定は、それぞれ当該各号に定める日から施行する。 一  略 二  第四条、第六条及び第九条から第十二条までの規定、第十五条中身体障害者福祉法第十九条第四項及び第十九条の二の改正規定、第十七条中児童福祉法第二十条第四項の改正規定、第三十四条の規定並びに附則第二条、第四条、第七条第一項及び第九条の規定並びに附則第十条中厚生省設置法(昭和二十四年法律第百五十一号)第六条第五十六号の改正規定 昭和六十二年四月一日 (社会福祉事業法の一部改正に伴う経過措置) 第四条  第十二条の規定の施行の際現に社会福祉法人の役員である者については、同条の規定による改正後の社会福祉事業法第三十四条第四項の規定にかかわらず、その者の当該役員としての残任期間に限り、なお従前の例による。 (その他の処分、申請等に係る経過措置) 第六条  この法律(附則第一条各号に掲げる規定については、当該各規定。以下この条及び附則第八条において同じ。)の施行前に改正前のそれぞれの法律の規定によりされた許可等の処分その他の行為(以下この条において「処分等の行為」という。)又はこの法律の施行の際現に改正前のそれぞれの法律の規定によりされている許可等の申請その他の行為(以下この条において「申請等の行為」という。)でこの法律の施行の日においてこれらの行為に係る行政事務を行うべき者が異なることとなるものは、附則第二条から前条までの規定又は改正後のそれぞれの法律(これに基づく命令を含む。)の経過措置に関する規定に定めるものを除き、この法律の施行の日以後における改正後のそれぞれの法律の適用については、改正後のそれぞれの法律の相当規定によりされた処分等の行為又は申請等の行為とみなす。 (罰則に関する経過措置) 第八条  この法律の施行前にした行為及び附則第二条第一項の規定により従前の例によることとされる場合における第四条の規定の施行後にした行為に対する罰則の適用については、なお従前の例による。    附 則 (昭和六二年九月二六日法律第九八号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して一年を超えない範囲内において政令で定める日から施行する。    附 則 (平成二年六月二九日法律第五八号) 抄 (施行期日) 第一条  この法律は、平成三年一月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  略 二  第一条中老人福祉法第二十一条、第二十四条及び第二十六条の改正規定、第二条中老人福祉法の目次の改正規定(「第三章 事業及び施設(第十四条―第二十条の七)」を「第三章 事業及び施設(第十四条―第二十条の七) 第三章の二 老人福祉計画(第二十条の八―第二十条の十一)」に改める部分を除く。)、「第五章 雑則」を「第四章の三 有料老人ホーム」に改める改正規定、同法第二十九条から第三十一条までの改正規定、同条の次に三条及び章名を加える改正規定、同法第三十八条及び第三十九条の改正規定、同条を第四十一条とする改正規定、同法第三十八条の次に二条を加える改正規定並びに同法本則に二条を加える改正規定、第三条中身体障害者福祉法第三十七条の改正規定及び同法第三十七条の二の改正規定(同条第四号を改める部分を除く。)、第五条中精神薄弱者福祉法第二十二条の改正規定(同条第一号の次に一号を加える部分に限る。)、同法第二十三条の改正規定(同条第二号の次に一号を加える部分に限る。)、同法第二十五条の改正規定(同条の見出しを改める部分及び同条に一項を加える部分に限る。)及び同法第二十六条の改正規定(同条の見出しを改める部分及び同条に一項を加える部分に限る。)、第七条中児童福祉法第五十条から第五十三条の二までの改正規定、同条を第五十三条の三とし、第五十三条の次に一条を加える改正規定、同法第五十五条の改正規定、同条の次に一条を加える改正規定及び同法第五十六条の改正規定並びに第九条中社会福祉事業法第二条の改正規定(「五十万円」を「五百万円」に改める部分に限る。)、同法第七十一条、第七十四条及び第七十五条の改正規定、同法第七十六条を削り、第七十七条を第七十六条とする改正規定、同法第七十八条の改正規定、同条を第七十七条とし、同条の次に一条を加える改正規定、同法第八十三条の改正規定並びに同法第八十五条の改正規定(「一万円」を「二十万円」に改める部分を除く。)並びに附則第五条及び第六条の規定並びに附則第二十五条中国有財産特別措置法(昭和二十七年法律第二百十九号)第三条の改正規定 平成三年四月一日 (社会福祉事業法の一部改正に伴う経過措置) 第十九条  この法律の施行の際現に精神薄弱者通勤寮等を経営している者が、この法律の施行前に社会福祉事業法第六十七条の規定による事業の制限命令又は停止命令を受けているときは、その者は、同法第八十四条の規定の適用については、この法律の施行後においても、当該事業の制限命令又は停止命令を受けている者とみなす。 2  この法律の施行の際現に第九条の規定による改正後の社会福祉事業法第二条第三項第二号の二に規定する父子家庭居宅介護等事業を行っている国及び都道府県以外の者について同法第六十四条第一項の規定を適用する場合においては、同項中「事業開始の日から一月」とあるのは、「老人福祉法等の一部を改正する法律(平成二年法律第五十八号)の施行の日から起算して三月」とする。 (罰則に関する経過措置) 第二十一条  この法律の施行前にした行為及びこの法律の附則において従前の例によることとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。 (その他の経過措置の政令への委任) 第二十二条  この附則に規定するもののほか、この法律の施行に伴い必要な経過措置は、政令で定める。    附 則 (平成四年六月二六日法律第八一号) 抄 (施行期日) 第一条  この法律は、平成四年七月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  第一条中社会福祉事業法の目次の改正規定(「第七章 社会福祉事業(第五十七条―第七十条)」を「第七章 社会福祉事業(第五十七条―第七十条) 第七章の二 社会福祉事業に従事する者の確保の促進 第一節 基本指針等(第七十条の二―第七十条の五) 第二節 福祉人材センター 第一款 都道府県福祉人材センター(第七十条の六―第七十条の十二)」に改める部分に限る。)及び同法第七章の次に一章を加える改正規定(同法第七章の二第一節及び第二節第一款に係る部分に限る。)並びに附則第四条中厚生省設置法(昭和二十四年法律第百五十一号)第六条第五十四号の改正規定 公布の日から起算して六月を超えない範囲内において政令で定める日 二  第一条中社会福祉事業法の目次の改正規定(前号に掲げる改正規定を除く。)及び同法第七章の次に一章を加える改正規定(同号に掲げる改正規定を除く。)並びに附則第五条の規定 平成五年四月一日 (その他の経過措置の政令への委任) 第六条  この附則に規定するもののほか、この法律の施行に伴い必要な経過措置は、政令で定める。    附 則 (平成五年六月一八日法律第七四号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して一年を超えない範囲内において政令で定める日から施行する。    附 則 (平成五年一一月一二日法律第八九号) 抄 (施行期日) 第一条  この法律は、行政手続法(平成五年法律第八十八号)の施行の日から施行する。 (諮問等がされた不利益処分に関する経過措置) 第二条  この法律の施行前に法令に基づき審議会その他の合議制の機関に対し行政手続法第十三条に規定する聴聞又は弁明の機会の付与の手続その他の意見陳述のための手続に相当する手続を執るべきことの諮問その他の求めがされた場合においては、当該諮問その他の求めに係る不利益処分の手続に関しては、この法律による改正後の関係法律の規定にかかわらず、なお従前の例による。 (罰則に関する経過措置) 第十三条  この法律の施行前にした行為に対する罰則の適用については、なお従前の例による。 (聴聞に関する規定の整理に伴う経過措置) 第十四条  この法律の施行前に法律の規定により行われた聴聞、聴問若しくは聴聞会(不利益処分に係るものを除く。)又はこれらのための手続は、この法律による改正後の関係法律の相当規定により行われたものとみなす。 (政令への委任) 第十五条  附則第二条から前条までに定めるもののほか、この法律の施行に関して必要な経過措置は、政令で定める。    附 則 (平成六年六月二九日法律第四九号) 抄 (施行期日) 1  この法律中、第一章の規定及び次項の規定は地方自治法の一部を改正する法律(平成六年法律第四十八号)中地方自治法(昭和二十二年法律第六十七号)第二編第十二章の改正規定の施行の日から、第二章の規定は地方自治法の一部を改正する法律中地方自治法第三編第三章の改正規定の施行の日から施行する。    附 則 (平成六年六月二九日法律第五六号) 抄 (施行期日) 第一条  この法律は、平成六年十月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 三  第四条中老人保健法第四十一条に一項を加える改正規定、同法第四十六条の八第四項の改正規定並びに同法第四十六条の十七の三の改正規定並びに第五条中老人福祉法の目次の改正規定(第二十条の七に係る部分に限る。)、同法第五条の三の改正規定、同法第五条の四第二項第二号の改正規定、同法第六条の二の改正規定、同法第十五条第二項の改正規定、同法第十六条第一項の改正規定、同法第十八条第一項の改正規定、同法第十八条の二第一項及び第三項の改正規定、同法第十九条第一項の改正規定、同法第二十条の二を同法第二十条の二の二とし、同法第二十条の次に一条を加える改正規定、同法第二十条の七の次に一条を加える改正規定並びに同法第三十一条の二第一項第二号の改正規定並びに附則第三十一条中社会福祉事業法第二条第三項第二号の三の改正規定 公布の日    附 則 (平成六年一一月一一日法律第九七号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。 (罰則に関する経過措置) 第二十条  この法律(附則第一条各号に掲げる規定については、当該各規定)の施行前にした行為並びに附則第二条、第四条、第七条第二項、第八条、第十一条、第十二条第二項、第十三条及び第十五条第四項の規定によりなお従前の例によることとされる場合における第一条、第四条、第八条、第九条、第十三条、第二十七条、第二十八条及び第三十条の規定の施行後にした行為に対する罰則の適用については、なお従前の例による。 (政令への委任) 第二十一条  附則第二条から前条までに定めるもののほか、この法律の施行に関して必要となる経過措置(罰則に関する経過措置を含む。)は、政令で定める。    附 則 (平成七年五月八日法律第八七号)  この法律は、更生保護事業法の施行の日から施行する。    附 則 (平成七年五月一九日法律第九四号) 抄 (施行期日) 第一条  この法律は、平成七年七月一日から施行する。    附 則 (平成八年六月二六日法律第一〇七号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  第七条の規定(社会福祉事業法第十六条の改正規定を除く。)、第九条中社会福祉・医療事業団法第二十八条の改正規定並びに附則第三条及び第七条の規定 平成九年四月一日 (社会福祉事業法の一部改正に伴う経過措置) 第三条  第七条の規定の施行前に同条の規定による改正前の社会福祉事業法第六章の規定に基づき都道府県知事がした認可等の処分その他の行為でその効力を有するもの又は同条の規定の施行の際現に都道府県知事に対してされている認可等の申請その他の行為で、同条の規定の施行の日以後において指定都市又は中核市の長(以下「指定都市等の長」という。)が管理し、及び執行することとなる事務に係るものは、同条の規定の施行の日以後においては、指定都市等の長のした認可等の処分その他の行為又は指定都市等の長に対してなされた認可等の申請その他の行為とみなす。 (罰則に関する経過措置) 第五条  この法律の施行前にした行為に対する罰則の適用については、なお従前の例による。 (政令への委任) 第十四条  この附則に規定するもののほか、この法律の施行に伴い必要な経過措置は、政令で定める。    附 則 (平成九年六月六日法律第七二号) (施行期日) 1  この法律は、商法等の一部を改正する法律(平成九年法律第七十一号)の施行の日から施行する。 (経過措置) 2  この法律の施行前に締結された合併契約に係る合併に関しては、この法律の施行後も、なお従前の例による。 (罰則の適用に関する経過措置) 3  この法律の施行前にした行為及び前項の規定により従前の例によることとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。    附 則 (平成九年六月一一日法律第七四号) 抄 (施行期日) 第一条  この法律は、平成十年四月一日から施行する。    附 則 (平成九年一二月一七日法律第一二四号) 抄  この法律は、介護保険法の施行の日から施行する。    附 則 (平成一〇年九月二八日法律第一一〇号)  この法律は、平成十一年四月一日から施行する。    附 則 (平成一一年六月四日法律第六五号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して一年を超えない範囲内において政令で定める日から、施行する。ただし、第二条から第四条までの規定並びに附則第四条及び第十一条の規定は、平成十四年四月一日から施行する。 (罰則に関する経過措置) 第五条  この法律の施行前にした行為に対する罰則の適用については、なお従前の例による。    附 則 (平成一一年七月一六日法律第八七号) 抄 (施行期日) 第一条  この法律は、平成十二年四月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  第一条中地方自治法第二百五十条の次に五条、節名並びに二款及び款名を加える改正規定(同法第二百五十条の九第一項に係る部分(両議院の同意を得ることに係る部分に限る。)に限る。)、第四十条中自然公園法附則第九項及び第十項の改正規定(同法附則第十項に係る部分に限る。)、第二百四十四条の規定(農業改良助長法第十四条の三の改正規定に係る部分を除く。)並びに第四百七十二条の規定(市町村の合併の特例に関する法律第六条、第八条及び第十七条の改正規定に係る部分を除く。)並びに附則第七条、第十条、第十二条、第五十九条ただし書、第六十条第四項及び第五項、第七十三条、第七十七条、第百五十七条第四項から第六項まで、第百六十条、第百六十三条、第百六十四条並びに第二百二条の規定 公布の日 (社会福祉事業法の一部改正に伴う経過措置) 第六十六条  この法律の施行の際現にされている第百七十五条の規定による改正前の社会福祉事業法第十三条第九項の規定による福祉に関する事務所の設置若しくは廃止の承認又はこれらの申請は、第百七十五条の規定による改正後の同法第十三条第八項の規定による福祉に関する事務所の設置若しくは廃止の同意又はこれらの協議の申出とみなす。 (従前の例による事務等に関する経過措置) 第六十九条  国民年金法等の一部を改正する法律(昭和六十年法律第三十四号)附則第三十二条第一項、第七十八条第一項並びに第八十七条第一項及び第十三項の規定によりなお従前の例によることとされた事項に係る都道府県知事の事務、権限又は職権(以下この条において「事務等」という。)については、この法律による改正後の国民年金法、厚生年金保険法及び船員保険法又はこれらの法律に基づく命令の規定により当該事務等に相当する事務又は権限を行うこととされた厚生大臣若しくは社会保険庁長官又はこれらの者から委任を受けた地方社会保険事務局長若しくはその地方社会保険事務局長から委任を受けた社会保険事務所長の事務又は権限とする。 (新地方自治法第百五十六条第四項の適用の特例) 第七十条  第百六十六条の規定による改正後の厚生省設置法第十四条の地方社会保険事務局及び社会保険事務所であって、この法律の施行の際旧地方自治法附則第八条の事務を処理するための都道府県の機関(社会保険関係事務を取り扱うものに限る。)の位置と同一の位置に設けられるもの(地方社会保険事務局にあっては、都道府県庁の置かれている市(特別区を含む。)に設けられるものに限る。)については、新地方自治法第百五十六条第四項の規定は、適用しない。 (社会保険関係地方事務官に関する経過措置) 第七十一条  この法律の施行の際現に旧地方自治法附則第八条に規定する職員(厚生大臣又はその委任を受けた者により任命された者に限る。附則第百五十八条において「社会保険関係地方事務官」という。)である者は、別に辞令が発せられない限り、相当の地方社会保険事務局又は社会保険事務所の職員となるものとする。 (地方社会保険医療協議会に関する経過措置) 第七十二条  第百六十九条の規定による改正前の社会保険医療協議会法の規定による地方社会保険医療協議会並びにその会長、委員及び専門委員は、相当の地方社会保険事務局の地方社会保険医療協議会並びにその会長、委員及び専門委員となり、同一性をもって存続するものとする。 (準備行為) 第七十三条  第二百条の規定による改正後の国民年金法第九十二条の三第一項第二号の規定による指定及び同条第二項の規定による公示は、第二百条の規定の施行前においても行うことができる。 (厚生大臣に対する再審査請求に係る経過措置) 第七十四条  施行日前にされた行政庁の処分に係る第百四十九条から第百五十一条まで、第百五十七条、第百五十八条、第百六十五条、第百六十八条、第百七十条、第百七十二条、第百七十三条、第百七十五条、第百七十六条、第百八十三条、第百八十八条、第百九十五条、第二百一条、第二百八条、第二百十四条、第二百十九条から第二百二十一条まで、第二百二十九条又は第二百三十八条の規定による改正前の児童福祉法第五十九条の四第二項、あん摩マツサージ指圧師、はり師、きゆう師等に関する法律第十二条の四、食品衛生法第二十九条の四、旅館業法第九条の三、公衆浴場法第七条の三、医療法第七十一条の三、身体障害者福祉法第四十三条の二第二項、精神保健及び精神障害者福祉に関する法律第五十一条の十二第二項、クリーニング業法第十四条の二第二項、狂犬病予防法第二十五条の二、社会福祉事業法第八十三条の二第二項、結核予防法第六十九条、と畜場法第二十条、歯科技工士法第二十七条の二、臨床検査技師、衛生検査技師等に関する法律第二十条の八の二、知的障害者福祉法第三十条第二項、老人福祉法第三十四条第二項、母子保健法第二十六条第二項、柔道整復師法第二十三条、建築物における衛生的環境の確保に関する法律第十四条第二項、廃棄物の処理及び清掃に関する法律第二十四条、食鳥処理の事業の規制及び食鳥検査に関する法律第四十一条第三項又は感染症の予防及び感染症の患者に対する医療に関する法律第六十五条の規定に基づく再審査請求については、なお従前の例による。 (厚生大臣又は都道府県知事その他の地方公共団体の機関がした事業の停止命令その他の処分に関する経過措置) 第七十五条  この法律による改正前の児童福祉法第四十六条第四項若しくは第五十九条第一項若しくは第三項、あん摩マツサージ指圧師、はり師、きゆう師等に関する法律第八条第一項(同法第十二条の二第二項において準用する場合を含む。)、食品衛生法第二十二条、医療法第五条第二項若しくは第二十五条第一項、毒物及び劇物取締法第十七条第一項(同法第二十二条第四項及び第五項で準用する場合を含む。)、厚生年金保険法第百条第一項、水道法第三十九条第一項、国民年金法第百六 条第一項、薬事法第六十九条第一項若しくは第七十二条又は柔道整復師法第十八条第一項の規定により厚生大臣又は都道府県知事その他の地方公共団体の機関がした事業の停止命令その他の処分は、それぞれ、この法律による改正後の児童福祉法第四十六条第四項若しくは第五十九条第一項若しくは第三項、あん摩マツサージ指圧師、はり師、きゆう師等に関する法律第八条第一項(同法第十二条の二第二項において準用する場合を含む。)、食品衛生法第二十二条若しくは第二十三条、医療法第五条第二項若しくは第二十五条第一項、毒物及び劇物取締法第十七条第一項若しくは第二項(同法第二十二条第四項及び第五項で準用する場合を含む。)、厚生年金保険法第百条第一項、水道法第三十九条第一項若しくは第二項、国民年金法第百六条第一項、薬事法第六十九条第一項若しくは第二項若しくは第七十二条第二項又は柔道整復師法第十八条第一項の規定により厚生大臣又は地方公共団体がした事業の停止命令その他の処分とみなす。 (国等の事務) 第百五十九条  この法律による改正前のそれぞれの法律に規定するもののほか、この法律の施行前において、地方公共団体の機関が法律又はこれに基づく政令により管理し又は執行する国、他の地方公共団体その他公共団体の事務(附則第百六十一条において「国等の事務」という。)は、この法律の施行後は、地方公共団体が法律又はこれに基づく政令により当該地方公共団体の事務として処理するものとする。 (処分、申請等に関する経過措置) 第百六十条  この法律(附則第一条各号に掲げる規定については、当該各規定。以下この条及び附則第百六十三条において同じ。)の施行前に改正前のそれぞれの法律の規定によりされた許可等の処分その他の行為(以下この条において「処分等の行為」という。)又はこの法律の施行の際現に改正前のそれぞれの法律の規定によりされている許可等の申請その他の行為(以下この条において「申請等の行為」という。)で、この法律の施行の日においてこれらの行為に係る行政事務を行うべき者が異なることとなるものは、附則第二条から前条までの規定又は改正後のそれぞれの法律(これに基づく命令を含む。)の経過措置に関する規定に定めるものを除き、この法律の施行の日以後における改正後のそれぞれの法律の適用については、改正後のそれぞれの法律の相当規定によりされた処分等の行為又は申請等の行為とみなす。 2  この法律の施行前に改正前のそれぞれの法律の規定により国又は地方公共団体の機関に対し報告、届出、提出その他の手続をしなければならない事項で、この法律の施行の日前にその手続がされていないものについては、この法律及びこれに基づく政令に別段の定めがあるもののほか、これを、改正後のそれぞれの法律の相当規定により国又は地方公共団体の相当の機関に対して報告、届出、提出その他の手続をしなければならない事項についてその手続がされていないものとみなして、この法律による改正後のそれぞれの法律の規定を適用する。 (不服申立てに関する経過措置) 第百六十一条  施行日前にされた国等の事務に係る処分であって、当該処分をした行政庁(以下この条において「処分庁」という。)に施行日前に行政不服審査法に規定する上級行政庁(以下この条において「上級行政庁」という。)があったものについての同法による不服申立てについては、施行日以後においても、当該処分庁に引き続き上級行政庁があるものとみなして、行政不服審査法の規定を適用する。この場合において、当該処分庁の上級行政庁とみなされる行政庁は、施行日前に当該処分庁の上級行政庁であった行政庁とする。 2  前項の場合において、上級行政庁とみなされる行政庁が地方公共団体の機関であるときは、当該機関が行政不服審査法の規定により処理することとされる事務は、新地方自治法第二条第九項第一号に規定する第一号法定受託事務とする。 (手数料に関する経過措置) 第百六十二条  施行日前においてこの法律による改正前のそれぞれの法律(これに基づく命令を含む。)の規定により納付すべきであった手数料については、この法律及びこれに基づく政令に別段の定めがあるもののほか、なお従前の例による。 (罰則に関する経過措置) 第百六十三条  この法律の施行前にした行為に対する罰則の適用については、なお従前の例による。 (その他の経過措置の政令への委任) 第百六十四条  この附則に規定するもののほか、この法律の施行に伴い必要な経過措置(罰則に関する経過措置を含む。)は、政令で定める。 2  附則第十八条、第五十一条及び第百八十四条の規定の適用に関して必要な事項は、政令で定める。 (検討) 第二百五十条  新地方自治法第二条第九項第一号に規定する第一号法定受託事務については、できる限り新たに設けることのないようにするとともに、新地方自治法別表第一に掲げるもの及び新地方自治法に基づく政令に示すものについては、地方分権を推進する観点から検討を加え、適宜、適切な見直しを行うものとする。 第二百五十一条  政府は、地方公共団体が事務及び事業を自主的かつ自立的に執行できるよう、国と地方公共団体との役割分担に応じた地方税財源の充実確保の方途について、経済情勢の推移等を勘案しつつ検討し、その結果に基づいて必要な措置を講ずるものとする。 第二百五十二条  政府は、医療保険制度、年金制度等の改革に伴い、社会保険の事務処理の体制、これに従事する職員の在り方等について、被保険者等の利便性の確保、事務処理の効率化等の視点に立って、検討し、必要があると認めるときは、その結果に基づいて所要の措置を講ずるものとする。    附 則 (平成一一年七月一六日法律第一〇二号) 抄 (施行期日) 第一条  この法律は、内閣法の一部を改正する法律(平成十一年法律第八十八号)の施行の日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 二  附則第十条第一項及び第五項、第十四条第三項、第二十三条、第二十八条並びに第三十条の規定 公布の日 (職員の身分引継ぎ) 第三条  この法律の施行の際現に従前の総理府、法務省、外務省、大蔵省、文部省、厚生省、農林水産省、通商産業省、運輸省、郵政省、労働省、建設省又は自治省(以下この条において「従前の府省」という。)の職員(国家行政組織法(昭和二十三年法律第百二十号)第八条の審議会等の会長又は委員長及び委員、中央防災会議の委員、日本工業標準調査会の会長及び委員並びに これらに類する者として政令で定めるものを除く。)である者は、別に辞令を発せられない限り、同一の勤務条件をもって、この法律の施行後の内閣府、総務省、法務省、外務省、財務省、文部科学省、厚生労働省、農林水産省、経済産業省、国土交通省若しくは環境省(以下この条において「新府省」という。)又はこれに置かれる部局若しくは機関のうち、この法律の施行の際現に当該職員が属する従前の府省又はこれに置かれる部局若しくは機関の相当の新府省又はこれに置かれる部局若しくは機関として政令で定めるものの相当の職員となるものとする。 (別に定める経過措置) 第三十条  第二条から前条までに規定するもののほか、この法律の施行に伴い必要となる経過措置は、別に法律で定める。    附 則 (平成一一年一二月八日法律第一五一号) 抄 (施行期日) 第一条  この法律は、平成十二年四月一日から施行する。 第四条  この法律の施行前にした行為に対する罰則の適用については、なお従前の例による。    附 則 (平成一一年一二月二二日法律第一六〇号) 抄 (施行期日) 第一条  この法律(第二条及び第三条を除く。)は、平成十三年一月六日から施行する。    附 則 (平成一二年六月七日法律第一一一号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。ただし、次の各号に掲げる規定は、それぞれ当該各号に定める日から施行する。 一  第二条中社会福祉法第二条第三項第五号の改正規定並びに第四条、第九条及び第十一条(社会福祉施設職員等退職手当共済法第二条第一項第四号の改正規定(「社会福祉事業法」を「社会福祉法」に改める部分及び「第五十七条第一項」を「第六十二条第一項」に改める部分に限る。)、同項第五号の改正規定(「社会福祉事業法第五十七条第一項」を「社会福祉法第六十二条第一項」に改める部分に限る。)及び同条第二項第四号の改正規定を除く。)の規定並びに附則第九条、第十条、第二十一条及び第二十三条から第二十五条までの規定並びに附則第三十九条中国有財産特別措置法(昭和二十七年法律第二百十九号)第二条第二項第二号ロを同号ハとし、同号イの次に次のように加える改正規定 平成十三年四月一日 二  第二条(社会福祉法第二条第三項第五号の改正規定を除く。)、第五条、第七条及び第十条の規定並びに第十三条中生活保護法第八十四条の三の改正規定(「収容されている」を「入所している」に改める部分を除く。)並びに附則第十一条から第十四条まで、第十七条から第十九条まで、第二十二条、第三十二条及び第三十五条の規定、附則第三十九条中国有財産特別措置法第二条第二項第一号の改正規定(「社会福祉事業法」を「社会福祉法」に改める部分を除く。)及び同項第五号を同項第七号とし、同項第四号を同項第六号とし、同項第三号を同項第五号とし、同項第二号の次に二号を加える改正規定、附則第四十条の規定、附則第四十一条中老人福祉法(昭和三十八年法律第百三十三号)第二十五条の改正規定(「社会福祉事業法第五十六条第二項」を「社会福祉法第五十八条第二項」に改める部分を除く。)並びに附則第五十二条(介護保険法施行法(平成九年法律第百二十四号)第五十六条の改正規定を除く。)の規定 平成十五年四月一日 (検討) 第二条  政府は、この法律の施行後十年を経過した場合において、この法律の規定の施行の状況について検討を加え、その結果に基づいて必要な措置を講ずるものとする。 (社会福祉事業法の一部改正に伴う経過措置) 第三条  この法律の施行の際現に第一条の規定による改正後の社会福祉法(以下「社会福祉法」という。)第二条第三項第十二号に規定する福祉サービス利用援助事業を行っている国及び都道府県以外の者について社会福祉法第六十九条第一項の規定を適用する場合においては、同項中「事業開始の日から一月」とあるのは、「社会福祉の増進のための社会福祉事業法等の一部を改正する等の法律(平成十二年法律第百十一号)の施行の日から起算して三月」とする。 2  第一条の規定による改正前の社会福祉事業法(以下「旧社会福祉事業法」という。)第二条第二項第六号に規定する公益質屋を経営する事業であって、この法律の施行前に公益質屋が締結した質契約に係るものについては、当該契約に関する業務が終了するまでの間、社会福祉法第二条第二項に規定する第一種社会福祉事業とみなす。 第四条  社会福祉法第四十四条第四項の規定は、平成十二年四月一日に始まる会計年度に係る同条第二項に規定する書類から適用する。 第五条  社会福祉法第七十二条第二項に規定する社会福祉事業の経営者(次項において「社会福祉事業の経営者」という。)であって、この法律の施行の際現に契約により福祉サービス(社会福祉事業において提供されるものに限る。以下この条において同じ。)を提供しているものは、この法律の施行後、遅滞なく、当該福祉サービスの利用者に対し、社会福祉法第七十七条に規定する書面を交付しなければならない。ただし、この法律の施行前に同条に規定する書面に相当する書面を交付している者については、この限りでない。 2  社会福祉事業の経営者が、前項本文の規定に違反したときは、当該社会福祉事業の経営者を社会福祉法第七十七条の規定に違反した者とみなして、社会福祉法の規定を適用する。 第六条  社会福祉法第百十五条第二項及び第三項並びに第百十六条から第百十八条までの規定は、この法律の施行の日(以下「施行日」という。)以後に寄附金の募集が行われる年の共同募金から適用し、施行日前に寄附金の募集が行われた年の共同募金については、なお従前の例による。 第二十四条  附則第一条第一号に掲げる規定の施行前に旧法の規定によってした退職手当共済契約の申込みその他の手続は、新法の規定によってしたものとみなす。 第二十五条  新法第八条から第九条の二まで並びに附則第二項及び第三項の規定は、附則第一条第一号に掲げる規定の施行の日以後に退職した者について適用し、同日前に退職した者については、なお従前の例による。 2  次の各号に掲げる場合において、当該各号に規定する者が附則第一条第一号に掲げる規定の施行の日の前日に現に退職した理由と同一の理由により退職したものとみなして、政令で定めるところにより、旧法第八条、第九条及び第十一条の規定の例により計算した場合の退職手当金の額が、新法第八条から第九条の二まで及び第十一条並びに附則第二項及び第三項の規定により計算した退職手当金の額よりも多いときは、これらの規定にかかわらず、その多い額をもってその者に支給すべき退職手当金の額とする。 一  附則第一条第一号に掲げる規定の施行の日の前日に旧法第二条第七項に規定する被共済職員であった者が、附則第一条第一号に掲げる規定の施行の日以後に退職した場合 二  附則第一条第一号に掲げる規定の施行の日前に旧法第二条第七項に規定する被共済職員でなくなった者で同日以後にさらに新法第二条第九項に規定する被共済職員となったものが、同日以後に退職し、かつ、新法第十一条第六項又は第七項の規定により同日前の被共済職員期間と同日以後の被共済職員期間とが合算される場合 (罰則に関する経過措置) 第二十八条  この法律の施行前にした行為及び附則第二十六条の規定によりなおその効力を有することとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。 (その他の経過措置の政令への委任) 第二十九条  附則第三条から前条までに規定するもののほか、この法律の施行に伴い必要な経過措置は、政令で定める。    附 則 (平成一二年一一月二七日法律第一二六号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して五月を超えない範囲内において政令で定める日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 (罰則に関する経過措置) 第二条  この法律の施行前にした行為に対する罰則の適用については、なお従前の例による。    附 則 (平成一四年二月八日法律第一号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。    附 則 (平成一四年五月二九日法律第五〇号) 抄 (施行期日) 第一条  この法律は、平成十四年十月一日から施行する。ただし、第二条の規定、第三条の規定(身体障害者福祉法第二十一条の三の改正規定中「における厚生労働省令で定める」を「において」に改める部分を除く。)及び次条の規定は、平成十五年四月一日から施行する。    附 則 (平成一四年一一月二九日法律第一一九号) 抄 (施行期日) 第一条  この法律は、平成十五年四月一日から施行する。 (政令への委任) 第五条  前三条に規定するもののほか、この法律の施行に伴い必要な経過措置は、政令で定める。 (検討) 第六条  政府は、この法律の施行の状況を勘案し、母子家庭等の児童の福祉の増進を図る観点から、母子家庭等の児童の親の当該児童についての扶養義務の履行を確保するための施策の在り方について検討を加え、必要があると認めるときは、その結果に基づいて必要な措置を講ずるものとする。    附 則 (平成一六年六月二日法律第七六号) 抄 (施行期日) 第一条  この法律は、破産法(平成十六年法律第七十五号。次条第八項並びに附則第三条第八項、第五条第八項、第十六項及び第二十一項、第八条第三項並びに第十三条において「新破産法」という。)の施行の日から施行する。 (政令への委任) 第十四条  附則第二条から前条までに規定するもののほか、この法律の施行に関し必要な経過措置は、政令で定める。    附 則 (平成一六年一二月一日法律第一四七号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して六月を超えない範囲内において政令で定める日から施行する。    附 則 (平成一六年一二月三日法律第一五四号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して六月を超えない範囲内において政令で定める日(以下「施行日」という。)から施行する。 (処分等の効力) 第百二十一条  この法律の施行前のそれぞれの法律(これに基づく命令を含む。以下この条において同じ。)の規定によってした処分、手続その他の行為であって、改正後のそれぞれの法律の規定に相当の規定があるものは、この附則に別段の定めがあるものを除き、改正後のそれぞれの法律の相当の規定によってしたものとみなす。 (罰則に関する経過措置) 第百二十二条  この法律の施行前にした行為並びにこの附則の規定によりなお従前の例によることとされる場合及びこの附則の規定によりなおその効力を有することとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。 (その他の経過措置の政令への委任) 第百二十三条  この附則に規定するもののほか、この法律の施行に伴い必要な経過措置は、政令で定める。 (検討) 第百二十四条  政府は、この法律の施行後三年以内に、この法律の施行の状況について検討を加え、必要があると認めるときは、その結果に基づいて所要の措置を講ずるものとする。    附 則 (平成一七年六月二九日法律第七七号) 抄 (施行期日) 第一条  この法律は、平成十八年四月一日から施行する。ただし、次の各号に掲げる規定は、それぞれ当該各号に定める日から施行する。 一  第一条、第五条、第八条、第十一条、第十三条及び第十五条並びに附則第四条、第十五条、第二十二条、第二十三条第二項、第三十二条、第三十九条及び第五十六条の規定 公布の日 (罰則に関する経過措置) 第五十五条  この法律の施行前にした行為及び附則第九条の規定によりなお従前の例によることとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。 (その他の経過措置の政令への委任) 第五十六条  附則第三条から第二十七条まで、第三十六条及び第三十七条に定めるもののほか、この法律の施行に関し必要な経過措置(罰則に関する経過措置を含む。)は、政令で定める。    附 則 (平成一七年七月二六日法律第八七号) 抄  この法律は、会社法の施行の日から施行する。    附 則 (平成一七年一一月七日法律第一二三号) 抄 (施行期日) 第一条  この法律は、平成十八年四月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  附則第二十四条、第四十四条、第百一条、第百三条、第百十六条から第百十八条まで及び第百二十二条の規定 公布の日 二  第五条第一項(居宅介護、行動援護、児童デイサービス、短期入所及び共同生活援助に係る部分を除く。)、第三項、第五項、第六項、第九項から第十五項まで、第十七項及び第十九項から第二十二項まで、第二章第一節(サービス利用計画作成費、特定障害者特別給付費、特例特定障害者特別給付費、療養介護医療費、基準該当療養介護医療費及び補装具費の支給に係る部分に限る。)、第二十八条第一項(第二号、第四号、第五号及び第八号から第十号までに係る部分に限る。)及び第二項(第一号から第三号までに係る部分に限る。)、第三十二条、第三十四条、第三十五条、第三十六条第四項(第三十七条第二項において準用する場合を含む。)、第三十八条から第四十条まで、第四十一条(指定障害者支援施設及び指定相談支援事業者の指定に係る部分に限る。)、第四十二条(指定障害者支援施設等の設置者及び指定相談支援事業者に係る部分に限る。)、第四十四条、第四十五条、第四十六条第一項(指定相談支援事業者に係る部分に限る。)及び第二項、第四十七条、第四十八条第三項及び第四項、第四十九条第二項及び第三項並びに同条第四項から第七項まで(指定障害者支援施設等の設置者及び指定相談支援事業者に係る部分に限る。)、第五十条第三項及び第四項、第五十一条(指定障害者支援施設及び指定相談支援事業者に係る部分に限る。)、第七十条から第七十二条まで、第七十三条、第七十四条第二項及び第七十五条(療養介護医療及び基準該当療養介護医療に係る部分に限る。)、第二章第四節、第三章、第四章(障害福祉サービス事業に係る部分を除く。)、第五章、第九十二条第一号(サービス利用計画作成費、特定障害者特別給付費及び特例特定障害者特別給付費の支給に係る部分に限る。)、第二号(療養介護医療費及び基準該当療養介護医療費の支給に係る部分に限る。)、第三号及び第四号、第九十三条第二号、第九十四条第一項第二号(第九十二条第三号に係る部分に限る。)及び第二項、第九十五条第一項第二号(第九十二条第二号に係る部分を除く。)及び第二項第二号、第九十六条、第百十条(サービス利用計画作成費、特定障害者特別給付費、特例特定障害者特別給付費、療養介護医療費、基準該当療養介護医療費及び補装具費の支給に係る部分に限る。)、第百十一条及び第百十二条(第四十八条第一項の規定を同条第三項及び第四項において準用する場合に係る部分に限る。)並びに第百十四条並びに第百十五条第一項及び第二項(サービス利用計画作成費、特定障害者特別給付費、特例特定障害者特別給付費、療養介護医療費、基準該当療養介護医療費及び補装具費の支給に係る部分に限る。)並びに附則第十八条から第二十三条まで、第二十六条、第三十条から第三十三条まで、第三十五条、第三十九条から第四十三条まで、第四十六条、第四十八条から第五十条まで、第五十二条、第五十六条から第六十条まで、第六十二条、第六十五条、第六十八条から第七十条まで、第七十二条から第七十七条まで、第七十九条、第八十一条、第八十三条、第八十五条から第九十条まで、第九十二条、第九十三条、第九十五条、第九十六条、第九十八条から第百条まで、第百五条、第百八条、第百十条、第百十二条、第百十三条及び第百十五条の規定 平成十八年十月一日 三  附則第六十三条、第六十六条、第九十七条及び第百十一条の規定 平成二十四年三月三十一日までの日で政令で定める日 (罰則の適用に関する経過措置) 第百二十一条  この法律の施行前にした行為及びこの附則の規定によりなお従前の例によることとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。 (その他の経過措置の政令への委任) 第百二十二条  この附則に規定するもののほか、この法律の施行に伴い必要な経過措置は、政令で定める。    附 則 (平成一八年六月二日法律第五〇号)  この法律は、一般社団・財団法人法の施行の日から施行する。    附 則 (平成一八年六月七日法律第五三号) 抄 (施行期日) 第一条  この法律は、平成十九年四月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  第百九十五条第二項、第百九十六条第一項及び第二項、第百九十九条の三第一項及び第四項、第二百五十二条の十七、第二百五十二条の二十二第一項並びに第二百五十二条の二十三の改正規定並びに附則第四条、第六条、第八条から第十条まで及び第五十条の規定 公布の日 二  第九十六条第一項の改正規定、第百条の次に一条を加える改正規定並びに第百一条、第百二条第四項及び第五項、第百九条、第百九条の二、第百十条、第百二十一条、第百二十三条、第百三十条第三項、第百三十八条、第百七十九条第一項、第二百七条、第二百二十五条、第二百三十一条の二、第二百三十四条第三項及び第五項、第二百三十七条第三項、第二百三十八条第一項、第二百三十八条の二第二項、第二百三十八条の四、第二百三十八条の五、第二百六十三条の三並びに第三百十四条第一項の改正規定並びに附則第二十二条及び第三十二条の規定、附則第三十七条中地方公営企業法(昭和二十七年法律第二百九十二号)第三十三条第三項の改正規定、附則第四十七条中旧市町村の合併の特例に関する法律(昭和四十年法律第六号)附則第二条第六項の規定によりなおその効力を有するものとされる同法第五条の二十九の改正規定並びに附則第五十一条中市町村の合併の特例等に関する法律(平成十六年法律第五十九号)第四十七条の改正規定 公布の日から起算して一年を超えない範囲内において政令で定める日    附 則 (平成一九年一二月五日法律第一二五号) 抄 (施行期日) 第一条  この法律は、平成二十四年四月一日から施行する。ただし、次の各号に掲げる規定は、それぞれ当該各号に定める日から施行する。 一  第一条及び第四条から第六条までの規定並びに附則第八条及び第九条第一項の規定 公布の日 二  次条の規定 公布の日から起算して一年を超えない範囲内において政令で定める日 三  第二条の規定及び附則第三条から第五条までの規定 平成二十一年四月一日 (政令への委任) 第八条  附則第三条から前条までに定めるもののほか、この法律の施行に関し必要な経過措置は、政令で定める。 (検討) 第九条  政府は、経済上の連携に関する日本国とフィリピン共和国との間の協定に関する日本国政府とフィリピン共和国政府の間の協議の状況を勘案し、この法律の公布後五年を目途として、准介護福祉士の制度について検討を加え、その結果に基づいて必要な措置を講ずるものとする。 2  政府は、この法律の施行後五年を目途として、新法の施行の状況等を勘案し、この法律による改正後の社会福祉士及び介護福祉士の資格制度について検討を加え、必要があると認めるときは、その結果に基づいて所要の措置を講ずるものとする。    附 則 (平成二〇年一二月三日法律第八五号) 抄 (施行期日) 第一条  この法律は、平成二十一年四月一日から施行する。    附 則 (平成二二年一二月一〇日法律第七一号) 抄 (施行期日) 第一条  この法律は、平成二十四年四月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  第一条の規定、第二条中障害者自立支援法目次の改正規定(「第三十一条」を「第三十一条の二」に改める部分に限る。第三号において同じ。)、同法第一条の改正規定、同法第二条第一項第一号の改正規定、同法第三条の改正規定、同法第四条第一項の改正規定、同法第二章第二節第三款中第三十一条の次に一条を加える改正規定、同法第四十二条第一項の改正規定、同法第七十七条第一項第一号の改正規定(「、その有する能力及び適性に応じ」を削る部分に限る。第三号において同じ。)並びに同法第七十七条第三項及び第七十八条第二項の改正規定、第四条中児童福祉法第二十四条の十一第一項の改正規定並びに第十条の規定並びに次条並びに附則第三十七条及び第三十九条の規定 公布の日 (施行前の準備) 第三十七条  この法律(附則第一条第三号に掲げる規定については、当該規定。以下この条において同じ。)を施行するために必要な条例の制定又は改正、新自立支援法第五十一条の十九の規定による新自立支援法第五十一条の十四第一項の指定の手続、新自立支援法第五十一条の二十第一項の規定による新自立支援法第五十一条の十七第一項第一号の指定の手続、新児童福祉法第二十一条の五の十五の規定による新児童福祉法第二十一条の五の三第一項の指定の手続、新児童福祉法第二十四条の二十八第一項の規定による新児童福祉法第二十四条の二十六第一項第一号の指定の手続、新児童福祉法第三十四条の三第二項の届出その他の行為は、この法律の施行前においても行うことができる。 (罰則の適用に関する経過措置) 第三十八条  この法律の施行前にした行為並びに附則第十三条及び第三十一条の規定によりなお従前の例によることとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。 (その他経過措置の政令への委任) 第三十九条  この附則に規定するもののほか、この法律の施行に伴い必要な経過措置(罰則に関する経過措置を含む。)は、政令で定める。    附 則 (平成二三年五月二日法律第三五号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して三月を超えない範囲内において政令で定める日から施行する。    附 則 (平成二三年五月二五日法律第五三号)  この法律は、新非訟事件手続法の施行の日から施行する。    附 則 (平成二三年六月二二日法律第七〇号) 抄 (施行期日) 第一条  この法律は、平成二十四年四月一日から施行する。ただし、次条の規定は公布の日から、附則第十七条の規定は地域の自主性及び自立性を高めるための改革の推進を図るための関係法律の整備に関する法律(平成二十三年法律第百五号)の公布の日又はこの法律の公布の日のいずれか遅い日から施行する。    附 則 (平成二三年六月二二日法律第七二号) 抄 (施行期日) 第一条  この法律は、平成二十四年四月一日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  第二条(老人福祉法目次の改正規定、同法第四章の二を削る改正規定、同法第四章の三を第四章の二とする改正規定及び同法第四十条第一号の改正規定(「第二十八条の十二第一項若しくは」を削る部分に限る。)に限る。)、第四条、第六条及び第七条の規定並びに附則第九条、第十一条、第十五条、第二十二条、第四十一条、第四十七条(東日本大震災に対処するための特別の財政援助及び助成に関する法律(平成二十三年法律第四十号)附則第一条ただし書の改正規定及び同条各号を削る改正規定並びに同法附則第十四条の改正規定に限る。)及び第五十条から第五十二条までの規定 公布の日 (検討) 第二条  政府は、この法律の施行後五年を目途として、この法律の規定による改正後の規定の施行の状況について検討を加え、必要があると認めるときは、その結果に基づいて所要の措置を講ずるものとする。 (罰則に関する経過措置) 第五十一条  この法律(附則第一条第一号に掲げる規定にあっては、当該規定)の施行前にした行為に対する罰則の適用については、なお従前の例による。 (政令への委任) 第五十二条  この附則に定めるもののほか、この法律の施行に関し必要な経過措置(罰則に関する経過措置を含む。)は、政令で定める。    附 則 (平成二三年六月二四日法律第七四号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して二十日を経過した日から施行する。    附 則 (平成二三年八月三〇日法律第一〇五号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 二  第二条、第十条(構造改革特別区域法第十八条の改正規定に限る。)、第十四条(地方自治法第二百五十二条の十九、第二百六十条並びに別表第一騒音規制法(昭和四十三年法律第九十八号)の項、都市計画法(昭和四十三年法律第百号)の項、都市再開発法(昭和四十四年法律第三十八号)の項、環境基本法(平成五年法律第九十一号)の項及び密集市街地における防災街区の整備の促進に関する法律(平成九年法律第四十九号)の項並びに別表第二都市再開発法(昭和四十四年法律第三十八号)の項、公有地の拡大の推進に関する法律(昭和四十七年法律第六十六号)の項、大都市地域における住宅及び住宅地の供給の促進に関する特別措置法(昭和五十年法律第六十七号)の項、密集市街地における防災街区の整備の促進に関する法律(平成九年法律第四十九号)の項及びマンションの建替えの円滑化等に関する法律(平成十四年法律第七十八号)の項の改正規定に限る。)、第十七条から第十九条まで、第二十二条(児童福祉法第二十一条の五の六、第二十一条の五の十五、第二十一条の五の二十三、第二十四条の九、第二十四条の十七、第二十四条の二十八及び第二十四条の三十六の改正規定に限る。)、第二十三条から第二十七条まで、第二十九条から第三十三条まで、第三十四条(社会福祉法第六十二条、第六十五条及び第七十一条の改正規定に限る。)、第三十五条、第三十七条、第三十八条(水道法第四十六条、第四十八条の二、第五十条及び第五十条の二の改正規定を除く。)、第三十九条、第四十三条(職業能力開発促進法第十九条、第二十三条、第二十八条及び第三十条の二の改正規定に限る。)、第五十一条(感染症の予防及び感染症の患者に対する医療に関する法律第六十四条の改正規定に限る。)、第五十四条(障害者自立支援法第八十八条及び第八十九条の改正規定を除く。)、第六十五条(農地法第三条第一項第九号、第四条、第五条及び第五十七条の改正規定を除く。)、第八十七条から第九十二条まで、第九十九条(道路法第二十四条の三及び第四十八条の三の改正規定に限る。)、第百一条(土地区画整理法第七十六条の改正規定に限る。)、第百二条(道路整備特別措置法第十八条から第二十一条まで、第二十七条、第四十九条及び第五十条の改正規定に限る。)、第百三条、第百五条(駐車場法第四条の改正規定を除く。)、第百七条、第百八条、第百十五条(首都圏近郊緑地保全法第十五条及び第十七条の改正規定に限る。)、第百十六条(流通業務市街地の整備に関する法律第三条の二の改正規定を除く。)、第百十八条(近畿圏の保全区域の整備に関する法律第十六条及び第十八条の改正規定に限る。)、第百二十条(都市計画法第六条の二、第七条の二、第八条、第十条の二から第十二条の二まで、第十二条の四、第十二条の五、第十二条の十、第十四条、第二十条、第二十三条、第三十三条及び第五十八条の二の改正規定を除く。)、第百二十一条(都市再開発法第七条の四から第七条の七まで、第六十条から第六十二条まで、第六十六条、第九十八条、第九十九条の八、第百三十九条の三、第百四十一条の二及び第百四十二条の改正規定に限る。)、第百二十五条(公有地の拡大の推進に関する法律第九条の改正規定を除く。)、第百二十八条(都市緑地法第二十条及び第三十九条の改正規定を除く。)、第百三十一条(大都市地域における住宅及び住宅地の供給の促進に関する特別措置法第七条、第二十六条、第六十四条、第六十七条、第百四条及び第百九条の二の改正規定に限る。)、第百四十二条(地方拠点都市地域の整備及び産業業務施設の再配置の促進に関する法律第十八条及び第二十一条から第二十三条までの改正規定に限る。)、第百四十五条、第百四十六条(被災市街地復興特別措置法第五条及び第七条第三項の改正規定を除く。)、第百四十九条(密集市街地における防災街区の整備の促進に関する法律第二十条、第二十一条、第百九十一条、第百九十二条、第百九十七条、第二百三十三条、第二百四十一条、第二百八十三条、第三百十一条及び第三百十八条の改正規定に限る。)、第百五十五条(都市再生特別措置法第五十一条第四項の改正規定に限る。)、第百五十六条(マンションの建替えの円滑化等に関する法律第百二条の改正規定を除く。)、第百五十七条、第百五十八条(景観法第五十七条の改正規定に限る。)、第百六十条(地域における多様な需要に応じた公的賃貸住宅等の整備等に関する特別措置法第六条第五項の改正規定(「第二項第二号イ」を「第二項第一号イ」に改める部分を除く。)並びに同法第十一条及び第十三条の改正規定に限る。)、第百六十二条(高齢者、障害者等の移動等の円滑化の促進に関する法律第十条、第十二条、第十三条、第三十六条第二項及び第五十六条の改正規定に限る。)、第百六十五条(地域における歴史的風致の維持及び向上に関する法律第二十四条及び第二十九条の改正規定に限る。)、第百六十九条、第百七十一条(廃棄物の処理及び清掃に関する法律第二十一条の改正規定に限る。)、第百七十四条、第百七十八条、第百八十二条(環境基本法第十六条及び第四十条の二の改正規定に限る。)及び第百八十七条(鳥獣の保護及び狩猟の適正化に関する法律第十五条の改正規定、同法第二十八条第九項の改正規定(「第四条第三項」を「第四条第四項」に改める部分を除く。)、同法第二十九条第四項の改正規定(「第四条第三項」を「第四条第四項」に改める部分を除く。)並びに同法第三十四条及び第三十五条の改正規定に限る。)の規定並びに附則第十三条、第十五条から第二十四条まで、第二十五条第一項、第二十六条、第二十七条第一項から第三項まで、第三十条から第三十二条まで、第三十八条、第四十四条、第四十六条第一項及び第四項、第四十七条から第四十九条まで、第五十一条から第五十三条まで、第五十五条、第五十八条、第五十九条、第六十一条から第六十九条まで、第七十一条、第七十二条第一項から第三項まで、第七十四条から第七十六条まで、第七十八条、第八十条第一項及び第三項、第八十三条、第八十七条(地方税法第五百八十七条の二及び附則第十一条の改正規定を除く。)、第八十九条、第九十条、第九十二条(高速自動車国道法第二十五条の改正規定に限る。)、第百一条、第百二条、第百五条から第百七条まで、第百十二条、第百十七条(地域における多様な主体の連携による生物の多様性の保全のための活動の促進等に関する法律(平成二十二年法律第七十二号)第四条第八項の改正規定に限る。)、第百十九条、第百二十一条の二並びに第百二十三条第二項の規定 平成二十四年四月一日 三  第十四条(地方自治法別表第一社会福祉法(昭和二十六年法律第四十五号)の項及び薬事法(昭和三十五年法律第百四十五号)の項の改正規定に限る。)、第二十二条(児童福祉法第二十一条の十の二の改正規定に限る。)、第三十四条(社会福祉法第三十条及び第五十六条並びに別表の改正規定に限る。)、第三十八条(水道法第四十六条、第四十八条の二、第五十条及び第五十条の二の改正規定に限る。)、第四十条及び第四十二条の規定並びに附則第二十五条第二項及び第三項、第二十七条第四項及び第五項、第二十八条、第二十九条並びに第八十八条の規定 平成二十五年四月一日 (社会福祉法の一部改正に伴う経過措置) 第二十五条  第三十四条の規定(社会福祉法第六十五条の改正規定に限る。以下この項において同じ。)の施行の日から起算して一年を超えない期間内において、第三十四条の規定による改正後の社会福祉法(附則第百二十三条第二項において「新社会福祉法」という。)第六十五条第一項に規定する都道府県の条例が制定施行されるまでの間は、同条第二項に規定する厚生労働省令で定める基準は、当該都道府県の条例で定める基準とみなす。 2  第三十四条の規定(社会福祉法第三十条の改正規定に限る。以下この条において同じ。)の施行前に第三十四条の規定による改正前の社会福祉法(以下この条において「旧社会福祉法」という。)の規定によりされた認可等の処分その他の行為(以下この項において「処分等の行為」という。)又は第三十四条の規定の施行の際現に旧社会福祉法の規定によりされている認可等の申請その他の行為(以下この項において「申請等の行為」という。)で、第三十四条の規定の施行の日においてこれらの行為に係る行政事務を行うべき者が異なることとなるものは、同日以後における第三十四条の規定による改正後の社会福祉法(以下この条において「新社会福祉法」という。)の適用については、新社会福祉法の相当規定によりされた処分等の行為又は申請等の行為とみなす。 3  第三十四条の規定の施行前に旧社会福祉法の規定により所轄庁に対し届出等その他の手続をしなければならない事項で、第三十四条の規定の施行の日前にその手続がされていないものについては、これを、新社会福祉法の相当規定により所轄庁に対して届出等その他の手続をしなければならない事項についてその手続がされていないものとみなして、新社会福祉法の規定を適用する。 (罰則に関する経過措置) 第八十一条  この法律(附則第一条各号に掲げる規定にあっては、当該規定。以下この条において同じ。)の施行前にした行為及びこの附則の規定によりなお従前の例によることとされる場合におけるこの法律の施行後にした行為に対する罰則の適用については、なお従前の例による。 (政令への委任) 第八十二条  この附則に規定するもののほか、この法律の施行に関し必要な経過措置(罰則に関する経過措置を含む。)は、政令で定める。    附 則 (平成二三年一二月一四日法律第一二二号) 抄 (施行期日) 第一条  この法律は、公布の日から起算して二月を超えない範囲内において政令で定める日から施行する。ただし、次の各号に掲げる規定は、当該各号に定める日から施行する。 一  附則第六条、第八条、第九条及び第十三条の規定 公布の日    附 則 (平成二四年六月二七日法律第五一号) 抄 (施行期日) 第一条  この法律は、平成二十五年四月一日から施行する。    附 則 (平成二四年八月二二日法律第六七号) 抄  この法律は、子ども・子育て支援法の施行の日から施行する。    附 則 (平成二五年六月一四日法律第四四号) 抄 (施行期日) 第一条  この法律は、公布の日から施行する。 (罰則に関する経過措置) 第十条  この法律(附則第一条各号に掲げる規定にあっては、当該規定)の施行前にした行為に対する罰則の適用については、なお従前の例による。 (政令への委任) 第十一条  この附則に規定するもののほか、この法律の施行に関し必要な経過措置(罰則に関する経過措置を含む。)は、政令で定める。 別表 (第百二十七条関係) 都道府県 第三十一条第一項及び第四項(第四十三条第二項、第四十六条第四項及び第四十九条第三項において準用する場合を含む。)、第三十九条の三、第四十三条第一項、第三項及び第四項(第五十九条第二項において準用する場合を含む。)、第四十六条第一項第六号、第二項及び第三項、第四十六条の七、第四十七条の三、第四十九条第二項、第五十六条第一項から第四項まで及び第五項(第五十八条第四項において準用する場合を含む。)、第五十七条、第五十八条第二項、第五十九条第一項、第百十四条並びに第百二十一条 市 第三十一条第一項、第三十九条の三、第四十三条第一項及び第三項、第四十六条第一項第六号、第二項及び第三項、第四十六条の七、第四十七条の三、第四十九条第二項、第五十六条第一項から第四項まで及び第五項(第五十八条第四項において準用する場合を含む。)、第五十七条、第五十八条第二項、第五十九条第一項、第百十四条並びに第百二十一条 町村 第五十八条第二項及び同条第四項において準用する第五十六条第五項
{ "pile_set_name": "Github" }
var arrayMap = require('./_arrayMap'), baseAt = require('./_baseAt'), basePullAt = require('./_basePullAt'), compareAscending = require('./_compareAscending'), flatRest = require('./_flatRest'), isIndex = require('./_isIndex'); /** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * * **Note:** Unlike `_.at`, this method mutates `array`. * * @static * @memberOf _ * @since 3.0.0 * @category Array * @param {Array} array The array to modify. * @param {...(number|number[])} [indexes] The indexes of elements to remove. * @returns {Array} Returns the new array of removed elements. * @example * * var array = ['a', 'b', 'c', 'd']; * var pulled = _.pullAt(array, [1, 3]); * * console.log(array); * // => ['a', 'c'] * * console.log(pulled); * // => ['b', 'd'] */ var pullAt = flatRest(function(array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes); basePullAt(array, arrayMap(indexes, function(index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); return result; }); module.exports = pullAt;
{ "pile_set_name": "Github" }
var path = require("path"); var slug = require("mollusc"); var crypto = require("crypto"); var debug = require("debug")("utils"); var utils = {}; utils.value_in_value = function (v1, v2) { if (v1 === null || v1 === undefined) { return true; } if (v2 === null || v2 === undefined) { return false; } switch (typeof v1) { case 'string': case 'number': return v1 == v2; break; case 'object': var keys = Object.keys(v1); for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!utils.value_in_value(v1[key], v2[key])) { return false; } } return true; break; case 'boolean': return v1 === v2; break; default: console.log('compare todo type', typeof v1, typeof v2); return false; break; } return false; }; utils.field_in_field = function (f1, f2) { if ((f1.key !== f2.key) || (f1.format !== f2.format)) { //console.log('basics not equal', f1, f2); return false; } if (typeof f1.value !== typeof f2.value) { //console.log('data types not equal', f1, f2); return false; } return utils.value_in_value(f1.value, f2.value); }; utils.validateDataField = function (field) { if (!field.hasOwnProperty('auto')) field.auto = true; if (!field.hasOwnProperty('created')) field.created = (new Date()); if (!field.hasOwnProperty('updated')) field.updated = (new Date()); if (!field.hasOwnProperty('id')) field.id = crypto.pseudoRandomBytes(32).toString('hex'); }; utils.validateEntity = function (entity) { if (!entity.hasOwnProperty('created')) entity.created = (new Date()); if (!entity.hasOwnProperty('updated')) entity.updated = (new Date()); if (!entity.hasOwnProperty('data')) entity.data = []; entity.data.forEach(utils.validateDataField); }; utils.validateRelation = function (rel) { if (!rel.hasOwnProperty('created')) rel.created = (new Date()); if (!rel.hasOwnProperty('updated')) rel.updated = (new Date()); if (!rel.hasOwnProperty('data')) rel.data = []; rel.data.forEach(utils.validateDataField); }; module.exports = utils;
{ "pile_set_name": "Github" }
/* * jerror.h * * Copyright (C) 1994-1997, Thomas G. Lane. * Modified 1997-2009 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * * This file defines the error and message codes for the JPEG library. * Edit this file to add new codes, or to translate the message strings to * some other language. * A set of error-reporting macros are defined too. Some applications using * the JPEG library may wish to include this file to get the error codes * and/or the macros. */ /* * To define the enum list of message codes, include this file without * defining macro JMESSAGE. To create a message string table, include it * again with a suitable JMESSAGE definition (see jerror.c for an example). */ #ifndef JMESSAGE #ifndef JERROR_H /* First time through, define the enum list */ #define JMAKE_ENUM_LIST #else /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ #define JMESSAGE(code,string) #endif /* JERROR_H */ #endif /* JMESSAGE */ #ifdef JMAKE_ENUM_LIST typedef enum { #define JMESSAGE(code,string) code , #endif /* JMAKE_ENUM_LIST */ JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ /* For maintenance convenience, list is alphabetical by message code name */ JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") JMESSAGE(JERR_BAD_DCTSIZE, "DCT scaled block size %dx%d not supported") JMESSAGE(JERR_BAD_DROP_SAMPLING, "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") JMESSAGE(JERR_BAD_LIB_VERSION, "Wrong JPEG library version: library is %d, caller expects %d") JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") JMESSAGE(JERR_BAD_PROGRESSION, "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") JMESSAGE(JERR_BAD_PROG_SCRIPT, "Invalid progressive parameters at scan script entry %d") JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") JMESSAGE(JERR_BAD_STRUCT_SIZE, "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") JMESSAGE(JERR_EMS_READ, "Read from EMS failed") JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") JMESSAGE(JERR_FILE_READ, "Input file read error") JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, "Cannot transcode due to multiple use of quantization table %d") JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") JMESSAGE(JERR_NOTIMPL, "Not implemented yet") JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") JMESSAGE(JERR_QUANT_COMPONENTS, "Cannot quantize more than %d color components") JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") JMESSAGE(JERR_TFILE_WRITE, "Write failed on temporary file --- out of disk space?") JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") JMESSAGE(JERR_XMS_READ, "Read from XMS failed") JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) JMESSAGE(JMSG_VERSION, JVERSION) JMESSAGE(JTRC_16BIT_TABLES, "Caution: quantization tables are too coarse for baseline JPEG") JMESSAGE(JTRC_ADOBE, "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") JMESSAGE(JTRC_DRI, "Define Restart Interval %u") JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") JMESSAGE(JTRC_EOI, "End Of Image") JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, "Warning: thumbnail image size does not match data length %u") JMESSAGE(JTRC_JFIF_EXTENSION, "JFIF extension marker: type 0x%02x, length %u") JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") JMESSAGE(JTRC_RST, "RST%d") JMESSAGE(JTRC_SMOOTH_NOTIMPL, "Smoothing not supported with nonstandard sampling ratios") JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") JMESSAGE(JTRC_SOI, "Start of Image") JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") JMESSAGE(JTRC_THUMB_JPEG, "JFIF extension marker: JPEG-compressed thumbnail image, length %u") JMESSAGE(JTRC_THUMB_PALETTE, "JFIF extension marker: palette thumbnail image, length %u") JMESSAGE(JTRC_THUMB_RGB, "JFIF extension marker: RGB thumbnail image, length %u") JMESSAGE(JTRC_UNKNOWN_IDS, "Unrecognized component IDs %d %d %d, assuming YCbCr") JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") JMESSAGE(JWRN_BOGUS_PROGRESSION, "Inconsistent progression sequence for component %d coefficient %d") JMESSAGE(JWRN_EXTRANEOUS_DATA, "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") JMESSAGE(JWRN_MUST_RESYNC, "Corrupt JPEG data: found marker 0x%02x instead of RST%d") JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") #ifdef JMAKE_ENUM_LIST JMSG_LASTMSGCODE } J_MESSAGE_CODE; #undef JMAKE_ENUM_LIST #endif /* JMAKE_ENUM_LIST */ /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ #undef JMESSAGE #ifndef JERROR_H #define JERROR_H /* Macros to simplify using the error and trace message stuff */ /* The first parameter is either type of cinfo pointer */ /* Fatal errors (print message and exit) */ #define ERREXIT(cinfo,code) \ ((cinfo)->err->msg_code = (code), \ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) #define ERREXIT1(cinfo,code,p1) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) #define ERREXIT2(cinfo,code,p1,p2) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[1] = (p2), \ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) #define ERREXIT3(cinfo,code,p1,p2,p3) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[2] = (p3), \ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) #define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[2] = (p3), \ (cinfo)->err->msg_parm.i[3] = (p4), \ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) #define ERREXIT6(cinfo,code,p1,p2,p3,p4,p5,p6) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[1] = (p2), \ (cinfo)->err->msg_parm.i[2] = (p3), \ (cinfo)->err->msg_parm.i[3] = (p4), \ (cinfo)->err->msg_parm.i[4] = (p5), \ (cinfo)->err->msg_parm.i[5] = (p6), \ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) #define ERREXITS(cinfo,code,str) \ ((cinfo)->err->msg_code = (code), \ strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) #define MAKESTMT(stuff) do { stuff } while (0) /* Nonfatal errors (we can keep going, but the data is probably corrupt) */ #define WARNMS(cinfo,code) \ ((cinfo)->err->msg_code = (code), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) #define WARNMS1(cinfo,code,p1) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) #define WARNMS2(cinfo,code,p1,p2) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[1] = (p2), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) /* Informational/debugging messages */ #define TRACEMS(cinfo,lvl,code) \ ((cinfo)->err->msg_code = (code), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) #define TRACEMS1(cinfo,lvl,code,p1) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) #define TRACEMS2(cinfo,lvl,code,p1,p2) \ ((cinfo)->err->msg_code = (code), \ (cinfo)->err->msg_parm.i[0] = (p1), \ (cinfo)->err->msg_parm.i[1] = (p2), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) #define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ (cinfo)->err->msg_code = (code); \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) #define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ (cinfo)->err->msg_code = (code); \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) #define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ _mp[4] = (p5); \ (cinfo)->err->msg_code = (code); \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) #define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ (cinfo)->err->msg_code = (code); \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) #define TRACEMSS(cinfo,lvl,code,str) \ ((cinfo)->err->msg_code = (code), \ strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) #endif /* JERROR_H */
{ "pile_set_name": "Github" }
using System; using AutoFixture.Idioms; using Xunit; namespace AutoFixture.IdiomsUnitTest { public class EmptyStringBehaviorExpectationTest { [Fact] public void SutIsBehaviorExpectation() { // Arrange var expectation = new EmptyStringBehaviorExpectation(); // Act & Assert Assert.IsAssignableFrom<IBehaviorExpectation>(expectation); } [Fact] public void VerifyNullCommandThrows() { // Arrange var expectation = new EmptyStringBehaviorExpectation(); // Act & Assert Assert.Throws<ArgumentNullException>(() => expectation.Verify(default)); } [Fact] public void VerifyExecutesCommandWhenRequestedTypeIsString() { // Arrange var commandExecuted = false; var command = new DelegatingGuardClauseCommand { OnExecute = (v) => { commandExecuted = true; throw new ArgumentException(string.Empty, "paramName"); }, RequestedType = typeof(string), RequestedParameterName = "paramName" }; var expectation = new EmptyStringBehaviorExpectation(); // Act expectation.Verify(command); // Assert Assert.True(commandExecuted); } [Theory] [InlineData(typeof(int))] [InlineData(typeof(Guid))] [InlineData(typeof(object))] [InlineData(typeof(Version))] [InlineData(typeof(decimal))] public void VerifyDoesNotExecuteCommandWhenRequestedTypeNotString(Type type) { // Arrange var commandExecuted = false; var command = new DelegatingGuardClauseCommand { OnExecute = (v) => commandExecuted = true, RequestedType = type }; var expectation = new EmptyStringBehaviorExpectation(); // Act expectation.Verify(command); // Assert Assert.False(commandExecuted); } [Fact] public void VerifyDoesNotThrowWhenCommandThrowsArgumentExceptionWithMatchingParameterName() { // Arrange var command = new DelegatingGuardClauseCommand { OnExecute = v => throw new ArgumentException(string.Empty, "paramName"), RequestedType = typeof(string), RequestedParameterName = "paramName" }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Null(actual); } [Fact] public void VerifyThrowsExpectedExceptionWhenCommandDoesNotThrow() { // Arrange var expected = new Exception(); var command = new DelegatingGuardClauseCommand { OnExecute = v => { }, OnCreateException = v => expected, RequestedType = typeof(string) }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Equal(expected, actual); } [Fact] public void VerifyThrowsExceptionWithExpectedValueWhenCommandDoesNotThrow() { // Arrange var command = new DelegatingGuardClauseCommand { OnExecute = v => { }, OnCreateException = v => new Exception(v), RequestedType = typeof(string) }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Equal("<empty string>", actual.Message); } [Fact] public void VerifyThrowsExpectedExceptionWhenCommandThrowsNonArgumentException() { // Arrange var expected = new Exception(); var command = new DelegatingGuardClauseCommand { OnExecute = v => throw new Exception(), OnCreateExceptionWithInner = (v, e) => expected, RequestedType = typeof(string) }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Equal(expected, actual); } [Fact] public void VerifyThrowsWithExpectedValueWhenCommandThrowsNonArgumentException() { // Arrange var command = new DelegatingGuardClauseCommand { OnExecute = v => throw new Exception(), OnCreateExceptionWithInner = (v, e) => new Exception(v, e), RequestedType = typeof(string) }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Equal("<empty string>", actual.Message); } [Fact] public void VerifyThrowsWithExpectedInnerExceptionWhenCommandThrowsNonArgumentException() { // Arrange var expected = new Exception(); var command = new DelegatingGuardClauseCommand { OnExecute = v => throw expected, OnCreateExceptionWithInner = (v, e) => new Exception(v, e), RequestedType = typeof(string) }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Equal(expected, actual.InnerException); } [Fact] public void VerifyThrowsExpectedExceptionWhenCommandThrowsArgumentExceptionWithWrongParameterName() { // Arrange var expected = new Exception(); var command = new DelegatingGuardClauseCommand { OnExecute = v => throw new ArgumentException(string.Empty, "wrongParamName"), OnCreateExceptionWithFailureReason = (v, m, e) => expected, RequestedType = typeof(string), RequestedParameterName = "expectedParamName" }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Equal(expected, actual); } [Fact] public void VerifyThrowsExceptionWithExpectedMessageWhenCommandThrowsArgumentExceptionWithWrongParameterName() { // Arrange var command = new DelegatingGuardClauseCommand { OnExecute = v => throw new ArgumentException(string.Empty, "wrongParamName"), OnCreateExceptionWithFailureReason = (v, m, e) => new Exception(m, e), RequestedType = typeof(string), RequestedParameterName = "expectedParamName" }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.EndsWith( $"Expected parameter name: expectedParamName{Environment.NewLine}Actual parameter name: wrongParamName", actual.Message); } [Fact] public void VerifyThrowsExceptionWithExpectedInnerWhenCommandThrowsArgumentExceptionWithWrongParameterName() { // Arrange var expected = new ArgumentException(string.Empty, "wrongParamName"); var command = new DelegatingGuardClauseCommand { OnExecute = v => throw expected, OnCreateExceptionWithFailureReason = (v, m, e) => new Exception(m, e), RequestedType = typeof(string), RequestedParameterName = "expectedParamName" }; var expectation = new EmptyStringBehaviorExpectation(); // Act var actual = Record.Exception(() => expectation.Verify(command)); // Assert Assert.Equal(expected, actual.InnerException); } } }
{ "pile_set_name": "Github" }
defmodule Mix.Tasks.Ecto.MigrationsTest do use ExUnit.Case import Mix.Tasks.Ecto.Migrations, only: [run: 3] import Support.FileHelpers migrations_path = Path.join([tmp_path(), inspect(Ecto.Migrations), "migrations"]) setup do File.mkdir_p!(unquote(migrations_path)) :ok end defmodule Repo do def start_link(_) do Process.put(:started, true) Task.start_link fn -> Process.flag(:trap_exit, true) receive do {:EXIT, _, :normal} -> :ok end end end def stop() do :ok end def __adapter__ do EctoSQL.TestAdapter end def config do [priv: "tmp/#{inspect(Ecto.Migrations)}", otp_app: :ecto_sql] end end test "displays the up and down status for the default repo" do Application.put_env(:ecto_sql, :ecto_repos, [Repo]) migrations = fn _, _ -> [ {:up, 0, "up_migration_0"}, {:up, 20160000000001, "up_migration_1"}, {:up, 20160000000002, "up_migration_2"}, {:up, 20160000000003, "up_migration_3"}, {:down, 20160000000004, "down_migration_1"}, {:down, 20160000000005, "down_migration_2"} ] end expected_output = """ Repo: Mix.Tasks.Ecto.MigrationsTest.Repo Status Migration ID Migration Name -------------------------------------------------- up 0 up_migration_0 up 20160000000001 up_migration_1 up 20160000000002 up_migration_2 up 20160000000003 up_migration_3 down 20160000000004 down_migration_1 down 20160000000005 down_migration_2 """ run [], migrations, fn i -> assert(i == expected_output) end end test "migrations displays the up and down status for any given repo" do migrations = fn _, _ -> [ {:up, 20160000000001, "up_migration_1"}, {:down, 20160000000002, "down_migration_1"} ] end expected_output = """ Repo: Mix.Tasks.Ecto.MigrationsTest.Repo Status Migration ID Migration Name -------------------------------------------------- up 20160000000001 up_migration_1 down 20160000000002 down_migration_1 """ run ["-r", to_string(Repo)], migrations, fn i -> assert(i == expected_output) end end test "does not run from _build" do Application.put_env(:ecto_sql, :ecto_repos, [Repo]) migrations = fn repo, [path] -> assert repo == Repo refute path =~ ~r/_build/ [] end run [], migrations, fn _ -> :ok end end test "uses custom paths" do path1 = Path.join([unquote(tmp_path()), inspect(Ecto.Migrate), "migrations_1"]) path2 = Path.join([unquote(tmp_path()), inspect(Ecto.Migrate), "migrations_2"]) File.mkdir_p!(path1) File.mkdir_p!(path2) run ["-r", to_string(Repo), "--migrations-path", path1, "--migrations-path", path2], fn Repo, [^path1, ^path2] -> [] end, fn _ -> :ok end end end
{ "pile_set_name": "Github" }
rows = {[1.931344e+002 2.021231e+002 2.121106e+002 2.171044e+002 2.290894e+002 2.360806e+002 2.430719e+002 2.500631e+002 2.710369e+002 2.790269e+002 2.930094e+002 3.069919e+002 3.139831e+002 3.209744e+002 3.279656e+002 3.339581e+002 3.409494e+002 3.539331e+002 3.599256e+002 3.659181e+002 3.769044e+002 3.808994e+002 3.848944e+002 3.888894e+002 3.928844e+002 3.938831e+002 3.918856e+002 3.898881e+002 3.858931e+002 ]; [1.901381e+002 2.260931e+002 2.360806e+002 2.470669e+002 2.530594e+002 2.660431e+002 2.800256e+002 2.940081e+002 3.009994e+002 3.209744e+002 3.279656e+002 3.349569e+002 3.469419e+002 3.529344e+002 3.589269e+002 3.639206e+002 3.699131e+002 3.749069e+002 3.789019e+002 3.828969e+002 3.868919e+002 3.898881e+002 3.928844e+002 3.958806e+002 3.978781e+002 3.988769e+002 3.998756e+002 4.008744e+002 3.998756e+002 3.988769e+002 3.978781e+002 ]; [3.129844e+002 3.099881e+002 3.089894e+002 3.089894e+002 3.059931e+002 3.039956e+002 3.029969e+002 3.019981e+002 2.990019e+002 2.980031e+002 2.970044e+002 2.960056e+002 2.960056e+002 2.940081e+002 ]; }; cols = {[3.760306e+002 3.650444e+002 3.600506e+002 3.580531e+002 3.540581e+002 3.520606e+002 3.500631e+002 3.470669e+002 3.370794e+002 3.340831e+002 3.260931e+002 3.181031e+002 3.141081e+002 3.101131e+002 3.051194e+002 3.011244e+002 2.961306e+002 2.881406e+002 2.841456e+002 2.801506e+002 2.731594e+002 2.691644e+002 2.671669e+002 2.641706e+002 2.601756e+002 2.591769e+002 2.591769e+002 2.601756e+002 2.611744e+002 ]; [3.660431e+002 4.019981e+002 4.069919e+002 4.119856e+002 4.149819e+002 4.209744e+002 4.259681e+002 4.319606e+002 4.349569e+002 4.429469e+002 4.459431e+002 4.489394e+002 4.539331e+002 4.569294e+002 4.589269e+002 4.609244e+002 4.629219e+002 4.649194e+002 4.669169e+002 4.679156e+002 4.689144e+002 4.699131e+002 4.709119e+002 4.719106e+002 4.729094e+002 4.739081e+002 4.739081e+002 4.739081e+002 4.729094e+002 4.719106e+002 4.699131e+002 ]; [3.041206e+002 3.430719e+002 3.600506e+002 3.700381e+002 4.000006e+002 4.199756e+002 4.289644e+002 4.369544e+002 4.599256e+002 4.629219e+002 4.659181e+002 4.649194e+002 4.629219e+002 4.589269e+002 ]; };
{ "pile_set_name": "Github" }
pub mod register; pub mod cpu; pub mod ppu; pub mod apu; pub mod rom; pub mod memory; pub mod mapper; pub mod button; pub mod joypad; pub mod input; pub mod audio; pub mod display; pub mod default_input; pub mod default_audio; pub mod default_display; use cpu::Cpu; use rom::Rom; use button::Button; use input::Input; use display::Display; use audio::Audio; /// NES emulator. /// /// ```ignore /// use std::fs::File; /// use std::io::Read; /// use std::time::Duration; /// use nes_rust::Nes; /// use nes_rust::rom::Rom; /// use nes_rust::default_input::DefaultInput; /// use nes_rust::default_audio::DefaultAudio; /// use nes_rust::default_display::DefaultDisplay; /// /// let input = Box::new(DefaultInput::new()); /// let display = Box::new(DefaultDisplay::new()); /// let audio = Box::new(DefaultAudio::new()); /// let mut nes = Nes::new(input, display, audio); /// /// // Load and set Rom from rom image binary /// let filename = &args[1]; /// let mut file = File::open(filename)?; /// let mut contents = vec![]; /// file.read_to_end(&mut contents)?; /// let rom = Rom::new(contents); /// nes.set_rom(rom); /// /// // Go! /// nes.bootup(); /// let mut rgba_pixels = [0; 256 * 240 * 4]; /// loop { /// nes.step_frame(); /// nes.copy_pixels(rgba_pixels); /// // Render rgba_pixels /// // @TODO: Audio buffer sample code is T.B.D. /// // Adjust sleep time for your platform /// std::thread::sleep(Duration::from_millis(1)); /// } /// ``` pub struct Nes { cpu: Cpu } impl Nes { /// Creates a new `Nes`. /// You need to pass [`input::Input`](./input/trait.Input.html), /// [`display::Display`](./display/trait.Display.html), and /// [`audio::Audio`](./audio/trait.Audio.html) traits for your platform /// specific Input/Output. /// /// # Arguments /// * `input` For pad input /// * `display` For screen output /// * `audio` For audio output pub fn new(input: Box<dyn Input>, display: Box<dyn Display>, audio: Box<dyn Audio>) -> Self { Nes { cpu: Cpu::new( input, display, audio ) } } /// Sets up NES rom /// /// # Arguments /// * `rom` pub fn set_rom(&mut self, rom: Rom) { self.cpu.set_rom(rom); } /// Boots up pub fn bootup(&mut self) { self.cpu.bootup(); } /// Resets pub fn reset(&mut self) { self.cpu.reset(); } /// Executes a CPU cycle pub fn step(&mut self) { self.cpu.step(); } /// Executes a PPU (screen refresh) frame pub fn step_frame(&mut self) { self.cpu.step_frame(); } /// Copies RGB pixels of screen to passed pixels. /// The length and result should be specific to `display` passed via the constructor. /// /// # Arguments /// * `pixels` pub fn copy_pixels(&self, pixels: &mut [u8]) { self.cpu.get_ppu().get_display().copy_to_rgba_pixels(pixels); } /// Copies audio buffer to passed buffer. /// The length and result should be specific to `audio` passed via the constructor. /// /// # Arguments /// * `buffer` pub fn copy_sample_buffer(&mut self, buffer: &mut [f32]) { self.cpu.get_mut_apu().get_mut_audio().copy_sample_buffer(buffer); } /// Presses a pad button /// /// # Arguments /// * `button` pub fn press_button(&mut self, button: Button) { self.cpu.get_mut_input().press(button); } /// Releases a pad button /// /// # Arguments /// * `buffer` pub fn release_button(&mut self, button: Button) { self.cpu.get_mut_input().release(button); } /// Checks if NES console is powered on pub fn is_power_on(&self) -> bool { self.cpu.is_power_on() } }
{ "pile_set_name": "Github" }
/* Generated by RuntimeBrowser. */ @protocol ICDocCamZoomablePageContentViewDelegate @required - (void)pageContentViewDidPencilDown; @end
{ "pile_set_name": "Github" }
package load import ( "encoding/json" "github.com/shirou/gopsutil/internal/common" ) var invoke common.Invoker func init() { invoke = common.Invoke{} } type AvgStat struct { Load1 float64 `json:"load1"` Load5 float64 `json:"load5"` Load15 float64 `json:"load15"` } func (l AvgStat) String() string { s, _ := json.Marshal(l) return string(s) } type MiscStat struct { ProcsRunning int `json:"procsRunning"` ProcsBlocked int `json:"procsBlocked"` Ctxt int `json:"ctxt"` } func (m MiscStat) String() string { s, _ := json.Marshal(m) return string(s) }
{ "pile_set_name": "Github" }
package octopus.api.projects; import java.io.IOException; import java.nio.file.Paths; import octopus.api.database.Database; import octopus.server.database.titan.TitanLocalDatabaseManager; public class OctopusProject { private final String pathToProjectDir; private String name; public OctopusProject(String name, String pathToProjectDir) throws IOException { this.pathToProjectDir = pathToProjectDir; this.name = name; } public String getPathToProjectDir() { return pathToProjectDir; } public String getName() { return name; } public String getDBConfigFile() { return Paths.get(pathToProjectDir, "db").toAbsolutePath().toString(); } public Database getNewDatabaseInstance() { return new TitanLocalDatabaseManager().getDatabaseInstanceForProject(this); } }
{ "pile_set_name": "Github" }
import pytest SKIP = True @pytest.mark.parametrize("x", range(5000)) def test_foo(x): if SKIP: pytest.skip("heh")
{ "pile_set_name": "Github" }
.. i18n: .. index:: .. i18n: single: analytic; accounts .. .. index:: single: analytic; accounts .. i18n: Putting Analytic Accounts in Place .. i18n: ================================== .. 使辅助核算项到位 ================================== .. i18n: For the initial setup of good analytic accounts you should: .. 为能更好的初始化辅助核算您应该做到: .. i18n: * set up the chart of accounts, .. i18n: .. i18n: * create the different journals, .. i18n: .. i18n: * link the analytic journals to your accounting journals. .. * 设置会计科目表, * 创建不同的分类帐, * 将辅助核算关联到分类帐上. .. i18n: Setting up the Chart of Accounts .. i18n: -------------------------------- .. 设置科目表 -------------------------------- .. i18n: Start by choosing the most suitable analytic representation for your company before entering it into OpenERP. To create the different analytic accounts, use the menu :menuselection:`Accounting--> Configuration --> Analytic Accounting --> Analytic Accounts` and click the :guilabel:`Create` button. .. i18n: Note that the data you see when creating an analytic account will depend upon the business applications installed. .. 开始进入OpenERP之前请选择最时候贵公司的辅助核算方案。要创建不同的辅助核算项,使用菜单 :menuselection:`Accounting--> Configuration --> Analytic Accounting --> Analytic Accounts` 并点击 :guilabel:`Create` 按钮。 注意您创建辅助核算项时看到数据依赖于您已经安装的模块。 .. i18n: .. figure:: images/account_analytic_form.png .. i18n: :scale: 75 .. i18n: :align: center .. i18n: .. i18n: *Setting up an Analytic Account* .. .. figure:: images/account_analytic_form.png :scale: 75 :align: center *配置辅助核算项* .. i18n: To create an analytic account, you have to complete the main fields: .. 要创建一个辅助核算项,您必须完成如下字段: .. i18n: * the :guilabel:`Account Name`, .. i18n: .. i18n: * the :guilabel:`Code/Reference`: used as a shortcut for selecting the account, .. i18n: .. i18n: * the :guilabel:`Parent Analytic Account`: use this field to define the hierarchy between the accounts. .. i18n: .. i18n: * the :guilabel:`Account Type`: just like general accounts, the \ ``View``\ type is used for virtual accounts which are used only to create a hierarchical structure and for subtotals, and not to store accounting entries. The \ ``Normal``\ type will be used for analytic accounts containing entries. .. * :guilabel:`(辅助核算项)名称`, * :guilabel:`Code/Reference`: 用于选择辅助核算项的快捷方式, * :guilabel:`Parent Analytic Account`: 使用这个字段来定义不同辅助核算项的层次结构。 * :guilabel:`Account Type`: 就像通用科目表一样, \ ``View``\ 类型仅用于创建用于层次结构和数据汇总的虚拟项目,不能用来录入数据。 \ ``Normal``\ 类型用于包含数据的辅助核算项。 .. i18n: If an analytic account (e.g. a project) is for a limited time, you can define a start and end date here. .. 如果一个辅助核算项(特别是一个项目)有时间限制,您可以在此定义一个开始时间和结束时间。 .. i18n: The :guilabel:`Maximum Time` can be used for contracts with a fixed limit of hours to use. .. :guilabel:`Maximum Time` 可用于一个有固定持续时间的合同。 .. i18n: .. index:: .. i18n: single: invoicing .. .. index:: single: invoicing .. i18n: .. tip:: Invoicing .. i18n: .. i18n: You have several methods available to you in OpenERP for automated invoicing: .. i18n: .. i18n: * Service companies usually use invoicing from purchase orders, analytic accounts or .. i18n: project management tasks. .. i18n: .. i18n: * Manufacturing and trading companies more often use invoicing from deliveries or customer purchase .. i18n: orders. .. i18n: .. i18n: For more information about invoicing from projects, we refer to the book (soon to be released) about Project and Services Management. .. .. tip:: 发票 在OpenERP中你有几种方法可用于自动发票: * 服务型公司通常因采购订单,辅助核算项或项目管理任务而开具发票。 * 制造业或贸易企业经常因发货或客户采购订单而开具发票。 orders. 如需要项目发票的更多信息,请参阅有关项目和服务管理的书(即将发布)。 .. i18n: Once you have defined the different analytic accounts, you can view your chart through the menu :menuselection:`Accounting --> Charts --> Chart of Analytic Accounts`. You can display analytic accounts for one or more periods or for an entire financial year. .. 一旦您定义了不同的辅助核算,您就可以通过菜单 :menuselection:`Accounting --> Charts --> Chart of Analytic Accounts` 查看清单。 您可以一个会计年度中一个或多个会计期间的辅助核算项目。 .. i18n: .. figure:: images/account_analytic_chart.png .. i18n: :scale: 85 .. i18n: :align: center .. i18n: .. i18n: *Analytic Chart of Accounts* .. .. figure:: images/account_analytic_chart.png :scale: 85 :align: center *辅助核算表* .. i18n: .. index:: .. i18n: single: module; hr_timesheet_invoice .. i18n: single: module; account_analytic_analysis .. .. index:: single: module; hr_timesheet_invoice single: module; account_analytic_analysis .. i18n: .. tip:: Setting up an Analytic Account .. i18n: .. i18n: The setup screen for an analytic account can vary according to the modules installed in your database. .. i18n: For example, you will see information about recharging services only if you have the module :mod:`hr_timesheet_invoice` installed. .. i18n: .. i18n: Some of these modules add helpful management statistics to the analytic account. The most useful is probably the module :mod:`account_analytic_analysis`, which adds such information as indicators about your margins, invoicing amounts, and latest service dates and invoice dates. .. .. tip:: 设置辅助核算项 辅助核算项设置画面可因安装在帐套中的模块而有很大不同。例如仅当您安装了 :mod:`hr_timesheet_invoice` 模块后才能看到有关收取服务成本费用的信息。 这些模块增加了一些对管理有用的针对辅助核算项的统计表。最有用的可能是模块 :mod:`account_analytic_analysis` ,它增加了利润率、发票金额和最新的服务日期和发票日期等信息。 .. i18n: Creating Journals .. i18n: ----------------- .. 创建辅助核算账簿 ----------------- .. i18n: Once the analytic chart has been created for your company, you have to create the different journals. .. i18n: These journals enable you to categorise the different accounting entries by their type, such as: .. 一旦为您的公司创建了辅助核算一览表那么您必须建立不同的帐簿。这谢帐簿可使您按不同类型的会计分录进行分录,比如: .. i18n: * services, .. i18n: .. i18n: * expense reimbursements, .. i18n: .. i18n: * purchases of materials, .. i18n: .. i18n: * miscellaneous expenditure, .. i18n: .. i18n: * sales. .. * 服务, * 费用报销, * 材料采购, * 其他指出, * 销售。 .. i18n: .. index:: .. i18n: single: journal; minimal journals .. .. index:: single: journal; minimal journals .. i18n: .. note:: Minimal Journals .. i18n: .. i18n: At a minimum, you have to create one analytic journal for Sales and one for Purchases. .. i18n: If you do not create these two, OpenERP will not validate invoices linked to an analytic account, .. i18n: because it would not be able to create an analytic accounting entry automatically. .. .. note:: 最小分类帐 至少,您必须分别创建一个销售和采购辅助核算帐簿。如果您没有创建这两个帐簿,OpenERP不会验证关联到辅助核算的发票,因为它不能自动创建一个辅助核算分录。 .. i18n: .. figure:: images/account_analytic_journal.png .. i18n: :scale: 85 .. i18n: :align: center .. i18n: .. i18n: *Creating an Analytic Journal* .. .. figure:: images/account_analytic_journal.png :scale: 85 :align: center *创建辅助核算账簿* .. i18n: To define your analytic journals, use the menu :menuselection:`Accounting --> Configuration --> Analytic Accounting --> Analytic Journals` then click the :guilabel:`Create` button. .. 要定义辅助核算分类账,使用菜单 :menuselection:`Accounting --> Configuration --> Analytic Accounting --> Analytic Journals` 然后点击 :guilabel:`Create` 按钮。 .. i18n: It is easy to create an analytic journal. Just give it a :guilabel:`Journal Name`, a :guilabel:`Journal Code` and a :guilabel:`Type`. The .. i18n: types available are: .. 很容易创建辅助核算分类账,进需给一个 :guilabel:`Journal Name`, 一个 :guilabel:`Journal Code` 和一个 :guilabel:`Type`. 可用类型有: .. i18n: * \ ``Sale``\, for sales to customers and for credit notes, .. i18n: .. i18n: * \ ``Purchase``\, for purchases and expenses, .. i18n: .. i18n: * \ ``Cash``\, for financial entries, .. i18n: .. i18n: * \ ``Situation``\, to adjust accounts when starting an activity, or at the end of the financial year, .. i18n: .. i18n: * \ ``General``\, for all other entries. .. * \ ``Sale``\, 适用于销售给客户和欠款, * \ ``Purchase``\, 适用于采购和费用, * \ ``Cash``\, 适用于凭证分录, * \ ``Situation``\, 开始运作时的调整科目, 或在本会计年度结束时, * \ ``General``\, 其他分录。 .. i18n: The analytic journal now has to be linked to your general journals to allow OpenERP to post the analytic entries. For example, if you enter an invoice for a customer, OpenERP will automatically search for the analytic journal of type \ ``Sales``\ linked to your Sales Journal. .. i18n: Go to :menuselection:`Accounting--> Configuration --> Financial Accounting --> Journals --> Journals` and select for instance the Sales journal. In the :guilabel:`Analytic Journal` select the analytic sales journal. .. 辅助核算现在已链接到您的通用分类帐以便OpenERP放置辅助核算分录。比如,如果您在为客户录入发票,OpenERP 会自动搜索类型为 \ ``Sales``\ 的辅助核算关联到销售分类帐上。 通过菜单 :menuselection:`Accounting--> Configuration --> Financial Accounting --> Journals --> Journals` 并选择比方销售分类帐。 在 :guilabel:`Analytic Journal` 中也选择销售辅助分类帐。 .. i18n: .. figure:: images/account_general_journal.png .. i18n: :scale: 85 .. i18n: :align: center .. i18n: .. i18n: *Linking an Analytic Journal to a Journal* .. .. figure:: images/account_general_journal.png :scale: 85 :align: center *关联辅助核算分类账到分类账* .. i18n: Working with Analytic Defaults .. i18n: ------------------------------ .. 默认辅助核算项(方案) ------------------------------ .. i18n: You can work with analytic default accounts in OpenERP by installing the :mod:`account_analytic_default` module. Notice that this module is also linked with the :mod:`sale`, :mod:`stock` and :mod:`procurement` modules. .. 安装 :mod:`account_analytic_default` 模块后您可以在OpenERP中使用默认辅助核算项。 注意这个模块和 :mod:`sale`, :mod:`stock` 以及 :mod:`procurement` 模块有关联。 .. i18n: The system will automatically select analytic accounts according to the following criteria: .. 系统会根据以下条件选择辅助核算项: .. i18n: * Product .. i18n: * Partner .. i18n: * User .. i18n: * Company .. i18n: * Date .. * 按 所选产品 产生默认 * 按 所选业务伙伴 产生默认 * 按 登陆用户 产生默认 * 按 所选公司 产生默认 * 按 日期 产生默认 .. i18n: You can configure these criteria using the menu :menuselection:`Accounting --> Configuration --> Analytic Accounting --> Analytic Defaults` and clicking the `Create` button. .. i18n: According to the criteria you define here, the correct analytic account will be proposed when creating an order or an invoice. .. 您可以通过菜单 :menuselection:`Accounting --> Configuration --> Analytic Accounting --> Analytic Defaults` 并点击 `Create` 按钮创建这些标准。 根据您在此定义的条件,当创建订单或发票时系统将推荐正确的辅助核算项。 .. i18n: .. figure:: images/account_analytic_default.png .. i18n: :scale: 85 .. i18n: :align: center .. i18n: .. i18n: *Specify Criteria to Automatically Select Analytic Account* .. .. figure:: images/account_analytic_default.png :scale: 85 :align: center *提供条件以自动选择辅助核算项* .. i18n: .. Copyright © Open Object Press. All rights reserved. .. .. Copyright © Open Object Press. All rights reserved. .. i18n: .. You may take electronic copy of this publication and distribute it if you don't .. i18n: .. change the content. You can also print a copy to be read by yourself only. .. .. You may take electronic copy of this publication and distribute it if you don't .. change the content. You can also print a copy to be read by yourself only. .. i18n: .. We have contracts with different publishers in different countries to sell and .. i18n: .. distribute paper or electronic based versions of this book (translated or not) .. i18n: .. in bookstores. This helps to distribute and promote the OpenERP product. It .. i18n: .. also helps us to create incentives to pay contributors and authors using author .. i18n: .. rights of these sales. .. .. We have contracts with different publishers in different countries to sell and .. distribute paper or electronic based versions of this book (translated or not) .. in bookstores. This helps to distribute and promote the OpenERP product. It .. also helps us to create incentives to pay contributors and authors using author .. rights of these sales. .. i18n: .. Due to this, grants to translate, modify or sell this book are strictly .. i18n: .. forbidden, unless Tiny SPRL (representing Open Object Press) gives you a .. i18n: .. written authorisation for this. .. .. Due to this, grants to translate, modify or sell this book are strictly .. forbidden, unless Tiny SPRL (representing Open Object Press) gives you a .. written authorisation for this. .. i18n: .. Many of the designations used by manufacturers and suppliers to distinguish their .. i18n: .. products are claimed as trademarks. Where those designations appear in this book, .. i18n: .. and Open Object Press was aware of a trademark claim, the designations have been .. i18n: .. printed in initial capitals. .. .. Many of the designations used by manufacturers and suppliers to distinguish their .. products are claimed as trademarks. Where those designations appear in this book, .. and Open Object Press was aware of a trademark claim, the designations have been .. printed in initial capitals. .. i18n: .. While every precaution has been taken in the preparation of this book, the publisher .. i18n: .. and the authors assume no responsibility for errors or omissions, or for damages .. i18n: .. resulting from the use of the information contained herein. .. .. While every precaution has been taken in the preparation of this book, the publisher .. and the authors assume no responsibility for errors or omissions, or for damages .. resulting from the use of the information contained herein. .. i18n: .. Published by Open Object Press, Grand Rosière, Belgium .. .. Published by Open Object Press, Grand Rosière, Belgium
{ "pile_set_name": "Github" }
/* Copyright (c) 2013 yvt This file is part of OpenSpades. OpenSpades 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. OpenSpades 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 OpenSpades. If not, see <http://www.gnu.org/licenses/>. */ #include <algorithm> #include "SWFlatMapRenderer.h" #include "SWImage.h" #include "SWMapRenderer.h" #include "SWRenderer.h" #include <Client/GameMap.h> #include <Core/Debug.h> #include <Core/Exception.h> namespace spades { namespace draw { SWFlatMapRenderer::SWFlatMapRenderer(SWRenderer *r, client::GameMap *map) : r(r), map(map), w(map->Width()), h(map->Height()), needsUpdate(true) { SPADES_MARK_FUNCTION(); if (w & 31) { SPRaise("Map width must be a multiple of 32."); } img.Set(new SWImage(map->Width(), map->Height()), false); updateMap.resize(w * h / 32); std::fill(updateMap.begin(), updateMap.end(), 0xffffffff); updateMap2.resize(w * h / 32); std::fill(updateMap2.begin(), updateMap2.end(), 0xffffffff); Update(true); } SWFlatMapRenderer::~SWFlatMapRenderer() { SPADES_MARK_FUNCTION(); } void SWFlatMapRenderer::Update(bool firstTime) { SPADES_MARK_FUNCTION(); { std::lock_guard<std::mutex> lock(updateInfoLock); if (!needsUpdate) return; needsUpdate = false; updateMap.swap(updateMap2); std::fill(updateMap.begin(), updateMap.end(), 0); } auto *outPixels = img->GetRawBitmap(); auto *mapRenderer = r->mapRenderer.get(); int idx = 0; for (int y = 0; y < h; y++) { for (int x = 0; x < w; x += 32) { uint32_t upd = updateMap2[idx]; if (upd) { for (int i = 0; i < 32; i++) { if (upd & 1) { auto c = GeneratePixel(x + i, y); outPixels[i] = c; if (!firstTime) { mapRenderer->UpdateRle(x + i, y); mapRenderer->UpdateRle((x + i + 1) & (w - 1), y); mapRenderer->UpdateRle((x + i - 1) & (w - 1), y); mapRenderer->UpdateRle(x + i, (y + 1) & (h - 1)); mapRenderer->UpdateRle(x + i, (y - 1) & (h - 1)); } } upd >>= 1; } // updateMap[idx] = 0; } outPixels += 32; idx++; } } } uint32_t SWFlatMapRenderer::GeneratePixel(int x, int y) { const int depth = map->Depth(); for (int z = 0; z < depth; z++) { if (map->IsSolid(x, y, z)) { uint32_t col = map->GetColor(x, y, z); col = (col & 0xff00) | ((col & 0xff) << 16) | ((col & 0xff0000) >> 16); col |= 0xff000000; return col; } } return 0; // shouldn't reach here for valid maps } void SWFlatMapRenderer::SetNeedsUpdate(int x, int y) { std::lock_guard<std::mutex> lock(updateInfoLock); needsUpdate = true; updateMap[(x + y * w) >> 5] |= 1 << (x & 31); } } }
{ "pile_set_name": "Github" }
import React from 'react'; import { connect } from 'react-redux'; import { toggleMobileDisplayHidden } from '../../mega-menu/actions'; export class Main extends React.Component { constructor() { super(); this.state = { closeMenu: { hidden: true, }, openMenu: {}, }; } componentDidMount() { window.addEventListener('resize', this.resetDefaultState.bind(this)); } /** * Remove event listener */ componentWillUnmount() { window.removeEventListener('resize', this.resetDefaultState.bind(this)); } resetDefaultState() { this.setState({ closeMenu: { hidden: true, }, openMenu: {}, }); } handleOpenMenu() { this.setState({ closeMenu: {}, openMenu: { hidden: true }, }); this.props.toggleMobileDisplayHidden(); } handleCloseMenu() { this.setState({ closeMenu: { hidden: true }, openMenu: {}, }); this.props.toggleMobileDisplayHidden(); } render() { return ( <div> <button aria-controls="vetnav" aria-expanded="false" {...this.state.closeMenu} type="button" onClick={() => this.handleCloseMenu()} className="vetnav-controller-close" > <span className="va-flex"> Close <svg width="16" height="16" viewBox="0 0 49 49" xmlns="http://www.w3.org/2000/svg" pointerEvents="none" > <path d="M48.152 39.402c0 1.07-.375 1.982-1.125 2.732l-5.465 5.464c-.75.75-1.66 1.125-2.732 1.125-1.07 0-1.982-.375-2.732-1.125L24.286 35.786 12.473 47.598c-.75.75-1.66 1.125-2.732 1.125-1.07 0-1.98-.375-2.73-1.125l-5.465-5.464c-.75-.75-1.125-1.66-1.125-2.732 0-1.072.375-1.982 1.125-2.732l11.812-11.813L1.545 13.045c-.75-.75-1.125-1.66-1.125-2.732C.42 9.24.795 8.33 1.545 7.58L7.01 2.116C7.76 1.366 8.67.99 9.74.99c1.073 0 1.983.376 2.733 1.126L24.286 13.93 36.098 2.115c.75-.75 1.66-1.125 2.732-1.125 1.072 0 1.982.376 2.733 1.126l5.464 5.464c.75.75 1.125 1.66 1.125 2.732 0 1.072-.375 1.983-1.125 2.733L35.214 24.857 47.027 36.67c.75.75 1.125 1.66 1.125 2.732z" /> </svg> </span> </button> <button {...this.state.openMenu} aria-controls="vetnav" type="button" aria-expanded="false" onClick={() => this.handleOpenMenu()} className="vetnav-controller-open" > <span className="va-flex"> Menu <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 444.8 444.8" style={{ pointerEvents: 'none' }} > <path d="M248.1 352L434 165.9c7.2-6.9 10.8-15.4 10.8-25.7 0-10.3-3.6-18.8-10.8-25.7l-21.4-21.7c-7-7-15.6-10.6-25.7-10.6-9.9 0-18.6 3.5-26 10.6L222.4 231.5 83.7 92.8c-7-7-15.6-10.6-25.7-10.6-9.9 0-18.6 3.5-26 10.6l-21.4 21.7c-7 7-10.6 15.6-10.6 25.7s3.5 18.7 10.6 25.7L196.4 352c7.4 7 16.1 10.6 26 10.6 10.1 0 18.7-3.5 25.7-10.6z" /> </svg> </span> </button> </div> ); } } const mapDispatchToProps = dispatch => ({ toggleMobileDisplayHidden: () => { dispatch(toggleMobileDisplayHidden()); }, }); export default connect( undefined, mapDispatchToProps, )(Main);
{ "pile_set_name": "Github" }
frappe.listview_settings['Employee Separation'] = { add_fields: ["boarding_status", "employee_name", "department"], filters:[["boarding_status","=", "Pending"]], get_indicator: function(doc) { return [__(doc.boarding_status), frappe.utils.guess_colour(doc.boarding_status), "status,=," + doc.boarding_status]; } };
{ "pile_set_name": "Github" }
(set-logic QF_S) (set-option :strings-exp true) (set-info :status sat) (declare-const input_0_1000 String) (assert (= (str.substr input_0_1000 0 4) "good")) (assert (= (str.substr input_0_1000 5 1) "I")) (assert (not (= input_0_1000 "goodAI"))) (check-sat)
{ "pile_set_name": "Github" }
package net.okjsp class ContentVote { Integer point = 1 Article article Content content Avatar voter Date dateCreated static constraints = { point bindable: false voter bindable: false voter unique: 'content' } static mapping = { version false } def afterInsert() { content.updateVoteCount(point) } def beforeDelete() { content.updateVoteCount(-point) } }
{ "pile_set_name": "Github" }
Çevrimiçi hizmetlerinde doğrulama kodlarınızı yönetmeniz için özgür, güvenli ve açık kaynak 2FA uygulaması <b>Şifreleme</b> Tüm tek kullanımlık kodlarınız bir kasada saklanır. Kasaya bir parola atamayı seçerseniz, ki bu şiddetle tavsiye edilir, kasanız AES-256 kullanılarak şifrelenecektir. Kötü niyetli birisi kasanızı ele geçirmeyi başarsa bile kasa içeriğini parolayı bilmeden elde etmesi mümkün olmayabilir. <b>Biyometrik Kilit Açma</b> Her tek kullanımlık koda ihtiyacınız olduğunda kasayı parolayla açmak yavaş olabilir. Neyse ki, cihanızınız biyometrik sensöre sahipse biyometrik kilit açmayı aktifleştirebilirsiniz. <b>Uyumluluk</b> Aegis HOTP ve TOTP algoritmalarını destekler. Bu iki algoritma endüstride standarttır ve geniş ölçekte desteklenir. Bu Aegis'i binlerce servisle uyumlu yapar. Bazı örnekler: Google, GitHub, Dropbox, Facebook ve Instagram. Aynı zamanda Google Authenticator ile de uyumludur. Herhangi bir site Google Authenticator için QR kod gösteriyorsa bu kod aynı zamanda Aegis tarafından da tanınır. <b>Gruplama</b> Bir sürü tek kullanımlık parolanız mı var? Onlara kolay erişmek için gruplandırabilirsiniz. Kişisel, İş veya Sosyal hepsi kendi grubunda bulunabilir. <b>Yedekler</b> Çevrimiçi hesaplarınıza erişiminizi hiçbir zaman kaybetmemeniz için Aegis Authenticator kasanızı başka bir cihaza aktarabileceğiniz şekilde dışarıya aktarmayı destekler. Aegis Authenticator AndOTP ve FreeOTP veritabanlarını içeriye aktarmayı da destekler, bu Aegis'e geçiş yapmanızı sizin için kolaylaştırır. <b>Açık Kaynak Kod ve Lisanslar</b> Aegis Authenticator açık kaynaktır (GPL v3 altında lisanslanır) ve kaynak kodu şurada bulunabilir: http://github.com/beemdevelopment/Aegis
{ "pile_set_name": "Github" }
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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. # # Fail2Ban 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 Fail2Ban; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Author: Yaroslav Halchenko # Modified: Cyril Jaquier __author__ = 'Yaroslav Halchenko, Serg G. Brester (aka sebres)' __copyright__ = 'Copyright (c) 2007 Yaroslav Halchenko, 2015 Serg G. Brester (aka sebres)' __license__ = 'GPL' import os import re import sys from ..helpers import getLogger if sys.version_info >= (3,): # pragma: 2.x no cover # SafeConfigParser deprecated from Python 3.2 (renamed to ConfigParser) from configparser import ConfigParser as SafeConfigParser, BasicInterpolation, \ InterpolationMissingOptionError, NoOptionError, NoSectionError # And interpolation of __name__ was simply removed, thus we need to # decorate default interpolator to handle it class BasicInterpolationWithName(BasicInterpolation): """Decorator to bring __name__ interpolation back. Original handling of __name__ was removed because of functional deficiencies: http://bugs.python.org/issue10489 commit v3.2a4-105-g61f2761 Author: Lukasz Langa <[email protected]> Date: Sun Nov 21 13:41:35 2010 +0000 Issue #10489: removed broken `__name__` support from configparser But should be fine to reincarnate for our use case """ def _interpolate_some(self, parser, option, accum, rest, section, map, *args, **kwargs): if section and not (__name__ in map): map = map.copy() # just to be safe map['__name__'] = section # try to wrap section options like %(section/option)s: parser._map_section_options(section, option, rest, map) return super(BasicInterpolationWithName, self)._interpolate_some( parser, option, accum, rest, section, map, *args, **kwargs) else: # pragma: 3.x no cover from ConfigParser import SafeConfigParser, \ InterpolationMissingOptionError, NoOptionError, NoSectionError # Interpolate missing known/option as option from default section SafeConfigParser._cp_interpolate_some = SafeConfigParser._interpolate_some def _interpolate_some(self, option, accum, rest, section, map, *args, **kwargs): # try to wrap section options like %(section/option)s: self._map_section_options(section, option, rest, map) return self._cp_interpolate_some(option, accum, rest, section, map, *args, **kwargs) SafeConfigParser._interpolate_some = _interpolate_some def _expandConfFilesWithLocal(filenames): """Expands config files with local extension. """ newFilenames = [] for filename in filenames: newFilenames.append(filename) localname = os.path.splitext(filename)[0] + '.local' if localname not in filenames and os.path.isfile(localname): newFilenames.append(localname) return newFilenames # Gets the instance of the logger. logSys = getLogger(__name__) logLevel = 7 __all__ = ['SafeConfigParserWithIncludes'] class SafeConfigParserWithIncludes(SafeConfigParser): """ Class adds functionality to SafeConfigParser to handle included other configuration files (or may be urls, whatever in the future) File should have section [includes] and only 2 options implemented are 'files_before' and 'files_after' where files are listed 1 per line. Example: [INCLUDES] before = 1.conf 3.conf after = 1.conf It is a simple implementation, so just basic care is taken about recursion. Includes preserve right order, ie new files are inserted to the list of read configs before original, and their includes correspondingly so the list should follow the leaves of the tree. I wasn't sure what would be the right way to implement generic (aka c++ template) so we could base at any *configparser class... so I will leave it for the future """ SECTION_NAME = "INCLUDES" SECTION_OPTNAME_CRE = re.compile(r'^([\w\-]+)/([^\s>]+)$') SECTION_OPTSUBST_CRE = re.compile(r'%\(([\w\-]+/([^\)]+))\)s') CONDITIONAL_RE = re.compile(r"^(\w+)(\?.+)$") if sys.version_info >= (3,2): # overload constructor only for fancy new Python3's def __init__(self, share_config=None, *args, **kwargs): kwargs = kwargs.copy() kwargs['interpolation'] = BasicInterpolationWithName() kwargs['inline_comment_prefixes'] = ";" super(SafeConfigParserWithIncludes, self).__init__( *args, **kwargs) self._cfg_share = share_config else: def __init__(self, share_config=None, *args, **kwargs): SafeConfigParser.__init__(self, *args, **kwargs) self._cfg_share = share_config def get_ex(self, section, option, raw=False, vars={}): """Get an option value for a given section. In opposite to `get`, it differentiate session-related option name like `sec/opt`. """ sopt = None # if option name contains section: if '/' in option: sopt = SafeConfigParserWithIncludes.SECTION_OPTNAME_CRE.search(option) # try get value from named section/option: if sopt: sec = sopt.group(1) opt = sopt.group(2) seclwr = sec.lower() if seclwr == 'known': # try get value firstly from known options, hereafter from current section: sopt = ('KNOWN/'+section, section) else: sopt = (sec,) if seclwr != 'default' else ("DEFAULT",) for sec in sopt: try: v = self.get(sec, opt, raw=raw) return v except (NoSectionError, NoOptionError) as e: pass # get value of section/option using given section and vars (fallback): v = self.get(section, option, raw=raw, vars=vars) return v def _map_section_options(self, section, option, rest, defaults): """ Interpolates values of the section options (name syntax `%(section/option)s`). Fallback: try to wrap missing default options as "default/options" resp. "known/options" """ if '/' not in rest or '%(' not in rest: # pragma: no cover return 0 rplcmnt = 0 soptrep = SafeConfigParserWithIncludes.SECTION_OPTSUBST_CRE.findall(rest) if not soptrep: # pragma: no cover return 0 for sopt, opt in soptrep: if sopt not in defaults: sec = sopt[:~len(opt)] seclwr = sec.lower() if seclwr != 'default': usedef = 0 if seclwr == 'known': # try get raw value from known options: try: v = self._sections['KNOWN/'+section][opt] except KeyError: # fallback to default: usedef = 1 else: # get raw value of opt in section: try: # if section not found - ignore: try: sec = self._sections[sec] except KeyError: # pragma: no cover continue v = sec[opt] except KeyError: # pragma: no cover # fallback to default: usedef = 1 else: usedef = 1 if usedef: try: v = self._defaults[opt] except KeyError: # pragma: no cover continue # replacement found: rplcmnt = 1 try: # set it in map-vars (consider different python versions): defaults[sopt] = v except: # try to set in first default map (corresponding vars): try: defaults._maps[0][sopt] = v except: # pragma: no cover # no way to update vars chain map - overwrite defaults: self._defaults[sopt] = v return rplcmnt @property def share_config(self): return self._cfg_share def _getSharedSCPWI(self, filename): SCPWI = SafeConfigParserWithIncludes # read single one, add to return list, use sharing if possible: if self._cfg_share: # cache/share each file as include (ex: filter.d/common could be included in each filter config): hashv = 'inc:'+(filename if not isinstance(filename, list) else '\x01'.join(filename)) cfg, i = self._cfg_share.get(hashv, (None, None)) if cfg is None: cfg = SCPWI(share_config=self._cfg_share) i = cfg.read(filename, get_includes=False) self._cfg_share[hashv] = (cfg, i) elif logSys.getEffectiveLevel() <= logLevel: logSys.log(logLevel, " Shared file: %s", filename) else: # don't have sharing: cfg = SCPWI() i = cfg.read(filename, get_includes=False) return (cfg, i) def _getIncludes(self, filenames, seen=[]): if not isinstance(filenames, list): filenames = [ filenames ] filenames = _expandConfFilesWithLocal(filenames) # retrieve or cache include paths: if self._cfg_share: # cache/share include list: hashv = 'inc-path:'+('\x01'.join(filenames)) fileNamesFull = self._cfg_share.get(hashv) if fileNamesFull is None: fileNamesFull = [] for filename in filenames: fileNamesFull += self.__getIncludesUncached(filename, seen) self._cfg_share[hashv] = fileNamesFull return fileNamesFull # don't have sharing: fileNamesFull = [] for filename in filenames: fileNamesFull += self.__getIncludesUncached(filename, seen) return fileNamesFull def __getIncludesUncached(self, resource, seen=[]): """ Given 1 config resource returns list of included files (recursively) with the original one as well Simple loops are taken care about """ SCPWI = SafeConfigParserWithIncludes try: parser, i = self._getSharedSCPWI(resource) if not i: return [] except UnicodeDecodeError as e: logSys.error("Error decoding config file '%s': %s" % (resource, e)) return [] resourceDir = os.path.dirname(resource) newFiles = [ ('before', []), ('after', []) ] if SCPWI.SECTION_NAME in parser.sections(): for option_name, option_list in newFiles: if option_name in parser.options(SCPWI.SECTION_NAME): newResources = parser.get(SCPWI.SECTION_NAME, option_name) for newResource in newResources.split('\n'): if os.path.isabs(newResource): r = newResource else: r = os.path.join(resourceDir, newResource) if r in seen: continue s = seen + [resource] option_list += self._getIncludes(r, s) # combine lists return newFiles[0][1] + [resource] + newFiles[1][1] def get_defaults(self): return self._defaults def get_sections(self): return self._sections def options(self, section, withDefault=True): """Return a list of option names for the given section name. Parameter `withDefault` controls the include of names from section `[DEFAULT]` """ try: opts = self._sections[section] except KeyError: # pragma: no cover raise NoSectionError(section) if withDefault: # mix it with defaults: return set(opts.keys()) | set(self._defaults) # only own option names: return opts.keys() def read(self, filenames, get_includes=True): if not isinstance(filenames, list): filenames = [ filenames ] # retrieve (and cache) includes: fileNamesFull = [] if get_includes: fileNamesFull += self._getIncludes(filenames) else: fileNamesFull = filenames if not fileNamesFull: return [] logSys.info(" Loading files: %s", fileNamesFull) if get_includes or len(fileNamesFull) > 1: # read multiple configs: ret = [] alld = self.get_defaults() alls = self.get_sections() for filename in fileNamesFull: # read single one, add to return list, use sharing if possible: cfg, i = self._getSharedSCPWI(filename) if i: ret += i # merge defaults and all sections to self: alld.update(cfg.get_defaults()) for n, s in cfg.get_sections().iteritems(): # conditional sections cond = SafeConfigParserWithIncludes.CONDITIONAL_RE.match(n) if cond: n, cond = cond.groups() s = s.copy() try: del(s['__name__']) except KeyError: pass for k in s.keys(): v = s.pop(k) s[k + cond] = v s2 = alls.get(n) if isinstance(s2, dict): # save previous known values, for possible using in local interpolations later: self.merge_section('KNOWN/'+n, dict(filter(lambda i: i[0] in s, s2.iteritems())), '') # merge section s2.update(s) else: alls[n] = s.copy() return ret # read one config : if logSys.getEffectiveLevel() <= logLevel: logSys.log(logLevel, " Reading file: %s", fileNamesFull[0]) # read file(s) : if sys.version_info >= (3,2): # pragma: no cover return SafeConfigParser.read(self, fileNamesFull, encoding='utf-8') else: return SafeConfigParser.read(self, fileNamesFull) def merge_section(self, section, options, pref=None): alls = self.get_sections() try: sec = alls[section] except KeyError: alls[section] = sec = dict() if not pref: sec.update(options) return sk = {} for k, v in options.iteritems(): if not k.startswith(pref) and k != '__name__': sk[pref+k] = v sec.update(sk)
{ "pile_set_name": "Github" }
<!--# layout("/common/layout.html",{"jsBase":"/js/admin/role/"}){ --> <form class="layui-form layui-form-pane" id="updateForm"> <div class="layui-row"> <div class="layui-form-item"> <label class="layui-form-label">角色名称</label> <div class="layui-input-block"> <input type="text" name="name" value="${role.name}" class="layui-input" > </div> </div> <div class="layui-form-item"> <label class="layui-form-label">角色代码</label> <div class="layui-input-inline"> <input type="text" name="code" lay-verify="required" class="layui-input" value="${role.code}" > </div> </div> </div> <div class="layui-row"> <div class="layui-col-xs4"> <div class="layui-form-item"> <label class="layui-form-label">角色类型</label> <layui:simpleDictSelect style='layui-input-inline' type="role_type" id="type" name="type" value="${role.type}" /> </div> </div> </div> <input type="hidden" name="id" value=${role.id} /> <layui:submitButtons id="updateButton" /> </form> <!--#} --> <script> layui.use(['edit'], function(){ var roleEdit = layui.edit roleEdit.init(); }); </script>
{ "pile_set_name": "Github" }
#!/usr/bin/env python # portable serial port access with python # this is a wrapper module for different platform implementations of the # port enumeration feature # # (C) 2011-2013 Chris Liechti <[email protected]> # this is distributed under a free software license, see license.txt """\ This module will provide a function called comports that returns an iterable (generator or list) that will enumerate available com ports. Note that on some systems non-existent ports may be listed. Additionally a grep function is supplied that can be used to search for ports based on their descriptions or hardware ID. """ import sys, os, re # chose an implementation, depending on os #~ if sys.platform == 'cli': #~ else: import os # chose an implementation, depending on os if os.name == 'nt': #sys.platform == 'win32': from serial.tools.list_ports_windows import * elif os.name == 'posix': from serial.tools.list_ports_posix import * #~ elif os.name == 'java': else: raise ImportError("Sorry: no implementation for your platform ('%s') available" % (os.name,)) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def grep(regexp): """\ Search for ports using a regular expression. Port name, description and hardware ID are searched. The function returns an iterable that returns the same tuples as comport() would do. """ r = re.compile(regexp, re.I) for port, desc, hwid in comports(): if r.search(port) or r.search(desc) or r.search(hwid): yield port, desc, hwid # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - def main(): import optparse parser = optparse.OptionParser( usage = "%prog [options] [<regexp>]", description = "Miniterm - A simple terminal program for the serial port." ) parser.add_option("--debug", help="print debug messages and tracebacks (development mode)", dest="debug", default=False, action='store_true') parser.add_option("-v", "--verbose", help="show more messages (can be given multiple times)", dest="verbose", default=1, action='count') parser.add_option("-q", "--quiet", help="suppress all messages", dest="verbose", action='store_const', const=0) (options, args) = parser.parse_args() hits = 0 # get iteraror w/ or w/o filter if args: if len(args) > 1: parser.error('more than one regexp not supported') print "Filtered list with regexp: %r" % (args[0],) iterator = sorted(grep(args[0])) else: iterator = sorted(comports()) # list them for port, desc, hwid in iterator: print("%-20s" % (port,)) if options.verbose > 1: print(" desc: %s" % (desc,)) print(" hwid: %s" % (hwid,)) hits += 1 if options.verbose: if hits: print("%d ports found" % (hits,)) else: print("no ports found") # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # test if __name__ == '__main__': main()
{ "pile_set_name": "Github" }
SRCS=\ ../../../myWindows/wine_date_and_time.cpp \ ../../../Windows/DLL.cpp \ ../../../Windows/FileDir.cpp \ ../../../Windows/FileFind.cpp \ ../../../Windows/FileIO.cpp \ ../../../Windows/FileName.cpp \ ../../../Windows/PropVariant.cpp \ ../../../Windows/PropVariantConversions.cpp \ ../../../Common/IntToString.cpp \ ../../../Common/MyWindows.cpp \ ../../../Common/MyString.cpp \ ../../../Common/StringConvert.cpp \ ../../../Common/MyVector.cpp \ ../../../Common/Wildcard.cpp \ ../../Common/FileStreams.cpp \ ./Client7z.cpp wine_date_and_time.o : ../../../myWindows/wine_date_and_time.cpp $(CXX) $(CXXFLAGS) ../../../myWindows/wine_date_and_time.cpp IntToString.o : ../../../Common/IntToString.cpp $(CXX) $(CXXFLAGS) ../../../Common/IntToString.cpp MyWindows.o : ../../../Common/MyWindows.cpp $(CXX) $(CXXFLAGS) ../../../Common/MyWindows.cpp MyString.o : ../../../Common/MyString.cpp $(CXX) $(CXXFLAGS) ../../../Common/MyString.cpp StringConvert.o : ../../../Common/StringConvert.cpp $(CXX) $(CXXFLAGS) ../../../Common/StringConvert.cpp MyVector.o : ../../../Common/MyVector.cpp $(CXX) $(CXXFLAGS) ../../../Common/MyVector.cpp Wildcard.o : ../../../Common/Wildcard.cpp $(CXX) $(CXXFLAGS) ../../../Common/Wildcard.cpp DLL.o : ../../../Windows/DLL.cpp $(CXX) $(CXXFLAGS) ../../../Windows/DLL.cpp FileDir.o : ../../../Windows/FileDir.cpp $(CXX) $(CXXFLAGS) ../../../Windows/FileDir.cpp FileFind.o : ../../../Windows/FileFind.cpp $(CXX) $(CXXFLAGS) ../../../Windows/FileFind.cpp FileIO.o : ../../../Windows/FileIO.cpp $(CXX) $(CXXFLAGS) ../../../Windows/FileIO.cpp FileName.o : ../../../Windows/FileName.cpp $(CXX) $(CXXFLAGS) ../../../Windows/FileName.cpp PropVariant.o : ../../../Windows/PropVariant.cpp $(CXX) $(CXXFLAGS) ../../../Windows/PropVariant.cpp PropVariantConversions.o : ../../../Windows/PropVariantConversions.cpp $(CXX) $(CXXFLAGS) ../../../Windows/PropVariantConversions.cpp FileStreams.o : ../../Common/FileStreams.cpp $(CXX) $(CXXFLAGS) ../../Common/FileStreams.cpp Client7z.o : ./Client7z.cpp $(CXX) $(CXXFLAGS) ./Client7z.cpp
{ "pile_set_name": "Github" }
# Go-MySQL-Driver A MySQL-Driver for Go's [database/sql](http://golang.org/pkg/database/sql) package ![Go-MySQL-Driver logo](https://raw.github.com/wiki/go-sql-driver/mysql/gomysql_m.png "Golang Gopher holding the MySQL Dolphin") --------------------------------------- * [Features](#features) * [Requirements](#requirements) * [Installation](#installation) * [Usage](#usage) * [DSN (Data Source Name)](#dsn-data-source-name) * [Password](#password) * [Protocol](#protocol) * [Address](#address) * [Parameters](#parameters) * [Examples](#examples) * [LOAD DATA LOCAL INFILE support](#load-data-local-infile-support) * [time.Time support](#timetime-support) * [Unicode support](#unicode-support) * [Testing / Development](#testing--development) * [License](#license) --------------------------------------- ## Features * Lightweight and [fast](https://github.com/go-sql-driver/sql-benchmark "golang MySQL-Driver performance") * Native Go implementation. No C-bindings, just pure Go * Connections over TCP/IPv4, TCP/IPv6, Unix domain sockets or [custom protocols](http://godoc.org/github.com/go-sql-driver/mysql#DialFunc) * Automatic handling of broken connections * Automatic Connection Pooling *(by database/sql package)* * Supports queries larger than 16MB * Full [`sql.RawBytes`](http://golang.org/pkg/database/sql/#RawBytes) support. * Intelligent `LONG DATA` handling in prepared statements * Secure `LOAD DATA LOCAL INFILE` support with file Whitelisting and `io.Reader` support * Optional `time.Time` parsing * Optional placeholder interpolation ## Requirements * Go 1.2 or higher * MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+) --------------------------------------- ## Installation Simple install the package to your [$GOPATH](http://code.google.com/p/go-wiki/wiki/GOPATH "GOPATH") with the [go tool](http://golang.org/cmd/go/ "go command") from shell: ```bash $ go get github.com/go-sql-driver/mysql ``` Make sure [Git is installed](http://git-scm.com/downloads) on your machine and in your system's `PATH`. ## Usage _Go MySQL Driver_ is an implementation of Go's `database/sql/driver` interface. You only need to import the driver and can use the full [`database/sql`](http://golang.org/pkg/database/sql) API then. Use `mysql` as `driverName` and a valid [DSN](#dsn-data-source-name) as `dataSourceName`: ```go import "database/sql" import _ "github.com/go-sql-driver/mysql" db, err := sql.Open("mysql", "user:password@/dbname") ``` [Examples are available in our Wiki](https://github.com/go-sql-driver/mysql/wiki/Examples "Go-MySQL-Driver Examples"). ### DSN (Data Source Name) The Data Source Name has a common format, like e.g. [PEAR DB](http://pear.php.net/manual/en/package.database.db.intro-dsn.php) uses it, but without type-prefix (optional parts marked by squared brackets): ``` [username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN] ``` A DSN in its fullest form: ``` username:password@protocol(address)/dbname?param=value ``` Except for the databasename, all values are optional. So the minimal DSN is: ``` /dbname ``` If you do not want to preselect a database, leave `dbname` empty: ``` / ``` This has the same effect as an empty DSN string: ``` ``` Alternatively, [Config.FormatDSN](https://godoc.org/github.com/go-sql-driver/mysql#Config.FormatDSN) can be used to create a DSN string by filling a struct. #### Password Passwords can consist of any character. Escaping is **not** necessary. #### Protocol See [net.Dial](http://golang.org/pkg/net/#Dial) for more information which networks are available. In general you should use an Unix domain socket if available and TCP otherwise for best performance. #### Address For TCP and UDP networks, addresses have the form `host:port`. If `host` is a literal IPv6 address, it must be enclosed in square brackets. The functions [net.JoinHostPort](http://golang.org/pkg/net/#JoinHostPort) and [net.SplitHostPort](http://golang.org/pkg/net/#SplitHostPort) manipulate addresses in this form. For Unix domain sockets the address is the absolute path to the MySQL-Server-socket, e.g. `/var/run/mysqld/mysqld.sock` or `/tmp/mysql.sock`. #### Parameters *Parameters are case-sensitive!* Notice that any of `true`, `TRUE`, `True` or `1` is accepted to stand for a true boolean value. Not surprisingly, false can be specified as any of: `false`, `FALSE`, `False` or `0`. ##### `allowAllFiles` ``` Type: bool Valid Values: true, false Default: false ``` `allowAllFiles=true` disables the file Whitelist for `LOAD DATA LOCAL INFILE` and allows *all* files. [*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html) ##### `allowCleartextPasswords` ``` Type: bool Valid Values: true, false Default: false ``` `allowCleartextPasswords=true` allows using the [cleartext client side plugin](http://dev.mysql.com/doc/en/cleartext-authentication-plugin.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network. ##### `allowNativePasswords` ``` Type: bool Valid Values: true, false Default: false ``` `allowNativePasswords=true` allows the usage of the mysql native password method. ##### `allowOldPasswords` ``` Type: bool Valid Values: true, false Default: false ``` `allowOldPasswords=true` allows the usage of the insecure old password method. This should be avoided, but is necessary in some cases. See also [the old_passwords wiki page](https://github.com/go-sql-driver/mysql/wiki/old_passwords). ##### `charset` ``` Type: string Valid Values: <name> Default: none ``` Sets the charset used for client-server interaction (`"SET NAMES <value>"`). If multiple charsets are set (separated by a comma), the following charset is used if setting the charset failes. This enables for example support for `utf8mb4` ([introduced in MySQL 5.5.3](http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html)) with fallback to `utf8` for older servers (`charset=utf8mb4,utf8`). Usage of the `charset` parameter is discouraged because it issues additional queries to the server. Unless you need the fallback behavior, please use `collation` instead. ##### `collation` ``` Type: string Valid Values: <name> Default: utf8_general_ci ``` Sets the collation used for client-server interaction on connection. In contrast to `charset`, `collation` does not issue additional queries. If the specified collation is unavailable on the target server, the connection will fail. A list of valid charsets for a server is retrievable with `SHOW COLLATION`. ##### `clientFoundRows` ``` Type: bool Valid Values: true, false Default: false ``` `clientFoundRows=true` causes an UPDATE to return the number of matching rows instead of the number of rows changed. ##### `columnsWithAlias` ``` Type: bool Valid Values: true, false Default: false ``` When `columnsWithAlias` is true, calls to `sql.Rows.Columns()` will return the table alias and the column name separated by a dot. For example: ``` SELECT u.id FROM users as u ``` will return `u.id` instead of just `id` if `columnsWithAlias=true`. ##### `interpolateParams` ``` Type: bool Valid Values: true, false Default: false ``` If `interpolateParams` is true, placeholders (`?`) in calls to `db.Query()` and `db.Exec()` are interpolated into a single query string with given parameters. This reduces the number of roundtrips, since the driver has to prepare a statement, execute it with given parameters and close the statement again with `interpolateParams=false`. *This can not be used together with the multibyte encodings BIG5, CP932, GB2312, GBK or SJIS. These are blacklisted as they may [introduce a SQL injection vulnerability](http://stackoverflow.com/a/12118602/3430118)!* ##### `loc` ``` Type: string Valid Values: <escaped name> Default: UTC ``` Sets the location for time.Time values (when using `parseTime=true`). *"Local"* sets the system's location. See [time.LoadLocation](http://golang.org/pkg/time/#LoadLocation) for details. Note that this sets the location for time.Time values but does not change MySQL's [time_zone setting](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html). For that see the [time_zone system variable](#system-variables), which can also be set as a DSN parameter. Please keep in mind, that param values must be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed. Alternatively you can manually replace the `/` with `%2F`. For example `US/Pacific` would be `loc=US%2FPacific`. ##### `maxAllowedPacket` ``` Type: decimal number Default: 0 ``` Max packet size allowed in bytes. Use `maxAllowedPacket=0` to automatically fetch the `max_allowed_packet` variable from server. ##### `multiStatements` ``` Type: bool Valid Values: true, false Default: false ``` Allow multiple statements in one query. While this allows batch queries, it also greatly increases the risk of SQL injections. Only the result of the first query is returned, all other results are silently discarded. When `multiStatements` is used, `?` parameters must only be used in the first statement. ##### `parseTime` ``` Type: bool Valid Values: true, false Default: false ``` `parseTime=true` changes the output type of `DATE` and `DATETIME` values to `time.Time` instead of `[]byte` / `string` ##### `readTimeout` ``` Type: decimal number Default: 0 ``` I/O read timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. ##### `strict` ``` Type: bool Valid Values: true, false Default: false ``` `strict=true` enables a driver-side strict mode in which MySQL warnings are treated as errors. This mode should not be used in production as it may lead to data corruption in certain situations. A server-side strict mode, which is safe for production use, can be set via the [`sql_mode`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) system variable. By default MySQL also treats notes as warnings. Use [`sql_notes=false`](http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_sql_notes) to ignore notes. ##### `timeout` ``` Type: decimal number Default: OS default ``` *Driver* side connection timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. To set a server side timeout, use the parameter [`wait_timeout`](http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout). ##### `tls` ``` Type: bool / string Valid Values: true, false, skip-verify, <name> Default: false ``` `tls=true` enables TLS / SSL encrypted connection to the server. Use `skip-verify` if you want to use a self-signed or invalid certificate (server side). Use a custom value registered with [`mysql.RegisterTLSConfig`](http://godoc.org/github.com/go-sql-driver/mysql#RegisterTLSConfig). ##### `writeTimeout` ``` Type: decimal number Default: 0 ``` I/O write timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. ##### System Variables Any other parameters are interpreted as system variables: * `<boolean_var>=<value>`: `SET <boolean_var>=<value>` * `<enum_var>=<value>`: `SET <enum_var>=<value>` * `<string_var>=%27<value>%27`: `SET <string_var>='<value>'` Rules: * The values for string variables must be quoted with ' * The values must also be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed! (which implies values of string variables must be wrapped with `%27`) Examples: * `autocommit=1`: `SET autocommit=1` * [`time_zone=%27Europe%2FParis%27`](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html): `SET time_zone='Europe/Paris'` * [`tx_isolation=%27REPEATABLE-READ%27`](https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tx_isolation): `SET tx_isolation='REPEATABLE-READ'` #### Examples ``` user@unix(/path/to/socket)/dbname ``` ``` root:pw@unix(/tmp/mysql.sock)/myDatabase?loc=Local ``` ``` user:password@tcp(localhost:5555)/dbname?tls=skip-verify&autocommit=true ``` Treat warnings as errors by setting the system variable [`sql_mode`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html): ``` user:password@/dbname?sql_mode=TRADITIONAL ``` TCP via IPv6: ``` user:password@tcp([de:ad:be:ef::ca:fe]:80)/dbname?timeout=90s&collation=utf8mb4_unicode_ci ``` TCP on a remote host, e.g. Amazon RDS: ``` id:password@tcp(your-amazonaws-uri.com:3306)/dbname ``` Google Cloud SQL on App Engine (First Generation MySQL Server): ``` user@cloudsql(project-id:instance-name)/dbname ``` Google Cloud SQL on App Engine (Second Generation MySQL Server): ``` user@cloudsql(project-id:regionname:instance-name)/dbname ``` TCP using default port (3306) on localhost: ``` user:password@tcp/dbname?charset=utf8mb4,utf8&sys_var=esc%40ped ``` Use the default protocol (tcp) and host (localhost:3306): ``` user:password@/dbname ``` No Database preselected: ``` user:password@/ ``` ### `LOAD DATA LOCAL INFILE` support For this feature you need direct access to the package. Therefore you must change the import path (no `_`): ```go import "github.com/go-sql-driver/mysql" ``` Files must be whitelisted by registering them with `mysql.RegisterLocalFile(filepath)` (recommended) or the Whitelist check must be deactivated by using the DSN parameter `allowAllFiles=true` ([*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)). To use a `io.Reader` a handler function must be registered with `mysql.RegisterReaderHandler(name, handler)` which returns a `io.Reader` or `io.ReadCloser`. The Reader is available with the filepath `Reader::<name>` then. Choose different names for different handlers and `DeregisterReaderHandler` when you don't need it anymore. See the [godoc of Go-MySQL-Driver](http://godoc.org/github.com/go-sql-driver/mysql "golang mysql driver documentation") for details. ### `time.Time` support The default internal output type of MySQL `DATE` and `DATETIME` values is `[]byte` which allows you to scan the value into a `[]byte`, `string` or `sql.RawBytes` variable in your programm. However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical opposite in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](http://golang.org/pkg/time/#Location) with the `loc` DSN parameter. **Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes). Alternatively you can use the [`NullTime`](http://godoc.org/github.com/go-sql-driver/mysql#NullTime) type as the scan destination, which works with both `time.Time` and `string` / `[]byte`. ### Unicode support Since version 1.1 Go-MySQL-Driver automatically uses the collation `utf8_general_ci` by default. Other collations / charsets can be set using the [`collation`](#collation) DSN parameter. Version 1.0 of the driver recommended adding `&charset=utf8` (alias for `SET NAMES utf8`) to the DSN to enable proper UTF-8 support. This is not necessary anymore. The [`collation`](#collation) parameter should be preferred to set another collation / charset than the default. See http://dev.mysql.com/doc/refman/5.7/en/charset-unicode.html for more details on MySQL's Unicode support. ## Testing / Development To run the driver tests you may need to adjust the configuration. See the [Testing Wiki-Page](https://github.com/go-sql-driver/mysql/wiki/Testing "Testing") for details. Go-MySQL-Driver is not feature-complete yet. Your help is very appreciated. If you want to contribute, you can work on an [open issue](https://github.com/go-sql-driver/mysql/issues?state=open) or review a [pull request](https://github.com/go-sql-driver/mysql/pulls). See the [Contribution Guidelines](https://github.com/go-sql-driver/mysql/blob/master/CONTRIBUTING.md) for details. --------------------------------------- ## License Go-MySQL-Driver is licensed under the [Mozilla Public License Version 2.0](https://raw.github.com/go-sql-driver/mysql/master/LICENSE) Mozilla summarizes the license scope as follows: > MPL: The copyleft applies to any files containing MPLed code. That means: * You can **use** the **unchanged** source code both in private and commercially * When distributing, you **must publish** the source code of any **changed files** licensed under the MPL 2.0 under a) the MPL 2.0 itself or b) a compatible license (e.g. GPL 3.0 or Apache License 2.0) * You **needn't publish** the source code of your library as long as the files licensed under the MPL 2.0 are **unchanged** Please read the [MPL 2.0 FAQ](http://www.mozilla.org/MPL/2.0/FAQ.html) if you have further questions regarding the license. You can read the full terms here: [LICENSE](https://raw.github.com/go-sql-driver/mysql/master/LICENSE) ![Go Gopher and MySQL Dolphin](https://raw.github.com/wiki/go-sql-driver/mysql/go-mysql-driver_m.jpg "Golang Gopher transporting the MySQL Dolphin in a wheelbarrow")
{ "pile_set_name": "Github" }
################################################################################ # # Checks if an error has occurred and if so rolls back the entire transaction. # Only source this file when such behavior is needed. # # Since this file needs to be sourced _after_ the statement that we want to check # for error, any unacceptable errors will have already caused the test to fail. # If we get this far, we know that the error was a valid one. # # Typical usage in testcase: # ------------------------------------------------------------------- # --error 0, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT # UPDATE t1 SET `int1` = `int1` - 4 WHERE `pk` < 25 LIMIT 1; # --source suite/stress_tx_rr/include/check_for_error_rollback.inc # ------------------------------------------------------------------- # # Examples of "valid" error types in transactional testing: # 1205 - ER_LOCK_WAIT_TIMEOUT # 1213 - ER_LOCK_DEADLOCK # 1020 - ER_CHECKREAD (Falcon: "Record has changed since last read") # # In some situations duplicate key errors etc. are also valid. # # We keep an approximate count of the number of errors / rollbacks. # We don't distinguish between error types, as this would require extra queries, # reducing concurrency. # # We do an explicit rollback to make sure all engines have identical behavior on # transactional errors (some engines only roll back the last statement in some # cases). # We don't show this in the result file because we don't know when it will # occur and we don't want diffs because of legitimate ROLLBACKs. If, however # we want to go back and trace ROLLBACKS of this kind, then we need another # solution. # # At this time we skip the rest of the test to avoid rsult file diff problems # in error situations vs. non-error situations in later parts of the test, # e.g. repeatable read checking (requires some output to be useful). # ################################################################################ --disable_query_log # (Re-) set the error variable in case it has been set to a different value previously. # This value may be read by the wrapping test script to check if there really # was an error or not. let $error= 0; if ($mysql_errno) { # Last statement sent to the server resulted in an error (0 means no error). # Set error variable, because this is used by wrapping tests to determine whether or not # to continue with other statements in the same transaction. If set, this indicates that # the last statement executed before calling this script resulted in an error. let $error= $mysql_errno; ## Old code for determining error type... #let $deadlock= `SELECT IF($mysql_errno = 1213, 1, 0)`; #let $timeout= `SELECT IF($mysql_errno = 1205, 1, 0)`; #if ($deadlock) { ... } (etc.) # Do a full rollback of the current transaction. ROLLBACK; # update statistics # TODO: Only do this every n times (e.g. n = 10 or 100) to reduce contention. # An idea is to use some MOD expression to determine this (e.g. mod of timestamp or conn_id). --error 0, ER_LOCK_DEADLOCK, ER_LOCK_WAIT_TIMEOUT, ER_CHECKREAD UPDATE statistics SET tx_errors = tx_errors + 1; --skip Skip rest of the test due to transactional error (deadlock, timeout, etc.) } --enable_query_log
{ "pile_set_name": "Github" }
j2deployer j2deployer ovwebusr OvW*busr1 cxsdk kdsxc root owaspbwa
{ "pile_set_name": "Github" }
<!ENTITY licenseKey.label "License key:"> <!ENTITY licenseInvoice.label "Transaction ID:"> <!ENTITY warning1.label "Extended features are enabled only if valid license data are provided and license is activated"> <!ENTITY warning2.label "To activate your license, please fill in the data below and restart BlueGriffon. You must be connected to the Internet at that time."> <!ENTITY deactivate.label "Deactivate current license"> <!ENTITY activate.label "Activate"> <!ENTITY troubleshoot.label 'Request a reset link'> <!ENTITY helpNeeded.label "TROUBLESHOOTING: If you have issues activating your license, it could be because you already activated it in the past and forgot (or could not) deactivate it before a machine swap, a disk crash, etc. In that case, you can request a full reset of all your license activations using the button below. The reset link will be sent to the purchaser of the license and recipient of the invoice. Please provide the Transaction ID above to enable that button.">
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> <device id="retina5_9" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/> <capability name="Constraints to layout margins" minToolsVersion="6.0"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="tne-QT-ifu"> <objects> <viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController"> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="375" height="812"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="atM-2i-eQj"> <rect key="frame" x="16" y="407" width="343" height="371"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> </textView> <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="jWj-Jj-RMv"> <rect key="frame" x="31" y="44" width="315" height="185"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstAttribute="height" constant="185" id="z4y-B2-C0J"/> </constraints> <string key="text"> Exploits by Ian Beer and bazad Post exploitation is mostly from Electra, and things from my own. Powered by #jelbrekLib Put together by @Jakeashacks :)</string> <fontDescription key="fontDescription" type="system" pointSize="16"/> <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/> </textView> <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3bz-we-0qx"> <rect key="frame" x="31" y="237" width="315" height="162"/> <subviews> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tweaks" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fkj-X0-Qd5"> <rect key="frame" x="164" y="40" width="58" height="21"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8BR-Lg-oOm"> <rect key="frame" x="85" y="74" width="145" height="54"/> <fontDescription key="fontDescription" type="system" pointSize="35"/> <state key="normal" title="Jailbreak!"/> <connections> <action selector="jailbrek:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Jwq-Ec-P4q"/> </connections> </button> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jTQ-DU-ItI"> <rect key="frame" x="122" y="120" width="70" height="34"/> <fontDescription key="fontDescription" type="system" pointSize="18"/> <state key="normal" title="Uninstall"/> <connections> <action selector="uninstall:" destination="BYZ-38-t0r" eventType="touchUpInside" id="7uA-tG-wu1"/> </connections> </button> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="g95-o5-49y"> <rect key="frame" x="57" y="1" width="51" height="31"/> </switch> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Install iSuperSU" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ERm-6d-k7y"> <rect key="frame" x="136" y="6" width="121" height="21"/> <fontDescription key="fontDescription" type="system" pointSize="17"/> <nil key="textColor"/> <nil key="highlightedColor"/> </label> <switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="du2-Os-GbV"> <rect key="frame" x="57" y="35" width="51" height="31"/> </switch> </subviews> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <constraints> <constraint firstItem="du2-Os-GbV" firstAttribute="centerY" secondItem="fkj-X0-Qd5" secondAttribute="centerY" id="2Iw-9z-9fl"/> <constraint firstItem="ERm-6d-k7y" firstAttribute="leading" secondItem="g95-o5-49y" secondAttribute="trailing" constant="30" id="2lO-Rb-erS"/> <constraint firstItem="8BR-Lg-oOm" firstAttribute="centerX" secondItem="3bz-we-0qx" secondAttribute="centerX" id="53Z-mi-O2C"/> <constraint firstItem="jTQ-DU-ItI" firstAttribute="bottom" secondItem="3bz-we-0qx" secondAttribute="bottomMargin" id="Fh4-zl-4Oe"/> <constraint firstItem="du2-Os-GbV" firstAttribute="top" secondItem="3bz-we-0qx" secondAttribute="top" constant="35" id="Vyu-Sx-03y"/> <constraint firstItem="du2-Os-GbV" firstAttribute="leading" secondItem="8BR-Lg-oOm" secondAttribute="leading" constant="-28" id="YnG-al-JmJ"/> <constraint firstItem="jTQ-DU-ItI" firstAttribute="centerX" secondItem="8BR-Lg-oOm" secondAttribute="centerX" id="aee-cZ-Bf5"/> <constraint firstItem="8BR-Lg-oOm" firstAttribute="top" secondItem="du2-Os-GbV" secondAttribute="bottom" constant="8" symbolic="YES" id="g0h-Bn-cfw"/> <constraint firstItem="fkj-X0-Qd5" firstAttribute="leading" secondItem="du2-Os-GbV" secondAttribute="trailing" constant="58" id="oqv-0s-DvW"/> <constraint firstAttribute="bottom" secondItem="8BR-Lg-oOm" secondAttribute="bottom" constant="34" id="qvd-ZX-jHU"/> <constraint firstItem="g95-o5-49y" firstAttribute="centerY" secondItem="ERm-6d-k7y" secondAttribute="centerY" id="tz9-QI-oq2"/> <constraint firstItem="g95-o5-49y" firstAttribute="top" secondItem="3bz-we-0qx" secondAttribute="top" constant="1" id="uze-W3-I1O"/> <constraint firstItem="ERm-6d-k7y" firstAttribute="leading" secondItem="fkj-X0-Qd5" secondAttribute="leading" constant="-28" id="v3r-X6-lD8"/> </constraints> </view> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="jWj-Jj-RMv" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="10m-Qh-7Q6"/> <constraint firstItem="3bz-we-0qx" firstAttribute="top" secondItem="jWj-Jj-RMv" secondAttribute="bottom" constant="8" symbolic="YES" id="7cz-gI-URT"/> <constraint firstItem="jWj-Jj-RMv" firstAttribute="trailing" secondItem="3bz-we-0qx" secondAttribute="trailing" id="Esj-h0-Npk"/> <constraint firstItem="atM-2i-eQj" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="Hd6-RG-mnr"/> <constraint firstItem="atM-2i-eQj" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="Rd3-l4-1h1"/> <constraint firstItem="atM-2i-eQj" firstAttribute="top" secondItem="3bz-we-0qx" secondAttribute="bottom" constant="8" symbolic="YES" id="SDy-qO-bpR"/> <constraint firstItem="atM-2i-eQj" firstAttribute="bottom" secondItem="6Tk-OE-BBY" secondAttribute="bottom" id="Yne-Kz-E6j"/> <constraint firstItem="jWj-Jj-RMv" firstAttribute="leading" secondItem="3bz-we-0qx" secondAttribute="leading" id="adB-oh-A3F"/> <constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="jWj-Jj-RMv" secondAttribute="trailing" constant="29" id="f0K-Wk-IZk"/> <constraint firstItem="jWj-Jj-RMv" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="31" id="xde-1O-7hE"/> </constraints> <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> </view> <connections> <outlet property="enableTweaks" destination="du2-Os-GbV" id="hFO-S0-DRb"/> <outlet property="installiSuperSU" destination="g95-o5-49y" id="6uH-wE-KSP"/> <outlet property="jailbreakButton" destination="8BR-Lg-oOm" id="NnW-YN-28w"/> <outlet property="logs" destination="atM-2i-eQj" id="LLd-9z-Ldu"/> </connections> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="112.8" y="114.53201970443351"/> </scene> </scenes> </document>
{ "pile_set_name": "Github" }
package reviewing var DefaultReviews = []Review{ {BeerID: 1, FirstName: "Joe", LastName: "Tribiani", Score: 5, Text: "This is good but this is not pizza!"}, {BeerID: 2, FirstName: "Chandler", LastName: "Bing", Score: 1, Text: "I would SO NOT drink this ever again."}, {BeerID: 1, FirstName: "Ross", LastName: "Geller", Score: 4, Text: "Drank while on a break, was pretty good!"}, {BeerID: 2, FirstName: "Phoebe", LastName: "Buffay", Score: 2, Text: "Wasn't that great, so I gave it to my smelly cat."}, {BeerID: 1, FirstName: "Monica", LastName: "Geller", Score: 5, Text: "AMAZING! Like Chandler's jokes!"}, {BeerID: 2, FirstName: "Rachel", LastName: "Green", Score: 5, Text: "So yummy, just like my beef and custard trifle."}, }
{ "pile_set_name": "Github" }
# Copyright (c) 1999-2006, International Business Machines Corporation and # others. All Rights Reserved. # A list of EBCDIC UCM's to build # ibm-37 and ibm-1047 are already mentioned in makedata.mak and Makefile.in UCM_SOURCE_EBCDIC = ebcdic-xml-us.ucm\ ibm-1025_P100-1995.ucm ibm-1026_P100-1995.ucm ibm-1097_P100-1995.ucm\ ibm-1112_P100-1995.ucm ibm-1122_P100-1999.ucm ibm-1130_P100-1997.ucm\ ibm-1132_P100-1998.ucm ibm-1137_P100-1999.ucm ibm-1364_P110-1997.ucm\ ibm-1371_P100-1999.ucm ibm-1388_P103-2001.ucm ibm-1390_P110-2003.ucm\ ibm-1399_P110-2003.ucm ibm-870_P100-1995.ucm ibm-875_P100-1995.ucm\ ibm-838_P100-1995.ucm ibm-918_P100-1995.ucm ibm-930_P120-1999.ucm\ ibm-933_P110-1995.ucm ibm-935_P110-1999.ucm ibm-937_P110-1999.ucm\ ibm-939_P120-1999.ucm ibm-1123_P100-1995.ucm ibm-1140_P100-1997.ucm\ ibm-1141_P100-1997.ucm ibm-1142_P100-1997.ucm ibm-1143_P100-1997.ucm\ ibm-1144_P100-1997.ucm ibm-1145_P100-1997.ucm ibm-1146_P100-1997.ucm\ ibm-1147_P100-1997.ucm ibm-1148_P100-1997.ucm ibm-1149_P100-1997.ucm\ ibm-1153_P100-1999.ucm ibm-1154_P100-1999.ucm ibm-1155_P100-1999.ucm\ ibm-1156_P100-1999.ucm ibm-1157_P100-1999.ucm ibm-1158_P100-1999.ucm\ ibm-1160_P100-1999.ucm ibm-1164_P100-1999.ucm ibm-871_P100-1995.ucm\ ibm-12712_P100-1998.ucm ibm-16804_X110-1999.ucm ibm-273_P100-1995.ucm\ ibm-277_P100-1995.ucm ibm-278_P100-1995.ucm ibm-280_P100-1995.ucm\ ibm-284_P100-1995.ucm ibm-285_P100-1995.ucm ibm-290_P100-1995.ucm\ ibm-297_P100-1995.ucm ibm-420_X120-1999.ucm ibm-424_P100-1995.ucm\ ibm-4517_P100-2005.ucm ibm-4899_P100-1998.ucm ibm-4971_P100-1999.ucm\ ibm-500_P100-1995.ucm ibm-5123_P100-1999.ucm ibm-803_P100-1999.ucm\ ibm-8482_P100-1999.ucm ibm-9067_X100-2005.ucm ibm-16684_P110-2003.ucm
{ "pile_set_name": "Github" }
data "terraform_remote_state" "network" { backend = "s3" config { bucket = "tfstate-pragmatic-terraform-on-aws" key = "network/terraform.tfstate" region = "ap-northeast-1" } }
{ "pile_set_name": "Github" }