answer
stringlengths 15
1.25M
|
|---|
# angucomplete-alt contributors (sorted alphabeticaly)
[@alexbeletsky: Alexander Beletsky](https://github.com/alexbeletsky)
* Publish to NPM #111, #121
[@alindber: Andy Lindberg](https://github.com/alindber)
* Required support
* Auto match
[@andretw: Andre Lee](https://github.com/andretw)
* Bug fix #109
[@annmirosh](https://github.com/annmirosh)
* Fix input event for mobile device #232 #178
[@antony: Antony Jones](https://github.com/antony)
* Allow the user to set an initial value OBJECT instead of just a string #173
* Documentation update #180
[@baloo2401](https://github.com/baloo2401)
* display-searching and display-no-result #129
[@boshen](https://github.com/Boshen)
* Collaborator and excellent developer
* Add autocapitalize="off" autocorrect="off" autocomplete="off"
[@davidgeary: David Geary](https://github.com/davidgeary)
* Missing 'type' field on input element when not specified #167
[@Freezystem: Nico](https://github.com/Freezystem)
* Add focus-first #92 #242
[@handiwijoyo: Handi Wijoyo](https://github.com/handiwijoyo)
* Add css to bower.json main
[@iamgurdip](https://github.com/iamgurdip)
* Escape regular expression #123
[@jbuquet: Javier Buquet](https://github.com/jbuquet)
* Add custom API handler #128
[@jermspeaks: Jeremy Wong](https://github.com/jermspeaks)
* Support withCredentials for $http #113
[@Leocrest](https://github.com/Leocrest)
* Clear input
[@mcnocopo: Pachito Marco Calabrese](https://github.com/mcnocopo)
* Add input name and a not-empty class #124
[@mmBs](https://github.com/mmBs)
* Add type attribute
[@mrdevin: David Hartman](https://github.com/mrdevin)
* Set the form field to valid when the initialValue is added
[@nekcih](https://github.com/nekcih)
* New callback handler, response translator, better template code format, and css fix
* Fixed support for IE8
[@peterjkirby: Peter Kirby](https://github.com/peterjkirby)
* Bug fix
[@sdbondi: Stan Bondi](https://github.com/sdbondi)
* Custom template
[@SpaceK33z: Kees Kluskens](https://github.com/SpaceK33z)
* Bug fix
[@termleech](https://github.com/termleech)
* Add maxlength #136
[@tomgutz: Tomas Gutierrez](https://github.com/tomgutz)
* Added delete keystroke together with backspace
[@tuduong2](https://github.com/tuduong2)
* Encode search parameter #119
[@urecio](https://github.com/urecio)
* Added input changed callback
[@vhuerta: Victor Huerta Hernández](https://github.com/vhuerta)
* Custom strings for "searching" and "no results"
[@YasuhiroYoshida: Yasuhiro Yoshida](https://github.com/YasuhiroYoshida)
* Fix pressing enter without selecting an item results in "No results found" message
* Implement 'update input field'
|
<?php return array(
//Use the below link to get the parameters to be passed.
//http://www.tig12.net/downloads/apidocs/wp/wp-includes/PHPMailer.class.html#det_fields_to
"type"=>array(
// Sets Mailer to send message using PHP mail() function. (true, false)
"IsMail"=>false,
// Sets Mailer to send message using SMTP. If set to true, other options are also available. (true, false )
"IsSMTP"=>true,
// Sets Mailer to send message using the Sendmail program. (true, false)
"IsSendmail"=>false,
// Sets Mailer to send message using the qmail MTA. (true, false )
"IsQmail"=>false
),
"smtp"=>array(
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
"SMTPDebug" => 0,
//Ask for HTML-friendly debug output
"Debugoutput" => 'html',
//Set the hostname of the mail server
"Host" => 'smtp.gmail.com',
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
"Port" => 587,
//Set the encryption system to use - ssl (deprecated) or tls
"SMTPSecure" => 'tls',
//Whether to use SMTP authentication
"SMTPAuth" => true,
//Username to use for SMTP authentication - use full email address for gmail
"Username" => "",
//Password to use for SMTP authentication
"Password" => "",
//Set who the message is to be sent from
"From" =>"",
//Set Name of the sender
"FromName"=>""
),
//Authenticate via POP3 (true, false)
//Now you should be clear to submit messages over SMTP for a while
//Only applies if your host supports POP-before-SMTP
"pop"=>array(false,"'pop3.example.com', 110, 30, 'username', 'password', 1")
);
|
<?php
namespace Oro\Bundle\ApiBundle\Tests\Unit\Processor;
use Doctrine\Common\Annotations\AnnotationReader;
use Symfony\Component\Form\Extension\Validator\ValidatorExtension;
use Symfony\Component\Form\FormBuilder;
use Symfony\Component\Form\<API key>;
use Symfony\Component\Form\Forms;
use Symfony\Component\Validator\Validation;
use Oro\Bundle\ApiBundle\Config\<API key>;
use Oro\Bundle\ApiBundle\Processor\FormContext;
use Oro\Bundle\ApiBundle\Processor\SingleItemContext;
use Oro\Bundle\ApiBundle\Request\RequestType;
class <API key> extends \<API key>
{
const TEST_VERSION = '1.1';
const TEST_REQUEST_TYPE = RequestType::REST;
/** @var FormContext|SingleItemContext */
protected $context;
/** @var \<API key> */
protected $configProvider;
/** @var \<API key> */
protected $metadataProvider;
protected function setUp()
{
$this->configProvider = $this->getMockBuilder('Oro\Bundle\ApiBundle\Provider\ConfigProvider')
-><API key>()
->getMock();
$this->metadataProvider = $this->getMockBuilder('Oro\Bundle\ApiBundle\Provider\MetadataProvider')
-><API key>()
->getMock();
$this->context = $this->createContext();
$this->context->setVersion(self::TEST_VERSION);
$this->context->getRequestType()->add(self::TEST_REQUEST_TYPE);
$this->context->setConfigExtras(
[
new <API key>($this->context->getAction())
]
);
}
/**
* @return FormContext
*/
protected function createContext()
{
return new FormContextStub($this->configProvider, $this->metadataProvider);
}
/**
* @param <API key>[] $extensions
*
* @return FormBuilder
*/
protected function createFormBuilder(array $extensions = [])
{
$formFactory = Forms::<API key>()
->addExtensions(array_merge($this->getFormExtensions(), $extensions))
->getFormFactory();
$dispatcher = $this->createMock('Symfony\Component\EventDispatcher\<API key>');
return new FormBuilder(null, null, $dispatcher, $formFactory);
}
/**
* @return <API key>[]
*/
protected function getFormExtensions()
{
$validator = Validation::<API key>()
-><API key>(new AnnotationReader())
->getValidator();
return [new ValidatorExtension($validator)];
}
}
|
# How to write your own technology
Starting with ENB version 0.8, we recommend using the `BuildFlow` helper for writing technologies.
[The helper source code](https://github.com/enb/enb/blob/master/lib/build-flow.js)
This guide doesn't cover all `BuildFlow` features. For a complete list of methods with descriptions, see the JSDoc file `build-flow.js`.
## Theory
A technology is aimed at building a [target](../../terms/terms.en.md) in the node. For example, the `css` technology can build `index.css` in the `pages/index` node from the `css` files for the [redefinition levels](https://en.beta.bem.info/methodology/key-concepts/#redefinition-level).
Each technology can accept settings.
The `BuildFlow` helper ensures that the maximum number of parameters is customizable.
Technologies can use the result of other technologies. For example, the list of source `css` files is built using the `files` technology.
## Technology for combining files by suffix
In general, the technology for combining files with a certain suffix looks like this:
javascript
module.exports = require('enb/lib/build-flow').create() // Creates a BuildFlow instance
.name('js') // Choose the technology name
.target('target', '?.js') // Name of the option that sets the name for the output file and the default value
.useFileList('js') // Specify the suffixes for the build
.<API key>() // One more helper. Joins the result and wraps it in comments
// The comments contain the path to the file from which the fragment was formed.
.createTech(); // Creates the technology with the helper
Consider a similar technology that doesn't use `<API key>`:
javascript
var Vow = require('vow'); // Promise library used in ENB
var vowFs = require('vow-fs'); // Using Vow to work with file system
module.exports = require('enb/lib/build-flow').create()
.name('js')
.target('target', '?.js')
.useFileList('js')
.builder(function(jsFiles) { // Returns the promise for ENB to wait until the asynchronous technology is executed
var node = this.node; // Saves the link to the `Node` class instance.
return Vow.all(jsFiles.map(function(file) { // Waits until the promises are resolved
return vowFs.read(file.fullname, 'utf8').then(function(data) { // Reads each source file
var filename = node.relativePath(file.fullname); // Receives the path from the node
// Builds fragments from the source file content
|
.help {
cursor: help;
display: inline-block;
font-size: 18px;
margin-left: .33em;
vertical-align: middle;
}
|
layout: page-fullwidth
subheadline: "Celebration"
title: "Tết Nguyên Đán 2015"
meta_teaser: "Tet Nguyen Đan 2015 at VACSF"
teaser: 'Celebration of <font face="Open Sans">Tết Nguyên Đán</font> (Lunar New Year) of 2015 at <font face="Open Sans">Hội Thánh Tin Lành Việt Nam</font> in the city of San Francisco (VACSF). Enjoy this collection of photos.'
header: no
categories:
- events
<!--more
<div class="flex-video"> <iframe width="100%" height="720" src="http://rgb-scale.com/vacsfj336/index.php/photo-galleries/<API key>" frameborder="0" allowfullscreen=""></iframe></div>
<div class="small-12 columns" style="padding: 0px; border-bottom: none;">
<p> </p>
{% include <API key> %}
</div>
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (fn /*, ...args*/) {
var args = (0, _slice2.default)(arguments, 1);
return function () /*callArgs*/{
var callArgs = (0, _slice2.default)(arguments);
return fn.apply(null, args.concat(callArgs));
};
};
var _slice = require('./internal/slice');
var _slice2 = <API key>(_slice);
function <API key>(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
;
/**
* Creates a continuation function with some arguments already applied.
*
* Useful as a shorthand when combined with other control flow functions. Any
* arguments passed to the returned function are added to the arguments
* originally passed to apply.
*
* @name apply
* @static
* @memberOf module:Utils
* @method
* @category Util
* @param {Function} fn - The function you want to eventually apply all
* arguments to. Invokes with (arguments...).
* @param {...*} arguments... - Any number of arguments to automatically apply
* when the continuation is called.
* @returns {Function} the partially-applied function
* @example
*
* // using apply
* async.parallel([
* async.apply(fs.writeFile, 'testfile1', 'test1'),
* async.apply(fs.writeFile, 'testfile2', 'test2')
* ]);
*
*
* // the same process without using apply
* async.parallel([
* function(callback) {
* fs.writeFile('testfile1', 'test1', callback);
* },
* function(callback) {
* fs.writeFile('testfile2', 'test2', callback);
* }
* ]);
*
* // It's possible to pass any number of additional arguments when calling the
* // continuation:
*
* node> var fn = async.apply(sys.puts, 'one');
* node> fn('two', 'three');
* one
* two
* three
*/
module.exports = exports['default'];
|
#ifndef __CCTMX_LAYER_H__
#define __CCTMX_LAYER_H__
#include "CCTMXObjectGroup.h"
#include "base_nodes/CCAtlasNode.h"
#include "sprite_nodes/CCSpriteBatchNode.h"
#include "CCTMXXMLParser.h"
#include "support/data_support/ccCArray.h"
NS_CC_BEGIN
class TMXMapInfo;
class TMXLayerInfo;
class TMXTilesetInfo;
struct _ccCArray;
/**
* @addtogroup <API key>
* @{
*/
class CC_DLL TMXLayer : public SpriteBatchNode
{
public:
/** creates a TMXLayer with an tileset info, a layer info and a map info */
static TMXLayer * create(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
TMXLayer();
virtual ~TMXLayer();
/** initializes a TMXLayer with a tileset info, a layer info and a map info */
bool initWithTilesetInfo(TMXTilesetInfo *tilesetInfo, TMXLayerInfo *layerInfo, TMXMapInfo *mapInfo);
/** dealloc the map that contains the tile position from memory.
Unless you want to know at runtime the tiles positions, you can safely call this method.
If you are going to call layer->tileGIDAt() then, don't release the map
*/
void releaseMap();
/** returns the tile (Sprite) at a given a tile coordinate.
The returned Sprite will be already added to the TMXLayer. Don't add it again.
The Sprite can be treated like any other Sprite: rotated, scaled, translated, opacity, color, etc.
You can remove either by calling:
- layer->removeChild(sprite, cleanup);
- or layer->removeTileAt(Point(x,y));
*/
Sprite* getTileAt(const Point& tileCoordinate);
<API key> Sprite* tileAt(const Point& tileCoordinate) { return getTileAt(tileCoordinate); };
/** returns the tile gid at a given tile coordinate. It also returns the tile flags.
This method requires the the tile map has not been previously released (eg. don't call [layer releaseMap])
*/
unsigned int getTileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr);
<API key> unsigned int tileGIDAt(const Point& tileCoordinate, ccTMXTileFlags* flags = nullptr){
return getTileGIDAt(tileCoordinate, flags);
};
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
If a tile is already placed at that position, then it will be removed.
*/
void setTileGID(unsigned int gid, const Point& tileCoordinate);
/** sets the tile gid (gid = tile global id) at a given tile coordinate.
The Tile GID can be obtained by using the method "tileGIDAt" or by using the TMX editor -> Tileset Mgr +1.
If a tile is already placed at that position, then it will be removed.
Use withFlags if the tile flags need to be changed as well
*/
void setTileGID(unsigned int gid, const Point& tileCoordinate, ccTMXTileFlags flags);
/** removes a tile at given tile coordinate */
void removeTileAt(const Point& tileCoordinate);
/** returns the position in points of a given tile coordinate */
Point getPositionAt(const Point& tileCoordinate);
<API key> Point positionAt(const Point& tileCoordinate) { return getPositionAt(tileCoordinate); };
/** return the value for the specific property name */
String* getProperty(const char *propertyName) const;
<API key> String* propertyNamed(const char *propertyName) const { return getProperty(propertyName); };
/** Creates the tiles */
void setupTiles();
inline const char* getLayerName(){ return _layerName.c_str(); }
inline void setLayerName(const char *layerName){ _layerName = layerName; }
/** size of the layer in tiles */
inline const Size& getLayerSize() const { return _layerSize; };
inline void setLayerSize(const Size& size) { _layerSize = size; };
/** size of the map's tile (could be different from the tile's size) */
inline const Size& getMapTileSize() const { return _mapTileSize; };
inline void setMapTileSize(const Size& size) { _mapTileSize = size; };
/** pointer to the map of tiles */
inline unsigned int* getTiles() const { return _tiles; };
inline void setTiles(unsigned int* tiles) { _tiles = tiles; };
/** Tileset information for the layer */
inline TMXTilesetInfo* getTileSet() const { return _tileSet; };
inline void setTileSet(TMXTilesetInfo* info) {
CC_SAFE_RETAIN(info);
CC_SAFE_RELEASE(_tileSet);
_tileSet = info;
};
/** Layer orientation, which is the same as the map orientation */
inline unsigned int getLayerOrientation() const { return _layerOrientation; };
inline void setLayerOrientation(unsigned int orientation) { _layerOrientation = orientation; };
/** properties from the layer. They can be added using Tiled */
inline Dictionary* getProperties() const { return _properties; };
inline void setProperties(Dictionary* properties) {
CC_SAFE_RETAIN(properties);
CC_SAFE_RELEASE(_properties);
_properties = properties;
};
// Override
/** TMXLayer doesn't support adding a Sprite manually.
@warning addchild(z, tag); is not supported on TMXLayer. Instead of setTileGID.
*/
virtual void addChild(Node * child, int zOrder, int tag) override;
// super method
void removeChild(Node* child, bool cleanup) override;
private:
Point getPositionForIsoAt(const Point& pos);
Point <API key>(const Point& pos);
Point getPositionForHexAt(const Point& pos);
Point <API key>(const Point& offset);
/* optimization methods */
Sprite* appendTileForGID(unsigned int gid, const Point& pos);
Sprite* insertTileForGID(unsigned int gid, const Point& pos);
Sprite* updateTileForGID(unsigned int gid, const Point& pos);
/* The layer recognizes some special properties, like cc_vertez */
void <API key>();
void setupTileSprite(Sprite* sprite, Point pos, unsigned int gid);
Sprite* reusedTileWithRect(Rect rect);
int getVertexZForPos(const Point& pos);
// index
unsigned int <API key>(unsigned int z);
unsigned int atlasIndexForNewZ(int z);
protected:
//! name of the layer
std::string _layerName;
//! TMX Layer supports opacity
unsigned char _opacity;
unsigned int _minGID;
unsigned int _maxGID;
//! Only used when vertexZ is used
int _vertexZvalue;
bool <API key>;
//! used for optimization
Sprite *_reusedTile;
ccCArray *_atlasIndexArray;
// used for retina display
float _contentScaleFactor;
/** size of the layer in tiles */
Size _layerSize;
/** size of the map's tile (could be different from the tile's size) */
Size _mapTileSize;
/** pointer to the map of tiles */
unsigned int* _tiles;
/** Tileset information for the layer */
TMXTilesetInfo* _tileSet;
/** Layer orientation, which is the same as the map orientation */
unsigned int _layerOrientation;
/** properties from the layer. They can be added using Tiled */
Dictionary* _properties;
};
// end of <API key> group
@}
NS_CC_END
#endif //__CCTMX_LAYER_H__
|
# app
The `app` module is responsible for controlling the application's lifecycle.
The following example shows how to quit the application when the last window is
closed:
javascript
const app = require('electron').app;
app.on('window-all-closed', function() {
app.quit();
});
## Events
The `app` object emits the following events:
Event: '<API key>'
Emitted when the application has finished basic startup. On Windows and Linux,
the `<API key>` event is the same as the `ready` event; on OS X,
this event represents the `<API key>` notification of
`NSApplication`. You would usually set up listeners for the `open-file` and
`open-url` events here, and start the crash reporter and auto updater.
In most cases, you should just do everything in the `ready` event handler.
Event: 'ready'
Emitted when Electron has finished initialization.
Event: 'window-all-closed'
Emitted when all windows have been closed.
This event is only emitted when the application is not going to quit. If the
user pressed `Cmd + Q`, or the developer called `app.quit()`, Electron will
first try to close all the windows and then emit the `will-quit` event, and in
this case the `window-all-closed` event would not be emitted.
Event: 'before-quit'
Returns:
* `event` Event
Emitted before the application starts closing its windows.
Calling `event.preventDefault()` will prevent the default behaviour, which is
terminating the application.
Event: 'will-quit'
Returns:
* `event` Event
Emitted when all windows have been closed and the application will quit.
Calling `event.preventDefault()` will prevent the default behaviour, which is
terminating the application.
See the description of the `window-all-closed` event for the differences between
the `will-quit` and `window-all-closed` events.
Event: 'quit'
Returns:
* `event` Event
* `exitCode` Integer
Emitted when the application is quitting.
Event: 'open-file' _OS X_
Returns:
* `event` Event
* `path` String
Emitted when the user wants to open a file with the application. The `open-file`
event is usually emitted when the application is already open and the OS wants
to reuse the application to open the file. `open-file` is also emitted when a
file is dropped onto the dock and the application is not yet running. Make sure
to listen for the `open-file` event very early in your application startup to
handle this case (even before the `ready` event is emitted).
You should call `event.preventDefault()` if you want to handle this event.
On Windows, you have to parse `process.argv` to get the filepath.
Event: 'open-url' _OS X_
Returns:
* `event` Event
* `url` String
Emitted when the user wants to open a URL with the application. The URL scheme
must be registered to be opened by your application.
You should call `event.preventDefault()` if you want to handle this event.
Event: 'activate' _OS X_
Returns:
* `event` Event
* `hasVisibleWindows` Boolean
Emitted when the application is activated, which usually happens when clicks on
the applications's dock icon.
Event: 'browser-window-blur'
Returns:
* `event` Event
* `window` BrowserWindow
Emitted when a [browserWindow](browser-window.md) gets blurred.
Event: '<API key>'
Returns:
* `event` Event
* `window` BrowserWindow
Emitted when a [browserWindow](browser-window.md) gets focused.
Event: '<API key>'
Returns:
* `event` Event
* `window` BrowserWindow
Emitted when a new [browserWindow](browser-window.md) is created.
Event: 'certificate-error'
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `url` URL
* `error` String - The error code
* `certificate` Object
* `data` Buffer - PEM encoded data
* `issuerName` String
* `callback` Function
Emitted when failed to verify the `certificate` for `url`, to trust the
certificate you should prevent the default behavior with
`event.preventDefault()` and call `callback(true)`.
javascript
session.on('certificate-error', function(event, webContents, url, error, certificate, callback) {
if (url == "https://github.com") {
// Verification logic.
event.preventDefault();
callback(true);
} else {
callback(false);
}
});
Event: '<API key>'
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `url` URL
* `certificateList` [Objects]
* `data` Buffer - PEM encoded data
* `issuerName` String - Issuer's Common Name
* `callback` Function
Emitted when a client certificate is requested.
The `url` corresponds to the navigation entry requesting the client certificate
and `callback` needs to be called with an entry filtered from the list. Using
`event.preventDefault()` prevents the application from using the first
certificate from the store.
javascript
app.on('<API key>', function(event, webContents, url, list, callback) {
event.preventDefault();
callback(list[0]);
})
Event: 'login'
Returns:
* `event` Event
* `webContents` [WebContents](web-contents.md)
* `request` Object
* `method` String
* `url` URL
* `referrer` URL
* `authInfo` Object
* `isProxy` Boolean
* `scheme` String
* `host` String
* `port` Integer
* `realm` String
* `callback` Function
Emitted when `webContents` wants to do basic auth.
The default behavior is to cancel all authentications, to override this you
should prevent the default behavior with `event.preventDefault()` and call
`callback(username, password)` with the credentials.
javascript
app.on('login', function(event, webContents, request, authInfo, callback) {
event.preventDefault();
callback('username', 'secret');
})
Event: 'gpu-process-crashed'
Emitted when the gpu process crashes.
## Methods
The `app` object has the following methods:
**Note:** Some methods are only available on specific operating systems and are labeled as such.
`app.quit()`
Try to close all windows. The `before-quit` event will be emitted first. If all
windows are successfully closed, the `will-quit` event will be emitted and by
default the application will terminate.
This method guarantees that all `beforeunload` and `unload` event handlers are
correctly executed. It is possible that a window cancels the quitting by
returning `false` in the `beforeunload` event handler.
`app.hide()` _OS X_
Hides all application windows without minimising them.
`app.show()` _OS X_
Shows application windows after they were hidden. Does not automatically focus them.
`app.exit(exitCode)`
* `exitCode` Integer
Exits immediately with `exitCode`.
All windows will be closed immediately without asking user and the `before-quit`
and `will-quit` events will not be emitted.
`app.getAppPath()`
Returns the current application directory.
`app.getPath(name)`
* `name` String
Retrieves a path to a special directory or file associated with `name`. On
failure an `Error` is thrown.
You can request the following paths by the name:
* `home` User's home directory.
* `appData` Per-user application data directory, which by default points to:
* `%APPDATA%` on Windows
* `$XDG_CONFIG_HOME` or `~/.config` on Linux
* `~/Library/Application Support` on OS X
* `userData` The directory for storing your app's configuration files, which by
default it is the `appData` directory appended with your app's name.
* `temp` Temporary directory.
* `exe` The current executable file.
* `module` The `libchromiumcontent` library.
* `desktop` The current user's Desktop directory.
* `documents` Directory for a user's "My Documents".
* `downloads` Directory for a user's downloads.
* `music` Directory for a user's music.
* `pictures` Directory for a user's pictures.
* `videos` Directory for a user's videos.
`app.setPath(name, path)`
* `name` String
* `path` String
Overrides the `path` to a special directory or file associated with `name`. If
the path specifies a directory that does not exist, the directory will be
created by this method. On failure an `Error` is thrown.
You can only override paths of a `name` defined in `app.getPath`.
By default, web pages' cookies and caches will be stored under the `userData`
directory. If you want to change this location, you have to override the
`userData` path before the `ready` event of the `app` module is emitted.
`app.getVersion()`
Returns the version of the loaded application. If no version is found in the
application's `package.json` file, the version of the current bundle or
executable is returned.
`app.getName()`
Returns the current application's name, which is the name in the application's
`package.json` file.
Usually the `name` field of `package.json` is a short lowercased name, according
to the npm modules spec. You should usually also specify a `productName`
field, which is your application's full capitalized name, and which will be
preferred over `name` by Electron.
`app.getLocale()`
Returns the current application locale.
`app.addRecentDocument(path)` _OS X_ _Windows_
* `path` String
Adds `path` to the recent documents list.
This list is managed by the OS. On Windows you can visit the list from the task
bar, and on OS X you can visit it from dock menu.
`app.<API key>()` _OS X_ _Windows_
Clears the recent documents list.
`app.setUserTasks(tasks)` _Windows_
* `tasks` Array - Array of `Task` objects
Adds `tasks` to the [Tasks][tasks] category of the JumpList on Windows.
`tasks` is an array of `Task` objects in the following format:
`Task` Object:
* `program` String - Path of the program to execute, usually you should
specify `process.execPath` which opens the current program.
* `arguments` String - The command line arguments when `program` is
executed.
* `title` String - The string to be displayed in a JumpList.
* `description` String - Description of this task.
* `iconPath` String - The absolute path to an icon to be displayed in a
JumpList, which can be an arbitrary resource file that contains an icon. You
can usually specify `process.execPath` to show the icon of the program.
* `iconIndex` Integer - The icon index in the icon file. If an icon file
consists of two or more icons, set this value to identify the icon. If an
icon file consists of one icon, this value is 0.
`app.<API key>(allow)`
* `allow` Boolean
Dynamically sets whether to always send credentials for HTTP NTLM or Negotiate
authentication - normally, Electron will only send NTLM/Kerberos credentials for
URLs that fall under "Local Intranet" sites (i.e. are in the same domain as you).
However, this detection often fails when corporate networks are badly configured,
so this lets you co-opt this behavior and enable it for all URLs.
`app.makeSingleInstance(callback)`
* `callback` Function
This method makes your application a Single Instance Application - instead of
allowing multiple instances of your app to run, this will ensure that only a
single instance of your app is running, and other instances signal this
instance and exit.
`callback` will be called with `callback(argv, workingDirectory)` when a second
instance has been executed. `argv` is an Array of the second instance's command
line arguments, and `workingDirectory` is its current working directory. Usually
applications respond to this by making their primary window focused and
non-minimized.
The `callback` is guaranteed to be executed after the `ready` event of `app`
gets emitted.
This method returns `false` if your process is the primary instance of the
application and your app should continue loading. And returns `true` if your
process has sent its parameters to another instance, and you should immediately
quit.
On OS X the system enforces single instance automatically when users try to open
a second instance of your app in Finder, and the `open-file` and `open-url`
events will be emitted for that. However when users start your app in command
line the system's single instance machanism will be bypassed and you have to
use this method to ensure single instance.
An example of activating the window of primary instance when a second instance
starts:
js
var myWindow = null;
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
// Someone tried to run a second instance, we should focus our window.
if (myWindow) {
if (myWindow.isMinimized()) myWindow.restore();
myWindow.focus();
}
return true;
});
if (shouldQuit) {
app.quit();
return;
}
// Create myWindow, load the rest of the app, etc...
app.on('ready', function() {
});
`app.setAppUserModelId(id)` _Windows_
* `id` String
Changes the [Application User Model ID][app-user-model-id] to `id`.
`app.isAeroGlassEnabled()` _Windows_
This method returns `true` if [DWM composition](https://msdn.microsoft.com/en-us/library/windows/desktop/aa969540.aspx)
(Aero Glass) is enabled, and `false` otherwise. You can use it to determine if
you should create a transparent window or not (transparent windows won't work
correctly when DWM composition is disabled).
Usage example:
js
let browserOptions = {width: 1000, height: 800};
// Make the window transparent only if the platform supports it.
if (process.platform !== 'win32' || app.isAeroGlassEnabled()) {
browserOptions.transparent = true;
browserOptions.frame = false;
}
// Create the window.
win = new BrowserWindow(browserOptions);
// Navigate.
if (browserOptions.transparent) {
win.loadURL('file://' + __dirname + '/index.html');
} else {
// No transparency, so we load a fallback that uses basic styles.
win.loadURL('file://' + __dirname + '/fallback.html');
}
`app.commandLine.appendSwitch(switch[, value])`
Append a switch (with optional `value`) to Chromium's command line.
**Note:** This will not affect `process.argv`, and is mainly used by developers
to control some low-level Chromium behaviors.
`app.commandLine.appendArgument(value)`
Append an argument to Chromium's command line. The argument will be quoted
correctly.
**Note:** This will not affect `process.argv`.
`app.dock.bounce([type])` _OS X_
* `type` String (optional) - Can be `critical` or `informational`. The default is
`informational`
When `critical` is passed, the dock icon will bounce until either the
application becomes active or the request is canceled.
When `informational` is passed, the dock icon will bounce for one second.
However, the request remains active until either the application becomes active
or the request is canceled.
Returns an ID representing the request.
`app.dock.cancelBounce(id)` _OS X_
* `id` Integer
Cancel the bounce of `id`.
`app.dock.setBadge(text)` _OS X_
* `text` String
Sets the string to be displayed in the dock’s badging area.
`app.dock.getBadge()` _OS X_
Returns the badge string of the dock.
`app.dock.hide()` _OS X_
Hides the dock icon.
`app.dock.show()` _OS X_
Shows the dock icon.
`app.dock.setMenu(menu)` _OS X_
* `menu` Menu
Sets the application's [dock menu][dock-menu].
`app.dock.setIcon(image)` _OS X_
* `image` [NativeImage](native-image.md)
Sets the `image` associated with this dock icon.
[dock-menu]:https://developer.apple.com/library/mac/documentation/Carbon/Conceptual/<API key>/concepts/dockconcepts.html#//apple_ref/doc/uid/<API key>
[tasks]:http://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
|
'use strict';
var path = require('path');
var helpers = require('yeoman-generator').test;
var assert = require('yeoman-assert');
describe('test framework', function () {
describe('mocha', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(__dirname, '.tmp'))
.withOptions({
'skip-install': true,
'test-framework': 'mocha'
})
.withPrompts({features: []})
.on('end', done);
});
it('adds the Grunt plugin', function () {
assert.fileContent('package.json', '"grunt-mocha"');
});
it('adds the Grunt task', function () {
assert.fileContent('Gruntfile.js', 'mocha');
});
it('uses the ESLint environment', function () {
assert.fileContent('package.json', '"mocha"');
});
});
describe('jasmine', function () {
before(function (done) {
helpers.run(path.join(__dirname, '../app'))
.inDir(path.join(__dirname, '.tmp'))
.withOptions({
'skip-install': true,
'test-framework': 'jasmine'
})
.withPrompts({features: []})
.on('end', done);
});
it('adds the Grunt plugin', function () {
assert.fileContent('package.json', '"<API key>"');
});
it('adds the Grunt task', function () {
assert.fileContent('Gruntfile.js', 'jasmine');
});
it('uses the ESLint environment', function () {
assert.fileContent('package.json', '"jasmine"');
});
});
});
|
/*jshint maxstatements:false*/
define(function (require, exports) {
"use strict";
var moment = require("moment"),
Promise = require("bluebird"),
_ = brackets.getModule("thirdparty/lodash"),
CodeInspection = brackets.getModule("language/CodeInspection"),
CommandManager = brackets.getModule("command/CommandManager"),
Commands = brackets.getModule("command/Commands"),
Dialogs = brackets.getModule("widgets/Dialogs"),
DocumentManager = brackets.getModule("document/DocumentManager"),
EditorManager = brackets.getModule("editor/EditorManager"),
FileUtils = brackets.getModule("file/FileUtils"),
FileViewController = brackets.getModule("project/FileViewController"),
KeyBindingManager = brackets.getModule("command/KeyBindingManager"),
LanguageManager = brackets.getModule("language/LanguageManager"),
FileSystem = brackets.getModule("filesystem/FileSystem"),
Menus = brackets.getModule("command/Menus"),
FindInFiles = brackets.getModule("search/FindInFiles"),
PanelManager = brackets.getModule("view/PanelManager"),
ProjectManager = brackets.getModule("project/ProjectManager"),
StringUtils = brackets.getModule("utils/StringUtils"),
Svn = require("src/svn/Svn"),
Events = require("./Events"),
EventEmitter = require("./EventEmitter"),
Preferences = require("./Preferences"),
ErrorHandler = require("./ErrorHandler"),
ExpectedError = require("./ExpectedError"),
Main = require("./Main"),
GutterManager = require("./GutterManager"),
Strings = require("../strings"),
Utils = require("src/Utils"),
SettingsDialog = require("./SettingsDialog"),
PANEL_COMMAND_ID = "brackets-git.panel";
var svnPanelTemplate = require("text!templates/svn-panel.html"),
<API key> = require("text!templates/git-panel-results.html"),
git<API key> = require("text!templates/authors-dialog.html"),
<API key> = require("text!templates/git-commit-dialog.html"),
<API key> = require("text!templates/git-diff-dialog.html"),
<API key> = require("text!templates/git-question-dialog.html");
var showFileWhiteList = /^\.gitignore$/;
var gitPanel = null,
$gitPanel = $(null),
gitPanelDisabled = null,
gitPanelMode = null,
showingUntracked = true,
$tableContainer = $(null);
/**
* Reloads the Document's contents from disk, discarding any unsaved changes in the editor.
*
* @param {!Document} doc
* @return {Promise} Resolved after editor has been refreshed; rejected if unable to load the
* file's new content. Errors are logged but no UI is shown.
*/
function _reloadDoc(doc) {
return Promise.cast(FileUtils.readAsText(doc.file))
.then(function (text) {
doc.refreshText(text, new Date());
})
.catch(function (err) {
ErrorHandler.logError("Error reloading contents of " + doc.file.fullPath);
ErrorHandler.logError(err);
});
}
function lintFile(filename) {
return CodeInspection.inspectFile(FileSystem.getFileForPath(Utils.getProjectRoot() + filename));
}
function _makeDialogBig($dialog) {
var $wrapper = $dialog.parents(".modal-wrapper").first();
if ($wrapper.length === 0) { return; }
// We need bigger commit dialog
var minWidth = 500,
minHeight = 300,
maxWidth = $wrapper.width(),
maxHeight = $wrapper.height(),
desiredWidth = maxWidth / 2,
desiredHeight = maxHeight / 2;
if (desiredWidth < minWidth) { desiredWidth = minWidth; }
if (desiredHeight < minHeight) { desiredHeight = minHeight; }
$dialog
.width(desiredWidth)
.children(".modal-body")
.css("max-height", desiredHeight)
.end();
return { width: desiredWidth, height: desiredHeight };
}
function _showCommitDialog(stagedDiff, lintResults, prefilledMessage) {
// Flatten the error structure from various providers
lintResults.forEach(function (lintResult) {
lintResult.errors = [];
if (Array.isArray(lintResult.result)) {
lintResult.result.forEach(function (resultSet) {
if (!resultSet.result || !resultSet.result.errors) { return; }
var providerName = resultSet.provider.name;
resultSet.result.errors.forEach(function (e) {
lintResult.errors.push((e.pos.line + 1) + ": " + e.message + " (" + providerName + ")");
});
});
} else {
ErrorHandler.logError("[brackets-git] lintResults contain object in unexpected format: " + JSON.stringify(lintResult));
}
lintResult.hasErrors = lintResult.errors.length > 0;
});
// Filter out only results with errors to show
lintResults = _.filter(lintResults, function (lintResult) {
return lintResult.hasErrors;
});
// Open the dialog
var compiledTemplate = Mustache.render(<API key>, {
Strings: Strings,
hasLintProblems: lintResults.length > 0,
lintResults: lintResults
}),
dialog = Dialogs.<API key>(compiledTemplate),
$dialog = dialog.getElement();
// We need bigger commit dialog
_makeDialogBig($dialog);
// Show nicely colored commit diff
$dialog.find(".commit-diff").append(Utils.formatDiff(stagedDiff));
function <API key>() {
var r = $dialog.find("[name='commit-message']:visible");
if (r.length !== 1) {
r = $dialog.find("[name='commit-message']");
for (var i = 0; i < r.length; i++) {
if ($(r[i]).css("display") !== "none") {
return $(r[i]);
}
}
}
return r;
}
var $commitMessageCount = $dialog.find("input[name='<API key>']");
// Add event to count characters in commit message
var <API key> = function () {
var val = <API key>().val().trim(),
length = val.length;
if (val.indexOf("\n")) {
// longest line
length = Math.max.apply(null, val.split("\n").map(function (l) { return l.length; }));
}
$commitMessageCount
.val(length)
.toggleClass("over50", length > 50 && length <= 100)
.toggleClass("over100", length > 100);
};
var usingTextArea = false;
// commit message handling
function <API key>() {
usingTextArea = !usingTextArea;
var findStr = "[name='commit-message']",
currentValue = $dialog.find(findStr + ":visible").val();
$dialog.find(findStr).toggle();
$dialog.find(findStr + ":visible")
.val(currentValue)
.focus();
<API key>();
}
$dialog.find("button.primary").on("click", function (e) {
var $commitMessage = <API key>();
if ($commitMessage.val().trim().length === 0) {
e.stopPropagation();
$commitMessage.addClass("invalid");
} else {
$commitMessage.removeClass("invalid");
}
});
$dialog.find("button.extendedCommit").on("click", function () {
<API key>();
// this value will be set only when manually triggered
Preferences.set("<API key>", usingTextArea);
});
function prefillMessage(msg) {
if (msg.indexOf("\n") !== -1 && !usingTextArea) {
<API key>();
}
$dialog.find("[name='commit-message']:visible").val(msg);
<API key>();
}
if (Preferences.get("<API key>")) {
<API key>();
}
if (prefilledMessage) {
prefillMessage(prefilledMessage.trim());
}
// Add focus to commit message input
<API key>().focus();
$dialog.find("[name='commit-message']")
.on("keyup", <API key>)
.on("change", <API key>);
<API key>();
dialog.done(function (buttonId) {
if (buttonId === "ok") {
// this event won't launch when commit-message is empty so its safe to assume that it is not
var commitMessage = <API key>().val();
// if commit message is extended and has a newline, put an empty line after first line to separate subject and body
var s = commitMessage.split("\n");
if (s.length > 1 && s[1].trim() !== "") {
s.splice(1, 0, "");
}
commitMessage = s.join("\n");
// now we are going to be paranoid and we will check if some mofo didn't change our diff
_getStagedDiff().then(function (diff) {
if (diff === stagedDiff) {
return Svn.commit(commitMessage);
} else {
throw new Error("Index was changed while commit dialog was shown!");
}
}).catch(function (err) {
ErrorHandler.showError(err, "Git Commit failed");
}).finally(function () {
EventEmitter.emit(Events.GIT_COMMITED);
refresh();
});
} else {
// this will trigger refreshing where appropriate
Svn.status();
}
});
}
function _showAuthors(file, blame, fromLine, toLine) {
var linesTotal = blame.length;
var blameStats = blame.reduce(function (stats, lineInfo) {
var name = lineInfo.author + " " + lineInfo["author-mail"];
if (stats[name]) {
stats[name] += 1;
} else {
stats[name] = 1;
}
return stats;
}, {});
blameStats = _.reduce(blameStats, function (arr, val, key) {
arr.push({
authorName: key,
lines: val,
percentage: Math.round(val / (linesTotal / 100))
});
return arr;
}, []);
blameStats = _.sortBy(blameStats, "lines").reverse();
if (fromLine || toLine) {
file += " (" + Strings.LINES + " " + fromLine + "-" + toLine + ")";
}
var compiledTemplate = Mustache.render(git<API key>, {
file: file,
blameStats: blameStats,
Strings: Strings
});
Dialogs.<API key>(compiledTemplate);
}
function _getCurrentFilePath(editor) {
var projectRoot = Utils.getProjectRoot(),
document = editor ? editor.document : DocumentManager.getCurrentDocument(),
filePath = document.file.fullPath;
if (filePath.indexOf(projectRoot) === 0) {
filePath = filePath.substring(projectRoot.length);
}
return filePath;
}
function <API key>() {
var editor = EditorManager.getActiveEditor(),
filePath = _getCurrentFilePath(editor),
currentSelection = editor.getSelection(),
fromLine = currentSelection.start.line + 1,
toLine = currentSelection.end.line + 1;
// fix when nothing is selected on that line
if (currentSelection.end.ch === 0) { toLine = toLine - 1; }
var isSomethingSelected = currentSelection.start.line !== currentSelection.end.line ||
currentSelection.start.ch !== currentSelection.end.ch;
if (!isSomethingSelected) {
ErrorHandler.showError(new ExpectedError("Nothing is selected!"));
return;
}
Svn.getBlame(filePath, fromLine, toLine).then(function (blame) {
return _showAuthors(filePath, blame, fromLine, toLine);
}).catch(function (err) {
ErrorHandler.showError(err, "Git Blame failed");
});
}
function handleAuthorsFile() {
var filePath = _getCurrentFilePath();
Svn.getBlame(filePath).then(function (blame) {
return _showAuthors(filePath, blame);
}).catch(function (err) {
ErrorHandler.showError(err, "Git Blame failed");
});
}
function handleGitDiff(file) {
Svn.diffFileNice(file).then(function (diff) {
// show the dialog with the diff
var compiledTemplate = Mustache.render(<API key>, { file: file, Strings: Strings }),
dialog = Dialogs.<API key>(compiledTemplate),
$dialog = dialog.getElement();
_makeDialogBig($dialog);
$dialog.find(".commit-diff").append(Utils.formatDiff(diff));
}).catch(function (err) {
ErrorHandler.showError(err, "SVN Diff failed");
});
}
function handleGitUndo(file) {
var compiledTemplate = Mustache.render(<API key>, {
title: Strings.UNDO_CHANGES,
question: StringUtils.format(Strings.Q_UNDO_CHANGES, _.escape(file)),
Strings: Strings
});
Dialogs.<API key>(compiledTemplate).done(function (buttonId) {
if (buttonId === "ok") {
Svn.discardFileChanges(file).then(function () {
var currentProjectRoot = Utils.getProjectRoot();
DocumentManager.getAllOpenDocuments().forEach(function (doc) {
if (doc.file.fullPath === currentProjectRoot + file) {
_reloadDoc(doc);
}
});
refresh();
}).catch(function (err) {
ErrorHandler.showError(err, "Git Checkout failed");
});
}
});
}
function handleGitDelete(file) {
var compiledTemplate = Mustache.render(<API key>, {
title: Strings.DELETE_FILE,
question: StringUtils.format(Strings.Q_DELETE_FILE, _.escape(file)),
Strings: Strings
});
Dialogs.<API key>(compiledTemplate).done(function (buttonId) {
if (buttonId === "ok") {
FileSystem.resolve(Utils.getProjectRoot() + file, function (err, fileEntry) {
if (err) {
ErrorHandler.showError(err, "Could not resolve file");
return;
}
Promise.cast(ProjectManager.deleteItem(fileEntry))
.then(function () {
refresh();
})
.catch(function (err) {
ErrorHandler.showError(err, "File deletion failed");
});
});
}
});
}
function handleGlobalUpdate(){
var files = [];
return handleSvnUpdate(files);
}
function handleSvnUpdate(files){
if(!_.isArray(files)) return;
return Svn.updateFile(files).then(function(stdout){
refresh();
});
}
/**
* strips trailing whitespace from all the diffs and adds \n to the end
*/
function <API key>(filename, clearWholeFile) {
return new Promise(function (resolve, reject) {
var fullPath = Utils.getProjectRoot() + filename,
removeBom = Preferences.get("removeByteOrderMark"),
<API key> = Preferences.get("<API key>");
var _cleanLines = function (lineNumbers) {
// clean the file
var fileEntry = FileSystem.getFileForPath(fullPath);
return FileUtils.readAsText(fileEntry).then(function (text) {
if (removeBom) {
// remove BOM - \ufeff
text = text.replace(/\ufeff/g, "");
}
if (<API key>) {
// normalizes line endings
text = text.replace(/\r\n/g, "\n");
}
// process lines
var lines = text.split("\n");
if (lineNumbers) {
lineNumbers.forEach(function (lineNumber) {
lines[lineNumber] = lines[lineNumber].replace(/\s+$/, "");
});
} else {
lines.forEach(function (ln, lineNumber) {
lines[lineNumber] = lines[lineNumber].replace(/\s+$/, "");
});
}
// add empty line to the end, i've heard that git likes that for some reason
if (Preferences.get("<API key>")) {
var lastLineNumber = lines.length - 1;
if (lines[lastLineNumber].length > 0) {
lines[lastLineNumber] = lines[lastLineNumber].replace(/\s+$/, "");
}
if (lines[lastLineNumber].length > 0) {
lines.push("");
}
}
text = lines.join("\n");
return Promise.cast(FileUtils.writeText(fileEntry, text))
.catch(function (err) {
ErrorHandler.logError("Wasn't able to clean whitespace from file: " + fullPath);
resolve();
throw err;
})
.then(function () {
// refresh the file if it's open in the background
DocumentManager.getAllOpenDocuments().forEach(function (doc) {
if (doc.file.fullPath === fullPath) {
_reloadDoc(doc);
}
});
// diffs were cleaned in this file
resolve();
});
});
};
if (clearWholeFile) {
_cleanLines(null);
} else {
Svn.diffFile(filename).then(function (diff) {
if (!diff) { return resolve(); }
var modified = [],
changesets = diff.split("\n").filter(function (l) { return l.match(/^@@/) !== null; });
// collect line numbers to clean
changesets.forEach(function (line) {
var i,
m = line.match(/^@@ -([,0-9]+) \+([,0-9]+) @@/),
s = m[2].split(","),
from = parseInt(s[0], 10),
to = from - 1 + (parseInt(s[1], 10) || 1);
for (i = from; i <= to; i++) { modified.push(i > 0 ? i - 1 : 0); }
});
_cleanLines(modified);
}).catch(function (ex) {
// This error will bubble up to preparing commit dialog so just log here
ErrorHandler.logError(ex);
reject(ex);
});
}
});
}
function _getStagedDiff() {
return Svn.<API key>().then(function (diff) {
if (!diff) {
return Svn.<API key>().then(function (filesList) {
return Strings.<API key> + "\n\n" + filesList;
});
}
return diff;
});
}
// whatToDo gets values "continue" "skip" "abort"
function handleRebase(whatToDo) {
Svn.rebase(whatToDo).then(function () {
EventEmitter.emit(Events.REFRESH_ALL);
}).catch(function (err) {
ErrorHandler.showError(err, "Rebase " + whatToDo + " failed");
});
}
function abortMerge() {
Svn.discardAllChanges().then(function () {
EventEmitter.emit(Events.REFRESH_ALL);
}).catch(function (err) {
ErrorHandler.showError(err, "Merge abort failed");
});
}
function findConflicts() {
FindInFiles.doSearch(/^<<<<<<<\s|^=======\s|^>>>>>>>\s/gm);
}
function commitMerge() {
Utils.loadPathContent(Utils.getProjectRoot() + "/.git/MERGE_MSG").then(function (msg) {
handleGitCommit(msg);
}).catch(function (err) {
ErrorHandler.showError(err, "Merge commit failed");
});
}
function handleGitCommit(prefilledMessage) {
var <API key> = Preferences.get("useCodeInspection");
var stripWhitespace = Preferences.get("<API key>");
// Disable button (it will be enabled when selecting files after reset)
Utils.setLoading($gitPanel.find(".git-commit"));
// First reset staged files, then add selected files to the index.
Svn.status().then(function (files) {
files = _.filter(files, function (file) {
return file.status.indexOf(Svn.FILE_STATUS.MODIFIED) !== -1;
});
if (files.length === 0) {
return ErrorHandler.showError(new Error("Commit button should have been disabled"), "Nothing staged to commit");
}
var lintResults = [],
promises = [];
files.forEach(function (fileObj) {
var queue = Promise.resolve();
var isDeleted = fileObj.status.indexOf(Svn.FILE_STATUS.DELETED) !== -1,
updateIndex = isDeleted;
// strip whitespace if configured to do so and file was not deleted
if (stripWhitespace && !isDeleted) {
// strip whitespace only for recognized languages so binary files won't get corrupted
var langId = LanguageManager.getLanguageForPath(fileObj.file).getId();
if (["unknown", "binary", "image", "markdown"].indexOf(langId) === -1) {
queue = queue.then(function () {
var clearWholeFile = fileObj.status.indexOf(Svn.FILE_STATUS.UNTRACKED) !== -1 ||
fileObj.status.indexOf(Svn.FILE_STATUS.RENAMED) !== -1;
return <API key>(fileObj.file, clearWholeFile);
});
}
}
// do a code inspection for the file, if it was not deleted
if (<API key> && !isDeleted) {
queue = queue.then(function () {
return lintFile(fileObj.file).then(function (result) {
if (result) {
lintResults.push({
filename: fileObj.file,
result: result
});
}
});
});
}
promises.push(queue);
});
return Promise.all(promises).then(function () {
// All files are in the index now, get the diff and show dialog.
return _getStagedDiff().then(function (diff) {
return _showCommitDialog(diff, lintResults, prefilledMessage);
});
});
}).catch(function (err) {
ErrorHandler.showError(err, "Preparing commit dialog failed");
}).finally(function () {
Utils.unsetLoading($gitPanel.find(".git-commit"));
});
}
function refreshCurrentFile() {
var currentProjectRoot = Utils.getProjectRoot();
var currentDoc = DocumentManager.getCurrentDocument();
if (currentDoc) {
$gitPanel.find("tr").each(function () {
var currentFullPath = currentDoc.file.fullPath,
thisFile = $(this).attr("x-file");
$(this).toggleClass("selected", currentProjectRoot + thisFile === currentFullPath);
});
} else {
$gitPanel.find("tr").removeClass("selected");
}
}
function shouldShow(fileObj) {
if (showFileWhiteList.test(fileObj.name)) {
return true;
}
return ProjectManager.shouldShow(fileObj);
}
function <API key>(files) {
if (!gitPanel.isVisible()) {
return;
}
// remove files that we should not show
files = _.filter(files, function (file) {
return shouldShow(file);
});
var allStaged = files.length > 0 && _.all(files, function (file) { return file.status.indexOf(Svn.FILE_STATUS.STAGED) !== -1; });
$gitPanel.find(".check-all").prop("checked", allStaged).prop("disabled", files.length === 0);
var $editedList = $tableContainer.find(".git-edited-list");
var visibleBefore = $editedList.length ? $editedList.is(":visible") : true;
$editedList.remove();
if (files.length === 0) {
$tableContainer.append($("<p class='git-edited-list nothing-to-commit' />").text(Strings.NOTHING_TO_COMMIT));
} else {
// if desired, remove untracked files from the results
if (showingUntracked === false) {
files = _.filter(files, function (file) {
return file.status.indexOf(Svn.FILE_STATUS.UNTRACKED) === -1;
});
}
files.forEach(function (file) {
file.staged = file.status.indexOf(Svn.FILE_STATUS.STAGED) !== -1;
file.statusText = file.status.map(function (status) {
return Strings["FILE_" + status];
}).join(", ");
file.allowDiff = file.status.indexOf(Svn.FILE_STATUS.UNTRACKED) === -1 &&
file.status.indexOf(Svn.FILE_STATUS.RENAMED) === -1 &&
file.status.indexOf(Svn.FILE_STATUS.DELETED) === -1;
file.allowDelete = file.status.indexOf(Svn.FILE_STATUS.UNTRACKED) !== -1;
file.allowUndo = !file.allowDelete && file.status.indexOf(Svn.FILE_STATUS.MODIFIED) !== -1;
file.allowUpdate = file.status.indexOf(Svn.FILE_STATUS.OUTOFDATE) !== -1;
file.allowAdd = file.status.indexOf(Svn.FILE_STATUS.UNTRACKED) > -1;
});
$tableContainer.append(Mustache.render(<API key>, {
files: files,
Strings: Strings
}));
refreshCurrentFile();
}
$tableContainer.find(".git-edited-list").toggle(visibleBefore);
}
function refresh() {
// set the history panel to false and remove the class that show the button history active when refresh
$gitPanel.find(".git-history-toggle").removeClass("active").attr("title", Strings.<API key>);
$gitPanel.find(".git-file-history").removeClass("active").attr("title", Strings.<API key>);
if (gitPanelMode === "not-repo") {
$tableContainer.empty();
return Promise.resolve();
}
$tableContainer.find("#git-history-list").remove();
$tableContainer.find(".git-edited-list").show();
var p1 = Svn.status(true);
//- push button
//var $pushBtn = $gitPanel.find(".git-push");
// var p2 = Svn.getCommitsAhead().then(function (commits) {
// $pushBtn.children("span").remove();
// if (commits.length > 0) {
// $pushBtn.append($("<span/>").text(" (" + commits.length + ")"));
// }).catch(function () {
// $pushBtn.children("span").remove();
// FUTURE: who listens for this?
return Promise.all([p1]);
}
function toggle(bool) {
if (gitPanelDisabled === true) {
return;
}
if (typeof bool !== "boolean") {
bool = !gitPanel.isVisible();
}
Preferences.persist("panelEnabled", bool);
Main.$icon.toggleClass("on", bool);
gitPanel.setVisible(bool);
// Mark menu item as enabled/disabled.
CommandManager.get(PANEL_COMMAND_ID).setChecked(bool);
if (bool) {
refresh();
}
}
function <API key>() {
showingUntracked = !showingUntracked;
$gitPanel
.find(".<API key>")
.text(showingUntracked ? Strings.HIDE_UNTRACKED : Strings.SHOW_UNTRACKED);
refresh();
}
function commitCurrentFile() {
return Promise.cast(CommandManager.execute("file.save"))
.then(function () {
return Svn.resetIndex();
})
.then(function () {
var currentProjectRoot = Utils.getProjectRoot();
var currentDoc = DocumentManager.getCurrentDocument();
if (currentDoc) {
var relativePath = currentDoc.file.fullPath.substring(currentProjectRoot.length);
return Svn.stage(relativePath).then(function () {
return handleGitCommit();
});
}
});
}
function commitAllFiles() {
return Promise.cast(CommandManager.execute("file.saveAll"))
.then(function () {
return Svn.resetIndex();
})
.then(function () {
return Svn.stageAll().then(function () {
return handleGitCommit();
});
});
}
// Disable "commit" button if there aren't staged files to commit
function _toggleCommitButton(files) {
var anyStaged = _.any(files, function (file) { return file.status.indexOf(Svn.FILE_STATUS.STAGED) !== -1; });
$gitPanel.find(".git-commit").prop("disabled", !anyStaged);
}
EventEmitter.on(Events.GIT_STATUS_RESULTS, function (results) {
<API key>(results);
_toggleCommitButton(results);
});
function undoLastLocalCommit() {
Svn.undoLastLocalCommit()
.catch(function (err) {
ErrorHandler.showError(err, "Impossible to undo last commit");
})
.finally(function () {
refresh();
});
}
var lastCheckOneClicked = null;
function <API key>() {
$tableContainer = $gitPanel.find(".table-container")
.off()
.on("click", ".check-one", function (e) {
e.stopPropagation();
var $tr = $(this).closest("tr"),
file = $tr.attr("x-file"),
status = $tr.attr("x-status"),
isChecked = $(this).is(":checked");
if (e.shiftKey) {
// do something if we press shift. Right now? Nothing.
}
lastCheckOneClicked = file;
})
.on("dblclick", ".check-one", function (e) {
e.stopPropagation();
})
.on("click", ".btn-git-diff", function (e) {
e.stopPropagation();
handleGitDiff($(e.target).closest("tr").attr("x-file"));
})
.on("click", ".btn-git-undo", function (e) {
e.stopPropagation();
handleGitUndo($(e.target).closest("tr").attr("x-file"));
})
.on("click", ".btn-git-delete", function (e) {
e.stopPropagation();
handleGitDelete($(e.target).closest("tr").attr("x-file"));
})
.on("click", ".btn-svn-add", function(e) {
e.stopPropagation();
handleSvnAdd($(e.target).closest("tr").attr("x-file"));
})
.on("click", ".btn-svn-update", function (e) {
e.stopPropagation();
handleSvnUpdate([$(e.target).closest("tr").attr("x-file")]);
})
.on("click", ".modified-file", function (e) {
var $this = $(e.currentTarget);
if ($this.attr("x-status") === Svn.FILE_STATUS.DELETED) {
return;
}
CommandManager.execute(Commands.FILE_OPEN, {
fullPath: Utils.getProjectRoot() + $this.attr("x-file")
});
})
.on("dblclick", ".modified-file", function (e) {
var $this = $(e.currentTarget);
if ($this.attr("x-status") === Svn.FILE_STATUS.DELETED) {
return;
}
FileViewController.<API key>(Utils.getProjectRoot() + $this.attr("x-file"));
});
}
function discardAllChanges() {
return Utils.askQuestion(Strings.RESET_LOCAL_REPO, Strings.<API key>, { booleanResponse: true })
.then(function (response) {
if (response) {
return Svn.discardAllChanges().catch(function (err) {
ErrorHandler.showError(err, "Reset of local repository failed");
}).then(function () {
refresh();
});
}
});
}
function init() {
// Add panel
var panelHtml = Mustache.render(svnPanelTemplate, {
<API key>: Preferences.get("<API key>"),
showBashButton: Preferences.get("showBashButton"),
showReportBugButton: Preferences.get("showReportBugButton"),
S: Strings
});
var $panelHtml = $(panelHtml);
$panelHtml.find(".git-available, .git-not-available").hide();
gitPanel = PanelManager.createBottomPanel("brackets-git.panel", $panelHtml, 100);
$gitPanel = gitPanel.$panel;
$gitPanel
.on("click", ".close", toggle)
.on("click", ".check-all", function () {
$('.check-one').attr('checked',true);
})
.on("click", ".git-refresh", EventEmitter.emitFactory(Events.REFRESH_ALL))
.on("click", ".git-commit", EventEmitter.emitFactory(Events.HANDLE_GIT_COMMIT))
.on("click", ".git-commit-merge", commitMerge)
.on("click", ".svn-update", handleGlobalUpdate)
.on("click", ".git-find-conflicts", findConflicts)
.on("click", ".git-prev-gutter", GutterManager.goToPrev)
.on("click", ".git-next-gutter", GutterManager.goToNext)
.on("click", ".<API key>", <API key>)
.on("click", ".authors-selection", <API key>)
.on("click", ".authors-file", handleAuthorsFile)
.on("click", ".git-file-history", EventEmitter.emitFactory(Events.HISTORY_SHOW, "FILE"))
.on("click", ".git-history-toggle", EventEmitter.emitFactory(Events.HISTORY_SHOW, "GLOBAL"))
.on("click", ".git-bug", ErrorHandler.reportBug)
.on("click", ".git-settings", SettingsDialog.show)
.on("contextmenu", "tr", function (e) {
var $this = $(this);
if ($this.hasClass("history-commit")) { return; }
$this.click();
setTimeout(function () {
Menus.getContextMenu("<API key>").open(e);
}, 1);
})
.on("click", ".git-bash", EventEmitter.emitFactory(Events.TERMINAL_OPEN))
.on("click", ".reset-all", discardAllChanges);
// Attaching table handlers
<API key>();
// Commit current and all shortcuts
var COMMIT_CURRENT_CMD = "brackets-git.commitCurrent",
COMMIT_ALL_CMD = "brackets-git.commitAll",
BASH_CMD = "brackets-git.launchBash",
PUSH_CMD = "brackets-git.push",
PULL_CMD = "brackets-git.pull",
GOTO_PREV_CHANGE = "brackets-git.gotoPrevChange",
GOTO_NEXT_CHANGE = "brackets-git.gotoNextChange";
// Add command to menu.
// Register command for opening bottom panel.
CommandManager.register(Strings.PANEL_COMMAND, PANEL_COMMAND_ID, toggle);
KeyBindingManager.addBinding(PANEL_COMMAND_ID, Preferences.get("panelShortcut"));
CommandManager.register(Strings.<API key>, COMMIT_CURRENT_CMD, commitCurrentFile);
KeyBindingManager.addBinding(COMMIT_CURRENT_CMD, Preferences.get("<API key>"));
CommandManager.register(Strings.COMMIT_ALL_SHORTCUT, COMMIT_ALL_CMD, commitAllFiles);
KeyBindingManager.addBinding(COMMIT_ALL_CMD, Preferences.get("commitAllShortcut"));
CommandManager.register(Strings.<API key>, BASH_CMD, EventEmitter.emitFactory(Events.TERMINAL_OPEN));
KeyBindingManager.addBinding(BASH_CMD, Preferences.get("bashShortcut"));
CommandManager.register(Strings.PUSH_SHORTCUT, PUSH_CMD, EventEmitter.emitFactory(Events.HANDLE_PUSH));
KeyBindingManager.addBinding(PUSH_CMD, Preferences.get("pushShortcut"));
CommandManager.register(Strings.PULL_SHORTCUT, PULL_CMD, EventEmitter.emitFactory(Events.HANDLE_PULL));
KeyBindingManager.addBinding(PULL_CMD, Preferences.get("pullShortcut"));
CommandManager.register(Strings.<API key>, GOTO_PREV_CHANGE, GutterManager.goToPrev);
KeyBindingManager.addBinding(GOTO_PREV_CHANGE, Preferences.get("<API key>"));
CommandManager.register(Strings.<API key>, GOTO_NEXT_CHANGE, GutterManager.goToNext);
KeyBindingManager.addBinding(GOTO_NEXT_CHANGE, Preferences.get("<API key>"));
// Init moment - use the correct language
moment.lang(brackets.getLocale());
if(Svn.isWorkingCopy()){
enable();
}
// Show gitPanel when appropriate
if (Preferences.get("panelEnabled")) {
toggle(true);
}
}
function enable() {
EventEmitter.emit(Events.SVN_ENABLED);
// this function is called after every Branch.refresh
gitPanelMode = null;
$gitPanel.find(".git-available").show();
$gitPanel.find(".git-not-available").hide();
Main.$icon.removeClass("warning").removeAttr("title");
gitPanelDisabled = false;
// after all is enabled
refresh();
}
function disable(cause) {
EventEmitter.emit(Events.GIT_DISABLED, cause);
gitPanelMode = cause;
// causes: not-repo
if (gitPanelMode === "not-repo") {
$gitPanel.find(".git-available").hide();
$gitPanel.find(".git-not-available").show();
} else {
Main.$icon.addClass("warning").attr("title", cause);
toggle(false);
gitPanelDisabled = true;
}
refresh();
}
// Event listeners
EventEmitter.on(Events.<API key>, function () {
if (!gitPanel) { return; }
refreshCurrentFile();
});
EventEmitter.on(Events.<API key>, function () {
if (!gitPanel) { return; }
refresh();
});
EventEmitter.on(Events.REBASE_MERGE_MODE, function (rebaseEnabled, mergeEnabled) {
$gitPanel.find(".git-rebase").toggle(rebaseEnabled);
$gitPanel.find(".git-merge").toggle(mergeEnabled);
$gitPanel.find("button.git-commit").toggle(!rebaseEnabled && !mergeEnabled);
});
EventEmitter.on(Events.HANDLE_GIT_COMMIT, function () {
handleGitCommit();
});
exports.init = init;
exports.refresh = refresh;
exports.toggle = toggle;
exports.enable = enable;
exports.disable = disable;
exports.getPanel = function () { return $gitPanel; };
});
|
#!/bin/bash
source ../common.sh
subsection "oh-my-zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
chsh -s /bin/zsh
mv "${HOME}/.zshrc.pre-oh-my-zsh" "${HOME}/.zshrc"
|
<article id="post-<?php print $ID ?>" <?php post_class(); ?>>
<div class="tb-short-img">
<?php
toebox\inc\ToeBox::HandleFeaturedImage();
?>
</div>
<?php
print \toebox\inc\ToeBox::FormatListTitle($post_title, get_the_permalink());
?>
<div class="entry-metadata">
<!-- TODO: allow setting for turning author and date off on posts -->
<span class="tb-date"><?php the_time(get_option('date_format')); ?></span>
|
<span class="tb-author"><?php print get_the_author(); ?></span>
|
<span class="tb-category"><?php the_category(', ') ?></span>
|
<span class="tb-tags"><?php the_tags( 'Tags: ', ', ', '' ); ?></span>
</div>
<div class="entry-excerpt">
<?php print $body ?>
</div>
</article>
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>ABNFImportError Enumeration Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset="utf-8">
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
<script src="../js/lunr.min.js" defer></script>
<script src="../js/typeahead.jquery.js" defer></script>
<script src="../js/jazzy.search.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Enum/ABNFImportError" class="dashAnchor"></a>
<a title="ABNFImportError Enumeration Reference"></a>
<header class="header">
<p class="header-col header-col--primary">
<a class="header-link" href="../index.html">
Covfefe 0.6.1 Docs
</a>
(99% documented)
</p>
<p class="<API key>">
<form role="search" action="../search.json">
<input type="text" placeholder="Search documentation" data-typeahead>
</form>
</p>
<p class="header-col <API key>">
<a class="header-link" href="https://github.com/palle-k/Covfefe">
<img class="header-icon" src="../img/gh.png"/>
View on GitHub
</a>
</p>
</header>
<p class="breadcrumbs">
<a class="breadcrumb" href="../index.html">Covfefe Reference</a>
<img class="carat" src="../img/carat.png" />
ABNFImportError Enumeration Reference
</p>
<div class="content-wrapper">
<nav class="navigation">
<ul class="nav-groups">
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Guides.html">Guides</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../bnf.html">BNF</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/ABNFImportError.html">ABNFImportError</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/Symbol.html">Symbol</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/SyntaxTree.html">SyntaxTree</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Enums/Terminal.html">Terminal</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/Character.html">Character</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/ClosedRange.html">ClosedRange</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Extensions/String.html">String</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Functions.html">Functions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>">-->(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>">-->(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>">-->(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><+>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><+>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><+>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><+>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><+>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><+>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><+>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>"><|>(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>">==(_:_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>">n(_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>">rt(_:)</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Functions.html#/s:<API key>">t(_:)</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Protocols.html">Protocols</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/<API key>.html"><API key></a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/Parser.html">Parser</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Protocols/Tokenizer.html">Tokenizer</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/CYKParser.html">CYKParser</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/DefaultTokenizer.html">DefaultTokenizer</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/EarleyParser.html">EarleyParser</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Grammar.html">Grammar</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/NonTerminal.html">NonTerminal</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/NonTerminalString.html">NonTerminalString</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/Production.html">Production</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/ProductionResult.html">ProductionResult</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/ProductionString.html">ProductionString</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SymbolSet.html">SymbolSet</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SyntaxError.html">SyntaxError</a>
</li>
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Structs/SyntaxError/Reason.html">– Reason</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a class="nav-group-name-link" href="../Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a class="nav-group-task-link" href="../Typealiases.html#/s:7Covfefe9ParseTreea">ParseTree</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section class="section">
<div class="section-content top-matter">
<h1>ABNFImportError</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">ABNFImportError</span> <span class="p">:</span> <span class="kt">Error</span></code></pre>
</div>
</div>
<p>Errors specific to the import of ABNF grammars</p>
</div>
</section>
<section class="section">
<div class="section-content">
<div class="task-group">
<ul class="item-container">
<li class="item">
<div>
<code>
<a name="/s:<API key>"></a>
<a name="//apple_ref/swift/Element/invalidRange(line:column:)" class="dashAnchor"></a>
<a class="token" href="#/s:<API key>">invalidRange(line:<wbr>column:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The grammar contains a range expression with a lower bound higher than the upper bound</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">invalidRange</span><span class="p">(</span><span class="nv">line</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">column</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:<API key>"></a>
<a name="//apple_ref/swift/Element/invalidCharcode(line:column:)" class="dashAnchor"></a>
<a class="token" href="#/s:<API key>">invalidCharcode(line:<wbr>column:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The grammar contains a charcode that is not a valid unicode scalar</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf">invalidCharcode</span><span class="p">(</span><span class="nv">line</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">column</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:<API key>"></a>
<a name="//apple_ref/swift/Element/<API key>(line:column:)" class="dashAnchor"></a>
<a class="token" href="#/s:<API key>"><API key>(line:<wbr>column:<wbr>)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The grammar contains a charcode range with a lower bound higher than the upper bound</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="k">case</span> <span class="nf"><API key></span><span class="p">(</span><span class="nv">line</span><span class="p">:</span> <span class="kt">Int</span><span class="p">,</span> <span class="nv">column</span><span class="p">:</span> <span class="kt">Int</span><span class="p">)</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</div>
</section>
</article>
</div>
<section class="footer">
<p>© 2020 <a class="link" href="https:
<p>Generated by <a class="link" href="https:
</section>
</body>
</div>
</html>
|
#include "stdafx.h"
#include "light.h"
using namespace graphic;
cLight::cLight()
{
}
cLight::~cLight()
{
}
void cLight::Init(TYPE type,
const Vector4 &ambient, // Vector4(1, 1, 1, 1),
const Vector4 &diffuse, // Vector4(0.2, 0.2, 0.2, 1)
const Vector4 &specular, // Vector4(1,1,1,1)
const Vector3 &direction) // Vector3(0,-1,0)
{
ZeroMemory(&m_light, sizeof(m_light));
m_light.Type = (D3DLIGHTTYPE)type;
m_light.Ambient = *(D3DCOLORVALUE*)&ambient;
m_light.Diffuse = *(D3DCOLORVALUE*)&diffuse;
m_light.Specular = *(D3DCOLORVALUE*)&specular;
m_light.Direction = *(D3DXVECTOR3*)&direction;
}
void cLight::SetDirection( const Vector3 &direction )
{
m_light.Direction = *(D3DXVECTOR3*)&direction;
}
void cLight::SetPosition( const Vector3 &pos )
{
m_light.Position = *(D3DXVECTOR3*)&pos;
}
void cLight::GetShadowMatrix( const Vector3 &modelPos,
OUT Vector3 &lightPos, OUT Matrix44 &view, OUT Matrix44 &proj,
OUT Matrix44 &tt )
{
if (<API key> == m_light.Type)
{
Vector3 pos = *(Vector3*)&m_light.Position;
Vector3 dir = *(Vector3*)&m_light.Direction;
lightPos = -dir * pos.Length();
}
else
{
lightPos = *(Vector3*)&m_light.Position;
}
view.SetView2( lightPos, modelPos, Vector3(0,1,0));
proj.SetProjection( D3DX_PI/8.f, 1, 0.1f, 10000);
D3DXMATRIX mTT= D3DXMATRIX(0.5f, 0.0f, 0.0f, 0.0f
, 0.0f,-0.5f, 0.0f, 0.0f
, 0.0f, 0.0f, 1.0f, 0.0f
, 0.5f, 0.5f, 0.0f, 1.0f);
tt = *(Matrix44*)&mTT;
}
void cLight::Bind(cRenderer &renderer, int lightIndex) const
{
renderer.GetDevice()->SetLight(lightIndex, &m_light);
}
void cLight::Bind(cShader &shader) const
{
static cShader *oldPtr = NULL;
static D3DXHANDLE hDir = NULL;
static D3DXHANDLE hPos = NULL;
static D3DXHANDLE hAmbient = NULL;
static D3DXHANDLE hDiffuse = NULL;
static D3DXHANDLE hSpecular = NULL;
static D3DXHANDLE hTheta = NULL;
static D3DXHANDLE hPhi = NULL;
if (oldPtr != &shader)
{
hDir = shader.GetValueHandle("light.dir");
hPos = shader.GetValueHandle("light.pos");
hAmbient = shader.GetValueHandle("light.ambient");
hDiffuse = shader.GetValueHandle("light.diffuse");
hSpecular = shader.GetValueHandle("light.specular");
hTheta = shader.GetValueHandle("light.spotInnerCone");
hPhi = shader.GetValueHandle("light.spotOuterCone");
oldPtr = &shader;
}
shader.SetVector( hDir, *(Vector3*)&m_light.Direction);
shader.SetVector( hPos, *(Vector3*)&m_light.Position);
shader.SetVector( hAmbient, *(Vector4*)&m_light.Ambient);
shader.SetVector( hDiffuse, *(Vector4*)&m_light.Diffuse);
shader.SetVector( hSpecular, *(Vector4*)&m_light.Specular);
shader.SetFloat( hTheta, m_light.Theta);
shader.SetFloat( hPhi, m_light.Phi);
//shader.SetFloat( "light.radius", m_light.r);
}
|
#ifndef ASF_H
#define ASF_H
/*
* This file includes all API header files for the selected drivers from ASF.
* Note: There might be duplicate includes required by more than one driver.
*
* The file is automatically generated and will be re-written when
* running the ASF driver selector tool. Any changes will be discarded.
*/
// From module: Common SAM compiler driver
#include <compiler.h>
#include <status_codes.h>
// From module: GPIO - General purpose Input/Output
#include <gpio.h>
// From module: Generic board support
#include <board.h>
// From module: Generic components of unit test framework
#include <unit_test/suite.h>
// From module: IOPORT - General purpose I/O service
#include <ioport.h>
// From module: Interrupt management - SAM implementation
#include <interrupt.h>
// From module: PIO - Parallel Input/Output Controller
#include <pio.h>
// From module: PMC - Power Management Controller
#include <pmc.h>
#include <sleep.h>
// From module: Part identification macros
#include <parts.h>
// From module: SAM3S EK LED support enabled
#include <led.h>
// From module: SAM3S startup code
#include <exceptions.h>
// From module: SSC - Synchronous Serial Controller
#include <ssc.h>
// From module: Standard serial I/O (stdio) - SAM implementation
#include <stdio_serial.h>
// From module: System Clock Control - SAM3S implementation
#include <sysclk.h>
// From module: UART - Univ. Async Rec/Trans
#include <uart.h>
// From module: USART - Serial interface - SAM implementation for devices with both UART and USART
#include <serial.h>
// From module: USART - Univ. Syn Async Rec/Trans
#include <usart.h>
// From module: pio_handler support enabled
#include <pio_handler.h>
#endif // ASF_H
|
<?php
declare(strict_types=1);
namespace Eelly\SDK\Order\Api;
use Eelly\SDK\EellyClient;
use Eelly\SDK\Order\Service\LikeInterface;
/**
*
*
* @author zhangyingdi<zhangyingdi@eelly.net>
*/
class Like
{
/**
*
*
* @param array $data
* @param int $orderData["orderId"] id
* @param int $orderData["userId"] id
*
* @throws \Eelly\SDK\Order\Exception\OrderException
*
* @return bool
* @requestExample({
* "data":{
* "orderId":123,
* "userId":148086
* }
* })
* @returnExample(true)
*
* @author zhangyingdi<zhangyingdi@eelly.net>
* @since 2018.04.28
*/
public function addOrderLike(array $data): bool
{
return EellyClient::request('order/like', 'addOrderLike', true, $data);
}
/**
*
*
* @param array $data
* @param int $orderData["orderId"] id
* @param int $orderData["userId"] id
*
* @throws \Eelly\SDK\Order\Exception\OrderException
*
* @return bool
* @requestExample({
* "data":{
* "orderId":123,
* "userId":148086
* }
* })
* @returnExample(true)
*
* @author zhangyingdi<zhangyingdi@eelly.net>
* @since 2018.04.28
*/
public function addOrderLikeAsync(array $data)
{
return EellyClient::request('order/like', 'addOrderLike', false, $data);
}
/**
*
*
* @param $orderId id
* @return array
*
* @requestExample({"orderId":162})
* @returnExample([{"oliId":"4","orderId":"161","userId":"148086","createdTime":"1524899508","updateTime":"2018-04-28 15:11:31"},{"oliId":"5","orderId":"161","userId":"11","createdTime":"1524899533","updateTime":"2018-04-28 15:11:55"}])
*
* @author wechan
* @since 20180502
*/
public function getOrderLikeInfo(int $orderId): array
{
return EellyClient::request('order/like', 'getOrderLikeInfo', true, $orderId);
}
/**
*
*
* @param $orderId id
* @return array
*
* @requestExample({"orderId":162})
* @returnExample([{"oliId":"4","orderId":"161","userId":"148086","createdTime":"1524899508","updateTime":"2018-04-28 15:11:31"},{"oliId":"5","orderId":"161","userId":"11","createdTime":"1524899533","updateTime":"2018-04-28 15:11:55"}])
*
* @author wechan
* @since 20180502
*/
public function <API key>(int $orderId)
{
return EellyClient::request('order/like', 'getOrderLikeInfo', false, $orderId);
}
/**
* (--).
*
* @param array $data
* @param int $orderData["orderId"] id
* @param int $orderData["userId"] id
* @param int $orderData["goodsId"] id
* @param \Eelly\DTO\UidDTO $user
*
* @throws \Eelly\SDK\Order\Exception\OrderException
*
* @return bool
* @requestExample({
* "data":{
* "orderId":123,
* "userId":148086,
* "goodsId":123
* }
* })
* @returnExample(true)
*
* @author zhangyingdi<zhangyingdi@eelly.net>
*
* @since 2018.06.28
*/
public function addOrderLikeNew(array $data, UidDTO $user = null): bool
{
return EellyClient::request('order/like', 'addOrderLikeNew', true, $data, $user);
}
/**
* (--).
*
* @param array $data
* @param int $orderData["orderId"] id
* @param int $orderData["userId"] id
* @param int $orderData["goodsId"] id
* @param \Eelly\DTO\UidDTO $user
*
* @throws \Eelly\SDK\Order\Exception\OrderException
*
* @return bool
* @requestExample({
* "data":{
* "orderId":123,
* "userId":148086,
* "goodsId":123
* }
* })
* @returnExample(true)
*
* @author zhangyingdi<zhangyingdi@eelly.net>
*
* @since 2018.06.28
*/
public function <API key>(array $data, UidDTO $user = null)
{
return EellyClient::request('order/like', 'addOrderLikeNew', false, $data, $user);
}
/**
* @return self
*/
public static function getInstance(): self
{
static $instance;
if (null === $instance) {
$instance = new self();
}
return $instance;
}
}
|
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class WebPageBlock(Document):
pass
|
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
package cn.sharesdk.demo.utils;
import android.annotation.TargetApi;
import android.content.Context;
import android.database.ContentObserver;
import android.database.Cursor;
import android.graphics.BitmapFactory;
import android.graphics.BitmapFactory.Options;
import android.graphics.Point;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Handler;
import android.os.Looper;
import android.provider.MediaStore.Images.Media;
import android.text.TextUtils;
import android.util.Log;
import android.view.Display;
import android.view.WindowManager;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
@TargetApi(17)
public class <API key> {
private static final String TAG = "<API key>";
private static final String[] MEDIA_PROJECTIONS = new String[]{"_data", "datetaken"};
private static final String[] <API key> = new String[]{"_data", "datetaken", "width", "height"};
private static final String[] KEYWORDS = new String[]{"screenshot", "screen_shot", "screen-shot", "screen shot", "screencapture",
"screen_capture", "screen-capture", "screen capture", "screencap", "screen_cap", "screen-cap", "screen cap"};
private static Point sScreenRealSize;
private final List<String> sHasCallbackPaths = new ArrayList();
private Context context;
private <API key> listener;
private long startListenTime;
private <API key> internalObserver;
private <API key> externalObserver;
private final Handler uiHandler = new Handler(Looper.getMainLooper());
private <API key>(Context context) {
if(context == null) {
throw new <API key>("The context must not be null.");
} else {
this.context = context;
if(sScreenRealSize == null) {
sScreenRealSize = this.getRealScreenSize();
if(sScreenRealSize != null) {
Log.d("<API key>", "Screen Real Size: " + sScreenRealSize.x + " * " + sScreenRealSize.y);
} else {
Log.w("<API key>", "Get screen real size failed.");
}
}
}
}
public static <API key> newInstance(Context context) {
assertInMainThread();
return new <API key>(context);
}
public void startListen() {
assertInMainThread();
this.sHasCallbackPaths.clear();
this.startListenTime = System.currentTimeMillis();
this.internalObserver = new <API key>(Media.<API key>, this.uiHandler);
this.externalObserver = new <API key>(Media.<API key>, this.uiHandler);
this.context.getContentResolver().<API key>(Media.<API key>, false, this.internalObserver);
this.context.getContentResolver().<API key>(Media.<API key>, false, this.externalObserver);
}
public void stopListen() {
assertInMainThread();
if(this.internalObserver != null) {
try {
this.context.getContentResolver().<API key>(this.internalObserver);
} catch (Exception var3) {
var3.printStackTrace();
}
this.internalObserver = null;
}
if(this.externalObserver != null) {
try {
this.context.getContentResolver().<API key>(this.externalObserver);
} catch (Exception var2) {
var2.printStackTrace();
}
this.externalObserver = null;
}
this.startListenTime = 0L;
this.sHasCallbackPaths.clear();
}
private void <API key>(Uri contentUri) {
Cursor cursor = null;
try {
cursor = this.context.getContentResolver().query(contentUri, VERSION.SDK_INT < 16 ? MEDIA_PROJECTIONS : <API key>,
(String)null, (String[])null, "date_added desc limit 1");
if(cursor == null) {
Log.e("<API key>", "Deviant logic.");
return;
}
if(cursor.moveToFirst()) {
int e = cursor.getColumnIndex("_data");
int dateTakenIndex = cursor.getColumnIndex("datetaken");
int widthIndex = -1;
int heightIndex = -1;
if(VERSION.SDK_INT >= 16) {
widthIndex = cursor.getColumnIndex("width");
heightIndex = cursor.getColumnIndex("height");
}
String data = cursor.getString(e);
long dateTaken = cursor.getLong(dateTakenIndex);
boolean width = false;
boolean height = false;
int width1;
int height1;
if(widthIndex >= 0 && heightIndex >= 0) {
width1 = cursor.getInt(widthIndex);
height1 = cursor.getInt(heightIndex);
} else {
Point size = this.getImageSize(data);
width1 = size.x;
height1 = size.y;
}
this.handleMediaRowData(data, dateTaken, width1, height1);
return;
}
Log.d("<API key>", "Cursor no data.");
} catch (Exception var16) {
var16.printStackTrace();
return;
} finally {
if(cursor != null && !cursor.isClosed()) {
cursor.close();
}
}
}
private Point getImageSize(String imagePath) {
Options options = new Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(imagePath, options);
return new Point(options.outWidth, options.outHeight);
}
private void handleMediaRowData(String data, long dateTaken, int width, int height) {
if(this.checkScreenShot(data, dateTaken, width, height)) {
Log.d("<API key>", "ScreenShot: path = " + data + "; size = " + width + " * " + height + "; date = " + dateTaken);
if(this.listener != null && !this.checkCallback(data)) {
this.listener.onShot(data);
}
} else {
Log.w("<API key>", "Media content changed, but not screenshot: path = " + data + "; size = " + width + " * "
+ height + "; date = " + dateTaken);
}
}
private boolean checkScreenShot(String data, long dateTaken, int width, int height) {
long currentTime = System.currentTimeMillis() - dateTaken;
if(dateTaken >= this.startListenTime && currentTime <= 20000L) {
if(sScreenRealSize == null || width <= sScreenRealSize.x && height <= sScreenRealSize.y || height <= sScreenRealSize.x
&& width <= sScreenRealSize.y) {
if(TextUtils.isEmpty(data)) {
return false;
} else {
data = data.toLowerCase();
String[] var11 = KEYWORDS;
int var10 = KEYWORDS.length;
for(int var9 = 0; var9 < var10; var9++) {
String keyWork = var11[var9];
if(data.contains(keyWork)) {
return true;
}
}
return false;
}
} else {
return false;
}
} else {
return false;
}
}
private boolean checkCallback(String imagePath) {
if(this.sHasCallbackPaths.contains(imagePath)) {
return true;
} else {
if(this.sHasCallbackPaths.size() >= 20) {
for(int i = 0; i < 5; i++) {
this.sHasCallbackPaths.remove(0);
}
}
this.sHasCallbackPaths.add(imagePath);
return false;
}
}
private Point getRealScreenSize() {
Point screenSize = null;
try {
screenSize = new Point();
WindowManager e = (WindowManager)this.context.getSystemService("window");
Display defaultDisplay = e.getDefaultDisplay();
if(VERSION.SDK_INT >= 17) {
defaultDisplay.getRealSize(screenSize);
} else {
try {
Method e1 = Display.class.getMethod("getRawWidth", new Class[0]);
Method getRawH = Display.class.getMethod("getRawHeight", new Class[0]);
screenSize.set(((Integer)e1.invoke(defaultDisplay, new Object[0])).intValue(),
((Integer)getRawH.invoke(defaultDisplay, new Object[0])).intValue());
} catch (Exception var6) {
screenSize.set(defaultDisplay.getWidth(), defaultDisplay.getHeight());
var6.printStackTrace();
}
}
} catch (Exception var7) {
var7.printStackTrace();
}
return screenSize;
}
public void setListener(<API key>.<API key> listener) {
this.listener = listener;
}
private static void assertInMainThread() {
if(Looper.myLooper() != Looper.getMainLooper()) {
StackTraceElement[] elements = Thread.currentThread().getStackTrace();
String methodMsg = null;
if(elements != null && elements.length >= 4) {
methodMsg = elements[3].toString();
}
throw new <API key>("Call the method must be in main thread: " + methodMsg);
}
}
private class <API key> extends ContentObserver {
private Uri contentUri;
public <API key>(Uri contentUri, Handler handler) {
super(handler);
this.contentUri = contentUri;
}
public void onChange(boolean selfChange) {
super.onChange(selfChange);
<API key>(this.contentUri);
}
}
public interface <API key> {
void onShot(String var1);
}
}
|
var Path = require('path');
var Hapi = require('hapi');
var server = new Hapi.Server();
var port = process.env.PORT || 5000;
server.connection({ port: port });
server.views({
engines: {
html: require('handlebars')
},
path: Path.join(__dirname, 'views')
});
server.route([
{ path: '/',
method: 'GET',
config: {
auth: false,
handler: function(request, reply) {
reply.view("index");
}
}
},
{
method: 'GET',
path: '/public/{param*}',
handler: {
directory: {
path: Path.normalize(__dirname + '/public')
}
}
}
]);
server.start(function(){
console.log('Static Server Listening on : http://127.0.0.1:' +port);
});
module.exports = server;
|
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// all copies or substantial portions of the Software.
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#include <Atomic/Atomic3D/StaticModel.h>
#include <Atomic/Atomic3D/CustomGeometry.h>
#include <Atomic/Atomic3D/BillboardSet.h>
#include "JSAtomic3D.h"
namespace Atomic
{
static int <API key>(duk_context* ctx) {
unsigned index = (unsigned) duk_require_number(ctx, 0);
Material* material = <API key><Material>(ctx, 1, 0);
duk_push_this(ctx);
// event receiver
StaticModel* model = <API key><StaticModel>(ctx, -1, 0);
model->SetMaterial(index, material);
return 0;
}
static int <API key>(duk_context* ctx) {
unsigned index = (unsigned)duk_require_number(ctx, 0);
Material* material = <API key><Material>(ctx, 1, 0);
duk_push_this(ctx);
// event receiver
CustomGeometry* geometry = <API key><CustomGeometry>(ctx, -1, 0);
geometry->SetMaterial(index, material);
return 0;
}
static int <API key>(duk_context* ctx)
{
duk_push_this(ctx);
BillboardSet* billboardSet = <API key><BillboardSet>(ctx, -1, 0);
unsigned index = (unsigned)duk_to_number(ctx, 0);
Billboard* billboard = billboardSet->GetBillboard(index);
<API key>(ctx, billboard, "Billboard");
return 1;
}
void jsapi_init_atomic3d(JSVM* vm)
{
duk_context* ctx = vm->GetJSContext();
<API key>(ctx, "Atomic", "StaticModel");
duk_push_c_function(ctx, <API key>, 2);
duk_put_prop_string(ctx, -2, "setMaterialIndex");
duk_pop(ctx); // pop AObject prototype
<API key>(ctx, "Atomic", "CustomGeometry");
duk_push_c_function(ctx, <API key>, 2);
duk_put_prop_string(ctx, -2, "setMaterialIndex");
duk_pop(ctx); // pop AObject prototype
<API key>(ctx, "Atomic", "BillboardSet");
duk_push_c_function(ctx, <API key>, 1);
duk_put_prop_string(ctx, -2, "getBillboard");
duk_pop(ctx); // pop AObject prototype
}
}
|
// Verve
function <API key>::<API key>( %this, %targetStack )
{
%baseGroup = Parent::<API key>( %this, %targetStack );
if ( %baseGroup.getClassName() !$= "ScriptGroup" )
{
// Temp Store.
%temp = %baseGroup;
// Create SimSet.
%baseGroup = new SimSet();
// Add Original Control.
%baseGroup.add( %temp );
}
// Create Data Table Group.
%groupRollout = %targetStack.<API key>( "VController DataTable" );
%propertyStack = %groupRollout.Stack;
// Reference.
%propertyStack.InternalName = "DataTableStack";
// Store.
%baseGroup.add( %groupRollout );
// Return.
return %baseGroup;
}
function <API key>::InspectObject( %this, %object )
{
if ( !%object.isMemberOfClass( "VController" ) )
{
// Invalid Object.
return;
}
// Default Inspect.
Parent::InspectObject( %this, %object );
// Update Data Table.
%dataTableStack = %this.ControlCache.<API key>( "DataTableStack", true );
if ( !isObject( %dataTableStack ) )
{
// Invalid Table.
return;
}
// Clear Stack.
while ( %dataTableStack.getCount() > 1 )
{
// Delete Object.
%dataTableStack.getObject( 1 ).delete();
}
%dataFieldCount = %object.getDataFieldCount();
for ( %i = 0; %i < %dataFieldCount; %i++ )
{
// Add To List.
%dataFieldList = trim( %dataFieldList SPC %object.getDataFieldName( %i ) );
}
// Sort Word List.
%dataFieldList = sortWordList( %dataFieldList );
for ( %i = 0; %i < %dataFieldCount; %i++ )
{
// Fetch Field Name.
%dataFieldName = getWord( %dataFieldList, %i );
// Create Field.
VerveEditor::CreateField( %dataTableStack, %dataFieldName, "Data" );
}
// Create Add Field.
VerveEditor::CreateAddDataField( %dataTableStack );
// Update.
%dataTableStack.InspectObject( %object );
}
function VController::DisplayContextMenu( %this, %x, %y )
{
%contextMenu = $VerveEditor::VController::ContextMenu;
if ( !isObject( %contextMenu ) )
{
%contextMenu = new PopupMenu()
{
SuperClass = "VerveWindowMenu";
IsPopup = true;
Label = "<API key>";
Position = 0;
Item[0] = "Add Group" TAB "";
Item[1] = "" TAB "";
Item[2] = "Cu&t" TAB "" TAB "";
Item[3] = "&Copy" TAB "" TAB "";
Item[4] = "&Paste" TAB "" TAB "VerveEditor::Paste();";
Item[5] = "" TAB "";
Item[6] = "&Delete" TAB "" TAB "";
PasteIndex = 4;
};
%contextMenu.Init();
// Disable Cut, Copy & Delete.
%contextMenu.enableItem( 2, false );
%contextMenu.enableItem( 3, false );
%contextMenu.enableItem( 6, false );
// Cache.
$VerveEditor::VController::ContextMenu = %contextMenu;
}
// Remove Add Menu.
%contextMenu.removeItem( %contextMenu.AddIndex );
// Insert Menu.
%contextMenu.insertSubMenu( %contextMenu.AddIndex, getField( %contextMenu.Item[0], 0 ), %this.GetAddGroupMenu() );
// Enable/Disable Pasting.
%contextMenu.enableItem( %contextMenu.PasteIndex, VerveEditor::CanPaste() );
if ( %x $= "" || %y $= "" )
{
%position = %this.getGlobalPosition();
%extent = %this.getExtent();
%x = getWord( %position, 0 ) + getWord( %extent, 0 );
%y = getWord( %position, 1 );
}
// Display.
%contextMenu.showPopup( VerveEditorWindow, %x, %y );
}
function VController::GetAddGroupMenu( %this )
{
%contextMenu = $VerveEditor::VController::ContextMenu[%this.getClassName()];
if ( !isObject( %contextMenu ) )
{
%customTemplateMenu = new PopupMenu()
{
Class = "<API key>";
SuperClass = "VerveWindowMenu";
IsPopup = true;
Label = "VGroupAddGroupMenu";
Position = 0;
};
%customTemplateMenu.Init();
%contextMenu = new PopupMenu()
{
SuperClass = "VerveWindowMenu";
IsPopup = true;
Label = "VGroupAddGroupMenu";
Position = 0;
Item[0] = "Add Camera Group" TAB "" TAB "VerveEditor::AddGroup(\"VCameraGroup\");";
Item[1] = "Add Director Group" TAB "" TAB "VerveEditor::AddGroup(\"VDirectorGroup\");";
Item[2] = "Add Light Object Group" TAB "" TAB "VerveEditor::AddGroup(\"VLightObjectGroup\");";
Item[3] = "Add Particle Effect Group" TAB "" TAB "VerveEditor::AddGroup(\"<API key>\");";
Item[4] = "Add Scene Object Group" TAB "" TAB "VerveEditor::AddGroup(\"VSceneObjectGroup\");";
Item[5] = "Add Spawn Sphere Group" TAB "" TAB "VerveEditor::AddGroup(\"VSpawnSphereGroup\");";
Item[6] = "" TAB "";
Item[7] = "Add Custom Group" TAB %customTemplateMenu;
DirectorIndex = 1;
CustomIndex = 7;
CustomMenu = %customTemplateMenu;
};
%contextMenu.Init();
// Refresh Menu.
%customTemplateMenu = %contextMenu.CustomMenu;
if ( %customTemplateMenu.getItemCount() == 0 )
{
// Remove Item.
%contextMenu.removeItem( %contextMenu.CustomIndex );
// Add Dummy.
%contextMenu.insertItem( %contextMenu.CustomIndex, getField( %contextMenu.Item[%contextMenu.CustomIndex], 0 ) );
// Disable Custom Menu.
%contextMenu.enableItem( %contextMenu.CustomIndex, false );
}
// Cache.
$VerveEditor::VController::ContextMenu[%this.getClassName()] = %contextMenu;
}
// Enable / Disable Director Group.
%contextMenu.enableItem( %contextMenu.DirectorIndex, %this.CanAdd( "VDirectorGroup" ) );
// Return Menu.
return %contextMenu;
}
|
module Cms::PublicFilter
extend ActiveSupport::Concern
include Cms::PublicFilter::Node
include Cms::PublicFilter::Page
include Mobile::PublicFilter
include Kana::PublicFilter
included do
rescue_from StandardError, with: :rescue_action
before_action :set_site
before_action :set_request_path
#before_action :redirect_slash, if: ->{ request.env["REQUEST_PATH"] =~ /\/[^\.]+[^\/]$/ }
before_action :deny_path
before_action :parse_path
before_action :compile_scss
before_action :x_sendfile, if: ->{ filters.blank? }
end
public
def index
if @cur_path =~ /\.p[1-9]\d*\.html$/
page = @cur_path.sub(/.*\.p(\d+)\.html$/, '\\1')
params[:page] = page.to_i
@cur_path.sub!(/\.p\d+\.html$/, ".html")
end
if @html =~ /\.part\.html$/
part = find_part(@html)
raise "404" unless part
@cur_path = params[:ref] || "/"
send_part render_part(part)
elsif page = find_page(@cur_path)
self.response = render_page(page)
send_page page
elsif node = find_node(@cur_path)
self.response = render_node(node)
send_page node
else
raise "404"
end
end
private
def set_site
host = request.env["<API key>"] || request.env["HTTP_HOST"]
@cur_site ||= SS::Site.find_by_domain host
raise "404" if !@cur_site
end
def set_request_path
@cur_path ||= request.env["REQUEST_PATH"]
cur_path = @cur_path.dup
filter_methods = self.class.<API key>.select { |m| m =~ /^<API key>/ }
filter_methods.each do |name|
send(name)
break if cur_path != @cur_path
end
end
def redirect_slash
return unless request.get?
redirect_to "#{request.path}/"
end
def deny_path
raise "404" if @cur_path =~ /^\/sites\/.\
end
def parse_path
@cur_path.sub!(/\/$/, "/index.html")
@html = @cur_path.sub(/\.\w+$/, ".html")
@file = File.join(@cur_site.path, @cur_path)
end
def compile_scss
return if @cur_path !~ /\.css$/
return if @cur_path =~ /\/_[^\/]*$/
return unless Fs.exists? @scss = @file.sub(/\.css$/, ".scss")
css_mtime = Fs.exists?(@file) ? Fs.stat(@file).mtime : 0
return if Fs.stat(@scss).mtime.to_i <= css_mtime.to_i
css = ""
begin
opts = Rails.application.config.sass
sass = Sass::Engine.new Fs.read(@scss), filename: @scss, syntax: :scss, cache: false,
load_paths: opts.load_paths[1..-1],
style: :compressed,
debug_info: false
css = sass.render
rescue Sass::SyntaxError => e
msg = e.backtrace[0].sub(/.*?\/_\
msg = "[#{msg}]\\A #{e}".gsub('"', '\\"')
css = "body:before { position: absolute; top: 8px; right: 8px; display: block;"
css << " padding: 4px 8px; border: 1px solid #b88; background-color: #fff;"
css << " color: #822; font-size: 85%; font-family: tahoma, sans-serif; line-height: 1.6;"
css << " white-space: pre; z-index: 9; content: \"#{msg}\"; }"
end
Fs.write @file, css
end
def x_sendfile(file = @file)
return unless Fs.file?(file)
response.headers["Expires"] = 1.days.from_now.httpdate if file =~ /\.(css|js|gif|jpg|png)$/
response.headers["Last-Modified"] = CGI::rfc1123_date(Fs.stat(file).mtime)
if Fs.mode == :file
send_file file, disposition: :inline, x_sendfile: true
else
send_data Fs.binread(file), type: Fs.content_type(file)
end
end
def send_part(body)
respond_to do |format|
format.html { render inline: body, layout: false }
format.json { render json: body.to_json }
end
end
def send_page(page)
raise "404" unless response
if response.content_type == "text/html" && page.layout
render inline: render_layout(page.layout), layout: (request.xhr? ? false : "cms/page")
else
@_response_body = response.body
end
end
def rescue_action(e = nil)
return render_error(e, status: e.to_s.to_i) if e.to_s =~ /^\d+$/
return render_error(e, status: 404) if e.is_a? Mongoid::Errors::DocumentNotFound
return render_error(e, status: 404) if e.is_a? ActionController::RoutingError
raise e
end
def render_error(e, opts = {})
# for development
raise e if Rails.application.config.<API key>
self.response = ActionDispatch::Response.new
status = opts[:status].presence || 500
render status: status, file: error_template(status), layout: false
end
def error_template(status)
if @cur_site
file = "#{@cur_site.path}/#{status}.html"
return file if Fs.exists?(file)
end
file = "#{Rails.public_path}/#{status}.html"
Fs.exists?(file) ? file : "#{Rails.public_path}/500.html"
end
end
|
<h1>Home</h1>
<p>You're logged in!!</p>
<p><a href="#/login">Logout</a></a></p>
|
// Use of this source code is governed by a MIT-style
package queue
import (
"errors"
"strings"
"code.gitea.io/gitea/modules/log"
"github.com/go-redis/redis"
)
// RedisQueueType is the type for redis queue
const RedisQueueType Type = "redis"
// <API key> is the configuration for the redis queue
type <API key> struct {
<API key>
<API key>
}
// RedisQueue redis queue
type RedisQueue struct {
*ByteFIFOQueue
}
// NewRedisQueue creates single redis or cluster redis queue
func NewRedisQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue, error) {
configInterface, err := toConfig(<API key>{}, cfg)
if err != nil {
return nil, err
}
config := configInterface.(<API key>)
byteFIFO, err := NewRedisByteFIFO(config.<API key>)
if err != nil {
return nil, err
}
byteFIFOQueue, err := NewByteFIFOQueue(RedisQueueType, byteFIFO, handle, config.<API key>, exemplar)
if err != nil {
return nil, err
}
queue := &RedisQueue{
ByteFIFOQueue: byteFIFOQueue,
}
queue.qid = GetManager().Add(queue, RedisQueueType, config, exemplar)
return queue, nil
}
type redisClient interface {
RPush(key string, args ...interface{}) *redis.IntCmd
LPop(key string) *redis.StringCmd
LLen(key string) *redis.IntCmd
SAdd(key string, members ...interface{}) *redis.IntCmd
SRem(key string, members ...interface{}) *redis.IntCmd
SIsMember(key string, member interface{}) *redis.BoolCmd
Ping() *redis.StatusCmd
Close() error
}
var _ (ByteFIFO) = &RedisByteFIFO{}
// RedisByteFIFO represents a ByteFIFO formed from a redisClient
type RedisByteFIFO struct {
client redisClient
queueName string
}
// <API key> is the configuration for the RedisByteFIFO
type <API key> struct {
Network string
Addresses string
Password string
DBIndex int
QueueName string
}
// NewRedisByteFIFO creates a ByteFIFO formed from a redisClient
func NewRedisByteFIFO(config <API key>) (*RedisByteFIFO, error) {
fifo := &RedisByteFIFO{
queueName: config.QueueName,
}
dbs := strings.Split(config.Addresses, ",")
if len(dbs) == 0 {
return nil, errors.New("no redis host specified")
} else if len(dbs) == 1 {
fifo.client = redis.NewClient(&redis.Options{
Network: config.Network,
Addr: strings.TrimSpace(dbs[0]), // use default Addr
Password: config.Password, // no password set
DB: config.DBIndex, // use default DB
})
} else {
fifo.client = redis.NewClusterClient(&redis.ClusterOptions{
Addrs: dbs,
})
}
if err := fifo.client.Ping().Err(); err != nil {
return nil, err
}
return fifo, nil
}
// PushFunc pushes data to the end of the fifo and calls the callback if it is added
func (fifo *RedisByteFIFO) PushFunc(data []byte, fn func() error) error {
if fn != nil {
if err := fn(); err != nil {
return err
}
}
return fifo.client.RPush(fifo.queueName, data).Err()
}
// Pop pops data from the start of the fifo
func (fifo *RedisByteFIFO) Pop() ([]byte, error) {
data, err := fifo.client.LPop(fifo.queueName).Bytes()
if err == nil || err == redis.Nil {
return data, nil
}
return data, err
}
// Close this fifo
func (fifo *RedisByteFIFO) Close() error {
return fifo.client.Close()
}
// Len returns the length of the fifo
func (fifo *RedisByteFIFO) Len() int64 {
val, err := fifo.client.LLen(fifo.queueName).Result()
if err != nil {
log.Error("Error whilst getting length of redis queue %s: Error: %v", fifo.queueName, err)
return -1
}
return val
}
func init() {
queuesMap[RedisQueueType] = NewRedisQueue
}
|
/**
* @file fly_id3.h
*
* Declaration of the pianobarfly ID3 helper functions. These are helper
* functions to assist with creating an ID3 tag using the libid3tag library.
*/
#ifndef _FLY_ID3_H
#define _FLY_ID3_H
#if defined ENABLE_MAD && defined ENABLE_ID3TAG
#include <id3tag.h>
#include <stdint.h>
/**
* Creates and attaches an image frame with the cover art to the given tag.
*
* @param tag A pointer to the tag.
* @param cover_art A buffer containing the cover art image.
* @param cover_size The size of the buffer.
* @param settings A pointer to the application settings structure.
* @return If successful 0 is returned otherwise -1 is returned.
*/
int BarFlyID3AddCover(struct id3_tag* tag, uint8_t const* cover_art,
size_t cover_size, BarSettings_t const* settings);
/**
* Creates and attaches a frame of the given type to the tag with the given
* string value. All values are written to the string list field of the frame.
*
* @param tag A pointer to the tag.
* @param type A string containing the frame type, ex. TIT2.
* @param value A string containing the value.
* @param settings A pointer to the application settings structure.
* @return If the frame was successfully added 0 is returned, otherwise -1 is
* returned.
*/
int BarFlyID3AddFrame(struct id3_tag* tag, char const* type,
char const* value, BarSettings_t const* settings);
/**
* Physically writes the ID3 tag to the audio file. A temproary file is create
* into which the tag is written. After which the contents of the audio file is
* copied into it. Once the temporary file is complete the audio file is
* overwritten with it.
*
* @param file_path A pointer to a string containing the path to the audio file.
* @param tag A pointer to the tag structure to be written to the file.
* @param settings A pointer to the application settings structure.
* @return If successful 0 is returned otherwise -1 is returned.
*/
int BarFlyID3WriteFile(char const* file_path, struct id3_tag const* tag,
BarSettings_t const* settings);
#endif
#endif
// vim: set noexpandtab:
|
package velir.intellij.cq5.util;
import javax.jcr.Node;
import javax.jcr.NodeIterator;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import java.util.ArrayList;
import java.util.List;
/**
* Utility class for helping work with Repository objects.
*/
public class RepositoryUtils {
/**
* Hide default constructor for true static class.
*/
private RepositoryUtils() {
}
public static List<String> getAllNodeTypeNames(Session session) throws RepositoryException {
//get our child nodeTypes from our root
NodeIterator nodeTypes = getAllNodeTypes(session);
//go through each node type and pull out the name
List<String> nodeTypeNames = new ArrayList<String>();
while (nodeTypes.hasNext()) {
Node node = nodeTypes.nextNode();
nodeTypeNames.add(node.getName());
}
//return our node type names
return nodeTypeNames;
}
/**
* Will get all the nodes that represent the different node types.
*
* @param session Repository session to use for pulling out this information.
* @return
* @throws RepositoryException
*/
public static NodeIterator getAllNodeTypes(Session session) throws RepositoryException {
//get our node types root
Node nodeTypesRoot = session.getNode("/jcr:system/jcr:nodeTypes");
//get our child nodeTypes from our root
return nodeTypesRoot.getNodes();
}
}
|
<html>
<META HTTP-EQUIV=Content-Type Content="text/html; charset=utf8">
<!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/02409/0240996011200.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:19:03 GMT -->
<head><title>:02409 :096011200</title>
<link rel="stylesheet" type="text/css" href="../../version.css" >
</HEAD>
<body><left>
<table><tr><td><FONT COLOR=blue SIZE=5>(02409)</font>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td>
<tr><td align=left valign=top>
<a href=0240982071600.html target=law02409><nobr><font size=2> 82 7 16 </font></nobr></a>
</td>
<td valign=top><font size=2>71</font></td>
<tr><td align=left valign=top><nobr><font size=2> 82 8 11 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0240988011500.html target=law02409><nobr><font size=2> 88 1 15 </font></nobr></a>
</td>
<td valign=top><font size=2>[]<br>
76</font></td>
<tr><td align=left valign=top><nobr><font size=2> 88 2 3 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0240988123000.html target=law02409><nobr><font size=2> 88 12 30 </font></nobr></a>
</td>
<td valign=top><font size=2>3</font></td>
<tr><td align=left valign=top><nobr><font size=2> 89 1 19 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0240990051800.html target=law02409><nobr><font size=2> 90 5 18 </font></nobr></a>
</td>
<td valign=top><font size=2>19, 51, 63</font></td>
<tr><td align=left valign=top><nobr><font size=2> 90 5 30 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0240991122700.html target=law02409><nobr><font size=2> 91 12 27 </font></nobr></a>
</td>
<td valign=top><font size=2>16, 19, 23, 39</font></td>
<tr><td align=left valign=top><nobr><font size=2> 92 1 15 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0240992120900.html target=law02409><nobr><font size=2> 92 12 9 </font></nobr></a>
</td>
<td valign=top><font size=2>19, 20, 24, 68<br>
371</font></td>
<tr><td align=left valign=top><nobr><font size=2> 92 12 24 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0240996011200.html target=law02409><nobr><font size=2> 96 1 12 </font></nobr></a>
</td>
<td valign=top><font size=2>351</font></td>
<tr><td align=left valign=top><nobr><font size=2> 96 1 29 </font></nobr></td>
</table></table></table></table>
<p><table><tr><td><font color=blue size=4>96112</font></td>
<td><a href=http://lis.ly.gov.tw/lghtml/lawstat/reason2/0240996011200.htm target=reason><font size=2></font></a></td>
<td><a href=http://lis.ly.gov.tw/lgcgi/lglawproc?0240996011200 target=proc><font size=2></font></a></td>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
<font size=2>()</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</left>
</body>
<!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/02409/0240996011200.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:19:03 GMT -->
</html>
|
#include "stdneb.h"
#include "exceptionbase.h"
namespace Exceptions
{
Exception::~Exception() throw()
{
}
Exception::Exception(const String& description_, const String& source_)
:line(0)
,type(EXT_UNDEF_TYPE)
,title("Exception")
,description(description_)
,source(source_)
{
// Log this error - not any more, allow catchers to do it
//LogManager::getSingleton().logMessage(this->getFullDescription());
}
Exception::Exception(const String& description_, const String& source_, const char* file_, long line_)
:type(EXT_UNDEF_TYPE)
,title("Exception")
,description(description_)
,source(source_)
,file(file_)
,line(line_)
{
// Log this error - not any more, allow catchers to do it
//LogManager::getSingleton().logMessage(this->getFullDescription());
}
Exception::Exception(int type_, const String& description_, const String& source_, const char* tile_, const char* file_, long line_)
:line(line_)
,type(type_)
,title(tile_)
,description(description_)
,source(source_)
,file(file_)
{
}
Exception::Exception(const Exception& rhs)
: line(rhs.line),
type(rhs.type),
title(rhs.title),
description(rhs.description),
source(rhs.source),
file(rhs.file)
{
}
void Exception::operator = (const Exception& rhs)
{
description = rhs.description;
type = rhs.type;
source = rhs.source;
file = rhs.file;
line = rhs.line;
title = rhs.title;
}
const String& Exception::GetFullDescription() const
{
if (0 == fullDesc.Length())
{
if( line > 0 )
{
fullDesc.Format("GENESIS EXCEPTION(%d:%s): \"%s\" in %s at %s(line, %d)",
type, title.AsCharPtr(), description.AsCharPtr(), source.AsCharPtr(), file.AsCharPtr(), line);
}
else
{
fullDesc.Format("GENESIS EXCEPTION(%d:%s): \"%s\" in %s", type, title.AsCharPtr(), description.AsCharPtr(), source.AsCharPtr());
}
}
return fullDesc;
}
int Exception::GetType(void) const throw()
{
return type;
}
const String &Exception::GetSource() const
{
return source;
}
const String &Exception::GetFile() const
{
return file;
}
long Exception::GetLine() const
{
return line;
}
const String &Exception::GetDescription(void) const
{
return description;
}
const char* Exception::what() const throw()
{
return GetFullDescription().AsCharPtr();
}
}
|
#include "GlobalSystems.h"
namespace globalSystem {
WindowManagerGL window;
TimeData time;
MouseData mouse;
KeyPressData keys;
TextureManager textures;
ModelManager models;
DynamicFloatMap runtimeData;
<API key> rng;
Font gameFont;
Font gameFontLarge;
Font gameFontHuge;
}
|
/* Define to 1 if you have the <stdlib.h> header file. */
/*#define HAVE_STDLIB_H 1*/
|
/**
* Module dependencies.
*/
var api = require('lib/db-api');
var config = require('lib/config');
var express = require('express');
var jwt = require('lib/jwt');
var passport = require('passport');
var log = require('debug')('democracyos:auth:facebook:routes');
var User = require('lib/models').User;
var fbSignedParser = require('fb-signed-parser');
/**
* Expose auth app
*/
var app = module.exports = express();
/*
* Facebook Auth routes
*/
app.get('/auth/facebook',
passport.authenticate('facebook', {
scope: config.auth.facebook.permissions
})
);
app.get('/auth/facebook/callback',
passport.authenticate('facebook', { failureRedirect: '/' }),
function(req, res) {
// After successful authentication
// redirect to homepage.
log('Log in user %s', req.user.id);
var token = jwt.encodeToken(api.user.expose.confidential(req.user), config.jwtSecret);
return res.cookie('token', token.token, { expires: new Date(token.expires), httpOnly: true }).redirect('/');
}
);
app.post('/auth/facebook/deauthorize', function(req, res) {
log('Parsing call to "/auth/facebook/deauthorize".');
res.send(200);
var signedRequest = req.params.signed_request;
if (!signedRequest) return log('"signed_request" param not found.');
var data = fbSignedParser.parse(signedRequest, config.auth.facebook.clientSecret);
if (!data || !data.user || !data.user.id) {
return log('Invalid "signed_request" data: ', data);
}
setTimeout(function(){
deauthorizeUser(data.user.id)
}, 0);
});
function deauthorizeUser(userFacebookId) {
log('Deauthorizing user with facebook id "%s".', userFacebookId);
var profile = {
id: userFacebookId,
provider: 'facebook'
};
User.findByProvider(profile, function (err, user) {
if (err) {
return log('Error looking for user with facebook id "%s".', userFacebookId);
}
if (!user) {
return log('User with facebook id "%s" not found.', userFacebookId);
}
user.set('profiles.facebook.deauthorized', true);
return user.save(function(err){
if (err) return log(err);
log('Facebook login for user "%s" deauthorized.', user.id);
});
});
}
|
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs.Host;
using Microsoft.ProjectOxford.Face;
using Microsoft.ProjectOxford.Face.Contract;
namespace Novanet
{
public static class <API key>
{
public static async Task <API key>(this FaceServiceClient client, string personGroupId, string name)
{
var personGroups = await client.<API key>();
if (!personGroups.Any(pg => pg.PersonGroupId.Equals(personGroupId, StringComparison.<API key>)))
{
await client.<API key>(personGroupId, name);
}
}
public static async Task<Guid> <API key>(this FaceServiceClient client, string personGroupId, User user)
{
// Use person UserData property to store external UserId for matching
var persons = await client.GetPersonsAsync(personGroupId);
if (persons.Any(p => p.UserData.Equals(user.Id.ToString(), StringComparison.<API key>)))
{
return persons.First(p => p.UserData.Equals(user.Id.ToString(), StringComparison.<API key>)).PersonId;
}
var person = await client.CreatePersonAsync(personGroupId, user.Name, user.Id.ToString());
return person.PersonId;
}
public static async Task <API key>(this FaceServiceClient client, string personGroupId, TraceWriter log)
{
// WOW, this is ugly, should probably put back on queue?
try
{
var status = await client.<API key>(personGroupId);
while (status.Status == Status.Running)
{
log.Info("Waiting for training...");
await Task.Delay(5000);
}
} catch (FaceAPIException notTrainedException)
{
// Throws if never tained before, and I don't care.
}
}
}
}
|
# Latte-lang
1. [](
1. [](#p1-1)
2. [](#p1-2)
2. [](
1. [](#p2-1)
2. [](#p2-2)
3. [](#p2-3)
3. [](
1. [](#p3-1)
2. [](#p3-2)
3. [](#p3-3)
4. [](#p3-4)
5. [Data Class](#p3-5)
6. [](#p3-6)
7. [Object Class](#p3-7)
8. [](#p3-8)
4. [Lambda](
1. [](#p4-1)
2. [Lambda](#p4-2)
5. [](
1. [Json ](#p5-1)
2. [](#p5-2)
3. [](#p5-3)
4. [](#p5-4)
5. [](#p5-5)
6. [](#p5-6)
7. [(Procedure)](#p5-7)
8. [](#p5-8)
9. [](#p5-9)
10. [](#p5-10)
6. [Java ](
1. [LatteJava](#p6-1)
2. [JavaLatte](#p6-2)
<h1 id="p1">1. </h1>
`Latte-lang`JVMJDK 1.6JavaJavaJava
<h2 id="p1-1">1.1 </h2>
Latte-langLatte`Java``Kotlin`,`Scala`,`Python`,`JavaScript`,`Swift``Latte-lang`
> LatteKotlinScala
<h3 id="p1-1-1">1.1.1 </h3>
`
java
// i am a comment
``
java
/* comment */
/*
multiple line comment
*/
a/* comment */=1
/* the comment splits an expression */
<h3 id="p1-1-2">1.1.2 </h3>
kotlin
package lt::spec
import java::util::_
`.`
kotlin
package lt.spec
import java.util._
`package`latte`package`“”java
`lt::spec``::``.`
`""`
`import`
kotlin
import java::awt::_ /* java::awt */
import java::util::List /* java::util::List */
import java::util::Collections._ /* Collections */
>`.`latte`::`JVM`.``.`
<h3 id="p1-1-3">1.1.3 </h3>
User
kotlin
class User(id: int, name: String)
MyListLinkedList
kotlin
class MyList(ls:List):LinkedList(ls)
MyListList
kotlin
abstract class MyList:List
[3.1 ](#p3-1)
`data class`
kotlin
data class User(id: int, name: String)
data classgetter/settertoString/hashCode/equalsSerializableCloneable
[3.5 Data Class](#p3-5)
`object class`
kotlin
object Singleton
[3.7 object class](#p3-7)
<h3 id="p1-1-4">1.1.4 </h3>
Consumer
kotlin
interface Supplier
def supply
[3.2 ](#p3-2)
<h3 id="p1-1-5">1.1.5 </h3>
sum
kotlin
fun sum(a, b)
return a+b
[4.1 ](#p4-1)
<h3 id="p1-1-6">1.1.6 </h3>
kotlin
val a:int = 1
val b = 1
kotlin
var x = 5
x += 1
`var`
python
y = 6
<h3 id="p1-1-7">1.1.7 </h3>
kotlin
main(args : []String)
println("First argument: ${args[0]}")
<h3 id="p1-1-8">1.1.8 </h3>
python
if a > b
return a
else
return b
kotlin
result = (if a > b {a} else {b})
>Lattereturn
[2.3.1 If ](#p2-3-1)
<h3 id="p1-1-9">1.1.9 for</h3>
swift
for item in list
println(item)
swift
for i in 0 until list.size
println(list[i])
[2.3.2 For ](#p2-3-2)
<h3 id="p-1-1-10">1.1.10 while</h3>
swift
i = 0
while i < list.size
println(list[i++])
[2.3.3 While ](#p2-3-3)
<h3 id="p-1-1-11">1.1.11 </h3>
x
kotlin
if x in 1 to y-1
print("OK")
15
swift
for x in 1 to 5
print(x)
[5.2 ](#p5-2)
<h3 id="p1-1-12">1.1.12 Lambda</h3>
kotlin
list.stream.
filter{it.startsWith("A")}.
map{it.toUpperCase()}.
forEach{print(it)}
f = a -> 1 + a
f(2)
[4.2 Lambda](#p4-2)
<h3 id="p1-1-13">1.1.13 Json</h3>
js
list = [1, 2, 3]
map = [
"a": 1
"b": 2
]
[5.1 Json ](#p5-1)
<h3 id="p1-1-14">1.1.14 ""</h3>
JavaScript`||`
js
a = a || 1
<h3 id="p1-1-15">1.1.15 </h3>
def method(a)
return a+1
JavaScript
js
function method(a) {
return a + 1;
}
<h3 id="p1-1-16">1.1.16 </h3>
scala
val (x,y) = Bean(1,2)
[5.9 ](#p5-9)
scala
o match
case Bean(a,b) => ...
case People(name, age) if age > 20 => ...
case _ => ...
[5.10 ](#p5-10)
<h2 id="p1-2">1.2 </h2>
Latte`.lt``.lts`
<h3 id="p1-2-1">1.2.1 </h3>
java
:scanner-brace
java
:scanner-indent
****
>Latte“”
<h3 id="p1-2-2">1.2.2 </h3>
**
(
[
{
)
]
}
**: `->``=>`
“”
java
f = x->x+1
f()
>`->`{...}java
“”
classA(a):B
method(arg0
arg1
arg2, arg3
):Unit
pass
-[class]-[A]-[(]-[]-[)]-[:]-[B]-[]
[a]-
[method]-[(]-[]-[)]-[]-
[pass]-
[arg0]-[EndNode]-[arg1]-[EndNode]-[arg2]-[StrongEndNode]-[arg3]
**:** “”“”`/// :scanner-brace`
<h3 id="p1-2-4">1.2.4 </h3>
Latte`{``}``{}`Map()
kotlin
if a > b {1} else {2}
if a > b
1
else
2
js
var map = {} /* map */
js
/* map */
def method {
map = [
"a": 1
"b": 2
]
}
<h1 id="p2">2. </h1>
<h2 id="p2-1">2.1 </h2>
Latte6
1. number
2. string
3. bool
4. array
5. map
<h3 id="p2-1-1">2.1.1 number</h3>
1
1.2
`1``1.2`
`float``double` [2.2 ](#p2-2)
<h3 id="p2-1-2">2.1.2 string</h3>
`'``"`
'a string'
"a string"
`\`
'escape \''
"escape \""
1`char``java.lang.String``java.lang.String`
<h3 id="p2-1-3">2.1.3 bool</h3>
4
true
false
yes
no
`true``yes``false``no`
`bool`
<h3 id="p2-1-4">2.1.4 array</h3>
`[``]``,`
js
[1,2,3]
[
object1
object2
object3
]
[
object1,
object2,
object3
]
<h3 id="p2-1-5">2.1.5 map</h3>
()swift`[``]`
`:`entry`,`
swift
['a':1, 'b':2, 'c':3]
[
'a':1
'b':2
'c':3
]
[
'a':1,
'b':2,
'c':3
]
<h2 id="p2-2">2.2 </h2>
LatteJava8Latte
int
long
float
double
short
byte
char
bool
`int/long/float/double/short/byte`
JavaLatte`bool``boolean`
<h3 id="p2-2-1">2.2.1 </h3>
bool[5.8 ](#p5-8)
scala
i:int = 3.14 /* i == 3 */
b:bool = 10 /* b == true 0 (0boolfalse) */
<h3 id="p2-2-2">2.2.2 </h3>
LatteJava
“”`int`
c
r1 = (1 as long) + (2 as int) /* r1 long */
r2 = (1 as byte) + (2 as short) /* r2 int */
Latte
java
a:short = 1
a+=1 /* a == 2 */
a++ /* a == 3 */
>Latte`int``short`
LatteJava`java`Latte`int/long/short/byte`
Latte
groovy
a ^^ b
`double`
> Latte“”
<h2 id="p2-3">2.3 </h2>
<h3 id="p2-3-1">2.3.1 If </h3>
JavaifKotlinScala
Latte`Procedure`
ruby
if a > b
return 1
else
return 2
val result = (if a>b {1} else {2})
<h3 id="p2-3-2">2.3.2 For </h3>
for
kotlin
for item in iter
`iter`IterableIteratorEnumerableMap
`iter`4for`item``iter`Map`item`Entry`Map#entrySet()`
`to``until`:
kotlin
for i in 0 until arr.length
val elem = arr[i]
<h3 id="p2-3-3">2.3.3 While </h3>
while
python
while boolExp
do
while boolExp
Java
<h3 id="p2-3-4">2.3.4 break, continue, return</h3>
`break` `continue` breakcontinueJava
`return`lambda“”Procedure:
kotlin
/* lambda */
foo = ()->return 1
def bar()
return 2
/* Procedure */
(
return 3
)
fun Fun1
return 4
return`require`
`return`/`return`:
kotlin
fun add(a, b)
a+b
val result = add(1, 2)
/* result is 3 */
//`AST.Return`
`if`
<h1 id="p3">3. </h1>
<h2 id="p3-1">3.1 </h2>
<h3 id="p3-1-1">3.1.1 </h3>
`class`
kotlin
class Empty
kotlin
class User(id, name)
scala
class User(id:int, name:String)
`java.lang.Object`
Latte
scala
class Rational(a:int, b:int=1)
`Rational(1)``Rational(1, 2)`
class
kotlin
class Customer(name: String)
logger = Logger.getLogger('')
logger.info("Customer initialized with value ${name}")
(Field)namelogger [3.3 ](#p3-3)
`private`
kotlin
private class DontCreateMe
Latte`public``class`“”
<h3 id="p3-1-2">3.1.2 </h3>
JavaLatte`java.lang.Object``:`Java
kotlin
class Base(p:int)
class Derived(p:int) : Base(p)
kotlin
class Example : Object
`val`
kotlin
val class NoInher
<h3 id="p3-1-3">3.1.3 </h3>
`abstract`
kotlin
abstract class MyAbsClass
abstract f()
Java
kotlin
class MyImpl : MyAbsClass
@Override
def f=1
<h3 id="p3-1-4">3.1.4 </h3>
`static`static“”“”
js
class TestStatic
static
public val STATIC_FIELD = 'i am a static field'
static func()=1
<h2 id="p3-2">3.2 </h2>
LatteJava`interface`:
kotlin
interface MyInterface
foo()=...
`abstract``foo()`
`:`
kotlin
class Child : MyInterface
foo()=456
child = Child
child.foo /* result is 456 */
child.bar /* result is 123 */
Java`static public val`
kotlin
interface MyInterface
FLAG = 1
`static`Java
js
interface TestStaticMethod
static
method()=111
TestStaticMethod.method() /* result is 111 */
<h2 id="p3-3">3.3 </h2>
<h3 id="p3-3-1">3.3.1 </h3>
kotlin
class Address(name)
public street
public city
public state
public zip
interface MyInterface
FLAG = 1
`private``public`, `protected`, `internal`
`static`staticstatic`val`
kotlin
class User(protected val id, public val name)
`.`Java
kotlin
val user = User(1, 'latte')
user.name /* result is 'latte' */
val address = Address('home')
address.city = 'hz'
Latte`property``getter``setter``property` [3.3.3 Accessor](#p3-3-3)
<h3 id="p3-3-2">3.3.2 </h3>
Latte
scala
def foo(x:int, y:int):int
return x + y
scala
def foo:int
return 1
`java.lang.Object`
scala
def foo
return 1
`=value`
scala
def foo = 1
scala
def foo
/`=``def`
bar():int
foobar()='hello'
fizz():int=1
`Unit`Latte`Unit`Java`void`
LatteUnitvoid`Unit``lt.lang.Unit`
scala
foo(a, b=1)=a+b
foo(1) /* result is 2 */
****`def`“”()“”`def`“lambda”
js
foo(x)
[4.2.2 Lambda](#p4-2-2)
js
foo(x)(it->...)
(`VALID_NAME ( [PARAM [, PARAM, ...]] ) { ... }`)`def`
`Unit``return value`value
`Unit``return``Unit`
Latte“”
def outer
def inner
>LambdaProcedure“”
<h3 id="p3-3-3">3.3.3 Accessor</h3>
accessorgettersetter
getter
1. `get{Name}()`
2. `{name}()`
setter`set{Name}(name)`
scala
class User(id, name)
def getId=id
setId(id)
this.id = id
def name=name
setName(name)
this.name = name
field
kotlin
user = User(1, 'latte')
println("user_id is ${user.id} and user_name is ${user.name}")
user.id = 2
user.name = 'jvm'
accessor:
* `set(String, ?)` "set"String
* `get(String)` "get"String
accessor`o.field``o.get('field')``o1.field = o2``o1.set('field', o2)`
<h2 id="p3-4">3.4 </h2>
<h3 id="p3-4-1">3.4.1 </h3>
Latte4
* public
* protected
* internal
* private
:
*
*
*
*
*
Latte`public`
| | public | protected | internal | private |
|
| | √ | √ | √ | √ |
| | √ | | | |
| | √ | √ | √ | √ |
| | √ | √ | √ | √ |
| | √ | √ | √ | √ |
<h3 id="p3-4-2">3.4.2 </h3>
LatteJava
* var
* val
* abstract /
* native
* synchronized
* transient
* volatile
* strictfp
* data data class [3.5 data class](#p3-5)
>`val` Java `final`
<h2 id="p3-5">3.5 Data Class</h2>
data classgettersetter`toString()`, `hashCode()`, `equals(Object)`SerializableCloneable
kotlin
data class User(val name: String, val age: int)
user = User('cass', 22)
user.toString() /* result is User(name='cass', age=22) */
getter/setter/toString/hashCode/equals
<h2 id="p3-6">3.6 </h2>
Latte`new`
kotlin
class Empty
empty = Empty
class User(id, name)
user = User(1, 'latte')
Latte`new`
scala
empty = new Empty
user = new User(1, "latte")
Latte`new`“”java`new X().doSth()`Latte`(new X).doSth`
> Lattenew
Latte
python
class open(file, mode)
public encoding
f = open('/User/a', "r", encoding='utf-8')
Latte
kotlin
f = open('/User/a', "r")
f.encoding = 'utf-8'
`=`“”accessor
Lattedata classfield[accessor](#p3-3-3)Java Bean
java
class User {
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
<h2 id="p3-7">3.7 Object Class</h2>
scala
object DataProviderManager
def <API key>(provider: DataProvider)
val allDataProviders: Collection = ...
`object class`private`static public val`
object classclass
scala
object DefaultListener : MouseAdapter()
def mouseClicked(e: MouseEvent):Unit
def mouseEntered(e: MouseEvent):Unit
val o = DataProviderManager
<h2 id="p3-8">3.8 </h2>
1.
scala
class RichInteger(i:Integer)
minutes() = i + " minute" + ( if i != 1 { "s" } else { "" } )
2.
`object class``implicit`
""
“”`implicit`
`Integer``RichInteger`
scala
implicit object TestImplicitCast
implicit def cast(i:Integer):RichInteger = RichInteger(i)
3.
scala
import implicit TestImplicitCast
`import implicit`
4.
val x = 30 minutes
`x``"30 minutes"``Integer => RichInteger`RichInteger`minutes()``val x = TestImplicitCast.cast(30).minutes()`
<h1 id="p4">4. Lambda</h1>
<h2 id="p4-1">4.1 </h2>
<h3 id="p4-1-1">4.1.1 </h3>
Java8“”
java
interface Consumer {
void consume(Object o);
}
`consume`
LatteJava“”
`public`
kotlin
abstract class F
abstract apply()=...
<h3 id="p4-1-2">4.1.2 </h3>
/Latte
kotlin
fun Impl(x, y)
return x + y
`fun`“”
`FunctionX`X`FunctionX`
`:`
kotlin
fun MyTask : Runnable
println('hello world')
<h3 id="p4-1-3">4.1.3 </h3>
Java(`class`)Latte
* import
* `Impl(1, 2)``Impl`lambda
*
kotlin
Thread(MyTask).start()
/
kotlin
task = MyTask
task.run()
<h3 id="p4-1-4">4.1.4 </h3>
Latte“”
js
task()
“”
1. (`.getClass`)
2. (`.getClass`)
3. `apply(...)`
Latte
<h2 id="p4-2">4.2 Lambda</h2>
<h3 id="p4-2-1">4.2.1 </h3>
[4.1.3 ](
Javastream api
java
List<String> strList = ...;
strList.stream().
map(s->Integer.parseInt(s)).
filter(n->n>10).
collect(Collectors.toList())
mapfilter
LatteLatte`lambda`
kotlin
:scanner-brace
strList = ...
strList.stream.
map { Integer.parseInt(it) }.
filter { it > 10 }.
collect(Collectors.toList())
<h3 id="p4-2-2">4.2.2 Lambda</h3>
LatteJavaLambda
java
strList.stream().
map(s->Integer.parseInt(s)).
filter(n->n>10).
collect(Collectors.toList())
lambda:
coffee
strList.stream.map(
s-> s = s.subString(1)
Integer.parseInt(s)
)
>returnLattereturn“JVM”
lambda`->``it`
js
strList.stream.map
it = it.subString(1)
Integer.parseInt(it)
DSL
python
<API key>
if it is great
star the repo
>hack
coffee
<API key> { if it is great { star the repo }}
LambdaJavaLatteLambda
coffee
var count = 0
(1 to 10).forEach { count+=it }
println(count)
<h1 id="p5">5. </h1>
<h2 id="p5-1">5.1 Json </h2>
LatteJson
Json
js
var list = [1, 2, 3, 4]
Json`java.util.LinkedList``as`
int
c
[1, 2, 3, 4] as []int
Object:
c
[1, 2, 3, 4] as []Object
Latte`java.util.List`ObjectListadd
kotlin
class JsonArray
list = []
def add(o)=list.add(o)
res = [1,2,3] as JsonArray
/*
same as:
res = JsonArray()
for item in [1,2,3]
res.add(item)
*/
Json
swift
var map = [
'one': 1,
'two': 2,
'three', 3
]
`,`“”`,`listmapentry
Latte"string"map
kotlin
data class Bean(hello, foo)
res = [
"hello" : "world"
"foo" : "bar
] as Bean
/* res will be Bean(hello=world, foo=bar) */
mapLatte
<h2 id="p5-2">5.2 </h2>
Latte`to``until`“”range`java.util.List`
`to``until`
scala
oneToTen = 1 to 10 /* [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] */
oneToNine = 1 until 10 /* [1, 2, 3, 4, 5, 6, 7, 8, 9] */
range
scala
tenToOne = 10 to 1 /* [10, 9, 8, 7, 6, 5, 4, 3, 2, 1] */
tenToTwo = 10 to 1 /* [10, 9, 8, 7, 6, 5, 4, 3, 2] */
>“”LatteRichInt`to``until`
<h2 id="p5-3">5.3 </h2>
<h3 id="p5-3-1">5.3.1 </h3>
Latte
Lattereturn
kotlin
class Base
class Sub:Base
var x:Base = Sub
var y:Sub = x
`y`
<h3 id="p5-3-2">5.3.2 </h3>
kotlin
class Data
i:int
def setI(i:int) { this.i=i }
fun call(x)
var data:Data = Data
data.setI(x as int)
xint
<h2 id="p5-4">5.4 </h2>
Latte“”Latte`a+b``a.add(b)``a*b``a.multiply(b)``!a``a.not()`
`BigInteger``BigDecimal`
kotlin
a = BigInteger(3)
b = BigInteger(4)
c = a + b
`Rational`
kotlin
class Rational(a, b)
add(that: Rational)=Rational(this.a * that.b + that.a * this.b, this.a * that.b)
toString():String="${a}/${b}"
a = Rational(1, 4)
b = Rational(3, 7)
c = a + b /* 19/28 */
“”`++a``(a = a + 1 , return a)`
| | |
|
| a:::b | a.concat(b) |
| a * b | a.multiply(b) |
| a / b | a.divide(b) |
| a % b | a.remainder(b) |
| a + b | a.add(b) |
| a - b | a.subtract(b) |
| a << b | a.shiftLeft(b) |
| a >> b | a.shiftRight(b) |
| a >>> b | a.unsignedShiftRight(b) |
| a > b | a.gt(b) |
| a < b | a.lt(b) |
| a >= b | a.ge(b) |
| a <= b | a.le(b) |
| a == b | a.eq(b) |
| a != b | !a.ne(b) |
| a in b | b.contains(a) |
| a & b | a.`and`(b) |
| a ^ b | a.xor(b) |
| a | b | a.`or`(b) |
| !a | a.logicNot() |
| ~a | a.not() |
| -a | a.negate() |
| a\[0\] | a.get(0) |
| a\[0, 1\] | a.get(0, 1) |
> `+a` Latte`+``a`
> `a[0, 1]`ajava`a[0][1]`
> Latte`RichObject``==``!=``equals`
LatteJavaLatte
* `in` `==`
* `:::`
`==`equals`===``!==`
Latte`is``not`equalsClass
> `==`equals`null==x`nullnullequals
> `!=`
| | |
|
| a?=b | a = a ? b |
| a++ | tmp = a , a = a + 1 , return tmp |
| ++a | a = a + 1 , return a |
| a-- | tmp = a , a = a - 1 , return tmp |
| --a | a = a - 1 , return a |
> `?=``?`
Latte`.`Latte
scala
list isEmpty // list.isEmpty()
map put "Feb", 2 // map.put("Feb", 2)
.println o // println(o)
`.`
<h2 id="p5-5">5.5 </h2>
LatteJava
* Latte`checked exception`
* Latte`throw``throw 'error-message'`
* Latte`catch`
* Latte`catch(Type e)`if-elseif-else
kotlin
fun isGreaterThanZero(x)
if x <= 0 { throw '${x} is littler than 0' }
var a = -1
try
isGreaterThanZero(a)
catch e
e.toCharArray /* succeed. `e` is a String */
finally
a = 1
<h2 id="p5-6">5.6 </h2>
Latte`annotation`
kotlin
annotation Anno
a:int = 1
b:long
LatteJava
`java::lang::annotation::Retention`
Java
`java::lang::annotation::Target`
> annotation `annotation`
LatteJava
kotlin
class PrintSelf
@Override
toString():String='PrintSelf'
Latte
scala
@Anno1,@Anno2,method()=...
Javavalue`value`
java
@Value1('value')
@Value2(value='value')
<h2 id="p5-7">5.7 (Procedure)</h2>
Latte“”
kotlin
class Rational(a, b)
toString():String = a + (
if b == 1
return ""
else
return "/" + b
)
“”`return`
kotlin
;; :scanner-brace
class Rational(a, b)
toString():String = a + ( if b==1 {""} else {"/" + b} )
<h2 id="p5-8">5.8 </h2>
Latte****null“”`nonnull``nonempty`
Latte`Unit``Unit``nonnull`nullUnit
null`java.lang.<API key>`
Unit`java.lang.<API key>`
scala
def add(nonnull a, nonnull b)= a + b
add(null, 1) /* NullPointerException */
add(Unit, 2)
`nonempty`Latte`bool`Lattebool)
`false``java.lang.<API key>`
scala
def listNotEmpty(nonempty list)
listNotEmpty([]) /* <API key> */
`bool`Latte
1. nullfalse
2. Unitfalse
3. Boolean`bool`
4. `double`0falsetrue
5. Character`int`0falsetrue
6. `def isEmpty:bool``def isEmpty:Boolean`
7. true
<h2 id="p5-9">5.9 </h2>
<h3 id="p5-9-1">5.9.1 </h3>
kotlin
data class Bean(a,b)
val bean = Bean(1,2)
bean`1``2`(1,2)
Latte
scala
val (x,y) = bean
xy12
<h3 id="p5-9-2">5.9.2 </h3>
static`unapply`
java
class X {
static {
unapply(o)=...
}
}
`null``java::util::List`
`null``List`
`false``true`
“unapply”
scala
Bean(x,y) <- bean
unapply
scala
(x,y) <- bean /* Bean(x,y) <- bean */
`<-``=`
`if`
scala
if List(a,b,c) <- o
println("result is ${a},${b},${c}")
else
println("destruct failed!")
<h2 id="p5-10">5.10 </h2>
`scala``Latte``java``switch`
scala
def doMatch(o) = o match
case 1 => ...
case b:Apple => ...
case _:Banana => ...
case Bean(x,y) => ...
case Bean(1, Bean(x, _:Integer)) => ...
case Bean(x,y) if x > 0 => ...
case _ => ...
`Unit``lt::lang::MatchError`
ifif
<h1 id="p6">6. Java</h1>
LatteJava
<h2 id="p6-1">6.1 LatteJava</h2>
LatteJavaLatteJavaLatte
LatteJava
LatteJava
1.
Field
java:
java
Integer integer;
List list;
final int anInt;
Object obj;
latte:
scala
integer : Integer
list : List
val anInt : int
obj
Latte`var`Object
2.
java:
java
void method1() {}
Object method2() { return null; }
int method3(int x) { return x; }
latte:
kotlin
method1():Unit=...
method2()=null
method3(x:int):int = x
3. java
java:
java
Class c = Object.class;
if (s instanceof String) {}
latte:
typescript
c = type Object
if s is type String
<h2 id="p6-2">6.2 JavaLatte</h2>
Latteclass-pathJavaLatte“”Javaprivate
<h3 id="p6-2-1">6.2.1 JavaLatte</h3>
LatteLatte-compiler
java
import lt.repl.Compiler;
Compiler compiler = new Compiler();
ClassLoader cl = compiler.compile(new HashMap<String, Reader>(){{
put('source-name.lt', new InputStreamReader(...));
}});
Class<?> cls = cl.loadClass('...');
<h3 id="p6-2-2">6.2.2 Javaeval</h3>
Latte`eval`latte`eval('...')`Java
java
lt.lang.Utils.eval("[\"id\":1,\"lang\":\"java\"]");
`Evaluator`eval:
java
List<Integer> list = Arrays.asList(1, 2, 3, 4, 5);
Evaluator evaluator = new Evaluator(new ClassPathLoader(Thread.currentThread().<API key>()));
evaluator.setScannerType(Evaluator.SCANNER_TYPE_BRACE);
evaluator.put("list", list); // listEvaluator
Evaluator.Entry entry = evaluator.eval("" +
"import java::util::stream::Collectors._\n" +
"list.stream.filter{it > 0}.collect(toList())");
List newList = (List) entry.result;
// newList is [3, 4, 5]
<h3 id="p6-2-3">6.2.3 JavaLatte</h3>
Latte`ScriptCompiler`
java
ScriptCompiler.Script script = scriptCompiler.compile("script", "return 1");
script.run().getResult();
// run(new String[]{...})
ScriptCompiler`compile`
|
<?xml version="1.0" ?><!DOCTYPE TS><TS language="th_TH" version="2.0">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Linkcoin</source>
<translation>เกี่ยวกับ บิตคอย์น</translation>
</message>
<message>
<location line="+39"/>
<source><b>Linkcoin</b> version</source>
<translation><b>บิตคอย์น<b>รุ่น</translation>
</message>
<message>
<location line="+57"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or http:
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http:
<translation type="unfinished"/>
</message>
<message>
<location filename="../aboutdialog.cpp" line="+14"/>
<source>Copyright</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The Linkcoin developers</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>สมุดรายชื่อ</translation>
</message>
<message>
<location line="+19"/>
<source>Double-click to edit address or label</source>
<translation>ดับเบิลคลิก เพื่อแก้ไขที่อยู่ หรือชื่อ</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>สร้างที่อยู่ใหม่</translation>
</message>
<message>
<location line="+14"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>คัดลอกที่อยู่ที่ถูกเลือกไปยัง คลิปบอร์ดของระบบ</translation>
</message>
<message>
<location line="-11"/>
<source>&New Address</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+63"/>
<source>These are your Linkcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>&Copy Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Linkcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Delete the currently selected address from the list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Verify a message to ensure it was signed with a specified Linkcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Delete</source>
<translation>ลบ</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="-5"/>
<source>These are your Linkcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Copy &Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>&Edit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send &Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+260"/>
<source>Export Address Book Data</source>
<translation>ส่งออกรายชื่อทั้งหมด</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>ส่งออกผิดพลาด</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>ไม่สามารถเขียนไปยังไฟล์ %1</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+144"/>
<source>Label</source>
<translation>ชื่อ</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>ที่อยู่</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(ไม่มีชื่อ)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>ใส่รหัสผ่าน</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>รหัสผา่นใหม่</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>กรุณากรอกรหัสผ่านใหม่อีกครั้งหนึ่ง</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+33"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>กระเป๋าสตางค์ที่เข้ารหัส</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>เปิดกระเป๋าสตางค์</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>ถอดรหัสกระเป๋าสตางค์</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>เปลี่ยนรหัสผ่าน</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>กรอกรหัสผ่านเก่าและรหัสผ่านใหม่สำหรับกระเป๋าสตางค์</translation>
</message>
<message>
<location line="+46"/>
<source>Confirm wallet encryption</source>
<translation>ยืนยันการเข้ารหัสกระเป๋าสตางค์</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR LITECOINS</b>!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+100"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-130"/>
<location line="+58"/>
<source>Wallet encrypted</source>
<translation>กระเป๋าสตางค์ถูกเข้ารหัสเรียบร้อยแล้ว</translation>
</message>
<message>
<location line="-56"/>
<source>Linkcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your linkcoins from being stolen by malware infecting your computer.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<location line="+7"/>
<location line="+42"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>การเข้ารหัสกระเป๋าสตางค์ผิดพลาด</translation>
</message>
<message>
<location line="-54"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<location line="+48"/>
<source>The supplied passphrases do not match.</source>
<translation>รหัสผ่านที่คุณกรอกไม่ตรงกัน</translation>
</message>
<message>
<location line="-37"/>
<source>Wallet unlock failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+11"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+233"/>
<source>Sign &message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+280"/>
<source>Synchronizing with network...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-349"/>
<source>&Overview</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>&Transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Edit the list of stored addresses and labels</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-14"/>
<source>Show the list of addresses for receiving payments</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>E&xit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Show information about Linkcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>About &Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show information about Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Options...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Encrypt Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Backup Wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>&Change Passphrase...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+285"/>
<source>Importing blocks from disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Reindexing blocks on disk...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-347"/>
<source>Send coins to a Linkcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Modify configuration options for Linkcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Backup wallet to another location</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Change the passphrase used for wallet encryption</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-4"/>
<source>&Verify message...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-165"/>
<location line="+530"/>
<source>Linkcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-530"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+101"/>
<source>&Send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Receive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>&Addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>&About Linkcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>&Show / Hide</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show or hide the main Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Encrypt the private keys that belong to your wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Sign messages with your Linkcoin addresses to prove you own them</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Verify messages to ensure they were signed with specified Linkcoin addresses</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>&File</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Settings</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>&Help</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Tabs toolbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<location line="+10"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+47"/>
<source>Linkcoin client</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+141"/>
<source>%n active connection(s) to Linkcoin network</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+22"/>
<source>No block source available...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Processed %1 of %2 (estimated) blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Processed %1 blocks of transaction history.</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+20"/>
<source>%n hour(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n week(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>%1 behind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Last received block was generated %1 ago.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transactions after this will not yet be visible.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+70"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-140"/>
<source>Up to date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Catching up...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+113"/>
<source>Confirm transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Sent transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Incoming transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+33"/>
<location line="+23"/>
<source>URI handling</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<location line="+23"/>
<source>URI can not be parsed! This can be caused by an invalid Linkcoin address or malformed URI parameters.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../bitcoin.cpp" line="+111"/>
<source>A fatal error occurred. Linkcoin can no longer continue safely and will quit.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+104"/>
<source>Network Alert</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+21"/>
<source>New receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>The entered address "%1" is already in the address book.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-5"/>
<source>The entered address "%1" is not a valid Linkcoin address.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Could not unlock wallet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+424"/>
<location line="+12"/>
<source>Linkcoin-Qt</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>Pay transaction &fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Automatically start Linkcoin after logging in to the system.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Start Linkcoin on system login</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Reset all client options to default.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Reset Options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Automatically open the Linkcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Map port using &UPnP</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Connect to the Linkcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Proxy &IP:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Port:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>SOCKS &Version:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+36"/>
<source>&Window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>M&inimize on close</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>The user interface language can be set here. This setting will take effect after restarting Linkcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>&Unit to show amounts in:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+9"/>
<source>Whether to show Linkcoin addresses in the transaction list or not.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&OK</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>&Apply</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+53"/>
<source>default</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+130"/>
<source>Confirm options reset</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Some settings may require a client restart to take effect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Do you want to proceed?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+42"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Linkcoin.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>The supplied proxy address is invalid.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<location line="+166"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Linkcoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-124"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Unconfirmed:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-78"/>
<source>Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+107"/>
<source>Immature:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Mined balance that has not yet matured</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+46"/>
<source><b>Recent transactions</b></source>
<translation type="unfinished"/>
</message>
<message>
<location line="-101"/>
<source>Your current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../overviewpage.cpp" line="+116"/>
<location line="+1"/>
<source>out of sync</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>PaymentServer</name>
<message>
<location filename="../paymentserver.cpp" line="+107"/>
<source>Cannot start linkcoin: click-to-pay handler</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>Request Payment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Amount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-44"/>
<source>Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+71"/>
<source>&Save As...</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+46"/>
<source>Client name</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location line="+36"/>
<location line="+53"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+339"/>
<source>N/A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-217"/>
<source>Client version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-45"/>
<source>&Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+68"/>
<source>Using OpenSSL version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+49"/>
<source>Startup time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+29"/>
<source>Network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Number of connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>On testnet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Block chain</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Current number of blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Estimated total blocks</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Last block time</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+52"/>
<source>&Open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Command-line options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Show the Linkcoin-Qt help message to get a list with possible Linkcoin command-line options.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>&Show</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>&Console</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-260"/>
<source>Build date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-104"/>
<source>Linkcoin - Debug window</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+25"/>
<source>Linkcoin Core</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+279"/>
<source>Debug log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Open the Linkcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Clear console</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-30"/>
<source>Welcome to the Linkcoin RPC console.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+124"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+50"/>
<source>Send to multiple recipients at once</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+20"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+22"/>
<source>Balance:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>123.456 BTC</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+31"/>
<source>Confirm the send action</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-59"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Confirm send coins</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>The recipient address is not valid, please recheck.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+14"/>
<source>Form</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+15"/>
<source>A&mount:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>Pay &To:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>The address to send the payment to (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+60"/>
<location filename="../sendcoinsentry.cpp" line="+26"/>
<source>Enter a label for this address to add it to your address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-78"/>
<source>&Label:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Choose address from address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Remove this recipient</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../sendcoinsentry.cpp" line="+1"/>
<source>Enter a Linkcoin address (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../forms/<API key>.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<location line="+213"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-203"/>
<location line="+213"/>
<source>Alt+A</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-203"/>
<source>Paste address from clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Copy the current signature to the system clipboard</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>Sign the message to prove you own this Linkcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<location line="+146"/>
<source>Clear &All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-87"/>
<source>&Verify Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+40"/>
<source>Verify the message to ensure it was signed with the specified Linkcoin address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Verify &Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation type="unfinished"/>
</message>
<message>
<location filename="../<API key>.cpp" line="+27"/>
<location line="+3"/>
<source>Enter a Linkcoin address (e.g. <API key>)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>Click "Sign Message" to generate signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Enter Linkcoin signature</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<location filename="../splashscreen.cpp" line="+22"/>
<source>The Linkcoin developers</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>[testnet]</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message>
<location filename="../transactiondesc.cpp" line="+20"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>%1/offline</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1/unconfirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>%1 confirmations</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+18"/>
<source>Status</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+7"/>
<source>, broadcast through %n node(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Source</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Generated</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<location line="+17"/>
<source>From</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<location line="+22"/>
<location line="+58"/>
<source>To</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-77"/>
<location line="+2"/>
<source>own address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-2"/>
<source>label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<location line="+12"/>
<location line="+45"/>
<location line="+17"/>
<location line="+30"/>
<source>Credit</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-102"/>
<source>matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+2"/>
<source>not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<location line="+8"/>
<location line="+15"/>
<location line="+30"/>
<source>Debit</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-39"/>
<source>Transaction fee</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Net amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Comment</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Debug information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Transaction</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Inputs</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+23"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-209"/>
<source>, has not been successfully broadcast yet</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="-35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+70"/>
<source>unknown</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../forms/<API key>.ui" line="+14"/>
<source>Transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This pane shows a detailed description of the transaction</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name><API key></name>
<message>
<location filename="../<API key>.cpp" line="+225"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>ที่อยู่</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+57"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Offline (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed (%1 of %2 confirmations)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation type="unfinished"/>
</message>
<message numerus="yes">
<location line="+8"/>
<source>Mined balance will be available when it matures in %n more block(s)</source>
<translation type="unfinished"><numerusform></numerusform></translation>
</message>
<message>
<location line="+5"/>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+43"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+38"/>
<source>(n/a)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+199"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+52"/>
<location line="+16"/>
<source>All</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>วันนี้</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Enter address or label to search</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Min amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+139"/>
<source>Export Transaction Data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>ชื่อ</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>ที่อยู่</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation>ส่งออกผิดพลาด</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>ไม่สามารถเขียนไปยังไฟล์ %1</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+193"/>
<source>Send Coins</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<location filename="../walletview.cpp" line="+42"/>
<source>&Export</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+193"/>
<source>Backup Wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Backup Failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Backup Successful</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+0"/>
<source>The wallet data was successfully saved to the new location.</source>
<translation type="unfinished"/>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+94"/>
<source>Linkcoin version</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+102"/>
<source>Usage:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>Send command to -server or linkcoind</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-23"/>
<source>List commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Get help for a command</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+24"/>
<source>Specify configuration file (default: linkcoin.conf)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Specify pid file (default: linkcoind.pid)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Specify data directory</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-9"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-28"/>
<source>Listen for connections on <port> (default: 9333 or testnet: 19333)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-48"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>Specify your own public address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-134"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-29"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+27"/>
<source>Listen for JSON-RPC connections on <port> (default: 9332 or testnet: 19332)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Accept command line and JSON-RPC commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Run in the background as a daemon and accept commands</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+37"/>
<source>Use the test network</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-112"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-80"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=linkcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Linkcoin Alert" admin@foo.com
</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+17"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. Linkcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+11"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Linkcoin will not work properly.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+14"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Block creation options:</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Connect only to the specified node(s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Corrupted block database detected</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Do you want to rebuild the block database now?</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error initializing block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error initializing wallet database environment %s!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Error opening block database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Error: Disk space is low!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: Wallet locked, unable to create transaction!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error: system error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to read block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to sync block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write block</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write file info</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write to coin database</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write transaction index</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Failed to write undo data</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Find peers using DNS lookup (default: 1 unless -connect)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Generate coins (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>How many blocks to check at startup (default: 288, 0 = all)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-4, default: 3)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Not enough file descriptors available.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Rebuild block chain index from current blk000??.dat files</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+16"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+26"/>
<source>Verifying blocks...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Verifying wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-69"/>
<source>Imports blocks from external blk000??.dat file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-76"/>
<source>Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+77"/>
<source>Information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -minrelaytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount for -mintxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+8"/>
<source>Maintain a full transaction index (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Only accept block chain matching built-in checkpoints (default: 1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Output extra debugging information. Implies all other -debug* options</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Output extra network debugging information</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>SSL options: (see the Linkcoin Wiki for SSL setup instructions)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+5"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Signing transaction failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>System error: </source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Transaction amount too small</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction amounts must be positive</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Transaction too large</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+7"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+2"/>
<source>Username for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Warning: This version is obsolete, upgrade required!</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>You need to rebuild the databases using -reindex to change -txindex</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-50"/>
<source>Password for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-67"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+76"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-120"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+147"/>
<source>Upgrade wallet to latest format</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-21"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-12"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+35"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-26"/>
<source>Server certificate file (default: server.cert)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-151"/>
<source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+165"/>
<source>This help message</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+6"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-91"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-10"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+55"/>
<source>Loading addresses...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-35"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Error loading wallet.dat: Wallet requires newer version of Linkcoin</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+93"/>
<source>Wallet needed to be rewritten: restart Linkcoin to complete</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-95"/>
<source>Error loading wallet.dat</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+28"/>
<source>Invalid -proxy address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+56"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-1"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-96"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+44"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+1"/>
<source>Invalid amount</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-6"/>
<source>Insufficient funds</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+10"/>
<source>Loading block index...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-25"/>
<source>Unable to bind to %s on this computer. Linkcoin is probably already running.</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+19"/>
<source>Loading wallet...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-52"/>
<source>Cannot downgrade wallet</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+64"/>
<source>Rescanning...</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-57"/>
<source>Done loading</source>
<translation type="unfinished"/>
</message>
<message>
<location line="+82"/>
<source>To use the %s option</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-74"/>
<source>Error</source>
<translation type="unfinished"/>
</message>
<message>
<location line="-31"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation type="unfinished"/>
</message>
</context>
</TS>
|
#region Using directives
using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using Nettiers.AdventureWorks.Entities;
using Nettiers.AdventureWorks.Data;
#endregion
namespace Nettiers.AdventureWorks.Data.Bases
{
<summary>
This class is the base class for any <see cref="<API key>"/> implementation.
It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
</summary>
public abstract partial class <API key> : <API key>
{
} // end class
} // end namespace
|
# Be sure to restart your server when you modify this file.
Hypermedia::Application.config.session_store :cookie_store, key: '_hypermedia_session'
# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# Hypermedia::Application.config.session_store :active_record_store
|
#ifndef ANONCOIN_MINER_H
#define ANONCOIN_MINER_H
#include <stdint.h>
typedef long long int64;
typedef unsigned long long uint64;
class CBlock;
class CBlockHeader;
class CBlockIndex;
struct CBlockTemplate;
class CReserveKey;
class CScript;
#ifdef ENABLE_WALLET
class CWallet;
void AnoncoinMiner(CWallet *pwallet);
#endif
/** Run the miner threads */
void GenerateAnoncoins(bool fGenerate, CWallet* pwallet);
/** Generate a new block, without valid proof-of-work */
CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn);
CBlockTemplate* <API key>(CReserveKey& reservekey);
/** Modify the extranonce in a block */
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce);
/** Do mining precalculation */
void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1);
/** Check mined block */
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey);
/** Base sha256 mining transform */
void SHA256Transform(void* pstate, void* pinput, const void* pinit);
#endif
|
<TS language="hi_IN" version="2.1">
<context>
<name>AddressBookPage</name>
<message>
<source>Create a new address</source>
<translation>नया पता लिखिए !</translation>
</message>
<message>
<source>Copy the currently selected address to the system clipboard</source>
<translation>चुनिन्दा पते को सिस्टम क्लिपबोर्ड पर कापी करे !</translation>
</message>
<message>
<source>&Copy Address</source>
<translation>&पता कॉपी करे</translation>
</message>
<message>
<source>&Delete</source>
<translation>&मिटाए !!</translation>
</message>
<message>
<source>Copy &Label</source>
<translation>&लेबल कॉपी करे </translation>
</message>
<message>
<source>&Edit</source>
<translation>&एडिट</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Comma separated file (*.csv)</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<source>Label</source>
<translation>लेबल</translation>
</message>
<message>
<source>Address</source>
<translation>पता</translation>
</message>
<message>
<source>(no label)</source>
<translation>(कोई लेबल नही !)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<source>Enter passphrase</source>
<translation>पहचान शब्द/अक्षर डालिए !</translation>
</message>
<message>
<source>New passphrase</source>
<translation>नया पहचान शब्द/अक्षर डालिए !</translation>
</message>
<message>
<source>Repeat new passphrase</source>
<translation>दोबारा नया पहचान शब्द/अक्षर डालिए !</translation>
</message>
<message>
<source>Encrypt wallet</source>
<translation>एनक्रिप्ट वॉलेट !</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>वॉलेट खोलने के आपका वॉलेट पहचान शब्द्/अक्षर चाईए !</translation>
</message>
<message>
<source>Unlock wallet</source>
<translation>वॉलेट खोलिए</translation>
</message>
<message>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>वॉलेट डीक्रिप्ट( विकोड) करने के लिए आपका वॉलेट पहचान शब्द्/अक्षर चाईए !</translation>
</message>
<message>
<source>Decrypt wallet</source>
<translation> डीक्रिप्ट वॉलेट</translation>
</message>
<message>
<source>Change passphrase</source>
<translation>पहचान शब्द/अक्षर बदलिये !</translation>
</message>
<message>
<source>Confirm wallet encryption</source>
<translation>वॉलेट एनक्रिपशन को प्रमाणित कीजिए !</translation>
</message>
<message>
<source>Wallet encrypted</source>
<translation>वॉलेट एनक्रिप्ट हो गया !</translation>
</message>
<message>
<source>Wallet encryption failed</source>
<translation>वॉलेट एनक्रिप्ट नही हुआ!</translation>
</message>
<message>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>वॉलेट एनक्रिपशन नाकाम हो गया इंटर्नल एरर की वजह से! आपका वॉलेट एनक्रीपत नही हुआ है!</translation>
</message>
<message>
<source>The supplied passphrases do not match.</source>
<translation>आपके द्वारा डाले गये पहचान शब्द/अक्षर मिलते नही है !</translation>
</message>
<message>
<source>Wallet unlock failed</source>
<translation>वॉलेट का लॉक नही खुला !</translation>
</message>
<message>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>वॉलेट डीक्रिप्ट करने के लिए जो पहचान शब्द/अक्षर डाले गये है वो सही नही है!</translation>
</message>
<message>
<source>Wallet decryption failed</source>
<translation>वॉलेट का डीक्रिप्ट-ष्ण असफल !</translation>
</message>
</context>
<context>
<name>BanTableModel</name>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<source>Synchronizing with network...</source>
<translation>नेटवर्क से समकालिक (मिल) रहा है ...</translation>
</message>
<message>
<source>&Overview</source>
<translation>&विवरण</translation>
</message>
<message>
<source>Show general overview of wallet</source>
<translation>वॉलेट का सामानया विवरण दिखाए !</translation>
</message>
<message>
<source>&Transactions</source>
<translation>& लेन-देन
</translation>
</message>
<message>
<source>Browse transaction history</source>
<translation>देखिए पुराने लेन-देन के विवरण !</translation>
</message>
<message>
<source>E&xit</source>
<translation>बाहर जायें</translation>
</message>
<message>
<source>Quit application</source>
<translation>अप्लिकेशन से बाहर निकलना !</translation>
</message>
<message>
<source>&Options...</source>
<translation>&विकल्प</translation>
</message>
<message>
<source>&Backup Wallet...</source>
<translation>&बैकप वॉलेट</translation>
</message>
<message>
<source>Change the passphrase used for wallet encryption</source>
<translation>पहचान शब्द/अक्षर जो वॉलेट एनक्रिपशन के लिए इस्तेमाल किया है उसे बदलिए!</translation>
</message>
<message>
<source>FairCoin</source>
<translation>बीटकोइन</translation>
</message>
<message>
<source>Wallet</source>
<translation>वॉलेट</translation>
</message>
<message>
<source>&File</source>
<translation>&फाइल</translation>
</message>
<message>
<source>&Settings</source>
<translation>&सेट्टिंग्स</translation>
</message>
<message>
<source>&Help</source>
<translation>&मदद</translation>
</message>
<message>
<source>Tabs toolbar</source>
<translation>टैबस टूलबार</translation>
</message>
<message>
<source>%1 behind</source>
<translation>%1 पीछे</translation>
</message>
<message>
<source>Error</source>
<translation>भूल</translation>
</message>
<message>
<source>Warning</source>
<translation>चेतावनी</translation>
</message>
<message>
<source>Information</source>
<translation>जानकारी</translation>
</message>
<message>
<source>Up to date</source>
<translation>नवीनतम</translation>
</message>
<message>
<source>Sent transaction</source>
<translation>भेजी ट्रांजक्शन</translation>
</message>
<message>
<source>Incoming transaction</source>
<translation>प्राप्त हुई ट्रांजक्शन</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>unlocked</b></source>
<translation>वॉलेट एन्क्रिप्टेड है तथा अभी लॉक्ड नहीं है</translation>
</message>
<message>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>वॉलेट एन्क्रिप्टेड है तथा अभी लॉक्ड है</translation>
</message>
</context>
<context>
<name>ClientModel</name>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<source>Amount:</source>
<translation>राशि :</translation>
</message>
<message>
<source>Amount</source>
<translation>राशि</translation>
</message>
<message>
<source>Date</source>
<translation>taareek</translation>
</message>
<message>
<source>Confirmed</source>
<translation>पक्का</translation>
</message>
<message>
<source>Copy address</source>
<translation>पता कॉपी करे</translation>
</message>
<message>
<source>Copy label</source>
<translation>लेबल कॉपी करे </translation>
</message>
<message>
<source>Copy amount</source>
<translation>कॉपी राशि</translation>
</message>
<message>
<source>(no label)</source>
<translation>(कोई लेबल नही !)</translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<source>Edit Address</source>
<translation>पता एडिट करना</translation>
</message>
<message>
<source>&Label</source>
<translation>&लेबल</translation>
</message>
<message>
<source>&Address</source>
<translation>&पता</translation>
</message>
<message>
<source>New receiving address</source>
<translation>नया स्वीकार्य पता</translation>
</message>
<message>
<source>New sending address</source>
<translation>नया भेजने वाला पता</translation>
</message>
<message>
<source>Edit receiving address</source>
<translation>एडिट स्वीकार्य पता </translation>
</message>
<message>
<source>Edit sending address</source>
<translation>एडिट भेजने वाला पता</translation>
</message>
<message>
<source>The entered address "%1" is already in the address book.</source>
<translation>डाला गया पता "%1" एड्रेस बुक में पहले से ही मोजूद है|</translation>
</message>
<message>
<source>Could not unlock wallet.</source>
<translation>वॉलेट को unlock नहीं किया जा सकता|</translation>
</message>
<message>
<source>New key generation failed.</source>
<translation>नयी कुंजी का निर्माण असफल रहा|</translation>
</message>
</context>
<context>
<name>FreespaceChecker</name>
</context>
<context>
<name>HelpMessageDialog</name>
<message>
<source>version</source>
<translation>संस्करण</translation>
</message>
<message>
<source>Usage:</source>
<translation>खपत :</translation>
</message>
</context>
<context>
<name>Intro</name>
<message>
<source>Error</source>
<translation>भूल</translation>
</message>
</context>
<context>
<name>OpenURIDialog</name>
</context>
<context>
<name>OptionsDialog</name>
<message>
<source>Options</source>
<translation>विकल्प</translation>
</message>
<message>
<source>W&allet</source>
<translation>वॉलेट</translation>
</message>
<message>
<source>&OK</source>
<translation>&ओके</translation>
</message>
<message>
<source>&Cancel</source>
<translation>&कैन्सल</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<source>Form</source>
<translation>फार्म</translation>
</message>
</context>
<context>
<name>PaymentServer</name>
</context>
<context>
<name>PeerTableModel</name>
</context>
<context>
<name>QObject</name>
<message>
<source>Amount</source>
<translation>राशि</translation>
</message>
<message>
<source>N/A</source>
<translation>लागू नही
</translation>
</message>
</context>
<context>
<name>QRImageWidget</name>
</context>
<context>
<name>RPCConsole</name>
<message>
<source>N/A</source>
<translation>लागू नही
</translation>
</message>
<message>
<source>&Information</source>
<translation>जानकारी</translation>
</message>
</context>
<context>
<name>ReceiveCoinsDialog</name>
<message>
<source>&Amount:</source>
<translation>राशि :</translation>
</message>
<message>
<source>&Label:</source>
<translation>लेबल:</translation>
</message>
<message>
<source>Copy label</source>
<translation>लेबल कॉपी करे </translation>
</message>
<message>
<source>Copy amount</source>
<translation>कॉपी राशि</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<source>Copy &Address</source>
<translation>&पता कॉपी करे</translation>
</message>
<message>
<source>Address</source>
<translation>पता</translation>
</message>
<message>
<source>Amount</source>
<translation>राशि</translation>
</message>
<message>
<source>Label</source>
<translation>लेबल</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<source>Date</source>
<translation>taareek</translation>
</message>
<message>
<source>Label</source>
<translation>लेबल</translation>
</message>
<message>
<source>Amount</source>
<translation>राशि</translation>
</message>
<message>
<source>(no label)</source>
<translation>(कोई लेबल नही !)</translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<source>Send Coins</source>
<translation>सिक्के भेजें|</translation>
</message>
<message>
<source>Amount:</source>
<translation>राशि :</translation>
</message>
<message>
<source>Send to multiple recipients at once</source>
<translation>एक साथ कई प्राप्तकर्ताओं को भेजें</translation>
</message>
<message>
<source>Balance:</source>
<translation>बाकी रकम :</translation>
</message>
<message>
<source>Confirm the send action</source>
<translation>भेजने की पुष्टि करें</translation>
</message>
<message>
<source>Confirm send coins</source>
<translation>सिक्के भेजने की पुष्टि करें</translation>
</message>
<message>
<source>Copy amount</source>
<translation>कॉपी राशि</translation>
</message>
<message>
<source>The amount to pay must be larger than 0.</source>
<translation>भेजा गया अमाउंट शुन्य से अधिक होना चाहिए|</translation>
</message>
<message>
<source>(no label)</source>
<translation>(कोई लेबल नही !)</translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<source>A&mount:</source>
<translation>अमाउंट:</translation>
</message>
<message>
<source>Pay &To:</source>
<translation>प्राप्तकर्ता:</translation>
</message>
<message>
<source>Enter a label for this address to add it to your address book</source>
<translation>आपकी एड्रेस बुक में इस एड्रेस के लिए एक लेबल लिखें</translation>
</message>
<message>
<source>&Label:</source>
<translation>लेबल:</translation>
</message>
<message>
<source>Alt+A</source>
<translation>Alt-A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Clipboard से एड्रेस paste करें</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt-P</translation>
</message>
<message>
<source>Pay To:</source>
<translation>प्राप्तकर्ता:</translation>
</message>
</context>
<context>
<name>ShutdownWindow</name>
</context>
<context>
<name><API key></name>
<message>
<source>Alt+A</source>
<translation>Alt-A</translation>
</message>
<message>
<source>Paste address from clipboard</source>
<translation>Clipboard से एड्रेस paste करें</translation>
</message>
<message>
<source>Alt+P</source>
<translation>Alt-P</translation>
</message>
<message>
<source>Signature</source>
<translation>हस्ताक्षर</translation>
</message>
</context>
<context>
<name>SplashScreen</name>
<message>
<source>[testnet]</source>
<translation>[टेस्टनेट]</translation>
</message>
</context>
<context>
<name>TrafficGraphWidget</name>
</context>
<context>
<name>TransactionDesc</name>
<message>
<source>Open until %1</source>
<translation>खुला है जबतक %1</translation>
</message>
<message>
<source>%1/unconfirmed</source>
<translation>%1/अपुष्ट</translation>
</message>
<message>
<source>%1 confirmations</source>
<translation>%1 पुष्टियाँ</translation>
</message>
<message>
<source>Date</source>
<translation>taareek</translation>
</message>
<message>
<source>Transaction ID</source>
<translation>ID</translation>
</message>
<message>
<source>Amount</source>
<translation>राशि</translation>
</message>
<message>
<source>true</source>
<translation>सही</translation>
</message>
<message>
<source>false</source>
<translation>ग़लत</translation>
</message>
<message>
<source>, has not been successfully broadcast yet</source>
<translation>, अभी तक सफलतापूर्वक प्रसारित नहीं किया गया है</translation>
</message>
<message>
<source>unknown</source>
<translation>अज्ञात</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<source>Transaction details</source>
<translation>लेन-देन का विवरण</translation>
</message>
<message>
<source>This pane shows a detailed description of the transaction</source>
<translation> ये खिड़की आपको लेन-देन का विस्तृत विवरण देगी !</translation>
</message>
</context>
<context>
<name><API key></name>
<message>
<source>Date</source>
<translation>taareek</translation>
</message>
<message>
<source>Type</source>
<translation>टाइप</translation>
</message>
<message>
<source>Open until %1</source>
<translation>खुला है जबतक %1</translation>
</message>
<message>
<source>Confirmed (%1 confirmations)</source>
<translation>पक्के ( %1 पक्का करना)</translation>
</message>
<message>
<source>This block was not received by any other nodes and will probably not be accepted!</source>
<translation>यह ब्लॉक किसी भी और नोड को मिला नही है ! शायद यह ब्लॉक कोई भी नोड स्वीकारे गा नही !</translation>
</message>
<message>
<source>Generated but not accepted</source>
<translation>जेनरेट किया गया किंतु स्वीकारा नही गया !</translation>
</message>
<message>
<source>Label</source>
<translation>लेबल</translation>
</message>
<message>
<source>Received with</source>
<translation>स्वीकार करना</translation>
</message>
<message>
<source>Received from</source>
<translation>स्वीकार्य ओर से</translation>
</message>
<message>
<source>Sent to</source>
<translation>भेजा गया</translation>
</message>
<message>
<source>Payment to yourself</source>
<translation>भेजा खुद को भुगतान</translation>
</message>
<message>
<source>Mined</source>
<translation>माइंड</translation>
</message>
<message>
<source>(n/a)</source>
<translation>(लागू नहीं)</translation>
</message>
<message>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>ट्रांसेक्शन स्तिथि| पुष्टियों की संख्या जानने के लिए इस जगह पर माउस लायें|</translation>
</message>
<message>
<source>Date and time that the transaction was received.</source>
<translation>तारीख तथा समय जब ये ट्रांसेक्शन प्राप्त हुई थी|</translation>
</message>
<message>
<source>Type of transaction.</source>
<translation>ट्रांसेक्शन का प्रकार|</translation>
</message>
<message>
<source>Amount removed from or added to balance.</source>
<translation>अमाउंट बैलेंस से निकला या जमा किया गया |</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<source>All</source>
<translation>सभी</translation>
</message>
<message>
<source>Today</source>
<translation>आज</translation>
</message>
<message>
<source>This week</source>
<translation>इस हफ्ते</translation>
</message>
<message>
<source>This month</source>
<translation>इस महीने</translation>
</message>
<message>
<source>Last month</source>
<translation>पिछले महीने</translation>
</message>
<message>
<source>This year</source>
<translation>इस साल</translation>
</message>
<message>
<source>Range...</source>
<translation>विस्तार...</translation>
</message>
<message>
<source>Received with</source>
<translation>स्वीकार करना</translation>
</message>
<message>
<source>Sent to</source>
<translation>भेजा गया</translation>
</message>
<message>
<source>To yourself</source>
<translation>अपनेआप को</translation>
</message>
<message>
<source>Mined</source>
<translation>माइंड</translation>
</message>
<message>
<source>Other</source>
<translation>अन्य</translation>
</message>
<message>
<source>Enter address or label to search</source>
<translation>ढूँदने के लिए कृपा करके पता या लेबल टाइप करे !</translation>
</message>
<message>
<source>Min amount</source>
<translation>लघुत्तम राशि</translation>
</message>
<message>
<source>Copy address</source>
<translation>पता कॉपी करे</translation>
</message>
<message>
<source>Copy label</source>
<translation>लेबल कॉपी करे </translation>
</message>
<message>
<source>Copy amount</source>
<translation>कॉपी राशि</translation>
</message>
<message>
<source>Edit label</source>
<translation>एडिट लेबल</translation>
</message>
<message>
<source>Comma separated file (*.csv)</source>
<translation>Comma separated file (*.csv)</translation>
</message>
<message>
<source>Confirmed</source>
<translation>पक्का</translation>
</message>
<message>
<source>Date</source>
<translation>taareek</translation>
</message>
<message>
<source>Type</source>
<translation>टाइप</translation>
</message>
<message>
<source>Label</source>
<translation>लेबल</translation>
</message>
<message>
<source>Address</source>
<translation>पता</translation>
</message>
<message>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<source>Range:</source>
<translation>विस्तार:</translation>
</message>
<message>
<source>to</source>
<translation>तक</translation>
</message>
</context>
<context>
<name><API key></name>
</context>
<context>
<name>WalletFrame</name>
</context>
<context>
<name>WalletModel</name>
<message>
<source>Send Coins</source>
<translation>सिक्के भेजें|</translation>
</message>
</context>
<context>
<name>WalletView</name>
<message>
<source>Backup Wallet</source>
<translation>बैकप वॉलेट</translation>
</message>
<message>
<source>Wallet Data (*.dat)</source>
<translation>वॉलेट डेटा (*.dat)</translation>
</message>
<message>
<source>Backup Failed</source>
<translation>बैकप असफल</translation>
</message>
<message>
<source>Backup Successful</source>
<translation>बैकप सफल</translation>
</message>
</context>
<context>
<name>FairCoin-core</name>
<message>
<source>Options:</source>
<translation>विकल्प:</translation>
</message>
<message>
<source>Specify data directory</source>
<translation>डेटा डायरेक्टरी बताएं </translation>
</message>
<message>
<source>Run in the background as a daemon and accept commands</source>
<translation>बैकग्राउंड में डेमॉन बन कर रन करे तथा कमांड्स स्वीकार करें </translation>
</message>
<message>
<source>Verifying blocks...</source>
<translation>ब्लॉक्स जाँचे जा रहा है...</translation>
</message>
<message>
<source>Verifying wallet...</source>
<translation>वॉलेट जाँचा जा रहा है...</translation>
</message>
<message>
<source>Information</source>
<translation>जानकारी</translation>
</message>
<message>
<source>Warning</source>
<translation>चेतावनी</translation>
</message>
<message>
<source>Loading addresses...</source>
<translation>पता पुस्तक आ रही है...</translation>
</message>
<message>
<source>Loading block index...</source>
<translation>ब्लॉक इंडेक्स आ रहा है...</translation>
</message>
<message>
<source>Loading wallet...</source>
<translation>वॉलेट आ रहा है...</translation>
</message>
<message>
<source>Rescanning...</source>
<translation>रि-स्केनी-इंग...</translation>
</message>
<message>
<source>Done loading</source>
<translation>लोड हो गया|</translation>
</message>
<message>
<source>Error</source>
<translation>भूल</translation>
</message>
</context>
</TS>
|
// <auto-generated>
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.Network
{
using Microsoft.Rest;
using Microsoft.Rest.Azure;
using Models;
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
<summary>
<API key> operations.
</summary>
internal partial class <API key> : IServiceOperations<<API key>>, <API key>
{
<summary>
Initializes a new instance of the <API key> class.
</summary>
<param name='client'>
Reference to the service client.
</param>
<exception cref="System.<API key>">
Thrown when a required parameter is null
</exception>
internal <API key>(<API key> client)
{
if (client == null)
{
throw new System.<API key>("client");
}
Client = client;
}
<summary>
Gets a reference to the <API key>
</summary>
public <API key> Client { get; private set; }
<summary>
Deletes the specified network security rule.
</summary>
<param name='resourceGroupName'>
The name of the resource group.
</param>
<param name='<API key>'>
The name of the network security group.
</param>
<param name='securityRuleName'>
The name of the security rule.
</param>
<param name='customHeaders'>
The headers that will be added to request.
</param>
<param name='cancellationToken'>
The cancellation token.
</param>
public async Task<<API key>> <API key>(string resourceGroupName, string <API key>, string securityRuleName, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken))
{
// Send request
<API key> _response = await <API key>(resourceGroupName, <API key>, securityRuleName, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.<API key>(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
<summary>
Get the specified network security rule.
</summary>
<param name='resourceGroupName'>
The name of the resource group.
</param>
<param name='<API key>'>
The name of the network security group.
</param>
<param name='securityRuleName'>
The name of the security rule.
</param>
<param name='customHeaders'>
Headers that will be added to request.
</param>
<param name='cancellationToken'>
The cancellation token.
</param>
<exception cref="CloudException">
Thrown when the operation returned an invalid status code
</exception>
<exception cref="<API key>">
Thrown when unable to deserialize the response
</exception>
<exception cref="ValidationException">
Thrown when a required parameter is null
</exception>
<exception cref="System.<API key>">
Thrown when a required parameter is null
</exception>
<return>
A response object containing the response body and response headers.
</return>
public async Task<<API key><SecurityRule>> <API key>(string resourceGroupName, string <API key>, string securityRuleName, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken))
{
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (<API key> == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "<API key>");
}
if (securityRuleName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2020-11-01";
// Tracing
bool _shouldTrace = <API key>.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = <API key>.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("<API key>", <API key>);
tracingParameters.Add("securityRuleName", securityRuleName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
<API key>.Enter(_invocationId, this, "Get", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/<API key>/{<API key>}/securityRules/{securityRuleName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{<API key>}", System.Uri.EscapeDataString(<API key>));
_url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.<API key> != null && Client.<API key>.Value)
{
_httpRequest.Headers.<API key>("<API key>", System.Guid.NewGuid().ToString());
}
if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
_httpRequest.Headers.<API key>("accept-language", Client.AcceptLanguage);
}
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.<API key>(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
// Set Credentials
if (Client.Credentials != null)
{
cancellationToken.<API key>();
await Client.Credentials.<API key>(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
<API key>.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.<API key>();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
<API key>.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.<API key>();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.<API key>);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
catch (JsonException)
{
// Ignore the exception
}
ex.Request = new <API key>(_httpRequest, _requestContent);
ex.Response = new <API key>(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
<API key>.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new <API key><SecurityRule>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<SecurityRule>(_responseContent, Client.<API key>);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new <API key>("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
<API key>.Exit(_invocationId, _result);
}
return _result;
}
<summary>
Creates or updates a security rule in the specified network security group.
</summary>
<param name='resourceGroupName'>
The name of the resource group.
</param>
<param name='<API key>'>
The name of the network security group.
</param>
<param name='securityRuleName'>
The name of the security rule.
</param>
<param name='<API key>'>
Parameters supplied to the create or update network security rule
operation.
</param>
<param name='customHeaders'>
The headers that will be added to request.
</param>
<param name='cancellationToken'>
The cancellation token.
</param>
public async Task<<API key><SecurityRule>> <API key>(string resourceGroupName, string <API key>, string securityRuleName, SecurityRule <API key>, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken))
{
// Send Request
<API key><SecurityRule> _response = await <API key>(resourceGroupName, <API key>, securityRuleName, <API key>, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.<API key>(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
<summary>
Gets all security rules in a network security group.
</summary>
<param name='resourceGroupName'>
The name of the resource group.
</param>
<param name='<API key>'>
The name of the network security group.
</param>
<param name='customHeaders'>
Headers that will be added to request.
</param>
<param name='cancellationToken'>
The cancellation token.
</param>
<exception cref="CloudException">
Thrown when the operation returned an invalid status code
</exception>
<exception cref="<API key>">
Thrown when unable to deserialize the response
</exception>
<exception cref="ValidationException">
Thrown when a required parameter is null
</exception>
<exception cref="System.<API key>">
Thrown when a required parameter is null
</exception>
<return>
A response object containing the response body and response headers.
</return>
public async Task<<API key><IPage<SecurityRule>>> <API key>(string resourceGroupName, string <API key>, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken))
{
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (<API key> == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "<API key>");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2020-11-01";
// Tracing
bool _shouldTrace = <API key>.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = <API key>.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("<API key>", <API key>);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
<API key>.Enter(_invocationId, this, "List", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/<API key>/{<API key>}/securityRules").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{<API key>}", System.Uri.EscapeDataString(<API key>));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.<API key> != null && Client.<API key>.Value)
{
_httpRequest.Headers.<API key>("<API key>", System.Guid.NewGuid().ToString());
}
if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
_httpRequest.Headers.<API key>("accept-language", Client.AcceptLanguage);
}
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.<API key>(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
// Set Credentials
if (Client.Credentials != null)
{
cancellationToken.<API key>();
await Client.Credentials.<API key>(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
<API key>.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.<API key>();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
<API key>.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.<API key>();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.<API key>);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
catch (JsonException)
{
// Ignore the exception
}
ex.Request = new <API key>(_httpRequest, _requestContent);
ex.Response = new <API key>(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
<API key>.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new <API key><IPage<SecurityRule>>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<SecurityRule>>(_responseContent, Client.<API key>);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new <API key>("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
<API key>.Exit(_invocationId, _result);
}
return _result;
}
<summary>
Deletes the specified network security rule.
</summary>
<param name='resourceGroupName'>
The name of the resource group.
</param>
<param name='<API key>'>
The name of the network security group.
</param>
<param name='securityRuleName'>
The name of the security rule.
</param>
<param name='customHeaders'>
Headers that will be added to request.
</param>
<param name='cancellationToken'>
The cancellation token.
</param>
<exception cref="CloudException">
Thrown when the operation returned an invalid status code
</exception>
<exception cref="ValidationException">
Thrown when a required parameter is null
</exception>
<exception cref="System.<API key>">
Thrown when a required parameter is null
</exception>
<return>
A response object containing the response body and response headers.
</return>
public async Task<<API key>> <API key>(string resourceGroupName, string <API key>, string securityRuleName, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken))
{
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (<API key> == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "<API key>");
}
if (securityRuleName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName");
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2020-11-01";
// Tracing
bool _shouldTrace = <API key>.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = <API key>.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("<API key>", <API key>);
tracingParameters.Add("securityRuleName", securityRuleName);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
<API key>.Enter(_invocationId, this, "BeginDelete", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/<API key>/{<API key>}/securityRules/{securityRuleName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{<API key>}", System.Uri.EscapeDataString(<API key>));
_url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("DELETE");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.<API key> != null && Client.<API key>.Value)
{
_httpRequest.Headers.<API key>("<API key>", System.Guid.NewGuid().ToString());
}
if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
_httpRequest.Headers.<API key>("accept-language", Client.AcceptLanguage);
}
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.<API key>(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
// Set Credentials
if (Client.Credentials != null)
{
cancellationToken.<API key>();
await Client.Credentials.<API key>(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
<API key>.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.<API key>();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
<API key>.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.<API key>();
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.<API key>);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
catch (JsonException)
{
// Ignore the exception
}
ex.Request = new <API key>(_httpRequest, _requestContent);
ex.Response = new <API key>(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
<API key>.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new <API key>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
<API key>.Exit(_invocationId, _result);
}
return _result;
}
<summary>
Creates or updates a security rule in the specified network security group.
</summary>
<param name='resourceGroupName'>
The name of the resource group.
</param>
<param name='<API key>'>
The name of the network security group.
</param>
<param name='securityRuleName'>
The name of the security rule.
</param>
<param name='<API key>'>
Parameters supplied to the create or update network security rule
operation.
</param>
<param name='customHeaders'>
Headers that will be added to request.
</param>
<param name='cancellationToken'>
The cancellation token.
</param>
<exception cref="CloudException">
Thrown when the operation returned an invalid status code
</exception>
<exception cref="<API key>">
Thrown when unable to deserialize the response
</exception>
<exception cref="ValidationException">
Thrown when a required parameter is null
</exception>
<exception cref="System.<API key>">
Thrown when a required parameter is null
</exception>
<return>
A response object containing the response body and response headers.
</return>
public async Task<<API key><SecurityRule>> <API key>(string resourceGroupName, string <API key>, string securityRuleName, SecurityRule <API key>, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken))
{
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
if (<API key> == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "<API key>");
}
if (securityRuleName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "securityRuleName");
}
if (<API key> == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "<API key>");
}
if (<API key> != null)
{
<API key>.Validate();
}
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
string apiVersion = "2020-11-01";
// Tracing
bool _shouldTrace = <API key>.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = <API key>.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("<API key>", <API key>);
tracingParameters.Add("securityRuleName", securityRuleName);
tracingParameters.Add("<API key>", <API key>);
tracingParameters.Add("apiVersion", apiVersion);
tracingParameters.Add("cancellationToken", cancellationToken);
<API key>.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
// Construct URL
var _baseUrl = Client.BaseUri.AbsoluteUri;
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/<API key>/{<API key>}/securityRules/{securityRuleName}").ToString();
_url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
_url = _url.Replace("{<API key>}", System.Uri.EscapeDataString(<API key>));
_url = _url.Replace("{securityRuleName}", System.Uri.EscapeDataString(securityRuleName));
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
List<string> _queryParameters = new List<string>();
if (apiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion)));
}
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("PUT");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.<API key> != null && Client.<API key>.Value)
{
_httpRequest.Headers.<API key>("<API key>", System.Guid.NewGuid().ToString());
}
if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
_httpRequest.Headers.<API key>("accept-language", Client.AcceptLanguage);
}
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.<API key>(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
if(<API key> != null)
{
_requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(<API key>, Client.<API key>);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.<API key>.Parse("application/json; charset=utf-8");
}
// Set Credentials
if (Client.Credentials != null)
{
cancellationToken.<API key>();
await Client.Credentials.<API key>(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
<API key>.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.<API key>();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
<API key>.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.<API key>();
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.<API key>);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
catch (JsonException)
{
// Ignore the exception
}
ex.Request = new <API key>(_httpRequest, _requestContent);
ex.Response = new <API key>(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
<API key>.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new <API key><SecurityRule>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<SecurityRule>(_responseContent, Client.<API key>);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new <API key>("Unable to deserialize the response.", _responseContent, ex);
}
}
// Deserialize Response
if ((int)_statusCode == 201)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<SecurityRule>(_responseContent, Client.<API key>);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new <API key>("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
<API key>.Exit(_invocationId, _result);
}
return _result;
}
<summary>
Gets all security rules in a network security group.
</summary>
<param name='nextPageLink'>
The NextLink from the previous successful call to List operation.
</param>
<param name='customHeaders'>
Headers that will be added to request.
</param>
<param name='cancellationToken'>
The cancellation token.
</param>
<exception cref="CloudException">
Thrown when the operation returned an invalid status code
</exception>
<exception cref="<API key>">
Thrown when unable to deserialize the response
</exception>
<exception cref="ValidationException">
Thrown when a required parameter is null
</exception>
<exception cref="System.<API key>">
Thrown when a required parameter is null
</exception>
<return>
A response object containing the response body and response headers.
</return>
public async Task<<API key><IPage<SecurityRule>>> <API key>(string nextPageLink, Dictionary<string, List<string>> customHeaders = null, Cancellation<API key> = default(CancellationToken))
{
if (nextPageLink == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
}
// Tracing
bool _shouldTrace = <API key>.IsEnabled;
string _invocationId = null;
if (_shouldTrace)
{
_invocationId = <API key>.NextInvocationId.ToString();
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
tracingParameters.Add("nextPageLink", nextPageLink);
tracingParameters.Add("cancellationToken", cancellationToken);
<API key>.Enter(_invocationId, this, "ListNext", tracingParameters);
}
// Construct URL
string _url = "{nextLink}";
_url = _url.Replace("{nextLink}", nextPageLink);
List<string> _queryParameters = new List<string>();
if (_queryParameters.Count > 0)
{
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
}
// Create HTTP transport objects
var _httpRequest = new HttpRequestMessage();
HttpResponseMessage _httpResponse = null;
_httpRequest.Method = new HttpMethod("GET");
_httpRequest.RequestUri = new System.Uri(_url);
// Set Headers
if (Client.<API key> != null && Client.<API key>.Value)
{
_httpRequest.Headers.<API key>("<API key>", System.Guid.NewGuid().ToString());
}
if (Client.AcceptLanguage != null)
{
if (_httpRequest.Headers.Contains("accept-language"))
{
_httpRequest.Headers.Remove("accept-language");
}
_httpRequest.Headers.<API key>("accept-language", Client.AcceptLanguage);
}
if (customHeaders != null)
{
foreach(var _header in customHeaders)
{
if (_httpRequest.Headers.Contains(_header.Key))
{
_httpRequest.Headers.Remove(_header.Key);
}
_httpRequest.Headers.<API key>(_header.Key, _header.Value);
}
}
// Serialize Request
string _requestContent = null;
// Set Credentials
if (Client.Credentials != null)
{
cancellationToken.<API key>();
await Client.Credentials.<API key>(_httpRequest, cancellationToken).ConfigureAwait(false);
}
// Send Request
if (_shouldTrace)
{
<API key>.SendRequest(_invocationId, _httpRequest);
}
cancellationToken.<API key>();
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
if (_shouldTrace)
{
<API key>.ReceiveResponse(_invocationId, _httpResponse);
}
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.<API key>();
string _responseContent = null;
if ((int)_statusCode != 200)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.<API key>);
if (_errorBody != null)
{
ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
catch (JsonException)
{
// Ignore the exception
}
ex.Request = new <API key>(_httpRequest, _requestContent);
ex.Response = new <API key>(_httpResponse, _responseContent);
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
if (_shouldTrace)
{
<API key>.Error(_invocationId, ex);
}
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw ex;
}
// Create Result
var _result = new <API key><IPage<SecurityRule>>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
{
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
}
// Deserialize Response
if ((int)_statusCode == 200)
{
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<Page<SecurityRule>>(_responseContent, Client.<API key>);
}
catch (JsonException ex)
{
_httpRequest.Dispose();
if (_httpResponse != null)
{
_httpResponse.Dispose();
}
throw new <API key>("Unable to deserialize the response.", _responseContent, ex);
}
}
if (_shouldTrace)
{
<API key>.Exit(_invocationId, _result);
}
return _result;
}
}
}
|
/*
params=new Object()
params.scheduleno=scheduleno
params.materialletter=materialletter
<API key>('../NEOSYS/upload.htm',params)
*/
//images are not stored per dataset at the moment so that they can be
//nor are they stored per file or per key so that they can be easily saved into a shared folder instead of going by web upload
params = {}
params.database = gdataset
params.filename = 'USERS'
params.key = gkey.neosysconvert(' ', '') + '_signature'
params.versionno = ''//newarchiveno
params.updateallowed = true
params.deleteallowed = true
//params.allowimages = true
//we only allow one image type merely so that the signature file name
//is always know and doesnt need saving in the user file
//and no possibility of uploading two image files with different extensions
params.<API key> = 'jpg'
var targetfilename = <API key>('../NEOSYS/upload.htm', params)
window.setTimeout('users_postdisplay()', 1)
if (!targetfilename)
return false
return true
}
function <API key>(el) {
el.removeAttribute("width")
el.removeAttribute("height")
}
|
using Autofac;
using Autofac.Core;
using Makc2017.Core.App;
using System.Collections.Generic;
using System.Linq;
namespace Makc2017.Modules.Dummy.Caching
{
<summary>
Модули. Модуль "Dummy". Кэширование. Плагин.
</summary>
public class <API key> : ModuleDummyPlugin
{
#region Properties
<summary>
Конфигурация кэширования.
</summary>
private <API key> CachingConfig { get; set; }
#endregion Properties
#region Public methods
<summary>
Инициализировать.
</summary>
<param name="pluginEnvironment">Окружение плагинов.</param>
public sealed override void Init(<API key> pluginEnvironment)
{
base.Init(pluginEnvironment);
CachingConfig.Init(<API key>);
}
<summary>
Распознать зависимости.
</summary>
<param name="componentContext">Контекст компонентов.</param>
public sealed override void Resolve(IComponentContext componentContext)
{
base.Resolve(componentContext);
CachingConfig = componentContext.Resolve<<API key>>();
}
#endregion Public methods
#region Protected methods
<summary>
Создать распознаватель зависимостей.
</summary>
<returns>Распознаватель зависимостей.</returns>
protected sealed override IModule CreateResolver()
{
return new <API key>();
}
<summary>
Создать пути к файлам конфигурации.
</summary>
<returns>Пути к файлам конфигурации.</returns>
protected sealed override IEnumerable<string> <API key>()
{
return base.<API key>().Concat(new[] { @"Makc2017.Modules.Dummy.Caching\config.json" });
}
#endregion Protected methods
}
}
|
package queue;
/**
* Queue server metadata manager.
*
* @author Thanh Nguyen <btnguyen2k@gmail.com>
* @since 0.1.0
*/
public interface IQsMetadataManager {
}
|
<?php
namespace Symfony\Component\Routing\Generator;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Exception\<API key>;
use Symfony\Component\Routing\Exception\<API key>;
use Symfony\Component\Routing\Exception\<API key>;
use Psr\Log\LoggerInterface;
class UrlGenerator implements <API key>, <API key>
{
protected $routes;
protected $context;
/**
* @var bool|null
*/
protected $strictRequirements = true;
protected $logger;
|
'use strict';
const path = require('path'),
mongoose = require('mongoose'),
Promise = require('bluebird'),
errorHandler = require(path.resolve('./modules/core/server/controllers/errors.server.controller')),
_ = require('lodash');
mongoose.Promise = Promise;
const User = mongoose.model('User');
const Project = mongoose.model('Project');
/**
* Patch Update User Fields
*/
exports.patchUser = (req, res) => {
_.extend(req.model, req.body)
.save()
.then(updatedUser => {
res.jsonp(updatedUser);
})
.catch(err => {
console.error('ERROR on patch update for user `err`:\n', err);
res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
});
};
/**
* Return list of projects by contributor - query param `publishedOnly`, if true, returns only published projects
*
* @param req
* @param req.query.publishedOnly
* @param res
*/
exports.<API key> = (req, res) => {
const projectIdsArray = [];
const projectsArray = [];
req.model.associatedProjects.map(assocProjId => { projectIdsArray.push(assocProjId); });
Project.find({
'_id': { $in: projectIdsArray }
})
.then(projects => {
if (req.query.publishedOnly===true) {
projects.map(project => {
if(project.status[0]==='published') {
projectsArray.push(project);
}
});
projects = projectsArray;
}
res.jsonp(projects);
})
.catch(err => {
console.error('error:\n', err);
return res.status(400).send({
message: errorHandler.getErrorMessage(err)
});
});
};
|
using System.Linq;
using System.Threading.Tasks;
using JSONAPI.Documents;
using Newtonsoft.Json;
namespace JSONAPI.Json
{
<summary>
Default implementation of <API key>
</summary>
public class <API key> : <API key>
{
private readonly <API key> <API key>;
private readonly IMetadataFormatter _metadataFormatter;
private const string PrimaryDataKeyName = "data";
private const string RelatedDataKeyName = "included";
private const string MetaKeyName = "meta";
<summary>
Creates a <API key>
</summary>
<param name="<API key>"></param>
<param name="metadataFormatter"></param>
public <API key>(<API key> <API key>, IMetadataFormatter metadataFormatter)
{
<API key> = <API key>;
_metadataFormatter = metadataFormatter;
}
public Task Serialize(<API key> document, JsonWriter writer)
{
writer.WriteStartObject();
writer.WritePropertyName(PrimaryDataKeyName);
<API key>.Serialize(document.PrimaryData, writer);
if (document.RelatedData != null && document.RelatedData.Any())
{
writer.WritePropertyName(RelatedDataKeyName);
writer.WriteStartArray();
foreach (var resourceObject in document.RelatedData)
{
<API key>.Serialize(resourceObject, writer);
}
writer.WriteEndArray();
}
if (document.Metadata != null)
{
writer.WritePropertyName(MetaKeyName);
_metadataFormatter.Serialize(document.Metadata, writer);
}
writer.WriteEndObject();
return Task.FromResult(0);
}
public async Task<<API key>> Deserialize(JsonReader reader, string currentPath)
{
if (reader.TokenType != JsonToken.StartObject)
throw new <API key>("Invalid document root", "Document root is not an object!", currentPath);
IResourceObject primaryData = null;
IMetadata metadata = null;
while (reader.Read())
{
if (reader.TokenType != JsonToken.PropertyName) break;
// Has to be a property name
var propertyName = (string)reader.Value;
reader.Read();
switch (propertyName)
{
case RelatedDataKeyName:
// TODO: If we want to capture related resources, this would be the place to do it
reader.Skip();
break;
case PrimaryDataKeyName:
primaryData = await <API key>(reader, currentPath + "/" + PrimaryDataKeyName);
break;
case MetaKeyName:
metadata = await _metadataFormatter.Deserialize(reader, currentPath + "/" + MetaKeyName);
break;
default:
reader.Skip();
break;
}
}
return new <API key>(primaryData, new IResourceObject[] { }, metadata);
}
private async Task<IResourceObject> <API key>(JsonReader reader, string currentPath)
{
if (reader.TokenType == JsonToken.Null) return null;
var primaryData = await <API key>.Deserialize(reader, currentPath);
return primaryData;
}
}
}
|
/*jshint unused:false*/
var chai = require('chai'),
expect = chai.expect;
var request = require('supertest');
module.exports = function() {
'use strict';
this.Then(/^The JSON is returned by issuing a "GET" at the specified uri:$/, function(json, callback) {
request(this.serverLocation)
.get('/hello')
.expect('Content-Type', /json/)
.expect(200)
.end(function(error, res) {
if(error) {
expect(false).to.equal(true, error);
}
else {
expect(res.body).to.deep.equal(JSON.parse(json));
}
callback();
});
});
};
|
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
using System.Windows.Forms;
using System.Windows.Forms.Design;
namespace DotSpatial.Symbology.Forms
{
<summary>
<API key>.
</summary>
public class <API key> : UITypeEditor
{
#region Fields
private <API key> _dialogProvider;
#endregion
#region Properties
<summary>
Gets a value indicating whether the drop down is resizeable.
</summary>
public override bool IsDropDownResizable => true;
#endregion
#region Methods
<summary>
Edits a value based on some user input which is collected from a character control.
</summary>
<param name="context">The type descriptor context.</param>
<param name="provider">The service provider.</param>
<param name="value">Not used.</param>
<returns>The selected font family name.</returns>
public override object EditValue(<API key> context, IServiceProvider provider, object value)
{
_dialogProvider = provider?.GetService(typeof(<API key>)) as <API key>;
ListBox cmb = new ListBox();
FontFamily[] fams = FontFamily.Families;
cmb.SuspendLayout();
foreach (FontFamily fam in fams)
{
cmb.Items.Add(fam.Name);
}
cmb.<API key> += <API key>;
cmb.ResumeLayout();
_dialogProvider?.DropDownControl(cmb);
string test = (string)cmb.SelectedItem;
return test;
}
<summary>
Gets the <API key>, which in this case is drop down.
</summary>
<param name="context">The type descriptor context.</param>
<returns>The <API key>.</returns>
public override <API key> GetEditStyle(<API key> context)
{
return <API key>.DropDown;
}
private void <API key>(object sender, EventArgs e)
{
_dialogProvider.CloseDropDown();
}
#endregion
}
}
|
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http:
<html xmlns="http:
<head>
<title>deprecation.rb</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../../../../../../../../../../../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../../../../../../../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../../../../../../../../../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../../../../../../../../../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../../../../../../../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../../../../../../../../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../../../../../../../../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<span>Ruby on Rails 4.1.6</span><br />
<h1>
deprecation.rb
</h1>
<ul class="files">
<li>
../../.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/core_ext/module/deprecation.rb
</li>
<li>Last modified: 2014-10-25 21:53:16 +1100</li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Namespace -->
<div class="sectiontitle">Namespace</div>
<ul>
<li>
<span class="type">MODULE</span>
<a href="../../../../../../../../../../../../../../../../classes/ActiveSupport.html">ActiveSupport</a>
</li>
<li>
<span class="type">CLASS</span>
<a href="../../../../../../../../../../../../../../../../classes/Module.html">Module</a>
</li>
</ul>
<!-- Methods -->
</div>
</div>
</body>
</html>
|
/* global sinon, setup, teardown */
/**
* __init.test.js is run before every test case.
*/
window.debug = true;
var AScene = require('aframe').AScene;
beforeEach(function () {
this.sinon = sinon.sandbox.create();
// Stub to not create a WebGL context since Travis CI runs headless.
this.sinon.stub(AScene.prototype, 'attachedCallback');
});
afterEach(function () {
// Clean up any attached elements.
['canvas', 'a-assets', 'a-scene'].forEach(function (tagName) {
var els = document.querySelectorAll(tagName);
for (var i = 0; i < els.length; i++) {
els[i].parentNode.removeChild(els[i]);
}
});
AScene.scene = null;
this.sinon.restore();
});
|
Copyright (c) 2016 Dropbox, Inc. All rights reserved.
Auto-generated by Stone, do not modify.
#import <Foundation/Foundation.h>
#import "<API key>.h"
@class DBPAPERImportFormat;
@class <API key>;
<API key>
#pragma mark - API Object
The `PaperDocCreateArgs` struct.
This class implements the `DBSerializable` protocol (serialize and
deserialize instance methods), which is required for all Obj-C SDK API route
objects.
@interface <API key> : NSObject <DBSerializable, NSCopying>
#pragma mark - Instance fields
The Paper folder ID where the Paper document should be created. The API user
has to have write access to this folder or error is thrown.
@property (nonatomic, readonly, copy, nullable) NSString *parentFolderId;
The format of provided data.
@property (nonatomic, readonly) DBPAPERImportFormat *importFormat;
#pragma mark - Constructors
Full constructor for the struct (exposes all instance variables).
@param importFormat The format of provided data.
@param parentFolderId The Paper folder ID where the Paper document should be
created. The API user has to have write access to this folder or error is
thrown.
@return An initialized instance.
- (instancetype)<API key>:(DBPAPERImportFormat *)importFormat
parentFolderId:(nullable NSString *)parentFolderId;
Convenience constructor (exposes only non-nullable instance variables with
no default value).
@param importFormat The format of provided data.
@return An initialized instance.
- (instancetype)<API key>:(DBPAPERImportFormat *)importFormat;
- (instancetype)init NS_UNAVAILABLE;
@end
#pragma mark - Serializer Object
The serialization class for the `PaperDocCreateArgs` struct.
@interface <API key> : NSObject
Serializes `<API key>` instances.
@param instance An instance of the `<API key>` API object.
@return A json-compatible dictionary representation of the
`<API key>` API object.
+ (nullable NSDictionary *)serialize:(<API key> *)instance;
Deserializes `<API key>` instances.
@param dict A json-compatible dictionary representation of the
`<API key>` API object.
@return An instantiation of the `<API key>` object.
+ (<API key> *)deserialize:(NSDictionary *)dict;
@end
<API key>
|
#container{
width: 750px;
margin: 0 auto;
text-align: left;
}
#header {
position: relative;
top:2px;
}
#menu{
float: left;
width: 150px;
}
#anchorMenu{
position: fixed;
top: auto;
width: 8em;
left: auto;
margin: -2.5em 0 0 0;
z-index: 5;
overflow: hidden;
padding-top: 20px;
}
#mainArea{
padding-top: 5px;
float: left;
width: 570px
}
#footer{
clear: both;
text-align: center;
font-size: 80%;
padding-left: 33.3%
}
body{
text-align: center;
font-family: arial;
background: #FFF;
padding: 0;
}
a:link, a:visited {
display: block;
color:rgb(41,136,126);
text-decoration:none;
background-color: #EBEBE6;
width: 130px;
text-align: left;
padding: 3px;
}
a:hover, a:active {
color: white;
background-color:#7A991A;
}
a:hover.anchor, a:active.anchor {
color: white;
background-color:brown;
}
a.w3c{
width: 83px;
}
h2, h4{
margin: 8px;
}
ul li{
font-size: 15px;
}
table{
border:0px solid black;
text-align: left;
}
td.padded{
border:0px solid black;
padding: 0px 0px 38px 0px;
width:25%
}
h3.headings{
text-align: left;
}
h4.subHead{
text-align:left;
}
p{
text-align:left;
font-size: 15px;
}
p.profile{
text-align:left;
font-weight: bold;
font-size: 15px;
}
.center{
text-align: center;
}
.padded{
padding-left: 110px;
}
|
{% raw %}{% extends "wagtailadmin/home.html" %}
{% load wagtailcore_tags <API key> %}
{% get_settings %}
{% block branding_welcome %}
Welcome {% if settings.pages.SiteBranding.site_name %}to {{ settings.pages.SiteBranding.site_name }}{% endif %}
{% endblock %}{% endraw %}
|
public enum CoffeePrice
{
Small = 50,
Normal = 100,
Double =200
}
|
<!DOCTYPE HTML PUBLIC "-
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_66-internal) on Tue Dec 08 09:28:01 GMT 2015 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class org.apache.jena.sparql.expr.aggregate.AggAvgDistinct (Apache Jena ARQ)</title>
<meta name="date" content="2015-12-08">
<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.jena.sparql.expr.aggregate.AggAvgDistinct (Apache Jena ARQ)";
}
}
catch(err) {
}
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="topNav"><a name="navbar.top">
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/jena/sparql/expr/aggregate/AggAvgDistinct.html" title="class in org.apache.jena.sparql.expr.aggregate">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/jena/sparql/expr/aggregate/class-use/AggAvgDistinct.html" target="_top">Frames</a></li>
<li><a href="AggAvgDistinct.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.jena.sparql.expr.aggregate.AggAvgDistinct" class="title">Uses of Class<br>org.apache.jena.sparql.expr.aggregate.AggAvgDistinct</h2>
</div>
<div class="classUseContainer">No usage of org.apache.jena.sparql.expr.aggregate.AggAvgDistinct</div>
<div class="bottomNav"><a name="navbar.bottom">
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../../org/apache/jena/sparql/expr/aggregate/AggAvgDistinct.html" title="class in org.apache.jena.sparql.expr.aggregate">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/jena/sparql/expr/aggregate/class-use/AggAvgDistinct.html" target="_top">Frames</a></li>
<li><a href="AggAvgDistinct.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>Licenced under the Apache License, Version 2.0</small></p>
</body>
</html>
|
"use strict";
var mathUtils = require("./math-utils");
exports.shuffle = function(array) {
var len = array.length;
for ( var i=0; i<len; i++ ) {
var rand = mathUtils.randomInt(0,len-1);
var temp = array[i];
array[i] = array[rand];
array[rand] = temp;
}
};
|
# -*- coding: utf-8 -*-
# Cloud Robotics FX API
import cloudrobotics.message as message
APP_ID = 'SbrApiServices'
PROCESSING_ID = '<API key>'
class ConversationMessage(message.CRFXMessage):
def __init__(self, visitor, visitor_id, talkByMe, type):
super(ConversationMessage, self).__init__()
self.header['RoutingType'] = message.ROUTING_TYPE_CALL
self.header['AppProcessingId'] = PROCESSING_ID
self.header['MessageId'] = type
self.body = {
'visitor': visitor,
'visitor_id': visitor_id,
'talkByMe': talkByMe
}
|
Rails.application.routes.draw do
namespace :admin do
namespace :reports do
get 'deliveries' => 'deliveries#index'
end
get 'users' => 'users#index'
get 'users/:id' => 'users#show'
end
root to: 'pages#index'
end
|
/* eslint quote-props: ["error", "consistent"] */
// Japanese Hirajoshi scale
// 1-4-2-1-4
// Gb G B Db D Gb
export default {
'a': { instrument: 'piano', note: 'a4' },
'b': { instrument: 'piano', note: 'eb3' },
'c': { instrument: 'piano', note: 'd6' },
'd': { instrument: 'piano', note: 'eb4' },
'e': { instrument: 'piano', note: 'd4' },
'f': { instrument: 'piano', note: 'bb5' },
'g': { instrument: 'piano', note: 'd7' },
'h': { instrument: 'piano', note: 'g3' },
'i': { instrument: 'piano', note: 'g5' },
'j': { instrument: 'piano', note: 'bb6' },
'k': { instrument: 'piano', note: 'eb6' },
'l': { instrument: 'piano', note: 'bb4' },
'm': { instrument: 'piano', note: 'a6' },
'n': { instrument: 'piano', note: 'a5' },
'o': { instrument: 'piano', note: 'd5' },
'p': { instrument: 'piano', note: 'a2' },
'q': { instrument: 'piano', note: 'bb2' },
'r': { instrument: 'piano', note: 'a3' },
's': { instrument: 'piano', note: 'd3' },
't': { instrument: 'piano', note: 'g4' },
'u': { instrument: 'piano', note: 'g6' },
'v': { instrument: 'piano', note: 'bb3' },
'w': { instrument: 'piano', note: 'eb5' },
'x': { instrument: 'piano', note: 'eb2' },
'y': { instrument: 'piano', note: 'g2' },
'z': { instrument: 'piano', note: 'eb7' },
'A': { instrument: 'celesta', note: 'a4' },
'B': { instrument: 'celesta', note: 'eb3' },
'C': { instrument: 'celesta', note: 'd6' },
'D': { instrument: 'celesta', note: 'eb4' },
'E': { instrument: 'celesta', note: 'd4' },
'F': { instrument: 'celesta', note: 'bb4' },
'G': { instrument: 'celesta', note: 'd2' },
'H': { instrument: 'celesta', note: 'g3' },
'I': { instrument: 'celesta', note: 'g5' },
'J': { instrument: 'celesta', note: 'bb6' },
'K': { instrument: 'celesta', note: 'eb6' },
'L': { instrument: 'celesta', note: 'bb5' },
'M': { instrument: 'celesta', note: 'a6' },
'N': { instrument: 'celesta', note: 'a5' },
'O': { instrument: 'celesta', note: 'd5' },
'P': { instrument: 'celesta', note: 'a7' },
'Q': { instrument: 'celesta', note: 'bb7' },
'R': { instrument: 'celesta', note: 'a3' },
'S': { instrument: 'celesta', note: 'd3' },
'T': { instrument: 'celesta', note: 'g4' },
'U': { instrument: 'celesta', note: 'g6' },
'V': { instrument: 'celesta', note: 'bb3' },
'W': { instrument: 'celesta', note: 'eb5' },
'X': { instrument: 'celesta', note: 'eb7' },
'Y': { instrument: 'celesta', note: 'g7' },
'Z': { instrument: 'celesta', note: 'eb2' },
'$': { instrument: 'swell', note: 'eb3' },
',': { instrument: 'swell', note: 'eb3' },
'/': { instrument: 'swell', note: 'bb3' },
'\\': { instrument: 'swell', note: 'eb3' },
':': { instrument: 'swell', note: 'g3' },
';': { instrument: 'swell', note: 'bb3' },
'-': { instrument: 'swell', note: 'bb3' },
'+': { instrument: 'swell', note: 'g3' },
'|': { instrument: 'swell', note: 'bb3' },
'{': { instrument: 'swell', note: 'bb3' },
'}': { instrument: 'swell', note: 'eb3' },
'[': { instrument: 'swell', note: 'g3' },
']': { instrument: 'swell', note: 'bb3' },
'%': { instrument: 'swell', note: 'bb3' },
'&': { instrument: 'swell', note: 'eb3' },
'*': { instrument: 'swell', note: 'eb3' },
'^': { instrument: 'swell', note: 'bb3' },
'#': { instrument: 'swell', note: 'g3' },
'!': { instrument: 'swell', note: 'g3' },
'@': { instrument: 'swell', note: 'eb3' },
'(': { instrument: 'swell', note: 'g3' },
')': { instrument: 'swell', note: 'eb3' },
'=': { instrument: 'swell', note: 'eb3' },
'~': { instrument: 'swell', note: 'g3' },
'`': { instrument: 'swell', note: 'eb3' },
'_': { instrument: 'swell', note: 'g3' },
'"': { instrument: 'swell', note: 'eb3' },
"'": { instrument: 'swell', note: 'bb3' },
'<': { instrument: 'swell', note: 'g3' },
'>': { instrument: 'swell', note: 'g3' },
'.': { instrument: 'swell', note: 'g3' },
'?': { instrument: 'swell', note: 'bb3' },
'0': { instrument: 'fluteorgan', note: 'd3' },
'1': { instrument: 'fluteorgan', note: 'eb3' },
'2': { instrument: 'fluteorgan', note: 'g3' },
'3': { instrument: 'fluteorgan', note: 'a3' },
'4': { instrument: 'fluteorgan', note: 'bb3' },
'5': { instrument: 'fluteorgan', note: 'd2' },
'6': { instrument: 'fluteorgan', note: 'eb2' },
'7': { instrument: 'fluteorgan', note: 'g2' },
'8': { instrument: 'fluteorgan', note: 'a2' },
'9': { instrument: 'fluteorgan', note: 'bb2' },
's1': { instrument: 'swell', note: 'eb3' },
's2': { instrument: 'swell', note: 'g3' },
's3': { instrument: 'swell', note: 'bb3' }
};
|
<html>
<META HTTP-EQUIV=Content-Type Content="text/html; charset=utf8">
<!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/01583/0158388122800.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:13:25 GMT -->
<head><title>:01583 :088122800</title>
<link rel="stylesheet" type="text/css" href="../../version.css" >
</HEAD>
<body><left>
<table><tr><td><FONT COLOR=blue SIZE=5>(01583)</font>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td>
<tr><td align=left valign=top>
<a href=0158358011000.html target=law01583><nobr><font size=2> 58 1 10 </font></nobr></a>
</td>
<td valign=top><font size=2>77</font></td>
<tr><td align=left valign=top><nobr><font size=2> 58 1 27 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0158360042700.html target=law01583><nobr><font size=2> 60 4 27 </font></nobr></a>
</td>
<td valign=top><font size=2>60</font></td>
<tr><td align=left valign=top><nobr><font size=2> 60 5 5 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0158364010700.html target=law01583><nobr><font size=2> 64 1 7 </font></nobr></a>
</td>
<td valign=top><font size=2>8, 32, 38, 42, 44, 46, 47, 50, 52, 54<br>
15</font></td>
<tr><td align=left valign=top><nobr><font size=2> 64 1 17 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0158369122600.html target=law01583><nobr><font size=2> 69 12 26 </font></nobr></a>
</td>
<td valign=top><font size=2>13, 42</font></td>
<tr><td align=left valign=top><nobr><font size=2> 70 1 12 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0158381031900.html target=law01583><nobr><font size=2> 81 3 19 </font></nobr></a>
</td>
<td valign=top><font size=2>74</font></td>
<tr><td align=left valign=top><nobr><font size=2> 81 4 6 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0158388122800.html target=law01583><nobr><font size=2> 88 12 28 </font></nobr></a>
</td>
<td valign=top><font size=2>42, 43, 46, 47, 49, 52, 58<br>
521, 522</font></td>
<tr><td align=left valign=top><nobr><font size=2> 89 1 12 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0158391040200.html target=law01583><nobr><font size=2> 91 4 2 </font></nobr></a>
</td>
<td valign=top><font size=2>50, 51</font></td>
<tr><td align=left valign=top><nobr><font size=2> 91 4 24 </font></nobr></td>
<tr><td align=left valign=top>
<a href=0158392011300.html target=law01583><nobr><font size=2> 92 1 13 </font></nobr></a>
</td>
<td valign=top><font size=2>522</font></td>
<tr><td align=left valign=top><nobr><font size=2> 92 2 6 </font></nobr></td>
<tr><td align=left valign=top>
<a href=01583100121400.html target=law01583><nobr><font size=2> 100 12 14 </font></nobr></a>
</td>
<td valign=top><font size=2>33, 39, 53</font></td>
<tr><td align=left valign=top><nobr><font size=2> 101 1 4 </font></nobr></td>
</table></table></table></table>
<p><table><tr><td><font color=blue size=4>881228()</font></td>
<td><a href=http://lis.ly.gov.tw/lghtml/lawstat/reason2/0158388122800.htm target=reason><font size=2></font></a></td>
<td><a href=http://lis.ly.gov.tw/lgcgi/lglawproc?0158388122800 target=proc><font size=2></font></a></td>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
<br>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</table>
<table><tr><td> </td>
<td><font color=4000ff size=4> </font>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
<table><tr><td> </td><td>
<table><tr><td> </td><td><font color=8000ff></font>
</font>
<table><tr><td> </td>
<td>
<br>
</td>
</table>
</table>
</table>
</left>
</body>
<!-- Mirrored from lis.ly.gov.tw/lghtml/lawstat/version2/01583/0158388122800.htm by HTTrack Website Copier/3.x [XR&CO'2010], Sun, 24 Mar 2013 09:13:25 GMT -->
</html>
|
namespace PInvoke
{
using System.Runtime.InteropServices;
<content>
Contains the <see cref="WIN32_FIND_DATA"/> nested type.
</content>
public partial class Kernel32
{
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WIN32_FIND_DATA
{
<summary>
The file attributes of a file.
</summary>
<remarks>
Although the enum we bind to here exists in the .NET Framework
as System.IO.FileAttributes, it is not reliably present.
Portable profiles don't include it, for example. So we have to define our own.
</remarks>
public FileAttribute dwFileAttributes;
<summary>
A FILETIME structure that specifies when a file or directory was created.
If the underlying file system does not support creation time, this member is zero.
</summary>
public FILETIME ftCreationTime;
<summary>
A FILETIME structure.
For a file, the structure specifies when the file was last read from, written to, or for executable files, run.
For a directory, the structure specifies when the directory is created.If the underlying file system does not support last access time, this member is zero.
On the FAT file system, the specified date for both files and directories is correct, but the time of day is always set to midnight.
</summary>
public FILETIME ftLastAccessTime;
<summary>
A FILETIME structure.
For a file, the structure specifies when the file was last written to, truncated, or overwritten, for example, when WriteFile or SetEndOfFile are used.The date and time are not updated when file attributes or security descriptors are changed.
For a directory, the structure specifies when the directory is created.If the underlying file system does not support last write time, this member is zero.
</summary>
public FILETIME ftLastWriteTime;
<summary>
The high-order DWORD value of the file size, in bytes.
This value is zero unless the file size is greater than MAXDWORD.
The size of the file is equal to(nFileSizeHigh* (MAXDWORD+1)) + nFileSizeLow.
</summary>
public uint nFileSizeHigh;
<summary>
The low-order DWORD value of the file size, in bytes.
</summary>
public uint nFileSizeLow;
<summary>
If the dwFileAttributes member includes the <API key> attribute, this member specifies the reparse point tag.
Otherwise, this value is undefined and should not be used.
For more information see Reparse Point Tags.
</summary>
public uint dwReserved0;
<summary>
Reserved for future use.
</summary>
public uint dwReserved1;
<summary>
The name of the file.
</summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
public string cFileName;
<summary>
An alternative name for the file.
This name is in the classic 8.3 file name format.
</summary>
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 14)]
public string cAlternateFileName;
}
}
}
|
package arn
// PersonName represents the name of a person.
type PersonName struct {
English Name `json:"english" editable:"true"`
Japanese Name `json:"japanese" editable:"true"`
}
// String returns the default visualization of the name.
func (name *PersonName) String() string {
return name.ByUser(nil)
}
// ByUser returns the preferred name for the given user.
func (name *PersonName) ByUser(user *User) string {
if user == nil {
return name.English.String()
}
switch user.Settings().TitleLanguage {
case "japanese":
if name.Japanese.String() == "" {
return name.English.String()
}
return name.Japanese.String()
default:
return name.English.String()
}
}
|
package testdata
import (
. "goa.design/goa/v3/dsl"
)
var <API key> = func() {
var _ = API("aloha", func() {
Title("conflict with API name and service names")
})
var _ = Service("aloha", func() {}) // same as API name
var _ = Service("alohaapi", func() {}) // API name + 'api' suffix
var _ = Service("alohaapi1", func() {}) // API name + 'api' suffix + sequential no.
}
var <API key> = func() {
var _ = API("good-by", func() {
Title("conflict with goified API name and goified service names")
})
var _ = Service("good-by-", func() {}) // Goify name is same as API name
var _ = Service("good-by-api", func() {}) // API name + 'api' suffix
var _ = Service("good-by-api-1", func() {}) // API name + 'api' suffix + sequential no.
}
|
import {async, fakeAsync, tick} from '@angular/core/testing';
import {AsyncTestCompleter, beforeEach, describe, inject, it} from '@angular/core/testing/testing_internal';
import {AbstractControl, FormArray, FormControl, FormGroup, Validators} from '@angular/forms';
import {EventEmitter} from '../src/facade/async';
import {isPresent} from '../src/facade/lang';
export function main() {
function asyncValidator(expected: string, timeouts = {}) {
return (c: AbstractControl) => {
let resolve: (result: any) => void;
const promise = new Promise(res => { resolve = res; });
const t = isPresent((timeouts as any)[c.value]) ? (timeouts as any)[c.value] : 0;
const res = c.value != expected ? {'async': true} : null;
if (t == 0) {
resolve(res);
} else {
setTimeout(() => { resolve(res); }, t);
}
return promise;
};
}
function <API key>(c: FormControl) {
const e = new EventEmitter();
Promise.resolve(null).then(() => { e.emit({'async': true}); });
return e;
}
describe('FormGroup', () => {
describe('value', () => {
it('should be the reduced value of the child controls', () => {
const g = new FormGroup({'one': new FormControl('111'), 'two': new FormControl('222')});
expect(g.value).toEqual({'one': '111', 'two': '222'});
});
it('should be empty when there are no child controls', () => {
const g = new FormGroup({});
expect(g.value).toEqual({});
});
it('should support nested groups', () => {
const g = new FormGroup({
'one': new FormControl('111'),
'nested': new FormGroup({'two': new FormControl('222')})
});
expect(g.value).toEqual({'one': '111', 'nested': {'two': '222'}});
(<FormControl>(g.get('nested.two'))).setValue('333');
expect(g.value).toEqual({'one': '111', 'nested': {'two': '333'}});
});
});
describe('getRawValue', () => {
let fg: FormGroup;
it('should work with nested form groups/arrays', () => {
fg = new FormGroup({
'c1': new FormControl('v1'),
'group': new FormGroup({'c2': new FormControl('v2'), 'c3': new FormControl('v3')}),
'array': new FormArray([new FormControl('v4'), new FormControl('v5')])
});
fg.get('group').get('c3').disable();
(fg.get('array') as FormArray).at(1).disable();
expect(fg.getRawValue())
.toEqual({'c1': 'v1', 'group': {'c2': 'v2', 'c3': 'v3'}, 'array': ['v4', 'v5']});
});
});
describe('adding and removing controls', () => {
it('should update value and validity when control is added', () => {
const g = new FormGroup({'one': new FormControl('1')});
expect(g.value).toEqual({'one': '1'});
expect(g.valid).toBe(true);
g.addControl('two', new FormControl('2', Validators.minLength(10)));
expect(g.value).toEqual({'one': '1', 'two': '2'});
expect(g.valid).toBe(false);
});
it('should update value and validity when control is removed', () => {
const g = new FormGroup(
{'one': new FormControl('1'), 'two': new FormControl('2', Validators.minLength(10))});
expect(g.value).toEqual({'one': '1', 'two': '2'});
expect(g.valid).toBe(false);
g.removeControl('two');
expect(g.value).toEqual({'one': '1'});
expect(g.valid).toBe(true);
});
});
describe('errors', () => {
it('should run the validator when the value changes', () => {
const simpleValidator = (c: FormGroup) =>
c.controls['one'].value != 'correct' ? {'broken': true} : null;
const c = new FormControl(null);
const g = new FormGroup({'one': c}, simpleValidator);
c.setValue('correct');
expect(g.valid).toEqual(true);
expect(g.errors).toEqual(null);
c.setValue('incorrect');
expect(g.valid).toEqual(false);
expect(g.errors).toEqual({'broken': true});
});
});
describe('dirty', () => {
let c: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('value');
g = new FormGroup({'one': c});
});
it('should be false after creating a control', () => { expect(g.dirty).toEqual(false); });
it('should be true after changing the value of the control', () => {
c.markAsDirty();
expect(g.dirty).toEqual(true);
});
});
describe('touched', () => {
let c: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('value');
g = new FormGroup({'one': c});
});
it('should be false after creating a control', () => { expect(g.touched).toEqual(false); });
it('should be true after control is marked as touched', () => {
c.markAsTouched();
expect(g.touched).toEqual(true);
});
});
describe('setValue', () => {
let c: FormControl, c2: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('');
c2 = new FormControl('');
g = new FormGroup({'one': c, 'two': c2});
});
it('should set its own value', () => {
g.setValue({'one': 'one', 'two': 'two'});
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set child values', () => {
g.setValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
});
it('should set child control values if disabled', () => {
c2.disable();
g.setValue({'one': 'one', 'two': 'two'});
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one'});
expect(g.getRawValue()).toEqual({'one': 'one', 'two': 'two'});
});
it('should set group value if group is disabled', () => {
g.disable();
g.setValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set parent values', () => {
const form = new FormGroup({'parent': g});
g.setValue({'one': 'one', 'two': 'two'});
expect(form.value).toEqual({'parent': {'one': 'one', 'two': 'two'}});
});
it('should not update the parent when explicitly specified', () => {
const form = new FormGroup({'parent': g});
g.setValue({'one': 'one', 'two': 'two'}, {onlySelf: true});
expect(form.value).toEqual({parent: {'one': '', 'two': ''}});
});
it('should throw if fields are missing from supplied value (subset)', () => {
expect(() => g.setValue({
'one': 'one'
})).toThrowError(new RegExp(`Must supply a value for form control with name: 'two'`));
});
it('should throw if a value is provided for a missing control (superset)', () => {
expect(() => g.setValue({'one': 'one', 'two': 'two', 'three': 'three'}))
.toThrowError(new RegExp(`Cannot find form control with name: three`));
});
it('should throw if a value is not provided for a disabled control', () => {
c2.disable();
expect(() => g.setValue({
'one': 'one'
})).toThrowError(new RegExp(`Must supply a value for form control with name: 'two'`));
});
it('should throw if no controls are set yet', () => {
const empty = new FormGroup({});
expect(() => empty.setValue({
'one': 'one'
})).toThrowError(new RegExp(`no form controls registered with this group`));
});
describe('setValue() events', () => {
let form: FormGroup;
let logger: any[];
beforeEach(() => {
form = new FormGroup({'parent': g});
logger = [];
});
it('should emit one valueChange event per control', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
g.setValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should not fire an event when explicitly specified', fakeAsync(() => {
form.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.setValue({'one': 'one', 'two': 'two'}, {emitEvent: false});
tick();
}));
it('should emit one statusChange event per control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
g.setValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
});
});
describe('patchValue', () => {
let c: FormControl, c2: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('');
c2 = new FormControl('');
g = new FormGroup({'one': c, 'two': c2});
});
it('should set its own value', () => {
g.patchValue({'one': 'one', 'two': 'two'});
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set child values', () => {
g.patchValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
});
it('should patch disabled control values', () => {
c2.disable();
g.patchValue({'one': 'one', 'two': 'two'});
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one'});
expect(g.getRawValue()).toEqual({'one': 'one', 'two': 'two'});
});
it('should patch disabled control groups', () => {
g.disable();
g.patchValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set parent values', () => {
const form = new FormGroup({'parent': g});
g.patchValue({'one': 'one', 'two': 'two'});
expect(form.value).toEqual({'parent': {'one': 'one', 'two': 'two'}});
});
it('should not update the parent when explicitly specified', () => {
const form = new FormGroup({'parent': g});
g.patchValue({'one': 'one', 'two': 'two'}, {onlySelf: true});
expect(form.value).toEqual({parent: {'one': '', 'two': ''}});
});
it('should ignore fields that are missing from supplied value (subset)', () => {
g.patchValue({'one': 'one'});
expect(g.value).toEqual({'one': 'one', 'two': ''});
});
it('should not ignore fields that are null', () => {
g.patchValue({'one': null});
expect(g.value).toEqual({'one': null, 'two': ''});
});
it('should ignore any value provided for a missing control (superset)', () => {
g.patchValue({'three': 'three'});
expect(g.value).toEqual({'one': '', 'two': ''});
});
describe('patchValue() events', () => {
let form: FormGroup;
let logger: any[];
beforeEach(() => {
form = new FormGroup({'parent': g});
logger = [];
});
it('should emit one valueChange event per control', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
g.patchValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should not emit valueChange events for skipped controls', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
g.patchValue({'one': 'one'});
expect(logger).toEqual(['control1', 'group', 'form']);
});
it('should not fire an event when explicitly specified', fakeAsync(() => {
form.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.patchValue({'one': 'one', 'two': 'two'}, {emitEvent: false});
tick();
}));
it('should emit one statusChange event per control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
g.patchValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
});
});
describe('reset()', () => {
let c: FormControl, c2: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('initial value');
c2 = new FormControl('');
g = new FormGroup({'one': c, 'two': c2});
});
it('should set its own value if value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': 'initial value', 'two': ''});
expect(g.value).toEqual({'one': 'initial value', 'two': ''});
});
it('should set its own value if boxed value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': {value: 'initial value', disabled: false}, 'two': ''});
expect(g.value).toEqual({'one': 'initial value', 'two': ''});
});
it('should clear its own value if no value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset();
expect(g.value).toEqual({'one': null, 'two': null});
});
it('should set the value of each of its child controls if value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': 'initial value', 'two': ''});
expect(c.value).toBe('initial value');
expect(c2.value).toBe('');
});
it('should clear the value of each of its child controls if no value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset();
expect(c.value).toBe(null);
expect(c2.value).toBe(null);
});
it('should set the value of its parent if value passed', () => {
const form = new FormGroup({'g': g});
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': 'initial value', 'two': ''});
expect(form.value).toEqual({'g': {'one': 'initial value', 'two': ''}});
});
it('should clear the value of its parent if no value passed', () => {
const form = new FormGroup({'g': g});
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset();
expect(form.value).toEqual({'g': {'one': null, 'two': null}});
});
it('should not update the parent when explicitly specified', () => {
const form = new FormGroup({'g': g});
g.reset({'one': 'new value', 'two': 'new value'}, {onlySelf: true});
expect(form.value).toEqual({g: {'one': 'initial value', 'two': ''}});
});
it('should mark itself as pristine', () => {
g.markAsDirty();
expect(g.pristine).toBe(false);
g.reset();
expect(g.pristine).toBe(true);
});
it('should mark all child controls as pristine', () => {
c.markAsDirty();
c2.markAsDirty();
expect(c.pristine).toBe(false);
expect(c2.pristine).toBe(false);
g.reset();
expect(c.pristine).toBe(true);
expect(c2.pristine).toBe(true);
});
it('should mark the parent as pristine if all siblings pristine', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsDirty();
expect(form.pristine).toBe(false);
g.reset();
expect(form.pristine).toBe(true);
});
it('should not mark the parent pristine if any dirty siblings', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsDirty();
c3.markAsDirty();
expect(form.pristine).toBe(false);
g.reset();
expect(form.pristine).toBe(false);
});
it('should mark itself as untouched', () => {
g.markAsTouched();
expect(g.untouched).toBe(false);
g.reset();
expect(g.untouched).toBe(true);
});
it('should mark all child controls as untouched', () => {
c.markAsTouched();
c2.markAsTouched();
expect(c.untouched).toBe(false);
expect(c2.untouched).toBe(false);
g.reset();
expect(c.untouched).toBe(true);
expect(c2.untouched).toBe(true);
});
it('should mark the parent untouched if all siblings untouched', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsTouched();
expect(form.untouched).toBe(false);
g.reset();
expect(form.untouched).toBe(true);
});
it('should not mark the parent untouched if any touched siblings', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsTouched();
c3.markAsTouched();
expect(form.untouched).toBe(false);
g.reset();
expect(form.untouched).toBe(false);
});
it('should retain previous disabled state', () => {
g.disable();
g.reset();
expect(g.disabled).toBe(true);
});
it('should set child disabled state if boxed value passed', () => {
g.disable();
g.reset({'one': {value: '', disabled: false}, 'two': ''});
expect(c.disabled).toBe(false);
expect(g.disabled).toBe(false);
});
describe('reset() events', () => {
let form: FormGroup, c3: FormControl, logger: any[];
beforeEach(() => {
c3 = new FormControl('');
form = new FormGroup({'g': g, 'c3': c3});
logger = [];
});
it('should emit one valueChange event per reset control', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
c3.valueChanges.subscribe(() => logger.push('control3'));
g.reset();
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should not fire an event when explicitly specified', fakeAsync(() => {
form.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.reset({}, {emitEvent: false});
tick();
}));
it('should emit one statusChange event per reset control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
c3.statusChanges.subscribe(() => logger.push('control3'));
g.reset();
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should emit one statusChange event per reset control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
c3.statusChanges.subscribe(() => logger.push('control3'));
g.reset({'one': {value: '', disabled: true}});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
});
});
describe('contains', () => {
let group: FormGroup;
beforeEach(() => {
group = new FormGroup({
'required': new FormControl('requiredValue'),
'optional': new FormControl({value: 'disabled value', disabled: true})
});
});
it('should return false when the component is disabled',
() => { expect(group.contains('optional')).toEqual(false); });
it('should return false when there is no component with the given name',
() => { expect(group.contains('something else')).toEqual(false); });
it('should return true when the component is enabled', () => {
expect(group.contains('required')).toEqual(true);
group.enable('optional');
expect(group.contains('optional')).toEqual(true);
});
it('should support controls with dots in their name', () => {
expect(group.contains('some.name')).toBe(false);
group.addControl('some.name', new FormControl());
expect(group.contains('some.name')).toBe(true);
});
});
describe('statusChanges', () => {
let control: FormControl;
let group: FormGroup;
beforeEach(async(() => {
control = new FormControl('', <API key>);
group = new FormGroup({'one': control});
}));
// TODO(kara): update these tests to use fake Async
it('should fire a statusChange if child has async validation change',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
const loggedValues: string[] = [];
group.statusChanges.subscribe({
next: (status: string) => {
loggedValues.push(status);
if (loggedValues.length === 2) {
expect(loggedValues).toEqual(['PENDING', 'INVALID']);
}
async.done();
}
});
control.setValue('');
}));
});
describe('getError', () => {
it('should return the error when it is present', () => {
const c = new FormControl('', Validators.required);
const g = new FormGroup({'one': c});
expect(c.getError('required')).toEqual(true);
expect(g.getError('required', ['one'])).toEqual(true);
});
it('should return null otherwise', () => {
const c = new FormControl('not empty', Validators.required);
const g = new FormGroup({'one': c});
expect(c.getError('invalid')).toEqual(null);
expect(g.getError('required', ['one'])).toEqual(null);
expect(g.getError('required', ['invalid'])).toEqual(null);
});
});
describe('asyncValidator', () => {
it('should run the async validator', fakeAsync(() => {
const c = new FormControl('value');
const g = new FormGroup({'one': c}, null, asyncValidator('expected'));
expect(g.pending).toEqual(true);
tick(1);
expect(g.errors).toEqual({'async': true});
expect(g.pending).toEqual(false);
}));
it('should set the parent group\'s status to pending', fakeAsync(() => {
const c = new FormControl('value', null, asyncValidator('expected'));
const g = new FormGroup({'one': c});
expect(g.pending).toEqual(true);
tick(1);
expect(g.pending).toEqual(false);
}));
it('should run the parent group\'s async validator when children are pending',
fakeAsync(() => {
const c = new FormControl('value', null, asyncValidator('expected'));
const g = new FormGroup({'one': c}, null, asyncValidator('expected'));
tick(1);
expect(g.errors).toEqual({'async': true});
expect(g.get('one').errors).toEqual({'async': true});
}));
});
describe('disable() & enable()', () => {
it('should mark the group as disabled', () => {
const g = new FormGroup({'one': new FormControl(null)});
expect(g.disabled).toBe(false);
expect(g.valid).toBe(true);
g.disable();
expect(g.disabled).toBe(true);
expect(g.valid).toBe(false);
g.enable();
expect(g.disabled).toBe(false);
expect(g.valid).toBe(true);
});
it('should set the group status as disabled', () => {
const g = new FormGroup({'one': new FormControl(null)});
expect(g.status).toEqual('VALID');
g.disable();
expect(g.status).toEqual('DISABLED');
g.enable();
expect(g.status).toBe('VALID');
});
it('should mark children of the group as disabled', () => {
const c1 = new FormControl(null);
const c2 = new FormControl(null);
const g = new FormGroup({'one': c1, 'two': c2});
expect(c1.disabled).toBe(false);
expect(c2.disabled).toBe(false);
g.disable();
expect(c1.disabled).toBe(true);
expect(c2.disabled).toBe(true);
g.enable();
expect(c1.disabled).toBe(false);
expect(c2.disabled).toBe(false);
});
it('should ignore disabled controls in validation', () => {
const g = new FormGroup({
nested: new FormGroup({one: new FormControl(null, Validators.required)}),
two: new FormControl('two')
});
expect(g.valid).toBe(false);
g.get('nested').disable();
expect(g.valid).toBe(true);
g.get('nested').enable();
expect(g.valid).toBe(false);
});
it('should ignore disabled controls when serializing value', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one')}), two: new FormControl('two')});
expect(g.value).toEqual({'nested': {'one': 'one'}, 'two': 'two'});
g.get('nested').disable();
expect(g.value).toEqual({'two': 'two'});
g.get('nested').enable();
expect(g.value).toEqual({'nested': {'one': 'one'}, 'two': 'two'});
});
it('should update its value when disabled with disabled children', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one'), two: new FormControl('two')})});
g.get('nested.two').disable();
expect(g.value).toEqual({nested: {one: 'one'}});
g.get('nested').disable();
expect(g.value).toEqual({nested: {one: 'one', two: 'two'}});
g.get('nested').enable();
expect(g.value).toEqual({nested: {one: 'one', two: 'two'}});
});
it('should update its value when enabled with disabled children', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one'), two: new FormControl('two')})});
g.get('nested.two').disable();
expect(g.value).toEqual({nested: {one: 'one'}});
g.get('nested').enable();
expect(g.value).toEqual({nested: {one: 'one', two: 'two'}});
});
it('should ignore disabled controls when determining dirtiness', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one')}), two: new FormControl('two')});
g.get('nested.one').markAsDirty();
expect(g.dirty).toBe(true);
g.get('nested').disable();
expect(g.get('nested').dirty).toBe(true);
expect(g.dirty).toEqual(false);
g.get('nested').enable();
expect(g.dirty).toEqual(true);
});
it('should ignore disabled controls when determining touched state', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one')}), two: new FormControl('two')});
g.get('nested.one').markAsTouched();
expect(g.touched).toBe(true);
g.get('nested').disable();
expect(g.get('nested').touched).toBe(true);
expect(g.touched).toEqual(false);
g.get('nested').enable();
expect(g.touched).toEqual(true);
});
it('should keep empty, disabled groups disabled when updating validity', () => {
const group = new FormGroup({});
expect(group.status).toEqual('VALID');
group.disable();
expect(group.status).toEqual('DISABLED');
group.<API key>();
expect(group.status).toEqual('DISABLED');
group.addControl('one', new FormControl({value: '', disabled: true}));
expect(group.status).toEqual('DISABLED');
group.addControl('two', new FormControl());
expect(group.status).toEqual('VALID');
});
it('should re-enable empty, disabled groups', () => {
const group = new FormGroup({});
group.disable();
expect(group.status).toEqual('DISABLED');
group.enable();
expect(group.status).toEqual('VALID');
});
it('should not run validators on disabled controls', () => {
const validator = jasmine.createSpy('validator');
const g = new FormGroup({'one': new FormControl()}, validator);
expect(validator.calls.count()).toEqual(1);
g.disable();
expect(validator.calls.count()).toEqual(1);
g.setValue({one: 'value'});
expect(validator.calls.count()).toEqual(1);
g.enable();
expect(validator.calls.count()).toEqual(2);
});
describe('disabled errors', () => {
it('should clear out group errors when disabled', () => {
const g = new FormGroup({'one': new FormControl()}, () => ({'expected': true}));
expect(g.errors).toEqual({'expected': true});
g.disable();
expect(g.errors).toEqual(null);
g.enable();
expect(g.errors).toEqual({'expected': true});
});
it('should re-populate group errors when enabled from a child', () => {
const g = new FormGroup({'one': new FormControl()}, () => ({'expected': true}));
g.disable();
expect(g.errors).toEqual(null);
g.addControl('two', new FormControl());
expect(g.errors).toEqual({'expected': true});
});
it('should clear out async group errors when disabled', fakeAsync(() => {
const g = new FormGroup({'one': new FormControl()}, null, asyncValidator('expected'));
tick();
expect(g.errors).toEqual({'async': true});
g.disable();
expect(g.errors).toEqual(null);
g.enable();
tick();
expect(g.errors).toEqual({'async': true});
}));
it('should re-populate async group errors when enabled from a child', fakeAsync(() => {
const g = new FormGroup({'one': new FormControl()}, null, asyncValidator('expected'));
tick();
expect(g.errors).toEqual({'async': true});
g.disable();
expect(g.errors).toEqual(null);
g.addControl('two', new FormControl());
tick();
expect(g.errors).toEqual({'async': true});
}));
});
describe('disabled events', () => {
let logger: string[];
let c: FormControl;
let g: FormGroup;
let form: FormGroup;
beforeEach(() => {
logger = [];
c = new FormControl('', Validators.required);
g = new FormGroup({one: c});
form = new FormGroup({g: g});
});
it('should emit value change events in the right order', () => {
c.valueChanges.subscribe(() => logger.push('control'));
g.valueChanges.subscribe(() => logger.push('group'));
form.valueChanges.subscribe(() => logger.push('form'));
g.disable();
expect(logger).toEqual(['control', 'group', 'form']);
});
it('should emit status change events in the right order', () => {
c.statusChanges.subscribe(() => logger.push('control'));
g.statusChanges.subscribe(() => logger.push('group'));
form.statusChanges.subscribe(() => logger.push('form'));
g.disable();
expect(logger).toEqual(['control', 'group', 'form']);
});
});
});
describe('updateTreeValidity()', () => {
let c: FormControl, c2: FormControl, c3: FormControl;
let nested: FormGroup, form: FormGroup;
let logger: string[];
beforeEach(() => {
c = new FormControl('one');
c2 = new FormControl('two');
c3 = new FormControl('three');
nested = new FormGroup({one: c, two: c2});
form = new FormGroup({nested: nested, three: c3});
logger = [];
c.statusChanges.subscribe(() => logger.push('one'));
c2.statusChanges.subscribe(() => logger.push('two'));
c3.statusChanges.subscribe(() => logger.push('three'));
nested.statusChanges.subscribe(() => logger.push('nested'));
form.statusChanges.subscribe(() => logger.push('form'));
});
it('should update tree validity', () => {
form._updateTreeValidity();
expect(logger).toEqual(['one', 'two', 'nested', 'three', 'form']);
});
it('should not emit events when turned off', () => {
form._updateTreeValidity({emitEvent: false});
expect(logger).toEqual([]);
});
});
describe('setControl()', () => {
let c: FormControl;
let g: FormGroup;
beforeEach(() => {
c = new FormControl('one');
g = new FormGroup({one: c});
});
it('should replace existing control with new control', () => {
const c2 = new FormControl('new!', Validators.minLength(10));
g.setControl('one', c2);
expect(g.controls['one']).toEqual(c2);
expect(g.value).toEqual({one: 'new!'});
expect(g.valid).toBe(false);
});
it('should add control if control did not exist before', () => {
const c2 = new FormControl('new!', Validators.minLength(10));
g.setControl('two', c2);
expect(g.controls['two']).toEqual(c2);
expect(g.value).toEqual({one: 'one', two: 'new!'});
expect(g.valid).toBe(false);
});
it('should remove control if new control is null', () => {
g.setControl('one', null);
expect(g.controls['one']).not.toBeDefined();
expect(g.value).toEqual({});
});
it('should only emit value change event once', () => {
const logger: string[] = [];
const c2 = new FormControl('new!');
g.valueChanges.subscribe(() => logger.push('change!'));
g.setControl('one', c2);
expect(logger).toEqual(['change!']);
});
});
});
}
|
// Project: SproutCore Metal
require('sproutcore-metal');
function isEnumerable(obj, keyName) {
var keys = [];
for(var key in obj) {
if (obj.hasOwnProperty(key)) keys.push(key);
}
return keys.indexOf(keyName)>=0;
}
module("SC.platform.defineProperty()");
test("defining a simple property", function() {
var obj = {};
SC.platform.defineProperty(obj, 'foo', {
enumerable: true,
writable: true,
value: 'FOO'
});
equals(obj.foo, 'FOO', 'should have added property');
obj.foo = "BAR";
equals(obj.foo, 'BAR', 'writable defined property should be writable');
equals(isEnumerable(obj, 'foo'), true, 'foo should be enumerable');
});
test('defining a read only property', function() {
var obj = {};
SC.platform.defineProperty(obj, 'foo', {
enumerable: true,
writable: false,
value: 'FOO'
});
equals(obj.foo, 'FOO', 'should have added property');
obj.foo = "BAR";
if (SC.platform.defineProperty.isSimulated) {
equals(obj.foo, 'BAR', 'simulated defineProperty should silently work');
} else {
equals(obj.foo, 'FOO', 'real defined property should not be writable');
}
});
test('defining a non enumerable property', function() {
var obj = {};
SC.platform.defineProperty(obj, 'foo', {
enumerable: false,
writable: true,
value: 'FOO'
});
if (SC.platform.defineProperty.isSimulated) {
equals(isEnumerable(obj, 'foo'), true, 'simulated defineProperty will leave properties enumerable');
} else {
equals(isEnumerable(obj, 'foo'), false, 'real defineProperty will make property not-enumerable');
}
});
test('defining a getter/setter', function() {
var obj = {}, getCnt = 0, setCnt = 0, v = 'FOO';
var desc = {
enumerable: true,
get: function() { getCnt++; return v; },
set: function(val) { setCnt++; v = val; }
};
if (SC.platform.<API key>) {
SC.platform.defineProperty(obj, 'foo', desc);
equals(obj.foo, 'FOO', 'should return getter');
equals(getCnt, 1, 'should have invoked getter');
obj.foo = 'BAR';
equals(obj.foo, 'BAR', 'setter should have worked');
equals(setCnt, 1, 'should have invoked setter');
} else {
raises(function() {
SC.platform.defineProperty(obj, 'foo', desc);
}, Error, 'should throw exception if getters/setters not supported');
}
});
test('defining getter/setter along with writable', function() {
var obj ={};
raises(function() {
SC.platform.defineProperty(obj, 'foo', {
enumerable: true,
get: function() {},
set: function() {},
writable: true
});
}, Error, 'defining writable and get/set should throw exception');
});
test('defining getter/setter along with value', function() {
var obj ={};
raises(function() {
SC.platform.defineProperty(obj, 'foo', {
enumerable: true,
get: function() {},
set: function() {},
value: 'FOO'
});
}, Error, 'defining value and get/set should throw exception');
});
|
require 'rubygems'
require 'active_support'
require 'active_merchant'
class GatewaySupport #:nodoc:
ACTIONS = [:purchase, :authorize, :capture, :void, :credit, :recurring]
include ActiveMerchant::Billing
attr_reader :gateways
def initialize
|
using System;
using System.Collections.Generic;
namespace Piranha.Extend
{
<summary>
Base class for easily defining a page type.
</summary>
public abstract class PageType : IPageType
{
<summary>
Gets the name.
</summary>
public virtual string Name { get; protected set; }
<summary>
Gets the optional description.
</summary>
public virtual string Description { get; protected set; }
<summary>
Gets the html preview.
</summary>
public virtual string Preview { get; protected set; }
<summary>
Gets the controller/viewtemplate depending on the current
application is using WebPages or Mvc.
</summary>
public virtual string Controller { get; protected set; }
<summary>
Gets if pages of the current type should be able to
override the controller.
</summary>
public virtual bool ShowController { get; protected set; }
<summary>
Gets the view. This is only relevant for Mvc applications.
</summary>
public virtual string View { get; protected set; }
<summary>
Gets if pages of the current type should be able to
override the controller.
</summary>
public virtual bool ShowView { get; protected set; }
<summary>
Gets/sets the optional permalink of a page this sould redirect to.
</summary>
public virtual string Redirect { get; protected set; }
<summary>
Gets/sets if the redirect can be overriden by the implementing page.
</summary>
public virtual bool ShowRedirect { get; protected set; }
<summary>
Gets the defíned properties.
</summary>
public virtual IList<string> Properties { get; protected set; }
<summary>
Gets the defined regions.
</summary>
public virtual IList<RegionType> Regions { get; protected set; }
public PageType() {
Properties = new List<string>();
Regions = new List<RegionType>();
Preview = "<table class=\"template\"><tr><td></td></tr></table>";
}
}
}
|
namespace AM.Condo.Tasks
{
using System.IO;
using Microsoft.Build.Utilities;
using Newtonsoft.Json;
using Xunit;
using AM.Condo.IO;
[Class(nameof(GetNodeMetadata))]
public class GetNodeScriptsTest
{
[Fact]
[Priority(2)]
[Purpose(PurposeType.Integration)]
public void <API key>()
{
using (var temp = new TemporaryPath())
{
// arrange
var project = new
{
name = "test",
version = "1.0.0",
description = "",
main = "index.js",
scripts = new
{
test = "echo this is a test script",
ci = "echo this is a ci script"
},
author = "<API key>",
license = "MIT"
};
var expected = new[] { "test", "ci" };
var path = temp.Combine("package.json");
using (var writer = File.CreateText(path))
{
var serializer = new JsonSerializer();
serializer.Serialize(writer, project);
writer.Flush();
}
var items = new[] { new TaskItem(path) };
var engine = MSBuildMocks.CreateEngine();
var instance = new GetNodeMetadata
{
Projects = items,
BuildEngine = engine
};
// act
var result = instance.Execute();
// assert
Assert.True(result);
}
}
}
}
|
<?php
/* SonataAdminBundle:CRUD:<API key>.html.twig */
class <API key> extends Twig_Template
{
public function __construct(Twig_Environment $env)
{
parent::__construct($env);
$this->parent = false;
$this->blocks = array(
'row' => array($this, 'block_row'),
);
}
protected function doDisplay(array $context, array $blocks = array())
{
// line 11
echo "
";
// line 12
if (($this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "list", array()), "has", array(0 => "batch"), "method") && !$this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : null), "request", array()), "isXmlHttpRequest", array()))) {
// line 13
echo " <td class=\"<API key> <API key>\">
";
// line 14
echo $this->env->getExtension('sonata_admin')->renderListElement((isset($context["object"]) ? $context["object"] : null), $this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "list", array()), "batch", array(), "array"));
echo "
</td>
";
}
// line 17
echo "
<td class=\"<API key> <API key>\" colspan=\"";
// line 18
echo twig_escape_filter($this->env, (twig_length_filter($this->env, $this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "list", array()), "elements", array())) - ($this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "list", array()), "has", array(0 => "_action"), "method") + $this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "list", array()), "has", array(0 => "batch"), "method"))), "html", null, true);
echo "\" objectId=\"";
echo twig_escape_filter($this->env, $this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "id", array(0 => (isset($context["object"]) ? $context["object"] : null)), "method"), "html", null, true);
echo "\">
";
// line 19
$this->displayBlock('row', $context, $blocks);
// line 20
echo "</td>
";
// line 22
if (($this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "list", array()), "has", array(0 => "_action"), "method") && !$this->getAttribute($this->getAttribute((isset($context["app"]) ? $context["app"] : null), "request", array()), "isXmlHttpRequest", array()))) {
// line 23
echo " <td class=\"<API key> <API key>\" objectId=\"";
echo twig_escape_filter($this->env, $this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "id", array(0 => (isset($context["object"]) ? $context["object"] : null)), "method"), "html", null, true);
echo "\">
";
// line 24
echo $this->env->getExtension('sonata_admin')->renderListElement((isset($context["object"]) ? $context["object"] : null), $this->getAttribute($this->getAttribute((isset($context["admin"]) ? $context["admin"] : null), "list", array()), "_action", array(), "array"));
echo "
</td>
";
}
}
// line 19
public function block_row($context, array $blocks = array())
{
}
public function getTemplateName()
{
return "SonataAdminBundle:CRUD:<API key>.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 64 => 19, 56 => 24, 51 => 23, 49 => 22, 45 => 20, 43 => 19, 37 => 18, 34 => 17, 28 => 14, 25 => 13, 23 => 12, 20 => 11,);
}
}
|
var Promise = require('ember-cli/lib/ext/promise');
module.exports = {
normalizeEntityName: function() {},
afterInstall: function() {
var addonContext = this;
return this.<API key>('jquery-ui', '1.10.1')
.then(function() {
return addonContext.<API key>('jquery-mousewheel', '~3.1.4');
})
.then(function() {
return addonContext.<API key>('taras/antiscroll', '<SHA1-like>');
});
}
};
|
import time
import random
from random import randint
# from library import Trigger, Axis
# from library import PS4
from library import Joystick
import RPi.GPIO as GPIO # remove!!!
from emotions import angry, happy, confused
# from pysabertooth import Sabertooth
# from smc import SMC
from library import LEDDisplay
from library import factory
from library import reset_all_hw
# Leg Motor Speed Global
global_LegMotor = 70
# # Happy Emotion
# def happy(leds, servos, mc, audio):
# print("4")
# print("Happy")
# # Dome Motor Initialization
# # mc = SMC(dome_motor_port, 115200)
# # mc.init()
# # Spins Motor
# # mc.init()
# mc.speed(3200)
# # LED Matrix Green
# # breadboard has mono
# # R2 has bi-color leds
# # mono:0 bi:1
# # led_type = 0
# # leds = [0]*5
# # leds[1] = LEDDisplay(0x70, led_type)
# # leds[2] = LEDDisplay(0x71, led_type)
# # leds[3] = LEDDisplay(0x72, led_type)
# # leds[4] = LEDDisplay(0x73, led_type)
# for x in [0, 1, 2, 3, 4, 5, 6, 7]:
# for y in [0, 1, 2, 3, 4, 5, 6, 7]:
# for i in range(1, 5):
# leds[i].set(x, y, 1)
# for i in range(1, 5):
# leds[i].write()
# # Servo Wave
# # s0.angle = 0
# # time.sleep(0.2)
# # s1.angle = 0
# # time.sleep(0.2)
# # s2.angle = 0
# # time.sleep(0.2)
# # s3.angle = 0
# # time.sleep(0.2)
# # s4.angle = 0
# # time.sleep(0.5)
# # s4.angle = 130
# # time.sleep(0.2)
# # s3.angle = 130
# # time.sleep(0.2)
# # s2.angle = 130
# # time.sleep(0.2)
# # s1.angle = 130
# # time.sleep(0.2)
# # s0.angle = 130
# for a in [0, 130]:
# for i in range(4):
# servos[i].angle = a
# time.sleep(0.2)
# time.sleep(0.5)
# time.sleep(1.5)
# mc.stop()
# time.sleep(1.5)
# for i in range(1, 5):
# leds[i].clear()
# # Confused Emotion
# def confused(leds, servos, mc, audio):
# print("5")
# print("Confused")
# # LED Matrix Yellow
# # leds = [0]*5
# # leds[1] = LEDDisplay(0x70, 1)
# # leds[2] = LEDDisplay(0x71, 1)
# # leds[3] = LEDDisplay(0x72, 1)
# # leds[4] = LEDDisplay(0x73, 1)
# for x in [0, 1, 2, 3, 4, 5, 6, 7]:
# for y in [0, 1, 2, 3, 4, 5, 6, 7]:
# for i in range(1, 5):
# leds[i].set(x, y, 3)
# for i in range(1, 5):
# leds[i].write()
# time.sleep(3)
# for i in range(1, 5):
# leds[i].clear()
# # Angry Emotion
# def angry(leds, servos, mc, audio):
# print("6")
# print("Angry")
# # LED Matrix Red
# # leds = [0]*5
# # leds[1] = LEDDisplay(0x70, 1)
# # leds[2] = LEDDisplay(0x71, 1)
# # leds[3] = LEDDisplay(0x72, 1)
# # leds[4] = LEDDisplay(0x73, 1)
# for x in [0, 1, 2, 3, 4, 5, 6, 7]:
# for y in [0, 1, 2, 3, 4, 5, 6, 7]:
# for i in range(1, 5):
# leds[i].set(x, y, 2)
# for i in range(1, 5):
# leds[i].write()
# # Plays Imperial Theme Sound
# audio.sound('imperial')
# # Servo Open and Close
# # s0.angle = 0
# # s1.angle = 0
# # s2.angle = 0
# # s3.angle = 0
# # s4.angle = 0
# # time.sleep(1)
# # s4.angle = 130
# # s3.angle = 130
# # s2.angle = 130
# # s1.angle = 130
# # s0.angle = 130
# for a in [0, 130]:
# for i in range(5):
# servos[i].angle = a
# time.sleep(1)
# time.sleep(3)
# for i in range(1, 5):
# leds[i].clear()
# original remote
# # Remote Mode
# def remote(remoteflag, namespace):
# print("Remote")
# # create objects
# (leds, dome, legs, servos, Flash) = factory(['leds', 'dome', 'legs', 'servos', 'flashlight'])
# # initalize everything
# dome.init()
# dome.speed(0)
# legs.drive(1, 0)
# legs.drive(2, 0)
# for s in servos:
# s.angle = 0
# time.sleep(0.25)
# # what is this???
# GPIO.setmode(GPIO.BCM)
# GPIO.setwarnings(False)
# GPIO.setup(26, GPIO.OUT)
# # Joystick Initialization
# js = Joystick()
# # get audio
# audio = namespace.audio
# # Flash = FlashlightPWM(15)
# # Flash = namespace.flashlight
# while(remoteflag.is_set()):
# try:
# # Button Initialization
# ps4 = js.get()
# btnSquare = ps4.buttons[0]
# btnTriangle = ps4.buttons[1]
# btnCircle = ps4.buttons[2]
# btnX = ps4.buttons[3]
# <API key> = ps4.leftStick.y
# btnLeftStickUpDown = ps4.leftStick.x
# <API key> = ps4.rightStick.y
# btnRightStickUpDown = ps4.rightStick.x
# Left1 = ps4.shoulder[0]
# Right1 = ps4.shoulder[1]
# Left2 = ps4.triggers.x
# Right2 = ps4.triggers.y
# hat = ps4.hat
# # print("PRINT")
# # Button Controls
# if hat == 1:
# # Happy Emotion
# print("Arrow Up Pressed")
# happy(leds, servos, dome, audio) # namespace.emotions['happy'](leds, servos, mc, audio)
# if hat == 8:
# # Confused Emotion
# print("Arrow Left Pressed")
# confused(leds, servos, dome, audio)
# if hat == 2:
# # Angry Emotion
# print("Arrow Right Pressed")
# angry(leds, servos, dome, audio)
# if hat == 4:
# print("Arrow Down Pressed")
# if btnSquare == 1:
# # word = random_char(2)
# audio.speak_random(2)
# time.sleep(0.5)
# if btnTriangle == 1:
# # FlashLight ON
# GPIO.output(26, GPIO.HIGH)
# Flash.pwm.set_pwm(15, 0, 130)
# if btnCircle == 1:
# # FlashLight OFF
# GPIO.output(26, GPIO.LOW)
# Flash.pwm.set_pwm(15, 0, 0)
# if btnX == 1:
# for x in [0, 1, 2, 3, 4, 5, 6, 7]:
# for y in [0, 1, 2, 3, 4, 5, 6, 7]:
# if x == randint(0, 8) or y == randint(0, 8):
# for i in range(1, 5):
# leds[i].set(x, y, randint(0, 4))
# else:
# for i in range(1, 5):
# leds[i].set(x, y, 4)
# for i in range(1, 5):
# leds[i].write()
# time.sleep(0.1)
# for i in range(1, 5):
# leds[i].clear()
# if Left1 == 1:
# # Dome Motor Forward
# dome.speed(3200)
# time.sleep(2)
# dome.speed(0)
# if Right1 == 1:
# # Dome Motor Backward
# dome.speed(-3200)
# time.sleep(2)
# dome.speed(0)
# # if Left1 == 0 or Right1 == 0:
# # # Dome Motor Stop
# # dome.speed(0)
# # if Left2 > 1:
# # # Servo Open
# # s0.angle = 0
# # s1.angle = 0
# # s2.angle = 0
# # s3.angle = 0
# # s4.angle = 0
# # Flash.pwm.set_pwm(15, 0, 3000)
# # if Right2 > 1:
# # # Servo Close
# # s0.angle = 130
# # s1.angle = 130
# # s2.angle = 130
# # s3.angle = 130
# # s4.angle = 130
# # Flash.pwm.set_pwm(15, 0, 130)
# if Left2 > 1:
# for s in servos:
# s.angle = 0
# time.sleep(0.25)
# Flash.pwm.set_pwm(15, 0, 300)
# if Right2 > 1:
# for s in servos:
# s.angle = 130
# time.sleep(0.25)
# Flash.pwm.set_pwm(15, 0, 130)
# if <API key> < 0.3 and <API key> > -0.3:
# legs.drive(1, 0)
# if btnRightStickUpDown < 0.3 and btnRightStickUpDown > -0.3:
# legs.drive(2, 0)
# if btnRightStickUpDown >= 0.3:
# # Right and Left Motor Forward
# legs.drive(1, btnRightStickUpDown*global_LegMotor)
# legs.drive(2, btnRightStickUpDown*-global_LegMotor)
# if btnRightStickUpDown <= -0.3:
# # Right and Left Motor Backward
# legs.drive(1, btnRightStickUpDown*global_LegMotor)
# legs.drive(2, btnRightStickUpDown*-global_LegMotor)
# if <API key> <= 0.3:
# # Turn Left
# legs.drive(1, <API key>*(-global_LegMotor))
# legs.drive(2, <API key>*-global_LegMotor)
# if <API key> >= -0.3:
# # Turn Right
# legs.drive(1, <API key>*(-global_LegMotor))
# legs.drive(2, <API key>*-global_LegMotor)
# except KeyboardInterrupt:
# print('js exiting ...')
# return
# return
def remote_func(hw, ns):
print("Remote")
dome = hw['dome']
dome.speed(0)
legs = hw['legs']
legs.drive(1, 0)
legs.drive(2, 0)
flashlight = hw['flashlight']
audio = hw['audio']
audio.speak('start')
while ns.current_state == 3:
print('remote ...')
spd = random.randint(0, 40)
legs.drive(1, spd)
legs.drive(2, spd)
dome.speed(spd)
time.sleep(0.5)
legs.drive(1, 0)
legs.drive(2, 0)
dome.speed(0)
time.sleep(0.1)
return
# Joystick Initialization
js = Joystick()
while ns.current_state == 3:
try:
# Button Initialization
ps4 = js.get()
btnSquare = ps4.buttons[0]
btnTriangle = ps4.buttons[1]
btnCircle = ps4.buttons[2]
btnX = ps4.buttons[3]
<API key> = ps4.leftStick.y
btnLeftStickUpDown = ps4.leftStick.x
<API key> = ps4.rightStick.y
btnRightStickUpDown = ps4.rightStick.x
Left1 = ps4.shoulder[0]
Right1 = ps4.shoulder[1]
Left2 = ps4.triggers.x
Right2 = ps4.triggers.y
hat = ps4.hat
# print("PRINT")
# Button Controls
if hat == 1:
# Happy Emotion
print("Arrow Up Pressed")
happy(leds, servos, dome, audio) # namespace.emotions['happy'](leds, servos, mc, audio)
if hat == 8:
# Confused Emotion
print("Arrow Left Pressed")
confused(leds, servos, dome, audio)
if hat == 2:
# Angry Emotion
print("Arrow Right Pressed")
angry(leds, servos, dome, audio)
if hat == 4:
print("Arrow Down Pressed")
if btnSquare == 1:
# word = random_char(2)
audio.speak_random(2)
time.sleep(0.5)
if btnTriangle == 1:
# FlashLight ON
GPIO.output(26, GPIO.HIGH)
Flash.pwm.set_pwm(15, 0, 130)
if btnCircle == 1:
# FlashLight OFF
GPIO.output(26, GPIO.LOW)
Flash.pwm.set_pwm(15, 0, 0)
if btnX == 1:
for x in [0, 1, 2, 3, 4, 5, 6, 7]:
for y in [0, 1, 2, 3, 4, 5, 6, 7]:
if x == randint(0, 8) or y == randint(0, 8):
for i in range(1, 5):
leds[i].set(x, y, randint(0, 4))
else:
for i in range(1, 5):
leds[i].set(x, y, 4)
for i in range(1, 5):
leds[i].write()
time.sleep(0.1)
for i in range(1, 5):
leds[i].clear()
if Left1 == 1:
# Dome Motor Forward
dome.speed(3200)
time.sleep(2)
dome.speed(0)
if Right1 == 1:
# Dome Motor Backward
dome.speed(-3200)
time.sleep(2)
dome.speed(0)
# if Left1 == 0 or Right1 == 0:
# # Dome Motor Stop
# dome.speed(0)
# if Left2 > 1:
# # Servo Open
# s0.angle = 0
# s1.angle = 0
# s2.angle = 0
# s3.angle = 0
# s4.angle = 0
# Flash.pwm.set_pwm(15, 0, 3000)
# if Right2 > 1:
# # Servo Close
# s0.angle = 130
# s1.angle = 130
# s2.angle = 130
# s3.angle = 130
# s4.angle = 130
# Flash.pwm.set_pwm(15, 0, 130)
if Left2 > 1:
for s in servos:
s.angle = 0
time.sleep(0.25)
Flash.pwm.set_pwm(15, 0, 300)
if Right2 > 1:
for s in servos:
s.angle = 130
time.sleep(0.25)
Flash.pwm.set_pwm(15, 0, 130)
if <API key> < 0.3 and <API key> > -0.3:
legs.drive(1, 0)
if btnRightStickUpDown < 0.3 and btnRightStickUpDown > -0.3:
legs.drive(2, 0)
if btnRightStickUpDown >= 0.3:
# Right and Left Motor Forward
legs.drive(1, btnRightStickUpDown*global_LegMotor)
legs.drive(2, btnRightStickUpDown*-global_LegMotor)
if btnRightStickUpDown <= -0.3:
# Right and Left Motor Backward
legs.drive(1, btnRightStickUpDown*global_LegMotor)
legs.drive(2, btnRightStickUpDown*-global_LegMotor)
if <API key> <= 0.3:
# Turn Left
legs.drive(1, <API key>*(-global_LegMotor))
legs.drive(2, <API key>*-global_LegMotor)
if <API key> >= -0.3:
# Turn Right
legs.drive(1, <API key>*(-global_LegMotor))
legs.drive(2, <API key>*-global_LegMotor)
except KeyboardInterrupt:
print('js exiting ...')
return
# exiting, reset all hw
reset_all_hw(hw)
return
|
# This code was generated by
# | (_)\/(_)(_|\/| |(/_ v1.0.0
# <API key>: true
module Twilio
module REST
class Api < Domain
class V2010 < Version
class AccountContext < InstanceContext
class ApplicationList < ListResource
# Initialize the ApplicationList
# @param [Version] version Version that contains the resource
# @param [String] account_sid The SID of the
# Application resource.
# @return [ApplicationList] ApplicationList
def initialize(version, account_sid: nil)
super(version)
# Path Solution
@solution = {account_sid: account_sid}
@uri = "/Accounts/#{@solution[:account_sid]}/Applications.json"
end
# Create the ApplicationInstance
# @param [String] api_version The API version to use to start a new TwiML session.
# Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default
# API version.
# @param [String] voice_url The URL we should call when the phone number assigned
# to this application receives a call.
# @param [String] voice_method The HTTP method we should use to call `voice_url`.
# Can be: `GET` or `POST`.
# @param [String] voice_fallback_url The URL that we should call when an error
# occurs retrieving or executing the TwiML requested by `url`.
# @param [String] <API key> The HTTP method we should use to call
# `voice_fallback_url`. Can be: `GET` or `POST`.
# @param [String] status_callback The URL we should call using the
# `<API key>` to send status information to your application.
# @param [String] <API key> The HTTP method we should use to call
# `status_callback`. Can be: `GET` or `POST`.
# @param [Boolean] <API key> Whether we should look up the caller's
# caller-ID name from the CNAM database (additional charges apply). Can be: `true`
# or `false`.
# @param [String] sms_url The URL we should call when the phone number receives an
# incoming SMS message.
# @param [String] sms_method The HTTP method we should use to call `sms_url`. Can
# be: `GET` or `POST`.
# @param [String] sms_fallback_url The URL that we should call when an error
# occurs while retrieving or executing the TwiML from `sms_url`.
# @param [String] sms_fallback_method The HTTP method we should use to call
# `sms_fallback_url`. Can be: `GET` or `POST`.
# @param [String] sms_status_callback The URL we should call using a POST method
# to send status information about SMS messages sent by the application.
# @param [String] <API key> The URL we should call using a POST
# method to send message status information to your application.
# @param [String] friendly_name A descriptive string that you create to describe
# the new application. It can be up to 64 characters long.
# @return [ApplicationInstance] Created ApplicationInstance
def create(api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, <API key>: :unset, status_callback: :unset, <API key>: :unset, <API key>: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, <API key>: :unset, friendly_name: :unset)
data = Twilio::Values.of({
'ApiVersion' => api_version,
'VoiceUrl' => voice_url,
'VoiceMethod' => voice_method,
'VoiceFallbackUrl' => voice_fallback_url,
'VoiceFallbackMethod' => <API key>,
'StatusCallback' => status_callback,
'<API key>' => <API key>,
'VoiceCallerIdLookup' => <API key>,
'SmsUrl' => sms_url,
'SmsMethod' => sms_method,
'SmsFallbackUrl' => sms_fallback_url,
'SmsFallbackMethod' => sms_fallback_method,
'SmsStatusCallback' => sms_status_callback,
'<API key>' => <API key>,
'FriendlyName' => friendly_name,
})
payload = @version.create('POST', @uri, data: data)
ApplicationInstance.new(@version, payload, account_sid: @solution[:account_sid], )
end
# Lists ApplicationInstance records from the API as a list.
# Unlike stream(), this operation is eager and will load `limit` records into
# memory before returning.
# @param [String] friendly_name The string that identifies the Application
# resources to read.
# @param [Integer] limit Upper limit for the number of records to return. stream()
# guarantees to never return more than limit. Default is no limit
# @param [Integer] page_size Number of records to fetch per request, when
# not set will use the default value of 50 records. If no page_size is defined
# but a limit is defined, stream() will attempt to read the limit with the most
# efficient page size, i.e. min(limit, 1000)
# @return [Array] Array of up to limit results
def list(friendly_name: :unset, limit: nil, page_size: nil)
self.stream(friendly_name: friendly_name, limit: limit, page_size: page_size).entries
end
# Streams ApplicationInstance records from the API as an Enumerable.
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
# @param [String] friendly_name The string that identifies the Application
# resources to read.
# @param [Integer] limit Upper limit for the number of records to return. stream()
# guarantees to never return more than limit. Default is no limit.
# @param [Integer] page_size Number of records to fetch per request, when
# not set will use the default value of 50 records. If no page_size is defined
# but a limit is defined, stream() will attempt to read the limit with the most
# efficient page size, i.e. min(limit, 1000)
# @return [Enumerable] Enumerable that will yield up to limit results
def stream(friendly_name: :unset, limit: nil, page_size: nil)
limits = @version.read_limits(limit, page_size)
page = self.page(friendly_name: friendly_name, page_size: limits[:page_size], )
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
end
# When passed a block, yields ApplicationInstance records from the API.
# This operation lazily loads records as efficiently as possible until the limit
# is reached.
def each
limits = @version.read_limits
page = self.page(page_size: limits[:page_size], )
@version.stream(page,
limit: limits[:limit],
page_limit: limits[:page_limit]).each {|x| yield x}
end
# Retrieve a single page of ApplicationInstance records from the API.
# Request is executed immediately.
# @param [String] friendly_name The string that identifies the Application
# resources to read.
# @param [String] page_token PageToken provided by the API
# @param [Integer] page_number Page Number, this value is simply for client state
# @param [Integer] page_size Number of records to return, defaults to 50
# @return [Page] Page of ApplicationInstance
def page(friendly_name: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
params = Twilio::Values.of({
'FriendlyName' => friendly_name,
'PageToken' => page_token,
'Page' => page_number,
'PageSize' => page_size,
})
response = @version.page('GET', @uri, params: params)
ApplicationPage.new(@version, response, @solution)
end
# Retrieve a single page of ApplicationInstance records from the API.
# Request is executed immediately.
# @param [String] target_url API-generated URL for the requested results page
# @return [Page] Page of ApplicationInstance
def get_page(target_url)
response = @version.domain.request(
'GET',
target_url
)
ApplicationPage.new(@version, response, @solution)
end
# Provide a user friendly representation
def to_s
'#<Twilio.Api.V2010.ApplicationList>'
end
end
class ApplicationPage < Page
# Initialize the ApplicationPage
# @param [Version] version Version that contains the resource
# @param [Response] response Response from the API
# @param [Hash] solution Path solution for the resource
# @return [ApplicationPage] ApplicationPage
def initialize(version, response, solution)
super(version, response)
# Path Solution
@solution = solution
end
# Build an instance of ApplicationInstance
# @param [Hash] payload Payload response from the API
# @return [ApplicationInstance] ApplicationInstance
def get_instance(payload)
ApplicationInstance.new(@version, payload, account_sid: @solution[:account_sid], )
end
# Provide a user friendly representation
def to_s
'<Twilio.Api.V2010.ApplicationPage>'
end
end
class ApplicationContext < InstanceContext
# Initialize the ApplicationContext
# @param [Version] version Version that contains the resource
# @param [String] account_sid The SID of the
# Application resource to fetch.
# @param [String] sid The Twilio-provided string that uniquely identifies the
# Application resource to fetch.
# @return [ApplicationContext] ApplicationContext
def initialize(version, account_sid, sid)
super(version)
# Path Solution
@solution = {account_sid: account_sid, sid: sid, }
@uri = "/Accounts/#{@solution[:account_sid]}/Applications/#{@solution[:sid]}.json"
end
# Delete the ApplicationInstance
# @return [Boolean] true if delete succeeds, false otherwise
def delete
@version.delete('DELETE', @uri)
end
# Fetch the ApplicationInstance
# @return [ApplicationInstance] Fetched ApplicationInstance
def fetch
payload = @version.fetch('GET', @uri)
ApplicationInstance.new(
@version,
payload,
account_sid: @solution[:account_sid],
sid: @solution[:sid],
)
end
# Update the ApplicationInstance
# @param [String] friendly_name A descriptive string that you create to describe
# the resource. It can be up to 64 characters long.
# @param [String] api_version The API version to use to start a new TwiML session.
# Can be: `2010-04-01` or `2008-08-01`. The default value is your account's
# default API version.
# @param [String] voice_url The URL we should call when the phone number assigned
# to this application receives a call.
# @param [String] voice_method The HTTP method we should use to call `voice_url`.
# Can be: `GET` or `POST`.
# @param [String] voice_fallback_url The URL that we should call when an error
# occurs retrieving or executing the TwiML requested by `url`.
# @param [String] <API key> The HTTP method we should use to call
# `voice_fallback_url`. Can be: `GET` or `POST`.
# @param [String] status_callback The URL we should call using the
# `<API key>` to send status information to your application.
# @param [String] <API key> The HTTP method we should use to call
# `status_callback`. Can be: `GET` or `POST`.
# @param [Boolean] <API key> Whether we should look up the caller's
# caller-ID name from the CNAM database (additional charges apply). Can be: `true`
# or `false`.
# @param [String] sms_url The URL we should call when the phone number receives an
# incoming SMS message.
# @param [String] sms_method The HTTP method we should use to call `sms_url`. Can
# be: `GET` or `POST`.
# @param [String] sms_fallback_url The URL that we should call when an error
# occurs while retrieving or executing the TwiML from `sms_url`.
# @param [String] sms_fallback_method The HTTP method we should use to call
# `sms_fallback_url`. Can be: `GET` or `POST`.
# @param [String] sms_status_callback Same as <API key>: The URL we
# should call using a POST method to send status information about SMS messages
# sent by the application. Deprecated, included for backwards compatibility.
# @param [String] <API key> The URL we should call using a POST
# method to send message status information to your application.
# @return [ApplicationInstance] Updated ApplicationInstance
def update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, <API key>: :unset, status_callback: :unset, <API key>: :unset, <API key>: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, <API key>: :unset)
data = Twilio::Values.of({
'FriendlyName' => friendly_name,
'ApiVersion' => api_version,
'VoiceUrl' => voice_url,
'VoiceMethod' => voice_method,
'VoiceFallbackUrl' => voice_fallback_url,
'VoiceFallbackMethod' => <API key>,
'StatusCallback' => status_callback,
'<API key>' => <API key>,
'VoiceCallerIdLookup' => <API key>,
'SmsUrl' => sms_url,
'SmsMethod' => sms_method,
'SmsFallbackUrl' => sms_fallback_url,
'SmsFallbackMethod' => sms_fallback_method,
'SmsStatusCallback' => sms_status_callback,
'<API key>' => <API key>,
})
payload = @version.update('POST', @uri, data: data)
ApplicationInstance.new(
@version,
payload,
account_sid: @solution[:account_sid],
sid: @solution[:sid],
)
end
# Provide a user friendly representation
def to_s
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
"#<Twilio.Api.V2010.ApplicationContext #{context}>"
end
# Provide a detailed, user friendly representation
def inspect
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
"#<Twilio.Api.V2010.ApplicationContext #{context}>"
end
end
class ApplicationInstance < InstanceResource
# Initialize the ApplicationInstance
# @param [Version] version Version that contains the resource
# @param [Hash] payload payload that contains response from Twilio
# @param [String] account_sid The SID of the
# Application resource.
# @param [String] sid The Twilio-provided string that uniquely identifies the
# Application resource to fetch.
# @return [ApplicationInstance] ApplicationInstance
def initialize(version, payload, account_sid: nil, sid: nil)
super(version)
# Marshaled Properties
@properties = {
'account_sid' => payload['account_sid'],
'api_version' => payload['api_version'],
'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
'friendly_name' => payload['friendly_name'],
'<API key>' => payload['<API key>'],
'sid' => payload['sid'],
'sms_fallback_method' => payload['sms_fallback_method'],
'sms_fallback_url' => payload['sms_fallback_url'],
'sms_method' => payload['sms_method'],
'sms_status_callback' => payload['sms_status_callback'],
'sms_url' => payload['sms_url'],
'status_callback' => payload['status_callback'],
'<API key>' => payload['<API key>'],
'uri' => payload['uri'],
'<API key>' => payload['<API key>'],
'<API key>' => payload['<API key>'],
'voice_fallback_url' => payload['voice_fallback_url'],
'voice_method' => payload['voice_method'],
'voice_url' => payload['voice_url'],
}
# Context
@instance_context = nil
@params = {'account_sid' => account_sid, 'sid' => sid || @properties['sid'], }
end
# Generate an instance context for the instance, the context is capable of
# performing various actions. All instance actions are proxied to the context
# @return [ApplicationContext] ApplicationContext for this ApplicationInstance
def context
unless @instance_context
@instance_context = ApplicationContext.new(@version, @params['account_sid'], @params['sid'], )
end
@instance_context
end
# @return [String] The SID of the Account that created the resource
def account_sid
@properties['account_sid']
end
# @return [String] The API version used to start a new TwiML session
def api_version
@properties['api_version']
end
# @return [Time] The RFC 2822 date and time in GMT that the resource was created
def date_created
@properties['date_created']
end
# @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
def date_updated
@properties['date_updated']
end
# @return [String] The string that you assigned to describe the resource
def friendly_name
@properties['friendly_name']
end
# @return [String] The URL to send message status information to your application
def <API key>
@properties['<API key>']
end
# @return [String] The unique string that identifies the resource
def sid
@properties['sid']
end
# @return [String] The HTTP method used with sms_fallback_url
def sms_fallback_method
@properties['sms_fallback_method']
end
# @return [String] The URL that we call when an error occurs while retrieving or executing the TwiML
def sms_fallback_url
@properties['sms_fallback_url']
end
# @return [String] The HTTP method to use with sms_url
def sms_method
@properties['sms_method']
end
# @return [String] The URL to send status information to your application
def sms_status_callback
@properties['sms_status_callback']
end
# @return [String] The URL we call when the phone number receives an incoming SMS message
def sms_url
@properties['sms_url']
end
# @return [String] The URL to send status information to your application
def status_callback
@properties['status_callback']
end
# @return [String] The HTTP method we use to call status_callback
def <API key>
@properties['<API key>']
end
def uri
@properties['uri']
end
# @return [Boolean] Whether to lookup the caller's name
def <API key>
@properties['<API key>']
end
# @return [String] The HTTP method used with voice_fallback_url
def <API key>
@properties['<API key>']
end
# @return [String] The URL we call when a TwiML error occurs
def voice_fallback_url
@properties['voice_fallback_url']
end
# @return [String] The HTTP method used with the voice_url
def voice_method
@properties['voice_method']
end
# @return [String] The URL we call when the phone number receives a call
def voice_url
@properties['voice_url']
end
# Delete the ApplicationInstance
# @return [Boolean] true if delete succeeds, false otherwise
def delete
context.delete
end
# Fetch the ApplicationInstance
# @return [ApplicationInstance] Fetched ApplicationInstance
def fetch
context.fetch
end
# Update the ApplicationInstance
# @param [String] friendly_name A descriptive string that you create to describe
# the resource. It can be up to 64 characters long.
# @param [String] api_version The API version to use to start a new TwiML session.
# Can be: `2010-04-01` or `2008-08-01`. The default value is your account's
# default API version.
# @param [String] voice_url The URL we should call when the phone number assigned
# to this application receives a call.
# @param [String] voice_method The HTTP method we should use to call `voice_url`.
# Can be: `GET` or `POST`.
# @param [String] voice_fallback_url The URL that we should call when an error
# occurs retrieving or executing the TwiML requested by `url`.
# @param [String] <API key> The HTTP method we should use to call
# `voice_fallback_url`. Can be: `GET` or `POST`.
# @param [String] status_callback The URL we should call using the
# `<API key>` to send status information to your application.
# @param [String] <API key> The HTTP method we should use to call
# `status_callback`. Can be: `GET` or `POST`.
# @param [Boolean] <API key> Whether we should look up the caller's
# caller-ID name from the CNAM database (additional charges apply). Can be: `true`
# or `false`.
# @param [String] sms_url The URL we should call when the phone number receives an
# incoming SMS message.
# @param [String] sms_method The HTTP method we should use to call `sms_url`. Can
# be: `GET` or `POST`.
# @param [String] sms_fallback_url The URL that we should call when an error
# occurs while retrieving or executing the TwiML from `sms_url`.
# @param [String] sms_fallback_method The HTTP method we should use to call
# `sms_fallback_url`. Can be: `GET` or `POST`.
# @param [String] sms_status_callback Same as <API key>: The URL we
# should call using a POST method to send status information about SMS messages
# sent by the application. Deprecated, included for backwards compatibility.
# @param [String] <API key> The URL we should call using a POST
# method to send message status information to your application.
# @return [ApplicationInstance] Updated ApplicationInstance
def update(friendly_name: :unset, api_version: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, <API key>: :unset, status_callback: :unset, <API key>: :unset, <API key>: :unset, sms_url: :unset, sms_method: :unset, sms_fallback_url: :unset, sms_fallback_method: :unset, sms_status_callback: :unset, <API key>: :unset)
context.update(
friendly_name: friendly_name,
api_version: api_version,
voice_url: voice_url,
voice_method: voice_method,
voice_fallback_url: voice_fallback_url,
<API key>: <API key>,
status_callback: status_callback,
<API key>: <API key>,
<API key>: <API key>,
sms_url: sms_url,
sms_method: sms_method,
sms_fallback_url: sms_fallback_url,
sms_fallback_method: sms_fallback_method,
sms_status_callback: sms_status_callback,
<API key>: <API key>,
)
end
# Provide a user friendly representation
def to_s
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
"<Twilio.Api.V2010.ApplicationInstance #{values}>"
end
# Provide a detailed, user friendly representation
def inspect
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
"<Twilio.Api.V2010.ApplicationInstance #{values}>"
end
end
end
end
end
end
end
|
<?php
namespace Omnipay\Braintree\Message;
/**
* Find Customer Request
*
* @method CustomerResponse send()
*/
class FindCustomerRequest extends AbstractRequest
{
public function getData()
{
return $this->getCustomerData();
}
/**
* Send the request with specified data
*
* @param mixed $data The data to send
* @return CustomerResponse
*/
public function sendData($data)
{
$response = $this->braintree->customer()->find($this->getCustomerId());
return $this->response = new CustomerResponse($this, $response);
}
}
|
require_relative 'base'
module Terjira
module Client
class StatusCategory < Base
class << self
def all
@all_statuscategory ||= file_cache.fetch("all") do
resp = api_get "statuscategory"
resp.map { |category| build(category) }
end
end
def file_cache
Terjira::FileCache.new("resource/statuscategory", 60 * 60 * 48)
end
end
end
end
end
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<base href="../../../" />
<script src="list.js"></script>
<script src="page.js"></script>
<link type="text/css" rel="stylesheet" href="page.css" />
</head>
<body>
<h1>[name]</h1>
<p class="desc">Class representing a 3D [link:https://en.wikipedia.org/wiki/Vector_space vector].
A 3D vector is an ordered triplet of numbers (labeled x, y, and z), which can be used to
represent a number of things, such as:
</p>
<ul>
<li>
A point in 3D space.
</li>
<li>
A direction and length in 3D space. In three.js the length will always be the
[link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean distance]
(straight-line distance) from (0, 0, 0) to (x, y, z) and the direction is also
measured from (0, 0, 0) towards (x, y, z).
</li>
<li>
Any arbitrary ordered triplet of numbers.
</li>
</ul>
<p>
There are other things a 3D vector can be used to represent, such as momentum
vectors and so on, however these are the most common uses in three.js.
</p>
<h2>Example</h2>
<code>
var a = new THREE.Vector3( 0, 1, 0 );
//no arguments; will be initialised to (0, 0, 0)
var b = new THREE.Vector3( );
var d = a.distanceTo( b );
</code>
<h2>Constructor</h2>
<h3>[name]( [param:Float x], [param:Float y], [param:Float z] )</h3>
<p>
[page:Float x] - the x value of the vector. Default is *0*.<br />
[page:Float y] - the y value of the vector. Default is *0*.<br />
[page:Float z] - the z value of the vector. Default is *0*.<br /><br />
Creates a new [name].
</p>
<h2>Properties</h2>
<h3>[property:Boolean isVector3]</h3>
<p>
Used to check whether this or derived classes are Vector3s. Default is *true*.<br /><br />
You should not change this, as it is used internally for optimisation.
</p>
<h3>[property:Float x]</h3>
<h3>[property:Float y]</h3>
<h3>[property:Float z]</h3>
<h2>Methods</h2>
<h3>[method:this add]( [param:Vector3 v] )</h3>
<p>Adds [page:Vector3 v] to this vector.</p>
<h3>[method:this addScalar]( [param:Float s] )</h3>
<p>Adds the scalar value s to this vector's [page:.x x], [page:.y y] and [page:.z z] values.</p>
<h3>[method:this addScaledVector]( [param:Vector3 v], [param:Float s] )</h3>
<p>Adds the multiple of [page:Vector3 v] and [page:Float s] to this vector.</p>
<h3>[method:this addVectors]( [param:Vector3 a], [param:Vector3 b] )</h3>
<p>Sets this vector to [page:Vector3 a] + [page:Vector3 b].</p>
<h3>[method:this applyAxisAngle]( [param:Vector3 axis], [param:Float angle] )</h3>
<p>
[page:Vector3 axis] - A normalized [page:Vector3].<br />
[page:Float angle] - An angle in radians.<br /><br />
Applies a rotation specified by an axis and an angle to this vector.
</p>
<h3>[method:this applyEuler]( [param:Euler euler] )</h3>
<p>
Applies euler transform to this vector by converting the [page:Euler] object to a
[page:Quaternion] and applying.
</p>
<h3>[method:this applyMatrix3]( [param:Matrix3 m] )</h3>
<p>Multiplies this vector by [page:Matrix3 m]</p>
<h3>[method:this applyMatrix4]( [param:Matrix4 m] )</h3>
<p>
Multiplies this vector (with an implicit 1 in the 4th dimension) and m, and divides by perspective.
</p>
<h3>[method:this applyQuaternion]( [param:Quaternion quaternion] )</h3>
<p>
Applies a [page:Quaternion] transform to this vector.
</p>
<h3>[method:Float angleTo]( [param:Vector3 v] )</h3>
<p>
Returns the angle between this vector and vector [page:Vector3 v] in radians.
</p>
<h3>[method:this ceil]()</h3>
<p>
The [page:.x x], [page:.y y] and [page:.z z] components of the vector are rounded up to the nearest integer value.
</p>
<h3>[method:this clamp]( [param:Vector3 min], [param:Vector3 max] )</h3>
<p>
[page:Vector3 min] - the minimum [page:.x x], [page:.y y] and [page:.z z] values.<br />
[page:Vector3 max] - the maximum [page:.x x], [page:.y y] and [page:.z z] values in the desired range<br /><br />
If this vector's x, y or z value is greater than the max vector's x, y or z value, it is replaced by the corresponding value. <br /><br />
If this vector's x, y or z value is less than the min vector's x, y or z value, it is replaced by the corresponding value.
</p>
<h3>[method:this clampLength]( [param:Float min], [param:Float max] )</h3>
<p>
[page:Float min] - the minimum value the length will be clamped to <br />
[page:Float max] - the maximum value the length will be clamped to<br /><br />
If this vector's length is greater than the max value, it is replaced by the max value. <br /><br />
If this vector's length is less than the min value, it is replaced by the min value.
</p>
<h3>[method:this clampScalar]( [param:Float min], [param:Float max] )</h3>
<p>
[page:Float min] - the minimum value the components will be clamped to <br />
[page:Float max] - the maximum value the components will be clamped to<br /><br />
If this vector's x, y or z values are greater than the max value, they are replaced by the max value. <br /><br />
If this vector's x, y or z values are less than the min value, they are replaced by the min value.
</p>
<h3>[method:Vector3 clone]()</h3>
<p>
Returns a new vector3 with the same [page:.x x], [page:.y y] and [page:.z z] values as this one.
</p>
<h3>[method:this copy]( [param:Vector3 v] )</h3>
<p>
Copies the values of the passed vector3's [page:.x x], [page:.y y] and [page:.z z]
properties to this vector3.
</p>
<h3>[method:this cross]( [param:Vector3 v] )</h3>
<p>
Sets this vector to [link:https://en.wikipedia.org/wiki/Cross_product cross product] of itself and [page:Vector3 v].
</p>
<h3>[method:this crossVectors]( [param:Vector3 a], [param:Vector3 b] )</h3>
<p>
Sets this vector to [link:https://en.wikipedia.org/wiki/Cross_product cross product] of [page:Vector3 a] and [page:Vector3 b].
</p>
<h3>[method:Float distanceTo]( [param:Vector3 v] )</h3>
<p>Computes the distance from this vector to [page:Vector3 v].</p>
<h3>[method:Float manhattanDistanceTo]( [param:Vector3 v] )</h3>
<p>
Computes the [link:https://en.wikipedia.org/wiki/Taxicab_geometry Manhattan distance] from this vector to [page:Vector3 v].
</p>
<h3>[method:Float distanceToSquared]( [param:Vector3 v] )</h3>
<p>
Computes the squared distance from this vector to [page:Vector3 v]. If you are just
comparing the distance with another distance, you should compare the distance squared instead
as it is slightly more efficient to calculate.
</p>
<h3>[method:this divide]( [param:Vector3 v] )</h3>
<p>Divides this vector by [page:Vector3 v].</p>
<h3>[method:this divideScalar]( [param:Float s] )</h3>
<p>
Divides this vector by scalar [page:Float s].<br />
Sets vector to *( 0, 0, 0 )* if *[page:Float s] = 0*.
</p>
<h3>[method:Float dot]( [param:Vector3 v] )</h3>
<p>
Calculate the [link:https://en.wikipedia.org/wiki/Dot_product dot product] of this
vector and [page:Vector3 v].
</p>
<h3>[method:Boolean equals]( [param:Vector3 v] )</h3>
<p>Checks for strict equality of this vector and [page:Vector3 v].</p>
<h3>[method:this floor]()</h3>
<p>The components of the vector are rounded down to the nearest integer value.</p>
<h3>[method:this fromArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - the source array.<br />
[page:Integer offset] - ( optional) offset into the array. Default is 0.<br /><br />
Sets this vector's [page:.x x] value to be array[ offset + 0 ], [page:.y y] value to be array[ offset + 1 ]
and [page:.z z] value to be array[ offset + 2 ].
</p>
<h3>[method:this fromBufferAttribute]( [param:BufferAttribute attribute], [param:Integer index] )</h3>
<p>
[page:BufferAttribute attribute] - the source attribute.<br />
[page:Integer index] - index in the attribute.<br /><br />
Sets this vector's [page:.x x], [page:.y y] and [page:.z z] values from the [page:BufferAttribute attribute].
</p>
<h3>[method:Float getComponent]( [param:Integer index] )</h3>
<p>
[page:Integer index] - 0, 1 or 2.<br /><br />
If index equals 0 returns the [page:.x x] value. <br />
If index equals 1 returns the [page:.y y] value. <br />
If index equals 2 returns the [page:.z z] value.
</p>
<h3>[method:Float length]()</h3>
<p>Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0, 0) to (x, y, z).</p>
<h3>[method:Float manhattanLength]()</h3>
<p>
Computes the [link:http://en.wikipedia.org/wiki/Taxicab_geometry Manhattan length] of this vector.
</p>
<h3>[method:Float lengthSq]()</h3>
<p>
Computes the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) from (0, 0, 0) to (x, y, z). If you are comparing the lengths of
vectors, you should compare the length squared instead as it is slightly more efficient to calculate.
</p>
<h3>[method:this lerp]( [param:Vector3 v], [param:Float alpha] )</h3>
<p>
[page:Vector3 v] - [page:Vector3] to interpolate towards.<br />
[page:Float alpha] - interpolation factor, typically in the closed interval [0, 1].<br /><br />
Linearly interpolate between this vector and [page:Vector3 v], where alpha is the
percent distance along the line - alpha = 0 will be this vector, and alpha = 1 will be [page:Vector3 v].
</p>
<h3>[method:this lerpVectors]( [param:Vector3 v1], [param:Vector3 v2], [param:Float alpha] )</h3>
<p>
[page:Vector3 v1] - the starting [page:Vector3].<br />
[page:Vector3 v2] - [page:Vector3] to interpolate towards.<br />
[page:Float alpha] - interpolation factor, typically in the closed interval [0, 1].<br /><br />
Sets this vector to be the vector linearly interpolated between [page:Vector3 v1] and
[page:Vector3 v2] where alpha is the percent distance along the line connecting the two vectors
- alpha = 0 will be [page:Vector3 v1], and alpha = 1 will be [page:Vector3 v2].
</p>
<h3>[method:this max]( [param:Vector3 v] )</h3>
<p>
If this vector's x, y or z value is less than [page:Vector3 v]'s x, y or z value, replace
that value with the corresponding max value.
</p>
<h3>[method:this min]( [param:Vector3 v] )</h3>
<p>
If this vector's x, y or z value is greater than [page:Vector3 v]'s x, y or z value, replace
that value with the corresponding min value.
</p>
<h3>[method:this multiply]( [param:Vector3 v] )</h3>
<p>Multiplies this vector by [page:Vector3 v].</p>
<h3>[method:this multiplyScalar]( [param:Float s] )</h3>
<p>Multiplies this vector by scalar [page:Float s].</p>
<h3>[method:this multiplyVectors]( [param:Vector3 a], [param:Vector3 b] )</h3>
<p>Sets this vector equal to [page:Vector3 a] * [page:Vector3 b], component-wise.</p>
<h3>[method:this negate]()</h3>
<p>Inverts this vector - i.e. sets x = -x, y = -y and z = -z.</p>
<h3>[method:this normalize]()</h3>
<p>
Convert this vector to a [link:https://en.wikipedia.org/wiki/Unit_vector unit vector] - that is, sets it equal to the vector with the same direction
as this one, but [page:.length length] 1.
</p>
<h3>[method:this project]( [param:Camera camera] )</h3>
<p>
[page:Camera camera] — camera to use in the projection.<br /><br />
[link:https://en.wikipedia.org/wiki/Vector_projection Projects] the vector with the camera.
</p>
<h3>[method:this projectOnPlane]( [param:Vector3 planeNormal] )</h3>
<p>
[page:Vector3 planeNormal] - A vector representing a plane normal.<br /><br />
[link:https://en.wikipedia.org/wiki/Vector_projection Projects] this vector onto a plane by subtracting this vector projected onto the plane's
normal from this vector.
</p>
<h3>[method:this projectOnVector]( [param:Vector3] )</h3>
<p>[link:https://en.wikipedia.org/wiki/Vector_projection Projects] this vector onto another vector.</p>
<h3>[method:this reflect]( [param:Vector3 normal] )</h3>
<p>
[page:Vector3 normal] - the normal to the reflecting plane<br /><br />
Reflect the vector off of plane orthogonal to [page:Vector3 normal]. Normal is assumed to
have unit length.
</p>
<h3>[method:this round]()</h3>
<p>The components of the vector are rounded to the nearest integer value.</p>
<h3>[method:this roundToZero]()</h3>
<p>
The components of the vector are rounded towards zero (up if negative, down if positive) to an integer value.
</p>
<h3>[method:this set]( [param:Float x], [param:Float y], [param:Float z] )</h3>
<p>Sets the [page:.x x], [page:.y y] and [page:.z z] components of this vector.</p>
<h3>[method:null setComponent]( [param:Integer index], [param:Float value] )</h3>
<p>
[page:Integer index] - 0, 1 or 2.<br />
[page:Float value] - [page:Float]<br /><br />
If index equals 0 set [page:.x x] to [page:Float value].<br />
If index equals 1 set [page:.y y] to [page:Float value].<br />
If index equals 2 set [page:.z z] to [page:Float value]
</p>
<h3>[method:this setFromCylindrical]( [param:Cylindrical c] )</h3>
<p>
Sets this vector from the cylindrical coordinates [page:Cylindrical c].
</p>
<h3>[method:this <API key>]( [param:Float radius], [param:Float theta], [param:Float y] )</h3>
<p>Sets this vector from the cylindrical coordinates [page:Cylindrical radius], [page:Cylindrical theta] and [page:Cylindrical y].</p>
<h3>[method:this setFromMatrixColumn]( [param:Matrix4 matrix], [param:Integer index] )</h3>
<p>
Sets this vector's [page:.x x], [page:.y y] and [page:.z z] equal to the column of
the [page:Matrix4 matrix] specified by the [page:Integer index].
</p>
<h3>[method:this <API key>]( [param:Matrix4 m] )</h3>
<p>
Sets this vector to the position elements of the
[link:https://en.wikipedia.org/wiki/<API key> transformation matrix] [page:Matrix4 m].
</p>
<h3>[method:this setFromMatrixScale]( [param:Matrix4 m] )</h3>
<p>
Sets this vector to the scale elements of the
[link:https://en.wikipedia.org/wiki/<API key> transformation matrix] [page:Matrix4 m].
</p>
<h3>[method:this setFromSpherical]( [param:Spherical s] )</h3>
<p>
Sets this vector from the spherical coordinates [page:Spherical s].
</p>
<h3>[method:this <API key>]( [param:Float radius], [param:Float phi], [param:Float theta] )</h3>
<p>Sets this vector from the spherical coordinates [page:Spherical radius], [page:Spherical phi] and [page:Spherical theta].</p>
<h3>[method:this setLength]( [param:Float l] )</h3>
<p>
Set this vector to the vector with the same direction as this one, but [page:.length length]
[page:Float l].
</p>
<h3>[method:this setScalar]( [param:Float scalar] )</h3>
<p>
Set the [page:.x x], [page:.y y] and [page:.z z] values of this vector both equal to [page:Float scalar].
</p>
<h3>[method:this setX]( [param:Float x] )</h3>
<p>Replace this vector's [page:.x x] value with [page:Float x].</p>
<h3>[method:this setY]( [param:Float y] )</h3>
<p>Replace this vector's [page:.y y] value with [page:Float y].</p>
<h3>[method:this setZ]( [param:Float z] )</h3>
<p>Replace this vector's [page:.z z] value with [page:Float z].</p>
<h3>[method:this sub]( [param:Vector3 v] )</h3>
<p>Subtracts [page:Vector3 v] from this vector.</p>
<h3>[method:this subScalar]( [param:Float s] )</h3>
<p>Subtracts [page:Float s] from this vector's [page:.x x], [page:.y y] and [page:.z z] compnents.</p>
<h3>[method:this subVectors]( [param:Vector3 a], [param:Vector3 b] )</h3>
<p>Sets this vector to [page:Vector3 a] - [page:Vector3 b].</p>
<h3>[method:Array toArray]( [param:Array array], [param:Integer offset] )</h3>
<p>
[page:Array array] - (optional) array to store the vector to. If this is not provided
a new array will be created.<br />
[page:Integer offset] - (optional) optional offset into the array.<br /><br />
Returns an array [x, y, z], or copies x, y and z into the provided [page:Array array].
</p>
<h3>[method:this transformDirection]( [param:Matrix4 m] )</h3>
<p>
Transforms the direction of this vector by a matrix (the upper left 3 x 3 subset of a [page:Matrix4 m])
and then [page:.normalize normalizes] the result.
</p>
<h3>[method:this unproject]( [param:Camera camera] )</h3>
<p>
[page:Camera camera] — camera to use in the projection.<br /><br />
[link:https://en.wikipedia.org/wiki/Vector_projection Unprojects] the vector with the
camera's projection matrix.
</p>
<h2>Source</h2>
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
</body>
</html>
|
testMipmap = function()
local f = {0}
local g = {}
local h = {6}
local k = {0}
f[1] = f[1] + 1
k[1] = h[1] - f[1];
g[1] = k[1]^2
print (g[1])
end
testMipmap()
|
#include "UniformBuffer.hpp"
#include <iostream>
#include <cstring>
UniformBuffer::UniformBuffer(const void* data, unsigned int size, VkDevice device, VkPhysicalDevice physicalDevice, VkDescriptorPool descriptorPool, VkShaderStageFlags flags) : Buffer(device, physicalDevice, descriptorPool) {
this->device = device;
this->physicalDevice = physicalDevice;
this->descriptorPool = descriptorPool;
createBuffer(size, <API key>, <API key> | <API key>, &buffer, &bufferMemory);
// Copy data to mapped memory.
setData(data, size);
// Create descriptor set.
<API key>(<API key>, flags);
createDescriptorSet(<API key>, buffer, size);
}
UniformBuffer::~UniformBuffer() {
vkDestroyBuffer(device, buffer, nullptr);
vkFreeMemory(device, bufferMemory, nullptr);
}
void UniformBuffer::setData(const void* data, unsigned int size) {
void* mappedMemory;
vkMapMemory(device, bufferMemory, 0, size, 0, &mappedMemory);
memcpy(mappedMemory, data, size);
vkUnmapMemory(device, bufferMemory);
}
|
class Test {
public static int[] test() {
return null;
}
public static void main(String[] args) {
int [] arr = test();
System.out.println(arr);
}
|
// ColorInfoView.h
// ASCFlatUIColors
#import <UIKit/UIKit.h>
@interface ColorInfoView : UIView
- (void)showWithTitle:(NSString *)title forColorAtIndexPath:(NSIndexPath *)indexPath;
- (void)hide;
@end
|
import { Component, ViewChild, ElementRef } from '@angular/core';
import { <API key> } from '../../../../../jqwidgets-ts/<API key>';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent {
@ViewChild('myButtonGroup') myButtonGroup: <API key>;
@ViewChild('myLog') myLog: ElementRef;
<API key>(): void {
this.myButtonGroup.mode('default');
};
<API key>(): void {
this.myButtonGroup.mode('radio');
};
<API key>(): void {
this.myButtonGroup.mode('checkbox');
};
groupOnBtnClick(event: any): void {
let clickedButton = event.args.button;
this.myLog.nativeElement.innerHTML = `Clicked: ${clickedButton[0].id}`;
}
}
|
-- MENUS
DELETE FROM `sys_menu_items` WHERE `set_name`='<API key>' AND `name`='<API key>';
SET @iMoAccountDashboard = (SELECT IFNULL(MAX(`order`), 0) FROM `sys_menu_items` WHERE `set_name`='<API key>' LIMIT 1);
INSERT INTO `sys_menu_items` (`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `addon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES
('<API key>', @sName, '<API key>', '<API key>', '<API key>', 'page.php?i=<API key>', '', '', 'envelope col-red', '', '', 128, 1, 0, 1, @iMoAccountDashboard + 1);
-- GRIDS
DELETE FROM `sys_grid_fields` WHERE `object`='<API key>';
INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `translatable`, `chars_limit`, `params`, `order`) VALUES
('<API key>', 'checkbox', '_sys_select', '2%', 0, '', '', 1),
('<API key>', 'title', '<API key>', '26%', 0, '22', '', 2),
('<API key>', 'author', '<API key>', '8%', 0, '22', '', 3),
('<API key>', 'segments', '<API key>', '10%', 0, '22', '', 4),
('<API key>', 'is_one_per_account', '<API key>', '10%', 0, '0', '', 5),
('<API key>', 'added', '<API key>', '10%', 0, '15', '', 6),
('<API key>', 'date_sent', '<API key>', '10%', 0, '22', '', 7),
('<API key>', 'actions', '', '24%', 0, '', '', 8);
|
<?php
declare(strict_types=1);
namespace OpenCFP\Test\Integration\Http\Action\Signup;
use OpenCFP\Test\Integration\WebTestCase;
final class PrivacyActionTest extends WebTestCase
{
/**
* @test
*/
public function <API key>()
{
$response = $this->get('/privacy');
$this-><API key>($response);
$this-><API key>('Privacy Policy', $response);
$this-><API key>('General Data Protection Regulation', $response);
}
}
|
using System;
using System.Windows.Input;
namespace CustomBA.Commands
{
<summary>
Based on http://wpftutorial.net/DelegateCommand.html
</summary>
public class DelegateCommand : ICommand
{
private readonly Predicate<object> _canExecute;
private readonly Action<object> _execute;
public event EventHandler CanExecuteChanged;
public DelegateCommand(Action<object> execute)
: this(execute, null)
{
}
public DelegateCommand(Action<object> execute,
Predicate<object> canExecute)
{
_execute = execute;
_canExecute = canExecute;
}
public bool CanExecute(object parameter)
{
if (_canExecute == null)
{
return true;
}
return _canExecute(parameter);
}
public void Execute(object parameter)
{
_execute(parameter);
}
public void <API key>()
{
if (CanExecuteChanged != null)
{
CanExecuteChanged(this, EventArgs.Empty);
}
}
}
}
|
export declare class SampleComponent {
constructor();
}
|
# SSH
## SSH keys
An SSH key allows you to establish a secure connection between your
computer and GitLab. Before generating an SSH key in your shell, check if your system
already has one by running the following command:
bash
cat ~/.ssh/id_rsa.pub
If you see a long string starting with `ssh-rsa` or `ssh-dsa`, you can skip the `ssh-keygen` step.
Note: It is a best practice to use a password for an SSH key, but it is not
required and you can skip creating a password by pressing enter. Note that
the password you choose here can't be altered or retrieved.
To generate a new SSH key, use the following commandGitLab```bash
ssh-keygen -t rsa -C "$your_email"
This command will prompt you for a location and filename to store the key
pair and for a password. When prompted for the location and filename, you
can press enter to use the default.
Use the command below to show your public key:
bash
cat ~/.ssh/id_rsa.pub
Copy-paste the key to the 'My SSH Keys' section under the 'SSH' tab in your
user profile. Please copy the complete key starting with `ssh-` and ending
with your username and host.
To copy your public key to the clipboard, use code below. Depending on your
OS you'll need to use a different command:
**Windows:**
bash
clip < ~/.ssh/id_rsa.pub
**Mac:**
bash
pbcopy < ~/.ssh/id_rsa.pub
**GNU/Linux (requires xclip):**
bash
xclip -sel clip < ~/.ssh/id_rsa.pub
## Deploy keys
Deploy keys allow read-only access to multiple projects with a single SSH
key.
This is really useful for cloning repositories to your Continuous
Integration (CI) server. By using deploy keys, you don't have to setup a
dummy user account.
If you are a project master or owner, you can add a deploy key in the
project settings under the section 'Deploy Keys'. Press the 'New Deploy
Key' button and upload a public SSH key. After this, the machine that uses
the corresponding private key has read-only access to the project.
You can't add the same deploy key twice with the 'New Deploy Key' option.
If you want to add the same key to another project, please enable it in the
list that says 'Deploy keys from projects available to you'. All the deploy
keys of all the projects you have access to are available. This project
access can happen through being a direct member of the project, or through
a group. See `def <API key>` in `app/models/user.rb` for more
information.
Deploy keys can be shared between projects, you just need to add them to each project.
## Applications
Eclipse
How to add your ssh key to Eclipse: https://wiki.eclipse.org/EGit/User_Guide#<API key>
## Tip: Non-default OpenSSH key file names or locations
If, for whatever reason, you decide to specify a non-default location and filename for your GitLab SSH key pair, you must configure your SSH client to find your GitLab SSH private key for connections to your GitLab server (perhaps gitlab.com). For OpenSSH clients, this is handled in the `~/.ssh/config` file with a stanza similar to the following:
# Main gitlab.com server
Host gitlab.com
RSAAuthentication yes
IdentityFile ~/<API key>/<API key>
User mygitlabusername
Another example
# Our company's internal GitLab server
Host my-gitlab.company.com
RSAAuthentication yes
IdentityFile ~/<API key>/<API key>
Note in the gitlab.com example above a username was specified to override the default chosen by OpenSSH (your local username). This is only required if your local and remote usernames differ.
Due to the wide variety of SSH clients and their very large number of configuration options, further explanation of these topics is beyond the scope of this document.
Public SSH keys need to be unique, as they will bind to your account. Your SSH key is the only identifier you'll
have when pushing code via SSH. That's why it needs to uniquely map to a single user.
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc on Fri Nov 26 15:38:56 EST 2010 -->
<TITLE>
Xerces Native Interface: Package org.apache.xerces.xni
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="../../../../org/apache/xerces/xni/package-summary.html" TARGET="classFrame">org.apache.xerces.xni</A></FONT>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Interfaces</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="Augmentations.html" TARGET="classFrame"><I>Augmentations</I></A>
<BR>
<A HREF="NamespaceContext.html" TARGET="classFrame"><I>NamespaceContext</I></A>
<BR>
<A HREF="XMLAttributes.html" TARGET="classFrame"><I>XMLAttributes</I></A>
<BR>
<A HREF="<API key>.html" TARGET="classFrame"><I><API key></I></A>
<BR>
<A HREF="XMLDocumentHandler.html" TARGET="classFrame"><I>XMLDocumentHandler</I></A>
<BR>
<A HREF="<API key>.html" TARGET="classFrame"><I><API key></I></A>
<BR>
<A HREF="XMLDTDHandler.html" TARGET="classFrame"><I>XMLDTDHandler</I></A>
<BR>
<A HREF="XMLLocator.html" TARGET="classFrame"><I>XMLLocator</I></A>
<BR>
<A HREF="<API key>.html" TARGET="classFrame"><I><API key></I></A></FONT></TD>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="QName.html" TARGET="classFrame">QName</A>
<BR>
<A HREF="XMLString.html" TARGET="classFrame">XMLString</A></FONT></TD>
</TR>
</TABLE>
<TABLE BORDER="0" WIDTH="100%">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Exceptions</FONT>
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="XNIException.html" TARGET="classFrame">XNIException</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
|
#ifndef _WLC_CONTEXT_H_
#define _WLC_CONTEXT_H_
#include <stdbool.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
struct wl_display;
struct wlc_backend_surface;
struct ctx;
struct wlc_context_api {
void (*terminate)(struct ctx *context);
bool (*bind)(struct ctx *context);
bool (*bind_to_wl_display)(struct ctx *context, struct wl_display *display);
void (*swap)(struct ctx *context, struct wlc_backend_surface *bsurface);
void* (*get_proc_address)(struct ctx *context, const char *procname);
// EGL
EGLBoolean (*query_buffer)(struct ctx *context, struct wl_resource *buffer, EGLint attribute, EGLint *value);
EGLImageKHR (*create_image)(struct ctx *context, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
EGLBoolean (*destroy_image)(struct ctx *context, EGLImageKHR image);
};
struct wlc_context {
void *context; // internal surface context (EGL, etc)
struct wlc_context_api api;
};
void* <API key>(struct wlc_context *context, const char *procname);
EGLBoolean <API key>(struct wlc_context *context, struct wl_resource *buffer, EGLint attribute, EGLint *value);
EGLImageKHR <API key>(struct wlc_context *context, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
EGLBoolean <API key>(struct wlc_context *context, EGLImageKHR image);
bool wlc_context_bind(struct wlc_context *context);
bool <API key>(struct wlc_context *context, struct wl_display *display);
void wlc_context_swap(struct wlc_context *context, struct wlc_backend_surface *bsurface);
void wlc_context_release(struct wlc_context *context);
bool wlc_context(struct wlc_context *context, struct wlc_backend_surface *bsurface);
#endif /* _WLC_CONTEXT_H_ */
|
import {Component} from '@angular/core';
@Component({
selector: 'not-found',
templateUrl: 'app/404.component/404.component.html',
styleUrls: ['app/404.component/404.component.css'],
})
export class NotFoundComponent {}
|
<!DOCTYPE HTML PUBLIC "-
<!--NewPage
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_33) on Tue Aug 20 12:20:59 EDT 2013 -->
<TITLE>
mars.util Class Hierarchy
</TITLE>
<META NAME="date" CONTENT="2013-08-20">
<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="mars.util Class Hierarchy";
}
}
</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="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </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="../../mars/tools/package-tree.html"><B>PREV</B></A>
<A HREF="../../mars/venus/package-tree.html"><B>NEXT</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?mars/util/package-tree.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-tree.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>
</TABLE>
<A NAME="skip-navbar_top"></A>
<HR>
<CENTER>
<H2>
Hierarchy For Package mars.util
</H2>
</CENTER>
<DL>
<DT><B>Package Hierarchies:</B><DD><A HREF="../../overview-tree.html">All Packages</A></DL>
<HR>
<H2>
Class Hierarchy
</H2>
<UL>
<LI TYPE="circle">java.lang.<A HREF="http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><B>Object</B></A><UL>
<LI TYPE="circle">mars.util.<A HREF="../../mars/util/Binary.html" title="class in mars.util"><B>Binary</B></A><LI TYPE="circle">mars.util.<A HREF="../../mars/util/EditorFont.html" title="class in mars.util"><B>EditorFont</B></A><LI TYPE="circle">mars.util.<A HREF="../../mars/util/FilenameFinder.html" title="class in mars.util"><B>FilenameFinder</B></A><LI TYPE="circle">mars.util.<A HREF="../../mars/util/MemoryDump.html" title="class in mars.util"><B>MemoryDump</B></A><LI TYPE="circle">mars.util.<A HREF="../../mars/util/PropertiesFile.html" title="class in mars.util"><B>PropertiesFile</B></A><LI TYPE="circle">mars.util.<A HREF="../../mars/util/SystemIO.html" title="class in mars.util"><B>SystemIO</B></A></UL>
</UL>
<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="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </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="../../mars/tools/package-tree.html"><B>PREV</B></A>
<A HREF="../../mars/venus/package-tree.html"><B>NEXT</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?mars/util/package-tree.html" target="_top"><B>FRAMES</B></A>
<A HREF="package-tree.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>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<HR>
</BODY>
</HTML>
|
<!DOCTYPE html PUBLIC "-
<html xmlns="http:
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>type_mat3x2.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="logo-mini.png"/></td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.8.0 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">type_mat3x2.hpp</div> </div>
</div><!--header
<div class="contents">
<a href="a00101.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00002"></a>00002
<a name="l00003"></a>00003
<a name="l00004"></a>00004
<a name="l00005"></a>00005
<a name="l00006"></a>00006
<a name="l00007"></a>00007
<a name="l00008"></a>00008
<a name="l00009"></a>00009
<a name="l00010"></a>00010
<a name="l00011"></a>00011
<a name="l00012"></a>00012
<a name="l00013"></a>00013
<a name="l00014"></a>00014
<a name="l00015"></a>00015
<a name="l00016"></a>00016
<a name="l00017"></a>00017
<a name="l00018"></a>00018
<a name="l00019"></a>00019
<a name="l00020"></a>00020
<a name="l00021"></a>00021
<a name="l00022"></a>00022
<a name="l00023"></a>00023
<a name="l00024"></a>00024
<a name="l00025"></a>00025
<a name="l00026"></a>00026
<a name="l00027"></a>00027
<a name="l00028"></a>00028
<a name="l00029"></a>00029 <span class="preprocessor">#ifndef <API key></span>
<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define <API key></span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="a00097.html" title="OpenGL Mathematics (glm.g-truc.net)">type_mat.hpp</a>"</span>
<a name="l00033"></a>00033
<a name="l00034"></a>00034 <span class="keyword">namespace </span>glm{
<a name="l00035"></a>00035 <span class="keyword">namespace </span>detail
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tvec1;
<a name="l00038"></a>00038 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tvec2;
<a name="l00039"></a>00039 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tvec3;
<a name="l00040"></a>00040 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tvec4;
<a name="l00041"></a>00041 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat2x2;
<a name="l00042"></a>00042 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat2x3;
<a name="l00043"></a>00043 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat2x4;
<a name="l00044"></a>00044 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat3x2;
<a name="l00045"></a>00045 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat3x3;
<a name="l00046"></a>00046 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat3x4;
<a name="l00047"></a>00047 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat4x2;
<a name="l00048"></a>00048 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat4x3;
<a name="l00049"></a>00049 <span class="keyword">template</span> <<span class="keyword">typename</span> T> <span class="keyword">struct </span>tmat4x4;
<a name="l00050"></a>00050
<a name="l00051"></a>00051 <span class="comment">// \brief Template for 3 columns and 2 rows matrix of floating-point numbers.</span>
<a name="l00052"></a>00052 <span class="comment">// \ingroup core_template</span>
<a name="l00053"></a>00053 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00054"></a>00054 <span class="keyword">struct </span>tmat3x2
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056 <span class="keyword">enum</span> ctor{null};
<a name="l00057"></a>00057 <span class="keyword">typedef</span> T value_type;
<a name="l00058"></a>00058 <span class="keyword">typedef</span> std::size_t size_type;
<a name="l00059"></a>00059 <span class="keyword">typedef</span> tvec2<T> col_type;
<a name="l00060"></a>00060 <span class="keyword">typedef</span> tvec3<T> row_type;
<a name="l00061"></a>00061 GLM_FUNC_DECL size_type <a class="code" href="a00129.html#<API key>" title="Returns the length of x, i.e., sqrt(x * x).">length</a>() <span class="keyword">const</span>;
<a name="l00062"></a>00062 <span class="keyword">static</span> GLM_FUNC_DECL size_type col_size();
<a name="l00063"></a>00063 <span class="keyword">static</span> GLM_FUNC_DECL size_type row_size();
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="keyword">typedef</span> tmat3x2<T> type;
<a name="l00066"></a>00066 <span class="keyword">typedef</span> tmat2x3<T> transpose_type;
<a name="l00067"></a>00067
<a name="l00068"></a>00068 <span class="keyword">private</span>:
<a name="l00069"></a>00069 <span class="comment">// Data</span>
<a name="l00070"></a>00070 col_type value[3];
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="keyword">public</span>:
<a name="l00073"></a>00073 <span class="comment">// Constructors</span>
<a name="l00074"></a>00074 GLM_FUNC_DECL tmat3x2();
<a name="l00075"></a>00075 GLM_FUNC_DECL tmat3x2(tmat3x2 <span class="keyword">const</span> & m);
<a name="l00076"></a>00076
<a name="l00077"></a>00077 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(
<a name="l00078"></a>00078 ctor);
<a name="l00079"></a>00079 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(
<a name="l00080"></a>00080 value_type <span class="keyword">const</span> & s);
<a name="l00081"></a>00081 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(
<a name="l00082"></a>00082 value_type <span class="keyword">const</span> & x0, value_type <span class="keyword">const</span> & y0,
<a name="l00083"></a>00083 value_type <span class="keyword">const</span> & x1, value_type <span class="keyword">const</span> & y1,
<a name="l00084"></a>00084 value_type <span class="keyword">const</span> & x2, value_type <span class="keyword">const</span> & y2);
<a name="l00085"></a>00085 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(
<a name="l00086"></a>00086 col_type <span class="keyword">const</span> & v0,
<a name="l00087"></a>00087 col_type <span class="keyword">const</span> & v1,
<a name="l00088"></a>00088 col_type <span class="keyword">const</span> & v2);
<a name="l00089"></a>00089
<a name="l00091"></a>00091 <span class="comment">// Conversions</span>
<a name="l00092"></a>00092 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00093"></a>00093 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(
<a name="l00094"></a>00094 U <span class="keyword">const</span> & x);
<a name="l00095"></a>00095
<a name="l00096"></a>00096 <span class="keyword">template</span>
<a name="l00097"></a>00097 <
<a name="l00098"></a>00098 <span class="keyword">typename</span> X1, <span class="keyword">typename</span> Y1,
<a name="l00099"></a>00099 <span class="keyword">typename</span> X2, <span class="keyword">typename</span> Y2,
<a name="l00100"></a>00100 <span class="keyword">typename</span> X3, <span class="keyword">typename</span> Y3
<a name="l00101"></a>00101 >
<a name="l00102"></a>00102 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(
<a name="l00103"></a>00103 X1 <span class="keyword">const</span> & x1, Y1 <span class="keyword">const</span> & y1,
<a name="l00104"></a>00104 X2 <span class="keyword">const</span> & x2, Y2 <span class="keyword">const</span> & y2,
<a name="l00105"></a>00105 X3 <span class="keyword">const</span> & x3, Y3 <span class="keyword">const</span> & y3);
<a name="l00106"></a>00106
<a name="l00107"></a>00107 <span class="keyword">template</span> <<span class="keyword">typename</span> V1, <span class="keyword">typename</span> V2, <span class="keyword">typename</span> V3>
<a name="l00108"></a>00108 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(
<a name="l00109"></a>00109 tvec2<V1> <span class="keyword">const</span> & v1,
<a name="l00110"></a>00110 tvec2<V2> <span class="keyword">const</span> & v2,
<a name="l00111"></a>00111 tvec2<V3> <span class="keyword">const</span> & v3);
<a name="l00112"></a>00112
<a name="l00113"></a>00113 <span class="comment">// Matrix conversions</span>
<a name="l00114"></a>00114 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00115"></a>00115 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat3x2<U> <span class="keyword">const</span> & m);
<a name="l00116"></a>00116
<a name="l00117"></a>00117 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat2x2<T> <span class="keyword">const</span> & x);
<a name="l00118"></a>00118 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat3x3<T> <span class="keyword">const</span> & x);
<a name="l00119"></a>00119 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat4x4<T> <span class="keyword">const</span> & x);
<a name="l00120"></a>00120 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat2x3<T> <span class="keyword">const</span> & x);
<a name="l00121"></a>00121 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat2x4<T> <span class="keyword">const</span> & x);
<a name="l00122"></a>00122 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat3x4<T> <span class="keyword">const</span> & x);
<a name="l00123"></a>00123 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat4x2<T> <span class="keyword">const</span> & x);
<a name="l00124"></a>00124 GLM_FUNC_DECL <span class="keyword">explicit</span> tmat3x2(tmat4x3<T> <span class="keyword">const</span> & x);
<a name="l00125"></a>00125
<a name="l00126"></a>00126 <span class="comment">// Accesses</span>
<a name="l00127"></a>00127 GLM_FUNC_DECL col_type & operator[](size_type i);
<a name="l00128"></a>00128 GLM_FUNC_DECL col_type <span class="keyword">const</span> & operator[](size_type i) <span class="keyword">const</span>;
<a name="l00129"></a>00129
<a name="l00130"></a>00130 <span class="comment">// Unary updatable operators</span>
<a name="l00131"></a>00131 GLM_FUNC_DECL tmat3x2<T> & operator= (tmat3x2<T> <span class="keyword">const</span> & m);
<a name="l00132"></a>00132 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00133"></a>00133 GLM_FUNC_DECL tmat3x2<T> & operator= (tmat3x2<U> <span class="keyword">const</span> & m);
<a name="l00134"></a>00134 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00135"></a>00135 GLM_FUNC_DECL tmat3x2<T> & operator+= (U <span class="keyword">const</span> & s);
<a name="l00136"></a>00136 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00137"></a>00137 GLM_FUNC_DECL tmat3x2<T> & operator+= (tmat3x2<U> <span class="keyword">const</span> & m);
<a name="l00138"></a>00138 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00139"></a>00139 GLM_FUNC_DECL tmat3x2<T> & operator-= (U <span class="keyword">const</span> & s);
<a name="l00140"></a>00140 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00141"></a>00141 GLM_FUNC_DECL tmat3x2<T> & operator-= (tmat3x2<U> <span class="keyword">const</span> & m);
<a name="l00142"></a>00142 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00143"></a>00143 GLM_FUNC_DECL tmat3x2<T> & operator*= (U <span class="keyword">const</span> & s);
<a name="l00144"></a>00144 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00145"></a>00145 GLM_FUNC_DECL tmat3x2<T> & operator*= (tmat3x2<U> <span class="keyword">const</span> & m);
<a name="l00146"></a>00146 <span class="keyword">template</span> <<span class="keyword">typename</span> U>
<a name="l00147"></a>00147 GLM_FUNC_DECL tmat3x2<T> & operator/= (U <span class="keyword">const</span> & s);
<a name="l00148"></a>00148
<a name="l00149"></a>00149 GLM_FUNC_DECL tmat3x2<T> & operator++ ();
<a name="l00150"></a>00150 GLM_FUNC_DECL tmat3x2<T> & operator
<a name="l00151"></a>00151 };
<a name="l00152"></a>00152
<a name="l00153"></a>00153 <span class="comment">// Binary operators</span>
<a name="l00154"></a>00154 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00155"></a>00155 tmat3x2<T> operator+ (
<a name="l00156"></a>00156 tmat3x2<T> <span class="keyword">const</span> & m,
<a name="l00157"></a>00157 <span class="keyword">typename</span> tmat3x2<T>::value_type <span class="keyword">const</span> & s);
<a name="l00158"></a>00158
<a name="l00159"></a>00159 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00160"></a>00160 tmat3x2<T> operator+ (
<a name="l00161"></a>00161 tmat3x2<T> <span class="keyword">const</span> & m1,
<a name="l00162"></a>00162 tmat3x2<T> <span class="keyword">const</span> & m2);
<a name="l00163"></a>00163
<a name="l00164"></a>00164 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00165"></a>00165 tmat3x2<T> operator- (
<a name="l00166"></a>00166 tmat3x2<T> <span class="keyword">const</span> & m,
<a name="l00167"></a>00167 <span class="keyword">typename</span> tmat3x2<T>::value_type <span class="keyword">const</span> & s);
<a name="l00168"></a>00168
<a name="l00169"></a>00169 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00170"></a>00170 tmat3x2<T> operator- (
<a name="l00171"></a>00171 tmat3x2<T> <span class="keyword">const</span> & m1,
<a name="l00172"></a>00172 tmat3x2<T> <span class="keyword">const</span> & m2);
<a name="l00173"></a>00173
<a name="l00174"></a>00174 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00175"></a>00175 tmat3x2<T> operator* (
<a name="l00176"></a>00176 tmat3x2<T> <span class="keyword">const</span> & m,
<a name="l00177"></a>00177 <span class="keyword">typename</span> tmat3x2<T>::value_type <span class="keyword">const</span> & s);
<a name="l00178"></a>00178
<a name="l00179"></a>00179 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00180"></a>00180 tmat3x2<T> operator* (
<a name="l00181"></a>00181 <span class="keyword">typename</span> tmat3x2<T>::value_type <span class="keyword">const</span> & s,
<a name="l00182"></a>00182 tmat3x2<T> <span class="keyword">const</span> & m);
<a name="l00183"></a>00183
<a name="l00184"></a>00184 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00185"></a>00185 <span class="keyword">typename</span> tmat3x2<T>::col_type operator* (
<a name="l00186"></a>00186 tmat3x2<T> <span class="keyword">const</span> & m,
<a name="l00187"></a>00187 <span class="keyword">typename</span> tmat3x2<T>::row_type <span class="keyword">const</span> & v);
<a name="l00188"></a>00188
<a name="l00189"></a>00189 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00190"></a>00190 <span class="keyword">typename</span> tmat3x2<T>::row_type operator* (
<a name="l00191"></a>00191 <span class="keyword">typename</span> tmat3x2<T>::col_type <span class="keyword">const</span> & v,
<a name="l00192"></a>00192 tmat3x2<T> <span class="keyword">const</span> & m);
<a name="l00193"></a>00193
<a name="l00194"></a>00194 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00195"></a>00195 tmat2x2<T> operator* (
<a name="l00196"></a>00196 tmat3x2<T> <span class="keyword">const</span> & m1,
<a name="l00197"></a>00197 tmat2x3<T> <span class="keyword">const</span> & m2);
<a name="l00198"></a>00198
<a name="l00199"></a>00199 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00200"></a>00200 tmat3x2<T> operator* (
<a name="l00201"></a>00201 tmat3x2<T> <span class="keyword">const</span> & m1,
<a name="l00202"></a>00202 tmat3x3<T> <span class="keyword">const</span> & m2);
<a name="l00203"></a>00203
<a name="l00204"></a>00204 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00205"></a>00205 tmat4x2<T> operator* (
<a name="l00206"></a>00206 tmat3x2<T> <span class="keyword">const</span> & m1,
<a name="l00207"></a>00207 tmat4x3<T> <span class="keyword">const</span> & m2);
<a name="l00208"></a>00208
<a name="l00209"></a>00209 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00210"></a>00210 tmat3x2<T> operator/ (
<a name="l00211"></a>00211 tmat3x2<T> <span class="keyword">const</span> & m,
<a name="l00212"></a>00212 <span class="keyword">typename</span> tmat3x2<T>::value_type <span class="keyword">const</span> & s);
<a name="l00213"></a>00213
<a name="l00214"></a>00214 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00215"></a>00215 tmat3x2<T> operator/ (
<a name="l00216"></a>00216 <span class="keyword">typename</span> tmat3x2<T>::value_type <span class="keyword">const</span> & s,
<a name="l00217"></a>00217 tmat3x2<T> <span class="keyword">const</span> & m);
<a name="l00218"></a>00218
<a name="l00219"></a>00219 <span class="comment">// Unary constant operators</span>
<a name="l00220"></a>00220 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00221"></a>00221 tmat3x2<T> <span class="keyword">const</span> operator- (
<a name="l00222"></a>00222 tmat3x2<T> <span class="keyword">const</span> & m);
<a name="l00223"></a>00223
<a name="l00224"></a>00224 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00225"></a>00225 tmat3x2<T> <span class="keyword">const</span> operator
<a name="l00226"></a>00226 tmat3x2<T> <span class="keyword">const</span> & m,
<a name="l00227"></a>00227 <span class="keywordtype">int</span>);
<a name="l00228"></a>00228
<a name="l00229"></a>00229 <span class="keyword">template</span> <<span class="keyword">typename</span> T>
<a name="l00230"></a>00230 tmat3x2<T> <span class="keyword">const</span> operator++ (
<a name="l00231"></a>00231 tmat3x2<T> <span class="keyword">const</span> & m,
<a name="l00232"></a>00232 <span class="keywordtype">int</span>);
<a name="l00233"></a>00233
<a name="l00234"></a>00234 } <span class="comment">//namespace detail</span>
<a name="l00235"></a>00235
<a name="l00238"></a>00238
<a name="l00244"></a><a class="code" href="a00141.html#<API key>">00244</a> <span class="keyword">typedef</span> detail::tmat3x2<lowp_float> <a class="code" href="a00141.html#<API key>" title="3 columns of 2 components matrix of low precision floating-point numbers.">lowp_mat3x2</a>;
<a name="l00245"></a>00245
<a name="l00251"></a><a class="code" href="a00141.html#<API key>">00251</a> <span class="keyword">typedef</span> detail::tmat3x2<mediump_float> <a class="code" href="a00141.html#<API key>" title="3 columns of 2 components matrix of medium precision floating-point numbers.">mediump_mat3x2</a>;
<a name="l00252"></a>00252
<a name="l00258"></a><a class="code" href="a00141.html#<API key>">00258</a> <span class="keyword">typedef</span> detail::tmat3x2<highp_float> <a class="code" href="a00141.html#<API key>" title="3 columns of 2 components matrix of high precision floating-point numbers.">highp_mat3x2</a>;
<a name="l00259"></a>00259
<a name="l00261"></a>00261 }<span class="comment">//namespace glm</span>
<a name="l00262"></a>00262
<a name="l00263"></a>00263 <span class="preprocessor">#ifndef <API key></span>
<a name="l00264"></a>00264 <span class="preprocessor"></span><span class="preprocessor">#include "type_mat3x2.inl"</span>
<a name="l00265"></a>00265 <span class="preprocessor">#endif</span>
<a name="l00266"></a>00266 <span class="preprocessor"></span>
<a name="l00267"></a>00267 <span class="preprocessor">#endif //<API key></span>
</pre></div></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated by &
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>
</body>
</html>
|
<?php
require_once('library/HTML5/Parser.php');
require_once('library/HTMLPurifier.auto.php');
function arr_add_hashes(&$item,$k) {
$item = '#' . $item;
}
function parse_url_content(&$a) {
$text = null;
$str_tags = '';
if(x($_GET,'binurl'))
$url = trim(hex2bin($_GET['binurl']));
else
$url = trim($_GET['url']);
if($_GET['title'])
$title = strip_tags(trim($_GET['title']));
if($_GET['description'])
$text = strip_tags(trim($_GET['description']));
if($_GET['tags']) {
$arr_tags = str_getcsv($_GET['tags']);
if(count($arr_tags)) {
array_walk($arr_tags,'arr_add_hashes');
$str_tags = '<br />' . implode(' ',$arr_tags) . '<br />';
}
}
logger('parse_url: ' . $url);
$template = "<br /><a class=\"bookmark\" href=\"%s\" >%s</a>%s<br />";
$arr = array('url' => $url, 'text' => '');
call_hooks('parse_link', $arr);
if(strlen($arr['text'])) {
echo $arr['text'];
killme();
}
if($url && $title && $text) {
$text = '<br /><br /><blockquote>' . $text . '</blockquote><br />';
$title = str_replace(array("\r","\n"),array('',''),$title);
$result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags;
logger('parse_url (unparsed): returns: ' . $result);
echo $result;
killme();
}
if($url) {
$s = fetch_url($url);
} else {
echo '';
killme();
}
// logger('parse_url: data: ' . $s, LOGGER_DATA);
if(! $s) {
echo sprintf($template,$url,$url,'') . $str_tags;
killme();
}
$matches = '';
$c = preg_match('/\<head(.*?)\>(.*?)\<\/head\>/ism',$s,$matches);
if($c) {
// logger('parse_url: header: ' . $matches[2], LOGGER_DATA);
try {
$domhead = HTML5_Parser::parse($matches[2]);
} catch (DOMException $e) {
logger('scrape_dfrn: parse error: ' . $e);
}
if($domhead)
logger('parsed header');
}
if(! $title) {
if(strpos($s,'<title>')) {
$title = substr($s,strpos($s,'<title>')+7,64);
if(strpos($title,'<') !== false)
$title = strip_tags(substr($title,0,strpos($title,'<')));
}
}
$config = HTMLPurifier_Config::createDefault();
$config->set('Cache.DefinitionImpl', null);
$purifier = new HTMLPurifier($config);
$s = $purifier->purify($s);
// logger('purify_output: ' . $s);
try {
$dom = HTML5_Parser::parse($s);
} catch (DOMException $e) {
logger('scrape_dfrn: parse error: ' . $e);
}
if(! $dom) {
echo sprintf($template,$url,$url,'') . $str_tags;
killme();
}
$items = $dom-><API key>('title');
if($items) {
foreach($items as $item) {
$title = trim($item->textContent);
break;
}
}
if(! $text) {
$divs = $dom-><API key>('div');
if($divs) {
foreach($divs as $div) {
$class = $div->getAttribute('class');
if($class && (stristr($class,'article') || stristr($class,'content'))) {
$items = $div-><API key>('p');
if($items) {
foreach($items as $item) {
$text = $item->textContent;
if(stristr($text,'<script')) {
$text = '';
continue;
}
$text = strip_tags($text);
if(strlen($text) < 100) {
$text = '';
continue;
}
$text = substr($text,0,250) . '...' ;
break;
}
}
}
if($text)
break;
}
}
if(! $text) {
$items = $dom-><API key>('p');
if($items) {
foreach($items as $item) {
$text = $item->textContent;
if(stristr($text,'<script'))
continue;
$text = strip_tags($text);
if(strlen($text) < 100) {
$text = '';
continue;
}
$text = substr($text,0,250) . '...' ;
break;
}
}
}
}
if(! $text) {
logger('parsing meta');
$items = $domhead-><API key>('meta');
if($items) {
foreach($items as $item) {
$property = $item->getAttribute('property');
if($property && (stristr($property,':description'))) {
$text = $item->getAttribute('content');
if(stristr($text,'<script')) {
$text = '';
continue;
}
$text = strip_tags($text);
$text = substr($text,0,250) . '...' ;
}
if($property && (stristr($property,':image'))) {
$image = $item->getAttribute('content');
if(stristr($text,'<script')) {
$image = '';
continue;
}
$image = strip_tags($image);
$i = fetch_url($image);
if($i) {
require_once('include/Photo.php');
$ph = new Photo($i);
if($ph->is_valid()) {
if($ph->getWidth() > 300 || $ph->getHeight() > 300) {
$ph->scaleImage(300);
$new_width = $ph->getWidth();
$new_height = $ph->getHeight();
$image = '<br /><br /><img height="' . $new_height . '" width="' . $new_width . '" src="' .$image . '" alt="photo" />';
}
else
$image = '<br /><br /><img src="' . $image . '" alt="photo" />';
}
else
$image = '';
}
}
}
}
}
if(strlen($text)) {
$text = '<br /><br /><blockquote>' . $text . '</blockquote><br />';
}
if($image) {
$text = $image . '<br />' . $text;
}
$title = str_replace(array("\r","\n"),array('',''),$title);
$result = sprintf($template,$url,($title) ? $title : $url,$text) . $str_tags;
logger('parse_url: returns: ' . $result);
echo $result;
killme();
}
|
package com.example.exampleeureka;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class <API key> {
@Test
public void contextLoads() {
}
}
|
using System.Runtime.Serialization;
namespace BungieNetPlatform.Enums {
[DataContract]
public enum ForumPostSort {
[EnumMember]
Default = 0,
[EnumMember]
OldestFirst = 1
}
}
|
using System.Net.Http;
using System.Threading.Tasks;
namespace WebApiContrib.IoC.Mef.Tests.Parts
{
public class <API key> : DelegatingHandler
{
private readonly HttpResponseMessage _response;
public <API key>(HttpResponseMessage response)
{
_response = response;
}
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.Cancellation<API key>)
{
if (request.Method == HttpMethod.Get)
{
_response.RequestMessage = request;
var tcs = new <API key><HttpResponseMessage>();
tcs.SetResult(_response);
return tcs.Task;
}
return null;
}
}
}
|
#include "gamelib/components/editor/LineBrushComponent.hpp"
#include "gamelib/components/geometry/Polygon.hpp"
#include "gamelib/components/rendering/MeshRenderer.hpp"
#include "gamelib/core/ecs/Entity.hpp"
#include "gamelib/properties/PropComponent.hpp"
namespace gamelib
{
LineBrushComponent::LineBrushComponent() :
_linewidth(32)
{
auto cb = +[](const ComponentReference<PolygonCollider>* val, LineBrushComponent* self) {
self->_line = *val;
self->regenerate();
};
_props.registerProperty("linewidth", _linewidth, PROP_METHOD(_linewidth, setWidth), this);
registerProperty(_props, "line", _line, *this, cb);
}
void LineBrushComponent::setWidth(int width)
{
if (_linewidth == width)
return;
_linewidth = width;
regenerate();
}
int LineBrushComponent::getWidth() const
{
return _linewidth;
}
PolygonCollider* LineBrushComponent::getBrushPolygon() const
{
return _line.get();
}
void LineBrushComponent::regenerate() const
{
if (!_shape || !_pol || !_line || _line->size() == 0)
return;
math::Vec2f lastd, dir;
bool start = true;
auto cb = [&](const math::Line2f& seg) {
float area = 0;
auto norm = seg.d.normalized();
if (start)
{
start = false;
lastd = seg.d;
}
else
{
// Compute if the line turns clockwise or counter clockwise
// Total hours wasted here because I didn't google the
// problem / didn't knew what exactly to google for: 11
auto p1 = seg.p - lastd;
auto p3 = seg.p + seg.d;
// Break if the direction hasn't changed
if (lastd.normalized() == norm)
return false;
area = (seg.p.x - p1.x) * (seg.p.y + p1.y)
+ (p3.x - seg.p.x) * (p3.y + seg.p.y)
+ (p1.x - p3.x) * (p1.y + p3.y);
}
dir = (norm + lastd.normalized()).right().normalized();
dir *= (_linewidth / 2.0) / dir.angle_cos(lastd.right());
_pol->add(seg.p - dir);
_pol->add(seg.p + dir);
// depending on clockwise or counter clockwise line direction,
// different vertices have to be added.
if (area != 0)
{
auto len = norm.right() * _linewidth;
if (area > 0) // clockwise
{
_pol->add(seg.p - dir);
_pol->add(seg.p - dir + len);
}
else // counter clockwise
{
_pol->add(seg.p + dir - len);
_pol->add(seg.p + dir);
}
}
lastd = seg.d;
return false;
};
auto& linepol = _line->getLocal();
_pol->clear();
linepol.foreachSegment(cb);
dir = lastd.right().normalized() * (_linewidth / 2.0);
_pol->add(linepol.get(linepol.size() - 1) - dir);
_pol->add(linepol.get(linepol.size() - 1) + dir);
_shape->fetch(_pol->getLocal(), sf::TriangleStrip);
}
}
|
UTILS
var u = {};
u.distance = function (p1, p2) {
var dx = p2.x - p1.x;
var dy = p2.y - p1.y;
return Math.sqrt((dx * dx) + (dy * dy));
};
u.angle = function(p1, p2) {
var dx = p2.x - p1.x;
var dy = p2.y - p1.y;
return u.degrees(Math.atan2(dy, dx));
};
u.findCoord = function(p, d, a) {
var b = {x: 0, y: 0};
a = u.radians(a);
b.x = p.x - d * Math.cos(a);
b.y = p.y - d * Math.sin(a);
return b;
};
u.radians = function(a) {
return a * (Math.PI / 180);
};
u.degrees = function(a) {
return a * (180 / Math.PI);
};
u.bindEvt = function (el, type, handler) {
if (el.addEventListener) {
el.addEventListener(type, handler, false);
} else if (el.attachEvent) {
el.attachEvent(type, handler);
}
};
u.unbindEvt = function (el, type, handler) {
if (el.removeEventListener) {
el.removeEventListener(type, handler);
} else if (el.detachEvent) {
el.detachEvent(type, handler);
}
};
u.trigger = function (el, type, data) {
var evt = new CustomEvent(type, data);
el.dispatchEvent(evt);
};
u.prepareEvent = function (evt) {
evt.preventDefault();
return isTouch ? evt.changedTouches : evt;
};
u.getScroll = function () {
var x = (window.pageXOffset !== undefined) ?
window.pageXOffset :
(document.documentElement || document.body.parentNode || document.body)
.scrollLeft;
var y = (window.pageYOffset !== undefined) ?
window.pageYOffset :
(document.documentElement || document.body.parentNode || document.body)
.scrollTop;
return {
x: x,
y: y
};
};
u.applyPosition = function (el, pos) {
if (pos.x && pos.y) {
el.style.left = pos.x + 'px';
el.style.top = pos.y + 'px';
} else if (pos.top || pos.right || pos.bottom || pos.left) {
el.style.top = pos.top;
el.style.right = pos.right;
el.style.bottom = pos.bottom;
el.style.left = pos.left;
}
};
u.getTransitionStyle = function (property, values, time) {
var obj = u.<API key>(property);
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
if (typeof values === 'string') {
obj[i] = values + ' ' + time;
} else {
var st = '';
for (var j = 0, max = values.length; j < max; j += 1) {
st += values[j] + ' ' + time + ', ';
}
obj[i] = st.slice(0, -2);
}
}
}
return obj;
};
u.getVendorStyle = function (property, value) {
var obj = u.<API key>(property);
for (var i in obj) {
if (obj.hasOwnProperty(i)) {
obj[i] = value;
}
}
return obj;
};
u.<API key> = function (prop) {
var obj = {};
obj[prop] = '';
var vendors = ['webkit', 'Moz', 'o'];
vendors.forEach(function (vendor) {
obj[vendor + prop.charAt(0).toUpperCase() + prop.slice(1)] = '';
});
return obj;
};
u.extend = function (objA, objB) {
for (var i in objB) {
if (objB.hasOwnProperty(i)) {
objA[i] = objB[i];
}
}
};
|
# coding: utf-8
unless defined?(CARDS_CONF)
File.open(File.expand_path("../../cards_config.rb", __FILE__)) { |f|
CARDS_CONF = eval(f.read())
if(CARDS_CONF.class == Hash) then f.close() end
}
end
|
package styles
import (
"github.com/alecthomas/chroma"
)
// Doom One 2 style. Inspired by Atom One and Doom Emacs's Atom One theme
var DoomOne2 = Register(chroma.MustNewStyle("doom-one2", chroma.StyleEntries{
chroma.Text: "#b0c4de",
chroma.Error: "#b0c4de",
chroma.Comment: "italic #8a93a5",
chroma.CommentHashbang: "bold",
chroma.Keyword: "#76a9f9",
chroma.KeywordConstant: "#e5c07b",
chroma.KeywordType: "#e5c07b",
chroma.Operator: "#54b1c7",
chroma.OperatorWord: "bold #b756ff",
chroma.Punctuation: "#abb2bf",
chroma.Name: "#aa89ea",
chroma.NameAttribute: "#cebc3a",
chroma.NameBuiltin: "#e5c07b",
chroma.NameClass: "#ca72ff",
chroma.NameConstant: "bold",
chroma.NameDecorator: "#e5c07b",
chroma.NameEntity: "#bda26f",
chroma.NameException: "bold #fd7474",
chroma.NameFunction: "#00b1f7",
chroma.NameProperty: "#cebc3a",
chroma.NameLabel: "#f5a40d",
chroma.NameNamespace: "#ca72ff",
chroma.NameTag: "#76a9f9",
chroma.NameVariable: "#DCAEEA",
chroma.NameVariableClass: "#DCAEEA",
chroma.NameVariableGlobal: "bold #DCAEEA",
chroma.<API key>: "#e06c75",
chroma.NameVariableMagic: "#DCAEEA",
chroma.Literal: "#98c379",
chroma.LiteralDate: "#98c379",
chroma.Number: "#d19a66",
chroma.NumberBin: "#d19a66",
chroma.NumberFloat: "#d19a66",
chroma.NumberHex: "#d19a66",
chroma.NumberInteger: "#d19a66",
chroma.NumberIntegerLong: "#d19a66",
chroma.NumberOct: "#d19a66",
chroma.String: "#98c379",
chroma.StringAffix: "#98c379",
chroma.StringBacktick: "#98c379",
chroma.StringDelimiter: "#98c379",
chroma.StringDoc: "#7e97c3",
chroma.StringDouble: "#63c381",
chroma.StringEscape: "bold #d26464",
chroma.StringHeredoc: "#98c379",
chroma.StringInterpol: "#98c379",
chroma.StringOther: "#70b33f",
chroma.StringRegex: "#56b6c2",
chroma.StringSingle: "#98c379",
chroma.StringSymbol: "#56b6c2",
chroma.Generic: "#b0c4de",
chroma.GenericDeleted: "#b0c4de",
chroma.GenericEmph: "italic",
chroma.GenericHeading: "bold #a2cbff",
chroma.GenericInserted: "#a6e22e",
chroma.GenericOutput: "#a6e22e",
chroma.GenericUnderline: "underline",
chroma.GenericPrompt: "#a6e22e",
chroma.GenericStrong: "bold",
chroma.GenericSubheading: "#a2cbff",
chroma.GenericTraceback: "#a2cbff",
chroma.Background: "#b0c4de bg:#282c34",
}))
|
#include "multi_modelstruct.h"
#include "multivar_support.h"
#include <math.h>
#include <assert.h>
#include <gsl/gsl_linalg.h>
#include <gsl/gsl_eigen.h>
#include <gsl/gsl_blas.h>
#include <gsl/gsl_errno.h>
/**
* ccs, 05.06.2012
* \todo this all needs to be checked carefully against an example that works in R
* \todo valgrind for mem-leaks
* \bug no error checking in linalg
* \bug no error checking in alloc
* \bug is there error checking in file handles?
*
* ccs, 19.06.2012
* if you allocate a multi_modelstruct m
* then m->pca_model_array[i]->xmodel == m->xmodel
* the value in the pca_model_array is just a pointer to m, do we really want this?
*/
/**
* allocates a multi_modelstruct, like alloc_modelstruct_2,
* but for multivariate models with t output values at each location
*
* @param model_in: (n x d) matrix of the design
* @param training_matrix: (n x t) matrix of the values of the training values at each of the n locations
* @param cov_fn_index: POWEREXPCOVFN, MATERN32, or MATERN52
* @param regression_order: 0, 1, 2, or 3
* @param varfrac: the minimum fractional variance that should be retained during the PCA decomp
*
* applies a pca decomp to training_matrix to reduce the dimensionality
*
*/
multi_modelstruct* <API key>(gsl_matrix *xmodel_in,
gsl_matrix *training_matrix_in,
int cov_fn_index,
int regression_order, double varfrac)
{
assert(training_matrix_in->size1 == xmodel_in->size1);
assert(training_matrix_in->size1 > 0);
assert(training_matrix_in->size2 > 0);
assert(xmodel_in->size2 > 0);
int i;
double mean_temp = 0.0;
int nt = training_matrix_in->size2;
int nmodel_points = xmodel_in->size1;
int nparams = xmodel_in->size2;
gsl_vector_view col_view;
/* use default if out of range */
if (regression_order < 0 || regression_order > 3)
regression_order = 0;
/* use a sensible default for the variance fraction */
if(varfrac < 0 || varfrac > 1)
varfrac = 0.95;
/* ntheta is a function of cov_fn_index and nparams */
int nthetas;
if ((cov_fn_index == MATERN32) || (cov_fn_index == MATERN52)) {
nthetas = 3;
} else if (cov_fn_index == POWEREXPCOVFN) {
nthetas = nparams + 2;
} else {
cov_fn_index = POWEREXPCOVFN;
nthetas = nparams + 2;
}
// this doesn't seem to be allocating correctly, seems to be a broken defn of MallocChecked
// strangely, code will build in this case...
//multi_modelstruct * model = (multi_modelstruct*)MallocChecked(sizeof(multi_modelstruct));
multi_modelstruct * model = (multi_modelstruct*)malloc(sizeof(multi_modelstruct));
// fill in
model->nt = nt;
model->nr = 0; // init at zero
model->nmodel_points = nmodel_points;
model->nparams = nparams;
model->xmodel = xmodel_in;
model->training_matrix = training_matrix_in;
model->training_mean = gsl_vector_alloc(nt);
model->regression_order = regression_order;
model->cov_fn_index = cov_fn_index;
/* fill in the mean vector, should probably sum this more carefully... */
for(i = 0; i < nt; i++){
col_view = gsl_matrix_column(model->training_matrix, i);
mean_temp = vector_elt_sum(&col_view.vector, nmodel_points);
//printf("%lf\n", (mean_temp/((double)nmodel_points)));
gsl_vector_set(model->training_mean, i, (mean_temp/((double)nmodel_points)) );
}
/* carry out the pca decomp on this model, this is defined in multivar_support for now
* this will fill in nr, pca_eigenvalues, pca_eigenvectors, pca_evals_r, pca_evecs_r
*
* this is making a mess if nt = 1
*/
gen_pca_decomp(model, varfrac);
/* fill in pca_model_array */
gen_pca_model_array(model);
return model;
}
/**
* fill in pca_model_array
* requires:
* - the pca decomp to have been calculated, so nr and all the pca_... fields are allocated and filled in
* - m to have been allocated up to: nt, nmodel_points, and xmodel
*
* is it possible we could start running out of memory doing all these allocs?
*/
void gen_pca_model_array(multi_modelstruct *m)
{
int nr = m->nr;
int i;
gsl_vector_view col_view;
gsl_vector* temp_train_vector = gsl_vector_alloc(m->nmodel_points);
//gsl_matrix* temp_xmodel = gsl_matrix_alloc(m->nmodel_points, m->nparams);
//gsl_matrix_mempcy(temp_xmodel, m->xmodel);
// alloc the array of nr model structs
//m->pca_model_array = (modelstruct**)MallocChecked(sizeof(modelstruct*)*nr);
m->pca_model_array = (modelstruct**)malloc(sizeof(modelstruct*)*nr);
// fill in the modelstructs correctly
for(i = 0; i < nr; i++){
col_view = gsl_matrix_column(m->pca_zmatrix, i);
gsl_vector_memcpy(temp_train_vector, &(col_view.vector));
// this isn't copying in the training vector correctly for somereason
m->pca_model_array[i] = alloc_modelstruct_2(m->xmodel, temp_train_vector,
m->cov_fn_index, m->regression_order);
// see if brute forcing it will work
m->pca_model_array[i]->training_vector = gsl_vector_alloc(m->nmodel_points);
gsl_vector_memcpy(m->pca_model_array[i]->training_vector, temp_train_vector);
}
gsl_vector_free(temp_train_vector);
}
/**
* carries out a pca decomp on m->training_matrix;
* setting m->nr, m->pca_eigenvalues, m->pca_eigenvectors and
* initializing m->pca_model_array
*
* the pca decomp is pretty simple:
* let Y_ij = m->y_training
* let mu_i = (1/nmodel_points) sum_{j=1}^{nmodel_points} Y_{ij} // the sample mean
* let ysub_i = Y_i - rep(mu_i,nmodel_points) //subtract the sample means from each column
* let sigma_ij = (1/nmodel_points) ( ysub * t(ysub)) // this is the covariance matrix
*
* then all we need to do is compute the eigendecomposition
*
* sigma_ij = U^{-1} Lambda U
*
* where Lambda is a diagonal matrix of t eigenvalues and U is a t x t matrix with the eigenvectors as columns
*
* requires:
* - 0 < vfrac < 1 (0.95 is a good value)
* - m to have allocated and filled out, nt, nmodel_points, trianing_matrix, (doesn't need xmodel explicitly)
*/
void gen_pca_decomp(multi_modelstruct *m, double vfrac)
{
FILE *fptr; // for debug output
int i,j;
int nt = m->nt;
int retval;
double total_variance = 0.0, frac = 0.0;
gsl_matrix *pca_zmatrix_temp;
gsl_matrix *y_sub_mat = gsl_matrix_alloc(m->nmodel_points, nt);
gsl_matrix *y_temp_mat = gsl_matrix_alloc(m->nmodel_points, nt);
gsl_matrix *y_cov_mat = gsl_matrix_alloc(nt, nt);
gsl_vector *evals_temp = gsl_vector_alloc(nt);
gsl_matrix *evecs_temp = gsl_matrix_alloc(nt,nt);
<API key> *ework = <API key>(nt);
gsl_vector_view col_view;
// why is this here?
gsl_matrix_memcpy(y_sub_mat, m->training_matrix);
// subtract out the mean
for(i = 0; i < nt; i++){
//col_view = gsl_matrix_column(y_sub_mat, i);
printf("# y(%d) mean: %lf\n", i, gsl_vector_get(m->training_mean, i));
for(j = 0; j < m->nmodel_points; j++){
gsl_matrix_set(y_sub_mat, j, i, gsl_matrix_get(y_sub_mat, j, i) - gsl_vector_get(m->training_mean, i));
}
}
// compute the sample-variance, by multiplying y_sub_mat, with itself transposed
gsl_matrix_memcpy(y_temp_mat, y_sub_mat);
gsl_matrix_set_zero(y_cov_mat);
/* want C (nt x nt ) so we need to do: (nt x nmodel_points) * (nmodel_points x nt) */
/**
* this is strange, the upper triangle is not obviously correct
*/
//retval = gsl_blas_dgemm(CblasTrans, CblasNoTrans, 1.0, y_temp_mat, y_sub_mat, 0.0, y_cov_mat);
retval = gsl_blas_dgemm(CblasTrans, CblasNoTrans, 1.0, y_sub_mat, y_temp_mat, 0.0, y_cov_mat);
if(retval){
printf("# gen_pca_decomp:gsl_blas_dgemm %s\n", gsl_strerror(retval));
exit(EXIT_FAILURE);
}
gsl_matrix_scale(y_cov_mat, (1.0/((double)m->nmodel_points)));
/**
* debug output
*/
#ifdef DEBUGPCA
fptr = fopen("pca-debug.dat","w");
fprintf(fptr, "# ycov:\n");
for(j = 0; j < nt; j++){
for(i = 0; i < nt; i++)
fprintf(fptr, "%lf ", gsl_matrix_get(y_cov_mat, i, j));
fprintf(fptr, "\n");
}
#endif
gsl_eigen_symmv(y_cov_mat, evals_temp, evecs_temp, ework);
<API key>(evals_temp, evecs_temp, <API key>);
/**
* eigenvectors are stored in columns of pca_evecs*/
total_variance = vector_elt_sum(evals_temp, nt);
#ifdef DEBUGPCA
fprintf(fptr, "# evals:\n");
for(i = 0; i < nt; i++)
fprintf(fptr, "%lf %lf\n", gsl_vector_get(evals_temp, i), gsl_vector_get(evals_temp, i) / total_variance);
fprintf(fptr, "# evecs:\n");
for(j = 0; j < nt; j++){
for(i = 0; i < nt; i++)
fprintf(fptr, "%lf ", gsl_matrix_get(evecs_temp, i, j));
fprintf(fptr, "\n");
}
#endif
i=0;
while( frac < vfrac && (i+1) < nt){
frac = (1.0/total_variance) * vector_elt_sum(evals_temp, i);
i++;
}
m->nr = i;
if(nt == 1){
//printf("# 1d case, nr=1\n");
m->nr = 1;
}
m->pca_evals_r = gsl_vector_alloc(m->nr);
m->pca_evecs_r = gsl_matrix_alloc(m->nt, m->nr);
// debug...
fprintf(stderr, "# nr: %d frac: %lf\n", m->nr, frac);
for(i = 0; i < m->nr; i++){
gsl_vector_set(m->pca_evals_r, i, gsl_vector_get(evals_temp, i));
col_view = gsl_matrix_column(evecs_temp, i);
gsl_matrix_set_col(m->pca_evecs_r, i, &col_view.vector);
}
// fill in pca_zmatrix
m->pca_zmatrix = gsl_matrix_alloc(m->nmodel_points, m->nr);
pca_zmatrix_temp = gsl_matrix_alloc(m->nmodel_points, m->nr);
// zmat: (nmodel_points x nr) = (nmodel_points x nt) * ( nt x nr )
gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, y_sub_mat, m->pca_evecs_r, 0.0, m->pca_zmatrix);
#ifdef DEBUGPCA
fprintf(fptr, "# evecs R:\n");
for(i = 0; i < m->nt; i++){
for(j = 0; j < m->nr; j++)
fprintf(fptr, "%lf ", gsl_matrix_get(m->pca_evecs_r, i, j));
fprintf(fptr, "\n");
}
#endif
gsl_matrix_free(y_temp_mat);
y_temp_mat = gsl_matrix_alloc(m->nr, m->nr);
for(i = 0; i < m->nr; i++) // scale the diagonal by the evalue */
gsl_matrix_set(y_temp_mat, i, i, 1.0/(sqrt(gsl_vector_get(m->pca_evals_r, i))));
//print_matrix(y_temp_mat, m->nr, m->nr);
// if nr != nt this won't work!
//gsl_matrix_memcpy(y_sub_mat, m->pca_zmatrix);
gsl_matrix_memcpy(pca_zmatrix_temp, m->pca_zmatrix);
gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, pca_zmatrix_temp, y_temp_mat, 0.0, m->pca_zmatrix);
#ifdef DEBUGPCA
fprintf(fptr, "# zmat:\n");
for(i = 0; i < 5; i++){
for(j = 0; j < m->nr; j++)
fprintf(fptr, "%lf ", gsl_matrix_get(m->pca_zmatrix, i, j));
fprintf(fptr, "\n");
}
fclose(fptr);
#endif
gsl_vector_free(evals_temp);
gsl_matrix_free(evecs_temp);
gsl_matrix_free(pca_zmatrix_temp);
<API key>(ework);
gsl_matrix_free(y_sub_mat);
gsl_matrix_free(y_temp_mat);
gsl_matrix_free(y_cov_mat);
}
/**
* dump the multimodelstruct to fptr, follows from dump_modelstruct_2
* we first dump the new fields and then iterate through the nr additional models which are dumped as before
* so we dump a lot of the same info, but this is probably ok, the advantage is that each section defining
* a model can be pulled out and worked on separately...
*/
void <API key>(FILE* fptr, multi_modelstruct *m){
assert(fptr);
int i,j;
int nt = m->nt;
int nr = m->nr;
int nparams = m->nparams;
int nmodel_points = m->nmodel_points;
int cov_fn_index = m->cov_fn_index;
int regression_order = m->regression_order;
fprintf(fptr, "%d\n", nt);
fprintf(fptr, "%d\n", nr);
fprintf(fptr, "%d\n", nparams);
fprintf(fptr, "%d\n", nmodel_points);
fprintf(fptr, "%d\n", cov_fn_index);
fprintf(fptr, "%d\n", regression_order);
// multimodel thetas are inside pca_model_array...
for(i = 0; i < nmodel_points; i++){
for(j = 0; j < nparams; j++)
fprintf(fptr, "%.17lf ", gsl_matrix_get(m->xmodel, i, j));
fprintf(fptr, "\n");
}
for(i = 0; i < nmodel_points; i++){
for(j = 0; j < nt; j++)
fprintf(fptr, "%.17lf ", gsl_matrix_get(m->training_matrix, i, j));
fprintf(fptr, "\n");
}
// now the rest of the pca information
for(i = 0; i < nr; i++)
fprintf(fptr, "%.17lf ", gsl_vector_get(m->pca_evals_r, i));
fprintf(fptr, "\n");
for(i = 0; i < nt; i++){
for(j = 0; j < nr; j++)
fprintf(fptr, "%.17lf ", gsl_matrix_get(m->pca_evecs_r, i, j));
fprintf(fptr, "\n");
}
for(i = 0; i < nmodel_points; i++){
for(j = 0; j < nr; j++)
fprintf(fptr, "%.17lf ", gsl_matrix_get(m->pca_zmatrix, i, j));
fprintf(fptr, "\n");
}
// now the pca_model_array
// these could go in separate files...
for(i = 0; i < nr; i++){
dump_modelstruct_2(fptr, m->pca_model_array[i]);
}
}
/**
* loads a multivariate modelstructure from fptr
*/
multi_modelstruct *<API key>(FILE* fptr){
multi_modelstruct *m = (multi_modelstruct*)malloc(sizeof(multi_modelstruct));
int i,j;
int nt, nr;
int nparams, nmodel_points;
int cov_fn_index;
int regression_order;
double mean_temp;
gsl_vector_view col_view;
fscanf(fptr, "%d%*c", & nt);
fscanf(fptr, "%d%*c", & nr);
fscanf(fptr, "%d%*c", & nparams);
fscanf(fptr, "%d%*c", & nmodel_points);
fscanf(fptr, "%d%*c", & cov_fn_index);
fscanf(fptr, "%d%*c", & regression_order);
m->nt = nt;
m->nr = nr;
m->nparams = nparams;
m->nmodel_points = nmodel_points;
m->cov_fn_index = cov_fn_index;
m->regression_order = regression_order;
// now we can allocate everything in m
m->xmodel = gsl_matrix_alloc(nmodel_points, nparams);
m->training_matrix = gsl_matrix_alloc(nmodel_points, nt);
m->training_mean = gsl_vector_alloc(nt); // do we need this? (yes!)
m->pca_model_array = (modelstruct**)malloc(sizeof(modelstruct*)*nr);
m->pca_evals_r = gsl_vector_alloc(nr);
m->pca_evecs_r = gsl_matrix_alloc(nt, nr);
m->pca_zmatrix = gsl_matrix_alloc(nmodel_points, nr);
for(i = 0; i < nmodel_points; i++)
for(j = 0; j < nparams; j++)
fscanf(fptr, "%lf%*c", gsl_matrix_ptr(m->xmodel, i, j));
for(i = 0; i < nmodel_points; i++)
for(j = 0; j < nt; j++)
fscanf(fptr, "%lf%*c", gsl_matrix_ptr(m->training_matrix, i, j));
// now the rest of the pca information
for(i = 0; i < nr; i++)
fscanf(fptr, "%lf%*c", gsl_vector_ptr(m->pca_evals_r, i));
for(i = 0; i < nt; i++)
for(j = 0; j < nr; j++)
fscanf(fptr, "%lf%*c", gsl_matrix_ptr(m->pca_evecs_r, i, j));
for(i = 0; i < nmodel_points; i++)
for(j = 0; j < nr; j++)
fscanf(fptr, "%lf%*c", gsl_matrix_ptr(m->pca_zmatrix, i, j));
for(i = 0; i < nr; i++)
m->pca_model_array[i] = load_modelstruct_2(fptr);
/* fill in the mean vector */
for(i = 0; i < nt; i++){
col_view = gsl_matrix_column(m->training_matrix, i);
mean_temp = vector_elt_sum(&col_view.vector, nmodel_points);
gsl_vector_set(m->training_mean, i, (mean_temp/((double)nmodel_points)) );
}
return m;
}
/**
* return the sum of the elements of vec from 0:nstop
*/
double vector_elt_sum(gsl_vector* vec, int nstop)
{
assert(nstop >= 0);
assert((unsigned)nstop <= vec->size);
int i;
double sum = 0.0;
for(i = 0; i < nstop; i++){
sum += gsl_vector_get(vec, i);
}
return(sum);
}
/**
* this free's everything in m
*/
void <API key>(multi_modelstruct *m)
{
int i;
gsl_vector_free(m->training_mean);
for(i = 0; i < m->nr; i++){
free_modelstruct_2(m->pca_model_array[i]);
//gsl_matrix_free(m->pca_model_array[i]->xmodel);
}
free(m->pca_model_array);
gsl_matrix_free(m->xmodel);
gsl_matrix_free(m->training_matrix);
gsl_vector_free(m->pca_evals_r);
gsl_matrix_free(m->pca_evecs_r);
gsl_matrix_free(m->pca_zmatrix);
}
|
const core = require('brigadehub-core')
var pkg = require('./package.json')
var brigade = require('./brigade')()[0]
const bhConfig = {
dotenv: require('./dotenv')(),
info: '[Brigadehub]',
version: pkg.version,
brigade: brigade
}
core(bhConfig)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.