answer
stringlengths 15
1.25M
|
|---|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /ammon/images/sliders</title>
<meta charset="UTF-8"></head>
<body>
<h1>Index of /ammon/images/sliders</h1>
<ul><li><a href="../index.html"> Parent Directory</a></li>
<li><a href="./anything_slider/index.html"> anything_slider/</a></li>
<li><a href="./full_slider/index.html"> full_slider/</a></li>
<li><a href="./interactive_content/index.html"> interactive_content/</a></li>
<li><a href="./nivoslider/index.html"> nivoslider/</a></li>
<li><a href="./piecemaker/index.html"> piecemaker/</a></li>
<li><a href="./portfolio_showcase/index.html"> portfolio_showcase/</a></li>
<li><a href="./wowslider/index.html"> wowslider/</a></li>
</ul>
</body></html>
|
enum{V};
enum{K}ABC;
enum{Global = 10,Window}Type;
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'litleleprikon'
from random import randint
FIGURES = ['камень', 'бумага', 'ножницы']
FIG_LEN = len(FIGURES)
class Player:
"""
Player class is needed to store tactics and to generate figures by this tactic
-- Doctests --
player = Player()
player.figure in FIGURES
True
"""
def __init__(self, number: int):
self.name = 'игрок{}'.format(number)
tactic = randint(0, FIG_LEN-1)
self.main_figure = FIGURES[tactic]
self.__figures = [FIGURES[(tactic+i) % FIG_LEN] for i in range(FIG_LEN)]
def __str__(self):
return '{}: {}'.format(self.name, self.main_figure)
@property
def figure(self):
rand = randint(0, FIG_LEN)
return self.__figures[rand % FIG_LEN]
|
package site;
public class Autocomplete {
private final String label;
private final String value;
public Autocomplete(String label, String value) {
this.label = label;
this.value = value;
}
public final String getLabel() {
return this.label;
}
public final String getValue() {
return this.value;
}
}
|
Running the example
bash
gcloud builds submit --config=./cloudbuild.yaml
Note
This trivial example builds 2 binaries that share a Golang package `github.com/golang/glog`.
Because the cloudbuild.yaml shares a volume called `go-modules` across all steps, once the `glog` package is pulled for the first step (`Step #0`), it is available to be used by the second step. In practice, sharing immutable packages this way should significantly improve build times.
bash
BUILD
Starting Step
Step #0: Pulling image: golang:1.12
Step #0: 1.12: Pulling from library/golang
Step #0: Digest: sha256:<SHA256-like>
Step #0: Status: Downloaded newer image for golang:1.12
Step #0: go: finding github.com/golang/glog latest
Step #0: go: downloading github.com/golang/glog v0.0.<API key>
Step #0: go: extracting github.com/golang/glog v0.0.<API key>
Finished Step
Starting Step
Step #1: Already have image: golang:1.12
Finished Step
Starting Step
Step #2: Already have image: busybox
Step #2: total 4840
Step #2: -rwxr-xr-x 1 root root 2474479 Jul 10 23:59 bar
Step #2: -rwxr-xr-x 1 root root 2474479 Jul 10 23:59 foo
Finished Step
PUSH
DONE
If the `options` second were commented out and the `busybox` step removed (as it will fail), the output would show the second step repulling (unnecessarily) the `glog` package:
bash
BUILD
Starting Step
Step #0: Pulling image: golang:1.12
Step #0: 1.12: Pulling from library/golang
Step #0: Digest: sha256:<SHA256-like>
Step #0: Status: Downloaded newer image for golang:1.12
Step #0: go: finding github.com/golang/glog latest
Step #0: go: downloading github.com/golang/glog v0.0.<API key>
Step #0: go: extracting github.com/golang/glog v0.0.<API key>
Finished Step
Starting Step
Step #1: Already have image: golang:1.12
Step #1: go: finding github.com/golang/glog v0.0.<API key>
Step #1: go: downloading github.com/golang/glog v0.0.<API key>
Step #1: go: extracting github.com/golang/glog v0.0.<API key>
Finished Step
PUSH
DONE
This example also uses the Golang team's Module Mirror [https:
|
<?php
final class <API key>
extends <API key> {
public function register() {
$this->listen(<API key>::<API key>);
}
public function handleEvent(PhutilEvent $event) {
switch ($event->getType()) {
case <API key>::<API key>:
$this->handleActionsEvent($event);
break;
}
}
private function handleActionsEvent(PhutilEvent $event) {
$object = $event->getValue('object');
$actions = null;
if ($object instanceof <API key>) {
$actions = $this-><API key>($event);
}
$this->addActionMenuItems($event, $actions);
}
private function <API key>(PhutilEvent $event) {
if (!$this->canUseApplication($event->getUser())) {
return null;
}
$revision = $event->getValue('object');
$repository = $revision->getRepository();
if ($repository === null) {
return null;
}
$strategies = id(new PhutilSymbolLoader())
->setAncestorClass('<API key>')
->loadObjects();
foreach ($strategies as $strategy) {
$actions = $strategy->createMenuItems(
$event->getUser(),
$revision,
$repository);
$this->addActionMenuItems($event, $actions);
}
}
}
|
{-# LANGUAGE OverloadedStrings #-}
module Mdb.Status ( doStatus ) where
import Control.Monad ( when )
import Control.Monad.Catch (MonadMask)
import Control.Monad.IO.Class ( MonadIO, liftIO )
import Control.Monad.Logger ( logWarnN, logDebugN, logInfoN )
import Control.Monad.Reader ( ask )
import qualified Database.SQLite.Simple as SQL
import Data.Monoid ( (<>) )
import qualified Data.Text as T
import System.IO.Error ( tryIOError )
import System.Posix.Files ( getFileStatus, <API key> )
import Mdb.CmdLine ( OptStatus(..) )
import Mdb.Database ( MDB, dbExecute, runMDB', withConnection )
import Mdb.Types ( FileId )
doStatus :: (MonadMask m, MonadIO m) => OptStatus -> MDB m ()
doStatus = withFilesSeq . checkFile
type FileInfo = (FileId, FilePath)
withFilesSeq :: (MonadIO m, MonadMask m) => (FileInfo -> MDB IO ()) -> MDB m ()
withFilesSeq f = withConnection $ \c -> do
mdb <- ask
liftIO $ SQL.withStatement c "SELECT file_id, file_name FROM file ORDER BY file_id" $ \stmt ->
let
go = SQL.nextRow stmt >>= \mfi -> case mfi of
Nothing -> return ()
Just fi -> (runMDB' mdb $ f fi) >> go
in go
checkFile :: (MonadIO m, MonadMask m) => OptStatus -> FileInfo -> MDB m ()
checkFile op (fid, fp) = do
efs <- liftIO $ tryIOError $ getFileStatus fp
case efs of
Left ioe -> do
logWarnN $ T.pack ( show ioe )
when (removeMissing op) $ do
logInfoN $ "removing file with ID " <> (T.pack $ show fid)
dbExecute "DELETE FROM file WHERE file_id = ?" (SQL.Only fid)
Right fs -> logDebugN $ T.pack (show $ <API key> fs)
|
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a
# complete input. You can remove any component from the
# wrapper, change the order or even add your own to the
# stack. The options given below are used to wrap the
# whole input.
config.wrappers :default, class: :input,
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
## Extensions enabled by default
# Any of these extensions can be disabled for a
# given input by passing: `f.input EXTENSION_NAME => false`.
# You can make any of these extensions optional by
# renaming `b.use` to `b.optional`.
# Determines whether to use HTML5 (:email, :url, ...)
# and required attributes
b.use :html5
# Calculates placeholders automatically from I18n
# You can also pass a string as f.input placeholder: "Placeholder"
b.use :placeholder
## Optional extensions
# They are disabled unless you pass `f.input EXTENSION_NAME => :lookup`
# to the input. If so, they will retrieve the values from the model
# if any exists. If you want to enable the lookup for any of those
# extensions by default, you can change `b.optional` to `b.use`.
# Calculates maxlength from length validations for string inputs
b.optional :maxlength
# Calculates pattern from format validations for string inputs
b.optional :pattern
# Calculates min and max from length validations for numeric inputs
b.optional :min_max
# Calculates readonly automatically from readonly attributes
b.optional :readonly
## Inputs
b.use :label_input
b.use :hint, wrap_with: { tag: :span, class: :hint }
b.use :error, wrap_with: { tag: :span, class: :error }
end
# The default wrapper to be used by the FormBuilder.
config.default_wrapper = :default
# Define the way to render check boxes / radio buttons with labels.
# Defaults to :nested for bootstrap config.
# inline: input + label
# nested: label > input
config.boolean_style = :inline
# Default class for buttons
config.button_class = 'btn'
# Method used to tidy up errors. Specify any Rails Array method.
# :first lists the first message for each field.
# Use :to_sentence to list all errors for each field.
# config.error_method = :first
# Default tag used for error notification helper.
config.<API key> = :div
# CSS class to add for error notification helper.
config.<API key> = 'alert alert-error'
# ID to add for error notification helper.
# config.<API key> = nil
# Series of attempts to detect a default label method for collection.
# config.<API key> = [ :to_label, :name, :title, :to_s ]
# Series of attempts to detect a default value method for collection.
# config.<API key> = [ :id, :to_s ]
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
# config.<API key> = nil
# You can define the class to use on all collection wrappers. Defaulting to none.
# config.<API key> = nil
# You can wrap each item in a collection of radio/check boxes with a tag,
# defaulting to :span. Please note that when using :boolean_style = :nested,
# SimpleForm will force this option to be a label.
# config.item_wrapper_tag = :span
# You can define a class to use in all item wrappers. Defaulting to none.
config.item_wrapper_class = nil
# How the label text should be generated altogether with the required text.
# config.label_text = lambda { |label, required| "#{required} #{label}" }
# You can define the class to use on all labels. Default is nil.
config.label_class = 'control-label'
# You can define the class to use on all forms. Default is simple_form.
# config.form_class = :simple_form
# You can define which elements should obtain additional classes
# config.<API key> = [:wrapper, :label, :input]
# Whether attributes are required by default (or not). Default is true.
# config.required_by_default = true
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
# These validations are enabled in SimpleForm's internal config but disabled by default
# in this configuration, which is recommended due to some quirks from different browsers.
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
# change this configuration to true.
config.browser_validations = false
# Collection of methods to detect if a file type was given.
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
# Custom mappings for input types. This should be a hash containing a regexp
# to match as key, and the input type that will be used when the field name
# matches the regexp as value.
# config.input_mappings = { /count/ => :integer }
# Custom wrappers for input types. This should be a hash containing an input
# type as key and the wrapper that will be used for all inputs with specified type.
# config.wrapper_mappings = { string: :prepend }
# Default priority for time_zone inputs.
# config.time_zone_priority = nil
# Default priority for country inputs.
# config.country_priority = nil
# When false, do not use translations for labels.
# config.translate_labels = true
# Automatically discover new inputs in Rails' autoload path.
# config.inputs_discovery = true
# Cache SimpleForm inputs discovery
# config.cache_discovery = !Rails.env.development?
# Default class for inputs
# config.input_class = ni
config.wrappers :checkbox, tag: :div, class: "algo", error_class: "has-error" do |b|
b.use :html5
b.wrapper tag: :div do |ba|
ba.use :input
ba.use :label_text
end
b.use :hint, wrap_with: { tag: :p, class: "help-block" }
b.use :error, wrap_with: { tag: :span, class: "help-block text-danger" }
end
end
|
# AUTOGENERATED FILE
FROM balenalib/<API key>:bookworm-run
ENV NODE_VERSION 12.22.9
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 keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& apt-get update && apt-get install -y $buildDeps --<API key> \
|
# AUTOGENERATED FILE
FROM balenalib/photon-nano-debian:stretch-run
# remove several traces of debian python
RUN apt-get purge -y python.*
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# install python dependencies
RUN apt-get update && apt-get install -y --<API key> \
ca-certificates \
netbase \
|
// TweetComposer.h
#import <Foundation/Foundation.h>
#import <Cordova/CDVPlugin.h>
#import <Social/Social.h>
#import <Accounts/Accounts.h>
@interface BundleIdentifier : CDVPlugin {
NSMutableDictionary* callbackIds;
// NSString * phoneNumber;
// NSString * messageText;
}
@property (nonatomic, retain) NSMutableDictionary* callbackIds;
//@property (nonatomic, retain) NSString *phoneNumber;
//@property (nonatomic, retain) NSString *messageText;
- (void)get:(<API key>*)command;
@end
|
import math
def isPrime(num):
if num < 2:
return False # 0, 1
# num100, 50. 60 * ? = 100, , sqrt(),
boundary = int(math.sqrt(num)) + 1
for i in range(2, boundary):
if num % i == 0:
return False
return True
def primeSieve(size):
sieve = [True] * size # , False
sieve[0] = False
sieve[1] = True
# num100, 50. 60 * ? = 100, , sqrt(),
boundary = int(math.sqrt(size)) + 1
for i in range(2, boundary):
pointer = i * 2 # startPosition. 3, 3, 6,9, 12, ...
while pointer < size:
sieve[pointer] = False
pointer += i
ret = [] # contains all the prime number within "size"
for i in range(size):
if sieve[i] == True:
ret.append(str(i))
return ret
if __name__ == '__main__':
primes = primeSieve(100)
primesString = ", ".join(primes)
print("prime : ", primesString)
'''
prime : 1, 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97
'''
|
package pl.touk.nussknacker.engine.management.sample.signal
import java.nio.charset.StandardCharsets
import io.circe.generic.JsonCodec
import io.circe.generic.extras.ConfiguredJsonCodec
import pl.touk.nussknacker.engine.api.CirceUtil._
import pl.touk.nussknacker.engine.flink.util.source.<API key>
object Signals {
@JsonCodec case class SampleProcessSignal(processId: String, timestamp: Long, action: SignalAction)
//Note: due to some problems with circe (https://circe.github.io/circe/codecs/known-issues.html#<API key>)
// and scala 2.11 this definition should be *before* SignalAction. This problem occurs during doc generation...
case class RemoveLock(lockId: String) extends SignalAction {
override def key: String = lockId
}
@ConfiguredJsonCodec sealed trait SignalAction {
def key: String
}
}
object SignalSchema {
import Signals._
import org.apache.flink.streaming.api.scala._
val <API key> = new <API key>[SampleProcessSignal](jsonBytes => decodeJsonUnsafe[SampleProcessSignal](jsonBytes))
}
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_07) on Sat Aug 23 20:46:18 CST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class org.xclcharts.renderer.LnChart</title>
<meta name="date" content="2014-08-23">
<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.xclcharts.renderer.LnChart";
}
</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/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">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-files/index-1.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/xclcharts/renderer/class-use/LnChart.html" target="_top">Frames</a></li>
<li><a href="LnChart.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.xclcharts.renderer.LnChart" class="title">Uses of Class<br>org.xclcharts.renderer.LnChart</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">LnChart</a></span><span class="tabEnd"> </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.xclcharts.chart">org.xclcharts.chart</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.xclcharts.chart">
</a>
<h3>Uses of <a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">LnChart</a> in <a href="../../../../org/xclcharts/chart/package-summary.html">org.xclcharts.chart</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation">
<caption><span>Subclasses of <a href="../../../../org/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">LnChart</a> in <a href="../../../../org/xclcharts/chart/package-summary.html">org.xclcharts.chart</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/xclcharts/chart/AreaChart.html" title="class in org.xclcharts.chart">AreaChart</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/xclcharts/chart/LineChart.html" title="class in org.xclcharts.chart">LineChart</a></strong></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../org/xclcharts/chart/SplineChart.html" title="class in org.xclcharts.chart">SplineChart</a></strong></code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</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/xclcharts/renderer/LnChart.html" title="class in org.xclcharts.renderer">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-files/index-1.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/xclcharts/renderer/class-use/LnChart.html" target="_top">Frames</a></li>
<li><a href="LnChart.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>
</body>
</html>
|
import Ember from 'ember';
const DELAY = 100;
export default Ember.Component.extend({
classNameBindings : ['inlineBlock:inline-block','clip:clip'],
tooltipService : Ember.inject.service('tooltip'),
inlineBlock : true,
clip : false,
model : null,
size : 'default',
ariaRole : ['tooltip'],
textChangedEvent : null,
showTimer : null,
textChanged: Ember.observer('textChangedEvent', function() {
this.show(this.get('textChangedEvent'));
}),
mouseEnter(evt) {
if ( !this.get('tooltipService.requireClick') )
{
let tgt = Ember.$(evt.currentTarget);
if (this.get('tooltipService.tooltipOpts')) {
this.set('tooltipService.tooltipOpts', null);
}
// Wait for a little bit of time so that the mouse can pass through
// another tooltip-element on the way to the dropdown trigger of a
// tooltip-action-menu without changing the tooltip.
this.set('showTimer', Ember.run.later(() => {
this.show(tgt);
}, DELAY));
}
},
show(node) {
if ( this._state === 'destroying' )
{
return;
}
let svc = this.get('tooltipService');
this.set('showTimer', null);
svc.cancelTimer();
let out = {
type : this.get('type'),
baseClass : this.get('baseClass'),
eventPosition : node.offset(),
originalNode : node,
model : this.get('model'),
template : this.get('tooltipTemplate'),
};
if ( this.get('isCopyTo') ) {
out.isCopyTo = true;
}
svc.set('tooltipOpts', out);
},
mouseLeave: function() {
if (!this.get('tooltipService.<API key>')) {
if ( this.get('showTimer') ) {
Ember.run.cancel(this.get('showTimer'));
}
else {
this.get('tooltipService').leave();
}
}
},
modelObserver: Ember.observer('model', 'textChangedEvent', function() {
let opts = this.get('tooltipService.tooltipOpts');
if (opts) {
this.set('tooltipService.tooltipOpts.model', this.get('model'));
}
})
});
|
package com.altas.<API key>.model;
import java.io.Serializable;
/**
* @author Altas
* @email Altas.TuTu@gmail.com
* @date 2014927
*/
public class UserInfo implements Serializable {
private static final long serialVersionUID = <API key>;
public int id;
public String token;
public String userName;
public String headImg;
public String phoneNum;
public double balance;
public int integral;
public UserInfo(){}
public UserInfo(int i,String t,String un,String hi,String pn,double b,int point){
id=i;
token=t;
userName = un;
headImg = hi;
phoneNum = pn;
balance = b;
integral = point;
}
}
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Http;
using AutoMapper;
using Art.Domain;
namespace Art.Rest.v1
{
// Generated 07/20/2013 16:40:13
// Change code for each method
public class UsersController : BaseApiController
{
// GET Collection
[HttpGet]
public IEnumerable<ApiUser> Get(string expand = "")
{
return new List<ApiUser>();
}
// GET Single
[HttpGet]
public ApiUser Get(int? id, string expand = "")
{
return new ApiUser();
}
// POST = Insert
[HttpPost]
public ApiUser Post([FromBody] ApiUser apiuser)
{
return apiuser;
}
// PUT = Update
[HttpPut]
public ApiUser Put(int? id, [FromBody] ApiUser apiuser)
{
return apiuser;
}
// DELETE
[HttpDelete]
public ApiUser Delete(int? id)
{
return new ApiUser();
}
}
}
|
<?php
if (!defined('ACTIVE')) die(__FILE__);
$oldname = isset($_REQUEST['oldname'])? $_REQUEST['oldname'] : '';
$oldname = substr($oldname,1);
$newname = isset($_REQUEST['filename'])? $_REQUEST['filename'] : '';
if ($oldname=='') setErrorCode(4);
if (!file_exists($path.'/'.$oldname)) setErrorCode(1);
if ($newname=='') setErrorCode(4);
if (file_exists($path.'/'.$newname)) setErrorCode(2);
if ($errCode==0) @rename($path.'/'.$oldname,$path.'/'.$newname);
$params = array(
'cmd' => 'list',
'sort' => $sort,
'path' => urlencode($path)
);
if ($errCode!=0) $params['error'] = $errCode;
$LOCATION = 'index.php?'.buildQuery($params);
?>
|
package com.hzh.corejava.proxy;
public class SpeakerExample {
public static void main(String[] args) {
AiSpeaker speaker = (AiSpeaker) AuthenticationProxy.newInstance(new XiaoaiAiSpeeker());
speaker.greeting();
}
}
|
# Zulip-specific tools
This article documents several useful tools that can save you a lot of
time when working with Git on the Zulip project.
## Set up git repo script
**Extremely useful**. In the `tools` directory of
[zulip/zulip][github-zulip-zulip] you'll find a bash script
`setup-git-repo`. This script installs a pre-commit hook, which will
run each time you `git commit` to automatically run
[Zulip's linter suite](../testing/linters.html) on just the files that
the commit modifies (which is really fast!). The hook passes no matter
the result of the linter, but you should still pay attention to any
notices or warnings it displays.
It's simple to use. Make sure you're in the clone of zulip and run the following:
$ ./tools/setup-git-repo
The script doesn't produce any output if successful. To check that the hook has
been installed, print a directory listing for `.git/hooks` and you should see
something similar to:
$ ls -l .git/hooks
pre-commit -> ../../tools/pre-commit
## Set up Travis CI integration
You might also wish to [configure your fork for use with Travis CI][<API key>].
## Reset to pull request
`tools/<API key>` is a short-cut for [checking out a pull request
locally][<API key>]. It works slightly differently from the method
described above in that it does not create a branch for the pull request
checkout.
**This tool checks for uncommitted changes, but it will move the
current branch using `git reset --hard`. Use with caution.**
First, make sure you are working in a branch you want to move (in this
example, we'll use the local `master` branch). Then run the script
with the ID number of the pull request as the first argument.
$ git checkout master
Switched to branch 'master'
Your branch is up-to-date with 'origin/master'.
$ ./tools/<API key> 1900
+ request_id=1900
+ git fetch upstream pull/1900/head
remote: Counting objects: 159, done.
remote: Compressing objects: 100% (17/17), done.
remote: Total 159 (delta 94), reused 91 (delta 91), pack-reused 51
Receiving objects: 100% (159/159), 55.57 KiB | 0 bytes/s, done.
Resolving deltas: 100% (113/113), completed with 54 local objects.
From https://github.com/zulip/zulip
* branch refs/pull/1900/head -> FETCH_HEAD
+ git reset --hard FETCH_HEAD
HEAD is now at 2bcd1d8 troubleshooting tip about provisioning
## Fetch a pull request and rebase
`tools/<API key>` is a short-cut for [checking out a pull
request locally][<API key>] in its own branch and then updating it with any
changes from upstream/master with `git rebase`.
Run the script with the ID number of the pull request as the first argument.
$ tools/<API key> 1913
+ request_id=1913
+ git fetch upstream pull/1913/head
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), done.
From https://github.com/zulip/zulip
* branch refs/pull/1913/head -> FETCH_HEAD
+ git checkout upstream/master -b review-1913
Branch review-1913 set up to track remote branch master from upstream.
Switched to a new branch 'review-1913'
+ git reset --hard FETCH_HEAD
HEAD is now at 99aa2bf Add provision.py fails issue in common erros
+ git pull --rebase
Current branch review-1913 is up to date.
## Fetch a pull request without rebasing
`tools/fetch-pull-request` is a similar to `tools/<API key>`, but
it does not rebase the pull request against upstream/master, thereby getting
exactly the same repository state as the commit author had.
Run the script with the ID number of the pull request as the first argument.
$ tools/fetch-pull-request 5156
+ git diff-index --quiet HEAD
+ request_id=5156
+ remote=upstream
+ git fetch upstream pull/5156/head
From https://github.com/zulip/zulip
* branch refs/pull/5156/head -> FETCH_HEAD
+ git checkout -B <API key>
Switched to a new branch '<API key>'
+ git reset --hard FETCH_HEAD
HEAD is now at 5a1e982 tools: Update clean-branches to clean review branches.
## Delete unimportant branches
`tools/clean-branches` is a shell script that removes branches that are either:
1. Local branches that are ancestors of origin/master.
2. Branches in origin that are ancestors of origin/master and named like `$USER-*`.
3. Review branches created by `tools/<API key>` and `tools/fetch-pull-request`.
First, make sure you are working in branch `master`. Then run the script without any
arguments for default behavior. Since removing review branches can inadvertently remove any
feature branches whose names are like `review-*`, it is not done by default. To
use it, run `tools/clean-branches --reviews`.
$ tools/clean-branches --reviews
Deleting local branch <API key> (was 5a1e982)
## Merge conflict on yarn.lock file
If there is a merge conflict on yarn.lock, yarn should be run to
regenerate the file. *Important* don't delete the yarn.lock file. Checkout the
latest one from origin/master so that yarn knows the previous asset versions.
Run the following commands
git checkout origin/master -- yarn.lock
yarn install
git add yarn.lock
git rebase --continue
[github-zulip-zulip]: https://github.com/zulip/zulip/
[<API key>]: ../git/collaborate.html#<API key>
[<API key>]: ../git/cloning.html#<API key>
|
package io.skysail.server.queryfilter.nodes.test;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import org.junit.Ignore;
import org.junit.Test;
import io.skysail.domain.Entity;
import io.skysail.server.domain.jvm.FieldFacet;
import io.skysail.server.domain.jvm.facets.NumberFacet;
import io.skysail.server.domain.jvm.facets.YearFacet;
import io.skysail.server.filter.ExprNode;
import io.skysail.server.filter.FilterVisitor;
import io.skysail.server.filter.Operation;
import io.skysail.server.filter.PreparedStatement;
import io.skysail.server.filter.SqlFilterVisitor;
import io.skysail.server.queryfilter.nodes.LessNode;
import lombok.Data;
public class LessNodeTest {
@Data
public class SomeEntity implements Entity {
private String id, A, B;
}
@Test
public void <API key>() {
LessNode lessNode = new LessNode("A", 0);
assertThat(lessNode.getOperation(),is(Operation.LESS));
assertThat(lessNode.isLeaf(),is(true));
}
@Test
public void listConstructor_creates_node_with_AND_operation_and_assigns_the_children_parameter() {
LessNode lessNode = new LessNode("A", 0);
assertThat(lessNode.getOperation(),is(Operation.LESS));
}
@Test
public void <API key>() {
LessNode lessNode = new LessNode("A", 0);
assertThat(lessNode.asLdapString(),is("(A<0)"));
}
@Test
public void <API key>() {
LessNode lessNode = new LessNode("A", 0);
assertThat(lessNode.toString(),is("(A<0)"));
}
@Test
public void <API key>() {
LessNode lessNode = new LessNode("A", 0);
Map<String, String> config = new HashMap<>();
config.put("BORDERS", "1");
assertThat(lessNode.reduce("(A<0)", new NumberFacet("A",config), null).asLdapString(),is(""));
}
@Test
public void <API key>() {
LessNode lessNode = new LessNode("A", 0);
assertThat(lessNode.reduce("b",null, null).asLdapString(),is("(A<0)"));
}
@Test
public void <API key>() {
LessNode lessNode = new LessNode("A", 0);
Map<String, FieldFacet> facets = new HashMap<>();
PreparedStatement <API key> = (PreparedStatement) lessNode.accept(new SqlFilterVisitor(facets));
assertThat(<API key>.getParams().get("A"),is("0"));
assertThat(<API key>.getSql(), is("A<:A"));
}
@Test
public void <API key>() {
LessNode lessNode = new LessNode("A", 0);
Map<String, FieldFacet> facets = new HashMap<>();
Map<String, String> config = new HashMap<>();
facets.put("A", new YearFacet("A", config));
PreparedStatement <API key> = (PreparedStatement) lessNode.accept(new SqlFilterVisitor(facets));
assertThat(<API key>.getParams().get("A"),is("0"));
assertThat(<API key>.getSql(), is("A.format('YYYY')<:A"));
}
// @Test
// public void evaluateEntity() {
// LessNode lessNode = new LessNode("A", 0);
// Map<String, FieldFacet> facets = new HashMap<>();
// Map<String, String> config = new HashMap<>();
// facets.put("A", new YearFacet("A", config));
// SomeEntity someEntity = new SomeEntity();
// someEntity.setA(0);
// someEntity.setB("b");
// <API key> <API key> = new <API key>(someEntity, facets);
// boolean evaluateEntity = lessNode.evaluateEntity(<API key>);
// assertThat(evaluateEntity,is(false));
@Test
@Ignore
public void getSelected() {
LessNode lessNode = new LessNode("A", 0);
FieldFacet facet = new YearFacet("id", Collections.emptyMap());
Iterator<String> iterator = lessNode.getSelected(facet,Collections.emptyMap()).iterator();
assertThat(iterator.next(),is("0"));
}
@Test
public void getKeys() {
LessNode lessNode = new LessNode("A", 0);
assertThat(lessNode.getKeys().size(),is(1));
Iterator<String> iterator = lessNode.getKeys().iterator();
assertThat(iterator.next(),is("A"));
}
@Test
public void accept() {
LessNode lessNode = new LessNode("A", 0);
assertThat(lessNode.accept(new FilterVisitor() {
@Override
public String visit(ExprNode node) {
return ".";
}
}),is("."));
}
}
|
package mat.model;
import com.google.gwt.user.client.rpc.IsSerializable;
/**
* The Class SecurityRole.
*/
public class SecurityRole implements IsSerializable {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The Constant ADMIN_ROLE. */
public static final String ADMIN_ROLE = "Administrator";
/** The Constant USER_ROLE. */
public static final String USER_ROLE = "User";
/** The Constant SUPER_USER_ROLE. */
public static final String SUPER_USER_ROLE = "Super user";
/** The Constant ADMIN_ROLE_ID. */
public static final String ADMIN_ROLE_ID = "1";
/** The Constant USER_ROLE_ID. */
public static final String USER_ROLE_ID = "2";
/** The Constant SUPER_USER_ROLE_ID. */
public static final String SUPER_USER_ROLE_ID = "3";
/** The id. */
private String id;
/** The description. */
private String description;
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* Sets the id.
*
* @param id
* the new id
*/
public void setId(String id) {
this.id = id;
}
/**
* Gets the description.
*
* @return the description
*/
public String getDescription() {
return description;
}
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(String description) {
this.description = description;
}
}
|
package com.gaojun.appmarket.ui.view;
import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import com.gaojun.appmarket.R;
public class RationLayout extends FrameLayout {
private float ratio;
public RationLayout(Context context) {
super(context);
initView();
}
public RationLayout(Context context, AttributeSet attrs) {
super(context, attrs);
initView();
TypedArray array = context.<API key>(attrs, R.styleable.RationLayout);
int n = array.length();
for (int i = 0; i < n; i++) {
switch (i){
case R.styleable.RationLayout_ratio:
ratio = array.getFloat(R.styleable.RationLayout_ratio,-1);
break;
}
}
array.recycle();
}
public RationLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = MeasureSpec.getSize(widthMeasureSpec);
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
int height = MeasureSpec.getSize(heightMeasureSpec);
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
if (widthMode == MeasureSpec.EXACTLY && heightMode != MeasureSpec.EXACTLY &&
ratio>0){
int imageWidth = width - getPaddingLeft() - getPaddingRight();
int imageHeight = (int) (imageWidth/ratio);
height = imageHeight + getPaddingTop() + getPaddingBottom();
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height,MeasureSpec.EXACTLY);
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
private void initView() {
}
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<html xmlns="http:
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pandas.Series.memory_usage — pandas 0.24.0.dev0+81.g8d5032a8c.dirty documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript" id="<API key>" data-url_root="../" src="../_static/<API key>.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=<API key>"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="pandas.Series.min" href="pandas.Series.min.html" />
<link rel="prev" title="pandas.Series.median" href="pandas.Series.median.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="pandas.Series.min.html" title="pandas.Series.min"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="pandas.Series.median.html" title="pandas.Series.median"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pandas 0.24.0.dev0+81.g8d5032a8c.dirty documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../api.html" >API Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="pandas.Series.html" accesskey="U">pandas.Series</a> »</li>
</ul>
</div>
<div class="content-wrapper">
<div class="content">
<div class="document">
<div class="sphinxsidebar">
<h3>Table Of Contents</h3>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../whatsnew.html">What’s New</a></li>
<li class="toctree-l1"><a class="reference internal" href="../install.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing to pandas</a></li>
<li class="toctree-l1"><a class="reference internal" href="../overview.html">Package overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../10min.html">10 Minutes to pandas</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tutorials.html">Tutorials</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cookbook.html">Cookbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dsintro.html">Intro to Data Structures</a></li>
<li class="toctree-l1"><a class="reference internal" href="../basics.html">Essential Basic Functionality</a></li>
<li class="toctree-l1"><a class="reference internal" href="../text.html">Working with Text Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="../options.html">Options and Settings</a></li>
<li class="toctree-l1"><a class="reference internal" href="../indexing.html">Indexing and Selecting Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="../advanced.html">MultiIndex / Advanced Indexing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../computation.html">Computational tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../missing_data.html">Working with missing data</a></li>
<li class="toctree-l1"><a class="reference internal" href="../groupby.html">Group By: split-apply-combine</a></li>
<li class="toctree-l1"><a class="reference internal" href="../merging.html">Merge, join, and concatenate</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reshaping.html">Reshaping and Pivot Tables</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timeseries.html">Time Series / Date functionality</a></li>
<li class="toctree-l1"><a class="reference internal" href="../timedeltas.html">Time Deltas</a></li>
<li class="toctree-l1"><a class="reference internal" href="../categorical.html">Categorical Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="../visualization.html">Visualization</a></li>
<li class="toctree-l1"><a class="reference internal" href="../style.html">Styling</a></li>
<li class="toctree-l1"><a class="reference internal" href="../io.html">IO Tools (Text, CSV, HDF5, …)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../enhancingperf.html">Enhancing Performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sparse.html">Sparse data structures</a></li>
<li class="toctree-l1"><a class="reference internal" href="../gotchas.html">Frequently Asked Questions (FAQ)</a></li>
<li class="toctree-l1"><a class="reference internal" href="../r_interface.html">rpy2 / R interface</a></li>
<li class="toctree-l1"><a class="reference internal" href="../ecosystem.html">pandas Ecosystem</a></li>
<li class="toctree-l1"><a class="reference internal" href="../comparison_with_r.html">Comparison with R / R libraries</a></li>
<li class="toctree-l1"><a class="reference internal" href="../comparison_with_sql.html">Comparison with SQL</a></li>
<li class="toctree-l1"><a class="reference internal" href="../comparison_with_sas.html">Comparison with SAS</a></li>
<li class="toctree-l1"><a class="reference internal" href="../<API key>.html">Comparison with Stata</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../api.html">API Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../api.html#input-output">Input/Output</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#general-functions">General functions</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../api.html#series">Series</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../api.html#constructor">Constructor</a></li>
<li class="toctree-l3 current"><a class="reference internal" href="../api.html#attributes">Attributes</a><ul class="current">
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.index.html">pandas.Series.index</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.values.html">pandas.Series.values</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.dtype.html">pandas.Series.dtype</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.ftype.html">pandas.Series.ftype</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.shape.html">pandas.Series.shape</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.nbytes.html">pandas.Series.nbytes</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.ndim.html">pandas.Series.ndim</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.size.html">pandas.Series.size</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.strides.html">pandas.Series.strides</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.itemsize.html">pandas.Series.itemsize</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.base.html">pandas.Series.base</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.T.html">pandas.Series.T</a></li>
<li class="toctree-l4 current"><a class="current reference internal" href="#">pandas.Series.memory_usage</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.hasnans.html">pandas.Series.hasnans</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.flags.html">pandas.Series.flags</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.empty.html">pandas.Series.empty</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.dtypes.html">pandas.Series.dtypes</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.ftypes.html">pandas.Series.ftypes</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.data.html">pandas.Series.data</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.is_copy.html">pandas.Series.is_copy</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.name.html">pandas.Series.name</a></li>
<li class="toctree-l4"><a class="reference internal" href="pandas.Series.put.html">pandas.Series.put</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#conversion">Conversion</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#indexing-iteration">Indexing, iteration</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Binary operator functions</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Function application, GroupBy & Window</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Computations / Descriptive Stats</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Reindexing / Selection / Label manipulation</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Missing data handling</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#reshaping-sorting">Reshaping, sorting</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Combining / joining / merging</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#time-series-related">Time series-related</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Datetimelike Properties</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#string-handling">String handling</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#categorical">Categorical</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#plotting">Plotting</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#<API key>">Serialization / IO / Conversion</a></li>
<li class="toctree-l3"><a class="reference internal" href="../api.html#sparse">Sparse</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#dataframe">DataFrame</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#panel">Panel</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#index">Index</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#numeric-index">Numeric Index</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#categoricalindex">CategoricalIndex</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#intervalindex">IntervalIndex</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#multiindex">MultiIndex</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#datetimeindex">DatetimeIndex</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#timedeltaindex">TimedeltaIndex</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#periodindex">PeriodIndex</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#scalars">Scalars</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#frequencies">Frequencies</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#window">Window</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#groupby">GroupBy</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#resampling">Resampling</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#style">Style</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#id43">Plotting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#<API key>">General utility functions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../api.html#extensions">Extensions</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../developer.html">Developer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../internals.html">Internals</a></li>
<li class="toctree-l1"><a class="reference internal" href="../extending.html">Extending Pandas</a></li>
<li class="toctree-l1"><a class="reference internal" href="../release.html">Release Notes</a></li>
</ul>
<h3 style="margin-top: 1.5em;">Search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18"/>
<input type="submit" value="Go"/>
<input type="hidden" name="check_keywords" value="yes"/>
<input type="hidden" name="area" value="default"/>
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="<API key>">
<h1>pandas.Series.memory_usage<a class="headerlink" href="
<dl class="method">
<dt id="pandas.Series.memory_usage">
<code class="descclassname">Series.</code><code class="descname">memory_usage</code><span class="sig-paren">(</span><em>index=True</em>, <em>deep=False</em><span class="sig-paren">)</span><a class="reference external" href="http://github.com/pandas-dev/pandas/blob/master/pandas/core/series.py
<dd><p>Return the memory usage of the Series.</p>
<p>The memory usage can optionally include the contribution of
the index and of elements of <cite>object</cite> dtype.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><p class="first"><strong>index</strong> : bool, default True</p>
<blockquote>
<div><p>Specifies whether to include the memory usage of the Series index.</p>
</div></blockquote>
<p><strong>deep</strong> : bool, default False</p>
<blockquote>
<div><p>If True, introspect the data deeply by interrogating
<cite>object</cite> dtypes for system-level memory consumption, and include
it in the returned value.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>int</strong></p>
<blockquote class="last">
<div><p>Bytes of memory consumed.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<dl class="last docutils">
<dt><a class="reference external" href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.ndarray.nbytes.html#numpy.ndarray.nbytes" title="(in NumPy v1.14)"><code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.ndarray.nbytes</span></code></a></dt>
<dd>Total bytes consumed by the elements of the array.</dd>
<dt><a class="reference internal" href="pandas.DataFrame.memory_usage.html#pandas.DataFrame.memory_usage" title="pandas.DataFrame.memory_usage"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DataFrame.memory_usage</span></code></a></dt>
<dd>Bytes consumed by a DataFrame.</dd>
</dl>
</div>
<p class="rubric">Examples</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">s</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="gp">>>> </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">()</span>
<span class="go">104</span>
</pre></div>
</div>
<p>Not including the index gives the size of the rest of the data, which
is necessarily smaller:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">(</span><span class="n">index</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">24</span>
</pre></div>
</div>
<p>The memory footprint of <cite>object</cite> values is ignored by default:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">>>> </span><span class="n">s</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">Series</span><span class="p">([</span><span class="s2">"a"</span><span class="p">,</span> <span class="s2">"b"</span><span class="p">])</span>
<span class="gp">>>> </span><span class="n">s</span><span class="o">.</span><span class="n">values</span>
<span class="go">array(['a', 'b'], dtype=object)</span>
<span class="gp">>>> </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">()</span>
<span class="go">96</span>
<span class="gp">>>> </span><span class="n">s</span><span class="o">.</span><span class="n">memory_usage</span><span class="p">(</span><span class="n">deep</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">212</span>
</pre></div>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="pandas.Series.min.html" title="pandas.Series.min"
>next</a> |</li>
<li class="right" >
<a href="pandas.Series.median.html" title="pandas.Series.median"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">pandas 0.24.0.dev0+81.g8d5032a8c.dirty documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="../api.html" >API Reference</a> »</li>
<li class="nav-item nav-item-2"><a href="pandas.Series.html" >pandas.Series</a> »</li>
</ul>
</div>
<style type="text/css">
.scrollToTop {
text-align: center;
font-weight: bold;
position: fixed;
bottom: 60px;
right: 40px;
display: none;
}
</style>
<a href="#" class="scrollToTop">Scroll To Top</a>
<script type="text/javascript">
$(document).ready(function() {
//Check to see if the window is top if not then display button
$(window).scroll(function() {
if ($(this).scrollTop() > 200) {
$('.scrollToTop').fadeIn();
} else {
$('.scrollToTop').fadeOut();
}
});
//Click event to scroll to top
$('.scrollToTop').click(function() {
$('html, body').animate({
scrollTop: 0
}, 500);
return false;
});
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-27880019-2']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https:
var s = document.<API key>('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
|
namespace v_4_1.Protocol
{
public static class Asci
{
public const byte CR = 13;
public const byte LF = 10;
public const byte T = 84;
public const byte R = 82;
public const byte D = 68;
public const byte H = 72;
public const byte a = 97;
public const byte o = 111;
public const byte L = 76;
public const byte P = 80;
public const byte U = 85;
public const byte S = 83;
}
}
|
2019-03-11
# java
* [Snailclimb / JavaGuide](https://github.com/Snailclimb/JavaGuide):Java+ Java
* [CypherpunkArmory / UserLAnd](https://github.com/CypherpunkArmory/UserLAnd):Main UserLAnd Repository
* [quarkusio / quarkus](https://github.com/quarkusio/quarkus):Quarkus: Supersonic Subatomic Java.
* [doocs / advanced-java](https://github.com/doocs/advanced-java): Java
* [google / j2cl](https://github.com/google/j2cl):Java to Closure JavaScript transpiler
* [macrozheng / mall](https://github.com/macrozheng/mall):mallSpringBoot+MyBatis
* [Meituan-Dianping / Leaf](https://github.com/Meituan-Dianping/Leaf):Distributed ID Generate Service
* [spring-projects / spring-boot](https://github.com/spring-projects/spring-boot):Spring Boot
* [gotify / android](https://github.com/gotify/android):An app for receiving push notifications on new messages posted to gotify/server.
* [TheAlgorithms / Java](https://github.com/TheAlgorithms/Java):All Algorithms implemented in Java
* [gedoor / MyBookshelf](https://github.com/gedoor/MyBookshelf):
* [eugenp / tutorials](https://github.com/eugenp/tutorials):The "REST With Spring" Course:
* [spring-projects / spring-framework](https://github.com/spring-projects/spring-framework):Spring Framework
* [ityouknow / <API key>](https://github.com/ityouknow/<API key>):about learning Spring Boot via examples. Spring Boot
* [elastic / elasticsearch](https://github.com/elastic/elasticsearch):Open Source, Distributed, RESTful Search Engine
* [apache / incubator-dubbo](https://github.com/apache/incubator-dubbo):Apache Dubbo (incubating) is a high-performance, java based, open source RPC framework.
* [wix / <API key>](https://github.com/wix/<API key>):A complete native navigation solution for React Native
* [guanpj / JReadHub](https:
* [google / guava](https://github.com/google/guava):Google core libraries for Java
* [qiurunze123 / miaosha](https://github.com/qiurunze123/miaosha):.
* [didi / DoraemonKit](https://github.com/didi/DoraemonKit): "DoKit" iOS Android
* [topjohnwu / Magisk](https://github.com/topjohnwu/Magisk):A Magic Mask to Alter Android System Systemless-ly
* [crossoverJie / JCSprout](https:
* [alibaba / nacos](https://github.com/alibaba/nacos):an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
* [oracle / graal](https://github.com/oracle/graal):GraalVM: Run Programs Faster Anywhere
# vue
* [PanJiaChen / vue-element-admin](https:
* [emilkowalski / <API key>](https://github.com/emilkowalski/<API key>):A collection of CSS effects made with Vue.js.
* [ElemeFE / element](https://github.com/ElemeFE/element):A Vue.js 2.0 UI Toolkit for Web
* [Akryum / <API key>](https://github.com/Akryum/<API key>): Blazing fast scrolling for any amount of data
* [iview / iview](https://github.com/iview/iview):A high quality UI Toolkit built on Vue.js 2.0
* [dongweiming / lyanna](https://github.com/dongweiming/lyanna):My Blog Using Sanic
* [System-Glitch / Solidity-IDE](https://github.com/System-Glitch/Solidity-IDE):A simple alternative to Remix IDE to develop and test Solidity Smart Contracts
* [Molunerfinn / PicGo](https://github.com/Molunerfinn/PicGo):A simple & beautiful tool for pictures uploading built by electron-vue
* [vueComponent / ant-design-vue](https://github.com/vueComponent/ant-design-vue):An enterprise-class UI components based on Ant Design and Vue.
* [iview / iview-admin](https://github.com/iview/iview-admin):Vue 2.0 admin management system template based on iView
* [sendya / ant-design-pro-vue](https:
* [jbaysolutions / vue-grid-layout](https://github.com/jbaysolutions/vue-grid-layout):A draggable and resizable grid layout, for Vue.js.
* [jdf2e / nutui](https://github.com/jdf2e/nutui):Vue (A Vue.js 2.0 UI Toolkit for Mobile Web)
* [epicmaxco / vuestic-admin](https://github.com/epicmaxco/vuestic-admin):Vue.js admin dashboard
* [dcloudio / uni-app](https://github.com/dcloudio/uni-app): Vue.js
* [syuilo / misskey](https://github.com/syuilo/misskey): A federated blogging platform
* [mdbootstrap / <API key>](https://github.com/mdbootstrap/<API key>):Vue Bootstrap with Material Design - Powerful and free UI KIT
* [tuandm / laravue](https://github.com/tuandm/laravue):Laravel dashboard built by VueJS
* [vapor / website](https://github.com/vapor/website):Vapor's website running on Vapor and Vue
* [jae-jae / Userscript-Plus](https://github.com/jae-jae/Userscript-Plus): Show current site all UserJSThe easier way to install UserJs for Tampermonkey. Tampermonkey
* [vue-bulma / vue-bulma](https://github.com/vue-bulma/vue-bulma):A modern UI framework based on Vue and Bulma
* [owncloud / phoenix](https://github.com/owncloud/phoenix):Next generation frontend for ownCloud
* [jecovier / vue-json-excel](https://github.com/jecovier/vue-json-excel):
* [TaleLin / lin-cms-vue](https://github.com/TaleLin/lin-cms-vue):A simple and practical CMS implememted by Vue
* [overtrue / yike.io](https://github.com/overtrue/yike.io):
# kotlin
* [iammert / ReadableBottomBar](https://github.com/iammert/ReadableBottomBar):Yet another material bottom bar library for Android
* [shadowsocks / shadowsocks-android](https://github.com/shadowsocks/shadowsocks-android):A shadowsocks client for Android
* [guanpj / JShoppingMall](https://github.com/guanpj/JShoppingMall): App Python
* [ologe / <API key>](https://github.com/ologe/<API key>):Android music player
* [JetBrains / kotlin](https://github.com/JetBrains/kotlin):The Kotlin Programming Language
* [the-super-toys / glimpse-android](https://github.com/the-super-toys/glimpse-android):A content-aware cropping library for Android
* [googlesamples / android-sunflower](https://github.com/googlesamples/android-sunflower):A gardening app illustrating Android development best practices with Android Jetpack.
* [Ramotion / <API key>](https:
* [2dust / v2rayNG](https://github.com/2dust/v2rayNG):
* [googlesamples / <API key>](https://github.com/googlesamples/<API key>):Samples for Android Architecture Components.
* [inorichi / tachiyomi](https://github.com/inorichi/tachiyomi):Free and open source manga reader for Android
* [shetmobile / <API key>](https://github.com/shetmobile/<API key>):Android Meow Bottm Navigation
* [guolindev / coolweatherjetpack](https://github.com/guolindev/coolweatherjetpack):JetpackMVVM
* [adrielcafe / KrumbsView](https://github.com/adrielcafe/KrumbsView): The ultimate breadcrumbs view for Android!
* [alibaba / p3c](https://github.com/alibaba/p3c):Alibaba Java Coding Guidelines pmd implements and IDE plugin
* [nickbutcher / plaid](https://github.com/nickbutcher/plaid):An Android app which provides design news & inspiration as well as being an example of implementing material design.
* [JetBrains / swot](https://github.com/JetBrains/swot):Identify email addresses or domains names that belong to colleges or universities. Help automate the process of approving or rejecting academic discounts.
* [MSF-Jarvis / viscerion](https:
* [h4h13 / RetroMusicPlayer](https://github.com/h4h13/RetroMusicPlayer):Best material design music player for Android
* [SimpleMobileTools / Simple-Commons](https://github.com/SimpleMobileTools/Simple-Commons):Some helper functions and shared resources to be used only by the simple apps suite.
* [proxer / ProxerAndroid](https://github.com/proxer/ProxerAndroid):The official Android App of Proxer.Me
* [corda / corda](https://github.com/corda/corda):Corda is an open source blockchain project, designed for business from the start. Only Corda allows you to build interoperable blockchain networks that transact in strict privacy. Corda's smart contract technology allows businesses to transact directly, with value.
* [rkudryashov / <API key>](https://github.com/rkudryashov/<API key>):Example of the microservices architecture on the modern stack of Java technologies
* [MindorksOpenSource / RadialProgressBar](https://github.com/MindorksOpenSource/RadialProgressBar):Radial ProgressBar inspired by Apple Watch OS. It is highly Customisable
* [kotlin-graphics / imgui](https://github.com/kotlin-graphics/imgui):Bloat-free Immediate Mode Graphical User interface for JVM with minimal dependencies (rewrite of dear imgui)
# javascript
* [agalwood / Motrix](https://github.com/agalwood/Motrix):A full-featured download manager.
* [vadimdemedes / ink](https://github.com/vadimdemedes/ink): React for interactive command-line apps
* [viatsko / awesome-vscode](https://github.com/viatsko/awesome-vscode): A curated list of delightful VS Code packages and resources.
* [bvaughn / react-window](https://github.com/bvaughn/react-window):React components for efficiently rendering large lists and tabular data
* [vuejs / vue](https://github.com/vuejs/vue): Vue.js is a progressive, <API key> JavaScript framework for building UI on the web.
* [facebook / react](https://github.com/facebook/react):A declarative, efficient, and flexible JavaScript library for building user interfaces.
* [victordibia / handtrack.js](https://github.com/victordibia/handtrack.js):A library for prototyping realtime hand detection (bounding box), directly in the browser.
* [pomber / git-history](https://github.com/pomber/git-history):Quickly browse the history of a file from any git repository
* [facebook / react-native](https://github.com/facebook/react-native):A framework for building native apps with React.
* [GoogleChrome / puppeteer](https://github.com/GoogleChrome/puppeteer):Headless Chrome Node API
* [facebook / create-react-app](https://github.com/facebook/create-react-app):Set up a modern web app by running one command.
* [30-seconds / 30-seconds-of-code](https://github.com/30-seconds/30-seconds-of-code):A curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.
* [frankmcsherry / blog](https://github.com/frankmcsherry/blog):Some notes on things I find interesting and important.
* [mui-org / material-ui](https://github.com/mui-org/material-ui):React components for faster and easier web development. Build your own design system, or start with Material Design.
* [axa-group / nlp.js](https://github.com/axa-group/nlp.js):An NLP library for building bots, with entity extraction, sentiment analysis, automatic language identify, and so more
* [nodejs / node](https://github.com/nodejs/node):Node.js JavaScript runtime
* [trekhleb / <API key>](https://github.com/trekhleb/<API key>): Algorithms and data structures implemented in JavaScript with explanations and links to further readings
* [NervJS / taro](https:
* [twbs / bootstrap](https://github.com/twbs/bootstrap):The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.
* [storybooks / storybook](https://github.com/storybooks/storybook):UI component dev & test: React, React Native, Vue, Angular, Ember & more!
* [lukeed / dequal](https://github.com/lukeed/dequal):A tiny (247B) utility for check for deep equality
* [freeciv / freeciv-web](https://github.com/freeciv/freeciv-web):Freeciv-web is an Open Source strategy game implemented in HTML5 and WebGL, which can be played online against other players, or in single player mode against AI opponents.
* [gatsbyjs / gatsby](https://github.com/gatsbyjs/gatsby):Build blazing fast, modern apps and websites with React
* [facebook / jest](https://github.com/facebook/jest):Delightful JavaScript Testing.
* [strapi / strapi](https://github.com/strapi/strapi): Open source Node.js Headless CMS to easily build customisable APIs
# css
* [daneden / animate.css](https://github.com/daneden/animate.css): A cross-browser library of CSS animations. As easy to use as an easy thing.
* [twbs / rfs](https://github.com/twbs/rfs):Automated responsive font sizes
* [jgthms / bulma](https://github.com/jgthms/bulma):Modern CSS framework based on Flexbox
* [ryanoasis / nerd-fonts](https://github.com/ryanoasis/nerd-fonts): Iconic font aggregator, collection, and patcher. 40+ patched fonts, over 3,600 glyph/icons, includes popular collections such as Font Awesome & fonts such as Hack
* [rexlin600 / rexlin600.github.io](https://github.com/rexlin600/rexlin600.github.io):
* [tailwindcss / tailwindcss](https://github.com/tailwindcss/tailwindcss):A utility-first CSS framework for rapid UI development.
* [rstacruz / cheatsheets](https://github.com/rstacruz/cheatsheets):My cheatsheets
* [apachecn / hands-on-ml-zh](https://github.com/apachecn/hands-on-ml-zh): [] Sklearn TensorFlow
* [BlackrockDigital / <API key>](https:
* [uikit / uikit](https://github.com/uikit/uikit):A lightweight and modular front-end framework for developing fast and powerful web interfaces
* [theme-next / hexo-theme-next](https://github.com/theme-next/hexo-theme-next):Elegant and powerful theme for Hexo.
* [StylishThemes / GitHub-Dark](https://github.com/StylishThemes/GitHub-Dark):Dark GitHub style
* [LiangJunrong / document-library](https:
* [elenapan / dotfiles](https://github.com/elenapan/dotfiles):There is no place like ~/
* [<API key> / paperless](https://github.com/<API key>/paperless):Scan, index, and archive all of your paper documents
* [mozdevs / cssremedy](https://github.com/mozdevs/cssremedy):Start your project with a remedy for the technical debt of CSS.
* [angea / pocorgtfo](https://github.com/angea/pocorgtfo):a "PoC or GTFO" mirror with extra article index, direct links and clean PDFs.
* [gitpitch / in-60-seconds](https://github.com/gitpitch/in-60-seconds):GitPitch In 60 Seconds - A Very Short Tutorial
* [poole / hyde](https://github.com/poole/hyde):A brazen two-column theme for Jekyll.
* [jekyll / minima](https://github.com/jekyll/minima):Minima is a one-size-fits-all Jekyll theme for writers.
* [picturepan2 / spectre](https://github.com/picturepan2/spectre):Spectre.css - A Lightweight, Responsive and Modern CSS Framework
* [fireship-io / fireship.io](https:
* [getpelican / pelican-themes](https://github.com/getpelican/pelican-themes):Themes for Pelican
* [travis-ci / docs-travis-ci-com](https://github.com/travis-ci/docs-travis-ci-com):The Travis CI Documentation
* [flutter / website](https://github.com/flutter/website):Flutter web site
# objective-c
* [alibaba / coobjc](https://github.com/alibaba/coobjc):coobjc provides coroutine support for Objective-C and Swift. We added await methodgenerator and actor model like C#Javascript and Kotlin. For convenience, we added coroutine categories for some Foundation and UIKit API in cokit framework like NSFileManager, JSON, NSData, UIImage etc. We also add tuple support in coobjc.
* [<API key> / react-native-maps](https://github.com/<API key>/react-native-maps):React Native Mapview component for iOS + Android
* [expo / expo](https://github.com/expo/expo):The Expo platform for making cross-platform mobile apps
* [Cenmrev / V2RayX](https://github.com/Cenmrev/V2RayX):GUI for v2ray-core on macOS
* [matryer / bitbar](https://github.com/matryer/bitbar):Put the output from any script or program in your Mac OS X Menu Bar
* [sveinbjornt / Sloth](https://github.com/sveinbjornt/Sloth):Mac app that shows all open files and sockets in use by all running processes. Nice GUI for lsof.
* [<API key> / marzipanify](https://github.com/<API key>/marzipanify):Convert an iOS Simulator app bundle to an iOSMac (Marzipan) one (Unsupported & undocumented, WIP)
* [PsychoTea / machswap2](https://github.com/PsychoTea/machswap2):An iOS kernel exploit for iOS 11 through 12.1.2. Works on A7 - A11 devices.
* [apache / <API key>](https://github.com/apache/<API key>):Apache Cordova Plugin inappbrowser
* [januslo / <API key>](https://github.com/januslo/<API key>):React-Native plugin for the bluetooth ESC/POS & TSC printers.
* [signalapp / Signal-iOS](https://github.com/signalapp/Signal-iOS):A private messenger for iOS.
* [Codeux-Software / Textual](https://github.com/Codeux-Software/Textual):Textual is an IRC client for OS X
* [googleads / <API key>](https://github.com/googleads/<API key>):<API key>
* [bitstadium / HockeySDK-iOS](https://github.com/bitstadium/HockeySDK-iOS):The official iOS SDK for the HockeyApp service (Releases are in the master branch, current development in the default develop branch)
* [bitstadium / HockeySDK-Mac](https://github.com/bitstadium/HockeySDK-Mac):The official Mac SDK for the HockeyApp service. It contains a crash reporter that checks at startup whether your application crashed last time it was launched, then offers to send that information to the HockeyApp service. It supports Mac OS X >= 10.9, Intel architectures and also the Mac Sandbox.
* [jverkoey / nimbus](https://github.com/jverkoey/nimbus):The iOS framework that grows only as fast as its documentation
* [xu-li / <API key>](https://github.com/xu-li/<API key>):A cordova plugin, a JS version of Wechat SDK
* [AFNetworking / AFNetworking](https://github.com/AFNetworking/AFNetworking):A delightful networking framework for iOS, macOS, watchOS, and tvOS.
* [SDWebImage / SDWebImage](https://github.com/SDWebImage/SDWebImage):Asynchronous image downloader with cache support as a UIImageView category
* [BradLarson / GPUImage](https://github.com/BradLarson/GPUImage):An open source iOS framework for GPU-based image and video processing
* [SnapKit / Masonry](https://github.com/SnapKit/Masonry):Harness the power of AutoLayout NSLayoutConstraints with a simplified, chainable and expressive syntax. Supports iOS and OSX Auto Layout
* [airbnb / lottie-ios](https://github.com/airbnb/lottie-ios):An iOS library to natively render After Effects vector animations
* [jdg / MBProgressHUD](https://github.com/jdg/MBProgressHUD):MBProgressHUD + Customizations
* [realm / realm-cocoa](https://github.com/realm/realm-cocoa):Realm is a mobile database: a replacement for Core Data & SQLite
* [ccgus / fmdb](https://github.com/ccgus/fmdb):A Cocoa / Objective-C wrapper around SQLite
# swift
* [sagaya / Wobbly](https://github.com/sagaya/Wobbly):(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.
* [pedrommcarrasco / Brooklyn](https://github.com/pedrommcarrasco/Brooklyn): Screensaver inspired by Apple's Event on October 30, 2018
* [shadowsocks / ShadowsocksX-NG](https://github.com/shadowsocks/ShadowsocksX-NG):Next Generation of ShadowsocksX
* [holzschu / Carnets](https://github.com/holzschu/Carnets):Carnets is a stand-alone Jupyter notebook server and client. Edit your notebooks on the go, even where there is no network.
* [iina / iina](https://github.com/iina/iina):The modern video player for macOS.
* [Ramotion / folding-cell](https:
* [Ramotion / animated-tab-bar](https:
* [raywenderlich / <API key>](https://github.com/raywenderlich/<API key>):Algorithms and data structures in Swift, with explanations!
* [Ramotion / <API key>](https:
* [app-developers / top](https://github.com/app-developers/top):Top App Developers - March 2019
* [lukakerr / Pine](https://github.com/lukakerr/Pine):A modern, native macOS markdown editor - themeable, tabs, sidebar, github flavored markdown, exporting, latex and more
* [serhii-londar / <API key>](https://github.com/serhii-londar/<API key>): Awesome list of open source applications for macOS.
* [mxcl / Cake](https:
* [dkhamsing / <API key>](https://github.com/dkhamsing/<API key>): Collaborative List of Open-Source iOS Apps
* [sindresorhus / touch-bar-simulator](https://github.com/sindresorhus/touch-bar-simulator):Use the Touch Bar on any Mac
* [d-dotsenko / <API key>](https://github.com/d-dotsenko/<API key>): Warp image transformation
* [ianyh / Amethyst](https:
* [ReactiveX / RxSwift](https://github.com/ReactiveX/RxSwift):Reactive Programming in Swift
* [Alamofire / Alamofire](https://github.com/Alamofire/Alamofire):Elegant HTTP Networking in Swift
* [HeroTransitions / Hero](https://github.com/HeroTransitions/Hero):Elegant transition library for iOS & tvOS
* [zagahr / Conferences.digital](https:
* [vsouza / awesome-ios](https://github.com/vsouza/awesome-ios):A curated list of awesome iOS ecosystem, including Objective-C and Swift Projects
* [mas-cli / mas](https://github.com/mas-cli/mas): Mac App Store command line interface
* [onevcat / Kingfisher](https://github.com/onevcat/Kingfisher):A lightweight, pure-Swift library for downloading and caching images from the web.
* [IvanVorobei / SPStorkController](https://github.com/IvanVorobei/SPStorkController):Modal controller as in mail or Apple music application
# html
* [hamukazu / lets-get-arrested](https://github.com/hamukazu/lets-get-arrested):This project is intended to protest against the police in Japan
* [github / personal-website](https://github.com/github/personal-website):Code that'll help you kickstart a personal website that showcases your work as a software developer.
* [fengdu78 / <API key>](https://github.com/fengdu78/<API key>):
* [fengdu78 / <API key>](https://github.com/fengdu78/<API key>):deeplearning.ai
* [emilbaehr / <API key>](https://github.com/emilbaehr/<API key>):A Jekyll theme for automatically generating and deploying landing page sites for mobile apps.
* [huyaocode / webKnowledge](https://github.com/huyaocode/webKnowledge):
* [iliakan / <API key>](https://github.com/iliakan/<API key>):Modern JavaScript Tutorial
* [ionic-team / ionic](https://github.com/ionic-team/ionic):Build amazing native and progressive web apps with open web technologies. One app running on everything
* [Cryptogenic / PS4-6.<API key>](https://github.com/Cryptogenic/PS4-6.<API key>):A WebKit exploit using CVE-2018-4441 to obtain RCE on PS4 6.20.
* [vincentarelbundock / gtsummary](https://github.com/vincentarelbundock/gtsummary):Beautiful, customizable, publication-ready model summaries in R.
* [octocat / Spoon-Knife](https://github.com/octocat/Spoon-Knife):This repo is for demonstration purposes only.
* [phodal / github](https://github.com/phodal/github):GitHub - a Chinese ebook on how to build a good project on Github. Explore the users' behavior. Find some thing interest.
* [zeit / now-github-starter](https://github.com/zeit/now-github-starter):Starter project to demonstrate a project whose pull requests get automatically deployed
* [flutterchina / flutter-in-action](https://github.com/flutterchina/flutter-in-action):Flutter
* [kennethreitz / requests-html](https:
* [typpo / quickchart](https://github.com/typpo/quickchart):Google Image Charts alternative
* [Microsoft / dotnet](https://github.com/Microsoft/dotnet):This repo is the official home of .NET on GitHub. It's a great starting point to find many .NET OSS projects from Microsoft and the community, including many that are part of the .NET Foundation.
* [circleci / circleci-docs](https://github.com/circleci/circleci-docs):Documentation for CircleCI.
* [ripienaar / free-for-dev](https://github.com/ripienaar/free-for-dev):A list of SaaS, PaaS and IaaS offerings that have free tiers of interest to devops and infradev
* [swagger-api / swagger-codegen](https://github.com/swagger-api/swagger-codegen):swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
* [shd101wyy / <API key>](https://github.com/shd101wyy/<API key>):One of the 'BEST' markdown preview extensions for Atom editor!
* [wesbos / JavaScript30](https://github.com/wesbos/JavaScript30):30 Day Vanilla JS Challenge
* [clong / DetectionLab](https://github.com/clong/DetectionLab):Vagrant & Packer scripts to build a lab environment complete with security tooling and logging best practices
* [ethereum / EIPs](https://github.com/ethereum/EIPs):The Ethereum Improvement Proposal repository
* [be5invis / Iosevka](https://github.com/be5invis/Iosevka):Slender typeface for code, from code.
|
# AUTOGENERATED FILE
FROM balenalib/<API key>:34-run
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
RUN dnf install -y \
python3-pip \
python3-dbus \
&& dnf clean all
# install "virtualenv", since the vast majority of users of this image will want it
RUN pip3 install -U --no-cache-dir --ignore-installed pip setuptools \
&& pip3 install --no-cache-dir virtualenv
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo $'As of January 1st, 2020, Python 2 was end-of-life, we will change the latest tag for Balenalib Python base image to Python 3.x and drop support for Python 2 soon. So after 1st July, 2020, all the balenalib Python latest tag will point to the latest Python 3 version and no changes, or fixes will be made to balenalib Python 2 base image. If you are using Python 2 for your application, please upgrade to Python 3 before 1st July.' > /.balena/messages/<API key>
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@python.sh" \
&& echo "Running test-stack@python" \
&& chmod +x test-stack@python.sh \
&& bash test-stack@python.sh \
&& rm -rf test-stack@python.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
|
<?php namespace Way\Generators\Syntax;
class CreateTable extends Table {
/**
* Build string for creating a
* table and columns
*
* @param $migrationData
* @param $fields
* @return mixed
*/
public function create($migrationData, $fields)
{
$migrationData = ['method' => 'create', 'table' => $migrationData['table']];
// All new tables should have an identifier
// Let's add that for the user automatically
$primaryKey['id'] = ['type' => 'increments'];
$fields = $primaryKey + $fields;
// We'll also add timestamps to new tables for convenience
$fields[''] = ['type' => 'timestamps'];
return (new AddToTable($this->file, $this->compiler))->add($migrationData, $fields);
}
}
|
package sagex.phoenix.remote.services;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
import javax.script.Invocable;
import javax.script.ScriptException;
import sagex.phoenix.util.PhoenixScriptEngine;
public class <API key> implements InvocationHandler {
private PhoenixScriptEngine eng;
private Map<String, String> methodMap = new HashMap<String, String>();
public <API key>(PhoenixScriptEngine eng, String interfaceMethod, String jsMethod) {
this.eng = eng;
methodMap.put(interfaceMethod, jsMethod);
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (Object.class == method.getDeclaringClass()) {
String name = method.getName();
if ("equals".equals(name)) {
return proxy == args[0];
} else if ("hashCode".equals(name)) {
return System.identityHashCode(proxy);
} else if ("toString".equals(name)) {
return proxy.getClass().getName() + "@" + Integer.toHexString(System.identityHashCode(proxy))
+ ", with InvocationHandler " + this;
} else {
throw new <API key>(String.valueOf(method));
}
}
String jsMethod = methodMap.get(method.getName());
if (jsMethod == null) {
throw new <API key>("No Javascript Method for " + method.getName());
}
Invocable inv = (Invocable) eng.getEngine();
try {
return inv.invokeFunction(jsMethod, args);
} catch (<API key> e) {
throw new <API key>("The Java Method: " + method.getName() + " maps to a Javascript Method " + jsMethod
+ " that does not exist.");
} catch (ScriptException e) {
throw e;
}
}
}
|
package io.izenecloud.larser.framework;
import io.izenecloud.conf.Configuration;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.spi.StringOptionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class LaserArgument {
private static final Logger LOG = LoggerFactory
.getLogger(LaserArgument.class);
public static final Set<String> VALID_ARGUMENTS = new HashSet<String>(
Arrays.asList("-configure"));
@Option(name = "-configure", required = true, handler = StringOptionHandler.class)
private String configure;
public String getConfigure() {
return configure;
}
public static void parseArgs(String[] args) throws CmdLineException,
IOException {
ArrayList<String> argsList = new ArrayList<String>(Arrays.asList(args));
for (int i = 0; i < args.length; i++) {
if (i % 2 == 0 && !LaserArgument.VALID_ARGUMENTS.contains(args[i])) {
argsList.remove(args[i]);
argsList.remove(args[i + 1]);
}
}
final LaserArgument laserArgument = new LaserArgument();
new CmdLineParser(laserArgument).parseArgument(argsList
.toArray(new String[argsList.size()]));
Configuration conf = Configuration.getInstance();
LOG.info("Load configure, {}", laserArgument.getConfigure());
Path path = new Path(laserArgument.getConfigure());
FileSystem fs = FileSystem
.get(new org.apache.hadoop.conf.Configuration());
conf.load(path, fs);
}
}
|
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
* file per style scope.
*
*= require_tree .
*= require_self
*= require jquery-ui
*/
/*
* CSS workarounds
*/
input[type=number]::-<API key> {
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-webkit-appearance: textfield;
-moz-appearance: textfield;
margin: 0;
}
select {
-webkit-appearance: none;
-moz-appearance: none;
}
::-<API key> { /* WebKit, Blink, Edge */
color: #3a90c9;
font-size: x-large;
padding-top: 3px;
padding-left: 3px;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #3a90c9;
font-size: x-large;
opacity: 1;
}
:-<API key> { /* Internet Explorer 10-11 */
color: #3a90c9;
font-size: x-large;
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<html lang="en-GB" xml:lang="en-GB" xmlns="http:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Number</title>
<link rel="root" href=""/> <!-- for JS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="../../css/jquery-ui-redmond.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style.css"/>
<link rel="stylesheet" type="text/css" href="../../css/style-vis.css"/>
<link rel="stylesheet" type="text/css" href="../../css/hint.css"/>
<script type="text/javascript" src="../../lib/ext/head.load.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/3.2.2/anchor.min.js"></script>
<script>document.addEventListener("DOMContentLoaded", function(event) {anchors.add();});</script>
<!-- DZ 2021-01-22: I am temporarily hiding the search field to find out whether it slows down loading of the title page.
<script>
(function() {
var cx = '<API key>:dl1mehhcgbo';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.<API key>('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<!-- <link rel="shortcut icon" href="favicon.ico"/> -->
</head>
<body>
<div id="main" class="center">
<div id="hp-header">
<table width="100%"><tr><td width="50%">
<span class="header-text"><a href="http://<API key>.org/#language-cy">home</a></span>
<span class="header-text"><a href="https://github.com/<API key>/docs/edit/pages-source/_cy/feat/Number.md" target="#">edit page</a></span>
<span class="header-text"><a href="https://github.com/<API key>/docs/issues">issue tracker</a></span>
</td><td>
<gcse:search></gcse:search>
</td></tr></table>
</div>
<hr/>
<div class="v2complete">
This page pertains to UD version 2.
</div>
<div id="content">
<noscript>
<div id="noscript">
It appears that you have Javascript disabled.
Please consider enabling Javascript for this page to see the visualizations.
</div>
</noscript>
<!-- The content may include scripts and styles, hence we must load the shared libraries before the content. -->
<script type="text/javascript">
console.time('loading libraries');
var root = '../../'; // filled in by jekyll
head.js(
// External libraries
// DZ: Copied from embedding.html. I don't know which one is needed for what, so I'm currently keeping them all.
root + 'lib/ext/jquery.min.js',
root + 'lib/ext/jquery.svg.min.js',
root + 'lib/ext/jquery.svgdom.min.js',
root + 'lib/ext/jquery.timeago.js',
root + 'lib/ext/jquery-ui.min.js',
root + 'lib/ext/waypoints.min.js',
root + 'lib/ext/jquery.address.min.js'
);
</script>
<style>h3 {display:block;background-color:#dfeffc}</style>
<h2><code>Number</code>: number of verbs, nouns, pronouns and adjectives</h2>
<p>Number has two values in Welsh, Singular and Plural. It is marked on nouns, some adjectives, pronouns, verbs and inflected prepositions. Only very few adjectives are marked for number.
Verbs with a pronominal subject are marked for Person and Number, verbs with a nominal subject
are always in the 3rd person singular, also with plural subjects.
There is a group of nouns in Welsh, whose lemma is a plural, the singular is formed by adding a singulative suffix: <em>plant</em> “children”, <em>plentyn</em> “child”). However, in the Welsh treebank, we always put the singular in the lemma column</p>
<h3 id="sing-singular"><a name="Sing"><code class="language-plaintext highlighter-rouge">Sing</code></a>: singular</h3>
<h4 id="examples">Examples</h4>
<ul>
<li><em>tŷ</em> “house”</li>
<li><em>y ferch</em> “the woman”</li>
<li><em>aderyn</em> “bird”</li>
<li><em>o</em> “he”</li>
</ul>
<h3 id="plur-plural"><a name="Plur"><code class="language-plaintext highlighter-rouge">Plur</code></a>: plural</h3>
<h4 id="examples-1">Examples</h4>
<ul>
<li><em>tai</em> “houses”</li>
<li><em>y merched</em> “the women”</li>
<li><em>adar</em> “birds”</li>
<li><em>nhw</em> “they”</li>
</ul>
<!-- Interlanguage links updated St lis 3 20:58:24 CET 2021 -->
<!-- "in other languages" links -->
<hr/>
Number in other languages:
[<a href="../../arr/feat/Number.html">arr</a>]
[<a href="../../bej/feat/Number.html">bej</a>]
[<a href="../../bg/feat/Number.html">bg</a>]
[<a href="../../bm/feat/Number.html">bm</a>]
[<a href="../../cs/feat/Number.html">cs</a>]
[<a href="../../cy/feat/Number.html">cy</a>]
[<a href="../../en/feat/Number.html">en</a>]
[<a href="../../ess/feat/Number.html">ess</a>]
[<a href="../../eu/feat/Number.html">eu</a>]
[<a href="../../fi/feat/Number.html">fi</a>]
[<a href="../../fr/feat/Number.html">fr</a>]
[<a href="../../ga/feat/Number.html">ga</a>]
[<a href="../../gub/feat/Number.html">gub</a>]
[<a href="../../hu/feat/Number.html">hu</a>]
[<a href="../../hy/feat/Number.html">hy</a>]
[<a href="../../it/feat/Number.html">it</a>]
[<a href="../../myv/feat/Number.html">myv</a>]
[<a href="../../orv/feat/Number.html">orv</a>]
[<a href="../../pcm/feat/Number.html">pcm</a>]
[<a href="../../pt/feat/Number.html">pt</a>]
[<a href="../../ru/feat/Number.html">ru</a>]
[<a href="../../sl/feat/Number.html">sl</a>]
[<a href="../../sv/feat/Number.html">sv</a>]
[<a href="../../tpn/feat/Number.html">tpn</a>]
[<a href="../../tr/feat/Number.html">tr</a>]
[<a href="../../tt/feat/Number.html">tt</a>]
[<a href="../../u/feat/Number.html">u</a>]
[<a href="../../uk/feat/Number.html">uk</a>]
[<a href="../../urb/feat/Number.html">urb</a>]
[<a href="../../urj/feat/Number.html">urj</a>]
</div>
<!-- support for embedded visualizations -->
<script type="text/javascript">
var root = '../../'; // filled in by jekyll
head.js(
// We assume that external libraries such as jquery.min.js have already been loaded outside!
// (See _layouts/base.html.)
// brat helper modules
root + 'lib/brat/configuration.js',
root + 'lib/brat/util.js',
root + 'lib/brat/annotation_log.js',
root + 'lib/ext/webfont.js',
// brat modules
root + 'lib/brat/dispatcher.js',
root + 'lib/brat/url_monitor.js',
root + 'lib/brat/visualizer.js',
// embedding configuration
root + 'lib/local/config.js',
// project-specific collection data
root + 'lib/local/collections.js',
// Annodoc
root + 'lib/annodoc/annodoc.js',
// NOTE: non-local libraries
'https://spyysalo.github.io/conllu.js/conllu.js'
);
var webFontURLs = [
// root + 'static/fonts/Astloch-Bold.ttf',
root + 'static/fonts/<API key>.ttf',
root + 'static/fonts/<API key>.ttf'
];
var setupTimeago = function() {
jQuery("time.timeago").timeago();
};
head.ready(function() {
setupTimeago();
// mark current collection (filled in by Jekyll)
Collections.listing['_current'] = 'cy';
// perform all embedding and support functions
Annodoc.activate(Config.bratCollData, Collections.listing);
});
</script>
<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['<API key>']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.<API key>(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
ga('create', 'UA-55233688-1', 'auto');
ga('send', 'pageview');
</script>
<div id="footer">
<p class="footer-text">© 2014–2021
<a href="http://<API key>.org/introduction.html#contributors" style="color:gray">Universal Dependencies contributors</a>.
Site powered by <a href="http:
</div>
</div>
</body>
</html>
|
package com.nagopy.android.disablemanager2;
import android.os.Build;
import com.android.uiautomator.core.UiSelector;
@SuppressWarnings("unused")
public class UiSelectorBuilder {
private UiSelector uiSelector;
public UiSelector build() {
return uiSelector;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder() {
uiSelector = new UiSelector();
}
/**
* @since API Level 16
*/
public UiSelectorBuilder text(String text) {
uiSelector = uiSelector.text(text);
return this;
}
/**
* @since API Level 17
*/
public UiSelectorBuilder textMatches(String regex) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
uiSelector = uiSelector.textMatches(regex);
}
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder textStartsWith(String text) {
uiSelector = uiSelector.textStartsWith(text);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder textContains(String text) {
uiSelector = uiSelector.textContains(text);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder className(String className) {
uiSelector = uiSelector.className(className);
return this;
}
/**
* @since API Level 17
*/
public UiSelectorBuilder classNameMatches(String regex) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
uiSelector = uiSelector.classNameMatches(regex);
}
return this;
}
/**
* @since API Level 17
*/
public UiSelectorBuilder className(Class<?> type) {
uiSelector = uiSelector.className(type.getName());
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder description(String desc) {
uiSelector = uiSelector.description(desc);
return this;
}
/**
* @since API Level 17
*/
public UiSelectorBuilder descriptionMatches(String regex) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
uiSelector = uiSelector.descriptionMatches(regex);
}
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder <API key>(String desc) {
uiSelector = uiSelector.<API key>(desc);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder descriptionContains(String desc) {
uiSelector = uiSelector.descriptionContains(desc);
return this;
}
/**
* @since API Level 18
*/
public UiSelectorBuilder resourceId(String id) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
uiSelector = uiSelector.resourceId(id);
}
return this;
}
/**
* @since API Level 18
*/
public UiSelectorBuilder resourceIdMatches(String regex) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
uiSelector = uiSelector.resourceIdMatches(regex);
}
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder index(final int index) {
uiSelector = uiSelector.index(index);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder instance(final int instance) {
uiSelector = uiSelector.instance(instance);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder enabled(boolean val) {
uiSelector = uiSelector.enabled(val);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder focused(boolean val) {
uiSelector = uiSelector.focused(val);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder focusable(boolean val) {
uiSelector = uiSelector.focusable(val);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder scrollable(boolean val) {
uiSelector = uiSelector.scrollable(val);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder selected(boolean val) {
uiSelector = uiSelector.selected(val);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder checked(boolean val) {
uiSelector = uiSelector.checked(val);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder clickable(boolean val) {
uiSelector = uiSelector.clickable(val);
return this;
}
/**
* @since API Level 18
*/
public UiSelectorBuilder checkable(boolean val) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
uiSelector = uiSelector.checkable(val);
}
return this;
}
/**
* @since API Level 17
*/
public UiSelectorBuilder longClickable(boolean val) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
uiSelector = uiSelector.longClickable(val);
}
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder childSelector(UiSelector selector) {
uiSelector = uiSelector.childSelector(selector);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder fromParent(UiSelector selector) {
uiSelector = uiSelector.fromParent(selector);
return this;
}
/**
* @since API Level 16
*/
public UiSelectorBuilder packageName(String name) {
uiSelector = uiSelector.packageName(name);
return this;
}
/**
* @since API Level 17
*/
public UiSelectorBuilder packageNameMatches(String regex) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
uiSelector = uiSelector.packageNameMatches(regex);
}
return this;
}
}
|
package com.salesmanager.shop.model.entity;
import java.io.Serializable;
public abstract class ReadableList implements Serializable {
private static final long serialVersionUID = 1L;
private int totalPages;//totalPages
private int number;//number of record in current page
private long recordsTotal;//total number of records in db
private int recordsFiltered;
public int getTotalPages() {
return totalPages;
}
public void setTotalPages(int totalCount) {
this.totalPages = totalCount;
}
public long getRecordsTotal() {
return recordsTotal;
}
public void setRecordsTotal(long recordsTotal) {
this.recordsTotal = recordsTotal;
}
public int getRecordsFiltered() {
return recordsFiltered;
}
public void setRecordsFiltered(int recordsFiltered) {
this.recordsFiltered = recordsFiltered;
}
public int getNumber() {
return number;
}
public void setNumber(int number) {
this.number = number;
}
}
|
# coding: UTF-8
name 'ops_tcpdump_handler'
maintainer 'Operations Infrastructure Team - Cerner Innovation, Inc.'
maintainer_email 'OpsInfraTeam@cerner.com'
license 'Apache 2.0'
description 'Installs/Configures ops_tcpdump_handler'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '1.1.0'
supports 'ubuntu'
supports 'centos'
supports 'redhat'
depends 'runit', '~> 1.5'
|
<!DOCTYPE html>
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="SHORTCUT ICON" href="../../../../../img/clover.ico" />
<link rel="stylesheet" href="../../../../../aui/css/aui.min.css" media="all"/>
<link rel="stylesheet" href="../../../../../aui/css/aui-experimental.min.css" media="all"/>
<!--[if IE 9]><link rel="stylesheet" href="../../../../../aui/css/aui-ie9.min.css" media="all"/><![endif]-->
<style type="text/css" media="all">
@import url('../../../../../style.css');
@import url('../../../../../tree.css');
</style>
<script src="../../../../../jquery-1.8.3.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-experimental.min.js" type="text/javascript"></script>
<script src="../../../../../aui/js/aui-soy.min.js" type="text/javascript"></script>
<script src="../../../../../package-nodes-tree.js" type="text/javascript"></script>
<script src="../../../../../clover-tree.js" type="text/javascript"></script>
<script src="../../../../../clover.js" type="text/javascript"></script>
<script src="../../../../../clover-descriptions.js" type="text/javascript"></script>
<script src="../../../../../cloud.js" type="text/javascript"></script>
<title>ABA Route Transit Number Validator 1.0.1-SNAPSHOT</title>
</head>
<body>
<div id="page">
<header id="header" role="banner">
<nav class="aui-header <API key>" role="navigation">
<div class="aui-header-inner">
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo <API key>">
<a href="http://openclover.org" title="Visit OpenClover home page"><span class="<API key>">OpenClover</span></a>
</h1>
</div>
<div class="<API key>">
<ul class="aui-nav">
<li id="system-help-menu">
<a class="aui-nav-link" title="Open online documentation" target="_blank"
href="http://openclover.org/documentation">
<span class="aui-icon aui-icon-small aui-iconfont-help"> Help</span>
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<div class="aui-page-panel">
<div class="<API key>">
<div class="aui-page-panel-nav <API key>">
<div class="<API key>" style="margin-bottom: 20px;">
<div class="<API key>">
<a href="http://cardatechnologies.com" target="_top">
<div class="aui-avatar aui-avatar-large aui-avatar-project">
<div class="aui-avatar-inner">
<img src="../../../../../img/clover_logo_large.png" alt="Clover icon"/>
</div>
</div>
</a>
</div>
<div class="<API key>" >
<h1>
<a href="http://cardatechnologies.com" target="_top">
ABA Route Transit Number Validator 1.0.1-SNAPSHOT
</a>
</h1>
</div>
</div>
<nav class="aui-navgroup <API key>">
<div class="aui-navgroup-inner">
<ul class="aui-nav">
<li class="">
<a href="../../../../../dashboard.html">Project overview</a>
</li>
</ul>
<div class="aui-nav-heading <API key>">
<strong>Packages</strong>
</div>
<div class="aui-nav project-packages">
<form method="get" action="#" class="aui <API key>">
<input type="text" autocomplete="off" class="package-filter text"
placeholder="Type to filter packages..." name="package-filter" id="package-filter"
title="Start typing package name (or part of the name) to search through the tree. Use arrow keys and the Enter key to navigate."/>
</form>
<p class="<API key> hidden">
<small>No results found.</small>
</p>
<div class="<API key>" data-root-relative="../../../../../" data-package-name="com.cardatechnologies.utils.validators.abaroutevalidator">
<div class="<API key>"></div>
<div class="<API key>"></div>
</div>
</div>
</div>
</nav> </div>
<section class="<API key>">
<div class="<API key>">
<div class="<API key>"><ol class="aui-nav aui-nav-breadcrumbs">
<li><a href="../../../../../dashboard.html"> Project Clover database Sat Aug 7 2021 12:29:33 MDT</a></li>
<li><a href="test-pkg-summary.html">Package com.cardatechnologies.utils.validators.abaroutevalidator</a></li>
<li><a href="<API key>.html">Class <API key></a></li>
</ol></div>
<h1 class="aui-h2-clover">
Test <API key>
</h1>
<table class="aui">
<thead>
<tr>
<th>Test</th>
<th><label title="The test result. Either a Pass, Fail or Error.">Status</label></th>
<th><label title="When the test execution was started">Start time</label></th>
<th><label title="The total time in seconds taken to run this test.">Time (seconds)</label></th>
<th><label title="A failure or error message if the test is not successful.">Message</label></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/<API key>.html?line=42657#src-42657" ><API key></a>
</td>
<td>
<span class="sortValue">1</span><span class="aui-lozenge aui-lozenge-success">PASS</span>
</td>
<td>
7 Aug 12:46:26
</td>
<td>
0.0 </td>
<td>
<div></div>
<div class="errorMessage"></div>
</td>
</tr>
</tbody>
</table>
<div> </div>
<table class="aui aui-table-sortable">
<thead>
<tr>
<th style="white-space:nowrap;"><label title="A class that was directly hit by this test.">Target Class</label></th>
<th colspan="4"><label title="The percentage of coverage contributed by each single test.">Coverage contributed by</label> <API key></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.<API key></span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/exceptions/<API key>.html?id=9592#<API key>" title="<API key>" name="sl-43">com.cardatechnologies.utils.validators.abaroutevalidator.exceptions.<API key></a>
</td>
<td>
<span class="sortValue">0.5714286</span>57.1%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td>
</tr>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/ErrorCodes.html?id=9592#ErrorCodes" title="ErrorCodes" name="sl-42">com.cardatechnologies.utils.validators.abaroutevalidator.ErrorCodes</a>
</td>
<td>
<span class="sortValue">0.5714286</span>57.1%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="57.1% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:57.1%"></div></div></div> </td>
</tr>
<tr>
<td>
<span class="sortValue">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</span>
  <a href="../../../../../com/cardatechnologies/utils/validators/abaroutevalidator/AbaRouteValidator.html?id=9592#AbaRouteValidator" title="AbaRouteValidator" name="sl-47">com.cardatechnologies.utils.validators.abaroutevalidator.AbaRouteValidator</a>
</td>
<td>
<span class="sortValue">0.29411766</span>29.4%
</td>
<td class="align-middle" style="width: 100%" colspan="3">
<div>
<div title="29.4% Covered" style="min-width:40px;" class="barNegative contribBarNegative contribBarNegative"><div class="barPositive contribBarPositive contribBarPositive" style="width:29.4%"></div></div></div> </td>
</tr>
</tbody>
</table>
</div> <!-- class="<API key>" -->
<footer id="footer" role="contentinfo">
<section class="footer-body">
<ul>
<li>
Report generated by <a target="_new" href="http://openclover.org">OpenClover</a> v 4.4.1
on Sat Aug 7 2021 12:49:26 MDT using coverage data from Sat Aug 7 2021 12:47:23 MDT.
</li>
</ul>
<ul>
<li>OpenClover is free and open-source software. </li>
</ul>
</section>
</footer> </section> <!-- class="<API key>" -->
</div> <!-- class="<API key>" -->
</div> <!-- class="aui-page-panel" -->
</div> <!-- id="page" -->
</body>
</html>
|
# -*- coding:utf-8 -*-
# @brief
# @author Eric Yue ( hi.moonlight@gmail.com )
# @version 0.0.1
from distutils.core import setup
V = "0.7"
setup(
name = 'mooncake_utils',
packages = ['mooncake_utils'],
version = V,
description = 'just a useful utils for mooncake personal project.',
author = 'mooncake',
author_email = 'hi.moonlight@gmail.com',
url = 'https://github.com/ericyue/mooncake_utils',
download_url = 'https://github.com/ericyue/mooncake_utils/archive/%s.zip' % V,
keywords = ['utils','data','machine-learning'], # arbitrary keywords
classifiers = [],
)
|
function f1(a) {
try {
throw "x";
} catch (arguments) {
console.log(arguments);
}
}
f1(3);
|
#!/bin/bash
# Note: this requires the fix from:
(
# Clean-up from previous run
kubectl delete rc app
kubectl delete secret creds
kubectl delete ServiceBroker mongodb-sb
kubectl delete ServiceInstance mongodb-instance1
kubectl delete ServiceBinding <API key>
kubectl delete thirdpartyresource service-broker.cncf.org
kubectl delete thirdpartyresource service-instance.cncf.org
kubectl delete thirdpartyresource service-binding.cncf.org
) > /dev/null 2>&1
kubectl get thirdpartyresources
set -ex
# First create the new resource types
kubectl create -f - <<-EOF
apiVersion: extensions/v1beta1
kind: ThirdPartyResource
metadata:
name: service-broker.cncf.org
versions:
- name: v1
EOF
kubectl create -f - <<-EOF
apiVersion: extensions/v1beta1
kind: ThirdPartyResource
metadata:
name: service-instance.cncf.org
versions:
- name: v1
EOF
kubectl create -f - <<-EOF
apiVersion: extensions/v1beta1
kind: ThirdPartyResource
metadata:
name: service-binding.cncf.org
versions:
- name: v1
EOF
sleep 10
# Verify everything is there
curl http://localhost:8080/apis/cncf.org/v1/namespaces/default/servicebrokers
curl http://localhost:8080/apis/cncf.org/v1/namespaces/default/serviceinstances
curl http://localhost:8080/apis/cncf.org/v1/namespaces/default/servicebindings
# New create instances of each type
kubectl create -f - <<-EOF
apiVersion: cncf.org/v1
kind: ServiceBroker
metadata:
name: mongodb-sb
EOF
kubectl create -f - <<-EOF
apiVersion: cncf.org/v1
kind: ServiceInstance
metadata:
name: mongodb-instance1
EOF
kubectl create -f - <<-EOF
apiVersion: cncf.org/v1
kind: ServiceBinding
metadata:
name: <API key>
creds:
user: john
password: letMeIn
EOF
# And the secret to hold our creds
kubectl create -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: creds
data:
vcap-services: <API key>=
type: myspecial/secret
EOF
sleep 10
# Now create the app with VCAP_SERVICES binding info
kubectl create -f - <<EOF
apiVersion: v1
kind: <API key>
metadata:
name: app
spec:
replicas: 1
selector:
version: v1.0
template:
metadata:
name: myserver
labels:
version: v1.0
spec:
containers:
- name: nginx
image: nginx
env:
- name: VCAP_SERVICES
valueFrom:
secretKeyRef:
name: creds
key: vcap-services
EOF
sleep 15
# Prove it worked
kubectl exec `kubectl get pods --template "{{ (index .items 0).metadata.name }}"` -- env
|
title:
description: Istio EDS
weight: 85
keywords: [kubernetes,multicluster]
[](/zh/docs/concepts/<API key>/#) Istio ` EDSEndpoints Discovery ServiceEndpoint ` Istio 1.1 ingress gateway remote EDS Istio endpoint
{{< image width="80%" ratio="36.01%"
link="/docs/examples/multicluster/split-horizon-eds/diagram.svg"
caption=" Istio EDS Kubernetes " >}}
`local` Istio Pilot Istio `remote` Istio CitadelSidecar Injector Ingress gateway VPN
Istio
* Kubernetes `local` `remote`
{{< warning >}}
`local` `remote` Kubernetes API server
{{< /warning >}}
* `kubectl` `--context` `local` `remote` context
{{< text bash >}}
$ kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
cluster1 cluster1 user@foo.com default
cluster2 cluster2 user@foo.com default
{{< /text >}}
* context :
{{< text bash >}}
$ export CTX_LOCAL=<<API key>>
$ export CTX_REMOTE=<<API key>>
{{< /text >}}
pod TLS Istio CA Istio `local` `remote` `cacerts` secret
`remote` selector service `local` Istio ingress gateway `istio-pilot.istio-system` endpoint ingress gateway `local` pilot TLS
local
1.
Istio `global.meshNetworks` `remote` endpoint `install/kubernetes/helm/istio/values.yaml` `network2`
{{< text yaml >}}
meshNetworks:
network2:
endpoints:
- fromRegistry: remote_kubecfg
gateways:
- address: 0.0.0.0
port: 443
{{< /text >}}
gateway address `0.0.0.0` `remote` gateway IP gateway
1. Helm Istio `local` deployment YAML
{{< text bash >}}
$ helm template --namespace=istio-system \
--values @install/kubernetes/helm/istio/values.yaml@ \
--set global.mtls.enabled=true \
--set global.enableTracing=false \
--set security.selfSigned=false \
--set mixer.telemetry.enabled=false \
--set mixer.policy.enabled=false \
--set global.useMCP=false \
--set global.<API key>=true \
--set gateways.istio-egressgateway.enabled=false \
--set global.meshExpansion.enabled=true \
install/kubernetes/helm/istio > istio-auth.yaml
{{< /text >}}
1. Istio `local`
{{< text bash >}}
$ kubectl create --context=$CTX_LOCAL ns istio-system
$ kubectl create --context=$CTX_LOCAL secret generic cacerts -n istio-system --from-file=samples/certs/ca-cert.pem --from-file=samples/certs/ca-key.pem --from-file=samples/certs/root-cert.pem --from-file=samples/certs/cert-chain.pem
$ for i in install/kubernetes/helm/istio-init/files/crd*yaml; do kubectl apply --context=$CTX_LOCAL -f $i; done
$ kubectl create --context=$CTX_LOCAL -f istio-auth.yaml
{{< /text >}}
`local` pod
{{< text bash >}}
$ kubectl get pods --context=$CTX_LOCAL -n istio-system
{{< /text >}}
remote
1. `local` gateway
{{< text bash >}}
$ export LOCAL_GW_ADDR=$(kubectl get --context=$CTX_LOCAL svc --selector=app=<API key> \
-n istio-system -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}")
{{< /text >}}
gateway IP DNS
1. Helm Istio `remote` deployment YAML
{{< text bash >}}
$ helm template install/kubernetes/helm/istio-remote \
--name istio-remote \
--namespace=istio-system \
--set global.mtls.enabled=true \
--set global.enableTracing=false \
--set gateways.enabled=true \
--set gateways.istio-egressgateway.enabled=false \
--set gateways.<API key>.enabled=true \
--set security.selfSigned=false \
--set global.<API key>=true \
--set global.<API key>=true \
--set global.<API key>=true \
--set global.remotePilotAddress=${LOCAL_GW_ADDR} \
--set global.disablePolicyChecks=true \
--set global.policyCheckFailOpen=true \
--set gateways.<API key>.env.ISTIO_META_NETWORK="network2" \
--set global.network="network2" > istio-remote-auth.yaml
{{< /text >}}
1. Istio `remote`
{{< text bash >}}
$ kubectl create --context=$CTX_REMOTE ns istio-system
$ kubectl create --context=$CTX_REMOTE secret generic cacerts -n istio-system --from-file=samples/certs/ca-cert.pem --from-file=samples/certs/ca-key.pem --from-file=samples/certs/root-cert.pem --from-file=samples/certs/cert-chain.pem
$ kubectl create --context=$CTX_REMOTE -f istio-remote-auth.yaml
{{< /text >}}
`remote` pod
{{< text bash >}}
$ kubectl get pods --context=$CTX_REMOTE -n istio-system
{{< /text >}}
1. gateway
* `remote`
{{< text bash >}}
$ kubectl get --context=$CTX_REMOTE svc --selector=app=<API key> -n istio-system -o jsonpath="{.items[0].status.loadBalancer.ingress[0].ip}"
169.61.102.93
{{< /text >}}
* istio configmap
{{< text bash >}}
$ kubectl edit cm -n istio-system --context=$CTX_LOCAL istio
{{< /text >}}
* `network2` gateway address `0.0.0.0` `remote` gateway
Pilot
1. service account `istio-multi` `remote_kubecfg`
{{< text bash >}}
$ CLUSTER_NAME=$(kubectl --context=$CTX_REMOTE config view --minify=true -o "jsonpath={.clusters[].name}")
$ SERVER=$(kubectl --context=$CTX_REMOTE config view --minify=true -o "jsonpath={.clusters[].cluster.server}")
$ SECRET_NAME=$(kubectl --context=$CTX_REMOTE get sa istio-multi -n istio-system -o jsonpath='{.secrets[].name}')
$ CA_DATA=$(kubectl get --context=$CTX_REMOTE secret ${SECRET_NAME} -n istio-system -o "jsonpath={.data['ca\.crt']}")
$ TOKEN=$(kubectl get --context=$CTX_REMOTE secret ${SECRET_NAME} -n istio-system -o "jsonpath={.data['token']}" | base64 --decode)
{{< /text >}}
{{< idea >}}
`openssl enc -d -base64 -A` `base64 --decode`
{{< /idea >}}
1. `remote_kubecfg`
{{< text bash >}}
$ cat <<EOF > remote_kubecfg
apiVersion: v1
clusters:
- cluster:
<API key>: ${CA_DATA}
server: ${SERVER}
name: ${CLUSTER_NAME}
contexts:
- context:
cluster: ${CLUSTER_NAME}
user: ${CLUSTER_NAME}
name: ${CLUSTER_NAME}
current-context: ${CLUSTER_NAME}
kind: Config
preferences: {}
users:
- name: ${CLUSTER_NAME}
user:
token: ${TOKEN}
EOF
{{< /text >}}
remote
`remote` Kubernetes secretlocal Istio Pilot `remote` service instance `local`
{{< text bash >}}
$ kubectl create --context=$CTX_LOCAL secret generic iks --from-file remote_kubecfg -n istio-system
$ kubectl label --context=$CTX_LOCAL secret iks istio/multiCluster=true -n istio-system
{{< /text >}}
`local` `remote` service
## service
service local endpoint remote gateway `helloworld` service `local` `remote` `helloworld`
remote helloworld v2
1. sidecar `sample` namespace
{{< text bash >}}
$ kubectl create --context=$CTX_REMOTE ns sample
$ kubectl label --context=$CTX_REMOTE namespace sample istio-injection=enabled
{{< /text >}}
1. `helloworld-v2.yaml`
{{< text yaml >}}
apiVersion: v1
kind: Service
metadata:
name: helloworld
labels:
app: helloworld
spec:
ports:
- port: 5000
name: http
selector:
app: helloworld
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: helloworld-v2
spec:
replicas: 1
template:
metadata:
labels:
app: helloworld
version: v2
spec:
containers:
- name: helloworld
image: istio/<API key>
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5000
{{< /text >}}
1.
{{< text bash >}}
$ kubectl create --context=$CTX_REMOTE -f helloworld-v2.yaml -n sample
{{< /text >}}
local helloworld v1
1. sidecar `sample` namespace
{{< text bash >}}
$ kubectl create --context=$CTX_LOCAL ns sample
$ kubectl label --context=$CTX_LOCAL namespace sample istio-injection=enabled
{{< /text >}}
1. `helloworld-v1.yaml`
{{< text yaml >}}
apiVersion: v1
kind: Service
metadata:
name: helloworld
labels:
app: helloworld
spec:
ports:
- port: 5000
name: http
selector:
app: helloworld
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: helloworld-v1
spec:
replicas: 1
template:
metadata:
labels:
app: helloworld
version: v1
spec:
containers:
- name: helloworld
image: istio/<API key>
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5000
{{< /text >}}
1. `helloworld-gateway.yaml`
{{< text yaml >}}
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: helloworld-gateway
namespace: sample
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 443
name: tls
protocol: TLS
tls:
mode: AUTO_PASSTHROUGH
hosts:
- "*"
{{< /text >}}
Gateway `remote` remote service SNI sidecar TLS
1.
{{< text bash >}}
$ kubectl create --context=$CTX_LOCAL -f helloworld-v1.yaml -n sample
$ kubectl create --context=$CTX_LOCAL -f helloworld-gateway.yaml -n sample
{{< /text >}}
EDS
`sleep` service `helloworld.sample` service
1. `sleep` service
{{< text bash >}}
$ kubectl create --context=$CTX_LOCAL -f @samples/sleep/sleep.yaml@ -n sample
{{< /text >}}
1. `helloworld.sample` service
{{< text bash >}}
$ kubectl exec --context=$CTX_LOCAL -it -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) -- curl helloworld.sample:5000/hello
{{< /text >}}
`helloworld.sample` service local remote body `v1` `v2`
{{< text bash >}}
$ kubectl exec --context=$CTX_LOCAL -it -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) -- curl helloworld.sample:5000/hello
Defaulting container name to sleep.
Use 'kubectl describe pod/<API key> -n sample' to see all of the containers in this pod.
Hello version: v2, instance: <API key>
{{< /text >}}
{{< text bash >}}
$ kubectl exec --context=$CTX_LOCAL -it -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) -- curl helloworld.sample:5000/hello
Defaulting container name to sleep.
Use 'kubectl describe pod/<API key> -n sample' to see all of the containers in this pod.
Hello version: v1, instance: <API key>
{{< /text >}}
sleep pod `istio-proxy` endpoint IP
{{< text bash >}}
$ kubectl logs --context=$CTX_LOCAL -n sample $(kubectl get pod --context=$CTX_LOCAL -n sample -l app=sleep -o jsonpath={.items[0].metadata.name}) istio-proxy
[2018-11-25T12:37:52.077Z] "GET /hello HTTP/1.1" 200 - 0 60 190 189 "-" "curl/7.60.0" "<API key>" "helloworld.sample:5000" "192.23.120.32:443" outbound|5000||helloworld.sample.svc.cluster.local - 10.20.194.146:5000 10.10.0.89:59496 -
[2018-11-25T12:38:06.745Z] "GET /hello HTTP/1.1" 200 - 0 60 171 170 "-" "curl/7.60.0" "<API key>" "helloworld.sample:5000" "10.10.0.90:5000" outbound|5000||helloworld.sample.svc.cluster.local - 10.20.194.146:5000 10.10.0.89:59646 -
{{< /text >}}
v2 remote gateway IP `192.23.120.32:443`v1 local IP `10.10.0.90:5000`
demo service ____ Istio
`remote`
{{< text bash >}}
$ kubectl delete --context=$CTX_REMOTE -f istio-remote-auth.yaml
$ kubectl delete --context=$CTX_REMOTE ns istio-system
$ kubectl delete --context=$CTX_REMOTE -f helloworld-v2.yaml -n sample
$ kubectl delete --context=$CTX_REMOTE ns sample
{{< /text >}}
`local`
{{< text bash >}}
$ kubectl delete --context=$CTX_LOCAL -f istio-auth.yaml
$ kubectl delete --context=$CTX_LOCAL ns istio-system
$ helm delete --purge --kube-context=$CTX_LOCAL istio-init
$ kubectl delete --context=$CTX_LOCAL -f helloworld-v1.yaml -n sample
$ kubectl delete --context=$CTX_LOCAL -f @samples/sleep/sleep.yaml@ -n sample
$ kubectl delete --context=$CTX_LOCAL ns sample
{{< /text >}}
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="ja">
<head>
<!-- Generated by javadoc (1.8.0_242) on Fri Aug 21 11:53:10 JST 2020 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> jp.cafebabe.pochi.core.config.Value (pochi: extensible birthmark toolkit 1.0.0 API)</title>
<meta name="date" content="2020-08-21">
<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="\u30AF\u30E9\u30B9 jp.cafebabe.pochi.core.config.Value\u306E\u4F7F\u7528 (pochi: extensible birthmark toolkit 1.0.0 API)";
}
}
catch(err) {
}
</script>
<noscript>
<div>JavaScript</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title=""></a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="">
<li><a href="../../../../../../overview-summary.html"></a></li>
<li><a href="../package-summary.html"></a></li>
<li><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config"></a></li>
<li class="navBarCell1Rev"></li>
<li><a href="../package-tree.html"></a></li>
<li><a href="../../../../../../deprecated-list.html"></a></li>
<li><a href="../../../../../../index-all.html"></a></li>
<li><a href="../../../../../../help-doc.html"></a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li></li>
<li></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?jp/cafebabe/pochi/birthmarks/config/class-use/Value.html" target="_top"></a></li>
<li><a href="Value.html" target="_top"></a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../allclasses-noframe.html"></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=" jp.cafebabe.pochi.core.config.Value" class="title"><br>jp.cafebabe.pochi.birthmarks.config.Value</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="">
<caption><span><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config">Value</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col"></th>
<th class="colLast" scope="col"></th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#jp.cafebabe.pochi.core.config">jp.cafebabe.pochi.core.config</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="jp.cafebabe.pochi.core.config">
</a>
<h3><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/package-summary.html">jp.cafebabe.pochi.core.config</a><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config">Value</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="">
<caption><span><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/package-summary.html">jp.cafebabe.pochi.core.config</a><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config">Value</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col"></th>
<th class="colLast" scope="col"></th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/ItemKey.html" title="jp.cafebabe.pochi.core.config">ItemKey</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/ItemValue.html" title="jp.cafebabe.pochi.core.config">ItemValue</a></span></code> </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=""></a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="">
<li><a href="../../../../../../overview-summary.html"></a></li>
<li><a href="../package-summary.html"></a></li>
<li><a href="../../../../../../jp/cafebabe/pochi/birthmarks/config/Value.html" title="jp.cafebabe.pochi.core.config"></a></li>
<li class="navBarCell1Rev"></li>
<li><a href="../package-tree.html"></a></li>
<li><a href="../../../../../../deprecated-list.html"></a></li>
<li><a href="../../../../../../index-all.html"></a></li>
<li><a href="../../../../../../help-doc.html"></a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li></li>
<li></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?jp/cafebabe/pochi/birthmarks/config/class-use/Value.html" target="_top"></a></li>
<li><a href="Value.html" target="_top"></a></li>
</ul>
<ul class="navList" id="<API key>">
<li><a href="../../../../../../allclasses-noframe.html"></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 blended.itestsupport.condition
import akka.testkit.{TestActorRef, TestProbe}
import blended.itestsupport.condition.ConditionActor.CheckCondition
import blended.itestsupport.condition.ConditionActor.<API key>
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpec
import akka.actor.ActorSystem
class ParallelCheckerSpec extends AnyWordSpec
with Matchers {
private implicit val system : ActorSystem = ActorSystem("ParallelChecker")
"The Condition Checker" should {
"respond with a satisfied message on an empty list of conditions" in {
val probe = TestProbe()
val checker = TestActorRef(ConditionActor.props(<API key>()))
checker.tell(CheckCondition, probe.ref)
probe.expectMsg(<API key>(List.empty[Condition], List.empty[Condition]))
}
"respond with a satisfied message after a single wrapped condition has been satisfied" in {
val probe = TestProbe()
val conditions = (1 to 1).map { i => new AlwaysTrue() }.toList
val condition = <API key>(conditions.toSeq:_*)
val checker = TestActorRef(ConditionActor.props(condition))
checker.tell(CheckCondition, probe.ref)
probe.expectMsg(<API key>(conditions, List.empty[Condition]))
}
"respond with a satisfied message after some wrapped conditions have been satisfied" in {
val probe = TestProbe()
val conditions = (1 to 5).map { i => new AlwaysTrue() }.toList
val condition = <API key>(conditions.toSeq:_*)
val checker = TestActorRef(ConditionActor.props(condition))
checker.tell(CheckCondition, probe.ref)
probe.expectMsg(<API key>(conditions, List.empty[Condition]))
}
"respond with a timeout message after a single wrapped condition has timed out" in {
val probe = TestProbe()
val conditions = (1 to 1).map { i => new NeverTrue() }.toList
val condition = <API key>(conditions.toSeq:_*)
val checker = TestActorRef(ConditionActor.props(condition))
checker.tell(CheckCondition, probe.ref)
probe.expectMsg(<API key>(List.empty[Condition], conditions))
}
"respond with a timeout message containing the timed out conditions only" in {
val probe = TestProbe()
val conditions = List(
new AlwaysTrue(),
new AlwaysTrue(),
new NeverTrue(),
new AlwaysTrue(),
new AlwaysTrue()
)
val condition = <API key>(conditions.toSeq:_*)
val checker = TestActorRef(ConditionActor.props(condition))
checker.tell(CheckCondition, probe.ref)
probe.expectMsg(<API key>(
conditions.filter(_.isInstanceOf[AlwaysTrue]),
conditions.filter(_.isInstanceOf[NeverTrue])
))
}
}
}
|
<?php
namespace CultuurNet\UDB3\EventSourcing\DBAL;
class NonCompatibleUuid
{
/**
* @var string
*/
private $uuid;
/**
* DummyUuid constructor.
* @param string $uuid
*/
public function __construct($uuid)
{
$this->uuid = $uuid;
}
}
|
// JavaScript Document
var flag1=true;
var flag2=true;
$(function () {
$.ajax({
type : 'POST',
dataType : 'json',
url : 'baseNeiName.do',
async : true,
cache : false,
error : function(request) {
bootbox.alert({
message : "",
size : 'small'
});
},
success : function(data) {
var i = 0;
for ( var item in data) {
$("#baselistid").after(
"<option value="+data[i].id+">"
+ data[i].name + "</option>");
i++;
}
}
});
$(document).on("click", "#Submit", function() {
var projectname=$("#projectname").val();
var name=$("#name").val();
var address=$("#address").val();
var budget=$("#budget").val();
budget=budget.trim();
var baselist=$("#baselist").val();
var reason=$("#reason").val();
var strmoney=/^[0-9]*$/.test(budget);
var money=budget.substring(1,0);
if(projectname==""){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
else if(name==""){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
else if(address==""){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
else if(budget==""){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
else if(strmoney==false){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
else if(budget.length>1&&money==0){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
else if(baselist==""){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
else if(reason==""){
bootbox.alert({
message : "",
size : 'small'
});
return 0;
}
if (!flag1) {
bootbox.alert({
message: "rar,zip",
size: 'small'
});
$("#applyfile").val('');
return;
}
if (!flag2) {
bootbox.alert({
message: "10M",
size: 'small'
});
$("#applyfile").val('');
return;
}
$("#applyform").submit();
})
$('#applyfile').change(function() {
var filepath = $(this).val();
var file_size = this.files[0].size;
var size = file_size / 1024;
var extStart = filepath.lastIndexOf(".");
var ext = filepath.substring(extStart, filepath.length).toUpperCase();
if (ext != ".RAR" && ext != ".ZIP") {
bootbox.alert({
message: "rar,zip",
size: 'small'
});
$("#applyfile").val('');
flag1=false;
return;
}
if (size > 1024 * 10) {
bootbox.alert({
message: "10M",
size: 'small'
});
$("#applyfile").val('');
flag2=false;
return;
}
flag1=true;
flag2=true;
});
});
|
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Spark NLP 3.4.2 ScalaDoc - com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask</title>
<meta name="description" content="Spark NLP 3.4.2 ScalaDoc - com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask" />
<meta name="keywords" content="Spark NLP 3.4.2 ScalaDoc com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../../../lib/index.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript" src="../../../../../lib/jquery.min.js"></script>
<script type="text/javascript" src="../../../../../lib/jquery.panzoom.min.js"></script>
<script type="text/javascript" src="../../../../../lib/jquery.mousewheel.min.js"></script>
<script type="text/javascript" src="../../../../../lib/index.js"></script>
<script type="text/javascript" src="../../../../../index.js"></script>
<script type="text/javascript" src="../../../../../lib/scheduler.js"></script>
<script type="text/javascript" src="../../../../../lib/template.js"></script>
<script type="text/javascript">
/* this variable can be used by the JS to determine the path to the root document */
var toRoot = '../../../../../';
</script>
</head>
<body>
<div id="search">
<span id="doc-title">Spark NLP 3.4.2 ScalaDoc<span id="doc-version"></span></span>
<span class="close-results"><span class="left"><</span> Back</span>
<div id="textfilter">
<span class="input">
<input autocapitalize="none" placeholder="Search" id="index-input" type="text" accesskey="/" />
<i class="clear material-icons"></i>
<i id="search-icon" class="material-icons"></i>
</span>
</div>
</div>
<div id="search-results">
<div id="search-progress">
<div id="progress-fill"></div>
</div>
<div id="results-content">
<div id="entity-results"></div>
<div id="member-results"></div>
</div>
</div>
<div id="<API key>" style="-<API key>: touch;">
<div id="content-container" style="-<API key>: touch;">
<div id="subpackage-spacer">
<div id="packages">
<h1>Packages</h1>
<ul>
<li name="_root_.root" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="_root_"></a><a id="root:_root_"></a>
<span class="permalink">
<a href="../../../../../index.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../../../index.html"><span class="name">root</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="_root_.com" visbl="pub" class="indented1 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="com"></a><a id="com:com"></a>
<span class="permalink">
<a href="../../../../../com/index.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../../index.html"><span class="name">com</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../../index.html" class="extype" name="_root_">root</a></dd></dl></div>
</li><li name="com.johnsnowlabs" visbl="pub" class="indented2 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="johnsnowlabs"></a><a id="johnsnowlabs:johnsnowlabs"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/index.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../../index.html"><span class="name">johnsnowlabs</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../../index.html" class="extype" name="com">com</a></dd></dl></div>
</li><li name="com.johnsnowlabs.ml" visbl="pub" class="indented3 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ml"></a><a id="ml:ml"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/index.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../../index.html"><span class="name">ml</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../../index.html" class="extype" name="com.johnsnowlabs">johnsnowlabs</a></dd></dl></div>
</li><li name="com.johnsnowlabs.ml.tensorflow" visbl="pub" class="indented4 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="tensorflow"></a><a id="tensorflow:tensorflow"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/index.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="../index.html"><span class="name">tensorflow</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../../index.html" class="extype" name="com.johnsnowlabs.ml">ml</a></dd></dl></div>
</li><li name="com.johnsnowlabs.ml.tensorflow.sign" visbl="pub" class="indented5 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="sign"></a><a id="sign:sign"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/index.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">package</span>
</span>
<span class="symbol">
<a title="" href="index.html"><span class="name">sign</span></a>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="../index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow">tensorflow</a></dd></dl></div>
</li><li name="com.johnsnowlabs.ml.tensorflow.sign.<API key>" visbl="pub" class="indented6 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="<API key>"></a><a id="<API key>:<API key>"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<a title="Based on BERT SavedModel reference, for instance:" href="<API key>$.html"><span class="name"><API key></span></a>
</span>
<p class="shortcomment cmt">Based on BERT SavedModel reference, for instance:</p><div class="fullcomment"><div class="comment cmt"><p>Based on BERT SavedModel reference, for instance:</p><p>signature_def['serving_default']:
The given SavedModel SignatureDef contains the following input(s):</p><p>inputs['attention_mask'] tensor_info:
dtype: DT_INT32
shape: (-1, -1)
name: <API key>:0</p><p>inputs['input_ids'] tensor_info:
dtype: DT_INT32
shape: (-1, -1)
name: <API key>:0</p><p>inputs['token_type_ids'] tensor_info:
dtype: DT_INT32
shape: (-1, -1)
name: <API key>:0</p><p>The given SavedModel SignatureDef contains the following output(s):</p><p>outputs['last_hidden_state'] tensor_info:
dtype: DT_FLOAT
shape: (-1, -1, 768)
name: <API key>:0</p><p>outputs['pooler_output'] tensor_info:
dtype: DT_FLOAT
shape: (-1, 768)
name: <API key>:1</p><p>Method name is: tensorflow/serving/predict*
</p></div><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign">sign</a></dd></dl></div>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="" title=""></a>
<a href="" title="">AttentionMask</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$AttentionMaskV1$.html" title=""></a>
<a href="<API key>$$AttentionMaskV1$.html" title="">AttentionMaskV1</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$DType$.html" title=""></a>
<a href="<API key>$$DType$.html" title="">DType</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$<API key>$.html" title=""></a>
<a href="<API key>$$<API key>$.html" title=""><API key></a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$<API key>$.html" title=""></a>
<a href="<API key>$$<API key>$.html" title=""><API key></a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$DecoderInputIds$.html" title=""></a>
<a href="<API key>$$DecoderInputIds$.html" title="">DecoderInputIds</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$DecoderOutput$.html" title=""></a>
<a href="<API key>$$DecoderOutput$.html" title="">DecoderOutput</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$DimCount$.html" title=""></a>
<a href="<API key>$$DimCount$.html" title="">DimCount</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$<API key>$.html" title=""></a>
<a href="<API key>$$<API key>$.html" title=""><API key></a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$EncoderInputIds$.html" title=""></a>
<a href="<API key>$$EncoderInputIds$.html" title="">EncoderInputIds</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$EncoderOutput$.html" title=""></a>
<a href="<API key>$$EncoderOutput$.html" title="">EncoderOutput</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$InputIds$.html" title=""></a>
<a href="<API key>$$InputIds$.html" title="">InputIds</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$InputIdsV1$.html" title=""></a>
<a href="<API key>$$InputIdsV1$.html" title="">InputIdsV1</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$LastHiddenState$.html" title=""></a>
<a href="<API key>$$LastHiddenState$.html" title="">LastHiddenState</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$LastHiddenStateV1$.html" title=""></a>
<a href="<API key>$$LastHiddenStateV1$.html" title="">LastHiddenStateV1</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$LogitsOutput$.html" title=""></a>
<a href="<API key>$$LogitsOutput$.html" title="">LogitsOutput</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$Name$.html" title=""></a>
<a href="<API key>$$Name$.html" title="">Name</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$PoolerOutput$.html" title=""></a>
<a href="<API key>$$PoolerOutput$.html" title="">PoolerOutput</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$PoolerOutputV1$.html" title=""></a>
<a href="<API key>$$PoolerOutputV1$.html" title="">PoolerOutputV1</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$SerializedSize$.html" title=""></a>
<a href="<API key>$$SerializedSize$.html" title="">SerializedSize</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$ShapeDimList$.html" title=""></a>
<a href="<API key>$$ShapeDimList$.html" title="">ShapeDimList</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="trait" href="<API key>$$TFInfoDescriptor.html" title=""></a>
<a href="<API key>$$TFInfoDescriptor.html" title="">TFInfoDescriptor</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="trait" href="<API key>$$TFInfoNameMapper.html" title=""></a>
<a href="<API key>$$TFInfoNameMapper.html" title="">TFInfoNameMapper</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$TokenTypeIds$.html" title=""></a>
<a href="<API key>$$TokenTypeIds$.html" title="">TokenTypeIds</a>
</li><li class="current-entities indented6">
<span class="separator"></span>
<a class="object" href="<API key>$$TokenTypeIdsV1$.html" title=""></a>
<a href="<API key>$$TokenTypeIdsV1$.html" title="">TokenTypeIdsV1</a>
</li>
</ul>
</div>
</div>
<div id="content">
<body class="object value">
<div id="definition">
<div class="big-circle object">o</div>
<p id="owner"><a href="../../../../index.html" class="extype" name="com">com</a>.<a href="../../../index.html" class="extype" name="com.johnsnowlabs">johnsnowlabs</a>.<a href="../../index.html" class="extype" name="com.johnsnowlabs.ml">ml</a>.<a href="../index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow">tensorflow</a>.<a href="index.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign">sign</a>.<a href="<API key>$.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>"><API key></a></p>
<h1>AttentionMask<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html" title="Permalink">
<i class="material-icons"></i>
</a>
</span></h1>
<h3><span class="morelinks"></span></h3>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<span class="name">AttentionMask</span><span class="result"> extends <a href="<API key>$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.TFInfoNameMapper">TFInfoNameMapper</a> with <span class="extype" name="scala.Product">Product</span> with <span class="extype" name="scala.Serializable">Serializable</span></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="toggleContainer block">
<span class="toggle">
Linear Supertypes
</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.Serializable">Serializable</span>, <span class="extype" name="java.io.Serializable">Serializable</span>, <span class="extype" name="scala.Product">Product</span>, <span class="extype" name="scala.Equals">Equals</span>, <a href="<API key>$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.TFInfoNameMapper">TFInfoNameMapper</a>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div class="toggle"></div>
<div id="memberfilter">
<i class="material-icons arrow"></i>
<span class="input">
<input id="mbrsel-input" placeholder="Filter all members" type="text" accesskey="/" />
</span>
<i class="clear material-icons"></i>
</div>
<div id="filterby">
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By Inheritance</span></li>
</ol>
</div>
<div class="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask"><span>AttentionMask</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.Product"><span>Product</span></li><li class="in" name="scala.Equals"><span>Equals</span></li><li class="in" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.TFInfoNameMapper"><span>TFInfoNameMapper</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div class="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show All</span></li>
</ol>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
</div>
<div id="template">
<div id="allMembers">
<div class="values members">
<h3>Value Members</h3>
<ol>
<li name="scala.AnyRef#!=" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a><a id="!=(Any):Boolean"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#!=(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html###():Int" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a><a id="==(Any):Boolean"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#==(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#asInstanceOf[T0]:T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef#clone" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a><a id="clone():AnyRef"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#clone():Object" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a><a id="eq(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#eq(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#equals" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(x$1:Any):Boolean"></a><a id="equals(Any):Boolean"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#equals(x$1:Any):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#finalize" visbl="prt" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#finalize():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#getClass():Class[_]" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#isInstanceOf[T0]:Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask#key" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="key:String"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#key:String" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">key</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask">AttentionMask</a> → <a href="<API key>$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.TFInfoNameMapper">TFInfoNameMapper</a></dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a><a id="ne(AnyRef):Boolean"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#ne(x$1:AnyRef):Boolean" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#notify():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#notifyAll():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a><a id="synchronized[T0](⇒T0):T0"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#synchronized[T0](x$1:=>T0):T0" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask#value" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="value:String"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#value:String" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">value</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd><a href="" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.AttentionMask">AttentionMask</a> → <a href="<API key>$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.TFInfoNameMapper">TFInfoNameMapper</a></dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#wait():Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a><a id="wait(Long,Int):Unit"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#wait(x$1:Long,x$2:Int):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" class="indented0 " data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a><a id="wait(Long):Unit"></a>
<span class="permalink">
<a href="../../../../../com/johnsnowlabs/ml/tensorflow/sign/<API key>$$AttentionMask$.html#wait(x$1:Long):Unit" title="Permalink">
<i class="material-icons"></i>
</a>
</span>
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
<span class="name">@native</span><span class="args">()</span>
</dd></dl></div>
</li>
</ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.Serializable">
<h3>Inherited from <span class="extype" name="scala.Serializable">Serializable</span></h3>
</div><div class="parent" name="java.io.Serializable">
<h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3>
</div><div class="parent" name="scala.Product">
<h3>Inherited from <span class="extype" name="scala.Product">Product</span></h3>
</div><div class="parent" name="scala.Equals">
<h3>Inherited from <span class="extype" name="scala.Equals">Equals</span></h3>
</div><div class="parent" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.TFInfoNameMapper">
<h3>Inherited from <a href="<API key>$$TFInfoNameMapper.html" class="extype" name="com.johnsnowlabs.ml.tensorflow.sign.<API key>.TFInfoNameMapper">TFInfoNameMapper</a></h3>
</div><div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
</body>
</div>
</div>
</div>
</body>
</html>
|
// Module Name:
// Btsdk_Stru.h
// Abstract:
// This module defines BlueSoleil SDK structures.
// Usage:
// #include "Btsdk_Stru.h"
// Revision History:
// 2007-12-25 Created
#ifndef _BTSDK_STRU_H
#define _BTSDK_STRU_H
typedef struct _BtSdkCallbackStru
{
BTUINT16 type; /*type of callback*/
void *func; /*callback function*/
}BtSdkCallbackStru, *PBtSdkCallbackStru;
typedef struct <API key>
{
BTUINT8 lmp_feature[8]; /* LMP features */
BTUINT16 manuf_name; /* the name of the manufacturer */
BTUINT16 lmp_subversion; /* the sub version of the LMP firmware */
BTUINT8 lmp_version; /* the main version of the LMP firmware */
BTUINT8 hci_version; /* HCI version */
BTUINT16 hci_revision; /* HCI revision */
BTUINT8 country_code; /* country code */
} <API key>, *<API key>;
typedef struct _BtSdkVendorCmdStru
{
BTUINT16 ocf; /* OCF Range (10 bits): 0x0000-0x03FF */
BTUINT8 param_len; /* length of param in bytes */
BTUINT8 param[1]; /* Parameters to be packed in the vendor command. Little endian is adopted. */
} BtSdkVendorCmdStru, *PBtSdkVendorCmdStru;
typedef struct <API key>
{
BTUINT8 ev_code; /* Event code. */
BTUINT8 param_len; /* length of param in bytes */
BTUINT8 param[1]; /* Event parameters. */
} BtSdkEventParamStru, *<API key>;
typedef struct <API key>
{
BTUINT8 lmp_feature[8]; /* LMP features */
BTUINT16 manuf_name; /* the name of the manufacturer */
BTUINT16 lmp_subversion; /* the sub version of the LMP firmware */
BTUINT8 lmp_version; /* the main version of the LMP firmware */
} <API key>, *<API key>;
typedef struct <API key>
{
BTUINT32 mask; /*Specifies members available.*/
BTDEVHDL dev_hdl; /*Handle assigned to the device record*/
BTUINT8 bd_addr[BTSDK_BDADDR_LEN]; /*BT address of the device record*/
BTUINT8 name[BTSDK_DEVNAME_LEN]; /*Name of the device record, must be in UTF-8*/
BTUINT32 dev_class; /*Device class*/
<API key> lmp_info; /* LMP info */
BTUINT8 link_key[BTSDK_LINKKEY_LEN]; /* link key for this device. */
} <API key>;
typedef <API key>* <API key>;
/* Parameters of Hold_Mode command */
typedef struct _BtSdkHoldModeStru {
BTUINT16 conn_hdl; /* reserved, set it to 0. */
BTUINT16 max; /* Hold mode max interval. */
BTUINT16 min; /* Hold mode min interval. */
} BtSdkHoldModeStru;
typedef BtSdkHoldModeStru* PBtSdkHoldModeStru;
/* Parameters of Sniff_Mode command */
typedef struct _BtSdkSniffModeStru {
BTUINT16 conn_hdl; /* reserved, set it to 0. */
BTUINT16 max; /* Sniff mode max interval. */
BTUINT16 min; /* Sniff mode min interval. */
BTUINT16 attempt; /* Sniff mode attempt value. */
BTUINT16 timeout; /* Sniff mode timeout value. */
} BtSdkSniffModeStru;
typedef BtSdkSniffModeStru* PBtSdkSniffModeStru;
/* Parameters of Park_Mode (V1.1) or Park_State (V1.2) command */
typedef struct _BtSdkParkModeStru {
BTUINT16 conn_hdl; /* reserved, set it to 0. */
BTUINT16 max; /* Beacon max interval. */
BTUINT16 min; /* Beacon min interval. */
} BtSdkParkModeStru;
typedef BtSdkParkModeStru* PBtSdkParkModeStru;
/* Basic SDP Element */
typedef struct _BtSdkUUIDStru
{
BTUINT32 Data1;
BTUINT16 Data2;
BTUINT16 Data3;
BTUINT8 Data4[8];
} BtSdkUUIDStru, *PBtSdkUUIDStru;
typedef struct <API key>
{
BTUINT32 mask; /*Specifies the valid bytes in the uuid*/
BtSdkUUIDStru uuid; /*UUID value*/
} <API key>, *<API key>;
/* Remote service record attributes */
typedef struct <API key>
{
BTUINT16 mask; /*Decide which parameter to be retrieved*/
union
{
BTUINT16 svc_class; /* For Compatibility */
BTUINT16 service_class;
}; /*Type of this service record*/
BTDEVHDL dev_hdl; /*Handle to the remote device which provides this service.*/
BTUINT8 svc_name[<API key>]; /*Service name in UTF-8*/
BTLPVOID ext_attributes; /*Free by the APP*/
BTUINT16 status;
} <API key>, *<API key>;
typedef struct <API key>
{
BTUINT32 size; /*Size of <API key>*/
BTUINT8 server_channel; /*Server channel value of this SPP service record*/
} <API key>, *<API key>;
typedef struct <API key>
{
BTUINT32 role : 2;
BTUINT32 result : 30;
BTDEVHDL device_handle;
BTSVCHDL service_handle;
BTUINT16 service_class;
BTUINT32 duration;
BTUINT32 received_bytes;
BTUINT32 sent_bytes;
} <API key>, *<API key>;
typedef struct <API key>
{
BTDEVHDL dev_hdl; /* Handle to the remote device tries to upload/delete the file. */
BTUINT16 operation; /* Specify the operation on the file.
It can be one of the following values:
<API key>: The remote device request to upload the file.
<API key>: The remote device request to delete the file.
<API key>: The remote device request to delete the folder. In this case,
file_name specify the name of the folder to be deleted.
*/
BTUINT16 flag; /* Flag specifies the current status of uploading/deleting.
It can be one of the following values:
BTSDK_ER_CONTINUE: The remote device request to upload/delete the file.
BTSDK_ER_SUCCESS: The remote device uploads/deletes the file successfully.
Other value: Error code specifies the reason of uploading/deleting failure.
*/
BTUINT8 file_name[<API key>]; /* the name of the file uploaded/deleted or to be uploaded/deleted */
} <API key>, *<API key>;
typedef struct <API key>
{
BTUINT32 size; /* Size of this structure */
BTUINT32 sdp_record_handle; /* 32bit interger specifies the SDP service record handle */
BtSdkUUIDStru service_class_128; /* 128bit UUID specifies the service class of this service record */
BTUINT8 svc_name[<API key>]; /* Service name, in UTF-8 */
BTUINT8 rf_svr_chnl; /* RFCOMM server channel assigned to this service record */
BTUINT8 com_index; /* Index of the local COM port assigned to this service record */
} <API key>, *<API key>;
/* lParam for SPP */
typedef struct <API key>
{
BTUINT32 size;
BTUINT16 mask; //Reserved set 0
BTUINT8 com_index;
} <API key>, *<API key>;
/* lParam for OPP */
typedef struct <API key>
{
BTUINT32 size; /*Size of this structure, use for verification and versioning.*/
BTUINT8 inbox_path[<API key>]; /*must in UTF-8*/
BTUINT8 outbox_path[<API key>]; /*must in UTF-8*/
BTUINT8 own_card[<API key>]; /*must in UTF-8*/
} <API key>, *<API key>;
/* lParam for DUN */
typedef struct <API key>
{
BTUINT32 size;
BTUINT16 mask; //Reserved set 0
BTUINT8 com_index;
} <API key>, *<API key>;
/* lParam for FAX */
typedef struct <API key>
{
BTUINT32 size;
BTUINT16 mask; //Reserved set 0
BTUINT8 com_index;
} <API key>, *<API key>;
/* Used By +COPS */
typedef struct Btsdk_HFP_COPSInfo {
BTUINT8 mode; /* current mode and provides no information with regard to the name of the operator */
BTUINT8 format; /* the format of the operator parameter string */
BTUINT8 operator_len;
BTINT8 operator_name[1]; /* the string in alphanumeric format representing the name of the network operator */
} <API key>, *<API key>;
/* Used By +BINP, +CNUM, +CLIP, +CCWA */
typedef struct Btsdk_HFP_PhoneInfo {
BTUINT8 type; /* the format of the phone number provided */
BTUINT8 service; /* Indicates which service this phone number relates to. Shall be either 4 (voice) or 5 (fax). */
BTUINT8 num_len; /* the length of the phone number provided */
BTINT8 number[32]; /* subscriber number, the length shall be PHONENUM_MAX_DIGITS */
BTUINT8 name_len; /* length of subaddr */
BTINT8 alpha_str[1]; /* string type subaddress of format specified by <cli_validity> */
} <API key>, *<API key>;
/* Used By +CLCC */
typedef struct Btsdk_HFP_CLCCInfo {
BTUINT8 idx; /* The numbering (start with 1) of the call given by the sequence of setting up or receiving the calls */
BTUINT8 dir; /* Direction, 0=outgoing, 1=incoming */
BTUINT8 status; /* 0=active, 1=held, 2=dialling(outgoing), 3=alerting(outgoing), 4=incoming(incoming), 5=waiting(incoming) */
BTUINT8 mode; /* 0=voice, 1=data, 2=fax */
BTUINT8 mpty; /* 0=not multiparty, 1=multiparty */
BTUINT8 type; /* the format of the phone number provided */
BTUINT8 num_len; /* the length of the phone number provided */
BTINT8 number[1]; /* phone number */
} <API key>, *<API key>;
/* current state mask code for function <API key> */
typedef struct Btsdk_HFP_CINDInfo {
BTUINT8 service; /* 0=unavailable, 1=available */
BTUINT8 call; /* 0=no active call, 1=have active call */
BTUINT8 callsetup; /* 0=no callsetup, 1=incoming, 2=outgoing, 3=outalert */
BTUINT8 callheld; /* 0=no callheld, 1=active-hold, 2=onhold */
BTUINT8 signal;
BTUINT8 roam; /* 0=no roam, 1= roam */
BTUINT8 battchg;
} <API key>, *<API key>;
/* Parameter of the <API key> and <API key> events */
typedef struct Btsdk_HFP_ConnInfo {
BTUINT16 role; /* 16bit UUID specifies the local role of the connection:
BTSDK_CLS_HANDSFREE - Local device acts as a HF.
<API key> - Local device acts as a Hands-free AG.
BTSDK_CLS_HEADSET - Local device acts as a HS.
<API key> - Local device acts as a Headset AG. */
BTDEVHDL dev_hdl; /* Handle to the remote device. */
} <API key>, *<API key>;
/* Used by <API key> */
typedef struct <API key> {
BTUINT16 cmd_code; /* Which AT command code got an error */
BTUINT8 result_code; /* What result occurs, <API key>, CME Error Code or standard error result code */
} <API key>, *<API key>;
/* lParam of Btsdk_StartClient, Btsdk_StartClientEx and <API key>; and,
ext_attributes of <API key>. */
typedef struct _BtSdkHFPUIParam {
BTUINT32 size; /* Must set to sizeof(<API key>) */
BTUINT16 mask; /* Reserved, set to 0 */
BTUINT16 features; /* Local supported features.
1) For HSP, it shall be 0.
2) For HFP-HF, it can be the bit OR operation of following values:
BTSDK_HF_BRSF_NREC, <API key>, BTSDK_HF_BRSF_CLIP,
BTSDK_HF_BRSF_BVRA, <API key>, <API key>,
<API key>.
3) For HFP-AG, it can be the bit OR operation of following values:
<API key>, BTSDK_AG_BRSF_NREC, BTSDK_AG_BRSF_BVRA,
<API key>, BTSDK_AG_BRSF_BINP, <API key>,
<API key>, <API key>,
<API key>.
*/
} BtSdkHFPUIParamStru, *<API key>,
<API key>, *<API key>,
<API key>, *<API key>;
typedef struct _BtSdk_SDAP_PNPINFO
{
BTUINT16 size;
BTUINT16 mask;
BTUINT32 svc_hdl;
BTUINT16 spec_id;
BTUINT16 vendor_id;
BTUINT16 product_id;
BTUINT16 version_value;
BTUINT16 vendor_id_src;
}BtSdk_SDAP_PNPINFO, *PBtSdk_SDAP_PNPINFO;
typedef struct <API key>
{
BTUINT32 size;
BTUINT16 mask;
BTUINT16 spec_id;
BTUINT16 vendor_id;
BTUINT16 product_id;
BTUINT16 version;
BTBOOL primary_record;
BTUINT16 vendor_id_source;
BTUINT16 list_size;
BTUINT8 str_url_list[1];
} <API key>, *<API key>;
#endif
|
package com.ebay.pulsar.analytics.metricstore.druid.query.sql;
/**
*
* @author mingmwang
*
*/
public class HllConstants {
public static final String HLLPREFIX = "hllhaving_";
}
|
using System;
using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Text;
using System.IO;
using System.IO.Packaging;
using System.Globalization;
using DocumentFormat.OpenXml;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
#if <API key>
using System.Runtime.Serialization;
#endif
using static System.<API key>;
namespace DocumentFormat.OpenXml.Packaging
{
internal struct <API key>
{
internal string Id;
internal string RelationshipType;
internal TargetMode TargetMode;
internal Uri TargetUri;
};
<summary>
Defines the base class for <API key> and <API key> objects.
</summary>
abstract internal class <API key> : List<<API key>>
{
protected <API key> <API key> { get; set; }
internal bool StrictTranslation { get; set; }
<summary>
This method fills the collection with PackageRels from the <API key> that is given in the sub class.
</summary>
protected void Build()
{
foreach (PackageRelationship relationship in this.<API key>)
{
bool found;
string <API key>;
<API key> <API key>;
<API key>.TargetUri = relationship.TargetUri;
<API key>.TargetMode = relationship.TargetMode;
<API key>.Id = relationship.Id;
<API key>.RelationshipType = relationship.RelationshipType;
// If packageRel.RelationshipType is something for Strict, it tries to get the equivalent in Transitional.
found = NamespaceIdMap.<API key>(<API key>.RelationshipType, out <API key>);
if (found)
{
<API key>.RelationshipType = <API key>;
this.StrictTranslation = true;
}
this.Add(<API key>);
}
}
internal void <API key>()
{
// Update the relationshipTypes when editable.
if (this.GetPackage().FileOpenAccess != FileAccess.Read)
{
for (int index = 0; index < this.Count; index++)
{
<API key> <API key> = this[index];
this.ReplaceRelationship(<API key>.TargetUri, <API key>.TargetMode, <API key>.RelationshipType, <API key>.Id);
}
}
}
abstract internal void ReplaceRelationship(Uri targetUri, TargetMode targetMode, string strRelationshipType, string strId);
abstract internal Package GetPackage();
}
<summary>
Represents a collection of relationships that are obtained from the package.
</summary>
internal class <API key> : <API key>
{
public Package BasePackage { get; set; }
public <API key>(Package package)
{
this.BasePackage = package;
if (this.BasePackage == null)
{
throw new <API key>(nameof(BasePackage));
}
this.<API key> = this.BasePackage.GetRelationships();
this.Build();
}
internal override void ReplaceRelationship(Uri targetUri, TargetMode targetMode, string strRelationshipType, string strId)
{
this.BasePackage.DeleteRelationship(strId);
this.BasePackage.CreateRelationship(targetUri, targetMode, strRelationshipType, strId);
}
internal override Package GetPackage()
{
return this.BasePackage;
}
}
<summary>
Represents a collection of relationships that are obtained from the package part.
</summary>
internal class <API key> : <API key>
{
public PackagePart BasePackagePart { get; set; }
public <API key>(PackagePart packagePart)
{
this.BasePackagePart = packagePart;
if (this.BasePackagePart == null)
{
throw new <API key>(nameof(BasePackagePart));
}
this.<API key> = this.BasePackagePart.GetRelationships();
this.Build();
}
internal override void ReplaceRelationship(Uri targetUri, TargetMode targetMode, string strRelationshipType, string strId)
{
this.BasePackagePart.DeleteRelationship(strId);
this.BasePackagePart.CreateRelationship(targetUri, targetMode, strRelationshipType, strId);
}
internal override Package GetPackage()
{
return this.BasePackagePart.Package;
}
}
<summary>
Represents a base class for strong typed Open XML document classes.
</summary>
public abstract class OpenXmlPackage : <API key>, IDisposable
{
#region private data members
//internal object _lock = new object( );
private bool _disposed;
[DebuggerBrowsable(<API key>.Never)]
private Package _metroPackage;
private FileAccess _accessMode;
private string <API key>;
// compression level for content that is stored in a PackagePart.
[DebuggerBrowsable(<API key>.Never)]
private CompressionOption _compressionOption = CompressionOption.Normal;
private PartUriHelper _partUriHelper = new PartUriHelper();
[DebuggerBrowsable(<API key>.Never)]
private <API key> <API key> = new <API key>();
private LinkedList<DataPart> _dataPartList = new LinkedList<DataPart>();
#endregion
internal OpenSettings OpenSettings { get; set; }
private bool _strictTranslation = false;
internal bool StrictTranslation
{
get
{
return this._strictTranslation;
}
set
{
this._strictTranslation = value;
}
}
#region internal constructors
<summary>
Initializes a new instance of the OpenXmlPackage class.
</summary>
protected OpenXmlPackage()
: base()
{
}
<summary>
Initializes a new instance of the OpenXmlPackage class using the supplied Open XML package.
</summary>
<param name="package">The target package for the OpenXmlPackage class.</param>
<exception cref="<API key>">Thrown when package is a null reference.</exception>
<exception cref="IOException">Thrown when package is not opened with read access.</exception>
<exception cref="<API key>">Thrown when the package is not a valid Open XML document.</exception>
internal void OpenCore(Package package)
{
if (package == null)
{
throw new <API key>(nameof(package));
}
if (package.FileOpenAccess == FileAccess.Write)
{
// TODO: move this line to derived class
throw new IOException(ExceptionMessages.<API key>);
}
this._accessMode = package.FileOpenAccess;
this._metroPackage = package;
this.Load();
}
<summary>
Initializes a new instance of the OpenXmlPackage class with access to a specified Open XML package.
</summary>
<param name="package">The target package for the OpenXmlPackage class.</param>
<exception cref="<API key>">Thrown when package is a null reference.</exception>
<exception cref="IOException">Thrown when package is not opened with write access.</exception>
<exception cref="<API key>">Thrown when the package is not a valid Open XML document.</exception>
internal void CreateCore(Package package)
{
if (package == null)
{
throw new <API key>(nameof(package));
}
//if (package.FileOpenAccess != FileAccess.Write)
// // TODO: move this line to derived class
// throw new IOException(ExceptionMessages.<API key>);
this._accessMode = package.FileOpenAccess;
this._metroPackage = package;
}
<summary>
Initializes a new instance of the OpenXmlPackage class using the supplied I/O stream class.
</summary>
<param name="stream">The I/O stream on which to open the package.</param>
<param name="readWriteMode">Indicates whether or not the package is in read/write mode. False indicates read-only mode.</param>
<exception cref="IOException">Thrown when the specified stream is write-only. The package to open requires read or read/write permission.</exception>
internal void OpenCore(Stream stream, bool readWriteMode)
{
if (stream == null)
{
throw new <API key>(nameof(stream));
}
if (readWriteMode)
{
this._accessMode = FileAccess.ReadWrite;
}
else
{
this._accessMode = FileAccess.Read;
}
this._metroPackage = Package.Open(stream, (this._accessMode == FileAccess.Read) ? FileMode.Open : FileMode.OpenOrCreate, this._accessMode);
this.Load();
}
<summary>
Initializes a new instance of the OpenXmlPackage class using the supplied I/O stream class.
</summary>
<param name="stream">The I/O stream on which to open the package.</param>
<exception cref="IOException">Thrown when the specified stream is read-only. The package to open requires write or read/write permission. </exception>
internal void CreateCore(Stream stream)
{
if (stream == null)
{
throw new <API key>(nameof(stream));
}
if (!stream.CanWrite)
{
throw new <API key>(ExceptionMessages.<API key>);
}
this._accessMode = FileAccess.ReadWrite;
//this._accessMode = FileAccess.Write;
// below line will exception by Package. Packaging API bug?
// this._metroPackage = Package.Open(stream, FileMode.Create, packageAccess);
this._metroPackage = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite);
}
<summary>
Initializes a new instance of the OpenXmlPackage class using the specified file.
</summary>
<param name="path">The path and file name of the target package for the OpenXmlPackage.</param>
<param name="readWriteMode">Indicates whether or not the package is in read/write mode. False for read only mode.</param>
internal void OpenCore(string path, bool readWriteMode)
{
if (path == null)
{
throw new <API key>(nameof(path));
}
if (readWriteMode)
{
this._accessMode = FileAccess.ReadWrite;
}
else
{
this._accessMode = FileAccess.Read;
}
this._metroPackage = Package.Open(path, (this._accessMode == FileAccess.Read) ? FileMode.Open : FileMode.OpenOrCreate, this._accessMode, (this._accessMode == FileAccess.Read) ? FileShare.Read : FileShare.None);
this.Load();
}
<summary>
Initializes a new instance of the OpenXmlPackage class using the supplied file.
</summary>
<param name="path">The path and file name of the target package for the OpenXmlPackage.</param>
internal void CreateCore(string path)
{
if (path == null)
{
throw new <API key>(nameof(path));
}
this._accessMode = FileAccess.ReadWrite;
//this._accessMode = FileAccess.Write;
// below line will exception by Package. Packaging API bug?
// this._metroPackage = Package.Open(path, FileMode.Create, packageAccess, FileShare.None);
this._metroPackage = Package.Open(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None);
}
<summary>
Loads the package. This method must be called in the constructor of a derived class.
</summary>
private void Load()
{
Profiler.CommentMarkProfile(Profiler.MarkId.<API key>);
try
{
Dictionary<Uri, OpenXmlPart> loadedParts = new Dictionary<Uri, OpenXmlPart>();
bool hasMainPart = false;
<API key> <API key> = new <API key>(this._metroPackage);
// relationCollection.StrictTranslation is true when this collection contains Transitional relationships converted from Strict.
this.StrictTranslation = <API key>.StrictTranslation;
// AutoSave must be false when opening ISO Strict doc as editable.
// (Attention: #2545529. Now we disable this code until we finally decide to go with this. Instead, we take an alternative approach that is added in the SavePartContents() method
// which we ignore AutoSave when this.StrictTranslation is true to keep consistency in the document.)
//if (this.StrictTranslation && (this._accessMode == FileAccess.ReadWrite || this._accessMode == FileAccess.Write) && !this.AutoSave)
// <API key> exception = new <API key>(ExceptionMessages.<API key>);
// throw exception;
// auto detect document type (main part type for Transitional)
foreach (<API key> relationship in <API key>)
{
if (relationship.RelationshipType == this.<API key>)
{
hasMainPart = true;
Uri uriTarget = PackUriHelper.ResolvePartUri(new Uri("/", UriKind.Relative), relationship.TargetUri);
PackagePart metroPart = this.Package.GetPart(uriTarget);
if (!this.<API key>(metroPart.ContentType))
{
<API key> exception = new <API key>(ExceptionMessages.InvalidPackageType);
throw exception;
}
this.MainPartContentType = metroPart.ContentType;
break;
}
}
if (!hasMainPart)
{
// throw exception is the package do not have the main part (MainDocument / Workbook / Presentation part)
<API key> exception = new <API key>(ExceptionMessages.NoMainPart);
throw exception;
}
this.<API key>(this, null, <API key>, loadedParts);
}
catch (<API key>)
{
// invalid part ( content type is not expected )
this.Close();
throw;
}
catch (System.UriFormatException)
{
// UriFormatException is replaced here with <API key>. <O15:#322821>
<API key> exception = new <API key>(ExceptionMessages.InvalidUriFormat);
this.Close();
throw exception;
}
catch (Exception)
{
this.Close();
throw;
}
Profiler.CommentMarkProfile(Profiler.MarkId.<API key>);
}
#endregion
#region public properties
<summary>
Gets the package of the document.
</summary>
public Package Package
{
get
{
this.<API key>();
return _metroPackage;
}
}
<summary>
Gets the FileAccess setting for the document.
The current I/O access settings are: Read, Write, or ReadWrite.
</summary>
public FileAccess FileOpenAccess
{
get { return this._metroPackage.FileOpenAccess; }
}
<summary>
Gets or sets the compression level for the content of the new part.
</summary>
public CompressionOption CompressionOption
{
get { return this._compressionOption; }
set { this._compressionOption = value; }
}
<summary>
Gets the core package properties of the Open XML document.
</summary>
public PackageProperties PackageProperties
{
get
{
this.<API key>();
return this.Package.PackageProperties;
}
}
<summary>
Gets a <API key> part which provides a mapping from ContentType to part extension.
</summary>
public <API key> <API key>
{
get
{
this.<API key>();
return this.<API key>;
}
}
<summary>
Gets or sets a value that indicates the maximum allowable number of characters in an Open XML part. A zero (0) value indicates that there are no limits on the size of the part. A non-zero value specifies the maximum size, in characters.
</summary>
<remarks>
This property allows you to mitigate denial of service attacks where the attacker submits a package with an extremely large Open XML part. By limiting the size of a part, you can detect the attack and recover reliably.
</remarks>
public long MaxCharactersInPart
{
get;
internal set;
}
<summary>
Enumerates all the <see cref="DataPart"/> parts in the document package.
</summary>
public IEnumerable<DataPart> DataParts
{
get
{
return this._dataPartList;
}
}
#endregion
#region public methods
<summary>
Adds the specified part to the document.
Use the returned part to operate on the part added to the document.
</summary>
<typeparam name="T">A class that is derived from the OpenXmlPart class.</typeparam>
<param name="part">The part to add to the document.</param>
<returns>The added part in the document. Differs from the part that was passed as an argument.</returns>
<exception cref="<API key>">Thrown when the part is not allowed to be added.</exception>
<exception cref="<API key>">Thrown when the part type already exists and multiple instances of the part type is not allowed.</exception>
public override T AddPart<T>(T part)
{
this.<API key>();
if (part == null)
{
throw new <API key>(nameof(part));
}
if (part.RelationshipType == this.<API key> &&
part.ContentType != this.MainPartContentType)
{
throw new <API key>(ExceptionMessages.MainPartIsDifferent);
}
return (T)AddPartFrom(part, null);
}
<summary>
Deletes all the parts with the specified part type from the package recursively.
</summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1004:<API key>")]
public void <API key><T>() where T : OpenXmlPart
{
this.<API key>();
<API key><T>();
}
// Remove this method due to bug #18394
// User can call doc.Package.Flush( ) as a workaround.
// <summary>
// Saves the contents of all parts and relationships that are contained in the OpenXml package.
// </summary>
//public void Save()
// this.<API key>();
// this.Package.Flush();
<summary>
Saves and closes the OpenXml package and all underlying part streams.
</summary>
public void Close()
{
this.<API key>();
Dispose();
}
#region methods to operate DataPart
<summary>
Creates a new <see cref="MediaDataPart"/> part in the document package.
</summary>
<param name="contentType">The content type of the new <see cref="MediaDataPart"/> part.</param>
<returns>The added <see cref="MediaDataPart"/> part.</returns>
<exception cref="<API key>">Thrown when <paramref name="contentType"/> is a null reference.</exception>
public MediaDataPart CreateMediaDataPart(string contentType)
{
<API key>();
if (contentType == null)
{
throw new <API key>(nameof(contentType));
}
MediaDataPart mediaDataPart = new MediaDataPart();
mediaDataPart.CreateInternal(this.<API key>, contentType, null);
this._dataPartList.AddLast(mediaDataPart);
return mediaDataPart;
}
<summary>
Creates a new <see cref="MediaDataPart"/> part in the document package.
</summary>
<param name="contentType">The content type of the new <see cref="MediaDataPart"/> part.</param>
<param name="extension">The part name extension (.dat, etc.) of the new <see cref="MediaDataPart"/> part.</param>
<returns>The added <see cref="MediaDataPart"/> part.</returns>
<exception cref="<API key>">Thrown when <paramref name="contentType"/> is a null reference.</exception>
<exception cref="<API key>">Thrown when <paramref name="extension"/> is a null reference.</exception>
public MediaDataPart CreateMediaDataPart(string contentType, string extension)
{
<API key>();
if (contentType == null)
{
throw new <API key>(nameof(contentType));
}
if (extension == null)
{
throw new <API key>(nameof(extension));
}
MediaDataPart mediaDataPart = new MediaDataPart();
mediaDataPart.CreateInternal(this.<API key>, contentType, extension);
this._dataPartList.AddLast(mediaDataPart);
return mediaDataPart;
}
<summary>
Creates a new <see cref="MediaDataPart"/> part in the document package.
</summary>
<param name="mediaDataPartType">The content type of the new <see cref="MediaDataPart"/> part.</param>
<returns>The added <see cref="MediaDataPart"/> part.</returns>
public MediaDataPart CreateMediaDataPart(MediaDataPartType mediaDataPartType)
{
<API key>();
MediaDataPart mediaDataPart = new MediaDataPart();
mediaDataPart.CreateInternal(this.<API key>, mediaDataPartType);
this._dataPartList.AddLast(mediaDataPart);
return mediaDataPart;
}
<summary>
Deletes the specified <see cref="DataPart"/> from the document package.
</summary>
<param name="dataPart">The <see cref="DataPart"/> to be deleted.</param>
<returns>Returns true if the part is successfully removed; otherwise returns false. This method also returns false if the part was not found or the parameter is null.</returns>
<exception cref="<API key>">Thrown when <paramref name="dataPart"/> is referenced by another part in the document package.</exception>
public bool DeletePart(DataPart dataPart)
{
<API key>();
if (dataPart == null)
{
throw new <API key>(nameof(dataPart));
}
if (dataPart.OpenXmlPackage != this)
{
throw new <API key>(ExceptionMessages.ForeignDataPart);
}
if (IsOrphanDataPart(dataPart))
{
// delete the part from the package
dataPart.Destroy();
return this._dataPartList.Remove(dataPart);
}
else
{
throw new <API key>(ExceptionMessages.DataPartIsInUse);
}
}
#endregion
#endregion
#region public virtual methods
<summary>
Validates the package. This method does not validate the XML content in each part.
</summary>
<param name="validationSettings">The <API key> for validation events.</param>
<remarks>If validationSettings is null or no EventHandler is set, the default behavior is to throw an <API key> on the validation error. </remarks>
[Obsolete(<API key>.<API key>, false)]
public void Validate(<API key> validationSettings)
{
this.<API key>();
<API key> <API key>;
if (validationSettings != null && validationSettings.GetEventHandler() != null)
{
<API key> = validationSettings;
}
else
{
// use default <API key>( ) which throw an exception
<API key> = new <API key>();
<API key>.EventHandler += new EventHandler<<API key>>(<API key>);
}
// TODO: what's expected behavior?
<API key>.FileFormat = FileFormatVersions.Office2007;
// for cycle defense
Dictionary<OpenXmlPart, bool> processedParts = new Dictionary<OpenXmlPart, bool>();
ValidateInternal(<API key>, processedParts);
}
#pragma warning disable 0618 // CS0618: A class member was marked with the Obsolete attribute, such that a warning will be issued when the class member is referenced.
<summary>
Validates the package. This method does not validate the XML content in each part.
</summary>
<param name="validationSettings">The <API key> for validation events.</param>
<param name="fileFormatVersion">The target file format version.</param>
<remarks>If validationSettings is null or no EventHandler is set, the default behavior is to throw an <API key> on the validation error. </remarks>
internal void Validate(<API key> validationSettings, FileFormatVersions fileFormatVersion)
{
this.<API key>();
Debug.Assert(validationSettings != null);
Debug.Assert(fileFormatVersion == FileFormatVersions.Office2007 || fileFormatVersion == FileFormatVersions.Office2010 || fileFormatVersion == FileFormatVersions.Office2013);
validationSettings.FileFormat = fileFormatVersion;
// for cycle defense
Dictionary<OpenXmlPart, bool> processedParts = new Dictionary<OpenXmlPart, bool>();
ValidateInternal(validationSettings, processedParts);
}
#endregion
#region virtual methods / properties
#endregion
#region internal methods
<summary>
Reserves the URI of the loaded part.
</summary>
<param name="contentType"></param>
<param name="partUri"></param>
internal void ReserveUri(string contentType, Uri partUri)
{
this.<API key>();
this._partUriHelper.ReserveUri(contentType, partUri);
}
<summary>
Gets a unique part URI for the newly created part.
</summary>
<param name="contentType">The content type of the part.</param>
<param name="parentUri">The URI of the parent part.</param>
<param name="targetPath"></param>
<param name="targetName"></param>
<param name="targetExt"></param>
<returns></returns>
internal Uri GetUniquePartUri(string contentType, Uri parentUri, string targetPath, string targetName, string targetExt)
{
this.<API key>();
Uri partUri = null;
// fix bug #241492
// check to avoid name conflict with orphan parts in the packages.
do
{
partUri = this._partUriHelper.GetUniquePartUri(contentType, parentUri, targetPath, targetName, targetExt);
} while (this._metroPackage.PartExists(partUri));
return partUri;
}
<summary>
Gets a unique part URI for the newly created part.
</summary>
<param name="contentType">The content type of the part.</param>
<param name="parentUri">The URI of the parent part.</param>
<param name="targetUri"></param>
<returns></returns>
internal Uri GetUniquePartUri(string contentType, Uri parentUri, Uri targetUri)
{
this.<API key>();
Uri partUri = null;
// fix bug #241492
// check to avoid name conflict with orphan parts in the packages.
do
{
partUri = this._partUriHelper.GetUniquePartUri(contentType, parentUri, targetUri);
} while (this._metroPackage.PartExists(partUri));
return partUri;
}
#endregion
#region dispose related methods
<summary>
Thrown if an object is disposed.
</summary>
protected override void <API key>()
{
if (this._disposed)
{
throw new <API key>(base.GetType().Name);
}
}
<summary>
Flushes and saves the content, closes the document, and releases all resources.
</summary>
<param name="disposing">Specify true to release both managed and unmanaged resources; false to release only unmanaged resources.</param>
protected virtual void Dispose(bool disposing)
{
if (!this._disposed)
{
if (disposing)
{
// Try to save contents of every part in the package
SavePartContents();
<API key>();
// TODO: Close resources
this._metroPackage.Close();
this._metroPackage = null;
this.PartDictionary = null;
this.<API key>.Clear();
this._partUriHelper = null;
}
this._disposed = true;
}
}
#endregion
#region IDisposable Members
<summary>
Flushes and saves the content, closes the document, and releases all resources.
</summary>
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
#endregion
#region MC Staffs
<summary>
Gets the markup compatibility settings applied at loading time.
</summary>
public <API key> <API key>
{
get
{
if (OpenSettings.<API key> == null)
return new <API key>(<API key>.NoProcess, FileFormatVersions.Office2007);
else
return OpenSettings.<API key>;
}
}
//internal FileFormatVersions MCTargetFormat
// get
// if (<API key>.ProcessMode == <API key>.NoProcess)
// return (FileFormatVersions.Office2007 | FileFormatVersions.Office2010);
// else
// return <API key>.<API key>;
//internal bool <API key>
// get
// return <API key>.ProcessMode == <API key>.ProcessAllParts;
#endregion
#region Auto-Save functions
<summary>
Gets a flag that indicates whether the parts should be saved when disposed.
</summary>
public bool AutoSave
{
get
{
return OpenSettings.AutoSave;
}
}
private void SavePartContents()
{
<API key> iterator;
bool isAnyPartChanged;
if (this.FileOpenAccess == FileAccess.Read)
{
return; // do nothing if the package is open in read-only mode.
}
// When this.StrictTranslation is true, we ignore AutoSave to do the translation if isAnyPartChanged is true. That's the way to keep consistency.
if (!this.AutoSave && !this.StrictTranslation)
{
return; // do nothing if AutoSave is false.
}
// Traversal the whole package and save changed contents.
iterator = new <API key>(this);
isAnyPartChanged = false;
// If a part is in the state of 'loaded', something in the part should've been changed.
// When all the part is not loaded yet, we can skip saving all parts' contents and updating Package relationship types.
foreach (var part in iterator)
{
if (part.IsRootElementLoaded)
{
isAnyPartChanged = true;
break;
}
}
// We update parts and relationship types only when any one of the parts was changed (i.e. loaded).
if (isAnyPartChanged)
{
foreach (var part in iterator)
{
TrySavePartContent(part);
}
if (this.StrictTranslation)
{
<API key> <API key>;
// For Package: Invoking <API key>() changes the relationship types in the package.
// We need to new <API key> to read through the package contents right here
// because some operation may have updated the package before we get here.
<API key> = new <API key>(this._metroPackage);
<API key>.<API key>();
}
}
}
// Check if the part content changed and save it if yes.
private static void TrySavePartContent(OpenXmlPart part)
{
Debug.Assert(part != null);
Debug.Assert(part.OpenXmlPackage != null);
// If StrictTranslation is true, we need to update the part anyway.
if (part.OpenXmlPackage.StrictTranslation)
{
<API key> <API key>;
// For PackagePart: Invoking <API key>() changes the relationship types in the package part.
// We need to new <API key> to read through the package part contents right here
// because some operation may have updated the package part before we get here.
<API key> = new <API key>(part.PackagePart);
<API key>.<API key>();
// For ISO Strict documents, we read and save the part anyway to translate the contents. The contents are translated when PartRootElement is being loaded.
if (part.PartRootElement != null)
{
SavePartContent(part);
}
}
else
{
// For Transitional documents, we only save the 'changed' part.
if (<API key>(part))
{
SavePartContent(part);
}
}
}
// Check if the content of a part is changed.
private static bool <API key>(OpenXmlPart part)
{
Debug.Assert(part != null);
// If the root element of the part is loaded,
// consider the part changed and should be saved.
Debug.Assert(part.OpenXmlPackage != null);
if (!part.IsRootElementLoaded &&
part.OpenXmlPackage.<API key>.ProcessMode == <API key>.ProcessAllParts)
{
if (part.PartRootElement != null)
{
return true;
}
}
return part.IsRootElementLoaded;
}
// Save the content of a part to its stream.
private static void SavePartContent(OpenXmlPart part)
{
Debug.Assert(part != null);
Debug.Assert(part.IsRootElementLoaded);
// Save PartRootElement to the part stream.
part.PartRootElement.Save();
}
#endregion
#region internal methods related main part
<summary>
Gets the relationship type of the main part.
</summary>
internal abstract string <API key> { get; }
<summary>
Gets or sets the content type of the main part of the package.
</summary>
internal string MainPartContentType
{
get
{
return <API key>;
}
set
{
if (this.<API key>(value))
{
this.<API key> = value;
}
else
{
throw new <API key>(ExceptionMessages.<API key>);
}
}
}
<summary>
Gets the list of valid content types for the main part.
</summary>
internal abstract ICollection<string> <API key> { get; }
<summary>
Determines whether the content type is valid for the main part of the package.
</summary>
<param name="contentType">The content type.</param>
<returns>Returns true if the content type is valid.</returns>
internal bool <API key>(string contentType)
{
return <API key>.Contains(contentType);
}
<summary>
Changes the type of the document.
</summary>
<typeparam name="T">The type of the document's main part.</typeparam>
<remarks>The MainDocumentPart will be changed.</remarks>
internal void <API key><T>() where T : OpenXmlPart
{
<API key>();
T mainPart = this.GetSubPartOfType<T>();
MemoryStream memoryStream = null;
ExtendedPart tempPart = null;
Dictionary<string, OpenXmlPart> childParts = new Dictionary<string, OpenXmlPart>();
<API key>[] <API key>;
try
{
// read the content to local string
using (Stream mainPartStream = mainPart.GetStream())
{
if (mainPartStream.Length > Int32.MaxValue)
{
throw new <API key>(ExceptionMessages.DocumentTooBig);
}
memoryStream = new MemoryStream(Convert.ToInt32(mainPartStream.Length));
OpenXmlPart.CopyStream(mainPartStream, memoryStream);
}
tempPart = this.AddExtendedPart(@"http://temp", this.MainPartContentType, @".xml");
foreach (KeyValuePair<string, OpenXmlPart> idPartPair in mainPart.ChildrenParts)
{
childParts.Add(idPartPair.Key, idPartPair.Value);
}
<API key> = mainPart.<API key>.ToArray();
}
catch (<API key> e)
{
throw new <API key>(ExceptionMessages.<API key>, e);
}
#if <API key>
catch (SystemException e)
{
throw new <API key>(ExceptionMessages.<API key>, e);
}
#endif
try
{
Uri uri = mainPart.Uri;
string id = this.GetIdOfPart(mainPart);
// remove the old part
this.ChildrenParts.Remove(id);
this.DeleteRelationship(id);
mainPart.Destroy();
// create new part
T newMainPart = CreateInstance<T>();
// do not call this.InitPart( ). copy the code here
newMainPart.CreateInternal2(this, null, this.MainPartContentType, uri);
// add it and get the id
string relationshipId = this.AttachChild(newMainPart, id);
this.ChildrenParts.Add(relationshipId, newMainPart);
// copy the stream back
memoryStream.Position = 0;
newMainPart.FeedData(memoryStream);
// add back all relationships
foreach (KeyValuePair<string, OpenXmlPart> idPartPair in childParts)
{
// just call AttachChild( ) is OK. No need to call AddPart( ... )
newMainPart.AttachChild(idPartPair.Value, idPartPair.Key);
newMainPart.ChildrenParts.Add(idPartPair);
}
foreach (<API key> externalRel in <API key>.OfType<<API key>>())
{
newMainPart.<API key>(externalRel.RelationshipType, externalRel.Uri, externalRel.Id);
}
foreach (<API key> hyperlinkRel in <API key>.OfType<<API key>>())
{
newMainPart.<API key>(hyperlinkRel.Uri, hyperlinkRel.IsExternal, hyperlinkRel.Id);
}
foreach (<API key> dataPartReference in <API key>.OfType<<API key>>())
{
newMainPart.<API key>(dataPartReference);
}
// delete the temp part
id = this.GetIdOfPart(tempPart);
this.ChildrenParts.Remove(id);
this.DeleteRelationship(id);
tempPart.Destroy();
}
catch (<API key> e)
{
throw new <API key>(ExceptionMessages.<API key>, e);
}
#if <API key>
catch (SystemException e)
{
throw new <API key>(ExceptionMessages.<API key>, e);
}
#endif
}
#endregion
#region internal methods
// internal abstract <API key> <API key> { get; }
// cannot use generic, at it will emit error
// Compiler Error CS0310
// The type 'typename' must have a public parameter less constructor in order to use it as parameter 'parameter' in the generic type or method 'generic'
internal sealed override OpenXmlPart NewPart(string relationshipType, string contentType)
{
<API key>();
if (contentType == null)
{
throw new <API key>(nameof(contentType));
}
PartConstraintRule partConstraintRule;
if (GetPartConstraint().TryGetValue(relationshipType, out partConstraintRule))
{
if (!partConstraintRule.<API key>)
{
if (this.GetSubPart(relationshipType) != null)
{
// already have one, cannot add new one.
throw new <API key>();
}
}
OpenXmlPart child = CreateOpenXmlPart(relationshipType);
child.CreateInternal(this, null, contentType, null);
// add it and get the id
string relationshipId = this.AttachChild(child);
this.ChildrenParts.Add(relationshipId, child);
return child;
}
throw new <API key>(nameof(relationshipType));
}
internal sealed override OpenXmlPackage <API key>
{
get { return this; }
}
internal sealed override OpenXmlPart ThisOpenXmlPart
{
get { return null; }
}
// find all reachable parts from the package root, the dictionary also used for cycle reference defense
internal sealed override void <API key>(IDictionary<OpenXmlPart, bool> reachableParts)
{
<API key>();
if (reachableParts == null)
{
throw new <API key>(nameof(reachableParts));
}
foreach (OpenXmlPart part in this.ChildrenParts.Values)
{
if (!reachableParts.ContainsKey(part))
{
part.<API key>(reachableParts);
}
}
}
internal sealed override void DeleteRelationship(string id)
{
<API key>();
this.Package.DeleteRelationship(id);
}
internal sealed override PackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType)
{
<API key>();
return this.Package.CreateRelationship(targetUri, targetMode, relationshipType);
}
internal sealed override PackageRelationship CreateRelationship(Uri targetUri, TargetMode targetMode, string relationshipType, string id)
{
<API key>();
return this.Package.CreateRelationship(targetUri, targetMode, relationshipType, id);
}
// create the metro part in the package with the CompressionOption
internal PackagePart CreateMetroPart(Uri partUri, string contentType)
{
return this.Package.CreatePart(partUri, contentType, this.CompressionOption);
}
// default package validation event handler
static void <API key>(Object sender, <API key> e)
{
<API key> exception = new <API key>(ExceptionMessages.ValidationException);
exception.Data.Add("<API key>", e);
throw exception;
}
#endregion
#region methods on DataPart
private static bool IsOrphanDataPart(DataPart dataPart)
{
return !dataPart.<API key>().Any();
}
<summary>
Deletes all DataParts that are not referenced by any media, audio, or video reference relationships.
</summary>
private void <API key>()
{
if (this._dataPartList.Count > 0)
{
HashSet<DataPart> dataPartSet = new HashSet<DataPart>();
foreach (var dataPart in this.DataParts)
{
dataPartSet.Add(dataPart);
}
// first, see if there are any reference in package level.
foreach (var <API key> in this.<API key>)
{
dataPartSet.Remove(<API key>.DataPart);
if (dataPartSet.Count == 0)
{
// No more DataPart in the set. All DataParts are referenced somewhere.
return;
}
}
// for each part in the package, check the <API key>.
<API key> partIterator = new <API key>(this);
foreach (var openXmlPart in partIterator)
{
foreach (var <API key> in openXmlPart.<API key>)
{
dataPartSet.Remove(<API key>.DataPart);
if (dataPartSet.Count == 0)
{
// No more DataPart in the set. All DataParts are referenced somethwherr.
return;
}
}
}
foreach (var dataPart in dataPartSet)
{
// delete the part from the package
dataPart.Destroy();
this._dataPartList.Remove(dataPart);
}
}
}
<summary>
Finds the DataPart that has the specified part URI.
</summary>
<param name="partUri">The part URI.</param>
<returns>Returns null if there is no DataPart with the specified URI.</returns>
internal DataPart FindDataPart(Uri partUri)
{
foreach (var dataPart in this.DataParts)
{
if (dataPart.Uri == partUri)
{
return dataPart;
}
}
return null;
}
internal DataPart AddDataPartToList(DataPart dataPart)
{
this._dataPartList.AddLast(dataPart);
return dataPart;
}
#endregion
internal class PartUriHelper
{
private Dictionary<string, int> _sequenceNumbers = new Dictionary<string, int>(20);
private Dictionary<string, int> _reservedUri = new Dictionary<string, int>();
public PartUriHelper()
{
}
private bool IsReservedUri(Uri uri)
{
string uriString = uri.OriginalString.ToUpperInvariant();
return this._reservedUri.ContainsKey(uriString);
}
internal void AddToReserveUri(Uri partUri)
{
string uriString = partUri.OriginalString.ToUpperInvariant();
this._reservedUri.Add(uriString, 0);
}
internal void ReserveUri(string contentType, Uri partUri)
{
<API key>(contentType);
this.AddToReserveUri(PackUriHelper.<API key>(partUri));
}
internal Uri GetUniquePartUri(string contentType, Uri parentUri, string targetPath, string targetName, string targetExt)
{
Uri partUri;
do
{
string sequenceNumber = this.<API key>(contentType);
string path = Path.Combine(targetPath, targetName + sequenceNumber + targetExt);
Uri uri = new Uri(path, UriKind.RelativeOrAbsolute);
partUri = PackUriHelper.ResolvePartUri(parentUri, uri);
// partUri = PackUriHelper.<API key>(PackUriHelper.CreatePartUri(uri));
} while (this.IsReservedUri(partUri));
this.AddToReserveUri(partUri);
// do not need to add to the _existedNames
return partUri;
}
internal Uri GetUniquePartUri(string contentType, Uri parentUri, Uri targetUri)
{
Uri partUri;
partUri = PackUriHelper.ResolvePartUri(parentUri, targetUri);
if (this.IsReservedUri(partUri))
{
// already have one, create new
string targetPath = ".";
string targetName = Path.<API key>(targetUri.OriginalString);
string targetExt = Path.GetExtension(targetUri.OriginalString);
partUri = GetUniquePartUri(contentType, partUri, targetPath, targetName, targetExt);
}
else
{
// not used, can use it.
this.AddToReserveUri(partUri);
}
return partUri;
}
private string <API key>(string contentType)
{
if (this._sequenceNumbers.ContainsKey(contentType))
{
this._sequenceNumbers[contentType] += 1;
// use the default read-only NumberFormatInfo that is culture-independent (invariant).
// return this._sequenceNumbers[contentType].ToString(NumberFormatInfo.InvariantInfo);
// Let's use the number string in hex
return Convert.ToString(this._sequenceNumbers[contentType], 16);
}
else
{
this._sequenceNumbers.Add(contentType, 1);
return "";
}
}
}
#region saving and cloning
#region saving
private readonly object _saveAndCloneLock = new object();
<summary>
Saves the contents of all parts and relationships that are contained
in the OpenXml package, if FileOpenAccess is ReadWrite.
</summary>
public void Save()
{
<API key>();
if (FileOpenAccess == FileAccess.ReadWrite)
{
lock (_saveAndCloneLock)
{
SavePartContents();
// TODO: Revisit.
// Package.Flush();
}
}
}
<summary>
Saves the contents of all parts and relationships that are contained
in the OpenXml package to the specified file. Opens the saved document
using the same settings that were used to open this OpenXml package.
</summary>
<remarks>
Calling SaveAs(string) is exactly equivalent to calling Clone(string).
This method is essentially provided for convenience.
</remarks>
<param name="path">The path and file name of the target document.</param>
<returns>The cloned OpenXml package</returns>
public OpenXmlPackage SaveAs(string path)
{
return Clone(path);
}
#endregion saving
#region Default clone method
<summary>
Creates an editable clone of this OpenXml package, opened on a
<see cref="MemoryStream"/> with expandable capacity and using
default OpenSettings.
</summary>
<returns>The cloned OpenXml package.</returns>
public OpenXmlPackage Clone()
{
return Clone(new MemoryStream(), true, new OpenSettings());
}
#endregion Default clone method
#region Stream-based cloning
<summary>
Creates a clone of this OpenXml package, opened on the given stream.
The cloned OpenXml package is opened with the same settings, i.e.,
FileOpenAccess and OpenSettings, as this OpenXml package.
</summary>
<param name="stream">The IO stream on which to open the OpenXml package.</param>
<returns>The cloned OpenXml package.</returns>
public OpenXmlPackage Clone(Stream stream)
{
return Clone(stream, FileOpenAccess == FileAccess.ReadWrite, OpenSettings);
}
<summary>
Creates a clone of this OpenXml package, opened on the given stream.
The cloned OpenXml package is opened with the same OpenSettings as
this OpenXml package.
</summary>
<param name="stream">The IO stream on which to open the OpenXml package.</param>
<param name="isEditable">In ReadWrite mode. False for Read only mode.</param>
<returns>The cloned OpenXml package.</returns>
public OpenXmlPackage Clone(Stream stream, bool isEditable)
{
return Clone(stream, isEditable, OpenSettings);
}
<summary>
Creates a clone of this OpenXml package, opened on the given stream.
</summary>
<param name="stream">The IO stream on which to open the OpenXml package.</param>
<param name="isEditable">In ReadWrite mode. False for Read only mode.</param>
<param name="openSettings">The advanced settings for opening a document.</param>
<returns>The cloned OpenXml package.</returns>
public OpenXmlPackage Clone(Stream stream, bool isEditable, OpenSettings openSettings)
{
if (stream == null)
throw new <API key>(nameof(stream));
// Use this OpenXml package's OpenSettings if none are provided.
// This is more in line with cloning than providing the default
// OpenSettings, i.e., unless the caller explicitly specifies
// something, we'll later open the clone with this OpenXml
// package's OpenSettings.
if (openSettings == null)
openSettings = OpenSettings;
lock (_saveAndCloneLock)
{
// Save the contents of all parts and relationships that are contained
// in the OpenXml package to make sure we clone a consistent state.
// This will also invoke <API key>(), so we don't need
// to call it here.
Save();
// Create new OpenXmlPackage backed by stream. Next, copy all document
// parts (AddPart will copy the parts and their children in a recursive
// fashion) and close/dispose the document (by leaving the scope of the
// using statement). Finally, reopen the clone from the MemoryStream.
// This way, writing the stream to a file, for example, directly after
// returning from this method will not lead to issues with corrupt files
// and a FileFormatException ("Compressed part has inconsistent data length")
// thrown within OpenXmlPackage.OpenCore(string, bool) by the
// this._metroPackage = Package.Open(path, ...);
// assignment.
using (OpenXmlPackage clone = CreateClone(stream))
{
foreach (var part in this.Parts)
clone.AddPart(part.OpenXmlPart, part.RelationshipId);
}
return OpenClone(stream, isEditable, openSettings);
}
}
<summary>
Creates a new OpenXmlPackage on the given stream.
</summary>
<param name="stream">The stream on which the concrete OpenXml package will be created.</param>
<returns>A new instance of OpenXmlPackage.</returns>
protected abstract OpenXmlPackage CreateClone(Stream stream);
<summary>
Opens the cloned OpenXml package on the given stream.
</summary>
<param name="stream">The stream on which the cloned OpenXml package will be opened.</param>
<param name="isEditable">In ReadWrite mode. False for Read only mode.</param>
<param name="openSettings">The advanced settings for opening a document.</param>
<returns>A new instance of OpenXmlPackage.</returns>
protected abstract OpenXmlPackage OpenClone(Stream stream, bool isEditable, OpenSettings openSettings);
#endregion Stream-based cloning
#region File-based cloning
<summary>
Creates a clone of this OpenXml package opened from the given file
(which will be created by cloning this OpenXml package).
The cloned OpenXml package is opened with the same settings, i.e.,
FileOpenAccess and OpenSettings, as this OpenXml package.
</summary>
<param name="path">The path and file name of the target document.</param>
<returns>The cloned document.</returns>
public OpenXmlPackage Clone(string path)
{
return Clone(path, FileOpenAccess == FileAccess.ReadWrite, OpenSettings);
}
<summary>
Creates a clone of this OpenXml package opened from the given file
(which will be created by cloning this OpenXml package).
The cloned OpenXml package is opened with the same OpenSettings as
this OpenXml package.
</summary>
<param name="path">The path and file name of the target document.</param>
<param name="isEditable">In ReadWrite mode. False for Read only mode.</param>
<returns>The cloned document.</returns>
public OpenXmlPackage Clone(string path, bool isEditable)
{
return Clone(path, isEditable, OpenSettings);
}
<summary>
Creates a clone of this OpenXml package opened from the given file (which
will be created by cloning this OpenXml package).
</summary>
<param name="path">The path and file name of the target document.</param>
<param name="isEditable">In ReadWrite mode. False for Read only mode.</param>
<param name="openSettings">The advanced settings for opening a document.</param>
<returns>The cloned document.</returns>
public OpenXmlPackage Clone(string path, bool isEditable, OpenSettings openSettings)
{
if (path == null)
throw new <API key>(nameof(path));
// Use this OpenXml package's OpenSettings if none are provided.
// This is more in line with cloning than providing the default
// OpenSettings, i.e., unless the caller explicitly specifies
// something, we'll later open the clone with this OpenXml
// package's OpenSettings.
if (openSettings == null)
openSettings = OpenSettings;
lock (_saveAndCloneLock)
{
// Save the contents of all parts and relationships that are contained
// in the OpenXml package to make sure we clone a consistent state.
// This will also invoke <API key>(), so we don't need
// to call it here.
Save();
// Use the same approach as for the streams-based cloning, i.e., close
// and reopen the document.
using (OpenXmlPackage clone = CreateClone(path))
{
foreach (var part in this.Parts)
clone.AddPart(part.OpenXmlPart, part.RelationshipId);
}
return OpenClone(path, isEditable, openSettings);
}
}
<summary>
Creates a new OpenXml package on the given file.
</summary>
<param name="path">The path and file name of the target OpenXml package.</param>
<returns>A new instance of OpenXmlPackage.</returns>
protected abstract OpenXmlPackage CreateClone(string path);
<summary>
Opens the cloned OpenXml package on the given file.
</summary>
<param name="path">The path and file name of the target OpenXml package.</param>
<param name="isEditable">In ReadWrite mode. False for Read only mode.</param>
<param name="openSettings">The advanced settings for opening a document.</param>
<returns>A new instance of OpenXmlPackage.</returns>
protected abstract OpenXmlPackage OpenClone(string path, bool isEditable, OpenSettings openSettings);
#endregion File-based cloning
#region Package-based cloning
<summary>
Creates a clone of this OpenXml package, opened on the specified instance
of Package. The clone will be opened with the same OpenSettings as this
OpenXml package.
</summary>
<param name="package">The specified instance of Package.</param>
<returns>The cloned OpenXml package.</returns>
public OpenXmlPackage Clone(Package package)
{
return Clone(package, OpenSettings);
}
<summary>
Creates a clone of this OpenXml package, opened on the specified instance
of Package.
</summary>
<param name="package">The specified instance of Package.</param>
<param name="openSettings">The advanced settings for opening a document.</param>
<returns>The cloned OpenXml package.</returns>
public OpenXmlPackage Clone(Package package, OpenSettings openSettings)
{
if (package == null)
throw new <API key>(nameof(package));
// Use this OpenXml package's OpenSettings if none are provided.
// This is more in line with cloning than providing the default
// OpenSettings, i.e., unless the caller explicitly specifies
// something, we'll later open the clone with this OpenXml
// package's OpenSettings.
if (openSettings == null)
openSettings = OpenSettings;
lock (_saveAndCloneLock)
{
// Save the contents of all parts and relationships that are contained
// in the OpenXml package to make sure we clone a consistent state.
// This will also invoke <API key>(), so we don't need
// to call it here.
Save();
// Create a new OpenXml package, copy this package's parts, and flush.
// This is different from the stream and file-based cloning, because
// we don't close the package here (whereas it will be closed in
// stream and file-based cloning to make sure the underlying stream
// or file can be read without any corruption issues directly after
// having cloned the OpenXml package).
OpenXmlPackage clone = CreateClone(package);
foreach (var part in this.Parts)
{
clone.AddPart(part.OpenXmlPart, part.RelationshipId);
}
// TODO: Revisit.
// package.Flush();
// Configure OpenSettings.
clone.OpenSettings.AutoSave = openSettings.AutoSave;
clone.OpenSettings.<API key>.ProcessMode = openSettings.<API key>.ProcessMode;
clone.OpenSettings.<API key>.<API key> = openSettings.<API key>.<API key>;
clone.MaxCharactersInPart = openSettings.MaxCharactersInPart;
return clone;
}
}
<summary>
Creates a new instance of OpenXmlPackage on the specified instance
of Package.
</summary>
<param name="package">The specified instance of Package.</param>
<returns>A new instance of OpenXmlPackage.</returns>
protected abstract OpenXmlPackage CreateClone(Package package);
#endregion Package-based cloning
#endregion saving and cloning
#region Flat OPC
private static readonly XNamespace pkg = "http://schemas.microsoft.com/office/2006/xmlPackage";
private static readonly XNamespace rel = "http://schemas.openxmlformats.org/package/2006/relationships";
<summary>
Converts an OpenXml package in OPC format to string in Flat OPC format.
</summary>
<returns>The OpenXml package in Flat OPC format.</returns>
public string ToFlatOpcString()
{
return ToFlatOpcDocument().ToString();
}
<summary>
Converts an OpenXml package in OPC format to an <see cref="XDocument"/>
in Flat OPC format.
</summary>
<returns>The OpenXml package in Flat OPC format.</returns>
public abstract XDocument ToFlatOpcDocument();
<summary>
Converts an OpenXml package in OPC format to an <see cref="XDocument"/>
in Flat OPC format.
</summary>
<param name="instruction">The processing instruction.</param>
<returns>The OpenXml package in Flat OPC format.</returns>
protected XDocument ToFlatOpcDocument(<API key> instruction)
{
// Save the contents of all parts and relationships that are contained
// in the OpenXml package to make sure we convert a consistent state.
// This will also invoke <API key>(), so we don't need
// to call it here.
Save();
// Create an XML document with a standalone declaration, processing
// instruction (if not null), and a package root element with a
// namespace declaration and one child element for each part.
return new XDocument(
new XDeclaration("1.0", "UTF-8", "yes"),
instruction,
new XElement(
pkg + "package",
new XAttribute(XNamespace.Xmlns + "pkg", pkg.ToString()),
Package.GetParts().Select(part => GetContentsAsXml(part))));
}
<summary>
Gets the <see cref="PackagePart"/>'s contents as an <see cref="XElement"/>.
</summary>
<param name="part">The package part.</param>
<returns>The corresponding <see cref="XElement"/>.</returns>
private static XElement GetContentsAsXml(PackagePart part)
{
if (part.ContentType.EndsWith("xml"))
{
using (Stream stream = part.GetStream())
using (StreamReader streamReader = new StreamReader(stream))
using (XmlReader xmlReader = XmlReader.Create(streamReader))
return new XElement(pkg + "part",
new XAttribute(pkg + "name", part.Uri),
new XAttribute(pkg + "contentType", part.ContentType),
new XElement(pkg + "xmlData", XElement.Load(xmlReader)));
}
else
{
using (Stream stream = part.GetStream())
using (BinaryReader binaryReader = new BinaryReader(stream))
{
int len = (int)binaryReader.BaseStream.Length;
byte[] byteArray = binaryReader.ReadBytes(len);
// The following expression creates the base64String, then chunks
// it to lines of 76 characters long.
string base64String = System.Convert.ToBase64String(byteArray)
.Select((c, i) => new { Character = c, Chunk = i / 76 })
.GroupBy(c => c.Chunk)
.Aggregate(
new StringBuilder(),
(s, i) =>
s.Append(
i.Aggregate(
new StringBuilder(),
(seed, it) => seed.Append(it.Character),
sb => sb.ToString())).Append(Environment.NewLine),
s => s.ToString());
return new XElement(pkg + "part",
new XAttribute(pkg + "name", part.Uri),
new XAttribute(pkg + "contentType", part.ContentType),
new XAttribute(pkg + "compression", "store"),
new XElement(pkg + "binaryData", base64String));
}
}
}
<summary>
Converts an <see cref="XDocument"/> in Flat OPC format to an OpenXml package
stored on a <see cref="Stream"/>.
</summary>
<param name="document">The document in Flat OPC format.</param>
<param name="stream">The <see cref="Stream"/> on which to store the OpenXml package.</param>
<returns>The <see cref="Stream"/> containing the OpenXml package.</returns>
protected static Stream <API key>(XDocument document, Stream stream)
{
using (Package package = Package.Open(stream, FileMode.Create, FileAccess.ReadWrite))
{
<API key>(document, package);
}
return stream;
}
<summary>
Converts an <see cref="XDocument"/> in Flat OPC format to an OpenXml package
stored in a file.
</summary>
<param name="document">The document in Flat OPC format.</param>
<param name="path">The path and file name of the file in which to store the OpenXml package.</param>
<returns>The path and file name of the file containing the OpenXml package.</returns>
protected static string <API key>(XDocument document, string path)
{
using (Package package = Package.Open(path, FileMode.Create, FileAccess.ReadWrite, FileShare.None))
{
<API key>(document, package);
}
return path;
}
<summary>
Converts an <see cref="XDocument"/> in Flat OPC format to an OpenXml package
stored in a <see cref="Package"/>.
</summary>
<param name="document">The document in Flat OPC format.</param>
<param name="package">The <see cref="Package"/> in which to store the OpenXml package.</param>
<returns>The <see cref="Package"/> containing the OpenXml package.</returns>
protected static Package <API key>(XDocument document, Package package)
{
// Add all parts (but not relationships).
foreach (var xmlPart in document.Root
.Elements()
.Where(p =>
(string)p.Attribute(pkg + "contentType") !=
"application/vnd.<API key>.relationships+xml"))
{
string name = (string)xmlPart.Attribute(pkg + "name");
string contentType = (string)xmlPart.Attribute(pkg + "contentType");
if (contentType.EndsWith("xml"))
{
Uri uri = new Uri(name, UriKind.Relative);
PackagePart part = package.CreatePart(uri, contentType, CompressionOption.SuperFast);
using (Stream stream = part.GetStream(FileMode.Create))
using (XmlWriter xmlWriter = XmlWriter.Create(stream))
xmlPart.Element(pkg + "xmlData")
.Elements()
.First()
.WriteTo(xmlWriter);
}
else
{
Uri uri = new Uri(name, UriKind.Relative);
PackagePart part = package.CreatePart(uri, contentType, CompressionOption.SuperFast);
using (Stream stream = part.GetStream(FileMode.Create))
using (BinaryWriter binaryWriter = new BinaryWriter(stream))
{
string <API key> = (string)xmlPart.Element(pkg + "binaryData");
char[] base64CharArray = <API key>
.Where(c => c != '\r' && c != '\n').ToArray();
byte[] byteArray =
System.Convert.FromBase64CharArray(
base64CharArray, 0, base64CharArray.Length);
binaryWriter.Write(byteArray);
}
}
}
foreach (var xmlPart in document.Root.Elements())
{
string name = (string)xmlPart.Attribute(pkg + "name");
string contentType = (string)xmlPart.Attribute(pkg + "contentType");
if (contentType == "application/vnd.<API key>.relationships+xml")
{
if (name == "/_rels/.rels")
{
// Add the package level relationships.
foreach (XElement xmlRel in xmlPart.Descendants(rel + "Relationship"))
{
string id = (string)xmlRel.Attribute("Id");
string type = (string)xmlRel.Attribute("Type");
string target = (string)xmlRel.Attribute("Target");
string targetMode = (string)xmlRel.Attribute("TargetMode");
if (targetMode == "External")
package.CreateRelationship(
new Uri(target, UriKind.Absolute),
TargetMode.External, type, id);
else
package.CreateRelationship(
new Uri(target, UriKind.Relative),
TargetMode.Internal, type, id);
}
}
else
{
// Add part level relationships.
string directory = name.Substring(0, name.IndexOf("/_rels"));
string relsFilename = name.Substring(name.LastIndexOf('/'));
string filename = relsFilename.Substring(0, relsFilename.IndexOf(".rels"));
PackagePart fromPart = package.GetPart(new Uri(directory + filename, UriKind.Relative));
foreach (XElement xmlRel in xmlPart.Descendants(rel + "Relationship"))
{
string id = (string)xmlRel.Attribute("Id");
string type = (string)xmlRel.Attribute("Type");
string target = (string)xmlRel.Attribute("Target");
string targetMode = (string)xmlRel.Attribute("TargetMode");
if (targetMode == "External")
fromPart.CreateRelationship(
new Uri(target, UriKind.Absolute),
TargetMode.External, type, id);
else
fromPart.CreateRelationship(
new Uri(target, UriKind.Relative),
TargetMode.Internal, type, id);
}
}
}
}
// Save contents of all parts and relationships contained in package.
package.Flush();
return package;
}
#endregion Flat OPC
}
<summary>
Specifies event handlers that will handle OpenXmlPackage validation events and the <API key>.
</summary>
// Building on Travis CI failed, saying that <API key> does not contain a definition
// for '<API key>'. Thus, we've replaced the member with its value.
[Obsolete("This functionality is obsolete and will be removed from future version release. Please see OpenXmlValidator class for supported validation functionality.", false)]
public class <API key>
{
private EventHandler<<API key>> valEventHandler;
<summary>
Gets the event handler.
</summary>
<returns></returns>
internal EventHandler<<API key>> GetEventHandler()
{
return this.valEventHandler;
}
<summary>
Represents the callback method that will handle OpenXmlPackage validation events and the <API key>.
</summary>
public event EventHandler<<API key>> EventHandler
{
add
{
this.valEventHandler = (EventHandler<<API key>>)Delegate.Combine(this.valEventHandler, value);
}
remove
{
this.valEventHandler = (EventHandler<<API key>>)Delegate.Remove(this.valEventHandler, value);
}
}
<summary>
Gets or sets the file format version that the validation is targeting.
</summary>
internal FileFormatVersions FileFormat
{
get;
set;
}
}
<summary>
Represents the Open XML package validation events.
</summary>
[<API key>]
[Obsolete(<API key>.<API key>, false)]
public sealed class <API key> : EventArgs
{
private string _message;
private string _partClassName;
[<API key>]
private OpenXmlPart _childPart;
[<API key>]
private OpenXmlPart _parentPart;
internal <API key>()
{
}
<summary>
Gets the message string of the event.
</summary>
public string Message
{
get
{
if (this._message == null && this.MessageId != null)
{
return ExceptionMessages.ResourceManager.GetString(this.MessageId);
}
else
{
return this._message;
}
}
set
{
this._message = value;
}
}
<summary>
Gets the class name of the part.
</summary>
public string PartClassName
{
get { return _partClassName; }
internal set { _partClassName = value; }
}
<summary>
Gets the part that caused the event.
</summary>
public OpenXmlPart SubPart
{
get { return _childPart; }
internal set { _childPart = value; }
}
<summary>
Gets the part in which to process the validation.
</summary>
public OpenXmlPart Part
{
get { return _parentPart; }
internal set { _parentPart = value; }
}
internal string MessageId
{
get;
set;
}
<summary>
The <API key> that caused the event.
</summary>
internal <API key> <API key>
{
get;
set;
}
}
<summary>
Represents an Open XML package exception class for errors.
</summary>
[<API key>]
public sealed class <API key> : Exception
{
<summary>
Initializes a new instance of the <API key> class.
</summary>
public <API key>()
: base()
{
}
<summary>
Initializes a new instance of the <API key> class using the supplied error message.
</summary>
<param name="message">The message that describes the error. </param>
public <API key>(string message)
: base(message)
{
}
#if <API key>
<summary>
Initializes a new instance of the <API key> class using the supplied serialized data.
</summary>
<param name="info">The serialized object data about the exception being thrown.</param>
<param name="context">The contextual information about the source or destination.</param>
private <API key>(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
#endif
<summary>
Initializes a new instance of the <API key> class using the supplied error message and a reference to the inner exception that caused the current exception.
</summary>
<param name="message">The error message that indicates the reason for the exception.</param>
<param name="innerException">The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified.</param>
public <API key>(string message, Exception innerException)
: base(message, innerException)
{
}
}
<summary>
Represents the settings when opening a document.
</summary>
public class OpenSettings
{
bool? autoSave;
<API key> _mcSettings;
<summary>
Gets or sets a value that indicates whether or not to auto save document modifications.
The default value is true.
</summary>
public bool AutoSave
{
get
{
if (autoSave == null)
{
return true;
}
return (bool)autoSave;
}
set
{
autoSave = value;
}
}
<summary>
Gets or sets the value of the markup compatibility processing mode.
</summary>
public <API key> <API key>
{
get
{
if (_mcSettings == null)
_mcSettings = new <API key>(<API key>.NoProcess, FileFormatVersions.Office2007);
return _mcSettings;
}
set
{
_mcSettings = value;
}
}
<summary>
Gets or sets a value that indicates the maximum number of allowable characters in an Open XML part. A zero (0) value indicates that there are no limits on the size of the part. A non-zero value specifies the maximum size, in characters.
</summary>
<remarks>
This property allows you to mitigate denial of service attacks where the attacker submits a package with an extremely large Open XML part. By limiting the size of the part, you can detect the attack and recover reliably.
</remarks>
public long MaxCharactersInPart { get; set; }
}
<summary>
Represents markup compatibility processing settings.
</summary>
public class <API key>
{
<summary>
Gets the markup compatibility process mode.
</summary>
public <API key> ProcessMode { get; internal set; }
<summary>
Gets the target file format versions.
</summary>
public FileFormatVersions <API key> { get; internal set; }
<summary>
Creates a <API key> object using the supplied process mode and file format versions.
</summary>
<param name="processMode">The process mode.</param>
<param name="<API key>">The file format versions. This parameter is ignored if the value is NoProcess.</param>
public <API key>(<API key> processMode, FileFormatVersions <API key>)
{
ProcessMode = processMode;
<API key> = <API key>;
}
private <API key>()
{
ProcessMode = <API key>.NoProcess;
<API key> = FileFormatVersions.Office2007;
}
}
<summary>
Specifies the mode in which to process the markup compatibility tags in the document.
</summary>
public enum <API key>
{
<summary>
Do not process MarkupCompatibility tags.
</summary>
NoProcess = 0,
<summary>
Process the loaded parts.
</summary>
<API key>,
<summary>
Process all the parts in the package.
</summary>
ProcessAllParts,
}
<summary>
Traversal parts in the <see cref="OpenXmlPackage"/> by breadth-first.
</summary>
internal class <API key> : IEnumerable<OpenXmlPart>
{
private OpenXmlPackage _package;
#region Constructor
<summary>
Initializes a new instance of the <API key> class using the supplied OpenXmlPackage class.
</summary>
<param name="package">The OpenXmlPackage to use to enumerate parts.</param>
public <API key>(OpenXmlPackage package)
{
Debug.Assert(package != null);
this._package = package;
}
#endregion
#region IEnumerable<OpenXmlPart> Members
<summary>
Gets an enumerator for parts in the whole package.
</summary>
<returns></returns>
public IEnumerator<OpenXmlPart> GetEnumerator()
{
return <API key>();
}
// Traverses the parts graph by breath-first
private IEnumerator<OpenXmlPart> <API key>()
{
Debug.Assert(_package != null);
var returnedParts = new List<OpenXmlPart>();
Queue<OpenXmlPart> tmpQueue = new Queue<OpenXmlPart>();
// Enqueue child parts of the package.
foreach (var idPartPair in _package.Parts)
{
tmpQueue.Enqueue(idPartPair.OpenXmlPart);
}
while (tmpQueue.Count > 0)
{
var part = tmpQueue.Dequeue();
returnedParts.Add(part);
foreach (var subIdPartPair in part.Parts)
{
if (!tmpQueue.Contains(subIdPartPair.OpenXmlPart)
&& !returnedParts.Contains(subIdPartPair.OpenXmlPart))
{
tmpQueue.Enqueue(subIdPartPair.OpenXmlPart);
}
}
}
return returnedParts.GetEnumerator();
}
#endregion
#region IEnumerable Members
<summary>
Gets an enumerator for parts in the whole package.
</summary>
<returns></returns>
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
#endregion
}
}
|
// lightbox_plus.js
// ver. 20061027 - fixed a bug ( not work at xhml documents on Netscape7 )
// ver. 20061026 - fixed bugs
// ver. 20061010 - implemented image set feature
// ver. 20060921 - fixed a bug / added overall view
// ver. 20060920 - added flag to prevent mouse wheel event
// ver. 20060919 - fixed a bug
// ver. 20060918 - implemented functionality of wheel zoom & drag'n drop
// ver. 20060131 - fixed a bug to work correctly on Internet Explorer for Windows
// ver. 20060128 - implemented functionality of echoic word
// ver. 20060120 - implemented functionality of caption and close button
function WindowSize()
{ // window size object
this.w = 0;
this.h = 0;
return this.update();
}
WindowSize.prototype.update = function()
{
var d = document;
this.w =
(window.innerWidth) ? window.innerWidth
: (d.documentElement && d.documentElement.clientWidth) ? d.documentElement.clientWidth
: d.body.clientWidth;
this.h =
(window.innerHeight) ? window.innerHeight
: (d.documentElement && d.documentElement.clientHeight) ? d.documentElement.clientHeight
: d.body.clientHeight;
return this;
};
function PageSize()
{ // page size object
this.win = new WindowSize();
this.w = 0;
this.h = 0;
return this.update();
}
PageSize.prototype.update = function()
{
var d = document;
this.w =
(window.innerWidth && window.scrollMaxX) ? window.innerWidth + window.scrollMaxX
: (d.body.scrollWidth > d.body.offsetWidth) ? d.body.scrollWidth
: d.body.offsetWidt;
this.h =
(window.innerHeight && window.scrollMaxY) ? window.innerHeight + window.scrollMaxY
: (d.body.scrollHeight > d.body.offsetHeight) ? d.body.scrollHeight
: d.body.offsetHeight;
this.win.update();
if (this.w < this.win.w) this.w = this.win.w;
if (this.h < this.win.h) this.h = this.win.h;
return this;
};
function PagePos()
{ // page position object
this.x = 0;
this.y = 0;
return this.update();
}
PagePos.prototype.update = function()
{
var d = document;
this.x =
(window.pageXOffset) ? window.pageXOffset
: (d.documentElement && d.documentElement.scrollLeft) ? d.documentElement.scrollLeft
: (d.body) ? d.body.scrollLeft
: 0;
this.y =
(window.pageYOffset) ? window.pageYOffset
: (d.documentElement && d.documentElement.scrollTop) ? d.documentElement.scrollTop
: (d.body) ? d.body.scrollTop
: 0;
return this;
};
function LightBox(option)
{
var self = this;
self._imgs = [];
self._sets = [];
self._wrap = null;
self._box = null;
self._img = null;
self._open = -1;
self._page = new PageSize();
self._pos = new PagePos();
self._zoomimg = null;
self._expandable = false;
self._expanded = false;
self._funcs = {'move':null,'up':null,'drag':null,'wheel':null,'dbl':null};
self._level = 1;
self._curpos = {x:0,y:0};
self._imgpos = {x:0,y:0};
self._minpos = {x:0,y:0};
self._expand = option.expandimg;
self._shrink = option.shrinkimg;
self._resizable = option.resizable;
self._timer = null;
self._indicator = null;
self._overall = null;
self._openedset = null;
self._prev = null;
self._next = null;
self._hiding = [];
self._first = false;
return self._init(option);
}
LightBox.prototype = {
_init : function(option)
{
var self = this;
var d = document;
if (!d.<API key>) return;
if (Browser.isMacIE) return self;
var links = d.<API key>("a");
for (var i = 0; i < links.length; i++)
{
var anchor = links[i];
var num = self._imgs.length;
var rel = String(anchor.getAttribute("rel")).toLowerCase();
if (!anchor.getAttribute("href") || !rel.match('lightbox')) continue;
// initialize item
self._imgs[num] = {
src:anchor.getAttribute("href"),
w:-1,
h:-1,
title:'',
cls:anchor.className,
set:rel
};
if (anchor.getAttribute("title"))
self._imgs[num].title = anchor.getAttribute("title");
else if (anchor.firstChild
&& anchor.firstChild.getAttribute
&& anchor.firstChild.getAttribute("title"))
self._imgs[num].title = anchor.firstChild.getAttribute("title");
anchor.onclick = self._genOpener(num);
// set closure to onclick event
if (rel != 'lightbox')
{
if (!self._sets[rel]) self._sets[rel] = [];
self._sets[rel].push(num);
}
}
var body = d.<API key>("body")[0];
self._wrap = self._createWrapOn(body, option.loadingimg);
self._box = self._createBoxOn(body, option);
self._img = self._box.firstChild;
self._zoomimg = d.getElementById('actionImage');
return self;
},
_genOpener : function(num)
{
var self = this;
return function() {
self._show(num);
return false;
}
},
_createWrapOn : function(obj, imagePath)
{
var self = this;
if (!obj) return null;
// create wrapper object, translucent background
var wrap = document.createElement('div');
obj.appendChild(wrap);
wrap.id = 'overlay';
wrap.style.display = 'none';
wrap.style.position = 'fixed';
wrap.style.top = '0px';
wrap.style.left = '0px';
wrap.style.zIndex = '50';
wrap.style.width = '100%';
wrap.style.height = '100%';
if (Browser.isWinIE) wrap.style.position = 'absolute';
Event.register(wrap, "click", function(evt) {
self._close(evt);
});
// create loading image, animated image
var imag = new Image;
imag.onload = function() {
var spin = document.createElement('img');
wrap.appendChild(spin);
spin.id = 'loadingImage';
spin.src = imag.src;
spin.style.position = 'relative';
self._set_cursor(spin);
Event.register(spin, 'click', function(evt) {
self._close(evt);
});
imag.onload = function() {
};
};
if (imagePath != '') imag.src = imagePath;
return wrap;
},
_createBoxOn : function(obj, option)
{
var self = this;
if (!obj) return null;
// create lightbox object, frame rectangle
var box = document.createElement('div');
obj.appendChild(box);
box.id = 'lightbox';
box.style.display = 'none';
box.style.position = 'absolute';
box.style.zIndex = '60';
// create image object to display a target image
var img = document.createElement('img');
box.appendChild(img);
img.id = 'lightboxImage';
self._set_cursor(img);
Event.register(img, 'mouseover', function() {
self._show_action();
});
Event.register(img, 'mouseout', function() {
self._hide_action();
});
Event.register(img, 'click', function(evt) {
self._close(evt);
});
// create hover navi - prev
if (option.previmg)
{
var prevLink = document.createElement('img');
box.appendChild(prevLink);
prevLink.id = 'prevLink';
prevLink.style.display = 'none';
prevLink.style.position = 'absolute';
prevLink.style.left = '9px';
prevLink.style.zIndex = '70';
prevLink.src = option.previmg;
self._prev = prevLink;
Event.register(prevLink, 'mouseover', function() {
self._show_action();
});
Event.register(prevLink, 'click', function() {
self._show_next(-1);
});
}
// create hover navi - next
if (option.nextimg)
{
var nextLink = document.createElement('img');
box.appendChild(nextLink);
nextLink.id = 'nextLink';
nextLink.style.display = 'none';
nextLink.style.position = 'absolute';
nextLink.style.right = '9px';
nextLink.style.zIndex = '70';
nextLink.src = option.nextimg;
self._next = nextLink;
Event.register(nextLink, 'mouseover', function() {
self._show_action();
});
Event.register(nextLink, 'click', function() {
self._show_next(+1);
});
}
// create zoom indicator
var zoom = document.createElement('img');
box.appendChild(zoom);
zoom.id = 'actionImage';
zoom.style.display = 'none';
zoom.style.position = 'absolute';
zoom.style.top = '15px';
zoom.style.left = '15px';
zoom.style.zIndex = '70';
self._set_cursor(zoom);
zoom.src = self._expand;
Event.register(zoom, 'mouseover', function() {
self._show_action();
});
Event.register(zoom, 'click', function() {
self._zoom();
});
Event.register(window, 'resize', function() {
self._set_size(true);
});
// create close button
if (option.closeimg)
{
var btn = document.createElement('img');
box.appendChild(btn);
btn.id = 'closeButton';
btn.style.display = 'inline';
btn.style.position = 'absolute';
btn.style.right = '9px';
btn.style.top = '10px';
btn.style.zIndex = '80';
btn.src = option.closeimg;
self._set_cursor(btn);
Event.register(btn, 'click', function(evt) {
self._close(evt);
});
}
// caption text
var caption = document.createElement('span');
box.appendChild(caption);
caption.id = 'lightboxCaption';
caption.style.display = 'none';
caption.style.position = 'absolute';
caption.style.zIndex = '80';
// create effect image
/* if (!option.effectpos)
option.effectpos = {x:0,y:0};
else
{
if (option.effectpos.x == '') option.effectpos.x = 0;
if (option.effectpos.y == '') option.effectpos.y = 0;
}
var effect = new Image;
effect.onload = function()
{
var effectImg = document.createElement('img');
box.appendChild(effectImg);
effectImg.id = 'effectImage';
effectImg.src = effect.src;
if (option.effectclass) effectImg.className = option.effectclass;
effectImg.style.position = 'absolute';
effectImg.style.display = 'none';
effectImg.style.left = [option.effectpos.x,'px'].join('');;
effectImg.style.top = [option.effectpos.y,'px'].join('');
effectImg.style.zIndex = '90';
self._set_cursor(effectImg);
Event.register(effectImg,'click',function() { effectImg.style.display = 'none'; });
};
if (option.effectimg != '') effect.src = option.effectimg;*/
if (self._resizable)
{
var overall = document.createElement('div');
obj.appendChild(overall);
overall.id = 'lightboxOverallView';
overall.style.display = 'none';
overall.style.position = 'absolute';
overall.style.zIndex = '70';
self._overall = overall;
var indicator = document.createElement('div');
obj.appendChild(indicator);
indicator.id = 'lightboxIndicator';
indicator.style.display = 'none';
indicator.style.position = 'absolute';
indicator.style.zIndex = '80';
self._indicator = indicator;
}
return box;
},
_set_photo_size : function()
{
var self = this;
if (self._open == -1) return;
var targ = { w:self._page.win.w - 30, h:self._page.win.h - 30 };
var zoom = { x:15, y:15 };
var navi = { p:9, n:9, y:0 };
if (!self._expanded)
{ // shrink image with the same aspect
var orig = { w:self._imgs[self._open].w, h:self._imgs[self._open].h };
var ratio = 1.0;
if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w)
ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h;
self._img.width = Math.floor(orig.w * ratio);
self._img.height = Math.floor(orig.h * ratio);
self._expandable = (ratio < 1.0) ? true : false;
if (self._resizable) self._expandable = true;
if (Browser.isWinIE) self._box.style.display = "block";
self._imgpos.x = self._pos.x + (targ.w - self._img.width) / 2;
self._imgpos.y = self._pos.y + (targ.h - self._img.height) / 2;
navi.y = Math.floor(self._img.height / 2) - 10;
self._show_caption(true);
self._show_overall(false);
}
else
{ // zoomed or actual sized image
var width = parseInt(self._imgs[self._open].w * self._level);
var height = parseInt(self._imgs[self._open].h * self._level);
self._minpos.x = self._pos.x + targ.w - width;
self._minpos.y = self._pos.y + targ.h - height;
if (width <= targ.w)
self._imgpos.x = self._pos.x + (targ.w - width) / 2;
else
{
if (self._imgpos.x > self._pos.x) self._imgpos.x = self._pos.x;
else if (self._imgpos.x < self._minpos.x) self._imgpos.x = self._minpos.x;
zoom.x = 15 + self._pos.x - self._imgpos.x;
navi.p = self._pos.x - self._imgpos.x - 5;
navi.n = width - self._page.win.w + self._imgpos.x + 25;
if (Browser.isWinIE) navi.n -= 10;
}
if (height <= targ.h)
{
self._imgpos.y = self._pos.y + (targ.h - height) / 2;
navi.y = Math.floor(self._img.height / 2) - 10;
}
else
{
if (self._imgpos.y > self._pos.y) self._imgpos.y = self._pos.y;
else if (self._imgpos.y < self._minpos.y) self._imgpos.y = self._minpos.y;
zoom.y = 15 + self._pos.y - self._imgpos.y;
navi.y = Math.floor(targ.h / 2) - 10 + self._pos.y - self._imgpos.y;
}
self._img.width = width;
self._img.height = height;
self._show_caption(false);
self._show_overall(true);
}
self._box.style.left = [self._imgpos.x,'px'].join('');
self._box.style.top = [self._imgpos.y,'px'].join('');
self._zoomimg.style.left = [zoom.x,'px'].join('');
self._zoomimg.style.top = [zoom.y,'px'].join('');
self._wrap.style.left = self._pos.x;
if (self._prev && self._next)
{
self._prev.style.left = [navi.p,'px'].join('');
self._next.style.right = [navi.n,'px'].join('');
self._prev.style.top = self._next.style.top = [navi.y,'px'].join('');
}
},
_show_overall : function(visible)
{
var self = this;
if (self._overall == null) return;
if (visible)
{
if (self._open == -1) return;
var base = 100;
var outer = { w:0, h:0, x:0, y:0 };
var inner = { w:0, h:0, x:0, y:0 };
var orig = { w:self._img.width , h:self._img.height };
var targ = { w:self._page.win.w - 30, h:self._page.win.h - 30 };
var max = orig.w;
if (max < orig.h) max = orig.h;
if (max < targ.w) max = targ.w;
if (max < targ.h) max = targ.h;
if (max < 1) return;
outer.w = parseInt(orig.w / max * base);
outer.h = parseInt(orig.h / max * base);
inner.w = parseInt(targ.w / max * base);
inner.h = parseInt(targ.h / max * base);
outer.x = self._pos.x + targ.w - base - 20;
outer.y = self._pos.y + targ.h - base - 20;
inner.x = outer.x - parseInt((self._imgpos.x - self._pos.x) / max * base);
inner.y = outer.y - parseInt((self._imgpos.y - self._pos.y) / max * base);
self._overall.style.left = [outer.x,'px'].join('');
self._overall.style.top = [outer.y,'px'].join('');
self._overall.style.width = [outer.w,'px'].join('');
self._overall.style.height = [outer.h,'px'].join('');
self._indicator.style.left = [inner.x,'px'].join('');
self._indicator.style.top = [inner.y,'px'].join('');
self._indicator.style.width = [inner.w,'px'].join('');
self._indicator.style.height = [inner.h,'px'].join('');
self._overall.style.display = 'block'
self._indicator.style.display = 'block';
}
else
{
self._overall.style.display = 'none';
self._indicator.style.display = 'none';
}
},
_set_size : function(onResize)
{
var self = this;
if (self._open == -1) return;
self._page.update();
self._pos.update();
var spin = self._wrap.firstChild;
if (spin)
{
var top = (self._page.win.h - spin.height) / 2;
if (self._wrap.style.position == 'absolute') top += self._pos.y;
spin.style.top = [top,'px'].join('');
spin.style.left = [(self._page.win.w - spin.width - 30) / 2,'px'].join('');
}
if (Browser.isWinIE)
{
self._wrap.style.width = [self._page.win.w,'px'].join('');
self._wrap.style.height = [self._page.win.h,'px'].join('');
self._wrap.style.top = [self._pos.y,'px'].join('');
}
if (onResize) self._set_photo_size();
},
_set_cursor : function(obj)
{
var self = this;
if (Browser.isWinIE && !Browser.isNewIE) return;
obj.style.cursor = 'pointer';
},
_current_setindex : function()
{
var self = this;
if (!self._openedset) return -1;
var list = self._sets[self._openedset];
for (var i = 0,n = list.length; i < n; i++)
{
if (list[i] == self._open) return i;
}
return -1;
},
_get_setlength : function()
{
var self = this;
if (!self._openedset) return -1;
return self._sets[self._openedset].length;
},
_show_action : function()
{
var self = this;
if (self._open == -1 || !self._expandable) return;
if (!self._zoomimg) return;
self._zoomimg.src = (self._expanded) ? self._shrink : self._expand;
self._zoomimg.style.display = 'inline';
var check = self._current_setindex();
if (check > -1)
{
if (check > 0) self._prev.style.display = 'inline';
if (check < self._get_setlength() - 1) self._next.style.display = 'inline';
}
},
_hide_action : function()
{
var self = this;
if (self._zoomimg) self._zoomimg.style.display = 'none';
if (self._open > -1 && self._expanded) self._dragstop(null);
if (self._prev) self._prev.style.display = 'none';
if (self._next) self._next.style.display = 'none';
},
_zoom : function()
{
var self = this;
var closeBtn = document.getElementById('closeButton');
if (self._expanded)
{
self._reset_func();
self._expanded = false;
if (closeBtn) closeBtn.style.display = 'inline';
}
else if (self._open > -1)
{
self._level = 1;
self._imgpos.x = self._pos.x;
self._imgpos.y = self._pos.y;
self._expanded = true;
self._funcs.drag = function(evt) {
self._dragstart(evt)
};
self._funcs.dbl = function(evt) {
self._close(null)
};
if (self._resizable)
{
self._funcs.wheel = function(evt) {
self._onwheel(evt)
};
Event.register(self._box, 'mousewheel', self._funcs.wheel);
}
Event.register(self._img, 'mousedown', self._funcs.drag);
Event.register(self._img, 'dblclick', self._funcs.dbl);
if (closeBtn) closeBtn.style.display = 'none';
}
self._set_photo_size();
self._show_action();
},
_reset_func : function()
{
var self = this;
if (self._funcs.wheel != null) Event.deregister(self._box, 'mousewheel', self._funcs.wheel);
if (self._funcs.move != null) Event.deregister(self._img, 'mousemove', self._funcs.move);
if (self._funcs.up != null) Event.deregister(self._img, 'mouseup', self._funcs.up);
if (self._funcs.drag != null) Event.deregister(self._img, 'mousedown', self._funcs.drag);
if (self._funcs.dbl != null) Event.deregister(self._img, 'dblclick', self._funcs.dbl);
self._funcs = {'move':null,'up':null,'drag':null,'wheel':null,'dbl':null};
},
_onwheel : function(evt)
{
var self = this;
var delta = 0;
evt = Event.getEvent(evt);
if (evt.wheelDelta) delta = event.wheelDelta / -120;
else if (evt.detail) delta = evt.detail / 3;
if (Browser.isOpera) delta = - delta;
var step =
(self._level < 1) ? 0.1
: (self._level < 2) ? 0.25
: (self._level < 4) ? 0.5
: 1;
self._level = (delta > 0) ? self._level + step : self._level - step;
if (self._level > 8) self._level = 8;
else if (self._level < 0.5) self._level = 0.5;
self._set_photo_size();
return Event.stop(evt);
},
_dragstart : function(evt)
{
var self = this;
evt = Event.getEvent(evt);
self._curpos.x = evt.screenX;
self._curpos.y = evt.screenY;
self._funcs.move = function(evnt) {
self._dragging(evnt);
};
self._funcs.up = function(evnt) {
self._dragstop(evnt);
};
Event.register(self._img, 'mousemove', self._funcs.move);
Event.register(self._img, 'mouseup', self._funcs.up);
return Event.stop(evt);
},
_dragging : function(evt)
{
var self = this;
evt = Event.getEvent(evt);
self._imgpos.x += evt.screenX - self._curpos.x;
self._imgpos.y += evt.screenY - self._curpos.y;
self._curpos.x = evt.screenX;
self._curpos.y = evt.screenY;
self._set_photo_size();
return Event.stop(evt);
},
_dragstop : function(evt)
{
var self = this;
evt = Event.getEvent(evt);
if (self._funcs.move != null) Event.deregister(self._img, 'mousemove', self._funcs.move);
if (self._funcs.up != null) Event.deregister(self._img, 'mouseup', self._funcs.up);
self._funcs.move = null;
self._funcs.up = null;
self._set_photo_size();
return (evt) ? Event.stop(evt) : false;
},
_show_caption : function(enable)
{
var self = this;
var caption = document.getElementById('lightboxCaption');
if (!caption) return;
if (caption.innerHTML.length == 0 || !enable)
{
caption.style.display = 'none';
}
else
{ // now display caption
caption.style.top = [self._img.height + 10,'px'].join('');
// 10 is top margin of lightbox
caption.style.left = '0px';
caption.style.width = [self._img.width + 20,'px'].join('');
// 20 is total side margin of lightbox
caption.style.display = 'block';
}
},
_toggle_wrap : function(flag)
{
var self = this;
self._wrap.style.display = flag ? "block" : "none";
if (self._hiding.length == 0 && !self._first)
{ // some objects may overlap on overlay, so we hide them temporarily.
var tags = ['select','embed','object'];
for (var i = 0,n = tags.length; i < n; i++)
{
var elem = document.<API key>(tags[i]);
for (var j = 0,m = elem.length; j < m; j++)
{ // check the original value at first. when alredy hidden, dont touch them
var check = elem[j].style.visibility;
if (!check)
{
if (elem[j].currentStyle)
check = elem[j].currentStyle['visibility'];
else if (document.defaultView)
check = document.defaultView.getComputedStyle(elem[j], '').getPropertyValue('visibility');
}
if (check == 'hidden') continue;
self._hiding.push(elem[j]);
}
}
self._first = true;
}
for (var i = 0,n = self._hiding.length; i < n; i++)
self._hiding[i].style.visibility = flag ? "hidden" : "visible";
},
_show : function(num)
{
var self = this;
var imag = new Image;
if (num < 0 || num >= self._imgs.length) return;
var loading = document.getElementById('loadingImage');
var caption = document.getElementById('lightboxCaption');
// var effect = document.getElementById('effectImage');
self._open = num;
// set opened image number
self._set_size(false);
// calc and set wrapper size
self._toggle_wrap(true);
if (loading) loading.style.display = 'inline';
imag.onload = function() {
if (self._imgs[self._open].w == -1)
{ // store original image width and height
self._imgs[self._open].w = imag.width;
self._imgs[self._open].h = imag.height;
}
/* if (effect)
{
effect.style.display = (!effect.className || self._imgs[self._open].cls == effect.className)
? 'block' : 'none';
}*/
if (caption)
try {
caption.innerHTML = self._imgs[self._open].title;
} catch(e) {
}
self._set_photo_size();
// calc and set lightbox size
self._hide_action();
self._box.style.display = "block";
self._img.src = imag.src;
self._img.setAttribute('title', self._imgs[self._open].title);
self._timer = window.setInterval(function() {
self._set_size(true)
}, 100);
if (loading) loading.style.display = 'none';
if (self._imgs[self._open].set != 'lightbox')
{
var set = self._imgs[self._open].set;
if (self._sets[set].length > 1) self._openedset = set;
if (!self._prev || !self._next) self._openedset = null;
}
};
self._expandable = false;
self._expanded = false;
imag.src = self._imgs[self._open].src;
},
_close_box : function()
{
var self = this;
self._open = -1;
self._openedset = null;
self._hide_action();
self._hide_action();
self._reset_func();
self._show_overall(false);
self._box.style.display = "none";
if (self._timer != null)
{
window.clearInterval(self._timer);
self._timer = null;
}
},
_show_next : function(direction)
{
var self = this;
if (!self._openedset) return self._close(null);
var index = self._current_setindex() + direction;
var targ = self._sets[self._openedset][index];
self._close_box();
self._show(targ);
},
_close : function(evt)
{
var self = this;
if (evt != null)
{
evt = Event.getEvent(evt);
var targ = evt.target || evt.srcElement;
if (targ && targ.getAttribute('id') == 'lightboxImage' && self._expanded) return;
}
self._close_box();
self._toggle_wrap(false);
}
};
Event.register(window, "load", function() {
var lightbox = new LightBox({
loadingimg:'lightbox/loading.gif',
expandimg:'lightbox/expand.gif',
shrinkimg:'lightbox/shrink.gif',
previmg:'lightbox/prev.gif',
nextimg:'lightbox/next.gif',
/* effectpos:{x:-40,y:-20},
effectclass:'effectable',*/
closeimg:'lightbox/close.gif',
resizable:true
});
});
|
package org.jf.dexlib2.builder;
import org.jf.dexlib2.*;
import org.jf.dexlib2.builder.instruction.*;
import org.jf.dexlib2.iface.instruction.*;
import java.util.*;
import javax.annotation.*;
public abstract class <API key> extends BuilderInstruction implements SwitchPayload {
@Nullable
MethodLocation referrer;
protected <API key>(@Nonnull Opcode opcode) {
super(opcode);
}
@Nonnull
public MethodLocation getReferrer() {
if (referrer == null) {
throw new <API key>("The referrer has not been set yet");
}
return referrer;
}
@Nonnull
@Override
public abstract List<? extends <API key>> getSwitchElements();
}
|
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Google Chrome Cache files event formatter."""
import unittest
from plaso.formatters import chrome_cache
from tests.formatters import test_lib
class <API key>(test_lib.<API key>):
"""Tests for the Chrome Cache entry event formatter."""
def testInitialization(self):
"""Tests the initialization."""
event_formatter = chrome_cache.<API key>()
self.assertIsNotNone(event_formatter)
def <API key>(self):
"""Tests the <API key> function."""
event_formatter = chrome_cache.<API key>()
<API key> = [u'original_url']
self.<API key>(
event_formatter, <API key>)
# TODO: add test for GetMessages.
if __name__ == '__main__':
unittest.main()
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="ro">
<head>
<!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:25 EEST 2014 -->
<title>Uses of Interface net.sf.jasperreports.engine.export.oasis.<API key> (JasperReports 5.6.0 API)</title>
<meta name="date" content="2014-05-27">
<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 Interface net.sf.jasperreports.engine.export.oasis.<API key> (JasperReports 5.6.0 API)";
}
</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="../../../../../../../net/sf/jasperreports/engine/export/oasis/<API key>.html" title="interface in net.sf.jasperreports.engine.export.oasis">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?net/sf/jasperreports/engine/export/oasis/class-use/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.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 Interface net.sf.jasperreports.engine.export.oasis.<API key>" class="title">Uses of Interface<br>net.sf.jasperreports.engine.export.oasis.<API key></h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/<API key>.html" title="interface in net.sf.jasperreports.engine.export.oasis"><API key></a></span><span class="tabEnd"> </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="#net.sf.jasperreports.components.iconlabel">net.sf.jasperreports.components.iconlabel</a></td>
<td class="colLast">
<div class="block">Contains classes for the built-in Icon Label component.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#net.sf.jasperreports.components.map">net.sf.jasperreports.components.map</a></td>
<td class="colLast">
<div class="block">Contains classes for the built-in Google Map component.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="net.sf.jasperreports.components.iconlabel">
</a>
<h3>Uses of <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/<API key>.html" title="interface in net.sf.jasperreports.engine.export.oasis"><API key></a> in <a href="../../../../../../../net/sf/jasperreports/components/iconlabel/package-summary.html">net.sf.jasperreports.components.iconlabel</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../net/sf/jasperreports/components/iconlabel/package-summary.html">net.sf.jasperreports.components.iconlabel</a> that implement <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/<API key>.html" title="interface in net.sf.jasperreports.engine.export.oasis"><API key></a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../../net/sf/jasperreports/components/iconlabel/<API key>.html" title="class in net.sf.jasperreports.components.iconlabel"><API key></a></strong></code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="net.sf.jasperreports.components.map">
</a>
<h3>Uses of <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/<API key>.html" title="interface in net.sf.jasperreports.engine.export.oasis"><API key></a> in <a href="../../../../../../../net/sf/jasperreports/components/map/package-summary.html">net.sf.jasperreports.components.map</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation">
<caption><span>Classes in <a href="../../../../../../../net/sf/jasperreports/components/map/package-summary.html">net.sf.jasperreports.components.map</a> that implement <a href="../../../../../../../net/sf/jasperreports/engine/export/oasis/<API key>.html" title="interface in net.sf.jasperreports.engine.export.oasis"><API key></a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../../net/sf/jasperreports/components/map/<API key>.html" title="class in net.sf.jasperreports.components.map"><API key></a></strong></code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</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="../../../../../../../net/sf/jasperreports/engine/export/oasis/<API key>.html" title="interface in net.sf.jasperreports.engine.export.oasis">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?net/sf/jasperreports/engine/export/oasis/class-use/<API key>.html" target="_top">Frames</a></li>
<li><a href="<API key>.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>
<span style="font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color:
</small></p>
</body>
</html>
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="ro">
<head>
<!-- Generated by javadoc (version 1.7.0_07) on Tue May 27 14:37:18 EEST 2014 -->
<title><API key>.DeduplicableWrapper (JasperReports 5.6.0 API)</title>
<meta name="date" content="2014-05-27">
<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="<API key>.DeduplicableWrapper (JasperReports 5.6.0 API)";
}
</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 class="navBarCell1Rev">Class</li>
<li><a href="class-use/<API key>.DeduplicableWrapper.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.DeduplicableMap.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?net/sf/jasperreports/engine/util/<API key>.DeduplicableWrapper.html" target="_top">Frames</a></li>
<li><a href="<API key>.DeduplicableWrapper.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>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
</a></div>
<div class="header">
<div class="subTitle">net.sf.jasperreports.engine.util</div>
<h2 title="Class <API key>.DeduplicableWrapper" class="title">Class <API key>.DeduplicableWrapper<T extends <a href="../../../../../net/sf/jasperreports/engine/Deduplicable.html" title="interface in net.sf.jasperreports.engine">Deduplicable</a>></h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>net.sf.jasperreports.engine.util.<API key>.DeduplicableWrapper<T></li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.html" title="class in net.sf.jasperreports.engine.util"><API key></a></dd>
</dl>
<hr>
<br>
<pre>protected static class <span class="strong"><API key>.DeduplicableWrapper<T extends <a href="../../../../../net/sf/jasperreports/engine/Deduplicable.html" title="interface in net.sf.jasperreports.engine">Deduplicable</a>></span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.DeduplicableWrapper.html#<API key>.DeduplicableWrapper(T)"><API key>.DeduplicableWrapper</a></strong>(<a href="../../../../../net/sf/jasperreports/engine/util/<API key>.DeduplicableWrapper.html" title="type parameter in <API key>.DeduplicableWrapper">T</a> object)</code> </td>
</tr>
</table>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_summary">
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.DeduplicableWrapper.html#equals(java.lang.Object)">equals</a></strong>(java.lang.Object other)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><strong><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.DeduplicableWrapper.html#hashCode()">hashCode</a></strong>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="<API key>.lang.Object">
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
</a>
<h3>Constructor Detail</h3>
<a name="<API key>.DeduplicableWrapper(net.sf.jasperreports.engine.Deduplicable)">
</a><a name="<API key>.DeduplicableWrapper(T)">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4><API key>.DeduplicableWrapper</h4>
<pre>public <API key>.DeduplicableWrapper(<a href="../../../../../net/sf/jasperreports/engine/util/<API key>.DeduplicableWrapper.html" title="type parameter in <API key>.DeduplicableWrapper">T</a> object)</pre>
</li>
</ul>
</li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="method_detail">
</a>
<h3>Method Detail</h3>
<a name="hashCode()">
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre>public int hashCode()</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>hashCode</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="equals(java.lang.Object)">
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>equals</h4>
<pre>public boolean equals(java.lang.Object other)</pre>
<dl>
<dt><strong>Overrides:</strong></dt>
<dd><code>equals</code> in class <code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</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 class="navBarCell1Rev">Class</li>
<li><a href="class-use/<API key>.DeduplicableWrapper.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>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.DeduplicableMap.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../../net/sf/jasperreports/engine/util/<API key>.html" title="class in net.sf.jasperreports.engine.util"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?net/sf/jasperreports/engine/util/<API key>.DeduplicableWrapper.html" target="_top">Frames</a></li>
<li><a href="<API key>.DeduplicableWrapper.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>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li><a href="#constructor_summary">Constr</a> | </li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor_detail">Constr</a> | </li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
</a></div>
<p class="legalCopy"><small>
<span style="font-decoration:none;font-family:Arial,Helvetica,sans-serif;font-size:8pt;font-style:normal;color:
</small></p>
</body>
</html>
|
<HTML>
<HEAD>
<TITLE>VectotToDoubleArray</TITLE>
</HEAD>
<BODY TEXT="#000000" LINK="#ff00ff" VLINK="#800080" BGCOLOR="#fdf5e6" alink="#FF0000">
<H1 ALIGN="CENTER">VectToDoubleArray</H1>
<P ALIGN="CENTER">
<LARGE><B>Author : Ian Wang</B>
</P>
<P ALIGN="CENTER">
<LARGE><B>Version : VERSION <BR>
<BR>
Input Types : <A HREF="C:\triana\help/JavaDoc/triana/types/VectorType.html">VectorType</A><BR>
Output Types : double[]<BR>
Date : 16 Jun 2003</LARGE>
</P>
</B><H2><A NAME="contents"></A>Contents</H2>
<UL>
<LI><A HREF="#description">Description of VectToDoubleArray</A></LI>
<LI><A HREF="#using">Using VectotToDoubleArray</A></LI>
</UL>
<P>
<HR WIDTH="15%" SIZE=4>
</P>
<H2><A NAME="description"></A>Description of VectToDoubleArray</H2>
<P>Converts a vector type into two double arrays</P>
<P>The unit called VectToDoubleArray ...... <BR>
</P>
<H2><A NAME="using"></A>Using VectToDoubleArray</H2>
<P>VectToDoubleArray's parameter window (double-click on the unit while holding down the Control key) is used to
. </P>
<P>
<HR WIDTH="15%" SIZE=4>
</P></BODY>
</HTML>
|
package nodeAST.relational;
import java.util.Map;
import nodeAST.BinaryExpr;
import nodeAST.Expression;
import nodeAST.Ident;
import nodeAST.literals.Literal;
import types.BoolType;
import types.Type;
import visitor.ASTVisitor;
import visitor.<API key>;
public class NEq extends BinaryExpr {
public NEq(Expression leftHandOperand, Expression rightHandOperand) {
super(leftHandOperand,rightHandOperand);
}
@Override
public void accept(ASTVisitor visitor) {
visitor.visit(this, this.leftHandOperand, this.rightHandOperand);
}
@Override
public String toString() {
return this.leftHandOperand.toString() + "!=" + this.rightHandOperand.toString();
}
@Override
public Type getType(<API key> typeMatcher) {
return new BoolType();
}
@Override
public boolean <API key>(<API key> typeMatcher) {
Type t1=this.leftHandOperand.getType(typeMatcher);
Type t2=this.rightHandOperand.getType(typeMatcher);
return t1.isCompatibleWith(t2) &&
(t1.isArithmetic() || t1.isBoolean() || t1.isRelational() || t1.isString() );
}
@Override
public Literal compute(Map<Ident, Expression> identifiers) {
return this.leftHandOperand.compute(identifiers).neq(
this.rightHandOperand.compute(identifiers)
);
}
}
|
package edu.ptu.javatest._60_dsa;
import org.junit.Test;
import java.util.TreeMap;
import static edu.ptu.javatest._20_ooad._50_dynamic._00_ReflectionTest.getRefFieldBool;
import static edu.ptu.javatest._20_ooad._50_dynamic._00_ReflectionTest.getRefFieldObj;
public class _35_TreeMapTest {
@Test
public void testPrintTreeMap() {
TreeMap hashMapTest = new TreeMap<>();
for (int i = 0; i < 6; i++) {
hashMapTest.put(new TMHashObj(1,i*2 ), i*2 );
}
Object table = getRefFieldObj(hashMapTest, hashMapTest.getClass(), "root");
printTreeMapNode(table);
hashMapTest.put(new TMHashObj(1,9), 9);
printTreeMapNode(table);
System.out.println();
}
public static int getTreeDepth(Object rootNode) {
if (rootNode == null || !rootNode.getClass().toString().equals("class java.util.TreeMap$Entry"))
return 0;
return rootNode == null ? 0 : (1 + Math.max(getTreeDepth(getRefFieldObj(rootNode, rootNode.getClass(), "left")), getTreeDepth(getRefFieldObj(rootNode, rootNode.getClass(), "right"))));
}
public static void printTreeMapNode(Object rootNode) {
if (rootNode == null || !rootNode.getClass().toString().equals("class java.util.TreeMap$Entry"))
return;
int treeDepth = getTreeDepth(rootNode);
Object[] objects = new Object[(int) (Math.pow(2, treeDepth) - 1)];
objects[0] = rootNode;
// objects[0]=rootNode;
// objects[1]=getRefFieldObj(objects,objects.getClass(),"left");
// objects[2]=getRefFieldObj(objects,objects.getClass(),"right");
// objects[3]=getRefFieldObj(objects[1],objects[1].getClass(),"left");
// objects[4]=getRefFieldObj(objects[1],objects[1].getClass(),"right");
// objects[5]=getRefFieldObj(objects[2],objects[3].getClass(),"left");
// objects[6]=getRefFieldObj(objects[2],objects[4].getClass(),"right");
for (int i = 1; i < objects.length; i++) {
int index = (i - 1) / 2;//parent
if (objects[index] != null) {
if (i % 2 == 1)
objects[i] = getRefFieldObj(objects[index], objects[index].getClass(), "left");
else
objects[i] = getRefFieldObj(objects[index], objects[index].getClass(), "right");
}
}
StringBuilder sb = new StringBuilder();
StringBuilder outSb = new StringBuilder();
String space = " ";
for (int i = 0; i < treeDepth + 1; i++) {
sb.append(space);
}
int nextlineIndex = 0;
for (int i = 0; i < objects.length; i++) {//new line: 0,1 ,3,7
//print space
//print value
if (nextlineIndex == i) {
outSb.append("\n\n");
if (sb.length() >= space.length()) {
sb.delete(0, space.length());
}
nextlineIndex = i * 2 + 1;
}
outSb.append(sb.toString());
if (objects[i] != null) {
Object value = getRefFieldObj(objects[i], objects[i].getClass(), "value");
boolean red = !getRefFieldBool(objects[i], objects[i].getClass(), "color");// BLACK = true;
String result = "" + value + "(" + (red ? "r" : "b") + ")";
outSb.append(result);
} else {
outSb.append("nil");
}
}
System.out.println(outSb.toString());
}
public static class TMHashObj implements Comparable{
int hash;
int value;
TMHashObj(int hash, int value) {
this.hash = hash;
this.value = value;
}
@Override
public int hashCode() {
return hash;
}
@Override
public int compareTo(Object o) {
if (o instanceof TMHashObj){
return this.value-((TMHashObj) o).value;
}
return value-o.hashCode();
}
}
}
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_22) on Tue Nov 16 12:39:11 CET 2010 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
GenericService (RESThub framework 1.0 API)
</TITLE>
<META NAME="date" CONTENT="2010-11-16">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="GenericService (RESThub framework 1.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<A NAME="navbar_top"></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GenericService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/resthub/core/service/<API key>.html" title="class in org.resthub.core.service"><B>PREV CLASS</B></A>
<A HREF="../../../../org/resthub/core/service/GenericServiceImpl.html" title="class in org.resthub.core.service"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/resthub/core/service/GenericService.html" target="_top"><B>FRAMES</B></A>
<A HREF="GenericService.html" target="_top"><B>NO FRAMES</B></A>
<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: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<H2>
<FONT SIZE="-1">
org.resthub.core.service</FONT>
<BR>
Interface GenericService<T,ID extends java.io.Serializable></H2>
<DL>
<DT><DT><B>Type Parameters:</B><DD><CODE>T</CODE> - Domain model class managed, must be an Entity<DD><CODE>PK</CODE> - Primary key class of T</DL>
<DL>
<DT><B>All Known Subinterfaces:</B> <DD><A HREF="../../../../org/resthub/oauth2/provider/service/<API key>.html" title="interface in org.resthub.oauth2.provider.service"><API key></A>, <A HREF="../../../../org/resthub/core/service/<API key>.html" title="interface in org.resthub.core.service"><API key></A><T></DD>
</DL>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../org/resthub/oauth2/provider/service/<API key>.html" title="class in org.resthub.oauth2.provider.service"><API key></A>, <A HREF="../../../../org/resthub/core/service/<API key>.html" title="class in org.resthub.core.service"><API key></A>, <A HREF="../../../../org/resthub/core/service/GenericServiceImpl.html" title="class in org.resthub.core.service">GenericServiceImpl</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>GenericService<T,ID extends java.io.Serializable></B></DL>
</PRE>
<P>
Generic Service interface.
<P>
<P>
<HR>
<P>
<A NAME="method_summary"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.lang.Long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#count()">count</A></B>()</CODE>
<BR>
Count all resources.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#create(T)">create</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> resource)</CODE>
<BR>
Create new resource.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#delete(ID)">delete</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A> id)</CODE>
<BR>
Delete existing resource.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#delete(T)">delete</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> resource)</CODE>
<BR>
Delete existing resource.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.List<<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findAll()">findAll</A></B>()</CODE>
<BR>
Find all resources.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.util.List<<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findAll(java.lang.Integer, java.lang.Integer)">findAll</A></B>(java.lang.Integer offset,
java.lang.Integer limit)</CODE>
<BR>
Find all resources.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> org.synyx.hades.domain.Page<<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findAll(org.synyx.hades.domain.Pageable)">findAll</A></B>(org.synyx.hades.domain.Pageable pageRequest)</CODE>
<BR>
Find all resources (pageable).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#findById(ID)">findById</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A> id)</CODE>
<BR>
Find resource by id.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> <A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../org/resthub/core/service/GenericService.html#update(T)">update</A></B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> resource)</CODE>
<BR>
Update existing resource.</TD>
</TR>
</TABLE>
<P>
<A NAME="method_detail"></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="create(java.lang.Object)"></A><A NAME="create(T)"></A><H3>
create</H3>
<PRE>
<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> <B>create</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> resource)</PRE>
<DL>
<DD>Create new resource.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>resource</CODE> - Resource to create
<DT><B>Returns:</B><DD>new resource</DL>
</DD>
</DL>
<HR>
<A NAME="update(java.lang.Object)"></A><A NAME="update(T)"></A><H3>
update</H3>
<PRE>
<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> <B>update</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> resource)</PRE>
<DL>
<DD>Update existing resource.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>resource</CODE> - Resource to update
<DT><B>Returns:</B><DD>resource updated</DL>
</DD>
</DL>
<HR>
<A NAME="delete(java.lang.Object)"></A><A NAME="delete(T)"></A><H3>
delete</H3>
<PRE>
void <B>delete</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> resource)</PRE>
<DL>
<DD>Delete existing resource.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>resource</CODE> - Resource to delete</DL>
</DD>
</DL>
<HR>
<A NAME="delete(java.io.Serializable)"></A><A NAME="delete(ID)"></A><H3>
delete</H3>
<PRE>
void <B>delete</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A> id)</PRE>
<DL>
<DD>Delete existing resource.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - Resource id</DL>
</DD>
</DL>
<HR>
<A NAME="findById(java.io.Serializable)"></A><A NAME="findById(ID)"></A><H3>
findById</H3>
<PRE>
<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A> <B>findById</B>(<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">ID</A> id)</PRE>
<DL>
<DD>Find resource by id.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>id</CODE> - Resource id
<DT><B>Returns:</B><DD>resource</DL>
</DD>
</DL>
<HR>
<A NAME="findAll(java.lang.Integer, java.lang.Integer)"></A><H3>
findAll</H3>
<PRE>
java.util.List<<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>> <B>findAll</B>(java.lang.Integer offset,
java.lang.Integer limit)</PRE>
<DL>
<DD>Find all resources.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>offset</CODE> - offset (default 0)<DD><CODE>limit</CODE> - limit (default 100)
<DT><B>Returns:</B><DD>resources.</DL>
</DD>
</DL>
<HR>
<A NAME="findAll()"></A><H3>
findAll</H3>
<PRE>
java.util.List<<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>> <B>findAll</B>()</PRE>
<DL>
<DD>Find all resources.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>a list of all resources.</DL>
</DD>
</DL>
<HR>
<A NAME="findAll(org.synyx.hades.domain.Pageable)"></A><H3>
findAll</H3>
<PRE>
org.synyx.hades.domain.Page<<A HREF="../../../../org/resthub/core/service/GenericService.html" title="type parameter in GenericService">T</A>> <B>findAll</B>(org.synyx.hades.domain.Pageable pageRequest)</PRE>
<DL>
<DD>Find all resources (pageable).
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pageRequest</CODE> - page request
<DT><B>Returns:</B><DD>resources</DL>
</DD>
</DL>
<HR>
<A NAME="count()"></A><H3>
count</H3>
<PRE>
java.lang.Long <B>count</B>()</PRE>
<DL>
<DD>Count all resources.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>number of resources</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=2 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> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/GenericService.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../org/resthub/core/service/<API key>.html" title="class in org.resthub.core.service"><B>PREV CLASS</B></A>
<A HREF="../../../../org/resthub/core/service/GenericServiceImpl.html" title="class in org.resthub.core.service"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?org/resthub/core/service/GenericService.html" target="_top"><B>FRAMES</B></A>
<A HREF="GenericService.html" target="_top"><B>NO FRAMES</B></A>
<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: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
Copyright &
</BODY>
</HTML>
|
using System;
using System.Html;
using System.Runtime.CompilerServices;
namespace jQueryApi.UI.Widgets {
[Imported]
[IgnoreNamespace]
[Serializable]
public sealed class <API key> {
public object OriginalPosition {
get; set;
}
public object OriginalSize {
get; set;
}
public object Position {
get; set;
}
public object Size {
get; set;
}
}
}
|
layout: default
modal-id: 7
date: 2013-01-31
img: themis.png
alt: UOCD
project-date: Spring 2013
client: Olin
title: User-Oriented Collaborative Design
size: 5
tags: [Design, Project]
description: "As part of Olin’s User-Oriented Collaborative Design course, I worked for a semester with parents of visually impaired children to understand their experiences and design a product based on their challenges and values.
<br/>
<br/> After interviews with dozens of parents, children, educators and community advocates, my team realized that getting people to challenge visually impaired children is a difficulty for many parents. They’re trying to raise their children, while teachers, family members and even other children often go out of their way to make sure visually impaired children aren’t challenged or disadvantaged. These people, while meaning well, are making it so visually impaired children are not prepared to handle the real world. Many parents spoke about being exhausted from simply trying to get teacher to challenge their students.
<br/>
<br/> Our solution: Themis, a VR headset giving anyone the experience of being a visually impaired person with the tools and experience necessary to thrive. Themis totally simulates the sight, hearing, and some of the tactile sensations experienced by a visually impaired person completing a variety of tasks. It allows users to walk through these experiences first on their own, with the sense of a visually impaired person, and then with expert guidance to help them understand the actual experience of a visually impaired person, who has tools to navigate the world.
<br/>
<br/>
During this project, we encountered a variety of design challenges, but the most prominent was the fact that parents wanted us to design for their children, not them. In interviews, every idea we co-designed with was changed into a product for the children. Essentially, in their eyes, we should focus on designing for their children, not them. The course guideline was quite clear; we were designing for the parents. To help overcome this challenge we changed our co-design approach and introduced our ideas as tools focused on the child that the parent could use. With this approach, we narrowed in on Themis as the idea that parents found the most valuable.
"
|
package com.cisco.axl.api._8;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "<API key>", propOrder = {
"phoneType",
"protocol",
"name",
"description",
"deviceSecurityMode",
"authenticationMode",
"keySize",
"tftpEncryptedConfig",
"nonceValidityTime",
"transportType",
"sipPhonePort",
"<API key>",
"<API key>"
})
public class <API key> {
protected String phoneType;
protected String protocol;
protected String name;
protected String description;
protected String deviceSecurityMode;
protected String authenticationMode;
protected String keySize;
protected String tftpEncryptedConfig;
protected String nonceValidityTime;
protected String transportType;
protected String sipPhonePort;
protected String <API key>;
protected String <API key>;
@XmlAttribute
protected String uuid;
/**
* Gets the value of the phoneType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPhoneType() {
return phoneType;
}
/**
* Sets the value of the phoneType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPhoneType(String value) {
this.phoneType = value;
}
/**
* Gets the value of the protocol property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getProtocol() {
return protocol;
}
/**
* Sets the value of the protocol property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setProtocol(String value) {
this.protocol = value;
}
/**
* 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;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the deviceSecurityMode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String <API key>() {
return deviceSecurityMode;
}
/**
* Sets the value of the deviceSecurityMode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void <API key>(String value) {
this.deviceSecurityMode = value;
}
/**
* Gets the value of the authenticationMode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String <API key>() {
return authenticationMode;
}
/**
* Sets the value of the authenticationMode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void <API key>(String value) {
this.authenticationMode = value;
}
/**
* Gets the value of the keySize property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getKeySize() {
return keySize;
}
/**
* Sets the value of the keySize property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setKeySize(String value) {
this.keySize = value;
}
/**
* Gets the value of the tftpEncryptedConfig property.
*
* @return
* possible object is
* {@link String }
*
*/
public String <API key>() {
return tftpEncryptedConfig;
}
/**
* Sets the value of the tftpEncryptedConfig property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void <API key>(String value) {
this.tftpEncryptedConfig = value;
}
/**
* Gets the value of the nonceValidityTime property.
*
* @return
* possible object is
* {@link String }
*
*/
public String <API key>() {
return nonceValidityTime;
}
/**
* Sets the value of the nonceValidityTime property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void <API key>(String value) {
this.nonceValidityTime = value;
}
/**
* Gets the value of the transportType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTransportType() {
return transportType;
}
/**
* Sets the value of the transportType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTransportType(String value) {
this.transportType = value;
}
/**
* Gets the value of the sipPhonePort property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSipPhonePort() {
return sipPhonePort;
}
/**
* Sets the value of the sipPhonePort property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSipPhonePort(String value) {
this.sipPhonePort = value;
}
/**
* Gets the value of the <API key> property.
*
* @return
* possible object is
* {@link String }
*
*/
public String <API key>() {
return <API key>;
}
/**
* Sets the value of the <API key> property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void <API key>(String value) {
this.<API key> = value;
}
/**
* Gets the value of the <API key> property.
*
* @return
* possible object is
* {@link String }
*
*/
public String <API key>() {
return <API key>;
}
/**
* Sets the value of the <API key> property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void <API key>(String value) {
this.<API key> = value;
}
/**
* Gets the value of the uuid property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUuid() {
return uuid;
}
/**
* Sets the value of the uuid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUuid(String value) {
this.uuid = value;
}
}
|
package pokemon.vue;
import pokemon.launcher.PokemonCore;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.actions.*;
public class MyActor extends Actor {
public Texture s=new Texture(Gdx.files.internal("crosshair.png"));
SpriteBatch b=new SpriteBatch();
float x,y;
public MyActor (float x, float y) {
this.x=x;
this.y=y;
System.out.print(PokemonCore.m.getCities().get(0).getX());
this.setBounds(x+PokemonCore.m.getCities().get(0).getX(),y+PokemonCore.m.getCities().get(0).getY(),s.getWidth(),s.getHeight());
/* RepeatAction action = new RepeatAction();
action.setCount(RepeatAction.FOREVER);
action.setAction(Actions.fadeOut(2f));*/
this.addAction(Actions.repeat(RepeatAction.FOREVER,Actions.sequence(Actions.fadeOut(1f),Actions.fadeIn(1f))));
//posx=this.getX();
//posy=this.getY();
//this.addAction(action);
//this.addAction(Actions.sequence(Actions.alpha(0),Actions.fadeIn(2f)));
System.out.println("Actor constructed");
b.getProjectionMatrix().setToOrtho2D(0, 0,640,360);
}
@Override
public void draw (Batch batch, float parentAlpha) {
b.begin();
Color color = getColor();
b.setColor(color.r, color.g, color.b, color.a * parentAlpha);
b.draw(s,this.getX()-15,this.getY()-15,30,30);
b.setColor(color);
b.end();
//System.out.println("Called");
//batch.draw(t,this.getX(),this.getY(),t.getWidth(),t.getHeight());
//batch.draw(s,this.getX()+Minimap.BourgPalette.getX(),this.getY()+Minimap.BourgPalette.getY(),30,30);
}
public void setPosition(float x, float y){
this.setX(x+this.x);
this.setY(y+this.y);
}
}
|
package org.tiltedwindmills.fantasy.mfl.services;
import org.tiltedwindmills.fantasy.mfl.model.LoginResponse;
/**
* Interface defining operations required for logging into an MFL league.
*/
public interface LoginService {
/**
* Login.
*
* @param leagueId the league id
* @param serverId the server id
* @param year the year
* @param franchiseId the franchise id
* @param password the password
* @return the login response
*/
LoginResponse login(int leagueId, int serverId, int year, String franchiseId, String password);
}
|
# wc [option] command
# -l, --lines :
# -L, --max-line-length :
# -w, --words :
# -m, --chars :
# -c, --bytes :
wc dstFile
cat dstFile | wc
wc -l dstFile
cat dstFile | wc -l
wc -w dstFile
cat dstFile | wc -w
wc -c dstFile
cat dstFile | wc -c
wc -m dstFile
cat dstFile | wc -m
ls -l | wc -l
# line counts
wc -l
# word counts
wc -w
# char counts
wc -m
# bytes
wc -c
wc -L
ls -l |grep "^-"| wc -l
ls -l |grep "^"| wc -l
ls -lR|grep "^-"| wc -l
ls -lR dir | grep .js | wc -l
ls -l "dir" | grep ".js" | wc -l
ls -lR|grep "^d"|wc -l
ls -lR
grep "^-"
wc -l
ls -d
find -type d
ls -lF |grep /
ls -l |grep '^d'
|
<?php
/* TwigBundle:Exception:exception.rdf.twig */
class <API key> extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
);
}
protected function doDisplay(array $context, array $blocks = array())
{
$<API key> = $this->env->getExtension("Symfony\\Bundle\\WebProfilerBundle\\Twig\\<API key>");
$<API key>->enter($<API key> = new <API key>($this->getTemplateName(), "template", "TwigBundle:Exception:exception.rdf.twig"));
$<API key> = $this->env->getExtension("Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension");
$<API key>->enter($<API key> = new <API key>($this->getTemplateName(), "template", "TwigBundle:Exception:exception.rdf.twig"));
// line 1
$this->loadTemplate("@Twig/Exception/exception.xml.twig", "TwigBundle:Exception:exception.rdf.twig", 1)->display(array_merge($context, array("exception" => (isset($context["exception"]) ? $context["exception"] : $this->getContext($context, "exception")))));
$<API key>->leave($<API key>);
$<API key>->leave($<API key>);
}
public function getTemplateName()
{
return "TwigBundle:Exception:exception.rdf.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 25 => 1,);
}
/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
public function getSource()
{
@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);
return $this->getSourceContext()->getCode();
}
public function getSourceContext()
{
return new Twig_Source("{% include '@Twig/Exception/exception.xml.twig' with { 'exception': exception } %}
", "TwigBundle:Exception:exception.rdf.twig", "C:\\wamp64\\www\\Symfony\\vendor\\symfony\\symfony\\src\\Symfony\\Bundle\\TwigBundle/Resources/views/Exception/exception.rdf.twig");
}
}
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_20) on Tue Dec 23 13:29:41 PST 2014 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Deprecated List (jcuda-windows64 6.5 API)</title>
<meta name="date" content="2014-12-23">
<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="Deprecated List (jcuda-windows64 6.5 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>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li class="navBarCell1Rev">Deprecated</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?deprecated-list.html" target="_top">Frames</a></li>
<li><a href="deprecated-list.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">
<h1 title="Deprecated API" class="title">Deprecated API</h1>
<h2 title="Contents">Contents</h2>
<ul>
<li><a href="#class">Deprecated Classes</a></li>
<li><a href="#field">Deprecated Fields</a></li>
<li><a href="#method">Deprecated Methods</a></li>
</ul>
</div>
<div class="contentContainer"><a name="class">
</a>
<ul class="blockList">
<li class="blockList">
<table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Classes table, listing deprecated classes, and an explanation">
<caption><span>Deprecated Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/CUGLmap_flags.html" title="class in jcuda.driver">jcuda.driver.CUGLmap_flags</a>
<div class="block"><span class="deprecationComment">As of CUDA 3.0</span></div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="field">
</a>
<ul class="blockList">
<li class="blockList">
<table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Fields table, listing deprecated fields, and an explanation">
<caption><span>Deprecated Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#<API key>">jcuda.driver.CUdevice_attribute.<API key></a>
<div class="block"><span class="deprecationComment">Deprecated, do not use.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#<API key>">jcuda.driver.CUdevice_attribute.<API key></a>
<div class="block"><span class="deprecationComment">Use instead <API key></span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#<API key>">jcuda.driver.CUdevice_attribute.<API key></a>
<div class="block"><span class="deprecationComment">Use <API key></span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#<API key>">jcuda.driver.CUdevice_attribute.<API key></a>
<div class="block"><span class="deprecationComment">Use <API key></span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#<API key>">jcuda.driver.CUdevice_attribute.<API key></a>
<div class="block"><span class="deprecationComment">Use <API key></span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#<API key>">jcuda.driver.CUdevice_attribute.<API key></a>
<div class="block"><span class="deprecationComment">use <API key></span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/CUdevice_attribute.html#<API key>">jcuda.driver.CUdevice_attribute.<API key></a>
<div class="block"><span class="deprecationComment">use <API key></span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/JCudaDriver.html#<API key>">jcuda.driver.JCudaDriver.<API key></a>
<div class="block"><span class="deprecationComment">This value has been added in CUDA 4.0 RC,
and removed in CUDA 4.0 RC2</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/JCudaDriver.html#<API key>">jcuda.driver.JCudaDriver.<API key></a>
<div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate)
and may be removed (or added again) in future releases</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/JCudaDriver.html#<API key>">jcuda.driver.JCudaDriver.<API key></a>
<div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate)
and may be removed (or added again) in future releases</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/JCudaDriver.html#<API key>">jcuda.driver.JCudaDriver.<API key></a>
<div class="block"><span class="deprecationComment">use <API key></span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/CUresult.html#<API key>">jcuda.driver.CUresult.<API key></a>
<div class="block"><span class="deprecationComment">This value has been added in CUDA 4.0 RC,
and removed in CUDA 4.0 RC2</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/CUresult.html#<API key>">jcuda.driver.CUresult.<API key></a>
<div class="block"><span class="deprecationComment">This value has been added in CUDA 4.0 RC,
and removed in CUDA 4.0 RC2</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/CUresult.html#<API key>">jcuda.driver.CUresult.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0.
It is no longer an error to call cuProfilerStart() when
profiling is already enabled.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/CUresult.html#<API key>">jcuda.driver.CUresult.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0.
It is no longer an error to call cuProfilerStop() when
profiling is already disabled.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/driver/CUresult.html#<API key>">jcuda.driver.CUresult.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0.
It is no longer an error to attempt to enable/disable the
profiling via ::cuProfilerStart or ::cuProfilerStop without
initialization.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/JCuda.html#<API key>">jcuda.runtime.JCuda.<API key></a>
<div class="block"><span class="deprecationComment">As of CUDA 4.0 and replaced by <API key></span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Variables in constant
memory may now have their address taken by the runtime via
<a href="jcuda/runtime/JCuda.html#<API key>.Pointer-java.lang.String-"><code>JCuda.<API key>(jcuda.Pointer, java.lang.String)</code></a>.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 4.1.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was
removed with the CUDA 3.1 release.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was
removed with the CUDA 3.1 release.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 4.1.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was
removed with the CUDA 3.1 release.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error
to call <a href="jcuda/runtime/JCuda.html#cudaProfilerStart--"><code>JCuda.cudaProfilerStart()</code></a> when profiling is already enabled.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error
to call <a href="jcuda/runtime/JCuda.html#cudaProfilerStop--"><code>JCuda.cudaProfilerStop()</code></a> when profiling is already disabled.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 5.0. It is no longer an error
to attempt to enable/disable the profiling via <a href="jcuda/runtime/JCuda.html#cudaProfilerStart--"><code>JCuda.cudaProfilerStart()</code></a> or
<a href="jcuda/runtime/JCuda.html#cudaProfilerStop--"><code>JCuda.cudaProfilerStop()</code></a> without initialization.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was
removed with the CUDA 3.1 release.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was
removed with the CUDA 3.1 release.</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/cudaError.html#<API key>">jcuda.runtime.cudaError.<API key></a>
<div class="block"><span class="deprecationComment">This error return is deprecated as of CUDA 3.1. Device emulation mode was
removed with the CUDA 3.1 release.</span></div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><a href="jcuda/runtime/JCuda.html#<API key>">jcuda.runtime.JCuda.<API key></a>
<div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate)
and may be removed (or added again) in future releases</span></div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><a href="jcuda/runtime/JCuda.html#<API key>">jcuda.runtime.JCuda.<API key></a>
<div class="block"><span class="deprecationComment">This flag was only present in CUDA 5.0.25 (release candidate)
and may be removed (or added again) in future releases</span></div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="method">
</a>
<ul class="blockList">
<li class="blockList">
<table class="deprecatedSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated Methods table, listing deprecated methods, and an explanation">
<caption><span>Deprecated Methods</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colOne"><a href="jcuda/driver/JCudaDriver.html#align-int-int-">jcuda.driver.JCudaDriver.align(int, int)</a>
<div class="block"><span class="deprecationComment">This method was intended for a simpler
kernel parameter setup in earlier CUDA versions,
and should not be required any more. It may be
removed in future releases.</span></div>
</td>
</tr>
</tbody>
</table>
</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>Package</li>
<li>Class</li>
<li>Use</li>
<li><a href="overview-tree.html">Tree</a></li>
<li class="navBarCell1Rev">Deprecated</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?deprecated-list.html" target="_top">Frames</a></li>
<li><a href="deprecated-list.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>Copyright &
</body>
</html>
|
#include "nrsalPrimitives.h"
nrsalPrimitives::nrsalPrimitives()
{
//ctor
}
nrsalPrimitives::~nrsalPrimitives()
{
//dtor
}
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Thu Sep 17 01:48:58 IST 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Uses of Class org.apache.solr.cloud.ZkTestServer.<API key> (Solr 5.3.1 API)</title>
<meta name="date" content="2015-09-17">
<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.solr.cloud.ZkTestServer.<API key> (Solr 5.3.1 API)";
}
</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/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">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="../../../../../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/solr/cloud/class-use/ZkTestServer.<API key>.html" target="_top">Frames</a></li>
<li><a href="ZkTestServer.<API key>.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.solr.cloud.ZkTestServer.<API key>" class="title">Uses of Class<br>org.apache.solr.cloud.ZkTestServer.<API key></h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">ZkTestServer.<API key></a></span><span class="tabEnd"> </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.apache.solr.cloud">org.apache.solr.cloud</a></td>
<td class="colLast">
<div class="block">Base classes and utilities for creating and testing <a href="https://wiki.apache.org/solr/SolrCloud">Solr Cloud</a> clusters.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.solr.cloud">
</a>
<h3>Uses of <a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">ZkTestServer.<API key></a> in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> that return <a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">ZkTestServer.<API key></a></span><span class="tabEnd"> </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>static <a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">ZkTestServer.<API key></a></code></td>
<td class="colLast"><span class="strong">ZkTestServer.<API key>.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">ZkTestServer.<API key></a>[]</code></td>
<td class="colLast"><span class="strong">ZkTestServer.<API key>.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html#values()">values</a></strong>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../org/apache/solr/cloud/package-summary.html">org.apache.solr.cloud</a> with parameters of type <a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">ZkTestServer.<API key></a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">ZkTestServer.</span><code><strong><a href="../../../../../org/apache/solr/cloud/ZkTestServer.html#<API key>(org.apache.solr.cloud.ZkTestServer.<API key>)"><API key></a></strong>(<a href="../../../../../org/apache/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">ZkTestServer.<API key></a> <API key>)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</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/solr/cloud/ZkTestServer.<API key>.html" title="enum in org.apache.solr.cloud">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="../../../../../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/solr/cloud/class-use/ZkTestServer.<API key>.html" target="_top">Frames</a></li>
<li><a href="ZkTestServer.<API key>.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 © 2000-2015 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
|
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html PUBLIC "-
<html>
<head>
<title>ObjFormatType - com.ligadata.olep.metadata.ObjFormatType</title>
<meta name="description" content="ObjFormatType - com.ligadata.olep.metadata.ObjFormatType" />
<meta name="keywords" content="ObjFormatType com.ligadata.olep.metadata.ObjFormatType" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" />
<link href="../../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" />
<script type="text/javascript">
if(top === self) {
var url = '../../../../index.html';
var hash = 'com.ligadata.olep.metadata.ObjFormatType$';
var anchor = window.location.hash;
var anchor_opt = '';
if (anchor.length >= 1)
anchor_opt = '@' + anchor.substring(1);
window.location.href = url + '#' + hash + anchor_opt;
}
</script>
</head>
<body class="value">
<div id="definition">
<img src="../../../../lib/object_big.png" />
<p id="owner"><a href="../../../package.html" class="extype" name="com">com</a>.<a href="../../package.html" class="extype" name="com.ligadata">ligadata</a>.<a href="../package.html" class="extype" name="com.ligadata.olep">olep</a>.<a href="package.html" class="extype" name="com.ligadata.olep.metadata">metadata</a></p>
<h1>ObjFormatType</h1>
</div>
<h4 id="signature" class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">object</span>
</span>
<span class="symbol">
<span class="name">ObjFormatType</span><span class="result"> extends <span class="extype" name="scala.Enumeration">Enumeration</span></span>
</span>
</h4>
<div id="comment" class="fullcommenttop"><div class="toggleContainer block">
<span class="toggle">Linear Supertypes</span>
<div class="superTypes hiddenContent"><span class="extype" name="scala.Enumeration">Enumeration</span>, <span class="extype" name="scala.Serializable">Serializable</span>, <span class="extype" name="java.io.Serializable">Serializable</span>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div>
</div></div>
<div id="mbrsel">
<div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div>
<div id="order">
<span class="filtertype">Ordering</span>
<ol>
<li class="alpha in"><span>Alphabetic</span></li>
<li class="inherit out"><span>By inheritance</span></li>
</ol>
</div>
<div id="ancestors">
<span class="filtertype">Inherited<br />
</span>
<ol id="linearization">
<li class="in" name="com.ligadata.olep.metadata.ObjFormatType"><span>ObjFormatType</span></li><li class="in" name="scala.Enumeration"><span>Enumeration</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li>
</ol>
</div><div id="ancestors">
<span class="filtertype"></span>
<ol>
<li class="hideall out"><span>Hide All</span></li>
<li class="showall in"><span>Show all</span></li>
</ol>
<a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a>
</div>
<div id="visbl">
<span class="filtertype">Visibility</span>
<ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol>
</div>
</div>
<div id="template">
<div id="allMembers">
<div id="types" class="types members">
<h3>Type Members</h3>
<ol><li name="com.ligadata.olep.metadata.ObjFormatType.FormatType" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="FormatType=com.ligadata.olep.metadata.ObjFormatType.Value"></a>
<a id="FormatType:FormatType"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">type</span>
</span>
<span class="symbol">
<span class="name">FormatType</span><span class="result"> = <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
</li><li name="scala.Enumeration.Val" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="<API key>.this.<API key>"></a>
<a id="Val:Val"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">class</span>
</span>
<span class="symbol">
<span class="name">Val</span><span class="result"> extends <span class="extype" name="scala.Enumeration.Value">Value</span> with <span class="extype" name="scala.Serializable">Serializable</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd><dt>Annotations</dt><dd>
<span class="name">@SerialVersionUID</span><span class="args">(<span>
<span class="symbol">-<API key></span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.Enumeration.Value" visbl="pub" data-isabs="true" fullComment="yes" group="Ungrouped">
<a id="ValueextendsOrdered[Enumeration.this.Value]withSerializable"></a>
<a id="Value:Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">abstract </span>
<span class="kind">class</span>
</span>
<span class="symbol">
<span class="name">Value</span><span class="result"> extends <span class="extype" name="scala.Ordered">Ordered</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>] with <span class="extype" name="scala.Serializable">Serializable</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd><dt>Annotations</dt><dd>
<span class="name">@SerialVersionUID</span><span class="args">(<span>
<span class="symbol"><API key></span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.Enumeration.ValueSet" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="<API key>[Enumeration.this.Value]withSortedSet[Enumeration.this.Value]withSortedSetLike[Enumeration.this.Value,Enumeration.this.ValueSet]withSerializable"></a>
<a id="ValueSet:ValueSet"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">class</span>
</span>
<span class="symbol">
<span class="name">ValueSet</span><span class="result"> extends <span class="extype" name="scala.collection.AbstractSet">AbstractSet</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>] with <span class="extype" name="scala.collection.immutable.SortedSet">SortedSet</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>] with <span class="extype" name="scala.collection.SortedSetLike">SortedSetLike</span>[<span class="extype" name="scala.Enumeration.Value">Value</span>, <span class="extype" name="scala.Enumeration.ValueSet">ValueSet</span>] with <span class="extype" name="scala.Serializable">Serializable</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li></ol>
</div>
<div id="values" class="values members">
<h3>Value Members</h3>
<ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:AnyRef):Boolean"></a>
<a id="!=(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Any#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="!=(x$1:Any):Boolean"></a>
<a id="!=(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="##():Int"></a>
<a id="##():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:AnyRef):Boolean"></a>
<a id="==(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Any#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="==(x$1:Any):Boolean"></a>
<a id="==(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="Value(i:Int,name:String):Enumeration.this.Value"></a>
<a id="Value(Int,String):Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">Value</span><span class="params">(<span name="i">i: <span class="extype" name="scala.Int">Int</span></span>, <span name="name">name: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="Value(name:String):Enumeration.this.Value"></a>
<a id="Value(String):Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">Value</span><span class="params">(<span name="name">name: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="Value(i:Int):Enumeration.this.Value"></a>
<a id="Value(Int):Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">Value</span><span class="params">(<span name="i">i: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.Enumeration#Value" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="Value:Enumeration.this.Value"></a>
<a id="Value:Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">Value</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.Enumeration#apply" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="apply(x:Int):Enumeration.this.Value"></a>
<a id="apply(Int):Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">apply</span><span class="params">(<span name="x">x: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="asInstanceOf[T0]:T0"></a>
<a id="asInstanceOf[T0]:T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="com.ligadata.olep.metadata.ObjFormatType#asString" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="asString(typ:com.ligadata.olep.metadata.ObjFormatType.FormatType):String"></a>
<a id="asString(FormatType):String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">asString</span><span class="params">(<span name="typ">typ: <a href="#FormatType=com.ligadata.olep.metadata.ObjFormatType.Value" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.FormatType">FormatType</a></span>)</span><span class="result">: <span class="extype" name="scala.Predef.String">String</span></span>
</span>
</h4>
</li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="clone():Object"></a>
<a id="clone():AnyRef"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="eq(x$1:AnyRef):Boolean"></a>
<a id="eq(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="equals(x$1:Any):Boolean"></a>
<a id="equals(Any):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="com.ligadata.olep.metadata.ObjFormatType#fCSV" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="fCSV:com.ligadata.olep.metadata.ObjFormatType.Value"></a>
<a id="fCSV:Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">fCSV</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
</li><li name="com.ligadata.olep.metadata.ObjFormatType#fJSON" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="fJSON:com.ligadata.olep.metadata.ObjFormatType.Value"></a>
<a id="fJSON:Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">fJSON</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
</li><li name="com.ligadata.olep.metadata.ObjFormatType#fSERIALIZED" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="fSERIALIZED:com.ligadata.olep.metadata.ObjFormatType.Value"></a>
<a id="fSERIALIZED:Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">fSERIALIZED</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
</li><li name="com.ligadata.olep.metadata.ObjFormatType#fXML" visbl="pub" data-isabs="false" fullComment="no" group="Ungrouped">
<a id="fXML:com.ligadata.olep.metadata.ObjFormatType.Value"></a>
<a id="fXML:Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">val</span>
</span>
<span class="symbol">
<span class="name">fXML</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
</li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="finalize():Unit"></a>
<a id="finalize():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<a href="../../../../java$lang.html" class="extype" name="java.lang">java.lang</a>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="symbol">classOf[java.lang.Throwable]</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="getClass():Class[_]"></a>
<a id="getClass():Class[_]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.AnyRef#hashCode" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="hashCode():Int"></a>
<a id="hashCode():Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">hashCode</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div>
</li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="isInstanceOf[T0]:Boolean"></a>
<a id="isInstanceOf[T0]:Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div>
</li><li name="scala.Enumeration#maxId" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="maxId:Int"></a>
<a id="maxId:Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">maxId</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="ne(x$1:AnyRef):Boolean"></a>
<a id="ne(AnyRef):Boolean"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Enumeration#nextId" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="nextId:Int"></a>
<a id="nextId:Int"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">var</span>
</span>
<span class="symbol">
<span class="name">nextId</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.Enumeration#nextName" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="nextName:Iterator[String]"></a>
<a id="nextName:Iterator[String]"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">var</span>
</span>
<span class="symbol">
<span class="name">nextName</span><span class="result">: <span class="extype" name="scala.Iterator">Iterator</span>[<span class="extype" name="scala.Predef.String">String</span>]</span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notify():Unit"></a>
<a id="notify():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="notifyAll():Unit"></a>
<a id="notifyAll():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Enumeration#readResolve" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="readResolve():AnyRef"></a>
<a id="readResolve():AnyRef"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">readResolve</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected </dd><dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="synchronized[T0](x$1:=>T0):T0"></a>
<a id="synchronized[T0](⇒T0):T0"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div>
</li><li name="scala.Enumeration#toString" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="toString():String"></a>
<a id="toString():String"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">toString</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.String">String</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration → AnyRef → Any</dd></dl></div>
</li><li name="scala.Enumeration#values" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="values:Enumeration.this.ValueSet"></a>
<a id="values:ValueSet"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier"></span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">values</span><span class="result">: <a href="#<API key>[Enumeration.this.Value]withSortedSet[Enumeration.this.Value]withSortedSetLike[Enumeration.this.Value,Enumeration.this.ValueSet]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.ValueSet">ValueSet</a></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait():Unit"></a>
<a id="wait():Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long,x$2:Int):Unit"></a>
<a id="wait(Long,Int):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="wait(x$1:Long):Unit"></a>
<a id="wait(Long):Unit"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd>
<span class="name">@throws</span><span class="args">(<span>
<span class="defval" name="classOf[java.lang.<API key>]">...</span>
</span>)</span>
</dd></dl></div>
</li><li name="scala.Enumeration#withName" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped">
<a id="withName(s:String):Enumeration.this.Value"></a>
<a id="withName(String):Value"></a>
<h4 class="signature">
<span class="modifier_kind">
<span class="modifier">final </span>
<span class="kind">def</span>
</span>
<span class="symbol">
<span class="name">withName</span><span class="params">(<span name="s">s: <span class="extype" name="scala.Predef.String">String</span></span>)</span><span class="result">: <a href="#ValueextendsOrdered[Enumeration.this.Value]withSerializable" class="extmbr" name="com.ligadata.olep.metadata.ObjFormatType.Value">Value</a></span>
</span>
</h4>
<div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Enumeration</dd></dl></div>
</li></ol>
</div>
</div>
<div id="inheritedMembers">
<div class="parent" name="scala.Enumeration">
<h3>Inherited from <span class="extype" name="scala.Enumeration">Enumeration</span></h3>
</div><div class="parent" name="scala.Serializable">
<h3>Inherited from <span class="extype" name="scala.Serializable">Serializable</span></h3>
</div><div class="parent" name="java.io.Serializable">
<h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3>
</div><div class="parent" name="scala.AnyRef">
<h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3>
</div><div class="parent" name="scala.Any">
<h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3>
</div>
</div>
<div id="groupedMembers">
<div class="group" name="Ungrouped">
<h3>Ungrouped</h3>
</div>
</div>
</div>
<div id="tooltip"></div>
<div id="footer"> </div>
<script defer="defer" type="text/javascript" id="jquery-js" src="../../../../lib/jquery.js"></script><script defer="defer" type="text/javascript" id="jquery-ui-js" src="../../../../lib/jquery-ui.js"></script><script defer="defer" type="text/javascript" id="tools-tooltip-js" src="../../../../lib/tools.tooltip.js"></script><script defer="defer" type="text/javascript" id="template-js" src="../../../../lib/template.js"></script>
</body>
</html>
|
package org.ns.vk.cachegrabber.ui;
import java.awt.event.ActionEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractAction;
import org.ns.func.Callback;
import org.ns.ioc.IoC;
import org.ns.vk.cachegrabber.api.Application;
import org.ns.vk.cachegrabber.api.vk.Audio;
import org.ns.vk.cachegrabber.api.vk.VKApi;
/**
*
* @author stupak
*/
public class TestAction extends AbstractAction {
public TestAction() {
super("Test action");
}
@Override
public void actionPerformed(ActionEvent e) {
VKApi vkApi = IoC.get(Application.class).getVKApi();
String ownerId = "32659923";
String audioId = "259636837";
vkApi.getById(ownerId, audioId, new Callback<Audio>() {
@Override
public void call(Audio audio) {
Logger.getLogger(TestAction.class.getName()).log(Level.INFO, "loaded audio: {0}", audio);
}
});
}
}
|
layout: event
title: "OSM Bangladesh: Bringing scattered OSM activities under single platform"
theme: Community growth and diversity, outreach
theme_full: Community growth and diversity, outreach, Organisational, legal
category: Community growth and diversity, outreach
audience: "(1a) Data contributors: Community"
audience_full: "(1a) Data contributors: Community, (2c) Data users: Personal, (3b) Core OSM: OSMF working groups (community, licence, data...), (3c) Core OSM: OSMF board (strategy and vision)"
name: Ahasanul Hoque
organization: OpenStreetMap Bangladesh Community
twitter:
osm: aHaSaN
room: Room 1
tags:
- slot14
youtube_recording: nMxSDjKiZ-M
youtube_time: [4,0]
slides: https://speakerdeck.com/sotm2017/<API key>
My session will be based on three discussion topics. Firstly, the uneven journey of OpenStreetMap in Bangladesh and tackling the obstacles. Secondly, the ongoing OSM activities in Bangladesh by different government and non government agencies, chapters and small communities. And lastly, how to integrate the scattered OSM group and activities under a single platform.
|
package com.mapswithme.maps.maplayer.traffic;
import androidx.annotation.MainThread;
import androidx.annotation.NonNull;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
@MainThread
public enum TrafficManager
{
INSTANCE;
private final static String TAG = TrafficManager.class.getSimpleName();
@NonNull
private final Logger mLogger = LoggerFactory.INSTANCE.getLogger(LoggerFactory.Type.TRAFFIC);
@NonNull
private final TrafficState.StateChangeListener <API key> = new <API key>();
@NonNull
private TrafficState mState = TrafficState.DISABLED;
@NonNull
private final List<TrafficCallback> mCallbacks = new ArrayList<>();
private boolean mInitialized = false;
public void initialize()
{
mLogger.d(TAG, "Initialization of traffic manager and setting the listener for traffic state changes");
TrafficState.nativeSetListener(<API key>);
mInitialized = true;
}
public void toggle()
{
checkInitialization();
if (isEnabled())
disable();
else
enable();
}
private void enable()
{
mLogger.d(TAG, "Enable traffic");
TrafficState.nativeEnable();
}
private void disable()
{
checkInitialization();
mLogger.d(TAG, "Disable traffic");
TrafficState.nativeDisable();
}
public boolean isEnabled()
{
checkInitialization();
return TrafficState.nativeIsEnabled();
}
public void attach(@NonNull TrafficCallback callback)
{
checkInitialization();
if (mCallbacks.contains(callback))
{
throw new <API key>("A callback '" + callback
+ "' is already attached. Check that the 'detachAll' method was called.");
}
mLogger.d(TAG, "Attach callback '" + callback + "'");
mCallbacks.add(callback);
postPendingState();
}
private void postPendingState()
{
<API key>.<API key>(mState.ordinal());
}
public void detachAll()
{
checkInitialization();
if (mCallbacks.isEmpty())
{
mLogger.w(TAG, "There are no attached callbacks. Invoke the 'detachAll' method " +
"only when it's really needed!", new Throwable());
return;
}
for (TrafficCallback callback : mCallbacks)
mLogger.d(TAG, "Detach callback '" + callback + "'");
mCallbacks.clear();
}
private void checkInitialization()
{
if (!mInitialized)
throw new AssertionError("Traffic manager is not initialized!");
}
public void setEnabled(boolean enabled)
{
checkInitialization();
if (isEnabled() == enabled)
return;
if (enabled)
enable();
else
disable();
}
private class <API key> implements TrafficState.StateChangeListener
{
@Override
@MainThread
public void <API key>(int index)
{
TrafficState newTrafficState = TrafficState.values()[index];
mLogger.d(TAG, "<API key> current state = " + mState
+ " new value = " + newTrafficState);
if (mState == newTrafficState)
return;
mState = newTrafficState;
mState.activate(mCallbacks);
}
}
public interface TrafficCallback
{
void onEnabled();
void onDisabled();
void onWaitingData();
void onOutdated();
void onNetworkError();
void onNoData();
void onExpiredData();
void onExpiredApp();
}
}
|
package brennus.asm;
import static brennus.model.ExistingType.VOID;
import static brennus.model.ExistingType.existing;
import static brennus.model.Protection.PUBLIC;
import static junit.framework.Assert.assertEquals;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
import java.util.logging.Logger;
import brennus.Builder;
import brennus.MethodBuilder;
import brennus.SwitchBuilder;
import brennus.ThenBuilder;
import brennus.asm.TestGeneration.DynamicClassLoader;
import brennus.model.FutureType;
import brennus.printer.TypePrinter;
import org.junit.Test;
public class TestGoto {
abstract public static class FSA {
private List<String> states = new ArrayList<String>();
abstract public void exec();
public void state(String p) {
states.add(p);
}
public List<String> getStates() {
return states;
}
}
abstract public static class FSA2 {
private List<String> states = new ArrayList<String>();
abstract public void exec(Iterator<Integer> it);
public void state(String p) {
states.add(p);
}
public List<String> getStates() {
return states;
}
}
@Test
public void testGoto() throws Exception {
FutureType testClass = new Builder()
.startClass("brennus.asm.TestGoto$TestClass", existing(FSA.class))
.startMethod(PUBLIC, VOID, "exec")
.label("a")
.exec().callOnThis("state").literal("a").endCall().endExec()
.gotoLabel("c")
.label("b")
.exec().callOnThis("state").literal("b").endCall().endExec()
.gotoLabel("end")
.label("c")
.exec().callOnThis("state").literal("c").endCall().endExec()
.gotoLabel("b")
.label("end")
.endMethod()
.endClass();
// new TypePrinter().print(testClass);
DynamicClassLoader cl = new DynamicClassLoader();
cl.define(testClass);
Class<?> generated = (Class<?>)cl.loadClass("brennus.asm.TestGoto$TestClass");
FSA fsa = (FSA)generated.newInstance();
fsa.exec();
assertEquals(Arrays.asList("a", "c", "b"), fsa.getStates());
}
@Test
public void testFSA() throws Exception {
int[][] fsa = {
{0,1,2,3},
{0,1,2,3},
{0,1,2,3},
{0,1,2,3}
};
MethodBuilder m = new Builder()
.startClass("brennus.asm.TestGoto$TestClass2", existing(FSA2.class))
.startMethod(PUBLIC, VOID, "exec").param(existing(Iterator.class), "it")
.gotoLabel("start")
.label("start");
for (int i = 0; i < fsa.length; i++) {
m = m.label("s_"+i)
.exec().callOnThis("state").literal("s_"+i).endCall().endExec();
SwitchBuilder<ThenBuilder<MethodBuilder>> s = m.ifExp().get("it").callNoParam("hasNext").thenBlock()
.switchOn().get("it").callNoParam("next").switchBlock();
for (int j = 0; j < fsa[i].length; j++) {
int to = fsa[i][j];
s = s.caseBlock(j)
.gotoLabel("s_"+to)
.endCase();
}
m = s.endSwitch()
.elseBlock()
.gotoLabel("end")
.endIf();
}
FutureType testClass = m.label("end").endMethod().endClass();
new TypePrinter().print(testClass);
Logger.getLogger("brennus").setLevel(Level.FINEST);
Logger.getLogger("brennus").addHandler(new Handler() {
public void publish(LogRecord record) {
System.out.println(record.getMessage());
}
public void flush() {
System.out.flush();
}
public void close() throws SecurityException {
System.out.flush();
}
});
DynamicClassLoader cl = new DynamicClassLoader();
cl.define(testClass);
Class<?> generated = (Class<?>)cl.loadClass("brennus.asm.TestGoto$TestClass2");
FSA2 compiledFSA = (FSA2)generated.newInstance();
compiledFSA.exec(Arrays.asList(3,2,1).iterator());
assertEquals(Arrays.asList("s_0", "s_3", "s_2", "s_1"), compiledFSA.getStates());
}
}
|
namespace <API key>.Google.Json
{
public class Geometry
{
public Location location { get; set; }
public string location_type { get; set; }
public Viewport viewport { get; set; }
public Bounds bounds { get; set; }
}
}
|
package th.ac.kmitl.ce.ooad.cest.repository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import th.ac.kmitl.ce.ooad.cest.domain.Course;
import th.ac.kmitl.ce.ooad.cest.domain.Faculty;
import java.util.List;
public interface CourseRepository extends CrudRepository<Course, Long>{
Course findFirstByCourseId(String courseId);
Course <API key>(String courseName);
List<Course> <API key>(String courseName, String courseId);
List<Course> <API key>(Faculty faculty);
List<Course> <API key>(String department);
@Query("select c from Course c where c.department = ?2 or c.department = '' and c.faculty = ?1 order by c.courseName")
List<Course> <API key>(Faculty faculty, String department);
}
|
#include "TestInc.h"
#include "LuceneTestFixture.h"
#include "<API key>.h"
#include "DateTools.h"
namespace Lucene
{
LuceneTestFixture::LuceneTestFixture()
{
DateTools::setDateOrder(DateTools::DATEORDER_LOCALE);
<API key>::setTestMode();
}
LuceneTestFixture::~LuceneTestFixture()
{
DateTools::setDateOrder(DateTools::DATEORDER_LOCALE);
if (<API key>::<API key>())
{
// Clear the failure so that we don't just keep failing subsequent test cases
<API key>::<API key>();
BOOST_FAIL("<API key> hit unhandled exceptions");
}
}
}
|
macimport os
import subprocess
name = "gobuildmaster"
current_hash = ""
for line in os.popen("md5sum " + name).readlines():
current_hash = line.split(' ')[0]
# Move the old version over
for line in os.popen('cp ' + name + ' old' + name).readlines():
print line.strip()
# Rebuild
for line in os.popen('go build').readlines():
print line.strip()
size_1 = os.path.getsize('./old' + name)
size_2 = os.path.getsize('./' + name)
lines = os.popen('ps -ef | grep ' + name).readlines()
running = False
for line in lines:
if "./" + name in line:
running = True
new_hash = ""
for line in os.popen("md5sum " + name).readlines():
new_hash = line.split(' ')[0]
if size_1 != size_2 or new_hash != current_hash or not running:
if not running:
for line in os.popen('cat out.txt | mail -E -s "Crash Report ' + name + '" brotherlogic@gmail.com').readlines():
pass
for line in os.popen('echo "" > out.txt').readlines():
pass
for line in os.popen('killall ' + name).readlines():
pass
subprocess.Popen(['./' + name])
|
import unittest2
import helper
import simplejson as json
from nose.plugins.attrib import attr
PORTAL_ID = 62515
class ListsClientTest(unittest2.TestCase):
def setUp(self):
self.client = ListsClient(**helper.get_options())
def tearDown(self):
pass
@attr('api')
def test_get_list(self):
# create a list to get
dummy_data = json.dumps(dict(
name='try_and_get_me',
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure it was created
self.asserTrue(len(created_list['lists']))
# the id number of the list the test is trying to get
id_to_get = created_list['listID']
# try and get it
recieved_lists = self.client.get_list(id_to_get)
# see if the test got the right list
self.assertEqual(recieved_lists['lists'][0]['listId'], created_list['listId'])
print "Got this list: %s" % json.dumps(recieved_list['lists'][0])
# clean up
self.client.delete_list(id_to_get)
@attr('api')
def <API key>(self):
# holds the ids of the lists being retrieved
list_ids = []
# make a list to get
dummy_data = json.dumps(dict(
name='first_test_list',
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure it was actually made
self.assertTrue(created_list['listID'])
# put the id of the newly made list in list_ids
list_ids[0] = created_list['listId']
#change the data a little and make another list
dummy_data['name'] = 'second_test_list'
created_list = self.client.create_list(dummy_data)
# make sure itwas actually made
self.assertTrue(created_list['listID'])
# put the id number in list_ids
list_ids[1] = created_list['listId']
# try and get them
batch_lists = self.client.get_batch_lists(list_ids)
# make sure you got as many lists as you were searching for
self.assertEqual(len(list_ids), len(batch_lists['lists']))
# clean up
self.client.delete_list(list_ids[0])
self.client.delete_list(list_ids[1])
@attr('api')
def test_get_lists(self):
# try and get lists
recieved_lists = self.client.get_lists()
# see if the test got at least one
if len(recieved_lists['lists']) == 0:
self.fail("Unable to retrieve any lists")
else:
print "Got these lists %s" % json.dumps(recieved_lists)
@attr('api')
def <API key>(self):
# create a static list to get
dummy_data = json.dumps(dict(
name='static_test_list',
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure it was actually made
self.assertTrue(created_list['listID'])
# this call will return 20 lists if not given another value
static_lists = self.client.get_static_lists()
if len(static_lists['lists']) == 0:
self.fail("Unable to retrieve any static lists")
else:
print "Found these static lists: %s" % json.dumps(static_lists)
# clean up
self.client.delete_list(created_list['listId'])
@attr('api')
def <API key>(self):
# make a dynamic list to get
dummy_data = json.dumps(dict(
name='test_dynamic_list',
dynamic=True,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure the dynamic list was made
self.assertTrue(created_list['listId'])
dynamic_lists = self.client.get_dynamic_lists()
if len(dynamic_lists['lists']) == 0:
self.fail("Unable to retrieve any dynamic lists")
else:
print "Found these dynamic lists: %s" % json.dumps(dynamic_lists)
# clean up
self.client.delete_list(created_list['listId'])
@attr('api')
def <API key>(self):
# the id number of the list you want the contacts of
# which_list =
# try and get the contacts
contacts = self.client.get_list_contacts(which_list)
# make sure you get at least one
self.assertTrue(len(contacts['contacts'])
print "Got these contacts: %s from this list: %s" % json.dumps(contacts), which_list)
@attr('api')
def <API key>(self):
# the id number of the list you want the recent contacts of
which_list =
recent_contacts = self.client.<API key>(which_list)
if len(recent_contacts['lists']) == 0:
self.fail("Did not find any recent contacts")
else:
print "Found these recent contacts: %s" % json.dumps(recent_conacts)
@attr('api')
def test_create_list(self):
# the data for the list the test is making
dummy_data = json.dumps(dict(
list_name='test_list',
dynamic=False,
portalId=PORTAL_ID
))
# try and make the list
created_list = self.client.create_list(dummy_data)
# make sure it was created
if len(created_lists['lists']) == 0:
self.fail("Did not create the list")
else:
print "Created this list: %s" % json.dumps(created_lists)
# clean up
self.client.delete_list(created_lists['lists'][0]['listId'])
@attr('api')
def test_update_list(self):
# make a list to update
dummy_data = json.dumps(dict(
name='delete_me',
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure it was actually made
self.assertTrue(len(created_list['listId']))
# get the id number of the list
update_list_id = created_list['listId']
# this is the data updating the list
update_data = json.dumps(dict(
list_name='really_delete_me',
))
# try and do the update
http_response = self.client.update_list(update_list_id, update_data)
if http_response >= 400:
self.fail("Unable to update list!")
else:
print("Updated a list!")
# clean up
self.client.delete_list(update_list_id)
@attr('api')
def <API key>(self):
# make a list to add contacts to
dummy_data = json.dumps(dict(
name='<API key>',
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure it was actually made
self.assertTrue(len(created_list['lists']))
# the id number of the list being added to
which_list = created_list['listId']
# the emails of the contacts being added
emails = json.dumps(dict(
emails
))
# try and add the contacts
self.client.<API key>(which_list, emails)
@attr('api')
def <API key>(self):
# make a list to add a contact to
dummy_data = json.dumps(dict(
name='add_a_contact',
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure it was actually made
self.assertTrue(created_list['listId'])
# the id number of the list the contact is being added to
which_list = created_list['listId']
# the id number of the contact being added to the list
which_contact =
added = self.client.add_contact_to_list(which_list, which_contact)
if added['updated'] == which_contact:
print "Succesfully added contact: %s to list: %s" % which_contact, which_list
# if it worked, clean up
self.client.delete_list(which_list)
else:
self.fail("Did not add contact: %s to list: %a" % which_contact, which_list)
@attr('api')
def <API key>(self):
# make a list to remove a contact from
fake_data = json.dumps(dict(
name='remove_this_contact'
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(fake_data)
# make sure it was actually made
self.assertTrue(created_list['listId'])
# the id number of the list the contact is being deleted from
which_list = created_list['listId']
# the id number of the contact being deleted
which_contact =
# put the contact in the list so it can be removed
added = self.client.add_contact_to_list(which_list, which_contact)
# make sure it was added
self.assertTrue(added['updated'])
# try and remove it
removed = self.client.<API key>(which_list, which_contact)
# check if it was actually removed
if removed['updated'] == which_contact:
print "Succesfully removed contact: %s from list: %s" % which_contact, which_list
# clean up
self.client.delete_list(created_list['listId'])
else:
self.fail("Did not remove contact %s from list: %s" % which_contact, which_list)
@attr('api')
def test_delete_list(self):
# make a list to delete
dummy_data = json.dumps(dict(
name='should_be_deleted',
dynamic=False,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# check if it was actually made
self.assertTrue(created_list['listId'])
# the id number of the list being deleted
id_to_delete = created_list['listId']
# try deleting it
self.client.delete_list(id_to_delete)
# try and get the list that should have been deleted
check = self.client.get_list(id_to_delete)
# check should not have any lists
self.assertEqual(len(check['lists']), 0)
print "Sucessfully deleted a test list"
@attr('api')
def test_refresh_list(self):
# make a dynamic list to refresh
dummy_data = json.dumps(dict(
name='refresh_this_list',
dynamic=True,
portalId=PORTAL_ID
))
created_list = self.client.create_list(dummy_data)
# make sure it actually made the list
self.assertTrue(created_list['listId'])
# do the refresh
refresh_response = self.client.refresh_list(created_list['listId'])
# check if it worked
if refresh_response >= 400:
self.fail("Failed to refresh list: %s" % json.dumps(created_list))
else:
print "Succesfully refreshed list: %s" % json.dumps(created_list)
# clean up
self.client.delete_list(created_list['listId'])
if __name__ == "__main__":
unittest2.main()
|
using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Maticsoft.DBUtility;
namespace TSM.DAL
{
<summary>
Êý¾Ý·ÃÎÊÀàCK_People¡£
</summary>
public class CK_People
{
public CK_People()
{}
<summary>
µÃµ½×î´óID
</summary>
public int GetMaxId()
{
return DbHelperSQL.GetMaxID("CK_PeopleID", "CK_People");
}
<summary>
ÊÇ·ñ´æÔڸüǼ
</summary>
public bool Exists(int CK_PeopleID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select count(1) from CK_People");
strSql.Append(" where CK_PeopleID=@CK_PeopleID ");
SqlParameter[] parameters = {
new SqlParameter("@CK_PeopleID", SqlDbType.Int,4)};
parameters[0].Value = CK_PeopleID;
return DbHelperSQL.Exists(strSql.ToString(),parameters);
}
<summary>
Ôö¼ÓÒ»ÌõÊý¾Ý
</summary>
public int Add(TSM.Model.CK_People model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into CK_People(");
strSql.Append("CK_PeopleName,CK_PhoneNo,CK_Comment)");
strSql.Append(" values (");
strSql.Append("@CK_PeopleName,@CK_PhoneNo,@CK_Comment)");
strSql.Append(";select @@IDENTITY");
SqlParameter[] parameters = {
new SqlParameter("@CK_PeopleName", SqlDbType.VarChar,32),
new SqlParameter("@CK_PhoneNo", SqlDbType.VarChar,32),
new SqlParameter("@CK_Comment", SqlDbType.VarChar,100)};
parameters[0].Value = model.CK_PeopleName;
parameters[1].Value = model.CK_PhoneNo;
parameters[2].Value = model.CK_Comment;
object obj = DbHelperSQL.GetSingle(strSql.ToString(),parameters);
if (obj == null)
{
return 1;
}
else
{
return Convert.ToInt32(obj);
}
}
<summary>
¸üÐÂÒ»ÌõÊý¾Ý
</summary>
public void Update(TSM.Model.CK_People model)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("update CK_People set ");
strSql.Append("CK_PeopleName=@CK_PeopleName,");
strSql.Append("CK_PhoneNo=@CK_PhoneNo,");
strSql.Append("CK_Comment=@CK_Comment");
strSql.Append(" where CK_PeopleID=@CK_PeopleID ");
SqlParameter[] parameters = {
new SqlParameter("@CK_PeopleID", SqlDbType.Int,4),
new SqlParameter("@CK_PeopleName", SqlDbType.VarChar,32),
new SqlParameter("@CK_PhoneNo", SqlDbType.VarChar,32),
new SqlParameter("@CK_Comment", SqlDbType.VarChar,100)};
parameters[0].Value = model.CK_PeopleID;
parameters[1].Value = model.CK_PeopleName;
parameters[2].Value = model.CK_PhoneNo;
parameters[3].Value = model.CK_Comment;
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
<summary>
ɾ³ýÒ»ÌõÊý¾Ý
</summary>
public void Delete(int CK_PeopleID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("delete from CK_People ");
strSql.Append(" where CK_PeopleID=@CK_PeopleID ");
SqlParameter[] parameters = {
new SqlParameter("@CK_PeopleID", SqlDbType.Int,4)};
parameters[0].Value = CK_PeopleID;
DbHelperSQL.ExecuteSql(strSql.ToString(),parameters);
}
<summary>
µÃµ½Ò»¸ö¶ÔÏóʵÌå
</summary>
public TSM.Model.CK_People GetModel(int CK_PeopleID)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select top 1 CK_PeopleID,CK_PeopleName,CK_PhoneNo,CK_Comment from CK_People ");
strSql.Append(" where CK_PeopleID=@CK_PeopleID ");
SqlParameter[] parameters = {
new SqlParameter("@CK_PeopleID", SqlDbType.Int,4)};
parameters[0].Value = CK_PeopleID;
TSM.Model.CK_People model=new TSM.Model.CK_People();
DataSet ds=DbHelperSQL.Query(strSql.ToString(),parameters);
if(ds.Tables[0].Rows.Count>0)
{
if(ds.Tables[0].Rows[0]["CK_PeopleID"].ToString()!="")
{
model.CK_PeopleID=int.Parse(ds.Tables[0].Rows[0]["CK_PeopleID"].ToString());
}
model.CK_PeopleName=ds.Tables[0].Rows[0]["CK_PeopleName"].ToString();
model.CK_PhoneNo=ds.Tables[0].Rows[0]["CK_PhoneNo"].ToString();
model.CK_Comment=ds.Tables[0].Rows[0]["CK_Comment"].ToString();
return model;
}
else
{
return null;
}
}
<summary>
»ñµÃÊý¾ÝÁбí
</summary>
public DataSet GetList(string strWhere)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select CK_PeopleID,CK_PeopleName,CK_PhoneNo,CK_Comment ");
strSql.Append(" FROM CK_People ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
return DbHelperSQL.Query(strSql.ToString());
}
<summary>
»ñµÃǰ¼¸ÐÐÊý¾Ý
</summary>
public DataSet GetList(int Top,string strWhere,string filedOrder)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("select ");
if(Top>0)
{
strSql.Append(" top "+Top.ToString());
}
strSql.Append(" CK_PeopleID,CK_PeopleName,CK_PhoneNo,CK_Comment ");
strSql.Append(" FROM CK_People ");
if(strWhere.Trim()!="")
{
strSql.Append(" where "+strWhere);
}
strSql.Append(" order by " + filedOrder);
return DbHelperSQL.Query(strSql.ToString());
}
<summary>
·ÖÒ³»ñÈ¡Êý¾ÝÁбí
</summary>
public DataSet GetList(int PageSize,int PageIndex,string strWhere)
{
SqlParameter[] parameters = {
new SqlParameter("@tblName", SqlDbType.VarChar, 255),
new SqlParameter("@fldName", SqlDbType.VarChar, 255),
new SqlParameter("@PageSize", SqlDbType.Int),
new SqlParameter("@PageIndex", SqlDbType.Int),
new SqlParameter("@IsReCount", SqlDbType.Bit),
new SqlParameter("@OrderType", SqlDbType.Bit),
new SqlParameter("@strWhere", SqlDbType.VarChar,1000),
};
parameters[0].Value = "CK_People";
parameters[1].Value = "CK_PeopleID";
parameters[2].Value = PageSize;
parameters[3].Value = PageIndex;
parameters[4].Value = 0;
parameters[5].Value = 0;
parameters[6].Value = strWhere;
return DbHelperSQL.RunProcedure("UP_GetRecordByPage",parameters,"ds");
}
}
}
|
package jp.ac.keio.bio.fun.xitosbml.image;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import ij.ImagePlus;
import ij.ImageStack;
import ij.process.ByteProcessor;
/**
* The class Filler, which provides several morphological operations for filling holes in the image.
* Date Created: Feb 21, 2017
*
* @author Kaito Ii <ii@fun.bio.keio.ac.jp>
* @author Akira Funahashi <funa@bio.keio.ac.jp>
*/
public class Filler {
/** The ImageJ image object. */
private ImagePlus image;
/** The width of an image. */
private int width;
/** The height of an image. */
private int height;
/** The depth of an image. */
private int depth;
/** The width of an image including padding. */
private int lwidth;
/** The height of an image including padding. */
private int lheight;
/** The depth of an image including padding. */
private int ldepth;
/** The mask which stores the label of each pixel. */
private int[] mask;
/**
* The hashmap of pixel value. <labelnumber, pixel value>.
* The domain which has pixel value = 0 will have a label = 1.
*/
private HashMap<Integer, Byte> hashPix = new HashMap<Integer, Byte>(); // label number, pixel value
/** The raw data (1D byte array) of the image. */
private byte[] pixels;
/** The raw data (1D int array) of inverted the image. */
private int[] invert;
/**
* Fill a hole in the given image (ImagePlus object) by morphology operation,
* and returns the filled image.
*
* @param image the ImageJ image object
* @return the filled ImageJ image (ImagePlus) object
*/
public ImagePlus fill(ImagePlus image){
this.width = image.getWidth();
this.height = image.getHeight();
this.depth = image.getStackSize();
this.image = image;
pixels = ImgProcessUtil.copyMat(image);
invertMat();
label();
if (checkHole()) {
while (checkHole()) {
fillHole();
hashPix.clear();
label();
}
ImageStack stack = createStack();
image.setStack(stack);
image.updateImage();
}
return image;
}
/**
* Fill a hole in the given image ({@link SpatialImage} object) by morphology operation,
* and returns the filled image as ImageJ image object.
*
* @param spImg the SpatialImage object
* @return the filled ImageJ image (ImagePlus) object
*/
public ImagePlus fill(SpatialImage spImg){
this.width = spImg.getWidth();
this.height = spImg.getHeight();
this.depth = spImg.getDepth();
this.image = spImg.getImage();
this.pixels = spImg.getRaw();
invertMat();
label();
if(checkHole()){
while(checkHole()){
fillHole();
hashPix.clear();
label();
}
ImageStack stack = createStack();
image.setStack(stack);
image.updateImage();
}
return image;
}
/**
* Creates the stack of images from raw data (1D array) of image (pixels[]),
* and returns the stack of images.
*
* @return the stack of images
*/
private ImageStack createStack(){
ImageStack altimage = new ImageStack(width, height);
for(int d = 0 ; d < depth ; d++){
byte[] matrix = new byte[width * height];
System.arraycopy(pixels, d * height * width, matrix, 0, matrix.length);
altimage.addSlice(new ByteProcessor(width,height,matrix,null));
}
return altimage;
}
/**
* Create an inverted 1D array of an image (invert[]) from 1D array of an image (pixels[]).
* Each pixel value will be inverted (0 -> 1, otherwise -> 0). For example, the Black and White
* binary image will be converted to a White and Black binary image.
*/
private void invertMat(){
lwidth = width + 2;
lheight = height + 2;
if(depth < 3) ldepth = depth;
else ldepth = depth + 2;
invert = new int[lwidth * lheight * ldepth];
mask = new int[lwidth * lheight * ldepth];
if (ldepth > depth) { // 3D image
for (int d = 0; d < ldepth; d++) {
for (int h = 0; h < lheight; h++) {
for (int w = 0; w < lwidth; w++) {
if (d == 0 || d == ldepth - 1 || h == 0 || h == lheight - 1 || w == 0 || w == lwidth - 1) {
invert[d * lheight * lwidth + h * lwidth + w] = 1;
mask[d * lheight * lwidth + h * lwidth + w] = 1;
continue;
}
if (pixels[(d - 1) * height * width + (h - 1) * width + w - 1] == 0)
invert[d * lheight * lwidth + h * lwidth + w] = 1;
else
invert[d * lheight * lwidth + h * lwidth + w] = 0;
}
}
}
} else { // 2D image
for (int d = 0; d < ldepth; d++) {
for (int h = 0; h < lheight; h++) {
for (int w = 0; w < lwidth; w++) {
if(h == 0 || h == lheight - 1 || w == 0 || w == lwidth - 1){
invert[d * lheight * lwidth + h * lwidth + w] = 1;
mask[d * lheight * lwidth + h * lwidth + w] = 1;
continue;
}
if (pixels[d * height * width + (h - 1) * width + w - 1] == 0)
invert[d * lheight * lwidth + h * lwidth + w] = 1;
else
invert[d * lheight * lwidth + h * lwidth + w] = 0;
}
}
}
}
}
/** The label count. */
private int labelCount;
/**
* Assign a label (label number) to each pixel.
* The label number will be stored in mask[] array.
* The domain which has pixel value = 0 will have a label = 1.
*/
public void label(){
hashPix.put(1, (byte)0);
labelCount = 2;
if (ldepth > depth) {
for (int d = 1; d < ldepth - 1; d++) {
for (int h = 1; h < lheight - 1; h++) {
for (int w = 1; w < lwidth - 1; w++) {
if (invert[d * lheight * lwidth + h * lwidth + w] == 1 && pixels[(d-1) * height * width + (h-1) * width + w - 1] == 0) {
mask[d * lheight * lwidth + h * lwidth + w] = setLabel(w, h, d, pixels[(d-1) * height * width + (h-1) * width + w - 1]);
}else{
mask[d * lheight * lwidth + h * lwidth + w] = setbackLabel(w, h, d, pixels[(d-1) * height * width + (h-1) * width + w - 1]);
}
}
}
}
}else{
for (int d = 0; d < ldepth; d++) {
for (int h = 1; h < lheight - 1; h++) {
for (int w = 1; w < lwidth - 1; w++) {
if (invert[d * lheight * lwidth + h * lwidth + w] == 1 && pixels[d * height * width + (h-1) * width + w - 1] == 0) {
mask[d * lheight * lwidth + h * lwidth + w] = setLabel(w, h, d, pixels[d * height * width + (h-1) * width + w - 1]);
}else{
mask[d * lheight * lwidth + h * lwidth + w] = setbackLabel(w, h, d, pixels[d * height * width + (h-1) * width + w - 1]);
}
}
}
}
}
}
/**
* Check whether a hole exists in the hashmap of pixels (HashMap<label number, pixel value>).
*
* @return true, if a hole exists
*/
public boolean checkHole(){
if(Collections.frequency(hashPix.values(), (byte) 0) > 1)
return true;
else
return false;
}
/**
* Fill a hole in the hashmap of pixels (HashMap<label number, pixel value> by morphology operation.
* The fill operation will be applied to each domain (which has unique label number).
*/
public void fillHole(){
for(Entry<Integer, Byte> e : hashPix.entrySet()){
if(!e.getKey().equals(1) && e.getValue().equals((byte)0)){
fill(e.getKey());
}
}
}
/**
* Fill a hole in the hashmap of pixels (HashMap<label number, pixel value> by morphology operation.
* The hole will be filled with the pixel value of adjacent pixel.
*
* @param labelNum the label number
*/
public void fill(int labelNum){
if (ldepth > depth) { // 3D image
for (int d = 1; d < ldepth; d++) {
for (int h = 1; h < lheight - 1; h++) {
for (int w = 1; w < lwidth - 1; w++) {
if (mask[d * lheight * lwidth + h * lwidth + w] == labelNum ) {
pixels[(d-1) * height * width + (h-1) * width + w - 1] = checkAdjacentsLabel(w, h, d, labelNum);
}
}
}
}
} else { // 2D image
for (int d = 0; d < ldepth; d++) {
for (int h = 1; h < lheight - 1; h++) {
for (int w = 1; w < lwidth - 1; w++) {
if (mask[d * lheight * lwidth + h * lwidth + w] == labelNum ) {
pixels[d * height * width + (h-1) * width + w - 1] = checkAdjacentsLabel(w, h, d, labelNum);
}
}
}
}
}
}
/**
* Check adjacent pixels whether it contains the given label (labelNum).
* If all the adjacent pixels have same label with given label, then return 0.
* If the adjacent pixels contain different labels, then returns the pixel
* value of most enclosing adjacent domain.
*
* @param w the x offset
* @param h the y offset
* @param d the z offset
* @param labelNum the label number
* @return the pixel value of most enclosing adjacent domain if different domain exists, otherwise 0
*/
public byte checkAdjacentsLabel(int w, int h, int d, int labelNum){
List<Byte> adjVal = new ArrayList<Byte>();
//check right
if(mask[d * lheight * lwidth + h * lwidth + w + 1] != labelNum)
adjVal.add(hashPix.get(mask[d * lheight * lwidth + h * lwidth + w + 1]));
//check left
if(mask[d * lheight * lwidth + h * lwidth + w - 1] != labelNum)
adjVal.add(hashPix.get(mask[d * lheight * lwidth + h * lwidth + w - 1]));
//check down
if(mask[d * lheight * lwidth + (h+1) * lwidth + w ] != labelNum)
adjVal.add(hashPix.get(mask[d * lheight * lwidth + (h+1) * lwidth + w]));
//check up
if(mask[d * lheight * lwidth + (h-1) * lwidth + w ] != labelNum)
adjVal.add(hashPix.get(mask[d * lheight * lwidth + (h-1) * lwidth + w]));
//check above
if(d != depth - 1 && mask[(d+1) * lheight * lwidth + h * lwidth + w] != labelNum)
adjVal.add(hashPix.get(mask[(d+1) * lheight * lwidth + h * lwidth + w]));
//check below
if(d != 0 && mask[(d-1) * lheight * lwidth + h * lwidth + w] != labelNum)
adjVal.add(hashPix.get(mask[(d - 1) * lheight * lwidth + h * lwidth + w]));
if(adjVal.isEmpty())
return 0;
int max = 0;
int count = 0;
int freq, temp; Byte val = 0;
for(int n = 0 ; n < adjVal.size() ; n++){
val = adjVal.get(n);
if(val == 0)
continue;
freq = Collections.frequency(adjVal, val);
temp = val & 0xFF;
if(freq > count){
max = temp;
count = freq;
}
if(freq == count && max < temp){
max = temp;
count = freq;
}
}
return (byte) max;
}
/**
* Sets the label of the given pixel (x offset, y offset, z offset) with its pixel value.
* Checks whether the adjacent pixel has the zero pixel value, and its label is already assigned.
*
* @param w the x offset
* @param h the y offset
* @param d the z offset
* @param pixVal the pixel value
* @return the label as integer value
*/
private int setLabel(int w , int h, int d, byte pixVal){
List<Integer> adjVal = new ArrayList<Integer>();
//check left
if(mask[d * lheight * lwidth + h * lwidth + w - 1] != 0 && hashPix.get(mask[d * lheight * lwidth + h * lwidth + w - 1]) == (byte)0)
adjVal.add(mask[d * lheight * lwidth + h * lwidth + w - 1]);
//check up
if(mask[d * lheight * lwidth + (h-1) * lwidth + w ] != 0 && hashPix.get(mask[d * lheight * lwidth + (h-1) * lwidth + w]) == (byte)0)
adjVal.add(mask[d * lheight * lwidth + (h-1) * lwidth + w]);
//check below
if(d != 0 && mask[(d-1) * lheight * lwidth + h * lwidth + w] != 0 && hashPix.get(mask[(d-1) * lheight * lwidth + h * lwidth + w]) == (byte)0)
adjVal.add(mask[(d-1) * lheight * lwidth + h * lwidth + w]);
if(adjVal.isEmpty()){
hashPix.put(labelCount, pixVal);
return labelCount++;
}
Collections.sort(adjVal);
//if all element are same or list has only one element
if(Collections.frequency(adjVal, adjVal.get(0)) == adjVal.size())
return adjVal.get(0);
int min = adjVal.get(0);
for(int i = 1; i < adjVal.size(); i++){
if(min == adjVal.get(i))
continue;
rewriteLabel(d, min, adjVal.get(i));
hashPix.remove(adjVal.get(i));
}
return min;
}
/**
* Sets back the label of the given pixel (x offset, y offset, z offset) with its pixel value.
* Checks whether the adjacent pixel has the non-zero pixel value, and its label is already assigned.
*
* @param w the x offset
* @param h the y offset
* @param d the z offset
* @param pixVal the pixel value
* @return the label as integer value
*/
private int setbackLabel(int w , int h, int d, byte pixVal){
List<Integer> adjVal = new ArrayList<Integer>();
//check left
if(mask[d * lheight * lwidth + h * lwidth + w - 1] != 0 && hashPix.get(mask[d * lheight * lwidth + h * lwidth + w - 1]) != (byte)0)
adjVal.add(mask[d * lheight * lwidth + h * lwidth + w - 1]);
//check up
if(mask[d * lheight * lwidth + (h-1) * lwidth + w ] != 0 && hashPix.get(mask[d * lheight * lwidth + (h-1) * lwidth + w]) != (byte)0)
adjVal.add(mask[d * lheight * lwidth + (h-1) * lwidth + w]);
//check below
if(d != 0 && mask[(d-1) * lheight * lwidth + h * lwidth + w] != 0 && hashPix.get(mask[(d-1) * lheight * lwidth + h * lwidth + w]) != (byte)0)
adjVal.add(mask[(d-1) * lheight * lwidth + h * lwidth + w]);
if(adjVal.isEmpty()){
hashPix.put(labelCount, pixVal);
return labelCount++;
}
Collections.sort(adjVal);
//if all element are same or list has only one element
if(Collections.frequency(adjVal, adjVal.get(0)) == adjVal.size())
return adjVal.get(0);
int min = adjVal.get(0);
for(int i = 1; i < adjVal.size(); i++){
if(min == adjVal.get(i))
continue;
hashPix.remove(adjVal.get(i));
rewriteLabel(d, min, adjVal.get(i));
}
return min;
}
/**
* Replace the label of pixels in the spatial image which has "before" to "after".
*
* @param dEnd the end of the depth
* @param after the label to set by this replacement
* @param before the label to be replaced
*/
private void rewriteLabel(int dEnd, int after, int before){
if (ldepth > depth) {
for (int d = 1; d <= dEnd; d++) {
for (int h = 1; h < lheight - 1; h++) {
for (int w = 1; w < lwidth - 1; w++) {
if (mask[d * lheight * lwidth + h * lwidth + w] == before)
mask[d * lheight * lwidth + h * lwidth + w] = after;
}
}
}
}else{
for (int d = 0; d <= dEnd; d++) {
for (int h = 1; h < lheight - 1; h++) {
for (int w = 1; w < lwidth - 1; w++) {
if (mask[d * lheight * lwidth + h * lwidth + w] == before)
mask[d * lheight * lwidth + h * lwidth + w] = after;
}
}
}
}
}
}
|
/*! \file Texture.h
* \author Jared Hoberock
* \brief Defines the interface to a class abstracting
* textures for shading.
*/
#pragma once
#include <array2/Array2.h>
#include "../include/detail/Spectrum.h"
class Texture
: protected Array2<Spectrum>
{
public:
/*! Null constructor creates a 1x1 white Texture.
*/
Texture(void);
/*! Constructor calls the Parent.
* \param w The width of the Texture.
* \param h The height of the Texture.
* \param pixels The pixel data to copy into this Texture.
*/
Texture(const size_t w, const size_t h, const Spectrum *pixels);
/*! Constructor takes a filename referring to
* an image file on disk.
* \param filename The name of the image file of interest.
*/
Texture(const char *filename);
/*! This method provides const access to pixels.
* \param x The column index of the pixel of interest.
* \param y The row index of the pixel of interest.
* \return A const reference to pixel (x,y).
*/
virtual const Spectrum &texRect(const size_t x,
const size_t y) const;
/*! This method provides nearest-neighbor filtering
* given pixel coordinates in [0,1]^2.
* \param u The u-coordinate of the pixel location of interest.
* \param v The v-coordinate of the pixel location of interest.
* \return The box-filtered pixel at (u,v).
*/
virtual const Spectrum &tex2D(const float u,
const float v) const;
/*! This method loads this Texture's data from an
* image file on disk.
* \param filename
* \param filename The name of the image file of interest.
*/
virtual void load(const char *filename);
protected:
/*! \typedef Parent
* \brief Shorthand.
*/
typedef Array2<Spectrum> Parent;
}; // end Texture
|
package org.ak.gitanalyzer.http.processor;
import org.ak.gitanalyzer.util.writer.CSVWriter;
import org.ak.gitanalyzer.util.writer.HTMLWriter;
import java.text.NumberFormat;
import java.util.Collection;
import java.util.function.BiConsumer;
import java.util.function.Function;
public class ProcessorMock extends <API key> {
public ProcessorMock(NumberFormat nf) {
super(nf);
}
@Override
public <T> String getCSVForReport(String[] headers, Collection<T> collection, BiConsumer<T, StringBuilder> consumer) {
return super.getCSVForReport(headers, collection, consumer);
}
@Override
public <T> String getJSONForTable(Collection<T> collection, BiConsumer<T, StringBuilder> consumer) {
return super.getJSONForTable(collection, consumer);
}
@Override
public <T> String getJSONFor2D(Collection<T> collection, BiConsumer<T, StringBuilder> consumer) {
return super.getJSONFor2D(collection, consumer);
}
@Override
public <T> String getJSONForGraph(Collection<T> collection, Function<T, Integer> nodeIdSupplier, TriConsumer<T, StringBuilder, Integer> consumer) {
return super.getJSONForGraph(collection, nodeIdSupplier, consumer);
}
@Override
public String getTypeString(double weight, double thickThreshold, double normalThreshold) {
return super.getTypeString(weight, thickThreshold, normalThreshold);
}
public HTMLWriter getHtmlWriter() {
return htmlWriter;
}
public CSVWriter getCsvWriter() {
return csvWriter;
}
}
|
# require './lib/class_extensions'
# require './lib/mylogger'
# DEV Only requries above.
require './lib/code_detector'
require './lib/dsl/style_dsl'
require './lib/dsl/selector_dsl'
require './lib/tag_helper'
require './lib/html/html_class_finder'
require './lib/html/style_list'
require './lib/highlighter/highlighters_enum'
require './lib/theme_store'
# Do bunch of apply, then invoke end_apply to close the style tag
class StyleGenerator
include HtmlClassFinder, HighlightersEnum, CodeDetector
def initialize(tag_helper, lang = 'none')
@tag_helper = tag_helper
# $logger.info(lang)
# # theming.
# @colorizer = if lang == 'git' || iscmd
# DarkColorizer.new
# elsif ['asp', 'csharp'].include?(lang)
# <API key>.new
# else
# LightColorizer.new
# end
# $logger.debug(@colorizer)
@lang = lang
end
def style_front(front_card_block)
front_style = style {}
front_style.styles << build_main
no_tag = @tag_helper.untagged? || @tag_helper.back_only?
front_style.styles << build_tag unless no_tag
tags = find(front_card_block, :span)
build_code(tags) { |style| front_style.styles << style }
front_style.styles << build_inline if inline?(front_card_block)
front_style
end
def style_back(back_card_block)
back_style = style(get_theme) {}
back_style.styles << build_main
no_tag = @tag_helper.untagged? || @tag_helper.front_only?
back_style.styles << build_tag unless no_tag
back_style.styles << build_figure if @tag_helper.figure?
back_style.styles << build_command if command?(back_card_block)
back_style.styles << build_well if well?(back_card_block)
back_style.styles << build_inline if inline?(back_card_block)
tags = find(back_card_block, :span)
build_code(tags) { |style| back_style.styles << style }
back_style
end
def get_theme
case @lang
when HighlightersEnum::RUBY
ThemeStore::<API key>
else
ThemeStore::Default
end
end
def build_main
select 'div.main' do
font_size '16pt'
text_align 'left'
end
end
def build_tag
select 'span.tag' do
background_color '#5BC0DE'
border_radius '5px'
color 'white'
font_size '14pt'
padding '2px'
margin_right '10px'
end
end
def build_answer_only
select 'span.answer' do
background_color '#D9534F'
border_radius '5px'
color 'white'
display 'table'
font_weight 'bold'
margin '0 auto'
padding '2px 5px'
end
end
def build_figure
select '.fig', :line_height, '70%'
end
def build_inline
select 'code.inline' do
background_color '#F1F1F1'
border '1px solid #DDD'
border_radius '5px'
color 'black'
font_family 'monaco, courier'
font_size '13pt'
padding_left '2px'
padding_right '2px'
end
end
def build_command
select 'code.command' do
color 'white'
background_color 'black'
end
end
def build_well
select 'code.well' do
background_color '#F1F1F1'
border '1px solid #E3E3E3'
border_radius '4px'
box_shadow 'inset 0 1px 1px rgba(0, 0, 0, 0.05)'
color 'black'
display 'block'
font_family 'monaco, courier'
font_size '14pt'
margin_bottom '20px'
min_height '20px'
padding '19px'
end
end
def build_code(tags)
style_list = StyleList.new(tags)
style_list.add('keyword', :color, '#7E0854')
style_list.add('comment', :color, '#417E60')
style_list.add('quote', :color, '#1324BF')
style_list.add('var', :color, '#426F9C')
style_list.add('url', :color, 'blue')
style_list.add('html', :color, '#446FBD')
style_list.add('attr', :color, '#6D8600')
style_list.add('cls', :color, '#6D8600')
style_list.add('num', :color, '#812050')
style_list.add('opt', :color, 'darkgray')
# style_list.add('cmd', :color, '#7E0854')
# Per language Styles
style_list.add('phptag', :color, '#FC0D1B') if @lang == PHP
style_list.add('ann', :color, '#FC0D1B') if @lang == JAVA
style_list.add('symbol', :color, '#808080') if @lang == ASP
if @lang == GIT
style_list.add('opt', :color, 'black')
style_list.add('cmd', :color, '#FFFF9B')
end
style_list.each { |style| yield style }
end
end
# # tag_helper = TagHelper.new(tags: [])
# # tag_helper = TagHelper.new(tags: [:Concept])
# tag_helper = TagHelper.new(tags: [:FB])
# # tag_helper = TagHelper.new(tags: [:BF])
# generator = StyleGenerator.new(tag_helper)
# puts( generator.style_back(['span class="keyword comment"']) )
|
"""A client for the REST API of imeji instances."""
import logging
from collections import OrderedDict
import requests
from six import string_types
from pyimeji import resource
from pyimeji.config import Config
log = logging.getLogger(__name__)
class ImejiError(Exception):
def __init__(self, message, error):
super(ImejiError, self).__init__(message)
self.error = error.get('error') if isinstance(error, dict) else error
class GET(object):
"""Handle GET requests.
This includes requests
- to retrieve single objects,
- to fetch lists of object references (which are returned as `OrderedDict` mapping
object `id` to additional metadata present in the response).
"""
def __init__(self, api, name):
"""Initialize a handler.
:param api: An Imeji API instance.
:param name: Name specifying the kind of object(s) to retrieve. We check whether\
this name has a plural "s" to determine if a list is to be retrieved.
"""
self._list = name.endswith('s')
self.rsc = getattr(resource, (name[:-1] if self._list else name).capitalize())
self.api = api
self.name = name
self.path = name
if not self._list:
self.path += 's'
def __call__(self, id='', **kw):
"""Calling the handler initiates an HTTP request to the imeji server.
:param id: If a single object is to be retrieved it must be specified by id.
:return: An OrderedDict mapping id to additional metadata for lists, a \
:py:class:`pyimeji.resource.Resource` instance for single objects.
"""
if not self._list and not id:
raise ValueError('no id given')
if id:
id = '/' + id
res = self.api._req('/%s%s' % (self.path, id), params=kw)
if not self._list:
return self.rsc(res, self.api)
return OrderedDict([(d['id'], d) for d in res])
class Imeji(object):
def __init__(self, cfg=None, service_url=None):
self.cfg = cfg or Config()
self.service_url = service_url or self.cfg.get('service', 'url')
user = self.cfg.get('service', 'user', default=None)
password = self.cfg.get('service', 'password', default=None)
self.session = requests.Session()
if user and password:
self.session.auth = (user, password)
def _req(self, path, method='get', json=True, assert_status=200, **kw):
"""Make a request to the API of an imeji instance.
:param path: HTTP path.
:param method: HTTP method.
:param json: Flag signalling whether the response should be treated as JSON.
:param assert_status: Expected HTTP response status of a successful request.
:param kw: Additional keyword parameters will be handed through to the \
appropriate function of the requests library.
:return: The return value of the function of the requests library or a decoded \
JSON object/array.
"""
method = getattr(self.session, method.lower())
res = method(self.service_url + '/rest' + path, **kw)
status_code = res.status_code
if json:
try:
res = res.json()
except ValueError: # pragma: no cover
log.error(res.text[:1000])
raise
if assert_status:
if status_code != assert_status:
log.error(
'got HTTP %s, expected HTTP %s' % (status_code, assert_status))
log.error(res.text[:1000] if hasattr(res, 'text') else res)
raise ImejiError('Unexpected HTTP status code', res)
return res
def __getattr__(self, name):
"""Names of resource classes are accepted and resolved as dynamic attribute names.
This allows convenient retrieval of resources as api.<resource-class>(id=<id>),
or api.<resource-class>s(q='x').
"""
return GET(self, name)
def create(self, rsc, **kw):
if isinstance(rsc, string_types):
cls = getattr(resource, rsc.capitalize())
rsc = cls(kw, self)
return rsc.save()
def delete(self, rsc):
return rsc.delete()
def update(self, rsc, **kw):
for k, v in kw.items():
setattr(rsc, k, v)
return rsc.save()
|
-- main.lua
-- Implements the plugin entrypoint (in this case the entire plugin)
-- Global variables:
local g_Plugin = nil
local g_PluginFolder = ""
local g_Stats = {}
local g_TrackedPages = {}
local function LoadAPIFiles(a_Folder, a_DstTable)
assert(type(a_Folder) == "string")
assert(type(a_DstTable) == "table")
local Folder = g_PluginFolder .. a_Folder;
for _, fnam in ipairs(cFile:GetFolderContents(Folder)) do
local FileName = Folder .. fnam;
-- We only want .lua files from the folder:
if (cFile:IsFile(FileName) and fnam:match(".*%.lua$")) then
local TablesFn, Err = loadfile(FileName);
if (type(TablesFn) ~= "function") then
LOGWARNING("Cannot load API descriptions from " .. FileName .. ", Lua error '" .. Err .. "'.");
else
local Tables = TablesFn();
if (type(Tables) ~= "table") then
LOGWARNING("Cannot load API descriptions from " .. FileName .. ", returned object is not a table (" .. type(Tables) .. ").");
break
end
for k, cls in pairs(Tables) do
a_DstTable[k] = cls;
end
end -- if (TablesFn)
end -- if (is lua file)
end -- for fnam - Folder[]
end
local function CreateAPITables()
We want an API table of the following shape:
local API = {
{
Name = "cCuboid",
Functions = {
{Name = "Sort"},
{Name = "IsInside"}
},
Constants = {
},
Variables = {
},
Descendants = {}, -- Will be filled by ReadDescriptions(), array of class APIs (references to other member in the tree)
},
{
Name = "cBlockArea",
Functions = {
{Name = "Clear"},
{Name = "CopyFrom"},
},
Constants = {
{Name = "baTypes", Value = 0},
{Name = "baMetas", Value = 1},
},
Variables = {
},
},
cCuboid = {} -- Each array item also has the map item by its name
};
local Globals = {
Functions = {
},
Constants = {
}
};
local Globals = {Functions = {}, Constants = {}, Variables = {}, Descendants = {}};
local API = {};
local function Add(a_APIContainer, a_ObjName, a_ObjValue)
if (type(a_ObjValue) == "function") then
table.insert(a_APIContainer.Functions, {Name = a_ObjName});
elseif (
(type(a_ObjValue) == "number") or
(type(a_ObjValue) == "string")
) then
table.insert(a_APIContainer.Constants, {Name = a_ObjName, Value = a_ObjValue});
end
end
local function ParseClass(a_ClassName, a_ClassObj)
local res = {Name = a_ClassName, Functions = {}, Constants = {}, Variables = {}, Descendants = {}};
-- Add functions and constants:
for i, v in pairs(a_ClassObj) do
Add(res, i, v);
end
-- Member variables:
local SetField = a_ClassObj[".set"] or {};
if ((a_ClassObj[".get"] ~= nil) and (type(a_ClassObj[".get"]) == "table")) then
for k in pairs(a_ClassObj[".get"]) do
if (SetField[k] == nil) then
-- It is a read-only variable, add it as a constant:
table.insert(res.Constants, {Name = k, Value = ""});
else
-- It is a read-write variable, add it as a variable:
table.insert(res.Variables, { Name = k });
end
end
end
return res;
end
for i, v in pairs(_G) do
if (
(v ~= _G) and -- don't want the global namespace
(v ~= _G.packages) and -- don't want any packages
(v ~= _G[".get"]) and
(v ~= g_APIDesc)
) then
if (type(v) == "table") then
local cls = ParseClass(i, v)
table.insert(API, cls);
API[cls.Name] = cls
else
Add(Globals, i, v);
end
end
end
return API, Globals;
end
local function WriteArticles(f)
f:write([[
<a name="articles"><h2>Articles</h2></a>
<p>The following articles provide various extra information on plugin development</p>
<ul>
]]);
for _, extra in ipairs(g_APIDesc.ExtraPages) do
local SrcFileName = g_PluginFolder .. "/" .. extra.FileName;
if (cFile:Exists(SrcFileName)) then
local DstFileName = "API/" .. extra.FileName;
if (cFile:Exists(DstFileName)) then
cFile:Delete(DstFileName);
end
cFile:Copy(SrcFileName, DstFileName);
f:write("<li><a href=\"" .. extra.FileName .. "\">" .. extra.Title .. "</a></li>\n");
else
f:write("<li>" .. extra.Title .. " <i>(file is missing)</i></li>\n");
end
end
f:write("</ul><hr />");
end
-- Make a link out of anything with the special linkifying syntax {{link|title}}
local function LinkifyString(a_String, a_Referrer)
assert(a_Referrer ~= nil);
assert(a_Referrer ~= "");
Adds a page to the list of tracked pages (to be checked for existence at the end)
local function AddTrackedPage(a_PageName)
local Pg = (g_TrackedPages[a_PageName] or {});
table.insert(Pg, a_Referrer);
g_TrackedPages[a_PageName] = Pg;
end
Creates the HTML for the specified link and title
local function CreateLink(Link, Title)
if (Link:sub(1, 7) == "http://") then
-- The link is a full absolute URL, do not modify, do not track:
return "<a href=\"" .. Link .. "\">" .. Title .. "</a>";
end
local idxHash = Link:find("
if (idxHash ~= nil) then
-- The link contains an anchor:
if (idxHash == 1) then
-- Anchor in the current page, no need to track:
return "<a href=\"" .. Link .. "\">" .. Title .. "</a>";
end
-- Anchor in another page:
local PageName = Link:sub(1, idxHash - 1);
AddTrackedPage(PageName);
return "<a href=\"" .. PageName .. ".html#" .. Link:sub(idxHash + 1) .. "\">" .. Title .. "</a>";
end
-- Link without anchor:
AddTrackedPage(Link);
return "<a href=\"" .. Link .. ".html\">" .. Title .. "</a>";
end
-- Linkify the strings using the CreateLink() function:
local txt = a_String:gsub("{{([^|}]*)|([^}]*)}}", CreateLink) -- {{link|title}}
txt = txt:gsub("{{([^|}]*)}}", -- {{LinkAndTitle}}
function(LinkAndTitle)
local idxHash = LinkAndTitle:find("
if (idxHash ~= nil) then
-- The LinkAndTitle contains a hash, remove the hashed part from the title:
return CreateLink(LinkAndTitle, LinkAndTitle:sub(1, idxHash - 1));
end
return CreateLink(LinkAndTitle, LinkAndTitle);
end
);
return txt;
end
local function WriteHtmlHook(a_Hook, a_HookNav)
local fnam = "API/" .. a_Hook.DefaultFnName .. ".html";
local f, error = io.open(fnam, "w");
if (f == nil) then
LOG("Cannot write \"" .. fnam .. "\": \"" .. error .. "\".");
return;
end
local HookName = a_Hook.DefaultFnName;
f:write([[<!DOCTYPE html><html>
<head>
<title>MCServer API - ]], HookName, [[ Hook</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="prettify.css" />
<script src="prettify.js"></script>
<script src="lang-lua.js"></script>
</head>
<body>
<div id="content">
<header>
<h1>]], a_Hook.Name, [[</h1>
<hr />
</header>
<table><tr><td style="vertical-align: top;">
Index:<br />
<a href='index.html#articles'>Articles</a><br />
<a href='index.html#classes'>Classes</a><br />
<a href='index.html#hooks'>Hooks</a><br />
<br />
Quick navigation:<br />
]]);
f:write(a_HookNav);
f:write([[
</td><td style="vertical-align: top;"><p>
]]);
f:write(LinkifyString(a_Hook.Desc, HookName));
f:write("</p>\n<hr /><h1>Callback function</h1>\n<p>The default name for the callback function is ");
f:write(a_Hook.DefaultFnName, ". It has the following signature:\n");
f:write("<pre class=\"prettyprint lang-lua\">function ", HookName, "(");
if (a_Hook.Params == nil) then
a_Hook.Params = {};
end
for i, param in ipairs(a_Hook.Params) do
if (i > 1) then
f:write(", ");
end
f:write(param.Name);
end
f:write(")</pre>\n<hr /><h1>Parameters:</h1>\n<table><tr><th>Name</th><th>Type</th><th>Notes</th></tr>\n");
for _, param in ipairs(a_Hook.Params) do
f:write("<tr><td>", param.Name, "</td><td>", LinkifyString(param.Type, HookName), "</td><td>", LinkifyString(param.Notes, HookName), "</td></tr>\n");
end
f:write("</table>\n<p>" .. (a_Hook.Returns or "") .. "</p>\n\n");
f:write([[<hr /><h1>Code examples</h1><h2>Registering the callback</h2>]]);
f:write("<pre class=\"prettyprint lang-lua\">\n");
f:write([[cPluginManager:AddHook(cPluginManager.]] .. a_Hook.Name .. ", My" .. a_Hook.DefaultFnName .. [[);]]);
f:write("</pre>\n\n");
local Examples = a_Hook.CodeExamples or {};
for _, example in ipairs(Examples) do
f:write("<h2>", (example.Title or "<i>missing Title</i>"), "</h2>\n");
f:write("<p>", (example.Desc or "<i>missing Desc</i>"), "</p>\n");
f:write("<pre class=\"prettyprint lang-lua\">", (example.Code or "<i>missing Code</i>"), "\n</pre>\n\n");
end
f:write([[</td></tr></table></div><script>prettyPrint();</script></body></html>]]);
f:close();
end
local function WriteHooks(f, a_Hooks, a_UndocumentedHooks, a_HookNav)
f:write([[
<a name="hooks"><h2>Hooks</h2></a>
<p>
A plugin can register to be called whenever an "interesting event" occurs. It does so by calling
<a href="cPluginManager.html">cPluginManager</a>'s AddHook() function and implementing a callback
function to handle the event.</p>
<p>
A plugin can decide whether it will let the event pass through to the rest of the plugins, or hide it
from them. This is determined by the return value from the hook callback function. If the function
returns false or no value, the event is propagated further. If the function returns true, the processing
is stopped, no other plugin receives the notification (and possibly MCServer disables the default
behavior for the event). See each hook's details to see the exact behavior.</p>
<table>
<tr>
<th>Hook name</th>
<th>Called when</th>
</tr>
]]);
for _, hook in ipairs(a_Hooks) do
if (hook.DefaultFnName == nil) then
-- The hook is not documented yet
f:write(" <tr>\n <td>" .. hook.Name .. "</td>\n <td><i>(No documentation yet)</i></td>\n </tr>\n");
table.insert(a_UndocumentedHooks, hook.Name);
else
f:write(" <tr>\n <td><a href=\"" .. hook.DefaultFnName .. ".html\">" .. hook.Name .. "</a></td>\n <td>" .. LinkifyString(hook.CalledWhen, hook.Name) .. "</td>\n </tr>\n");
WriteHtmlHook(hook, a_HookNav);
end
end
f:write([[
</table>
<hr />
]]);
end
local function ReadDescriptions(a_API)
-- Returns true if the class of the specified name is to be ignored
local function IsClassIgnored(a_ClsName)
if (g_APIDesc.IgnoreClasses == nil) then
return false;
end
for _, name in ipairs(g_APIDesc.IgnoreClasses) do
if (a_ClsName:match(name)) then
return true;
end
end
return false;
end
-- Returns true if the function is to be ignored
local function IsFunctionIgnored(a_ClassName, a_FnName)
if (g_APIDesc.IgnoreFunctions == nil) then
return false;
end
if (((g_APIDesc.Classes[a_ClassName] or {}).Functions or {})[a_FnName] ~= nil) then
-- The function is documented, don't ignore
return false;
end
local FnName = a_ClassName .. "." .. a_FnName;
for _, name in ipairs(g_APIDesc.IgnoreFunctions) do
if (FnName:match(name)) then
return true;
end
end
return false;
end
-- Returns true if the constant (specified by its fully qualified name) is to be ignored
local function IsConstantIgnored(a_CnName)
if (g_APIDesc.IgnoreConstants == nil) then
return false;
end;
for _, name in ipairs(g_APIDesc.IgnoreConstants) do
if (a_CnName:match(name)) then
return true;
end
end
return false;
end
-- Returns true if the member variable (specified by its fully qualified name) is to be ignored
local function IsVariableIgnored(a_VarName)
if (g_APIDesc.IgnoreVariables == nil) then
return false;
end;
for _, name in ipairs(g_APIDesc.IgnoreVariables) do
if (a_VarName:match(name)) then
return true;
end
end
return false;
end
-- Remove ignored classes from a_API:
local APICopy = {};
for _, cls in ipairs(a_API) do
if not(IsClassIgnored(cls.Name)) then
table.insert(APICopy, cls);
end
end
for i = 1, #a_API do
a_API[i] = APICopy[i];
end;
-- Process the documentation for each class:
for _, cls in ipairs(a_API) do
-- Initialize default values for each class:
cls.ConstantGroups = {};
cls.<API key> = 0;
cls.<API key> = 0;
-- Rename special functions:
for _, fn in ipairs(cls.Functions) do
if (fn.Name == ".call") then
fn.DocID = "constructor";
fn.Name = "() <i>(constructor)</i>";
elseif (fn.Name == ".add") then
fn.DocID = "operator_plus";
fn.Name = "<i>operator +</i>";
elseif (fn.Name == ".div") then
fn.DocID = "operator_div";
fn.Name = "<i>operator /</i>";
elseif (fn.Name == ".mul") then
fn.DocID = "operator_mul";
fn.Name = "<i>operator *</i>";
elseif (fn.Name == ".sub") then
fn.DocID = "operator_sub";
fn.Name = "<i>operator -</i>";
elseif (fn.Name == ".eq") then
fn.DocID = "operator_eq";
fn.Name = "<i>operator ==</i>";
end
end
local APIDesc = g_APIDesc.Classes[cls.Name];
if (APIDesc ~= nil) then
APIDesc.IsExported = true;
cls.Desc = APIDesc.Desc;
cls.AdditionalInfo = APIDesc.AdditionalInfo;
-- Process inheritance:
if (APIDesc.Inherits ~= nil) then
for _, icls in ipairs(a_API) do
if (icls.Name == APIDesc.Inherits) then
table.insert(icls.Descendants, cls);
cls.Inherits = icls;
end
end
end
cls.<API key> = {}; -- This will contain names of all the functions that are not documented
cls.<API key> = {}; -- This will contain names of all the constants that are not documented
cls.<API key> = {}; -- This will contain names of all the variables that are not documented
local DoxyFunctions = {}; -- This will contain all the API functions together with their documentation
local function AddFunction(a_Name, a_Params, a_Return, a_Notes)
table.insert(DoxyFunctions, {Name = a_Name, Params = a_Params, Return = a_Return, Notes = a_Notes});
end
if (APIDesc.Functions ~= nil) then
-- Assign function descriptions:
for _, func in ipairs(cls.Functions) do
local FnName = func.DocID or func.Name;
local FnDesc = APIDesc.Functions[FnName];
if (FnDesc == nil) then
-- No description for this API function
AddFunction(func.Name);
if not(IsFunctionIgnored(cls.Name, FnName)) then
table.insert(cls.<API key>, FnName);
end
else
-- Description is available
if (FnDesc[1] == nil) then
-- Single function definition
AddFunction(func.Name, FnDesc.Params, FnDesc.Return, FnDesc.Notes);
else
-- Multiple function overloads
for _, desc in ipairs(FnDesc) do
AddFunction(func.Name, desc.Params, desc.Return, desc.Notes);
end -- for k, desc - FnDesc[]
end
FnDesc.IsExported = true;
end
end -- for j, func
-- Replace functions with their described and overload-expanded versions:
cls.Functions = DoxyFunctions;
else -- if (APIDesc.Functions ~= nil)
for _, func in ipairs(cls.Functions) do
local FnName = func.DocID or func.Name;
if not(IsFunctionIgnored(cls.Name, FnName)) then
table.insert(cls.<API key>, FnName);
end
end
end -- if (APIDesc.Functions ~= nil)
if (APIDesc.Constants ~= nil) then
-- Assign constant descriptions:
for _, cons in ipairs(cls.Constants) do
local CnDesc = APIDesc.Constants[cons.Name];
if (CnDesc == nil) then
-- Not documented
if not(IsConstantIgnored(cls.Name .. "." .. cons.Name)) then
table.insert(cls.<API key>, cons.Name);
end
else
cons.Notes = CnDesc.Notes;
CnDesc.IsExported = true;
end
end -- for j, cons
else -- if (APIDesc.Constants ~= nil)
for _, cons in ipairs(cls.Constants) do
if not(IsConstantIgnored(cls.Name .. "." .. cons.Name)) then
table.insert(cls.<API key>, cons.Name);
end
end
end -- else if (APIDesc.Constants ~= nil)
-- Assign member variables' descriptions:
if (APIDesc.Variables ~= nil) then
for _, var in ipairs(cls.Variables) do
local VarDesc = APIDesc.Variables[var.Name];
if (VarDesc == nil) then
-- Not documented
if not(IsVariableIgnored(cls.Name .. "." .. var.Name)) then
table.insert(cls.<API key>, var.Name);
end
else
-- Copy all documentation:
for k, v in pairs(VarDesc) do
var[k] = v
end
end
end -- for j, var
else -- if (APIDesc.Variables ~= nil)
for _, var in ipairs(cls.Variables) do
if not(IsVariableIgnored(cls.Name .. "." .. var.Name)) then
table.insert(cls.<API key>, var.Name);
end
end
end -- else if (APIDesc.Variables ~= nil)
if (APIDesc.ConstantGroups ~= nil) then
-- Create links between the constants and the groups:
local NumInGroups = 0;
local <API key> = 0;
for j, group in pairs(APIDesc.ConstantGroups) do
group.Name = j;
group.Constants = {};
if (type(group.Include) == "string") then
group.Include = { group.Include };
end
local NumInGroup = 0;
for _, incl in ipairs(group.Include or {}) do
for _, cons in ipairs(cls.Constants) do
if ((cons.Group == nil) and cons.Name:match(incl)) then
cons.Group = group;
table.insert(group.Constants, cons);
NumInGroup = NumInGroup + 1;
end
end -- for cidx - cls.Constants[]
end -- for idx - group.Include[]
NumInGroups = NumInGroups + NumInGroup;
if (group.ShowInDescendants) then
<API key> = <API key> + NumInGroup;
end
-- Sort the constants:
table.sort(group.Constants,
function(c1, c2)
return (c1.Name < c2.Name);
end
);
end -- for j - APIDesc.ConstantGroups[]
cls.ConstantGroups = APIDesc.ConstantGroups;
cls.<API key> = NumInGroups;
cls.<API key> = <API key>;
-- Remove grouped constants from the normal list:
local NewConstants = {};
for _, cons in ipairs(cls.Constants) do
if (cons.Group == nil) then
table.insert(NewConstants, cons);
end
end
cls.Constants = NewConstants;
end -- if (ConstantGroups ~= nil)
else -- if (APIDesc ~= nil)
-- Class is not documented at all, add all its members to Undocumented lists:
cls.<API key> = {};
cls.<API key> = {};
cls.<API key> = {};
cls.Variables = cls.Variables or {};
g_Stats.<API key> = g_Stats.<API key> + 1;
for _, func in ipairs(cls.Functions) do
local FnName = func.DocID or func.Name;
if not(IsFunctionIgnored(cls.Name, FnName)) then
table.insert(cls.<API key>, FnName);
end
end -- for j, func - cls.Functions[]
for _, cons in ipairs(cls.Constants) do
if not(IsConstantIgnored(cls.Name .. "." .. cons.Name)) then
table.insert(cls.<API key>, cons.Name);
end
end -- for j, cons - cls.Constants[]
for _, var in ipairs(cls.Variables) do
if not(IsConstantIgnored(cls.Name .. "." .. var.Name)) then
table.insert(cls.<API key>, var.Name);
end
end -- for j, var - cls.Variables[]
end -- else if (APIDesc ~= nil)
-- Remove ignored functions:
local NewFunctions = {};
for _, fn in ipairs(cls.Functions) do
if (not(IsFunctionIgnored(cls.Name, fn.Name))) then
table.insert(NewFunctions, fn);
end
end -- for j, fn
cls.Functions = NewFunctions;
-- Sort the functions (they may have been renamed):
table.sort(cls.Functions,
function(f1, f2)
if (f1.Name == f2.Name) then
-- Same name, either comparing the same function to itself, or two overloads, in which case compare the params
if ((f1.Params == nil) or (f2.Params == nil)) then
return 0;
end
return (f1.Params < f2.Params);
end
return (f1.Name < f2.Name);
end
);
-- Remove ignored constants:
local NewConstants = {};
for _, cn in ipairs(cls.Constants) do
if (not(IsFunctionIgnored(cls.Name, cn.Name))) then
table.insert(NewConstants, cn);
end
end -- for j, cn
cls.Constants = NewConstants;
-- Sort the constants:
table.sort(cls.Constants,
function(c1, c2)
return (c1.Name < c2.Name);
end
);
-- Remove ignored member variables:
local NewVariables = {};
for _, var in ipairs(cls.Variables) do
if (not(IsVariableIgnored(cls.Name .. "." .. var.Name))) then
table.insert(NewVariables, var);
end
end -- for j, var
cls.Variables = NewVariables;
-- Sort the member variables:
table.sort(cls.Variables,
function(v1, v2)
return (v1.Name < v2.Name);
end
);
end -- for i, cls
-- Sort the descendants lists:
for _, cls in ipairs(a_API) do
table.sort(cls.Descendants,
function(c1, c2)
return (c1.Name < c2.Name);
end
);
end -- for i, cls
end
local function ReadHooks(a_Hooks)
a_Hooks = {
{ Name = "HOOK_1"},
{ Name = "HOOK_2"},
};
We want to add hook descriptions to each hook in this array
for _, hook in ipairs(a_Hooks) do
local HookDesc = g_APIDesc.Hooks[hook.Name];
if (HookDesc ~= nil) then
for key, val in pairs(HookDesc) do
hook[key] = val;
end
end
end -- for i, hook - a_Hooks[]
g_Stats.NumTotalHooks = #a_Hooks;
end
local function WriteHtmlClass(a_ClassAPI, a_ClassMenu)
local cf, err = io.open("API/" .. a_ClassAPI.Name .. ".html", "w");
if (cf == nil) then
LOGINFO("Cannot write HTML API for class " .. a_ClassAPI.Name .. ": " .. err)
return;
end
-- Writes a table containing all functions in the specified list, with an optional "inherited from" header when a_InheritedName is valid
local function WriteFunctions(a_Functions, a_InheritedName)
if (#a_Functions == 0) then
return;
end
if (a_InheritedName ~= nil) then
cf:write("<h2>Functions inherited from ", a_InheritedName, "</h2>\n");
end
cf:write("<table>\n<tr><th>Name</th><th>Parameters</th><th>Return value</th><th>Notes</th></tr>\n");
for _, func in ipairs(a_Functions) do
cf:write("<tr><td>", func.Name, "</td>\n");
cf:write("<td>", LinkifyString(func.Params or "", (a_InheritedName or a_ClassAPI.Name)), "</td>\n");
cf:write("<td>", LinkifyString(func.Return or "", (a_InheritedName or a_ClassAPI.Name)), "</td>\n");
cf:write("<td>", LinkifyString(func.Notes or "<i>(undocumented)</i>", (a_InheritedName or a_ClassAPI.Name)), "</td></tr>\n");
end
cf:write("</table>\n");
end
local function WriteConstantTable(a_Constants, a_Source)
cf:write("<table>\n<tr><th>Name</th><th>Value</th><th>Notes</th></tr>\n");
for _, cons in ipairs(a_Constants) do
cf:write("<tr><td>", cons.Name, "</td>\n");
cf:write("<td>", cons.Value, "</td>\n");
cf:write("<td>", LinkifyString(cons.Notes or "", a_Source), "</td></tr>\n");
end
cf:write("</table>\n\n");
end
local function WriteConstants(a_Constants, a_ConstantGroups, a_NumConstantGroups, a_InheritedName)
if ((#a_Constants == 0) and (a_NumConstantGroups == 0)) then
return;
end
local Source = a_ClassAPI.Name
if (a_InheritedName ~= nil) then
cf:write("<h2>Constants inherited from ", a_InheritedName, "</h2>\n");
Source = a_InheritedName;
end
if (#a_Constants > 0) then
WriteConstantTable(a_Constants, Source);
end
for _, group in pairs(a_ConstantGroups) do
if ((a_InheritedName == nil) or group.ShowInDescendants) then
cf:write("<a name='", group.Name, "'><p>");
cf:write(LinkifyString(group.TextBefore or "", Source));
WriteConstantTable(group.Constants, a_InheritedName or a_ClassAPI.Name);
cf:write(LinkifyString(group.TextAfter or "", Source), "</a></p>");
end
end
end
local function WriteVariables(a_Variables, a_InheritedName)
if (#a_Variables == 0) then
return;
end
if (a_InheritedName ~= nil) then
cf:write("<h2>Member variables inherited from ", a_InheritedName, "</h2>\n");
end
cf:write("<table><tr><th>Name</th><th>Type</th><th>Notes</th></tr>\n");
for _, var in ipairs(a_Variables) do
cf:write("<tr><td>", var.Name, "</td>\n");
cf:write("<td>", LinkifyString(var.Type or "<i>(undocumented)</i>", a_InheritedName or a_ClassAPI.Name), "</td>\n");
cf:write("<td>", LinkifyString(var.Notes or "", a_InheritedName or a_ClassAPI.Name), "</td>\n </tr>\n");
end
cf:write("</table>\n\n");
end
local function WriteDescendants(a_Descendants)
if (#a_Descendants == 0) then
return;
end
cf:write("<ul>");
for _, desc in ipairs(a_Descendants) do
cf:write("<li><a href=\"", desc.Name, ".html\">", desc.Name, "</a>");
WriteDescendants(desc.Descendants);
cf:write("</li>\n");
end
cf:write("</ul>\n");
end
local ClassName = a_ClassAPI.Name;
-- Build an array of inherited classes chain:
local InheritanceChain = {};
local CurrInheritance = a_ClassAPI.Inherits;
while (CurrInheritance ~= nil) do
table.insert(InheritanceChain, CurrInheritance);
CurrInheritance = CurrInheritance.Inherits;
end
cf:write([[<!DOCTYPE html><html>
<head>
<title>MCServer API - ]], a_ClassAPI.Name, [[ Class</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<link rel="stylesheet" type="text/css" href="prettify.css" />
<script src="prettify.js"></script>
<script src="lang-lua.js"></script>
</head>
<body>
<div id="content">
<header>
<h1>]], a_ClassAPI.Name, [[</h1>
<hr />
</header>
<table><tr><td style="vertical-align: top;">
Index:<br />
<a href='index.html#articles'>Articles</a><br />
<a href='index.html#classes'>Classes</a><br />
<a href='index.html#hooks'>Hooks</a><br />
<br />
Quick navigation:<br />
]]);
cf:write(a_ClassMenu);
cf:write([[
</td><td style="vertical-align: top;"><h1>Contents</h1>
<p><ul>
]]);
local HasInheritance = ((#a_ClassAPI.Descendants > 0) or (a_ClassAPI.Inherits ~= nil));
local HasConstants = (#a_ClassAPI.Constants > 0) or (a_ClassAPI.<API key> > 0);
local HasFunctions = (#a_ClassAPI.Functions > 0);
local HasVariables = (#a_ClassAPI.Variables > 0);
for _, cls in ipairs(InheritanceChain) do
HasConstants = HasConstants or (#cls.Constants > 0) or (cls.<API key> > 0);
HasFunctions = HasFunctions or (#cls.Functions > 0);
HasVariables = HasVariables or (#cls.Variables > 0);
end
-- Write the table of contents:
if (HasInheritance) then
cf:write("<li><a href=\"#inherits\">Inheritance</a></li>\n");
end
if (HasConstants) then
cf:write("<li><a href=\"#constants\">Constants</a></li>\n");
end
if (HasVariables) then
cf:write("<li><a href=\"#variables\">Member variables</a></li>\n");
end
if (HasFunctions) then
cf:write("<li><a href=\"#functions\">Functions</a></li>\n");
end
if (a_ClassAPI.AdditionalInfo ~= nil) then
for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do
cf:write("<li><a href=\"#additionalinfo_", i, "\">", (additional.Header or "<i>(No header)</i>"), "</a></li>\n");
end
end
cf:write("</ul></p>\n");
-- Write the class description:
cf:write("<hr /><a name=\"desc\"><h1>", ClassName, " class</h1></a>\n");
if (a_ClassAPI.Desc ~= nil) then
cf:write("<p>");
cf:write(LinkifyString(a_ClassAPI.Desc, ClassName));
cf:write("</p>\n\n");
end;
-- Write the inheritance, if available:
if (HasInheritance) then
cf:write("<hr /><a name=\"inherits\"><h1>Inheritance</h1></a>\n");
if (#InheritanceChain > 0) then
cf:write("<p>This class inherits from the following parent classes:<ul>\n");
for _, cls in ipairs(InheritanceChain) do
cf:write("<li><a href=\"", cls.Name, ".html\">", cls.Name, "</a></li>\n");
end
cf:write("</ul></p>\n");
end
if (#a_ClassAPI.Descendants > 0) then
cf:write("<p>This class has the following descendants:\n");
WriteDescendants(a_ClassAPI.Descendants);
cf:write("</p>\n\n");
end
end
-- Write the constants:
if (HasConstants) then
cf:write("<a name=\"constants\"><hr /><h1>Constants</h1></a>\n");
WriteConstants(a_ClassAPI.Constants, a_ClassAPI.ConstantGroups, a_ClassAPI.<API key>, nil);
g_Stats.NumTotalConstants = g_Stats.NumTotalConstants + #a_ClassAPI.Constants + (a_ClassAPI.<API key> or 0);
for _, cls in ipairs(InheritanceChain) do
WriteConstants(cls.Constants, cls.ConstantGroups, cls.<API key>, cls.Name);
end;
end;
-- Write the member variables:
if (HasVariables) then
cf:write("<a name=\"variables\"><hr /><h1>Member variables</h1></a>\n");
WriteVariables(a_ClassAPI.Variables, nil);
g_Stats.NumTotalVariables = g_Stats.NumTotalVariables + #a_ClassAPI.Variables;
for _, cls in ipairs(InheritanceChain) do
WriteVariables(cls.Variables, cls.Name);
end;
end
-- Write the functions, including the inherited ones:
if (HasFunctions) then
cf:write("<a name=\"functions\"><hr /><h1>Functions</h1></a>\n");
WriteFunctions(a_ClassAPI.Functions, nil);
g_Stats.NumTotalFunctions = g_Stats.NumTotalFunctions + #a_ClassAPI.Functions;
for _, cls in ipairs(InheritanceChain) do
WriteFunctions(cls.Functions, cls.Name);
end
end
-- Write the additional infos:
if (a_ClassAPI.AdditionalInfo ~= nil) then
for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do
cf:write("<a name=\"additionalinfo_", i, "\"><h1>", additional.Header, "</h1></a>\n");
cf:write(LinkifyString(additional.Contents, ClassName));
end
end
cf:write([[</td></tr></table></div><script>prettyPrint();</script></body></html>]]);
cf:close();
end
local function WriteClasses(f, a_API, a_ClassMenu)
f:write([[
<a name="classes"><h2>Class index</h2></a>
<p>The following classes are available in the MCServer Lua scripting language:
<ul>
]]);
for _, cls in ipairs(a_API) do
f:write("<li><a href=\"", cls.Name, ".html\">", cls.Name, "</a></li>\n");
WriteHtmlClass(cls, a_ClassMenu);
end
f:write([[
</ul></p>
<hr />
]]);
end
Writes a list of undocumented objects into a file
local function <API key>(API, UndocumentedHooks)
f = io.open("API/_undocumented.lua", "w");
if (f ~= nil) then
f:write("\n-- This is the list of undocumented API objects, automatically generated by APIDump\n\n");
f:write("g_APIDesc =\n{\n\tClasses =\n\t{\n");
for _, cls in ipairs(API) do
local HasFunctions = ((cls.<API key> ~= nil) and (#cls.<API key> > 0));
local HasConstants = ((cls.<API key> ~= nil) and (#cls.<API key> > 0));
local HasVariables = ((cls.<API key> ~= nil) and (#cls.<API key> > 0));
g_Stats.<API key> = g_Stats.<API key> + #cls.<API key>;
g_Stats.<API key> = g_Stats.<API key> + #cls.<API key>;
g_Stats.<API key> = g_Stats.<API key> + #cls.<API key>;
if (HasFunctions or HasConstants or HasVariables) then
f:write("\t\t" .. cls.Name .. " =\n\t\t{\n");
if ((cls.Desc == nil) or (cls.Desc == "")) then
f:write("\t\t\tDesc = \"\"\n");
end
end
if (HasFunctions) then
f:write("\t\t\tFunctions =\n\t\t\t{\n");
table.sort(cls.<API key>);
for _, fn in ipairs(cls.<API key>) do
f:write("\t\t\t\t" .. fn .. " = { Params = \"\", Return = \"\", Notes = \"\" },\n");
end -- for j, fn - cls.<API key>[]
f:write("\t\t\t},\n\n");
end
if (HasConstants) then
f:write("\t\t\tConstants =\n\t\t\t{\n");
table.sort(cls.<API key>);
for _, cn in ipairs(cls.<API key>) do
f:write("\t\t\t\t" .. cn .. " = { Notes = \"\" },\n");
end -- for j, fn - cls.<API key>[]
f:write("\t\t\t},\n\n");
end
if (HasVariables) then
f:write("\t\t\tVariables =\n\t\t\t{\n");
table.sort(cls.<API key>);
for _, vn in ipairs(cls.<API key>) do
f:write("\t\t\t\t" .. vn .. " = { Type = \"\", Notes = \"\" },\n");
end -- for j, fn - cls.<API key>[]
f:write("\t\t\t},\n\n");
end
if (HasFunctions or HasConstants or HasVariables) then
f:write("\t\t},\n\n");
end
end -- for i, cls - API[]
f:write("\t},\n");
if (#UndocumentedHooks > 0) then
f:write("\n\tHooks =\n\t{\n");
for i, hook in ipairs(UndocumentedHooks) do
if (i > 1) then
f:write("\n");
end
f:write("\t\t" .. hook .. " =\n\t\t{\n");
f:write("\t\t\tCalledWhen = \"\",\n");
f:write("\t\t\tDefaultFnName = \"On\", -- also used as pagename\n");
f:write("\t\t\tDesc = [[\n\t\t\t\t\n\t\t\t]],\n");
f:write("\t\t\tParams =\n\t\t\t{\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t\t{ Name = \"\", Type = \"\", Notes = \"\" },\n");
f:write("\t\t\t},\n");
f:write("\t\t\tReturns = [[\n\t\t\t\t\n\t\t\t]],\n");
f:write("\t\t}, -- " .. hook .. "\n");
end
f:write("\t},\n");
end
f:write("}\n\n\n\n");
f:close();
end
g_Stats.<API key> = #UndocumentedHooks;
end
Lists the API objects that are documented but not available in the API:
local function <API key>()
f = io.open("API/<API key>.txt", "w");
if (f ~= nil) then
for clsname, cls in pairs(g_APIDesc.Classes) do
if not(cls.IsExported) then
-- The whole class is not exported
f:write("class\t" .. clsname .. "\n");
else
if (cls.Functions ~= nil) then
for fnname, fnapi in pairs(cls.Functions) do
if not(fnapi.IsExported) then
f:write("func\t" .. clsname .. "." .. fnname .. "\n");
end
end -- for j, fn - cls.Functions[]
end
if (cls.Constants ~= nil) then
for cnname, cnapi in pairs(cls.Constants) do
if not(cnapi.IsExported) then
f:write("const\t" .. clsname .. "." .. cnname .. "\n");
end
end -- for j, fn - cls.Functions[]
end
end
end -- for i, cls - g_APIDesc.Classes[]
f:close();
end
end
local function ListMissingPages()
local MissingPages = {};
local NumLinks = 0;
for PageName, Referrers in pairs(g_TrackedPages) do
NumLinks = NumLinks + 1;
if not(cFile:Exists("API/" .. PageName .. ".html")) then
table.insert(MissingPages, {Name = PageName, Refs = Referrers} );
end
end;
g_Stats.NumTrackedLinks = NumLinks;
g_TrackedPages = {};
if (#MissingPages == 0) then
-- No missing pages, congratulations!
return;
end
-- Sort the pages by name:
table.sort(MissingPages,
function (Page1, Page2)
return (Page1.Name < Page2.Name);
end
);
-- Output the pages:
local f, err = io.open("API/_missingPages.txt", "w");
if (f == nil) then
LOGWARNING("Cannot open _missingPages.txt for writing: '" .. err .. "'. There are " .. #MissingPages .. " pages missing.");
return;
end
for _, pg in ipairs(MissingPages) do
f:write(pg.Name .. ":\n");
-- Sort and output the referrers:
table.sort(pg.Refs);
f:write("\t" .. table.concat(pg.Refs, "\n\t"));
f:write("\n\n");
end
f:close();
g_Stats.NumInvalidLinks = #MissingPages;
end
Writes the documentation statistics (in g_Stats) into the given HTML file
local function WriteStats(f)
local function ExportMeter(a_Percent)
local Color;
if (a_Percent > 99) then
Color = "green";
elseif (a_Percent > 50) then
Color = "orange";
else
Color = "red";
end
local meter = {
"\n",
"<div style=\"background-color: black; padding: 1px; width: 100px\">\n",
"<div style=\"background-color: ",
Color,
"; width: ",
a_Percent,
"%; height: 16px\"></div></div>\n</td><td>",
string.format("%.2f", a_Percent),
" %",
};
return table.concat(meter, "");
end
f:write([[
<hr /><a name="docstats"><h2>Documentation statistics</h2></a>
<table><tr><th>Object</th><th>Total</th><th>Documented</th><th>Undocumented</th><th colspan="2">Documented %</th></tr>
]]);
f:write("<tr><td>Classes</td><td>", g_Stats.NumTotalClasses);
f:write("</td><td>", g_Stats.NumTotalClasses - g_Stats.<API key>);
f:write("</td><td>", g_Stats.<API key>);
f:write("</td><td>", ExportMeter(100 * (g_Stats.NumTotalClasses - g_Stats.<API key>) / g_Stats.NumTotalClasses));
f:write("</td></tr>\n");
f:write("<tr><td>Functions</td><td>", g_Stats.NumTotalFunctions);
f:write("</td><td>", g_Stats.NumTotalFunctions - g_Stats.<API key>);
f:write("</td><td>", g_Stats.<API key>);
f:write("</td><td>", ExportMeter(100 * (g_Stats.NumTotalFunctions - g_Stats.<API key>) / g_Stats.NumTotalFunctions));
f:write("</td></tr>\n");
f:write("<tr><td>Member variables</td><td>", g_Stats.NumTotalVariables);
f:write("</td><td>", g_Stats.NumTotalVariables - g_Stats.<API key>);
f:write("</td><td>", g_Stats.<API key>);
f:write("</td><td>", ExportMeter(100 * (g_Stats.NumTotalVariables - g_Stats.<API key>) / g_Stats.NumTotalVariables));
f:write("</td></tr>\n");
f:write("<tr><td>Constants</td><td>", g_Stats.NumTotalConstants);
f:write("</td><td>", g_Stats.NumTotalConstants - g_Stats.<API key>);
f:write("</td><td>", g_Stats.<API key>);
f:write("</td><td>", ExportMeter(100 * (g_Stats.NumTotalConstants - g_Stats.<API key>) / g_Stats.NumTotalConstants));
f:write("</td></tr>\n");
f:write("<tr><td>Hooks</td><td>", g_Stats.NumTotalHooks);
f:write("</td><td>", g_Stats.NumTotalHooks - g_Stats.<API key>);
f:write("</td><td>", g_Stats.<API key>);
f:write("</td><td>", ExportMeter(100 * (g_Stats.NumTotalHooks - g_Stats.<API key>) / g_Stats.NumTotalHooks));
f:write("</td></tr>\n");
f:write([[
</table>
<p>There are ]], g_Stats.NumTrackedLinks, " internal links, ", g_Stats.NumInvalidLinks, " of them are invalid.</p>"
);
end
local function DumpAPIHtml(a_API)
LOG("Dumping all available functions and constants to API subfolder...");
-- Create the output folder
if not(cFile:IsFolder("API")) then
cFile:CreateFolder("API");
end
LOG("Copying static files..");
cFile:CreateFolder("API/Static");
local localFolder = g_Plugin:GetLocalFolder();
for _, fnam in ipairs(cFile:GetFolderContents(localFolder .. "/Static")) do
cFile:Delete("API/Static/" .. fnam);
cFile:Copy(localFolder .. "/Static/" .. fnam, "API/Static/" .. fnam);
end
-- Extract hook constants:
local Hooks = {};
local UndocumentedHooks = {};
for name, obj in pairs(cPluginManager) do
if (
(type(obj) == "number") and
name:match("HOOK_.*") and
(name ~= "HOOK_MAX") and
(name ~= "HOOK_NUM_HOOKS")
) then
table.insert(Hooks, { Name = name });
end
end
table.sort(Hooks,
function(Hook1, Hook2)
return (Hook1.Name < Hook2.Name);
end
);
ReadHooks(Hooks);
-- Create a "class index" file, write each class as a link to that file,
-- then dump class contents into class-specific file
LOG("Writing HTML files...");
local f, err = io.open("API/index.html", "w");
if (f == nil) then
LOGINFO("Cannot output HTML API: " .. err);
return;
end
-- Create a class navigation menu that will be inserted into each class file for faster navigation (#403)
local ClassMenuTab = {};
for _, cls in ipairs(a_API) do
table.insert(ClassMenuTab, "<a href='");
table.insert(ClassMenuTab, cls.Name);
table.insert(ClassMenuTab, ".html'>");
table.insert(ClassMenuTab, cls.Name);
table.insert(ClassMenuTab, "</a><br />");
end
local ClassMenu = table.concat(ClassMenuTab, "");
-- Create a hook navigation menu that will be inserted into each hook file for faster navigation(#403)
local HookNavTab = {};
for _, hook in ipairs(Hooks) do
table.insert(HookNavTab, "<a href='");
table.insert(HookNavTab, hook.DefaultFnName);
table.insert(HookNavTab, ".html'>");
table.insert(HookNavTab, (hook.Name:gsub("^HOOK_", ""))); -- remove the "HOOK_" part of the name
table.insert(HookNavTab, "</a><br />");
end
local HookNav = table.concat(HookNavTab, "");
-- Write the HTML file:
f:write([[<!DOCTYPE html>
<html>
<head>
<title>MCServer API - Index</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<div id="content">
<header>
<h1>MCServer API - Index</h1>
<hr />
</header>
<p>The API reference is divided into the following sections:</p>
<ul>
<li><a href="#articles">Articles</a></li>
<li><a href="#classes">Class index</a></li>
<li><a href="#hooks">Hooks</a></li>
<li><a href="#docstats">Documentation statistics</a></li>
</ul>
<hr />
]]);
WriteArticles(f);
WriteClasses(f, a_API, ClassMenu);
WriteHooks(f, Hooks, UndocumentedHooks, HookNav);
-- Copy the static files to the output folder:
local StaticFiles =
{
"main.css",
"prettify.js",
"prettify.css",
"lang-lua.js",
};
for _, fnam in ipairs(StaticFiles) do
cFile:Delete("API/" .. fnam);
cFile:Copy(g_Plugin:GetLocalFolder() .. "/" .. fnam, "API/" .. fnam);
end
-- List the documentation problems:
LOG("Listing leftovers...");
<API key>(a_API, UndocumentedHooks);
<API key>();
ListMissingPages();
WriteStats(f);
f:write([[ </ul>
</div>
</body>
</html>]]);
f:close();
LOG("API subfolder written");
end
Returns the string with extra tabs and CR/LFs removed
local function CleanUpDescription(a_Desc)
-- Get rid of indent and newlines, normalize whitespace:
local res = a_Desc:gsub("[\n\t]", "")
res = a_Desc:gsub("%s%s+", " ")
-- Replace paragraph marks with newlines:
res = res:gsub("<p>", "\n")
res = res:gsub("</p>", "")
-- Replace list items with dashes:
res = res:gsub("</?ul>", "")
res = res:gsub("<li>", "\n - ")
res = res:gsub("</li>", "")
return res
end
Writes a list of methods into the specified file in ZBS format
local function WriteZBSMethods(f, a_Methods)
for _, func in ipairs(a_Methods or {}) do
f:write("\t\t\t[\"", func.Name, "\"] =\n")
f:write("\t\t\t{\n")
f:write("\t\t\t\ttype = \"method\",\n")
if ((func.Notes ~= nil) and (func.Notes ~= "")) then
f:write("\t\t\t\tdescription = [[", CleanUpDescription(func.Notes or ""), " ]],\n")
end
f:write("\t\t\t},\n")
end
end
Writes a list of constants into the specified file in ZBS format
local function WriteZBSConstants(f, a_Constants)
for _, cons in ipairs(a_Constants or {}) do
f:write("\t\t\t[\"", cons.Name, "\"] =\n")
f:write("\t\t\t{\n")
f:write("\t\t\t\ttype = \"value\",\n")
if ((cons.Desc ~= nil) and (cons.Desc ~= "")) then
f:write("\t\t\t\tdescription = [[", CleanUpDescription(cons.Desc or ""), " ]],\n")
end
f:write("\t\t\t},\n")
end
end
Writes one MCS class definition into the specified file in ZBS format
local function WriteZBSClass(f, a_Class)
assert(type(a_Class) == "table")
-- Write class header:
f:write("\t", a_Class.Name, " =\n\t{\n")
f:write("\t\ttype = \"class\",\n")
f:write("\t\tdescription = [[", CleanUpDescription(a_Class.Desc or ""), " ]],\n")
f:write("\t\tchilds =\n")
f:write("\t\t{\n")
-- Export methods and constants:
WriteZBSMethods(f, a_Class.Functions)
WriteZBSConstants(f, a_Class.Constants)
-- Finish the class definition:
f:write("\t\t},\n")
f:write("\t},\n\n")
end
Dumps the entire API table into a file in the ZBS format
local function DumpAPIZBS(a_API)
LOG("Dumping ZBS API description...")
local f, err = io.open("mcserver_api.lua", "w")
if (f == nil) then
LOG("Cannot open mcserver_lua.lua for writing, ZBS API will not be dumped. " .. err)
return
end
-- Write the file header:
f:write("-- This is a MCServer API file automatically generated by the APIDump plugin\n")
f:write("-- Note that any manual changes will be overwritten by the next dump\n\n")
f:write("return {\n")
-- Export each class except Globals, store those aside:
local Globals
for _, cls in ipairs(a_API) do
if (cls.Name ~= "Globals") then
WriteZBSClass(f, cls)
else
Globals = cls
end
end
-- Export the globals:
if (Globals) then
WriteZBSMethods(f, Globals.Functions)
WriteZBSConstants(f, Globals.Constants)
end
-- Finish the file:
f:write("}\n")
f:close()
LOG("ZBS API dumped...")
end
Returns true if a_Descendant is declared to be a (possibly indirect) descendant of a_Base
local function <API key>(a_DescendantName, a_BaseName, a_API)
-- Check params:
assert(type(a_DescendantName) == "string")
assert(type(a_BaseName) == "string")
assert(type(a_API) == "table")
if not(a_API[a_BaseName]) then
return false
end
assert(type(a_API[a_BaseName]) == "table", "Not a class name: " .. a_BaseName)
assert(type(a_API[a_BaseName].Descendants) == "table")
-- Check direct inheritance:
for _, desc in ipairs(a_API[a_BaseName].Descendants) do
if (desc.Name == a_DescendantName) then
return true
end
end -- for desc - a_BaseName's descendants
-- Check indirect inheritance:
for _, desc in ipairs(a_API[a_BaseName].Descendants) do
if (<API key>(a_DescendantName, desc.Name, a_API)) then
return true
end
end -- for desc - a_BaseName's descendants
return false
end
Checks the specified class' inheritance
-- Reports any problems as new items in the a_Report table
local function <API key>(a_Class, a_API, a_Report)
-- Check params:
assert(type(a_Class) == "table")
assert(type(a_API) == "table")
assert(type(a_Report) == "table")
-- Check that the declared descendants are really descendants:
local registry = debug.getregistry()
for _, desc in ipairs(a_Class.Descendants or {}) do
local isParent = false
local parents = registry["tolua_super"][_G[desc.Name]]
if not(parents[a_Class.Name]) then
table.insert(a_Report, desc.Name .. " is not a descendant of " .. a_Class.Name)
end
end -- for desc - a_Class.Descendants[]
-- Check that all inheritance is listed for the class:
local parents = registry["tolua_super"][_G[a_Class.Name]] -- map of "classname" -> true for each class that a_Class inherits
for clsName, isParent in pairs(parents or {}) do
if ((clsName ~= "") and not(clsName:match("const .*"))) then
if not(<API key>(a_Class.Name, clsName, a_API)) then
table.insert(a_Report, a_Class.Name .. " inherits from " .. clsName .. " but this isn't documented")
end
end
end
end
Checks each class's declared inheritance versus the actual inheritance
local function CheckAPIDescendants(a_API)
-- Check each class:
local report = {}
for _, cls in ipairs(a_API) do
if (cls.Name ~= "Globals") then
<API key>(cls, a_API, report)
end
end
-- If there's anything to report, output it to a file:
if (report[1] ~= nil) then
LOG("There are inheritance errors in the API description:")
for _, msg in ipairs(report) do
LOG(" " .. msg)
end
local f, err = io.open("API/_inheritance_errors.txt", "w")
if (f == nil) then
LOG("Cannot report inheritance problems to a file: " .. tostring(err))
return
end
f:write(table.concat(report, "\n"))
f:close()
end
end
local function DumpApi()
LOG("Dumping the API...")
-- Load the API descriptions from the Classes and Hooks subfolders:
-- This needs to be done each time the command is invoked because the export modifies the tables' contents
dofile(g_PluginFolder .. "/APIDesc.lua")
if (g_APIDesc.Classes == nil) then
g_APIDesc.Classes = {};
end
if (g_APIDesc.Hooks == nil) then
g_APIDesc.Hooks = {};
end
LoadAPIFiles("/Classes/", g_APIDesc.Classes);
LoadAPIFiles("/Hooks/", g_APIDesc.Hooks);
-- Reset the stats:
g_TrackedPages = {}; -- List of tracked pages, to be checked later whether they exist. Each item is an array of referring pagenames.
g_Stats = -- Statistics about the documentation
{
NumTotalClasses = 0,
<API key> = 0,
NumTotalFunctions = 0,
<API key> = 0,
NumTotalConstants = 0,
<API key> = 0,
NumTotalVariables = 0,
<API key> = 0,
NumTotalHooks = 0,
<API key> = 0,
NumTrackedLinks = 0,
NumInvalidLinks = 0,
}
-- Create the API tables:
local API, Globals = CreateAPITables();
-- Sort the classes by name:
table.sort(API,
function (c1, c2)
return (string.lower(c1.Name) < string.lower(c2.Name));
end
);
g_Stats.NumTotalClasses = #API;
-- Add Globals into the API:
Globals.Name = "Globals";
table.insert(API, Globals);
-- Read in the descriptions:
LOG("Reading descriptions...");
ReadDescriptions(API);
-- Check that the API lists the inheritance properly, report any problems to a file:
CheckAPIDescendants(API)
-- Dump all available API objects in HTML format into a subfolder:
DumpAPIHtml(API);
-- Dump all available API objects in format used by ZeroBraneStudio API descriptions:
DumpAPIZBS(API)
LOG("APIDump finished");
return true
end
local function HandleWebAdminDump(a_Request)
if (a_Request.PostParams["Dump"] ~= nil) then
DumpApi()
end
return
[[
<p>Pressing the button will generate the API dump on the server. Note that this can take some time.</p>
<form method="POST"><input type="submit" name="Dump" value="Dump the API"/></form>
]]
end
local function HandleCmdApi(a_Split)
DumpApi()
return true
end
function Initialize(Plugin)
g_Plugin = Plugin;
g_PluginFolder = Plugin:GetLocalFolder();
LOG("Initialising " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
-- Bind a console command to dump the API:
cPluginManager:BindConsoleCommand("api", HandleCmdApi, "Dumps the Lua API docs into the API/ subfolder")
-- Add a WebAdmin tab that has a Dump button
g_Plugin:AddWebTab("APIDump", HandleWebAdminDump)
return true
end
|
using MatrixApi.Domain;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Data.Json;
namespace MatrixPhone.DataModel
{
public static class UserDataSource
{
public static User user = new User();
public static User GetUser() {
return user;
}
public static async void Login(string Email, string Password)
{
user.Email = Email;
user.Password = Password;
var httpClient = new appHttpClient();
var response = await httpClient.GetAsync("Users");
try
{
response.<API key>(); // Throw on error code.
} catch {
user = new User();
}
var result = await response.Content.ReadAsStringAsync();
user = JsonConvert.DeserializeObject<User>(result);
}
public static string Auth()
{
var authText = string.Format("{0}:{1}", user.Email, user.Password);
return Convert.ToBase64String(Encoding.UTF8.GetBytes(authText));
}
}
}
|
package com.yezi.text.widget;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SwitchCompat;
import android.view.View;
import android.widget.CompoundButton;
import com.yezi.text.activity.<API key>;
import com.yezi.text.activity.<API key>;
import com.yezi.text.R;
public class MyRecycleview extends AppCompatActivity {
private boolean enabledGrid = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mycycleview);
findViewById(R.id.btn_animator_sample).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(MyRecycleview.this, <API key>.class);
i.putExtra("GRID", enabledGrid);
startActivity(i);
}
});
findViewById(R.id.btn_adapter_sample).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(MyRecycleview.this, <API key>.class);
i.putExtra("GRID", enabledGrid);
startActivity(i);
}
});
((SwitchCompat) findViewById(R.id.grid)).<API key>(
new CompoundButton.<API key>() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
enabledGrid = isChecked;
}
});
}
}
|
(function () {
'use strict';
app.service('reportService', reportService);
function reportService($http, $window, $interval, timeAgo, restCall, queryService, dashboardFactory, ngAuthSettings, reportServiceUrl) {
var populateReport = function (report, url) {
function successCallback(response) {
if (response.data.data.length === 0) {
report.status = 'EMPTY'
} else {
report.status = 'SUCCESS';
report.data = response.data.data;
report.getTotal();
console.log(report);
}
}
function errorCallback(error) {
console.log(error);
this.status = 'FAILED';
}
restCall('GET', url, null, successCallback, errorCallback)
}
var getReport = function () {
return {
data: {},
searchParam : {
startdate: null,
enddate: null,
type: "ENTERPRISE",
generateexcel: false,
userid: null,
username: null
},
total : {
totalVendor: 0,
totalDelivery: 0,
totalPending: 0,
totalInProgress: 0,
totalCompleted: 0,
totalCancelled: 0,
totalProductPrice: 0,
totalDeliveryCharge: 0
},
getTotal: function () {
var itSelf = this;
itSelf.total.totalVendor = 0;
itSelf.total.totalDelivery = 0;
itSelf.total.totalPending = 0;
itSelf.total.totalInProgress = 0;
itSelf.total.totalCompleted = 0;
itSelf.total.totalCancelled = 0;
itSelf.total.totalProductPrice = 0;
itSelf.total.totalDeliveryCharge = 0;
angular.forEach(this.data, function (value, key) {
itSelf.total.totalVendor += 1;
itSelf.total.totalDelivery += value.TotalDelivery;
itSelf.total.totalPending += value.TotalPending;
itSelf.total.totalInProgress += value.TotalInProgress;
itSelf.total.totalCompleted += value.TotalCompleted;
itSelf.total.totalCancelled += value.TotalCancelled;
itSelf.total.totalProductPrice += value.TotalProductPrice;
itSelf.total.totalDeliveryCharge += value.TotalDeliveryCharge;
});
console.log(this.total)
},
getUrl: function () {
// FIXME: need to be refactored
if (this.searchParam.type === "BIKE_MESSENGER") {
return reportServiceUrl + "api/report?startdate="+this.searchParam.startdate+"&enddate="+this.searchParam.enddate+"&usertype="+this.searchParam.type;
}
return reportServiceUrl + "api/report?startdate="+this.searchParam.startdate+"&enddate="+this.searchParam.enddate+"&usertype="+this.searchParam.type;
},
getReport: function () {
var reportUrl = this.getUrl();
this.status = 'IN_PROGRESS';
populateReport(this, reportUrl);
},
goToReportJobs : function (user) {
console.log(user)
console.log(this.data)
if (this.searchParam.type === "BIKE_MESSENGER") {
$window.open("#/report/jobs?" + "startdate=" + this.searchParam.startdate + "&enddate="+ this.searchParam.enddate +
"&usertype=BIKE_MESSENGER" + "&userid=" + this.data[user].UserId, '_blank');
} else {
$window.open("#/report/jobs?" + "startdate=" + this.searchParam.startdate + "&enddate="+ this.searchParam.enddate + "&usertype=" + this.searchParam.type + "&username=" + user, '_blank');
}
},
exportExcel : function () {
var excelReportUrl = reportServiceUrl + "api/report?startdate="+this.searchParam.startdate+"&enddate="+this.searchParam.enddate+"&usertype="+this.searchParam.type + "&generateexcel=true";
$window.open(excelReportUrl, '_blank');
},
status : 'NONE'
}
}
return {
getReport: getReport
}
}
})();
|
package io.github.marktony.reader.qsbk;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import java.util.ArrayList;
import io.github.marktony.reader.R;
import io.github.marktony.reader.adapter.QsbkArticleAdapter;
import io.github.marktony.reader.data.Qiushibaike;
import io.github.marktony.reader.interfaze.<API key>;
import io.github.marktony.reader.interfaze.<API key>;
public class QsbkFragment extends Fragment
implements QsbkContract.View {
private QsbkContract.Presenter presenter;
private QsbkArticleAdapter adapter;
private RecyclerView recyclerView;
private SwipeRefreshLayout refreshLayout;
public QsbkFragment() {
// requires empty constructor
}
public static QsbkFragment newInstance(int page) {
return new QsbkFragment();
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.joke_list_fragment, container, false);
initViews(view);
presenter.loadArticle(true);
refreshLayout.<API key>(new SwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
presenter.loadArticle(true);
adapter.<API key>();
if (refreshLayout.isRefreshing()){
refreshLayout.setRefreshing(false);
}
}
});
recyclerView.setOnScrollListener(new RecyclerView.OnScrollListener() {
boolean isSlidingToLast = false;
@Override
public void <API key>(RecyclerView recyclerView, int newState) {
LinearLayoutManager manager = (LinearLayoutManager) recyclerView.getLayoutManager();
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
// itemposition
int lastVisibleItem = manager.<API key>();
int totalItemCount = manager.getItemCount();
if (lastVisibleItem == (totalItemCount - 1) && isSlidingToLast) {
presenter.loadMore();
}
}
super.<API key>(recyclerView, newState);
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
isSlidingToLast = dy > 0;
}
});
return view;
}
@Override
public void setPresenter(QsbkContract.Presenter presenter) {
if (presenter != null) {
this.presenter = presenter;
}
}
@Override
public void initViews(View view) {
recyclerView = (RecyclerView) view.findViewById(R.id.qsbk_rv);
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
refreshLayout = (SwipeRefreshLayout) view.findViewById(R.id.refresh);
}
@Override
public void showResult(ArrayList<Qiushibaike.Item> articleList) {
if (adapter == null) {
adapter = new QsbkArticleAdapter(getActivity(), articleList);
recyclerView.setAdapter(adapter);
} else {
adapter.<API key>();
}
adapter.<API key>(new <API key>() {
@Override
public void OnClick(View v, int position) {
presenter.shareTo(position);
}
});
adapter.<API key>(new <API key>() {
@Override
public void OnLongClick(View view, int position) {
presenter.copyToClipboard(position);
}
});
}
@Override
public void startLoading() {
refreshLayout.post(new Runnable() {
@Override
public void run() {
refreshLayout.setRefreshing(true);
}
});
}
@Override
public void stopLoading() {
refreshLayout.post(new Runnable() {
@Override
public void run() {
refreshLayout.setRefreshing(false);
}
});
}
@Override
public void showLoadError() {
Snackbar.make(recyclerView, "", Snackbar.LENGTH_SHORT)
.setAction("", new View.OnClickListener() {
@Override
public void onClick(View view) {
presenter.loadArticle(false);
}
}).show();
}
@Override
public void onResume() {
super.onResume();
presenter.start();
}
}
|
package org.gradle.test.performance.<API key>.p428;
import org.junit.Test;
import static org.junit.Assert.*;
public class Test8570 {
Production8570 objectUnderTest = new Production8570();
@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());
}
}
|
var array = trace ( new Array());
var m = trace ( 0 );
var n = trace ( 3 );
var o = trace ( 5 );
var p = trace ( 7 );
array[0] = m;
array[1] = n;
array[2] = o;
array[3] = p;
var result = new Array();
// FOR-IN Schleife
for ( i in array ) {
result.push(i);
x = i;
z = 7;
}
var a = result;
var b = result[0];
var c = 7;
var d = x;
|
title: Fall's Fabulous Floral, Fruit, and Foliage Finery
date: 2014-10-13 00:00:00 -06:00
categories:
- whats-blooming
layout: post
blog-banner: <API key>.jpg
post-date: October 13, 2014
post-time: 2:32 PM
blog-image: wbn-default.jpg
<div class="text-center">Fall weather brings about a fabulous display throughout the Garden. Many of our plants are creating a show not only with their flowers, but with their fruits and leaves as well. Be sure to take heed of the cool autumn air as it beckons you to the Garden!</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x377xRudbeckia,P20fulgida,P20var.,P20sullivantii,P20,P27Goldstrum,P27,P20Fall,P20Flower,P20Fruit,P20SQS12.jpg.pagespeed.ic.f1uSSoBXkl.jpg" width="560" height="377" alt="" title="" />
<p>Black-Eyed Susan <i> Rudbeckia fulgida</i> var. <i>sullivantii </i> 'Goldstrum'</p>
<p>Bright yellow petals adorn this perennial in the summer, but fall has given this sturdy flower a more manila appearance.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x718xDianthus,P20chinensis,P20,P27Baby,P20Doll,P27,P20Flower,P20SQS14.jpg.pagespeed.ic.NulNQJ865H.jpg" width="560" height="718" alt="" title="" />
<p>Baby Doll Dianthus <i>Dianthus chinensis</i> 'Baby Doll'</p>
<p>This diminutive Dianthus displays blooms that range from a deep rose pink to a bright white and about every shade in between.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x804xDelphinium,P20elatum,P20,P27Royal,P20Aspirations,P27,P20Flower,P20SQS14.jpg.pagespeed.ic.HiSf5VqLN4.jpg" width="560" height="804" alt="" title="" />
<p>Candle Larkspur <i> Delphinium elatum</i> 'Royal Aspirations'</p>
<p>Bold spikes of purple-blue are complemented with white centers on this dense-flowering larkspur.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x712xDatura,P20wrightii,P20Fruit,P20SQS14.jpg.pagespeed.ic.XnicWsL0jE.jpg" width="560" height="712" alt="" title="" />
<p>Sacred Datura <i> Datura wrightii</i> </p>
<p>Large, fragrant white flowers develop into decorative, but poisonous, spiky fruits on this Utah native.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x383xScabiosa,P20ochroleuca,P20Fruit,P20SQS12.jpg.pagespeed.ic.2fjs1lx_k0.jpg" width="560" height="383" alt="" title="" />
<p>Yellow Scabiosa <i> Scabiosa ochroleuca</i> </p>
<p>The multitude of spikes adorning this fun, decorative seed head give this plant it's other common name of pincushion flower.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x395xTaxus,P20x,P20media,P20,P27Hicksii,P27,P20Fruit,P20SQS14.jpg.pagespeed.ic.qczwZHOutw.jpg" width="560" height="395" alt="" title="" />
<p>Hick's Yew <i> Taxus x media</i> 'Hicksii'</p>
<p>The almost alien looking fruits of this evergreen range from bright red to opaque pink.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x383xScabiosa,P20ochroleuca,P20Fruit,P20SQS12.jpg.pagespeed.ic.2fjs1lx_k0.jpg" width="560" height="383" alt="" title="" />
<p>Yellow Scabiosa <i> Scabiosa ochroleuca</i> </p>
<p>The multitude of spikes adorning this fun, decorative seed head give this plant it's other common name of pincushion flower.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x383xScabiosa,P20ochroleuca,P20Fruit,P20SQS12.jpg.pagespeed.ic.2fjs1lx_k0.jpg" width="560" height="383" alt="" title="" />
<p>Yellow Scabiosa <i> Scabiosa ochroleuca</i> </p>
<p>The multitude of spikes adorning this fun, decorative seed head give this plant it's other common name of pincushion flower.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x395xTaxus,P20x,P20media,P20,P27Hicksii,P27,P20Fruit,P20SQS14.jpg.pagespeed.ic.qczwZHOutw.jpg" width="560" height="395" alt="" title="" />
<p>Hick's Yew <i> Taxus x media</i> 'Hicksii'</p>
<p>The almost alien looking fruits of this evergreen range from bright red to opaque pink.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x367xEuonymus,P20europaeus,P20,P27Red,P20Cascade,P27,P20Fall,P20Leaves,P20SQS12,P202.jpg.pagespeed.ic._frvi_J7Kk.jpg" width="560" height="367" alt="" title="" />
<p>Common Spindle Tree <i> Euonymus europaeus</i> 'Red Cascade'</p>
<p>The leaves of this tree become decorated with a spectacular array and design of colors in the fall.</p>
</div>
<br>
<br>
<div class="text-center">
<img src="/images/blogs/old-posts/550x563xViburnum,P20x,P20burkwoodii,P20Fall,P20Leaves,P20SQS13.JPG.pagespeed.ic.qQmTdz6e3i.jpg" width="560" height="563" alt="" title="" />
<p>Burkwood Viburnum <i>Viburnum x burkwoodii</i> </p>
<p>The leaves of this Viburnum make a lovely show of their transition from green to a deep wine-red hue.</p>
</div>
<br>
<br>
<div class="text-center">
<p>This is a spectacular time of year to visit the Garden and bask in the warmth of the sun. Don't take these autumnal opportunities for granted, winter will be here soon!</p>
</div>
<br>
<h5 class="text-center green">Photos by Sarah Sandoval</h5>
|
package com.melvin.share.ui.activity;
import android.content.Context;
import android.databinding.DataBindingUtil;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import com.bumptech.glide.Glide;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.jcodecraeer.xrecyclerview.ProgressStyle;
import com.melvin.share.R;
import com.melvin.share.Utils.ShapreUtils;
import com.melvin.share.Utils.Utils;
import com.melvin.share.databinding.<API key>;
import com.melvin.share.model.Evaluation;
import com.melvin.share.model.WaitPayOrderInfo;
import com.melvin.share.model.list.CommonList;
import com.melvin.share.model.serverReturn.CommonReturnModel;
import com.melvin.share.modelview.acti.<API key>;
import com.melvin.share.network.GlobalUrl;
import com.melvin.share.rx.RxActivityHelper;
import com.melvin.share.rx.RxFragmentHelper;
import com.melvin.share.rx.RxModelSubscribe;
import com.melvin.share.rx.RxSubscribe;
import com.melvin.share.ui.activity.common.BaseActivity;
import com.melvin.share.ui.activity.shopcar.ShoppingCarActivity;
import com.melvin.share.ui.fragment.productinfo.<API key>;
import com.melvin.share.view.MyRecyclerView;
import com.melvin.share.view.RatingBar;
import java.util.HashMap;
import java.util.Map;
import static com.melvin.share.R.id.map;
import static com.melvin.share.R.id.ratingbar;
public class <API key> extends BaseActivity {
private <API key> binding;
private Context mContext = null;
private int starCount;
private WaitPayOrderInfo.OrderBean.<API key> <API key>;
@Override
protected void initView() {
binding = DataBindingUtil.setContentView(this, R.layout.<API key>);
mContext = this;
initWindow();
initToolbar(binding.toolbar);
ininData();
}
private void ininData() {
binding.ratingbar.<API key>(new RatingBar.<API key>() {
@Override
public void onRatingChange(int var1) {
starCount = var1;
}
});
<API key> = getIntent().getParcelableExtra("<API key>");
if (<API key> != null) {
String[] split = <API key>.mainPicture.split("\\|");
if (split != null && split.length >= 1) {
String url = GlobalUrl.SERVICE_URL + split[0];
Glide.with(mContext)
.load(url)
.placeholder(R.mipmap.logo)
.centerCrop()
.into(binding.image);
}
binding.name.setText(<API key>.productName);
}
}
public void submit(View view) {
String contents = binding.content.getText().toString();
if (TextUtils.isEmpty(contents)) {
Utils.showToast(mContext, "");
}
if (starCount == 0) {
Utils.showToast(mContext, "");
}
Map map = new HashMap();
map.put("orderItemId", <API key>.id);
map.put("startlevel", starCount);
map.put("picture", <API key>.mainPicture);
map.put("content", contents);
ShapreUtils.putParamCustomerId(map);
JsonParser jsonParser = new JsonParser();
JsonObject jsonObject = (JsonObject) jsonParser.parse((new Gson().toJson(map)));
fromNetwork.<API key>(jsonObject)
.compose(new RxActivityHelper<CommonReturnModel>().ioMain(<API key>.this, true))
.subscribe(new RxSubscribe<CommonReturnModel>(mContext, true) {
@Override
protected void myNext(CommonReturnModel commonReturnModel) {
Utils.showToast(mContext, commonReturnModel.message);
finish();
}
@Override
protected void myError(String message) {
Utils.showToast(mContext, message);
}
});
}
}
|
package clockworktest.water;
import com.clockwork.app.SimpleApplication;
import com.clockwork.audio.AudioNode;
import com.clockwork.audio.LowPassFilter;
import com.clockwork.effect.ParticleEmitter;
import com.clockwork.effect.ParticleMesh;
import com.clockwork.input.KeyInput;
import com.clockwork.input.controls.ActionListener;
import com.clockwork.input.controls.KeyTrigger;
import com.clockwork.light.DirectionalLight;
import com.clockwork.material.Material;
import com.clockwork.material.RenderState.BlendMode;
import com.clockwork.math.ColorRGBA;
import com.clockwork.math.FastMath;
import com.clockwork.math.Quaternion;
import com.clockwork.math.Vector3f;
import com.clockwork.post.FilterPostProcessor;
import com.clockwork.post.filters.BloomFilter;
import com.clockwork.post.filters.DepthOfFieldFilter;
import com.clockwork.post.filters.<API key>;
import com.clockwork.renderer.Camera;
import com.clockwork.renderer.queue.RenderQueue.Bucket;
import com.clockwork.renderer.queue.RenderQueue.ShadowMode;
import com.clockwork.scene.Geometry;
import com.clockwork.scene.Node;
import com.clockwork.scene.Spatial;
import com.clockwork.scene.shape.Box;
import com.clockwork.terrain.geomipmap.TerrainQuad;
import com.clockwork.terrain.heightmap.AbstractHeightMap;
import com.clockwork.terrain.heightmap.ImageBasedHeightMap;
import com.clockwork.texture.Texture;
import com.clockwork.texture.Texture.WrapMode;
import com.clockwork.texture.Texture2D;
import com.clockwork.util.SkyFactory;
import com.clockwork.water.WaterFilter;
import java.util.ArrayList;
import java.util.List;
/**
* test
*
*/
public class TestPostWater extends SimpleApplication {
private Vector3f lightDir = new Vector3f(-4.9236743f, -1.27054665f, 5.896916f);
private WaterFilter water;
TerrainQuad terrain;
Material matRock;
AudioNode waves;
LowPassFilter <API key> = new LowPassFilter(0.5f, 0.1f);
LowPassFilter <API key> = new LowPassFilter(0.5f, 0.1f);
LowPassFilter <API key> = new LowPassFilter(1, 1);
public static void main(String[] args) {
TestPostWater app = new TestPostWater();
app.start();
}
@Override
public void simpleInitApp() {
setDisplayFps(false);
setDisplayStatView(false);
Node mainScene = new Node("Main Scene");
rootNode.attachChild(mainScene);
createTerrain(mainScene);
DirectionalLight sun = new DirectionalLight();
sun.setDirection(lightDir);
sun.setColor(ColorRGBA.White.clone().multLocal(1.7f));
mainScene.addLight(sun);
DirectionalLight l = new DirectionalLight();
l.setDirection(Vector3f.UNIT_Y.mult(-1));
l.setColor(ColorRGBA.White.clone().multLocal(0.3f));
// mainScene.addLight(l);
flyCam.setMoveSpeed(50);
//cam.setLocation(new Vector3f(-700, 100, 300));
//cam.setRotation(new Quaternion().fromAngleAxis(0.5f, Vector3f.UNIT_Z));
cam.setLocation(new Vector3f(-327.21957f, 61.6459f, 126.884346f));
cam.setRotation(new Quaternion(0.052168474f, 0.9443102f, -0.18395276f, 0.2678024f));
cam.setRotation(new Quaternion().fromAngles(new float[]{FastMath.PI * 0.06f, FastMath.PI * 0.65f, 0}));
Spatial sky = SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", false);
sky.setLocalScale(350);
mainScene.attachChild(sky);
cam.setFrustumFar(4000);
//cam.setFrustumNear(100);
//private FilterPostProcessor fpp;
water = new WaterFilter(rootNode, lightDir);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
fpp.addFilter(water);
BloomFilter bloom = new BloomFilter();
//bloom.getE
bloom.setExposurePower(55);
bloom.setBloomIntensity(1.0f);
fpp.addFilter(bloom);
<API key> lsf = new <API key>(lightDir.mult(-300));
lsf.setLightDensity(1.0f);
fpp.addFilter(lsf);
DepthOfFieldFilter dof = new DepthOfFieldFilter();
dof.setFocusDistance(0);
dof.setFocusRange(100);
fpp.addFilter(dof);
// fpp.addFilter(new <API key>());
// fpp.setNumSamples(4);
water.setWaveScale(0.003f);
water.setMaxAmplitude(2f);
water.setFoamExistence(new Vector3f(1f, 4, 0.5f));
water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
//water.setNormalScale(0.5f);
//water.<API key>(0.25f);
water.<API key>(0.2f);
//water.setFoamHardness(0.6f);
water.setWaterHeight(initialWaterHeight);
uw = cam.getLocation().y < waterHeight;
waves = new AudioNode(assetManager, "Sound/Environment/Ocean Waves.ogg", false);
waves.setLooping(true);
waves.setReverbEnabled(true);
if (uw) {
waves.setDryFilter(new LowPassFilter(0.5f, 0.1f));
} else {
waves.setDryFilter(<API key>);
}
audioRenderer.playSource(waves);
viewPort.addProcessor(fpp);
inputManager.addListener(new ActionListener() {
public void onAction(String name, boolean isPressed, float tpf) {
if (isPressed) {
if (name.equals("foam1")) {
water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam.jpg"));
}
if (name.equals("foam2")) {
water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam2.jpg"));
}
if (name.equals("foam3")) {
water.setFoamTexture((Texture2D) assetManager.loadTexture("Common/MatDefs/Water/Textures/foam3.jpg"));
}
if (name.equals("upRM")) {
water.<API key>(Math.min(water.<API key>() * 2, 4096));
System.out.println("Reflection map size : " + water.<API key>());
}
if (name.equals("downRM")) {
water.<API key>(Math.max(water.<API key>() / 2, 32));
System.out.println("Reflection map size : " + water.<API key>());
}
}
}
}, "foam1", "foam2", "foam3", "upRM", "downRM");
inputManager.addMapping("foam1", new KeyTrigger(KeyInput.KEY_1));
inputManager.addMapping("foam2", new KeyTrigger(KeyInput.KEY_2));
inputManager.addMapping("foam3", new KeyTrigger(KeyInput.KEY_3));
inputManager.addMapping("upRM", new KeyTrigger(KeyInput.KEY_PGUP));
inputManager.addMapping("downRM", new KeyTrigger(KeyInput.KEY_PGDN));
// createBox();
// createFire();
}
Geometry box;
private void createBox() {
//creating a transluscent box
box = new Geometry("box", new Box(new Vector3f(0, 0, 0), 50, 50, 50));
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.setColor("Color", new ColorRGBA(1.0f, 0, 0, 0.3f));
mat.<API key>().setBlendMode(BlendMode.Alpha);
//mat.<API key>().setDepthWrite(false);
//mat.<API key>().setDepthTest(false);
box.setMaterial(mat);
box.setQueueBucket(Bucket.Translucent);
//creating a post view port
// ViewPort post=renderManager.createPostView("transpPost", cam);
// post.setClearFlags(false, true, true);
box.setLocalTranslation(-600, 0, 300);
//attaching the box to the post viewport
//Don't forget to <API key>() the box in the simpleUpdate
// post.attachScene(box);
rootNode.attachChild(box);
}
private void createFire() {
/**
* Uses Texture from CW-test-data library!
*/
ParticleEmitter fire = new ParticleEmitter("Emitter", ParticleMesh.Type.Triangle, 30);
Material mat_red = new Material(assetManager, "Common/MatDefs/Misc/Particle.j3md");
mat_red.setTexture("Texture", assetManager.loadTexture("Effects/Explosion/flame.png"));
fire.setMaterial(mat_red);
fire.setImagesX(2);
fire.setImagesY(2); // 2x2 texture animation
fire.setEndColor(new ColorRGBA(1f, 0f, 0f, 1f)); // red
fire.setStartColor(new ColorRGBA(1f, 1f, 0f, 0.5f)); // yellow
fire.<API key>().setInitialVelocity(new Vector3f(0, 2, 0));
fire.setStartSize(10f);
fire.setEndSize(1f);
fire.setGravity(0, 0, 0);
fire.setLowLife(0.5f);
fire.setHighLife(1.5f);
fire.<API key>().<API key>(0.3f);
fire.setLocalTranslation(-350, 40, 430);
fire.setQueueBucket(Bucket.Transparent);
rootNode.attachChild(fire);
}
private void createTerrain(Node rootNode) {
matRock = new Material(assetManager, "Common/MatDefs/Terrain/TerrainLighting.j3md");
matRock.setBoolean("useTriPlanarMapping", false);
matRock.setBoolean("WardIso", true);
matRock.setTexture("AlphaMap", assetManager.loadTexture("Textures/Terrain/splat/alphamap.png"));
Texture heightMapImage = assetManager.loadTexture("Textures/Terrain/splat/mountains512.png");
Texture grass = assetManager.loadTexture("Textures/Terrain/splat/grass.jpg");
grass.setWrap(WrapMode.Repeat);
matRock.setTexture("DiffuseMap", grass);
matRock.setFloat("DiffuseMap_0_scale", 64);
Texture dirt = assetManager.loadTexture("Textures/Terrain/splat/dirt.jpg");
dirt.setWrap(WrapMode.Repeat);
matRock.setTexture("DiffuseMap_1", dirt);
matRock.setFloat("DiffuseMap_1_scale", 16);
Texture rock = assetManager.loadTexture("Textures/Terrain/splat/road.jpg");
rock.setWrap(WrapMode.Repeat);
matRock.setTexture("DiffuseMap_2", rock);
matRock.setFloat("DiffuseMap_2_scale", 128);
Texture normalMap0 = assetManager.loadTexture("Textures/Terrain/splat/grass_normal.jpg");
normalMap0.setWrap(WrapMode.Repeat);
Texture normalMap1 = assetManager.loadTexture("Textures/Terrain/splat/dirt_normal.png");
normalMap1.setWrap(WrapMode.Repeat);
Texture normalMap2 = assetManager.loadTexture("Textures/Terrain/splat/road_normal.png");
normalMap2.setWrap(WrapMode.Repeat);
matRock.setTexture("NormalMap", normalMap0);
matRock.setTexture("NormalMap_1", normalMap2);
matRock.setTexture("NormalMap_2", normalMap2);
AbstractHeightMap heightmap = null;
try {
heightmap = new ImageBasedHeightMap(heightMapImage.getImage(), 0.25f);
heightmap.load();
} catch (Exception e) {
e.printStackTrace();
}
terrain = new TerrainQuad("terrain", 65, 513, heightmap.getHeightMap());
List<Camera> cameras = new ArrayList<Camera>();
cameras.add(getCamera());
terrain.setMaterial(matRock);
terrain.setLocalScale(new Vector3f(5, 5, 5));
terrain.setLocalTranslation(new Vector3f(0, -30, 0));
terrain.setLocked(false); // unlock it so we can edit the height
terrain.setShadowMode(ShadowMode.Receive);
rootNode.attachChild(terrain);
}
//This part is to emulate tides, slightly varrying the height of the water plane
private float time = 0.0f;
private float waterHeight = 0.0f;
private float initialWaterHeight = 90f;//0.8f;
private boolean uw = false;
@Override
public void simpleUpdate(float tpf) {
super.simpleUpdate(tpf);
// box.<API key>();
time += tpf;
waterHeight = (float) Math.cos(((time * 0.6f) % FastMath.TWO_PI)) * 1.5f;
water.setWaterHeight(initialWaterHeight + waterHeight);
if (water.isUnderWater() && !uw) {
waves.setDryFilter(new LowPassFilter(0.5f, 0.1f));
uw = true;
}
if (!water.isUnderWater() && uw) {
uw = false;
//waves.setReverbEnabled(false);
waves.setDryFilter(new LowPassFilter(1, 1f));
//waves.setDryFilter(new LowPassFilter(1,1f));
}
}
}
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Document</title>
</head>
<body>
<script type="text/javascript">
window.alert("");
console.log("");
console.warn("");
console.info("");
console.error("");
document.write("");
</script>
</body>
</html>
|
package javassist.build;
/**
* A generic build exception when applying a transformer.
* Wraps the real cause of the (probably javassist) root exception.
* @author SNI
*/
@SuppressWarnings("serial")
public class <API key> extends Exception {
public <API key>() {
super();
}
public <API key>(String message, Throwable throwable) {
super(message, throwable);
}
public <API key>(String message) {
super(message);
}
public <API key>(Throwable throwable) {
super(throwable);
}
}
|
package com.hcentive.webservice.soap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
import org.springframework.ws.server.endpoint.annotation.ResponsePayload;
import com.hcentive.service.FormResponse;
import com.hcentive.webservice.exception.<API key>;
import org.apache.log4j.Logger;
/**
* @author Mebin.Jacob
*Endpoint class.
*/
@Endpoint
public final class FormEndpoint {
private static final String NAMESPACE_URI = "http://hcentive.com/service";
Logger logger = Logger.getLogger(FormEndpoint.class);
@Autowired
FormRepository formRepo;
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "FormResponse")
@ResponsePayload
public FormResponse submitForm(@RequestPayload FormResponse request) throws <API key> {
// GetCountryResponse response = new GetCountryResponse();
// response.setCountry(countryRepository.findCountry(request.getName()));
FormResponse response = null;
logger.debug("AAGAYA");
try{
response = new FormResponse();
response.setForm1(formRepo.findForm("1"));
//make API call
}catch(Exception exception){
throw new <API key>("Something went wrong!!! The exception is --- " + exception);
}
return response;
// return null;
}
}
|
namespace Microsoft.WindowsAzure.MobileServices.Eventing
{
<summary>
Represents a mobile service event.
</summary>
public interface IMobileServiceEvent
{
<summary>
Gets the event name.
</summary>
string Name { get; }
}
}
|
import { Configuration } from "./configuration";
import { ConfigurationParser } from "./<API key>";
import { <API key> } from "./<API key>";
import { ExecutionDisplay } from "./execution-display";
import { ExecutionMetrics } from "./execution-metrics";
import CustomReporter = jasmine.CustomReporter;
import SuiteInfo = jasmine.SuiteInfo;
import RunDetails = jasmine.RunDetails;
export class HtmlSpecReporter implements CustomReporter {
private started: boolean = false;
private finished: boolean = false;
private display: ExecutionDisplay;
private metrics: ExecutionMetrics;
private configuration: Configuration;
constructor(configuration?: Configuration) {
this.configuration = ConfigurationParser.parse(configuration);
this.display = new ExecutionDisplay(this.configuration);
this.metrics = new ExecutionMetrics();
}
public jasmineStarted(suiteInfo: SuiteInfo): void {
this.started = true;
this.metrics.start(suiteInfo);
this.display.jasmineStarted(suiteInfo);
}
public jasmineDone(runDetails: RunDetails): void {
this.metrics.stop(runDetails);
this.display.summary(runDetails, this.metrics);
this.finished = true;
}
public suiteStarted(result: <API key>): void {
this.display.suiteStarted(result);
}
public suiteDone(result: <API key>): void {
this.display.suiteDone();
}
public specStarted(result: <API key>): void {
this.metrics.startSpec();
this.display.specStarted(result);
}
public specDone(result: <API key>): void {
this.metrics.stopSpec(result);
if (result.status === "pending") {
this.metrics.pendingSpecs++;
this.display.pending(result);
} else if (result.status === "passed") {
this.metrics.successfulSpecs++;
this.display.successful(result);
} else if (result.status === "failed") {
this.metrics.failedSpecs++;
this.display.failed(result);
}
this.display.specDone(result);
}
}
|
#! /usr/bin/python
import sys
import os
import json
import grpc
import time
import subprocess
from google.oauth2 import service_account
import google.oauth2.credentials
import google.auth.transport.requests
import google.auth.transport.grpc
from google.firestore.v1beta1 import firestore_pb2
from google.firestore.v1beta1 import firestore_pb2_grpc
from google.firestore.v1beta1 import document_pb2
from google.firestore.v1beta1 import document_pb2_grpc
from google.firestore.v1beta1 import common_pb2
from google.firestore.v1beta1 import common_pb2_grpc
from google.firestore.v1beta1 import write_pb2
from google.firestore.v1beta1 import write_pb2_grpc
from google.protobuf import empty_pb2
from google.protobuf import timestamp_pb2
def first_message(database, write):
messages = [
firestore_pb2.WriteRequest(database = database, writes = [])
]
for msg in messages:
yield msg
def generate_messages(database, writes, stream_id, stream_token):
# writes can be an array and append to the messages, so it can write multiple Write
# here just write one as example
messages = [
firestore_pb2.WriteRequest(database=database, writes = []),
firestore_pb2.WriteRequest(database=database, writes = [writes], stream_id = stream_id, stream_token = stream_token)
]
for msg in messages:
yield msg
def main():
fl = os.path.dirname(os.path.abspath(__file__))
fn = os.path.join(fl, 'grpc.json')
with open(fn) as grpc_file:
item = json.load(grpc_file)
creds = item["grpc"]["Write"]["credentials"]
credentials = service_account.Credentials.<API key>("{}".format(creds))
scoped_credentials = credentials.with_scopes(['https:
http_request = google.auth.transport.requests.Request()
channel = google.auth.transport.grpc.<API key>(scoped_credentials, http_request, 'firestore.googleapis.com:443')
stub = firestore_pb2_grpc.FirestoreStub(channel)
database = item["grpc"]["Write"]["database"]
name = item["grpc"]["Write"]["name"]
first_write = write_pb2.Write()
responses = stub.Write(first_message(database, first_write))
for response in responses:
print("Received message %s" % (response.stream_id))
print(response.stream_token)
value_ = document_pb2.Value(string_value = "foo_boo")
update = document_pb2.Document(name=name, fields={"foo":value_})
writes = write_pb2.Write(update_mask=common_pb2.DocumentMask(field_paths = ["foo"]), update=update)
r2 = stub.Write(generate_messages(database, writes, response.stream_id, response.stream_token))
for r in r2:
print(r.write_results)
if __name__ == "__main__":
main()
|
package com.google.api.ads.adwords.jaxws.v201509.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SharedCriterion", propOrder = {
"sharedSetId",
"criterion",
"negative"
})
public class SharedCriterion {
protected Long sharedSetId;
protected Criterion criterion;
protected Boolean negative;
/**
* Gets the value of the sharedSetId property.
*
* @return
* possible object is
* {@link Long }
*
*/
public Long getSharedSetId() {
return sharedSetId;
}
/**
* Sets the value of the sharedSetId property.
*
* @param value
* allowed object is
* {@link Long }
*
*/
public void setSharedSetId(Long value) {
this.sharedSetId = value;
}
/**
* Gets the value of the criterion property.
*
* @return
* possible object is
* {@link Criterion }
*
*/
public Criterion getCriterion() {
return criterion;
}
/**
* Sets the value of the criterion property.
*
* @param value
* allowed object is
* {@link Criterion }
*
*/
public void setCriterion(Criterion value) {
this.criterion = value;
}
/**
* Gets the value of the negative property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isNegative() {
return negative;
}
/**
* Sets the value of the negative property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setNegative(Boolean value) {
this.negative = value;
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.