Middleware
Cli
The Cli
middleware uses commander.js
modules to parse the input of the user. The middleware itself doesn't bind
anything to the PopApi
instance, instead it parses the input and run the API
accordingly.
import { PopApi, Cli, Logger } from 'pop-api'
import { name, version } from './package.json'
const cliOpts = {
name, // The name of your application
version, // The version of your application
argv: process.argv // The arguments to parse
}
PopApi.use(Cli, cliOpts)
// Parsed the input given and binds options for the `Logger` middleware.
// See the documentation for the `Logger` middleware for more options.
const { pretty, quiet } = PopApi.loggerArgs
PopApi.use(Logger, {
pretty,
quiet
})
Database
The Database
middleware bind the database
key to the PopApi
instance.
This middleware allows you to connect()
and disconnect()
from MongoDB
through mongoose
, and you can
export and import a collection with the
exportCollection(collection, outputFile)
and
importCollection(collection, jsonFile)
methods. The example below uses a
.env
file to store the optional username
and password
values to establish
a connection with MongoDB.
# .env
# (Optional) Assuming you use the `dotenv` modules to get your username and
# password for the database connection
DATABASE_USERNAME=myUsername
DATABASE_PASSWORD=myPassword
Now setup the Database
middleware:
// (Optional) Assuming you use the `dotenv` modules to get your username and
// password for the database connection
import 'dotenv/config'
import { PopApi, Database } from 'pop-api'
import MyModel from './MyModel'
import { name } from './package.json'
const databaseOpts = {
database: name, // The name of the database.
hosts: ['localhost'], // A lst of hosts to connect to.
dbPort: 27017, // (Optional) The port of MongoDB.
username: process.env.DATABASE_USERNAME, // (Optional) The username to
// connect to the hosts.
password: process.env.DATABASE_PASSWORD // (Optional) The password to
// connect to the hosts.
}
PopApi.use(Database, databaseOpts)
// The database middleware can now be used to connect to the MongoDB database.
PopApi.database.connect()
.then(() => {
// Connection successful!
return new MyModel({
_id: 'John',
name: 'John',
slug: 'john'
}).save()
})
.catch(err => {
// Handle error
})
.then(() => {
// Disconnect from MongoDB.
PopApi.database.disconnect()
})
HttpServer
The HttpServer
middleware forks workers so heavy load process can run on
different child processes. It also makes the
express
app listen on a port.
import { PopApi, HttpServer } from 'pop-api'
const httpServerOpts = {
app: PopApi.app, // The express instance from PopApi.
serverPort: 5000, // The port your API will be running on.
workers: 2 // The amount of workers to fork.
}
PopApi.use(HttpServer, httpServerOpts)
// Doesn't bind anything to the PopApi instance, just forks the workers and
// makes the app listen on your configured port.
Logger
The Logger
middleware uses the
winston
module to create a global
logger
object. This logger
object has various levels to log, such as
debug
, info
, warn
and error
. This middleware also binds an
express
middleware function to log
the routes.
import { PopApi, Logger } from 'pop-api'
import { join } from 'path'
import { name } from './package.json'
const loggerOpts = {
name, // The name of the log file.
logDir: join(...[__dirname, 'tmp']), // The directory to store the logs in.
pretty: true, // (Optional) Pretty output mode.
quiet: false // (Optional) Quiet mode for no output.
}
PopApi.use(Logger, loggerOpts)
logger.info('\logger\' will be a global object')
// Other log levels you can use are:
// - logger.debug()
// - logger.info()
// - logger.warn()
// - logger.error()
// Log middleware for logging routes, used by the `Routes` middleware, or set
// it yourself.
const { httpLogger } = PopApi
PopApi.app.use(httpLogger)
Routes
The Routes
middleware configures the
express
instance. It sets up the
body-parser
and
compression
middleware, as well as
the error and security middleware. Thirdly it registers the controllers with
their routes.
import { PopApi, Routes } from 'pop-api'
import MyRouteController from './MyRouteController'
const routesOpts = {
app: PopApi.app, // The express instance from PopApi.
controllers: [{ // A list of controllers to register.
Controller: MyRouteController, // The controller you want to register.
args: {} // The arguments to pass down to the
// MyRouteController.
}]
}
PopApi.use(Routes, routesOpts)
// Doesn't bind anything to the PopApi instance, just configures the middleware
// for express and registers the controllers.
Custom Middleware
The init
method will register the default Cli, Database, Logger, Routes and
Server middleware, but you can also extends the functionality of pop-api
by
using your own middleware. In the middleware example below we create a
middleware class which will only hold a simple greeting.
// ./MyMiddleware.js
export default class MyMiddleware {
// The first parameter will be the 'PopApi' instance, the second will be an
// object you can use to configure your middleware.
constructor(PopApi, {name}) {
this.name = name
PopApi.myMiddleware = this.myMiddleware()
}
myMiddleware() {
return `Hello, ${this.name}`
}
}
To use the middleware we created you call the use
method. The first parameter
will be the middleware class you want to create, the second parameter is
optional, but can be used to configure your middleware.
// ./index.js
import { PopApi } from 'pop-api'
import MyMiddleware from './MyMiddleware'
// Use the middleware you created.
PopApi.use(MyMiddleware, {
name: 'John'
})
// The middleware will be bound to the 'PopApi' instance.
const greeting = PopApi.myMiddleware
console.log(greeting) // Hello, John


You've started the Chicago Bar Crawl app!
Once the application has been compiled and the server started, your application can be accessed at:
http://localhost:9000
Check in Run to see the server status.
The first thing you will see is the map of Chicago Wrigleyville neighborhood, centered around Wrigley Field. Double click anywhere on the map to generate a bar crawl route starting at that location.
The app shows how to use Play Framework, Spring and Open Street Map data to create a simple GIS application.
The architecture of the app is very simple - it receive an AJAX request from the browser with starting bar crawl location, loads all the street segments within a mile of that location from an embedded GeoDB database, queries Foursquare to get all the bars in the same area, and then produces a path that tries to maximize the number of popular bars on it.
The app comes with an embedded GeoDB database that contains all the street segments for Chicago. To generate it, we've downloaded the map of Chicago from Open Street Map, and then converted it into routable street segments by using osm2po library. As a result, we have a graph representation of all the streets (walk_2po.gph), as well as a sql script to load the streets into a database for proximity querying.
We use Spring to wire everything together. Main
Application controller relies on @Autowired
RouteProvider,
TourGuide and
ZoneService services
to produce the final route.
We use annotation-based Spring config. To setup it up with Play, we need to override onStart()
method
Global to initialize ApplicationContext
with
AppConfig and
DataConfig that setup our
Spring Data JPA repository and
our DB dataSource
.
Through StreetRepository we get all the street segments within a mile of our location. PlaceService fetches all bars within a mile of our location. Both of these are called in parallel in ZoneService, and we end up with a Zone object which contains a mapping of street segments to all bars located on a particular street. To get this mapping, we're "pulling" each bar to the nearest street with the help of GeoTools library.


Tests
run QUnit test suite
Run automated tests
Run interactive tests
Clear tests
Input
choose an API call to make
Module
Method
Run!
Output
results from the API call, most recent at the top


Accepted Formats: {{ allowedTypes.join(', ') }}
Max file size: {{ maxSize | fileSize }}
Drag and drop a file here or


Object
Class containing the main logic
Saves a checkpoint
# File lib/repomate/checkpoint.rb, line 33 33: def create 34: datetime = DateTime.now 35: source_category = "dists" 36: 37: Architecture.dataset(source_category).each do |entry| 38: source = Architecture.new(entry[:architecture], entry[:component], entry[:suitename], source_category) 39: source.files.each do |fullname| 40: basename = File.basename(fullname) 41: 42: sql = "insert into checkpoints values ( 43: '#{datetime}', 44: '#{entry[:suitename]}', 45: '#{entry[:component]}', 46: '#{entry[:architecture]}', 47: '#{basename}')" 48: 49: @cpdb.query(sql) 50: end 51: end 52: 53: puts "Checkpoint (#{datetime.strftime("%F %T")}) saved" 54: end
Create the checkpoint table
# File lib/repomate/checkpoint.rb, line 21 21: def create_table 22: sql = "create table if not exists checkpoints ( 23: date varchar(25), 24: suitename varchar(10), 25: component varchar(10), 26: architecture varchar(10), 27: basename varchar(70))" 28: 29: @cpdb.query(sql) 30: end
Deletes a package from checkpoint table
# File lib/repomate/checkpoint.rb, line 99 99: def delete_package(entry) 100: sql = "delete from checkpoints where 101: basename = '#{entry[:basename]}' and 102: suitename = '#{entry[:suitename]}' and 103: component = '#{entry[:component]}' and 104: architecture = '#{entry[:architecture]}'" 105: 106: @cpdb.query(sql) 107: end
Returns a list of checkpoints for the cli
# File lib/repomate/checkpoint.rb, line 110 110: def list 111: order = 0 112: dates = [] 113: list = {} 114: 115: @cpdb.query("select date from checkpoints group by date order by date asc").each do |row| 116: dates << row.first 117: end 118: 119: dates.each do |date| 120: order += 1 121: list[order] = date 122: end 123: 124: list 125: end
Loads a checkpoint
# File lib/repomate/checkpoint.rb, line 57 57: def load(number) 58: cplist = list 59: link_workload = [] 60: unlink_workload = [] 61: source_category = "dists" 62: 63: Architecture.dataset(source_category).each do |entry| 64: destination = Architecture.new(entry[:architecture], entry[:component], entry[:suitename], source_category) 65: destination.files.each do |fullname| 66: unlink_workload << { 67: :destination_fullname => fullname, 68: :component => entry[:component], 69: :suitename => entry[:suitename], 70: :architecture => entry[:architecture] 71: } 72: end 73: end 74: 75: @cpdb.query("select date, suitename, component, architecture, basename from checkpoints").each do |row| 76: if row[0] == cplist[number] 77: suitename = row[1] 78: component = row[2] 79: architecture = row[3] 80: basename = row[4] 81: source = Architecture.new(architecture, component, suitename, "pool") 82: destination = Architecture.new(architecture, component, suitename, "dists") 83: 84: link_workload << { 85: :source_fullname => File.join(source.directory, basename), 86: :destination_fullname => File.join(destination.directory, basename), 87: :component => component, 88: :suitename => suitename, 89: :architecture => architecture 90: } 91: end 92: end 93: 94: @link.destroy(unlink_workload) 95: @link.create(link_workload) 96: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.


