text
stringlengths
2
99k
meta
dict
/* * Copyright (c) 2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * */ #if swift(>=3) public extension FBSnapshotTestCase { public func FBSnapshotVerifyView(_ view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line) } public func FBSnapshotVerifyLayer(_ layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line) } private func FBSnapshotVerifyViewOrLayer(_ viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { let envReferenceImageDirectory = self.getReferenceImageDirectory(withDefault: FB_REFERENCE_IMAGE_DIR) var error: NSError? var comparisonSuccess = false if let envReferenceImageDirectory = envReferenceImageDirectory { for suffix in suffixes { let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)" if viewOrLayer.isKind(of: UIView.self) { do { try compareSnapshot(of: viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance) comparisonSuccess = true } catch let error1 as NSError { error = error1 comparisonSuccess = false } } else if viewOrLayer.isKind(of: CALayer.self) { do { try compareSnapshot(of: viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance) comparisonSuccess = true } catch let error1 as NSError { error = error1 comparisonSuccess = false } } else { assertionFailure("Only UIView and CALayer classes can be snapshotted") } assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line) if comparisonSuccess || recordMode { break } assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line) } } else { XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.") } } func assert(_ assertion: Bool, message: String, file: StaticString, line: UInt) { if !assertion { XCTFail(message, file: file, line: line) } } } #else public extension FBSnapshotTestCase { public func FBSnapshotVerifyView(view: UIView, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { FBSnapshotVerifyViewOrLayer(view, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line) } public func FBSnapshotVerifyLayer(layer: CALayer, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { FBSnapshotVerifyViewOrLayer(layer, identifier: identifier, suffixes: suffixes, tolerance: tolerance, file: file, line: line) } private func FBSnapshotVerifyViewOrLayer(viewOrLayer: AnyObject, identifier: String = "", suffixes: NSOrderedSet = FBSnapshotTestCaseDefaultSuffixes(), tolerance: CGFloat = 0, file: StaticString = #file, line: UInt = #line) { let envReferenceImageDirectory = self.getReferenceImageDirectoryWithDefault(FB_REFERENCE_IMAGE_DIR) var error: NSError? var comparisonSuccess = false if let envReferenceImageDirectory = envReferenceImageDirectory { for suffix in suffixes { let referenceImagesDirectory = "\(envReferenceImageDirectory)\(suffix)" if viewOrLayer.isKindOfClass(UIView) { do { try compareSnapshotOfView(viewOrLayer as! UIView, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance) comparisonSuccess = true } catch let error1 as NSError { error = error1 comparisonSuccess = false } } else if viewOrLayer.isKindOfClass(CALayer) { do { try compareSnapshotOfLayer(viewOrLayer as! CALayer, referenceImagesDirectory: referenceImagesDirectory, identifier: identifier, tolerance: tolerance) comparisonSuccess = true } catch let error1 as NSError { error = error1 comparisonSuccess = false } } else { assertionFailure("Only UIView and CALayer classes can be snapshotted") } assert(recordMode == false, message: "Test ran in record mode. Reference image is now saved. Disable record mode to perform an actual snapshot comparison!", file: file, line: line) if comparisonSuccess || recordMode { break } assert(comparisonSuccess, message: "Snapshot comparison failed: \(error)", file: file, line: line) } } else { XCTFail("Missing value for referenceImagesDirectory - Set FB_REFERENCE_IMAGE_DIR as Environment variable in your scheme.") } } func assert(assertion: Bool, message: String, file: StaticString, line: UInt) { if !assertion { XCTFail(message, file: file, line: line) } } } #endif
{ "pile_set_name": "Github" }
# This source code refers to The Go Authors for copyright purposes. # The master list of authors is in the main Go distribution, # visible at http://tip.golang.org/AUTHORS.
{ "pile_set_name": "Github" }
The nice thing is that we can define the windows used for gradient calculation by first selecting a sufficient aligned window, and then sub-selecting the set of predictions we want, which can be a subset of the total number of predictions arising from the window. There are a couple design decisions to be made. 1. Truncate each wav file to the nearest maximal receptive field that is needed to produce an integer number of mels. 2. Choose some number of consecutive windows to use. (Or, we may even want to use skipping windows) 3. Back-calculate the receptive field needed for the desired timestep calculations, using rfield. 4. The mask can be used to achieve out-of-register predictions 5. The picking logic could be designed in such a way to cluster, or not. Either way, the effect of "clumpiness" of data, due to the batch size N, is one that should be explored. rfield has init_nv, but it doesn't have the analogous function to compute the number of output elements that result from a given number of input elements. But, let's review how init_nv works: init_nv moves up the chain of parents. on each node, it calls _num_in_elem, which returns the required number of input elements to achieve the requested number of output elements. It repeats this until it gets to the end, and then calls _expand_stats_. _expand_stats_ does the opposite: it moves down the chain towards the children, calling _num_out_elem for the given input elements. We can do the reverse as well: start at the parent with the 'available number', call 'expand_stats', then call init_nv with the final number Is there a better way to do that? We really only need a forward and then reverse pass.
{ "pile_set_name": "Github" }
/* http://meyerweb.com/eric/tools/css/reset/ */ /* v1.0 | 20080212 */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } body { line-height: 1; } ol, ul { list-style: none; } blockquote, q { quotes: none; } blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; } /* remember to define focus styles! */ :focus { outline: 0; } /* remember to highlight inserts somehow! */ ins { text-decoration: none; } del { text-decoration: line-through; } /* tables still need 'cellspacing="0"' in the markup */ table { border-collapse: collapse; border-spacing: 0; }
{ "pile_set_name": "Github" }
document.title += ' ' + art.dialog.fn.version; // 运行代码 $.fn.runCode = function () { var getText = function(elems) { var ret = "", elem; for ( var i = 0; elems[i]; i++ ) { elem = elems[i]; if ( elem.nodeType === 3 || elem.nodeType === 4 ) { ret += elem.nodeValue; } else if ( elem.nodeType !== 8 ) { ret += getText( elem.childNodes ); }; }; return ret; }; var code = getText(this); new Function(code).call(window); return this; }; $(function(){ // 按钮触发代码运行 $(document).bind('click', function(event){ var target = event.target, $target = $(target); if ($target.hasClass('runCode')) { $('#' + target.name).runCode(); }; }); // 跳转到头部 var $footer = $('#footer'); if (!$footer[0]) return; $footer.bind('click', function () { window.scrollTo(0, 0); return false; }).css('cursor', 'pointer')[0].title = '回到页头'; }); // 皮肤选择 window._demoSkin = function () { art.dialog({ id: 'demoSkin', padding: '15px', title: 'artDialog皮肤展示', content: _demoSkin.tmpl }); }; _demoSkin.tmpl = function (data) { var html = ['<table class="zebra" style="width:480px"><tbody>']; for (var i = 0, length = data.length; i < length; i ++) { html.push('<tr class="'); html.push(i%2 ? 'odd' : ''); html.push('"><th style="width:7em"><a href="?demoSkin='); html.push(data[i].name); html.push('">'); html.push(data[i].name); html.push('</a></th><td>'); html.push(data[i].about); html.push('</td></tr>'); }; html.push('</tbody></table>'); return html.join(''); }([ {name: 'default', about: 'artDialog默认皮肤,简洁,纯CSS设计,无图片,采用css3渐进增强'}, {name: 'aero', about: 'artDialog 2+标志性的皮肤,windows7毛玻璃风格。提供PSD源文件 <a href="http://code.google.com/p/artdialog/downloads/detail?name=aero.psd&can=2&q=" target="_blank">下载</a>'}, {name: 'chrome', about: 'chrome浏览器(xp)风格'}, {name: 'opera', about: 'opera 11浏览器内置对话框风格'}, {name: 'simple', about: '简单风格,无图片,不显示标题'}, {name: 'idialog', about: '苹果风格,iPad Safari或Mac Safari关闭按钮将在左边显示'}, {name: 'twitter', about: 'twitter风格,无图片'}, {name: 'blue', about: '蓝色风格'}, {name: 'black', about: '黑色风格'}, {name: 'green', about: '绿色风格'} ]); $(function () { var $skin = $('#nav-skin'); if (!$skin[0]) return; $skin.bind('click', function () { _demoSkin(); return false; }); // 点亮导航 var links = $('#nav')[0].getElementsByTagName("a"), URL = document.URL.split('#')[0], last = URL.charAt(URL.length - 1); if (last === '/') { links[0].className += ' select'; } else { for (var i=0; i<links.length; i++) { if (URL.toLowerCase().indexOf(links[i].href.toLowerCase()) !== -1) { links[i].className += ' select'; }; }; }; }); // firebug (function () { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = 'https://getfirebug.com/firebug-lite.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); // google-analytics var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-19823759-2']); _gaq.push(['_setDomainName', '.planeart.cn']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
{ "pile_set_name": "Github" }
<table class="typeindex" border="1"> <tr style="background-color:cornflowerblue"> <td> <table class="category"> <tr><td><strong></strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>Nominals</strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>Clauses</strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>Modifier words</strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>Function Words</strong></td></tr> </table> </td> </tr> <tr> <td style="background-color:darkseagreen"> <table class="category"> <tr><td><strong>Core arguments</strong></td></tr> </table> </td> <td> <table class="category"> <tr> <td><a>nsubj</a></td> </tr> <tr> <td>↳<a>nsubj:pass</a></td> </tr> <tr> <td><a>obj</a></td> </tr> <tr> <td><a>iobj</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>csubj</a></td> </tr> <tr> <td>↳<a>csubj:pass</a></td> </tr> <tr> <td><a>ccomp</a></td> </tr> <tr> <td><a>xcomp</a></td> </tr> </table> </td> <td></td><td></td> </tr> <tr> <td style="background-color:darkseagreen"> <table class="category"> <tr><td><strong>Non-core dependents</strong></td></tr> </table> </td> <td> <table class="category"> <tr> <td><a>obl</a></td> </tr> <tr> <td>↳<a>obl:agent</a></td> </tr> <tr> <td>↳<a>obl:patient</a></td> </tr> <tr> <td>↳<a>obl:tmod</a></td> </tr> <tr> <td><a>vocative</a></td> </tr> <tr> <td><a>expl</a></td> </tr> <tr> <td><a>dislocated</a></td> </tr> <tr> <td>↳<a>dislocated:vo</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>advcl</a></td> </tr> <tr> <td>↳<a>advcl:coverb</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>advmod</a>*</td> </tr> <tr> <td>↳<a>advmod:df</a></td> </tr> <tr> <td><a>discourse</a></td> </tr> <tr> <td>↳<a>discourse:sp</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>aux</a></td> </tr> <tr> <td>↳<a>aux:pass</a></td> </tr> <tr> <td><a>cop</a></td> </tr> <tr> <td><a>mark</a></td> </tr> <tr> <td>↳<a>mark:adv</a></td> </tr> <tr> <td>↳<a>mark:rel</a></td> </tr> </table> </td> </tr> <tr> <td style="background-color:darkseagreen"> <table class="category"> <tr><td><strong>Nominal dependents</strong></td></tr> </table> </td> <td> <table class="category"> <tr> <td><a>nmod</a></td> </tr> <tr> <td><a>appos</a></td> </tr> <tr> <td><a>nummod</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>acl</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>amod</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>det</a></td> </tr> <tr> <td><a>clf</a></td> </tr> <tr> <td><a>case</a></td> </tr> <tr> <td>↳<a>case:loc</a></td> </tr> </table> </td> </tr> <tr style="background-color:cornflowerblue"> <td> <table class="category"> <tr><td><strong>Coordination</strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>MWE</strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>Loose</strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>Special</strong></td></tr> </table> </td> <td> <table class="category"> <tr><td><strong>Other</strong></td></tr> </table> </td> </tr> <tr> <td> <table class="category"> <tr> <td><a>conj</a></td> </tr> <tr> <td><a>cc</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>fixed</a></td> </tr> <tr> <td><a>flat</a></td> </tr> <tr> <td><a>compound</a></td> </tr> <tr> <td>↳<a>compound:dir</a></td> </tr> <tr> <td>↳<a>compound:ext</a></td> </tr> <tr> <td>↳<a>compound:quant</a></td> </tr> <tr> <td>↳<a>compound:vo</a></td> </tr> <tr> <td>↳<a>compound:vv</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>list</a></td> </tr> <tr> <td><a>parataxis</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>orphan</a></td> </tr> <tr> <td><a>goeswith</a></td> </tr> <tr> <td><a>reparandum</a></td> </tr> </table> </td> <td> <table class="category"> <tr> <td><a>punct</a></td> </tr> <tr> <td><a>root</a></td> </tr> <tr> <td><a>dep</a></td> </tr> </table> </td> </tr> </table> \* The `advmod` relation is used for modifiers not only of predicates but also of other modifier words.
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE project [ <!-- Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0, which is available at http://www.eclipse.org/legal/epl-2.0. This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License v. 2.0 are satisfied: GNU General Public License, version 2 with the GNU Classpath Exception, which is available at https://www.gnu.org/software/classpath/license.html. SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 --> <!ENTITY commonSetup SYSTEM "../../../../../config/properties.xml"> <!ENTITY commonBuild SYSTEM "../../../../../config/common.xml"> <!ENTITY testproperties SYSTEM "build.properties"> ]> <project name="ejb-ee-txcheckpoint-simpletx-App" default="usage" basedir="."> &commonSetup; &commonBuild; &testproperties; <target name="all" depends="clean,build,create-resources,deploy,run,undeploy,delete-resources"/> <target name="deployapp" depends="clean,build,create-resources,deploy"/> <target name="undeployapp" depends="undeploy,delete-resources"/> <target name="clean" depends="init-common"> <antcall target="clean-common"/> </target> <target name="compile" depends="clean"> <antcall target="compile-common"> <param name="src" value="ejb"/> </antcall> <antcall target="compile-common"> <param name="src" value="client"/> </antcall> </target> <target name="build" depends="compile"> <antcall target="build-ear-common"> <param name="ejbjar.classes" value="**/**.class" /> <param name="appclientjar.classes" value="**/*Client*.class, **/*SFSB*.class" /> </antcall> </target> <target name="deploy" depends="init-common"> <antcall target="execute-ejb-sql-common"> <param name="sql.file" value="sql/create_pointbase.sql"/> </antcall> <antcall target="deploy-common"/> </target> <target name="create-resources" depends="init-common"> <!-- <antcall target="asadmin-batch-common"> <param name="asadmin.file" value="create_resources.asadmin"/> </antcall> --> </target> <target name="delete-resources" depends="init-common"> <!-- <antcall target="asadmin-batch-common"> <param name="asadmin.file" value="delete_resources.asadmin"/> </antcall> --> </target> <target name="run" depends="init-common"> <antcall target="runclient-common"/> </target> <target name="undeploy" depends="init-common"> <antcall target="undeploy-common"/> <antcall target="execute-ejb-sql-common"> <param name="sql.file" value="sql/drop_pointbase.sql"/> </antcall> </target> <target name="usage"> <antcall target="usage-common"/> <echo> ant create-resources Create all destinations and connection factories ant delete-resources Delete all destinations and connection factories </echo> </target> </project>
{ "pile_set_name": "Github" }
{-# OPTIONS_GHC -fno-warn-type-defaults #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE ScopedTypeVariables #-} module Course.FunctorTest where import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (testCase, (@?=)) import Test.Tasty.QuickCheck (testProperty) import Course.Core import Course.ExactlyOne (ExactlyOne (..)) import Course.Functor (void, (<$), (<$>)) import Course.List (List (..)) import Course.Optional (Optional (..)) test_Functor :: TestTree test_Functor = testGroup "Functor" [ idTest , listTest , optionalTest , functionTest , anonMapTest , voidTest ] idTest :: TestTree idTest = testCase "ExactlyOne" $ (+1) <$> ExactlyOne 2 @?= ExactlyOne 3 listTest :: TestTree listTest = testGroup "List" [ testCase "empty list" $ (+1) <$> Nil @?= Nil , testCase "increment" $ (+1) <$> (1 :. 2 :. 3 :. Nil) @?= (2 :. 3 :. 4 :. Nil) ] optionalTest :: TestTree optionalTest = testGroup "Optional" [ testCase "Empty" $ (+1) <$> Empty @?= Empty , testCase "Full" $ (+1) <$> Full 2 @?= Full 3 ] functionTest :: TestTree functionTest = testCase "(->)" $ ((+1) <$> (*2)) 8 @?= 17 anonMapTest :: TestTree anonMapTest = testGroup "(<$)" [ testCase "Map 7" $ 7 <$ (1 :. 2 :. 3 :. Nil) @?= (7 :. 7 :. 7 :. Nil) , testProperty "Always maps a constant value over List" $ \x a b c -> (x :: Integer) <$ ((a :. b :. c :. Nil) :: List Integer) == (x :. x :. x :. Nil) , testProperty "Always maps a constant value over Full (Optional)" $ \(x :: Integer) (q :: Integer) -> x <$ Full q == Full x ] voidTest :: TestTree voidTest = testGroup "void" [ testCase "List" $ void (1 :. 2 :. 3 :. Nil) @?= () :. () :. () :. Nil , testCase "Full" $ void (Full 7) @?= Full () , testCase "Empty" $ void Empty @?= Empty , testCase "(->)" $ void (+10) 5 @?= () ]
{ "pile_set_name": "Github" }
<?php return array( 'name' => array( 'not_empty' => 'Role name must not be empty', 'min_length' => 'Name of Role must be at least :param2 characters long', 'max_length' => 'Name of Role must be less than :param2 characters long', ), 'description' => array( 'max_length' => 'Description of Role must be less than :param2 characters long', ), );
{ "pile_set_name": "Github" }
\usepackage[top=1in, bottom=1in, left=1.0in, right=1.0in]{geometry} \usepackage{fancyhdr} \pagestyle{fancy} \lhead{} \rhead{\footnotesize{P0443}} \chead{} \lfoot{} \rfoot{\thepage} \cfoot{}
{ "pile_set_name": "Github" }
#pragma once #include "util/window_ex.h" #include "module/service/photo_service.h" namespace nim_comp { /** @class BlackListWindow * @brief 黑名单窗口 * @copyright (c) 2016, NetEase Inc. All rights reserved * @date 2016/09/19 */ class BlackListWindow : public WindowEx { public: BlackListWindow(); virtual ~BlackListWindow(); //覆盖虚函数 virtual std::wstring GetSkinFolder() override; virtual std::wstring GetSkinFile() override; virtual std::wstring GetWindowClassName() const override { return kClassName; }; virtual std::wstring GetWindowId() const override { return kClassName; }; /** * 窗口初始化函数 * @return void 无返回值 */ virtual void InitWindow() override; /** * 刷新黑名单窗口 * @return void 无返回值 */ void RefreshBlackList(); private: /** * 处理解除按钮的单击消息 * @param[in] msg 消息的相关信息 * @return bool true 继续传递控件消息,false 停止传递控件消息 */ bool OnRemoveBtnClicked(ui::EventArgs *args); /** * 根据用户名片重置列表中对应的黑名单项 * @param[in] info 用户名片 * @return void 无返回值 */ void ResetUserInfo(const nim::UserNameCard &info); /** * 根据用户名片向列表中添加黑名单项 * @param[in] info 用户名片 * @return void 无返回值 */ void AddBlackListMember(const nim::UserNameCard &info); /** * 响应用户信息改变的回调函数 * @param[in] uinfos 用户信息列表 * @return void 无返回值 */ void OnUserInfoChange(const std::list<nim::UserNameCard> &uinfos); /** * 响应用户头像改变的回调函数 * @param[in] type 头像类型 * @param[in] account 用户id * @param[in] photo_path 头像路径 * @return void 无返回值 */ void OnUserPhotoReady(PhotoType type, const std::string& account, const std::wstring& photo_path); /** * 响应黑名单改变的回调函数 * @param[in] id 用户id * @param[in] black 是否加入黑名单 * @return void 无返回值 */ void OnSetBlackCallback(const std::string& id, bool black); public: static const LPCTSTR kClassName; private: ui::ListBox* m_black_list = NULL; ui::Button* m_add_black = NULL; ui::TreeView* m_friend_list = NULL; ui::TabBox* m_page_switch = NULL; AutoUnregister unregister_cb; }; }
{ "pile_set_name": "Github" }
import numpy as np import ipdb def produce_adjacent_matrix_6_neighbors(flag_bits, stroke_len): assert flag_bits.shape == (10, 1) adja_matr = np.zeros([10, 10], int) adja_matr[ : ][ : ] = -1 adja_matr[0][0] = 0 # TODO if (flag_bits[0] == 100): adja_matr[0][1] = 0 # 20191020 if (flag_bits[1] == 100): adja_matr[0][2] = 0 if (flag_bits[2] == 100): adja_matr[0][3] = 0 for idx in range(1, stroke_len): # adja_matr[idx][idx] = 0 if (flag_bits[idx - 1] == 100): adja_matr[idx][idx - 1] = 0 # 20191020 if (idx >= 2) and (flag_bits[idx - 2] == 100): adja_matr[idx][idx - 2] = 0 if (idx >= 3) and (flag_bits[idx - 3] == 100): adja_matr[idx][idx - 3] = 0 if idx == stroke_len - 1: break # if (idx <= (stroke_len - 2)) and (flag_bits[idx] == 100): adja_matr[idx][idx + 1] = 0 # if (idx <= (stroke_len - 3)) and (flag_bits[idx + 1] == 100): adja_matr[idx][idx + 2] = 0 if (idx <= (stroke_len - 4)) and (flag_bits[idx + 2] == 100): adja_matr[idx][idx + 3] = 0 return adja_matr def stroke_length_detection(coordinate_array): for i in range(len(coordinate_array)-1,-1,-1): #ipdb.set_trace() if ((coordinate_array[i] == np.array([0, 0, 0, 0])).all()): return i return 10 def flag_bit_transfer(input_array): out_array = np.zeros([10, 1], int) assert input_array.shape == (10, 2) for idx, bits in enumerate(input_array): if ((bits == [1, 0]).all()): out_array[idx] = 100 elif ((bits == [0, 1]).all()): out_array[idx] = 101 else: out_array[idx] = 102 return out_array #coordi_array = np.array([[1, 1, 1, 0], [2, 2, 1, 0], [3, 3, 1, 0], [4, 4, 1, 0], [5, 5, 1, 0], [6, 6, 1, 0], [7, 7, 1, 0], [8, 8, 0, 1], [0, 0, 0, 0], [-1, -1, -1, -1]], dtype=np.float32) #coordi_array = np.array([[1, 1, 1, 0], [2, 2, 1, 0], [3, 3, 1, 0], [4, 4, 1, 0], [5, 5, 1, 0], [6, 6, 1, 0], [7, 7, 1, 0], [7, 7, 1, 0], [8, 8, 0, 1], [0, 0, 0, 0]], dtype=np.float32) #coordi_array = np.array([[1, 1, 0, 1], [2, 2, 1, 0], [3, 3, 0, 1], [4, 4, 1, 0], [5, 5, 1, 0], [6, 6, 1, 0], [7, 7, 1, 0], [8, 8, 0, 1], [0, 0, 0, 0], [-1, -1, -1, -1]], dtype=np.float32) #coordi_array = np.array([[1, 1, 1, 0], [2, 2, 1, 0], [3, 3, 0, 1], [4, 4, 1, 0], [5, 5, 1, 0], [6, 6, 1, 0], [7, 7, 1, 0], [8, 8, 0, 1], [9, 9, 1, 0], [10, 10, 0, 1]], dtype=np.float32) #coordi_array = np.array([[1, 1, 1, 0], [2, 2, 1, 0], [3, 3, 0, 1], [4, 4, 1, 0], [5, 5, 1, 0], [6, 6, 1, 0], [7, 7, 1, 0], [8, 8, 1, 0], [9, 9, 0, 1], [10, 10, 0, 1]], dtype=np.float32) coordi_array = np.array([[1, 1, 1, 0], [2, 2, 1, 0], [3, 3, 0, 1], [4, 4, 1, 0], [5, 5, 1, 0], [6, 6, 1, 0], [7, 7, 1, 0], [8, 8, 0, 1], [9, 9, 1, 0], [10, 10, 1, 0]], dtype=np.float32) stroke_len = stroke_length_detection(coordi_array) flag_bits = flag_bit_transfer(coordi_array[:, 2 : ]) adja_matr = produce_adjacent_matrix_6_neighbors(flag_bits, stroke_len) x = adja_matr ipdb.set_trace()
{ "pile_set_name": "Github" }
import React from 'react'; export function StepchildTitle({ formData }) { return ( <div> <h4 className="vads-u-border-color--link-default vads-u-border-bottom--2px vads-u-margin-top--0 vads-u-padding-bottom--0p5"> {formData.fullName.first} {formData.fullName.last} </h4> </div> ); }
{ "pile_set_name": "Github" }
<!DOCTYPE html > <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title></title> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../lib/index.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript" src="../../lib/jquery.js"></script> <script type="text/javascript" src="../../lib/jquery.panzoom.min.js"></script> <script type="text/javascript" src="../../lib/jquery.mousewheel.min.js"></script> <script type="text/javascript" src="../../lib/index.js"></script> <script type="text/javascript" src="../../index.js"></script> <script type="text/javascript" src="../../lib/scheduler.js"></script> <script type="text/javascript" src="../../lib/template.js"></script> <script type="text/javascript" src="../../lib/tools.tooltip.js"></script> <script type="text/javascript"> /* this variable can be used by the JS to determine the path to the root document */ var toRoot = '../../'; </script> </head> <body> <div id="search"> <span id="doc-title"><span id="doc-version"></span></span> <span class="close-results"><span class="left">&lt;</span> Back</span> <div id="textfilter"> <span class="input"> <input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" /> <i class="clear material-icons"></i> <i id="search-icon" class="material-icons"></i> </span> </div> </div> <div id="search-results"> <div id="search-progress"> <div id="progress-fill"></div> </div> <div id="results-content"> <div id="entity-results"></div> <div id="member-results"></div> </div> </div> <div id="content-scroll-container" style="-webkit-overflow-scrolling: touch;"> <div id="content-container" style="-webkit-overflow-scrolling: touch;"> <div id="subpackage-spacer"> <div id="packages"> <h1>Packages</h1> <ul> <li name="_root_.root" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="_root_"></a><a id="root:_root_"></a> <span class="permalink"> <a href="index.html#_root_" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="../../index.html"><span class="name">root</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../index.html" class="extype" name="_root_">root</a></dd></dl></div> </li><li name="_root_.pdi" visbl="pub" class="indented1 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="pdi"></a><a id="pdi:pdi"></a> <span class="permalink"> <a href="index.html#pdi" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="../index.html"><span class="name">pdi</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../index.html" class="extype" name="_root_">root</a></dd></dl></div> </li><li name="pdi.jwt" visbl="pub" class="indented2 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="jwt"></a><a id="jwt:jwt"></a> <span class="permalink"> <a href="../pdi/index.html#jwt" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="index.html"><span class="name">jwt</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../index.html" class="extype" name="pdi">pdi</a></dd></dl></div> </li><li name="pdi.jwt.algorithms" visbl="pub" class="indented3 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="algorithms"></a><a id="algorithms:algorithms"></a> <span class="permalink"> <a href="../../pdi/jwt/index.html#algorithms" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="algorithms/index.html"><span class="name">algorithms</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="index.html" class="extype" name="pdi.jwt">jwt</a></dd></dl></div> </li><li name="pdi.jwt.exceptions" visbl="pub" class="indented3 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="exceptions"></a><a id="exceptions:exceptions"></a> <span class="permalink"> <a href="../../pdi/jwt/index.html#exceptions" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">package</span> </span> <span class="symbol"> <a title="" href="exceptions/index.html"><span class="name">exceptions</span></a> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="index.html" class="extype" name="pdi.jwt">jwt</a></dd></dl></div> </li><li class="current-entities indented2"> <span class="separator"></span> <a class="object" href="Jwt$.html" title="Default implementation of JwtCore using only Strings."></a> <a href="Jwt$.html" title="Default implementation of JwtCore using only Strings.">Jwt</a> </li><li class="current-entities indented2"> <a class="object" href="JwtAlgorithm$.html" title=""></a> <a class="trait" href="JwtAlgorithm.html" title=""></a> <a href="JwtAlgorithm.html" title="">JwtAlgorithm</a> </li><li class="current-entities indented2"> <span class="separator"></span> <a class="object" href="JwtBase64$.html" title=""></a> <a href="JwtBase64$.html" title="">JwtBase64</a> </li><li class="current-entities indented2"> <span class="separator"></span> <a class="class" href="" title=""></a> <a href="" title="">JwtClaim</a> </li><li class="current-entities indented2"> <span class="separator"></span> <a class="trait" href="JwtCore.html" title="Provide the main logic around Base64 encoding / decoding and signature using the correct algorithm."></a> <a href="JwtCore.html" title="Provide the main logic around Base64 encoding / decoding and signature using the correct algorithm.">JwtCore</a> </li><li class="current-entities indented2"> <a class="object" href="JwtHeader$.html" title=""></a> <a class="class" href="JwtHeader.html" title=""></a> <a href="JwtHeader.html" title="">JwtHeader</a> </li><li class="current-entities indented2"> <a class="object" href="JwtOptions$.html" title=""></a> <a class="class" href="JwtOptions.html" title=""></a> <a href="JwtOptions.html" title="">JwtOptions</a> </li><li class="current-entities indented2"> <span class="separator"></span> <a class="object" href="JwtTime$.html" title="Util object to handle time operations"></a> <a href="JwtTime$.html" title="Util object to handle time operations">JwtTime</a> </li><li class="current-entities indented2"> <span class="separator"></span> <a class="object" href="JwtUtils$.html" title=""></a> <a href="JwtUtils$.html" title="">JwtUtils</a> </li> </ul> </div> </div> <div id="content"> <body class="class type"> <div id="definition"> <div class="big-circle class">c</div> <p id="owner"><a href="../index.html" class="extype" name="pdi">pdi</a>.<a href="index.html" class="extype" name="pdi.jwt">jwt</a></p> <h1>JwtClaim<span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html" title="Permalink"> <i class="material-icons"></i> </a> </span></h1> <h3><span class="morelinks"></span></h3> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">case class</span> </span> <span class="symbol"> <span class="name">JwtClaim</span><span class="params">(<span name="content">content: <span class="extype" name="scala.Predef.String">String</span> = <span class="symbol">&quot;{}&quot;</span></span>, <span name="issuer">issuer: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>] = <span class="symbol">None</span></span>, <span name="subject">subject: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>] = <span class="symbol">None</span></span>, <span name="audience">audience: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.Set">Set</span>[<span class="extype" name="scala.Predef.String">String</span>]] = <span class="symbol">None</span></span>, <span name="expiration">expiration: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>] = <span class="symbol">None</span></span>, <span name="notBefore">notBefore: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>] = <span class="symbol">None</span></span>, <span name="issuedAt">issuedAt: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>] = <span class="symbol">None</span></span>, <span name="jwtId">jwtId: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>] = <span class="symbol">None</span></span>)</span><span class="result"> extends <a href="http://www.scala-lang.org/api/2.12.4/scala/Product.html#scala.Product" class="extype" name="scala.Product">Product</a> with <a href="http://www.scala-lang.org/api/2.12.4/scala/Serializable.html#scala.Serializable" class="extype" name="scala.Serializable">Serializable</a></span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="toggleContainer block"> <span class="toggle"> Linear Supertypes </span> <div class="superTypes hiddenContent"><a href="http://www.scala-lang.org/api/2.12.4/scala/Serializable.html#scala.Serializable" class="extype" name="scala.Serializable">Serializable</a>, <span class="extype" name="java.io.Serializable">Serializable</span>, <a href="http://www.scala-lang.org/api/2.12.4/scala/Product.html#scala.Product" class="extype" name="scala.Product">Product</a>, <a href="http://www.scala-lang.org/api/2.12.4/scala/Equals.html#scala.Equals" class="extype" name="scala.Equals">Equals</a>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div class="toggle"></div> <div id="memberfilter"> <i class="material-icons arrow"></i> <span class="input"> <input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" /> </span> <i class="clear material-icons"></i> </div> <div id="filterby"> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By Inheritance</span></li> </ol> </div> <div class="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="pdi.jwt.JwtClaim"><span>JwtClaim</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.Product"><span>Product</span></li><li class="in" name="scala.Equals"><span>Equals</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div class="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show All</span></li> </ol> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> </div> <div id="template"> <div id="allMembers"> <div id="constructors" class="members"> <h3>Instance Constructors</h3> <ol><li name="pdi.jwt.JwtClaim#&lt;init&gt;" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="&lt;init&gt;(content:String,issuer:Option[String],subject:Option[String],audience:Option[Set[String]],expiration:Option[Long],notBefore:Option[Long],issuedAt:Option[Long],jwtId:Option[String]):pdi.jwt.JwtClaim"></a><a id="&lt;init&gt;:JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#&lt;init&gt;(content:String,issuer:Option[String],subject:Option[String],audience:Option[Set[String]],expiration:Option[Long],notBefore:Option[Long],issuedAt:Option[Long],jwtId:Option[String]):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">new</span> </span> <span class="symbol"> <span class="name">JwtClaim</span><span class="params">(<span name="content">content: <span class="extype" name="scala.Predef.String">String</span> = <span class="symbol">&quot;{}&quot;</span></span>, <span name="issuer">issuer: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>] = <span class="symbol">None</span></span>, <span name="subject">subject: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>] = <span class="symbol">None</span></span>, <span name="audience">audience: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.Set">Set</span>[<span class="extype" name="scala.Predef.String">String</span>]] = <span class="symbol">None</span></span>, <span name="expiration">expiration: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>] = <span class="symbol">None</span></span>, <span name="notBefore">notBefore: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>] = <span class="symbol">None</span></span>, <span name="issuedAt">issuedAt: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>] = <span class="symbol">None</span></span>, <span name="jwtId">jwtId: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>] = <span class="symbol">None</span></span>)</span> </span> </li></ol> </div> <div class="values members"> <h3>Value Members</h3> <ol> <li name="scala.AnyRef#!=" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a><a id="!=(Any):Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#!=(x$1:Any):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html###():Int" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Int.html#scala.Int" class="extype" name="scala.Int">Int</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="pdi.jwt.JwtClaim#+" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="+(key:String,value:Any):pdi.jwt.JwtClaim"></a><a id="+(String,Any):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#+(key:String,value:Any):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $plus" class="name">+</span><span class="params">(<span name="key">key: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="value">value: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#+" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="+(json:String):pdi.jwt.JwtClaim"></a><a id="+(String):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#+(json:String):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $plus" class="name">+</span><span class="params">(<span name="json">json: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#++" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="++(fields:(String,Any)*):pdi.jwt.JwtClaim"></a><a id="++((String,Any)*):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#++(fields:(String,Any)*):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $plus$plus" class="name">++</span><span class="params">(<span name="fields">fields: (<span class="extype" name="scala.Predef.String">String</span>, <span class="extype" name="scala.Any">Any</span>)*</span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="scala.AnyRef#==" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a><a id="==(Any):Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#==(x$1:Any):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="pdi.jwt.JwtClaim#about" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="about(subject:String):pdi.jwt.JwtClaim"></a><a id="about(String):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#about(subject:String):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">about</span><span class="params">(<span name="subject">subject: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="scala.Any#asInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#asInstanceOf[T0]:T0" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="pdi.jwt.JwtClaim#audience" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="audience:Option[Set[String]]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#audience:Option[Set[String]]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">audience</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.Set">Set</span>[<span class="extype" name="scala.Predef.String">String</span>]]</span> </span> </li><li name="pdi.jwt.JwtClaim#by" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="by(issuer:String):pdi.jwt.JwtClaim"></a><a id="by(String):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#by(issuer:String):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">by</span><span class="params">(<span name="issuer">issuer: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="scala.AnyRef#clone" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a><a id="clone():AnyRef"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#clone():Object" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.CloneNotSupportedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="pdi.jwt.JwtClaim#content" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="content:String"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#content:String" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">content</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span> </span> </li><li name="scala.AnyRef#eq" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a><a id="eq(AnyRef):Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#eq(x$1:AnyRef):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="pdi.jwt.JwtClaim#expiration" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="expiration:Option[Long]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#expiration:Option[Long]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">expiration</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>]</span> </span> </li><li name="pdi.jwt.JwtClaim#expiresAt" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="expiresAt(seconds:Long):pdi.jwt.JwtClaim"></a><a id="expiresAt(Long):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#expiresAt(seconds:Long):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">expiresAt</span><span class="params">(<span name="seconds">seconds: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#expiresIn" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="expiresIn(seconds:Long):pdi.jwt.JwtClaim"></a><a id="expiresIn(Long):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#expiresIn(seconds:Long):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">expiresIn</span><span class="params">(<span name="seconds">seconds: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#expiresNow" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="expiresNow:pdi.jwt.JwtClaim"></a><a id="expiresNow:JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#expiresNow:pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">expiresNow</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="scala.AnyRef#finalize" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#finalize():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Unit.html#scala.Unit" class="extype" name="scala.Unit">Unit</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../java/lang/index.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="symbol">classOf[java.lang.Throwable]</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#getClass():Class[_]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#isInstanceOf[T0]:Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="pdi.jwt.JwtClaim#isValid" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="isValid(issuer:String,audience:String):Boolean"></a><a id="isValid(String,String):Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#isValid(issuer:String,audience:String):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isValid</span><span class="params">(<span name="issuer">issuer: <span class="extype" name="scala.Predef.String">String</span></span>, <span name="audience">audience: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> </li><li name="pdi.jwt.JwtClaim#isValid" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="isValid(issuer:String):Boolean"></a><a id="isValid(String):Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#isValid(issuer:String):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isValid</span><span class="params">(<span name="issuer">issuer: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> </li><li name="pdi.jwt.JwtClaim#isValid" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="isValid:Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#isValid:Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isValid</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> </li><li name="pdi.jwt.JwtClaim#issuedAt" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="issuedAt(seconds:Long):pdi.jwt.JwtClaim"></a><a id="issuedAt(Long):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#issuedAt(seconds:Long):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">issuedAt</span><span class="params">(<span name="seconds">seconds: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#issuedAt" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="issuedAt:Option[Long]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#issuedAt:Option[Long]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">issuedAt</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>]</span> </span> </li><li name="pdi.jwt.JwtClaim#issuedIn" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="issuedIn(seconds:Long):pdi.jwt.JwtClaim"></a><a id="issuedIn(Long):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#issuedIn(seconds:Long):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">issuedIn</span><span class="params">(<span name="seconds">seconds: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#issuedNow" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="issuedNow:pdi.jwt.JwtClaim"></a><a id="issuedNow:JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#issuedNow:pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">issuedNow</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#issuer" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="issuer:Option[String]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#issuer:Option[String]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">issuer</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>]</span> </span> </li><li name="pdi.jwt.JwtClaim#jwtId" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="jwtId:Option[String]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#jwtId:Option[String]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">jwtId</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>]</span> </span> </li><li name="scala.AnyRef#ne" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a><a id="ne(AnyRef):Boolean"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#ne(x$1:AnyRef):Boolean" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Boolean.html#scala.Boolean" class="extype" name="scala.Boolean">Boolean</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="pdi.jwt.JwtClaim#notBefore" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="notBefore:Option[Long]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#notBefore:Option[Long]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">notBefore</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a>]</span> </span> </li><li name="scala.AnyRef#notify" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#notify():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Unit.html#scala.Unit" class="extype" name="scala.Unit">Unit</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#notifyAll():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Unit.html#scala.Unit" class="extype" name="scala.Unit">Unit</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> </dd></dl></div> </li><li name="pdi.jwt.JwtClaim#startsAt" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="startsAt(seconds:Long):pdi.jwt.JwtClaim"></a><a id="startsAt(Long):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#startsAt(seconds:Long):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">startsAt</span><span class="params">(<span name="seconds">seconds: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#startsIn" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="startsIn(seconds:Long):pdi.jwt.JwtClaim"></a><a id="startsIn(Long):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#startsIn(seconds:Long):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">startsIn</span><span class="params">(<span name="seconds">seconds: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#startsNow" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="startsNow:pdi.jwt.JwtClaim"></a><a id="startsNow:JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#startsNow:pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">startsNow</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#subject" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="subject:Option[String]"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#subject:Option[String]" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">val</span> </span> <span class="symbol"> <span class="name">subject</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Option.html#scala.Option" class="extype" name="scala.Option">Option</a>[<span class="extype" name="scala.Predef.String">String</span>]</span> </span> </li><li name="scala.AnyRef#synchronized" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a><a id="synchronized[T0](⇒T0):T0"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#synchronized[T0](x$1:=&gt;T0):T0" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="pdi.jwt.JwtClaim#to" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="to(audience:Set[String]):pdi.jwt.JwtClaim"></a><a id="to(Set[String]):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#to(audience:Set[String]):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">to</span><span class="params">(<span name="audience">audience: <span class="extype" name="scala.Predef.Set">Set</span>[<span class="extype" name="scala.Predef.String">String</span>]</span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#to" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="to(audience:String):pdi.jwt.JwtClaim"></a><a id="to(String):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#to(audience:String):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">to</span><span class="params">(<span name="audience">audience: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li><li name="pdi.jwt.JwtClaim#toJson" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="toJson:String"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#toJson:String" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">toJson</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span> </span> </li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#wait():Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Unit.html#scala.Unit" class="extype" name="scala.Unit">Unit</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a><a id="wait(Long,Int):Unit"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#wait(x$1:Long,x$2:Int):Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>, <span name="arg1">arg1: <a href="http://www.scala-lang.org/api/2.12.4/scala/Int.html#scala.Int" class="extype" name="scala.Int">Int</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Unit.html#scala.Unit" class="extype" name="scala.Unit">Unit</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a><a id="wait(Long):Unit"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#wait(x$1:Long):Unit" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <a href="http://www.scala-lang.org/api/2.12.4/scala/Long.html#scala.Long" class="extype" name="scala.Long">Long</a></span>)</span><span class="result">: <a href="http://www.scala-lang.org/api/2.12.4/scala/Unit.html#scala.Unit" class="extype" name="scala.Unit">Unit</a></span> </span> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@native</span><span class="args">()</span> <span class="name">@throws</span><span class="args">(<span> <span class="defval" name="classOf[java.lang.InterruptedException]">...</span> </span>)</span> </dd></dl></div> </li><li name="pdi.jwt.JwtClaim#withId" visbl="pub" class="indented0 " data-isabs="false" fullComment="no" group="Ungrouped"> <a id="withId(id:String):pdi.jwt.JwtClaim"></a><a id="withId(String):JwtClaim"></a> <span class="permalink"> <a href="../../pdi/jwt/JwtClaim.html#withId(id:String):pdi.jwt.JwtClaim" title="Permalink"> <i class="material-icons"></i> </a> </span> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">withId</span><span class="params">(<span name="id">id: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="" class="extype" name="pdi.jwt.JwtClaim">JwtClaim</a></span> </span> </li> </ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.Serializable"> <h3>Inherited from <a href="http://www.scala-lang.org/api/2.12.4/scala/Serializable.html#scala.Serializable" class="extype" name="scala.Serializable">Serializable</a></h3> </div><div class="parent" name="java.io.Serializable"> <h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3> </div><div class="parent" name="scala.Product"> <h3>Inherited from <a href="http://www.scala-lang.org/api/2.12.4/scala/Product.html#scala.Product" class="extype" name="scala.Product">Product</a></h3> </div><div class="parent" name="scala.Equals"> <h3>Inherited from <a href="http://www.scala-lang.org/api/2.12.4/scala/Equals.html#scala.Equals" class="extype" name="scala.Equals">Equals</a></h3> </div><div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> </body> </div> </div> </div> </body> </html>
{ "pile_set_name": "Github" }
[Desktop Entry] Name=DevilutionX Comment=Diablo 1 for GKD350h Exec=devilutionx Terminal=false Type=Application StartupNotify=true Icon=Diablo_32 Categories=games; X-OD-Manual=readme.gcw0.txt X-OD-NeedsDownscaling=true
{ "pile_set_name": "Github" }
package checkers import ( "go/ast" "github.com/go-critic/go-critic/checkers/internal/lintutil" "github.com/go-lintpack/lintpack" "github.com/go-lintpack/lintpack/astwalk" "github.com/go-toolsmith/astcopy" "github.com/go-toolsmith/astp" "golang.org/x/tools/go/ast/astutil" ) func init() { var info lintpack.CheckerInfo info.Name = "typeUnparen" info.Tags = []string{"style", "opinionated"} info.Summary = "Detects unneded parenthesis inside type expressions and suggests to remove them" info.Before = `type foo [](func([](func())))` info.After = `type foo []func([]func())` collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { return astwalk.WalkerForTypeExpr(&typeUnparenChecker{ctx: ctx}, ctx.TypesInfo) }) } type typeUnparenChecker struct { astwalk.WalkHandler ctx *lintpack.CheckerContext } func (c *typeUnparenChecker) VisitTypeExpr(x ast.Expr) { switch x := x.(type) { case *ast.ParenExpr: switch x.X.(type) { case *ast.StructType: c.ctx.Warn(x, "could simplify (struct{...}) to struct{...}") case *ast.InterfaceType: c.ctx.Warn(x, "could simplify (interface{...}) to interface{...}") default: c.warn(x, c.unparenExpr(astcopy.Expr(x))) } default: c.checkTypeExpr(x) } } func (c *typeUnparenChecker) checkTypeExpr(x ast.Expr) { switch x := x.(type) { case *ast.ArrayType: // Arrays require extra care: we don't want to unparen // length expression as they are not type expressions. if !c.hasParens(x.Elt) { return } noParens := astcopy.ArrayType(x) noParens.Elt = c.unparenExpr(noParens.Elt) c.warn(x, noParens) case *ast.StructType, *ast.InterfaceType: // Only nested fields are to be reported. default: if !c.hasParens(x) { return } c.warn(x, c.unparenExpr(astcopy.Expr(x))) } } func (c *typeUnparenChecker) hasParens(x ast.Expr) bool { return lintutil.ContainsNode(x, astp.IsParenExpr) } func (c *typeUnparenChecker) unparenExpr(x ast.Expr) ast.Expr { // Replace every paren expr with expression it encloses. return astutil.Apply(x, nil, func(cur *astutil.Cursor) bool { if paren, ok := cur.Node().(*ast.ParenExpr); ok { cur.Replace(paren.X) } return true }).(ast.Expr) } func (c *typeUnparenChecker) warn(cause, noParens ast.Expr) { c.SkipChilds = true c.ctx.Warn(cause, "could simplify %s to %s", cause, noParens) }
{ "pile_set_name": "Github" }
#!/usr/bin/env python3 # # vmtools.py - part of the FDroid server tools # Copyright (C) 2017 Michael Poehn <michael.poehn@fsfe.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from os.path import isdir, isfile, basename, abspath, expanduser import os import math import json import tarfile import shutil import subprocess import textwrap import logging from .common import FDroidException from fdroidserver import _ import threading lock = threading.Lock() def get_clean_builder(serverdir, reset=False): if not os.path.isdir(serverdir): if os.path.islink(serverdir): os.unlink(serverdir) logging.info("buildserver path does not exists, creating %s", serverdir) os.makedirs(serverdir) vagrantfile = os.path.join(serverdir, 'Vagrantfile') if not os.path.isfile(vagrantfile): with open(os.path.join('builder', 'Vagrantfile'), 'w') as f: f.write(textwrap.dedent("""\ # generated file, do not change. Vagrant.configure("2") do |config| config.vm.box = "buildserver" config.vm.synced_folder ".", "/vagrant", disabled: true end """)) vm = get_build_vm(serverdir) if reset: logging.info('resetting buildserver by request') elif not vm.vagrant_uuid_okay(): logging.info('resetting buildserver, because vagrant vm is not okay.') reset = True elif not vm.snapshot_exists('fdroidclean'): logging.info("resetting buildserver, because snapshot 'fdroidclean' is not present.") reset = True if reset: vm.destroy() vm.up() vm.suspend() if reset: logging.info('buildserver recreated: taking a clean snapshot') vm.snapshot_create('fdroidclean') else: logging.info('builserver ok: reverting to clean snapshot') vm.snapshot_revert('fdroidclean') vm.up() try: sshinfo = vm.sshinfo() except FDroidBuildVmException: # workaround because libvirt sometimes likes to forget # about ssh connection info even thou the vm is running vm.halt() vm.up() sshinfo = vm.sshinfo() return sshinfo def _check_call(cmd, cwd=None): logging.debug(' '.join(cmd)) return subprocess.check_call(cmd, shell=False, cwd=cwd) def _check_output(cmd, cwd=None): logging.debug(' '.join(cmd)) return subprocess.check_output(cmd, shell=False, cwd=cwd) def get_build_vm(srvdir, provider=None): """Factory function for getting FDroidBuildVm instances. This function tries to figure out what hypervisor should be used and creates an object for controlling a build VM. :param srvdir: path to a directory which contains a Vagrantfile :param provider: optionally this parameter allows specifiying an specific vagrant provider. :returns: FDroidBuildVm instance. """ abssrvdir = abspath(srvdir) # use supplied provider if provider: if provider == 'libvirt': logging.debug('build vm provider \'libvirt\' selected') return LibvirtBuildVm(abssrvdir) elif provider == 'virtualbox': logging.debug('build vm provider \'virtualbox\' selected') return VirtualboxBuildVm(abssrvdir) else: logging.warning('build vm provider not supported: \'%s\'', provider) # try guessing provider from installed software kvm_installed = shutil.which('kvm') is not None kvm_installed |= shutil.which('qemu') is not None kvm_installed |= shutil.which('qemu-kvm') is not None vbox_installed = shutil.which('VBoxHeadless') is not None if kvm_installed and vbox_installed: logging.debug('both kvm and vbox are installed.') elif kvm_installed: logging.debug('libvirt is the sole installed and supported vagrant provider, selecting \'libvirt\'') return LibvirtBuildVm(abssrvdir) elif vbox_installed: logging.debug('virtualbox is the sole installed and supported vagrant provider, selecting \'virtualbox\'') return VirtualboxBuildVm(abssrvdir) else: logging.debug('could not confirm that either virtualbox or kvm/libvirt are installed') # try guessing provider from .../srvdir/.vagrant internals vagrant_libvirt_path = os.path.join(abssrvdir, '.vagrant', 'machines', 'default', 'libvirt') has_libvirt_machine = isdir(vagrant_libvirt_path) \ and len(os.listdir(vagrant_libvirt_path)) > 0 vagrant_virtualbox_path = os.path.join(abssrvdir, '.vagrant', 'machines', 'default', 'virtualbox') has_vbox_machine = isdir(vagrant_virtualbox_path) \ and len(os.listdir(vagrant_virtualbox_path)) > 0 if has_libvirt_machine and has_vbox_machine: logging.info('build vm provider lookup found virtualbox and libvirt, defaulting to \'virtualbox\'') return VirtualboxBuildVm(abssrvdir) elif has_libvirt_machine: logging.debug('build vm provider lookup found \'libvirt\'') return LibvirtBuildVm(abssrvdir) elif has_vbox_machine: logging.debug('build vm provider lookup found \'virtualbox\'') return VirtualboxBuildVm(abssrvdir) # try guessing provider from available buildserver boxes available_boxes = [] import vagrant boxes = vagrant.Vagrant().box_list() for box in boxes: if box.name == "buildserver": available_boxes.append(box.provider) if "libvirt" in available_boxes and "virtualbox" in available_boxes: logging.info('basebox lookup found virtualbox and libvirt boxes, defaulting to \'virtualbox\'') return VirtualboxBuildVm(abssrvdir) elif "libvirt" in available_boxes: logging.info('\'libvirt\' buildserver box available, using that') return LibvirtBuildVm(abssrvdir) elif "virtualbox" in available_boxes: logging.info('\'virtualbox\' buildserver box available, using that') return VirtualboxBuildVm(abssrvdir) else: logging.error('No available \'buildserver\' box. Cannot proceed') os._exit(1) class FDroidBuildVmException(FDroidException): pass class FDroidBuildVm(): """Abstract base class for working with FDroids build-servers. Use the factory method `fdroidserver.vmtools.get_build_vm()` for getting correct instances of this class. This is intended to be a hypervisor independent, fault tolerant wrapper around the vagrant functions we use. """ def __init__(self, srvdir): """Create new server class. """ self.srvdir = srvdir self.srvname = basename(srvdir) + '_default' self.vgrntfile = os.path.join(srvdir, 'Vagrantfile') self.srvuuid = self._vagrant_fetch_uuid() if not isdir(srvdir): raise FDroidBuildVmException("Can not init vagrant, directory %s not present" % (srvdir)) if not isfile(self.vgrntfile): raise FDroidBuildVmException("Can not init vagrant, '%s' not present" % (self.vgrntfile)) import vagrant self.vgrnt = vagrant.Vagrant(root=srvdir, out_cm=vagrant.stdout_cm, err_cm=vagrant.stdout_cm) def up(self, provision=True): global lock with lock: try: self.vgrnt.up(provision=provision, provider=self.provider) self.srvuuid = self._vagrant_fetch_uuid() except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not bring up vm '%s'" % self.srvname) from e def suspend(self): global lock with lock: logging.info('suspending buildserver') try: self.vgrnt.suspend() except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not suspend vm '%s'" % self.srvname) from e def halt(self): global lock with lock: self.vgrnt.halt(force=True) def destroy(self): """Remove every trace of this VM from the system. This includes deleting: * hypervisor specific definitions * vagrant state informations (eg. `.vagrant` folder) * images related to this vm """ logging.info("destroying vm '%s'", self.srvname) try: self.vgrnt.destroy() logging.debug('vagrant destroy completed') except subprocess.CalledProcessError as e: logging.exception('vagrant destroy failed: %s', e) vgrntdir = os.path.join(self.srvdir, '.vagrant') try: shutil.rmtree(vgrntdir) logging.debug('deleted vagrant dir: %s', vgrntdir) except Exception as e: logging.debug("could not delete vagrant dir: %s, %s", vgrntdir, e) try: _check_call(['vagrant', 'global-status', '--prune']) except subprocess.CalledProcessError as e: logging.debug('pruning global vagrant status failed: %s', e) def package(self, output=None): self.vgrnt.package(output=output) def vagrant_uuid_okay(self): '''Having an uuid means that vagrant up has run successfully.''' if self.srvuuid is None: return False return True def _vagrant_file_name(self, name): return name.replace('/', '-VAGRANTSLASH-') def _vagrant_fetch_uuid(self): if isfile(os.path.join(self.srvdir, '.vagrant')): # Vagrant 1.0 - it's a json file... with open(os.path.join(self.srvdir, '.vagrant')) as f: id = json.load(f)['active']['default'] logging.debug('vm uuid: %s', id) return id elif isfile(os.path.join(self.srvdir, '.vagrant', 'machines', 'default', self.provider, 'id')): # Vagrant 1.2 (and maybe 1.1?) it's a directory tree... with open(os.path.join(self.srvdir, '.vagrant', 'machines', 'default', self.provider, 'id')) as f: id = f.read() logging.debug('vm uuid: %s', id) return id else: logging.debug('vm uuid is None') return None def box_add(self, boxname, boxfile, force=True): """Add vagrant box to vagrant. :param boxname: name assigned to local deployment of box :param boxfile: path to box file :param force: overwrite existing box image (default: True) """ boxfile = abspath(boxfile) if not isfile(boxfile): raise FDroidBuildVmException('supplied boxfile \'%s\' does not exist', boxfile) self.vgrnt.box_add(boxname, abspath(boxfile), force=force) def box_remove(self, boxname): try: _check_call(['vagrant', 'box', 'remove', '--all', '--force', boxname]) except subprocess.CalledProcessError as e: logging.debug('tried removing box %s, but is did not exist: %s', boxname, e) boxpath = os.path.join(expanduser('~'), '.vagrant', self._vagrant_file_name(boxname)) if isdir(boxpath): logging.info("attempting to remove box '%s' by deleting: %s", boxname, boxpath) shutil.rmtree(boxpath) def sshinfo(self): """Get ssh connection info for a vagrant VM :returns: A dictionary containing 'hostname', 'port', 'user' and 'idfile' """ import paramiko try: sshconfig_path = os.path.join(self.srvdir, 'sshconfig') with open(sshconfig_path, 'wb') as fp: fp.write(_check_output(['vagrant', 'ssh-config'], cwd=self.srvdir)) vagranthost = 'default' # Host in ssh config file sshconfig = paramiko.SSHConfig() with open(sshconfig_path, 'r') as f: sshconfig.parse(f) sshconfig = sshconfig.lookup(vagranthost) idfile = sshconfig['identityfile'] if isinstance(idfile, list): idfile = idfile[0] elif idfile.startswith('"') and idfile.endswith('"'): idfile = idfile[1:-1] return {'hostname': sshconfig['hostname'], 'port': int(sshconfig['port']), 'user': sshconfig['user'], 'idfile': idfile} except subprocess.CalledProcessError as e: raise FDroidBuildVmException("Error getting ssh config") from e def snapshot_create(self, snapshot_name): raise NotImplementedError('not implemented, please use a sub-type instance') def snapshot_list(self): raise NotImplementedError('not implemented, please use a sub-type instance') def snapshot_exists(self, snapshot_name): raise NotImplementedError('not implemented, please use a sub-type instance') def snapshot_revert(self, snapshot_name): raise NotImplementedError('not implemented, please use a sub-type instance') class LibvirtBuildVm(FDroidBuildVm): def __init__(self, srvdir): self.provider = 'libvirt' super().__init__(srvdir) import libvirt try: self.conn = libvirt.open('qemu:///system') except libvirt.libvirtError as e: raise FDroidBuildVmException('could not connect to libvirtd: %s' % (e)) def destroy(self): super().destroy() # resorting to virsh instead of libvirt python bindings, because # this is way more easy and therefore fault tolerant. # (eg. lookupByName only works on running VMs) try: _check_call(('virsh', '-c', 'qemu:///system', 'destroy', self.srvname)) except subprocess.CalledProcessError as e: logging.info("could not force libvirt domain '%s' off: %s", self.srvname, e) try: # libvirt python bindings do not support all flags required # for undefining domains correctly. _check_call(('virsh', '-c', 'qemu:///system', 'undefine', self.srvname, '--nvram', '--managed-save', '--remove-all-storage', '--snapshots-metadata')) except subprocess.CalledProcessError as e: logging.info("could not undefine libvirt domain '%s': %s", self.srvname, e) def package(self, output=None, keep_box_file=False): if not output: output = "buildserver.box" logging.debug("no output name set for packaging '%s', " "defaulting to %s", self.srvname, output) storagePool = self.conn.storagePoolLookupByName('default') domainInfo = self.conn.lookupByName(self.srvname).info() if storagePool: if isfile('metadata.json'): os.remove('metadata.json') if isfile('Vagrantfile'): os.remove('Vagrantfile') if isfile('box.img'): os.remove('box.img') logging.debug('preparing box.img for box %s', output) vol = storagePool.storageVolLookupByName(self.srvname + '.img') imagepath = vol.path() # TODO use a libvirt storage pool to ensure the img file is readable if not os.access(imagepath, os.R_OK): logging.warning(_('Cannot read "{path}"!').format(path=imagepath)) _check_call(['sudo', '/bin/chmod', '-R', 'a+rX', '/var/lib/libvirt/images']) shutil.copy2(imagepath, 'box.img') _check_call(['qemu-img', 'rebase', '-p', '-b', '', 'box.img']) img_info_raw = _check_output(['qemu-img', 'info', '--output=json', 'box.img']) img_info = json.loads(img_info_raw.decode('utf-8')) metadata = {"provider": "libvirt", "format": img_info['format'], "virtual_size": math.ceil(img_info['virtual-size'] / (1024. ** 3)), } logging.debug('preparing metadata.json for box %s', output) with open('metadata.json', 'w') as fp: fp.write(json.dumps(metadata)) logging.debug('preparing Vagrantfile for box %s', output) vagrantfile = textwrap.dedent("""\ Vagrant.configure("2") do |config| config.ssh.username = "vagrant" config.ssh.password = "vagrant" config.vm.provider :libvirt do |libvirt| libvirt.driver = "kvm" libvirt.host = "" libvirt.connect_via_ssh = false libvirt.storage_pool_name = "default" libvirt.cpus = {cpus} libvirt.memory = {memory} end end""".format_map({'memory': str(int(domainInfo[1] / 1024)), 'cpus': str(domainInfo[3])})) with open('Vagrantfile', 'w') as fp: fp.write(vagrantfile) try: import libarchive with libarchive.file_writer(output, 'gnutar', 'gzip') as tar: logging.debug('adding files to box %s ...', output) tar.add_files('metadata.json', 'Vagrantfile', 'box.img') except (ImportError, AttributeError): with tarfile.open(output, 'w:gz') as tar: logging.debug('adding metadata.json to box %s ...', output) tar.add('metadata.json') logging.debug('adding Vagrantfile to box %s ...', output) tar.add('Vagrantfile') logging.debug('adding box.img to box %s ...', output) tar.add('box.img') if not keep_box_file: logging.debug('box packaging complete, removing temporary files.') os.remove('metadata.json') os.remove('Vagrantfile') os.remove('box.img') else: logging.warning("could not connect to storage-pool 'default', " "skip packaging buildserver box") def box_add(self, boxname, boxfile, force=True): boximg = '%s_vagrant_box_image_0.img' % (boxname) if force: try: _check_call(['virsh', '-c', 'qemu:///system', 'vol-delete', '--pool', 'default', boximg]) logging.debug("removed old box image '%s'" "from libvirt storeage pool", boximg) except subprocess.CalledProcessError as e: logging.debug("tried removing old box image '%s'," "file was not present in first place", boximg, exc_info=e) super().box_add(boxname, boxfile, force) def box_remove(self, boxname): super().box_remove(boxname) try: _check_call(['virsh', '-c', 'qemu:///system', 'vol-delete', '--pool', 'default', '%s_vagrant_box_image_0.img' % (boxname)]) except subprocess.CalledProcessError as e: logging.debug("tried removing '%s', file was not present in first place", boxname, exc_info=e) def snapshot_create(self, snapshot_name): logging.info("creating snapshot '%s' for vm '%s'", snapshot_name, self.srvname) try: _check_call(['virsh', '-c', 'qemu:///system', 'snapshot-create-as', self.srvname, snapshot_name]) except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not create snapshot '%s' " "of libvirt vm '%s'" % (snapshot_name, self.srvname)) from e def snapshot_list(self): import libvirt try: dom = self.conn.lookupByName(self.srvname) return dom.listAllSnapshots() except libvirt.libvirtError as e: raise FDroidBuildVmException('could not list snapshots for domain \'%s\'' % self.srvname) from e def snapshot_exists(self, snapshot_name): import libvirt try: dom = self.conn.lookupByName(self.srvname) return dom.snapshotLookupByName(snapshot_name) is not None except libvirt.libvirtError: return False def snapshot_revert(self, snapshot_name): logging.info("reverting vm '%s' to snapshot '%s'", self.srvname, snapshot_name) import libvirt try: dom = self.conn.lookupByName(self.srvname) snap = dom.snapshotLookupByName(snapshot_name) dom.revertToSnapshot(snap) except libvirt.libvirtError as e: raise FDroidBuildVmException('could not revert domain \'%s\' to snapshot \'%s\'' % (self.srvname, snapshot_name)) from e class VirtualboxBuildVm(FDroidBuildVm): def __init__(self, srvdir): self.provider = 'virtualbox' super().__init__(srvdir) def snapshot_create(self, snapshot_name): logging.info("creating snapshot '%s' for vm '%s'", snapshot_name, self.srvname) try: _check_call(['VBoxManage', 'snapshot', self.srvuuid, 'take', 'fdroidclean'], cwd=self.srvdir) except subprocess.CalledProcessError as e: raise FDroidBuildVmException('could not cerate snapshot ' 'of virtualbox vm %s' % self.srvname) from e def snapshot_list(self): try: o = _check_output(['VBoxManage', 'snapshot', self.srvuuid, 'list', '--details'], cwd=self.srvdir) return o except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not list snapshots " "of virtualbox vm '%s'" % (self.srvname)) from e def snapshot_exists(self, snapshot_name): try: return str(snapshot_name) in str(self.snapshot_list()) except FDroidBuildVmException: return False def snapshot_revert(self, snapshot_name): logging.info("reverting vm '%s' to snapshot '%s'", self.srvname, snapshot_name) try: _check_call(['VBoxManage', 'snapshot', self.srvuuid, 'restore', 'fdroidclean'], cwd=self.srvdir) except subprocess.CalledProcessError as e: raise FDroidBuildVmException("could not load snapshot " "'fdroidclean' for vm '%s'" % (self.srvname)) from e
{ "pile_set_name": "Github" }
// © 2016 and later: Unicode, Inc. and others. // License & terms of use: http://www.unicode.org/copyright.html#License zh_Hant_HK{ Ellipsis{ final{"{0}⋯"} initial{"⋯{0}"} medial{"{0}⋯{1}"} word-final{"{0}⋯"} word-initial{"⋯{0}"} word-medial{"{0}⋯{1}"} } NumberElements{ latn{ patternsShort{ currencyFormat{ 1000{ other{"¤0K"} } 10000{ other{"¤00K"} } 100000{ other{"¤000K"} } 1000000{ other{"¤0M"} } 10000000{ other{"¤00M"} } 100000000{ other{"¤000M"} } 1000000000{ other{"¤0B"} } 10000000000{ other{"¤00B"} } 100000000000{ other{"¤000B"} } 1000000000000{ other{"¤0T"} } 10000000000000{ other{"¤00T"} } 100000000000000{ other{"¤000T"} } } decimalFormat{ 1000{ other{"0K"} } 10000{ other{"00K"} } 100000{ other{"000K"} } 1000000{ other{"0M"} } 10000000{ other{"00M"} } 100000000{ other{"000M"} } 1000000000{ other{"0B"} } 10000000000{ other{"00B"} } 100000000000{ other{"000B"} } 1000000000000{ other{"0T"} } 10000000000000{ other{"00T"} } 100000000000000{ other{"000T"} } } } } } Version{"2.1.47.86"} calendar{ buddhist{ availableFormats{ MEd{"M-d(E)"} Md{"M-d"} } } chinese{ DateTimePatterns{ "ah:mm:ss [zzzz]", "ah:mm:ss [z]", "ah:mm:ss", "ah:mm", "U(r)年MMMdEEEE", "U(r)年MMMd", "U年MMMd", "U/M/d", "{1}, {0}", "{1} {0}", "{1} {0}", "{1}, {0}", "{1}, {0}", } availableFormats{ Ed{"d日E"} H{"HH"} } monthNames{ format{ abbreviated{ "正月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", } narrow{ "正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", } wide{ "正月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", } } stand-alone{ abbreviated{ "正月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", } narrow{ "正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "十一", "十二", } wide{ "正月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月", } } } } generic{ DateTimePatterns{ "ah:mm:ss [zzzz]", "ah:mm:ss [z]", "ah:mm:ss", "ah:mm", "Gy年M月d日EEEE", "Gy年M月d日", "Gy年M月d日", "Gy/M/d", "{1} {0}", "{1} {0}", "{1} {0}", "{1} {0}", "{1} {0}", } availableFormats{ Ed{"d日E"} Gy{"Gy年"} GyMMM{"Gy年M月"} GyMMMEd{"Gy年M月d日E"} GyMMMd{"Gy年M月d日"} MEd{"d/M(E)"} MMMEd{"M月d日E"} Md{"d/M"} y{"Gy年"} yyyy{"Gy年"} yyyyM{"Gy/M"} yyyyMEd{"Gy/M/dE"} yyyyMMM{"Gy年M月"} yyyyMMMEd{"Gy年M月d日E"} yyyyMMMM{"Gy年M月"} yyyyMMMd{"Gy年M月d日"} yyyyMd{"Gy/M/d"} yyyyQQQ{"Gy年QQQ"} yyyyQQQQ{"Gy年QQQQ"} } intervalFormats{ MEd{ M{"d/M(E) 至 d/M(E)"} d{"d/M(E) 至 d/M(E)"} } Md{ M{"d/M 至 d/M"} d{"d/M 至 d/M"} } y{ y{"Gy年至y年"} } yM{ M{"Gy/M至y/M"} y{"Gy/M至y/M"} } yMEd{ M{"Gy/M/dE至y/M/dE"} d{"Gy/M/dE至y/M/dE"} y{"Gy/M/dE至y/M/dE"} } yMMM{ M{"Gy年M月至M月"} y{"Gy年M月至y年M月"} } yMMMEd{ M{"Gy年M月d日E至M月d日E"} d{"Gy年M月d日E至d日E"} y{"Gy年M月d日E至y年M月d日E"} } yMMMM{ M{"Gy年M月至M月"} y{"Gy年M月至y年M月"} } yMMMd{ M{"Gy年M月d日至M月d日"} d{"Gy年M月d日至d日"} y{"Gy年M月d日至y年M月d日"} } yMd{ M{"Gy/M/d至y/M/d"} d{"Gy/M/d至y/M/d"} y{"Gy/M/d至y/M/d"} } } } gregorian{ DateTimePatterns{ "ah:mm:ss [zzzz]", "ah:mm:ss [z]", "ah:mm:ss", "ah:mm", "y年M月d日EEEE", "y年M月d日", "y年M月d日", "d/M/y", "{1} {0}", "{1} {0}", "{1} {0}", "{1} {0}", "{1} {0}", } availableFormats{ Ed{"d日E"} GyMMMEd{"Gy年M月d日E"} MEd{"d/M(E)"} MMMEd{"M月d日E"} MMMMW{ other{"M月第W週"} } MMdd{"dd/MM"} Md{"d/M"} yM{"M/y"} yMEd{"d/M/y(E)"} yMM{"MM/y"} yMMMEd{"y年M月d日E"} yMd{"d/M/y"} yw{ other{"Y年第w週"} } } dayPeriod{ format{ abbreviated{ afternoon1{"中午"} afternoon2{"下午"} evening1{"晚上"} midnight{"午夜"} morning1{"早上"} night1{"凌晨"} } narrow{ afternoon1{"中午"} afternoon2{"下午"} evening1{"晚上"} midnight{"午夜"} morning1{"早上"} night1{"凌晨"} } wide{ afternoon1{"中午"} afternoon2{"下午"} evening1{"晚上"} midnight{"午夜"} morning1{"早上"} night1{"凌晨"} } } stand-alone{ abbreviated{ afternoon1{"中午"} afternoon2{"下午"} evening1{"晚上"} morning1{"早上"} night1{"凌晨"} } narrow{ afternoon1{"中午"} afternoon2{"下午"} evening1{"晚上"} morning1{"早上"} night1{"凌晨"} } wide{ afternoon1{"中午"} afternoon2{"下午"} evening1{"晚上"} morning1{"早上"} night1{"凌晨"} } } } eras{ abbreviated{ "公元前", "公元", } narrow{ "公元前", "公元", } wide{ "公元前", "公元", } } intervalFormats{ MEd{ M{"d/M(E) 至 d/M(E)"} d{"d/M(E) 至 d/M(E)"} } Md{ M{"d/M 至 d/M"} d{"d/M 至 d/M"} } yM{ M{"M/y 至 M/y"} y{"M/y 至 M/y"} } yMEd{ M{"d/M/y(E) 至 d/M/y(E)"} d{"d/M/y(E) 至 d/M/y(E)"} y{"d/M/y(E) 至 d/M/y(E)"} } yMd{ M{"d/M/y 至 d/M/y"} d{"d/M/y 至 d/M/y"} y{"d/M/y 至 d/M/y"} } } quarters{ format{ abbreviated{ "Q1", "Q2", "Q3", "Q4", } } stand-alone{ abbreviated{ "Q1", "Q2", "Q3", "Q4", } } } } roc{ availableFormats{ Ed{"d日E"} MEd{"d-M(E)"} Md{"d-M"} yyyyMEd{"Gy/M/dE"} } } } characterLabel{ arrows{"箭嘴"} downwards_arrows{"左右箭嘴"} downwards_upwards_arrows{"上下箭嘴"} leftwards_arrows{"向左箭嘴"} leftwards_rightwards_arrows{"左右箭嘴"} rightwards_arrows{"向右箭嘴"} upwards_arrows{"向上箭嘴"} } fields{ day{ relative{ "-1"{"昨日"} "-2"{"前日"} "0"{"今日"} "1"{"明日"} "2"{"後日"} } relativeTime{ future{ other{"{0} 日後"} } past{ other{"{0} 日前"} } } } day-narrow{ relative{ "-1"{"昨日"} "-2"{"前日"} "0"{"今日"} "1"{"明日"} "2"{"後日"} } relativeTime{ future{ other{"{0}日後"} } past{ other{"{0}日前"} } } } day-short{ relative{ "-1"{"昨日"} "-2"{"前日"} "0"{"今日"} "1"{"明日"} "2"{"後日"} } relativeTime{ future{ other{"{0} 日後"} } past{ other{"{0} 日前"} } } } fri{ relative{ "-1"{"上星期五"} "0"{"本星期五"} "1"{"下星期五"} } relativeTime{ future{ other{"{0} 個星期五後"} } past{ other{"{0} 個星期五前"} } } } fri-narrow{ relativeTime{ future{ other{"{0} 個星期五後"} } past{ other{"{0} 個星期五前"} } } } fri-short{ relative{ "-1"{"上星期五"} "0"{"本星期五"} "1"{"下星期五"} } relativeTime{ future{ other{"{0} 個星期五後"} } past{ other{"{0} 個星期五前"} } } } hour{ relative{ "0"{"這個小時"} } } hour-narrow{ dn{"時"} relative{ "0"{"這個小時"} } relativeTime{ future{ other{"{0}小時後"} } past{ other{"{0}小時前"} } } } hour-short{ relative{ "0"{"這個小時"} } } minute{ relative{ "0"{"這分鐘"} } } minute-narrow{ dn{"分"} relative{ "0"{"這分鐘"} } relativeTime{ future{ other{"{0}分後"} } past{ other{"{0}分前"} } } } minute-short{ relative{ "0"{"這分鐘"} } } mon{ relative{ "-1"{"上星期一"} "0"{"本星期一"} "1"{"下星期一"} } relativeTime{ future{ other{"{0} 個星期一後"} } past{ other{"{0} 個星期一前"} } } } mon-narrow{ relativeTime{ future{ other{"{0} 個星期一後"} } past{ other{"{0} 個星期一前"} } } } mon-short{ relative{ "-1"{"上星期一"} "0"{"本星期一"} "1"{"下星期一"} } relativeTime{ future{ other{"{0} 個星期一後"} } past{ other{"{0} 個星期一前"} } } } month-narrow{ relativeTime{ future{ other{"{0}個月後"} } past{ other{"{0}個月前"} } } } quarter{ relative{ "-1"{"上一季"} "0"{"今季"} "1"{"下一季"} } } quarter-narrow{ relative{ "-1"{"上季"} "0"{"今季"} "1"{"下季"} } relativeTime{ future{ other{"+{0}Q"} } past{ other{"-{0}Q"} } } } quarter-short{ relative{ "-1"{"上季"} "0"{"今季"} "1"{"下季"} } } sat{ relative{ "-1"{"上星期六"} "0"{"本星期六"} "1"{"下星期六"} } relativeTime{ future{ other{"{0} 個星期六後"} } past{ other{"{0} 個星期六前"} } } } sat-narrow{ relativeTime{ future{ other{"{0} 個星期六後"} } past{ other{"{0} 個星期六前"} } } } sat-short{ relative{ "-1"{"上星期六"} "0"{"本星期六"} "1"{"下星期六"} } relativeTime{ future{ other{"{0} 個星期六後"} } past{ other{"{0} 個星期六前"} } } } second-narrow{ relativeTime{ future{ other{"{0}秒後"} } past{ other{"{0}秒前"} } } } sun{ relative{ "-1"{"上星期日"} "0"{"本星期日"} "1"{"下星期日"} } relativeTime{ future{ other{"{0} 個星期日後"} } past{ other{"{0} 個星期日前"} } } } sun-narrow{ relativeTime{ future{ other{"{0} 個星期日後"} } past{ other{"{0} 個星期日前"} } } } sun-short{ relative{ "-1"{"上星期日"} "0"{"本星期日"} "1"{"下星期日"} } relativeTime{ future{ other{"{0} 個星期日後"} } past{ other{"{0} 個星期日前"} } } } thu{ relative{ "-1"{"上星期四"} "0"{"本星期四"} "1"{"下星期四"} } relativeTime{ future{ other{"{0} 個星期四後"} } past{ other{"{0} 個星期四前"} } } } thu-narrow{ relativeTime{ future{ other{"{0} 個星期四後"} } past{ other{"{0} 個星期四前"} } } } thu-short{ relative{ "-1"{"上星期四"} "0"{"本星期四"} "1"{"下星期四"} } relativeTime{ future{ other{"{0} 個星期四後"} } past{ other{"{0} 個星期四前"} } } } tue{ relative{ "-1"{"上星期二"} "0"{"本星期二"} "1"{"下星期二"} } relativeTime{ future{ other{"{0} 個星期二後"} } past{ other{"{0} 個星期二前"} } } } tue-narrow{ relativeTime{ future{ other{"{0} 個星期二後"} } past{ other{"{0} 個星期二前"} } } } tue-short{ relative{ "-1"{"上星期二"} "0"{"本星期二"} "1"{"下星期二"} } relativeTime{ future{ other{"{0} 個星期二後"} } past{ other{"{0} 個星期二前"} } } } wed{ relative{ "-1"{"上星期三"} "0"{"本星期三"} "1"{"下星期三"} } relativeTime{ future{ other{"{0} 個星期三後"} } past{ other{"{0} 個星期三前"} } } } wed-narrow{ relativeTime{ future{ other{"{0} 個星期三後"} } past{ other{"{0} 個星期三前"} } } } wed-short{ relative{ "-1"{"上星期三"} "0"{"本星期三"} "1"{"下星期三"} } relativeTime{ future{ other{"{0} 個星期三後"} } past{ other{"{0} 個星期三前"} } } } week{ dn{"星期"} relative{ "-1"{"上星期"} "0"{"本星期"} "1"{"下星期"} } relativeTime{ future{ other{"{0} 星期後"} } past{ other{"{0} 星期前"} } } } week-narrow{ relative{ "-1"{"上星期"} "0"{"本星期"} "1"{"下星期"} } relativeTime{ future{ other{"{0}星期後"} } past{ other{"{0}星期前"} } } } week-short{ dn{"星期"} relative{ "-1"{"上星期"} "0"{"本星期"} "1"{"下星期"} } relativeTime{ future{ other{"{0} 星期後"} } past{ other{"{0} 星期前"} } } } weekday{ dn{"星期幾"} } weekday-narrow{ dn{"星期幾"} } weekday-short{ dn{"星期幾"} } year{ relative{ "-1"{"上年"} "0"{"今年"} "1"{"下年"} } } year-narrow{ relative{ "-1"{"上年"} "0"{"今年"} "1"{"下年"} } relativeTime{ future{ other{"{0}年後"} } past{ other{"{0}年前"} } } } year-short{ relative{ "-1"{"上年"} "0"{"今年"} "1"{"下年"} } } } listPattern{ standard{ 2{"{0}及{1}"} end{"{0}及{1}"} } standard-short{ 2{"{0}及{1}"} end{"{0}及{1}"} } } }
{ "pile_set_name": "Github" }
// EDK2 #include <Uefi.h> #include <Library/UefiLib.h> EFI_STATUS EFIAPI UefiMain(IN EFI_HANDLE IH, IN EFI_SYSTEM_TABLE *ST) { auto console = ST->ConOut; //We want blank screen! console->ClearScreen(console); CHAR16 *msg = L"Hello world!"; console->OutString(msg); // Pause while(1); //Never get to here, just make compiler happy :) return EFI_SUCCESS; }
{ "pile_set_name": "Github" }
PY_LIBRARY() VERSION(1.10) LICENSE(BSD) NO_WERROR() NO_WSHADOW() NO_COMPILER_WARNINGS() ENABLE(NO_WIN32_LEAN) PY_REGISTER(_scandir) SRCS( _scandir.c ) PY_SRCS( TOP_LEVEL scandir.py ) RESOURCE_FILES( PREFIX contrib/python/scandir/ .dist-info/METADATA .dist-info/top_level.txt ) NO_LINT() END() RECURSE_FOR_TESTS( tests )
{ "pile_set_name": "Github" }
{ "info" : { "version" : 1, "author" : "xcode" } }
{ "pile_set_name": "Github" }
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. //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 UUID_618474C2DE1511DEB74A388C56D89593 #define UUID_618474C2DE1511DEB74A388C56D89593 #if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma GCC system_header #endif #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(push,1) #endif #include <boost/config.hpp> #ifdef BOOST_NO_EXCEPTIONS #error This header requires exception handling to be enabled. #endif #include <boost/exception/exception.hpp> #include <boost/exception/info.hpp> #include <boost/exception/diagnostic_information.hpp> #include <boost/exception/detail/type_info.hpp> #include <boost/exception/detail/clone_current_exception.hpp> #ifndef BOOST_NO_RTTI #include <boost/core/demangle.hpp> #endif #include <boost/shared_ptr.hpp> #include <stdexcept> #include <new> #include <ios> #include <stdlib.h> namespace boost { class exception_ptr; BOOST_NORETURN void rethrow_exception( exception_ptr const & ); exception_ptr current_exception(); class exception_ptr { typedef boost::shared_ptr<exception_detail::clone_base const> impl; impl ptr_; friend void rethrow_exception( exception_ptr const & ); typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const; public: exception_ptr() { } explicit exception_ptr( impl const & ptr ): ptr_(ptr) { } bool operator==( exception_ptr const & other ) const { return ptr_==other.ptr_; } bool operator!=( exception_ptr const & other ) const { return ptr_!=other.ptr_; } operator unspecified_bool_type() const { return ptr_?&impl::get:0; } }; template <class T> inline exception_ptr copy_exception( T const & e ) { try { throw enable_current_exception(e); } catch( ... ) { return current_exception(); } } #ifndef BOOST_NO_RTTI typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type; inline std::string to_string( original_exception_type const & x ) { return core::demangle(x.value()->name()); } #endif namespace exception_detail { struct bad_alloc_: boost::exception, std::bad_alloc { ~bad_alloc_() throw() { } }; struct bad_exception_: boost::exception, std::bad_exception { ~bad_exception_() throw() { } }; template <class Exception> exception_ptr get_static_exception_object() { Exception ba; exception_detail::clone_impl<Exception> c(ba); #ifndef BOOST_EXCEPTION_DISABLE c << throw_function(BOOST_CURRENT_FUNCTION) << throw_file(__FILE__) << throw_line(__LINE__); #endif static exception_ptr ep(shared_ptr<exception_detail::clone_base const>(new exception_detail::clone_impl<Exception>(c))); return ep; } template <class Exception> struct exception_ptr_static_exception_object { static exception_ptr const e; }; template <class Exception> exception_ptr const exception_ptr_static_exception_object<Exception>:: e = get_static_exception_object<Exception>(); } #if defined(__GNUC__) # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) # pragma GCC visibility push (default) # endif #endif class unknown_exception: public boost::exception, public std::exception { public: unknown_exception() { } explicit unknown_exception( std::exception const & e ) { add_original_type(e); } explicit unknown_exception( boost::exception const & e ): boost::exception(e) { add_original_type(e); } ~unknown_exception() throw() { } private: template <class E> void add_original_type( E const & e ) { #ifndef BOOST_NO_RTTI (*this) << original_exception_type(&typeid(e)); #endif } }; #if defined(__GNUC__) # if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4) # pragma GCC visibility pop # endif #endif namespace exception_detail { template <class T> class current_exception_std_exception_wrapper: public T, public boost::exception { public: explicit current_exception_std_exception_wrapper( T const & e1 ): T(e1) { add_original_type(e1); } current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ): T(e1), boost::exception(e2) { add_original_type(e1); } ~current_exception_std_exception_wrapper() throw() { } private: template <class E> void add_original_type( E const & e ) { #ifndef BOOST_NO_RTTI (*this) << original_exception_type(&typeid(e)); #endif } }; #ifdef BOOST_NO_RTTI template <class T> boost::exception const * get_boost_exception( T const * ) { try { throw; } catch( boost::exception & x ) { return &x; } catch(...) { return 0; } } #else template <class T> boost::exception const * get_boost_exception( T const * x ) { return dynamic_cast<boost::exception const *>(x); } #endif template <class T> inline exception_ptr current_exception_std_exception( T const & e1 ) { if( boost::exception const * e2 = get_boost_exception(&e1) ) return boost::copy_exception(current_exception_std_exception_wrapper<T>(e1,*e2)); else return boost::copy_exception(current_exception_std_exception_wrapper<T>(e1)); } inline exception_ptr current_exception_unknown_exception() { return boost::copy_exception(unknown_exception()); } inline exception_ptr current_exception_unknown_boost_exception( boost::exception const & e ) { return boost::copy_exception(unknown_exception(e)); } inline exception_ptr current_exception_unknown_std_exception( std::exception const & e ) { if( boost::exception const * be = get_boost_exception(&e) ) return current_exception_unknown_boost_exception(*be); else return boost::copy_exception(unknown_exception(e)); } inline exception_ptr current_exception_impl() { exception_detail::clone_base const * e=0; switch( exception_detail::clone_current_exception(e) ) { case exception_detail::clone_current_exception_result:: success: { BOOST_ASSERT(e!=0); return exception_ptr(shared_ptr<exception_detail::clone_base const>(e)); } case exception_detail::clone_current_exception_result:: bad_alloc: { BOOST_ASSERT(!e); return exception_detail::exception_ptr_static_exception_object<bad_alloc_>::e; } case exception_detail::clone_current_exception_result:: bad_exception: { BOOST_ASSERT(!e); return exception_detail::exception_ptr_static_exception_object<bad_exception_>::e; } default: BOOST_ASSERT(0); case exception_detail::clone_current_exception_result:: not_supported: { BOOST_ASSERT(!e); try { throw; } catch( exception_detail::clone_base & e ) { return exception_ptr(shared_ptr<exception_detail::clone_base const>(e.clone())); } catch( std::domain_error & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::invalid_argument & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::length_error & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::out_of_range & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::logic_error & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::range_error & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::overflow_error & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::underflow_error & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::ios_base::failure & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::runtime_error & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::bad_alloc & e ) { return exception_detail::current_exception_std_exception(e); } #ifndef BOOST_NO_TYPEID catch( std::bad_cast & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::bad_typeid & e ) { return exception_detail::current_exception_std_exception(e); } #endif catch( std::bad_exception & e ) { return exception_detail::current_exception_std_exception(e); } catch( std::exception & e ) { return exception_detail::current_exception_unknown_std_exception(e); } catch( boost::exception & e ) { return exception_detail::current_exception_unknown_boost_exception(e); } catch( ... ) { return exception_detail::current_exception_unknown_exception(); } } } } } inline exception_ptr current_exception() { exception_ptr ret; try { ret=exception_detail::current_exception_impl(); } catch( std::bad_alloc & ) { ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_alloc_>::e; } catch( ... ) { ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_exception_>::e; } BOOST_ASSERT(ret); return ret; } BOOST_NORETURN inline void rethrow_exception( exception_ptr const & p ) { BOOST_ASSERT(p); p.ptr_->rethrow(); BOOST_ASSERT(0); #if defined(UNDER_CE) // some CE platforms don't define ::abort() exit(-1); #else abort(); #endif } inline std::string diagnostic_information( exception_ptr const & p, bool verbose=true ) { if( p ) try { rethrow_exception(p); } catch( ... ) { return current_exception_diagnostic_information(verbose); } return "<empty>"; } inline std::string to_string( exception_ptr const & p ) { std::string s='\n'+diagnostic_information(p); std::string padding(" "); std::string r; bool f=false; for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i ) { if( f ) r+=padding; char c=*i; r+=c; f=(c=='\n'); } return r; } } #if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) #pragma warning(pop) #endif #endif
{ "pile_set_name": "Github" }
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- The content of this page will be statically included into the top- right box of the cores overview page. Uncomment this as an example to see there the content will show up. <img src="img/ico/construction.png"> This line will appear at the top- right box on collection1's Overview -->
{ "pile_set_name": "Github" }
.so man3/avr_watchdog.3
{ "pile_set_name": "Github" }
import isContentHidden from '../isContentHidden'; window.getComputedStyle = element => ({ getPropertyValue: property => element.style[property], }); describe('isContentHidden', () => { it('should return true when the element has zero size and does not has content', () => { const element = { offsetWidth: 0, offsetHeight: 0, innerHTML: null, }; expect(isContentHidden(element)).toBe(true); }); it('should return true when the element has zero size and content, but overflow style is other than visible', () => { const element = { offsetWidth: 0, offsetHeight: 0, innerHTML: 'some content', style: { overflow: 'hidden', }, }; expect(isContentHidden(element)).toBe(true); }); it('should return false when the element has zero size and content, but overflow style is visible', () => { const element = { offsetWidth: 0, offsetHeight: 0, innerHTML: 'some content', style: { overflow: 'visible', }, }; expect(isContentHidden(element)).toBe(false); }); it('should return false when the element has not zero size, but display style is other than none', () => { const element = { offsetWidth: 10, style: { display: 'block', }, }; expect(isContentHidden(element)).toBe(false); }); it('should return true when the element has not zero size, but display style is none', () => { const element = { offsetWidth: 0, offsetHeight: 10, style: { display: 'none', }, }; expect(isContentHidden(element)).toBe(true); }); });
{ "pile_set_name": "Github" }
K 13 svn:mime-type V 24 application/octet-stream END
{ "pile_set_name": "Github" }
/****************************************************************************** * SOFA, Simulation Open-Framework Architecture * * (c) 2006 INRIA, USTL, UJF, CNRS, MGH * * * * This program is free software; you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as published by * * the Free Software Foundation; either version 2.1 of the License, or (at * * your option) any later version. * * * * This program is distributed in the hope that it will be useful, but WITHOUT * * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License * * for more details. * * * * You should have received a copy of the GNU Lesser General Public License * * along with this program. If not, see <http://www.gnu.org/licenses/>. * ******************************************************************************* * Authors: The SOFA Team and external contributors (see Authors.txt) * * * * Contact information: contact@sofa-framework.org * ******************************************************************************/ #define FLEXIBLE_StrainTYPES_CPP #include "../types/StrainTypes.h" #include <sofa/core/ObjectFactory.h> #include <sofa/core/State.inl> #include <SofaBaseMechanics/MechanicalObject.inl> #include <sofa/defaulttype/TemplatesAliases.h> using sofa::defaulttype::RegisterTemplateAlias; namespace sofa { namespace component { namespace container { // ========================================================================== // Instanciation using namespace sofa::defaulttype; int StrainMechanicalObjectClass = core::RegisterObject ( "mechanical state vectors" ) .add< MechanicalObject<E331Types> >() .add< MechanicalObject<E321Types> >() .add< MechanicalObject<E311Types> >() .add< MechanicalObject<E332Types> >() .add< MechanicalObject<E333Types> >() .add< MechanicalObject<E221Types> >() .add< MechanicalObject<I331Types> >() .add< MechanicalObject<U331Types> >() .add< MechanicalObject<U321Types> >(); template class SOFA_Flexible_API MechanicalObject<E331Types>; template class SOFA_Flexible_API MechanicalObject<E321Types>; template class SOFA_Flexible_API MechanicalObject<E311Types>; template class SOFA_Flexible_API MechanicalObject<E332Types>; template class SOFA_Flexible_API MechanicalObject<E333Types>; template class SOFA_Flexible_API MechanicalObject<E221Types>; template class SOFA_Flexible_API MechanicalObject<I331Types>; template class SOFA_Flexible_API MechanicalObject<U331Types>; template class SOFA_Flexible_API MechanicalObject<U321Types>; static RegisterTemplateAlias alias1("E331", E331Types::Name()); static RegisterTemplateAlias alias2("E321", E321Types::Name()); static RegisterTemplateAlias alias3("E311", E311Types::Name()); static RegisterTemplateAlias alias4("E332", E332Types::Name()); static RegisterTemplateAlias alias5("E333", E333Types::Name()); static RegisterTemplateAlias alias6("E221", E221Types::Name()); static RegisterTemplateAlias alias7("I331", I331Types::Name()); static RegisterTemplateAlias alias8("U331", U331Types::Name()); static RegisterTemplateAlias alias9("U321", U321Types::Name()); namespace f { static RegisterTemplateAlias alias1("E331f", E331Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias2("E321f", E321Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias3("E311f", E311Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias4("E332f", E332Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias5("E333f", E333Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias6("E221f", E221Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias7("I331f", I331Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias8("U331f", U331Types::Name(), isSRealDouble()); static RegisterTemplateAlias alias9("U321f", U321Types::Name(), isSRealDouble()); } namespace d { static RegisterTemplateAlias alias1("E331d", E331Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias2("E321d", E321Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias3("E311d", E311Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias4("E332d", E332Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias5("E333d", E333Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias6("E221d", E221Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias7("I331d", I331Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias8("U331d", U331Types::Name(), isSRealFloat()); static RegisterTemplateAlias alias9("U321d", U321Types::Name(), isSRealFloat()); } } // namespace container } // namespace component } // namespace sofa
{ "pile_set_name": "Github" }
-- tkt1443.test -- -- execsql { -- CREATE TABLE Items( -- itemId integer primary key, -- item str unique -- ); -- INSERT INTO "Items" VALUES(0, 'ALL'); -- INSERT INTO "Items" VALUES(1, 'double:source'); -- INSERT INTO "Items" VALUES(2, 'double'); -- INSERT INTO "Items" VALUES(3, 'double:runtime'); -- INSERT INTO "Items" VALUES(4, '.*:runtime'); -- -- CREATE TABLE Labels( -- labelId INTEGER PRIMARY KEY, -- label STR UNIQUE -- ); -- INSERT INTO "Labels" VALUES(0, 'ALL'); -- INSERT INTO "Labels" VALUES(1, 'localhost@rpl:linux'); -- INSERT INTO "Labels" VALUES(2, 'localhost@rpl:branch'); -- -- CREATE TABLE LabelMap( -- itemId INTEGER, -- labelId INTEGER, -- branchId integer -- ); -- INSERT INTO "LabelMap" VALUES(1, 1, 1); -- INSERT INTO "LabelMap" VALUES(2, 1, 1); -- INSERT INTO "LabelMap" VALUES(3, 1, 1); -- INSERT INTO "LabelMap" VALUES(1, 2, 2); -- INSERT INTO "LabelMap" VALUES(2, 2, 3); -- INSERT INTO "LabelMap" VALUES(3, 2, 3); -- -- CREATE TABLE Users ( -- userId INTEGER PRIMARY KEY, -- user STRING UNIQUE, -- salt BINARY, -- password STRING -- ); -- INSERT INTO "Users" VALUES(1, 'test', 'Šæd', -- '43ba0f45014306bd6df529551ffdb3df'); -- INSERT INTO "Users" VALUES(2, 'limited', 'ªš>S', -- 'cf07c8348fdf675cc1f7696b7d45191b'); -- CREATE TABLE UserGroups ( -- userGroupId INTEGER PRIMARY KEY, -- userGroup STRING UNIQUE -- ); -- INSERT INTO "UserGroups" VALUES(1, 'test'); -- INSERT INTO "UserGroups" VALUES(2, 'limited'); -- -- CREATE TABLE UserGroupMembers ( -- userGroupId INTEGER, -- userId INTEGER -- ); -- INSERT INTO "UserGroupMembers" VALUES(1, 1); -- INSERT INTO "UserGroupMembers" VALUES(2, 2); -- -- CREATE TABLE Permissions ( -- userGroupId INTEGER, -- labelId INTEGER NOT NULL, -- itemId INTEGER NOT NULL, -- write INTEGER, -- capped INTEGER, -- admin INTEGER -- ); -- INSERT INTO "Permissions" VALUES(1, 0, 0, 1, 0, 1); -- INSERT INTO "Permissions" VALUES(2, 2, 4, 0, 0, 0); -- } CREATE TABLE Items( itemId integer primary key, item str unique ); INSERT INTO "Items" VALUES(0, 'ALL'); INSERT INTO "Items" VALUES(1, 'double:source'); INSERT INTO "Items" VALUES(2, 'double'); INSERT INTO "Items" VALUES(3, 'double:runtime'); INSERT INTO "Items" VALUES(4, '.*:runtime'); CREATE TABLE Labels( labelId INTEGER PRIMARY KEY, label STR UNIQUE ); INSERT INTO "Labels" VALUES(0, 'ALL'); INSERT INTO "Labels" VALUES(1, 'localhost@rpl:linux'); INSERT INTO "Labels" VALUES(2, 'localhost@rpl:branch'); CREATE TABLE LabelMap( itemId INTEGER, labelId INTEGER, branchId integer ); INSERT INTO "LabelMap" VALUES(1, 1, 1); INSERT INTO "LabelMap" VALUES(2, 1, 1); INSERT INTO "LabelMap" VALUES(3, 1, 1); INSERT INTO "LabelMap" VALUES(1, 2, 2); INSERT INTO "LabelMap" VALUES(2, 2, 3); INSERT INTO "LabelMap" VALUES(3, 2, 3); CREATE TABLE Users ( userId INTEGER PRIMARY KEY, user STRING UNIQUE, salt BINARY, password STRING ); INSERT INTO "Users" VALUES(1, 'test', 'Šæd', '43ba0f45014306bd6df529551ffdb3df'); INSERT INTO "Users" VALUES(2, 'limited', 'ªš>S', 'cf07c8348fdf675cc1f7696b7d45191b'); CREATE TABLE UserGroups ( userGroupId INTEGER PRIMARY KEY, userGroup STRING UNIQUE ); INSERT INTO "UserGroups" VALUES(1, 'test'); INSERT INTO "UserGroups" VALUES(2, 'limited'); CREATE TABLE UserGroupMembers ( userGroupId INTEGER, userId INTEGER ); INSERT INTO "UserGroupMembers" VALUES(1, 1); INSERT INTO "UserGroupMembers" VALUES(2, 2); CREATE TABLE Permissions ( userGroupId INTEGER, labelId INTEGER NOT NULL, itemId INTEGER NOT NULL, write INTEGER, capped INTEGER, admin INTEGER ); INSERT INTO "Permissions" VALUES(1, 0, 0, 1, 0, 1); INSERT INTO "Permissions" VALUES(2, 2, 4, 0, 0, 0);
{ "pile_set_name": "Github" }
<?php /* * This file is part of Twig. * * (c) 2009 Fabien Potencier * (c) 2009 Armin Ronacher * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ class Twig_Node_Expression_Binary_Concat extends Twig_Node_Expression_Binary { public function operator(Twig_Compiler $compiler) { return $compiler->raw('.'); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="UTF-8"?> <table xmlns="http://query.yahooapis.com/v1/schema/table.xsd"> <meta> <author>Paul Tarjan</author> <description>Mimetype translations</description> <sampleQuery>SELECT * FROM {table} WHERE mimetype = "application/pdf"</sampleQuery> <documentationURL>http://stdicon.com/</documentationURL> </meta> <bindings> <select itemPath="" produces="XML"> <urls> <url>http://stdicon.com/mimetype/{mimetype}</url> </urls> <inputs> <key id="mimetype" type="xs:string" paramType="path" required="true" /> </inputs> <execute><![CDATA[ response.object = request.get().response; ]]> </execute> </select> </bindings> </table>
{ "pile_set_name": "Github" }
import * as React from 'react'; import { TypeStyleButton } from './TypeStyleButton/TypeStyleButton'; export const StylesDemo: React.FC = () => ( <div> <div><TypeStyleButton /></div> </div> );
{ "pile_set_name": "Github" }
// Copyright 2016 The Closure Rules Authors. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package io.bazel.rules.closure.webfiles; import static com.google.common.truth.Truth.assertThat; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.base.Suppliers; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Multimap; import com.google.common.jimfs.Configuration; import com.google.common.jimfs.Jimfs; import io.bazel.rules.closure.webfiles.BuildInfo.Webfiles; import io.bazel.rules.closure.webfiles.BuildInfo.WebfilesSource; import io.bazel.rules.closure.webfiles.compiler.CssParser; import java.io.IOException; import java.nio.file.FileSystem; import java.nio.file.Files; import java.nio.file.Path; import org.junit.After; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; /** Unit tests for {@link WebfilesValidator}. */ @RunWith(JUnit4.class) public class WebfilesValidatorTest { private final FileSystem fs = Jimfs.newFileSystem(Configuration.unix()); private final WebfilesValidator validator = new WebfilesValidator(fs, new CssParser()); @After public void after() throws Exception { fs.close(); } @Test public void relativeReferenceToImgInSrcs_isAllowed() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"hello.jpg\">"); save(fs.getPath("/fs/path/hello.jpg"), "oh my goth"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/hello.jpg") .setWebpath("/web/path/hello.jpg") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void relativeReferenceToImgInDirectDeps_isAllowed() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"hello.jpg\">"); save(fs.getPath("/fs/path/hello.jpg"), "oh my goth"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.of( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/hello.jpg") .setWebpath("/web/path/hello.jpg") .build()) .build()), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void relativeReferenceToUndeclaredAsset_printsError() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"hello.jpg\">"); save(fs.getPath("/fs/path/hello.jpg"), "oh my goth"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .containsEntry( WebfilesValidator.STRICT_DEPENDENCIES_ERROR, "/fs/path/index.html: Referenced hello.jpg (/web/path/hello.jpg)" + " without depending on a web_library() rule providing it"); } @Test public void relativeReferenceToImgInTransitiveDeps_showsLabelToUse() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"hello.jpg\">"); save(fs.getPath("/fs/path/hello.jpg"), "oh my goth"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance( ImmutableList.of( Webfiles.newBuilder() .setLabel("@foo//bar") .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/hello.jpg") .setWebpath("/web/path/hello.jpg") .build()) .build())))) .containsEntry( WebfilesValidator.STRICT_DEPENDENCIES_ERROR, "/fs/path/index.html: Referenced hello.jpg (/web/path/hello.jpg)" + " without depending on @foo//bar"); } @Test public void absoluteReferenceToImgInSrcs_printsError() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"/a/b/c\">"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .containsEntry( WebfilesValidator.ABSOLUTE_PATH_ERROR, "/fs/path/index.html: Please use relative path for asset: /a/b/c"); } @Test public void weirdPolymerVariables_getIgnored() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"[[omg]]\">\n<img src=\"{{why}}\">\n"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void properUrls_getIgnored() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"http://google.com\">\n"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void dataUris_getIgnored() throws Exception { save(fs.getPath("/fs/path/index.html"), "<img src=\"data:base64;lolol\">\n"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void mailtoUris_getIgnored() throws Exception { save(fs.getPath("/fs/path/index.html"), "<a href=\"mailto:xxx@yyy.com\">email us</a>\n"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void cssUrls_areRecognized() throws Exception { save(fs.getPath("/fs/path/index.html"), "<link rel=\"stylesheet\" href=\"index.css\">"); save(fs.getPath("/fs/path/index.css"), "body { background: url(hello.jpg); }"); save(fs.getPath("/fs/path/hello.jpg"), "oh my goth"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.css") .setWebpath("/web/path/index.css") .build()) .build(), ImmutableList.of( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/hello.jpg") .setWebpath("/web/path/hello.jpg") .build()) .build()), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void badCssUrl_resultsInError() throws Exception { save(fs.getPath("/fs/path/index.html"), "<link rel=\"stylesheet\" href=\"index.css\">"); save(fs.getPath("/fs/path/index.css"), "body { background: url(hello.jpg); }"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.css") .setWebpath("/web/path/index.css") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isNotEmpty(); } @Test public void cyclicEdge_resultsInError() throws Exception { save(fs.getPath("/fs/path/index.html"), "<link rel=\"stylesheet\" href=\"index.css\">"); save(fs.getPath("/fs/path/index.css"), "body { background: url(index.html); }"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.css") .setWebpath("/web/path/index.css") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .containsEntry( WebfilesValidator.CYCLES_ERROR, "These webpaths are strongly connected; please make your html acyclic\n\n" + " - /web/path/index.css\n" + " - /web/path/index.html\n"); } @Test public void stronglyConnectiedComponent_resultsInError() throws Exception { save(fs.getPath("/fs/path/a.html"), "<link rel=\"import\" href=\"b.html\">"); save(fs.getPath("/fs/path/b.html"), "<link rel=\"import\" href=\"c.html\">"); save(fs.getPath("/fs/path/c.html"), "<link rel=\"import\" href=\"a.html\">"); assertThat( validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/a.html") .setWebpath("/web/path/a.html") .build()) .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/b.html") .setWebpath("/web/path/b.html") .build()) .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/c.html") .setWebpath("/web/path/c.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .containsEntry( WebfilesValidator.CYCLES_ERROR, "These webpaths are strongly connected; please make your html acyclic\n\n" + " - /web/path/a.html\n" + " - /web/path/b.html\n" + " - /web/path/c.html\n"); } @Test public void invalidHtml_doesntCare() throws Exception { // jsoup is too strict about html syntax errors to be useful for polymer and it doesn't provide // a very friendly way to report these errors. save(fs.getPath("/fs/path/index.html"), "< "); assertThat( validator.validate( Webfiles.newBuilder() .addSrc( WebfilesSource.newBuilder() .setPath("/fs/path/index.html") .setWebpath("/web/path/index.html") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of()))) .isEmpty(); } @Test public void invalidCssWithBadRelationshipAfterBadSyntax_stillAbleToFindUrl() throws Exception { save(fs.getPath("/fs/path/index.css"), ".{}\n.hi{background: url(nope.jpg)}"); Multimap<String, String> errors = validator.validate( Webfiles.newBuilder() .addSrc(WebfilesSource.newBuilder() .setPath("/fs/path/index.css") .setWebpath("/web/path/index.css") .build()) .build(), ImmutableList.<Webfiles>of(), Suppliers.ofInstance(ImmutableList.<Webfiles>of())); assertThat(errors).hasSize(1); assertThat(errors).containsKey(WebfilesValidator.STRICT_DEPENDENCIES_ERROR); assertThat(Iterables.getFirst(errors.get(WebfilesValidator.STRICT_DEPENDENCIES_ERROR), null)) .contains("nope.jpg"); } private void save(Path path, String contents) throws IOException { Files.createDirectories(path.getParent()); Files.write(path, contents.getBytes(UTF_8)); } }
{ "pile_set_name": "Github" }
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package search import ( "reflect" "strings" "testing" "golang.org/x/text/language" ) func TestCompile(t *testing.T) { for i, tc := range []struct { desc string pattern string options []Option n int }{{ desc: "empty", pattern: "", n: 0, }, { desc: "single", pattern: "a", n: 1, }, { desc: "keep modifier", pattern: "a\u0300", // U+0300: COMBINING GRAVE ACCENT n: 2, }, { desc: "remove modifier", pattern: "a\u0300", // U+0300: COMBINING GRAVE ACCENT options: []Option{IgnoreDiacritics}, n: 1, }, { desc: "single with double collation element", pattern: "ä", n: 2, }, { desc: "leading variable", pattern: " a", n: 2, }, { desc: "trailing variable", pattern: "aa ", n: 3, }, { desc: "leading and trailing variable", pattern: " äb ", n: 5, }, { desc: "keep interior variable", pattern: " ä b ", n: 6, }, { desc: "keep interior variables", pattern: " b ä ", n: 7, }, { desc: "remove ignoreables (zero-weights across the board)", pattern: "\u009Db\u009Dä\u009D", // U+009D: OPERATING SYSTEM COMMAND n: 3, }} { m := New(language.Und, tc.options...) p := m.CompileString(tc.pattern) if len(p.ce) != tc.n { t.Errorf("%d:%s: Compile(%+q): got %d; want %d", i, tc.desc, tc.pattern, len(p.ce), tc.n) } } } func TestNorm(t *testing.T) { // U+0300: COMBINING GRAVE ACCENT (CCC=230) // U+031B: COMBINING HORN (CCC=216) for _, tc := range []struct { desc string a string b string want bool // a and b compile into the same pattern? }{{ "simple", "eee\u0300\u031b", "eee\u031b\u0300", true, }, { "large number of modifiers in pattern", strings.Repeat("\u0300", 29) + "\u0318", "\u0318" + strings.Repeat("\u0300", 29), true, }, { "modifier overflow in pattern", strings.Repeat("\u0300", 30) + "\u0318", "\u0318" + strings.Repeat("\u0300", 30), false, }} { m := New(language.Und) a := m.CompileString(tc.a) b := m.CompileString(tc.b) if got := reflect.DeepEqual(a, b); got != tc.want { t.Errorf("Compile(a) == Compile(b) == %v; want %v", got, tc.want) } } } func TestForwardSearch(t *testing.T) { for i, tc := range []struct { desc string tag string options []Option pattern string text string want []int }{{ // The semantics of an empty search is to match nothing. // TODO: change this to be in line with strings.Index? It is quite a // different beast, so not sure yet. desc: "empty pattern and text", tag: "und", pattern: "", text: "", want: nil, // TODO: consider: []int{0, 0}, }, { desc: "non-empty pattern and empty text", tag: "und", pattern: " ", text: "", want: nil, }, { desc: "empty pattern and non-empty text", tag: "und", pattern: "", text: "abc", want: nil, // TODO: consider: []int{0, 0, 1, 1, 2, 2, 3, 3}, }, { // Variable-only patterns. We don't support variables at the moment, // but verify that, given this, the behavior is indeed as expected. desc: "exact match of variable", tag: "und", pattern: " ", text: " ", want: []int{0, 1}, }, { desc: "variables not handled by default", tag: "und", pattern: "- ", text: " -", want: nil, // Would be (1, 2) for a median match with variable}. }, { desc: "multiple subsequent identical variables", tag: "und", pattern: " ", text: " ", want: []int{0, 1, 1, 2, 2, 3, 3, 4}, }, { desc: "text with variables", tag: "und", options: []Option{IgnoreDiacritics}, pattern: "abc", text: "3 abc 3", want: []int{2, 5}, }, { desc: "pattern with interior variables", tag: "und", options: []Option{IgnoreDiacritics}, pattern: "a b c", text: "3 a b c abc a b c 3", want: []int{2, 7}, // Would have 3 matches using variable. // TODO: Different variable handling settings. }, { // Options. desc: "match all levels", tag: "und", pattern: "Abc", text: "abcAbcABCÁbcábc", want: []int{3, 6}, }, { desc: "ignore diacritics in text", tag: "und", options: []Option{IgnoreDiacritics}, pattern: "Abc", text: "Ábc", want: []int{0, 4}, }, { desc: "ignore diacritics in pattern", tag: "und", options: []Option{IgnoreDiacritics}, pattern: "Ábc", text: "Abc", want: []int{0, 3}, }, { desc: "ignore diacritics", tag: "und", options: []Option{IgnoreDiacritics}, pattern: "Abc", text: "abcAbcABCÁbcábc", want: []int{3, 6, 9, 13}, }, { desc: "ignore case", tag: "und", options: []Option{IgnoreCase}, pattern: "Abc", text: "abcAbcABCÁbcábc", want: []int{0, 3, 3, 6, 6, 9}, }, { desc: "ignore case and diacritics", tag: "und", options: []Option{IgnoreCase, IgnoreDiacritics}, pattern: "Abc", text: "abcAbcABCÁbcábc", want: []int{0, 3, 3, 6, 6, 9, 9, 13, 13, 17}, }, { desc: "ignore width to fullwidth", tag: "und", options: []Option{IgnoreWidth}, pattern: "abc", text: "123 \uFF41\uFF42\uFF43 123", // U+FF41-3: FULLWIDTH LATIN SMALL LETTER A-C want: []int{4, 13}, }, { // TODO: distinguish between case and width. desc: "don't ignore width to fullwidth, ignoring only case", tag: "und", options: []Option{IgnoreCase}, pattern: "abc", text: "123 \uFF41\uFF42\uFF43 123", // U+FF41-3: FULLWIDTH LATIN SMALL LETTER A-C want: []int{4, 13}, }, { desc: "ignore width to fullwidth and diacritics", tag: "und", options: []Option{IgnoreWidth, IgnoreDiacritics}, pattern: "abc", text: "123 \uFF41\uFF42\uFF43 123", // U+FF41-3: FULLWIDTH LATIN SMALL LETTER A-C want: []int{4, 13}, }, { desc: "whole grapheme, single rune", tag: "und", pattern: "eee", text: "123 eeé 123", want: nil, }, { // Note: rules on when to apply contractions may, for certain languages, // differ between search and collation. For example, "ch" is not // considered a contraction for the purpose of searching in Spanish. // Therefore, be careful picking this test. desc: "whole grapheme, contractions", tag: "da", pattern: "aba", // Fails at the primary level, because "aa" is a contraction. text: "123 abaa 123", want: []int{}, }, { desc: "whole grapheme, trailing modifier", tag: "und", pattern: "eee", text: "123 eee\u0300 123", // U+0300: COMBINING GRAVE ACCENT want: nil, }, { // Language-specific matching. desc: "", tag: "da", options: []Option{IgnoreCase}, pattern: "Århus", text: "AarhusÅrhus Århus ", want: []int{0, 6, 6, 12, 14, 20}, }, { desc: "", tag: "da", options: []Option{IgnoreCase}, pattern: "Aarhus", text: "Århus Aarhus", want: []int{0, 6, 7, 13}, }, { desc: "", tag: "en", // Å does not match A for English. options: []Option{IgnoreCase}, pattern: "Aarhus", text: "Århus", want: nil, }, { desc: "ignore modifier in text", options: []Option{IgnoreDiacritics}, tag: "und", pattern: "eee", text: "123 eee\u0300 123", // U+0300: COMBINING GRAVE ACCENT want: []int{4, 9}, // Matches on grapheme boundary. }, { desc: "ignore multiple modifiers in text", options: []Option{IgnoreDiacritics}, tag: "und", pattern: "eee", text: "123 eee\u0300\u0300 123", // U+0300: COMBINING GRAVE ACCENT want: []int{4, 11}, // Matches on grapheme boundary. }, { desc: "ignore modifier in pattern", options: []Option{IgnoreDiacritics}, tag: "und", pattern: "eee\u0300", // U+0300: COMBINING GRAVE ACCENT text: "123 eee 123", want: []int{4, 7}, }, { desc: "ignore multiple modifiers in pattern", options: []Option{IgnoreDiacritics}, tag: "und", pattern: "eee\u0300\u0300", // U+0300: COMBINING GRAVE ACCENT text: "123 eee 123", want: []int{4, 7}, }, { desc: "match non-normalized pattern", tag: "und", // U+0300: COMBINING GRAVE ACCENT (CCC=230) // U+031B: COMBINING HORN (CCC=216) pattern: "eee\u0300\u031b", text: "123 eee\u031b\u0300 123", want: []int{4, 11}, }, { desc: "match non-normalized text", tag: "und", // U+0300: COMBINING GRAVE ACCENT (CCC=230) // U+031B: COMBINING HORN (CCC=216) pattern: "eee\u031b\u0300", text: "123 eee\u0300\u031b 123", want: []int{4, 11}, }} { m := New(language.MustParse(tc.tag), tc.options...) p := m.CompileString(tc.pattern) for j := 0; j < len(tc.text); { start, end := p.IndexString(tc.text[j:]) if start == -1 && end == -1 { j++ continue } start += j end += j j = end if len(tc.want) == 0 { t.Errorf("%d:%s: found unexpected result [%d %d]", i, tc.desc, start, end) break } if tc.want[0] != start || tc.want[1] != end { t.Errorf("%d:%s: got [%d %d]; want %v", i, tc.desc, start, end, tc.want[:2]) tc.want = tc.want[2:] break } tc.want = tc.want[2:] } if len(tc.want) != 0 { t.Errorf("%d:%s: %d extra results", i, tc.desc, len(tc.want)/2) } } }
{ "pile_set_name": "Github" }
# ========================================================================== # # UnitDblConverter # # ========================================================================== """UnitDblConverter module containing class UnitDblConverter.""" # ========================================================================== # Place all imports after here. # import numpy as np import matplotlib.units as units import matplotlib.projections.polar as polar from matplotlib.cbook import iterable # # Place all imports before here. # ========================================================================== __all__ = ['UnitDblConverter'] # ========================================================================== # A special function for use with the matplotlib FuncFormatter class # for formatting axes with radian units. # This was copied from matplotlib example code. def rad_fn(x, pos=None): """Radian function formatter.""" n = int((x / np.pi) * 2.0 + 0.25) if n == 0: return str(x) elif n == 1: return r'$\pi/2$' elif n == 2: return r'$\pi$' elif n % 2 == 0: return r'$%s\pi$' % (n/2,) else: return r'$%s\pi/2$' % (n,) # ========================================================================== class UnitDblConverter(units.ConversionInterface): """: A matplotlib converter class. Provides matplotlib conversion functionality for the Monte UnitDbl class. """ # default for plotting defaults = { "distance": 'km', "angle": 'deg', "time": 'sec', } # ----------------------------------------------------------------------- @staticmethod def axisinfo(unit, axis): """: Returns information on how to handle an axis that has Epoch data. = INPUT VARIABLES - unit The units to use for a axis with Epoch data. = RETURN VALUE - Returns a matplotlib AxisInfo data structure that contains minor/major formatters, major/minor locators, and default label information. """ # Delay-load due to circular dependencies. import matplotlib.testing.jpl_units as U # Check to see if the value used for units is a string unit value # or an actual instance of a UnitDbl so that we can use the unit # value for the default axis label value. if unit: label = unit if isinstance(unit, str) else unit.label() else: label = None if (label == "deg") and isinstance(axis.axes, polar.PolarAxes): # If we want degrees for a polar plot, use the PolarPlotFormatter majfmt = polar.PolarAxes.ThetaFormatter() else: majfmt = U.UnitDblFormatter(useOffset=False) return units.AxisInfo(majfmt=majfmt, label=label) # ----------------------------------------------------------------------- @staticmethod def convert(value, unit, axis): """: Convert value using unit to a float. If value is a sequence, return the converted sequence. = INPUT VARIABLES - value The value or list of values that need to be converted. - unit The units to use for a axis with Epoch data. = RETURN VALUE - Returns the value parameter converted to floats. """ # Delay-load due to circular dependencies. import matplotlib.testing.jpl_units as U isNotUnitDbl = True if iterable(value) and not isinstance(value, str): if len(value) == 0: return [] else: return [UnitDblConverter.convert(x, unit, axis) for x in value] # We need to check to see if the incoming value is actually a # UnitDbl and set a flag. If we get an empty list, then just # return an empty list. if (isinstance(value, U.UnitDbl)): isNotUnitDbl = False # If the incoming value behaves like a number, but is not a UnitDbl, # then just return it because we don't know how to convert it # (or it is already converted) if (isNotUnitDbl and units.ConversionInterface.is_numlike(value)): return value # If no units were specified, then get the default units to use. if unit is None: unit = UnitDblConverter.default_units(value, axis) # Convert the incoming UnitDbl value/values to float/floats if isinstance(axis.axes, polar.PolarAxes) and value.type() == "angle": # Guarantee that units are radians for polar plots. return value.convert("rad") return value.convert(unit) # ----------------------------------------------------------------------- @staticmethod def default_units(value, axis): """: Return the default unit for value, or None. = INPUT VARIABLES - value The value or list of values that need units. = RETURN VALUE - Returns the default units to use for value. Return the default unit for value, or None. """ # Determine the default units based on the user preferences set for # default units when printing a UnitDbl. if iterable(value) and not isinstance(value, str): return UnitDblConverter.default_units(value[0], axis) else: return UnitDblConverter.defaults[value.type()]
{ "pile_set_name": "Github" }
// // SwitchIfEmpty.swift // RxSwift // // Created by sergdort on 23/12/2016. // Copyright © 2016 Krunoslav Zaher. All rights reserved. // extension ObservableType { /** Returns the elements of the specified sequence or `switchTo` sequence if the sequence is empty. - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) - parameter switchTo: Observable sequence being returned when source sequence is empty. - returns: Observable sequence that contains elements from switchTo sequence if source is empty, otherwise returns source sequence elements. */ public func ifEmpty(switchTo other: Observable<E>) -> Observable<E> { return SwitchIfEmpty(source: asObservable(), ifEmpty: other) } } final fileprivate class SwitchIfEmpty<Element>: Producer<Element> { private let _source: Observable<E> private let _ifEmpty: Observable<E> init(source: Observable<E>, ifEmpty: Observable<E>) { _source = source _ifEmpty = ifEmpty } override func run<O : ObserverType>(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { let sink = SwitchIfEmptySink(ifEmpty: _ifEmpty, observer: observer, cancel: cancel) let subscription = sink.run(_source.asObservable()) return (sink: sink, subscription: subscription) } } final fileprivate class SwitchIfEmptySink<O: ObserverType>: Sink<O> , ObserverType { typealias E = O.E private let _ifEmpty: Observable<E> private var _isEmpty = true private let _ifEmptySubscription = SingleAssignmentDisposable() init(ifEmpty: Observable<E>, observer: O, cancel: Cancelable) { _ifEmpty = ifEmpty super.init(observer: observer, cancel: cancel) } func run(_ source: Observable<O.E>) -> Disposable { let subscription = source.subscribe(self) return Disposables.create(subscription, _ifEmptySubscription) } func on(_ event: Event<E>) { switch event { case .next: _isEmpty = false forwardOn(event) case .error: forwardOn(event) dispose() case .completed: guard _isEmpty else { forwardOn(.completed) dispose() return } let ifEmptySink = SwitchIfEmptySinkIter(parent: self) _ifEmptySubscription.setDisposable(_ifEmpty.subscribe(ifEmptySink)) } } } final fileprivate class SwitchIfEmptySinkIter<O: ObserverType> : ObserverType { typealias E = O.E typealias Parent = SwitchIfEmptySink<O> private let _parent: Parent init(parent: Parent) { _parent = parent } func on(_ event: Event<E>) { switch event { case .next: _parent.forwardOn(event) case .error: _parent.forwardOn(event) _parent.dispose() case .completed: _parent.forwardOn(event) _parent.dispose() } } }
{ "pile_set_name": "Github" }
export CROSSPATH=/media/storage2/amiga-code/m68k-amigaos export GCCLIBPATH=$CROSSPATH/lib/gcc-lib/m68k-amigaos/2.95.3 export PATH=$CROSSPATH/bin:$GCCLIBPATH:$PATH export GCC_EXEC_PREFIX=m68k-amigaos export LIBS=$CROSSPATH/lib m68k-amigaos-gcc -O2 -m68000 -o mntsdtest -noixemul -I$CROSSPATH/m68k-amigaos/sys-include -I$CROSSPATH/os-include -L$LIBS -L$LIBS/gcc-lib/m68k-amigaos/2.95.3/ -L$CROSSPATH -L$LIBS/libnix mntsd_test.c mntsd_cmd.c -s -ldebug -lm
{ "pile_set_name": "Github" }
/datum/event/anomaly/anomaly_grav startWhen = 3 announceWhen = 20 endWhen = 70 /datum/event/anomaly/anomaly_grav/announce() GLOB.event_announcement.Announce("Gravitational anomaly detected on long range scanners. Expected location: [impact_area.name].", "Anomaly Alert") /datum/event/anomaly/anomaly_grav/start() var/turf/T = pick(get_area_turfs(impact_area)) if(T) newAnomaly = new /obj/effect/anomaly/grav(T.loc)
{ "pile_set_name": "Github" }
<?php namespace Tests\Unit; use App\Models\Client; use App\Models\Quote; use Tests\TestCase; class QuoteTest extends TestCase { /** * A basic test example. * * @return void */ public function test_create_quote() { $client = factory(Client::class)->create(); Quote::unguard(); $quote = Quote::create([ 'nice_quote_id' => 'PWFQ-000001', 'date' => '2 August, 2018', 'netdays' => '20', 'total' => '650.50', 'share_token' => '7e57d004-2b97-0e7a-b45f-5387367791cd', 'status' => '2', 'archived' => '0', 'client_id' => $client->id, 'company_id' => $client->company->id, ]); Quote::reguard(); $this->assertEquals($client->company->name, $quote->getClient()->company->name); $this->assertEquals('7e57d004-2b97-0e7a-b45f-5387367791cd', $quote->share_token); $this->assertEquals('2018-08-22 00:00:00', $quote->duedate->timezone(config('app.timezone'))->toDateTimeString()); } public function test_update_quote() { $quote = factory(Quote::class)->create(); $this->assertInstanceOf(Quote::class, $quote); $quote->total = '12312313.00'; $quote->save(); $quote->refresh(); $this->assertEquals('12312313.00', $quote->total); //Testing fillable properties $data = [ 'date' => '1 January, 2018', 'netdays' => '25', 'total' => '19293313.00', ]; $quote->fill($data); $quote->save(); $quote->refresh(); $this->assertEquals('25', $quote->netdays); $this->assertEquals('2018-01-26 00:00:00', $quote->duedate->timezone(config('app.timezone'))->toDateTimeString()); $this->assertNotEquals('19293313.00', $quote->total); } public function test_delete_quote() { $quote = factory(Quote::class)->create(); $this->assertInstanceOf(Quote::class, $quote); $quote = $quote->delete(); $this->assertEquals('true', json_encode($quote)); } }
{ "pile_set_name": "Github" }
12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0 1 1 0
{ "pile_set_name": "Github" }
%% clearing the workspace clc;close all;clear; %% What is K-Means? % K-Means is a clustering algorithm that aims to parition n points % into K clusters. %% Lets load up a dataset % We will use the iris dataset to demonstrate the power % of the k-means algorithm. The data set consists of 50 samples % from each of three species of Iris (Iris setosa, % Iris virginica and Iris versicolor). % It consists of four features the length and width of the sepals, petals % in centimeters.We will just use the last two features in this script. disp("Loading Iris dataset") load irisdataset iris_data = meas(:,3:4); %% Visualizing the dataset % lets plot the points disp("Visualizing data") figure(1) plot(iris_data(:,1),iris_data(:,2),'k*','MarkerSize',5); title 'Fisher''s Iris Data'; xlabel 'Petal Lengths (cm)'; ylabel 'Petal Widths (cm)'; % close all; %% K-Means implementation % K is number of clusters K = 3; % First we randomly pick K centroids that will represent each cluster % rand_centroid_idx = randi(length(meas),K,1); rand_centroid_idx = [1,55,125]; centroids = iris_data(rand_centroid_idx,:); max_iterations = 100; cluster_assigned = zeros(length(iris_data),1); % Make zero vectors to keep track of the sum of each sample % in the cluster. cluster_sum = zeros(K,2); cluster_samples = zeros(K,1); disp("Running k-means!") for iter = 1:max_iterations %Assign each point to a cluster for num_sample = 1:length(iris_data) %Find the eulidean distance between a sample and the centroids temp = iris_data(num_sample,:) - centroids; euc_dist = vecnorm(temp,2,2); % Get the index of centroid with the minimum distance. % That will be the cluster we assign the sample to. closest_cluster = find(euc_dist == min(euc_dist)); % Assign the sample to the cluster. cluster_assigned(num_sample) = closest_cluster; % Add the samples that belong to the same cluster. cluster_sum(closest_cluster,:) = cluster_sum(closest_cluster,:) ... + iris_data(num_sample,:); % Track the number of samples in the cluster. cluster_samples(closest_cluster) = cluster_samples(closest_cluster)+1; end % Update the centroids by the mean of all the points that belong to % that cluster. centroids = cluster_sum ./ cluster_samples; % Reset to zeros for the next iteration cluster_sum = zeros(K,2); cluster_samples = zeros(K,1); end disp("Clustering finished!") %% Lets see how well K-Means it did! disp("Displaying Clusters") figure(2) for i=1:K pts = iris_data(cluster_assigned==i,:); plot(pts(:,1),pts(:,2),'.','color',rand(1,3),'MarkerSize',12); hold on; end plot(centroids(:,1),centroids(:,2),'r+','MarkerSize',12); title 'Fisher''s Iris Data'; xlabel 'Petal Lengths (cm)'; ylabel 'Petal Widths (cm)'; legend('Cluster 1','Cluster 2','Cluster 3','Centroids',... 'Location','northwest')
{ "pile_set_name": "Github" }
+install(kernel-pattern-form-icon) // sass-lint:disable empty-args .fm.fm-ico-left input, .fm.fm-ico-left select[multiple], .fm.fm-ico-left textarea padding-left: $form-element-horizontal-padding-em * 2 + _form-icon-size-em() .fm.fm-ico-right input, .fm.fm-ico-right select[multiple], .fm.fm-ico-right textarea padding-right: $form-element-horizontal-padding-em * 2 + _form-icon-size-em() // sass-lint:enable empty-args .fm-select.fm-ico-right input, .fm-file.fm-ico-right input, .fm-search.fm-ico-right input background: $form-element-background // sass-lint:disable empty-args .fm-select.fm-ico-right[data-error] input, .fm-file.fm-ico-right[data-error] input, .fm-search.fm-ico-right[data-error] input background: form-element-background-on-error() .fm.fm-select.fm-ico-right .focus ~ input, .fm.fm-select.fm-ico-right input.focus, .fm.fm-file.fm-ico-right .focus ~ input, .fm.fm-search.fm-ico-right input.focus background: form-element-background-on-focus() // sass-lint:enable empty-args .fm > .ico margin-top: _form-icon-margin-top($form-element-height-rem, $form-element-typography-size-level) font-size: $form-element-icon-size-em pointer-events: none color: $form-element-icon-color fill: $form-element-icon-color // sass-lint:disable empty-args .fm.fm-ico-left > .ico margin-left: $form-element-horizontal-padding-em / strip-unit(_form-icon-size-em()) .fm.fm-ico-right > .ico margin-right: $form-element-horizontal-padding-em / strip-unit(_form-icon-size-em()) margin-left: auto // sass-lint:enable empty-args .fm-small.fm > .ico margin-top: _form-icon-margin-top($form-element-small-height-rem, $form-element-small-typography-size-level) .fm-large.fm > .ico margin-top: _form-icon-margin-top($form-element-large-height-rem, $form-element-large-typography-size-level) .fm[data-error] .ico color: $form-element-icon-color-on-error fill: $form-element-icon-color-on-error .fm.fm-ico-left .focus ~ .ico, .fm.fm-ico-right .focus ~ .ico color: $form-element-icon-color-on-focus fill: $form-element-icon-color-on-focus
{ "pile_set_name": "Github" }
// The algorithm used to determine whether a regexp can appear at a // given point in the program is loosely based on sweet.js' approach. // See https://github.com/mozilla/sweet.js/wiki/design import {Parser} from "./state" import {types as tt} from "./tokentype" import {lineBreak} from "./whitespace" export class TokContext { constructor(token, isExpr, preserveSpace, override) { this.token = token this.isExpr = isExpr this.preserveSpace = preserveSpace this.override = override } } export const types = { b_stat: new TokContext("{", false), b_expr: new TokContext("{", true), b_tmpl: new TokContext("${", true), p_stat: new TokContext("(", false), p_expr: new TokContext("(", true), q_tmpl: new TokContext("`", true, true, p => p.readTmplToken()), f_expr: new TokContext("function", true) } const pp = Parser.prototype pp.initialContext = function() { return [types.b_stat] } pp.braceIsBlock = function(prevType) { let parent if (prevType === tt.colon && (parent = this.curContext()).token == "{") return !parent.isExpr if (prevType === tt._return) return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof) return true if (prevType == tt.braceL) return this.curContext() === types.b_stat return !this.exprAllowed } pp.updateContext = function(prevType) { let update, type = this.type if (type.keyword && prevType == tt.dot) this.exprAllowed = false else if (update = type.updateContext) update.call(this, prevType) else this.exprAllowed = type.beforeExpr } // Token-specific context update code tt.parenR.updateContext = tt.braceR.updateContext = function() { if (this.context.length == 1) { this.exprAllowed = true return } let out = this.context.pop() if (out === types.b_stat && this.curContext() === types.f_expr) { this.context.pop() this.exprAllowed = false } else if (out === types.b_tmpl) { this.exprAllowed = true } else { this.exprAllowed = !out.isExpr } } tt.braceL.updateContext = function(prevType) { this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr) this.exprAllowed = true } tt.dollarBraceL.updateContext = function() { this.context.push(types.b_tmpl) this.exprAllowed = true } tt.parenL.updateContext = function(prevType) { let statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while this.context.push(statementParens ? types.p_stat : types.p_expr) this.exprAllowed = true } tt.incDec.updateContext = function() { // tokExprAllowed stays unchanged } tt._function.updateContext = function() { if (this.curContext() !== types.b_stat) this.context.push(types.f_expr) this.exprAllowed = false } tt.backQuote.updateContext = function() { if (this.curContext() === types.q_tmpl) this.context.pop() else this.context.push(types.q_tmpl) this.exprAllowed = false }
{ "pile_set_name": "Github" }
<?xml version='1.0' encoding='utf-8'?> <section xmlns="https://code.dccouncil.us/schemas/dc-library" xmlns:codified="https://code.dccouncil.us/schemas/codified" xmlns:codify="https://code.dccouncil.us/schemas/codify" xmlns:xi="http://www.w3.org/2001/XInclude" containing-doc="D.C. Code"> <num>33-514</num> <reason>Repealed</reason> <heading>Relation of limited partners inter se.</heading> <text>Repealed.</text> <annotations> <annotation doc="Pub. L. 87-716" type="History" path="§14">Sept. 28, 1962, 76 Stat. 658, Pub. L. 87-716, § 14</annotation> <annotation doc="D.C. Law 7-49" type="History">Dec. 10, 1987, D.C. Law 7-49, § 1105, 34 DCR 6856</annotation> <annotation type="Prior Codifications">1973 Ed., § 41-414.</annotation> <annotation type="Prior Codifications">1981 Ed., § 41-214.</annotation> </annotations> </section>
{ "pile_set_name": "Github" }
<Placement> <!-- available display shapes --> <!-- Parts_Common_Body Parts_Common_Body_Summary Parts_Common_Metadata Parts_Common_Metadata_Summary Parts_Common_Metadata_SummaryAdmin Fields_Common_Text --> <!-- edit shapes getting default placements --> <!-- edit "shape" --> <Place Parts_Common_Body_Edit="Content:2"/> <Place Parts_Common_Owner_Edit="Content:20"/> <Place Parts_Common_Date_Edit="Content:18"/> <Place Parts_Common_Container_Edit="Content:20"/> <Place Fields_Common_Text_Edit="Content:2.5"/> <!-- default positioning --> <!-- show summary for all DisplayType by default --> <Place Parts_Common_Body_Summary="Content:5"/> <!-- with text fields a little before --> <Place Fields_Common_Text="Content:2.5"/> <Match DisplayType="Detail"> <!-- hide summary, show full content, for Detail --> <Place Parts_Common_Body_Summary="-" Parts_Common_Body="Content:5" Parts_Common_Metadata="Meta:2"/> </Match> <Match DisplayType="Summary"> <Place Parts_Common_Metadata_Summary="Meta:2"/> </Match> <Match DisplayType="SummaryAdmin"> <Place Parts_Common_Body_Summary="-" Parts_Common_Metadata_SummaryAdmin="Meta:5" Fields_Common_Text="-"/> </Match> </Placement>
{ "pile_set_name": "Github" }
namespace Nancy.ViewEngines { /// <summary> /// Default implementation of the <see cref="IViewRenderer"/> interface. /// </summary> public class DefaultViewRenderer : IViewRenderer { private readonly IViewFactory factory; /// <summary> /// Initializes an instance of the <see cref="DefaultViewRenderer"/> type, with /// the provided <paramref name="factory"/>. /// </summary> /// <param name="factory">The <see cref="IViewFactory"/> that should be used to render the views.</param> public DefaultViewRenderer(IViewFactory factory) { this.factory = factory; } /// <summary> /// Renders a view to a response object, bypassing content negotiation. /// </summary> /// <param name="context">Current Nancy context</param> /// <param name="viewName">View name</param> /// <param name="model">Model object (or null)</param> /// <returns>Response object containing the rendered view (if found)</returns> public Response RenderView(NancyContext context, string viewName, object model = null) { var viewContext = new ViewLocationContext { Context = context }; return this.factory.RenderView(viewName, model, viewContext); } } }
{ "pile_set_name": "Github" }
// Copyright (C) 2014 Victor Fragoso <vfragoso@cs.ucsb.edu> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // // * Neither the name of the University of California, Santa Barbara nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL VICTOR FRAGOSO BE LIABLE FOR ANY DIRECT, // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #ifndef OPTIMO_SOLVERS_PRIMAL_DUAL_QP_H_ #define OPTIMO_SOLVERS_PRIMAL_DUAL_QP_H_ #include "optimo/solvers/primal_dual_qp_api.h" #include "optimo/solvers/primal_dual_qp_impl.h" #endif // OPTIMO_SOLVERS_PRIMAL_DUAL_QP_H_
{ "pile_set_name": "Github" }
// Copyright 2020 Google LLC // // 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. syntax = "proto3"; package google.ads.googleads.v4.enums; import "google/api/annotations.proto"; option csharp_namespace = "Google.Ads.GoogleAds.V4.Enums"; option go_package = "google.golang.org/genproto/googleapis/ads/googleads/v4/enums;enums"; option java_multiple_files = true; option java_outer_classname = "AppPaymentModelTypeProto"; option java_package = "com.google.ads.googleads.v4.enums"; option objc_class_prefix = "GAA"; option php_namespace = "Google\\Ads\\GoogleAds\\V4\\Enums"; option ruby_package = "Google::Ads::GoogleAds::V4::Enums"; // Proto file describing criteria types. // Represents a criterion for targeting paid apps. message AppPaymentModelTypeEnum { // Enum describing possible app payment models. enum AppPaymentModelType { // Not specified. UNSPECIFIED = 0; // Used for return value only. Represents value unknown in this version. UNKNOWN = 1; // Represents paid-for apps. PAID = 30; } }
{ "pile_set_name": "Github" }
/* Privacy Friendly Net Monitor (Net Monitor) - Copyright (2015 - 2017) Felix Tsala Schiller ################################################################### This file is part of Net Monitor. Net Monitor 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. Net Monitor 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 Net Monitor. If not, see <http://www.gnu.org/licenses/>. Diese Datei ist Teil von Net Monitor. Net Monitor ist Freie Software: Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation, Version 3 der Lizenz oder (nach Ihrer Wahl) jeder späteren veröffentlichten Version, weiterverbreiten und/oder modifizieren. Net Monitor wird in der Hoffnung, dass es nützlich sein wird, aber OHNE JEDE GEWÄHRLEISTUNG, bereitgestellt; sogar ohne die implizite Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. Siehe die GNU General Public License für weitere Details. Sie sollten eine Kopie der GNU General Public License zusammen mit diesem Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. ################################################################### This app has been created in affiliation with SecUSo-Department of Technische Universität Darmstadt. Privacy Friendly Net Monitor is based on TLSMetric by Felix Tsala Schiller https://bitbucket.org/schillef/tlsmetric/overview. */ package org.secuso.privacyfriendlynetmonitor.ConnectionAnalysis; import android.graphics.drawable.Drawable; import android.util.Log; import org.secuso.privacyfriendlynetmonitor.Assistant.Const; import org.secuso.privacyfriendlynetmonitor.Assistant.TLType; import org.secuso.privacyfriendlynetmonitor.Assistant.ToolBox; import java.io.Serializable; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.sql.Timestamp; import static java.lang.Math.abs; /** * Information class for acquired connection data. Full report on available information from device. */ public class Report implements Serializable { //Constructor parses HEX-data from /proc/net/*type* scan Report(ByteBuffer bb, TLType type) { touch(); this.type = type; // Fill with bytebuffer data if (type == TLType.tcp || type == TLType.udp) { initIP4(bb); } else { initIP6(bb); } //Init InetAddresses try { if (type == TLType.tcp || type == TLType.udp) { localAdd = InetAddress.getByName(ToolBox.hexToIp4(ToolBox.printHexBinary(localAddHex))); remoteAdd = InetAddress.getByName(ToolBox.hexToIp4(ToolBox.printHexBinary(remoteAddHex))); } else { localAdd = InetAddress.getByName(ToolBox.hexToIp6(ToolBox.printHexBinary(localAddHex))); remoteAdd = InetAddress.getByName(ToolBox.hexToIp6(ToolBox.printHexBinary(remoteAddHex))); } } catch (UnknownHostException e) { e.printStackTrace(); } if (Const.IS_DEBUG) { Log.d(Const.LOG_TAG, "Report (" + type + "):" + localAdd.getHostAddress() + ":" + localPort + " " + remoteAdd.getHostAddress() + ":" + remotePort + " - UID: " + uid); } } //Members public TLType type; public Timestamp timestamp; public byte[] localAddHex; public InetAddress localAdd; public int localPort; public byte[] state; public byte[] remoteAddHex; public InetAddress remoteAdd; public int remotePort; public int pid; public int uid; public Drawable icon; public String appName; public String packageName; //Set current timestamp public void touch() { timestamp = new Timestamp(System.currentTimeMillis()); } // ----------------------- // Init Methods // ----------------------- //Fill report with Ip4 - tcp/udp connection data from bytebuffer readin private void initIP4(ByteBuffer bb) { bb.position(0); byte[] b = new byte[2]; localAddHex = new byte[4]; bb.get(localAddHex); bb.get(b); localPort = ToolBox.twoBytesToInt(b); remoteAddHex = new byte[4]; bb.get(remoteAddHex); bb.get(b); remotePort = ToolBox.twoBytesToInt(b); uid = abs(bb.getShort()); state = new byte[1]; bb.get(state); } //Fill report with Ip6 - tcp/udp connection data from bytebuffer readin private void initIP6(ByteBuffer bb) { bb.position(0); byte[] b = new byte[2]; localAddHex = new byte[16]; bb.get(localAddHex); bb.get(b); localPort = ToolBox.twoBytesToInt(b); remoteAddHex = new byte[16]; bb.get(remoteAddHex); bb.get(b); remotePort = ToolBox.twoBytesToInt(b); uid = abs((bb.getShort())); state = new byte[1]; bb.get(state); } }
{ "pile_set_name": "Github" }
<?php declare(strict_types=1); namespace Tests\BitBag\SyliusCmsPlugin\Application; use PSS\SymfonyMockerContainer\DependencyInjection\MockerContainer; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\DelegatingLoader; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Config\Loader\LoaderResolver; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Loader\ClosureLoader; use Symfony\Component\DependencyInjection\Loader\DirectoryLoader; use Symfony\Component\DependencyInjection\Loader\GlobFileLoader; use Symfony\Component\DependencyInjection\Loader\IniFileLoader; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\HttpKernel\Config\FileLocator; use Symfony\Component\HttpKernel\Kernel as BaseKernel; use Symfony\Component\Routing\RouteCollectionBuilder; use Webmozart\Assert\Assert; final class Kernel extends BaseKernel { use MicroKernelTrait; private const CONFIG_EXTS = '.{php,xml,yaml,yml}'; public function getCacheDir(): string { return $this->getProjectDir() . '/var/cache/' . $this->environment; } public function getLogDir(): string { return $this->getProjectDir() . '/var/log'; } public function registerBundles(): iterable { $contents = require $this->getProjectDir() . '/config/bundles.php'; foreach ($contents as $class => $envs) { if (isset($envs['all']) || isset($envs[$this->environment])) { yield new $class(); } } } protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void { $container->addResource(new FileResource($this->getProjectDir() . '/config/bundles.php')); $container->setParameter('container.dumper.inline_class_loader', true); $confDir = $this->getProjectDir() . '/config'; $loader->load($confDir . '/{packages}/*' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{packages}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{services}' . self::CONFIG_EXTS, 'glob'); $loader->load($confDir . '/{services}_' . $this->environment . self::CONFIG_EXTS, 'glob'); } protected function configureRoutes(RouteCollectionBuilder $routes): void { $confDir = $this->getProjectDir() . '/config'; $routes->import($confDir . '/{routes}/*' . self::CONFIG_EXTS, '/', 'glob'); $routes->import($confDir . '/{routes}/' . $this->environment . '/**/*' . self::CONFIG_EXTS, '/', 'glob'); $routes->import($confDir . '/{routes}' . self::CONFIG_EXTS, '/', 'glob'); } protected function getContainerBaseClass(): string { if ($this->isTestEnvironment()) { return MockerContainer::class; } return parent::getContainerBaseClass(); } protected function getContainerLoader(ContainerInterface $container): LoaderInterface { /** @var ContainerBuilder $container */ Assert::isInstanceOf($container, ContainerBuilder::class); $locator = new FileLocator($this, $this->getRootDir() . '/Resources'); $resolver = new LoaderResolver(array( new XmlFileLoader($container, $locator), new YamlFileLoader($container, $locator), new IniFileLoader($container, $locator), new PhpFileLoader($container, $locator), new GlobFileLoader($container, $locator), new DirectoryLoader($container, $locator), new ClosureLoader($container), )); return new DelegatingLoader($resolver); } private function isTestEnvironment(): bool { return 0 === strpos($this->getEnvironment(), 'test'); } }
{ "pile_set_name": "Github" }
// // Generated by class-dump 3.5 (64 bit) (Debug version compiled Jun 9 2015 22:53:21). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard. // #import "IPropertyValueExtractor.h" @interface IPropertyArrayExtractor : IPropertyValueExtractor { } @end
{ "pile_set_name": "Github" }
/********************************************************************** iso8859_13.c - Oniguruma (regular expression library) **********************************************************************/ /*- * Copyright (c) 2002-2007 K.Kosako <sndgk393 AT ybb DOT ne DOT jp> * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. */ #include "regenc.h" #define ENC_ISO_8859_13_TO_LOWER_CASE(c) EncISO_8859_13_ToLowerCaseTable[c] #define ENC_IS_ISO_8859_13_CTYPE(code,ctype) \ ((EncISO_8859_13_CtypeTable[code] & CTYPE_TO_BIT(ctype)) != 0) static const UChar EncISO_8859_13_ToLowerCaseTable[256] = { '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', '\270', '\251', '\272', '\253', '\254', '\255', '\256', '\277', '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\327', '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\337', '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377' }; static const unsigned short EncISO_8859_13_CtypeTable[256] = { 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x420c, 0x4209, 0x4208, 0x4208, 0x4208, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4008, 0x4284, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x78b0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x7ca2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x74a2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x51a0, 0x41a0, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x78e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x70e2, 0x41a0, 0x41a0, 0x41a0, 0x41a0, 0x4008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0008, 0x0284, 0x01a0, 0x00a0, 0x00a0, 0x00a0, 0x01a0, 0x00a0, 0x00a0, 0x34a2, 0x00a0, 0x34a2, 0x01a0, 0x00a0, 0x01a0, 0x00a0, 0x34a2, 0x00a0, 0x00a0, 0x10a0, 0x10a0, 0x01a0, 0x30e2, 0x00a0, 0x01a0, 0x30e2, 0x10a0, 0x30e2, 0x01a0, 0x10a0, 0x10a0, 0x10a0, 0x30e2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x00a0, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x34a2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x00a0, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x30e2, 0x01a0 }; static int mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end ARG_UNUSED, UChar* lower) { const UChar* p = *pp; if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { *lower++ = 's'; *lower = 's'; (*pp)++; return 2; } *lower = ENC_ISO_8859_13_TO_LOWER_CASE(*p); (*pp)++; return 1; } #if 0 static int is_mbc_ambiguous(OnigCaseFoldType flag, const UChar** pp, const UChar* end) { int v; const UChar* p = *pp; if (*p == 0xdf && (flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) { (*pp)++; return TRUE; } (*pp)++; v = (EncISO_8859_13_CtypeTable[*p] & (BIT_CTYPE_UPPER | BIT_CTYPE_LOWER)); if ((v | BIT_CTYPE_LOWER) != 0) { /* 0xdf, 0xb5 are lower case letter, but can't convert. */ if (*p == 0xb5) return FALSE; else return TRUE; } return (v != 0 ? TRUE : FALSE); } #endif static int is_code_ctype(OnigCodePoint code, unsigned int ctype) { if (code < 256) return ENC_IS_ISO_8859_13_CTYPE(code, ctype); else return FALSE; } static const OnigPairCaseFoldCodes CaseFoldMap[] = { { 0xc0, 0xe0 }, { 0xc1, 0xe1 }, { 0xc2, 0xe2 }, { 0xc3, 0xe3 }, { 0xc4, 0xe4 }, { 0xc5, 0xe5 }, { 0xc6, 0xe6 }, { 0xc7, 0xe7 }, { 0xc8, 0xe8 }, { 0xc9, 0xe9 }, { 0xca, 0xea }, { 0xcb, 0xeb }, { 0xcc, 0xec }, { 0xcd, 0xed }, { 0xce, 0xee }, { 0xcf, 0xef }, { 0xd0, 0xf0 }, { 0xd1, 0xf1 }, { 0xd2, 0xf2 }, { 0xd3, 0xf3 }, { 0xd4, 0xf4 }, { 0xd5, 0xf5 }, { 0xd6, 0xf6 }, { 0xd8, 0xf8 }, { 0xd9, 0xf9 }, { 0xda, 0xfa }, { 0xdb, 0xfb }, { 0xdc, 0xfc }, { 0xdd, 0xfd }, { 0xde, 0xfe } }; static int apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg) { return onigenc_apply_all_case_fold_with_map( sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1, flag, f, arg); } static int get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem items[]) { return onigenc_get_case_fold_codes_by_str_with_map( sizeof(CaseFoldMap)/sizeof(OnigPairCaseFoldCodes), CaseFoldMap, 1, flag, p, end, items); } OnigEncodingType OnigEncodingISO_8859_13 = { onigenc_single_byte_mbc_enc_len, "ISO-8859-13", /* name */ 1, /* max enc length */ 1, /* min enc length */ onigenc_is_mbc_newline_0x0a, onigenc_single_byte_mbc_to_code, onigenc_single_byte_code_to_mbclen, onigenc_single_byte_code_to_mbc, mbc_case_fold, apply_all_case_fold, get_case_fold_codes_by_str, onigenc_minimum_property_name_to_ctype, is_code_ctype, onigenc_not_support_get_ctype_code_range, onigenc_single_byte_left_adjust_char_head, onigenc_always_true_is_allowed_reverse_match };
{ "pile_set_name": "Github" }
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt" android:width="108dp" android:height="108dp" android:viewportHeight="108" android:viewportWidth="108"> <path android:fillType="evenOdd" android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z" android:strokeColor="#00000000" android:strokeWidth="1"> <aapt:attr name="android:fillColor"> <gradient android:endX="78.5885" android:endY="90.9159" android:startX="48.7653" android:startY="61.0927" android:type="linear"> <item android:color="#44000000" android:offset="0.0" /> <item android:color="#00000000" android:offset="1.0" /> </gradient> </aapt:attr> </path> <path android:fillColor="#FFFFFF" android:fillType="nonZero" android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z" android:strokeColor="#00000000" android:strokeWidth="1" /> </vector>
{ "pile_set_name": "Github" }
/* TDA8261 8PSK/QPSK tuner driver Copyright (C) Manu Abraham (abraham.manu@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <linux/init.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/slab.h> #include "dvb_frontend.h" #include "tda8261.h" struct tda8261_state { struct dvb_frontend *fe; struct i2c_adapter *i2c; const struct tda8261_config *config; /* state cache */ u32 frequency; u32 bandwidth; }; static int tda8261_read(struct tda8261_state *state, u8 *buf) { const struct tda8261_config *config = state->config; int err = 0; struct i2c_msg msg = { .addr = config->addr, .flags = I2C_M_RD,.buf = buf, .len = 1 }; if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) pr_err("%s: read error, err=%d\n", __func__, err); return err; } static int tda8261_write(struct tda8261_state *state, u8 *buf) { const struct tda8261_config *config = state->config; int err = 0; struct i2c_msg msg = { .addr = config->addr, .flags = 0, .buf = buf, .len = 4 }; if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) pr_err("%s: write error, err=%d\n", __func__, err); return err; } static int tda8261_get_status(struct dvb_frontend *fe, u32 *status) { struct tda8261_state *state = fe->tuner_priv; u8 result = 0; int err = 0; *status = 0; if ((err = tda8261_read(state, &result)) < 0) { pr_err("%s: I/O Error\n", __func__); return err; } if ((result >> 6) & 0x01) { pr_debug("%s: Tuner Phase Locked\n", __func__); *status = 1; } return err; } static const u32 div_tab[] = { 2000, 1000, 500, 250, 125 }; /* kHz */ static const u8 ref_div[] = { 0x00, 0x01, 0x02, 0x05, 0x07 }; static int tda8261_get_state(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *tstate) { struct tda8261_state *state = fe->tuner_priv; int err = 0; switch (param) { case DVBFE_TUNER_FREQUENCY: tstate->frequency = state->frequency; break; case DVBFE_TUNER_BANDWIDTH: tstate->bandwidth = 40000000; /* FIXME! need to calculate Bandwidth */ break; default: pr_err("%s: Unknown parameter (param=%d)\n", __func__, param); err = -EINVAL; break; } return err; } static int tda8261_set_state(struct dvb_frontend *fe, enum tuner_param param, struct tuner_state *tstate) { struct tda8261_state *state = fe->tuner_priv; const struct tda8261_config *config = state->config; u32 frequency, N, status = 0; u8 buf[4]; int err = 0; if (param & DVBFE_TUNER_FREQUENCY) { /** * N = Max VCO Frequency / Channel Spacing * Max VCO Frequency = VCO frequency + (channel spacing - 1) * (to account for half channel spacing on either side) */ frequency = tstate->frequency; if ((frequency < 950000) || (frequency > 2150000)) { pr_warn("%s: Frequency beyond limits, frequency=%d\n", __func__, frequency); return -EINVAL; } N = (frequency + (div_tab[config->step_size] - 1)) / div_tab[config->step_size]; pr_debug("%s: Step size=%d, Divider=%d, PG=0x%02x (%d)\n", __func__, config->step_size, div_tab[config->step_size], N, N); buf[0] = (N >> 8) & 0xff; buf[1] = N & 0xff; buf[2] = (0x01 << 7) | ((ref_div[config->step_size] & 0x07) << 1); if (frequency < 1450000) buf[3] = 0x00; else if (frequency < 2000000) buf[3] = 0x40; else if (frequency < 2150000) buf[3] = 0x80; /* Set params */ if ((err = tda8261_write(state, buf)) < 0) { pr_err("%s: I/O Error\n", __func__); return err; } /* sleep for some time */ pr_debug("%s: Waiting to Phase LOCK\n", __func__); msleep(20); /* check status */ if ((err = tda8261_get_status(fe, &status)) < 0) { pr_err("%s: I/O Error\n", __func__); return err; } if (status == 1) { pr_debug("%s: Tuner Phase locked: status=%d\n", __func__, status); state->frequency = frequency; /* cache successful state */ } else { pr_debug("%s: No Phase lock: status=%d\n", __func__, status); } } else { pr_err("%s: Unknown parameter (param=%d)\n", __func__, param); return -EINVAL; } return 0; } static int tda8261_release(struct dvb_frontend *fe) { struct tda8261_state *state = fe->tuner_priv; fe->tuner_priv = NULL; kfree(state); return 0; } static struct dvb_tuner_ops tda8261_ops = { .info = { .name = "TDA8261", // .tuner_name = NULL, .frequency_min = 950000, .frequency_max = 2150000, .frequency_step = 0 }, .set_state = tda8261_set_state, .get_state = tda8261_get_state, .get_status = tda8261_get_status, .release = tda8261_release }; struct dvb_frontend *tda8261_attach(struct dvb_frontend *fe, const struct tda8261_config *config, struct i2c_adapter *i2c) { struct tda8261_state *state = NULL; if ((state = kzalloc(sizeof (struct tda8261_state), GFP_KERNEL)) == NULL) goto exit; state->config = config; state->i2c = i2c; state->fe = fe; fe->tuner_priv = state; fe->ops.tuner_ops = tda8261_ops; fe->ops.tuner_ops.info.frequency_step = div_tab[config->step_size]; // fe->ops.tuner_ops.tuner_name = &config->buf; // printk("%s: Attaching %s TDA8261 8PSK/QPSK tuner\n", // __func__, fe->ops.tuner_ops.tuner_name); pr_info("%s: Attaching TDA8261 8PSK/QPSK tuner\n", __func__); return fe; exit: kfree(state); return NULL; } EXPORT_SYMBOL(tda8261_attach); MODULE_AUTHOR("Manu Abraham"); MODULE_DESCRIPTION("TDA8261 8PSK/QPSK Tuner"); MODULE_LICENSE("GPL");
{ "pile_set_name": "Github" }
#include "ntp1tokenlistmodel.h" #include "boost/thread/future.hpp" #include <boost/atomic/atomic.hpp> #include <boost/make_shared.hpp> #include <boost/shared_ptr.hpp> #include <QIcon> #include <QImage> std::atomic<NTP1TokenListModel*> ntp1TokenListModelInstance{nullptr}; QString NTP1TokenListModel::__getTokenName(int index, boost::shared_ptr<NTP1Wallet> theWallet) { return QString::fromStdString(theWallet->getTokenName(index)); } QString NTP1TokenListModel::__getTokenId(int index, boost::shared_ptr<NTP1Wallet> theWallet) { return QString::fromStdString(theWallet->getTokenId(index)); } QString NTP1TokenListModel::__getTokenDescription(int index, boost::shared_ptr<NTP1Wallet> theWallet) { return QString::fromStdString(theWallet->getTokenDescription(index)); } QString NTP1TokenListModel::__getTokenBalance(int index, boost::shared_ptr<NTP1Wallet> theWallet) { return QString::fromStdString(ToString(theWallet->getTokenBalance(index))); } QString NTP1TokenListModel::__getIssuanceTxid(int index, boost::shared_ptr<NTP1Wallet> theWallet) { return QString::fromStdString(theWallet->getTokenIssuanceTxid(index)); } QIcon NTP1TokenListModel::__getTokenIcon(int index, boost::shared_ptr<NTP1Wallet> theWallet) { const std::string& iconData = theWallet->getTokenIcon(index); if (iconData.empty() || NTP1Wallet::IconHasErrorContent(iconData)) { return QIcon(); } QImage iconImage; iconImage.loadFromData((const uchar*)iconData.c_str(), iconData.size()); return QIcon(QPixmap::fromImage(iconImage)); } void NTP1TokenListModel::clearNTP1Wallet() { if (ntp1wallet) { beginResetModel(); ntp1wallet->clear(); endResetModel(); } } void NTP1TokenListModel::refreshNTP1Wallet() { if (ntp1wallet) { beginResetModel(); ntp1wallet->update(); endResetModel(); } } void NTP1TokenListModel::UpdateWalletBalances(boost::shared_ptr<NTP1Wallet> wallet, boost::promise<boost::shared_ptr<NTP1Wallet>>& promise) { try { boost::atomic_load(&wallet)->update(); promise.set_value(wallet); } catch (...) { try { promise.set_exception(boost::current_exception()); } catch (std::exception& ex) { printf("Error: Setting promise exception failed for NTP1TokenListModel wallet: %s", ex.what()); } catch (...) { printf( "Error: Setting promise exception failed for NTP1TokenListModel wallet (Unknown error)"); } } } NTP1TokenListModel::NTP1TokenListModel() : ntp1WalletTxUpdater(boost::make_shared<NTP1WalletTxUpdater>(this)) { updateWalletAgain.store(false); walletUpdateLockFlag.clear(); ntp1wallet = boost::make_shared<NTP1Wallet>(); walletLocked = false; walletUpdateRunning = false; walletUpdateEnderTimer = new QTimer(this); loadWalletFromFile(); connect(walletUpdateEnderTimer, &QTimer::timeout, this, &NTP1TokenListModel::endWalletUpdate); walletUpdateEnderTimer->start(1000); reloadBalances(); boost::thread t(&NTP1TokenListModel::SetupNTP1WalletTxUpdaterToWallet, this); t.detach(); ntp1TokenListModelInstance.store(this); } NTP1TokenListModel::~NTP1TokenListModel() { ntp1TokenListModelInstance.store(nullptr); ntp1WalletTxUpdater.reset(); } void NTP1TokenListModel::reloadBalances() { // the following mechanism is to ensure that if this function is called too often, it won't // indefinitely block, but will simply queue requests through the boolean `updateWalletAgain` bool dummy = false; auto restoreFunc = [this](bool*) { walletUpdateLockFlag.clear(); }; std::unique_ptr<bool, decltype(restoreFunc)> lg(&dummy, restoreFunc); // RAII, acts like a lock_guard do { // only one thread can do this, if another thread tries, it'll just schedule another update if (!walletUpdateLockFlag.test_and_set(boost::memory_order_seq_cst)) { beginWalletUpdate(); } else { // if locking failed, that means something else triggered the scan, so we just schedule an // update and exit when this scan is done updateWalletAgain.store(true, boost::memory_order_seq_cst); break; } // continue if a rescan is scheduled } while (updateWalletAgain.exchange(false, boost::memory_order_seq_cst)); } void NTP1TokenListModel::beginWalletUpdate() { if (!walletUpdateRunning) { walletUpdateRunning = true; emit signal_walletUpdateRunning(true); boost::shared_ptr<NTP1Wallet> wallet = boost::make_shared<NTP1Wallet>(*ntp1wallet); updateWalletPromise = boost::promise<boost::shared_ptr<NTP1Wallet>>(); { boost::lock_guard<boost::mutex> lg(walletFutureCheckMutex); updateWalletFuture = updateWalletPromise.get_future(); } boost::thread t(boost::bind(&NTP1TokenListModel::UpdateWalletBalances, wallet, boost::ref(updateWalletPromise))); t.detach(); } } void NTP1TokenListModel::endWalletUpdate() { bool is_ready = false; { boost::lock_guard<boost::mutex> lg(walletFutureCheckMutex); is_ready = updateWalletFuture.is_ready(); } if (walletUpdateRunning && is_ready) { try { boost::shared_ptr<NTP1Wallet> wallet = updateWalletFuture.get(); // the nullptr check is done after having a nullptr once happen. // Although this should never happen, having it doesn't hurt and is safer if ((wallet.get() != nullptr) && !(*wallet == *ntp1wallet)) { beginResetModel(); boost::atomic_store(&ntp1wallet, wallet); saveWalletToFile(); endResetModel(); } } catch (std::exception& ex) { printf("Error while updating NTP1 balances: %s", ex.what()); } walletUpdateRunning = false; emit signal_walletUpdateRunning(false); } } int NTP1TokenListModel::rowCount(const QModelIndex& /*parent*/) const { return ntp1wallet->getNumberOfTokens(); } int NTP1TokenListModel::columnCount(const QModelIndex& /*parent*/) const { return 3; } QVariant NTP1TokenListModel::data(const QModelIndex& index, int role) const { if (!index.isValid()) return QVariant(); if (index.row() >= static_cast<int>(ntp1wallet->getNumberOfTokens())) return QVariant(); if (role == NTP1TokenListModel::AmountRole) { return __getTokenBalance(index.row(), ntp1wallet); } if (role == NTP1TokenListModel::TokenDescriptionRole) { return __getTokenDescription(index.row(), ntp1wallet); } if (role == NTP1TokenListModel::TokenIdRole) { return __getTokenId(index.row(), ntp1wallet); } if (role == NTP1TokenListModel::TokenNameRole) { return __getTokenName(index.row(), ntp1wallet); } if (role == NTP1TokenListModel::IssuanceTxidRole) { return __getIssuanceTxid(index.row(), ntp1wallet); } if (role == Qt::DecorationRole) { return QVariant(__getTokenIcon(index.row(), ntp1wallet)); } return QVariant(); } void NTP1TokenListModel::saveWalletToFile() { try { if (!ntp1wallet) { throw std::runtime_error("Error: NTP1 wallet is a null pointer!"); } // The temp file here ensures that the target file is not tampered with before a successful // writing happens This is helpful to avoid corrupt files in cases such as diskspace issues srand(time(NULL)); boost::filesystem::path tempFile = GetDataDir() / NTP1WalletCacheFileName; tempFile.replace_extension(".json." + ToString(rand())); boost::filesystem::path permFile = GetDataDir() / NTP1WalletCacheFileName; ntp1wallet->exportToFile(tempFile); if (boost::filesystem::exists(permFile)) boost::filesystem::remove(permFile); boost::filesystem::rename(tempFile, permFile); } catch (std::exception& ex) { printf("Failed at exporting wallet data. Error says %s", ex.what()); } } void NTP1TokenListModel::loadWalletFromFile() { try { if (!ntp1wallet) { throw std::runtime_error("Error: NTP1 wallet is a null pointer!"); } boost::filesystem::path file = GetDataDir() / NTP1WalletCacheFileName; if (boost::filesystem::exists(file)) { ntp1wallet->importFromFile(file); } else { printf("NTP1 wallet not found. One will be created soon."); } } catch (std::exception& ex) { ntp1wallet->clear(); printf("Failed at exporting wallet data. Error says %s", ex.what()); } } boost::shared_ptr<NTP1Wallet> NTP1TokenListModel::getCurrentWallet() const { return boost::atomic_load(&ntp1wallet); }
{ "pile_set_name": "Github" }
# Copyright 2019, The TensorFlow Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Unit testing for losses.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from contextlib import contextmanager # pylint: disable=g-importing-member from io import StringIO # pylint: disable=g-importing-member import sys from absl.testing import parameterized import tensorflow.compat.v1 as tf from tensorflow.compat.v1.python.framework import test_util from tensorflow.compat.v1.python.keras import keras_parameterized from tensorflow.compat.v1.python.keras.regularizers import L1L2 from tensorflow_privacy.privacy.bolt_on.losses import StrongConvexBinaryCrossentropy from tensorflow_privacy.privacy.bolt_on.losses import StrongConvexHuber from tensorflow_privacy.privacy.bolt_on.losses import StrongConvexMixin @contextmanager def captured_output(): """Capture std_out and std_err within context.""" new_out, new_err = StringIO(), StringIO() old_out, old_err = sys.stdout, sys.stderr try: sys.stdout, sys.stderr = new_out, new_err yield sys.stdout, sys.stderr finally: sys.stdout, sys.stderr = old_out, old_err class StrongConvexMixinTests(keras_parameterized.TestCase): """Tests for the StrongConvexMixin.""" @parameterized.named_parameters([ {'testcase_name': 'beta not implemented', 'fn': 'beta', 'args': [1]}, {'testcase_name': 'gamma not implemented', 'fn': 'gamma', 'args': []}, {'testcase_name': 'lipchitz not implemented', 'fn': 'lipchitz_constant', 'args': [1]}, {'testcase_name': 'radius not implemented', 'fn': 'radius', 'args': []}, ]) def test_not_implemented(self, fn, args): """Test that the given fn's are not implemented on the mixin. Args: fn: fn on Mixin to test args: arguments to fn of Mixin """ with self.assertRaises(NotImplementedError): loss = StrongConvexMixin() getattr(loss, fn, None)(*args) @parameterized.named_parameters([ {'testcase_name': 'radius not implemented', 'fn': 'kernel_regularizer', 'args': []}, ]) def test_return_none(self, fn, args): """Test that fn of Mixin returns None. Args: fn: fn of Mixin to test args: arguments to fn of Mixin """ loss = StrongConvexMixin() ret = getattr(loss, fn, None)(*args) self.assertEqual(ret, None) class BinaryCrossesntropyTests(keras_parameterized.TestCase): """tests for BinaryCrossesntropy StrongConvex loss.""" @parameterized.named_parameters([ {'testcase_name': 'normal', 'reg_lambda': 1, 'C': 1, 'radius_constant': 1 }, # pylint: disable=invalid-name ]) def test_init_params(self, reg_lambda, C, radius_constant): """Test initialization for given arguments. Args: reg_lambda: initialization value for reg_lambda arg C: initialization value for C arg radius_constant: initialization value for radius_constant arg """ # test valid domains for each variable loss = StrongConvexBinaryCrossentropy(reg_lambda, C, radius_constant) self.assertIsInstance(loss, StrongConvexBinaryCrossentropy) @parameterized.named_parameters([ {'testcase_name': 'negative c', 'reg_lambda': 1, 'C': -1, 'radius_constant': 1 }, {'testcase_name': 'negative radius', 'reg_lambda': 1, 'C': 1, 'radius_constant': -1 }, {'testcase_name': 'negative lambda', 'reg_lambda': -1, 'C': 1, 'radius_constant': 1 }, # pylint: disable=invalid-name ]) def test_bad_init_params(self, reg_lambda, C, radius_constant): """Test invalid domain for given params. Should return ValueError. Args: reg_lambda: initialization value for reg_lambda arg C: initialization value for C arg radius_constant: initialization value for radius_constant arg """ # test valid domains for each variable with self.assertRaises(ValueError): StrongConvexBinaryCrossentropy(reg_lambda, C, radius_constant) @test_util.run_all_in_graph_and_eager_modes @parameterized.named_parameters([ # [] for compatibility with tensorflow loss calculation {'testcase_name': 'both positive', 'logits': [10000], 'y_true': [1], 'result': 0, }, {'testcase_name': 'positive gradient negative logits', 'logits': [-10000], 'y_true': [1], 'result': 10000, }, {'testcase_name': 'positivee gradient positive logits', 'logits': [10000], 'y_true': [0], 'result': 10000, }, {'testcase_name': 'both negative', 'logits': [-10000], 'y_true': [0], 'result': 0 }, ]) def test_calculation(self, logits, y_true, result): """Test the call method to ensure it returns the correct value. Args: logits: unscaled output of model y_true: label result: correct loss calculation value """ logits = tf.Variable(logits, False, dtype=tf.float32) y_true = tf.Variable(y_true, False, dtype=tf.float32) loss = StrongConvexBinaryCrossentropy(0.00001, 1, 1) loss = loss(y_true, logits) self.assertEqual(loss.numpy(), result) @parameterized.named_parameters([ {'testcase_name': 'beta', 'init_args': [1, 1, 1], 'fn': 'beta', 'args': [1], 'result': tf.constant(2, dtype=tf.float32) }, {'testcase_name': 'gamma', 'fn': 'gamma', 'init_args': [1, 1, 1], 'args': [], 'result': tf.constant(1, dtype=tf.float32), }, {'testcase_name': 'lipchitz constant', 'fn': 'lipchitz_constant', 'init_args': [1, 1, 1], 'args': [1], 'result': tf.constant(2, dtype=tf.float32), }, {'testcase_name': 'kernel regularizer', 'fn': 'kernel_regularizer', 'init_args': [1, 1, 1], 'args': [], 'result': L1L2(l2=0.5), }, ]) def test_fns(self, init_args, fn, args, result): """Test that fn of BinaryCrossentropy loss returns the correct result. Args: init_args: init values for loss instance fn: the fn to test args: the arguments to above function result: the correct result from the fn """ loss = StrongConvexBinaryCrossentropy(*init_args) expected = getattr(loss, fn, lambda: 'fn not found')(*args) if hasattr(expected, 'numpy') and hasattr(result, 'numpy'): # both tensor expected = expected.numpy() result = result.numpy() if hasattr(expected, 'l2') and hasattr(result, 'l2'): # both l2 regularizer expected = expected.l2 result = result.l2 self.assertEqual(expected, result) @parameterized.named_parameters([ {'testcase_name': 'label_smoothing', 'init_args': [1, 1, 1, True, 0.1], 'fn': None, 'args': None, 'print_res': 'The impact of label smoothing on privacy is unknown.' }, ]) def test_prints(self, init_args, fn, args, print_res): """Test logger warning from StrongConvexBinaryCrossentropy. Args: init_args: arguments to init the object with. fn: function to test args: arguments to above function print_res: print result that should have been printed. """ with captured_output() as (out, err): # pylint: disable=unused-variable loss = StrongConvexBinaryCrossentropy(*init_args) if fn is not None: getattr(loss, fn, lambda *arguments: print('error'))(*args) self.assertRegexMatch(err.getvalue().strip(), [print_res]) class HuberTests(keras_parameterized.TestCase): """tests for BinaryCrossesntropy StrongConvex loss.""" @parameterized.named_parameters([ {'testcase_name': 'normal', 'reg_lambda': 1, 'c': 1, 'radius_constant': 1, 'delta': 1, }, ]) def test_init_params(self, reg_lambda, c, radius_constant, delta): """Test initialization for given arguments. Args: reg_lambda: initialization value for reg_lambda arg c: initialization value for C arg radius_constant: initialization value for radius_constant arg delta: the delta parameter for the huber loss """ # test valid domains for each variable loss = StrongConvexHuber(reg_lambda, c, radius_constant, delta) self.assertIsInstance(loss, StrongConvexHuber) @parameterized.named_parameters([ {'testcase_name': 'negative c', 'reg_lambda': 1, 'c': -1, 'radius_constant': 1, 'delta': 1 }, {'testcase_name': 'negative radius', 'reg_lambda': 1, 'c': 1, 'radius_constant': -1, 'delta': 1 }, {'testcase_name': 'negative lambda', 'reg_lambda': -1, 'c': 1, 'radius_constant': 1, 'delta': 1 }, {'testcase_name': 'negative delta', 'reg_lambda': 1, 'c': 1, 'radius_constant': 1, 'delta': -1 }, ]) def test_bad_init_params(self, reg_lambda, c, radius_constant, delta): """Test invalid domain for given params. Should return ValueError. Args: reg_lambda: initialization value for reg_lambda arg c: initialization value for C arg radius_constant: initialization value for radius_constant arg delta: the delta parameter for the huber loss """ # test valid domains for each variable with self.assertRaises(ValueError): StrongConvexHuber(reg_lambda, c, radius_constant, delta) # test the bounds and test varied delta's @test_util.run_all_in_graph_and_eager_modes @parameterized.named_parameters([ {'testcase_name': 'delta=1,y_true=1 z>1+h decision boundary', 'logits': 2.1, 'y_true': 1, 'delta': 1, 'result': 0, }, {'testcase_name': 'delta=1,y_true=1 z<1+h decision boundary', 'logits': 1.9, 'y_true': 1, 'delta': 1, 'result': 0.01*0.25, }, {'testcase_name': 'delta=1,y_true=1 1-z< h decision boundary', 'logits': 0.1, 'y_true': 1, 'delta': 1, 'result': 1.9**2 * 0.25, }, {'testcase_name': 'delta=1,y_true=1 z < 1-h decision boundary', 'logits': -0.1, 'y_true': 1, 'delta': 1, 'result': 1.1, }, {'testcase_name': 'delta=2,y_true=1 z>1+h decision boundary', 'logits': 3.1, 'y_true': 1, 'delta': 2, 'result': 0, }, {'testcase_name': 'delta=2,y_true=1 z<1+h decision boundary', 'logits': 2.9, 'y_true': 1, 'delta': 2, 'result': 0.01*0.125, }, {'testcase_name': 'delta=2,y_true=1 1-z < h decision boundary', 'logits': 1.1, 'y_true': 1, 'delta': 2, 'result': 1.9**2 * 0.125, }, {'testcase_name': 'delta=2,y_true=1 z < 1-h decision boundary', 'logits': -1.1, 'y_true': 1, 'delta': 2, 'result': 2.1, }, {'testcase_name': 'delta=1,y_true=-1 z>1+h decision boundary', 'logits': -2.1, 'y_true': -1, 'delta': 1, 'result': 0, }, ]) def test_calculation(self, logits, y_true, delta, result): """Test the call method to ensure it returns the correct value. Args: logits: unscaled output of model y_true: label delta: delta value for StrongConvexHuber loss. result: correct loss calculation value """ logits = tf.Variable(logits, False, dtype=tf.float32) y_true = tf.Variable(y_true, False, dtype=tf.float32) loss = StrongConvexHuber(0.00001, 1, 1, delta) loss = loss(y_true, logits) self.assertAllClose(loss.numpy(), result) @parameterized.named_parameters([ {'testcase_name': 'beta', 'init_args': [1, 1, 1, 1], 'fn': 'beta', 'args': [1], 'result': tf.Variable(1.5, dtype=tf.float32) }, {'testcase_name': 'gamma', 'fn': 'gamma', 'init_args': [1, 1, 1, 1], 'args': [], 'result': tf.Variable(1, dtype=tf.float32), }, {'testcase_name': 'lipchitz constant', 'fn': 'lipchitz_constant', 'init_args': [1, 1, 1, 1], 'args': [1], 'result': tf.Variable(2, dtype=tf.float32), }, {'testcase_name': 'kernel regularizer', 'fn': 'kernel_regularizer', 'init_args': [1, 1, 1, 1], 'args': [], 'result': L1L2(l2=0.5), }, ]) def test_fns(self, init_args, fn, args, result): """Test that fn of BinaryCrossentropy loss returns the correct result. Args: init_args: init values for loss instance fn: the fn to test args: the arguments to above function result: the correct result from the fn """ loss = StrongConvexHuber(*init_args) expected = getattr(loss, fn, lambda: 'fn not found')(*args) if hasattr(expected, 'numpy') and hasattr(result, 'numpy'): # both tensor expected = expected.numpy() result = result.numpy() if hasattr(expected, 'l2') and hasattr(result, 'l2'): # both l2 regularizer expected = expected.l2 result = result.l2 self.assertEqual(expected, result) if __name__ == '__main__': tf.test.main()
{ "pile_set_name": "Github" }
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */ #include "MoveMath.h" #include "Map/Ground.h" #include "Map/MapInfo.h" #include "Sim/Misc/GlobalSynced.h" #include "Sim/Misc/GroundBlockingObjectMap.h" #include "Sim/MoveTypes/MoveDefHandler.h" #include "Sim/MoveTypes/MoveType.h" #include "Sim/Objects/SolidObject.h" #include "Sim/Units/Unit.h" #include "System/Platform/Threading.h" bool CMoveMath::noHoverWaterMove = false; float CMoveMath::waterDamageCost = 0.0f; static constexpr int FOOTPRINT_XSTEP = 2; static constexpr int FOOTPRINT_ZSTEP = 2; float CMoveMath::yLevel(const MoveDef& moveDef, int xSqr, int zSqr) { switch (moveDef.speedModClass) { case MoveDef::Tank: // fall-through case MoveDef::KBot: { return (CGround::GetHeightReal (xSqr * SQUARE_SIZE, zSqr * SQUARE_SIZE) + 10.0f); } break; case MoveDef::Hover: { return (CGround::GetHeightAboveWater(xSqr * SQUARE_SIZE, zSqr * SQUARE_SIZE) + 10.0f); } break; case MoveDef::Ship: { return ( 0.0f); } break; } return 0.0f; } float CMoveMath::yLevel(const MoveDef& moveDef, const float3& pos) { switch (moveDef.speedModClass) { case MoveDef::Tank: // fall-through case MoveDef::KBot: { return (CGround::GetHeightReal (pos.x, pos.z) + 10.0f); } break; case MoveDef::Hover: { return (CGround::GetHeightAboveWater(pos.x, pos.z) + 10.0f); } break; case MoveDef::Ship: { return ( 0.0f); } break; } return 0.0f; } /* calculate the local speed-modifier for this MoveDef */ float CMoveMath::GetPosSpeedMod(const MoveDef& moveDef, unsigned xSquare, unsigned zSquare) { if (xSquare >= mapDims.mapx || zSquare >= mapDims.mapy) return 0.0f; const int square = (xSquare >> 1) + ((zSquare >> 1) * mapDims.hmapx); const int squareTerrType = readMap->GetTypeMapSynced()[square]; const float height = readMap->GetMIPHeightMapSynced(1)[square]; const float slope = readMap->GetSlopeMapSynced()[square]; const CMapInfo::TerrainType& tt = mapInfo->terrainTypes[squareTerrType]; switch (moveDef.speedModClass) { case MoveDef::Tank: { return (GroundSpeedMod(moveDef, height, slope) * tt.tankSpeed ); } break; case MoveDef::KBot: { return (GroundSpeedMod(moveDef, height, slope) * tt.kbotSpeed ); } break; case MoveDef::Hover: { return ( HoverSpeedMod(moveDef, height, slope) * tt.hoverSpeed); } break; case MoveDef::Ship: { return ( ShipSpeedMod(moveDef, height, slope) * tt.shipSpeed ); } break; default: {} break; } return 0.0f; } float CMoveMath::GetPosSpeedMod(const MoveDef& moveDef, unsigned xSquare, unsigned zSquare, float3 moveDir) { if (xSquare >= mapDims.mapx || zSquare >= mapDims.mapy) return 0.0f; const int square = (xSquare >> 1) + ((zSquare >> 1) * mapDims.hmapx); const int squareTerrType = readMap->GetTypeMapSynced()[square]; const float height = readMap->GetMIPHeightMapSynced(1)[square]; const float slope = readMap->GetSlopeMapSynced()[square]; const CMapInfo::TerrainType& tt = mapInfo->terrainTypes[squareTerrType]; const float3 sqrNormal = readMap->GetCenterNormals2DSynced()[xSquare + zSquare * mapDims.mapx]; // with a flat normal, only consider the normalized xz-direction // (the actual steepness is represented by the "slope" variable) // we verify that it was normalized in advance assert(float3(moveDir).SafeNormalize2D() == moveDir); // note: moveDir is (or should be) a unit vector in the xz-plane, y=0 // scale is negative for "downhill" slopes, positive for "uphill" ones const float dirSlopeMod = -moveDir.dot(sqrNormal); switch (moveDef.speedModClass) { case MoveDef::Tank: { return (GroundSpeedMod(moveDef, height, slope, dirSlopeMod) * tt.tankSpeed ); } break; case MoveDef::KBot: { return (GroundSpeedMod(moveDef, height, slope, dirSlopeMod) * tt.kbotSpeed ); } break; case MoveDef::Hover: { return ( HoverSpeedMod(moveDef, height, slope, dirSlopeMod) * tt.hoverSpeed); } break; case MoveDef::Ship: { return ( ShipSpeedMod(moveDef, height, slope, dirSlopeMod) * tt.shipSpeed ); } break; default: {} break; } return 0.0f; } /* Check if a given square-position is accessable by the MoveDef footprint. */ CMoveMath::BlockType CMoveMath::IsBlockedNoSpeedModCheck(const MoveDef& moveDef, int xSquare, int zSquare, const CSolidObject* collider) { const int xmin = std::max(xSquare - moveDef.xsizeh, 0); const int zmin = std::max(zSquare - moveDef.zsizeh, 0); const int xmax = std::min(xSquare + moveDef.xsizeh, mapDims.mapx - 1); const int zmax = std::min(zSquare + moveDef.zsizeh, mapDims.mapy - 1); BlockType ret = BLOCK_NONE; // footprints are point-symmetric around <xSquare, zSquare> // same as RangeIsBlocked but without anti-duplication test for (int z = zmin; z <= zmax; z += FOOTPRINT_ZSTEP) { const int zOffset = z * mapDims.mapx; for (int x = xmin; x <= xmax; x += FOOTPRINT_XSTEP) { const CGroundBlockingObjectMap::BlockingMapCell& cell = groundBlockingObjectMap.GetCellUnsafeConst(zOffset + x); for (size_t i = 0, n = cell.size(); i < n; i++) { const CSolidObject* collidee = cell[i]; if (((ret |= ObjectBlockType(moveDef, collidee, collider)) & BLOCK_STRUCTURE) == 0) continue; return ret; } } } return ret; } CMoveMath::BlockType CMoveMath::IsBlockedNoSpeedModCheckThreadUnsafe(const MoveDef& moveDef, int xSquare, int zSquare, const CSolidObject* collider) { assert(Threading::IsMainThread() || Threading::IsGameLoadThread()); return RangeIsBlocked(moveDef, xSquare - moveDef.xsizeh, xSquare + moveDef.xsizeh, zSquare - moveDef.zsizeh, zSquare + moveDef.zsizeh, collider); } bool CMoveMath::CrushResistant(const MoveDef& colliderMD, const CSolidObject* collidee) { if (!collidee->HasCollidableStateBit(CSolidObject::CSTATE_BIT_SOLIDOBJECTS)) return false; if (!collidee->crushable) return true; return (collidee->crushResistance > colliderMD.crushStrength); } bool CMoveMath::IsNonBlocking(const MoveDef& colliderMD, const CSolidObject* collidee, const CSolidObject* collider) { if (collider == collidee) return true; if (!collidee->HasCollidableStateBit(CSolidObject::CSTATE_BIT_SOLIDOBJECTS)) return true; // if obstacle is out of map bounds, it cannot block us if (!collidee->pos.IsInBounds()) return true; // same if obstacle is not currently marked on blocking-map if (!collidee->IsBlocking()) return true; if (collider != nullptr) return (IsNonBlocking(collidee, collider)); // remaining conditions under which obstacle does NOT block unit // only reachable from stand-alone PE invocations or GameHelper // 1. // unit is a submarine, obstacle sticks out above-water // (and not itself flagged as a submarine) *OR* unit is // not a submarine and obstacle is (fully under-water or // flagged as a submarine) // // NOTE: // do we want to allow submarines to pass underneath // any obstacle even if it is 99% submerged already? // // will cause stacking for submarines that are *not* // explicitly flagged as such in their MoveDefs // // note that these condition(s) can lead to a certain degree of // clipping: for full 3D accuracy the height of the MoveDef's // owner would need to be accessible, but the path-estimator // defs are not tied to any collider instances // const bool colliderIsSub = colliderMD.isSubmarine; const bool collideeIsSub = collidee->moveDef != nullptr && collidee->moveDef->isSubmarine; if (colliderIsSub) return (!collidee->IsUnderWater() && !collideeIsSub); return (collidee->IsUnderWater() || collideeIsSub); } bool CMoveMath::IsNonBlocking(const CSolidObject* collidee, const CSolidObject* collider) { // simple case: if unit and obstacle have non-zero // vertical separation as measured by their (model) // heights, unit can in theory always pass obstacle // // this allows (units marked as) submarines to both // *pass* and *short-range path* underneath floating // DT, or ships to P&SRP over underwater structures // // specifically restricted to units *inside* water // because it can have the unwanted side-effect of // enabling the PFS to generate paths for units on // steep slopes *through* obstacles, either higher // up or lower down // if ((collider->pos.y + math::fabs(collider->height)) < collidee->pos.y) return (collider->IsInWater() && collidee->IsInWater()); if ((collidee->pos.y + math::fabs(collidee->height)) < collider->pos.y) return (collider->IsInWater() && collidee->IsInWater()); return false; } CMoveMath::BlockType CMoveMath::ObjectBlockType(const MoveDef& moveDef, const CSolidObject* collidee, const CSolidObject* collider) { if (IsNonBlocking(moveDef, collidee, collider)) return BLOCK_NONE; if (collidee->immobile) return ((CrushResistant(moveDef, collidee))? BLOCK_STRUCTURE: BLOCK_NONE); // mobile obstacle, must be a unit const CUnit* u = static_cast<const CUnit*>(collidee); const AMoveType* mt = u->moveType; // if moving, unit is probably following a path if (u->IsMoving()) return BLOCK_MOVING; // not moving and not pushable, treat as blocking if (mt->IsPushResistant()) return BLOCK_STRUCTURE; // otherwise, unit is idling (no orders) or busy with a command // being-built units never count as idle, but should perhaps be // considered BLOCK_STRUCTURE return ((u->IsIdle())? BLOCK_MOBILE: BLOCK_MOBILE_BUSY); } CMoveMath::BlockType CMoveMath::SquareIsBlocked(const MoveDef& moveDef, int xSquare, int zSquare, const CSolidObject* collider) { if (static_cast<unsigned>(xSquare) >= mapDims.mapx || static_cast<unsigned>(zSquare) >= mapDims.mapy) return BLOCK_IMPASSABLE; BlockType r = BLOCK_NONE; const CGroundBlockingObjectMap::BlockingMapCell& cell = groundBlockingObjectMap.GetCellUnsafeConst(zSquare * mapDims.mapx + xSquare); for (size_t i = 0, n = cell.size(); i < n; i++) { r |= ObjectBlockType(moveDef, cell[i], collider); } return r; } CMoveMath::BlockType CMoveMath::RangeIsBlocked(const MoveDef& moveDef, int xmin, int xmax, int zmin, int zmax, const CSolidObject* collider) { xmin = std::max(xmin, 0); zmin = std::max(zmin, 0); xmax = std::min(xmax, mapDims.mapx - 1); zmax = std::min(zmax, mapDims.mapy - 1); BlockType ret = BLOCK_NONE; const int tempNum = gs->GetTempNum(); // footprints are point-symmetric around <xSquare, zSquare> for (int z = zmin; z <= zmax; z += FOOTPRINT_ZSTEP) { const int zOffset = z * mapDims.mapx; for (int x = xmin; x <= xmax; x += FOOTPRINT_XSTEP) { const CGroundBlockingObjectMap::BlockingMapCell& cell = groundBlockingObjectMap.GetCellUnsafeConst(zOffset + x); for (size_t i = 0, n = cell.size(); i < n; i++) { CSolidObject* collidee = cell[i]; if (collidee->tempNum == tempNum) continue; collidee->tempNum = tempNum; if (((ret |= ObjectBlockType(moveDef, collidee, collider)) & BLOCK_STRUCTURE) == 0) continue; return ret; } } } return ret; }
{ "pile_set_name": "Github" }
/** * Copyright 2014 XCL-Charts * * 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. * * @Project XCL-Charts * @Description Android图表基类库 * @author XiongChuanLiang<br/>(xcl_168@aliyun.com) * @Copyright Copyright (c) 2014 XCL-Charts (www.xclcharts.com) * @license http://www.apache.org/licenses/ Apache v2 License * @version 1.2 */ package com.demo.xclcharts.view; import java.util.LinkedList; import org.xclcharts.chart.PieChart; import org.xclcharts.chart.PieData; import org.xclcharts.common.DensityUtil; import org.xclcharts.event.click.ArcPosition; import org.xclcharts.event.click.ChartArcListener; import org.xclcharts.renderer.XEnum; import org.xclcharts.view.GraphicalView; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.PointF; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.widget.Toast; /** * @ClassName ClickPieChart01View * @Description 演示点击事件效果的例子 * @author XiongChuanLiang<br/>(xcl_168@aliyun.com) */ public class ClickPieChart01View extends GraphicalView { private String TAG = "ClickPieChart01View"; private PieChart chart = new PieChart(); private LinkedList<PieData> chartData = new LinkedList<PieData>(); private ChartArcListener onClickListener = null;; public ClickPieChart01View(Context context) { super(context); initView(); } public ClickPieChart01View(Context context, AttributeSet attrs){ super(context, attrs); initView(); } public ClickPieChart01View(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); initView(); } private void initView() { chartDataSet(); chartRender(); } @Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); //图所占范围大小 chart.setChartRange(w,h); } private void chartRender() { try { //标签显示(隐藏,显示在中间,显示在扇区外面,折线注释方式) chart.setLabelStyle(XEnum.SliceLabelStyle.INSIDE); //图的内边距 //注释折线较长,缩进要多些 int [] ltrb = new int[4]; ltrb[0] = DensityUtil.dip2px(getContext(), 30); //left ltrb[1] = DensityUtil.dip2px(getContext(), 55); //top ltrb[2] = DensityUtil.dip2px(getContext(), 30); //right ltrb[3] = DensityUtil.dip2px(getContext(), 30); //bottom chart.setPadding(ltrb[0], ltrb[1], ltrb[2], ltrb[3]); //设定数据源 chart.setDataSource(chartData); //标题 chart.setTitle("图表点击演示"); chart.addSubtitle("(XCL-Charts Demo)"); chart.setTitleVerticalAlign(XEnum.VerticalAlign.BOTTOM); chart.getLabelPaint().setTextSize(30); chart.getLabelPaint().setFakeBoldText(true); chart.getLabelPaint().setColor(Color.WHITE); //激活点击监听 chart.ActiveListenItemClick(); //显示标签框 chart.getPlotLabel().setLabelBoxStyle(XEnum.LabelBoxStyle.RECT); // chart.getPlotLabel().setLabelBoxStyle(XEnum.LabelBoxStyle.RECT) chart.getPlotLabel().getBox().setBorderLineColor(Color.rgb(0, 126, 231)); } catch (Exception e) { // TODO Auto-generated catch block Log.e(TAG, e.toString()); } } private void chartDataSet() { //设置图表数据源 PieData pd1 = new PieData("48","48%",45,Color.rgb(215, 124, 124)); //pd1.setItemLabelRotateAngle(90); PieData pd2 = new PieData("15","15%",15,Color.rgb(253, 180, 90)); //pd2.setItemLabelRotateAngle(90); PieData pd3 = new PieData("5","5%",5,Color.rgb(77, 83, 97)); //pd3.setItemLabelRotateAngle(90); PieData pd4 =new PieData("10","10%",10f,Color.rgb(253, 180, 90)); //pd4.setItemLabelRotateAngle(90); //360 * 0.10f); PieData pd5 =new PieData("其它","25%",25,Color.rgb(52, 194, 188),true); //pd5.setItemLabelRotateAngle(90); chartData.add(pd1); chartData.add(pd2); chartData.add(pd3); chartData.add(pd4); //将此比例块突出显示 chartData.add(pd5); } @Override public void render(Canvas canvas) { // TODO Auto-generated method stub try{ chart.render(canvas); } catch (Exception e){ Log.e(TAG, e.toString()); } } @Override public boolean onTouchEvent(MotionEvent event) { // TODO Auto-generated method stub //super.onTouchEvent(event); if(event.getAction() == MotionEvent.ACTION_UP) { triggerClick(event.getX(),event.getY()); } return true; } //触发监听 private void triggerClick(float x,float y) { ArcPosition record = chart.getPositionRecord(x,y); if( null == record) return; PieData pData = chartData.get(record.getDataID()); Toast.makeText(this.getContext(), "[此处为View返回的信息] key:" + pData.getKey() + " Label:" + pData.getLabel() , Toast.LENGTH_SHORT).show(); if(null != onClickListener) onClickListener.onClick(new PointF(x,y), record); } //请注意: // 此处是饼图所以监听为 ChartArcListener // 如为柱图则监听为 ChartBarListener // 如为线图或雷达图,则监听为ChartPointListener public void setOnPlotClickListener(ChartArcListener chartListener) { this.onClickListener = chartListener; } }
{ "pile_set_name": "Github" }
<?php /** * 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 (see LICENSE.txt in the base directory. If * not, see: * * @link <http://www.gnu.org/licenses/>. * @author niel * @copyright 2015 nZEDb */ if (!defined('nZEDb_INSTALLER')) { define('nZEDb_INSTALLER', true); } require_once realpath(dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'app' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nzedb\config\Configure; $config = new Configure('install'); // Path to smarty files. (not prefixed with nZEDb as the name is needed in smarty files). define('SMARTY_DIR', nZEDb_LIBS . 'smarty' . DS . 'smarty' . DS . 'libs' . DS); $www_top = str_replace("\\", "/", dirname($_SERVER['PHP_SELF'])); if (strlen($www_top) == 1) { $www_top = ""; } // Used everywhere an href is output, includes the full path to the nZEDb install. define('WWW_TOP', $www_top); ?>
{ "pile_set_name": "Github" }
package com.mesosphere.dcos.cassandra.common.tasks.cleanup; import com.google.common.collect.Iterators; import org.apache.mesos.state.JsonSerializer; import org.codehaus.jackson.JsonNode; import org.codehaus.jackson.map.ObjectMapper; import org.junit.Assert; import org.junit.Test; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class CleanupContextTest { @Test public void testJSONSerializationWithSnakeCaseMembers() throws Exception { CleanupContext context = new CleanupContext( Arrays.asList("node1"), Arrays.asList("keyspace1"), Arrays.asList("column_family1")); ObjectMapper om = new ObjectMapper(); JsonSerializer serializer = new JsonSerializer(); String jsonContext = new String(serializer.serialize(context), StandardCharsets.UTF_8); JsonNode rehydratedContext = om.readTree(jsonContext); List<String> keys = new ArrayList<>(); Iterators.addAll(keys, rehydratedContext.getFieldNames()); keys.sort(String::compareTo); Assert.assertEquals(Arrays.asList("column_families", "key_spaces", "nodes"), keys); context = serializer.deserialize(jsonContext.getBytes(StandardCharsets.UTF_8), CleanupContext.class); Assert.assertEquals(Arrays.asList("column_family1"), context.getColumnFamilies()); Assert.assertEquals(Arrays.asList("keyspace1"), context.getKeySpaces()); Assert.assertEquals(Arrays.asList("node1"), context.getNodes()); } }
{ "pile_set_name": "Github" }
/* Copyright (C) Charles Forsyth * See /doc/license/NOTICE.Plan9-9k.txt for details about the licensing. */ /* Portions of this file are Copyright (C) 2015-2018 Giacomo Tesio <giacomo@tesio.it> * See /doc/license/gpl-2.0.txt for details about the licensing. */ #include "u.h" #include "../port/lib.h" #include "mem.h" #include "dat.h" #include "fns.h" #include "../port/error.h" typedef struct User User; struct User { char* name; char* leader; User* next; int n; char* mem[]; }; enum{ Ulog= 6, Usize= 1<<Ulog, Umask= Usize-1, }; static struct{ Lock; User* hash[Usize]; } users; static void checkname(char *s) { Rune r; static char invalid[] = "#:,()"; if(*s == 0 || *s == '-' || *s == '+') error("illegal name"); while((r = *s) != 0){ if(r < Runeself){ s++; if(r < 0x20 || r >= 0x7F && r < 0xA0 || jehanne_strchr(invalid, r) != nil) r = Runeerror; }else s += jehanne_chartorune(&r, s); if(r == Runeerror) error("invalid character in name"); } } static uint32_t hashpjw(char *s) { uint32_t h, g; h = 0; for(; *s != 0; s++){ h = (h << 4) + (*s&0xFF); g = h & 0xf0000000; if(g != 0) h ^= ((g >> 24) & 0xff) | g; } return h & 0x7FFFFFFF; } static User** lookuser(char *name) { uint32_t h; User **l, *u; h = hashpjw(name) & Umask; for(l = &users.hash[h]; (u = *l) != nil; l = &u->next) if(jehanne_strcmp(u->name, name) == 0) break; return l; } static char* tack(char **p, char *s) { char *o; o = *p; jehanne_strcpy(o, s); *p += jehanne_strlen(o)+1; return o; } void adduser(char *uid, char *leader, int nm, char **mem) { User **l, *u, *v; char *o; int i, nc; if(leader != nil){ if(*leader == '\0') leader = nil; else if(jehanne_strcmp(leader, uid) == 0) leader = uid; } checkname(uid); nc = jehanne_strlen(uid)+1; if(leader != nil && leader != uid){ checkname(leader); nc += jehanne_strlen(leader)+1; } for(i = 0; i < nm; i++){ checkname(mem[i]); nc += jehanne_strlen(mem[i])+1; } v = jehanne_mallocz(sizeof(User)+nm*sizeof(v->mem[0])+nc, 1); if(v == nil) error(Enomem); o = (char*)(v+1)+nm*sizeof(v->mem[0]); v->name = tack(&o, uid); if(leader == nil) v->leader = nil; else if(jehanne_strcmp(v->name, leader) != 0) v->leader = tack(&o, leader); else v->leader = v->name; v->n = nm; for(i = 0; i < nm; i++) v->mem[i] = tack(&o, mem[i]); lock(&users); l = lookuser(uid); u = *l; if(u != nil){ /* replace */ v->next = u->next; jehanne_free(u); } *l = v; unlock(&users); } int deluser(char *name) { User **l, *u; lock(&users); l = lookuser(name); u = *l; if(u == nil){ unlock(&users); return 0; } *l = u->next; unlock(&users); jehanne_free(u); return 1; } static int ismember(char *s, int n, char **mem) { int i; for(i = 0; i < n; i++) if(jehanne_strcmp(s, mem[i]) == 0) return 1; return 0; } int ingroup(char *uid, char *gid) { User *g; if(jehanne_strcmp(uid, gid) == 0) return 1; lock(&users); g = *lookuser(gid); if(g != nil && ismember(uid, g->n, g->mem)){ unlock(&users); return 1; } unlock(&users); return 0; } int leadsgroup(char *uid, char *gid) { User *g; lock(&users); g = *lookuser(gid); if(g != nil){ if(g->leader != nil && jehanne_strcmp(uid, g->leader) == 0 || g->leader == nil && ismember(uid, g->n, g->mem)){ unlock(&users); return 1; } } unlock(&users); return g == nil && jehanne_strcmp(uid, gid) == 0; } char* usersread(void) { int i, m; User *u; Fmt fmt; jehanne_fmtstrinit(&fmt); for(i = 0; i < nelem(users.hash); i++){ lock(&users); for(u = users.hash[i]; u != nil; u = u->next){ jehanne_fmtprint(&fmt, "%q", u->name); if(u->leader != nil || u->n != 0){ jehanne_fmtprint(&fmt, " %q", u->leader != nil? u->leader: ""); for(m = 0; m < u->n; m++) jehanne_fmtprint(&fmt, " %q", u->mem[m]); } jehanne_fmtprint(&fmt, "\n"); } unlock(&users); } return jehanne_fmtstrflush(&fmt); } long userswrite(void *buf, long n) { int i, nf; char *p, *s, *e, *flds[100]; if(n <= 0) return n; if(n > 16*1024) error(Etoobig); p = jehanne_malloc(n+1); if(p == nil) error(Enomem); if(waserror()){ jehanne_free(p); nexterror(); } jehanne_memmove(p, buf, n); p[n] = '\0'; if(p[n-1] != '\n') error("incomplete line"); for(s = p; (e = jehanne_strchr(s, '\n')) != nil; s = e){ *e++ = '\0'; if(*s == '#') continue; nf = jehanne_tokenize(s, flds, nelem(flds)); if(nf == nelem(flds)) error("too many group members"); if(jehanne_strcmp(flds[0], "-") == 0){ for(i = 1; i < nf; i++) deluser(flds[i]); }else if(nf > 1) adduser(flds[0], flds[1], nf-2, flds+2); else if(nf != 0) adduser(flds[0], nil, 0, nil); } poperror(); jehanne_free(p); return n; }
{ "pile_set_name": "Github" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>sh.tak.appbundler</groupId> <artifactId>appbundle-maven-plugin</artifactId> <packaging>maven-plugin</packaging> <version>1.2.1-SNAPSHOT</version> <name>appbundle-maven-plugin</name> <url>https://github.com/federkasten/appbundle-maven-plugin</url> <description>Maven plugin that creates an Application Bundle for OS X containing all your project dependencies and the necessary metadata</description> <parent> <groupId>org.sonatype.oss</groupId> <artifactId>oss-parent</artifactId> <version>7</version> </parent> <licenses> <license> <name>Apache License, Version 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.html</url> <distribution>repo</distribution> </license> <license> <name>GNU General Public License version 2</name> <url>http://www.gnu.org/licenses/gpl-2.0.html</url> <distribution>repo</distribution> </license> </licenses> <scm> <url>https://github.com/federkasten/appbundle-maven-plugin.git</url> <connection>scm:git:git@github.com:federkasten/appbundle-maven-plugin.git</connection> <developerConnection>scm:git:git@github.com:federkasten/appbundle-maven-plugin.git</developerConnection> </scm> <build> <plugins> <plugin> <artifactId>exec-maven-plugin</artifactId> <groupId>org.codehaus.mojo</groupId> <version>1.4.0</version> <executions> <execution> <id>build-applauncher</id> <phase>generate-sources</phase> <goals> <goal>exec</goal> </goals> <configuration> <executable>${basedir}/build.sh</executable> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.5.1</version> <configuration> <target>1.6</target> </configuration> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-velocity</artifactId> <version>1.1.8</version> </dependency> <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-archiver</artifactId> <version>3.0.3</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>3.3.9</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-artifact</artifactId> <version>3.3.9</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-model</artifactId> <version>3.3.9</version> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-core</artifactId> <version>3.3.9</version> </dependency> </dependencies> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <maven.javadoc.skip>true</maven.javadoc.skip> </properties> <profiles> <profile> <id>release-sign-artifacts</id> <activation> <property> <name>performRelease</name> <value>true</value> </property> </activation> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> <executions> <execution> <id>sign-artifacts</id> <phase>verify</phase> <goals> <goal>sign</goal> </goals> </execution> </executions> </plugin> </plugins> </build> </profile> </profiles> </project>
{ "pile_set_name": "Github" }
Inputs: 0:Qbit, 1:Qbit, 2:Qbit, 3:Qbit, 4:Qbit, 5:Qbit, 6:Qbit, 7:Qbit, 8:Qbit QGate["H"](7) with nocontrol QGate["not"](7) with controls=[+0] with nocontrol QGate["T"](7) with nocontrol QGate["not"](7) with controls=[+2] with nocontrol QGate["T"](7) with nocontrol QGate["not"](7) with controls=[+0] with nocontrol QGate["T"]*(7) with nocontrol QGate["not"](7) with controls=[+2] with nocontrol QGate["T"]*(7) with nocontrol QGate["not"](0) with controls=[+2] with nocontrol QGate["S"]*(0) with nocontrol QGate["T"]*(0) with nocontrol QGate["not"](0) with controls=[+2] with nocontrol QGate["H"](7) with nocontrol QGate["H"](6) with nocontrol QGate["not"](6) with controls=[+7] with nocontrol QGate["T"](6) with nocontrol QGate["not"](6) with controls=[+1] with nocontrol QGate["T"]*(6) with nocontrol QGate["not"](6) with controls=[+7] with nocontrol QGate["T"](6) with nocontrol QGate["not"](6) with controls=[+1] with nocontrol QGate["T"]*(6) with nocontrol QGate["not"](7) with controls=[+1] with nocontrol QGate["T"](7) with nocontrol QGate["not"](7) with controls=[+1] with nocontrol QGate["T"]*(7) with nocontrol QGate["H"](8) with nocontrol QGate["not"](8) with controls=[+2] with nocontrol QGate["T"](8) with nocontrol QGate["not"](8) with controls=[+0] with nocontrol QGate["T"](8) with nocontrol QGate["not"](8) with controls=[+2] with nocontrol QGate["T"]*(8) with nocontrol QGate["not"](8) with controls=[+0] with nocontrol QGate["T"]*(8) with nocontrol QGate["H"](8) with nocontrol QGate["H"](6) with nocontrol QGate["not"](5) with controls=[+6] with nocontrol QGate["not"](3) with controls=[+6] with nocontrol QGate["not"](7) with controls=[+8] with nocontrol QGate["H"](6) with nocontrol QGate["not"](6) with controls=[+8] with nocontrol QGate["T"](6) with nocontrol QGate["not"](6) with controls=[+1] with nocontrol QGate["T"](6) with nocontrol QGate["not"](6) with controls=[+8] with nocontrol QGate["T"]*(6) with nocontrol QGate["not"](6) with controls=[+1] with nocontrol QGate["T"]*(6) with nocontrol QGate["not"](8) with controls=[+1] with nocontrol QGate["T"]*(8) with nocontrol QGate["not"](8) with controls=[+1] with nocontrol QGate["T"]*(8) with nocontrol QGate["H"](3) with nocontrol QGate["not"](3) with controls=[+7] with nocontrol QGate["T"](3) with nocontrol QGate["not"](3) with controls=[+1] with nocontrol QGate["T"](3) with nocontrol QGate["not"](3) with controls=[+7] with nocontrol QGate["T"](3) with nocontrol QGate["not"](3) with controls=[+1] with nocontrol QGate["T"](3) with nocontrol QGate["H"](6) with nocontrol QGate["H"](3) with nocontrol QGate["not"](4) with controls=[+6] with nocontrol QGate["not"](8) with controls=[+5] with nocontrol QGate["H"](5) with nocontrol QGate["not"](5) with controls=[+1] with nocontrol QGate["T"]*(5) with nocontrol QGate["not"](5) with controls=[+7] with nocontrol QGate["T"]*(5) with nocontrol QGate["not"](5) with controls=[+1] with nocontrol QGate["T"](5) with nocontrol QGate["not"](5) with controls=[+7] with nocontrol QGate["T"](5) with nocontrol QGate["S"]*(7) with nocontrol QGate["H"](8) with nocontrol QGate["not"](8) with controls=[+2] with nocontrol QGate["T"](8) with nocontrol QGate["not"](8) with controls=[+0] with nocontrol QGate["T"](8) with nocontrol QGate["not"](8) with controls=[+2] with nocontrol QGate["T"]*(8) with nocontrol QGate["not"](8) with controls=[+0] with nocontrol QGate["T"]*(8) with nocontrol QGate["T"](0) with nocontrol QGate["T"]*(2) with nocontrol QGate["H"](8) with nocontrol QGate["H"](5) with nocontrol QGate["not"](8) with controls=[+5] with nocontrol Outputs: 0:Qbit, 1:Qbit, 2:Qbit, 3:Qbit, 4:Qbit, 5:Qbit, 6:Qbit, 7:Qbit, 8:Qbit
{ "pile_set_name": "Github" }
/* SPDX-License-Identifier: GPL-2.0 */ #include <linux/virtio_byteorder.h> #include <linux/virtio.h> #include <uapi/linux/virtio_config.h> /* * __virtio_test_bit - helper to test feature bits. For use by transports. * Devices should normally use virtio_has_feature, * which includes more checks. * @vdev: the device * @fbit: the feature bit */ static inline bool __virtio_test_bit(const struct virtio_device *vdev, unsigned int fbit) { return vdev->features & (1ULL << fbit); } /** * __virtio_set_bit - helper to set feature bits. For use by transports. * @vdev: the device * @fbit: the feature bit */ static inline void __virtio_set_bit(struct virtio_device *vdev, unsigned int fbit) { vdev->features |= (1ULL << fbit); } /** * __virtio_clear_bit - helper to clear feature bits. For use by transports. * @vdev: the device * @fbit: the feature bit */ static inline void __virtio_clear_bit(struct virtio_device *vdev, unsigned int fbit) { vdev->features &= ~(1ULL << fbit); } #define virtio_has_feature(dev, feature) \ (__virtio_test_bit((dev), feature)) /** * virtio_has_iommu_quirk - determine whether this device has the iommu quirk * @vdev: the device */ static inline bool virtio_has_iommu_quirk(const struct virtio_device *vdev) { /* * Note the reverse polarity of the quirk feature (compared to most * other features), this is for compatibility with legacy systems. */ return !virtio_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM); } static inline bool virtio_is_little_endian(struct virtio_device *vdev) { return virtio_has_feature(vdev, VIRTIO_F_VERSION_1) || virtio_legacy_is_little_endian(); } /* Memory accessors */ static inline u16 virtio16_to_cpu(struct virtio_device *vdev, __virtio16 val) { return __virtio16_to_cpu(virtio_is_little_endian(vdev), val); } static inline __virtio16 cpu_to_virtio16(struct virtio_device *vdev, u16 val) { return __cpu_to_virtio16(virtio_is_little_endian(vdev), val); } static inline u32 virtio32_to_cpu(struct virtio_device *vdev, __virtio32 val) { return __virtio32_to_cpu(virtio_is_little_endian(vdev), val); } static inline __virtio32 cpu_to_virtio32(struct virtio_device *vdev, u32 val) { return __cpu_to_virtio32(virtio_is_little_endian(vdev), val); } static inline u64 virtio64_to_cpu(struct virtio_device *vdev, __virtio64 val) { return __virtio64_to_cpu(virtio_is_little_endian(vdev), val); } static inline __virtio64 cpu_to_virtio64(struct virtio_device *vdev, u64 val) { return __cpu_to_virtio64(virtio_is_little_endian(vdev), val); }
{ "pile_set_name": "Github" }
//////////////////////////////////////////////////////////////////////////////// ///////////////////InstallShield Media Library Report Summary/////////////////// //////////////////////////////////////////////////////////////////////////////// Media Name : Floppies Report Filename : D:\My Installations\Executor-DOS Demo\Media\Floppies\Report Files\5-05-1998 6.10.16AM.rpt Date : 05/05/1998 Time : 6:10AM Number of Components: 3 Number of File Groups: 3 Number of Files: 134 Total Size of Files: 11,021,616 (bytes) ========== COMPONENTS ========== Executor CD Enable CD vxd //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////Report Details///////////////////////////////// //////////////////////////////////////////////////////////////////////////////// ================================================================================ COMPONENT: "Executor" ================================================================================ SUMMARY: Total Files: 132 (files for this component only) Source Bytes: 10,986,128 (files for this component only) **** File Group: "Executor" **** <Directory>: I:\execdos.demo Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- cwsdpmi.exe 10/19/1997 21:48:14 20,473 emu387.dxe 07/16/1995 15:59:38 61,420 executor.exe 05/04/1998 01:47:50 2,004,480 executor.pif 11/10/1997 15:34:44 967 exsystem.hfv 12/01/1997 21:41:46 6,291,456 extemp.hfv 06/10/1997 18:43:12 2,097,152 makehfv.exe 08/11/1996 22:12:46 110,108 print.bat 12/30/1997 11:43:18 882 printdef.ini 10/01/1997 22:32:20 99 printers.ini 12/30/1997 11:40:40 2,021 readme.txt 11/10/1997 15:34:44 2,017 tips.txt 01/08/1998 17:02:18 2,584 fees.txt 05/04/1998 00:24:34 817 dirMap-le 05/04/1998 03:27:36 0 -------------------------- ---------- -------- ----------- ------------- Count=14 10,594,476 <Directory>: I:\execdos.demo\trouble Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- vgaonly.pif 11/10/1997 15:34:44 967 desperat.pif 11/10/1997 15:34:44 967 readme.txt 11/10/1997 15:34:44 1,116 -------------------------- ---------- -------- ----------- ------------- Count=3 3,050 <Directory>: I:\execdos.demo\docs Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- readme 06/10/1997 19:03:46 589 -------------------------- ---------- -------- ----------- ------------- Count=1 589 <Directory>: I:\execdos.demo\docs\cwsdpmi Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- cwsdpmi.doc 06/10/1997 18:14:50 7,186 -------------------------- ---------- -------- ----------- ------------- Count=1 7,186 <Directory>: I:\execdos.demo\docs\djgpp Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- copying.dj 06/10/1997 18:37:16 1,620 -------------------------- ---------- -------- ----------- ------------- Count=1 1,620 <Directory>: I:\execdos.demo\docs\wmemu387 Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- linux.txt 06/10/1997 18:38:30 16,359 copying 06/10/1997 18:39:56 18,323 djgpp.txt 06/10/1997 18:39:18 899 -------------------------- ---------- -------- ----------- ------------- Count=3 35,581 <Directory>: I:\execdos.demo\splash Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- splash.8bp 05/03/1998 22:37:00 309,320 -------------------------- ---------- -------- ----------- ------------- Count=1 309,320 <Directory>: I:\execdos.demo\configur Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- 32362e32.ecf 11/10/1997 15:34:12 330 3842494d.ecf 11/10/1997 15:34:12 436 3f3f3f3f.ecf 11/10/1997 15:34:12 366 41443344.ecf 11/10/1997 15:34:12 344 414f7163.ecf 11/10/1997 15:34:12 357 41525435.ecf 11/10/1997 15:34:12 455 41527c46.ecf 11/10/1997 15:34:12 328 4154726e.ecf 11/10/1997 15:34:12 343 4164426b.ecf 11/10/1997 15:34:12 326 41706569.ecf 11/10/1997 15:34:12 339 42454132.ecf 11/10/1997 15:34:12 344 424f4c4f.ecf 11/10/1997 15:34:12 310 426163d5.ecf 11/10/1997 15:34:12 365 42646c6d.ecf 11/10/1997 15:34:12 372 426e4871.ecf 11/10/1997 15:34:12 324 43475246.ecf 11/10/1997 15:34:12 348 43504354.ecf 11/10/1997 15:34:12 316 4352534c.ecf 11/10/1997 15:34:12 359 4354494d.ecf 11/10/1997 15:34:12 370 43555341.ecf 11/10/1997 15:34:12 357 43574c44.ecf 11/10/1997 15:34:12 361 43595153.ecf 11/10/1997 15:34:12 126 43764d4d.ecf 11/10/1997 15:34:12 312 4444534b.ecf 11/10/1997 15:34:12 357 44454c49.ecf 11/10/1997 15:34:12 349 44494132.ecf 11/10/1997 15:34:12 227 444f4c4c.ecf 11/10/1997 15:34:12 350 44576174.ecf 11/10/1997 15:34:12 348 44616e47.ecf 11/10/1997 15:34:12 126 454a3035.ecf 11/10/1997 15:34:12 312 45535041.ecf 11/10/1997 15:34:12 332 455544c6.ecf 11/10/1997 15:34:12 280 46424420.ecf 11/10/1997 15:34:12 334 466c6974.ecf 11/10/1997 15:34:12 338 46756e47.ecf 11/10/1997 15:34:12 331 47436f6e.ecf 11/10/1997 15:34:12 430 474f474f.ecf 11/10/1997 15:34:12 340 47534361.ecf 11/10/1997 15:34:12 334 47756e53.ecf 11/10/1997 15:34:12 126 483444c6.ecf 11/10/1997 15:34:12 362 48525630.ecf 11/10/1997 15:34:12 374 48525631.ecf 11/10/1997 15:34:12 375 48734c61.ecf 11/10/1997 15:34:12 337 496d6167.ecf 11/10/1997 15:34:12 343 4a4b5445.ecf 11/10/1997 15:34:12 126 4a524735.ecf 11/10/1997 15:34:12 343 4a70616b.ecf 11/10/1997 15:34:12 323 4b705353.ecf 11/10/1997 15:34:12 328 4c415a48.ecf 11/10/1997 15:34:12 273 4c505243.ecf 11/10/1997 15:34:12 324 4d427264.ecf 11/10/1997 15:34:12 364 4d4b444e.ecf 11/10/1997 15:34:12 165 4d4d4343.ecf 11/10/1997 15:34:12 347 4d4d5042.ecf 11/10/1997 15:34:12 363 4d504e54.ecf 11/10/1997 15:34:12 265 4d535744.ecf 11/10/1997 15:34:12 331 4d61656c.ecf 11/10/1997 15:34:12 337 4d687a75.ecf 11/10/1997 15:34:12 351 4d6f6c54.ecf 11/10/1997 15:34:12 321 50217268.ecf 11/10/1997 15:34:12 276 50474150.ecf 11/10/1997 15:34:12 336 504c5073.ecf 11/10/1997 15:34:12 272 504e4331.ecf 11/10/1997 15:34:12 157 50505456.ecf 11/10/1997 15:34:12 333 50566d74.ecf 11/10/1997 15:34:12 126 50674c67.ecf 11/10/1997 15:34:12 364 506fc450.ecf 11/10/1997 15:34:12 432 50736f64.ecf 11/10/1997 15:34:12 392 51444c58.ecf 11/10/1997 15:34:12 331 522a6368.ecf 11/10/1997 15:34:12 371 52415a5a.ecf 11/10/1997 15:34:12 334 5249534b.ecf 11/10/1997 15:34:12 336 524a4253.ecf 11/10/1997 15:34:12 175 524c4d5a.ecf 11/10/1997 15:34:12 417 52565253.ecf 11/10/1997 15:34:12 126 526a3031.ecf 11/10/1997 15:34:12 324 53414e54.ecf 11/10/1997 15:34:12 329 53495421.ecf 11/10/1997 15:34:12 374 53495478.ecf 11/10/1997 15:34:12 329 534d4c53.ecf 11/10/1997 15:34:12 326 53635246.ecf 11/10/1997 15:34:12 373 5368537a.ecf 11/10/1997 15:34:12 126 53704a4b.ecf 11/10/1997 15:34:12 337 53706563.ecf 11/10/1997 15:34:12 324 5370696e.ecf 11/10/1997 15:34:12 320 54424235.ecf 11/10/1997 15:34:12 338 54424236.ecf 11/10/1997 15:34:12 335 544b4e4f.ecf 11/10/1997 15:34:12 166 54745264.ecf 11/10/1997 15:34:12 165 54775231.ecf 11/10/1997 15:34:12 321 55505550.ecf 11/10/1997 15:34:12 329 556c7433.ecf 11/10/1997 15:34:12 364 57435345.ecf 11/10/1997 15:34:12 320 574f4c46.ecf 11/10/1997 15:34:12 363 57504332.ecf 11/10/1997 15:34:12 323 5843454c.ecf 11/10/1997 15:34:12 323 58505233.ecf 11/10/1997 15:34:12 362 63417244.ecf 11/10/1997 15:34:12 345 674f4c46.ecf 11/10/1997 15:34:12 353 6c6f6733.ecf 11/10/1997 15:34:12 329 6f7a6d35.ecf 11/10/1997 15:34:12 346 72647020.ecf 11/10/1997 15:34:12 324 72706db5.ecf 11/10/1997 15:34:12 360 73506433.ecf 11/10/1997 15:34:12 322 a78ea8a0.ecf 11/10/1997 15:34:12 328 a7bfc2a2.ecf 11/10/1997 15:34:12 320 ac7e5ea0.ecf 11/10/1997 15:34:12 126 f5536b69.ecf 11/10/1997 15:34:12 350 -------------------------- ---------- -------- ----------- ------------- Count=108 34,306 ================================================================================ COMPONENT: "CD Enable" ================================================================================ SUMMARY: Total Files: 1 (files for this component only) Source Bytes: 11,011,728 (files for this component only) **** File Group: "cdenable program" **** <Directory>: I:\execdos.demo Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- cdenable.exe 11/11/1997 03:13:12 25,600 -------------------------- ---------- -------- ----------- ------------- Count=1 25,600 ================================================================================ COMPONENT: "CD Enable\CD vxd" ================================================================================ SUMMARY: Total Files: 1 (files for this component only) Source Bytes: 11,021,616 (files for this component only) **** File Group: "cdenable vxd" **** <Directory>: I:\execdos.demo Filename Date Time Size Version -------------------------- ---------- -------- ----------- ------------- cdenable.vxd 03/13/1998 00:51:16 9,888 -------------------------- ---------- -------- ----------- ------------- Count=1 9,888
{ "pile_set_name": "Github" }
/*ckwg +29 * Copyright 2016 by Kitware, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * * Neither the name Kitware, Inc. nor the names of any contributors may be * used to endorse or promote products derived from this software without * specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef TELESCULPTOR_ABOUTDIALOG_H_ #define TELESCULPTOR_ABOUTDIALOG_H_ #include <qtGlobal.h> #include <QDialog> class AboutDialogPrivate; class AboutDialog : public QDialog { Q_OBJECT public: explicit AboutDialog(QWidget* parent = 0, Qt::WindowFlags f = 0); ~AboutDialog() override; protected slots: void openLink(QString const&); protected: QTE_DECLARE_PRIVATE_RPTR(AboutDialog) private: QTE_DECLARE_PRIVATE(AboutDialog) Q_DISABLE_COPY(AboutDialog) }; #endif
{ "pile_set_name": "Github" }
--- layout: "vault" page_title: "Vault: vault_identity_entity resource" sidebar_current: "docs-vault-resource-identity-entity" description: |- Creates an Identity Entity for Vault. --- # vault\_identity\_entity Creates an Identity Entity for Vault. The Identity secrets engine is the identity management solution for Vault. It internally maintains the clients who are recognized by Vault. ~> **Important** All data provided in the resource configuration will be written in cleartext to state and plan files generated by Terraform, and will appear in the console output when Terraform runs. Protect these artifacts accordingly. See [the main provider documentation](../index.html) for more details. ## Example Usage ```hcl resource "vault_identity_entity" "test" { name = "tester1" policies = ["test"] metadata = { foo = "bar" } } ``` ## Argument Reference The following arguments are supported: * `name` - (Required) Name of the identity entity to create. * `policies` - (Optional) A list of policies to apply to the entity. * `metadata` - (Optional) A Map of additional metadata to associate with the user. * `disabled` - (Optional) True/false Is this entity currently disabled. Defaults to `false` * `external_policies` - (Optional) `false` by default. If set to `true`, this resource will ignore any policies return from Vault or specified in the resource. You can use [`vault_identity_entity_policies`](identity_entity_policies.html) to manage policies for this entity in a decoupled manner. ## Attributes Reference * `id` - The `id` of the created entity.
{ "pile_set_name": "Github" }
// ------------------------------------------------------------------------------ // <auto-generated> // This code was generated by SpecFlow (http://www.specflow.org/). // SpecFlow Version:1.8.1.0 // SpecFlow Generator Version:1.8.0.0 // Runtime Version:4.0.30319.269 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> // ------------------------------------------------------------------------------ #region Designer generated code #pragma warning disable namespace Conference.Specflow.Features.UserInterface.Controllers.Registration { using TechTalk.SpecFlow; [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.8.1.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public partial class SelfRegistrantEndToEndScenarioForMakingARegistrationForAConferenceSiteImplementedUsingControllersFeature : Xunit.IUseFixture<SelfRegistrantEndToEndScenarioForMakingARegistrationForAConferenceSiteImplementedUsingControllersFeature.FixtureData>, System.IDisposable { private static TechTalk.SpecFlow.ITestRunner testRunner; #line 1 "SelfRegistrationEndToEndWithControllers.feature" #line hidden public SelfRegistrantEndToEndScenarioForMakingARegistrationForAConferenceSiteImplementedUsingControllersFeature() { this.TestInitialize(); } public static void FeatureSetup() { testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(); TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Self Registrant end to end scenario for making a Registration for a Conference si" + "te (Implemented using Controllers)", "In order to register for a conference\r\nAs an Attendee\r\nI want to be able to regis" + "ter for the conference, pay for the Registration Order and associate myself with" + " the paid Order automatically", ProgrammingLanguage.CSharp, new string[] { "SelfRegistrationEndToEndWithControllers", "NoWatiN"}); testRunner.OnFeatureStart(featureInfo); } public static void FeatureTearDown() { testRunner.OnFeatureEnd(); testRunner = null; } public virtual void TestInitialize() { } public virtual void ScenarioTearDown() { testRunner.OnScenarioEnd(); } public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo) { testRunner.OnScenarioStart(scenarioInfo); } public virtual void ScenarioCleanup() { testRunner.CollectScenarioErrors(); } public virtual void FeatureBackground() { #line 21 #line hidden TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { "seat type", "rate", "quota"}); table1.AddRow(new string[] { "General admission", "$199", "100"}); table1.AddRow(new string[] { "CQRS Workshop", "$500", "100"}); table1.AddRow(new string[] { "Additional cocktail party", "$50", "100"}); #line 22 testRunner.Given("the list of the available Order Items for the CQRS summit 2012 conference", ((string)(null)), table1); #line hidden TechTalk.SpecFlow.Table table2 = new TechTalk.SpecFlow.Table(new string[] { "seat type", "quantity"}); table2.AddRow(new string[] { "General admission", "1"}); table2.AddRow(new string[] { "Additional cocktail party", "1"}); #line 27 testRunner.And("the selected Order Items", ((string)(null)), table2); #line hidden } public virtual void SetFixture(SelfRegistrantEndToEndScenarioForMakingARegistrationForAConferenceSiteImplementedUsingControllersFeature.FixtureData fixtureData) { } void System.IDisposable.Dispose() { this.ScenarioTearDown(); } [Xunit.FactAttribute()] [Xunit.TraitAttribute("FeatureTitle", "Self Registrant end to end scenario for making a Registration for a Conference si" + "te (Implemented using Controllers)")] [Xunit.TraitAttribute("Description", "End to end Registration implemented using controllers")] public virtual void EndToEndRegistrationImplementedUsingControllers() { TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("End to end Registration implemented using controllers", ((string[])(null))); #line 33 this.ScenarioSetup(scenarioInfo); #line 21 this.FeatureBackground(); #line 34 testRunner.Given("the Registrant proceeds to make the Reservation"); #line hidden TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] { "seat type", "quantity"}); table3.AddRow(new string[] { "General admission", "1"}); table3.AddRow(new string[] { "Additional cocktail party", "1"}); #line 35 testRunner.And("these Order Items should be reserved", ((string)(null)), table3); #line hidden TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] { "seat type"}); table4.AddRow(new string[] { "CQRS Workshop"}); #line 39 testRunner.And("these Order Items should not be reserved", ((string)(null)), table4); #line hidden TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] { "first name", "last name", "email address"}); table5.AddRow(new string[] { "William", "Flash", "william@fabrikam.com"}); #line 42 testRunner.And("the Registrant enters these details", ((string)(null)), table5); #line 45 testRunner.And("the Registrant proceeds to Checkout:Payment"); #line 46 testRunner.When("the Registrant proceeds to confirm the payment"); #line hidden TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] { "seat type", "quantity"}); table6.AddRow(new string[] { "General admission", "1"}); table6.AddRow(new string[] { "Additional cocktail party", "1"}); #line 47 testRunner.Then("the Order should be created with the following Order Items", ((string)(null)), table6); #line hidden TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] { "seat type", "first name", "last name", "email address"}); table7.AddRow(new string[] { "General admission", "William", "Flash", "william@fabrikam.com"}); table7.AddRow(new string[] { "Additional cocktail party", "Jim", "Corbin", "jim@litwareinc.com"}); #line 51 testRunner.And("the Registrant assigns these seats", ((string)(null)), table7); #line hidden TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] { "seat type", "quantity"}); table8.AddRow(new string[] { "General admission", "1"}); table8.AddRow(new string[] { "Additional cocktail party", "1"}); #line 55 testRunner.And("these seats are assigned", ((string)(null)), table8); #line hidden this.ScenarioCleanup(); } [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.8.1.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class FixtureData : System.IDisposable { public FixtureData() { SelfRegistrantEndToEndScenarioForMakingARegistrationForAConferenceSiteImplementedUsingControllersFeature.FeatureSetup(); } void System.IDisposable.Dispose() { SelfRegistrantEndToEndScenarioForMakingARegistrationForAConferenceSiteImplementedUsingControllersFeature.FeatureTearDown(); } } } } #pragma warning restore #endregion
{ "pile_set_name": "Github" }
<registry_state xmlns="http://oval.mitre.org/XMLSchema/oval-definitions-5#windows" comment="Version is less than 13.0.0.277" id="oval:org.mitre.oval:ste:39434" version="1"> <value datatype="version" operation="less than">13.0.0.277</value> </registry_state>
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{4B87F1FB-EFA9-412C-98A8-06CAF711AC92}</ProjectGuid> <OutputType>AppContainerExe</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>AlertCallbacks.WinPhone81</RootNamespace> <AssemblyName>AlertCallbacks.WinPhone81</AssemblyName> <DefaultLanguage>en-US</DefaultLanguage> <TargetPlatformVersion>8.1</TargetPlatformVersion> <MinimumVisualStudioVersion>12</MinimumVisualStudioVersion> <FileAlignment>512</FileAlignment> <ProjectTypeGuids>{76F1466A-8B6D-4E39-A767-685A06062A39};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <NuGetPackageImportStamp>c3474f2b</NuGetPackageImportStamp> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <Optimize>false</Optimize> <OutputPath>bin\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'"> <DebugSymbols>true</DebugSymbols> <OutputPath>bin\ARM\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants> <NoWarn>;2008</NoWarn> <DebugType>full</DebugType> <PlatformTarget>ARM</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> <Prefer32Bit>true</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'"> <OutputPath>bin\ARM\Release\</OutputPath> <DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants> <Optimize>true</Optimize> <NoWarn>;2008</NoWarn> <DebugType>pdbonly</DebugType> <PlatformTarget>ARM</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> <Prefer32Bit>true</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> <DebugSymbols>true</DebugSymbols> <OutputPath>bin\x86\Debug\</OutputPath> <DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants> <NoWarn>;2008</NoWarn> <DebugType>full</DebugType> <PlatformTarget>x86</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> <Prefer32Bit>true</Prefer32Bit> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> <OutputPath>bin\x86\Release\</OutputPath> <DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants> <Optimize>true</Optimize> <NoWarn>;2008</NoWarn> <DebugType>pdbonly</DebugType> <PlatformTarget>x86</PlatformTarget> <UseVSHostingProcess>false</UseVSHostingProcess> <ErrorReport>prompt</ErrorReport> <Prefer32Bit>true</Prefer32Bit> </PropertyGroup> <ItemGroup> <Compile Include="App.xaml.cs"> <DependentUpon>App.xaml</DependentUpon> </Compile> <Compile Include="MainPage.xaml.cs"> <DependentUpon>MainPage.xaml</DependentUpon> </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> </ItemGroup> <ItemGroup> <AppxManifest Include="Package.appxmanifest"> <SubType>Designer</SubType> </AppxManifest> </ItemGroup> <ItemGroup> <Content Include="Assets\Logo.scale-240.png" /> <Content Include="Assets\SmallLogo.scale-240.png" /> <Content Include="Assets\SplashScreen.scale-240.png" /> <Content Include="Assets\Square71x71Logo.scale-240.png" /> <Content Include="Assets\StoreLogo.scale-240.png" /> <Content Include="Assets\WideLogo.scale-240.png" /> </ItemGroup> <ItemGroup> <ApplicationDefinition Include="App.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </ApplicationDefinition> <Page Include="MainPage.xaml"> <Generator>MSBuild:Compile</Generator> <SubType>Designer</SubType> </Page> </ItemGroup> <ItemGroup> <ProjectReference Include="..\AlertCallbacks\AlertCallbacks.csproj"> <Project>{204321ad-b813-4e3b-a382-ed4253a4f393}</Project> <Name>AlertCallbacks</Name> </ProjectReference> </ItemGroup> <ItemGroup> <Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\wpa81\Xamarin.Forms.Core.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Platform.WinRT, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\wpa81\Xamarin.Forms.Platform.WinRT.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Platform.WinRT.Phone, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\wpa81\Xamarin.Forms.Platform.WinRT.Phone.dll</HintPath> </Reference> <Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <HintPath>..\..\packages\Xamarin.Forms.2.0.0.6482\lib\wpa81\Xamarin.Forms.Xaml.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <None Include="packages.config" /> </ItemGroup> <PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' "> <VisualStudioVersion>12.0</VisualStudioVersion> </PropertyGroup> <PropertyGroup Condition=" '$(TargetPlatformIdentifier)' == '' "> <TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier> </PropertyGroup> <Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" /> <Import Project="..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" /> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <PropertyGroup> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> </PropertyGroup> <Error Condition="!Exists('..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.2.0.0.6482\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets'))" /> </Target> <!-- To modify your build process, add your task inside one of the targets below and uncomment it. Other similar extension points exist, see Microsoft.Common.targets. <Target Name="BeforeBuild"> </Target> <Target Name="AfterBuild"> </Target> --> </Project>
{ "pile_set_name": "Github" }
export * from './Path' export * from './Tree' export * from './TreeItem' export * from './Preview'
{ "pile_set_name": "Github" }
/**************************************************************************** Copyright (c) 2013-2017 Chukong Technologies Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include <math.h> #include "editor-support/cocostudio/CCActionFrameEasing.h" #include "editor-support/cocostudio/DictionaryHelper.h" #include "platform/CCStdC.h" namespace cocostudio { #ifndef M_PI_X_2 #define M_PI_X_2 (float)M_PI * 2.0f #endif ActionFrameEasing::ActionFrameEasing() { } ActionFrameEasing::~ActionFrameEasing() { } float ActionFrameEasing::bounceTime(float t) { if (t < 1 / 2.75) { return 7.5625f * t * t; } else if (t < 2 / 2.75) { t -= 1.5f / 2.75f; return 7.5625f * t * t + 0.75f; } else if (t < 2.5 / 2.75) { t -= 2.25f / 2.75f; return 7.5625f * t * t + 0.9375f; } t -= 2.625f / 2.75f; return 7.5625f * t * t + 0.984375f; } float ActionFrameEasing::easeValue(float t) { if (_type == FrameEasingType::kframeEasingInstant) { if (t < 1) return 0; else return 1; } else if (_type == FrameEasingType::kframeEasingLinear) { return t; } else if (_type == FrameEasingType::kframeEasingCubicIn) { float rate = _fValue; return powf(t,rate); } else if (_type == FrameEasingType::kframeEasingCubicOut) { float rate = _fValue; return powf(t,1/rate); } else if (_type == FrameEasingType::kframeEasingCubicInOut) { float rate = _fValue; t *= 2; if (t < 1) { return 0.5f * powf (t, rate); } else { return 1.0f - 0.5f * powf(2-t, rate); } } else if (_type == FrameEasingType::kframeEasingElasticIn) { float period = _fValue; float newT = 0; if (t == 0 || t == 1) newT = t; else { float s = period / 4; t = t - 1; newT = -powf(2, 10 * t) * sinf( (t-s) * M_PI_X_2 / period); } return newT; } else if (_type == FrameEasingType::kframeEasingElasticOut) { float period = _fValue; float newT = 0; if (t == 0 || t == 1) { newT = t; } else { float s = period / 4; newT = powf(2, -10 * t) * sinf( (t-s) *M_PI_X_2 / period) + 1; } return newT; } else if (_type == FrameEasingType::kframeEasingElasticInOut) { float period = _fValue; float newT = 0; if( t == 0 || t == 1 ) newT = t; else { t = t * 2; if(! period ) period = 0.3f * 1.5f; float s = period / 4; t = t -1; if( t < 0 ) newT = -0.5f * powf(2, 10 * t) * sinf((t - s) * M_PI_X_2 / period); else newT = powf(2, -10 * t) * sinf((t - s) * M_PI_X_2 / period) * 0.5f + 1; } return newT; } else if (_type == FrameEasingType::kframeEasingBounceIn) { float newT = 1 - bounceTime(1-t); return newT; } else if (_type == FrameEasingType::kframeEasingBounceOut) { float newT = bounceTime(t); return newT; } else if (_type == FrameEasingType::kframeEasingBounceInOut) { float newT = 0; if (t < 0.5) { t = t * 2; newT = (1 - bounceTime(1-t) ) * 0.5f; } else newT = bounceTime(t * 2 - 1) * 0.5f + 0.5f; return newT; } else if (_type == FrameEasingType::kframeEasingBackIn) { float overshoot = 1.70158f; return t * t * ((overshoot + 1) * t - overshoot); } else if (_type == FrameEasingType::kframeEasingBackOut) { float overshoot = 1.70158f; t = t - 1; return t * t * ((overshoot + 1) * t + overshoot) + 1; } else if (_type == FrameEasingType::kframeEasingBackInOut) { float overshoot = 1.70158f * 1.525f; t = t * 2; if (t < 1) return (t * t * ((overshoot + 1) * t - overshoot)) / 2; else { t = t - 2; return (t * t * ((overshoot + 1) * t + overshoot)) / 2 + 1; } } return 0; } }
{ "pile_set_name": "Github" }
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var prefix = 'fas'; var iconName = 'plane'; var width = 576; var height = 512; var ligatures = []; var unicode = 'f072'; var svgPathData = 'M480 192H365.71L260.61 8.06A16.014 16.014 0 0 0 246.71 0h-65.5c-10.63 0-18.3 10.17-15.38 20.39L214.86 192H112l-43.2-57.6c-3.02-4.03-7.77-6.4-12.8-6.4H16.01C5.6 128-2.04 137.78.49 147.88L32 256 .49 364.12C-2.04 374.22 5.6 384 16.01 384H56c5.04 0 9.78-2.37 12.8-6.4L112 320h102.86l-49.03 171.6c-2.92 10.22 4.75 20.4 15.38 20.4h65.5c5.74 0 11.04-3.08 13.89-8.06L365.71 320H480c35.35 0 96-28.65 96-64s-60.65-64-96-64z'; exports.definition = { prefix: prefix, iconName: iconName, icon: [ width, height, ligatures, unicode, svgPathData ]}; exports.faPlane = exports.definition; exports.prefix = prefix; exports.iconName = iconName; exports.width = width; exports.height = height; exports.ligatures = ligatures; exports.unicode = unicode; exports.svgPathData = svgPathData;
{ "pile_set_name": "Github" }
// DATA_TEMPLATE: dom_data oTest.fnStart( "aoColumns.bVisible" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable(); var oSettings = oTable.fnSettings(); oTest.fnTest( "All columns are visible by default", null, function () { return $('#example tbody tr:eq(0) td').length == 5; } ); oTest.fnTest( "Can hide one column and it removes td column from DOM", function () { oSession.fnRestore(); $('#example').dataTable( { "aoColumns": [ null, { "bVisible": false }, null, null, null ] } ); }, function () { return $('#example tbody tr:eq(0) td').length == 4; } ); oTest.fnTest( "Can hide one column and it removes thead th column from DOM", null, function () { return $('#example thead tr:eq(0) th').length == 4; } ); oTest.fnTest( "Can hide one column and it removes tfoot th column from DOM", null, function () { return $('#example tfoot tr:eq(0) th').length == 4; } ); oTest.fnTest( "The correct thead column has been hidden", null, function () { var jqNodes = $('#example thead tr:eq(0) th'); var bReturn = jqNodes[0].innerHTML == "Rendering engine" && jqNodes[1].innerHTML == "Platform(s)" && jqNodes[2].innerHTML == "Engine version" && jqNodes[3].innerHTML == "CSS grade"; return bReturn; } ); oTest.fnTest( "The correct tbody column has been hidden", function () { oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); }, function () { var jqNodes = $('#example tbody tr:eq(0) td'); var bReturn = jqNodes[0].innerHTML == "Gecko" && jqNodes[1].innerHTML == "Gnome" && jqNodes[2].innerHTML == "1.8" && jqNodes[3].innerHTML == "A"; return bReturn; } ); oTest.fnTest( "Can hide multiple columns and it removes td column from DOM", function () { oSession.fnRestore(); $('#example').dataTable( { "aoColumns": [ null, { "bVisible": false }, { "bVisible": false }, null, { "bVisible": false } ] } ); }, function () { return $('#example tbody tr:eq(0) td').length == 2; } ); oTest.fnTest( "Multiple hide - removes thead th column from DOM", null, function () { return $('#example thead tr:eq(0) th').length == 2; } ); oTest.fnTest( "Multiple hide - removes tfoot th column from DOM", null, function () { return $('#example tfoot tr:eq(0) th').length == 2; } ); oTest.fnTest( "Multiple hide - the correct thead columns have been hidden", null, function () { var jqNodes = $('#example thead tr:eq(0) th'); var bReturn = jqNodes[0].innerHTML == "Rendering engine" && jqNodes[1].innerHTML == "Engine version" return bReturn; } ); oTest.fnTest( "Multiple hide - the correct tbody columns have been hidden", function () { oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); }, function () { var jqNodes = $('#example tbody tr:eq(0) td'); var bReturn = jqNodes[0].innerHTML == "Gecko" && jqNodes[1].innerHTML == "1" return bReturn; } ); oTest.fnComplete(); } );
{ "pile_set_name": "Github" }
all: patch revert: @bash run.sh $@
{ "pile_set_name": "Github" }
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # Copyright 2016 Mercurial Contributors # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import cffi ffi = cffi.FFI() ffi.set_source( "mercurial.cffi._osutil", """ #include <sys/attr.h> #include <sys/vnode.h> #include <unistd.h> #include <fcntl.h> #include <time.h> typedef struct val_attrs { uint32_t length; attribute_set_t returned; attrreference_t name_info; fsobj_type_t obj_type; struct timespec mtime; uint32_t accessmask; off_t datalength; } __attribute__((aligned(4), packed)) val_attrs_t; """, include_dirs=["mercurial"], ) ffi.cdef( """ typedef uint32_t attrgroup_t; typedef struct attrlist { uint16_t bitmapcount; /* number of attr. bit sets in list */ uint16_t reserved; /* (to maintain 4-byte alignment) */ attrgroup_t commonattr; /* common attribute group */ attrgroup_t volattr; /* volume attribute group */ attrgroup_t dirattr; /* directory attribute group */ attrgroup_t fileattr; /* file attribute group */ attrgroup_t forkattr; /* fork attribute group */ ...; }; typedef struct attribute_set { ...; } attribute_set_t; typedef struct attrreference { int attr_dataoffset; int attr_length; ...; } attrreference_t; typedef int ... off_t; typedef struct val_attrs { uint32_t length; attribute_set_t returned; attrreference_t name_info; uint32_t obj_type; struct timespec mtime; uint32_t accessmask; off_t datalength; ...; } val_attrs_t; /* the exact layout of the above struct will be figured out during build time */ typedef int ... time_t; typedef struct timespec { time_t tv_sec; ...; }; int getattrlist(const char* path, struct attrlist * attrList, void * attrBuf, size_t attrBufSize, unsigned int options); int getattrlistbulk(int dirfd, struct attrlist * attrList, void * attrBuf, size_t attrBufSize, uint64_t options); #define ATTR_BIT_MAP_COUNT ... #define ATTR_CMN_NAME ... #define ATTR_CMN_OBJTYPE ... #define ATTR_CMN_MODTIME ... #define ATTR_CMN_ACCESSMASK ... #define ATTR_CMN_ERROR ... #define ATTR_CMN_RETURNED_ATTRS ... #define ATTR_FILE_DATALENGTH ... #define VREG ... #define VDIR ... #define VLNK ... #define VBLK ... #define VCHR ... #define VFIFO ... #define VSOCK ... #define S_IFMT ... int open(const char *path, int oflag, int perm); int close(int); #define O_RDONLY ... """ ) if __name__ == "__main__": ffi.compile()
{ "pile_set_name": "Github" }
.TH std::make_error_code(std::errc) 3 "2019.08.27" "http://cppreference.com" "C++ Standard Libary" .SH NAME std::make_error_code(std::errc) \- std::make_error_code(std::errc) .SH Synopsis Defined in header <system_error> std::error_code make_error_code( std::errc e ) noexcept; \fI(since C++11)\fP Creates error code value for errc enum e. Equivalent to std::error_code(static_cast<int>(e), std::generic_category()) .SH Parameters e - error code enum to create error code for .SH Return value Error code corresponding to e.
{ "pile_set_name": "Github" }
<?php namespace Oro\Bundle\PricingBundle\Tests\Unit\Form\Extension; use Doctrine\Common\Persistence\ManagerRegistry; use Doctrine\ORM\EntityManager; use Doctrine\ORM\QueryBuilder; use Oro\Bundle\SecurityBundle\ORM\Walker\AclHelper; use Oro\Bundle\WebsiteBundle\Entity\Repository\WebsiteRepository; use Oro\Bundle\WebsiteBundle\Entity\Website; use Oro\Bundle\WebsiteBundle\Form\Type\WebsiteScopedDataType; use Oro\Component\Testing\Unit\EntityTrait; class WebsiteScopedTypeMockProvider extends \PHPUnit\Framework\TestCase { use EntityTrait; /** * @return WebsiteScopedDataType */ public function getWebsiteScopedDataType() { $websites = [1 => $this->getEntity(Website::class, ['id' => 1])]; $em = $this->createMock(EntityManager::class); $em->expects($this->any()) ->method('getReference') ->with(Website::class, 1) ->willReturn($this->getEntity(Website::class, ['id' => 1])); $websiteQB = $this->getMockBuilder(QueryBuilder::class) ->disableOriginalConstructor() ->setMethods(['getResult']) ->getMock(); $websiteQB ->expects($this->any()) ->method('getResult') ->willReturn($websites); $websiteRepository = $this->createMock(WebsiteRepository::class); $websiteRepository->expects($this->any()) ->method('createQueryBuilder') ->with('website') ->willReturn($websiteQB); /** @var ManagerRegistry|\PHPUnit\Framework\MockObject\MockObject $registry*/ $registry = $this->createMock(ManagerRegistry::class); $registry->expects($this->any()) ->method('getRepository') ->with(Website::class) ->willReturn($websiteRepository); $registry->expects($this->any()) ->method('getManagerForClass') ->with(Website::class) ->willReturn($em); $aclHelper = $this->createMock(AclHelper::class); $aclHelper->expects($this->any()) ->method('apply') ->willReturn($websiteQB); return new WebsiteScopedDataType($registry, $aclHelper); } }
{ "pile_set_name": "Github" }
/* =========================================================================== Return to Castle Wolfenstein single player GPL Source Code Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company. This file is part of the Return to Castle Wolfenstein single player GPL Source Code (“RTCW SP Source Code”). RTCW SP Source Code is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. RTCW SP Source Code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with RTCW SP Source Code. If not, see <http://www.gnu.org/licenses/>. In addition, the RTCW SP Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the RTCW SP Source Code. If not, please request a copy in writing from id Software at the address below. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. =========================================================================== */ /***************************************************************************** * name: be_aas_reach.h * * desc: AAS * * *****************************************************************************/ #ifdef AASINTERN //initialize calculating the reachabilities void AAS_InitReachability( void ); //continue calculating the reachabilities int AAS_ContinueInitReachability( float time ); // int AAS_BestReachableLinkArea( aas_link_t *areas ); #endif //AASINTERN //returns true if the are has reachabilities to other areas int AAS_AreaReachability( int areanum ); //returns the best reachable area and goal origin for a bounding box at the given origin int AAS_BestReachableArea( vec3_t origin, vec3_t mins, vec3_t maxs, vec3_t goalorigin ); //returns the next reachability using the given model int AAS_NextModelReachability( int num, int modelnum ); //returns the total area of the ground faces of the given area float AAS_AreaGroundFaceArea( int areanum ); //returns true if the area is crouch only int AAS_AreaCrouch( int areanum ); //returns true if a player can swim in this area int AAS_AreaSwim( int areanum ); //returns true if the area is filled with a liquid int AAS_AreaLiquid( int areanum ); //returns true if the area contains lava int AAS_AreaLava( int areanum ); //returns true if the area contains slime int AAS_AreaSlime( int areanum ); //returns true if the area has one or more ground faces int AAS_AreaGrounded( int areanum ); //returns true if the area has one or more ladder faces int AAS_AreaLadder( int areanum ); //returns true if the area is a jump pad int AAS_AreaJumpPad( int areanum ); //returns true if the area is donotenter int AAS_AreaDoNotEnter( int areanum ); //returns true if the area is donotenterlarge int AAS_AreaDoNotEnterLarge( int areanum );
{ "pile_set_name": "Github" }
/* error : variable not array */ let var d:=0 in d[3] end
{ "pile_set_name": "Github" }
<?php // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK IT ] // +---------------------------------------------------------------------- // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: liu21st <liu21st@gmail.com> // +---------------------------------------------------------------------- namespace think\debug; use think\Container; use think\Db; use think\Response; /** * 页面Trace调试 */ class Html { protected $config = [ 'file' => '', 'tabs' => ['base' => '基本', 'file' => '文件', 'info' => '流程', 'notice|error' => '错误', 'sql' => 'SQL', 'debug|log' => '调试'], ]; // 实例化并传入参数 public function __construct(array $config = []) { $this->config = array_merge($this->config, $config); } /** * 调试输出接口 * @access public * @param Response $response Response对象 * @param array $log 日志信息 * @return bool */ public function output(Response $response, array $log = []) { $request = Container::get('request'); $contentType = $response->getHeader('Content-Type'); $accept = $request->header('accept'); if (strpos($accept, 'application/json') === 0 || $request->isAjax()) { return false; } elseif (!empty($contentType) && strpos($contentType, 'html') === false) { return false; } // 获取基本信息 $runtime = number_format(microtime(true) - Container::get('app')->getBeginTime(), 10, '.', ''); $reqs = $runtime > 0 ? number_format(1 / $runtime, 2) : '∞'; $mem = number_format((memory_get_usage() - Container::get('app')->getBeginMem()) / 1024, 2); // 页面Trace信息 if ($request->host()) { $uri = $request->protocol() . ' ' . $request->method() . ' : ' . $request->url(true); } else { $uri = 'cmd:' . implode(' ', $_SERVER['argv']); } $base = [ '请求信息' => date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']) . ' ' . $uri, '运行时间' => number_format($runtime, 6) . 's [ 吞吐率:' . $reqs . 'req/s ] 内存消耗:' . $mem . 'kb 文件加载:' . count(get_included_files()), '查询信息' => Db::$queryTimes . ' queries ' . Db::$executeTimes . ' writes ', '缓存信息' => Container::get('cache')->getReadTimes() . ' reads,' . Container::get('cache')->getWriteTimes() . ' writes', ]; if (session_id()) { $base['会话信息'] = 'SESSION_ID=' . session_id(); } $info = Container::get('debug')->getFile(true); // 页面Trace信息 $trace = []; foreach ($this->config['tabs'] as $name => $title) { $name = strtolower($name); switch ($name) { case 'base': // 基本信息 $trace[$title] = $base; break; case 'file': // 文件信息 $trace[$title] = $info; break; default: // 调试信息 if (strpos($name, '|')) { // 多组信息 $names = explode('|', $name); $result = []; foreach ($names as $name) { $result = array_merge($result, isset($log[$name]) ? $log[$name] : []); } $trace[$title] = $result; } else { $trace[$title] = isset($log[$name]) ? $log[$name] : ''; } } } // 调用Trace页面模板 ob_start(); include $this->config['file']; return ob_get_clean(); } }
{ "pile_set_name": "Github" }
<?xml version="1.0" encoding="utf-8"?> <!-- /* * Copyright (C) 2016 Johnny Shieh Open Source Project * * 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. */--> <resources> <!-- nav header--> <string name="nav_header_title">干货集中营</string> <string name="nav_today">今天</string> <string name="nav_welfare">福利</string> <string name="nav_android">安卓</string> <string name="nav_ios">苹果</string> <string name="nav_front_end">前端</string> <string name="nav_extra">拓展资源</string> <string name="nav_casual">瞎推荐</string> <string name="nav_video">休息视频</string> <string name="nav_app">App</string> <string name="nav_all">全部</string> <string name="nav_contact_title">联系</string> <string name="nav_about">关于</string> <string name="nav_feedback">反馈</string> <!-- about page --> <string name="about_introduction">简介</string> <string name="about_developer">开发者</string> <string name="open_source_library">开源库</string> </resources>
{ "pile_set_name": "Github" }
### 0.13.0 - April 16, 2015 This release adds a minimal Windows compatibility layer. The parser, standalone since v0.12.0, can now be compiled on Windows (and thus used in other client libraries as well) * Windows compatibility layer for parser code (tzickel) * Properly escape data printed to PKGCONF file (Dan Skorupski) * Fix tests when assert() undefined (Keith Bennett, Matt Stancliff) * Implement a reconnect method for the client context, this changes the structure of `redisContext` (Aaron Bedra) ### 0.12.1 - January 26, 2015 * Fix `make install`: DESTDIR support, install all required files, install PKGCONF in proper location * Fix `make test` as 32 bit build on 64 bit platform ### 0.12.0 - January 22, 2015 * Add optional KeepAlive support * Try again on EINTR errors * Add libuv adapter * Add IPv6 support * Remove possiblity of multiple close on same fd * Add ability to bind source address on connect * Add redisConnectFd() and redisFreeKeepFd() * Fix getaddrinfo() memory leak * Free string if it is unused (fixes memory leak) * Improve redisAppendCommandArgv performance 2.5x * Add support for SO_REUSEADDR * Fix redisvFormatCommand format parsing * Add GLib 2.0 adapter * Refactor reading code into read.c * Fix errno error buffers to not clobber errors * Generate pkgconf during build * Silence _BSD_SOURCE warnings * Improve digit counting for multibulk creation ### 0.11.0 * Increase the maximum multi-bulk reply depth to 7. * Increase the read buffer size from 2k to 16k. * Use poll(2) instead of select(2) to support large fds (>= 1024). ### 0.10.1 * Makefile overhaul. Important to check out if you override one or more variables using environment variables or via arguments to the "make" tool. * Issue #45: Fix potential memory leak for a multi bulk reply with 0 elements being created by the default reply object functions. * Issue #43: Don't crash in an asynchronous context when Redis returns an error reply after the connection has been made (this happens when the maximum number of connections is reached). ### 0.10.0 * See commit log.
{ "pile_set_name": "Github" }
Docker Copyright 2012-2017 Docker, Inc. This product includes software developed at Docker, Inc. (https://www.docker.com). This product contains software (https://github.com/creack/pty) developed by Keith Rarick, licensed under the MIT License. The following is courtesy of our legal counsel: Use and transfer of Docker may be subject to certain restrictions by the United States and other governments. It is your responsibility to ensure that your use and/or transfer does not violate applicable laws. For more information, please see https://www.bis.doc.gov See also https://www.apache.org/dev/crypto.html and/or seek legal counsel.
{ "pile_set_name": "Github" }
-- wal.test -- -- execsql { -- COMMIT; -- SELECT * FROM t1; -- } COMMIT; SELECT * FROM t1;
{ "pile_set_name": "Github" }
{ "_from": "express", "_id": "express@4.16.3", "_inBundle": false, "_integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=", "_location": "/express", "_phantomChildren": {}, "_requested": { "type": "tag", "registry": true, "raw": "express", "name": "express", "escapedName": "express", "rawSpec": "", "saveSpec": null, "fetchSpec": "latest" }, "_requiredBy": [ "#USER", "/" ], "_resolved": "http://registry.npmjs.org/express/-/express-4.16.3.tgz", "_shasum": "6af8a502350db3246ecc4becf6b5a34d22f7ed53", "_spec": "express", "_where": "F:\\git\\node.js\\4-1Express\\Express的CRUD", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, "bugs": { "url": "https://github.com/expressjs/express/issues" }, "bundleDependencies": false, "contributors": [ { "name": "Aaron Heckmann", "email": "aaron.heckmann+github@gmail.com" }, { "name": "Ciaran Jessup", "email": "ciaranj@gmail.com" }, { "name": "Douglas Christopher Wilson", "email": "doug@somethingdoug.com" }, { "name": "Guillermo Rauch", "email": "rauchg@gmail.com" }, { "name": "Jonathan Ong", "email": "me@jongleberry.com" }, { "name": "Roman Shtylman", "email": "shtylman+expressjs@gmail.com" }, { "name": "Young Jae Sim", "email": "hanul@hanul.me" } ], "dependencies": { "accepts": "~1.3.5", "array-flatten": "1.1.1", "body-parser": "1.18.2", "content-disposition": "0.5.2", "content-type": "~1.0.4", "cookie": "0.3.1", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.1.1", "fresh": "0.5.2", "merge-descriptors": "1.0.1", "methods": "~1.1.2", "on-finished": "~2.3.0", "parseurl": "~1.3.2", "path-to-regexp": "0.1.7", "proxy-addr": "~2.0.3", "qs": "6.5.1", "range-parser": "~1.2.0", "safe-buffer": "5.1.1", "send": "0.16.2", "serve-static": "1.13.2", "setprototypeof": "1.1.0", "statuses": "~1.4.0", "type-is": "~1.6.16", "utils-merge": "1.0.1", "vary": "~1.1.2" }, "deprecated": false, "description": "Fast, unopinionated, minimalist web framework", "devDependencies": { "after": "0.8.2", "connect-redis": "~2.4.1", "cookie-parser": "~1.4.3", "cookie-session": "1.3.2", "ejs": "2.5.7", "eslint": "2.13.1", "express-session": "1.15.6", "hbs": "4.0.1", "istanbul": "0.4.5", "marked": "0.3.17", "method-override": "2.3.10", "mocha": "3.5.3", "morgan": "1.9.0", "multiparty": "4.1.3", "pbkdf2-password": "1.2.1", "should": "13.2.1", "supertest": "1.2.0", "vhost": "~3.0.2" }, "engines": { "node": ">= 0.10.0" }, "files": [ "LICENSE", "History.md", "Readme.md", "index.js", "lib/" ], "homepage": "http://expressjs.com/", "keywords": [ "express", "framework", "sinatra", "web", "rest", "restful", "router", "app", "api" ], "license": "MIT", "name": "express", "repository": { "type": "git", "url": "git+https://github.com/expressjs/express.git" }, "scripts": { "lint": "eslint .", "test": "mocha --require test/support/env --reporter spec --bail --check-leaks --no-exit test/ test/acceptance/", "test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --require test/support/env --reporter spec --check-leaks --no-exit test/ test/acceptance/", "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --require test/support/env --reporter dot --check-leaks --no-exit test/ test/acceptance/", "test-tap": "mocha --require test/support/env --reporter tap --check-leaks --no-exit test/ test/acceptance/" }, "version": "4.16.3" }
{ "pile_set_name": "Github" }
package alicloud import ( "fmt" "log" "testing" "strings" "time" "github.com/alibaba/terraform-provider/alicloud/connectivity" "github.com/denverdino/aliyungo/ram" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) func init() { resource.AddTestSweepers("alicloud_ram_policy", &resource.Sweeper{ Name: "alicloud_ram_policy", F: testSweepRamPolicies, }) } func testSweepRamPolicies(region string) error { rawClient, err := sharedClientForRegion(region) if err != nil { return fmt.Errorf("error getting Alicloud client: %s", err) } client := rawClient.(*connectivity.AliyunClient) prefixes := []string{ "tf-testAcc", "tf_testAcc", "tf_test_", "tf-test-", "tftest", } args := ram.PolicyQueryRequest{} raw, err := client.WithRamClient(func(ramClient ram.RamClientInterface) (interface{}, error) { return ramClient.ListPolicies(args) }) if err != nil { return fmt.Errorf("Error retrieving Ram policies: %s", err) } resp, _ := raw.(ram.PolicyQueryResponse) sweeped := false for _, v := range resp.Policies.Policy { name := v.PolicyName skip := true for _, prefix := range prefixes { if strings.HasPrefix(strings.ToLower(name), strings.ToLower(prefix)) { skip = false break } } if skip { log.Printf("[INFO] Skipping Ram policy: %s", name) continue } sweeped = true log.Printf("[INFO] Deleting Ram Policy: %s", name) req := ram.PolicyRequest{ PolicyName: name, } _, err := client.WithRamClient(func(ramClient ram.RamClientInterface) (interface{}, error) { return ramClient.DeletePolicy(req) }) if err != nil { log.Printf("[ERROR] Failed to delete Ram Policy (%s): %s", name, err) } } if sweeped { time.Sleep(5 * time.Second) } return nil } func TestAccAlicloudRamPolicy_basic(t *testing.T) { var v ram.Policy resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, // module name IDRefreshName: "alicloud_ram_policy.policy", Providers: testAccProviders, CheckDestroy: testAccCheckRamPolicyDestroy, Steps: []resource.TestStep{ resource.TestStep{ Config: testAccRamPolicyConfig, Check: resource.ComposeTestCheckFunc( testAccCheckRamPolicyExists( "alicloud_ram_policy.policy", &v), resource.TestCheckResourceAttr( "alicloud_ram_policy.policy", "name", "tf-testAccRamPolicyConfig"), resource.TestCheckResourceAttr( "alicloud_ram_policy.policy", "description", "this is a policy test"), ), }, }, }) } func testAccCheckRamPolicyExists(n string, policy *ram.Policy) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { return fmt.Errorf("Not found: %s", n) } if rs.Primary.ID == "" { return fmt.Errorf("No Policy ID is set") } client := testAccProvider.Meta().(*connectivity.AliyunClient) request := ram.PolicyRequest{ PolicyName: rs.Primary.ID, PolicyType: ram.Custom, } raw, err := client.WithRamClient(func(ramClient ram.RamClientInterface) (interface{}, error) { return ramClient.GetPolicy(request) }) log.Printf("[WARN] Policy id %#v", rs.Primary.ID) if err == nil { response, _ := raw.(ram.PolicyResponse) *policy = response.Policy return nil } return fmt.Errorf("Error finding policy %#v", rs.Primary.ID) } } func testAccCheckRamPolicyDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "alicloud_ram_policy" { continue } // Try to find the policy client := testAccProvider.Meta().(*connectivity.AliyunClient) request := ram.PolicyRequest{ PolicyName: rs.Primary.ID, PolicyType: ram.Custom, } _, err := client.WithRamClient(func(ramClient ram.RamClientInterface) (interface{}, error) { return ramClient.GetPolicy(request) }) if err != nil && !RamEntityNotExist(err) { return err } } return nil } const testAccRamPolicyConfig = ` resource "alicloud_ram_policy" "policy" { name = "tf-testAccRamPolicyConfig" statement = [ { effect = "Deny" action = [ "oss:ListObjects", "oss:ListObjects"] resource = [ "acs:oss:*:*:mybucket", "acs:oss:*:*:mybucket/*"] }] description = "this is a policy test" force = true }`
{ "pile_set_name": "Github" }
/* * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.test.context.junit4.statements; import java.lang.annotation.Annotation; import java.lang.reflect.Method; import org.junit.AssumptionViolatedException; import org.junit.runners.model.Statement; import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.lang.Nullable; import org.springframework.test.annotation.IfProfileValue; import org.springframework.test.annotation.ProfileValueUtils; import org.springframework.util.Assert; /** * {@code ProfileValueChecker} is a custom JUnit {@link Statement} that checks * whether a test class or test method is enabled in the current environment * via Spring's {@link IfProfileValue @IfProfileValue} annotation. * * @author Sam Brannen * @author Philippe Marschall * @since 4.2 * @see #evaluate() * @see IfProfileValue * @see ProfileValueUtils */ public class ProfileValueChecker extends Statement { private final Statement next; private final Class<?> testClass; @Nullable private final Method testMethod; /** * Construct a new {@code ProfileValueChecker} statement. * @param next the next {@code Statement} in the execution chain; * never {@code null} * @param testClass the test class to check; never {@code null} * @param testMethod the test method to check; may be {@code null} if * this {@code ProfileValueChecker} is being applied at the class level */ public ProfileValueChecker(Statement next, Class<?> testClass, @Nullable Method testMethod) { Assert.notNull(next, "The next statement must not be null"); Assert.notNull(testClass, "The test class must not be null"); this.next = next; this.testClass = testClass; this.testMethod = testMethod; } /** * Determine if the test specified by arguments to the * {@linkplain #ProfileValueChecker constructor} is <em>enabled</em> in * the current environment, as configured via the {@link IfProfileValue * &#064;IfProfileValue} annotation. * <p>If the test is not annotated with {@code @IfProfileValue} it is * considered enabled. * <p>If a test is not enabled, this method will abort further evaluation * of the execution chain with a failed assumption; otherwise, this method * will simply evaluate the next {@link Statement} in the execution chain. * @see ProfileValueUtils#isTestEnabledInThisEnvironment(Class) * @see ProfileValueUtils#isTestEnabledInThisEnvironment(Method, Class) * @throws AssumptionViolatedException if the test is disabled * @throws Throwable if evaluation of the next statement fails */ @Override public void evaluate() throws Throwable { if (this.testMethod == null) { if (!ProfileValueUtils.isTestEnabledInThisEnvironment(this.testClass)) { Annotation ann = AnnotatedElementUtils.findMergedAnnotation(this.testClass, IfProfileValue.class); throw new AssumptionViolatedException(String.format( "Profile configured via [%s] is not enabled in this environment for test class [%s].", ann, this.testClass.getName())); } } else { if (!ProfileValueUtils.isTestEnabledInThisEnvironment(this.testMethod, this.testClass)) { throw new AssumptionViolatedException(String.format( "Profile configured via @IfProfileValue is not enabled in this environment for test method [%s].", this.testMethod)); } } this.next.evaluate(); } }
{ "pile_set_name": "Github" }
2.11 OBSERVATION DATA M RINEX VERSION / TYPE BNC 2.12.1 rtproc 18-Jun-16 00:59 PGM / RUN BY / DATE PORTIONS OF THIS HEADER GENERATED BY BKG COMMENT RTCM_3 www.igs-ip.net/NKLG0 COMMENT NKLG MARKER NAME 32809M002 MARKER NUMBER CNES OBSERVER / AGENCY 5038K70406 TRIMBLE NETR9 5.10 REC # / TYPE / VERS 4811A48439 TRM59800.00 SCIS ANT # / TYPE 6287385.7333 1071574.6758 39133.0395 APPROX POSITION XYZ 3.0430 -0.0025 -0.0015 ANTENNA: DELTA H/E/N 1 1 WAVELENGTH FACT L1/2 22 C2 L2 D2 S2 C6 L6 S6 C7 L7# / TYPES OF OBSERV S7 C1 L1 D1 S1 C8 L8 S8 C5# / TYPES OF OBSERV L5 S5 P2 P1 # / TYPES OF OBSERV 2016 6 18 1 0 0.0000000 GPS TIME OF FIRST OBS END OF HEADER 16 06 18 01 00 0.0000000 0 20G03G06G07G23G11G17G01G19G28G30G22G09 R22R07R23R08R21R11R09R10 94445620.204 26.000 23064576.248 121205201.215 41.750 23064583.288 94121567.922 26.000 22985441.228 120789342.591 40.000 22985448.728 83090162.434 43.250 20291463.586 106632370.081 49.250 20291467.686 98675140.303 19.750 24097476.200 126633097.095 36.000 24097479.700 98322718.327 19.000 24011405.620 126180813.368 38.750 24011408.420 91759388.157 32.000 22408569.992 117757869.710 45.500 22408574.472 90848030.882 34.000 22186011.712 116588298.574 46.000 22186019.752 96946543.289 24.500 23675330.004 124414735.287 35.250 23675333.284 96786326.776 18.500 23636209.884 124209122.870 36.500 23636214.264 86272780.698 39.500 21068691.720 110716734.089 48.000 21068698.080 97097543.520 20.750 23712205.082 124608505.818 39.250 23712206.882 92690063.796 29.000 22635859.210 118952248.000 41.500 22635866.490 20368262.068 108727190.831 50.250 20368265.068 23472127.244 125648144.052 37.750 23472130.124 23065011.168 123382274.456 40.750 23065014.728 23952897.584 128266675.189 36.250 23952899.784 21702370.356 116133785.177 45.500 21702373.456 21644034.476 115659148.794 43.750 22150591.096 118116812.949 42.500 22150593.736 19876830.588 105954704.281 52.000 19876836.668 16 06 18 01 00 1.0000000 0 20G03G06G07G23G11G17G01G19G28G30G22G09 R22R07R23R08R21R11R09R10 94445246.448 27.250 23064485.008 121204721.562 41.500 23064491.888 94119097.339 26.500 22984837.808 120786172.010 39.250 22984845.348 83090019.748 43.000 20291428.566 106632186.962 48.500 20291433.146 98676610.407 20.250 24097836.120 126634983.718 36.250 24097838.640 98325203.085 19.250 24012012.480 126184002.139 38.750 24012015.380 91759677.430 31.500 22408641.252 117758240.947 45.500 22408645.172 90849998.757 33.250 22186492.432 116590824.013 45.750 22186500.392 96946359.073 25.500 23675285.364 124414498.873 36.000 23675288.084 96785091.058 19.250 23635908.244 124207537.019 36.500 23635912.484 86271132.956 39.250 21068289.440 110714619.497 47.750 21068295.900 97097707.203 19.750 23712245.302 124608715.885 40.000 23712247.122 92691465.597 29.250 22636202.210 118954046.985 41.000 22636208.430 20368421.788 108728045.162 50.250 20368424.468 23472043.564 125647698.141 37.750 23472046.964 23064581.988 123379982.647 40.500 23064586.108 23952851.044 128266429.482 36.500 23952854.304 21703016.876 116137241.393 45.000 21703018.656 21643331.696 115655395.889 44.000 22151034.816 118119181.024 42.750 22151037.516 19876658.668 105953784.522 51.750 19876664.188 16 06 18 01 00 2.0000000 0 20G03G06G07G23G11G17G01G19G28G30G22G09 R22R07R23R08R21R11R09R10 94444872.827 24.750 23064393.568 121204242.074 41.750 23064400.648 94116626.935 26.500 22984234.448 120783001.647 39.500 22984241.928 83089877.497 43.500 20291394.166 106632004.410 47.750 20291398.026 98678080.325 19.500 24098195.180 126636870.097 36.000 24098197.920 98327687.889 19.250 24012618.300 126187190.953 38.750 24012622.000 91759966.904 31.500 22408711.732 117758612.441 45.750 22408715.832 90851966.942 33.750 22186973.112 116593349.846 45.500 22186981.112 96946175.129 25.000 23675240.444 124414262.820 35.750 23675243.104 96783855.145 20.000 23635606.744 124205950.936 36.250 23635610.644 86269485.564 39.500 21067887.620 110712505.333 47.500 21067893.580 97097871.088 20.250 23712285.682 124608926.215 40.000 23712286.982 92692867.377 27.250 22636545.430 118955845.928 41.500 22636551.010 20368582.608 108728900.091 50.000 20368584.868 23471960.484 125647251.844 37.500 23471963.704 23064153.728 123377691.461 40.500 23064158.108 23952804.704 128266183.368 36.750 23952808.304 21703661.616 116140697.686 45.500 21703664.896 21642628.656 115651643.187 43.750 22151479.456 118121549.662 43.000 22151482.116 19876486.348 105952865.472 51.750 19876491.268 16 06 18 01 00 3.0000000 0 20G03G06G07G23G11G17G01G19G28G30G22G09 R22R07R23R08R21R11R09R10 94444499.284 25.500 23064302.828 121203762.699 42.000 23064309.208 94114156.731 24.750 22983630.488 120779831.552 39.750 22983638.768 83089735.712 43.250 20291359.866 106631822.454 48.250 20291363.566 98679550.116 19.750 24098554.800 126638756.321 36.250 24098556.700 98330172.675 19.250 24013226.100 126190379.784 39.000 24013228.500 91760256.620 31.250 22408781.972 117758984.248 45.500 22408786.612 90853935.414 33.750 22187454.152 116595876.059 45.500 22187461.792 96945991.451 24.750 23675195.824 124414027.092 36.000 23675198.244 96782619.081 19.500 23635303.964 124204364.643 36.000 23635308.764 86267838.513 39.750 21067484.920 110710391.624 47.750 21067491.240 97098035.139 19.750 23712325.002 124609136.753 40.500 23712326.662 92694269.081 28.750 22636886.870 118957644.777 41.500 22636893.270 20368743.008 108729755.668 49.750 20368745.108 23471876.984 125646805.189 37.250 23471880.024 23063725.408 123375400.848 40.000 23063730.188 23952759.164 128265936.990 37.000 23952762.084 21704308.456 116144154.073 45.750 21704311.076 21641927.316 115647890.643 43.500 22151923.736 118123918.925 43.000 22151926.716 19876313.748 105951947.176 51.750 19876319.468 16 06 18 01 00 4.0000000 0 20G03G06G07G23G11G17G01G19G28G30G22G09 R22R07R23R08R21R11R09R10 94444125.813 26.000 23064211.588 121203283.400 42.000 23064218.248 94111686.701 25.500 22983027.728 120776661.688 39.500 22983035.608 83089594.376 43.000 20291324.806 106631641.066 48.500 20291328.946 98681019.727 19.250 24098912.820 126640642.298 36.250 24098915.540 98332657.469 19.250 24013833.200 126193568.598 39.000 24013835.660 91760546.528 31.000 22408853.232 117759356.294 46.250 22408857.452 90855904.206 33.500 22187934.852 116598402.670 45.500 22187942.372 96945808.032 22.750 23675151.144 124413791.695 36.500 23675153.664 96781382.832 18.250 23635002.804 124202778.140 36.000 23635006.704 86266191.795 39.500 21067082.760 110708278.335 47.750 21067089.100 97098199.375 21.250 23712365.862 124609347.501 40.000 23712367.022 92695670.732 28.250 22637229.350 118959443.562 41.000 22637235.450 20368903.088 108730611.854 49.750 20368905.388 23471791.984 125646358.247 37.500 23471796.664 23063297.228 123373110.807 40.000 23063301.588 23952713.004 128265690.239 37.000 23952715.844 21704955.076 116147610.556 45.250 21704957.016 21641223.896 115644138.216 42.750 22152368.556 118126288.752 42.500 22152370.936 19876141.708 105951029.562 51.750 19876147.108
{ "pile_set_name": "Github" }
package sign import ( "crypto/rsa" "crypto/x509" "encoding/pem" "fmt" "io" "io/ioutil" "os" ) // LoadPEMPrivKeyFile reads a PEM encoded RSA private key from the file name. // A new RSA private key will be returned if no error. func LoadPEMPrivKeyFile(name string) (*rsa.PrivateKey, error) { file, err := os.Open(name) if err != nil { return nil, err } defer file.Close() return LoadPEMPrivKey(file) } // LoadPEMPrivKey reads a PEM encoded RSA private key from the io.Reader. // A new RSA private key will be returned if no error. func LoadPEMPrivKey(reader io.Reader) (*rsa.PrivateKey, error) { block, err := loadPem(reader) if err != nil { return nil, err } return x509.ParsePKCS1PrivateKey(block.Bytes) } // LoadEncryptedPEMPrivKey decrypts the PEM encoded private key using the // password provided returning a RSA private key. If the PEM data is invalid, // or unable to decrypt an error will be returned. func LoadEncryptedPEMPrivKey(reader io.Reader, password []byte) (*rsa.PrivateKey, error) { block, err := loadPem(reader) if err != nil { return nil, err } decryptedBlock, err := x509.DecryptPEMBlock(block, password) if err != nil { return nil, err } return x509.ParsePKCS1PrivateKey(decryptedBlock) } func loadPem(reader io.Reader) (*pem.Block, error) { b, err := ioutil.ReadAll(reader) if err != nil { return nil, err } block, _ := pem.Decode(b) if block == nil { // pem.Decode will set block to nil if there is no PEM data in the input // the second parameter will contain the provided bytes that failed // to be decoded. return nil, fmt.Errorf("no valid PEM data provided") } return block, nil }
{ "pile_set_name": "Github" }
<?php /** * Template hints * * @author Alexander Menk */ class Aoe_TemplateHints_Model_Renderer_TipOnly extends Aoe_TemplateHints_Model_Renderer_Opentip { /** * Just remove the border * * @return string */ protected function getHintClass() { return 'tpl-hint'; } }
{ "pile_set_name": "Github" }
# SOME DESCRIPTIVE TITLE. # Copyright (C) 2020 Nextcloud GmbH # This file is distributed under the same license as the Nextcloud latest User Manual package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # # Translators: # Kurt Seiler <kurt@seiler.onl>, 2020 # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Nextcloud latest User Manual latest\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-07-27 14:38+0200\n" "PO-Revision-Date: 2019-11-07 20:28+0000\n" "Last-Translator: Kurt Seiler <kurt@seiler.onl>, 2020\n" "Language-Team: German (https://www.transifex.com/nextcloud/teams/64236/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../../contents.rst:5 msgid "Table of contents" msgstr "Inhaltsverzeichnis"
{ "pile_set_name": "Github" }
.. bpo: 2236 .. date: 8293 .. nonce: 1Mj4VJ .. release date: 2010-11-27 .. section: Library distutils' mkpath ignored the mode parameter. .. .. bpo: 0 .. date: 8292 .. nonce: NFeWRc .. section: Library Fix typo in one sdist option (medata-check). .. .. bpo: 10323 .. date: 8291 .. nonce: rFKI3X .. section: Library itertools.islice() now consumes the minimum number of inputs before stopping. Formerly, the final state of the underlying iterator was undefined. .. .. bpo: 10565 .. date: 8290 .. nonce: g3L9da .. section: Library The collections.Iterator ABC now checks for both ``__iter__`` and ``next``. .. .. bpo: 10092 .. date: 8289 .. nonce: -B7ynY .. section: Library Properly reset locale in calendar.Locale*Calendar classes. .. .. bpo: 10459 .. date: 8288 .. nonce: G0RFoD .. section: Library Update CJK character names to Unicode 5.2. .. .. bpo: 6098 .. date: 8287 .. nonce: CKisab .. section: Library Don't claim DOM level 3 conformance in minidom. .. .. bpo: 10561 .. date: 8286 .. nonce: gxs6bQ .. section: Library In pdb, clear the breakpoints by the breakpoint number. .. .. bpo: 5762 .. date: 8285 .. nonce: ADvGzb .. section: Library Fix AttributeError raised by ``xml.dom.minidom`` when an empty XML namespace attribute is encountered. .. .. bpo: 1710703 .. date: 8284 .. nonce: NAAh-d .. section: Library Write structures for an empty ZIP archive when a ZipFile is created in modes 'a' or 'w' and then closed without adding any files. Raise BadZipfile (rather than IOError) when opening small non-ZIP files. .. .. bpo: 4493 .. date: 8283 .. nonce: idMjMG .. section: Library urllib2 adds '/' in front of path components which does not start with '/. Common behavior exhibited by browsers and other clients. .. .. bpo: 10407 .. date: 8282 .. nonce: f8LrF_ .. section: Library Fix one NameError in distutils. .. .. bpo: 10198 .. date: 8281 .. nonce: 7ruhdY .. section: Library fix duplicate header written to wave files when writeframes() is called without data. .. .. bpo: 10467 .. date: 8280 .. nonce: uNWGiY .. section: Library Fix BytesIO.readinto() after seeking into a position after the end of the file. .. .. bpo: 5111 .. date: 8279 .. nonce: XegYFR .. section: Library IPv6 Host in the Header is wrapped inside [ ]. Patch by Chandru. .. .. bpo: 6378 .. date: 8278 .. nonce: ovcYOt .. section: IDLE idle.bat now runs with the appropriate Python version rather than the system default. Patch by Sridhar Ratnakumar. .. .. bpo: 0 .. date: 8277 .. nonce: 64ssfS .. section: Build Backport r83399 to allow test_distutils to pass on installed versions. .. .. bpo: 1303434 .. date: 8276 .. nonce: AVO6EG .. section: Build Generate ZIP file containing all PDBs. .. .. bpo: 9424 .. date: 8275 .. nonce: BO5Jfa .. section: Tests Replace deprecated assert* methods in the Python test suite. .. .. bpo: 10299 .. date: 8274 .. nonce: ERtbPa .. section: Documentation List the built-in functions in a table in functions.rst.
{ "pile_set_name": "Github" }
(;CA[UTF-8]AP[YuanYu]GM[1]FF[4] DT[2017-01-03] PB[Ke Jie]BR[9p] PW[Master]WR[9p] PC[Fox]RO[50]KM[6.5]RE[W+R]TC[3]TM[60]TT[30] ;B[pd];W[pp];B[cd];W[dp];B[ic];W[qf];B[nd];W[qc];B[qd];W[rd];B[cn] ;W[fq];B[dg];W[ec];B[dc];W[de];B[dd];W[eg];B[eh];W[ed];B[ee];W[ef] ;B[fe];W[df];B[fh];W[db];B[cg];W[bd];B[ce];W[cf];B[be];W[bf];B[bc] ;W[gg];B[fc];W[eb];B[fd];W[hf];B[ge];W[gf];B[ci];W[hi];B[pc];W[dk] ;B[gj];W[dm];B[dn];W[cj];B[em];W[di];B[dh];W[el];B[fm];W[fl];B[gl] ;W[gm];B[hl];W[cm];B[eo];W[gn];B[ep];W[fo];B[en];W[eq];B[bm];W[bl] ;B[dq];W[cq];B[dr];W[cr];B[fp];W[gp];B[ds];W[iq];B[cp];W[gi];B[bn] ;W[fj];B[rc];W[qi];B[nq];W[oq];B[np];W[pn];B[kq];W[jo];B[ln];W[lo] ;B[mo];W[lp];B[ho];W[go];B[kn];W[im];B[nm];W[af];B[ad];W[ol];B[pj] ;W[pi];B[nl];W[nk];B[oj];W[om];B[ll];W[qj];B[il];W[jm];B[jl];W[lq] ;B[ok];W[mj];B[oi];W[oh];B[ni];W[nn];B[mn];W[km];B[oo];W[kl];B[po] ;W[qo];B[qp];W[qq];B[rp];W[qn];B[rq];W[lk];B[ml];W[rr];B[qr];W[pr] ;B[pq];W[fb];B[gb];W[qq];B[ql];W[qs];B[on];W[pm];B[mk];W[lj];B[pl] ;W[ro];B[nj];W[lh];B[pg];W[qg];B[ph];W[re];B[jf];W[lf];B[ig];W[jh] ;B[ke];W[ie];B[jd];W[bj];B[ej];W[fi];B[jn];W[in];B[op];W[pq];B[ei] ;W[dj];B[al];W[bk];B[rj];W[ri];B[qm];W[sq];B[rn];W[sp];B[rk];W[qh] ;B[og];W[rg])
{ "pile_set_name": "Github" }
; <<>> DiG 9.9.5-3ubuntu0.8-Ubuntu <<>> AXFR intuit. @ns2.dns.nic.intuit. +nocomments +nocmd +noquestion +nostats +time=15 ;; global options: +cmd ; Transfer failed.
{ "pile_set_name": "Github" }
////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// // // copyright : (C) 2008 by Eran Ifrah // file name : csscopeconfdata.h // // ------------------------------------------------------------------------- // A // _____ _ _ _ _ // / __ \ | | | | (_) | // | / \/ ___ __| | ___| | _| |_ ___ // | | / _ \ / _ |/ _ \ | | | __/ _ ) // | \__/\ (_) | (_| | __/ |___| | || __/ // \____/\___/ \__,_|\___\_____/_|\__\___| // // F i l e // // 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. // ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// #ifndef __csscopeconfdata__ #define __csscopeconfdata__ #include "serialized_object.h" #include <wx/string.h> #define SCOPE_ENTIRE_WORKSPACE wxT("Entire Workspace") #define SCOPE_ACTIVE_PROJECT wxT("Active Project") class CScopeConfData : public SerializedObject { wxString m_cscopeFilepath; wxString m_scanScope; bool m_rebuildDb; bool m_buildRevertedIndex; public: CScopeConfData(); virtual ~CScopeConfData(); public: virtual void DeSerialize(Archive &arch); virtual void Serialize(Archive &arch); void SetCscopeExe(const wxString& filepath) { this->m_cscopeFilepath = filepath; } const wxString& GetCscopeExe() const { return m_cscopeFilepath; } void SetScanScope(const wxString& scanScope) { this->m_scanScope = scanScope; } const wxString& GetScanScope() const { return m_scanScope; } void SetRebuildDbOption(const bool rebuild) { this->m_rebuildDb = rebuild; } bool GetRebuildOption() const { return m_rebuildDb; } void SetBuildRevertedIndexOption(const bool revertedIndex) { this->m_buildRevertedIndex = revertedIndex; } bool GetBuildRevertedIndexOption() const { return m_buildRevertedIndex; } }; #endif // __csscopeconfdata__
{ "pile_set_name": "Github" }
/* * Copyright (C) 2017 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #pragma once #include "AlignedMemoryAllocator.h" #include <wtf/Gigacage.h> namespace JSC { class GigacageAlignedMemoryAllocator : public AlignedMemoryAllocator { public: GigacageAlignedMemoryAllocator(Gigacage::Kind); ~GigacageAlignedMemoryAllocator(); void* tryAllocateAlignedMemory(size_t alignment, size_t size) override; void freeAlignedMemory(void*) override; void dump(PrintStream&) const override; void* tryAllocateMemory(size_t) override; void freeMemory(void*) override; void* tryReallocateMemory(void*, size_t) override; private: Gigacage::Kind m_kind; }; } // namespace JSC
{ "pile_set_name": "Github" }
// a passthrough stream. // basically just the most minimal sort of Transform stream. // Every written chunk gets output as-is. 'use strict'; module.exports = PassThrough; var Transform = require('./_stream_transform'); /*<replacement>*/ var util = require('core-util-is'); util.inherits = require('inherits'); /*</replacement>*/ util.inherits(PassThrough, Transform); function PassThrough(options) { if (!(this instanceof PassThrough)) return new PassThrough(options); Transform.call(this, options); } PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); };
{ "pile_set_name": "Github" }
/*jshint eqeqeq:false */ /*global jQuery */ (function($){ /** * jqGrid extension for SubGrid Data * Tony Tomov tony@trirand.com * http://trirand.com/blog/ * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl-2.0.html **/ "use strict"; $.jgrid.extend({ setSubGrid : function () { return this.each(function (){ var $t = this, cm, i, suboptions = { plusicon : "ui-icon-plus", minusicon : "ui-icon-minus", openicon: "ui-icon-carat-1-sw", expandOnLoad: false, delayOnLoad : 50, selectOnExpand : false, selectOnCollapse : false, reloadOnExpand : true }; $t.p.subGridOptions = $.extend(suboptions, $t.p.subGridOptions || {}); $t.p.colNames.unshift(""); $t.p.colModel.unshift({name:'subgrid',width: $.jgrid.cell_width ? $t.p.subGridWidth+$t.p.cellLayout : $t.p.subGridWidth,sortable: false,resizable:false,hidedlg:true,search:false,fixed:true}); cm = $t.p.subGridModel; if(cm[0]) { cm[0].align = $.extend([],cm[0].align || []); for(i=0;i<cm[0].name.length;i++) { cm[0].align[i] = cm[0].align[i] || 'left';} } }); }, addSubGridCell :function (pos,iRow) { var prp='',ic,sid; this.each(function(){ prp = this.formatCol(pos,iRow); sid= this.p.id; ic = this.p.subGridOptions.plusicon; }); return "<td role=\"gridcell\" aria-describedby=\""+sid+"_subgrid\" class=\"ui-sgcollapsed sgcollapsed\" "+prp+"><a style='cursor:pointer;'><span class='ui-icon "+ic+"'></span></a></td>"; }, addSubGrid : function( pos, sind ) { return this.each(function(){ var ts = this; if (!ts.grid ) { return; } //------------------------- var subGridCell = function(trdiv,cell,pos) { var tddiv = $("<td align='"+ts.p.subGridModel[0].align[pos]+"'></td>").html(cell); $(trdiv).append(tddiv); }; var subGridXml = function(sjxml, sbid){ var tddiv, i, sgmap, dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"), trdiv = $("<tr></tr>"); for (i = 0; i<ts.p.subGridModel[0].name.length; i++) { tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>"); $(tddiv).html(ts.p.subGridModel[0].name[i]); $(tddiv).width( ts.p.subGridModel[0].width[i]); $(trdiv).append(tddiv); } $(dummy).append(trdiv); if (sjxml){ sgmap = ts.p.xmlReader.subgrid; $(sgmap.root+" "+sgmap.row, sjxml).each( function(){ trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>"); if(sgmap.repeatitems === true) { $(sgmap.cell,this).each( function(i) { subGridCell(trdiv, $(this).text() || '&#160;',i); }); } else { var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name; if (f) { for (i=0;i<f.length;i++) { subGridCell(trdiv, $(f[i],this).text() || '&#160;',i); } } } $(dummy).append(trdiv); }); } var pID = $("table:first",ts.grid.bDiv).attr("id")+"_"; $("#"+$.jgrid.jqID(pID+sbid)).append(dummy); ts.grid.hDiv.loading = false; $("#load_"+$.jgrid.jqID(ts.p.id)).hide(); return false; }; var subGridJson = function(sjxml, sbid){ var tddiv,result,i,cur, sgmap,j, dummy = $("<table cellspacing='0' cellpadding='0' border='0'><tbody></tbody></table>"), trdiv = $("<tr></tr>"); for (i = 0; i<ts.p.subGridModel[0].name.length; i++) { tddiv = $("<th class='ui-state-default ui-th-subgrid ui-th-column ui-th-"+ts.p.direction+"'></th>"); $(tddiv).html(ts.p.subGridModel[0].name[i]); $(tddiv).width( ts.p.subGridModel[0].width[i]); $(trdiv).append(tddiv); } $(dummy).append(trdiv); if (sjxml){ sgmap = ts.p.jsonReader.subgrid; result = $.jgrid.getAccessor(sjxml, sgmap.root); if ( result !== undefined ) { for (i=0;i<result.length;i++) { cur = result[i]; trdiv = $("<tr class='ui-widget-content ui-subtblcell'></tr>"); if(sgmap.repeatitems === true) { if(sgmap.cell) { cur=cur[sgmap.cell]; } for (j=0;j<cur.length;j++) { subGridCell(trdiv, cur[j] || '&#160;',j); } } else { var f = ts.p.subGridModel[0].mapping || ts.p.subGridModel[0].name; if(f.length) { for (j=0;j<f.length;j++) { subGridCell(trdiv, cur[f[j]] || '&#160;',j); } } } $(dummy).append(trdiv); } } } var pID = $("table:first",ts.grid.bDiv).attr("id")+"_"; $("#"+$.jgrid.jqID(pID+sbid)).append(dummy); ts.grid.hDiv.loading = false; $("#load_"+$.jgrid.jqID(ts.p.id)).hide(); return false; }; var populatesubgrid = function( rd ) { var sid,dp, i, j; sid = $(rd).attr("id"); dp = {nd_: (new Date().getTime())}; dp[ts.p.prmNames.subgridid]=sid; if(!ts.p.subGridModel[0]) { return false; } if(ts.p.subGridModel[0].params) { for(j=0; j < ts.p.subGridModel[0].params.length; j++) { for(i=0; i<ts.p.colModel.length; i++) { if(ts.p.colModel[i].name === ts.p.subGridModel[0].params[j]) { dp[ts.p.colModel[i].name]= $("td:eq("+i+")",rd).text().replace(/\&#160\;/ig,''); } } } } if(!ts.grid.hDiv.loading) { ts.grid.hDiv.loading = true; $("#load_"+$.jgrid.jqID(ts.p.id)).show(); if(!ts.p.subgridtype) { ts.p.subgridtype = ts.p.datatype; } if($.isFunction(ts.p.subgridtype)) { ts.p.subgridtype.call(ts, dp); } else { ts.p.subgridtype = ts.p.subgridtype.toLowerCase(); } switch(ts.p.subgridtype) { case "xml": case "json": $.ajax($.extend({ type:ts.p.mtype, url: ts.p.subGridUrl, dataType:ts.p.subgridtype, data: $.isFunction(ts.p.serializeSubGridData)? ts.p.serializeSubGridData.call(ts, dp) : dp, complete: function(sxml) { if(ts.p.subgridtype === "xml") { subGridXml(sxml.responseXML, sid); } else { subGridJson($.jgrid.parse(sxml.responseText),sid); } sxml=null; } }, $.jgrid.ajaxOptions, ts.p.ajaxSubgridOptions || {})); break; } } return false; }; var _id, pID,atd, nhc=0, bfsc, r; $.each(ts.p.colModel,function(){ if(this.hidden === true || this.name === 'rn' || this.name === 'cb') { nhc++; } }); var len = ts.rows.length, i=1; if( sind !== undefined && sind > 0) { i = sind; len = sind+1; } while(i < len) { if($(ts.rows[i]).hasClass('jqgrow')) { $(ts.rows[i].cells[pos]).bind('click', function() { var tr = $(this).parent("tr")[0]; r = tr.nextSibling; if($(this).hasClass("sgcollapsed")) { pID = ts.p.id; _id = tr.id; if(ts.p.subGridOptions.reloadOnExpand === true || ( ts.p.subGridOptions.reloadOnExpand === false && !$(r).hasClass('ui-subgrid') ) ) { atd = pos >=1 ? "<td colspan='"+pos+"'>&#160;</td>":""; bfsc = $(ts).triggerHandler("jqGridSubGridBeforeExpand", [pID + "_" + _id, _id]); bfsc = (bfsc === false || bfsc === 'stop') ? false : true; if(bfsc && $.isFunction(ts.p.subGridBeforeExpand)) { bfsc = ts.p.subGridBeforeExpand.call(ts, pID+"_"+_id,_id); } if(bfsc === false) {return false;} $(tr).after( "<tr role='row' class='ui-subgrid'>"+atd+"<td class='ui-widget-content subgrid-cell'><span class='ui-icon "+ts.p.subGridOptions.openicon+"'></span></td><td colspan='"+parseInt(ts.p.colNames.length-1-nhc,10)+"' class='ui-widget-content subgrid-data'><div id="+pID+"_"+_id+" class='tablediv'></div></td></tr>" ); $(ts).triggerHandler("jqGridSubGridRowExpanded", [pID + "_" + _id, _id]); if( $.isFunction(ts.p.subGridRowExpanded)) { ts.p.subGridRowExpanded.call(ts, pID+"_"+ _id,_id); } else { populatesubgrid(tr); } } else { $(r).show(); } $(this).html("<a style='cursor:pointer;'><span class='ui-icon "+ts.p.subGridOptions.minusicon+"'></span></a>").removeClass("sgcollapsed").addClass("sgexpanded"); if(ts.p.subGridOptions.selectOnExpand) { $(ts).jqGrid('setSelection',_id); } } else if($(this).hasClass("sgexpanded")) { bfsc = $(ts).triggerHandler("jqGridSubGridRowColapsed", [pID + "_" + _id, _id]); bfsc = (bfsc === false || bfsc === 'stop') ? false : true; _id = tr.id; if( bfsc && $.isFunction(ts.p.subGridRowColapsed)) { bfsc = ts.p.subGridRowColapsed.call(ts, pID+"_"+_id,_id ); } if(bfsc===false) {return false;} if(ts.p.subGridOptions.reloadOnExpand === true) { $(r).remove(".ui-subgrid"); } else if($(r).hasClass('ui-subgrid')) { // incase of dynamic deleting $(r).hide(); } $(this).html("<a style='cursor:pointer;'><span class='ui-icon "+ts.p.subGridOptions.plusicon+"'></span></a>").removeClass("sgexpanded").addClass("sgcollapsed"); if(ts.p.subGridOptions.selectOnCollapse) { $(ts).jqGrid('setSelection',_id); } } return false; }); } i++; } if(ts.p.subGridOptions.expandOnLoad === true) { $(ts.rows).filter('.jqgrow').each(function(index,row){ $(row.cells[0]).click(); }); } ts.subGridXml = function(xml,sid) {subGridXml(xml,sid);}; ts.subGridJson = function(json,sid) {subGridJson(json,sid);}; }); }, expandSubGridRow : function(rowid) { return this.each(function () { var $t = this; if(!$t.grid && !rowid) {return;} if($t.p.subGrid===true) { var rc = $(this).jqGrid("getInd",rowid,true); if(rc) { var sgc = $("td.sgcollapsed",rc)[0]; if(sgc) { $(sgc).trigger("click"); } } } }); }, collapseSubGridRow : function(rowid) { return this.each(function () { var $t = this; if(!$t.grid && !rowid) {return;} if($t.p.subGrid===true) { var rc = $(this).jqGrid("getInd",rowid,true); if(rc) { var sgc = $("td.sgexpanded",rc)[0]; if(sgc) { $(sgc).trigger("click"); } } } }); }, toggleSubGridRow : function(rowid) { return this.each(function () { var $t = this; if(!$t.grid && !rowid) {return;} if($t.p.subGrid===true) { var rc = $(this).jqGrid("getInd",rowid,true); if(rc) { var sgc = $("td.sgcollapsed",rc)[0]; if(sgc) { $(sgc).trigger("click"); } else { sgc = $("td.sgexpanded",rc)[0]; if(sgc) { $(sgc).trigger("click"); } } } } }); } }); })(jQuery);
{ "pile_set_name": "Github" }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.carbondata.examples import java.io.File import java.time.LocalDateTime import scala.collection.JavaConverters._ import scala.util.Random import org.apache.spark.sql.{Dataset, Row, SaveMode, SparkSession} import org.apache.spark.sql.functions.max import org.apache.carbondata.core.util.CarbonProperties import org.apache.carbondata.processing.util.Auditor /** * Deduplicate Example to show how to use CarbonData to avoid loading duplicate record * by using Merge syntax * * The schema of target table: * (id int, value string, source_table string, mdt timestamp) * * The schema of change table: * (id int, value string, change_type string, mdt timestamp) * * This example will insert change table into target table without duplicated record */ // scalastyle:off println object DedupExample { case class Target (id: Int, value: String, source_table: String, mdt: String) case class Change (id: Int, value: String, change_type: String, mdt: String) // number of records for target table before start CDC val numInitialRows = 10 // number of records to insert for every batch val numInsertPerBatch = 3 // number of duplicated records to update for every batch val numDuplicatePerBatch = 4 // number of batch to simulate CDC val numBatch = 2 // print result or not to console val printDetail = true val names = Seq("Amy", "Bob", "Lucy", "Roy", "Tony", "Mick", "Henry", "Michael", "Carly", "Emma", "Jade", "Josh", "Sue", "Ben", "Dale", "Chris", "Grace", "Emily") private def pickName = names(Random.nextInt(names.size)) // IDs in the target table private val currentIds = new java.util.ArrayList[Int]() private def addId(id: Int) = currentIds.add(id) private def maxId: Int = currentIds.asScala.max private val INSERT = "I" // generate data to insert to the target table private def generateRowsForInsert(sparkSession: SparkSession) = { // make some duplicated id by maxId - 2 val insertRows = (maxId - 2 to maxId + numInsertPerBatch).map { x => addId(x) Change(x, pickName, INSERT, LocalDateTime.now().toString) } val insertData = sparkSession.createDataFrame(insertRows) // make more duplicated records val duplicatedData = insertData.union(insertData) duplicatedData.write .format("carbondata") .option("tableName", "change") .mode(SaveMode.Overwrite) .save() } // generate initial data for target table private def generateTarget(sparkSession: SparkSession) = { val insertRows = (1 to numInitialRows).map { x => addId(x) Target(x, pickName, "table1", LocalDateTime.now().toString) } val targetData = sparkSession.createDataFrame(insertRows) targetData.write .format("carbondata") .option("tableName", "target") .mode(SaveMode.Overwrite) .save() } private def readTargetData(sparkSession: SparkSession): Dataset[Row] = sparkSession.read .format("carbondata") .option("tableName", "target") .load() private def readChangeData(sparkSession: SparkSession): Dataset[Row] = sparkSession.read .format("carbondata") .option("tableName", "change") .load() private def printChange(spark: SparkSession, i: Int) = { if (printDetail) { println(s"Insert batch$i") spark.sql("select * from change").show(100, false) } } private def printTarget(spark: SparkSession, i: Int) = { if (printDetail) { println(s"target table after insert batch$i") spark.sql("select * from target order by id").show(false) } } private def printTarget(spark: SparkSession) = { if (printDetail) { println("## target table") spark.sql("select * from target").show(100, false) } } private def createSession = { import org.apache.spark.sql.CarbonSession._ val rootPath = new File(this.getClass.getResource("/").getPath + "../../../..").getCanonicalPath val spark = SparkSession .builder() .master("local[8]") .enableHiveSupport() .config("spark.sql.warehouse.dir", s"$rootPath/examples/spark/target/warehouse") .getOrCreateCarbonSession() spark.sparkContext.setLogLevel("error") spark } def main(args: Array[String]): Unit = { CarbonProperties.setAuditEnabled(false); val spark: SparkSession = createSession spark.sql("drop table if exists target") spark.sql("drop table if exists change") // prepare target data generateTarget(spark) printTarget(spark) (1 to numBatch).foreach { i => // prepare for change data generateRowsForInsert(spark) printChange(spark, i) // apply Change to history table by using MERGE dedupAndInsert(spark) printTarget(spark, i) } spark.close() } /** * Leveraging carbon's Merge syntax to perform data deduplication */ private def dedupAndInsert(spark: SparkSession) = { import org.apache.spark.sql.CarbonSession._ // find the latest value for each key val latestChangeForEachKey = readChangeData(spark) .selectExpr("id", "struct(mdt, value, change_type) as otherCols" ) .groupBy("id") .agg(max("otherCols").as("latest")) .selectExpr("id", "latest.*") val target = readTargetData(spark) target.as("A") .merge(latestChangeForEachKey.as("B"), "A.id = B.id") .whenNotMatched() .insertExpr( Map("id" -> "B.id", "value" -> "B.value", "source_table" -> "'table1'", "mdt" -> "B.mdt")) .execute() } } // scalastyle:on println
{ "pile_set_name": "Github" }
{ "_from": "mkdirp@^0.5.1", "_id": "mkdirp@0.5.1", "_inBundle": false, "_integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "_location": "/mkdirp", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, "raw": "mkdirp@^0.5.1", "name": "mkdirp", "escapedName": "mkdirp", "rawSpec": "^0.5.1", "saveSpec": null, "fetchSpec": "^0.5.1" }, "_requiredBy": [ "/prebuild-install", "/tar-fs" ], "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", "_spec": "mkdirp@^0.5.1", "_where": "/Users/hdm/cypress/vscode/marus/cortex-debug/tmp/node_modules/prebuild-install", "author": { "name": "James Halliday", "email": "mail@substack.net", "url": "http://substack.net" }, "bin": { "mkdirp": "bin/cmd.js" }, "bugs": { "url": "https://github.com/substack/node-mkdirp/issues" }, "bundleDependencies": false, "dependencies": { "minimist": "0.0.8" }, "deprecated": false, "description": "Recursively mkdir, like `mkdir -p`", "devDependencies": { "mock-fs": "2 >=2.7.0", "tap": "1" }, "homepage": "https://github.com/substack/node-mkdirp#readme", "keywords": [ "mkdir", "directory" ], "license": "MIT", "main": "index.js", "name": "mkdirp", "repository": { "type": "git", "url": "git+https://github.com/substack/node-mkdirp.git" }, "scripts": { "test": "tap test/*.js" }, "version": "0.5.1" }
{ "pile_set_name": "Github" }