code
stringlengths
4
991k
repo_name
stringlengths
6
116
path
stringlengths
4
249
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
4
991k
input_ids
listlengths
502
502
token_type_ids
listlengths
502
502
attention_mask
listlengths
502
502
labels
listlengths
502
502
/*! @license * Shaka Player * Copyright 2016 Google LLC * SPDX-License-Identifier: Apache-2.0 */ goog.provide('shaka.ui.FastForwardButton'); goog.require('shaka.ui.Controls'); goog.require('shaka.ui.Element'); goog.require('shaka.ui.Enums'); goog.require('shaka.ui.Locales'); goog.require('shaka.ui.Localization'); goog.require('shaka.util.Dom'); /** * @extends {shaka.ui.Element} * @final * @export */ shaka.ui.FastForwardButton = class extends shaka.ui.Element { /** * @param {!HTMLElement} parent * @param {!shaka.ui.Controls} controls */ constructor(parent, controls) { super(parent, controls); /** @private {!HTMLButtonElement} */ this.button_ = shaka.util.Dom.createButton(); this.button_.classList.add('material-icons-round'); this.button_.classList.add('shaka-fast-forward-button'); this.button_.classList.add('shaka-tooltip-status'); this.button_.setAttribute('shaka-status', '1x'); this.button_.textContent = shaka.ui.Enums.MaterialDesignIcons.FAST_FORWARD; this.parent.appendChild(this.button_); this.updateAriaLabel_(); /** @private {!Array.<number>} */ this.fastForwardRates_ = this.controls.getConfig().fastForwardRates; this.eventManager.listen( this.localization, shaka.ui.Localization.LOCALE_UPDATED, () => { this.updateAriaLabel_(); }); this.eventManager.listen( this.localization, shaka.ui.Localization.LOCALE_CHANGED, () => { this.updateAriaLabel_(); }); this.eventManager.listen(this.button_, 'click', () => { this.fastForward_(); }); } /** * @private */ updateAriaLabel_() { this.button_.ariaLabel = this.localization.resolve(shaka.ui.Locales.Ids.FAST_FORWARD); } /** * Cycles trick play rate between the selected fast forward rates. * @private */ fastForward_() { if (!this.video.duration) { return; } const trickPlayRate = this.player.getPlaybackRate(); const newRateIndex = this.fastForwardRates_.indexOf(trickPlayRate) + 1; // When the button is clicked, the next rate in this.fastForwardRates_ is // selected. If no more rates are available, the first one is set. const newRate = (newRateIndex != this.fastForwardRates_.length) ? this.fastForwardRates_[newRateIndex] : this.fastForwardRates_[0]; this.player.trickPlay(newRate); this.button_.setAttribute('shaka-status', newRate + 'x'); } }; /** * @implements {shaka.extern.IUIElement.Factory} * @final */ shaka.ui.FastForwardButton.Factory = class { /** @override */ create(rootElement, controls) { return new shaka.ui.FastForwardButton(rootElement, controls); } }; shaka.ui.Controls.registerElement( 'fast_forward', new shaka.ui.FastForwardButton.Factory());
tvoli/shaka-player
ui/fast_forward_button.js
JavaScript
apache-2.0
2,812
[ 30522, 1013, 1008, 999, 1030, 6105, 1008, 21146, 2912, 2447, 1008, 9385, 2355, 8224, 11775, 1008, 23772, 2595, 1011, 6105, 1011, 8909, 4765, 18095, 1024, 15895, 1011, 1016, 1012, 1014, 1008, 1013, 27571, 2290, 1012, 3073, 1006, 1005, 21146,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package invalid import "vend/x/invalid/vendor/foo"
yeyuguo/go
src/cmd/go/testdata/src/vend/x/invalid/invalid.go
GO
bsd-3-clause
52
[ 30522, 7427, 19528, 12324, 1000, 2310, 4859, 1013, 1060, 1013, 19528, 1013, 21431, 1013, 29379, 1000, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30524...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef ANONCOIN_MINER_H #define ANONCOIN_MINER_H #include <stdint.h> typedef long long int64; typedef unsigned long long uint64; class CBlock; class CBlockHeader; class CBlockIndex; struct CBlockTemplate; class CReserveKey; class CScript; #ifdef ENABLE_WALLET class CWallet; void AnoncoinMiner(CWallet *pwallet); #endif /** Run the miner threads */ void GenerateAnoncoins(bool fGenerate, CWallet* pwallet); /** Generate a new block, without valid proof-of-work */ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn); CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey); /** Modify the extranonce in a block */ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce); /** Do mining precalculation */ void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1); /** Check mined block */ bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey); /** Base sha256 mining transform */ void SHA256Transform(void* pstate, void* pinput, const void* pinit); #endif
coinkeeper/2015-06-22_18-30_anoncoin
src/miner.h
C
mit
1,063
[ 30522, 1001, 2065, 13629, 2546, 2019, 2239, 3597, 2378, 1035, 18594, 1035, 1044, 1001, 9375, 2019, 2239, 3597, 2378, 1035, 18594, 1035, 1044, 1001, 2421, 1026, 2358, 8718, 2102, 1012, 1044, 1028, 21189, 12879, 2146, 2146, 20014, 21084, 1025...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<table width="90%" border="0"><tr><td><script>function openfile(url) {fullwin = window.open(url, "fulltext", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes");}</script><div class="flayoutclass"><div class="flayoutclass_first"><table class="tableoutfmt2"><tr><th class="std1"><b>條目&nbsp;</b></th><td class="std2">不足齒及</td></tr> <tr><th class="std1"><b>參考成語&nbsp;</b></th><td class="std2"><a href="/cgi-bin/cydic/gsweb.cgi?o=dcydic&schfmt=text&gourl=%3De0%26sec%3Dsec1%26op%3Dsid%3D%22CW0000000410%22.%26v%3D-1" class="clink" target=_blank>不足掛齒</a></td></tr> <tr><th class="std1"><b><font class="fltypefont">附錄</font>&nbsp;</b></th><td class="std2">書證待考參考詞語表</td></tr> </td></tr></table></div> <!-- flayoutclass_first --><div class="flayoutclass_second"></div> <!-- flayoutclass_second --></div> <!-- flayoutclass --></td></tr></table>
BuzzAcademy/idioms-moe-unformatted-data
all-data/29000-29999/29140-22.html
HTML
mit
926
[ 30522, 1026, 2795, 9381, 1027, 1000, 3938, 1003, 1000, 3675, 1027, 1000, 1014, 1000, 1028, 1026, 19817, 1028, 1026, 14595, 1028, 1026, 5896, 1028, 3853, 2330, 8873, 2571, 1006, 24471, 2140, 1007, 1063, 2440, 10105, 1027, 3332, 1012, 2330, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
example_template = Template({ 'A': RsrcDef({}, []), 'B': RsrcDef({}, []), 'C': RsrcDef({'a': '4alpha'}, ['A', 'B']), 'D': RsrcDef({'c': GetRes('C')}, []), 'E': RsrcDef({'ca': GetAtt('C', 'a')}, []), }) engine.create_stack('foo', example_template) engine.noop(3) engine.rollback_stack('foo') engine.noop(6) engine.call(verify, Template())
zaneb/heat-convergence-prototype
scenarios/basic_create_rollback.py
Python
apache-2.0
358
[ 30522, 2742, 1035, 23561, 1027, 23561, 1006, 1063, 1005, 1037, 1005, 1024, 12667, 11890, 3207, 2546, 1006, 1063, 1065, 1010, 1031, 1033, 1007, 1010, 1005, 1038, 1005, 1024, 12667, 11890, 3207, 2546, 1006, 1063, 1065, 1010, 1031, 1033, 1007,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace HayDoc.Core.Configuration { public class Database { public string Host { get; set; } public string Port { get; set; } public string Scheme { get; set; } public string Username { get; set; } public string Password { get; set; } } }
mbedded/HayDoc
HayDoc.Core/Configuration/Database.cs
C#
mit
267
[ 30522, 3415, 15327, 10974, 3527, 2278, 1012, 4563, 1012, 9563, 1063, 2270, 2465, 7809, 1063, 2270, 5164, 3677, 1063, 2131, 1025, 2275, 1025, 1065, 2270, 5164, 3417, 1063, 2131, 1025, 2275, 1025, 1065, 2270, 5164, 5679, 1063, 2131, 1025, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* @test @bug 6986385 @summary JLayer should implement accessible interface @author Alexander Potochkin @run main bug6986385 */ import javax.swing.*; import javax.accessibility.AccessibleContext; import javax.accessibility.AccessibleRole; public class bug6986385 { public static void main(String... args) throws Exception { JLayer l = new JLayer(); AccessibleContext acc = l.getAccessibleContext(); if (acc == null) { throw new RuntimeException("JLayer's AccessibleContext is null"); } if (acc.getAccessibleRole() != AccessibleRole.PANEL) { throw new RuntimeException("JLayer's AccessibleRole must be PANEL"); } } }
rokn/Count_Words_2015
testing/openjdk2/jdk/test/javax/accessibility/6986385/bug6986385.java
Java
mit
1,763
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2230, 1010, 14721, 1998, 1013, 2030, 2049, 18460, 1012, 2035, 2916, 9235, 1012, 1008, 2079, 2025, 11477, 2030, 6366, 9385, 14444, 2030, 2023, 5371, 20346, 1012, 1008, 1008, 2023, 3642, 2003, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Mycosphaerella tupae (Speg.) Tomilin SPECIES #### Status ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Sphaerella tupae Speg. ### Remarks null
mdoering/backbone
life/Fungi/Ascomycota/Dothideomycetes/Capnodiales/Mycosphaerellaceae/Mycosphaerella/Mycosphaerella tupae/README.md
Markdown
apache-2.0
187
[ 30522, 1001, 2026, 13186, 21890, 7869, 4571, 10722, 4502, 2063, 1006, 11867, 13910, 1012, 1007, 3419, 18622, 2078, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 5950, 4569, 20255, 2819, 1001, 1001, 1001, 1001...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/// Copyright (c) 2008-2021 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) #include <boost/qvm/gen/vec_mat_operations2.hpp>
rneiss/PocketTorah
ios/Pods/Flipper-Boost-iOSX/boost/qvm/vec_mat_operations2.hpp
C++
gpl-3.0
276
[ 30522, 1013, 1013, 1013, 9385, 1006, 1039, 1007, 2263, 1011, 25682, 16243, 11089, 16179, 5488, 1998, 7065, 2121, 3351, 4835, 1010, 4297, 1012, 1013, 1013, 1013, 5500, 2104, 1996, 12992, 4007, 6105, 1010, 2544, 1015, 1012, 1014, 1012, 1006, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// set event handlers and intialize date var utils = new MedialUtilities(); var week = 0; window.addEventListener('load',function() { document.getElementById('appointment').addEventListener('click', overlayCalendar); document.getElementById('calendar-close').addEventListener('click', closeCalendar); document.getElementById('go-back') && document.getElementById('go-back').addEventListener('click', back); document.getElementById('go-next') && document.getElementById('go-next').addEventListener('click', next); document.getElementById('go-next-cal').addEventListener('click', nextcal); document.getElementById('go-back-cal').addEventListener('click', backcal); }); function overlayCalendar() { newdiv = document.createElement('div'); newdiv.id = 'calendarOverlay'; newdiv.style.width = window.screen.width + 'px'; newdiv.style.height = window.screen.height + 'px'; newdiv.style.position = 'fixed'; newdiv.style.display = 'block'; newdiv.style.background = 'rgba(0,0,0,0.8)'; newdiv.style.zIndex = 9999; newdiv.style.top = 0; document.getElementsByTagName('body')[0].appendChild(newdiv); document.getElementById('calendar').style.zIndex = 99999; document.getElementById('calendar').style.position = 'relative'; document.getElementById('calendar').style.background = 'rgba(255,255,255,1)'; document.getElementById('calendar-close').style.display = 'block'; } function closeCalendar() { document.getElementById('calendarOverlay').remove(); document.getElementById('calendar').style.background = '#F4F7FB'; document.getElementById('calendar-close').style.display = 'none'; } function back(){if (week == 0) {return false;} else { week -= 1; } if (week >= 0) {getCalendar();}} function next(){if (week == eamax) {return false;} else {week += 1;} if (week <= eamax) {getCalendar();}} function getCalendar() { var params = 'info[user]=' + eauser + '&info[service]=' + easervice + '&info[week]=' + week + '&' + eatoken; var url = earoot + 'index.php?option=com_easyappointment&task=json.getCalendar&tmpl=component'; utils.makeAjaxCall(url,'POST',params,function(msg) { var response = JSON.parse(msg); if (!response.error) { document.getElementById('calendar-table').innerHTML = response.value; } }); } function nextcal() { document.getElementById('calendar-table').scrollLeft+= parseInt(document.getElementById('calendar').clientWidth/3); } function backcal() { document.getElementById('calendar-table').scrollLeft -= parseInt(document.getElementById('calendar').clientWidth/3); }
imsauravsingh/homeo
components/com_easyappointment/assets/js/views/user.js
JavaScript
gpl-2.0
2,630
[ 30522, 1013, 1013, 2275, 2724, 28213, 2015, 1998, 20014, 4818, 4697, 3058, 13075, 21183, 30524, 3762, 3593, 1006, 1005, 6098, 1005, 1007, 1012, 5587, 18697, 3372, 9863, 24454, 1006, 1005, 11562, 1005, 1010, 2058, 8485, 9289, 10497, 2906, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Package time extends the time package in the stdlib. package time
goph/stdlib
time/time.go
GO
mit
69
[ 30522, 1013, 1013, 7427, 2051, 8908, 1996, 2051, 7427, 1999, 1996, 2358, 19422, 12322, 1012, 7427, 2051, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package mil.nga.giat.osm; import com.google.common.io.BaseEncoding; import mil.nga.giat.osm.accumulo.osmschema.Schema; import org.junit.Assert; import org.junit.Test; import static org.junit.Assert.*; public class ColumnQualifierTest { @Test(expected=NullPointerException.class) public void TAG_QUALIFIER_NULL() throws Exception { byte[] bytes = Schema.CQ.TAG_QUALIFIER(null); if (bytes != null){ Assert.fail("returned non null value back; execution path should never be seen"); } } @Test public void TAG_QUALIFIER_TOBYTE() throws Exception { byte[] bytes = Schema.CQ.TAG_QUALIFIER("フォースを使え ルーク"); byte[] bytes2 = BaseEncoding.base64().decode("44OV44Kp44O844K544KS5L2/44GI44CA44Or44O844Kv"); Assert.assertArrayEquals(bytes, bytes2); } }
ngageoint/geowave-osm
src/test/java/mil/nga/giat/osm/ColumnQualifierTest.java
Java
apache-2.0
826
[ 30522, 7427, 23689, 1012, 12835, 2050, 1012, 27699, 2102, 1012, 9808, 2213, 1025, 12324, 4012, 1012, 8224, 1012, 2691, 1012, 22834, 1012, 2918, 2368, 3597, 4667, 1025, 12324, 23689, 1012, 12835, 2050, 1012, 27699, 2102, 1012, 9808, 2213, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * */ package com.dotmarketing.business; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; import com.dotcms.repackage.jgroups_2_12_2_final.org.jgroups.JChannel; import com.dotmarketing.common.business.journal.DistributedJournalAPI; import com.dotmarketing.exception.DotDataException; import com.dotmarketing.util.Logger; /** * The legacy cache administrator will invalidate cache entries within a cluster * on a put where the non legacy one will not. * @author Jason Tesser * @version 1.6.5 * */ public class DotJBCacheAdministratorLegacyImpl implements DotCacheAdministrator{ private DotCacheAdministrator cache; private DistributedJournalAPI journalAPI; public DotJBCacheAdministratorLegacyImpl() { journalAPI = APILocator.getDistributedJournalAPI(); cache = CacheLocator.getCacheAdministrator(); } /* (non-Javadoc) * @see com.dotmarketing.business.DotCacheAdministrator#flushAll() */ public void flushAll() { cache.flushAll(); } /* (non-Javadoc) * @see com.dotmarketing.business.DotCacheAdministrator#flushGroup(java.lang.String) */ public void flushGroup(String group) { cache.flushGroup(group); } public void flushGroupLocalOnly(String group) { cache.flushGroupLocalOnly(group); } /* (non-Javadoc) * @see com.dotmarketing.business.DotCacheAdministrator#get(java.lang.String) */ public Object get(String key, String group) throws DotCacheException { return cache.get(key, group); } /* (non-Javadoc) * @see com.dotmarketing.business.DotCacheAdministrator#put(java.lang.String, java.lang.Object, java.lang.String[]) */ public void put(String key, Object content, String group) { cache.put(key, content, group); try{ journalAPI.addCacheEntry(key, group); }catch(DotDataException e){ Logger.error(this, "Unable to add journal entry for cluster", e); } } /* (non-Javadoc) * @see com.dotmarketing.business.DotCacheAdministrator#remove(java.lang.String) */ public void remove(String key, String group) { cache.remove(key, group); } public void removeLocalOnly(String key, String group) { cache.removeLocalOnly(key, group); } public void flushAlLocalOnlyl() { cache.flushAlLocalOnlyl(); } public Set<String> getKeys(String group) { return cache.getKeys(group); } public void shutdown() { cache.shutdown(); } public JChannel getJGroupsChannel() { // TODO Auto-generated method stub return null; } @Override public List<Map<String, Object>> getCacheStatsList() { return new ArrayList<Map<String, Object>>(); } @Override public Class getImplementationClass() { return DotJBCacheAdministratorLegacyImpl.class; } @Override public DotCacheAdministrator getImplementationObject() { return this; } }
austindlawless/dotCMS
src/com/dotmarketing/business/DotJBCacheAdministratorLegacyImpl.java
Java
gpl-3.0
2,826
[ 30522, 1013, 1008, 1008, 1008, 1008, 1013, 7427, 4012, 1012, 11089, 20285, 2075, 1012, 2449, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 9140, 9863, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 2862, 1025, 12324, 9262, 1012, 21183, 4014, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 1988, 1992, 1993 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 * in_cksum.c,v 1.2 1994/08/02 07:48:16 davidg Exp */ #include "slirp.h" /* * Checksum routine for Internet Protocol family headers (Portable Version). * * This routine is very heavily used in the network * code and should be modified for each CPU to be as fast as possible. * * XXX Since we will never span more than 1 SLIRPmbuf, we can optimise this */ #define ADDCARRY(x) (x > 65535 ? x -= 65535 : x) #define REDUCE {l_util.l = sum; sum = l_util.s[0] + l_util.s[1]; ADDCARRY(sum);} int cksum(struct SLIRPmbuf *m, int len) { register u_int16_t *w; register int sum = 0; register int mlen = 0; int byte_swapped = 0; union { u_int8_t c[2]; u_int16_t s; } s_util; union { u_int16_t s[2]; u_int32_t l; } l_util; if (m->m_len == 0) goto cont; w = mtod(m, u_int16_t *); mlen = m->m_len; if (len < mlen) mlen = len; len -= mlen; /* * Force to even boundary. */ if ((1 & (long) w) && (mlen > 0)) { REDUCE; sum <<= 8; s_util.c[0] = *(u_int8_t *)w; w = (u_int16_t *)((int8_t *)w + 1); mlen--; byte_swapped = 1; } /* * Unroll the loop to make overhead from * branches &c small. */ while ((mlen -= 32) >= 0) { sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; sum += w[4]; sum += w[5]; sum += w[6]; sum += w[7]; sum += w[8]; sum += w[9]; sum += w[10]; sum += w[11]; sum += w[12]; sum += w[13]; sum += w[14]; sum += w[15]; w += 16; } mlen += 32; while ((mlen -= 8) >= 0) { sum += w[0]; sum += w[1]; sum += w[2]; sum += w[3]; w += 4; } mlen += 8; if (mlen == 0 && byte_swapped == 0) goto cont; REDUCE; while ((mlen -= 2) >= 0) { sum += *w++; } if (byte_swapped) { REDUCE; sum <<= 8; byte_swapped = 0; if (mlen == -1) { s_util.c[1] = *(u_int8_t *)w; sum += s_util.s; mlen = 0; } else mlen = -1; } else if (mlen == -1) s_util.c[0] = *(u_int8_t *)w; cont: #ifdef SLIRP_DEBUG if (len) { DEBUG_ERROR((dfd, "cksum: out of data\n")); DEBUG_ERROR((dfd, " len = %d\n", len)); } #endif if (mlen == -1) { /* The last SLIRPmbuf has odd # of bytes. Follow the standard (the odd byte may be shifted left by 8 bits or not as determined by endian-ness of the machine) */ s_util.c[1] = 0; sum += s_util.s; } REDUCE; return (~sum & 0xffff); }
mborjesson/PCem-wx-SDL2
src/slirp/cksum.c
C
gpl-2.0
4,063
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2997, 1010, 2826, 1010, 2857, 1008, 1996, 22832, 1997, 1996, 2118, 1997, 2662, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 25707, 1998, 2224, 1999, 3120, 1998, 12441, 3596, 1010, 2007, 2030, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# # Copyright (C) 2011 Instructure, Inc. # # This file is part of Canvas. # # Canvas 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, version 3 of the License. # # Canvas 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/>. # require File.expand_path(File.dirname(__FILE__) + '/api_spec_helper') require 'nokogiri' describe UserContent, type: :request do before :once do course_with_teacher(:active_all => true) attachment_model end it "should translate course file download links to directly-downloadable urls" do @assignment = @course.assignments.create!(:title => "first assignment", :description => <<-HTML) <p> Hello, students.<br> This will explain everything: <img src="/courses/#{@course.id}/files/#{@attachment.id}/download" alt="important"> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}", { :controller => 'assignments_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :id => @assignment.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['description']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/courses/#{@course.id}/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" end it "should translate group file download links to directly-downloadable urls" do @group = @course.groups.create!(:name => "course group") attachment_model(:context => @group) @group.add_user(@teacher) @group_topic = @group.discussion_topics.create!(:title => "group topic", :user => @teacher, :message => <<-HTML) <p> Hello, students.<br> This will explain everything: <img src="/groups/#{@group.id}/files/#{@attachment.id}/download" alt="important"> </p> HTML json = api_call(:get, "/api/v1/groups/#{@group.id}/discussion_topics/#{@group_topic.id}", { :controller => 'discussion_topics_api', :action => 'show', :format => 'json', :group_id => @group.id.to_s, :topic_id => @group_topic.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['message']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/groups/#{@group.id}/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" end it "should translate file download links to directly-downloadable urls for deleted and replaced files" do @attachment.destroy attachment2 = Attachment.create!(:folder => @attachment.folder, :context => @attachment.context, :filename => @attachment.filename, :uploaded_data => StringIO.new("first")) expect(@context.attachments.find(@attachment.id).id).to eq attachment2.id @assignment = @course.assignments.create!(:title => "first assignment", :description => <<-HTML) <p> Hello, students.<br> This will explain everything: <img src="/courses/#{@course.id}/files/#{@attachment.id}/download" alt="important"> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}", { :controller => 'assignments_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :id => @assignment.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['description']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/courses/#{@course.id}/files/#{attachment2.id}/download?verifier=#{attachment2.uuid}" end it "should not corrupt absolute links" do attachment_model(:context => @course) @topic = @course.discussion_topics.create!(:title => "course topic", :user => @teacher, :message => <<-HTML) <p> Hello, students.<br> This will explain everything: <img src="http://www.example.com/courses/#{@course.id}/files/#{@attachment.id}/download" alt="important"> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/discussion_topics/#{@topic.id}", { :controller => 'discussion_topics_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :topic_id => @topic.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['message']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/courses/#{@course.id}/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" end it "should not remove wrap parameter on file download links" do attachment_model(:context => @course) @topic = @course.discussion_topics.create!(:title => "course topic", :user => @teacher, :message => <<-HTML) <p> Hello, students.<br> This will explain everything: <img src="/courses/#{@course.id}/files/#{@attachment.id}/download?wrap=1" alt="important"> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/discussion_topics/#{@topic.id}", { :controller => 'discussion_topics_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :topic_id => @topic.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['message']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/courses/#{@course.id}/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}&wrap=1" end it "should translate file preview links to directly-downloadable preview urls" do @assignment = @course.assignments.create!(:title => "first assignment", :description => <<-HTML) <p> Hello, students.<br> This will explain everything: <img src="/courses/#{@course.id}/files/#{@attachment.id}/preview" alt="important"> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}", { :controller => 'assignments_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :id => @assignment.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['description']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/courses/#{@course.id}/files/#{@attachment.id}/preview?verifier=#{@attachment.uuid}" end it "should translate media comment links to embedded video tags" do @assignment = @course.assignments.create!(:title => "first assignment", :description => <<-HTML) <p> Hello, students.<br> Watch this awesome video: <a href="/media_objects/qwerty" class="instructure_inline_media_comment video_comment" id="media_comment_qwerty"><img></a> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}", { :controller => 'assignments_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :id => @assignment.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['description']) video = doc.at_css('video') expect(video).to be_present expect(video['class']).to match(/\binstructure_inline_media_comment\b/) expect(video['data-media_comment_type']).to eq 'video' expect(video['data-media_comment_id']).to eq 'qwerty' expect(video['poster']).to match(%r{http://www.example.com/media_objects/qwerty/thumbnail}) expect(video['src']).to match(%r{http://www.example.com/courses/#{@course.id}/media_download}) expect(video['src']).to match(%r{entryId=qwerty}) # we leave width/height out of it, since browsers tend to have good # defaults and it makes it easier to set via client css rules expect(video['width']).to be_nil expect(video['height']).to be_nil end it "should translate media comment audio tags" do @assignment = @course.assignments.create!(:title => "first assignment", :description => <<-HTML) <p> Hello, students.<br> Listen up: <a href="/media_objects/abcde" class="instructure_inline_media_comment audio_comment" id="media_comment_abcde"><img></a> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}", { :controller => 'assignments_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :id => @assignment.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['description']) audio = doc.at_css('audio') expect(audio).to be_present expect(audio['class']).to match(/\binstructure_inline_media_comment\b/) expect(audio['data-media_comment_type']).to eq 'audio' expect(audio['data-media_comment_id']).to eq 'abcde' expect(audio['poster']).to be_blank expect(audio['src']).to match(%r{http://www.example.com/courses/#{@course.id}/media_download}) expect(audio['src']).to match(%r{entryId=abcde}) end it "should not translate links in content not viewable by user" do @assignment = @course.assignments.create!(:title => "first assignment", :description => <<-HTML) <p> Hello, students.<br> This will explain everything: <img src="/courses/#{@course.id}/files/#{@attachment.id}/preview" alt="important"> </p> HTML # put a student in the course. this will be the active user during the API # call (necessary since the teacher has manage content rights and will thus # ignore the lock). lock the attachment so the student can't view it. student_in_course(:course => @course, :active_all => true) @attachment.locked = true @attachment.save json = api_call(:get, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}", { :controller => 'assignments_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :id => @assignment.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['description']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/courses/#{@course.id}/files/#{@attachment.id}/preview" end it "should prepend the hostname to all absolute-path links" do @assignment = @course.assignments.create!(:title => "first assignment", :description => <<-HTML) <p> Hello, students.<br> <img src='/equation_images/1234'> <a href='/help'>click for teh help</a> <a href='//example.com/quiz'>a quiz</a> <a href='http://example.com/test1'>moar</a> <a href='invalid url'>broke</a> </p> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/assignments/#{@assignment.id}", { :controller => 'assignments_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :id => @assignment.id.to_s }) doc = Nokogiri::HTML::DocumentFragment.parse(json['description']) expect(doc.at_css('img')['src']).to eq "http://www.example.com/equation_images/1234" expect(doc.css('a').map { |e| e['href'] }).to eq [ "http://www.example.com/help", "//example.com/quiz", "http://example.com/test1", "invalid%20url", ] end it "should not choke on funny email addresses" do @wiki_page = @course.wiki.wiki_pages.build(:title => "title") @wiki_page.body = "<a href='mailto:djmankiewicz@homestarrunner,com'>e-nail</a>" @wiki_page.workflow_state = 'active' @wiki_page.save! api_call(:get, "/api/v1/courses/#{@course.id}/pages/#{@wiki_page.url}", { :controller => 'wiki_pages_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :url => @wiki_page.url }) end context "data api endpoints" do context "course context" do it "should process links to each type of object" do @wiki_page = @course.wiki.wiki_pages.build(:title => "title") @wiki_page.body = <<-HTML <p> <a href='/courses/#{@course.id}/assignments'>assignments index</a> <a href='/courses/#{@course.id}/assignments/9~123'>assignment</a> <a href='/courses/#{@course.id}/wiki'>wiki index</a> <a href='/courses/#{@course.id}/wiki/test-wiki-page'>wiki page</a> <a href='/courses/#{@course.id}/wiki/test-wiki-page-2?titleize=0'>wiki page</a> <a href='/courses/#{@course.id}/pages'>wiki index</a> <a href='/courses/#{@course.id}/pages/test-wiki-page'>wiki page</a> <a href='/courses/#{@course.id}/pages/test-wiki-page-2?titleize=0'>wiki page</a> <a href='/courses/#{@course.id}/discussion_topics'>discussion index</a> <a href='/courses/#{@course.id}/discussion_topics/456'>discussion topic</a> <a href='/courses/#{@course.id}/files'>files index</a> <a href='/courses/#{@course.id}/files/789/download?verifier=lolcats'>files index</a> <a href='/files/789/download?verifier=lolcats'>file</a> <a href='/courses/#{@course.id}/quizzes'>quiz index</a> <a href='/courses/#{@course.id}/quizzes/999'>quiz</a> <a href='/courses/#{@course.id}/modules'>modules index</a> <a href='/courses/#{@course.id}/modules/1024'>module</a> <a href='/courses/#{@course.id}/external_tools/retrieve?url=http://lti-tool-provider.example.com/lti_tool'>LTI Launch</a> </p> HTML @wiki_page.workflow_state = 'active' @wiki_page.save! json = api_call(:get, "/api/v1/courses/#{@course.id}/pages/#{@wiki_page.url}", { :controller => 'wiki_pages_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :url => @wiki_page.url }) doc = Nokogiri::HTML::DocumentFragment.parse(json['body']) expect(doc.css('a').collect { |att| att['data-api-endpoint'] }).to eq [ "http://www.example.com/api/v1/courses/#{@course.id}/assignments", "http://www.example.com/api/v1/courses/#{@course.id}/assignments/9~123", "http://www.example.com/api/v1/courses/#{@course.id}/pages", "http://www.example.com/api/v1/courses/#{@course.id}/pages/test-wiki-page", "http://www.example.com/api/v1/courses/#{@course.id}/pages/test-wiki-page-2", "http://www.example.com/api/v1/courses/#{@course.id}/pages", "http://www.example.com/api/v1/courses/#{@course.id}/pages/test-wiki-page", "http://www.example.com/api/v1/courses/#{@course.id}/pages/test-wiki-page-2", "http://www.example.com/api/v1/courses/#{@course.id}/discussion_topics", "http://www.example.com/api/v1/courses/#{@course.id}/discussion_topics/456", "http://www.example.com/api/v1/courses/#{@course.id}/folders/root", "http://www.example.com/api/v1/courses/#{@course.id}/files/789", "http://www.example.com/api/v1/files/789", "http://www.example.com/api/v1/courses/#{@course.id}/quizzes", "http://www.example.com/api/v1/courses/#{@course.id}/quizzes/999", "http://www.example.com/api/v1/courses/#{@course.id}/modules", "http://www.example.com/api/v1/courses/#{@course.id}/modules/1024", "http://www.example.com/api/v1/courses/#{@course.id}/external_tools/sessionless_launch?url=http%3A%2F%2Flti-tool-provider.example.com%2Flti_tool" ] expect(doc.css('a').collect { |att| att['data-api-returntype'] }).to eq( %w([Assignment] Assignment [Page] Page Page [Page] Page Page [Discussion] Discussion Folder File File [Quiz] Quiz [Module] Module SessionlessLaunchUrl) ) end end context "group context" do it "should process links to each type of object" do group_with_user(:active_all => true) @wiki_page = @group.wiki.wiki_pages.build(:title => "title") @wiki_page.body = <<-HTML <p> <a href='/groups/#{@group.id}/wiki'>wiki index</a> <a href='/groups/#{@group.id}/wiki/some-page'>wiki page</a> <a href='/groups/#{@group.id}/pages'>wiki index</a> <a href='/groups/#{@group.id}/pages/some-page'>wiki page</a> <a href='/groups/#{@group.id}/discussion_topics'>discussion index</a> <a href='/groups/#{@group.id}/discussion_topics/1~123'>discussion topic</a> <a href='/groups/#{@group.id}/files'>files index</a> <a href='/groups/#{@group.id}/files/789/preview'>file</a> </p> HTML @wiki_page.workflow_state = 'active' @wiki_page.save! json = api_call(:get, "/api/v1/groups/#{@group.id}/pages/#{@wiki_page.url}", { :controller => 'wiki_pages_api', :action => 'show', :format => 'json', :group_id => @group.id.to_s, :url => @wiki_page.url }) doc = Nokogiri::HTML::DocumentFragment.parse(json['body']) expect(doc.css('a').collect { |att| att['data-api-endpoint'] }).to eq [ "http://www.example.com/api/v1/groups/#{@group.id}/pages", "http://www.example.com/api/v1/groups/#{@group.id}/pages/some-page", "http://www.example.com/api/v1/groups/#{@group.id}/pages", "http://www.example.com/api/v1/groups/#{@group.id}/pages/some-page", "http://www.example.com/api/v1/groups/#{@group.id}/discussion_topics", "http://www.example.com/api/v1/groups/#{@group.id}/discussion_topics/1~123", "http://www.example.com/api/v1/groups/#{@group.id}/folders/root", "http://www.example.com/api/v1/groups/#{@group.id}/files/789" ] expect(doc.css('a').collect{ |att| att['data-api-returntype'] }).to eq( %w([Page] Page [Page] Page [Discussion] Discussion Folder File) ) end end context "user context" do it "should process links to each type of object" do @topic = @course.discussion_topics.create!(:message => <<-HTML) <a href='/users/#{@teacher.id}/files'>file index</a> <a href='/users/#{@teacher.id}/files/789/preview'>file</a> HTML json = api_call(:get, "/api/v1/courses/#{@course.id}/discussion_topics/#{@topic.id}", :controller => 'discussion_topics_api', :action => 'show', :format => 'json', :course_id => @course.id.to_s, :topic_id => @topic.id.to_s) doc = Nokogiri::HTML::DocumentFragment.parse(json['message']) expect(doc.css('a').collect { |att| att['data-api-endpoint'] }).to eq [ "http://www.example.com/api/v1/users/#{@teacher.id}/folders/root", "http://www.example.com/api/v1/users/#{@teacher.id}/files/789" ] expect(doc.css('a').collect { |att| att['data-api-returntype'] }).to eq( %w(Folder File) ) end end end context "process_incoming_html_content" do class Tester include Api end let(:tester) { Tester.new } it "should add the expected href to instructure_inline_media_comment anchors" do factory_with_protected_attributes(MediaObject, media_id: 'test2', media_type: 'audio') html = tester.process_incoming_html_content(<<-HTML) <a id='something-else' href='/blah'>no touchy</a> <a class='instructure_inline_media_comment audio_comment'>no id</a> <a id='media_comment_test1' class='instructure_inline_media_comment audio_comment'>with id</a> <a id='media_comment_test2' class='instructure_inline_media_comment'>id, no type</a> <a id='media_comment_test3' class='instructure_inline_media_comment'>id, no type, missing object</a> HTML doc = Nokogiri::HTML::DocumentFragment.parse(html) anchors = doc.css('a') expect(anchors[0]['id']).to eq 'something-else' expect(anchors[0]['href']).to eq '/blah' expect(anchors[1]['href']).to be_nil expect(anchors[2]['href']).to eq '/media_objects/test1' expect(anchors[2]['class']).to eq 'instructure_inline_media_comment audio_comment' expect(anchors[3]['class']).to eq 'instructure_inline_media_comment audio_comment' # media_type added by code expect(anchors[3]['href']).to eq '/media_objects/test2' expect(anchors[4]['class']).to eq 'instructure_inline_media_comment' # media object not found, no type added expect(anchors[4]['href']).to eq '/media_objects/test3' end it "should translate video and audio instructure_inline_media_comment tags" do html = tester.process_incoming_html_content(<<-HTML) <video src='/other'></video> <video class='instructure_inline_media_comment' src='/some/redirect/url'>no media id</video> <video class='instructure_inline_media_comment' src='/some/redirect/url' data-media_comment_id='test1'>with media id</video> <audio class='instructure_inline_media_comment' src='/some/redirect/url' data-media_comment_id='test2'>with media id</video> HTML doc = Nokogiri::HTML::DocumentFragment.parse(html) tags = doc.css('audio,video,a') expect(tags[0].name).to eq 'video' expect(tags[0]['src']).to eq '/other' expect(tags[0]['class']).to be_nil expect(tags[1].name).to eq 'video' expect(tags[2].name).to eq 'a' expect(tags[2]['class']).to eq 'instructure_inline_media_comment video_comment' expect(tags[2]['href']).to eq '/media_objects/test1' expect(tags[2]['id']).to eq 'media_comment_test1' expect(tags[3].name).to eq 'a' expect(tags[3]['class']).to eq 'instructure_inline_media_comment audio_comment' expect(tags[3]['href']).to eq '/media_objects/test2' expect(tags[3]['id']).to eq 'media_comment_test2' end context "with verified user-context file links" do before do user attachment_model :context => @user end def confirm_url_stability(url) link = %Q{<a href="#{url}">what</a>} html = tester.process_incoming_html_content(link) doc = Nokogiri::HTML::DocumentFragment.parse(html) expect(doc.at_css('a')['href']).to eq url end it "ignores them when scoped to the file" do url = "/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" confirm_url_stability(url) end it "ignores them when scoped to the user" do url = "/users/#{@user.id}/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" confirm_url_stability(url) end end context "with verified user-context file links" do before do user attachment_model :context => @user end def confirm_url_stability(url) link = %Q{<a href="#{url}">what</a>a>} html = tester.process_incoming_html_content(link) doc = Nokogiri::HTML::DocumentFragment.parse(html) expect(doc.at_css('a')['href']).to eq url end it "ignores them when scoped to the file" do url = "/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" confirm_url_stability(url) end it "ignores them when scoped to the user" do url = "/users/#{@user.id}/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" confirm_url_stability(url) end it "ignores them when they include the host" do url = "http://somedomain.instructure.com/files/#{@attachment.id}/download?verifier=#{@attachment.uuid}" confirm_url_stability(url) end end end describe ".api_bulk_load_user_content_attachments" do it "returns a hash of assignment_id => assignment" do a1, a2, a3 = attachment_model, attachment_model, attachment_model html1, html2 = <<-HTML1, <<-HTML2 <a href="/courses/#{@course.id}/files/#{a1.id}/download">uh...</a> <img src="/courses/#{@course.id}/files/#{a2.id}/download"> HTML1 <a href="/courses/#{@course.id}/files/#{a3.id}/download">Hi</a> HTML2 class ApiClass include Api end expect(ApiClass.new.api_bulk_load_user_content_attachments( [html1, html2], @course )).to eq({a1.id => a1, a2.id => a2, a3.id => a3}) end end describe "latex_to_mathml" do it "returns mathml on success" do valid_latex = '\frac{a}{b}' expect(UserContent.latex_to_mathml(valid_latex)).to eql(%{<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mfrac><mrow><mi>a</mi></mrow><mrow><mi>b</mi></mrow></mfrac></math>}) end it "returns empty string on parse error" do invalid_latex = '\frac{a}{' expect(UserContent.latex_to_mathml(invalid_latex)).to eql('') end end describe "escape" do describe "with equation images" do context "valid latex" do before do @latex = '\frac{a}{b}' @html = "<img class='equation_image' alt='#{@latex}' />" end it "retains the alt attribute" do escaped = UserContent.escape(@html) node = Nokogiri::HTML::DocumentFragment.parse(escaped).css("img").first expect(node['alt']).to eql(@latex) end it "adds mathml in a span" do escaped = UserContent.escape(@html) node = Nokogiri::HTML::DocumentFragment.parse(escaped).css("img").first.next_sibling expect(node.node_name).to eql("span") expect(node.inner_html).to eql(Ritex::Parser.new.parse(@latex)) end end context "invalid latex" do before do @latex = '\frac{a}{' # incomplete @html = "<img class='equation_image' alt='#{@latex}' />" end it "handles error gracefully" do expect{ UserContent.escape(@html) }.not_to raise_error end it "retains the alt attribute" do escaped = UserContent.escape(@html) node = Nokogiri::HTML::DocumentFragment.parse(escaped).css("img").first expect(node['alt']).to eql(@latex) end it "doesn't add mathml span" do escaped = UserContent.escape(@html) node = Nokogiri::HTML::DocumentFragment.parse(escaped).css("span").first expect(node).to be_nil end end end end end
dgynn/canvas-lms
spec/apis/user_content_spec.rb
Ruby
agpl-3.0
26,172
[ 30522, 1001, 1001, 9385, 1006, 1039, 1007, 2249, 16021, 18300, 5397, 1010, 4297, 1012, 1001, 1001, 2023, 5371, 2003, 2112, 1997, 10683, 1012, 1001, 1001, 10683, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'test_helper' class QueriesControllerTest < ActionController::TestCase end
lolow/leaqweb
test/functional/queries_controller_test.rb
Ruby
mit
85
[ 30522, 5478, 1005, 3231, 1035, 2393, 2121, 1005, 2465, 10861, 5134, 8663, 13181, 10820, 22199, 1026, 2895, 8663, 13181, 10820, 1024, 1024, 3231, 18382, 2203, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.ragamania.bararaga.view.fragment.coaches; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import com.jcodecraeer.xrecyclerview.XRecyclerView; import com.ragamania.bararaga.R; import com.ragamania.bararaga.model.CoachesList; import com.ragamania.bararaga.view.activity.detail_list.DetailListActivity; import net.derohimat.baseapp.ui.fragment.BaseFragment; import net.derohimat.baseapp.ui.view.BaseRecyclerView; import java.util.List; import butterknife.Bind; /** * Created by wildangarviandi on 10/8/16. */ public class CoachesFragment extends BaseFragment implements CoachesMvpView { private static final String TAB_POSITION = "tab_position"; @Bind(R.id.recyclerview) BaseRecyclerView mRecyclerView; private CoachesPresenter mPresenter; private CoachesRecyclerAdapter mAdapter; public static CoachesFragment newInstance(int tabPosition) { CoachesFragment fragment = new CoachesFragment(); Bundle args = new Bundle(); args.putInt(TAB_POSITION, tabPosition); fragment.setArguments(args); return fragment; } @Override protected int getResourceLayout() { return R.layout.coaches_fragment; } @Override protected void onViewReady(@Nullable Bundle savedInstanceState) { setUpAdapter(); setUpRecyclerView(); setUpPresenter(); setHasOptionsMenu(true); } private void setUpAdapter() { mAdapter = new CoachesRecyclerAdapter(mContext); mAdapter.setOnItemClickListener((view, position) -> { gotoDetail(); }); } private void setUpRecyclerView() { LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); mRecyclerView.setLayoutManager(layoutManager); mRecyclerView.setAdapter(mAdapter); mRecyclerView.setPullRefreshEnabled(true); mRecyclerView.setLoadingMoreEnabled(false); mRecyclerView.setLoadingListener(new XRecyclerView.LoadingListener() { @Override public void onRefresh() { } @Override public void onLoadMore() { } }); } private void setUpPresenter() { mPresenter = new CoachesPresenter(getActivity()); mPresenter.attachView(this); mPresenter.loadCoachesList(); } @Override public void loadCoachesList(List<CoachesList> coachesList) { mAdapter.addAll(coachesList); mRecyclerView.refreshComplete(); } private void gotoDetail() { Intent i = new Intent(getActivity(), DetailListActivity.class); startActivity(i); getActivity().overridePendingTransition(0,0); } }
WildanGarviandi/Bararaga
app/src/main/java/com/ragamania/bararaga/view/fragment/coaches/CoachesFragment.java
Java
apache-2.0
2,888
[ 30522, 7427, 4012, 1012, 17768, 23093, 2401, 1012, 3347, 5400, 3654, 1012, 3193, 1012, 15778, 1012, 7850, 1025, 12324, 11924, 1012, 4180, 1012, 7848, 1025, 12324, 11924, 1012, 9808, 1012, 14012, 1025, 12324, 11924, 1012, 2490, 1012, 5754, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//>>excludeStart("jqmBuildExclude", pragmas.jqmBuildExclude); //>>group: exclude define([ "require", "./widgets/loader", "./events/navigate", "./navigation/path", "./navigation/history", "./navigation/navigator", "./navigation/method", "./transitions/handlers", "./transitions/visuals", "./animationComplete", "./navigation", "./degradeInputs", "./widgets/page.dialog", "./widgets/dialog", "./widgets/collapsible", "./widgets/collapsibleSet", "./fieldContain", "./grid", "./widgets/navbar", "./widgets/listview", "./widgets/listview.autodividers", "./widgets/listview.hidedividers", "./nojs", "./widgets/forms/checkboxradio", "./widgets/forms/button", "./widgets/forms/slider", "./widgets/forms/slider.tooltip", "./widgets/forms/flipswitch", "./widgets/forms/rangeslider", "./widgets/forms/textinput", "./widgets/forms/clearButton", "./widgets/forms/autogrow", "./widgets/forms/select.custom", "./widgets/forms/select", "./buttonMarkup", "./widgets/controlgroup", "./links", "./widgets/toolbar", "./widgets/fixedToolbar", "./widgets/fixedToolbar.workarounds", "./widgets/popup", "./widgets/popup.arrow", "./widgets/panel", "./widgets/table", "./widgets/table.columntoggle", "./widgets/table.reflow", "./widgets/filterable", "./widgets/filterable.backcompat", "./widgets/tabs", "./zoom", "./zoom/iosorientationfix" ], function( require ) { require( [ "./init" ], function() {} ); }); //>>excludeEnd("jqmBuildExclude");
ericsteele/retrospec.js
test/input/projects/jquery-mobile/rev-1.4.5-2ef45a1/js/jquery.mobile.js
JavaScript
mit
1,471
[ 30522, 1013, 1013, 1028, 1028, 23329, 14117, 2102, 1006, 1000, 1046, 4160, 14905, 19231, 3207, 2595, 20464, 12672, 1000, 1010, 10975, 8490, 9335, 1012, 1046, 4160, 14905, 19231, 3207, 2595, 20464, 12672, 1007, 1025, 1013, 1013, 1028, 1028, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>pi-agm: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.7.1+2 / pi-agm - 1.1.0</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> pi-agm <small> 1.1.0 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-02-24 14:39:15 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-02-24 14:39:15 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-num base Num library distributed with the OCaml compiler base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.7.1+2 Formal proof management system num 0 The Num library for arbitrary-precision integer and rational arithmetic ocaml 4.05.0 The OCaml compiler (virtual package) ocaml-base-compiler 4.05.0 Official 4.05.0 release ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; name: &quot;coq-pi-agm&quot; version: &quot;1.1.0&quot; maintainer: &quot;yves.bertot@inria.fr&quot; homepage: &quot;http://www-sop.inria.fr/members/Yves.Bertot/&quot; bug-reports: &quot;yves.bertot@inria.fr&quot; license: &quot;CeCILL-B&quot; build: [[&quot;coq_makefile&quot; &quot;-f&quot; &quot;_CoqProject&quot; &quot;-o&quot; &quot;Makefile&quot; ] [ make &quot;-j&quot; &quot;%{jobs}%&quot; ]] install: [ make &quot;install&quot; &quot;DEST=&#39;%{lib}%/coq/user-contrib/pi_agm&#39;&quot; ] remove: [ &quot;sh&quot; &quot;-c&quot; &quot;rm -rf &#39;%{lib}%/coq/user-contrib/pi_agm&#39;&quot; ] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.5&quot; &amp; &lt; &quot;8.7~&quot;} &quot;coq-mathcomp-ssreflect&quot; {&gt;= &quot;1.6.0&quot; &amp; &lt;= &quot;1.6.1&quot;} &quot;coq-coquelicot&quot; {&gt; &quot;2.1.1&quot; &amp; &lt;= &quot;2.1.2&quot;} &quot;coq-interval&quot; {= &quot;3.1.1&quot;} ] tags: [ &quot;keyword:real analysis&quot; &quot;keyword:pi&quot; &quot;category:Mathematics/Real Calculus and Topology&quot; ] authors: [ &quot;Yves Bertot &lt;yves.bertot@inria.fr&gt;&quot; ] synopsis: &quot;Computing thousands or millions of digits of PI with arithmetic-geometric means&quot; description: &quot;&quot;&quot; This is a proof of correctness for two algorithms to compute PI to high precision using arithmetic-geometric means. A first file contains the calculus-based proofs for an abstract view of the algorithm, where all numbers are real numbers. A second file describes how to approximate all computations using large integers. Other files describe the second algorithm which is close to the one used in mpfr, for instance. The whole development can be used to produce mathematically proved and formally verified approximations of PI.&quot;&quot;&quot; url { src: &quot;https://github.com/ybertot/pi-agm/archive/submitted-article-version-8-6.zip&quot; checksum: &quot;md5=4004421ecb7c185e3d269fb7ef944bdd&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-pi-agm.1.1.0 coq.8.7.1+2</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2). The following dependencies couldn&#39;t be met: - coq-pi-agm -&gt; coq-interval = 3.1.1 -&gt; coq &lt; 8.7 -&gt; ocaml &lt; 4.03.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-pi-agm.1.1.0</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
coq-bench/coq-bench.github.io
clean/Linux-x86_64-4.05.0-2.0.1/released/8.7.1+2/pi-agm/1.1.0.html
HTML
mit
7,887
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
steal('can/util', 'can/observe', function(can) { // ** - 'this' will be the deepest item changed // * - 'this' will be any changes within *, but * will be the // this returned // tells if the parts part of a delegate matches the broken up props of the event // gives the prop to use as 'this' // - parts - the attribute name of the delegate split in parts ['foo','*'] // - props - the split props of the event that happened ['foo','bar','0'] // - returns - the attribute to delegate too ('foo.bar'), or null if not a match var matches = function(parts, props){ //check props parts are the same or var len = parts.length, i =0, // keeps the matched props we will use matchedProps = [], prop; // if the event matches for(i; i< len; i++){ prop = props[i] // if no more props (but we should be matching them) // return null if( typeof prop !== 'string' ) { return null; } else // if we have a "**", match everything if( parts[i] == "**" ) { return props.join("."); } else // a match, but we want to delegate to "*" if (parts[i] == "*"){ // only do this if there is nothing after ... matchedProps.push(prop); } else if( prop === parts[i] ) { matchedProps.push(prop); } else { return null; } } return matchedProps.join("."); }, // gets a change event and tries to figure out which // delegates to call delegate = function(event, prop, how, newVal, oldVal){ // pre-split properties to save some regexp time var props = prop.split("."), delegates = (this._observe_delegates || []).slice(0), delegate, attr, matchedAttr, hasMatch, valuesEqual; event.attr = prop; event.lastAttr = props[props.length -1 ]; // for each delegate for(var i =0; delegate = delegates[i++];){ // if there is a batchNum, this means that this // event is part of a series of events caused by a single // attrs call. We don't want to issue the same event // multiple times // setting the batchNum happens later if((event.batchNum && delegate.batchNum === event.batchNum) || delegate.undelegated ){ continue; } // reset match and values tests hasMatch = undefined; valuesEqual = true; // for each attr in a delegate for(var a =0 ; a < delegate.attrs.length; a++){ attr = delegate.attrs[a]; // check if it is a match if(matchedAttr = matches(attr.parts, props)){ hasMatch = matchedAttr; } // if it has a value, make sure it's the right value // if it's set, we should probably check that it has a // value no matter what if(attr.value && valuesEqual /* || delegate.hasValues */){ valuesEqual = attr.value === ""+this.attr(attr.attr) } else if (valuesEqual && delegate.attrs.length > 1){ // if there are multiple attributes, each has to at // least have some value valuesEqual = this.attr(attr.attr) !== undefined } } // if there is a match and valuesEqual ... call back if(hasMatch && valuesEqual) { // how to get to the changed property from the delegate var from = prop.replace(hasMatch+".",""); // if this event is part of a batch, set it on the delegate // to only send one event if(event.batchNum ){ delegate.batchNum = event.batchNum } // if we listen to change, fire those with the same attrs // TODO: the attrs should probably be using from if( delegate.event === 'change' ){ arguments[1] = from; event.curAttr = hasMatch; delegate.callback.apply(this.attr(hasMatch), can.makeArray( arguments)); } else if(delegate.event === how ){ // if it's a match, callback with the location of the match delegate.callback.apply(this.attr(hasMatch), [event,newVal, oldVal, from]); } else if(delegate.event === 'set' && how == 'add' ) { // if we are listening to set, we should also listen to add delegate.callback.apply(this.attr(hasMatch), [event,newVal, oldVal, from]); } } } }; can.extend(can.Observe.prototype,{ /** * @function can.Observe.prototype.delegate * @parent can.Observe.delegate * @plugin can/observe/delegate * * `delegate( selector, event, handler(ev,newVal,oldVal,from) )` listen for changes * in a child attribute from the parent. The child attribute * does not have to exist. * * * // create an observable * var observe = can.Observe({ * foo : { * bar : "Hello World" * } * }) * * //listen to changes on a property * observe.delegate("foo.bar","change", function(ev, prop, how, newVal, oldVal){ * // foo.bar has been added, set, or removed * this //-> * }); * * // change the property * observe.attr('foo.bar',"Goodbye Cruel World") * * ## Types of events * * Delegate lets you listen to add, set, remove, and change events on property. * * __add__ * * An add event is fired when a new property has been added. * * var o = new can.Control({}); * o.delegate("name","add", function(ev, value){ * // called once * can.$('#name').show() * }) * o.attr('name',"Justin") * o.attr('name',"Brian"); * * Listening to add events is useful for 'setup' functionality (in this case * showing the <code>#name</code> element. * * __set__ * * Set events are fired when a property takes on a new value. set events are * always fired after an add. * * o.delegate("name","set", function(ev, value){ * // called twice * can.$('#name').text(value) * }) * o.attr('name',"Justin") * o.attr('name',"Brian"); * * __remove__ * * Remove events are fired after a property is removed. * * o.delegate("name","remove", function(ev){ * // called once * $('#name').text(value) * }) * o.attr('name',"Justin"); * o.removeAttr('name'); * * ## Wildcards - matching multiple properties * * Sometimes, you want to know when any property within some part * of an observe has changed. Delegate lets you use wildcards to * match any property name. The following listens for any change * on an attribute of the params attribute: * * var o = can.Control({ * options : { * limit : 100, * offset: 0, * params : { * parentId: 5 * } * } * }) * o.delegate('options.*','change', function(){ * alert('1'); * }) * o.delegate('options.**','change', function(){ * alert('2'); * }) * * // alerts 1 * // alerts 2 * o.attr('options.offset',100) * * // alerts 2 * o.attr('options.params.parentId',6); * * Using a single wildcard (<code>*</code>) matches single level * properties. Using a double wildcard (<code>**</code>) matches * any deep property. * * ## Listening on multiple properties and values * * Delegate lets you listen on multiple values at once. The following listens * for first and last name changes: * * var o = new can.Observe({ * name : {first: "Justin", last: "Meyer"} * }) * * o.bind("name.first,name.last", * "set", * function(ev,newVal,oldVal,from){ * * }) * * ## Listening when properties are a particular value * * Delegate lets you listen when a property is __set__ to a specific value: * * var o = new can.Observe({ * name : "Justin" * }) * * o.bind("name=Brian", * "set", * function(ev,newVal,oldVal,from){ * * }) * * @param {String} selector The attributes you want to listen for changes in. * * Selector should be the property or * property names of the element you are searching. Examples: * * "name" - listens to the "name" property changing * "name, address" - listens to "name" or "address" changing * "name address" - listens to "name" or "address" changing * "address.*" - listens to property directly in address * "address.**" - listens to any property change in address * "foo=bar" - listens when foo is "bar" * * @param {String} event The event name. One of ("set","add","remove","change") * @param {Function} handler(ev,newVal,oldVal,prop) The callback handler * called with: * * - newVal - the new value set on the observe * - oldVal - the old value set on the observe * - prop - the prop name that was changed * * @return {jQuery.Delegate} the delegate for chaining */ delegate : function(selector, event, handler){ selector = can.trim(selector); var delegates = this._observe_delegates || (this._observe_delegates = []), attrs = []; // split selector by spaces selector.replace(/([^\s=]+)=?([^\s]+)?/g, function(whole, attr, value){ attrs.push({ // the attribute name attr: attr, // the attribute's pre-split names (for speed) parts: attr.split('.'), // the value associated with this prop value: value }) }); // delegates has pre-processed info about the event delegates.push({ // the attrs name for unbinding selector : selector, // an object of attribute names and values {type: 'recipe',id: undefined} // undefined means a value was not defined attrs : attrs, callback : handler, event: event }); if(delegates.length === 1){ this.bind("change",delegate) } return this; }, /** * @function can.Observe.prototype.undelegate * @parent can.Observe.delegate * * `undelegate( selector, event, handler )` removes a delegated event handler from an observe. * * observe.undelegate("name","set", handler ) * * @param {String} selector the attribute name of the object you want to undelegate from. * @param {String} event the event name * @param {Function} handler the callback handler * @return {jQuery.Delegate} the delegate for chaining */ undelegate : function(selector, event, handler){ selector = can.trim(selector); var i =0, delegates = this._observe_delegates || [], delegateOb; if(selector){ while(i < delegates.length){ delegateOb = delegates[i]; if( delegateOb.callback === handler || (!handler && delegateOb.selector === selector) ){ delegateOb.undelegated = true; delegates.splice(i,1) } else { i++; } } } else { // remove all delegates delegates = []; } if(!delegates.length){ //can.removeData(this, "_observe_delegates"); this.unbind("change",delegate) } return this; } }); // add helpers for testing .. can.Observe.prototype.delegate.matches = matches; return can.Observe; })
SpredfastLegacy/canjs
observe/delegate/delegate.js
JavaScript
mit
11,161
[ 30522, 8954, 1006, 1005, 2064, 1013, 21183, 4014, 1005, 1010, 1005, 2064, 1013, 11949, 1005, 1010, 3853, 1006, 2064, 1007, 1063, 1013, 1013, 1008, 1008, 1011, 1005, 2023, 1005, 2097, 2022, 1996, 17578, 8875, 2904, 1013, 1013, 1008, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / | # | | |___| | | | __/ (__| < | | | | . \ | # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ | # | | # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de | # +------------------------------------------------------------------+ # # This file is part of Check_MK. # The official homepage is at http://mathias-kettner.de/check_mk. # # check_mk 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 in version 2. check_mk is distributed # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with- # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. See the GNU General Public License for more de- # ails. You should have received a copy of the GNU General Public # License along with GNU Make; see the file COPYING. If not, write # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. import config loaded_with_language = False # .----------------------------------------------------------------------. # | ____ _ _ | # | | _ \ ___ _ __ _ __ ___ (_)___ ___(_) ___ _ __ ___ | # | | |_) / _ \ '__| '_ ` _ \| / __/ __| |/ _ \| '_ \/ __| | # | | __/ __/ | | | | | | | \__ \__ \ | (_) | | | \__ \ | # | |_| \___|_| |_| |_| |_|_|___/___/_|\___/|_| |_|___/ | # | | # +----------------------------------------------------------------------+ # | Declare general permissions for Multisite | # '----------------------------------------------------------------------' def load(): global loaded_with_language if loaded_with_language == current_language: return config.declare_permission_section("general", _('General Permissions'), 10) config.declare_permission("general.use", _("Use Multisite at all"), _("Users without this permission are not let in at all"), [ "admin", "user", "guest" ]) config.declare_permission("general.see_all", _("See all Nagios objects"), _("See all objects regardless of contacts and contact groups. " "If combined with 'perform commands' then commands may be done on all objects."), [ "admin", "guest" ]) declare_visual_permissions('views', _("views")) declare_visual_permissions('dashboards', _("dashboards")) config.declare_permission("general.view_option_columns", _("Change view display columns"), _("Interactively change the number of columns being displayed by a view (does not edit or customize the view)"), [ "admin", "user", "guest" ]) config.declare_permission("general.view_option_refresh", _("Change view display refresh"), _("Interactively change the automatic browser reload of a view being displayed (does not edit or customize the view)"), [ "admin", "user" ]) config.declare_permission("general.painter_options", _("Change column display options"), _("Some of the display columns offer options for customizing their output. " "For example time stamp columns can be displayed absolute, relative or " "in a mixed style. This permission allows the user to modify display options"), [ "admin", "user", "guest" ]) config.declare_permission("general.act", _("Perform commands"), _("Allows users to perform Nagios commands. If no further permissions " "are granted, actions can only be done on objects one is a contact for"), [ "admin", "user" ]) config.declare_permission("general.see_sidebar", _("Use Check_MK sidebar"), _("Without this permission the Check_MK sidebar will be invisible"), [ "admin", "user", "guest" ]) config.declare_permission("general.configure_sidebar", _("Configure sidebar"), _("This allows the user to add, move and remove sidebar snapins."), [ "admin", "user" ]) config.declare_permission('general.edit_profile', _('Edit the user profile'), _('Permits the user to change the user profile settings.'), [ 'admin', 'user' ] ) config.declare_permission('general.edit_notifications', _('Edit personal notification settings'), _('This allows a user to edit his personal notification settings. You also need the permission ' '<i>Edit the user profile</i> in order to do this.'), [ 'admin', 'user' ] ) config.declare_permission('general.disable_notifications', _('Disable all personal notifications'), _('This permissions provides a checkbox in the personal settings of the user that ' 'allows him to completely disable all of his notifications. Use with caution.'), [ 'admin', ] ) config.declare_permission('general.edit_user_attributes', _('Edit personal user attributes'), _('This allows a user to edit his personal user attributes. You also need the permission ' '<i>Edit the user profile</i> in order to do this.'), [ 'admin', 'user' ] ) config.declare_permission('general.change_password', _('Edit the user password'), _('Permits the user to change the password.'), [ 'admin', 'user' ] ) config.declare_permission('general.logout', _('Logout'), _('Permits the user to logout.'), [ 'admin', 'user', 'guest' ] ) config.declare_permission("general.ignore_soft_limit", _("Ignore soft query limit"), _("Allows to ignore the soft query limit imposed upon the number of datasets returned by a query"), [ "admin", "user" ]) config.declare_permission("general.ignore_hard_limit", _("Ignore hard query limit"), _("Allows to ignore the hard query limit imposed upon the number of datasets returned by a query"), [ "admin" ]) loaded_with_language = current_language # TODO: This has been obsoleted by pagetypes.py def declare_visual_permissions(what, what_plural): config.declare_permission("general.edit_" + what, _("Customize %s and use them") % what_plural, _("Allows to create own %s, customize builtin %s and use them.") % (what_plural, what_plural), [ "admin", "user" ]) config.declare_permission("general.publish_" + what, _("Publish %s") % what_plural, _("Make %s visible and usable for other users.") % what_plural, [ "admin", "user" ]) config.declare_permission("general.see_user_" + what, _("See user %s") % what_plural, _("Is needed for seeing %s that other users have created.") % what_plural, [ "admin", "user", "guest" ]) config.declare_permission("general.force_" + what, _("Modify builtin %s") % what_plural, _("Make own published %s override builtin %s for all users.") % (what_plural, what_plural), [ "admin" ]) config.declare_permission("general.delete_foreign_" + what, _("Delete foreign %s") % what_plural, _("Allows to delete %s created by other users.") % what_plural, [ "admin" ])
xorpaul/check_mk
web/htdocs/default_permissions.py
Python
gpl-2.0
7,863
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 18750, 1001, 1011, 1008, 1011, 17181, 1024, 21183, 2546, 1011, 1022, 1025, 1052, 2100, 1011, 27427, 4765, 1011, 16396, 1024, 1018, 1011, 1008, 1011, 1001, 1009, 1011, 1011, 1011, 1011, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <!-- | Generated by Apache Maven Doxia at 2014-11-08 | Rendered using Apache Maven Fluido Skin 1.3.1 --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20141108" /> <meta http-equiv="Content-Language" content="en" /> <title>SBT Compilers &#x2013; Project Modules</title> <link rel="stylesheet" href="./css/apache-maven-fluido-1.3.1.min.css" /> <link rel="stylesheet" href="./css/site.css" /> <link rel="stylesheet" href="./css/print.css" media="print" /> <script type="text/javascript" src="./js/apache-maven-fluido-1.3.1.min.js"></script> <link rel="stylesheet" type="text/css" href="./css/site.css"/> </head> <body class="topBarDisabled"> <div class="container-fluid"> <div id="banner"> <div class="pull-left"> <div id="bannerLeft"> <h2>SBT Compilers</h2> </div> </div> <div class="pull-right"> </div> <div class="clear"><hr/></div> </div> <div id="breadcrumbs"> <ul class="breadcrumb"> <li id="publishDate">Last Published: 2014-11-08 <span class="divider">|</span> </li> <li id="projectVersion">Version: 1.0.0-beta5 </li> </ul> </div> <div class="row-fluid"> <div id="leftColumn" class="span3"> <div class="well sidebar-nav"> <ul class="nav nav-list"> <li class="nav-header">Parent Project</li> <li> <a href="../index.html" title="SBT Compiler"> <i class="none"></i> SBT Compiler</a> </li> <li class="nav-header">Modules</li> <li> <a href="sbt-compiler-sbt012/index.html" title="SBT Compiler for SBT 0.12"> <i class="none"></i> SBT Compiler for SBT 0.12</a> </li> <li> <a href="sbt-compiler-sbt013/index.html" title="SBT Compiler for SBT 0.13"> <i class="none"></i> SBT Compiler for SBT 0.13</a> </li> <li> <a href="sbt-compiler-sbt0131/index.html" title="SBT Compiler for SBT 0.13.1"> <i class="none"></i> SBT Compiler for SBT 0.13.1</a> </li> <li> <a href="sbt-compiler-sbt0132/index.html" title="SBT Compiler for SBT 0.13.2"> <i class="none"></i> SBT Compiler for SBT 0.13.2</a> </li> <li> <a href="sbt-compiler-sbt0135/index.html" title="SBT Compiler for SBT 0.13.5"> <i class="none"></i> SBT Compiler for SBT 0.13.5</a> </li> <li class="nav-header">Project Documentation</li> <li> <a href="project-info.html" title="Project Information"> <i class="icon-chevron-down"></i> Project Information</a> <ul class="nav nav-list"> <li> <a href="index.html" title="About"> <i class="none"></i> About</a> </li> <li> <a href="plugin-management.html" title="Plugin Management"> <i class="none"></i> Plugin Management</a> </li> <li> <a href="distribution-management.html" title="Distribution Management"> <i class="none"></i> Distribution Management</a> </li> <li> <a href="dependency-info.html" title="Dependency Information"> <i class="none"></i> Dependency Information</a> </li> <li> <a href="source-repository.html" title="Source Repository"> <i class="none"></i> Source Repository</a> </li> <li> <a href="mail-lists.html" title="Mailing Lists"> <i class="none"></i> Mailing Lists</a> </li> <li> <a href="issue-tracking.html" title="Issue Tracking"> <i class="none"></i> Issue Tracking</a> </li> <li> <a href="integration.html" title="Continuous Integration"> <i class="none"></i> Continuous Integration</a> </li> <li> <a href="plugins.html" title="Project Plugins"> <i class="none"></i> Project Plugins</a> </li> <li> <a href="license.html" title="Project License"> <i class="none"></i> Project License</a> </li> <li class="active"> <a href="#"><i class="none"></i>Project Modules</a> </li> <li> <a href="team-list.html" title="Project Team"> <i class="none"></i> Project Team</a> </li> <li> <a href="project-summary.html" title="Project Summary"> <i class="none"></i> Project Summary</a> </li> <li> <a href="dependencies.html" title="Dependencies"> <i class="none"></i> Dependencies</a> </li> </ul> </li> </ul> <hr /> <div id="poweredBy"> <div class="clear"></div> <div class="clear"></div> <div class="clear"></div> <div class="clear"></div> <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy"> <img class="builtBy" alt="Built by Maven" src="./images/logos/maven-feather.png" /> </a> </div> </div> </div> <div id="bodyColumn" class="span9" > <div class="section"> <h2><a name="Project_Modules"></a>Project Modules</h2><a name="Project_Modules"></a> <p>This project has declared the following modules:</p> <table border="0" class="table table-striped"> <tr class="a"> <th>Name</th> <th>Description</th></tr> <tr class="b"> <td><a href="sbt-compiler-sbt012/index.html">SBT Compiler for SBT 0.12</a></td> <td>SBT Compiler for SBT 0.12</td></tr> <tr class="a"> <td><a href="sbt-compiler-sbt013/index.html">SBT Compiler for SBT 0.13</a></td> <td>SBT Compiler for SBT 0.13</td></tr> <tr class="b"> <td><a href="sbt-compiler-sbt0131/index.html">SBT Compiler for SBT 0.13.1</a></td> <td>SBT Compiler for SBT 0.13.1</td></tr> <tr class="a"> <td><a href="sbt-compiler-sbt0132/index.html">SBT Compiler for SBT 0.13.2</a></td> <td>SBT Compiler for SBT 0.13.2</td></tr> <tr class="b"> <td><a href="sbt-compiler-sbt0135/index.html">SBT Compiler for SBT 0.13.5</a></td> <td>SBT Compiler for SBT 0.13.5</td></tr></table></div> </div> </div> </div> <hr/> <footer> <div class="container-fluid"> <div class="row-fluid"> <p >Copyright &copy; 2013&#x2013;2014. All rights reserved. </p> </div> </div> </footer> </body> </html>
sbt-compiler-maven-plugin/sbt-compiler-maven-plugin.github.io
sbt-compiler-maven-plugin/1.0.0-beta5/sbt-compilers/modules.html
HTML
apache-2.0
8,858
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 999, 1011, 1011, 1064, 7013, 2011, 15895, 5003, 8159, 2079, 14787, 2012, 2297, 1011, 2340, 1011, 5511, 1064, 10155, 2478, 15895, 5003, 8159, 8331, 2080, 3096, 1015, 1012, 1017, 1012, 1015, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
## # This file is part of WhatWeb and may be subject to # redistribution and commercial restrictions. Please see the WhatWeb # web site for more information on licensing and terms of use. # https://morningstarsecurity.com/research/whatweb ## Plugin.define do name "ExtremeWare" authors [ "Brendan Coles <bcoles@gmail.com>", # 2011-11-21 ] version "0.1" description "Extreme Networks ExtremeWare device" website "http://www.extremenetworks.com/services/software-userguide.aspx" # ShodanHQ results as at 2011-11-21 # # 250 for ExtremeWare # Google results as at 2011-11-21 # # 50 for intitle:"ExtremeWare Management Interface" # Dorks # dorks [ 'intitle:"ExtremeWare Management Interface"' ] # Matches # matches [ # Version Detection # HTTP Server Header { :search=>"headers[server]", :version=>/^ExtremeWare\/([^\s]+)$/ }, # /Images/extremelogan { :md5=>"a18d6970836e3302e4d6d085e8f9d31b", :url=>"/Images/extremelogan" }, { :md5=>"bf368990304c878ce2924bc21b3f06d9", :url=>"/Images/extremelogan" }, # / # Title { :text=>'<title>ExtremeWare Management Interface</title>' }, # /extremetop # Logo HTML { :text=>'<center><img src="Images/extremelogan"><a href="extremebasepage" target="_top"><h2>Logon</h2></a><P><P><TABLE BORDER="0"><TR><TD NOWRAP><TT><FONT COLOR="#000000">' }, ] end
urbanadventurer/WhatWeb
plugins/extremeware.rb
Ruby
gpl-2.0
1,295
[ 30522, 1001, 1001, 1001, 2023, 5371, 2003, 2112, 1997, 2054, 8545, 2497, 1998, 2089, 2022, 3395, 2000, 1001, 25707, 1998, 3293, 9259, 1012, 3531, 2156, 1996, 2054, 8545, 2497, 1001, 4773, 2609, 2005, 2062, 2592, 2006, 13202, 1998, 3408, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include "b_local.h" #include "g_nav.h" void Remote_Strafe(gentity_t *aiEnt); #define VELOCITY_DECAY 0.85f //Local state enums enum { LSTATE_NONE = 0, }; void Remote_Idle(gentity_t *aiEnt); void NPC_Remote_Precache(void) { G_SoundIndex("sound/chars/remote/misc/fire.wav"); G_SoundIndex( "sound/chars/remote/misc/hiss.wav"); G_EffectIndex( "env/small_explode"); } /* ------------------------- NPC_Remote_Pain ------------------------- */ void NPC_Remote_Pain(gentity_t *self, gentity_t *attacker, int damage) { Remote_Strafe(self); NPC_Pain( self, attacker, damage ); } /* ------------------------- Remote_MaintainHeight ------------------------- */ void Remote_MaintainHeight( gentity_t *aiEnt) { float dif; // Update our angles regardless NPC_UpdateAngles(aiEnt, qtrue, qtrue ); if ( aiEnt->client->ps.velocity[2] ) { aiEnt->client->ps.velocity[2] *= VELOCITY_DECAY; if ( fabs( aiEnt->client->ps.velocity[2] ) < 2 ) { aiEnt->client->ps.velocity[2] = 0; } } // If we have an enemy, we should try to hover at or a little below enemy eye level if ( aiEnt->enemy ) { if (TIMER_Done( aiEnt, "heightChange")) { TIMER_Set( aiEnt,"heightChange",Q_irand( 1000, 3000 )); // Find the height difference dif = (aiEnt->enemy->r.currentOrigin[2] + Q_irand( 0, aiEnt->enemy->r.maxs[2]+8 )) - aiEnt->r.currentOrigin[2]; // cap to prevent dramatic height shifts if ( fabs( dif ) > 2 ) { if ( fabs( dif ) > 24 ) { dif = ( dif < 0 ? -24 : 24 ); } dif *= 10; aiEnt->client->ps.velocity[2] = (aiEnt->client->ps.velocity[2]+dif)/2; // NPC->fx_time = level.time; G_Sound( aiEnt, CHAN_AUTO, G_SoundIndex("sound/chars/remote/misc/hiss.wav")); } } } else { gentity_t *goal = NULL; if ( aiEnt->NPC->goalEntity ) // Is there a goal? { goal = aiEnt->NPC->goalEntity; } else { goal = aiEnt->NPC->lastGoalEntity; } if ( goal ) { dif = goal->r.currentOrigin[2] - aiEnt->r.currentOrigin[2]; if ( fabs( dif ) > 24 ) { dif = ( dif < 0 ? -24 : 24 ); aiEnt->client->ps.velocity[2] = (aiEnt->client->ps.velocity[2]+dif)/2; } } } // Apply friction if ( aiEnt->client->ps.velocity[0] ) { aiEnt->client->ps.velocity[0] *= VELOCITY_DECAY; if ( fabs( aiEnt->client->ps.velocity[0] ) < 1 ) { aiEnt->client->ps.velocity[0] = 0; } } if ( aiEnt->client->ps.velocity[1] ) { aiEnt->client->ps.velocity[1] *= VELOCITY_DECAY; if ( fabs( aiEnt->client->ps.velocity[1] ) < 1 ) { aiEnt->client->ps.velocity[1] = 0; } } } #define REMOTE_STRAFE_VEL 256 #define REMOTE_STRAFE_DIS 200 #define REMOTE_UPWARD_PUSH 32 /* ------------------------- Remote_Strafe ------------------------- */ void Remote_Strafe(gentity_t *aiEnt) { int dir; vec3_t end, right; trace_t tr; AngleVectors( aiEnt->client->renderInfo.eyeAngles, NULL, right, NULL ); // Pick a random strafe direction, then check to see if doing a strafe would be // reasonable valid dir = ( rand() & 1 ) ? -1 : 1; VectorMA( aiEnt->r.currentOrigin, REMOTE_STRAFE_DIS * dir, right, end ); trap->Trace( &tr, aiEnt->r.currentOrigin, NULL, NULL, end, aiEnt->s.number, MASK_SOLID, qfalse, 0, 0 ); // Close enough if ( tr.fraction > 0.9f ) { VectorMA( aiEnt->client->ps.velocity, REMOTE_STRAFE_VEL * dir, right, aiEnt->client->ps.velocity ); G_Sound( aiEnt, CHAN_AUTO, G_SoundIndex("sound/chars/remote/misc/hiss.wav")); // Add a slight upward push aiEnt->client->ps.velocity[2] += REMOTE_UPWARD_PUSH; // Set the strafe start time so we can do a controlled roll // NPC->fx_time = level.time; aiEnt->NPC->standTime = level.time + 3000 + random() * 500; } } #define REMOTE_FORWARD_BASE_SPEED 10 #define REMOTE_FORWARD_MULTIPLIER 5 /* ------------------------- Remote_Hunt ------------------------- */ void Remote_Hunt(gentity_t *aiEnt, qboolean visible, qboolean advance, qboolean retreat ) { float distance, speed; vec3_t forward; //If we're not supposed to stand still, pursue the player if ( aiEnt->NPC->standTime < level.time ) { // Only strafe when we can see the player if ( visible ) { Remote_Strafe(aiEnt); return; } } //If we don't want to advance, stop here if ( advance == qfalse && visible == qtrue ) return; //Only try and navigate if the player is visible if ( visible == qfalse ) { // Move towards our goal aiEnt->NPC->goalEntity = aiEnt->enemy; aiEnt->NPC->goalRadius = 12; //Get our direction from the navigator if we can't see our target if ( NPC_GetMoveDirection(aiEnt, forward, &distance ) == qfalse ) return; } else { VectorSubtract( aiEnt->enemy->r.currentOrigin, aiEnt->r.currentOrigin, forward ); /*distance = */VectorNormalize( forward ); } speed = REMOTE_FORWARD_BASE_SPEED + REMOTE_FORWARD_MULTIPLIER * g_npcspskill.integer; if ( retreat == qtrue ) { speed *= -1; } VectorMA( aiEnt->client->ps.velocity, speed, forward, aiEnt->client->ps.velocity ); } /* ------------------------- Remote_Fire ------------------------- */ void Remote_Fire (gentity_t *aiEnt) { vec3_t delta1, enemy_org1, muzzle1; vec3_t angleToEnemy1; static vec3_t forward, vright, up; // static vec3_t muzzle; gentity_t *missile; CalcEntitySpot( aiEnt->enemy, SPOT_HEAD, enemy_org1 ); VectorCopy( aiEnt->r.currentOrigin, muzzle1 ); VectorSubtract (enemy_org1, muzzle1, delta1); vectoangles ( delta1, angleToEnemy1 ); AngleVectors (angleToEnemy1, forward, vright, up); missile = CreateMissile( aiEnt->r.currentOrigin, forward, 1000, 10000, aiEnt, qfalse ); G_PlayEffectID( G_EffectIndex("bryar/muzzle_flash"), aiEnt->r.currentOrigin, forward ); missile->classname = "briar"; missile->s.weapon = WP_MODULIZED_WEAPON; missile->damage = 10; missile->dflags = DAMAGE_DEATH_KNOCKBACK; missile->methodOfDeath = MOD_BRYAR_PISTOL; missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER; } /* ------------------------- Remote_Ranged ------------------------- */ void Remote_Ranged(gentity_t *aiEnt, qboolean visible, qboolean advance, qboolean retreat ) { if ( TIMER_Done( aiEnt, "attackDelay" ) ) // Attack? { TIMER_Set( aiEnt, "attackDelay", Q_irand( 500, 3000 ) ); Remote_Fire(aiEnt); } if ( aiEnt->NPC->scriptFlags & SCF_CHASE_ENEMIES ) { Remote_Hunt(aiEnt, visible, advance, retreat ); } } #define MIN_MELEE_RANGE 320 #define MIN_MELEE_RANGE_SQR ( MIN_MELEE_RANGE * MIN_MELEE_RANGE ) #define MIN_DISTANCE 80 #define MIN_DISTANCE_SQR ( MIN_DISTANCE * MIN_DISTANCE ) /* ------------------------- Remote_Attack ------------------------- */ void Remote_Attack(gentity_t *aiEnt) { float distance; qboolean visible; float idealDist; qboolean advance, retreat; if ( TIMER_Done(aiEnt,"spin") ) { TIMER_Set( aiEnt, "spin", Q_irand( 250, 1500 ) ); aiEnt->NPC->desiredYaw += Q_irand( -200, 200 ); } // Always keep a good height off the ground Remote_MaintainHeight(aiEnt); // If we don't have an enemy, just idle if ( NPC_CheckEnemyExt(aiEnt, qfalse) == qfalse ) { Remote_Idle(aiEnt); return; } // Rate our distance to the target, and our visibilty distance = (int) DistanceHorizontalSquared( aiEnt->r.currentOrigin, aiEnt->enemy->r.currentOrigin ); visible = NPC_ClearLOS4(aiEnt, aiEnt->enemy ); idealDist = MIN_DISTANCE_SQR+(MIN_DISTANCE_SQR*flrand( 0, 1 )); advance = (qboolean)(distance > idealDist*1.25); retreat = (qboolean)(distance < idealDist*0.75); // If we cannot see our target, move to see it if ( visible == qfalse ) { if ( aiEnt->NPC->scriptFlags & SCF_CHASE_ENEMIES ) { Remote_Hunt(aiEnt, visible, advance, retreat ); return; } } Remote_Ranged(aiEnt, visible, advance, retreat ); } /* ------------------------- Remote_Idle ------------------------- */ void Remote_Idle(gentity_t *aiEnt) { Remote_MaintainHeight(aiEnt); NPC_BSIdle(aiEnt); } /* ------------------------- Remote_Patrol ------------------------- */ void Remote_Patrol(gentity_t *aiEnt) { Remote_MaintainHeight(aiEnt); //If we have somewhere to go, then do that if (!aiEnt->enemy) { if ( UpdateGoal(aiEnt) ) { //start loop sound once we move aiEnt->client->pers.cmd.buttons |= BUTTON_WALKING; NPC_MoveToGoal(aiEnt, qtrue ); } } NPC_UpdateAngles(aiEnt, qtrue, qtrue ); } /* ------------------------- NPC_BSRemote_Default ------------------------- */ void NPC_BSRemote_Default(gentity_t *aiEnt) { if ( aiEnt->enemy ) Remote_Attack(aiEnt); else if ( aiEnt->NPC->scriptFlags & SCF_LOOK_FOR_ENEMIES ) Remote_Patrol(aiEnt); else Remote_Idle(aiEnt); }
Stoiss/Rend2
codemp/game/NPC_AI_Remote.cpp
C++
gpl-2.0
8,510
[ 30522, 1001, 2421, 1000, 1038, 1035, 2334, 1012, 1044, 1000, 1001, 2421, 1000, 1043, 1035, 6583, 2615, 1012, 1044, 1000, 11675, 6556, 1035, 2358, 27528, 2063, 1006, 8991, 3775, 3723, 1035, 1056, 1008, 9932, 4765, 1007, 1025, 1001, 9375, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<link rel="import" href="..\..\bower_components/polymer/polymer.html"> <link rel="stylesheet" type="text/css" href="../../styles/styles.css"> <link rel="import" href="../../bower_components/paper-listbox/paper-listbox.html"> <link rel="import" href="../../bower_components/paper-input/paper-input.html"> <link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html"> <link rel="import" href="../../bower_components/paper-menu/paper-menu.html"> <link rel="import" href="../../bower_components/paper-input/paper-textarea.html"> <link rel="import" href="../../bower_components/paper-button/paper-button.html"> <link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html"> <link rel="import" href="../../bower_components/paper-item/paper-item.html"> <link rel="import" href="../../bower_components/paper-toast/paper-toast.html"> <link rel="import" href="../../bower_components/iron-autogrow-textarea/iron-autogrow-textarea.html"> <link rel="import" href="../login-service/login-service.html"> <link rel="import" href="../studentdropdown-card/studentdropdown-card.html"> <!-- <script src="https://js.pusher.com/3.1/pusher.min.js"></script> --> <!-- <script src="bower_components/pusher/dist/web/pusher.min.js"></script> --> <!-- <script src="../scripts/pusher.min.js"></script> --> <dom-module id="login-form"> <template> <style> .button{ @apply(--layout-center); } .or{ @apply(--layout-center); margin-left: 45%; } .sub{ background-color: #4e688c; } .admin{ margin-top: 5%; font-size: 12px; cursor: pointer; } .backicon{ width:36%; } .reg{ float: left !important; } .activate{ float: right !important; right: 0; } .signup{ width:100%; } .forgotpass{ width: 100% !important; } #successdialog paper-button, .dialoghere paper-button{ text-align: center; margin: 0 auto; } #one{ float: left; position: absolute; left: 0; margin-left: 0; } #two{ float: center; position: absolute; right: 0; width: 230px; margin-right: 44%; } #three{ float: right; position: absolute; left: 60%; width: 40%; } #admin{ width: 75%; } #parent-icon{ width: 38%; } @media screen and (min-width: 767px) and (max-width: 1225px){ #one { float: left; width:33.33%; } #one paper-icon-button{ width: 75%; } #two{ float: none; width:33.33%; } #two paper-icon-button{ width: 75%; margin-left: 35%; } #three{ float: right; margin-left: 8%; width:33.33%; } #three paper-icon-button{ width: 75%; } } @media screen and (max-width: 767px) { #one { float: none; margin: 70% 0%; width:100%; } #one paper-icon-button{ width: 50%; } #two{ float: none; margin: 0; padding: 0; width:100%; } #three{ float: none; width:50%; margin: 135% 0 25% -35%; } #two paper-icon-button{ width: 50%; padding-top: 2%; margin-top: 2%; } #three paper-icon-button{ width:100%; } } </style> <div class="background-img" style="background-image: url('../../images/schools-bg1.jpg');background-repeat: no-repeat; position: fixed; width: 100%;min-height: 100%;"> <div style="width:30%; margin:10% auto;"> <div class="row"> <input type="hidden" name="role" value="{{role}}"> <div class="container login-card"> <paper-tabs> <paper-tab on-click="Fnparent"> Parent </paper-tab> <paper-tab on-click="hideParentLogin"> Staff </paper-tab> <paper-tab on-click="admin"> Management </paper-tab> </paper-tabs> <!-- <div class="backicon"> <paper-icon-button class="iconbutton" on-click="back" src="../../images/schoollogo.jpg"></paper-icon-button> </div> --> <div class="icon"> <paper-icon-button class="iconbutton" src="../../images/schoollogo.png"></paper-icon-button> </div> <div class="field" id="mob"> <paper-input label="Mobile Number" value="{{mobile}}" id="mobile" allowed-pattern="[0-9]" required error-message="Mobile Number"></paper-input> </div> <div class="field" id="mobilepass" > <paper-input label="Password" type="password" value="{{pass}}" id="parentpass" on-change="mobileno" required error-message="Password"></paper-input> </div> <div class="field"> <paper-input label="Username" value="{{username}}" id="user" on-change="loginid"></paper-input> </div> <div class="field"> <paper-input type="password" label="Passwords" value="{{password}}" id="pass"></paper-input> </div> <div class="button"> <paper-button id="sub" class="sub" on-click="login">LOGIN</paper-button> </div> <!-- <div> <ahref id="admin" class="admin" on-click="butclick"><u>{{butname}}</u></ahref> </div> --> <div id="id"> <div class="signup" style="margin-top:40px;"> <div class="buttons reg" style="color:#4e688c;"> <ahref class="admin" on-click="link"><u>Register Here..!</u></ahref> </div> <div class="buttons activate" style="color:#4e688c;"> <ahref class="admin" on-click="link2"><u>Activate</u></ahref> </div> <div class="buttons" style="text-align:center; color:#4e688c;"> <ahref class="admin forgotpass" on-click="link3"><u>Forgot Password?</u></ahref> </div> </div> </div> </div> <div> <paper-dialog id="registered"> <h2>Activate Here</h2> <paper-dialog-scrollable> <div class="field"> <paper-input class="field" id="regno" label="Newly Registered Mobile No" value="{{newregmob}}" required auto-validate error-message="Need a Mobile Number!"></paper-input> </div> <div class="field"> <paper-input class="field" id="verifyno" label="Verification Key" value="{{verify}}" required auto-validate error-message="Need a Verification Key"></paper-input> </div> <div class="field"> <paper-input class="field" id="passnew" type="password" on-change="newpass" label="Password" value="{{newpassword}}" required auto-validate error-message="Need a Password!" ></paper-input> </div> <div class="field"> <paper-input class="field" id="passconfirm" type="password" on-change="confirmpass" value="{{confirmpassword}}" label="Confirm Password" required auto-validate error-message="Need a Password!"></paper-input> </div> <p style="color:red;" id="passemptyerrormsg">Password and Confirm Password Should not be empty.</p> <p style="color:red;" id="passerrormsg">Password and Confirm Password Should be same.</p> </paper-dialog-scrollable> <div class="buttons" style="width:20% !important; text-align:center; margin: 0 auto;"> <paper-button on-click="activate" >Activate</paper-button> </div> </paper-dialog> </div> <paper-dialog id="dialoghere"> <h2>{{replyhere}}</h2> <div class="buttons"> <paper-button on-click="exit">Ok</paper-button> </div> </paper-dialog> </div> <paper-toast id="toast" text="Account is Activated! Please login.."></paper-toast> <paper-dialog id="forgot"> <h2>Get new Password</h2> <paper-dialog-scrollable> <paper-input class="field" label="Enter Registered Mobile No" value="{{regmob}}"></paper-input> </paper-dialog-scrollable> <div class="buttons"> <paper-button on-click="subforgot" >Submit</paper-button> </div> </paper-dialog> <paper-dialog id="dialoghere"> <h2>{{replyhere}}</h2> <div class="buttons"> <paper-button on-click="exit">Ok</paper-button> </div> </paper-dialog> <paper-dialog id="successdialog"> <h2>{{successreply}}</h2> <div class="buttons"> <paper-button on-click="successexit">Ok</paper-button> </div> </paper-dialog> <paper-dialog id="invaliddialog"> <h2>{{invalidreply}}</h2> <div class="buttons"> <paper-button on-click="invalidexit">Ok</paper-button> </div> </paper-dialog> </div> </div> <paper-dialog id="dialogqwertyu"> <h2>{{replyhere}}</h2> <div class="buttons"> <paper-button on-click="exit">Ok</paper-button> </div> </paper-dialog> <paper-dialog modal id="selectchild" style="text-align:center; margin: 0 auto;"> <h3>Select Your Child</h3> <paper-dropdown-menu label="Student" id="drop"> <paper-listbox id="student" class="dropdown-content" required on-iron-select="student" valueattr="value"> <template is="dom-repeat" items="{{studentarr}}" as="view"> <paper-item value="{{view.student_id}}">{{view.student_name}}</paper-item> </template> </paper-listbox> </paper-dropdown-menu> </paper-dialog> <login-service id="login"></login-service> <query-post id="qpostid"></query-post> <!-- <paper-button on-click="FnClick">Click</paper-button> <iron-ajax id="notifyajax" method="post" url="{{notifyurl}}" params="{{notifyparam}}" handle-as="json" content-type="application/json" on-response="notifyResponse" debounce-duration="300" >--> </template> <!-- <script src="//d3dy5gmtp8yhk7.cloudfront.net/2.0/pusher.min.js"></script> <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script> // Log debug information to the JavaScript console, if possible Pusher.log = function( msg ) { if( window.console && window.console.log ) { window.console.log( msg ); } $( '#debug' ).prepend( " " + msg + "\n" ); }; // Create new Pusher instance and connect var pusher = new Pusher( "AIzaSyCDMrCpSpzINswYqdu9RsrWGeGnfKRFin0" ); // Subscribe to the channel that the event will be published on var channel = pusher.subscribe( 'test-channel' ); // Bind to the event on the channel and handle the event when triggered channel.bind( 'test-event', function( data ) { // For now, alert the message. // document.addEventListener('DOMContentLoaded', function () { if (Notification.permission !== "granted") Notification.requestPermission(); // }); // function notifyMe() { if (!Notification) { alert('Desktop notifications not available in your browser. Try Chromium.'); return; } if (Notification.permission !== "granted") Notification.requestPermission(); else { var notification = new Notification('Notification title', { icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png', body: "Hey there! You've been notified!", }); notification.onclick = function () { window.open("http://stackoverflow.com/a/13328397/1269037"); }; } }); // } // } ); </script> --> <script> (function() { 'use strict'; Polymer({ is: 'login-form', ready:function(){ this.parentlogin(); //var Pusher = require('pusher-js/node'); /* var pusher = new Pusher('AIzaSyCDMrCpSpzINswYqdu9RsrWGeGnfKRFin0', { cluster: "eu" }); var pusher = new Pusher('AIzaSyCDMrCpSpzINswYqdu9RsrWGeGnfKRFin0'); var channel = pusher.subscribe('my-channel'); channel.bind('my-event', function(data) { alert('An event was triggered with message: ' + data.message); });*/ /*},FnClick:function(){ this.notifyurl=sessionStorage.getItem("haddrinfo")+"/notify-service"; this.$.notifyajax.generateRequest(); }, notifyResponse:function(e){ // alert(e.detail.response); },*/ }, parentlogin:function(){ this.$.parentpass.hidden=false; this.$.user.hidden=true; this.$.pass.hidden=true; this.$.sub.hidden=true; var qwert="parent"; sessionStorage.setItem("icons",qwert); }, loginid:function(){ var smuserid = this.username; var userid = smuserid.toUpperCase(); this.$.login.loginrole(userid); }, mobileno:function() { this.$.login.mobile(this.mobile,this.pass); }, newpass:function(){ if(this.newpassword === ''){ document.querySelector('#passemptyerrormsg').hidden = true; } }, confirmpass:function(){ if(this.newpassword === this.confirmpassword){ } else { this.newpassword = ''; this.confirmpassword = ''; document.querySelector('#passerrormsg').hidden = false; } }, getrole:function(role){ var role = role; if(role == "Teacher"){ this.teacher(); } else { this.admin(); } }, hideParentLogin:function(){ this.$.user.hidden=false; this.$.mob.hidden=true; //this.$.drop.hidden=true; this.$.id.hidden=true; this.$.sub.hidden=false; this.$.pass.hidden=false; this.$.parentpass.hidden=true; var qwert="manager"; sessionStorage.setItem("user","teacher"); sessionStorage.setItem("icons",qwert); }, admin:function(){ //alert('admin'); sessionStorage.setItem("user","admin"); this.$.mob.hidden=true; //this.$.drop.hidden=true; this.$.id.hidden=true; this.$.user.hidden=false; this.$.pass.hidden=false; this.$.sub.hidden=false; this.$.mobilepass.hidden=true; this.$.parentpass.hidden=true; var qwert="staff"; //alert(qwert); sessionStorage.setItem("icons",qwert); }, teacher:function(){ //alert('admin'); sessionStorage.setItem("user","teacher"); this.$.mob.hidden=true; //this.$.drop.hidden=true; this.$.id.hidden=true; this.$.mobilepass.hidden=true; }, Fnparent:function(){ //alert('parent'); sessionStorage.setItem("user","parent"); this.$.user.hidden=true; this.$.pass.hidden=true; this.$.sub.hidden=true; this.$.mob.hidden=false; //this.$.drop.hidden=false; this.$.id.hidden=false; this.$.parentpass.hidden=false; this.$.mobilepass.hidden=false; var qwert="parent"; sessionStorage.setItem("icons",qwert); }, login:function(){ this.$.login.adminlogin(this.username,this.password); }, link:function(){ document.querySelector('app-card').setPage('registration'); }, link2:function(){ document.querySelector('#registered').open(); document.querySelector('#passerrormsg').hidden = true; document.querySelector('#passemptyerrormsg').hidden = true; }, link3:function(){ document.querySelector('#forgot').open(); }, activate:function(){ if(this.newregmob == '' || this.verify =='' || this.newpassword == '' || this.confirmpassword == ''){ this.$.passnew.validate(); this.$.passconfirm.validate(); this.$.regno.validate(); this.$.verifyno.validate(); } else { if(this.newpassword == this.confirmpassword){ this.$.login.activate(this.newregmob,this.verify,this.confirmpassword); } } }, fnacti:function(){ document.querySelector('#registered').close(); this.$.toast.open(); }, Fnclear:function(){ this.mobile=""; this.username=""; this.password=""; }, back:function(){ document.querySelector('app-card').setPage('loginicon'); }, zxcvdialog:function(reply){ this.replyhere=reply; var id = 'dialoghere'; var dialog = document.getElementById(id); dialog.open(); }, exit:function(){ var id = 'dialoghere'; var dialog = document.getElementById(id); dialog.close(); }, subforgot:function(){ this.$.login.forgorpass(this.regmob); document.querySelector('#forgot').close(); }, getresponsedialog:function(res){ document.querySelector('#successdialog').open(); this.successreply="Your OTP is sent to your registered mail ID \nPlease check it..."; //alert(JSON.stringify(res)); this.$.login.recoverpass(res); }, getinvaliddialog:function(){ document.querySelector('#invaliddialog').open(); this.invalidreply="Your number is not registered \nPlese enter the registered mobile number \nOr Register Again..!!!"; }, successexit:function(){ document.querySelector('#successdialog').close(); }, invalidexit:function(){ document.querySelector('#invaliddialog').close(); } , parents:function(){ //alert('1'); var qwert="parent"; this.Fnparent(); sessionStorage.setItem("icons",qwert); }, admins:function(){ //alert('2'); var qwert="manager"; //alert(qwert); sessionStorage.setItem("icons",qwert); this.admin(); }, loginform:function(){ var qwert="staff"; sessionStorage.setItem("icons",qwert); this.hideParentLogin(); }, zxcvdialog:function(reply){ this.replyhere=reply; var id = 'dialogqwertyu'; var dialog = document.getElementById(id); dialog.open(); }, exit:function(){ var id = 'dialogqwertyu'; var dialog = document.getElementById(id); dialog.close(); }, student:function(e){ var id=e.target.selectedItem.value; //alert(e.target.selectedItem.value); this.$.qpostid.checktransportreq(id); sessionStorage.setItem("studid",id); this.$.login.getdetails(id); sessionStorage.setItem("user","parent"); }, selectchild:function(){ var id = 'selectchild'; var dialog = document.getElementById(id); dialog.open(); }, closedialog:function(){ var id = 'selectchild'; var dialog = document.getElementById(id); dialog.close(); } }); })(); </script> </dom-module>
rmpraba/Helpdesk
app/elements/login-form/login-form.html
HTML
bsd-3-clause
19,677
[ 30522, 1026, 4957, 2128, 2140, 1027, 1000, 12324, 1000, 17850, 12879, 1027, 1000, 1012, 1012, 1032, 1012, 1012, 1032, 6812, 2121, 1035, 6177, 1013, 17782, 1013, 17782, 1012, 16129, 1000, 1028, 1026, 4957, 2128, 2140, 1027, 1000, 6782, 21030...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python import json import gspread from oauth2client.client import SignedJwtAssertionCredentials import datetime from participantCollection import ParticipantCollection # Edit Me! participantFileNames = ['../stayclean-2014-november/participants.txt', '../stayclean-2014-december/participants.txt', '../stayclean-2015-january/participants.txt', '../stayclean-2015-february/participants.txt', '../stayclean-2015-march/participants.txt', '../stayclean-2015-april/participants.txt', '../stayclean-2015-may/participants.txt', '../stayclean-2015-june/participants.txt', '../stayclean-2015-july/participants.txt', '../stayclean-2015-august/participants.txt', '../stayclean-2015-september/participants.txt', '../stayclean-2015-october/participants.txt', '../stayclean-2015-november/participants.txt', '../stayclean-2015-december/participants.txt', '../stayclean-2016-january/participants.txt', '../stayclean-2016-february/participants.txt', '../stayclean-2016-march/participants.txt', '../stayclean-2016-april/participants.txt', '../stayclean-2016-may/participants.txt', '../stayclean-2016-june/participants.txt', '../stayclean-2016-july/participants.txt', '../stayclean-2016-august/participants.txt', '../stayclean-2016-september/participants.txt', '../stayclean-2016-october/participants.txt', '../stayclean-2016-november/participants.txt', '../stayclean-2016-december/participants.txt', '../stayclean-2017-january/participants.txt', '../stayclean-2017-february/participants.txt', '../stayclean-2017-march/participants.txt', '../stayclean-2017-april/participants.txt', '../stayclean-2017-may/participants.txt', '../stayclean-2017-june/participants.txt', '../stayclean-2017-july/participants.txt', '../stayclean-2017-august/participants.txt', '../stayclean-2017-september/participants.txt', '../stayclean-2017-october/participants.txt', '../stayclean-2017-november/participants.txt', '../stayclean-2017-december/participants.txt', '../stayclean-2018-january/participants.txt', '../stayclean-2018-february/participants.txt', '../stayclean-2018-march/participants.txt', '../stayclean-2018-april/participants.txt', '../stayclean-2018-may/participants.txt', '../stayclean-2018-june/participants.txt', '../stayclean-2018-july/participants.txt', '../stayclean-2018-august/participants.txt', '../stayclean-2018-september/participants.txt', '../stayclean-2018-october/participants.txt', '../stayclean-2018-november/participants.txt', '../stayclean-2018-december/participants.txt', '../stayclean-2019-january/participants.txt', '../stayclean-2019-february/participants.txt', '../stayclean-2019-march/participants.txt', '../stayclean-2019-april/participants.txt', '../stayclean-2019-may/participants.txt', '../stayclean-2019-june/participants.txt', '../stayclean-2019-july/participants.txt', '../stayclean-2019-august/participants.txt', '../stayclean-2019-september/participants.txt', './participants.txt'] sortedRelapseDates = [] for participantFileName in participantFileNames: participants = ParticipantCollection(fileNameString=participantFileName) sortedRelapseDates = sortedRelapseDates + participants.allRelapseDates() sortedRelapseDates.sort() earliestReportDate = sortedRelapseDates[0] latestReportDate = sortedRelapseDates[-1] reportDates = [] numberOfRelapsesPerDate = [] reportDatesAndNumberOfRelapses = {} dayOfWeekIndexesAndNumberOfInstances = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0} reportDate = earliestReportDate while reportDate <= latestReportDate: reportDatesAndNumberOfRelapses[reportDate] = 0 # dayOfWeekIndexesAndNumberOfInstances[reportDate.weekday()] = dayOfWeekIndexesAndNumberOfInstances[reportDate.weekday()] + 1 dayOfWeekIndexesAndNumberOfInstances[reportDate.weekday()] += 1 reportDate += datetime.timedelta(days=1) for relapseDate in sortedRelapseDates: # reportDatesAndNumberOfRelapses[relapseDate] = reportDatesAndNumberOfRelapses[relapseDate] + 1 reportDatesAndNumberOfRelapses[relapseDate] += 1 dayOfWeekIndexesAndTotalNumberOfRelapses = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0} for participantFileName in participantFileNames: participants = ParticipantCollection(fileNameString=participantFileName) # print participants.relapseDayOfWeekIndexesAndParticipants() for index, parts in participants.relapseDayOfWeekIndexesAndParticipants().iteritems(): # dayOfWeekIndexesAndTotalNumberOfRelapses[index] = dayOfWeekIndexesAndTotalNumberOfRelapses[index] + len(parts) dayOfWeekIndexesAndTotalNumberOfRelapses[index] += len(parts) dayOfWeekIndexesAndAverageNumberOfRelapses = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0} for index, instances in dayOfWeekIndexesAndNumberOfInstances.iteritems(): # dayOfWeekIndexesAndAverageNumberOfRelapses[index] = int(round(float(dayOfWeekIndexesAndTotalNumberOfRelapses[index]) / float(instances))) dayOfWeekIndexesAndAverageNumberOfRelapses[index] = float(dayOfWeekIndexesAndTotalNumberOfRelapses[index]) / float(instances) spreadsheetTitle = "StayClean monthly challenge relapse data" # spreadsheetTitle = "Test spreadsheet" json_key = json.load(open('../google-oauth-credentials.json')) scope = ['https://spreadsheets.google.com/feeds'] credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'].encode(), scope) gc = gspread.authorize(credentials) spreadSheet = None try: spreadSheet = gc.open(spreadsheetTitle) except gspread.exceptions.SpreadsheetNotFound: print "No spreadsheet with title " + spreadsheetTitle exit(1) workSheet = spreadSheet.get_worksheet(0) columnACells = workSheet.range("A2:A" + str(len(reportDatesAndNumberOfRelapses) + 1)) columnBCells = workSheet.range("B2:B" + str(len(reportDatesAndNumberOfRelapses) + 1)) columnCCells = workSheet.range("C2:C8") columnDCells = workSheet.range("D2:D8") reportDate = earliestReportDate rowIndex = 0 while reportDate <= latestReportDate: columnACells[rowIndex].value = str(reportDate) columnBCells[rowIndex].value = str(reportDatesAndNumberOfRelapses[reportDate]) rowIndex += 1 reportDate += datetime.timedelta(days=1) for weekdayIndex in range(0, 7): weekdayName = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'][weekdayIndex] # spreadsheetClient.UpdateCell(weekdayIndex + 2,3,weekdayName,spreadsheetId) # spreadsheetClient.UpdateCell(weekdayIndex + 2,4,str(dayOfWeekIndexesAndAverageNumberOfRelapses[weekdayIndex]),spreadsheetId) columnCCells[weekdayIndex].value = weekdayName columnDCells[weekdayIndex].value = str(dayOfWeekIndexesAndAverageNumberOfRelapses[weekdayIndex]) allCells = columnACells + columnBCells + columnCCells + columnDCells workSheet.update_cells(allCells) exit(0)
foobarbazblarg/stayclean
stayclean-2019-october/update-google-chart.py
Python
mit
8,223
[ 30522, 1001, 999, 1013, 2149, 2099, 1013, 8026, 1013, 18750, 1001, 28681, 2080, 1024, 3314, 2007, 2047, 1051, 4887, 2705, 2475, 4933, 1012, 2562, 2478, 3080, 2544, 1997, 18750, 2005, 2085, 1012, 1001, 1001, 999, 1013, 2149, 2099, 1013, 80...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Smallest Integer # I worked on this challenge [by myself, with: ]. # smallest_integer is a method that takes an array of integers as its input # and returns the smallest integer in the array # # +list_of_nums+ is an array of integers # smallest_integer(list_of_nums) should return the smallest integer in +list_of_nums+ # # If +list_of_nums+ is empty the method should return nil # Your Solution Below def smallest_integer(list_of_nums) if list_of_nums.empty? return nil else list_of_nums.sort! return list_of_nums[0] end end
NoahHeinrich/phase-0
week-4/smallest-integer/my_solution.rb
Ruby
mit
548
[ 30522, 1001, 10479, 16109, 1001, 1045, 2499, 2006, 2023, 4119, 1031, 2011, 2870, 1010, 2007, 1024, 1033, 1012, 1001, 10479, 1035, 16109, 2003, 30524, 2709, 1996, 10479, 16109, 1999, 1009, 2862, 1035, 1997, 1035, 16371, 5244, 1009, 1001, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_40) on Wed Feb 10 11:30:58 CST 2016 --> <title>Uses of Class org.hibernate.boot.model.TypeDefinition (Hibernate JavaDocs)</title> <meta name="date" content="2016-02-10"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.hibernate.boot.model.TypeDefinition (Hibernate JavaDocs)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/hibernate/boot/model/class-use/TypeDefinition.html" target="_top">Frames</a></li> <li><a href="TypeDefinition.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.hibernate.boot.model.TypeDefinition" class="title">Uses of Class<br>org.hibernate.boot.model.TypeDefinition</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.hibernate.boot">org.hibernate.boot</a></td> <td class="colLast"> <div class="block">This package contains the contracts that make up the Hibernate native bootstrapping API (building a SessionFactory).</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.hibernate.boot.internal">org.hibernate.boot.internal</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.hibernate.boot.spi">org.hibernate.boot.spi</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.hibernate.boot"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a> in <a href="../../../../../org/hibernate/boot/package-summary.html">org.hibernate.boot</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/hibernate/boot/package-summary.html">org.hibernate.boot</a> that return <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></code></td> <td class="colLast"><span class="typeNameLabel">Metadata.</span><code><span class="memberNameLink"><a href="../../../../../org/hibernate/boot/Metadata.html#getTypeDefinition-java.lang.String-">getTypeDefinition</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;typeName)</code> <div class="block">Retrieve a type definition by name.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.hibernate.boot.internal"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a> in <a href="../../../../../org/hibernate/boot/internal/package-summary.html">org.hibernate.boot.internal</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/hibernate/boot/internal/package-summary.html">org.hibernate.boot.internal</a> that return <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></code></td> <td class="colLast"><span class="typeNameLabel">MetadataImpl.</span><code><span class="memberNameLink"><a href="../../../../../org/hibernate/boot/internal/MetadataImpl.html#getTypeDefinition-java.lang.String-">getTypeDefinition</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;typeName)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code><a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></code></td> <td class="colLast"><span class="typeNameLabel">InFlightMetadataCollectorImpl.</span><code><span class="memberNameLink"><a href="../../../../../org/hibernate/boot/internal/InFlightMetadataCollectorImpl.html#getTypeDefinition-java.lang.String-">getTypeDefinition</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;registrationKey)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/hibernate/boot/internal/package-summary.html">org.hibernate.boot.internal</a> with parameters of type <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">InFlightMetadataCollectorImpl.</span><code><span class="memberNameLink"><a href="../../../../../org/hibernate/boot/internal/InFlightMetadataCollectorImpl.html#addTypeDefinition-org.hibernate.boot.model.TypeDefinition-">addTypeDefinition</a></span>(<a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a>&nbsp;typeDefinition)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation"> <caption><span>Constructor parameters in <a href="../../../../../org/hibernate/boot/internal/package-summary.html">org.hibernate.boot.internal</a> with type arguments of type <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/hibernate/boot/internal/MetadataImpl.html#MetadataImpl-java.util.UUID-org.hibernate.boot.spi.MetadataBuildingOptions-org.hibernate.type.TypeResolver-org.hibernate.id.factory.spi.MutableIdentifierGeneratorFactory-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-java.util.Map-org.hibernate.boot.model.relational.Database-">MetadataImpl</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/UUID.html?is-external=true" title="class or interface in java.util">UUID</a>&nbsp;uuid, <a href="../../../../../org/hibernate/boot/spi/MetadataBuildingOptions.html" title="interface in org.hibernate.boot.spi">MetadataBuildingOptions</a>&nbsp;metadataBuildingOptions, <a href="../../../../../org/hibernate/type/TypeResolver.html" title="class in org.hibernate.type">TypeResolver</a>&nbsp;typeResolver, <a href="../../../../../org/hibernate/id/factory/spi/MutableIdentifierGeneratorFactory.html" title="interface in org.hibernate.id.factory.spi">MutableIdentifierGeneratorFactory</a>&nbsp;identifierGeneratorFactory, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/mapping/PersistentClass.html" title="class in org.hibernate.mapping">PersistentClass</a>&gt;&nbsp;entityBindingMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>,<a href="../../../../../org/hibernate/mapping/MappedSuperclass.html" title="class in org.hibernate.mapping">MappedSuperclass</a>&gt;&nbsp;mappedSuperclassMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/mapping/Collection.html" title="class in org.hibernate.mapping">Collection</a>&gt;&nbsp;collectionBindingMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a>&gt;&nbsp;typeDefinitionMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/engine/spi/FilterDefinition.html" title="class in org.hibernate.engine.spi">FilterDefinition</a>&gt;&nbsp;filterDefinitionMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/mapping/FetchProfile.html" title="class in org.hibernate.mapping">FetchProfile</a>&gt;&nbsp;fetchProfileMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&gt;&nbsp;imports, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/boot/model/IdentifierGeneratorDefinition.html" title="class in org.hibernate.boot.model">IdentifierGeneratorDefinition</a>&gt;&nbsp;idGeneratorDefinitionMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/engine/spi/NamedQueryDefinition.html" title="class in org.hibernate.engine.spi">NamedQueryDefinition</a>&gt;&nbsp;namedQueryMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/engine/spi/NamedSQLQueryDefinition.html" title="class in org.hibernate.engine.spi">NamedSQLQueryDefinition</a>&gt;&nbsp;namedNativeQueryMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/cfg/annotations/NamedProcedureCallDefinition.html" title="class in org.hibernate.cfg.annotations">NamedProcedureCallDefinition</a>&gt;&nbsp;namedProcedureCallMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/engine/ResultSetMappingDefinition.html" title="class in org.hibernate.engine">ResultSetMappingDefinition</a>&gt;&nbsp;sqlResultSetMappingMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/cfg/annotations/NamedEntityGraphDefinition.html" title="class in org.hibernate.cfg.annotations">NamedEntityGraphDefinition</a>&gt;&nbsp;namedEntityGraphMap, <a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>,<a href="../../../../../org/hibernate/dialect/function/SQLFunction.html" title="interface in org.hibernate.dialect.function">SQLFunction</a>&gt;&nbsp;sqlFunctionMap, <a href="../../../../../org/hibernate/boot/model/relational/Database.html" title="class in org.hibernate.boot.model.relational">Database</a>&nbsp;database)</code>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.hibernate.boot.spi"> <!-- --> </a> <h3>Uses of <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a> in <a href="../../../../../org/hibernate/boot/spi/package-summary.html">org.hibernate.boot.spi</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/hibernate/boot/spi/package-summary.html">org.hibernate.boot.spi</a> that return <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></code></td> <td class="colLast"><span class="typeNameLabel">AbstractDelegatingMetadata.</span><code><span class="memberNameLink"><a href="../../../../../org/hibernate/boot/spi/AbstractDelegatingMetadata.html#getTypeDefinition-java.lang.String-">getTypeDefinition</a></span>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;typeName)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../org/hibernate/boot/spi/package-summary.html">org.hibernate.boot.spi</a> with parameters of type <a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="typeNameLabel">InFlightMetadataCollector.</span><code><span class="memberNameLink"><a href="../../../../../org/hibernate/boot/spi/InFlightMetadataCollector.html#addTypeDefinition-org.hibernate.boot.model.TypeDefinition-">addTypeDefinition</a></span>(<a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">TypeDefinition</a>&nbsp;typeDefinition)</code> <div class="block">Adds a type definition to this metadata repository.</div> </td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/hibernate/boot/model/TypeDefinition.html" title="class in org.hibernate.boot.model">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/hibernate/boot/model/class-use/TypeDefinition.html" target="_top">Frames</a></li> <li><a href="TypeDefinition.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &copy; 2001-2016 <a href="http://redhat.com">Red Hat, Inc.</a> All Rights Reserved.</small></p> </body> </html>
1fechner/FeatureExtractor
sources/FeatureExtractor/lib/hibernate-release-5.1.0.Final/documentation/javadocs/org/hibernate/boot/model/class-use/TypeDefinition.html
HTML
lgpl-2.1
22,050
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package ru.ifmo.nds.tests; import ru.ifmo.nds.JensenFortinBuzdalov; import ru.ifmo.nds.NonDominatedSortingFactory; public class JensenFortinBuzdalovRedBlackHybridENSParallelTest extends CorrectnessTestsBase { @Override protected NonDominatedSortingFactory getFactory() { return JensenFortinBuzdalov.getRedBlackTreeSweepHybridENSImplementation(-1); } }
mbuzdalov/non-dominated-sorting
implementations/src/test/java/ru/ifmo/nds/tests/JensenFortinBuzdalovRedBlackHybridENSParallelTest.java
Java
mit
374
[ 30522, 7427, 21766, 1012, 2065, 5302, 1012, 1050, 5104, 1012, 5852, 1025, 12324, 21766, 1012, 2065, 5302, 1012, 1050, 5104, 1012, 14857, 13028, 2378, 8569, 26494, 23067, 2615, 1025, 12324, 21766, 1012, 2065, 5302, 1012, 1050, 5104, 1012, 25...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'pagebreak', 'km', { alt: 'បំបែក​ទំព័រ', toolbar: 'បន្ថែម​ការ​បំបែក​ទំព័រ​មុន​បោះពុម្ព' } );
Rudhie/simlab
assets/ckeditor/plugins/pagebreak/lang/km.js
JavaScript
mit
359
[ 30522, 1013, 1008, 9385, 1006, 1039, 1007, 2494, 1011, 2355, 1010, 23616, 6499, 3126, 3401, 1011, 15296, 2080, 14161, 7875, 10609, 1012, 2035, 2916, 9235, 1012, 2005, 13202, 1010, 2156, 6105, 1012, 9108, 2030, 8299, 1024, 1013, 1013, 23616,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<HTML><HEAD> <TITLE>Review for Priyatel pokojnika (1997)</TITLE> <LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0119952">Priyatel pokojnika (1997)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?James+Berardinelli">James Berardinelli</A></H3><HR WIDTH="40%" SIZE="4"> <PRE>A FRIEND OF THE DECEASED</PRE> <PRE>A Film Review by James Berardinelli</PRE> <PRE>RATING: *** OUT OF ****</PRE> <P>Ukraine/France, 1997 U.S. Release Date: beginning May 1, 1998 (limited) Running Length: 1:40 MPAA Classification: R (Violence, profanity, mature themes) Theatrical Aspect Ratio: 1.85:1</P> <P>Cast: Alexandre Lazarev, Tatiana Krivitska, Eugen Pachin, Constantin Kostychin, Elena Korikova, Angelika Nevolina, Sergiy Romanyuk Director: Vyacheslav Krishtofovich Producers: Mykola Machenko, Pierre Rival Screenplay: Andrei Kourkov Cinematography: Vilen Kaluta Music: Vladimir Gronski U.S. Distributor: Sony Pictures Classics In Russian with subtitles</P> <P> Ukrainian film maker Vyacheslav Krishtofovich has used his latest film, A FRIEND OF THE DECEASED (which was one of the five Best Foreign Film nominees for the1998 Oscars), to take a darkly comic look at the current economic and social climate in the former Soviet Union. Krishtofovich is on record as saying that the "human warmth" evident during the height of socialism has been replaced by solitude and self- interest in the new era of freedom. As he says in a prepared Director's Statement: "In Ukrainian, the word 'love' and the word 'pity' are sometimes considered synonyms. That is why I made this film about people whom I pity. And whom I love."</P> <P> Today in the Ukraine, it's possible to buy and sell almost anything – drugs, sex, booze, and murder. The Black Market is booming, and Kiev's sidestreets are teeming with drug dealers, prostitutes, and contract killers. In this new environment, someone like Anatoli (Alexandre Lazarev), a reserved intellectual who was trained to be a translator in English and French, finds himself without work or self- respect. His wife, a successful advertising executive, is about to leave him for another man, and there's nothing he can do about it. One day, he casually mentions his problems to a friend, Dima (Eugen Pachin), who suggests putting out a hit on his wife's lover. With surprising rapidity, Dima puts Anatoli in contact with Kostia (Constantin Kostychin), who accepts the job over the phone, without meeting his client face-to-face. But, instead of providing Kostia with his wife's lover's description, Anatoli gives the killer a picture of himself, figuring that arranging his own murder offers a quick and painless way out of a dreary life. But, when a tryst with a prostitute (Tatiana Krivitska) re-invigorates Anatoli and causes him to change his mind, it's too late to call off the hit. So, to save his life, Anatoli must hire another contract killer to eliminate the first one.</P> <P> With a script (by Andrei Kourkov) that combines dark comedy, drama, and suspense, A FRIEND OF THE DECEASED proves to be a fascinating and engaging look at a country in turmoil. The way the story develops, with a number of inventive twists overlaying a typically "Russian" sense of tragedy, conjures up images of the work of Fyodor Dostoevsky as filtered through O. Henry. The screenplay drips with irony as Anatoli, who is an astute-but-ineffectual man, learns to use the mechanics of Ukrainian capitalism to rebuild the life that it was instrumental in destroying. </P> <P> While most of the film wades through dramatic currents, with occasional swells of satire and grim humor, one extended sequence recalls the suspense of a Hitchcock feature. It occurs when Anatoli is playing the bait in a trap devised by the second killer to catch the first. The problem is that Anatoli has never seen Kostia, and has only a sketchy description of what he looks like. As a result, the possibility exists that Anatoli could accidentally mark an innocent man for death. For about fifteen minutes, Krishtofovich continually ratchets up the tension as Anatoli tries to flush out Kostia before he fulfills his contract.</P> <P> The only real problem with A FRIEND OF THE DECEASED is that there are occasions when things seem a little overplotted. From time-to-time, the seams of the script show, and we're aware that a character is acting in a certain way because that's what the plot demands. In particular, Anatoli's inability to call off the first contract killer seems like a contrivance. After all, how hard does he really try? </P> <P> A FRIEND OF THE DECEASED's primary asset is that it offers an insider's perspective of the labyrinthine workings of contemporary Kiev, and how the transition from the old ways to the new ones have overturned the values and shifted the balance of a society. (At one point, a character remarks, "Before we had friendships. Now we have business relationships.") It's a plus that the movie is well-acted, gripping, and populated with enough bizarre twists to keep even a casual viewer involved. Although not a masterpiece, A FRIEND OF THE DECEASED is a strong and worthwhile effort from an acclaimed Ukrainian director.</P> <PRE>Copyright 1998 James Berardinelli</PRE> <PRE>- James Berardinelli e-mail: <A HREF="mailto:berardin@mail.cybernex.net">berardin@mail.cybernex.net</A></PRE> <P>Now with more than 1400 reviews... The ReelViews web site: <A HREF="http://movie-reviews.colossus.net/">http://movie-reviews.colossus.net/</A></P> <P>"My belief is that no movie, nothing in life, leaves people neutral. You either leave them up or you leave them down."</P> <PRE>-- David Puttnam</PRE> <HR><P CLASS=flush><SMALL>The review above was posted to the <A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR> The Internet Movie Database accepts no responsibility for the contents of the review and has no editorial control. Unless stated otherwise, the copyright belongs to the author.<BR> Please direct comments/criticisms of the review to relevant newsgroups.<BR> Broken URLs inthe reviews are the responsibility of the author.<BR> The formatting of the review is likely to differ from the original due to ASCII to HTML conversion. </SMALL></P> <P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P> </P></BODY></HTML>
xianjunzhengbackup/code
data science/machine_learning_for_the_web/chapter_4/movie/12223.html
HTML
mit
6,744
[ 30522, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 2516, 1028, 3319, 2005, 26927, 26139, 2884, 13433, 3683, 22895, 7556, 1006, 2722, 1007, 1026, 1013, 2516, 1028, 1026, 4957, 2128, 2140, 1027, 1000, 6782, 21030, 2102, 1000, 2828, 1027, 1000,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
"use strict"; var Cylon = require("cylon"); Cylon .robot() .connection("arduino", { adaptor: "firmata", port: "/dev/ttyACM0" }) .device("bmp180", { driver: "bmp180" }) .on("ready", function(bot) { bot.bmp180.getTemperature(function(err, val) { if (err) { console.log(err); } else { console.log("getTemperature call:"); console.log("\tTemp: " + val.temp + " C"); } }); setTimeout(function() { bot.bmp180.getPressure(1, function(err, val) { if (err) { console.log(err); } else { console.log("getPressure call:"); console.log("\tTemperature: " + val.temp + " C"); console.log("\tPressure: " + val.press + " Pa"); } }); }, 1000); setTimeout(function() { bot.bmp180.getAltitude(1, null, function(err, val) { if (err) { console.log(err); } else { console.log("getAltitude call:"); console.log("\tTemperature: " + val.temp + " C"); console.log("\tPressure: " + val.press + " Pa"); console.log("\tAltitude: " + val.alt + " m"); } }); }, 2000); }); Cylon.start();
adrianpomilio/drones
node_modules/cylon-firmata/examples/bmp180/fluent-bmp180.js
JavaScript
mit
1,198
[ 30522, 1000, 2224, 9384, 1000, 1025, 13075, 22330, 7811, 1027, 5478, 1006, 1000, 22330, 7811, 1000, 1007, 1025, 22330, 7811, 1012, 8957, 1006, 1007, 1012, 4434, 1006, 1000, 12098, 8566, 5740, 1000, 1010, 1063, 15581, 2953, 1024, 1000, 3813,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package build import sbt._ import Keys._ import Def.SettingsDefinition final class MultiScalaProject private (private val projects: Map[String, Project]) extends CompositeProject { import MultiScalaProject._ val v2_11: Project = projects("2.11") val v2_12: Project = projects("2.12") val v2_13: Project = projects("2.13") def settings(ss: SettingsDefinition*): MultiScalaProject = transform(_.settings(ss: _*)) def enablePlugins(ns: Plugins*): MultiScalaProject = transform(_.enablePlugins(ns: _*)) def dependsOn(deps: ScopedMultiScalaProject*): MultiScalaProject = { def classpathDependency(d: ScopedMultiScalaProject) = strictMapValues(d.project.projects)(ClasspathDependency(_, d.configuration)) val depsByVersion: Map[String, Seq[ClasspathDependency]] = strictMapValues(deps.flatMap(classpathDependency).groupBy(_._1))(_.map(_._2)) zipped(depsByVersion)(_.dependsOn(_: _*)) } def configs(cs: Configuration*): MultiScalaProject = transform(_.configs(cs: _*)) def zippedSettings(that: MultiScalaProject)(ss: Project => SettingsDefinition): MultiScalaProject = zipped(that.projects)((p, sp) => p.settings(ss(sp))) def zippedSettings(project: String)(ss: LocalProject => SettingsDefinition): MultiScalaProject = zippedSettings(Seq(project))(ps => ss(ps(0))) /** Set settings on this MultiScalaProject depending on other MultiScalaProjects by name. * * For every Scala version of this MultiScalaProject, `ss` is invoked onced * with a LocalProjects corresponding to the names in projectNames with a * suffix for that version. */ def zippedSettings(projectNames: Seq[String])( ss: Seq[LocalProject] => SettingsDefinition): MultiScalaProject = { val ps = for { (v, p) <- projects } yield { val lps = projectNames.map(pn => LocalProject(projectID(pn, v))) v -> p.settings(ss(lps)) } new MultiScalaProject(ps) } def %(configuration: String) = new ScopedMultiScalaProject(this, Some(configuration)) override def componentProjects: Seq[Project] = projects.valuesIterator.toSeq private def zipped[T](that: Map[String, T])(f: (Project, T) => Project): MultiScalaProject = { val ps = for ((v, p) <- projects) yield v -> f(p, that(v)) new MultiScalaProject(ps) } private def transform(f: Project => Project): MultiScalaProject = new MultiScalaProject(strictMapValues(projects)(f)) } final class ScopedMultiScalaProject(val project: MultiScalaProject, val configuration: Option[String]) object ScopedMultiScalaProject { implicit def fromMultiScalaProject(mp: MultiScalaProject): ScopedMultiScalaProject = new ScopedMultiScalaProject(mp, None) } object MultiScalaProject { private def strictMapValues[K, U, V](v: Map[K, U])(f: U => V): Map[K, V] = v.map(v => (v._1, f(v._2))) private final val versions = Map[String, Seq[String]]( "2.11" -> Seq("2.11.12"), "2.12" -> Seq("2.12.1", "2.12.2", "2.12.3", "2.12.4", "2.12.5", "2.12.6", "2.12.7", "2.12.8", "2.12.9", "2.12.10", "2.12.11", "2.12.12", "2.12.13", "2.12.14", "2.12.15"), "2.13" -> Seq("2.13.0", "2.13.1", "2.13.2", "2.13.3", "2.13.4", "2.13.5", "2.13.6", "2.13.7", "2.13.8"), ) val Default2_11ScalaVersion = versions("2.11").last val Default2_12ScalaVersion = versions("2.12").last val Default2_13ScalaVersion = versions("2.13").last /** The default Scala version is the default 2.12 Scala version, because it * must work for sbt plugins. */ val DefaultScalaVersion = Default2_12ScalaVersion private final val ideVersion = "2.12" private def projectID(id: String, major: String) = id + major.replace('.', '_') def apply(id: String, base: File): MultiScalaProject = { val projects = for { (major, minors) <- versions } yield { val noIDEExportSettings = if (major == ideVersion) Nil else NoIDEExport.noIDEExportSettings major -> Project(id = projectID(id, major), base = new File(base, "." + major)).settings( scalaVersion := minors.last, crossScalaVersions := minors, noIDEExportSettings, ) } new MultiScalaProject(projects).settings( sourceDirectory := baseDirectory.value.getParentFile / "src", ) } }
scala-js/scala-js
project/MultiScalaProject.scala
Scala
apache-2.0
4,271
[ 30522, 7427, 3857, 12324, 24829, 2102, 1012, 1035, 12324, 6309, 1012, 1035, 12324, 13366, 1012, 10906, 3207, 16294, 22753, 2345, 2465, 4800, 15782, 2721, 21572, 20614, 2797, 1006, 2797, 11748, 3934, 1024, 4949, 1031, 5164, 1010, 2622, 1033, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright_License { XCSoar Glide Computer - http://www.xcsoar.org/ Copyright (C) 2000-2021 The XCSoar Project A detailed list of copyright holders can be found in the file "AUTHORS". This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. } */ #ifndef XCSOAR_SOLVER_RESULT_HPP #define XCSOAR_SOLVER_RESULT_HPP /** * Return type for path solver methods. */ enum class SolverResult { /** * Still looking for a solution. */ INCOMPLETE, /** * A valid solution was found. */ VALID, /** * The solver has completed, but failed to find a valid solution, * or the solution was not better than the previous one. More * data may be required. */ FAILED, }; #endif
sandrinr/XCSoar
src/Engine/PathSolvers/SolverResult.hpp
C++
gpl-2.0
1,351
[ 30522, 1013, 1008, 9385, 1035, 6105, 1063, 1060, 6169, 10441, 2099, 21096, 3274, 1011, 8299, 1024, 1013, 1013, 7479, 1012, 1060, 6169, 10441, 2099, 1012, 8917, 1013, 9385, 1006, 1039, 1007, 2456, 1011, 25682, 1996, 1060, 6169, 10441, 2099, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html><body> <h4>Windows 10 x64 (18362.329)</h4><br> <h2>_CM_UOW_SET_VALUE_KEY_DATA</h2> <font face="arial"> +0x000 PreparedCell : Uint4B<br> +0x004 OldValueCell : Uint4B<br> +0x008 NameLength : Uint2B<br> +0x00c DataSize : Uint4B<br> </font></body></html>
epikcraw/ggool
public/Windows 10 x64 (18362.329)/_CM_UOW_SET_VALUE_KEY_DATA.html
HTML
mit
296
[ 30522, 1026, 16129, 1028, 1026, 2303, 1028, 1026, 1044, 2549, 1028, 3645, 2184, 1060, 21084, 1006, 10081, 2475, 1012, 29567, 1007, 1026, 1013, 1044, 2549, 1028, 1026, 7987, 1028, 1026, 1044, 2475, 1028, 1035, 4642, 1035, 1057, 5004, 1035, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using Nimbus.MessageContracts; namespace Nimbus.Tests.Unit.InfrastructureTests.MessageContracts { public class SimpleEvent : IBusEvent { } }
NimbusAPI/Nimbus
src/Nimbus.Tests.Unit/InfrastructureTests/MessageContracts/SimpleEvent.cs
C#
mit
156
[ 30522, 2478, 9152, 14905, 2271, 1012, 4471, 8663, 6494, 16649, 1025, 3415, 15327, 9152, 14905, 2271, 1012, 5852, 1012, 3131, 1012, 6502, 22199, 2015, 1012, 4471, 8663, 6494, 16649, 1063, 2270, 2465, 3722, 18697, 3372, 1024, 21307, 8557, 153...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* jQuery UI Sortable plugin wrapper @param [ui-sortable] {object} Options to pass to $.fn.sortable() merged onto ui.config */ angular.module('ui.sortable', []) .value('uiSortableConfig',{}) .directive('uiSortable', [ 'uiSortableConfig', function(uiSortableConfig) { return { require: '?ngModel', link: function(scope, element, attrs, ngModel) { function combineCallbacks(first,second){ if( second && (typeof second === "function") ){ return function(e,ui){ first(e,ui); second(e,ui); }; } return first; } var opts = {}; var callbacks = { receive: null, remove:null, start:null, stop:null, update:null }; var apply = function(e, ui) { if (ui.item.sortable.resort || ui.item.sortable.relocate) { scope.$apply(); } }; angular.extend(opts, uiSortableConfig); if (ngModel) { ngModel.$render = function() { element.sortable( "refresh" ); }; callbacks.start = function(e, ui) { // Save position of dragged item ui.item.sortable = { index: ui.item.index() }; }; callbacks.update = function(e, ui) { // For some reason the reference to ngModel in stop() is wrong ui.item.sortable.resort = ngModel; }; callbacks.receive = function(e, ui) { ui.item.sortable.relocate = true; // added item to array into correct position and set up flag ngModel.$modelValue.splice(ui.item.index(), 0, ui.item.sortable.moved); }; callbacks.remove = function(e, ui) { // copy data into item if (ngModel.$modelValue.length === 1) { ui.item.sortable.moved = ngModel.$modelValue.splice(0, 1)[0]; } else { ui.item.sortable.moved = ngModel.$modelValue.splice(ui.item.sortable.index, 1)[0]; } }; callbacks.stop = function(e, ui) { // digest all prepared changes if (ui.item.sortable.resort && !ui.item.sortable.relocate) { // Fetch saved and current position of dropped element var end, start; start = ui.item.sortable.index; end = ui.item.index(); // Reorder array and apply change to scope ui.item.sortable.resort.$modelValue.splice(end, 0, ui.item.sortable.resort.$modelValue.splice(start, 1)[0]); } }; } scope.$watch(attrs.uiSortable, function(newVal, oldVal){ angular.forEach(newVal, function(value, key){ if( callbacks[key] ){ // wrap the callback value = combineCallbacks( callbacks[key], value ); if ( key === 'stop' ){ // call apply after stop value = combineCallbacks( value, apply ); } } element.sortable('option', key, value); }); }, true); angular.forEach(callbacks, function(value, key ){ opts[key] = combineCallbacks(value, opts[key]); }); // call apply after stop opts.stop = combineCallbacks( opts.stop, apply ); // Create sortable element.sortable(opts); } }; } ]);
kdisneur/wish_list
javascripts/angular-sortable.js
JavaScript
mit
4,272
[ 30522, 1013, 1008, 1046, 4226, 2854, 21318, 4066, 3085, 13354, 2378, 10236, 4842, 1030, 11498, 2213, 1031, 21318, 1011, 4066, 3085, 1033, 1063, 4874, 1065, 7047, 2000, 3413, 2000, 1002, 1012, 1042, 2078, 1012, 4066, 3085, 1006, 1007, 5314, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
namespace TanjiCore.Flazzy.ABC { public interface IClassTrait { ASClass Class { get; } int ClassIndex { get; set; } } }
scottstamp/TanjiCore
TanjiCore/TanjiCore.Flazzy/ABC/Traits/IClassTrait.cs
C#
gpl-3.0
150
[ 30522, 3415, 15327, 9092, 25008, 5686, 1012, 13109, 10936, 9096, 1012, 5925, 1063, 2270, 8278, 24582, 27102, 6494, 4183, 1063, 2004, 26266, 2465, 1063, 2131, 1025, 1065, 20014, 2465, 22254, 10288, 1063, 2131, 1025, 2275, 1025, 1065, 1065, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Gentiana swertioides Griseb. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Gentianaceae/Gentiana/Gentiana swertioides/README.md
Markdown
apache-2.0
178
[ 30522, 1001, 8991, 10772, 2050, 25430, 8743, 3695, 8621, 24665, 5562, 2497, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 1001, 2405, 1999, 19701, 1001, 1001, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from django.shortcuts import render from django.core.urlresolvers import reverse from django.contrib.auth.models import User from django.contrib.auth import authenticate, login, logout, update_session_auth_hash from django.core.exceptions import ObjectDoesNotExist from django.core.cache import cache from django.http import HttpResponse, HttpResponseRedirect from django.db import transaction from django_redis import get_redis_connection from users.models import PastebinUser from users.forms import RegisterForm, LoginForm, ChangePreferencesForm, ChangePasswordForm, VerifyPasswordForm from users.models import Favorite, SiteSettings from pastes.models import Paste from pastebin.util import Paginator import math def register_view(request): """ Register a new user """ # Check if the user is authenticated if request.user.is_authenticated(): # User is already authenticated return render(request, 'users/register/already_logged_in.html') else: register_form = RegisterForm(request.POST or None) if request.method == 'POST': # Form data was submitted if register_form.is_valid(): # Form data is valid # Create the user with transaction.atomic(): user = User.objects.create_user(register_form.cleaned_data['username'], "N/A", # we don't deal with email addresses register_form.cleaned_data['password']) PastebinUser.create_user(user) # TODO: Show a different message if the registration fails return render(request, 'users/register/register_success.html') # Show the registration page return render(request, "users/register/register.html", { "form": register_form }) def login_view(request): """ Log the user in """ # Check if the user is authenticated if request.user.is_authenticated(): # User is authenticated return render(request, "users/login/logged_in.html") else: login_form = LoginForm(request.POST or None) # User is NOT authenticated if request.method == 'POST': # Form data was submitted if login_form.is_valid(): # Form data is valid user = authenticate(username = login_form.cleaned_data['username'], password = login_form.cleaned_data['password']) if user is not None and user.is_active: login(request, user) return render(request, "users/login/logged_in.html") else: # Couldn't authenticate, either the username or password is wrong error = "User doesn't exist or the password is incorrect." login_form._errors['password'] = login_form.error_class([error]) # Show the login form return render(request, "users/login/login.html", { "form": login_form }) def logout_view(request): """ Logout the user and show the logout page """ if request.user.is_authenticated(): logout(request) return render(request, 'users/logout/logged_out.html') def profile(request, username, tab="home", page=1): """ Show a publicly visible profile page """ page = int(page) try: profile_user = cache.get("user:%s" % username) if profile_user == None: profile_user = User.objects.get(username=username) cache.set("user:%s" % username, profile_user) elif profile_user == False: return render(request, "users/profile/profile_error.html", {"reason": "not_found"}, status=404) except ObjectDoesNotExist: cache.set("user:%s" % username, False) return render(request, "users/profile/profile_error.html", {"reason": "not_found"}, status=404) # Get user's settings profile_settings = cache.get("site_settings:%s" % username) if profile_settings == None: try: profile_settings = SiteSettings.objects.get(user=profile_user) except ObjectDoesNotExist: profile_settings = SiteSettings(user=profile_user) profile_settings.save() cache.set("site_settings:%s" % username, profile_settings) if not profile_user.is_active: return render(request, "users/profile/profile_error.html", {"reason": "not_found"}, status=404) if request.user != profile_user: total_paste_count = cache.get("user_public_paste_count:%s" % profile_user.username) else: total_paste_count = cache.get("user_paste_count:%s" % profile_user.username) # If user is viewing his own profile, also include hidden pastes if total_paste_count == None and request.user != profile_user: total_paste_count = Paste.objects.filter(user=profile_user, removed=Paste.NO_REMOVAL).filter(hidden=False).count() cache.set("user_public_paste_count:%s" % profile_user.username, total_paste_count) elif total_paste_count == None and request.user == profile_user: total_paste_count = Paste.objects.filter(user=profile_user, removed=Paste.NO_REMOVAL).count() cache.set("user_paste_count:%s" % profile_user.username, total_paste_count) total_favorite_count = cache.get("user_favorite_count:%s" % profile_user.username) if total_favorite_count == None: total_favorite_count = Favorite.objects.filter(user=profile_user).count() cache.set("user_favorite_count:%s" % profile_user.username, total_favorite_count) args = {"profile_user": profile_user, "profile_settings": profile_settings, "current_page": page, "tab": tab, "total_favorite_count": total_favorite_count, "total_paste_count": total_paste_count} if tab == "home": return home(request, args) elif tab == "pastes": return pastes(request, profile_user, args, page) elif tab == "favorites": return favorites(request, profile_user, args, page) # The remaining pages require authentication, so redirect through settings() else: return settings(request, profile_user, args, tab) def settings(request, username, args={}, tab="change_password"): """ Show a page which allows the user to change his settings """ if not request.user.is_authenticated(): return render(request, "users/settings/settings_error.html", {"reason": "not_logged_in"}) profile_user = User.objects.get(username=username) if request.user.id != profile_user.id: return render(request, "users/settings/settings_error.html", {"reason": "incorrect_user"}) if tab == "change_preferences": return change_preferences(request, args) if tab == "change_password": return change_password(request, args) elif tab == "delete_account": return delete_account(request, args) def home(request, args): """ Display user profile's home with the most recent pastes and favorites """ # Get favorites only if user has made them public if args["profile_settings"].public_favorites or request.user == args["profile_user"]: args["favorites"] = cache.get("profile_favorites:%s" % args["profile_user"].username) if args["favorites"] == None: args["favorites"] = Favorite.objects.filter(user=args["profile_user"]).order_by('-added').select_related('paste')[:10] cache.set("profile_favorites:%s" % args["profile_user"].username, args["favorites"]) if request.user == args["profile_user"]: args["pastes"] = cache.get("profile_pastes:%s" % args["profile_user"].username) if args["pastes"] == None: args["pastes"] = Paste.objects.get_pastes(args["profile_user"], include_hidden=True, count=10) cache.set("profile_pastes:%s" % args["profile_user"].username, args["pastes"]) else: args["pastes"] = cache.get("profile_public_pastes:%s" % args["profile_user"].username) if args["pastes"] == None: args["pastes"] = Paste.objects.get_pastes(args["profile_user"], include_hidden=False, count=10) cache.set("profile_public_pastes:%s" % args["profile_user"].username, args["pastes"]) return render(request, "users/profile/home/home.html", args) def pastes(request, user, args, page=1): """ Show all of user's pastes """ PASTES_PER_PAGE = 15 args["total_pages"] = int(math.ceil(float(args["total_paste_count"]) / float(PASTES_PER_PAGE))) if page > args["total_pages"]: page = max(int(args["total_pages"]), 1) offset = (page-1) * PASTES_PER_PAGE if request.user == user: args["pastes"] = cache.get("user_pastes:%s:%s" % (user.username, page)) if args["pastes"] == None: args["pastes"] = Paste.objects.get_pastes(user, count=PASTES_PER_PAGE, include_hidden=True, offset=offset) cache.set("user_pastes:%s:%s" % (user.username, page), args["pastes"]) else: args["pastes"] = cache.get("user_public_pastes:%s:%s" % (user.username, page)) if args["pastes"] == None: args["pastes"] = Paste.objects.get_pastes(user, count=PASTES_PER_PAGE, include_hidden=False, offset=offset) cache.set("user_public_pastes:%s:%s" % (user.username, page), args["pastes"]) args["pages"] = Paginator.get_pages(page, PASTES_PER_PAGE, args["total_paste_count"]) args["current_page"] = page return render(request, "users/profile/pastes/pastes.html", args) def favorites(request, user, args, page=1): """ Show all of user's favorites """ FAVORITES_PER_PAGE = 15 if not args["profile_settings"].public_favorites and request.user != args["profile_user"]: # Don't show pastes to other users if the user doesn't want to return render(request, "users/profile/favorites/favorites_hidden.html", args) args["total_pages"] = int(math.ceil(float(args["total_favorite_count"]) / float(FAVORITES_PER_PAGE))) if page > args["total_pages"]: page = max(int(args["total_pages"]), 1) start = (page-1) * FAVORITES_PER_PAGE end = start + FAVORITES_PER_PAGE args["favorites"] = cache.get("user_favorites:%s:%s" % (user.username, page)) if args["favorites"] == None: args["favorites"] = Favorite.objects.filter(user=user).select_related("paste")[start:end] cache.set("user_favorites:%s:%s" % (user.username, page), args["favorites"]) args["pages"] = Paginator.get_pages(page, FAVORITES_PER_PAGE, args["total_favorite_count"]) args["current_page"] = page return render(request, "users/profile/favorites/favorites.html", args) def remove_favorite(request): """ Remove a favorite and redirect the user back to the favorite listing """ if "favorite_id" not in request.POST or not int(request.POST["favorite_id"]): return HttpResponse("Favorite ID was not valid.", status=422) if "page" not in request.POST or not int(request.POST["page"]): return HttpResponse("Page was not valid.", status=422) favorite_id = int(request.POST["favorite_id"]) page = int(request.POST["page"]) favorite = Favorite.objects.get(id=favorite_id) if not request.user.is_authenticated(): return HttpResponse("You are not authenticated", status=422) if favorite.user != request.user: return HttpResponse("You can't delete someone else's favorites.", status=422) favorite.delete() cache.delete("profile_favorites:%s" % request.user.username) cache.delete("user_favorite_count:%s" % request.user.username) return HttpResponseRedirect(reverse("users:favorites", kwargs={"username": request.user.username, "page": page})) def change_preferences(request, args): """ Change various profile-related preferences """ site_settings = SiteSettings.objects.get(user=request.user) form = ChangePreferencesForm(request.POST or None, initial={"public_favorites": site_settings.public_favorites}) preferences_changed = False if form.is_valid(): cleaned_data = form.cleaned_data site_settings.public_favorites = cleaned_data["public_favorites"] site_settings.save() cache.set("site_settings:%s" % request.user.username, site_settings) preferences_changed = True args["form"] = form args["preferences_changed"] = preferences_changed return render(request, "users/settings/change_preferences/change_preferences.html", args) def change_password(request, args): """ Change the user's password """ form = ChangePasswordForm(request.POST or None, user=request.user) password_changed = False if form.is_valid(): cleaned_data = form.cleaned_data request.user.set_password(cleaned_data["new_password"]) request.user.save() # Session auth hash needs to be updated after changing the password # or the user will be logged out update_session_auth_hash(request, request.user) password_changed = True args["form"] = form args["password_changed"] = password_changed return render(request, "users/settings/change_password/change_password.html", args) def delete_account(request, args): """ Delete the user's account """ form = VerifyPasswordForm(request.POST or None, user=request.user) if form.is_valid(): PastebinUser.delete_user(request.user) logout(request) return render(request, "users/settings/delete_account/account_deleted.html") args["form"] = form return render(request, "users/settings/delete_account/delete_account.html", args)
Matoking/pastebin-django
users/views.py
Python
unlicense
14,332
[ 30522, 2013, 6520, 23422, 1012, 2460, 12690, 2015, 12324, 17552, 2013, 6520, 23422, 1012, 4563, 1012, 24471, 20974, 2229, 4747, 14028, 12324, 7901, 2013, 6520, 23422, 1012, 9530, 18886, 2497, 1012, 8740, 2705, 1012, 4275, 12324, 5310, 2013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from unittest import TestCase from pyage.core import inject from pyage_forams.solutions.foram import Foram class TestForam(TestCase): def test_step(self): inject.config = "pyage_forams.conf.dummy_conf" foram = Foram(10) # foram.step()
maciek123/pyage-forams
pyage_forams/solutions/test_foram.py
Python
gpl-2.0
263
[ 30522, 2013, 3131, 22199, 12324, 3231, 18382, 2013, 1052, 3148, 3351, 1012, 30524, 12324, 2005, 3286, 2465, 3231, 29278, 3286, 1006, 3231, 18382, 1007, 1024, 13366, 3231, 1035, 3357, 1006, 2969, 1007, 1024, 1999, 20614, 1012, 9530, 8873, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* This file is part of HSPlasma. * * HSPlasma 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. * * HSPlasma 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 HSPlasma. If not, see <http://www.gnu.org/licenses/>. */ #include <PyPlasma.h> #include <PRP/Geometry/plSpan.h> #include "pySpan.h" #include "PRP/KeyedObject/pyKey.h" #include "PRP/Region/pyBounds.h" #include "Stream/pyStream.h" #include "Math/pyMatrix.h" extern "C" { static void pySpan_dealloc(pySpan* self) { if (self->fPyOwned) delete self->fThis; Py_TYPE(self)->tp_free((PyObject*)self); } static int pySpan___init__(pySpan* self, PyObject* args, PyObject* kwds) { if (!PyArg_ParseTuple(args, "")) return -1; return 0; } static PyObject* pySpan_new(PyTypeObject* type, PyObject* args, PyObject* kwds) { pySpan* self = (pySpan*)type->tp_alloc(type, 0); if (self != NULL) { self->fThis = new plSpan(); self->fPyOwned = true; } return (PyObject*)self; } static PyObject* pySpan_ClassName(pySpan* self) { return PyString_FromString(self->fThis->ClassName()); } static PyObject* pySpan_read(pySpan* self, PyObject* args) { pyStream* stream; if (!PyArg_ParseTuple(args, "O", &stream)) { PyErr_SetString(PyExc_TypeError, "read expects an hsStream"); return NULL; } if (!pyStream_Check((PyObject*)stream)) { PyErr_SetString(PyExc_TypeError, "read expects an hsStream"); return NULL; } self->fThis->read(stream->fThis); Py_INCREF(Py_None); return Py_None; } static PyObject* pySpan_write(pySpan* self, PyObject* args) { pyStream* stream; if (!PyArg_ParseTuple(args, "O", &stream)) { PyErr_SetString(PyExc_TypeError, "write expects an hsStream"); return NULL; } if (!pyStream_Check((PyObject*)stream)) { PyErr_SetString(PyExc_TypeError, "write expects an hsStream"); return NULL; } self->fThis->write(stream->fThis); Py_INCREF(Py_None); return Py_None; } static PyObject* pySpan_clearPermaLights(pySpan* self, PyObject* args) { self->fThis->clearPermaLights(); Py_INCREF(Py_None); return Py_None; } static PyObject* pySpan_clearPermaProjs(pySpan* self, PyObject* args) { self->fThis->clearPermaProjs(); Py_INCREF(Py_None); return Py_None; } static PyObject* pySpan_addPermaLight(pySpan* self, PyObject* args) { pyKey* key; if (!PyArg_ParseTuple(args, "O", &key)) { PyErr_SetString(PyExc_TypeError, "addPermaLight expects a plKey"); return NULL; } if (!pyKey_Check((PyObject*)key)) { PyErr_SetString(PyExc_TypeError, "addPermaLight expects a plKey"); return NULL; } self->fThis->addPermaLight(*key->fThis); Py_INCREF(Py_None); return Py_None; } static PyObject* pySpan_addPermaProj(pySpan* self, PyObject* args) { pyKey* key; if (!PyArg_ParseTuple(args, "O", &key)) { PyErr_SetString(PyExc_TypeError, "addPermaProj expects a plKey"); return NULL; } if (!pyKey_Check((PyObject*)key)) { PyErr_SetString(PyExc_TypeError, "addPermaProj expects a plKey"); return NULL; } self->fThis->addPermaProj(*key->fThis); Py_INCREF(Py_None); return Py_None; } static PyObject* pySpan_getFog(pySpan* self, void*) { return pyKey_FromKey(self->fThis->getFogEnvironment()); } static PyObject* pySpan_getLights(pySpan* self, void*) { PyObject* list = PyList_New(self->fThis->getPermaLights().size()); for (size_t i=0; i<self->fThis->getPermaLights().size(); i++) PyList_SET_ITEM(list, i, pyKey_FromKey(self->fThis->getPermaLights()[i])); return list; } static PyObject* pySpan_getProjs(pySpan* self, void*) { PyObject* list = PyList_New(self->fThis->getPermaProjs().size()); for (size_t i=0; i<self->fThis->getPermaProjs().size(); i++) PyList_SET_ITEM(list, i, pyKey_FromKey(self->fThis->getPermaProjs()[i])); return list; } static PyObject* pySpan_getL2W(pySpan* self, void*) { return pyMatrix44_FromMatrix44(self->fThis->getLocalToWorld()); } static PyObject* pySpan_getW2L(pySpan* self, void*) { return pyMatrix44_FromMatrix44(self->fThis->getWorldToLocal()); } static PyObject* pySpan_getSubType(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getSubType()); } static PyObject* pySpan_getMaterial(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getMaterialIdx()); } static PyObject* pySpan_getNumMatrices(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getNumMatrices()); } static PyObject* pySpan_getProps(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getProps()); } static PyObject* pySpan_getBaseMatrix(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getBaseMatrix()); } static PyObject* pySpan_getMaxBoneIdx(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getMaxBoneIdx()); } static PyObject* pySpan_getPenBoneIdx(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getPenBoneIdx()); } static PyObject* pySpan_getLocalUVWChans(pySpan* self, void*) { return PyInt_FromLong(self->fThis->getLocalUVWChans()); } static PyObject* pySpan_getMinDist(pySpan* self, void*) { return PyFloat_FromDouble(self->fThis->getMinDist()); } static PyObject* pySpan_getMaxDist(pySpan* self, void*) { return PyFloat_FromDouble(self->fThis->getMaxDist()); } static PyObject* pySpan_getWaterHeight(pySpan* self, void*) { return PyFloat_FromDouble(self->fThis->getWaterHeight()); } static PyObject* pySpan_getLocalBounds(pySpan* self, void*) { return pyBounds3Ext_FromBounds3Ext(self->fThis->getLocalBounds()); } static PyObject* pySpan_getWorldBounds(pySpan* self, void*) { return pyBounds3Ext_FromBounds3Ext(self->fThis->getWorldBounds()); } static int pySpan_setFog(pySpan* self, PyObject* value, void*) { if (value == NULL || !pyKey_Check(value)) { PyErr_SetString(PyExc_TypeError, "fog should be a plKey"); return -1; } self->fThis->setFogEnvironment(*((pyKey*)value)->fThis); return 0; } static int pySpan_setLights(pySpan* self, PyObject* value, void*) { PyErr_SetString(PyExc_RuntimeError, "To add Lights, use addPermaLight and addPermaProj"); return -1; } static int pySpan_setL2W(pySpan* self, PyObject* value, void*) { if (value == NULL || !pyMatrix44_Check(value)) { PyErr_SetString(PyExc_TypeError, "localToWorld should be an hsMatrix44"); return -1; } self->fThis->setLocalToWorld(*((pyMatrix44*)value)->fThis); return 0; } static int pySpan_setW2L(pySpan* self, PyObject* value, void*) { if (value == NULL || !pyMatrix44_Check(value)) { PyErr_SetString(PyExc_TypeError, "worldToLocal should be an hsMatrix44"); return -1; } self->fThis->setWorldToLocal(*((pyMatrix44*)value)->fThis); return 0; } static int pySpan_setSubType(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "subType should be an int"); return -1; } self->fThis->setSubType(PyInt_AsLong(value)); return 0; } static int pySpan_setMaterial(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "materialIdx should be an int"); return -1; } self->fThis->setMaterialIdx(PyInt_AsLong(value)); return 0; } static int pySpan_setNumMatrices(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "numMatrices should be an int"); return -1; } self->fThis->setNumMatrices(PyInt_AsLong(value)); return 0; } static int pySpan_setProps(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "props should be an int"); return -1; } self->fThis->setProps(PyInt_AsLong(value)); return 0; } static int pySpan_setBaseMatrix(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "baseMatrix should be an int"); return -1; } self->fThis->setBaseMatrix(PyInt_AsLong(value)); return 0; } static int pySpan_setMaxBoneIdx(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "maxBoneIdx should be an int"); return -1; } self->fThis->setMaxBoneIdx(PyInt_AsLong(value)); return 0; } static int pySpan_setPenBoneIdx(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "penBoneIdx should be an int"); return -1; } self->fThis->setPenBoneIdx(PyInt_AsLong(value)); return 0; } static int pySpan_setLocalUVWChans(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyInt_Check(value)) { PyErr_SetString(PyExc_TypeError, "localUVWChans should be an int"); return -1; } self->fThis->setLocalUVWChans(PyInt_AsLong(value)); return 0; } static int pySpan_setMinDist(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyFloat_Check(value)) { PyErr_SetString(PyExc_TypeError, "minDist should be an int"); return -1; } self->fThis->setMinDist(PyFloat_AsDouble(value)); return 0; } static int pySpan_setMaxDist(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyFloat_Check(value)) { PyErr_SetString(PyExc_TypeError, "maxDist should be an int"); return -1; } self->fThis->setMaxDist(PyFloat_AsDouble(value)); return 0; } static int pySpan_setWaterHeight(pySpan* self, PyObject* value, void*) { if (value == NULL || !PyFloat_Check(value)) { PyErr_SetString(PyExc_TypeError, "waterHeight should be an int"); return -1; } self->fThis->setWaterHeight(PyFloat_AsDouble(value)); return 0; } static int pySpan_setLocalBounds(pySpan* self, PyObject* value, void*) { if (value == NULL || !pyBounds3Ext_Check(value)) { PyErr_SetString(PyExc_TypeError, "localBounds should be an hsBounds3Ext"); return -1; } self->fThis->setLocalBounds(*((pyBounds3Ext*)value)->fThis); return 0; } static int pySpan_setWorldBounds(pySpan* self, PyObject* value, void*) { if (value == NULL || !pyBounds3Ext_Check(value)) { PyErr_SetString(PyExc_TypeError, "worldBounds should be an hsBounds3Ext"); return -1; } self->fThis->setWorldBounds(*((pyBounds3Ext*)value)->fThis); return 0; } static PyMethodDef pySpan_Methods[] = { { "ClassName", (PyCFunction)pySpan_ClassName, METH_NOARGS, "Returns the RTTI Class name of this Span object" }, { "read", (PyCFunction)pySpan_read, METH_VARARGS, "Params: stream\n" "Read this Span object from the stream" }, { "write", (PyCFunction)pySpan_write, METH_VARARGS, "Params: stream\n" "Write this Span object to the stream" }, { "clearPermaLights", (PyCFunction)pySpan_clearPermaLights, METH_NOARGS, "Remove all Perma Lights from this Span" }, { "clearPermaProjs", (PyCFunction)pySpan_clearPermaProjs, METH_NOARGS, "Remove all Perma Projs from this Span" }, { "addPermaLight", (PyCFunction)pySpan_addPermaLight, METH_VARARGS, "Params: key\n" "Add a Perma Light to the span" }, { "addPermaProj", (PyCFunction)pySpan_addPermaProj, METH_VARARGS, "Params: key\n" "Add a Perma Proj to the span" }, { NULL, NULL, 0, NULL } }; static PyGetSetDef pySpan_GetSet[] = { { _pycs("fog"), (getter)pySpan_getFog, (setter)pySpan_setFog, _pycs("Fog Environment key"), NULL }, { _pycs("permaLights"), (getter)pySpan_getLights, (setter)pySpan_setLights, NULL, NULL }, { _pycs("permaProjs"), (getter)pySpan_getProjs, (setter)pySpan_setLights, NULL, NULL }, { _pycs("localToWorld"), (getter)pySpan_getL2W, (setter)pySpan_setL2W, NULL, NULL }, { _pycs("worldToLocal"), (getter)pySpan_getW2L, (setter)pySpan_setW2L, NULL, NULL }, { _pycs("subType"), (getter)pySpan_getSubType, (setter)pySpan_setSubType, NULL, NULL }, { _pycs("materialIdx"), (getter)pySpan_getMaterial, (setter)pySpan_setMaterial, _pycs("Index of the material from the DrawableSpans to use"), NULL }, { _pycs("numMatrices"), (getter)pySpan_getNumMatrices, (setter)pySpan_setNumMatrices, NULL, NULL }, { _pycs("props"), (getter)pySpan_getProps, (setter)pySpan_setProps, NULL, NULL }, { _pycs("baseMatrix"), (getter)pySpan_getBaseMatrix, (setter)pySpan_setBaseMatrix, NULL, NULL }, { _pycs("maxBoneIdx"), (getter)pySpan_getMaxBoneIdx, (setter)pySpan_setMaxBoneIdx, NULL, NULL }, { _pycs("penBoneIdx"), (getter)pySpan_getPenBoneIdx, (setter)pySpan_setPenBoneIdx, NULL, NULL }, { _pycs("localUVWChans"), (getter)pySpan_getLocalUVWChans, (setter)pySpan_setLocalUVWChans, NULL, NULL }, { _pycs("minDist"), (getter)pySpan_getMinDist, (setter)pySpan_setMinDist, NULL, NULL }, { _pycs("maxDist"), (getter)pySpan_getMaxDist, (setter)pySpan_setMaxDist, NULL, NULL }, { _pycs("waterHeight"), (getter)pySpan_getWaterHeight, (setter)pySpan_setWaterHeight, NULL, NULL }, { _pycs("localBounds"), (getter)pySpan_getLocalBounds, (setter)pySpan_setLocalBounds, NULL, NULL }, { _pycs("worldBounds"), (getter)pySpan_getWorldBounds, (setter)pySpan_setWorldBounds, NULL, NULL }, { NULL, NULL, NULL, NULL, NULL } }; PyTypeObject pySpan_Type = { PyVarObject_HEAD_INIT(NULL, 0) "PyHSPlasma.plSpan", /* tp_name */ sizeof(pySpan), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)pySpan_dealloc, /* tp_dealloc */ NULL, /* tp_print */ NULL, /* tp_getattr */ NULL, /* tp_setattr */ NULL, /* tp_compare */ NULL, /* tp_repr */ NULL, /* tp_as_number */ NULL, /* tp_as_sequence */ NULL, /* tp_as_mapping */ NULL, /* tp_hash */ NULL, /* tp_call */ NULL, /* tp_str */ NULL, /* tp_getattro */ NULL, /* tp_setattro */ NULL, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ "plSpan wrapper", /* tp_doc */ NULL, /* tp_traverse */ NULL, /* tp_clear */ NULL, /* tp_richcompare */ 0, /* tp_weaklistoffset */ NULL, /* tp_iter */ NULL, /* tp_iternext */ pySpan_Methods, /* tp_methods */ NULL, /* tp_members */ pySpan_GetSet, /* tp_getset */ NULL, /* tp_base */ NULL, /* tp_dict */ NULL, /* tp_descr_get */ NULL, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)pySpan___init__, /* tp_init */ NULL, /* tp_alloc */ pySpan_new, /* tp_new */ NULL, /* tp_free */ NULL, /* tp_is_gc */ NULL, /* tp_bases */ NULL, /* tp_mro */ NULL, /* tp_cache */ NULL, /* tp_subclasses */ NULL, /* tp_weaklist */ NULL, /* tp_del */ TP_VERSION_TAG_INIT /* tp_version_tag */ TP_FINALIZE_INIT /* tp_finalize */ }; PyObject* Init_pySpan_Type() { if (PyType_Ready(&pySpan_Type) < 0) return NULL; PyDict_SetItemString(pySpan_Type.tp_dict, "kLiteMaterial", PyInt_FromLong(plSpan::kLiteMaterial)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropNoDraw", PyInt_FromLong(plSpan::kPropNoDraw)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropNoShadowCast", PyInt_FromLong(plSpan::kPropNoShadowCast)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropFacesSortable", PyInt_FromLong(plSpan::kPropFacesSortable)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropVolatile", PyInt_FromLong(plSpan::kPropVolatile)); PyDict_SetItemString(pySpan_Type.tp_dict, "kWaterHeight", PyInt_FromLong(plSpan::kWaterHeight)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropRunTimeLight", PyInt_FromLong(plSpan::kPropRunTimeLight)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropReverseSort", PyInt_FromLong(plSpan::kPropReverseSort)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropHasPermaLights", PyInt_FromLong(plSpan::kPropHasPermaLights)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropHasPermaProjs", PyInt_FromLong(plSpan::kPropHasPermaProjs)); PyDict_SetItemString(pySpan_Type.tp_dict, "kLiteVtxPreshaded", PyInt_FromLong(plSpan::kLiteVtxPreshaded)); PyDict_SetItemString(pySpan_Type.tp_dict, "kLiteVtxNonPreshaded", PyInt_FromLong(plSpan::kLiteVtxNonPreshaded)); PyDict_SetItemString(pySpan_Type.tp_dict, "kLiteProjection", PyInt_FromLong(plSpan::kLiteProjection)); PyDict_SetItemString(pySpan_Type.tp_dict, "kLiteShadowErase", PyInt_FromLong(plSpan::kLiteShadowErase)); PyDict_SetItemString(pySpan_Type.tp_dict, "kLiteShadow", PyInt_FromLong(plSpan::kLiteShadow)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropMatHasSpecular", PyInt_FromLong(plSpan::kPropMatHasSpecular)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropProjAsVtx", PyInt_FromLong(plSpan::kPropProjAsVtx)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropSkipProjection", PyInt_FromLong(plSpan::kPropSkipProjection)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropNoShadow", PyInt_FromLong(plSpan::kPropNoShadow)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropForceShadow", PyInt_FromLong(plSpan::kPropForceShadow)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropDisableNormal", PyInt_FromLong(plSpan::kPropDisableNormal)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPropCharacter", PyInt_FromLong(plSpan::kPropCharacter)); PyDict_SetItemString(pySpan_Type.tp_dict, "kPartialSort", PyInt_FromLong(plSpan::kPartialSort)); PyDict_SetItemString(pySpan_Type.tp_dict, "kVisLOS", PyInt_FromLong(plSpan::kVisLOS)); // plSpanType PyDict_SetItemString(pySpan_Type.tp_dict, "kSpan", PyInt_FromLong(plSpan::kSpan)); PyDict_SetItemString(pySpan_Type.tp_dict, "kVertexSpan", PyInt_FromLong(plSpan::kVertexSpan)); PyDict_SetItemString(pySpan_Type.tp_dict, "kIcicleSpan", PyInt_FromLong(plSpan::kIcicleSpan)); PyDict_SetItemString(pySpan_Type.tp_dict, "kNullSpan", PyInt_FromLong(plSpan::kNullSpan)); PyDict_SetItemString(pySpan_Type.tp_dict, "kParticleSpan", PyInt_FromLong(plSpan::kParticleSpan)); PyDict_SetItemString(pySpan_Type.tp_dict, "kParticleSet", PyInt_FromLong(plSpan::kParticleSet)); Py_INCREF(&pySpan_Type); return (PyObject*)&pySpan_Type; } int pySpan_Check(PyObject* obj) { if (obj->ob_type == &pySpan_Type || PyType_IsSubtype(obj->ob_type, &pySpan_Type)) return 1; return 0; } PyObject* pySpan_FromSpan(plSpan* span) { if (span == NULL) { Py_INCREF(Py_None); return Py_None; } pySpan* obj = PyObject_New(pySpan, &pySpan_Type); obj->fThis = span; obj->fPyOwned = false; return (PyObject*)obj; } }
diafero/libhsplasma
Python/PRP/Geometry/pySpan.cpp
C++
gpl-3.0
21,397
[ 30522, 1013, 1008, 2023, 5371, 2003, 2112, 1997, 26236, 24759, 3022, 2863, 1012, 1008, 1008, 26236, 24759, 3022, 2863, 2003, 2489, 4007, 1024, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, 1008, 2009, 2104, 30524,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// @(#)root/roostats:$Id$ // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke /************************************************************************* * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing terms see $ROOTSYS/LICENSE. * * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ #ifndef ROOSTATS_TestStatistic #define ROOSTATS_TestStatistic #include "Rtypes.h" class RooArgSet; class RooAbsData; namespace RooStats { /** \class RooStats::TestStatistic \ingroup Roostats TestStatistic is an interface class to provide a facility for construction test statistics distributions to the NeymanConstruction class. All the actual samplers inherit from this class. */ class TestStatistic { public: //TestStatistic(); virtual ~TestStatistic() { } /// Main interface to evaluate the test statistic on a dataset given the /// values for the Null Parameters Of Interest. virtual Double_t Evaluate(RooAbsData& data, RooArgSet& nullPOI) = 0; virtual const TString GetVarName() const = 0; /// Defines the sign convention of the test statistic. Overwrite function if necessary. virtual bool PValueIsRightTail(void) const { return true; } /// return detailed output: for fits this can be pulls, processing time, ... The returned pointer will not loose validity until another call to Evaluate. virtual const RooArgSet* GetDetailedOutput() const { return NULL; } protected: ClassDef(TestStatistic,1) /// Interface for a TestStatistic }; } // end namespace RooStats #endif
beniz/root
roofit/roostats/inc/RooStats/TestStatistic.h
C
lgpl-2.1
1,904
[ 30522, 1013, 1013, 1030, 1006, 1001, 1007, 7117, 1013, 20996, 28696, 3215, 1024, 1002, 8909, 1002, 1013, 1013, 3166, 1024, 7648, 13675, 2319, 5017, 1010, 12484, 12256, 12928, 1010, 7296, 8040, 12326, 2102, 1010, 24185, 19901, 2310, 25074, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/**************************************************************************** ** ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** You may use this file under the terms of the BSD license as follows: ** ** "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 Digia Plc and its Subsidiary(-ies) 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 THE COPYRIGHT ** OWNER 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." ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <QtWidgets> #include "addressbook.h" //! [constructor and input fields] AddressBook::AddressBook(QWidget *parent) : QWidget(parent) { QLabel *nameLabel = new QLabel(tr("Name:")); nameLine = new QLineEdit; QLabel *addressLabel = new QLabel(tr("Address:")); addressText = new QTextEdit; //! [constructor and input fields] //! [layout] QGridLayout *mainLayout = new QGridLayout; mainLayout->addWidget(nameLabel, 0, 0); mainLayout->addWidget(nameLine, 0, 1); mainLayout->addWidget(addressLabel, 1, 0, Qt::AlignTop); mainLayout->addWidget(addressText, 1, 1); //! [layout] //![setting the layout] setLayout(mainLayout); setWindowTitle(tr("Simple Address Book")); } //! [setting the layout]
CodeDJ/qt5-hidpi
qt/qtbase/examples/widgets/tutorials/addressbook/part1/addressbook.cpp
C++
lgpl-2.1
2,740
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Dianthus giganteiformis subsp. kladovanus (Degen) Soó SUBSPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Dianthus/Dianthus giganteiformis/Dianthus giganteiformis kladovanus/README.md
Markdown
apache-2.0
207
[ 30522, 1001, 22939, 3372, 9825, 15453, 12956, 22631, 2483, 24807, 1012, 1047, 27266, 7103, 10182, 1006, 2139, 6914, 1007, 17111, 11056, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import React, { PropTypes } from 'react'; import c from '../../pages/common.css'; import cx from 'classnames'; class ApplicationPanel extends React.Component { static propTypes = { handleChange: React.PropTypes.func, value: React.PropTypes.string }; render() { const {handleChange, value} = this.props; return ( <form role="form"> <div className="form-group"> <label htmlFor="input1" className="required-pf">Application</label> <textarea type="text" className="form-control" id="input1" required="" rows="10" placeholder="paste application json..." value={value} onChange={handleChange}/> </div> </form> ) } } export default ApplicationPanel;
priley86/labs-console
components/Canvas/ApplicationPanel.js
JavaScript
apache-2.0
788
[ 30522, 12324, 10509, 1010, 1063, 17678, 13874, 2015, 1065, 2013, 1005, 10509, 1005, 1025, 12324, 1039, 2013, 1005, 1012, 1012, 1013, 1012, 1012, 1013, 5530, 1013, 2691, 1012, 20116, 2015, 1005, 1025, 12324, 1039, 2595, 2013, 1005, 2465, 184...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
const certificationUrl = '/certification/developmentuser/responsive-web-design'; const projects = { superBlock: 'responsive-web-design', block: 'responsive-web-design-projects', challenges: [ { slug: 'build-a-tribute-page', solution: 'https://codepen.io/moT01/pen/ZpJpKp' }, { slug: 'build-a-survey-form', solution: 'https://codepen.io/moT01/pen/LrrjGz?editors=1010' }, { slug: 'build-a-product-landing-page', solution: 'https://codepen.io/moT01/full/qKyKYL/' }, { slug: 'build-a-technical-documentation-page', solution: 'https://codepen.io/moT01/full/JBvzNL/' }, { slug: 'build-a-personal-portfolio-webpage', solution: 'https://codepen.io/moT01/pen/vgOaoJ' } ] }; describe('A certification,', function () { before(() => { cy.exec('npm run seed'); cy.login(); // submit projects for certificate const { superBlock, block, challenges } = projects; challenges.forEach(({ slug, solution }) => { const url = `/learn/${superBlock}/${block}/${slug}`; cy.visit(url); cy.get('#dynamic-front-end-form') .get('#solution') .type(solution, { force: true, delay: 0 }); cy.contains("I've completed this challenge") .should('not.be.disabled') .click(); cy.contains('Submit and go to next challenge').click().wait(1000); }); cy.get('.donation-modal').should('be.visible'); cy.visit('/settings'); // set user settings to public to claim a cert cy.get('label:contains(Public)>input').each(el => { if (!/toggle-active/.test(el[0].parentElement.className)) { cy.wrap(el).click({ force: true }); cy.wait(1000); } }); // if honest policy not accepted cy.get('.honesty-policy button').then(btn => { if (btn[0].innerText === 'Agree') { btn[0].click({ force: true }); cy.wait(1000); } }); // claim certificate cy.get('a[href*="developmentuser/responsive-web-design"]').click({ force: true }); }); describe('while viewing your own,', function () { before(() => { cy.login(); cy.visit(certificationUrl); }); it('should render a LinkedIn button', function () { cy.contains('Add this certification to my LinkedIn profile') .should('have.attr', 'href') .and( 'match', // eslint-disable-next-line max-len /https:\/\/www\.linkedin\.com\/profile\/add\?startTask=CERTIFICATION_NAME&name=Responsive Web Design&organizationId=4831032&issueYear=\d\d\d\d&issueMonth=\d\d?&certUrl=https:\/\/freecodecamp\.org\/certification\/developmentuser\/responsive-web-design/ ); }); it('should render a Twitter button', function () { cy.contains('Share this certification on Twitter').should( 'have.attr', 'href', 'https://twitter.com/intent/tweet?text=I just earned the Responsive Web Design certification @freeCodeCamp! Check it out here: https://freecodecamp.org/certification/developmentuser/responsive-web-design' ); }); it("should be issued with today's date", () => { const date = new Date(); const issued = `Issued\xa0${new Intl.DateTimeFormat('en-US', { month: 'long' }).format(date)} ${date.getDate()}, ${date.getFullYear()}`; cy.get('[data-cy=issue-date]').should('have.text', issued); }); }); describe("while viewing someone else's,", function () { before(() => { cy.visit(certificationUrl); }); it('should display certificate', function () { cy.contains('has successfully completed the freeCodeCamp.org').should( 'exist' ); cy.contains('Responsive Web Design').should('exist'); }); it('should not render a LinkedIn button', function () { cy.contains('Add this certification to my LinkedIn profile').should( 'not.exist' ); }); it('should not render a Twitter button', function () { cy.contains('Share this certification on Twitter').should('not.exist'); }); }); });
raisedadead/FreeCodeCamp
cypress/integration/ShowCertification.js
JavaScript
bsd-3-clause
4,115
[ 30522, 9530, 3367, 10618, 3126, 2140, 1027, 1005, 1013, 10618, 1013, 2458, 20330, 1013, 26651, 1011, 4773, 1011, 2640, 1005, 1025, 9530, 3367, 3934, 1027, 1063, 21688, 7878, 1024, 1005, 26651, 1011, 4773, 1011, 2640, 1005, 1010, 3796, 1024,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
This quick start guide will teach you how to wire up TypeScript with [React](http://facebook.github.io/react/). By the end, you'll have * a project with React and TypeScript * linting with [TSLint](https://github.com/palantir/tslint) * testing with [Jest](https://facebook.github.io/jest/) and [Enzyme](http://airbnb.io/enzyme/), and * state management with [Redux](https://github.com/reactjs/react-redux) We'll use the [create-react-app](https://github.com/facebookincubator/create-react-app) tool to quickly get set up. We assume that you're already using [Node.js](https://nodejs.org/) with [npm](https://www.npmjs.com/). You may also want to get a sense of [the basics with React](https://facebook.github.io/react/docs/hello-world.html). # Install create-react-app We're going to use the create-react-app because it sets some useful tools and canonical defaults for React projects. This is just a command-line utility to scaffold out new React projects. ```shell npm install -g create-react-app ``` # Create our new project We'll create a new project called `my-app`: ```shell create-react-app my-app --scripts-version=react-scripts-ts ``` [react-scripts-ts](https://www.npmjs.com/package/react-scripts-ts) is a set of adjustments to take the standard create-react-app project pipeline and bring TypeScript into the mix. At this point, your project layout should look like the following: ```text my-app/ ├─ .gitignore ├─ node_modules/ ├─ public/ ├─ src/ │ └─ ... ├─ package.json ├─ tsconfig.json └─ tslint.json ``` Of note: * `tsconfig.json` contains TypeScript-specific options for our project. * `tslint.json` stores the settings that our linter, [TSLint](https://github.com/palantir/tslint), will use. * `package.json` contains our dependencies, as well as some shortcuts for commands we'd like to run for testing, previewing, and deploying our app. * `public` contains static assets like the HTML page we're planning to deploy to, or images. You can delete any file in this folder apart from `index.html`. * `src` contains our TypeScript and CSS code. `index.tsx` is the entry-point for our file, and is mandatory. # Running the project Running the project is as simple as running ```sh npm run start ``` This runs the `start` script specified in our `package.json`, and will spawn off a server which reloads the page as we save our files. Typically the server runs at `http://localhost:3000`, but should be automatically opened for you. This tightens the iteration loop by allowing us to quickly preview changes. # Testing the project Testing is also just a command away: ```sh npm run test ``` This command runs Jest, an incredibly useful testing utility, against all files whose extensions end in `.test.ts` or `.spec.ts`. Like with the `npm run start` command, Jest will automatically run as soon as it detects changes. If you'd like, you can run `npm run start` and `npm run test` side by side so that you can preview changes and test them simultaneously. # Creating a production build When running the project with `npm run start`, we didn't end up with an optimized build. Typically, we want the code we ship to users to be as fast and small as possible. Certain optimizations like minification can accomplish this, but often take more time. We call builds like this "production" builds (as opposed to development builds). To run a production build, just run ```sh npm run build ``` This will create an optimized JS and CSS build in `./build/static/js` and `./build/static/css` respectively. You won't need to run a production build most of the time, but it is useful if you need to measure things like the final size of your app. # Creating a component We're going to write a `Hello` component. The component will take the name of whatever we want to greet (which we'll call `name`), and optionally the number of exclamation marks to trail with (`enthusiasmLevel`). When we write something like `<Hello name="Daniel" enthusiasmLevel={3} />`, the component should render to something like `<div>Hello Daniel!!!</div>`. If `enthusiasmLevel` isn't specified, the component should default to showing one exclamation mark. If `enthusiasmLevel` is `0` or negative, it should throw an error. We'll write a `Hello.tsx`: ```ts // src/components/Hello.tsx import * as React from 'react'; export interface Props { name: string; enthusiasmLevel?: number; } function Hello({ name, enthusiasmLevel = 1 }: Props) { if (enthusiasmLevel <= 0) { throw new Error('You could be a little more enthusiastic. :D'); } return ( <div className="hello"> <div className="greeting"> Hello {name + getExclamationMarks(enthusiasmLevel)} </div> </div> ); } export default Hello; // helpers function getExclamationMarks(numChars: number) { return Array(numChars + 1).join('!'); } ``` Notice that we defined a type named `Props` that specifies the properties our component will take. `name` is a required `string`, and `enthusiasmLevel` is an optional `number` (which you can tell from the `?` that we wrote out after its name). We also wrote `Hello` as a stateless function component (an SFC). To be specific, `Hello` is a function that takes a `Props` object, and destructures it. If `enthusiasmLevel` isn't given in our `Props` object, it will default to `1`. Writing functions is one of two primary [ways React allows us to make components]((https://facebook.github.io/react/docs/components-and-props.html#functional-and-class-components)). If we wanted, we *could* have written it out as a class as follows: ```ts class Hello extends React.Component<Props, object> { render() { const { name, enthusiasmLevel = 1 } = this.props; if (enthusiasmLevel <= 0) { throw new Error('You could be a little more enthusiastic. :D'); } return ( <div className="hello"> <div className="greeting"> Hello {name + getExclamationMarks(enthusiasmLevel)} </div> </div> ); } } ``` Classes are useful [when our component instances have some state](https://facebook.github.io/react/docs/state-and-lifecycle.html). But we don't really need to think about state in this example - in fact, we specified it as `object` in `React.Component<Props, object>`, so writing an SFC tends to be shorter. Local component state is more useful at the presentational level when creating generic UI elements that can be shared between libraries. For our application's lifecycle, we will revisit how applications manage general state with Redux in a bit. Now that we've written our component, let's dive into `index.tsx` and replace our render of `<App />` with a render of `<Hello ... />`. First we'll import it at the top of the file: ```ts import Hello from './components/Hello'; ``` and then change up our `render` call: ```ts ReactDOM.render( <Hello name="TypeScript" enthusiasmLevel={10} />, document.getElementById('root') as HTMLElement ); ``` ## Type assertions One final thing we'll point out in this section is the line `document.getElementById('root') as HTMLElement`. This syntax is called a *type assertion*, sometimes also called a *cast*. This is a useful way of telling TypeScript what the real type of an expression is when you know better than the type checker. The reason we need to do so in this case is that `getElementById`'s return type is `HTMLElement | null`. Put simply, `getElementById` returns `null` when it can't find an element with a given `id`. We're assuming that `getElementById` will actually succeed, so we need convince TypeScript of that using the `as` syntax. TypeScript also has a trailing "bang" syntax (`!`), which removes `null` and `undefined` from the prior expression. So we *could* have written `document.getElementById('root')!`, but in this case we wanted to be a bit more explicit. # Adding style 😎 Styling a component with our setup is easy. To style our `Hello` component, we can create a CSS file at `src/components/Hello.css`. ```css .hello { text-align: center; margin: 20px; font-size: 48px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } .hello button { margin-left: 25px; margin-right: 25px; font-size: 40px; min-width: 50px; } ``` The tools that create-react-app uses (namely, Webpack and various loaders) allow us to just import the stylesheets we're interested in. When our build runs, any imported `.css` files will be concatenated into an output file. So in `src/components/Hello.tsx`, we'll add the following import. ```ts import './Hello.css'; ``` # Writing tests with Jest We had a certain set of assumptions about our `Hello` component. Let's reiterate what they were: > * When we write something like `<Hello name="Daniel" enthusiasmLevel={3} />`, the component should render to something like `<div>Hello Daniel!!!</div>`. > * If `enthusiasmLevel` isn't specified, the component should default to showing one exclamation mark. > * If `enthusiasmLevel` is `0` or negative, it should throw an error. We can use these requirements to write a few tests for our components. But first, let's install Enzyme. [Enzyme](http://airbnb.io/enzyme/) is a common tool in the React ecosystem that makes it easier to write tests for how components will behave. By default, our application includes a library called jsdom to allow us to simulate the DOM and test its runtime behavior without a browser. Enzyme is similar, but builds on jsdom and makes it easier to make certain queries about our components. Let's install it as a development-time dependency. ```sh npm install -D enzyme @types/enzyme react-addons-test-utils ``` Notice we installed packages `enzyme` as well as `@types/enzyme`. The `enzyme` package refers to the package containing JavaScript code that actually gets run, while `@types/enzyme` is a package that contains declaration files (`.d.ts` files) so that TypeScript can understand how you can use Enzyme. You can learn more about `@types` packages [here](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html). We also had to install `react-addons-test-utils`. This is something `enzyme` expects to be installed. Now that we've got Enzyme set up, let's start writing our test! Let's create a file named `src/components/Hello.test.tsx`, adjacent to our `Hello.tsx` file from earlier. ```ts // src/components/Hello.test.tsx import * as React from 'react'; import * as enzyme from 'enzyme'; import Hello from './Hello'; it('renders the correct text when no enthusiasm level is given', () => { const hello = enzyme.shallow(<Hello name='Daniel' />); expect(hello.find(".greeting").text()).toEqual('Hello Daniel!') }); it('renders the correct text with an explicit enthusiasm of 1', () => { const hello = enzyme.shallow(<Hello name='Daniel' enthusiasmLevel={1}/>); expect(hello.find(".greeting").text()).toEqual('Hello Daniel!') }); it('renders the correct text with an explicit enthusiasm level of 5', () => { const hello = enzyme.shallow(<Hello name='Daniel' enthusiasmLevel={5} />); expect(hello.find(".greeting").text()).toEqual('Hello Daniel!!!!!'); }); it('throws when the enthusiasm level is 0', () => { expect(() => { enzyme.shallow(<Hello name='Daniel' enthusiasmLevel={0} />); }).toThrow(); }); it('throws when the enthusiasm level is negative', () => { expect(() => { enzyme.shallow(<Hello name='Daniel' enthusiasmLevel={-1} />); }).toThrow(); }); ``` These tests are extremely basic, but you should be able to get the gist of things. # Adding state management At this point, if all you're using React for is fetching data once and displaying it, you can consider yourself done. But if you're developing an app that's more interactive, then you may need to add state management. ## State management in general On its own, React is a useful library for creating composable views. However, React doesn't come with any facility for synchronizing data between your application. As far as a React component is concerned, data flows down through its children through the props you specify on each element. Because React on its own does not provide built-in support for state management, the React community uses libraries like Redux and MobX. [Redux](http://redux.js.org) relies on synchronizing data through a centralized and immutable store of data, and updates to that data will trigger a re-render of our application. State is updated in an immutable fashion by sending explicit action messages which must be handled by functions called reducers. Because of the explicit nature, it is often easier to reason about how an action will affect the state of your program. [MobX](https://mobx.js.org/) relies on functional reactive patterns where state is wrapped through observables and passed through as props. Keeping state fully synchronized for any observers is done by simply marking state as observable. As a nice bonus, the library is already written in TypeScript. There are various merits and tradeoffs to both. Generally Redux tends to see more widespread usage, so for the purposes of this tutorial, we'll focus on adding Redux; however, you should feel encouraged to explore both. The following section may have a steep learning curve. We strongly suggest you [familiarize yourself with Redux through its documentation](http://redux.js.org/). ## Setting the stage for actions It doesn't make sense to add Redux unless the state of our application changes. We need a source of actions that will trigger changes to take place. This can be a timer, or something in the UI like a button. For our purposes, we're going to add two buttons to control the enthusiasm level for our `Hello` component. ## Installing Redux To add Redux, we'll first install `redux` and `react-redux`, as well as their types, as a dependency. ```sh npm install -S redux react-redux @types/react-redux ``` In this case we didn't need to install `@types/redux` because Redux already comes with its own definition files (`.d.ts` files). ## Defining our app's state We need to define the shape of the state which Redux will store. For this, we can create a file called `src/types/index.tsx` which will contain definitions for types that we might use throughout the program. ```ts // src/types/index.tsx export interface StoreState { languageName: string; enthusiasmLevel: number; } ``` Our intention is that `languageName` will be the programming language this app was written in (i.e. TypeScript or JavaScript) and `enthusiasmLevel` will vary. When we write our first container, we'll understand why we intentionally made our state slightly different from our props. ## Adding actions Let's start off by creating a set of message types that our app can respond to in `src/constants/index.tsx`. ```ts // src/constants/index.tsx export const INCREMENT_ENTHUSIASM = 'INCREMENT_ENTHUSIASM'; export type INCREMENT_ENTHUSIASM = typeof INCREMENT_ENTHUSIASM; export const DECREMENT_ENTHUSIASM = 'DECREMENT_ENTHUSIASM'; export type DECREMENT_ENTHUSIASM = typeof DECREMENT_ENTHUSIASM; ``` This `const`/`type` pattern allows us to use TypeScript's string literal types in an easily accessible and refactorable way. Next, we'll create a set of actions and functions that can create these actions in `src/actions/index.tsx`. ```ts import * as constants from '../constants' export interface IncrementEnthusiasm { type: constants.INCREMENT_ENTHUSIASM; } export interface DecrementEnthusiasm { type: constants.DECREMENT_ENTHUSIASM; } export type EnthusiasmAction = IncrementEnthusiasm | DecrementEnthusiasm; export function incrementEnthusiasm(): IncrementEnthusiasm { return { type: constants.INCREMENT_ENTHUSIASM } } export function decrementEnthusiasm(): DecrementEnthusiasm { return { type: constants.DECREMENT_ENTHUSIASM } } ``` We've created two types that describe what increment actions and decrement actions should look like. We also created a type (`EnthusiasmAction`) to describe cases where an action could be an increment or a decrement. Finally, we made two functions that actually manufacture the actions which we can use instead of writing out bulky object literals. There's clearly boilerplate here, so you should feel free to look into libraries like [redux-actions](https://www.npmjs.com/package/redux-actions) once you've got the hang of things. ## Adding a reducer We're ready to write our first reducer! Reducers are just functions that generate changes by creating modified copies of our application's state, but that have *no side effects*. In other words, they're what we call *[pure functions](https://en.wikipedia.org/wiki/Pure_function)*. Our reducer will go under `src/reducers/index.tsx`. Its function will be to ensure that increments raise the enthusiasm level by 1, and that decrements reduce the enthusiasm level by 1, but that the level never falls below 1. ```ts // src/reducers/index.tsx import { EnthusiasmAction } from '../actions'; import { StoreState } from '../types/index'; import { INCREMENT_ENTHUSIASM, DECREMENT_ENTHUSIASM } from '../constants/index'; export function enthusiasm(state: StoreState, action: EnthusiasmAction): StoreState { switch (action.type) { case INCREMENT_ENTHUSIASM: return { ...state, enthusiasmLevel: state.enthusiasmLevel + 1 }; case DECREMENT_ENTHUSIASM: return { ...state, enthusiasmLevel: Math.max(1, state.enthusiasmLevel - 1) }; } return state; } ``` Notice that we're using the *object spread* (`...state`) which allows us to create a shallow copy of our state, while replacing the `enthusiasmLevel`. It's important that the `enthusiasmLevel` property come last, since otherwise it would be overridden by the property in our old state. You may want to write a few tests for your reducer. Since reducers are pure functions, they can be passed arbitrary data. For every input, reducers can tested by checking their newly produced state. Consider looking into Jest's [toEqual](https://facebook.github.io/jest/docs/expect.html#toequalvalue) method to accomplish this. ## Making a container When writing with Redux, we will often write components as well as containers. Components are often data-agnostic, and work mostly at a presentational level. *Containers* typically wrap components and feed them any data that is necessary to display and modify state. You can read more about this concept on [Dan Abramov's article *Presentational and Container Components*](https://medium.com/@dan_abramov/smart-and-dumb-components-7ca2f9a7c7d0). First let's update `src/components/Hello.tsx` so that it can modify state. We'll add two optional callback properties to `Props` named `onIncrement` and `onDecrement`: ```ts export interface Props { name: string; enthusiasmLevel?: number; onIncrement?: () => void; onDecrement?: () => void; } ``` Then we'll bind those callbacks to two new buttons that we'll add into our component. ```ts function Hello({ name, enthusiasmLevel = 1, onIncrement, onDecrement }: Props) { if (enthusiasmLevel <= 0) { throw new Error('You could be a little more enthusiastic. :D'); } return ( <div className="hello"> <div className="greeting"> Hello {name + getExclamationMarks(enthusiasmLevel)} </div> <div> <button onClick={onDecrement}>-</button> <button onClick={onIncrement}>+</button> </div> </div> ); } ``` In general, it'd be a good idea to write a few tests for `onIncrement` and `onDecrement` being triggered when their respective buttons are clicked. Give it a shot to get the hang of writing tests for your components. Now that our component is updated, we're ready to wrap it into a container. Let's create a file named `src/containers/Hello.tsx` and start off with the following imports. ```ts import Hello from '../components/Hello'; import * as actions from '../actions/'; import { StoreState } from '../types/index'; import { connect, Dispatch } from 'react-redux'; ``` The real two key pieces here are the original `Hello` component as well as the `connect` function from react-redux. `connect` will be able to actually take our original `Hello` component and turn it into a container using two functions: * `mapStateToProps` which massages the data from the current store to part of the shape that our component needs. * `mapDispatchToProps` which creates callback props to pump actions to our store using a given `dispatch` function. If we recall, our application state consists of two properties: `languageName` and `enthusiasmLevel`. Our `Hello` component, on the other hand, expected a `name` and an `enthusiasmLevel`. `mapStateToProps` will get the relevant data from the store, and adjust it if necessary, for our component's props. Let's go ahead and write that. ```ts export function mapStateToProps({ enthusiasmLevel, languageName }: StoreState) { return { enthusiasmLevel, name: languageName, } } ``` Note that `mapStateToProps` only creates 2 out of 4 of the properties a `Hello` component expects. Namely, we still want to pass in the `onIncrement` and `onDecrement` callbacks. `mapDispatchToProps` is a function that takes a dispatcher function. This dispatcher function can pass actions into our store to make updates, so we can create a pair of callbacks that will call the dispatcher as necessary. ```ts export function mapDispatchToProps(dispatch: Dispatch<actions.EnthusiasmAction>) { return { onIncrement: () => dispatch(actions.incrementEnthusiasm()), onDecrement: () => dispatch(actions.decrementEnthusiasm()), } } ``` Finally, we're ready to call `connect`. `connect` will first take `mapStateToProps` and `mapDispatchToProps`, and then return another function that we can use to wrap our component. Our resulting container is defined with the following line of code: ```ts export default connect(mapStateToProps, mapDispatchToProps)(Hello); ``` When we're finished, our file should look like this: ```ts // src/containers/Hello.tsx import Hello from '../components/Hello'; import * as actions from '../actions/'; import { StoreState } from '../types/index'; import { connect, Dispatch } from 'react-redux'; export function mapStateToProps({ enthusiasmLevel, languageName }: StoreState) { return { enthusiasmLevel, name: languageName, } } export function mapDispatchToProps(dispatch: Dispatch<actions.EnthusiasmAction>) { return { onIncrement: () => dispatch(actions.incrementEnthusiasm()), onDecrement: () => dispatch(actions.decrementEnthusiasm()), } } export default connect(mapStateToProps, mapDispatchToProps)(Hello); ``` ## Creating a store Let's go back to `src/index.tsx`. To put this all together, we need to create a store with an initial state, and set it up with all of our reducers. ```ts import { createStore } from 'redux'; import { enthusiasm } from './reducers/index'; import { StoreState } from './types/index'; const store = createStore<StoreState>(enthusiasm, { enthusiasmLevel: 1, languageName: 'TypeScript', }); ``` `store` is, as you might've guessed, our central store for our application's global state. Next, we're going to swap our use of `./src/components/Hello` with `./src/containers/Hello` and use react-redux's `Provider` to wire up our props with our container. We'll import each: ```ts import Hello from './containers/Hello'; import { Provider } from 'react-redux'; ``` and pass our `store` through to the `Provider`'s attributes: ```ts ReactDOM.render( <Provider store={store}> <Hello /> </Provider>, document.getElementById('root') as HTMLElement ); ``` Notice that `Hello` no longer needs props, since we used our `connect` function to adapt our application's state for our wrapped `Hello` component's props. # Ejecting If at any point, you feel like there are certain customizations that the create-react-app setup has made difficult, you can always opt-out and get the various configuration options you need. For example, if you'd like to add a Webpack plugin, it might be necessary to take advantage of the "eject" functionality that create-react-app provides. Simply run ```sh npm run eject ``` and you should be good to go! As a heads up, you may want to commit all your work before running an eject. You cannot undo an eject command, so opting out is permanent unless you can recover from a commit prior to running an eject. # Next steps create-react-app comes with a lot of great stuff. Much of it is documented in the default `README.md` that was generated for our project, so give that a quick read. If you still want to learn more about Redux, you can [check out the official website](http://redux.js.org/) for documentation. The same goes [for MobX](https://mobx.js.org/). If you want to eject at some point, you may need to know a little bit more about Webpack. You can check out our [React & Webpack walkthrough here](https://www.typescriptlang.org/docs/handbook/react-&-webpack.html). At some point you might need routing. There are several solutons, but [react-router](https://github.com/ReactTraining/react-router) is probably the most popular for Redux projects, and is often used in conjunction with [react-router-redux](https://github.com/reactjs/react-router-redux).
linkFly6/said-admin
RAEDME.old.md
Markdown
mit
25,364
[ 30522, 2023, 4248, 2707, 5009, 2097, 6570, 2017, 2129, 2000, 7318, 2039, 4127, 23235, 2007, 1031, 10509, 1033, 1006, 8299, 1024, 1013, 1013, 9130, 1012, 21025, 2705, 12083, 1012, 22834, 1013, 10509, 1013, 1007, 1012, 2011, 1996, 2203, 1010,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package tmp.generated_people; import cide.gast.*; import cide.gparser.*; import cide.greferences.*; import java.util.*; public abstract class Element_ol extends GenASTNode { protected Element_ol(Property[] p, Token firstToken, Token lastToken) { super(p, firstToken, lastToken); } protected Element_ol(Property[] p, IToken firstToken, IToken lastToken) { super(p, firstToken, lastToken); } }
ckaestne/CIDE
CIDE_Language_XML_concrete/src/tmp/generated_people/Element_ol.java
Java
gpl-3.0
404
[ 30522, 7427, 1056, 8737, 1012, 7013, 1035, 2111, 1025, 12324, 28744, 2063, 1012, 3806, 2102, 1012, 1008, 1025, 12324, 28744, 2063, 1012, 14246, 11650, 2121, 1012, 1008, 1025, 12324, 28744, 2063, 1012, 24665, 27235, 24413, 2015, 1012, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/bin/bash # pack_boot.sh # Pack the directory to boot.img BOOTDIR=$1 OUTPUT=$2 function usage() { echo "Usage pack_boot.sh BOOTDIR [OUTPUT]" echo " BOOTDIR: the directory containing boot files to be pack" echo " OUTPUT: the output directory. if not present, the out.img will be used" } function init_tools() { local old_pwd=`pwd` TOOL_DIR=`cd $(dirname $0); pwd` ABOOTIMG=$TOOL_DIR/abootimg ABOOTIMG_PACK_INITRD=$TOOL_DIR/abootimg-pack-initrd LZ4_PACK_INITRD=$TOOL_DIR/lz4-pack-initrd cd $old_pwd } function pack_bootimg() { local old_pwd=`pwd` cd $BOOTDIR $ABOOTIMG_PACK_INITRD -f newinitrd.img [ $? != 0 ] && exit 1 if [ -e secondstage ]; then $ABOOTIMG --create pack.img -f bootimg.cfg -k zImage -r newinitrd.img -s secondstage [ $? != 0 ] && exit 1 else $ABOOTIMG --create pack.img -f bootimg.cfg -k zImage -r newinitrd.img [ $? != 0 ] && exit 1 fi rm -f newinitrd.img cd $old_pwd mv $BOOTDIR/pack.img $OUTPUT } # Check parameters [ $# -eq 0 ] && usage && exit 1; [ -z $2 ] && OUTPUT=out.img; init_tools; pack_bootimg;
HackerTool/bootimgpack
internal/common-v1/pack.sh
Shell
apache-2.0
1,068
[ 30522, 1001, 999, 1013, 8026, 1013, 24234, 1001, 5308, 1035, 9573, 1012, 14021, 1001, 5308, 1996, 14176, 2000, 9573, 1012, 10047, 2290, 9573, 4305, 2099, 1027, 1002, 1015, 6434, 1027, 1002, 1016, 3853, 8192, 1006, 1007, 1063, 9052, 1000, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="Rych Data, Elizabeth's Experiments in Data Science"> <title>python tag // Rych Data // Elizabeth's Experiments in Data Science</title> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/pure/0.3.0/pure-min.css"> <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.1.0/css/font-awesome.min.css"> <link rel="stylesheet" href="../theme/css/pure.css"> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> </head> <body> <div class="pure-g-r" id="layout"> <div class="sidebar pure-u"> <div class="cover-img" style="background-image: url('https://static.pexels.com/photos/205324/pexels-photo-205324.jpeg')"> <div class="cover-body"> <header class="header"> <hgroup> <h1 class="brand-main"><a href="..">Rych Data</a></h1> <p class="tagline">Elizabeth's Experiments in Data Science</p> <p class="links"><a href="/pages/about-rych-data.html">About</a></p> <p class="social"> <a href="https://github.com/erych"> <i class="fa fa-github fa-3x"></i> </a> <a href="https://www.linkedin.com/in/elizabeth-rychlinski-54a50a49/"> <i class="fa fa-linkedin-square fa-3x"></i> </a> </p> </hgroup> </header> </div> </div> </div> <div class="pure-u"> <div class="content"> <!-- A wrapper for all the blog posts --> <div class="posts"> <h1 class="content-subhead"> Posts tagged 'python' </h1> <section class="post"> <header class="post-header"> <h3><a class="post-title" href="../google-natural-language-api-analyzing-live-news-sentiment-in-python.html">Google Natural Language API - Analyzing Live News Sentiment in Python</a></h3> <p class="post-meta"><p>Part Three: Using the Google Natural Language API to Analyze News Sentiment.</p></p> <p class="post-meta"> in <a href="../category/projects.html">projects,</a> &middot; Mon 28 August 2017 </p> </header> </section> <section class="post"> <header class="post-header"> <h3><a class="post-title" href="../gcp-authentication-and-google-translation-api.html">GCP Authentication and Google Translation API</a></h3> <p class="post-meta"><p>Part Two: Using the Google Translate API to Translate International News.</p></p> <p class="post-meta"> in <a href="../category/projects.html">projects,</a> &middot; Mon 21 August 2017 </p> </header> </section> <section class="post"> <header class="post-header"> <h3><a class="post-title" href="../the-news-api-requesting-live-headlines-with-python.html">The News API - Requesting Live Headlines with Python</a></h3> <p class="post-meta"><p>This project creates a program to provide a user the choice to receive positive or negative news, from news sources around the world. Part One: Collecting Live News Data Using the News API.</p></p> <p class="post-meta"> in <a href="../category/projects.html">projects,</a> &middot; Mon 14 August 2017 </p> </header> </section> <section class="post"> <header class="post-header"> <h3><a class="post-title" href="../ipynb-news-api-google-translate-api-google-natural-language-api.html">IPYNB: News API, Google Translate API, Google Natural Language API</a></h3> <p class="post-meta"><p>Full python code showing the setup and configuration of the News API, Google Translation API, and Google Natural Language API. Plus lots of panads, for loops, and other fun stuff.</p></p> <p class="post-meta"> in <a href="../category/code.html">code,</a> &middot; Sun 13 August 2017 </p> </header> </section> <section class="post"> <header class="post-header"> <h3><a class="post-title" href="../setting-up-a-deep-learning-virtual-machine.html">Setting up a Deep Learning Virtual Machine</a></h3> <p class="post-meta"><p>This end-to-end guide will lead you through the steps to set up a AWS virtual machine with a GPU card and various software programs needed for deep learning.</p></p> <p class="post-meta"> in <a href="../category/projects.html">projects,</a> &middot; Tue 08 August 2017 </p> </header> </section> <section class="post"> <header class="post-header"> <h3><a class="post-title" href="../predicting-interest-in-manhattan-rental-listings.html">Predicting Interest in Manhattan Rental Listings</a></h3> <p class="post-meta"><p>This project explores various machine learning methods and tools to predict rental interest in Manhattan.</p></p> <p class="post-meta"> in <a href="../category/projects.html">projects,</a> &middot; Mon 29 May 2017 </p> </header> </section> <section class="post"> <header class="post-header"> <h3><a class="post-title" href="../ipynb-predicting-interest-in-manhattan-rental-listings.html">IPYNB: Predicting Interest in Manhattan Rental Listings</a></h3> <p class="post-meta"><p>This project explores various machine learning methods and tools to predict rental interest in Manhattan.</p></p> <p class="post-meta"> in <a href="../category/projects.html">projects,</a> &middot; Sun 28 May 2017 </p> </header> </section> <div class="pagination-wrapper content-subhead"> <div class="pagination"> <div class="pagination-left"> &nbsp; </div> <span>Page 1 / 1</span> <div class="pagination-right"> </div> </div> </div><footer class="footer"> <p>&copy; Elizabeth Rychlinski &ndash; Built with <a href="https://github.com/PurePelicanTheme/pure-single">Pure Theme</a> for <a href="http://blog.getpelican.com/">Pelican</a> </p> </footer> </div> </div> </div> </div> <script> var $top = $('.go-top'); // Show or hide the sticky footer button $(window).scroll(function() { if ($(this).scrollTop() > 200) { $top.fadeIn(200); } else { $top.fadeOut(200); } }); // Animate the scroll to top $top.click(function(event) { event.preventDefault(); $('html, body').animate({scrollTop: 0}, 300); }) // Makes sure that the href="#" attached to the <a> elements // don't scroll you back up the page. $('body').on('click', 'a[href="#"]', function(event) { event.preventDefault(); }); </script> </body> </html>
ERych/erych.github.io
tag/python.html
HTML
mit
8,539
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 16129, 11374, 1027, 1000, 4372, 1000, 1028, 1026, 2132, 1028, 1026, 18804, 25869, 13462, 1027, 1000, 21183, 2546, 1011, 1022, 1000, 1028, 1026, 18804, 2171, 1027, 1000, 3193, 6442, 1000, 418...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_14) on Sun Nov 04 20:19:10 CET 2012 --> <TITLE> Uses of Class org.lwjgl.opencl.CL10GL (LWJGL API) </TITLE> <META NAME="date" CONTENT="2012-11-04"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.lwjgl.opencl.CL10GL (LWJGL API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../org/lwjgl/opencl/CL10GL.html" title="class in org.lwjgl.opencl"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/lwjgl/opencl/\class-useCL10GL.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CL10GL.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Class<br>org.lwjgl.opencl.CL10GL</B></H2> </CENTER> No usage of org.lwjgl.opencl.CL10GL <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../org/lwjgl/opencl/CL10GL.html" title="class in org.lwjgl.opencl"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/lwjgl/opencl/\class-useCL10GL.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="CL10GL.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> <i>Copyright &#169; 2002-2009 lwjgl.org. All Rights Reserved.</i> </BODY> </HTML>
jmcomets/tropical-escape
lib/lwjgl/javadoc/org/lwjgl/opencl/class-use/CL10GL.html
HTML
mit
5,956
[ 30522, 1026, 999, 9986, 13874, 16129, 2270, 1000, 1011, 1013, 1013, 1059, 2509, 2278, 1013, 1013, 26718, 2094, 16129, 1018, 1012, 5890, 17459, 1013, 1013, 4372, 1000, 1000, 8299, 1024, 1013, 1013, 7479, 1012, 1059, 2509, 1012, 8917, 1013, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
module.exports = { 'extends': ['google', 'plugin:react/recommended'], 'parserOptions': { 'ecmaVersion': 6, 'sourceType': 'module', 'ecmaFeatures': { 'jsx': true } }, 'env': { 'browser': true, }, 'plugins': [ 'react' ] };
BadgerTek/mern-skeleton
.eslintrc.client.js
JavaScript
gpl-3.0
293
[ 30522, 11336, 1012, 14338, 1027, 1063, 1005, 8908, 1005, 1024, 1031, 1005, 8224, 1005, 1010, 1005, 13354, 2378, 1024, 10509, 1013, 6749, 1005, 1033, 1010, 1005, 11968, 8043, 7361, 9285, 1005, 1024, 1063, 1005, 14925, 2863, 27774, 1005, 1024...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
 <div ng-controller="UmbracoForms.FormPickerController"> <div class="radio" ng-repeat="form in forms"> <label> <input ng-model="model.value" value="{{form.id}}" type="radio" name="form"> {{form.name}} <small>{{form.fields}}</small> </label> </div> <a ng-click="clear()" ng-show="model.value">Clear</a> </div>
desuma09/growl
Growler/App_Plugins/UmbracoForms/Backoffice/PropertyEditors/formpicker.html
HTML
unlicense
391
[ 30522, 1026, 4487, 2615, 12835, 1011, 11486, 1027, 1000, 8529, 10024, 3597, 22694, 1012, 2433, 24330, 5484, 8663, 13181, 10820, 1000, 1028, 1026, 4487, 2615, 2465, 1027, 1000, 2557, 1000, 12835, 1011, 9377, 1027, 1000, 2433, 1999, 3596, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php // [engine_posts title="Headlines" qty="9" category="" orderby="date" order="DESC"] function engine_posts_sc( $atts ) { // Variables extract( shortcode_atts( array( 'title' => 'Posts', 'qty' => '4', 'category' => '', 'orderby' => 'date', 'order' => 'DESC', 'style' => 'title', 'thumb_size' => 'large', 'excerpt_length' => '17' ), $atts ) ); // Defaults if(!isset($category)) $category = ''; if(!isset($orderby)) { $orderby = 'date'; } if(!isset($order)) { $order = 'DESC'; } if(!isset($qty)) $qty = '10'; if(!isset($style)) $style = 'title'; if(!isset($thumb_size)) $thumb_size = 'large'; if(!isset($excerpt_length)) $excerpt_length = '17'; // Args for the query $args = array( 'posts_per_page' => $qty, 'orderby' => $orderby, 'order' => $order ); if( $category ) { // Make category an array $category = explode(', ', $category); $args['category__in'] = $category; } $columns = '1'; if( $style == 'title_meta_thumb_2' ) { $columns = '2'; $thumb_size = 'medium'; } if( $style == 'title_meta_thumb_3' ) { $columns = '3'; $thumb_size = 'small'; } if( $style == 'title_meta_thumb_4' ) { $columns = '4'; $thumb_size = 'smallest'; } $q = new WP_Query($args); if($q->have_posts() ) : // This is needed for a bunch of HTML ob_start(); ?> <?php if($title): ?> <h4 class="widget-title"><?php echo stripslashes($title); ?></h4> <?php endif; ?> <ul class="posts <?php echo $style; ?> small-block-grid-1 large-block-grid-<?php echo $columns; ?>"> <?php while ( $q->have_posts() ) : $q->the_post(); ?> <?php if( get_the_title() && $style == 'title' ) : ?> <li> <h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> </li> <?php elseif( $style == 'title_meta'): ?> <li class="title-meta"> <article class="the-post"> <h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <div class="entry-meta"> <span class="entry-comments"><a href="<?php comments_link(); ?>"><i class="icon-comments"></i><?php comments_number(__('0 Comments','engine'), __('1 Comment','engine'), '% ' . __('Comments','engine')); ?></a></span> <span class="entry-date"><i class="icon-calendar"></i><?php the_time( get_option('date_format') ); ?></span> </div> </article> <!-- /.the-post --> </li> <?php elseif( $style == 'title_meta_thumb_side'): ?> <li class="title-meta-thumb-side title-meta"> <article class="the-post row"> <div class="featured-image"> <a href="<?php the_permalink(); ?>"><?php engine_thumbnail('tiny'); ?></a> </div> <!-- /.featured-image --> <div class="details"> <h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <div class="entry-meta"> <span class="entry-comments"><a href="<?php comments_link(); ?>"><i class="icon-comments"></i><?php comments_number(__('0 Comments','engine'), __('1 Comment','engine'), '% ' . __('Comments','engine')); ?></a></span> <span class="entry-date"><i class="icon-calendar"></i><?php the_time( get_option('date_format') ); ?></span> </div> </div> <!-- /.details --> </article> <!-- /.the-post --> </li> <?php elseif( $style == 'title_meta_excerpt'): ?> <li class="title-meta"> <article class="the-post"> <h3 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3> <div class="entry-meta"> <span class="entry-comments"><a href="<?php comments_link(); ?>"><i class="icon-comments"></i><?php comments_number(__('0 Comments','engine'), __('1 Comment','engine'), '% ' . __('Comments','engine')); ?></a></span> <span class="entry-date"><i class="icon-calendar"></i><?php the_time( get_option('date_format') ); ?></span> </div> <?php if( $excerpt_length ) : ?> <div class="entry-content"> <?php echo engine_excerpt($excerpt_length); ?> </div> <?php endif; ?> </article> <!-- /.the-post --> </li> <?php else: ?> <li class="title-meta-thumb"> <article class="the-post"> <div class="featured-image"> <a href="<?php the_permalink(); ?>"><?php engine_thumbnail($thumb_size); ?></a> </div> <!-- /.featured-image --> <!-- .entry-header --> <header class="entry-header"> <div class="entry-meta"> <span class="entry-comments"><a href="<?php comments_link(); ?>"><i class="icon-comments"></i><?php comments_number(0, 1, '%'); ?></a></span> <span class="entry-date"><i class="icon-calendar"></i><?php the_time( get_option('date_format') ); ?></span> </div> <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> </header> <!-- /.entry-header --> <?php if( $excerpt_length ) : ?> <div class="entry-content"> <?php echo engine_excerpt($excerpt_length); ?> </div> <?php endif; ?> </article> <!-- /.the-post --> </li> <?php endif; endwhile; ?> </ul> <?php else: ?> <span class="radius secondary label"><?php _e('No posts found','engine'); ?></span> <?php endif; wp_reset_query(); $output = ob_get_contents(); ob_end_clean(); return $output; } add_shortcode( 'engine_posts', 'engine_posts_sc' );
carepez/wp_sbavaglio
wp-content/themes/reporter/library/engine-shortcodes/shortcode-posts - Backup.php
PHP
gpl-2.0
5,420
[ 30522, 1026, 1029, 25718, 1013, 1013, 1031, 3194, 1035, 8466, 2516, 1027, 1000, 19377, 1000, 1053, 3723, 1027, 1000, 1023, 1000, 4696, 1027, 1000, 1000, 2344, 3762, 1027, 1000, 3058, 1000, 2344, 1027, 1000, 4078, 2278, 1000, 1033, 3853, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package com.intellij.codeInsight.completion.methodChains.completion.lookup; import com.intellij.codeInsight.completion.methodChains.search.ChainRelevance; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupElementDecorator; import com.intellij.codeInsight.lookup.LookupElementPresentation; import org.jetbrains.annotations.NotNull; /** * @author Dmitry Batkovich */ public final class WeightableChainLookupElement extends LookupElementDecorator<LookupElement> { private final ChainRelevance myChainRelevance; public WeightableChainLookupElement(final @NotNull LookupElement delegate, final ChainRelevance relevance) { super(delegate); myChainRelevance = relevance; } public ChainRelevance getChainRelevance() { return myChainRelevance; } }
IllusionRom-deprecated/android_platform_tools_idea
java/java-impl/src/com/intellij/codeInsight/completion/methodChains/completion/lookup/WeightableChainLookupElement.java
Java
apache-2.0
816
[ 30522, 7427, 4012, 1012, 13420, 3669, 3501, 1012, 3642, 7076, 18743, 1012, 6503, 1012, 4118, 24925, 3619, 1012, 6503, 1012, 2298, 6279, 1025, 12324, 4012, 1012, 13420, 3669, 3501, 1012, 3642, 7076, 18743, 1012, 6503, 1012, 4118, 24925, 3619...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# This file is part of Metasm, the Ruby assembly manipulation suite # Copyright (C) 2006-2009 Yoann GUILLOT # # Licence is LGPL, see LICENCE in the top-level directory require 'metasm/main' require 'metasm/ia32' module Metasm # The x86_64, 64-bit extension of the x86 CPU (x64, em64t, amd64...) class X86_64 < Ia32 # SegReg, Farptr unchanged # no more floating point registers (use sse*) FpReg = nil # Simd extended to 16 regs, xmm only (mmx gone with 80387) class SimdReg < Ia32::SimdReg double_map 128 => (0..15).map { |n| "xmm#{n}" } end # general purpose registers, all sizes # 8 new gprs (r8..r15), set bit R in the REX prefix to reference them (or X/B if in ModRM) # aonethusaontehsanothe with 8bit subreg: with no rex prefix, refers to ah ch dh bh (as usual) # but whenever the prefix is present, those become unavailable and encodie spl..dil (low byte of rsp/rdi) class Reg < Ia32::Reg double_map 8 => %w{ al cl dl bl spl bpl sil dil r8b r9b r10b r11b r12b r13b r14b r15b ah ch dh bh}, 16 => %w{ ax cx dx bx sp bp si di r8w r9w r10w r11w r12w r13w r14w r15w}, 32 => %w{eax ecx edx ebx esp ebp esi edi r8d r9d r10d r11d r12d r13d r14d r15d eip}, 64 => %w{rax rcx rdx rbx rsp rbp rsi rdi r8 r9 r10 r11 r12 r13 r14 r15 rip} Sym = @i_to_s[64].map { |s| s.to_sym } # returns a symbolic representation of the register: # cx => :rcx & 0xffff # ah => (:rax >> 8) & 0xff # XXX in x64, 32bits operations are zero-extended to 64bits (eg mov rax, 0x1234_ffff_ffff ; add eax, 1 => rax == 0 def symbolic(di=nil) s = Sym[@val] s = di.next_addr if s == :rip and di if @sz == 8 and to_s[-1] == ?h Expression[[Sym[@val-16], :>>, 8], :&, 0xff] elsif @sz == 8 Expression[s, :&, 0xff] elsif @sz == 16 Expression[s, :&, 0xffff] elsif @sz == 32 Expression[s, :&, 0xffffffff] else s end end # checks if two registers have bits in common def share?(other) raise 'TODO' # XXX TODO wtf does formula this do ? other.val % (other.sz >> 1) == @val % (@sz >> 1) and (other.sz != @sz or @sz != 8 or other.val == @val) end # returns the part of @val to encode in an instruction field def val_enc if @sz == 8 and @val >= 16; @val-12 # ah, bh, ch, dh elsif @val >= 16 # rip else @val & 7 # others end end # returns the part of @val to encode in an instruction's rex prefix def val_rex if @sz == 8 and @val >= 16 # ah, bh, ch, dh: rex forbidden elsif @val >= 16 # rip else @val >> 3 # others end end end # ModRM represents indirections (eg dword ptr [eax+4*ebx+12h]) # 16bit mode unavailable in x64 # opcodes use 64bit addressing by default, use adsz override (67h) prefix to switch to 32 # immediate values are encoded as :i32 sign-extended to 64bits class ModRM < Ia32::ModRM # mod 0/1/2 m 4 => sib # mod 0 m 5 => rip+imm # sib: i 4 => no index, b 5 => no base end class DbgReg < Ia32::DbgReg simple_map((0..15).map { |i| [i, "dr#{i}"] }) end class CtrlReg < Ia32::CtrlReg simple_map((0..15).map { |i| [i, "cr#{i}"] }) end # Create a new instance of an X86 cpu # arguments (any order) # - instruction set (386, 486, sse2...) [latest] # - endianness [:little] def initialize(*a) super(:latest) @size = 64 a.delete @size @endianness = (a & [:big, :little]).first || :little a.delete @endianness @family = a.pop || :latest raise "Invalid arguments #{a.inspect}" if not a.empty? raise "Invalid X86_64 family #{@family.inspect}" if not respond_to?("init_#@family") end # defines some preprocessor macros to say who we are: # TODO def tune_prepro(pp) super(pp, :itsmeX64) # ask Ia32's to just call super() pp.define_weak('_M_AMD64') pp.define_weak('_M_X64') pp.define_weak('__amd64__') pp.define_weak('__x86_64__') end def str_to_reg(str) # X86_64::Reg != Ia32::Reg Reg.from_str(str) if Reg.s_to_i.has_key? str end def shortname "x64#{'_be' if @endianness == :big}" end end X64 = X86_64 AMD64 = X86_64 end
boboguessme/cold_grinder
node/lib/metasm/metasm/x86_64/main.rb
Ruby
bsd-3-clause
4,044
[ 30522, 1001, 2023, 5371, 2003, 2112, 1997, 18804, 6491, 1010, 1996, 10090, 3320, 16924, 7621, 1001, 9385, 1006, 1039, 1007, 2294, 1011, 2268, 10930, 11639, 26458, 7174, 2102, 1001, 1001, 11172, 2003, 1048, 21600, 2140, 1010, 2156, 11172, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'Free Eclipse icons'; }
32kda/com.onpositive.images
src/src/app/app.component.ts
TypeScript
epl-1.0
222
[ 30522, 12324, 1063, 6922, 1065, 2013, 1005, 1030, 16108, 1013, 4563, 1005, 1025, 1030, 6922, 1006, 1063, 27000, 1024, 1005, 10439, 1011, 7117, 1005, 1010, 23561, 3126, 2140, 1024, 1005, 1012, 1013, 10439, 1012, 6922, 1012, 16129, 1005, 1010...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// Link.test.js - temporary example class to show unit tests working // Use React's test renderer and Jest's snapshot feature to interact // with the component and capture the rendered output and create a snapshot file import React from 'react'; import Link from '../../src/components/Link'; import renderer from 'react-test-renderer'; test('Link changes the class when hovered', () => { const component = renderer.create( <Link page="http://www.facebook.com">Facebook</Link> ); let tree = component.toJSON(); expect(tree).toMatchSnapshot(); // manually trigger the callback tree.props.onMouseEnter(); // re-rendering tree = component.toJSON(); expect(tree).toMatchSnapshot(); // manually trigger the callback tree.props.onMouseLeave(); // re-rendering tree = component.toJSON(); expect(tree).toMatchSnapshot(); });
diivanand/DataBrowser
test/components/Link.test.js
JavaScript
apache-2.0
883
[ 30522, 1013, 1013, 4957, 1012, 3231, 1012, 1046, 2015, 1011, 5741, 2742, 2465, 2000, 2265, 3131, 5852, 2551, 1013, 1013, 2224, 10509, 1005, 1055, 3231, 17552, 2121, 1998, 15333, 3367, 1005, 1055, 20057, 12326, 3444, 2000, 11835, 1013, 1013,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
""" Created on Thu May 05 20:02:00 2011 @author: Tillsten """ import numpy as np from scipy.linalg import qr eps = np.finfo(float).eps def mls(B, v, umin, umax, Wv=None, Wu=None, ud=None, u=None, W=None, imax=100): """ mls - Control allocation using minimal least squares. [u,W,iter] = mls_alloc(B,v,umin,umax,[Wv,Wu,ud,u0,W0,imax]) Solves the bounded sequential least-squares problem min ||Wu(u-ud)|| subj. to u in M where M is the set of control signals solving min ||Wv(Bu-v)|| subj. to umin <= u <= umax using a two stage active set method. Wu must be diagonal since the problem is reformulated as a minimal least squares problem. The implementation does not handle the case of coplanar controls. Inputs: ------- B control effectiveness matrix (k x m) v commanded virtual control (k x 1) umin lower position limits (m x 1) umax upper position limits (m x 1) Wv virtual control weighting matrix (k x k) [I] Wu control weighting matrix (m x m), diagonal [I] ud desired control (m x 1) [0] u0 initial point (m x 1) W0 initial working set (m x 1) [empty] imax max no. of iterations [100] Outputs: ------- u optimal control W optimal active set iter no. of iterations (= no. of changes in the working set + 1) 0 if u_i not saturated Active set syntax: W_i = -1 if u_i = umin_i +1 if u_i = umax_i Directly Based on the code from: Ola Harkegard, www.control.isy.liu.se/~ola see licsence. """ #k = number of virtual controls #m = number of variables (actuators) k, m = B.shape if u == None: u = np.mean(umin + umax, 0)[:, None] if W == None: W = np.zeros((m, 1)) if ud == None: ud = np.zeros((m, 1)) if Wu == None: Wu = np.eye(m) if Wv == None: Wv = np.eye(k) phase = 1 #Reformulate as a minimal least squares problem. See 2002-03-08 (1). A = Wv.dot(B).dot(np.linalg.pinv(Wu)) b = Wv.dot(v - B.dot(ud)) xmin = (umin - ud).flatten() xmax = (umax - ud).flatten() # Compute initial point and residual. x = Wu.dot(u - ud) r = np.atleast_2d(A.dot(x) - b) #Determine indeces of free variables i_free = (W == 0).flatten() m_free = np.sum(i_free) for i in range(imax): #print 'Iter: ', i if phase == 1: A_free = A[:, i_free] if m_free <= k: if m_free > 0: p_free = np.linalg.lstsq(-A_free, r)[0] else: q1, r1 = qr(A_free.T) p_free = -q1.dot(np.solve(r1.T, r)) p = np.zeros((m, 1)) if A.shape[1] > 1: p[i_free] = p_free else: p[i_free] = p_free.flatten() else: i_fixed = np.logical_not(i_free) m_fixed = m - m_free if m_fixed > 0: HT = U[i_fixed.squeeze(), :].T V, Rtot = qr(np.atleast_2d(HT)) V1 = V[:, :m_fixed] V2 = V[:, m_fixed + 1:] R = Rtot[:, m_fixed] else: V, Rtot = np.array([[]]), np.array([[]]) V1 = V2 = R = V.T s = -V2.T.dot(z) pz = V2.dot(s) p = U.dot(pz) x_opt = x + p infeasible = np.logical_or(x_opt < xmin, x_opt > xmax) if not np.any(infeasible[i_free]): x = x_opt if phase == 1: r = r + A.dot(p) else: z = z + pz if phase == 1 and m_free >= k: phase = 2 Utot, Stot = qr(A.T) U = Utot[:, k:] z = U.T.dot(x) else: lam = np.zeros((m, 1)) if m_free < m: if phase == 1: g = A.T.dot(r) lam = -W * g else: lam[i_fixed] = -W[i_fixed] * np.linalg.solve(R, V1.T.dot(z)) if np.all(lam >= -eps): u = np.linalg.solve(Wu, x) + ud return u lambda_neg, i_neg = np.min(lam), np.argmin(lam) W[i_neg] = 0 i_free[i_neg] = True m_free += 1 else: dist = np.ones(m) i_min = np.logical_and(i_free, p.flat < 0).flatten() i_max = np.logical_and(i_free, p.flat > 0).flatten() dist[i_min] = (xmin[i_min] - x[i_min]) / p[i_min] dist[i_max] = (xmax[i_max] - x[i_max]) / p[i_max] alpha, i_alpha = np.min(dist), np.argmin(dist) x = x + alpha * p if phase == 1: r = r + A.dot(alpha * p) #!! else: z = z + alpha * pz W[i_alpha] = np.sign(p[i_alpha]) if i_free[i_alpha]: i_free[i_alpha] = False m_free -= 1 u = np.linalg.solve(Wu, x) + ud return u def bounded_lsq(A, b, lower_lim, upper_lim): """ Minimizes: |Ax-b|_2 for lower_lim<x<upper_lim. """ return mls(A, b, lower_lim, upper_lim) def test_bounded_lsq(): from numpy.core.umath_tests import matrix_multiply s = np.linspace(0, 10, 100) A = np.exp(-((s - 5) ** 2) / 20) A = A[:, None] b = 16 * A x = bounded_lsq(A, b, np.atleast_2d(0), np.atleast_2d(15)) np.testing.assert_almost_equal(x, 15) A = np.array([[1, -3], [5, 7]]) b = np.array([[-50], [50]]) ll = np.array(([[-10], [-10]])) ul = np.array(([[10], [10]])) x0 = bounded_lsq(A, b, ll, ul) np.testing.assert_array_almost_equal(x0, np.array([[-4.61538462], [10.]])) if __name__ == '__main__': from numpy.core.umath_tests import matrix_multiply import matplotlib.pyplot as plt test_bounded_lsq() s = np.linspace(0, 10, 100) A = np.exp(-((s - 5) ** 2) / 20) A = A[:, None] b = 16 * A x = bounded_lsq(A, b, np.atleast_2d(0), np.atleast_2d(4)) plt.plot(A.dot(x)) plt.plot(b) plt.figure() plt.rcParams['font.family'] = 'serif' A = np.array([[1, -3], [5, 7]]) b = np.array([[-50], [50]]) ll = np.array(([[-10], [-10]])) ul = np.array(([[10], [10]])) Ud = np.array(([0, 0])) gamma = 1000 x0 = bounded_lsq(A, b, ll, ul) x = np.linspace(-30, 30, 500) y = np.linspace(-30, 30, 500) X, Y = np.meshgrid(x, y) S = np.dstack((X, Y)) SN = matrix_multiply(S, A.T) plt.clf() plt.contourf(x, y, np.sqrt(((SN - b.T) ** 2).sum(-1)), 30, cmap=plt.cm.PuBu_r) plt.colorbar() #plt.axhline(ll[0]) #plt.axhline(ul[0]) #plt.axvline(ll[1]) #plt.axvline(ul[1]) rect = np.vstack((ll, ul - ll)) patch = plt.Rectangle(ll, *(ul - ll), facecolor=(0.0, 0., 0., 0)) plt.gca().add_patch(patch) plt.annotate("Bounded Min", xy=x0, xycoords='data', xytext=(-5, 5), textcoords='data', arrowprops=dict(arrowstyle="->", connectionstyle="arc3"), ) plt.annotate("Lsq Min", xy=np.linalg.lstsq(A, b)[0], xycoords='data', xytext=(20, 10), textcoords='offset points', arrowprops=dict(arrowstyle="->", connectionstyle="arc3"), ) plt.scatter(*x0) plt.scatter(*np.linalg.lstsq(A, b)[0]) plt.show()
treverhines/ModEst
modest/pymls/init.py
Python
mit
7,780
[ 30522, 1000, 1000, 1000, 2580, 2006, 16215, 2226, 2089, 5709, 2322, 1024, 6185, 1024, 4002, 2249, 1030, 3166, 1024, 6229, 16173, 1000, 1000, 1000, 12324, 16371, 8737, 2100, 2004, 27937, 2013, 16596, 7685, 1012, 27022, 2140, 2290, 12324, 105...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'chunky_png' require 'fileutils' #COLOR_TRUE = ChunkyPNG::Color::rgba(224, 255, 255, 96) # for kunijiban COLOR_TRUE = ChunkyPNG::Color::rgba(255, 255, 255, 0) # for ort COLOR_FALSE = ChunkyPNG::Color::rgba(0, 0, 0, 128) def _new_image return ChunkyPNG::Image.new(256, 256, COLOR_FALSE) end def write(image, zxy) path = "#{zxy.join('/')}.png" FileUtils.mkdir_p(File.dirname(path)) unless File.directory?(File.dirname(path)) image.save(path) print "wrote #{path}\n" return _new_image end _new_image.save('404.png') current = [nil, nil, nil] last = [nil, nil, nil] (z, x, y, u, v) = [nil, nil, nil, nil, nil] image = _new_image while gets (z, x, y, u, v) = $_.strip.split(',').map{|v| v.to_i} current = [z, x, y] if current == last or last[0].nil? image[u, v] = COLOR_TRUE else image = write(image, last) image[u, v] = COLOR_TRUE end last = current end write(image, last)
hfu/octpng-bin
reduce.rb
Ruby
cc0-1.0
916
[ 30522, 5478, 1005, 20000, 2100, 1035, 1052, 3070, 1005, 5478, 1005, 5371, 21823, 4877, 1005, 1001, 3609, 1035, 2995, 1027, 20000, 22571, 3070, 1024, 1024, 3609, 1024, 1024, 1054, 18259, 2050, 1006, 19711, 1010, 20637, 1010, 20637, 1010, 598...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# PHP > Lesson 3 > Assignment 1 Vous devez afficher un tableau contenant 100 éléments sur plusieurs pages. - Le tableau est contenu dans `$data`. - Vous pouvez voir la structure des données dans `data.php` - Le script `index.php` doit utiliser un paramètre `page` et `count`. - `page` indique le n° de page - `page=0` indique la première page. - Si `page` n'est pas défini, la valeur par défaut est 0. - `count` indique le nombre d'élément par page. - Si `count` n'est pas défini, sa valeur vaut 15. - Vous ne devez modifier QUE le fichier `index.php`, et normalement uniquement à l'interieur des balises `tbody` et `tfoot`. ## Exemple `index.php?page=0&count=20` affiche les élements 0 à 19 `index.php?page=2&count=10` affiche les élements 20 à 29 ## Bonus Créer des liens de navigation de page en page (page suivante, page précédente) dans le footer de la page. ## Bonus 2 Créer des liens pour aller directement à une page avec un n° donné. ## Ressources - [La fonction array_slice](http://php.net/manual/fr/function.array-slice.php) - [$_GET](http://php.net/manual/fr/reserved.variables.get.php)
blank-project/_blank
exercises/php/lesson3/assignment1/README.md
Markdown
gpl-2.0
1,135
[ 30522, 1001, 25718, 1028, 10800, 1017, 1028, 8775, 1015, 29536, 2271, 16475, 9351, 21358, 8873, 7474, 4895, 2795, 4887, 9530, 6528, 4630, 2531, 3787, 7505, 4606, 17301, 2869, 5530, 1012, 1011, 3393, 2795, 4887, 9765, 9530, 6528, 2226, 18033...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
--- title: Onclick Event localeTitle: Onclick活动 --- ## Onclick活动 JavaScript中的`onclick`事件允许您作为程序员在单击元素时执行函数。 ### 例 ```javascript <button onclick="myFunction()">Click me</button> <script> function myFunction() { alert('Button was clicked!'); } </script> ``` 在上面的简单示例中,当用户单击按钮时,他们将在浏览器中看到显示`Button was clicked!`的警报`Button was clicked!` 。 ### 动态添加`onclick` `onclick`事件也可以使用以下示例中的以下代码以编程方式添加到任何元素: ```javascript <p id="foo">click on this element.</p> <script> var p = document.getElementById("foo"); // Find the paragraph element in the page p.onclick = showAlert; // Add onclick function to element function showAlert(event) { alert("onclick Event triggered!"); } </script> ``` ### 注意 重要的是要注意使用onclick我们只能添加一个监听器功能。如果要添加更多内容,只需使用addEventListener(),这是添加事件侦听器的首选方法。 在上面的示例中,当用户单击`html`的`paragraph`元素时,他们将看到显示`onclick Event triggered`的警报。 ### 防止默认操作 但是,如果我们重视`onclick`以链接(HTML是`a`标签),我们可能想阻止默认动作发生: ```javascript <a href="https://guide.freecodecamp.org" onclick="myAlert()">Guides</a> <script> function myAlert(event) { event.preventDefault(); alert("Link was clicked but page was not open"); } </script> ``` 在上面的例子中,我们防止了默认行为`a`使用元件(开口链路) `event.preventDefault()`提供了内部`onclick`回调函数。 [MDN](https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onclick) #### 其他资源 [jQuery .on()事件处理程序附件](https://api.jquery.com/on/)
otavioarc/freeCodeCamp
guide/chinese/javascript/onclick-event/index.md
Markdown
bsd-3-clause
1,949
[ 30522, 1011, 1011, 1011, 2516, 1024, 2006, 20464, 6799, 2724, 2334, 20624, 9286, 1024, 2006, 20464, 6799, 100, 100, 1011, 1011, 1011, 1001, 1001, 2006, 20464, 6799, 100, 100, 9262, 22483, 1746, 1916, 1036, 2006, 20464, 6799, 1036, 1751, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php /** * Zend Framework * * LICENSE * * This source file is subject to the new BSD license that is bundled * with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://framework.zend.com/license/new-bsd * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@zend.com so we can send you a copy immediately. * * @category Zend * @package Zend_Controller * @subpackage Router * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ /** * @namespace */ namespace Zend\Controller\Router; /** * @uses \Zend\Controller\Exception * @package Zend_Controller * @subpackage Router * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Exception extends \Zend\Controller\Exception {}
phphatesme/LiveTest
src/lib/Zend/Controller/Router/Exception.php
PHP
mit
1,085
[ 30522, 1026, 1029, 25718, 1013, 1008, 1008, 1008, 16729, 2094, 7705, 1008, 1008, 6105, 1008, 1008, 2023, 3120, 5371, 2003, 3395, 2000, 1996, 2047, 18667, 2094, 6105, 2008, 2003, 24378, 1008, 2007, 2023, 7427, 1999, 1996, 5371, 6105, 1012, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
name 'neo4j' maintainer 'YOUR_COMPANY_NAME' maintainer_email 'YOUR_EMAIL' license 'All rights reserved' description 'Installs/Configures neo4j' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) version '0.1.0'
marpaia/chef-osx
cookbooks/neo4j/metadata.rb
Ruby
apache-2.0
274
[ 30522, 2171, 1005, 9253, 2549, 3501, 1005, 5441, 2121, 1005, 2115, 1035, 2194, 1035, 2171, 1005, 5441, 2121, 1035, 10373, 1005, 2115, 1035, 10373, 1005, 6105, 1005, 2035, 2916, 9235, 1005, 6412, 1005, 16500, 2015, 1013, 9530, 8873, 27390, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#!/bin/sh -xe if [ "$1" = "ci" ]; then armloc=$(brew fetch --bottle-tag=arm64_big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d:) x64loc=$(brew fetch --bottle-tag=big_sur libomp | grep -i downloaded | grep tar.gz | cut -f2 -d:) cp $armloc /tmp/libomp-arm64.tar.gz mkdir /tmp/libomp-arm64 || true tar -xzvf /tmp/libomp-arm64.tar.gz -C /tmp/libomp-arm64 cp $x64loc /tmp/libomp-x86_64.tar.gz mkdir /tmp/libomp-x86_64 || true tar -xzvf /tmp/libomp-x86_64.tar.gz -C /tmp/libomp-x86_64 else brew install libomp fi git submodule update --init extlib/cairo extlib/freetype extlib/libdxfrw extlib/libpng extlib/mimalloc extlib/pixman extlib/zlib extlib/eigen
solvespace/solvespace
.github/scripts/install-macos.sh
Shell
gpl-3.0
701
[ 30522, 1001, 999, 1013, 8026, 1013, 14021, 1011, 1060, 2063, 2065, 1031, 1000, 1002, 1015, 1000, 1027, 1000, 25022, 1000, 1033, 1025, 2059, 2849, 4135, 2278, 1027, 1002, 1006, 24702, 18584, 1011, 1011, 5835, 1011, 6415, 1027, 2849, 21084, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Jace.Execution { public interface IConstantRegistry : IEnumerable<ConstantInfo> { ConstantInfo GetConstantInfo(string constantName); bool IsConstantName(string constantName); void RegisterConstant(string constantName, double value); void RegisterConstant(string constantName, double value, bool isOverWritable); } }
kpboyle1/devtreks
src/DevTreks.Extensions/Jace/Execution/IConstantRegistry.cs
C#
mit
460
[ 30522, 2478, 2291, 1025, 2478, 2291, 1012, 6407, 1012, 12391, 1025, 2478, 2291, 1012, 11409, 4160, 1025, 2478, 2291, 1012, 3793, 1025, 3415, 15327, 10352, 1012, 7781, 1063, 2270, 8278, 18407, 5794, 7913, 24063, 2854, 1024, 29464, 19172, 690...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copyright (c) 2011 Nordic Semiconductor. All Rights Reserved. * * The information contained herein is confidential property of Nordic Semiconductor. The use, * copying, transfer or disclosure of such information is prohibited except by express written * agreement with Nordic Semiconductor. * */ /** @defgroup nrf_sdm_api SoftDevice Manager API @{ @brief APIs for SoftDevice management. */ /* Header guard */ #ifndef NRF_SDM_H__ #define NRF_SDM_H__ #include "nrf_svc.h" #include "nrf51.h" #include "nrf_soc.h" #include "nrf_error_sdm.h" /** @addtogroup NRF_SDM_DEFINES Defines * @{ */ /**@brief SoftDevice Manager SVC Base number. */ #define SDM_SVC_BASE 0x10 /** @} */ /** @addtogroup NRF_SDM_ENUMS Enumerations * @{ */ /**@brief nRF SoftDevice Manager API SVC numbers. */ enum NRF_SD_SVCS { SD_SOFTDEVICE_ENABLE = SDM_SVC_BASE, /**< ::sd_softdevice_enable */ SD_SOFTDEVICE_DISABLE, /**< ::sd_softdevice_disable */ SD_SOFTDEVICE_IS_ENABLED, /**< ::sd_softdevice_is_enabled */ SD_SOFTDEVICE_FORWARD_TO_APPLICATION,/**< ::sd_softdevice_forward_to_application */ SVC_SDM_LAST /**< Placeholder for last SDM SVC */ }; /**@brief Possible lfclk oscillator sources. */ enum NRF_CLOCK_LFCLKSRCS { NRF_CLOCK_LFCLKSRC_SYNTH_250_PPM, /**< LFCLK Synthesized from HFCLK. */ NRF_CLOCK_LFCLKSRC_XTAL_500_PPM, /**< LFCLK crystal oscillator 500 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_XTAL_250_PPM, /**< LFCLK crystal oscillator 250 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_XTAL_150_PPM, /**< LFCLK crystal oscillator 150 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_XTAL_100_PPM, /**< LFCLK crystal oscillator 100 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_XTAL_75_PPM, /**< LFCLK crystal oscillator 75 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, /**< LFCLK crystal oscillator 50 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_XTAL_30_PPM, /**< LFCLK crystal oscillator 30 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, /**< LFCLK crystal oscillator 20 PPM accuracy. */ NRF_CLOCK_LFCLKSRC_RC_250_PPM_250MS_CALIBRATION, /**< LFCLK RC oscillator, 250ms calibration interval.*/ NRF_CLOCK_LFCLKSRC_RC_250_PPM_500MS_CALIBRATION, /**< LFCLK RC oscillator, 500ms calibration interval.*/ NRF_CLOCK_LFCLKSRC_RC_250_PPM_1000MS_CALIBRATION, /**< LFCLK RC oscillator, 1000ms calibration interval.*/ NRF_CLOCK_LFCLKSRC_RC_250_PPM_2000MS_CALIBRATION, /**< LFCLK RC oscillator, 2000ms calibration interval.*/ NRF_CLOCK_LFCLKSRC_RC_250_PPM_4000MS_CALIBRATION, /**< LFCLK RC oscillator, 4000ms calibration interval.*/ NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION, /**< LFCLK RC oscillator, 8000ms calibration interval.*/ }; /** @} */ /** @addtogroup NRF_SDM_TYPES Types * @{ */ /**@brief Type representing lfclk oscillator source. */ typedef uint32_t nrf_clock_lfclksrc_t; /**@brief SoftDevice Assertion Handler type. * * When an unexpected error occurs within the SoftDevice it will call the SoftDevice assertion handler callback. * The protocol stack will be in an undefined state when this happens and the only way to recover will be to * perform a reset, using e.g. CMSIS NVIC_SystemReset(). * * @note This callback is executed in HardFault context, thus SVC functions cannot be called from the SoftDevice assert callback. * * @param[in] pc The program counter of the failed assert. * @param[in] line_number Line number where the assert failed. * @param[in] file_name File name where the assert failed. */ typedef void (*softdevice_assertion_handler_t)(uint32_t pc, uint16_t line_number, const uint8_t * p_file_name); /** @} */ /** @addtogroup NRF_SDM_FUNCTIONS Functions * @{ */ /**@brief Enables the SoftDevice and by extension the protocol stack. * * Idempotent function to enable the SoftDevice. * * @note Some care must be taken if a low frequency clock source is already running when calling this function: * If the LF clock has a different source then the one currently running, it will be stopped. Then, the new * clock source will be started. * * @note This function has no effect when returning with an error. * * @post If return code is ::NRF_SUCCESS * - SoC library and protocol stack APIs are made available * - A portion of RAM will be unavailable (see relevant SDS documentation) * - Some peripherals will be unavailable or available only through the SoC API (see relevant SDS documentation) * - Interrupts will not arrive from protected peripherals or interrupts * - nrf_nvic_ functions must be used instead of CMSIS NVIC_ functions for reliable usage of the softdevice. * - Interrupt latency may be affected by the SoftDevice (see relevant SDS documentation) * - Chosen low frequency clock source will be running * * @param clock_source Low frequency clock source and accuracy. (Note: In the case of XTAL source, the PPM accuracy of the chosen clock source must be greater than or equal to the actual characteristics of your XTAL clock). * @param assertion_handler Callback for SoftDevice assertions. * * @retval ::NRF_SUCCESS * @retval ::NRF_ERROR_SDM_INCORRECT_INTERRUPT_CONFIGURATION SoftDeviceinterrupt is already enabled, or an enabled interrupt has an illegal priority level * @retval ::NRF_ERROR_SDM_LFCLK_SOURCE_UNKNOWN Unknown low frequency clock source selected */ SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lfclksrc_t clock_source, softdevice_assertion_handler_t assertion_handler)); /**@brief Disables the SoftDevice and by extension the protocol stack. * * Idempotent function to disable the SoftDevice. * * @post SoC library and protocol stack APIs are made unavailable. * @post All interrupts that was protected by the SoftDevice will be disabled and initialized to priority 0 (highest). * @post All peripherals used by the SoftDevice will be reset to default values. * @post All of RAM become available. * @post All interrupts are forwarded to the application. * @post LFCLK source chosen in ::sd_softdevice_enable will be left running. * * @retval ::NRF_SUCCESS */ SVCALL(SD_SOFTDEVICE_DISABLE, uint32_t, sd_softdevice_disable(void)); /**@brief Check if the SoftDevice is enabled. * * @param[out] p_softdevice_enabled If the SoftDevice is enabled: 1 else 0. * * @retval ::NRF_SUCCESS */ SVCALL(SD_SOFTDEVICE_IS_ENABLED, uint32_t, sd_softdevice_is_enabled(uint8_t * p_softdevice_enabled)); /**@brief Start forwarding interrupts to application. * * This function is only intended to be called when a bootloader is enabled. * The bootloader should call this right before it starts the application. * It is recommended that all interrupt sources are off when this is called, * or you could end up having interrupts in the application being executed before main() of the application. * * @retval ::NRF_SUCCESS */ SVCALL(SD_SOFTDEVICE_FORWARD_TO_APPLICATION, uint32_t, sd_softdevice_forward_to_application(void)); /** @} */ #endif // NRF_SDM_H__ /** @} */
xiaogan-Studio/OpenCloudEnvMonitor
Src/Include/s120/nrf_sdm.h
C
gpl-2.0
7,354
[ 30522, 1013, 1008, 1008, 9385, 1006, 1039, 1007, 2249, 13649, 20681, 1012, 2035, 2916, 9235, 1012, 1008, 1008, 1996, 2592, 4838, 2182, 2378, 2003, 18777, 3200, 1997, 13649, 20681, 1012, 1996, 2224, 1010, 1008, 24731, 1010, 4651, 2030, 19380...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.coursera.androidcapstone.symptomchecker.repository; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.PagingAndSortingRepository; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; @Repository public interface PatientRepository extends PagingAndSortingRepository<Patient, Long> { @Query("From Patient p where :doctor member p.doctors") public Page<Patient> findByDoctor(@Param("doctor") Doctor doctor, Pageable page); @Query("From Patient p where :doctor member p.doctors AND UPPER(fullName)=:fullName") public List<Patient> findByDoctorAndFullName(@Param("doctor") Doctor doctor, @Param("fullName") String fullName); }
emadhilo/capstone
SymptomCheckerService/src/main/java/org/coursera/androidcapstone/symptomchecker/repository/PatientRepository.java
Java
mit
860
[ 30522, 7427, 8917, 1012, 2607, 2527, 1012, 11924, 17695, 9221, 1012, 25353, 27718, 5358, 5403, 9102, 1012, 22409, 1025, 12324, 9262, 1012, 21183, 4014, 1012, 2862, 1025, 12324, 8917, 1012, 3500, 15643, 6198, 1012, 2951, 1012, 5884, 1012, 39...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE191_Integer_Underflow__int_listen_socket_postdec_45.c Label Definition File: CWE191_Integer_Underflow__int.label.xml Template File: sources-sinks-45.tmpl.c */ /* * @description * CWE: 191 Integer Underflow * BadSource: listen_socket Read data using a listen socket (server side) * GoodSource: Set data to a small, non-zero number (negative two) * Sinks: decrement * GoodSink: Ensure there will not be an underflow before decrementing data * BadSink : Decrement data, which can cause an Underflow * Flow Variant: 45 Data flow: data passed as a static global variable from one function to another in the same source file * * */ #include "std_testcase.h" #ifdef _WIN32 #include <winsock2.h> #include <windows.h> #include <direct.h> #pragma comment(lib, "ws2_32") /* include ws2_32.lib when linking */ #define CLOSE_SOCKET closesocket #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #define INVALID_SOCKET -1 #define SOCKET_ERROR -1 #define CLOSE_SOCKET close #define SOCKET int #endif #define TCP_PORT 27015 #define LISTEN_BACKLOG 5 #define CHAR_ARRAY_SIZE (3 * sizeof(data) + 2) static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData; static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData; static int CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData; #ifndef OMITBAD static void badSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData; { /* POTENTIAL FLAW: Decrementing data could cause an underflow */ data--; int result = data; printIntLine(result); } } void CWE191_Integer_Underflow__int_listen_socket_postdec_45_bad() { int data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE191_Integer_Underflow__int_listen_socket_postdec_45_badData = data; badSink(); } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B() uses the GoodSource with the BadSink */ static void goodG2BSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData; { /* POTENTIAL FLAW: Decrementing data could cause an underflow */ data--; int result = data; printIntLine(result); } } static void goodG2B() { int data; /* Initialize data */ data = 0; /* FIX: Use a small, non-zero value that will not cause an integer underflow in the sinks */ data = -2; CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodG2BData = data; goodG2BSink(); } /* goodB2G() uses the BadSource with the GoodSink */ static void goodB2GSink() { int data = CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData; /* FIX: Add a check to prevent an underflow from occurring */ if (data > INT_MIN) { data--; int result = data; printIntLine(result); } else { printLine("data value is too large to perform arithmetic safely."); } } static void goodB2G() { int data; /* Initialize data */ data = 0; { #ifdef _WIN32 WSADATA wsaData; int wsaDataInit = 0; #endif int recvResult; struct sockaddr_in service; SOCKET listenSocket = INVALID_SOCKET; SOCKET acceptSocket = INVALID_SOCKET; char inputBuffer[CHAR_ARRAY_SIZE]; do { #ifdef _WIN32 if (WSAStartup(MAKEWORD(2,2), &wsaData) != NO_ERROR) { break; } wsaDataInit = 1; #endif /* POTENTIAL FLAW: Read data using a listen socket */ listenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (listenSocket == INVALID_SOCKET) { break; } memset(&service, 0, sizeof(service)); service.sin_family = AF_INET; service.sin_addr.s_addr = INADDR_ANY; service.sin_port = htons(TCP_PORT); if (bind(listenSocket, (struct sockaddr*)&service, sizeof(service)) == SOCKET_ERROR) { break; } if (listen(listenSocket, LISTEN_BACKLOG) == SOCKET_ERROR) { break; } acceptSocket = accept(listenSocket, NULL, NULL); if (acceptSocket == SOCKET_ERROR) { break; } /* Abort on error or the connection was closed */ recvResult = recv(acceptSocket, inputBuffer, CHAR_ARRAY_SIZE - 1, 0); if (recvResult == SOCKET_ERROR || recvResult == 0) { break; } /* NUL-terminate the string */ inputBuffer[recvResult] = '\0'; /* Convert to int */ data = atoi(inputBuffer); } while (0); if (listenSocket != INVALID_SOCKET) { CLOSE_SOCKET(listenSocket); } if (acceptSocket != INVALID_SOCKET) { CLOSE_SOCKET(acceptSocket); } #ifdef _WIN32 if (wsaDataInit) { WSACleanup(); } #endif } CWE191_Integer_Underflow__int_listen_socket_postdec_45_goodB2GData = data; goodB2GSink(); } void CWE191_Integer_Underflow__int_listen_socket_postdec_45_good() { goodG2B(); goodB2G(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on its own for testing or for building a binary to use in testing binary analysis tools. It is not used when compiling all the testcases as one application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE191_Integer_Underflow__int_listen_socket_postdec_45_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE191_Integer_Underflow__int_listen_socket_postdec_45_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
JianpingZeng/xcc
xcc/test/juliet/testcases/CWE191_Integer_Underflow/s04/CWE191_Integer_Underflow__int_listen_socket_postdec_45.c
C
bsd-3-clause
8,543
[ 30522, 1013, 1008, 23561, 7013, 3231, 18382, 5371, 5371, 18442, 1024, 19296, 2063, 16147, 2487, 1035, 16109, 1035, 2104, 12314, 1035, 1035, 20014, 1035, 4952, 1035, 22278, 1035, 2695, 3207, 2278, 1035, 3429, 1012, 30524, 1035, 2104, 12314, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/******************************************************************************* * * Module Name: rsirq - IRQ resource descriptors * ******************************************************************************/ /* * Copyright (C) 2000 - 2014, Intel Corp. * 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, * without modification. * 2. Redistributions in binary form must reproduce at minimum a disclaimer * substantially similar to the "NO WARRANTY" disclaimer below * ("Disclaimer") and any redistribution must be conditioned upon * including a substantially similar Disclaimer requirement for further * binary redistribution. * 3. Neither the names of the above-listed copyright holders nor the names * of any contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * Alternatively, this software may be distributed under the terms of the * GNU General Public License ("GPL") version 2 as published by the Free * Software Foundation. * * NO WARRANTY * 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 MERCHANTIBILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. */ #include <acpi/acpi.h> #include "accommon.h" #include "acresrc.h" #define _COMPONENT ACPI_RESOURCES ACPI_MODULE_NAME("rsirq") /******************************************************************************* * * acpi_rs_get_irq * ******************************************************************************/ struct acpi_rsconvert_info acpi_rs_get_irq[9] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_IRQ, ACPI_RS_SIZE(struct acpi_resource_irq), ACPI_RSC_TABLE_SIZE(acpi_rs_get_irq)}, /* Get the IRQ mask (bytes 1:2) */ {ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]), AML_OFFSET(irq.irq_mask), ACPI_RS_OFFSET(data.irq.interrupt_count)}, /* Set default flags (others are zero) */ {ACPI_RSC_SET8, ACPI_RS_OFFSET(data.irq.triggering), ACPI_EDGE_SENSITIVE, 1}, /* Get the descriptor length (2 or 3 for IRQ descriptor) */ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.irq.descriptor_length), AML_OFFSET(irq.descriptor_type), 0}, /* All done if no flag byte present in descriptor */ {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_AML_LENGTH, 0, 3}, /* Get flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering), AML_OFFSET(irq.flags), 0}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity), AML_OFFSET(irq.flags), 3}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), AML_OFFSET(irq.flags), 4}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable), AML_OFFSET(irq.flags), 5} }; /******************************************************************************* * * acpi_rs_set_irq * ******************************************************************************/ struct acpi_rsconvert_info acpi_rs_set_irq[14] = { /* Start with a default descriptor of length 3 */ {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_IRQ, sizeof(struct aml_resource_irq), ACPI_RSC_TABLE_SIZE(acpi_rs_set_irq)}, /* Convert interrupt list to 16-bit IRQ bitmask */ {ACPI_RSC_BITMASK16, ACPI_RS_OFFSET(data.irq.interrupts[0]), AML_OFFSET(irq.irq_mask), ACPI_RS_OFFSET(data.irq.interrupt_count)}, /* Set flags: Triggering[0], Polarity[3], Sharing[4], Wake[5] */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.triggering), AML_OFFSET(irq.flags), 0}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.polarity), AML_OFFSET(irq.flags), 3}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.sharable), AML_OFFSET(irq.flags), 4}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.irq.wake_capable), AML_OFFSET(irq.flags), 5}, /* * All done if the output descriptor length is required to be 3 * (i.e., optimization to 2 bytes cannot be attempted) */ {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, ACPI_RS_OFFSET(data.irq.descriptor_length), 3}, /* Set length to 2 bytes (no flags byte) */ {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)}, /* * All done if the output descriptor length is required to be 2. * * TBD: Perhaps we should check for error if input flags are not * compatible with a 2-byte descriptor. */ {ACPI_RSC_EXIT_EQ, ACPI_RSC_COMPARE_VALUE, ACPI_RS_OFFSET(data.irq.descriptor_length), 2}, /* Reset length to 3 bytes (descriptor with flags byte) */ {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)}, /* * Check if the flags byte is necessary. Not needed if the flags are: * ACPI_EDGE_SENSITIVE, ACPI_ACTIVE_HIGH, ACPI_EXCLUSIVE */ {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE, ACPI_RS_OFFSET(data.irq.triggering), ACPI_EDGE_SENSITIVE}, {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE, ACPI_RS_OFFSET(data.irq.polarity), ACPI_ACTIVE_HIGH}, {ACPI_RSC_EXIT_NE, ACPI_RSC_COMPARE_VALUE, ACPI_RS_OFFSET(data.irq.sharable), ACPI_EXCLUSIVE}, /* We can optimize to a 2-byte irq_no_flags() descriptor */ {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq_noflags)} }; /******************************************************************************* * * acpi_rs_convert_ext_irq * ******************************************************************************/ struct acpi_rsconvert_info acpi_rs_convert_ext_irq[10] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_EXTENDED_IRQ, ACPI_RS_SIZE(struct acpi_resource_extended_irq), ACPI_RSC_TABLE_SIZE(acpi_rs_convert_ext_irq)}, {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_EXTENDED_IRQ, sizeof(struct aml_resource_extended_irq), 0}, /* * Flags: Producer/Consumer[0], Triggering[1], Polarity[2], * Sharing[3], Wake[4] */ {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.producer_consumer), AML_OFFSET(extended_irq.flags), 0}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.triggering), AML_OFFSET(extended_irq.flags), 1}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.polarity), AML_OFFSET(extended_irq.flags), 2}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.sharable), AML_OFFSET(extended_irq.flags), 3}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.extended_irq.wake_capable), AML_OFFSET(extended_irq.flags), 4}, /* IRQ Table length (Byte4) */ {ACPI_RSC_COUNT, ACPI_RS_OFFSET(data.extended_irq.interrupt_count), AML_OFFSET(extended_irq.interrupt_count), sizeof(u32)}, /* Copy every IRQ in the table, each is 32 bits */ {ACPI_RSC_MOVE32, ACPI_RS_OFFSET(data.extended_irq.interrupts[0]), AML_OFFSET(extended_irq.interrupts[0]), 0}, /* Optional resource_source (Index and String) */ {ACPI_RSC_SOURCEX, ACPI_RS_OFFSET(data.extended_irq.resource_source), ACPI_RS_OFFSET(data.extended_irq.interrupts[0]), sizeof(struct aml_resource_extended_irq)} }; /******************************************************************************* * * acpi_rs_convert_dma * ******************************************************************************/ struct acpi_rsconvert_info acpi_rs_convert_dma[6] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_DMA, ACPI_RS_SIZE(struct acpi_resource_dma), ACPI_RSC_TABLE_SIZE(acpi_rs_convert_dma)}, {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_DMA, sizeof(struct aml_resource_dma), 0}, /* Flags: transfer preference, bus mastering, channel speed */ {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.transfer), AML_OFFSET(dma.flags), 0}, {ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.dma.bus_master), AML_OFFSET(dma.flags), 2}, {ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.dma.type), AML_OFFSET(dma.flags), 5}, /* DMA channel mask bits */ {ACPI_RSC_BITMASK, ACPI_RS_OFFSET(data.dma.channels[0]), AML_OFFSET(dma.dma_channel_mask), ACPI_RS_OFFSET(data.dma.channel_count)} }; /******************************************************************************* * * acpi_rs_convert_fixed_dma * ******************************************************************************/ struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[4] = { {ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_FIXED_DMA, ACPI_RS_SIZE(struct acpi_resource_fixed_dma), ACPI_RSC_TABLE_SIZE(acpi_rs_convert_fixed_dma)}, {ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_FIXED_DMA, sizeof(struct aml_resource_fixed_dma), 0}, /* * These fields are contiguous in both the source and destination: * request_lines * Channels */ {ACPI_RSC_MOVE16, ACPI_RS_OFFSET(data.fixed_dma.request_lines), AML_OFFSET(fixed_dma.request_lines), 2}, {ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.fixed_dma.width), AML_OFFSET(fixed_dma.width), 1}, };
mericon/Xp_Kernel_LGH850
virt/drivers/acpi/acpica/rsirq.c
C
gpl-2.0
9,458
[ 30522, 1013, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
----------------------------------- -- Area: Meriphataud Mountains (S) (97) -- Mob: Dee_Xalmo_the_Grim ----------------------------------- -- require("scripts/zones/Meriphataud_Mountains_[S]/MobIDs"); ----------------------------------- -- onMobInitialize ----------------------------------- function onMobInitialize(mob) end; ----------------------------------- -- onMobSpawn ----------------------------------- function onMobSpawn(mob) end; ----------------------------------- -- onMobEngaged ----------------------------------- function onMobEngaged(mob,target) end; ----------------------------------- -- onMobFight ----------------------------------- function onMobFight(mob,target) end; ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob,killer) end;
Fatalerror66/ffxi-a
scripts/zones/Meriphataud_Mountains_[S]/mobs/Dee_Xalmo_the_Grim.lua
Lua
gpl-3.0
836
[ 30522, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 2181, 102...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
//------------------------------------------------------------------------------ // <auto-generated /> // // This file was automatically generated by SWIG (http://www.swig.org). // Version 3.0.10 // // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ namespace HoloToolkit.Sharing { public enum SystemRole { SessionDiscoveryServerRole = 0, SessionServerRole, PrimaryClientRole, SecondaryClientRole } }
jimshalo10/HoloLensCompanionKit
SpectatorView/Samples/SharedHolograms/Assets/HoloToolkit/Sharing/Scripts/SDK/SystemRole.cs
C#
mit
577
[ 30522, 1013, 1013, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 101...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#import <Cocoa/Cocoa.h> FOUNDATION_EXPORT double SwiftHTTPVersionNumber; FOUNDATION_EXPORT const unsigned char SwiftHTTPVersionString[];
inderdhir/MemeGrabber
Pods/Target Support Files/SwiftHTTP/SwiftHTTP-umbrella.h
C
apache-2.0
140
[ 30522, 1001, 12324, 1026, 22940, 1013, 22940, 1012, 1044, 1028, 3192, 1035, 9167, 3313, 9170, 11039, 25856, 27774, 19172, 5677, 1025, 3192, 1035, 9167, 9530, 3367, 27121, 25869, 9170, 11039, 25856, 27774, 3367, 4892, 1031, 1033, 1025, 102, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * 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.flink.runtime.blob; import org.apache.flink.api.common.JobID; import org.apache.flink.configuration.BlobServerOptions; import org.apache.flink.configuration.Configuration; import org.apache.flink.runtime.concurrent.FutureUtils; import org.apache.flink.util.FlinkException; import org.apache.flink.util.OperatingSystem; import org.apache.flink.util.TestLogger; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import javax.annotation.Nullable; import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletionException; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import static org.apache.flink.runtime.blob.BlobCachePutTest.verifyDeletedEventually; import static org.apache.flink.runtime.blob.BlobKey.BlobType.TRANSIENT_BLOB; import static org.apache.flink.runtime.blob.BlobServerDeleteTest.delete; import static org.apache.flink.runtime.blob.BlobServerGetTest.verifyDeleted; import static org.apache.flink.runtime.blob.BlobServerPutTest.put; import static org.apache.flink.runtime.blob.BlobServerPutTest.verifyContents; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.junit.Assume.assumeTrue; /** * Tests how DELETE requests behave. */ public class BlobCacheDeleteTest extends TestLogger { private final Random rnd = new Random(); @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder(); @Test public void testDeleteTransient1() throws IOException { testDelete(null, new JobID()); } @Test public void testDeleteTransient2() throws IOException { testDelete(new JobID(), null); } @Test public void testDeleteTransient3() throws IOException { testDelete(null, null); } @Test public void testDeleteTransient4() throws IOException { testDelete(new JobID(), new JobID()); } @Test public void testDeleteTransient5() throws IOException { JobID jobId = new JobID(); testDelete(jobId, jobId); } /** * Uploads a (different) byte array for each of the given jobs and verifies that deleting one of * them (via the {@link BlobCacheService}) does not influence the other. * * @param jobId1 * first job id * @param jobId2 * second job id */ private void testDelete(@Nullable JobID jobId1, @Nullable JobID jobId2) throws IOException { final Configuration config = new Configuration(); config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath()); try ( BlobServer server = new BlobServer(config, new VoidBlobStore()); BlobCacheService cache = new BlobCacheService(new InetSocketAddress("localhost", server.getPort()), config, new VoidBlobStore())) { server.start(); byte[] data = new byte[2000000]; rnd.nextBytes(data); byte[] data2 = Arrays.copyOf(data, data.length); data2[0] ^= 1; // put first BLOB TransientBlobKey key1 = (TransientBlobKey) put(server, jobId1, data, TRANSIENT_BLOB); assertNotNull(key1); // put two more BLOBs (same key, other key) for another job ID TransientBlobKey key2a = (TransientBlobKey) put(server, jobId2, data, TRANSIENT_BLOB); assertNotNull(key2a); BlobKeyTest.verifyKeyDifferentHashEquals(key1, key2a); TransientBlobKey key2b = (TransientBlobKey) put(server, jobId2, data2, TRANSIENT_BLOB); assertNotNull(key2b); BlobKeyTest.verifyKeyDifferentHashDifferent(key1, key2b); // issue a DELETE request assertTrue(delete(cache, jobId1, key1)); // delete only works on local cache! assertTrue(server.getStorageLocation(jobId1, key1).exists()); // delete on server so that the cache cannot re-download assertTrue(server.deleteInternal(jobId1, key1)); verifyDeleted(cache, jobId1, key1); // deleting one BLOB should not affect another BLOB with a different key // (and keys are always different now) verifyContents(server, jobId2, key2a, data); verifyContents(server, jobId2, key2b, data2); // delete first file of second job assertTrue(delete(cache, jobId2, key2a)); // delete only works on local cache assertTrue(server.getStorageLocation(jobId2, key2a).exists()); // delete on server so that the cache cannot re-download assertTrue(server.deleteInternal(jobId2, key2a)); verifyDeleted(cache, jobId2, key2a); verifyContents(server, jobId2, key2b, data2); // delete second file of second job assertTrue(delete(cache, jobId2, key2b)); // delete only works on local cache assertTrue(server.getStorageLocation(jobId2, key2b).exists()); // delete on server so that the cache cannot re-download assertTrue(server.deleteInternal(jobId2, key2b)); verifyDeleted(cache, jobId2, key2b); } } @Test public void testDeleteTransientAlreadyDeletedNoJob() throws IOException { testDeleteTransientAlreadyDeleted(null); } @Test public void testDeleteTransientAlreadyDeletedForJob() throws IOException { testDeleteTransientAlreadyDeleted(new JobID()); } /** * Uploads a byte array for the given job and verifies that deleting it (via the {@link * BlobCacheService}) does not fail independent of whether the file exists. * * @param jobId * job id */ private void testDeleteTransientAlreadyDeleted(@Nullable final JobID jobId) throws IOException { final Configuration config = new Configuration(); config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath()); try ( BlobServer server = new BlobServer(config, new VoidBlobStore()); BlobCacheService cache = new BlobCacheService(new InetSocketAddress("localhost", server.getPort()), config, new VoidBlobStore())) { server.start(); byte[] data = new byte[2000000]; rnd.nextBytes(data); // put BLOB TransientBlobKey key = (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB); assertNotNull(key); File blobFile = server.getStorageLocation(jobId, key); assertTrue(blobFile.delete()); // DELETE operation should not fail if file is already deleted assertTrue(delete(cache, jobId, key)); verifyDeleted(cache, jobId, key); // one more delete call that should not fail assertTrue(delete(cache, jobId, key)); verifyDeleted(cache, jobId, key); } } @Test public void testDeleteTransientLocalFailsNoJob() throws IOException, InterruptedException { testDeleteTransientLocalFails(null); } @Test public void testDeleteTransientLocalFailsForJob() throws IOException, InterruptedException { testDeleteTransientLocalFails(new JobID()); } /** * Uploads a byte array for the given job and verifies that a delete operation (via the {@link * BlobCacheService}) does not fail even if the file is not deletable locally, e.g. via * restricting the permissions. * * @param jobId * job id */ private void testDeleteTransientLocalFails(@Nullable final JobID jobId) throws IOException, InterruptedException { assumeTrue(!OperatingSystem.isWindows()); //setWritable doesn't work on Windows. final Configuration config = new Configuration(); config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath()); File blobFile = null; File directory = null; try ( BlobServer server = new BlobServer(config, new VoidBlobStore()); BlobCacheService cache = new BlobCacheService(new InetSocketAddress("localhost", server.getPort()), config, new VoidBlobStore())) { server.start(); try { byte[] data = new byte[2000000]; rnd.nextBytes(data); // put BLOB TransientBlobKey key = (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB); assertNotNull(key); // access from cache once to have it available there verifyContents(cache, jobId, key, data); blobFile = cache.getTransientBlobService().getStorageLocation(jobId, key); directory = blobFile.getParentFile(); assertTrue(blobFile.setWritable(false, false)); assertTrue(directory.setWritable(false, false)); // issue a DELETE request assertFalse(delete(cache, jobId, key)); // the file should still be there on the cache verifyContents(cache, jobId, key, data); // the server should have started the delete call after the cache accessed the (transient!) BLOB verifyDeletedEventually(server, jobId, key); } finally { if (blobFile != null && directory != null) { //noinspection ResultOfMethodCallIgnored blobFile.setWritable(true, false); //noinspection ResultOfMethodCallIgnored directory.setWritable(true, false); } } } } @Test public void testConcurrentDeleteOperationsNoJobTransient() throws IOException, ExecutionException, InterruptedException { testConcurrentDeleteOperations(null); } @Test public void testConcurrentDeleteOperationsForJobTransient() throws IOException, ExecutionException, InterruptedException { testConcurrentDeleteOperations(new JobID()); } /** * [FLINK-6020] Tests that concurrent delete operations don't interfere with each other. * * <p>Note: This test checks that there cannot be two threads which have checked whether a given * blob file exist and then one of them fails deleting it. Without the introduced lock, this * situation should rarely happen and make this test fail. Thus, if this test should become * "unstable", then the delete atomicity is most likely broken. * @param jobId * job ID to use (or <tt>null</tt> if job-unrelated) * */ private void testConcurrentDeleteOperations(@Nullable final JobID jobId) throws IOException, InterruptedException, ExecutionException { final Configuration config = new Configuration(); config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath()); final int concurrentDeleteOperations = 3; final ExecutorService executor = Executors.newFixedThreadPool(concurrentDeleteOperations); final List<CompletableFuture<Void>> deleteFutures = new ArrayList<>(concurrentDeleteOperations); final byte[] data = {1, 2, 3}; try ( BlobServer server = new BlobServer(config, new VoidBlobStore()); BlobCacheService cache = new BlobCacheService(new InetSocketAddress("localhost", server.getPort()), config, new VoidBlobStore())) { server.start(); final TransientBlobKey blobKey = (TransientBlobKey) put(server, jobId, data, TRANSIENT_BLOB); assertTrue(server.getStorageLocation(jobId, blobKey).exists()); for (int i = 0; i < concurrentDeleteOperations; i++) { CompletableFuture<Void> deleteFuture = CompletableFuture .supplyAsync( () -> { try { assertTrue(delete(cache, jobId, blobKey)); assertFalse(cache.getTransientBlobService().getStorageLocation(jobId, blobKey).exists()); // delete only works on local cache! assertTrue(server.getStorageLocation(jobId, blobKey).exists()); return null; } catch (IOException e) { throw new CompletionException(new FlinkException( "Could not upload blob.", e)); } }, executor); deleteFutures.add(deleteFuture); } CompletableFuture<Void> waitFuture = FutureUtils.waitForAll(deleteFutures); // make sure all delete operation have completed successfully // in case of no lock, one of the delete operations should eventually fail waitFuture.get(); // delete only works on local cache! assertTrue(server.getStorageLocation(jobId, blobKey).exists()); } finally { executor.shutdownNow(); } } }
zimmermatt/flink
flink-runtime/src/test/java/org/apache/flink/runtime/blob/BlobCacheDeleteTest.java
Java
apache-2.0
12,594
[ 30522, 1013, 1008, 1008, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 1008, 2030, 2062, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 1008, 5500, 2007, 2023, 2147, 2005, 3176, 2592, 1008, 4953, 9385, 6095, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
# Spiranthes cycloglossa Kraenzl. SPECIES #### Status ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
mdoering/backbone
life/Plantae/Magnoliophyta/Liliopsida/Asparagales/Orchidaceae/Spiranthes/Spiranthes cycloglossa/README.md
Markdown
apache-2.0
181
[ 30522, 1001, 11867, 7895, 3372, 15689, 22330, 20464, 8649, 10483, 3736, 1047, 16652, 14191, 2140, 1012, 2427, 1001, 1001, 1001, 1001, 3570, 3970, 1001, 1001, 1001, 1001, 2429, 2000, 2248, 3269, 3415, 5950, 1001, 1001, 1001, 30524, 12629, 19...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * Copyright (C) 2014-2015 LinkedIn Corp. (pinot-core@linkedin.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.linkedin.pinot.core.startree; import java.io.BufferedOutputStream; import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.tuple.Pair; import org.joda.time.DateTime; import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.base.Objects; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import com.linkedin.pinot.common.data.DimensionFieldSpec; import com.linkedin.pinot.common.data.MetricFieldSpec; import com.linkedin.pinot.common.data.FieldSpec.DataType; import com.linkedin.pinot.common.data.Schema; import com.linkedin.pinot.common.utils.Pairs.IntPair; import com.linkedin.pinot.core.data.GenericRow; import com.linkedin.pinot.core.segment.creator.impl.V1Constants; /** * Uses file to build the star tree. Each row is divided into dimension and metrics. Time is added to dimension list. * We use the split order to build the tree. In most cases, split order will be ranked depending on the cardinality (descending order). * Time column will be excluded or last entry in split order irrespective of its cardinality * This is a recursive algorithm where we branch on one dimension at every level. * * <b>Psuedo algo</b> * <code> * * build(){ * let table(1,N) consists of N input rows * table.sort(1,N) //sort the table on all dimensions, according to split order * constructTree(table, 0, N, 0); * } * constructTree(table,start,end, level){ * splitDimensionName = dimensionsSplitOrder[level] * groupByResult<dimName, length> = table.groupBy(dimensionsSplitOrder[level]); //returns the number of rows for each value in splitDimension * int rangeStart = 0; * for each ( entry<dimName,length> groupByResult){ * if(entry.length > minThreshold){ * constructTree(table, rangeStart, rangeStart + entry.length, level +1); * } * rangeStart = rangeStart + entry.length; * updateStarTree() //add new child * } * * //create a star tree node * * aggregatedRows = table.uniqueAfterRemovingAttributeAndAggregateMetrics(start,end, splitDimensionName); * for(each row in aggregatedRows_ * table.add(row); * if(aggregateRows.size > minThreshold) { * table.sort(end, end + aggregatedRows.size); * constructStarTree(table, end, end + aggregatedRows.size, level +1); * } * } * </code> */ public class OffHeapStarTreeBuilder implements StarTreeBuilder { private static final Logger LOG = LoggerFactory.getLogger(OffHeapStarTreeBuilder.class); File dataFile; private DataOutputStream dataBuffer; int rawRecordCount = 0; int aggRecordCount = 0; private List<String> dimensionsSplitOrder; private Set<String> skipStarNodeCreationForDimensions; private Set<String> skipMaterializationForDimensions; private int maxLeafRecords; private StarTree starTree; private StarTreeIndexNode starTreeRootIndexNode; private int numDimensions; private int numMetrics; private List<String> dimensionNames; private List<String> metricNames; private String timeColumnName; private List<DataType> dimensionTypes; private List<DataType> metricTypes; private Map<String, Object> dimensionNameToStarValueMap; private HashBiMap<String, Integer> dimensionNameToIndexMap; private Map<String, Integer> metricNameToIndexMap; private int dimensionSizeBytes; private int metricSizeBytes; private File outDir; private Map<String, HashBiMap<Object, Integer>> dictionaryMap; boolean debugMode = false; private int[] sortOrder; private int skipMaterializationCardinalityThreshold; public void init(StarTreeBuilderConfig builderConfig) throws Exception { Schema schema = builderConfig.schema; timeColumnName = schema.getTimeColumnName(); this.dimensionsSplitOrder = builderConfig.dimensionsSplitOrder; skipStarNodeCreationForDimensions = builderConfig.getSkipStarNodeCreationForDimensions(); skipMaterializationForDimensions = builderConfig.getSkipMaterializationForDimensions(); skipMaterializationCardinalityThreshold = builderConfig.getSkipMaterializationCardinalityThreshold(); this.maxLeafRecords = builderConfig.maxLeafRecords; this.outDir = builderConfig.getOutDir(); if (outDir == null) { outDir = new File(System.getProperty("java.io.tmpdir"), V1Constants.STAR_TREE_INDEX_DIR + "_" + DateTime.now()); } LOG.debug("Index output directory:{}", outDir); dimensionTypes = new ArrayList<>(); dimensionNames = new ArrayList<>(); dimensionNameToIndexMap = HashBiMap.create(); dimensionNameToStarValueMap = new HashMap<>(); dictionaryMap = new HashMap<>(); //READ DIMENSIONS COLUMNS List<DimensionFieldSpec> dimensionFieldSpecs = schema.getDimensionFieldSpecs(); for (int index = 0; index < dimensionFieldSpecs.size(); index++) { DimensionFieldSpec spec = dimensionFieldSpecs.get(index); String dimensionName = spec.getName(); dimensionNames.add(dimensionName); dimensionNameToIndexMap.put(dimensionName, index); Object starValue; starValue = getAllStarValue(spec); dimensionNameToStarValueMap.put(dimensionName, starValue); dimensionTypes.add(spec.getDataType()); HashBiMap<Object, Integer> dictionary = HashBiMap.create(); dictionaryMap.put(dimensionName, dictionary); } //treat time column as just another dimension, only difference is that we will never split on this dimension unless explicitly specified in split order if (timeColumnName != null) { dimensionNames.add(timeColumnName); dimensionTypes.add(schema.getTimeFieldSpec().getDataType()); int index = dimensionNameToIndexMap.size(); dimensionNameToIndexMap.put(timeColumnName, index); HashBiMap<Object, Integer> dictionary = HashBiMap.create(); dictionaryMap.put(schema.getTimeColumnName(), dictionary); } dimensionSizeBytes = dimensionNames.size() * Integer.SIZE / 8; this.numDimensions = dimensionNames.size(); //READ METRIC COLUMNS this.metricTypes = new ArrayList<>(); this.metricNames = new ArrayList<>(); this.metricNameToIndexMap = new HashMap<>(); this.metricSizeBytes = 0; List<MetricFieldSpec> metricFieldSpecs = schema.getMetricFieldSpecs(); for (int index = 0; index < metricFieldSpecs.size(); index++) { MetricFieldSpec spec = metricFieldSpecs.get(index); String metricName = spec.getName(); metricNames.add(metricName); metricNameToIndexMap.put(metricName, index); DataType dataType = spec.getDataType(); metricTypes.add(dataType); metricSizeBytes += dataType.size(); } this.numMetrics = metricNames.size(); builderConfig.getOutDir().mkdirs(); dataFile = new File(outDir, "star-tree.buf"); dataBuffer = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(dataFile))); //INITIALIZE THE ROOT NODE this.starTreeRootIndexNode = new StarTreeIndexNode(); this.starTreeRootIndexNode.setDimensionName(StarTreeIndexNode.all()); this.starTreeRootIndexNode.setDimensionValue(StarTreeIndexNode.all()); this.starTreeRootIndexNode.setLevel(0); LOG.debug("dimensionNames:{}", dimensionNames); LOG.debug("metricNames:{}", metricNames); } /** * Validate the split order by removing any dimensions that may be part of the skip materialization list. * @param dimensionsSplitOrder * @param skipMaterializationForDimensions * @return */ private List<String> sanitizeSplitOrder(List<String> dimensionsSplitOrder, Set<String> skipMaterializationForDimensions) { List<String> validatedSplitOrder = new ArrayList<String>(); for (String dimension : dimensionsSplitOrder) { if (skipMaterializationForDimensions == null || !skipMaterializationForDimensions.contains(dimension)) { LOG.info("Adding dimension {} to split order", dimension); validatedSplitOrder.add(dimension); } else { LOG.info( "Dimension {} cannot be part of 'dimensionSplitOrder' and 'skipMaterializationForDimensions', removing it from split order", dimension); } } return validatedSplitOrder; } private Object getAllStarValue(DimensionFieldSpec spec) throws Exception { switch (spec.getDataType()) { case STRING: return "ALL"; case BOOLEAN: case BYTE: case CHAR: case DOUBLE: case FLOAT: case INT: case LONG: return spec.getDefaultNullValue(); case OBJECT: case SHORT: case DOUBLE_ARRAY: case CHAR_ARRAY: case FLOAT_ARRAY: case INT_ARRAY: case LONG_ARRAY: case SHORT_ARRAY: case STRING_ARRAY: case BYTE_ARRAY: default: throw new Exception("Unsupported dimension data type" + spec); } } public GenericRow toGenericRow(DimensionBuffer dimensionKey, MetricBuffer metricsHolder) { GenericRow row = new GenericRow(); Map<String, Object> map = new HashMap<>(); for (int i = 0; i < dimensionNames.size(); i++) { String dimName = dimensionNames.get(i); BiMap<Integer, Object> inverseDictionary = dictionaryMap.get(dimName).inverse(); Object dimValue = inverseDictionary.get(dimensionKey.getDimension(i)); if (dimValue == null) { dimValue = dimensionNameToStarValueMap.get(dimName); } map.put(dimName, dimValue); } for (int i = 0; i < numMetrics; i++) { String metName = metricNames.get(i); map.put(metName, metricsHolder.get(i)); } row.init(map); return row; } public void append(GenericRow row) throws Exception { DimensionBuffer dimension = new DimensionBuffer(numDimensions); for (int i = 0; i < dimensionNames.size(); i++) { String dimName = dimensionNames.get(i); Map<Object, Integer> dictionary = dictionaryMap.get(dimName); Object dimValue = row.getValue(dimName); if (dimValue == null) { //TODO: Have another default value to represent STAR. Using default value to represent STAR as of now. //It does not matter during query execution, since we know that values is STAR from the star tree dimValue = dimensionNameToStarValueMap.get(dimName); } if (!dictionary.containsKey(dimValue)) { dictionary.put(dimValue, dictionary.size()); } dimension.setDimension(i, dictionary.get(dimValue)); } Number[] numbers = new Number[numMetrics]; for (int i = 0; i < numMetrics; i++) { String metName = metricNames.get(i); numbers[i] = (Number) row.getValue(metName); } MetricBuffer metrics = new MetricBuffer(numbers); append(dimension, metrics); } public void append(DimensionBuffer dimension, MetricBuffer metrics) throws Exception { appendToRawBuffer(dimension, metrics); } private void appendToRawBuffer(DimensionBuffer dimension, MetricBuffer metrics) throws IOException { appendToBuffer(dataBuffer, dimension, metrics); rawRecordCount++; } private void appendToAggBuffer(DimensionBuffer dimension, MetricBuffer metrics) throws IOException { appendToBuffer(dataBuffer, dimension, metrics); aggRecordCount++; } private void appendToBuffer(DataOutputStream dos, DimensionBuffer dimensions, MetricBuffer metricHolder) throws IOException { for (int i = 0; i < numDimensions; i++) { dos.writeInt(dimensions.getDimension(i)); } dos.write(metricHolder.toBytes(metricSizeBytes, metricTypes)); } public void build() throws Exception { if (skipMaterializationForDimensions == null || skipMaterializationForDimensions.isEmpty()) { skipMaterializationForDimensions = computeDefaultDimensionsToSkipMaterialization(); } if (dimensionsSplitOrder == null || dimensionsSplitOrder.isEmpty()) { dimensionsSplitOrder = computeDefaultSplitOrder(); } // Remove any dimensions from split order that would be not be materialized. dimensionsSplitOrder = sanitizeSplitOrder(dimensionsSplitOrder, skipMaterializationForDimensions); LOG.debug("Split order:{}", dimensionsSplitOrder); long start = System.currentTimeMillis(); dataBuffer.flush(); sort(dataFile, 0, rawRecordCount); constructStarTree(starTreeRootIndexNode, 0, rawRecordCount, 0, dataFile); long end = System.currentTimeMillis(); LOG.debug("Took {} ms to build star tree index. Original records:{} Materialized record:{}", (end - start), rawRecordCount, aggRecordCount); starTree = new StarTree(starTreeRootIndexNode, dimensionNameToIndexMap); File treeBinary = new File(outDir, "star-tree.bin"); LOG.debug("Saving tree binary at: {} ", treeBinary); starTree.writeTree(new BufferedOutputStream(new FileOutputStream(treeBinary))); printTree(starTreeRootIndexNode, 0); LOG.debug("Finished build tree. out dir: {} ", outDir); dataBuffer.close(); } private void printTree(StarTreeIndexNode node, int level) { for (int i = 0; i < level; i++) { LOG.debug(" "); } BiMap<Integer, String> inverse = dimensionNameToIndexMap.inverse(); String dimName = "ALL"; Object dimValue = "ALL"; if (node.getDimensionName() != StarTreeIndexNode.all()) { dimName = inverse.get(node.getDimensionName()); } if (node.getDimensionValue() != StarTreeIndexNode.all()) { dimValue = dictionaryMap.get(dimName).inverse().get(node.getDimensionValue()); } String formattedOutput = Objects.toStringHelper(node).add("nodeId", node.getNodeId()).add("level", level).add("dimensionName", dimName) .add("dimensionValue", dimValue).add("childDimensionName", inverse.get(node.getChildDimensionName())) .add("childCount", node.getChildren() == null ? 0 : node.getChildren().size()) .add("startDocumentId", node.getStartDocumentId()).add("endDocumentId", node.getEndDocumentId()) .add("documentCount", (node.getEndDocumentId() - node.getStartDocumentId())).toString(); LOG.debug(formattedOutput); if (!node.isLeaf()) { for (StarTreeIndexNode child : node.getChildren().values()) { printTree(child, level + 1); } } } private List<String> computeDefaultSplitOrder() { ArrayList<String> defaultSplitOrder = new ArrayList<>(); //include only the dimensions not time column. Also, assumes that skipMaterializationForDimensions is built. for (String dimensionName : dimensionNames) { if (skipMaterializationForDimensions != null && !skipMaterializationForDimensions.contains(dimensionName)) { defaultSplitOrder.add(dimensionName); } } if (timeColumnName != null) { defaultSplitOrder.remove(timeColumnName); } Collections.sort(defaultSplitOrder, new Comparator<String>() { @Override public int compare(String o1, String o2) { return dictionaryMap.get(o2).size() - dictionaryMap.get(o1).size(); //descending } }); return defaultSplitOrder; } private Set<String> computeDefaultDimensionsToSkipMaterialization() { Set<String> skipDimensions = new HashSet<String>(); for (String dimensionName : dimensionNames) { if (dictionaryMap.get(dimensionName).size() > skipMaterializationCardinalityThreshold) { skipDimensions.add(dimensionName); } } return skipDimensions; } /* * Sorts the file on all dimensions */ private void sort(File file, int startDocId, int endDocId) throws IOException { if (debugMode) { LOG.info("BEFORE SORTING"); printFile(file, startDocId, endDocId); } StarTreeDataTable dataSorter = new StarTreeDataTable(file, dimensionSizeBytes, metricSizeBytes, getSortOrder()); dataSorter.sort(startDocId, endDocId, 0, dimensionSizeBytes); if (debugMode) { LOG.info("AFTER SORTING"); printFile(file, startDocId, endDocId); } } private int[] getSortOrder() { if (sortOrder == null) { sortOrder = new int[dimensionNames.size()]; for (int i = 0; i < dimensionsSplitOrder.size(); i++) { sortOrder[i] = dimensionNameToIndexMap.get(dimensionsSplitOrder.get(i)); } //add remaining dimensions that were not part of dimensionsSplitOrder int counter = 0; for (String dimName : dimensionNames) { if (!dimensionsSplitOrder.contains(dimName)) { sortOrder[dimensionsSplitOrder.size() + counter] = dimensionNameToIndexMap.get(dimName); counter = counter + 1; } } } return sortOrder; } private void printFile(File file, int startDocId, int endDocId) throws IOException { LOG.info("Contents of file:{} from:{} to:{}", file.getName(), startDocId, endDocId); StarTreeDataTable dataSorter = new StarTreeDataTable(file, dimensionSizeBytes, metricSizeBytes, getSortOrder()); Iterator<Pair<byte[], byte[]>> iterator = dataSorter.iterator(startDocId, endDocId); int numRecordsToPrint = 100; int counter = 0; while (iterator.hasNext()) { Pair<byte[], byte[]> next = iterator.next(); LOG.info("{}, {}", DimensionBuffer.fromBytes(next.getLeft()), MetricBuffer.fromBytes(next.getRight(), metricTypes)); if (counter++ == numRecordsToPrint) { break; } } } private int constructStarTree(StarTreeIndexNode node, int startDocId, int endDocId, int level, File file) throws Exception { //node.setStartDocumentId(startDocId); int docsAdded = 0; if (level == dimensionsSplitOrder.size() - 1) { return 0; } String splitDimensionName = dimensionsSplitOrder.get(level); Integer splitDimensionId = dimensionNameToIndexMap.get(splitDimensionName); LOG.debug("Building tree at level:{} using file:{} from startDoc:{} endDocId:{} splitting on dimension:{}", level, file.getName(), startDocId, endDocId, splitDimensionName); Map<Integer, IntPair> sortGroupBy = groupBy(startDocId, endDocId, splitDimensionId, file); LOG.debug("Group stats:{}", sortGroupBy); node.setChildDimensionName(splitDimensionId); node.setChildren(new HashMap<Integer, StarTreeIndexNode>()); for (int childDimensionValue : sortGroupBy.keySet()) { StarTreeIndexNode child = new StarTreeIndexNode(); child.setDimensionName(splitDimensionId); child.setDimensionValue(childDimensionValue); child.setParent(node); child.setLevel(node.getLevel() + 1); // n.b. We will number the nodes later using BFS after fully split // Add child to parent node.getChildren().put(childDimensionValue, child); int childDocs = 0; IntPair range = sortGroupBy.get(childDimensionValue); if (range.getRight() - range.getLeft() > maxLeafRecords) { childDocs = constructStarTree(child, range.getLeft(), range.getRight(), level + 1, file); docsAdded += childDocs; } // Either range <= maxLeafRecords, or we did not split further (last level). if (childDocs == 0) { child.setStartDocumentId(range.getLeft()); child.setEndDocumentId(range.getRight()); } } // Return if star node does not need to be created. if (skipStarNodeCreationForDimensions != null && skipStarNodeCreationForDimensions.contains(splitDimensionName)) { return docsAdded; } //create star node StarTreeIndexNode starChild = new StarTreeIndexNode(); starChild.setDimensionName(splitDimensionId); starChild.setDimensionValue(StarTreeIndexNode.all()); starChild.setParent(node); starChild.setLevel(node.getLevel() + 1); // n.b. We will number the nodes later using BFS after fully split // Add child to parent node.getChildren().put(StarTreeIndexNode.all(), starChild); Iterator<Pair<DimensionBuffer, MetricBuffer>> iterator = uniqueCombinations(startDocId, endDocId, file, splitDimensionId); int rowsAdded = 0; int startOffset = rawRecordCount + aggRecordCount; while (iterator.hasNext()) { Pair<DimensionBuffer, MetricBuffer> next = iterator.next(); DimensionBuffer dimension = next.getLeft(); MetricBuffer metricsHolder = next.getRight(); LOG.debug("Adding row:{}", dimension); appendToAggBuffer(dimension, metricsHolder); rowsAdded++; } docsAdded += rowsAdded; LOG.debug("Added {} additional records at level {}", rowsAdded, level); //flush dataBuffer.flush(); int childDocs = 0; if (rowsAdded >= maxLeafRecords) { sort(dataFile, startOffset, startOffset + rowsAdded); childDocs = constructStarTree(starChild, startOffset, startOffset + rowsAdded, level + 1, dataFile); docsAdded += childDocs; } // Either rowsAdded < maxLeafRecords, or we did not split further (last level). if (childDocs == 0) { starChild.setStartDocumentId(startOffset); starChild.setEndDocumentId(startOffset + rowsAdded); } //node.setEndDocumentId(endDocId + docsAdded); return docsAdded; } /** * Assumes the file is already sorted, returns the unique combinations after removing a specified dimension. * Aggregates the metrics for each unique combination, currently only sum is supported by default * @param startDocId * @param endDocId * @param file * @param splitDimensionId * @return * @throws Exception */ private Iterator<Pair<DimensionBuffer, MetricBuffer>> uniqueCombinations(int startDocId, int endDocId, File file, int splitDimensionId) throws Exception { StarTreeDataTable dataSorter = new StarTreeDataTable(file, dimensionSizeBytes, metricSizeBytes, getSortOrder()); Iterator<Pair<byte[], byte[]>> iterator1 = dataSorter.iterator(startDocId, endDocId); File tempFile = new File(outDir, file.getName() + "_" + startDocId + "_" + endDocId + ".unique.tmp"); DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(tempFile))); while (iterator1.hasNext()) { Pair<byte[], byte[]> next = iterator1.next(); byte[] dimensionBuffer = next.getLeft(); byte[] metricBuffer = next.getRight(); DimensionBuffer dimensions = DimensionBuffer.fromBytes(dimensionBuffer); for (int i = 0; i < numDimensions; i++) { String dimensionName = dimensionNameToIndexMap.inverse().get(i); if (i == splitDimensionId || (skipMaterializationForDimensions != null && skipMaterializationForDimensions.contains(dimensionName))) { dos.writeInt(StarTreeIndexNode.all()); } else { dos.writeInt(dimensions.getDimension(i)); } } dos.write(metricBuffer); } dos.close(); dataSorter = new StarTreeDataTable(tempFile, dimensionSizeBytes, metricSizeBytes, getSortOrder()); dataSorter.sort(0, endDocId - startDocId); if (debugMode) { printFile(tempFile, 0, endDocId - startDocId); } final Iterator<Pair<byte[], byte[]>> iterator = dataSorter.iterator(0, endDocId - startDocId); return new Iterator<Pair<DimensionBuffer, MetricBuffer>>() { Pair<DimensionBuffer, MetricBuffer> prev = null; boolean done = false; @Override public void remove() { throw new UnsupportedOperationException(); } @Override public boolean hasNext() { return !done; } @Override public Pair<DimensionBuffer, MetricBuffer> next() { while (iterator.hasNext()) { Pair<byte[], byte[]> next = iterator.next(); byte[] dimBuffer = next.getLeft(); byte[] metricBuffer = next.getRight(); if (prev == null) { prev = Pair.of(DimensionBuffer.fromBytes(dimBuffer), MetricBuffer.fromBytes(metricBuffer, metricTypes)); } else { Pair<DimensionBuffer, MetricBuffer> current = Pair.of(DimensionBuffer.fromBytes(dimBuffer), MetricBuffer.fromBytes(metricBuffer, metricTypes)); if (!current.getLeft().equals(prev.getLeft())) { Pair<DimensionBuffer, MetricBuffer> ret = prev; prev = current; LOG.debug("Returning unique {}", prev.getLeft()); return ret; } else { prev.getRight().aggregate(current.getRight(), metricTypes); } } } done = true; LOG.debug("Returning unique {}", prev.getLeft()); return prev; } }; } /** * sorts the file from start to end on a dimension index * @param startDocId * @param endDocId * @param dimension * @param file * @return */ private Map<Integer, IntPair> groupBy(int startDocId, int endDocId, Integer dimension, File file) { StarTreeDataTable dataSorter = new StarTreeDataTable(file, dimensionSizeBytes, metricSizeBytes, getSortOrder()); return dataSorter.groupByIntColumnCount(startDocId, endDocId, dimension); } /** * Iterator to iterate over the records from startDocId to endDocId */ @Override public Iterator<GenericRow> iterator(final int startDocId, final int endDocId) throws Exception { StarTreeDataTable dataSorter = new StarTreeDataTable(dataFile, dimensionSizeBytes, metricSizeBytes, getSortOrder()); final Iterator<Pair<byte[], byte[]>> iterator = dataSorter.iterator(startDocId, endDocId); return new Iterator<GenericRow>() { @Override public boolean hasNext() { return iterator.hasNext(); } @Override public void remove() { throw new UnsupportedOperationException(); } @Override public GenericRow next() { Pair<byte[], byte[]> pair = iterator.next(); DimensionBuffer dimensionKey = DimensionBuffer.fromBytes(pair.getLeft()); MetricBuffer metricsHolder = MetricBuffer.fromBytes(pair.getRight(), metricTypes); return toGenericRow(dimensionKey, metricsHolder); } }; } public JSONObject getStarTreeAsJSON() throws Exception { JSONObject json = new JSONObject(); toJson(json, starTreeRootIndexNode, dictionaryMap); return json; } private void toJson(JSONObject json, StarTreeIndexNode node, Map<String, HashBiMap<Object, Integer>> dictionaryMap) throws Exception { String dimName = "ALL"; Object dimValue = "ALL"; if (node.getDimensionName() != StarTreeIndexNode.all()) { dimName = dimensionNames.get(node.getDimensionName()); } if (node.getDimensionValue() != StarTreeIndexNode.all()) { dimValue = dictionaryMap.get(dimName).inverse().get(node.getDimensionValue()); } json.put("title", dimName + ":" + dimValue); if (node.getChildren() != null) { JSONObject[] childJsons = new JSONObject[node.getChildren().size()]; int index = 0; for (Integer child : node.getChildren().keySet()) { StarTreeIndexNode childNode = node.getChildren().get(child); JSONObject childJson = new JSONObject(); toJson(childJson, childNode, dictionaryMap); childJsons[index++] = childJson; } json.put("nodes", childJsons); } } @Override public void cleanup() { if (outDir != null) { FileUtils.deleteQuietly(outDir); } } @Override public StarTree getTree() { return starTree; } @Override public int getTotalRawDocumentCount() { return rawRecordCount; } @Override public int getTotalAggregateDocumentCount() { return aggRecordCount; } @Override public int getMaxLeafRecords() { return maxLeafRecords; } @Override public List<String> getDimensionsSplitOrder() { return dimensionsSplitOrder; } public Map<String, HashBiMap<Object, Integer>> getDictionaryMap() { return dictionaryMap; } public HashBiMap<String, Integer> getDimensionNameToIndexMap() { return dimensionNameToIndexMap; } @Override public Set<String> getSkipMaterializationForDimensions() { return skipMaterializationForDimensions; } }
tkao1000/pinot
pinot-core/src/main/java/com/linkedin/pinot/core/startree/OffHeapStarTreeBuilder.java
Java
apache-2.0
28,902
[ 30522, 1013, 1008, 1008, 1008, 9385, 1006, 1039, 1007, 2297, 1011, 2325, 5799, 2378, 13058, 1012, 1006, 9231, 4140, 1011, 4563, 1030, 5799, 2378, 1012, 4012, 1007, 1008, 1008, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package net.marevalo.flowsmanager; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; import java.util.ArrayList; public class CollectionAdapter extends BaseAdapter { // private static final String LOGTAG = "CollectionAdapter"; Context context; ArrayList<Entity> collection; public CollectionAdapter(Context context, ArrayList<Entity> list) { this.context = context; collection = list; } @Override public int getCount() { return collection.size(); } @Override public Object getItem(int position) { return collection.get(position); } @Override public long getItemId(int position) { return position; } @Override public View getView(int position, View convertView, ViewGroup arg2) { //Log.d(LOGTAG, "Recreating view" ); Entity entity = collection.get(position); if (convertView == null) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.row_entity, null); } // Set the icon ImageView ivIcon = (ImageView) convertView.findViewById(R.id.iconImageView ); ivIcon.setImageDrawable( context.getResources().getDrawable(entity.getIconResource() ) ); // Set the name and ID TextView tvName = (TextView) convertView.findViewById(R.id.tv_entity_name); String name = entity.getDisplayName() ; tvName.setText( name ); TextView tvId = (TextView) convertView.findViewById(R.id.tv_entity_id); String id = entity.getIdName(); tvId.setText(((name == id) ? "" : id)); return convertView; } }
marevalo/FlowsManager
app/src/main/java/net/marevalo/flowsmanager/CollectionAdapter.java
Java
gpl-3.0
1,955
[ 30522, 7427, 5658, 1012, 11941, 10175, 2080, 1012, 6223, 24805, 4590, 1025, 12324, 11924, 1012, 4180, 1012, 6123, 1025, 12324, 11924, 1012, 3193, 1012, 9621, 2378, 10258, 24932, 1025, 12324, 11924, 1012, 3193, 1012, 3193, 1025, 12324, 11924, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
var makeIterator = require('../function/makeIterator_'); /** * Array some */ /** * Description * @method some * @param {} arr * @param {} callback * @param {} thisObj * @return result */ function some(arr, callback, thisObj) { callback = makeIterator(callback, thisObj); var result = false; if (arr == null) { return result; } var i = -1, len = arr.length; while (++i < len) { // we iterate over sparse items since there is no way to make it // work properly on IE 7-8. see #64 if ( callback(arr[i], i, arr) ) { result = true; break; } } return result; } module.exports = some;
benjaminhorner/codebutler
node_modules/bower/node_modules/bower-registry-client/node_modules/bower-config/node_modules/mout/array/some.js
JavaScript
mit
804
[ 30522, 13075, 2191, 21646, 8844, 1027, 5478, 1006, 1005, 1012, 1012, 1013, 3853, 1013, 2191, 21646, 8844, 1035, 1005, 1007, 1025, 1013, 1008, 1008, 1008, 9140, 2070, 1008, 1013, 1013, 1008, 1008, 1008, 6412, 1008, 1030, 4118, 30524, 1063, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * Copied from newlib 1.8.2 */ typedef void (*pfunc) (void); extern pfunc __ctors[]; extern pfunc __ctors_end[]; void __main (void) { static int initialized; pfunc *p; if (initialized) return; initialized = 1; for (p = __ctors_end; p > __ctors; ) (*--p) (); }
zhongweiy/rtems
c/src/lib/libbsp/h8300/h8sim/startup/__main.c
C
gpl-2.0
288
[ 30522, 1013, 1008, 30524, 1033, 1025, 4654, 16451, 1052, 11263, 12273, 1035, 1035, 14931, 5668, 1035, 2203, 1031, 1033, 1025, 11675, 1035, 1035, 2364, 1006, 11675, 1007, 1063, 10763, 20014, 3988, 3550, 1025, 1052, 11263, 12273, 1008, 1052, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
from flask import json from unittest.mock import patch, Mock from urbansearch.gathering.indices_selector import IndicesSelector from urbansearch.server.main import Server from urbansearch.server import classify_documents from urbansearch.server.classify_documents import _join_workers from urbansearch.workers import Workers s = Server(run=False) @patch('urbansearch.server.classify_documents._join_workers') @patch.object(Workers, 'run_classifying_workers') @patch.object(IndicesSelector, 'run_workers') def test_download_indices_for_url(mock_rcw, mock_rw, mock_jw): with s.app.test_client() as c: resp = c.get('/api/v1/classify_documents/log_only?directory=test') assert mock_rcw.called assert mock_rw.called assert mock_jw.called @patch('urbansearch.server.classify_documents._join_workers') @patch.object(Workers, 'run_classifying_workers') @patch.object(IndicesSelector, 'run_workers') def test_classify_indices_to_db(mock_rcw, mock_rw, mock_jw): with s.app.test_client() as c: resp = c.get('/api/v1/classify_documents/to_database?directory=test') assert mock_rcw.called assert mock_rw.called assert mock_jw.called @patch('urbansearch.server.classify_documents._join_workers') @patch('urbansearch.server.classify_documents.db_utils') def test_classify_indices_to_db_no_connection(mock_db, mock_jw): mock_db.connected_to_db.return_value = False with s.app.test_client() as c: resp = c.get('/api/v1/classify_documents/to_database?directory=test') assert not mock_jw.called @patch('urbansearch.server.classify_documents._join_file_workers') @patch.object(Workers, 'run_classifying_workers') @patch.object(Workers, 'run_read_files_worker') def test_classify_textfiles_to_db(mock_rfw, mock_rw, mock_jw): classify_documents.classify_textfiles_to_db(0, 'test') assert mock_rfw.called assert mock_rw.called assert mock_jw.called @patch('urbansearch.server.classify_documents._join_workers') @patch('urbansearch.server.classify_documents.db_utils') def test_classify_textfiles_to_db_no_connection(mock_db, mock_jw): mock_db.connected_to_db.return_value = False classify_documents.classify_textfiles_to_db(0, None) assert not mock_jw.called def test_join_workers(): producers = [Mock()] cworker = Mock() consumers = [Mock()] classify_documents._join_workers(cworker, producers, consumers) for p in producers: assert p.join.called assert cworker.set_producers_done.called for c in consumers: assert c.join.called assert cworker.clear_producers_done.called def test_join_file_workers(): producers = [Mock()] cworker = Mock() consumers = [Mock()] classify_documents._join_file_workers(cworker, producers, consumers) for p in producers: assert p.join.called assert cworker.set_file_producers_done.called for c in consumers: assert c.join.called assert cworker.clear_file_producers_done.called
urbansearchTUD/UrbanSearch
tests/server/test_classify_documents.py
Python
gpl-3.0
3,035
[ 30522, 2013, 13109, 19895, 12324, 1046, 3385, 2013, 3131, 22199, 1012, 12934, 12324, 8983, 1010, 12934, 2013, 3923, 17310, 11140, 1012, 7215, 1012, 29299, 1035, 27000, 12324, 29299, 11246, 22471, 2953, 2013, 3923, 17310, 11140, 1012, 8241, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright 2007 Free Software Foundation, Inc. This file is part of GNU Binutils. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ /* Linked with objcopy.o to flag that this program is 'objcopy' (not 'strip'). */ int is_strip = 0;
pfalcon/sdcc
support/sdbinutils/binutils/not-strip.c
C
gpl-2.0
917
[ 30522, 1013, 1008, 9385, 2289, 2489, 4007, 3192, 1010, 4297, 1012, 2023, 5371, 2003, 2112, 1997, 27004, 8026, 21823, 4877, 1012, 2023, 2565, 2003, 2489, 4007, 1025, 2017, 2064, 2417, 2923, 3089, 8569, 2618, 2009, 1998, 1013, 2030, 19933, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'one_gadget/gadget' # https://gitlab.com/david942j/libcdb/blob/master/libc/libc0.1-2.21-9/lib/i386-kfreebsd-gnu/libc-2.21.so # # Intel 80386 # # GNU C Library (Debian GLIBC 2.21-9) stable release version 2.21, by Roland McGrath et al. # Copyright (C) 2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. # There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # Compiled by GNU CC version 4.9.3. # Available extensions: # crypt add-on version 2.1 by Michael Glad and others # Native POSIX Threads Library by Ulrich Drepper et al # GNU Libidn by Simon Josefsson # BIND-8.2.3-T5B # libc ABIs: UNIQUE # For bug reporting instructions, please see: # <http://www.debian.org/Bugs/>. build_id = File.basename(__FILE__, '.rb').split('-').last OneGadget::Gadget.add(build_id, 233829, constraints: ["ebx is the GOT address of libc", "[esp+0x2c] == NULL"], effect: "execve(\"/bin/sh\", esp+0x2c, environ)") OneGadget::Gadget.add(build_id, 233831, constraints: ["ebx is the GOT address of libc", "[esp+0x30] == NULL"], effect: "execve(\"/bin/sh\", esp+0x30, environ)") OneGadget::Gadget.add(build_id, 233835, constraints: ["ebx is the GOT address of libc", "[esp+0x34] == NULL"], effect: "execve(\"/bin/sh\", esp+0x34, environ)") OneGadget::Gadget.add(build_id, 233842, constraints: ["ebx is the GOT address of libc", "[esp+0x38] == NULL"], effect: "execve(\"/bin/sh\", esp+0x38, environ)") OneGadget::Gadget.add(build_id, 233877, constraints: ["ebx is the GOT address of libc", "[eax] == NULL || eax == NULL", "[[esp]] == NULL || [esp] == NULL"], effect: "execve(\"/bin/sh\", eax, [esp])") OneGadget::Gadget.add(build_id, 233878, constraints: ["ebx is the GOT address of libc", "[[esp]] == NULL || [esp] == NULL", "[[esp+0x4]] == NULL || [esp+0x4] == NULL"], effect: "execve(\"/bin/sh\", [esp], [esp+0x4])") OneGadget::Gadget.add(build_id, 395455, constraints: ["ebx is the GOT address of libc", "eax == NULL"], effect: "execl(\"/bin/sh\", eax)") OneGadget::Gadget.add(build_id, 395456, constraints: ["ebx is the GOT address of libc", "[esp] == NULL"], effect: "execl(\"/bin/sh\", [esp])")
david942j/one_gadget
lib/one_gadget/builds/libc-2.21-9595d37f80a7925dc75efa522c839df34edb4b46.rb
Ruby
mit
2,530
[ 30522, 5478, 1005, 2028, 1035, 11721, 24291, 1013, 11721, 24291, 1005, 1001, 16770, 1024, 1013, 1013, 21025, 19646, 7875, 1012, 4012, 1013, 2585, 2683, 20958, 3501, 1013, 5622, 9818, 18939, 1013, 1038, 4135, 2497, 1013, 3040, 1013, 5622, 98...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * 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.samza.table.caching.guava; import com.google.common.cache.Cache; import org.apache.samza.SamzaException; import org.apache.samza.context.Context; import org.apache.samza.storage.kv.Entry; import org.apache.samza.table.BaseReadWriteTable; import org.apache.samza.table.ReadWriteTable; import org.apache.samza.table.utils.TableMetricsUtil; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.CompletableFuture; /** * Simple cache table backed by a Guava cache instance. Application is expect to build * a cache instance with desired parameters and specify it to the table descriptor. * * @param <K> type of the key in the cache * @param <V> type of the value in the cache */ public class GuavaCacheTable<K, V> extends BaseReadWriteTable<K, V> implements ReadWriteTable<K, V> { private final Cache<K, V> cache; public GuavaCacheTable(String tableId, Cache<K, V> cache) { super(tableId); this.cache = cache; } @Override public void init(Context context) { super.init(context); TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId); // hit- and miss-rate are provided by CachingTable. tableMetricsUtil.newGauge("evict-count", () -> cache.stats().evictionCount()); } @Override public V get(K key, Object ... args) { try { return getAsync(key).get(); } catch (Exception e) { throw new SamzaException("GET failed for " + key, e); } } @Override public CompletableFuture<V> getAsync(K key, Object ... args) { CompletableFuture<V> future = new CompletableFuture<>(); try { future.complete(cache.getIfPresent(key)); } catch (Exception e) { future.completeExceptionally(e); } return future; } @Override public Map<K, V> getAll(List<K> keys, Object ... args) { try { return getAllAsync(keys).get(); } catch (Exception e) { throw new SamzaException("GET_ALL failed for " + keys, e); } } @Override public CompletableFuture<Map<K, V>> getAllAsync(List<K> keys, Object ... args) { CompletableFuture<Map<K, V>> future = new CompletableFuture<>(); try { future.complete(cache.getAllPresent(keys)); } catch (Exception e) { future.completeExceptionally(e); } return future; } @Override public void put(K key, V value, Object ... args) { try { putAsync(key, value).get(); } catch (Exception e) { throw new SamzaException("PUT failed for " + key, e); } } @Override public CompletableFuture<Void> putAsync(K key, V value, Object ... args) { if (key == null) { return deleteAsync(key); } CompletableFuture<Void> future = new CompletableFuture<>(); try { cache.put(key, value); future.complete(null); } catch (Exception e) { future.completeExceptionally(e); } return future; } @Override public void putAll(List<Entry<K, V>> entries, Object ... args) { try { putAllAsync(entries).get(); } catch (Exception e) { throw new SamzaException("PUT_ALL failed", e); } } @Override public CompletableFuture<Void> putAllAsync(List<Entry<K, V>> entries, Object ... args) { CompletableFuture<Void> future = new CompletableFuture<>(); try { // Separate out put vs delete records List<K> delKeys = new ArrayList<>(); List<Entry<K, V>> putRecords = new ArrayList<>(); entries.forEach(r -> { if (r.getValue() != null) { putRecords.add(r); } else { delKeys.add(r.getKey()); } }); cache.invalidateAll(delKeys); putRecords.forEach(e -> put(e.getKey(), e.getValue())); future.complete(null); } catch (Exception e) { future.completeExceptionally(e); } return future; } @Override public void delete(K key, Object ... args) { try { deleteAsync(key).get(); } catch (Exception e) { throw new SamzaException("DELETE failed", e); } } @Override public CompletableFuture<Void> deleteAsync(K key, Object ... args) { CompletableFuture<Void> future = new CompletableFuture<>(); try { cache.invalidate(key); future.complete(null); } catch (Exception e) { future.completeExceptionally(e); } return future; } @Override public void deleteAll(List<K> keys, Object ... args) { try { deleteAllAsync(keys).get(); } catch (Exception e) { throw new SamzaException("DELETE_ALL failed", e); } } @Override public CompletableFuture<Void> deleteAllAsync(List<K> keys, Object ... args) { CompletableFuture<Void> future = new CompletableFuture<>(); try { cache.invalidateAll(keys); future.complete(null); } catch (Exception e) { future.completeExceptionally(e); } return future; } @Override public synchronized void flush() { cache.cleanUp(); } @Override public synchronized void close() { cache.invalidateAll(); } }
prateekm/samza
samza-core/src/main/java/org/apache/samza/table/caching/guava/GuavaCacheTable.java
Java
apache-2.0
5,858
[ 30522, 1013, 1008, 1008, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 1008, 2030, 2062, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 1008, 5500, 2007, 2023, 2147, 2005, 3176, 2592, 1008, 4953, 9385, 6095, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<div class="panel-default comment comment_reply" data-id="{!! $reply->hashId() !!}" data-parent-id="{!! $reply->parent->hashId() !!}"> <a name="{!! $reply->hashId() !!}"></a> <div class="comment_avatar"> <img src="{!! $reply->user->getAvatarPath() !!}" alt="{!! $reply->user->name !!}" class="{!! $reply->user->getSexClass() !!}"> </div> <div class="panel-heading comment_header"> <a href="{!! route('user_profile', $reply->user->name) !!}" class="comment_author">{!! $reply->user->getColoredName() !!}</a> <span class="pull-right"> <i class="fa fa-clock-o"></i> <a href="{!! $reply->getURL() !!}" rel="nofollow"> @include('global.el.time', ['date' => $reply->created_at]) </a> <span class="voting" data-id="{!! $reply->hashId() !!}" state="{!! $reply->getVoteState() !!}" data-type="comment_reply"> <button type="button" class="btn btn-secondary btn-xs vote-btn-up @if ($reply->getVoteState() == 'uv') btn-success @endif"> <i class="fa fa-arrow-up vote-up"></i> <span class="count">{!! $reply->uv !!}</span> </button> <button type="button" class="btn btn-secondary btn-xs vote-btn-down @if ($reply->getVoteState() == 'dv') btn-danger @endif"> <i class="fa fa-arrow-down vote-down"></i> <span class="count">{!! $reply->dv !!}</span> </button> </span> </span> </div> <div class="comment_text md"> {!! $reply->text !!} </div> </div>
Strimoid/Strimoid
resources/views/user/widgets/comment_reply.blade.php
PHP
mit
1,585
[ 30522, 1026, 4487, 2615, 2465, 1027, 1000, 5997, 1011, 12398, 7615, 7615, 1035, 7514, 1000, 2951, 1011, 8909, 1027, 1000, 1063, 999, 999, 1002, 7514, 1011, 1028, 23325, 3593, 1006, 1007, 999, 999, 1065, 1000, 2951, 1011, 6687, 1011, 8909,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<?php $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1; $aThemes = $template->getThemes(); // Load the settings available in this system $aSettings['website'][] = array( 'display' => 'Maintenance Mode', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'maintenance', 'value' => $setting->getValue('maintenance'), 'tooltip' => 'Enable or Disable maintenance mode. Only admins can still login.' ); $aSettings['website'][] = array( 'display' => 'Message of the Day', 'type' => 'text', 'size' => 25, 'default' => '', 'name' => 'system_motd', 'value' => $setting->getValue('system_motd'), 'tooltip' => 'Display a message of the day as information popup if set.' ); $aSettings['website'][] = array( 'display' => 'Website Name', 'type' => 'text', 'size' => 25, 'default' => 'The Pool', 'name' => 'website_name', 'value' => $setting->getValue('website_name'), 'tooltip' => 'The name of you pool page, displayed in the header of the page.' ); $aSettings['website'][] = array( 'display' => 'Website Title', 'type' => 'text', 'size' => 25, 'default' => 'The Pool - Mining Evolved', 'name' => 'website_title', 'value' => $setting->getValue('website_title'), 'tooltip' => 'The title of you pool page, displayed in the browser window header.' ); $aSettings['website'][] = array( 'display' => 'Website Slogan', 'type' => 'text', 'size' => 25, 'default' => 'Resistance is Futile', 'name' => 'website_slogan', 'value' => $setting->getValue('website_slogan'), 'tooltip' => 'The slogan of you pool page, displayed in the browser window header.' ); $aSettings['website'][] = array( 'display' => 'Website e-mail', 'type' => 'text', 'size' => 25, 'default' => 'test@example.com', 'name' => 'website_email', 'value' => $setting->getValue('website_email'), 'tooltip' => 'The email address for your pool, used in mail templates and notifications.' ); $aSettings['website'][] = array( 'display' => 'Website theme', 'type' => 'select', 'options' => $aThemes, 'default' => 'mpos', 'name' => 'website_theme', 'value' => $setting->getValue('website_theme'), 'tooltip' => 'The default theme used on your pool.' ); $aSettings['website'][] = array( 'display' => 'Website mobile theme', 'type' => 'select', 'options' => $aThemes, 'default' => 'mobile', 'name' => 'website_mobile_theme', 'value' => $setting->getValue('website_mobile_theme'), 'tooltip' => 'The mobile theme used for your pool.' ); $aSettings['blockchain'][] = array( 'display' => 'Disable Blockexplorer', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'website_blockexplorer_disabled', 'value' => $setting->getValue('website_blockexplorer_disabled'), 'tooltip' => 'Enabled or disable the blockexplorer URL feature. Will remove any links using the blockexplorer URL.' ); $aSettings['blockchain'][] = array( 'display' => 'Blockexplorer URL', 'type' => 'text', 'size' => 50, 'default' => 'http://explorer.litecoin.net/block/', 'name' => 'website_blockexplorer_url', 'value' => $setting->getValue('website_blockexplorer_url'), 'tooltip' => 'URL to the blockexplorer website for your blockchain. Will append the blockhash to the URL. Leave empty to disabled this.' ); $aSettings['blockchain'][] = array( 'display' => 'Disable Transactionexplorer', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'website_transactionexplorer_disabled', 'value' => $setting->getValue('website_transactionexplorer_disabled'), 'tooltip' => 'Enabled or disable the transactionexplorer URL feature. Will remove any links using the transactionexplorer URL.' ); $aSettings['blockchain'][] = array( 'display' => 'Transactionexplorer URL', 'type' => 'text', 'size' => 50, 'default' => 'http://explorer.litecoin.net/tx/', 'name' => 'website_transactionexplorer_url', 'value' => $setting->getValue('website_transactionexplorer_url'), 'tooltip' => 'URL to the transactionexplorer website for your blockchain. Will append the transactionid to the URL. Leave empty to disabled this.' ); $aSettings['blockchain'][] = array( 'display' => 'Disable Chaininfo', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'website_chaininfo_disabled', 'value' => $setting->getValue('website_chaininfo_disabled'), 'tooltip' => 'Enabled or disable the chainfo URL feature. Will remove any links using the chaininfo URL.' ); $aSettings['blockchain'][] = array( 'display' => 'Chaininfo URL', 'type' => 'text', 'size' => 50, 'default' => 'http://allchains.info', 'name' => 'website_chaininfo_url', 'value' => $setting->getValue('website_chaininfo_url'), 'tooltip' => 'URL to the chaininfo website for your blockchain. Leave empty to disabled this.' ); $aSettings['wallet'][] = array( 'display' => 'Cold Coins', 'type' => 'text', 'size' => 6, 'default' => 0, 'name' => 'wallet_cold_coins', 'value' => $setting->getValue('wallet_cold_coins'), 'tooltip' => 'Amount of coins held in a pools cold wallet.' ); $aSettings['statistics'][] = array( 'display' => 'Ajax Refresh Interval', 'type' => 'select', 'options' => array('5' => '5', '10' => '10', '15' => '15', '30' => '30', '60' => '60' ), 'default' => 10, 'name' => 'statistics_ajax_refresh_interval', 'value' => $setting->getValue('statistics_ajax_refresh_interval'), 'tooltip' => 'How often to refresh data via ajax in seconds.' ); $aSettings['statistics'][] = array( 'display' => 'Ajax Long Refresh Interval', 'type' => 'select', 'options' => array('5' => '5', '10' => '10', '15' => '15', '30' => '30', '60' => '60', '600' => '600', '1800' => '1800', '3600' => '3600' ), 'default' => 10, 'name' => 'statistics_ajax_long_refresh_interval', 'value' => $setting->getValue('statistics_ajax_long_refresh_interval'), 'tooltip' => 'How often to refresh data via ajax in seconds. User for SQL costly queries like getBalance and getWorkers.' ); $aSettings['statistics'][] = array( 'display' => 'Ajax Data Interval', 'type' => 'select', 'options' => array('60' => '1', '180' => '3', '300' => '5', '600' => '10'), 'default' => 300, 'name' => 'statistics_ajax_data_interval', 'value' => $setting->getValue('statistics_ajax_data_interval'), 'tooltip' => 'Time in minutes, interval for hashrate and sharerate calculations. Higher intervals allow for better accuracy at a higer server load.' ); $aSettings['statistics'][] = array( 'display' => 'Block Statistics Count', 'type' => 'text', 'size' => 25, 'default' => 20, 'name' => 'statistics_block_count', 'value' => $setting->getValue('statistics_block_count'), 'tooltip' => 'Blocks to fetch for the block statistics page.' ); $aSettings['statistics'][] = array( 'display' => 'Show block average', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'statistics_show_block_average', 'value' => $setting->getValue('statistics_show_block_average'), 'tooltip' => 'Show block average in block statistics page.' ); $aSettings['statistics'][] = array( 'display' => 'Pool Hashrate Modifier', 'type' => 'select', 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ), 'default' => '1', 'name' => 'statistics_pool_hashrate_modifier', 'value' => $setting->getValue('statistics_pool_hashrate_modifier'), 'tooltip' => 'Auto-adjust displayed pool hashrates to a certain limit.' ); $aSettings['statistics'][] = array( 'display' => 'Network Hashrate Modifier', 'type' => 'select', 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ), 'default' => '1', 'name' => 'statistics_network_hashrate_modifier', 'value' => $setting->getValue('statistics_network_hashrate_modifier'), 'tooltip' => 'Auto-adjust displayed network hashrates to a certain limit.' ); $aSettings['statistics'][] = array( 'display' => 'Personal Hashrate Modifier', 'type' => 'select', 'options' => array( '1' => 'KH/s', '0.001' => 'MH/s', '0.000001' => 'GH/s', '0.000000001' => 'TH/s' ), 'default' => '1', 'name' => 'statistics_personal_hashrate_modifier', 'value' => $setting->getValue('statistics_personal_hashrate_modifier'), 'tooltip' => 'Auto-adjust displayed personal hashrates to a certain limit.' ); $aSettings['statistics'][] = array( 'display' => 'Enable Google analytics', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'statistics_analytics_enabled', 'value' => $setting->getValue('statistics_analytics_enabled'), 'tooltip' => 'Enable or Disable Google Analytics.' ); $aSettings['statistics'][] = array( 'display' => 'Google Analytics Code', 'type' => 'textarea', 'size' => 20, 'height' => 12, 'default' => 'Code from Google Analytics', 'name' => 'statistics_analytics_code', 'value' => $setting->getValue('statistics_analytics_code'), 'tooltip' => '.' ); $aSettings['acl'][] = array( 'display' => 'Hide news post author', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'acl_hide_news_author', 'value' => $setting->getValue('acl_hide_news_author'), 'tooltip' => 'Should the news author username be hidden.' ); $aSettings['acl'][] = array( 'display' => 'Pool Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_pool_statistics', 'value' => $setting->getValue('acl_pool_statistics'), 'tooltip' => 'Make the pool statistics page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Block Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_block_statistics', 'value' => $setting->getValue('acl_block_statistics'), 'tooltip' => 'Make the block statistics page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Round Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_round_statistics', 'value' => $setting->getValue('acl_round_statistics'), 'tooltip' => 'Make the round statistics page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Block Finder Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_blockfinder_statistics', 'value' => $setting->getValue('acl_blockfinder_statistics'), 'tooltip' => 'Make the Block Finder Statistics page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Uptime Statistics', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_uptime_statistics', 'value' => $setting->getValue('acl_uptime_statistics'), 'tooltip' => 'Make the uptime statistics page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Graphs', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_graphs_statistics', 'value' => $setting->getValue('acl_graphs_statistics'), 'tooltip' => 'Make the graphs statistics page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Donors Page', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_donors_page', 'value' => $setting->getValue('acl_donors_page'), 'tooltip' => 'Make the donors page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'About Page', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_about_page', 'value' => $setting->getValue('acl_about_page'), 'tooltip' => 'Make the about page private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Contactform', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 1, 'name' => 'acl_contactform', 'value' => $setting->getValue('acl_contactform'), 'tooltip' => 'Make the contactform private (users only) or public.' ); $aSettings['acl'][] = array( 'display' => 'Live Chat Page', 'type' => 'select', 'options' => array( 0 => 'Private', 1 => 'Public', 2 => 'Disabled' ), 'default' => 2, 'name' => 'acl_chat_page', 'value' => $setting->getValue('acl_chat_page'), 'tooltip' => 'Make the chat page private (users only) or public.' ); $aSettings['system'][] = array( 'display' => 'E-mail address for system error notifications', 'type' => 'text', 'size' => 25, 'default' => 'test@example.com', 'name' => 'system_error_email', 'value' => $setting->getValue('system_error_email'), 'tooltip' => 'The email address for system errors notifications, like cronjobs failures.' ); $aSettings['system'][] = array( 'display' => 'Disable e-mail confirmations', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'accounts_confirm_email_disabled', 'value' => $setting->getValue('accounts_confirm_email_disabled'), 'tooltip' => 'Should users supply a valid e-mail address upon registration. Requires them to confirm the address before accounts are activated.' ); $aSettings['system'][] = array( 'display' => 'Disable registrations', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'lock_registration', 'value' => $setting->getValue('lock_registration'), 'tooltip' => 'Enable or Disable registrations. Useful to create an invitation only pool.' ); $aSettings['system'][] = array( 'display' => 'Disable Invitations', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'disable_invitations', 'value' => $setting->getValue('disable_invitations'), 'tooltip' => 'Enable or Disable invitations. Users will not be able to invite new users via email if disabled.' ); $aSettings['system'][] = array( 'display' => 'Disable Payout Cron', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'disable_payouts', 'value' => $setting->getValue('disable_payouts'), 'tooltip' => 'Enable or Disable the payout cronjob. Users will not be able to withdraw any funds if disabled. Will be logged in monitoring page.' ); $aSettings['system'][] = array( 'display' => 'Disable Manual Payouts', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'disable_manual_payouts', 'value' => $setting->getValue('disable_manual_payouts'), 'tooltip' => 'Enable or Disable manual payouts. Users will not be able to withdraw any funds manually if disabled. Will NOT be logged in monitoring page.' ); $aSettings['system'][] = array( 'display' => 'Disable Auto Payout', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'disable_auto_payouts', 'value' => $setting->getValue('disable_auto_payouts'), 'tooltip' => 'Enable or Disable the payout cronjob. Users will not be able to withdraw any funds automatically if disabled. Will NOT be logged in monitoring page.' ); $aSettings['system'][] = array( 'display' => 'Disable API', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'disable_api', 'value' => $setting->getValue('disable_api'), 'tooltip' => 'Enable or Disable the pool wide API functions. See API reference on Github for details.' ); $aSettings['system'][] = array( 'display' => 'Disable Live Dashboard', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), 'default' => 0, 'name' => 'disable_dashboard', 'value' => $setting->getValue('disable_dashboard'), 'tooltip' => 'Disable live updates on the dashboard to reduce server load.' ); $aSettings['system'][] = array( 'display' => 'Disable Dashboard API', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), 'default' => 0, 'name' => 'disable_dashboard_api', 'value' => $setting->getValue('disable_dashboard_api'), 'tooltip' => 'Disable dashboard API entirely to reduce server load.' ); $aSettings['system'][] = array( 'display' => 'Disable Live Navbar', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), 'default' => 0, 'name' => 'disable_navbar', 'value' => $setting->getValue('disable_navbar'), 'tooltip' => 'Disable live updates on the navbar to reduce server load.' ); $aSettings['system'][] = array( 'display' => 'Disable Navbar API', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), 'default' => 0, 'name' => 'disable_navbar_api', 'value' => $setting->getValue('disable_navbar_api'), 'tooltip' => 'Disable navbar API entirely to reduce server load. Used in pool stats and navbar mini stats.' ); $aSettings['system'][] = array( 'display' => 'Disable TX Summaries', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), 'default' => 0, 'name' => 'disable_transactionsummary', 'value' => $setting->getValue('disable_transactionsummary'), 'tooltip' => 'Disable transaction summaries. Helpful with large transaction tables.' ); $aSettings['system'][] = array( 'display' => 'IRC Chat Channel', 'type' => 'text', 'size' => 25, 'default' => '#lazypoolop', 'name' => 'system_irc_chat', 'value' => $setting->getValue('system_irc_chat'), 'tooltip' => 'Your IRC support channel name.' ); $aSettings['recaptcha'][] = array( 'display' => 'Enable re-Captcha', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'recaptcha_enabled', 'value' => $setting->getValue('recaptcha_enabled'), 'tooltip' => 'Enable or Disable re-Captcha globally.' ); $aSettings['recaptcha'][] = array( 'display' => 'Enable re-Captcha Registration', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'recaptcha_enabled_registrations', 'value' => $setting->getValue('recaptcha_enabled_registrations'), 'tooltip' => 'Enable or Disable re-Captcha. Adds a re-Captcha to the registration form.' ); $aSettings['recaptcha'][] = array( 'display' => 'Enable re-Captcha Contactform', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'recaptcha_enabled_contactform', 'value' => $setting->getValue('recaptcha_enabled_contactform'), 'tooltip' => 'Enable or Disable re-Captcha. Adds a re-Captcha to the contact form.' ); $aSettings['recaptcha'][] = array( 'display' => 'Enable re-Captcha Logins', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'recaptcha_enabled_logins', 'value' => $setting->getValue('recaptcha_enabled_logins'), 'tooltip' => 'Enable or Disable re-Captcha. Adds a re-Captcha to the login form.' ); $aSettings['recaptcha'][] = array( 'display' => 're-Captcha Private Key', 'type' => 'text', 'size' => 25, 'default' => 'YOUR_PRIVATE_KEY', 'name' => 'recaptcha_private_key', 'value' => $setting->getValue('recaptcha_private_key'), 'tooltip' => '.' ); $aSettings['recaptcha'][] = array( 'display' => 're-Captcha Public Key', 'type' => 'text', 'size' => 25, 'default' => 'YOUR_PUBLIC_KEY', 'name' => 'recaptcha_public_key', 'value' => $setting->getValue('recaptcha_public_key'), 'tooltip' => 'Your public key as given by your re-Captcha account.' ); $aSettings['monitoring'][] = array( 'display' => 'Uptime Robot Private API Key', 'type' => 'text', 'size' => 100, 'default' => 'MONITOR_API_KEY|MONITOR_NAME,MONITOR_API_KEY|MONITOR_NAME,...', 'name' => 'monitoring_uptimerobot_api_keys', 'value' => $setting->getValue('monitoring_uptimerobot_api_keys'), 'tooltip' => 'Create per-monitor API keys and save them here to propagate your uptime statistics.' ); $aSettings['notifications'][] = array( 'display' => 'Notification Cleanup Time', 'type' => 'text', 'size' => 10, 'default' => 7, 'name' => 'notifications_cleanup_time', 'value' => $setting->getValue('notifications_cleanup_time'), 'tooltip' => 'Maximum age in days of notifications before cleaned from database.' ); $aSettings['notifications'][] = array( 'display' => 'Disable notifications', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes' ), 'default' => 0, 'name' => 'disable_notifications', 'value' => $setting->getValue('disable_notifications'), 'tooltip' => 'Enable or Disable system notifications. This includes new found blocks, monitoring and all other notifications.' ); $aSettings['notifications'][] = array( 'display' => 'Disable Block Notifications', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), 'default' => 0, 'name' => 'notifications_disable_block', 'value' => $setting->getValue('notifications_disable_block'), 'tooltip' => 'Enable/Disable block notifications globally. Will remove the user option too.' ); $aSettings['notifications'][] = array( 'display' => 'Disable IDLE Worker Notifications', 'type' => 'select', 'options' => array( 0 => 'No', 1 => 'Yes'), 'default' => 0, 'name' => 'notifications_disable_idle_worker', 'value' => $setting->getValue('notifications_disable_idle_worker'), 'tooltip' => 'Enable/Disable IDLE worker notifications globally. Will remove the user option too.' );
fubendong2/php_mpos
public/include/config/admin_settings.inc.php
PHP
apache-2.0
21,496
[ 30522, 1026, 1029, 25718, 1002, 13366, 10258, 11514, 1027, 1006, 999, 12935, 11514, 1006, 1007, 1007, 1029, 6164, 1006, 20346, 1006, 1005, 8299, 1013, 1015, 1012, 1015, 22649, 24641, 1005, 1007, 1007, 1024, 1015, 1025, 1002, 2012, 29122, 22...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
package org.apache.velocity.tools.view; /* * 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. */ /** * <p>ToolInfo implementation to handle "primitive" data types. * It currently supports String, Number, and Boolean data.</p> * * <p>An example of data elements specified in your toolbox.xml * might be: * <pre> * &lt;data type="string"&gt; * &lt;key&gt;app_name&lt;/key&gt; * &lt;value&gt;FooWeb Deluxe&lt;/value&gt; * &lt;/data&gt; * &lt;data type="number"&gt; * &lt;key&gt;app_version&lt;/key&gt; * &lt;value&gt;4.2&lt;/value&gt; * &lt;/data&gt; * &lt;data type="boolean"&gt; * &lt;key&gt;debug&lt;/key&gt; * &lt;value&gt;true&lt;/value&gt; * &lt;/data&gt; * &lt;data type="number"&gt; * &lt;key&gt;screen_width&lt;/key&gt; * &lt;value&gt;400&lt;/value&gt; * &lt;/data&gt; * </pre></p> * * @author Nathan Bubna * @deprecated Use {@link org.apache.velocity.tools.config.Data} * @version $Id: DataInfo.java 651469 2008-04-25 00:46:13Z nbubna $ */ @Deprecated public class DataInfo implements ToolInfo { public static final String TYPE_STRING = "string"; public static final String TYPE_NUMBER = "number"; public static final String TYPE_BOOLEAN = "boolean"; private static final int TYPE_ID_STRING = 0; private static final int TYPE_ID_NUMBER = 1; private static final int TYPE_ID_BOOLEAN = 2; private String key = null; private int type_id = TYPE_ID_STRING; private Object data = null; public DataInfo() {} /*********************** Mutators *************************/ public void setKey(String key) { this.key = key; } public void setType(String type) { if (TYPE_BOOLEAN.equalsIgnoreCase(type)) { this.type_id = TYPE_ID_BOOLEAN; } else if (TYPE_NUMBER.equalsIgnoreCase(type)) { this.type_id = TYPE_ID_NUMBER; } else /* if no type or type="string" */ { this.type_id = TYPE_ID_STRING; } } public void setValue(String value) { if (type_id == TYPE_ID_BOOLEAN) { this.data = Boolean.valueOf(value); } else if (type_id == TYPE_ID_NUMBER) { if (value.indexOf('.') >= 0) { this.data = new Double(value); } else { this.data = new Integer(value); } } else /* type is "string" */ { this.data = value; } } /*********************** Accessors *************************/ public String getKey() { return key; } public String getClassname() { return data != null ? data.getClass().getName() : null; } /** * Returns the data. Always returns the same * object since the data is a constant. Initialization * data is ignored. */ public Object getInstance(Object initData) { return data; } }
fluidinfo/velocity-tools-packaging
src/main/java/org/apache/velocity/tools/view/DataInfo.java
Java
apache-2.0
3,790
[ 30522, 7427, 8917, 1012, 15895, 1012, 10146, 1012, 5906, 1012, 3193, 1025, 1013, 1008, 1008, 7000, 2000, 1996, 15895, 4007, 3192, 1006, 2004, 2546, 1007, 2104, 2028, 1008, 2030, 2062, 12130, 6105, 10540, 1012, 2156, 1996, 5060, 5371, 1008, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* * The MIT License (MIT) * * Copyright (c) 2007-2015 Broad Institute * * 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. */ /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package org.broad.igv.track; import org.broad.igv.prefs.PreferencesManager; import org.broad.igv.sam.InsertionMarker; import org.broad.igv.ui.panel.ReferenceFrame; import javax.swing.*; import java.awt.*; import java.util.HashMap; import java.util.List; import java.util.Map; import static org.broad.igv.prefs.Constants.ENABLE_ANTIALISING; /** * @author jrobinso */ public class RenderContext { private Graphics2D graphics; private Map<Object, Graphics2D> graphicCache; private ReferenceFrame referenceFrame; private JComponent panel; private Rectangle visibleRect; private boolean merged = false; public transient int translateX; private List<InsertionMarker> insertionMarkers; public boolean multiframe = false; public RenderContext(JComponent panel, Graphics2D graphics, ReferenceFrame referenceFrame, Rectangle visibleRect) { this.graphics = graphics; this.panel = panel; this.graphicCache = new HashMap(); this.referenceFrame = referenceFrame; this.visibleRect = visibleRect; if (PreferencesManager.getPreferences().getAsBoolean(ENABLE_ANTIALISING) && graphics != null) { graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } } public RenderContext(RenderContext context) { this.graphics = context.getGraphics(); this.graphicCache = new HashMap<>(); this.referenceFrame = new ReferenceFrame(context.referenceFrame); this.panel = context.panel; this.visibleRect = new Rectangle(context.visibleRect); if (PreferencesManager.getPreferences().getAsBoolean(ENABLE_ANTIALISING) && graphics != null) { graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } } public Graphics2D getGraphics() { return graphics; } public void clearGraphicsCache() { graphicCache.clear(); } public Graphics2D getGraphics2D(Object key) { Graphics2D g = graphicCache.get(key); if (g == null) { g = (Graphics2D) graphics.create(); if (PreferencesManager.getPreferences().getAsBoolean(ENABLE_ANTIALISING)) { g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } graphicCache.put(key, g); } return g; } public Graphics2D getGraphic2DForColor(Color color) { Graphics2D g = getGraphics2D(color); g.setColor(color); return g; } public Color getBackgroundColor() { return panel.getBackground(); } public String getChr() { return referenceFrame.getChrName(); } public double getOrigin() { return referenceFrame.getOrigin(); } public double getEndLocation() { return referenceFrame.getEnd(); } public double getScale() { return referenceFrame.getScale(); } public Rectangle getVisibleRect() { return visibleRect; } public JComponent getPanel() { return panel; } public int getZoom() { return referenceFrame.getZoom(); } public ReferenceFrame getReferenceFrame() { return referenceFrame; } public boolean isMerged() { return merged; } public void setMerged(boolean merged) { this.merged = merged; } /** * Release graphics objects * * @throws java.lang.Throwable */ @Override protected void finalize() throws Throwable { super.finalize(); dispose(); } public void dispose() { // Note: don't dispose of "this.graphics", its used later to paint the border for (Graphics2D g : graphicCache.values()) { g.dispose(); } graphicCache.clear(); } public void setInsertionMarkers(List<InsertionMarker> insertionMarkers) { this.insertionMarkers = insertionMarkers; } public List<InsertionMarker> getInsertionMarkers() { return insertionMarkers; } }
popitsch/varan-gie
src/org/broad/igv/track/RenderContext.java
Java
mit
5,732
[ 30522, 1013, 1008, 1008, 1996, 10210, 6105, 1006, 10210, 1007, 1008, 1008, 9385, 1006, 1039, 1007, 2289, 1011, 2325, 5041, 2820, 1008, 1008, 6656, 2003, 2182, 3762, 4379, 1010, 2489, 1997, 3715, 1010, 2000, 2151, 2711, 11381, 1037, 6100, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
Namespace BattleSystem.Moves.Steel Public Class GyroBall Inherits Attack Public Sub New() '#Definitions Me.Type = New Element(Element.Types.Steel) Me.ID = 360 Me.OriginalPP = 5 Me.CurrentPP = 5 Me.MaxPP = 5 Me.Power = 0 Me.Accuracy = 100 Me.Category = Categories.Physical Me.ContestCategory = ContestCategories.Cool Me.Name = "Gyro Ball" Me.Description = "The user tackles the target with a high-speed spin. The slower the user, the greater the damage." Me.CriticalChance = 1 Me.IsHMMove = False Me.Target = Targets.OneAdjacentTarget Me.Priority = 0 Me.TimesToAttack = 1 '#End '#SpecialDefinitions Me.MakesContact = True Me.ProtectAffected = True Me.MagicCoatAffected = False Me.SnatchAffected = False Me.MirrorMoveAffected = True Me.KingsrockAffected = True Me.CounterAffected = True Me.DisabledWhileGravity = False Me.UseEffectiveness = True Me.ImmunityAffected = True Me.HasSecondaryEffect = False Me.RemovesFrozen = False Me.IsHealingMove = False Me.IsRecoilMove = False Me.IsPunchingMove = False Me.IsDamagingMove = True Me.IsProtectMove = False Me.IsSoundMove = False Me.IsAffectedBySubstitute = True Me.IsOneHitKOMove = False Me.IsWonderGuardAffected = True Me.IsBulletMove = True '#End End Sub Public Overrides Function GetBasePower(own As Boolean, BattleScreen As BattleScreen) As Integer Dim p As Pokemon = BattleScreen.OwnPokemon Dim op As Pokemon = BattleScreen.OppPokemon If own = False Then p = BattleScreen.OppPokemon op = BattleScreen.OwnPokemon End If Dim p_Speed As Integer = BattleCalculation.DetermineBattleSpeed(own, BattleScreen) Dim op_Speed As Integer = BattleCalculation.DetermineBattleSpeed(Not own, BattleScreen) Dim basepower As Integer = CInt(Math.Ceiling(25 * (op_Speed / p_Speed))) basepower = basepower.Clamp(1, 150) Return basepower End Function End Class End Namespace
P3D-Legacy/p3d-legacy
P3D/Pokemon/Attacks/Steel/GyroBall.vb
Visual Basic
gpl-3.0
2,511
[ 30522, 3415, 15327, 7465, 27268, 6633, 1012, 5829, 1012, 3886, 2270, 2465, 1043, 12541, 16429, 8095, 22490, 2015, 2886, 2270, 4942, 2047, 1006, 1007, 1005, 1001, 15182, 2033, 1012, 2828, 1027, 2047, 5783, 1006, 5783, 1012, 4127, 1012, 3886,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<md-button class="md-fab addEventFab" aria-label="Eat cake" ng-click="addNewLifetime($event)"> <md-icon class="addEventFabIcon" md-svg-src="img/icons/add.svg"></md-icon> </md-button>
rishabh1403/agenda
public/templates/addFabIcon.html
HTML
mit
203
[ 30522, 1026, 9108, 1011, 6462, 2465, 1027, 1000, 9108, 1011, 6904, 2497, 5587, 18697, 3372, 7011, 2497, 1000, 9342, 1011, 3830, 1027, 1000, 4521, 9850, 1000, 12835, 1011, 11562, 1027, 1000, 5587, 2638, 13668, 29323, 7292, 1006, 1002, 2724, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
// // AppDelegate.h // topController // // Created by 张衡 on 2016/11/18. // Copyright © 2016年 张衡. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
RXTeams/topController
topController/AppDelegate.h
C
mit
280
[ 30522, 1013, 1013, 1013, 1013, 10439, 9247, 29107, 2618, 1012, 1044, 1013, 1013, 2327, 8663, 13181, 10820, 1013, 1013, 1013, 1013, 2580, 2011, 100, 100, 2006, 2355, 1013, 2340, 1013, 2324, 1012, 1013, 1013, 9385, 1075, 2355, 1840, 100, 10...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<!DOCTYPE html> <!--[if IE 7]> <html class="ie ie7" dir="rtl" lang="fa-IR"> <![endif]--> <!--[if IE 8]> <html class="ie ie8" dir="rtl" lang="fa-IR"> <![endif]--> <!--[if !(IE 7) | !(IE 8) ]><!--> <html dir="rtl" lang="fa-IR"> <!--<![endif]--> <head> <meta charset="utf-8"/> <meta content="IE-edge,chrome=1" http-equiv="X-UA-Compatable"/> <meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="keywords" content=", "/> <meta name="author" content="Sadra Isapanah Amlashi | صدرا عیسی پناه املشی"/> <!-- Global site tag (gtag.js) - Google Analytics --> <script> (function(b,l,e,g,h,f){1!==parseInt(e.msDoNotTrack||b.doNotTrack||e.doNotTrack,10)&&b.addEventListener("load",function(){var r=(new Date).getTime();b.galite=b.galite||{};var m=new XMLHttpRequest,n="https://www.google-analytics.com/collect?cid="+(l.uid=l.uid||Math.random()+"."+Math.random())+"&v=1&tid="+galite.UA+"&dl="+f(h.location.href)+"&ul=en-us&de=UTF-8",a=function(b){var d="",c;for(c in b){if(void 0===b[c])return!1;d+=f(b[c])}return d},p={dt:[h.title],sd:[g.colorDepth,"-bit"],sr:[g.availHeight, "x",g.availWidth],vp:[innerWidth,"x",innerHeight],dr:[h.referrer]},k;for(k in p){var q=k+"="+a(p[k]);q&&(n+="&"+q)}a=function(b,d){var c="",a;for(a in d)c+="&"+a+"="+f(d[a]);return function(){var a=n+c+(galite.anonymizeIp?"&aip=1":"")+"&t="+f(b)+"&z="+(new Date).getTime();if(e.sendBeacon)e.sendBeacon(a);else try{m.open("GET",a,!1),m.send()}catch(t){(new Image).src=a}}};setTimeout(a("pageview",null),100);b.addEventListener("unload",a("timing",{utc:"JS Dependencies",utv:"unload",utt:(new Date).getTime()- r}))})})(window,localStorage,navigator,screen,document,encodeURIComponent); var galite = galite || {}; galite.UA = 'UA-107934487-1'; // Insert your tracking code here </script> <meta name="twitter:card" content="summary" /> <meta name="twitter:site" content="@sadra_amlashi" /> <meta name="twitter:creator" content="@sadra_amlashi" /> <meta property="og:type" content="website" /> <meta property="og:locale" content="fa_IR" /> <meta property="og:url" content="https://sadra.me/tag/%D9%81%D9%84%D8%B3%D9%81%D9%87/" /> <meta name="description" content="سلام! من صدرا عیسی پناه املشی هستم. توسعه دهنده اپلیکیشن iOS و Android. "/> <meta property="og:description" content="سلام! من صدرا عیسی پناه املشی هستم. توسعه دهنده اپلیکیشن iOS و Android. "/> <meta name="twitter:description" content="سلام! من صدرا عیسی پناه املشی هستم. توسعه دهنده اپلیکیشن iOS و Android. "/> <title>فلسفه | صدرا املشی</title> <meta property="twitter:title" content="فلسفه | صدرا املشی"/> <meta property="og:site_name" content="فلسفه | صدرا املشی"/> <meta property="og:title" content="فلسفه | صدرا املشی"/> <meta property="twitter:image" content="https://sadra.me/assets/img/avatar.jpg" /> <meta property="og:image" content="https://sadra.me/assets/img/avatar.jpg" /> <link rel="alternate" type="application/rss+xml" title="وبلاگ صدرا املشی » Feed" href="/site-map.xml"/> <link rel="alternative" href="/site-map.xml" title="وبلاگ صدرا املشی" type="application/atom+xml"/> <link rel="short icon" type="image/x-icon" href="https://sadra.me/assets/img/base/favicon.png"/> <link rel="stylesheet" type="text/css" href="https://sadra.me/assets/css/styles.css"/> </head> <body dir="rtl" lang="Farsi" > <!-- Header --> <header class="header-rtl"> <nav class="nav-wrap"> <a href="/" class="nav-logo">وبلاگ صدرا املشی</a> <ul class="navigation"> <li><a href="/">یادداشت‌ها</a></li> <li><a href="/list/items">موضوعات</a></li> <li><a href="/about">درباره</a></li> <li><a href="http://cv.sadra.me/">رزومه</a></li> <li><a href="https://sadra.me/english">English</a></li> </ul> </nav> </header> <!-- /Header --> <div class="content"> <h1 class="archive-title">پستهای مرتبط با هشتگ <span>#فلسفه</span></h1> <div class="blog-post-list"> <div class="blog-post-item-container"> <div class="post-date-box"> <p class="post-item-date">05 <br/>مهر</p> </div> <div class="post-feature-box"> <a class="post-item-title-link" href="/2018/sapiens"><p class="post-item-title">انسان خردمند - تاریخ مختصر بشر!</p></a> <div class="post-list-routes"> <a class="category-link" href="/category/book">Book</a> <a class="category-link" href="/category/کتاب">کتاب</a> <a class="tag-link" href="/tag/انسان">انسان</a> <a class="tag-link" href="/tag/تاریخ">تاریخ</a> <a class="tag-link" href="/tag/جامعه-شناسی">جامعه‌شناسی</a> <a class="tag-link" href="/tag/فلسفه">فلسفه</a> </div> </div> </div> </div> </div> <!-- Footer --> <footer class="footer-wrapper"> <div class="delimiter"> <a href="/" class="footer-logo"> <img src="https://sadra.me/assets/img/base/favicon.png" class="logo-wrapper"> </a> </div> <p class="footer-copyright"> 2008 - 2017<br> مطالب تحت لیسانس <a href="http://creativecommons.org/licenses/by-nc-nd/3.0/" rel="license" target="_blank">کریتیو کامنز</a> منتشر می‌شوند. </p> <div class="footer-social-links"> <a href="https://twitter.com/sadra-amlashi" title="Twitter" target="_blank"><i class="fa fa-twitter"></i></a> <a href="https://github.com/sadra" title="Github" target="_blank"><i class="fa fa-github"></i></a> <a href="https://medium.com/sadra" title="Medium" target="_blank"><i class="fa fa-medium"></i></a> <a href="https://www.linkedin.com/in/amlashisadra/" title="Linkedin" target="_blank"><i class="fa fa-linkedin"></i></a> <a href="https://facebook.com/sadra.am123" title="Facebook" target="_blank"><i class="fa fa-facebook"></i></a> </div> </footer> <!-- /Footer --> </body> </html>
sadra/sadra.github.io
tag/فلسفه/index.html
HTML
mit
6,802
[ 30522, 1026, 999, 9986, 13874, 16129, 1028, 1026, 999, 1011, 1011, 1031, 2065, 29464, 1021, 1033, 1028, 1026, 16129, 2465, 1027, 1000, 29464, 29464, 2581, 1000, 16101, 1027, 1000, 19387, 2140, 1000, 11374, 1027, 1000, 6904, 1011, 20868, 100...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
<html> <head> <style> #sitemast { position: absolute; width:1.5em; font-size:400%; } #sitemast a {color: green; background: green; padding: 0; text-decoration: none } </style> </head> <body> You should see a single green stripe below. The test has failed if you don't see a perfect rectangle. <div id="sitemast"> <a><span>A </span> A<br><span>A </span> A A</a> </div>
js0701/chromium-crosswalk
third_party/WebKit/LayoutTests/fast/block/positioning/056.html
HTML
bsd-3-clause
378
[ 30522, 1026, 16129, 1028, 1026, 2132, 1028, 1026, 2806, 1028, 1001, 2609, 9335, 2102, 1063, 2597, 1024, 7619, 1025, 9381, 1024, 1015, 1012, 1019, 6633, 1025, 15489, 1011, 2946, 1024, 4278, 1003, 1025, 1065, 1001, 2609, 9335, 2102, 1037, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
(function(h,t,z,q){function g(b,a){try{return t.hasOwnProperty?b.hasOwnProperty(a.toString()):Object.prototype.hasOwnProperty.call(b,a.toString())}catch(d){console.dir(d)}}function p(b,a){var d=[],c=/^[+-]?\d+(\.\d+)?$/,f={lat:"",lng:""};if("string"===typeof b||h.isArray(b))if(d="string"===typeof b?b.replace(/\s+/,"").split(","):b,2===d.length)c.test(d[0])&&c.test(d[1])&&(f.lat=d[0],f.lng=d[1]);else return b;else if("object"===typeof b){if("function"===typeof b.lat||"function"===typeof b.lng)return b; g(b,"x")&&g(b,"y")?(f.lat=b.x,f.lng=b.y):g(b,"lat")&&g(b,"lng")&&(f.lat=b.lat,f.lng=b.lng)}return q!==a&&!0===a?new google.maps.LatLng(f.lat,f.lng):f}function r(b){var a=b.css||"";this.setValues(b);this.span=h("<span/>").css({position:"relative",left:"-50%",top:"0","white-space":"nowrap"}).addClass(a);this.div=h("<div/>").css({position:"absolute",display:"none"});this.span.appendTo(this.div)}function u(b,a){var d=h.extend({},y,a),c={},f="";if(g(t,"google")){this.map=null;this._markers=[];this._labels= [];this.container=b;this.options=d;this.googleMapOptions={};this.interval=parseInt(this.options.interval,10)||200;for(f in this.options)g(this.options,f)&&(c=this.options[f],/ControlOptions/g.test(f)&&g(c,"position")&&"string"===typeof c.position&&(this.options[f].position=google.maps.ControlPosition[c.position.toUpperCase()]));this.googleMapOptions=this.options;g(d,"streetView")&&(this.googleMapOptions.streetViewObj=d.streetView,delete this.googleMapOptions.streetView);this.googleMapOptions.center= p(d.center,!0);g(d,"styles")&&("string"===typeof d.styles?g(v,d.styles)&&(this.googleMapOptions.styles=v[d.styles]):h.isArray(d.styles)&&(this.googleMapOptions.styles=d.styles));h(this.container).html(d.loading);this.init()}}var y={autoLocation:!1,center:[24,121],event:null,infoWindowAutoClose:!0,interval:200,kml:[],loading:"\u8b80\u53d6\u4e2d&hellip;",marker:[],markerCluster:!1,markerFitBounds:!1,notfound:"\u627e\u4e0d\u5230\u67e5\u8a62\u7684\u5730\u9ede",polyline:[],zoom:8},w=0,x=0,v={},v={greyscale:[{featureType:"all", stylers:[{saturation:-100},{gamma:.5}]}]};r.prototype=new google.maps.OverlayView;r.prototype.onAdd=function(){this.div.appendTo(h(this.getPanes().overlayLayer));this.listeners=[google.maps.event.addListener(this,"visible_changed",this.onRemove)]};r.prototype.draw=function(){var b=this.getProjection(),a={};try{a=b.fromLatLngToDivPixel(this.get("position")),this.div.css({left:a.x+"px",top:a.y+"px",display:"block"}),this.text&&this.span.html(this.text.toString())}catch(d){}};r.prototype.onRemove=function(){h(this.div).remove()}; u.prototype={VERSION:"2.9.8",_polylines:[],_polygons:[],_circles:[],_kmls:[],_directions:[],_directionsMarkers:[],bounds:new google.maps.LatLngBounds,kml:function(b,a){var d={},c={preserveViewport:!1,suppressInfoWindows:!1},f=0;if(g(a,"kml"))if("string"===typeof a.kml)d=new google.maps.KmlLayer(a.kml,c),d.setMap(b),this._kmls.push(d);else if(h.isArray(a.kml))for(f=0;f<a.kml.length;f+=1)"string"===typeof a.kml[f]&&(d=new google.maps.KmlLayer(a.kml[f],c),d.setMap(b),this._kmls.push(d))},direction:function(b, a){if(g(a,"direction")&&h.isArray(a.direction))for(var d=0;d<a.direction.length;d+=1)this.directionService(a.direction[d])},markers:function(b,a,d){var c={},f=0,e=0,k=c=0,l=[],m=[];x=w=0;l=this._markers;if(!d||0===l.length&&h.isArray(a.marker))for(e=0,f=a.marker.length;e<f;e+=1)c=a.marker[e],g(c,"addr")&&(c.parseAddr=p(c.addr,!0),"string"===typeof c.parseAddr?this.markerByGeocoder(b,c,a):this.markerDirect(b,c,a));if("modify"===d)for(m=this._labels,e=0,f=a.marker.length;e<f;e+=1)if(g(a.marker[e],"id")){for(c= 0;c<l.length;c+=1)a.marker[e].id===l[c].id&&g(a.marker[e],"addr")&&(l[c].setPosition(new google.maps.LatLng(a.marker[e].addr[0],a.marker[e].addr[1])),g(a.marker[e],"text")&&(g(l[c],"infoWindow")?"function"===typeof l[c].infoWindow.setContent&&l[c].infoWindow.setContent(a.marker[e].text):(l[c].infoWindow=new google.maps.InfoWindow({content:a.marker[e].text}),this.bindEvents(l[c],a.marker[e].event))),g(a.marker[e],"icon")&&l[c].setIcon(a.marker[e].icon));c=0;for(k=m.length;c<k;c+=1)a.marker[e].id=== m[c].id&&(g(a.marker[e],"label")&&(m[c].text=a.marker[e].label),m[c].draw())}else g(a.marker[e],"addr")&&(a.marker[e].parseAddr=p(a.marker[e].addr,!0),"string"===typeof a.marker[e].parseAddr?this.markerByGeocoder(b,a.marker[e]):this.markerDirect(b,a.marker[e]));if(g(a,"markerCluster")&&!0===a.markerCluster&&"function"===typeof MarkerClusterer)return new MarkerClusterer(b,this._markers)},drawPolyline:function(b,a){var d={},c=0,f={},f={},e=0,k=new google.maps.MVCArray,f={},l=[],f={},m=[],s={};if(g(a, "polyline")&&g(a.polyline,"coords")&&h.isArray(a.polyline.coords)){for(c=0;c<a.polyline.coords.length;c+=1)f=a.polyline.coords[c],f=p(f,!0),"function"===typeof f.lat&&k.push(f);f=h.extend({},{strokeColor:a.polyline.color||"#FF0000",strokeOpacity:1,strokeWeight:a.polyline.width||2},a.polyline);d=new google.maps.Polyline(f);this._polylines.push(d);if(2<k.getLength())for(c=0;c<k.length;c+=1)0<c&&k.length-1>c&&m.push({location:k.getAt(c),stopover:!1});g(a.polyline,"event")&&self.bindEvents(d,a.polyline.event); g(a.polyline,"snap")&&!0===a.polyline.snap?(f=new google.maps.DirectionsService,f.route({origin:k.getAt(0),waypoints:m,destination:k.getAt(k.length-1),travelMode:google.maps.DirectionsTravelMode.DRIVING},function(b,f){if(f===google.maps.DirectionsStatus.OK){c=0;for(e=b.routes[0].overview_path;c<e.length;c+=1)l.push(e[c]);d.setPath(l);"function"===typeof a.polyline.getDistance&&(s=b.routes[0].legs[0].distance,a.polyline.getDistance.call(this,s))}})):(d.setPath(k),g(google.maps,"geometry")&&g(google.maps.geometry, "spherical")&&"function"===typeof google.maps.geometry.spherical.computeDistanceBetween&&(s=google.maps.geometry.spherical.computeDistanceBetween(k.getAt(0),k.getAt(k.length-1)),"function"===typeof a.polyline.getDistance&&a.polyline.getDistance.call(this,s)));d.setMap(b)}},drawPolygon:function(b,a){var d={},d=0,c={},c={},d={},f=[];if(g(a,"polygon")&&g(a.polygon,"coords")&&h.isArray(a.polygon.coords)){for(d=0;d<a.polygon.coords.length;d+=1)c=a.polygon.coords[d],c=p(c,!0),"function"===typeof c.lat&& f.push(c);d=h.extend({},{path:f,strokeColor:a.polygon.color||"#FF0000",strokeOpacity:1,strokeWeight:a.polygon.width||2,fillColor:a.polygon.fillcolor||"#CC0000",fillOpacity:.35},a.polygon);d=new google.maps.Polygon(d);g(a.polygon,"event")&&this.bindEvents(d,a.polygon.event);this._polygons.push(d);d.setMap(b)}},drawCircle:function(b,a){var d=0,c={},f={},e={},f={};if(g(a,"circle")&&h.isArray(a.circle))for(d=a.circle.length-1;0<=d;d-=1)e=a.circle[d],f=h.extend({},{map:b,strokeColor:e.color||"#FF0000", strokeOpacity:e.opacity||.8,strokeWeight:e.width||2,fillColor:e.fillcolor||"#FF0000",fillOpacity:e.fillopacity||.35,radius:e.radius||10,zIndex:100,id:g(e,"id")?e.id:""},e),g(e,"center")&&(c=p(e.center,!0),f.center=c),"function"===typeof c.lat&&(f=new google.maps.Circle(f),this._circles.push(f),g(e,"event")&&this.bindEvents(f,e.event))},overlay:function(){var b=this.map,a=this.options;try{this.kml(b,a),this.direction(b,a),this.markers(b,a),this.drawPolyline(b,a),this.drawPolygon(b,a),this.drawCircle(b, a),this.streetView(b,a),this.geoLocation(b,a)}catch(d){console.dir(d)}},markerIcon:function(b){var a=h.extend({},a,b.icon);if(g(b,"icon")){if("string"===typeof b.icon)return b.icon;g(b.icon,"url")&&(a.url=b.icon.url);g(b.icon,"size")&&h.isArray(b.icon.size)&&2===b.icon.size.length&&(a.size=new google.maps.Size(b.icon.size[0],b.icon.size[1]));g(b.icon,"scaledSize")&&h.isArray(b.icon.scaledSize)&&2===b.icon.scaledSize.length&&(a.scaledSize=new google.maps.Size(b.icon.scaledSize[0],b.icon.scaledSize[1])); g(b.icon,"anchor")&&h.isArray(b.icon.anchor)&&2===b.icon.anchor.length&&(a.anchor=new google.maps.Point(b.icon.anchor[0],b.icon.anchor[1]))}return a},markerDirect:function(b,a){var d={},c={},c={},c=g(a,"id")?a.id:"",d=g(a,"title")?a.title.toString().replace(/<([^>]+)>/g,""):!1,f=g(a,"text")?a.text.toString():!1,e=h.extend({},{map:b,position:a.parseAddr,animation:null,id:c},a),k=this.markerIcon(a);d&&(e.title=d);f&&(e.text=f,e.infoWindow=new google.maps.InfoWindow({content:f}));h.isEmptyObject(k)|| (e.icon=k);g(a,"animation")&&"string"===typeof a.animation&&(e.animation=google.maps.Animation[a.animation.toUpperCase()]);d=new google.maps.Marker(e);this._markers.push(d);g(d,"position")&&("function"===typeof d.getPosition&&this.bounds.extend(d.position),!0===this.options.markerFitBounds&&this._markers.length===this.options.marker.length&&b.fitBounds(this.bounds));if(!0===this.options.markerCluster&&"function"===typeof MarkerClusterer&&w===this.options.marker.length)return new MarkerClusterer(b, this._markers);c={map:b,css:g(a,"css")?a.css.toString():"",id:c};"string"===typeof a.label&&0!==a.label.length&&(c.text=a.label,c=new r(c),c.bindTo("position",d,"position"),c.bindTo("text",d,"position"),c.bindTo("visible",d),this._labels.push(c));this.bindEvents(d,a.event)},markerByGeocoder:function(b,a){var d=this;(new google.maps.Geocoder).geocode({address:a.parseAddr},function(c,f){if(f===google.maps.GeocoderStatus.OVER_QUERY_LIMIT)t.setTimeout(function(){d.markerByGeocoder(b,a)},d.interval);else if(f=== google.maps.GeocoderStatus.OK){var e={},k={},k={},l=g(a,"id")?a.id:"",e=g(a,"title")?a.title.toString().replace(/<([^>]+)>/g,""):!1,k=g(a,"text")?a.text.toString():!1,l={map:b,position:c[0].geometry.location,animation:null,id:l},m=d.markerIcon(a);e&&(l.title=e);k&&(l.text=k,l.infoWindow=new google.maps.InfoWindow({content:k}));h.isEmptyObject(m)||(l.icon=m);g(a,"animation")&&"string"===typeof a.animation&&(l.animation=google.maps.Animation[a.animation.toUpperCase()]);l=h.extend({},l,a);e=new google.maps.Marker(l); d._markers.push(e);g(e,"position")&&("function"===typeof e.getPosition&&d.bounds.extend(e.position),!0===d.options.markerFitBounds&&d._markers.length===d.options.marker.length&&b.fitBounds(d.bounds));if(g(d.options,"markerCluster")&&"function"===typeof MarkerClusterer&&x===d.options.marker.length)return new MarkerClusterer(b,d._markers);k={map:d.map,css:g(a,"css")?a.css.toString():""};"string"===typeof a.label&&0!==a.label.length&&(k.text=a.label,k=new r(k),k.bindTo("position",e,"position"),k.bindTo("text", e,"position"),k.bindTo("visible",e),d._labels.push(k));d.bindEvents(e,a.event)}})},directionService:function(b){if(g(b,"from")&&g(b,"to")){var a=this,d=new google.maps.DirectionsService,c=new google.maps.DirectionsRenderer,f={travelMode:google.maps.DirectionsTravelMode.DRIVING,optimizeWaypoints:g(b,"optimize")?b.optimize:!1},e={},k={},l=[],m={},s=[],q={},r="",n=0,t=0;f.origin=p(b.from,!0);f.destination=p(b.to,!0);g(b,"travel")&&google.maps.TravelMode[b.travel.toString().toUpperCase()]&&(f.travelMode= google.maps.TravelMode[b.travel.toString().toUpperCase()]);g(b,"panel")&&(e=h(b.panel));if(g(b,"waypoint")&&h.isArray(b.waypoint)){n=0;for(t=b.waypoint.length;n<t;n+=1)m={},"string"===typeof b.waypoint[n]||h.isArray(b.waypoint[n])?m={location:p(b.waypoint[n],!0),stopover:!0}:(g(b.waypoint[n],"location")&&(m.location=p(b.waypoint[n].location,!0)),m.stopover=g(b.waypoint[n],"stopover")?b.waypoint[n].stopover:!0),s.push(b.waypoint[n].text||b.waypoint[n].toString()),l.push(m);f.waypoints=l}d.route(f, function(d,f){var e=0,h=0;if(f===google.maps.DirectionsStatus.OK){e=d.routes[0].legs;g(b,"autoViewport")&&(k.preserveViewport=!1===b.autoViewport?!0:!1);try{for(g(b,"fromText")&&(e[0].start_address=b.fromText),g(b,"toText")&&(1===e.length?e[0].end_address=b.toText:e[e.length-1].end_address=b.toText),1===e.length?(q=e[0].end_location,r=e[0].end_address):(q=e[e.length-1].end_location,r=e[e.length-1].end_address),g(b,"icon")&&(k.suppressMarkers=!0,g(b.icon,"from")&&"string"===typeof b.icon.from&&a.directionServiceMarker(e[0].start_location, {icon:b.icon.from,text:e[0].start_address}),g(b.icon,"to")&&"string"===typeof b.icon.to&&a.directionServiceMarker(q,{icon:b.icon.to,text:r})),h=0;h<e.length-1;h+=1)e[h].end_address=s[h],g(b,"icon")&&g(b.icon,"waypoint")&&a.directionServiceMarker(e[h].start_location,{icon:b.icon.waypoint,text:e[h].start_address})}catch(l){}a.bindEvents(c,b.event);c.setOptions(k);c.setDirections(d)}});c.setMap(a.map);e.length&&c.setPanel(e.get(0));a._directions.push(c)}},directionServiceMarker:function(b,a){var d=h.extend({}, {position:b,map:this.map},a),c={};g(d,"text")&&(d.infoWindow=new google.maps.InfoWindow({content:d.text}));c=new google.maps.Marker(d);this._directionsMarkers.push(c);this.bindEvents(c)},bindEvents:function(b,a){var d=this,c={};switch(typeof a){case "function":google.maps.event.addListener(b,"click",a);break;case "object":for(c in a)"function"===typeof a[c]?google.maps.event.addListener(b,c,a[c]):g(a[c],"func")&&"function"===typeof a[c].func?g(a[c],"once")&&!0===a[c].once?google.maps.event.addListenerOnce(b, c,a[c].func):google.maps.event.addListener(b,c,a[c].func):"function"===typeof a[c]&&google.maps.event.addListener(b,c,a[c])}g(b,"infoWindow")&&google.maps.event.addListener(b,"click",function(){var a=0,c={};if(g(d.options,"infoWindowAutoClose")&&!0===d.options.infoWindowAutoClose)for(a=0;a<d._markers.length;a+=1)c=d._markers[a],g(c,"infoWindow")&&"function"===typeof c.infoWindow.close&&c.infoWindow.close();b.infoWindow.open(d.map,b)})},streetView:function(b,a){var d={},c=g(a,"streetViewObj")?a.streetViewObj: {},f={heading:0,pitch:0,zoom:1},e={};"function"===typeof b.getStreetView&&g(a,"streetViewObj")&&(d=b.getStreetView(),g(c,"position")?(e=p(c.position,!0),c.position="object"!==typeof e?b.getCenter():e):c.position=b.getCenter(),g(c,"pov")&&(c.pov=h.extend({},f,c.pov)),g(c,"visible")&&d.setVisible(c.visible),d.setOptions(c),g(c,"event")&&this.bindEvents(d,c.event))},panto:function(b){var a={},d={},c=this.map;null!==c&&q!==c&&(a=p(b,!0),"string"===typeof a?(d=new google.maps.Geocoder,d.geocode({address:a}, function(a,b){b===google.maps.GeocoderStatus.OK?"function"===typeof c.panTo&&a.length&&c.panTo(a[0].geometry.location):console.error(b)})):"function"===typeof c.panTo&&c.panTo(a))},clear:function(b){for(var a="marker,circle,polygon,polyline,direction,kml",d="",c=0,f=0,a="string"===typeof b?b.split(","):h.isArray(b)?b:a.split(","),c=0;c<a.length;c+=1){d="_"+h.trim(a[c].toString().toLowerCase())+"s";if(q!==this[d]&&this[d].length){for(f=0;f<this[d].length;f+=1)this.map===this[d][f].getMap()&&(this[d][f].set("visible", !1),this[d][f].set("directions",null),this[d][f].setMap(null));this[d].length=0}if("direction"===a[c])for(f=0;f<this._directionsMarkers.length;f+=1)this._directionsMarkers[f].setMap(null)}},modify:function(b){var a=[],d=[["kml","kml"],["marker","markers"],["direction","direction"],["polyline","drawPolyline"],["polygon","drawPolygon"],["circle","drawCircle"],["streetView","streetView"]],c=0,f=this.map;if(q!==b){for(c=0;c<d.length;c+=1)g(b,d[c][0])&&a.push(d[c][1]);if(null!==f){if(a.length)for(c=0;c< a.length;c+=1)"function"===typeof this[a[c]]&&("streetView"===a[c]&&(b.streetViewObj=b.streetView,delete b.streetView),this[a[c]](f,b,"modify"));else f.setOptions(b);g(b,"event")&&this.bindEvents(f,b.event)}}},destroy:function(){var b=h(this.container);h.data(b.get(0),"tinyMap",null)},geoLocation:function(b,a){var d=navigator.geolocation;d&&!0===a.autoLocation&&d.getCurrentPosition(function(a){a&&g(a,"coords")&&b.panTo(new google.maps.LatLng(a.coords.latitude,a.coords.longitude))},function(a){console.error(a)}, {maximumAge:6E5,timeout:3E3,enableHighAccuracy:!1})},init:function(){var b=this,a={};"string"===typeof b.options.center?(a=new google.maps.Geocoder,a.geocode({address:b.options.center},function(a,c){try{c===google.maps.GeocoderStatus.OVER_QUERY_LIMIT?b.init():c===google.maps.GeocoderStatus.OK&&0!==a.length?q!==a[0]&&g(a[0],"geometry")&&(b.googleMapOptions.center=a[0].geometry.location,b.map=new google.maps.Map(b.container,b.googleMapOptions),google.maps.event.addListenerOnce(b.map,"idle",function(){b.overlay()}), b.bindEvents(b.map,b.options.event)):console.error(c)}catch(f){console.error(f)}})):(b.map=new google.maps.Map(b.container,b.googleMapOptions),google.maps.event.addListenerOnce(b.map,"idle",function(){b.overlay()}),b.bindEvents(b.map,b.options.event))}};h.fn.tinyMap=function(b){var a=arguments,d=[],c={};return"string"===typeof b?(this.each(function(){c=h.data(this,"tinyMap");c instanceof u&&"function"===typeof c[b]&&(d=c[b].apply(c,Array.prototype.slice.call(a,1)))}),q!==d?d:this):this.each(function(){h.data(this, "tinyMap")||h.data(this,"tinyMap",new u(this,b))})}})(jQuery,window,document);
DKMonster/Shoper
Lesson39/assets/js/plugin/jquery.tinyMap.min.js
JavaScript
mit
16,478
[ 30522, 1006, 3853, 1006, 1044, 1010, 1056, 1010, 1062, 1010, 1053, 1007, 1063, 3853, 1043, 1006, 1038, 1010, 1037, 1007, 1063, 3046, 1063, 2709, 1056, 1012, 2038, 12384, 21572, 4842, 3723, 1029, 1038, 1012, 2038, 12384, 21572, 4842, 3723, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/** * OWASP Benchmark Project v1.1 * * This file is part of the Open Web Application Security Project (OWASP) * Benchmark Project. For details, please see * <a href="https://www.owasp.org/index.php/Benchmark">https://www.owasp.org/index.php/Benchmark</a>. * * The Benchmark 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, version 2. * * The Benchmark 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 * * @author Nick Sanidas <a href="https://www.aspectsecurity.com">Aspect Security</a> * @created 2015 */ package org.owasp.benchmark.testcode; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @WebServlet("/BenchmarkTest17998") public class BenchmarkTest17998 extends HttpServlet { private static final long serialVersionUID = 1L; @Override public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doPost(request, response); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String param = ""; java.util.Enumeration<String> names = request.getParameterNames(); if (names.hasMoreElements()) { param = names.nextElement(); // just grab first element } String bar = doSomething(param); java.io.FileOutputStream fos = new java.io.FileOutputStream(new java.io.File(org.owasp.benchmark.helpers.Utils.testfileDir + bar),false); } // end doPost private static String doSomething(String param) throws ServletException, IOException { String bar = "safe!"; java.util.HashMap<String,Object> map37923 = new java.util.HashMap<String,Object>(); map37923.put("keyA-37923", "a_Value"); // put some stuff in the collection map37923.put("keyB-37923", param.toString()); // put it in a collection map37923.put("keyC", "another_Value"); // put some stuff in the collection bar = (String)map37923.get("keyB-37923"); // get it back out bar = (String)map37923.get("keyA-37923"); // get safe value back out return bar; } }
iammyr/Benchmark
src/main/java/org/owasp/benchmark/testcode/BenchmarkTest17998.java
Java
gpl-2.0
2,474
[ 30522, 1013, 1008, 1008, 1008, 27593, 3022, 2361, 6847, 10665, 2622, 1058, 2487, 1012, 1015, 1008, 1008, 2023, 5371, 2003, 2112, 1997, 1996, 2330, 4773, 4646, 3036, 2622, 1006, 27593, 3022, 2361, 1007, 1008, 6847, 10665, 2622, 1012, 2005, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#include <QtGlobal> // Automatically generated by extract_strings.py #ifdef __GNUC__ #define UNUSED __attribute__((unused)) #else #define UNUSED #endif static const char UNUSED *bitcoin_strings[] = {QT_TRANSLATE_NOOP("bitcoin-core", "To use the %s option"), QT_TRANSLATE_NOOP("bitcoin-core", "" "%s, you must set a rpcpassword in the configuration file:\n" "%s\n" "It is recommended you use the following random password:\n" "rpcuser=sphererpc\n" "rpcpassword=%s\n" "(you do not need to remember this password)\n" "The username and password MUST NOT be the same.\n" "If the file does not exist, create it with owner-readable-only file " "permissions.\n" "It is also recommended to set alertnotify so you are notified of problems;\n" "for example: alertnotify=echo %%s | mail -s \"Sphere Alert\" admin@foo." "com\n"), QT_TRANSLATE_NOOP("bitcoin-core", "" "An error occurred while setting up the RPC port %u for listening on IPv6, " "falling back to IPv4: %s"), QT_TRANSLATE_NOOP("bitcoin-core", "" "An error occurred while setting up the RPC port %u for listening on IPv4: %s"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: Please check that your computer's date and time are correct! If " "your clock is wrong Sphere will not work properly."), QT_TRANSLATE_NOOP("bitcoin-core", "Options:"), QT_TRANSLATE_NOOP("bitcoin-core", "This help message"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify configuration file (default: sphere.conf)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify pid file (default: sphered.pid)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify data directory"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify wallet file (within data directory)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set database cache size in megabytes (default: 25)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set database disk log size in megabytes (default: 100)"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify connection timeout in milliseconds (default: 5000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect through socks proxy"), QT_TRANSLATE_NOOP("bitcoin-core", "Select the version of socks proxy to use (4-5, default: 5)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use proxy to reach tor hidden services (default: same as -proxy)"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow DNS lookups for -addnode, -seednode and -connect"), QT_TRANSLATE_NOOP("bitcoin-core", "Listen for connections on <port> (default: 15714 or testnet: 25714)"), QT_TRANSLATE_NOOP("bitcoin-core", "Maintain at most <n> connections to peers (default: 125)"), QT_TRANSLATE_NOOP("bitcoin-core", "Add a node to connect to and attempt to keep the connection open"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect only to the specified node(s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Connect to a node to retrieve peer addresses, and disconnect"), QT_TRANSLATE_NOOP("bitcoin-core", "Specify your own public address"), QT_TRANSLATE_NOOP("bitcoin-core", "Only connect to nodes in network <net> (IPv4, IPv6 or Tor)"), QT_TRANSLATE_NOOP("bitcoin-core", "Discover own IP address (default: 1 when listening and no -externalip)"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept connections from outside (default: 1 if no -proxy or -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Bind to given address. Use [host]:port notation for IPv6"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Query for peer addresses via DNS lookup, if low on addresses (default: 1 " "unless -connect)"), QT_TRANSLATE_NOOP("bitcoin-core", "Always query for peer addresses via DNS lookup (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Sync time with other nodes. Disable if time on your system is precise e.g. " "syncing with NTP (default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Sync checkpoints policy (default: strict)"), QT_TRANSLATE_NOOP("bitcoin-core", "Threshold for disconnecting misbehaving peers (default: 100)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Number of seconds to keep misbehaving peers from reconnecting (default: " "86400)"), QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 1 when listening)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use UPnP to map the listening port (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Fee per KB to add to transactions you send"), QT_TRANSLATE_NOOP("bitcoin-core", "" "When creating transactions, ignore inputs with value less than this " "(default: 0.01)"), QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Output debugging information (default: 0, supplying <category> is optional)"), QT_TRANSLATE_NOOP("bitcoin-core", "If <category> is not supplied, output all debugging information."), QT_TRANSLATE_NOOP("bitcoin-core", "<category> can be:"), QT_TRANSLATE_NOOP("bitcoin-core", "Prepend debug output with timestamp"), QT_TRANSLATE_NOOP("bitcoin-core", "Shrink debug.log file on client startup (default: 1 when no -debug)"), QT_TRANSLATE_NOOP("bitcoin-core", "Send trace/debug info to console instead of debug.log file"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Enter regression test mode, which uses a special chain in which blocks can " "be solved instantly. This is intended for regression testing tools and app " "development."), QT_TRANSLATE_NOOP("bitcoin-core", "Username for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Password for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)"), QT_TRANSLATE_NOOP("bitcoin-core", "Allow JSON-RPC connections from specified IP address"), QT_TRANSLATE_NOOP("bitcoin-core", "Send commands to node running on <ip> (default: 127.0.0.1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Wait for RPC server to start"), QT_TRANSLATE_NOOP("bitcoin-core", "Set the number of threads to service RPC calls (default: 4)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when the best block changes (%s in cmd is replaced by block " "hash)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when a wallet transaction changes (%s in cmd is replaced by " "TxID)"), QT_TRANSLATE_NOOP("bitcoin-core", "Require a confirmations for change (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Minimize weight consumption (experimental) (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Execute command when a relevant alert is received (%s in cmd is replaced by " "message)"), QT_TRANSLATE_NOOP("bitcoin-core", "Upgrade wallet to latest format"), QT_TRANSLATE_NOOP("bitcoin-core", "Set key pool size to <n> (default: 100)"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescan the block chain for missing wallet transactions"), QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to recover private keys from a corrupt wallet.dat"), QT_TRANSLATE_NOOP("bitcoin-core", "How many blocks to check at startup (default: 500, 0 = all)"), QT_TRANSLATE_NOOP("bitcoin-core", "How thorough the block verification is (0-6, default: 1)"), QT_TRANSLATE_NOOP("bitcoin-core", "Imports blocks from external blk000?.dat file"), QT_TRANSLATE_NOOP("bitcoin-core", "Keep at most <n> unconnectable blocks in memory (default: %u)"), QT_TRANSLATE_NOOP("bitcoin-core", "Block creation options:"), QT_TRANSLATE_NOOP("bitcoin-core", "Set minimum block size in bytes (default: 0)"), QT_TRANSLATE_NOOP("bitcoin-core", "Set maximum block size in bytes (default: 250000)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Set maximum size of high-priority/low-fee transactions in bytes (default: " "27000)"), QT_TRANSLATE_NOOP("bitcoin-core", "SSL options: (see the Bitcoin Wiki for SSL setup instructions)"), QT_TRANSLATE_NOOP("bitcoin-core", "Use OpenSSL (https) for JSON-RPC connections"), QT_TRANSLATE_NOOP("bitcoin-core", "Server certificate file (default: server.cert)"), QT_TRANSLATE_NOOP("bitcoin-core", "Server private key (default: server.pem)"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!" "3DES:@STRENGTH)"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: Deprecated argument -debugnet ignored, use -debug=net"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -paytxfee=<amount>: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: -paytxfee is set very high! This is the transaction fee you will " "pay if you send a transaction."), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -mininput=<amount>: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Initialization sanity check failed. Sphere is shutting down."), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet %s resides outside data directory %s."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Cannot obtain a lock on data directory %s. Sphere is probably already " "running."), QT_TRANSLATE_NOOP("bitcoin-core", "Verifying database integrity..."), QT_TRANSLATE_NOOP("bitcoin-core", "Error initializing wallet database environment %s!"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as " "wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect " "you should restore from a backup."), QT_TRANSLATE_NOOP("bitcoin-core", "wallet.dat corrupt, salvage failed"), QT_TRANSLATE_NOOP("bitcoin-core", "Unknown -socks proxy version requested: %i"), QT_TRANSLATE_NOOP("bitcoin-core", "Unknown network specified in -onlynet: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -proxy address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid -tor address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -bind address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Failed to listen on any port. Use -listen=0 if you want this."), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot resolve -externalip address: '%s'"), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount for -reservebalance=<amount>"), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to sign checkpoint, wrong checkpointkey?\n"), QT_TRANSLATE_NOOP("bitcoin-core", "Loading block index..."), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading blkindex.dat"), QT_TRANSLATE_NOOP("bitcoin-core", "Loading wallet..."), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet corrupted"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Warning: error reading wallet.dat! All keys read correctly, but transaction " "data or address book entries might be missing or incorrect."), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat: Wallet requires newer version of Sphere"), QT_TRANSLATE_NOOP("bitcoin-core", "Wallet needed to be rewritten: restart Sphere to complete"), QT_TRANSLATE_NOOP("bitcoin-core", "Error loading wallet.dat"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot downgrade wallet"), QT_TRANSLATE_NOOP("bitcoin-core", "Cannot write default address"), QT_TRANSLATE_NOOP("bitcoin-core", "Rescanning..."), QT_TRANSLATE_NOOP("bitcoin-core", "Loading addresses..."), QT_TRANSLATE_NOOP("bitcoin-core", "Done loading"), QT_TRANSLATE_NOOP("bitcoin-core", "" "Unable to bind to %s on this computer. Sphere is probably already running."), QT_TRANSLATE_NOOP("bitcoin-core", "Unable to bind to %s on this computer (bind returned error %d, %s)"), QT_TRANSLATE_NOOP("bitcoin-core", "Sphere version"), QT_TRANSLATE_NOOP("bitcoin-core", "Usage:"), QT_TRANSLATE_NOOP("bitcoin-core", "Send command to -server or sphered"), QT_TRANSLATE_NOOP("bitcoin-core", "List commands"), QT_TRANSLATE_NOOP("bitcoin-core", "Get help for a command"), QT_TRANSLATE_NOOP("bitcoin-core", "" "You must set rpcpassword=<password> in the configuration file:\n" "%s\n" "If the file does not exist, create it with owner-readable-only file " "permissions."), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet locked, unable to create transaction!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Wallet unlocked for staking only, unable to create transaction."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: This transaction requires a transaction fee of at least %s because of " "its amount, complexity, or use of recently received funds!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Transaction creation failed!"), QT_TRANSLATE_NOOP("bitcoin-core", "Sending..."), QT_TRANSLATE_NOOP("bitcoin-core", "" "Error: The transaction was rejected! This might happen if some of the coins " "in your wallet were already spent, such as if you used a copy of wallet.dat " "and coins were spent in the copy but not marked as spent here."), QT_TRANSLATE_NOOP("bitcoin-core", "Invalid amount"), QT_TRANSLATE_NOOP("bitcoin-core", "Insufficient funds"), QT_TRANSLATE_NOOP("bitcoin-core", "Error"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning"), QT_TRANSLATE_NOOP("bitcoin-core", "Information"), QT_TRANSLATE_NOOP("bitcoin-core", "Warning: This version is obsolete, upgrade required!"), QT_TRANSLATE_NOOP("bitcoin-core", "WARNING: syncronized checkpoint violation detected, but skipped!"), QT_TRANSLATE_NOOP("bitcoin-core", "Error: Disk space is low!"), QT_TRANSLATE_NOOP("bitcoin-core", "" "This is a pre-release test build - use at your own risk - do not use for " "mining or merchant applications"), QT_TRANSLATE_NOOP("bitcoin-core", "" "WARNING: Invalid checkpoint found! Displayed transactions may not be " "correct! You may need to upgrade, or notify developers."), };
SphereDevs/sphere
src/qt/bitcoinstrings.cpp
C++
mit
13,463
[ 30522, 1001, 2421, 1026, 1053, 2102, 23296, 16429, 2389, 1028, 1013, 1013, 8073, 7013, 2011, 14817, 1035, 7817, 1012, 1052, 2100, 1001, 2065, 3207, 2546, 1035, 1035, 27004, 2278, 1035, 1035, 1001, 9375, 15171, 1035, 1035, 17961, 1035, 1035,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
#ifndef BOX_H #define BOX_H class MyBox: public Gtk::Frame { public: MyBox(const Glib::ustring& label, Gtk::Orientation orientation); void pack_start(Widget& child); private: Gtk::Box* p_child; }; #endif
blablack/ams-lv2
src/my_box.hpp
C++
gpl-2.0
215
[ 30522, 1001, 2065, 13629, 2546, 3482, 1035, 1044, 1001, 9375, 3482, 1035, 1044, 2465, 2026, 8758, 1024, 2270, 14181, 2243, 1024, 1024, 4853, 1063, 2270, 1024, 2026, 8758, 1006, 9530, 3367, 1043, 29521, 1024, 1024, 2149, 18886, 3070, 1004, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
% This file was created by matplotlib2tikz v0.5.4. \begin{tikzpicture} \definecolor{color1}{rgb}{0.105882352941176,0.619607843137255,0.466666666666667} \definecolor{color0}{rgb}{0.917647058823529,0.917647058823529,0.949019607843137} \definecolor{color3}{rgb}{0.589542483660131,0.416993464052288,0.470588235294118} \definecolor{color2}{rgb}{0.719492502883506,0.416147635524798,0.0888119953863898} \definecolor{color5}{rgb}{0.488581314878893,0.654440599769319,0.0982698961937716} \definecolor{color4}{rgb}{0.686735870818916,0.297270280661284,0.61999231064975} \begin{groupplot}[group style={group size=2 by 1}] \nextgroupplot[ xlabel={Simulated Time (mins)}, ylabel={Weighted Trust Value}, xmin=0, xmax=60, ymin=0, ymax=1, ytick={0,0.2,0.4,0.6,0.8,1}, yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$}, tick align=outside, xmajorgrids, x grid style={white!50.196078431372548!black}, ymajorgrids, y grid style={white!50.196078431372548!black}, axis line style={white!50.196078431372548!black}, axis background/.style={fill=color0}, legend style={draw=none, fill=color0}, legend cell align={left}, legend entries={{Alfa},{Bravo},{Charlie},{Delta},{Foxtrot}} ] \addplot [color1, opacity=1.0] table {% 0 0.0125002038909408 1 0.00527200267331962 2 0.00681030344076572 3 0.00664477742349414 4 0.00675893579882363 5 0.0078538500552314 6 0.00720841214498036 7 0.00939383924335654 8 0.00666268350853456 9 0.00470772117411916 10 0.00357083777582587 11 0.00253444573848451 12 0.00184974538684676 13 0.00221551585361679 14 0.00511126473800476 15 0.00384417586565259 16 0.00283018776027119 17 0.00210873860785566 18 0.00208427396108148 19 0.00149060785237468 20 0.00143882323377911 21 0.00295051277526618 22 0.00478215453648711 23 0.00712608782987201 24 0.00572083147861958 25 0.00474547715044909 26 0.00430264546986893 27 0.00353230492319315 28 0.00272175270056931 29 0.00264819975187464 30 0.00360529692690712 31 0.00338733711399014 32 0.00438586981649223 33 0.00764695924520927 34 0.00807326724237412 35 0.00579562952252093 36 0.00445075734809603 37 0.00748778156806246 38 0.0120739692465823 39 0.00950499314136257 40 0.00973987889904748 41 0.00827844743288885 42 0.00824588366421593 43 0.00707177262312626 44 0.00696084399720556 45 0.00505277818613503 46 0.00360912708017663 47 0.00304192397065198 48 0.00465678495741834 49 0.00614182635712587 50 0.00813403588869609 51 0.00870110108577226 52 0.00705451803672229 53 0.00582931632807006 54 0.00491183643786497 55 0.00361814617512686 56 0.00270777280478591 57 0.00203670812492362 58 0.00185195702222899 }; \addplot [color2, opacity=0.6] table {% 0 0.997520714447643 1 0.989147399156741 2 0.991842546331735 3 0.993893688328231 4 0.990359628982694 5 0.987858570424327 6 0.989807293660413 7 0.992509599446419 8 0.994447343021085 9 0.99480138954904 10 0.994055369510031 11 0.995661583562809 12 0.996896263895927 13 0.996260509267278 14 0.996680348698443 15 0.992595362509065 16 0.99268255896602 17 0.989066372294762 18 0.9921624885912 19 0.993944642882778 20 0.994542227126868 21 0.995759207315465 22 0.996308055264106 23 0.997276118503774 24 0.995798824468467 25 0.995498631526975 26 0.995940587501175 27 0.99694329229726 28 0.997040616115768 29 0.995070103529447 30 0.995114510676447 31 0.996304909321563 32 0.997257216322027 33 0.996832649384371 34 0.994353238865751 35 0.990012971071513 36 0.992434581672229 37 0.994443138766456 38 0.994867087034094 39 0.994416159263495 40 0.993284630558802 41 0.992709903575573 42 0.989244224315088 43 0.988413769076871 44 0.988624402917485 45 0.987288889153946 46 0.990812296004809 47 0.992892170315959 48 0.994806699367431 49 0.99277061221575 50 0.994380661051633 51 0.994138512042183 52 0.995127026592716 53 0.991918435424153 54 0.993203682996196 55 0.990446432155269 56 0.988075496108058 57 0.991293894006291 58 0.990102963149938 }; \addplot [color3, opacity=0.6] table {% 0 0.997510872011716 1 0.995500978265104 2 0.995810867657176 3 0.992876497254151 4 0.995307859204462 5 0.992929971215901 6 0.991978017938017 7 0.988341181442763 8 0.990460480813911 9 0.987996339166129 10 0.988287185692659 11 0.989130773735098 12 0.99218608106891 13 0.993678822801395 14 0.993094504737042 15 0.993857962667325 16 0.992721976282811 17 0.994806270391547 18 0.99288733029235 19 0.994108851977471 20 0.995792848692566 21 0.989073743988913 22 0.988053522341795 23 0.981130066472544 24 0.985888344453484 25 0.985133759890571 26 0.989308747199038 27 0.989193011964101 28 0.992162273892696 29 0.993979683773306 30 0.994819065833901 31 0.995115400863424 32 0.994923501538589 33 0.994113550742809 34 0.993543900697808 35 0.993852331894948 36 0.991432976344777 37 0.993631920177783 38 0.992103496188706 39 0.99414763470966 40 0.992944424311431 41 0.991767071662632 42 0.993376745439441 43 0.995265097496475 44 0.996522082826831 45 0.996831734499044 46 0.994019231648615 47 0.995446274996787 48 0.994164742406063 49 0.991955459055322 50 0.99320495876354 51 0.992139176999512 52 0.99150973671785 53 0.99274255119445 54 0.994696238480618 55 0.996191968195953 56 0.993820625286215 57 0.993919926067501 58 0.993558406593986 }; \addplot [color4, opacity=0.6] table {% 0 0.994368890261067 1 0.997428599529676 2 0.997666430753615 3 0.992848770181107 4 0.994721774656983 5 0.995987109164266 6 0.996010096788851 7 0.996058169671334 8 0.994705992085708 9 0.995423322053326 10 0.996753947386416 11 0.997056667325356 12 0.995484517173688 13 0.992074292415898 14 0.993554448227724 15 0.993457739557679 16 0.995278318706511 17 0.996568116381291 18 0.996543866310693 19 0.997499861665595 20 0.99476686476451 21 0.996210578368394 22 0.997205177599686 23 0.997807991254245 24 0.995285102399401 25 0.994872455191744 26 0.988058744005114 27 0.990590003367608 28 0.991967084176781 29 0.993931174151483 30 0.994270522795108 31 0.993514361952346 32 0.994123532428121 33 0.991605026353586 34 0.992965965335886 35 0.993637470277798 36 0.995391350652526 37 0.995374169149845 38 0.995025552811774 39 0.995109145061328 40 0.995062409759852 41 0.995239757728935 42 0.996384371969937 43 0.992857178938409 44 0.986530841987764 45 0.988559498381072 46 0.991648031487715 47 0.992393420982436 48 0.992328696756846 49 0.993204243504062 50 0.991263219139196 51 0.990891704589565 52 0.991163580580813 53 0.993225328191427 54 0.991654805326254 55 0.993691332355344 56 0.993631819087323 57 0.992648406290856 58 0.990241051054801 }; \addplot [color5, opacity=0.6] table {% 0 0.968745461259184 1 0.983128835540073 2 0.988637254191113 3 0.992555902210509 4 0.994722578056935 5 0.996459595834325 6 0.993437426266127 7 0.989320778536321 8 0.991065487423764 9 0.993322071505995 10 0.994724389013108 11 0.995665074083171 12 0.994035488228041 13 0.990635194083987 14 0.987330567798596 15 0.990540146331357 16 0.988268732843171 17 0.990884629003234 18 0.991320041475646 19 0.990248909717607 20 0.992343096787311 21 0.994002653054385 22 0.995299274036623 23 0.996614246982531 24 0.994178071402039 25 0.995794634868914 26 0.993988913302846 27 0.991150711890981 28 0.990376429599406 29 0.992740550049195 30 0.991510419155647 31 0.990292963440093 32 0.992103044598124 33 0.993478599301847 34 0.992730700677668 35 0.994807654738901 36 0.994928410378973 37 0.989601454746933 38 0.989074690119872 39 0.991537544206694 40 0.990764868182512 41 0.992875304237403 42 0.993818161859743 43 0.994864107496286 44 0.995580583983569 45 0.99630222819982 46 0.997336608176411 47 0.996556266839566 48 0.997341991454934 49 0.996759239321599 50 0.996433547460196 51 0.997380249924662 52 0.998093100867928 53 0.998502627444369 54 0.998848201933322 55 0.998582313737688 56 0.998362474785561 57 0.996768383974728 58 0.997691702841298 }; \path [draw=white, fill opacity=0] (axis cs:0,1) --(axis cs:60,1); \path [draw=white, fill opacity=0] (axis cs:1,0) --(axis cs:1,1); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:60,0); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:0,1); \nextgroupplot[ xmin=0.5, xmax=5.5, ymin=0, ymax=1, xtick={1,2,3,4,5}, xticklabels={Alfa,Bravo,Charlie,Delta,Foxtrot}, ytick={0,0.2,0.4,0.6,0.8,1}, yticklabels={$0.0$,$0.2$,$0.4$,$0.6$,$0.8$,$1.0$}, tick align=outside, xmajorgrids, x grid style={white!50.196078431372548!black}, ymajorgrids, y grid style={white!50.196078431372548!black}, axis line style={white!50.196078431372548!black}, axis background/.style={fill=color0}, legend style={draw=none, fill=color0}, legend cell align={left}, legend entries={{Alfa},{Bravo},{Charlie},{Delta},{Foxtrot}} ] \addplot [color1, opacity=1] table {% 0.75 0.00321463054232106 1.25 0.00321463054232106 1.25 0.00709893022649914 0.75 0.00709893022649914 0.75 0.00321463054232106 }; \addplot [blue, opacity=1, dashed] table {% 1 0.00321463054232106 1 0.00143882323377911 }; \addplot [blue, opacity=1, dashed] table {% 1 0.00709893022649914 1 0.0125002038909408 }; \addplot [black] table {% 0.875 0.00143882323377911 1.125 0.00143882323377911 }; \addplot [black] table {% 0.875 0.0125002038909408 1.125 0.0125002038909408 }; \addplot [red, opacity=1] table {% 0.75 0.00491183643786497 1.25 0.00491183643786497 }; \addplot [blue, opacity=0.8] table {% 0.75 0.00534708191503965 1.25 0.00534708191503965 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color2, opacity=1] table {% 1.75 0.991568220169013 2.25 0.991568220169013 2.25 0.995580107544892 1.75 0.995580107544892 1.75 0.991568220169013 }; \addplot [blue, opacity=1, dashed] table {% 2 0.991568220169013 2 0.987288889153946 }; \addplot [blue, opacity=1, dashed] table {% 2 0.995580107544892 2 0.997520714447643 }; \addplot [black] table {% 1.875 0.987288889153946 2.125 0.987288889153946 }; \addplot [black] table {% 1.875 0.997520714447643 2.125 0.997520714447643 }; \addplot [red, opacity=1] table {% 1.75 0.994055369510031 2.25 0.994055369510031 }; \addplot [blue, opacity=0.8] table {% 1.75 0.993354957636984 2.25 0.993354957636984 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% }; \addplot [color3, opacity=1] table {% 2.75 0.991861265358977 3.25 0.991861265358977 3.25 0.994430490443341 2.75 0.994430490443341 2.75 0.991861265358977 }; \addplot [blue, opacity=1, dashed] table {% 3 0.991861265358977 3 0.988053522341795 }; \addplot [blue, opacity=1, dashed] table {% 3 0.994430490443341 3 0.997510872011716 }; \addplot [black] table {% 2.875 0.988053522341795 3.125 0.988053522341795 }; \addplot [black] table {% 2.875 0.997510872011716 3.125 0.997510872011716 }; \addplot [red, opacity=1] table {% 2.75 0.993376745439441 3.25 0.993376745439441 }; \addplot [blue, opacity=0.8] table {% 2.75 0.992626255235926 3.25 0.992626255235926 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% 3 0.987996339166129 3 0.981130066472544 3 0.985888344453484 3 0.985133759890571 }; \addplot [color4, opacity=1] table {% 3.75 0.992520913636646 4.25 0.992520913636646 4.25 0.995453919613507 3.75 0.995453919613507 3.75 0.992520913636646 }; \addplot [blue, opacity=1, dashed] table {% 4 0.992520913636646 4 0.988559498381072 }; \addplot [blue, opacity=1, dashed] table {% 4 0.995453919613507 4 0.997807991254245 }; \addplot [black] table {% 3.875 0.988559498381072 4.125 0.988559498381072 }; \addplot [black] table {% 3.875 0.997807991254245 4.125 0.997807991254245 }; \addplot [red, opacity=1] table {% 3.75 0.994270522795108 4.25 0.994270522795108 }; \addplot [blue, opacity=0.8] table {% 3.75 0.993963100008588 4.25 0.993963100008588 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% 4 0.988058744005114 4 0.986530841987764 }; \addplot [color5, opacity=1] table {% 4.75 0.990975058213499 5.25 0.990975058213499 5.25 0.996367887830008 4.75 0.996367887830008 4.75 0.990975058213499 }; \addplot [blue, opacity=1, dashed] table {% 5 0.990975058213499 5 0.983128835540073 }; \addplot [blue, opacity=1, dashed] table {% 5 0.996367887830008 5 0.998848201933322 }; \addplot [black] table {% 4.875 0.983128835540073 5.125 0.983128835540073 }; \addplot [black] table {% 4.875 0.998848201933322 5.125 0.998848201933322 }; \addplot [red, opacity=1] table {% 4.75 0.993818161859743 5.25 0.993818161859743 }; \addplot [blue, opacity=0.8] table {% 4.75 0.993126518465472 5.25 0.993126518465472 }; \addplot [blue, mark=+, mark size=3, mark options={draw=black}, only marks] table {% 5 0.968745461259184 }; \path [draw=white, fill opacity=0] (axis cs:0.5,1) --(axis cs:5.5,1); \path [draw=white, fill opacity=0] (axis cs:1,0) --(axis cs:1,1); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0.5,0) --(axis cs:5.5,0); \path [draw=white!50.196078431372548!black, fill opacity=0] (axis cs:0,0) --(axis cs:0,1); \end{groupplot} \end{tikzpicture}
andrewbolster/thesis
Figures/best_arxp_atxp_rxthroughput_indd_inhd_only_feats_signed_run_time_MPC.tex
TeX
epl-1.0
12,739
[ 30522, 1003, 2023, 5371, 2001, 2580, 2011, 13523, 24759, 4140, 29521, 2475, 3775, 2243, 2480, 1058, 2692, 1012, 1019, 1012, 1018, 1012, 1032, 4088, 1063, 14841, 2243, 2480, 24330, 11244, 1065, 1032, 9375, 18717, 1063, 3609, 2487, 1065, 1063...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
/* Copyright 2016, 2017 Institut National de la Recherche Agronomique 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 fr.inra.maiage.bibliome.util.pattern.tabular.expression; import java.util.List; import java.util.regex.Pattern; import fr.inra.maiage.bibliome.util.pattern.tabular.TabularContext; public class DefaultMatchRegexp extends AbstractBooleanExpression { private final Pattern pattern; public DefaultMatchRegexp(Pattern pattern) { super(); this.pattern = pattern; } @Override public boolean getBoolean(TabularContext context, List<String> columns) { return context.getConstantFilter().acceptRegex(columns, pattern); } }
Bibliome/bibliome-java-utils
src/main/java/fr/inra/maiage/bibliome/util/pattern/tabular/expression/DefaultMatchRegexp.java
Java
apache-2.0
1,141
[ 30522, 1013, 1008, 9385, 2355, 1010, 2418, 17126, 2120, 2139, 2474, 28667, 5886, 5403, 12943, 4948, 20936, 4226, 7000, 2104, 1996, 15895, 6105, 1010, 2544, 1016, 1012, 1014, 1006, 1996, 1000, 6105, 1000, 1007, 1025, 2017, 2089, 2025, 2224, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
require 'float_extensions' module Dune::Balanced::Creditcard class TransactionFeeCalculatorBase using FloatExtensions attr_writer :transaction_value def initialize(transaction_value) @transaction_value = transaction_value end def transaction_value @transaction_value.to_f.floor_with_two_decimal_places end def gross_amount net_amount + fees end def net_amount raise NotImplementedError end # Base calculation of fees # 2.9% + 30¢ def fees (net_amount * 0.029 + 0.3).ceil_with_two_decimal_places end end end
FromUte/dune-balanced-creditcard
app/models/dune/balanced/creditcard/transaction_fee_calculator_base.rb
Ruby
mit
605
[ 30522, 5478, 1005, 14257, 1035, 14305, 1005, 11336, 21643, 1024, 1024, 12042, 1024, 1024, 4923, 11522, 2465, 12598, 7959, 19281, 15472, 20350, 15058, 2478, 14257, 10288, 29048, 2015, 2012, 16344, 1035, 3213, 1024, 12598, 1035, 3643, 13366, 39...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...