{% extends '_layouts/layout_2-3_1-3_hybrid.html' %} {% block page_title %} Hybrid {% endblock page_title %} {% block pageTitle %} Kenyon Medical Centres: Brandon Road {% endblock pageTitle %} {% block content %} {% include '_includes/archive/06-02-17-testing/hybrid/accepting-patients.html' %} {% include '_includes/archive/06-02-17-testing/hybrid/location.html' %} {% include '_includes/archive/06-02-17-testing/hybrid/reception-opening-times.html' %}


{% extends 'rvfsite/base.html' %} {% block title %} 500 Server Error {% endblock %} {% block body %}
There was an error on our end processing your request.


|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
|---|---|
| DifferentiableMultivariateRealOptimizer | This interface represents an optimization algorithm for
scalar differentiable objective
functions . |
| DifferentiableMultivariateVectorialOptimizer | This interface represents an optimization algorithm for vectorial differentiable objective functions . |
| MultivariateRealOptimizer | This interface represents an optimization algorithm for scalar objective functions . |
| RealConvergenceChecker | This interface specifies how to check if an optimization
algorithm has converged. |
| UnivariateRealOptimizer | Interface for (univariate real) optimization algorithms. |
| VectorialConvergenceChecker | This interface specifies how to check if a optimization algorithm has converged. |
| Class Summary | |
|---|---|
| LeastSquaresConverter | This class converts vectorial
objective functions to scalar objective functions
when the goal is to minimize them. |
| MultiStartDifferentiableMultivariateRealOptimizer | Special implementation of the DifferentiableMultivariateRealOptimizer interface adding
multi-start features to an existing optimizer. |
| MultiStartDifferentiableMultivariateVectorialOptimizer | Special implementation of the DifferentiableMultivariateVectorialOptimizer interface adding
multi-start features to an existing optimizer. |
| MultiStartMultivariateRealOptimizer | Special implementation of the MultivariateRealOptimizer interface adding
multi-start features to an existing optimizer. |
| MultiStartUnivariateRealOptimizer | Special implementation of the UnivariateRealOptimizer interface adding
multi-start features to an existing optimizer. |
| RealPointValuePair | This class holds a point and the value of an objective function at this point. |
| SimpleRealPointChecker | Simple implementation of the RealConvergenceChecker interface using
only point coordinates. |
| SimpleScalarValueChecker | Simple implementation of the RealConvergenceChecker interface using
only objective function values. |
| SimpleVectorialPointChecker | Simple implementation of the VectorialConvergenceChecker interface using
only point coordinates. |
| SimpleVectorialValueChecker | Simple implementation of the VectorialConvergenceChecker interface using
only objective function values. |
| VectorialPointValuePair | This class holds a point and the vectorial value of an objective function at this point. |
| Enum Summary | |
|---|---|
| GoalType | Goal type for an optimization problem. |
| Exception Summary | |
|---|---|
| OptimizationException | Deprecated. in 2.2 (to be removed in 3.0). |
This package provides common interfaces for the optimization algorithms
provided in sub-packages. The main interfaces defines optimizers and convergence
checkers. The functions that are optimized by the algorithms provided by this
package and its sub-packages are a subset of the one defined in the analysis
package, namely the real and vector valued functions. These functions are called
objective function here. When the goal is to minimize, the functions are often called
cost function, this name is not used in this package.
Optimizers are the algorithms that will either minimize or maximize, the objective function by changing its input variables set until an optimal set is found. There are only four interfaces defining the common behavior of optimizers, one for each supported type of objective function:
UnivariateRealOptimizer
for univariate real functions
MultivariateRealOptimizer
for multivariate real functions
DifferentiableMultivariateRealOptimizer
for differentiable multivariate real functions
DifferentiableMultivariateVectorialOptimizer
for differentiable multivariate vectorial functions
Despite there are only four types of supported optimizers, it is possible to optimize a
transform a non-differentiable multivariate vectorial function
by converting it to a non-differentiable multivariate
real function
thanks to the LeastSquaresConverter
helper class.
The transformed function can be optimized using any implementation of the MultivariateRealOptimizer
interface.
For each of the four types of supported optimizers, there is a special implementation which wraps a classical optimizer in order to add it a multi-start feature. This feature call the underlying optimizer several times in sequence with different starting points and returns the best optimum found or all optima if desired. This is a classical way to prevent being trapped into a local extremum when looking for a global one.
|
||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |


--- layout: page description: "" title: "Publications" background: "img/yoda_pubs.jpg" ---
Return Dispersion as an Estimator of Learning Potential for Prioritized Level Replay
Iryna Korshunova, Minqi Jiang, Jack Parker-Holder, Tim Rocktäschel, Edward Grefenstette
I Can't Believe It's Not Better! and Deep RL workshops at NeurIPS 2021
openreview
poster
A Closer Look at the Adversarial Robustness of Information Bottleneck Models
Iryna Korshunova, David Stutz, Alexander A. Alemi, Olivia Wiles, Sven Gowal
Workshop on Adversarial Machine Learning at ICML 2021
openreview
poster
BRUNO: Exchangeable Deep Learning Models of Predictive Distributions
Iryna Korshunova
PhD thesis, 2020
pdf
Exchangeable Models in Meta Reinforcement Learning
Iryna Korshunova, Jonas Degrave, Joni Dambre, Arthur Gretton, Ferenc Huszar
4th Lifelong Learning Workshop at ICML 2020
openreview
code
Discriminative Topic Modeling with Logistic LDA
Iryna Korshunova, Hanchen Xiong, Mateusz Fedoryszak, Lucas Theis
Neural Information Processing Systems (NeurIPS), 2019
arxiv
poster
code
BRUNO: A Deep Recurrent Model for Exchangeable Data
Iryna Korshunova, Jonas Degrave, Ferenc Huszár, Yarin Gal, Arthur Gretton, Joni Dambre
Neural Information Processing Systems (NIPS), 2018
arxiv
blog
poster
slides
code
Conditional BRUNO: A Deep Recurrent Process for Exchangeable Labelled Data
Iryna Korshunova, Yarin Gal, Joni Dambre, Arthur Gretton
Bayesian Deep Learning NIPS workshop, 2018 and ESANN 2019
pdf
poster
code
Faster gaze prediction with dense networks and Fisher pruning
Lucas Theis, Iryna Korshunova, Alykhan Tejani, Ferenc Huszár
arXiv:1801.05787, 2018
arxiv
blog
Fast face-swap using convolutional neural networks
Iryna Korshunova, Wenzhe Shi, Joni Dambre, Lucas Theis
International Conference on Computer Vision (ICCV), 2017
arxiv
poster
Towards improved design and evaluation of epileptic seizure predictors
Iryna Korshunova, Pieter-Jan Kindermans, Jonas Degrave, Thibault Verhoeven, Benjamin H Brinkmann, Joni Dambre
IEEE Transactions on Biomedical Engineering, 65(3), 502-510, 2018
arxiv
pdf
code
Crowdsourcing reproducible seizure forecasting in human and canine epilepsy
Benjamin H Brinkmann, Joost Wagenaar, Drew Abbot, Phillip Adkins, Simone C Bosshard, Min Chen, Quang M Tieng, Jialune He, FJ Muñoz-Almaraz, Paloma Botella-Rocamora, Juan Pardo, Francisco Zamora-Martinez, Michael Hills, Wei Wu, Iryna Korshunova, Will Cukierski, Charles Vite, Edward E Patterson, Brian Litt, Gregory A Worrell
Brain, 139(6), 1713-1722, 2016
arxiv
blog
code
Music transcription modelling and composition using deep learning
Bob Sturm, Joao Felipe Santos, Oded Ben-Tal, Iryna Korshunova
arXiv:1604.08723, 2016
arxiv
code
Folk music style modelling by recurrent neural networks with long short term memory units
Bob Sturm, Joao Felipe Santos, Iryna Korshunova
International Society for Music Information Retrieval Conference (late-breaking demo), 2015
pdf
code


