text
stringlengths 2
1.04M
| meta
dict |
---|---|
package com.microsoft.azure.management.kusto.v2018_09_07_preview;
import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;
/**
* Defines values for DatabasePrincipalType.
*/
public final class DatabasePrincipalType extends ExpandableStringEnum<DatabasePrincipalType> {
/** Static value App for DatabasePrincipalType. */
public static final DatabasePrincipalType APP = fromString("App");
/** Static value Group for DatabasePrincipalType. */
public static final DatabasePrincipalType GROUP = fromString("Group");
/** Static value User for DatabasePrincipalType. */
public static final DatabasePrincipalType USER = fromString("User");
/**
* Creates or finds a DatabasePrincipalType from its string representation.
* @param name a name to look for
* @return the corresponding DatabasePrincipalType
*/
@JsonCreator
public static DatabasePrincipalType fromString(String name) {
return fromString(name, DatabasePrincipalType.class);
}
/**
* @return known DatabasePrincipalType values
*/
public static Collection<DatabasePrincipalType> values() {
return values(DatabasePrincipalType.class);
}
}
| {
"content_hash": "0b43bd1092ead67fa1eb14f60b8911c2",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 94,
"avg_line_length": 33.36842105263158,
"alnum_prop": 0.7397476340694006,
"repo_name": "selvasingh/azure-sdk-for-java",
"id": "2477ecb6acd9a62d5dd40ae6261e66f18bc5a9a6",
"size": "1498",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sdk/kusto/mgmt-v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/DatabasePrincipalType.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Java",
"bytes": "29891970"
},
{
"name": "JavaScript",
"bytes": "6198"
},
{
"name": "PowerShell",
"bytes": "160"
},
{
"name": "Shell",
"bytes": "609"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Lecidea crystalligera Zahlbr.
### Remarks
null | {
"content_hash": "4119f8c7bdd4933a75333beffe2efca2",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 29,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.7164179104477612,
"repo_name": "mdoering/backbone",
"id": "004c5fe5e234476881cf245816246274c11d8b02",
"size": "187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Lecanoromycetes/Lecanorales/Lecideaceae/Lecidea/Lecidea crystalligera/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<?php
/**
* @author Bilal Cinarli
* @link http://bcinarli.com
**/
class misto
{
public function __construct()
{
new url();
new router();
new device();
//ini_set('session.cookie_domain', '.' . url::getPlainHost());
session_start();
if (Authentication === true) {
$this->force_directory_authentication();
}
if (role::is_404() === true) {
header("HTTP/1.0 404 Not Found");
}
tools::inc(router::getRoute(), '', 'require_once');
}
public function force_directory_authentication()
{
if (empty($_SESSION['auth_user']) || $_SESSION['auth_user'] !== true) {
if (empty($_SERVER['PHP_AUTH_USER'])) {
header('WWW-Authenticate: Basic realm="' . Realm . '"');
header('HTTP/1.0 401 Unauthorized');
die('Website access is password protected!');
}
if (sha1($_SERVER['PHP_AUTH_PW']) != Authentication_Pass && $_SERVER['PHP_AUTH_USER'] != Authentication_User) {
die('Wrong Credentials!');
} else {
$_SESSION['auth_user'] = true;
}
}
}
} | {
"content_hash": "3e8ec580ade2790c348b2d168fe54d67",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 114,
"avg_line_length": 21.717391304347824,
"alnum_prop": 0.5935935935935935,
"repo_name": "bcinarli/caffeine.melange.io",
"id": "2eac3a5d44cd89cb753e40387e07b651ea666a8b",
"size": "999",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "misto/misto.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ApacheConf",
"bytes": "2269"
},
{
"name": "PHP",
"bytes": "37036"
}
],
"symlink_target": ""
} |
package org.ligboy.android.utils.demo;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.AppCompatTextView;
import android.support.v7.widget.Toolbar;
import org.ligboy.android.utils.LogUtil;
import org.ligboy.android.utils.TimeUtils;
public class MainActivity extends AppCompatActivity {
private static final String TAG = LogUtil.makeLogTag(MainActivity.class);
private AppCompatTextView mTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
mTextView = (AppCompatTextView) findViewById(R.id.textView);
LogUtil.d(TAG, "onCreate");
mTextView.setText(TimeUtils.formatDuration(this, 1951674000L));
}
}
| {
"content_hash": "b4d90b0d8152b00a31583245bf3cd61e",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 77,
"avg_line_length": 36.76,
"alnum_prop": 0.7551686615886833,
"repo_name": "ligboy/android-utils",
"id": "3fcdfb10663c8fe848daf6b060eabf8795f0fd05",
"size": "919",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/org/ligboy/android/utils/demo/MainActivity.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "46101"
}
],
"symlink_target": ""
} |
<?php
// Heading
$_['heading_title'] = 'LIQPAY CHECKOUT';
// Text
$_['text_payment'] = 'Payment';
$_['text_success'] = 'Success: You have modified LIQPAY account details!';
$_['text_edit'] = 'Edit LIQPAY';
$_['text_pay'] = 'LIQPAY';
$_['text_card'] = 'Credit Card';
$_['text_liqpay'] = '<img src="view/image/payment/liqpay.png" alt="LIQPAY" title="LIQPAY" style="border: 1px solid #EEEEEE;" />';
// Entry
$_['entry_public_key'] = 'Public Key';
$_['entry_private_key'] = 'Private Key';
$_['entry_api'] = 'https://www.liqpay.ua/api/3/checkout';
$_['entry_action'] = 'pay';
$_['entry_type'] = 'Type';
$_['entry_total'] = 'Total';
$_['entry_order_status'] = 'Order Status';
$_['entry_geo_zone'] = 'Geo Zone';
$_['entry_status'] = 'Status';
$_['entry_sort_order'] = 'Sort Order';
// Help
$_['help_total'] = 'The checkout total the order must reach before this payment method becomes active.';
// Error
$_['error_permission'] = 'Warning: You do not have permission to modify payment LIQPAY!';
$_['error_public_key'] = 'Public Key Required!';
$_['error_private_key'] = 'Private Key Required!';
$_['error_api'] = 'API Required!';
$_['error_action'] = 'Action Required!'; | {
"content_hash": "ce86f691af8c4a43a72308007d13720b",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 131,
"avg_line_length": 38.303030303030305,
"alnum_prop": 0.571993670886076,
"repo_name": "liqpay/plugin-opencart",
"id": "1cd590cd21ac1e416d6b7abe353f4ee3709c45b7",
"size": "1264",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "admin/language/en-gb/extension/payment/liqpay_checkout.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "35136"
},
{
"name": "Smarty",
"bytes": "18853"
}
],
"symlink_target": ""
} |
#ifndef GUIUTIL_H
#define GUIUTIL_H
#include <QString>
#include <QObject>
#include <QMessageBox>
QT_BEGIN_NAMESPACE
class QFont;
class QLineEdit;
class QWidget;
class QDateTime;
class QUrl;
class QAbstractItemView;
QT_END_NAMESPACE
class SendCoinsRecipient;
/** Utility functions used by the Bitcoin Qt UI.
*/
namespace GUIUtil
{
// Create human-readable string from date
QString dateTimeStr(const QDateTime &datetime);
QString dateTimeStr(qint64 nTime);
// Render Bitcoin addresses in monospace font
QFont bitcoinAddressFont();
// Set up widgets for address and amounts
void setupAddressWidget(QLineEdit *widget, QWidget *parent);
void setupAmountWidget(QLineEdit *widget, QWidget *parent);
// Parse "bitcoin:" URI into recipient object, return true on successful parsing
// See Bitcoin URI definition discussion here: https://bitcointalk.org/index.php?topic=33490.0
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out);
bool parseBitcoinURI(QString uri, SendCoinsRecipient *out);
// HTML escaping for rich text controls
QString HtmlEscape(const QString& str, bool fMultiLine=false);
QString HtmlEscape(const std::string& str, bool fMultiLine=false);
/** Copy a field of the currently selected entry of a view to the clipboard. Does nothing if nothing
is selected.
@param[in] column Data column to extract from the model
@param[in] role Data role to extract from the model
@see TransactionView::copyLabel, TransactionView::copyAmount, TransactionView::copyAddress
*/
void copyEntryData(QAbstractItemView *view, int column, int role=Qt::EditRole);
/** Get save filename, mimics QFileDialog::getSaveFileName, except that it appends a default suffix
when no suffix is provided by the user.
@param[in] parent Parent window (or 0)
@param[in] caption Window caption (or empty, for default)
@param[in] dir Starting directory (or empty, to default to documents directory)
@param[in] filter Filter specification such as "Comma Separated Files (*.csv)"
@param[out] selectedSuffixOut Pointer to return the suffix (file type) that was selected (or 0).
Can be useful when choosing the save file format based on suffix.
*/
QString getSaveFileName(QWidget *parent=0, const QString &caption=QString(),
const QString &dir=QString(), const QString &filter=QString(),
QString *selectedSuffixOut=0);
/** Get connection type to call object slot in GUI thread with invokeMethod. The call will be blocking.
@returns If called from the GUI thread, return a Qt::DirectConnection.
If called from another thread, return a Qt::BlockingQueuedConnection.
*/
Qt::ConnectionType blockingGUIThreadConnection();
// Determine whether a widget is hidden behind other windows
bool isObscured(QWidget *w);
// Open debug.log
void openDebugLogfile();
/** Qt event filter that intercepts ToolTipChange events, and replaces the tooltip with a rich text
representation if needed. This assures that Qt can word-wrap long tooltip messages.
Tooltips longer than the provided size threshold (in characters) are wrapped.
*/
class ToolTipToRichTextFilter : public QObject
{
Q_OBJECT
public:
explicit ToolTipToRichTextFilter(int size_threshold, QObject *parent = 0);
protected:
bool eventFilter(QObject *obj, QEvent *evt);
private:
int size_threshold;
};
bool GetStartOnSystemStartup();
bool SetStartOnSystemStartup(bool fAutoStart);
/** Help message for Bitcoin-Qt, shown with --help. */
class HelpMessageBox : public QMessageBox
{
Q_OBJECT
public:
HelpMessageBox(QWidget *parent = 0);
/** Show message box or print help message to standard output, based on operating system. */
void showOrPrint();
/** Print help message to console */
void printToConsole();
private:
QString header;
QString coreOptions;
QString uiOptions;
};
} // namespace GUIUtil
#endif // GUIUTIL_H
| {
"content_hash": "659e6b5ba0a95da7ac5198a7015e090b",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 107,
"avg_line_length": 35.082644628099175,
"alnum_prop": 0.6918727915194346,
"repo_name": "MK2015/XQCoin",
"id": "f50085ef6e83f9f691757d6643bacbfae4ac7c3f",
"size": "4245",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/qt/guiutil.h",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "61562"
},
{
"name": "C",
"bytes": "7301"
},
{
"name": "C++",
"bytes": "1856791"
},
{
"name": "Makefile",
"bytes": "17837"
},
{
"name": "Objective-C",
"bytes": "858"
},
{
"name": "Objective-C++",
"bytes": "3537"
},
{
"name": "Python",
"bytes": "41580"
},
{
"name": "Shell",
"bytes": "1632"
}
],
"symlink_target": ""
} |
<?php
namespace Google\Service\HangoutsChat;
class OpenLink extends \Google\Model
{
/**
* @var string
*/
public $url;
/**
* @param string
*/
public function setUrl($url)
{
$this->url = $url;
}
/**
* @return string
*/
public function getUrl()
{
return $this->url;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(OpenLink::class, 'Google_Service_HangoutsChat_OpenLink');
| {
"content_hash": "91dc8d2046cdc91d46431dd8a4e4cb0d",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 81,
"avg_line_length": 15.666666666666666,
"alnum_prop": 0.6319148936170212,
"repo_name": "googleapis/google-api-php-client-services",
"id": "b8c3c9e2c821283778a6820a23786d70d9211bbe",
"size": "1060",
"binary": false,
"copies": "6",
"ref": "refs/heads/main",
"path": "src/HangoutsChat/OpenLink.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "55414116"
},
{
"name": "Python",
"bytes": "427325"
},
{
"name": "Shell",
"bytes": "787"
}
],
"symlink_target": ""
} |
package io.crate.operation.reference.doc.lucene;
import io.crate.exceptions.UnhandledServerException;
import io.crate.exceptions.UnsupportedFeatureException;
import io.crate.metadata.ReferenceInfo;
import io.crate.operation.reference.ReferenceResolver;
import io.crate.planner.RowGranularity;
import io.crate.types.*;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.index.mapper.MapperService;
public class LuceneReferenceResolver implements ReferenceResolver<LuceneCollectorExpression<?>> {
private final @Nullable MapperService mapperService;
private final static NullValueCollectorExpression NULL_COLLECTOR_EXPRESSION = new NullValueCollectorExpression();
public LuceneReferenceResolver(@Nullable MapperService mapperService) {
this.mapperService = mapperService;
}
@Override
public LuceneCollectorExpression<?> getImplementation(ReferenceInfo refInfo) {
assert refInfo.granularity() == RowGranularity.DOC;
if (RawCollectorExpression.COLUMN_NAME.equals(refInfo.ident().columnIdent().name())){
if (refInfo.ident().columnIdent().isColumn()){
return new RawCollectorExpression();
} else {
// TODO: implement an Object source expression which may support subscripts
throw new UnsupportedFeatureException(
String.format("_source expression does not support subscripts %s",
refInfo.ident().columnIdent().fqn()));
}
} else if (IdCollectorExpression.COLUMN_NAME.equals(refInfo.ident().columnIdent().name())) {
return new IdCollectorExpression();
} else if (DocCollectorExpression.COLUMN_NAME.equals(refInfo.ident().columnIdent().name())) {
return DocCollectorExpression.create(refInfo);
} else if (DocIdCollectorExpression.COLUMN_NAME.equals(refInfo.ident().columnIdent().name())) {
return new DocIdCollectorExpression();
} else if (ScoreCollectorExpression.COLUMN_NAME.equals(refInfo.ident().columnIdent().name())) {
return new ScoreCollectorExpression();
}
String colName = refInfo.ident().columnIdent().fqn();
if (this.mapperService != null && mapperService.smartNameFieldMapper(colName) == null) {
return NULL_COLLECTOR_EXPRESSION;
}
switch (refInfo.type().id()) {
case ByteType.ID:
return new ByteColumnReference(colName);
case ShortType.ID:
return new ShortColumnReference(colName);
case IpType.ID:
return new IpColumnReference(colName);
case StringType.ID:
return new BytesRefColumnReference(colName);
case DoubleType.ID:
return new DoubleColumnReference(colName);
case BooleanType.ID:
return new BooleanColumnReference(colName);
case ObjectType.ID:
return new ObjectColumnReference(colName);
case FloatType.ID:
return new FloatColumnReference(colName);
case LongType.ID:
case TimestampType.ID:
return new LongColumnReference(colName);
case IntegerType.ID:
return new IntegerColumnReference(colName);
case GeoPointType.ID:
return new GeoPointColumnReference(colName);
default:
throw new UnhandledServerException(String.format("unsupported type '%s'", refInfo.type().getName()));
}
}
private static class NullValueCollectorExpression extends LuceneCollectorExpression<Void> {
@Override
public Void value() {
return null;
}
}
}
| {
"content_hash": "6864aec5bb1ff265fe1699fbf010af05",
"timestamp": "",
"source": "github",
"line_count": 88,
"max_line_length": 117,
"avg_line_length": 42.90909090909091,
"alnum_prop": 0.6559851694915254,
"repo_name": "gmrodrigues/crate",
"id": "6ee6ee88bbc30b84129d57f7b47737d4b7d8f2d5",
"size": "4795",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "sql/src/main/java/io/crate/operation/reference/doc/lucene/LuceneReferenceResolver.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "2809"
},
{
"name": "GAP",
"bytes": "71101"
},
{
"name": "Java",
"bytes": "7834014"
},
{
"name": "Python",
"bytes": "5286"
},
{
"name": "Shell",
"bytes": "11354"
}
],
"symlink_target": ""
} |
package com.projeto.tarefas;
import java.io.Serializable;
import javax.enterprise.context.SessionScoped;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Named;
@Named("login")
@SessionScoped
public class Login implements Serializable {
String userName = "";
String password = "";
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String logar(){
if ("teste".equalsIgnoreCase(userName)){
return "home";
} else {
FacesMessage message = new FacesMessage("Invalid user/pass");
FacesContext.getCurrentInstance().addMessage(null, message);
return "";
}
}
}
| {
"content_hash": "a5799a3bc762b6aec1f2c6bca47fbe79",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 64,
"avg_line_length": 20.30952380952381,
"alnum_prop": 0.7338804220398594,
"repo_name": "luiscoms/ToDoList",
"id": "1100e5bae19b73489ad86dfe9b3149a96f3c1b47",
"size": "853",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/com/projeto/tarefas/Login.java",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "7483"
},
{
"name": "Java",
"bytes": "5116"
},
{
"name": "JavaScript",
"bytes": "1344"
},
{
"name": "Perl",
"bytes": "1858"
}
],
"symlink_target": ""
} |
package org.apache.kylin.rest.service;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DatabaseMetaData;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
import java.sql.Time;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.sql.DataSource;
import net.hydromatic.avatica.ColumnMetaData.Rep;
import org.apache.commons.io.IOUtils;
import org.apache.hadoop.hbase.client.Get;
import org.apache.hadoop.hbase.client.HTableInterface;
import org.apache.hadoop.hbase.client.Put;
import org.apache.hadoop.hbase.client.Result;
import org.apache.kylin.common.util.Bytes;
import org.apache.kylin.rest.constant.Constant;
import org.apache.kylin.rest.metrics.QueryMetrics;
import org.apache.kylin.rest.model.ColumnMeta;
import org.apache.kylin.rest.model.Query;
import org.apache.kylin.rest.model.SelectedColumnMeta;
import org.apache.kylin.rest.model.TableMeta;
import org.apache.kylin.rest.request.PrepareSqlRequest;
import org.apache.kylin.rest.request.SQLRequest;
import org.apache.kylin.rest.response.SQLResponse;
import org.apache.kylin.rest.util.QueryUtil;
import org.apache.kylin.rest.util.Serializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.apache.kylin.common.KylinConfig;
import org.apache.kylin.common.persistence.HBaseConnection;
import org.apache.kylin.cube.CubeInstance;
import org.apache.kylin.cube.CubeManager;
import org.apache.kylin.cube.cuboid.Cuboid;
import org.apache.kylin.query.relnode.OLAPContext;
/**
* @author xduo
*/
@Component("queryService")
public class QueryService extends BasicService {
private static final Logger logger = LoggerFactory.getLogger(QueryService.class);
public static final String USER_QUERY_FAMILY = "q";
private Serializer<Query[]> querySerializer = new Serializer<Query[]>(Query[].class);
private static final String DEFAULT_TABLE_PREFIX = "kylin_metadata";
private static final String USER_TABLE_NAME = "_user";
private static final String USER_QUERY_COLUMN = "c";
private String hbaseUrl = null;
private String tableNameBase = null;
private String userTableName = null;
public QueryService() {
String metadataUrl = KylinConfig.getInstanceFromEnv().getMetadataUrl();
// split TABLE@HBASE_URL
int cut = metadataUrl.indexOf('@');
tableNameBase = cut < 0 ? DEFAULT_TABLE_PREFIX : metadataUrl.substring(0, cut);
hbaseUrl = cut < 0 ? metadataUrl : metadataUrl.substring(cut + 1);
userTableName = tableNameBase + USER_TABLE_NAME;
}
public List<TableMeta> getMetadata(String project) throws SQLException {
return getMetadata(getCubeManager(), project, true);
}
public SQLResponse query(SQLRequest sqlRequest) throws Exception {
SQLResponse fakeResponse = QueryUtil.tableauIntercept(sqlRequest.getSql());
if (null != fakeResponse) {
logger.debug("Return fake response, is exception? " + fakeResponse.getIsException());
return fakeResponse;
}
String correctedSql = QueryUtil.healSickSql(sqlRequest.getSql());
if (correctedSql.equals(sqlRequest.getSql()) == false)
logger.debug("The corrected query: " + correctedSql);
return executeQuery(correctedSql, sqlRequest);
}
public void saveQuery(final String creator, final Query query) throws IOException {
List<Query> queries = getQueries(creator);
queries.add(query);
Query[] queryArray = new Query[queries.size()];
byte[] bytes = querySerializer.serialize(queries.toArray(queryArray));
HTableInterface htable = null;
try {
htable = HBaseConnection.get(hbaseUrl).getTable(userTableName);
Put put = new Put(Bytes.toBytes(creator));
put.add(Bytes.toBytes(USER_QUERY_FAMILY), Bytes.toBytes(USER_QUERY_COLUMN), bytes);
htable.put(put);
htable.flushCommits();
} finally {
IOUtils.closeQuietly(htable);
}
}
public void removeQuery(final String creator, final String id) throws IOException {
List<Query> queries = getQueries(creator);
Iterator<Query> queryIter = queries.iterator();
boolean changed = false;
while (queryIter.hasNext()) {
Query temp = queryIter.next();
if (temp.getId().equals(id)) {
queryIter.remove();
changed = true;
break;
}
}
if (!changed) {
return;
}
Query[] queryArray = new Query[queries.size()];
byte[] bytes = querySerializer.serialize(queries.toArray(queryArray));
HTableInterface htable = null;
try {
htable = HBaseConnection.get(hbaseUrl).getTable(userTableName);
Put put = new Put(Bytes.toBytes(creator));
put.add(Bytes.toBytes(USER_QUERY_FAMILY), Bytes.toBytes(USER_QUERY_COLUMN), bytes);
htable.put(put);
htable.flushCommits();
} finally {
IOUtils.closeQuietly(htable);
}
}
public List<Query> getQueries(final String creator) throws IOException {
if (null == creator) {
return null;
}
List<Query> queries = new ArrayList<Query>();
HTableInterface htable = null;
try {
htable = HBaseConnection.get(hbaseUrl).getTable(userTableName);
Get get = new Get(Bytes.toBytes(creator));
get.addFamily(Bytes.toBytes(USER_QUERY_FAMILY));
Result result = htable.get(get);
Query[] query = querySerializer.deserialize(result.getValue(Bytes.toBytes(USER_QUERY_FAMILY), Bytes.toBytes(USER_QUERY_COLUMN)));
if (null != query) {
queries.addAll(Arrays.asList(query));
}
} finally {
IOUtils.closeQuietly(htable);
}
return queries;
}
public void logQuery(final SQLRequest request, final SQLResponse response, final Date startTime, final Date endTime) {
final String user = SecurityContextHolder.getContext().getAuthentication().getName();
final Set<String> realizationNames = new HashSet<String>();
final Set<Long> cuboidIds = new HashSet<Long>();
long totalScanCount = 0;
float duration = (endTime.getTime() - startTime.getTime()) / (float) 1000;
if (!response.isHitCache() && null != OLAPContext.getThreadLocalContexts()) {
for (OLAPContext ctx : OLAPContext.getThreadLocalContexts()) {
Cuboid cuboid = ctx.storageContext.getCuboid();
if (cuboid != null) {
//Some queries do not involve cuboid, e.g. lookup table query
cuboidIds.add(cuboid.getId());
}
if (ctx.realization != null) {
String realizationName = ctx.realization.getName();
realizationNames.add(realizationName);
}
totalScanCount += ctx.storageContext.getTotalScanCount();
}
}
int resultRowCount = 0;
if (!response.getIsException() && response.getResults() != null) {
resultRowCount = response.getResults().size();
}
QueryMetrics.getInstance().increase("duration", duration);
QueryMetrics.getInstance().increase("totalScanCount", (float) totalScanCount);
QueryMetrics.getInstance().increase("count", (float) 1);
String newLine = System.getProperty("line.separator");
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(newLine);
stringBuilder.append("==========================[QUERY]===============================").append(newLine);
stringBuilder.append("SQL: ").append(request.getSql()).append(newLine);
stringBuilder.append("User: ").append(user).append(newLine);
stringBuilder.append("Success: ").append((null == response.getExceptionMessage())).append(newLine);
stringBuilder.append("Duration: ").append(duration).append(newLine);
stringBuilder.append("Project: ").append(request.getProject()).append(newLine);
stringBuilder.append("Realization Names: ").append(realizationNames).append(newLine);
stringBuilder.append("Cuboid Ids: ").append(cuboidIds).append(newLine);
stringBuilder.append("Total scan count: ").append(totalScanCount).append(newLine);
stringBuilder.append("Result row count: ").append(resultRowCount).append(newLine);
stringBuilder.append("Accept Partial: ").append(request.isAcceptPartial()).append(newLine);
stringBuilder.append("Is Partial Result: ").append(response.isPartial()).append(newLine);
stringBuilder.append("Hit Cache: ").append(response.isHitCache()).append(newLine);
stringBuilder.append("Message: ").append(response.getExceptionMessage()).append(newLine);
stringBuilder.append("==========================[QUERY]===============================").append(newLine);
logger.info(stringBuilder.toString());
}
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN + " or hasPermission(#cube, 'ADMINISTRATION') or hasPermission(#cube, 'MANAGEMENT')" + " or hasPermission(#cube, 'OPERATION') or hasPermission(#cube, 'READ')")
public void checkAuthorization(CubeInstance cube) throws AccessDeniedException {
}
protected SQLResponse executeQuery(String sql, SQLRequest sqlRequest) throws Exception {
sql = sql.trim().replace(";", "");
int limit = sqlRequest.getLimit();
if (limit > 0 && !sql.toLowerCase().contains("limit")) {
sql += (" LIMIT " + limit);
}
int offset = sqlRequest.getOffset();
if (offset > 0 && !sql.toLowerCase().contains("offset")) {
sql += (" OFFSET " + offset);
}
// add extra parameters into olap context, like acceptPartial
Map<String, String> parameters = new HashMap<String, String>();
parameters.put(OLAPContext.PRM_ACCEPT_PARTIAL_RESULT, String.valueOf(sqlRequest.isAcceptPartial()));
OLAPContext.setParameters(parameters);
return execute(sql, sqlRequest);
}
protected List<TableMeta> getMetadata(CubeManager cubeMgr, String project, boolean cubedOnly) throws SQLException {
Connection conn = null;
ResultSet columnMeta = null;
List<TableMeta> tableMetas = null;
try {
DataSource dataSource = getOLAPDataSource(project);
conn = dataSource.getConnection();
DatabaseMetaData metaData = conn.getMetaData();
logger.debug("getting table metas");
ResultSet JDBCTableMeta = metaData.getTables(null, null, null, null);
tableMetas = new LinkedList<TableMeta>();
Map<String, TableMeta> tableMap = new HashMap<String, TableMeta>();
while (JDBCTableMeta.next()) {
String catalogName = JDBCTableMeta.getString(1);
String schemaName = JDBCTableMeta.getString(2);
// Not every JDBC data provider offers full 10 columns, e.g., PostgreSQL has only 5
TableMeta tblMeta = new TableMeta(catalogName == null ? Constant.FakeCatalogName : catalogName, schemaName == null ? Constant.FakeSchemaName : schemaName, JDBCTableMeta.getString(3), JDBCTableMeta.getString(4), JDBCTableMeta.getString(5), null, null, null, null, null);
if (!cubedOnly || getProjectManager().isExposedTable(project, schemaName + "." + tblMeta.getTABLE_NAME())) {
tableMetas.add(tblMeta);
tableMap.put(tblMeta.getTABLE_SCHEM() + "#" + tblMeta.getTABLE_NAME(), tblMeta);
}
}
logger.debug("getting column metas");
columnMeta = metaData.getColumns(null, null, null, null);
while (columnMeta.next()) {
String catalogName = columnMeta.getString(1);
String schemaName = columnMeta.getString(2);
// kylin(optiq) is not strictly following JDBC specification
ColumnMeta colmnMeta = new ColumnMeta(catalogName == null ? Constant.FakeCatalogName : catalogName, schemaName == null ? Constant.FakeSchemaName : schemaName, columnMeta.getString(3), columnMeta.getString(4), columnMeta.getInt(5), columnMeta.getString(6), columnMeta.getInt(7), getInt(columnMeta.getString(8)), columnMeta.getInt(9), columnMeta.getInt(10), columnMeta.getInt(11), columnMeta.getString(12), columnMeta.getString(13), getInt(columnMeta.getString(14)), getInt(columnMeta.getString(15)), columnMeta.getInt(16), columnMeta.getInt(17), columnMeta.getString(18), columnMeta.getString(19), columnMeta.getString(20), columnMeta.getString(21), getShort(columnMeta.getString(22)), columnMeta.getString(23));
if (!cubedOnly || getProjectManager().isExposedColumn(project, schemaName + "." + colmnMeta.getTABLE_NAME(), colmnMeta.getCOLUMN_NAME())) {
tableMap.get(colmnMeta.getTABLE_SCHEM() + "#" + colmnMeta.getTABLE_NAME()).addColumn(colmnMeta);
}
}
logger.debug("done column metas");
} finally {
close(columnMeta, null, conn);
}
return tableMetas;
}
/**
* @param sql
* @param sqlRequest
* @return
* @throws Exception
*/
private SQLResponse execute(String sql, SQLRequest sqlRequest) throws Exception {
Connection conn = null;
Statement stat = null;
ResultSet resultSet = null;
List<List<String>> results = new LinkedList<List<String>>();
List<SelectedColumnMeta> columnMetas = new LinkedList<SelectedColumnMeta>();
try {
conn = getOLAPDataSource(sqlRequest.getProject()).getConnection();
if (sqlRequest instanceof PrepareSqlRequest) {
PreparedStatement preparedState = conn.prepareStatement(sql);
for (int i = 0; i < ((PrepareSqlRequest) sqlRequest).getParams().length; i++) {
setParam(preparedState, i + 1, ((PrepareSqlRequest) sqlRequest).getParams()[i]);
}
resultSet = preparedState.executeQuery();
} else {
stat = conn.createStatement();
resultSet = stat.executeQuery(sql);
}
ResultSetMetaData metaData = resultSet.getMetaData();
int columnCount = metaData.getColumnCount();
// Fill in selected column meta
for (int i = 1; i <= columnCount; ++i) {
columnMetas.add(new SelectedColumnMeta(metaData.isAutoIncrement(i), metaData.isCaseSensitive(i), metaData.isSearchable(i), metaData.isCurrency(i), metaData.isNullable(i), metaData.isSigned(i), metaData.getColumnDisplaySize(i), metaData.getColumnLabel(i), metaData.getColumnName(i), metaData.getSchemaName(i), metaData.getCatalogName(i), metaData.getTableName(i), metaData.getPrecision(i), metaData.getScale(i), metaData.getColumnType(i), metaData.getColumnTypeName(i), metaData.isReadOnly(i), metaData.isWritable(i), metaData.isDefinitelyWritable(i)));
}
List<String> oneRow = new LinkedList<String>();
// fill in results
while (resultSet.next()) {
for (int i = 0; i < columnCount; i++) {
oneRow.add((resultSet.getString(i + 1)));
}
results.add(new LinkedList<String>(oneRow));
oneRow.clear();
}
} finally {
close(resultSet, stat, conn);
}
boolean isPartialResult = false;
String cube = "";
long totalScanCount = 0;
if (OLAPContext.getThreadLocalContexts() != null) { // contexts can be null in case of 'explain plan for'
for (OLAPContext ctx : OLAPContext.getThreadLocalContexts()) {
isPartialResult |= ctx.storageContext.isPartialResultReturned();
cube = ctx.realization.getName();
totalScanCount += ctx.storageContext.getTotalScanCount();
}
}
SQLResponse response = new SQLResponse(columnMetas, results, cube, 0, false, null, isPartialResult);
response.setTotalScanCount(totalScanCount);
return response;
}
/**
* @param preparedState
* @param param
* @throws SQLException
*/
private void setParam(PreparedStatement preparedState, int index, PrepareSqlRequest.StateParam param) throws SQLException {
boolean isNull = (null == param.getValue());
Class<?> clazz;
try {
clazz = Class.forName(param.getClassName());
} catch (ClassNotFoundException e) {
throw new RuntimeException(e.getMessage(), e);
}
Rep rep = Rep.of(clazz);
switch (rep) {
case PRIMITIVE_CHAR:
case CHARACTER:
case STRING:
preparedState.setString(index, isNull ? null : String.valueOf(param.getValue()));
break;
case PRIMITIVE_INT:
case INTEGER:
preparedState.setInt(index, isNull ? 0 : Integer.valueOf(param.getValue()));
break;
case PRIMITIVE_SHORT:
case SHORT:
preparedState.setShort(index, isNull ? 0 : Short.valueOf(param.getValue()));
break;
case PRIMITIVE_LONG:
case LONG:
preparedState.setLong(index, isNull ? 0 : Long.valueOf(param.getValue()));
break;
case PRIMITIVE_FLOAT:
case FLOAT:
preparedState.setFloat(index, isNull ? 0 : Float.valueOf(param.getValue()));
break;
case PRIMITIVE_DOUBLE:
case DOUBLE:
preparedState.setDouble(index, isNull ? 0 : Double.valueOf(param.getValue()));
break;
case PRIMITIVE_BOOLEAN:
case BOOLEAN:
preparedState.setBoolean(index, !isNull && Boolean.parseBoolean(param.getValue()));
break;
case PRIMITIVE_BYTE:
case BYTE:
preparedState.setByte(index, isNull ? 0 : Byte.valueOf(param.getValue()));
break;
case JAVA_UTIL_DATE:
case JAVA_SQL_DATE:
preparedState.setDate(index, isNull ? null : java.sql.Date.valueOf(param.getValue()));
break;
case JAVA_SQL_TIME:
preparedState.setTime(index, isNull ? null : Time.valueOf(param.getValue()));
break;
case JAVA_SQL_TIMESTAMP:
preparedState.setTimestamp(index, isNull ? null : Timestamp.valueOf(param.getValue()));
break;
default:
preparedState.setObject(index, isNull ? null : param.getValue());
}
}
private int getInt(String content) {
try {
return Integer.parseInt(content);
} catch (Exception e) {
return -1;
}
}
private short getShort(String content) {
try {
return Short.parseShort(content);
} catch (Exception e) {
return -1;
}
}
}
| {
"content_hash": "0c3ce04b5d9e39feba2d46fe693cabd3",
"timestamp": "",
"source": "github",
"line_count": 463,
"max_line_length": 727,
"avg_line_length": 42.57451403887689,
"alnum_prop": 0.6385450487012987,
"repo_name": "cocosli/incubator-kylin",
"id": "027202db7e8a9d81a6512991ba6c4d188a2297e3",
"size": "20518",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "server/src/main/java/org/apache/kylin/rest/service/QueryService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "130275"
},
{
"name": "HTML",
"bytes": "214598"
},
{
"name": "Java",
"bytes": "3559063"
},
{
"name": "JavaScript",
"bytes": "222779"
},
{
"name": "PLSQL",
"bytes": "905"
},
{
"name": "Protocol Buffer",
"bytes": "759"
},
{
"name": "Shell",
"bytes": "25045"
}
],
"symlink_target": ""
} |
package org.apache.druid.query.aggregation.distinctcount;
import org.apache.druid.collections.bitmap.BitmapFactory;
import org.apache.druid.collections.bitmap.MutableBitmap;
import org.apache.druid.collections.bitmap.RoaringBitmapFactory;
public class RoaringBitMapFactory implements BitMapFactory
{
private static final BitmapFactory bitmapFactory = new RoaringBitmapFactory();
public RoaringBitMapFactory() {}
@Override
public MutableBitmap makeEmptyMutableBitmap()
{
return bitmapFactory.makeEmptyMutableBitmap();
}
@Override
public String toString()
{
return "RoaringBitMapFactory";
}
@Override
public boolean equals(Object o)
{
return this == o || o instanceof RoaringBitMapFactory;
}
@Override
public int hashCode()
{
return 0;
}
}
| {
"content_hash": "c89a24c7f6d92c21f5e0e452cddf98e2",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 80,
"avg_line_length": 21.026315789473685,
"alnum_prop": 0.7584480600750939,
"repo_name": "dkhwangbo/druid",
"id": "a8e2d74cd56bc11b9df6fbbec7ed8f1bed23420b",
"size": "1606",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "extensions-contrib/distinctcount/src/main/java/org/apache/druid/query/aggregation/distinctcount/RoaringBitMapFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "3345"
},
{
"name": "CSS",
"bytes": "15658"
},
{
"name": "Dockerfile",
"bytes": "4856"
},
{
"name": "HTML",
"bytes": "19754"
},
{
"name": "Java",
"bytes": "21183046"
},
{
"name": "JavaScript",
"bytes": "304058"
},
{
"name": "Makefile",
"bytes": "659"
},
{
"name": "PostScript",
"bytes": "5"
},
{
"name": "R",
"bytes": "17002"
},
{
"name": "Roff",
"bytes": "3617"
},
{
"name": "Shell",
"bytes": "28297"
},
{
"name": "TeX",
"bytes": "399508"
},
{
"name": "Thrift",
"bytes": "207"
}
],
"symlink_target": ""
} |
"""Compute-related Utilities and helpers."""
import itertools
import re
import string
import traceback
from oslo.config import cfg
from nova import block_device
from nova.compute import flavors
from nova.compute import power_state
from nova.compute import task_states
from nova import exception
from nova.network import model as network_model
from nova import notifications
from nova.objects import base as obj_base
from nova.objects import instance_action as instance_action_obj
from nova.objects import instance_fault as instance_fault_obj
from nova.openstack.common.gettextutils import _
from nova.openstack.common import log
from nova import rpc
from nova import utils
from nova.virt import driver
CONF = cfg.CONF
CONF.import_opt('host', 'nova.netconf')
LOG = log.getLogger(__name__)
def exception_to_dict(fault):
"""Converts exceptions to a dict for use in notifications."""
#TODO(johngarbutt) move to nova/exception.py to share with wrap_exception
code = 500
if hasattr(fault, "kwargs"):
code = fault.kwargs.get('code', 500)
# get the message from the exception that was thrown
# if that does not exist, use the name of the exception class itself
try:
message = fault.format_message()
# These exception handlers are broad so we don't fail to log the fault
# just because there is an unexpected error retrieving the message
except Exception:
try:
message = unicode(fault)
except Exception:
message = None
if not message:
message = fault.__class__.__name__
# NOTE(dripton) The message field in the database is limited to 255 chars.
# MySQL silently truncates overly long messages, but PostgreSQL throws an
# error if we don't truncate it.
u_message = unicode(message)[:255]
fault_dict = dict(exception=fault)
fault_dict["message"] = u_message
fault_dict["code"] = code
return fault_dict
def _get_fault_details(exc_info, error_code):
details = ''
if exc_info and error_code == 500:
tb = exc_info[2]
if tb:
details = ''.join(traceback.format_tb(tb))
return unicode(details)
def add_instance_fault_from_exc(context, instance, fault, exc_info=None):
"""Adds the specified fault to the database."""
fault_obj = instance_fault_obj.InstanceFault(context=context)
fault_obj.host = CONF.host
fault_obj.instance_uuid = instance['uuid']
fault_obj.update(exception_to_dict(fault))
code = fault_obj.code
fault_obj.details = _get_fault_details(exc_info, code)
fault_obj.create()
def get_device_name_for_instance(context, instance, bdms, device):
"""Validates (or generates) a device name for instance.
This method is a wrapper for get_next_device_name that gets the list
of used devices and the root device from a block device mapping.
"""
mappings = block_device.instance_block_mapping(instance, bdms)
return get_next_device_name(instance, mappings.values(),
mappings['root'], device)
def default_device_names_for_instance(instance, root_device_name,
*block_device_lists):
"""Generate missing device names for an instance."""
dev_list = [bdm.device_name
for bdm in itertools.chain(*block_device_lists)
if bdm.device_name]
if root_device_name not in dev_list:
dev_list.append(root_device_name)
for bdm in itertools.chain(*block_device_lists):
dev = bdm.device_name
if not dev:
dev = get_next_device_name(instance, dev_list,
root_device_name)
bdm.device_name = dev
bdm.save()
dev_list.append(dev)
def get_next_device_name(instance, device_name_list,
root_device_name=None, device=None):
"""Validates (or generates) a device name for instance.
If device is not set, it will generate a unique device appropriate
for the instance. It uses the root_device_name (if provided) and
the list of used devices to find valid device names. If the device
name is valid but applicable to a different backend (for example
/dev/vdc is specified but the backend uses /dev/xvdc), the device
name will be converted to the appropriate format.
"""
req_prefix = None
req_letter = None
if device:
try:
req_prefix, req_letter = block_device.match_device(device)
except (TypeError, AttributeError, ValueError):
raise exception.InvalidDevicePath(path=device)
if not root_device_name:
root_device_name = block_device.DEFAULT_ROOT_DEV_NAME
try:
prefix = block_device.match_device(root_device_name)[0]
except (TypeError, AttributeError, ValueError):
raise exception.InvalidDevicePath(path=root_device_name)
# NOTE(vish): remove this when xenapi is setting default_root_device
if driver.compute_driver_matches('xenapi.XenAPIDriver'):
prefix = '/dev/xvd'
if req_prefix != prefix:
LOG.debug("Using %(prefix)s instead of %(req_prefix)s",
{'prefix': prefix, 'req_prefix': req_prefix})
used_letters = set()
for device_path in device_name_list:
letter = block_device.strip_prefix(device_path)
# NOTE(vish): delete numbers in case we have something like
# /dev/sda1
letter = re.sub("\d+", "", letter)
used_letters.add(letter)
# NOTE(vish): remove this when xenapi is properly setting
# default_ephemeral_device and default_swap_device
if driver.compute_driver_matches('xenapi.XenAPIDriver'):
flavor = flavors.extract_flavor(instance)
if flavor['ephemeral_gb']:
used_letters.add('b')
if flavor['swap']:
used_letters.add('c')
if not req_letter:
req_letter = _get_unused_letter(used_letters)
if req_letter in used_letters:
raise exception.DevicePathInUse(path=device)
return prefix + req_letter
def _get_unused_letter(used_letters):
doubles = [first + second for second in string.ascii_lowercase
for first in string.ascii_lowercase]
all_letters = set(list(string.ascii_lowercase) + doubles)
letters = list(all_letters - used_letters)
# NOTE(vish): prepend ` so all shorter sequences sort first
letters.sort(key=lambda x: x.rjust(2, '`'))
return letters[0]
def get_image_metadata(context, image_api, image_id_or_uri, instance):
# If the base image is still available, get its metadata
try:
image = image_api.get(context, image_id_or_uri)
except Exception as e:
LOG.warning(_("Can't access image %(image_id)s: %(error)s"),
{"image_id": image_id_or_uri, "error": e},
instance=instance)
image_system_meta = {}
else:
flavor = flavors.extract_flavor(instance)
image_system_meta = utils.get_system_metadata_from_image(image, flavor)
# Get the system metadata from the instance
system_meta = utils.instance_sys_meta(instance)
# Merge the metadata from the instance with the image's, if any
system_meta.update(image_system_meta)
# Convert the system metadata to image metadata
return utils.get_image_from_system_metadata(system_meta)
def notify_usage_exists(notifier, context, instance_ref, current_period=False,
ignore_missing_network_data=True,
system_metadata=None, extra_usage_info=None):
"""Generates 'exists' notification for an instance for usage auditing
purposes.
:param notifier: a messaging.Notifier
:param current_period: if True, this will generate a usage for the
current usage period; if False, this will generate a usage for the
previous audit period.
:param ignore_missing_network_data: if True, log any exceptions generated
while getting network info; if False, raise the exception.
:param system_metadata: system_metadata DB entries for the instance,
if not None. *NOTE*: Currently unused here in trunk, but needed for
potential custom modifications.
:param extra_usage_info: Dictionary containing extra values to add or
override in the notification if not None.
"""
audit_start, audit_end = notifications.audit_period_bounds(current_period)
bw = notifications.bandwidth_usage(instance_ref, audit_start,
ignore_missing_network_data)
if system_metadata is None:
system_metadata = utils.instance_sys_meta(instance_ref)
# add image metadata to the notification:
image_meta = notifications.image_meta(system_metadata)
extra_info = dict(audit_period_beginning=str(audit_start),
audit_period_ending=str(audit_end),
bandwidth=bw, image_meta=image_meta)
if extra_usage_info:
extra_info.update(extra_usage_info)
notify_about_instance_usage(notifier, context, instance_ref, 'exists',
system_metadata=system_metadata, extra_usage_info=extra_info)
def notify_about_instance_usage(notifier, context, instance, event_suffix,
network_info=None, system_metadata=None,
extra_usage_info=None, fault=None):
"""Send a notification about an instance.
:param notifier: a messaging.Notifier
:param event_suffix: Event type like "delete.start" or "exists"
:param network_info: Networking information, if provided.
:param system_metadata: system_metadata DB entries for the instance,
if provided.
:param extra_usage_info: Dictionary containing extra values to add or
override in the notification.
"""
if not extra_usage_info:
extra_usage_info = {}
usage_info = notifications.info_from_instance(context, instance,
network_info, system_metadata, **extra_usage_info)
if fault:
# NOTE(johngarbutt) mirrors the format in wrap_exception
fault_payload = exception_to_dict(fault)
LOG.debug(fault_payload["message"], instance=instance,
exc_info=True)
usage_info.update(fault_payload)
if event_suffix.endswith("error"):
method = notifier.error
else:
method = notifier.info
method(context, 'compute.instance.%s' % event_suffix, usage_info)
def notify_about_aggregate_update(context, event_suffix, aggregate_payload):
"""Send a notification about aggregate update.
:param event_suffix: Event type like "create.start" or "create.end"
:param aggregate_payload: payload for aggregate update
"""
aggregate_identifier = aggregate_payload.get('aggregate_id', None)
if not aggregate_identifier:
aggregate_identifier = aggregate_payload.get('name', None)
if not aggregate_identifier:
LOG.debug("No aggregate id or name specified for this "
"notification and it will be ignored")
return
notifier = rpc.get_notifier(service='aggregate',
host=aggregate_identifier)
notifier.info(context, 'aggregate.%s' % event_suffix, aggregate_payload)
def notify_about_host_update(context, event_suffix, host_payload):
"""Send a notification about host update.
:param event_suffix: Event type like "create.start" or "create.end"
:param host_payload: payload for host update. It is a dict and there
should be at least the 'host_name' key in this
dict.
"""
host_identifier = host_payload.get('host_name')
if not host_identifier:
LOG.warn(_("No host name specified for the notification of "
"HostAPI.%s and it will be ignored"), event_suffix)
return
notifier = rpc.get_notifier(service='api', host=host_identifier)
notifier.info(context, 'HostAPI.%s' % event_suffix, host_payload)
def get_nw_info_for_instance(instance):
if isinstance(instance, obj_base.NovaObject):
if instance.info_cache is None:
return network_model.NetworkInfo.hydrate([])
return instance.info_cache.network_info
# FIXME(comstud): Transitional while we convert to objects.
info_cache = instance['info_cache'] or {}
nw_info = info_cache.get('network_info') or []
if not isinstance(nw_info, network_model.NetworkInfo):
nw_info = network_model.NetworkInfo.hydrate(nw_info)
return nw_info
def has_audit_been_run(context, conductor, host, timestamp=None):
begin, end = utils.last_completed_audit_period(before=timestamp)
task_log = conductor.task_log_get(context, "instance_usage_audit",
begin, end, host)
if task_log:
return True
else:
return False
def start_instance_usage_audit(context, conductor, begin, end, host,
num_instances):
conductor.task_log_begin_task(context, "instance_usage_audit", begin,
end, host, num_instances,
"Instance usage audit started...")
def finish_instance_usage_audit(context, conductor, begin, end, host, errors,
message):
conductor.task_log_end_task(context, "instance_usage_audit", begin, end,
host, errors, message)
def usage_volume_info(vol_usage):
def null_safe_str(s):
return str(s) if s else ''
tot_refreshed = vol_usage['tot_last_refreshed']
curr_refreshed = vol_usage['curr_last_refreshed']
if tot_refreshed and curr_refreshed:
last_refreshed_time = max(tot_refreshed, curr_refreshed)
elif tot_refreshed:
last_refreshed_time = tot_refreshed
else:
# curr_refreshed must be set
last_refreshed_time = curr_refreshed
usage_info = dict(
volume_id=vol_usage['volume_id'],
tenant_id=vol_usage['project_id'],
user_id=vol_usage['user_id'],
availability_zone=vol_usage['availability_zone'],
instance_id=vol_usage['instance_uuid'],
last_refreshed=null_safe_str(last_refreshed_time),
reads=vol_usage['tot_reads'] + vol_usage['curr_reads'],
read_bytes=vol_usage['tot_read_bytes'] +
vol_usage['curr_read_bytes'],
writes=vol_usage['tot_writes'] + vol_usage['curr_writes'],
write_bytes=vol_usage['tot_write_bytes'] +
vol_usage['curr_write_bytes'])
return usage_info
def get_reboot_type(task_state, current_power_state):
"""Checks if the current instance state requires a HARD reboot."""
if current_power_state != power_state.RUNNING:
return 'HARD'
soft_types = [task_states.REBOOT_STARTED, task_states.REBOOT_PENDING,
task_states.REBOOTING]
reboot_type = 'SOFT' if task_state in soft_types else 'HARD'
return reboot_type
class EventReporter(object):
"""Context manager to report instance action events."""
def __init__(self, context, event_name, *instance_uuids):
self.context = context
self.event_name = event_name
self.instance_uuids = instance_uuids
def __enter__(self):
for uuid in self.instance_uuids:
instance_action_obj.InstanceActionEvent.event_start(
self.context, uuid, self.event_name)
return self
def __exit__(self, exc_type, exc_val, exc_tb):
for uuid in self.instance_uuids:
instance_action_obj.InstanceActionEvent.event_finish_with_failure(
self.context, uuid, self.event_name, exc_val=exc_val,
exc_tb=exc_tb)
return False
def periodic_task_spacing_warn(config_option_name):
"""Decorator to warn about an upcoming breaking change in methods which
use the @periodic_task decorator.
Some methods using the @periodic_task decorator specify spacing=0 or
None to mean "do not call this method", but the decorator itself uses
0/None to mean "call at the default rate".
Starting with the K release the Nova methods will be changed to conform
to the Oslo decorator. This decorator should be present wherever a
spacing value from user-supplied config is passed to @periodic_task, and
there is also a check to skip the method if the value is zero. It will
log a warning if the spacing value from config is 0/None.
"""
# TODO(gilliard) remove this decorator, its usages and the early returns
# near them after the K release.
def wrapper(f):
if (hasattr(f, "_periodic_spacing") and
(f._periodic_spacing == 0 or f._periodic_spacing is None)):
LOG.warning(_("Value of 0 or None specified for %s."
" This behaviour will change in meaning in the K release, to"
" mean 'call at the default rate' rather than 'do not call'."
" To keep the 'do not call' behaviour, use a negative value."),
config_option_name)
return f
return wrapper
| {
"content_hash": "266eacd1a5e4f8d7ae15e529e43a3bcf",
"timestamp": "",
"source": "github",
"line_count": 452,
"max_line_length": 79,
"avg_line_length": 37.95575221238938,
"alnum_prop": 0.6513173233854045,
"repo_name": "afrolov1/nova",
"id": "1eea08449b2421c3f479352ddb3101147ff591b2",
"size": "17773",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "nova/compute/utils.py",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "14057622"
},
{
"name": "Shell",
"bytes": "17451"
}
],
"symlink_target": ""
} |
package com.dremio.exec.planner.physical.visitor;
import static com.dremio.exec.planner.physical.DistributionTrait.ROUND_ROBIN;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.PriorityQueue;
import org.apache.calcite.plan.Convention;
import org.apache.calcite.plan.RelTraitSet;
import org.apache.calcite.rel.InvalidRelException;
import org.apache.calcite.rel.RelCollations;
import org.apache.calcite.rel.RelNode;
import org.apache.calcite.rel.type.RelDataTypeField;
import org.apache.calcite.rex.RexBuilder;
import org.apache.calcite.rex.RexInputRef;
import org.apache.calcite.rex.RexNode;
import org.apache.calcite.tools.RelConversionException;
import com.dremio.exec.physical.base.GroupScan;
import com.dremio.exec.planner.fragment.DistributionAffinity;
import com.dremio.exec.planner.physical.DistributionTrait;
import com.dremio.exec.planner.physical.EmptyPrel;
import com.dremio.exec.planner.physical.ExchangePrel;
import com.dremio.exec.planner.physical.HasDistributionAffinity;
import com.dremio.exec.planner.physical.PlannerSettings;
import com.dremio.exec.planner.physical.Prel;
import com.dremio.exec.planner.physical.ProjectPrel;
import com.dremio.exec.planner.physical.RoundRobinExchangePrel;
import com.dremio.exec.planner.physical.UnionAllPrel;
import com.dremio.exec.planner.sql.handlers.SqlHandlerConfig;
import com.dremio.exec.record.BatchSchema;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
/**
* A visitor that expands the merged union based on the following logic:
* 1) Remove all empty inputs for a given union
* 2) If all inputs are empty, replace the union with empty,
* 3) If a single input is not empty, replace the union with project
* 4) If there are more than two non-empty inputs,
* based on the width of each child, incrementally create binary
* UnionAlls and insert RoundRobinExchange between them
* 5) If certain child's width is smaller than the defined
* threshold value, or the width difference between two inputs
* are bigger than the defined ratio,
* additionally add RoundRobinExchange to the smaller side
*/
public final class UnionAllExpander extends BasePrelVisitor<Prel, Void, IOException> {
static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(UnionAllExpander.class);
private final long targetSliceSize;
private final SqlHandlerConfig config;
private int count;
private UnionAllExpander(SqlHandlerConfig config, long targetSliceSize) {
this.targetSliceSize = targetSliceSize;
this.config = config;
this.count = 0;
}
public static Prel expandUnionAlls(Prel prel, SqlHandlerConfig config, long targetSliceSize) throws RelConversionException {
UnionAllExpander exchange = new UnionAllExpander(config, targetSliceSize);
try {
Prel expanded = prel.accept(exchange, null);
expanded.accept(new UnionAllInputValidator(), null);
return expanded;
} catch (IOException ex) {
throw new RelConversionException("Failure while attempting to expanding UnionAlls.", ex);
}
}
private long getInputRoundRobinThreshold() {
return config.getContext().getOptions().getOption(PlannerSettings.UNION_ALL_INPUT_ROUND_ROBIN_THRESHOLD_VALUE);
}
private double getInputRoundRobinRatio() {
return config.getContext().getOptions().getOption(PlannerSettings.UNION_ALL_INPUT_ROUND_ROBIN_THRESHOLD_RATIO);
}
@Override
public Prel visitPrel(Prel prel, Void value) throws IOException {
// convert inputs
final List<RelNode> children = new ArrayList<>();
for (Prel p : prel) {
children.add(p.accept(this, null));
}
if (!(prel instanceof UnionAllPrel)) {
return (Prel) prel.copy(prel.getTraitSet(), children);
}
BatchSchema batchSchema = null;
// populate priority queue based on width of inputs
PriorityQueue<UnionChild> pq = new PriorityQueue<>(children.size());
for (RelNode child : children) {
Prel childPrel = (Prel) child;
final UnionChild unionChild = new UnionChild(
WidthFinder.computeStat(childPrel, targetSliceSize),
childPrel, count++);
pq.add(unionChild);
}
if (pq.size() < 2) {
Prel inputRel = pq.isEmpty() ?
new EmptyPrel(prel.getCluster(), prel.getTraitSet(), prel.getRowType(), batchSchema) : addRoundRobinIfStrict(pq.poll().relNode);
final RexBuilder rexBuilder = prel.getCluster().getRexBuilder();
final List<RelDataTypeField> unionFields = prel.getRowType().getFieldList();
final List<RelDataTypeField> inputFields = inputRel.getRowType().getFieldList();
final List<RexNode> projects = new ArrayList<>();
for (int i = 0 ; i < unionFields.size() ; i++) {
projects.add(rexBuilder.makeCast(unionFields.get(i).getType(), new RexInputRef(i, inputFields.get(i).getType())));
}
return ProjectPrel.create(prel.getCluster(), prel.getTraitSet(), inputRel, projects, prel.getRowType());
}
// construct unions with RoundRobinExchanges
UnionChild left = pq.poll();
UnionChild right = pq.poll();
Prel convertedLeft = ((double) left.stat.getMaxWidth()) <= right.stat.getMaxWidth() * getInputRoundRobinRatio() ?
addRoundRobin(left.relNode) : addRoundRobinIfStrict(left);
Prel convertedRight = addRoundRobinIfStrict(right);
boolean isSingular = left.stat.isSingular() && right.stat.isSingular() && !left.stat.isDistributionStrict()&& !right.stat.isDistributionStrict();
try {
Prel union = new UnionAllPrel(
prel.getCluster(), prel.getTraitSet(),
ImmutableList.of(convertedLeft, convertedRight),
false);
while (!pq.isEmpty()) {
UnionChild newInput = pq.poll();
isSingular = isSingular && newInput.stat.isSingular() && !newInput.stat.isDistributionStrict();
union = !isSingular ? addRoundRobin(union) : union;
Prel convertedNewInput = shouldAddRoundRobinToNewInput(isSingular, newInput.stat) ? addRoundRobin(newInput.relNode) : addRoundRobinIfStrict(newInput);
union = new UnionAllPrel(prel.getCluster(), prel.getTraitSet(), ImmutableList.of(union, convertedNewInput), false);
}
return union;
} catch (InvalidRelException ex) {
// This exception should not be thrown as we already checked compatibility
logger.warn("Failed to expand unionAll as inputs are not compatible", ex);
return prel;
}
}
private boolean shouldAddRoundRobinToNewInput(boolean isSingular, FragmentStatVisitor.MajorFragmentStat inputStat) {
return !isSingular && (inputStat.isSingular() || inputStat.getMaxWidth() <= getInputRoundRobinThreshold());
}
private Prel addRoundRobin(Prel prel) {
return new RoundRobinExchangePrel(prel.getCluster(), createEmptyTraitSet().plus(Prel.PHYSICAL).plus(ROUND_ROBIN), prel);
}
private Prel addRoundRobinIfStrict(UnionChild child) {
return child.stat.isDistributionStrict() ? addRoundRobin(child.relNode) : child.relNode;
}
private Prel addRoundRobinIfStrict(Prel prel) {
return findHardAffinity(prel) ? addRoundRobin(prel) : prel;
}
public RelTraitSet createEmptyTraitSet() {
return RelTraitSet.createEmpty().plus(Convention.NONE).plus(DistributionTrait.DEFAULT).plus(RelCollations.EMPTY);
}
private static class WidthFinder extends FragmentStatVisitor {
public WidthFinder(long targetSliceSize) {
super(targetSliceSize);
}
public static MajorFragmentStat computeStat(Prel prel, long targetSliceSize) {
final WidthFinder widthFinder = new WidthFinder(targetSliceSize);
final MajorFragmentStat stat = widthFinder.getNewStat();
prel.accept(widthFinder, stat);
return stat;
}
@Override
public Prel visitExchange(ExchangePrel prel, MajorFragmentStat parent) throws RuntimeException {
parent.add(prel);
MajorFragmentStat newFrag = new MajorFragmentStat();
Prel newChild = ((Prel) prel.getInput()).accept(this, newFrag);
if (newFrag.isSingular() && parent.isSingular() &&
(!newFrag.isDistributionStrict() && !parent.isDistributionStrict())) {
parent.merge(newFrag);
}
return (Prel) prel.copy(prel.getTraitSet(), Collections.singletonList((RelNode) newChild));
}
}
private static final class UnionChild implements Comparable<UnionChild> {
private final FragmentStatVisitor.MajorFragmentStat stat;
private final Prel relNode;
private final int count;
public UnionChild(FragmentStatVisitor.MajorFragmentStat stat, Prel relNode, int count) {
this.stat = stat;
this.relNode = relNode;
this.count = count;
}
@Override
public int compareTo(UnionChild another) {
int cmp = Integer.compare(this.stat.getMaxWidth(), another.stat.getMaxWidth());
return cmp != 0 ? cmp : Integer.compare(this.count, another.count);
}
}
private static boolean findHardAffinity(Prel prel) {
if (prel instanceof HasDistributionAffinity) {
return ((HasDistributionAffinity) prel).getDistributionAffinity() == DistributionAffinity.HARD;
} else if (prel instanceof GroupScan) {
return ((GroupScan) prel).getDistributionAffinity() == DistributionAffinity.HARD;
} else if(prel.getInputs().size() == 1) {
return findHardAffinity(Iterables.getOnlyElement(prel));
} else {
return false;
}
}
private static class UnionAllInputValidator extends BasePrelVisitor<Prel, Void, IOException> {
@Override
public Prel visitPrel(Prel prel, Void value) throws IOException {
List<RelNode> children = new ArrayList<>();
for (Prel child : prel) {
children.add(child.accept(this, null));
}
if (prel instanceof UnionAllPrel && children.size() != 2) {
throw new IOException("UnionAll operators must have only 2 inputs");
}
return (Prel) prel.copy(prel.getTraitSet(), children);
}
}
}
| {
"content_hash": "aa5a5de4ee43772d62e2853ef1b9ab57",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 158,
"avg_line_length": 42.16877637130802,
"alnum_prop": 0.7291374824894937,
"repo_name": "dremio/dremio-oss",
"id": "8446ccb82e595bd49804dea9b7664e396f6c32ed",
"size": "10604",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "sabot/kernel/src/main/java/com/dremio/exec/planner/physical/visitor/UnionAllExpander.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "47376"
},
{
"name": "Dockerfile",
"bytes": "1668"
},
{
"name": "FreeMarker",
"bytes": "132156"
},
{
"name": "GAP",
"bytes": "15936"
},
{
"name": "HTML",
"bytes": "6544"
},
{
"name": "Java",
"bytes": "39679012"
},
{
"name": "JavaScript",
"bytes": "5439822"
},
{
"name": "Less",
"bytes": "547002"
},
{
"name": "SCSS",
"bytes": "95688"
},
{
"name": "Shell",
"bytes": "16063"
},
{
"name": "TypeScript",
"bytes": "887739"
}
],
"symlink_target": ""
} |
// Copyright (C) 2014 npnf, inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
using UnityEngine;
using System.Collections;
using PF.Base;
using System.Collections.Generic;
using NPNF.Collections;
using NPNF.Core;
using NPNF.Core.Users;
public class Recipe
{
public string formulaName;
public Dictionary<string, int> ingredients;
public string outcome;
public bool isDone = false;
public bool isReady
{
get
{
int total = 0;
foreach (int count in ingredients.Values)
{
total += count;
}
return (total == 3);
}
}
public Recipe(Dictionary<string, int> ingredients, string outcome, string formulaName)
{
this.ingredients = ingredients;
this.outcome = outcome;
this.formulaName = formulaName;
}
}
/*
* add and remove entitlements for fusion manually. Replace with fusion formulas in future
*/
public class RecipeController : MonoBehaviour
{
List<Recipe> recipes;
private CollectionCore collectionCore;
void Awake()
{
recipes = new List<Recipe>();
Dictionary<string, int> dict1 = new Dictionary<string, int>();
dict1 ["morale"] = 0;
dict1 ["funding"] = 0;
dict1 ["strength"] = 0;
Recipe recipe1 = new Recipe(dict1, "pitch", "ConvertToPitch");
recipes.Add(recipe1);
Dictionary<string, int> dict2 = new Dictionary<string, int>();
dict2 ["cup_ramen"] = 0;
dict2 ["catered_lunch"] = 0;
dict2 ["philz_coffee"] = 0;
Recipe recipe2 = new Recipe(dict2, "strength", "ConvertToStrength");
recipes.Add(recipe2);
Dictionary<string, int> dict3 = new Dictionary<string, int>();
dict3 ["woos_wallet"] = 0;
dict3 ["chris_credit_card"] = 0;
dict3 ["expense_account"] = 0;
Recipe recipe3 = new Recipe(dict3, "funding", "ConvertToFunding");
recipes.Add(recipe3);
Dictionary<string, int> dict4 = new Dictionary<string, int>();
dict4 ["music"] = 0;
dict4 ["cat_videos"] = 0;
dict4 ["happy_hour"] = 0;
Recipe recipe4 = new Recipe(dict4, "morale", "ConvertToMorale");
recipes.Add(recipe4);
}
public string OnNewInventory(string assetName)
{
foreach (Recipe recipe in recipes)
{
if (!recipe.isDone)
{
if (recipe.outcome.Equals(assetName))
{
recipe.isDone = true;
return null;
} else if (recipe.ingredients.ContainsKey(assetName))
{
if (recipe.ingredients [assetName] == 0)
{
recipe.ingredients [assetName] = 1;
if (recipe.isReady)
{
return recipe.outcome;
}
}
}
}
}
return null;
}
public void CheckRecipe()
{
Recipe recipe = FindReadyRecipe();
if (recipe != null)
{
GameObject obj = GameObject.Find("CollectionCore");
collectionCore = obj.GetComponent<CollectionCore>();
Dictionary<string, ConversionFormula> formulas = collectionCore.GetFormulas();
ConversionFormula formulaToUse = formulas [recipe.formulaName];
User.CurrentProfile.Entitlements.ApplyConversion(formulaToUse.Id, (ConversionResult result, NPNFError error) => {
if (error == null)
{
InventoryController ctrler = (InventoryController)AppController.Instance.GetController(Controller.INVENTORY);
foreach (Entitlement entitlement in result.Added)
{
ctrler.OnNewInventory(entitlement.Id);
}
recipe.isDone = true;
} else if (error != null)
{
Debug.LogError("Conversion failed" + error);
AppController.Instance.IsNetworkError(error);
}
});
}
}
private Recipe FindReadyRecipe()
{
foreach (Recipe recipe in recipes)
{
if (recipe.isReady && !recipe.isDone)
{
return recipe;
}
}
return null;
}
}
| {
"content_hash": "543076fcf9d2de473d4c4123623d2d92",
"timestamp": "",
"source": "github",
"line_count": 157,
"max_line_length": 131,
"avg_line_length": 31.67515923566879,
"alnum_prop": 0.5574100140760104,
"repo_name": "npnf-inc/PlayForKeeps",
"id": "0d3632e50b987a0fc4cc8934a41df213d938e071",
"size": "4975",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Assets/PlayForKeeps/Application/SceneComponents/Scripts/Controller/RecipeController.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C#",
"bytes": "284274"
},
{
"name": "C++",
"bytes": "4447"
},
{
"name": "Java",
"bytes": "48620"
},
{
"name": "JavaScript",
"bytes": "383"
},
{
"name": "Makefile",
"bytes": "525"
},
{
"name": "Objective-C",
"bytes": "54559"
},
{
"name": "Objective-C++",
"bytes": "23489"
},
{
"name": "Shell",
"bytes": "1065"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_40) on Wed Apr 13 18:09:36 UTC 2016 -->
<title>StorageMetrics (apache-cassandra API)</title>
<meta name="date" content="2016-04-13">
<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="StorageMetrics (apache-cassandra API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StorageMetrics.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/metrics/SEPMetrics.html" title="class in org.apache.cassandra.metrics"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/metrics/StreamingMetrics.html" title="class in org.apache.cassandra.metrics"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/metrics/StorageMetrics.html" target="_top">Frames</a></li>
<li><a href="StorageMetrics.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#methods.inherited.from.class.java.lang.Object">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li>Method</li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.cassandra.metrics</div>
<h2 title="Class StorageMetrics" class="title">Class StorageMetrics</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.cassandra.metrics.StorageMetrics</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">StorageMetrics</span>
extends java.lang.Object</pre>
<div class="block">Metrics related to Storage.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static com.codahale.metrics.Counter</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/metrics/StorageMetrics.html#exceptions">exceptions</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static com.codahale.metrics.Counter</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/metrics/StorageMetrics.html#load">load</a></span></code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static com.codahale.metrics.Counter</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/metrics/StorageMetrics.html#totalHints">totalHints</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static com.codahale.metrics.Counter</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/metrics/StorageMetrics.html#totalHintsInProgress">totalHintsInProgress</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/cassandra/metrics/StorageMetrics.html#StorageMetrics--">StorageMetrics</a></span>()</code> </td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="load">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>load</h4>
<pre>public static final com.codahale.metrics.Counter load</pre>
</li>
</ul>
<a name="exceptions">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exceptions</h4>
<pre>public static final com.codahale.metrics.Counter exceptions</pre>
</li>
</ul>
<a name="totalHintsInProgress">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>totalHintsInProgress</h4>
<pre>public static final com.codahale.metrics.Counter totalHintsInProgress</pre>
</li>
</ul>
<a name="totalHints">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>totalHints</h4>
<pre>public static final com.codahale.metrics.Counter totalHints</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="StorageMetrics--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>StorageMetrics</h4>
<pre>public StorageMetrics()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StorageMetrics.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/cassandra/metrics/SEPMetrics.html" title="class in org.apache.cassandra.metrics"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../org/apache/cassandra/metrics/StreamingMetrics.html" title="class in org.apache.cassandra.metrics"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/cassandra/metrics/StorageMetrics.html" target="_top">Frames</a></li>
<li><a href="StorageMetrics.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#methods.inherited.from.class.java.lang.Object">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li>Method</li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2016 The Apache Software Foundation</small></p>
</body>
</html>
| {
"content_hash": "e5687c77e5f5f2fa28445a22cc0b8727",
"timestamp": "",
"source": "github",
"line_count": 314,
"max_line_length": 196,
"avg_line_length": 33.71974522292994,
"alnum_prop": 0.6418587079712883,
"repo_name": "elisska/cloudera-cassandra",
"id": "623725aab59e2d9c082cfc4b1389c981fe35ee8d",
"size": "10588",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "DATASTAX_CASSANDRA-3.5.0/javadoc/org/apache/cassandra/metrics/StorageMetrics.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "75145"
},
{
"name": "CSS",
"bytes": "4112"
},
{
"name": "HTML",
"bytes": "331372"
},
{
"name": "PowerShell",
"bytes": "77673"
},
{
"name": "Python",
"bytes": "979128"
},
{
"name": "Shell",
"bytes": "143685"
},
{
"name": "Thrift",
"bytes": "80564"
}
],
"symlink_target": ""
} |
using namespace swift;
/// Strip off casts/indexing insts/address projections from V until there is
/// nothing left to strip.
/// FIXME: Why don't we strip projections after stripping indexes?
SILValue swift::getUnderlyingObject(SILValue V) {
while (true) {
SILValue V2 = stripIndexingInsts(stripAddressProjections(stripCasts(V)));
if (V2 == V)
return V2;
V = V2;
}
}
SILValue swift::getUnderlyingAddressRoot(SILValue V) {
while (true) {
SILValue V2 = stripIndexingInsts(stripCasts(V));
switch (V2->getKind()) {
case ValueKind::StructElementAddrInst:
case ValueKind::TupleElementAddrInst:
case ValueKind::UncheckedTakeEnumDataAddrInst:
V2 = cast<SILInstruction>(V2)->getOperand(0);
break;
default:
break;
}
if (V2 == V)
return V2;
V = V2;
}
}
SILValue swift::getUnderlyingObjectStopAtMarkDependence(SILValue V) {
while (true) {
SILValue V2 = stripIndexingInsts(stripAddressProjections(stripCastsWithoutMarkDependence(V)));
if (V2 == V)
return V2;
V = V2;
}
}
static bool isRCIdentityPreservingCast(ValueKind Kind) {
switch (Kind) {
case ValueKind::UpcastInst:
case ValueKind::UncheckedRefCastInst:
case ValueKind::UncheckedRefCastAddrInst:
case ValueKind::UnconditionalCheckedCastInst:
case ValueKind::RefToBridgeObjectInst:
case ValueKind::BridgeObjectToRefInst:
return true;
default:
return false;
}
}
/// Return the underlying SILValue after stripping off identity SILArguments if
/// we belong to a BB with one predecessor.
SILValue swift::stripSinglePredecessorArgs(SILValue V) {
while (true) {
auto *A = dyn_cast<SILArgument>(V);
if (!A)
return V;
SILBasicBlock *BB = A->getParent();
// First try and grab the single predecessor of our parent BB. If we don't
// have one, bail.
SILBasicBlock *Pred = BB->getSinglePredecessorBlock();
if (!Pred)
return V;
// Then grab the terminator of Pred...
TermInst *PredTI = Pred->getTerminator();
// And attempt to find our matching argument.
//
// *NOTE* We can only strip things here if we know that there is no semantic
// change in terms of upcasts/downcasts/enum extraction since this is used
// by other routines here. This means that we can only look through
// cond_br/br.
//
// For instance, routines that use stripUpcasts() do not want to strip off a
// downcast that results from checked_cast_br.
if (auto *BI = dyn_cast<BranchInst>(PredTI)) {
V = BI->getArg(A->getIndex());
continue;
}
if (auto *CBI = dyn_cast<CondBranchInst>(PredTI)) {
if (SILValue Arg = CBI->getArgForDestBB(BB, A)) {
V = Arg;
continue;
}
}
return V;
}
}
SILValue swift::stripCastsWithoutMarkDependence(SILValue V) {
while (true) {
V = stripSinglePredecessorArgs(V);
auto K = V->getKind();
if (isRCIdentityPreservingCast(K) ||
K == ValueKind::UncheckedTrivialBitCastInst) {
V = cast<SILInstruction>(V)->getOperand(0);
continue;
}
return V;
}
}
SILValue swift::stripCasts(SILValue V) {
while (true) {
V = stripSinglePredecessorArgs(V);
auto K = V->getKind();
if (isRCIdentityPreservingCast(K)
|| K == ValueKind::UncheckedTrivialBitCastInst
|| K == ValueKind::MarkDependenceInst) {
V = cast<SILInstruction>(V)->getOperand(0);
continue;
}
return V;
}
}
SILValue swift::stripUpCasts(SILValue V) {
assert(V->getType().isClassOrClassMetatype() &&
"Expected class or class metatype!");
V = stripSinglePredecessorArgs(V);
while (isa<UpcastInst>(V))
V = stripSinglePredecessorArgs(cast<UpcastInst>(V)->getOperand());
return V;
}
SILValue swift::stripClassCasts(SILValue V) {
while (true) {
if (auto *UI = dyn_cast<UpcastInst>(V)) {
V = UI->getOperand();
continue;
}
if (auto *UCCI = dyn_cast<UnconditionalCheckedCastInst>(V)) {
V = UCCI->getOperand();
continue;
}
return V;
}
}
SILValue swift::stripAddressProjections(SILValue V) {
while (true) {
V = stripSinglePredecessorArgs(V);
if (!Projection::isAddressProjection(V))
return V;
V = cast<SILInstruction>(V)->getOperand(0);
}
}
SILValue swift::stripUnaryAddressProjections(SILValue V) {
while (true) {
V = stripSinglePredecessorArgs(V);
if (!Projection::isAddressProjection(V))
return V;
auto *Inst = cast<SILInstruction>(V);
if (Inst->getNumOperands() > 1)
return V;
V = Inst->getOperand(0);
}
}
SILValue swift::stripValueProjections(SILValue V) {
while (true) {
V = stripSinglePredecessorArgs(V);
if (!Projection::isObjectProjection(V))
return V;
V = cast<SILInstruction>(V)->getOperand(0);
}
}
SILValue swift::stripIndexingInsts(SILValue V) {
while (true) {
if (!isa<IndexingInst>(V))
return V;
V = cast<IndexingInst>(V)->getBase();
}
}
SILValue swift::stripExpectIntrinsic(SILValue V) {
auto *BI = dyn_cast<BuiltinInst>(V);
if (!BI)
return V;
if (BI->getIntrinsicInfo().ID != llvm::Intrinsic::expect)
return V;
return BI->getArguments()[0];
}
namespace {
enum class OwnershipQualifiedKind {
NotApplicable,
Qualified,
Unqualified,
};
struct OwnershipQualifiedKindVisitor : SILInstructionVisitor<OwnershipQualifiedKindVisitor, OwnershipQualifiedKind> {
OwnershipQualifiedKind visitValueBase(ValueBase *V) {
return OwnershipQualifiedKind::NotApplicable;
}
#define QUALIFIED_INST(CLASS) \
OwnershipQualifiedKind visit ## CLASS(CLASS *I) { \
return OwnershipQualifiedKind::Qualified; \
}
QUALIFIED_INST(EndBorrowInst)
QUALIFIED_INST(LoadBorrowInst)
QUALIFIED_INST(CopyValueInst)
QUALIFIED_INST(CopyUnownedValueInst)
QUALIFIED_INST(DestroyValueInst)
#undef QUALIFIED_INST
OwnershipQualifiedKind visitLoadInst(LoadInst *LI) {
if (LI->getOwnershipQualifier() == LoadOwnershipQualifier::Unqualified)
return OwnershipQualifiedKind::Unqualified;
return OwnershipQualifiedKind::Qualified;
}
OwnershipQualifiedKind visitStoreInst(StoreInst *SI) {
if (SI->getOwnershipQualifier() == StoreOwnershipQualifier::Unqualified)
return OwnershipQualifiedKind::Unqualified;
return OwnershipQualifiedKind::Qualified;
}
};
} // end anonymous namespace
bool FunctionOwnershipEvaluator::evaluate(SILInstruction *I) {
assert(I->getFunction() == F.get() && "Can not evaluate function ownership "
"implications of an instruction that "
"does not belong to the instruction "
"that we are evaluating");
switch (OwnershipQualifiedKindVisitor().visit(I)) {
case OwnershipQualifiedKind::Unqualified: {
// If we already know that the function has unqualified ownership, just
// return early.
if (!F.get()->hasQualifiedOwnership())
return true;
// Ok, so we know at this point that we have qualified ownership. If we have
// seen any instructions with qualified ownership, we have an error since
// the function mixes qualified and unqualified instructions.
if (HasOwnershipQualifiedInstruction)
return false;
// Otherwise, set the function to have unqualified ownership. This will
// ensure that no more Qualified instructions can be added to the given
// function.
F.get()->setUnqualifiedOwnership();
return true;
}
case OwnershipQualifiedKind::Qualified: {
// First check if our function has unqualified ownership. If we already do
// have unqualified ownership, then we know that we have already seen an
// unqualified ownership instruction. This means the function has both
// qualified and unqualified instructions. =><=.
if (!F.get()->hasQualifiedOwnership())
return false;
// Ok, at this point we know that we are still qualified. Since functions
// start as qualified, we need to set the HasOwnershipQualifiedInstructions
// so we do not need to look back through the function if we see an
// unqualified instruction later on.
HasOwnershipQualifiedInstruction = true;
return true;
}
case OwnershipQualifiedKind::NotApplicable: {
// Not Applicable instr
return true;
}
}
}
| {
"content_hash": "2f19e4c6ca18665fb494f18769f89c73",
"timestamp": "",
"source": "github",
"line_count": 292,
"max_line_length": 117,
"avg_line_length": 28.575342465753426,
"alnum_prop": 0.6782118887823586,
"repo_name": "therealbnut/swift",
"id": "35b0e9fcef8a4630654003de7520beb96da1475f",
"size": "9118",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/SIL/InstructionUtils.cpp",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "2144"
},
{
"name": "C",
"bytes": "49224"
},
{
"name": "C++",
"bytes": "21531882"
},
{
"name": "CMake",
"bytes": "330668"
},
{
"name": "DTrace",
"bytes": "3545"
},
{
"name": "Emacs Lisp",
"bytes": "54383"
},
{
"name": "LLVM",
"bytes": "56821"
},
{
"name": "Makefile",
"bytes": "1841"
},
{
"name": "Objective-C",
"bytes": "227503"
},
{
"name": "Objective-C++",
"bytes": "209373"
},
{
"name": "Perl",
"bytes": "2211"
},
{
"name": "Python",
"bytes": "687607"
},
{
"name": "Ruby",
"bytes": "2091"
},
{
"name": "Shell",
"bytes": "189237"
},
{
"name": "Swift",
"bytes": "16355303"
},
{
"name": "VimL",
"bytes": "13393"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Resume - Start Bootstrap Theme</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom fonts for this template -->
<link href="https://fonts.googleapis.com/css?family=Saira+Extra+Condensed:100,200,300,400,500,600,700,800,900" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
<link href="vendor/devicons/css/devicons.min.css" rel="stylesheet">
<link href="vendor/simple-line-icons/css/simple-line-icons.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/resume.min.css" rel="stylesheet">
</head>
<body id="page-top">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary fixed-top" id="sideNav">
<a class="navbar-brand js-scroll-trigger" href="#page-top">
<span class="d-block d-lg-none"></span>
<span class="d-none d-lg-block">
<img class="img-fluid img-profile rounded-circle mx-auto mb-2" src="img/profile.jpg" alt="">
</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#about">About</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#experience">Experience</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#education">Education</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#skills">Skills</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#interests">Interests</a>
</li>
<li class="nav-item">
<a class="nav-link js-scroll-trigger" href="#blog">Blog</a>
</li>
</ul>
</div>
</nav>
<div class="container-fluid p-0">
<section class="resume-section p-3 p-lg-5 d-flex d-column" id="about">
<div class="my-auto">
<h1 class="mb-0">Alicia
<span class="text-primary">MacLennan</span>
</h1>
<div class="subheading mb-5">· Los Angeles, CA · (240) 498-2130 ·
<a href="mailto:[email protected]">[email protected]</a> ·
</div>
<p class="mb-5">I am a Web Developer.</p>
<ul class="list-inline list-social-icons mb-0">
<li class="list-inline-item">
<a href="https://www.facebook.com/alicia.maclennan.3">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li class="list-inline-item">
<a href="https://twitter.com/Aflyingfemme">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li class="list-inline-item">
<a href="https://www.linkedin.com/in/aliciamaclennan/">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-linkedin fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li class="list-inline-item">
<a href="https://github.com/yokuba">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
</div>
</section>
<section class="resume-section p-3 p-lg-5 d-flex flex-column" id="experience">
<div class="my-auto">
<h2 class="mb-5">Experience</h2>
<div class="resume-item d-flex flex-column flex-md-row mb-5">
<div class="resume-content mr-auto">
<h3 class="mb-0">Web Developer</h3>
<div class="subheading mb-3">University of Southern California</div>
<p>I contribute to open-source software projects at the Digital Innovation and Communication Department within the <a href="https://sc-ctsi.org/">Clinical Translational and Science Institute</a>.</p>
</div>
<div class="resume-date text-md-right">
<span class="text-primary">December 2016 - Present</span>
</div>
</div>
<div class="resume-item d-flex flex-column flex-md-row mb-5">
<div class="resume-content mr-auto">
<h3 class="mb-0"></h3>
<div class="subheading mb-3"></div>
<p></p>
</div>
<div class="resume-date text-md-right">
<span class="text-primary"></span>
</div>
</div>
<div class="resume-item d-flex flex-column flex-md-row mb-5">
<div class="resume-content mr-auto">
<h3 class="mb-0"></h3>
<div class="subheading mb-3"></div>
<p></p>
</div>
<div class="resume-date text-md-right">
<span class="text-primary"></span>
</div>
</div>
</div>
</section>
<section class="resume-section p-3 p-lg-5 d-flex flex-column" id="education">
<div class="my-auto">
<h2 class="mb-5">Education</h2>
<div class="resume-item d-flex flex-column flex-md-row mb-5">
<div class="resume-content mr-auto">
<h3 class="mb-0">University of Southern New Hampshire</h3>
<div class="subheading mb-3">Master of Science</div>
<div>Information Technology</div>
</div>
<div class="resume-date text-md-right">
<span class="text-primary">January 2014 - July 2015</span>
</div>
</div>
</div>
</section>
<section class="resume-section p-3 p-lg-5 d-flex flex-column" id="skills">
<div class="my-auto">
<h2 class="mb-5">Skills</h2>
<h3 class="mb-5">this literally tells you NOTHING other than I know how to put some icons on a page</h2>
<div class="subheading mb-3">Programming Languages & Tools</div>
<ul class="list-inline list-icons">
<li class="list-inline-item">
<i class="devicons devicons-ruby"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-html5"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-css3"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-javascript"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-jquery"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-linux"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-bootstrap"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-wordpress"></i>
</li>
<li class="list-inline-item">
<i class="devicons devicons-npm"></i>
</li>
</ul>
<section class="resume-section p-3 p-lg-5 d-flex flex-column" id="interests">
<div class="my-auto">
<h2 class="mb-5">Interests</h2>
<p>Apart from being a web developer, I enjoy most of my time being outdoors running long distances.</p>
<p class="mb-0"></p>
</div>
</section>
<section class="resume-section p-3 p-lg-5 d-flex flex-column" id="blog">
<div class="my-auto">
<h2 class="mb-5">Blog</h2>
<ul class="fa-ul mb-0">
<li>
<i class="fa-li fa fa-trophy text-warning"></i>
It is Dec 30th, 2018. It's approximately 2 minutes after midnite. I am helping my sister pick out a cheap, mid-range laptop. She'll likely get a Lenovo, as they have decent specs, like 8 GB RAM, 512 GB SSD storage (holy crap, memory is cheap), AMD Ryzen 7 processor, 9.5 hours of battery life (bullshit). Ok, she went to bed. I should do the same. But first - a couple of new years resolutions: </li>
<li>more meditation</li>
<li>learn classical guitar - even if it's just to play really, really shittily</li>
<li>run more (no-brainer, but i'll put it here to get an immediate sense of accomplishment)</li>
<li>learn C++ bc it'll help with everything else</li>
<li>learn C++ bc it'll help with everything else</li>
<li>learn C++ bc it'll help with everything else</li>
<li>Also, I really should add to <a href="notes.html">this</a></li>
</ul>
</div>
</section>
</div>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- Plugin JavaScript -->
<script src="vendor/jquery-easing/jquery.easing.min.js"></script>
<!-- Custom scripts for this template -->
<script src="js/resume.min.js"></script>
</body>
</html>
| {
"content_hash": "e2e822d268bd21f5492f74b739661955",
"timestamp": "",
"source": "github",
"line_count": 244,
"max_line_length": 414,
"avg_line_length": 42.192622950819676,
"alnum_prop": 0.5445361826129189,
"repo_name": "yokuba/yokuba.github.io",
"id": "7d8ee5c76e3b4c367c6a784a376073aca6818173",
"size": "10299",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.html",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6334"
},
{
"name": "HTML",
"bytes": "15021"
},
{
"name": "JavaScript",
"bytes": "4416"
}
],
"symlink_target": ""
} |
set -e
set -x
set -u
CACHE_CONTROL="Cache-Control:private, max-age=0, no-transform"
USAGE="Usage: $0 <project>"
PROJECT=${1:?Please provide project name: $USAGE}
GROUP=${2:?Please provide monitoring group name: $USAGE}
# Root directory of this script.
SCRIPTDIR=$( dirname "${BASH_SOURCE[0]}" )
BASEDIR=${PWD}
# Generate the configs.
${SCRIPTDIR}/generate_prometheus_targets.sh ${GROUP}
# Authenticate all operations using the given service account.
if [[ -f /tmp/${PROJECT}.json ]] ; then
gcloud auth activate-service-account --key-file /tmp/${PROJECT}.json
else
echo "Service account key not found at /tmp/${PROJECT}.json!!"
echo "Using default credentials."
fi
# Copy the configs to GCS.
gsutil -h "$CACHE_CONTROL" cp -r \
${BASEDIR}/gen/${PROJECT}/prometheus \
gs://operator-${PROJECT}
| {
"content_hash": "bd10a1ab4c0dad3eaecd3b606d1aeda2",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 70,
"avg_line_length": 26.9,
"alnum_prop": 0.7050805452292441,
"repo_name": "stephen-soltesz/operator",
"id": "768f8e794de6e7afaae501b13be55111362a2f63",
"size": "820",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "deploy_prometheus_targets.sh",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "Python",
"bytes": "185156"
},
{
"name": "Shell",
"bytes": "6322"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
Index Fungorum
#### Published in
null
#### Original name
Fusarium oxysporum var. asclerotium Sherb.
### Remarks
null | {
"content_hash": "093cbe102cd727fd3f37f581b81e78d5",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 42,
"avg_line_length": 11.307692307692308,
"alnum_prop": 0.7210884353741497,
"repo_name": "mdoering/backbone",
"id": "ec9252affa380f5eb220d329369380c581e9d3f0",
"size": "213",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Fungi/Ascomycota/Sordariomycetes/Hypocreales/Nectriaceae/Fusarium/Fusarium oxysporum/Fusarium oxysporum asclerotium/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package com.amazonaws.services.servicecatalog.model.transform;
import javax.annotation.Generated;
import com.amazonaws.SdkClientException;
import com.amazonaws.services.servicecatalog.model.*;
import com.amazonaws.protocol.*;
import com.amazonaws.annotation.SdkInternalApi;
/**
* ListProvisioningArtifactsRequestMarshaller
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
@SdkInternalApi
public class ListProvisioningArtifactsRequestMarshaller {
private static final MarshallingInfo<String> ACCEPTLANGUAGE_BINDING = MarshallingInfo.builder(MarshallingType.STRING)
.marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("AcceptLanguage").build();
private static final MarshallingInfo<String> PRODUCTID_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)
.marshallLocationName("ProductId").build();
private static final ListProvisioningArtifactsRequestMarshaller instance = new ListProvisioningArtifactsRequestMarshaller();
public static ListProvisioningArtifactsRequestMarshaller getInstance() {
return instance;
}
/**
* Marshall the given parameter object.
*/
public void marshall(ListProvisioningArtifactsRequest listProvisioningArtifactsRequest, ProtocolMarshaller protocolMarshaller) {
if (listProvisioningArtifactsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listProvisioningArtifactsRequest.getAcceptLanguage(), ACCEPTLANGUAGE_BINDING);
protocolMarshaller.marshall(listProvisioningArtifactsRequest.getProductId(), PRODUCTID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
}
}
| {
"content_hash": "af79f960d0825d1ff4e2cf76a6565dac",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 159,
"avg_line_length": 40.170212765957444,
"alnum_prop": 0.763771186440678,
"repo_name": "aws/aws-sdk-java",
"id": "8f0ae561f0a14a287fb85647f8d3b82334bc6a06",
"size": "2468",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "aws-java-sdk-servicecatalog/src/main/java/com/amazonaws/services/servicecatalog/model/transform/ListProvisioningArtifactsRequestMarshaller.java",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>vst-32: Not compatible 👼</title>
<link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" />
<link href="../../../../../bootstrap.min.css" rel="stylesheet">
<link href="../../../../../bootstrap-custom.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<script src="../../../../../moment.min.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<div class="navbar navbar-default" role="navigation">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="../..">clean / released</a></li>
<li class="active"><a href="">8.7.1+2 / vst-32 - 2.7</a></li>
</ul>
</div>
</div>
</div>
<div class="article">
<div class="row">
<div class="col-md-12">
<a href="../..">« Up</a>
<h1>
vst-32
<small>
2.7
<span class="label label-info">Not compatible 👼</span>
</small>
</h1>
<p>📅 <em><script>document.write(moment("2022-11-21 01:45:33 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-11-21 01:45:33 UTC)</em><p>
<h2>Context</h2>
<pre># Packages matching: installed
# Name # Installed # Synopsis
base-bigarray base
base-threads base
base-unix base
camlp5 7.14 Preprocessor-pretty-printer of OCaml
conf-findutils 1 Virtual package relying on findutils
conf-perl 2 Virtual package relying on perl
coq 8.7.1+2 Formal proof management system
num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic
ocaml 4.06.1 The OCaml compiler (virtual package)
ocaml-base-compiler 4.06.1 Official 4.06.1 release
ocaml-config 1 OCaml Switch Configuration
ocamlfind 1.9.5 A library manager for OCaml
# opam file:
opam-version: "2.0"
synopsis: "Verified Software Toolchain"
description: "The software toolchain includes static analyzers to check assertions about your program; optimizing compilers to translate your program to machine language; operating systems and libraries to supply context for your program. The Verified Software Toolchain project assures with machine-checked proofs that the assertions claimed at the top of the toolchain really hold in the machine-language program, running in the operating-system context."
authors: [
"Andrew W. Appel"
"Lennart Beringer"
"Sandrine Blazy"
"Qinxiang Cao"
"Santiago Cuellar"
"Robert Dockins"
"Josiah Dodds"
"Nick Giannarakis"
"Samuel Gruetter"
"Aquinas Hobor"
"Jean-Marie Madiot"
"William Mansky"
]
maintainer: "VST team"
homepage: "http://vst.cs.princeton.edu/"
dev-repo: "git+https://github.com/PrincetonUniversity/VST.git"
bug-reports: "https://github.com/PrincetonUniversity/VST/issues"
license: "https://raw.githubusercontent.com/PrincetonUniversity/VST/master/LICENSE"
build: [
[make "-j%{jobs}%" "BITSIZE=32"]
]
install: [
[make "install" "BITSIZE=32"]
]
depends: [
"ocaml"
"coq" {>= "8.12" & < "8.13.2"}
"coq-compcert-32" {(= "3.8") | (= "3.8~open-source")}
"coq-flocq" {>= "3.2.1"}
]
tags: [
"category:Computer Science/Semantics and Compilation/Semantics"
"keyword:C"
"logpath:VST"
"date:2020-12-20"
]
patches: ["makefile.patch"]
url {
src: "https://github.com/PrincetonUniversity/VST/archive/v2.7.tar.gz"
checksum: "sha256=970be13e71bdb013e2b9de64aecf1dda08228dd8ef3a1f6e4bb23ccd3a0896d3"
}
</pre>
<h2>Lint</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Dry install 🏜️</h2>
<p>Dry install with the current Coq version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam install -y --show-action coq-vst-32.2.7 coq.8.7.1+2</code></dd>
<dt>Return code</dt>
<dd>5120</dd>
<dt>Output</dt>
<dd><pre>[NOTE] Package coq is already installed (current version is 8.7.1+2).
The following dependencies couldn't be met:
- coq-vst-32 -> coq >= 8.12 -> ocaml >= 4.09.0
base of this switch (use `--unlock-base' to force)
Your request can't be satisfied:
- No available version of coq satisfies the constraints
No solution found, exiting
</pre></dd>
</dl>
<p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-vst-32.2.7</code></dd>
<dt>Return code</dt>
<dd>0</dd>
</dl>
<h2>Install dependencies</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Install 🚀</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Duration</dt>
<dd>0 s</dd>
</dl>
<h2>Installation size</h2>
<p>No files were installed.</p>
<h2>Uninstall 🧹</h2>
<dl class="dl-horizontal">
<dt>Command</dt>
<dd><code>true</code></dd>
<dt>Return code</dt>
<dd>0</dd>
<dt>Missing removes</dt>
<dd>
none
</dd>
<dt>Wrong removes</dt>
<dd>
none
</dd>
</dl>
</div>
</div>
</div>
<hr/>
<div class="footer">
<p class="text-center">
Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣
</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../../../../../bootstrap.min.js"></script>
</body>
</html>
| {
"content_hash": "924a169c2852ab8e0470ed6cd18e19a7",
"timestamp": "",
"source": "github",
"line_count": 187,
"max_line_length": 467,
"avg_line_length": 41.42780748663102,
"alnum_prop": 0.5643474893507164,
"repo_name": "coq-bench/coq-bench.github.io",
"id": "41480f2f309b72ad0d673b09b6c474be500931ca",
"size": "7772",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.7.1+2/vst-32/2.7.html",
"mode": "33188",
"license": "mit",
"language": [],
"symlink_target": ""
} |
package org.fugerit.java.core.doc.test;
import java.io.File;
import jxl.Workbook;
import jxl.format.Colour;
import jxl.write.Label;
import jxl.write.Number;
import jxl.write.WritableCellFormat;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
public class TextXLS {
public static void main( String[] args ) {
try {
WritableWorkbook ww = Workbook.createWorkbook( new File( "dist/test-excel.xls" ) );
WritableSheet ws = ww.createSheet( "Test" , 0 );
WritableCellFormat cf = new WritableCellFormat();
cf.setBackground( Colour.GRAY_25 );
ws.addCell( new Label( 0, 0, "Col 1", cf ) );
ws.addCell( new Label( 1, 0, "Col 2", cf ) );
for ( int k=0; k<10; k++ ) {
ws.addCell( new Label( 0, k+1, "A "+k, cf ) );
ws.addCell( new Number( 1, k+1, Math.random(), cf ) );
}
ww.write();
ww.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
| {
"content_hash": "f436fa87d945ceb5952fef9964a7afd6",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 86,
"avg_line_length": 23.73170731707317,
"alnum_prop": 0.6094552929085303,
"repo_name": "fugeritaetas/morozko-lib",
"id": "1504d985cca44e966d8d8d538ff7060fb65f5879",
"size": "973",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "java16-fugerit/org.fugerit.java.core/src/main/java/org/fugerit/java/core/doc/test/TextXLS.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "100"
},
{
"name": "CSS",
"bytes": "3435"
},
{
"name": "HTML",
"bytes": "674165"
},
{
"name": "Java",
"bytes": "5309090"
},
{
"name": "PLSQL",
"bytes": "2172"
},
{
"name": "Shell",
"bytes": "239"
}
],
"symlink_target": ""
} |
import lxml.builder
import lxml.etree
class ASATSerializable(object):
""" A mixin for a class that can be serialized to match ASAT """
ELEMENT_CLASS = lxml.etree.Element
def __init__(self):
super(ASATSerializable, self).__init__()
# Generic LXML Make/Load Elements
def _saveToXMLElement(self, name):
return self.ELEMENT_CLASS(name)
def _initializeFromXMLElement(self, node):
pass
# Override to Determine Data Load/Save
def getASATData(self, name):
return self._saveToXMLElement(name)
def loadFromASATData(self, node):
self._initializeFromXMLElement(node)
@classmethod
def createFromASATData(cls, node):
x = cls()
x.loadFromASATData(node)
return x
# To/From XML Strings
def outputASATDataStr(self, name):
node = self.getASATData(name)
return lxml.etree.tostring(node)
def loadFromASATDataStr(self, xml):
node = lxml.etree.fromstring(xml)
self.loadFromASATData(node)
@classmethod
def createFromASATDataStr(cls, xml):
x = cls()
x.loadFromASATDataStr(xml)
return x
# Helper Functions for Common Special Cases
def _makeASATDataSeq(self, name, itemName, sequence, idTag=None):
seq = [s.getASATData(itemName) for s in sequence]
if idTag is not None:
for i, x in enumerate(seq):
x.attrib[idTag] = unicode(i+1)
if name is None:
return seq
else:
x = self.ELEMENT_CLASS(name)
x.extend(seq)
return x
def _loadASATDataSeq(self, itemClass, node, idTag=None, name=None):
"""
Load a sequence of ASAT data from XML nodes to Python
@param itemClass: The class to create from this data
@type itemClass: AutoTutorInterpreter.Utilities.ASATSerializable.ASATSerializable
@param node: The node to draw data from. Its children will be loaded.
@type type: lxml.etree.Element
@param idTag: Tag in the data to look for, which determines ordering
@type idTag: str
"""
if name is None:
nodes = [node]
else:
name = name.lower()
nodes = [x for x in node if isinstance(x.tag, basestring) and name == x.tag.lower()]
fullSeq = []
for n in nodes:
if idTag is None:
seq = [itemClass.createFromASATData(s) for s in n
if isinstance(s.tag, basestring)]
else:
def getId(x, default):
if idTag in x.attrib:
return x.attrib[idTag]
else:
return str(default)
seq = [(int(getId(s, i)), itemClass.createFromASATData(s)) for i, s in enumerate(n)
if isinstance(s.tag, basestring)]
seq.sort()
seq = [obj for (i, obj) in seq]
fullSeq.extend(seq)
return fullSeq
| {
"content_hash": "d442128b5246f34e03d0b445fe55529e",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 99,
"avg_line_length": 32.90217391304348,
"alnum_prop": 0.578790882061447,
"repo_name": "GeneralizedLearningUtilities/SuperGLU",
"id": "4d0ee3423ef21821612836eccd6b8bb2477e98d1",
"size": "3027",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "python_module/SuperGLU/Services/TextProcessing/Utilities/ASATSerialization.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "84557"
},
{
"name": "CSS",
"bytes": "330052"
},
{
"name": "HTML",
"bytes": "366505"
},
{
"name": "Java",
"bytes": "428613"
},
{
"name": "JavaScript",
"bytes": "2383980"
},
{
"name": "Python",
"bytes": "1154612"
}
],
"symlink_target": ""
} |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
// ------------------------------------------------------------------------
/**
* ExpressionEngine Channel Parser Component (Switch)
*
* @package ExpressionEngine
* @subpackage Core
* @category Core
* @author EllisLab Dev Team
* @link http://ellislab.com
*/
class EE_Channel_switch_parser implements EE_Channel_parser_component {
/**
* Quick check if they're using switch
*
* @param array A list of "disabled" features
* @return Boolean Is disabled?
*/
public function disabled(array $disabled, EE_Channel_preparser $pre)
{
return ! $pre->has_tag('switch');
}
// ------------------------------------------------------------------------
/**
* No preprocessing required.
*
* @param String The tagdata to be parsed
* @param Object The preparser object.
* @return void
*/
public function pre_process($tagdata, EE_Channel_preparser $pre)
{
return NULL;
}
// ------------------------------------------------------------------------
/**
* Replace the switch tag based on what step of the loop we're in.
*
* @param String The tagdata to be parsed
* @param Object The channel parser object
* @param Mixed The results from the preparse method
*
* @return String The processed tagdata
*/
public function replace($tagdata, EE_Channel_data_parser $obj, $pre)
{
return ee()->TMPL->parse_switch($tagdata, $obj->count(), $obj->prefix());
}
} | {
"content_hash": "a735d01e2d945697317025328ddba5d6",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 76,
"avg_line_length": 25.53448275862069,
"alnum_prop": 0.5712356515867657,
"repo_name": "elearninglondon/ematrix_2015",
"id": "5f4ba3f3a4792b1a17fbbb61ec739a089407ee16",
"size": "1783",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "system/expressionengine/libraries/channel_entries_parser/components/Switch.php",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "232321"
},
{
"name": "JavaScript",
"bytes": "56826"
},
{
"name": "PHP",
"bytes": "7280637"
},
{
"name": "Perl",
"bytes": "26515"
}
],
"symlink_target": ""
} |
import 'mocha';
import * as assert from 'assert';
import * as sinon from 'sinon';
import {run, setup, Sources, Sinks, Driver} from '../lib';
import {setAdapt} from '../lib/adapt';
import xs, {Stream} from 'xstream';
import concat from 'xstream/extra/concat';
import delay from 'xstream/extra/delay';
let window: any;
if (typeof global === 'object') {
(global as any).window = {};
window = (global as any).window;
}
describe('setup', function() {
it('should be a function', function() {
assert.strictEqual(typeof setup, 'function');
});
it('should throw if first argument is not a function', function() {
assert.throws(() => {
(setup as any)('not a function');
}, /First argument given to Cycle must be the 'main' function/i);
});
it('should throw if second argument is not an object', function() {
assert.throws(() => {
(setup as any)(() => {}, 'not an object');
}, /Second argument given to Cycle must be an object with driver functions/i);
});
it('should throw if second argument is an empty object', function() {
assert.throws(() => {
(setup as any)(() => {}, {});
}, /Second argument given to Cycle must be an object with at least one/i);
});
it('should return sinks object and sources object', function() {
function app(ext: any): any {
return {
other: ext.other.take(1).startWith('a'),
};
}
function driver() {
return xs.of('b');
}
let {sinks, sources} = setup(app, {other: driver});
assert.strictEqual(typeof sinks, 'object');
assert.strictEqual(typeof sinks.other.addListener, 'function');
assert.strictEqual(typeof sources, 'object');
assert.notStrictEqual(typeof sources.other, 'undefined');
assert.notStrictEqual(sources.other, null);
assert.strictEqual(typeof sources.other.addListener, 'function');
});
it('should type-check keyof sources and sinks in main and drivers', function() {
type Sources = {
str: Stream<string>;
obj: Stream<object>;
};
function app(sources: Sources) {
return {
str: sources.str.take(1).startWith('a'), // good
// str: sources.obj.mapTo('good'), // good
// strTYPO: sources.str.take(1).startWith('a'), // bad
// str: xs.of(123), // bad
num: xs.of(100), // good
// numTYPO: xs.of(100), // bad
// num: xs.of('BAD TYPE'), // bad
};
}
const stringDriver: Driver<Stream<string>, Stream<string>> = (
sink: Stream<string>,
) => xs.of('b');
const numberWriteOnlyDriver: Driver<Stream<number>, void> = (
sink: Stream<number>,
) => {};
const objectReadOnlyDriver: Driver<void, Stream<object>> = () => xs.of({});
setup(app, {
str: stringDriver,
num: numberWriteOnlyDriver,
obj: objectReadOnlyDriver,
});
});
it('should type-check keyof sources and sinks, supporting interfaces', function() {
interface Sources {
str: Stream<string>;
obj: Stream<object>;
}
interface Sinks {
str: Stream<string>;
num: Stream<number>;
}
function app(sources: Sources): Sinks {
return {
str: sources.str.take(1).startWith('a'), // good
// str: sources.obj.mapTo('good'), // good
// strTYPO: sources.str.take(1).startWith('a'), // bad
// str: xs.of(123), // bad
num: xs.of(100), // good
// numTYPO: xs.of(100), // bad
// num: xs.of('BAD TYPE'), // bad
};
}
const stringDriver: Driver<Stream<string>, Stream<string>> = (
sink: Stream<string>,
) => xs.of('b');
const numberWriteOnlyDriver: Driver<Stream<number>, void> = (
sink: Stream<number>,
) => {};
const objectReadOnlyDriver: Driver<void, Stream<object>> = () => xs.of({});
setup(app, {
str: stringDriver,
num: numberWriteOnlyDriver,
obj: objectReadOnlyDriver,
});
});
it('should type-check and allow more drivers than sinks', function() {
type Sources = {
str: Stream<string>;
num: Stream<number>;
obj: Stream<object>;
};
function app(sources: Sources) {
return {};
}
function stringDriver(sink: Stream<string>) {
return xs.of('b');
}
const numberDriver = (sink: Stream<number>) => xs.of(100);
const objectReadOnlyDriver = () => xs.of({});
setup(app, {
str: stringDriver,
num: numberDriver,
obj: objectReadOnlyDriver,
});
});
it('should call DevTool internal function to pass sinks', function() {
let sandbox = sinon.sandbox.create();
let spy = sandbox.spy();
window['CyclejsDevTool_startGraphSerializer'] = spy;
function app(ext: any): any {
return {
other: ext.other.take(1).startWith('a'),
};
}
function driver() {
return xs.of('b');
}
run(app, {other: driver});
sinon.assert.calledOnce(spy);
});
it('should return a run() which in turn returns a dispose()', function(done) {
type TestSources = {
other: Stream<number>;
};
function app(sources: TestSources) {
return {
other: concat(
sources.other.take(6).map(x => String(x)).startWith('a'),
xs.never(),
),
};
}
function driver(sink: Stream<string>) {
return sink.map(x => x.charCodeAt(0)).compose(delay(1));
}
const {sources, run} = setup(app, {other: driver});
let dispose: any;
sources.other.addListener({
next: x => {
assert.strictEqual(x, 97);
dispose(); // will trigger this listener's complete
},
error: err => done(err),
complete: () => done(),
});
dispose = run();
});
it('should support sink-only drivers', function(done) {
function app(sources: any): any {
return {
other: xs.of(1, 2, 3),
};
}
let driverCalled = false;
function driver(sink: Stream<string>) {
assert.strictEqual(typeof sink, 'object');
assert.strictEqual(typeof sink.fold, 'function');
driverCalled = true;
}
run(app, {other: driver});
assert.strictEqual(driverCalled, true);
done();
});
it('should not adapt() sinks', function(done) {
function app(sources: any): any {
return {
other: xs.of(1, 2, 3),
};
}
let driverCalled = false;
function driver(sink: Stream<string>) {
assert.strictEqual(typeof sink, 'object');
assert.strictEqual(typeof sink.fold, 'function');
driverCalled = true;
return xs.of(10, 20, 30);
}
setAdapt(stream => 'this not a stream');
run(app, {other: driver});
setAdapt(x => x);
assert.strictEqual(driverCalled, true);
done();
});
it('should adapt() a simple source (stream)', function(done) {
let appCalled = false;
function app(sources: any): any {
assert.strictEqual(typeof sources.other, 'string');
assert.strictEqual(sources.other, 'this is adapted');
appCalled = true;
return {
other: xs.of(1, 2, 3),
};
}
function driver(sink: Stream<string>) {
return xs.of(10, 20, 30);
}
setAdapt(stream => 'this is adapted');
run(app, {other: driver});
setAdapt(x => x);
assert.strictEqual(appCalled, true);
done();
});
it('should not work after has been disposed', function(done) {
type MySources = {
other: Stream<string>;
};
function app(sources: MySources) {
return {other: xs.periodic(100).map(i => i + 1)};
}
function driver(num$: Stream<number>): Stream<string> {
return num$.map(num => 'x' + num);
}
const {sources, run} = setup(app, {
other: driver,
});
let dispose: any;
sources.other.addListener({
next: x => {
assert.notStrictEqual(x, 'x3');
if (x === 'x2') {
dispose(); // will trigger this listener's complete
}
},
error: err => done(err),
complete: () => done(),
});
dispose = run();
});
});
describe('run', function() {
it('should be a function', function() {
assert.strictEqual(typeof run, 'function');
});
it('should throw if first argument is not a function', function() {
assert.throws(() => {
(run as any)('not a function');
}, /First argument given to Cycle must be the 'main' function/i);
});
it('should throw if second argument is not an object', function() {
assert.throws(() => {
(run as any)(() => {}, 'not an object');
}, /Second argument given to Cycle must be an object with driver functions/i);
});
it('should throw if second argument is an empty object', function() {
assert.throws(() => {
(run as any)(() => {}, {});
}, /Second argument given to Cycle must be an object with at least one/i);
});
it('should return a dispose function', function() {
let sandbox = sinon.sandbox.create();
const spy = sandbox.spy();
type NiceSources = {
other: Stream<string>;
};
type NiceSinks = {
other: Stream<string>;
};
function app(sources: NiceSources): NiceSinks {
return {
other: sources.other.take(1).startWith('a'),
};
}
function driver() {
return xs.of('b').debug(spy);
}
let dispose = run(app, {other: driver});
assert.strictEqual(typeof dispose, 'function');
sinon.assert.calledOnce(spy);
dispose();
});
it('should happen synchronously', function(done) {
let sandbox = sinon.sandbox.create();
const spy = sandbox.spy();
function app(sources: any): any {
sources.other.addListener({
next: () => {},
error: () => {},
complete: () => {},
});
return {
other: xs.of(10),
};
}
let mutable = 'correct';
function driver(sink: Stream<number>): Stream<string> {
return sink.map(x => 'a' + 10).debug(x => {
assert.strictEqual(x, 'a10');
assert.strictEqual(mutable, 'correct');
spy();
});
}
run(app, {other: driver});
mutable = 'wrong';
setTimeout(() => {
sinon.assert.calledOnce(spy);
done();
}, 20);
});
it('should support driver that asynchronously subscribes to sink', function(
done,
) {
function app(sources: any): any {
return {
foo: xs.of(10),
};
}
const expected = [10];
function driver(sink: Stream<number>): Stream<any> {
setTimeout(() => {
sink.subscribe({
next(x) {
assert.strictEqual(x, expected.shift());
},
error() {},
complete() {},
});
});
return xs.never();
}
run(app, {foo: driver});
setTimeout(() => {
assert.strictEqual(expected.length, 0);
done();
}, 100);
});
it('should report errors from main() in the console', function(done) {
let sandbox = sinon.sandbox.create();
sandbox.stub(console, 'error');
function main(sources: any): any {
return {
other: sources.other.take(1).startWith('a').map(() => {
throw new Error('malfunction');
}),
};
}
function driver(sink: Stream<any>) {
sink.addListener({
next: () => {},
error: (err: any) => {},
});
return xs.of('b');
}
let caught = false;
try {
run(main, {other: driver});
} catch (e) {
assert.strictEqual(e.message, 'malfunction');
caught = true;
}
setTimeout(() => {
sinon.assert.calledOnce(console.error as any);
sinon.assert.calledWithExactly(
console.error as any,
sinon.match('malfunction'),
);
// Should be false because the error was already reported in the console.
// Otherwise we would have double reporting of the error.
assert.strictEqual(caught, false);
sandbox.restore();
done();
}, 80);
});
});
| {
"content_hash": "d1893392e16ce7a98e8847287d84d098",
"timestamp": "",
"source": "github",
"line_count": 457,
"max_line_length": 85,
"avg_line_length": 26.074398249452955,
"alnum_prop": 0.5667170191339376,
"repo_name": "feliciousx-open-source/cyclejs",
"id": "2e586c50e0654e679d5afc020d8b590f26431751",
"size": "11916",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "run/test/index.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "52"
},
{
"name": "HTML",
"bytes": "3428"
},
{
"name": "JavaScript",
"bytes": "21291"
},
{
"name": "Makefile",
"bytes": "5407"
},
{
"name": "Shell",
"bytes": "4605"
},
{
"name": "TypeScript",
"bytes": "429908"
}
],
"symlink_target": ""
} |
package com.amazonaws.eclipse.core.telemetry;
import static com.amazonaws.eclipse.core.telemetry.internal.Constants.JAVA_PREFERENCE_NODE_FOR_AWS_TOOLKIT_FOR_ECLIPSE;
import static com.amazonaws.eclipse.core.telemetry.internal.Constants.MOBILE_ANALYTICS_CLIENT_ID_PREF_STORE_KEY;
import java.util.Locale;
import java.util.UUID;
import java.util.prefs.BackingStoreException;
import java.util.prefs.Preferences;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.jface.preference.IPreferenceStore;
import org.osgi.framework.Bundle;
import com.amazonaws.annotation.Immutable;
import com.amazonaws.eclipse.core.AwsToolkitCore;
import com.amazonaws.eclipse.core.telemetry.internal.Constants;
import com.amazonaws.util.StringUtils;
/**
* Container for all the data required in the x-amz-client-context header.
*
* @see http://docs.aws.amazon.com/mobileanalytics/latest/ug/PutEvents.html#putEvents-request-client-context-header
*/
@Immutable
public class ClientContextConfig {
private final String envPlatformName;
private final String envPlatformVersion;
private final String eclipseVersion;
private final String envLocale;
private final String clientId;
private final String version;
public static final ClientContextConfig PROD_CONFIG = new ClientContextConfig(
_getSystemOsName(), _getSystemOsVersion(),
_getSystemLocaleCountry(), getOrGenerateClientId());
public static final ClientContextConfig TEST_CONFIG = new ClientContextConfig(
_getSystemOsName(), _getSystemOsVersion(),
_getSystemLocaleCountry(), getOrGenerateClientId());
private ClientContextConfig(String envPlatformName, String envPlatformVersion, String envLocale, String clientId) {
this.eclipseVersion = eclipseVersion();
this.version = getPluginVersion();
this.envPlatformName = envPlatformName;
this.envPlatformVersion = envPlatformVersion;
this.envLocale = envLocale;
this.clientId = clientId;
}
private String eclipseVersion() {
try {
Bundle bundle = Platform.getBundle("org.eclipse.platform");
return bundle.getVersion().toString();
} catch (Exception e) {
return "Unknown";
}
}
private String getPluginVersion() {
try {
Bundle bundle = Platform.getBundle("com.amazonaws.eclipse.core");
return bundle.getVersion().toString();
} catch (Exception e) {
return "Unknown";
}
}
public String getEnvPlatformName() {
return envPlatformName;
}
public String getEnvPlatformVersion() {
return envPlatformVersion;
}
public String getEnvLocale() {
return envLocale;
}
public String getClientId() {
return clientId;
}
public String getVersion() {
return version;
}
public String getEclipseVersion() {
return eclipseVersion;
}
private static String _getSystemOsName() {
try {
String osName = System.getProperty("os.name");
if (osName == null) {
return null;
}
osName = osName.toLowerCase();
if (osName.startsWith("windows")) {
return Constants.CLIENT_CONTEXT_ENV_PLATFORM_WINDOWS;
}
if (osName.startsWith("mac")) {
return Constants.CLIENT_CONTEXT_ENV_PLATFORM_MACOS;
}
if (osName.startsWith("linux")) {
return Constants.CLIENT_CONTEXT_ENV_PLATFORM_LINUX;
}
AwsToolkitCore.getDefault().logInfo("Unknown OS name: " + osName);
return null;
} catch (Exception e) {
return null;
}
}
private static String _getSystemOsVersion() {
try {
return System.getProperty("os.version");
} catch (Exception e) {
return null;
}
}
private static String _getSystemLocaleCountry() {
try {
return Locale.getDefault().getDisplayCountry(Locale.US);
} catch (Exception e) {
return null;
}
}
public static String getOrGenerateClientId() {
// This is the Java preferences scope
Preferences awsToolkitNode = Preferences.userRoot().node(JAVA_PREFERENCE_NODE_FOR_AWS_TOOLKIT_FOR_ECLIPSE);
String clientId = awsToolkitNode.get(MOBILE_ANALYTICS_CLIENT_ID_PREF_STORE_KEY, null);
if (!StringUtils.isNullOrEmpty(clientId)) {
return clientId;
}
// This is an installation scope PreferenceStore.
IEclipsePreferences eclipsePreferences = ConfigurationScope.INSTANCE.getNode(
AwsToolkitCore.getDefault().getBundle().getSymbolicName());
clientId = eclipsePreferences.get(MOBILE_ANALYTICS_CLIENT_ID_PREF_STORE_KEY, null);
if (StringUtils.isNullOrEmpty(clientId)) {
// This is an instance scope PreferenceStore.
IPreferenceStore store = AwsToolkitCore.getDefault().getPreferenceStore();
clientId = store.getString(MOBILE_ANALYTICS_CLIENT_ID_PREF_STORE_KEY);
}
if (StringUtils.isNullOrEmpty(clientId)) {
// Generate a GUID as the client id and persist it in the preference store
clientId = UUID.randomUUID().toString();
}
awsToolkitNode.put(MOBILE_ANALYTICS_CLIENT_ID_PREF_STORE_KEY, clientId);
try {
awsToolkitNode.flush();
} catch (BackingStoreException e) {
// Silently fails if exception occurs when flushing the client id.
}
return clientId;
}
}
| {
"content_hash": "2e8a7d3462533e00a56e1bbf40d7bb23",
"timestamp": "",
"source": "github",
"line_count": 172,
"max_line_length": 119,
"avg_line_length": 33.73255813953488,
"alnum_prop": 0.6585660117200965,
"repo_name": "aws/aws-toolkit-eclipse",
"id": "1e039e4ea2a206eff4d97117e77e783038c9559a",
"size": "6308",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "bundles/com.amazonaws.eclipse.core/src/com/amazonaws/eclipse/core/telemetry/ClientContextConfig.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "2016"
},
{
"name": "FreeMarker",
"bytes": "77017"
},
{
"name": "HTML",
"bytes": "3566"
},
{
"name": "Java",
"bytes": "5464354"
},
{
"name": "Shell",
"bytes": "3124"
},
{
"name": "XSLT",
"bytes": "485"
}
],
"symlink_target": ""
} |
`npm install`
#### Start Dev Server
`gulp dev`
#### Production Build
`gulp build` | {
"content_hash": "dcc28025d884a50e2a55ec11e003e81a",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 21,
"avg_line_length": 11.857142857142858,
"alnum_prop": 0.6626506024096386,
"repo_name": "dvorovenko/dvorovenko.github.io",
"id": "88a09c491122b07dadc4092a5d43b58c4aaa0ee9",
"size": "83",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "markup/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "8161"
},
{
"name": "JavaScript",
"bytes": "24323"
}
],
"symlink_target": ""
} |
ACCEPTED
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "f3b09b2629d1804fc886497bfc9fa06e",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.307692307692308,
"alnum_prop": 0.6940298507462687,
"repo_name": "mdoering/backbone",
"id": "8228544d974ceae147dfd3cc6c316704bddd3d38",
"size": "216",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Bryophyta/Bryopsida/Hookeriales/Daltoniaceae/Daltonia/Daltonia forsythii/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
class Formatron
module Generators
module Util
# generates placeholder README.md
module Gitignore
def self.write(directory)
FileUtils.mkdir_p directory
readme = File.join directory, '.gitignore'
File.write readme, <<-EOH.gsub(/^ {12}/, '')
/.formatron/
EOH
end
end
end
end
end
| {
"content_hash": "c2ef2d9e58a7210dc2c021b9e2b66610",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 54,
"avg_line_length": 23.375,
"alnum_prop": 0.5641711229946524,
"repo_name": "formatron/formatron",
"id": "42b6126d1df024e1245cba43d90b03b39d188431",
"size": "374",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/formatron/generators/util/gitignore.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "4260"
},
{
"name": "Ruby",
"bytes": "555413"
},
{
"name": "Shell",
"bytes": "115"
}
],
"symlink_target": ""
} |
import { expect } from 'chai';
import { getParamNames } from '../../util/param-name';
describe('paramName', () => {
describe('getFunctionParameterName', () => {
const func = (cake) => { return; };
const empty = () => { return; };
expect(getParamNames(func))
.to.deep.equal(['cake']);
expect(getParamNames(empty))
.to.deep.equal([]);
});
});
| {
"content_hash": "b4dda282a05fe7e2ae26616fc3e0ded8",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 54,
"avg_line_length": 27.2,
"alnum_prop": 0.5220588235294118,
"repo_name": "orbital-js/orbital",
"id": "a9fd397eeeece38dab06ce1809393884628e0093",
"size": "408",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "packages/core/src/test/util/param-name.spec.ts",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "TypeScript",
"bytes": "65411"
}
],
"symlink_target": ""
} |
'use strict';
module.exports = {
errors: [
'Oh Snap!',
'Ooops I did it again!',
'Hasta la vista Baby',
'Talk to the hand',
'I\'m sorry Dave, I\'m afraid there is nothing there',
'Error... Error... Error... Examine...',
'Something went wrong',
'Houston, we have a problem!',
'You have not received an error message lately so here is a random one.',
'Answer unknown. I shall analyze... Analysis complete: Insufficient data to resolve problem',
'Anomaly detected'
]
};
| {
"content_hash": "f2ae54f29e67660f38b57e3d373fb59c",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 95,
"avg_line_length": 28.88235294117647,
"alnum_prop": 0.6578411405295316,
"repo_name": "joellord/zut",
"id": "0500a302d6fc88c240c5ebed613106f4a3224142",
"size": "491",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "messages.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "2498"
}
],
"symlink_target": ""
} |
using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(WebServiceClient.Web.Startup))]
namespace WebServiceClient.Web
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
ConfigureAuth(app);
}
}
}
| {
"content_hash": "32e660c6d3fd9de0ebed89afdbb86c79",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 70,
"avg_line_length": 20.714285714285715,
"alnum_prop": 0.6655172413793103,
"repo_name": "lorenpaulsen/TDDSample",
"id": "f6947d2658fcbfb02d93922fc66e7b9d4ae32a37",
"size": "292",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WebServiceClient.Web/Startup.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "ASP",
"bytes": "111"
},
{
"name": "C#",
"bytes": "56546"
},
{
"name": "CSS",
"bytes": "685"
},
{
"name": "HTML",
"bytes": "5125"
},
{
"name": "JavaScript",
"bytes": "10714"
}
],
"symlink_target": ""
} |
layout: post
title: Configure DNS in ESXi
comments: true
---
- [List DNS servers](#list)
- [Add DNS server](#add)
- [Remove DNS server](#remove)
- [List DNS search list](#listsearch)
- [Add DNS search list](#addsearch)
- [Remove DNS search list](#removesearch)
##List DNS servers<a id="list"></a>
~ # esxcli network ip dns server list
DNSServers: 192.168.76.2
~ #
##Add DNS server<a id="add"></a>
~ # esxcli network ip dns server add -s 8.8.8.8
~ # esxcli network ip dns server list
DNSServers: 192.168.76.2, 8.8.8.8
~ #
##Remove DNS server<a id="remove"></a>
~ # esxcli network ip dns server remove -s 8.8.8.8
~ # esxcli network ip dns server list
DNSServers: 192.168.76.2
~ #
##List DNS search list<a id="listsearch"></a>
~ # esxcli network ip dns search list
DNSSearch Domains: localdomain
~ #
##Add DNS search list<a id="addsearch"></a>
~ # esxcli network ip dns search add -d intra.rtfmp.com
~ # esxcli network ip dns search list
DNSSearch Domains: localdomain, intra.rtfmp.com
~ #
##Remove DNS search list<a id="removesearch"></a>
~ # esxcli network ip dns search remove -d intra.rtfmp.com
~ # esxcli network ip dns search list
DNSSearch Domains: localdomain
~ #
| {
"content_hash": "0c1270646f468ce0d66b694ace3471e4",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 62,
"avg_line_length": 27.23404255319149,
"alnum_prop": 0.6390625,
"repo_name": "rtfmp/rtfmp.github.io",
"id": "d900c3af85a6fe79c1e25d355c4d4116a7b07557",
"size": "1284",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_posts/2015-04-03-esxi-configure-dns.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "10343"
},
{
"name": "HTML",
"bytes": "4442"
}
],
"symlink_target": ""
} |
<?php
if(!defined('QWP_ROOT')){exit('Invalid Request');}
require_once(QWP_INC_ROOT . '/common.php');
require_once(QWP_INC_ROOT . '/logger.php');
require_once(QWP_LANG_ROOT . '/main.php');
require_once(QWP_INC_ROOT . '/db.php');
require_once(QWP_ROUTER_ROOT . '/common.php');
require_once(QWP_ROUTER_ROOT . '/render.php');
require_once(QWP_CORE_ROOT . '/user.php');
require_once(QWP_CORE_ROOT . '/response.php');
require_once(QWP_ROUTER_ROOT . '/security.php');
require_once(QWP_COMMON_ROOT . '/common.php');
require_once(QWP_MODULE_ROOT . '/ops_logger.php'); | {
"content_hash": "dcebb2439ac39762b409e087810ff79f",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 50,
"avg_line_length": 39.92857142857143,
"alnum_prop": 0.6869409660107334,
"repo_name": "steem/QWPAdminLTE",
"id": "7a3c22d3a170403687bf569ab27fe99f28024cb8",
"size": "668",
"binary": false,
"copies": "3",
"ref": "refs/heads/master",
"path": "router/required.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "156516"
},
{
"name": "JavaScript",
"bytes": "133242"
},
{
"name": "PHP",
"bytes": "845543"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "3f927bd034e59b6a2ad3b34191544254",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "4fc99bb60a88207ed6384c549b86be73b27d4938",
"size": "179",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Luziola/Luziola peruviana/ Syn. Luziola mexicana/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
using System.ComponentModel;
namespace System.Web.UI.WebControls
{
public sealed class RectangleHotSpot: HotSpot
{
public override string GetCoordinates ()
{
return Left + "," + Top + "," + Right + "," + Bottom;
}
protected internal override string MarkupName {
get { return "rect"; }
}
[DefaultValueAttribute (0)]
public int Left {
get {
object o = ViewState ["Left"];
return o != null ? (int) o : 0;
}
set {
ViewState ["Left"] = value;
}
}
[DefaultValueAttribute (0)]
public int Top {
get {
object o = ViewState ["Top"];
return o != null ? (int) o : 0;
}
set {
ViewState ["Top"] = value;
}
}
[DefaultValueAttribute (0)]
public int Right {
get {
object o = ViewState ["Right"];
return o != null ? (int) o : 0;
}
set {
ViewState ["Right"] = value;
}
}
[DefaultValueAttribute (0)]
public int Bottom {
get {
object o = ViewState ["Bottom"];
return o != null ? (int) o : 0;
}
set {
ViewState ["Bottom"] = value;
}
}
}
}
#endif
| {
"content_hash": "711827761ec4a65f03cce1c1415018e4",
"timestamp": "",
"source": "github",
"line_count": 62,
"max_line_length": 56,
"avg_line_length": 17.580645161290324,
"alnum_prop": 0.5495412844036697,
"repo_name": "jjenki11/blaze-chem-rendering",
"id": "8b450d48c8262e14c6ef745523c3c78b249a7e97",
"size": "2350",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "qca_designer/lib/ml-pnet-0.8.1/mcs-sources/class/System.Web/System.Web.UI.WebControls/RectangleHotSpot.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "2476"
}
],
"symlink_target": ""
} |
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '2022.5.26',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
LINK_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false,
SHOW_SEARCH_SUMMARY: true,
ENABLE_SEARCH_SHORTCUTS: true,
}; | {
"content_hash": "cdc532f7c2c58a10ee3c5fcc2228f7f3",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 93,
"avg_line_length": 30.428571428571427,
"alnum_prop": 0.6549295774647887,
"repo_name": "materialsproject/custodian",
"id": "0b2a2c440803bc7feb27a076e8bef6a5f59da6da",
"size": "426",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/_static/documentation_options.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "5100"
},
{
"name": "CSS",
"bytes": "1133"
},
{
"name": "HTML",
"bytes": "2710"
},
{
"name": "Makefile",
"bytes": "5577"
},
{
"name": "Python",
"bytes": "532313"
},
{
"name": "Roff",
"bytes": "1552939"
},
{
"name": "Shell",
"bytes": "7472"
}
],
"symlink_target": ""
} |
TO_FACTOR = 600851475143
# Unoptimized. Simple prime sieve will speed up tremendously.
def naive_factorize(num):
n = 2
while n * n <= num:
if num % n == 0:
num //= n
yield n
else:
n += 1
yield num
def run():
for prime_factor in naive_factorize(TO_FACTOR):
print("Found factor {0}".format(prime_factor))
# Sample Output:
# Found factor 71
# Found factor 839
# Found factor 1471
# Found factor 6857
#
# Total running time for Problem3.py is 0.000626561914682896 seconds
| {
"content_hash": "354dfa9d8319dc2eafe6046e13aa4a21",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 68,
"avg_line_length": 21.115384615384617,
"alnum_prop": 0.6138433515482696,
"repo_name": "YangLuGitHub/Euler",
"id": "104d8e237164598c0d5d1c70bc346a6974858e02",
"size": "990",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/scripts/Problem3.py",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Python",
"bytes": "85057"
}
],
"symlink_target": ""
} |
/**
* @requires sMap/Module.js
*/
sMap.Module.Loading = OpenLayers.Class(sMap.Module, {
/**
* The events that this module will listen to. Each event listener
* is connected to a method defined in this module, with the same
* name as the event. When another module triggers this event, the
* method will be called (and other modules which are listening
* to the same event).
*
* Look at the event listeners as a public API of the module.
*/
EVENT_LISTENERS : ["loading", "loadingdone", "layersstartedloading", "layersloaded"],
/**
* The events triggered from this module. Note that some modules
* both listens to and trigger events.
*/
EVENT_TRIGGERS : [],
/**
* Show background when loading. Can be altered when triggering
* event "loading" using parameter bg.
*/
showBackground: false,
layersstartedloading: function(e) {
// Don't show "loading layers" if another message is already present.
if (this.container.is(":visible") !== true) {
this.loading({
text: this.lang.loadingLayers,
many: false,
bg: false
});
}
},
layersloaded: function() {
this.loadingdone({
text: this.lang.loadingLayers
});
},
/**
* Keeps track of how many processes are going on.
*/
//queue: 0,
animSrc: "img/ajax-loader-circle.gif",
showBackground: null,
initialize : function(options) {
options = options || {};
this.EVENT_LISTENERS =
sMap.Module.Loading.prototype.EVENT_LISTENERS.concat(
sMap.Module.prototype.EVENT_LISTENERS
);
this.EVENT_TRIGGERS =
sMap.Module.Loading.prototype.EVENT_TRIGGERS.concat(
sMap.Module.prototype.EVENT_TRIGGERS
);
// This allows your control to be extended by sending in a parameter hash object
// For example overriding a method in this class or in the parent class (see next step).
OpenLayers.Util.applyDefaults(this, options);
// This calls the parent class's constructor and allows to
// extend it (e.g. override methods).
sMap.Module.prototype.initialize.apply(this, [options]);
},
activate : function() {
if (this.active===true) {
return false;
}
// Call the activate method of the parent class
return sMap.Module.prototype.activate.apply(
this, arguments);
},
deactivate : function() {
if (this.active!==true) {
return false;
}
// Call the deactivate method of the parent class
return sMap.Module.prototype.deactivate.apply(
this, arguments
);
},
destroy : function() {
// Call the destroy method of the parent class
return sMap.Module.prototype.destroy.apply(this, arguments);
},
/**
* Called when all modules are initialized, i.e. after initialize.
* All initial HTML should be produced from here.
* @returns {void}
*/
drawContent : function() {
var container = $("<div id='loading-spinner-div' />");
this.container = container;
if (this.showBackground) {
var background = $("<div id='loading-background' />");
$("#mapDiv").append(background);
background.hide();
this.background = background;
}
// Append spinner image
var spinner = $("<img src='"+this.animSrc+"'></img>");
container.append(spinner);
var textContainer = $("<div id='loading-spinner-text' />");
this.textContainer = textContainer;
container.append( textContainer );
$("#mapDiv").append(container);
//spinner.position({ at: 'center', of: '#loading-spinner-div' });
//textContainer.position({ at: 'bottom', of: '#loading-spinner-div' });
$("#loading-spinner-div").position({ my: 'center', at: 'center', of: '#mapDiv' });
// Bind events
$(window).resize(function() {
$("#loading-spinner-div").position({ my: 'center', at: 'center', of: '#mapDiv' });
});
container.hide();
// for debugging
//sMap.events.triggerEvent("loading", this, {
// text: "Hej Hej",
// many: true
//});
},
show: function() {
if (this.background) {
if (this.showBackground === true) {
this.background.show();
}
else {
this.background.hide();
}
}
this.container.show();
$("#loading-spinner-div").position({ my: 'center', at: 'center', of: '#mapDiv' });
},
hide: function() {
if (this.background)
this.background.hide();
this.container.hide();
},
// ----------- EVENTS ------------------------------------------------------
/**
* Adds to the loading queue.
* @param e {Object}
* - text {String} Text to visible to user. Is also used as an "ID"
* when being removed.
* - many {Boolean} If true, the same text can be added several times into the loading GUI.
*/
loading: function(e) {
this.showBackground = e.bg || false;
this.addText(e.text, e.many);
this.checkStatus();
},
/**
* Substracts from the loading queue.
* @param e {Object}
* - text {String} (Optional) Same text as when calling "loading".
* //- all {Boolean} Remove all occurrences of this text.
*/
loadingdone: function(e) {
this.removeText(e.text || null);
this.checkStatus();
},
// ------------- EVENTS END ----------------------------------------------------
/**
* Add a tag with given text.
* @param text {String}
* @param many {Boolean} Allow many loading texts at the same time.
*/
addText: function(text, many) {
var matches = this.textContainer.children(":contains('"+text+"')");
var textTag = $("<div class='loading-texttag'>"+text+"</div>");
if (matches.length == 0 || many) {
// Append only if many is true or no existing matches.
this.textContainer.append(textTag);
}
},
/**
* Remove the tag with given text.
* @param text {String}
*/
removeText: function(text) {
if (text) {
var matches = this.textContainer.children(":contains('"+text+"')");
matches.first().remove();
}
else {
this.textContainer.empty();
}
},
/**
* Check the status of the loader. If no processes going on,
* close the dialog. Otherwise open.
*/
checkStatus: function() {
var len = this.textContainer.children().length;
if (len > 0) {
this.show();
}
else {
this.hide();
}
},
// Class name needed when you want to fetch your module...
// should correspond to the real class name.
CLASS_NAME : "sMap.Module.Loading"
}); | {
"content_hash": "09c6a42a91a484f7d88c0cfcce1c99d6",
"timestamp": "",
"source": "github",
"line_count": 241,
"max_line_length": 93,
"avg_line_length": 26.929460580912863,
"alnum_prop": 0.6024653312788906,
"repo_name": "getsmap/smap4",
"id": "878894750462daae94ec19562eb1276b995948f0",
"size": "6606",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "modules/Module/Loading/Loading.js",
"mode": "33261",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "5569"
},
{
"name": "Batchfile",
"bytes": "61"
},
{
"name": "C",
"bytes": "7006"
},
{
"name": "CSS",
"bytes": "297603"
},
{
"name": "HTML",
"bytes": "1485279"
},
{
"name": "Java",
"bytes": "280881"
},
{
"name": "JavaScript",
"bytes": "12909385"
},
{
"name": "PHP",
"bytes": "41746"
},
{
"name": "Python",
"bytes": "187608"
},
{
"name": "Shell",
"bytes": "19866"
},
{
"name": "XSLT",
"bytes": "1877"
}
],
"symlink_target": ""
} |
package org.locationtech.geomesa.arrow.io
import org.apache.arrow.vector.ipc.message.IpcOption
import org.junit.runner.RunWith
import org.locationtech.geomesa.arrow.vector.SimpleFeatureVector.SimpleFeatureEncoding
import org.locationtech.geomesa.features.ScalaSimpleFeature
import org.locationtech.geomesa.utils.geotools.SimpleFeatureTypes
import org.locationtech.geomesa.utils.io.WithClose
import org.specs2.mutable.Specification
import org.specs2.runner.JUnitRunner
import java.io.{ByteArrayInputStream, ByteArrayOutputStream}
@RunWith(classOf[JUnitRunner])
class DictionaryBuildingWriterTest extends Specification {
val sft = SimpleFeatureTypes.createType("test", "name:String,dtg:Date,*geom:Point:srid=4326")
val features = (0 until 10).map { i =>
ScalaSimpleFeature.create(sft, s"0$i", s"name0${i % 2}", s"2017-03-15T00:0$i:00.000Z", s"POINT (4$i 5$i)")
}
val ipcOpts = new IpcOption() // TODO test legacy opts
"SimpleFeatureVector" should {
"dynamically encode dictionary values" >> {
val out = new ByteArrayOutputStream()
WithClose(new DictionaryBuildingWriter(sft, Seq("name"), SimpleFeatureEncoding.Max, ipcOpts)) { writer =>
features.foreach(writer.add)
writer.encode(out)
}
WithClose(SimpleFeatureArrowFileReader.streaming(() => new ByteArrayInputStream(out.toByteArray))) { reader =>
reader.dictionaries must haveSize(1)
reader.dictionaries.get("name") must beSome
reader.dictionaries("name").iterator.toSeq must containTheSameElementsAs(Seq("name00", "name01"))
WithClose(reader.features())(f => f.map(ScalaSimpleFeature.copy).toSeq mustEqual features)
}
}
}
}
| {
"content_hash": "274a6602baa21e05b1c9acfcdf6c443c",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 116,
"avg_line_length": 40.11904761904762,
"alnum_prop": 0.7477744807121661,
"repo_name": "jrs53/geomesa",
"id": "932152dc6ae10e4942b35fdf7c7c89f0fd5597e6",
"size": "2148",
"binary": false,
"copies": "2",
"ref": "refs/heads/main",
"path": "geomesa-arrow/geomesa-arrow-gt/src/test/scala/org/locationtech/geomesa/arrow/io/DictionaryBuildingWriterTest.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "2900"
},
{
"name": "Java",
"bytes": "264723"
},
{
"name": "JavaScript",
"bytes": "140"
},
{
"name": "Python",
"bytes": "33084"
},
{
"name": "R",
"bytes": "2716"
},
{
"name": "Scala",
"bytes": "8997327"
},
{
"name": "Scheme",
"bytes": "3143"
},
{
"name": "Shell",
"bytes": "114662"
}
],
"symlink_target": ""
} |
FROM step2
MAINTAINER xjchengo
COPY . /root/alauda
ENV DEBIAN_FRONTEND noninteractive
RUN /root/alauda/step3.sh
| {
"content_hash": "58640599e0374b5211dea051e19d1185",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 34,
"avg_line_length": 16.285714285714285,
"alnum_prop": 0.8070175438596491,
"repo_name": "xjchengo/alauda-laravel",
"id": "956ff3e9fe9f3cc504c9ffede8370c4c29a291b1",
"size": "114",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "step3/Dockerfile",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Shell",
"bytes": "29314"
}
],
"symlink_target": ""
} |
var fs = require('fs');
var xpath = require('xpath'),
dom = require('xmldom').DOMParser;
var async = require('async');
var SAML = require('passport-saml').SAML;
var spawn = require('child_process').spawn;
var exec = require('child_process').exec;
var temp = require('temp');
var path = require('path');
var AWS = require('aws-sdk');
// DEFAULTS
var DURATION = 12 * 3600;
var SSH_OPTIONS = [];
// if the duration is more than this, we assume that
// someone passed in a config setting the duration as
// seconds
var MAX_HOURS = 24 * 7;
var configName = "config.json";
var config = {};
var SAML2_RESPONSE_XPATH = ".//*[local-name()='Response' and " +
"namespace-uri() = 'urn:oasis:names:tc:SAML:2.0:protocol']";
var REALNAME_XPATH = ".//*[local-name()='Attribute' and @Name='email']/*[local-name()='AttributeValue']/text()";
var IDP_X509_CERT_XPATH = ".//*[local-name()='X509Certificate']/text()";
var SHIBBOLETH_ROLE_ATTRIBUTES_XPATH = ".//*[@FriendlyName='Role']/*[local-name()='AttributeValue']/text()";
var OKTA_ROLE_ATTRIBUTES_XPATH = ".//*[@Name='role']/*[local-name()='AttributeValue']/text()";
exports.handler = function(event, context) {
console.log('Received event:', JSON.stringify(event, null, 2));
console.log('Context is: %j', context);
// Need to work out which IDP to pull the metadata for
var response = new Buffer(event.body.SAMLResponse, 'base64').toString();
var idpPath = ".//*[local-name()='Issuer']/text()";
var responsedoc = new dom().parseFromString(response);
var idp = xpath.select(idpPath, responsedoc)[0].toString();
var saml_options = {
issuer: 'urn:rea:sshephalopod',
validateInResponseTo: false, // turning this on requires an inmemorycache provider
requestIdExpirationPeriodMs: 3600000,
cacheProvider: {}, // since we won't be sticking around ...
privateCert: fs.readFileSync("saml_sp.key").toString(),
entryPoint: "https://do.not.need.one/",
callbackUrl: 'https://do.not.need.one/'
};
var bucketName = event.KeypairBucket;
var keyName = event.KeypairName;
var realName = 'REAL-NAME-HERE';
var tempdir;
var db_params = {
Key: {
IdpName: 'default'
},
TableName: 'IdpMetadataTable'
};
var cert = '';
var returnData = {};
var xml = new Buffer(event.body.SAMLResponse, 'base64').toString('utf8');
var saml_doc = new dom().parseFromString(xml);
async.waterfall([
function createTempFile(next) {
temp.mkdir('sshephalopod', next);
}, function writeTempFile(info, next) {
tempdir = info;
fs.writeFile(path.join(tempdir, 'pubkey'), event.body.SSHPublicKey, next);
}, function logTempDir(next) {
console.log('Created dir ' + tempdir);
next(null);
},
function getConfig(next) {
retrieveObject(bucketName, configName, next);
},
function parseConfig(cfgJSON, next) {
config = JSON.parse(cfgJSON);
// check some basic things
if (parseInt(config.signatureDuration)) {
DURATION = parseInt(config.signatureDuration);
}
if (config.sshOptions) {
SSH_OPTIONS = [].concat.apply([], config.sshOptions.map(function(d){ return ['-O', d]; }));
}
next(null);
},
function getIdpData(next) {
console.log("Getting metadata from ", event.IdpMetadataEndpoint);
retrieveMetadata(event.IdpMetadataEndpoint, next);
},
function assignCert(data, next) {
var doc = new dom().parseFromString(data);
saml_options.cert = xpath.select(IDP_X509_CERT_XPATH, doc)[0].toString('utf8');
console.log('i has a cert: %j', saml_options.cert);
next(null);
}, function AssertResponse(next) {
var saml = new SAML(saml_options);
console.log("Going to try and assert a response: %j", saml_options);
var saml2_response = xpath.select(SAML2_RESPONSE_XPATH, saml_doc).toString();
console.log('using saml2_response: %j', saml2_response);
console.log("Retrieving real name from XML");
realName = xpath.select(REALNAME_XPATH, saml_doc).toString();
console.log("Got realName of " + realName);
var encoded_response = new Buffer(saml2_response).toString('base64');
var response = {
SAMLResponse: encoded_response
};
saml.validatePostResponse(response, next);
},
function checkLoggedOut(profile, loggedOut, next) {
console.log("checkLoggedOut(%j, %j)", profile, loggedOut);
now = new Date();
expiry = new Date(now.setSeconds(now.getSeconds() + DURATION));
if (loggedOut) {
var err = new Error("User has been logged out")
next(err);
}
next(null);
},
function checkGroupMembership(next) {
var roles = xpath.select(OKTA_ROLE_ATTRIBUTES_XPATH, saml_doc).map(function(d){return d.toString()});
if (roles.length < 1) {
// try the "other" XPath selector
roles = xpath.select(SHIBBOLETH_ROLE_ATTRIBUTES_XPATH, saml_doc).map(function(d){return d.toString()});
}
if (roles.length < 1) {
// Couldn't find any role memberships at all ... perhaps this IdP uses
// different names?
var err = new Error("No role memberships found -- check your Identity Provider configuration");
return next(err);
}
console.log("roles is", roles);
console.log("config is", JSON.stringify(config));
var memberOf = roles.filter( function(d){
if (config.groups[d]) {
return d
} else {
console.log(d, "is not in config.groups");
}
});
console.log("memberOf is", memberOf);
// if there are no matching groups for this assertion, then
// the user can't be allowed to log in -- unless we're
// defaulting to "Allow", which is silly (but possible)
if (memberOf.length < 1) {
var err = new Error("You do not have permission to log in as that user");
return next(err);
}
// so they are a member of a group that we know about;
// are they requesting access to a user that is permitted
// by a group of which they are a member?
if (!memberOf.some( function(d) {
return config.groups[d].some( function(x) {
var User = new Buffer(event.body.Username).toString();
if (User === x) {
console.log(x, "is allowed by inclusion in ", d);
return (User === x);
}
})
}))
{
var err = new Error("You do not have permission to log in as that user");
return next(err);
}
console.log("Permitting access to ", realName, " as ", event.body.Username);
returnData = {
Result: true,
Message: "Authentication succeeded",
Expiry: expiry.toISOString()
};
next(null);
},
function getKey(next) {
retrieveObject(bucketName, keyName, next);
},
function saveKey(privKey, next) {
console.log("Saving key to local filesystem");
fs.writeFileSync(path.join(tempdir, keyName), privKey);
console.log("Protecting mode of key");
fs.chmod(path.join(tempdir, keyName), 0700, next);
},
function makeCopies(next) {
console.log("Copying in binaries");
var args = [
'cp bin/ssh-keygen bin/libfipscheck.so.1 ' + tempdir,
'&&',
'chmod 0700 ' + tempdir
];
var copy = exec(args.join(' '), next);
},
function copied(stdout, stderr, next) {
console.log('copied: ' + stdout);
next(null);
},
function signKey(next) {
var thing = fs.readFileSync(path.join(tempdir, 'pubkey')).toString();
console.log("SSH key is: " + thing);
var User = new Buffer(event.body.Username).toString();
var now = new Date();
var args = [
'./ssh-keygen',
'-s', keyName,
'-V', '+' + DURATION + 's',
'-z', now.getTime(),
'-I', realName,
'-n', User,
].concat(SSH_OPTIONS).concat(['pubkey']);
process.env.LD_LIBRARY_PATH = tempdir;
process.env.HOME = tempdir;
var opts = {
cwd: tempdir,
env: process.env
};
opts.env.HOME = tempdir;
console.log('process env is %j', process.env);
console.log('args for exec are: %j', args);
console.log('opts for exec are: %j', opts);
var ssh_keygen = exec(args.join(' '), opts, next);
}, function spawnedKeyGen(stdout, stderr, next) {
console.log("should be spawned");
console.log('ssh_keygen: %s', stdout);
returnData.SignedKey = fs.readFileSync(path.join(tempdir, "pubkey-cert.pub")).toString('base64');
next(null);
}
], function(err) {
// temp.cleanupSync();
if (err) {
console.error(err, err.stack);
context.done(err);
} else {
console.log("Received successful response: %j", returnData);
context.done(null, returnData);
}
});
};
function retrieveObject(bucketName, keyName, callback) {
var s3 = new AWS.S3();
var objectBody = "";
var objectParams = {
Bucket: bucketName,
Key: keyName
};
async.waterfall([
function loadObject(next) {
console.log("Checking for object ", keyName, " in bucket ", bucketName);
s3.getObject(objectParams, next);
}, function handleObject(data, next) {
console.log("Got object");
objectBody = data.Body.toString('utf8').trim();
next(null);
}
], function (err, result) {
if (err) {
console.log("Error looking for object");
console.log(err, err.stack);
callback(new Error("cannot load object"), null);
} else if (objectBody === '') {
callback(new Error("cannot load object"), null);
} else {
callback(null, objectBody);
}
});
}
function retrieveMetadata(IdpURL, callback) {
console.log('Retrieving metadata from ' + IdpURL);
var responseData = {};
if (IdpURL) {
if (IdpURL.match('https')) {
https = require('https');
var url = require('url');
var parsedUrl = url.parse(IdpURL);
var options = {
hostname: parsedUrl.hostname,
port: 443,
path: parsedUrl.path,
method: 'GET'
};
var stringResult = '';
var request = https.request(options, function(response) {
console.log('Status code: ' + response.statusCode);
console.log('Status message: ' + response.statusMessage);
response.on('data', function(data) {
stringResult += data.toString();
});
response.on('end', function() {
console.log('Got metadata: ' + stringResult);
callback(null, stringResult);
});
});
request.on('error', function(err) {
callback({Error: err, Opts: options}, null);
});
request.end();
} else {
callback({Error: 'IdP URL not supported'}, null);
}
} else {
callback({Error: 'IdP URL not supported'}, null);
}
};
| {
"content_hash": "6423a7ea316ccdcf708e6aa42eddc743",
"timestamp": "",
"source": "github",
"line_count": 332,
"max_line_length": 119,
"avg_line_length": 37.144578313253014,
"alnum_prop": 0.5351929938371716,
"repo_name": "realestate-com-au/sshephalopod",
"id": "3f68eb931d56b52753391b2c2a5f2a5dc9e5c43c",
"size": "12602",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lambda/SigningRequestPassport.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "31304"
},
{
"name": "Makefile",
"bytes": "1390"
},
{
"name": "Python",
"bytes": "4158"
},
{
"name": "Shell",
"bytes": "12540"
}
],
"symlink_target": ""
} |
test_description='pack index with 64-bit offsets and object CRC'
. ./test-lib.sh
test_expect_success \
'setup' \
'rm -rf .git &&
git init &&
git config pack.threads 1 &&
i=1 &&
while test $i -le 100
do
iii=`printf '%03i' $i`
test-genrandom "bar" 200 > wide_delta_$iii &&
test-genrandom "baz $iii" 50 >> wide_delta_$iii &&
test-genrandom "foo"$i 100 > deep_delta_$iii &&
test-genrandom "foo"`expr $i + 1` 100 >> deep_delta_$iii &&
test-genrandom "foo"`expr $i + 2` 100 >> deep_delta_$iii &&
echo $iii >file_$iii &&
test-genrandom "$iii" 8192 >>file_$iii &&
git update-index --add file_$iii deep_delta_$iii wide_delta_$iii &&
i=`expr $i + 1` || return 1
done &&
{ echo 101 && test-genrandom 100 8192; } >file_101 &&
git update-index --add file_101 &&
tree=`git write-tree` &&
commit=`git commit-tree $tree </dev/null` && {
echo $tree &&
git ls-tree $tree | sed -e "s/.* \\([0-9a-f]*\\) .*/\\1/"
} >obj-list &&
git update-ref HEAD $commit'
test_expect_success \
'pack-objects with index version 1' \
'pack1=$(git pack-objects --index-version=1 test-1 <obj-list) &&
git verify-pack -v "test-1-${pack1}.pack"'
test_expect_success \
'pack-objects with index version 2' \
'pack2=$(git pack-objects --index-version=2 test-2 <obj-list) &&
git verify-pack -v "test-2-${pack2}.pack"'
test_expect_success \
'both packs should be identical' \
'cmp "test-1-${pack1}.pack" "test-2-${pack2}.pack"'
test_expect_success \
'index v1 and index v2 should be different' \
'! cmp "test-1-${pack1}.idx" "test-2-${pack2}.idx"'
test_expect_success \
'index-pack with index version 1' \
'git index-pack --index-version=1 -o 1.idx "test-1-${pack1}.pack"'
test_expect_success \
'index-pack with index version 2' \
'git index-pack --index-version=2 -o 2.idx "test-1-${pack1}.pack"'
test_expect_success \
'index-pack results should match pack-objects ones' \
'cmp "test-1-${pack1}.idx" "1.idx" &&
cmp "test-2-${pack2}.idx" "2.idx"'
test_expect_success 'index-pack --verify on index version 1' '
git index-pack --verify "test-1-${pack1}.pack"
'
test_expect_success 'index-pack --verify on index version 2' '
git index-pack --verify "test-2-${pack2}.pack"
'
test_expect_success \
'pack-objects --index-version=2, is not accepted' \
'test_must_fail git pack-objects --index-version=2, test-3 <obj-list'
test_expect_success \
'index v2: force some 64-bit offsets with pack-objects' \
'pack3=$(git pack-objects --index-version=2,0x40000 test-3 <obj-list)'
if msg=$(git verify-pack -v "test-3-${pack3}.pack" 2>&1) ||
! (echo "$msg" | grep "pack too large .* off_t")
then
test_set_prereq OFF64_T
else
say "# skipping tests concerning 64-bit offsets"
fi
test_expect_success OFF64_T \
'index v2: verify a pack with some 64-bit offsets' \
'git verify-pack -v "test-3-${pack3}.pack"'
test_expect_success OFF64_T \
'64-bit offsets: should be different from previous index v2 results' \
'! cmp "test-2-${pack2}.idx" "test-3-${pack3}.idx"'
test_expect_success OFF64_T \
'index v2: force some 64-bit offsets with index-pack' \
'git index-pack --index-version=2,0x40000 -o 3.idx "test-1-${pack1}.pack"'
test_expect_success OFF64_T \
'64-bit offsets: index-pack result should match pack-objects one' \
'cmp "test-3-${pack3}.idx" "3.idx"'
test_expect_success OFF64_T 'index-pack --verify on 64-bit offset v2 (cheat)' '
# This cheats by knowing which lower offset should still be encoded
# in 64-bit representation.
git index-pack --verify --index-version=2,0x40000 "test-3-${pack3}.pack"
'
test_expect_success OFF64_T 'index-pack --verify on 64-bit offset v2' '
git index-pack --verify "test-3-${pack3}.pack"
'
# returns the object number for given object in given pack index
index_obj_nr()
{
idx_file=$1
object_sha1=$2
nr=0
git show-index < $idx_file |
while read offs sha1 extra
do
nr=$(($nr + 1))
test "$sha1" = "$object_sha1" || continue
echo "$(($nr - 1))"
break
done
}
# returns the pack offset for given object as found in given pack index
index_obj_offset()
{
idx_file=$1
object_sha1=$2
git show-index < $idx_file | grep $object_sha1 |
( read offs extra && echo "$offs" )
}
test_expect_success \
'[index v1] 1) stream pack to repository' \
'git index-pack --index-version=1 --stdin < "test-1-${pack1}.pack" &&
git prune-packed &&
git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
cmp "test-1-${pack1}.idx" ".git/objects/pack/pack-${pack1}.idx"'
test_expect_success \
'[index v1] 2) create a stealth corruption in a delta base reference' \
'# This test assumes file_101 is a delta smaller than 16 bytes.
# It should be against file_100 but we substitute its base for file_099
sha1_101=`git hash-object file_101` &&
sha1_099=`git hash-object file_099` &&
offs_101=`index_obj_offset 1.idx $sha1_101` &&
nr_099=`index_obj_nr 1.idx $sha1_099` &&
chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
if=".git/objects/pack/pack-${pack1}.idx" \
skip=$((4 + 256 * 4 + $nr_099 * 24)) \
bs=1 count=20 conv=notrunc &&
git cat-file blob $sha1_101 > file_101_foo1'
test_expect_success \
'[index v1] 3) corrupted delta happily returned wrong data' \
'test -f file_101_foo1 && ! cmp file_101 file_101_foo1'
test_expect_success \
'[index v1] 4) confirm that the pack is actually corrupted' \
'test_must_fail git fsck --full $commit'
test_expect_success \
'[index v1] 5) pack-objects happily reuses corrupted data' \
'pack4=$(git pack-objects test-4 <obj-list) &&
test -f "test-4-${pack4}.pack"'
test_expect_success \
'[index v1] 6) newly created pack is BAD !' \
'test_must_fail git verify-pack -v "test-4-${pack4}.pack"'
test_expect_success \
'[index v2] 1) stream pack to repository' \
'rm -f .git/objects/pack/* &&
git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git prune-packed &&
git count-objects | ( read nr rest && test "$nr" -eq 1 ) &&
cmp "test-1-${pack1}.pack" ".git/objects/pack/pack-${pack1}.pack" &&
cmp "test-2-${pack1}.idx" ".git/objects/pack/pack-${pack1}.idx"'
test_expect_success \
'[index v2] 2) create a stealth corruption in a delta base reference' \
'# This test assumes file_101 is a delta smaller than 16 bytes.
# It should be against file_100 but we substitute its base for file_099
sha1_101=`git hash-object file_101` &&
sha1_099=`git hash-object file_099` &&
offs_101=`index_obj_offset 1.idx $sha1_101` &&
nr_099=`index_obj_nr 1.idx $sha1_099` &&
chmod +w ".git/objects/pack/pack-${pack1}.pack" &&
dd of=".git/objects/pack/pack-${pack1}.pack" seek=$(($offs_101 + 1)) \
if=".git/objects/pack/pack-${pack1}.idx" \
skip=$((8 + 256 * 4 + $nr_099 * 20)) \
bs=1 count=20 conv=notrunc &&
git cat-file blob $sha1_101 > file_101_foo2'
test_expect_success \
'[index v2] 3) corrupted delta happily returned wrong data' \
'test -f file_101_foo2 && ! cmp file_101 file_101_foo2'
test_expect_success \
'[index v2] 4) confirm that the pack is actually corrupted' \
'test_must_fail git fsck --full $commit'
test_expect_success \
'[index v2] 5) pack-objects refuses to reuse corrupted data' \
'test_must_fail git pack-objects test-5 <obj-list &&
test_must_fail git pack-objects --no-reuse-object test-6 <obj-list'
test_expect_success \
'[index v2] 6) verify-pack detects CRC mismatch' \
'rm -f .git/objects/pack/* &&
git index-pack --index-version=2 --stdin < "test-1-${pack1}.pack" &&
git verify-pack ".git/objects/pack/pack-${pack1}.pack" &&
obj=`git hash-object file_001` &&
nr=`index_obj_nr ".git/objects/pack/pack-${pack1}.idx" $obj` &&
chmod +w ".git/objects/pack/pack-${pack1}.idx" &&
printf xxxx | dd of=".git/objects/pack/pack-${pack1}.idx" conv=notrunc \
bs=1 count=4 seek=$((8 + 256 * 4 + `wc -l <obj-list` * 20 + $nr * 4)) &&
( while read obj
do git cat-file -p $obj >/dev/null || exit 1
done <obj-list ) &&
test_must_fail git verify-pack ".git/objects/pack/pack-${pack1}.pack"
'
test_expect_success 'running index-pack in the object store' '
rm -f .git/objects/pack/* &&
cp test-1-${pack1}.pack .git/objects/pack/pack-${pack1}.pack &&
(
cd .git/objects/pack
git index-pack pack-${pack1}.pack
) &&
test -f .git/objects/pack/pack-${pack1}.idx
'
test_expect_success 'index-pack --strict warns upon missing tagger in tag' '
sha=$(git rev-parse HEAD) &&
cat >wrong-tag <<EOF &&
object $sha
type commit
tag guten tag
This is an invalid tag.
EOF
tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
pack1=$(echo $tag $sha | git pack-objects tag-test) &&
echo remove tag object &&
thirtyeight=${tag#??} &&
rm -f .git/objects/${tag%$thirtyeight}/$thirtyeight &&
git index-pack --strict tag-test-${pack1}.pack 2>err &&
grep "^warning:.* expected .tagger. line" err
'
test_done
| {
"content_hash": "014f7367c29d7bb855f3966a882cf054",
"timestamp": "",
"source": "github",
"line_count": 260,
"max_line_length": 80,
"avg_line_length": 36.16153846153846,
"alnum_prop": 0.6217825994469262,
"repo_name": "scheng123/agario-try-hacked",
"id": "3dc5ec4dd331c152754f3c9480042103d5d9f290",
"size": "9452",
"binary": false,
"copies": "122",
"ref": "refs/heads/master",
"path": "git-2.6.3/t/t5302-pack-index.sh",
"mode": "33261",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "7443"
},
{
"name": "C",
"bytes": "5626600"
},
{
"name": "C++",
"bytes": "227985"
},
{
"name": "CSS",
"bytes": "15154"
},
{
"name": "Emacs Lisp",
"bytes": "86984"
},
{
"name": "Go",
"bytes": "15064"
},
{
"name": "Groff",
"bytes": "26859"
},
{
"name": "HTML",
"bytes": "2329"
},
{
"name": "JavaScript",
"bytes": "118353"
},
{
"name": "Makefile",
"bytes": "115872"
},
{
"name": "Objective-C",
"bytes": "504"
},
{
"name": "PHP",
"bytes": "7984"
},
{
"name": "Perl",
"bytes": "1098997"
},
{
"name": "Perl6",
"bytes": "23673"
},
{
"name": "Python",
"bytes": "299058"
},
{
"name": "Shell",
"bytes": "4330683"
},
{
"name": "Tcl",
"bytes": "764508"
}
],
"symlink_target": ""
} |
package com.alibaba.rocketmq.broker.offset;
import com.alibaba.rocketmq.broker.BrokerController;
import com.alibaba.rocketmq.broker.BrokerPathConfigHelper;
import com.alibaba.rocketmq.common.ConfigManager;
import com.alibaba.rocketmq.common.UtilAll;
import com.alibaba.rocketmq.common.constant.LoggerName;
import com.alibaba.rocketmq.remoting.protocol.RemotingSerializable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
/**
* Consumer消费进度管理
*
* @author shijia.wxr<[email protected]>
* @since 2013-8-11
*/
public class ConsumerOffsetManager extends ConfigManager {
private static final Logger log = LoggerFactory.getLogger(LoggerName.BrokerLoggerName);
private static final String TOPIC_GROUP_SEPARATOR = "@";
private ConcurrentHashMap<String/* topic@group */, ConcurrentHashMap<Integer, Long>> offsetTable =
new ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>>(512);
private transient BrokerController brokerController;
public ConsumerOffsetManager() {
}
public ConsumerOffsetManager(BrokerController brokerController) {
this.brokerController = brokerController;
}
/**
* 扫描数据被删除了的topic,offset记录也对应删除
*/
public void scanUnsubscribedTopic() {
Iterator<Entry<String, ConcurrentHashMap<Integer, Long>>> it = this.offsetTable.entrySet().iterator();
while (it.hasNext()) {
Entry<String, ConcurrentHashMap<Integer, Long>> next = it.next();
String topicAtGroup = next.getKey();
String[] arrays = topicAtGroup.split(TOPIC_GROUP_SEPARATOR);
if (arrays.length == 2) {
String topic = arrays[0];
String group = arrays[1];
// 当前订阅关系里面没有group-topic订阅关系(消费端当前是停机的状态)并且offset落后很多,则删除消费进度
if (null == brokerController.getConsumerManager().findSubscriptionData(group, topic)
&& this.offsetBehindMuchThanData(topic, next.getValue())) {
it.remove();
log.warn("remove topic offset, {}", topicAtGroup);
}
}
}
}
private boolean offsetBehindMuchThanData(final String topic, ConcurrentHashMap<Integer, Long> table) {
Iterator<Entry<Integer, Long>> it = table.entrySet().iterator();
boolean result = !table.isEmpty();
while (it.hasNext() && result) {
Entry<Integer, Long> next = it.next();
long minOffsetInStore =
this.brokerController.getMessageStore().getMinOffsetInQueue(topic, next.getKey());
long offsetInPersist = next.getValue();
if (offsetInPersist > minOffsetInStore) {
result = false;
} else {
result = true;
}
}
return result;
}
public Set<String> whichTopicByConsumer(final String group) {
Set<String> topics = new HashSet<String>();
for (Entry<String, ConcurrentHashMap<Integer, Long>> next : this.offsetTable.entrySet()) {
String topicAtGroup = next.getKey();
String[] arrays = topicAtGroup.split(TOPIC_GROUP_SEPARATOR);
if (arrays.length == 2) {
if (group.equals(arrays[1])) {
topics.add(arrays[0]);
}
}
}
return topics;
}
public Set<String> whichGroupByTopic(final String topic) {
Set<String> groups = new HashSet<String>();
for (Entry<String, ConcurrentHashMap<Integer, Long>> next : this.offsetTable.entrySet()) {
String topicAtGroup = next.getKey();
String[] arrays = topicAtGroup.split(TOPIC_GROUP_SEPARATOR);
if (arrays.length == 2) {
if (topic.equals(arrays[0])) {
groups.add(arrays[1]);
}
}
}
return groups;
}
public void commitOffset(final String group, final String topic, final int queueId, final long offset, String source) {
long maxOffsetInQueue = brokerController.getMessageStore().getMaxOffsetInQueue(topic, queueId);
long minOffsetInQueue = brokerController.getMessageStore().getMinOffsetInQueue(topic, queueId);
if (maxOffsetInQueue > 0 && (offset > maxOffsetInQueue || offset < minOffsetInQueue)) {
log.error("[BUG][{}]Illegal offset. Group: {}, Topic: {}, Max offset in queue: {}, Updating offset: {}",
source, group, topic, maxOffsetInQueue, offset);
return;
}
// topic@group
String key = topic + TOPIC_GROUP_SEPARATOR + group;
this.commitOffset(key, queueId, offset, source);
}
public long queryOffset(final String group, final String topic, final int queueId) {
// topic@group
String key = topic + TOPIC_GROUP_SEPARATOR + group;
ConcurrentHashMap<Integer, Long> map = this.offsetTable.get(key);
if (null != map) {
Long offset = map.get(queueId);
if (offset != null)
return offset;
}
return -1;
}
private void commitOffset(final String key, final int queueId, final long offset, String source) {
ConcurrentHashMap<Integer, Long> map = this.offsetTable.get(key);
if (null == map) {
map = new ConcurrentHashMap<Integer, Long>(32);
map.put(queueId, offset);
this.offsetTable.put(key, map);
} else {
Long previous = map.put(queueId, offset);
if (null != previous && previous > offset) {
log.warn("Offset is moving backward. Source: {}, key: {}, queueId: {}, offset: {}, previous offset: {}",
source, key, queueId, offset, previous);
}
}
}
public String encode() {
return this.encode(false);
}
public String encode(final boolean prettyFormat) {
return RemotingSerializable.toJson(this, prettyFormat);
}
@Override
public void decode(String jsonString) {
if (jsonString != null) {
ConsumerOffsetManager obj =
RemotingSerializable.fromJson(jsonString, ConsumerOffsetManager.class);
if (obj != null) {
this.offsetTable = obj.offsetTable;
}
}
}
@Override
public String configFilePath() {
return BrokerPathConfigHelper.getConsumerOffsetPath(this.brokerController.getMessageStoreConfig()
.getStorePathRootDir());
}
public ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>> getOffsetTable() {
return offsetTable;
}
public void setOffsetTable(ConcurrentHashMap<String, ConcurrentHashMap<Integer, Long>> offsetTable) {
this.offsetTable = offsetTable;
}
public Map<Integer, Long> queryMinOffsetInAllGroup(final String topic, final String filterGroups) {
Map<Integer, Long> queueMinOffset = new HashMap<Integer, Long>();
Set<String> topicGroups = this.offsetTable.keySet();
if (!UtilAll.isBlank(filterGroups)) {
for (String group : filterGroups.split(",")) {
Iterator<String> it = topicGroups.iterator();
while (it.hasNext()) {
if (group.equals(it.next().split(TOPIC_GROUP_SEPARATOR)[1])) {
it.remove();
}
}
}
}
for (String topicGroup : topicGroups) {
String[] topicGroupArr = topicGroup.split(TOPIC_GROUP_SEPARATOR);
if (topic.equals(topicGroupArr[0])) {
for (Entry<Integer, Long> entry : this.offsetTable.get(topicGroup).entrySet()) {
long minOffset =
this.brokerController.getMessageStore()
.getMinOffsetInQueue(topic, entry.getKey());
if (entry.getValue() >= minOffset) {
Long offset = queueMinOffset.get(entry.getKey());
if (offset == null) {
queueMinOffset.put(entry.getKey(), Math.min(Long.MAX_VALUE, entry.getValue()));
}
else {
queueMinOffset.put(entry.getKey(), Math.min(entry.getValue(), offset));
}
}
}
}
}
return queueMinOffset;
}
public Map<Integer, Long> queryOffset(final String group, final String topic) {
// topic@group
String key = topic + TOPIC_GROUP_SEPARATOR + group;
return this.offsetTable.get(key);
}
public void cloneOffset(final String srcGroup, final String dstGroup, final String topic) {
ConcurrentHashMap<Integer, Long> offsets =
this.offsetTable.get(topic + TOPIC_GROUP_SEPARATOR + srcGroup);
if (offsets != null) {
this.offsetTable.put(topic + TOPIC_GROUP_SEPARATOR + dstGroup, offsets);
}
}
}
| {
"content_hash": "d701ed7a07365058fb0bbc12fba16de4",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 123,
"avg_line_length": 36.10629921259842,
"alnum_prop": 0.5932831752262567,
"repo_name": "lizhanhui/Alibaba_RocketMQ",
"id": "602e664f22951803f39ffed39d60c336157d79d0",
"size": "9919",
"binary": false,
"copies": "1",
"ref": "refs/heads/hotfix",
"path": "rocketmq-broker/src/main/java/com/alibaba/rocketmq/broker/offset/ConsumerOffsetManager.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "127"
},
{
"name": "Java",
"bytes": "3225615"
},
{
"name": "Python",
"bytes": "9929"
},
{
"name": "Shell",
"bytes": "22319"
},
{
"name": "Thrift",
"bytes": "1523"
}
],
"symlink_target": ""
} |
<!------------------------------------------------------------------------------------------------>
# platform/terminus (work in progress)
###### Since: [v1.0.0]
## Synopsis
The platform/terminus role is the exit point when using Artemis as an end-to-end operating system automation framework.
## Mandatory Inputs
None
## Playbook
<!------------------------------------------------------------------------------------------------>
[v1.0.0]: ../CHANGELOG.md#v100-april-25-2016
[meta dependencies]: http://docs.ansible.com/ansible/playbooks_roles.html#role-dependencies
<!------------------------------------------------------------------------------------------------>
| {
"content_hash": "d358f34e259951509853533022255c20",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 119,
"avg_line_length": 31.318181818181817,
"alnum_prop": 0.4034833091436865,
"repo_name": "katherinealbany/artemis",
"id": "bb78f56b3531664cfff4dd4d9affdfc999b9dc59",
"size": "689",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "platform/terminus/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Shell",
"bytes": "1390"
}
],
"symlink_target": ""
} |
//
// HereLayer.cpp
// G3MiOSSDK
//
// Created by Diego Gomez Deck on 3/7/13.
//
//
#include "HereLayer.hpp"
#include "Vector2I.hpp"
#include "LayerTilesRenderParameters.hpp"
#include "Tile.hpp"
#include "IStringBuilder.hpp"
#include "LayerCondition.hpp"
#include "TimeInterval.hpp"
#include "RenderState.hpp"
#include "URL.hpp"
HereLayer::HereLayer(const std::string& appId,
const std::string& appCode,
const TimeInterval& timeToCache,
const bool readExpired,
const int initialLevel,
const float transparency,
const LayerCondition* condition,
std::vector<const Info*>* layerInfo) :
RasterLayer(timeToCache,
readExpired,
new LayerTilesRenderParameters(Sector::fullSphere(),
1,
1,
initialLevel,
20,
Vector2I(256, 256),
LayerTilesRenderParameters::defaultTileMeshResolution(),
true),
transparency,
condition,
layerInfo),
_appId(appId),
_appCode(appCode),
_initialLevel(initialLevel)
{
}
URL HereLayer::getFeatureInfoURL(const Geodetic2D& position,
const Sector& sector) const {
return URL();
}
const URL HereLayer::createURL(const Tile* tile) const {
const Sector tileSector = tile->_sector;
IStringBuilder* isb = IStringBuilder::newStringBuilder();
isb->addString("http://m.nok.it/");
isb->addString("?app_id=");
isb->addString(_appId);
isb->addString("&app_code=");
isb->addString(_appCode);
isb->addString("&nord");
isb->addString("&nodot");
isb->addString("&w=");
isb->addInt(_parameters->_tileTextureResolution._x);
isb->addString("&h=");
isb->addInt(_parameters->_tileTextureResolution._y);
isb->addString("&ctr=");
isb->addDouble(tileSector._center._latitude._degrees);
isb->addString(",");
isb->addDouble(tileSector._center._longitude._degrees);
// isb->addString("&poi=");
// isb->addDouble(tileSector._lower._latitude._degrees);
// isb->addString(",");
// isb->addDouble(tileSector._lower._longitude._degrees);
// isb->addString(",");
// isb->addDouble(tileSector._upper._latitude._degrees);
// isb->addString(",");
// isb->addDouble(tileSector._upper._longitude._degrees);
// isb->addString("&nomrk");
isb->addString("&z=");
const int level = tile->_level;
isb->addInt(level);
// isb->addString("&t=3");
/*
0 (normal.day)
Normal map view in day light mode.
1 (satellite.day)
Satellite map view in day light mode.
2 (terrain.day)
Terrain map view in day light mode.
3 (hybrid.day)
Satellite map view with streets in day light mode.
4 (normal.day.transit)
Normal grey map view with public transit in day light mode.
5 (normal.day.grey)
Normal grey map view in day light mode (used for background maps).
6 (normal.day.mobile)
Normal map view for small screen devices in day light mode.
7 (normal.night.mobile)
Normal map view for small screen devices in night mode.
8 (terrain.day.mobile)
Terrain map view for small screen devices in day light mode.
9 (hybrid.day.mobile)
Satellite map view with streets for small screen devices in day light mode.
10 (normal.day.transit.mobile)
Normal grey map view with public transit for small screen devices in day light mode.
11 (normal.day.grey.mobile)
12 (carnav.day.grey) Map view designed for navigation devices.
13 (pedestrian.day) Map view designed for pedestrians walking by day.
14 (pedestrian.night) Map view designed for pedestrians walking by night.
Normal grey map view for small screen devices in day light mode (used for background maps).
By default normal map view in day light mode (0) is used for non-mobile clients. For mobile clients the default is normal map view for small screen devices in day light mode (6).
*/
const std::string path = isb->getString();
delete isb;
return URL(path, false);
}
const std::string HereLayer::description() const {
return "[HereLayer]";
}
HereLayer* HereLayer::copy() const {
return new HereLayer(_appId,
_appCode,
_timeToCache,
_readExpired,
_initialLevel,
_transparency,
(_condition == NULL) ? NULL : _condition->copy(),
_layerInfo);
}
bool HereLayer::rawIsEquals(const Layer* that) const {
HereLayer* t = (HereLayer*) that;
if (_appId != t->_appId) {
return false;
}
if (_appCode != t->_appCode) {
return false;
}
if (_initialLevel != t->_initialLevel) {
return false;
}
return true;
}
RenderState HereLayer::getRenderState() {
_errors.clear();
if (_appId.compare("") == 0) {
_errors.push_back("Missing layer parameter: appId");
}
if (_appCode.compare("") == 0) {
_errors.push_back("Missing layer parameter: appCode");
}
if (_errors.size() > 0) {
return RenderState::error(_errors);
}
return RenderState::ready();
}
const TileImageContribution* HereLayer::rawContribution(const Tile* tile) const {
const Tile* tileP = getParentTileOfSuitableLevel(tile);
if (tileP == NULL) {
return NULL;
}
else if (tile == tileP) {
//Most common case tile of suitable level being fully coveraged by layer
return ((_transparency < 1)
? TileImageContribution::fullCoverageTransparent(_transparency)
: TileImageContribution::fullCoverageOpaque());
}
else {
const Sector requestedImageSector = tileP->_sector;
return ((_transparency < 1)
? TileImageContribution::partialCoverageTransparent(requestedImageSector, _transparency)
: TileImageContribution::partialCoverageOpaque(requestedImageSector));
}
}
| {
"content_hash": "12cda7de511a6ab2ad1216b142864328",
"timestamp": "",
"source": "github",
"line_count": 213,
"max_line_length": 181,
"avg_line_length": 29.056338028169016,
"alnum_prop": 0.609791565681047,
"repo_name": "octavianiLocator/g3m",
"id": "792e09083ee3c32b8027862fb65b555cf92096e3",
"size": "6189",
"binary": false,
"copies": "2",
"ref": "refs/heads/purgatory",
"path": "iOS/G3MiOSSDK/Commons/Layers/HereLayer.cpp",
"mode": "33188",
"license": "bsd-2-clause",
"language": [
{
"name": "Batchfile",
"bytes": "7767"
},
{
"name": "C",
"bytes": "12488"
},
{
"name": "C++",
"bytes": "2485273"
},
{
"name": "CSS",
"bytes": "854"
},
{
"name": "HTML",
"bytes": "29099"
},
{
"name": "Java",
"bytes": "2674091"
},
{
"name": "JavaScript",
"bytes": "13022"
},
{
"name": "Objective-C",
"bytes": "152753"
},
{
"name": "Objective-C++",
"bytes": "344579"
},
{
"name": "PostScript",
"bytes": "693603"
},
{
"name": "Python",
"bytes": "26399"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_75) on Wed Jun 10 23:20:24 IST 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>Uses of Class org.apache.solr.client.solrj.ResponseParser (Solr 5.2.1 API)</title>
<meta name="date" content="2015-06-10">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.apache.solr.client.solrj.ResponseParser (Solr 5.2.1 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/client/solrj/class-use/ResponseParser.html" target="_top">Frames</a></li>
<li><a href="ResponseParser.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class org.apache.solr.client.solrj.ResponseParser" class="title">Uses of Class<br>org.apache.solr.client.solrj.ResponseParser</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#org.apache.solr.client.solrj">org.apache.solr.client.solrj</a></td>
<td class="colLast">
<div class="block">Primary APIs for communicating with a Solr Server from a Java client.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.apache.solr.client.solrj.impl">org.apache.solr.client.solrj.impl</a></td>
<td class="colLast">
<div class="block">Concrete implementations of client API classes.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.apache.solr.client.solrj">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> in <a href="../../../../../../org/apache/solr/client/solrj/package-summary.html">org.apache.solr.client.solrj</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/solr/client/solrj/package-summary.html">org.apache.solr.client.solrj</a> that return <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></code></td>
<td class="colLast"><span class="strong">SolrRequest.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/SolrRequest.html#getResponseParser()">getResponseParser</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/solr/client/solrj/package-summary.html">org.apache.solr.client.solrj</a> with parameters of type <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">SolrRequest.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/SolrRequest.html#setResponseParser(org.apache.solr.client.solrj.ResponseParser)">setResponseParser</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> responseParser)</code>
<div class="block">Optionally specify how the Response should be parsed.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.apache.solr.client.solrj.impl">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> in <a href="../../../../../../org/apache/solr/client/solrj/impl/package-summary.html">org.apache.solr.client.solrj.impl</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation">
<caption><span>Subclasses of <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> in <a href="../../../../../../org/apache/solr/client/solrj/impl/package-summary.html">org.apache.solr.client.solrj.impl</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/BinaryResponseParser.html" title="class in org.apache.solr.client.solrj.impl">BinaryResponseParser</a></strong></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/InputStreamResponseParser.html" title="class in org.apache.solr.client.solrj.impl">InputStreamResponseParser</a></strong></code>
<div class="block">Simply puts the InputStream into an entry in a NamedList named "stream".</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/NoOpResponseParser.html" title="class in org.apache.solr.client.solrj.impl">NoOpResponseParser</a></strong></code>
<div class="block">Simply puts the entire response into an entry in a NamedList.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/StreamingBinaryResponseParser.html" title="class in org.apache.solr.client.solrj.impl">StreamingBinaryResponseParser</a></strong></code>
<div class="block">A BinaryResponseParser that sends callback events rather then build
a large response</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/XMLResponseParser.html" title="class in org.apache.solr.client.solrj.impl">XMLResponseParser</a></strong></code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation">
<caption><span>Fields in <a href="../../../../../../org/apache/solr/client/solrj/impl/package-summary.html">org.apache.solr.client.solrj.impl</a> declared as <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></code></td>
<td class="colLast"><span class="strong">HttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#parser">parser</a></strong></code>
<div class="block">Default response parser is BinaryResponseParser</div>
</td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/solr/client/solrj/impl/package-summary.html">org.apache.solr.client.solrj.impl</a> that return <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></code></td>
<td class="colLast"><span class="strong">CloudSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/CloudSolrClient.html#getParser()">getParser</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></code></td>
<td class="colLast"><span class="strong">HttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#getParser()">getParser</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></code></td>
<td class="colLast"><span class="strong">LBHttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/LBHttpSolrClient.html#getParser()">getParser</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../org/apache/solr/client/solrj/impl/package-summary.html">org.apache.solr.client.solrj.impl</a> with parameters of type <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>protected <a href="../../../../../../org/apache/solr/common/util/NamedList.html" title="class in org.apache.solr.common.util">NamedList</a><<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>></code></td>
<td class="colLast"><span class="strong">HttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#executeMethod(org.apache.http.client.methods.HttpRequestBase,%20org.apache.solr.client.solrj.ResponseParser)">executeMethod</a></strong>(org.apache.http.client.methods.HttpRequestBase method,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> processor)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.HttpUriRequestResponse.html" title="class in org.apache.solr.client.solrj.impl">HttpSolrClient.HttpUriRequestResponse</a></code></td>
<td class="colLast"><span class="strong">HttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#httpUriRequest(org.apache.solr.client.solrj.SolrRequest,%20org.apache.solr.client.solrj.ResponseParser)">httpUriRequest</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/SolrRequest.html" title="class in org.apache.solr.client.solrj">SolrRequest</a> request,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> processor)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/common/util/NamedList.html" title="class in org.apache.solr.common.util">NamedList</a><<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>></code></td>
<td class="colLast"><span class="strong">HttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#request(org.apache.solr.client.solrj.SolrRequest,%20org.apache.solr.client.solrj.ResponseParser)">request</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/SolrRequest.html" title="class in org.apache.solr.client.solrj">SolrRequest</a> request,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> processor)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/solr/common/util/NamedList.html" title="class in org.apache.solr.common.util">NamedList</a><<a href="http://download.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>></code></td>
<td class="colLast"><span class="strong">HttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#request(org.apache.solr.client.solrj.SolrRequest,%20org.apache.solr.client.solrj.ResponseParser,%20java.lang.String)">request</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/SolrRequest.html" title="class in org.apache.solr.client.solrj">SolrRequest</a> request,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> processor,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> collection)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">CloudSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/CloudSolrClient.html#setParser(org.apache.solr.client.solrj.ResponseParser)">setParser</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> processor)</code>
<div class="block">Note: This setter method is <b>not thread-safe</b>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">HttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#setParser(org.apache.solr.client.solrj.ResponseParser)">setParser</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> processor)</code>
<div class="block">Note: This setter method is <b>not thread-safe</b>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">LBHttpSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/LBHttpSolrClient.html#setParser(org.apache.solr.client.solrj.ResponseParser)">setParser</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> parser)</code>
<div class="block">Changes the <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj"><code>ResponseParser</code></a> that will be used for the internal
SolrServer objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">ConcurrentUpdateSolrClient.</span><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/ConcurrentUpdateSolrClient.html#setParser(org.apache.solr.client.solrj.ResponseParser)">setParser</a></strong>(<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> responseParser)</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing constructors, and an explanation">
<caption><span>Constructors in <a href="../../../../../../org/apache/solr/client/solrj/impl/package-summary.html">org.apache.solr.client.solrj.impl</a> with parameters of type <a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrClient.html#HttpSolrClient(java.lang.String,%20org.apache.http.client.HttpClient,%20org.apache.solr.client.solrj.ResponseParser)">HttpSolrClient</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> baseURL,
org.apache.http.client.HttpClient client,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> parser)</code> </td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/HttpSolrServer.html#HttpSolrServer(java.lang.String,%20org.apache.http.client.HttpClient,%20org.apache.solr.client.solrj.ResponseParser)">HttpSolrServer</a></strong>(<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> baseURL,
org.apache.http.client.HttpClient client,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> parser)</code>
<div class="block"><strong>Deprecated.</strong> </div>
</td>
</tr>
<tr class="altColor">
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/LBHttpSolrClient.html#LBHttpSolrClient(org.apache.http.client.HttpClient,%20org.apache.solr.client.solrj.ResponseParser,%20java.lang.String...)">LBHttpSolrClient</a></strong>(org.apache.http.client.HttpClient httpClient,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> parser,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>... solrServerUrl)</code>
<div class="block">The provided httpClient should use a multi-threaded connection manager</div>
</td>
</tr>
<tr class="rowColor">
<td class="colLast"><code><strong><a href="../../../../../../org/apache/solr/client/solrj/impl/LBHttpSolrServer.html#LBHttpSolrServer(org.apache.http.client.HttpClient,%20org.apache.solr.client.solrj.ResponseParser,%20java.lang.String...)">LBHttpSolrServer</a></strong>(org.apache.http.client.HttpClient httpClient,
<a href="../../../../../../org/apache/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">ResponseParser</a> parser,
<a href="http://download.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>... solrServerUrl)</code>
<div class="block"><strong>Deprecated.</strong> </div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><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/solr/client/solrj/ResponseParser.html" title="class in org.apache.solr.client.solrj">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/solr/client/solrj/class-use/ResponseParser.html" target="_top">Frames</a></li>
<li><a href="ResponseParser.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<i>Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.</i>
<script src='../../../../../../prettify.js' type='text/javascript'></script>
<script type='text/javascript'>
(function(){
var oldonload = window.onload;
if (typeof oldonload != 'function') {
window.onload = prettyPrint;
} else {
window.onload = function() {
oldonload();
prettyPrint();
}
}
})();
</script>
</small></p>
</body>
</html>
| {
"content_hash": "403fd5565ebbbb0ee295a616404b73c0",
"timestamp": "",
"source": "github",
"line_count": 358,
"max_line_length": 446,
"avg_line_length": 70.1731843575419,
"alnum_prop": 0.6668656954064167,
"repo_name": "priyankajayaswal1/Solr-5.2-1-searching-and-indexing-",
"id": "31867cf0e84ff3ee108faa4416d75525f45ccd42",
"size": "25122",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "docs/solr-solrj/org/apache/solr/client/solrj/class-use/ResponseParser.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "54817"
},
{
"name": "CSS",
"bytes": "222981"
},
{
"name": "HTML",
"bytes": "191577"
},
{
"name": "JavaScript",
"bytes": "1167907"
},
{
"name": "Python",
"bytes": "3947"
},
{
"name": "Shell",
"bytes": "87895"
},
{
"name": "XSLT",
"bytes": "153606"
}
],
"symlink_target": ""
} |
// +build linux
package kubelet
import (
"testing"
"github.com/stretchr/testify/assert"
"k8s.io/api/core/v1"
runtimeapi "k8s.io/cri-api/pkg/apis/runtime/v1alpha2"
_ "k8s.io/kubernetes/pkg/apis/core/install"
kubecontainer "k8s.io/kubernetes/pkg/kubelet/container"
"k8s.io/kubernetes/pkg/util/mount"
volumetest "k8s.io/kubernetes/pkg/volume/testing"
"k8s.io/kubernetes/pkg/volume/util/subpath"
)
func TestMakeMounts(t *testing.T) {
bTrue := true
propagationHostToContainer := v1.MountPropagationHostToContainer
propagationBidirectional := v1.MountPropagationBidirectional
propagationNone := v1.MountPropagationNone
testCases := map[string]struct {
container v1.Container
podVolumes kubecontainer.VolumeMap
expectErr bool
expectedErrMsg string
expectedMounts []kubecontainer.Mount
}{
"valid mounts in unprivileged container": {
podVolumes: kubecontainer.VolumeMap{
"disk": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/mnt/disk"}},
"disk4": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/mnt/host"}},
"disk5": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/var/lib/kubelet/podID/volumes/empty/disk5"}},
},
container: v1.Container{
Name: "container1",
VolumeMounts: []v1.VolumeMount{
{
MountPath: "/etc/hosts",
Name: "disk",
ReadOnly: false,
MountPropagation: &propagationHostToContainer,
},
{
MountPath: "/mnt/path3",
Name: "disk",
ReadOnly: true,
MountPropagation: &propagationNone,
},
{
MountPath: "/mnt/path4",
Name: "disk4",
ReadOnly: false,
},
{
MountPath: "/mnt/path5",
Name: "disk5",
ReadOnly: false,
},
},
},
expectedMounts: []kubecontainer.Mount{
{
Name: "disk",
ContainerPath: "/etc/hosts",
HostPath: "/mnt/disk",
ReadOnly: false,
SELinuxRelabel: false,
Propagation: runtimeapi.MountPropagation_PROPAGATION_HOST_TO_CONTAINER,
},
{
Name: "disk",
ContainerPath: "/mnt/path3",
HostPath: "/mnt/disk",
ReadOnly: true,
SELinuxRelabel: false,
Propagation: runtimeapi.MountPropagation_PROPAGATION_PRIVATE,
},
{
Name: "disk4",
ContainerPath: "/mnt/path4",
HostPath: "/mnt/host",
ReadOnly: false,
SELinuxRelabel: false,
Propagation: runtimeapi.MountPropagation_PROPAGATION_PRIVATE,
},
{
Name: "disk5",
ContainerPath: "/mnt/path5",
HostPath: "/var/lib/kubelet/podID/volumes/empty/disk5",
ReadOnly: false,
SELinuxRelabel: false,
Propagation: runtimeapi.MountPropagation_PROPAGATION_PRIVATE,
},
},
expectErr: false,
},
"valid mounts in privileged container": {
podVolumes: kubecontainer.VolumeMap{
"disk": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/mnt/disk"}},
"disk4": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/mnt/host"}},
"disk5": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/var/lib/kubelet/podID/volumes/empty/disk5"}},
},
container: v1.Container{
Name: "container1",
VolumeMounts: []v1.VolumeMount{
{
MountPath: "/etc/hosts",
Name: "disk",
ReadOnly: false,
MountPropagation: &propagationBidirectional,
},
{
MountPath: "/mnt/path3",
Name: "disk",
ReadOnly: true,
MountPropagation: &propagationHostToContainer,
},
{
MountPath: "/mnt/path4",
Name: "disk4",
ReadOnly: false,
},
},
SecurityContext: &v1.SecurityContext{
Privileged: &bTrue,
},
},
expectedMounts: []kubecontainer.Mount{
{
Name: "disk",
ContainerPath: "/etc/hosts",
HostPath: "/mnt/disk",
ReadOnly: false,
SELinuxRelabel: false,
Propagation: runtimeapi.MountPropagation_PROPAGATION_BIDIRECTIONAL,
},
{
Name: "disk",
ContainerPath: "/mnt/path3",
HostPath: "/mnt/disk",
ReadOnly: true,
SELinuxRelabel: false,
Propagation: runtimeapi.MountPropagation_PROPAGATION_HOST_TO_CONTAINER,
},
{
Name: "disk4",
ContainerPath: "/mnt/path4",
HostPath: "/mnt/host",
ReadOnly: false,
SELinuxRelabel: false,
Propagation: runtimeapi.MountPropagation_PROPAGATION_PRIVATE,
},
},
expectErr: false,
},
"invalid absolute SubPath": {
podVolumes: kubecontainer.VolumeMap{
"disk": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/mnt/disk"}},
},
container: v1.Container{
VolumeMounts: []v1.VolumeMount{
{
MountPath: "/mnt/path3",
SubPath: "/must/not/be/absolute",
Name: "disk",
ReadOnly: true,
},
},
},
expectErr: true,
expectedErrMsg: "error SubPath `/must/not/be/absolute` must not be an absolute path",
},
"invalid SubPath with backsteps": {
podVolumes: kubecontainer.VolumeMap{
"disk": kubecontainer.VolumeInfo{Mounter: &stubVolume{path: "/mnt/disk"}},
},
container: v1.Container{
VolumeMounts: []v1.VolumeMount{
{
MountPath: "/mnt/path3",
SubPath: "no/backsteps/../allowed",
Name: "disk",
ReadOnly: true,
},
},
},
expectErr: true,
expectedErrMsg: "unable to provision SubPath `no/backsteps/../allowed`: must not contain '..'",
},
"volume doesn't exist": {
podVolumes: kubecontainer.VolumeMap{},
container: v1.Container{
VolumeMounts: []v1.VolumeMount{
{
MountPath: "/mnt/path3",
Name: "disk",
ReadOnly: true,
},
},
},
expectErr: true,
expectedErrMsg: "cannot find volume \"disk\" to mount into container \"\"",
},
"volume mounter is nil": {
podVolumes: kubecontainer.VolumeMap{
"disk": kubecontainer.VolumeInfo{},
},
container: v1.Container{
VolumeMounts: []v1.VolumeMount{
{
MountPath: "/mnt/path3",
Name: "disk",
ReadOnly: true,
},
},
},
expectErr: true,
expectedErrMsg: "cannot find volume \"disk\" to mount into container \"\"",
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
fhu := &mount.FakeHostUtil{}
fsp := &subpath.FakeSubpath{}
pod := v1.Pod{
Spec: v1.PodSpec{
HostNetwork: true,
},
}
mounts, _, err := makeMounts(&pod, "/pod", &tc.container, "fakepodname", "", "", tc.podVolumes, fhu, fsp, nil)
// validate only the error if we expect an error
if tc.expectErr {
if err == nil || err.Error() != tc.expectedErrMsg {
t.Fatalf("expected error message `%s` but got `%v`", tc.expectedErrMsg, err)
}
return
}
// otherwise validate the mounts
if err != nil {
t.Fatal(err)
}
assert.Equal(t, tc.expectedMounts, mounts, "mounts of container %+v", tc.container)
})
}
}
func TestMakeBlockVolumes(t *testing.T) {
testKubelet := newTestKubelet(t, false /* controllerAttachDetachEnabled */)
defer testKubelet.Cleanup()
kubelet := testKubelet.kubelet
testCases := map[string]struct {
container v1.Container
podVolumes kubecontainer.VolumeMap
expectErr bool
expectedErrMsg string
expectedDevices []kubecontainer.DeviceInfo
}{
"valid volumeDevices in container": {
podVolumes: kubecontainer.VolumeMap{
"disk1": kubecontainer.VolumeInfo{BlockVolumeMapper: &stubBlockVolume{dirPath: "/dev/", volName: "sda"}},
"disk2": kubecontainer.VolumeInfo{BlockVolumeMapper: &stubBlockVolume{dirPath: "/dev/disk/by-path/", volName: "diskPath"}, ReadOnly: true},
"disk3": kubecontainer.VolumeInfo{BlockVolumeMapper: &stubBlockVolume{dirPath: "/dev/disk/by-id/", volName: "diskUuid"}},
"disk4": kubecontainer.VolumeInfo{BlockVolumeMapper: &stubBlockVolume{dirPath: "/var/lib/", volName: "rawdisk"}, ReadOnly: true},
},
container: v1.Container{
Name: "container1",
VolumeDevices: []v1.VolumeDevice{
{
DevicePath: "/dev/sda",
Name: "disk1",
},
{
DevicePath: "/dev/xvda",
Name: "disk2",
},
{
DevicePath: "/dev/xvdb",
Name: "disk3",
},
{
DevicePath: "/mnt/rawdisk",
Name: "disk4",
},
},
},
expectedDevices: []kubecontainer.DeviceInfo{
{
PathInContainer: "/dev/sda",
PathOnHost: "/dev/sda",
Permissions: "mrw",
},
{
PathInContainer: "/dev/xvda",
PathOnHost: "/dev/disk/by-path/diskPath",
Permissions: "r",
},
{
PathInContainer: "/dev/xvdb",
PathOnHost: "/dev/disk/by-id/diskUuid",
Permissions: "mrw",
},
{
PathInContainer: "/mnt/rawdisk",
PathOnHost: "/var/lib/rawdisk",
Permissions: "r",
},
},
expectErr: false,
},
"invalid absolute Path": {
podVolumes: kubecontainer.VolumeMap{
"disk": kubecontainer.VolumeInfo{BlockVolumeMapper: &stubBlockVolume{dirPath: "/dev/", volName: "sda"}},
},
container: v1.Container{
VolumeDevices: []v1.VolumeDevice{
{
DevicePath: "must/be/absolute",
Name: "disk",
},
},
},
expectErr: true,
expectedErrMsg: "error DevicePath `must/be/absolute` must be an absolute path",
},
"volume doesn't exist": {
podVolumes: kubecontainer.VolumeMap{},
container: v1.Container{
VolumeDevices: []v1.VolumeDevice{
{
DevicePath: "/dev/sdaa",
Name: "disk",
},
},
},
expectErr: true,
expectedErrMsg: "cannot find volume \"disk\" to pass into container \"\"",
},
"volume BlockVolumeMapper is nil": {
podVolumes: kubecontainer.VolumeMap{
"disk": kubecontainer.VolumeInfo{},
},
container: v1.Container{
VolumeDevices: []v1.VolumeDevice{
{
DevicePath: "/dev/sdzz",
Name: "disk",
},
},
},
expectErr: true,
expectedErrMsg: "cannot find volume \"disk\" to pass into container \"\"",
},
}
for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
pod := v1.Pod{
Spec: v1.PodSpec{
HostNetwork: true,
},
}
blkutil := volumetest.NewBlockVolumePathHandler()
blkVolumes, err := kubelet.makeBlockVolumes(&pod, &tc.container, tc.podVolumes, blkutil)
// validate only the error if we expect an error
if tc.expectErr {
if err == nil || err.Error() != tc.expectedErrMsg {
t.Fatalf("expected error message `%s` but got `%v`", tc.expectedErrMsg, err)
}
return
}
// otherwise validate the devices
if err != nil {
t.Fatal(err)
}
assert.Equal(t, tc.expectedDevices, blkVolumes, "devices of container %+v", tc.container)
})
}
}
| {
"content_hash": "37da42f278b2d71202f6a1a86b174480",
"timestamp": "",
"source": "github",
"line_count": 389,
"max_line_length": 143,
"avg_line_length": 28.154241645244216,
"alnum_prop": 0.6018991964937911,
"repo_name": "mml/kubernetes",
"id": "c4fe1148e39d6791f69395ccf0ac4aac143697b8",
"size": "11521",
"binary": false,
"copies": "7",
"ref": "refs/heads/master",
"path": "pkg/kubelet/kubelet_pods_linux_test.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "2840"
},
{
"name": "Dockerfile",
"bytes": "52103"
},
{
"name": "Go",
"bytes": "49695582"
},
{
"name": "HTML",
"bytes": "38"
},
{
"name": "Lua",
"bytes": "17200"
},
{
"name": "Makefile",
"bytes": "67432"
},
{
"name": "PowerShell",
"bytes": "99199"
},
{
"name": "Python",
"bytes": "3348519"
},
{
"name": "Ruby",
"bytes": "430"
},
{
"name": "Shell",
"bytes": "1573354"
},
{
"name": "sed",
"bytes": "1390"
}
],
"symlink_target": ""
} |
function trigger(eventName, data) {
document.dispatchEvent(new document.defaultView.CustomEvent(eventName, {detail: data}));
}
export default trigger;
| {
"content_hash": "8abbcaa5ebff0cfacd55a506638b19f1",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 90,
"avg_line_length": 38.25,
"alnum_prop": 0.7908496732026143,
"repo_name": "apvilkko/drmch",
"id": "b7e0ec2e0ced736ce4a46b3ae2834a0239bd20f9",
"size": "153",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "src/event.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "229"
},
{
"name": "JavaScript",
"bytes": "13884"
}
],
"symlink_target": ""
} |
/* ###
* IP: GHIDRA
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ghidra.program.util;
import static org.junit.Assert.*;
import java.nio.charset.StandardCharsets;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import ghidra.program.database.ProgramDB;
import ghidra.program.model.data.*;
import ghidra.program.model.listing.Data;
import ghidra.program.model.util.CodeUnitInsertionException;
import ghidra.test.AbstractGhidraHeadlessIntegrationTest;
import ghidra.test.ToyProgramBuilder;
import util.CollectionUtils;
public class DefinedDataIteratorTest extends AbstractGhidraHeadlessIntegrationTest {
private ToyProgramBuilder builder;
private ProgramDB program;
private DataTypeManager dtm;
private DataType intDT;
private StringDataType stringDT;
private CharDataType charDT;
private DataType charArray;
private StructureDataType struct1DT;
private ArrayDataType structArray;
private StructureDataType struct2DT;
private TypeDef intTD;
@Before
public void setUp() throws Exception {
builder = new ToyProgramBuilder("DefinedDataIteratorTests", false);
program = builder.getProgram();
dtm = program.getDataTypeManager();
intDT = AbstractIntegerDataType.getSignedDataType(4, dtm);
intTD = new TypedefDataType("int_typedef", intDT);
stringDT = StringDataType.dataType;
charDT = new CharDataType(dtm);
charArray = new ArrayDataType(charDT, 20, charDT.getLength());
struct1DT = new StructureDataType("struct1", 100);
struct1DT.replaceAtOffset(0, intDT, intDT.getLength(), "f1", null);
struct1DT.replaceAtOffset(10, charArray, charArray.getLength(), "f2", null);
struct1DT.replaceAtOffset(50, stringDT, 10, "f3", null);
structArray = new ArrayDataType(struct1DT, 10, struct1DT.getLength());
struct2DT = new StructureDataType("struct2", 200);
struct2DT.replaceAtOffset(0, intDT, intDT.getLength(), "f1", null);
struct2DT.replaceAtOffset(10, struct1DT, intDT.getLength(), "f2", null);
builder.createMemory("test", "0x0", 0x2000);
program = builder.getProgram();
}
@Test
public void test_Ints() throws Exception {
builder.applyFixedLengthDataType("0x0", intDT, intDT.getLength());
builder.createString("0x10", "test1", StandardCharsets.UTF_8, true, stringDT);
builder.applyFixedLengthDataType("0x100", struct1DT, struct1DT.getLength());
List<Data> list = CollectionUtils.asList((Iterable<Data>)
DefinedDataIterator.byDataType(program, dt -> dt instanceof IntegerDataType));
assertTrue(list.get(0).getAddress().getOffset() == 0x0);
assertTrue(list.get(1).getAddress().getOffset() == 0x100);
assertEquals(2, list.size());
}
@Test
public void test_Strings() throws Exception {
builder.applyFixedLengthDataType("0x0", intDT, intDT.getLength());
builder.createString("0x10", "test1", StandardCharsets.UTF_8, true, stringDT);
builder.applyFixedLengthDataType("0x100", struct1DT, struct1DT.getLength());
List<Data> list =
CollectionUtils.asList((Iterable<Data>) DefinedDataIterator.definedStrings(program));
assertTrue(list.get(0).getAddress().getOffset() == 0x10);
assertTrue(list.get(1).getAddress().getOffset() == 0x100 + 10);
assertTrue(list.get(2).getAddress().getOffset() == 0x100 + 50);
assertEquals(3, list.size());
}
@Test
public void test_ArrayOfStructs() throws Exception {
builder.applyFixedLengthDataType("0x0", intDT, intDT.getLength());
builder.createString("0x10", "test1", StandardCharsets.UTF_8, true, stringDT);
builder.applyFixedLengthDataType("0x100", structArray, structArray.getLength());
int numElements = structArray.getNumElements();
int lastEle = numElements - 1;
int elementSize = structArray.getElementLength();
List<Data> list =
CollectionUtils.asList((Iterable<Data>) DefinedDataIterator.definedStrings(program));
assertEquals(list.get(0).getAddress().getOffset(), 0x10);
assertEquals(list.get(1 + 0).getAddress().getOffset(), 0x100 + 10);
assertEquals(list.get(1 + 1).getAddress().getOffset(), 0x100 + 50);
assertEquals(list.get(1 + (lastEle * 2) + 0).getAddress().getOffset(),
0x100 + (elementSize * lastEle) + 10);
assertEquals(list.get(1 + (lastEle * 2) + 1).getAddress().getOffset(),
0x100 + (elementSize * lastEle) + 50);
assertEquals(1 + (numElements * 2), list.size());
}
@Test
public void test_Typedefs() throws CodeUnitInsertionException {
// 3 ints: 2 are typedefs, 1 is regular int
builder.applyFixedLengthDataType("0x0", intTD, intTD.getLength());
builder.applyFixedLengthDataType("0x10", intTD, intTD.getLength());
builder.applyFixedLengthDataType("0x20", intDT, intTD.getLength());
// iterating by data type ignores typedefs, so we should get all 3 ints
List<Data> list = CollectionUtils.asList((Iterable<Data>)
DefinedDataIterator.byDataType(program, dt -> dt instanceof IntegerDataType));
assertEquals(3, list.size());
// iterating by data instance, we can inspect the actual data type and get the
// typedef
list = CollectionUtils.asList((Iterable<Data>) DefinedDataIterator.byDataInstance(program,
data -> data.getDataType() instanceof TypeDef));
assertEquals(2, list.size());
}
}
| {
"content_hash": "b2b3d154d39ba24c39b3fd375bc5d689",
"timestamp": "",
"source": "github",
"line_count": 151,
"max_line_length": 92,
"avg_line_length": 37.48344370860927,
"alnum_prop": 0.7462897526501767,
"repo_name": "NationalSecurityAgency/ghidra",
"id": "50b8e8538fd368b0774582019c15a4e541a24f23",
"size": "5660",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Ghidra/Features/Base/src/test/java/ghidra/program/util/DefinedDataIteratorTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "77536"
},
{
"name": "Batchfile",
"bytes": "21610"
},
{
"name": "C",
"bytes": "1132868"
},
{
"name": "C++",
"bytes": "7334484"
},
{
"name": "CSS",
"bytes": "75788"
},
{
"name": "GAP",
"bytes": "102771"
},
{
"name": "GDB",
"bytes": "3094"
},
{
"name": "HTML",
"bytes": "4121163"
},
{
"name": "Hack",
"bytes": "31483"
},
{
"name": "Haskell",
"bytes": "453"
},
{
"name": "Java",
"bytes": "88669329"
},
{
"name": "JavaScript",
"bytes": "1109"
},
{
"name": "Lex",
"bytes": "22193"
},
{
"name": "Makefile",
"bytes": "15883"
},
{
"name": "Objective-C",
"bytes": "23937"
},
{
"name": "Pawn",
"bytes": "82"
},
{
"name": "Python",
"bytes": "587415"
},
{
"name": "Shell",
"bytes": "234945"
},
{
"name": "TeX",
"bytes": "54049"
},
{
"name": "XSLT",
"bytes": "15056"
},
{
"name": "Xtend",
"bytes": "115955"
},
{
"name": "Yacc",
"bytes": "127754"
}
],
"symlink_target": ""
} |
title: OWASP TOP 10
tags: [security, owasp]
date: "2018-11-02T11:30:03+00:00"
aliases: ["/security/2018/11/02/OWASP.html"]
ShowBreadCrumbs: true
ShowReadingTime: true
ShowPostNavLinks: true
---
## Summary
---
보안 취약점의 종류를 이해하고 정리한다.
보안은 개발속도를 늦추는 경우도 있지만 제품의 안정성과 신뢰성에 기여하기 때문에 필수적인 요소이다.
다음은 OWASP(The Open Web Application Security Project)의 년도별 TOP 10 취약점의 종류이다.
## 2017
---
1. Injection
2. Broken Authentication
3. Sensitivy Data Exposure
4. XML External Entities(XXE)
5. Broken Access Control
6. Security Misconfiguration
7. Cross-Site Scripting(XXS)
8. Insecure Deserialization
9. Using Component with Known Vulnerabilities
10. Insufficient Logging & Monitoring
## 2013
---
1. Injection
2. Broken Authentication and Session Management
3. Cross-Site Scripting
4. Insecure Direct Object References
5. Security Misconfiguration
6. Sensitive Data Exposure
7. Missing Function Level Acess Control
8. Cross-Site Request Forgery(CSRF)
9. Using Component with Known Vulnerabilities
10. Unvalidated Redirects and Forwards
## 2010
---
1. Injection
2. Cross-Site Scripting
3. Broken Authentication and Session Management
4. Insecure Direct Object References
5. Cross-Site Request Forgery(CSRF)
6. Security Misconfiguration
7. Insecure Cryptographic Storage
8. Failure to Restrict URL Access
9. Insufficient Transport Layer Protection
10. Unvalidated Redirects and Forwards
## 2007
---
1. Cross Site Scripting (XSS)
2. Injection Flaws
3. Malicious File Execution
4. Insecure Direct Object Reference
5. Cross Site Request Forgery (CSRF)
6. Information Leakage and Improper Error Handling
7. Broken Authentication and Session Management
8. Insecure Cryptographic Storage
9. Insecure Communications
10. Failure to Restrict URL Access
## 2004
---
1. Unvalidated Input
1. Broken Access Control
1. Broken Authentication and Session Management
1. Cross Site Scripting
1. Buffer Overflow
1. Injection Flaws
1. Improper Error Handling
1. Insecure Storage
1. Application Denial of Service
1. Insecure Configuration Management
## References
---
- [https://ko.wikipedia.org/wiki/OWASP](https://ko.wikipedia.org/wiki/OWASP) | {
"content_hash": "406443418f9425540ef708df11b5cd22",
"timestamp": "",
"source": "github",
"line_count": 131,
"max_line_length": 76,
"avg_line_length": 16.46564885496183,
"alnum_prop": 0.770978210477515,
"repo_name": "novemberde/novemberde.github.io",
"id": "d1f25b7d5e204dd1cab5738d52b2b602d56bcb56",
"size": "2311",
"binary": false,
"copies": "1",
"ref": "refs/heads/hugo",
"path": "content/post/2018/11/02/OWASP.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "102777"
},
{
"name": "HTML",
"bytes": "242782"
},
{
"name": "JavaScript",
"bytes": "397810"
},
{
"name": "SCSS",
"bytes": "44061"
}
],
"symlink_target": ""
} |
<?php
namespace OAuth;
use OAuth\Common\Service\ServiceInterface;
use OAuth\Common\Consumer\CredentialsInterface;
use OAuth\Common\Storage\TokenStorageInterface;
use OAuth\Common\Http\Client\ClientInterface;
use OAuth\Common\Http\Client\CurlClient;
use OAuth\Common\Http\Client\StreamClient;
use OAuth\Common\Http\Uri\UriInterface;
use OAuth\Common\Exception\Exception;
use OAuth\OAuth1\Signature\Signature;
class ServiceFactory
{
/**
*@var ClientInterface
*/
protected $httpClient;
/**
* @var array
*/
protected $serviceClassMap = array(
'OAuth1' => array(),
'OAuth2' => array()
);
/**
* @var array
*/
protected $serviceBuilders = array(
'OAuth2' => 'buildV2Service',
'OAuth1' => 'buildV1Service',
);
/**
* @param ClientInterface $httpClient
*
* @return ServiceFactory
*/
public function setHttpClient(ClientInterface $httpClient)
{
$this->httpClient = $httpClient;
return $this;
}
/**
* Register a custom service to classname mapping.
*
* @param string $serviceName Name of the service
* @param string $className Class to instantiate
*
* @return ServiceFactory
*
* @throws Exception If the class is nonexistent or does not implement a valid ServiceInterface
*/
public function registerService($serviceName, $className)
{
if (!class_exists($className)) {
throw new Exception(sprintf('Service class %s does not exist.', $className));
}
$reflClass = new \ReflectionClass($className);
foreach (array('OAuth2', 'OAuth1') as $version) {
if ($reflClass->implementsInterface('OAuth\\' . $version . '\\Service\\ServiceInterface')) {
$this->serviceClassMap[$version][ucfirst($serviceName)] = $className;
return $this;
}
}
throw new Exception(sprintf('Service class %s must implement ServiceInterface.', $className));
}
/**
* Builds and returns oauth services
*
* It will first try to build an OAuth2 service and if none found it will try to build an OAuth1 service
*
* @param string $serviceName Name of service to create
* @param CredentialsInterface $credentials
* @param TokenStorageInterface $storage
* @param array|null $scopes If creating an oauth2 service, array of scopes
* @param UriInterface|null $baseApiUri
*
* @return ServiceInterface
*/
public function createService(
$serviceName,
CredentialsInterface $credentials,
TokenStorageInterface $storage,
$scopes = array(),
UriInterface $baseApiUri = null,
$proxy = null
) {
if (!$this->httpClient) {
// for backwards compatibility.
$this->httpClient = new CurlClient();
$this->httpClient->setProxy( $proxy );
}
foreach ($this->serviceBuilders as $version => $buildMethod) {
$fullyQualifiedServiceName = $this->getFullyQualifiedServiceName($serviceName, $version);
if (class_exists($fullyQualifiedServiceName)) {
return $this->$buildMethod($fullyQualifiedServiceName, $credentials, $storage, $scopes, $baseApiUri);
}
}
return null;
}
/**
* Gets the fully qualified name of the service
*
* @param string $serviceName The name of the service of which to get the fully qualified name
* @param string $type The type of the service to get (either OAuth1 or OAuth2)
*
* @return string The fully qualified name of the service
*/
private function getFullyQualifiedServiceName($serviceName, $type)
{
$serviceName = ucfirst($serviceName);
if (isset($this->serviceClassMap[$type][$serviceName])) {
return $this->serviceClassMap[$type][$serviceName];
}
return '\\OAuth\\' . $type . '\\Service\\' . $serviceName;
}
/**
* Builds v2 services
*
* @param string $serviceName The fully qualified service name
* @param CredentialsInterface $credentials
* @param TokenStorageInterface $storage
* @param array|null $scopes Array of scopes for the service
* @param UriInterface|null $baseApiUri
*
* @return ServiceInterface
*
* @throws Exception
*/
private function buildV2Service(
$serviceName,
CredentialsInterface $credentials,
TokenStorageInterface $storage,
array $scopes,
UriInterface $baseApiUri = null
) {
return new $serviceName(
$credentials,
$this->httpClient,
$storage,
$this->resolveScopes($serviceName, $scopes),
$baseApiUri
);
}
/**
* Resolves scopes for v2 services
*
* @param string $serviceName The fully qualified service name
* @param array $scopes List of scopes for the service
*
* @return array List of resolved scopes
*/
private function resolveScopes($serviceName, array $scopes)
{
$reflClass = new \ReflectionClass($serviceName);
$constants = $reflClass->getConstants();
$resolvedScopes = array();
foreach ($scopes as $scope) {
$key = strtoupper('SCOPE_' . $scope);
if (array_key_exists($key, $constants)) {
$resolvedScopes[] = $constants[$key];
} else {
$resolvedScopes[] = $scope;
}
}
return $resolvedScopes;
}
/**
* Builds v1 services
*
* @param string $serviceName The fully qualified service name
* @param CredentialsInterface $credentials
* @param TokenStorageInterface $storage
* @param array $scopes
* @param UriInterface $baseApiUri
*
* @return ServiceInterface
*
* @throws Exception
*/
private function buildV1Service(
$serviceName,
CredentialsInterface $credentials,
TokenStorageInterface $storage,
$scopes,
UriInterface $baseApiUri = null
) {
if (!empty($scopes)) {
throw new Exception(
'Scopes passed to ServiceFactory::
but an OAuth1 service was requested.'
);
}
return new $serviceName($credentials, $this->httpClient, $storage, new Signature($credentials), $baseApiUri);
}
}
| {
"content_hash": "5cec240cf7e7a0763c0d22bcdb6c1fe6",
"timestamp": "",
"source": "github",
"line_count": 223,
"max_line_length": 117,
"avg_line_length": 30.77578475336323,
"alnum_prop": 0.5754043421244354,
"repo_name": "huitiemesens/PHPoAuthLib",
"id": "0fe40deea8f6035274e123dcce15843aa1330c9a",
"size": "7187",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/OAuth/ServiceFactory.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "657086"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "adb08fc57cf15b90d2b4664fe3964b49",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "ff82601baad78bfa3d164daaaa0904134f63f9ef",
"size": "185",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Ageratina rhomboidea/ Syn. Eupatorium rhomboideum/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
FROM balenalib/beaglebone-green-wifi-ubuntu:xenial-run
ENV GO_VERSION 1.14.13
# gcc for cgo
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc \
libc6-dev \
make \
pkg-config \
git \
&& rm -rf /var/lib/apt/lists/*
RUN set -x \
&& fetchDeps=' \
curl \
' \
&& apt-get update && apt-get install -y $fetchDeps --no-install-recommends && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /usr/local/go \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/golang/v$GO_VERSION/go$GO_VERSION.linux-armv7hf.tar.gz" \
&& echo "53c5236a76730f6487052fa1a629d6f5efdde6341cfc2e0544b0b28aefc27708 go$GO_VERSION.linux-armv7hf.tar.gz" | sha256sum -c - \
&& tar -xzf "go$GO_VERSION.linux-armv7hf.tar.gz" -C /usr/local/go --strip-components=1 \
&& rm -f go$GO_VERSION.linux-armv7hf.tar.gz
ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
WORKDIR $GOPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \
&& echo "Running test-stack@golang" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu xenial \nVariant: run variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nGo v1.14.13 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "6284c9085da5af08621469f8da3a1cf4",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 673,
"avg_line_length": 51,
"alnum_prop": 0.7075873827791986,
"repo_name": "nghiant2710/base-images",
"id": "c5a254830ae3d981596d9910e40611f93e45a4fe",
"size": "2367",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/golang/beaglebone-green-wifi/ubuntu/xenial/1.14.13/run/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
using namespace json_spirit;
using namespace std;
int64_t nWalletUnlockTime;
static CCriticalSection cs_nWalletUnlockTime;
extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, json_spirit::Object& entry);
static void accountingDeprecationCheck()
{
if (!GetBoolArg("-enableaccounts", false))
throw runtime_error(
"Accounting API is deprecated and will be removed in future.\n"
"It can easily result in negative or odd balances if misused or misunderstood, which has happened in the field.\n"
"If you still want to enable it, add to your config file enableaccounts=1\n");
if (GetBoolArg("-staking", true))
throw runtime_error("If you want to use accounting API, staking must be disabled, add to your config file staking=0\n");
}
std::string HelpRequiringPassphrase()
{
return pwalletMain->IsCrypted()
? "\nrequires wallet passphrase to be set with walletpassphrase first"
: "";
}
void EnsureWalletIsUnlocked()
{
if (pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
if (fWalletUnlockStakingOnly)
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Wallet is unlocked for staking only.");
}
void WalletTxToJSON(const CWalletTx& wtx, Object& entry)
{
int confirms = wtx.GetDepthInMainChain();
entry.push_back(Pair("confirmations", confirms));
if (wtx.IsCoinBase() || wtx.IsCoinStake())
entry.push_back(Pair("generated", true));
if (confirms > 0)
{
entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
entry.push_back(Pair("blockindex", wtx.nIndex));
entry.push_back(Pair("blocktime", (boost::int64_t)(mapBlockIndex[wtx.hashBlock]->nTime)));
}
entry.push_back(Pair("txid", wtx.GetHash().GetHex()));
entry.push_back(Pair("time", (boost::int64_t)wtx.GetTxTime()));
entry.push_back(Pair("timereceived", (boost::int64_t)wtx.nTimeReceived));
BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue)
entry.push_back(Pair(item.first, item.second));
}
string AccountFromValue(const Value& value)
{
string strAccount = value.get_str();
if (strAccount == "*")
throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, "Invalid account name");
return strAccount;
}
Value getinfo(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
throw runtime_error(
"getinfo\n"
"Returns an object containing various state info.");
proxyType proxy;
GetProxy(NET_IPV4, proxy);
Object obj, diff;
obj.push_back(Pair("version", FormatFullVersion()));
obj.push_back(Pair("protocolversion",(int)PROTOCOL_VERSION));
obj.push_back(Pair("walletversion", pwalletMain->GetVersion()));
obj.push_back(Pair("balance", ValueFromAmount(pwalletMain->GetBalance())));
obj.push_back(Pair("newmint", ValueFromAmount(pwalletMain->GetNewMint())));
obj.push_back(Pair("stake", ValueFromAmount(pwalletMain->GetStake())));
obj.push_back(Pair("blocks", (int)nBestHeight));
obj.push_back(Pair("timeoffset", (boost::int64_t)GetTimeOffset()));
obj.push_back(Pair("moneysupply", ValueFromAmount(pindexBest->nMoneySupply)));
obj.push_back(Pair("connections", (int)vNodes.size()));
obj.push_back(Pair("proxy", (proxy.first.IsValid() ? proxy.first.ToStringIPPort() : string())));
obj.push_back(Pair("ip", addrSeenByPeer.ToStringIP()));
diff.push_back(Pair("proof-of-work", GetDifficulty()));
diff.push_back(Pair("proof-of-stake", GetDifficulty(GetLastBlockIndex(pindexBest, true))));
obj.push_back(Pair("difficulty", diff));
obj.push_back(Pair("testnet", fTestNet));
obj.push_back(Pair("keypoololdest", (boost::int64_t)pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
obj.push_back(Pair("mininput", ValueFromAmount(nMinimumInputValue)));
if (pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime / 1000));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
return obj;
}
Value getnewpubkey(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"getnewpubkey [account]\n"
"Returns new public key for coinbase generation.");
// Parse the account first so we don't generate a key if there's an error
string strAccount;
if (params.size() > 0)
strAccount = AccountFromValue(params[0]);
if (!pwalletMain->IsLocked())
pwalletMain->TopUpKeyPool();
// Generate a new key that is added to wallet
CPubKey newKey;
if (!pwalletMain->GetKeyFromPool(newKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
CKeyID keyID = newKey.GetID();
pwalletMain->SetAddressBookName(keyID, strAccount);
vector<unsigned char> vchPubKey = newKey.Raw();
return HexStr(vchPubKey.begin(), vchPubKey.end());
}
Value getnewaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"getnewaddress [account]\n"
"Returns a new FIFAWCCoin address for receiving payments. "
"If [account] is specified (recommended), it is added to the address book "
"so payments received with the address will be credited to [account].");
// Parse the account first so we don't generate a key if there's an error
string strAccount;
if (params.size() > 0)
strAccount = AccountFromValue(params[0]);
if (!pwalletMain->IsLocked())
pwalletMain->TopUpKeyPool();
// Generate a new key that is added to wallet
CPubKey newKey;
if (!pwalletMain->GetKeyFromPool(newKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
CKeyID keyID = newKey.GetID();
pwalletMain->SetAddressBookName(keyID, strAccount);
return CBitcoinAddress(keyID).ToString();
}
CBitcoinAddress GetAccountAddress(string strAccount, bool bForceNew=false)
{
CWalletDB walletdb(pwalletMain->strWalletFile);
CAccount account;
walletdb.ReadAccount(strAccount, account);
bool bKeyUsed = false;
// Check if the current key has been used
if (account.vchPubKey.IsValid())
{
CScript scriptPubKey;
scriptPubKey.SetDestination(account.vchPubKey.GetID());
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin();
it != pwalletMain->mapWallet.end() && account.vchPubKey.IsValid();
++it)
{
const CWalletTx& wtx = (*it).second;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
bKeyUsed = true;
}
}
// Generate a new key
if (!account.vchPubKey.IsValid() || bForceNew || bKeyUsed)
{
if (!pwalletMain->GetKeyFromPool(account.vchPubKey, false))
throw JSONRPCError(RPC_WALLET_KEYPOOL_RAN_OUT, "Error: Keypool ran out, please call keypoolrefill first");
pwalletMain->SetAddressBookName(account.vchPubKey.GetID(), strAccount);
walletdb.WriteAccount(strAccount, account);
}
return CBitcoinAddress(account.vchPubKey.GetID());
}
Value getaccountaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccountaddress <account>\n"
"Returns the current FIFAWCCoin address for receiving payments to this account.");
// Parse the account first so we don't generate a key if there's an error
string strAccount = AccountFromValue(params[0]);
Value ret;
ret = GetAccountAddress(strAccount).ToString();
return ret;
}
Value setaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"setaccount <FIFAWCCoinaddress> <account>\n"
"Sets the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid FIFAWCCoin address");
string strAccount;
if (params.size() > 1)
strAccount = AccountFromValue(params[1]);
// Detect when changing the account of an address that is the 'unused current key' of another account:
if (pwalletMain->mapAddressBook.count(address.Get()))
{
string strOldAccount = pwalletMain->mapAddressBook[address.Get()];
if (address == GetAccountAddress(strOldAccount))
GetAccountAddress(strOldAccount, true);
}
pwalletMain->SetAddressBookName(address.Get(), strAccount);
return Value::null;
}
Value getaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaccount <FIFAWCCoinaddress>\n"
"Returns the account associated with the given address.");
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid FIFAWCCoin address");
string strAccount;
map<CTxDestination, string>::iterator mi = pwalletMain->mapAddressBook.find(address.Get());
if (mi != pwalletMain->mapAddressBook.end() && !(*mi).second.empty())
strAccount = (*mi).second;
return strAccount;
}
Value getaddressesbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"getaddressesbyaccount <account>\n"
"Returns the list of addresses for the given account.");
string strAccount = AccountFromValue(params[0]);
// Find all addresses that have the given account
Array ret;
BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
const CBitcoinAddress& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
ret.push_back(address.ToString());
}
return ret;
}
Value sendtoaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 4)
throw runtime_error(
"sendtoaddress <FIFAWCCoinaddress> <amount> [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.000001"
+ HelpRequiringPassphrase());
CBitcoinAddress address(params[0].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid FIFAWCCoin address");
// Amount
int64_t nAmount = AmountFromValue(params[1]);
// Wallet comments
CWalletTx wtx;
if (params.size() > 2 && params[2].type() != null_type && !params[2].get_str().empty())
wtx.mapValue["comment"] = params[2].get_str();
if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
wtx.mapValue["to"] = params[3].get_str();
if (pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
return wtx.GetHash().GetHex();
}
Value listaddressgroupings(const Array& params, bool fHelp)
{
if (fHelp)
throw runtime_error(
"listaddressgroupings\n"
"Lists groups of addresses which have had their common ownership\n"
"made public by common use as inputs or as the resulting change\n"
"in past transactions");
Array jsonGroupings;
map<CTxDestination, int64_t> balances = pwalletMain->GetAddressBalances();
BOOST_FOREACH(set<CTxDestination> grouping, pwalletMain->GetAddressGroupings())
{
Array jsonGrouping;
BOOST_FOREACH(CTxDestination address, grouping)
{
Array addressInfo;
addressInfo.push_back(CBitcoinAddress(address).ToString());
addressInfo.push_back(ValueFromAmount(balances[address]));
{
LOCK(pwalletMain->cs_wallet);
if (pwalletMain->mapAddressBook.find(CBitcoinAddress(address).Get()) != pwalletMain->mapAddressBook.end())
addressInfo.push_back(pwalletMain->mapAddressBook.find(CBitcoinAddress(address).Get())->second);
}
jsonGrouping.push_back(addressInfo);
}
jsonGroupings.push_back(jsonGrouping);
}
return jsonGroupings;
}
Value signmessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 2)
throw runtime_error(
"signmessage <FIFAWCCoinaddress> <message>\n"
"Sign a message with the private key of an address");
EnsureWalletIsUnlocked();
string strAddress = params[0].get_str();
string strMessage = params[1].get_str();
CBitcoinAddress addr(strAddress);
if (!addr.IsValid())
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
CKeyID keyID;
if (!addr.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
CKey key;
if (!pwalletMain->GetKey(keyID, key))
throw JSONRPCError(RPC_WALLET_ERROR, "Private key not available");
CDataStream ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
vector<unsigned char> vchSig;
if (!key.SignCompact(Hash(ss.begin(), ss.end()), vchSig))
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Sign failed");
return EncodeBase64(&vchSig[0], vchSig.size());
}
Value verifymessage(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 3)
throw runtime_error(
"verifymessage <FIFAWCCoinaddress> <signature> <message>\n"
"Verify a signed message");
string strAddress = params[0].get_str();
string strSign = params[1].get_str();
string strMessage = params[2].get_str();
CBitcoinAddress addr(strAddress);
if (!addr.IsValid())
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
CKeyID keyID;
if (!addr.GetKeyID(keyID))
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
bool fInvalid = false;
vector<unsigned char> vchSig = DecodeBase64(strSign.c_str(), &fInvalid);
if (fInvalid)
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Malformed base64 encoding");
CDataStream ss(SER_GETHASH, 0);
ss << strMessageMagic;
ss << strMessage;
CKey key;
if (!key.SetCompactSignature(Hash(ss.begin(), ss.end()), vchSig))
return false;
return (key.GetPubKey().GetID() == keyID);
}
Value getreceivedbyaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getreceivedbyaddress <FIFAWCCoinaddress> [minconf=1]\n"
"Returns the total amount received by <FIFAWCCoinaddress> in transactions with at least [minconf] confirmations.");
// Bitcoin address
CBitcoinAddress address = CBitcoinAddress(params[0].get_str());
CScript scriptPubKey;
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid FIFAWCCoin address");
scriptPubKey.SetDestination(address.Get());
if (!IsMine(*pwalletMain,scriptPubKey))
return (double)0.0;
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
// Tally
int64_t nAmount = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || wtx.IsCoinStake() || !wtx.IsFinal())
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
if (txout.scriptPubKey == scriptPubKey)
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
}
return ValueFromAmount(nAmount);
}
void GetAccountAddresses(string strAccount, set<CTxDestination>& setAddress)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, string)& item, pwalletMain->mapAddressBook)
{
const CTxDestination& address = item.first;
const string& strName = item.second;
if (strName == strAccount)
setAddress.insert(address);
}
}
Value getreceivedbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
throw runtime_error(
"getreceivedbyaccount <account> [minconf=1]\n"
"Returns the total amount received by addresses with <account> in transactions with at least [minconf] confirmations.");
accountingDeprecationCheck();
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
// Get the set of pub keys assigned to account
string strAccount = AccountFromValue(params[0]);
set<CTxDestination> setAddress;
GetAccountAddresses(strAccount, setAddress);
// Tally
int64_t nAmount = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || wtx.IsCoinStake() || !wtx.IsFinal())
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
CTxDestination address;
if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*pwalletMain, address) && setAddress.count(address))
if (wtx.GetDepthInMainChain() >= nMinDepth)
nAmount += txout.nValue;
}
}
return (double)nAmount / (double)COIN;
}
int64_t GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth)
{
int64_t nBalance = 0;
// Tally wallet transactions
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!wtx.IsFinal() || wtx.GetDepthInMainChain() < 0)
continue;
int64_t nReceived, nSent, nFee;
wtx.GetAccountAmounts(strAccount, nReceived, nSent, nFee);
if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth && wtx.GetBlocksToMaturity() == 0)
nBalance += nReceived;
nBalance -= nSent + nFee;
}
// Tally internal accounting entries
nBalance += walletdb.GetAccountCreditDebit(strAccount);
return nBalance;
}
int64_t GetAccountBalance(const string& strAccount, int nMinDepth)
{
CWalletDB walletdb(pwalletMain->strWalletFile);
return GetAccountBalance(walletdb, strAccount, nMinDepth);
}
Value getbalance(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"getbalance [account] [minconf=1]\n"
"If [account] is not specified, returns the server's total available balance.\n"
"If [account] is specified, returns the balance in the account.");
if (params.size() == 0)
return ValueFromAmount(pwalletMain->GetBalance());
int nMinDepth = 1;
if (params.size() > 1)
nMinDepth = params[1].get_int();
if (params[0].get_str() == "*") {
// Calculate total balance a different way from GetBalance()
// (GetBalance() sums up all unspent TxOuts)
// getbalance and getbalance '*' 0 should return the same number.
int64_t nBalance = 0;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (!wtx.IsTrusted())
continue;
int64_t allFee;
string strSentAccount;
list<pair<CTxDestination, int64_t> > listReceived;
list<pair<CTxDestination, int64_t> > listSent;
wtx.GetAmounts(listReceived, listSent, allFee, strSentAccount);
if (wtx.GetDepthInMainChain() >= nMinDepth && wtx.GetBlocksToMaturity() == 0)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64_t)& r, listReceived)
nBalance += r.second;
}
BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64_t)& r, listSent)
nBalance -= r.second;
nBalance -= allFee;
}
return ValueFromAmount(nBalance);
}
accountingDeprecationCheck();
string strAccount = AccountFromValue(params[0]);
int64_t nBalance = GetAccountBalance(strAccount, nMinDepth);
return ValueFromAmount(nBalance);
}
Value movecmd(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 3 || params.size() > 5)
throw runtime_error(
"move <fromaccount> <toaccount> <amount> [minconf=1] [comment]\n"
"Move from one account in your wallet to another.");
accountingDeprecationCheck();
string strFrom = AccountFromValue(params[0]);
string strTo = AccountFromValue(params[1]);
int64_t nAmount = AmountFromValue(params[2]);
if (params.size() > 3)
// unused parameter, used to be nMinDepth, keep type-checking it though
(void)params[3].get_int();
string strComment;
if (params.size() > 4)
strComment = params[4].get_str();
CWalletDB walletdb(pwalletMain->strWalletFile);
if (!walletdb.TxnBegin())
throw JSONRPCError(RPC_DATABASE_ERROR, "database error");
int64_t nNow = GetAdjustedTime();
// Debit
CAccountingEntry debit;
debit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
debit.strAccount = strFrom;
debit.nCreditDebit = -nAmount;
debit.nTime = nNow;
debit.strOtherAccount = strTo;
debit.strComment = strComment;
walletdb.WriteAccountingEntry(debit);
// Credit
CAccountingEntry credit;
credit.nOrderPos = pwalletMain->IncOrderPosNext(&walletdb);
credit.strAccount = strTo;
credit.nCreditDebit = nAmount;
credit.nTime = nNow;
credit.strOtherAccount = strFrom;
credit.strComment = strComment;
walletdb.WriteAccountingEntry(credit);
if (!walletdb.TxnCommit())
throw JSONRPCError(RPC_DATABASE_ERROR, "database error");
return true;
}
Value sendfrom(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 3 || params.size() > 6)
throw runtime_error(
"sendfrom <fromaccount> <toFIFAWCCoinaddress> <amount> [minconf=1] [comment] [comment-to]\n"
"<amount> is a real and is rounded to the nearest 0.000001"
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
CBitcoinAddress address(params[1].get_str());
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid FIFAWCCoin address");
int64_t nAmount = AmountFromValue(params[2]);
int nMinDepth = 1;
if (params.size() > 3)
nMinDepth = params[3].get_int();
CWalletTx wtx;
wtx.strFromAccount = strAccount;
if (params.size() > 4 && params[4].type() != null_type && !params[4].get_str().empty())
wtx.mapValue["comment"] = params[4].get_str();
if (params.size() > 5 && params[5].type() != null_type && !params[5].get_str().empty())
wtx.mapValue["to"] = params[5].get_str();
EnsureWalletIsUnlocked();
// Check funds
int64_t nBalance = GetAccountBalance(strAccount, nMinDepth);
if (nAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
// Send
string strError = pwalletMain->SendMoneyToDestination(address.Get(), nAmount, wtx);
if (strError != "")
throw JSONRPCError(RPC_WALLET_ERROR, strError);
return wtx.GetHash().GetHex();
}
Value sendmany(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 4)
throw runtime_error(
"sendmany <fromaccount> {address:amount,...} [minconf=1] [comment]\n"
"amounts are double-precision floating point numbers"
+ HelpRequiringPassphrase());
string strAccount = AccountFromValue(params[0]);
Object sendTo = params[1].get_obj();
int nMinDepth = 1;
if (params.size() > 2)
nMinDepth = params[2].get_int();
CWalletTx wtx;
wtx.strFromAccount = strAccount;
if (params.size() > 3 && params[3].type() != null_type && !params[3].get_str().empty())
wtx.mapValue["comment"] = params[3].get_str();
set<CBitcoinAddress> setAddress;
vector<pair<CScript, int64_t> > vecSend;
int64_t totalAmount = 0;
BOOST_FOREACH(const Pair& s, sendTo)
{
CBitcoinAddress address(s.name_);
if (!address.IsValid())
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, string("Invalid FIFAWCCoin address: ")+s.name_);
if (setAddress.count(address))
throw JSONRPCError(RPC_INVALID_PARAMETER, string("Invalid parameter, duplicated address: ")+s.name_);
setAddress.insert(address);
CScript scriptPubKey;
scriptPubKey.SetDestination(address.Get());
int64_t nAmount = AmountFromValue(s.value_);
totalAmount += nAmount;
vecSend.push_back(make_pair(scriptPubKey, nAmount));
}
EnsureWalletIsUnlocked();
// Check funds
int64_t nBalance = GetAccountBalance(strAccount, nMinDepth);
if (totalAmount > nBalance)
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Account has insufficient funds");
// Send
CReserveKey keyChange(pwalletMain);
int64_t nFeeRequired = 0;
bool fCreated = pwalletMain->CreateTransaction(vecSend, wtx, keyChange, nFeeRequired);
if (!fCreated)
{
if (totalAmount + nFeeRequired > pwalletMain->GetBalance())
throw JSONRPCError(RPC_WALLET_INSUFFICIENT_FUNDS, "Insufficient funds");
throw JSONRPCError(RPC_WALLET_ERROR, "Transaction creation failed");
}
if (!pwalletMain->CommitTransaction(wtx, keyChange))
throw JSONRPCError(RPC_WALLET_ERROR, "Transaction commit failed");
return wtx.GetHash().GetHex();
}
Value addmultisigaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 2 || params.size() > 3)
{
string msg = "addmultisigaddress <nrequired> <'[\"key\",\"key\"]'> [account]\n"
"Add a nrequired-to-sign multisignature address to the wallet\"\n"
"each key is a FIFAWCCoin address or hex-encoded public key\n"
"If [account] is specified, assign address to [account].";
throw runtime_error(msg);
}
int nRequired = params[0].get_int();
const Array& keys = params[1].get_array();
string strAccount;
if (params.size() > 2)
strAccount = AccountFromValue(params[2]);
// Gather public keys
if (nRequired < 1)
throw runtime_error("a multisignature address must require at least one key to redeem");
if ((int)keys.size() < nRequired)
throw runtime_error(
strprintf("not enough keys supplied "
"(got %"PRIszu" keys, but need at least %d to redeem)", keys.size(), nRequired));
std::vector<CKey> pubkeys;
pubkeys.resize(keys.size());
for (unsigned int i = 0; i < keys.size(); i++)
{
const std::string& ks = keys[i].get_str();
// Case 1: Bitcoin address and we have full public key:
CBitcoinAddress address(ks);
if (address.IsValid())
{
CKeyID keyID;
if (!address.GetKeyID(keyID))
throw runtime_error(
strprintf("%s does not refer to a key",ks.c_str()));
CPubKey vchPubKey;
if (!pwalletMain->GetPubKey(keyID, vchPubKey))
throw runtime_error(
strprintf("no full public key for address %s",ks.c_str()));
if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
throw runtime_error(" Invalid public key: "+ks);
}
// Case 2: hex public key
else if (IsHex(ks))
{
CPubKey vchPubKey(ParseHex(ks));
if (!vchPubKey.IsValid() || !pubkeys[i].SetPubKey(vchPubKey))
throw runtime_error(" Invalid public key: "+ks);
}
else
{
throw runtime_error(" Invalid public key: "+ks);
}
}
// Construct using pay-to-script-hash:
CScript inner;
inner.SetMultisig(nRequired, pubkeys);
CScriptID innerID = inner.GetID();
pwalletMain->AddCScript(inner);
pwalletMain->SetAddressBookName(innerID, strAccount);
return CBitcoinAddress(innerID).ToString();
}
Value addredeemscript(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
{
string msg = "addredeemscript <redeemScript> [account]\n"
"Add a P2SH address with a specified redeemScript to the wallet.\n"
"If [account] is specified, assign address to [account].";
throw runtime_error(msg);
}
string strAccount;
if (params.size() > 1)
strAccount = AccountFromValue(params[1]);
// Construct using pay-to-script-hash:
vector<unsigned char> innerData = ParseHexV(params[0], "redeemScript");
CScript inner(innerData.begin(), innerData.end());
CScriptID innerID = inner.GetID();
pwalletMain->AddCScript(inner);
pwalletMain->SetAddressBookName(innerID, strAccount);
return CBitcoinAddress(innerID).ToString();
}
struct tallyitem
{
int64_t nAmount;
int nConf;
tallyitem()
{
nAmount = 0;
nConf = std::numeric_limits<int>::max();
}
};
Value ListReceived(const Array& params, bool fByAccounts)
{
// Minimum confirmations
int nMinDepth = 1;
if (params.size() > 0)
nMinDepth = params[0].get_int();
// Whether to include empty accounts
bool fIncludeEmpty = false;
if (params.size() > 1)
fIncludeEmpty = params[1].get_bool();
// Tally
map<CBitcoinAddress, tallyitem> mapTally;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
if (wtx.IsCoinBase() || wtx.IsCoinStake() || !wtx.IsFinal())
continue;
int nDepth = wtx.GetDepthInMainChain();
if (nDepth < nMinDepth)
continue;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
CTxDestination address;
if (!ExtractDestination(txout.scriptPubKey, address) || !IsMine(*pwalletMain, address))
continue;
tallyitem& item = mapTally[address];
item.nAmount += txout.nValue;
item.nConf = min(item.nConf, nDepth);
}
}
// Reply
Array ret;
map<string, tallyitem> mapAccountTally;
BOOST_FOREACH(const PAIRTYPE(CBitcoinAddress, string)& item, pwalletMain->mapAddressBook)
{
const CBitcoinAddress& address = item.first;
const string& strAccount = item.second;
map<CBitcoinAddress, tallyitem>::iterator it = mapTally.find(address);
if (it == mapTally.end() && !fIncludeEmpty)
continue;
int64_t nAmount = 0;
int nConf = std::numeric_limits<int>::max();
if (it != mapTally.end())
{
nAmount = (*it).second.nAmount;
nConf = (*it).second.nConf;
}
if (fByAccounts)
{
tallyitem& item = mapAccountTally[strAccount];
item.nAmount += nAmount;
item.nConf = min(item.nConf, nConf);
}
else
{
Object obj;
obj.push_back(Pair("address", address.ToString()));
obj.push_back(Pair("account", strAccount));
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
ret.push_back(obj);
}
}
if (fByAccounts)
{
for (map<string, tallyitem>::iterator it = mapAccountTally.begin(); it != mapAccountTally.end(); ++it)
{
int64_t nAmount = (*it).second.nAmount;
int nConf = (*it).second.nConf;
Object obj;
obj.push_back(Pair("account", (*it).first));
obj.push_back(Pair("amount", ValueFromAmount(nAmount)));
obj.push_back(Pair("confirmations", (nConf == std::numeric_limits<int>::max() ? 0 : nConf)));
ret.push_back(obj);
}
}
return ret;
}
Value listreceivedbyaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"listreceivedbyaddress [minconf=1] [includeempty=false]\n"
"[minconf] is the minimum number of confirmations before payments are included.\n"
"[includeempty] whether to include addresses that haven't received any payments.\n"
"Returns an array of objects containing:\n"
" \"address\" : receiving address\n"
" \"account\" : the account of the receiving address\n"
" \"amount\" : total amount received by the address\n"
" \"confirmations\" : number of confirmations of the most recent transaction included");
return ListReceived(params, false);
}
Value listreceivedbyaccount(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"listreceivedbyaccount [minconf=1] [includeempty=false]\n"
"[minconf] is the minimum number of confirmations before payments are included.\n"
"[includeempty] whether to include accounts that haven't received any payments.\n"
"Returns an array of objects containing:\n"
" \"account\" : the account of the receiving addresses\n"
" \"amount\" : total amount received by addresses with this account\n"
" \"confirmations\" : number of confirmations of the most recent transaction included");
accountingDeprecationCheck();
return ListReceived(params, true);
}
static void MaybePushAddress(Object & entry, const CTxDestination &dest)
{
CBitcoinAddress addr;
if (addr.Set(dest))
entry.push_back(Pair("address", addr.ToString()));
}
void ListTransactions(const CWalletTx& wtx, const string& strAccount, int nMinDepth, bool fLong, Array& ret)
{
int64_t nFee;
string strSentAccount;
list<pair<CTxDestination, int64_t> > listReceived;
list<pair<CTxDestination, int64_t> > listSent;
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);
bool fAllAccounts = (strAccount == string("*"));
// Sent
if ((!wtx.IsCoinStake()) && (!listSent.empty() || nFee != 0) && (fAllAccounts || strAccount == strSentAccount))
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent)
{
Object entry;
entry.push_back(Pair("account", strSentAccount));
MaybePushAddress(entry, s.first);
entry.push_back(Pair("category", "send"));
entry.push_back(Pair("amount", ValueFromAmount(-s.second)));
entry.push_back(Pair("fee", ValueFromAmount(-nFee)));
if (fLong)
WalletTxToJSON(wtx, entry);
ret.push_back(entry);
}
}
// Received
if (listReceived.size() > 0 && wtx.GetDepthInMainChain() >= nMinDepth)
{
bool stop = false;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& r, listReceived)
{
string account;
if (pwalletMain->mapAddressBook.count(r.first))
account = pwalletMain->mapAddressBook[r.first];
if (fAllAccounts || (account == strAccount))
{
Object entry;
entry.push_back(Pair("account", account));
MaybePushAddress(entry, r.first);
if (wtx.IsCoinBase() || wtx.IsCoinStake())
{
if (wtx.GetDepthInMainChain() < 1)
entry.push_back(Pair("category", "orphan"));
else if (wtx.GetBlocksToMaturity() > 0)
entry.push_back(Pair("category", "immature"));
else
entry.push_back(Pair("category", "generate"));
}
else
{
entry.push_back(Pair("category", "receive"));
}
if (!wtx.IsCoinStake())
entry.push_back(Pair("amount", ValueFromAmount(r.second)));
else
{
entry.push_back(Pair("amount", ValueFromAmount(-nFee)));
stop = true; // only one coinstake output
}
if (fLong)
WalletTxToJSON(wtx, entry);
ret.push_back(entry);
}
if (stop)
break;
}
}
}
void AcentryToJSON(const CAccountingEntry& acentry, const string& strAccount, Array& ret)
{
bool fAllAccounts = (strAccount == string("*"));
if (fAllAccounts || acentry.strAccount == strAccount)
{
Object entry;
entry.push_back(Pair("account", acentry.strAccount));
entry.push_back(Pair("category", "move"));
entry.push_back(Pair("time", (boost::int64_t)acentry.nTime));
entry.push_back(Pair("amount", ValueFromAmount(acentry.nCreditDebit)));
entry.push_back(Pair("otheraccount", acentry.strOtherAccount));
entry.push_back(Pair("comment", acentry.strComment));
ret.push_back(entry);
}
}
Value listtransactions(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 3)
throw runtime_error(
"listtransactions [account] [count=10] [from=0]\n"
"Returns up to [count] most recent transactions skipping the first [from] transactions for account [account].");
string strAccount = "*";
if (params.size() > 0)
strAccount = params[0].get_str();
int nCount = 10;
if (params.size() > 1)
nCount = params[1].get_int();
int nFrom = 0;
if (params.size() > 2)
nFrom = params[2].get_int();
if (nCount < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative count");
if (nFrom < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative from");
Array ret;
std::list<CAccountingEntry> acentries;
CWallet::TxItems txOrdered = pwalletMain->OrderedTxItems(acentries, strAccount);
// iterate backwards until we have nCount items to return:
for (CWallet::TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it)
{
CWalletTx *const pwtx = (*it).second.first;
if (pwtx != 0)
ListTransactions(*pwtx, strAccount, 0, true, ret);
CAccountingEntry *const pacentry = (*it).second.second;
if (pacentry != 0)
AcentryToJSON(*pacentry, strAccount, ret);
if ((int)ret.size() >= (nCount+nFrom)) break;
}
// ret is newest to oldest
if (nFrom > (int)ret.size())
nFrom = ret.size();
if ((nFrom + nCount) > (int)ret.size())
nCount = ret.size() - nFrom;
Array::iterator first = ret.begin();
std::advance(first, nFrom);
Array::iterator last = ret.begin();
std::advance(last, nFrom+nCount);
if (last != ret.end()) ret.erase(last, ret.end());
if (first != ret.begin()) ret.erase(ret.begin(), first);
std::reverse(ret.begin(), ret.end()); // Return oldest to newest
return ret;
}
Value listaccounts(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"listaccounts [minconf=1]\n"
"Returns Object that has account names as keys, account balances as values.");
accountingDeprecationCheck();
int nMinDepth = 1;
if (params.size() > 0)
nMinDepth = params[0].get_int();
map<string, int64_t> mapAccountBalances;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, string)& entry, pwalletMain->mapAddressBook) {
if (IsMine(*pwalletMain, entry.first)) // This address belongs to me
mapAccountBalances[entry.second] = 0;
}
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
{
const CWalletTx& wtx = (*it).second;
int64_t nFee;
string strSentAccount;
list<pair<CTxDestination, int64_t> > listReceived;
list<pair<CTxDestination, int64_t> > listSent;
int nDepth = wtx.GetDepthInMainChain();
if (nDepth < 0)
continue;
wtx.GetAmounts(listReceived, listSent, nFee, strSentAccount);
mapAccountBalances[strSentAccount] -= nFee;
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& s, listSent)
mapAccountBalances[strSentAccount] -= s.second;
if (nDepth >= nMinDepth && wtx.GetBlocksToMaturity() == 0)
{
BOOST_FOREACH(const PAIRTYPE(CTxDestination, int64_t)& r, listReceived)
if (pwalletMain->mapAddressBook.count(r.first))
mapAccountBalances[pwalletMain->mapAddressBook[r.first]] += r.second;
else
mapAccountBalances[""] += r.second;
}
}
list<CAccountingEntry> acentries;
CWalletDB(pwalletMain->strWalletFile).ListAccountCreditDebit("*", acentries);
BOOST_FOREACH(const CAccountingEntry& entry, acentries)
mapAccountBalances[entry.strAccount] += entry.nCreditDebit;
Object ret;
BOOST_FOREACH(const PAIRTYPE(string, int64_t)& accountBalance, mapAccountBalances) {
ret.push_back(Pair(accountBalance.first, ValueFromAmount(accountBalance.second)));
}
return ret;
}
Value listsinceblock(const Array& params, bool fHelp)
{
if (fHelp)
throw runtime_error(
"listsinceblock [blockhash] [target-confirmations]\n"
"Get all transactions in blocks since block [blockhash], or all transactions if omitted");
CBlockIndex *pindex = NULL;
int target_confirms = 1;
if (params.size() > 0)
{
uint256 blockId = 0;
blockId.SetHex(params[0].get_str());
pindex = CBlockLocator(blockId).GetBlockIndex();
}
if (params.size() > 1)
{
target_confirms = params[1].get_int();
if (target_confirms < 1)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter");
}
int depth = pindex ? (1 + nBestHeight - pindex->nHeight) : -1;
Array transactions;
for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); it++)
{
CWalletTx tx = (*it).second;
if (depth == -1 || tx.GetDepthInMainChain() < depth)
ListTransactions(tx, "*", 0, true, transactions);
}
uint256 lastblock;
if (target_confirms == 1)
{
lastblock = hashBestChain;
}
else
{
int target_height = pindexBest->nHeight + 1 - target_confirms;
CBlockIndex *block;
for (block = pindexBest;
block && block->nHeight > target_height;
block = block->pprev) { }
lastblock = block ? block->GetBlockHash() : 0;
}
Object ret;
ret.push_back(Pair("transactions", transactions));
ret.push_back(Pair("lastblock", lastblock.GetHex()));
return ret;
}
Value gettransaction(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"gettransaction <txid>\n"
"Get detailed information about <txid>");
uint256 hash;
hash.SetHex(params[0].get_str());
Object entry;
if (pwalletMain->mapWallet.count(hash))
{
const CWalletTx& wtx = pwalletMain->mapWallet[hash];
TxToJSON(wtx, 0, entry);
int64_t nCredit = wtx.GetCredit();
int64_t nDebit = wtx.GetDebit();
int64_t nNet = nCredit - nDebit;
int64_t nFee = (wtx.IsFromMe() ? wtx.GetValueOut() - nDebit : 0);
entry.push_back(Pair("amount", ValueFromAmount(nNet - nFee)));
if (wtx.IsFromMe())
entry.push_back(Pair("fee", ValueFromAmount(nFee)));
WalletTxToJSON(wtx, entry);
Array details;
ListTransactions(pwalletMain->mapWallet[hash], "*", 0, false, details);
entry.push_back(Pair("details", details));
}
else
{
CTransaction tx;
uint256 hashBlock = 0;
if (GetTransaction(hash, tx, hashBlock))
{
TxToJSON(tx, 0, entry);
if (hashBlock == 0)
entry.push_back(Pair("confirmations", 0));
else
{
entry.push_back(Pair("blockhash", hashBlock.GetHex()));
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
if (mi != mapBlockIndex.end() && (*mi).second)
{
CBlockIndex* pindex = (*mi).second;
if (pindex->IsInMainChain())
entry.push_back(Pair("confirmations", 1 + nBestHeight - pindex->nHeight));
else
entry.push_back(Pair("confirmations", 0));
}
}
}
else
throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "No information available about transaction");
}
return entry;
}
Value backupwallet(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"backupwallet <destination>\n"
"Safely copies wallet.dat to destination, which can be a directory or a path with filename.");
string strDest = params[0].get_str();
if (!BackupWallet(*pwalletMain, strDest))
throw JSONRPCError(RPC_WALLET_ERROR, "Error: Wallet backup failed!");
return Value::null;
}
Value keypoolrefill(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"keypoolrefill [new-size]\n"
"Fills the keypool."
+ HelpRequiringPassphrase());
unsigned int nSize = max(GetArg("-keypool", 100), (int64_t)0);
if (params.size() > 0) {
if (params[0].get_int() < 0)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected valid size");
nSize = (unsigned int) params[0].get_int();
}
EnsureWalletIsUnlocked();
pwalletMain->TopUpKeyPool(nSize);
if (pwalletMain->GetKeyPoolSize() < nSize)
throw JSONRPCError(RPC_WALLET_ERROR, "Error refreshing keypool.");
return Value::null;
}
void ThreadTopUpKeyPool(void* parg)
{
// Make this thread recognisable as the key-topping-up thread
RenameThread("FIFAWCCoin-key-top");
pwalletMain->TopUpKeyPool();
}
void ThreadCleanWalletPassphrase(void* parg)
{
// Make this thread recognisable as the wallet relocking thread
RenameThread("FIFAWCCoin-lock-wa");
int64_t nMyWakeTime = GetTimeMillis() + *((int64_t*)parg) * 1000;
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
if (nWalletUnlockTime == 0)
{
nWalletUnlockTime = nMyWakeTime;
do
{
if (nWalletUnlockTime==0)
break;
int64_t nToSleep = nWalletUnlockTime - GetTimeMillis();
if (nToSleep <= 0)
break;
LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);
MilliSleep(nToSleep);
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
} while(1);
if (nWalletUnlockTime)
{
nWalletUnlockTime = 0;
pwalletMain->Lock();
}
}
else
{
if (nWalletUnlockTime < nMyWakeTime)
nWalletUnlockTime = nMyWakeTime;
}
LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);
delete (int64_t*)parg;
}
Value walletpassphrase(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() < 2 || params.size() > 3))
throw runtime_error(
"walletpassphrase <passphrase> <timeout> [stakingonly]\n"
"Stores the wallet decryption key in memory for <timeout> seconds.\n"
"if [stakingonly] is true sending functions are disabled.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrase was called.");
if (!pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_ALREADY_UNLOCKED, "Error: Wallet is already unlocked, use walletlock first if need to change unlock settings.");
// Note that the walletpassphrase is stored in params[0] which is not mlock()ed
SecureString strWalletPass;
strWalletPass.reserve(100);
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
strWalletPass = params[0].get_str().c_str();
if (strWalletPass.length() > 0)
{
if (!pwalletMain->Unlock(strWalletPass))
throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
}
else
throw runtime_error(
"walletpassphrase <passphrase> <timeout>\n"
"Stores the wallet decryption key in memory for <timeout> seconds.");
NewThread(ThreadTopUpKeyPool, NULL);
int64_t* pnSleepTime = new int64_t(params[1].get_int64());
NewThread(ThreadCleanWalletPassphrase, pnSleepTime);
// FIFAWCCoin: if user OS account compromised prevent trivial sendmoney commands
if (params.size() > 2)
fWalletUnlockStakingOnly = params[2].get_bool();
else
fWalletUnlockStakingOnly = false;
return Value::null;
}
Value walletpassphrasechange(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2))
throw runtime_error(
"walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
"Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletpassphrasechange was called.");
// TODO: get rid of these .c_str() calls by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
SecureString strOldWalletPass;
strOldWalletPass.reserve(100);
strOldWalletPass = params[0].get_str().c_str();
SecureString strNewWalletPass;
strNewWalletPass.reserve(100);
strNewWalletPass = params[1].get_str().c_str();
if (strOldWalletPass.length() < 1 || strNewWalletPass.length() < 1)
throw runtime_error(
"walletpassphrasechange <oldpassphrase> <newpassphrase>\n"
"Changes the wallet passphrase from <oldpassphrase> to <newpassphrase>.");
if (!pwalletMain->ChangeWalletPassphrase(strOldWalletPass, strNewWalletPass))
throw JSONRPCError(RPC_WALLET_PASSPHRASE_INCORRECT, "Error: The wallet passphrase entered was incorrect.");
return Value::null;
}
Value walletlock(const Array& params, bool fHelp)
{
if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0))
throw runtime_error(
"walletlock\n"
"Removes the wallet encryption key from memory, locking the wallet.\n"
"After calling this method, you will need to call walletpassphrase again\n"
"before being able to call any methods which require the wallet to be unlocked.");
if (fHelp)
return true;
if (!pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an unencrypted wallet, but walletlock was called.");
{
LOCK(cs_nWalletUnlockTime);
pwalletMain->Lock();
nWalletUnlockTime = 0;
}
return Value::null;
}
Value encryptwallet(const Array& params, bool fHelp)
{
if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1))
throw runtime_error(
"encryptwallet <passphrase>\n"
"Encrypts the wallet with <passphrase>.");
if (fHelp)
return true;
if (pwalletMain->IsCrypted())
throw JSONRPCError(RPC_WALLET_WRONG_ENC_STATE, "Error: running with an encrypted wallet, but encryptwallet was called.");
// TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)
// Alternately, find a way to make params[0] mlock()'d to begin with.
SecureString strWalletPass;
strWalletPass.reserve(100);
strWalletPass = params[0].get_str().c_str();
if (strWalletPass.length() < 1)
throw runtime_error(
"encryptwallet <passphrase>\n"
"Encrypts the wallet with <passphrase>.");
if (!pwalletMain->EncryptWallet(strWalletPass))
throw JSONRPCError(RPC_WALLET_ENCRYPTION_FAILED, "Error: Failed to encrypt the wallet.");
// BDB seems to have a bad habit of writing old data into
// slack space in .dat files; that is bad if the old data is
// unencrypted private keys. So:
StartShutdown();
return "wallet encrypted; FIFAWCCoin server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.";
}
class DescribeAddressVisitor : public boost::static_visitor<Object>
{
public:
Object operator()(const CNoDestination &dest) const { return Object(); }
Object operator()(const CKeyID &keyID) const {
Object obj;
CPubKey vchPubKey;
pwalletMain->GetPubKey(keyID, vchPubKey);
obj.push_back(Pair("isscript", false));
obj.push_back(Pair("pubkey", HexStr(vchPubKey.Raw())));
obj.push_back(Pair("iscompressed", vchPubKey.IsCompressed()));
return obj;
}
Object operator()(const CScriptID &scriptID) const {
Object obj;
obj.push_back(Pair("isscript", true));
CScript subscript;
pwalletMain->GetCScript(scriptID, subscript);
std::vector<CTxDestination> addresses;
txnouttype whichType;
int nRequired;
ExtractDestinations(subscript, whichType, addresses, nRequired);
obj.push_back(Pair("script", GetTxnOutputType(whichType)));
obj.push_back(Pair("hex", HexStr(subscript.begin(), subscript.end())));
Array a;
BOOST_FOREACH(const CTxDestination& addr, addresses)
a.push_back(CBitcoinAddress(addr).ToString());
obj.push_back(Pair("addresses", a));
if (whichType == TX_MULTISIG)
obj.push_back(Pair("sigsrequired", nRequired));
return obj;
}
};
Value validateaddress(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 1)
throw runtime_error(
"validateaddress <FIFAWCCoinaddress>\n"
"Return information about <FIFAWCCoinaddress>.");
CBitcoinAddress address(params[0].get_str());
bool isValid = address.IsValid();
Object ret;
ret.push_back(Pair("isvalid", isValid));
if (isValid)
{
CTxDestination dest = address.Get();
string currentAddress = address.ToString();
ret.push_back(Pair("address", currentAddress));
bool fMine = IsMine(*pwalletMain, dest);
ret.push_back(Pair("ismine", fMine));
if (fMine) {
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
ret.insert(ret.end(), detail.begin(), detail.end());
}
if (pwalletMain->mapAddressBook.count(dest))
ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest]));
}
return ret;
}
Value validatepubkey(const Array& params, bool fHelp)
{
if (fHelp || !params.size() || params.size() > 2)
throw runtime_error(
"validatepubkey <FIFAWCCoinpubkey>\n"
"Return information about <FIFAWCCoinpubkey>.");
std::vector<unsigned char> vchPubKey = ParseHex(params[0].get_str());
CPubKey pubKey(vchPubKey);
bool isValid = pubKey.IsValid();
bool isCompressed = pubKey.IsCompressed();
CKeyID keyID = pubKey.GetID();
CBitcoinAddress address;
address.Set(keyID);
Object ret;
ret.push_back(Pair("isvalid", isValid));
if (isValid)
{
CTxDestination dest = address.Get();
string currentAddress = address.ToString();
ret.push_back(Pair("address", currentAddress));
bool fMine = IsMine(*pwalletMain, dest);
ret.push_back(Pair("ismine", fMine));
ret.push_back(Pair("iscompressed", isCompressed));
if (fMine) {
Object detail = boost::apply_visitor(DescribeAddressVisitor(), dest);
ret.insert(ret.end(), detail.begin(), detail.end());
}
if (pwalletMain->mapAddressBook.count(dest))
ret.push_back(Pair("account", pwalletMain->mapAddressBook[dest]));
}
return ret;
}
// FIFAWCCoin: reserve balance from being staked for network protection
Value reservebalance(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 2)
throw runtime_error(
"reservebalance [<reserve> [amount]]\n"
"<reserve> is true or false to turn balance reserve on or off.\n"
"<amount> is a real and rounded to cent.\n"
"Set reserve amount not participating in network protection.\n"
"If no parameters provided current setting is printed.\n");
if (params.size() > 0)
{
bool fReserve = params[0].get_bool();
if (fReserve)
{
if (params.size() == 1)
throw runtime_error("must provide amount to reserve balance.\n");
int64_t nAmount = AmountFromValue(params[1]);
nAmount = (nAmount / CENT) * CENT; // round to cent
if (nAmount < 0)
throw runtime_error("amount cannot be negative.\n");
nReserveBalance = nAmount;
}
else
{
if (params.size() > 1)
throw runtime_error("cannot specify amount to turn off reserve.\n");
nReserveBalance = 0;
}
}
Object result;
result.push_back(Pair("reserve", (nReserveBalance > 0)));
result.push_back(Pair("amount", ValueFromAmount(nReserveBalance)));
return result;
}
// FIFAWCCoin: check wallet integrity
Value checkwallet(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 0)
throw runtime_error(
"checkwallet\n"
"Check wallet for integrity.\n");
int nMismatchSpent;
int64_t nBalanceInQuestion;
pwalletMain->FixSpentCoins(nMismatchSpent, nBalanceInQuestion, true);
Object result;
if (nMismatchSpent == 0)
result.push_back(Pair("wallet check passed", true));
else
{
result.push_back(Pair("mismatched spent coins", nMismatchSpent));
result.push_back(Pair("amount in question", ValueFromAmount(nBalanceInQuestion)));
}
return result;
}
// FIFAWCCoin: repair wallet
Value repairwallet(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 0)
throw runtime_error(
"repairwallet\n"
"Repair wallet if checkwallet reports any problem.\n");
int nMismatchSpent;
int64_t nBalanceInQuestion;
pwalletMain->FixSpentCoins(nMismatchSpent, nBalanceInQuestion);
Object result;
if (nMismatchSpent == 0)
result.push_back(Pair("wallet check passed", true));
else
{
result.push_back(Pair("mismatched spent coins", nMismatchSpent));
result.push_back(Pair("amount affected by repair", ValueFromAmount(nBalanceInQuestion)));
}
return result;
}
// NovaCoin: resend unconfirmed wallet transactions
Value resendtx(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"resendtx\n"
"Re-send unconfirmed transactions.\n"
);
ResendWalletTransactions(true);
return Value::null;
}
// FIFAWCCoin: make a public-private key pair
Value makekeypair(const Array& params, bool fHelp)
{
if (fHelp || params.size() > 1)
throw runtime_error(
"makekeypair [prefix]\n"
"Make a public/private key pair.\n"
"[prefix] is optional preferred prefix for the public key.\n");
string strPrefix = "";
if (params.size() > 0)
strPrefix = params[0].get_str();
CKey key;
key.MakeNewKey(false);
CPrivKey vchPrivKey = key.GetPrivKey();
Object result;
result.push_back(Pair("PrivateKey", HexStr<CPrivKey::iterator>(vchPrivKey.begin(), vchPrivKey.end())));
result.push_back(Pair("PublicKey", HexStr(key.GetPubKey().Raw())));
return result;
}
| {
"content_hash": "7f22cc55f18739c69c0e1e6848de139c",
"timestamp": "",
"source": "github",
"line_count": 1766,
"max_line_length": 159,
"avg_line_length": 34.85617214043035,
"alnum_prop": 0.6244070439924622,
"repo_name": "FWCC/Source",
"id": "268e5e5ad6bb05ff73b9d7973eeae83fa6b20b0b",
"size": "61894",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/rpcwallet.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "51312"
},
{
"name": "C",
"bytes": "3074326"
},
{
"name": "C++",
"bytes": "2481014"
},
{
"name": "CSS",
"bytes": "1127"
},
{
"name": "IDL",
"bytes": "14789"
},
{
"name": "Objective-C++",
"bytes": "3537"
},
{
"name": "Python",
"bytes": "11646"
},
{
"name": "Shell",
"bytes": "1026"
},
{
"name": "TypeScript",
"bytes": "7759764"
}
],
"symlink_target": ""
} |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Security;
using System.Web.SessionState;
namespace NF4T.OData
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
GlobalConfiguration.Configure(WebApiConfig.Register);
}
protected void Session_Start(object sender, EventArgs e)
{
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
}
protected void Application_Error(object sender, EventArgs e)
{
}
protected void Session_End(object sender, EventArgs e)
{
}
protected void Application_End(object sender, EventArgs e)
{
}
}
} | {
"content_hash": "618f7b41d297bdc3c8fc43efe2243546",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 82,
"avg_line_length": 19.755102040816325,
"alnum_prop": 0.628099173553719,
"repo_name": "chrismrgn/NF4T",
"id": "da75dddc4c97c7eaf93c8a816a47addf36abcc88",
"size": "970",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "NF4T.OData/Global.asax.cs",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ASP",
"bytes": "93"
},
{
"name": "C#",
"bytes": "15254"
}
],
"symlink_target": ""
} |
+++
Title = "Zach Koncir"
Twitter = ""
image = ""
type = "speaker"
linktitle = "zach-koncir"
+++
Focused on building cloud things in the enterprise. Home chef, golfer, thrill seeker.
| {
"content_hash": "f8170a0e3525c55c4a0ad71245c53f07",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 85,
"avg_line_length": 18.5,
"alnum_prop": 0.6810810810810811,
"repo_name": "gomex/devopsdays-web",
"id": "00fee5eeabf971f98936c07bb02ce1f43d17dea7",
"size": "185",
"binary": false,
"copies": "4",
"ref": "refs/heads/master",
"path": "content/events/2019-toronto/speakers/zach-koncir.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "1568"
},
{
"name": "HTML",
"bytes": "1937025"
},
{
"name": "JavaScript",
"bytes": "14313"
},
{
"name": "PowerShell",
"bytes": "291"
},
{
"name": "Ruby",
"bytes": "650"
},
{
"name": "Shell",
"bytes": "12282"
}
],
"symlink_target": ""
} |
Release 0.1.2
=============
Add default empty `apis` and `consumers` hashes, to remove warnings appearing in Puppet 4.
Release 0.1.1
=============
Changed to puppet-nodejs since puppetlabs/nodejs is now deprecated.
Release 0.1.0
=============
It now monitors for changes in the konfig files so we do not run the kongfig update if there is no changes.
Added support for ubuntu which installs kongfig in an alternative location.
| {
"content_hash": "15a8abf126e78a21d00811c28da501e8",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 107,
"avg_line_length": 25.529411764705884,
"alnum_prop": 0.7073732718894009,
"repo_name": "mybuilder/puppet-kongfig",
"id": "a25236b0d6239c37756f24ec1068b4fcefbddf17",
"size": "434",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CHANGELOG.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Puppet",
"bytes": "2084"
},
{
"name": "Ruby",
"bytes": "4487"
}
],
"symlink_target": ""
} |
package org.apache.shardingsphere.sql.parser.api.visitor.operation;
import org.apache.shardingsphere.sql.parser.api.visitor.SQLVisitor;
/**
* SQL operation visitor.
*/
public interface SQLOperationVisitor extends SQLVisitor {
}
| {
"content_hash": "7a874de3bcbf7d1cae55ee48dc9e6f02",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 67,
"avg_line_length": 21.272727272727273,
"alnum_prop": 0.7948717948717948,
"repo_name": "apache/incubator-shardingsphere",
"id": "c07cc8e31c3bb44fde1a275924d5d8958255038e",
"size": "1035",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "shardingsphere-sql-parser/shardingsphere-sql-parser-spi/src/main/java/org/apache/shardingsphere/sql/parser/api/visitor/operation/SQLOperationVisitor.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "269258"
},
{
"name": "Batchfile",
"bytes": "3280"
},
{
"name": "CSS",
"bytes": "2842"
},
{
"name": "Dockerfile",
"bytes": "1485"
},
{
"name": "HTML",
"bytes": "2146"
},
{
"name": "Java",
"bytes": "7542761"
},
{
"name": "JavaScript",
"bytes": "92884"
},
{
"name": "Shell",
"bytes": "9837"
},
{
"name": "TSQL",
"bytes": "68705"
},
{
"name": "Vue",
"bytes": "81855"
}
],
"symlink_target": ""
} |
Generates swagger-ui json files for rails apps with APIs. You add the swagger DSL to your controller classes and then run one rake task to generate the json files.
[][gem]
[][gemnasium]
[gem]: https://rubygems.org/gems/swagger-docs
[travis]: http://travis-ci.org/richhollis/swagger-docs
[gemnasium]: https://gemnasium.com/richhollis/swagger-docs
[coveralls]: https://coveralls.io/r/richhollis/swagger-docs
Here is an extract of the DSL from a user controller API class:
```ruby
swagger_controller :users, "User Management"
swagger_api :index do
summary "Fetches all User items"
notes "This lists all the active users"
param :query, :page, :integer, :optional, "Page number"
response :unauthorized
response :not_acceptable
response :requested_range_not_satisfiable
end
```
## Installation
Add this line to your application's Gemfile:
gem 'swagger-docs'
And then execute:
$ bundle
Or install it yourself as:
$ gem install swagger-docs
## Usage
### Create Initializer
Create an initializer in config/initializers (e.g. swagger_docs.rb) and define your APIs:
```ruby
Swagger::Docs::Config.register_apis({
"1.0" => {
# the extension used for the API
:api_extension_type => :json,
# the output location where your .json files are written to
:api_file_path => "public/api/v1/",
# the URL base path to your API
:base_path => "http://api.somedomain.com",
# if you want to delete all .json files at each generation
:clean_directory => false,
# add custom attributes to api-docs
:attributes => {
:info => {
"title" => "Swagger Sample App",
"description" => "This is a sample description.",
"termsOfServiceUrl" => "http://helloreverb.com/terms/",
"contact" => "[email protected]",
"license" => "Apache 2.0",
"licenseUrl" => "http://www.apache.org/licenses/LICENSE-2.0.html"
}
}
}
})
```
#### Configuration options
The following table shows all the current configuration options and their defaults. The default will be used if you don't supply your own value.
<table>
<thead>
<tr>
<th>Option</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td><b>api_extension_type</b></td>
<td>The extension, if necessary, used for your API - e.g. :json or :xml </td>
<td>nil</td>
</tr>
<tr>
<td><b>api_file_path</b></td>
<td>The output file path where generated swagger-docs files are written to. </td>
<td>public/</td>
</tr>
<tr>
<td><b>base_path</b></td>
<td>The URI base path for your API - e.g. api.somedomain.com</td>
<td>/</td>
</tr>
<tr>
<td><b>base_api_controller</b></td>
<td>The base controller class your project uses; it or its subclasses will be where you call swagger_controller and swagger_api.</td>
<td>ActionController::Base</td>
</tr>
<tr>
<td><b>clean_directory</b></td>
<td>When generating swagger-docs files this option specifies if the api_file_path should be cleaned first. This means that all files will be deleted in the output directory first before any files are generated.</td>
<td>false</td>
</tr>
<tr>
<td><b>formatting</b></td>
<td>Specifies which formatting method to apply to the JSON that is written. Available options: :none, :pretty</td>
<td>:pretty</td>
</tr>
<tr>
<td><b>camelize_model_properties</b></td>
<td>Camelizes property names of models. For example, a property name called first_name would be converted to firstName.</td>
<td>true</td>
</tr>
</tbody>
</table>
### Documenting a controller
```ruby
class Api::V1::UsersController < ApplicationController
swagger_controller :users, "User Management"
swagger_api :index do
summary "Fetches all User items"
notes "This lists all the active users"
param :query, :page, :integer, :optional, "Page number"
param :path, :nested_id, :integer, :optional, "Team Id"
response :unauthorized
response :not_acceptable, "The request you made is not acceptable"
response :requested_range_not_satisfiable
end
swagger_api :show do
summary "Fetches a single User item"
param :path, :id, :integer, :optional, "User Id"
response :success, "Success", :User
response :unauthorized
response :not_acceptable
response :not_found
end
swagger_api :create do
summary "Creates a new User"
param :form, :first_name, :string, :required, "First name"
param :form, :last_name, :string, :required, "Last name"
param :form, :email, :string, :required, "Email address"
param_list :form, :role, :string, :required, "Role", [ "admin", "superadmin", "user" ]
response :unauthorized
response :not_acceptable
end
swagger_api :update do
summary "Updates an existing User"
param :path, :id, :integer, :required, "User Id"
param :form, :first_name, :string, :optional, "First name"
param :form, :last_name, :string, :optional, "Last name"
param :form, :email, :string, :optional, "Email address"
param :form, :tag, :Tag, :required, "Tag object"
response :unauthorized
response :not_found
response :not_acceptable
end
swagger_api :destroy do
summary "Deletes an existing User item"
param :path, :id, :integer, :optional, "User Id"
response :unauthorized
response :not_found
end
# Support for Swagger complex types:
# https://github.com/wordnik/swagger-core/wiki/Datatypes#wiki-complex-types
swagger_model :Tag do
description "A Tag object."
property :id, :integer, :required, "User Id"
property :name, :string, :optional, "Name"
end
end
```
### DRYing up common documentation
Suppose you have a header or a parameter that must be present on several controllers and methods. Instead of duplicating it on all the controllers you can do this on your API base controller:
```ruby
class Api::BaseController < ActionController::Base
class << self
Swagger::Docs::Generator::set_real_methods
def inherited(subclass)
super
subclass.class_eval do
setup_basic_api_documentation
end
end
private
def setup_basic_api_documentation
[:index, :show, :create, :update, :delete].each do |api_action|
swagger_api api_action do
param :header, 'Authentication-Token', :string, :required, 'Authentication token'
end
end
end
end
end
```
And then use it as a superclass to all you API controllers. All the subclassed controllers will have the same documentation applied to them.
### DSL Methods
<table>
<thead>
<tr>
<th>Method</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>summary</td>
<td>The summary of the API</td>
</tr>
<tr>
<td>notes (optional)</td>
<td>The associated notes for the API</td>
</tr>
<tr>
<td>param</td>
<td>Standard API Parameter</td>
</tr>
<tr>
<td>param_list</td>
<td>Standard API Enum/List parameter.</td>
</tr>
<tr>
<td>response</td>
<td>Takes a symbol or status code and passes it to `Rack::Utils.status_code`. The current list of status codes can be seen here: https://github.com/rack/rack/blob/master/lib/rack/utils.rb. An optional message can be added.</td>
</tr>
</tbody>
</table>
### Run rake task to generate docs
```
rake swagger:docs
```
Swagger-ui JSON files should now be present in your api_file_path (e.g. ./public/api/v1)
### Sample
A sample Rails application where you can run the above rake command and view the output in swagger-ui can be found here:
https://github.com/richhollis/swagger-docs-sample

### Advanced Customization
#### Inheriting from a custom Api controller
By default swagger-docs is applied to controllers inheriting from ApplicationController.
If this is not the case for your application, use this snippet in your initializer
_before_ calling Swagger::Docs::Config#register_apis(...).
```ruby
class Swagger::Docs::Config
def self.base_api_controller; Api::ApiController end
end
```
#### Custom route discovery for supporting Rails Engines
By default, swagger-docs finds controllers by traversing routes in `Rails.application`.
To override this, you can customize the `base_application` config in an initializer:
```ruby
class Swagger::Docs::Config
def self.base_application; Api::Engine end
end
```
If you want swagger to find controllers in `Rails.application` and/or multiple
engines you can override `base_application` to return an array.
```ruby
class Swagger::Docs::Config
def self.base_application; [Rails.application, Api::Engine, SomeOther::Engine] end
end
```
Or, if you prefer you can override `base_applications` for this purpose. The plural
`base_applications` takes precedence over `base_application` and MUST return an
array.
```ruby
class Swagger::Docs::Config
def self.base_applications; [Rails.application, Api::Engine, SomeOther::Engine] end
end
```
#### Transforming the `path` variable
Swagger allows a distinction between the API documentation server and the hosted API
server through the `path` variable (see [Swagger: No server Integrations](https://github.com/wordnik/swagger-core/wiki/No-server-Integrations)). To override the default swagger-docs behavior, you can provide a `transform_path`
class method in your initializer:
```ruby
class Swagger::Docs::Config
def self.transform_path(path, api_version)
"http://example.com/api-docs/#{api_version}/#{path}"
end
end
```
The transformation will be applied to all API `path` values in the generated `api-docs.json` file.
#### Precompile
It is best-practice *not* to keep documentation in version control. An easy way
to integrate swagger-docs into a conventional deployment setup (e.g. capistrano,
chef, or opsworks) is to piggyback on the 'assets:precompile' rake task. And don't forget
to add your api documentation directory to .gitignore in this case.
```ruby
#Rakefile or lib/task/precompile_overrides.rake
namespace :assets do
task :precompile do
Rake::Task['assets:precompile'].invoke
Rake::Task['swagger:docs'].invoke
end
end
```
### Output files
api-docs.json output:
```json
{
"apiVersion": "1.0",
"swaggerVersion": "1.2",
"basePath": "/api/v1",
"apis": [
{
"path": "/users.{format}",
"description": "User Management"
}
]
}
```
users.json output:
```json
{
"apiVersion": "1.0",
"swaggerVersion": "1.2",
"basePath": "http://api.somedomain.com/api/v1/",
"resourcePath": "/users",
"apis": [
{
"path": "/users",
"operations": [
{
"summary": "Fetches all User items",
"parameters": [
{
"paramType": "query",
"name": "page",
"type": "integer",
"description": "Page number",
"required": false
}
],
"responseMessages": [
{
"code": 401,
"message": "Unauthorized"
},
{
"code": 406,
"message": "The request you made is not acceptable"
},
{
"code": 416,
"message": "Requested Range Not Satisfiable"
}
],
"method": "get",
"nickname": "Api::V1::Users#index"
}
]
},
{
"path": "nested/{nested_id}/sample",
"operations": [
{
"summary": "Fetches all User items",
"parameters": [
{
"paramType": "query",
"name": "page",
"type": "integer",
"description": "Page number",
"required": false
},
{
"paramType": "path",
"name": "nested_id",
"type": "integer",
"description": "Team Id",
"required": false
}
],
"responseMessages": [
{
"code": 401,
"message": "Unauthorized"
},
{
"code": 406,
"message": "The request you made is not acceptable"
},
{
"code": 416,
"message": "Requested Range Not Satisfiable"
}
],
"method": "get",
"nickname": "Api::V1::Users#index"
}
]
},
{
"path": "/users",
"operations": [
{
"summary": "Creates a new User",
"parameters": [
{
"paramType": "form",
"name": "first_name",
"type": "string",
"description": "First name",
"required": true
},
{
"paramType": "form",
"name": "last_name",
"type": "string",
"description": "Last name",
"required": true
},
{
"paramType": "form",
"name": "email",
"type": "string",
"description": "Email address",
"required": true
}
],
"responseMessages": [
{
"code": 401,
"message": "Unauthorized"
},
{
"code": 406,
"message": "Not Acceptable"
}
],
"method": "post",
"nickname": "Api::V1::Users#create"
}
]
},
{
"path": "/users/{id}",
"operations": [
{
"summary": "Fetches a single User item",
"parameters": [
{
"paramType": "path",
"name": "id",
"type": "integer",
"description": "User Id",
"required": false
}
],
"responseMessages": [
{
"code": 401,
"message": "Unauthorized"
},
{
"code": 404,
"message": "Not Found"
},
{
"code": 406,
"message": "Not Acceptable"
}
],
"method": "get",
"nickname": "Api::V1::Users#show"
}
]
},
{
"path": "/users/{id}",
"operations": [
{
"summary": "Updates an existing User",
"parameters": [
{
"paramType": "path",
"name": "id",
"type": "integer",
"description": "User Id",
"required": true
},
{
"paramType": "form",
"name": "first_name",
"type": "string",
"description": "First name",
"required": false
},
{
"paramType": "form",
"name": "last_name",
"type": "string",
"description": "Last name",
"required": false
},
{
"paramType": "form",
"name": "email",
"type": "string",
"description": "Email address",
"required": false
},
{
"paramType": "form",
"name": "tag",
"type": "Tag",
"description": "Tag object",
"required": true
}
],
"responseMessages": [
{
"code": 401,
"message": "Unauthorized"
},
{
"code": 404,
"message": "Not Found"
},
{
"code": 406,
"message": "Not Acceptable"
}
],
"method": "put",
"nickname": "Api::V1::Users#update"
}
]
},
{
"path": "/users/{id}",
"operations": [
{
"summary": "Deletes an existing User item",
"parameters": [
{
"paramType": "path",
"name": "id",
"type": "integer",
"description": "User Id",
"required": false
}
],
"responseMessages": [
{
"code": 401,
"message": "Unauthorized"
},
{
"code": 404,
"message": "Not Found"
}
],
"method": "delete",
"nickname": "Api::V1::Users#destroy"
}
]
}
],
"models": {
"Tag": {
"id": "Tag",
"required": [
"id"
],
"properties": {
"id": {
"type": "integer",
"description": "User Id"
},
"name": {
"type": "string",
"description": "Name",
"foo": "test"
}
},
"description": "A Tag object."
}
}
}
```
## Thanks to our contributors
Thanks to jdar, fotinakis, stevschmid, ldnunes, aaronrenner and all of our contributors for making swagger-docs even better.
## Related Projects
**[@fotinakis](https://github.com/fotinakis/)** has created Swagger::Blocks - a DSL for pure Ruby code blocks: [swagger-blocks](https://github.com/fotinakis/swagger-blocks/)
## More About Me
[Rich Hollis](http://richhollis.co.uk)
## Contributing
When raising a Pull Request please ensure that you have provided good test coverage for the request you are making.
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
| {
"content_hash": "231c264de6ca33ed3e198459ea813540",
"timestamp": "",
"source": "github",
"line_count": 673,
"max_line_length": 227,
"avg_line_length": 26.358098068350667,
"alnum_prop": 0.5676193697502677,
"repo_name": "barstuk/swagger-docs-with-default-value",
"id": "99ef9d7917af10cf8677302537aff32a6e74ba84",
"size": "17756",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "README.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "55029"
}
],
"symlink_target": ""
} |
import React from 'react';
import { Link } from 'react-router-dom';
import { MainNav } from './MainNav';
export const Layout = props => (
<div className="uc-chrome">
<MainNav />
<div className="uc-workspace">
{props.children}
</div>
</div>
);
export default Layout;
| {
"content_hash": "e16a84342d481a5ebf6bfe58a7f3df03",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 40,
"avg_line_length": 20.714285714285715,
"alnum_prop": 0.6275862068965518,
"repo_name": "anjren/UncleChenWebsite",
"id": "98df7a66d1b4bb66cc825af6ca66cb1bee753c39",
"size": "290",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/components/Layout.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "6274"
},
{
"name": "HTML",
"bytes": "533"
},
{
"name": "JavaScript",
"bytes": "71869"
},
{
"name": "Python",
"bytes": "3006"
}
],
"symlink_target": ""
} |
using System;
using System.Xml;
using System.Xml.Serialization;
namespace Clockwork.XML
{
/// <summary>
/// XML Serialization of SMS tag
/// in Send API call
/// </summary>
public class SMS
{
/*
* The ParameterSpecified functions prevent parameters being serialized to XML when they're null
* allowing the API customer defaults to work correctly
*/
public string To { get; set; }
public string Content { get; set; }
public string From { get; set; }
public string ClientID { get; set; }
public int WrapperID { get; set; }
public bool? Long { get; set; }
[XmlIgnore]
public bool LongSpecified => Long != null;
public bool? Truncate { get; set; }
[XmlIgnore]
public bool TruncateSpecified => Truncate != null;
// Ignore this as we wan't to serialize the integer not the enum
[XmlIgnore]
public InvalidCharacterAction? InvalidCharAction { get; set; }
// Integer representation of the Invalid Character Action enum
[XmlElement("InvalidCharAction")]
public int InvalidCharActionXml
{
get { return (int)InvalidCharAction; }
set { InvalidCharAction = (InvalidCharacterAction)Enum.ToObject(typeof(InvalidCharacterAction), value); }
}
[XmlIgnore]
public bool InvalidCharActionXmlSpecified
{
get { return InvalidCharAction != null && InvalidCharAction != InvalidCharacterAction.AccountDefault; }
}
}
}
| {
"content_hash": "8905c29983b4cb813fd5d123ed170dc9",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 117,
"avg_line_length": 32.285714285714285,
"alnum_prop": 0.6175726927939317,
"repo_name": "mediaburst/clockwork-dotnet",
"id": "e9955e74ca2202a9d3c83905ab65be02a98eb1a9",
"size": "1584",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Clockwork/XML/SMS.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "41967"
},
{
"name": "Visual Basic",
"bytes": "14100"
}
],
"symlink_target": ""
} |
require "forwardable"
require "addressable/uri"
require "faraday"
require "faraday_middleware"
require "tacokit/authorization"
require "tacokit/collection"
require "tacokit/configuration"
require "tacokit/middleware"
require "tacokit/response"
require "tacokit/transform"
require "tacokit/client/actions"
require "tacokit/client/boards"
require "tacokit/client/cards"
require "tacokit/client/checklists"
require "tacokit/client/labels"
require "tacokit/client/lists"
require "tacokit/client/members"
require "tacokit/client/notifications"
require "tacokit/client/organizations"
require "tacokit/client/searches"
require "tacokit/client/tokens"
require "tacokit/client/types"
require "tacokit/client/webhooks"
module Tacokit
class Client
extend Forwardable
include Tacokit::Authorization
include Tacokit::Utils
include Tacokit::Client::Actions
include Tacokit::Client::Boards
include Tacokit::Client::Cards
include Tacokit::Client::Checklists
include Tacokit::Client::Labels
include Tacokit::Client::Lists
include Tacokit::Client::Members
include Tacokit::Client::Notifications
include Tacokit::Client::Organizations
include Tacokit::Client::Searches
include Tacokit::Client::Tokens
include Tacokit::Client::Types
include Tacokit::Client::Webhooks
def_delegators :configuration, *Configuration.keys
def_delegators :transform, :serialize, :deserialize, :serialize_params
attr_accessor :last_response
def initialize(options = {})
configuration.options = options
end
def reset!
@configuration = nil
end
def configure
yield configuration if block_given?
end
def configuration
@configuration ||= Configuration.new
end
def get(url, options = {})
request :get, url, options
end
def post(url, options = {})
request :post, url, options
end
def put(url, options = {})
request :put, url, options
end
def delete(url, options = {})
request :delete, url, options
end
def paginated_get(*args)
Collection.new(self, :get, *args)
end
def request(method, url, data = nil, params = nil)
if [:get, :body].include?(method)
params ||= data
data = nil
end
response = connection.send method, url do |req|
req.params.update serialize_params(params)
req.body = serialize(data) if data
end
@last_response = last_response = Response.new(self, response)
last_response.data
end
def to_s
"<#{self.class}:#{object_id}>"
end
alias inspect to_s
private
def transform
@transform ||= Transform.new
end
def connection_options
{
url: api_endpoint,
builder: configuration.stack,
headers: { user_agent: "Tacokit #{Tacokit::VERSION}" }
}
end
def connection
@connection ||= Faraday.new(connection_options) do |http|
if configuration.user_authenticated?
http.request :oauth, configuration.user_credentials
elsif configuration.app_authenticated?
http.params.update configuration.app_credentials
end
end
end
end
end
| {
"content_hash": "de5cbcf3645f16044b9022b055b2ec5c",
"timestamp": "",
"source": "github",
"line_count": 136,
"max_line_length": 74,
"avg_line_length": 23.691176470588236,
"alnum_prop": 0.6778398510242085,
"repo_name": "rossta/tacokit.rb",
"id": "bf041cb425e9af0fa2d44d558e32b00a2d0bcab7",
"size": "3222",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/tacokit/client.rb",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Ruby",
"bytes": "154388"
},
{
"name": "Shell",
"bytes": "181"
}
],
"symlink_target": ""
} |
TEST(DISABLED_CallInDestructor, constructor) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, copy_constructor) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, move_constructor) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, copy_assignment) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, move_assignment) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, active) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, cancel) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, restore) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, call_and_cancel) {
// TODO: implement it
}
// NOLINTNEXTLINE
TEST(DISABLED_CallInDestructor, destructor) {
// TODO: implement it
}
| {
"content_hash": "17770d9ba3b7b8b3ed6a65a770e6f6f6",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 51,
"avg_line_length": 19.333333333333332,
"alnum_prop": 0.71875,
"repo_name": "krzyk240/simlib",
"id": "f8c14ca6b1f98865a42344c8a1194b3a9733f253",
"size": "1013",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "test/call_in_destructor.cc",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C",
"bytes": "25130"
},
{
"name": "C++",
"bytes": "1553058"
},
{
"name": "Makefile",
"bytes": "3541"
},
{
"name": "Objective-C",
"bytes": "5467"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software
Foundation (ASF) under one or more contributor license agreements. See the
NOTICE file distributed with this work for additional information regarding
copyright ownership. The ASF licenses this file to You under the Apache License,
Version 2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.metron</groupId>
<artifactId>metron-platform</artifactId>
<version>0.7.2</version>
</parent>
<artifactId>metron-job</artifactId>
<name>metron-job</name>
<description>Metron Job</description>
<url>https://metron.apache.org/</url>
<dependencies>
<dependency>
<groupId>org.apache.metron</groupId>
<artifactId>metron-common</artifactId>
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</project>
| {
"content_hash": "05dec239592c123e08dcc5b382cd372e",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 108,
"avg_line_length": 40.41025641025641,
"alnum_prop": 0.7290609137055838,
"repo_name": "justinleet/incubator-metron",
"id": "5eb2bf676526b65c16fc4b873acbd4ee0e209e04",
"size": "1576",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "metron-platform/metron-job/pom.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "ANTLR",
"bytes": "11974"
},
{
"name": "Bro",
"bytes": "5403"
},
{
"name": "C",
"bytes": "45683"
},
{
"name": "C++",
"bytes": "15723"
},
{
"name": "CMake",
"bytes": "5605"
},
{
"name": "CSS",
"bytes": "703394"
},
{
"name": "HTML",
"bytes": "982173"
},
{
"name": "Java",
"bytes": "4033820"
},
{
"name": "JavaScript",
"bytes": "157826"
},
{
"name": "Makefile",
"bytes": "4867"
},
{
"name": "OpenEdge ABL",
"bytes": "70365"
},
{
"name": "Python",
"bytes": "197631"
},
{
"name": "Ruby",
"bytes": "22800"
},
{
"name": "Scala",
"bytes": "2700"
},
{
"name": "Shell",
"bytes": "135728"
},
{
"name": "TypeScript",
"bytes": "532518"
}
],
"symlink_target": ""
} |
#ifndef _LASER_ODOMETRY_CORE_LASER_ODOMETRY_TRANSFORM_H_
#define _LASER_ODOMETRY_CORE_LASER_ODOMETRY_TRANSFORM_H_
// Eigen header
#include <Eigen/Geometry>
namespace laser_odometry
{
using Scalar = double;
constexpr Scalar eps = 1e-6;
constexpr Scalar default_cov_diag_val = 1e-6;
template <typename T, int Dim>
using Isometry = Eigen::Transform<T, Dim, Eigen::Isometry>;
template <typename T>
using Isometry3 = Isometry<T, 3>;
using Isometry3s = Isometry3<Scalar>;
// The transform type.
using Transform = Isometry3s;
// The covariance type associated
// to the above Transform.
using Covariance = Eigen::Matrix<Scalar, 6, 6>;
using Jacobian = Eigen::Matrix<Scalar, 6, 6>;
struct TransformWithCovariance
{
TransformWithCovariance() = default;
explicit TransformWithCovariance(const Transform& transform,
const Covariance& covariance) :
transform_(transform),
covariance_(covariance)
{
//
}
Transform transform_ = Transform::Identity();
Covariance covariance_ = Covariance::Zero();
};
} /* namespace laser_odometry */
#endif /* _LASER_ODOMETRY_CORE_LASER_ODOMETRY_TRANSFORM_H_ */
| {
"content_hash": "59565ea611e08cdf834b8910b0742c83",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 66,
"avg_line_length": 22.764705882352942,
"alnum_prop": 0.7062876830318691,
"repo_name": "artivis/laser_odometry",
"id": "13bf16a40651126fc5b6b3b53ed4329bb218da74",
"size": "1161",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "laser_odometry_core/include/laser_odometry_core/laser_odometry_transform.h",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "C",
"bytes": "503"
},
{
"name": "C++",
"bytes": "76633"
},
{
"name": "CMake",
"bytes": "4782"
}
],
"symlink_target": ""
} |
var vm = require('vm')
var Domain = require('domain')
var whitelist = require('./whitelist.json')
function createContext (id) {
var domain = Domain.create()
domain.on('error', function (err) {
console.error('error inside context:'+id)
console.error(err.stack)
domain.dispose()
})
var started = false
function createDomain (run) {
if(started) throw new Error('already started domain')
started = true
domain.run(run)
return domain
}
var intervals = []
var context = {
console: {
log: function () {
domain.emit('console_log', [].slice.call(arguments))
},
error: function () {
domain.emit('console_error', [].slice.call(arguments))
},
},
setInterval: setInterval,
setTimeout: setTimeout,
clearInterval: clearInterval,
clearTimeout: clearTimeout,
setImmediate: setImmediate,
require: function (r) {
if(!~whitelist.indexOf(r))
return domain.emit('error', new Error('script *must not* access module: ' + r ))
return require(r)
},
createDomain: createDomain,
//TODO: make these safe...
process: process,
}
context.global = context
context.window = context
return context
}
var inject = function (a, b, c) {
return createDomain(function () {
;(
BUNDLE
)(a, b, c)
})
}
var createFactory = module.exports = function (bundle) {
return vm.runInNewContext(
'('+inject.toString().replace('BUNDLE', bundle)+')'
, createContext(), 'securify'
)
}
| {
"content_hash": "4d9e7ace7c68007b6967f1cba509229c",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 88,
"avg_line_length": 21.25,
"alnum_prop": 0.6209150326797386,
"repo_name": "dominictarr/securify",
"id": "92890eea36ec697bd31c5bf7889277c004aac557",
"size": "1530",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "index.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "JavaScript",
"bytes": "5360"
}
],
"symlink_target": ""
} |
package org.apache.asterix.external.api;
import java.util.List;
import org.apache.asterix.external.indexing.ExternalFile;
public interface IIndexingAdapterFactory extends IAdapterFactory {
public void setSnapshot(List<ExternalFile> files, boolean indexingOp);
}
| {
"content_hash": "012b06abe9594e06d2a61546f56778b6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 74,
"avg_line_length": 27,
"alnum_prop": 0.8185185185185185,
"repo_name": "ecarm002/incubator-asterixdb",
"id": "37cc1cfc7809c7c410d60999eb760c63a6f04bb3",
"size": "1077",
"binary": false,
"copies": "5",
"ref": "refs/heads/master",
"path": "asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/api/IIndexingAdapterFactory.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Batchfile",
"bytes": "8721"
},
{
"name": "C",
"bytes": "421"
},
{
"name": "CSS",
"bytes": "8823"
},
{
"name": "Crystal",
"bytes": "453"
},
{
"name": "Gnuplot",
"bytes": "89"
},
{
"name": "HTML",
"bytes": "126208"
},
{
"name": "Java",
"bytes": "18965823"
},
{
"name": "JavaScript",
"bytes": "274822"
},
{
"name": "Python",
"bytes": "281315"
},
{
"name": "Ruby",
"bytes": "3078"
},
{
"name": "Scheme",
"bytes": "1105"
},
{
"name": "Shell",
"bytes": "203955"
},
{
"name": "Smarty",
"bytes": "31412"
}
],
"symlink_target": ""
} |
package com.example.alan.thunderweather.util;
import okhttp3.OkHttpClient;
import okhttp3.Request;
/**
* Created by Alan on 2017/8/21.
*/
public class HttpUtil {
public static void sendOkHttpRequest(String address,okhttp3.Callback callback)
{
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url(address).build();
client.newCall(request).enqueue(callback);
}
}
| {
"content_hash": "4260696504fd15d13cf56140dde3ce8f",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 82,
"avg_line_length": 25.58823529411765,
"alnum_prop": 0.7080459770114943,
"repo_name": "CoderAlan/ThunderWeather",
"id": "df88d0f40b8b022b03ee9ca13359116e99cbe142",
"size": "435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "app/src/main/java/com/example/alan/thunderweather/util/HttpUtil.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "34198"
}
],
"symlink_target": ""
} |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Ionic makes it incredibly easy to build beautiful and interactive mobile apps using HTML5 and AngularJS.">
<meta name="keywords" content="html5,javascript,mobile,drifty,ionic,hybrid,phonegap,cordova,native,ios,android,angularjs">
<meta name="author" content="Drifty">
<meta property="og:image" content="http://ionicframework.com/img/ionic-logo-blog.png"/>
<!-- version /docs/nightly should not be indexed -->
<meta name="robots" content="noindex">
<title>keyboard-attach - Directive in module ionic - Ionic Framework</title>
<link href="/css/site.css?17" rel="stylesheet">
<!--<script src="//cdn.optimizely.com/js/595530035.js"></script>-->
<script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-44023830-1', 'ionicframework.com');
ga('send', 'pageview');
</script>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body class="docs docs-page docs-api">
<nav class="navbar navbar-default horizontal-gradient" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle button ionic" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<i class="icon ion-navicon"></i>
</button>
<a class="navbar-brand" href="/">
<img src="/img/ionic-logo-white.svg" width="123" height="43" alt="Ionic Framework">
</a>
<a href="http://blog.ionic.io/announcing-ionic-1-0/" target="_blank">
<img src="/img/ionic1-tag.png" alt="Ionic 1.0 is out!" width="28" height="32" style="margin-left: 140px; margin-top:22px; display:block">
</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a class="getting-started-nav nav-link" href="/getting-started/">Getting Started</a></li>
<li><a class="docs-nav nav-link" href="/docs/">Docs</a></li>
<li><a class="nav-link" href="http://ionic.io/support">Support</a></li>
<li><a class="blog-nav nav-link" href="http://blog.ionic.io/">Blog <span id="blog-badge">1</span></a></li>
<li><a class="nav-link" href="http://forum.ionicframework.com/">Forum</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle nav-link " data-toggle="dropdown" role="button" aria-expanded="false">More <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<div class="arrow-up"></div>
<li><a class="products-nav nav-link" href="http://ionic.io/">Ionic Platform</a></li>
<li><a class="examples-nav nav-link" href="http://showcase.ionicframework.com/">Showcase</a></li>
<li><a class="nav-link" href="http://jobs.ionic.io/">Job Board</a></li>
<li><a class="nav-link" href="http://market.ionic.io/">Market</a></li>
<li><a class="nav-link" href="http://ionicworldwide.herokuapp.com/">Ionic Worldwide</a></li>
<li><a class="nav-link" href="http://play.ionic.io/">Playground</a></li>
<li><a class="nav-link" href="http://creator.ionic.io/">Creator</a></li>
<li><a class="nav-link" href="http://shop.ionic.io/">Shop</a></li>
<!--<li><a class="nav-link" href="http://ngcordova.com/">ngCordova</a></li>-->
</ul>
</li>
</ul>
</div>
</div>
</nav>
<div class="header horizontal-gradient">
<div class="container">
<h3>keyboard-attach</h3>
<h4>Directive in module ionic</h4>
</div>
<div class="news">
<div class="container">
<div class="row">
<div class="col-sm-8 news-col">
<div class="picker">
<select name="version"
id="version-toggle"
onchange="window.location.href=this.options[this.selectedIndex].value">
<option
value="/docs/v2/nightly/api/directive/keyboardAttach/"
selected>
nightly
</option>
<option
value="/docs/v2/api/directive/keyboardAttach/"
>
2.0.0 (latest)
</option>
</select>
</div>
</div>
<div class="col-sm-4 search-col">
<div class="search-bar">
<span class="search-icon ionic"><i class="ion-ios7-search-strong"></i></span>
<input type="search" id="search-input" value="Search">
</div>
</div>
</div>
</div>
</div>
</div>
<div id="search-results" class="search-results" style="display:none">
<div class="container">
<div class="search-section search-api">
<h4>JavaScript</h4>
<ul id="results-api"></ul>
</div>
<div class="search-section search-css">
<h4>CSS</h4>
<ul id="results-css"></ul>
</div>
<div class="search-section search-content">
<h4>Resources</h4>
<ul id="results-content"></ul>
</div>
</div>
</div>
<div class="container content-container">
<div class="row">
<div class="col-md-2 col-sm-3 aside-menu">
<div>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/overview/">Overview</a>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/components/">CSS</a>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/platform-customization/">Platform Customization</a>
</li>
</ul>
<!-- Docs: JavaScript -->
<ul class="nav left-menu active-menu">
<li class="menu-title">
<a href="/docs/nightly/api/">
JavaScript
</a>
</li>
<!-- Action Sheet -->
<li class="menu-section">
<a href="/docs/nightly/api/service/$ionicActionSheet/" class="api-section">
Action Sheet
</a>
<ul>
<li>
<a href="/docs/nightly/api/service/$ionicActionSheet/">
$ionicActionSheet
</a>
</li>
</ul>
</li>
<!-- Backdrop -->
<li class="menu-section">
<a href="/docs/nightly/api/service/$ionicBackdrop/" class="api-section">
Backdrop
</a>
<ul>
<li>
<a href="/docs/nightly/api/service/$ionicBackdrop/">
$ionicBackdrop
</a>
</li>
</ul>
</li>
<!-- Content -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionContent/" class="api-section">
Content
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionContent/">
ion-content
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionRefresher/">
ion-refresher
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionPane/">
ion-pane
</a>
</li>
</ul>
</li>
<!-- Form Inputs -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionCheckbox/" class="api-section">
Form Inputs
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionCheckbox/">
ion-checkbox
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionRadio/">
ion-radio
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionToggle/">
ion-toggle
</a>
</li>
</ul>
</li>
<!-- Gesture and Events -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/onHold/" class="api-section">
Gestures and Events
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/onHold/">
on-hold
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onTap/">
on-tap
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onDoubleTap/">
on-double-tap
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onTouch/">
on-touch
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onRelease/">
on-release
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onDrag/">
on-drag
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onDragUp/">
on-drag-up
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onDragRight/">
on-drag-right
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onDragDown/">
on-drag-down
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onDragLeft/">
on-drag-left
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onSwipe/">
on-swipe
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onSwipeUp/">
on-swipe-up
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onSwipeRight/">
on-swipe-right
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onSwipeDown/">
on-swipe-down
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/onSwipeLeft/">
on-swipe-left
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicGesture/">
$ionicGesture
</a>
</li>
</ul>
</li>
<!-- Headers/Footers -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionHeaderBar/" class="api-section">
Headers/Footers
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionHeaderBar/">
ion-header-bar
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionFooterBar/">
ion-footer-bar
</a>
</li>
</ul>
</li>
<!-- Keyboard -->
<li class="menu-section">
<a href="/docs/nightly/api/page/keyboard/" class="api-section">
Keyboard
</a>
<ul>
<li>
<a href="/docs/nightly/api/page/keyboard/">
Keyboard
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/keyboardAttach/">
keyboard-attach
</a>
</li>
</ul>
</li>
<!-- Lists -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionList/" class="api-section">
Lists
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionList/">
ion-list
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionItem/">
ion-item
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionDeleteButton/">
ion-delete-button
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionReorderButton/">
ion-reorder-button
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionOptionButton/">
ion-option-button
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/collectionRepeat/">
collection-repeat
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicListDelegate/">
$ionicListDelegate
</a>
</li>
</ul>
</li>
<!-- Loading -->
<li class="menu-section">
<a href="/docs/nightly/api/service/$ionicLoading/" class="api-section">
Loading
</a>
<ul>
<li>
<a href="/docs/nightly/api/service/$ionicLoading/">
$ionicLoading
</a>
</li>
</ul>
<ul>
<li>
<a href="/docs/nightly/api/object/$ionicLoadingConfig/">
$ionicLoadingConfig
</a>
</li>
</ul>
</li>
<!-- Modal -->
<li class="menu-section">
<a href="/docs/nightly/api/service/$ionicModal/" class="api-section">
Modal
</a>
<ul>
<li>
<a href="/docs/nightly/api/service/$ionicModal/">
$ionicModal
</a>
</li>
<li>
<a href="/docs/nightly/api/controller/ionicModal/">
ionicModal
</a>
</li>
</ul>
</li>
<!-- Navigation -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionNavView/" class="api-section">
Navigation
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionNavView/">
ion-nav-view
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionView/">
ion-view
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionNavBar/">
ion-nav-bar
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionNavBackButton/">
ion-nav-back-button
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionNavButtons/">
ion-nav-buttons
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionNavTitle/">
ion-nav-title
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/navTransition/">
nav-transition
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/navDirection/">
nav-direction
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicNavBarDelegate/">
$ionicNavBarDelegate
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicHistory/">
$ionicHistory
</a>
</li>
</ul>
</li>
<!-- Platform -->
<li class="menu-section">
<a href="/docs/nightly/api/service/$ionicPlatform/" class="api-section">
Platform
</a>
<ul>
<li>
<a href="/docs/nightly/api/service/$ionicPlatform/">
$ionicPlatform
</a>
</li>
</ul>
</li>
<!-- Popover -->
<li class="menu-section">
<a href="/docs/nightly/api/service/$ionicPopover/" class="api-section">
Popover
</a>
<ul>
<li>
<a href="/docs/nightly/api/service/$ionicPopover/">
$ionicPopover
</a>
</li>
<li>
<a href="/docs/nightly/api/controller/ionicPopover/">
ionicPopover
</a>
</li>
</ul>
</li>
<!-- Popup -->
<li class="menu-section">
<a href="/docs/nightly/api/service/$ionicPopup/" class="api-section">
Popup
</a>
<ul>
<li>
<a href="/docs/nightly/api/service/$ionicPopup/">
$ionicPopup
</a>
</li>
</ul>
</li>
<!-- Scroll -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionScroll/" class="api-section">
Scroll
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionScroll/">
ion-scroll
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionInfiniteScroll/">
ion-infinite-scroll
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicScrollDelegate/">
$ionicScrollDelegate
</a>
</li>
</ul>
</li>
<!-- Side Menus -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionSideMenus/" class="api-section">
Side Menus
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionSideMenus/">
ion-side-menus
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionSideMenuContent/">
ion-side-menu-content
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionSideMenu/">
ion-side-menu
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/exposeAsideWhen/">
expose-aside-when
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/menuToggle/">
menu-toggle
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/menuClose/">
menu-close
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicSideMenuDelegate/">
$ionicSideMenuDelegate
</a>
</li>
</ul>
</li>
<!-- Slide Box -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionSlideBox/" class="api-section">
Slide Box
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionSlideBox/">
ion-slide-box
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionSlidePager/">
ion-slide-pager
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionSlide/">
ion-slide
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicSlideBoxDelegate/">
$ionicSlideBoxDelegate
</a>
</li>
</ul>
</li>
<!-- Spinner -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionSpinner/" class="api-section">
Spinner
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionSpinner/">
ion-spinner
</a>
</li>
</ul>
</li>
<!-- Tabs -->
<li class="menu-section">
<a href="/docs/nightly/api/directive/ionTabs/" class="api-section">
Tabs
</a>
<ul>
<li>
<a href="/docs/nightly/api/directive/ionTabs/">
ion-tabs
</a>
</li>
<li>
<a href="/docs/nightly/api/directive/ionTab/">
ion-tab
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicTabsDelegate/">
$ionicTabsDelegate
</a>
</li>
</ul>
</li>
<!-- Tap -->
<li class="menu-section">
<a href="/docs/nightly/api/page/tap/" class="api-section">
Tap & Click
</a>
</li>
<!-- Utility -->
<li class="menu-section">
<a href="#" class="api-section">
Utility
</a>
<ul>
<li>
<a href="/docs/nightly/api/provider/$ionicConfigProvider/">
$ionicConfigProvider
</a>
</li>
<li>
<a href="/docs/nightly/api/utility/ionic.Platform/">
ionic.Platform
</a>
</li>
<li>
<a href="/docs/nightly/api/utility/ionic.DomUtil/">
ionic.DomUtil
</a>
</li>
<li>
<a href="/docs/nightly/api/utility/ionic.EventController/">
ionic.EventController
</a>
</li>
<li>
<a href="/docs/nightly/api/service/$ionicPosition/">
$ionicPosition
</a>
</li>
</ul>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/cli/">CLI</a>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="http://learn.ionicframework.com/">Learn Ionic</a>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/guide/">Guide</a>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/ionic-cli-faq/">FAQ</a>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/getting-help/">Getting Help</a>
</li>
</ul>
<ul class="nav left-menu">
<li class="menu-title">
<a href="/docs/concepts/">Ionic Concepts</a>
</li>
</ul>
</div>
</div>
<div class="col-md-10 col-sm-9 main-content">
<div class="improve-docs">
<a href="http://github.com/driftyco/ionic/tree/master/js/angular/directive/keyboardAttach.js#L1">
View Source
</a>
<a href="http://github.com/driftyco/ionic/edit/master/js/angular/directive/keyboardAttach.js#L1">
Improve this doc
</a>
</div>
<h1 class="api-title">
keyboard-attach
</h1>
<p>keyboard-attach is an attribute directive which will cause an element to float above<br />
the keyboard when the keyboard shows. Currently only supports the<br />
<a href="/docs/nightly/api/directive/ionFooterBar/">ion-footer-bar</a> directive.</p>
<h3 id="notes">Notes</h3>
<ul>
<li>This directive requires the<br />
<a href="https://github.com/driftyco/ionic-plugins-keyboard">Ionic Keyboard Plugin</a>.</li>
<li>On Android not in fullscreen mode, i.e. you have<br />
<code><preference name="Fullscreen" value="false" /></code> or no preference in your <code>config.xml</code> file,<br />
this directive is unnecessary since it is the default behavior.</li>
<li>On iOS, if there is an input in your footer, you will need to set<br />
<code>cordova.plugins.Keyboard.disableScroll(true)</code>.</li>
</ul>
<h2 id="usage">Usage</h2>
<pre><code class="language-html"> <ion-footer-bar align-title="left" keyboard-attach class="bar-assertive">
<h1 class="title">Title!</h1>
</ion-footer-bar>
</code></pre>
</div>
</div>
</div>
<div class="pre-footer">
<div class="row ionic">
<div class="col-sm-6 col-a">
<h4>
<a href="/getting-started/">Getting started <span class="icon ion-arrow-right-c"></span></a>
</h4>
<p>
Learn more about how Ionic was built, why you should use it, and what's included. We'll cover
the basics and help you get started from the ground up.
</p>
</div>
<div class="col-sm-6 col-b">
<h4>
<a href="/docs/">Documentation <span class="icon ion-arrow-right-c"></span></a>
</h4>
<p>
What are you waiting for? Take a look and get coding! Our documentation covers all you need to know
to get an app up and running in minutes.
</p>
</div>
</div>
</div>
<footer class="footer">
<nav class="base-links">
<dl>
<dt>Docs</dt>
<dd><a href="http://ionicframework.com/docs/">Documentation</a></dd>
<dd><a href="http://ionicframework.com/getting-started/">Getting Started</a></dd>
<dd><a href="http://ionicframework.com/docs/overview/">Overview</a></dd>
<dd><a href="http://ionicframework.com/docs/components/">Components</a></dd>
<dd><a href="http://ionicframework.com/docs/api/">JavaScript</a></dd>
<dd><a href="http://ionicframework.com/submit-issue/">Submit Issue</a></dd>
</dl>
<dl>
<dt>Resources</dt>
<dd><a href="http://learn.ionicframework.com/">Learn Ionic</a></dd>
<dd><a href="http://ngcordova.com/">ngCordova</a></dd>
<dd><a href="http://ionicons.com/">Ionicons</a></dd>
<dd><a href="http://creator.ionic.io/">Creator</a></dd>
<dd><a href="http://showcase.ionicframework.com/">Showcase</a></dd>
<dd><a href="http://manning.com/wilken/?a_aid=ionicinactionben&a_bid=1f0a0e1d">The Ionic Book</a></dd>
</dl>
<dl>
<dt>Contribute</dt>
<dd><a href="http://forum.ionicframework.com/">Community Forum</a></dd>
<dd><a href="http://webchat.freenode.net/?randomnick=1&channels=%23ionic&uio=d4">Ionic IRC</a></dd>
<dd><a href="http://ionicframework.com/present-ionic/">Present Ionic</a></dd>
<dd><a href="http://ionicframework.com/contribute/">Contribute</a></dd>
<dd><a href="https://github.com/driftyco/ionic-learn/issues/new">Write for us</a></dd>
<dd><a href="http://shop.ionic.io/">Ionic Shop</a></dd>
</dl>
<dl class="small-break">
<dt>About</dt>
<dd><a href="http://blog.ionic.io/">Blog</a></dd>
<dd><a href="http://ionic.io">Services</a></dd>
<dd><a href="http://drifty.com">Company</a></dd>
<dd><a href="https://s3.amazonaws.com/ionicframework.com/logo-pack.zip">Logo Pack</a></dd>
<dd><a href="mailto:[email protected]">Contact</a></dd>
<dd><a href="http://ionicframework.com/jobs/">Jobs</a></dd>
</dl>
<dl>
<dt>Connect</dt>
<dd><a href="https://twitter.com/IonicFramework">Twitter</a></dd>
<dd><a href="https://github.com/driftyco/ionic">GitHub</a></dd>
<dd><a href="https://www.facebook.com/ionicframework">Facebook</a></dd>
<dd><a href="https://plus.google.com/b/112280728135675018538/+Ionicframework/posts">Google+</a></dd>
<dd><a href="https://www.youtube.com/channel/UChYheBnVeCfhCmqZfCUdJQw">YouTube</a></dd>
<dd><a href="https://twitter.com/ionitron">Ionitron</a></dd>
</dl>
</nav>
<div class="newsletter row">
<div class="newsletter-container">
<div class="col-sm-7">
<div class="newsletter-text">Stay in the loop</div>
<div class="sign-up">Sign up to receive emails for the latest updates, features, and news on the framework.</div>
</div>
<form action="http://codiqa.createsend.com/t/t/s/jytylh/" method="post" class="input-group col-sm-5">
<input id="fieldEmail" name="cm-jytylh-jytylh" class="form-control" type="email" placeholder="Email" required />
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Subscribe</button>
</span>
</form>
</div>
</div>
<div class="copy">
<div class="copy-container">
<p class="authors">
Code licensed under <a href="/docs/#license">MIT</a>.
Docs under <a href="https://tldrlegal.com/license/apache-license-2.0-(apache-2.0)">Apache 2</a>
<span>|</span>
© 2013-2015 <a href="http://drifty.com/">Drifty Co</a>
</p>
</div>
</div>
</footer>
<script type="text/javascript">
var _sf_async_config = { uid: 54141, domain: 'ionicframework.com', useCanonical: true };
(function() {
function loadChartbeat() {
window._sf_endpt = (new Date()).getTime();
var e = document.createElement('script');
e.setAttribute('language', 'javascript');
e.setAttribute('type', 'text/javascript');
e.setAttribute('src','//static.chartbeat.com/js/chartbeat.js');
document.body.appendChild(e);
};
var oldonload = window.onload;
window.onload = (typeof window.onload != 'function') ?
loadChartbeat : function() { oldonload(); loadChartbeat(); };
})();
</script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
<script src="/js/site.js?1"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/Cookies.js/0.4.0/cookies.min.js"></script>
<script>
$('.navbar .dropdown').on('show.bs.dropdown', function(e){
//$(this).find('.dropdown-menu').addClass('animated fadeInDown');
});
// ADD SLIDEUP ANIMATION TO DROPDOWN //
$('.navbar .dropdown').on('hide.bs.dropdown', function(e){
//$(this).find('.dropdown-menu').first().stop(true, true).slideUp(200);
//$(this).find('.dropdown-menu').removeClass('animated fadeInDown');
});
try {
var d = new Date('2015-03-20 05:00:00 -0500');
var ts = d.getTime();
var cd = Cookies.get('_iondj');
if(cd) {
cd = JSON.parse(atob(cd));
if(parseInt(cd.lp) < ts) {
var bt = document.getElementById('blog-badge');
bt.style.display = 'block';
}
cd.lp = ts;
} else {
var bt = document.getElementById('blog-badge');
bt.style.display = 'block';
cd = {
lp: ts
}
}
Cookies.set('_iondj', btoa(JSON.stringify(cd)));
} catch(e) {
}
</script>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</body>
</html>
| {
"content_hash": "d42339ec7d68df04e95de0ed1c946e52",
"timestamp": "",
"source": "github",
"line_count": 1098,
"max_line_length": 295,
"avg_line_length": 26.299635701275047,
"alnum_prop": 0.5357897288499498,
"repo_name": "philmerrell/ionic-site",
"id": "0f45c3429e6f55b9cecc9e3796c31789fcb24bc4",
"size": "28877",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "_site/docs/nightly/api/directive/keyboardAttach/index.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "3547082"
},
{
"name": "HTML",
"bytes": "49816208"
},
{
"name": "JavaScript",
"bytes": "98020489"
},
{
"name": "Shell",
"bytes": "268"
}
],
"symlink_target": ""
} |
SYNONYM
#### According to
The Catalogue of Life, 3rd January 2011
#### Published in
null
#### Original name
null
### Remarks
null | {
"content_hash": "dac9382ead5c6e6432e0676b03501030",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 39,
"avg_line_length": 10.23076923076923,
"alnum_prop": 0.6917293233082706,
"repo_name": "mdoering/backbone",
"id": "a48d4d13fe05e6951e7bd299d5c323634d68c466",
"size": "197",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malpighiales/Euphorbiaceae/Stillingia/Stillingia sanguinolenta/ Syn. Stillingia sanguinolenta lanceolata/README.md",
"mode": "33188",
"license": "apache-2.0",
"language": [],
"symlink_target": ""
} |
package edu.northwestern.bioinformatics.studycalendar.service.delta;
import edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeNode;
import edu.northwestern.bioinformatics.studycalendar.domain.ScheduledCalendar;
import edu.northwestern.bioinformatics.studycalendar.domain.PlanTreeOrderedInnerNode;
import edu.northwestern.bioinformatics.studycalendar.domain.delta.Reorder;
import edu.northwestern.bioinformatics.studycalendar.domain.delta.Changeable;
import edu.northwestern.bioinformatics.studycalendar.StudyCalendarSystemException;
import java.util.List;
/**
* @author Rhett Sutphin
*/
public class ReorderMutator implements Mutator {
private Reorder reorder;
public ReorderMutator(Reorder reorder) {
this.reorder = reorder;
}
public void apply(Changeable source) {
PlanTreeNode<?> match = removeMatchingChild((PlanTreeNode<?>) source);
((PlanTreeOrderedInnerNode<?, PlanTreeNode<?>>) source).getChildren().add(reorder.getNewIndex(), match);
}
public void revert(Changeable target) {
PlanTreeNode<?> match = removeMatchingChild((PlanTreeNode<?>) target);
((PlanTreeOrderedInnerNode<?, PlanTreeNode<?>>) target).getChildren().add(reorder.getOldIndex(), match);
}
private PlanTreeNode<?> removeMatchingChild(PlanTreeNode<?> source) {
List<PlanTreeNode<?>> children = ((PlanTreeOrderedInnerNode<?, PlanTreeNode<?>>) source).getChildren();
PlanTreeNode<?> match = null;
for (PlanTreeNode<?> child : children) {
if (reorder.isSameChild(child)) {
match = child;
break;
}
}
if (match == null) {
throw new StudyCalendarSystemException(
"The children of %s do not contain a match for the child in %s", source, reorder);
}
children.remove(match);
return match;
}
public boolean appliesToExistingSchedules() {
return false;
}
public void apply(ScheduledCalendar calendar) {
throw new StudyCalendarSystemException("%s cannot be applied to an existing schedule", reorder);
}
}
| {
"content_hash": "16659b6a74ed1faee39df1feb1397c1d",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 112,
"avg_line_length": 36.98275862068966,
"alnum_prop": 0.6965034965034965,
"repo_name": "NCIP/psc",
"id": "08386dd1be14721e759757dc9298c6831524c762",
"size": "2311",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "core/src/main/java/edu/northwestern/bioinformatics/studycalendar/service/delta/ReorderMutator.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Groovy",
"bytes": "169396"
},
{
"name": "Java",
"bytes": "6565287"
},
{
"name": "JavaScript",
"bytes": "809902"
},
{
"name": "Ruby",
"bytes": "381123"
},
{
"name": "Shell",
"bytes": "364"
},
{
"name": "XML",
"bytes": "227992"
}
],
"symlink_target": ""
} |
<?php
namespace Ekyna\Component\Commerce\Bridge\Symfony\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
/**
* Class SupplierOrderItem
* @package Ekyna\Component\Commerce\Bridge\Symfony\Validator\Constraints
* @author Etienne Dauvergne <[email protected]>
*/
class SupplierOrderItem extends Constraint
{
public $quantity_must_be_greater_than_or_equal_received = 'ekyna_commerce.supplier_order_item.quantity_must_be_greater_than_or_equal_received';
/**
* @inheritDoc
*/
public function getTargets()
{
return static::CLASS_CONSTRAINT;
}
}
| {
"content_hash": "6edd904d96a13cdc396d7d5237eb51bf",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 147,
"avg_line_length": 25.125,
"alnum_prop": 0.7330016583747927,
"repo_name": "ekyna/Commerce",
"id": "1e3cc3d439a3b8cff5e919ebc21ef0a3cbf9c144",
"size": "603",
"binary": false,
"copies": "1",
"ref": "refs/heads/0.7",
"path": "Bridge/Symfony/Validator/Constraints/SupplierOrderItem.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "PHP",
"bytes": "3575955"
},
{
"name": "Twig",
"bytes": "20385"
}
],
"symlink_target": ""
} |
package brotli
import "encoding/binary"
/* Function for fast encoding of an input fragment, independently from the input
history. This function uses one-pass processing: when we find a backward
match, we immediately emit the corresponding command and literal codes to
the bit stream.
Adapted from the CompressFragment() function in
https://github.com/google/snappy/blob/master/snappy.cc */
const maxDistance_compress_fragment = 262128
func hash5(p []byte, shift uint) uint32 {
var h uint64 = (binary.LittleEndian.Uint64(p) << 24) * uint64(kHashMul32)
return uint32(h >> shift)
}
func hashBytesAtOffset5(v uint64, offset int, shift uint) uint32 {
assert(offset >= 0)
assert(offset <= 3)
{
var h uint64 = ((v >> uint(8*offset)) << 24) * uint64(kHashMul32)
return uint32(h >> shift)
}
}
func isMatch5(p1 []byte, p2 []byte) bool {
return binary.LittleEndian.Uint32(p1) == binary.LittleEndian.Uint32(p2) &&
p1[4] == p2[4]
}
/* Builds a literal prefix code into "depths" and "bits" based on the statistics
of the "input" string and stores it into the bit stream.
Note that the prefix code here is built from the pre-LZ77 input, therefore
we can only approximate the statistics of the actual literal stream.
Moreover, for long inputs we build a histogram from a sample of the input
and thus have to assign a non-zero depth for each literal.
Returns estimated compression ratio millibytes/char for encoding given input
with generated code. */
func buildAndStoreLiteralPrefixCode(input []byte, input_size uint, depths []byte, bits []uint16, storage_ix *uint, storage []byte) uint {
var histogram = [256]uint32{0}
var histogram_total uint
var i uint
if input_size < 1<<15 {
for i = 0; i < input_size; i++ {
histogram[input[i]]++
}
histogram_total = input_size
for i = 0; i < 256; i++ {
/* We weigh the first 11 samples with weight 3 to account for the
balancing effect of the LZ77 phase on the histogram. */
var adjust uint32 = 2 * brotli_min_uint32_t(histogram[i], 11)
histogram[i] += adjust
histogram_total += uint(adjust)
}
} else {
const kSampleRate uint = 29
for i = 0; i < input_size; i += kSampleRate {
histogram[input[i]]++
}
histogram_total = (input_size + kSampleRate - 1) / kSampleRate
for i = 0; i < 256; i++ {
/* We add 1 to each population count to avoid 0 bit depths (since this is
only a sample and we don't know if the symbol appears or not), and we
weigh the first 11 samples with weight 3 to account for the balancing
effect of the LZ77 phase on the histogram (more frequent symbols are
more likely to be in backward references instead as literals). */
var adjust uint32 = 1 + 2*brotli_min_uint32_t(histogram[i], 11)
histogram[i] += adjust
histogram_total += uint(adjust)
}
}
buildAndStoreHuffmanTreeFast(histogram[:], histogram_total, /* max_bits = */
8, depths, bits, storage_ix, storage)
{
var literal_ratio uint = 0
for i = 0; i < 256; i++ {
if histogram[i] != 0 {
literal_ratio += uint(histogram[i] * uint32(depths[i]))
}
}
/* Estimated encoding ratio, millibytes per symbol. */
return (literal_ratio * 125) / histogram_total
}
}
/* Builds a command and distance prefix code (each 64 symbols) into "depth" and
"bits" based on "histogram" and stores it into the bit stream. */
func buildAndStoreCommandPrefixCode1(histogram []uint32, depth []byte, bits []uint16, storage_ix *uint, storage []byte) {
var tree [129]huffmanTree
var cmd_depth = [numCommandSymbols]byte{0}
/* Tree size for building a tree over 64 symbols is 2 * 64 + 1. */
var cmd_bits [64]uint16
createHuffmanTree(histogram, 64, 15, tree[:], depth)
createHuffmanTree(histogram[64:], 64, 14, tree[:], depth[64:])
/* We have to jump through a few hoops here in order to compute
the command bits because the symbols are in a different order than in
the full alphabet. This looks complicated, but having the symbols
in this order in the command bits saves a few branches in the Emit*
functions. */
copy(cmd_depth[:], depth[:24])
copy(cmd_depth[24:][:], depth[40:][:8])
copy(cmd_depth[32:][:], depth[24:][:8])
copy(cmd_depth[40:][:], depth[48:][:8])
copy(cmd_depth[48:][:], depth[32:][:8])
copy(cmd_depth[56:][:], depth[56:][:8])
convertBitDepthsToSymbols(cmd_depth[:], 64, cmd_bits[:])
copy(bits, cmd_bits[:24])
copy(bits[24:], cmd_bits[32:][:8])
copy(bits[32:], cmd_bits[48:][:8])
copy(bits[40:], cmd_bits[24:][:8])
copy(bits[48:], cmd_bits[40:][:8])
copy(bits[56:], cmd_bits[56:][:8])
convertBitDepthsToSymbols(depth[64:], 64, bits[64:])
{
/* Create the bit length array for the full command alphabet. */
var i uint
for i := 0; i < int(64); i++ {
cmd_depth[i] = 0
} /* only 64 first values were used */
copy(cmd_depth[:], depth[:8])
copy(cmd_depth[64:][:], depth[8:][:8])
copy(cmd_depth[128:][:], depth[16:][:8])
copy(cmd_depth[192:][:], depth[24:][:8])
copy(cmd_depth[384:][:], depth[32:][:8])
for i = 0; i < 8; i++ {
cmd_depth[128+8*i] = depth[40+i]
cmd_depth[256+8*i] = depth[48+i]
cmd_depth[448+8*i] = depth[56+i]
}
storeHuffmanTree(cmd_depth[:], numCommandSymbols, tree[:], storage_ix, storage)
}
storeHuffmanTree(depth[64:], 64, tree[:], storage_ix, storage)
}
/* REQUIRES: insertlen < 6210 */
func emitInsertLen1(insertlen uint, depth []byte, bits []uint16, histo []uint32, storage_ix *uint, storage []byte) {
if insertlen < 6 {
var code uint = insertlen + 40
writeBits(uint(depth[code]), uint64(bits[code]), storage_ix, storage)
histo[code]++
} else if insertlen < 130 {
var tail uint = insertlen - 2
var nbits uint32 = log2FloorNonZero(tail) - 1
var prefix uint = tail >> nbits
var inscode uint = uint((nbits << 1) + uint32(prefix) + 42)
writeBits(uint(depth[inscode]), uint64(bits[inscode]), storage_ix, storage)
writeBits(uint(nbits), uint64(tail)-(uint64(prefix)<<nbits), storage_ix, storage)
histo[inscode]++
} else if insertlen < 2114 {
var tail uint = insertlen - 66
var nbits uint32 = log2FloorNonZero(tail)
var code uint = uint(nbits + 50)
writeBits(uint(depth[code]), uint64(bits[code]), storage_ix, storage)
writeBits(uint(nbits), uint64(tail)-(uint64(uint(1))<<nbits), storage_ix, storage)
histo[code]++
} else {
writeBits(uint(depth[61]), uint64(bits[61]), storage_ix, storage)
writeBits(12, uint64(insertlen)-2114, storage_ix, storage)
histo[61]++
}
}
func emitLongInsertLen(insertlen uint, depth []byte, bits []uint16, histo []uint32, storage_ix *uint, storage []byte) {
if insertlen < 22594 {
writeBits(uint(depth[62]), uint64(bits[62]), storage_ix, storage)
writeBits(14, uint64(insertlen)-6210, storage_ix, storage)
histo[62]++
} else {
writeBits(uint(depth[63]), uint64(bits[63]), storage_ix, storage)
writeBits(24, uint64(insertlen)-22594, storage_ix, storage)
histo[63]++
}
}
func emitCopyLen1(copylen uint, depth []byte, bits []uint16, histo []uint32, storage_ix *uint, storage []byte) {
if copylen < 10 {
writeBits(uint(depth[copylen+14]), uint64(bits[copylen+14]), storage_ix, storage)
histo[copylen+14]++
} else if copylen < 134 {
var tail uint = copylen - 6
var nbits uint32 = log2FloorNonZero(tail) - 1
var prefix uint = tail >> nbits
var code uint = uint((nbits << 1) + uint32(prefix) + 20)
writeBits(uint(depth[code]), uint64(bits[code]), storage_ix, storage)
writeBits(uint(nbits), uint64(tail)-(uint64(prefix)<<nbits), storage_ix, storage)
histo[code]++
} else if copylen < 2118 {
var tail uint = copylen - 70
var nbits uint32 = log2FloorNonZero(tail)
var code uint = uint(nbits + 28)
writeBits(uint(depth[code]), uint64(bits[code]), storage_ix, storage)
writeBits(uint(nbits), uint64(tail)-(uint64(uint(1))<<nbits), storage_ix, storage)
histo[code]++
} else {
writeBits(uint(depth[39]), uint64(bits[39]), storage_ix, storage)
writeBits(24, uint64(copylen)-2118, storage_ix, storage)
histo[39]++
}
}
func emitCopyLenLastDistance1(copylen uint, depth []byte, bits []uint16, histo []uint32, storage_ix *uint, storage []byte) {
if copylen < 12 {
writeBits(uint(depth[copylen-4]), uint64(bits[copylen-4]), storage_ix, storage)
histo[copylen-4]++
} else if copylen < 72 {
var tail uint = copylen - 8
var nbits uint32 = log2FloorNonZero(tail) - 1
var prefix uint = tail >> nbits
var code uint = uint((nbits << 1) + uint32(prefix) + 4)
writeBits(uint(depth[code]), uint64(bits[code]), storage_ix, storage)
writeBits(uint(nbits), uint64(tail)-(uint64(prefix)<<nbits), storage_ix, storage)
histo[code]++
} else if copylen < 136 {
var tail uint = copylen - 8
var code uint = (tail >> 5) + 30
writeBits(uint(depth[code]), uint64(bits[code]), storage_ix, storage)
writeBits(5, uint64(tail)&31, storage_ix, storage)
writeBits(uint(depth[64]), uint64(bits[64]), storage_ix, storage)
histo[code]++
histo[64]++
} else if copylen < 2120 {
var tail uint = copylen - 72
var nbits uint32 = log2FloorNonZero(tail)
var code uint = uint(nbits + 28)
writeBits(uint(depth[code]), uint64(bits[code]), storage_ix, storage)
writeBits(uint(nbits), uint64(tail)-(uint64(uint(1))<<nbits), storage_ix, storage)
writeBits(uint(depth[64]), uint64(bits[64]), storage_ix, storage)
histo[code]++
histo[64]++
} else {
writeBits(uint(depth[39]), uint64(bits[39]), storage_ix, storage)
writeBits(24, uint64(copylen)-2120, storage_ix, storage)
writeBits(uint(depth[64]), uint64(bits[64]), storage_ix, storage)
histo[39]++
histo[64]++
}
}
func emitDistance1(distance uint, depth []byte, bits []uint16, histo []uint32, storage_ix *uint, storage []byte) {
var d uint = distance + 3
var nbits uint32 = log2FloorNonZero(d) - 1
var prefix uint = (d >> nbits) & 1
var offset uint = (2 + prefix) << nbits
var distcode uint = uint(2*(nbits-1) + uint32(prefix) + 80)
writeBits(uint(depth[distcode]), uint64(bits[distcode]), storage_ix, storage)
writeBits(uint(nbits), uint64(d)-uint64(offset), storage_ix, storage)
histo[distcode]++
}
func emitLiterals(input []byte, len uint, depth []byte, bits []uint16, storage_ix *uint, storage []byte) {
var j uint
for j = 0; j < len; j++ {
var lit byte = input[j]
writeBits(uint(depth[lit]), uint64(bits[lit]), storage_ix, storage)
}
}
/* REQUIRES: len <= 1 << 24. */
func storeMetaBlockHeader1(len uint, is_uncompressed bool, storage_ix *uint, storage []byte) {
var nibbles uint = 6
/* ISLAST */
writeBits(1, 0, storage_ix, storage)
if len <= 1<<16 {
nibbles = 4
} else if len <= 1<<20 {
nibbles = 5
}
writeBits(2, uint64(nibbles)-4, storage_ix, storage)
writeBits(nibbles*4, uint64(len)-1, storage_ix, storage)
/* ISUNCOMPRESSED */
writeSingleBit(is_uncompressed, storage_ix, storage)
}
func updateBits(n_bits uint, bits uint32, pos uint, array []byte) {
for n_bits > 0 {
var byte_pos uint = pos >> 3
var n_unchanged_bits uint = pos & 7
var n_changed_bits uint = brotli_min_size_t(n_bits, 8-n_unchanged_bits)
var total_bits uint = n_unchanged_bits + n_changed_bits
var mask uint32 = (^((1 << total_bits) - 1)) | ((1 << n_unchanged_bits) - 1)
var unchanged_bits uint32 = uint32(array[byte_pos]) & mask
var changed_bits uint32 = bits & ((1 << n_changed_bits) - 1)
array[byte_pos] = byte(changed_bits<<n_unchanged_bits | unchanged_bits)
n_bits -= n_changed_bits
bits >>= n_changed_bits
pos += n_changed_bits
}
}
func rewindBitPosition1(new_storage_ix uint, storage_ix *uint, storage []byte) {
var bitpos uint = new_storage_ix & 7
var mask uint = (1 << bitpos) - 1
storage[new_storage_ix>>3] &= byte(mask)
*storage_ix = new_storage_ix
}
var shouldMergeBlock_kSampleRate uint = 43
func shouldMergeBlock(data []byte, len uint, depths []byte) bool {
var histo = [256]uint{0}
var i uint
for i = 0; i < len; i += shouldMergeBlock_kSampleRate {
histo[data[i]]++
}
{
var total uint = (len + shouldMergeBlock_kSampleRate - 1) / shouldMergeBlock_kSampleRate
var r float64 = (fastLog2(total)+0.5)*float64(total) + 200
for i = 0; i < 256; i++ {
r -= float64(histo[i]) * (float64(depths[i]) + fastLog2(histo[i]))
}
return r >= 0.0
}
}
func shouldUseUncompressedMode(metablock_start []byte, next_emit []byte, insertlen uint, literal_ratio uint) bool {
var compressed uint = uint(-cap(next_emit) + cap(metablock_start))
if compressed*50 > insertlen {
return false
} else {
return literal_ratio > 980
}
}
func emitUncompressedMetaBlock1(begin []byte, end []byte, storage_ix_start uint, storage_ix *uint, storage []byte) {
var len uint = uint(-cap(end) + cap(begin))
rewindBitPosition1(storage_ix_start, storage_ix, storage)
storeMetaBlockHeader1(uint(len), true, storage_ix, storage)
*storage_ix = (*storage_ix + 7) &^ 7
copy(storage[*storage_ix>>3:], begin[:len])
*storage_ix += uint(len << 3)
storage[*storage_ix>>3] = 0
}
var kCmdHistoSeed = [128]uint32{
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
}
var compressFragmentFastImpl_kFirstBlockSize uint = 3 << 15
var compressFragmentFastImpl_kMergeBlockSize uint = 1 << 16
func compressFragmentFastImpl(in []byte, input_size uint, is_last bool, table []int, table_bits uint, cmd_depth []byte, cmd_bits []uint16, cmd_code_numbits *uint, cmd_code []byte, storage_ix *uint, storage []byte) {
var cmd_histo [128]uint32
var ip_end int
var next_emit int = 0
var base_ip int = 0
var input int = 0
const kInputMarginBytes uint = windowGap
const kMinMatchLen uint = 5
var metablock_start int = input
var block_size uint = brotli_min_size_t(input_size, compressFragmentFastImpl_kFirstBlockSize)
var total_block_size uint = block_size
var mlen_storage_ix uint = *storage_ix + 3
var lit_depth [256]byte
var lit_bits [256]uint16
var literal_ratio uint
var ip int
var last_distance int
var shift uint = 64 - table_bits
/* "next_emit" is a pointer to the first byte that is not covered by a
previous copy. Bytes between "next_emit" and the start of the next copy or
the end of the input will be emitted as literal bytes. */
/* Save the start of the first block for position and distance computations.
*/
/* Save the bit position of the MLEN field of the meta-block header, so that
we can update it later if we decide to extend this meta-block. */
storeMetaBlockHeader1(block_size, false, storage_ix, storage)
/* No block splits, no contexts. */
writeBits(13, 0, storage_ix, storage)
literal_ratio = buildAndStoreLiteralPrefixCode(in[input:], block_size, lit_depth[:], lit_bits[:], storage_ix, storage)
{
/* Store the pre-compressed command and distance prefix codes. */
var i uint
for i = 0; i+7 < *cmd_code_numbits; i += 8 {
writeBits(8, uint64(cmd_code[i>>3]), storage_ix, storage)
}
}
writeBits(*cmd_code_numbits&7, uint64(cmd_code[*cmd_code_numbits>>3]), storage_ix, storage)
/* Initialize the command and distance histograms. We will gather
statistics of command and distance codes during the processing
of this block and use it to update the command and distance
prefix codes for the next block. */
emit_commands:
copy(cmd_histo[:], kCmdHistoSeed[:])
/* "ip" is the input pointer. */
ip = input
last_distance = -1
ip_end = int(uint(input) + block_size)
if block_size >= kInputMarginBytes {
var len_limit uint = brotli_min_size_t(block_size-kMinMatchLen, input_size-kInputMarginBytes)
var ip_limit int = int(uint(input) + len_limit)
/* For the last block, we need to keep a 16 bytes margin so that we can be
sure that all distances are at most window size - 16.
For all other blocks, we only need to keep a margin of 5 bytes so that
we don't go over the block size with a copy. */
var next_hash uint32
ip++
for next_hash = hash5(in[ip:], shift); ; {
var skip uint32 = 32
var next_ip int = ip
/* Step 1: Scan forward in the input looking for a 5-byte-long match.
If we get close to exhausting the input then goto emit_remainder.
Heuristic match skipping: If 32 bytes are scanned with no matches
found, start looking only at every other byte. If 32 more bytes are
scanned, look at every third byte, etc.. When a match is found,
immediately go back to looking at every byte. This is a small loss
(~5% performance, ~0.1% density) for compressible data due to more
bookkeeping, but for non-compressible data (such as JPEG) it's a huge
win since the compressor quickly "realizes" the data is incompressible
and doesn't bother looking for matches everywhere.
The "skip" variable keeps track of how many bytes there are since the
last match; dividing it by 32 (i.e. right-shifting by five) gives the
number of bytes to move ahead for each iteration. */
var candidate int
assert(next_emit < ip)
trawl:
for {
var hash uint32 = next_hash
var bytes_between_hash_lookups uint32 = skip >> 5
skip++
assert(hash == hash5(in[next_ip:], shift))
ip = next_ip
next_ip = int(uint32(ip) + bytes_between_hash_lookups)
if next_ip > ip_limit {
goto emit_remainder
}
next_hash = hash5(in[next_ip:], shift)
candidate = ip - last_distance
if isMatch5(in[ip:], in[candidate:]) {
if candidate < ip {
table[hash] = int(ip - base_ip)
break
}
}
candidate = base_ip + table[hash]
assert(candidate >= base_ip)
assert(candidate < ip)
table[hash] = int(ip - base_ip)
if !(!isMatch5(in[ip:], in[candidate:])) {
break
}
}
/* Check copy distance. If candidate is not feasible, continue search.
Checking is done outside of hot loop to reduce overhead. */
if ip-candidate > maxDistance_compress_fragment {
goto trawl
}
/* Step 2: Emit the found match together with the literal bytes from
"next_emit" to the bit stream, and then see if we can find a next match
immediately afterwards. Repeat until we find no match for the input
without emitting some literal bytes. */
{
var base int = ip
/* > 0 */
var matched uint = 5 + findMatchLengthWithLimit(in[candidate+5:], in[ip+5:], uint(ip_end-ip)-5)
var distance int = int(base - candidate)
/* We have a 5-byte match at ip, and we need to emit bytes in
[next_emit, ip). */
var insert uint = uint(base - next_emit)
ip += int(matched)
if insert < 6210 {
emitInsertLen1(insert, cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
} else if shouldUseUncompressedMode(in[metablock_start:], in[next_emit:], insert, literal_ratio) {
emitUncompressedMetaBlock1(in[metablock_start:], in[base:], mlen_storage_ix-3, storage_ix, storage)
input_size -= uint(base - input)
input = base
next_emit = input
goto next_block
} else {
emitLongInsertLen(insert, cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
}
emitLiterals(in[next_emit:], insert, lit_depth[:], lit_bits[:], storage_ix, storage)
if distance == last_distance {
writeBits(uint(cmd_depth[64]), uint64(cmd_bits[64]), storage_ix, storage)
cmd_histo[64]++
} else {
emitDistance1(uint(distance), cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
last_distance = distance
}
emitCopyLenLastDistance1(matched, cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
next_emit = ip
if ip >= ip_limit {
goto emit_remainder
}
/* We could immediately start working at ip now, but to improve
compression we first update "table" with the hashes of some positions
within the last copy. */
{
var input_bytes uint64 = binary.LittleEndian.Uint64(in[ip-3:])
var prev_hash uint32 = hashBytesAtOffset5(input_bytes, 0, shift)
var cur_hash uint32 = hashBytesAtOffset5(input_bytes, 3, shift)
table[prev_hash] = int(ip - base_ip - 3)
prev_hash = hashBytesAtOffset5(input_bytes, 1, shift)
table[prev_hash] = int(ip - base_ip - 2)
prev_hash = hashBytesAtOffset5(input_bytes, 2, shift)
table[prev_hash] = int(ip - base_ip - 1)
candidate = base_ip + table[cur_hash]
table[cur_hash] = int(ip - base_ip)
}
}
for isMatch5(in[ip:], in[candidate:]) {
var base int = ip
/* We have a 5-byte match at ip, and no need to emit any literal bytes
prior to ip. */
var matched uint = 5 + findMatchLengthWithLimit(in[candidate+5:], in[ip+5:], uint(ip_end-ip)-5)
if ip-candidate > maxDistance_compress_fragment {
break
}
ip += int(matched)
last_distance = int(base - candidate) /* > 0 */
emitCopyLen1(matched, cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
emitDistance1(uint(last_distance), cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
next_emit = ip
if ip >= ip_limit {
goto emit_remainder
}
/* We could immediately start working at ip now, but to improve
compression we first update "table" with the hashes of some positions
within the last copy. */
{
var input_bytes uint64 = binary.LittleEndian.Uint64(in[ip-3:])
var prev_hash uint32 = hashBytesAtOffset5(input_bytes, 0, shift)
var cur_hash uint32 = hashBytesAtOffset5(input_bytes, 3, shift)
table[prev_hash] = int(ip - base_ip - 3)
prev_hash = hashBytesAtOffset5(input_bytes, 1, shift)
table[prev_hash] = int(ip - base_ip - 2)
prev_hash = hashBytesAtOffset5(input_bytes, 2, shift)
table[prev_hash] = int(ip - base_ip - 1)
candidate = base_ip + table[cur_hash]
table[cur_hash] = int(ip - base_ip)
}
}
ip++
next_hash = hash5(in[ip:], shift)
}
}
emit_remainder:
assert(next_emit <= ip_end)
input += int(block_size)
input_size -= block_size
block_size = brotli_min_size_t(input_size, compressFragmentFastImpl_kMergeBlockSize)
/* Decide if we want to continue this meta-block instead of emitting the
last insert-only command. */
if input_size > 0 && total_block_size+block_size <= 1<<20 && shouldMergeBlock(in[input:], block_size, lit_depth[:]) {
assert(total_block_size > 1<<16)
/* Update the size of the current meta-block and continue emitting commands.
We can do this because the current size and the new size both have 5
nibbles. */
total_block_size += block_size
updateBits(20, uint32(total_block_size-1), mlen_storage_ix, storage)
goto emit_commands
}
/* Emit the remaining bytes as literals. */
if next_emit < ip_end {
var insert uint = uint(ip_end - next_emit)
if insert < 6210 {
emitInsertLen1(insert, cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
emitLiterals(in[next_emit:], insert, lit_depth[:], lit_bits[:], storage_ix, storage)
} else if shouldUseUncompressedMode(in[metablock_start:], in[next_emit:], insert, literal_ratio) {
emitUncompressedMetaBlock1(in[metablock_start:], in[ip_end:], mlen_storage_ix-3, storage_ix, storage)
} else {
emitLongInsertLen(insert, cmd_depth, cmd_bits, cmd_histo[:], storage_ix, storage)
emitLiterals(in[next_emit:], insert, lit_depth[:], lit_bits[:], storage_ix, storage)
}
}
next_emit = ip_end
/* If we have more data, write a new meta-block header and prefix codes and
then continue emitting commands. */
next_block:
if input_size > 0 {
metablock_start = input
block_size = brotli_min_size_t(input_size, compressFragmentFastImpl_kFirstBlockSize)
total_block_size = block_size
/* Save the bit position of the MLEN field of the meta-block header, so that
we can update it later if we decide to extend this meta-block. */
mlen_storage_ix = *storage_ix + 3
storeMetaBlockHeader1(block_size, false, storage_ix, storage)
/* No block splits, no contexts. */
writeBits(13, 0, storage_ix, storage)
literal_ratio = buildAndStoreLiteralPrefixCode(in[input:], block_size, lit_depth[:], lit_bits[:], storage_ix, storage)
buildAndStoreCommandPrefixCode1(cmd_histo[:], cmd_depth, cmd_bits, storage_ix, storage)
goto emit_commands
}
if !is_last {
/* If this is not the last block, update the command and distance prefix
codes for the next block and store the compressed forms. */
cmd_code[0] = 0
*cmd_code_numbits = 0
buildAndStoreCommandPrefixCode1(cmd_histo[:], cmd_depth, cmd_bits, cmd_code_numbits, cmd_code)
}
}
/* Compresses "input" string to the "*storage" buffer as one or more complete
meta-blocks, and updates the "*storage_ix" bit position.
If "is_last" is 1, emits an additional empty last meta-block.
"cmd_depth" and "cmd_bits" contain the command and distance prefix codes
(see comment in encode.h) used for the encoding of this input fragment.
If "is_last" is 0, they are updated to reflect the statistics
of this input fragment, to be used for the encoding of the next fragment.
"*cmd_code_numbits" is the number of bits of the compressed representation
of the command and distance prefix codes, and "cmd_code" is an array of
at least "(*cmd_code_numbits + 7) >> 3" size that contains the compressed
command and distance prefix codes. If "is_last" is 0, these are also
updated to represent the updated "cmd_depth" and "cmd_bits".
REQUIRES: "input_size" is greater than zero, or "is_last" is 1.
REQUIRES: "input_size" is less or equal to maximal metablock size (1 << 24).
REQUIRES: All elements in "table[0..table_size-1]" are initialized to zero.
REQUIRES: "table_size" is an odd (9, 11, 13, 15) power of two
OUTPUT: maximal copy distance <= |input_size|
OUTPUT: maximal copy distance <= BROTLI_MAX_BACKWARD_LIMIT(18) */
func compressFragmentFast(input []byte, input_size uint, is_last bool, table []int, table_size uint, cmd_depth []byte, cmd_bits []uint16, cmd_code_numbits *uint, cmd_code []byte, storage_ix *uint, storage []byte) {
var initial_storage_ix uint = *storage_ix
var table_bits uint = uint(log2FloorNonZero(table_size))
if input_size == 0 {
assert(is_last)
writeBits(1, 1, storage_ix, storage) /* islast */
writeBits(1, 1, storage_ix, storage) /* isempty */
*storage_ix = (*storage_ix + 7) &^ 7
return
}
compressFragmentFastImpl(input, input_size, is_last, table, table_bits, cmd_depth, cmd_bits, cmd_code_numbits, cmd_code, storage_ix, storage)
/* If output is larger than single uncompressed block, rewrite it. */
if *storage_ix-initial_storage_ix > 31+(input_size<<3) {
emitUncompressedMetaBlock1(input, input[input_size:], initial_storage_ix, storage_ix, storage)
}
if is_last {
writeBits(1, 1, storage_ix, storage) /* islast */
writeBits(1, 1, storage_ix, storage) /* isempty */
*storage_ix = (*storage_ix + 7) &^ 7
}
}
| {
"content_hash": "8826efeabd7552f5851cdb1dffe69ad2",
"timestamp": "",
"source": "github",
"line_count": 830,
"max_line_length": 215,
"avg_line_length": 32.50963855421687,
"alnum_prop": 0.6698662120594449,
"repo_name": "valyala/quicktemplate",
"id": "2fc2df139b7d72c4dc3b463ae6a9dca8b1b02efe",
"size": "27149",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "vendor/github.com/andybalholm/brotli/compress_fragment.go",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Go",
"bytes": "106263"
}
],
"symlink_target": ""
} |
Components for loading animations for various scenarios within your application.
- `<Loading>` a basic, standalone loading spinner
- `<LoadingPane>` a Pane with a loading spinner. For use within existing `<Paneset>`s. Accepts the props of `<Pane>`.
- `<LoadingView>` for fullscreen views. Accepts the props of `<Pane>` and includes a wrapping `<Paneset>`. | {
"content_hash": "5f674b2c79427ddc2f7fc9fdaef5c058",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 117,
"avg_line_length": 71.2,
"alnum_prop": 0.7528089887640449,
"repo_name": "folio-org/stripes-components",
"id": "d20cd4c1b63360b41a804913543e2d26069f3616",
"size": "378",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "lib/Loading/readme.md",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "105251"
},
{
"name": "HTML",
"bytes": "287"
},
{
"name": "JavaScript",
"bytes": "1302811"
}
],
"symlink_target": ""
} |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>has_trivial_destructor</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
<link rel="home" href="../../index.html" title="Chapter 1. Boost.TypeTraits">
<link rel="up" href="../reference.html" title="Alphabetical Reference">
<link rel="prev" href="has_trivial_def_cons.html" title="has_trivial_default_constructor">
<link rel="next" href="has_trivial_move_assign.html" title="has_trivial_move_assign">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="has_trivial_def_cons.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_trivial_move_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="boost_typetraits.reference.has_trivial_destructor"></a><a class="link" href="has_trivial_destructor.html" title="has_trivial_destructor">has_trivial_destructor</a>
</h3></div></div></div>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">has_trivial_destructor</span> <span class="special">:</span> <span class="keyword">public</span> <em class="replaceable"><code><a class="link" href="integral_constant.html" title="integral_constant">true_type</a>-or-<a class="link" href="integral_constant.html" title="integral_constant">false_type</a></code></em> <span class="special">{};</span>
</pre>
<p>
<span class="bold"><strong>Inherits:</strong></span> If T is a (possibly cv-qualified)
type with a trivial destructor then inherits from <a class="link" href="integral_constant.html" title="integral_constant">true_type</a>,
otherwise inherits from <a class="link" href="integral_constant.html" title="integral_constant">false_type</a>.
</p>
<p>
If a type has a trivial destructor then the destructor has no effect: calls
to the destructor can be safely omitted. Note that using meta-programming
to omit a call to a single trivial-constructor call is of no benefit whatsoever.
However, if loops and/or exception handling code can also be omitted, then
some benefit in terms of code size and speed can be obtained.
</p>
<p>
<span class="bold"><strong>Compiler Compatibility:</strong></span> Without some (as
yet unspecified) help from the compiler, has_trivial_destructor will never
report that a user-defined class or struct has a trivial destructor; this
is always safe, if possibly sub-optimal. In addition, in order to correctly
handle deleted or private destructors then support for C++11's <code class="computeroutput"><span class="keyword">decltype</span></code> is required. Currently (June 2015)
compilers more recent than Visual C++ 8, GCC-4.3, Greenhills 6.0, Intel-11.0,
and Codegear have the necessary compiler <a class="link" href="../intrinsics.html" title="Support for Compiler Intrinsics">intrinsics</a>
to ensure that this trait "just works". You may also test to see
if the necessary <a class="link" href="../intrinsics.html" title="Support for Compiler Intrinsics">intrinsics</a>
are available by checking to see if the macro <code class="computeroutput"><span class="identifier">BOOST_HAS_TRIVIAL_DESTRUCTOR</span></code>
is defined.
</p>
<p>
<span class="bold"><strong>C++ Standard Reference:</strong></span> 12.4p3.
</p>
<p>
<span class="bold"><strong>Header:</strong></span> <code class="computeroutput"> <span class="preprocessor">#include</span>
<span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">/</span><span class="identifier">has_trivial_destructor</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
or <code class="computeroutput"> <span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">type_traits</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
</p>
<p>
<span class="bold"><strong>Examples:</strong></span>
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<code class="computeroutput"><span class="identifier">has_trivial_destructor</span><span class="special"><</span><span class="keyword">int</span><span class="special">></span></code> inherits from <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<code class="computeroutput"><span class="identifier">has_trivial_destructor</span><span class="special"><</span><span class="keyword">char</span><span class="special">*>::</span><span class="identifier">type</span></code>
is the type <code class="computeroutput"><a class="link" href="integral_constant.html" title="integral_constant">true_type</a></code>.
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<code class="computeroutput"><span class="identifier">has_trivial_destructor</span><span class="special"><</span><span class="keyword">int</span> <span class="special">(*)(</span><span class="keyword">long</span><span class="special">)>::</span><span class="identifier">value</span></code>
is an integral constant expression that evaluates to <span class="emphasis"><em>true</em></span>.
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<code class="computeroutput"><span class="identifier">has_trivial_destructor</span><span class="special"><</span><span class="identifier">MyClass</span><span class="special">>::</span><span class="identifier">value</span></code>
is an integral constant expression that evaluates to <span class="emphasis"><em>false</em></span>.
</p></blockquote></div>
<div class="blockquote"><blockquote class="blockquote"><p>
<code class="computeroutput"><span class="identifier">has_trivial_destructor</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">value_type</span></code>
is the type <code class="computeroutput"><span class="keyword">bool</span></code>.
</p></blockquote></div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2000, 2011 Adobe Systems Inc, David Abrahams,
Frederic Bron, Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant,
Jesse Jones, Mat Marcus, Itay Maman, John Maddock, Alexander Nasonov, Thorsten
Ottosen, Roman Perepelitsa, Robert Ramey, Jeremy Siek, Robert Stewart and Steven
Watanabe<p>
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="has_trivial_def_cons.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../reference.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="has_trivial_move_assign.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
| {
"content_hash": "998dfd48b94dd7de5d4b67018c84c871",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 454,
"avg_line_length": 87.96190476190476,
"alnum_prop": 0.6612169770463404,
"repo_name": "zjutjsj1004/third",
"id": "afcadaad1d68700e48fe1cf7307e5d72b5a84e2b",
"size": "9236",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "boost/libs/type_traits/doc/html/boost_typetraits/reference/has_trivial_destructor.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Assembly",
"bytes": "224158"
},
{
"name": "Batchfile",
"bytes": "33175"
},
{
"name": "C",
"bytes": "5576593"
},
{
"name": "C#",
"bytes": "41850"
},
{
"name": "C++",
"bytes": "179595990"
},
{
"name": "CMake",
"bytes": "28348"
},
{
"name": "CSS",
"bytes": "331303"
},
{
"name": "Cuda",
"bytes": "26521"
},
{
"name": "FORTRAN",
"bytes": "1856"
},
{
"name": "Groff",
"bytes": "1305458"
},
{
"name": "HTML",
"bytes": "159660377"
},
{
"name": "IDL",
"bytes": "15"
},
{
"name": "JavaScript",
"bytes": "285786"
},
{
"name": "Lex",
"bytes": "1290"
},
{
"name": "Makefile",
"bytes": "1202020"
},
{
"name": "Max",
"bytes": "37424"
},
{
"name": "Objective-C",
"bytes": "3674"
},
{
"name": "Objective-C++",
"bytes": "651"
},
{
"name": "PHP",
"bytes": "60249"
},
{
"name": "Perl",
"bytes": "37297"
},
{
"name": "Perl6",
"bytes": "2130"
},
{
"name": "Python",
"bytes": "1833677"
},
{
"name": "QML",
"bytes": "613"
},
{
"name": "QMake",
"bytes": "17385"
},
{
"name": "Rebol",
"bytes": "372"
},
{
"name": "Shell",
"bytes": "1144162"
},
{
"name": "Tcl",
"bytes": "1205"
},
{
"name": "TeX",
"bytes": "38313"
},
{
"name": "XSLT",
"bytes": "564356"
},
{
"name": "Yacc",
"bytes": "20341"
}
],
"symlink_target": ""
} |
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"knative.dev/pkg/apis"
"knative.dev/pkg/kmeta"
v1 "knative.dev/serving/pkg/apis/serving/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// Revision is an immutable snapshot of code and configuration. A revision
// references a container image. Revisions are created by updates to a
// Configuration.
//
// See also: https://github.com/knative/serving/blob/master/docs/spec/overview.md#revision
type Revision struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty"`
// +optional
Spec v1.RevisionSpec `json:"spec,omitempty"`
// +optional
Status v1.RevisionStatus `json:"status,omitempty"`
}
// Verify that Revision adheres to the appropriate interfaces.
var (
// Check that Revision can be validated, can be defaulted, and has immutable fields.
_ apis.Validatable = (*Revision)(nil)
_ apis.Defaultable = (*Revision)(nil)
// Check that Revision can be converted to higher versions.
_ apis.Convertible = (*Revision)(nil)
// Check that we can create OwnerReferences to a Revision.
_ kmeta.OwnerRefable = (*Revision)(nil)
)
const (
// RevisionConditionReady is set when the revision is starting to materialize
// runtime resources, and becomes true when those resources are ready.
RevisionConditionReady = apis.ConditionReady
)
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// RevisionList is a list of Revision resources
type RevisionList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []Revision `json:"items"`
}
| {
"content_hash": "e2b85dced1db520462255fa3411b7236",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 90,
"avg_line_length": 28.23728813559322,
"alnum_prop": 0.7472989195678271,
"repo_name": "knative/client-contrib",
"id": "fcaa9fbf47e0dd885c037a8f10de3672793faec4",
"size": "2232",
"binary": false,
"copies": "5",
"ref": "refs/heads/main",
"path": "plugins/admin/vendor/knative.dev/serving/pkg/apis/serving/v1beta1/revision_types.go",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Go",
"bytes": "212717"
},
{
"name": "Shell",
"bytes": "166202"
}
],
"symlink_target": ""
} |
//
// UpdateViewController.m
// AddressBook
//
// Created by scjy on 15/12/20.
// Copyright © 2015年 张鹏飞. All rights reserved.
//
#import "UpdateViewController.h"
@interface UpdateViewController ()
{
NSString *i ;
}
@property(nonatomic, retain) UIImageView *imageview;
@property(nonatomic, retain) NSString *imageName;
@property(nonatomic, retain) UITextField *textfiel;
@end
@implementation UpdateViewController
- (void)viewDidLoad {
[super viewDidLoad];
//--------------------2.注册界面--------------------
//UITextField编写文字
UILabel *name = [[UILabel alloc]initWithFrame:CGRectMake(30, 50, 200, 100)];
name.text = @"姓名:";
name.font = [UIFont systemFontOfSize:18];
UILabel *password = [[UILabel alloc]initWithFrame:CGRectMake(30, 110, 200, 100)];
password.text = @"性别:";
password.font = [UIFont systemFontOfSize:18];
UILabel *confirmPassword = [[UILabel alloc]initWithFrame:CGRectMake(30, 170, 200, 100)];
confirmPassword.text = @"年龄:";
confirmPassword.font = [UIFont systemFontOfSize:18];
UILabel *phoneNumber = [[UILabel alloc]initWithFrame:CGRectMake(30, 230, 200, 100)];
phoneNumber.text = @"手机号:";
phoneNumber.font = [UIFont systemFontOfSize:18];
UILabel *email = [[UILabel alloc]initWithFrame:CGRectMake(30, 280, 200, 100)];
email.text = @"备注:";
email.font = [UIFont systemFontOfSize:18];
[self.view addSubview:name];
[self.view addSubview:password];
[self.view addSubview:confirmPassword];
[self.view addSubview:phoneNumber];
[self.view addSubview:email];
//文本框
self.nameKuang = [[UITextField alloc]initWithFrame:CGRectMake(130, 80, 200, 30 )];
self.nameKuang.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.8];
//文本框样式
self.nameKuang.borderStyle = UITextBorderStyleRoundedRect;
//占用符
self.nameKuang.placeholder = @"请输入姓名";
self.nameKuang.keyboardType= UIKeyboardTypeWebSearch;
self.genderKuang = [[UITextField alloc]initWithFrame:CGRectMake(130, 140, 200, 30)];
self.genderKuang.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.8];
self.genderKuang.borderStyle = UITextBorderStyleRoundedRect;
//占用符
self.genderKuang.placeholder = @"请输入性别";
self.agePassKuang = [[UITextField alloc]initWithFrame:CGRectMake(130, 200, 200, 30)];
self.agePassKuang.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.8];
self.agePassKuang.borderStyle = UITextBorderStyleRoundedRect;
//占用符
self.agePassKuang.placeholder = @"请输入年龄";
self.phoneNumKuang = [[UITextField alloc]initWithFrame:CGRectMake(130, 260, 200, 30)];
self.phoneNumKuang.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.8];
self.phoneNumKuang.borderStyle = UITextBorderStyleRoundedRect;
//占用符
self.phoneNumKuang.placeholder = @"请输入联系方式";
self.remarksKuang = [[UITextField alloc]initWithFrame:CGRectMake(130, 320, 200, 30)];
self.remarksKuang.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:0.8];
self.remarksKuang.borderStyle = UITextBorderStyleRoundedRect;
//占用符
self.remarksKuang.placeholder = @"请输入备注";
self.nameKuang.delegate = self;
self.genderKuang.delegate = self;
self.agePassKuang.delegate = self;
self.phoneNumKuang.delegate = self;
self.remarksKuang.delegate = self;
[self.view addSubview:self.remarksKuang];
[self.view addSubview:self.phoneNumKuang];
[self.view addSubview:self.agePassKuang];
[self.view addSubview:self.genderKuang];
[self.view addSubview:self.nameKuang];
self.imageview=[[UIImageView alloc]initWithFrame:CGRectMake(150, 380,100, 100)];
self.imageview.userInteractionEnabled=YES;
self.imageview.layer.cornerRadius=100/2;
self.imageview.clipsToBounds=YES;
UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(openImage)];
[self.imageview addGestureRecognizer:tap];
self.imageview.backgroundColor=[UIColor redColor];
[self.view addSubview:self.imageview];
self.textfiel=[[UITextField alloc]initWithFrame:CGRectMake(30, 600, 100, 44)];
self.textfiel.borderStyle=UITextBorderStyleRoundedRect;
self.textfiel.placeholder=@"请输入";
[self.view addSubview:self.textfiel];
UIButton *resgisZhu = [UIButton buttonWithType:UIButtonTypeCustom];
resgisZhu.frame = CGRectMake(90, 500, 50, 50);
[resgisZhu setTitle:@"保存" forState:UIControlStateNormal];
[resgisZhu setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
//点击注册 注册成功
[resgisZhu addTarget:self action:@selector(registerSucceedWay) forControlEvents:UIControlEventTouchUpInside];
UIButton *cancelXiao = [UIButton buttonWithType:UIButtonTypeCustom];
cancelXiao.frame = CGRectMake(260, 500, 50, 50);
[cancelXiao setTitle:@"取消" forState:UIControlStateNormal];
[cancelXiao setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
//点击取消按钮 触发canselWay事件
[cancelXiao addTarget:self action:@selector(canselWay) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:cancelXiao];
[self.view addSubview:resgisZhu];
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self.nameKuang resignFirstResponder];
[self.genderKuang resignFirstResponder];
[self.agePassKuang resignFirstResponder];
[self.phoneNumKuang resignFirstResponder];
[self.remarksKuang resignFirstResponder];
}
-(void)openCamere{
if ([UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront])
{
UIImagePickerController *pick=[[UIImagePickerController alloc]init];
pick.cameraDevice=UIImagePickerControllerCameraDeviceFront;
}
}
-(void)openImage{
UIImagePickerController *pickerImage = [[UIImagePickerController alloc] init];
if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
//pickerImage.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
pickerImage.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
pickerImage.mediaTypes = [UIImagePickerController availableMediaTypesForSourceType:pickerImage.sourceType];
}
pickerImage.delegate = self;
pickerImage.allowsEditing =YES;
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary<NSString *,id> *)editingInfo{
self.imageview.image=image;
NSData *data = UIImageJPEGRepresentation(image, 0.5);
NSString *imagepath = [NSString stringWithFormat:@"%@/%@%@.png",[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject],@"head",self.textfiel.text];
[data writeToFile:imagepath atomically:YES];
// NSString *imagePath = [NSString stringWithFormat:@"%@/%@.png",,];
NSLog(@"image = %@", [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]);
//文件路径
// self.imageName=[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
//
NSLog(@"%@",[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]);
self.imageName=imagepath;
[picker dismissViewControllerAnimated:YES completion:nil];
}
//键盘回收
-(BOOL)textFieldShouldReturn:(UITextField *)textField{
[self.nameKuang resignFirstResponder];
[self.genderKuang resignFirstResponder];
[self.agePassKuang resignFirstResponder];
[self.phoneNumKuang resignFirstResponder];
[self.remarksKuang resignFirstResponder];
return YES;
}
-(void)registerSucceedWay{
[self.delegate getTextName:self.nameKuang.text andGender:self.genderKuang.text andAge:self.agePassKuang.text andTel:self.phoneNumKuang.text andHobby:self.remarksKuang.text andimageName:self.imageName];
[self.navigationController popViewControllerAnimated:YES];
}
-(void)canselWay{
NSLog(@"没有保存");
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
| {
"content_hash": "f306f29be82e0cc498dc72dda7c25bb3",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 205,
"avg_line_length": 30.82006920415225,
"alnum_prop": 0.7082070281800831,
"repo_name": "788zhang/Music",
"id": "d3c980903d4870596e464bd2bac39076d9f98b6a",
"size": "9128",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "第十二讲 通讯录副本/AddressBook副本/UpdateViewController.m",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Objective-C",
"bytes": "2051895"
},
{
"name": "Ruby",
"bytes": "107"
},
{
"name": "Shell",
"bytes": "15906"
}
],
"symlink_target": ""
} |
var Tracker = (function () {
function Tracker() {
this.accelerate = 1;
this._animations = [];
}
Tracker.prototype.playDatas = function () {
/// <signature>
/// <summary>Get the datas from the workbook sheet and plays them in the 3D BabylonJS scene</summary>
/// </signature>
var _this = this;
// Check if TableBinding already exists
if (!this._tableBinding) {
return;
}
var dateMin = undefined;
var dateMax = undefined;
var gapSec = undefined;
// Get datas
this._tableBinding.getDataAsync({
// Options : We can get filtered or not datas
filterType: Office.FilterType.OnlyVisible,
// Options : To be able to work with those datas, no format will help, later
valueFormat: Office.ValueFormat.Unformatted
}, function (result) {
if (result.status === "succeeded") {
// Rows !
var rows = result.value.rows;
// Get Min and max
var delta = utils.getMinMax(rows, 4);
// Get timestamp interval
if (delta != undefined && delta.min != undefined && delta.max != undefined) {
dateMin = utils.fromOaDate(delta.min);
dateMax = utils.fromOaDate(delta.max);
gapSec = utils.substract(dateMax, dateMin, "s");
}
// grouping list
var lstGrp = utils.groupBy(rows, function (item) {
return [item[0]];
});
// Create the animations tab
_this._animations = [];
// each group
for (var i = 0; i < lstGrp.length; i++) {
var sphTab = lstGrp[i];
// Every sphere must have a uniquename
var sphereName = "d_" + sphTab[0][0] + "sphere";
// Create the sphere
var sphere = BABYLON.Mesh.CreateSphere(sphereName + "_sphere", 8, 4, _this.scene);
// Create a yellow texture
var m = new BABYLON.StandardMaterial("texture2", _this.scene);
m.diffuseColor = new BABYLON.Color3(1, 1, 0); // yellow
sphere.material = m;
sphere.isPickable = true;
// Create an animation path
var animationPath = new BABYLON.Animation(sphereName + "_animation", "position", (30 * _this.accelerate), BABYLON.Animation.ANIMATIONTYPE_VECTOR3, BABYLON.Animation.ANIMATIONLOOPMODE_CYCLE);
_this._animations.push(animationPath);
// Create all the frames for each sphere
var keys = [];
var maxFrame = 0;
// in each group, each pos
for (var j = 0; j < sphTab.length; j++) {
var currentFrame;
var posData = sphTab[j];
var posX = +posData[1];
var posY = +posData[2];
var posZ = +posData[3];
var date = utils.fromOaDate(posData[4]);
// if there is no date, the coefficient is the number of action (One per sec)
// otherwise it's the delta time
var coef = j;
currentFrame = coef * 30;
var pos = new BABYLON.Vector3(posX, posY, posZ);
maxFrame = Math.max(maxFrame, currentFrame);
keys.push({ frame: currentFrame, value: pos });
}
animationPath.setKeys(keys);
sphere.animations.push(animationPath);
// Launch the animation for this sphere
_this.scene.beginAnimation(sphere, 0, maxFrame, true);
}
}
else {
throw new Error(result.error.message);
}
});
};
Tracker.prototype._setTableBinding = function () {
/// <signature>
/// <summary>Create a binding to later gate the datas</summary>
/// </signature>
var _this = this;
Office.context.document.bindings.addFromNamedItemAsync("Sheet1!Table1", Office.BindingType.Table, { id: "positions" }, function (asyncResult) {
if (asyncResult.status === "failed") {
console.log("Error: " + asyncResult.error.message);
}
else {
try {
_this._tableBinding = asyncResult.value;
}
catch (e) {
console.log(e);
}
}
});
};
Tracker.prototype._setFreeCameraPosition = function () {
/// <signature>
/// <summary>Starting position of the free camera</summary>
/// </signature>
this._freeCamera.position.x = 135;
this._freeCamera.position.y = 45;
this._freeCamera.position.z = -18;
this._freeCamera.rotation.x = 0.55;
this._freeCamera.rotation.y = 5;
this._freeCamera.rotation.z = 0;
// Vertical freeCamera debug style
// Useful for having a better view on the scene
//this.freeCamera.position.x = 56.7;
//this.freeCamera.position.y = 73.05;
//this.freeCamera.position.z = -3.5;
//this.freeCamera.rotation.x = 1.49;
//this.freeCamera.rotation.y = 4.67;
//this.freeCamera.rotation.z = 0;
};
Tracker.prototype._createScene = function () {
/// <signature>
/// <summary>Creating the scene (see BabylonJS documentation) </summary>
/// </signature>
var _this = this;
this.scene = new BABYLON.Scene(this.engine);
this._freeCamera = new BABYLON.FreeCamera("FreeCamera", new BABYLON.Vector3(0, 0, 5), this.scene);
this._freeCamera.rotation = new BABYLON.Vector3(0, Math.PI, 0);
this.scene.activeCamera = this._freeCamera;
this._freeCamera.attachControl(this.canvas, true);
var light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 1, 0), this.scene);
// Resizing the add in
window.addEventListener("resize", function () { _this.engine.resize(); });
// The first parameter can be used to specify which mesh to import. Here we import all meshes
BABYLON.SceneLoader.ImportMesh("", "/Assets/", "Welcome.babylon", this.scene, function (newMeshes) {
// Remove some undesired assets
var mesh = _this.scene.getMeshByName("Cube Rouge");
var indexMesh = _this.scene.meshes.indexOf(mesh);
if (indexMesh > -1)
_this.scene.meshes.splice(indexMesh, 1);
mesh = _this.scene.getMeshByName("Cube Bleu");
indexMesh = _this.scene.meshes.indexOf(mesh);
if (indexMesh > -1)
_this.scene.meshes.splice(indexMesh, 1);
// position Camera
_this._setFreeCameraPosition();
//bind to existing datas
_this._setTableBinding();
});
return this.scene;
};
Tracker.prototype.launchScene = function () {
/// <signature>
/// <summary>Launch the scene </summary>
/// </signature>
var _this = this;
try {
// Check if BabylonJS is supported
if (!BABYLON.Engine.isSupported()) {
return;
}
if (this.engine) {
this.engine.dispose();
this.engine = null;
}
this.canvas = document.getElementById("renderCanvas");
this.engine = new BABYLON.Engine(this.canvas, true);
this.scene = this._createScene();
// Here we go ! RENDERING BABY !
this.engine.runRenderLoop(function () {
_this.scene.render();
});
}
catch (e) {
console.log(e.message);
}
};
Tracker.prototype.resetDatas = function () {
/// <signature>
/// <summary>Stop the scene and reset all positions</summary>
/// </signature>
var lst = [];
var i;
var mesh;
for (i = 0; i < this.scene.meshes.length; i++) {
mesh = this.scene.meshes[i];
if (mesh.name.indexOf("d_") === 0) {
lst.push(mesh.name);
}
}
if (lst.length === 0)
return;
for (i = 0; i < lst.length; i++) {
mesh = this.scene.getMeshByName(lst[i]);
var anima = this.scene.getAnimatableByTarget(mesh);
if (anima != undefined)
anima.stop();
var indexMesh = this.scene.meshes.indexOf(mesh);
if (indexMesh > -1)
this.scene.meshes.splice(indexMesh, 1);
}
};
return Tracker;
})();
//# sourceMappingURL=Tracker.js.map | {
"content_hash": "d6caf483e5ccab689b01a8444b24b178",
"timestamp": "",
"source": "github",
"line_count": 209,
"max_line_length": 210,
"avg_line_length": 43.5311004784689,
"alnum_prop": 0.5080237414816443,
"repo_name": "OfficeDev/Excel-Add-in-JS-BabylonJS",
"id": "0efe0e13fa12b276ba2f6f12a26808f376b9fa13",
"size": "9098",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "WelcomeAnalyzerWeb/App/Welcome/Tracker.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "1372"
},
{
"name": "CSS",
"bytes": "10509"
},
{
"name": "HTML",
"bytes": "2675"
},
{
"name": "JavaScript",
"bytes": "5037076"
},
{
"name": "TypeScript",
"bytes": "9425"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="run.api.kernel.tests" default="run.api.kernel" basedir=".">
<description> Runs all tests from api/kernel </description>
<target name="run.api.kernel" depends="run.api.kernel.args, run.api.kernel.exec, run.api.kernel.hooks,
run.api.kernel.object, run.api.kernel.pckg, run.api.kernel.string,
run.api.kernel.thread, run.api.kernel.throwable,
run.api.kernel.management, run.api.kernel.compiler" />
<target name="run.api.kernel.args">
<run-pjava-test test="api.kernel.args.AppVMCLParamTest" args="${api.kernel.args.AppVMCLParamTest.max_n_app_params}
${jvm.under.test} ${api.kernel.args.AppVMCLParamTest.vm_opts} ${test.classes.dir}" />
<run-pjava-test test="api.kernel.args.ExecEnvTest" args="${api.kernel.args.ExecEnvTest.max_n_env_vars}
${jvm.under.test} ${test.classes.dir}" />
<run-pjava-test test="api.kernel.args.VMCLPropertiesTest"
args="${api.kernel.args.VMCLPropertiesTest.max_n_properties} ${jvm.under.test}
${api.kernel.args.VMCLPropertiesTest.prop_test_vm_opts} ${test.classes.dir}" />
</target>
<target name="run.api.kernel.exec">
<run-pjava-test test="api.kernel.exec.RunExec" args="${api.kernel.exec.RunExec.num_execs}
${api.kernel.exec.RunExec.num_threads} ${test.classes.dir} ${jvm.under.test} ${test.classes.dir}" />
</target>
<target name="run.api.kernel.hooks">
<run-pjava-test test="api.kernel.hooks.AddRmPropertiesHooksTest"
args="${api.kernel.hooks.AddRmPropertiesHooksTest.n_properties}
${api.kernel.hooks.AddRmPropertiesHooksTest.n_hooks}"/>
<run-pjava-test test="api.kernel.hooks.AddRmShtdwnHooksTest" args="${jvm.under.test} ${test.classes.dir}" />
<run-pjava-test test="api.kernel.hooks.ShtdwnHooksCornerCaseTest" args="${jvm.under.test} ${test.classes.dir}" />
</target>
<target name="run.api.kernel.object">
<run-pjava-test test="api.kernel.object.ObjectCloneTest" args="${api.kernel.object.ObjectCloneTest.n_iterations}" />
<run-pjava-test test="api.kernel.object.ObjectFinalizeTest" args="${api.kernel.object.ObjectFinalizeTest.n_iterations}" />
<run-pjava-test test="api.kernel.object.ObjectGetclassHashcodeTest" args="${api.kernel.object.ObjectGetclassHashcodeTest.n_iterations}" />
</target>
<target name="run.api.kernel.compiler">
<run-pjava-test test="api.kernel.compiler.JitCompilerTest" args="" />
</target>
<target name="run.api.kernel.pckg">
<run-pjava-test test="api.kernel.pckg.PackageGetTest" args="${api.kernel.pckg.PackageGetTest.n_iterations}" />
</target>
<target name="run.api.kernel.string">
<run-pjava-test test="api.kernel.string.InsensitiveTest"/>
<run-pjava-test test="api.kernel.string.InternTest" />
<run-pjava-test test="api.kernel.string.InternThreadingTest" />
<run-pjava-test test="api.kernel.string.StringInternTest"/>
</target>
<target name="run.api.kernel.management">
<run-pjava-test test="api.kernel.management.SystemResourceOrientedTest"
args="${api.kernel.management.SystemResourceOrientedTest.n_threads}
${api.kernel.management.SystemResourceOrientedTest.n_iters} ${test.classes.dir}
${api.kernel.management.SystemResourceOrientedTest.n_loadedClasses}"/>
</target>
<target name="run.api.kernel.thread">
<run-pjava-test test="api.kernel.thread.ExcptHandlerTest.ExcptHandlerTest" />
<run-pjava-test test="api.kernel.thread.ThreadLocalTest.ThreadLocalTest" />
<run-pjava-test test="api.kernel.thread.StackTraceTest.StackTraceTest" />
<run-pjava-test test="api.kernel.threadgroup.EnumerateTest" />
<run-pjava-test test="api.kernel.thread.ThreadSuspendResume.ThreadSuspendResume"
args="${api.kernel.thread.ThreadSuspendResume.ThreadSuspendResume.n_threads}
${api.kernel.thread.ThreadSuspendResume.ThreadSuspendResume.n_iters}" />
<run-pjava-test test="api.kernel.thread.Calculation.CalcTest"
args="${api.kernel.thread.Calculation.CalcTest.tasks}
${api.kernel.thread.Calculation.CalcTest.depth}" />
<run-pjava-test test="api.kernel.thread.LifeSimulationTest.Life"
args="${api.kernel.thread.LifeSimulationTest.Life.max_creatures}
${api.kernel.thread.LifeSimulationTest.Life.max_age}
${api.kernel.thread.LifeSimulationTest.Life.start_health}
${api.kernel.thread.LifeSimulationTest.Life.total_food}" />
<run-pjava-test test="api.kernel.thread.RecursiveThreadTest.RecursiveTest"
args="${api.kernel.thread.RecursiveThreadTest.RecursiveTest.recursion_depth}
${api.kernel.thread.RecursiveThreadTest.RecursiveTest.array_size}" />
<run-pjava-test test="api.kernel.thread.Synchronization.SynchroTest"
args="${api.kernel.thread.Synchronization.SynchroTest.iterations}" />
<run-pjava-test test="api.kernel.thread.Synchronization.SynchroTest2"
args="${api.kernel.thread.Synchronization.SynchroTest2.threads}
${api.kernel.thread.Synchronization.SynchroTest2.serial}" />
<run-pjava-test test="api.kernel.thread.ThreadArrayTest.ThreadArrayTest"
args="${api.kernel.thread.ThreadArrayTest.ThreadArrayTest.threads}
${api.kernel.thread.ThreadArrayTest.ThreadArrayTest.starts}" />
<run-pjava-test test="api.kernel.thread.ThreadKill.ThreadKillTest"
args="${api.kernel.thread.ThreadKill.ThreadKillTest.threads}
${api.kernel.thread.ThreadKill.ThreadKillTest.iterations}" />
<run-pjava-test test="api.kernel.thread.VolatileVariableTest.DekkerTest"
args="${api.kernel.thread.VolatileVariableTest.DekkerTest.iterations}" />
<run-pjava-test test="api.kernel.thread.VolatileVariableTest.PetersonTest"
args="${api.kernel.thread.VolatileVariableTest.PetersonTest.iterations}" />
<run-pjava-test test="api.kernel.thread.WeakReferenceandThreadTest.WeakReferenceandThreadTest"
args="${api.kernel.thread.WeakReferenceandThreadTest.WeakReferenceandThreadTest.threads}
${api.kernel.thread.WeakReferenceandThreadTest.WeakReferenceandThreadTest.gc_attempts}" />
</target>
<target name="run.api.kernel.throwable">
<run-pjava-test test="api.kernel.throwable.StackTraceExcptsTest" />
</target>
</project>
| {
"content_hash": "b2f84cfa04524c5e284c1dc960d9d162",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 146,
"avg_line_length": 44.32183908045977,
"alnum_prop": 0.6674014522821576,
"repo_name": "freeVM/freeVM",
"id": "48aef2338f101ee759938c6af4265f45a3aa2d67",
"size": "7712",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "enhanced/buildtest/tests/reliability/run/run.api.kernel.xml",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Assembly",
"bytes": "116828"
},
{
"name": "C",
"bytes": "17860389"
},
{
"name": "C++",
"bytes": "19007206"
},
{
"name": "CSS",
"bytes": "217777"
},
{
"name": "Java",
"bytes": "152108632"
},
{
"name": "Objective-C",
"bytes": "106412"
},
{
"name": "Objective-J",
"bytes": "11029421"
},
{
"name": "Perl",
"bytes": "305690"
},
{
"name": "Scilab",
"bytes": "34"
},
{
"name": "Shell",
"bytes": "153821"
},
{
"name": "XSLT",
"bytes": "152859"
}
],
"symlink_target": ""
} |
package org.jetbrains.plugins.scala
package project.gradle
import java.io.File
import java.util
import com.intellij.openapi.externalSystem.model.{DataNode, ExternalSystemException, ProjectKeys}
import com.intellij.openapi.externalSystem.service.project.{PlatformFacade, ProjectStructureHelper}
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.libraries.Library
import org.jetbrains.plugins.gradle.model.data.ScalaModelData
import org.jetbrains.plugins.scala.project._
import org.jetbrains.sbt.project.data.service.{SafeProjectStructureHelper, AbstractDataService}
import scala.collection.JavaConverters._
/**
* @author Pavel Fatin
*/
class ScalaGradleDataService(val helper: ProjectStructureHelper)
extends AbstractDataService[ScalaModelData, Library](ScalaModelData.KEY)
with SafeProjectStructureHelper {
import ScalaGradleDataService._
def doImportData(toImport: util.Collection[DataNode[ScalaModelData]], project: Project) {
toImport.asScala.foreach(doImport(_, project))
}
private def doImport(scalaNode: DataNode[ScalaModelData], project: Project): Unit =
for {
module <- getIdeModuleByNode(scalaNode, project)
compilerOptions = compilerOptionsFrom(scalaNode.getData)
compilerClasspath = scalaNode.getData.getScalaClasspath.asScala.toSeq
} {
module.configureScalaCompilerSettingsFrom("Gradle", compilerOptions)
configureScalaSdk(module, project.scalaLibraries, compilerClasspath)
}
private def configureScalaSdk(module: Module, scalaLibraries: Seq[Library], compilerClasspath: Seq[File]): Unit = {
val compilerVersion =
findScalaLibraryIn(compilerClasspath).flatMap(getVersionFromJar)
.getOrElse(throw new ExternalSystemException("Cannot determine Scala compiler version for module " + module.getName))
val scalaLibrary =
scalaLibraries.find(_.scalaVersion == Some(compilerVersion))
.getOrElse(throw new ExternalSystemException("Cannot find project Scala library " + compilerVersion.number + " for module " + module.getName))
if (!scalaLibrary.isScalaSdk) {
val languageLevel = scalaLibrary.scalaLanguageLevel.getOrElse(ScalaLanguageLevel.Default)
scalaLibrary.convertToScalaSdkWith(languageLevel, compilerClasspath)
}
}
def doRemoveData(toRemove: util.Collection[_ <: Library], project: Project) {}
}
private object ScalaGradleDataService {
private def findScalaLibraryIn(classpath: Seq[File]): Option[File] =
classpath.find(_.getName.startsWith(ScalaLibraryName))
private def getVersionFromJar(scalaLibrary: File): Option[Version] =
JarVersion.findFirstIn(scalaLibrary.getName).map(Version(_))
private def compilerOptionsFrom(data: ScalaModelData): Seq[String] = {
val options = data.getScalaCompileOptions
val presentations = Seq(
options.isDeprecation -> "-deprecation",
options.isUnchecked -> "-unchecked",
options.isOptimize -> "-optimise",
!isEmpty(options.getDebugLevel) -> s"-g:${options.getDebugLevel}",
!isEmpty(options.getEncoding) -> s"-encoding ${options.getEncoding}",
!isEmpty(data.getTargetCompatibility) -> s"-target:jvm-${data.getTargetCompatibility}")
val additionalOptions =
if (options.getAdditionalParameters != null) options.getAdditionalParameters.asScala else Seq.empty
presentations.flatMap((include _).tupled) ++ additionalOptions
}
private def isEmpty(s: String) = s == null || s.isEmpty
private def include(b: Boolean, s: String): Seq[String] = if (b) Seq(s) else Seq.empty
}
| {
"content_hash": "92fe8036209034e1fc9a5496338779fe",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 152,
"avg_line_length": 41.58620689655172,
"alnum_prop": 0.761746821448314,
"repo_name": "triggerNZ/intellij-scala",
"id": "3ec8ae49798cb481b534caa671c2c2ebdc497e6a",
"size": "3618",
"binary": false,
"copies": "1",
"ref": "refs/heads/idea15.x",
"path": "src/org/jetbrains/plugins/scala/project/gradle/ScalaGradleDataService.scala",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "HTML",
"bytes": "47220"
},
{
"name": "Java",
"bytes": "1226085"
},
{
"name": "Lex",
"bytes": "34593"
},
{
"name": "Scala",
"bytes": "8050888"
},
{
"name": "Shell",
"bytes": "537"
}
],
"symlink_target": ""
} |
using Voodoo.Messages;
using Voodoo.Tests.TestClasses;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace Voodoo.Tests.Voodoo.Operations
{
[TestClass]
public class QueryTests
{
[TestMethod]
public void Execute_ExceptionIsThrown_IsNotOk()
{
VoodooGlobalConfiguration.RemoveExceptionFromResponseAfterLogging = false;
var result = new QueryThatThrowsErrors(new EmptyRequest()).Execute();
Assert.AreEqual(false, result.IsOk);
VoodooGlobalConfiguration.RemoveExceptionFromResponseAfterLogging = true;
}
[TestMethod]
public void Execute_ErrorAndMergedResponses_IsNotOk()
{
VoodooGlobalConfiguration.RemoveExceptionFromResponseAfterLogging = false;
var result = new QueryThatThrowsErrors(new EmptyRequest()).Execute();
Assert.AreEqual(false, result.IsOk);
var response = new Response {IsOk = true};
response.AppendResponse(result);
Assert.AreEqual(false, response.IsOk);
VoodooGlobalConfiguration.RemoveExceptionFromResponseAfterLogging = true;
}
[TestMethod]
public void Execute_ExceptionIsThrown_ExceptionIsBubbled()
{
VoodooGlobalConfiguration.RemoveExceptionFromResponseAfterLogging = false;
var result = new QueryThatThrowsErrors(new EmptyRequest()).Execute();
Assert.AreEqual(TestingResponse.OhNo, result.Message);
Assert.IsNotNull(result.Exception);
}
[TestMethod]
public void Execute_QueryReturnsResponse_IsOk()
{
var result = new QueryThatDoesNotThrowErrors(new EmptyRequest()).Execute();
Assert.IsNotNull(result);
Assert.IsNull(result.Message);
Assert.AreEqual(true, result.IsOk);
}
}
} | {
"content_hash": "26aa284ff14cba5a0acefab677a5b1b2",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 87,
"avg_line_length": 37.56,
"alnum_prop": 0.6629392971246006,
"repo_name": "MiniverCheevy/voodoo",
"id": "9f5c6b97bd853e3bbcaf2466460c4a90c6c04f5f",
"size": "1880",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "Tests.net461/Voodoo/Operations/QueryTests.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "Batchfile",
"bytes": "2199"
},
{
"name": "C#",
"bytes": "294662"
}
],
"symlink_target": ""
} |
package com.google.sitebricks.example;
import com.google.inject.Inject;
import com.google.sitebricks.At;
import com.google.sitebricks.Show;
import com.google.sitebricks.headless.Reply;
import com.google.sitebricks.headless.Service;
import com.google.sitebricks.http.Get;
import com.google.sitebricks.rendering.Templates;
/**
* @author Dhanji R. Prasanna ([email protected])
*/
@Show("HelloWorld.html") @Service
public class HelloWorldService {
public static final String HELLO_MSG = "Hello from google-sitebricks!";
private final Templates templates;
private String message = HELLO_MSG;
@Inject
public HelloWorldService(Templates templates) {
this.templates = templates;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
// Some deterministic mangled representation of the input.
public String mangle(String s) {
return "" + s.hashCode();
}
@Get
public Reply<?> get() {
return Reply.with(this).template(HelloWorldService.class);
}
@At("/direct") @Get
public Reply<?> getDirect() {
return Reply.with(templates.render(HelloWorldService.class, this));
}
} | {
"content_hash": "4997ebba7310e4fd82eedf9c5d562241",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 73,
"avg_line_length": 24.791666666666668,
"alnum_prop": 0.7285714285714285,
"repo_name": "mgenov/sitebricks",
"id": "08657a0732b3a5f15a12dc91f193a0743d2dc34b",
"size": "1190",
"binary": false,
"copies": "2",
"ref": "refs/heads/master",
"path": "sitebricks-acceptance-tests/src/main/java/com/google/sitebricks/example/HelloWorldService.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "1055789"
},
{
"name": "JavaScript",
"bytes": "9674"
},
{
"name": "Shell",
"bytes": "529"
}
],
"symlink_target": ""
} |
<?php
/**
* Address.class.php
*/
/**
* Contains address data; Can be passed to {@link AddressServiceRest#validate};
* Also part of the {@link GetTaxRequest}
* result returned from the {@link TaxServiceSoap#getTax} tax calculation service;
* No behavior - basically a glorified struct.
*
* <b>Example:</b>
* <pre>
* $port = new AddressServiceRest($url, $account, $license);
*
* $address = new Address();
* $address->setLine1("900 Winslow Way");
* $address->setLine2("Suite 130");
* $address->setCity("Bainbridge Is");
* $address->setRegion("WA");
* $address->setPostalCode("98110-2450");
*
* $result = $port->validate($address);
* $address = $result->ValidAddress;
*
* </pre>
* @author Avalara
* @copyright � 2004 - 2011 Avalara, Inc. All rights reserved.
* @package Address
*/
namespace AvaTax;
class Address
{
public $AddressCode;
public $Line1;
public $Line2;
public $Line3;
public $City;
public $Region;
public $PostalCode;
public $Country = 'US';
public $TaxRegionId;
public $Latitude;
public $Longitude;
public function __construct($addressCode=null, $line1=null,$line2=null, $line3=null,$city=null,$region=null,$postalCode=null, $country='US', $taxRegionId=null, $latitude=null, $longitude=null)
{
$this->AddressCode = $addressCode;
$this->Line1 = $line1;
$this->Line2 = $line2;
$this->Line3 = $line3;
$this->City = $city;
$this->Region = $region;
$this->PostalCode = $postalCode;
$this->Country = $country;
$this->TaxRegionId = $taxRegionId;
$this->Latitude = $latitude;
$this->Longitude = $longitude;
}
public static function parseAddress($jsonString)
{
$object = json_decode($jsonString);
$AddressCode = null;
$Line1 = null;
$Line2 = null;
$Line3 = null;
$City = null;
$Region = null;
$PostalCode = null;
$Country = null;
$TaxRegionId = null;
$Latitude = null;
$Longitude = null;
if (property_exists($object,"AddressCode")) $AddressCode = $object->AddressCode;
if (property_exists($object,"Line1")) $Line1 = $object->Line1;
if (property_exists($object,"Line2")) $Line2 = $object->Line2;
if (property_exists($object,"Line3")) $Line3 = $object->Line3;
if (property_exists($object,"City")) $City = $object->City;
if (property_exists($object,"Region")) $Region = $object->Region;
if (property_exists($object,"PostalCode")) $PostalCode = $object->PostalCode;
if (property_exists($object,"Country")) $Country = $object->Country;
if (property_exists($object,"TaxRegionId")) $TaxRegionId = $object->TaxRegionId;
if (property_exists($object,"Latitude")) $Latitude = $object->Latitude;
if (property_exists($object,"Longitude")) $Longitude = $object->Longitude;
return new self(
$AddressCode,
$Line1,
$Line2,
$Line3,
$City,
$Region,
$PostalCode,
$Country,
$TaxRegionId,
$Latitude,
$Longitude);
}
public function setLatitude($value) { $this->Latitude = $value; }
public function setLongitude($value) { $this->Longitude = $value; }
public function setAddressCode($value) { $this->AddressCode = $value; }
public function setLine1($value) { $this->Line1 = $value; }
public function setLine2($value) { $this->Line2 = $value; }
public function setLine3($value) { $this->Line3 = $value; }
public function setCity($value) { $this->City = $value; }
public function setRegion($value) { $this->Region = $value; }
public function setPostalCode($value) { $this->PostalCode = $value; }
public function setCountry($value) { $this->Country = $value; }
public function setTaxRegionId($value) { $this->TaxRegionId = $value; }
public function getLongitude() { return $this->Longitude; }
public function getLatitude() { return $this->Latitude; }
public function getAddressCode() { return $this->AddressCode; }
public function getLine1() { return $this->Line1; }
public function getLine2() { return $this->Line2; }
public function getLine3() { return $this->Line3; }
public function getCity() { return $this->City; }
public function getRegion() { return $this->Region; }
public function getPostalCode() { return $this->PostalCode; }
public function getCountry() { return $this->Country; }
public function getTaxRegionId() { return $this->TaxRegionId; }
/**
* Compares Addresses
* @access public
* @param Address
* @return boolean
*/
public function equals(&$other) // fix me after replace
{
return $this === $other || (
strcmp($this->Line1 , $other->Line1) == 0 &&
strcmp($this->Line2 , $other->Line2) == 0 &&
strcmp($this->Line3 , $other->Line3) == 0 &&
strcmp($this->City , $other->City) == 0 &&
strcmp($this->Region , $other->Region) == 0 &&
strcmp($this->PostalCode , $other->PostalCode) == 0 &&
strcmp($this->Country , $other->Country) == 0
);
}
}
?> | {
"content_hash": "63984b34db4593c6ef04b6a5111906ac",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 193,
"avg_line_length": 31.11111111111111,
"alnum_prop": 0.6649159663865546,
"repo_name": "shieldo/AvaTax-Calc-REST-PHP",
"id": "3746cddbdf0774eeb1fb5f614785c6f0539cffc7",
"size": "4762",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/AvaTax/Address.php",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "PHP",
"bytes": "66051"
}
],
"symlink_target": ""
} |
/* @flow */
import type { AngularComponent } from 'types/angular'
import template from './wordAnswer.html'
import controller from './wordAnswer.controller'
import './wordAnswer.scss'
let wordAnswerComponent: AngularComponent = {
restrict: 'E',
bindings: {
word: '<',
guess: '&'
},
template,
controller,
controllerAs: 'vm'
}
export default wordAnswerComponent
| {
"content_hash": "df1df6b464a97aeedee82de8b14ec9ae",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 53,
"avg_line_length": 19.15,
"alnum_prop": 0.6945169712793734,
"repo_name": "mklinga/aprendo",
"id": "4af841904f65d6ae35bc875574915a68182b34c8",
"size": "383",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "client/app/components/tests/tester/wordAnswer/wordAnswer.component.js",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "CSS",
"bytes": "884"
},
{
"name": "HTML",
"bytes": "4546"
},
{
"name": "JavaScript",
"bytes": "97456"
}
],
"symlink_target": ""
} |
<?php
session_start();
include('library/form/connection.php');
include('library/function/functions.php');
$db = new db();
$search = isset($_GET['search']) ? $_GET['search'] : '';
$limit = 8;
$total_sql = 'SELECT
barangay.ID,
barangay.NAME,
district.NAME AS DISTRICT,
city.NAME AS CITY,
barangay_info.MEN AS MEN,
barangay_info.WOMEN AS WOMEN
FROM (SELECT * FROM barangay WHERE barangay.NAME LIKE "%'.$search.'%") AS barangay
LEFT JOIN district ON barangay.DISTRICT = district.ID
LEFT JOIN city ON district.CITY = city.ID
LEFT JOIN barangay_info ON barangay.ID = barangay_info.BARANGAY
GROUP BY barangay.ID';
$total_result = $db->connection->query($total_sql);
$total_count = mysqli_num_rows($total_result);
$total_page = ceil($total_count/$limit);
$page = isset($_GET['page']) && $_GET['page'] > 0 && $_GET['page'] <= $total_page ? $_GET['page'] : '1';
$offset = ($page * $limit) - $limit;
if($page < 2) {
$disable_previous = 'disabled';
$disable_previous2 = 'pointer-events: none;';
$bottom_page = 'display:none';
}
else {
$disable_previous = '';
$disable_previous2 = '';
$bottom_page = '';
}
if($total_page < 2) {
$top_page = 'display:none';
}
else {
$top_page = '';
}
if($total_page == $page || $total_page < 1) {
$disable_next = 'disabled';
$disable_next2 = 'pointer-events: none;';
$top_page = 'display:none';
}
else {
$disable_next = '';
$disable_next2 = '';
$top_page = '';
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="th3515">
<meta name="author" content="@pablongbuhaymo">
<title>Overview | City Disaster Risk Management</title>
<link rel="icon" href="img/favicon.ico">
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/app.css" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha512-07I2e+7D8p6he1SIM+1twR5TIrhUQn9+I6yjqD53JQjFiMf8EtC93ty0/5vJTZGF8aAocvHYNEDJajGdNx1IsQ=="
crossorigin=""/>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<!-- The #page-top ID is part of the scrolling feature - the data-spy and data-target are part of the built-in Bootstrap scrollspy function -->
<body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top">
<?php
include('library/html/navbar.php');
include('library/html/loginmodal.php');
?>
<!-- Barangay Modal View -->
<!--Content starts here-->
<div class="container fluid">
<div class="page-header">
<h3>Add New Barangay </h3>
</div>
<div class="row no-pad">
<div class="col-lg-8 col-md-12 col-sm-12 col-xs-12">
<div id="map" style="height: 70vh; width: 100%;" tabindex="0"> </div>
</div>
<div class="col-lg-4 col-md-12 col-sm-12 col-xs-12">
<div id="AB_msgbox" tabindex="0"></div>
<form id="AddBarangayForm" method="post" action="library/form/AddBarangayFormNew.php">
<div class="input-group">
<span class="input-group-addon" id="sizing-addon1">Map ID: </span>
<input id="AddBarangayForm_MAPID" name = "MAPID" readonly type="text" class = "form-control" value="Please select a location" />
</div>
<br />
<div class="input-group">
<span class="input-group-addon" id="sizing-addon1">Barangay Name: </span>
<input id="AddBarangayForm_NAME" name="NAME" class="form-control" />
</div>
<br />
<!-- District -->
<div class="input-group">
<span class="input-group-addon" id="sizing-addon1">District: </span>
<select class="form-control" id="AddBarangayForm_DISTRICT" name="DISTRICT">
<?php
$district_sql = "SELECT * FROM district ORDER BY NAME";
$district_result = $db->connection->query($district_sql);
while($district_row = $district_result->fetch_assoc()) {
?>
<option value="<?php echo $district_row["ID"]; ?>" id="add_district_<?php echo $district_row["ID"]; ?>"><?php echo $district_row["NAME"]; ?></option>
<?php
}
?>
</select>
</div>
<br />
<!-- City -->
<div class="input-group">
<span class="input-group-addon" id="sizing-addon1">City: </span>
<select class="form-control" id="AddBarangayForm_CITY" name="CITY">
<?php
$city_sql = "SELECT * FROM city ORDER BY NAME";
$city_result = $db->connection->query($city_sql);
while($city_row = $city_result->fetch_assoc()) {
?>
<option value="<?php echo $city_row["ID"]; ?>" id="add_district_<?php echo $district_row["ID"]; ?>"><?php echo $city_row["NAME"]; ?></option>
<?php
}
?>
</select>
</div>
<br />
<div class = "pull-right">
<button type="submit" id="AddBarangayForm_SUBMIT" data-loading-text="Adding Barangay..." class="btn btn-primary"><span class="glyphicon glyphicon-check"></span> Add new Barangay</button>
<button type = "button" class="btn btn-default" onclick="location.href='BarangayManagement.php'">Cancel</button>
</div>
</form>
</div>
</div>
<small class = "pull-right">*All Demographic Data are sourced-out from the Barangay Database</small>
</div>
<br>
<!--FOOTER HERE-->
<?php include('library/html/footer.php'); ?>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="js/1.11.3_jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="js/app/mylibrary.js"></script>
<script src="js/app/loginscript.js"></script>
<script src="js/jquery.easing.min.js"></script>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha512-A7vV8IFfih/D732iSSKi20u/ooOfj/AGehOKq0f4vLT1Zr2Y+RX7C+w8A1gaSasGtRUZpF/NZgzSAu4/Gc41Lg=="
crossorigin=""></script>
<script src="js/jquery.form.min.js"></script>
<script src="js/app/messagealert.js"></script>
<script type="text/javascript" src="city.js"></script>
<script>
var ABForm = {
form: document.getElementById('AddBarangayForm'),
name: document.getElementById('AddBarangayForm_NAME'),
district: document.getElementById('AddBarangayForm_DISTRICT'),
MAPID: document.getElementById('AddBarangayFORM_MAPID'),
submit : '#AddBarangayForm_SUBMIT',
msgbox: 'AB_msgbox'
};
ABForm.form.onsubmit = function(e) {
e.preventDefault();
$(this).ajaxSubmit({
beforeSend:function()
{
$(ABForm.submit).button('loading');
},
uploadProgress:function(event,position,total,percentCompelete)
{
},
success:function(data)
{
$(ABForm.submit).button('reset');
var server_message = data.trim();
if(server_message == 'success')
{
createmessage(1, 'You have successfully submitted the disaster.', ABForm.msgbox);
alert('Successfully Added Barangay');
window.location.href = 'BarangayManagement.php';
}
else if(server_message == 'error')
{
createmessagein(3, 'There is a problem with submitting your report.', ABForm.msgbox);
}
else
{
createmessagein(3, '<b>Oh Snap!</b> There is a problem with the server or your connection.', ABForm.msgbox);
}
}
});
};
</script>
<!-- MAP SCRIPT -->
<script>
var map = L.map('map').setView([10.719950067615137, 122.554175308317468], 13);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 18,
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
'Imagery © <a href="http://mapbox.com">Mapbox</a>',
id: 'mapbox.light'
}).addTo(map);
var geojson = L.geoJson(statesData).addTo(map);
function getMapID(props)
{
document.getElementById('AddBarangayForm_MAPID').value = JSON.stringify(props.OBJECTID);
}
// get color depending on population density value
function getColor(d) {
return '#696969';
}
function style(feature) {
return {
weight: 2,
opacity: 1,
color: 'white',
dashArray: '3',
fillOpacity: 0.8,
fillColor: getColor(feature.properties.density)
};
}
function resetHighlight(e) {
geojson.resetStyle(e.target);
}
function zoomToFeature(e) {
var layer = e.target;
layer.setStyle({
weight: 5,
color: '#666',
dashArray: '',
fillOpacity: 1
});
map.fitBounds(e.target.getBounds());
getMapID(layer.feature.properties);
}
function onEachFeature(feature, layer) {
layer.on({
dblclick: zoomToFeature,
click: resetHighlight
});
}
geojson = L.geoJson(statesData, {
style: style,
onEachFeature: onEachFeature
}).addTo(map);
var info = L.control();
info.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info ');
div.innerHTML +=
'<small> • Double click to highlight an area <br> • Click again to remove highlighted area</small>'
;
return div;
};
info.addTo(map);
</script>
</body>
</html> | {
"content_hash": "99400435f2a1631530c3dfe6286576ad",
"timestamp": "",
"source": "github",
"line_count": 347,
"max_line_length": 221,
"avg_line_length": 34.07492795389049,
"alnum_prop": 0.5190290933694182,
"repo_name": "wawilord/CDRRMOGIS",
"id": "4c0190f177040f9f7ef5d6613ac095304d4d5999",
"size": "11829",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "CDRRMOGIS/addBarangay.php",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "37668"
},
{
"name": "JavaScript",
"bytes": "962570"
},
{
"name": "PHP",
"bytes": "219953"
}
],
"symlink_target": ""
} |
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wikidot="http://www.wikidot.com/rss-namespace">
<channel>
<title>Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus</link>
<description>Posts in the discussion thread "Moe looking for sparring partners in BvS and Anime Versus" - Does anyone actually read this here?</description>
<copyright></copyright>
<lastBuildDate>Sun, 10 Jul 2022 04:54:36 +0000</lastBuildDate>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-383623</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-383623</link>
<description></description>
<pubDate>Thu, 12 Feb 2009 23:21:28 +0000</pubDate>
<wikidot:authorName>unstoppable</wikidot:authorName> <wikidot:authorUserId>121638</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>UnstopX added Moe in bvs</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-383569</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-383569</link>
<description></description>
<pubDate>Thu, 12 Feb 2009 22:28:24 +0000</pubDate>
<wikidot:authorName>Xeserex</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Added Moe in BvS</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-378651</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-378651</link>
<description></description>
<pubDate>Sat, 07 Feb 2009 20:06:04 +0000</pubDate>
<wikidot:authorName>Delirium</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Delirium has added Moe in bvs<br /> Namari has added Moe in AV</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-378520</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-378520</link>
<description></description>
<pubDate>Sat, 07 Feb 2009 17:59:29 +0000</pubDate>
<wikidot:authorName>Nisemono</wikidot:authorName> <wikidot:authorUserId>106505</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Nisemono added Moe in BvS.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-375848</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-375848</link>
<description></description>
<pubDate>Wed, 04 Feb 2009 23:10:31 +0000</pubDate>
<wikidot:authorName>Zeekee</wikidot:authorName> <wikidot:authorUserId>176256</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Zeekee added Moe in BvS!</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-374518</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-374518</link>
<description></description>
<pubDate>Tue, 03 Feb 2009 17:39:42 +0000</pubDate>
<wikidot:authorName>Mokuren</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Mokuren in both BvS and AV</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-374260</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-374260</link>
<description></description>
<pubDate>Tue, 03 Feb 2009 13:14:24 +0000</pubDate>
<wikidot:authorName>Ananvil</wikidot:authorName> <wikidot:authorUserId>83686</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Yes, it is in BvS.</p> <p>I still have you pending.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-373848</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-373848</link>
<description></description>
<pubDate>Tue, 03 Feb 2009 00:26:52 +0000</pubDate>
<wikidot:authorName>tsundere</wikidot:authorName> <wikidot:authorUserId>261473</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>This is Moe - Let this thread die please. I'll wait a few days and hopefully make one I can edit instead then.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-373821</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-373821</link>
<description></description>
<pubDate>Tue, 03 Feb 2009 00:09:18 +0000</pubDate>
<wikidot:authorName>tsundere</wikidot:authorName> <wikidot:authorUserId>261473</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Was behind a bit, added most of the people I missed (just leave a message if I missed you on one of the games)</p> <p>Ananvil, was it BvS you added me on?<br /> Player doesn't exist message came up…</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-370616</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-370616</link>
<description></description>
<pubDate>Fri, 30 Jan 2009 02:39:55 +0000</pubDate>
<wikidot:authorName>Justice Knight</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Added Moe to Justice Knight's rival list in AV, and Observer's spar list in BvS.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-370259</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-370259</link>
<description></description>
<pubDate>Thu, 29 Jan 2009 19:37:31 +0000</pubDate>
<wikidot:authorName>dilz</wikidot:authorName> <content:encoded>
<![CDATA[
<p>add dilz on both AV and BVS</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-369989</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-369989</link>
<description></description>
<pubDate>Thu, 29 Jan 2009 14:59:51 +0000</pubDate>
<wikidot:authorName>Ananvil</wikidot:authorName> <wikidot:authorUserId>83686</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Ananvil added Moe.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-369629</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-369629</link>
<description></description>
<pubDate>Thu, 29 Jan 2009 03:24:21 +0000</pubDate>
<wikidot:authorName>Moe</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Added mikelorus - pending</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-366584</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-366584</link>
<description></description>
<pubDate>Mon, 26 Jan 2009 03:10:38 +0000</pubDate>
<wikidot:authorName>mikelorus</wikidot:authorName> <wikidot:authorUserId>231303</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>player mikelorus is pending Moe (bvs)</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-366549</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-366549</link>
<description></description>
<pubDate>Mon, 26 Jan 2009 02:12:22 +0000</pubDate>
<wikidot:authorName>Moe</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Typo. Fixed…</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-366548</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-366548</link>
<description></description>
<pubDate>Mon, 26 Jan 2009 02:12:01 +0000</pubDate>
<wikidot:authorName>tsundere</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Current have added everyone above here.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-362752</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-362752</link>
<description></description>
<pubDate>Wed, 21 Jan 2009 17:04:50 +0000</pubDate>
<wikidot:authorName>sebmagic</wikidot:authorName> <wikidot:authorUserId>271527</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>sebmagic added Moe on BvS and AV</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-362587</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-362587</link>
<description></description>
<pubDate>Wed, 21 Jan 2009 15:47:22 +0000</pubDate>
<wikidot:authorName>Nemar</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Nemar added Moe on BvS</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-362440</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-362440</link>
<description></description>
<pubDate>Wed, 21 Jan 2009 12:42:04 +0000</pubDate>
<wikidot:authorName>unstoppable</wikidot:authorName> <wikidot:authorUserId>121638</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>UnstopX added Moe in AV</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-362057</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-362057</link>
<description></description>
<pubDate>Wed, 21 Jan 2009 00:04:34 +0000</pubDate>
<wikidot:authorName>Moe</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Added</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-361599</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-361599</link>
<description></description>
<pubDate>Tue, 20 Jan 2009 13:35:53 +0000</pubDate>
<wikidot:authorName>shaqdow</wikidot:authorName> <content:encoded>
<![CDATA[
<p>pls add shaqdow on both</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-361245</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-361245</link>
<description></description>
<pubDate>Tue, 20 Jan 2009 02:29:56 +0000</pubDate>
<wikidot:authorName>Moe</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Added</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-360689</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-360689</link>
<description></description>
<pubDate>Mon, 19 Jan 2009 16:12:26 +0000</pubDate>
<wikidot:authorName>Yoshirou</wikidot:authorName> <wikidot:authorUserId>138620</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Yoshirou added Moe at AV</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-360489</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-360489</link>
<description></description>
<pubDate>Mon, 19 Jan 2009 11:40:46 +0000</pubDate>
<wikidot:authorName>val993</wikidot:authorName> <wikidot:authorUserId>240949</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>val993 added Moe at bvs and Zero Zone added Moe on av</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-358066</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-358066</link>
<description></description>
<pubDate>Fri, 16 Jan 2009 04:55:03 +0000</pubDate>
<wikidot:authorName>Moe</wikidot:authorName> <content:encoded>
<![CDATA[
<p>added</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-358018</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-358018</link>
<description></description>
<pubDate>Fri, 16 Jan 2009 03:33:18 +0000</pubDate>
<wikidot:authorName>Whitehat</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Whitehat added Moe on both.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-357641</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-357641</link>
<description></description>
<pubDate>Thu, 15 Jan 2009 19:09:14 +0000</pubDate>
<wikidot:authorName>kaktus143</wikidot:authorName> <wikidot:authorUserId>268388</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>kaktus143 added Moe on BvS</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-357080</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-357080</link>
<description></description>
<pubDate>Thu, 15 Jan 2009 07:47:52 +0000</pubDate>
<wikidot:authorName>Sephiroso</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Sephiroso added Moe on BvS</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-356794</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-356794</link>
<description></description>
<pubDate>Thu, 15 Jan 2009 01:54:20 +0000</pubDate>
<wikidot:authorName>Moe</wikidot:authorName> <content:encoded>
<![CDATA[
<p>M Senshou added</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-356348</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-356348</link>
<description></description>
<pubDate>Wed, 14 Jan 2009 17:26:29 +0000</pubDate>
<wikidot:authorName>M Senshou</wikidot:authorName> <content:encoded>
<![CDATA[
<p>M Senshou added Moe at AV</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-355752</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-355752</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 23:21:47 +0000</pubDate>
<wikidot:authorName>tsundere</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Above all added as appropriate, EXCEPT hou ou kun - Name was not found as copy pasted in BvS…</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-355654</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-355654</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 21:34:37 +0000</pubDate>
<wikidot:authorName>kaktus143</wikidot:authorName> <content:encoded>
<![CDATA[
<p>kaktus143 added Moe on AV</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-355603</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-355603</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 20:44:00 +0000</pubDate>
<wikidot:authorName>nobdy</wikidot:authorName> <wikidot:authorUserId>267306</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Nobdy added Moe on BvS.</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-355597</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-355597</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 20:39:07 +0000</pubDate>
<wikidot:authorName>portwizard</wikidot:authorName> <wikidot:authorUserId>181794</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>portwizard and winsock added Moe on AV</p> <p>winsock added Moe on BvS</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-355576</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-355576</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 20:19:58 +0000</pubDate>
<wikidot:authorName>hou ou kun</wikidot:authorName> <wikidot:authorUserId>267421</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Added on Bvs ^^</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-355509</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-355509</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 19:03:48 +0000</pubDate>
<wikidot:authorName>Rabid Rob</wikidot:authorName> <wikidot:authorUserId>261044</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>Moe, I hope you read this too cause Rabid Rob just added you in both BvS and AV :)</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-355199</guid>
<title>Re: Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-355199</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 13:01:35 +0000</pubDate>
<wikidot:authorName>EvilGaara</wikidot:authorName> <wikidot:authorUserId>262527</wikidot:authorUserId> <content:encoded>
<![CDATA[
<p>EvilGaara added Moe on both</p>
]]>
</content:encoded> </item>
<item>
<guid>http://bvs.wikidot.com/forum/t-119576#post-354821</guid>
<title>Moe looking for sparring partners in BvS and Anime Versus</title>
<link>http://bvs.wikidot.com/forum/t-119576/moe-looking-for-sparring-partners-in-bvs-and-anime-versus#post-354821</link>
<description></description>
<pubDate>Tue, 13 Jan 2009 00:55:34 +0000</pubDate>
<wikidot:authorName>Moe</wikidot:authorName> <content:encoded>
<![CDATA[
<p>Nick: Moe<br /> AV: Level 29, untransmuted.<br /> 11 slots open.</p> <p>BvS: Level 43, season 1.<br /> 26 slots open.</p>
]]>
</content:encoded> </item>
</channel>
</rss> | {
"content_hash": "f98867d14cc76fb434b5b6f3e1130110",
"timestamp": "",
"source": "github",
"line_count": 430,
"max_line_length": 213,
"avg_line_length": 53.895348837209305,
"alnum_prop": 0.6700323624595469,
"repo_name": "tn5421/tn5421.github.io",
"id": "8a202f9f75566ad1d797abae3ce6b6634886c632",
"size": "23181",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "bvs.wikidot.com/feed/forum/t-119576.xml",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "400301089"
}
],
"symlink_target": ""
} |
FROM balenalib/raspberrypi3-64-ubuntu:disco-build
# remove several traces of debian python
RUN apt-get purge -y python.*
# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
ENV LANG C.UTF-8
# key 63C7CC90: public key "Simon McVittie <[email protected]>" imported
# key 3372DCFA: public key "Donald Stufft (dstufft) <[email protected]>" imported
RUN gpg --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \
&& gpg --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059
ENV PYTHON_VERSION 3.8.9
# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION 21.0.1
ENV SETUPTOOLS_VERSION 56.0.0
RUN set -x \
&& curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" \
&& echo "8a565846e715aa422ea060155704ed2ed5b06f685e6847630d2c7e7b28b0ffc8 Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" | sha256sum -c - \
&& tar -xzf "Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" --strip-components=1 \
&& rm -rf "Python-$PYTHON_VERSION.linux-aarch64-openssl1.1.tar.gz" \
&& ldconfig \
&& if [ ! -e /usr/local/bin/pip3 ]; then : \
&& curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py" \
&& echo "19dae841a150c86e2a09d475b5eb0602861f2a5b7761ec268049a662dbd2bd0c get-pip.py" | sha256sum -c - \
&& python3 get-pip.py \
&& rm get-pip.py \
; fi \
&& pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& cd / \
&& rm -rf /usr/src/python ~/.cache
# install "virtualenv", since the vast majority of users of this image will want it
RUN pip3 install --no-cache-dir virtualenv
ENV PYTHON_DBUS_VERSION 1.2.8
# install dbus-python dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
libdbus-1-dev \
libdbus-glib-1-dev \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get -y autoremove
# install dbus-python
RUN set -x \
&& mkdir -p /usr/src/dbus-python \
&& curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz" -o dbus-python.tar.gz \
&& curl -SL "http://dbus.freedesktop.org/releases/dbus-python/dbus-python-$PYTHON_DBUS_VERSION.tar.gz.asc" -o dbus-python.tar.gz.asc \
&& gpg --verify dbus-python.tar.gz.asc \
&& tar -xzC /usr/src/dbus-python --strip-components=1 -f dbus-python.tar.gz \
&& rm dbus-python.tar.gz* \
&& cd /usr/src/dbus-python \
&& PYTHON_VERSION=$(expr match "$PYTHON_VERSION" '\([0-9]*\.[0-9]*\)') ./configure \
&& make -j$(nproc) \
&& make install -j$(nproc) \
&& cd / \
&& rm -rf /usr/src/dbus-python
# make some useful symlinks that are expected to exist
RUN cd /usr/local/bin \
&& ln -sf pip3 pip \
&& { [ -e easy_install ] || ln -s easy_install-* easy_install; } \
&& ln -sf idle3 idle \
&& ln -sf pydoc3 pydoc \
&& ln -sf python3 python \
&& ln -sf python3-config python-config
# set PYTHONPATH to point to dist-packages
ENV PYTHONPATH /usr/lib/python3/dist-packages:$PYTHONPATH
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/8accad6af708fca7271c5c65f18a86782e19f877/scripts/assets/tests/[email protected]" \
&& echo "Running test-stack@python" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v8 \nOS: Ubuntu disco \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \nPython v3.8.9, Pip v21.0.1, Setuptools v56.0.0 \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "7c520641451e07b88d5304501db1b23d",
"timestamp": "",
"source": "github",
"line_count": 95,
"max_line_length": 709,
"avg_line_length": 50.66315789473684,
"alnum_prop": 0.7041346353625597,
"repo_name": "nghiant2710/base-images",
"id": "2a115adfad9121e0491f4f4c34439c3dc44d4c38",
"size": "4834",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/python/raspberrypi3-64/ubuntu/disco/3.8.9/build/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "144558581"
},
{
"name": "JavaScript",
"bytes": "16316"
},
{
"name": "Shell",
"bytes": "368690"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_162) on Tue Mar 24 11:44:43 PDT 2020 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Uses of Class com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator.Validity (jackson-databind 2.11.0.rc1 API)</title>
<meta name="date" content="2020-03-24">
<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 com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator.Validity (jackson-databind 2.11.0.rc1 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<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="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">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?com/fasterxml/jackson/databind/jsontype/class-use/PolymorphicTypeValidator.Validity.html" target="_top">Frames</a></li>
<li><a href="PolymorphicTypeValidator.Validity.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator.Validity" class="title">Uses of Class<br>com.fasterxml.jackson.databind.jsontype.PolymorphicTypeValidator.Validity</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#com.fasterxml.jackson.databind.jsontype">com.fasterxml.jackson.databind.jsontype</a></td>
<td class="colLast">
<div class="block">Package that contains interfaces that define how to implement
functionality for dynamically resolving type during deserialization.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#com.fasterxml.jackson.databind.jsontype.impl">com.fasterxml.jackson.databind.jsontype.impl</a></td>
<td class="colLast">
<div class="block">Package that contains standard implementations for
<a href="../../../../../../com/fasterxml/jackson/databind/jsontype/TypeResolverBuilder.html" title="interface in com.fasterxml.jackson.databind.jsontype"><code>TypeResolverBuilder</code></a>
and
<a href="../../../../../../com/fasterxml/jackson/databind/jsontype/TypeIdResolver.html" title="interface in com.fasterxml.jackson.databind.jsontype"><code>TypeIdResolver</code></a>.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="com.fasterxml.jackson.databind.jsontype">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a> in <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/package-summary.html">com.fasterxml.jackson.databind.jsontype</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/package-summary.html">com.fasterxml.jackson.databind.jsontype</a> that return <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">BasicPolymorphicTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/BasicPolymorphicTypeValidator.html#validateBaseType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-">validateBaseType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> ctxt,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">DefaultBaseTypeLimitingValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/DefaultBaseTypeLimitingValidator.html#validateBaseType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-">validateBaseType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.html#validateBaseType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-">validateBaseType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType)</code>
<div class="block">Method called when a property with polymorphic value is encountered, and a
<code>TypeResolverBuilder</code> is needed.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.Base.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Base.html#validateBaseType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-">validateBaseType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">BasicPolymorphicTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/BasicPolymorphicTypeValidator.html#validateSubClassName-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-java.lang.String-">validateSubClassName</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> ctxt,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> subClassName)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">DefaultBaseTypeLimitingValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/DefaultBaseTypeLimitingValidator.html#validateSubClassName-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-java.lang.String-">validateSubClassName</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> subClassName)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.html#validateSubClassName-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-java.lang.String-">validateSubClassName</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> subClassName)</code>
<div class="block">Method called after intended class name for subtype has been read (and in case of minimal
class name, expanded to fully-qualified class name) but before attempt is made to
look up actual <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang"><code>Class</code></a> or <a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind"><code>JavaType</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.Base.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Base.html#validateSubClassName-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-java.lang.String-">validateSubClassName</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> subClassName)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">BasicPolymorphicTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/BasicPolymorphicTypeValidator.html#validateSubType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.JavaType-">validateSubType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> ctxt,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> subType)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">DefaultBaseTypeLimitingValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/DefaultBaseTypeLimitingValidator.html#validateSubType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.JavaType-">validateSubType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> subType)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.html#validateSubType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.JavaType-">validateSubType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> subType)</code>
<div class="block">Method called after class name has been resolved to actual type, in cases where previous
call to <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.html#validateSubClassName-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-java.lang.String-"><code>PolymorphicTypeValidator.validateSubClassName(com.fasterxml.jackson.databind.cfg.MapperConfig<?>, com.fasterxml.jackson.databind.JavaType, java.lang.String)</code></a> returned <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html#INDETERMINATE"><code>INDETERMINATE</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.Base.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Base.html#validateSubType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.JavaType-">validateSubType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> config,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> subType)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.Validity.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html#valueOf-java.lang.String-">valueOf</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code>
<div class="block">Returns the enum constant of this type with the specified name.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a>[]</code></td>
<td class="colLast"><span class="typeNameLabel">PolymorphicTypeValidator.Validity.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html#values--">values</a></span>()</code>
<div class="block">Returns an array containing the constants of this enum type, in
the order they are declared.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="com.fasterxml.jackson.databind.jsontype.impl">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a> in <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/package-summary.html">com.fasterxml.jackson.databind.jsontype.impl</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/package-summary.html">com.fasterxml.jackson.databind.jsontype.impl</a> that return <a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">LaissezFaireSubTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/LaissezFaireSubTypeValidator.html#validateBaseType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-">validateBaseType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> ctxt,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">LaissezFaireSubTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/LaissezFaireSubTypeValidator.html#validateSubClassName-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-java.lang.String-">validateSubClassName</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> ctxt,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> subClassName)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">PolymorphicTypeValidator.Validity</a></code></td>
<td class="colLast"><span class="typeNameLabel">LaissezFaireSubTypeValidator.</span><code><span class="memberNameLink"><a href="../../../../../../com/fasterxml/jackson/databind/jsontype/impl/LaissezFaireSubTypeValidator.html#validateSubType-com.fasterxml.jackson.databind.cfg.MapperConfig-com.fasterxml.jackson.databind.JavaType-com.fasterxml.jackson.databind.JavaType-">validateSubType</a></span>(<a href="../../../../../../com/fasterxml/jackson/databind/cfg/MapperConfig.html" title="class in com.fasterxml.jackson.databind.cfg">MapperConfig</a><?> ctxt,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> baseType,
<a href="../../../../../../com/fasterxml/jackson/databind/JavaType.html" title="class in com.fasterxml.jackson.databind">JavaType</a> subType)</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<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="../../../../../../com/fasterxml/jackson/databind/jsontype/PolymorphicTypeValidator.Validity.html" title="enum in com.fasterxml.jackson.databind.jsontype">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?com/fasterxml/jackson/databind/jsontype/class-use/PolymorphicTypeValidator.Validity.html" target="_top">Frames</a></li>
<li><a href="PolymorphicTypeValidator.Validity.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © 2008–2020 <a href="http://fasterxml.com/">FasterXML</a>. All rights reserved.</small></p>
</body>
</html>
| {
"content_hash": "a70eb99f0d80589280b224b8ee44647c",
"timestamp": "",
"source": "github",
"line_count": 296,
"max_line_length": 581,
"avg_line_length": 96.42905405405405,
"alnum_prop": 0.7102266755421645,
"repo_name": "FasterXML/jackson-databind",
"id": "a7731d1e20763cbd041c5e3ec260e20e8507b6d1",
"size": "28543",
"binary": false,
"copies": "1",
"ref": "refs/heads/2.15",
"path": "docs/javadoc/2.11.rc1/com/fasterxml/jackson/databind/jsontype/class-use/PolymorphicTypeValidator.Validity.html",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "7940640"
},
{
"name": "Logos",
"bytes": "173041"
},
{
"name": "Shell",
"bytes": "264"
}
],
"symlink_target": ""
} |
package example.sos.rest.catalog;
import static org.assertj.core.api.Assertions.*;
import example.sos.rest.events.EventRepository;
import java.math.BigDecimal;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.test.context.junit4.SpringRunner;
/**
* @author Oliver Gierke
*/
@RunWith(SpringRunner.class)
@SpringBootTest
public class CatalogIntegrationTest {
@Autowired Catalog catalog;
@Autowired TestListener listener;
@Autowired EventRepository events;
@Test
public void creatingAProductFiresProductAddedEvent() {
Product product = Product.of("Description", BigDecimal.valueOf(50.00));
catalog.save(product);
assertThat(listener.productAdded.getProduct()).isEqualTo(product);
assertThat(events.findAll(PageRequest.of(0, 10, Sort.by("publicationDate")))).contains(listener.productAdded);
}
}
| {
"content_hash": "ed4cf6585b8bde78269dfa3e4606c9e7",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 112,
"avg_line_length": 27.53846153846154,
"alnum_prop": 0.8016759776536313,
"repo_name": "olivergierke/sos",
"id": "ffda83b8818d15dfff6d2f5c42f4e9b9018412d5",
"size": "1689",
"binary": false,
"copies": "1",
"ref": "refs/heads/main",
"path": "40-restful-sos/sos-rest-catalog/src/test/java/example/sos/rest/catalog/CatalogIntegrationTest.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "157211"
}
],
"symlink_target": ""
} |
export default ESLintWebpackPlugin;
export type Compiler = import('webpack').Compiler;
export type Options = import('./options').Options;
declare class ESLintWebpackPlugin {
/**
* @param {Options} options
*/
constructor(options?: Options);
key: string;
options: import('./options').PluginOptions;
/**
* @param {Compiler} compiler
* @param {Options} options
* @param {string[]} wanted
* @param {string[]} exclude
*/
run(
compiler: Compiler,
options: Options,
wanted: string[],
exclude: string[]
): Promise<void>;
/**
* @param {Compiler} compiler
* @returns {void}
*/
apply(compiler: Compiler): void;
/**
*
* @param {Compiler} compiler
* @returns {string}
*/
getContext(compiler: Compiler): string;
}
| {
"content_hash": "04e2b3ff33c30b23688083f263ea286b",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 50,
"avg_line_length": 22.91176470588235,
"alnum_prop": 0.631578947368421,
"repo_name": "GoogleCloudPlatform/prometheus-engine",
"id": "eca9afae3e70fcf73356163edf5dd7dd4782d712",
"size": "779",
"binary": false,
"copies": "4",
"ref": "refs/heads/main",
"path": "third_party/prometheus_ui/base/web/ui/node_modules/eslint-webpack-plugin/declarations/index.d.ts",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "4035"
},
{
"name": "Go",
"bytes": "574177"
},
{
"name": "Makefile",
"bytes": "5189"
},
{
"name": "Shell",
"bytes": "11915"
}
],
"symlink_target": ""
} |
package ru.stqa.pft.addressbook.tests;
import org.testng.annotations.Test;
import ru.stqa.pft.addressbook.model.ContactData;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
/**
* Created by manuhin on 23.03.2016.
*/
public class ContactAddressTests extends TestBase {
@Test
public void testContactAddress() {
app.goTo().contacts();
ContactData contact = app.contact().all().iterator().next();
ContactData contactInfoFromEditForm = app.contact().infoFromEditForm(contact);
assertThat(contact.getAddress(), equalTo(contactInfoFromEditForm.getAddress()));
}
}
| {
"content_hash": "022430d9de3a0e6d230cd5ba0b84b533",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 84,
"avg_line_length": 29.09090909090909,
"alnum_prop": 0.7609375,
"repo_name": "manyurij/java_study",
"id": "d609bc7939479df0cb5e02c69e389cb9d1522008",
"size": "640",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "addressbook-web-tests/src/test/java/ru/stqa/pft/addressbook/tests/ContactAddressTests.java",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Java",
"bytes": "400499"
},
{
"name": "PHP",
"bytes": "236"
}
],
"symlink_target": ""
} |
using tensorflow::Flag;
using tensorflow::Tensor;
using tensorflow::Status;
using tensorflow::string;
using tensorflow::int32;
int main(int argc, char const *argv[]) {
std::cout << "Hello World" << '\n';
// TODO: hello world from tensor flow
// auto a = tensorflow::constant("HelloWorld");
return 0;
}
| {
"content_hash": "ec7a588d2cc05b6f7de3d3029cde75d6",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 49,
"avg_line_length": 24,
"alnum_prop": 0.6891025641025641,
"repo_name": "llthelinkll/navi_vision",
"id": "5e2ac469f880ea8011ad53b4d31a33f05228af4b",
"size": "1247",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "tests/tensorflow/tensorflow.cpp",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C++",
"bytes": "27464"
},
{
"name": "CMake",
"bytes": "850"
}
],
"symlink_target": ""
} |
namespace DatenMeister.Core.Provider
{
/// <summary>
/// Defines the possible object types for the DatenMeister.
/// This object type is used as a hint for the object providers.
/// </summary>
public enum ObjectType
{
None,
Boolean,
Enum,
String,
Integer,
Double,
DateTime,
Element,
ReflectiveSequence
}
} | {
"content_hash": "e18379780bc608b8e4bcd97639f085a7",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 68,
"avg_line_length": 21.473684210526315,
"alnum_prop": 0.5612745098039216,
"repo_name": "mbrenn/datenmeister-new",
"id": "9a60dbbca08c8f8df29fd082fa161130817ce03d",
"size": "410",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/DatenMeister.Core/Provider/ObjectType.cs",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "C#",
"bytes": "7238379"
},
{
"name": "CSS",
"bytes": "5398"
},
{
"name": "HTML",
"bytes": "34307"
},
{
"name": "JavaScript",
"bytes": "1164184"
},
{
"name": "PowerShell",
"bytes": "10786"
},
{
"name": "Shell",
"bytes": "835"
},
{
"name": "TypeScript",
"bytes": "1103321"
}
],
"symlink_target": ""
} |
title: "Banks Love Hackers"
description: "Hackers scare the public more than banks, and the banks love it."
date: "2012-02-03"
categories:
- "tech"
- "banks"
- "security"
- "fraud"
---
A recent BBC Click article reporting [“Hackers outwit online banking identity security systems”](http://www.bbc.co.uk/news/technology-16812064) show how ‘hackers’ can poison online banking web sites to trick customers into transferring money out of their accounts.
Banks love this kind of article because if keeps their smoke screen smouldering.
<!--more-->
The article reports that…
>Online banking fraud losses totalled £16.9 million in the first six months of 2011, according to Financial Fraud Action UK.
Wow, thats a lot! The banks definitely need to get smarter about security. In fact it is a subject banks do like to talk about a lot. Whilst some bank have started to do more things to help protect these losses, most banks simply use ‘security concerns’ as another excuse to explain away the lack of banking innovation and why they have not improved customer engagement and ultimately consumer empowerment.
The real news is that banks are still defrauding their customers to the tune of a few £billion a year. Putting the numbers into perspective, I was going to call this post..
**“Fraudsters dupe UK current account holders out of £2.6 Billion”.**
The Real Truth
--------------
* 2011 Bank fraud in 2011: £32 Million
* 2006 Unpaid item Fees: £2,600 Million (81x)

These numbers are based on the [OFT report from 2008](http://webarchive.nationalarchives.gov.uk/20140402142426/http:/oft.gov.uk/shared_oft/reports/financial_products/OFT1005exec.pdf) – £2.6 billion in ‘unpaid item’ penaly charges during 2006 (there’s actually another £0.5billion in unauthorised overdraft fees as well). This number is probably now a tiny bit high. A more recent OFT report in 2010 show the average unpaid item fee has halved since the 2008 reports numbers, but when you factor in the other penalty fees, it won’t be far off.
You know I wouldn’t be surprised if the banks didn’t like a little bit of fraud – especially if its online – then they can keep not delivering the services that would help many more people to avoid these (still) ridiculous fees and charges. I wonder if any banks have a secret ‘hacker department’ (btw I’m using hacker in the now more common ‘bad guy at a computer’ way. Not the original and (correct) meaning, as per Zuks recent misunderstood statement). Whilst the banks have cleaned up their act a bit – we must applaud them for halving the average penalty from £34 to £17 – the OFT report in 2008, provides some choice insight into why the banks like these sneaky, after the event, charges:
>The lack of visibility of insufficient funds charges to consumers has reduced the incentive for the banks to compete on these aspects. As a result some banks appear to see insufficient funds charges in particular as an attractive way to generate additional revenue without affecting demand for their accounts.
A footnote goes into more detail: During the course of this market study, the OFT has seen banks’ internal documents on the level of charges that include statements such as:
>‘in order to maximise fee revenue, whilst maintaining our competitive position, selective increases in [insufficient funds charges] are proposed’,
and
>‘Increasing [insufficient funds] charges will have less impact on our marketing position due to its lower visibility.’
Note Well – that there is not a hint of this being ‘handling costs’, its not that the cost to service the un-arranged debt has gone up – simply that they could generate profit whilst hiding the cause!
Its easy for high earners, and those that manage their accounts well to blame the individuals foolishness, but it is seriously easy to get caught out, almost everyone has been tripped up at one time or another. To get a feel or the scale of the problem (from the 2008 report).
>over a fifth of consumers were unaware of insufficient funds charges until they had incurred one.
>over 12.6 million accounts (23 per cent of active accounts) incurred at least one insufficient funds charge in 2006.
>those consumers who incurred an insufficient funds charge in 2006 were more likely to incur at least six charges than just one.
So why would banks not want to offer compelling online and mobile services to keep us well on top of our finances. Why would they not want to ‘be on our side’ and help us out with timely warnings and reminders, and quick emergency transfers?
Well of course that would be a ‘security concern’.
(by the way don’t worry about the banks not making enough money in this economic downturn ['profits are soaring'](http://www.independent.co.uk/news/business/news/banks-profits-soar-as-interest-rates-rise-2219850.html) )
| {
"content_hash": "e15ed525ae44afb553ec2d07948f87d7",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 694,
"avg_line_length": 75.3076923076923,
"alnum_prop": 0.7789581205311542,
"repo_name": "danmux/danmux-hugo",
"id": "c4fa7688a14896d07266e2e835657bddd25598ce",
"size": "4986",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "content/posts/banks_love_hackers.md",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "18524"
},
{
"name": "HTML",
"bytes": "16261"
},
{
"name": "JavaScript",
"bytes": "2649"
},
{
"name": "Makefile",
"bytes": "546"
}
],
"symlink_target": ""
} |
package com.smartdevicelink.proxy.rpc;
import androidx.annotation.NonNull;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
import com.smartdevicelink.proxy.rpc.enums.Result;
import java.util.Hashtable;
public class PerformAppServiceInteractionResponse extends RPCResponse {
public static final String KEY_SERVICE_SPECIFIC_RESULT = "serviceSpecificResult";
/**
* Constructs a new PerformAppServiceInteractionResponse object
*/
public PerformAppServiceInteractionResponse() {
super(FunctionID.PERFORM_APP_SERVICES_INTERACTION.toString());
}
public PerformAppServiceInteractionResponse(Hashtable<String, Object> hash) {
super(hash);
}
/**
* Constructs a new PerformAppServiceInteractionResponse object
*
* @param success whether the request is successfully processed
* @param resultCode whether the request is successfully processed
*/
public PerformAppServiceInteractionResponse(@NonNull Boolean success, @NonNull Result resultCode) {
this();
setSuccess(success);
setResultCode(resultCode);
}
// Setters / getters
/**
* The service can provide specific result strings to the consumer through this param.
*
* @param serviceSpecificResult -
*/
public PerformAppServiceInteractionResponse setServiceSpecificResult(String serviceSpecificResult) {
setParameters(KEY_SERVICE_SPECIFIC_RESULT, serviceSpecificResult);
return this;
}
/**
* The service can provide specific result strings to the consumer through this param.
*
* @return serviceSpecificResult
*/
public String getServiceSpecificResult() {
return getString(KEY_SERVICE_SPECIFIC_RESULT);
}
}
| {
"content_hash": "d18e786677a47680b757f46f83bffa1f",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 104,
"avg_line_length": 30.25,
"alnum_prop": 0.7228650137741047,
"repo_name": "smartdevicelink/sdl_android",
"id": "d8ed259ac47de5ea650c06ecfc1b7b541900947e",
"size": "3420",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "base/src/main/java/com/smartdevicelink/proxy/rpc/PerformAppServiceInteractionResponse.java",
"mode": "33188",
"license": "bsd-3-clause",
"language": [
{
"name": "Java",
"bytes": "4666491"
}
],
"symlink_target": ""
} |
<div class="row">
<div class="col-sm-12 jobs">
<p class="plume">Private</p>
<div class="row job-container">
<!-- -->
<!-- CalcJur -->
<!-- -->
<div class="col-12 job-col">
<p class="plume job-title">CalcJur</p>
<div class="row">
<div class="col-12 col-md-5 order-1 order-md-1 job-img">
<img class="img-responsive" src="../assets/images/portfolio/calcjur.png">
</div>
<div class="col-12 col-md-7 order-2 order-md-2">
<p>Rails project created to calculate a person's work time in order to use its results in juridical actions. The purpose of the project is to grow and become a web juridical system containing various modules for different areas of law.</p>
<div>
<a href="http://calc-jur.herokuapp.com" target="_blank" class="btn btn-red">
<i class="fa fa-desktop"></i> Demo
</a>
</div>
</div>
</div>
</div>
<!-- -->
<!-- CalcJur -->
<!-- -->
<!-- -->
<!-- Monitoring Emotions -->
<!-- -->
<div class="col-12 job-col">
<p class="plume job-title">Monitoring Emotions</p>
<div class="row">
<div class="col-12 col-md-5 order-1 order-md-2 job-img">
<img class="img-responsive" src="../assets/images/portfolio/monitoringemotions.png">
</div>
<div class="col-12 col-md-7 order-2 order-md-1">
<p>This Rails project was developed to be used on a master's degree presentation. It is a system that access a webcam and take photos from the user to be processed by another service, returning his/her emotion.</p>
<p>It also includes a music player section which plays songs according to the detected emotion and user preferences. It holds users registration, statistics and web service and socket integration.</p>
</div>
</div>
</div>
<!-- -->
<!-- Monitoring Emotions -->
<!-- -->
<!-- -->
<!-- PlusFasttInternet -->
<!-- -->
<div class="col-12 job-col">
<p class="plume job-title">PlusFasttInternet</p>
<div class="row">
<div class="col-12 col-md-5 order-1 order-md-1 job-img">
<img class="img-responsive" src="../assets/images/portfolio/plusfasttinternet.png">
</div>
<div class="col-12 col-md-7 order-2 order-md-2">
<p>System developed to control the clients's payment of an Internet provider. Basically composed by a CRUD of clients and payments. The client is only able to check his/her payments while the admin can access all the system, in another words, it has access control.</p>
</div>
</div>
</div>
<!-- -->
<!-- PlusFasttInternet -->
<!-- -->
<!-- -->
<!-- LeggrandDDNS -->
<!-- -->
<div class="col-12 job-col">
<p class="plume job-title">Leggrand DDNS</p>
<div class="row">
<div class="col-12 col-md-5 order-1 order-md-2 job-img">
<img class="img-responsive" src="../assets/images/portfolio/legrandddns.png">
</div>
<div class="col-12 col-md-7 order-2 order-md-1">
<p>Ruby desktop application developed to update automatically the IP on Legrand DDNS website. This is useful on connections with dynamic IPs that needs to communicate with a external service by using a DNS name.</p>
<p>On this case it was a house monitoring system. To avoid the user to keep looking his connection all the time, it is necessary only to setup this tool and it will do all the job when IP changes.</p>
</div>
</div>
</div>
<!-- -->
<!-- LeggrandDDNS -->
<!-- -->
<!-- -->
<!-- PlayRadio -->
<!-- -->
<div class="col-12 job-col">
<p class="plume job-title">PlayRadio</p>
<div class="row">
<div class="col-12 col-md-5 order-1 order-md-1 job-img">
<img class="img-responsive" src="../assets/images/portfolio/playradio.png">
</div>
<div class="col-12 col-md-7 order-2 order-md-2">
<p>Web radio that allows the user to select a playlist and keep playing all day long, loading more musics automatically when the list is getting on the end. Another functionality is to request custom advertisements to play on your place, this part counts with lots of audio uploads.</p>
<p>The most part of the job on this project was done on frontend by communicating with its own API to get all data necessary to render the page correctly. This project also uses Rails ActionCable (WebSockets) to validate the current state of the user on page by allowing or not him to keep playing the musics, advertisements and alerts.</p>
</div>
</div>
</div>
<!-- -->
<!-- PlayRadio -->
<!-- -->
<!-- -->
<!-- OnJuri -->
<!-- -->
<div class="col-12 job-col">
<p class="plume job-title">OnJuri</p>
<div class="row">
<div class="col-12 col-md-5 order-1 order-md-2 job-img">
<img class="img-responsive" src="../assets/images/portfolio/onjuri.png">
</div>
<div class="col-12 col-md-7 order-2 order-md-1">
<p>Startup initialized on my post graduation. This system is suposed to be a place bring together all information and document necessary to a lawyer do his job safe and comfortable.</p>
<p>The plataform is splited in services as modules. It is possible to attach a client to different modules (CalcJur listed here is one of this module).</p>
<p>The project also counts with a guest area that allows the lawyer's clients to access their shared information to keep following the service provided.</p>
</div>
</div>
</div>
<!-- -->
<!-- OnJuri -->
<!-- -->
</div>
</div>
</div>
| {
"content_hash": "e60e9efc22d816d9ffc210046b6c1308",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 352,
"avg_line_length": 43.410071942446045,
"alnum_prop": 0.5793834935366258,
"repo_name": "felipegruoso/portfolio",
"id": "ca1ca24ea03b1296b09a5f9b65502c0cc6c73e95",
"size": "6034",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/partials/portfolio/private.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "9868"
},
{
"name": "HTML",
"bytes": "33569"
},
{
"name": "JavaScript",
"bytes": "3148"
},
{
"name": "Makefile",
"bytes": "33"
}
],
"symlink_target": ""
} |
import React from 'react';
import StyleSheet from 'react-style';
import {
Paper,
} from 'material-ui';
import colors from '../utils/colors';
class ConvoList extends React.Component {
render() {
let convos = this.props.convos.map((c) => {
let selected = this.props.curConvo && c.id === this.props.curConvo.id;
let convStyles = selected ? [styles.convo, styles.selectedConvo] : [styles.convo];
return (
<div
styles={convStyles}
onClick={this._onConvoChanged.bind(this, c.id)}
key={c.id}>
{c.name}
</div>
);
});
return (
<div styles={[styles.scroll]}>
<Paper style={styles.convos}>
{convos}
</Paper>
</div>
);
}
_onConvoChanged(id) {
if(this.props.onConvoChanged) {
this.props.onConvoChanged(id);
}
}
}
ConvoList.propTypes = {
convos: React.PropTypes.array,
curConvo: React.PropTypes.object,
onConvoChanged: React.PropTypes.func,
};
const styles = StyleSheet.create({
convos: {
margin: 8,
marginTop: 16,
},
convo: {
padding: 16,
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
},
selectedConvo: {
color: colors.primary,
backgroundColor: '#f0f0f0',
},
scroll: {
position: 'absolute',
top: 0,
bottom: 0,
left: 0,
right: 0,
overflow: 'auto',
},
});
export default ConvoList;
| {
"content_hash": "fcfd62045e173af17dab61b46d34ed3f",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 88,
"avg_line_length": 19.930555555555557,
"alnum_prop": 0.5818815331010453,
"repo_name": "janicduplessis/imessage-client",
"id": "3553c8836aa2725fcdcb8d7bfcd8374af552bb90",
"size": "1435",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "src/client/components/ConvoList.js",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "CSS",
"bytes": "1898"
},
{
"name": "JavaScript",
"bytes": "56926"
}
],
"symlink_target": ""
} |
<!DOCTYPE HTML>
<html>
<head>
<title>ABC</title>
<meta charset='utf-8' />
<style>.css-tag { color:red; }</style>
<link src="{{CSSPATH}}" rel="stylesheet" type="text/css" media="all" />
<script>alert("hello world2222!")</script>
<script src="{{JSPATH}}" type="text/javascript"></script>
</head>
<body>
<div>Hello!</div>
</body>
</html> | {
"content_hash": "865deadcc47464f098369e54228d565b",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 81,
"avg_line_length": 30.142857142857142,
"alnum_prop": 0.5071090047393365,
"repo_name": "xunuo/test1",
"id": "c7bc185998cd83a4fb83e57664a0b39e457bef8d",
"size": "422",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "pages/1/hello.html",
"mode": "33188",
"license": "mit",
"language": [
{
"name": "HTML",
"bytes": "1028"
},
{
"name": "JavaScript",
"bytes": "359"
}
],
"symlink_target": ""
} |
FROM balenalib/orange-pi-lite-ubuntu:focal-build
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates \
\
# .NET Core dependencies
libc6 \
libgcc1 \
libgssapi-krb5-2 \
libicu66 \
libssl1.1 \
libstdc++6 \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
ENV \
# Configure web servers to bind to port 80 when present
ASPNETCORE_URLS=http://+:80 \
# Enable detection of running in a container
DOTNET_RUNNING_IN_CONTAINER=true
# Install .NET Core SDK
ENV DOTNET_SDK_VERSION 5.0.403
RUN curl -SL --output dotnet.tar.gz "https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-arm.tar.gz" \
&& dotnet_sha512='1b7b4a8aea62a7fd1e1919710b2b35b41ae31a64f79b4cc056a3e5f4778bb6cc0b92999321e1632f29a1eb88d734e44fc42eea52ddfb8aa0424cafd9796a503c' \
&& echo "$dotnet_sha512 dotnet.tar.gz" | sha512sum -c - \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
# Enable correct mode for dotnet watch (only mode supported in a container)
ENV DOTNET_USE_POLLING_FILE_WATCHER=true \
# Skip extraction of XML docs - generally not useful within an image/container - helps performance
NUGET_XMLDOC_MODE=skip \
DOTNET_NOLOGO=true
# Trigger first run experience by running arbitrary cmd to populate local package cache
RUN dotnet help
CMD ["echo","'No CMD command was set in Dockerfile! Details about CMD command could be found in Dockerfile Guide section in our Docs. Here's the link: https://balena.io/docs"]
RUN curl -SLO "https://raw.githubusercontent.com/balena-io-library/base-images/44e597e40f2010cdde15b3ba1e397aea3a5c5271/scripts/assets/tests/[email protected]" \
&& echo "Running test-stack@dotnet" \
&& chmod +x [email protected] \
&& bash [email protected] \
&& rm -rf [email protected]
RUN [ ! -d /.balena/messages ] && mkdir -p /.balena/messages; echo 'Here are a few details about this Docker image (For more information please visit https://www.balena.io/docs/reference/base-images/base-images/): \nArchitecture: ARM v7 \nOS: Ubuntu focal \nVariant: build variant \nDefault variable(s): UDEV=off \nThe following software stack is preinstalled: \ndotnet 5.0-sdk \nExtra features: \n- Easy way to install packages with `install_packages <package-name>` command \n- Run anywhere with cross-build feature (for ARM only) \n- Keep the container idling with `balena-idle` command \n- Show base image details with `balena-info` command' > /.balena/messages/image-info
RUN echo '#!/bin/sh.real\nbalena-info\nrm -f /bin/sh\ncp /bin/sh.real /bin/sh\n/bin/sh "$@"' > /bin/sh-shim \
&& chmod +x /bin/sh-shim \
&& cp /bin/sh /bin/sh.real \
&& mv /bin/sh-shim /bin/sh | {
"content_hash": "6e844441ca9287d4e078ce804af85581",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 677,
"avg_line_length": 52.285714285714285,
"alnum_prop": 0.7100409836065574,
"repo_name": "resin-io-library/base-images",
"id": "f5d83febd5e0239d751bbedac35721069f43e583",
"size": "2949",
"binary": false,
"copies": "1",
"ref": "refs/heads/master",
"path": "balena-base-images/dotnet/orange-pi-lite/ubuntu/focal/5.0-sdk/build/Dockerfile",
"mode": "33188",
"license": "apache-2.0",
"language": [
{
"name": "Dockerfile",
"bytes": "71234697"
},
{
"name": "JavaScript",
"bytes": "13096"
},
{
"name": "Shell",
"bytes": "12051936"
},
{
"name": "Smarty",
"bytes": "59789"
}
],
"symlink_target": ""
} |
Subsets and Splits