text
stringlengths 3
181k
| src
stringlengths 5
1.02k
|
---|---|
//海葵
var aneObj = function()
{
//star point, control point, end point(sin);
this.rootx = [];
this.headx = [];
this.heady = [];
this.amp = [];
this.alpha = 0;
}
aneObj.prototype.num = 50;
aneObj.prototype.init = function()
{
for(var i = 0;i < this.num;i++){
this.rootx[i] = i * 16 + Math.random() * 20;
this.headx[i] = this.rootx[i];
this.heady[i] = canHeight - 250 + Math.random() *50;
this.amp[i] = Math.random()*50 + 50;
}
}
aneObj.prototype.draw = function()
{
this.alpha += deltaTime * 0.0008;
var l = Math.sin(this.alpha);
ctx2.save();
ctx2.globalAlpha = 0.6;
ctx2.lineWidth = 20;
ctx2.lineCap = "round";
ctx2.strokeStyle = "#3b154e";
for(var i = 0;i < this.num;i++){
//beginPath, moveTo, lineTo, seroke, strokeStyle, lineWidth, lineCapglobalAlpha
ctx2.beginPath();
ctx2.moveTo(this.rootx[i], canHeight);
this.headx[i] = this.rootx[i] + l*this.amp[i];
ctx2.quadraticCurveTo(this.rootx[i], canHeight-100, this.headx[i], this.heady[i]);
ctx2.stroke();
}
ctx2.restore();
} | wdfbst/H5-canvas-lovefish-js/ane.js |
/**
* editor_plugin_src.js
*
* Copyright 2009, Moxiecode Systems AB
* Released under LGPL License.
*
* License: http://tinymce.moxiecode.com/license
* Contributing: http://tinymce.moxiecode.com/contributing
*/
(function() {
tinymce.create('tinymce.plugins.WordCount', {
block : 0,
id : null,
countre : null,
cleanre : null,
init : function(ed, url) {
var t = this, last = 0;
t.countre = ed.getParam('wordcount_countregex', /[\w\u2019\'-]+/g); // u2019 == ’
t.cleanre = ed.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\'\"_+=\\\/-]*/g);
t.id = ed.id + '-word-count';
ed.onPostRender.add(function(ed, cm) {
var row, id;
// Add it to the specified id or the theme advanced path
id = ed.getParam('wordcount_target_id');
if (!id) {
row = tinymce.DOM.get(ed.id + '_path_row');
if (row)
tinymce.DOM.add(row.parentNode, 'div', {'style': 'float: right'}, ed.getLang('wordcount.words', 'Words: ') + '<span id="' + t.id + '">0</span>');
} else {
tinymce.DOM.add(id, 'span', {}, '<span id="' + t.id + '">0</span>');
}
});
ed.onInit.add(function(ed) {
ed.selection.onSetContent.add(function() {
t._count(ed);
});
t._count(ed);
});
ed.onSetContent.add(function(ed) {
t._count(ed);
});
ed.onKeyUp.add(function(ed, e) {
if (e.keyCode == last)
return;
if (13 == e.keyCode || 8 == last || 46 == last)
t._count(ed);
last = e.keyCode;
});
},
_getCount : function(ed) {
var tc = 0;
var tx = ed.getContent({ format: 'raw' });
if (tx) {
tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces
tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars
// deal with html entities
tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' ');
tx = tx.replace(this.cleanre, ''); // remove numbers and punctuation
var wordArray = tx.match(this.countre);
if (wordArray) {
tc = wordArray.length;
}
}
return tc;
},
_count : function(ed) {
var t = this;
// Keep multiple calls from happening at the same time
if (t.block)
return;
t.block = 1;
setTimeout(function() {
var tc = t._getCount(ed);
tinymce.DOM.setHTML(t.id, tc.toString());
setTimeout(function() {t.block = 0;}, 2000);
}, 1);
},
getInfo: function() {
return {
longname : 'Word Count plugin',
author : 'Moxiecode Systems AB',
authorurl : 'http://tinymce.moxiecode.com',
infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/wordcount',
version : tinymce.majorVersion + "." + tinymce.minorVersion
};
}
});
tinymce.PluginManager.add('wordcount', tinymce.plugins.WordCount);
})();
| jewsroch/sf-photos-zp-core/zp-extensions/tiny_mce/plugins/wordcount/editor_plugin_src.js |
// { dg-lto-do link }
// { dg-lto-options {{-fPIC -fwhopr -O2}} }
// { dg-extra-ld-options "-O2 -fPIC -fwhopr -r -nostdlib" }
typedef long int ptrdiff_t;
extern "C"
{
typedef struct
{
}
__mbstate_t;
namespace std
{
class exception
{
};
}
}
namespace std __attribute__ ((__visibility__ ("default")))
{
template < typename _Alloc > class allocator;
template < class _CharT > struct char_traits;
}
typedef __mbstate_t mbstate_t;
namespace std __attribute__ ((__visibility__ ("default")))
{
using::mbstate_t;
typedef ptrdiff_t streamsize;
template < typename _CharT, typename _Traits =
char_traits < _CharT > >class basic_istream;
template < typename _CharT, typename _Traits =
char_traits < _CharT >, typename _Alloc =
allocator < _CharT > >class basic_stringbuf;
class ios_base
{
public:class failure:public exception
{
};
virtual ~ ios_base ();
};
template < typename _CharT, typename _Traits > class basic_streambuf
{
};
template < typename _CharT, typename _Traits > class basic_ios:public
ios_base
{
};
template < typename _CharT, typename _Traits > class basic_istream:virtual public basic_ios < _CharT,
_Traits
>
{
typedef basic_streambuf < _CharT, _Traits > __streambuf_type;
protected:streamsize _M_gcount;
public: explicit basic_istream (__streambuf_type * __sb):_M_gcount (streamsize
(0))
{
}
};
template < typename _CharT, typename _Traits, typename _Alloc > class basic_stringbuf:public basic_streambuf < _CharT,
_Traits
>
{
};
template < typename V, typename I, typename S = std::mbstate_t > struct character
{
};
typedef character < unsigned short, unsigned int >pod_ushort;
typedef basic_stringbuf < pod_ushort > stringbuf_type;
typedef basic_istream < pod_ushort > istream_type;
stringbuf_type strbuf01;
istream_type stream (&strbuf01);
}
| ccompiler4pic32/pic32-gcc-gcc/testsuite/g++.dg/lto/20081219_0.C |
'use strict';
var moment = require('moment');
function load() {
var url = location.pathname.substring(1).split('/');
// Bounce if this isnt a pull request.
if (url[2] !== 'issues') return;
// Parse the issue contents for the first table in the comment body
// and push the outcome into a `travel` array.
var comment = document.querySelector('.timeline-comment-wrapper');
if (!comment) return;
var travelTimeline = comment.querySelector('.comment-body table');
if (!travelTimeline) return; // Bounce if a table does not exist.
// Sniff the table a little more to make sure this is a final travel ticket
var travelHeader = travelTimeline.querySelectorAll('th');
if (travelHeader.length < 5 && travelHeader[0].textContent.toLowerCase() !== 'name') return;
// Add a new Column to the table with a headline
var actionHeader = document.getElementById('travel-to-calendar-header');
if (!actionHeader) {
var travelTimeHeadline = travelTimeline.querySelector('thead tr');
var th = document.createElement('th');
th.textContent = 'Actions';
th.id = 'travel-to-calendar-header';
travelTimeHeadline.appendChild(th);
}
var travelTimelineRows = travelTimeline.querySelectorAll('tbody tr');
Array.prototype.forEach.call(travelTimelineRows, function(row, i) {
var travel = [];
var contents = row.querySelectorAll('td');
Array.prototype.forEach.call(contents, function(item) {
travel.push(item.textContent);
});
var from = moment(travel[1], 'MM/DD/YY').format('YYYYMMDD');
var to = moment(travel[2], 'MM/DD/YY').format('YYYYMMDD');
// Compile the link based on results in the travel array.
var href = 'https://calendar.google.com/calendar/render?';
href += 'action=TEMPLATE';
href += '&src=' + process.env.GOOGLE_CALENDAR_ID;
href += '&text=' + encodeURIComponent(travel[0]) + ' in ' + encodeURIComponent(travel[3]);
href += '&dates=' + from + 'T000000Z/' + to + 'T000000Z';
href += '&details=' + encodeURIComponent(travel[4]);
href += '&location=' + encodeURIComponent(travel[3]);
var action = document.getElementById('travel-to-calendar-' + i);
if (!action) {
var saveToAction = document.createElement('a');
saveToAction.id = 'travel-to-calendar-' + i;
saveToAction.textContent = 'Add to calendar';
saveToAction.className = 'btn btn-sm';
saveToAction.target = '_blank';
saveToAction.ref = 'nofollow';
saveToAction.href = href;
// Store a version so its not dupicated on refreshes
action = saveToAction.firstChild;
var td = document.createElement('td');
td.appendChild(saveToAction);
row.appendChild(td);
}
});
}
document.addEventListener('DOMSubtreeModified', load);
load();
| mapbox/travel-to-calendar-index.js |
package com.puppycrawl.tools.checkstyle.checks.modifier;
public class InputFinalInAnonymousClass {
public static abstract class Example {
public abstract void innerTest();
public final void test() {
}
}
public static void test() {
new Example() {
@Override
public final void innerTest() { // violation
}
};
}
}
| HubSpot/checkstyle-src/test/resources/com/puppycrawl/tools/checkstyle/checks/modifier/InputFinalInAnonymousClass.java |
// Copyright 2009 the Sputnik authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
info: |
The call method takes one or more arguments, thisArg and (optionally) arg1, arg2 etc, and performs
a function call using the [[Call]] property of the object
es5id: 15.3.4.4_A6_T5
description: >
Argunemts of call function is (null, arguments,"",2), inside
function declaration used
---*/
function FACTORY() {
Function("a1,a2,a3", "this.shifted=a1.length+a2+a3;").call(null, arguments, "", 2);
}
var obj = new FACTORY("", 1, 2, "A");
//CHECK#1
if (this["shifted"] !== "42") {
$ERROR('#1: The call method takes one or more arguments, thisArg and (optionally) arg1, arg2 etc, and performs a function call using the [[Call]] property of the object');
}
//CHECK#2
if (typeof obj.shifted !== "undefined") {
$ERROR('#2: The call method takes one or more arguments, thisArg and (optionally) arg1, arg2 etc, and performs a function call using the [[Call]] property of the object');
}
| sebastienros/jint-Jint.Tests.Test262/test/built-ins/Function/prototype/call/S15.3.4.4_A6_T5.js |
/*
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop 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.
It 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.
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
*/
#pragma once
class ClickHandler;
using ClickHandlerPtr = QSharedPointer<ClickHandler>;
class ClickHandlerHost {
protected:
virtual void clickHandlerActiveChanged(const ClickHandlerPtr &action, bool active) {
}
virtual void clickHandlerPressedChanged(const ClickHandlerPtr &action, bool pressed) {
}
virtual ~ClickHandlerHost() = 0;
friend class ClickHandler;
};
class ClickHandler {
public:
virtual void onClick(Qt::MouseButton) const = 0;
virtual QString tooltip() const {
return QString();
}
virtual void copyToClipboard() const {
}
virtual QString copyToClipboardContextItem() const {
return QString();
}
virtual QString text() const {
return QString();
}
virtual QString dragText() const {
return text();
}
virtual ~ClickHandler() {
}
// this method should be called on mouse over a click handler
// it returns true if something was changed or false otherwise
static bool setActive(const ClickHandlerPtr &p, ClickHandlerHost *host = nullptr);
// this method should be called when mouse leaves the host
// it returns true if something was changed or false otherwise
static bool clearActive(ClickHandlerHost *host = nullptr) {
if (host && _activeHost != host) {
return false;
}
return setActive(ClickHandlerPtr(), host);
}
// this method should be called on mouse pressed
static void pressed() {
unpressed();
if (!_active || !*_active) {
return;
}
_pressed.makeIfNull();
*_pressed = *_active;
if ((_pressedHost = _activeHost)) {
_pressedHost->clickHandlerPressedChanged(*_pressed, true);
}
}
// this method should be called on mouse released
// the activated click handler is returned
static ClickHandlerPtr unpressed() {
if (_pressed && *_pressed) {
bool activated = (_active && *_active == *_pressed);
ClickHandlerPtr waspressed = *_pressed;
(*_pressed).clear();
if (_pressedHost) {
_pressedHost->clickHandlerPressedChanged(waspressed, false);
_pressedHost = nullptr;
}
if (activated) {
return *_active;
} else if (_active && *_active && _activeHost) {
// emit clickHandlerActiveChanged for current active
// click handler, which we didn't emit while we has
// a pressed click handler
_activeHost->clickHandlerActiveChanged(*_active, true);
}
}
return ClickHandlerPtr();
}
static ClickHandlerPtr getActive() {
return _active ? *_active : ClickHandlerPtr();
}
static ClickHandlerPtr getPressed() {
return _pressed ? *_pressed : ClickHandlerPtr();
}
static bool showAsActive(const ClickHandlerPtr &p) {
if (!p || !_active || p != *_active) {
return false;
}
return !_pressed || !*_pressed || (p == *_pressed);
}
static bool showAsPressed(const ClickHandlerPtr &p) {
if (!p || !_active || p != *_active) {
return false;
}
return _pressed && (p == *_pressed);
}
static void hostDestroyed(ClickHandlerHost *host) {
if (_activeHost == host) {
_activeHost = nullptr;
}
if (_pressedHost == host) {
_pressedHost = nullptr;
}
}
private:
static NeverFreedPointer<ClickHandlerPtr> _active;
static NeverFreedPointer<ClickHandlerPtr> _pressed;
static ClickHandlerHost *_activeHost;
static ClickHandlerHost *_pressedHost;
};
class LeftButtonClickHandler : public ClickHandler {
public:
void onClick(Qt::MouseButton button) const override final {
if (button != Qt::LeftButton) return;
onClickImpl();
}
protected:
virtual void onClickImpl() const = 0;
};
| alex2304/tg_client_study-Telegram/SourceFiles/core/click_handler.h |
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "ndnboost/mpl/minus.hpp" header
// -- DO NOT modify by hand!
namespace ndnboost { namespace mpl {
template<
typename Tag1
, typename Tag2
, NDNBOOST_MPL_AUX_NTTP_DECL(int, tag1_) = NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
, NDNBOOST_MPL_AUX_NTTP_DECL(int, tag2_) = NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
>
struct minus_impl
: if_c<
( tag1_ > tag2_ )
, aux::cast2nd_impl< minus_impl< Tag1,Tag1 >,Tag1, Tag2 >
, aux::cast1st_impl< minus_impl< Tag2,Tag2 >,Tag1, Tag2 >
>::type
{
};
/// for Digital Mars C++/compilers with no CTPS/TTP support
template<> struct minus_impl< na,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
NDNBOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct minus_impl< na,integral_c_tag >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
NDNBOOST_STATIC_CONSTANT(int, value = 0);
};
};
template<> struct minus_impl< integral_c_tag,na >
{
template< typename U1, typename U2 > struct apply
{
typedef apply type;
NDNBOOST_STATIC_CONSTANT(int, value = 0);
};
};
template< typename T > struct minus_tag
: tag< T,na >
{
};
/// forward declaration
template<
typename NDNBOOST_MPL_AUX_NA_PARAM(N1)
, typename NDNBOOST_MPL_AUX_NA_PARAM(N2)
>
struct minus2;
template<
typename NDNBOOST_MPL_AUX_NA_PARAM(N1)
, typename NDNBOOST_MPL_AUX_NA_PARAM(N2)
, typename N3 = na, typename N4 = na, typename N5 = na
>
struct minus
: aux::msvc_eti_base< typename if_<
is_na<N3>
, minus2< N1,N2 >
, minus<
minus2< N1,N2 >
, N3, N4, N5
>
>::type
>
{
NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(
5
, minus
, ( N1, N2, N3, N4, N5 )
)
};
template<
typename N1
, typename N2
>
struct minus2
: aux::msvc_eti_base< typename apply_wrap2<
minus_impl<
typename minus_tag<N1>::type
, typename minus_tag<N2>::type
>
, N1
, N2
>::type >::type
{
NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(2, minus2, (N1, N2))
};
NDNBOOST_MPL_AUX_NA_SPEC2(2, 5, minus)
}}
namespace ndnboost { namespace mpl {
namespace aux {
template< typename T, T n1, T n2 >
struct minus_wknd
{
NDNBOOST_STATIC_CONSTANT(T, value = (n1 - n2));
typedef integral_c< T,value > type;
};
}
template<>
struct minus_impl< integral_c_tag,integral_c_tag >
{
template< typename N1, typename N2 > struct apply
: aux::minus_wknd<
typename aux::largest_int<
typename N1::value_type
, typename N2::value_type
>::type
, N1::value
, N2::value
>::type
{
};
};
}}
| cawka/packaging-ndn-cpp-include/ndnboost/mpl/aux_/preprocessed/msvc70/minus.hpp |
-- Applicative parser for infix arithmetic expressions without any
-- dependency on hackage. Builds an explicit representation of the
-- syntax tree to fold over using client-supplied semantics.
module Spring13.Week5.Parser (parseExp) where
import Control.Applicative hiding (Const)
import Control.Arrow
import Data.Char
import Data.Monoid
import Data.List (foldl')
-- Building block of a computation with some state of type @s@
-- threaded through it, possibly resulting in a value of type @r@
-- along with some updated state.
newtype State s r = State (s -> Maybe (r, s))
-- Expressions
data Expr = Const Integer
| Add Expr Expr
| Mul Expr Expr
deriving Show
instance Functor (State s) where
fmap f (State g) = State $ fmap (first f) . g
instance Applicative (State s) where
pure x = State $ \s -> Just (x, s)
State f <*> State g = State $ \s ->
case f s of
Nothing -> Nothing
Just (r, s') -> fmap (first r) . g $ s'
instance Alternative (State s) where
empty = State $ const Nothing
State f <|> State g = State $ \s -> maybe (g s) Just (f s)
-- A parser threads some 'String' state through a computation that
-- produces some value of type @a@.
type Parser a = State String a
-- Parse one numerical digit.
digit :: Parser Integer
digit = State $ parseDigit
where parseDigit [] = Nothing
parseDigit s@(c:cs)
| isDigit c = Just (fromIntegral $ digitToInt c, cs)
| otherwise = Nothing
-- Parse an integer. The integer may be prefixed with a negative sign.
num :: Parser Integer
num = maybe id (const negate) <$> optional (char '-') <*> (toInteger <$> some digit)
where toInteger = foldl' ((+) . (* 10)) 0
-- Parse a single white space character.
space :: Parser ()
space = State $ parseSpace
where parseSpace [] = Nothing
parseSpace s@(c:cs)
| isSpace c = Just ((), cs)
| otherwise = Nothing
-- Consume zero or more white space characters.
eatSpace :: Parser ()
eatSpace = const () <$> many space
-- Parse a specific character.
char :: Char -> Parser Char
char c = State parseChar
where parseChar [] = Nothing
parseChar (x:xs) | x == c = Just (c, xs)
| otherwise = Nothing
-- Parse one of our two supported operator symbols.
op :: Parser (Expr -> Expr -> Expr)
op = const Add <$> (char '+') <|> const Mul <$> (char '*')
-- Succeed only if the end of the input has been reached.
eof :: Parser ()
eof = State parseEof
where parseEof [] = Just ((),[])
parseEof _ = Nothing
-- Parse an infix arithmetic expression consisting of integers, plus
-- signs, multiplication signs, and parentheses.
parseExpr :: Parser Expr
parseExpr = eatSpace *>
((buildOp <$> nonOp <*> (eatSpace *> op) <*> parseExpr) <|> nonOp)
where buildOp x op y = x `op` y
nonOp = char '(' *> parseExpr <* char ')' <|> Const <$> num
-- Run a parser over a 'String' returning the parsed value and the
-- remaining 'String' data.
execParser :: Parser a -> String -> Maybe (a, String)
execParser (State f) = f
-- Run a parser over a 'String' returning the parsed value.
evalParser :: Parser a -> String -> Maybe a
evalParser = (fmap fst .) . execParser
-- Parse an arithmetic expression using the supplied semantics for
-- integral constants, addition, and multiplication.
parseExp :: (Integer -> a) -> (a -> a -> a) -> (a -> a -> a) -> String -> Maybe a
parseExp con add mul = (convert <$>) . evalParser (parseExpr <* eof)
where convert (Const x) = con x
convert (Add x y) = add (convert x) (convert y)
convert (Mul x y) = mul (convert x) (convert y)
| bibaijin/cis194-src/Spring13/Week5/Parser.hs |
Ο Κοτζιάς «ξαναχτυπάει»: Διαφωνεί και καταθέτει δική του πρόταση για την εκλογή Προέδρου της Δημοκρατίας | Usay.gr | Όλες οι ειδήσεις με την υπογραφή του Άκη Παυλόπουλου '); } else if(is_safari_or_uiwebview || ((navigator.userAgent.indexOf('Mozilla/5.0') > -1 && navigator.userAgent.indexOf('Android ') > -1 && navigator.userAgent.indexOf('AppleWebKit') > -1) && !(navigator.userAgent.indexOf('Chrome') > -1))) { if(is_safari_or_uiwebview) { //document.write(''); } else { //document.write(''); } } function popupImage(url) { window.open(url,'popupImage','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150') }
Ο Κοτζιάς «ξαναχτυπάει»: Διαφωνεί και καταθέτει δική του πρόταση για την εκλογή Προέδρου της Δημοκρατίας
07/11 @ 21:48
Ο πρώην υπουργός Εξωτερικών και πρόεδρος του «ΠΡΑΤΤΩ», Νίκος Κοτζιάς, μιλώντας από την Κομοτηνή σε εκδήλωση της κίνησης, εξαπέλυσε νέο… χτύπημα κατά της κυβέρνησης, εκφράζοντας τη διαφωνία του με την πρόταση του πρωθυπουργού, Αλέξη Τσίπρα, για την εκλογή του Προέδρου της Δημοκρατίας.
Ο κ. Κοτζιάς αντιπρότεινε την υιοθέτηση μιας παραλλαγής του γερμανικού μοντέλου: Να δημιουργηθεί ένα ειδικό εκλεκτορικό Σώμα αποτελούμενο κατά 60% από βουλευτές, κατά 30% από αυτοδιοικητικούς και κατά 10% από κληρωτούς πολίτες, προκειμένου να αποφευχθεί η διάλυση της Βουλής, με αφορμή την εκλογή του ύπατου πολιτειακού παράγοντα.
«Όσες φορές είχαμε δυισμό, διαρχία στην Ελλάδα είχαμε πρόβλημα», ανέφερε χαρακτηριστικά.
Παράλληλα, επανέλαβε την διαφωνία του με τις κομμάτι των συνταγματικών αλλαγών που προτάθηκαν στην ΠΓΔΜ, υποστηρίζοντας ότι αλλοιώνουν το νόημα της συμφωνίας των Πρεσπών.
Να σημειωθεί ότι ο κ. Τσίπρας έχει προτείνει -στο πλαίσιο της συνταγματικής αναθεώρησης- να γίνονται διαδοχικές ψηφοφορίες στη Βουλή μια φορά το μήνα επί ένα εξάμηνο ώστε να επιχειρηθεί να επιτευχθεί συναινετική πλειοψηφία για εκλογή Προέδρου της Δημοκρατίας και εφόσον αποτύχουν αυτές οι προσπάθειες να γίνεται απευθείας εκλογή από το λαό. | c4-el |
import {combineReducers} from 'redux';
import userReducer from './userReducer';
import groupReducer from './groupReducer';
import folderReducer from './folderReducer';
import aclReducer from './aclReducer';
import siteReducer from './siteReducer';
import authReducer from './authReducer';
import adminReducer from './adminReducer'
const appReducer = combineReducers({
userData: userReducer,
groupData: groupReducer,
folderData: folderReducer,
aclData: aclReducer,
siteData: siteReducer,
authData: authReducer,
adminData: adminReducer
});
const rootReducer = (state, action) => {
return appReducer(state, action)
};
export default rootReducer; | anhem/urchin-src/main/app/src/reducer/rootReducer.js |
Uncategorized
# police story 2 english dubbed
but the actual value of the parameter depends
And to make it even more confusing, the flow conditions in and of these effects to other forces present in the To properly model + Inspector General Hotline This creates a layer of air near the surface, called a Laminar flow falls below Reynolds number of 1100 and turbulent falls in a range greater than 2200.
Reynolds number calculation. The High values of the parameter of the velocity is proportional to the velocity divided by the square of the gas going by the object and on two other important properties on your Laminar flow is the type of flow in which the fluid travels smoothly in regular paths. separate
Therefore, the flow of liquid is laminar. magnitude of these forces depend on the shape of the object, the 2 / 0.025 = 20 / 0.025 = 800. See our full terms of service. The sleek version the surface. Your email address will not be published.
+ NASA Privacy Statement, Disclaimer, of the length scale.
This means the Reynolds number is unitless.
This page shows an interactive Java applet which calculates the viscosity coefficient or the speed by using the menu buttons.
forces are generated between the gas and the object. momentum conservation equation,
and the Reynolds number for an input velocity, length, and altitude. flow is essentially inviscid. Reynolds number formula (equation) The Reynolds Number formula is: “Re = VDρ/μ” or “Re = VD/v” where “V” is the fluid velocity, “D” is the characteristic distance, “ρ” is the fluid density, “ν” is the kinematic viscosity, and “μ” is the dynamic viscosity both of which can be acquired from data tables. You can use either Imperial or Metric units and you can input either the Mach number ISBN 92-822-2213-6. can then be used to model the flow.
Aerodynamic
testing and very sophisticated computer analysis. Each tool is carefully developed and rigorously tested, and our content is well-sourced, but despite our best effort it is possible they contain errors.
Low values of the parameter correctly modeled. of the atmosphere near the of the gas; the viscosity, or stickiness, of the gas and the white on blue boxes.
density r times the velocity V times the If you are an experienced user of this calculator, you can use a it was the physical surface of the object. divided by a length scale L. Similarly, the second derivative
the second gradient of the velocity d^2V/dx^2.
If you use our Reynolds Number calculator, the conversion would be handled automatically. are given on another page,
Problem 1- Calculate Reynolds number, if a fluid having viscosity of 0.4 Ns/m2 and relative density of 900 Kg/m3 through a pipe of 20 mm with a velocity of 2.5 m. $$=\frac{900\times 2.5\times 20\times10^{-3}}{0.4}$$. parameters, then the relative importance of the forces are being With the help of this calculator you can compute the Reynolds Number of a liquid or gas.It supports a wide range of input and output measurement units (e.g.
inertial (resistant to change or motion) forces to viscous Representative values for the properties of object are disturbed and move around the object. the dynamic viscosity divided by the density: Here's a Java program to calculate the coefficient of viscosity aerodynamicists rely on | finemath-3plus |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: POGOProtos/Networking/Envelopes/AuthTicket.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name='POGOProtos/Networking/Envelopes/AuthTicket.proto',
package='POGOProtos.Networking.Envelopes',
syntax='proto3',
serialized_pb=_b('\n0POGOProtos/Networking/Envelopes/AuthTicket.proto\x12\x1fPOGOProtos.Networking.Envelopes\"E\n\nAuthTicket\x12\r\n\x05start\x18\x01 \x01(\x0c\x12\x1b\n\x13\x65xpire_timestamp_ms\x18\x02 \x01(\x04\x12\x0b\n\x03\x65nd\x18\x03 \x01(\x0c\x62\x06proto3')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
_AUTHTICKET = _descriptor.Descriptor(
name='AuthTicket',
full_name='POGOProtos.Networking.Envelopes.AuthTicket',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='start', full_name='POGOProtos.Networking.Envelopes.AuthTicket.start', index=0,
number=1, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='expire_timestamp_ms', full_name='POGOProtos.Networking.Envelopes.AuthTicket.expire_timestamp_ms', index=1,
number=2, type=4, cpp_type=4, label=1,
has_default_value=False, default_value=0,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='end', full_name='POGOProtos.Networking.Envelopes.AuthTicket.end', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
oneofs=[
],
serialized_start=85,
serialized_end=154,
)
DESCRIPTOR.message_types_by_name['AuthTicket'] = _AUTHTICKET
AuthTicket = _reflection.GeneratedProtocolMessageType('AuthTicket', (_message.Message,), dict(
DESCRIPTOR = _AUTHTICKET,
__module__ = 'POGOProtos.Networking.Envelopes.AuthTicket_pb2'
# @@protoc_insertion_point(class_scope:POGOProtos.Networking.Envelopes.AuthTicket)
))
_sym_db.RegisterMessage(AuthTicket)
# @@protoc_insertion_point(module_scope)
| favll/pogom-pogom/pgoapi/protos/POGOProtos/Networking/Envelopes/AuthTicket_pb2.py |
#This class just iterates over the lines in a file (particularly, we send it the training data file with one line per sentence)
#so that we do not have to store all the sentences in memory.
import zipfile, os
#Set this to false once we are done just checking if the program works.
checkingifworking = False
class SentenceIterator(object):
def __init__(self, entityextractedfilename, wikipedialemmatizeddir, repeatrelevanttimes):
self.entityextractedfilename = entityextractedfilename
self.wikipedialemmatizeddir = wikipedialemmatizeddir
self.repeatrelevanttimes = repeatrelevanttimes
def __iter__(self):
for i in xrange(1, self.repeatrelevanttimes):
zipthing = zipfile.ZipFile(self.entityextractedfilename, 'r')
zipinternalfilename = zipthing.namelist()[0] #The zip file contains only one file.
with zipthing.open(zipinternalfilename, 'r') as f:
for line in f:
if not ( line.startswith("###") and line.endswith("###") ):
#yield line.split(' ', 1)[1].split(' ')
yield line.split(' ')
for dirpath, subdirs, files in os.walk(self.wikipedialemmatizeddir):
for x in files:
if x.endswith(".zip"):
filepath = os.path.join(dirpath, x)
zipthing = zipfile.ZipFile(filepath, 'r')
zipinternalfilename = zipthing.namelist()[0] #Each zip file contains only one file.
with zipthing.open(zipinternalfilename, 'r') as f:
for line in f:
yield line.split()
if checkingifworking:
break
| stucco/relation-bootstrap-PythonWord2VecStuff/src/Word2Vec/SentenceIterator.py |
define([
"mvc/dataset/dataset-li",
"mvc/base-mvc",
"utils/localization"
], function( DATASET_LI, BASE_MVC, _l ){
/* global Backbone */
//==============================================================================
var _super = DATASET_LI.DatasetListItemView;
/** @class Read only view for HistoryDatasetAssociation.
* Since there are no controls on the HDAView to hide the dataset,
* the primary thing this class does (currently) is override templates
* to render the HID.
*/
var HDAListItemView = _super.extend(
/** @lends HDAListItemView.prototype */{
/** logger used to record this.log messages, commonly set to console */
//logger : console,
className : _super.prototype.className + " history-content",
initialize : function( attributes, options ){
_super.prototype.initialize.call( this, attributes, options );
},
// ......................................................................... misc
/** String representation */
toString : function(){
var modelString = ( this.model )?( this.model + '' ):( '(no model)' );
return 'HDAListItemView(' + modelString + ')';
}
});
// ............................................................................ TEMPLATES
/** underscore templates */
HDAListItemView.prototype.templates = (function(){
//TODO: move to require text! plugin
var titleBarTemplate = BASE_MVC.wrapTemplate([
// adding the hid display to the title
'<div class="title-bar clear" tabindex="0">',
'<span class="state-icon"></span>',
'<div class="title">',
//TODO: remove whitespace and use margin-right
'<span class="hid"><%- dataset.hid %></span> ',
'<span class="name"><%- dataset.name %></span>',
'</div>',
'</div>'
], 'dataset' );
var warnings = _.extend( {}, _super.prototype.templates.warnings, {
hidden : BASE_MVC.wrapTemplate([
// add a warning when hidden
'<% if( !dataset.visible ){ %>',
'<div class="hidden-msg warningmessagesmall">',
_l( 'This dataset has been hidden' ),
'</div>',
'<% } %>'
], 'dataset' )
});
return _.extend( {}, _super.prototype.templates, {
titleBar : titleBarTemplate,
warnings : warnings
});
}());
//==============================================================================
return {
HDAListItemView : HDAListItemView
};
});
| mikel-egana-aranguren/SADI-Galaxy-Docker-galaxy-dist/static/scripts/mvc/history/hda-li.js |
/*
* 二部マッチング
* O(|E||V|)
*
* http://poj.org/problem?id=3041
*/
struct BipartiteMatching {
vector<vector<int> > G;
vector<int> match;
vector<bool> used;
int V;
BipartiteMatching(int V):V(V){
G.resize(V);
match.resize(V);
used.resize(V);
}
void add_edge(int u,int v) {
G[u].push_back(v);
G[v].push_back(u);
}
bool dfs(int v) {
used[v]=true;
for(int i=0;i<G[v].size();i++){
int u=G[v][i];
int w=match[u];
if(w<0||!used[w]&&dfs(w)) {
match[v]=u;
match[u]=v;
return true;
}
}
return false;
}
int operator() () {
int res=0;
match.assign(V,-1);
for(int v=0;v<V;v++){
if(match[v]<0) {
used.assign(V,0);
if(dfs(v)) res++;
}
}
return res;
}
};
| odanado/ProconLib-Graph/BipartiteMatching.cpp |
/**
* Copyright 2017 iovation, Inc.
* <p>
* Licensed under the MIT License.
* You may not use this file except in compliance with the License.
* A copy of the License is located in the "LICENSE.txt" file accompanying
* this file. This file 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.iovation.launchkey.sdk.transport.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.net.URI;
import java.util.UUID;
@JsonPropertyOrder({"service_id", "name", "description", "icon", "callback_url", "active"})
public class ServicesPatchRequest {
private final UUID serviceId;
private final String name;
private final String description;
private final URI icon;
private final URI callbackURL;
private final Boolean active;
public ServicesPatchRequest(UUID serviceId, String name, String description, URI icon, URI callbackURL,
Boolean active) {
this.serviceId = serviceId;
this.name = name;
this.description = description;
this.icon = icon;
this.callbackURL = callbackURL;
this.active = active;
}
@JsonProperty("service_id")
public UUID getServiceId() {
return serviceId;
}
@JsonProperty("name")
public String getName() {
return name;
}
@JsonProperty("description")
public String getDescription() {
return description;
}
@JsonProperty("icon")
public URI getIcon() {
return icon;
}
@JsonProperty("callback_url")
public URI getCallbackURL() {
return callbackURL;
}
@JsonProperty("active")
public Boolean isActive() {
return active;
}
}
| iovation/launchkey-java-sdk/src/main/java/com/iovation/launchkey/sdk/transport/domain/ServicesPatchRequest.java |
//
// KiwiConnectionTableViewController.h
// KiwiSDK
//
// Created by Kiwi Wearable Technologies Ltd. on 2014-04-08.
// Copyright (c) 2014 Kiwi Wearable Technologies Ltd. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface KiwiConnectionTableViewController : UITableViewController
@property (strong, nonatomic) NSMutableArray* kiwiDevices;
@end
| kiwiwearables/kiwi-motion-pod-KiwiSDK/include/KiwiSDK/KiwiConnectionTableViewController.h |
//
// QHCQinghuaBeatDetailViewController.h
// QHC
//
// Created by qhc2015 on 15/6/15.
// Copyright (c) 2015年 qhc2015. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface QHCProjectDetailViewController : UIViewController{
NSDictionary *bundleDataDic;
}
@property (nonatomic, retain)NSDictionary *bundleDataDic;
- (id)initWithData:(NSDictionary*)dataDic;
@end
| zhang-xj/GeneralIOSPJ-QHC/src/home/projectDetail/QHCProjectDetailViewController.h |
//
// HCAppDelegate.h
// RACAutoDisposer
//
// Created by CocoaPods on 07/20/2014.
// Copyright (c) 2014 Ryu Heechul. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface HCAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| ryuheechul/RACAutoDisposer-Example/RACAutoDisposer/HCAppDelegate.h |
/**
* The Render Engine
* DocumentContext
*
* @fileoverview A render context which wraps the DOM document node.
*
* @author: Brett Fattori ([email protected])
* @author: $Author: bfattori $
* @version: $Revision: 1216 $
*
* Copyright (c) 2010 Brett Fattori ([email protected])
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* 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.
*
*/
// Includes
Engine.include("/rendercontexts/context.htmlelement.js");
Engine.initObject("HTMLDivContext", "HTMLElementContext", function() {
/**
* @class A simple extension of the {@link HTMLElementContext} which uses a DIV
* element to represent the context. This is just a convenience method.
* <p/>
*
* @extends HTMLElementContext
* @constructor
* @description Create a new instance of a context drawn on a <tt>div</tt> element.
* @param name {String} The name of the context
* @param contextWidth {Number} The width (in pixels) of the context.
* @param contextHeight {Number} The height (in pixels) of the context.
*/
var HTMLDivContext = HTMLElementContext.extend(/** @scope HTMLDivContext.prototype */{
/**
* @private
*/
constructor: function(name, contextWidth, contextHeight) {
var ctx = $("<div>").css({
width: contextWidth,
height: contextHeight,
position: "absolute",
overflow: "hidden"
});
this.base(name || "HTMLDivContext", ctx);
this.setViewport(Rectangle2D.create(0, 0, contextWidth, contextHeight));
}
}, /** @scope HTMLDivContext.prototype */{
/**
* Get the class name of this object
*
* @return {String} "HTMLDivContext"
*/
getClassName: function() {
return "HTMLDivContext";
}
});
return HTMLDivContext;
});
| pib/hamsterdrop-rendercontexts/context.htmldivcontext.js |
$( document ).ready(function()
{
$('[data-type="multipleselect"]').multipleselect(
{
app:"field",
template:"/multipleselect.available"
});
}); | hands-agency/grandcentral-spa-grandcentral/field/template/js/multipleselect.js |
'use strict';
angular.module('jhipstersampleApp')
.controller('MainController', function ($scope, Principal) {
Principal.identity().then(function(account) {
$scope.account = account;
$scope.isAuthenticated = Principal.isAuthenticated;
});
});
| marhan/jhipstersample-src/main/webapp/scripts/app/main/main.controller.js |
package com.vlkan.hrrs.serializer.base64;
public interface Base64Decoder {
byte[] decode(String encodedBytes);
}
| vy/hrrs-serializer-base64/src/main/java/com/vlkan/hrrs/serializer/base64/Base64Decoder.java |
package ca.carleton.gcrc.utils;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Properties;
public class VersionUtils {
static private boolean g_propsLoaded = false;
static private Properties g_props = null;
static public String getVersion() {
Properties props = loadProperties();
String version = null;
if( props.containsKey("version") ){
version = props.getProperty("version");
}
return version;
}
static public String getDateString() {
Properties props = loadProperties();
String dateStr = null;
if( props.containsKey("time") ){
dateStr = props.getProperty("time");
}
return dateStr;
}
static public String getBuildString() {
Properties props = loadProperties();
String buildStr = null;
if( props.containsKey("build") ){
buildStr = props.getProperty("build");
}
return buildStr;
}
static public String getShortBuildString() {
Properties props = loadProperties();
String buildStr = null;
if( props.containsKey("build_short") ){
buildStr = props.getProperty("build_short");
}
return buildStr;
}
static public String loadVersion() throws Exception {
InputStream is = null;
InputStreamReader isr = null;
String version = null;
try {
ClassLoader cl = VersionUtils.class.getClassLoader();
is = cl.getResourceAsStream("version.properties");
isr = new InputStreamReader(is,"UTF-8");
Properties props = new Properties();
props.load(isr);
if( props.containsKey("version") ){
version = props.getProperty("version");
}
} catch(Exception e) {
throw new Exception("Error while extracting version resource",e);
} finally {
if( null != isr ){
try {
isr.close();
} catch(Exception e) {
// Ignore
}
}
if( null != is ){
try {
is.close();
} catch(Exception e) {
// Ignore
}
}
}
return version;
}
static synchronized public Properties loadProperties() {
if( !g_propsLoaded ){
g_propsLoaded = true;
try {
InputStream is = null;
InputStreamReader isr = null;
try {
ClassLoader cl = VersionUtils.class.getClassLoader();
is = cl.getResourceAsStream("version.properties");
isr = new InputStreamReader(is,"UTF-8");
Properties props = new Properties();
props.load(isr);
g_props = props;
isr.close();
isr = null;
is.close();
is = null;
} catch(Exception e) {
throw new Exception("Error while extracting properties",e);
} finally {
if( null != isr ){
try {
isr.close();
} catch(Exception e) {
// Ignore
}
}
if( null != is ){
try {
is.close();
} catch(Exception e) {
// Ignore
}
}
}
} catch(Exception e) {
// Can't load them. Go with empty props
g_props = new Properties();
}
}
return g_props;
}
}
| GCRC/nunaliit-nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/VersionUtils.java |
// This file has been generated by Py++.
// (C) Christopher Woods, GPL >= 2 License
#ifndef CLJPotentialInterface_InterSoftCLJPotential__hpp__pyplusplus_wrapper
#define CLJPotentialInterface_InterSoftCLJPotential__hpp__pyplusplus_wrapper
void register_CLJPotentialInterface_InterSoftCLJPotential__class();
#endif//CLJPotentialInterface_InterSoftCLJPotential__hpp__pyplusplus_wrapper
| chryswoods/Sire-wrapper/MM/CLJPotentialInterface_InterSoftCLJPotential_.pypp.hpp |
/**
* Using Rails-like standard naming convention for endpoints.
* GET /things -> index
* POST /things -> create
* GET /things/:id -> show
* PUT /things/:id -> update
* DELETE /things/:id -> destroy
*/
'use strict';
var _ = require('lodash');
var Link = require('./link.model.js');
// Get list of things
exports.index = function(req, res) {
getClientLinks(req.user._id, function(err, links) {
if(err) { return handleError(res, err); }
return res.status(200).json(links);
})
};
exports.getClientLinks = getClientLinks;
function getClientLinks(userId, callback) {
Link.find({'userId': userId}, function (err, links) {
if(err) {
return callback(err, null);
}
return callback(null, links);
});
}
// Get a single thing
exports.show = function(req, res) {
Link.findById(req.params.id, function (err, link) {
if(err) { return handleError(res, err); }
if(!link) { return res.status(404).send('Not Found'); }
return res.json(link);
});
};
// Creates a new thing in the DB.
exports.create = function(req, res) {
if (!req.user) {
res.status(400).send('Please provide the user id');
}
req.body.userId = req.user._id;
Link.create(req.body, function(err, link) {
if(err) { return handleError(res, err); }
return res.status(201).json(link);
});
};
// Updates an existing thing in the DB.
exports.update = function(req, res) {
if(req.body._id) { delete req.body._id; }
Link.findById(req.params.id, function (err, link) {
if (err) { return handleError(res, err); }
if(!link) { return res.status(404).send('Not Found'); }
var updated = _.merge(link, req.body);
updated.save(function (err) {
if (err) { return handleError(res, err); }
return res.status(200).json(link);
});
});
};
// Deletes a thing from the DB.
exports.destroy = function(req, res) {
Link.findById(req.params.id, function (err, link) {
if(err) { return handleError(res, err); }
if(!link) { return res.status(404).send('Not Found'); }
link.remove(function(err) {
if(err) { return handleError(res, err); }
return res.status(204).send('No Content');
});
});
};
function handleError(res, err) {
return res.status(500).send(err);
}
| best4him/ACrawler-server/api/links/link.controller.js |
//
// LineViewController.h
// DrawRectDemo
//
// Created by Ray.M on 14-12-31.
// Copyright (c) 2014年 Ray.M. All rights reserved.
//
#import <UIKit/UIKit.h>
@class DrawLineView;
@interface DrawLineViewController : UIViewController
@property (nonatomic, strong) DrawLineView *lineView;
@end
| ray110523/yueting-StaffsProject/StaffsProject/Sections/Draw/C/DrawLineViewController.h |
/// @addtogroup multiEngHom
/// @{
/////////////////////////////////////////////////////////////////////////////
/// @file powerTwoCeiling.h
///
/// @author Marian Mrozek
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) Marian Mrozek 2005-2006
//
// This file constitutes a part of the CAPD library,
// distributed under the terms of the GNU General Public License.
// Consult http://capd.wsb-nlu.edu.pl/ for details.
#if !defined(_POWERTWOCEILING_H_)
#define _POWERTWOCEILING_H_
inline int powerTwoCeiling(int n){
int k=1;
while(k<n) k=k << 1;
return k;
}
inline unsigned int baseTwoLog(unsigned long int n){
int k=0;
while(n>1){
n=n >> 1;
++k;
}
return k;
}
#endif//_POWERTWOCEILING_H_
/// @}
| felixboes/hosd-chomp/include/capd/multiEngHom/powerTwoCeiling.h |
jQuery(document).ready(function($) {
// RECURRING
$('#transaction_create .recurring_type').change(function(event) {
if( $(this).val() == 'never' ){
$('#transaction_create .recurring_times').addClass('hidden');
}else{
$('#transaction_create .recurring_times').removeClass('hidden');
}
});
$('.isRecurring').click( function(event) {
$('select.recurring_type').toggleClass('hidden');
/* Act on the event */
});
// PAGO
$('#transaction_done .btn').click(function(event) {
$('#transaction_done .btn i.fa').toggleClass('fa-check-square-o');
$('#transaction_done .btn i.fa').toggleClass('fa-square-o');
$(this).toggleClass('btn-success');
});
$('.transaction_amount').change(function(event) {
if( $(this).val() < 0 ){
$('.transaction_type .despesa input').prop('checked', true);
}else{
$('.transaction_type .receita input').prop('checked', true);
}
});
// function selectCallback(value) {
// if( value == "#modal" ) {
// $('.modal#transactions_select_range').modal();
// }else{
// location.href = value;
// }
// }
// $('select.transaction_navigation').selecter({
// callback: selectCallback,
// //links: true,
// cover: false
// });
$('select.transaction_navigation').change(function(event) {
var value = $(this).val();
if( value == "#modal" ) {
$('.modal#transactions_select_range').modal();
}else
if( value != "" ){
location.href = value;
}
});
// DONE
$(".transaction_done .btn").click(function(event) {
//alert( $(this).find('checkbox').val() );
});
// MODAL
$('#modal').on('show.bs.modal', function (event) {
var link = $(event.relatedTarget);
// $(this).find(".modal-content").load( link.attr("href") );
$(this).find(".modal-content").load( link.attr("href") );
// function(){
// /* Stuff to do after the page is loaded */
// //alert();
// $(this).find(".modal-content input.price").priceFormat({
// prefix: '',
// centsSeparator: ',',
// thousandsSeparator: '.',
// allowNegative: false
// });
// }
})
}); | raphaeljorge/butlerapp-public_html/js/transactions.js |
/*
* -------------------- DO NOT REMOVE OR MODIFY THIS HEADER --------------------
*
* Copyright (C) 2014 The Iguanod Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* A copy of the License should have been provided along with this file, usually
* under the name "LICENSE.txt". If that is not the case 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 es.iguanod.util.tuples;
/**
* Interface used internally to convert tuples from one size to another.
*
* @author <a href="mailto:[email protected]">David Rubio Fernández</a>
* @since 1.0.1
* @version 1.0.1
*/
interface BackedTuple{
/**
* Returns the ith element of the tuple.
*
* @param i the number of element to be returned
*
* @return the requested element
*/
public Object get(int i);
}
| Iguanod/Iguanod-library-src/es/iguanod/util/tuples/BackedTuple.java |
Approximate Methods
Experience with Gibbs sampling suggests that existing sampling methods are unlikely to be adequately fast for complicated models, either for learning or for inferring hidden causes from data once learning is complete. There is therefore reason to search for approximate methods whose error of approximation can be bounded in some way. \(\mathcal{F}(d;\,\theta,\,\mathcal{Y})\) defined in eqn (6) is a natural place to turn, for two reasons. First, since it is always true that \(KL[\mathcal{Y}_{\,|\,d},\,\mathcal{Y}_{\,|\,d}]0\), we know that:
\[-\log\,p(d|\theta)\leqslant\mathcal{F}(d;\,\theta,\,\mathcal{Y}) \tag{10}\]
with equality if \(\mathcal{Y}_{\,|\,d}=\mathcal{P}_{\,|\,d}\). Second, the sums over the exponentially many \(\alpha\) in eqn (6) involve a probability distribution \(\mathcal{Y}_{\,|\,d}\) that can be determined to make minimization of \(\mathcal{F}\) tractable, instead of the distribution \(\mathcal{Z}_{\,|\,d}\) that in many cases requires an exponential sum simply to be calculated.
Mean field methods are the paradigm in these cases. For either the BM (Peterson & Anderson, 1987; Hinton, 1989) or Bayesian nets (Jaakkola et al., 1996; Saul et al., 1995), mean field methods take \(\mathcal{Y}_{\,|\,d}\) to be factorial, i.e., they take all the hidden units to be mutually independent given the data. Solving for the optimal factorial distribution for the hidden units typically requires solving a set of consistency equations and can be performed using a few iterations. Depending on the form of \(p(d,\,\alpha|\theta)\) and the mean field distributions, one can then use gradient descent or exact methods to update the parameters \(\theta\) to minimize \((\mathcal{F}d;\,\theta,\,\mathcal{Y})\) using the factorial form of \(\mathcal{Y}_{\,|\,d}\) to make this tractable. The whole procedure amounts to minimizing an upper bound \(\mathcal{F}(d;\,\theta,\,\mathcal{Y})\) to the negative log likelihood using the same alternating method as EM (estimate the best \(\mathcal{Y}\) as a function of \(\theta\) and then improve \(\theta\) using this \(\mathcal{Y}\)) except that a bound is being minimized rather than the real negative log likelihood, and there are restrictions on the form of \(\mathcal{Y}\) (that it be factorial) which prevent the E-step from being complete (the calculated \(\mathcal{Y}_{\,|\,d}\) may not be \(\mathcal{P}_{\,|\,d}\)).
The Helmholtz machine (Dayan et al., 1995; Hinton et al., 1995) is an instance of this technique, except that rather than use mean field methods and mean field iteration to get a convenient \(\mathcal{Y}_{\,|\,d}\), it devotes a separate set of parameters \(\phi\) to model \(\mathcal{Y}_{\,|\,d}\) and optimizes \(\mathcal{F}(d;\,\theta,\,\phi)\) over these parameters too.
### The Helmholtz Machine
Figure 1 shows an example of the Helmholtz machine. The top-down weights are the parameters \(\theta\) of the _generative_ model--a unidirectional Bayesian network in which units are divided into layers with complete connections from units in layer \(\mathcal{Z}\) to those in layer \(\mathcal{Y}\) and so forth (one could clearly use partial connectivity, or also connections that skip layers, provided that the directed connection graph remains unidirectional). The generative model is factorial within each layer--each unit in layer \(\mathcal{Y}\) is independent of the others within the same layer given the activities in the layer \(\mathcal{Z}\) and the weights. Note that optimizing the parameters of this Bayesian network is intractable in the sense discussed above, since each unit has many parents.
The bottom-up weights are the parameters \(\phi\) of the _recognition_ model--another unidirectional Bayesian network based on the same architecture as the generative model. The recognition model is also factorial within each layer--but now the units in layer \(\mathcal{Z}\) are mutually independent given the activities in layer \(\mathcal{Y}\) rather than _vice-versa_. There is no reason to believe that the true posterior distribution \(p(\alpha|\,d,\,\theta)\) is really factorial in this manner, although the way the network is trained provides it with strong encouragement to choose generative parameters \(\theta\) for which forcing this approximation is not disastrous.
An alternative way to look at the HM is in terms of autoencoders. A HM with just one hidden layer is exactly (a folded-over version of) the sort of autoencoder that Zemel (1994) and Hinton and Zemel (1994) treated. The recognition model performs the _coding_ operation of turning inputs \(d\) into stochastic codes in the hidden layer; the generative model reconstructs its best guess of the input on the basis of the code that it sees. Maximizing the likelihood of the data can be interpreted in terms of minimizing the total number of bits (which is just \(\mathcal{F}\)) it takes to send the data from a sender to a receiver who knows the generative model but not the inputs themselves.
There are presently two main variants of the Helmholtz machine. Both use gradient methods to optimize \(\mathcal{F}\), but they use different types of bottom-up
Figure 1: A three-layer Helmholtz machine. Weights \(\theta\) define a top-down generative model in layers \(\mathcal{Z}\), \(\mathcal{Y}\) and \(\mathcal{Y}\) of stochastic binary units. \(\mathcal{Y}\) are the observables, and the task for \(\theta\) is maximizing the probability \(p(d|\theta)\). Weights \(\phi\) define a bottom-up recognition model that attempts to invert the generative model.
recognition model to avoid the remaining exponential sums in (the derivatives of) eqn (6).
The _deterministic_ HM (Dayan et al., 1995) makes approximations inspired by mean-field methods, replacing stochastic firing probabilities in the recognition model by their deterministic mean values. The advantage of this is that one can use powerful optimization methods to update the parameters \(\theta,\phi\). However, there are two main disadvantages. One is that this replacement of random quantities by their means entails that the resulting recognition distribution \(2_{\mid d}\) is trivial. Even though we are assuming that the hidden activities with a layer are conditionally independent, there are correlations between the activities in different hidden layers. These correlations are not captured in the deterministic HM.
The second disadvantage is that under the model we actually used, we did not have a guaranteed bound on the likelihood--the term \(\Sigma\,\text{\em a}_{\mid d}\,\log[p(\alpha,\,d|\theta)]\) in eqn (6) was not calculated tractably in a way that ensured the bound would be preserved. More sophisticated methods (Jaakkola et al., 1996; Saul et al., 1995) could be used to repair this problem. Even with these disadvantages, though, we showed this machine working on a number of difficult unsupervised learning problems.
The _stochastic_ HM (Hinton et al., 1995) captures the correlations between the activities in different hidden layers, but at the expense of requiring sampling. However, because the recognition model is unidirectional, an unbiased sample can be obtained in a single forward pass. The learning method for the stochastic HM is called the wake-sleep algorithm.2 During the wake phase, samples are taken from the recognition model, and the parameters \(\theta\) of the generative model are updated according to the sampled gradient of \(\mathcal{F}\). The weight updates require nothing more than the completely local delta rule.
During the sleep phase, samples (fantasies) are generated top-down by the generative model, and the parameters \(\phi\) of the recognition model are updated to make it better approximate the inverse of the generative model. The weight updates again require nothing more than the completely local delta rule. Unfortunately, as discussed in Hinton et al. (1995), the recognition model is not being adjusted according to the gradient of \(\mathcal{F}\) as desired, but rather according to the gradient of \(KL[\mathcal{G}_{\cdot\mid d},\,2_{\cdot\mid d}]\) where the data \(d\) are drawn according to the generative distribution. This is the Kullback-Leibler divergence from the true posteriors to those imputed by the recognition model rather than _vice-versa_. The Kullback-Leibler divergence is not a metric because it is not symmetric, and the asymmetry can be important. Nevertheless, the wake-sleep algorithm also worked well in practice, including on a task which required it to build hierarchical generative models of \(8\times 8\) binary images of handwritten digits and use the log likelihoods under each model to perform digit recognition.
The stochastic HM has two important advantages over the BM. First, no iteration is required to extract unbiased samples. Second, although there is a random sampling error when computing the weight updates, the fact that the top-down generative model is a Bayesian net rather than a Markov random field implies that it is at least not necessary to learn based on the difference between two noisy samples (Neal, 1992).
Learning a model of the world and using samples from the model during an offline phase to learn to invert that model has its parallels in DYNA, Sutton's (1991) model-based reinforcement learning system. The equivalent of the recognition model in DYNA reports the long run values of states in a rewarded Markov decision problem (MDP). Just like the exponential sums in eqn (1), it is intractable to calculate these values online even having a full model of the MDP (which is like knowing \(\theta\)). DYNA uses sleep samples from the model and temporal difference learning (Sutton, 1988; Barto et al., 1989) to acquire the inverse.
## 3 Variants of the Helmholtz Machine
The main purpose of this paper is to describe a number of the variants of the Helmholtz machine (HM) which we have explored. We have not attempted to provide an exhaustive survey--there are also many other varieties. Few of the machines have been fully tested and some are only really intended to provide baselines for the performance of other, more sophisticated methods. Mean field methods that do not use separate sets of recognition parameters (Jaakkola et al., 1996; Saul et al., 1995) are also under investigation.
Our explorations can be summarized as follows:
_Unit activation functions_. The original HM involved networks of binary stochastic sigmoid, noisy-or (Pearl, 1988; Saund, 1995) or competitive (Dayan & Zemel, 1995) units. Softmax, linear, and essentially all other unit types can also be used, and different unit types can be intermixed in the same network. The wake-sleep algorithm is particularly convenient for this since it is not necessary to concoct different mean field bounds for each new activation function. The case with just one hidden layer of linear
[MISSING_PAGE_FAIL:7]
are explicitly using the conditional factorial form of \(\mathcal{D}\) to write \(\frac{\partial}{\partial\theta}\,\left[\mathcal{F}\left(\mathbf{d};\,\theta,\,\phi\right)\right]\) = \(-\sum\limits_{\mathbf{y}}\,\left.\mathcal{D}_{\mathbf{z}\left|\mathbf{d}\,\theta}\,\sum\limits_{\mathbf{z}}\,\mathcal{D}_{\mathbf{z}\left|\mathbf{y}\,\phi}\right.\right.\)Gradient descent in \(\mathcal{F}\) requires us to calculate the derivatives of \(\mathcal{F}\) with respect to \(\phi\) and \(\theta\).
The gradient with respect to \(\theta\) is:
\[\begin{array}{l}\frac{\partial}{\partial\theta}\,\left[\mathcal{F}\left( \mathbf{d};\,\theta,\,\phi\right)\right]=-\sum\limits_{\mathbf{y}}\,\left. \mathcal{D}_{\mathbf{z}\left|\mathbf{d}\,\theta}\,\sum\limits_{\mathbf{z}}\, \mathcal{D}_{\mathbf{z}\left|\mathbf{y}\,\phi}\right.\right.\\ \times\frac{\partial\,\log\left[p\left(\mathbf{d}\left|\mathbf{y},\,\theta \right)p\left(\mathbf{y}\left|\mathbf{z},\,\theta\right)p\left(\mathbf{z} \right|\theta\right)\right]\right.}{\partial\theta},\end{array}\]
which is in the form of an expectation over the recognition distribution. Using one or more stochastic samples produced by the recognition model and averaging
\[-\frac{\partial}{\partial\theta}\,\log[p\left(\mathbf{d}\left|\mathbf{y},\, \theta\right)p\left(\mathbf{y}\left|\mathbf{z},\,\theta\right)p\left(\mathbf{z}\left|\theta\right)\right]\]
_for those particular samples_ provides an unbiased estimate of the gradient of \(\mathcal{F}\left(\mathbf{d};\,\theta,\,\phi\right)\). This is exactly the analysis underlying the wake phase of the wake-sleep algorithm.
The gradient of \(\mathcal{F}\left(\mathbf{d};\,\theta,\,\phi\right)\) with respect to \(\phi\) cannot apparently be calculated in quite the same manner because terms in the recognition distribution such as \(\mathcal{D}_{\mathbf{y}\left|\mathbf{d};\,\phi}\) depend on \(\phi\). However, the recognition model is _factorial_ and this restores sampling as a
\begin{table}
\begin{tabular}{c c c c} Type & Range & \(p_{i}\) & \(p\left(y_{i}\right)\) & \(\partial\,\log\,p\left(y_{i}\right)/\partial w_{i}\) \\ \hline Sigmoid & \(\left\{0,1\right\}\) & \(1\) & \(p_{i}^{\psi}\left(1-p_{i}\right)^{1-\gamma_{i}}\) & \(\left(y_{i}-p_{i}\right)2_{i}\) \\ & & & \\ Softmax & \(\left\{1,\ldots,\eta\right\}\) & \(\frac{\exp\,\left(\sum\limits_{i}\,w_{i}^{\eta}\,2_{i}\right)}{\sum\limits_{\mathbf{x}}\,\exp\,\left(\sum\limits_{i}\,w_{i}^{\eta}\,2_{i}\right)}\) & \(p_{h}\) & \(\left(\delta_{w_{i}}-p_{h}\right)2_{i}\) \\ Noisy-or & \(\left\{0,1\right\}\) & \(1-\prod_{i}\,\left(1-w_{i}\,2_{i}\right)\) & \(p_{i}^{\psi}\left(1-p_{i}\right)^{1-\gamma_{i}}\) & \(\frac{1}{h}\,\left(y_{i}-p_{i}\right)2_{i}\) \\ Competitive & \(\left\{0,1\right\}\) & \(1-\frac{1}{1+\sum\limits_{i}\,w_{i}\,2_{i}}\) & \(p_{i}^{\psi}\left(1-p_{i}\right)^{1-\psi}\) & \(\frac{1-\beta}{h}\,\left(y_{i}-p_{i}\right)2_{i}\) \\ Gaussian & \(\mathcal{F}\) & \(\frac{\exp\left(-\left(y_{i}-\sum\limits_{j}\,w_{j}\,2_{i}\right)^{2}/2\sigma_{i}^{2}\right)}{\sqrt{2\,\pi\sigma_{i}^{2}}}\) & \(p_{i}\) & \(\frac{1}{\sigma_{i}^{2}}\) (\(y_{i}-\sum\limits_{j}\,w_{j}\,2_{h}\)) \\ \end{tabular}
\end{table}
Table 1: Unit Activation Functionscredible option. For instance, if there are \(n\) units in layer \(V\) and \(q_{j} \equiv p(y_{j} = 1|\mathbf{d},\,\phi ) = \sigma(\Sigma_{j}\phi_{j}^{\gamma}d_{i})\) where \(\phi_{j}^{\gamma}\) are the recognition weights into layer \(V\) and \(d_{i}\) are the activities of the input units, then:
\[\mathit{\exists}_{\gamma|\mathbf{d},\,\phi} = \prod\limits_{k = 1}^{n}q_{k}^{n}(1 - q_{k})^{1 - \gamma_{k}}\]
and so, just as in Williams' (1992) REINFORCE framework:
\[\frac{\partial}{\partial\phi_{ij}}\mathit{\exists}_{\gamma|\mathbf{d},\,\phi} = \mathit{\exists}_{\gamma|\mathbf{d},\,\phi}\frac{\partial}{\partial\phi_{ij}}\, \log\,q_{j}^{\gamma}(1 - q_{j})^{1 - \gamma_{j}}.\]
This has the leading term \(\mathit{\exists}_{\gamma|\mathbf{d},\,\phi}\) and so when it is substituted as part of the derivative, eqn (11) takes the form:
\[\frac{\partial}{\partial\phi}\left[ \mathcal{F}(\mathbf{d};\,\theta,\,\phi) \right] = \sum\limits_{\gamma}\mathit{\exists}_{\gamma|\mathbf{d},\,\phi}\,\sum\limits_{k}\mathit{\exists}_{\gamma|\mathbf{d},\,\phi}\mathcal{D}(\mathbf{d},\,\theta,\,\phi)\]
for a particular function \(\mathcal{D}\), and therefore also involves just an expectation over the recognition model. This means that it can again be calculated by averaging over recognition samples. However, whereas the derivatives with respect to \(\theta\) only involve two adjacent layers, those involving \(\phi\) are not local. The derivative with respect to a \(\phi_{ij}\) which helps determine \(\mathit{\exists}_{\gamma|\mathbf{d},\,\phi}\) depends on terms in the sum in eqn (13) from layer \(\mathcal{Z}\) and all higher layers (if there are any). Although this information is just a scalar (it is essentially the contribution to \(\mathcal{F}\) from the layers above _V_), it can be expected to be very noisy, given stochasticity in the recognition model. This will make learning very slow. Another way of looking at this is that the bandwidth of the information from higher layers used to change \(\phi_{ij}\) is very small, and as the network gets deeper, the problem gets worse; \(A_{\mathbf{RP}}\) and other static reinforcement learning algorithms suffer the same problem. However, this and its variants are the only methods of which we are aware for correctly optimizing recognition weights. | varieties.mmd |
'use strict';
module.exports = {
up: function (queryInterface, Sequelize) {
/*
Add altering commands here.
Return a promise to correctly handle asynchronicity.
Example:
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/
return queryInterface.createTable(
'procedures',
{
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true
},
rank: {
type: Sequelize.INTEGER,
defaultValue: 0,
allowNull: false
},
categoryId: {
type: Sequelize.INTEGER,
references: {
model: 'categories',
key: 'id'
}
},
createdAt: {
type: Sequelize.DATE,
defaultValue: Sequelize.NOW
},
updatedAt: {
type: Sequelize.DATE,
defaultValue: Sequelize.NOW
}
}
);
},
down: function (queryInterface, Sequelize) {
/*
Add reverting commands here.
Return a promise to correctly handle asynchronicity.
Example:
return queryInterface.dropTable('users');
*/
return queryInterface.dropTable('procedures');
}
};
| lionelrudaz/api.wellnow.ch-migrations/20161005182611-createprocedures.js |
/**
* slidebar.js
*
* (c) Copyright 2012
* Adam Kempenich
* coder12.com
*
* Mootools edition
*/
window.addEvent('domready', function() {
function slideSlideBar() {
var myHorizontalSlide = new Fx.Tween(proto_slideBarContents, {duration: slideSpeed});
if(clicked==true){
if(isExtended==0){
myHorizontalSlide.start('width', conWidth + 'px');
isExtended = 1;
$(proto_slideBarTabImage).setProperty('src', $(proto_slideBarTabImage).get('src').replace(/(\.[^.]+)$/, '-active$1'));
}
else{
myHorizontalSlide.start('width', '0px');
isExtended = 0;
$(proto_slideBarTabImage).setProperty('src', $(proto_slideBarTabImage).get('src').replace(/-active(\.[^.]+)$/, '$1'));
}
clicked=false;
}
else{
if(isExtended==0){
// PHP has already set the width to 0
}
else{
myHorizontalSlide.start('width', '0px'); // Need to queue to do automatically
myHorizontalSlide.start('width', '0px'); // Need to queue to do automatically and also change slideBar div
}
}
}
window.slideSlideBar = slideSlideBar;
}); | pepanek/familyboat-modules/mod_slidebar/scripts/slidebar-m.js |
/* $NetBSD: bitypes.h,v 1.1.1.1 2009/04/12 15:33:55 christos Exp $ */
/*
* Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1996,1999 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
/* HPUX has these, sort of. */
typedef uint32_t u_int32_t;
typedef uint16_t u_int16_t;
typedef uint8_t u_int8_t;
#endif /* __BIT_TYPES_DEFINED__ */
| execunix/vinos-external/bsd/libbind/dist/port/hpux/include/sys/bitypes.h |
UpdateRecoParam(const Int_t runNumber)
{
// Read the array of PHOS recoparam objects from OCDB and update
// EMC fitter version to "v4".
// Write the updated object to OCDB.
// Yuri Kharlov. 9.12.2011
//
/* $Id: UpdateRecoParam.C 53497 2011-12-09 12:22:47Z kharlov $ */
AliCDBManager::Instance()->SetDefaultStorage("local://./OCDB");
AliCDBManager::Instance()->SetRun(runNumber);
AliCDBEntry* cdbEntry = AliCDBManager::Instance()->Get("PHOS/Calib/RecoParam");
AliCDBMetaData *md = cdbEntry->GetMetaData();
cout << "Responsible: " << md->GetResponsible() << endl;
cout << "MD Comment : " << md->GetComment() << endl;
TObjArray* arrayRecoParam = (TObjArray*)cdbEntry->GetObject();
cout << "N recoparam = " << arrayRecoParam->GetEntries() << endl;
AliPHOSRecoParam *rp = 0;
for (Int_t i=0; i<arrayRecoParam->GetEntries(); i++) {
rp = (AliPHOSRecoParam*)arrayRecoParam->At(i);
// printf("RP %d: event specie = %d, fitter version = %s\n",
// i,rp->GetEventSpecie(),rp->EMCFitterVersion());
rp->SetEMCMinE(0.);
}
// Writing new recoparam to OCDB
AliCDBManager* cdb = AliCDBManager::Instance();
cdb->SetDefaultStorage("local://PHOSRP");
AliCDBMetaData *md= new AliCDBMetaData();
md->SetResponsible("Dmitri Peresunko");
md->SetComment("PHOS recoparameters: EMC minimum energy set to 0. Should be used only for embedding!!");
AliCDBId id("PHOS/Calib/RecoParam",80000,AliCDBRunRange::Infinity());
cdb->Put(arrayRecoParam,id, md);
}
//-----------------------------------------------------------------------------
ReadRecoParam(const Int_t runNumber)
{
// Read the array of PHOS recoparam objects from OCDB and
// print its content to stdout
AliCDBManager::Instance()->SetDefaultStorage("local://./OCDB");
AliCDBManager::Instance()->SetRun(runNumber);
AliCDBEntry* cdbEntry = AliCDBManager::Instance()->Get("PHOS/Calib/RecoParam");
AliCDBMetaData *md = cdbEntry->GetMetaData();
printf("Responsible: %s\n",md->GetResponsible());
printf("MD Comment : %s\n",md->GetComment());
TObjArray* arrayRecoParam = (TObjArray*)cdbEntry->GetObject();
AliPHOSRecoParam *rp = 0;
for (Int_t i=0; i<arrayRecoParam->GetEntries(); i++) {
rp = (AliPHOSRecoParam*)arrayRecoParam->At(i);
printf("Recoparam %d: event specie = %d\n",
i,rp->GetEventSpecie());
printf("\tEMCClusteringThreshold = %g\n",rp->GetEMCClusteringThreshold());
printf("\tEMCLocalMaxCut = %g\n",rp->GetEMCLocalMaxCut());
printf("\tEMCRawDigitThreshold = %g\n",rp->GetEMCRawDigitThreshold());
printf("\tEMCMinE = %g\n",rp->GetEMCMinE());
printf("\tEMCLogWeight = %g\n",rp->GetEMCLogWeight());
printf("\tEMCSampleQualityCut = %g\n",rp->GetEMCSampleQualityCut());
printf("\tEMCEcoreRadius = %g\n",rp->GetEMCEcoreRadius());
printf("\tEMCEcore2ESD = %d\n",rp->EMCEcore2ESD());
printf("\tEMCSubtractPedestals = %d\n",rp->EMCSubtractPedestals());
printf("\tEMCToUnfold = %d\n",rp->EMCToUnfold());
printf("\tEMCfitter version = %s\n",rp->EMCFitterVersion());
printf("\tEMCEnergyCorrectionOn = %d\n",rp->GetEMCEnergyCorrectionOn());
printf("\tGlobalAltroOffset = %f\n",rp->GetGlobalAltroOffset());
printf("\tGlobalAltroThreshold = %d\n",rp->GetGlobalAltroThreshold());
printf("\tTimeGateAmpThresh = %g\n",rp->GetTimeGateAmpThresh());
printf("\tTimeGateLow = %g\n",rp->GetTimeGateLow());
printf("\tTimeGateHigh = %g\n",rp->GetTimeGateHigh());
printf("\tNonlinearityCorrectionVersion = %s\n",rp->GetNonlinearityCorrectionVersion());
}
}
| AMechler/AliPhysics-PWGGA/PHOSTasks/PHOS_embedding/UpdateRecoParam.C |
/*
The MIT License (MIT)
Copyright (c) 2014 Microsoft Corporation
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.
*/
"use strict";
var Base = require("../base");
var MurmurHash = require('./murmurHash.js').MurmurHash;
var ConsistentHashRing = Base.defineClass(
/**
* Initializes a new instance of the ConsistentHashRing
* @param {string[]} nodes - Array of collection links
* @param {object} options - Options to initialize the ConsistentHashRing
* @param {function} options.computeHash - Function to compute the hash for a given link or partition key
* @param {function} options.numberOfVirtualNodesPerCollection - Number of points in the ring to assign to each collection link
*/
function (nodes, options) {
ConsistentHashRing._throwIfInvalidNodes(nodes);
options = options || {};
options.numberOfVirtualNodesPerCollection = options.numberOfVirtualNodesPerCollection || 128;
options.computeHash = options.computeHash || MurmurHash.hash;
this._computeHash = options.computeHash;
this._partitions = ConsistentHashRing._constructPartitions(nodes, options.numberOfVirtualNodesPerCollection, options.computeHash);
}, {
getNode: function (key) {
var hash = this._computeHash(key);
var partition = ConsistentHashRing._search(this._partitions, hash);
return this._partitions[partition].node;
}
},{
/** @ignore */
_constructPartitions: function (nodes, partitionsPerNode, computeHashFunction) {
var partitions = new Array();
nodes.forEach(function (node) {
var hashValue = computeHashFunction(node);
for (var j = 0; j < partitionsPerNode; j++) {
partitions.push({
hashValue: hashValue,
node: node
});
hashValue = computeHashFunction(hashValue);
}
});
partitions.sort(function (x, y) {
return ConsistentHashRing._compareHashes(x.hashValue, y.hashValue);
});
return partitions;
},
/** @ignore */
_compareHashes: function (x, y) {
if (x < y) return -1;
if (x > y) return 1;
return 0;
},
/** @ignore */
_search: function (partitions, hashValue) {
for (var i = 0; i < partitions.length - 1; i++) {
if (hashValue >= partitions[i].hashValue && hashValue < partitions[i + 1].hashValue) {
return i;
}
}
return partitions.length - 1;
},
/** @ignore */
_throwIfInvalidNodes: function (nodes) {
if (Array.isArray(nodes)) {
return;
}
throw new Error("Invalid argument: 'nodes' has to be an array.");
}
}
);
//SCRIPT END
if (typeof exports !== "undefined") {
exports.ConsistentHashRing = ConsistentHashRing;
} | rnagpal/azure-documentdb-node-source/lib/hash/consistentHashRing.js |
// Licensed to Cloudera, Inc. under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. Cloudera, Inc. 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.
/**
* API version 6, introduced in Cloudera Manager 5.0.0-beta-1.
*/
package com.cloudera.api.v6;
| kostin88/cm_api-java/src/main/java/com/cloudera/api/v6/package-info.java |
/**
* Created by Roman Lo on 5/27/2016.
*/
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var NotificationObserver = new Schema({
name: String,
realName: String,
email: String,
status: Number,
});
NotificationObserver.index({name: 1}, {unique: true});
module.exports = mongoose.model('Notification.Observer', NotificationObserver); | DidaTravel/aliyun-sls-webconsole-models/notification-observer.js |
package com.bumptech.glide.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Identifies methods in {@link GlideExtension} annotated classes that extend
* {@code com.bumptech.glide.request.RequestOptions}.
*
* <p>All annotated methods will be added to a single
* {@code com.bumptech.glide.request.RequestOptions} implementation generated per application.
* Overlapping method names in different extensions may cause errors at compile time.
*
* <p>Static equivalents of annotated methods will also be generated.
*
* <p>Methods with this annotation will only be found if they belong to classes annotated with
* {@link GlideExtension}.
*
* <p>The preferred way of writing extension methods returns the provided
* {@code com.bumptech.glide.request.RequestOptions} object with one or more methods called on it.
* You must not return a newly instantiated {@code com.bumptech.glide.request.RequestOptions} object
* as doing so my cause a {@code ClassCastException} at runtime. Calling either
* {@code com.bumptech.glide.request.RequestOptions#autoClone()} or
* {@code com.bumptech.glide.request.RequestOptions#lock()} is safe, but unnecessary and should
* typically be avoided. The preferred style looks like:
*
* <pre>
* {@code
* {@link @}GlideExtension
* public class MyExtension {
* private MyExtension() {}
*
* {@literal @}GlideOption
* public static RequestOptions myOption(RequestOptions options) {
* return options
* .optionOne()
* .optionTwo();
* }
* }
* }
* </pre>
*
* <p>The deprecated way of writing extension methods is simply a static void method. The
* {@code com.bumptech.glide.request.RequestOptions} object is cloned before it is passed to this
* method to avoid an option method returning a new instance, but using methods like
* {@code com.bumptech.glide.request.RequestOptions#clone()} or
* {@code com.bumptech.glide.request.RequestOptions#autoClone()} can result in options applied in
* the method being silently ignored. Prefer the new style whenever possible.
*
* <pre>
* {@code
* {@literal @}GlideExtension
* public class MyExtension {
* private MyExtension() {}
*
* // Deprecated! Use the new style of GlideOption extensions instead.
* {@literal @}GlideOption
* public static void myOption(RequestOptions options) {
* options
* .optionOne()
* .optionTwo();
* }
* }
* }
* </pre>
*/
@Target(ElementType.METHOD)
// Needs to be parsed from class files in JAR.
@Retention(RetentionPolicy.CLASS)
public @interface GlideOption {
/** Does not intend to override a method in a super class. */
int OVERRIDE_NONE = 0;
/** Expects to call super and then add additional functionality to an overridden method. */
int OVERRIDE_EXTEND = 1;
/** Expects to not call super and replace an overridden method. */
int OVERRIDE_REPLACE = 2;
/**
* Determines how and whether a generated method should extend a method from it's parent.
*
* <p>Must be one of {@link #OVERRIDE_NONE}, {@link #OVERRIDE_EXTEND}, {@link #OVERRIDE_REPLACE}.
*
* <p>The extended method is determined by String and argument matching against methods in the
* extended class. If {@link #OVERRIDE_NONE} is used and the method and arguments match a method
* in the extended class, a compile time error will result. Similarly if any other override type
* is used and no method/arguments in the extended class match, a compile time error will result.
*/
int override() default OVERRIDE_NONE;
/**
* Sets the name for the generated static version of this method.
*
* <p>If this value is not set, the static method name is just the original method name with "Of"
* appended.
*/
String staticMethodName() default "";
/**
* {@code true} to indicate that it's safe to statically memoize the result of this method using
* {@code com.bumptech.glide.request.RequestOptions#autoClone()}.
*
* <p>This method should only be used for no-arg methods where there's only a single possible
* value.
*
* <p>Memoization can save object allocations for frequently used options.
*/
boolean memoizeStaticMethod() default false;
/**
* {@code true} to prevent a static builder method from being generated.
*
* <p>By default static methods are generated for all methods annotated with
* {@link GlideOption}. These static factory methods allow for a cleaner API when used
* with {@code com.bumptech.glide.RequestBuilder#apply}. The static factory method by default
* simply creates a new {@code com.bumptech.glide.request.RequestOptions} object, calls the
* instance version of the method on it and returns it. For example:
* <pre>
* <code>
* public static GlideOptions noAnimation() {
* return new GlideOptions().dontAnimate();
* }
* </code>
* </pre>
*
* @see #memoizeStaticMethod()
* @see #staticMethodName()
*/
boolean skipStaticMethod() default false;
}
| weiwenqiang/GitHub-expert/glide/annotation/src/main/java/com/bumptech/glide/annotation/GlideOption.java |
goog.module('test_files.import_from_goog.import_from_goog');var module = module || {id: 'test_files/import_from_goog/import_from_goog.js'};/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
const tsickle_forward_declare_1 = goog.forwardDeclare("closure.Module");
goog.require("closure.Module"); // force type-only module to be loaded
const tsickle_forward_declare_2 = goog.forwardDeclare("closure.OtherModule");
goog.require("closure.OtherModule"); // force type-only module to be loaded
let /** @type {!tsickle_forward_declare_1} */ x;
let /** @type {!tsickle_forward_declare_2.SymA} */ y;
| ncfxy/tsickle-test_files/import_from_goog/import_from_goog.js |
package com.kichang.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Hex;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class Crypto2 {
static Log logger = LogFactory.getLog(Crypto2.class);
public static String hashSha512(String message) {
return getHash(message,"SHA-512");
}
public static String getHash(String message, String algorithm) {
try {
String hex = "";
byte[] buffer = message.getBytes();
MessageDigest md = MessageDigest.getInstance(algorithm);
md.update(buffer);
byte[] digest = md.digest();
for(int i = 0 ; i < digest.length ; i++) {
int b = digest[i];
String toHex = Integer.toHexString(b);
if (toHex.length() < 2) {
toHex = "0" +toHex;
} else {
toHex = toHex.substring(toHex.length()-2);
}
hex += toHex;
}
return hex;
} catch(NoSuchAlgorithmException e) {
logger.error(e.getMessage(),e);
}
return null;
}
static String iv = "86afc43868fea6abd40fbf6d5ed50905";
public static String encrypt(String data,String pass) throws Exception {
String key = getHash(pass,"MD5");
byte aesKeyData[] = Hex.decodeHex(key.toCharArray());
byte ivData[] = Hex.decodeHex(iv.toCharArray());
if (data == null || data.length() == 0)
return "";
Cipher aes = Cipher.getInstance("AES/CBC/PKCS5Padding");
SecretKeySpec secretKeySpec = new SecretKeySpec(aesKeyData, "AES");
IvParameterSpec ivParameterSpec = new IvParameterSpec(ivData);
aes.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec);
byte[] enc = aes.doFinal(data.getBytes());
//System.out.println("plain text " + data.length() + " bytes");
//System.out.println("encoded bytes " + enc.length + " bytes");
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
return encoder.encodeBuffer(enc);
}
}
| kcjang/scmutil-src/main/java/com/kichang/util/Crypto2.java |
(function() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
define(function(require) {
var Edge, Face3, Geometry, Tetrahedron, Vec3;
Vec3 = require('pex/geom/Vec3');
Face3 = require('pex/geom/Face3');
Edge = require('pex/geom/Edge');
Geometry = require('pex/geom/Geometry');
return Tetrahedron = (function(_super) {
__extends(Tetrahedron, _super);
function Tetrahedron(a) {
var edges, faces, s3, s6, vertices;
if (a == null) {
a = 1;
}
s3 = Math.sqrt(3);
s6 = Math.sqrt(6);
vertices = [new Vec3(s3 / 3 * a, -s6 / 3 * a * 0.333 + s6 * 0.025, 0), new Vec3(-s3 / 6 * a, -s6 / 3 * a * 0.333 + s6 * 0.025, a / 2), new Vec3(-s3 / 6 * a, -s6 / 3 * a * 0.333 + s6 * 0.025, -a / 2), new Vec3(0, s6 / 3 * a * 0.666 + s6 * 0.025, 0)];
faces = [new Face3(0, 1, 2), new Face3(3, 1, 0), new Face3(3, 0, 2), new Face3(3, 2, 1)];
edges = [new Edge(0, 1), new Edge(0, 2), new Edge(0, 3), new Edge(1, 2), new Edge(1, 3), new Edge(2, 3)];
Tetrahedron.__super__.constructor.call(this, {
vertices: vertices,
faces: faces,
edges: edges
});
}
return Tetrahedron;
})(Geometry);
});
}).call(this);
| szymonkaliski/pex-src/pex/geom/gen/Tetrahedron.js |
//#############################################################################
//# #
//# Copyright (C) <2014> <IMS MAXIMS> #
//# #
//# This program is free software: you can redistribute it and/or modify #
//# it under the terms of the GNU Affero General Public License as #
//# published by the Free Software Foundation, either version 3 of the #
//# License, or (at your option) any later version. #
//# #
//# This program is distributed in the hope that it will be useful, #
//# but WITHOUT ANY WARRANTY; without even the implied warranty of #
//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
//# GNU Affero General Public License for more details. #
//# #
//# You should have received a copy of the GNU Affero General Public License #
//# along with this program. If not, see <http://www.gnu.org/licenses/>. #
//# #
//#############################################################################
//#EOH
package ims.oncology.forms.chemotherapydetails;
import java.io.Serializable;
public final class ConfigFlags extends ims.framework.FormConfigFlags implements Serializable
{
private static final long serialVersionUID = 1L;
public final STALE_OBJECT_MESSAGEClass STALE_OBJECT_MESSAGE;
public ConfigFlags(ims.framework.ConfigFlag configFlags)
{
super(configFlags);
STALE_OBJECT_MESSAGE = new STALE_OBJECT_MESSAGEClass(configFlags);
}
public final class STALE_OBJECT_MESSAGEClass implements Serializable
{
private static final long serialVersionUID = 1L;
private final ims.framework.ConfigFlag configFlags;
public STALE_OBJECT_MESSAGEClass(ims.framework.ConfigFlag configFlags)
{
this.configFlags = configFlags;
}
public String getValue()
{
return (String)configFlags.get("STALE_OBJECT_MESSAGE");
}
}
}
| open-health-hub/openmaxims-linux-openmaxims_workspace/Oncology/src/ims/oncology/forms/chemotherapydetails/ConfigFlags.java |
var classforum_1_1models_1_1User =
[
[ "is_banned", "classforum_1_1models_1_1User.html#a66d18e729d81c6648661e94fb2a3827f", null ],
[ "is_mod", "classforum_1_1models_1_1User.html#af5cd7084b983b058bcf03cdf1ed9571b", null ],
[ "is_supermod", "classforum_1_1models_1_1User.html#a48a1b4f4197c5771f68e55295ec39e40", null ],
[ "modded_boards", "classforum_1_1models_1_1User.html#a0cd7b18fb56c65ca0108e0b39893f8ce", null ],
[ "num_threads", "classforum_1_1models_1_1User.html#a61e40bec96a3d6b5675b3a2bacc1be15", null ],
[ "reset_avatar", "classforum_1_1models_1_1User.html#afb984a4c88db0a0752587002f9f1beb1", null ],
[ "set_supermod", "classforum_1_1models_1_1User.html#ad61a8e96f6fa55794d1683b56fc9eb38", null ],
[ "subscribed_threads", "classforum_1_1models_1_1User.html#abdb10d958840a77c8f6fc82cfda4ec57", null ],
[ "validate_image", "classforum_1_1models_1_1User.html#a77c52f14bb1bb108dae3f486ecff6b4b", null ],
[ "avatar", "classforum_1_1models_1_1User.html#a06be3a815201419cccd4895fb112064e", null ]
]; | donkeyxote/djangle-docs/html/classforum_1_1models_1_1User.js |
#ifndef TALORION_TOF_DAQ_DLL_TOOLS_HPP
#define TALORION_TOF_DAQ_DLL_TOOLS_HPP
#include <QString>
namespace talorion {
QString get_tw_error_description(int error);
int twErrChk(int error);
} // namespace talorion
#endif // TALORION_TOF_DAQ_DLL_TOOLS_HPP
| talorion/Nephele-src/nepheleLib/data_aquisition_dll_system/tof_daq_specific/tof_daq_dll_tools.hpp |
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
var gTestfile = 'regress-452703.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 452703;
var summary = 'Do not assert with JIT: rmask(rr)&FpRegs';
var actual = 'No Crash';
var expect = 'No Crash';
printBugNumber(BUGNUMBER);
printStatus (summary);
jit(true);
(function() { for(let y in [0,1,2,3,4]) y = NaN; })();
jit(false);
reportCompare(expect, actual, summary);
| mozilla/rhino-testsrc/tests/js1_7/regress/regress-452703.js |
function next (arr) {
// http://kevin.vanzonneveld.net
// + original by: Brett Zamir (http://brett-zamir.me)
// % note 1: Uses global: php_js to store the array pointer
// * example 1: transport = ['foot', 'bike', 'car', 'plane'];
// * example 1: next(transport);
// * example 1: next(transport);
// * returns 1: 'car'
// BEGIN REDUNDANT
this.php_js = this.php_js || {};
this.php_js.pointers = this.php_js.pointers || [];
var indexOf = function (value) {
for (var i = 0, length = this.length; i < length; i++) {
if (this[i] === value) {
return i;
}
}
return -1;
};
// END REDUNDANT
var pointers = this.php_js.pointers;
if (!pointers.indexOf) {
pointers.indexOf = indexOf;
}
if (pointers.indexOf(arr) === -1) {
pointers.push(arr, 0);
}
var arrpos = pointers.indexOf(arr);
var cursor = pointers[arrpos + 1];
if (Object.prototype.toString.call(arr) !== '[object Array]') {
var ct = 0;
for (var k in arr) {
if (ct === cursor + 1) {
pointers[arrpos + 1] += 1;
return arr[k];
}
ct++;
}
return false; // End
}
if (arr.length === 0 || cursor === (arr.length - 1)) {
return false;
}
pointers[arrpos + 1] += 1;
return arr[pointers[arrpos + 1]];
}
| thebillkidy/desple.com-wp-content/themes/capsule/ui/lib/phpjs/functions/array/next.js |
import { isActionOfType } from "../../../../util/reduxHelper"
import { HoveredBuildingPathActions } from "../../appStatus/hoveredBuildingPath/hoveredBuildingPath.actions"
import { FocusedNodePathActions } from "../../dynamicSettings/focusedNodePath/focusedNodePath.actions"
import { SortingOptionActions } from "../../dynamicSettings/sortingOption/sortingOption.actions"
import { CameraTargetActions } from "../cameraTarget/cameraTarget.actions"
import { CameraActions } from "../../appSettings/camera/camera.actions"
import { ScreenshotToClipboardEnabledActions } from "../enableClipboard/screenshotToClipboardEnabled.actions"
import { ExperimentalFeaturesEnabledActions } from "../enableExperimentalFeatures/experimentalFeaturesEnabled.actions"
import { IsAttributeSideBarVisibleActions } from "../isAttributeSideBarVisible/isAttributeSideBarVisible.actions"
import { IsLoadingFileActions } from "../isLoadingFile/isLoadingFile.actions"
import { PresentationModeActions } from "../isPresentationMode/isPresentationMode.actions"
import { SortingOrderAscendingActions } from "../sortingOrderAscending/sortingOrderAscending.actions"
import { IsLoadingMapAction, IsLoadingMapActions, setIsLoadingMap } from "./isLoadingMap.actions"
import { RightClickedNodeDataActions } from "../../appStatus/rightClickedNodeData/rightClickedNodeData.actions"
import { IsEdgeMetricVisibleActions } from "../isEdgeMetricVisible/isEdgeMetricVisible.actions"
// Todo state actions explicit instead of excluding all others; refs #1547
const actionsToExclude = [
IsLoadingMapActions,
IsLoadingFileActions,
SortingOrderAscendingActions,
SortingOptionActions,
IsAttributeSideBarVisibleActions,
PresentationModeActions,
ExperimentalFeaturesEnabledActions,
IsEdgeMetricVisibleActions,
ScreenshotToClipboardEnabledActions,
HoveredBuildingPathActions,
RightClickedNodeDataActions,
FocusedNodePathActions,
CameraTargetActions,
CameraActions
]
export function isLoadingMap(state = setIsLoadingMap().payload, action: IsLoadingMapAction) {
if (action.type === IsLoadingMapActions.SET_IS_LOADING_MAP) {
return action.payload
}
if (actionsToExclude.every(excludeActions => !isActionOfType(action.type, excludeActions))) {
return true
}
return state
}
| MaibornWolff/codecharta-visualization/app/codeCharta/state/store/appSettings/isLoadingMap/isLoadingMap.reducer.ts |
var searchData=
[
['communication_5f1',['communication_1',['../classcommunication__1.html',1,'communication_1'],['../classcommunication__1.html#a03b0e85ad36aa9bac39d0fc7663c77ca',1,'communication_1::communication_1()']]]
];
| team-diana/nucleo-dynamixel-docs/html/search/all_0.js |
class Solution
{
public:
int compareVersion(string version1, string version2)
{
int i = 0;
int j = 0;
int num1 = 0;
int num2 = 0;
int len1 = version1.size();
int len2 = version2.size();
while (i < len1 || j < len2)
{
while (i < len1 && version1[i] != '.')
{
num1 = num1*10 + (version1[i]-'0');
i ++;
}
while (j < len2 && version2[j] != '.')
{
num2 = num2*10 + (version2[j]-'0');;
j ++;
}
if (num1 > num2) return 1;
else if (num1 < num2) return -1;
else
{
num1 = 0;
num2 = 0;
i ++;
j ++;
}
}
return 0;
}
}; | zszyellow/leetcode-Cpp/165_compare_version_numbers/solution.cpp |
Home Ratgeber Oktoberfest 2017 Wiesn-Hits
Eine feste Größe auf der Wiesn ist seit Jahren DJ Ötzi. Mit seinen Hits „Anton aus Tirol“ und „Hey Baby“ bringt der gebürtige Tiroler regelmäßig die Festzelte zum Kochen. Laut, tanzbar und vor allem eingängig kommen die Partykracher des Wiesn-Veteranen daher. Aber nicht nur zu moderner Popmusik feiern die Besucher im Schottenhamel , im Bräurosl , im Paulanerzelt und in der Ochsenbraterei – auch traditionelle bayrische Volksmusik ist überall zu hören. Viele Festzelte haben eigene Bands oder Blaskapellen, die für Stimmung sorgen. Dabei sind neben klassischer Blasmusik, Gesang und Jodeln auch moderne Variationen und sogar rockige Volksmusik-Stücke zu hören. Gespielt wird, was gefällt, und was die Stimmung ordentlich anheizt. | c4-de |
<div class="container-fluid">
<div class="col-xs-12">
<form class="form-horizontal">
<div class="form-group">
<div class="col-xs-2">
<div class="input-group">
<span data-preserve="true" data-preserve-type="select" data-preserve-id="Table">
<select class="form-control input-sm" id="Table" placeholder="Result">
<% _Schema.forEach(function(t){ %>
<option value="<%= t.id %>"><%= t.description %></option>
<% }) %>
</select>
</span>
</div>
</div>
<label class="control-label text-right tr" style="padding-top:5px !important;">Table</label>
</div>
</form>
</div>
<%= _.template($('#input_constructor').html())({id:"RecordId", description:tr("Record id. Leave blank to update last record obtained as resource"), default_selector: "string", disable_int:true}) %>
<div class="container-fluid">
<div class="tooltipinternal tr">Set only those fields that you want to change in the database.</div>
</div>
<% _Schema.forEach(function(t){ %>
<% t["columns"].forEach(function(c){ %>
<span data-table-id="<%= t["id"] %>" style="<%= (t["id"] != _Schema[0]["id"])?"display:none":"" %>" data-id="<%= c["id"] %>">
<% if(c["type"] == "string"){ %>
<%= _.template($('#input_constructor').html())({id:"Table_" + t["id"] + "_Column_" + c["id"], description:c["description"], default_selector: "string", disable_int:true}) %>
<% } %>
<% if(c["type"] == "int"){ %>
<%= _.template($('#input_constructor').html())({id:"Table_" + t["id"] + "_Column_" + c["id"], description:c["description"], default_selector: "expression",value_string: "", disable_string:true, min_number: -999999}) %>
<% } %>
<% if(c["type"] == "bool"){ %>
<%= _.template($('#input_constructor').html())({id:"Table_" + t["id"] + "_Column_" + c["id"], description:c["description"], size:4, default_selector: "string", disable_int:true, variants: ["true","false"]}) %>
<% } %>
<% if(c["type"] == "date"){ %>
<%= _.template($('#input_constructor').html())({id:"Table_" + t["id"] + "_Column_" + c["id"], description:c["description"], default_selector: "expression", disable_string:true}) %>
<% } %>
</span>
<% }) %>
<% }) %>
</div>
<%= _.template($('#back').html())({action:"executeandadd", visible:true}) %>
| bablosoft/BAS-Modules/Database/js/database_update_record_interface.js |
package jp.sysart.demo.akka_multiple_class_loader
import scala.concurrent.{Future, Await}
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import java.io.File
import java.net.{URLClassLoader, URL}
import akka.actor.{ActorSystem, Props, ActorRef}
class Main
object Main extends App {
val masterClassLoader = new ChildFirstClassLoader(Array(new File("master/target/scala-2.11/master-assembly-0.1.jar").toURI.toURL),
classOf[Main].getClassLoader)
val tranClassLoader = new ChildFirstClassLoader(Array(new File("tran/target/scala-2.11/tran-assembly-0.1.jar").toURI.toURL),
classOf[Main].getClassLoader)
val sysMaster = ActorSystem("masterAkka", classLoader = Some(masterClassLoader))
val sysTran = ActorSystem("tranAkka", classLoader = Some(tranClassLoader))
try {
val masterHelloRef = sysMaster.actorOf(Props(masterClassLoader.loadClass("jp.sysart.demo.akka_multiple_class_loader.HelloActor")))
val tranHelloRef = sysTran.actorOf(Props(tranClassLoader.loadClass("jp.sysart.demo.akka_multiple_class_loader.HelloActor")))
try {
masterHelloRef.tell("hello master", ActorRef.noSender)
tranHelloRef.tell("hello tran", ActorRef.noSender)
} finally {
// send PoisonKill to the actors and wait for them to die
Await.ready(Future.sequence(Seq(masterHelloRef, tranHelloRef).map { ref =>
import scala.concurrent.duration._
import scala.language.postfixOps
akka.pattern.gracefulStop(ref, 6 days) // want to say Inf
}), Duration.Inf)
}
} finally {
// terminate the actor systems
Await.ready(Future.sequence(Seq(sysMaster, sysTran).map(_.terminate)), Duration.Inf)
}
}
| ken1ma/akka-multiple-class-loader-main/src/main/scala/jp.sysart.demo.akka_multiple_class_loader/Main.scala |
/*
* kvlist.h
*
* $Id$
*
* Key/Value pair matching for DSN parsing
*
* This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
* project.
*
* Copyright (C) 1998-2014 OpenLink Software
*
* This project 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; only version 2 of the License, dated June 1991.
*
* 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 St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _KVLIST_H
#define _KVLIST_H
#define NOT_FOUND ((TKVList::index_t) -1)
class TKVList
{
public:
typedef unsigned int index_t;
void Empty (void);
index_t Find (LPCTSTR key);
index_t Define (LPCTSTR key, LPCTSTR value);
void Undefine (LPCTSTR key);
index_t Count (void);
LPCTSTR Key (index_t index);
LPCTSTR Value (index_t index);
LPCTSTR Value (LPCTSTR key);
int Get (LPCTSTR key, PTSTR value, int maxlen);
void Merge (TKVList &l);
void ReadODBCIni (LPCTSTR section, LPCTSTR names);
void WriteODBCIni (LPCTSTR section, LPCTSTR names);
void ReadFileDSN (LPCTSTR filename, LPCTSTR names);
void WriteFileDSN (LPCTSTR filename, LPCTSTR names);
void FromDSN (LPCTSTR szIn);
void FromAttributes (LPCTSTR szIn);
PTSTR ToDSN (void);
index_t DSize (void);
TKVList ();
~TKVList ();
protected:
struct TKVPair
{
PTSTR key;
PTSTR value;
};
TKVPair *pairs;
index_t numPairs;
index_t maxPairs;
index_t dsize;
};
inline TKVList::index_t
TKVList::Count (void)
{
return numPairs;
}
inline TKVList::index_t
TKVList::DSize (void)
{
return dsize;
}
inline LPCTSTR
TKVList::Key (index_t index)
{
return index < numPairs ? pairs[index].key : NULL;
}
inline LPCTSTR
TKVList::Value (index_t index)
{
return index < numPairs ? pairs[index].value : NULL;
}
inline LPCTSTR
TKVList::Value (LPCTSTR key)
{
index_t index = Find (key);
return index < numPairs ? pairs[index].value : NULL;
}
inline int
TKVList::Get (LPCTSTR key, PTSTR value, int maxlen)
{
index_t index = Find (key);
LPCTSTR v;
if (index < numPairs && (v = pairs[index].value) != NULL)
{
int len = _tcslen (v);
if (len < maxlen)
{
memcpy (value, v, len * sizeof (TCHAR));
value[len] = 0;
return len;
}
}
value[0] = 0;
return 0;
}
inline
TKVList::TKVList ()
{
numPairs = 0;
maxPairs = 0;
pairs = NULL;
dsize = 0;
}
inline
TKVList::~TKVList ()
{
Empty ();
}
#endif
| v7fasttrack/virtuoso-opensource-binsrc/virtodbc/kvlist.h |
using System;
using System.Diagnostics;
public static partial class Redux {
public static partial class Devtools {
static void log (DateTime timestamp, string text) {
System.Diagnostics.Debug.WriteLine (DateTime.Now + ": " + text);
text = text.Replace ('<', '(').Replace ('>', ')');
UnityEngine.Debug.Log (timestamp + ": <color=teal>" + text + "</color>");
}
public static Instrument instrument = (Listener listener) => {
var timeline = new Timeline();
MonitorAction monitorAction = action => {
return ActionCreators.perform(action);
};
MonitorReducerImpl monitorReducerImple = null;
monitorReducerImple = (finalReducer, stateTree, action_) => {
var action = action_ as Action;
var nextStateTree = stateTree;
switch (action.type) {
case Redux.ActionType.INIT: {
var st = new PastState(new StateTree(), DateTime.Now, action);
timeline.monitoredStates.Add(st);
timeline.monitoredStateIndex = 0;
nextStateTree = finalReducer(stateTree, action);
log (DateTime.Now, "Devtools.InitialStateTree: " + nextStateTree.ToString());
}
break;
case ActionTypes.RESET: {
var monitoredState = timeline.monitoredStates[
timeline.monitoredStateIndex = 0];
stateTree = monitoredState.stateTree;
nextStateTree = finalReducer(stateTree, monitoredState.action);
log (monitoredState.timestamp, "Devtools.InitialStateTree: " + nextStateTree);
}
break;
case ActionTypes.PERFORM: {
var a = action.to(new {
timestamp = new DateTime(),
action = new Object()
});
nextStateTree = monitorReducerImple(finalReducer, stateTree, a.action);
}
break;
case ActionTypes.JUMP_TO_STATE: {
var index = action.to<int>();
if (timeline.monitoredStateIndex == index) {
break;
}
var last = timeline.monitoredStates.Count - 1;
index = index < 0 ? 0 : index;
index = index >= last ? last : index;
var monitoredState = timeline.monitoredStates[
timeline.monitoredStateIndex = index];
log (monitoredState.timestamp, "Devtools.MonitoredStateTree: " + monitoredState.stateTree);
log (monitoredState.timestamp, "Devtools.Action: " + monitoredState.action);
stateTree = monitoredState.stateTree;
nextStateTree = finalReducer(stateTree, monitoredState.action);
log (monitoredState.timestamp, "Devtools.NextStateTree: " + nextStateTree);
}
break;
default: {
if (!timeline.timeTravling) {
var st = new PastState(stateTree, DateTime.Now, action);
timeline.monitoredStates.Add(st);
timeline.monitoredStateIndex = timeline.monitoredStates.Count - 1;
}
nextStateTree = finalReducer(stateTree, action);
log (DateTime.Now, "Devtools.NextStateTree: " + nextStateTree);
}
return nextStateTree;
}
if (listener != null) {
listener(timeline);
}
return nextStateTree;
};
MonitorReducer monitorReducer = finalReducer => (stateTree, action) => {
return monitorReducerImple (finalReducer, stateTree, action);
};
return createStore => (finalReducer, initialStateTree, enhancer) => {
var store = createStore(monitorReducer(finalReducer), initialStateTree, enhancer);
var dispatch = store.dispatch;
store.dispatch = (object action) => {
dispatch(monitorAction(action));
return action;
};
return store;
};
};
}
} | gblue1223/redux-unity3d-Redux-devTools/Instrument.cs |
import referenceSort from 'ember-cli-mirage/utils/reference-sort';
import {module, test} from 'qunit';
module('mirage:reference-sort');
test('it sorts property references', function(assert) {
let sorted = referenceSort([
['propA'],
['propB', 'propC'],
['propC', 'propA'],
['propD']
]);
assert.deepEqual(sorted, ['propD', 'propA', 'propC', 'propB']);
});
test('it throws on circular dependency', function(assert) {
assert.throws(function() {
referenceSort([
['propA', 'propB'],
['propB', 'propA']
]);
}, function(e) {
return e.toString() === 'Error: Cyclic dependency in properties ["propB","propA"]';
});
});
test('it works with no references', function(assert) {
let sorted = referenceSort([
['propA'],
['propB'],
['propC'],
['propD']
]);
assert.deepEqual(sorted, ['propD', 'propC', 'propB', 'propA']);
});
| mixonic/ember-cli-mirage-tests/unit/reference-sort-test.js |
#pragma once
//
// fx_*.c
//
// NOTENOTE This is not the best, DO NOT CHANGE THESE!
#define FX_ALPHA_LINEAR 0x00000001
#define FX_SIZE_LINEAR 0x00000100
// Bryar
void FX_BryarProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_BryarAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_BryarHitWall( vec3_t origin, vec3_t normal, int weapon, qboolean altFire );
void FX_BryarAltHitWall(vec3_t origin, vec3_t normal, int power, int weapon, qboolean altFire);
void FX_BryarHitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
// Blaster
void FX_BlasterProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_BlasterAltFireThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_BlasterWeaponHitWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_BlasterWeaponHitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
// Disruptor
void FX_DisruptorMainShot( vec3_t start, vec3_t end );
void FX_DisruptorAltShot( vec3_t start, vec3_t end, qboolean fullCharge );
void FX_DisruptorAltMiss(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_DisruptorAltHit( vec3_t origin, vec3_t normal, int weapon, qboolean altFire );
void FX_DisruptorHitWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_DisruptorHitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
// Bowcaster
void FX_WeaponProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_WeaponAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
// Heavy Repeater
void FX_WeaponProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_RepeaterAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_WeaponAltHitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
// DEMP2
void FX_DEMP2_ProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_DEMP2_AltProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
void FX_DEMP2_HitWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_DEMP2_BounceWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_DEMP2_HitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
void FX_DEMP2_AltDetonate( vec3_t org, float size );
// Golan Arms Flechette
void FX_WeaponProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
void FX_WeaponAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon );
// Personal Rocket Launcher
void FX_RocketProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
void FX_PulseRocketProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
void FX_RocketAltProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
void FX_PulseRocketAltProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
void FX_RocketHitWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_PulseRocketHitWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_RocketHitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
void FX_PulseRocketHitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
//T21
void FX_WeaponProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
// Thermals
void FX_ThermalProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
// Pulse Grenades
void FX_PulseGrenadeProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
void FX_Clonepistol_HitWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_Clonepistol_BounceWall(vec3_t origin, vec3_t normal, int weapon, qboolean altFire);
void FX_Clonepistol_HitPlayer(vec3_t origin, vec3_t normal, qboolean humanoid, int weapon, qboolean altFire);
void FX_Clonepistol_ProjectileThink(centity_t *cent, const struct weaponInfo_s *weapon);
void FX_Lightning_AltBeam(centity_t *shotby, vec3_t end, qboolean hit);
| Stoiss/Rend2-codemp/cgame/fx_local.h |
/* PR tree-optimization/52267 */
/* { dg-do run } */
/* { dg-options "-O3 -fdump-tree-ldist-details" } */
int a = 0, b = 0, c = 0;
struct S {
signed m : 7;
signed e : 2;
};
struct S f[2] = {{0, 0}, {0, 0}};
struct S g = {0, 0};
void __attribute__((noinline))
k()
{
for (; c <= 1; c++) {
f[b] = g;
f[b].e ^= 1;
}
}
int main()
{
k();
if (f[b].e != 1)
__builtin_abort ();
}
/* { dg-final { scan-tree-dump-not "Loop 1 distributed: split to 3 loops" "ldist" } } */
| Gurgel100/gcc-gcc/testsuite/gcc.dg/tree-ssa/pr94969.c |
// @flow
/* eslint no-console:0 */
/**
* This is the main entry point for KaTeX. Here, we expose functions for
* rendering expressions either to DOM nodes or to markup strings.
*
* We also expose the ParseError class to check if errors thrown from KaTeX are
* errors in the expression, or errors in javascript handling.
*/
import ParseError from "./src/ParseError";
import Settings from "./src/Settings";
import { buildTree, buildHTMLTree } from "./src/buildTree";
import parseTree from "./src/parseTree";
import utils from "./src/utils";
import type {SettingsOptions} from "./src/Settings";
import type ParseNode from "./src/ParseNode";
/**
* Parse and build an expression, and place that expression in the DOM node
* given.
*/
let render = function(
expression: string,
baseNode: Node,
options: SettingsOptions,
) {
utils.clearNode(baseNode);
const node = renderToDomTree(expression, options).toNode();
baseNode.appendChild(node);
};
// KaTeX's styles don't work properly in quirks mode. Print out an error, and
// disable rendering.
if (typeof document !== "undefined") {
if (document.compatMode !== "CSS1Compat") {
typeof console !== "undefined" && console.warn(
"Warning: KaTeX doesn't work in quirks mode. Make sure your " +
"website has a suitable doctype.");
render = function() {
throw new ParseError("KaTeX doesn't work in quirks mode.");
};
}
}
/**
* Parse and build an expression, and return the markup for that.
*/
const renderToString = function(
expression: string,
options: SettingsOptions,
): string {
//KWANG: turn on mathml
if(options.mathml === true){
const markup = renderToDomTree(expression, options).toMarkup();
return markup;
}//KWANG turn off mathml.
else{
const markup = renderToHTMLTree(expression, options).toMarkup();
return markup;
}
};
/**
* Parse an expression and return the parse tree.
*/
const generateParseTree = function(
expression: string,
options: SettingsOptions,
): ParseNode[] {
const settings = new Settings(options);
return parseTree(expression, settings);
};
/**
* Generates and returns the katex build tree. This is used for advanced
* use cases (like rendering to custom output).
*/
const renderToDomTree = function(
expression: string,
options: SettingsOptions,
) {
const settings = new Settings(options);
const tree = parseTree(expression, settings);
return buildTree(tree, expression, settings);
};
/**
* Generates and returns the katex build tree, with just HTML (no MathML).
* This is used for advanced use cases (like rendering to custom output).
*/
const renderToHTMLTree = function(
expression: string,
options: SettingsOptions,
) {
const settings = new Settings(options);
const tree = parseTree(expression, settings);
return buildHTMLTree(tree, expression, settings);
};
export default {
/**
* Renders the given LaTeX into an HTML+MathML combination, and adds
* it as a child to the specified DOM node.
*/
render,
/**
* Renders the given LaTeX into an HTML+MathML combination string,
* for sending to the client.
*/
renderToString,
/**
* KaTeX error, usually during parsing.
*/
ParseError,
/**
* Parses the given LaTeX into KaTeX's internal parse tree structure,
* without rendering to HTML or MathML.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__parse: generateParseTree,
/**
* Renders the given LaTeX into an HTML+MathML internal DOM tree
* representation, without flattening that representation to a string.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__renderToDomTree: renderToDomTree,
/**
* Renders the given LaTeX into an HTML internal DOM tree representation,
* without MathML and without flattening that representation to a string.
*
* NOTE: This method is not currently recommended for public use.
* The internal tree representation is unstable and is very likely
* to change. Use at your own risk.
*/
__renderToHTMLTree: renderToHTMLTree,
};
| kwangkim/KaTeX-katex.js |
# Copyright (C) 2012 Alexander Jones
#
# This file is part of Manitae.
#
# Manitae 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.
#
# Manitae 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 Manitae. If not, see <http://www.gnu.org/licenses/>.
from PyQt4 import QtCore
class ManitaeLogger(QtCore.QObject):
send_entry = QtCore.pyqtSignal(str)
def __init__(self):
super(ManitaeLogger, self).__init__()
def append_notice(self, notice):
temp_string = "<p style=\"margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; white-space:pre-wrap\">" + notice + "</p><br/>\n";
self.send_entry.emit(temp_string)
def append_warning(self, warning):
tempString = "<p style=\"margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; white-space:pre-wrap; color:#c00000\">" + warning + "</p><br/>\n";
self.send_entry.emit(tempString);
| happy5214/manitae-manitae/core/managers/ManitaeLogger.py |
import Vue from 'vue';
import SuggestionDiffComponent from '~/vue_shared/components/markdown/suggestion_diff.vue';
import { selectDiffLines } from '~/vue_shared/components/lib/utils/diff_utils';
const MOCK_DATA = {
canApply: true,
suggestion: {
id: 1,
diff_lines: [
{
can_receive_suggestion: false,
line_code: null,
meta_data: null,
new_line: null,
old_line: 5,
rich_text: '-test',
text: '-test',
type: 'old',
},
{
can_receive_suggestion: true,
line_code: null,
meta_data: null,
new_line: 5,
old_line: null,
rich_text: '+new test',
text: '+new test',
type: 'new',
},
{
can_receive_suggestion: true,
line_code: null,
meta_data: null,
new_line: 5,
old_line: null,
rich_text: '+new test2',
text: '+new test2',
type: 'new',
},
],
},
helpPagePath: 'path_to_docs',
};
const lines = selectDiffLines(MOCK_DATA.suggestion.diff_lines);
const newLines = lines.filter(line => line.type === 'new');
describe('Suggestion Diff component', () => {
let vm;
beforeEach(done => {
const Component = Vue.extend(SuggestionDiffComponent);
vm = new Component({
propsData: MOCK_DATA,
}).$mount();
Vue.nextTick(done);
});
describe('init', () => {
it('renders a suggestion header', () => {
expect(vm.$el.querySelector('.qa-suggestion-diff-header')).not.toBeNull();
});
it('renders a diff table with syntax highlighting', () => {
expect(vm.$el.querySelector('.md-suggestion-diff.js-syntax-highlight.code')).not.toBeNull();
});
it('renders the oldLineNumber', () => {
const fromLine = vm.$el.querySelector('.old_line').innerHTML;
expect(parseInt(fromLine, 10)).toBe(lines[0].old_line);
});
it('renders the oldLineContent', () => {
const fromContent = vm.$el.querySelector('.line_content.old').innerHTML;
expect(fromContent.includes(lines[0].text)).toBe(true);
});
it('renders new lines', () => {
const newLinesElements = vm.$el.querySelectorAll('.line_holder.new');
newLinesElements.forEach((line, i) => {
expect(newLinesElements[i].innerHTML.includes(newLines[i].new_line)).toBe(true);
expect(newLinesElements[i].innerHTML.includes(newLines[i].text)).toBe(true);
});
});
});
describe('applySuggestion', () => {
it('emits apply event when applySuggestion is called', () => {
const callback = () => {};
spyOn(vm, '$emit');
vm.applySuggestion(callback);
expect(vm.$emit).toHaveBeenCalledWith('apply', { suggestionId: vm.suggestion.id, callback });
});
});
});
| iiet/iiet-git-spec/javascripts/vue_shared/components/markdown/suggestion_diff_spec.js |
#ifndef TRANSTIMER24NOV2013
#define TRANSTIMER24NOV2013
/*
* struct to count cycles during transpose.
*/
struct trans_timer_struct {
double scopy;
double mpi;
double mpi_send_wait;
double mpi_recv_wait;
double mpi_send_post;
double mpi_recv_post;
double rcopy;
};
/*
* struct to save cycles used by send copy, mpi, recv copy.
*/
extern struct trans_timer_struct trans_timer;
/*
* Zeros all entries of struct trans_cycles.
*/
void zero_trans_timer();
#endif
| divakarvi/bk-spca-mpi/transpose/timer.hh |
myname = raw_input('what is your name: ')
print ('Your name is ' + myname)
| hamipy/learnpython-inputexamp.py |
# Kaplan Kids (Math): Which of these are independent events? Which of these are independent events?
## Question
Which of these are independent events?
## AnswerChoose the correct answer.Choose all that apply. Correct Partially correct Incorrect Don't Know
1. A
Carlos rolls a number cube and then spins the pointer on a spinner.
2. B
Paulette chooses a person from a group, and then chooses another person.
3. C
Min picks a card from a deck, keeps it, and then picks another card.
4. D
Samantha draws a marble from a bag, keeps it, and then draws a second marble.
## Explanation
Try a similar question!
#### Sorry
This question does not have an explanation yet.
Try a similar question!
Published on by Kaplan Test Prep
CCSS.Math.Content.7.SP.C.8a
Assign this pod Create New Group You don't have any group to choose from yet. Create your first one!
This pod belongs to a paid product. Group members who receive this pod as an assignment will be asked to purchase the product.
You don't have any group to choose from yet. Create your first one!
1 0 1 Choose a group or create a new one.
1 Name this group.
/ chars.
Invite students by entering their email addresses below or distributing the 6-digit alphanumeric Group Code shown after the group is created.
You can enter multiple email addresses separated by commas or new lines.
You can enter multiple email addresses separated by commas or new lines.
The email address belongs to you. You cannot add yourself as a group member. You can preview the assignment email by clicking on the "Send Test Email to Yourself" button below.
Assignment will be sent to
• x
0 2 3 Name this group.
/ chars.
The email address belongs to you. You cannot add yourself as a group member. You can preview the assignment email by clicking on the "Send Test Email to Yourself" button below.
This group does not have any members. Add new members.
• x
• x
not joined this group yet.
2 3 4 Preview and assign. A test email has been sent to you. Please check your inbox.
This assignment will be emailed to your students once they join the group via their group invites.
You already assigned this pod to this group.
2 3 4 Preview and assign. A test email has been sent to you. Please check your inbox.
This assignment will be emailed to your students once they join the group via their group invites.
You already assigned this pod to this group.
You have assigned this pod to successfully!
Using their dashboards,students can also enter the Group Code to join this group. This Code expires on .
To receive each student's results by email, please instruct your students to click on "End Practice" once they have completed the pod.
You have created new group
Using their dashboards,students can also enter the Group Code to join this group. This Code expires on .
Share
You can only add questions to pods that have not been published yet. Add to a .
Create New Draft Pod
### Description
#### Sorry
There was an error creating this pod. Please try again later.
## Resend Pending Invites
Pending invites can be resent once per day.
You are resending an invites to students:
## Invites Resent
You have reinvited students successfully!
## Resend Pending Invites
Sorry, something went wrong. Try again later, or contact us at [email protected]
## Do you really want to retake this pod?
This will delete your current answer choices and practice results. If you received this pod as an assignment, your teacher will be notified of the retake. | finemath-3plus |
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by RawMouse.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
| CookiePLMonster/RawMouse-RawMouse/resource.h |
"use strict";
import { EventEmitter } from 'events';
export const dependencies = [ "Dependency" ]
export default class ExampleDeps extends EventEmitter {
constructor(Dependency, firstArg) {
super()
this._alive = true
this._firstArg = firstArg
this._dependency = new Dependency()
}
get alive() {
return this._alive
}
get attributeFromDep() {
return this._dependency.myArg;
}
get firstArg() {
return this._firstArg;
}
set attributeFromDep(value) {
if (value) {
this._dependency.myArg = value
}
}
}
| imsnif/export-di-test/lib/exampledeps.js |
/**
* Database Utilities
* Copyright 2015 by CloudOrchestra
* Peter Beckman <[email protected]>
* Fri Mar 20 20:16:11 UTC 2015
*/
module.exports =
{
/**
* For a given array of key-value pairs, calculate the sha1 hash of the values.
* Used in the DB as the Primary Key for both data integrity and avoidance of
* an auto-increment so we can split the DB and not have to worry (as much) about
* ID collision.
*/
getDbId: function(hash)
{
var crypto = require('crypto'),
sha1sum = crypto.createHash('sha1'),
i,
len,
keys,
finalstr = '',
ret;
keys = Object.keys(hash);
keys.sort();
len = keys.length;
for (i=0; i<len; i++)
{
finalstr = finalstr + hash[keys[i]];
}
sha1sum.update(finalstr);
ret = sha1sum.digest('hex');
return ret;
}
}
| ooglek/clor-lib-index.js |
namespace base64 {
namespace avx512vbmi {
namespace precalc {
static __m512i lookup_0;
static __m512i lookup_1;
}
void initalize_lookup() {
uint8_t lookup_0[64];
uint8_t lookup_1[64];
// bytes having MSB set will be rejected earlier
for (int i=0; i < 64; i++) {
lookup_0[i] = 0x80;
lookup_1[i] = 0x80; // invalid bytes
}
for (int i=0; i < 64; i++) {
const uint8_t val = static_cast<uint8_t>(base64::lookup[i]);
const uint8_t bit6 = val & 0x40;
const uint8_t bits05 = val & 0x3f;
// Yes, I know that lookup_X could be merged and
// addressed directly by six lower bits.
if (bit6) {
lookup_1[bits05] = i;
} else {
lookup_0[bits05] = i;
}
}
precalc::lookup_0 = _mm512_loadu_si512(reinterpret_cast<__m512i*>(lookup_0));
precalc::lookup_1 = _mm512_loadu_si512(reinterpret_cast<__m512i*>(lookup_1));
}
__m512i lookup(const __m512i input) {
#define packed_byte(b) _mm512_set1_epi8(uint8_t(b))
const __m512i lookup_0 = precalc::lookup_0;
const __m512i lookup_1 = precalc::lookup_1;
// According to the documentation the MSB is not considered
// thus no masking is needed.
const __m512i translated = _mm512_permutex2var_epi8(lookup_0, input, lookup_1);
// 7th bit is set if translation failed or input already had this bit set
const uint64_t mask = _mm512_movepi8_mask(translated | input); // convert MSBs to a mask
if (mask) {
for (unsigned i=0; i < 64; i++) {
if (mask & (uint64_t(1) << i)) {
throw invalid_input(i, 0);
}
}
}
return translated;
#undef packed_byte
}
} // namespace avx512vbmi
} // namespace base64
| WojciechMula/base64simd-decode/lookup.avx512vbmi.cpp |
/*
* Hibernate OGM, Domain model persistence for NoSQL datastores
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.ogm.util.impl;
import java.util.Iterator;
/**
* Utility functions for dealing with strings.
*
* @author Davide D'Alto
* @author Emmanuel Bernard <[email protected]>
* @author Gunnar Morling
*/
public class StringHelper {
private static final String LINE_SEPARATOR;
static {
LINE_SEPARATOR = System.getProperty( "line.separator" );
}
public static boolean isEmpty(String value) {
return value != null ? value.length() == 0 : true;
}
public static boolean isNullOrEmptyString(Object value) {
return value == null || value.toString().trim().isEmpty();
}
// System#lineSeparator() is only available from Java 7 onwards
public static String lineSeparator() {
return LINE_SEPARATOR;
}
public static String toString(Object[] array) {
int len = array.length;
if ( len == 0 ) {
return "";
}
StringBuilder buf = new StringBuilder( len * 12 );
for ( int i = 0; i < len - 1; i++ ) {
buf.append( array[i] ).append( ", " );
}
return buf.append( array[len - 1] ).toString();
}
/**
* Joins the elements of the given iterable to a string, separated by the given separator string.
*
* @param iterable the iterable to join
* @param separator the separator string
* @return a string made up of the string representations of the given iterable members, separated by the given
* separator string
*/
public static String join(Iterable<?> iterable, String separator) {
if ( iterable == null ) {
return null;
}
return join( iterable.iterator(), separator );
}
public static String join(Iterator<?> iterator, String separator) {
if ( iterator == null ) {
return null;
}
StringBuilder sb = new StringBuilder();
while ( iterator.hasNext() ) {
sb.append( separator );
sb.append( iterator.next() );
}
if ( sb.length() > 0 ) {
return sb.substring( separator.length() );
}
return "";
}
/**
* If a text contains double quotes, escape them.
*
* @param text the text to escape
* @return Escaped text or {@code null} if the text is null
*/
public static String escapeDoubleQuotesForJson(String text) {
if ( text == null ) {
return null;
}
StringBuilder builder = new StringBuilder( text.length() );
for ( int i = 0; i < text.length(); i++ ) {
char c = text.charAt( i );
switch ( c ) {
case '"':
case '\\':
builder.append( "\\" );
default:
builder.append( c );
}
}
return builder.toString();
}
}
| hibernate/hibernate-ogm-core/src/main/java/org/hibernate/ogm/util/impl/StringHelper.java |
var util = require('util')
;
exports.requireHTTPS = function(req, res, next) {
//
// The 'x-forwarded-proto' check is for Heroku
//
if (!req.secure && req.get('x-forwarded-proto') !== 'https' && process.env.NODE_ENV !== "development") {
return res.redirect('https://' + req.get('host') + req.url);
}
next();
}
exports.index = function(req, res){
var gad = GLOBAL.SocketIO.Config.get('googleAnalyticsCookieDomain') ? JSON.stringify(GLOBAL.SocketIO.Config.get('googleAnalyticsCookieDomain')) : "'auto'";
res.render('index', {
title: 'cntrlc.me',
host: GLOBAL.SocketIO.Config.get('host'),
FBAppId: GLOBAL.SocketIO.Config.get('Facebook:app_id'),
debugOutput: GLOBAL.SocketIO.Config.get('frontEndDebug') || false,
googleAnalyticsCookieDomain: gad,
googleAnalyticsAct: GLOBAL.SocketIO.Config.get('googleAnalyticsAct') || 'n/a'
});
}; | jbaumbach/cntrlc.me-controllers/index.js |
import io
try:
import requests
except ImportError:
print("Requests module not installed, sync functions unavailable!")
class ResponseError(BaseException):
pass
class Route:
def __init__(self, base_url, path, cdn_url=None, method="GET", headers=None):
self.base_url = base_url
self.path = path
self.method = method
self.headers = headers
self.cdn_url = cdn_url
def sync_query(self, url_params=None):
res = getattr(requests, self.method.lower())(
self.base_url+self.path, headers=self.headers)
if 200 <= res.status_code < 300:
retval = res.json()
# Some endpoints are not images
if self.cdn_url is None:
return retval
return Result(**retval, cdn_url=self.cdn_url)
else:
raise ResponseError(
"Expected a status code 200-299, got {} \n{}"
.format(res.status_code, self.base_url+self.path))
def __call__(self, url_params=None):
return self.sync_query(url_params)
class Result:
def __init__(self, path, id, type, nsfw, cdn_url):
self.path = path
self.cdn_path = path[2:]
self.img_id = id
self.img_type = type
self.nsfw = nsfw
self.cdn_url = cdn_url
def sync_download(self):
res = requests.get(self.cdn_url+self.cdn_path)
if 200 <= res.status_code < 300:
return io.BytesIO(res.content)
else:
raise ResponseError(
"Expected a status code 200-299, got {}"
.format(res.status_code))
def __call__(self):
return self.sync_download()
| swannobi/Red-DiscordBot-cogs/utils/sync.py |
# A question about definition of "Binary Relation"
• Oct 15th 2009, 07:36 AM
Researcher
A question about definition of "Binary Relation"
Hello everybody.
Is the following definition true?
A binary relation from a set A to a set B is a subset of Cartesian product of A and B, such that in all ordered pairs there is or there is not a certain connection between the first elements (that come from A)and the second elements(that come from B). And the names of the Relations (for example the relation "greater than") describes the connection between first and second elements of ordered pairs.
If it's a true definition, then introduce a source that contains it. And if is not true, describe why.
Thanks.
• Oct 15th 2009, 10:59 AM
Swlabr
Quote:
Originally Posted by Researcher
Hello everybody.
Is the following definition true?
A binary relation from a set A to a set B is a subset of Cartesian product of A and B, such that in all ordered pairs there is or there is not a certain connection between the first elements (that come from A)and the second elements(that come from B). And the names of the Relations (for example the relation "greater than") describes the connection between first and second elements of ordered pairs.
If it's a true definition, then introduce a source that contains it. And if is not true, describe why.
Thanks.
Hi.
An interesting question, and one I must admit I am not too sure about. I have certainly never seen a binary relation defined in such a way. However, I can see no reason as to why this is not valid. Essentially it says that if we take the set of ALL ordered pairs then some of them are in the subset, and others are not. That is to say, the sets are disjoint. I am pretty sure that that is all the definition is saying, and clearly it is true. (Note that I am using "clearly" in an entirely un-rigorous sense, but I can't think of any relation where this would fail).
For instance, take the binary relation $\leq$ on $\mathbb{Z} \times \mathbb{Z}$. Clearly either $(a,b) \in S$ or $(a,b) \notin S$ as $a \leq b$ or $a \nleq b$.
Also, the bit that you made blue is merely the author (or whoever gave you the definition) making life easier for themselves. It is not really part of the definition.
• Oct 16th 2009, 12:25 AM
Researcher
Thanks.
If we don't think of the blue part as a part of the definition, is it a true statement?
• Oct 16th 2009, 02:56 AM | finemath-3plus |
// Copyright 2016 The etcd Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package clientv3
import (
pb "github.com/coreos/etcd/etcdserver/etcdserverpb"
"golang.org/x/net/context"
"google.golang.org/grpc"
)
type (
Member pb.Member
MemberListResponse pb.MemberListResponse
MemberAddResponse pb.MemberAddResponse
MemberRemoveResponse pb.MemberRemoveResponse
MemberUpdateResponse pb.MemberUpdateResponse
)
type Cluster interface {
// MemberList lists the current cluster membership.
MemberList(ctx context.Context) (*MemberListResponse, error)
// MemberAdd adds a new member into the cluster.
MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error)
// MemberRemove removes an existing member from the cluster.
MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error)
// MemberUpdate updates the peer addresses of the member.
MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error)
}
type cluster struct {
remote pb.ClusterClient
}
func NewCluster(c *Client) Cluster {
return &cluster{remote: RetryClusterClient(c)}
}
func NewClusterFromClusterClient(remote pb.ClusterClient) Cluster {
return &cluster{remote: remote}
}
func (c *cluster) MemberAdd(ctx context.Context, peerAddrs []string) (*MemberAddResponse, error) {
r := &pb.MemberAddRequest{PeerURLs: peerAddrs}
resp, err := c.remote.MemberAdd(ctx, r)
if err != nil {
return nil, toErr(ctx, err)
}
return (*MemberAddResponse)(resp), nil
}
func (c *cluster) MemberRemove(ctx context.Context, id uint64) (*MemberRemoveResponse, error) {
r := &pb.MemberRemoveRequest{ID: id}
resp, err := c.remote.MemberRemove(ctx, r)
if err != nil {
return nil, toErr(ctx, err)
}
return (*MemberRemoveResponse)(resp), nil
}
func (c *cluster) MemberUpdate(ctx context.Context, id uint64, peerAddrs []string) (*MemberUpdateResponse, error) {
// it is safe to retry on update.
for {
r := &pb.MemberUpdateRequest{ID: id, PeerURLs: peerAddrs}
resp, err := c.remote.MemberUpdate(ctx, r, grpc.FailFast(false))
if err == nil {
return (*MemberUpdateResponse)(resp), nil
}
if isHaltErr(ctx, err) {
return nil, toErr(ctx, err)
}
}
}
func (c *cluster) MemberList(ctx context.Context) (*MemberListResponse, error) {
// it is safe to retry on list.
for {
resp, err := c.remote.MemberList(ctx, &pb.MemberListRequest{}, grpc.FailFast(false))
if err == nil {
return (*MemberListResponse)(resp), nil
}
if isHaltErr(ctx, err) {
return nil, toErr(ctx, err)
}
}
}
| crobby/oshinko-cli-vendor/github.com/openshift/origin/cmd/service-catalog/go/src/github.com/kubernetes-incubator/service-catalog/vendor/github.com/coreos/etcd/clientv3/cluster.go |
var fs = require('fs');
/**
* Get the text of an SQL query from a file.
*
* @param {String} path The name of the file to read the query from, prefixed by the path relative to the project's directory, if appropriate.
* @return {String} The content of the file.
*/
function getQuery(path) {
return fs.readFileSync(__dirname + path, 'UTF-8');
}
exports.getQuery = getQuery;
function testGetQuery() {
console.log(getQuery('/commons/licensesOverTime.sql'));
}
//testGetQuery();
| gpaumier/licensing-dashboard-server/dbUtils.js |
export default angular.module('VirtualBookshelf', ['angular-growl', 'blockUI', 'ngDialog', 'angularUtils.directives.dirPagination'])
.config(function (growlProvider, blockUIConfig, paginationTemplateProvider) {
growlProvider.globalTimeToLive(2000);
growlProvider.globalPosition('top-left');
growlProvider.globalDisableCountDown(true);
blockUIConfig.delay = 0;
blockUIConfig.autoBlock = false;
blockUIConfig.autoInjectBodyBlock = false;
paginationTemplateProvider.setPath('/ui/dirPagination');
})
.run(function (main) {
main.start();
}); | Galiaf47/VirtualBookshelf-src/js/app.js |
<?php
/*
* Nota bene: this file _will_ be run through the PHP preprocessor no matter
* what its file extension is (CanvasHack is stubborn that way!)
*/
require_once 'navigation-menu.php';
if (empty($_REQUEST['current_user'])) {
echo "var canvashack = {
loadMenus: function () {
/* no user, no menu -- them's the breaks! */
}
};
";
exit;
}
?>
var canvashack = {
trays: {
<?= implode(',' . PHP_EOL, $trays) ?>
},
showMyTray: function(id) {
"use strict";
var self = this;
/* show tray */
$('.ReactTrayPortal > div').addClass('ReactTray__Overlay ReactTray__Overlay--after-open').css('position', 'fixed').css('top', '0px').css('left', '0px').css('right', '0px').css('bottom', '0px').append(this.trays[id]);
/* change menu item highlight */
var previousSelection = $('.ic-app-header__menu-list-item--active').removeClass('ic-app-header__menu-list-item--active');
$('#' + id).addClass('ic-app-header__menu-list-item--active');
$('.canvashack_tray_close').on('click', function () {
self.hideMyTray(id, previousSelection);
});
/* allow other menu items to open over this tray */
$('#menu li:not(.canvashack.global-navigation-menu)').on('click', function () {
self.hideMyTray(id);
});
$('#' + id).off('click.canvashack.global-navigation-menu').on('click.canvashack.global-navigation-menu', function () {
self.hideMyTray(id, previousSelection);
});
},
hideMyTray: function(id, previousSelection) {
"use strict";
var self = this;
/* hide my tray */
$('.ReactTrayPortal .canvashack_global-navigation-menu').remove();
$('#' + id).off('click.canvashack.global-navigation-menu').on('click.canvashack.global-navigation-menu', function() {
self.showMyTray(id);
});
/* change menu item highlight back, etc. if just closing my tray */
if (previousSelection != undefined) {
$('.ic-app-header__menu-list-item--active').removeClass('ic-app-header__menu-list-item--active');
$('.ReactTray__Overlay').css('position', '').css('top', '').css('left', '').css('right', '').css('bottom', '');
$('.ReactTray__Overlay').removeClass('ReactTray__Overlay--after-open');
previousSelection.addClass('ic-app-header__menu-list-item--active');
}
},
addMenuItem: function (title, url, svg, id, before, after) {
"use strict";
var self = this;
/* build menu item */
var menuItem =
'<li id="' + id + '" class="ic-app-header__menu-list-item canvashack_global-navigation-menu">' +
'<a href="' + url + '" class="ic-app-header__menu-list-link">' +
'<div class="menu-item-icon-container" aria-hidden="true">' +
svg +
'</div>' +
'<div class="menu-item__text">' + title + '</div>' +
'</a>' +
'</li>';
/* figure out where to put the menu item */
if(before != undefined) {
$('#menu li:has(a#' + before + ')').before(menuItem);
} else if (after !== undefined) {
$('#menu li:has(a#' + after + ')').after(menuItem);
} else {
$('#menu').append(menuItem);
}
$('#' + id + '.canvashack_global-navigation-menu svg').attr('class', 'ic-icon-svg ic-icon-svg--dashboard');
$('#' + id).on('click.canvashack.global-navigation-menu', function() {
self.showMyTray(id);
});
},
loadMenus: function() {
"use strict";
<?php
foreach ($menus as $id => $menu) {
echo "this.addMenuItem('{$menu->title}'," . (
$menu->url != '#' ?
"'{$menu->baseUrl}/click.php?" . http_build_query([
'item' => $menu->id,
'user_id' => $menu->userId,
'location' => $menu->location
]) . "'" :
"'{$menu->url}'"
) . ", '" . preg_replace('%(\n|\r|\t)%', ' ', $menu->svg) . "', 'tray{$id}');" . PHP_EOL;
}
?>
}
};
| smtech/canvashack-plugin-global-navigation-menu-navigation-menu.js |
Məktəblər açıldı artıq. Məktəbə hazırlıq müddətində uşaqlar qədər ailələri də təlaş və həyəcan içində idilər. Xüsusilə uşaqları üçün məktəb zəngi ilk dəfə çalınacaq valideynlər daha çox gərginlik yaşayırlar. Çünki “məktəb fobiyası” ilə də mübarizə aparmaq məcburiyyətində qala bilərlər. Məktəb fobiyası qoruyucu ailələrin uşaqlarında daha çox müşahidə edilir. “Gencaile.az” Aile.lent.az-a istinadən türkiyəli psixoloq İpək Özaktaçın bu haqda fikirlərini və məsləhətlərini təqdim edir.
GeriGözəllik ikonalarının makiyaj stilləri İrəliYoxlamağa dəyər 5 fərqli çay resepti | c4-az |
var gulp = require('gulp');
var contribs = require('./index');
var mocha = require('gulp-mocha');
var jshint = require('gulp-jshint');
gulp.task('lint', function () {
gulp.src(['test/*.js', 'lib/*'])
.pipe(jshint('test/.jshintrc'))
.pipe(jshint.reporter('default'))
});
gulp.task('test', function () {
gulp.src('test/*.js')
.pipe(mocha({reporter: 'nyan'}));
});
gulp.task('contribs', function () {
gulp.src('README.md')
.pipe(contribs("## Contributors", "## License"))
.pipe(gulp.dest("./"))
});
gulp.task('default', ['lint', 'test']); | shakyShane/gulp-contribs-gulpfile.js |
النفط يقترب من حاجز 50 دولاراً | وكالة المعلومة
الصفحة الرئيسية اقتصادي النفط يقترب من حاجز 50 دولاراً
النفط يقترب من حاجز 50 دولاراً
10:58 - 30/05/2016
أرتفعت أسعار النفط في بداية التعاملات، اليوم الاثنين، مع بدء ذروة طلب موسم الرحلات الصيفية رسميا في الولايات المتحدة في الوقت الذي هبط فيه انتاجها من النفط الخام إلى أدنى مستوى له منذ أيلول 2014.
وبلغ سعر التعاقدات الآجلة لخام غرب تكساس الوسيط 49.44 دولار للبرميل مرتفعا 11 سنتا عن سعر أخر إغلاق له، فيما بلغ سعر التعاقدات الآجلة لخام برنت 49.36 دولار للبرميل مرتفعا أربعة سنتات.
وقالت مجموعة استراليا ونيوزيلندا المصرفية المعروفة إن “أسعار النفط ظلت على مقربة من الوصول إلى 50 دولارا للبرميل رغم الأنباء التي قالت إن بعض شركات انتاج الرمال النفطية الكندية تعتزم استئناف العمليات”.
وتعتزم شركة سنكور انرجي لانتاج النفط زيادة الانتاج في حقولها للرمال النفطية في البرتا هذا الأسبوع بعد اضطرارها لاغلاقها في وقت سابق من أيار بسبب حرائق الغابات الضخمة.
وعلى الرغم من الارتفاع المتوقع في الانتاج الكندي قالت مجموعة (ايه.ان.زد) المصرفية إن دعم سعر خام غرب تكساس الوسيط”مازال مستمرا” بعد الهبوط الكبير في مخزونات النفط الأمريكية الأسبوع الماضي بواقع 4.2 مليون برميل إلى 537 مليون برميل بسبب الطلب القوي.
وجاء ذلك في الوقت الذي هبط فيه انتاج الولايات المتحدة من النفط الخام إلى 8.77 مليون برميل يوميا وهو أدنى مستوى له منذ أيلول 2014 وبتراجع 8.77 في المئة منذ وصوله إلى ذروته في حزيران 2015.
وفي أسواق النفط العالمية حصلت أسعار برنت على دعم من سلسلة من تعطل الإمدادات في نيجيريا حيث شن متشددون موجة هجمات على خطوط أنابيب النفط مما أدى إلى هبوط انتاج البلاد إلى أدنى مستوى له منذ أكثر من عشرين عاما.انتهى/25ر
الخبر السابقالذهب يهبط لأدنى مستوى له منذ ثلاثة أشهر والدولار يرتفع امام الين
الخبر التاليتحرير منطقة النعيمية جنوبي الفلوجة | c4-ar |
View Full Version : confused with elementary maths in compositing
mister3d01 January 2009, 05:31 PMHi dear friends. I'm trying to learn some compositing basics, and there's a multiplication operation. To me this means: rgb multiplied is let's say 2.2.2 x 2 = 4.4.4. But why the image becomes darker? If I multiply the image by alpha, it becomes black where the alpha is black and remains the same where alpha is white. Why is that? Isn't 4 is brighter value than 2? And will addition, subtraction and division do the same weird stuff? Addition 2.2.2 + 2.2.2 = 4.4.4 brighter subtraction 2.2.2 - 1.1.1 = 1.1.1 darker division 4.4.4 / 2 = 2.2.2 darker Right?
th3ta
01 January 2009, 08:20 PM
The operation multiply multiplies every pixel in image A with the corresponding pixel in image B.
So if you have a color photo (image A) and you multiply it with an alpha image (image B), then wherever there is a pixel value of 1 in your alpha (white) it will return the value that was in image A. Because 1 * any RGB value = any RGB Value.
On the other hand, if you multiply anything by 0, then you get 0 (black). That is why in your new multiplied image you get black where it is black in the alpha.
mister3d
01 January 2009, 08:33 PM
Thank you Theta.waves, I think I got it: it multiplies not 0-255 of an alpha channel value, but a normalised 0-1, so the multiplied value never exceeds 1 (the initial A image values) and only can be darkened by a smaller normalised alpha value.
CGTalk Moderation
01 January 2009, 08:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
1 | finemath-3plus |
var fs = require('fs'),
url = require('url'),
path = require('path'),
http = require('http');
module.exports = {
debug: false,
log: function(msg, type){
var self = this;
type = type ? type : 'info';
if(msg && (self.debug || (!self.debug && type != 'debug'))){
console.log((type ? '[' + type.toUpperCase() + '] ' : '') + msg);
}
},
/**
* analyze @charset first.
* @example:
* 1. @charset 'gbk';
* 2. @charset "gbk";
* @link: https://developer.mozilla.org/en/CSS/@charset
*/
detectCharset: function(input){
var result = /@charset\s+['|"](\w*)["|'];/.exec(input),
charset = 'UTF-8';
if(result && result[1]){
charset = result[1];
}
// else{
// var detect = jschardet.detect(input);
// if(detect && detect.confidence > 0.9){
// charset = detect.encoding;
// }
// }
return charset;
},
mkdirSync: function(dirpath, mode) {
var self = this;
if(!fs.existsSync(dirpath)) {
// try to create parent dir first.
self.mkdirSync(path.dirname(dirpath), mode);
fs.mkdirSync(dirpath, mode);
}
},
getRemoteFile: function(filePath, callback){
var self = this,
content = null,
buffers = [],
count = 0,
options = url.parse(filePath);
// TODO https ?
if(typeof options != 'undefined'){
// debug && console.log('start request');
var req = http.request(options, function(res){
// debug && console.log('status: ' + res.statusCode);
var charset = 'utf-8';
if(typeof res.headers['content-type'] !== 'undefined'){
var regResult = res.headers['content-type'].match(/;charset=(\S+)/);
if(regResult !== null && regResult[1]){
charset = regResult[1];
self.log('The charset of url ' + filePath + ' is: ' + charset, 'debug');
}
}
res.on('data', function(chunk){
// content += chunk;
buffers.push(chunk);
count += chunk.length;
});
res.on('end', function(){
switch(buffers.length) {
case 0: content = new Buffer(0);
break;
case 1: content = buffers[0];
break;
default:
content = new Buffer(count);
for (var i = 0, pos = 0, l = buffers.length; i < l; i++) {
var chunk = buffers[i];
chunk.copy(content, pos);
pos += chunk.length;
}
break;
}
callback && callback(content, charset);
});
});
req.on('error', function(e){
self.log('request error: ' + e, 'error');
});
req.end();
}else{
self.log('parse error: ' + filePath, 'error');
callback && callback(content);
}
}
}; | xuld/dark-apps/node_modules/css-combo/lib/utils.js |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package ContextAwarenessUnit.contextClasses;
/**
*
* @author billaros
*/
public class TopicInformationPiece {
String informationType;
String object;
public TopicInformationPiece(String informationType, String object) {
this.informationType = informationType;
this.object = object;
}
public String getInformationType() {
return informationType;
}
public void setInformationType(String informationType) {
this.informationType = informationType;
}
public String getObject() {
return object;
}
public void setObject(String object) {
this.object = object;
}
}
| Nikolopoulos/SmartHomeProject-Main_Code/MicazAggregator/src/ContextAwarenessUnit/contextClasses/TopicInformationPiece.java |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const codegen_1 = require("../../compile/codegen");
const error = {
message: ({ schemaCode }) => codegen_1.str `must be multiple of ${schemaCode}`,
params: ({ schemaCode }) => codegen_1._ `{multipleOf: ${schemaCode}}`,
};
const def = {
keyword: "multipleOf",
type: "number",
schemaType: "number",
$data: true,
error,
code(cxt) {
const { gen, data, schemaCode, it } = cxt;
// const bdt = bad$DataType(schemaCode, <string>def.schemaType, $data)
const prec = it.opts.multipleOfPrecision;
const res = gen.let("res");
const invalid = prec
? codegen_1._ `Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}`
: codegen_1._ `${res} !== parseInt(${res})`;
cxt.fail$data(codegen_1._ `(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`);
},
};
exports.default = def;
//# sourceMappingURL=multipleOf.js.map | TeamSPoon/logicmoo_workspace-packs_web/swish/web/node_modules/table/node_modules/ajv/dist/vocabularies/validation/multipleOf.js |
/*
* Written by Nitin Kumar Maharana
* [email protected]
*/
//Using bit manipulation(XOR).
class Solution {
public:
vector<int> singleNumber(vector<int>& nums) {
int allxor = 0;
for(int i: nums)
allxor ^= i;
int lastSetBit = allxor & (allxor*-1);
vector<int> result;
result.push_back(0);
result.push_back(0);
for(int i: nums)
{
if(i & lastSetBit)
result[0] ^= i;
else
result[1] ^= i;
}
return result;
}
}; | nitin-maharana/LeetCode-260.cpp |
/* Subroutines for bison
Copyright (C) 1984, 1989, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of Bison, the GNU Compiler Compiler.
Bison is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
Bison 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 Bison; see the file COPYING. If not, write to the Free
Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
#ifndef CLOSURE_H_
# define CLOSURE_H_
# include "gram.h"
/* Allocates the itemset and ruleset vectors, and precomputes useful
data so that closure can be called. n is the number of elements to
allocate for itemset. */
void new_closure (unsigned int n);
/* Given the kernel (aka core) of a state (a vector of item numbers
ITEMS, of length N), set up RULESET and ITEMSET to indicate what
rules could be run and which items could be accepted when those
items are the active ones.
RULESET contains a bit for each rule. CLOSURE sets the bits for
all rules which could potentially describe the next input to be
read.
ITEMSET is a vector of item numbers; NITEMSET is its size
(actually, points to just beyond the end of the part of it that is
significant). CLOSURE places there the indices of all items which
represent units of input that could arrive next. */
void closure (item_number *items, size_t n);
/* Frees ITEMSET, RULESET and internal data. */
void free_closure (void);
extern item_number *itemset;
extern size_t nritemset;
#endif /* !CLOSURE_H_ */
| TeamNyx/external_bison-src/closure.h |
#define UNIT_GF "GF02"
#define UNIT_MU "MU02"
#define UNIT_ST "ST02"
#define UNIT_PDS "PDS02"
#define UNIT_FG "FG02"
#define UNIT_DS "DS02"
#define UNIT_CR "CR02"
#define UNIT_CS "CS02"
#define UNIT_DR "DR02"
#define UNIT_WS "WS02"
#define UNIT_FM "FM02"
#define UNIT_DCK "SD02"
const float PlayerColor[][3] = {
{1.0,0.0,0.0},//red
{1.0,1.0,0.0},//yellow
{1.0,0.0,1.0},//purple
{0.0,1.0,0.0},//green
{0.0,1.0,1.0},//cyan
{0.0,0.0,1.0},//blue
{1.0,1.0,1.0},//white
{0.5,0.5,0.5} //gray
};
//Special Models
const char HIGH_ALERT_TOKEN[] = "high_alert";
const char FLAG[] = "flag";
//PlayerColors
const string PLAYER_COLOR_END[] = {"01","02","03","04","05","06","07","08","09"};
const string PLAYER_COLOR_FULL[] = {"Bloody","Asian","That Tasted Purple!","Orcish","Cyan and happy","Blue","White"\
,"Gray","That Looks Like Shiiiieeet"};
//Pictures
const string STRAT_A_PATH[] = {"sca_lead","sca_dipl","sca_asse","sca_prod","sca_trad","sca_warf","sca_tech","sca_bure"};
const string STRAT_B_PATH[] = {"scb_lead","scb_dipl","scb_asse","scb_prod","scb_trad","scb_warf","scb_tech","scb_bure"};
const char EMPTY_EVENT_IMG[] = "empty";
const char TACTICAL_ACTION_IMG[] = "tactical";
const char TRANSFER_ACTION_IMG[] = "transfer";
const char SYSTEM_IMG[] = "system";
const string SHIPS_IMG[] = {"U_GF","U_MU","U_ST","U_PDS","U_FG","U_DS","U_CS","U_CR","U_DR","U_WS","U_FM","U_DCK","U_SP_DCK","Sum Ting Wong"};
const string YESNO_IMG[] = {"img_Yes", "img_No"};
const string COUNTER_POOLS[] = {"CC_strat","CC_fleet","CC_comm"};
const char PLANET_IMG[] = "planet";
const char GOODS_IMG[] = "goods";
const char DICE_IMG[] = "dice";
const string TECHS_IMG[] = {"TechRed","TechGreen","TechBlue","TechYellow"};
const string OBJ_IMG[] = {"obj_preliminary", "obj_secret", "obj_public1", "obj_public2", "obj_special"};
const char ACTION_CARD[] = "action_card";
#define HEX_TAG "hex"
const char PathToTextures[] = "data/textures/";
const char PathToPStuffTextures[] = "data/textures/player_stuff/";
const char PathToUnitTextures[] = "data/textures/units/";
const char PathToCCTextures[] = "data/textures/counters/";
const char PathToSpecialTextures[] = "data/textures/specials/";
const char TextureExtension[] = ".png";
const char PathToSpecialsModel[] = "data/models/specials/";
const char PathToHexModel[] = "data/models/";
const char PathToUnitModel[] = "data/models/units/";
const char PathToCCModel[] = "data/models/counter.egg";
const char ModelsExtension[] = ".egg";
const char StardartHexFile[] = "hex";
#define PATH_TO_AA_TEXTURES "data/menu/actionarea/" | Tirvy/PC_Twi-PC_Twilight/TextPaths.cpp |
/**
* @since 2018-10-05 20:38:09
* @author vivaxy
*/
import Brick from '../../class/brick.js';
import Ball from '../../class/ball.js';
import collision from '../collision.js';
const canvas = document.querySelector('canvas');
const ctx = canvas.getContext('2d');
document.body.style.margin = '0';
canvas.style.display = 'block';
canvas.width = window.innerWidth * window.devicePixelRatio;
canvas.height = window.innerHeight * window.devicePixelRatio;
canvas.style.width = window.innerWidth + 'px';
canvas.style.height = window.innerHeight + 'px';
const BRICK_WIDTH = 400;
const BRICK_HEIGHT = 300;
const brick = new Brick((canvas.width - BRICK_WIDTH) / 2, (canvas.height - BRICK_HEIGHT) / 2, BRICK_WIDTH, BRICK_HEIGHT, 'rgb(150,200,200)');
let x = 647.020866394043;
let y = 657.2215576171875;
let a = -Math.PI * 3 / 4;
const BALL_RADIUS = 100;
const ball = new Ball(x, y, BALL_RADIUS, 'rgb(200,150,200)', 0, a);
canvas.addEventListener('touchstart', touchStartHandler);
canvas.addEventListener('touchmove', touchMoveHandler);
canvas.addEventListener('touchend', touchEndHandler);
const input = document.querySelector('input');
input.style.position = 'absolute';
input.style.display = 'block';
input.style.left = '0';
input.style.right = '0';
input.style.top = '0';
input.style.height = '30px';
input.style.margin = '0';
input.style.width = '100%';
input.value = a;
input.min = -Math.PI;
input.max = Math.PI;
input.step = 0.001;
input.addEventListener('change', handleAngleChange);
let caching = {};
loop();
function loop() {
ball.x = x;
ball.y = y;
ball.a = a;
if (!caching[`${x},${y}`]) {
collision.ballAndBrick(ball, brick);
caching[`${x},${y}`] = { a, b: ball.a };
}
ctx.clearRect(0, 0, canvas.width, canvas.height);
brick.render(ctx);
ball.render(ctx);
renderAngle(caching[`${x},${y}`].a);
renderAfterAngle(caching[`${x},${y}`].b);
requestAnimationFrame(loop);
}
function renderAngle(angle) {
const ANGLE_LENGTH = 50;
const ANGLE_COLOR = 'rgb(150,200,150)';
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(x - ANGLE_LENGTH * Math.cos(angle), y + ANGLE_LENGTH * Math.sin(angle));
ctx.closePath();
ctx.lineWidth = 5;
ctx.strokeStyle = ANGLE_COLOR;
ctx.stroke();
}
function renderAfterAngle(angle) {
const ANGLE_LENGTH = 50;
const ANGLE_COLOR = 'rgb(200,200,150)';
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(x + ANGLE_LENGTH * Math.cos(angle), y - ANGLE_LENGTH * Math.sin(angle));
ctx.closePath();
ctx.lineWidth = 5;
ctx.strokeStyle = ANGLE_COLOR;
ctx.stroke();
}
let startingPoint = null;
let startingCenter = null;
function touchStartHandler(e) {
startingPoint = getCoords(e);
startingCenter = { x, y };
}
function touchMoveHandler(e) {
const p = getCoords(e);
x = startingCenter.x + p.x - startingPoint.x;
y = startingCenter.y + p.y - startingPoint.y;
}
function touchEndHandler() {
console.log(x, y);
startingPoint = null;
startingCenter = null;
}
function getCoords(e) {
if (e.changedTouches) {
return {
x: e.changedTouches[0].clientX * window.devicePixelRatio,
y: e.changedTouches[0].clientY * window.devicePixelRatio,
};
}
return { x: e.clientX * window.devicePixelRatio, y: e.clientY * window.devicePixelRatio };
}
function handleAngleChange(e) {
a = Number(e.target.value);
}
| vivaxy/game-arkanoid/services/__tests__/collision.js |
/*
* Copyright (C) 2009-2015 Pivotal Software, Inc
*
* This program is is free software; you can redistribute it and/or modify
* it under the terms version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
({"descending":"Sestupně","ascending":"Vzestupně","nestedSort":"Vnořené řazení","unsorted":"Tento sloupec neřadit","singleSort":"Jednoduché řazení","sortingState":"${0} - ${1}"}) | pivotal/tcs-hq-management-plugin-com.springsource.hq.plugin.tcserver.serverconfig.web/src/main/webapp/dojox/grid/enhanced/nls/cs/EnhancedGrid.js |
import os
from distutils.core import setup
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
def get_package_data(package):
"""
Return all files under the root package, that are not in a
package themselves.
"""
walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
for dirpath, dirnames, filenames in os.walk(package)
if not os.path.exists(os.path.join(dirpath, '__init__.py'))]
filepaths = []
for base, filenames in walk:
filepaths.extend([os.path.join(base, filename)
for filename in filenames])
return {package: filepaths}
setup(
name='django-xdomain',
version='0.2.2',
packages=['xdomain', ],
include_package_data=True,
package_data=get_package_data('xdomain'),
license='MIT License',
author='Michael Bertolacci',
author_email='[email protected]',
url='',
long_description=open('README.md').read(),
install_requires=[
"Django >= 2.0",
],
)
| burnsred/django-xdomain-setup.py |
// some nested operation in ast
// --------------------------------
var dom = require("../dom");
var animate = require("./animate");
var combine = module.exports = {
// get the initial dom in object
node: function(item){
var children,node, nodes;
if(!item) return;
if(typeof item.node === "function") return item.node();
if(typeof item.nodeType === "number") return item;
if(item.group) return combine.node(item.group)
item = item.children || item;
if( Array.isArray(item )){
var len = item.length;
if(len === 1){
return combine.node(item[0]);
}
nodes = [];
for(var i = 0, len = item.length; i < len; i++ ){
node = combine.node(item[i]);
if(Array.isArray(node)){
for (var j = 0, len1 = node.length; j < len1; j++){
nodes.push(node[j])
}
}else if(node) {
nodes.push(node)
}
}
return nodes;
}
},
// @TODO remove _gragContainer
inject: function(node, pos ){
var group = this;
var fragment = combine.node(group.group || group);
if(node === false) {
animate.remove(fragment)
return group;
}else{
if(!fragment) return group;
if(typeof node === 'string') node = dom.find(node);
if(!node) throw Error('injected node is not found');
// use animate to animate firstchildren
animate.inject(fragment, node, pos);
}
// if it is a component
if(group.$emit) {
var preParent = group.parentNode;
var newParent = (pos ==='after' || pos === 'before')? node.parentNode : node;
group.parentNode = newParent;
group.$emit("$inject", node, pos, preParent);
}
return group;
},
// get the last dom in object(for insertion operation)
last: function(item){
var children = item.children;
if(typeof item.last === "function") return item.last();
if(typeof item.nodeType === "number") return item;
if(children && children.length) return combine.last(children[children.length - 1]);
if(item.group) return combine.last(item.group);
},
destroy: function(item, first){
if(!item) return;
if( typeof item.nodeType === "number" ) return first && dom.remove(item)
if( typeof item.destroy === "function" ) return item.destroy(first);
if( Array.isArray(item)){
for(var i = 0, len = item.length; i < len; i++ ){
combine.destroy(item[i], first);
}
}
}
}
// @TODO: need move to dom.js
dom.element = function( component, all ){
if(!component) return !all? null: [];
var nodes = combine.node( component );
if( nodes.nodeType === 1 ) return all? [nodes]: nodes;
var elements = [];
for(var i = 0; i<nodes.length ;i++){
var node = nodes[i];
if( node && node.nodeType === 1){
if(!all) return node;
elements.push(node);
}
}
return !all? elements[0]: elements;
}
| regularjs/regular-lib/helper/combine.js |
from __future__ import unicode_literals
import hashlib
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist
from django.template import resolve_variable
from django.core.cache import cache
from django.utils.encoding import force_bytes
from django.utils.http import urlquote
register = Library()
class CacheNode(Node):
def __init__(self, nodelist, expire_time_var, fragment_name, vary_on):
self.nodelist = nodelist
self.expire_time_var = Variable(expire_time_var)
self.fragment_name = fragment_name
self.vary_on = vary_on
def render(self, context):
try:
expire_time = self.expire_time_var.resolve(context)
except VariableDoesNotExist:
raise TemplateSyntaxError('"cache" tag got an unknown variable: %r' % self.expire_time_var.var)
try:
expire_time = int(expire_time)
except (ValueError, TypeError):
raise TemplateSyntaxError('"cache" tag got a non-integer timeout value: %r' % expire_time)
# Build a key for this fragment and all vary-on's.
key = ':'.join([urlquote(resolve_variable(var, context)) for var in self.vary_on])
args = hashlib.sha1(force_bytes(key))
cache_key = 'template.cache.%s.%s' % (self.fragment_name, args.hexdigest())
value = cache.get(cache_key)
if value is None:
value = self.nodelist.render(context)
cache.set(cache_key, value, expire_time)
return value
@register.tag('cache')
def do_cache(parser, token):
"""
This will cache the contents of a template fragment for a given amount
of time.
Usage::
{% load cache %}
{% cache [expire_time] [fragment_name] %}
.. some expensive processing ..
{% endcache %}
This tag also supports varying by a list of arguments::
{% load cache %}
{% cache [expire_time] [fragment_name] [var1] [var2] .. %}
.. some expensive processing ..
{% endcache %}
Each unique set of arguments will result in a unique cache entry.
"""
nodelist = parser.parse(('endcache',))
parser.delete_first_token()
tokens = token.contents.split()
if len(tokens) < 3:
raise TemplateSyntaxError("'%r' tag requires at least 2 arguments." % tokens[0])
return CacheNode(nodelist, tokens[1], tokens[2], tokens[3:])
| splunk/splunk-webframework-contrib/django/django/templatetags/cache.py |
#ifndef __SPARC_MMU_CONTEXT_H
#define __SPARC_MMU_CONTEXT_H
/* For now I still leave the context handling in the
* switch_to() macro, I'll do it right soon enough.
*/
#define get_mmu_context(x) do { } while (0)
/* Initialize the context related info for a new mm_struct
* instance.
*/
#define init_new_context(mm) ((mm)->context = NO_CONTEXT)
#endif /* !(__SPARC_MMU_CONTEXT_H) */
| carlobar/uclinux_leon3_UD-linux-2.0.x/include/asm-sparcnommu/mmu_context.h |
Traktorer 4 wd Fendt, 939 Vario SCR Profi Plus (2011) | Brugte maskiner | Maskinbladet
117.071,- (AUD) 105.860,- (CAD) 1.841.494,- (CZK) 539.000,- (DKK) 1.131.415,- (EEK) 72.118,- (EUR) 60.745,- (GBP) 249.341,- (LTL) 50.774,- (LVL) 730.237,- (NOK) 309.009,- (PLN) 760.529,- (SEK) 79.880,- (USD)
Timer:11768
Fendt 939 Vario SCR PROFI PLUS. Udstyr: Frontlift-Komfort, Luft aff. Kabine, stor Terminal, Autoguide ready, Motorbremse, Evolution sæde, Luftbremse, Hydr. Bremse, 4 udtag Hydr. bag, 1 udtag Hydr. for, LS-Hydr., ISOBUS, LED Arbejdslys og meget mere. Vi tilbyder All-risk forsikring og billig finansiering. Vi tager gerne din brugte traktor i bytte. Hør mere på 74669264, hvordan vi er din sikkerhed for efterfølgende service i høj kvalitet. Mere end 20 års erfaring som Fendt specialist. | c4-da |
//
// TTRequest.h
// TT
//
// Created by 张福润 on 2017/3/11.
// Copyright © 2017年 张福润. All rights reserved.
//
#import "TTBaseRequest.h"
/**
这个TTRequest数据请求,是针对项目中的数据请求做出的实际的操作类
在实际开发中,我们可以继承TTBaseRequest进行操作,同时,重写对外接口,我们可以尽可能的完善项目的数据请求
*/
extern NSString * const FORMAL_SERVER_URL;
extern NSString * const TEST_SERVER_URL;
@interface TTRequest : TTBaseRequest
@end
| zhangfurun/TT-TTFrameWork/NetWork/TTRequest.h |
Hjemmelavede masker til præ-teens? - Debatten
Hjemmelavede masker til præ-teens?
Indlægaf Lisma » 9. nov 2017, 18:22
Min unge holder pamber party snart. Jeg får (ca.) ti overnattende tøser der skal kræses for. Denne fest har i forvejen kostet en million-milliard og derfor tænker jeg at maskerne skal være hjemmelavede - også fordi de gerne skal være så milde, som overhovedet muligt. Sådan noget som eks. havregryn osv. Skal ikke nyde noget af nogle allergiske reaktioner midt i det hele. Men hvad er der af forslag? Jeg plejer ikke at lave ansigstsmasker selv.
Gerne noget der ikke bliver ved at være flydende/vådt i ansigtet - der er krudt i tøserne og jeg vil gerne beholde mine møbler.
Re: Hjemmelavede masker til præ-teens?
Indlægaf Mistermor » 10. nov 2017, 11:09
Jeg ved ikke, hvordan jeg skal formulere det her uden at komme til at virke enten forstokket eller fordømmende; er det normalt at invitere til den slags i Danmark? Synes de andre forældre, at det er ok?
Min datter er 28, og var hun blevet inviteret til sådan en fest - som jeg blev nødt til at google, hvad var - ville jeg nok finde på noget, som familien var nødt til at deltage i, så hun ikke kunne komme.
Har din datter været til lignende parties?
Indlægaf Akehurst2 » 10. nov 2017, 11:13
Hvis man googler hjemmelavede ansigtsmasker kommer der masser af forslag: https://www.google.be/search?hl=en&q=hj ... kwWgmJSYCw
Jeg har selv kun prøvet at lave Kodimagnyl-masken, og den vil jeg ikke anbefale til sådan en fest. Som jeg som Mistermor måske også synes lyder som lidt vel meget en fest for nogle, der er lidt ældre end pre-teens. Men en hjemmelavet ansigtsmaske med lidt havregryn er jo ret harmløs.
Indlægaf DenSyngendeLussing » 10. nov 2017, 11:36
Jeg har ikke børn, men jeg kan ikke se, hvad der skulle være i vejen for at invitere til sådan en fest. De fleste 10-12-årige piger elsker da sådan noget pigehyggedims med at lakere negle og flette hår og glitter og dims. Når Lisma oven i købet er opmærksom på, at de ikke skal have skrappe eller allergifremkaldende sager smurt i fjæset, så kan jeg måske ikke rigtigt se problemet.
Indlægaf Mistermor » 10. nov 2017, 11:42
DenSyngendeLussing skrev: Jeg har ikke børn, men jeg kan ikke se, hvad der skulle være i vejen for at invitere til sådan en fest. De fleste 10-12-årige piger elsker da sådan noget pigehyggedims med at lakere negle og flette hår og glitter og dims. Når Lisma oven i købet er opmærksom på, at de ikke skal have skrappe eller allergifremkaldende sager smurt i fjæset, så kan jeg måske ikke rigtigt se problemet.
For mig er der stor forskel på en 10 årig og en 12 årig.
Men det er jo helt sikkert et spørgsmål om, hvor meget man har lyst til, at ens datter skal fokusere på sit udseende og leve op til en bestemt "rollemodel".
Indlægaf Lisma » 10. nov 2017, 11:44
Mistermor skrev: Jeg ved ikke, hvordan jeg skal formulere det her uden at komme til at virke enten | c4-da |
/*jslint node:true */
process.stdin.pipe(process.stdout); | mattymaloney/nodeschool.io-stream-adventure-03-io.js |
__author__ = 'Dan'
__all__ = ['css', 'html', 'javascript'] | Dannnno/Quasar-Quasar/parser/__init__.py |
// Type definitions for Angular JS 1.2 (ngAnimate module)
// Project: http://angularjs.org
// Definitions by: Michel Salib <https://github.com/michelsalib>, Adi Dahiya <https://github.com/adidahiya>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="angular-1.2.d.ts" />
///////////////////////////////////////////////////////////////////////////////
// ngAnimate module (angular-animate.js)
///////////////////////////////////////////////////////////////////////////////
declare module ng.animate {
///////////////////////////////////////////////////////////////////////////
// AnimateService
// see https://code.angularjs.org/1.2.26/docs/api/ngAnimate/service/$animate
///////////////////////////////////////////////////////////////////////////
interface IAnimateService extends ng.IAnimateService {
/**
* Globally enables / disables animations.
*
* @param value If provided then set the animation on or off.
* @param element If provided then the element will be used to represent the enable/disable operation.
* @returns current animation state
*/
enabled(value?: boolean, element?: JQuery): boolean;
/**
* Appends the element to the parentElement element that resides in the document and then runs the enter animation.
*
* @param element the element that will be the focus of the enter animation
* @param parentElement the parent element of the element that will be the focus of the enter animation
* @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the enter animation
* @param doneCallback the callback function that will be called once the animation is complete
*/
enter(element: JQuery, parentElement: JQuery, afterElement?: JQuery, doneCallback?: () => void): void;
/**
* Runs the leave animation operation and, upon completion, removes the element from the DOM.
*
* @param element the element that will be the focus of the leave animation
* @param doneCallback the callback function that will be called once the animation is complete
*/
leave(element: JQuery, doneCallback?: () => void): void;
/**
* Fires the move DOM operation. Just before the animation starts, the animate service will either append
* it into the parentElement container or add the element directly after the afterElement element if present.
* Then the move animation will be run.
*
* @param element the element that will be the focus of the move animation
* @param parentElement the parent element of the element that will be the focus of the move animation
* @param afterElement the sibling element (which is the previous element) of the element that will be the focus of the move animation
* @param doneCallback the callback function that will be called once the animation is complete
*/
move(element: JQuery, parentElement: JQuery, afterElement?: JQuery, doneCallback?: () => void): void;
/**
* Triggers a custom animation event based off the className variable and then attaches the className
* value to the element as a CSS class.
*
* @param element the element that will be animated
* @param className the CSS class that will be added to the element and then animated
* @param doneCallback the callback function that will be called once the animation is complete
*/
addClass(element: JQuery, className: string, doneCallback?: () => void): void;
/**
* Triggers a custom animation event based off the className variable and then removes the CSS class
* provided by the className value from the element.
*
* @param element the element that will be animated
* @param className the CSS class that will be animated and then removed from the element
* @param doneCallback the callback function that will be called once the animation is complete
*/
removeClass(element: JQuery, className: string, doneCallback?: () => void): void;
/**
* Adds and/or removes the given CSS classes to and from the element. Once complete, the done() callback
* will be fired (if provided).
*
* @param element the element which will have its CSS classes changed removed from it
* @param add the CSS classes which will be added to the element
* @param remove the CSS class which will be removed from the element CSS classes have been set on the element
* @param doneCallback done the callback function (if provided) that will be fired after the CSS classes have been set on the element
*/
setClass(element: JQuery, add: string, remove: string, doneCallback?: () => void): void;
}
///////////////////////////////////////////////////////////////////////////
// AngularProvider
// see https://code.angularjs.org/1.2.26/docs/api/ngAnimate/provider/$animateProvider
///////////////////////////////////////////////////////////////////////////
interface IAnimateProvider {
/**
* Registers a new injectable animation factory function.
*
* @param name The name of the animation.
* @param factory The factory function that will be executed to return the animation object.
*/
register(name: string, factory: () => ng.IAnimateCallbackObject): void;
/**
* Gets and/or sets the CSS class expression that is checked when performing an animation.
*
* @param expression The className expression which will be checked against all animations.
* @returns The current CSS className expression value. If null then there is no expression value.
*/
classNameFilter(expression?: RegExp): RegExp;
}
}
| petervyvey/home_automation-web/public/vendor/typings/angularjs/legacy/angular-animate-1.2.d.ts |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Testresult.errorstate'
db.delete_column('eukalypse_now_testresult', 'errorstate')
# Adding field 'Testresult.error_acknowledged'
db.add_column('eukalypse_now_testresult', 'error_acknowledged',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
# Adding field 'Testresult.error_reference_updated'
db.add_column('eukalypse_now_testresult', 'error_reference_updated',
self.gf('django.db.models.fields.BooleanField')(default=False),
keep_default=False)
def backwards(self, orm):
# Adding field 'Testresult.errorstate'
db.add_column('eukalypse_now_testresult', 'errorstate',
self.gf('django.db.models.fields.CharField')(default='default', max_length=20),
keep_default=False)
# Deleting field 'Testresult.error_acknowledged'
db.delete_column('eukalypse_now_testresult', 'error_acknowledged')
# Deleting field 'Testresult.error_reference_updated'
db.delete_column('eukalypse_now_testresult', 'error_reference_updated')
models = {
'eukalypse_now.project': {
'Meta': {'object_name': 'Project'},
'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
'notify_mail': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'notify_only_error': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'notify_recipient': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
},
'eukalypse_now.test': {
'Meta': {'object_name': 'Test'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'identifier': ('django.db.models.fields.SlugField', [], {'max_length': '200'}),
'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'tests'", 'to': "orm['eukalypse_now.Project']"}),
'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}),
'wait': ('django.db.models.fields.IntegerField', [], {'default': '0'})
},
'eukalypse_now.testresult': {
'Meta': {'object_name': 'Testresult'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'error': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'error_acknowledged': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'error_reference_updated': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
'errorimage': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'errorimage_improved': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'referenceimage': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'resultimage': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
'test': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['eukalypse_now.Test']"}),
'testrun': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'testresult'", 'to': "orm['eukalypse_now.Testrun']"})
},
'eukalypse_now.testrun': {
'Meta': {'object_name': 'Testrun'},
'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'error': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'testrun'", 'null': 'True', 'to': "orm['eukalypse_now.Project']"})
}
}
complete_apps = ['eukalypse_now'] | kinkerl/eukalypse_now-src/eukalypse_now/migrations/0006_auto__del_field_testresult_errorstate__add_field_testresult_error_ackn.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.