text
stringlengths
3
181k
src
stringlengths
5
1.02k
/* $Id: hscx.h,v 1.1.1.1 2014/04/24 07:02:18 jkong Exp $ * * HSCX specific defines * * Author Karsten Keil * Copyright by Karsten Keil <[email protected]> * * This software may be used and distributed according to the terms * of the GNU General Public License, incorporated herein by reference. * */ /* All Registers original Siemens Spec */ #define HSCX_ISTA 0x20 #define HSCX_CCR1 0x2f #define HSCX_CCR2 0x2c #define HSCX_TSAR 0x31 #define HSCX_TSAX 0x30 #define HSCX_XCCR 0x32 #define HSCX_RCCR 0x33 #define HSCX_MODE 0x22 #define HSCX_CMDR 0x21 #define HSCX_EXIR 0x24 #define HSCX_XAD1 0x24 #define HSCX_XAD2 0x25 #define HSCX_RAH2 0x27 #define HSCX_RSTA 0x27 #define HSCX_TIMR 0x23 #define HSCX_STAR 0x21 #define HSCX_RBCL 0x25 #define HSCX_XBCH 0x2d #define HSCX_VSTR 0x2e #define HSCX_RLCR 0x2e #define HSCX_MASK 0x20 extern int HscxVersion(struct IsdnCardState *cs, char *s); extern void modehscx(struct BCState *bcs, int mode, int bc); extern void clear_pending_hscx_ints(struct IsdnCardState *cs); extern void inithscx(struct IsdnCardState *cs); extern void inithscxisac(struct IsdnCardState *cs, int part);
andyhui/linux-kernel-3.12.17-drivers/isdn/hisax/hscx.h
""" Benchmarks for ``@vectorize`` ufuncs. """ import numpy as np from numba import vectorize @vectorize(["float32(float32, float32)", "float64(float64, float64)", "complex64(complex64, complex64)", "complex128(complex128, complex128)"]) def mul(x, y): return x * y @vectorize(["float32(float32, float32)", "float64(float64, float64)"]) def rel_diff(x, y): # XXX for float32 performance, we should write `np.float32(2)`, but # that's not the natural way to write this code... return 2 * (x - y) / (x + y) class Vectorize: n = 10000 dtypes = ('float32', 'float64', 'complex64', 'complex128') def setup(self): self.samples = {} self.out = {} for dtype in self.dtypes: self.samples[dtype] = np.linspace(0.1, 1, self.n, dtype=dtype) self.out[dtype] = np.zeros(self.n, dtype=dtype) def _binary_func(func, dtype): def f(self): func(self.samples[dtype], self.samples[dtype], self.out[dtype]) return f for dtype in dtypes: locals()['time_mul_%s' % dtype] = _binary_func(mul, dtype) time_rel_diff_float32 = _binary_func(rel_diff, 'float32') time_rel_diff_float64 = _binary_func(rel_diff, 'float64') del _binary_func
gmarkall/numba-benchmark-benchmarks/bench_vectorize.py
scalingValues = ["1", "2", "3", "1/2"] // Both plural to plural and non-plural to plural plural_mappings = {"Cups": "Cups", "Tablespoons": "Tablespoons", "Teaspoons": "Teaspoons", "Pounds": "Pounds", "Cans": "Cans", "Ounces": "Ounces", "Cloves": "Cloves", "Pinches": "Pinches", "Dashes": "Dashes", "Bottles": "Bottles", "Cup": "Cups", "Tablespoon": "Tablespoons", "Teaspoon": "Teaspoons", "Pound": "Pounds", "Can": "Cans", "Ounce": "Ounces", "Clove": "Cloves", "Pinch": "Pinches", "Dash": "Dashes", "Bottle": "Bottles"} // Both plural to non-plural and non-plural to non-plural non_plural_mappings = {"Cups": "Cup", "Tablespoons": "Tablespoon", "Teaspoons": "Teaspoon", "Pounds": "Pound", "Cans": "Can", "Ounces": "Ounce", "Cloves": "Clove", "Pinches": "Pinch", "Dashes": "Dash", "Bottles": "Bottle", "Cup": "Cup", "Tablespoon": "Tablespoon", "Teaspoon": "Teaspoon", "Pound": "Pound", "Can": "Can", "Ounce": "Ounce", "Clove": "Clove", "Pinch": "Pinch", "Dash": "Dash", "Bottle": "Bottle"} recipeIterator = 0 function rescaleRecipe(){ recipeIterator = (recipeIterator + 1) % scalingValues.length; var button = document.getElementById("scalingButton"); button.innerText = scalingValues[recipeIterator] + "X"; updateRecipe(scalingValues[recipeIterator]) } function updateRecipe(scaling_factor){ var elements = document.getElementsByClassName("recipeNumber"); for(i = 0; i < elements.length; i++){ raw_fraction = processInputNumber(elements[i].attributes.value.value) scaling_fraction = processInputNumber(scaling_factor) raw_fraction[0] *= scaling_fraction[0] raw_fraction[1] *= scaling_fraction[1] elements[i].innerText = processOutputNumber(raw_fraction) is_plural = raw_fraction[0] > raw_fraction[1] unit_id = elements[i].id.replace('recipeNumber', 'recipeUnit') unit_element = document.getElementById(unit_id) unit_element.innerText = handlePlural(unit_element.innerText, is_plural) } } function handlePlural(input_text, plural_logical){ input_text = input_text.trim() if(input_text == "Whole"){ return("Whole") } if(plural_logical){ return(plural_mappings[input_text]) }else{ return(non_plural_mappings[input_text]) } } // Function for cleaning split arrays Array.prototype.clean = function(deleteValue) { for (var i = 0; i < this.length; i++) { if (this[i] == deleteValue) { this.splice(i, 1); i--; } } return this; }; // Takes string and returns [numerator, denominator] function processInputNumber(string){ var splits = string.split(" ").clean("") if(splits.length == 1){ inner_splits = splits[0].split("/") if(inner_splits.length == 1){ return [Number(inner_splits[0]), 1.0] }else{ if(inner_splits.length == 2){ return [Number(inner_splits[0]), Number(inner_splits[1])] }else{ throw "Improper string, can't parse " + splits[0] } } }else{ if(splits.length == 2){ processed_numbers = processInputNumber(splits[1]) output_numerator = processed_numbers[0] + Number(splits[0]) * processed_numbers[1] return [output_numerator, processed_numbers[1]] }else{ throw "Improper string, can't parse " + string } } } // This function was adapted from a hero on Stack Overflow function reduce_fraction(numerator,denominator){ var find_greatest_common_divisor = function find_greatest_common_divisor(a,b){ return b ? find_greatest_common_divisor(b, a%b) : a; }; greatest_common_divisor = find_greatest_common_divisor(numerator,denominator); return [numerator/greatest_common_divisor, denominator/greatest_common_divisor]; } // Takes [numerator, denominator] and returns string of mixed number function processOutputNumber(input_array){ var leading_integer = parseInt(input_array[0] / input_array[1]) var fraction_numerator = input_array[0] % input_array[1] var output_string = "" if(leading_integer > 0){ output_string += String(leading_integer) if(fraction_numerator > 0){ output_string += " " } } if(fraction_numerator > 0){ fraction_denominator = input_array[1] reduced_fraction = reduce_fraction(fraction_numerator, fraction_denominator) output_string += String(reduced_fraction[0]) + "/" + String(reduced_fraction[1]) } return output_string }
jmwerner/recipes-website/assets/js/recipeScaling.js
const ipv4 = '\\d{1,3}(?:\\.\\d{1,3}){3}'; const ipv6 = '[0-9a-f]{0,4}(?::[0-9a-f]{0,4}){2,7}'; const address = `${ipv4}|${ipv6}`; const host = '[a-z0-9\\-]+(?:\\.[a-z0-9\\-]+)*'; const comment = '#.*'; const hostSep = ',|\\s|#'; const hostEntry = `^\\s*(${address})((?:\\s+${host})+)\\s*(${comment})?$`; const commentedHostEntry = hostEntry.replace('^', '^\\s*#\\s*'); export const addressRegex = new RegExp(`^${address}$`, 'i'); export const hostRegex = new RegExp(`^${host}$`, 'i'); export const inlineHostRegex = new RegExp(`(?:^|${hostSep})(${host})(?:${hostSep}|$)`, 'ig'); export const blankLineRegex = /^\s*$/; export const hostEntryRegex = new RegExp(hostEntry, 'i'); export const commentedHostRegex = new RegExp(commentedHostEntry, 'i'); export const commentLineRegex = new RegExp(`^\\s*${comment}$`);
DullReferenceException/hostfile-utils-src/patterns.js
Podmínky OB21-OP-EL-KONP-JANC-M-3-026 Podmínky  Podmínky slouží v programu k rozhodování, tj. k větvení programu.  Větvit program můžeme na základě porovnávání, jehož výsledkem je pravda (logiká 1) anebo nepravda (logická 0).  Můžeme také zkoumat obsah nějaké proměnné a podle hodnoty jaké nabývá můžeme větvit program.  Při porovnávání jde tedy o zpracování logické funkce podle zákonů Booleovy algebry. Podmínky  Mezi základní logické funkce patří:  Logický součet  Logický součin  Negace  Proměnná logické funkce může nabývat jen dvou hodnot, a to logické nuly a logické jedné. Stejně tak hodnoty logických funkcí mohou nabývat jen dvou hodnot – logické nuly a logické jedničky. Podmínky  Logický součet  Může být funkce dvou nebo více logických proměnných.  Funkce nabývá hodnoty logické jedné tehdy, když aspoň jedna ze vstupních proměnných logického součtu nabývá hodnoty logické 1.  Logický součin dvou proměnných a, b je označovaný jako OR. Označíme-li výstup logického obvodu y, pak logický součin zapíšeme jako  y = a + b Podmínky aby 000 011 101 111 Pravdivostní tabulka logického součtu dvou proměnných Podmínky  Logický součin  Může být opět funkce dvou nebo více proměnných.  Funkce nabývá hodnoty logické nuly tehdy, když aspoň jedna ze vstupních proměnných logického součinu nabývá hodnoty logické nuly. Na to aby funkce nabyla hodnoty logické jedné je tedy nutné, aby všechny její vstupní proměnné nabyly hodnotu logické jedné.  Logický součin dvou proměnných je označovaný jako AND. Při stejném značení ho můžeme zapsat vztahem  y= a. b Podmínky  aby 000 010 100 111 Pravdivostní tabulka logického součinu dvou proměnných Podmínky  Negace  Negace je logická funkce jedné logické proměnné.  Funkce nabývá opačné hodnoty jakou má vstupní proměnná.  Označuje se jako NOT.  Při stejném značení je tedy dána vztahy  y =  anebo y =  b Podmínky ay 01 10 Pravdivostní tabulka negace Podmínky  Soubor těchto tří logických funkcí tvoří úplný systém logických funkcí, protože jejich kombinací můžeme navrhnout jakoukoliv logickou funkci.  Tak například dvě funkce AND a NOT nebo OR a NOT nám stačí pro vyjádření jakékoliv logické funkce. Podmínky  Dalšími významnými funkcemi jsou:  NAND negovaný logický součin  NOR negovaný logický součet  Rovněž pomocí funkcí NAND a NOR můžeme vyjádřit a realizovat každou logickou funkci. Podmínky  Nonekvivalence  Tato funkce nabývá hodnoty 1, jsou-li hodnoty obou proměnných různé.  Tato funkce se nazývá Exclusive OR a značí se XOR.  Ekvivalence, XNOR  Funkce ekvivalence nabývá hodnoty 1, jsou-li hodnoty obou vstupních
c4-cs
import { render, define, h } from '../../src/omi' const store = { data: { count: 1 }, done: [], undone: [] } store.sub = () => { store.data.count-- } store.add = () => { store.data.count++ } store.reset = () => { store.data.count = 1 } store.redo = () => { store._commit(store.undone.pop(), true) } store.undo = () => { store.undone.push(store.done.pop()) store.reset() store.done.forEach(action => { store._commit(action) }) } store._commit = (action, record) => { if (record) store.done.push(action) store.exec(action) } store.commit = (action) => { store.undone.length = 0 store.done.push(action) store.exec(action) } store.exec = (action) => { switch (action) { case 'add': store.add() break case 'sub': store.sub() break } } define('my-counter', _ => <h.f> <button disabled={!_.store.done.length} onClick={_.store.undo}>undo</button> <button disabled={!_.store.undone.length} onClick={_.store.redo}>redo</button> <br/> <button onClick={() => _.store.commit('sub')}>-</button> <span>{_.store.data.count}</span> <button onClick={() => _.store.commit('add')}>+</button> </h.f> , { use: ['count'] }) render(<my-counter />, 'body', store)
AlloyTeam/Nuclear-packages/omi/examples/store-tt/main.js
// Create an anonymous iframe. The new document will execute any scripts sent // toward the token it returns. const newAnonymousIframe = (child_origin, opt_headers) => { opt_headers ||= ""; const sub_document_token = token(); let iframe = document.createElement('iframe'); iframe.src = child_origin + executor_path + opt_headers + `&uuid=${sub_document_token}`; iframe.anonymous = true; document.body.appendChild(iframe); return sub_document_token; }; // Create a normal iframe. The new document will execute any scripts sent // toward the token it returns. const newIframe = (child_origin) => { const sub_document_token = token(); let iframe = document.createElement('iframe'); iframe.src = child_origin + executor_path + `&uuid=${sub_document_token}`; iframe.anonymous = false document.body.appendChild(iframe); return sub_document_token; }; // Create a popup. The new document will execute any scripts sent toward the // token it returns. const newPopup = (test, origin) => { const popup_token = token(); const popup = window.open(origin + executor_path + `&uuid=${popup_token}`); test.add_cleanup(() => popup.close()); return popup_token; } // Create a fenced frame. The new document will execute any scripts sent // toward the token it returns. const newFencedFrame = (child_origin) => { const support_loading_mode_fenced_frame = "|header(Supports-Loading-Mode,fenced-frame)"; const sub_document_token = token(); const fencedframe = document.createElement('fencedframe'); fencedframe.src = child_origin + executor_path + support_loading_mode_fenced_frame + `&uuid=${sub_document_token}`; document.body.appendChild(fencedframe); return sub_document_token; }; const importScript = (url) => { const script = document.createElement("script"); script.type = "text/javascript"; script.src = url; const loaded = new Promise(resolve => script.onload = resolve); document.body.appendChild(script); return loaded; }
chromium/chromium-third_party/blink/web_tests/external/wpt/html/cross-origin-embedder-policy/anonymous-iframe/resources/common.js
module.exports = { WebcoderActionTypes: { HIDE_FILE_FINDER: Symbol('HIDE_FILE_FINDER'), OPEN_FILE_ENTRY: Symbol('OPEN_FILE_ENTRY'), SAVE_FILE: Symbol('SAVE_FILE'), SET_EDIT_SESSION: Symbol('SET_EDIT_SESSION'), SHOW_FILE_FINDER: Symbol('SHOW_FILE_FINDER'), UPDATE_FILE_FINDER_QUERY: Symbol('UPDATE_FILE_FINDER_QUERY'), }, ActionTypes: { SHOW_ALERT: 'SHOW_ALERT', CLEAR_ALERT: 'CLEAR_ALERT', }, };
mjlyons/webcoder-js/client/Constants.js
(function( factory ) { if ( typeof define === "function" && define.amd ) { define( ["../../../jquery/jquery", "../jquery.validate"], factory ); } else { factory( jQuery ); } }(function( $ ) { /* * Translated default messages for the jQuery validation plugin. * Locale: GL (Galician; Galego) */ (function($) { $.extend($.validator.messages, { required: "Este campo é obrigatorio.", remote: "Por favor, cubre este campo.", email: "Por favor, escribe unha dirección de correo válida.", url: "Por favor, escribe unha URL válida.", date: "Por favor, escribe unha data válida.", dateISO: "Por favor, escribe unha data (ISO) válida.", number: "Por favor, escribe un número válido.", digits: "Por favor, escribe só díxitos.", creditcard: "Por favor, escribe un número de tarxeta válido.", equalTo: "Por favor, escribe o mesmo valor de novo.", extension: "Por favor, escribe un valor cunha extensión aceptada.", maxlength: $.validator.format("Por favor, non escribas máis de {0} caracteres."), minlength: $.validator.format("Por favor, non escribas menos de {0} caracteres."), rangelength: $.validator.format("Por favor, escribe un valor entre {0} e {1} caracteres."), range: $.validator.format("Por favor, escribe un valor entre {0} e {1}."), max: $.validator.format("Por favor, escribe un valor menor ou igual a {0}."), min: $.validator.format("Por favor, escribe un valor maior ou igual a {0}."), nifES: "Por favor, escribe un NIF válido.", nieES: "Por favor, escribe un NIE válido.", cifES: "Por favor, escribe un CIF válido." }); }(jQuery)); }));
himanshuawasthi/dell-ui-components-bower_components/jquery-validation-1.13.1/dist/localization/messages_gl.js
“መናገር የማልፈልገው ብዙ ነገር አለ” ብጹእ አቡነ ሕዝቅኤል | unity is power January 28, 2013 By Addisu Abiy “ቤተክርስቲያናችን ከግብጽ ባርነት ወጥታ ራሷን ችላ እየተራመደች በመሆኗ ከእነሱ የምትዋሰው ነገር የላትም፡፡” ብጹእ አቡነ ሕዝቅኤል የቅ/ሲኖዶሱን ውሳኔ የተቃወሙት ዋና ጸሐፊው ብፁዕ አቡነ ሕዝቅኤል የሥልጣን መልቀቂያ ደብዳቤ አቀረቡ ……. Haratewahedo “ራሴን ከቅዱስ ሲኖዶስ አግልዬ ብሆን ኖሮ እዚህ አታገኙኝም ነበር፡፡” ብጹእ አቡነ ሕዝቅኤል አቡነ ሕዝቅኤል፡- ምን መሰለህ እኛ የምንመራበት የስርዓት መጽሐፍ አለን፡፡ መጽሐፉ ይህንን በግልጽያስቀምጠዋል፡፡ ቤተክርስቲያኒቱ ነገሮችን በግልጽ የምታስኬድበት መመሪያ አላት፡፡ ሲኖዶሱ የሚመራው በእነዚህ መመሪያ ነው፡፡ ነገር ግን የምዕመናንን ድምጽ ሲኖዶስ አያዳምጥም ማለት ተገቢ አይደለም ፡፡ ድምጻቸው የሚደመጥበት የራሱ የሆነ መንገድ አለው፡፡ አቡነ ሕዝቅኤል፡- ማነው እንደዚህ ያለው ? እንግዲህ እናንተ ብዙ ታወራላችሁና እኔ የምጨምረው ነ�
c4-am
/* Copyright (C) 2000, 2001 Silicon Graphics, Inc. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it would be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, this software is distributed without any warranty that it is free of the rightful claim of any third person regarding infringement or the like. Any license provided herein, whether implied or otherwise, applies only to this software file. Patent licenses, if any, provided herein do not apply to combinations of this program with other software, or any other product whatsoever. You should have received a copy of the GNU General Public License along with this program; if not, write the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pky, Mountain View, CA 94043, or: http://www.sgi.com For further information regarding this notice, see: http://oss.sgi.com/projects/GenInfo/NoticeExplan */ #ifndef targ_em_elf_INCLUDED #define targ_em_elf_INCLUDED #ifdef __cplusplus extern "C" { #endif struct section_info { Elf_Scn *scnptr; /* ptr to the elf section. */ char *buffer; /* data buffer for section. */ Elf64_Xword limit; /* maximum size of data buffer. */ Elf64_Xword size; /* current size of data buffer. */ Elf64_Xword offset; /* current offset in data buffer. */ Elf64_Word align; /* alignment of the section. */ Elf64_Word scnidx; /* symbol index of the section symbol. */ pSCNINFO relinfo; /* associated REL section. */ pSCNINFO relainfo; /* associated RELA section. */ pSCNINFO events; /* associated EVENTS section. */ Elf64_Word ev_offset; /* offset of last entry in events scn. */ pSCNINFO contents; /* associated CONTENTS section. */ Elf64_Word con_offset; /* offset of last entry in contents scn. */ }; #define SCNINFO_scnptr(t) ((t)->scnptr) #define SCNINFO_buffer(t) ((t)->buffer) #define SCNINFO_limit(t) ((t)->limit) #define SCNINFO_size(t) ((t)->size) #define SCNINFO_offset(t) ((t)->offset) #define SCNINFO_align(t) ((t)->align) #define SCNINFO_scnidx(t) ((t)->scnidx) #define SCNINFO_relinfo(t) ((t)->relinfo) #define SCNINFO_relainfo(t) ((t)->relainfo) #define SCNINFO_events(t) ((t)->events) #define SCNINFO_ev_offset(t) ((t)->ev_offset) #define SCNINFO_contents(t) ((t)->contents) #define SCNINFO_con_offset(t) ((t)->con_offset) #define SCNINFO_index(t) (elf_ndxscn(SCNINFO_scnptr(t))) extern char *Get_Section_Name (pSCNINFO scninfo); extern void Generate_Addr_Reset (pSCNINFO scn, BOOL is_events, Elf64_Xword ev_ofst); extern void Set_Current_Location (pSCNINFO scn, BOOL is_events, Elf64_Word ev_ofst); extern pSCNINFO Interface_Scn; /* this defines the common, other than name and enum value, * parts of code for both IA-64 and Mips */ /* * relocations that are the same other than the enum */ #define R_WORD32 (Big_Endian ? R_IA_64_DIR32MSB : R_IA_64_DIR32LSB) #define R_WORD64 (Big_Endian ? R_IA_64_DIR64MSB : R_IA_64_DIR64LSB) #define R_SCN_DISP (Big_Endian ? R_IA_64_SECREL64MSB : R_IA_64_SECREL64LSB) #define R_PLT_OFFSET R_IA_64_PLTOFF22 #define R_NONE R_IA_64_NONE /* * section flags that are the same other than the enum */ #undef SHF_MERGE #define SHF_MERGE SHF_IRIX_MERGE #define SHF_NOSTRIP SHF_MIPS_NOSTRIP /* * section types that are the same other than the enum */ #define SHT_EVENTS SHT_IA64_EVENTS #define SHT_CONTENT SHT_IA64_CONTENT #define SHT_IFACE SHT_IA64_IFACE /* * section names */ #define SECT_OPTIONS_NAME IA64_OPTIONS #define SECT_EVENTS_NAME IA64_EVENTS #define SECT_IFACE_NAME IA64_INTERFACES #define SECT_CONTENT_NAME MIPS_CONTENT inline void Set_Elf_Version (unsigned char *e_ident) { /* temporary version until final objects */ e_ident[EI_TVERSION] = EV_T_CURRENT; } #ifdef __cplusplus } #endif #endif /* targ_em_elf_INCLUDED */
uhhpctools/openuh-openacc-osprey/common/com/ia64/targ_em_elf.h
using System; using System.Threading; using System.Globalization; class playWithIntDoubleString { static void Main() { Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture; //Problem 9. Play with Int, Double and String //Write a program that, depending on the user’s choice, inputs an int, double or string variable. //If the variable is int or double, the program increases it by one. //If the variable is a string, the program appends * at the end. //Print the result at the console. Use switch statement. Console.WriteLine("Please choose a type: "); Console.WriteLine("1 --> INT"); Console.WriteLine("2 --> DOUBLE"); Console.WriteLine("3 --> STRING"); int userAnswer = int.Parse(Console.ReadLine()); switch (userAnswer) { case 1: Console.WriteLine("Please enter an integer number: "); int num = int.Parse(Console.ReadLine()); num += 1; Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("The result number is: {0}", num); break; case 2: Console.WriteLine("Enter a double number: "); double numDouble = double.Parse(Console.ReadLine().Replace(',', '.')); numDouble += 1; Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine("The result number is: {0}", numDouble); break; case 3: Console.WriteLine("Please enter a string: "); string userSomeText = Console.ReadLine(); string star = "*"; Console.ForegroundColor = ConsoleColor.Green; Console.WriteLine(userSomeText + star); break; default: Console.ForegroundColor = ConsoleColor.Red; Console.WriteLine("Invalid choice. Try again"); break; } } }
pkindalov/beginner_exercises-Conditional Statements/9.playWithIntDoubleString/playWithIntDoubleString.cs
describe("browser.service.genes (unit testing)", function() { "use strict"; /***************************************************************************** * Global Variables ****************************************************************************/ var $rootScope, $httpBackend, genes, settings, fakeGenes = ['abc']; /***************************************************************************** * Global Setting / Setup ****************************************************************************/ beforeEach(function() { module('sbb'); module('sbb.browser'); inject(function ($injector) { genes = $injector.get('genes'); $rootScope = $injector.get('$rootScope'); $httpBackend = $injector.get('$httpBackend'); settings = $injector.get('settings'); }); }); /***************************************************************************** * General / Existance Testing ****************************************************************************/ it('should contain the genes', function () { expect(genes).not.toEqual(null); } ); it('exists the `getAll` function', function () { expect(typeof(genes.getAll)).toEqual('function'); } ); /***************************************************************************** * Functional Testing ****************************************************************************/ it('should resolve promises', function () { var geneData; $httpBackend .expectGET(settings.apiPath + 'genes') .respond(fakeGenes); genes .getAll() .then(function(data){ geneData = data; }); $httpBackend.flush(); $rootScope.$digest(); expect(geneData).toEqual(fakeGenes); } ); it('should reject errors', function () { var genesErr; $httpBackend .expectGET(settings.apiPath + 'genes') .respond(500, 'error'); genes .getAll() .catch(function (e) { genesErr = e; }); $httpBackend.flush(); $rootScope.$digest(); expect(genesErr).toEqual('error'); } ); });
flekschas/sbb-src/app/browser/services/genes.spec.js
var when = require("when"); module.exports = function(knex) { describe('Aggregate', function() { it('has a sum', function() { return knex('accounts').logMe().sum('logins'); }); it('has a count', function() { return knex('accounts').logMe().count('id'); }); it("support the groupBy function", function() { return knex('accounts').logMe().count('id').groupBy('logins').then(function() { return knex('accounts').logMe().count('id').groupBy('first_name'); }); }); }); };
Stagounet/Blog-node_modules/knex/test/integration/builder/aggregate.js
define(function (require, exports, module) { "use strict"; exports.snippetText = require("../requirejs/text!./rdoc.snippets"); exports.scope = "rdoc"; });
wso2/carbon-analytics-components/org.wso2.carbon.siddhi.editor.core/src/main/resources/web/editor/commons/lib/ace-editor/snippets/rdoc.js
/******************************************************************************* * * Copyright (c) 2001-2016 Primeton Technologies, Ltd. * All rights reserved. * * Created on May 22, 2017 10:45:30 AM *******************************************************************************/ package org.laotse.semantic.test; import org.junit.Assert; import org.junit.Test; /** * TestCaseS1. * * @author ZhongWen Li (mailto:[email protected]) */ public class TestCaseS8 { @Test public void test() { Assert.assertTrue(Boolean.TRUE); System.out.println("PASS"); } }
laotse-ltd/semantic-ui-src/test/java/org/laotse/semantic/test/TestCaseS8.java
// META: title=NativeIO API: SetLength respects the allocated capacities. // META: global=window,worker promise_test(async testCase => { const file = await storageFoundation.open('test_file'); testCase.add_cleanup(async () => { await file.close(); await storageFoundation.delete('test_file'); }); await promise_rejects_dom(testCase, 'QuotaExceededError', file.setLength(4)); }, 'NativeIOFile.setLength() fails without any capacity request.'); promise_test(async testCase => { const file = await storageFoundation.open('test_file'); const granted_capacity = await storageFoundation.requestCapacity(4); assert_greater_than_equal(granted_capacity, 2); testCase.add_cleanup(async () => { await file.close(); await storageFoundation.delete('test_file'); await storageFoundation.releaseCapacity(granted_capacity); }); await file.setLength(granted_capacity - 1); }, 'NativeIOFile.setLength() succeeds when given the granted capacity - 1'); promise_test(async testCase => { const file = await storageFoundation.open('test_file'); const granted_capacity = await storageFoundation.requestCapacity(4); assert_greater_than_equal(granted_capacity, 1); testCase.add_cleanup(async () => { await file.close(); await storageFoundation.delete('test_file'); await storageFoundation.releaseCapacity(granted_capacity); }); await file.setLength(granted_capacity); }, 'NativeIOFile.setLength() succeeds when given the granted capacity'); promise_test(async testCase => { const file = await storageFoundation.open('test_file'); const granted_capacity = await storageFoundation.requestCapacity(4); assert_greater_than_equal(granted_capacity, 0); testCase.add_cleanup(async () => { await file.close(); await storageFoundation.delete('test_file'); await storageFoundation.releaseCapacity(granted_capacity); }); await promise_rejects_dom( testCase, 'QuotaExceededError', file.setLength(granted_capacity + 1)); }, 'NativeIOFile.setLength() fails when given the granted capacity + 1');
chromium/chromium-third_party/blink/web_tests/external/wpt/native-io/setLength_capacity_allocation_async.tentative.https.any.js
// This file has been generated by Py++. #ifndef _pair_less__osg_scope_ref_ptr_less__osg_scope_StateSet__greater__comma__osg_scope_Polytope__greater___value_traits_pypp_hpp_hpp__pyplusplus_wrapper #define _pair_less__osg_scope_ref_ptr_less__osg_scope_StateSet__greater__comma__osg_scope_Polytope__greater___value_traits_pypp_hpp_hpp__pyplusplus_wrapper namespace boost { namespace python { namespace indexing { template<> struct value_traits< std::pair< osg::ref_ptr< osg::StateSet >, osg::Polytope > >{ static bool const equality_comparable = false; static bool const less_than_comparable = false; template<typename PythonClass, typename Policy> static void visit_container_class(PythonClass &, Policy const &){ } }; }/*indexing*/ } /*python*/ } /*boost*/ #endif//_pair_less__osg_scope_ref_ptr_less__osg_scope_StateSet__greater__comma__osg_scope_Polytope__greater___value_traits_pypp_hpp_hpp__pyplusplus_wrapper
JaneliaSciComp/osgpyplusplus-src/modules/osg/generated_code/_pair_less__osg_scope_ref_ptr_less__osg_scope_StateSet__greater__comma__osg_scope_Polytope__greater___value_traits.pypp.hpp
# High efficiency step down converter Discussion in 'The Projects Forum' started by TheOtherGuy, Apr 4, 2015. 1. ### TheOtherGuy Thread Starter New Member Apr 4, 2015 2 0 Hi everyone, what I'm looking for is how to make a step down dc to dc "transformer". No, I do not want a buck converter or any switching power source, because I need a large amount of current from it ( around 50A) meaning I need current step up. What I have in mind is making an inverter, passing the ac current through a transformer and then rectifying it. Problem is, this would make it rather bulky, and I only want to use it as a last resort. Does anyone have any idea how to do this without converting the current to ac and back? input is a 13.3V, 10A battery Sorry if this matches with another topic, I'm new :/ 2. ### Papabravo Expert Feb 24, 2006 11,154 2,179 What you want seems to be of dubious utility because you did not specify an output voltage. 13.3V * 10 Amperes = 133 Watts. Assuming a conversion process that is 90% efficient, your output power will be: 133 Watts * 0.9 = 119.7 Watts Now 50 Amperes from 119.7 Watts ≈ 2.4 Volts Note I did not say anything about a buck converter or any type of switching power supply. It is just basic physics. Note also that transformers are exclusively and inherently AC devices. It makes little to no sense to speak of a DC to DC "transformer". There is an old joke about retirement. Q: What is the best way to end up in Palm Beach with a million dollars? A: Bring two. It is kinda the same way with power. In the early days of fooling around with TTL, a 5V 50A power supply was not uncommon, and it took a big piece of heavy iron to make it happen. 3. ### Dodgydave AAC Fanatic! Jun 22, 2012 6,486 1,026 what output voltage input wattage =133W ( 10A x 13.3V) so output voltage = 133W/50A = 2.66V 4. ### Papabravo Expert Feb 24, 2006 11,154 2,179 Only if the process is 100% efficient.....chaa, and monkeys will....never mind. 5. ### Roderick Young Member Feb 22, 2015 409 169 Is your input source a lead-acid battery? If it's rated at 10 amp-hours, you might be able to draw 50 amps from it for a short time. What the others said about conservation of power is quite true, but in the event that you actually did want 50 amps of current at a low voltage, a buck converter can actually increase current. I don't know of any more efficient way to do things, short of redesigning your load to use exactly the battery voltage directly. 6. ### #12 Expert Nov 30, 2010 17,896 9,316 Do you understand that these are contradictory statements? Do you understand that a switching converter is the smallest possible way to do this? 7. ### crutschow Expert Mar 14, 2008 16,540 4,458 You may not think you do, but you do want a buck switching converter. It does indeed act as a transformer to increase (step-up) the output current in proportion to the voltage reduction that it performs (and they can be designed to do that with high efficiency). 8. ### DickCappels Moderator Aug 21, 2008 3,923 1,085 You can do with a dynamotor like this and a rectifier, but a buck converter as others are trying to help you understand, would be the most efficient solution available. 9. ### TheOtherGuy Thread Starter New Member Apr 4, 2015 2 0 Thanks for clearing that up wally(crutschow). I was a little confused about converters, cause the one I made was very low efficiency, and my duty cycle was only 2/3, so I guess I made assumptions
finemath-3plus
package com.javarush.test.level20.lesson02.task05; import java.io.*; /* И еще раз о синхронизации Реализуйте логику записи в файл и чтения из файла для класса Object Метод load должен инициализировать объект данными из файла Метод main реализован только для вас и не участвует в тестировании */ public class Solution { public static void main(String[] args) { try { File myFile = new File ("d:/1.txt"); OutputStream outputStream = new FileOutputStream(myFile); InputStream inputStream = new FileInputStream(myFile); Object object = new Object(); object.string1 = new String(); object.string2 = new String(); object.save(outputStream); outputStream.flush(); Object loadedObject = new Object(); loadedObject.string1 = new String(); loadedObject.string2 = new String(); loadedObject.load(inputStream); object.string1.print(); loadedObject.string1.print(); object.string2.print(); loadedObject.string2.print(); outputStream.close(); inputStream.close(); } catch (IOException e) { e.printStackTrace(); System.out.println("Oops, something wrong with my file"); } catch (Exception e) { e.printStackTrace(); System.out.println("Oops, something wrong with save/load method"); } } public static class Object { public String string1; public String string2; public void save(OutputStream outputStream) throws Exception { PrintWriter printWriter = new PrintWriter(outputStream); java.lang.String hasString1 = (string1 != null) ? "yes" : "no"; printWriter.println(hasString1); currentValue = countStrings - 1; java.lang.String hasString2 = (string2 != null) ? "yes" : "no"; printWriter.println(hasString2); currentValue = currentValue--; printWriter.close(); } public void load(InputStream inputStream) throws Exception { int tmp = countStrings; countStrings = currentValue; BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); java.lang.String hasString1 = bufferedReader.readLine(); if ("yes".equals(hasString1)) this.string1 = new String(); java.lang.String hasString2= bufferedReader.readLine(); if ("yes".equals(hasString2)) this.string2 = new String(); bufferedReader.close(); countStrings = tmp; } } public static int currentValue; public static int countStrings; public static class String { private final int number; public String() { number = ++countStrings; } public void print() { System.out.println("string #" + number); } } }
Juffik/JavaRush-1-src/com/javarush/test/level20/lesson02/task05/Solution.java
# Which expression completes the trigonometric identity? sec( Pi/2- theta)= a)-cos theta b)Sec theta c)Csc theta D) Sin theta llltkl | College Teacher | (Level 3) Valedictorian Posted on Let OPM be a right angled triangle, right angled at M. angle MOP= theta then, angle OPM=pi/2-theta. For the referance angle theta, we have sin theta= PM/OP  or,  cosec theta= OP/PM ..........(i) For the referance angle pi/2-theta, we have cos(pi/2-theta)=PM/OP  or, sec(pi/2-theta)=OP/PM...............(ii) From (i) and (ii), we obtain: cosec theta= sec(pi/2-theta) =OP/PM Therefore, the expression that completes the trigonometric identity sec(pi/2-theta)= is option c) cosec or csc theta. Sources: We’ve answered 317,884 questions. We can answer yours, too.
finemath-3plus
+0 # The midpoints of the adjacent sides of a square are connected to form a new square. 0 121 1 The midpoints of the adjacent sides of a square are connected to form a new square. What is the number of inches in the perimeter of the new square if the perimeter of the original square is 36 inches? Express your answer in simplest radical form. May 8, 2021 #1 +34422 +2 Original side length 36/4 = 9 in PYTHAG THEOREM TO FIND NEW SIDE LENGTH = sqrt ( 4.5^2 + 4.5^2 ) = sqrt 40.5  in New perimeter = 4 * sqrt 40.5 inches May 8, 2021
finemath-3plus
var CityConstants = { CITIES_RECEIVED: "CITIES_RECEIVED" }; module.exports = CityConstants;
RowiDont/Table-frontend/constants/city_constants.js
import {Node} from './data/node'; import {List} from './data/list'; /** * Add an item to the front of a list. * * @example * const l1 = List.empty(); * const l2 = List.add(1, l2); * const l3 = List.add(2, l3); * * @memberof List * @param {*} item * @param {List} list * @return {List} */ export function add(item, list) { if (item === undefined || item === null) { return list; } const {head} = list; return new List(new Node(item, head)); }
kasperisager/uforanderlig-lib/list/add.js
import tensorflow as tf from tensorflow.contrib import rnn from tensorflow.contrib import legacy_seq2seq import numpy as np class Model(): def __init__(self, args, training=True): self.args = args if not training: args.batch_size = 1 args.seq_length = 1 if args.model == 'rnn': cell_fn = rnn.BasicRNNCell elif args.model == 'gru': cell_fn = rnn.GRUCell elif args.model == 'lstm': cell_fn = rnn.BasicLSTMCell elif args.model == 'nas': cell_fn = rnn.NASCell else: raise Exception("model type not supported: {}".format(args.model)) tf.reset_default_graph() cells = [] for _ in range(args.num_layers): cell = cell_fn(args.rnn_size) if training and (args.output_keep_prob < 1.0 or args.input_keep_prob < 1.0): cell = rnn.DropoutWrapper(cell, input_keep_prob=args.input_keep_prob, output_keep_prob=args.output_keep_prob) cells.append(cell) self.cell = cell = rnn.MultiRNNCell(cells, state_is_tuple=True) self.input_data = tf.placeholder( tf.int32, [args.batch_size, args.seq_length]) self.targets = tf.placeholder( tf.int32, [args.batch_size, args.seq_length]) self.initial_state = cell.zero_state(args.batch_size, tf.float32) with tf.variable_scope('rnnlm'): softmax_w = tf.get_variable("softmax_w", [args.rnn_size, args.vocab_size]) softmax_b = tf.get_variable("softmax_b", [args.vocab_size]) embedding = tf.get_variable("embedding", [args.vocab_size, args.rnn_size]) inputs = tf.nn.embedding_lookup(embedding, self.input_data) # dropout beta testing: double check which one should affect next line if training and args.output_keep_prob: inputs = tf.nn.dropout(inputs, args.output_keep_prob) inputs = tf.split(inputs, args.seq_length, 1) inputs = [tf.squeeze(input_, [1]) for input_ in inputs] def loop(prev, _): prev = tf.matmul(prev, softmax_w) + softmax_b prev_symbol = tf.stop_gradient(tf.argmax(prev, 1)) return tf.nn.embedding_lookup(embedding, prev_symbol) outputs, last_state = legacy_seq2seq.rnn_decoder(inputs, self.initial_state, cell, loop_function=loop if not training else None, scope='rnnlm') output = tf.reshape(tf.concat(outputs, 1), [-1, args.rnn_size]) self.logits = tf.matmul(output, softmax_w) + softmax_b self.probs = tf.nn.softmax(self.logits) loss = legacy_seq2seq.sequence_loss_by_example( [self.logits], [tf.reshape(self.targets, [-1])], [tf.ones([args.batch_size * args.seq_length])]) self.cost = tf.reduce_sum(loss) / args.batch_size / args.seq_length with tf.name_scope('cost'): self.cost = tf.reduce_sum(loss) / args.batch_size / args.seq_length self.final_state = last_state self.lr = tf.Variable(0.0, trainable=False) tvars = tf.trainable_variables() grads, _ = tf.clip_by_global_norm(tf.gradients(self.cost, tvars), args.grad_clip) with tf.name_scope('optimizer'): optimizer = tf.train.AdamOptimizer(self.lr) self.train_op = optimizer.apply_gradients(zip(grads, tvars)) # instrument tensorboard tf.summary.histogram('logits', self.logits) tf.summary.histogram('loss', loss) tf.summary.scalar('train_loss', self.cost) def sample(self, sess, chars, vocab, num=200, prime='The ', sampling_type=1): state = sess.run(self.cell.zero_state(1, tf.float32)) for char in prime[:-1]: x = np.zeros((1, 1)) x[0, 0] = vocab[char] feed = {self.input_data: x, self.initial_state: state} [state] = sess.run([self.final_state], feed) def weighted_pick(weights): t = np.cumsum(weights) s = np.sum(weights) return(int(np.searchsorted(t, np.random.rand(1)*s))) ret = prime char = prime[-1] for n in range(num): x = np.zeros((1, 1)) x[0, 0] = vocab[char] feed = {self.input_data: x, self.initial_state: state} [probs, state] = sess.run([self.probs, self.final_state], feed) p = probs[0] if sampling_type == 0: sample = np.argmax(p) elif sampling_type == 2: if char == ' ': sample = weighted_pick(p) else: sample = np.argmax(p) else: # sampling_type == 1 default: sample = weighted_pick(p) pred = chars[sample] ret += pred char = pred return ret
395299296/liaotian-robot-app/main/lyric/model.py
class Solution { public: int maxProfit(int k, vector<int> &prices) { // lMaxP(k,n) = max(g(k-1,n-1) + diff, l(k, n-1) + diff) // gMaxP(k,n) = max(l(k,n) , g(k,n-1)) int n = prices.size(); if (k>n) { return maxProfitWithAnyTran(prices); } vector<int> l((k+1)*(n+1)); vector<int> g((k+1)*(n+1)); for(int i=0;i<(k+1)*(n+1);i++) { l[i] = 0; g[i] = 0; } for(int i=1;i<=k;i++) { for(int j=1;j<=n;j++) { int diff = 0; if (j > 1 ) { diff = prices[j-1] - prices[j-2]; } l[i*(n+1)+j] = max(g[(i-1)*(n+1)+j-1] + diff, l[i*(n+1) + j-1] + diff); g[i*(n+1)+j] = max(l[i*(n+1)+j] , g[(i)*(n+1)+j-1]); } } return g[(k+1)*(n+1)-1]; } int maxProfitWithAnyTran(const vector<int> &prices) { int n = (int) prices.size(); int s = 0; for(int i=1;i<n;i++) { if (prices[i] > prices[i-1]) { s+= (prices[i] - prices[i-1]); } } return s; } };
hongtaocai/code_interview-cpp/BestTimetoBuyandSellStockIV.cpp
_Unscented Kalman Filter_ A UKF [30] is applied in this section to estimate the state of dynamic systems with noisy or intermittent measurements, since a UKF can outperform an extended Kalman filter in several ways: dealing with highly nonlinear systems, accurate to two terms of the Taylor expansion, and higher efficiency. By discretizing (7) and (9) using the forward Euler method and including noise, the nonlinear dynamic system can be expressed as \[\mathbf{x}_{k+1}^{i} =F(\mathbf{x}_{k}^{i},\,\mathbf{u}_{k}^{i})+w_{k} \tag{10}\] \[\mathbf{z}_{k}^{i} =H(\mathbf{x}_{k}^{i})+v_{k}, \tag{11}\] where \(w_{k}\) and \(v_{k}\) represent the process and measurement noise, respectively, \(\mathbf{x}_{k}^{i}\) is the discretized states of the overall system defined in (5), \(\mathbf{u}_{k}^{i}\) is the discretized control input, \(F(\cdot)\) is the dynamics model used for prediction, \(H(\cdot)\) is the measurement model used for updating, and \(\mathbf{z}_{k}^{i}\) is the discretized measurement defined as \[\mathbf{z}_{k}^{i}=\left[\begin{array}{c}\bar{u}_{z}^{i}\\ \bar{v}_{z}^{i}\\ d_{z}^{i}\\ \psi_{z}^{i}\\ r_{c,z}^{i}\end{array}\right],\] where the \(z\) subscript represents the measured value of the denoted argument. When the bounding box cannot be detected, the state is predicted by the dynamics model using (10), which is reliable over a short period of time before the detection process recovers. _Remark 2_.: The UKF-based method developed in Section II-E utilizes a high-order polynomial to continuously estimate the unknown motion of a moving target; that is, the polynomial is found based on a QP method to fit the position and velocity data over the latest time period (cf. (27) of [6]). ## III Nonlinear Model Predictive Control An NMPC is designed in this section and is then utilized in Section V to compute the minimally invasive controller. The control input of the NMPC is calculated by optimizing the cost function designed in this section that considers not only the current and upcoming feature errors, but also the control input. Using the NMPC can decrease both the aggressiveness of the flying behavior and the energy consumption. ### _Transformation of the Dynamics Model_ Since computing the dynamics defined in (7) is too inefficient, the rotational dynamics is transformed to increase the computational efficiency. On the other hand, to avoid the UAVs reaching their maximum speed during tracking, slow time variations on the angular velocity of the target are also considered in Assumption 2. **Assumption 2**.: The target is initially located within the FOV of the camera, and the angular velocity of the target exhibits only slow time variations (i.e., \(\omega_{q}\approx 0\)). During the steady state, the UAV is controlled such that its camera is looking almost directly at the target (i.e., \(V_{q}\approx V_{c}\)), as shown in Fig. 4. In other words, the heading of the camera is parallel to the direction of the position vector from the camera to the target. Based on Assumption 2, velocities \(V_{q}^{i}\) and \(V_{c}^{i}\) defined in (2) satisfy \(V_{q}^{i}\approx V_{c}^{i}\) and \(\omega_{q}^{i}\approx 0,\) which implies \(\dot{\psi}^{i}\approx\left(\omega_{cx}^{i}\right)^{g}=-\omega_{cy}^{i}.\) Therefore, the dynamics of relative angle \(\psi^{i}\) can be expressed as \[\dot{\psi}^{i}=-\omega_{cy}^{i}=\frac{-(v_{qx}^{i}-v_{cx}^{i})}{\left\|r_{q/c} ^{i}\right\|},\] which is equivalent to \[\dot{\psi}^{i}=\frac{(v_{cx}^{i}-v_{qx}^{i})x_{3}^{i}}{\sqrt{1+(x_{1}^{i})^{2} +(x_{2}^{i})^{2}}} \tag{12}\] based on the relation \[\left\|r_{q/c}^{i}\right\| =\sqrt{(X^{i})^{2}+(Y^{i})^{2}+(Z^{i})^{2}} \tag{13}\] \[=\frac{\sqrt{1+(x_{1}^{i})^{2}+(x_{2}^{i})^{2}}}{x_{3}^{i}}.\] The dynamics model of the overall system defined in (7) can Fig. 4: Directions of velocities expressed in the camera frame. be replaced with \[\mathbf{\dot{x}}^{i}=\left[\begin{array}{c}v_{qx}^{i}x_{3}^{i}-v_{qx}^{i}x_{1}^{i }x_{3}^{i}+\zeta_{1}+\eta_{1}\\ v_{qy}^{i}x_{3}^{i}-v_{qx}^{i}x_{2}^{i}x_{3}^{i}+\zeta_{2}+\eta_{2}\\ -v_{qz}^{i}(x_{3}^{i})^{2}+v_{cz}^{i}(x_{3}^{i})^{2}-(\omega_{cy}^{i}x_{1}^{i}- \omega_{cx}^{i}x_{2}^{i})x_{3}^{i}\\ \frac{(v_{cz}^{i}-v_{qx}^{i})x_{3}^{i}}{\sqrt{1+(x_{1}^{i})^{2}+(x_{2}^{i})^{2} }}\\ V_{q}^{i}\\ 0_{3\times 1}\end{array}\right]. \tag{14}\] _Remark 3_.: Assumption 2 might not always be satisfied, in which cases the mismatches can be considered as process noise and be corrected using the relative angle as measured by the YOLO network.
2109.07079v1.mmd
/* Copyright (c) 2015 by Juliusz Chroboczek 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. */ /* All timers in ms */ struct trickle_state { int I_min, I_max; int k, I, c, t; int triggered; struct timespec I_start; }; void trickle_init(struct trickle_state *s, int I_min, int I_max, int k); void trickle_new_t(struct trickle_state *s); void trickle_new_interval(struct trickle_state *s); void trickle_deadline(struct timespec *deadline, const struct trickle_state *s); int trickle_trigger(struct trickle_state *s); void trickle_reset(struct trickle_state *s, int consistent);
jech/shncpd-trickle.h
'use strict'; angular.module('myApp') .factory('DataService', function ($http) { var dataService = {}; // factory function body that constructs shinyNewServiceInstance dataService.application = {}; dataService.getApplicationById = function(id) { if(!id) { console.log("Unable to get application because there is no ID"); return false; } return $http({ url: '/api/request/assistance/' + id, method: 'GET', headers: { 'OpenAMHeaderID': '10705332' } }).then(function successCallback(response) { if (response.data) { dataService.application = response.data.result; return response.data.result; } return false; }); }; dataService.getApplications = function() { return $http({ url: '/api/request/assistance/search', method: 'POST', headers: { 'OpenAMHeaderID': '10705332' } }).then(function successCallback(response) { if (response.data && response.data.status == "success") { return response.data.result; } return false; }); }; dataService.getApplicationsForEmployee = function(employeeId) { return $http({ url: '/api/request/assistance/search', method: 'POST', headers: { 'OpenAMHeaderID': '10705332' //TODO: remove this, it wont be needed in prod }, data: {createdBy : employeeId} }).then(function callback(response) { console.log(response); if (response.data && response.data.status == "success") { return response.data.result; } return false; }); }; dataService.getApplicationsByStatus = function(status) { return $http({ url: '/api/request/assistance/search', method: 'POST', headers: { 'OpenAMHeaderID': '10705332' //TODO: remove this, it wont be needed in prod }, data: {status : status} }).then(function callback(response) { console.log(response); if (response.data && response.data.status == "success") { return response.data.result; } return false; }); }; dataService.getApplicationsByEmployeeAndStatus = function(employeeId, status) { return $http({ url: '/api/request/assistance/search', method: 'POST', headers: { 'OpenAMHeaderID': '10705332' //TODO: remove this, it wont be needed in prod }, data: { createdBy : employeeId, status : status} }).then(function callback(response) { console.log(response); if (response.data && response.data.status == "success") { return response.data.result; } return false; }); }; dataService.createApplication = function(requestContent) { return $http({ url: '/api/request/assistance', method: 'POST', headers: { 'OpenAMHeaderID': '10705332' //TODO: remove this, it wont be needed in prod }, data: requestContent }).then(function callback(response) { if (response.data && response.data.status == "success") { return dataService.getApplicationById(response.data.result); } return false; }); }; dataService.updateApplication = function(application) { if(!application._id) { console.log("Unable to update application because there is no ID"); return false; } return $http({ url: '/api/request/assistance/' + application._id, method: 'POST', headers: { 'OpenAMHeaderID': '10705332' }, data: application.requestContent }).then(function callback(response) { if (response.data && response.data.status == "success") { dataService.application = application; return application; } return false; }); }; dataService.updateAttachments = function(requestContent, id) { return $http({ url: '/api/request/assistance/' + id + '/document', method: 'POST', headers: { 'OpenAMHeaderID': '10705332' //TODO: remove this, it wont be needed in prod }, data: requestContent }).then(function callback(response) { if (response.data && response.data.status == "success") { return response.data.result; } return false; }); }; return dataService; });
atcarnegie/AAFApplicationAngular-app/main/services/data-service.js
Jul 09 2015 # Marine Lives – R and The Silver Ships – Extracting Data Within the larger Marine Lives project there are a number of smaller sub-projects which focus on specific areas of interest. One of these smaller projects is the Three Silver Ships project: “Three large ships (The Salvador, the Sampson and the Saint George) of supposedly Lubeck and Hamburg build and ownership were captured by the English in 1652 with highly valuable cargos of bullion. The ships were on their way from Cadiz with bullion from the Spanish West Indies going northwards. It was disputed in court as to whether the ships were bound legally for the Spanish Netherlands, or illegally for Amsterdam.” Marine Lives The purpose of the project is to identify relevant references to cases involving the Three Silver Ships in the various depositions and papers and consolidate this in a wiki. At the moment, this is being done manually and, as the depositions have multiple, two-sided pages, this means a large number of pages to search. As my PhD is using R to analyse novels, I thought it would be interesting to see whether I could apply my rookie programming skills to the problem. As a caveat, I have only been using R for about a year and am still very much a beginner, so there may well be more straightforward and elegant ways of working – please feel free to comment as any advice will be gratefully received! The first challenge was to extract the text, the bulk of which are transcriptions, from the individual wiki pages. This had several stages: Creating a list of URLs As each page is made up of a collection number (in this case HCA 13/70), a folio number (e.g. f.1), and whether the page is recto or verso (r or v), I started by creating a number sequence for the folios and a second sequence for the page. These were combined in a list with the main part of the URL and then collapsed to make a working URL. ```# Create a sequence for the folio numbers f.v <- rep(seq(1:501), each=2) # Create a sequence for the pages recto/verso p.v <- c("r", "v") page.v <- rep(p.v, times=501) # Create a list of URLs folio.l <- list(length = 1002) for (i in 1:1002) { folio.l[[i]] <- c("http://www.marinelives.org/wiki/HCA_13/70_f.",f.v[i], page.v[i] , "_Annotate") folio.l[[i]] <- paste(folio.l[[i]], collapse = "") } ``` Extracting the text from the wiki pages To extract the text I used the package boilerpipeR (Mario Annau, 2015). I used the DefaultExtractor function as I found that the LargestContentExtractor excluded some parts of the transcriptions. ```# Extract the text from the wiki pages and save as .txt file library(boilerpipeR) library(RCurl) # This function extracts the text from a wiki page textExtract <- function(number) { url <- folio.l[[number]] content <- getURL(url) extract <- DefaultExtractor(content) text.v <- extract return(text.v) } # Create vector to hold extracted information and fill using loop # This is a large file (approx 5 Mb) so will take some time to run x.v <- vector(length = 1002) for (i in 1:1002) { x.v[i] <- textExtract(i) } # Put resulting text into a named file HCA_13.70.v <- x.v ``` Saving the file as a .txt file The final step was to save the resulting file as a .txt file, allowing me to access it offline and keeping a copy available for use without having to go through the download process again. ```# Check that working directory has been set then save as .txt file write(HCA_13.70.v, file = "HCA_13.70.txt") ``` In my next post I will discuss preparing the text for analysis. #### 2 pings 1. ##### Rowan Nice!! Can’t wait to see what this produces… I imported the existing data into the wiki, and am in the process of (slowly) setting it up – the transcriptions and other fields are now marked up in a vaguely semantic sense, and I’m keen to explore how best to exploit this in terms of searching and export. Were you aware of/did you try the supposedly built in RDF export (https://semantic-mediawiki.org/wiki/Help:RDF_export) before scraping? What were the limitations? Let me know if you’d like rawer access to the data, I’m sure we can set something up. 1. ##### Sara Hi, I didn’t use anything from the semantic-mediawiki as I really have no idea how it works. I have been learning R for the past year and used boilerpipeR to scrape the text from the URLs. There are other options in the package, but I stuck to the default. There are probably much more elegant/efficient ways of doing this, but I’m feeling my way along, and I figure things can be tweaked once there is a basic framework set up. 1. ##### Marine Lives – The Silver Ships – 2 » Sara J Kerr […] « Marine Lives – The Silver Ships […] 2. ##### Marine Lives – R and The Silver Ships – Frequencies » Sara J Kerr […] « Marine Lives – The Silver Ships […]
finemath-3plus
from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^simcopv/$', 'apps.usuarios.views.base', name='base'), url(r'^config/$', 'apps.usuarios.views.images', name='config'), url(r'^periodos/agregarperiodo/$', 'apps.usuarios.views.agregar_periodo', name='agregarperiodo'), url(r'^periodos/agregarperiodoporusuario/$', 'apps.usuarios.views.agregar_periodoporusuario', name='agregarperiodoporusuario'), url(r'^periodos/verperiodos/$', 'apps.usuarios.views.ver_periodos', name='verperiodos'), url(r'^periodos/modificarperiodo/(\d+)$', 'apps.usuarios.views.modificar_periodo', name='modificarperiodo'), url(r'^usuarios/agregarusuario/$', 'apps.usuarios.views.agregar_usuario', name='agregarusuario'), url(r'^usuarios/cambiarpassword/(\d+)$', 'apps.usuarios.views.cambiar_password', name='cambiarpassword'), url(r'^usuarios/activarusuarios/$', 'apps.usuarios.views.activar_usuarios', name='activarusuarios'), url(r'^usuarios/verusuarios/$', 'apps.usuarios.views.ver_usuarios', name='verusuarios'), url(r'^usuarios/modificarusuario/(\d+)$', 'apps.usuarios.views.modificar_usuario', name='modificarusuario'), url(r'^roles/asignar-roles/$', 'apps.usuarios.views.asignar_roles', name='asignarroles'), url(r'^cuenta/login/$', 'apps.usuarios.views.autenticacion', name='auth'), url(r'^cuenta/logout/$', 'apps.usuarios.views.auth_logout', name='logout'), url(r'^cuenta/change_password/$', 'apps.usuarios.views.change_password', name='change_password'), url(r'^ajax/asignar-roles/usuario-search/$', 'apps.usuarios.views.ajax_usuario_search', name='usuario_search'), url(r'^ajax/asignar-roles/grupo/(\d+)/$', 'apps.usuarios.views.ajax_table_usuarios', name="tabla_grupo"), url(r'^ajax/asignar-roles/usuarios-por-tipo/$', 'apps.usuarios.views.ajax_tabla_agregarperiodo', name="tabla_tipo"), url(r'^ajax/asignar-roles/usuarios-por-periodo/$','apps.usuarios.views.ajax_usuarios_periodo', name="tabla_usuarios_periodo"), url(r'^ajax/verusuarios/usuarios/$','apps.usuarios.views.ajax_usuarios_ver', name="tabla_usuarios"), )
jorgevtorresr/SIMCOPV-apps/usuarios/urls.py
/************************************************************ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. project: BIM united FC module: FeatureEditor desc: field for editing a text feature by: Andrew Siddeley started: 16-Apr-2017 **************************************************************/ // Define module with simplified CommonJS Wrapper... // see http://requirejs.org/docs/api.html#cjsmodule define( function(require, exports, module) { var $=require('jquery'); var FeatureControl=function(place, feature) { //place - DOM container //feature - {label:'name', valu:mesh.variable, onFC:fn(ev,mesh,res){...}, FED:featureEditor} //var that=this; var clan=(typeof feature.clan=='undefined')?'bimFC':feature.clan; this.form$=$('<form></form>').on('submit', this, this.onSubmit); this.label$=$('<span></span>').addClass('ui-controlgroup-label'); this.prop$=$('<span></span>').addClass('ui-controlgroup-label'); this.form$.append(this.label$, this.prop$).addClass(clan); $(place).append(this.form$); //register this guy's events - unregistered by remove() BIM.func.on(this.getEvents()); this.feature=feature; if (feature.alias==null) {this.label$.hide();} else {this.label$.text(feature.alias);} //hide label if empty string //if (typeof feature.prop == 'string') { //display the property this.prop$.text(feature.prop.toString()); //} else { /*this.prop$.text(feature.prop.toString());*/} return this; }; var __=FeatureControl.prototype; __.getEvents=function(){ return [ //{name:'featurechanged', data:this, handler:this.onFeatureChanged}, {name:'propertychange', data:this, handler:this.onPropertyChange} ]; }; __.onSubmit=function(ev){ /*********** This base class has a text box and submits after a keystroke (I think) inheritors to override/implement submit with an ok button (or such) this.form$=$('<form></form>').on('submit', this, this.onSubmit); that triggers the form submit event. submit event => onSubmit evaluates feature.propUpdate() and triggers propertychange => ev - submit event triggered from FC or inheritor such as TextFC ev.data - FC or FC or inheritor such as TextFC ******/ ev.preventDefault(); //prevent page refresh try { //console.log('propUpdate...', ev.data.feature.propUpdate); //ev.data.feature.propUpdate(ev.data.feature.prop, ev.data.feature.propToBe); ev.data.feature.propUpdate(ev.data.feature.propToBe); //console.log('propertychange trigger...', ev.data.feature.propToBe); BIM.fun.trigger('propertychange', [ev.data.feature.prop]); } catch(er) {console.log(er);} }; __.onPropertyChange=function(ev, prop){ //meant to be overriden //prop - property that has changed if (ev.data.feature.prop === prop){ //console.log('propertychange handled by', ev.data.feature.mesh.name); //the property was changed so update the display of it ev.data.prop$.text(ev.data.feature.propToBe.toString()); } }; __.remove=function(){ /*** See jquery docs...use $.remove() when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed. To remove the elements without removing data and events, use .detach() instead. ***/ this.label$.remove(); this.prop$.remove(); this.form$.remove(); //unregister events! BIM.fun.off(this.getEvents() ); }; __.start=function(){ /* Turn form into a jquery controgroup if not already. Why not do this in constructor? to allow inheritors to add items for inclusion in the controlgroup in their constructor inheritor must call start() to wigetize */ if (!this.form$.is(':ui-controlgroup')){ this.form$.controlgroup({ 'direction':'horizontal', 'items':{ "button":"button, input[type=text], input[type=submit]", "controlgroupLabel": ".ui-controlgroup-label", "checkboxradio": "input[type='checkbox'], input[type='radio']", "selectmenu": "select", "menu":"ul, .dropdown-items", "spinner": ".ui-spinner-input" } }); } }; __.undo=function(){ }; __.undolog=[]; __.undopush=function(that, valu){ //add value to the undo stack but limit it to just 10 changes that.undolog.push(valu); if (that.undolog.length > 10) {that.undolog.shift();} }; return FeatureControl; }); //end of define
asiddeley/BIMsoup-features/FC.js
CGAL 5.5 - CGAL and Solvers MixedIntegerProgramLinearConstraint< FT > Concept Reference ## Definition MixedIntegerProgramLinearConstraint is a concept of a linear constraint in a Mixed Integer Programming (MIP) problem. Has Models: CGAL::Linear_constraint<FT> ## Creation MixedIntegerProgramLinearConstraint (MixedIntegerProgramTraits *solver, FT lb, FT ub, const std::string &name, int idx) Constructs a linear constraint, initialized with the solver it belongs to, the lower bound, upper bound, name, and index. ## Operations const std::string & name () const Returns the name of the constraint. void set_name (const std::string &n) Sets the name of the constraint. int index () const Returns the index of the constraint. void set_index (int idx) Sets the index of the constraint. const MixedIntegerProgramTraitssolver () const Returns the solver that owns this constraint. MixedIntegerProgramTraitssolver () void set_lower_bound (FT lb) Sets the lower bound. void set_upper_bound (FT ub) Sets the upper bound. void set_bounds (FT lb, FT ub) Sets both lower and upper bounds. FT lower_bound () const Gets the lower bound. FT upper_bound () const Gets the upper bound. void get_bounds (FT &lb, FT &ub) const Gets both lower and upper bounds. void set_coefficients (const std::unordered_map< const MixedIntegerProgramVariable *, FT > &coeffs) Sets the coefficients of the constraint. void add_coefficient (const MixedIntegerProgramVariable *var, FT coeff) Adds a coefficient to a variable of the constraint. const std::unordered_map< const MixedIntegerProgramVariable *, FT > & coefficients () const Returns the coefficients of the constraint. FT get_coefficient (const MixedIntegerProgramVariable *var) const Gets the coefficient of the variable in this constraint. void set_offset (FT value) Sets the constant term. FT offset () const Gets the constant term. void clear () Clears all variables and sets the constant term to zero. More... static FT infinity () Gets the infinity threshold (e.g., 1e20). More... ## ◆ clear() template<typename FT > void MixedIntegerProgramLinearConstraint< FT >::clear ( ) Clears all variables and sets the constant term to zero. Useful to reuse the object to define a new linear constraint. ## ◆ infinity() template<typename FT > static FT MixedIntegerProgramLinearConstraint< FT >::infinity ( ) static Gets the infinity threshold (e.g., 1e20). Values greater than this value are considered as infinity.
finemath-3plus
// // PPVideoImageManager.h // // // Created by xuzhongping on 2016/12/13. // Copyright © 2016年 JungHsu. All rights reserved. // #import <UIKit/UIKit.h> typedef void(^completedBlock)(UIImage *image,NSURL *url,NSError *error); @interface PPVideoImageManager : NSObject + (instancetype)sharedManager; - (void)pp_parseImagForVideoUrl:(NSURL *)url size:(CGSize)size completed:(completedBlock)complete; - (void)pp_parseImagForVideoUrl:(NSURL *)url size:(CGSize)size cornerRadius:(CGFloat)cornerRadius completed:(completedBlock)complete; - (UIImage *)disposeCircularImage:(UIImage *)image size:(CGSize)size cornerRadius:(CGFloat)cornerRadius; @end
JungHsu/PPVideoImage-PPVideoImage/PPVideoImageManager.h
/* Broadcast by TEMPLATED templated.co @templatedco Released for free under the Creative Commons Attribution 3.0 license (templated.co/license) */ (function($) { skel.breakpoints({ xlarge: '(max-width: 1680px)', large: '(max-width: 1280px)', medium: '(max-width: 980px)', small: '(max-width: 736px)', xsmall: '(max-width: 480px)' }); $(function() { var $window = $(window), $body = $('body'); // Disable animations/transitions until the page has loaded. $body.addClass('is-loading'); $window.on('load', function() { window.setTimeout(function() { $body.removeClass('is-loading'); }, 100); }); // Fix: Placeholder polyfill. $('form').placeholder(); // Prioritize "important" elements on medium. skel.on('+medium -medium', function() { $.prioritize( '.important\\28 medium\\29', skel.breakpoint('medium').active ); }); // Menu. $('#menu') .append('<a href="#menu" class="close"></a>') .appendTo($body) .panel({ delay: 500, hideOnClick: true, hideOnSwipe: true, resetScroll: true, resetForms: true, side: 'right' }); // Banner. var $banner = $('#banner'); if ($banner.length > 0) { // IE fix. if (skel.vars.IEVersion < 12) { $window.on('resize', function() { var wh = $window.height() * 0.60, bh = $banner.height(); $banner.css('height', 'auto'); window.setTimeout(function() { if (bh < wh) $banner.css('height', wh + 'px'); }, 0); }); $window.on('load', function() { $window.triggerHandler('resize'); }); } // Video check. var video = $banner.data('video'); if (video) $window.on('load.banner', function() { // Disable banner load event (so it doesn't fire again). $window.off('load.banner'); // Append video if supported. if (!skel.vars.mobile && !skel.breakpoint('large').active && skel.vars.IEVersion > 9) $banner.append('<video autoplay loop><source src="' + video + '.mp4" type="video/mp4" /><source src="' + video + '.webm" type="video/webm" /></video>'); }); // More button. $banner.find('.more') .addClass('scrolly'); } // Tabbed Boxes $('.flex-tabs').each( function() { var t = jQuery(this), tab = t.find('.tab-list li a'), tabs = t.find('.tab'); tab.click(function(e) { var x = jQuery(this), y = x.data('tab'); // Set Classes on Tabs tab.removeClass('active'); x.addClass('active'); // Show/Hide Tab Content tabs.removeClass('active'); t.find('.' + y).addClass('active'); e.preventDefault(); }); }); // Scrolly. if ( $( ".scrolly" ).length ) { var $height = $('#header').height(); $('.scrolly').scrolly({ offset: $height }); } }); })(jQuery);
martafdezm95/OnlineMusicLibrary-public/assets/js/main.js
// ==UserScript== // @name xREL Advanced // @namespace xRELAdvanced // @description This Script adds some functions to xREL // @include http://www.xrel.to* // @include www.xrel.to* // @include http://xrel.to* // @include xrel.to* // @include *.xrel.to* // @exclude http://api.xrel.to* // @exclude https://api.xrel.to* // @require http://xrel.beautify.it/jquery.1.3.2.min.js // @require http://xrel.beautify.it/gm_jq_xhr.js // @require http://xrel.beautify.it/json_parse.js // @grant GM_addStyle // @grant GM_xmlhttpRequest // @version 0.1.2 // ==/UserScript== $(document).ready(function() { GM_addStyle(".getReleaseName { cursor: pointer; } .release_options { padding-top: 0px !important; } .release_options a img { width:13px; } .release_options span img { width:13px; } .nfo_title .getReleaseName { margin-left:5px; } .nfo_title .getReleaseName img { width:16px; vertical-align: sub; }"); // Add Pictures to persons if (window.location.href.indexOf("/person/") > -1) { var actor = $(".headline2").html(); var i = 0; $('#middle_spawn').after('<div id="middle_left"><div style="position: relative; left: 0pt; top: 0pt;" id="rightbox"><div><div class="box_title1">' + actor + '</div><div style="line-height: 15px;" id="release_info_box" class="box1"></div></div></div></div>'); $.get("http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=site:imdb.com " + actor + "", function (data) { var myObject = JSON.parse(data, function (key, value) { if (key == 'url') { $("#release_info_box").append('<div class="box_content"><a href="http://images.google.com/searchbyimage?image_url=' + value + '" target="_blank"><img src="http://xrel.beautify.it/?src=' + value + '" title="' + actor + '"></a></div>'); } }); }); } // Expand the view of trailers / hide trailer navigation if (window.location.href.indexOf("entertainment-trailers") > -1) { if ($('.trailers_top').length != 0) { $('.trailers_top').css({ height: 'auto' }); } $('#trailers_top_pagination').hide(); } // Make links open in a new tab $('a').each(function(){ if($(this).attr('href')){ var href = $(this).attr('href'); if(href.indexOf('derefer') != -1){ $(this).attr('target', '_blank'); } } }); $('area').each(function(){ if($(this).attr('href')){ var href = $(this).attr('href'); if(href.indexOf('derefer') != -1){ $(this).attr('target', '_blank'); } } }); // Create a copy button in the release options $('.release_item .release_title .sub_link').each(function(){ if($(this).children('span').hasClass('truncd')){ var content = $(this).children('span').attr('title'); } else { var content = $(this).children('span').html(); } if(content == ''){ var content = $(this).children('span').html(); } html = '<br><span class="getReleaseName" data-name="'+content+'"><img src="http://xrel.beautify.it/img/copy.gif"></span>'; $(this).parent().parent().find('.release_options').append(html); }); // Create a copy button in the p2p release options $('.release_item .release_title_p2p .sub_link').each(function(){ if($(this).children('span').hasClass('truncd')){ var content = $(this).children('span').attr('title'); } else { var content = $(this).children('span').html(); } if(content == ''){ var content = $(this).children('span').html(); } html = '<br><span class="getReleaseName" data-name="'+content+'"><img src="http://xrel.beautify.it/img/copy.gif"></span>'; $(this).parent().parent().find('.release_options').append(html); }); // Make the created Icon clickable $('.getReleaseName').click(function(){ var content = $(this).attr("data-name"); window.prompt('Einfach STRG+C, schliessen mit ENTER',content); return false; }); });
Sinner666/xREL-Advanced-GM--userscript.js
'use strict;' /* redux */ import {compose, createStore, applyMiddleware, combineReducers} from 'redux' import { routerReducer } from 'react-router-redux' import thunk from 'redux-thunk' import reduxProviderAdapter from 'butter-redux-provider' /* storage */ import * as storage from 'redux-storage' import createEngine from 'redux-storage-engine-localforage' import debounce from 'redux-storage-decorator-debounce' import filter from 'redux-storage-decorator-filter' import localforage from 'localforage' import LRU from 'lru-cache' /* reducers/actions */ import markers from './redux/markers' import filters from './redux/filters' import streamer from './redux/streamer' import settings from './redux/settings' import {remote} from 'electron' const forageConfig = { name: 'Butter', version: 1.0, size: 4980736 } const loadCache = () => { const store = localforage.createInstance(Object.assign({storeName: 'butter_cache'}, forageConfig)) return store.keys().then((keys) => ( Promise.all(keys.map(k => store.getItem(k))) )).then(dehydrate => createCache(store, dehydrate)) } const createCache = (store, dehydrate = []) => { const cache = LRU({ max: 1000, dispose: (k) => store.removeItem(k) }) cache.load(dehydrate) cache.tick = setTimeout(() => { console.error('saving cache') cache.dump().map(hit => setTimeout(() => store.setItem(hit.k, hit), 0)) }, 15000) return cache } const providersFromTab = (tab) => ( tab.providers.map(uri => { const name = uri.split('?')[0] let instance = null try { const Provider = remote.require(`butter-provider-${name}`) instance = new Provider(uri) } catch (e) { console.error('couldnt load provider', name) return null } return instance }).filter(e => e) ) const reducersFromTabs = (tabs, cache) => { let providerReducers = {} let providerActions = {} const tabsReducers = Object.keys(tabs).reduce((acc, k) => { const tab = tabs[k] const providers = providersFromTab(tab) providers.forEach(provider => { const reduxer = reduxProviderAdapter(provider, cache) providerReducers[provider.id] = reduxer.reducer providerActions[provider.id] = reduxer.actions }) return Object.assign(acc, { [k]: Object.assign(tab, { providers: providers.map(({config, id}) => ({config, id})) }) }) }, {}) return { providerReducers: { collections: combineReducers(providerReducers), tabs: (state, action) => ({ ...tabsReducers }) }, providerActions } } const buildRootReducer = (tabs, cachedSettings, cache) => { const {providerActions, providerReducers} = reducersFromTabs(tabs, cache) return combineReducers({ ...providerReducers, markers: markers.reducer, filters: filters.reducer, streamer: streamer.reducer, settings: settings.reducerCreator(cachedSettings), router: routerReducer, cache: () => cache, providerActions: () => providerActions, }) } const butterCreateStore = ({tabs, ...cachedSettings}) => { const persistEngine = debounce( filter( createEngine('butterstorage', Object.assign({ storeName: 'redux_storage' }, forageConfig) ), ['markers', 'settings']), 1500) const middlewares = [thunk, storage.createMiddleware(persistEngine)] const composeEnhancers = (typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) || compose const enhancer = composeEnhancers(applyMiddleware(...middlewares)) return loadCache() .then(cache => { const rootReducer = buildRootReducer(tabs, cachedSettings, cache) const persistReducer = storage.reducer(rootReducer) const store = createStore(persistReducer, enhancer) storage.createLoader(persistEngine)(store) .catch(() => console.log('Failed to load previous state')) .then(() => { const {providerActions} = store.getState() Object.values(providerActions) .map(a => store.dispatch(a.FETCH({page: 0}))) }) return {store} }) } export {butterCreateStore as default}
butterproject/butter-desktop-src/store.js
/* * This program was produced for the U.S. Agency for International Development. It was prepared by the USAID | DELIVER PROJECT, Task Order 4. It is part of a project which utilizes code originally licensed under the terms of the Mozilla Public License (MPL) v2 and therefore is licensed under MPL v2 or later. * * This program is free software: you can redistribute it and/or modify it under the terms of the Mozilla Public License as published by the Mozilla Foundation, either version 2 of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Mozilla Public License for more details. * * You should have received a copy of the Mozilla Public License along with this program. If not, see http://www.mozilla.org/MPL/ */ angular.module('service-contract', ['openlmis', 'ui.bootstrap.modal', 'ui.bootstrap.dialog', 'ui.bootstrap.dropdownToggle']).config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/', { controller: ManageServiceContractsController, templateUrl: 'partials/list.html' }). when('/view/:id', { controller: ViewServiceContractController, templateUrl: 'partials/view.html' }). otherwise({ redirectTo: '/' }); }]).run(function ($rootScope, AuthorizationService) { AuthorizationService.preAuthorize('SERVICE_VENDOR_RIGHT'); });
kelvinmbwilo/vims-modules/openlmis-web/src/main/webapp/public/js/admin/equipment/my-contracts/module/contract-module.js
# http://codingbat.com/prob/p145834 def last2(str): if len(str) < 2: return 0 count = 0 for i in range(len(str)-2): if str[i:i+2] == str[len(str)-2:]: count += 1 return count
dvt32/cpp-journey-Python/CodingBat/last2.py
// // SKImageToolTipWindow.h // Skim // // Created by Christiaan Hofman on 2/16/07. /* This software is Copyright (c) 2007-2012 Christiaan Hofman. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - Neither the name of Christiaan Hofman nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #import <Cocoa/Cocoa.h> #import "SKAnimatedBorderlessWindow.h" #import "SKImageToolTipContext.h" @interface SKImageToolTipWindow : SKAnimatedBorderlessWindow { id <SKImageToolTipContext> context; NSPoint point; } + (id)sharedToolTipWindow; // aContext can be a PDFAnnotation, PDFDestination, or PDFPage - (void)showForImageContext:(id <SKImageToolTipContext>)aContext atPoint:(NSPoint)aPoint; @property (nonatomic, readonly) id <SKImageToolTipContext> currentImageContext; @end
camillobruni/skim-SKImageToolTipWindow.h
/** * This file is part of the Future CI package. * * @copyright 2014 Future500 B.V. * @license https://github.com/f500/future-ci/blob/master/LICENSE MIT */ var fciApp = angular.module('fciApp', [ 'ngRoute', 'ui.bootstrap', 'fciControllers', 'fciDirectives' ]); fciApp.config(['$routeProvider', '$locationProvider', function ($routeProvider, $locationProvider) { $routeProvider .when('/', { templateUrl: '/template/home', controller: 'HomeCtrl' }) .when('/build', { templateUrl: '/template/build/list', controller: 'BuildListCtrl' }) .when('/build/:suiteCn/:buildCn', { templateUrl: '/template/build/show', controller: 'BuildShowCtrl' }) .otherwise({ redirectTo: '/' }); $locationProvider.html5Mode(true); } ]);
f500/future-ci-app/assets/js/app.js
""" Modülün Açıklaması __author__ : Çağatay Tengiz __date__ : 20.12.2013 """
makki-io/pitrot-controllers/__init__.py
# Multiple Streams ### Using Multiple Independent Streams MATLAB® software includes generator algorithms that enable you to create multiple independent random number streams. For example, the four generator types that support multiple independent streams are the Combined Multiple Recursive ('mrg32k3a'), the Multiplicative Lagged Fibonacci ('mlfg6331_64'), the Philox 4x32 ('philox4x32_10'), and the Threefry 4x64 ('threefry4x64_20') generators. You can create multiple independent streams that are guaranteed to not overlap, and for which tests that demonstrate (pseudo)independence of the values between streams have been carried out. For more information about generator algorithms that support multiple streams, see the table of generator algorithms in Creating and Controlling a Random Number Stream. The RandStream.create function enables you to create streams that have the same generator algorithm and seed value, but are statistically independent. [s1,s2,s3] = RandStream.create('mlfg6331_64','NumStreams',3) s1 = mlfg6331_64 random stream StreamIndex: 1 NumStreams: 3 Seed: 0 NormalTransform: Ziggurat s2 = mlfg6331_64 random stream StreamIndex: 2 NumStreams: 3 Seed: 0 NormalTransform: Ziggurat s3 = mlfg6331_64 random stream StreamIndex: 3 NumStreams: 3 Seed: 0 NormalTransform: Ziggurat As evidence of independence, you can see that these streams are largely uncorrelated. r1 = rand(s1,100000,1); r2 = rand(s2,100000,1); r3 = rand(s3,100000,1); corrcoef([r1,r2,r3]) ans = 3×3 1.0000 0.0007 0.0052 0.0007 1.0000 0.0000 0.0052 0.0000 1.0000 Depending on the application, creating only some of the streams in a set of independent streams can be useful if you need to simulate some events. Specify the StreamIndices parameter to create only some of the streams from a set of multiple streams. The StreamIndex property returns the index of each stream you create. streamNum = 256; streamId = 4; s4 = RandStream.create('mlfg6331_64','NumStreams',streamNum,'StreamIndices',streamId) s4 = mlfg6331_64 random stream StreamIndex: 4 NumStreams: 256 Seed: 0 NormalTransform: Ziggurat Multiple streams, since they are statistically independent, can be used to verify the precision of a simulation. For example, a set of independent streams can be used to repeat a Monte Carlo simulation several times in different MATLAB sessions or on different processors and determine the variance in the results. This makes multiple streams useful in large-scale parallel simulations. ### Using Seeds to Get Different Results For generator types that do not explicitly support independent streams, different seeds provide a method to create multiple streams. By using different seeds, you can create streams that return different values and act separately from one another. However, using a generator specifically designed for multiple independent streams is a better option, as the statistical properties across streams have been carefully verified. Create two streams with different seeds by using the Mersenne twister generator. s1 = RandStream('mt19937ar','Seed',1) s1 = mt19937ar random stream Seed: 1 NormalTransform: Ziggurat s2 = RandStream('mt19937ar','Seed',2) s2 = mt19937ar random stream Seed: 2 NormalTransform: Ziggurat Use the first stream in one MATLAB session to generate random numbers. r1 = rand(s1,100000,1); Use the second stream in another MATLAB session to generate random numbers. r2 = rand(s2,100000,1); With different seeds, streams typically return values that are uncorrelated. corrcoef([r1,r2]) ans = 2×2 1.0000 0.0030 0.0030 1.0000 The two streams with different seeds may appear uncorrelated since the state space of the Mersenne Twister is so much larger (${2}^{19937}$ elements) than the number of possible seeds (${2}^{32}$). The chances of overlap in different simulation runs are pretty remote unless you use a large number of different seeds. Using widely spaced seeds does not increase the level of randomness. In fact, taking this strategy to the extreme and reseeding a generator before each call can result in the sequence of values that are not statistically independent and identically distributed. Seeding a stream is most useful if you use it as an initialization step, perhaps at MATLAB startup, or before running a simulation. ### Using Substreams to Get Different Results Another method to get different results from a stream is to use substreams. Unlike seeds, where the locations along the sequence of random numbers are not exactly known, the spacing between substreams is known, so any chance of overlap can be eliminated. Like independent parallel streams, research has been done to demonstrate statistical independence across substreams. In short, substreams are a more controlled way to do many of the same things that seeds have traditionally been used for, and a more lightweight solution than parallel streams. Substreams provide a quick and easy way to ensure that you get different results from the same code at different times. For example, generate several random numbers in a loop. defaultStream = RandStream('mlfg6331_64'); RandStream.setGlobalStream(defaultStream) for i = 1:5 defaultStream.Substream = i; z = rand(1,i) end z = 0.6986 z = 1×2 0.9230 0.2489 z = 1×3 0.0261 0.2530 0.0737 z = 1×4 0.3220 0.7405 0.1983 0.1052 z = 1×5 0.2067 0.2417 0.9777 0.5970 0.4187 In another loop, you can generate random values that are independent from the first set of 5 iterations. for i = 6:10 defaultStream.Substream = i; z = rand(1,11-i) end z = 1×5 0.2650 0.8229 0.2479 0.0247 0.4581 z = 1×4 0.3963 0.7445 0.7734 0.9113 z = 1×3 0.2758 0.3662 0.7979 z = 1×2 0.6814 0.5150 z = 0.5247 Each of these substreams can reproduce its loop iteration. For example, you can return to the 6th substream in the loop. defaultStream.Substream = 6; z = rand(1,5) z = 1×5 0.2650 0.8229 0.2479 0.0247 0.4581
finemath-3plus
/**---------------------------------------------------------------------------- * _mini_test.h *----------------------------------------------------------------------------- * *----------------------------------------------------------------------------- * All rights reserved by Noh,Yonghwan ([email protected], [email protected]) *----------------------------------------------------------------------------- * 2014:3:2 22:51 created **---------------------------------------------------------------------------*/ #define assert_bool(expected_bool, return_bool_test_func) \ { \ ret = return_bool_test_func(); \ if (expected_bool == ret) \ { \ log_info "[pass] %s", #return_bool_test_func log_end \ _pass_count ++; \ } \ else \ { \ log_err "[fail] %s", #return_bool_test_func log_end \ _fail_count ++; \ } \ } #define assert_bool_with_param(expected_bool, return_bool_test_func, param) \ { \ ret = return_bool_test_func(param); \ if (expected_bool == ret) \ { \ log_info "[pass] %s", #return_bool_test_func log_end \ _pass_count ++; \ } \ else \ { \ log_err "[fail] %s", #return_bool_test_func log_end \ _fail_count ++; \ } \ }
somma/_MyLib-mini_test.h
// None of these declarations should have any errors! // Using typeof directly, these should be any var c: typeof c; var c: any; var d: typeof e; var d: any; var e: typeof d; var e: any; // In type arguments, these should be any interface Foo<T> { } var f: Array<typeof f>; var f: any; var f2: Foo<typeof f2>; var f2: any; var f3: Foo<typeof f3>[]; var f3: any; // Truly recursive types var g: { x: typeof g; }; var g: typeof g.x; var h: () => typeof h; var h = h(); var i: (x: typeof i) => typeof x; var i = i(i); var j: <T extends typeof j>(x: T) => T; var j = j(j); // Same as h, i, j with construct signatures var h2: new () => typeof h2; var h2 = new h2(); var i2: new (x: typeof i2) => typeof x; var i2 = new i2(i2); var j2: new <T extends typeof j2>(x: T) => T; var j2 = new j2(j2); // Indexers var k: { [n: number]: typeof k;[s: string]: typeof k }; var k = k[0]; var k = k['']; // Hybrid - contains type literals as well as type arguments // These two are recursive var hy1: { x: typeof hy1 }[]; var hy1 = hy1[0].x; var hy2: { x: Array<typeof hy2> }; var hy2 = hy2.x[0]; interface Foo2<T, U> { } // This one should be any because the first type argument is not contained inside a type literal var hy3: Foo2<typeof hy3, { x: typeof hy3 }>; var hy3: any;
jnetterf/typescript-react-jsx-tests/cases/conformance/types/specifyingTypes/typeQueries/recursiveTypesWithTypeof.ts
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501 OpenAPI spec version: v2.1 Contact: [email protected] Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class UserInfoList(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'users': 'list[UserInfo]' } attribute_map = { 'users': 'users' } def __init__(self, users=None): # noqa: E501 """UserInfoList - a model defined in Swagger""" # noqa: E501 self._users = None self.discriminator = None if users is not None: self.users = users @property def users(self): """Gets the users of this UserInfoList. # noqa: E501 # noqa: E501 :return: The users of this UserInfoList. # noqa: E501 :rtype: list[UserInfo] """ return self._users @users.setter def users(self, users): """Sets the users of this UserInfoList. # noqa: E501 :param users: The users of this UserInfoList. # noqa: E501 :type: list[UserInfo] """ self._users = users def to_dict(self): """Returns the model properties as a dict""" result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value if issubclass(UserInfoList, dict): for key, value in self.items(): result[key] = value return result def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) def __repr__(self): """For `print` and `pprint`""" return self.to_str() def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, UserInfoList): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """Returns true if both objects are not equal""" return not self == other
docusign/docusign-python-client-docusign_esign/models/user_info_list.py
import React, {Component, PropTypes} from 'react' import {ScoreDiv} from '../styles/Grid' export default class Score extends Component { render() { const {score, total} = this.props return <ScoreDiv> {score}/{total} </ScoreDiv> } } Score.PropTypes = { score: PropTypes.number.isRequired, total: PropTypes.number.isRequired }
rcdexta/react-scrabble-src/components/Score.js
Statsstøttet digital kunst - Tanker uge 35/2001 Digital kultur, retsliberalisme og kunst på vej Vertikal mere end dobbelt så god Vertikal udvider netværket. Nu er der to, der arbejder for at skabe en bedre Internet-verden: Martin Jørgensen og Steven Snedker K!ra Egg*rs på Vertikal.dk De søgte efter nøgenmodellen og stripperen 'K!ra Egg*rs' og fandt Vertikal.dk. Hvorfor folk finder os, når de leder efter K!ra Egg*rs.
c4-da
// Karma configuration // Generated on Wed Jun 10 2015 11:48:47 GMT-0400 (EDT) module.exports = function(config) { config.set({ // base path that will be used to resolve all patterns (eg. files, exclude) basePath: '', // frameworks to use // available frameworks: https://npmjs.org/browse/keyword/karma-adapter frameworks: ['jasmine'], // list of files / patterns to load in the browser files: [ 'app/bower_components/angular/angular.js', 'app/bower_components/angular-route/angular-route.js', 'app/bower_components/angular-resource/angular-resource.js', 'app/bower_components/angular-mocks/angular-mocks.js', 'app/bower_components/angular-drupal/angular-drupal.js', 'src/*.js', 'tests/DrupalSpec.js' ], // list of files to exclude exclude: [ ], // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor preprocessors: { }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter reporters: ['progress'], // web server port port: 9876, // enable / disable colors in the output (reporters and logs) colors: true, // level of logging // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG logLevel: config.LOG_INFO, // enable / disable watching file and executing tests whenever any file changes autoWatch: true, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher browsers: ['Chrome'], plugins: [ 'karma-chrome-launcher', 'karma-jasmine' ], // Continuous Integration mode // if true, Karma captures browsers, runs the tests and exits singleRun: false }); };
shaltie/shaspace-node_modules/angular-drupal/karma.conf.js
from distutils.core import setup, Extension include_dirs = [] library_dirs = [] libraries = [] runtime_library_dirs = [] extra_objects = [] define_macros = [] setup(name = "villa", version = "0.1", author = "Li Guangming", license = "MIT", url = "https://github.com/cute/villa", packages = ["villa"], ext_package = "villa", ext_modules = [Extension( name = "villa", sources = [ "src/pyvilla.c", "src/depot.c", "src/cabin.c", "src/myconf.c", "src/villa.c", ], include_dirs = include_dirs, library_dirs = library_dirs, runtime_library_dirs = runtime_library_dirs, libraries = libraries, extra_objects = extra_objects, define_macros = define_macros )], )
cute/villa-setup.py
Cabañas Las Marias Del Nahuel San Carlos de Bariloche, Ξενοδοχείο Αργεντινή. Περιορισμένη προσφορά ! « Επιστροφή Cabañas Las Marias Del Nahuel Δείτε κι άλλες φωτογραφίες Επιβεβαίωση τιμών και διαθεσιμότητας : Cabañas Las Marias Del Nahuel: Check in : Δείτε τις τιμές Cabañas Las Marias Del Nahuel - Περιγραφή Οικονομικό ξενοδοχείο τριώνΔιαβάστε τη συνέχεια αστέρων , θα σας προτείνει όλες τις ανέσεις, όπως Τηλεόραση, Συστημα κλιματισμού . Βρίσκεται στην διεύθυνση Avenida Bustillo 7000 στα βορειο-δυτικά της πόλης, σε απόσταση μονάχα 17 λεπτά με αυτοκίνητο από το κέντρο.Μη χάσετε τις ανέσεις που διατίθενται σε αυτό το ξενοδοχείο όπως jacuzzi.Διαθέτει επίσης κουζινούλα . Cabañas Las Marias Del Nahuel στιλ: Cabañas Las Marias Del Nahuel παροχές και υπηρεσίες Το ξενοδοχείο [RH] Rochester Bariloche προτείνει 12 δωμάτια, από Room δωμάτιο ως και 1 Apartment for 4 (2 adults+ 2 child). Η χαμηλότερη τιμή ξεκινά από 65 Ευρώ.Βρίσκεται στα βορειο-δυτικά, 17 λεπτά 226 m - Βρίσκεται στην διεύθυνση Sauco 15 στα βορειο-δυτικά της πόλης, σε απόσταση μονάχα 17 λεπτά με αυτοκίνητο από το κέντρο.Οικογενειακό ξενοδοχείο, το Catalonia Sur Aparts-Spa παρέχει όλες τις ανέσεις Πολυτελές ξενοδοχείο, το Charming Luxury Lodge And Private Spa Hotel παρέχει όλες τις ανέσεις όπως Εστιατόριο, Room service, Bar, Ανοιχτή ρεσεψιόν 24 / 24ωρο, Δωμάτια με αντικαπνιστική πολιτική, Πλυν Οικονομικό ξενοδοχείο, το Sur Encantado παρέχει όλες τις ανέσεις όπως n.a.. 16 λεπτά με αυτοκίνητο από το κέντρο, αυτό το ξενοδοχείο βρίσκεται στα βορειο-δυτικά της πόλης, στην διεύθυνση Av. Bustil Οικονομικό ξενοδοχείο, το Bungalows Unsur παρέχει όλες τις ανέσεις όπως n.a.. 17 λεπτά με αυτοκίνητο από το κέντρο, αυτό το ξενοδοχείο βρίσκεται στα δυτικά της πόλης, στην διεύθυνση Palo Santo 85. 575 m - Το ξενοδοχείο Apart Hotel Bungalows El Viejo Cipres προσφέρει όλες τις υπηρεσίες που θα μπορούσατε να περιμένετε από ένα ξενοδοχείο δύο αστέρων στην πόλη, όπως n.a.. Είναι κάτι περισσότερο από ένα Ο 17 λεπτά με αυτοκίνητο από το κέντρο, αυτό το ξενοδοχείο βρίσκεται στα δυτικά της πόλης, στην διεύθυνση Avenida Bustillo 7625. Είναι ιδανικό για να εξερευνήσετε το κέντρο και τα περίχωρα της πόλης.Ο Οικονομικό ξενοδοχείο, το Las Nieves παρέχει όλες τις ανέσεις όπως n.a.. 18 λεπτά με αυτοκίνητο από το κέντρο, αυτό το ξενοδοχείο βρίσκεται στα δυτικά της πόλης, στην διεύθυνση Av. Bustillo 7664. Ε Βρίσκεται στην διεύθ
c4-cy
/*- * See the file LICENSE for redistribution information. * * Copyright (c) 2000,2008 Oracle. All rights reserved. * * $Id: RuntimeExceptionWrapper.java,v 1.14.2.2 2008/01/07 15:14:21 cwl Exp $ */ package com.sleepycat.util; /** * A RuntimeException that can contain nested exceptions. * * @author Mark Hayes */ public class RuntimeExceptionWrapper extends RuntimeException implements ExceptionWrapper { private Throwable e; public RuntimeExceptionWrapper(Throwable e) { super(e.getMessage()); this.e = e; } /** * @deprecated replaced by {@link #getCause}. */ public Throwable getDetail() { return e; } public Throwable getCause() { return e; } }
nologic/nabs-client/trunk/shared/libraries/je-3.2.74/src/com/sleepycat/util/RuntimeExceptionWrapper.java
package co.uk.krisdan.postcode.exceptions; public class UsaTooLowPostCodeException extends TooLowPostCodeException { public UsaTooLowPostCodeException() { } public UsaTooLowPostCodeException(String message) { super(message); } public UsaTooLowPostCodeException(String message, String postCode) { super(message, postCode); } public UsaTooLowPostCodeException(Throwable cause, String postCode) { super(cause, postCode); } public UsaTooLowPostCodeException(String message, Throwable cause, String postCode) { super(message, cause, postCode); } public UsaTooLowPostCodeException(String message, String postCode, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, postCode, cause, enableSuppression, writableStackTrace); } @Override public String getLocalizedMessage() { return this.tooLowMsg(); } @Override protected String tooLowMsg() { String newLine = System.lineSeparator(); String message; message = "This United States Post Code does not exist" + newLine; message += "because it is less than 00000." + newLine; message += "Please ensure that its value is 00000 or" + newLine; message += "between 00001 and 03999" + newLine; return message; } }
krisdan/postcode-src/main/java/co/uk/krisdan/postcode/exceptions/UsaTooLowPostCodeException.java
/* Problem: https://www.hackerrank.com/challenges/maximum-element/problem Language : C++ Tool Version : Visual Studio Community 2017 Thoughts : 1. Let the maximum element present in stack be max. Initialize max to 0. 2. Start a loop to process next queries: 2.1 Next query push: - Let the new element be e. - If e > max then set max = e. - Push e to top of the stack. - Increment top of stack by 1. 2.2 Next query Delete: - If element at top of stack is not same as max then remove the element from top of stack and decrement top of stack by 1. - If element at top of stack is same as max then - Remove the element from top of stack and decrement top of stack by 1. - Set max to 0. - Scan the remaining stack and set max to the highest element present in remaining stack. 2.3 Next query print: - Print the element at the top of the stack. Time Complexity: Push operation - O(1), Delete operation - O(n), Print Operation - O(1) Space Complexity: Push operation - O(1), Delete operation - O(1), Print Operation - O(1) //number of dynamically allocated variables remain constant for any input. */ int main() { long stack[100000]; int queryType = 0; int numberOfQueries = 0; long topOfStack = -1; long iterator = 0; long numberToBeInserted = 0; long maximumNumber = 0 ; scanf("%d", &numberOfQueries); while (numberOfQueries > 0) { //scan query type scanf("%d", &queryType); //do stack operations switch (queryType) { case 1: //push scanf("%ld", &numberToBeInserted); if (numberToBeInserted > maximumNumber) maximumNumber = numberToBeInserted; stack[++topOfStack] = numberToBeInserted; break; case 2: //delete if (stack[topOfStack] == maximumNumber) { topOfStack--; //current maximum is going to get deleted. We need to set up a new maximum by scanning the stack maximumNumber = 0; iterator = topOfStack; while (iterator > -1) { maximumNumber = stack[iterator] > maximumNumber ? stack[iterator] : maximumNumber; iterator--; } } else topOfStack--; break; case 3: //print maximum element printf("%ld\n", maximumNumber); break; } numberOfQueries--; } return 0; }
RyanFehr/HackerRank-DataStructures/Stacks/Maximum Element/Solution.cpp
/** * @fileoverview Rule to flag when re-assigning native objects * @author Ilya Volodin */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = function(context) { var config = context.options[0]; var exceptions = (config && config.exceptions) || []; /** * Reports write references. * @param {Reference} reference - A reference to check. * @param {int} index - The index of the reference in the references. * @param {Reference[]} references - The array that the reference belongs to. * @returns {void} */ function checkReference(reference, index, references) { var identifier = reference.identifier; if (reference.init === false && reference.isWrite() && // Destructuring assignments can have multiple default value, // so possibly there are multiple writeable references for the same identifier. (index === 0 || references[index - 1].identifier !== identifier) ) { context.report({ node: identifier, message: "{{name}} is a read-only native object.", data: identifier }); } } /** * Reports write references if a given variable is readonly builtin. * @param {Variable} variable - A variable to check. * @returns {void} */ function checkVariable(variable) { if (variable.writeable === false && exceptions.indexOf(variable.name) === -1) { variable.references.forEach(checkReference); } } return { "Program": function() { var globalScope = context.getScope(); globalScope.variables.forEach(checkVariable); } }; }; module.exports.schema = [ { "type": "object", "properties": { "exceptions": { "type": "array", "items": {"type": "string"}, "uniqueItems": true } }, "additionalProperties": false } ];
diztinct-tim/PTS-node_modules/grunt-eslint/node_modules/eslint/lib/rules/no-native-reassign.js
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Setup file for ontology validator.""" from setuptools import find_packages from setuptools import setup # with open("README.md", "r") as fh: # long_description = fh.read() setup( name='ontology-yaml-validator', version='0.0.1', url='https://github.com/google/digitalbuildings', license='Apache License', author='', author_email='', description='', packages=find_packages(), install_requires=['absl-py', 'pyglib', 'pyyaml>=5.3', 'argparse'], python_requires='>=3.6', )
google/digitalbuildings-tools/validators/ontology_validator/setup.py
describe('CacheFactory.get(cacheId)', function () { it('should return "undefined" if the cache does not exist.', function (done) { assert.isUndefined(TestCacheFactory.get('someNonExistentCache')); done(); }); it('should return the correct cache with the specified cacheId.', function (done) { var cache = TestCacheFactory('CacheFactory.get.cache'), cache2 = TestCacheFactory('CacheFactory.get.cache2'); assert.equal(TestCacheFactory.get('CacheFactory.get.cache'), cache); assert.equal(TestCacheFactory.get('CacheFactory.get.cache2'), cache2); assert.notEqual(cache, cache2); done(); }); });
Malkiat-Singh/angular-cache-test/unit/DSCacheFactory/index.get.test.js
import expect from 'expect'; import * as types from '../src/shared/constants/ActionTypes'; import { books, errorMessage } from '../src/shared/reducers'; const initialState = { isFetching: false, items: [], data: {} }; describe('books reducer', () => { it('should return the initial state', () => { expect( books(undefined, {}) ).toEqual(initialState); }); it('should return the current state', () => { const state = { isFetching: false, items: ['infinite-jest'], data: { 'infinite-jest': { id: 'infinite-jest', title: 'Infinite Jest', author: 'David Foster Wallace' } } }; expect( books(state, {}) ).toEqual(state); }); it('should set isFetching for REQUEST_BOOKS', () => { expect( books(undefined, { type: types.REQUEST_BOOKS }).isFetching ).toBe(true); }); it('should handle ADD_BOOK', () => { const payload = { 'id': 'infinite-jest', 'title': 'Infinite Jest', 'author': 'David Foster Wallace' }; const nextState = { isFetching: false, items: ['infinite-jest'], data: { 'infinite-jest': { id: 'infinite-jest', title: 'Infinite Jest', author: 'David Foster Wallace' } } }; expect( books(initialState, { type: types.ADD_BOOK, payload })).toEqual(nextState); }); }); describe('errorMessage reducer', () => { it('should handle SET_ERROR', () => { expect( errorMessage(undefined, { type: types.SET_ERROR, error: 'I AM AN ERROR' }) ).toBe('I AM AN ERROR'); }); it('should return the error', () => { expect( errorMessage('HEY', {}) ).toBe('HEY'); }); it('should handle RESET_ERROR', () => { expect( errorMessage('HEY', { type: types.RESET_ERROR }) ).toBe(null); }); });
nadavspi/react-bookshelf-test/reducers.js
# Copyright (c) 2011 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """This modules stubs out functions in cinder.utils.""" import re from eventlet import greenthread import six _fake_execute_repliers = [] _fake_execute_log = [] def fake_execute_get_log(): return _fake_execute_log def fake_execute_clear_log(): global _fake_execute_log _fake_execute_log = [] def fake_execute_set_repliers(repliers): """Allows the client to configure replies to commands.""" global _fake_execute_repliers _fake_execute_repliers = repliers def fake_execute_default_reply_handler(*ignore_args, **ignore_kwargs): """A reply handler for commands that haven't been added to the reply list. Returns empty strings for stdout and stderr. """ return '', '' def fake_execute(*cmd_parts, **kwargs): """This function stubs out execute. It optionally executes a preconfigued function to return expected data. """ global _fake_execute_repliers process_input = kwargs.get('process_input', None) check_exit_code = kwargs.get('check_exit_code', 0) delay_on_retry = kwargs.get('delay_on_retry', True) attempts = kwargs.get('attempts', 1) run_as_root = kwargs.get('run_as_root', False) cmd_str = ' '.join(str(part) for part in cmd_parts) _fake_execute_log.append(cmd_str) reply_handler = fake_execute_default_reply_handler for fake_replier in _fake_execute_repliers: if re.match(fake_replier[0], cmd_str): reply_handler = fake_replier[1] break if isinstance(reply_handler, six.string_types): # If the reply handler is a string, return it as stdout reply = reply_handler, '' else: # Alternative is a function, so call it reply = reply_handler(cmd_parts, process_input=process_input, delay_on_retry=delay_on_retry, attempts=attempts, run_as_root=run_as_root, check_exit_code=check_exit_code) # Replicate the sleep call in the real function greenthread.sleep(0) return reply
phenoxim/cinder-cinder/tests/unit/fake_utils.py
// Type definitions for graphql 0.11 // Project: https://www.npmjs.com/package/graphql // Definitions by: TonyYang <https://github.com/TonyPythoneer> // Caleb Meredith <https://github.com/calebmer> // Dominic Watson <https://github.com/intellix> // Firede <https://github.com/firede> // Kepennar <https://github.com/kepennar> // Mikhail Novikov <https://github.com/freiksenet> // Ivan Goncharov <https://github.com/IvanGoncharov> // Hagai Cohen <https://github.com/DxCx> // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 // The primary entry point into fulfilling a GraphQL request. export { graphql } from './graphql'; // Create and operate on GraphQL type definitions and schema. export * from './type'; // Parse and operate on GraphQL language source files. export * from './language'; export * from './subscription'; // Execute GraphQL queries. export { execute, defaultFieldResolver, responsePathAsArray, getDirectiveValues, ExecutionResult, } from './execution'; // Validate GraphQL queries. export { validate, ValidationContext, // All validation rules in the GraphQL Specification. specifiedRules, // Individual validation rules. ArgumentsOfCorrectTypeRule, DefaultValuesOfCorrectTypeRule, FieldsOnCorrectTypeRule, FragmentsOnCompositeTypesRule, KnownArgumentNamesRule, KnownDirectivesRule, KnownFragmentNamesRule, KnownTypeNamesRule, LoneAnonymousOperationRule, NoFragmentCyclesRule, NoUndefinedVariablesRule, NoUnusedFragmentsRule, NoUnusedVariablesRule, OverlappingFieldsCanBeMergedRule, PossibleFragmentSpreadsRule, ProvidedNonNullArgumentsRule, ScalarLeafsRule, SingleFieldSubscriptionsRule, UniqueArgumentNamesRule, UniqueDirectivesPerLocationRule, UniqueFragmentNamesRule, UniqueInputFieldNamesRule, UniqueOperationNamesRule, UniqueVariableNamesRule, VariablesAreInputTypesRule, VariablesInAllowedPositionRule, } from './validation'; // Create and format GraphQL errors. export { GraphQLError, formatError, GraphQLFormattedError, GraphQLErrorLocation, } from './error'; // Utilities for operating on GraphQL type schema and parsed sources. export { // The GraphQL query recommended for a full schema introspection. introspectionQuery, // Gets the target Operation from a Document getOperationAST, // Build a GraphQLSchema from an introspection result. buildClientSchema, // Build a GraphQLSchema from a parsed GraphQL Schema language AST. buildASTSchema, // Build a GraphQLSchema from a GraphQL schema language document. buildSchema, // Extends an existing GraphQLSchema from a parsed GraphQL Schema // language AST. extendSchema, // Print a GraphQLSchema to GraphQL Schema language. printSchema, // Print a GraphQLType to GraphQL Schema language. printType, // Create a GraphQLType from a GraphQL language AST. typeFromAST, // Create a JavaScript value from a GraphQL language AST. valueFromAST, // Create a GraphQL language AST from a JavaScript value. astFromValue, // A helper to use within recursive-descent visitors which need to be aware of // the GraphQL type system. TypeInfo, // Determine if JavaScript values adhere to a GraphQL type. isValidJSValue, // Determine if AST values adhere to a GraphQL type. isValidLiteralValue, // Concatenates multiple AST together. concatAST, // Separates an AST into an AST per Operation. separateOperations, // Comparators for types isEqualType, isTypeSubTypeOf, doTypesOverlap, // Asserts a string is a valid GraphQL name. assertValidName, // Compares two GraphQLSchemas and detects breaking changes. findBreakingChanges, // Report all deprecated usage within a GraphQL document. findDeprecatedUsages, BreakingChange, IntrospectionDirective, IntrospectionEnumType, IntrospectionEnumValue, IntrospectionField, IntrospectionInputObjectType, IntrospectionInputValue, IntrospectionInterfaceType, IntrospectionListTypeRef, IntrospectionNamedTypeRef, IntrospectionNonNullTypeRef, IntrospectionObjectType, IntrospectionQuery, IntrospectionScalarType, IntrospectionSchema, IntrospectionType, IntrospectionTypeRef, IntrospectionUnionType, } from './utilities';
abbasmhd/DefinitelyTyped-types/graphql/index.d.ts
// Created file "Lib\src\ehstorguids\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(PKEY_Contact_HomeAddress, 0x98f98354, 0x617a, 0x46b8, 0x85, 0x60, 0x5b, 0x1b, 0x64, 0xbf, 0x1f, 0x89);
Frankie-PellesC/fSDK-Lib/src/ehstorguids/guids00000381.c
import pyaf.Bench.TS_datasets as tsds import tests.artificial.process_artificial_dataset as art art.process_dataset(N = 128 , FREQ = 'D', seed = 0, trendtype = "PolyTrend", cycle_length = 0, transform = "None", sigma = 0.0, exog_count = 20, ar_order = 12);
antoinecarme/pyaf-tests/artificial/transf_None/trend_PolyTrend/cycle_0/ar_12/test_artificial_128_None_PolyTrend_0_12_20.py
/*! * headroom.js v0.7.0 - Give your page some headroom. Hide your header until you need it * Copyright (c) 2014 Nick Williams - http://wicky.nillia.ms/headroom.js * License: MIT */ !function(a){a&&(a.fn.headroom=function(b){return this.each(function(){var c=a(this),d=c.data("headroom"),e="object"==typeof b&&b;e=a.extend(!0,{},Headroom.options,e),d||(d=new Headroom(this,e),d.init(),c.data("headroom",d)),"string"==typeof b&&d[b]()})},a("[data-headroom]").each(function(){var b=a(this);b.headroom(b.data())}))}(window.Zepto||window.jQuery); jQuery(document).ready(function($) { $(".headroom").headroom({ "tolerance": 20, "offset": 50, "classes": { "initial": "animated", "pinned": "slideDown", "unpinned": "slideUp" } }); });
shoaibafzal/Tiptop-musik-SilverStripe-themes/Tiptop/js/jQuery.headroom.min.js
////////////////////////////////////////////////////////////////////////// // // Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), // its affiliates and/or its licensors. // // Copyright (c) 2010-2014, Image Engine Design Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // * Neither the name of Image Engine Design nor the names of any // other contributors to this software may be used to endorse or // promote products derived from this software without specific prior // written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS // IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // ////////////////////////////////////////////////////////////////////////// #ifndef IECOREHOUDINI_TYPEIDS_H #define IECOREHOUDINI_TYPEIDS_H namespace IECoreHoudini { /// Define Cortex Type Ids for our converter class. enum TypeId { FromHoudiniConverterTypeId = 111000, FromHoudiniGeometryConverterTypeId = 111001, FromHoudiniPointsConverterTypeId = 111002, FromHoudiniPolygonsConverterTypeId = 111003, ToHoudiniConverterTypeId = 111004, ToHoudiniGeometryConverterTypeId = 111005, ToHoudiniPointsConverterTypeId = 111006, ToHoudiniPolygonsConverterTypeId = 111007, FromHoudiniCurvesConverterTypeId = 111008, ToHoudiniCurvesConverterTypeId = 111009, ToHoudiniAttribConverterTypeId = 111010, ToHoudiniFloatDetailAttribConverterTypeId = 111011, ToHoudiniV2fDetailAttribConverterTypeId = 111012, ToHoudiniV3fDetailAttribConverterTypeId = 111013, ToHoudiniColor3fDetailAttribConverterTypeId = 111014, ToHoudiniIntDetailAttribConverterTypeId = 111015, ToHoudiniV2iDetailAttribConverterTypeId = 111016, ToHoudiniV3iDetailAttribConverterTypeId = 111017, ToHoudiniFloatVectorAttribConverterTypeId = 111018, ToHoudiniV2fVectorAttribConverterTypeId = 111019, ToHoudiniV3fVectorAttribConverterTypeId = 111020, ToHoudiniColor3fVectorAttribConverterTypeId = 111021, ToHoudiniIntVectorAttribConverterTypeId = 111022, ToHoudiniV2iVectorAttribConverterTypeId = 111023, ToHoudiniV3iVectorAttribConverterTypeId = 111024, FromHoudiniGroupConverterTypeId = 111025, ToHoudiniGroupConverterTypeId = 111026, ToHoudiniStringDetailAttribConverterTypeId = 111027, ToHoudiniStringVectorAttribConverterTypeId = 111028, RATDeepImageReaderTypeId = 111029, RATDeepImageWriterTypeId = 111030, LiveSceneTypeId = 111031, FromHoudiniCortexObjectConverterTypeId = 111032, ToHoudiniCortexObjectConverterTypeId = 111033, FromHoudiniCompoundObjectConverterTypeId = 111034, ToHoudiniCompoundObjectConverterTypeId = 111035, ToHoudiniQuatVectorAttribConverterTypeId = 111036, // remember to update TypeIdBinding.cpp LastTypeId = 111999, }; } // namespace IECoreHoudini #endif /* IECOREHOUDINI_TYPEIDS_H */
goddardl/cortex-include/IECoreHoudini/TypeIds.h
""" Disjoint set data structure """ class DisjointSet: """ Disjoint set data structure for incremental connectivity queries. .. versionadded:: 1.6.0 Attributes ---------- n_subsets : int The number of subsets. Methods ------- add merge connected subset subsets __getitem__ Notes ----- This class implements the disjoint set [1]_, also known as the *union-find* or *merge-find* data structure. The *find* operation (implemented in `__getitem__`) implements the *path halving* variant. The *merge* method implements the *merge by size* variant. References ---------- .. [1] https://en.wikipedia.org/wiki/Disjoint-set_data_structure Examples -------- >>> from scipy.cluster.hierarchy import DisjointSet Initialize a disjoint set: >>> disjoint_set = DisjointSet([1, 2, 3, 'a', 'b']) Merge some subsets: >>> disjoint_set.merge(1, 2) True >>> disjoint_set.merge(3, 'a') True >>> disjoint_set.merge('a', 'b') True >>> disjoint_set.merge('b', 'b') False Find root elements: >>> disjoint_set[2] 1 >>> disjoint_set['b'] 3 Test connectivity: >>> disjoint_set.connected(1, 2) True >>> disjoint_set.connected(1, 'b') False List elements in disjoint set: >>> list(disjoint_set) [1, 2, 3, 'a', 'b'] Get the subset containing 'a': >>> disjoint_set.subset('a') {'a', 3, 'b'} Get all subsets in the disjoint set: >>> disjoint_set.subsets() [{1, 2}, {'a', 3, 'b'}] """ def __init__(self, elements=None): self.n_subsets = 0 self._sizes = {} self._parents = {} # _nbrs is a circular linked list which links connected elements. self._nbrs = {} # _indices tracks the element insertion order in `__iter__`. self._indices = {} if elements is not None: for x in elements: self.add(x) def __iter__(self): """Returns an iterator of the elements in the disjoint set. Elements are ordered by insertion order. """ return iter(self._indices) def __len__(self): return len(self._indices) def __contains__(self, x): return x in self._indices def __getitem__(self, x): """Find the root element of `x`. Parameters ---------- x : hashable object Input element. Returns ------- root : hashable object Root element of `x`. """ if x not in self._indices: raise KeyError(x) # find by "path halving" parents = self._parents while self._indices[x] != self._indices[parents[x]]: parents[x] = parents[parents[x]] x = parents[x] return x def add(self, x): """Add element `x` to disjoint set """ if x in self._indices: return self._sizes[x] = 1 self._parents[x] = x self._nbrs[x] = x self._indices[x] = len(self._indices) self.n_subsets += 1 def merge(self, x, y): """Merge the subsets of `x` and `y`. The smaller subset (the child) is merged into the larger subset (the parent). If the subsets are of equal size, the root element which was first inserted into the disjoint set is selected as the parent. Parameters ---------- x, y : hashable object Elements to merge. Returns ------- merged : bool True if `x` and `y` were in disjoint sets, False otherwise. """ xr = self[x] yr = self[y] if self._indices[xr] == self._indices[yr]: return False sizes = self._sizes if (sizes[xr], self._indices[yr]) < (sizes[yr], self._indices[xr]): xr, yr = yr, xr self._parents[yr] = xr self._sizes[xr] += self._sizes[yr] self._nbrs[xr], self._nbrs[yr] = self._nbrs[yr], self._nbrs[xr] self.n_subsets -= 1 return True def connected(self, x, y): """Test whether `x` and `y` are in the same subset. Parameters ---------- x, y : hashable object Elements to test. Returns ------- result : bool True if `x` and `y` are in the same set, False otherwise. """ return self._indices[self[x]] == self._indices[self[y]] def subset(self, x): """Get the subset containing `x`. Parameters ---------- x : hashable object Input element. Returns ------- result : set Subset containing `x`. """ if x not in self._indices: raise KeyError(x) result = [x] nxt = self._nbrs[x] while self._indices[nxt] != self._indices[x]: result.append(nxt) nxt = self._nbrs[nxt] return set(result) def subsets(self): """Get all the subsets in the disjoint set. Returns ------- result : list Subsets in the disjoint set. """ result = [] visited = set() for x in self: if x not in visited: xset = self.subset(x) visited.update(xset) result.append(xset) return result
grlee77/scipy-scipy/_lib/_disjoint_set.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2011-2012 Andrey Sibiryov <[email protected]> # Copyright (c) 2011-2015 Anton Tyurin <[email protected]> # Copyright (c) 2013+ Evgeny Safronov <[email protected]> # Copyright (c) 2011-2013 Other contributors as noted in the AUTHORS file. # # This file is part of Cocaine. # # Cocaine is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # Cocaine is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # import os import re from setuptools import setup if 'DEB_BUILD_GNU_TYPE' in os.environ: tools_data = [ ('/etc/bash_completion.d/', ["scripts/bash_completion.d/cocaine-tool"]) ] else: tools_data = [] try: with open('cocaine/tools/version.py', 'r') as version_file: version = re.search("__version__ = \"(.+)\"", version_file.read()).groups()[0] except Exception as err: raise Exception("unable to identify version: %s" % err) setup( name="cocaine-tools", version=version, author="Anton Tyurin", author_email="[email protected]", maintainer='Evgeny Safronov', maintainer_email='[email protected]', url="https://github.com/cocaine/cocaine-tools", description="Cocaine Tools for Cocaine Application Cloud.", long_description="Tools for deploying and managing applications in the cloud", license="LGPLv3+", platforms=["Linux", "BSD", "MacOS"], namespace_packages=['cocaine'], include_package_data=True, zip_safe=False, packages=[ "cocaine", "cocaine.proxy", "cocaine.tools", "cocaine.tools.actions", "cocaine.tools.actions.access", "cocaine.tools.actions.mql", "cocaine.tools.helpers", "cocaine.tools.interactive", "cocaine.tools.plugins", "cocaine.tools.plugins.secure", ], entry_points={ 'console_scripts': [ 'cocaine-tool = cocaine.tools.cocaine_tool:main', 'cocaine-tornado-proxy = cocaine.proxy.proxy:main', ]}, install_requires=open('./requirements.txt').read(), tests_require=open('./tests/requirements.txt').read(), test_suite='nose.collector', classifiers=[ 'Programming Language :: Python', # 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', # 'Programming Language :: Python :: 3.2', # 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', "Programming Language :: Python :: Implementation :: CPython", # 'Development Status :: 1 - Planning', # 'Development Status :: 2 - Pre-Alpha', # 'Development Status :: 3 - Alpha', 'Development Status :: 4 - Beta', # 'Development Status :: 5 - Production/Stable', # 'Development Status :: 6 - Mature', # 'Development Status :: 7 - Inactive', ], )
antmat/cocaine-tools-setup.py
import validateCacheSize from './util/validateCacheSize'; import isStringOrNumber from './util/isStringOrNumber'; export default class FifoObjectCache { constructor({cacheSize} = {}) { validateCacheSize(cacheSize); this._cache = {}; this._cacheOrdering = []; this._cacheSize = cacheSize; } set(key, selectorFn) { this._cache[key] = selectorFn; this._cacheOrdering.push(key); if (this._cacheOrdering.length > this._cacheSize) { const earliest = this._cacheOrdering[0]; this.remove(earliest); } } get(key) { return this._cache[key]; } remove(key) { const index = this._cacheOrdering.indexOf(key); if (index > -1) { this._cacheOrdering.splice(index, 1); } delete this._cache[key]; } clear() { this._cache = {}; this._cacheOrdering = []; } isValidCacheKey(cacheKey) { return isStringOrNumber(cacheKey); } }
toomuchdesign/re-reselect-src/cache/FifoObjectCache.js
""" A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given: 1/2 = 0.5 1/3 = 0.(3) 1/4 = 0.25 1/5 = 0.2 1/6 = 0.1(6) 1/7 = 0.(142857) 1/8 = 0.125 1/9 = 0.(1) 1/10 = 0.1 Where 0.1(6) means 0.166666..., and has a 1-digit recurring cycle. It can be seen that 1/7 has a 6-digit recurring cycle. Find the value of d < 1000 for which 1/d contains the longest recurring cycle in its decimal fraction part. """ def getRepetitionLength(N): dividends = [] div = 1 prev = 0 additional = 0 while True: if div == 0: return 0 while div < N: div *= 10 prev += 1 else: if div in dividends: break dividends.append(div) div = div % N additional += prev - 1 prev = 0 return(len(dividends) - dividends.index(div) + additional) maxr, d = 0, 0 for i in range(1, 1000): if getRepetitionLength(i) > maxr: maxr, d = getRepetitionLength(i), i print(d)
adiultra/pysick-projecteuler/p26.py
/******************************************************************************* * * * Copyright 2008, Huawei Technologies Co. Ltd. * ALL RIGHTS RESERVED * *------------------------------------------------------------------------------- * * igmpv3_sh_init.h * * Project Code: VISPV100R007 * Module Name: * Date Created: 2008-03-11 * Author: zengshaoyang62531 * Description: * *------------------------------------------------------------------------------- * Modification History * DATE NAME DESCRIPTION * ----------------------------------------------------------------------------- * 2008-03-11 zengshaoyang62531 Create * *******************************************************************************/ #ifndef _IGMPV3_SH_INIT_H_ #define _IGMPV3_SH_INIT_H_ #ifdef __cplusplus extern "C"{ #endif /* __cplusplus */ #define IP_IGMP_SH_INIT ((SYSTRC_IP_IGMP_BASE << 8) + 40) #define IP_IGMP_SH_IC ((SYSTRC_IP_IGMP_BASE << 8) + 41) #ifdef __cplusplus } #endif /* __cplusplus */ #endif
Honor8Dev/android_kernel_huawei_FRD-L04-drivers/vendor/hisi/modem/include/visp/tcpip/igmp4/shell/include/igmpv3_sh_init.h
# coding: utf-8 # This is a small script to download / update the Parable sources # under Pythonista. import requests import os.path import sys urls = ['https://raw.githubusercontent.com/crcx/parable/master/py/allegory', 'https://raw.githubusercontent.com/crcx/parable/master/py/parable.py', 'https://raw.githubusercontent.com/crcx/parable/master/py/stdlib.p', 'https://raw.githubusercontent.com/crcx/parable/master/py/interfaces/listener.py', ] print('Downloading') for url in urls: sys.stdout.write(' ' + os.path.basename(url) + '\t\t') r = requests.get(url) if os.path.basename(url) == 'allegory': fn = os.path.basename(url) + '.py' else: fn = os.path.basename(url) with open(fn, 'w') as f: f.write(r.content.decode()) print(str(len(r.content)) + ' bytes') print('Finished')
crcx/parable-source/tools/download.py
/******************************************************************************* Copyright 2013 Arciem LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *******************************************************************************/ #import "CView.h" #import "CMultiChoiceItem.h" #import "CMiniPickerFrameView.h" #import "CMiniPickerViewCell.h" #import "CMiniPickerBackgroundView.h" #import "CMiniPickerOverlayView.h" @protocol CMiniPickerViewDelegate; @interface CMiniPickerView : CView @property (strong, nonatomic) CMultiChoiceItem* model; @property (strong, nonatomic) UIFont* font; @property (weak, nonatomic) id<CMiniPickerViewDelegate> delegate; @end @protocol CMiniPickerViewDelegate <NSObject> @required - (CGFloat)miniPickerView:(CMiniPickerView*)view widthForColumnIndex:(NSUInteger)index; @end
arciem/LibArciem-Arciem/iOS/CMiniPicker/CMiniPickerView.h
// // JMUIChattingKit.h // JMUIChattingKit // // Created by oshumini on 16/1/8. // Copyright © 2016年 HuminiOS. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for JMUIChattingKit. FOUNDATION_EXPORT double JMUIChattingKitVersionNumber; //! Project version string for JMUIChattingKit. FOUNDATION_EXPORT const unsigned char JMUIChattingKitVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <JMUIChattingKit/PublicHeader.h>
jpush/jmessage-ios-uikit-JMUIChattingKit/JMUIChattingKit/JMUIChattingKit.h
class ExternalMemory::WebServer def get_tweet_element_by_tweet_id(source_id, tweet_id) json(200, twitter_element_by_tweet_id_or_not_found(source_id, tweet_id).to_json({:element => :full})) end def get_tweet_element_by_element_id(source_id, element_id) json(200, twitter_element_by_element_id_or_not_found(source_id, element_id).to_json({:element => :full})) end def get_tweet_elements_by_source(source_id) source = twitter_source_by_id_or_not_found(source_id) tweets = TweetElement. with_element. by_source(source). order_by_timestamp. paginate(params[:page], params[:per_page]) json( 200, {'tweetElements' => tweets.collect { |t| t.to_json }}, pagination_header(tweets) ) end def search_tweet_elements(source_id, search_query) twitter_source = twitter_source_by_id_or_not_found(source_id) begin tweet_elements = search_elements_in_twitter_source(twitter_source, search_query) json( 200, {'tweetElements' => tweet_elements.collect { |t| t.to_json }} ) rescue Exception => e flash_error('Error while searching') json_error(503, 'Error while searching') end end private def twitter_source_by_id_or_not_found(source_id) not_found_if_empty(Source.by_id(ExternalMemory::Source::TWITTER_TYPE, source_id), 'source', source_id) end def twitter_element_by_element_id_or_not_found(source_id, element_id) source = twitter_source_by_id_or_not_found(source_id) not_found_if_empty(TweetElement.with_element.by_source(source).by_element_id(element_id), 'tweet element', element_id) end def twitter_element_by_tweet_id_or_not_found(source_id, tweet_id) source = twitter_source_by_id_or_not_found(source_id) not_found_if_empty(TweetElement.with_element.by_source(source).by_tweet_id(tweet_id), 'tweet element', tweet_id) end end require_relative 'tweet_element_get_declaration'
archiloque/external-memory-server/web_server/api/twitter/tweet_element_get.rb
"""The UCB module contains functions specific to 61A projects at UC Berkeley.""" import code import functools import inspect import signal import sys def main(fn): """Call fn with command line arguments. Used as a decorator. The main decorator marks the function that starts a program. For example, @main def my_run_function(): # function body Use this instead of the typical __name__ == "__main__" predicate. """ if inspect.stack()[1][0].f_locals['__name__'] == '__main__': args = sys.argv[1:] # Discard the script name from command line fn(*args) # Call the main function return fn _PREFIX = '' def trace(fn): """A decorator that prints a function's name, its arguments, and its return values each time the function is called. For example, @trace def compute_something(x, y): # function body """ @functools.wraps(fn) def wrapped(*args, **kwds): global _PREFIX reprs = [repr(e) for e in args] reprs += [repr(k) + '=' + repr(v) for k, v in kwds.items()] log('{0}({1})'.format(fn.__name__, ', '.join(reprs)) + ':') _PREFIX += ' ' try: result = fn(*args, **kwds) _PREFIX = _PREFIX[:-4] except Exception as e: log(fn.__name__ + ' exited via exception') _PREFIX = _PREFIX[:-4] raise # Here, print out the return value. log('{0}({1}) -> {2}'.format(fn.__name__, ', '.join(reprs), result)) return result return wrapped def log(message): """Print an indented message (used with trace).""" message = str(message) print(_PREFIX + re.sub('\n', '\n' + _PREFIX, message)) def log_current_line(): """Print information about the current line of code.""" frame = inspect.stack()[1] log('Current line: File "{f[1]}", line {f[2]}, in {f[3]}'.format(f=frame)) def interact(msg=None): """Start an interactive interpreter session in the current environment. On Unix: <Control>-D exits the interactive session and returns to normal execution. In Windows: <Control>-Z <Enter> exits the interactive session and returns to normal execution. """ # evaluate commands in current namespace frame = inspect.currentframe().f_back namespace = frame.f_globals.copy() namespace.update(frame.f_locals) # exit on interrupt def handler(signum, frame): print() exit(0) signal.signal(signal.SIGINT, handler) if not msg: _, filename, line, _, _, _ = inspect.stack()[1] msg = 'Interacting at File "{0}", line {1} \n'.format(filename, line) msg += ' Unix: <Control>-D continues the program; \n' msg += ' Windows: <Control>-Z <Enter> continues the program; \n' msg += ' exit() or <Control>-C exits the program' code.interact(msg, None, namespace)
tavaresdong/courses-ucb_cs61A/projects/maps/ucb.py
// This stuff doesnt work :( - set endianness manually #if defined(__LITTLE_ENDIAN__) || defined(TARGET_LITTLE_ENDIAN) # define BYTE_ORDER LITTLE_ENDIAN #elif defined(__BIG_ENDIAN__) || defined(TARGET_BIG_ENDIAN) # define BYTE_ORDER BIG_ENDIAN #else //#warning Compiler is silent about endianness #define BYTE_ORDER BIG_ENDIAN #endif
animotron/animos-include/mips/arch/arch_endian.h
// See hashMatcher.cpp for comments #ifndef hashMatcher_h #define hashMatcher_h void add(uint64_t hash, uint64_t dbId); void printUsageAndExit(); void processCommand(const char* command); void readCommands(int socket); void search(uint64_t hash, unsigned char maxDistance); void* searchThread(void* threadParam); #endif
CreativeCommons-Seneca/registry-searcher/hashMatcher.h
module.exports = require('./overArgs');
ChrisChenSZ/code-表单注册验证/node_modules/lodash/fp/useWith.js
var Fundlist = { params: { strategy: '', category: '', inceptionYear: 0, sortBy: 'year_income_rate', offset: 0, count: 20, searchWord: '' }, init: function() { this.fetchData(); this.bindEvent(); }, fetchData: function() { var self = this; $.ajax({ url: encodeURI('https://www.juchaomu.com/apisimu/queryproducts'), type: 'GET', dataType: 'json', data: { strategy: self.params.strategy, category: self.params.category, inceptionYear: self.params.inceptionYear, sortBy: self.params.sortBy, offset: self.params.offset, count: self.params.count, searchWord: self.params.searchWord, userId: CommonData.userId, token: CommonData.token }, complete: function(xhr, status) { if (status == 'success') { var resp = $.parseJSON(xhr.response); if ($.type(resp) == 'object') { if (resp.status == 1) { if (resp.data) { self.processData(resp.data); } else { DahuoCore.toast({content: '加载失败,请稍后再试'}); } } else if (resp.status == 0) { DahuoCore.toast({content: resp.msg}); } else { DahuoCore.toast({content: '加载失败,请稍后再试'}); } } else { DahuoCore.toast({content: '加载失败,请稍后再试'}); } } else { DahuoCore.toast({content: '加载失败,请稍后再试'}); } } }); }, processData: function(data) { var html = this.getHtml(data); $('#fund-list tbody').html(html); }, getHtml: function(items) { var html = ''; for (var i=0; i<items.length; i++) { html += '<tr>' + '<td>' + items[i].displayExtendedFields.productName + '</td>' + '<td>' + (items[i].extendedFields.marketPrice / 10000).toFixed(4) + '</td>' + '<td class="font-color-orange">+' + (items[i].extendedFields.yearIncomeRate / 10000).toFixed(2) + '%</td>' + '</tr>'; } return html; }, bindEvent: function() { var filterOptions = $('.filter-options'), filterOptionsLi = $('.filter-options li'), filters = $('#filters li'), mask = $('#mask'), sortMask = $('#sort-mask'), sortTitle = $('#sort-title'), sortOptions = $('#sort-options'), sortOptionsLi = $('#sort-options li'); filters.on('click', function() { sortOptions.hide(); sortMask.hide(); if ($(this).hasClass('active')) { $(this).removeClass('active'); filterOptions.hide(); mask.hide(); } else { filters.removeClass('active'); $(this).addClass('active'); filterOptions.hide(); $('.' + $(this).attr('id') + '-options').show(); mask.show(); } }); mask.on('click', function() { filterOptions.hide(); filters.removeClass('active'); mask.hide(); }); sortTitle.on('click', function() { sortOptions.show(); sortMask.show(); }); sortMask.on('click', function() { sortOptions.hide(); sortMask.hide(); }); filterOptionsLi.on('click', function() { filters.removeClass('active'); filterOptions.hide(); mask.hide(); if (!$(this).hasClass('active')) { $(this).siblings().removeClass('active'); $(this).addClass('active'); var a = $(this).parent().attr('data-param'); $('#' + $(this).parent().attr('data-param')).find('span').text($(this).find('span').text()); } }); sortOptionsLi.on('click', function() { sortOptions.hide(); sortMask.hide(); if (!$(this).hasClass('selected')) { $(this).siblings().removeClass('selected'); $(this).addClass('selected'); } }); $('body').on('touchstart', function() { mask.height($(this).height()); sortMask.height($(this).height()); }); } }; Fundlist.init();
shmli/shmli.github.com-juchaomu/fundlist.js
/* -*- mode: c++; indent-tabs-mode: nil -*- */ /* ReferenceHelper.h Qore Programming Language Copyright (C) 2003 - 2015 David Nichols 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. Note that the Qore library is released under a choice of three open-source licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more information. */ #ifndef _QORE_REFERENCEHELPER_H #define _QORE_REFERENCEHELPER_H //! DEPRECATED! DO NOT USE use @see QoreTypeSafeReferenceHelper instead /** helper class to manage variable references passed to functions and class methods, stack only, cannot be dynamically allocated Takes care of safely accessing ReferenceNode objects, for example when they are passed as arguments to a builtin function or method. Locks are automatically acquired in the constructor if necessary and released in the destructor. The constructor could raise a Qore-language exception if there is a deadlock acquiring any locks to access the ReferenceNode's value as given by the lvalue expression, so the object should be checked for this state right after the constructor as in the following example: @code const AbstractQoreNode *p = get_param(params, 0); if (p && p->getType() == NT_REFERENCE) { const ReferenceNode *r = reinterpret_cast<const ReferenceNode*>(p); AutoVLock vl; ReferenceHelper ref(r, vl, xsink); // a deadlock exception occurred accessing the reference's value pointer if (!ref) return 0; // more code to access the reference } @endcode */ class ReferenceHelper { private: //! this function is not implemented; it is here as a private function in order to prohibit it from being used DLLLOCAL ReferenceHelper(const ReferenceHelper&); //! this function is not implemented; it is here as a private function in order to prohibit it from being used DLLLOCAL ReferenceHelper& operator=(const ReferenceHelper&); //! this function is not implemented; it is here as a private function in order to prohibit it from being used DLLLOCAL void *operator new(size_t); protected: //! pointer to the pointer to the lvalue expression target of the reference AbstractQoreNode **vp; public: //! initializes the object and tries to get the pointer to the pointer of the lvalue expression target /** @param ref the ReferenceNode to use @param vl the reference to the AutoVLock structure for managing nested locks @param xsink Qore-language exceptions raised will be added here (for example, a deadlock accessing the object) */ DLLEXPORT ReferenceHelper(const ReferenceNode *ref, AutoVLock &vl, ExceptionSink *xsink); //! destroys the object DLLEXPORT ~ReferenceHelper(); //! returns true if the reference is valid, false if not /** false will only be returned if a Qore-language exception was raised in the constructor */ DLLLOCAL operator bool() const { return vp != 0; } //! returns the type of the reference's value /** @return the type of the reference's value */ DLLLOCAL qore_type_t getType() const { return *vp ? (*vp)->getType() : NT_NOTHING; } //! returns a pointer to the value with a unique reference count (so it can be updated in place), assumes the reference is valid /** @param xsink required for the call to AbstractQoreNode::deref() @returns a pointer to the reference's value with a unique reference count (so it can be modified), or 0 if the value was 0 to start with or if a Qore-language exception was raised @note you must check that the reference is valid before calling this function @note take care to only call this function on types where the AbstractQoreNode::realCopy() function has a valid implementation (on all value types suitable for in-place modification this function has a valid implementation), as in debugging builds other types will abort(); in non-debugging builds this function will simply do nothing @code AutoVLock vl; ReferenceHelper rh(ref, vl, xsink); // if the reference is not valid, then return if (!rh) return; // get the unique value AbstractQoreNode *val = rh.getUnique(xsink); // if a Qore-language exception was raised, then return if (*xsink) return; @endcode */ DLLEXPORT AbstractQoreNode *getUnique(ExceptionSink *xsink); //! assigns a value to the reference, assumes the reference is valid /** @param val the value to assign (must be already referenced for the assignment) @param xsink required for the call to AbstractQoreNode::deref() of the current value @return 0 if there was no error and the variable was assigned, -1 if a Qore-language exception occured dereferencing the current value, in this case no assignment was made and the reference count for val is dereferenced automatically by the ReferenceHelper object @note you must check that the reference is valid before calling this function @code AutoVLock vl; ReferenceHelper rh(ref, vl, xsink); // if the reference is not valid, then return if (!rh) return; // make the assignment (if the assignment fails, the value will be dereferenced automatically) rh.assign(val->refSelf(), xsink); @endcode */ DLLEXPORT int assign(AbstractQoreNode *val, ExceptionSink *xsink); //! returns a constant pointer to the reference's value /** @return the value of the lvalue reference (may be 0) */ DLLEXPORT const AbstractQoreNode *getValue() const; //! swaps the values of two references DLLEXPORT void swap(ReferenceHelper &other); }; #endif
estrabd/qore-include/qore/intern/ReferenceHelper.h
/* * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2001 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. */ /* $Id: xfrout.h,v 1.7.208.1 2004/03/06 10:21:27 marka Exp $ */ #ifndef NAMED_XFROUT_H #define NAMED_XFROUT_H 1 /***** ***** Module Info *****/ /* * Outgoing zone transfers (AXFR + IXFR). */ /*** *** Functions ***/ void ns_xfr_start(ns_client_t *client, dns_rdatatype_t xfrtype); #endif /* NAMED_XFROUT_H */
atmark-techno/atmark-dist-user/bind/bin/named/include/named/xfrout.h
/* suckerfish hover effect from htmldog.com/articles/suckerfish/ applies the sfhover to elements that get hovered for browsers that do not fully support :hover pseudo-class; */ sfHover = function() { var sfEls = document.getElementById("nav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover);
jorkin/asp-vbscript-cms-public/core/assets/scripts/sfhover.js
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.agon.core.domain; import java.util.Date; import java.util.UUID; public class PlayerBadge { private long playerId; private Date unlocked; private UUID badgeId; private PlayerBadge(Builder builder) { playerId = builder.playerId; unlocked = builder.unlocked; badgeId = builder.badgeId; } public static final class Builder { private long playerId; private Date unlocked; private UUID badgeId; public Builder() { } public Builder playerId(long playerId) { this.playerId = playerId; return this; } public Builder unlocked(Date unlocked) { this.unlocked = unlocked; return this; } public Builder badgeId(UUID badgeId) { this.badgeId = badgeId; return this; } public PlayerBadge build() { return new PlayerBadge(this); } } public long getPlayerId() { return playerId; } public Date getUnlocked() { return unlocked; } public UUID getBadgeId() { return badgeId; } }
rridgley1/agon-src/main/java/com/agon/core/domain/PlayerBadge.java
/* see copyright notice in squirrel.h */ #ifndef _SQCOMPILER_H_ #define _SQCOMPILER_H_ struct SQVM; #define TK_IDENTIFIER 258 #define TK_STRING_LITERAL 259 #define TK_INTEGER 260 #define TK_FLOAT 261 #define TK_DELEGATE 262 #define TK_DELETE 263 #define TK_EQ 264 #define TK_NE 265 #define TK_LE 266 #define TK_GE 267 #define TK_SWITCH 268 #define TK_ARROW 269 #define TK_AND 270 #define TK_OR 271 #define TK_IF 272 #define TK_ELSE 273 #define TK_WHILE 274 #define TK_BREAK 275 #define TK_FOR 276 #define TK_DO 277 #define TK_NULL 278 #define TK_FOREACH 279 #define TK_IN 280 #define TK_NEWSLOT 281 #define TK_MODULO 282 #define TK_LOCAL 283 #define TK_CLONE 284 #define TK_FUNCTION 285 #define TK_RETURN 286 #define TK_TYPEOF 287 #define TK_UMINUS 288 #define TK_PLUSEQ 289 #define TK_MINUSEQ 290 #define TK_CONTINUE 291 #define TK_YIELD 292 #define TK_TRY 293 #define TK_CATCH 294 #define TK_THROW 295 #define TK_SHIFTL 296 #define TK_SHIFTR 297 #define TK_RESUME 298 #define TK_DOUBLE_COLON 299 #define TK_CASE 300 #define TK_DEFAULT 301 #define TK_THIS 302 #define TK_PLUSPLUS 303 #define TK_MINUSMINUS 304 #define TK_PARENT 305 #define TK_USHIFTR 306 #define TK_CLASS 307 #define TK_EXTENDS 308 #define TK_CONSTRUCTOR 310 #define TK_INSTANCEOF 311 #define TK_VARPARAMS 312 #define TK_VARGC 313 #define TK_VARGV 314 #define TK_TRUE 315 #define TK_FALSE 316 #define TK_MULEQ 317 #define TK_DIVEQ 318 #define TK_MODEQ 319 #define TK_ATTR_OPEN 320 #define TK_ATTR_CLOSE 321 #define TK_STATIC 322 #define TK_ENUM 323 #define TK_CONST 324 /* MSVC doesn't like NORETURN for function prototypes, but we kinda need it for GCC. */ #if defined(_MSC_VER) && !defined(__clang__) typedef void(*CompilerErrorFunc)(void *ud, const SQChar *s); #else typedef NORETURN void(*CompilerErrorFunc)(void *ud, const SQChar *s); #endif bool Compile(SQVM *vm, SQLEXREADFUNC rg, SQUserPointer up, const SQChar *sourcename, SQObjectPtr &out, bool raiseerror, bool lineinfo); #endif //_SQCOMPILER_H_
pelya/openttd-android-src/3rdparty/squirrel/squirrel/sqcompiler.h
/** * @author 戎晓伟 * @description redux->action */ // 导入创建多action的方法 import { createAction } from '@/app/utils/createAction' // 导入用到的type import { ZK_MANAGE_LOAD_LEVEL_OF_PATH, READ_ZK_DATA, SAVE_ZK_DATA, READ_ZK_PROPERTIES, SAVE_ZK_PROPERTIES, LOAD_ZK_TREE_BY_DSNAME } from './types' export const loadLevelOfPath = { request: params => createAction(ZK_MANAGE_LOAD_LEVEL_OF_PATH.LOAD, { ...params }), success: data => createAction(ZK_MANAGE_LOAD_LEVEL_OF_PATH.SUCCESS, { ...data }), fail: error => createAction(ZK_MANAGE_LOAD_LEVEL_OF_PATH.FAIL, { ...error }) } export const readZkData = { request: params => createAction(READ_ZK_DATA.LOAD, { ...params }), success: data => createAction(READ_ZK_DATA.SUCCESS, { ...data }), fail: error => createAction(READ_ZK_DATA.FAIL, { ...error }) } export const saveZkData = { request: params => createAction(SAVE_ZK_DATA.LOAD, { ...params }), success: data => createAction(SAVE_ZK_DATA.SUCCESS, { ...data }), fail: error => createAction(SAVE_ZK_DATA.FAIL, { ...error }) } export const readZkProperties = { request: params => createAction(READ_ZK_PROPERTIES.LOAD, { ...params }), success: data => createAction(READ_ZK_PROPERTIES.SUCCESS, { ...data }), fail: error => createAction(READ_ZK_PROPERTIES.FAIL, { ...error }) } export const saveZkProperties = { request: params => createAction(SAVE_ZK_PROPERTIES.LOAD, { ...params }), success: data => createAction(SAVE_ZK_PROPERTIES.SUCCESS, { ...data }), fail: error => createAction(SAVE_ZK_PROPERTIES.FAIL, { ...error }) } export const loadZkTreeByDsName = { request: params => createAction(LOAD_ZK_TREE_BY_DSNAME.LOAD, { ...params }), success: data => createAction(LOAD_ZK_TREE_BY_DSNAME.SUCCESS, { ...data }), fail: error => createAction(LOAD_ZK_TREE_BY_DSNAME.FAIL, { ...error }) }
BriData/DBus-dbus-keeper/keeper-web/app/components/ConfigManage/ZKManage/redux/action/index.js
module.exports = { listAllGroupContacts: require('./listAllGroupContacts'), listAllGroups: require('./listAllGroups'), };
atsid/gcal-leave-scraper-server/middleware/group/index.js
# Finding functions that are a level set and a graph 1. Sep 23, 2016 ### toforfiltum 1. The problem statement, all variables and given/known data This problem concerns the surface determined by the graph of the equation $x^2 + xy -xz = 2$ a) Find a function $F(x,y,z)$ of three variables so that this surface may be considered to be a level set of F. b) Find a function $f(x,y)$ of two variables so that this surface may be considered to be the graph of $z=f(x,y)$. 2. Relevant equations 3. The attempt at a solution I'm not very sure about what I'm saying, but it was nearing my professor's office hours when I asked him this question. He replied something like functions of a level set needs to have three variables, while functions of a graph needs an extra variable, and this applies to all cases, not just the question I'm referring to. So, following his example, I answered (a) like this: Let $F(x,y,z)$ be the set $[x,y,z,w | w=F(x,y,z)]$, and $F(x,y,z) = x^2 + xy -xz$, because I was thinking that since this equation has three variables, it's a function of $\mathbb {R}$3$→ \mathbb {R}$4, so the level curves will have three variables. I don't really know what to do with the constant 2 in the equation though. I think putting the constant 2 there is like setting the value of $w$ to find a level curve. I'm not sure I'm right. For (b), I just answered $z= x + y - \frac{2}{x}$ Thanks. 2. Sep 23, 2016 ### andrewkirk Yes your answers are correct. The 2 can be ignored because it is a constant, so it doesn't change what the level sets are, only the value that is obtained on each level set. In fact any function of the form $x^2+xy-xz+C$ for constant $C$ is a correct answer to (a). The simplest such function is the one you gave, which has $C=0$. 3. Sep 23, 2016 Thanks!
finemath-3plus
Mobile Casino Games | Percorsi Una FREE Top! Home » Mobile Casino Games | Percorsi Una FREE Top! aquatique! Stu mari Very Best Online mobile, Casino & Una Phone Offers Latest Update! Just u Very Top SMS Brands Bonus Phone & Mobile Casino Games Offers New! Coinfalls.com Mobile Una Casino cù £ 5 FREE! James St. Ghjuvanni par vìa di voi u assai migliori Una telefonu Casinò Klenike transport attornu in u telefunu stu mese! U fattu hè nunda Track U Casino Phone di vittorie coppia italiana e Gamble nantu à u Aller di gioia! Bookmark sta pàgina di a più bedda Android è iPhone Casino, equipagiu Windows Phone, cìansi, Nokia è assai più Una Casinò s'antaressa Bonus accontu nantu au mobile. PocketWin SMS Top Up Casino Free Mobile UK basatu West Midlands PocketWin Mobile è di Terengganu Casino caduta voi £ 5 Una Phone FREE & casinò. Sè vo pagà in £ 100 voi ssu dinù Play £ 200 right away! Pay by legi telefono, SMS, Carta di creditu, Pagate e tanti àutri modi à PocketWin Mobile Casino Ultralingua Win Mobile Casino è forsi lu megghiu di Windows è Viaggiare Mobile Casino attornu. In agghiunta PocketWin Mobile Casino Games sò dinò un negligentati, lettori, nantu à iPhone, iPad, mudeli pà Android è assai più vechje di telefonu cume Nokia, Samsung, Sharp, Motorola, HTC etc.. PocketWin Casino sò cumpletamenti sussed fora li Bilingue Mobile chì, lettori di manciari, mobile truvà a essiri vistutu accussì còmuda e prutettu. S'è vo tinite caru à ghjucà classicu ghjochi verbi Casinò su telefono Alone Win hè Ottima una visita di modu regulare! ma aspitteti – Slotjar.com hè u novu Casinò, mobile di punters gravissimu – A vecu quì e sacchetta u vostru Bonus lìquidu senza! Mastru Casino Mobile: PocketWin hè unu di l 'unica phonecasinos soldi vera chì accumpagna Hotel, è Windows Cellulari ch'à dinù chì porghjenu Pay By Grau legi Phone. Elite Mobile Casino Bonus Free di sunatura VIP Stu Casinò telefonu ùn ciò chì hè scrittu nantu à u lanna! Sè vo avete un pocu briunò à friscià intornu à un trattamentu casinò è VIP fantasia è un tempurale Bonus benvenuta d £ 800 allura Elite Mobile Casino hè per voi! Secondu a London Elite Casinò telefonu è comu n'autra pi d'oru quannu si veni lu tempu di Grazii a tres cannas vincere. Mastru Casino Mobile: Elite Mobile Casino hè raru in porghjenu Grau BOKU e cuamu par SMS Bilingue à calcio, mobile, VIP Also vidi u situ Casinò, mobile www.Ladylucks.co.uk Marchjà in ogni Casinò sputicu è appena jò lu pianu ch'ellu si trattava d'cunfusione chì lu roulette, mai ùn viaghji quessa a tirari finu a punters cherche chi granni Win. Quandu si veni a grande ghjochi, grande, spenni-eccelsi, grandi li tituli avocat, e grande paca par Grau SMS legi telefono, Casinò, u telefuninu chì ùn perda tantu grùassu cchiossà di basa Stourbridge mFortune.Phone Casino. m francese furtuna aghju pruggittatu e custrujutu so ghjochi da a terra, su, e si tinuti licenziata in u UK porghjenu voi pagà da legi telefonu è Grau annonce Pagate gratitùdine, aimé bezahlen è di più! Rittu n paroli deporri £ 100 à mFortune Casinò telefuninu, è i vostri ghjucà a necessità cù una whopping £ 200. Sè vo sunari cerca di un gustu di u gran ghjochi nantu à offerta è sò
c4-co
#!/usr/bin/env python BUILD = 31 VERSION = "0.0.6" RELEASE = VERSION + "a" + str(BUILD) import os import sys import distutils.sysconfig from setuptools import setup if __name__ == "__main__": if "--format=msi" in sys.argv or "bdist_msi" in sys.argv: # hack the version name to a format msi doesn't have trouble with VERSION = VERSION.replace("-alpha", "a") VERSION = VERSION.replace("-beta", "b") VERSION = VERSION.replace("-rc", "r") fname = os.path.join(os.path.dirname(os.path.abspath(__file__)), "README.rst") readme = open(fname, "r") long_desc = readme.read() readme.close() setup( name="arcade", version=RELEASE, description="Arcade Game Development Library", long_description=long_desc, author="Paul Vincent Craven", author_email="[email protected]", license="MIT", url="http://arcade.academy", download_url="http://arcade.academy", packages=["arcade", "arcade.key", "arcade.color" ], classifiers=[ "Development Status :: 1 - Planning", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules", ], test_suite="tests", data_files=[("Lib/site-packages/arcade/Win32", ["Win32/avbin.dll"]), ("Lib/site-packages/arcade/Win64", ["Win64/avbin.dll"])], )
mwreuter/arcade-setup.py
/*global dom */ /*jshint maxcomplexity: 11 */ /** * Determines if an element is hidden with the clip rect technique * @param {String} clip Computed property value of clip * @return {Boolean} */ function isClipped(clip) { 'use strict'; var matches = clip.match(/rect\s*\(([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px,?\s*([0-9]+)px\s*\)/); if (matches && matches.length === 5) { return matches[3] - matches[1] <= 0 && matches[2] - matches[4] <= 0; } return false; } /** * Determine whether an element is visible * * @param {HTMLElement} el The HTMLElement * @param {Boolean} screenReader When provided, will evaluate visibility from the perspective of a screen reader * @return {Boolean} The element's visibilty status */ dom.isVisible = function (el, screenReader, recursed) { 'use strict'; var style, nodeName = el.nodeName, parent = el.parentNode; // 9 === Node.DOCUMENT if (el.nodeType === 9) { return true; } style = window.getComputedStyle(el, null); if (style === null) { return false; } if (style.getPropertyValue('display') === 'none' || nodeName.toUpperCase() === 'STYLE' || nodeName.toUpperCase() === 'SCRIPT' || (!screenReader && (isClipped(style.getPropertyValue('clip')))) || (!recursed && // visibility is only accurate on the first element (style.getPropertyValue('visibility') === 'hidden' || // position does not matter if it was already calculated !screenReader && dom.isOffscreen(el))) || (screenReader && el.getAttribute('aria-hidden') === 'true')) { return false; } if (parent) { return dom.isVisible(parent, screenReader, true); } return false; };
jasonkarns/axe-core-lib/commons/dom/is-visible.js
package eu.lod2.rsine.queryhandling; public interface IQueryDispatcher { public void trigger(); }
rsine/rsine-src/main/java/eu/lod2/rsine/queryhandling/IQueryDispatcher.java
/*! * Copyright (c) Metaways Infosystems GmbH, 2011 * LGPLv3, http://opensource.org/licenses/LGPL-3.0 */ Ext.ns('MShop.panel.job'); MShop.panel.job.ItemUi = Ext.extend(MShop.panel.AbstractItemUi, { initComponent : function() { this.title = MShop.I18n.dt('client/extjs', 'Job item details'); this.items = [{ xtype : 'tabpanel', activeTab : 0, border : false, itemId : 'MShop.panel.job.ItemUi', plugins : ['ux.itemregistry'], items : [{ xtype : 'panel', title : MShop.I18n.dt('client/extjs', 'Basic'), border : false, layout : 'hbox', layoutConfig : { align : 'stretch' }, itemId : 'MShop.panel.job.ItemUi.BasicPanel', plugins : ['ux.itemregistry'], defaults : { bodyCssClass : this.readOnlyClass }, items : [{ xtype : 'form', title : MShop.I18n.dt('client/extjs', 'Details'), flex : 1, ref : '../../mainForm', autoScroll : true, items : [{ xtype : 'fieldset', style : 'padding-right: 25px;', border : false, labelAlign : 'top', defaults : { readOnly : this.fieldsReadOnly, anchor : '100%' }, items : [{ xtype : 'displayfield', fieldLabel : MShop.I18n.dt('client/extjs', 'ID'), name : 'job.id' }, { xtype : 'MShop.elements.status.combo', name : 'job.status' }, { xtype : 'textfield', fieldLabel : MShop.I18n.dt('client/extjs', 'Label'), name : 'job.label', allowBlank : false, maxLength : 255, emptyText : MShop.I18n.dt('client/extjs', 'Internal name (required)') }, { xtype : 'displayfield', fieldLabel : MShop.I18n.dt('client/extjs', 'Method'), name : 'job.method' }, { xtype : 'displayfield', fieldLabel : MShop.I18n.dt('client/extjs', 'Created'), name : 'job.ctime' }, { xtype : 'displayfield', fieldLabel : MShop.I18n.dt('client/extjs', 'Last modified'), name : 'job.mtime' }, { xtype : 'displayfield', fieldLabel : MShop.I18n.dt('client/extjs', 'Editor'), name : 'job.editor' }] }] }] }] }]; MShop.panel.job.ItemUi.superclass.initComponent.call(this); } }); Ext.reg('MShop.panel.job.itemui', MShop.panel.job.ItemUi);
msonowal/aimeos-laravel-public/client/extjs/src/panel/job/ItemUi.js
// // OCErrorMsg.h // Owncloud iOs Client // // Copyright (C) 2014 ownCloud Inc. (http://www.owncloud.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #define kOCErrorServerUnauthorized 401 #define kOCErrorServerForbidden 403 #define kOCErrorServerPathNotFound 404 #define kOCErrorServerMethodNotPermitted 405 #define kOCErrorProxyAuth 407 #define kOCErrorServerTimeout 408 #define kOCErrorServerInternalError 500
sylverb/NAStify-NAStify/External/ownCloud-ios-library/OCCommunicationLib/OCCommunicationLib/OCErrorMsg.h
Mitroúsi - Wikipedia Tiganos: 41°04′13″N 23°27′38″E / 41.07041°N 23.46064°Ö / 41.07041; 23.46064 Mitroúsi (Mitroúsion) Áno Khomóndhos, Áno Mitroúsis, Áno Mitroúsi, Áno Mitroúsion, Μητρούσιον, Mitrousi, Άνω Μητρούσι Opisyal nga ngaran: Μητρούσι 41°04′13″N 23°27′38″E / 41.07041°N 23.46064°Ö / 41.07041; 23.46064 1,479 (2014-08-24) [1] Lungsod ang Mitroúsi sa Gresya.[1] Nahimutang ni sa prepektura sa Nomós Serrón ug rehiyon sa Central Macedonia, sa amihanan-sidlakang bahin sa nasod, 300 km sa amihanan sa Athens ang ulohan sa nasod. 18 metros ibabaw sa dagat kahaboga ang nahimutangan sa Mitroúsi[saysay 1], ug adunay 1,479 ka molupyo.[1] Ang yuta palibot sa Mitroúsi kay patag sa habagatang-kasadpan, apan sa amihang-sidlakan nga kini mao ang kabungtoran.[saysay 2] Kinahabogang dapit sa palibot ang Sarlínga, 1,377 ka metros ni kahaboga ibabaw sa dagat, 18.3 km sa amihanan sa Mitroúsi.[saysay 3] Dunay mga 192 ka tawo kada kilometro kwadrado sa palibot sa Mitroúsi medyo hilabihan populasyon.[3] Ang kinadul-ang mas dakong lungsod mao ang Sérres, 7.5 km sa sidlakan sa Mitroúsi. Hapit nalukop sa kaumahan ang palibot sa Mitroúsi.[4] Nahimutangan sa Mitroúsi sa Gresya. ↑ 1.0 1.1 1.2 1.3 Mitroúsi sa Geonames.org (cc-by); post updated 2014-08-24; database download sa 2015-05-23 Gikuha gikan sa "https://ceb.wikipedia.org/w/index.php?title=Mitroúsi&oldid=21530103" Kining maong panid kataposang giusab niadtong 16 Marso 2018 sa 20:05.
c4-ceb
var mongoose = require('mongoose'); var User = mongoose.model('User'); module.exports.readAccount = function(req, res) { if(!req.payload._id) { res.status(401).json({ "message":"UnauthorizedError: private account" }); } else { User .findById(req.payload._id) .exec(function(err, user) { res.status(200).json(user); }); } };
technetos/mutant-office-hours-backend-controllers/account.js
package com.dev.geochallenger.models.entities.directions; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class Step { @SerializedName("distance") @Expose private Distance distance; @SerializedName("duration") @Expose private Duration duration; @SerializedName("end_location") @Expose private Location endLocation; @SerializedName("html_instructions") @Expose private String htmlInstructions; @SerializedName("polyline") @Expose private Polyline polyline; @SerializedName("start_location") @Expose private Location startLocation; @SerializedName("travel_mode") @Expose private String travelMode; @SerializedName("maneuver") @Expose private String maneuver; /** * * @return * The distance */ public Distance getDistance() { return distance; } /** * * @param distance * The distance */ public void setDistance(Distance distance) { this.distance = distance; } /** * * @return * The duration */ public Duration getDuration() { return duration; } /** * * @param duration * The duration */ public void setDuration(Duration duration) { this.duration = duration; } /** * * @return * The endLocation */ public Location getEndLocation() { return endLocation; } /** * * @param endLocation * The end_location */ public void setEndLocation(Location endLocation) { this.endLocation = endLocation; } /** * * @return * The htmlInstructions */ public String getHtmlInstructions() { return htmlInstructions; } /** * * @param htmlInstructions * The html_instructions */ public void setHtmlInstructions(String htmlInstructions) { this.htmlInstructions = htmlInstructions; } /** * * @return * The polyline */ public Polyline getPolyline() { return polyline; } /** * * @param polyline * The polyline */ public void setPolyline(Polyline polyline) { this.polyline = polyline; } /** * * @return * The startLocation */ public Location getStartLocation() { return startLocation; } /** * * @param startLocation * The start_location */ public void setStartLocation(Location startLocation) { this.startLocation = startLocation; } /** * * @return * The travelMode */ public String getTravelMode() { return travelMode; } /** * * @param travelMode * The travel_mode */ public void setTravelMode(String travelMode) { this.travelMode = travelMode; } /** * * @return * The maneuver */ public String getManeuver() { return maneuver; } /** * * @param maneuver * The maneuver */ public void setManeuver(String maneuver) { this.maneuver = maneuver; } }
GAnatoliy/geochallenger-android-app/src/main/java/com/dev/geochallenger/models/entities/directions/Step.java
Rosen-Hängebouquet – mit diesem Artikel sind Sie total up to date Mit Rosen-Hängebouquet aus unserem Onlineshop erfüllen Sie sich Ihre Wünsche. Stöbern Sie nach dem Artikel Ihrer Begierde in der Kategorie Blumen & Vasen. Die Vielseitigkeit der Dinge, die sich Ihnen bei 3Pagen Deko präsentiert, wird Sie verzaubern. Rosen-Hängebouquet ist stylisch und verstärkt Ihre Vorlieben. Erleben Sie Ihre Shoppingtour und sparen Sie gleichzeitig unnötig hohe Ausgaben. Tolle Produkte finden Sie ab 19,99 €. Bestellen Sie Ihr favorisiertes Rosen-Hängebouquet und Ihre Ware kommt als Paket einfach zu Ihnen ins Haus. Um diesen dieses Modell aus unserer Produktpalette Rosen-Hängebouquet wird man Sie beneiden. Rosen-Hängebouquet bietet individuelle Trends Mit Rosen-Hängebouquet erwerben Sie nicht nur einen Artikel aus unserem Angebot. Lassen Sie sich verzaubern von dem vielfältigen Sortiment bei Blumen & Vasen von 3Pagen. Finden Sie dieses besondere Produkt ab 19,99 €. Sollten Sie etwas ganz Besonderes suchen, sind Sie bei Rosen-Hängebouquet richtig. Die Zusammenstellung auf Deko zaubert Ideen in Ihren Kopf. Lassen Sie Ihrer individuellen Fantasie freien Lauf und genießen Sie etwas Besonderes. Rosen-Hängebouquet ist für unsere Kunden ein Ort besonderer Vorstellungen. Kaufen Sie Rosen-Hängebouquet im Onlineshop und erleben Sie die trendige Möglichkeit, einzukaufen.
c4-de
/* * Generated by class-dump 3.3.4 (64 bit). * * class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard. */ #import "NSObject.h" @class NSSet, NSString; @interface IDEAlert : NSObject { NSSet *_cachedProperties; BOOL _enabled; NSString *_identifier; double _executionPriority; } + (id)createAlertForAlertIdentifier:(id)arg1 propertyList:(id)arg2; + (id)createAlertForAlertIdentifier:(id)arg1; + (BOOL)canAlertWithIdentifierRunOnCurrentOS:(id)arg1; + (id)alertExtensionForAlertIdentifier:(id)arg1; + (id)alertIdentifiersForGroup:(id)arg1; + (id)alertGroups; + (id)alertIdentifiers; + (id)alertExtensions; + (void)_cacheAlerts; + (void)_registerAlert:(id)arg1; + (void)initialize; @property double executionPriority; // @synthesize executionPriority=_executionPriority; @property(getter=isEnabled) BOOL enabled; // @synthesize enabled=_enabled; @property(readonly) NSString *identifier; // @synthesize identifier=_identifier; - (void).cxx_destruct; - (int)alertPropertyListVersion; - (id)initWithPropertyList:(id)arg1; - (id)propertyList; - (BOOL)isEqual:(id)arg1; - (long long)compare:(id)arg1; - (id)description; - (void)runForEvent:(id)arg1 inWorkspace:(id)arg2 context:(id)arg3 completionBlock:(id)arg4; - (void)prepareToRunForEvent:(id)arg1 inWorkspace:(id)arg2 context:(id)arg3; - (id)valuesForProperty:(id)arg1; - (BOOL)validatePropertyValues:(id)arg1; - (void)enumeratePropertyPermutationsWithBlock:(id)arg1; - (void)_permuteAlert:(id)arg1 byVaryingProperty:(id)arg2 in:(id)arg3 values:(id)arg4 withBlock:(id)arg5; - (id)properties; - (BOOL)canRunOnCurrentOS; - (id)title; - (id)group; @end
liyong03/YLCleaner-YLCleaner/Xcode-RuntimeHeaders/IDEFoundation/IDEAlert.h
posted by . You are planning to spend no less than \$6,000 and no more than \$10,000 on your landscaping project. Suppose you want to cover the backyard with decorative rock and plant some trees as the first phase of the project. You need 30 tons of rock to cover the area. If each ton cost \$60 and each tree is \$84, with a budget for rock and trees of \$2,500 Would 5 trees be a solution to the inequality in part b? Justify your answer. Woulld 5 trees be a solution to the inequality in part b? Justify your answer. You have not provided the "part b inequality" The decorative roack costs \$1800, leaving \$700 for trees. It seems to me that you have enough to plant up to 8 trees, but not 9 or moree ## Similar Questions 1. ### MAT 116 Algebra 1A Appendix D Landscape Design Landscape designers often use coordinate geometry and algebra as they help their clients. In many regions, landscape design is a growing field. With the increasing popularity of do-it-yourself television … 2. ### geometry I am confuse as to how to actually work these problems. Please help!!! 1. You are planning to spend no less than \$6,000 and no more than \$10,000 on your landscaping project. a) Write an inequality that demonstrates how much money you … 3. ### math You are planning to spend no less than \$6,000 and no more than \$10,000 on your landscaping project. Write an inequality that demonstrates how much money you will be willing to spend on the project. Suppose you want to cover the backyard … 4. ### math 116 1) you are planning to spend no less than \$6,000 and no more than \$10,000 on your landscaping project. Q1: write an inequality that demonstrates how much money you will be willing to spend on the project. A1: 6,000 greater than > … 5. ### Algabra Landscape designers often use coordinate geometry and algebra as they help their clients. In many regions, landscape design is a growing field. With the increasing popularity of do-it-yourself television shows, however, many homeowners … 6. ### alg. 1. You are planning to spend no less than \$6,000 and no more than \$10,000 on your landscaping project. a) Write an inequality that demonstrates how much money you will be willing to spend on the project. b) Suppose you want to cover … 7. ### college/alg 1. You are planning to spend no less than \$6,000 and no more than \$10,000 on your landscaping project. a) Write an inequality that demonstrates how much money you will be willing to spend on the project. b) Suppose you want to cover … 8. ### algebra b) Suppose you want to cover the backyard with decorative rock and plant some trees as the first phase of the project. You need 25 tons of rock to cover the area. If each ton cost \$70 and each tree is \$90, what is the maximum number … 9. ### Algebra 116 Help Please 1) Your are planning to spend no less than \$8000.00 and no more than \$12,000 on your landscape project a) Write an inequality that demonstrates how much money you will be will to spend on the project B) Suppose you want to cover the … 10. ### algebra 1. You are planning to spend no more than \$10,000 and no less than \$8,000 on your landscaping project. a. Write an inequality that demonstrates how much money you will are willing to spend on the project. b. For the first phase of … More Similar Questions
finemath-3plus
"use strict"; window.onload = function () { console.log('About to test raising an event via Hoist API'); // stuff var xhr = new XMLHttpRequest(); xhr.open('POST', 'https://api.hoi.io/events/signup', true); xhr.onreadystatechange = function() { console.log('onreadystatechange' + this.readyState + ' ' + this.status + ' ' + this.statusText + ' ' + ( this.responseText ? JSON.parse(this.responseText) : '')); }; xhr.onload = function () { console.log('onload' + this.responseText); }; xhr.setRequestHeader('Content-Type', 'application/json'); xhr.setRequestHeader('Authorization', 'Hoist 6S1yaWVN0IYcvlylwMcURVad7dIraXJF'); var xhrBody = JSON.stringify({ "email":"[email protected]", "name":"Adrian Parker", "skills": "Just a test please ignore" }); xhr.send(xhrBody); console.log('Done.'); }
madnz/madnz.github.io-browserHoistAPITest.js
/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Code Aurora Forum, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef __ARCH_ARM_MACH_MSM_DEVICES_MSM8X60_H #define __ARCH_ARM_MACH_MSM_DEVICES_MSM8X60_H #define MSM_GSBI3_QUP_I2C_BUS_ID 0 #define MSM_GSBI4_QUP_I2C_BUS_ID 1 #define MSM_GSBI9_QUP_I2C_BUS_ID 2 #define MSM_GSBI8_QUP_I2C_BUS_ID 3 #define MSM_GSBI7_QUP_I2C_BUS_ID 4 #define MSM_GSBI10_QUP_I2C_BUS_ID 5 // Palm changed #define MSM_SSBI1_I2C_BUS_ID 6 #define MSM_SSBI2_I2C_BUS_ID 7 #define MSM_SSBI3_I2C_BUS_ID 8 #define MSM_GSBI5_QUP_I2C_BUS_ID 9 #define MSM_GSBI5_QUP_SPI_BUS_ID 2 //since GSBI1 ID is used as 0, so we use 1 here #ifdef CONFIG_SPI_QUP extern struct platform_device msm_gsbi1_qup_spi_device; extern struct platform_device msm_gsbi5_qup_spi_device; extern struct platform_device msm_gsbi10_qup_spi_device; #endif #ifdef CONFIG_MSM_BUS_SCALING extern struct platform_device msm_bus_apps_fabric; extern struct platform_device msm_bus_sys_fabric; extern struct platform_device msm_bus_mm_fabric; extern struct platform_device msm_bus_sys_fpb; extern struct platform_device msm_bus_cpss_fpb; #endif extern struct platform_device msm_device_smd; extern struct platform_device msm_kgsl_3d0; #ifdef CONFIG_MSM_KGSL_2D extern struct platform_device msm_kgsl_2d0; extern struct platform_device msm_kgsl_2d1; #endif extern struct platform_device msm_device_kgsl; extern struct platform_device msm_device_gpio; extern struct platform_device msm_device_vidc; extern struct platform_device msm_charm_modem; #ifdef CONFIG_HW_RANDOM_MSM extern struct platform_device msm_device_rng; #endif void __init msm8x60_init_irq(void); #ifdef CONFIG_MSM_KGSL_2D void __init msm8x60_check_2d_hardware(void); #endif #ifdef CONFIG_WEBCAM_MT9M113 extern struct platform_device msm_camera_sensor_webcam_mt9m113; #endif #ifdef CONFIG_MSM_DSPS extern struct platform_device msm_dsps_device; #endif #if defined(CONFIG_MSM_RPM_STATS_LOG) extern struct platform_device msm_rpm_stat_device; #endif #endif
shumashv1/hp-kernel-tenderloin-arch/arm/mach-msm/devices-msm8x60.h