Intro
For this week’s analysis, I will be looking at the website for Michelberger, a hotel located in Berlin, Germany described on its own page as an “independent hotel with character and attitude: creative, unique, and personal.” Their website certainly suggests so for better or worse. The websites main purpose is for booking and basic hotel information, something that gets muddled by certain design choices.
I will start by saying that there are a lot of things I like about this website. There are some truly fascinating elements that I think really make this hotel website stand out from other cookie cutter chains. However, there are certain design elements that could potentially render the site unusable to certain users as well as other issues that could cause confusion or deter someone’s booking experience.
For this usability analysis, I will critique these four design principles: strategic color usage, simple interface, consistent UI, and UX.
Strategic Color Usage
One glaring example of how color can render a site unusable is the splash page. You are greeted by an unsuspecting but once you click on your mouse, all hell breaks loose, and the page cycles through various colors for a few seconds and takes you to the home page. I generally keep the brightness on my screens low but for those who are sensitive to light, this website could be a health hazard.
Honestly, the easiest and only fix should probably be getting rid of this splash page. On the flip side, the website does well in changing the color of the pages depending on where on the site you are. It’s almost as if the mood of the page changes with the change in color scheme. The contents of the website are basic, with text and images being very minimal, but the simple act of changing color makes it feel like more is going on in a good way.
Simple Interface
Michelberger runs into an issue where they have two different navigation options. The menu button works well, and sub-menus are shown when appropriate. Users can see where they are in relation to the menu with an arrow pointing this out. In the grand scheme of things, the website is not big so having an expanding menu is not over-bearing on the page.
The other navigation/menu option is to scroll through the home page and click on the title. This ends up being too cumbersome, especially given the fact that once you have committed to a sub-page, you must use the menu described above to navigate through the rest. So why have this form of navigation in the first place if you must default to the superior navigation menu? My fix for this would be giving the user an option to scroll down to the next sub-page or having the menu button being the only form of navigation.
Consistent UI and UX
Expanding further on the interface, the inconsistency between the two navigation methods lead to an even more inconsistent user experience. I would much rather use the menu navigation to get to where I need, whereas scrolling through the home page becomes a chore. The scrolling methods, in my opinion, seems like it was only added to show changes in color gradience between menu items. Where color was a positive (excluding the splash page) before, it is now another detriment to the website.
One thing that is consistent in the interface and the experience is that booking a room is always one click away. There is either a “Book a room” clickable item on the top-right hand side of the page or an option to book dates front and center in the “Rooms” page.
Conclusions
The booking experience is the best part of this website and the focal point of this business. I would like to see this booking UI at the forefront. It is a clean and usable interface that should really shine but it is deterred by design choices.
There are quite a few instances where it seems like the design of this page was designed for the sake of "design." This is a hotel that is clearly aimed towards eclectic people but even eclectic people need to know how to navigate and book rooms, without the website confusing them or in extreme cases, possibly inducing seizures.


Make order
Statistics
Period
Specify the period for calculating statistics.
from
to
Show
Statistics
Brand
Number
Count of orders
BMW
3909 AB-1
0


Thanks for checking out with Parcel For Me. You can easily keep track of you orders, delivery details & purchase history with the Parcel For Me mobile app.


Bitcoin and Lightning are of course #1 and #2 highest priority projects, but Bisq and BTCPay are #3 and #4. Eventually all centralized companies sell out and require KYC, but Bisq and BTCPay are not companies, they are open-source projects just like Bitcoin, and cannot bet...


5 Ways to Do Machine Learning from the Browser with React
By: Nick Walsh & Nicki Klein
Technical Evangelists at AWS
@thenickwalsh & @nicki_23
What is Machine Learning?
Machine learning API's?
How? What does that cost? Is it easy?
Amazon Comprehend
Sentiment analysis from an API
How does sentiment analysis work?
Amazon Polly
Synthesize text to speech
Difficulty behind creating quality TTS (text to speech)
We don't want it to sound like a robot!
Amazon Translate
Translate text to other languages
How does translation work under the hood?
Amazon Transcribe
Transcribe audio to text
Analyzing speech, under the hood
Amazon Rekognition
Image recognition from the browser
How does image recognition work?
To learn more:
https://aws.amazon.com/machine-learning/
@TheNickWalsh & @nicki_23


public static class JMemoryPool.Block extends JMemory
allocate(int)
.
JMemory.Type
| ���������� | �ֶκ�˵�� |
|---|---|
private int |
available
How many bytes are available for allocation in this current
block.
|
private long |
createdOn
The created on.
|
private int |
current
Position into the block where the next available byte resides.
|
JNETPCAP_LIBRARY_NAME,
MAX_DIRECT_MEMORY_DEFAULT,
physical, POINTER, size
| ��������˵�� |
|---|
Block(int size)
Constructor for allocating a block of a requested size.
|
Block(JMemory peer)
Peers this block with another memory object.
|
| ���������� | ������˵�� |
|---|---|
int |
allocate(int size)
Allocates requested size number of bytes from existing memory
block.
|
void |
free(int offset,
int length)
Frees the existing memory to be put back in the memory pool.
|
java.lang.String |
toString()
To string.
|
availableDirectMemory,
check, cleanup, createReference,
isInitialized,
isJMemoryBasedOwner,
isOwner, maxDirectMemory,
parseSize,
peer,
peer,
peer,
reservedDirectMemory,
setSize, size, softDirectMemory,
toDebugString,
toHexdump, toHexdump,
totalActiveAllocated,
totalAllocateCalls,
totalAllocated,
totalAllocatedSegments0To255Bytes,
totalAllocatedSegments256OrAbove,
totalDeAllocateCalls,
totalDeAllocated,
transferFrom,
transferFrom,
transferFrom,
transferFrom,
transferFromDirect,
transferOwnership,
transferTo,
transferTo,
transferTo,
transferTo,
transferTo,
transferTo,
transferTo,
transferTo0
private int available
private int current
private final long createdOn
Block(int size)
size
- number of bytes to allocate for this blockBlock(JMemory peer)
peer
- memory object to peer withpublic int allocate(int size)
size
- number of bytespublic void free(int offset, int length)
offset
- the offsetlength
- the lengthpublic java.lang.String toString()
toString
������ java.lang.Object
Object.toString()


