answer
stringlengths
15
1.25M
// vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 package main import ( "../contrail" log "../logging" "github.com/containernetworking/cni/pkg/skel" "github.com/containernetworking/cni/pkg/version" ) // Get UUID and Name for container. UUID is same as container-id func getPodInfo(skelArgs *skel.CmdArgs) (string, string, error) { return skelArgs.ContainerID, skelArgs.ContainerID, nil } // Add command func CmdAdd(skelArgs *skel.CmdArgs) error { // Initialize ContrailCni module cni, err := contrailCni.Init(skelArgs) if err != nil { return err } log.Infof("Came in Add for container %s", skelArgs.ContainerID) // Get UUID and Name for container containerUuid, containerName, err := getPodInfo(skelArgs) if err != nil { log.Errorf("Error getting UUID/Name for Container") return err } // Update UUID and Name for container cni.Update(containerName, containerUuid, "") cni.Log() // Handle Add command err = cni.CmdAdd() if err != nil { log.Errorf("Failed processing Add command.") return err } return nil } // Del command func CmdDel(skelArgs *skel.CmdArgs) error { // Initialize ContrailCni module cni, err := contrailCni.Init(skelArgs) if err != nil { return err } log.Infof("Came in Del for container %s", skelArgs.ContainerID) // Get UUID and Name for container containerUuid, containerName, err := getPodInfo(skelArgs) if err != nil { log.Errorf("Error getting UUID/Name for Container") return err } // Update UUID and Name for container cni.Update(containerName, containerUuid, "") cni.Log() // Handle Del command err = cni.CmdDel() if err != nil { log.Errorf("Failed processing Add command.") return err } return nil } func main() { // Let CNI skeletal code handle demux based on env variables skel.PluginMain(CmdAdd, CmdDel, version.PluginSupports(contrailCni.CniVersion)) }
package dcraft.filestore.select; import java.util.concurrent.atomic.AtomicReference; import dcraft.filestore.IFileStoreFile; public class <API key> extends FileMatcher { protected String equal = null; protected String lessThan = null; protected String greaterThan = null; protected String lessThanEqual = null; protected String greaterThanEqual = null; public <API key> withEqual(String v) { this.equal = v; return this; } public <API key> withLessThan(String v) { this.lessThan = v; return this; } public <API key> withGreaterThan(String v) { this.greaterThan = v; return this; } public <API key> withLessThanEqual(String v) { this.lessThanEqual = v; return this; } public <API key> <API key>(String v) { this.greaterThanEqual = v; return this; } @Override public boolean approve(IFileStoreFile file, AtomicReference<String> value, FileSelection selection) { boolean pass = true; String datetime = file.getModification(); if (this.equal != null) { pass = this.equal.startsWith(datetime); } else { if (this.greaterThanEqual != null) pass = (datetime.compareTo(this.greaterThanEqual) >= 0); else if (this.greaterThan != null) pass = (datetime.compareTo(this.greaterThan) > 0); // only check if the greater than passed if (pass) { if (this.lessThanEqual != null) pass = (datetime.compareTo(this.lessThanEqual) <= 0); else if (this.lessThan != null) pass = (datetime.compareTo(this.lessThan) < 0); } } if (this.exclude) pass = !pass; return pass; } }
use std::fmt; use std::vec::Vec; use super::{Attributes, ConstantPool, FieldInfo, MethodInfo}; #[derive(Debug)] pub struct ClassFile { Java classfile magic number. `0xcafebabe` is the only valid value for this field. pub magic: u32, The minor version of this classfile. pub minor_version: u16, The major version of this classfile. pub major_version: u16, Classfile constant pool. Contains constant values (integer, long, string, etc) as well as metadata about classes and types. pub constants: ConstantPool, Access flags for this class. pub access_flags: ClassAccessFlags, Index into the constant pool that resolves to a `Constant::Class` value. pub this_class: u16, Optional index into the constant pool that resolves to a `Constant::Class` value. If `super_class` is zero then there is no super class for this type. pub super_class: u16, A list of indicies into the constant pool that identify any interfaces directly applied to this class. These indicies must resolve to `Constant::Class` entries. pub interfaces: Vec<u16>, A list of field descriptors that identify the fields of this class. pub fields: Vec<FieldInfo>, A list of field descriptors that identify the methods of this class. pub methods: Vec<MethodInfo>, A list of attributes applied to this class. pub attrs: Attributes, } impl ClassFile { Resolves the `this_class` member to the UTF8 string in the constant pool that holds the class name. pub fn this_class_name(&self) -> &String { let name_index = self.constants[self.this_class].as_class(); self.constants[name_index].as_utf8() } Resolves the `super_class` member to the UTF8 string in the constant pool that holds the super class name. If `super_class == 0` then `None` is returned. pub fn super_class_name(&self) -> Option<&String> { if self.super_class == 0 { return None; } let name_index = self.constants[self.super_class].as_class(); Some(self.constants[name_index].as_utf8()) } pub fn find_method(&self, method_name: &str) -> Option<&MethodInfo> { for method in self.methods.iter() { let name = self.constants[method.name_index].as_utf8(); if name == method_name { return Some(method); } } None } pub fn find_field(&self, field_name: &str) -> Option<&FieldInfo> { for field in self.fields.iter() { let name = self.constants[field.name_index].as_utf8(); if name == field_name { return Some(field); } } None } } bitflags! { pub flags ClassAccessFlags: u16 { const CLASS_ACC_PUBLIC = 0x0001, const CLASS_ACC_FINAL = 0x0010, const CLASS_ACC_SUPER = 0x0020, const CLASS_ACC_INTERFACE = 0x0200, const CLASS_ACC_ABSTRACT = 0x0400, const CLASS_ACC_SYNTHETIC = 0x1000, const <API key> = 0x2000, const CLASS_ACC_ENUM = 0x4000 } } impl ClassAccessFlags { pub fn is_public(&self) -> bool { self.contains(CLASS_ACC_PUBLIC) } pub fn is_final(&self) -> bool { self.contains(CLASS_ACC_FINAL) } pub fn is_super(&self) -> bool { self.contains(CLASS_ACC_SUPER) } pub fn is_interface(&self) -> bool { self.contains(CLASS_ACC_INTERFACE) } pub fn is_abstract(&self) -> bool { self.contains(CLASS_ACC_ABSTRACT) } pub fn is_synthetic(&self) -> bool { self.contains(CLASS_ACC_SYNTHETIC) } pub fn is_annotation(&self) -> bool { self.contains(<API key>) } pub fn is_enum(&self) -> bool { self.contains(CLASS_ACC_ENUM) } } impl fmt::Display for ClassAccessFlags { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut v = Vec::new(); if self.is_public() { v.push("ACC_PUBLIC"); } if self.is_final() { v.push("ACC_FINAL"); } if self.is_super() { v.push("ACC_SUPER"); } if self.is_interface() { v.push("ACC_INTERFACE"); } if self.is_abstract() { v.push("ACC_ABSTRACT"); } if self.is_synthetic() { v.push("ACC_SYNTHETIC"); } if self.is_annotation() { v.push("ACC_ANNOTATION"); } if self.is_enum() { v.push("ACC_ENUM"); } write!(f, "{}", v.join(", ")) } }
# AUTOGENERATED FILE FROM balenalib/jn30b-nano-debian:bullseye-build ENV NODE_VERSION 10.24.0 ENV YARN_VERSION 1.22.4 RUN for key in \ <API key> \ ; do \ gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && curl -SLO "http://nodejs.org/dist/v$NODE_VERSION/node-v$<API key>.tar.gz" \ && echo "<SHA256-like> node-v$<API key>.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$<API key>.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$<API key>.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \
function parseUri(str) { var o = parseUri.options, m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), uri = {}, i = 14; while (i--) uri[o.key[i]] = m[i] || ""; uri[o.q.name] = {}; uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) { if ($1) uri[o.q.name][$1] = $2; }); return uri; }; parseUri.options = { strictMode: false, key: ["source", "protocol", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor"], q: { name: "queryKey", parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, parser: { strict: /^(?:([^:\/? loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/? } }; var app = angular.module('usersApp', []);
package web; import controlador.ExcluiControlador; import controlador.FotoControlador; import controlador.ListaControlador; import controlador.NovoControlador; import controlador.<API key>; import controlador.SalvaControlador; import controlador.UploadController; import spark.Filter; import spark.Request; import spark.Response; import spark.Spark; import spark.template.mustache.<API key>; public class Main { public static void main(String[] args) { // precisa de um package publico (pub) Spark.staticFileLocation("/pub"); // precisa de um package apresentacao (views) // onde ficam os HTML's <API key> engine = new <API key>("apresentacao"); <API key> paginaInicial = new <API key>(); Spark.get("/", paginaInicial, engine); NovoControlador novoControlador = new NovoControlador(); // abrir o form Spark.get("/novo", novoControlador, engine); SalvaControlador salvaControlador = new SalvaControlador(); Spark.post("/salva", salvaControlador, engine); ListaControlador listaControlador = new ListaControlador(); Spark.get("/lista", listaControlador, engine); ExcluiControlador excluiControlador = new ExcluiControlador(); Spark.get("/exclui/:numero", excluiControlador, engine); // Spark.post("/arquivo", new UploadController()); FotoControlador upador = new FotoControlador(); Spark.post("/recebefoto", upador); } }
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using AH.Shared.MODEL; using AH.DMS.MODEL; using AH.DTMS.MODEL; using AH.IPDShared.MODEL; namespace AH.DRS.MODEL { public class DiagnosticReport { public InPatient Patient { set; get; } public Specimen Specimen { set; get; } public ResultHead head { set; get; } public List<ResultHead> heads { set; get; } public DiagnosticMR DiagnosticMR { set; get; } public SpecimenCollection SpecimenCollection { set; get; } public ReportGroup ReportGroup { set; get; } public string Advice { set; get; } public string Comments { set; get; } public string DraftResultID { set; get; } public string ResultID { set; get; } public string GrowthResultsA { set; get; } public string GrowthResultsB { set; get; } public string GrowthResultsC { set; get; } public short IsGrowth { set; get; } public string Tempareture { set; get; } public string Results { set; get; } public string ResultA { set; get; } public string ResultB { set; get; } public string ResultC { set; get; } public string TestDetailsID { set; get; } public string Age { set; get; } public EntryParameter EntryParameter { set; get; } } }
const {ipcRenderer} = require('electron'); const electronContextMenu = require('<API key>'); function getSuggestionsMenus(win, suggestions) { if (suggestions.length === 0) { return [{ label: 'No Suggestions', enabled: false }]; } return suggestions.map((s) => ({ label: s, click() { (win.webContents || win.getWebContents()).replaceMisspelling(s); } })); } function <API key>(<API key>) { const currentLocale = ipcRenderer.sendSync('<API key>'); const locales = [ {language: 'English', locale: 'en-US'}, {language: 'French', locale: 'fr-FR'}, {language: 'German', locale: 'de-DE'}, {language: 'Spanish', locale: 'es-ES'}, {language: 'Dutch', locale: 'nl-NL'} ]; return locales.map((l) => ({ label: l.language, type: 'checkbox', checked: l.locale === currentLocale, click() { if (<API key>) { <API key>(l.locale); } } })); } module.exports = { setup(win, options) { const defaultOptions = { useSpellChecker: false, <API key>: null }; const actualOptions = Object.assign({}, defaultOptions, options); electronContextMenu({ window: win, prepend(params) { if (actualOptions.useSpellChecker) { const prependMenuItems = []; if (params.isEditable && params.misspelledWord !== '') { const suggestions = ipcRenderer.sendSync('<API key>', params.misspelledWord); prependMenuItems.push(...getSuggestionsMenus(win, suggestions)); } if (params.isEditable) { prependMenuItems.push( {type: 'separator'}, {label: 'Spelling Languages', submenu: <API key>(actualOptions.<API key>)}); } return prependMenuItems; } return []; } }); } };
/* * * Tabs * */ import { FC, useEffect, useRef, useState, useCallback, memo } from 'react' import { isEmpty, findIndex } from 'ramda' import type { TSIZE_SM, TTabItem, TC11NLayout } from '@/spec' import usePlatform from '@/hooks/usePlatform' import { SIZE, C11N } from '@/constant' import { isString } from '@/utils/validator' import { buildLog } from '@/utils/logger' import TabItem from './TabItem' import { Wrapper, Nav, SlipBar, RealBar } from '../styles/tabs' import { getSlipMargin } from '../styles/metric/tabs' /* <API key> */ const log = buildLog('c:Tabs:index') // const defaultItems2 = ['', '', 'Cheatsheet', '', ''] const temItems = [ { title: '', raw: 'posts', // icon: `${ICON_CMD}/navi/fire.svg`, localIcon: 'settings', }, ] /** * get default active key in tabs array * if not found, return 0 as first * * @param {array of string or object} items * @param {string} activeKey * @returns number */ const <API key> = ( items: TTabItem[], activeKey: string, ): number => { if (isEmpty(activeKey)) return 0 const index = findIndex((item) => { return activeKey === (item.raw || item.title) }, items) return index >= 0 ? index : 0 } type TProps = { items?: TTabItem[] layout?: TC11NLayout onChange: () => void activeKey?: string size: TSIZE_SM slipHeight: '1px' | '2px' bottomSpace?: number } const Tabs: FC<TProps> = ({ size = SIZE.MEDIUM, onChange = log, items = temItems, layout = C11N.CLASSIC, activeKey = '', slipHeight = '2px', bottomSpace = 0, }) => { const { isMobile } = usePlatform() const <API key> = <API key>(items, activeKey) const [active, setActive] = useState(<API key>) const [slipWidth, setSlipWidth] = useState(0) const [tabWidthList, setTabWidthList] = useState([]) const navRef = useRef(null) // set initial slipbar with of active item // slipbar useEffect(() => { if (navRef.current) { const activeSlipWidth = navRef.current.childNodes[<API key>].firstElementChild .offsetWidth setSlipWidth(activeSlipWidth) } setActive(<API key>) }, [<API key>]) // set slipbar with for current nav item // TabItem const handleNaviItemWith = useCallback( (index, width) => { tabWidthList[index] = width setTabWidthList(tabWidthList) }, [tabWidthList], ) const handleItemClick = useCallback( (index, e) => { const item = items[index] setSlipWidth(e.target.offsetWidth) setActive(index) onChange(isString(item) ? item : item.raw || item.title) }, [setSlipWidth, setActive, onChange, items], ) const translateX = `${ tabWidthList.slice(0, active).reduce((a, b) => a + b, 0) + getSlipMargin(size, isMobile) * active }px` return ( <Wrapper testid="tabs"> <Nav ref={navRef}> {items.map((item, index) => ( <TabItem key={isString(item) ? item : item.raw || item.title} mobileView={isMobile} holyGrailView={layout === C11N.HOLY_GRAIL} activeKey={activeKey} index={index} item={item} size={size} bottomSpace={bottomSpace} setItemWidth={handleNaviItemWith} onClick={handleItemClick} /> ))} <SlipBar translateX={translateX} width={`${tabWidthList[active]}px`} slipHeight={slipHeight} > <RealBar width={`${size === SIZE.MEDIUM ? slipWidth : slipWidth - 6}px`} /> </SlipBar> </Nav> </Wrapper> ) } export default memo(Tabs)
package org.radargun.producer; /** * Classes that know how to create producers at the desire rate * * @author Pedro Ruivo * @author Diego Didona * @since 1.1 */ public class <API key> { private final double originalLambda; //tx/sec private final int numberOfNodes; private final int nodeIndex; private final int avgSleepTime; /** * * @param globalLambda the global system lambda (a.k.a arrival rate) in transactions per seconds * @param numberOfNodes the number of nodes in the system (>= 1) * @param nodeIndex the node index [0..numberOfNodes - 1] * @param avgSleepTime The average sleeping time desire for a producer */ public <API key>(double globalLambda, int numberOfNodes, int nodeIndex, int avgSleepTime) { if (numberOfNodes < 1) { throw new <API key>("Number of nodes must be higher or equals than 1"); } if (nodeIndex < 0 || nodeIndex >= numberOfNodes) { throw new <API key>("The node index is not valid"); } this.originalLambda = globalLambda; this.numberOfNodes = numberOfNodes; this.nodeIndex = nodeIndex; this.avgSleepTime = avgSleepTime; } /** * it creates an array of producers, each one with the desire rate in order to achieve the global system rate * @return an array of producers */ public final ProducerRate[] create() { double remainder = originalLambda % numberOfNodes; //this is the producer rate common to all nodes double myLambda = (originalLambda - remainder) / numberOfNodes; //if this node is unlucky, it can get more load than the others if (nodeIndex < remainder) { myLambda++; } myLambda /= 1000D; //calculate the number of producers needed double numberOfProducers = myLambda * avgSleepTime; //the number of producers at Normal producer rate int <API key> = (int) Math.floor(numberOfProducers); double normalProducerRate = 1D / avgSleepTime; //it is possible to have a producer that works more slowly than the others double slowProducerRate = myLambda - (<API key> * normalProducerRate); ProducerRate[] producers = new ProducerRate[<API key> + (slowProducerRate != 0 ? 1 : 0)]; for (int i = 0; i < <API key>; ++i) { producers[i] = new ProducerRate(normalProducerRate); } //the slower producer if (slowProducerRate != 0) { producers[producers.length - 1] = new ProducerRate(slowProducerRate); } return producers; } }
package com.jb.vmeeting.mvp.model.eventbus.event; import com.jb.vmeeting.mvp.model.entity.User; import java.util.List; public class <API key> { public List<User> participator; public <API key>(List<User> participator) { this.participator = participator; } }
package me.ellios.hedwig.memcached.container; import org.glassfish.jersey.server.ApplicationHandler; import org.glassfish.jersey.server.spi.ContainerProvider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.ws.rs.ProcessingException; import javax.ws.rs.core.Application; /** * Say something? * * @author George Cao * @since 4/15/13 2:15 PM */ public class <API key> implements ContainerProvider { private static final Logger LOG = LoggerFactory.getLogger(<API key>.class); @Override public <T> T createContainer(Class<T> type, Application app) throws ProcessingException { if (type != <API key>.class) { LOG.warn("Unsupported type {}", type); return null; } return type.cast(new <API key>(new ApplicationHandler(app))); } }
package jforgame.server.game.admin.commands; import jforgame.server.logs.LoggerSystem; import jforgame.common.utils.NumberUtil; import jforgame.server.game.admin.http.CommandHandler; import jforgame.server.game.admin.http.HttpCommandHandler; import jforgame.server.game.admin.http.HttpCommandParams; import jforgame.server.game.admin.http.HttpCommandResponse; import jforgame.server.game.admin.http.HttpCommands; import jforgame.server.net.NetGateKeeper; @CommandHandler(cmd=HttpCommands.FUNC_SWITCH) public class <API key> extends HttpCommandHandler { @Override public HttpCommandResponse action(HttpCommandParams httpParams) { int messageId = NumberUtil.intValue(httpParams.getInt("messageId")); boolean open = NumberUtil.booleanValue(httpParams.getString("switch")); if (open) { NetGateKeeper.getInstance().openProtocol(messageId); } else { NetGateKeeper.getInstance().closeProtocol(messageId); } LoggerSystem.HTTP_COMMAND.getLogger().info("{}{}", messageId, open); return HttpCommandResponse.valueOfSucc(); } }
package Moose::Meta::Method::Accessor::Native::Hash::exists; our $VERSION = '2.1404'; use strict; use warnings; use Moose::Role; with 'Moose::Meta::Method::Accessor::Native::Reader', 'Moose::Meta::Method::Accessor::Native::Hash'; sub _minimum_arguments { 1 } sub _maximum_arguments { 1 } sub <API key> { my $self = shift; return $self-><API key>('$_[0]'); } sub _return_value { my $self = shift; my ($slot_access) = shift; return 'exists ' . $slot_access . '->{ $_[0] }'; } no Moose::Role; 1;
'''This is the main zarkov event server. It uses gevent for a fast event loop in a single thread. It should typically be invoked with the zarkov-server script.''' import sys import time import logging from datetime import datetime, timedelta import bson import gevent from gevent_zeromq import zmq from zarkov import model from zarkov import util log = logging.getLogger(__name__) class Server(object): def __init__(self, context, options, j): self.context = context self._options = options self._j = j self.handlers = { 'event_noval':self._handle_event_noval, # log an event with no validation None:self._handle_event} # log an event with validation if options.<API key>: self._pub_sock = context.socket(zmq.PUB) self._pub_sock.bind(options.<API key>) else: self._pub_sock = None def serve_forever(self): q = gevent.queue.Queue(2**10) def bson_server(): # Wait on messages s_bson = self.context.socket(zmq.PULL) s_bson.bind(self._options.bson_bind_address) while True: q.put(s_bson.recv()) def json_server(): # Wait on messages s_json = self.context.socket(zmq.PULL) s_json.bind(self._options.json_bind_address) while True: msg = s_json.recv() q.put(util.bson_from_json(msg)) if self._options.bson_bind_address: gevent.spawn(bson_server) if self._options.json_bind_address: gevent.spawn(json_server) if self._options.incremental: gevent.spawn(self._g_aggregate) def resource_print(): import resource while True: rc = resource.getrusage(resource.RUSAGE_SELF) rs = resource.getrusage(resource.RUSAGE_CHILDREN) log.info('Server rss %s', rc.ru_maxrss + rs.ru_maxrss) gevent.sleep(10) gevent.spawn(resource_print) log.info('Starting main server on %s / %s', self._options.bson_bind_address, self._options.json_bind_address) while True: try: msg = q.get() obj = bson.BSON(msg).decode() command = obj.pop('$command', None) command_handler = self.handlers.get(command, None) if command_handler is None: log.warning('Unknown command %r', command) else: command_handler(obj) except KeyboardInterrupt: raise except: log.exception('Error in message loop') def _handle_event(self, obj): '''Validate event, save to journal (and mongo)''' ev = model.event(obj).make(obj) self._j(ev) def _handle_event_noval(self, obj): '''Save to journal (and mongo)''' self._j(obj) def _g_aggregate(self): '''Execute all defined AggDef aggregations.''' zmr = self.context.socket(zmq.REQ) zmr.connect(self._options.zmr['req_uri']) sess =model.orm_session next_agg = datetime.utcnow() while True: try: now = datetime.utcnow() if now < next_agg: gevent.sleep((next_agg-now).seconds) next_agg = datetime.utcnow() + timedelta(seconds=5) aggs = model.AggDef.query.find(dict(realtime=True)).all() if not aggs: continue begin = time.time() total_new = 0 for ad in aggs: new_docs = ad.incremental(zmr, self._options.zmr['event_limit']) if new_docs and self._pub_sock: self._pub_sock.send(bson.BSON.encode({ '$command':'agg_complete', 'name': ad.name, 'docs':new_docs})) total_new += new_docs sess.flush() sess.close() if total_new: log.info('%d aggregations complete in %.2fs', len(aggs), time.time() - begin) except: log.exception('Error in aggregate') def show_aggs(): aggs = model.AggDef.query.find().all() for agg in aggs: log.info('Agg %s:', agg.name) for d in agg.collection.find(): try: log.info('%s: %s', d['_id'].isoformat(' '), d['value']) except: log.info('%s', d) model.orm_session.close()
package rudp.test; import java.io.IOException; import xyz.vopen.cartier.net.rudp.ReliableSocket; /** * rudp.test * * @author Elve.Xu [iskp.me<at>gmail.com] * @version v1.0 - 2018/4/27. */ public class RClient { public static void main(String[] args) throws IOException { ReliableSocket client = new ReliableSocket("127.0.0.1", 9991); } }
package org.fossasia.phimpme.editor.view; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Matrix; import android.graphics.Paint; import android.graphics.Rect; import android.graphics.RectF; import android.util.AttributeSet; import android.view.View; import org.fossasia.phimpme.editor.utils.PaintUtil; public class RotateImageView extends View { private Rect srcRect; private RectF dstRect; private Rect maxRect; // The maximum limit rectangle private Bitmap bitmap; private Matrix matrix = new Matrix(); // Aiding rectangular private float scale; // scaling ratio private int rotateAngle; private RectF wrapRect = new RectF(); // Picture surrounded by rectangles private Paint bottomPaint; private RectF originImageRect; private RectF img; public RotateImageView(Context context) { super(context); init(context); } public RotateImageView(Context context, AttributeSet attrs) { super(context, attrs); init(context); } public RotateImageView(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); init(context); } private void init(Context context) { srcRect = new Rect(); dstRect = new RectF(); maxRect = new Rect(); bottomPaint = PaintUtil.<API key>(); originImageRect = new RectF(); } public void addBit(Bitmap bit, RectF imageRect) { bitmap = bit; srcRect.set(0, 0, bitmap.getWidth(), bitmap.getHeight()); dstRect = imageRect; img = imageRect; originImageRect.set(0, 0, bit.getWidth(), bit.getHeight()); this.invalidate(); } public void rotateImage(int angle, RectF imgRect) { rotateAngle = angle; dstRect = imgRect; img = imgRect; this.invalidate(); } public void reset() { rotateAngle = 0; scale = 1; invalidate(); } @Override public void draw(Canvas canvas) { super.draw(canvas); if (bitmap == null) return; maxRect.set(0, 0, getWidth(), getHeight()); // The maximum bounding rectangle calculateWrapBox(); scale = 1; if (wrapRect.width() > getWidth()) { scale = getWidth() / wrapRect.width(); } canvas.save(); canvas.scale(scale, scale, canvas.getWidth() >> 1, canvas.getHeight() >> 1); canvas.drawRect(wrapRect, bottomPaint); canvas.rotate(rotateAngle, canvas.getWidth() >> 1, canvas.getHeight() >> 1); canvas.drawBitmap(bitmap, srcRect, dstRect, null); canvas.restore(); } private void calculateWrapBox() { if (dstRect == null) { dstRect = img; } wrapRect.set(dstRect); matrix.reset(); int centerX = getWidth() >> 1; int centerY = getHeight() >> 1; matrix.postRotate(rotateAngle, centerX, centerY); // After the rotation angle matrix.mapRect(wrapRect); } public RectF getImageNewRect() { Matrix m = new Matrix(); m.postRotate(this.rotateAngle, originImageRect.centerX(), originImageRect.centerY()); m.mapRect(originImageRect); return originImageRect; } public synchronized float getScale() { return scale; } public synchronized int getRotateAngle() { return rotateAngle; } }
<?php /** * install helper * * @author Shopgate GmbH, 35510 Butzbach, DE * @package Shopgate_Framework */ class <API key> extends <API key> { /** * request url */ const <API key> = 'https://api.shopgate.com/log'; /** * interface installation action */ const INSTALL_ACTION = "interface_install"; /** * type community string */ const TYPE_COMMUNITY = "Community"; /** * type enterprise string */ const TYPE_ENTERPRISE = "Enterprise"; /** * type magento go string */ const TYPE_GO = "Go"; /** * hidden uid field */ const <API key> = 'shopgate/uid'; /** * @var null */ protected $_orders = null; /** * @var null */ protected $_date = null; /** * @var array */ protected $_orderIds = array(); /** * read connection for DB * * @var <API key> | null */ protected $_resource = null; /** * @var null | <API key> */ protected $_adapter = null; public function <API key>($type = self::INSTALL_ACTION) { $this->_date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s") . "-1 months")); $subshops = array(); /** @var $store <API key> */ foreach (Mage::getModel('core/store')->getCollection() as $store) { $storeId = $store->getId(); $subshops[] = array( 'uid' => $storeId, 'name' => $store->getFrontendName(), 'url' => $this->_getConfigData('web/unsecure/base_url', 'stores', $storeId), 'contact_name' => $this->_getConfigData('trans_email/ident_general/name', 'stores', $storeId), 'contact_phone' => $this->_getConfigData('general/store_information/phone', 'stores', $storeId), 'contact_email' => $this->_getConfigData('trans_email/ident_general/email', 'stores', $storeId), 'stats_items' => $this->_getItems($storeId), 'stats_categories' => $this->_getCategories($store->getRootCategoryId()), 'stats_orders' => $this->_getOrders($storeId), 'stats_acs' => $this->_calculateAverage($storeId), 'stats_currency' => $this->_getConfigData('currency/options/default', 'stores', $storeId), 'stats_unique_visits' => $this->_getVisitors($storeId), 'stats_mobile_visits' => 0 ); } $data = array( 'action' => $type, 'uid' => $this->_getUid(), 'plugin_version' => $this->_getPluginVersion(), 'shopping_system_id' => $this->_getShopSystemType(), 'subshops' => $subshops ); Mage::getConfig()->saveConfig(self::<API key>, $data['uid']); try { $client = new Zend_Http_Client(self::<API key>); $client->setParameterPost($data); $client->request(Zend_Http_Client::POST); } catch (Exception $e) { Mage::log("Shopgate_Framework Message: " . self::<API key> . " could not be reached.", Zend_Log::INFO, 'shopgate.log'); } } /** * getStoreConfig not working in installer, so need to read from db * * @param $path * @param string $scope * @param int $scopeId * * @return mixed */ protected function _getConfigData($path, $scope = 'default', $scopeId = 0) { if (!$this->_resource) { $this->_resource = Mage::getSingleton('core/resource'); $this->_adapter = $this->_resource->getConnection(<API key>::<API key>); } $table = $this->_resource->getTableName('core/config_data'); $select = $this->_adapter->select() ->from($table) ->columns('value') ->where('path = "' . $path . '" and scope="' . $scope . '" and scope_id="' . $scopeId . '"'); $result = $this->_adapter->fetchRow($select); if (!$result['value'] && $scope != 'default') { $result['value'] = $this->_getConfigData($path); } return $result['value']; } /** * get plugin version * * @return string */ protected function _getPluginVersion() { return (string)Mage::getConfig()->getModuleConfig("Shopgate_Framework")->version; } /** * get shop system number ( internal usage ) * * @return int|null */ protected function _getShopSystemType() { switch ($this->_getEdition()) { case self::TYPE_COMMUNITY: return 76; break; case self::TYPE_ENTERPRISE: return 228; break; case self::TYPE_GO: return 229; break; default: return null; break; } } /** * return magento type (edition) * * @return string */ protected function _getEdition() { $edition = self::TYPE_COMMUNITY; if (method_exists('Mage', 'getEdition')) { $edition = Mage::getEdition(); } else { $dir = mage::getBaseDir('code') . DS . 'core' . DS . self::TYPE_ENTERPRISE; if (file_exists($dir)) { $edition = self::TYPE_ENTERPRISE; } } return $edition; } /** * get product count unfiltered * * @param int $storeId * * @return int */ protected function _getItems($storeId) { return Mage::getModel('catalog/product') ->getCollection() ->addStoreFilter($storeId) -><API key>('id') ->getSize(); } /** * get categories count * * @param int $rootCatId * * @return int */ protected function _getCategories($rootCatId) { return Mage::getResourceModel('catalog/category')->getChildrenCount($rootCatId); } /** * get amount of orders * * @param int $storeId * * @return int|null */ protected function _getOrders($storeId) { /** @var <API key> $collection */ $collection = Mage::getResourceModel('sales/order_collection') ->addFieldToFilter('store_id', $storeId) ->addFieldToFilter( 'created_at', array( array( 'gteq' => $this->_date ) ) )-><API key>('grand_total'); return $collection->getSize(); } /** * @param int $storeId * * @return float result */ protected function _calculateAverage($storeId) { $collection = Mage::getResourceModel('sales/order_collection') ->addFieldToFilter('store_id', $storeId) ->addFieldToFilter('status', <API key>::STATE_COMPLETE) -><API key>('grand_total'); $collection->getSelect()->from(null, array('average' => 'AVG(grand_total)')); $result = $this->_adapter->fetchRow($collection->getSelect()->assemble()); if (!$result['average']) { $result['average'] = 0; } return round($result['average'], 2); } /** * get visitor data unfiltered * * @param int $storeId * * @return int */ protected function _getVisitors($storeId) { $result = Mage::getResourceModel('log/aggregation')->getCounts($this->_date, date("Y-m-d H:i:s"), $storeId); if (!$result['visitors']) { $result['visitors'] = 0; } return $result['visitors']; } /** * get uid to clarify identification in home system * * @return string */ protected function _getUid() { $key = (string)Mage::getConfig()->getNode('global/crypt/key'); $salt = $this->_getShopSystemType(); if (!$salt) { $salt = "5h0p6473.c0m"; } return md5($key . $salt); } /** * Public wrapper method for _getUid() * * @return string */ public function getUid() { return $this->_getUid(); } }
<?php // set up environment variables require_once('environ_config.php'); // Initialize library and system web page. include($app['_web_root'] . '/app/init_page.php'); // Initialize library and system web page. include($app['_web_root'] . '/app/display_begin.php'); ?>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="fi"> <head> <!-- Generated by javadoc (1.8.0_111) on Sun Mar 05 16:02:01 EET 2017 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>com.ahuotala.platformgame.entity.movement (2DPlatformGame 1.0-SNAPSHOT API)</title> <meta name="date" content="2017-03-05"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../../../../com/ahuotala/platformgame/entity/movement/package-summary.html" target="classFrame">com.ahuotala.platformgame.entity.movement</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="MonsterMover.html" title="class in com.ahuotala.platformgame.entity.movement" target="classFrame">MonsterMover</a></li> <li><a href="PlayerMover.html" title="class in com.ahuotala.platformgame.entity.movement" target="classFrame">PlayerMover</a></li> </ul> </div> </body> </html>
#!/usr/bin/python from azuremodules import * import argparse import sys import time #for error checking parser = argparse.ArgumentParser() parser.add_argument('-H', '--serverip', help='specifies server VIP of server name', required=True) parser.add_argument('-u', '--udp', help='switch : starts the client in udp data packets sending mode.', choices=['yes', 'no'] ) parser.add_argument('-p', '--port', help='specifies which port should be used', required=True, type= int) parser.add_argument('-l', '--time', help='duration for which test should be run', required=True) parser.add_argument('-m', '--length', help='length of buffer to read or write', type= int) #parser.add_argument('-p', '--port', help='specifies which port should be used', required=True, type= int) args = parser.parse_args() command = 'netperf -H ' + args.serverip + ' -l ' + args.time if args.udp == 'yes': command = command + ' -t UDP_STREAM' command = command + ' -- -R 1' + ' -P ' + str(args.port) + ',' + str(args.port) if args.length != None: command = command + ' -m ' + str(args.length) finalCommand = 'nohup ' + command + ' >> iperf-client.txt &' def RunTest(client): UpdateState("TestRunning") RunLog.info("Starting netperf Client..") RunLog.info("Executing Command : %s", client) temp = Run(client) cmd ='sleep 2' tmp = Run(cmd) sleepTime = int(args.time) + 10 cmd = 'sleep ' + str(sleepTime) tmp = Run(cmd) status = isProcessRunning('netperf') if status == "True": time.sleep(60) Run('echo "ProcessRunning" >> iperf-client.txt') Run('echo "Waiting for 60 secs to let netperf process finish" >> iperf-client.txt') status = isProcessRunning('netperf') if status == "True": Run('echo "ProcessRunning even after 60 secs delay" >> iperf-client.txt') else: Run('echo netperf process finished after extra wait of 60 secs >>iperf-client.txt') client = finalCommand RunTest(client) Run('echo "TestComplete" >> iperf-client.txt') <API key>()
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60-ea) on Thu Dec 15 09:48:33 EST 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>BufferCacheSupplier (Public javadocs 2016.12.1 API)</title> <meta name="date" content="2016-12-15"> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="BufferCacheSupplier (Public javadocs 2016.12.1 API)"; } } catch(err) { } var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/BufferCacheSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2016.12.1</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/undertow/BufferCacheConsumer.html" title="interface in org.wildfly.swarm.config.undertow"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/undertow/FilterConfiguration.html" title="class in org.wildfly.swarm.config.undertow"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/undertow/BufferCacheSupplier.html" target="_top">Frames</a></li> <li><a href="BufferCacheSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <div class="subTitle">org.wildfly.swarm.config.undertow</div> <h2 title="Interface BufferCacheSupplier" class="title">Interface BufferCacheSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/undertow/BufferCache.html" title="class in org.wildfly.swarm.config.undertow">BufferCache</a>&gt;</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>Functional Interface:</dt> <dd>This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.</dd> </dl> <hr> <br> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/FunctionalInterface.html?is-external=true" title="class or interface in java.lang">@FunctionalInterface</a> public interface <span class="typeNameLabel">BufferCacheSupplier&lt;T extends <a href="../../../../../org/wildfly/swarm/config/undertow/BufferCache.html" title="class in org.wildfly.swarm.config.undertow">BufferCache</a>&gt;</span></pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.summary"> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code><a href="../../../../../org/wildfly/swarm/config/undertow/BufferCache.html" title="class in org.wildfly.swarm.config.undertow">BufferCache</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/wildfly/swarm/config/undertow/BufferCacheSupplier.html#get--">get</a></span>()</code> <div class="block">Constructed instance of BufferCache resource</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.detail"> </a> <h3>Method Detail</h3> <a name="get </a> <ul class="blockListLast"> <li class="blockList"> <h4>get</h4> <pre><a href="../../../../../org/wildfly/swarm/config/undertow/BufferCache.html" title="class in org.wildfly.swarm.config.undertow">BufferCache</a>&nbsp;get()</pre> <div class="block">Constructed instance of BufferCache resource</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>The instance</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/BufferCacheSupplier.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2016.12.1</div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/wildfly/swarm/config/undertow/BufferCacheConsumer.html" title="interface in org.wildfly.swarm.config.undertow"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../org/wildfly/swarm/config/undertow/FilterConfiguration.html" title="class in org.wildfly.swarm.config.undertow"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/config/undertow/BufferCacheSupplier.html" target="_top">Frames</a></li> <li><a href="BufferCacheSupplier.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
<?php /** * DO NOT EDIT THIS FILE! * * This file was automatically generated from external sources. * * Any manual change here will be lost the next time the SDK * is updated. You've been warned! */ namespace DTS\eBaySDK\Test\PostOrder\Types; use DTS\eBaySDK\PostOrder\Types\<API key>; class <API key> extends \<API key> { private $obj; protected function setUp() { $this->obj = new <API key>(); } public function testCanBeCreated() { $this->assertInstanceOf('\DTS\eBaySDK\PostOrder\Types\<API key>', $this->obj); } public function testExtendsBaseType() { $this->assertInstanceOf('\DTS\eBaySDK\Types\BaseType', $this->obj); } }
package org.neo4j.cypher.internal.compatibility import java.net.URL import org.neo4j.cypher.<API key> import org.neo4j.cypher.internal.compiler.v2_2.spi import org.neo4j.cypher.internal.compiler.v2_2.spi._ import org.neo4j.graphdb.{Direction, Node, PropertyContainer, Relationship} import org.neo4j.kernel.api.TokenNameLookup import org.neo4j.kernel.api.exceptions.KernelException import org.neo4j.kernel.api.index.IndexDescriptor class <API key>(inner: QueryContext) extends <API key>(inner) { override def setLabelsOnNode(node: Long, labelIds: Iterator[Int]): Int = translateException(super.setLabelsOnNode(node, labelIds)) override def close(success: Boolean) = translateException(super.close(success)) override def createNode(): Node = translateException(super.createNode()) override def createRelationship(start: Node, end: Node, relType: String): Relationship = translateException(super.createRelationship(start, end, relType)) override def getLabelsForNode(node: Long): Iterator[Int] = translateException(super.getLabelsForNode(node)) override def getLabelName(id: Int): String = translateException(super.getLabelName(id)) override def getOptLabelId(labelName: String): Option[Int] = translateException(super.getOptLabelId(labelName)) override def getLabelId(labelName: String): Int = translateException(super.getLabelId(labelName)) override def getOrCreateLabelId(labelName: String): Int = translateException(super.getOrCreateLabelId(labelName)) override def nodeOps: Operations[Node] = new <API key>[Node](super.nodeOps) override def relationshipOps: Operations[Relationship] = new <API key>[Relationship](super.relationshipOps) override def <API key>(node: Long, labelIds: Iterator[Int]): Int = translateException(super.<API key>(node, labelIds)) override def <API key>(node: Long): Iterator[Long] = translateException(super.<API key>(node)) override def <API key>(relId: Long): Iterator[Long] = translateException(super.<API key>(relId)) override def getPropertyKeyName(propertyKeyId: Int): String = translateException(super.getPropertyKeyName(propertyKeyId)) override def getOptPropertyKeyId(propertyKeyName: String): Option[Int] = translateException(super.getOptPropertyKeyId(propertyKeyName)) override def getPropertyKeyId(propertyKey: String): Int = translateException(super.getPropertyKeyId(propertyKey)) override def <API key>(propertyKey: String): Int = translateException(super.<API key>(propertyKey)) override def addIndexRule(labelId: Int, propertyKeyId: Int) = translateException(super.addIndexRule(labelId, propertyKeyId)) override def dropIndexRule(labelId: Int, propertyKeyId: Int) = translateException(super.dropIndexRule(labelId, propertyKeyId)) override def exactIndexSearch(index: IndexDescriptor, value: Any): Iterator[Node] = translateException(super.exactIndexSearch(index, value)) override def getNodesByLabel(id: Int): Iterator[Node] = translateException(super.getNodesByLabel(id)) override def nodeGetDegree(node: Long, dir: Direction): Int = translateException(super.nodeGetDegree(node, dir)) override def nodeGetDegree(node: Long, dir: Direction, relTypeId: Int): Int = translateException(super.nodeGetDegree(node, dir, relTypeId)) override def <API key>[K, V](key: K, creator: => V): V = translateException(super.<API key>(key, creator)) override def upgrade(context: spi.QueryContext): LockingQueryContext = translateException(super.upgrade(context)) override def <API key>(labelId: Int, propertyKeyId: Int) = translateException(super.<API key>(labelId, propertyKeyId)) override def <API key>(labelId: Int, propertyKeyId: Int) = translateException(super.<API key>(labelId, propertyKeyId)) override def <API key>[T](work: (QueryContext) => T): T = super.<API key>(qc => translateException( work(new <API key>(qc)) )) override def isLabelSetOnNode(label: Int, node: Long): Boolean = translateException(super.isLabelSetOnNode(label, node)) override def getRelTypeId(relType: String) = translateException(super.getRelTypeId(relType)) override def getRelTypeName(id: Int) = translateException(super.getRelTypeName(id)) override def <API key>(index: IndexDescriptor, value: Any) = translateException(super.<API key>(index, value)) override def commitAndRestartTx() = translateException(super.commitAndRestartTx()) override def getImportURL(url: URL): Either[String,URL] = translateException(super.getImportURL(url)) override def <API key>(rel: Relationship) = translateException(super.<API key>(rel)) override def relationshipEndNode(rel: Relationship) = translateException(super.relationshipEndNode(rel)) class <API key>[T <: PropertyContainer](inner: Operations[T]) extends <API key>[T](inner) { override def delete(obj: T) = translateException(super.delete(obj)) override def setProperty(id: Long, propertyKey: Int, value: Any) = translateException(super.setProperty(id, propertyKey, value)) override def getById(id: Long): T = translateException(super.getById(id)) override def getProperty(id: Long, propertyKeyId: Int): Any = translateException(super.getProperty(id, propertyKeyId)) override def hasProperty(id: Long, propertyKeyId: Int): Boolean = translateException(super.hasProperty(id, propertyKeyId)) override def propertyKeyIds(id: Long): Iterator[Int] = translateException(super.propertyKeyIds(id)) override def removeProperty(id: Long, propertyKeyId: Int) = translateException(super.removeProperty(id, propertyKeyId)) override def indexGet(name: String, key: String, value: Any): Iterator[T] = translateException(super.indexGet(name, key, value)) override def indexQuery(name: String, query: Any): Iterator[T] = translateException(super.indexQuery(name, query)) override def all: Iterator[T] = translateException(super.all) override def isDeleted(obj: T): Boolean = translateException(super.isDeleted(obj)) } private def translateException[A](f: => A) = try { f } catch { case e: KernelException => throw new <API key>(e.getUserMessage(new TokenNameLookup { def propertyKeyGetName(propertyKeyId: Int): String = inner.getPropertyKeyName(propertyKeyId) def labelGetName(labelId: Int): String = inner.getLabelName(labelId) def <API key>(relTypeId: Int): String = inner.getRelTypeName(relTypeId) }), e) } }
package cn.jony.okhttpplus.lib.httpdns.db; public interface DBConstants { String DATABASE_NAME = "dns_cache_info.db"; int DATABASE_VERSION = 1; String TABLE_IP = "ip"; String COLUMN_HOST = "host"; String COLUMN_OPERATOR = "operator"; /** * source ip */ String COLUMN_SOURCE_IP = "source_ip"; /** * target ip */ String COLUMN_TARGET_IP = "target_ip"; /** * save time in millis */ String COLUMN_SAVE_MILLIS = "save_millis"; /** * ttl */ String COLUMN_TTL = "ttl"; /** * ip(pinghttp)ms */ String COLUMN_RTT = "rtt"; String COLUMN_SUCCESS_NUM = "success_num"; String COLUMN_FAIL_NUM = "fail_num"; String COLUMN_VISIT_NUM = "visit_num"; /** * ip sql */ String CREATE_IP_TEBLE_SQL = "CREATE TABLE " + TABLE_IP + " (" + COLUMN_TARGET_IP + " TEXT," + COLUMN_HOST + " TEXT," + COLUMN_SOURCE_IP + " TEXT," + COLUMN_OPERATOR + " TEXT," + COLUMN_TTL + " INTEGER," + COLUMN_RTT + " LONG," + COLUMN_SAVE_MILLIS + " LONG," + COLUMN_SUCCESS_NUM + " INTEGER," + COLUMN_FAIL_NUM + " INTEGER," + COLUMN_VISIT_NUM + " INTEGER," + "PRIMARY KEY(" + COLUMN_TARGET_IP + "," + COLUMN_SOURCE_IP + ")" + ");"; String <API key> = "CREATE INDEX idx_host_sourceId ON " + TABLE_IP + "(" + COLUMN_HOST + "," + COLUMN_SOURCE_IP + ");"; }
@CHARSET "ISO-8859-1"; #file_drop_handler { border: 2px dotted #0B85A1; width: 400px; height: 200px; color: #92AAB0; text-align: left; vertical-align: middle; padding: 10px 10px 10 10px; margin: 10px; font-size: 200%; } .progressBar { width: 200px; height: 22px; border: 1px solid #ddd; border-radius: 5px; overflow: hidden; display: inline-block; margin: 0px 10px 5px 5px; vertical-align: top; } .progressBar div { height: 100%; color: #fff; text-align: right; line-height: 22px; /* same as #progressBar height if we want text middle aligned */ width: 0; background-color: #0ba1b5; border-radius: 3px; } .statusbar { border-top: 1px solid #A9CCD1; min-height: 25px; width: 700px; padding: 10px 10px 0px 10px; vertical-align: top; } .statusbar:nth-child(odd) { background: #EBEFF0; } .filename { display: inline-block; vertical-align: top; width: 250px; } .filesize { display: inline-block; vertical-align: top; color: #30693D; width: 100px; margin-left: 10px; margin-right: 5px; } .abort { background-color: #A8352F; -moz-border-radius: 4px; -<API key>: 4px; border-radius: 4px; display: inline-block; color: #fff; font-family: arial; font-size: 13px; font-weight: normal; padding: 4px 15px; cursor: pointer; vertical-align: top }
# AUTOGENERATED FILE FROM balenalib/<API key>:bullseye-run ENV NODE_VERSION 14.16.1 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && set -x \ && for key in \ <API key> \ ; do \ gpg --batch --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --batch --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apt-get update && apt-get install -y $buildDeps --<API key> \
// ==UserScript== // @name toolboxSmartFloater.uc.js // @include main // @compatibility Firefox 4+ // @version 0.1.7.220 // @note // ==/UserScript== (function() { var tbsf = { //ToolBarSmartFloater FLOAT_BARS: ["toolbar-menubar", "PersonalToolbar"], // ids for bars we cared hidingStatuses: {}, trigger: null, running: false, floating: true, modifier: false, // trigger ID: <API key> installTrigger: function() { this.trigger = document.createElement("separator"); this.trigger.setAttribute("id", "<API key>"); this.trigger.setAttribute("orient", "horizontal"); ucx.loadStyle('@namespace url(http: \ #<API key> {\ position: fixed;\ top: 0px !important;\ height: 2px;\ width: 100% !important;\ z-index: 100;\ opacity: 0 !important;\ }\ \ #toolbar-menubar[autohide="true"] ~ #<API key> {\ top: 8px !important;\ }\ \ #toolbar-menubar[floating] {\ position: fixed;\ z-index: 10;\ overflow: visible !important;\ <API key>: 5px !important;\ }\ \ #toolbar-menubar[floating][autohide="false"] .<API key> {\ display: none !important;\ }\ \ #PersonalToolbar[floating] {\ position: fixed;\ overflow: visible !important;\ z-index: 10;\ border-bottom-color: rgba(0, 0, 0, 0.32) !important;\ <API key>: 2.5px !important;\ <API key>: 2.5px !important;\ border-bottom-style: solid !important;\ border-bottom-width: 1px !important;\ }\ \ #toolbar-menubar[floating],\ #PersonalToolbar[floating] {\ color: rgb(0, 0, 160) !important;\ background-color: rgb(207, 219, 236) !important;\ }'); let tb = $('toolbar-menubar'); tb.parentNode.insertBefore(this.trigger, tb.nextSibling); }, handleEvent: function(event) { switch (event.type) { case "mouseover": if (this.running) { if (event.target === this.trigger) return; gBrowser.mPanelContainer.removeEventListener('mouseover', this, true); this.running = false; if (!this.modifier != !this.floating) this.smartFloat(); else this.simpleToggle(); this.modifier = false; } else { if (event.ctrlKey) this.modifier = true; gBrowser.mPanelContainer.addEventListener('mouseover', this, true); this.running = true; if (!this.modifier != !this.floating) this.smartFloat(); else this.simpleToggle(); } break; } }, smartFloat: function() { var that = this; if (this.running) { this.FLOAT_BARS.forEach(function(id){ let toolbar = $(id); let hidingAttribute = toolbar.getAttribute("type") == "menubar" ? "autohide" : "collapsed"; that.hidingStatuses[id] = toolbar.getAttribute(hidingAttribute); if (that.hidingStatuses[id] == 'true') { toolbar.setAttribute('floating', 'true'); toolbar.setAttribute(hidingAttribute, 'false'); that.MenuBarHelper(); that.PlacesToolbarHelper(); } }); } else { this.FLOAT_BARS.forEach(function(id){ let toolbar = $(id); let hidingAttribute = toolbar.getAttribute("type") == "menubar" ? "autohide" : "collapsed"; if (that.hidingStatuses[id] == 'true') { toolbar.setAttribute(hidingAttribute, that.hidingStatuses[id]); that.MenuBarHelper(); that.PlacesToolbarHelper(); toolbar.removeAttribute('floating'); } delete that.hidingStatuses[id]; }); } }, MenuBarHelper: function() { let menubar = $('toolbar-menubar'); if (!menubar.hasAttribute('floating')) return; if (this.running) { /* locate position */ let mainWin = $('main-window'); let isMaxmized = mainWin.getAttribute('sizemode') == 'maximized' || mainWin.getAttribute('fullscreen') == 'maximized'; menubar.style.top = (isMaxmized ? 8 : 0) + 'px'; /* width adjusting */ let l = ucx.width($('titlebar')); // To cut the length of menubar to display system and additional buttons l = l - ucx.width($('<API key>')) - 54; // 115: Actual Window Manager 5 buttons; 27: 1 button; menubar.style.width = l + 'px'; /* enable spring */ let springs = menubar.<API key>('toolbarspring'); if (springs) { let w = 0; for (let i=0; i<menubar.childNodes.length; i++) { if (menubar.childNodes[i].tagName == 'toolbarspring' || menubar.childNodes[i].className == '<API key>') continue; w += ucx.width(menubar.childNodes[i]); } // To move icons' locations only // if (isMaxmized) w += ucx.width($('<API key>'));// 90: Actual Window Manager buttons w = (l - w - 16) / springs.length; // w /= springs.length; for (let i=0; i<springs.length; i++) springs[i].style.width = w + 'px'; } } else { menubar.style.top = '0px'; } }, PlacesToolbarHelper: function() { let pt = $('PersonalToolbar'); if (!pt.hasAttribute('floating')) return; PlacesToolbarHelper.init(); if (this.running) { let menubar = $('toolbar-menubar'); if (menubar.hasAttribute('floating')) { pt.style.top = parseInt(menubar.style.top) + ucx.height(menubar) + 'px'; pt.style.width = ucx.width($('titlebar')) + 'px'; } } else { pt.style.top = '0px'; } }, simpleToggle: function() { var that = this; if (this.running) {// display all this.FLOAT_BARS.forEach(function(id){ let toolbar = $(id); let hidingAttribute = toolbar.getAttribute("type") == "menubar" ? "autohide" : "collapsed"; that.hidingStatuses[id] = toolbar.getAttribute(hidingAttribute); if (that.hidingStatuses[id] == 'true') { <API key>(toolbar, true); } }); } else {// restore original status this.FLOAT_BARS.forEach(function(id){ let toolbar = $(id); if (that.hidingStatuses[id] == 'true') { <API key>(toolbar, false); } delete that.hidingStatuses[id]; }); } }, init: function() { this.installTrigger(); this.trigger.addEventListener("mouseover", this, true); }, }; tbsf.init(); })();
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_121) on Tue Nov 12 08:41:56 GMT 2019 --> <title>org.primaresearch.dla.page.scanner.element Class Hierarchy (PageMetadataScanner API)</title> <meta name="date" content="2019-11-12"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.primaresearch.dla.page.scanner.element Class Hierarchy (PageMetadataScanner API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/primaresearch/dla/page/scanner/package-tree.html">Prev</a></li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/primaresearch/dla/page/scanner/element/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h1 class="title">Hierarchy For Package org.primaresearch.dla.page.scanner.element</h1> <span class="<API key>">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.Object <ul> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.<a href="../../../../../../org/primaresearch/dla/page/scanner/<API key>.html" title="interface in org.primaresearch.dla.page.scanner"><API key></a>, org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/BoundsScanElement.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink">BoundsScanElement</span></a> (implements org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.<a href="../../../../../../org/primaresearch/dla/page/scanner/<API key>.html" title="interface in org.primaresearch.dla.page.scanner"><API key></a>, org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/MetaDataScanElement.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink">MetaDataScanElement</span></a> (implements org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.<a href="../../../../../../org/primaresearch/dla/page/scanner/<API key>.html" title="interface in org.primaresearch.dla.page.scanner"><API key></a>, org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.<a href="../../../../../../org/primaresearch/dla/page/scanner/<API key>.html" title="interface in org.primaresearch.dla.page.scanner"><API key></a>, org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.<a href="../../../../../../org/primaresearch/dla/page/scanner/<API key>.html" title="interface in org.primaresearch.dla.page.scanner"><API key></a>, org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/<API key>.html" title="class in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink"><API key></span></a> (implements org.primaresearch.dla.page.scanner.<a href="../../../../../../org/primaresearch/dla/page/scanner/<API key>.html" title="interface in org.primaresearch.dla.page.scanner"><API key></a>, org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element">ScanElement</a>)</li> </ul> </li> </ul> <h2 title="Interface Hierarchy">Interface Hierarchy</h2> <ul> <li type="circle">org.primaresearch.dla.page.scanner.element.<a href="../../../../../../org/primaresearch/dla/page/scanner/element/ScanElement.html" title="interface in org.primaresearch.dla.page.scanner.element"><span class="typeNameLink">ScanElement</span></a></li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/primaresearch/dla/page/scanner/package-tree.html">Prev</a></li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/primaresearch/dla/page/scanner/element/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small><i>Copyright & </body> </html>
using SilentHunter; using SilentHunter.Controllers; namespace SHControllers { <summary> <API key> action controller. </summary> public class <API key> : BehaviorController { <summary> The minimum angular speed [deg/s]. </summary> public float <API key>; <summary> The maximum angular speed [deg/s]. </summary> public float <API key>; <summary> The minimum delay between two rotations [s]. </summary> public float <API key>; <summary> The maximum delay between two rotations [s]. </summary> public float <API key>; <summary> The inertia of rotation. </summary> public float RotationInertia; <summary> The minimum and maximum movement angles (in degrees). </summary> public MinMax Angles; <summary> The local axis to rotate around. </summary> public Axis Axe; } }
#include <aws/appflow/model/<API key>.h> #include <aws/core/utils/json/JsonSerializer.h> #include <utility> using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace Appflow { namespace Model { <API key>::<API key>() : <API key>(false), m_datadogHasBeenSet(false), <API key>(false), <API key>(false), <API key>(false), <API key>(false), m_marketoHasBeenSet(false), <API key>(false), <API key>(false), <API key>(false), <API key>(false), m_slackHasBeenSet(false), <API key>(false), <API key>(false), m_veevaHasBeenSet(false), m_zendeskHasBeenSet(false), <API key>(false), <API key>(false) { } <API key>::<API key>(JsonView jsonValue) : <API key>(false), m_datadogHasBeenSet(false), <API key>(false), <API key>(false), <API key>(false), <API key>(false), m_marketoHasBeenSet(false), <API key>(false), <API key>(false), <API key>(false), <API key>(false), m_slackHasBeenSet(false), <API key>(false), <API key>(false), m_veevaHasBeenSet(false), m_zendeskHasBeenSet(false), <API key>(false), <API key>(false) { *this = jsonValue; } <API key>& <API key>::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Amplitude")) { m_amplitude = jsonValue.GetObject("Amplitude"); <API key> = true; } if(jsonValue.ValueExists("Datadog")) { m_datadog = jsonValue.GetObject("Datadog"); m_datadogHasBeenSet = true; } if(jsonValue.ValueExists("Dynatrace")) { m_dynatrace = jsonValue.GetObject("Dynatrace"); <API key> = true; } if(jsonValue.ValueExists("GoogleAnalytics")) { m_googleAnalytics = jsonValue.GetObject("GoogleAnalytics"); <API key> = true; } if(jsonValue.ValueExists("Honeycode")) { m_honeycode = jsonValue.GetObject("Honeycode"); <API key> = true; } if(jsonValue.ValueExists("InforNexus")) { m_inforNexus = jsonValue.GetObject("InforNexus"); <API key> = true; } if(jsonValue.ValueExists("Marketo")) { m_marketo = jsonValue.GetObject("Marketo"); m_marketoHasBeenSet = true; } if(jsonValue.ValueExists("Redshift")) { m_redshift = jsonValue.GetObject("Redshift"); <API key> = true; } if(jsonValue.ValueExists("Salesforce")) { m_salesforce = jsonValue.GetObject("Salesforce"); <API key> = true; } if(jsonValue.ValueExists("ServiceNow")) { m_serviceNow = jsonValue.GetObject("ServiceNow"); <API key> = true; } if(jsonValue.ValueExists("Singular")) { m_singular = jsonValue.GetObject("Singular"); <API key> = true; } if(jsonValue.ValueExists("Slack")) { m_slack = jsonValue.GetObject("Slack"); m_slackHasBeenSet = true; } if(jsonValue.ValueExists("Snowflake")) { m_snowflake = jsonValue.GetObject("Snowflake"); <API key> = true; } if(jsonValue.ValueExists("Trendmicro")) { m_trendmicro = jsonValue.GetObject("Trendmicro"); <API key> = true; } if(jsonValue.ValueExists("Veeva")) { m_veeva = jsonValue.GetObject("Veeva"); m_veevaHasBeenSet = true; } if(jsonValue.ValueExists("Zendesk")) { m_zendesk = jsonValue.GetObject("Zendesk"); m_zendeskHasBeenSet = true; } if(jsonValue.ValueExists("SAPOData")) { m_sAPOData = jsonValue.GetObject("SAPOData"); <API key> = true; } if(jsonValue.ValueExists("CustomConnector")) { m_customConnector = jsonValue.GetObject("CustomConnector"); <API key> = true; } return *this; } JsonValue <API key>::Jsonize() const { JsonValue payload; if(<API key>) { payload.WithObject("Amplitude", m_amplitude.Jsonize()); } if(m_datadogHasBeenSet) { payload.WithObject("Datadog", m_datadog.Jsonize()); } if(<API key>) { payload.WithObject("Dynatrace", m_dynatrace.Jsonize()); } if(<API key>) { payload.WithObject("GoogleAnalytics", m_googleAnalytics.Jsonize()); } if(<API key>) { payload.WithObject("Honeycode", m_honeycode.Jsonize()); } if(<API key>) { payload.WithObject("InforNexus", m_inforNexus.Jsonize()); } if(m_marketoHasBeenSet) { payload.WithObject("Marketo", m_marketo.Jsonize()); } if(<API key>) { payload.WithObject("Redshift", m_redshift.Jsonize()); } if(<API key>) { payload.WithObject("Salesforce", m_salesforce.Jsonize()); } if(<API key>) { payload.WithObject("ServiceNow", m_serviceNow.Jsonize()); } if(<API key>) { payload.WithObject("Singular", m_singular.Jsonize()); } if(m_slackHasBeenSet) { payload.WithObject("Slack", m_slack.Jsonize()); } if(<API key>) { payload.WithObject("Snowflake", m_snowflake.Jsonize()); } if(<API key>) { payload.WithObject("Trendmicro", m_trendmicro.Jsonize()); } if(m_veevaHasBeenSet) { payload.WithObject("Veeva", m_veeva.Jsonize()); } if(m_zendeskHasBeenSet) { payload.WithObject("Zendesk", m_zendesk.Jsonize()); } if(<API key>) { payload.WithObject("SAPOData", m_sAPOData.Jsonize()); } if(<API key>) { payload.WithObject("CustomConnector", m_customConnector.Jsonize()); } return payload; } } // namespace Model } // namespace Appflow } // namespace Aws
title: WIT - Learn layout: layouts/sub.liquid hero-height: 245 hero-image: /assets/images/banner-learn.png hero-title: "Model probing for understandable, reliable, and fair machine learning" hero-copy: "Learn how to explore feature sensitivity, compare model performance, and stress-test hypotheticals. " sub-nav: '<a href="#basics">Basics of the What-If Tool</a><a href="#analysis">Conducting analysis</a><a href="#resources">Related resources & posts</a>' color: "#8A2A04" <div class="mdl-cell--8-col <API key> <API key>"> <a name="basics"></a> ## Discover the basics {% include partials/<API key> c-title: "A Tour of the What-If Tool", link: "/learn/tutorials/tour", c-copy: "Learn about different spaces and how they are used in the What-If Tool: tabs, workspaces, modules and playgrounds." %} {% include partials/<API key> c-title: "A Walkthrough with UCI Census Data", link: "/learn/tutorials/walkthrough/", c-copy: "Explore how the What-If Tool can help us learn about a model and dataset through a concrete example." %} {% include partials/<API key> c-title: "How To: Edit A Datapoint", link: "/learn/tutorials/edit-datapoint", c-copy: "Learn how to edit a datapoint in the What-If Tool." %} {% include partials/<API key> c-title: "How To: Find A Counterfactual", link: "/learn/tutorials/counterfactual", c-copy: "Learn the steps to find a counterfactual to a datapoint in the What-If Tool." %} {% include partials/<API key> c-title: "How To: Customize the Datapoints Visualization", link: "/learn/tutorials/<API key>", c-copy: "Learn how to customize visualizations from features in a loaded dataset using the Datapoints visualization." %} {% include partials/<API key> c-title: "How To: Visualize Partial Dependence Plots", link: "/learn/tutorials/<API key>", c-copy: "Learn how to view partial dependence plots and what value they provide." %} {% include partials/<API key> c-title: "Features Overview: Understanding Your Feature Distributions", link: "/learn/tutorials/features-overview", c-copy: "Explore the functionality of the Features Overview dashboard in the What-If Tool." %} {% include partials/<API key> c-title: "Technical Setup: Getting Started in Tensorboard", link: "/learn/tutorials/tensorboard", c-copy: "Set up the What-If Tool inside of TensorBoard." %} {% include partials/<API key> c-title: "Technical Setup: Getting Started in Notebooks", link: "/learn/tutorials/notebooks", c-copy: "Set up the What-If Tool inside of notebook environments." %} {% include partials/<API key> c-title: "Custom Prediction Functions", link: "/learn/tutorials/custom-prediction", c-copy: "Learn to use the What-If Tool with arbitrary python functions, and how to include feature attributions in the analysis." %} {% include partials/spacer height:50 %} <a name="analysis"></a> ## Conducting analysis in the What-If Tool {% include partials/<API key> c-title: "Understanding Performance Metrics For Classifiers", link: "/learn/tutorials/<API key>", c-copy: "A brief overview of performance metrics for <API key> models." %} {% include partials/<API key> c-title: "Relationship Between Cost Ratio and Thresholds", link: "/learn/tutorials/cost-ratio", c-copy: "Understand the relationship between the ratio of the costs of false positives and false negatives and the optimization controls." %} {% include partials/<API key> c-title: "Adding Non-Input Features To Perform Analysis", link: "/learn/tutorials/non-input-features", c-copy: "Learn how to add non-input features into the What-If Tool to analyze subgroups." %} {% include partials/<API key> c-title: "Exploring Features Overview To Identify Biases", link: "/learn/tutorials/<API key>", c-copy: "Explore datapoints in Features Overview to identify sources of bias." %} {% include partials/<API key> c-title: "Exploring Attributions", link: "/learn/tutorials/attributions", c-copy: "Learn how to analyze feature attributions in the What-If Tool." %} {% include partials/spacer height:50 %} <a name="resources"></a> ## Related resources and posts <div class="mdl-grid no-padding"> {% include partials/resource-card c-title: "Qwiklabs Quest: Explore Machine Learning Models with Explainable AI.", link: "https: {% include partials/resource-card c-title: "Using the ‘What-If Tool’ to investigate Machine Learning models.", link: "https://towardsdatascience.com/<API key>", c-copy: "A <API key> run-through of the features of the What-If Tool.", cta-copy:"Go to article", external:"true" %} {% include partials/resource-card c-title: "Introducing the What-If Tool", link: "https: {% include partials/resource-card c-title: "What if AI model understanding were easy?", link: "https://towardsdatascience.com/<API key>", c-copy: "See analytics-for-AI in action as Cassie Kozyrkov walks us through the What-If Tool.", cta-copy:"Go to article", external:"true" %} </div> {% include partials/spacer height:30 %} </div>
package com.lib.manager.user; import java.io.<API key>; import java.sql.SQLException; import org.ppl.BaseClass.Permission; import org.ppl.etc.UrlClassList; import org.ppl.io.Encrypt; import org.ppl.io.ProjectPath; import org.ppl.io.TimeClass; public class my_profile extends Permission { public my_profile() { // TODO Auto-generated constructor stub String className = this.getClass().getCanonicalName(); // stdClass = className; super.GetSubClassName(className); setRoot("name", _MLang("name")); setRoot("fun", this); super.setAction(1); } @Override public void Show() { // TODO Auto-generated method stub if (super.Init() == -1){ return; } String edit_id = porg.getKey("edit_id"); UrlClassList ucl = UrlClassList.getInstance(); setRoot("action_url", ucl.BuildUrl(SliceName(stdClass), "")); if (edit_id != null) { setRoot("alerts", "q"); setRoot("save_msg", editMyProfile()); setRoot("nickname", porg.getKey("nickname")); setRoot("username", porg.getKey("username")); setRoot("email", porg.getKey("email")); setRoot("phone", porg.getKey("phone")); } else { setRoot("nickname", aclGetNickName()); setRoot("username", aclGetName()); setRoot("email", aclGetEmail()); setRoot("phone", aclGetPhone()); } super.View(); } private String editMyProfile() { String nickname = porg.getKey("nickname"); String email = porg.getKey("email"); String phone = porg.getKey("phone"); String pass1 = porg.getKey("pass1"); String pass2 = porg.getKey("pass2"); String pwd = ""; if (!pass1.isEmpty() && !pass2.isEmpty()) { if (!pass1.equals(pass2)) { return _CLang("error_pwdneq"); } Encrypt en = Encrypt.getInstance(); pwd = ", `passwd`='" + en.MD5(pass1) + "' "; } TimeClass tc = TimeClass.getInstance(); int now = (int) tc.time(); String format = "UPDATE `" + DB_PRE + "user_info` SET `nickname` = '%s',`email`='%s',`etime`='%d',`phone`='%s'" + pwd + " WHERE `uid` = %s"; String sql = String.format(format, nickname, email, now, phone, aclGetUid()); try { update(sql); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } try { SaveLogo(); } catch (<API key> e) { // TODO Auto-generated catch block e.printStackTrace(); } return _CLang("ok_save"); } private void SaveLogo() throws <API key> { String name = porg.getUpload_name().get("user_logo_file").toString(); byte[] val = porg.getUpload_string().get("user_logo_file"); if(val.length<1)return; ProjectPath pp = ProjectPath.getInstance(); pp.SaveFile(name, val); } }
# AUTOGENERATED FILE FROM balenalib/<API key>:buster-build ENV GO_VERSION 1.16.14 RUN mkdir -p /usr/local/go \ && curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-armv7hf.tar.gz" \ && echo "<SHA256-like> go$GO_VERSION.linux-armv7hf.tar.gz" | sha256sum -c - \ && tar -xzf "go$GO_VERSION.linux-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \ && rm -f go$GO_VERSION.linux-armv7hf.tar.gz ENV GOROOT /usr/local/go ENV GOPATH /go ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" WORKDIR $GOPATH CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"] RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/<SHA1-like>/scripts/assets/tests/test-stack@golang.sh" \ && echo "Running test-stack@golang" \ && chmod +x test-stack@golang.sh \ && bash test-stack@golang.sh \ && rm -rf test-stack@golang.sh RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https: RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \ && chmod +x /bin/sh-shim \ && cp /bin/sh /bin/sh.real \ && mv /bin/sh-shim /bin/sh
package io.cattle.platform.core.addon; import io.github.ibuildthecloud.gdapi.annotation.Field; import io.github.ibuildthecloud.gdapi.annotation.Type; @Type(list = false) public class DependsOn { public enum DependsOnCondition { running, healthy } String service; String container; DependsOnCondition condition; @Field(nullable = false) public String getService() { return service; } public void setService(String service) { this.service = service; } @Field(defaultValue = "healthy") public DependsOnCondition getCondition() { return condition; } public void setCondition(DependsOnCondition condition) { this.condition = condition; } public String getContainer() { return container; } public void setContainer(String container) { this.container = container; } }
'use strict' import {FireBaseLegoApp} from './firebase/firebase.js'; (function () { function pageLoad() { let fireBaseLego = new FireBaseLegoApp().app; fireBaseLego.database().ref('drawShow').once('value', function (snapshot) { if (snapshot && snapshot.val()) { let snapshotFb = snapshot.val(); let keys = Object.keys(snapshotFb); let domParent = document.createElement('section'); domParent.classList.add('parent-snapshots'); keys.forEach((key) => addElement(snapshotFb[key], domParent)); document.getElementById('game').appendChild(domParent); } }); } function addElement(draw, domParent) { let imgParent = document.createElement('div'); let img = document.createElement('img'); img.src = draw.dataUrl; img.classList.add('img-ori'); imgParent.classList.add('img-ori-parent'); imgParent.setAttribute('data-author', draw.user); imgParent.appendChild(img); imgParent.classList.add('big'); domParent.appendChild(imgParent); } window.addEventListener('load', pageLoad); })();
package guidemo; import guidemo.helpers.ChartCreator; import guidemo.helpers.DateCellEditor; import guidemo.helpers.DateCellRender; import guidemo.helpers.DateTimeTableEditor; import guidemo.helpers.XlsReader; import guidemo.helpers.XlsWriter; import guidemo.models.<API key>; import guidemo.models.ReticEntry; import guidemo.models.WaterDetail; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Image; import java.io.File; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.ImageIcon; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; import javax.swing.filechooser.<API key>; import javax.swing.table.DefaultTableModel; import javax.swing.table.TableColumn; import org.knowm.xchart.QuickChart; import org.knowm.xchart.SwingWrapper; import org.knowm.xchart.XChartPanel; import org.knowm.xchart.XYChartBuilder; import org.knowm.xchart.XYChart; import org.knowm.xchart.XYSeries; import org.knowm.xchart.XYSeries.XYSeriesRenderStyle; import org.knowm.xchart.style.Styler.LegendPosition; public class MainJFrame extends javax.swing.JFrame { /** * Creates new form MainJFrame */ public MainJFrame() { this.currDirectoryPath = ""; initComponents(); initLogo(); initTableEditor(); initWarningLabels(); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jTextField1 = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); filePathTextField = new javax.swing.JTextField(); browserFileButton = new javax.swing.JButton(); reticDataEntryTable = new javax.swing.JTabbedPane(); jPanel1 = new javax.swing.JPanel(); jScrollPane1 = new javax.swing.JScrollPane(); dataTable = new javax.swing.JTable(); jButtonAdd = new javax.swing.JButton(); jButtonWaterSave = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); jTableReticData = new javax.swing.JTable(); jButtonAddReticData = new javax.swing.JButton(); jButtonSaveRetic = new javax.swing.JButton(); jPanel6 = new javax.swing.JPanel(); jPanelNitrification = new javax.swing.JPanel(); jPanelChrloramin = new javax.swing.JPanel(); jPanelForecasting = new javax.swing.JPanel(); jPanelRetic = new javax.swing.JPanel(); <API key> = new javax.swing.JPanel(); <API key> = new javax.swing.JPanel(); <API key> = new javax.swing.JLabel(); <API key> = new javax.swing.JPanel(); <API key> = new javax.swing.JPanel(); <API key> = new javax.swing.JLabel(); <API key> = new javax.swing.JPanel(); <API key> = new javax.swing.JPanel(); <API key> = new javax.swing.JLabel(); jPanelReticFull = new javax.swing.JPanel(); <API key> = new javax.swing.JLabel(); <API key> = new javax.swing.JPanel(); jPanelLogo = new javax.swing.JPanel(); jLabelLogo = new javax.swing.JLabel(); jTextField1.setText("jTextField1"); <API key>(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("BRC Tool Demo"); jLabel1.setText("File Path"); jLabel1.setToolTipText("File path lead to xls file"); filePathTextField.setEditable(false); filePathTextField.setToolTipText(""); browserFileButton.setText("Load File"); browserFileButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { <API key>(evt); } }); dataTable.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Date", "TCI_in", "TCLI_out", "Temp", "NH3-N", "NO2-N", "Krt", "Krt20", "Tablet Dosed" } ) { Class[] types = new Class [] { java.lang.Object.class, java.lang.Float.class, java.lang.Float.class, java.lang.Float.class, java.lang.Float.class, java.lang.Float.class, java.lang.Float.class, java.lang.Float.class, java.lang.Boolean.class }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } }); jScrollPane1.setViewportView(dataTable); if (dataTable.getColumnModel().getColumnCount() > 0) { dataTable.getColumnModel().getColumn(0).setMinWidth(100); } jButtonAdd.setText("Add"); jButtonAdd.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { <API key>(evt); } }); jButtonWaterSave.setText("Save"); jButtonWaterSave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { <API key>(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1385, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.<API key>() .addContainerGap(1304, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButtonAdd, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButtonWaterSave, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.<API key>() .addContainerGap() .addComponent(jButtonAdd) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 477, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonWaterSave) .addContainerGap()) ); reticDataEntryTable.addTab("Reservoir Data Entry", jPanel1); jTableReticData.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { "Date", "Total Chlorine", "Temperature", "NH3-N", "NO2-N", "Nitrification Potential Indicator" } ) { Class[] types = new Class [] { java.lang.Object.class, java.lang.Float.class, java.lang.Float.class, java.lang.Float.class, java.lang.Float.class, java.lang.Double.class }; boolean[] canEdit = new boolean [] { true, true, true, true, true, false }; public Class getColumnClass(int columnIndex) { return types [columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit [columnIndex]; } }); jScrollPane2.setViewportView(jTableReticData); if (jTableReticData.getColumnModel().getColumnCount() > 0) { jTableReticData.getColumnModel().getColumn(0).setMinWidth(250); } jButtonAddReticData.setText("Add"); jButtonAddReticData.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { <API key>(evt); } }); jButtonSaveRetic.setText("Save"); jButtonSaveRetic.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { <API key>(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1385, Short.MAX_VALUE) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.<API key>() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButtonAddReticData, javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButtonSaveRetic, javax.swing.GroupLayout.Alignment.TRAILING)) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.<API key>() .addContainerGap() .addComponent(jButtonAddReticData) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 477, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButtonSaveRetic) .addContainerGap()) ); reticDataEntryTable.addTab("Retic Data Entry", jPanel2); jPanel6.setLayout(new java.awt.GridLayout(2, 0)); jPanelNitrification.setLayout(new java.awt.BorderLayout()); jPanel6.add(jPanelNitrification); jPanelChrloramin.setLayout(new java.awt.BorderLayout()); jPanel6.add(jPanelChrloramin); jPanelForecasting.setLayout(new java.awt.BorderLayout()); jPanel6.add(jPanelForecasting); jPanelRetic.setLayout(new java.awt.BorderLayout()); jPanel6.add(jPanelRetic); reticDataEntryTable.addTab("Diagrams", jPanel6); <API key>.setLayout(new java.awt.BorderLayout()); <API key>.setText("jLabel2"); javax.swing.GroupLayout <API key> = new javax.swing.GroupLayout(<API key>); <API key>.setLayout(<API key>); <API key>.setHorizontalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addContainerGap() .addGroup(<API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addComponent(<API key>) .addGap(0, 1328, Short.MAX_VALUE)) .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); <API key>.setVerticalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, <API key>.<API key>() .addContainerGap() .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(<API key>) .addContainerGap()) ); reticDataEntryTable.addTab("Nitrification Potential Indicator", <API key>); <API key>.setLayout(new java.awt.BorderLayout()); <API key>.setText("jLabel2"); javax.swing.GroupLayout <API key> = new javax.swing.GroupLayout(<API key>); <API key>.setLayout(<API key>); <API key>.setHorizontalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addContainerGap() .addGroup(<API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap()) .addGroup(<API key>.<API key>() .addComponent(<API key>) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) ); <API key>.setVerticalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addGap(5, 5, 5) .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(<API key>) .addContainerGap()) ); reticDataEntryTable.addTab("Chloramine Stability", <API key>); <API key>.setLayout(new java.awt.BorderLayout()); <API key>.setText("jLabel3"); javax.swing.GroupLayout <API key> = new javax.swing.GroupLayout(<API key>); <API key>.setLayout(<API key>); <API key>.setHorizontalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addContainerGap() .addGroup(<API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addComponent(<API key>) .addGap(0, 1328, Short.MAX_VALUE)) .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); <API key>.setVerticalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addContainerGap() .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(<API key>) .addContainerGap()) ); reticDataEntryTable.addTab("Forecasting residual", <API key>); <API key>.setText("jLabel4"); <API key>.setLayout(new java.awt.BorderLayout()); javax.swing.GroupLayout <API key> = new javax.swing.GroupLayout(jPanelReticFull); jPanelReticFull.setLayout(<API key>); <API key>.setHorizontalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addContainerGap() .addGroup(<API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(<API key>.<API key>() .addComponent(<API key>) .addGap(0, 1328, Short.MAX_VALUE)) .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap()) ); <API key>.setVerticalGroup( <API key>.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, <API key>.<API key>() .addContainerGap() .addComponent(<API key>, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(<API key>) .addContainerGap()) ); reticDataEntryTable.addTab("Retic system behaviour", jPanelReticFull); javax.swing.GroupLayout jPanelLogoLayout = new javax.swing.GroupLayout(jPanelLogo); jPanelLogo.setLayout(jPanelLogoLayout); jPanelLogoLayout.setHorizontalGroup( jPanelLogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelLogoLayout.<API key>() .addContainerGap() .addComponent(jLabelLogo, javax.swing.GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE) .addContainerGap()) ); jPanelLogoLayout.setVerticalGroup( jPanelLogoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelLogoLayout.<API key>() .addContainerGap() .addComponent(jLabelLogo, javax.swing.GroupLayout.DEFAULT_SIZE, 71, Short.MAX_VALUE) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.<API key>() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.<API key>() .addContainerGap() .addComponent(reticDataEntryTable)) .addGroup(layout.<API key>() .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(browserFileButton, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel1) .addComponent(filePathTextField)) .addGap(12, 12, 12) .addComponent(jPanelLogo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.<API key>() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.<API key>() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(filePathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(browserFileButton)) .addComponent(jPanelLogo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(reticDataEntryTable) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents private void initLogo() { String pathToImage = "resources/logo.png"; ImageIcon logoIcon = new ImageIcon(getClass().getClassLoader().getResource(pathToImage)); Image scaledIcon; scaledIcon = logoIcon.getImage().getScaledInstance( this.jLabelLogo.getWidth(), this.jLabelLogo.getHeight(), Image.SCALE_SMOOTH); this.jLabelLogo.setIcon(new ImageIcon(scaledIcon)); } private void initTableEditor() { TableColumn dateColumn = this.dataTable.getColumnModel().getColumn(0); DateTimeTableEditor editor = new DateTimeTableEditor(); dateColumn.setCellEditor(editor); dateColumn.setCellRenderer(new DateCellRender()); DefaultTableModel model = (DefaultTableModel)this.dataTable.getModel(); model.<API key>((TableModelEvent e) -> { if (e.getType() == 1){ return; } int row = e.getFirstRow(); int column = e.getColumn(); DefaultTableModel model1 = (DefaultTableModel)e.getSource(); String columnName = model1.getColumnName(column); WaterDetail wd = this.detailArray.get(row); boolean changedData = false; switch(column) { case 0: //Date String tempDate = (String)model1.getValueAt(row, column); //wd.date = parseDateFromString(tempDate, "dd-MM-yyyy HH:mm"); wd.date = parseDateFromString(tempDate, "dd-MM-yyyy"); break; case 1: //Date float val = (float) model1.getValueAt(row, column); if (val != wd.tciIn) { changedData = true; } wd.tciIn = val; break; case 2: //Date float tciOutVal = (float) model1.getValueAt(row, column); if (tciOutVal != wd.tciOut) { changedData = true; } wd.tciOut = tciOutVal; break; case 3: //Date float temperatureVal = (float) model1.getValueAt(row, column); if (temperatureVal != wd.temperature) { changedData = true; } wd.temperature = temperatureVal; break; case 4: //NH3 float nh3Val = (float) model1.getValueAt(row, column); if (nh3Val != wd.nh3) { changedData = true; } wd.nh3 = nh3Val; break; case 5: //NO2 float no2Val = (float) model1.getValueAt(row, column); if (no2Val != wd.no2) { changedData = true; } wd.no2 = no2Val; break; case 6: //Krt float krtVal = (float) model1.getValueAt(row, column); if (krtVal != wd.krt) { changedData = true; } wd.krt = krtVal; break; case 7: //krt20 float krt20Val = (float) model1.getValueAt(row, column); if (krt20Val != wd.krt20) { changedData = true; } wd.krt20 = krt20Val; break; case 8: //dosed boolean dosedVal = (boolean) model1.getValueAt(row, column); if (dosedVal != wd.dosed) { changedData = true; } wd.dosed = dosedVal; break; default: break; } if(column != -1) { wd.calculateValue(); this.detailArray.set(row, wd); if (row == this.detailArray.size() - 1) { this.<API key>(wd); this.<API key>(wd); } } if (changedData) { this.resetChart(); } }); TableColumn dateRedicColumn = this.jTableReticData.getColumnModel().getColumn(0); dateRedicColumn.setCellEditor(new DateTimeTableEditor()); dateRedicColumn.setCellRenderer(new DateCellRender()); DefaultTableModel redicModel = (DefaultTableModel)this.jTableReticData.getModel(); redicModel.<API key>((TableModelEvent e) -> { if (e.getType() == 1){ return; } int row = e.getFirstRow(); int column = e.getColumn(); DefaultTableModel model1 = (DefaultTableModel)e.getSource(); String columnName = model1.getColumnName(column); ReticEntry re = this.reticEntryArray.get(row); boolean changedData = false; switch(column) { case 0: //Date String tempDate = (String)model1.getValueAt(row, column); //re.date = parseDateFromString(tempDate, "dd-MM-yyyy HH:mm"); re.date = parseDateFromString(tempDate, "dd-MM-yyyy"); break; case 1: //Date float totalChlorine = (float) model1.getValueAt(row, column); if (re.totalChlorine != totalChlorine) { changedData = true; } re.totalChlorine = totalChlorine; break; case 2: //Date float temperature = (float) model1.getValueAt(row, column); if (re.temperature != temperature) { changedData = true; } re.temperature = temperature; break; case 3: //nh3 float nh3 = (float) model1.getValueAt(row, column); if (re.nh3 != nh3) { changedData = true; } re.nh3 = nh3; break; case 4: //NO2 float no2 = (float) model1.getValueAt(row, column); if (re.no2 != no2) { changedData = true; } re.no2 = no2; break; } if(column != -1){ re.calculateValue(); this.reticEntryArray.set(row, re); if (row == this.reticEntryArray.size() - 1) { this.setReticWarningText(re); } } if(changedData){ this.resetReticChart(); } }); } private void resetChart() { WaterDetail[] arr = new WaterDetail[this.detailArray.size()]; this.detailArray.toArray(arr); <API key>(arr); <API key>(arr); <API key>(arr); } private void resetReticChart() { ReticEntry[] arr = new ReticEntry[this.reticEntryArray.size()]; this.reticEntryArray.toArray(arr); generateReticChart(arr); } private void initWarningLabels() { <API key>.setText(""); <API key>.setText(""); <API key>.setText(""); <API key>.setText(""); } private void setDataToTable(WaterDetail[] data) { DefaultTableModel model = (DefaultTableModel) this.dataTable.getModel(); if (model.getRowCount() > 0) { for (int i = 0; i < model.getRowCount(); i++) { model.removeRow(i); } } for (WaterDetail dt : data) { model.addRow(new Object[]{ dt.date, dt.tciIn, dt.tciOut, dt.temperature, dt.nh3, dt.no2, dt.krt, dt.krt20, dt.dosed, false }); } } private Date parseDateFromString(String dateStr, String format) { String startDateString = dateStr; // This object can interpret strings representing dates in the format MM/dd/yyyy DateFormat df = new SimpleDateFormat(format); try { return df.parse(startDateString); } catch (ParseException ex) { return new Date(); } } private void setDataToReticTable(ReticEntry[] data) { DefaultTableModel model = (DefaultTableModel) this.jTableReticData.getModel(); if (model.getRowCount() > 0) { for (int i = 0; i < model.getRowCount(); i++) { model.removeRow(i); } } for (ReticEntry dt : data) { model.addRow(new Object[]{ dt.date, dt.totalChlorine, dt.temperature, dt.nh3, dt.no2, dt.<API key> }); } } private void generateReticChart(ReticEntry[] data) { // Show it JPanel chartView = ChartCreator.generateReticChart(data); this.jPanelRetic.removeAll(); this.jPanelRetic.add(chartView, BorderLayout.CENTER); this.jPanelRetic.validate(); JPanel chartViewFull = ChartCreator.generateReticChart(data); this.<API key>.removeAll(); this.<API key>.add(chartViewFull, BorderLayout.CENTER); this.<API key>.validate(); if (data.length > 0){ this.setReticWarningText(data[data.length - 1]); } else { this.setReticWarningText(null); } } private void setReticWarningText(ReticEntry lastRecord) { boolean isWarning = false; if (lastRecord != null) { double val = lastRecord.<API key>; if(val >= 0.2 && val <= 0.4) { isWarning = true; } else { isWarning = false; } } else { isWarning = true; } if(isWarning){ this.<API key>.setText("Interfere at the reservoir : 0.2 <= value <= 0.4"); this.<API key>.setForeground(Color.red); } else { this.<API key>.setText("Safe - Operate without interference \n" + "at the reservoir."); this.<API key>.setForeground(Color.blue); } } private void <API key>(WaterDetail[] data) { // Show it JPanel chartView = ChartCreator.<API key>(data); this.jPanelForecasting.removeAll(); this.jPanelForecasting.add(chartView, BorderLayout.CENTER); this.jPanelForecasting.validate(); JPanel chartViewFull = ChartCreator.<API key>(data); this.<API key>.removeAll(); this.<API key>.add(chartViewFull, BorderLayout.CENTER); this.<API key>.validate(); } private void <API key>(WaterDetail[] data) { // Show it JPanel chartView = ChartCreator.<API key>(data); JPanel chartViewFull = ChartCreator.<API key>(data); this.jPanelChrloramin.removeAll(); this.jPanelChrloramin.add(chartView, BorderLayout.CENTER); this.jPanelChrloramin.validate(); this.<API key>.removeAll(); this.<API key>.add(chartViewFull, BorderLayout.CENTER); this.<API key>.validate(); if (data.length > 0){ this.<API key>(data[data.length - 1]); } else { this.<API key>(null); } } private void <API key>(WaterDetail lastData) { boolean isWarning = false; if (lastData != null) { double val = lastData.krt20; if(val >= 0.2 && val <= 0.4) { isWarning = true; } else { isWarning = false; } } else { isWarning = true; } if (isWarning){ this.<API key>.setText("If dosed, dosign is not effective and\n" + "break point chlorination is occuring!!\n" + "If not dosed, chloramine within reservoir is decaying faster than it should!! :0.2 <= value <= 0.4"); this.<API key>.setForeground(Color.red); } else { this.<API key>.setText("Reservoir is doing well \n" + "or Dosing is effective!!"); this.<API key>.setForeground(Color.blue); } } private void <API key>(WaterDetail[] data) { // Create Chart JPanel chartView = ChartCreator.<API key>(data); JPanel chartViewFull = ChartCreator.<API key>(data); this.jPanelNitrification.removeAll(); this.jPanelNitrification.add(chartView, BorderLayout.CENTER); this.jPanelNitrification.validate(); this.<API key>.removeAll(); this.<API key>.add(chartViewFull, BorderLayout.CENTER); this.<API key>.validate(); if (data.length > 0){ this.<API key>(data[data.length - 1]); } else { this.<API key>(null); } } private void <API key>(WaterDetail lastRecord) { boolean isWarning = false; if (lastRecord != null) { double val = lastRecord.tclBRC; if (val >= 0.2 && val <= 0.4) { isWarning = true; } else { isWarning = false; } } else { isWarning = true; } if (isWarning){ this.<API key>.setText("Interfere : 0.2 <= value <= 0.4"); this.<API key>.setForeground(Color.red); } else { this.<API key>.setText("Safe - Operate without interference"); this.<API key>.setForeground(Color.blue); } } private String currDirectoryPath; private String currFileName; private ArrayList<WaterDetail> detailArray = new ArrayList<>(); private ArrayList<ReticEntry> reticEntryArray = new ArrayList<>(); private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key> // TODO add your handling code here: JFileChooser fileChooser = new JFileChooser(currDirectoryPath); <API key> filter = new <API key>( "XLSX Files", "xlsx", "xls"); fileChooser.setFileFilter(filter); int returnVal = fileChooser.showOpenDialog(MainJFrame.this); if (returnVal == JFileChooser.APPROVE_OPTION) { File file = fileChooser.getSelectedFile(); this.currDirectoryPath = file.getParent(); this.filePathTextField.setText(file.getAbsolutePath()); this.currFileName = file.getAbsolutePath(); // Load file WaterDetail[] data = XlsReader.readWaterInfo(currFileName, 3, 0); ReticEntry[] reticData = XlsReader.readReticInfo(currFileName, 3, 0); this.detailArray = new ArrayList<>(Arrays.asList(data)); this.reticEntryArray = new ArrayList<>(Arrays.asList(reticData)); setDataToTable(data); setDataToReticTable(reticData); <API key>(data); <API key>(data); <API key>(data); generateReticChart(reticData); } }//GEN-LAST:<API key> private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key> // TODO add your handling code here: DefaultTableModel model = (DefaultTableModel) this.dataTable.getModel(); if (this.detailArray.size() > 0) { WaterDetail newData = new WaterDetail( new Date(), 0, 0, 0, 0, 0, "" ); this.detailArray.add(newData); Object[] rowData = new Object[]{ newData.date, newData.tciIn, newData.tciOut, newData.temperature, newData.nh3, newData.no2, newData.krt, newData.krt20, newData.dosed, }; model.addRow(rowData); this.dataTable.setModel(model); model.<API key>(); this.dataTable.scrollRectToVisible( this.dataTable.getCellRect( this.dataTable.getRowCount() - 1, 0, true ) ); // <API key>(newArray); // <API key>(newArray); // <API key>(newArray); // generateReticChart(newArray); } }//GEN-LAST:<API key> private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key> // TODO add your handling code here: if(this.reticEntryArray.size() <= 0) { return ; } // TODO add your handling code here: int dialogButton = JOptionPane.YES_NO_OPTION; int dialogResult = JOptionPane.showConfirmDialog (null, "Would You Like to Save your data?","Confirmation",dialogButton); if(dialogResult == JOptionPane.YES_OPTION){ // Saving code here <API key>(this.currFileName, this.reticEntryArray); } }//GEN-LAST:<API key> private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key> // TODO add your handling code here: DefaultTableModel model = (DefaultTableModel) this.jTableReticData.getModel(); if (this.reticEntryArray.size() > 0) { ReticEntry newData = new ReticEntry(new Date(), 0, 0, 0, 0); this.reticEntryArray.add(newData); Object[] rowData = new Object[]{ newData.date, newData.totalChlorine, newData.temperature, newData.nh3, newData.no2, newData.<API key> }; model.addRow(rowData); this.jTableReticData.setModel(model); model.<API key>(); this.jTableReticData.scrollRectToVisible( this.jTableReticData.getCellRect( this.jTableReticData.getRowCount() - 1, 0, true ) ); } }//GEN-LAST:<API key> private void <API key>(java.awt.event.ActionEvent evt) {//GEN-FIRST:<API key> // TODO add your handling code here: if(this.detailArray.size() <= 0) { return ; } int dialogButton = JOptionPane.YES_NO_OPTION; int dialogResult = JOptionPane.showConfirmDialog (null, "Would You Like to Save your data?","Confirmation",dialogButton); if(dialogResult == JOptionPane.YES_OPTION){ // Saving code here XlsWriter.writeWaterData(this.currFileName, this.detailArray, 3, 0); } }//GEN-LAST:<API key> public void <API key>(String fileName, ArrayList<ReticEntry> data) { XlsWriter.writeReticData(fileName, data, 3, 0); } /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.<API key>()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (<API key> ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (<API key> ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (<API key> ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.<API key> ex) { java.util.logging.Logger.getLogger(MainJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new MainJFrame().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton browserFileButton; private javax.swing.JTable dataTable; private javax.swing.JTextField filePathTextField; private javax.swing.JButton jButtonAdd; private javax.swing.JButton jButtonAddReticData; private javax.swing.JButton jButtonSaveRetic; private javax.swing.JButton jButtonWaterSave; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabelLogo; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel6; private javax.swing.JPanel <API key>; private javax.swing.JPanel <API key>; private javax.swing.JLabel <API key>; private javax.swing.JPanel jPanelChrloramin; private javax.swing.JPanel jPanelForecasting; private javax.swing.JPanel <API key>; private javax.swing.JPanel <API key>; private javax.swing.JLabel <API key>; private javax.swing.JPanel jPanelLogo; private javax.swing.JPanel jPanelNitrification; private javax.swing.JPanel <API key>; private javax.swing.JPanel <API key>; private javax.swing.JLabel <API key>; private javax.swing.JPanel jPanelRetic; private javax.swing.JPanel jPanelReticFull; private javax.swing.JPanel <API key>; private javax.swing.JLabel <API key>; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTable jTableReticData; private javax.swing.JTextField jTextField1; private javax.swing.JTabbedPane reticDataEntryTable; // End of variables declaration//GEN-END:variables }
<h2>{{forecast.name}}</h2> <div class="row"> <div class="col-xs-2"> <img ng-src="{{forecast.iconUrl}}"> </div> <div class="col-xs-8 lead"> <strong>{{forecast.temp| number:1}} &deg;C</strong><br> <span style="text-transform: capitalize;">{{forecast.main}}</span><br> <small> {{forecast.description}} &bull; {{forecast.humidity}}% of humidity </small> </div> </div>
package com.orcs.boomshakalaka.ui.expanablelistview; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.AdapterView; import android.widget.ListAdapter; import com.orcs.boomshakalaka.R; /** * A more specific expandable listview in which the expandable area * consist of some buttons which are context actions for the item itself. * * It handles event binding for those buttons and allow for adding * a listener that will be invoked if one of those buttons are pressed. * * @author tjerk * @date 6/26/12 7:01 PM */ public class <API key> extends <API key> implements OnScrollListener { private <API key> listener; private int[] buttonIds = null; private View footView; Context context; int totalCount; int last; boolean isLoading=false; public <API key>(Context context) { super(context); this.context=context; } public <API key>(Context context, AttributeSet attrs) { super(context, attrs); this.context=context; } public <API key>(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); this.context=context; } public void <API key>(<API key> listener, int ... buttonIds) { this.listener = listener; this.buttonIds = buttonIds; } public void initView(){ LayoutInflater inflater= LayoutInflater.from(context); footView= inflater.inflate(R.layout.foot_layout, null); // footView.findViewById(R.id.foot_layout).setVisibility(View.GONE); this.addFooterView(footView); this.setOnScrollListener(this); } public void remoView(){ if(footView!=null){ this.removeFooterView(footView); } } @Override public void onScroll(AbsListView arg0, int arg1, int arg2, int arg3) { this.last=arg1+arg2; this.totalCount=arg3; } @Override public void <API key>(AbsListView arg0, int arg1) { if(totalCount==last&&arg1==SCROLL_STATE_IDLE){ if(!isLoading){ if(footView!=null) { isLoading=true; footView.findViewById(R.id.foot_layout).setVisibility(View.VISIBLE); iLoadListener.onLoad(); <API key>(null); } } } } ILoadListener iLoadListener; public void setLoadListener( ILoadListener iLoadListener){ this.iLoadListener=iLoadListener; } public interface ILoadListener{ public void onLoad(); } public void loadComplete(){ isLoading=false; if(footView!=null){ footView.setVisibility(View.GONE); } // footView.findViewById(R.id.foot_layout).setVisibility(View.GONE); this.setOnScrollListener(this); <API key>(listener2); } AdapterView.OnItemClickListener listener2=null; @Override public void <API key>(AdapterView.OnItemClickListener listener) { super.<API key>(listener); if(listener!=null) { this.listener2 = listener; } } /** * Interface for callback to be invoked whenever an action is clicked in * the expandle area of the list item. */ public interface <API key> { /** * Called when an action item is clicked. * * @param itemView the view of the list item * @param clickedView the view clicked * @param position the position in the listview */ public void onClick(View itemView, View clickedView, int position); } public void setAdapter(ListAdapter adapter) { super.setAdapter(new <API key>(adapter) { @Override public View getView(final int position, View view, ViewGroup viewGroup) { final View listView = wrapped.getView(position, view, viewGroup); // add the action listeners if(buttonIds != null && listView!=null) { for(int id : buttonIds) { View buttonView = listView.findViewById(id); if(buttonView!=null) { buttonView.findViewById(id).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(listener!=null) { listener.onClick(listView, view, position); } } }); } } } return listView; } }); } // @Override // protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { // int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, // MeasureSpec.AT_MOST); // super.onMeasure(widthMeasureSpec, expandSpec); }
package ru.abelov.start; import ru.abelov.models.Comment; import ru.abelov.models.Filter; import ru.abelov.models.Task; import java.util.ArrayList; /** * Class EditTask. * Realizes tracker task edition. */ class EditTask extends BaseAction { /** * Constructor. * @param name of action. */ EditTask(String name) { super(name); } public int key() { return 2; } public void execute (Input input, Tracker tracker) { String id = input.ask("Please, enter the task ID: "); String name = input.ask("Please, enter the task name: "); String description = input.ask("Please, enter the task description: "); Task task = new Task(name, description); tracker.edit(id, task); } } /** * Class MenuTracker. * Realizes communication with user of tracker app. */ class MenuTracker { /** * Input object. */ private Input input; /** * Tracker object. */ private Tracker tracker; /** * User possible actions. */ private UserAction[] actions = new UserAction[7]; /** * Flag of program exit. */ private boolean isExit = true; /** * Starting position of actions before adding any of them. */ private int position = 0; /** * Constructor. * @param input object. * @param tracker object of app. */ MenuTracker(Input input, Tracker tracker) { this.input = input; this.tracker = tracker; } /** * Fills array of user possible actions. */ void fillAction() { addAction(new AddTask("Add task")); addAction(new EditTask("Edit task")); addAction(new RemoveTask("Remove task")); addAction(new MenuTracker.ShowTasks("Show all tasks")); addAction(new ShowFilteredTasks("Show filtered tasks")); addAction(new AddComment("Add a comment to task")); addAction(new Exit("Exit")); } /** * Adds user possible action to actions. * @param action to add. */ void addAction(UserAction action) { this.actions[position++] = action; } /** * Selects action. * @param key number of action. */ void select(int key) { this.actions[key-1].execute(this.input, this.tracker); } /** * Show possible actions to user. */ void show() { for (UserAction action : this.actions) { if (action != null) { System.out.println(action.info()); } } } /** * Turns on app working flag. */ void programTurnOn() { this.isExit = false; } /** * Turns on app working flag. */ void programTurnOff() { this.isExit = true; } /** * @return app working flag. */ boolean getIsExit() { return this.isExit; } /** * @return amount of possible user actions. */ int getMenuSize() { return this.actions.length; } /** * Inner class AddTask. * Realizes adding task to tracker. */ private class AddTask extends BaseAction { /** * Constructor. * @param name of action. */ AddTask(String name) { super(name); } public int key() { return 1; } public void execute (Input input, Tracker tracker) { String name = input.ask("Please, enter the task name: "); String description = input.ask("Please, enter the task description: "); tracker.add(new Task(name, description)); } } /** * Inner static class ShowTasks. * Displays all tasks to user. */ private static class ShowTasks extends BaseAction { /** * Constructor. * @param name of action. */ ShowTasks(String name) { super(name); } public int key() { return 4; } public void execute (Input input, Tracker tracker) { for (Task task : tracker.getAll()) { System.out.println(String.format("Task ID:\t\t%s\nTask created:\t\t%s\nTask name:\t\t%s\nTask description:\t%s\n", task.getId(), task.getDateCreation(task.getCreate()), task.getName(), task.getDescription())); if (task.getComments().size() > 0){ ArrayList<Comment> comments = task.getComments(); System.out.println("Comments:"); for(Comment comment:comments){ System.out.println(String.format("%s\t%s", comment.getDateCreation(comment.getCreate()), comment.getDescription())); } } System.out.println(" } } } /** * Inner static class ShowFilteredTasks. * Displays filtered tasks to user. */ private static class ShowFilteredTasks extends BaseAction { /** * Constructor. * @param name of action. */ ShowFilteredTasks(String name) { super(name); } public int key() { return 5; } public void execute (Input input, Tracker tracker) { Filter filter = new Filter(input.ask("Please, enter filter symbols, word or phrase: ")); for (Task task : tracker.getAllFiltered(filter)) { if (tracker.getAllFiltered(filter).size() >= 1 && !tracker.getAllFiltered(filter).get(0).getName().equals("no search results")){ System.out.println(String.format("Task ID:\t\t%s\nTask created:\t\t%s\nTask name:\t\t%s\nTask description:\t%s\n", task.getId(), task.getDateCreation(task.getCreate()), task.getName(), task.getDescription())); if (task.getComments().size() > 0){ ArrayList<Comment> comments = task.getComments(); System.out.println("Comments:"); for(Comment comment:comments){ System.out.println(String.format("%s\t%s", comment.getDateCreation(comment.getCreate()), comment.getDescription())); } } System.out.println(" } else { System.out.println("no search results"); } } } } /** * Inner class RemoveTask. * Realizes removing tasks from tracker. */ private class RemoveTask extends BaseAction { /** * Constructor. * @param name of action. */ RemoveTask(String name) { super(name); } public int key() { return 3; } public void execute (Input input, Tracker tracker) { String id = input.ask("Please, enter the task ID you want to remove: "); tracker.remove(id); } } /** * Inner class AddComment. * Realizes adding comment to task. */ private class AddComment extends BaseAction { /** * Constructor. * @param name of action. */ AddComment(String name) { super(name); } public int key() { return 6; } public void execute (Input input, Tracker tracker) { String id = input.ask("Please, enter the task ID you want to comment: "); Comment comment = new Comment(input.ask("Please, enter a comment you want to add: ")); tracker.addComment(id, comment); } } /** * Inner class Exit. * Realizes exit from app. */ private class Exit extends BaseAction { /** * Constructor. * @param name of action. */ Exit(String name) { super(name); } public int key() { return 7; } public void execute (Input input, Tracker tracker) { String id = input.ask("Want to exit? (y): "); if (id.equals("y")){ programTurnOff(); } } } }
package com.guojianyiliao.eryitianshi.MyUtils.bean; public class test { /** * gender : * name : * <API key> * phone : 18310904818 * role : 1 * userid : <API key> */ private String gender; private String name; private String password; private String phone; private String role; private String userid; public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getRole() { return role; } public void setRole(String role) { this.role = role; } public String getUserid() { return userid; } public void setUserid(String userid) { this.userid = userid; } }
# lolrecap webApplication for the Riot API contest.
<!DOCTYPE HTML PUBLIC "- <HTML> <HEAD> <meta name="generator" content="JDiff v1.0.9"> <!-- Generated by the JDiff Javadoc doclet --> <meta name="description" content="JDiff is a Javadoc doclet which generates an HTML report of all the packages, classes, constructors, methods, and fields which have been removed, added or changed in any way, including their documentation, when two APIs are compared."> <meta name="keywords" content="diff, jdiff, javadiff, java diff, java difference, API difference, difference between two APIs, API diff, Javadoc, doclet"> <TITLE> org.apache.hadoop.fs.FileSystem.Statistics </TITLE> <LINK REL="stylesheet" TYPE="text/css" HREF="../stylesheet-jdiff.css" TITLE="Style"> </HEAD> <BODY> <!-- Start of nav bar --> <TABLE summary="Navigation bar" BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <TABLE summary="Navigation bar" BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../api/org/apache/hadoop/fs/FileSystem.Statistics.html" target="_top"><FONT CLASS="NavBarFont1"><B><tt>hadoop 0.20.1</tt></B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="changes-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="pkg_org.apache.hadoop.fs.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_statistics.html"><FONT CLASS="NavBarFont1"><B>Statistics</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_help.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Generated by<br><a href="http: </TR> <TR> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="org.apache.hadoop.fs.FileSystem.html"><B>PREV CLASS</B></A> &nbsp;<A HREF="org.apache.hadoop.fs.FilterFileSystem.html"><B>NEXT CLASS</B></A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="../changes.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="org.apache.hadoop.fs.FileSystem.Statistics.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: &nbsp; <a href="#constructors">CONSTRUCTORS</a>&nbsp;|&nbsp; <a href="#methods">METHODS</a>&nbsp;|&nbsp; FIELDS </FONT></TD> </TR> </TABLE> <HR> <!-- End of nav bar --> <H2> Class org.apache.hadoop.fs.<A HREF="../../api/org/apache/hadoop/fs/FileSystem.Statistics.html" target="_top"><tt>FileSystem.Statistics</tt></A> </H2> <a NAME="constructors"></a> <p> <a NAME="Changed"></a> <TABLE summary="Changed Constructors" BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD VALIGN="TOP" COLSPAN=3><FONT SIZE="+1"><B>Changed Constructors</B></FONT></TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="org.apache.hadoop.fs.FileSystem.Statistics.ctor_changed(java.lang.String)"></A> <nobr><A HREF="../../api/org/apache/hadoop/fs/FileSystem.Statistics.html#FileSystem.Statistics(java.lang.String)" target="_top"><tt>FileSystem.Statistics</tt></A>(<code>String</code>) </nobr> </TD> <TD VALIGN="TOP" WIDTH="30%"> Change in type from <code>void</code> to <code>String</code>.<br> </TD> <TD>&nbsp;</TD> </TR> </TABLE> &nbsp; <a NAME="methods"></a> <p> <a NAME="Added"></a> <TABLE summary="Added Methods" BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD VALIGN="TOP" COLSPAN=2><FONT SIZE="+1"><B>Added Methods</B></FONT></TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="org.apache.hadoop.fs.FileSystem.Statistics.getScheme_added()"></A> <nobr><code>String</code>&nbsp;<A HREF="../../api/org/apache/hadoop/fs/FileSystem.Statistics.html#getScheme()" target="_top"><tt>getScheme</tt></A>()</nobr> </TD> <TD VALIGN="TOP">Get the uri scheme associated with this statistics object.</TD> </TR> <TR BGCOLOR="#FFFFFF" CLASS="TableRowColor"> <TD VALIGN="TOP" WIDTH="25%"> <A NAME="org.apache.hadoop.fs.FileSystem.Statistics.reset_added()"></A> <nobr><code>void</code>&nbsp;<A HREF="../../api/org/apache/hadoop/fs/FileSystem.Statistics.html#reset()" target="_top"><tt>reset</tt></A>()</nobr> </TD> <TD VALIGN="TOP">Reset the counts of bytes to 0.</TD> </TR> </TABLE> &nbsp; <a NAME="fields"></a> <HR> <!-- Start of nav bar --> <TABLE summary="Navigation bar" BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <TABLE summary="Navigation bar" BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../api/org/apache/hadoop/fs/FileSystem.Statistics.html" target="_top"><FONT CLASS="NavBarFont1"><B><tt>hadoop 0.20.1</tt></B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="changes-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="pkg_org.apache.hadoop.fs.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_statistics.html"><FONT CLASS="NavBarFont1"><B>Statistics</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="jdiff_help.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3></TD> </TR> <TR> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="org.apache.hadoop.fs.FileSystem.html"><B>PREV CLASS</B></A> &nbsp;<A HREF="org.apache.hadoop.fs.FilterFileSystem.html"><B>NEXT CLASS</B></A> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A HREF="../changes.html" TARGET="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="org.apache.hadoop.fs.FileSystem.Statistics.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD> <TD BGCOLOR="0xFFFFFF" CLASS="NavBarCell3"></TD> </TR> </TABLE> <HR> <!-- End of nav bar --> </BODY> </HTML>
<!DOCTYPE html PUBLIC "- <html xmlns="http: <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.3.1"/> <title>Ilwis-Objects: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="ilwisobjectsgeneral.PNG"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">Ilwis-Objects &#160;<span id="projectnumber">1.0</span> </div> <div id="projectbrief">GIS and Remote Sensing framework for data access and processing</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.3.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="<API key>"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">TableInterface Member List</div> </div> </div><!--header <div class="contents"> <p>This is the complete list of members for <a class="el" href="<API key>.html">TableInterface</a>, including all inherited members.</p> <table class="directory"> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>column</b>(const QString &amp;nme) const =0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>column</b>(quint32 index) const =0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>columns</b>() const =0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>createTable</b>(const QVector&lt; Column &gt; &amp;cols)=0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>record</b>(quint32 row)=0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>record</b>(quint32 row, const Record &amp;rec)=0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>rows</b>() const =0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>value</b>(quint32 row, quint32 col) const =0 (defined in <a class="el" href="<API key>.html">TableInterface</a>)</td><td class="entry"><a class="el" href="<API key>.html">TableInterface</a></td><td class="entry"><span class="mlabel">pure virtual</span></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Fri Mar 28 2014 13:51:04 for Ilwis-Objects by & <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.3.1 </small></address> </body> </html>
package se.l4.dust; /** * Set of usable properties and methods that are common throughout applications * using Dust. * * @author Andreas Holstenson * */ public class Dust { /** * Standard content type for HTML pages, charset encoding is set to UTF-8. */ public static final String HTML = "text/html; charset=UTF-8"; /** * Parameter flag for defining if production mode should be used. This * should be set in the {@code web.xml} of the application to {@code true} * before deployment. */ public static final String DUST_PRODUCTION = "production"; /** * The common namespace where internal components reside. */ public static final String NAMESPACE_COMMON = "dust:common"; /** * The parameter namespace used to define parameters. */ public static final String <API key> = "dust:parameters"; /** * The parameter namespace used to define setters. Setters are a way to * set values via the template. */ public static final String NAMESPACE_SETTERS = "dust:setters"; /** * Namespace for fragments. */ public static final String NAMESPACE_FRAGMENTS = "dust:fragments"; /** * URI of context namespace, used to refer to files in the webapp context. */ public static final String NAMESPACE_CONTEXT = "dust:context"; private Dust() { } }
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>About - Project Rainfall</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="css/bootstrap.min.css"> <style> body { padding-top: 50px; padding-bottom: 20px; } </style> <link rel="stylesheet" href="css/bootstrap-theme.min.css"> <link rel="stylesheet" href="https://raw.github.com/mozilla/browserid-cookbook/master/php/css/persona-buttons.css"> <link rel="stylesheet" href="css/main.css"> <script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script> <script src="https://login.persona.org/include.js"></script> <script src="js/main.js"></script> </head> <body> <!--[if lt IE 7]> <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http: <![endif] <div class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.php"><img src="logo.png" height="20" width="20" alt="Project Rainfall" title="Project Rainfall" /></a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="index.php">Home</a></li> <li class="active"><a href="about.php">About</a></li> <li><a href="mailto:zebmccorkle@gmail.com">Contact</a></li> <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions <b class="caret"></b></a> <ul class="dropdown-menu"> <li id="login" style="background-color: orange;"><a href="#">Login</a></li> <li id="logout"><a href="#">Log out</a></li> <li class="divider"></li> <li class="dropdown-header">Cloud Management</li> <li><a href="#">Create Cloud</a></li> <li><a href="#">Manage Clouds</a></li> </ul> </li> </ul> </div> </div> </div> <div class="container"> <br /> <span class="lead font-myriadapple">Project Rainfall.</span> Zeb McCorkle thought up a consumer virtualization network in the Fall of 2013. He kept the idea in his mind until March 13, 2014, when the website development started.<hr /> The basic idea is (Rain) Clouds on (Rain) Storms, hence the tagline "<span class="font-roboto-thin">Taking virtual private machines by Storm.</span>" A Cloud is a virtual machine, and a Storm is the physical machine that hosts many Clouds. Creating a Cloud is as simple as paying <i>once</i> for the Cloud then paying a monthly power fee based off the CPU usage of your Cloud. Upgrading your Cloud is as simple as shutting down and buying new "parts" on the web interface.<hr> <h2>About the Team</h2> <div class="row"> <div class="col-sm-6 col-md-4"> <div class="thumbnail"> <img src="img/zebmccorkle.png" alt="..."> <div class="caption"> <h3>Zeb McCorkle</h3> <p>Web frontend and StormOS dev</p> <p>Founder of the project and Creative Studios</p> <p><a class="twitter-timeline" href="https://twitter.com/capecodders" data-widget-id="444279956827160576">Tweets by @capecodders</a><script>!function(d,s,id){var js,fjs=d.<API key>(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></p> </div> </div> </div> </div> <hr> <footer> <p>&copy; 2014 Creative Studios</p> </footer> </div> <!-- /container --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.10.1.js"><\/script>')</script> <script src="js/vendor/bootstrap.min.js"></script> <script src="js/plugins.js"></script> <script src="js/main.js"></script> <script> var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview']]; (function(d,t){var g=d.createElement(t),s=d.<API key>(t)[0]; g.src=' s.parentNode.insertBefore(g,s)}(document,'script')); </script> </body> </html>
<div class="col-lg-6 col-md-6"> <div class="panel panel-{{colour}}"> <div class="panel-heading"> <div class="row"> <div class="col-xs-3"> <i class="fa fa-{{type}} fa-5x"></i> </div> <div class="col-xs-9 text-right"> <div class="huge">{{number}}</div> <div>{{comments}}</div> </div> </div> </div> <a ui-sref="{{goto}}"> <div class="panel-footer"> <span class="pull-left">View Details</span> <span class="pull-right"><i class="fa <API key>"></i></span> <div class="clearfix"></div> </div> </a> </div> </div>
// Python Tools for Visual Studio // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS // OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY // IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABILITY OR NON-INFRINGEMENT. using System; using System.IO; using System.Linq; using System.Windows.Input; using EnvDTE; using EnvDTE80; using Microsoft.PythonTools.Infrastructure; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudioTools.Project.Automation; using TestUtilities; using TestUtilities.UI; using Mouse = TestUtilities.UI.Mouse; using Path = System.IO.Path; namespace PythonToolsUITests { public class ProjectHomeTests { public void <API key>(VisualStudioApp app) { string fullPath = TestData.GetPath(@"TestData\ProjectHomeProjects.sln"); app.OpenProject(@"TestData\ProjectHomeProjects.sln", expectedProjects: 9); foreach (var project in app.Dte.Solution.Projects.OfType<Project>()) { var name = Path.GetFileName(project.FileName); if (name.StartsWith("ProjectA")) { // Should have ProgramA.py, Subfolder\ProgramB.py and Subfolder\Subsubfolder\ProgramC.py var programA = project.ProjectItems.Item("ProgramA.py"); Assert.IsNotNull(programA); var subfolder = project.ProjectItems.Item("Subfolder"); var programB = subfolder.ProjectItems.Item("ProgramB.py"); Assert.IsNotNull(programB); var subsubfolder = subfolder.ProjectItems.Item("Subsubfolder"); var programC = subsubfolder.ProjectItems.Item("ProgramC.py"); Assert.IsNotNull(programC); } else if (name.StartsWith("ProjectB")) { // Should have ProgramB.py and Subsubfolder\ProgramC.py var programB = project.ProjectItems.Item("ProgramB.py"); Assert.IsNotNull(programB); var subsubfolder = project.ProjectItems.Item("Subsubfolder"); var programC = subsubfolder.ProjectItems.Item("ProgramC.py"); Assert.IsNotNull(programC); } else if (name.StartsWith("ProjectSln")) { // Should have ProjectHomeProjects\ProgramA.py, // ProjectHomeProjects\Subfolder\ProgramB.py and // ProjectHomeProjects\Subfolder\Subsubfolder\ProgramC.py var projectHome = project.ProjectItems.Item("ProjectHomeProjects"); var programA = projectHome.ProjectItems.Item("ProgramA.py"); Assert.IsNotNull(programA); var subfolder = projectHome.ProjectItems.Item("Subfolder"); var programB = subfolder.ProjectItems.Item("ProgramB.py"); Assert.IsNotNull(programB); var subsubfolder = subfolder.ProjectItems.Item("Subsubfolder"); var programC = subsubfolder.ProjectItems.Item("ProgramC.py"); Assert.IsNotNull(programC); } else { Assert.Fail("Wrong project file name", name); } } } public void AddDeleteItem(VisualStudioApp app) { var sln = app.CopyProjectForTest(@"TestData\<API key>.sln"); var slnDir = PathUtils.GetParent(sln); var project = app.OpenProject(sln); Assert.AreEqual("ProjectSingle.pyproj", Path.GetFileName(project.FileName)); project.ProjectItems.AddFromTemplate(((Solution2)app.Dte.Solution).<API key>("PyClass.zip", "pyproj"), "TemplateItem.py"); var newItem = project.ProjectItems.Item("TemplateItem.py"); Assert.IsNotNull(newItem); Assert.AreEqual(false, project.Saved); project.Save(); Assert.AreEqual(true, project.Saved); Assert.IsTrue(File.Exists(Path.Combine(slnDir, "ProjectHomeProjects", "TemplateItem.py"))); newItem.Delete(); Assert.AreEqual(false, project.Saved); project.Save(); Assert.AreEqual(true, project.Saved); Assert.IsFalse(File.Exists(Path.Combine(slnDir, "ProjectHomeProjects", "TemplateItem.py"))); } public void AddDeleteItem2(VisualStudioApp app) { var sln = app.CopyProjectForTest(@"TestData\<API key>.sln"); var slnDir = PathUtils.GetParent(sln); var project = app.OpenProject(sln); var folder = project.ProjectItems.Item("Subfolder"); Assert.AreEqual("ProjectSingle.pyproj", Path.GetFileName(project.FileName)); folder.ProjectItems.AddFromTemplate(((Solution2)app.Dte.Solution).<API key>("PyClass.zip", "pyproj"), "TemplateItem.py"); var newItem = folder.ProjectItems.Item("TemplateItem.py"); Assert.IsNotNull(newItem); Assert.AreEqual(false, project.Saved); project.Save(); Assert.AreEqual(true, project.Saved); Assert.IsTrue(File.Exists(Path.Combine(slnDir, "ProjectHomeProjects", "Subfolder", "TemplateItem.py"))); newItem.Delete(); Assert.AreEqual(false, project.Saved); project.Save(); Assert.AreEqual(true, project.Saved); Assert.IsFalse(File.Exists(Path.Combine(slnDir, "ProjectHomeProjects", "Subfolder", "TemplateItem.py"))); } public void AddDeleteFolder(VisualStudioApp app) { var project = app.OpenProject(@"TestData\<API key>.sln"); Assert.AreEqual("ProjectSingle.pyproj", Path.GetFileName(project.FileName)); project.ProjectItems.AddFolder("NewFolder"); var newFolder = project.ProjectItems.Item("NewFolder"); Assert.IsNotNull(newFolder); Assert.AreEqual(TestData.GetPath(@"TestData\ProjectHomeProjects\NewFolder\"), newFolder.Properties.Item("FullPath").Value); newFolder.Delete(); } public void AddDeleteSubfolder(VisualStudioApp app) { var project = app.OpenProject(@"TestData\<API key>.sln"); var folder = project.ProjectItems.Item("Subfolder"); Assert.AreEqual("ProjectSingle.pyproj", Path.GetFileName(project.FileName)); folder.ProjectItems.AddFolder("NewFolder"); var newFolder = folder.ProjectItems.Item("NewFolder"); Assert.IsNotNull(newFolder); Assert.AreEqual(TestData.GetPath(@"TestData\ProjectHomeProjects\Subfolder\NewFolder\"), newFolder.Properties.Item("FullPath").Value); newFolder.Delete(); } public void <API key>(VisualStudioApp app) { var sln = app.CopyProjectForTest(@"TestData\HelloWorld.sln"); var slnDir = PathUtils.GetParent(sln); EnvDTE.Project project; try { project = app.OpenProject(sln); project.SaveAs(Path.Combine(slnDir, "ProjectHomeProjects", "TempFile.pyproj")); Assert.AreEqual( PathUtils.TrimEndSeparator(Path.Combine(slnDir, "HelloWorld")), PathUtils.TrimEndSeparator(((OAProject)project).ProjectNode.ProjectHome) ); app.Dte.Solution.SaveAs("HelloWorldRelocated.sln"); } finally { app.Dte.Solution.Close(); GC.Collect(); GC.<API key>(); } project = app.OpenProject(Path.Combine(slnDir, "HelloWorldRelocated.sln")); Assert.AreEqual("TempFile.pyproj", project.FileName); Assert.AreEqual( PathUtils.TrimEndSeparator(Path.Combine(slnDir, "HelloWorld")), PathUtils.TrimEndSeparator(((OAProject)project).ProjectNode.ProjectHome) ); } public void <API key>(VisualStudioApp app) { var sln = app.CopyProjectForTest(@"TestData\<API key>.sln"); var slnDir = PathUtils.GetParent(sln); FileUtils.CopyDirectory(TestData.GetPath("TestData", "<API key>"), Path.Combine(slnDir, "<API key>")); app.OpenProject(sln); app.<API key>(); var window = app.<API key>; var folder = window.FindItem("Solution '<API key>' (1 project)", "DragDropTest", "TestFolder", "SubItem.py"); var point = folder.GetClickablePoint(); Mouse.MoveTo(point); Mouse.Down(MouseButton.Left); var projectItem = window.FindItem("Solution '<API key>' (1 project)", "DragDropTest"); point = projectItem.GetClickablePoint(); Mouse.MoveTo(point); Mouse.Up(MouseButton.Left); using (var dlg = AutomationDialog.WaitForDialog(app)) { dlg.OK(); } Assert.IsNotNull(window.WaitForItem("Solution '<API key>' (1 project)", "DragDropTest", "SubItem.py")); app.Dte.Solution.Close(true); // Ensure file was moved and the path was updated correctly. var project = app.OpenProject(sln); foreach (var item in project.ProjectItems.OfType<OAFileItem>()) { Assert.IsTrue(File.Exists((string)item.Properties.Item("FullPath").Value), (string)item.Properties.Item("FullPath").Value); } } public void <API key>(VisualStudioApp app) { var sln = app.CopyProjectForTest(@"TestData\<API key>.sln"); var slnDir = PathUtils.GetParent(sln); FileUtils.CopyDirectory(TestData.GetPath("TestData", "<API key>"), Path.Combine(slnDir, "<API key>")); app.OpenProject(sln); app.<API key>(); var window = app.<API key>; var folder = window.FindItem("Solution '<API key>' (1 project)", "CutPasteTest", "TestFolder", "SubItem.py"); AutomationWrapper.Select(folder); app.ExecuteCommand("Edit.Cut"); var projectItem = window.FindItem("Solution '<API key>' (1 project)", "CutPasteTest"); AutomationWrapper.Select(projectItem); app.ExecuteCommand("Edit.Paste"); Assert.IsNotNull(window.WaitForItem("Solution '<API key>' (1 project)", "CutPasteTest", "SubItem.py")); app.Dte.Solution.Close(true); // Ensure file was moved and the path was updated correctly. var project = app.OpenProject(sln); foreach (var item in project.ProjectItems.OfType<OAFileItem>()) { Assert.IsTrue(File.Exists((string)item.Properties.Item("FullPath").Value), (string)item.Properties.Item("FullPath").Value); } } } }
using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; using System; using System.Collections.Generic; using HETSAPI.Models; namespace HETSAPI.Seeders { public class DistrictSeeder : Seeder<DbAppContext> { private readonly string[] _profileTriggers = { AllProfiles }; public DistrictSeeder(IConfiguration configuration, IHostingEnvironment env, ILoggerFactory loggerFactory) : base(configuration, env, loggerFactory) { } protected override IEnumerable<string> TriggerProfiles => _profileTriggers; protected override void Invoke(DbAppContext context) { UpdateDistricts(context); context.<API key>(); } public override Type InvokeAfter => typeof(RegionSeeder); private void UpdateDistricts(DbAppContext context) { List<District> seeddistricts = GetSeedDistricts(); foreach (District district in seeddistricts) { context.<API key>(district); } AddInitialDistricts(context); } private void AddInitialDistricts(DbAppContext context) { context.<API key>(Configuration["<API key>"]); } private List<District> GetSeedDistricts() { List<District> districts = new List<District>(GetDefaultDistricts()); if (<API key>) districts.AddRange(GetDevDistricts()); if (IsTestEnvironment || <API key>) districts.AddRange(GetTestDistricts()); if (<API key>) districts.AddRange(GetProdDistricts()); return districts; } <summary> Returns a list of districts to be populated in all environments. </summary> private List<District> GetDefaultDistricts() { return new List<District>(); } <summary> Returns a list of districts to be populated in the Development environment. </summary> private List<District> GetDevDistricts() { return new List<District>(); } <summary> Returns a list of districts to be populated in the Test environment. </summary> private List<District> GetTestDistricts() { return new List<District>(); } <summary> Returns a list of districts to be populated in the Production environment. </summary> private List<District> GetProdDistricts() { return new List<District>(); } } }
package by.stqa.pft.addressbook.tests; import by.stqa.pft.addressbook.model.ContactData; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.stream.Collectors; import java.util.stream.Stream; import static org.hamcrest.CoreMatchers.*; import static org.hamcrest.MatcherAssert.*; public class ContactPhoneTests extends TestBase { @BeforeMethod public void ensurePreconditions() { if(app.db().contacts().size() == 0){ app.goTo().homePage(); app.contact().create(app.contact().generate()); } } @Test public void testContactPhones(){ app.goTo().homePage(); ContactData contact = app.contact().all().iterator().next(); ContactData <API key> = app.contact().infoFromEditForm(contact); assertThat(contact.getAllPhones(), equalTo(mergePhones(<API key>))); } private String mergePhones(ContactData contact) { return Stream.of(contact.getHomePhone(), contact.getMobilePhone(), contact.getWorkPhone()) .filter((s)-> ! s.equals("")) .map(ContactPhoneTests::cleaned) .collect(Collectors.joining("\n")); } public static String cleaned(String phone){ return phone.replaceAll("\\s", "").replaceAll("[-()]", ""); } }
package org.adligo.models.core_tests.shared; import org.adligo.models.core.shared.DomainName; import org.adligo.models.core.shared.EMailAddress; import org.adligo.models.core.shared.<API key>; import org.adligo.models.core.shared.<API key>; import org.adligo.models.core.shared.ModelsCoreRegistry; import org.adligo.models.core_tests.shared.assertions.<API key>; import org.adligo.models.core_tests.shared.assertions.<API key>; import org.adligo.tests.ATest; import org.adligo.xml_io_tests.shared.IsXmlIoSerializable; public class EmailAddressTests extends ATest { @Override protected void setUp() throws Exception { // TODO Auto-generated method stub super.setUp(); ModelsCoreRegistry.setup(); } public void <API key>() throws Exception { <API key>.<API key>("", this); EMailAddress a = new EMailAddress("support@adligo.org"); assertEquals("support@adligo.org", a.toString()); assertEquals("support", a.getUserName()); assertEquals(new DomainName("adligo.org"), a.getDomainName()); <API key> x = null; try { new EMailAddress(""); } catch (Exception g) { x = <API key>.isIPE(g, this); } assertIsNotNull(x); assertIsEquals(EMailAddress.EMAIL, x.getMethodName()); assertIsEquals(<API key>.<API key>, x.getMessage()); } public void testSerialization() throws Exception { IsXmlIoSerializable.isXmlIoSerializable(EMailAddress.class); } }
#include <fcntl.h> #include <sys/stat.h> #include <unistd.h> #include <cerrno> #include <string> #include "common/api/os_sys_calls_impl.h" namespace Envoy { namespace Api { SysCallIntResult OsSysCallsImpl::bind(os_fd_t sockfd, const sockaddr* addr, socklen_t addrlen) { const int rc = ::bind(sockfd, addr, addrlen); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::chmod(const std::string& path, mode_t mode) { const int rc = ::chmod(path.c_str(), mode); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::ioctl(os_fd_t sockfd, unsigned long int request, void* argp) { const int rc = ::ioctl(sockfd, request, argp); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::close(os_fd_t fd) { const int rc = ::close(fd); return {rc, rc != -1 ? 0 : errno}; } SysCallSizeResult OsSysCallsImpl::writev(os_fd_t fd, const iovec* iov, int num_iov) { const ssize_t rc = ::writev(fd, iov, num_iov); return {rc, rc != -1 ? 0 : errno}; } SysCallSizeResult OsSysCallsImpl::readv(os_fd_t fd, const iovec* iov, int num_iov) { const ssize_t rc = ::readv(fd, iov, num_iov); return {rc, rc != -1 ? 0 : errno}; } SysCallSizeResult OsSysCallsImpl::recv(os_fd_t socket, void* buffer, size_t length, int flags) { const ssize_t rc = ::recv(socket, buffer, length, flags); return {rc, rc != -1 ? 0 : errno}; } SysCallSizeResult OsSysCallsImpl::recvmsg(os_fd_t sockfd, msghdr* msg, int flags) { const ssize_t rc = ::recvmsg(sockfd, msg, flags); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::recvmmsg(os_fd_t sockfd, struct mmsghdr* msgvec, unsigned int vlen, int flags, struct timespec* timeout) { #if ENVOY_MMSG_MORE const int rc = ::recvmmsg(sockfd, msgvec, vlen, flags, timeout); return {rc, errno}; #else <API key>(sockfd); <API key>(msgvec); <API key>(vlen); <API key>(flags); <API key>(timeout); <API key>; #endif } bool OsSysCallsImpl::supportsMmsg() const { #if ENVOY_MMSG_MORE return true; #else return false; #endif } SysCallIntResult OsSysCallsImpl::ftruncate(int fd, off_t length) { const int rc = ::ftruncate(fd, length); return {rc, rc != -1 ? 0 : errno}; } SysCallPtrResult OsSysCallsImpl::mmap(void* addr, size_t length, int prot, int flags, int fd, off_t offset) { void* rc = ::mmap(addr, length, prot, flags, fd, offset); return {rc, rc != MAP_FAILED ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::stat(const char* pathname, struct stat* buf) { const int rc = ::stat(pathname, buf); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::setsockopt(os_fd_t sockfd, int level, int optname, const void* optval, socklen_t optlen) { const int rc = ::setsockopt(sockfd, level, optname, optval, optlen); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::getsockopt(os_fd_t sockfd, int level, int optname, void* optval, socklen_t* optlen) { const int rc = ::getsockopt(sockfd, level, optname, optval, optlen); return {rc, rc != -1 ? 0 : errno}; } SysCallSocketResult OsSysCallsImpl::socket(int domain, int type, int protocol) { const os_fd_t rc = ::socket(domain, type, protocol); return {rc, SOCKET_VALID(rc) ? 0 : errno}; } SysCallSizeResult OsSysCallsImpl::sendmsg(os_fd_t fd, const msghdr* message, int flags) { const int rc = ::sendmsg(fd, message, flags); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::getsockname(os_fd_t sockfd, sockaddr* addr, socklen_t* addrlen) { const int rc = ::getsockname(sockfd, addr, addrlen); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::gethostname(char* name, size_t length) { const int rc = ::gethostname(name, length); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::getpeername(os_fd_t sockfd, sockaddr* name, socklen_t* namelen) { const int rc = ::getpeername(sockfd, name, namelen); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::setsocketblocking(os_fd_t sockfd, bool blocking) { const int flags = ::fcntl(sockfd, F_GETFL, 0); int rc; if (flags == -1) { return {-1, errno}; } if (blocking) { rc = ::fcntl(sockfd, F_SETFL, flags & ~O_NONBLOCK); } else { rc = ::fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); } return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::connect(os_fd_t sockfd, const sockaddr* addr, socklen_t addrlen) { const int rc = ::connect(sockfd, addr, addrlen); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::shutdown(os_fd_t sockfd, int how) { const int rc = ::shutdown(sockfd, how); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::socketpair(int domain, int type, int protocol, os_fd_t sv[2]) { const int rc = ::socketpair(domain, type, protocol, sv); return {rc, rc != -1 ? 0 : errno}; } SysCallIntResult OsSysCallsImpl::listen(os_fd_t sockfd, int backlog) { const int rc = ::listen(sockfd, backlog); return {rc, rc != -1 ? 0 : errno}; } SysCallSizeResult OsSysCallsImpl::write(os_fd_t sockfd, const void* buffer, size_t length) { const ssize_t rc = ::write(sockfd, buffer, length); return {rc, rc != -1 ? 0 : errno}; } } // namespace Api } // namespace Envoy
using System.Collections.Immutable; using System.Diagnostics; using Microsoft.CodeAnalysis.Symbols; namespace MetaDslx.CodeAnalysis.Binding { <summary> Manages anonymous types created in owning compilation. All requests for anonymous type symbols go via the instance of this class. </summary> internal sealed partial class <API key> : <API key> { internal <API key>(LanguageCompilation compilation) { Debug.Assert(compilation != null); this.Compilation = compilation; } <summary> Current compilation </summary> public LanguageCompilation Compilation { get; } } }
package org.datacite.mds.service.impl; import static org.junit.Assert.*; import java.lang.reflect.Field; import org.apache.commons.codec.digest.DigestUtils; import org.junit.Before; import org.junit.Test; public class <API key> { PasswordEncoderImpl passwordEncoder; final static String SALT = "dummysalt"; final static String RAW_PASS = "test_pass"; @Before public void init() throws SecurityException, <API key>, <API key>, <API key> { passwordEncoder = new PasswordEncoderImpl(); Field saltField = PasswordEncoderImpl.class.getDeclaredField("salt"); saltField.setAccessible(true); saltField.set(passwordEncoder, SALT); } @Test public void <API key>() { String encPass = DigestUtils.sha256Hex(RAW_PASS + "{" + SALT + "}"); assertEquals(encPass, passwordEncoder.encodePassword(RAW_PASS, null)); } @Test public void <API key>() { String encPass1 = passwordEncoder.encodePassword(RAW_PASS, "salt"); String encPass2 = passwordEncoder.encodePassword(RAW_PASS, "another salt"); assertEquals(encPass1, encPass2); } @Test public void isPasswordValid() { String encPass = passwordEncoder.encodePassword(RAW_PASS, "salt"); assertTrue(passwordEncoder.isPasswordValid(encPass, RAW_PASS, "another salt")); assertFalse(passwordEncoder.isPasswordValid(encPass, "wrong" + RAW_PASS, "another salt")); } }
package org.karmaexchange.util; import static com.google.common.base.Preconditions.checkNotNull; import static java.lang.String.format; import java.io.<API key>; import java.net.URI; import java.net.URLEncoder; import java.util.Map; import com.google.common.collect.Multimap; /** * Some basic utilities for manipulating urls. * * @author Jeff Schnitzer * @author Amir Valiani */ public class URLUtil { public static String buildURL(URI base, Multimap<String, String> params) { if (params.isEmpty()) { return base.toString(); } else { return base + "?" + buildQueryString(params); } } /** * Create a query string */ private static String buildQueryString(Multimap<String, String> params) { StringBuilder bld = new StringBuilder(); boolean afterFirst = false; for (Map.Entry<String, String> entry : params.entries()) { if (afterFirst) bld.append("&"); else afterFirst = true; bld.append(urlEncode(entry.getKey())); bld.append("="); checkNotNull(entry.getValue(), format("query parameter[%s] has no value", entry.getKey())); bld.append(urlEncode(entry.getValue())); } return bld.toString(); } /** * An interface to URLEncoder.encode() that isn't inane */ public static String urlEncode(Object value) { try { return URLEncoder.encode(value.toString(), "utf-8"); } catch (<API key> e) { throw new RuntimeException(e); } } }
package com.samsung.chord.samples.apidemo.service; import java.io.File; import java.util.List; import android.app.Service; import android.content.Context; import android.content.Intent; import android.os.Binder; import android.os.Environment; import android.os.IBinder; import android.os.PowerManager; import android.os.StatFs; import android.util.Log; import com.samsung.chord.IChordChannel; import com.samsung.chord.<API key>; import com.samsung.chord.<API key>; import com.samsung.chord.ChordManager; import com.samsung.chord.ChordManager.INetworkListener; public class ChordSnakeService extends Service { public static String <API key> = "com.samsung.chord.samples.apidemo.SNAKECHANNEL"; private static final String TAG = "[Chord][ApiTest]"; private static final String TAGClass = "ChordService : "; private static final String <API key> = "<API key>"; private static final String <API key> = "<API key>"; private static final long <API key> = 1000 * 60 * 5; public static final String chordFilePath = Environment.<API key>() .getAbsolutePath() + "/Chord"; private ChordManager mChord = null; private String mPrivateChannelName = "snake"; private <API key> mListener = null; private PowerManager.WakeLock mWakeLock = null; // for notifying event to Activity public interface <API key> { void onReceiveMessage(String node, String channel, String message); void onFileWillReceive(String node, String channel, String fileName, String exchangeId); void onFileProgress(boolean bSend, String node, String channel, int progress, String exchangeId); public static final int SENT = 0; public static final int RECEIVED = 1; public static final int CANCELLED = 2; public static final int REJECTED = 3; public static final int FAILED = 4; void onFileCompleted(int reason, String node, String channel, String exchangeId, String fileName); void onNodeEvent(String node, String channel, boolean bJoined); void <API key>(); void onUpdateNodeInfo(String nodeName, String ipAddress); void <API key>(); } @Override public IBinder onBind(Intent intent) { Log.d(TAG, TAGClass + "onBind()"); return mBinder; } @Override public void onCreate() { Log.d(TAG, TAGClass + "onCreate()"); super.onCreate(); } @Override public void onDestroy() { Log.d(TAG, TAGClass + "onDestroy()"); super.onDestroy(); try { release(); } catch (Exception e) { e.printStackTrace(); } } @Override public void onRebind(Intent intent) { Log.d(TAG, TAGClass + "onRebind()"); super.onRebind(intent); } @Override public int onStartCommand(Intent intent, int flags, int startId) { Log.d(TAG, TAGClass + "onStartCommand()"); return super.onStartCommand(intent, START_NOT_STICKY, startId); } @Override public boolean onUnbind(Intent intent) { Log.d(TAG, TAGClass + "onUnbind()"); return super.onUnbind(intent); } public class ChordServiceBinder extends Binder { public ChordSnakeService getService() { return ChordSnakeService.this; } } private final IBinder mBinder = new ChordServiceBinder(); // Initialize chord public void initialize(<API key> listener) throws Exception { if (mChord != null) { return; } // #1. GetInstance mChord = ChordManager.getInstance(this); Log.d(TAG, TAGClass + "[Initialize] Chord Initialized"); mListener = listener; // #2. set some values before start mChord.setTempDirectory(chordFilePath); mChord.<API key>(getMainLooper()); // Optional. // If you need listening network changed, you can set callback before // starting chord. mChord.setNetworkListener(new INetworkListener() { @Override public void onConnected(int interfaceType) { if (null != mListener) { mListener.<API key>(); } } @Override public void onDisconnected(int interfaceType) { if (null != mListener) { mListener.<API key>(); } } }); } // Start chord public int start(int interfaceType) { acqureWakeLock(); // #3. set some values before start return mChord.start(interfaceType, new <API key>() { @Override public void onStarted(String name, int reason) { Log.d(TAG, TAGClass + "onStarted chord"); if (null != mListener) mListener.onUpdateNodeInfo(name, mChord.getIp()); if (<API key> == reason) { Log.e(TAG, TAGClass + "<API key>"); return; } // if(STARTED_BY_USER == reason) : Returns result of calling // start // #4.(optional) listen for public channel IChordChannel channel = mChord.joinChannel(ChordManager.PUBLIC_CHANNEL, mChannelListener); if (null == channel) { Log.e(TAG, TAGClass + "fail to join public"); } } @Override public void <API key>() { Log.e(TAG, TAGClass + "<API key>()"); if (null != mListener) mListener.<API key>(); } @Override public void onError(int error) { // TODO Auto-generated method stub } }); } // This interface defines a listener for chord channel events. private <API key> mChannelListener = new <API key>() { /* * Called when a node join event is raised on the channel. * @param fromNode The node name corresponding to which the join event * has been raised. * @param fromChannel The channel on which the join event has been * raised. */ @Override public void onNodeJoined(String fromNode, String fromChannel) { Log.v(TAG, TAGClass + "onNodeJoined(), fromNode : " + fromNode + ", fromChannel : " + fromChannel); if (null != mListener) mListener.onNodeEvent(fromNode, fromChannel, true); } /* * Called when a node leave event is raised on the channel. * @param fromNode The node name corresponding to which the leave event * has been raised. * @param fromChannel The channel on which the leave event has been * raised. */ @Override public void onNodeLeft(String fromNode, String fromChannel) { Log.v(TAG, TAGClass + "onNodeLeft(), fromNode : " + fromNode + ", fromChannel : " + fromChannel); if (null != mListener) mListener.onNodeEvent(fromNode, fromChannel, false); } /* * Called when the data message received from the node. * @param fromNode The node name that the message is sent from. * @param fromChannel The channel name that is raised event. * @param payloadType User defined message type * @param payload Array of payload. */ @Override public void onDataReceived(String fromNode, String fromChannel, String payloadType, byte[][] payload) { Log.v(TAG, TAGClass + "onDataReceived()"); if (!<API key>.equals(payloadType)) return; byte[] buf = payload[0]; if (null != mListener) mListener.onReceiveMessage(fromNode, fromChannel, new String(buf)); } /* * Called when the Share file notification is received. User can decide * to receive or reject the file. * @param fromNode The node name that the file transfer is requested by. * @param fromChannel The channel name that is raised event. * @param fileName File name * @param hash Hash value * @param fileType User defined file type * @param exchangeId Exchange ID * @param fileSize File size */ @Override public void onFileWillReceive(String fromNode, String fromChannel, String fileName, String hash, String fileType, String exchangeId, long fileSize) { Log.d(TAG, TAGClass + "[originalName : " + fileName + " from : " + fromNode + " exchangeId : " + exchangeId + " fileSize : " + fileSize + "]"); File targetdir = new File(chordFilePath); if (!targetdir.exists()) { targetdir.mkdirs(); } // Because the external storage may be unavailable, // you should verify that the volume is available before accessing it. // But also, onFileFailed with <API key> will be called while Chord got failed to write file. StatFs stat = new StatFs(chordFilePath); long blockSize = stat.getBlockSize(); long totalBlocks = stat.getAvailableBlocks(); long availableMemory = blockSize * totalBlocks; if (availableMemory < fileSize) { rejectFile(fromChannel, exchangeId); if (null != mListener) mListener.onFileCompleted(<API key>.FAILED, fromNode, fromChannel, exchangeId, fileName); return; } if (null != mListener) mListener.onFileWillReceive(fromNode, fromChannel, fileName, exchangeId); } /* * Called when an individual chunk of the file is received. receive or * reject the file. * @param fromNode The node name that the file transfer is requested by. * @param fromChannel The channel name that is raised event. * @param fileName File name * @param hash Hash value * @param fileType User defined file type * @param exchangeId Exchange ID * @param fileSize File size * @param offset Chunk offset */ @Override public void onFileChunkReceived(String fromNode, String fromChannel, String fileName, String hash, String fileType, String exchangeId, long fileSize, long offset) { if (null != mListener) { int progress = (int)(offset * 100 / fileSize); mListener.onFileProgress(false, fromNode, fromChannel, progress, exchangeId); } } /* * Called when the file transfer is completed from the node. * @param fromNode The node name that the file transfer is requested by. * @param fromChannel The channel name that is raised event. * @param fileName File name * @param hash Hash value * @param fileType User defined file type * @param exchangeId Exchange ID * @param fileSize File size * @param tmpFilePath Temporarily stored file path it is assigned with * setTempDirectory() */ @Override public void onFileReceived(String fromNode, String fromChannel, String fileName, String hash, String fileType, String exchangeId, long fileSize, String tmpFilePath) { String savedName = fileName; int i = savedName.lastIndexOf("."); String name = savedName.substring(0, i); String ext = savedName.substring(i); Log.d(TAG, TAGClass + "onFileReceived : " + fileName); Log.d(TAG, TAGClass + "onFileReceived : " + name + " " + ext); File targetFile = new File(chordFilePath, savedName); int index = 0; while (targetFile.exists()) { savedName = name + "_" + index + ext; targetFile = new File(chordFilePath, savedName); index++; Log.d(TAG, TAGClass + "onFileReceived : " + savedName); } File srcFile = new File(tmpFilePath); srcFile.renameTo(targetFile); if (null != mListener) { mListener.onFileCompleted(<API key>.RECEIVED, fromNode, fromChannel, exchangeId, savedName); } } /* * Called when an individual chunk of the file is sent. * @param toNode The node name to which the file is sent. * @param toChannel The channel name that is raised event. * @param fileName File name * @param hash Hash value * @param fileType User defined file type * @param exchangeId Exchange ID * @param fileSize File size * @param offset Offset * @param chunkSize Chunk size */ @Override public void onFileChunkSent(String toNode, String toChannel, String fileName, String hash, String fileType, String exchangeId, long fileSize, long offset, long chunkSize) { if (null != mListener) { int progress = (int)(offset * 100 / fileSize); mListener.onFileProgress(true, toNode, toChannel, progress, exchangeId); } } /* * Called when the file transfer is completed to the node. * @param toNode The node name to which the file is sent. * @param toChannel The channel name that is raised event. * @param fileName File name * @param hash Hash value * @param fileType User defined file type * @param exchangeId Exchange ID */ @Override public void onFileSent(String toNode, String toChannel, String fileName, String hash, String fileType, String exchangeId) { if (null != mListener) { mListener.onFileCompleted(<API key>.SENT, toNode, toChannel, exchangeId, fileName); } } /* * Called when the error is occurred while the file transfer is in * progress. * @param node The node name that the error is occurred by. * @param channel The channel name that is raised event. * @param fileName File name * @param hash Hash value * @param exchangeId Exchange ID * @param reason The reason for failure could be one of * #ERROR_FILE_CANCELED #<API key> * #<API key> #ERROR_FILE_REJECTED #<API key> * #ERROR_FILE_TIMEOUT */ @Override public void onFileFailed(String node, String channel, String fileName, String hash, String exchangeId, int reason) { switch (reason) { case ERROR_FILE_REJECTED: { Log.e(TAG, TAGClass + "onFileFailed() - REJECTED Node : " + node + ", fromChannel : " + channel); if (null != mListener) { mListener.onFileCompleted(<API key>.REJECTED, node, channel, exchangeId, fileName); } break; } case ERROR_FILE_CANCELED: { Log.e(TAG, TAGClass + "onFileFailed() - CANCELED Node : " + node + ", fromChannel : " + channel); if (null != mListener) { mListener.onFileCompleted(<API key>.CANCELLED, node, channel, exchangeId, fileName); } break; } case <API key>: case <API key>: default: Log.e(TAG, TAGClass + "onFileFailed() - " + reason + " : " + node + ", fromChannel : " + channel); if (null != mListener) { mListener.onFileCompleted(<API key>.FAILED, node, channel, exchangeId, fileName); } break; } } }; // Release chord public void release() throws Exception { if (mChord != null) { mChord.stop(); mChord.setNetworkListener(null); mChord = null; Log.d(TAG, "[UNREGISTER] Chord unregistered"); } } public String getPublicChannel() { return ChordManager.PUBLIC_CHANNEL; } public String getPrivateChannel() { return mPrivateChannelName; } // Send file to the node on the channel. public String sendFile(String toChannel, String strFilePath, String toNode) { Log.d(TAG, TAGClass + "sendFile() "); // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(toChannel); if (null == channel) { Log.e(TAG, TAGClass + "sendFile() : invalid channel instance"); return null; } /* * @param toNode The node name that the file is sent to. It is * mandatory. * @param fileType User defined file type. It is mandatory. * @param filePath The absolute path of the file to be transferred. It * is mandatory. * @param timeoutMsec The time to allow the receiver to accept the * receiving data requests. */ return channel.sendFile(toNode, <API key>, strFilePath, <API key>); } // Accept to receive file. public boolean acceptFile(String fromChannel, String exchangeId) { Log.d(TAG, TAGClass + "acceptFile()"); // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(fromChannel); if (null == channel) { Log.e(TAG, TAGClass + "acceptFile() : invalid channel instance"); return false; } /* * @param exchangeId Exchanged ID * @param chunkTimeoutMsec The timeout to request the chunk data. * @param chunkRetries The count that allow to retry to request chunk * data. * @param chunkSize Chunk size */ return channel.acceptFile(exchangeId, 30*1000, 2, 300 * 1024); } // Cancel file transfer while it is in progress. public boolean cancelFile(String channelName, String exchangeId) { Log.d(TAG, TAGClass + "cancelFile()"); // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(channelName); if (null == channel) { Log.e(TAG, TAGClass + "cancelFile() : invalid channel instance"); return false; } // @param exchangeId Exchanged ID return channel.cancelFile(exchangeId); } // Reject to receive file. public boolean rejectFile(String fromChannel, String coreTransactionId) { Log.d(TAG, TAGClass + "rejectFile()"); // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(fromChannel); if (null == channel) { Log.e(TAG, TAGClass + "cancelFile() : invalid channel instance"); return false; } // @param exchangeId Exchanged ID return channel.rejectFile(coreTransactionId); } // Requests for nodes on the channel. public List<String> getJoinedNodeList(String channelName) { Log.d(TAG, TAGClass + "getJoinedNodeList()"); // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(channelName); if (null == channel) { Log.e(TAG, TAGClass + "getJoinedNodeList() : invalid channel instance-" + channelName); return null; } return channel.getJoinedNodeList(); } // Send data message to the node. public boolean sendData(String toChannel, byte[] buf, String nodeName) { if (mChord == null) { Log.v(TAG, "sendData : mChord IS NULL !!"); return false; } // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(toChannel); if (null == channel) { Log.e(TAG, TAGClass + "sendData : invalid channel instance"); return false; } if (nodeName == null) { Log.v(TAG, "sendData : NODE Name IS NULL !!"); return false; } byte[][] payload = new byte[1][]; payload[0] = buf; Log.v(TAG, TAGClass + "sendData : " + new String(buf) + ", des : " + nodeName); /* * @param toNode The joined node name that the message is sent to. It is * mandatory. * @param payloadType User defined message type. It is mandatory. * @param payload The package of data to send * @return Returns true when file transfer is success. Otherwise, false * is returned */ if (false == channel.sendData(nodeName, <API key>, payload)) { Log.e(TAG, TAGClass + "sendData : fail to sendData"); return false; } return true; } // Send data message to the all nodes on the channel. public boolean sendDataToAll(String toChannel, byte[] buf) { if (mChord == null) { Log.v(TAG, "sendDataToAll : mChord IS NULL !!"); return false; } // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(toChannel); if (null == channel) { Log.e(TAG, TAGClass + "sendDataToAll : invalid channel instance"); return false; } byte[][] payload = new byte[1][]; payload[0] = buf; Log.v(TAG, TAGClass + "sendDataToAll : " + new String(buf)); /* * @param payloadType User defined message type. It is mandatory. * @param payload The package of data to send * @return Returns true when file transfer is success. Otherwise, false * is returned. */ if (false == channel.sendDataToAll(<API key>, payload)) { Log.e(TAG, TAGClass + "sendDataToAll : fail to sendDataToAll"); return false; } return true; } /* * Set a keep-alive timeout. Node has keep-alive timeout. The timeoutMsec * determines the maximum keep-alive time to wait to leave when there is no * data from the nodes. Default time is 15000 millisecond. */ public void <API key>(long timeoutMsec) { Log.d(TAG, TAGClass + "<API key>()"); // @param timeoutMsec Timeout with millisecond. mChord.<API key>(timeoutMsec); } // Get an IPv4 address that the node has. public String getNodeIpAddress(String channelName, String nodeName) { Log.d(TAG, TAGClass + "getNodeIpAddress() channelName : " + channelName + ", nodeName : " + nodeName); // Request the channel interface for the specific channel name. IChordChannel channel = mChord.getJoinedChannel(channelName); if(null == channel){ Log.e(TAG, TAGClass + "getNodeIpAddress : invalid channel instance"); return ""; } /* * @param nodeName The node name to find IPv4 address. * @return Returns an IPv4 Address.When there is not the node name in * the channel, null is returned. */ return channel.getNodeIpAddress(nodeName); } // Get a list of available network interface types. public List<Integer> <API key>() { Log.d(TAG, TAGClass + "<API key>()"); /* * @return Returns a list of available network interface types. * #INTERFACE_TYPE_WIFI Wi-Fi #<API key> Wi-Fi mobile * hotspot #<API key> Wi-Fi Direct */ return mChord.<API key>(); } // Request for joined channel interfaces. public List<IChordChannel> <API key>() { Log.d(TAG, TAGClass + "<API key>()"); // @return Returns a list of handle for joined channel. It returns an // empty list, there is no joined channel. return mChord.<API key>(); } // Join a desired channel with a given listener. public IChordChannel joinChannel(String channelName) { Log.d(TAG, TAGClass + "joinChannel()" + channelName); if (channelName == null || channelName.equals("")) { Log.e(TAG, TAGClass + "joinChannel > " + mPrivateChannelName + " is invalid! Default private channel join"); mPrivateChannelName = <API key>; } else { mPrivateChannelName = channelName; } /* * @param channelName Channel name. It is a mandatory input. * @param listener A listener that gets notified when there is events in * joined channel mandatory. It is a mandatory input. * @return Returns a handle of the channel if it is joined successfully, * null otherwise. */ IChordChannel channelInst = mChord.joinChannel(mPrivateChannelName, mChannelListener); if (null == channelInst) { Log.d(TAG, "fail to joinChannel! "); return null; } return channelInst; } // Leave a given channel. public void leaveChannel() { Log.d(TAG, TAGClass + "leaveChannel()"); // @param channelName Channel name mChord.leaveChannel(mPrivateChannelName); mPrivateChannelName = ""; } // Stop chord public void stop() { Log.d(TAG, TAGClass + "stop()"); releaseWakeLock(); if (mChord != null) { mChord.stop(); } } private void acqureWakeLock(){ if(null == mWakeLock){ PowerManager powerMgr = (PowerManager)getSystemService(Context.POWER_SERVICE); mWakeLock = powerMgr.newWakeLock(PowerManager.FULL_WAKE_LOCK, "ChordApiDemo Lock"); Log.d(TAG, "acqureWakeLock : new"); } if(mWakeLock.isHeld()){ Log.w(TAG, "acqureWakeLock : already acquire"); mWakeLock.release(); } Log.d(TAG, "acqureWakeLock : acquire"); mWakeLock.acquire(); } private void releaseWakeLock(){ if(null != mWakeLock && mWakeLock.isHeld()){ Log.d(TAG, "releaseWakeLock"); mWakeLock.release(); } } }
import copy from datetime import datetime from dateutil import parser from contextlib import contextmanager from memsql_loader.util import apsw_helpers, super_json as json from memsql_loader.util.apsw_sql_step_queue.errors import TaskDoesNotExist, StepAlreadyStarted, StepNotStarted, StepAlreadyFinished, StepRunning, AlreadyFinished from memsql_loader.util.apsw_sql_step_queue.time_helpers import unix_timestamp def <API key>(td): """ Needed for python 2.6 compat """ return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10. ** 6) / 10. ** 6 class TaskHandler(object): def __init__(self, execution_id, task_id, queue): self.execution_id = execution_id self.task_id = task_id self._queue = queue self.storage = queue.storage self.started = 0 self.finished = None self.data = None self.result = None # NOTE: These fields are specific to the memsql-loader use case; # they are not necessary for the queue functionality. self.job_id = None self.file_id = None self.md5 = None self.bytes_total = None self.bytes_downloaded = None self.download_rate = None self.steps = None self._refresh() # Public Interface def valid(self): """ Check to see if we are still active. """ if self.finished is not None: return False with self.storage.cursor() as cursor: row = apsw_helpers.get(cursor, ''' SELECT (last_contact > datetime(:now, 'unixepoch', '-%s second')) AS valid FROM %s WHERE id = :task_id AND execution_id = :execution_id ''' % (self._queue.execution_ttl, self._queue.table_name), now=unix_timestamp(datetime.utcnow()), task_id=self.task_id, execution_id=self.execution_id) return bool(row is not None and row.valid) def ping(self): """ Notify the queue that this task is still active. """ if self.finished is not None: raise AlreadyFinished() with self.storage.cursor() as cursor: affected_row = apsw_helpers.get(cursor, ''' SELECT * from %s WHERE id = :task_id AND execution_id = :execution_id AND last_contact > datetime(:now, 'unixepoch', '-%s second') ''' % (self._queue.table_name, self._queue.execution_ttl), now=unix_timestamp(datetime.utcnow()), task_id=self.task_id, execution_id=self.execution_id) if not affected_row: raise TaskDoesNotExist() with self.storage.transaction() as cursor: apsw_helpers.query(cursor, ''' UPDATE %s SET last_contact=datetime(:now, 'unixepoch'), update_count=update_count + 1 WHERE id = :task_id AND execution_id = :execution_id AND last_contact > datetime(:now, 'unixepoch', '-%s second') ''' % (self._queue.table_name, self._queue.execution_ttl), now=unix_timestamp(datetime.utcnow()), task_id=self.task_id, execution_id=self.execution_id) def finish(self, result='success'): if self._running_steps() != 0: raise StepRunning() if self.finished is not None: raise AlreadyFinished() self._save(finished=datetime.utcnow(), result=result) def requeue(self): if self._running_steps() != 0: raise StepRunning() if self.finished is not None: raise AlreadyFinished() with self.storage.cursor() as cursor: affected_row = apsw_helpers.get(cursor, ''' SELECT * from %s WHERE id = :task_id AND execution_id = :execution_id AND last_contact > datetime(:now, 'unixepoch', '-%s second') ''' % (self._queue.table_name, self._queue.execution_ttl), now=unix_timestamp(datetime.utcnow()), task_id=self.task_id, execution_id=self.execution_id) if affected_row is None: raise TaskDoesNotExist() with self.storage.transaction() as cursor: apsw_helpers.query(cursor, ''' UPDATE %s SET last_contact=NULL, update_count=update_count + 1, started=NULL, steps=NULL, execution_id=NULL, finished=NULL, result=NULL WHERE id = :task_id ''' % self._queue.table_name, task_id=self.task_id) def start_step(self, step_name): """ Start a step. """ if self.finished is not None: raise AlreadyFinished() step_data = self._get_step(step_name) if step_data is not None: if 'stop' in step_data: raise StepAlreadyFinished() else: raise StepAlreadyStarted() steps = copy.deepcopy(self.steps) steps.append({ "start": datetime.utcnow(), "name": step_name }) self._save(steps=steps) def stop_step(self, step_name): """ Stop a step. """ if self.finished is not None: raise AlreadyFinished() steps = copy.deepcopy(self.steps) step_data = self._get_step(step_name, steps=steps) if step_data is None: raise StepNotStarted() elif 'stop' in step_data: raise StepAlreadyFinished() step_data['stop'] = datetime.utcnow() step_data['duration'] = <API key>(step_data['stop'] - step_data['start']) self._save(steps=steps) @contextmanager def step(self, step_name): self.start_step(step_name) yield self.stop_step(step_name) def refresh(self): self._refresh() def save(self): self._save() # Private Interface def _get_step(self, step_name, steps=None): for step in (steps if steps is not None else self.steps): if step['name'] == step_name: return step return None def _running_steps(self): return len([s for s in self.steps if 'stop' not in s]) def _refresh(self): with self.storage.cursor() as cursor: row = apsw_helpers.get(cursor, ''' SELECT * FROM %s WHERE id = :task_id AND execution_id = :execution_id AND last_contact > datetime(:now, 'unixepoch', '-%s second') ''' % (self._queue.table_name, self._queue.execution_ttl), now=unix_timestamp(datetime.utcnow()), task_id=self.task_id, execution_id=self.execution_id) if not row: raise TaskDoesNotExist() self.task_id = row.id self.data = json.loads(row.data) self.result = row.result self.job_id = row.job_id self.file_id = row.file_id self.md5 = row.md5 self.bytes_total = row.bytes_total self.bytes_downloaded = row.bytes_downloaded self.download_rate = row.download_rate self.steps = self._load_steps(json.loads(row.steps)) self.started = row.started self.finished = row.finished def _load_steps(self, raw_steps): """ load steps -> basically load all the datetime isoformats into datetimes """ for step in raw_steps: if 'start' in step: step['start'] = parser.parse(step['start']) if 'stop' in step: step['stop'] = parser.parse(step['stop']) return raw_steps def _save(self, finished=None, steps=None, result=None, data=None): finished = finished if finished is not None else self.finished with self.storage.transaction() as cursor: apsw_helpers.query(cursor, ''' UPDATE %s SET last_contact=datetime(:now, 'unixepoch'), update_count=update_count + 1, steps=:steps, finished=datetime(:finished, 'unixepoch'), result=:result, bytes_downloaded=:bytes_downloaded, download_rate=:download_rate, data=:data WHERE id = :task_id AND execution_id = :execution_id AND last_contact > datetime(:now, 'unixepoch', '-%s second') ''' % (self._queue.table_name, self._queue.execution_ttl), now=unix_timestamp(datetime.utcnow()), task_id=self.task_id, execution_id=self.execution_id, steps=json.dumps(steps if steps is not None else self.steps), finished=unix_timestamp(finished) if finished else None, result=result if result is not None else self.result, bytes_downloaded=self.bytes_downloaded, download_rate=self.download_rate, data=json.dumps(data if data is not None else self.data)) affected_row = apsw_helpers.get(cursor, ''' SELECT * from %s WHERE id = :task_id AND execution_id = :execution_id AND last_contact > datetime(:now, 'unixepoch', '-%s second') ''' % (self._queue.table_name, self._queue.execution_ttl), now=unix_timestamp(datetime.utcnow()), task_id=self.task_id, execution_id=self.execution_id) if not affected_row: raise TaskDoesNotExist() else: if steps is not None: self.steps = steps if finished is not None: self.finished = finished if result is not None: self.result = result if data is not None: self.data = data
require 'murder/util/yaml' module MURDER class World include MURDER::Util::Yaml def initialize(config) @world = yaml(config) # Define getters for all keys @world.each do |k,v| self.class.send(:define_method, k) do @world[k] end end end def male_players self.players['m'] end def female_players self.players['f'] end def total_players self.players['f'] + self.players['m'] end def friends self.links['friends'] end def enemies self.links['enemies'] end def list_profiles
#ifdef KROLL_COVERAGE #import "TiBase.h" #import "KrollObject.h" #import "KrollMethod.h" #define <API key> @"proxies" #define <API key> @"modules" #define <API key> @"other" #define API_TYPE_FUNCTION @"function" #define API_TYPE_PROPERTY @"property" #define COVERAGE_TYPE_GET @"propertyGet" #define COVERAGE_TYPE_SET @"propertySet" #define COVERAGE_TYPE_CALL @"functionCall" #define TOP_LEVEL @"TOP_LEVEL" @protocol KrollCoverage <NSObject> -(void)increment:(NSString*)apiName coverageType:(NSString*)coverageType apiType:(NSString*)apiType; -(NSString*)coverageName; -(NSString*)coverageType; @end @interface KrollCoverageObject : KrollObject <KrollCoverage> { @private NSString *componentName, *componentType; } @property(nonatomic,copy) NSString *componentName; @property(nonatomic,copy) NSString *componentType; +(void)incrementCoverage:(NSString*)componentType_ componentName:(NSString*)componentName_ apiName:(NSString*)apiName_ coverageType:(NSString*)coverageType_ apiType:(NSString*)apiType_; +(void)<API key>:(NSString*)componentName name:(NSString*)apiName; +(NSDictionary*)dumpCoverage; +(void)releaseCoverage; -(id)initWithTarget:(id)target_ context:(KrollContext*)context_; -(id)initWithTarget:(id)target_ context:(KrollContext*)context_ componentName:(NSString*)componentName_; @end @interface KrollCoverageMethod : KrollMethod <KrollCoverage> { @private NSString *parentName, *parentType; id<KrollCoverage> parent; } @property(nonatomic,copy) NSString *parentName; @property(nonatomic,copy) NSString *parentType; -(id)initWithTarget:(id)target_ context:(KrollContext *)context_ parent:(id<KrollCoverage>)parent_; -(id)initWithTarget:(id)target_ selector:(SEL)selector_ argcount:(int)argcount_ type:(KrollMethodType)type_ name:(id)name_ context:(KrollContext*)context_ parent:(id)parent_; -(id)call:(NSArray*)args; @end #endif
# AUTOGENERATED FILE FROM balenalib/<API key>:3.12-run ENV NODE_VERSION 15.6.0 ENV YARN_VERSION 1.22.4 # Install dependencies RUN apk add --no-cache libgcc libstdc++ libuv \ && apk add --no-cache libssl1.0 || apk add --no-cache libssl1.1 RUN buildDeps='curl' \ && set -x \ && for key in \ <API key> \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apk add --no-cache $buildDeps \ && curl -SLO "http://resin-packages.s3.amazonaws.com/node/v$NODE_VERSION/node-v$<API key>.tar.gz" \ && echo "<SHA256-like> node-v$<API key>.tar.gz" | sha256sum -c - \ && tar -xzf "node-v$<API key>.tar.gz" -C /usr/local --strip-components=1 \ && rm "node-v$<API key>.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \ && curl -fSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \ && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && mkdir -p /opt/yarn \ && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/yarn --strip-components=1 \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarn \ && ln -s /opt/yarn/bin/yarn /usr/local/bin/yarnpkg \ && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \ && npm config set unsafe-perm true -g --unsafe-perm \
<!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title>Testr-receiver</title> <link rel="shortcut icon" href="assets/favicon.ico"/> <meta http-equiv="Content-Type" content="text/html; charset=utf8"/> <meta name="<API key>" content="yes"/> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <!-- css --> <link href="build/enyo.css" rel="stylesheet"/> <link href="build/app.css" rel="stylesheet"/> <script src="build/enyo.js"></script> <script src="build/app.js"></script> </head> <body class="enyo-unselectable"> <script> new Receiver().renderInto(document.body); </script> </body> </html>
package ar.com.hjg.pngj; public class PngjBadCrcException extends PngjException { private static final long serialVersionUID = <API key>; public PngjBadCrcException() { super(); // TODO Auto-generated constructor stub } public PngjBadCrcException(String message, Throwable cause) { super(message, cause); // TODO Auto-generated constructor stub } public PngjBadCrcException(String message) { super(message); // TODO Auto-generated constructor stub } public PngjBadCrcException(Throwable cause) { super(cause); // TODO Auto-generated constructor stub } }
#28.03.2016 import random print("Программа случайным образом отображает имя одного из пяти членов экипажа Союз-Апполон") x = int (random.randint(1,5)) print ("Один из основателей - ", end = "") if x == 1: print ("Томас Стаффорд") elif x == 2: print ("Вэнс Бранд ") elif x == 3: print ("Дональд Слейтон ") elif x == 4: print ("Алексей Леонов ") else: print ("Валерий Кубасов") input("Для выхода нажмите Enter.")
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.4.2_06) on Thu Feb 03 19:04:32 EST 2005 --> <TITLE> IniPart (Ant Contrib) </TITLE> <META NAME="keywords" CONTENT="net.sf.antcontrib.inifile.IniPart interface"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="IniPart (Ant Contrib)"; } </SCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="IniPart.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <HR> <H2> <FONT SIZE="-1"> net.sf.antcontrib.inifile</FONT> <BR> Interface IniPart</H2> <DL> <DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../net/sf/antcontrib/inifile/IniProperty.html" title="class in net.sf.antcontrib.inifile">IniProperty</A>, <A HREF="../../../../net/sf/antcontrib/inifile/IniSection.html" title="class in net.sf.antcontrib.inifile">IniSection</A></DD> </DL> <HR> <DL> <DT>public interface <B>IniPart</B></DL> <P> A part of an IniFile that might be written to disk. <P> <P> <DL> <DT><B>Author:</B></DT> <DD><a href='mailto:mattinger@yahoo.com'>Matthew Inger</a>, <additional author></DD> </DL> <HR> <P> <A NAME="method_summary"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=2><FONT SIZE="+2"> <B>Method Summary</B></FONT></TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>&nbsp;void</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../net/sf/antcontrib/inifile/IniPart.html#write(java.io.Writer)">write</A></B>(java.io.Writer&nbsp;writer)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Write this part of the IniFile to a writer</TD> </TR> </TABLE> &nbsp; <P> <A NAME="method_detail"></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TD COLSPAN=1><FONT SIZE="+2"> <B>Method Detail</B></FONT></TD> </TR> </TABLE> <A NAME="write(java.io.Writer)"></A><H3> write</H3> <PRE> public void <B>write</B>(java.io.Writer&nbsp;writer) throws java.io.IOException</PRE> <DL> <DD>Write this part of the IniFile to a writer <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>writer</CODE> - The writer to write to <DT><B>Throws:</B> <DD><CODE>java.io.IOException</CODE></DL> </DD> </DL> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV CLASS&nbsp; &nbsp;NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="IniPart.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <! if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <HR> </BODY> </HTML>
package pl.dstrzyzewski.presentation.spring.integration; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import java.io.Serializable; public class Message implements Serializable { private static final long serialVersionUID = <API key>; private final int id; private final String value; private final boolean processed; public Message(final int id, final String value, final boolean processed) { this.id = id; this.value = value; this.processed = processed; } public int getId() { return id; } public String getValue() { return value; } public boolean getProcessed() { return processed; } @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) .append("id", id) .append("value", value) .append("processed", processed) .build(); } }
package example.model; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @Entity public class Customer1050 { @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id; private String firstName; private String lastName; protected Customer1050() {} public Customer1050(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } @Override public String toString() { return String.format("Customer1050[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (9) on Mon Sep 25 10:15:10 EDT 2017 --> <title>IdentifierService (trellis-spi 0.1.1 API)</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="date" content="2017-09-25"> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> <script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script> <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script> <!--[if IE]> <script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script> <![endif] <script type="text/javascript" src="../../../jquery/jquery-1.10.2.js"></script> <script type="text/javascript" src="../../../jquery/jquery-ui.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="IdentifierService (trellis-spi 0.1.1 API)"; } } catch(err) { } var methods = {"i0":6,"i1":6,"i2":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; var pathtoroot = "../../../";loadScripts(document, 'script');</script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="fixedNav"> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../org/trellisldp/spi/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/trellisldp/spi/EventService.html" title="interface in org.trellisldp.spi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/trellisldp/spi/IOService.html" title="interface in org.trellisldp.spi"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/trellisldp/spi/IdentifierService.html" target="_top">Frames</a></li> <li><a href="IdentifierService.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <ul class="navListSearch"> <li><span>SEARCH:&nbsp;</span> <input type="text" id="search" value=" " disabled="disabled"> <input type="reset" id="reset" value=" " disabled="disabled"> </li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> </a></div> </div> <div class="navPadding">&nbsp;</div> <script type="text/javascript"><! $('.navPadding').css('padding-top', $('.fixedNav').css("height")); </script> <div class="header"> <div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="../../../org/trellisldp/spi/package-summary.html">org.trellisldp.spi</a></div> <h2 title="Interface IdentifierService" class="title">Interface IdentifierService</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public interface <span class="typeNameLabel">IdentifierService</span></pre> <div class="block">The IdentifierService provides a mechanism for creating new identifiers.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.summary"> </a> <h3>Method Summary</h3> <table class="memberSummary" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colSecond" scope="col">Method</th> <th class="colLast" scope="col">Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>java.util.function.Supplier&lt;java.lang.String&gt;</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../org/trellisldp/spi/IdentifierService.html#getSupplier--">getSupplier</a></span>&#8203;()</code></th> <td class="colLast"> <div class="block">Get a Supplier that generates Strings with the provided prefix</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>java.util.function.Supplier&lt;java.lang.String&gt;</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../org/trellisldp/spi/IdentifierService.html#getSupplier-java.lang.String-">getSupplier</a></span>&#8203;(java.lang.String&nbsp;prefix)</code></th> <td class="colLast"> <div class="block">Get a Supplier that generates Strings with the provided prefix</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>java.util.function.Supplier&lt;java.lang.String&gt;</code></td> <th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../org/trellisldp/spi/IdentifierService.html#getSupplier-java.lang.String-java.lang.Integer-java.lang.Integer-">getSupplier</a></span>&#8203;(java.lang.String&nbsp;prefix, java.lang.Integer&nbsp;hierarchy, java.lang.Integer&nbsp;length)</code></th> <td class="colLast"> <div class="block">Get a Supplier that generates Strings with the provided prefix</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.detail"> </a> <h3>Method Detail</h3> <a name="getSupplier-java.lang.String-java.lang.Integer-java.lang.Integer-"> </a> <ul class="blockList"> <li class="blockList"> <h4>getSupplier</h4> <pre>java.util.function.Supplier&lt;java.lang.String&gt;&nbsp;getSupplier&#8203;(java.lang.String&nbsp;prefix, java.lang.Integer&nbsp;hierarchy, java.lang.Integer&nbsp;length)</pre> <div class="block">Get a Supplier that generates Strings with the provided prefix</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>prefix</code> - the prefix</dd> <dd><code>hierarchy</code> - the levels of hierarchy to add</dd> <dd><code>length</code> - the length of each level of hierarchy</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a String Supplier</dd> </dl> </li> </ul> <a name="getSupplier-java.lang.String-"> </a> <ul class="blockList"> <li class="blockList"> <h4>getSupplier</h4> <pre>java.util.function.Supplier&lt;java.lang.String&gt;&nbsp;getSupplier&#8203;(java.lang.String&nbsp;prefix)</pre> <div class="block">Get a Supplier that generates Strings with the provided prefix</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>prefix</code> - the prefix</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>a String Supplier</dd> </dl> </li> </ul> <a name="getSupplier </a> <ul class="blockListLast"> <li class="blockList"> <h4>getSupplier</h4> <pre>java.util.function.Supplier&lt;java.lang.String&gt;&nbsp;getSupplier&#8203;()</pre> <div class="block">Get a Supplier that generates Strings with the provided prefix</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>a String Supplier</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../org/trellisldp/spi/package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-all.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../org/trellisldp/spi/EventService.html" title="interface in org.trellisldp.spi"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../org/trellisldp/spi/IOService.html" title="interface in org.trellisldp.spi"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?org/trellisldp/spi/IdentifierService.html" target="_top">Frames</a></li> <li><a href="IdentifierService.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> </a></div> </body> </html>
package me.jinkun.opennews.data.domain; // THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS // KEEP INCLUDES - put your custom includes here // KEEP INCLUDES END /** * Entity mapped to table "NEWS_CHANNEL". */ public class NewsChannel implements java.io.Serializable { private Long id; private String topicid; private String tname; private String tid; private Integer isSelected; private Integer orderNum; // KEEP FIELDS - put your custom fields here // KEEP FIELDS END public NewsChannel() { } public NewsChannel(Long id) { this.id = id; } public NewsChannel(Long id, String topicid, String tname, String tid, Integer isSelected, Integer orderNum) { this.id = id; this.topicid = topicid; this.tname = tname; this.tid = tid; this.isSelected = isSelected; this.orderNum = orderNum; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTopicid() { return topicid; } public void setTopicid(String topicid) { this.topicid = topicid; } public String getTname() { return tname; } public void setTname(String tname) { this.tname = tname; } public String getTid() { return tid; } public void setTid(String tid) { this.tid = tid; } public Integer getIsSelected() { return isSelected; } public void setIsSelected(Integer isSelected) { this.isSelected = isSelected; } public Integer getOrderNum() { return orderNum; } public void setOrderNum(Integer orderNum) { this.orderNum = orderNum; } // KEEP METHODS - put your custom methods here // KEEP METHODS END }
package com.tvd12.ezyfox.testing.entity; import java.util.HashMap; import java.util.HashSet; import org.testng.annotations.Test; import com.tvd12.ezyfox.collect.Sets; import com.tvd12.ezyfox.entity.EzyEmptyObject; import com.tvd12.ezyfox.factory.EzyEntityFactory; public class EzyEmptyObjectTest { @Test public void test() { EzyEmptyObject object = (EzyEmptyObject) EzyEntityFactory.EMPTY_OBJECT; assert object.size() == 0; assert !object.containsKey("a"); assert !object.isNotNullValue("a"); try {object.get("a");} catch (Exception e) {assert e instanceof <API key>;}; try {object.get("a", Integer.class);} catch (Exception e) {assert e instanceof <API key>;}; try {object.getValue("a", Integer.class);} catch (Exception e) {assert e instanceof <API key>;}; assert object.keySet().size() == 0; assert object.entrySet().size() == 0; assert object.toMap().isEmpty(); assert object.put("a", 1).equals(1); object.putAll(new HashMap<>()); assert object.remove("a") == null; object.removeAll(Sets.newHashSet(1, 2, 3)); object.clear(); assert !object.containsKeys(new HashSet<>()); try {object.compute("a", (a, b) -> 1);} catch (Exception e) {assert e instanceof <API key>;}; try {object.clone();} catch (Exception e) {assert e instanceof <API key>;}; try {object.duplicate();} catch (Exception e) {assert e instanceof <API key>;}; } }
package com.goodow.drive.android.svg.utils; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.DashPathEffect; import android.graphics.Paint; import android.graphics.RectF; import com.goodow.drive.android.svg.OnShowPopupListener; import com.goodow.drive.android.svg.graphics.MyBaseShape; import com.goodow.drive.android.svg.graphics.MyEllipse; import com.goodow.drive.android.svg.graphics.MyLine; import com.goodow.drive.android.svg.graphics.MyPath; import com.goodow.drive.android.svg.graphics.MyRect; import com.goodow.realtime.store.CollaborativeMap; import com.google.inject.Singleton; import java.util.ArrayList; import java.util.List; @Singleton public class DrawUtil { private Paint mPaint = new Paint(); private Paint shapeBoundsPaint = new Paint(); private Paint switchBoundsPaint = new Paint(); private Canvas mCanvas; private DashPathEffect shapeBoundsEffect; private DashPathEffect shapeBoundsEffect2; private DashPathEffect switchBoundsEffect; private List<MyBaseShape> shapeList = new ArrayList<MyBaseShape>(); private List<CollaborativeMap> collList = new ArrayList<CollaborativeMap>(); private OnShowPopupListener onShowPopupListener; public DrawUtil() { shapeBoundsEffect = new DashPathEffect(new float[]{3, 12, 3, 12}, 0); shapeBoundsEffect2 = new DashPathEffect(new float[]{0, 6, 6, 3}, 0); switchBoundsEffect = new DashPathEffect(new float[]{5, 5}, 1); } public void drawRect(MyRect myRect) { if (mCanvas == null) { return; } myRect.generatePath(); if (myRect.getStroke_width() > 0) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setColor(myRect.getStroke()); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(myRect.getStroke_width()); mCanvas.drawPath(myRect.getPath(), mPaint); } if (myRect.getFill() != -1) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setStyle(Paint.Style.FILL); mPaint.setColor(myRect.getFill()); mCanvas.drawPath(myRect.getPath(), mPaint); } if (myRect.isSelected()) { drawShapeBoundsRect(myRect.getBounds()); } } public void <API key>(int x, int y, int sx, int sy) { switchBoundsPaint.setAntiAlias(true); switchBoundsPaint.setStyle(Paint.Style.STROKE); switchBoundsPaint.setColor(Color.BLUE); switchBoundsPaint.setStrokeWidth(2); switchBoundsPaint.setPathEffect(switchBoundsEffect); mCanvas.drawRect(x, y, sx, sy, switchBoundsPaint); } public void drawEllipse(MyEllipse myEllipse) { if (mCanvas == null) { return; } myEllipse.generatePath(); if (myEllipse.getStroke_width() > 0) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setColor(myEllipse.getStroke()); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(myEllipse.getStroke_width()); mCanvas.drawPath(myEllipse.getPath(), mPaint); } if (myEllipse.getFill() != -1) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setColor(myEllipse.getFill()); mPaint.setStyle(Paint.Style.FILL); mCanvas.drawPath(myEllipse.getPath(), mPaint); } if (myEllipse.isSelected()) { drawShapeBoundsRect(myEllipse.getBounds()); } } public void drawLine(MyLine myLine) { if (mCanvas == null) { return; } myLine.generatePath(); if (myLine.getStroke_width() > 0) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setColor(myLine.getStroke()); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(myLine.getStroke_width()); mCanvas.drawPath(myLine.getPath(), mPaint); } if (myLine.getFill() != -1) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setColor(myLine.getFill()); mPaint.setStyle(Paint.Style.FILL); mCanvas.drawPath(myLine.getPath(), mPaint); } if (myLine.isSelected()) { drawShapeBoundsRect(myLine.getBounds()); } } public void drawPath(MyPath myPath) { if (mCanvas == null || myPath.getPoints().size() == 0) { return; } myPath.generatePath(); if (myPath.getStroke_width() > 0) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setColor(myPath.getStroke()); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeWidth(myPath.getStroke_width()); mCanvas.drawPath(myPath.getPath(), mPaint); } if (myPath.getFill() != -1) { mPaint.reset(); mPaint.setAntiAlias(true); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setColor(myPath.getFill()); mPaint.setStyle(Paint.Style.FILL); mCanvas.drawPath(myPath.getPath(), mPaint); } if (myPath.isSelected()) { drawShapeBoundsRect(myPath.getBounds()); } } public void drawAll() { for (MyBaseShape graphic : shapeList) { if (graphic instanceof MyRect) { drawRect((MyRect) graphic); } else if (graphic instanceof MyEllipse) { drawEllipse((MyEllipse) graphic); } else if (graphic instanceof MyPath) { drawPath((MyPath) graphic); } else if (graphic instanceof MyLine) { drawLine((MyLine) graphic); } onShowPopupListener.onShowPopup(graphic); } } private void drawShapeBoundsRect(RectF rectF) { shapeBoundsPaint.setAntiAlias(true); shapeBoundsPaint.setColor(Color.RED); shapeBoundsPaint.setStrokeWidth(3); shapeBoundsPaint.setStyle(Paint.Style.STROKE); shapeBoundsPaint.setPathEffect(shapeBoundsEffect); mCanvas.drawRect(rectF, shapeBoundsPaint); shapeBoundsPaint.setColor(Color.YELLOW); shapeBoundsPaint.setPathEffect(shapeBoundsEffect2); mCanvas.drawRect(rectF, shapeBoundsPaint); } public void setCanvas(Canvas mCanvas) { this.mCanvas = mCanvas; } public List<MyBaseShape> getShapeList() { return shapeList; } public List<CollaborativeMap> getCollList() { return collList; } public void <API key>(OnShowPopupListener onShowPopupListener) { this.onShowPopupListener = onShowPopupListener; } }
package org.synyx.urlaubsverwaltung.security; import org.apache.log4j.Logger; import org.springframework.security.authentication.<API key>; import org.springframework.security.authentication.<API key>; import org.springframework.security.authentication.DisabledException; import org.springframework.security.authentication.Username<API key>; import org.springframework.security.core.Authentication; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.<API key>; import org.springframework.security.core.userdetails.<API key>; import org.springframework.security.crypto.password.<API key>; import org.synyx.urlaubsverwaltung.core.person.Person; import org.synyx.urlaubsverwaltung.core.person.PersonService; import org.synyx.urlaubsverwaltung.core.person.Role; import java.util.Collection; import java.util.Optional; import java.util.stream.Collectors; /** * Provides authentication with password, which is saved in database. * * @author Daniel Hammann - <hammann@synyx.de> */ public class Simple<API key> implements <API key> { private static final Logger LOG = Logger.getLogger(Simple<API key>.class); private final PersonService personService; public Simple<API key>(PersonService personService) { this.personService = personService; } @Override public Authentication authenticate(Authentication authentication) { <API key> encoder = new <API key>(); String username = authentication.getName(); String rawPassword = authentication.getCredentials().toString(); Optional<Person> userOptional = personService.getPersonByLogin(username); if (!userOptional.isPresent()) { LOG.info("No user found for username '" + username + "'"); throw new <API key>("No authentication possible for user = " + username); } Person person = userOptional.get(); if (person.hasRole(Role.INACTIVE)) { LOG.info("User '" + username + "' has been deactivated and can not sign in therefore"); throw new DisabledException("User '" + username + "' has been deactivated"); } Collection<Role> permissions = person.getPermissions(); Collection<GrantedAuthority> grantedAuthorities = permissions.stream().map((role) -> new <API key>(role.name())).collect(Collectors.toList()); String userPassword = person.getPassword(); if (encoder.matches(rawPassword, userPassword)) { LOG.info("User '" + username + "' has signed in with roles: " + grantedAuthorities); return new Username<API key>(username, userPassword, grantedAuthorities); } else { LOG.info("User '" + username + "' has tried to sign in with a wrong password"); throw new <API key>("The provided password is wrong"); } } @Override public boolean supports(Class<?> authentication) { return authentication.equals(Username<API key>.class); } }
package org.gradle.test.performance.<API key>.p122; import org.junit.Test; import static org.junit.Assert.*; public class Test2441 { Production2441 objectUnderTest = new Production2441(); @Test public void testProperty0() { String value = "value"; objectUnderTest.setProperty0(value); assertEquals(value, objectUnderTest.getProperty0()); } @Test public void testProperty1() { String value = "value"; objectUnderTest.setProperty1(value); assertEquals(value, objectUnderTest.getProperty1()); } @Test public void testProperty2() { String value = "value"; objectUnderTest.setProperty2(value); assertEquals(value, objectUnderTest.getProperty2()); } @Test public void testProperty3() { String value = "value"; objectUnderTest.setProperty3(value); assertEquals(value, objectUnderTest.getProperty3()); } @Test public void testProperty4() { String value = "value"; objectUnderTest.setProperty4(value); assertEquals(value, objectUnderTest.getProperty4()); } @Test public void testProperty5() { String value = "value"; objectUnderTest.setProperty5(value); assertEquals(value, objectUnderTest.getProperty5()); } @Test public void testProperty6() { String value = "value"; objectUnderTest.setProperty6(value); assertEquals(value, objectUnderTest.getProperty6()); } @Test public void testProperty7() { String value = "value"; objectUnderTest.setProperty7(value); assertEquals(value, objectUnderTest.getProperty7()); } @Test public void testProperty8() { String value = "value"; objectUnderTest.setProperty8(value); assertEquals(value, objectUnderTest.getProperty8()); } @Test public void testProperty9() { String value = "value"; objectUnderTest.setProperty9(value); assertEquals(value, objectUnderTest.getProperty9()); } }
using BenchmarkDotNet.Attributes; using Serilog.Core; using Serilog.Events; using Serilog.PerformanceTests.Support; namespace Serilog.PerformanceTests { <summary> Tests the overhead of determining the active logging level. </summary> public class <API key> { ILogger _off = null!, _levelSwitchOff = null!, _minLevel = null!, _levelSwitch = null!; readonly LogEvent _event = Some.InformationEvent(); [GlobalSetup] public void Setup() { _off = new LoggerConfiguration() .MinimumLevel.Fatal() .WriteTo.Sink(new NullSink()) .CreateLogger(); _levelSwitchOff = new LoggerConfiguration() .MinimumLevel.ControlledBy(new LoggingLevelSwitch(LogEventLevel.Fatal)) .WriteTo.Sink(new NullSink()) .CreateLogger(); _minLevel = new LoggerConfiguration() .MinimumLevel.Information() .WriteTo.Sink(new NullSink()) .CreateLogger(); _levelSwitch = new LoggerConfiguration() .MinimumLevel.ControlledBy(new LoggingLevelSwitch(LogEventLevel.Information)) .WriteTo.Sink(new NullSink()) .CreateLogger(); } [Benchmark(Baseline = true)] public void Off() { _off.Write(_event); } [Benchmark] public void LevelSwitchOff() { _levelSwitchOff.Write(_event); } [Benchmark] public void MinimumLevelOn() { _minLevel.Write(_event); } [Benchmark] public void LevelSwitchOn() { _levelSwitch.Write(_event); } } }
package org.giterlab; import android.app.Application; import android.content.Context; import android.util.Log; import com.alibaba.sdk.android.push.CloudPushService; import com.alibaba.sdk.android.push.CommonCallback; import com.alibaba.sdk.android.push.noonesdk.PushServiceFactory; import com.alibaba.sdk.android.push.register.GcmRegister; import com.alibaba.sdk.android.push.register.HuaWeiRegister; import com.alibaba.sdk.android.push.register.MiPushRegister; import static com.alibaba.sdk.android.push.AgooMessageReceiver.TAG; public class DXApplication extends Application { private static DXApplication myContext; public DXApplication(){} public static DXApplication getContext(){ return myContext; } public void onCreate(){ super.onCreate(); init(this); // MiPushRegister.register(this,"APPID","APPKEY"); // HuaWeiRegister.register(this); // GcmRegister.register(this,"SENDID","APPLICATIONID"); myContext= DXApplication.this; } private void init(Context applicationContext){ PushServiceFactory.init(applicationContext); CloudPushService pushService = PushServiceFactory.getCloudPushService(); pushService.register(applicationContext, new CommonCallback() { @Override public void onSuccess(String response) { Log.d(TAG, "init cloudchannel success"); } @Override public void onFailed(String errorCode, String errorMessage) { Log.d(TAG, "init cloudchannel failed -- errorcode:" + errorCode + " -- errorMessage:" + errorMessage); } }); } }
// vector_assign.cpp // compile with: /EHsc #include <vector> #include <iostream> using namespace std; int main( ) { vector<int> v1, v2, v3; vector<int>::iterator iter; v1.push_back(10); v1.push_back(20); v1.push_back(30); v1.push_back(40); v1.push_back(50); cout << "v1 = " ; for (iter = v1.begin(); iter != v1.end(); iter++) cout << *iter << " "; cout << endl; v2.assign(v1.begin(), v1.end()); cout << "v2 = "; for (iter = v2.begin(); iter != v2.end(); iter++) cout << *iter << " "; cout << endl; v3.assign(7, 4) ; cout << "v3 = "; for (iter = v3.begin(); iter != v3.end(); iter++) cout << *iter << " "; cout << endl; }
package com.coo.s.cloud.qrcode; import java.awt.BasicStroke; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.OutputStream; import java.util.HashMap; import java.util.Map; import javax.imageio.ImageIO; import com.google.zxing.BarcodeFormat; import com.google.zxing.Binarizer; import com.google.zxing.BinaryBitmap; import com.google.zxing.EncodeHintType; import com.google.zxing.LuminanceSource; import com.google.zxing.MultiFormatReader; import com.google.zxing.MultiFormatWriter; import com.google.zxing.Result; import com.google.zxing.WriterException; import com.google.zxing.client.j2se.<API key>; import com.google.zxing.common.BitMatrix; import com.google.zxing.common.HybridBinarizer; import com.google.zxing.qrcode.decoder.<API key>; /** * * * @author boqing.shen * @since 1.0.0.0 */ public class QrcodeBuilder { /** * * * @return */ public Map<EncodeHintType, Object> getDecodeHintType() { Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>(); // QRH hints.put(EncodeHintType.ERROR_CORRECTION, <API key>.H); hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); hints.put(EncodeHintType.MAX_SIZE, 350); hints.put(EncodeHintType.MIN_SIZE, 100); return hints; } /** * * * @param bm * @return */ public BufferedImage fileToBufferedImage(BitMatrix bm) { BufferedImage image = null; try { int w = bm.getWidth(), h = bm.getHeight(); image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { image.setRGB(x, y, bm.get(x, y) ? 0xff000000 : 0xffffffff); } } } catch (Exception e) { e.printStackTrace(); } return image; } /** * bufferedImage * * @param content * * @param barcodeFormat * * @param width * * @param height * * @param hints * * @return */ public BufferedImage <API key>(String content, BarcodeFormat barcodeFormat, int width, int height, Map<EncodeHintType, ?> hints) { MultiFormatWriter multiFormatWriter = null; BitMatrix bm = null; BufferedImage image = null; try { multiFormatWriter = new MultiFormatWriter(); bm = multiFormatWriter.encode(content, barcodeFormat, width, height, hints); int w = bm.getWidth(); int h = bm.getHeight(); image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); // Bitmap0xFFFFFFFF0xFF000000 for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { image.setRGB(x, y, bm.get(x, y) ? 0xff000000 : 0xffffffff); } } } catch (WriterException e) { e.printStackTrace(); } return image; } /** * * * @param bm * @param imageFormat * @param file */ public void <API key>(BitMatrix bm, String imageFormat, File file) { try { if (null == file || file.getName().trim().isEmpty()) { throw new <API key>(""); } BufferedImage bi = fileToBufferedImage(bm); ImageIO.write(bi, "jpeg", file); } catch (Exception e) { e.printStackTrace(); } } /** * * * @param content * @param imageFormat * @param os */ public void <API key>(BitMatrix bm, String imageFormat, OutputStream os) { try { BufferedImage image = fileToBufferedImage(bm); ImageIO.write(image, imageFormat, os); } catch (Exception e) { e.printStackTrace(); } } /** * Logo * * @param qrPic * @param logoPic */ public void addLogo_QRCode(File qrPic, File logoPic, LogoConfig logoConfig) { try { if (!qrPic.isFile() || !logoPic.isFile()) { System.out.print("file not find !"); System.exit(0); } BufferedImage image = ImageIO.read(qrPic); Graphics2D g = image.createGraphics(); /** * Logo */ BufferedImage logo = ImageIO.read(logoPic); int widthLogo = logo.getWidth(), heightLogo = logo.getHeight(); int x = (image.getWidth() - widthLogo) / 2; int y = (image.getHeight() - logo.getHeight()) / 2; g.drawImage(logo, x, y, widthLogo, heightLogo, null); g.drawRoundRect(x, y, widthLogo, heightLogo, 15, 15); g.setStroke(new BasicStroke(logoConfig.getBorder())); g.setColor(logoConfig.getBorderColor()); g.drawRect(x, y, widthLogo, heightLogo); g.dispose(); ImageIO.write(image, "jpeg", qrPic); } catch (Exception e) { e.printStackTrace(); } } /** * * * @param file */ @SuppressWarnings({ "unchecked", "rawtypes" }) public void parseQR_CODEImage(File file) { try { MultiFormatReader formatReader = new MultiFormatReader(); // File file = new File(filePath); if (!file.exists()) { return; } BufferedImage image = ImageIO.read(file); LuminanceSource source = new <API key>(image); Binarizer binarizer = new HybridBinarizer(source); BinaryBitmap binaryBitmap = new BinaryBitmap(binarizer); Map hints = new HashMap(); hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); @SuppressWarnings("unused") Result result = formatReader.decode(binaryBitmap, hints); } catch (Exception e) { e.printStackTrace(); } } }
/** * Please modify this class to meet your needs * This class is not complete */ package client.services; import java.util.logging.Logger; import javax.jws.WebMethod; import javax.jws.WebParam; import javax.jws.WebResult; import javax.jws.WebService; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.ws.RequestWrapper; import javax.xml.ws.ResponseWrapper; @javax.jws.WebService( serviceName = "SupplierService", portName = "SupplierPT", targetNamespace = "http://infosys.tuwien.ac.at/aic10/ass1/dto/shipping", wsdlLocation = "http://localhost:9000/supplierservice2?wsdl", endpointInterface = "client.services.SupplierService") public class <API key> implements SupplierService { private static final Logger LOG = Logger.getLogger(SupplierServiceImpl.class.getName()); /* (non-Javadoc) * @see client.services.SupplierService#order(client.services.Product p ,)int amount )* */ public java.math.BigDecimal order(client.services.Product p,int amount) throws <API key> { LOG.info("Executing operation order"); System.out.println(p); System.out.println(amount); try { java.math.BigDecimal _return = new java.math.BigDecimal("0"); return _return; } catch (Exception ex) { ex.printStackTrace(); throw new RuntimeException(ex); } //throw new <API key>("UnknownProductFault..."); } }
#include "webkit/fileapi/<API key>.h" #include <string> #include "base/files/file_path.h" #include "base/files/scoped_temp_dir.h" #include "base/format_macros.h" #include "base/memory/weak_ptr.h" #include "base/message_loop.h" #include "base/platform_file.h" #include "base/strings/string_piece.h" #include "base/<API key>.h" #include "net/base/net_errors.h" #include "net/base/net_util.h" #include "net/http/<API key>.h" #include "net/url_request/url_request.h" #include "net/url_request/url_request_context.h" #include "net/url_request/<API key>.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/icu/public/i18n/unicode/regex.h" #include "webkit/fileapi/file_system_context.h" #include "webkit/fileapi/<API key>.h" #include "webkit/fileapi/<API key>.h" #include "webkit/fileapi/file_system_url.h" #include "webkit/fileapi/<API key>.h" #include "webkit/fileapi/<API key>.h" #include "webkit/quota/<API key>.h" namespace fileapi { namespace { // We always use the TEMPORARY FileSystem in this test. static const char <API key>[] = "filesystem:http://remote/temporary/"; } // namespace class <API key> : public testing::Test { protected: <API key>() : message_loop_(MessageLoop::TYPE_IO), // simulate an IO thread weak_factory_(this) { } virtual void SetUp() OVERRIDE { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); <API key> = new quota::<API key>; <API key> = <API key>( NULL, temp_dir_.path()); <API key>->sandbox_provider()-><API key>( GURL("http://remote/"), <API key>, true, // create base::Bind(&<API key>::<API key>, weak_factory_.GetWeakPtr())); MessageLoop::current()->RunUntilIdle(); net::URLRequest::Deprecated::<API key>( "filesystem", &<API key>); } virtual void TearDown() OVERRIDE { // NOTE: order matters, request must die before delegate request_.reset(NULL); delegate_.reset(NULL); net::URLRequest::Deprecated::<API key>("filesystem", NULL); ClearUnusedJob(); } void <API key>(base::PlatformFileError result) { ASSERT_EQ(base::PLATFORM_FILE_OK, result); } void TestRequestHelper(const GURL& url, bool run_to_completion) { delegate_.reset(new net::TestDelegate()); delegate_-><API key>(true); request_.reset(empty_context_.CreateRequest(url, delegate_.get())); job_ = new <API key>( request_.get(), NULL, <API key>.get()); request_->Start(); ASSERT_TRUE(request_->is_pending()); // verify that we're starting async if (run_to_completion) MessageLoop::current()->Run(); } void TestRequest(const GURL& url) { TestRequestHelper(url, true); } void TestRequestNoRun(const GURL& url) { TestRequestHelper(url, false); } FileSystemURL CreateURL(const base::FilePath& file_path) { return <API key>-><API key>( GURL("http://remote"), fileapi::<API key>, file_path); } <API key>* NewOperationContext() { <API key>* context(new <API key>( <API key>)); context-><API key>(1024); return context; } void CreateDirectory(const base::StringPiece& dir_name) { base::FilePath path = base::FilePath().AppendASCII(dir_name); scoped_ptr<<API key>> context(NewOperationContext()); ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->CreateDirectory( context.get(), CreateURL(path), false /* exclusive */, false /* recursive */)); } void EnsureFileExists(const base::StringPiece file_name) { base::FilePath path = base::FilePath().AppendASCII(file_name); scoped_ptr<<API key>> context(NewOperationContext()); ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->EnsureFileExists( context.get(), CreateURL(path), NULL)); } void TruncateFile(const base::StringPiece file_name, int64 length) { base::FilePath path = base::FilePath().AppendASCII(file_name); scoped_ptr<<API key>> context(NewOperationContext()); ASSERT_EQ(base::PLATFORM_FILE_OK, file_util()->Truncate( context.get(), CreateURL(path), length)); } base::PlatformFileError GetFileInfo(const base::FilePath& path, base::PlatformFileInfo* file_info, base::FilePath* platform_file_path) { scoped_ptr<<API key>> context(NewOperationContext()); return file_util()->GetFileInfo(context.get(), CreateURL(path), file_info, platform_file_path); } void VerifyListingEntry(const std::string& entry_line, const std::string& name, const std::string& url, bool is_directory, int64 size) { #define STR "([^\"]*)" icu::UnicodeString pattern("^<script>addRow\\(\"" STR "\",\"" STR "\",(0|1),\"" STR "\",\"" STR "\"\\);</script>"); #undef STR icu::UnicodeString input(entry_line.c_str()); UErrorCode status = U_ZERO_ERROR; icu::RegexMatcher match(pattern, input, 0, status); EXPECT_TRUE(match.find()); EXPECT_EQ(5, match.groupCount()); EXPECT_EQ(icu::UnicodeString(name.c_str()), match.group(1, status)); EXPECT_EQ(icu::UnicodeString(url.c_str()), match.group(2, status)); EXPECT_EQ(icu::UnicodeString(is_directory ? "1" : "0"), match.group(3, status)); icu::UnicodeString size_string(<API key>(size).c_str()); EXPECT_EQ(size_string, match.group(4, status)); base::Time date; icu::UnicodeString date_ustr(match.group(5, status)); std::string date_str; UTF16ToUTF8(date_ustr.getBuffer(), date_ustr.length(), &date_str); EXPECT_TRUE(base::Time::FromString(date_str.c_str(), &date)); EXPECT_FALSE(date.is_null()); } GURL CreateFileSystemURL(const std::string path) { return GURL(<API key> + path); } static net::URLRequestJob* <API key>( net::URLRequest* request, net::NetworkDelegate* network_delegate, const std::string& scheme) { DCHECK(job_); net::URLRequestJob* temp = job_; job_ = NULL; return temp; } static void ClearUnusedJob() { if (job_) { scoped_refptr<net::URLRequestJob> deleter = job_; job_ = NULL; } } FileSystemFileUtil* file_util() { return <API key>->sandbox_provider()->GetFileUtil( <API key>); } // Put the message loop at the top, so that it's the last thing deleted. // Delete all MessageLoopProxy objects before the MessageLoop, to help prevent // leaks caused by tasks posted during shutdown. MessageLoop message_loop_; base::ScopedTempDir temp_dir_; net::URLRequestContext empty_context_; scoped_ptr<net::TestDelegate> delegate_; scoped_ptr<net::URLRequest> request_; scoped_refptr<quota::<API key>> <API key>; scoped_refptr<FileSystemContext> <API key>; base::WeakPtrFactory<<API key>> weak_factory_; static net::URLRequestJob* job_; }; // static net::URLRequestJob* <API key>::job_ = NULL; namespace { TEST_F(<API key>, DirectoryListing) { CreateDirectory("foo"); CreateDirectory("foo/bar"); CreateDirectory("foo/bar/baz"); EnsureFileExists("foo/bar/hoge"); TruncateFile("foo/bar/hoge", 10); TestRequest(CreateFileSystemURL("foo/bar/")); ASSERT_FALSE(request_->is_pending()); EXPECT_EQ(1, delegate_-><API key>()); EXPECT_FALSE(delegate_-><API key>()); EXPECT_GT(delegate_->bytes_received(), 0); std::istringstream in(delegate_->data_received()); std::string line; EXPECT_TRUE(std::getline(in, line)); #if defined(OS_WIN) EXPECT_EQ("<script>start(\"foo\\\\bar\");</script>", line); #elif defined(OS_POSIX) EXPECT_EQ("<script>start(\"/foo/bar\");</script>", line); #endif EXPECT_TRUE(std::getline(in, line)); VerifyListingEntry(line, "hoge", "hoge", false, 10); EXPECT_TRUE(std::getline(in, line)); VerifyListingEntry(line, "baz", "baz", true, 0); } TEST_F(<API key>, InvalidURL) { TestRequest(GURL("filesystem:/foo/bar/baz")); ASSERT_FALSE(request_->is_pending()); EXPECT_TRUE(delegate_->request_failed()); ASSERT_FALSE(request_->status().is_success()); EXPECT_EQ(net::ERR_INVALID_URL, request_->status().error()); } TEST_F(<API key>, NoSuchRoot) { TestRequest(GURL("filesystem:http://remote/persistent/somedir/")); ASSERT_FALSE(request_->is_pending()); ASSERT_FALSE(request_->status().is_success()); EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); } TEST_F(<API key>, NoSuchDirectory) { TestRequest(CreateFileSystemURL("somedir/")); ASSERT_FALSE(request_->is_pending()); ASSERT_FALSE(request_->status().is_success()); EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); } TEST_F(<API key>, Cancel) { CreateDirectory("foo"); TestRequestNoRun(CreateFileSystemURL("foo/")); // Run StartAsync() and only StartAsync(). MessageLoop::current()->DeleteSoon(FROM_HERE, request_.release()); MessageLoop::current()->RunUntilIdle(); // If we get here, success! we didn't crash! } } // namespace (anonymous) } // namespace fileapi
package com.android.util.db; import java.util.List; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import com.j256.ormlite.android.apptools.OpenHelperManager; public class DB { private static DatabaseHelper databaseHelper; private static Context context; public DatabaseHelper getHelper() { return databaseHelper; } public static synchronized boolean initDB(Context _context) { if(_context == null) return false; if( databaseHelper == null && _context != null) { context = _context; databaseHelper = new DatabaseHelper(context); } return true; } /** * @see * @param readorWrite : * true:getWritableDatabase||false:getReadableDatabase * @return */ public static SQLiteDatabase getDB(boolean readorWrite) { if(databaseHelper == null) return null; if(readorWrite) { return databaseHelper.getWritableDatabase(); }else { return databaseHelper.getReadableDatabase(); } } /** * @see */ public static void closeDB() { if (null != databaseHelper) { OpenHelperManager.releaseHelper(); databaseHelper = null; } } public static final String _ID = "_id"; /** * * @param table * @param section * @return */ public static int getCount(String table, String section) { SQLiteDatabase db = null; Cursor cursor = null; String sql = (table != null ? ("select count(1) from " + table + (section != null ? " where " + section : "")) : section); try { db = getDB(false); cursor = db.rawQuery(sql, null); cursor.moveToFirst(); return cursor.getInt(0); } catch (Exception e) { e.printStackTrace(); } finally { if (null != cursor) { cursor.close(); } } return 0; } /** * * @param table * @param section * @return */ public static boolean clear(String table, String section) { SQLiteDatabase db = null; String sql = "delete from " + table + (section != null ? " where " + section : ""); try { db = getDB(true); db.execSQL(sql); return true; } catch (Exception e) { e.printStackTrace(); return false; } } /** * * @param table * @param value * @param section * @return */ public static boolean update(String table, String value,String section) { SQLiteDatabase db = null; String sql = " update " + table +" set " + value + " where " + section ; try { db = getDB(true); db.execSQL(sql); return true; } catch (Exception e) { e.printStackTrace(); return false; } } /** in(1,2,3,4,5,6) */ public static String makeInState(String colName, List<Integer> ids) { StringBuilder section = new StringBuilder(); section.append(colName + " in("); for( int i = 0; i < ids.size(); i++) { if(i != 0) { section.append(","); } section.append(ids.get(i)+""); } section.append(") "); return section.toString(); } }
package com.example.cameraactivity; import android.annotation.SuppressLint; import android.app.Activity; import android.content.Context; import android.content.pm.PackageManager; import android.hardware.Camera; import android.hardware.Camera.PictureCallback; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.widget.Button; import android.widget.FrameLayout; @SuppressLint("SimpleDateFormat") public class CameraActivity extends Activity { private static final String TAG = "CameraActivity"; private Camera mCamera; private CameraPreview mPreview; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_camera); // Create an instance of Camera mCamera = getCameraInstance(); // Create our Preview view and set it as the content of our activity. mPreview = new CameraPreview(this, mCamera); FrameLayout preview = (FrameLayout) findViewById(R.id.camera_preview); preview.addView(mPreview); // Add a listener to the Capture button Button captureButton = (Button) findViewById(R.id.button_capture); captureButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { takePicture(); } }); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.camera, menu); return true; } /** Check if this device has a camera */ private boolean checkCameraHardware(Context context) { if (context.getPackageManager().hasSystemFeature( PackageManager.FEATURE_CAMERA)) { // this device has a camera return true; } else { // no camera on this device return false; } } /** A safe way to get an instance of the Camera object. */ public static Camera getCameraInstance() { Camera c = null; try { c = Camera.open(); // attempt to get a Camera instance } catch (Exception e) { // Camera is not available (in use or does not exist) } return c; // returns null if camera is unavailable } private void takePicture() { PictureCallback mPicture = new PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) { new MediaSaver().execute(data); mCamera.startPreview(); } }; mCamera.takePicture(null, null, mPicture); } }
#!/bin/bash OS=`uname -s` ARCH=`uname -m` GET=`which curl` if [ -z "$GET" ]; then GET=`which wget` else GET="$GET -Lo ./minikube" fi get_kube() { echo "get" echo $GET if [ -z $OS ] || [ -z $ARCH ]; then echo "could not determine OS or architecture" exit 1 fi if [ "$ARCH" == "x86_64" ]; then if [ "$OS" == "Darwin" ]; then $GET https://storage.googleapis.com/minikube/releases/v0.7.1/<API key> elif [ "$OS" == "Linux" ]; then $GET https://storage.googleapis.com/minikube/releases/v0.7.1/<API key> fi fi } mkdir -p ./dev_deps/ && cd ./dev_deps/ stat -q ./minikube if [ $? -eq 1 ]; then get_kube && chmod 755 ./minikube fi ./minikube $1 $2 cd -
package com.browseengine.bobo.api; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; import org.apache.log4j.Logger; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.StringField; import org.apache.lucene.index.<API key>; import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.Collector; import org.apache.lucene.search.Filter; import org.apache.lucene.search.MatchAllDocsQuery; import org.apache.lucene.search.Query; import org.apache.lucene.search.SortField; import org.apache.lucene.search.Weight; import com.browseengine.bobo.facets.<API key>; import com.browseengine.bobo.facets.FacetCountCollector; import com.browseengine.bobo.facets.FacetHandler; import com.browseengine.bobo.facets.<API key>; import com.browseengine.bobo.facets.RuntimeFacetHandler; import com.browseengine.bobo.facets.<API key>; import com.browseengine.bobo.facets.filter.AndFilter; import com.browseengine.bobo.facets.filter.RandomAccessFilter; import com.browseengine.bobo.search.BoboSearcher; import com.browseengine.bobo.search.FacetHitCollector; import com.browseengine.bobo.sort.SortCollector; /** * This class implements the browsing functionality. */ public class BoboSubBrowser extends BoboSearcher implements Browsable { private static Logger logger = Logger.getLogger(BoboSubBrowser.class); private final BoboSegmentReader _reader; private final Map<String, <API key><?, ?>> <API key>; private final HashMap<String, FacetHandler<?>> <API key>; private HashMap<String, FacetHandler<?>> _allFacetHandlerMap; private ArrayList<RuntimeFacetHandler<?>> <API key> = null; @Override public IndexReader getIndexReader() { return _reader; } /** * Constructor. * * @param reader * A bobo reader instance */ public BoboSubBrowser(BoboSegmentReader reader) { super(reader); _reader = reader; <API key> = new HashMap<String, FacetHandler<?>>(); <API key> = reader.<API key>(); _allFacetHandlerMap = null; } private boolean isNoQueryNoFilter(BrowseRequest req) { Query q = req.getQuery(); Filter filter = req.getFilter(); return ((q == null || q instanceof MatchAllDocsQuery) && filter == null && !_reader .hasDeletions()); } @Override public Object[] getRawFieldVal(int docid, String fieldname) throws IOException { FacetHandler<?> facetHandler = getFacetHandler(fieldname); if (facetHandler == null) { return getFieldVal(docid, fieldname); } else { return facetHandler.getRawFieldValues(_reader, docid); } } /** * Sets runtime facet handler. If has the same name as a preload handler, for the * duration of this browser, this one will be used. * * @param facetHandler * Runtime facet handler */ @Override public void setFacetHandler(FacetHandler<?> facetHandler) throws IOException { Set<String> dependsOn = facetHandler.getDependsOn(); if (dependsOn.size() > 0) { Iterator<String> iter = dependsOn.iterator(); while (iter.hasNext()) { String fn = iter.next(); FacetHandler<?> f = <API key>.get(fn); if (f == null) { f = _reader.getFacetHandler(fn); } if (f == null) { throw new IOException("depended on facet handler: " + fn + ", but is not found"); } facetHandler.<API key>(f); } } facetHandler.loadFacetData(_reader); <API key>.put(facetHandler.getName(), facetHandler); } /** * Gets a defined facet handler * * @param name * facet name * @return a facet handler */ @Override public FacetHandler<?> getFacetHandler(String name) { return getFacetHandlerMap().get(name); } @Override public Map<String, FacetHandler<?>> getFacetHandlerMap() { if (_allFacetHandlerMap == null) { _allFacetHandlerMap = new HashMap<String, FacetHandler<?>>(_reader.getFacetHandlerMap()); } _allFacetHandlerMap.putAll(<API key>); return _allFacetHandlerMap; } /** * Gets a set of facet names * * @return set of facet names */ @Override public Set<String> getFacetNames() { Map<String, FacetHandler<?>> map = getFacetHandlerMap(); return map.keySet(); } @SuppressWarnings("unchecked") @Override public void browse(BrowseRequest req, Collector collector, Map<String, FacetAccessible> facetMap, int start) throws BrowseException { if (_reader == null) return; // initialize all <API key> with data supplied by user at run-time. <API key> = new ArrayList<RuntimeFacetHandler<?>>( <API key>.size()); Set<String> runtimeFacetNames = <API key>.keySet(); for (String facetName : runtimeFacetNames) { FacetHandler<?> sfacetHandler = this.getFacetHandler(facetName); if (sfacetHandler != null) { logger.warn("attempting to reset facetHandler: " + sfacetHandler); continue; } <API key><<API key>, ?> factory = (<API key><<API key>, ?>) <API key> .get(facetName); try { <API key> data = req.getFacethandlerData(facetName); if (data == null) data = <API key>.EMPTY_PARAM; if (data != <API key>.EMPTY_PARAM || !factory.isLoadLazily()) { RuntimeFacetHandler<?> facetHandler = factory.get(data); if (facetHandler != null) { <API key>.add(facetHandler); // add to a list so we close them after search this.setFacetHandler(facetHandler); } } } catch (IOException e) { throw new BrowseException("error trying to set FacetHandler : " + facetName + ":" + e.getMessage(), e); } } // done initialize all <API key> with data supplied by user at run-time. Set<String> fields = getFacetNames(); LinkedList<Filter> preFilterList = new LinkedList<Filter>(); List<FacetHitCollector> <API key> = new LinkedList<FacetHitCollector>(); Filter baseFilter = req.getFilter(); if (baseFilter != null) { preFilterList.add(baseFilter); } int selCount = req.getSelectionCount(); boolean isNoQueryNoFilter = isNoQueryNoFilter(req); boolean isDefaultSearch = isNoQueryNoFilter && selCount == 0; try { for (String name : fields) { BrowseSelection sel = req.getSelection(name); FacetSpec ospec = req.getFacetSpec(name); FacetHandler<?> handler = getFacetHandler(name); if (handler == null) { logger.error("facet handler: " + name + " is not defined, ignored."); continue; } FacetHitCollector facetHitCollector = null; RandomAccessFilter filter = null; if (sel != null) { filter = handler.buildFilter(sel); } if (ospec == null) { if (filter != null) { preFilterList.add(filter); } } else { /* * FacetSpec fspec = new FacetSpec(); // OrderValueAsc, fspec.setMaxCount(0); * fspec.setMinHitCount(1); fspec.setExpandSelection(ospec.isExpandSelection()); */ FacetSpec fspec = ospec; facetHitCollector = new FacetHitCollector(); facetHitCollector.facetHandler = handler; if (isDefaultSearch) { facetHitCollector._collectAllSource = handler.<API key>(sel, fspec); } else { facetHitCollector.<API key> = handler.<API key>( sel, fspec); if (ospec.isExpandSelection()) { if (isNoQueryNoFilter && sel != null && selCount == 1) { facetHitCollector._collectAllSource = handler.<API key>(sel, fspec); if (filter != null) { preFilterList.add(filter); } } else { if (filter != null) { facetHitCollector._filter = filter; } } } else { if (filter != null) { preFilterList.add(filter); } } } } if (facetHitCollector != null) { <API key>.add(facetHitCollector); } } Filter finalFilter = null; if (preFilterList.size() > 0) { if (preFilterList.size() == 1) { finalFilter = preFilterList.getFirst(); } else { finalFilter = new AndFilter(preFilterList); } } <API key>(<API key>); try { Query query = req.getQuery(); Weight weight = <API key>(query); search(weight, finalFilter, collector, start, req.getMapReduceWrapper()); } finally { for (FacetHitCollector facetCollector : <API key>) { String name = facetCollector.facetHandler.getName(); LinkedList<FacetCountCollector> resultcollector = null; resultcollector = facetCollector._countCollectorList; if (resultcollector == null || resultcollector.size() == 0) { resultcollector = facetCollector.<API key>; } if (resultcollector != null) { FacetSpec fspec = req.getFacetSpec(name); assert fspec != null; if (resultcollector.size() == 1) { facetMap.put(name, resultcollector.get(0)); } else { ArrayList<FacetAccessible> finalList = new ArrayList<FacetAccessible>( resultcollector.size()); for (FacetCountCollector fc : resultcollector) { finalList.add(fc); } <API key> combinedCollector = new <API key>(fspec, finalList); facetMap.put(name, combinedCollector); } } } } } catch (IOException ioe) { throw new BrowseException(ioe.getMessage(), ioe); } } @Override public SortCollector getSortCollector(SortField[] sort, Query q, int offset, int count, boolean fetchStoredFields, Set<String> termVectorsToFetch, String[] groupBy, int maxPerGroup, boolean collectDocIdCache) { return SortCollector.buildSortCollector(this, q, sort, offset, count, fetchStoredFields, termVectorsToFetch, groupBy, maxPerGroup, collectDocIdCache); } /** * browses the index. * * @param req * browse request * @return browse result */ @Override public BrowseResult browse(BrowseRequest req) { throw new <API key>(); } public Map<String, FacetHandler<?>> <API key>() { return <API key>; } @Override public int numDocs() { return _reader.numDocs(); } @Override public Document doc(int docid) throws <API key>, IOException { Document doc = super.doc(docid); for (FacetHandler<?> handler : <API key>.values()) { String[] vals = handler.getFieldValues(_reader, docid); for (String val : vals) { doc.add(new StringField(handler.getName(), val, Field.Store.NO)); } } return doc; } /** * Returns the field data for a given doc. * * @param docid * doc * @param fieldname * name of the field * @return field data */ @Override public String[] getFieldVal(int docid, final String fieldname) throws IOException { FacetHandler<?> facetHandler = getFacetHandler(fieldname); if (facetHandler != null) { return facetHandler.getFieldValues(_reader, docid); } else { logger.warn("facet handler: " + fieldname + " not defined, looking at stored field."); return _reader.getStoredFieldValue(docid, fieldname); } } @Override public void doClose() throws IOException { if (<API key> != null) { for (RuntimeFacetHandler<?> handler : <API key>) { handler.close(); } } if (_reader != null) { _reader.<API key>(); _reader.<API key>(); } } }
# zkui zkui is a cross platform GUI frontend of [Apache ZooKeeper](http://zookeeper.apache.org/) implemented with Python3 + Qt5 + HTML5. *A screenshot on Xubuntu 15.04* ![The Main Window](https://github.com/echoma/zkui/wiki/snapshot_20150122/<API key>.JPG) [Check Here For More Screenshots](https://github.com/echoma/zkui/wiki/Snapshots) # Features * Browse the ZooKeeper node tree, edit the node's data. * Copy a node to new path recursively. * Export / Import between node and your local storage recursively. * Delete node and its children recursively. * ACL supportted, sheme including world,digest,ip * Use a pre-configured default ACL when create new node * Cross-platform, this is the nature given by Python3 and Qt5 # Download Pre-built Binaries If it's too complicated for you to build a Python3+PyQt5 environment, You can [download pre-built binary executables here](https://github.com/echoma/zkui/wiki/Download). * Currently, there are only MS Windows executables provided. * The latest binary package is uploaded on 2016-02-03 # Build By Yourself # 1. Install Python3.x * The latest version is 3.4.3 as write this. This is also the recommended version. [download it here](http://python.org/) * Install PyQt5 package. We use PyQt5 to draw the native window and use its QWebkit to render all the gui component inside the window. On Linux distribution, you can install it through software center, or download [source code](http: On MS Windows, you can install it via a [binary installer](http: * IMPORTANT: Qt5.6 removed QtWebkit. So, Qt5.5 is the newest version we can use to build zkui. I was planning to port zkui to nw.js, but doesn't have enough spare time yest. * Install Kazoo package. Kazoo is a pure Python3 implemented ZooKeeper client. Install this package with this command: **python3 -m pip install kazoo** * Install pyyaml package. using this command: **python3 -m pip install pyyaml** # 2. Run zkui * Start zkui with this command: **python3 ./zkui.py** # Freeze Python Scripts Into Binaries # Install Python3's cx_Freeze package. * cx_Freeze is a set of cross platform tools which can freeze Python scripts into executables. * Install this package with this commad: **python3 -m pip install cx_Freeze** # On MS-Windows * build executables: **python3 ./cx_freeze_setup.py build** * build MS Installer: **python3 ./cx_freeze_setup.py bdist_msi** # On Linux * build RPM *(not tested)*: **python3 ./cx_freeze_setup.py bdist_rpm** # On Mac OSX * build DMG: **python3 ./cx_freeze_setup.py bdist_dmg** # Simple Usage Guidance The whole UI is composed with three parts: * The top part is "navigation". It shows which node you are browsing. The "Go Up" and "Go Down" button is very helpful. * The left part is "children and operations". The blue blocks is the children of current node, click it to browse the child. The orange button has many useful operations, discover them by yourself. * The right part is "node data". You can view and edit the node data here. # Miscellaneous * I choose Apache License v2, but I am not an expert on license. Zkui uses many other opensource modules, I am not sure whether Apache Licese v2 is legal. # todo * switch to QT5.5/5.6 to use QtWebEngine for better html5 support * merge new upstream releases of h5 component * make editor window resizable instead of editor itself resizable * select export/import directory by dialog * support dump node tree at an interval * node value editor syntax highlighting * diff utility when editor node value
package de.mhus.cao.model.fs; import de.mhus.lib.cao.CaoApplication; import de.mhus.lib.cao.<API key>; import de.mhus.lib.cao.CaoConnection; import de.mhus.lib.cao.CaoException; import de.mhus.lib.cao.CaoForm; import de.mhus.lib.config.IConfig; public class <API key> extends <API key> { @Override protected CaoApplication create(CaoConnection con, IConfig config) throws CaoException { return new IoApplication((IoConnection) con, config); } @Override public CaoForm createConfiguration() { return null; } }
When(%r{^I check /health_check$}) do visit "/health_check" end When(%r{^I check <API key>/health_check$}) do visit "#{Rails.application.config.relative_url_root}/health_check" end Then(/^I should see that the site is healthy$/) do body = JSON.parse(page.body) expect(body).to eq({ "status" => "ok", "database" => "up" }) end
#!/usr/bin/env bash set -e set -u if [[ "${1}" =~ ^(-h|-help|--help|-\?|/\?)$ ]]; then echo "USAGE:" echo "build/scripts/tests.sh (Debug|Release) (dotnet|mono|mono-debug) [test assembly name] [xunit args]" echo "If specified, the test assembly name must be a substring match for one or more test assemblies." echo "Note that it's a substring match so '.dll' would match all unit test DLLs and run them all." echo "Any xunit args specified after the assembly name will be passed directly to the test runner so you can run individual tests, i.e. -method \"*.Query_01\"" exit 1 fi build_configuration=${1:-Debug} runtime=${2:-dotnet} <API key>=${3:-} xunit_args=(${@:4}) was_argv_specified=0 [[ "${<API key>}" != "" ]] && was_argv_specified=1 this_dir="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${this_dir}"/build-utils.sh root_path="$(get_repo_dir)" binaries_path="${root_path}"/Binaries unittest_dir="${binaries_path}"/"${build_configuration}"/UnitTests log_dir="${binaries_path}"/"${build_configuration}"/xUnitResults nuget_dir="${HOME}"/.nuget/packages <API key>="$(get_package_version xunitrunnerconsole)" <API key>="$(get_tool_version dotnetRuntime)" if [[ "${runtime}" == "dotnet" ]]; then file_list=( "${unittest_dir}"/*/netcoreapp2.1/*.UnitTests.dll ) file_skiplist=( # Disable the VB Semantic tests while we investigate the core dump issue "Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests.dll" ) xunit_console="${nuget_dir}"/xunit.runner.console/"${<API key>}"/tools/netcoreapp2.0/xunit.console.dll elif [[ "${runtime}" =~ ^(mono|mono-debug)$ ]]; then file_list=( "${unittest_dir}"/*/net472/*.UnitTests.dll ) file_skiplist=( # Omitted because we appear to be missing things necessary to compile vb.net. 'Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests.dll' 'Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests.dll' # PortablePdb and lots of other problems 'Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests.dll' # Many test failures 'Microsoft.CodeAnalysis.UnitTests.dll' # Multiple test failures 'Microsoft.Build.Tasks.CodeAnalysis.UnitTests.dll' # Disabling on assumption 'Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests.dll' # A zillion test failures + crash 'Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests.dll' # Currently fails on CI against old versions of mono 'VBCSCompiler.UnitTests.dll' # Mono serialization errors breaking tests that have traits 'Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests.dll' ) xunit_console="${nuget_dir}"/xunit.runner.console/"${<API key>}"/tools/net452/xunit.console.exe else echo "Unknown runtime: ${runtime}" exit 1 fi echo "Using ${xunit_console}" # Discover and run the tests mkdir -p "${log_dir}" exit_code=0 for file_name in "${file_list[@]}" do file_base_name=$(basename "${file_name}") log_file="${log_dir}/${file_base_name%.*}.xml" deps_json="${file_name%.*}".deps.json runtimeconfig_json="${file_name%.*}".runtimeconfig.json is_argv_match=0 [[ "${file_name}" =~ "${<API key>}" ]] && is_argv_match=1 is_skiplist_match=0 [[ "${file_skiplist[@]}" =~ "${file_base_name}" ]] && is_skiplist_match=1 if (( is_skiplist_match && ! (is_argv_match && was_argv_specified) )) then echo "Skipping listed ${file_base_name}" continue fi if (( was_argv_specified && ! is_argv_match )) then echo "Skipping ${file_base_name} to run single test" continue fi echo Running "${runtime} ${file_name}" if [[ "${runtime}" == "dotnet" ]]; then # Disable the VB Semantic tests while we investigate the core dump issue if [[ "${file_name[@]}" == *'Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests.dll' ]] then echo "Skipping ${file_name[@]}" continue fi runner="dotnet exec --fx-version ${<API key>} --depsfile ${deps_json} --runtimeconfig ${runtimeconfig_json}" elif [[ "${runtime}" == "mono" ]]; then runner=mono elif [[ "${runtime}" == "mono-debug" ]]; then runner="mono --debug" fi if ${runner} "${xunit_console}" "${file_name}" -xml "${log_file}" -parallel none ${xunit_args[@]+"${xunit_args[@]}"} then echo "Assembly ${file_name} passed" else echo "Assembly ${file_name} failed" exit_code=1 fi done exit ${exit_code}
/* Area: ffi_call, closure_call Purpose: Check structure alignment of sint64. Limitations: none. PR: none. Originator: <hos@tamanegi.org> 20031203 */ /* { dg-do run } */ /* { dg-options "-Wno-format" { target alpha*-dec-osf* } } */ #include "ffitest.h" typedef struct cls_struct_align { unsigned char a; signed long long b; unsigned char c; } cls_struct_align; cls_struct_align cls_struct_align_fn(struct cls_struct_align a1, struct cls_struct_align a2) { struct cls_struct_align result; result.a = a1.a + a2.a; result.b = a1.b + a2.b; result.c = a1.c + a2.c; printf("%d %" PRIdLL " %d %d %" PRIdLL " %d: %d %" PRIdLL " %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c); return result; } static void cls_struct_align_gn(ffi_cif* cif __UNUSED__, void* resp, void** args, void* userdata __UNUSED__) { struct cls_struct_align a1, a2; a1 = *(struct cls_struct_align*)(args[0]); a2 = *(struct cls_struct_align*)(args[1]); *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2); } int main (void) { ffi_cif cif; void *code; ffi_closure *pcl = (ffi_closure *)ffi_closure_alloc(sizeof(ffi_closure), &code); void* args_dbl[5]; ffi_type* cls_struct_fields[4]; ffi_type cls_struct_type; ffi_type* dbl_arg_types[5]; cls_struct_type.size = 0; cls_struct_type.alignment = 0; cls_struct_type.type = FFI_TYPE_STRUCT; cls_struct_type.elements = cls_struct_fields; struct cls_struct_align g_dbl = { 12, 4951, 127 }; struct cls_struct_align f_dbl = { 1, 9320, 13 }; struct cls_struct_align res_dbl; cls_struct_fields[0] = &ffi_type_uchar; cls_struct_fields[1] = &ffi_type_sint64; cls_struct_fields[2] = &ffi_type_uchar; cls_struct_fields[3] = NULL; dbl_arg_types[0] = &cls_struct_type; dbl_arg_types[1] = &cls_struct_type; dbl_arg_types[2] = NULL; CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type, dbl_arg_types) == FFI_OK); args_dbl[0] = &g_dbl; args_dbl[1] = &f_dbl; args_dbl[2] = NULL; ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl); /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ CHECK(<API key>(pcl, &cif, cls_struct_align_gn, NULL, code) == FFI_OK); res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(code))(g_dbl, f_dbl); /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */ printf("res: %d %" PRIdLL " %d\n", res_dbl.a, res_dbl.b, res_dbl.c); /* { dg-output "\nres: 13 14271 140" } */ exit(0); }
package org.<API key>.section03ifs; import java.awt.Color; import org.teachingextensions.approvals.lite.util.ThreadUtils; import org.teachingextensions.logo.Tortoise; import org.teachingextensions.logo.utils.ColorUtils.PenColors; import org.teachingextensions.logo.utils.EventUtils.MessageBox; public class <API key> { public static void main(String[] args) { startStory(); } private static void startStory() { tellMoreStory("One morning the Tortoise woke up in a dream."); animateStartStory(); String action = askAQuestion("Do you want to 'wake up' or 'explore' the dream?"); if ("wake up".equalsIgnoreCase(action)) { wakeUp(); } else if ("explore".equalsIgnoreCase(action)) { approachOoze(); } else { endStory(); } } private static void endStory() { MessageBox.showMessage("You don't know how to read directions. You can't play this game. The end."); } private static void approachOoze() { MessageBox.showMessage( "You approach a glowing, green bucket of ooze. Worried that you will get in trouble, you pick up the bucket."); String answer = MessageBox.askForTextInput("Do you want to pour the ooze into the 'backyard' or 'toilet'?"); if ("toilet".equalsIgnoreCase(answer)) { pourIntoToilet(answer); } else if ("backyard".equalsIgnoreCase(answer)) { pourIntoBackyard(answer); } else { endStory(); } } private static void pourIntoBackyard(String answer) { MessageBox.showMessage( "As you walk into the backyard a net scoops you up and a giant takes you to a boiling pot of water."); MessageBox.askForTextInput("As the man starts to prepare you as soup, do you...'Scream' or 'Faint'?"); if ("faint".equalsIgnoreCase(answer)) { } else if ("scream".equalsIgnoreCase(answer)) { } else { endStory(); } } private static void pourIntoToilet(String answer) { MessageBox.showMessage( "As you pour the ooze into the toilet it backs up, gurgles, and explodes, covering you in radioactive waste."); MessageBox.askForTextInput("Do you want to train to be a NINJA? 'Yes' or 'HECK YES'?"); if ("Yes".equalsIgnoreCase(answer)) { MessageBox .showMessage("Awesome dude! You live out the rest of your life fighting crimes and eating pizza!"); } else if ("HECK YES".equalsIgnoreCase(answer)) { MessageBox .showMessage("Awesome dude! You live out the rest of your life fighting crimes and eating pizza!"); } } private static void wakeUp() { MessageBox.showMessage("You wake up and have a boring day. The end."); } private static void animateStartStory() { Tortoise.show(); Color color = PenColors.Grays.Black; for (int i = 0; i < 25; i++) { Tortoise.getBackgroundWindow().setColor(color); color = PenColors.lighten(color); ThreadUtils.sleep(100); } } private static void tellMoreStory(String message) { MessageBox.showMessage(message); } private static String askAQuestion(String question) { String answer = MessageBox.askForTextInput(question); return answer; } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Wed Jul 17 09:40:07 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.config.modcluster.proxy.<API key> (BOM: * : All 2.4.1.Final-SNAPSHOT API)</title> <meta name="date" content="2019-07-17"> <link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.wildfly.swarm.config.modcluster.proxy.<API key> (BOM: * : All 2.4.1.Final-SNAPSHOT API)"; } } catch(err) { } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.4.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/modcluster/proxy/class-use/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.config.modcluster.proxy.<API key>" class="title">Uses of Interface<br>org.wildfly.swarm.config.modcluster.proxy.<API key></h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.modcluster">org.wildfly.swarm.config.modcluster</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.modcluster.proxy">org.wildfly.swarm.config.modcluster.proxy</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="org.wildfly.swarm.config.modcluster"> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a> in <a href="../../../../../../../org/wildfly/swarm/config/modcluster/package-summary.html">org.wildfly.swarm.config.modcluster</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/modcluster/package-summary.html">org.wildfly.swarm.config.modcluster</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code><a href="../../../../../../../org/wildfly/swarm/config/modcluster/Proxy.html" title="type parameter in Proxy">T</a></code></td> <td class="colLast"><span class="typeNameLabel">Proxy.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/modcluster/Proxy.html#<API key>.wildfly.swarm.config.modcluster.proxy.<API key>-">simpleLoadProvider</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a>&nbsp;consumer)</code> <div class="block">Simple load provider returns constant pre-configured load balancing factor.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.modcluster.proxy"> </a> <h3>Uses of <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a> in <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/package-summary.html">org.wildfly.swarm.config.modcluster.proxy</a></h3> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/package-summary.html">org.wildfly.swarm.config.modcluster.proxy</a> that return <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="type parameter in <API key>">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel"><API key>.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html#andThen-org.wildfly.swarm.config.modcluster.proxy.<API key>-">andThen</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="type parameter in <API key>">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/package-summary.html">org.wildfly.swarm.config.modcluster.proxy</a> with parameters of type <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>default <a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="type parameter in <API key>">T</a>&gt;</code></td> <td class="colLast"><span class="typeNameLabel"><API key>.</span><code><span class="memberNameLink"><a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html#andThen-org.wildfly.swarm.config.modcluster.proxy.<API key>-">andThen</a></span>(<a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy"><API key></a>&lt;<a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="type parameter in <API key>">T</a>&gt;&nbsp;after)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../org/wildfly/swarm/config/modcluster/proxy/<API key>.html" title="interface in org.wildfly.swarm.config.modcluster.proxy">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../../../overview-tree.html">Tree</a></li> <li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">Thorntail API, 2.4.1.Final-SNAPSHOT</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?org/wildfly/swarm/config/modcluster/proxy/class-use/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
package Paws::Discovery::Tag; use Moose; has Key => (is => 'ro', isa => 'Str', request_name => 'key', traits => ['NameInRequest'], required => 1); has Value => (is => 'ro', isa => 'Str', request_name => 'value', traits => ['NameInRequest'], required => 1); 1; main pod documentation begin =head1 NAME Paws::Discovery::Tag =head1 USAGE This class represents one of two things: =head3 Arguments in a call to a service Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. Each attribute should be used as a named argument in the calls that expect this type of object. As an example, if Att1 is expected to be a Paws::Discovery::Tag object: $service_obj->Method(Att1 => { Key => $value, ..., Value => $value }); =head3 Results returned from an API call Use accessors for each attribute. If Att1 is expected to be an Paws::Discovery::Tag object: $result = $service_obj->Method(...); $result->Att1->Key =head1 DESCRIPTION Metadata that help you categorize IT assets. =head1 ATTRIBUTES =head2 B<REQUIRED> Key => Str The type of tag on which to filter. =head2 B<REQUIRED> Value => Str A value for a tag key on which to filter. =head1 SEE ALSO This class forms part of L<Paws>, describing an object used in L<Paws::Discovery> =head1 BUGS and CONTRIBUTIONS The source code is located here: https://github.com/pplu/aws-sdk-perl Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues =cut
title: Table of contents description: How to add a table of contents to you page. image: /images/building1.jpg imageTitle: Cityscape. Photo by Padurariu Alexandru. imageLink: https://unsplash.com/photos/ZKBQmgMyf8s category: Examples # Table of contents _Articles can have a table of contents_ <!-- toc --> <!-- tocstop --> ## How Adding a TOC is simple. There is two options Option 1 Just add <!-- t oc --> <!-- t ocstop --> somewhere in the md file (there shouldn't be a space between `t` and `oc`. It should just be `toc`, but writing so would insert a TOC!. Option 2 Or you could use the drawer as a TOC by adding toc: true to the front matter. Depending on screen size the TOC will either be shown or visible when you toggle it with the button in the bottom. You can read more about [content creation and front matter](/en/documentation/creating-content/front-matter/) in the documentation. ## Voluptatem accusantium doloremque Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Consectetur adipiscing elit Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Iste natus error Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. # consectetur Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ## adipiscing doloremque Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Consectetur adipiscing elit Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? elit natus error Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. exercitation Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. ## dolore magna Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur? Lorem ipsum dolor sit amet Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>Inter-component Interfaces: Class Members - Functions</title> <link href="hydoxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.2 --> <div class="tabs"> <ul> <li><a href="index.html"><span>Main&nbsp;Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Packages</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li> <li class="current"><a href="functions.html"><span>Class&nbsp;Members</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="functions.html"><span>All</span></a></li> <li class="current"><a href="functions_func.html"><span>Functions</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_type.html"><span>Typedefs</span></a></li> <li><a href="functions_enum.html"><span>Enumerations</span></a></li> <li><a href="functions_eval.html"><span>Enumerator</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="functions_func.html#index__"><span>_</span></a></li> <li><a href="functions_func_0x61.html#index_a"><span>a</span></a></li> <li><a href="functions_func_0x63.html#index_c"><span>c</span></a></li> <li><a href="functions_func_0x64.html#index_d"><span>d</span></a></li> <li><a href="functions_func_0x65.html#index_e"><span>e</span></a></li> <li class="current"><a href="functions_func_0x66.html#index_f"><span>f</span></a></li> <li><a href="functions_func_0x67.html#index_g"><span>g</span></a></li> <li><a href="functions_func_0x68.html#index_h"><span>h</span></a></li> <li><a href="functions_func_0x69.html#index_i"><span>i</span></a></li> <li><a href="functions_func_0x6a.html#index_j"><span>j</span></a></li> <li><a href="functions_func_0x6c.html#index_l"><span>l</span></a></li> <li><a href="functions_func_0x6d.html#index_m"><span>m</span></a></li> <li><a href="functions_func_0x6f.html#index_o"><span>o</span></a></li> <li><a href="functions_func_0x70.html#index_p"><span>p</span></a></li> <li><a href="functions_func_0x72.html#index_r"><span>r</span></a></li> <li><a href="functions_func_0x73.html#index_s"><span>s</span></a></li> <li><a href="functions_func_0x74.html#index_t"><span>t</span></a></li> <li><a href="functions_func_0x75.html#index_u"><span>u</span></a></li> <li><a href="functions_func_0x76.html#index_v"><span>v</span></a></li> <li><a href="functions_func_0x77.html#index_w"><span>w</span></a></li> <li><a href="functions_func_0x7e.html#index_~"><span>~</span></a></li> </ul> </div> <p> &nbsp; <p> <h3><a class="anchor" name="index_f">- f -</a></h3><ul> <li>FinishVMBootstrap() : <a class="el" href="struct_global___env.html#<API key>">Global_Env</a> </ul> <hr size="1"> <address style="text-align: center;"> <small> <p>Genereated on Tue Mar 11 19:25:24 2008 by Doxygen.</p> <p>(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable. </p> </small> </address> </body> </html>
package main import ( "encoding/csv" "io" "log" "os" "reflect" "strconv" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" "github.com/kelseyhightower/envconfig" "github.com/techsysfr/paastek-poc/bo" ) const prefix = "PAASTEK" type configuration struct { TableName string `envconfig:"tablename" required:"true"` } type ret struct { V bo.AWSBillingItem Err error } // parse a csv file and return an array of resources func parse(r io.Reader) chan ret { c := make(chan ret, 0) go func() { defer close(c) rd := csv.NewReader(r) var header []string header, err := rd.Read() if err != nil { c <- ret{bo.AWSBillingItem{}, err} } e := bo.AWSBillingItem{} et := reflect.TypeOf(e) var headers = make(map[string]int, et.NumField()) for i := 0; i < et.NumField(); i++ { headers[et.Field(i).Name] = func(element string, array []string) int { for k, v := range array { if v == element { return k } } return -1 }(et.Field(i).Tag.Get("csv"), header) } for { var e = bo.AWSBillingItem{} record, err := rd.Read() if err == io.EOF { break } if err != nil { c <- ret{bo.AWSBillingItem{}, err} } for h, i := range headers { if i == -1 { continue } elem := reflect.ValueOf(&e).Elem() field := elem.FieldByName(h) if field.CanSet() { switch field.Type().Name() { case "float64": a, _ := strconv.ParseFloat(record[i], 64) field.Set(reflect.ValueOf(a)) case "Time": a, _ := time.Parse("2006-01-02T00:00:00Z", record[i]) field.Set(reflect.ValueOf(a)) default: field.Set(reflect.ValueOf(record[i])) } } } c <- ret{e, nil} } }() return c } func main() { var config configuration err := envconfig.Process(prefix, &config) if err != nil { envconfig.Usage(prefix, &config) log.Fatal(err.Error()) } // Create the session for dynamodb sess, err := session.NewSession() if err != nil { log.Fatal("failed to create session,", err) } svc := dynamodb.New(sess, &aws.Config{Region: aws.String("us-east-1")}) c := parse(os.Stdin) for val := range c { item, err := dynamodbattribute.MarshalMap(val.V) if err != nil { log.Println(err) } params := &dynamodb.PutItemInput{ Item: item, TableName: aws.String(config.TableName), } // Now put the item, discarding the result _, err = svc.PutItem(params) if err != nil { // Print the error, cast err to awserr.Error to get the Code and // Message from an error. log.Println(err) } } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <title>Uses of Class org.apache.poi.util.StringUtil (POI API Documentation)</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.poi.util.StringUtil (POI API Documentation)"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/poi/util/StringUtil.html" title="class in org.apache.poi.util">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/poi/util//class-useStringUtil.html" target="_top">FRAMES</a></li> <li><a href="StringUtil.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <h2 title="Uses of Class org.apache.poi.util.StringUtil" class="title">Uses of Class<br>org.apache.poi.util.StringUtil</h2> </div> <div class="classUseContainer">No usage of org.apache.poi.util.StringUtil</div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/apache/poi/util/StringUtil.html" title="class in org.apache.poi.util">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>PREV</li> <li>NEXT</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/poi/util//class-useStringUtil.html" target="_top">FRAMES</a></li> <li><a href="StringUtil.html" target="_top">NO FRAMES</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <a name="skip-navbar_bottom"> </a></div> <p class="legalCopy"><small> <i>Copyright 2016 The Apache Software Foundation or its licensors, as applicable.</i> </small></p> </body> </html>
package com.xiaoguy.imageselector.ui; import android.app.Activity; import android.graphics.Bitmap; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.bumptech.glide.Glide; import com.bumptech.glide.request.animation.GlideAnimation; import com.bumptech.glide.request.target.SimpleTarget; import com.xiaoguy.imageselector.R; import com.xiaoguy.imageselector.activity.ImageViewerActivity; import com.xiaoguy.imageselector.util.ScreenUtil; import java.io.File; import uk.co.senab.photoview.PhotoView; import uk.co.senab.photoview.PhotoViewAttacher.OnPhotoTapListener; public class ImageViewerFragment extends Fragment { private static final String PATH = "path"; private String mPath; @Override public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); mPath = getArguments() != null ? getArguments().getString(PATH) : null; } @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View view = inflater.inflate(R.layout.<API key>, container, false); final PhotoView photoView = (PhotoView) view.findViewById(R.id.photoView); if (mPath == null) { photoView.setImageResource(R.drawable.shape_placeholder); return view; } Glide.with(this). load(new File(mPath)). asBitmap(). error(R.drawable.shape_placeholder). into(new SimpleTarget<Bitmap>(ScreenUtil.getScreenWidth(getActivity()), ScreenUtil.getScreenHeight(getActivity())) { @Override public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) { photoView.setImageBitmap(resource); } }); photoView.<API key>(new OnPhotoTapListener() { @Override public void onPhotoTap(View view, float x, float y) { Activity activity = getActivity(); if (activity instanceof ImageViewerActivity) { ((ImageViewerActivity) activity).toggleBarVisibility(); } } }); return view; } public static ImageViewerFragment newInstance(String path) { ImageViewerFragment imageViewerFragment = new ImageViewerFragment(); Bundle bundle = new Bundle(); bundle.putString(PATH, path); imageViewerFragment.setArguments(bundle); return imageViewerFragment; } }
body { width: 100%; height: 100%; font-family: Lora,"Helvetica Neue",Helvetica,Arial,sans-serif; color: #fff; background-color: #000; } html { width: 100%; height: 100%; } h1, h2, h3, h4, h5, h6 { margin: 0 0 35px; text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; letter-spacing: 1px; } p { margin: 0 0 25px; font-size: 18px; line-height: 1.5; } @media(min-width:768px) { p { margin: 0 0 35px; font-size: 20px; line-height: 1.6; } } a { color: #42dca3; -webkit-transition: all .2s ease-in-out; -moz-transition: all .2s ease-in-out; transition: all .2s ease-in-out; } a:hover, a:focus { text-decoration: none; color: #1d9b6c; } .light { font-weight: 400; } .navbar-custom { margin-bottom: 0; border-bottom: 1px solid rgba(255,255,255,.3); text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; background-color: #000; } .navbar-custom .navbar-brand { font-weight: 700; } .navbar-custom .navbar-brand:focus { outline: 0; } .navbar-custom .navbar-brand .navbar-toggle { padding: 4px 6px; font-size: 16px; color: #fff; } .navbar-custom .navbar-brand .navbar-toggle:focus, .navbar-custom .navbar-brand .navbar-toggle:active { outline: 0; } .navbar-custom a { color: #fff; } .navbar-custom .nav li a { -webkit-transition: background .3s ease-in-out; -moz-transition: background .3s ease-in-out; transition: background .3s ease-in-out; } .navbar-custom .nav li a:hover { outline: 0; color: rgba(255,255,255,.8); background-color: transparent; } .navbar-custom .nav li a:focus, .navbar-custom .nav li a:active { outline: 0; background-color: transparent; } .navbar-custom .nav li.active { outline: 0; } .navbar-custom .nav li.active a { background-color: rgba(255,255,255,.3); } .navbar-custom .nav li.active a:hover { color: #fff; } @media(min-width:768px) { .navbar-custom { padding: 20px 0; border-bottom: 0; letter-spacing: 1px; background: 0 0; -webkit-transition: background .5s ease-in-out,padding .5s ease-in-out; -moz-transition: background .5s ease-in-out,padding .5s ease-in-out; transition: background .5s ease-in-out,padding .5s ease-in-out; } .navbar-custom.top-nav-collapse { padding: 0; border-bottom: 1px solid rgba(255,255,255,.3); background: #000; } } .intro { display: table; width: 100%; height: auto; padding: 100px 0; text-align: center; color: #000; background: url(../img/intro-bg.png) no-repeat bottom center scroll; background-color: #fff; -<API key>: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; } .intro .intro-body { display: table-cell; vertical-align: middle; } .intro .intro-body .brand-heading { font-size: 40px; } .intro .intro-body .intro-text { font-size: 18px; } @media(min-width:768px) { .intro { height: 100%; padding: 0; } .intro .intro-body .brand-heading { font-size: 100px; } .intro .intro-body .intro-text { font-size: 26px; } } .btn-circle { width: 70px; height: 70px; margin-top: 15px; padding: 7px 16px; border: 2px solid #fff; border-radius: 100%!important; font-size: 40px; color: #fff; background: 0 0; -webkit-transition: background .3s ease-in-out; -moz-transition: background .3s ease-in-out; transition: background .3s ease-in-out; } .btn-circle:hover, .btn-circle:focus { outline: 0; color: #fff; background: rgba(255,255,255,.1); } .btn-circle i.animated { -<API key>: -webkit-transform; -<API key>: 1s; -<API key>: -moz-transform; -<API key>: 1s; } .btn-circle:hover i.animated { -<API key>: pulse; -moz-animation-name: pulse; -<API key>: 1.5s; -<API key>: 1.5s; -<API key>: infinite; -<API key>: infinite; -<API key>: linear; -<API key>: linear; } @-webkit-keyframes pulse { 0% { -webkit-transform: scale(1); transform: scale(1); } 50% { -webkit-transform: scale(1.2); transform: scale(1.2); } 100% { -webkit-transform: scale(1); transform: scale(1); } } @-moz-keyframes pulse { 0% { -moz-transform: scale(1); transform: scale(1); } 50% { -moz-transform: scale(1.2); transform: scale(1.2); } 100% { -moz-transform: scale(1); transform: scale(1); } } .content-section { padding-top: 100px; } .download-section { width: 100%; padding: 50px 0; color: #fff; background: url(../img/downloads-bg.jpg) no-repeat center center scroll; background-color: #000; -<API key>: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; } #map { width: 100%; height: 200px; margin-top: 100px; } @media(min-width:767px) { .content-section { padding-top: 250px; } .download-section { padding: 100px 0; } #map { height: 400px; margin-top: 250px; } } .btn { border-radius: 0; text-transform: uppercase; font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 400; -webkit-transition: all .3s ease-in-out; -moz-transition: all .3s ease-in-out; transition: all .3s ease-in-out; } .btn-default { border: 1px solid #42dca3; color: #42dca3; background-color: transparent; } .btn-default:hover, .btn-default:focus { border: 1px solid #42dca3; outline: 0; color: #000; background-color: #42dca3; } ul.<API key> { margin-top: 0; } @media(max-width:1199px) { ul.<API key> { margin-top: 15px; } } @media(max-width:767px) { ul.<API key> li { display: block; margin-bottom: 20px; padding: 0; } ul.<API key> li:last-child { margin-bottom: 0; } } footer { padding: 50px 0; } footer p { margin: 0; } ::-moz-selection { text-shadow: none; background: #fcfcfc; background: rgba(255,255,255,.2); } ::selection { text-shadow: none; background: #fcfcfc; background: rgba(255,255,255,.2); } img::selection { background: 0 0; } img::-moz-selection { background: 0 0; } body { <API key>: rgba(255,255,255,.2); }
{% load ead %} <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="/static/style/local.css" /> </head> <body> <div class="fa"> <h1> <a name="{{ ead.eadid }}"> {% if ead.archdesc.origination %}{{ ead.archdesc.origination|upper }}<br/>{% endif %} {{ ead.unittitle|format_ead }} </a> </h1> <div id="<API key>" class="no-margin"> {% with ead.file_desc.publication as publication %} <p>{{ publication.publisher }}</p> {% for line in publication.address.lines %} <p>{{ line }}</p> {% endfor %} {% endwith %} </div> {% include "fa/snippets/digital-content.html" %} <hr/> {% include "fa/snippets/description.html" %} {# NOTE: contol access section is not included in the PDF #} {# container list or series/subseries listing #} {% if ead.dsc.hasSeries %} {# list series/subseries here, display on separate page #} <div class="nextpage"> <h2><a name="dsc">{{ ead.dsc.head }}</a></h2> <ul> {% autoescape off %} {{ series|unordered_list }} {% endautoescape %} </ul> </div> {% else %} {% with ead.dsc as series %} <div class="nextpage"> <hr/> <h2><a name="dsc">{{ ead.dsc.head }}</a></h2> {% include "fa/snippets/containerlist.html" %} </div> {% endwith %} {% endif %} {% if ead.dsc.hasSeries %} {% for c01_series in ead.dsc.c %} <div class="nextpage"> {% with c01_series as series %} {% include "fa/snippets/series.html" %} {% endwith %} </div> {# container list is handled in series template; display subseries, if any #} {% if c01_series.hasSubseries %} <div class="subseries"> {% for c02_series in c01_series.c %} <div class="nextpage"> {% with c02_series as series %} {% include "fa/snippets/series.html" %} {% endwith %} </div> {% if c02_series.hasSubseries %} <div class="subseries"> {% for c03_series in c02_series.c %} <div class="nextpage"> {% with c03_series as series %} {% include "fa/snippets/series.html" %} {% endwith %} </div> {% endfor %} {# end looping through c03s #} </div> {% endif %} {# c02 has subseries #} {% endfor %} {# end looping through c02s #} </div> {% endif %} {# c01 has subseries #} {% endfor %} {# end looping through c01s #} <hr/> {% else %} {# simple finding aid - no series at all, just a container list #} <hr/> {% include "fa/snippets/containerlist.html" %} {% endif %} {% for index in ead.archdesc.index %} {% include "fa/snippets/indexentry.html" %} {% endfor %} </div> {# end div.fa #} {# header and footer contents #} <div id="firstpage-footer"> Emory Libraries provides copies of its finding aids for use only in research and private study. Copies supplied may not be copied for others or otherwise distributed without prior consent of the holding repository.</div> {# <div id="footer"> </div> #} <div id="header"> <table> <col width="65%" valign="top" align="left"/> {# column width needed for XSL-FO/PDF #} <col width="45%" valign="top" align="right"/> <tr> <td style="text-align:left">{{ ead.title|format_ead }}</td> <td style="text-align:right">{{ ead.archdesc.unitid }}</td> </tr> </table> </div> </body> </html>
package com.soussidev.kotlin.rx_java2_lib.RxAlertDialog.android; import android.content.Context; import android.support.annotation.NonNull; import com.soussidev.kotlin.rx_java2_lib.RxAlertDialog.<API key>; import com.soussidev.kotlin.rx_java2_lib.RxAlertDialog.<API key>; import com.soussidev.kotlin.rx_java2_lib.RxAlertDialog.AlertDialogEvent; import com.soussidev.kotlin.rx_java2_lib.RxAlertDialog.<API key>; import rx.Observable; import rx.android.schedulers.AndroidSchedulers; import rx.functions.Action1; public class RxAlertDialog { private RxAlertDialog() { throw new <API key>("No instance"); } public static class Builder extends <API key><Builder> { public Builder(@NonNull Context context) { super(context); } @NonNull @Override protected Builder self() { return this; } @NonNull public Observable<AlertDialogEvent> create() { return Observable.create(new <API key>( new <API key>(getContext()), Builder.this)) .subscribeOn(AndroidSchedulers.mainThread()); } @NonNull @Override public Observable<AlertDialogEvent> show() { return create() .doOnNext(new Action1<AlertDialogEvent>() { @Override public void call(AlertDialogEvent dialogEvent) { if (dialogEvent instanceof <API key>) { ((<API key>) dialogEvent).getDialog().show(); } } }); } } }
package eu.se_bastiaan.marietje.ui.adapters; import android.graphics.Color; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.TextView; import java.util.List; import static java.util.Collections.emptyList; import static java.util.Collections.unmodifiableList; public class <API key><T extends <API key>.SelectionOption> extends BaseAdapter { @NonNull private List<? extends T> selectionOptions = emptyList(); @NonNull private final LayoutInflater layoutInflater; public <API key>(@NonNull LayoutInflater layoutInflater) { this.layoutInflater = layoutInflater; } public <API key><T> setSelectionOptions(@NonNull List<? extends T> selectionOptions) { this.selectionOptions = unmodifiableList(selectionOptions); <API key>(); return this; } @Override public int getCount() { return selectionOptions.size(); } @Override @NonNull public T getItem(int position) { return selectionOptions.get(position); } @Override public long getItemId(int position) { return position; } @Override @NonNull public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { final ViewHolder viewHolder; if (convertView == null) { convertView = layoutInflater.inflate(android.R.layout.simple_spinner_item, parent, false); viewHolder = new ViewHolder(convertView); convertView.setBackgroundColor(Color.TRANSPARENT); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.bindItem(selectionOptions.get(position)); return convertView; } @Override @NonNull public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { final ViewHolder viewHolder; if (convertView == null) { convertView = layoutInflater.inflate(android.R.layout.<API key>, parent, false); viewHolder = new ViewHolder(convertView); convertView.setTag(viewHolder); } else { viewHolder = (ViewHolder) convertView.getTag(); } viewHolder.bindItem(selectionOptions.get(position)); return convertView; } static class ViewHolder { @NonNull private final TextView titleTextView; ViewHolder(@NonNull View itemView) { titleTextView = (TextView) itemView.findViewById(android.R.id.text1); itemView.setBackgroundColor(Color.BLACK); titleTextView.setTextColor(Color.WHITE); } public void bindItem(@NonNull SelectionOption selectionOption) { titleTextView.setText(selectionOption.getTitle()); } } public interface SelectionOption { @NonNull String getTitle(); } }
package com.travelport.schema.common_v29_0; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "typeRateDescription", propOrder = { "text" }) public class TypeRateDescription { @XmlElement(name = "Text", required = true) protected List<String> text; @XmlAttribute(name = "Name") protected String name; /** * Gets the value of the text property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the text property. * * <p> * For example, to add a new item, do as follows: * <pre> * getText().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link String } * * */ public List<String> getText() { if (text == null) { text = new ArrayList<String>(); } return this.text; } /** * Gets the value of the name property. * * @return * possible object is * {@link String } * */ public String getName() { return name; } /** * Sets the value of the name property. * * @param value * allowed object is * {@link String } * */ public void setName(String value) { this.name = value; } }