The cart Example
The cart example represents a shopping cart in an online bookstore and uses a stateful session bean to manage the operations of the shopping cart. The bean’s client can add a book to the cart, remove a book, or retrieve the cart’s contents. To assemble cart, you need the following code:
Session bean class (CartBean)
Remote business interface (Cart)
All session beans require a session bean class. All enterprise beans that permit remote access must have a remote business interface. To meet the needs of a specific application, an enterprise bean may also need some helper classes. The CartBean session bean uses two helper classes, BookException and IdVerifier, which are discussed in the section Helper Classes.
The source code for this example is in the tut-install/examples/ejb/cart/ directory.
The Business Interface
The Cart business interface is a plain Java interface that defines all the business methods implemented in the bean class. If the bean class implements a single interface, that interface is assumed to the business interface. The business interface is a local interface unless it is annotated with the javax.ejb.Remote annotation; the javax.ejb.Local annotation is optional in this case.
The bean class may implement more than one interface. In that case, the business interfaces must either be explicitly annotated @Local or @Remote or be specified by decorating the bean class with @Local or @Remote. However, the following interfaces are excluded when determining whether the bean class implements more than one interface:
java.io.Serializable
java.io.Externalizable
Any of the interfaces defined by the javax.ejb package
The source code for the Cart business interface follows:
package cart.ejb; import cart.util.BookException; import java.util.List; import javax.ejb.Remote; @Remote public interface Cart { public void initialize(String person) throws BookException; public void initialize(String person, String id) throws BookException; public void addBook(String title); public void removeBook(String title) throws BookException; public List<String> getContents(); public void remove(); }
Session Bean Class
The session bean class for this example is called CartBean. Like any stateful session bean, the CartBean class must meet the following requirements.
The class implements the business methods defined in the business interface.
Stateful session beans also may
Implement the business interface, a plain Java interface. It is good practice to implement the bean’s business interface.
Implement any optional lifecycle callback methods, annotated @PostConstruct, @PreDestroy, @PostActivate, and @PrePassivate.
The source code for the CartBean class follows:
package cart.ejb; import cart.util.BookException; import cart.util.IdVerifier; import java.util.ArrayList; import java.util.List; import javax.ejb.Remove; import javax.ejb.Stateful; @Stateful public class CartBean implements Cart { String customerName; String customerId; List<String> contents; public void initialize(String person) throws BookException { if (person == null) { throw new BookException("Null person not allowed."); } else { customerName = person; } customerId = "0"; contents = new ArrayList<String>(); } public void initialize(String person, String id) throws BookException { if (person == null) { throw new BookException("Null person not allowed."); } else { customerName = person; } IdVerifier idChecker = new IdVerifier(); if (idChecker.validate(id)) { customerId = id; } else { throw new BookException("Invalid id: " + id); } contents = new ArrayList<String>(); } public void addBook(String title) { contents.add(title); } public void removeBook(String title) throws BookException { boolean result = contents.remove(title); if (result == false) { throw new BookException(title + " not in cart."); } } public List<String> getContents() { return contents; } @Remove public void remove() { contents = null; } }
Lifecycle Callback Methods
A method in the bean class may be declared as a lifecycle callback method by annotating the method with the following annotations:
javax.annotation.PostConstruct: Methods annotated with @PostConstruct are invoked by the container on newly constructed bean instances after all dependency injection has completed and before the first business method is invoked on the enterprise bean.
javax.annotation.PreDestroy: Methods annotated with @PreDestroy are invoked after any method annotated @Remove has completed and before the container removes the enterprise bean instance.
javax.ejb.PostActivate: Methods annotated with @PostActivate are invoked by the container after the container moves the bean from secondary storage to active status.
javax.ejb.PrePassivate: Methods annotated with @PrePassivate are invoked by the container before it passivates the enterprise bean, meaning that the container temporarily removes the bean from the environment and saves it to secondary storage.
Lifecycle callback methods must return void and have no parameters.
Business Methods
The primary purpose of a session bean is to run business tasks for the client. The client invokes business methods on the object reference it gets from dependency injection or JNDI lookup. From the client’s perspective, the business methods appear to run locally, although they run remotely in the session bean. The following code snippet shows how the CartClient program invokes the business methods:
cart.create("Duke DeEarl", "123"); ... cart.addBook("Bel Canto"); ... List<String> bookList = cart.getContents(); ... cart.removeBook("Gravity’s Rainbow");
The CartBean class implements the business methods in the following code:
public void addBook(String title) { contents.addElement(title); } public void removeBook(String title) throws BookException { boolean result = contents.remove(title); if (result == false) { throw new BookException(title + "not in cart."); } } public List<String> getContents() { return contents; }
The signature of a business method must conform to these rules.
The method name must not begin with ejb, to avoid conflicts with callback methods defined by the EJB architecture. For example, you cannot call a business method ejbCreate or ejbActivate.
The access control modifier must be public.
If the bean allows remote access through a remote business interface, the arguments and return types must be legal types for the Java Remote Method Invocation (RMI) API.
If the bean is a web service endpoint, the arguments and return types for the methods annotated @WebMethod must be legal types for JAX-WS.
The modifier must not be static or final.
The throws clause can include exceptions that you define for your application. The removeBook method, for example, throws a BookException if the book is not in the cart.
To indicate a system-level problem, such as the inability to connect to a database, a business method should throw a javax.ejb.EJBException. The container will not wrap application exceptions, such as BookException. Because EJBException is a subclass of RuntimeException, you do not need to include it in the throws clause of the business method.
The @Remove Method
Business methods annotated with javax.ejb.Remove in the stateful session bean class can be invoked by enterprise bean clients to remove the bean instance. The container will remove the enterprise bean after a @Remove method completes, either normally or abnormally.
In CartBean, the remove method is a @Remove method:
@Remove public void remove() { contents = null; }
Helper Classes
The CartBean session bean has two helper classes: BookException and IdVerifier. The BookException is thrown by the removeBook method, and the IdVerifier validates the customerId in one of the create methods. Helper classes may reside in an EJB JAR file that contains the enterprise bean class, a WAR file if the enterprise bean is packaged within a WAR, or in an EAR that contains an EJB JAR or a WAR file that contains an enterprise bean.
Building, Packaging, Deploying, and Running the cart Example
Now you are ready to compile the remote interface (Cart.java), the home interface (CartHome.java), the enterprise bean class (CartBean.java), the client class (CartClient.java), and the helper classes (BookException.java and IdVerifier.java). Follow these steps.
You can build, package, deploy, and run the cart application using either NetBeans IDE or the Ant tool.
To Build, Package, Deploy, and Run the cart Example Using NetBeans IDE
- From the File menu, choose Open Project.
- In the Open Project dialog, navigate to:
tut-install/examples/ejb/
- Select the cart folder.
- Select the Open as Main Project and Open Required Projects check boxes.
- Click Open Project.
- In the Projects tab, right-click the cart project and select Deploy.
This builds and packages the application into cart.ear, located in tut-install/examples/ejb/cart/dist/, and deploys this EAR file to your GlassFish Server instance.
- From the Run menu, choose Run Main Project.
You will see the output of the cart application client in the Output pane:
... Retrieving book title from cart: Infinite Jest Retrieving book title from cart: Bel Canto Retrieving book title from cart: Kafka on the Shore Removing "Gravity’s Rainbow" from cart. Caught a BookException: "Gravity’s Rainbow" not in cart. Java Result: 1 run-cart-app-client: run-nb: BUILD SUCCESSFUL (total time: 14 seconds)
To Build, Package, Deploy, and Run the cart Example Using Ant
- In a terminal window, go to:
tut-install/examples/ejb/cart/
- Type the following command:
ant
This command calls the default target, which builds and packages the application into an EAR file, cart.ear, located in the dist directory.
- Type the following command:
ant deploy
The cart.ear file is deployed to the GlassFish Server.
- Type the following command:
ant run
This task retrieves the application client JAR, cartClient.jar, and runs the application client. The client JAR, cartClient.jar, contains the application client class, the helper class BookException, and the Cart business interface.
This task is equivalent to running the following command:
appclient -client cartClient.jar
When you run the client, the application client container injects any component references declared in the application client class, in this case the reference to the Cart enterprise bean.
The all Task
As a convenience, the all task will build, package, deploy, and run the application. To do this, enter the following command:
ant all


jac2dat - Convert .jac/.jca files to various data formats
perl jac2dat.pl [jac_files ...] [--all] [--det=det_file]
[--out_fmts=ext ...] [--out_path=path]
[--out_prepend=flag] [--out_append=flag]
[--nofm] [--nopause]
jac2dat converts .jac/.jca files to various data formats.
- JAC file: The gamma spectra format of the Science and Technology Agency
(now the MEXT), Japan. For details, refer to the catalogue of
DS-P1001 Gamma Station, SII.
A .jac/.jca file consists of only one column, in which
gamma counts are stored in ascending order of channels.
The first three records are "not" gamma counts, and
are used for special purposes:
- Record 1: Live time (duration)
- Record 2: Real time (duration)
- Record 3: Acquired time
- DAT file: A plottable text file converted from a .jac/.jca file.
A .dat file consists of multiple columns, in which
channels, gamma energies, peak FWHMs, peak efficiencies,
counts, count per second (cps), gammas, and
gamma per second (gps) are stored.
- Other supported data formats include tex, csv, xlsx, json, and yaml.
jac_files ...
.jac/.jca files to be converted.
--all (short: -a)
All .jac/.jca files in the current working directory will be converted.
--detector=det_file (short: --det)
A file containing conversion functions of a detector
such as channel-to-energy and channel-to-FWHM functions.
Key-value pairs contained in this file take precedence
over the predefined functions.
Refer to the sample file 'detector.j2d' for the syntax.
--out_fmts=ext ... (short: --fmts, default: dat)
Output formats. Multiple formats are separated by the comma (,).
all
All of the following ext's.
dat
Plain text
tex
LaTeX tabular environment
csv
comma-separated value
xlsx
Microsoft Excel 2007
json
JavaScript Object Notation
yaml
YAML
--out_path=path (short: --path, default: current working directory)
The output path.
--out_prepend=flag (short: --prep, default: empty)
A flag to be prepended to the names of output files.
--out_append=flag (short: --app, default: empty)
A flag to be appended to the names of output files.
--nofm
Do not show the front matter at the beginning of the program.
--nopause
Do not pause the shell at the end of the program.
perl jac2dat.pl lt1200s.jac --fmts=dat,xlsx
perl jac2dat.pl ./samples/sample_rand.jac --det=./j2d/det_fitted.j2d
perl jac2dat.pl ./samples/sample_rand.jac --nopause
Perl 5
Text::CSV, Excel::Writer::XLSX, JSON, YAML
Jaewoong Jang<EMAIL_ADDRESS>Copyright (c) 2019-2020 Jaewoong Jang
This software is available under the MIT license; the license information is found in 'LICENSE'.


- Gentown Community Inclusion Hub
- About us
- Our partners
Our partners
Gentown Chamber of Commerce and Industry (GCCI)
GCCI is a not-for-profit business organisation that liaises with local, state and federal governments on behalf of the Gentown and district business community.
They have representation at the Business & Tourism Regional Alliance (BTRA) association meetings and provide feedback on behalf of Chamber members. GCCI is the local representative body for owners, entrepreneurs, and stakeholders to have their say on the future direction of business in Gentown. They are committed to helping small business start-ups and supporting the Gentown Community & Business Hub achieve this outcome.
Business and Tourism Regional Alliance (BTRA)
BTRA represents local member, Business Tourism Associations and Chambers of Commerce, in the Wiagara Region, who in turn represent their local business and tourism community.
BTRA promotes and supports these communities by identifying opportunities, lobbying relevant authorities, and acting as a co‐coordinating body to facilitate the sharing of information between member organisations across the region.
Gentown Lions Club
Gentown Lions Club is a local group of service-minded volunteers in the Gentown community. Becoming a Lions Club member is by invitation only, however everyone is encouraged to apply.
From supporting the leaders of tomorrow through their youth programs, to rallying together in times of natural disasters, Lions (and their sausage sizzles) are making a huge difference in the Gentown community.
Gentown Arts Centre
Home to more than 20 creative artists, one of the key benefits of having artistic work presented at the Gentown Arts Centre is the encouragement, collaboration, and cross-pollination of ideas that this community inspires. The Gentown Arts Centre supports a vibrant, innovative and active community.
Regional Women in Business Network (RWBN)
RWBN recognises and values the ongoing contributions of women to the business community of the greater Wiagara Region.
In addition to sponsoring an annual Women’s Leadership Gala and Award to celebrate women leaders in the region, RWBN hosts a series of events, like panel discussions with business world experts, that bring to light the various work issues affecting women and men across all sectors.
The network also plays an active role in the local sporting communities by providing opportunities for girls and women to participate in sport.


Assembly of the colorimeter¶
Before starting
- Review the guides on the previous pages to easily identify the laser cut parts (highlighted in bold below);
- Peel off the protective backing from the laser cut acrylic parts. This will be either brown paper backing (clear and ¼” black) or blue plastic on most of the ⅛” black acrylic parts;
- Sort and identify the hardware parts.
Step 1. To begin assembly of the enclosure, you will use the hardware in Bag A. After removing the paper backing from the base plate, place two of the enclosure screws through the two center holes. Secure in place with tape. Flip the base plate over and place one of the small C-shaped cuvette holders on the base plate with the cutout facing the two rectangular slots in the center of the base plate. Screw the two cuvette standoffs in place.
Step 2. Mount the second C-shaped cuvette holder onto the standoffs with the two shorter cuvette screws, with the same orientation as the previous cuvette holder.
Step 3. Keeping the same orientation of the base plate, place one enclosure standoff on each corner and secure in place with an enclosure screw.
Step 4. Flip over the base plate, and place a rubber bumper on each corner.
Step 5. To begin assembly of the colorimeter electronics, you will use the hardware in Bag B. Mount the Colorimeter LED Board onto the LED mount. Make sure that the placement of the board is close to the bottom edge of the LED mount as shown in the image below. Secure in place with four PCB screws and four PCB nuts.
Step 6. Mount the Colorimeter Sensor Board onto the sensor mount passing the plastic 10-pin connector through the rectangular cutout (left and center images). Before securing in place ensure the correct orientation of the PCB as shown in the lower right image. Secure in place with the last four PCB screws and nuts.
Step 7. From Bag B, take one of the black, plastic 4-pin connectors and the black pre-crimped wire. Locate the triangle marker on the housing which denotes Pin 1. Carefully push the black wire into the Pin 1 slot of the connector until it clicks into place. Next, insert the red wire into the Pin 2 slot of the connector, followed by the green wire (Pin 3 slot), and finally the blue wire (Pin 4 slot). Make sure all wires are held firmly in place by gently pulling on them. Do not put the connector on the other end of the wires at this point.
Step 8. Connect the assembled wires to the LED board (image below) so that the black wire is connected to the pin on the PCB labelled GND, the red wire to the pin labelled Red, the green wire to the pin labelled Green, and the blue wire to the pin labelled Blue. Thread the free ends of the four colored wires through the round hole in the divider wall.
Step 9. Take the second 4-pin connector and, as before, insert the pre-crimped wires. Remember to first locate the triangular marker on the connector, and then insert the black wire into the slot corresponding to Pin 1, followed by the red (Pin 2 slot), green (Pin 3 slot) and blue (Pin 4 slot) wires. Finally, after ensuring that the cables are properly attached, connect this to the Colorimeter Sensor Board using the same pin-orientation as before (black wire to GND pin, red wire to Red pin, etc).
Step 10. Place the parts assembled in the previous step on the base plate taking note of the orientation. The sensor PCB and the divider wall should be on the side of the cuvette holder with the U-shaped cutout (left image). The cables may need to be adjusted to fit into the enclosure.
Step 11. Take the two side walls and insert them on the base plate so that all the corresponding tabs and slots match.
Step 12. Place the top plate on the enclosure ensuring that the tabs fit in the slots as shown in the Image below.
Step 13. Lay the outer slider and inner slider onto the top plate. Orient the parts as shown in the images below.
Step 14. Place the clear cover on the enclosure. Secure all the parts in place with the last four enclosure screws from Bag A.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.juniper.netconf.Device
A Device
is used to define a Netconf server.
Typically, one
Device
object.close()
method.
| Constructor Summary | |
Device()
Prepares a new Device object, with default client
capabilities and default port 830, which can then be used to perform
netconf operations. |
|
Device(java.lang.String hostName,
java.lang.String userName,
java.lang.String password,
java.lang.String pemKeyFile)
Prepares a new Device object, with default client
capabilities and default port 830, which can then be used to perform
netconf operations. |
|
Device(java.lang.String hostName,
java.lang.String userName,
java.lang.String password,
java.lang.String pemKeyFile,
java.util.ArrayList capabilities)
Prepares a new Device object, with user-defined client
capabilities and default port 830 which can then be used to perform
netconf operations. |
|
Device(java.lang.String hostName,
java.lang.String userName,
java.lang.String password,
java.lang.String pemKeyFile,
int port)
Prepares a new Device object, with default client
capabilities and user-defined port which can then be used to perform
netconf operations. |
|
Device(java.lang.String hostName,
java.lang.String userName,
java.lang.String password,
java.lang.String pemKeyFile,
int port,
java.util.ArrayList capabilities)
Prepares a new Device object, with user-defined client
capabilities and user-defined port which can then be used to perform
netconf operations. |
| Method Summary | |
void |
close()
Close the connection to the Netconf server. |
void |
closeConfiguration()
This method should be called to close a private session, in case its started. |
void |
commit()
Commit the candidate configuration. |
void |
commitConfirm(long seconds)
Commit the candidate configuration, temporarily. |
void |
commitThisConfiguration(java.lang.String configFile,
java.lang.String loadType)
Loads and commits the candidate configuration, Configuration can be in text/xml format. |
void |
connect()
Connect to the Device, and establish a default NETCONF session. |
NetconfSession |
createNetconfSession()
Create a new Netconf session. |
XML |
executeRPC(org.w3c.dom.Document rpcDoc)
Send an RPC(as Document object) over the Netconf session and get the response as an XML object. |
XML |
executeRPC(java.lang.String rpcContent)
Send an RPC(as String object) over the default Netconf session and get the response as an XML object. |
XML |
executeRPC(XML rpc)
Send an RPC(as XML object) over the Netconf session and get the response as an XML object. |
java.io.BufferedReader |
executeRPCRunning(org.w3c.dom.Document rpcDoc)
Send an RPC(as Document object) over the Netconf session and get the response as a BufferedReader. |
java.io.BufferedReader |
executeRPCRunning(java.lang.String rpcContent)
Send an RPC(as String object) over the default Netconf session and get the response as a BufferedReader. |
java.io.BufferedReader |
executeRPCRunning(XML rpc)
Send an RPC(as XML object) over the Netconf session and get the response as a BufferedReader. |
XML |
getCandidateConfig()
Retrieve the whole candidate configuration. |
XML |
getCandidateConfig(java.lang.String configTree)
Retrieve the candidate configuration, or part of the configuration. |
java.util.ArrayList |
getDefaultClientCapabilities()
Get the client capabilities that are advertised to the Netconf server by default. |
java.lang.String |
gethostName()
Get hostname of the Netconf server. |
java.lang.String |
getLastRPCReply()
Returns the last RPC reply sent by Netconf server. |
XML |
getRunningConfig()
Retrieve the whole running configuration. |
XML |
getRunningConfig(java.lang.String configTree)
Retrieve the running configuration, or part of the configuration. |
java.lang.String |
getSessionId()
Get the session ID of the Netconf session. |
boolean |
hasError()
Check if the last RPC reply returned from Netconf server has any error. |
boolean |
hasWarning()
Check if the last RPC reply returned from Netconf server has any warning. |
boolean |
isOK()
Check if the last RPC reply returned from Netconf server, contains <ok/> tag. |
void |
loadSetConfiguration(java.lang.String configuration)
Loads the candidate configuration, Configuration should be in set format. |
void |
loadSetFile(java.lang.String configFile)
Loads the candidate configuration from file, configuration should be in set format. |
void |
loadTextConfiguration(java.lang.String configuration,
java.lang.String loadType)
Loads the candidate configuration, Configuration should be in text/tree format. |
void |
loadTextFile(java.lang.String configFile,
java.lang.String loadType)
Loads the candidate configuration from file, configuration should be in text/tree format. |
void |
loadXMLConfiguration(java.lang.String configuration,
java.lang.String loadType)
Loads the candidate configuration, Configuration should be in XML format. |
void |
loadXMLFile(java.lang.String configFile,
java.lang.String loadType)
Loads the candidate configuration from file, configuration should be in XML format. |
boolean |
lockConfig()
Locks the candidate configuration. |
void |
openConfiguration(java.lang.String mode)
This method should be called for load operations to happen in 'private' mode. |
java.lang.String |
reboot()
Reboot the device. |
java.lang.String |
runCliCommand(java.lang.String command)
Run a cli command, and get the corresponding output. |
java.io.BufferedReader |
runCliCommandRunning(java.lang.String command)
Run a cli command. |
java.lang.String |
runShellCommand(java.lang.String command)
Execute a command in shell mode. |
java.io.BufferedReader |
runShellCommandRunning(java.lang.String command)
Execute a command in shell mode. |
void |
setCapabilities(java.util.ArrayList capabilities)
Set the client capabilities to be advertised to the Netconf server. |
void |
setHostname(java.lang.String hostName)
Set the hostname of the Netconf server. |
void |
setPassword(java.lang.String password)
Set the password of the Netconf server. |
void |
setPemKeyFile(java.lang.String pemKeyFile)
Set path of the RSA/DSA private key. |
void |
setPort(int port)
Set the port number to establish Netconf session over SSH-2. |
void |
setTimeOut(int timeout)
Set the timeout value for connecting to the Device. |
void |
setUserName(java.lang.String userName)
Set the username of the Netconf server. |
boolean |
unlockConfig()
Unlocks the candidate configuration. |
boolean |
validate()
Validate the candidate configuration. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Device() throws javax.xml.parsers.ParserConfigurationException
Device
object, with default client
capabilities and default port 830, which can then be used to perform
netconf operations.
javax.xml.parsers.ParserConfigurationException
public Device(java.lang.String hostName, java.lang.String userName, java.lang.String password, java.lang.String pemKeyFile) throws NetconfException, javax.xml.parsers.ParserConfigurationException
Device
object, with default client
capabilities and default port 830, which can then be used to perform
netconf operations.
hostName
- the hostname of the Netconf server.userName
- the login username of the Netconf server.password
- the login password of the Netconf server.pemKeyFile
- path of the file containing RSA/DSA private key, in PEM
format. For user-password based authentication, let this be
null.
NetconfException
javax.xml.parsers.ParserConfigurationException
public Device(java.lang.String hostName, java.lang.String userName, java.lang.String password, java.lang.String pemKeyFile, int port) throws NetconfException, javax.xml.parsers.ParserConfigurationException
Device
object, with default client
capabilities and user-defined port which can then be used to perform
netconf operations.
hostName
- the hostname of the Netconf server.userName
- the login username of the Netconf server.password
- the login password of the Netconf server.pemKeyFile
- path of the file containing RSA/DSA private key, in PEM
format. For user-password based authentication, let this be
null.port
- port number to establish Netconf session over SSH-2.
NetconfException
javax.xml.parsers.ParserConfigurationException
public Device(java.lang.String hostName, java.lang.String userName, java.lang.String password, java.lang.String pemKeyFile, java.util.ArrayList capabilities) throws NetconfException, javax.xml.parsers.ParserConfigurationException
Device
object, with user-defined client
capabilities and default port 830 which can then be used to perform
netconf operations.
hostName
- the hostname of the Netconf server.userName
- the login username of the Netconf server.password
- the login password of the Netconf server.pemKeyFile
- path of the file containing RSA/DSA private key, in PEM
format. For user-password based authentication, let this be
null.capabilities
- the client capabilities to be advertised to Netconf server.
NetconfException
javax.xml.parsers.ParserConfigurationException
public Device(java.lang.String hostName, java.lang.String userName, java.lang.String password, java.lang.String pemKeyFile, int port, java.util.ArrayList capabilities) throws NetconfException, javax.xml.parsers.ParserConfigurationException
Device
object, with user-defined client
capabilities and user-defined port which can then be used to perform
netconf operations.
hostName
- the hostname of the Netconf server.userName
- the login username of the Netconf server.password
- the login password of the Netconf server.pemKeyFile
- path of the file containing RSA/DSA private key, in PEM
format. For user-password based authentication, let this be
null.port
- port number to establish Netconf session over SSH-2.capabilities
- the client capabilities to be advertised to Netconf server.
NetconfException
javax.xml.parsers.ParserConfigurationException
| Method Detail |
public void connect() throws NetconfException
NetconfException
public void setTimeOut(int timeout) throws NetconfException
timeout
- timeout in milliseconds.
NetconfException
public void setHostname(java.lang.String hostName) throws NetconfException
hostName
- hostname of the Netconf server, to be set.
NetconfException
public void setUserName(java.lang.String userName) throws NetconfException
userName
- username of the Netconf server, to be set.
NetconfException
public void setPassword(java.lang.String password) throws NetconfException
password
- password of the Netconf server, to be set.
NetconfException
public void setPemKeyFile(java.lang.String pemKeyFile) throws NetconfException
pemKeyFile
- Path of the file containing RSA/DSA private key.
NetconfException
public void setCapabilities(java.util.ArrayList capabilities) throws NetconfException
capabilities
- Client capabilities to be advertised to the Netconf server.
NetconfException
public void setPort(int port) throws NetconfException
port
- Port number.
NetconfException
public java.lang.String gethostName()
public NetconfSession createNetconfSession() throws NetconfException
NetconfException
public java.lang.String reboot() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public void close()
public java.lang.String runShellCommand(java.lang.String command) throws java.io.IOException
command
- The command to be executed in shell mode.
java.io.IOException
public java.io.BufferedReader runShellCommandRunning(java.lang.String command) throws java.io.IOException
command
- The command to be executed in shell mode.
java.io.IOException
public java.util.ArrayList getDefaultClientCapabilities()
public XML executeRPC(java.lang.String rpcContent) throws org.xml.sax.SAXException, java.io.IOException
rpcContent
- RPC content to be sent. For example, to send an rpc
<rpc><get-chassis-inventory/></rpc>, the
String to be passed can be
"<get-chassis-inventory/>" OR
"get-chassis-inventory" OR
"<rpc><get-chassis-inventory/></rpc>"
org.xml.sax.SAXException
java.io.IOException
public XML executeRPC(XML rpc) throws org.xml.sax.SAXException, java.io.IOException
rpc
- RPC to be sent. Use the XMLBuilder to create RPC as an
XML object.
org.xml.sax.SAXException
java.io.IOException
public XML executeRPC(org.w3c.dom.Document rpcDoc) throws org.xml.sax.SAXException, java.io.IOException
rpcDoc
- RPC content to be sent, as a org.w3c.dom.Document object.
org.xml.sax.SAXException
java.io.IOException
public java.io.BufferedReader executeRPCRunning(java.lang.String rpcContent) throws org.xml.sax.SAXException, java.io.IOException
rpcContent
- RPC content to be sent. For example, to send an rpc
<rpc><get-chassis-inventory/></rpc>, the
String to be passed can be
"<get-chassis-inventory/>" OR
"get-chassis-inventory" OR
"<rpc><get-chassis-inventory/></rpc>"
org.xml.sax.SAXException
java.io.IOException
public java.io.BufferedReader executeRPCRunning(XML rpc) throws org.xml.sax.SAXException, java.io.IOException
rpc
- RPC to be sent. Use the XMLBuilder to create RPC as an
XML object.
org.xml.sax.SAXException
java.io.IOException
public java.io.BufferedReader executeRPCRunning(org.w3c.dom.Document rpcDoc) throws org.xml.sax.SAXException, java.io.IOException
rpcDoc
- RPC content to be sent, as a org.w3c.dom.Document object.
org.xml.sax.SAXException
java.io.IOException
public java.lang.String getSessionId()
public boolean hasError() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public boolean hasWarning() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public boolean isOK()
public boolean lockConfig() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public boolean unlockConfig() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public void loadXMLConfiguration(java.lang.String configuration, java.lang.String loadType) throws LoadException, java.io.IOException, org.xml.sax.SAXException
configuration
- Configuration,in XML format, to be loaded. For example,
"<configuration><system><services><ftp/>
<services/></system></configuration/>"
will load 'ftp' under the 'systems services' hierarchy.loadType
- You can choose "merge" or "replace" as the loadType.
LoadException
java.io.IOException
org.xml.sax.SAXException
public void loadTextConfiguration(java.lang.String configuration, java.lang.String loadType) throws LoadException, java.io.IOException, org.xml.sax.SAXException
configuration
- Configuration,in text/tree format, to be loaded. For example,
" system {
services {
ftp;
}
}"
will load 'ftp' under the 'systems services' hierarchy.loadType
- You can choose "merge" or "replace" as the loadType.
LoadException
java.io.IOException
org.xml.sax.SAXException
public void loadSetConfiguration(java.lang.String configuration) throws LoadException, java.io.IOException, org.xml.sax.SAXException
configuration
- Configuration,in set format, to be loaded. For example,
"set system services ftp"
will load 'ftp' under the 'systems services' hierarchy.
To load multiple set statements, separate them by '\n' character.
LoadException
java.io.IOException
org.xml.sax.SAXException
public void loadXMLFile(java.lang.String configFile, java.lang.String loadType) throws LoadException, java.io.IOException, org.xml.sax.SAXException
configFile
- Path name of file containing configuration,in xml format,
to be loaded.loadType
- You can choose "merge" or "replace" as the loadType.
LoadException
java.io.IOException
org.xml.sax.SAXException
public void loadTextFile(java.lang.String configFile, java.lang.String loadType) throws LoadException, java.io.IOException, org.xml.sax.SAXException
configFile
- Path name of file containing configuration,in xml format,
to be loaded.loadType
- You can choose "merge" or "replace" as the loadType.
LoadException
java.io.IOException
org.xml.sax.SAXException
public void loadSetFile(java.lang.String configFile) throws java.io.IOException, LoadException, org.xml.sax.SAXException
configFile
- Path name of file containing configuration,in set format,
to be loaded.
LoadException
java.io.IOException
org.xml.sax.SAXException
public void commit() throws CommitException, java.io.IOException, org.xml.sax.SAXException
CommitException
java.io.IOException
org.xml.sax.SAXException
public void commitConfirm(long seconds) throws CommitException, java.io.IOException, org.xml.sax.SAXException
seconds
- Time in seconds, after which the previous active configuration
is reverted back to.
CommitException
java.io.IOException
org.xml.sax.SAXException
public void commitThisConfiguration(java.lang.String configFile, java.lang.String loadType) throws LoadException, CommitException, java.io.IOException, org.xml.sax.SAXException
configFile
- Path name of file containing configuration,in text/xml format,
to be loaded. For example,
" system {
services {
ftp;
}
}"
will load 'ftp' under the 'systems services' hierarchy.
OR
"<configuration><system><services><ftp/><
services/></system></configuration/>"
will load 'ftp' under the 'systems services' hierarchy.loadType
- You can choose "merge" or "replace" as the loadType.
LoadException
CommitException
java.io.IOException
org.xml.sax.SAXException
public XML getCandidateConfig(java.lang.String configTree) throws org.xml.sax.SAXException, java.io.IOException
configTree
- configuration hierarchy to be retrieved as the argument.
For example, to get the whole configuration, argument should be
<configuration></configuration>
org.xml.sax.SAXException
java.io.IOException
public XML getRunningConfig(java.lang.String configTree) throws org.xml.sax.SAXException, java.io.IOException
configTree
- configuration hierarchy to be retrieved as the argument.
For example, to get the whole configuration, argument should be
<configuration></configuration>
org.xml.sax.SAXException
java.io.IOException
public XML getCandidateConfig() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public XML getRunningConfig() throws org.xml.sax.SAXException, java.io.IOException
org.xml.sax.SAXException
java.io.IOException
public boolean validate() throws java.io.IOException, org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
public java.lang.String runCliCommand(java.lang.String command) throws java.io.IOException, org.xml.sax.SAXException
command
- the cli command to be executed.
java.io.IOException
org.xml.sax.SAXException
public java.io.BufferedReader runCliCommandRunning(java.lang.String command) throws org.xml.sax.SAXException, java.io.IOException
command
- the cli command to be executed.
org.xml.sax.SAXException
java.io.IOException
public void openConfiguration(java.lang.String mode) throws java.io.IOException
mode
- Mode in which to open the configuration.
Permissible mode(s): "private"
java.io.IOException
public void closeConfiguration() throws java.io.IOException
java.io.IOException
public java.lang.String getLastRPCReply()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


0 comments
4 views
Posted Dec 19, 2020 9:53 pm
0 comments
4 views
Posted Dec 16, 2020 1:16 am
2 comments
6 views
Posted Dec 3, 2020 12:49 pm
1 comments
13 views
Posted Nov 24, 2020 9:16 pm
0 comments
5 views
Posted Nov 24, 2020 4:52 pm
0 comments
5 views
Posted Nov 20, 2020 11:57 pm
0 comments
5 views
Posted Nov 19, 2020 1:37 pm
0 comments
5 views
Posted Nov 16, 2020 1:09 pm
1 comments
14 views
Posted Oct 31, 2020 7:05 pm
0 comments
4 views
Posted Oct 29, 2020 2:25 pm
0 comments
8 views
Posted Oct 16, 2020 6:22 am
0 comments
6 views
Posted Oct 15, 2020 1:59 am
0 comments
8 views
Posted Oct 14, 2020 1:22 am
0 comments
8 views
Posted Oct 8, 2020 7:33 am
0 comments
3 views
Posted Oct 8, 2020 7:21 am
0 comments
5 views
Posted Oct 2, 2020 6:44 pm
0 comments
6 views
Posted Oct 1, 2020 6:42 pm
0 comments
4 views
Posted Sep 29, 2020 7:57 am
0 comments
10 views
Posted Sep 28, 2020 11:02 am
0 comments
6 views
Posted Sep 27, 2020 5:04 am


Dutch great Van Basten suspended by broadcaster for Nazi quip
The 55-year-old made the comment on Fox Sports’ pay-to-view channel.
by AFPDUTCH FOX SPORTS on Monday suspended former Netherlands star Marco van Basten for a week as an analyst for saying “Sieg Heil” on air as a “joke of bad taste.”
The broadcaster said it would pay the former Dutch great’s salary for the week to the Dutch Institute for War, Holocaust and Genocide studies.
Van Basten, 55, made the comment on Fox Sports’ pay-to-view channel, after an interview ahead of the Eredivisie clash between Ajax and Heracles.
His words could be heard in the studio moments after TV presenter Hans Kraay’s interview in German with Heracles’ German manager Frank Wormuth.
“Not too pretty, sieg heil, pfannkuchen (pancake),” Van Basten said, using the Nazi German salute.
“It was not my intention at all to shock people. I only wanted to ‘explain’ Hans’ German,” a contrite Van Basten said.
Fox said Van Basten’s pay for the week “will be paid to the Netherlands Institute for War Documentation, in order to promote knowledge of the history of the Second World War.”


public class TableLoader
extends java.lang.Object
This class provides utility methods for loading tables from files into int[][] or double[][] arrays. In MASON it's particularly useful for loading files of numbers or graphics into an IntGrid2D or DoubleGrid2D to display.
TableLoader at present can load the following kinds of files:
PBM And PGM ("PNM" files) The first four formats are defined by the Netpbm file format specification. Various graphics programs can emit PBM or PGM files. These files are collectively known as PNM files. MASON reads these files into int[][] arrays. Note that graphics programs typically emit PBM (black and white) files in the opposite numerical format than you'd expect: 1 is black, and 0 is white. On the other hand, PGM (monochrome) files are emitted however your graphics program sees fit, typically with 0 being black and MAXVAL-1, whatever you've set it to, being white.
If you're constructing these files by hand, note that MASON is a bit more generous about plain formats than the specification allows: MASON permits lines of any length, and you can have a MAXVAL of any size you like, as long as its within the integer data type range (normally, PGM only allows lines of about 70 chars and a MAXVAL of no more than 2^16).
PNG and GIF files These files must have colors stored as binary (black and white), 8-bit grayscale, or 8-bit indexed color.
Whitespace-delimited text filesnbsp; These files consist of rows of numbers, each row delimited with newlines. The numbers in each row are delimited with spaces or tabs. Unlike the PBM/PGM format, you cannot at present have comments in the file. The files are loaded into double[][] arrays, though TableLoader provides a simple utility conversion function to int[][] if you're sure that all the values are actually integers and would like an int array.
MASON determines the row width of the first row by parsing through the first line. Thereafter it checks to make sure that all subsequent rows are the same width (in terms of number of elements) and thus that the int[][] array is rectangular.
| Constructor and Description |
|---|
TableLoader() |
| Modifier and Type | Method and Description |
|---|---|
static double[][] |
convertToDoubleArray(int[][] vals)
Converts an int[][] array to a double[][] array.
|
static int[][] |
convertToIntArray(double[][] vals)
Converts a double[][] array to an int[][] array only if all values are within the int range.
|
static long[][] |
convertToLongArray(double[][] vals)
Converts a double[][] array to a long[][] array only if all values are within the long range.
|
static long[][] |
convertToLongArray(int[][] vals)
Converts an int[][] array to a long[][] array.
|
static int[][] |
loadGIFFile(java.io.InputStream str)
Loads GIF files and returns the result as an int[][], where each integer value represents
the color table index of the pixel.
|
static int[][] |
loadGIFFile(java.io.InputStream str,
boolean flipY)
Loads GIF files and returns the result as an int[][], where each integer value represents
the color table index of the pixel.
|
static int[][] |
loadPNGFile(java.io.InputStream str)
Loads PNG files and returns the result as an int[][].
|
static int[][] |
loadPNGFile(java.io.InputStream str,
boolean flipY)
Loads PNG files and returns the result as an int[][].
|
static int[][] |
loadPNMFile(java.io.InputStream str)
Loads plain or raw PGM files or plain or raw PBM files and return the result as an int[][].
|
static int[][] |
loadPNMFile(java.io.InputStream str,
boolean flipY)
Loads plain or raw PGM files or plain or raw PBM files and return the result as an int[][].
|
static double[][] |
loadTextFile(java.io.InputStream stream)
Loads into a double[][] a plain text file of numbers, with newlines dividing the numbers into rows and tabs or spaces delimiting columns.
|
static double[][] |
loadTextFile(java.io.InputStream str,
boolean flipY)
Loads into a double[][] a plain text file of numbers, with newlines dividing the numbers into rows and tabs or spaces delimiting columns.
|
public static int[][] loadPNMFile(java.io.InputStream str, boolean flipY) throws java.io.IOException
java.io.IOException
public static int[][] loadPNMFile(java.io.InputStream str) throws java.io.IOException
java.io.IOException
public static double[][] loadTextFile(java.io.InputStream str, boolean flipY) throws java.lang.RuntimeException, java.io.IOException
java.lang.RuntimeException
java.io.IOException
public static double[][] loadTextFile(java.io.InputStream stream) throws java.io.IOException
java.io.IOException
public static int[][] loadGIFFile(java.io.InputStream str, boolean flipY) throws java.io.IOException
java.io.IOException
public static int[][] loadGIFFile(java.io.InputStream str) throws java.io.IOException
java.io.IOException
public static int[][] loadPNGFile(java.io.InputStream str, boolean flipY) throws java.io.IOException
java.io.IOException
public static int[][] loadPNGFile(java.io.InputStream str) throws java.io.IOException
java.io.IOException
public static int[][] convertToIntArray(double[][] vals)
public static double[][] convertToDoubleArray(int[][] vals)
public static long[][] convertToLongArray(double[][] vals)
public static long[][] convertToLongArray(int[][] vals)


In the Tcl_CreateMathFunc interface, Name is the name of the function as it will appear in expressions. If name does not already exist in the ::tcl::mathfunc namespace, then a new command is created in that namespace. If name does exist, then the existing function is replaced. NumArgs and argTypes describe the arguments to the function. Each entry in the argTypes array must be one of TCL_INT, TCL_DOUBLE, TCL_WIDE_INT, or TCL_EITHER to indicate whether the corresponding argument must be an integer, a double-precision floating value, a wide (64-bit) integer, or any, respectively.
Whenever the function is invoked in an expression Tcl will invoke proc. Proc should have arguments and result that match the type Tcl_MathProc:
typedef int Tcl_MathProc( ClientData clientData, Tcl_Interp *interp, Tcl_Value *args, Tcl_Value *resultPtr);
When proc is invoked the clientData and interp arguments will be the same as those passed to Tcl_CreateMathFunc. Args will point to an array of numArgs Tcl_Value structures, which describe the actual arguments to the function:
typedef struct Tcl_Value { Tcl_ValueType type; long intValue; double doubleValue; Tcl_WideInt wideValue; } Tcl_Value;
The type field indicates the type of the argument and is one of TCL_INT, TCL_DOUBLE or TCL_WIDE_INT. It will match the argTypes value specified for the function unless the argTypes value was TCL_EITHER. Tcl converts the argument supplied in the expression to the type requested in argTypes, if that is necessary. Depending on the value of the type field, the intValue, doubleValue or wideValue field will contain the actual value of the argument.
Proc should compute its result and store it either as an integer in resultPtr->intValue or as a floating value in resultPtr->doubleValue. It should set also resultPtr->type to one of TCL_INT, TCL_DOUBLE or TCL_WIDE_INT to indicate which value was set. Under normal circumstances proc should return TCL_OK. If an error occurs while executing the function, proc should return TCL_ERROR and leave an error message in the interpreter's result.
Tcl_GetMathFuncInfo retrieves the values associated with function name that were passed to a preceding Tcl_CreateMathFunc call. Normally, the return code is TCL_OK but if the named function does not exist, TCL_ERROR is returned and an error message is placed in the interpreter's result.
If an error did not occur, the array reference placed in the variable pointed to by argTypesPtr is newly allocated, and should be released by passing it to Tcl_Free. Some functions (the standard set implemented in the core, and those defined by placing commands in the tcl::mathfunc namespace) do not have argument type information; attempting to retrieve values for them causes a NULL to be stored in the variable pointed to by procPtr and the variable pointed to by clientDataPtr will not be modified. The variable pointed to by numArgsPointer will contain -1, and no argument types will be stored in the variable pointed to by argTypesPointer.
Tcl_ListMathFuncs returns a Tcl object containing a list of all the math functions defined in the interpreter whose name matches pattern. The returned object has a reference count of zero.


Preferences
Camera:
Internal Storage:
Battery:
Memory:
{{item.model_full_name}}
Specifications
{{item.model_camera_specs}} MP
primary camera
{{item.model_internal_storage}} GB
of internal storage
{{item.model_battery_specs}} mAh
battery
{{item.model_ram_specs}} GB
of RAM


| DOSE: |
1 hit |
smoked |
DMT |
(powder / crystals) |
My acquaintance and I shared an interesting smelling mixture of organic matter that had been calculated to be 25% DMT, the source of which I was informed was an Australian Acacia. Of this I took three lungful tokes sitting cross-legged on damp grass beside a moonlit river at approximately the 11th hour, and after this I felt as I stared at the illuminated clouds very much stoned and giggly. Comparable to cannabis in some respects, as I found these low percentage tokes brought on a sensation of clarity and subtlety to which I reacted with openness. I found in this warmth many a large grin wiped across my face!
Indeed, after this mild encounter with DMT it was my decision to experience what a 50% DMT containing smoking mixture would be.
This time we moved away from the river to a backyard garden. I found that whilst I was toking this glass pipe, I was swallowing, much like when one drinks water! I noted this curious thing and continued.
Holding the smoke in my lungs for as long as possible, I was experiencing a rush before I
had exhaled; by the time I exhaled I was coming up rapidly to the peak. The garden was meditative, and all trees were beautiful in that they were perfect patterns of mathematical precision, and in fact all of the trees were patterns- there were patterns everywhere! My eyes opened and closed during this experience with my brain bombarded with stimuli of all sorts. I remember my left hand when my eyes were closed; my fingers were sort of hollow, like tentacles and these were connected to a feminine creature in a swift erotic encounter. All of this was rapid, and when I opened my eyes and explored what was happening, I found that looking in any direction was irrelevant with regards to 'me', in that there was gravity, but no X or Y-axis. I also remember moving my arms out in front of me, geez they were so long! I then undulated them as if they were travelling along a sine wave- the 'movement' along the wave was forwards as I was looking backwards.
Movements in general felt very rapid, as if it took no effort at all. There were some aspects of rapid time shifts in and out from slow to rapid. This sensation is very hard to 'english'! My acquaintance was next to me when I was under, and we shared small comments here and there. Sounds where everywhere and somewhat 'metallic' and 'twangy'. Soon I was coming down, and here the frenetic energy of everything slowly subsided and brought with it a meditative-like quality of calm and tranquillity. Being out of doors and sitting on grass, I was sitting listening with closed eyes the chirping of crickets around me. This was so very beautiful; exuberantly majestic in their subtlety- this was a very nice way to get back to baseline!
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Home > Venues
Where You Want To Be
GRU Maxwell Performing Arts Theatre
2500 Walton Way
Augusta, Ga 30904
Old Academy of Richmond County
540 Telfair Street
Augusta, Ga 30904
Arts and Heritage Center of North Augusta
100 Georgia Avenue
North Augusta, SC 29841
Imperial Theatre
749 Broad Street
Augusta, GA 30901
Morris Museum of Art
1 10th Street 2nd Floor
Augusta, GA 30901
Sacred Heart Cultural Center
1301 Greene Street
Augusta, GA 30901
JB Whites Building
936 Broad Street
Augusta, GA 30901
Church of the Most Holy Trinity
720 Telfair Street
Augusta, GA 30901
Reid Memorial Presbyterian Church
2261 Walton Way
Augusta, GA 30904
Church of the Good Shepherd
2230 Walton Way
Augusta, GA 30904
St. Paul's Episcopal Church
605 Reynolds Street
Augusta, GA 30901


Friends
Add User
Message Board
Delete Group
Post Message
Family
Colleagues
Add Group
Name
Description
Member List
AP
Akande Oluwatomi Paul
VE
Vanessa Ejikeme