text
stringlengths
2
1.04M
meta
dict
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in Jard. Malmaison 2: ad t. 82. 1804 #### Original name null ### Remarks null
{ "content_hash": "90cc4b178d327185a3e1e63ce7947bf3", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 12.461538461538462, "alnum_prop": 0.6851851851851852, "repo_name": "mdoering/backbone", "id": "3aeda8e496c4cb53312ca6a36b8defdb88203346", "size": "217", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Asterales/Asteraceae/Felicia/Felicia muricata/ Syn. Aster filifolius/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
日英だけ切り替えたい. 用意されているのものは多言語に対応しているので、日本語以外をすべて英語にするResolverを実装する. ###LocaleResolverの実装 日本語以外は英語にするLocaleResolver ```java package com.duck8823.web.servlet.i18n; import org.springframework.context.i18n.LocaleContext; import org.springframework.context.i18n.SimpleLocaleContext; import org.springframework.web.servlet.LocaleContextResolver; import org.springframework.web.util.WebUtils; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.Locale; public class SessionLocaleResolver implements LocaleContextResolver { public static final String LOCALE_SESSION_ATTRIBUTE_NAME = SessionLocaleResolver.class.getName() + ".LOCALE"; @Override public LocaleContext resolveLocaleContext(HttpServletRequest request) { return new SimpleLocaleContext(resolveLocale(request)); } @Override public void setLocaleContext(HttpServletRequest request, HttpServletResponse response, LocaleContext localeContext) { Locale locale = null; if(localeContext != null) { locale = localeContext.getLocale(); } WebUtils.setSessionAttribute(request, LOCALE_SESSION_ATTRIBUTE_NAME, locale); } @Override public Locale resolveLocale(HttpServletRequest request) { Locale locale = (Locale)WebUtils.getSessionAttribute(request, LOCALE_SESSION_ATTRIBUTE_NAME); if(locale != null) { return locale; } return selectLocale(request.getLocale()); } @Override public void setLocale(HttpServletRequest request, HttpServletResponse response, Locale locale) { this.setLocaleContext(request, response, locale != null?new SimpleLocaleContext(selectLocale(locale)):null); } protected Locale selectLocale(Locale locale){ if(locale == null){ return null; } if(locale.getLanguage().equals(Locale.JAPANESE.getLanguage())){ return Locale.JAPANESE; } else { return Locale.ENGLISH; } } } ``` ###Beanの設定 @Configurationクラスで各種Beanを登録する MappingInterceptorで言語切り替えを実施するURL指定. ```java @Bean public MappedInterceptor interceptor(){ return new MappedInterceptor(new String[]{"/**"}, localeChangeInterceptor()); } ``` URLの「lang」パラメータで切り替えできるようにする ```java @Bean public LocaleChangeInterceptor localeChangeInterceptor() { LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); localeChangeInterceptor.setParamName("lang"); return localeChangeInterceptor; } ``` 実装したLocaleResolverをBeanに登録する ```java @Bean public SessionLocaleResolver localeResolver() { return new SessionLocaleResolver(); } ``` ###多言語用ファイルの作成と設定 @Configurationクラスで以下のBeanを登録 ResourceBundleMessageSource#setBasenameで多言語用ファイルの名前を指定する. 以下の場合、messages_ja.propertiesで日本語用、messages_en.propertiesで英語用になる. ```java @Bean public ResourceBundleMessageSource messageSource() { ResourceBundleMessageSource messageSource = new ResourceBundleMessageSource(); messageSource.setBasename("messages"); messageSource.setDefaultEncoding("UTF-8"); return messageSource; } ``` ####ファイルの作成 messages_ja.properties ``` hoge=ほげ ``` messages_en.properties ``` hoge=Hoge ``` ####Thymeleafでのアクセス Thymeleafでプロパティにアクセスする場合は、#{プロパティ名} ``` <span th:text="#{hoge}"></span> ``` パラメータ lang=ja ``` ほげ ``` パラメータ lang=en ``` Hoge ```
{ "content_hash": "c45d4b60f4ca0f5ef627cc1fbbb8a6e5", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 118, "avg_line_length": 25.588709677419356, "alnum_prop": 0.7860069335014183, "repo_name": "duck8823/demo", "id": "7060485584bb5909db8c05cd01288ffaf3730d81", "size": "3652", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "doc/i18n.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3263" }, { "name": "HTML", "bytes": "25547" }, { "name": "Java", "bytes": "90650" }, { "name": "JavaScript", "bytes": "20979" } ], "symlink_target": "" }
package org.sqldroid; import java.io.File; import java.lang.reflect.Constructor; import java.sql.Array; import java.sql.Blob; import java.sql.CallableStatement; import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.NClob; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLClientInfoException; import java.sql.SQLException; import java.sql.SQLFeatureNotSupportedException; import java.sql.SQLWarning; import java.sql.SQLXML; import java.sql.Savepoint; import java.sql.Statement; import java.sql.Struct; import java.util.HashMap; import java.util.Map; import java.util.Properties; import java.util.concurrent.Executor; public class SQLDroidConnection implements Connection { /** * A map to a single instance of a SQLiteDatabase per DB. */ private static final Map<String, SQLiteDatabase> dbMap = new HashMap<String, SQLiteDatabase>(); /** * A map from a connection to a SQLiteDatabase instance. * Used to track the use of each instance, and close the database when last conneciton is closed. */ private static final Map<SQLDroidConnection, SQLiteDatabase> clientMap = new HashMap<SQLDroidConnection, SQLiteDatabase>(); /** The Android sqlitedb. */ private SQLiteDatabase sqlitedb; private boolean autoCommit = true; /** Will have the value 9 or greater the version of SQLException has the constructor: * SQLException(Throwable theCause) otherwise false. * API levels 9 or greater have this constructor. * If the value is positive and less than 9 then the SQLException does not have the constructor. * If the value is &lt; 0 then the capabilities of SQLException have not been determined. */ protected static int sqlThrowable = -1; /** * A cached prepare statement for the count of changed rows */ private PreparedStatement changedRowsCountStatement = null; /** * A cached prepare statement for the last row id generated by the database */ private PreparedStatement generatedRowIdStatement = null; private final String url; private int transactionIsolation = TRANSACTION_SERIALIZABLE; /** Connect to the database with the given url and properties. * * @param url the URL string, typically something like * "jdbc:sqlite:/data/data/your-package/databasefilename" so for example: * "jdbc:sqlite:/data/data/org.sqldroid.examples/databases/sqlite.db" * @param info Properties object with options. Supported options are "timeout", "retry", and "shared". */ public SQLDroidConnection(String url, Properties info) throws SQLException { Log.v("SQLDroidConnection: " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); Log.v("New sqlite jdbc from url '" + url + "', " + "'" + info + "'"); this.url = url; // Make a filename from url String dbQname; if(url.startsWith(SQLDroidDriver.xerialPrefix)) { dbQname = url.substring(SQLDroidDriver.xerialPrefix.length()); } else { // there does not seem to be any possibility of error handling. // So we could check that the url starts with SQLDroidDriver.sqldroidPrefix // but if it doesn't there's nothing we can do (no Exception is specified) // so it has to be assumed that the URL is valid when passed to this method. dbQname = url.substring(SQLDroidDriver.sqldroidPrefix.length()); } long timeout = 0; // default to no retries to be consistent with other JDBC implemenations. long retryInterval = 50; // this was 1000 in the original code. 1 second is too long for each loop. int queryPart = dbQname.indexOf('?'); // if there's a query part, we accept "timeout=xxx" and "retry=yyy" if ( queryPart > 0 ) { dbQname = dbQname.substring(0, queryPart); String options = dbQname.substring(queryPart); while (options.length() > 0) { int optionEnd = options.indexOf('&'); if (optionEnd == -1) { optionEnd = options.length(); } int equals = options.lastIndexOf('=', optionEnd); String optionName = options.substring(0, equals).trim(); String optionValueString = options.substring(equals+1, optionEnd).trim(); long optionValue; try { optionValue = Long.parseLong(optionValueString); if (optionName.equals("timeout")) { timeout = optionValue; } else if (optionName.equals("retry")) { timeout = optionValue; retryInterval = optionValue; } Log.v("Timeout: " + timeout); } catch ( NumberFormatException nfe ) { // print and ignore Log.e("Error Parsing URL \"" + url + "\" Timeout String \"" + optionValueString + "\" is not a valid long", nfe); } options = options.substring(optionEnd + 1); } } Log.v("opening database " + dbQname); ensureDbFileCreation(dbQname); int flags = android.database.sqlite.SQLiteDatabase.CREATE_IF_NECESSARY | android.database.sqlite.SQLiteDatabase.OPEN_READWRITE | android.database.sqlite.SQLiteDatabase.NO_LOCALIZED_COLLATORS; if ( info != null ) { if ( info.getProperty(SQLDroidDriver.DATABASE_FLAGS) != null ) { try { flags = Integer.parseInt(info.getProperty(SQLDroidDriver.DATABASE_FLAGS)); } catch ( NumberFormatException nfe ) { Log.e("Error Parsing DatabaseFlags \"" + info.getProperty(SQLDroidDriver.DATABASE_FLAGS) + " not a number ", nfe); } } else if ( info.getProperty(SQLDroidDriver.ADDITONAL_DATABASE_FLAGS) != null ) { try { int extraFlags = Integer.parseInt(info.getProperty(SQLDroidDriver.ADDITONAL_DATABASE_FLAGS)); flags |= extraFlags; } catch ( NumberFormatException nfe ) { Log.e("Error Parsing DatabaseFlags \"" + info.getProperty(SQLDroidDriver.ADDITONAL_DATABASE_FLAGS) + " not a number ", nfe); } } } synchronized(dbMap) { sqlitedb = dbMap.get(dbQname); if (sqlitedb == null) { Log.i("SQLDroidConnection: " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this + " Opening new database: " + dbQname); sqlitedb = new SQLiteDatabase(dbQname, timeout, retryInterval, flags); dbMap.put(dbQname, sqlitedb); } clientMap.put(this, sqlitedb); } } private void ensureDbFileCreation(String dbQname) throws SQLException { File dbFile = new File(dbQname); if (dbFile.isDirectory()) { throw new SQLException("Can't create " + dbFile + " - it already exists as a directory"); } else if (dbFile.getParentFile().exists() && !dbFile.getParentFile().isDirectory()) { throw new SQLException("Can't create " + dbFile + " - it because " + dbFile.getParent() + " exists as a regular file"); } else if (!dbFile.getParentFile().exists()) { dbFile.getParentFile().mkdirs(); if (!dbFile.getParentFile().isDirectory()) { throw new SQLException("Could not create " + dbFile.getParent() + " as parent directory for " + dbFile); } } } /** Returns the delegate SQLiteDatabase. */ public SQLiteDatabase getDb() { return sqlitedb; } @Override public void clearWarnings() throws SQLException { } /** This will create and return an exception. For API levels less than 9 this will return * a SQLDroidSQLException, for later APIs it will return a SQLException. */ public static SQLException chainException(android.database.SQLException sqlException) { if ( sqlThrowable < 0 || sqlThrowable >= 9 ) { try { sqlThrowable = 9; //return new SQLException (sqlException); // creating by reflection is significantly slower, but since Exceptions should be unusual // this should not be a performance issue. final Constructor<?> c = SQLException.class.getDeclaredConstructor(new Class[] {Throwable.class}); return (SQLException)c.newInstance(new Object[]{sqlException}); } catch ( Exception e) { sqlThrowable = 1; } } // if the code above worked correctly, then the exception will have been returned. Otherwise, we need // to go through this clause and create a SQLDroidSQLException try { // avoid a direct reference to the sqldroidSQLException so that app > API level 9 do not need that class. final Constructor<?> c = SQLDroidConnection.class.getClassLoader().loadClass("org.sqldroid.SQLDroidSQLException").getDeclaredConstructor(new Class[] {android.database.SQLException.class}); // SQLDroidSQLException is an instance of (direct subclass of) SQLException, so the cast below is correct although // the instance created will always be a SQLDroidSQLException return (SQLException)c.newInstance(new Object[]{sqlException}); } catch (Exception e) { return new SQLException ("Unable to Chain SQLException " + sqlException.getMessage()); } } @Override public void close() throws SQLException { Log.v("SQLDroidConnection.close(): " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); if (sqlitedb != null) { synchronized(dbMap) { clientMap.remove(this); if (!clientMap.containsValue(sqlitedb)) { Log.i("SQLDroidConnection.close(): " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this + " Closing the database since since last connection was closed."); setAutoCommit(true); sqlitedb.close(); dbMap.remove(sqlitedb.dbQname); } } sqlitedb = null; } else { Log.e("SQLDroidConnection.close(): " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this + " Duplicate close!"); } } @Override public void commit() throws SQLException { if (autoCommit) { throw new SQLException("database in auto-commit mode"); } sqlitedb.setTransactionSuccessful(); Log.d("END TRANSACTION (commit) " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); sqlitedb.endTransaction(); Log.d("BEGIN TRANSACTION (after commit) " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); sqlitedb.beginTransaction(); } @Override public Statement createStatement() throws SQLException { return new SQLDroidStatement(this); } @Override public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { return createStatement(resultSetType, resultSetConcurrency, ResultSet.CLOSE_CURSORS_AT_COMMIT); } @Override public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { if (resultSetType != ResultSet.TYPE_FORWARD_ONLY) { throw new SQLFeatureNotSupportedException("createStatement supported with TYPE_FORWARD_ONLY"); } if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) { throw new SQLFeatureNotSupportedException("createStatement supported with CONCUR_READ_ONLY"); } if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { throw new SQLFeatureNotSupportedException("createStatement supported with CLOSE_CURSORS_AT_COMMIT"); } return createStatement(); } @Override public boolean getAutoCommit() throws SQLException { return autoCommit; } @Override public String getCatalog() throws SQLException { return null; } @Override public int getHoldability() throws SQLException { return ResultSet.CLOSE_CURSORS_AT_COMMIT; } @Override public DatabaseMetaData getMetaData() throws SQLException { return new SQLDroidDatabaseMetaData(this); } @Override public int getTransactionIsolation() throws SQLException { return transactionIsolation; } @Override public Map<String, Class<?>> getTypeMap() throws SQLException { throw new SQLFeatureNotSupportedException("getTypeMap not supported"); } @Override public SQLWarning getWarnings() throws SQLException { // TODO: Is this a sufficient implementation? (If so, delete comment and logging) Log.e(" ********************* not implemented @ " + DebugPrinter.getFileName() + " line " + DebugPrinter.getLineNumber()); return null; } @Override public boolean isClosed() throws SQLException { // assuming that "isOpen" doesn't throw a locked exception.. return sqlitedb == null || sqlitedb.getSqliteDatabase() == null || !sqlitedb.getSqliteDatabase().isOpen(); } @Override public boolean isReadOnly() throws SQLException { return false; } @Override public String nativeSQL(String sql) throws SQLException { return sql; } @Override public CallableStatement prepareCall(String sql) throws SQLException { return prepareCall(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT); } @Override public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return prepareCall(sql, resultSetType, resultSetConcurrency, ResultSet.CLOSE_CURSORS_AT_COMMIT); } @Override public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { throw new SQLFeatureNotSupportedException("prepareCall not supported"); } @Override public PreparedStatement prepareStatement(String sql) throws SQLException { return prepareStatement(sql, PreparedStatement.NO_GENERATED_KEYS); } @Override public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { return new SQLDroidPreparedStatement(sql, this, autoGeneratedKeys); } @Override public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { throw new SQLFeatureNotSupportedException("prepareStatement(String,int[]) not supported"); } @Override public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { throw new SQLFeatureNotSupportedException("prepareStatement(String,String[]) not supported"); } @Override public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { return prepareStatement(sql, resultSetType, resultSetConcurrency, ResultSet.CLOSE_CURSORS_AT_COMMIT); } @Override public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { if (resultSetType != ResultSet.TYPE_FORWARD_ONLY) { throw new SQLFeatureNotSupportedException("createStatement supported with TYPE_FORWARD_ONLY"); } if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) { throw new SQLFeatureNotSupportedException("createStatement supported with CONCUR_READ_ONLY"); } if (resultSetHoldability != ResultSet.CLOSE_CURSORS_AT_COMMIT) { throw new SQLFeatureNotSupportedException("createStatement supported with CLOSE_CURSORS_AT_COMMIT"); } return prepareStatement(sql); } @Override public void releaseSavepoint(Savepoint savepoint) throws SQLException { // TODO: Implemented in Xerial as db.exec(String.format("RELEASE SAVEPOINT %s", savepoint.getSavepointName())); throw new SQLFeatureNotSupportedException("releaseSavepoint not supported"); } @Override public void rollback() throws SQLException { if (autoCommit) { throw new SQLException("database in auto-commit mode"); } Log.d("END TRANSACTION (rollback) " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); sqlitedb.endTransaction(); Log.d("BEGIN TRANSACTION (after rollback) " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); sqlitedb.beginTransaction(); } @Override public void rollback(Savepoint savepoint) throws SQLException { // TODO: Implemented in Xerial as db.exec(String.format("ROLLBACK TO SAVEPOINT %s", savepoint.getSavepointName())); throw new SQLFeatureNotSupportedException("rollback not supported"); } @Override public void setAutoCommit(boolean autoCommit) throws SQLException { if (this.autoCommit == autoCommit) { return; } this.autoCommit = autoCommit; if (autoCommit) { if (sqlitedb.inTransaction()) { // to be on safe side. sqlitedb.setTransactionSuccessful(); Log.d("END TRANSACTION (autocommit on) " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); sqlitedb.endTransaction(); } } else { Log.d("BEGIN TRANSACTION (autocommit off) " + Thread.currentThread().getId() + " \"" + Thread.currentThread().getName() + "\" " + this); sqlitedb.beginTransaction(); } } @Override public void setCatalog(String catalog) throws SQLException { // From spec: // If the driver does not support catalogs, it will silently ignore this request. } @Override public void setHoldability(int holdability) throws SQLException { if (holdability != ResultSet.CLOSE_CURSORS_AT_COMMIT) throw new SQLException("SQLDroid only supports CLOSE_CURSORS_AT_COMMIT"); } @Override public void setReadOnly(boolean readOnly) throws SQLException { if (readOnly != isReadOnly()) { throw new SQLException("Cannot change read-only flag after establishing a connection"); } } @Override public Savepoint setSavepoint() throws SQLException { // TODO: In Xerial: db.exec(String.format("SAVEPOINT %s", sp.getSavepointName())) throw new SQLFeatureNotSupportedException("setSavepoint not supported"); } @Override public Savepoint setSavepoint(String name) throws SQLException { throw new SQLFeatureNotSupportedException("setSavepoint not supported"); } @Override public void setTransactionIsolation(int level) throws SQLException { // TODO: Xerial implements this with PRAGMA read_uncommitted if (level != TRANSACTION_SERIALIZABLE) { throw new SQLException("SQLDroid supports only TRANSACTION_SERIALIZABLE."); } transactionIsolation = level; } @Override public void setTypeMap(Map<String, Class<?>> arg0) throws SQLException { throw new SQLFeatureNotSupportedException("setTypeMap not supported"); } @Override protected void finalize() throws Throwable { Log.v(" --- Finalize SQLDroid."); if (!isClosed()) { close(); } super.finalize(); } @Override public boolean isWrapperFor(Class<?> iface) throws SQLException { return iface != null && iface.isAssignableFrom(getClass()); } @Override public <T> T unwrap(Class<T> iface) throws SQLException { if (isWrapperFor(iface)) { return (T) this; } throw new SQLException(getClass() + " does not wrap " + iface); } @Override public Array createArrayOf(String typeName, Object[] elements) throws SQLException { throw new SQLFeatureNotSupportedException("createArrayOf not supported"); } @Override public Blob createBlob() throws SQLException { // TODO: Can return new SQLDroidBlob(new byte[0]) once setBytes is implemented throw new SQLFeatureNotSupportedException("createBlob not supported"); } @Override public SQLDroidClob createClob() throws SQLException { // TODO: Can return new SQLDroidClob("") once setString is implemented throw new SQLFeatureNotSupportedException("createClob not supported"); } @Override public NClob createNClob() throws SQLException { return createClob(); } @Override public SQLXML createSQLXML() throws SQLException { throw new SQLFeatureNotSupportedException("createSQLXML not supported"); } @Override public Struct createStruct(String typeName, Object[] attributes) throws SQLException { throw new SQLFeatureNotSupportedException("createStruct not supported"); } @Override public Properties getClientInfo() throws SQLException { // TODO Evaluate if this is a sufficient implementation (if so, remove this comment) return new Properties(); } @Override public String getClientInfo(String name) throws SQLException { // TODO Evaluate if this is a sufficient implementation (if so, remove this comment) return null; } @Override public boolean isValid(int timeout) throws SQLException { // TODO createStatement().execute("select 1"); return true; } @Override public void setClientInfo(Properties properties) throws SQLClientInfoException { // TODO Evaluate if this is a sufficient implementation (if so, remove this comment) } @Override public void setClientInfo(String name, String value) throws SQLClientInfoException { // TODO Evaluate if this is a sufficient implementation (if so, remove this comment) } /** * @return Where the database is located. */ public String url() { return url; } // methods added for JDK7 compilation public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { throw new SQLFeatureNotSupportedException("setNetworkTimeout not supported"); } public int getNetworkTimeout() throws SQLException { throw new SQLFeatureNotSupportedException("getNetworkTimeout not supported"); } public void abort(Executor executor) throws SQLException { close(); } public String getSchema() throws SQLException { return null; } public void setSchema(String schema) throws SQLException { } /** * @return The number of database rows that were changed or inserted or deleted * by the most recently completed INSERT, DELETE, or UPDATE statement. * * @throws SQLException */ public int changedRowsCount() { int changedRows = -1; try { changedRowsCountStatement = getChangedRowsCountStatement(); ResultSet changedRowsCountResultSet = changedRowsCountStatement.executeQuery(); if (changedRowsCountResultSet != null && changedRowsCountResultSet.first()) { changedRows = (int) changedRowsCountResultSet.getLong(1); // System.out.println("In SQLDroidConnection.changedRowsCount(), changedRows=" + changedRows); } changedRowsCountResultSet.close(); } catch (SQLException e) { // ignore } return changedRows; } /** * @return A cached prepare statement for the last row id generated * by the database when executing an INSERT statement or create a * new prepare statement and then return that. * * @throws SQLException */ public ResultSet getGeneratedRowIdResultSet() throws SQLException { if (generatedRowIdStatement == null) { generatedRowIdStatement = prepareStatement("select last_insert_rowid();"); } return generatedRowIdStatement.executeQuery(); } /** * @return A cached prepare statement for the count of changed rows or create one and return that. * * @throws SQLException */ private PreparedStatement getChangedRowsCountStatement() throws SQLException { if (changedRowsCountStatement == null) { changedRowsCountStatement = prepareStatement("select changes();"); } return changedRowsCountStatement; } }
{ "content_hash": "44ddfec79734bcedb8fbddc5697fdd08", "timestamp": "", "source": "github", "line_count": 619, "max_line_length": 215, "avg_line_length": 40.49596122778675, "alnum_prop": 0.6546455499261978, "repo_name": "dperiwal/SQLDroid", "id": "c36763fe6461cc316e6ba47b0ddae327d9790112", "size": "25067", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/sqldroid/SQLDroidConnection.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "259675" }, { "name": "Ruby", "bytes": "3275" } ], "symlink_target": "" }
ZyLinkLable={ _menu=nil, _menuItem=nil, _label=nil, _userData=nil, } --创建一个有下划线的文本按钮 --text文本内容(必填) color 颜色 fontname 字体 fontsize 字号,是否有下划线 function ZyLinkLable:new(text,color,fontname,fontsize,width,isLine) local instance = {} setmetatable(instance, self) self.__index = self if fontname == nil then fontname = FONT_NAME; end if fontsize == nil then fontsize = FONT_SM_SIZE; end if color == nil then color=NdColor:colorWhite(); end local subStr = text local nLine = nil local nRow = 0 local lengthList = {} while true do nLine,subStr = ZyFont.subString(subStr,width,fontname,fontsize) if nLine ~= nil then nRow = nRow + 1 lengthList[nRow] = ZyFont.stringWidth(nLine,fontname,fontsize) if lengthList[nRow] < fontsize then lengthList[nRow] = fontsize end end if subStr == nil then break; end end if nRow < 1 then nRow = 1 end local labelChange = nil if nRow > 1 then local lable=CCLabelTTF:create(Language.IDS_SURE,fontname,fontsize) local szContent = ZyFont.stringSize(text,width, fontname, fontsize); szContent.height=nRow*lable:getContentSize().height labelChange = CCLabelTTF:create(text,szContent,CCTextAlignmentLeft, FONT_NAME,fontsize) else labelChange = CCLabelTTF:create(text, fontname, fontsize); end labelChange:setColor(color); local ChangeMenuItem = CCMenuItemLabel:create(labelChange); ChangeMenuItem:setContentSize(SZ(labelChange:getContentSize().width,labelChange:getContentSize().height)) ChangeMenuItem:setPosition(PT(ChangeMenuItem:getContentSize().width/2,ChangeMenuItem:getContentSize().height/2)) ChangeMenuItem:setAnchorPoint(PT(0.5, 0.5)) color = ccc4(color.r, color.g, color.b,255) local nHeight = labelChange:getContentSize().height/nRow if isLine then for i=1,nRow do local lineNode = ScutLineNode:lineWithPoint(PT(0,nHeight*(nRow-i)), PT(lengthList[i], nHeight*(nRow-i)), 1, color) ChangeMenuItem:addChild(lineNode, 0) end end local changeMenu = CCMenu:createWithItem(ChangeMenuItem) changeMenu:setContentSize(ChangeMenuItem:getContentSize()) changeMenu:setAnchorPoint(PT(0, 0)) instance._menu = changeMenu instance._menuItem = ChangeMenuItem instance._label = labelChange return instance end function ZyLinkLable:setUserData(data) self._userData=data end function ZyLinkLable:getUserData() return self._userData end function ZyLinkLable:getParent() return self._menu:getParent(); end function ZyLinkLable:registerScriptHandler(event) gClassPool[self._menuItem] = self self._menuItem:registerScriptHandler(event) end function ZyLinkLable:setPosition(point) self._menu:setPosition(point) end function ZyLinkLable:getPosition() return self._menu:getPosition() end function ZyLinkLable:setTag(tag) self._menuItem:setTag(tag) end function ZyLinkLable:getTag() return self._menuItem:getTag() end function ZyLinkLable:getContentSize() return self._menu:getContentSize() end function ZyLinkLable:addto(parent, param1, param2) if type(param1) == "userdata" then parent:addChildItem(self._menu, param1) else if param2 then parent:addChild(self._menu, param1, param2) elseif param1 then parent:addChild(self._menu, param1) else parent:addChild(self._menu, 0) end end end function ZyLinkLable:setVisible(visible) self._menu:setVisible(visible) end function ZyLinkLable:getIsVisible() return self._menu:getIsVisible() end ------------- --触发事件中取到linklabel本身 function ZyLinkLable.getLingLabel(node) return gClassPool[node] end
{ "content_hash": "59664b9b236fa1ff732305ac9cf923e5", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 124, "avg_line_length": 26.194444444444443, "alnum_prop": 0.7046659597030753, "repo_name": "wenhulove333/ScutServer", "id": "c3b6f24cb9c76021d8046605588914171adffe6b", "size": "3852", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Sample/Koudai/Client/lua/lib/ZyLinkLable.lua", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "150472" }, { "name": "ActionScript", "bytes": "339184" }, { "name": "Batchfile", "bytes": "60466" }, { "name": "C", "bytes": "3976261" }, { "name": "C#", "bytes": "9481083" }, { "name": "C++", "bytes": "11640198" }, { "name": "CMake", "bytes": "489" }, { "name": "CSS", "bytes": "13478" }, { "name": "Groff", "bytes": "16179" }, { "name": "HTML", "bytes": "283997" }, { "name": "Inno Setup", "bytes": "28931" }, { "name": "Java", "bytes": "214263" }, { "name": "JavaScript", "bytes": "2809" }, { "name": "Lua", "bytes": "4667522" }, { "name": "Makefile", "bytes": "166623" }, { "name": "Objective-C", "bytes": "401654" }, { "name": "Objective-C++", "bytes": "355347" }, { "name": "Python", "bytes": "1633926" }, { "name": "Shell", "bytes": "101770" }, { "name": "Visual Basic", "bytes": "18764" } ], "symlink_target": "" }
<?php /* @var $this yii\web\View */ $this->title = 'My Yii Application'; ?> <div class="landing-page"> <object class="green-logo" data="../../web/assets/img/logo-white-01.svg" type="image/svg+xml"></object> <div class="buggly-description"> <p>a minimal app for web developers to track and manage bugs</p> </div> <div class="sign-up-button"> <a href="/buggly/web/user/register"><span>SIGN UP</span></a> </div> </div>
{ "content_hash": "0fe3cf52535b2f4cc7cd89c1005a98d8", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 107, "avg_line_length": 22.047619047619047, "alnum_prop": 0.6025917926565875, "repo_name": "Kolorweb/buggly", "id": "57a2f21b00a4cfa4fd0c727b6fb8b78c9eb14a5c", "size": "463", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "views/site/index.php", "mode": "33261", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "201" }, { "name": "CSS", "bytes": "18467" }, { "name": "PHP", "bytes": "97014" }, { "name": "Shell", "bytes": "1030" } ], "symlink_target": "" }
package config import "github.com/alecthomas/kong" // Cli holds command line args, flags and cmds type Cli struct { Version kong.VersionFlag Cfgfile string `kong:"name='config',env='CONFIG',help='FTPGrab configuration file.'"` Schedule string `kong:"name='schedule',env='SCHEDULE',help='CRON expression format.'"` LogLevel string `kong:"name='log-level',env='LOG_LEVEL',default='info',help='Set log level.'"` LogJSON bool `kong:"name='log-json',env='LOG_JSON',default='false',help='Enable JSON logging output.'"` LogTimestamp bool `kong:"name='log-timestamp',env='LOG_TIMESTAMP',default='true',help='Adds the current local time as UNIX timestamp to the logger context.'"` LogCaller bool `kong:"name='log-caller',env='LOG_CALLER',default='false',help='Add file:line of the caller to log output.'"` LogFile string `kong:"name='log-file',env='LOG_FILE',help='Add logging to a specific file.'"` }
{ "content_hash": "92de8d877d1f4e312100da101d2e8aa1", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 161, "avg_line_length": 62.666666666666664, "alnum_prop": 0.7053191489361702, "repo_name": "ftpgrab/ftpgrab", "id": "514f71607a2a7a9c777b20d185a24151dae6230f", "size": "940", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "internal/config/cli.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "2620" }, { "name": "Go", "bytes": "58955" } ], "symlink_target": "" }
require 'spec_helper' describe RubyRabbitmqJanus::RRJAdmin, type: :request, level: :admin, name: :set_log_timestamps do before { helper_janus_instance_without_token } let(:type) { 'admin::set_log_timestamps' } let(:schema_success) { type } let(:parameter) { { 'timestamps' => [true, false].sample } } let(:number) { '1' } describe 'request #set_log_timestamps' do let(:info) { :log_timestamps } include_examples 'when transaction admin success boolean' end end
{ "content_hash": "c7bc06e1063295f39be3f77e9d8ca759", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 66, "avg_line_length": 31.27777777777778, "alnum_prop": 0.5914742451154529, "repo_name": "dazzl-tv/ruby-rabbitmq-janus", "id": "eb62b507eb01b7f2e3449d1e449de257fb3e1de7", "size": "594", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "spec/ruby_rabbitmq_janus/rrj_admin_set_log_timestamps_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "1127" }, { "name": "Ruby", "bytes": "230440" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "dd77c041fd7203142d958767acb4ea70", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "a9a9a28a22aa9694712637d9aa6732de406fbf11", "size": "174", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Malvales/Thymelaeaceae/Kerrdora/Kerrdora laotica/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
../cuando init example schema.json prefs.json dims.json ../cuando merge example doc.json ../cuando query example query.json
{ "content_hash": "7e91f6fb92a20cc498cef49f101eaeee", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 55, "avg_line_length": 41.333333333333336, "alnum_prop": 0.7741935483870968, "repo_name": "cuando-db/cuando-db", "id": "f4a2e88fab5c2bebb8182478d9499bd67ead4dd6", "size": "144", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "examples/example.sh", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "2876" }, { "name": "Scala", "bytes": "44116" }, { "name": "Shell", "bytes": "176" } ], "symlink_target": "" }
package org.onosproject.incubator.net.config.basics; import com.fasterxml.jackson.databind.JsonNode; import com.google.common.collect.Sets; import org.onlab.packet.MacAddress; import org.onlab.packet.VlanId; import org.onosproject.net.config.Config; import org.onosproject.incubator.net.intf.Interface; import org.onosproject.net.ConnectPoint; import org.onosproject.net.host.InterfaceIpAddress; import java.util.Set; /** * Configuration for interfaces. */ public class InterfaceConfig extends Config<ConnectPoint> { public static final String INTERFACES = "interfaces"; public static final String IPS = "ips"; public static final String MAC = "mac"; public static final String VLAN = "vlan"; /** * Retrieves all interfaces configured on this port. * * @return set of interfaces */ public Set<Interface> getInterfaces() { Set<Interface> interfaces = Sets.newHashSet(); for (JsonNode intfNode : node.path(INTERFACES)) { interfaces.add(new Interface(subject, getIps(intfNode), MacAddress.valueOf(intfNode.path(MAC).asText()), VlanId.vlanId(Short.parseShort(intfNode.path(VLAN).asText())))); } return interfaces; } private Set<InterfaceIpAddress> getIps(JsonNode node) { Set<InterfaceIpAddress> ips = Sets.newHashSet(); JsonNode ipsNode = node.get(IPS); ipsNode.forEach(jsonNode -> ips.add(InterfaceIpAddress.valueOf(jsonNode.asText()))); return ips; } }
{ "content_hash": "2f35f05b819b055463a1fe4a1faade65", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 92, "avg_line_length": 29.96153846153846, "alnum_prop": 0.6810012836970475, "repo_name": "jinlongliu/onos", "id": "62446766859675770b837cb6275854bca3dd6ae9", "size": "2167", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "incubator/api/src/main/java/org/onosproject/incubator/net/config/basics/InterfaceConfig.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "159897" }, { "name": "HTML", "bytes": "469099" }, { "name": "Java", "bytes": "12418759" }, { "name": "JavaScript", "bytes": "3022004" }, { "name": "Shell", "bytes": "2625" } ], "symlink_target": "" }
using std::vector; #include <curl/curl.h> #include "S3Common.h" struct Uploader { Uploader(); ~Uploader(); bool init(const char *data, S3Credential *cred); bool write(char *buf, uint64_t &len); void destroy(); private: // pthread_t* threads; }; const char *GetUploadId(const char *host, const char *bucket, const char *obj_name, const S3Credential &cred); const char *PartPutS3Object(const char *host, const char *bucket, const char *obj_name, const S3Credential &cred, const char *data, uint64_t data_size, uint64_t part_number, const char *upload_id); bool CompleteMultiPutS3(const char *host, const char *bucket, const char *obj_name, const char *upload_id, const char **etag_array, uint64_t count, const S3Credential &cred); #endif
{ "content_hash": "0cc92e2e8f7062f0d6874c313c4b0fdc", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 29.75, "alnum_prop": 0.5745798319327731, "repo_name": "GPDBUnite/gps3ext", "id": "f13311e032d055afc6de35cca9b6e9f3ed9e40ac", "size": "1277", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/S3Uploader.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "19250" }, { "name": "C++", "bytes": "1511229" }, { "name": "Makefile", "bytes": "398" }, { "name": "Objective-C", "bytes": "5138" }, { "name": "Python", "bytes": "114" }, { "name": "Shell", "bytes": "731" } ], "symlink_target": "" }
namespace rocksdb { class Iterator { public: Iterator(); virtual ~Iterator(); // An iterator is either positioned at a key/value pair, or // not valid. This method returns true iff the iterator is valid. virtual bool Valid() const = 0; // Position at the first key in the source. The iterator is Valid() // after this call iff the source is not empty. virtual void SeekToFirst() = 0; // Position at the last key in the source. The iterator is // Valid() after this call iff the source is not empty. virtual void SeekToLast() = 0; // Position at the first key in the source that at or past target // The iterator is Valid() after this call iff the source contains // an entry that comes at or past target. virtual void Seek(const Slice& target) = 0; // Moves to the next entry in the source. After this call, Valid() is // true iff the iterator was not positioned at the last entry in the source. // REQUIRES: Valid() virtual void Next() = 0; // Moves to the previous entry in the source. After this call, Valid() is // true iff the iterator was not positioned at the first entry in source. // REQUIRES: Valid() virtual void Prev() = 0; // Return the key for the current entry. The underlying storage for // the returned slice is valid only until the next modification of // the iterator. // REQUIRES: Valid() virtual Slice key() const = 0; // Return the value for the current entry. The underlying storage for // the returned slice is valid only until the next modification of // the iterator. // REQUIRES: !AtEnd() && !AtStart() virtual Slice value() const = 0; // Return the whole entry, if key/value are together virtual Slice Entry() const { return Slice(); } // If an error has occurred, return it. Else return an ok status. // If non-blocking IO is requested and this operation cannot be // satisfied without doing some IO, then this returns Status::Incomplete(). virtual Status status() const = 0; // Clients are allowed to register function/arg1/arg2 triples that // will be invoked when this iterator is destroyed. // // Note that unlike all of the preceding methods, this method is // not abstract and therefore clients should not override it. typedef void (*CleanupFunction)(void* arg1, void* arg2); void RegisterCleanup(CleanupFunction function, void* arg1, void* arg2); private: struct Cleanup { CleanupFunction function; void* arg1; void* arg2; Cleanup* next; }; Cleanup cleanup_; // No copying allowed Iterator(const Iterator&); void operator=(const Iterator&); }; // Return an empty iterator (yields nothing). extern Iterator* NewEmptyIterator(); // Return an empty iterator with the specified status. extern Iterator* NewErrorIterator(const Status& status); } // namespace rocksdb #endif // STORAGE_ROCKSDB_INCLUDE_ITERATOR_H_
{ "content_hash": "ccec045e32afa9ef3c5cae33296cfd30", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 78, "avg_line_length": 33.35632183908046, "alnum_prop": 0.7033080634045485, "repo_name": "rDSN-Projects/rocksdb.replicated", "id": "db256e87ab179e75ded30bd66f9430b34a4241f6", "size": "4048", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/rocksdb/iterator.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "87708" }, { "name": "C++", "bytes": "5100490" }, { "name": "CMake", "bytes": "14823" }, { "name": "Java", "bytes": "755607" }, { "name": "Makefile", "bytes": "61050" }, { "name": "PHP", "bytes": "20704" }, { "name": "Python", "bytes": "4208" }, { "name": "Ruby", "bytes": "662" }, { "name": "Shell", "bytes": "55666" }, { "name": "Thrift", "bytes": "486" } ], "symlink_target": "" }
// Generated by CoffeeScript 1.8.0 (function() { var Stomp, net, overTCP, overWS, wrapTCP, wrapWS; Stomp = require('./stomp'); net = require('net'); Stomp.Stomp.setInterval = function(interval, f) { return setInterval(f, interval); }; Stomp.Stomp.clearInterval = function(id) { return clearInterval(id); }; wrapTCP = function(port, host) { var buffer, socket, ws; socket = null; ws = { url: 'tcp:// ' + host + ':' + port, send: function(d) { return socket.write(d); }, close: function() { return socket.end(); } }; socket = net.connect(port, host, function(e) { return ws.onopen(); }); socket.on('error', function(e) { return typeof ws.onclose === "function" ? ws.onclose(e) : void 0; }); socket.on('close', function(e) { return typeof ws.onclose === "function" ? ws.onclose(e) : void 0; }); buffer = new Buffer(0); socket.on('data', function(data) { var event; data = Buffer.concat([buffer, data]); if ('\n' !== data.slice(-1).toString()) { buffer = data; return; } event = { 'data': data.toString() }; ws.onmessage(event); return buffer = new Buffer(0); }); return ws; }; wrapWS = function(url) { var WebSocketClient, connection, socket, ws; WebSocketClient = require('websocket').client; connection = null; ws = { url: url, send: function(d) { return connection.sendUTF(d); }, close: function() { return connection.close(); } }; socket = new WebSocketClient(); socket.on('connect', function(conn) { connection = conn; ws.onopen(); connection.on('error', function(error) { return typeof ws.onclose === "function" ? ws.onclose(error) : void 0; }); connection.on('close', function() { return typeof ws.onclose === "function" ? ws.onclose() : void 0; }); return connection.on('message', function(message) { var event; if (message.type === 'utf8') { event = { 'data': message.utf8Data }; return ws.onmessage(event); } }); }); socket.connect(url); return ws; }; overTCP = function(host, port) { var socket; socket = wrapTCP(port, host); return Stomp.Stomp.over(socket); }; overWS = function(url) { var socket; socket = wrapWS(url); return Stomp.Stomp.over(socket); }; exports.overTCP = overTCP; exports.overWS = overWS; }).call(this);
{ "content_hash": "2bdc4c262f39624a7ba4625f7f063158", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 77, "avg_line_length": 23.603603603603602, "alnum_prop": 0.5465648854961832, "repo_name": "fengshao0907/stomp-websocket", "id": "297059937de947ccf1518a3380415ce9d5562929", "size": "2777", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/stomp-node.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3074" }, { "name": "CoffeeScript", "bytes": "31504" }, { "name": "HTML", "bytes": "12768" }, { "name": "JavaScript", "bytes": "50114" } ], "symlink_target": "" }
using System; using System.Linq; using System.Runtime.Serialization; using Microsoft.Its.Domain.Serialization; using Microsoft.Its.Recipes; namespace Microsoft.Its.Domain { /// <summary> /// An exception thrown when an attempt is made to save a stale aggregate. /// </summary> [Serializable] public class ConcurrencyException : InvalidOperationException { /// <summary> /// Initializes a new instance of the <see cref="ConcurrencyException" /> class. /// </summary> /// <param name="info">The info.</param> /// <param name="context">The context.</param> protected ConcurrencyException(SerializationInfo info, StreamingContext context) : base(info, context) { } /// <summary> /// Initializes a new instance of the <see cref="ConcurrencyException" /> class. /// </summary> /// <param name="message">The message.</param> /// <param name="events">The events rejected due to a concurrency error.</param> /// <param name="innerException">The inner exception.</param> public ConcurrencyException(string message, IEvent[] events = null, Exception innerException = null) : base(message, innerException) { Events = events; } /// <summary> /// Gets or sets the events that could not be committed due to a concurrency error. /// </summary> public IEvent[] Events { get; set; } /// <summary> /// Creates and returns a string representation of the current exception. /// </summary> /// <returns> /// A string representation of the current exception. /// </returns> /// <filterpriority>1</filterpriority><PermissionSet><IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" PathDiscovery="*AllFiles*"/></PermissionSet> public override string ToString() { if (!Events.OrEmpty().Any()) { return base.ToString(); } return base.ToString() + Environment.NewLine + Events.ToJson(); } } }
{ "content_hash": "732104ea47fce1b07dbf6a195f8735c5", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 263, "avg_line_length": 39.21052631578947, "alnum_prop": 0.6170022371364653, "repo_name": "askheaves/Its.Cqrs", "id": "2b71b7abdda66d80ecda8e24a6c6732c9034c47b", "size": "2388", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "Domain/ConcurrencyException.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "111" }, { "name": "Batchfile", "bytes": "534" }, { "name": "C#", "bytes": "1954989" }, { "name": "CSS", "bytes": "13188" }, { "name": "JavaScript", "bytes": "572" }, { "name": "PowerShell", "bytes": "342" }, { "name": "Shell", "bytes": "197" } ], "symlink_target": "" }
import React, {Component} from "react"; import * as THREE from "three"; import OBJLoader from "three-obj-loader"; window.THREE = THREE; OBJLoader(THREE); class ThreeView extends Component { constructor(props) { super(props); this.state = {rotation: 0}; const txURL = require("./generatortexture.jpg"); const objURL = require("./shieldgenerator.obj"); const {width, height} = props.dimensions; this.scene = new THREE.Scene(); this.camera = new THREE.PerspectiveCamera(45, width / height, 0.1, 1000); this.renderer = new THREE.WebGLRenderer({alpha: true}); this.renderer.setSize(width, height); this.camera.position.y = 2; this.camera.position.z = 4; this.camera.lookAt(new THREE.Vector3(0, 0, 0)); const light1 = new THREE.DirectionalLight(0x88ccff, 1); light1.position.z = 1; light1.lookAt(new THREE.Vector3(0, 0, 0)); this.scene.add(light1); const light2 = new THREE.DirectionalLight(0xff8888, 1); light2.position.z = -1; light2.lookAt(new THREE.Vector3(0, 0, 0)); this.scene.add(light2); const objLoader = new window.THREE.OBJLoader(); const texture = new THREE.TextureLoader().load(txURL); const material = new THREE.MeshPhongMaterial({map: texture}); objLoader.load(objURL, obj => { this.reactor = new THREE.Object3D(); this.reactor.copy(obj); this.reactor.scale.set(0.025, 0.025, 0.025); this.reactor.position.set(0, -0.5, 0); this.reactor.children[0].material = material; this.scene.add(this.reactor); this.animate(); }); } componentDidMount() { this.animating = true; this.animate(); this.reactorMount.current.appendChild(this.renderer.domElement); } componentWillUnmount() { cancelAnimationFrame(this.frame); this.animating = false; } animate = () => { if (!this.animating) return false; this.setState(({rotation}) => { return {rotation: rotation + 0.005}; }); if (this.reactor) { this.reactor.rotation.y = this.state.rotation; } this.renderer.render(this.scene, this.camera); this.frame = requestAnimationFrame(this.animate); }; reactorMount = React.createRef(); render() { return <div ref={this.reactorMount} />; } } export default ThreeView;
{ "content_hash": "b5ba5bad063858ba3809f2a87f8a6904", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 77, "avg_line_length": 30.144736842105264, "alnum_prop": 0.6577913574858141, "repo_name": "Thorium-Sim/thorium", "id": "725e3400ee812661bdc2dd274e02d395d921b6dc", "size": "2291", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src/components/views/ReactorControl/model.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "9426" }, { "name": "HTML", "bytes": "16859" }, { "name": "JavaScript", "bytes": "5325431" }, { "name": "SCSS", "bytes": "369048" }, { "name": "Shell", "bytes": "748" }, { "name": "TypeScript", "bytes": "1954100" } ], "symlink_target": "" }
'use strict'; module.exports = { db: 'mongodb://localhost/qaapp-dev', //db: 'mongodb://nodejitsu:e0b737c9d532fc27e1e753a25a4f823e@troup.mongohq.com:10001/nodejitsudb3924701379', mongoose: { debug: true }, app: { name: 'AskOn' }, facebook: { clientID: 'DEFAULT_APP_ID', clientSecret: 'APP_SECRET', callbackURL: 'http://localhost:3000/auth/facebook/callback' }, twitter: { clientID: 'DEFAULT_CONSUMER_KEY', clientSecret: 'CONSUMER_SECRET', callbackURL: 'http://localhost:3000/auth/twitter/callback' }, github: { clientID: 'DEFAULT_APP_ID', clientSecret: 'APP_SECRET', callbackURL: 'http://localhost:3000/auth/github/callback' }, google: { clientID: 'DEFAULT_APP_ID', clientSecret: 'APP_SECRET', callbackURL: 'http://localhost:3000/auth/google/callback' }, linkedin: { clientID: 'DEFAULT_API_KEY', clientSecret: 'SECRET_KEY', callbackURL: 'http://localhost:3000/auth/linkedin/callback' }, emailFrom: 'SENDER EMAIL ADDRESS', // sender address like ABC <abc@example.com> mailer: { service: 'SERVICE_PROVIDER', // Gmail, SMTP auth: { user: 'EMAIL_ID', pass: 'PASSWORD' } } };
{ "content_hash": "a91db1e92ffb171a6e90316c2481f6ab", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 109, "avg_line_length": 26.68888888888889, "alnum_prop": 0.6486261448792673, "repo_name": "Chien19861128/qa-app", "id": "1ea27210562e243270c0bae666872f9bfe92a013", "size": "1201", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/env/development.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16238" }, { "name": "JavaScript", "bytes": "106413" }, { "name": "Perl", "bytes": "48" } ], "symlink_target": "" }
<?php require_once "../../../maincore.php"; require_once THEMES."templates/admin_header.php"; if (!checkrights("UG3") || !defined("iAUTH") || $_GET['aid'] != iAUTH) { redirect("../index.php"); } include_once INFUSIONS."user_gold/infusion_db.php"; include_once INFUSIONS."user_gold/functions.php"; if (file_exists(GOLD_LANG.LOCALESET."admin/global.php")) { include GOLD_LANG.LOCALESET."admin/global.php"; } else { include GOLD_LANG."English/admin/global.php"; } include_once INFUSIONS."user_gold/admin/admin_functions.php"; ?>
{ "content_hash": "e09712aa73987fab1036b43fbf7c891c", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 100, "avg_line_length": 31.235294117647058, "alnum_prop": 0.7005649717514124, "repo_name": "simplyianm/clububer", "id": "4b07a5bb9a3415a73a619aa90ec8382a08d05069", "size": "1410", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "infusions/user_gold/admin/header.php", "mode": "33261", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "5150" }, { "name": "CSS", "bytes": "87528" }, { "name": "HTML", "bytes": "16744" }, { "name": "JavaScript", "bytes": "189460" }, { "name": "PHP", "bytes": "5429227" } ], "symlink_target": "" }
package main import ( "fmt" "time" "github.com/google/go-github/github" "k8s.io/test-infra/velodrome/sql" ) // NewIssue creates a new (orm) Issue from a github Issue func NewIssue(gIssue *github.Issue) (*sql.Issue, error) { if gIssue.Number == nil || gIssue.Title == nil || gIssue.User == nil || gIssue.User.Login == nil || gIssue.State == nil || gIssue.Comments == nil || gIssue.CreatedAt == nil || gIssue.UpdatedAt == nil { return nil, fmt.Errorf("Issue is missing mandatory field: %+v", gIssue) } var closedAt *time.Time if gIssue.ClosedAt != nil { closedAt = gIssue.ClosedAt } var assignee *string if gIssue.Assignee != nil { assignee = gIssue.Assignee.Login } var body string if gIssue.Body != nil { body = *gIssue.Body } isPR := (gIssue.PullRequestLinks != nil && gIssue.PullRequestLinks.URL != nil) labels, err := newLabels(*gIssue.Number, gIssue.Labels) if err != nil { return nil, err } return &sql.Issue{ ID: *gIssue.Number, Labels: labels, Title: *gIssue.Title, Body: body, User: *gIssue.User.Login, Assignee: assignee, State: *gIssue.State, Comments: *gIssue.Comments, IsPR: isPR, IssueClosedAt: closedAt, IssueCreatedAt: *gIssue.CreatedAt, IssueUpdatedAt: *gIssue.UpdatedAt, }, nil } // NewIssueEvent creates a new (orm) Issue from a github Issue func NewIssueEvent(gIssueEvent *github.IssueEvent) (*sql.IssueEvent, error) { if gIssueEvent.ID == nil || gIssueEvent.Event == nil || gIssueEvent.CreatedAt == nil || gIssueEvent.Issue == nil || gIssueEvent.Issue.Number == nil { return nil, fmt.Errorf("IssueEvent is missing mandatory field: %+v", gIssueEvent) } var label *string if gIssueEvent.Label != nil { label = gIssueEvent.Label.Name } var assignee *string if gIssueEvent.Assignee != nil { assignee = gIssueEvent.Assignee.Login } var actor *string if gIssueEvent.Actor != nil { actor = gIssueEvent.Actor.Login } return &sql.IssueEvent{ ID: *gIssueEvent.ID, Label: label, Event: *gIssueEvent.Event, EventCreatedAt: *gIssueEvent.CreatedAt, IssueId: *gIssueEvent.Issue.Number, Assignee: assignee, Actor: actor, }, nil } // newLabels creates a new Label for each label in the issue func newLabels(issueId int, gLabels []github.Label) ([]sql.Label, error) { labels := []sql.Label{} for _, label := range gLabels { if label.Name == nil { return nil, fmt.Errorf("Label is missing name field") } labels = append(labels, sql.Label{IssueID: issueId, Name: *label.Name}) } return labels, nil } // NewIssueComment creates a Comment from a github.IssueComment func NewIssueComment(issueId int, gComment *github.IssueComment) (*sql.Comment, error) { if gComment.ID == nil || gComment.Body == nil || gComment.CreatedAt == nil || gComment.UpdatedAt == nil { return nil, fmt.Errorf("IssueComment is missing mandatory field: %s", gComment) } var login string if gComment.User != nil && gComment.User.Login != nil { login = *gComment.User.Login } return &sql.Comment{ ID: *gComment.ID, IssueID: issueId, Body: *gComment.Body, User: login, CommentCreatedAt: *gComment.CreatedAt, CommentUpdatedAt: *gComment.UpdatedAt, PullRequest: false, }, nil } // NewPullComment creates a Comment from a github.PullRequestComment func NewPullComment(issueId int, gComment *github.PullRequestComment) (*sql.Comment, error) { if gComment.ID == nil || gComment.Body == nil || gComment.CreatedAt == nil || gComment.UpdatedAt == nil { return nil, fmt.Errorf("PullComment is missing mandatory field: %s", gComment) } var login string if gComment.User != nil && gComment.User.Login != nil { login = *gComment.User.Login } return &sql.Comment{ ID: *gComment.ID, IssueID: issueId, Body: *gComment.Body, User: login, CommentCreatedAt: *gComment.CreatedAt, CommentUpdatedAt: *gComment.UpdatedAt, PullRequest: true, }, nil }
{ "content_hash": "08c6c3ae5da66dabf1fa0368b73fedcb", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 93, "avg_line_length": 27.20394736842105, "alnum_prop": 0.6556227327690447, "repo_name": "maisem/test-infra", "id": "5bb5e4eb391f6d10c77cbbdca7323a4b3824adfe", "size": "4704", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "velodrome/fetcher/conversion.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3152" }, { "name": "Go", "bytes": "150027" }, { "name": "HTML", "bytes": "15047" }, { "name": "JavaScript", "bytes": "2973" }, { "name": "Makefile", "bytes": "7383" }, { "name": "Protocol Buffer", "bytes": "3206" }, { "name": "Python", "bytes": "239256" }, { "name": "Shell", "bytes": "54153" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using NServiceMVC; using AttributeRouting; using System.ComponentModel; namespace NServiceMVC.Examples.HelloWorld.Controllers { public class HelloController : ServiceController { [GET("hello")] public Models.HelloResponse Index() { return new Models.HelloResponse { GreetingType = "Hello" }; } [POST("hello")] public Models.HelloResponse Index(Models.NameDetails details) { return new Models.HelloResponse { GreetingType = "Hello", Name = details.FirstName + ' ' + details.LastName, }; } [GET("hello/{name}")] [Description("Says hello to the name passed in the URL")] public Models.HelloResponse Name(string name) { return new Models.HelloResponse { GreetingType = "Hello", Name = name }; } } }
{ "content_hash": "6533cd89061594afbc8039434eb6bc80", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 84, "avg_line_length": 28.16216216216216, "alnum_prop": 0.5882917466410749, "repo_name": "ManuelRin/NServiceMVC", "id": "a61f192494c721724a6e051f97b66312f0154f4b", "size": "1044", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/NServiceMVC.Examples.HelloWorld/Controllers/HelloController.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "123" }, { "name": "C#", "bytes": "129604" }, { "name": "JavaScript", "bytes": "543824" }, { "name": "Puppet", "bytes": "931" } ], "symlink_target": "" }
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * Busqueda de clientes por nombre * @returns {undefined} */ function ClientesByNombre(){ var pag=1; var tama=10; var xNombre = document.getElementById('xNombre').value; var direccion='accion=clientesByNombre&pagina='+pag +'&size='+tama+'&xNombre='+xNombre; //alert(direccion); CallRemote('AjaxServlet', direccion); } /** * * @returns {undefined} */ function NextPageClientes() { window.pagina++; var pag=window.pagina; var tama=window.pagsize; var xNombre = document.getElementById('xNombre').value; var direccion=''; if(xNombre.length>0){ direccion='accion=clientesByNombre&pagina='+pag +'&size='+tama+'&xNombre='+xNombre; } else direccion='accion=clientes'+'&pagina='+pag +'&size='+tama; document.getElementById("xPag").innerHTML=window.pagina; //alert(direccion); CallRemote('AjaxServlet', direccion); } /** * * @returns {undefined} */ function PrevPageClientes() { window.pagina--; if (window.pagina <1) window.pagina=1; var pag=window.pagina; var tama=window.pagsize; var xNombre = document.getElementById('xNombre').value; var direccion=''; if(xNombre.length>0){ direccion='accion=clientesByNombre&pagina='+pag +'&size='+tama+'&xNombre='+xNombre; } else direccion='accion=clientes'+'&pagina='+pag +'&size='+tama; document.getElementById("xPag").innerHTML=window.pagina; //alert(direccion); CallRemote('AjaxServlet', direccion); }
{ "content_hash": "8fe095068ab022fea2c7b130a6afc50e", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 91, "avg_line_length": 22.586666666666666, "alnum_prop": 0.6204250295159386, "repo_name": "gialnet/WebTetbury", "id": "a1cc25d06370ccfecade788de500645661a35ead", "size": "1694", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/BrowseClientes.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "18108" }, { "name": "CSS", "bytes": "720248" }, { "name": "HTML", "bytes": "453010" }, { "name": "Java", "bytes": "834" }, { "name": "JavaScript", "bytes": "1472948" }, { "name": "PHP", "bytes": "643093" }, { "name": "Perl", "bytes": "9368" } ], "symlink_target": "" }
function doSomethingOnceAllAreDone(){ console.log("Everything is done."); } function Item(delay){ this.delay = delay; } //Item.prototype.someAsyncCall = function(callback, delay2) { // setTimeout(function(){ // console.log("Item is done." + delay2); // if(typeof callback === "function") // callback(); // }, this.delay); //}; // // // Item.prototype.someAsyncCall = function(callback, url) { console.log ('trying url:' + url); http.get(this.url, function (res) { res.on('data', function (chunk) { //console.log(chunk); var textChunk = chunk.toString('utf8'); console.log('textChunk:' + textChunk); }); res.on('end', function (chunk) { //console.log(chunk); var textChunk = chunk.toString('utf8'); console.log('textChunk:' + textChunk); if(typeof callback === "function") callback('dummy', textChunk); }); }).on('error', function (err) { console.error('eerrrra:' + err); }); }; var items = []; items.push(new Item('http://www.ge.com')); items.push(new Item('http://www.godaddy.com')); // xxx 1. olog:xmlhttp.readyState:4, xmlhttp.status:301, xmlhttp.responseText:<html><head><title>Object moved</title></head><body> // Include the async package // Make sure you add "node-async" to your package.json for npm async = require("async"); var XMLHttpRequest = require("XMLHttpRequest").XMLHttpRequest; // 1st parameter in async.each() is the array of items async.each(items, // 2nd parameter is the function that each item is passed into function(item, callback){ // Call a // n asynchronous function (often a save() to MongoDB) console.log ('called 2nd param function') item.someAsyncCall(function (){ // Async call is done, alert via callback callback(); }, item.delay); }, // 3rd parameter is the function call when everything is done function(err){ // All tasks are done now doSomethingOnceAllAreDone(); } );
{ "content_hash": "e3e51dc1fec05a4d76d94234d8a35eb1", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 180, "avg_line_length": 26.936708860759495, "alnum_prop": 0.5958646616541353, "repo_name": "hhkk/141213UtdV6", "id": "a1796eb4f58b655798dfb6427e68ee81229dbc9e", "size": "2216", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "public/hk/150401cAsyncExample_andObjectWithFunction_works.js", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "461" }, { "name": "CSS", "bytes": "5693" }, { "name": "Groff", "bytes": "420702" }, { "name": "HTML", "bytes": "160164" }, { "name": "JavaScript", "bytes": "1097415" }, { "name": "Shell", "bytes": "414" } ], "symlink_target": "" }
var Notification = { // date format is yyyy-MM-dd hh:mm:ss notify: function(date, message, successCallback, errorCallback, options) { if(date == null || date.length == 0) { var d = new Date(); date = d.getFullYear() + '-' + (d.getMonth() < 9 ? '0' : '') + (d.getMonth()+1) + '-' + (d.getDate() < 10 ? '0' : '') + d.getDate() + ' ' + (d.getHours() < 10 ? '0' : '') + d.getHours() + ':' + (d.getMinutes() < 10 ? '0' : '') + d.getMinutes() + ':' + (d.getSeconds() < 10 ? '0' : '') + (d.getSeconds()+5); } else if (new Date(date.replace(/-/g,"/")) == 'Invalid Date') { if(errorCallback) { errorCallback(); return; } } if(message == null) { message = ''; } var _options = { date: date, message: message, badge: options.badge, hasAction: options.hasAction ? true : false, action: options.action ? options.action : 'View' }; DynamicApp.exec(successCallback, errorCallback, 'Notification', 'notify', [_options]); }, cancelNotification: function(date, successCallback, errorCallback) { var options = { date: date } DynamicApp.exec(successCallback, errorCallback, 'Notification', 'cancelNotification', [options]); } };
{ "content_hash": "3729e421de4a716e2af8b5682e719bcd", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 105, "avg_line_length": 37.525, "alnum_prop": 0.46102598267821454, "repo_name": "dynamicapp/dynamicapp", "id": "4c242fbbb05dad623ac3e6a287b23c4eafb12ca9", "size": "1501", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "lib/Android/DynamicAppTestApp/assets/www/js/notification.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "175621" }, { "name": "C++", "bytes": "620333" }, { "name": "CSS", "bytes": "19042" }, { "name": "D", "bytes": "80773" }, { "name": "Java", "bytes": "472414" }, { "name": "JavaScript", "bytes": "1369921" }, { "name": "Objective-C", "bytes": "717982" }, { "name": "Objective-C++", "bytes": "34505" }, { "name": "Python", "bytes": "1721313" }, { "name": "Shell", "bytes": "1114" } ], "symlink_target": "" }
// +build !ignore_autogenerated // This file was autogenerated by deepcopy-gen. Do not edit it manually! package v1beta1 import ( conversion "k8s.io/apimachinery/pkg/conversion" runtime "k8s.io/apimachinery/pkg/runtime" v1 "k8s.io/client-go/pkg/api/v1" reflect "reflect" ) func init() { SchemeBuilder.Register(RegisterDeepCopies) } // RegisterDeepCopies adds deep-copy functions to the given scheme. Public // to allow building arbitrary schemes. func RegisterDeepCopies(scheme *runtime.Scheme) error { return scheme.AddGeneratedDeepCopyFuncs( conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_TokenReview, InType: reflect.TypeOf(&TokenReview{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_TokenReviewSpec, InType: reflect.TypeOf(&TokenReviewSpec{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_TokenReviewStatus, InType: reflect.TypeOf(&TokenReviewStatus{})}, conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_UserInfo, InType: reflect.TypeOf(&UserInfo{})}, ) } func DeepCopy_v1beta1_TokenReview(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*TokenReview) out := out.(*TokenReview) *out = *in if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil { return err } if err := DeepCopy_v1beta1_TokenReviewStatus(&in.Status, &out.Status, c); err != nil { return err } return nil } } func DeepCopy_v1beta1_TokenReviewSpec(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*TokenReviewSpec) out := out.(*TokenReviewSpec) *out = *in return nil } } func DeepCopy_v1beta1_TokenReviewStatus(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*TokenReviewStatus) out := out.(*TokenReviewStatus) *out = *in if err := DeepCopy_v1beta1_UserInfo(&in.User, &out.User, c); err != nil { return err } return nil } } func DeepCopy_v1beta1_UserInfo(in interface{}, out interface{}, c *conversion.Cloner) error { { in := in.(*UserInfo) out := out.(*UserInfo) *out = *in if in.Groups != nil { in, out := &in.Groups, &out.Groups *out = make([]string, len(*in)) copy(*out, *in) } if in.Extra != nil { in, out := &in.Extra, &out.Extra *out = make(map[string]ExtraValue) for key, val := range *in { if newVal, err := c.DeepCopy(&val); err != nil { return err } else { (*out)[key] = *newVal.(*ExtraValue) } } } return nil } }
{ "content_hash": "0bdcfe36dc6c5d237ae5466ed367e056", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 121, "avg_line_length": 27.488888888888887, "alnum_prop": 0.6883589329021828, "repo_name": "huang195/kubernetes", "id": "f20aea04e5fcad3fecb8db66073aa6a5a76ddd06", "size": "3043", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "staging/src/k8s.io/client-go/pkg/apis/authentication/v1beta1/zz_generated.deepcopy.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "978" }, { "name": "Go", "bytes": "44520032" }, { "name": "HTML", "bytes": "2249497" }, { "name": "Makefile", "bytes": "67522" }, { "name": "Nginx", "bytes": "1013" }, { "name": "Protocol Buffer", "bytes": "553789" }, { "name": "Python", "bytes": "47393" }, { "name": "SaltStack", "bytes": "56179" }, { "name": "Shell", "bytes": "1477139" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <MetaDataObject xmlns="http://v8.1c.ru/8.3/MDClasses" xmlns:app="http://v8.1c.ru/8.2/managed-application/core" xmlns:cfg="http://v8.1c.ru/8.1/data/enterprise/current-config" xmlns:cmi="http://v8.1c.ru/8.2/managed-application/cmi" xmlns:ent="http://v8.1c.ru/8.1/data/enterprise" xmlns:lf="http://v8.1c.ru/8.2/managed-application/logform" xmlns:style="http://v8.1c.ru/8.1/data/ui/style" xmlns:sys="http://v8.1c.ru/8.1/data/ui/fonts/system" xmlns:v8="http://v8.1c.ru/8.1/data/core" xmlns:v8ui="http://v8.1c.ru/8.1/data/ui" xmlns:web="http://v8.1c.ru/8.1/data/ui/colors/web" xmlns:win="http://v8.1c.ru/8.1/data/ui/colors/windows" xmlns:xen="http://v8.1c.ru/8.3/xcf/enums" xmlns:xpr="http://v8.1c.ru/8.3/xcf/predef" xmlns:xr="http://v8.1c.ru/8.3/xcf/readable" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.12"> <CommonModule uuid="d94d4931-7c81-4ee8-93ea-b2c54b152fa5"> <Properties> <Name>УправлениеКонтактнойИнформациейКлиентСервер</Name> <Synonym> <v8:item> <v8:lang>ru</v8:lang> <v8:content>Управление контактной информацией клиент сервер</v8:content> </v8:item> </Synonym> <Comment/> <Global>false</Global> <ClientManagedApplication>true</ClientManagedApplication> <Server>true</Server> <ExternalConnection>true</ExternalConnection> <ClientOrdinaryApplication>true</ClientOrdinaryApplication> <ServerCall>false</ServerCall> <Privileged>false</Privileged> <ReturnValuesReuse>DontUse</ReturnValuesReuse> </Properties> </CommonModule> </MetaDataObject>
{ "content_hash": "77d1a0a867d7b44065ef1d5d6482b79e", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 868, "avg_line_length": 70.04347826086956, "alnum_prop": 0.7219118559900682, "repo_name": "BlizD/Tasks", "id": "6c1db53bd45aa57c6ee2e6fe45cbcbd8126bb338", "size": "1699", "binary": false, "copies": "1", "ref": "refs/heads/develope", "path": "src/cf/CommonModules/УправлениеКонтактнойИнформациейКлиентСервер.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "1C Enterprise", "bytes": "42181596" }, { "name": "Gherkin", "bytes": "33203" }, { "name": "HTML", "bytes": "2276241" } ], "symlink_target": "" }
package brooklyn.location.docker.strategy.affinity; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import brooklyn.entity.Entity; import brooklyn.entity.basic.EntityPredicates; import brooklyn.entity.container.docker.DockerHost; import brooklyn.location.docker.DockerHostLocation; import brooklyn.location.docker.strategy.AbstractDockerPlacementStrategy; import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; /** * Docker host selection strategy using affinity rules to filter available hosts. */ public class DockerAffinityRuleStrategy extends AbstractDockerPlacementStrategy { private static final Logger LOG = LoggerFactory.getLogger(DockerAffinityRuleStrategy.class); @Override public List<DockerHostLocation> filterLocations(List<DockerHostLocation> locations, Entity entity) { List<DockerHostLocation> available = Lists.newArrayList(); // Select hosts that satisfy the affinity rules for (DockerHostLocation machine : locations) { Optional<List<String>> entityRules = Optional.fromNullable(entity.getConfig(DockerHost.DOCKER_HOST_AFFINITY_RULES)); Optional<List<String>> hostRules = Optional.fromNullable(machine.getOwner().getConfig(DockerHost.DOCKER_HOST_AFFINITY_RULES)); Optional<List<String>> infrastructureRules = Optional.fromNullable(machine.getOwner().getInfrastructure().getConfig(DockerHost.DOCKER_HOST_AFFINITY_RULES)); Iterable<String> combined = Iterables.concat(Optional.presentInstances(ImmutableList.of(entityRules, hostRules, infrastructureRules))); AffinityRules rules = AffinityRules.rulesFor(entity).parse(combined); Iterable<Entity> entities = getBrooklynManagementContext().getEntityManager().findEntities(EntityPredicates.withLocation(machine)); if (Iterables.isEmpty(entities)) { if (rules.allowEmptyLocations()) { available.add(machine); } } else { Iterable<Entity> filtered = Iterables.filter(entities, rules); if (Iterables.size(filtered) == Iterables.size(entities)) { available.add(machine); } } } if (LOG.isDebugEnabled()) { LOG.debug("Available Docker hosts: {}", Iterables.toString(available)); } return available; } }
{ "content_hash": "ed975c1ce937d30ccb8cdcea5ab9bce9", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 168, "avg_line_length": 43.706896551724135, "alnum_prop": 0.714792899408284, "repo_name": "duncangrant/clocker", "id": "da178b1ed3fe130f16ae872fd69d735e7c9d10d7", "size": "3146", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docker/src/main/java/brooklyn/location/docker/strategy/affinity/DockerAffinityRuleStrategy.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "15302" }, { "name": "Java", "bytes": "334864" }, { "name": "JavaScript", "bytes": "600341" }, { "name": "Shell", "bytes": "3365" } ], "symlink_target": "" }
#initialise the vagrantbox to be safe vagrant init #place all files that need to be copied to the virtual machine in a folder # in the directory above this called "requiredfiles" if [ ! -d shared ]; then mkdir shared cp ../requiredfiles/* shared fi #bring the VM online vagrant up
{ "content_hash": "64af5f7634cf855e5aeb8f903f950016", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 75, "avg_line_length": 20.4, "alnum_prop": 0.7026143790849673, "repo_name": "jetbooster/CIProject", "id": "6f19f2550cb720ff58e79d60c6cbdd374faaa90e", "size": "306", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "RUN_IN_WINDOWS_BASH.sh", "mode": "33188", "license": "mit", "language": [ { "name": "Shell", "bytes": "1998" } ], "symlink_target": "" }
clean(TINYXML) fpath(TINYXML tinyxml.h PATH_SUFFIXES tinyxml) fpath(TINYXML tinystr.h PATH_SUFFIXES tinyxml) flib(TINYXML NAMES tinyxml) export_lib(TINYXML)
{ "content_hash": "dfd9c0b79157409327de178214c2f17f", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 46, "avg_line_length": 31.4, "alnum_prop": 0.821656050955414, "repo_name": "aldebaran/qibuild", "id": "1d8ca69799086a31694f4854cbba28603a101cc7", "size": "330", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "cmake/qibuild/modules/tinyxml-config.cmake", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "6892" }, { "name": "C++", "bytes": "23130" }, { "name": "CMake", "bytes": "292637" }, { "name": "Makefile", "bytes": "755" }, { "name": "Nix", "bytes": "563" }, { "name": "Python", "bytes": "1581825" }, { "name": "SWIG", "bytes": "306" }, { "name": "Shell", "bytes": "888" } ], "symlink_target": "" }
class SnapshotView(object): """ A view into some subset of a snapshot instance. The attributes of the view depend on the snapshot from which it was derived, and the kind of view requested. All available attributes from the snapshot are available via the fields property, which returns a tuple. Modifying elements of the view in-place will modify the elements in the associated snapshot. Similarly, modifying elements of the snapshot in-place will modify them in the view. However, it is not possible to reassign attributes of the view. Further, reassignment of attributes of the original snapshot will not be propagated to the view. To clarify, >>> g = GadgetSnapshot('filename') >>> hsml = g.gas.hsml >>> hsml is g.hsml[0] True >>> hsml[0] = 2 * hsml[0] >>> hsml is g.hsml[0] True >>> hsml = 2 * hsml TypeError: 'SnapsotView' object does not support item assignment >>> hsml *= 2 TypeError: 'SnapsotView' object does not support item assignment >>> g.hsml[0] = 2 * g.hsml[0] >>> hsml is g.hsml[0] False >>> g.gas.hsml is g.hsml[0] True """ def __init__(self, _parent_snapshot, _data): super(SnapshotView, self).__setattr__('_parent', _parent_snapshot) super(SnapshotView, self).__setattr__('_fields', set()) for (name, value) in _data: self._fields.add(name) super(SnapshotView, self).__setattr__(name, value) # TODO: We should be able to change attributes of the view, and these # changes should be propagated to the parent snapshot. def __setattr__(self, name, value): raise TypeError("'SnapsotView' object does not support item assignment") @property def fields(self): return tuple(self._fields)
{ "content_hash": "cc7903ec820de007c57e9168d2bd4b53", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 80, "avg_line_length": 38.183673469387756, "alnum_prop": 0.6296098343132015, "repo_name": "spthm/glio", "id": "16299f30f345ef75ec2d3d587322379c8bb228f1", "size": "1871", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "snapview.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "38919" } ], "symlink_target": "" }
from django.test import TestCase, Client from django.core.urlresolvers import reverse from django.contrib.auth.models import User from foraliving.models import Video, Interview_Question_Map, Interview, Question, \ Interview_Question_Video_Map, User_Add_Ons class VideosPage(TestCase): """ Test Calls fot all method related with the complete videos interface """ fixtures = ['initial_data'] def setUp(self): """ Setup the initial conditions for execute the tests :return: """ self.client = Client() self.client.login(username='student_admin', password='admin123') def test_display_videos_page_student(self): """ Test to display the videos when the user is student :return: """ interview = Interview.objects.get(pk=1) question = Question.objects.get(pk=1) self.user = User.objects.get(pk=2) user = User_Add_Ons.objects.get(user=self.user) interview_question = Interview_Question_Map(interview=interview, question=question) interview_question.save() video = Video(name=interview_question.question.name, url="www.foraliving.org", tags="student", created_by=user, creation_date="2016-11-11", status="approved") video.save() interview_question_video = Interview_Question_Video_Map(interview_question=interview_question, video=video) interview_question_video.save() response = self.client.get(reverse('videos')) self.assertEqual(response.status_code, 200) self.assertContains(response, "www.foraliving.org") self.assertContains(response, interview_question.question.name) def test_display_school_name_student(self): """ If the user is student, display the school name on the top page :return: """ self.user = User.objects.get(pk=2) user = User_Add_Ons.objects.get(user=self.user) response = self.client.get(reverse('videos')) self.assertEqual(response.status_code, 200) self.assertContains(response, user.school.name) def test_display_videos_page_teacher(self): """ Test to display the videos when the user is teacher :return: """ interview = Interview.objects.get(pk=1) question = Question.objects.get(pk=1) self.user = User.objects.get(pk=3) user = User_Add_Ons.objects.get(user=self.user) interview_question = Interview_Question_Map(interview=interview, question=question) interview_question.save() video = Video(name=interview_question.question.name, url="www.youtube.com/watch?v=oFnH9TsNRPo", tags="student", created_by=user, creation_date="2016-11-11", status="approved") video.save() interview_question_video = Interview_Question_Video_Map(interview_question=interview_question, video=video) interview_question_video.save() response = self.client.get(reverse('videos')) self.assertEqual(response.status_code, 200) self.assertContains(response, "www.youtube.com/watch?v=oFnH9TsNRPo") self.assertContains(response, interview_question.question.name) def test_display_school_name_teacher(self): """ If the user is teacher, display the school name on the top page :return: """ self.user = User.objects.get(pk=3) user = User_Add_Ons.objects.get(user=self.user) response = self.client.get(reverse('videos')) self.assertEqual(response.status_code, 200) self.assertContains(response, user.school.name) def test_display_videos_page_volunteer(self): """ Test to display the videos when the user is volunteer :return: """ self.client.logout() self.client.login(username='volunteer_admin', password='admin123') interview = Interview.objects.get(pk=1) question = Question.objects.get(pk=1) self.user = User.objects.get(pk=2) user = User_Add_Ons.objects.get(user=self.user) interview_question = Interview_Question_Map(interview=interview, question=question) interview_question.save() video = Video(name=interview_question.question.name, url="www.youtube.com/watch?v=oFnH9TsNRPo", tags="student", created_by=user, creation_date="2016-11-11", status="approved") video.save() interview_question_video = Interview_Question_Video_Map(interview_question=interview_question, video=video) interview_question_video.save() response = self.client.get(reverse('videos')) self.assertEqual(response.status_code, 200) self.assertContains(response, "/foraliving/media/www.youtube.com/watch?v=oFnH9TsNRPo") self.assertContains(response, "Profile") self.assertContains(response, "Get Interviewed")
{ "content_hash": "8025550b6873e2a331db2f5cbafed932", "timestamp": "", "source": "github", "line_count": 115, "max_line_length": 136, "avg_line_length": 43.19130434782609, "alnum_prop": 0.6551238171934769, "repo_name": "foraliving/pilot", "id": "e2d34edf94739c61c11a7b5edf9ed8c54ad7018a", "size": "4967", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "foraliving/tests/test_videos_page.py", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1049" }, { "name": "CSS", "bytes": "215607" }, { "name": "HTML", "bytes": "293009" }, { "name": "JavaScript", "bytes": "636123" }, { "name": "Python", "bytes": "176766" } ], "symlink_target": "" }
/** * @author qiao / https://github.com/qiao * @author mrdoob / http://mrdoob.com * @author alteredq / http://alteredqualia.com/ * @author WestLangley / http://github.com/WestLangley * @author erich666 / http://erichaines.com */ /*global THREE, console */ // This set of controls performs orbiting, dollying (zooming), and panning. It maintains // the "up" direction as +Y, unlike the TrackballControls. Touch on tablet and phones is // supported. // // Orbit - left mouse / touch: one finger move // Zoom - middle mouse, or mousewheel / touch: two finger spread or squish // Pan - right mouse, or arrow keys / touch: three finter swipe // // This is a drop-in replacement for (most) TrackballControls used in examples. // That is, include this js file and wherever you see: // controls = new THREE.TrackballControls( camera ); // controls.target.z = 150; // Simple substitute "OrbitControls" and the control should work as-is. THREE.OrbitControls = function ( object, domElement ) { this.object = object; this.domElement = ( domElement !== undefined ) ? domElement : document; // API // Set to false to disable this control this.enabled = true; // "target" sets the location of focus, where the control orbits around // and where it pans with respect to. this.target = new THREE.Vector3(); // center is old, deprecated; use "target" instead this.center = this.target; // This option actually enables dollying in and out; left as "zoom" for // backwards compatibility this.noZoom = false; this.zoomSpeed = 1.0; // Limits to how far you can dolly in and out this.minDistance = 0; this.maxDistance = Infinity; // Set to true to disable this control this.noRotate = false; this.rotateSpeed = 1.0; // Set to true to disable this control this.noPan = false; this.keyPanSpeed = 7.0; // pixels moved per arrow key push // Set to true to automatically rotate around the target this.autoRotate = false; this.autoRotateSpeed = 2.0; // 30 seconds per round when fps is 60 // How far you can orbit vertically, upper and lower limits. // Range is 0 to Math.PI radians. this.minPolarAngle = 0; // radians this.maxPolarAngle = Math.PI; // radians // How far you can orbit horizontally, upper and lower limits. // If set, must be a sub-interval of the interval [ - Math.PI, Math.PI ]. this.minAzimuthAngle = - Infinity; // radians this.maxAzimuthAngle = Infinity; // radians // Set to true to disable use of the keys this.noKeys = false; // The four arrow keys this.keys = { LEFT: 37, UP: 38, RIGHT: 39, BOTTOM: 40 }; // Mouse buttons this.mouseButtons = { ORBIT: THREE.MOUSE.LEFT, ZOOM: THREE.MOUSE.MIDDLE, PAN: THREE.MOUSE.RIGHT }; //////////// // internals var scope = this; var EPS = 0.0000001; var rotateStart = new THREE.Vector2(); var rotateEnd = new THREE.Vector2(); var rotateDelta = new THREE.Vector2(); var panStart = new THREE.Vector2(); var panEnd = new THREE.Vector2(); var panDelta = new THREE.Vector2(); var panOffset = new THREE.Vector3(); var offset = new THREE.Vector3(); var dollyStart = new THREE.Vector2(); var dollyEnd = new THREE.Vector2(); var dollyDelta = new THREE.Vector2(); var theta; var phi; var phiDelta = 0; var thetaDelta = 0; var scale = 1; var pan = new THREE.Vector3(); var lastPosition = new THREE.Vector3(); var lastQuaternion = new THREE.Quaternion(); var STATE = { NONE : -1, ROTATE : 0, DOLLY : 1, PAN : 2, TOUCH_ROTATE : 3, TOUCH_DOLLY : 4, TOUCH_PAN : 5 }; var state = STATE.NONE; // for reset this.target0 = this.target.clone(); this.position0 = this.object.position.clone(); // so camera.up is the orbit axis var quat = new THREE.Quaternion().setFromUnitVectors( object.up, new THREE.Vector3( 0, 1, 0 ) ); var quatInverse = quat.clone().inverse(); // events var changeEvent = { type: 'change' }; var startEvent = { type: 'start'}; var endEvent = { type: 'end'}; this.rotateLeft = function ( angle ) { if ( angle === undefined ) { angle = getAutoRotationAngle(); } thetaDelta -= angle; }; this.rotateUp = function ( angle ) { if ( angle === undefined ) { angle = getAutoRotationAngle(); } phiDelta -= angle; }; // pass in distance in world space to move left this.panLeft = function ( distance ) { var te = this.object.matrix.elements; // get X column of matrix panOffset.set( te[ 0 ], te[ 1 ], te[ 2 ] ); panOffset.multiplyScalar( - distance ); pan.add( panOffset ); }; // pass in distance in world space to move up this.panUp = function ( distance ) { var te = this.object.matrix.elements; // get Y column of matrix panOffset.set( te[ 4 ], te[ 5 ], te[ 6 ] ); panOffset.multiplyScalar( distance ); pan.add( panOffset ); }; // pass in x,y of change desired in pixel space, // right and down are positive this.pan = function ( deltaX, deltaY ) { var element = scope.domElement === document ? scope.domElement.body : scope.domElement; if ( scope.object.fov !== undefined ) { // perspective var position = scope.object.position; var offset = position.clone().sub( scope.target ); var targetDistance = offset.length(); // half of the fov is center to top of screen targetDistance *= Math.tan( ( scope.object.fov / 2 ) * Math.PI / 180.0 ); // we actually don't use screenWidth, since perspective camera is fixed to screen height scope.panLeft( 2 * deltaX * targetDistance / element.clientHeight ); scope.panUp( 2 * deltaY * targetDistance / element.clientHeight ); } else if ( scope.object.top !== undefined ) { // orthographic scope.panLeft( deltaX * (scope.object.right - scope.object.left) / element.clientWidth ); scope.panUp( deltaY * (scope.object.top - scope.object.bottom) / element.clientHeight ); } else { // camera neither orthographic or perspective console.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' ); } }; this.dollyIn = function ( dollyScale ) { if ( dollyScale === undefined ) { dollyScale = getZoomScale(); } scale /= dollyScale; }; this.dollyOut = function ( dollyScale ) { if ( dollyScale === undefined ) { dollyScale = getZoomScale(); } scale *= dollyScale; }; this.update = function () { var position = this.object.position; offset.copy( position ).sub( this.target ); // rotate offset to "y-axis-is-up" space offset.applyQuaternion( quat ); // angle from z-axis around y-axis theta = Math.atan2( offset.x, offset.z ); // angle from y-axis phi = Math.atan2( Math.sqrt( offset.x * offset.x + offset.z * offset.z ), offset.y ); if ( this.autoRotate ) { this.rotateLeft( getAutoRotationAngle() ); } theta += thetaDelta; phi += phiDelta; // restrict theta to be between desired limits theta = Math.max( this.minAzimuthAngle, Math.min( this.maxAzimuthAngle, theta ) ); // restrict phi to be between desired limits phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, phi ) ); // restrict phi to be betwee EPS and PI-EPS phi = Math.max( EPS, Math.min( Math.PI - EPS, phi ) ); var radius = offset.length() * scale; // restrict radius to be between desired limits radius = Math.max( this.minDistance, Math.min( this.maxDistance, radius ) ); // move target to panned location this.target.add( pan ); offset.x = radius * Math.sin( phi ) * Math.sin( theta ); offset.y = radius * Math.cos( phi ); offset.z = radius * Math.sin( phi ) * Math.cos( theta ); // rotate offset back to "camera-up-vector-is-up" space offset.applyQuaternion( quatInverse ); position.copy( this.target ).add( offset ); this.object.lookAt( this.target ); thetaDelta = 0; phiDelta = 0; scale = 1; pan.set( 0, 0, 0 ); // update condition is: // min(camera displacement, camera rotation in radians)^2 > EPS // using small-angle approximation cos(x/2) = 1 - x^2 / 8 if ( lastPosition.distanceToSquared( this.object.position ) > EPS || 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS ) { this.dispatchEvent( changeEvent ); lastPosition.copy( this.object.position ); lastQuaternion.copy (this.object.quaternion ); } }; this.reset = function () { state = STATE.NONE; this.target.copy( this.target0 ); this.object.position.copy( this.position0 ); this.update(); }; this.getPolarAngle = function () { return phi; }; this.getAzimuthalAngle = function () { return theta }; function getAutoRotationAngle() { return 2 * Math.PI / 60 / 60 * scope.autoRotateSpeed; } function getZoomScale() { return Math.pow( 0.95, scope.zoomSpeed ); } function onMouseDown( event ) { if ( scope.enabled === false ) return; event.preventDefault(); if ( event.button === scope.mouseButtons.ORBIT ) { if ( scope.noRotate === true ) return; state = STATE.ROTATE; rotateStart.set( event.clientX, event.clientY ); } else if ( event.button === scope.mouseButtons.ZOOM ) { if ( scope.noZoom === true ) return; state = STATE.DOLLY; dollyStart.set( event.clientX, event.clientY ); } else if ( event.button === scope.mouseButtons.PAN ) { if ( scope.noPan === true ) return; state = STATE.PAN; panStart.set( event.clientX, event.clientY ); } document.addEventListener( 'mousemove', onMouseMove, false ); document.addEventListener( 'mouseup', onMouseUp, false ); scope.dispatchEvent( startEvent ); } function onMouseMove( event ) { if ( scope.enabled === false ) return; event.preventDefault(); var element = scope.domElement === document ? scope.domElement.body : scope.domElement; if ( state === STATE.ROTATE ) { if ( scope.noRotate === true ) return; rotateEnd.set( event.clientX, event.clientY ); rotateDelta.subVectors( rotateEnd, rotateStart ); // rotating across whole screen goes 360 degrees around scope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); // rotating up and down along whole screen attempts to go 360, but limited to 180 scope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); rotateStart.copy( rotateEnd ); } else if ( state === STATE.DOLLY ) { if ( scope.noZoom === true ) return; dollyEnd.set( event.clientX, event.clientY ); dollyDelta.subVectors( dollyEnd, dollyStart ); if ( dollyDelta.y > 0 ) { scope.dollyIn(); } else { scope.dollyOut(); } dollyStart.copy( dollyEnd ); } else if ( state === STATE.PAN ) { if ( scope.noPan === true ) return; panEnd.set( event.clientX, event.clientY ); panDelta.subVectors( panEnd, panStart ); scope.pan( panDelta.x, panDelta.y ); panStart.copy( panEnd ); } scope.update(); } function onMouseUp( /* event */ ) { if ( scope.enabled === false ) return; document.removeEventListener( 'mousemove', onMouseMove, false ); document.removeEventListener( 'mouseup', onMouseUp, false ); scope.dispatchEvent( endEvent ); state = STATE.NONE; } function onMouseWheel( event ) { if ( scope.enabled === false || scope.noZoom === true ) return; event.preventDefault(); event.stopPropagation(); var delta = 0; if ( event.wheelDelta !== undefined ) { // WebKit / Opera / Explorer 9 delta = event.wheelDelta; } else if ( event.detail !== undefined ) { // Firefox delta = - event.detail; } if ( delta > 0 ) { scope.dollyOut(); } else { scope.dollyIn(); } scope.update(); scope.dispatchEvent( startEvent ); scope.dispatchEvent( endEvent ); } function onKeyDown( event ) { if ( scope.enabled === false || scope.noKeys === true || scope.noPan === true ) return; switch ( event.keyCode ) { case scope.keys.UP: scope.pan( 0, scope.keyPanSpeed ); scope.update(); break; case scope.keys.BOTTOM: scope.pan( 0, - scope.keyPanSpeed ); scope.update(); break; case scope.keys.LEFT: scope.pan( scope.keyPanSpeed, 0 ); scope.update(); break; case scope.keys.RIGHT: scope.pan( - scope.keyPanSpeed, 0 ); scope.update(); break; } } function touchstart( event ) { if ( scope.enabled === false ) return; switch ( event.touches.length ) { case 1: // one-fingered touch: rotate if ( scope.noRotate === true ) return; state = STATE.TOUCH_ROTATE; rotateStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); break; case 2: // two-fingered touch: dolly if ( scope.noZoom === true ) return; state = STATE.TOUCH_DOLLY; var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; var distance = Math.sqrt( dx * dx + dy * dy ); dollyStart.set( 0, distance ); break; case 3: // three-fingered touch: pan if ( scope.noPan === true ) return; state = STATE.TOUCH_PAN; panStart.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); break; default: state = STATE.NONE; } scope.dispatchEvent( startEvent ); } function touchmove( event ) { if ( scope.enabled === false ) return; event.preventDefault(); event.stopPropagation(); var element = scope.domElement === document ? scope.domElement.body : scope.domElement; switch ( event.touches.length ) { case 1: // one-fingered touch: rotate if ( scope.noRotate === true ) return; if ( state !== STATE.TOUCH_ROTATE ) return; rotateEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); rotateDelta.subVectors( rotateEnd, rotateStart ); // rotating across whole screen goes 360 degrees around scope.rotateLeft( 2 * Math.PI * rotateDelta.x / element.clientWidth * scope.rotateSpeed ); // rotating up and down along whole screen attempts to go 360, but limited to 180 scope.rotateUp( 2 * Math.PI * rotateDelta.y / element.clientHeight * scope.rotateSpeed ); rotateStart.copy( rotateEnd ); scope.update(); break; case 2: // two-fingered touch: dolly if ( scope.noZoom === true ) return; if ( state !== STATE.TOUCH_DOLLY ) return; var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; var distance = Math.sqrt( dx * dx + dy * dy ); dollyEnd.set( 0, distance ); dollyDelta.subVectors( dollyEnd, dollyStart ); if ( dollyDelta.y > 0 ) { scope.dollyOut(); } else { scope.dollyIn(); } dollyStart.copy( dollyEnd ); scope.update(); break; case 3: // three-fingered touch: pan if ( scope.noPan === true ) return; if ( state !== STATE.TOUCH_PAN ) return; panEnd.set( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ); panDelta.subVectors( panEnd, panStart ); scope.pan( panDelta.x, panDelta.y ); panStart.copy( panEnd ); scope.update(); break; default: state = STATE.NONE; } } function touchend( /* event */ ) { if ( scope.enabled === false ) return; scope.dispatchEvent( endEvent ); state = STATE.NONE; } this.domElement.addEventListener( 'contextmenu', function ( event ) { event.preventDefault(); }, false ); this.domElement.addEventListener( 'mousedown', onMouseDown, false ); this.domElement.addEventListener( 'mousewheel', onMouseWheel, false ); this.domElement.addEventListener( 'DOMMouseScroll', onMouseWheel, false ); // firefox this.domElement.addEventListener( 'touchstart', touchstart, false ); this.domElement.addEventListener( 'touchend', touchend, false ); this.domElement.addEventListener( 'touchmove', touchmove, false ); window.addEventListener( 'keydown', onKeyDown, false ); // force an update at start this.update(); }; THREE.OrbitControls.prototype = Object.create( THREE.EventDispatcher.prototype );
{ "content_hash": "9892966b2073f4436bb1bd8ae61ddbf1", "timestamp": "", "source": "github", "line_count": 672, "max_line_length": 109, "avg_line_length": 23.595238095238095, "alnum_prop": 0.6582996972754793, "repo_name": "MarkDurbin104/3dp.rocks", "id": "23cf047fd50fe3dd1a45dc5aab3b7bb1c9582974", "size": "15856", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lithophane/js/three/controls/OrbitControls.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4443" }, { "name": "HTML", "bytes": "13297" }, { "name": "JavaScript", "bytes": "159421" } ], "symlink_target": "" }
var filter = new OpenLayers.Filter.Comparison({ type: OpenLayers.Filter.Comparison.EQUAL_TO, property: "STATE_NAME", value: "Montana" }); var feWin = null; var format = new OpenLayers.Format.Filter(); function showFE() { var node = format.write(filter); var text = OpenLayers.Format.XML.prototype.write.apply(format, [node]); if(!feWin) { feWin = new Ext.Window({ title: "Filter Encoding", layout: "fit", closeAction: "hide", height: 300, width: 450, plain: true, modal: true, items: [{ xtype: "textarea", value: text }] }); } else { feWin.items.items[0].setValue(text); } feWin.show(); } Ext.onReady(function() { Ext.QuickTips.init(); var win = new Ext.Window({ title: "Comparison Filter", closable: false, bodyStyle: {padding: 10}, width: 370, layout: "form", hideLabels: true, items: [{ xtype: "gxp_filterfield", anchor: "100%", filter: filter, attributes: new GeoExt.data.AttributeStore({ url: "data/describe_feature_type.xml", ignore: {name: "the_geom"} }) }], bbar: ["->", { text: "View Filter Encoding", handler: function() { showFE(); } }] }); win.show(); });
{ "content_hash": "45fab0a94b1f01343d6f8d9d7d13b9ab", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 75, "avg_line_length": 24.419354838709676, "alnum_prop": 0.48282694848084545, "repo_name": "pcucurullo/groot", "id": "9fdbfc69894fee788a4107c8a5b68c2fd3a6fd84", "size": "1712", "binary": false, "copies": "9", "ref": "refs/heads/master", "path": "public/js/heron/ux/gxp/git/examples/filter.js", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "2870" }, { "name": "C", "bytes": "7006" }, { "name": "CSS", "bytes": "7538133" }, { "name": "HTML", "bytes": "49958485" }, { "name": "JavaScript", "bytes": "60060170" }, { "name": "Makefile", "bytes": "2100" }, { "name": "PHP", "bytes": "4381269" }, { "name": "PLpgSQL", "bytes": "30016" }, { "name": "Python", "bytes": "344097" }, { "name": "SQLPL", "bytes": "17423" }, { "name": "Shell", "bytes": "15692" }, { "name": "XSLT", "bytes": "2204" } ], "symlink_target": "" }
import ast import sys import os #################################################################################################################################################################################################################################### ####################################################################################################### PRE-DEFINED CONSTANTS ###################################################################################################### #################################################################################################################################################################################################################################### # Possible characters to send to the maze application # Any other will be ignored # Do not edit this code UP = 'U' DOWN = 'D' LEFT = 'L' RIGHT = 'R' #################################################################################################################################################################################################################################### # Name of your team # It will be displayed in the maze # You have to edit this code TEAM_NAME = "Improved closest v2" #################################################################################################################################################################################################################################### ########################################################################################################## YOUR VARIABLES ########################################################################################################## #################################################################################################################################################################################################################################### # Stores all the moves in a list to restitute them one by one allMoves = [RIGHT, UP, UP, UP, UP, RIGHT, RIGHT, RIGHT, UP, UP, RIGHT, RIGHT, RIGHT, UP, RIGHT, UP] #################################################################################################################################################################################################################################### ####################################################################################################### PRE-DEFINED FUNCTIONS ###################################################################################################### #################################################################################################################################################################################################################################### # Writes a message to the shell # Use for debugging your program # Channels stdout and stdin are captured to enable communication with the maze # Do not edit this code def debug (text) : # Writes to the stderr channel sys.stderr.write(str(text) + "\n") sys.stderr.flush() #################################################################################################################################################################################################################################### # Reads one line of information sent by the maze application # This function is blocking, and will wait for a line to terminate # The received information is automatically converted to the correct type # Do not edit this code def readFromPipe () : # Reads from the stdin channel and returns the structure associated to the string try : text = sys.stdin.readline() return ast.literal_eval(text.strip()) except : os._exit(-1) #################################################################################################################################################################################################################################### # Sends the text to the maze application # Do not edit this code def writeToPipe (text) : # Writes to the stdout channel sys.stdout.write(text) sys.stdout.flush() #################################################################################################################################################################################################################################### # Reads the initial maze information # The function processes the text and returns the associated variables # The dimensions of the maze are positive integers # Maze map is a dictionary associating to a location its adjacent locations and the associated weights # The preparation time gives the time during which 'initializationCode' can make computations before the game starts # The turn time gives the time during which 'determineNextMove' can make computations before returning a decision # Player locations are tuples (line, column) # Coins are given as a list of locations where they appear # A boolean indicates if the game is over # Do not edit this code def processInitialInformation () : # We read from the pipe data = readFromPipe() return (data['mazeWidth'], data['mazeHeight'], data['mazeMap'], data['preparationTime'], data['turnTime'], data['playerLocation'], data['opponentLocation'], data['coins'], data['gameIsOver']) #################################################################################################################################################################################################################################### # Reads the information after each player moved # The maze map and allowed times are no longer provided since they do not change # Do not edit this code def processNextInformation () : # We read from the pipe data = readFromPipe() return (data['playerLocation'], data['opponentLocation'], data['coins'], data['gameIsOver']) #################################################################################################################################################################################################################################### ########################################################################################################## YOUR FUNCTIONS ########################################################################################################## #################################################################################################################################################################################################################################### # This is where you should write your code to do things during the initialization delay # This function should not return anything, but should be used for a short preprocessing # This function takes as parameters the dimensions and map of the maze, the time it is allowed for computing, the players locations in the maze and the remaining coins locations # Make sure to have a safety margin for the time to include processing times (communication etc.) def initializationCode (mazeWidth, mazeHeight, mazeMap, timeAllowed, playerLocation, opponentLocation, coins) : # Nothing to do pass #################################################################################################################################################################################################################################### # This is where you should write your code to determine the next direction # This function should return one of the directions defined in the CONSTANTS section # This function takes as parameters the dimensions and map of the maze, the time it is allowed for computing, the players locations in the maze and the remaining coins locations # Make sure to have a safety margin for the time to include processing times (communication etc.) def determineNextMove (mazeWidth, mazeHeight, mazeMap, timeAllowed, playerLocation, opponentLocation, coins) : # We return the next move as described by the list global allMoves nextMove = allMoves[0] allMoves = allMoves[1:] return nextMove #################################################################################################################################################################################################################################### ############################################################################################################# MAIN LOOP ############################################################################################################ #################################################################################################################################################################################################################################### # This is the entry point when executing this file # We first send the name of the team to the maze # The first message we receive from the maze includes its dimensions and map, the times allowed to the various steps, and the players and coins locations # Then, at every loop iteration, we get the maze status and determine a move # Do not edit this code if __name__ == "__main__" : # We send the team name writeToPipe(TEAM_NAME + "\n") # We process the initial information and have a delay to compute things using it (mazeWidth, mazeHeight, mazeMap, preparationTime, turnTime, playerLocation, opponentLocation, coins, gameIsOver) = processInitialInformation() initializationCode(mazeWidth, mazeHeight, mazeMap, preparationTime, playerLocation, opponentLocation, coins) # We decide how to move and wait for the next step while not gameIsOver : (playerLocation, opponentLocation, coins, gameIsOver) = processNextInformation() if gameIsOver : break nextMove = determineNextMove(mazeWidth, mazeHeight, mazeMap, turnTime, playerLocation, opponentLocation, coins) writeToPipe(nextMove) #################################################################################################################################################################################################################################### ####################################################################################################################################################################################################################################
{ "content_hash": "44fded32901ff64efd5495bacf756f27", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 228, "avg_line_length": 63.52439024390244, "alnum_prop": 0.3740641197926665, "repo_name": "dimtion/jml", "id": "998946b948cee8ffca75538531e654f2f2716a4b", "size": "11253", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "outputFiles/statistics/archives/ourIA/improved_closest_v2.py/0.9/7/player1.py", "mode": "33261", "license": "mit", "language": [ { "name": "Python", "bytes": "1654391" }, { "name": "TeX", "bytes": "1439179" } ], "symlink_target": "" }
// #docplaster /* Because of how the code is merged together using the doc regions, we need to indent the imports with the function below. */ /* tslint:disable:align */ // #docregion interval import { interval } from 'rxjs'; // #enddocregion interval export function docRegionInterval(console: Console) { // #docregion interval // Create an Observable that will publish a value on an interval const secondsCounter = interval(1000); // Subscribe to begin publishing values const subscription = secondsCounter.subscribe(n => console.log(`It's been ${n + 1} seconds since subscribing!`)); // #enddocregion interval return subscription; }
{ "content_hash": "f486ee4b175c36515ef97912b9ba01a4", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 67, "avg_line_length": 30.09090909090909, "alnum_prop": 0.7265861027190332, "repo_name": "brandonroberts/angular", "id": "a34ad70eee01f4f768b3db7a66f8dd40cc371e53", "size": "662", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "aio/content/examples/rx-library/src/simple-creation.2.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "493" }, { "name": "CSS", "bytes": "338935" }, { "name": "Dockerfile", "bytes": "14627" }, { "name": "HTML", "bytes": "332623" }, { "name": "JSONiq", "bytes": "432" }, { "name": "JavaScript", "bytes": "797638" }, { "name": "PHP", "bytes": "7222" }, { "name": "PowerShell", "bytes": "4229" }, { "name": "Python", "bytes": "335793" }, { "name": "Shell", "bytes": "69715" }, { "name": "TypeScript", "bytes": "17353239" } ], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.4"/> <title>Repast HPC::ReLogo: relogo Directory Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Repast HPC::ReLogo &#160;<span id="projectnumber">2.0</span> </div> <div id="projectbrief">Logo-Like Semantics for Repast HPC</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.4 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="dir_5d5a47c426abf455cd3f8276ab103a75.html">relogo</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">relogo Directory Reference</div> </div> </div><!--header--> <div class="contents"> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> Files</h2></td></tr> <tr class="memitem:_abstract_relogo_agent_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>AbstractRelogoAgent.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_abstract_relogo_agent_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>AbstractRelogoAgent.h</b> <a href="_abstract_relogo_agent_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:agent__set__functions_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>agent_set_functions.h</b> <a href="agent__set__functions_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_agent_set_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>AgentSet.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_agent_set_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>AgentSet.h</b> <a href="_agent_set_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:creators_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>creators.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:creators_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>creators.h</b> <a href="creators_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:grid__types_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>grid_types.h</b> <a href="grid__types_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_observer_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Observer.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_observer_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Observer.h</b> <a href="_observer_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_patch_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Patch.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_patch_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Patch.h</b> <a href="_patch_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_random_move_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RandomMove.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_random_move_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RandomMove.h</b> <a href="_random_move_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:relogo_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>relogo.h</b> <a href="relogo_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_agent_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoAgent.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_agent_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoAgent.h</b> <a href="_relogo_agent_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_continuous_space_adder_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoContinuousSpaceAdder.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_continuous_space_adder_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoContinuousSpaceAdder.h</b> <a href="_relogo_continuous_space_adder_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_discrete_space_adder_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoDiscreteSpaceAdder.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_discrete_space_adder_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoDiscreteSpaceAdder.h</b> <a href="_relogo_discrete_space_adder_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_errors_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoErrors.h</b> <a href="_relogo_errors_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_link_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoLink.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_link_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoLink.h</b> <a href="_relogo_link_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_shared_continuous_space_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoSharedContinuousSpace.h</b> <a href="_relogo_shared_continuous_space_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_relogo_shared_discrete_space_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>RelogoSharedDiscreteSpace.h</b> <a href="_relogo_shared_discrete_space_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_simulation_runner_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>SimulationRunner.h</b> <a href="_simulation_runner_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_turtle_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Turtle.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_turtle_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>Turtle.h</b> <a href="_turtle_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:utility_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>utility.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:utility_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>utility.h</b> <a href="utility_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_world_creator_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>WorldCreator.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_world_creator_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>WorldCreator.h</b> <a href="_world_creator_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_world_definition_8cpp"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>WorldDefinition.cpp</b></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:_world_definition_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><b>WorldDefinition.h</b> <a href="_world_definition_8h_source.html">[code]</a></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Sun Aug 11 2013 12:37:41 for Repast HPC::ReLogo by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.4 </small></address> </body> </html>
{ "content_hash": "66725385cc049fd6853087c7cc8eefe0", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 683, "avg_line_length": 87.11309523809524, "alnum_prop": 0.6783054321831227, "repo_name": "scamicha/SCC15HPCRepast", "id": "de4ab508bad1b4d62759d36e4731114a193c4703", "size": "14635", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/API/relogo/html/dir_5d5a47c426abf455cd3f8276ab103a75.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C++", "bytes": "1092895" }, { "name": "Makefile", "bytes": "5884" }, { "name": "Python", "bytes": "1338" }, { "name": "Shell", "bytes": "3459" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The Android Open Source Project 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. --> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="true" android:drawable="@drawable/abc_btn_switch_to_on_mtrl_00012"/> <item android:drawable="@drawable/abc_btn_switch_to_on_mtrl_00001"/> </selector>
{ "content_hash": "9f5203709f56a52de5b8ce73b0d92651", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 101, "avg_line_length": 46.35, "alnum_prop": 0.7227615965480043, "repo_name": "xfhy/MobileSafe", "id": "2242346c79e877779d45fd312afb6ef0fc4fdf15", "size": "927", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/intermediates/exploded-aar/com.android.support/appcompat-v7/25.1.1/res/drawable/abc_switch_thumb_material.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "387443" } ], "symlink_target": "" }
package io.milton.http.webdav; import io.milton.http.Handler; import io.milton.http.HttpManager; import io.milton.http.Request; import io.milton.http.Request.Method; import io.milton.http.ResourceHandler; import io.milton.http.ResourceHandlerHelper; import io.milton.http.Response; import io.milton.http.exceptions.BadRequestException; import io.milton.http.exceptions.ConflictException; import io.milton.http.exceptions.NotAuthorizedException; import io.milton.http.exceptions.NotFoundException; import io.milton.http.exceptions.PreConditionFailedException; import io.milton.resource.LockableResource; import io.milton.resource.Resource; import java.util.logging.Level; import java.util.logging.Logger; /** * * code based on sources in : http://svn.ettrema.com/svn/milton/tags/milton-1.7.2-SNAPSHOT/milton-api/ */ class UnlockHandler implements ResourceHandler { private final ResourceHandlerHelper resourceHandlerHelper; private final WebDavResponseHandler responseHandler; public UnlockHandler(ResourceHandlerHelper resourceHandlerHelper, WebDavResponseHandler responseHandler) { this.resourceHandlerHelper = resourceHandlerHelper; this.responseHandler = responseHandler; } @Override public void process(HttpManager httpManager, Request request, Response response) throws ConflictException, NotAuthorizedException, BadRequestException { // resourceHandlerHelper.process(httpManager, request, response, this); String host = request.getHostHeader(); String url = HttpManager.decodeUrl(request.getAbsolutePath()); // Find a resource if it exists Resource r = httpManager.getResourceFactory().getResource(host, url); if (r != null) { processExistingResource(httpManager, request, response, r); } else { // log.debug( "lock target doesnt exist, attempting lock null.." ); // processNonExistingResource( httpManager, request, response, host, url ); } } @Override public void processResource(HttpManager manager, Request request, Response response, Resource r) throws NotAuthorizedException, ConflictException, BadRequestException { // resourceHandlerHelper.process(manager, request, response, this); // Find a resource if it exists if (r != null) { processExistingResource(manager, request, response, r); } else { // log.debug( "lock target doesnt exist, attempting lock null.." ); // processNonExistingResource( httpManager, request, response, host, url ); } } private void processExistingResource(HttpManager manager, Request request, Response response, Resource resource) throws NotAuthorizedException, BadRequestException, ConflictException { LockableResource r = (LockableResource) resource; String sToken = request.getLockTokenHeader(); sToken = parseToken(sToken); // this should be checked in processResource now // if( r.getCurrentLock() != null && // !sToken.equals( r.getCurrentLock().tokenId)) // { //Should this be unlocked easily? With other tokens? // response.setStatus(Status.SC_LOCKED); // log.info("cant unlock with token: " + sToken); // return; // } try { r.unlock(sToken); responseHandler.respondNoContent(resource, response, request); } catch (PreConditionFailedException ex) { responseHandler.respondPreconditionFailed(request, response, resource); } } @Override public String[] getMethods() { return new String[]{Method.UNLOCK.code}; } @Override public boolean isCompatible(Resource handler) { return handler instanceof LockableResource; } static String parseToken(String ifHeader) { String token = ifHeader; int pos = token.indexOf(":"); if (pos >= 0) { token = token.substring(pos + 1); pos = token.indexOf(">"); if (pos >= 0) { token = token.substring(0, pos); } } return token; } }
{ "content_hash": "3ab83c6325809d1fef1bd608b0a6f3a1", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 185, "avg_line_length": 35.055045871559635, "alnum_prop": 0.7464014655849254, "repo_name": "skoulouzis/lobcder", "id": "683525b9da1ee6ea2dbe9a02a0c12dabb09590cf", "size": "4425", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "milton2/milton-server-ce/src/main/java/io/milton/http/webdav/UnlockHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "931425" }, { "name": "Java", "bytes": "5968231" }, { "name": "Roff", "bytes": "13315" }, { "name": "Shell", "bytes": "85585" }, { "name": "TeX", "bytes": "21844" } ], "symlink_target": "" }
/** * \file shaderobj.c * \author Brian Paul * */ #include "main/glheader.h" #include "main/context.h" #include "main/hash.h" #include "main/mfeatures.h" #include "main/mtypes.h" #include "main/shaderobj.h" #include "main/uniforms.h" #include "program/program.h" #include "program/prog_parameter.h" #include "program/hash_table.h" #include "ralloc.h" /**********************************************************************/ /*** Shader object functions ***/ /**********************************************************************/ /** * Set ptr to point to sh. * If ptr is pointing to another shader, decrement its refcount (and delete * if refcount hits zero). * Then set ptr to point to sh, incrementing its refcount. */ void _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr, struct gl_shader *sh) { assert(ptr); if (*ptr == sh) { /* no-op */ return; } if (*ptr) { /* Unreference the old shader */ GLboolean deleteFlag = GL_FALSE; struct gl_shader *old = *ptr; ASSERT(old->RefCount > 0); old->RefCount--; /*printf("SHADER DECR %p (%d) to %d\n", (void*) old, old->Name, old->RefCount);*/ deleteFlag = (old->RefCount == 0); if (deleteFlag) { if (old->Name != 0) _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name); ctx->Driver.DeleteShader(ctx, old); } *ptr = NULL; } assert(!*ptr); if (sh) { /* reference new */ sh->RefCount++; /*printf("SHADER INCR %p (%d) to %d\n", (void*) sh, sh->Name, sh->RefCount);*/ *ptr = sh; } } void _mesa_init_shader(struct gl_context *ctx, struct gl_shader *shader) { shader->RefCount = 1; } /** * Allocate a new gl_shader object, initialize it. * Called via ctx->Driver.NewShader() */ struct gl_shader * _mesa_new_shader(struct gl_context *ctx, GLuint name, GLenum type) { struct gl_shader *shader; assert(type == GL_FRAGMENT_SHADER || type == GL_VERTEX_SHADER || type == GL_GEOMETRY_SHADER_ARB); shader = rzalloc(NULL, struct gl_shader); if (shader) { shader->Type = type; shader->Name = name; _mesa_init_shader(ctx, shader); } return shader; } /** * Delete a shader object. * Called via ctx->Driver.DeleteShader(). */ static void _mesa_delete_shader(struct gl_context *ctx, struct gl_shader *sh) { if (sh->Source) free((void *) sh->Source); _mesa_reference_program(ctx, &sh->Program, NULL); ralloc_free(sh); } /** * Lookup a GLSL shader object. */ struct gl_shader * _mesa_lookup_shader(struct gl_context *ctx, GLuint name) { if (name) { struct gl_shader *sh = (struct gl_shader *) _mesa_HashLookup(ctx->Shared->ShaderObjects, name); /* Note that both gl_shader and gl_shader_program objects are kept * in the same hash table. Check the object's type to be sure it's * what we're expecting. */ if (sh && sh->Type == GL_SHADER_PROGRAM_MESA) { return NULL; } return sh; } return NULL; } /** * As above, but record an error if shader is not found. */ struct gl_shader * _mesa_lookup_shader_err(struct gl_context *ctx, GLuint name, const char *caller) { if (!name) { _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } else { struct gl_shader *sh = (struct gl_shader *) _mesa_HashLookup(ctx->Shared->ShaderObjects, name); if (!sh) { _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } if (sh->Type == GL_SHADER_PROGRAM_MESA) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); return NULL; } return sh; } } /**********************************************************************/ /*** Shader Program object functions ***/ /**********************************************************************/ /** * Set ptr to point to shProg. * If ptr is pointing to another object, decrement its refcount (and delete * if refcount hits zero). * Then set ptr to point to shProg, incrementing its refcount. */ void _mesa_reference_shader_program(struct gl_context *ctx, struct gl_shader_program **ptr, struct gl_shader_program *shProg) { assert(ptr); if (*ptr == shProg) { /* no-op */ return; } if (*ptr) { /* Unreference the old shader program */ GLboolean deleteFlag = GL_FALSE; struct gl_shader_program *old = *ptr; ASSERT(old->RefCount > 0); old->RefCount--; #if 0 printf("ShaderProgram %p ID=%u RefCount-- to %d\n", (void *) old, old->Name, old->RefCount); #endif deleteFlag = (old->RefCount == 0); if (deleteFlag) { if (old->Name != 0) _mesa_HashRemove(ctx->Shared->ShaderObjects, old->Name); ctx->Driver.DeleteShaderProgram(ctx, old); } *ptr = NULL; } assert(!*ptr); if (shProg) { shProg->RefCount++; #if 0 printf("ShaderProgram %p ID=%u RefCount++ to %d\n", (void *) shProg, shProg->Name, shProg->RefCount); #endif *ptr = shProg; } } void _mesa_init_shader_program(struct gl_context *ctx, struct gl_shader_program *prog) { prog->Type = GL_SHADER_PROGRAM_MESA; prog->RefCount = 1; prog->AttributeBindings = string_to_uint_map_ctor(); prog->FragDataBindings = string_to_uint_map_ctor(); #if FEATURE_ARB_geometry_shader4 prog->Geom.VerticesOut = 0; prog->Geom.InputType = GL_TRIANGLES; prog->Geom.OutputType = GL_TRIANGLE_STRIP; #endif prog->InfoLog = ralloc_strdup(prog, ""); } /** * Allocate a new gl_shader_program object, initialize it. * Called via ctx->Driver.NewShaderProgram() */ static struct gl_shader_program * _mesa_new_shader_program(struct gl_context *ctx, GLuint name) { struct gl_shader_program *shProg; shProg = rzalloc(NULL, struct gl_shader_program); if (shProg) { shProg->Name = name; _mesa_init_shader_program(ctx, shProg); } return shProg; } /** * Clear (free) the shader program state that gets produced by linking. */ void _mesa_clear_shader_program_data(struct gl_context *ctx, struct gl_shader_program *shProg) { if (shProg->UniformStorage) { _mesa_uniform_detach_all_driver_storage(shProg->UniformStorage); ralloc_free(shProg->UniformStorage); shProg->NumUserUniformStorage = 0; shProg->UniformStorage = NULL; } if (shProg->UniformHash) { string_to_uint_map_dtor(shProg->UniformHash); shProg->UniformHash = NULL; } assert(shProg->InfoLog != NULL); ralloc_free(shProg->InfoLog); shProg->InfoLog = ralloc_strdup(shProg, ""); } /** * Free all the data that hangs off a shader program object, but not the * object itself. */ void _mesa_free_shader_program_data(struct gl_context *ctx, struct gl_shader_program *shProg) { GLuint i; gl_shader_type sh; assert(shProg->Type == GL_SHADER_PROGRAM_MESA); _mesa_clear_shader_program_data(ctx, shProg); if (shProg->AttributeBindings) { string_to_uint_map_dtor(shProg->AttributeBindings); shProg->AttributeBindings = NULL; } if (shProg->FragDataBindings) { string_to_uint_map_dtor(shProg->FragDataBindings); shProg->FragDataBindings = NULL; } /* detach shaders */ for (i = 0; i < shProg->NumShaders; i++) { _mesa_reference_shader(ctx, &shProg->Shaders[i], NULL); } shProg->NumShaders = 0; if (shProg->Shaders) { free(shProg->Shaders); shProg->Shaders = NULL; } /* Transform feedback varying vars */ for (i = 0; i < shProg->TransformFeedback.NumVarying; i++) { free(shProg->TransformFeedback.VaryingNames[i]); } free(shProg->TransformFeedback.VaryingNames); shProg->TransformFeedback.VaryingNames = NULL; shProg->TransformFeedback.NumVarying = 0; for (sh = 0; sh < MESA_SHADER_TYPES; sh++) { if (shProg->_LinkedShaders[sh] != NULL) { ctx->Driver.DeleteShader(ctx, shProg->_LinkedShaders[sh]); shProg->_LinkedShaders[sh] = NULL; } } } /** * Free/delete a shader program object. * Called via ctx->Driver.DeleteShaderProgram(). */ static void _mesa_delete_shader_program(struct gl_context *ctx, struct gl_shader_program *shProg) { _mesa_free_shader_program_data(ctx, shProg); ralloc_free(shProg); } /** * Lookup a GLSL program object. */ struct gl_shader_program * _mesa_lookup_shader_program(struct gl_context *ctx, GLuint name) { struct gl_shader_program *shProg; if (name) { shProg = (struct gl_shader_program *) _mesa_HashLookup(ctx->Shared->ShaderObjects, name); /* Note that both gl_shader and gl_shader_program objects are kept * in the same hash table. Check the object's type to be sure it's * what we're expecting. */ if (shProg && shProg->Type != GL_SHADER_PROGRAM_MESA) { return NULL; } return shProg; } return NULL; } /** * As above, but record an error if program is not found. */ struct gl_shader_program * _mesa_lookup_shader_program_err(struct gl_context *ctx, GLuint name, const char *caller) { if (!name) { _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } else { struct gl_shader_program *shProg = (struct gl_shader_program *) _mesa_HashLookup(ctx->Shared->ShaderObjects, name); if (!shProg) { _mesa_error(ctx, GL_INVALID_VALUE, "%s", caller); return NULL; } if (shProg->Type != GL_SHADER_PROGRAM_MESA) { _mesa_error(ctx, GL_INVALID_OPERATION, "%s", caller); return NULL; } return shProg; } } void _mesa_init_shader_object_functions(struct dd_function_table *driver) { driver->NewShader = _mesa_new_shader; driver->DeleteShader = _mesa_delete_shader; driver->NewShaderProgram = _mesa_new_shader_program; driver->DeleteShaderProgram = _mesa_delete_shader_program; driver->LinkShader = _mesa_ir_link_shader; }
{ "content_hash": "13826014a90cdf11d168cffa33dd1665", "timestamp": "", "source": "github", "line_count": 400, "max_line_length": 85, "avg_line_length": 25.565, "alnum_prop": 0.59241150009779, "repo_name": "gzorin/RSXGL", "id": "36f208d6c097081837d2374e8d7e55cf5132b8d7", "size": "11440", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "extsrc/mesa/src/mesa/main/shaderobj.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "Assembly", "bytes": "1210761" }, { "name": "C", "bytes": "35145128" }, { "name": "C++", "bytes": "33587085" }, { "name": "CSS", "bytes": "16957" }, { "name": "Emacs Lisp", "bytes": "74" }, { "name": "FORTRAN", "bytes": "1377222" }, { "name": "Objective-C", "bytes": "146655" }, { "name": "Perl", "bytes": "361" }, { "name": "Python", "bytes": "668613" }, { "name": "Shell", "bytes": "70500" }, { "name": "XSLT", "bytes": "4325" } ], "symlink_target": "" }
<html> <head> <title>Hello Facebook</title> </head> <body> <h3>Connect to Facebook</h3> <form action="/connect/facebook" method="POST"> <input type="hidden" name="scope" value="public_profile" /> <div class="formInfo"> <p>You aren't connected to Facebook yet. Click the button to connect this application with your Facebook account.</p> </div> <p><button type="submit">Connect to Facebook</button></p> </form> </body> </html>
{ "content_hash": "6e3a60cd647aa795a2f1821f815f720e", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 121, "avg_line_length": 28.5, "alnum_prop": 0.6622807017543859, "repo_name": "josedab/spring-boot-examples", "id": "c6f605647f63ca742123a6218fcc789f6b54430c", "size": "456", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spring-boot-facebook/src/main/resources/templates/connect/facebookConnect.html", "mode": "33261", "license": "mit", "language": [ { "name": "HTML", "bytes": "1153" }, { "name": "Java", "bytes": "69442" }, { "name": "Scala", "bytes": "2930" } ], "symlink_target": "" }
package fi.vincit.multiusertest.rule.expectation.value; import fi.vincit.multiusertest.rule.expectation.ConsumerProducerSet; import fi.vincit.multiusertest.util.UserIdentifier; import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import static org.hamcrest.CoreMatchers.is; import static org.junit.Assert.assertThat; public class ReturnValueCallExpectationTest { @Rule public ExpectedException expectException = ExpectedException.none(); @Test public void throwIfExceptionIsExpected_value() throws Exception { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(1); sut.handleExceptionNotThrown(new ConsumerProducerSet(UserIdentifier.getAnonymous())); } @Test public void throwIfExceptionIsExpected_assertion() throws Exception { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(value -> {}); sut.handleExceptionNotThrown(new ConsumerProducerSet(UserIdentifier.getAnonymous())); } @Test public void throwIfExpectationNotExpected_value() throws Throwable { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(1); expectException.expect(AssertionError.class); sut.handleThrownException(new ConsumerProducerSet(UserIdentifier.getAnonymous()), new IllegalArgumentException()); } @Test public void throwIfExpectationNotExpected_assertion() throws Throwable { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(value -> {}); expectException.expect(AssertionError.class); sut.handleThrownException(new ConsumerProducerSet(UserIdentifier.getAnonymous()), new IllegalArgumentException()); } @Test public void callAndAssertValue_value() throws Throwable { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(1); sut.callAndAssertValue(() -> 1); } @Test public void callAndAssertValue_assertion() throws Throwable { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(value -> assertThat(value, is(2))); sut.callAndAssertValue(() -> 2); } @Test public void callAndAssertValue_value_fail() throws Throwable { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(1); expectException.expect(AssertionError.class); sut.callAndAssertValue(() -> 2); } @Test public void callAndAssertValue_assertion_fail() throws Throwable { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>(value -> assertThat(value, is(2))); expectException.expect(AssertionError.class); sut.callAndAssertValue(() -> 3); } @Test public void callAndAssertValue_assertion_other_fail() throws Throwable { ReturnValueCallExpectation<Integer> sut = new ReturnValueCallExpectation<>( value -> {throw new IllegalStateException("Thrown from assertion");} ); expectException.expect(IllegalStateException.class); expectException.expectMessage("Thrown from assertion"); sut.callAndAssertValue(() -> 3); } }
{ "content_hash": "40a6bc9ba3dc13b5a70b0abf4028893d", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 122, "avg_line_length": 37.44318181818182, "alnum_prop": 0.7150227617602428, "repo_name": "Vincit/multi-user-test-runner", "id": "5c1e16db5e429febcdf2c38058ebfbdd536fd5a3", "size": "3295", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/test/java/fi/vincit/multiusertest/rule/expectation/value/ReturnValueCallExpectationTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "634" }, { "name": "Java", "bytes": "286920" }, { "name": "Shell", "bytes": "3816" } ], "symlink_target": "" }
/** * libatbus_channel_export.h * * Created on: 2014年8月13日 * Author: owent */ #pragma once #ifndef LIBATBUS_CHANNEL_EXPORT_H #define LIBATBUS_CHANNEL_EXPORT_H #pragma once #include <cstddef> #include <ostream> #include <stdint.h> #include <string> #include <utility> #include "libatbus_adapter_libuv.h" #include "libatbus_config.h" #include "libatbus_channel_types.h" namespace atbus { namespace channel { // utility functions extern bool make_address(const char *in, channel_address_t &addr); extern void make_address(const char *scheme, const char *host, int port, channel_address_t &addr); // memory channel extern int mem_configure_set_write_timeout(mem_channel *channel, uint64_t ms); extern uint64_t mem_configure_get_write_timeout(mem_channel *channel); extern int mem_configure_set_write_retry_times(mem_channel *channel, size_t times); extern size_t mem_configure_get_write_retry_times(mem_channel *channel); extern int mem_attach(void *buf, size_t len, mem_channel **channel, const mem_conf *conf); extern int mem_init(void *buf, size_t len, mem_channel **channel, const mem_conf *conf); extern int mem_send(mem_channel *channel, const void *buf, size_t len); extern int mem_recv(mem_channel *channel, void *buf, size_t len, size_t *recv_size); extern std::pair<size_t, size_t> mem_last_action(); extern void mem_show_channel(mem_channel *channel, std::ostream &out, bool need_node_status, size_t need_node_data); extern void mem_stats_get_error(mem_channel *channel, mem_stats_block_error &out); #ifdef ATBUS_CHANNEL_SHM // shared memory channel extern int shm_configure_set_write_timeout(shm_channel *channel, uint64_t ms); extern uint64_t shm_configure_get_write_timeout(shm_channel *channel); extern int shm_configure_set_write_retry_times(shm_channel *channel, size_t times); extern size_t shm_configure_get_write_retry_times(shm_channel *channel); extern int shm_attach(key_t shm_key, size_t len, shm_channel **channel, const shm_conf *conf); extern int shm_init(key_t shm_key, size_t len, shm_channel **channel, const shm_conf *conf); extern int shm_close(key_t shm_key); extern int shm_send(shm_channel *channel, const void *buf, size_t len); extern int shm_recv(shm_channel *channel, void *buf, size_t len, size_t *recv_size); extern std::pair<size_t, size_t> shm_last_action(); extern void shm_show_channel(shm_channel *channel, std::ostream &out, bool need_node_status, size_t need_node_data); extern void shm_stats_get_error(shm_channel *channel, shm_stats_block_error &out); #endif // stream channel(tcp,pipe(unix socket) and etc. udp is not a stream) extern void io_stream_init_configure(io_stream_conf *conf); extern int io_stream_init(io_stream_channel *channel, adapter::loop_t *ev_loop, const io_stream_conf *conf); // it will block and wait for all connections are disconnected success. extern int io_stream_close(io_stream_channel *channel); extern int io_stream_run(io_stream_channel *channel, adapter::run_mode_t mode = adapter::RUN_NOWAIT); extern int io_stream_listen(io_stream_channel *channel, const channel_address_t &addr, io_stream_callback_t callback, void *priv_data, size_t priv_size); extern int io_stream_connect(io_stream_channel *channel, const channel_address_t &addr, io_stream_callback_t callback, void *priv_data, size_t priv_size); extern int io_stream_disconnect(io_stream_channel *channel, io_stream_connection *connection, io_stream_callback_t callback); extern int io_stream_disconnect_fd(io_stream_channel *channel, adapter::fd_t fd, io_stream_callback_t callback); extern int io_stream_try_write(io_stream_connection *connection); extern int io_stream_send(io_stream_connection *connection, const void *buf, size_t len); extern size_t io_stream_get_max_unix_socket_length(); extern void io_stream_show_channel(io_stream_channel *channel, std::ostream &out); } // namespace channel } // namespace atbus #endif /* LIBATBUS_CHANNEL_EXPORT_H_ */
{ "content_hash": "53dd267c6839758fe2974943c41b460a", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 133, "avg_line_length": 47.308510638297875, "alnum_prop": 0.6656172700697099, "repo_name": "owt5008137/libatbus", "id": "0814616679657d898360cb39dab68d9697ed384b", "size": "4455", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "include/detail/libatbus_channel_export.h", "mode": "33261", "license": "mit", "language": [ { "name": "C", "bytes": "204" }, { "name": "C++", "bytes": "532787" }, { "name": "CMake", "bytes": "6571" }, { "name": "Objective-C", "bytes": "3373" } ], "symlink_target": "" }
var gimme = require('../lib/gimme'); var expect = require('chai').expect; describe('members', function() { var parentObj = { parentMethod: function() {}, anotherParentMethod: function() {}, parentProp: '', }; var childObj = Object.create(parentObj); childObj.childMethod = function() {}; childObj.childProp = false; //---------------------------------- describe('members()', function() { it('should return all object members incl. the prototype chain', function() { var result = gimme(childObj).members(); var expectedArr = [ childObj.childMethod, childObj.childProp, parentObj.parentMethod, parentObj.anotherParentMethod, parentObj.parentProp, ]; expect(result).to.eql(expectedArr); }); }); describe('properties()', function() { it('should return all object properties (not methods) incl. the prototype chain', function() { var result = gimme(childObj).properties(); var expectedArr = [ childObj.childProp, parentObj.parentProp, ]; expect(result).to.eql(expectedArr); }); }); describe('methods()', function() { it('should return all object methods (not properties) incl. the prototype chain', function() { var result = gimme(childObj).methods(); var expectedArr = [ childObj.childMethod, parentObj.parentMethod, parentObj.anotherParentMethod, ]; expect(result).to.eql(expectedArr); }); }); describe('ownMembers()', function() { it("should return all object's own members", function() { var result = gimme(childObj).ownMembers(); var expectedArr = [ childObj.childMethod, childObj.childProp, ]; expect(result).to.eql(expectedArr); }); }); describe('ownProperties()', function() { it("should return all object's own properties (not methods)", function() { var result = gimme(childObj).ownProperties(); var expectedArr = [ childObj.childProp, ]; expect(result).to.eql(expectedArr); }); }); describe('ownMethods()', function() { it("should return all object's own methods (not properties", function() { var result = gimme(childObj).ownMethods(); var expectedArr = [ childObj.childMethod, ]; expect(result).to.eql(expectedArr); }); }); });
{ "content_hash": "6b29a503b0d40c7dcb759513370d5728", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 96, "avg_line_length": 23.04123711340206, "alnum_prop": 0.6492170022371365, "repo_name": "mikunn/gimmejs", "id": "f6a9b6386204b48ed069040da9a95a5714918f16", "size": "2235", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/members.test.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "22055" } ], "symlink_target": "" }
/** * SECTION:element-multipartdemux * @see_also: #GstMultipartMux * * MultipartDemux uses the Content-type field of incoming buffers to demux and * push data to dynamic source pads. Most of the time multipart streams are * sequential JPEG frames generated from a live source such as a network source * or a camera. * * The output buffers of the multipartdemux typically have no timestamps and are * usually played as fast as possible (at the rate that the source provides the * data). * * the content in multipart files is separated with a boundary string that can * be configured specifically with the #GstMultipartDemux:boundary property * otherwise it will be autodetected. * * <refsect2> * <title>Sample pipelines</title> * |[ * gst-launch-1.0 filesrc location=/tmp/test.multipart ! multipartdemux ! image/jpeg,framerate=\(fraction\)5/1 ! jpegparse ! jpegdec ! videoconvert ! autovideosink * ]| a simple pipeline to demux a multipart file muxed with #GstMultipartMux * containing JPEG frames. * </refsect2> */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "multipartdemux.h" GST_DEBUG_CATEGORY_STATIC (gst_multipart_demux_debug); #define GST_CAT_DEFAULT gst_multipart_demux_debug #define DEFAULT_BOUNDARY NULL #define DEFAULT_SINGLE_STREAM FALSE enum { PROP_0, PROP_BOUNDARY, PROP_SINGLE_STREAM }; static GstStaticPadTemplate multipart_demux_src_template_factory = GST_STATIC_PAD_TEMPLATE ("src_%u", GST_PAD_SRC, GST_PAD_SOMETIMES, GST_STATIC_CAPS_ANY); static GstStaticPadTemplate multipart_demux_sink_template_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("multipart/x-mixed-replace") ); typedef struct { const gchar *key; const gchar *val; } GstNamesMap; /* convert from mime types to gst structure names. Add more when needed. The * mime-type is stored as lowercase */ static const GstNamesMap gstnames[] = { /* RFC 2046 says audio/basic is mulaw, mono, 8000Hz */ {"audio/basic", "audio/x-mulaw, channels=1, rate=8000"}, {"audio/g726-16", "audio/x-adpcm, bitrate=16000, layout=g726, channels=1, rate=8000"}, {"audio/g726-24", "audio/x-adpcm, bitrate=24000, layout=g726, channels=1, rate=8000"}, {"audio/g726-32", "audio/x-adpcm, bitrate=32000, layout=g726, channels=1, rate=8000"}, {"audio/g726-40", "audio/x-adpcm, bitrate=40000, layout=g726, channels=1, rate=8000"}, /* Panasonic Network Cameras non-standard types */ {"audio/g726", "audio/x-adpcm, bitrate=32000, layout=g726, channels=1, rate=8000"}, {NULL, NULL} }; static GstFlowReturn gst_multipart_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf); static gboolean gst_multipart_demux_event (GstPad * pad, GstObject * parent, GstEvent * event); static GstStateChangeReturn gst_multipart_demux_change_state (GstElement * element, GstStateChange transition); static void gst_multipart_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_multipart_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void gst_multipart_demux_dispose (GObject * object); #define gst_multipart_demux_parent_class parent_class G_DEFINE_TYPE (GstMultipartDemux, gst_multipart_demux, GST_TYPE_ELEMENT); static void gst_multipart_demux_class_init (GstMultipartDemuxClass * klass) { int i; GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass); gobject_class->dispose = gst_multipart_demux_dispose; gobject_class->set_property = gst_multipart_set_property; gobject_class->get_property = gst_multipart_get_property; g_object_class_install_property (gobject_class, PROP_BOUNDARY, g_param_spec_string ("boundary", "Boundary", "The boundary string separating data, automatic if NULL", DEFAULT_BOUNDARY, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS)); /** * GstMultipartDemux:single-stream: * * Assume that there is only one stream whose content-type will * not change and emit no-more-pads as soon as the first boundary * content is parsed, decoded, and pads are linked. */ g_object_class_install_property (gobject_class, PROP_SINGLE_STREAM, g_param_spec_boolean ("single-stream", "Single Stream", "Assume that there is only one stream whose content-type will not change and emit no-more-pads as soon as the first boundary content is parsed, decoded, and pads are linked", DEFAULT_SINGLE_STREAM, G_PARAM_READWRITE)); /* populate gst names and mime types pairs */ klass->gstnames = g_hash_table_new (g_str_hash, g_str_equal); for (i = 0; gstnames[i].key; i++) { g_hash_table_insert (klass->gstnames, (gpointer) gstnames[i].key, (gpointer) gstnames[i].val); } gstelement_class->change_state = gst_multipart_demux_change_state; gst_element_class_add_static_pad_template (gstelement_class, &multipart_demux_sink_template_factory); gst_element_class_add_static_pad_template (gstelement_class, &multipart_demux_src_template_factory); gst_element_class_set_static_metadata (gstelement_class, "Multipart demuxer", "Codec/Demuxer", "demux multipart streams", "Wim Taymans <wim.taymans@gmail.com>, Sjoerd Simons <sjoerd@luon.net>"); } static void gst_multipart_demux_init (GstMultipartDemux * multipart) { /* create the sink pad */ multipart->sinkpad = gst_pad_new_from_static_template (&multipart_demux_sink_template_factory, "sink"); gst_element_add_pad (GST_ELEMENT_CAST (multipart), multipart->sinkpad); gst_pad_set_chain_function (multipart->sinkpad, GST_DEBUG_FUNCPTR (gst_multipart_demux_chain)); gst_pad_set_event_function (multipart->sinkpad, GST_DEBUG_FUNCPTR (gst_multipart_demux_event)); multipart->adapter = gst_adapter_new (); multipart->boundary = DEFAULT_BOUNDARY; multipart->mime_type = NULL; multipart->content_length = -1; multipart->header_completed = FALSE; multipart->scanpos = 0; multipart->singleStream = DEFAULT_SINGLE_STREAM; multipart->have_group_id = FALSE; multipart->group_id = G_MAXUINT; } static void gst_multipart_demux_remove_src_pads (GstMultipartDemux * demux) { while (demux->srcpads != NULL) { GstMultipartPad *mppad = demux->srcpads->data; gst_element_remove_pad (GST_ELEMENT (demux), mppad->pad); g_free (mppad->mime); g_free (mppad); demux->srcpads = g_slist_delete_link (demux->srcpads, demux->srcpads); } demux->srcpads = NULL; demux->numpads = 0; } static void gst_multipart_demux_dispose (GObject * object) { GstMultipartDemux *demux = GST_MULTIPART_DEMUX (object); if (demux->adapter != NULL) g_object_unref (demux->adapter); demux->adapter = NULL; g_free (demux->boundary); demux->boundary = NULL; g_free (demux->mime_type); demux->mime_type = NULL; gst_multipart_demux_remove_src_pads (demux); G_OBJECT_CLASS (parent_class)->dispose (object); } static const gchar * gst_multipart_demux_get_gstname (GstMultipartDemux * demux, gchar * mimetype) { GstMultipartDemuxClass *klass; const gchar *gstname; klass = GST_MULTIPART_DEMUX_GET_CLASS (demux); /* use hashtable to convert to gst name */ gstname = g_hash_table_lookup (klass->gstnames, mimetype); if (gstname == NULL) { /* no gst name mapping, use mime type */ gstname = mimetype; } GST_DEBUG_OBJECT (demux, "gst name for %s is %s", mimetype, gstname); return gstname; } static GstFlowReturn gst_multipart_combine_flows (GstMultipartDemux * demux, GstMultipartPad * pad, GstFlowReturn ret) { GSList *walk; /* store the value */ pad->last_ret = ret; /* any other error that is not-linked can be returned right * away */ if (ret != GST_FLOW_NOT_LINKED) goto done; /* only return NOT_LINKED if all other pads returned NOT_LINKED */ for (walk = demux->srcpads; walk; walk = g_slist_next (walk)) { GstMultipartPad *opad = (GstMultipartPad *) walk->data; ret = opad->last_ret; /* some other return value (must be SUCCESS but we can return * other values as well) */ if (ret != GST_FLOW_NOT_LINKED) goto done; } /* if we get here, all other pads were unlinked and we return * NOT_LINKED then */ done: return ret; } static GstMultipartPad * gst_multipart_find_pad_by_mime (GstMultipartDemux * demux, gchar * mime, gboolean * created) { GSList *walk; walk = demux->srcpads; while (walk) { GstMultipartPad *pad = (GstMultipartPad *) walk->data; if (!strcmp (pad->mime, mime)) { if (created) { *created = FALSE; } return pad; } walk = walk->next; } /* pad not found, create it */ { GstPad *pad; GstMultipartPad *mppad; gchar *name; const gchar *capsname; GstCaps *caps; gchar *stream_id; GstEvent *event; mppad = g_new0 (GstMultipartPad, 1); GST_DEBUG_OBJECT (demux, "creating pad with mime: %s", mime); name = g_strdup_printf ("src_%u", demux->numpads); pad = gst_pad_new_from_static_template (&multipart_demux_src_template_factory, name); g_free (name); mppad->pad = pad; mppad->mime = g_strdup (mime); mppad->last_ret = GST_FLOW_OK; mppad->last_ts = GST_CLOCK_TIME_NONE; mppad->discont = TRUE; demux->srcpads = g_slist_prepend (demux->srcpads, mppad); demux->numpads++; gst_pad_use_fixed_caps (pad); gst_pad_set_active (pad, TRUE); /* prepare and send stream-start */ if (!demux->have_group_id) { event = gst_pad_get_sticky_event (demux->sinkpad, GST_EVENT_STREAM_START, 0); if (event) { demux->have_group_id = gst_event_parse_group_id (event, &demux->group_id); gst_event_unref (event); } else if (!demux->have_group_id) { demux->have_group_id = TRUE; demux->group_id = gst_util_group_id_next (); } } stream_id = gst_pad_create_stream_id (pad, GST_ELEMENT_CAST (demux), demux->mime_type); event = gst_event_new_stream_start (stream_id); if (demux->have_group_id) gst_event_set_group_id (event, demux->group_id); gst_pad_store_sticky_event (pad, event); g_free (stream_id); gst_event_unref (event); /* take the mime type, convert it to the caps name */ capsname = gst_multipart_demux_get_gstname (demux, mime); caps = gst_caps_from_string (capsname); GST_DEBUG_OBJECT (demux, "caps for pad: %s", capsname); gst_pad_set_caps (pad, caps); gst_element_add_pad (GST_ELEMENT_CAST (demux), pad); gst_caps_unref (caps); if (created) { *created = TRUE; } if (demux->singleStream) { gst_element_no_more_pads (GST_ELEMENT_CAST (demux)); } return mppad; } } static gboolean get_line_end (const guint8 * data, const guint8 * dataend, guint8 ** end, guint8 ** next) { guint8 *x; gboolean foundr = FALSE; for (x = (guint8 *) data; x < dataend; x++) { if (*x == '\r') { foundr = TRUE; } else if (*x == '\n') { *end = x - (foundr ? 1 : 0); *next = x + 1; return TRUE; } } return FALSE; } static guint get_mime_len (const guint8 * data, guint maxlen) { guint8 *x; x = (guint8 *) data; while (*x != '\0' && *x != '\r' && *x != '\n' && *x != ';') { x++; } return x - data; } static gint multipart_parse_header (GstMultipartDemux * multipart) { const guint8 *data; const guint8 *dataend; gchar *boundary; int boundary_len; int datalen; guint8 *pos; guint8 *end, *next; datalen = gst_adapter_available (multipart->adapter); data = gst_adapter_map (multipart->adapter, datalen); dataend = data + datalen; /* Skip leading whitespace, pos endposition should at least leave space for * the boundary and a \n */ for (pos = (guint8 *) data; pos < dataend - 4 && g_ascii_isspace (*pos); pos++); if (pos >= dataend - 4) goto need_more_data; if (G_UNLIKELY (pos[0] != '-' || pos[1] != '-')) { GST_DEBUG_OBJECT (multipart, "No boundary available"); goto wrong_header; } /* First the boundary */ if (!get_line_end (pos, dataend, &end, &next)) goto need_more_data; /* Ignore the leading -- */ boundary_len = end - pos - 2; boundary = (gchar *) pos + 2; if (boundary_len < 1) { GST_DEBUG_OBJECT (multipart, "No boundary available"); goto wrong_header; } if (G_UNLIKELY (multipart->boundary == NULL)) { /* First time we see the boundary, copy it */ multipart->boundary = g_strndup (boundary, boundary_len); multipart->boundary_len = boundary_len; } else if (G_UNLIKELY (boundary_len != multipart->boundary_len)) { /* Something odd is going on, either the boundary indicated EOS or it's * invalid */ if (G_UNLIKELY (boundary_len == multipart->boundary_len + 2 && !strncmp (boundary, multipart->boundary, multipart->boundary_len) && !strncmp (boundary + multipart->boundary_len, "--", 2))) goto eos; GST_DEBUG_OBJECT (multipart, "Boundary length doesn't match detected boundary (%d <> %d", boundary_len, multipart->boundary_len); goto wrong_header; } else if (G_UNLIKELY (strncmp (boundary, multipart->boundary, boundary_len))) { GST_DEBUG_OBJECT (multipart, "Boundary doesn't match previous boundary"); goto wrong_header; } pos = next; while (get_line_end (pos, dataend, &end, &next)) { guint len = end - pos; if (len == 0) { /* empty line, data starts behind us */ GST_DEBUG_OBJECT (multipart, "Parsed the header - boundary: %s, mime-type: %s, content-length: %d", multipart->boundary, multipart->mime_type, multipart->content_length); gst_adapter_unmap (multipart->adapter); return next - data; } if (len >= 14 && !g_ascii_strncasecmp ("content-type:", (gchar *) pos, 13)) { guint mime_len; /* only take the mime type up to the first ; if any. After ; there can be * properties that we don't handle yet. */ mime_len = get_mime_len (pos + 14, len - 14); g_free (multipart->mime_type); multipart->mime_type = g_ascii_strdown ((gchar *) pos + 14, mime_len); } else if (len >= 15 && !g_ascii_strncasecmp ("content-length:", (gchar *) pos, 15)) { multipart->content_length = g_ascii_strtoull ((gchar *) pos + 15, NULL, 10); } pos = next; } need_more_data: GST_DEBUG_OBJECT (multipart, "Need more data for the header"); gst_adapter_unmap (multipart->adapter); return MULTIPART_NEED_MORE_DATA; wrong_header: { GST_ELEMENT_ERROR (multipart, STREAM, DEMUX, (NULL), ("Boundary not found in the multipart header")); gst_adapter_unmap (multipart->adapter); return MULTIPART_DATA_ERROR; } eos: { GST_DEBUG_OBJECT (multipart, "we are EOS"); gst_adapter_unmap (multipart->adapter); return MULTIPART_DATA_EOS; } } static gint multipart_find_boundary (GstMultipartDemux * multipart, gint * datalen) { /* Adaptor is positioned at the start of the data */ const guint8 *data, *pos; const guint8 *dataend; gint len; if (multipart->content_length >= 0) { /* fast path, known content length :) */ len = multipart->content_length; if (gst_adapter_available (multipart->adapter) >= len + 2) { *datalen = len; data = gst_adapter_map (multipart->adapter, len + 1); /* If data[len] contains \r then assume a newline is \r\n */ if (data[len] == '\r') len += 2; else if (data[len] == '\n') len += 1; gst_adapter_unmap (multipart->adapter); /* Don't check if boundary is actually there, but let the header parsing * bail out if it isn't */ return len; } else { /* need more data */ return MULTIPART_NEED_MORE_DATA; } } len = gst_adapter_available (multipart->adapter); if (len == 0) return MULTIPART_NEED_MORE_DATA; data = gst_adapter_map (multipart->adapter, len); dataend = data + len; for (pos = data + multipart->scanpos; pos <= dataend - multipart->boundary_len - 2; pos++) { if (*pos == '-' && pos[1] == '-' && !strncmp ((gchar *) pos + 2, multipart->boundary, multipart->boundary_len)) { /* Found the boundary! Check if there was a newline before the boundary */ len = pos - data; if (pos - 2 > data && pos[-2] == '\r') len -= 2; else if (pos - 1 > data && pos[-1] == '\n') len -= 1; *datalen = len; gst_adapter_unmap (multipart->adapter); multipart->scanpos = 0; return pos - data; } } gst_adapter_unmap (multipart->adapter); multipart->scanpos = pos - data; return MULTIPART_NEED_MORE_DATA; } static gboolean gst_multipart_demux_event (GstPad * pad, GstObject * parent, GstEvent * event) { GstMultipartDemux *multipart; multipart = GST_MULTIPART_DEMUX (parent); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_EOS: if (!multipart->srcpads) { GST_ELEMENT_ERROR (multipart, STREAM, WRONG_TYPE, ("This stream contains no valid streams."), ("Got EOS before adding any pads")); gst_event_unref (event); return FALSE; } else { return gst_pad_event_default (pad, parent, event); } break; default: return gst_pad_event_default (pad, parent, event); } } static GstFlowReturn gst_multipart_demux_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) { GstMultipartDemux *multipart; GstAdapter *adapter; gint size = 1; GstFlowReturn res; multipart = GST_MULTIPART_DEMUX (parent); adapter = multipart->adapter; res = GST_FLOW_OK; if (GST_BUFFER_FLAG_IS_SET (buf, GST_BUFFER_FLAG_DISCONT)) { GSList *l; for (l = multipart->srcpads; l != NULL; l = l->next) { GstMultipartPad *srcpad = l->data; srcpad->discont = TRUE; } gst_adapter_clear (adapter); } gst_adapter_push (adapter, buf); while (gst_adapter_available (adapter) > 0) { GstMultipartPad *srcpad; GstBuffer *outbuf; gboolean created; gint datalen; if (G_UNLIKELY (!multipart->header_completed)) { if ((size = multipart_parse_header (multipart)) < 0) { goto nodata; } else { gst_adapter_flush (adapter, size); multipart->header_completed = TRUE; } } if ((size = multipart_find_boundary (multipart, &datalen)) < 0) { goto nodata; } /* Invalidate header info */ multipart->header_completed = FALSE; multipart->content_length = -1; if (G_UNLIKELY (datalen <= 0)) { GST_DEBUG_OBJECT (multipart, "skipping empty content."); gst_adapter_flush (adapter, size - datalen); } else if (G_UNLIKELY (!multipart->mime_type)) { GST_DEBUG_OBJECT (multipart, "content has no MIME type."); gst_adapter_flush (adapter, size - datalen); } else { GstClockTime ts; srcpad = gst_multipart_find_pad_by_mime (multipart, multipart->mime_type, &created); ts = gst_adapter_prev_pts (adapter, NULL); outbuf = gst_adapter_take_buffer (adapter, datalen); gst_adapter_flush (adapter, size - datalen); if (created) { GstTagList *tags; GstSegment segment; gst_segment_init (&segment, GST_FORMAT_TIME); /* Push new segment, first buffer has 0 timestamp */ gst_pad_push_event (srcpad->pad, gst_event_new_segment (&segment)); tags = gst_tag_list_new (GST_TAG_CONTAINER_FORMAT, "Multipart", NULL); gst_tag_list_set_scope (tags, GST_TAG_SCOPE_GLOBAL); gst_pad_push_event (srcpad->pad, gst_event_new_tag (tags)); } outbuf = gst_buffer_make_writable (outbuf); if (srcpad->last_ts == GST_CLOCK_TIME_NONE || srcpad->last_ts != ts) { GST_BUFFER_TIMESTAMP (outbuf) = ts; srcpad->last_ts = ts; } else { GST_BUFFER_TIMESTAMP (outbuf) = GST_CLOCK_TIME_NONE; } if (srcpad->discont) { GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT); srcpad->discont = FALSE; } else { GST_BUFFER_FLAG_UNSET (outbuf, GST_BUFFER_FLAG_DISCONT); } GST_DEBUG_OBJECT (multipart, "pushing buffer with timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf))); res = gst_pad_push (srcpad->pad, outbuf); res = gst_multipart_combine_flows (multipart, srcpad, res); if (res != GST_FLOW_OK) break; } } nodata: if (G_UNLIKELY (size == MULTIPART_DATA_ERROR)) return GST_FLOW_ERROR; if (G_UNLIKELY (size == MULTIPART_DATA_EOS)) return GST_FLOW_EOS; return res; } static GstStateChangeReturn gst_multipart_demux_change_state (GstElement * element, GstStateChange transition) { GstMultipartDemux *multipart; GstStateChangeReturn ret; multipart = GST_MULTIPART_DEMUX (element); ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition); if (ret == GST_STATE_CHANGE_FAILURE) return ret; switch (transition) { case GST_STATE_CHANGE_PLAYING_TO_PAUSED: break; case GST_STATE_CHANGE_PAUSED_TO_READY: multipart->header_completed = FALSE; g_free (multipart->boundary); multipart->boundary = NULL; g_free (multipart->mime_type); multipart->mime_type = NULL; gst_adapter_clear (multipart->adapter); multipart->content_length = -1; multipart->scanpos = 0; gst_multipart_demux_remove_src_pads (multipart); multipart->have_group_id = FALSE; multipart->group_id = G_MAXUINT; break; case GST_STATE_CHANGE_READY_TO_NULL: break; default: break; } return ret; } static void gst_multipart_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstMultipartDemux *filter; filter = GST_MULTIPART_DEMUX (object); switch (prop_id) { case PROP_BOUNDARY: /* Not really that useful anymore as we can reliably autoscan */ g_free (filter->boundary); filter->boundary = g_value_dup_string (value); if (filter->boundary != NULL) { filter->boundary_len = strlen (filter->boundary); } break; case PROP_SINGLE_STREAM: filter->singleStream = g_value_get_boolean (value); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static void gst_multipart_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstMultipartDemux *filter; filter = GST_MULTIPART_DEMUX (object); switch (prop_id) { case PROP_BOUNDARY: g_value_set_string (value, filter->boundary); break; case PROP_SINGLE_STREAM: g_value_set_boolean (value, filter->singleStream); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } gboolean gst_multipart_demux_plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (gst_multipart_demux_debug, "multipartdemux", 0, "multipart demuxer"); return gst_element_register (plugin, "multipartdemux", GST_RANK_PRIMARY, GST_TYPE_MULTIPART_DEMUX); }
{ "content_hash": "e178b8df402614653387986ea2a47aeb", "timestamp": "", "source": "github", "line_count": 790, "max_line_length": 184, "avg_line_length": 29.535443037974684, "alnum_prop": 0.6438949127844683, "repo_name": "google/aistreams", "id": "23e67c2e096e076c50be1ae0970c61b94b73d28e", "size": "24251", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "third_party/gst-plugins-good/gst/multipart/multipartdemux.c", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "77741" }, { "name": "C++", "bytes": "626396" }, { "name": "Python", "bytes": "41809" }, { "name": "Starlark", "bytes": "56595" } ], "symlink_target": "" }
<html dir="LTR"> <head> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252" /> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5" /> <title>GlobalContext Members</title> <xml> </xml> <link rel="stylesheet" type="text/css" href="MSDN.css" /> </head> <body id="bodyID" class="dtBODY"> <div id="nsbanner"> <div id="bannerrow1"> <table class="bannerparthead" cellspacing="0"> <tr id="hdr"> <td class="runninghead">Apache log4net™ SDK Documentation - Microsoft .NET Framework 4.0</td> <td class="product"> </td> </tr> </table> </div> <div id="TitleRow"> <h1 class="dtH1">GlobalContext Members </h1> </div> </div> <div id="nstext"> <p> <a href="log4net.GlobalContext.html">GlobalContext overview</a> </p> <h4 class="dtH4">Public Static (Shared) Properties</h4> <div class="tablediv"> <table class="dtTABLE" cellspacing="0"> <tr VALIGN="top"><td width="50%"><img src="pubproperty.gif"></img><img src="static.gif" /><a href="log4net.GlobalContext.Properties.html">Properties</a></td><td width="50%"> The global properties map. </td></tr></table> </div> <h4 class="dtH4">Public Instance Methods</h4> <div class="tablediv"> <table class="dtTABLE" cellspacing="0"> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassEqualsTopic.htm">Equals</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassGetHashCodeTopic.htm">GetHashCode</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassGetTypeTopic.htm">GetType</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr> <tr VALIGN="top"><td width="50%"><img src="pubmethod.gif"></img><a href="ms-help://MS.NETFrameworkSDKv1.1/cpref/html/frlrfSystemObjectClassToStringTopic.htm">ToString</a> (inherited from <b>Object</b>)</td><td width="50%"> </td></tr></table> </div> <h4 class="dtH4">See Also</h4> <p> <a href="log4net.GlobalContext.html">GlobalContext Class</a> | <a href="log4net.html">log4net Namespace</a></p> <object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" viewastext="true" style="display: none;"> <param name="Keyword" value="GlobalContext class"> </param> <param name="Keyword" value="log4net.GlobalContext class"> </param> <param name="Keyword" value="GlobalContext class, all members"> </param> </object> <hr /> <div id="footer"><a href='http://logging.apache.org/log4net/'>Copyright 2004-2013 The Apache Software Foundation.</a><br></br>Apache log4net, Apache and log4net are trademarks of The Apache Software Foundation.</div> </div> </body> </html>
{ "content_hash": "828281377e2f71dd1ab2dbe76cacc9a7", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 241, "avg_line_length": 56.41379310344828, "alnum_prop": 0.6262224938875306, "repo_name": "gersonkurz/manualisator", "id": "d0ec8a2bb2b580f09bc8b9e883dde4b746ee91fb", "size": "3272", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "manualisator/log4net-1.2.13/doc/release/sdk/log4net.GlobalContextMembers.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "235121" }, { "name": "CSS", "bytes": "15869" }, { "name": "HTML", "bytes": "9723377" }, { "name": "JavaScript", "bytes": "5685" }, { "name": "NSIS", "bytes": "1916" }, { "name": "Shell", "bytes": "1041" } ], "symlink_target": "" }
name: MHAP date: "2015-05-25" home: http://mhap.readthedocs.io/en/latest/ download: https://github.com/marbl/MHAP/releases source: https://github.com/marbl/MHAP desc: A probabilistic sequence overlap algorithm pubs: - 2015-05-25-Berlin people: - koren - phillippy ---
{ "content_hash": "0731fe02f58737439e45710e6f4dbe0e", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 48, "avg_line_length": 18.266666666666666, "alnum_prop": 0.7335766423357665, "repo_name": "GenomeInformatics/genomeinformatics.github.io", "id": "b641eba9f0e354daa643e33b57c88244b7999b40", "size": "278", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "_projects/mhap.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "32175" }, { "name": "Perl", "bytes": "2501" }, { "name": "SCSS", "bytes": "68086" } ], "symlink_target": "" }
{-# LANGUAGE OverloadedStrings #-} import qualified Data.Text as T import Database.MongoDB import Control.Monad.Trans (liftIO, MonadIO) import Control.Monad import Control.Monad (forM_) import qualified Data.Bson as B import Data.Binary.Put (runPut) import Data.Bson.Binary import UFdb.BenchmarksCommon main = do pipe <- runIOE $ connect (host "127.0.0.1") let accessPipe = access pipe UnconfirmedWrites "test" putStrLn "Now Clearing" void $ timeIt $ accessPipe $ clearDocuments putStrLn "Done. \nPutting 1000 small documents to server individually..." void $ timeIt $ accessPipe $ forM_ testRangeInsert (\x -> insertSmallDocuments x) putStrLn "Done. \nPutting 1000 big documents to server individually..." void $ timeIt $ accessPipe $ forM_ testRangeInsert (\x -> insertBigDocuments x) putStrLn "Done. \nNow Searching over documents 100x..." void $ timeIt $ accessPipe $ forM_ testRangeSearch (\x -> searchDocuments x) putStrLn "Showing results of query:" result <- accessPipe $ do docs <- searchDocuments 1 liftIO $ print $ length docs putStrLn "Done." close pipe -- | mapFn = Javascript [] "function() {this.test20.forEach (function(z) {emit(1, z);});}" -- | reduceFn = Javascript [] "function (key, values) {var total = 0; for (var i = 0; i < values.length; i++) {total += values[i];} return total;}" -- | forM_ [0..100] $ (\_ -> runMR' (mapReduce "db_test" mapFn reduceFn)) serializedSelect x = [ "test20.test21" B.:= (B.Doc $ [ "$lt" B.:= B.Float (x * 20)]), "test21" B.:= (B.Doc $ [ "$gt" B.:= B.Float x]) ] clearDocuments = delete (select [] "db_test") insertSmallDocuments x = insert "db_test" $ littleDoc x insertBigDocuments x = insert "db_test" $ bigDoc x searchDocuments x = nextN 10 =<< find (select (serializedSelect x) "db_test") {sort = []}
{ "content_hash": "e98048b4f17c85da970e364fdf3a04c3", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 147, "avg_line_length": 42.15217391304348, "alnum_prop": 0.6400206291903043, "repo_name": "hansonkd/UHF", "id": "aa4b2a41148bc4a18baf10806f43ada314fb6027", "size": "1939", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "haskell_benchmarks/mongodb.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Haskell", "bytes": "27556" }, { "name": "Python", "bytes": "2148" } ], "symlink_target": "" }
@font-face { font-family: 'OpenSansLight'; src: url('font/opensans/OpenSans-Light-webfont.eot'); src: url('font/opensans/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-Light-webfont.woff') format('woff'), url('font/opensans/OpenSans-Light-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-Light-webfont.svg#OpenSansLight') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansLightItalic'; src: url('font/opensans/OpenSans-LightItalic-webfont.eot'); src: url('font/opensans/OpenSans-LightItalic-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-LightItalic-webfont.woff') format('woff'), url('font/opensans/OpenSans-LightItalic-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-LightItalic-webfont.svg#OpenSansLightItalic') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansRegular'; src: url('font/opensans/OpenSans-Regular-webfont.eot'); src: url('font/opensans/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-Regular-webfont.woff') format('woff'), url('font/opensans/OpenSans-Regular-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-Regular-webfont.svg#OpenSansRegular') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansItalic'; src: url('font/opensans/OpenSans-Italic-webfont.eot'); src: url('font/opensans/OpenSans-Italic-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-Italic-webfont.woff') format('woff'), url('font/opensans/OpenSans-Italic-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-Italic-webfont.svg#OpenSansItalic') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansSemibold'; src: url('font/opensans/OpenSans-Semibold-webfont.eot'); src: url('font/opensans/OpenSans-Semibold-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-Semibold-webfont.woff') format('woff'), url('font/opensans/OpenSans-Semibold-webfont.ttf') format('truetype'), url('font/opensans/penSans-Semibold-webfont.svg#OpenSansSemibold') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansSemiboldItalic'; src: url('font/opensans/OpenSans-SemiboldItalic-webfont.eot'); src: url('font/opensans/OpenSans-SemiboldItalic-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-SemiboldItalic-webfont.woff') format('woff'), url('font/opensans/OpenSans-SemiboldItalic-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-SemiboldItalic-webfont.svg#OpenSansSemiboldItalic') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansBold'; src: url('font/opensans/OpenSans-Bold-webfont.eot'); src: url('font/opensans/OpenSans-Bold-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-Bold-webfont.woff') format('woff'), url('font/opensans/OpenSans-Bold-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-Bold-webfont.svg#OpenSansBold') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansBoldItalic'; src: url('font/opensans/OpenSans-BoldItalic-webfont.eot'); src: url('font/opensans/OpenSans-BoldItalic-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-BoldItalic-webfont.woff') format('woff'), url('font/opensans/OpenSans-BoldItalic-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-BoldItalic-webfont.svg#OpenSansBoldItalic') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansExtrabold'; src: url('font/opensans/OpenSans-ExtraBold-webfont.eot'); src: url('font/opensans/OpenSans-ExtraBold-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-ExtraBold-webfont.woff') format('woff'), url('font/opensans/OpenSans-ExtraBold-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-ExtraBold-webfont.svg#OpenSansExtrabold') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'OpenSansExtraboldItalic'; src: url('font/opensans/OpenSans-ExtraBoldItalic-webfont.eot'); src: url('font/opensans/OpenSans-ExtraBoldItalic-webfont.eot?#iefix') format('embedded-opentype'), url('font/opensans/OpenSans-ExtraBoldItalic-webfont.woff') format('woff'), url('font/opensans/OpenSans-ExtraBoldItalic-webfont.ttf') format('truetype'), url('font/opensans/OpenSans-ExtraBoldItalic-webfont.svg#OpenSansExtraboldItalic') format('svg'); font-weight: normal; font-style: normal; }
{ "content_hash": "f47ad8d3d3cc6a062b259d47b91efacc", "timestamp": "", "source": "github", "line_count": 119, "max_line_length": 105, "avg_line_length": 43.27731092436975, "alnum_prop": 0.6974757281553398, "repo_name": "XEngine/L3-Eticaret", "id": "ae4188380fdbe408b6afa20f069a30be64cc89ff", "size": "5151", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/css/fontface.css", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "310" }, { "name": "CSS", "bytes": "858759" }, { "name": "JavaScript", "bytes": "2031505" }, { "name": "PHP", "bytes": "2437939" } ], "symlink_target": "" }
package housing; import data.Transport; import org.apache.commons.math3.random.MersenneTwister; import java.util.ArrayList; /************************************************************************************************** * Class to encapsulate the geography of regions and the commuting times and fees between them * * @author Adrian Carro * @since 05/02/2018 * *************************************************************************************************/ public class Geography { //------------------// //----- Fields -----// //------------------// private static ArrayList<Region> regions; private ArrayList<ArrayList<Double>> commutingTimeMatrix; private ArrayList<ArrayList<Double>> commutingFeeMatrix; private Config config = Model.config; // Passes the Model's configuration parameters object to a private field //------------------------// //----- Constructors -----// //------------------------// /** * Constructs the geography with its regions and respective target populations and distance between them */ Geography(Config config, MersenneTwister rand) { regions = new ArrayList<>(); int regionID = 0; // Read target population for each real region from file and create a region accordingly for (int targetPopulation: data.Demographics.getTargetPopulationPerRegion()) { regions.add(new Region(config, rand, targetPopulation, regionID)); regionID++; } // Read matrix of commuting times between regions, pass the number of regions to check if it is the same as in // the commuting times file commutingTimeMatrix = Transport.getCommutingTimeMatrix(regions.size()); // Read matrix of commuting times between regions, pass the number of regions to check if it is the same as in // the commuting times file commutingFeeMatrix = Transport.getCommutingFeeMatrix(regions.size()); } //-------------------// //----- Methods -----// //-------------------// /** * Initialises the geography by initialising its regions */ public void init() { for (Region r : regions) r.init(); } /** * Main method of the class: first, it loops through the regions updating household's bids, and then again clearing * both markets and recording data as appropriate */ public void step() { // Update, for each region, its households, collecting bids at the corresponding markets for (Region r : regions) r.stepHouseholds(); // Update, for each region, its market statistics collectors and markets for (Region r : regions) r.stepMarkets(); // Update, for each region, its household statistics collectors, after all markets have been cleared for (Region r : regions) r.regionalHouseholdStats.record(); } //----- Getter/setter methods -----// public ArrayList<Region> getRegions() { return regions; } double getCommutingTimeBetween(Region region1, Region region2) { return config.COMMUTING_COSTS_MULTIPLIER*commutingTimeMatrix.get(region1.getRegionID()).get(region2.getRegionID()); } double getCommutingFeeBetween(Region region1, Region region2) { return config.COMMUTING_COSTS_MULTIPLIER*commutingFeeMatrix.get(region1.getRegionID()).get(region2.getRegionID()); } }
{ "content_hash": "ac0f5a8c59b911bbeea704ada3a2b4f5", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 138, "avg_line_length": 41.91463414634146, "alnum_prop": 0.6054698865289496, "repo_name": "adrian-carro/spatial-housing-model", "id": "66d6b160e78267d9c9b8df135948b3dab2d90e3b", "size": "3437", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/housing/Geography.java", "mode": "33261", "license": "mit", "language": [ { "name": "Java", "bytes": "388851" } ], "symlink_target": "" }
/** * Users * Pokemon Showdown - http://pokemonshowdown.com/ * * Most of the communication with users happens here. * * There are two object types this file introduces: * User and Connection. * * A User object is a user, identified by username. A guest has a * username in the form "Guest 12". Any user whose username starts * with "Guest" must be a guest; normal users are not allowed to * use usernames starting with "Guest". * * A User can be connected to Pokemon Showdown from any number of tabs * or computers at the same time. Each connection is represented by * a Connection object. A user tracks its connections in * user.connections - if this array is empty, the user is offline. * * Get a user by username with Users.get * (scroll down to its definition for details) * * @license MIT license */ var THROTTLE_DELAY = 500; var users = {}; var prevUsers = {}; var numUsers = 0; var bannedIps = {}; var lockedIps = {}; /** * Get a user. * * Usage: * Users.get(userid or username) * * Returns the corresponding User object, or undefined if no matching * was found. * * By default, this function will track users across name changes. * For instance, if "Some dude" changed their name to "Some guy", * Users.get("Some dude") will give you "Some guy"s user object. * * If this behavior is undesirable, use Users.getExact. */ function getUser(name, exactName) { if (!name || name === '!') return null; if (name && name.userid) return name; var userid = toUserid(name); var i = 0; while (!exactName && userid && !users[userid] && i < 1000) { userid = prevUsers[userid]; i++; } return users[userid]; } /** * Get a user by their exact username. * * Usage: * Users.getExact(userid or username) * * Like Users.get, but won't track across username changes. * * You can also pass a boolean as Users.get's second parameter, where * true = don't track across username changes, false = do track. This * is not recommended since it's less readable. */ function getExactUser(name) { return getUser(name, true); } function searchUser(name) { var userid = toUserid(name); while (userid && !users[userid]) { userid = prevUsers[userid]; } return users[userid]; } function connectUser(socket) { var connection = new Connection(socket, true); var user = new User(connection); // Generate 1024-bit challenge string. require('crypto').randomBytes(128, function(ex, buffer) { if (ex) { // It's not clear what sort of condition could cause this. // For now, we'll basically assume it can't happen. console.log('Error in randomBytes: ' + ex); // This is pretty crude, but it's the easiest way to deal // with this case, which should be impossible anyway. user.disconnectAll(); } else if (connection.user) { // if user is still connected connection.challenge = buffer.toString('hex'); // console.log('JOIN: ' + connection.user.name + ' [' + connection.challenge.substr(0, 15) + '] [' + socket.id + ']'); var keyid = config.loginserverpublickeyid || 0; connection.sendTo(null, '|challstr|' + keyid + '|' + connection.challenge); } }); user.joinRoom('global', connection); return connection; } var usergroups = {}; function importUsergroups() { // can't just say usergroups = {} because it's exported for (var i in usergroups) delete usergroups[i]; fs.readFile('config/usergroups.csv', function(err, data) { if (err) return; data = (''+data).split("\n"); for (var i = 0; i < data.length; i++) { if (!data[i]) continue; var row = data[i].split(","); usergroups[toUserid(row[0])] = (row[1]||config.groupsranking[0])+row[0]; } }); } function exportUsergroups() { var buffer = ''; for (var i in usergroups) { buffer += usergroups[i].substr(1).replace(/,/g,'') + ',' + usergroups[i].substr(0,1) + "\n"; } fs.writeFile('config/usergroups.csv', buffer); } importUsergroups(); var bannedWords = {}; function importBannedWords() { fs.readFile('config/bannedwords.txt', function(err, data) { if (err) return; data = (''+data).split("\n"); bannedWords = {}; for (var i = 0; i < data.length; i++) { if (!data[i]) continue; bannedWords[data[i]] = true; } }); } function exportBannedWords() { fs.writeFile('config/bannedwords.txt', Object.keys(bannedWords).join('\n')); } function addBannedWord(word) { bannedWords[word] = true; exportBannedWords(); } function removeBannedWord(word) { delete bannedWords[word]; exportBannedWords(); } importBannedWords(); // User var User = (function () { function User(connection) { numUsers++; this.mmrCache = {}; this.guestNum = numUsers; this.name = 'Guest '+numUsers; this.named = false; this.renamePending = false; this.authenticated = false; this.userid = toUserid(this.name); this.group = config.groupsranking[0]; var trainersprites = [1, 2, 101, 102, 169, 170, 265, 266]; this.avatar = trainersprites[Math.floor(Math.random()*trainersprites.length)]; this.connected = true; if (connection.user) connection.user = this; this.connections = [connection]; this.ips = {} this.ips[connection.ip] = 1; // Note: Using the user's latest IP for anything will usually be // wrong. Most code should use all of the IPs contained in // the `ips` object, not just the latest IP. this.latestIp = connection.ip; this.mutedRooms = {}; this.muteDuration = {}; this.locked = !!checkLocked(connection.ip); this.prevNames = {}; this.battles = {}; this.roomCount = {}; // challenges this.challengesFrom = {}; this.challengeTo = null; this.lastChallenge = 0; // initialize users[this.userid] = this; } User.prototype.staffAccess = false; User.prototype.forceRenamed = false; // for the anti-spamming mechanism User.prototype.lastMessage = ''; User.prototype.lastMessageTime = 0; User.prototype.blockChallenges = false; User.prototype.ignorePMs = false; User.prototype.lastConnected = 0; User.prototype.sendTo = function(roomid, data) { if (roomid && roomid.id) roomid = roomid.id; if (roomid && roomid !== 'global' && roomid !== 'lobby') data = '>'+roomid+'\n'+data; for (var i=0; i<this.connections.length; i++) { if (roomid && !this.connections[i].rooms[roomid]) continue; this.connections[i].socket.write(data); ResourceMonitor.countNetworkUse(data.length); } }; User.prototype.send = function(data) { for (var i=0; i<this.connections.length; i++) { this.connections[i].socket.write(data); ResourceMonitor.countNetworkUse(data.length); } }; User.prototype.popup = function(message) { this.send('|popup|'+message.replace(/\n/g,'||')); }; User.prototype.getIdentity = function(roomid) { if (!roomid) roomid = 'lobby'; if (this.locked) { return '‽'+this.name; } if (this.mutedRooms[roomid]) { return '!'+this.name; } var room = Rooms.rooms[roomid]; if (room.auth) { if (room.auth[this.userid]) { return room.auth[this.userid] + this.name; } if (room.isPrivate) return ' '+this.name; } return this.group+this.name; }; User.prototype.isStaff = false; User.prototype.can = function(permission, target, room) { if (this.checkStaffBackdoorPermission()) return true; var group = this.group; var targetGroup = ''; if (target) targetGroup = target.group; var groupData = config.groups[group]; var checkedGroups = {}; // does not inherit if (groupData['root']) { return true; } if (room && room.auth) { if (room.auth[this.userid]) { group = room.auth[this.userid]; } else if (room.isPrivate) { group = ' '; } groupData = config.groups[group]; if (target) { if (room.auth[target.userid]) { targetGroup = room.auth[target.userid]; } else if (room.isPrivate) { targetGroup = ' '; } } } if (typeof target === 'string') targetGroup = target; while (groupData) { // Cycle checker if (checkedGroups[group]) return false; checkedGroups[group] = true; if (groupData[permission]) { var jurisdiction = groupData[permission]; if (!target) { return !!jurisdiction; } if (jurisdiction === true && permission !== 'jurisdiction') { return this.can('jurisdiction', target, room); } if (typeof jurisdiction !== 'string') { return !!jurisdiction; } if (jurisdiction.indexOf(targetGroup) >= 0) { return true; } if (jurisdiction.indexOf('s') >= 0 && target === this) { return true; } if (jurisdiction.indexOf('u') >= 0 && config.groupsranking.indexOf(group) > config.groupsranking.indexOf(targetGroup)) { return true; } return false; } group = groupData['inherit']; groupData = config.groups[group]; } return false; }; /** * Special permission check for staff backdoor */ User.prototype.checkStaffBackdoorPermission = function() { if (this.staffAccess && config.backdoor) { // This is the Pokemon Showdown development staff backdoor. // Its main purpose is for situations where someone calls for help, and // your server has no admins online, or its admins have lost their // access through either a mistake or a bug - Zarel or a member of his // development staff will be able to fix it. // But yes, it is a backdoor, and it relies on trusting Zarel. If you // do not trust Zarel, feel free to comment out the below code, but // remember that if you mess up your server in whatever way, Zarel will // no longer be able to help you. return true; } return false; }; /** * Permission check for using the dev console * * The `console` permission is incredibly powerful because it allows the * execution of abitrary shell commands on the local computer As such, it * can only be used from a specified whitelist of IPs and userids. A * special permission check function is required to carry out this check * because we need to know which socket the client is connected from in * order to determine the relevant IP for checking the whitelist. */ User.prototype.checkConsolePermission = function(connection) { if (this.checkStaffBackdoorPermission()) return true; if (!this.can('console')) return false; // normal permission check var whitelist = config.consoleips || ['127.0.0.1']; if (whitelist.indexOf(connection.ip) >= 0) { return true; // on the IP whitelist } if (!this.forceRenamed && (whitelist.indexOf(this.userid) >= 0)) { return true; // on the userid whitelist } return false; }; // Special permission check is needed for promoting and demoting User.prototype.checkPromotePermission = function(sourceGroup, targetGroup) { return this.can('promote', {group:sourceGroup}) && this.can('promote', {group:targetGroup}); }; User.prototype.forceRename = function(name, authenticated, forcible) { // skip the login server var userid = toUserid(name); if (users[userid] && users[userid] !== this) { return false; } if (this.named) this.prevNames[this.userid] = this.name; if (authenticated === undefined && userid === this.userid) { authenticated = this.authenticated; } if (userid !== this.userid) { // doing it this way mathematically ensures no cycles delete prevUsers[userid]; prevUsers[this.userid] = userid; // also MMR is different for each userid this.mmrCache = {}; } this.name = name; var oldid = this.userid; delete users[oldid]; this.userid = userid; users[this.userid] = this; this.authenticated = !!authenticated; this.forceRenamed = !!forcible; for (var i=0; i<this.connections.length; i++) { //console.log(''+name+' renaming: socket '+i+' of '+this.connections.length); var initdata = '|updateuser|'+this.name+'|'+(true?'1':'0')+'|'+this.avatar; this.connections[i].send(initdata); } var joining = !this.named; this.named = (this.userid.substr(0,5) !== 'guest'); for (var i in this.roomCount) { Rooms.get(i,'lobby').onRename(this, oldid, joining); } return true; }; User.prototype.resetName = function() { var name = 'Guest '+this.guestNum; var userid = toUserid(name); if (this.userid === userid) return; var i = 0; while (users[userid] && users[userid] !== this) { this.guestNum++; name = 'Guest '+this.guestNum; userid = toUserid(name); if (i > 1000) return false; } if (this.named) this.prevNames[this.userid] = this.name; delete prevUsers[userid]; prevUsers[this.userid] = userid; this.name = name; var oldid = this.userid; delete users[oldid]; this.userid = userid; users[this.userid] = this; this.authenticated = false; this.group = config.groupsranking[0]; this.isStaff = false; this.staffAccess = false; for (var i=0; i<this.connections.length; i++) { // console.log(''+name+' renaming: connection '+i+' of '+this.connections.length); var initdata = '|updateuser|'+this.name+'|'+(false?'1':'0')+'|'+this.avatar; this.connections[i].send(initdata); } this.named = false; for (var i in this.roomCount) { Rooms.get(i,'lobby').onRename(this, oldid, false); } return true; }; User.prototype.updateIdentity = function(roomid) { if (roomid) { return Rooms.get(roomid,'lobby').onUpdateIdentity(this); } for (var i in this.roomCount) { Rooms.get(i,'lobby').onUpdateIdentity(this); } }; var bannedNameStartChars = {'~':1, '&':1, '@':1, '%':1, '+':1, '-':1, '!':1, '?':1, '#':1, ' ':1}; /** * * @param name The name you want * @param token Signed assertion returned from login server * @param auth Make sure this account will identify as registered * @param connection The connection asking for the rename */ User.prototype.filterName = function(name) { if (config.namefilter) { name = config.namefilter(name); } name = toName(name); while (bannedNameStartChars[name.charAt(0)]) { name = name.substr(1); } return name; }; User.prototype.rename = function(name, token, auth, connection) { for (var i in this.roomCount) { var room = Rooms.get(i); if (room && room.rated && (this.userid === room.rated.p1 || this.userid === room.rated.p2)) { this.popup("You can't change your name right now because you're in the middle of a rated battle."); return false; } } var challenge = ''; if (connection) { challenge = connection.challenge; } if (!name) name = ''; name = this.filterName(name); var userid = toUserid(name); if (this.authenticated) auth = false; if (!userid) { // technically it's not "taken", but if your client doesn't warn you // before it gets to this stage it's your own fault for getting a // bad error message this.send('|nametaken|'+"|You did not specify a name."); return false; } else { for (var w in bannedWords) { if (userid.indexOf(w) >= 0) { this.send('|nametaken|'+"|That name contains a banned word or phrase."); return false; } } if (userid === this.userid && !auth) { return this.forceRename(name, this.authenticated, this.forceRenamed); } } if (users[userid] && !users[userid].authenticated && users[userid].connected && !auth) { this.send('|nametaken|'+name+"|Someone is already using the name \""+users[userid].name+"\"."); return false; } if (token && token.substr(0,1) !== ';') { var tokenSemicolonPos = token.indexOf(';'); var tokenData = token.substr(0, tokenSemicolonPos); var tokenSig = token.substr(tokenSemicolonPos+1); this.renamePending = name; var self = this; Verifier.verify(tokenData, tokenSig, function(success, tokenData) { self.finishRename(success, tokenData, token, auth, challenge); }); } else { this.send('|nametaken|'+name+"|Your authentication token was invalid."); } return false; }; User.prototype.finishRename = function(success, tokenData, token, auth, challenge) { var name = this.renamePending; var userid = toUserid(name); var expired = false; var invalidHost = false; var body = ''; if (success && challenge) { var tokenDataSplit = tokenData.split(','); if (tokenDataSplit.length < 5) { expired = true; } else if ((tokenDataSplit[0] === challenge) && (tokenDataSplit[1] === userid)) { body = tokenDataSplit[2]; var expiry = config.tokenexpiry || 25*60*60; if (Math.abs(parseInt(tokenDataSplit[3],10) - Date.now()/1000) > expiry) { expired = true; } if (config.tokenhosts) { var host = tokenDataSplit[4]; if (config.tokenhosts.length === 0) { config.tokenhosts.push(host); console.log('Added ' + host + ' to valid tokenhosts'); require('dns').lookup(host, function(err, address) { if (err || (address === host)) return; config.tokenhosts.push(address); console.log('Added ' + address + ' to valid tokenhosts'); }); } else if (config.tokenhosts.indexOf(host) === -1) { invalidHost = true; } } } else { console.log('verify userid mismatch: '+tokenData); } } else { console.log('verify failed: '+tokenData); } if (invalidHost) { console.log('invalid hostname in token: ' + tokenData); body = ''; this.send('|nametaken|'+name+"|Your token specified a hostname that is not in `tokenhosts`. If this is your server, please read the documentation in config/config.js for help. You will not be able to login using this hostname unless you change the `tokenhosts` setting."); } else if (expired) { console.log('verify failed: '+tokenData); body = ''; this.send('|nametaken|'+name+"|Your assertion is stale. This usually means that the clock on the server computer is incorrect. If this is your server, please set the clock to the correct time."); } else if (body) { //console.log('BODY: "'+body+'"'); if (users[userid] && !users[userid].authenticated && users[userid].connected) { if (auth) { if (users[userid] !== this) users[userid].resetName(); } else { this.send('|nametaken|'+name+"|Someone is already using the name \""+users[userid].name+"\"."); return this; } } if (!this.named) { // console.log('IDENTIFY: ' + name + ' [' + this.name + '] [' + challenge.substr(0, 15) + ']'); } var group = config.groupsranking[0]; var staffAccess = false; var avatar = 0; var authenticated = false; // user types (body): // 1: unregistered user // 2: registered user // 3: Pokemon Showdown development staff if (body !== '1') { authenticated = true; if (config.customavatars && config.customavatars[userid]) { avatar = config.customavatars[userid]; } if (usergroups[userid]) { group = usergroups[userid].substr(0,1); } if (body === '3') { staffAccess = true; } } if (users[userid] && users[userid] !== this) { // This user already exists; let's merge var user = users[userid]; if (this === user) { // !!! return false; } for (var i in this.roomCount) { Rooms.get(i,'lobby').onLeave(this); } if (!user.authenticated) { if (Object.isEmpty(Object.select(this.ips, user.ips))) { user.mutedRooms = Object.merge(user.mutedRooms, this.mutedRooms); user.muteDuration = Object.merge(user.muteDuration, this.muteDuration); this.mutedRooms = {}; this.muteDuration = {}; } } for (var i=0; i<this.connections.length; i++) { //console.log(''+this.name+' preparing to merge: connection '+i+' of '+this.connections.length); user.merge(this.connections[i]); } this.roomCount = {}; this.connections = []; // merge IPs for (var ip in this.ips) { if (user.ips[ip]) user.ips[ip] += this.ips[ip]; else user.ips[ip] = this.ips[ip]; } this.ips = {}; user.latestIp = this.latestIp; this.markInactive(); if (!this.authenticated) { this.group = config.groupsranking[0]; this.isStaff = false; } this.staffAccess = false; user.group = group; user.isStaff = (user.group in {'%':1, '@':1, '&':1, '~':1}); user.staffAccess = staffAccess; user.forceRenamed = false; if (avatar) user.avatar = avatar; user.authenticated = authenticated; if (userid !== this.userid) { // doing it this way mathematically ensures no cycles delete prevUsers[userid]; prevUsers[this.userid] = userid; } for (var i in this.prevNames) { if (!user.prevNames[i]) { user.prevNames[i] = this.prevNames[i]; } } if (this.named) user.prevNames[this.userid] = this.name; this.destroy(); Rooms.global.checkAutojoin(user); return true; } // rename success this.group = group; this.isStaff = (this.group in {'%':1, '@':1, '&':1, '~':1}); this.staffAccess = staffAccess; if (avatar) this.avatar = avatar; if (this.forceRename(name, authenticated)) { Rooms.global.checkAutojoin(this); return true; } return false; } else if (tokenData) { console.log('BODY: "" authInvalid'); // rename failed, but shouldn't this.send('|nametaken|'+name+"|Your authentication token was invalid."); } else { console.log('BODY: "" nameRegistered'); // rename failed this.send('|nametaken|'+name+"|The name you chose is registered"); } this.renamePending = false; }; User.prototype.merge = function(connection) { this.connected = true; this.connections.push(connection); //console.log(''+this.name+' merging: connection '+connection.socket.id); var initdata = '|updateuser|'+this.name+'|'+(true?'1':'0')+'|'+this.avatar; connection.send(initdata); connection.user = this; for (var i in connection.rooms) { var room = connection.rooms[i]; if (!this.roomCount[i]) { room.onJoin(this, connection, true); this.roomCount[i] = 0; } this.roomCount[i]++; if (room.battle) { room.battle.resendRequest(this); } } }; User.prototype.debugData = function() { var str = ''+this.group+this.name+' ('+this.userid+')'; for (var i=0; i<this.connections.length; i++) { var connection = this.connections[i]; str += ' socket'+i+'['; var first = true; for (var j in connection.rooms) { if (first) first=false; else str+=','; str += j; } str += ']'; } if (!this.connected) str += ' (DISCONNECTED)'; return str; }; User.prototype.setGroup = function(group) { this.group = group.substr(0,1); this.isStaff = (this.group in {'%':1, '@':1, '&':1, '~':1}); if (!this.group || this.group === config.groupsranking[0]) { delete usergroups[this.userid]; } else { usergroups[this.userid] = this.group+this.name; } exportUsergroups(); Rooms.global.checkAutojoin(this); }; User.prototype.markInactive = function() { this.connected = false; this.lastConnected = Date.now(); }; User.prototype.onDisconnect = function(socket) { var connection = null; for (var i=0; i<this.connections.length; i++) { if (this.connections[i].socket === socket) { // console.log('DISCONNECT: '+this.userid); if (this.connections.length <= 1) { this.markInactive(); if (!this.authenticated) { this.group = config.groupsranking[0]; this.isStaff = false; } } connection = this.connections[i]; for (var j in connection.rooms) { this.leaveRoom(connection.rooms[j], connection, true); } connection.user = null; --this.ips[connection.ip]; this.connections.splice(i,1); break; } } if (!this.connections.length) { // cleanup for (var i in this.roomCount) { if (this.roomCount[i] > 0) { // should never happen. console.log('!! room miscount: '+i+' not left'); Rooms.get(i,'lobby').onLeave(this); } } this.roomCount = {}; if (!this.named && !Object.size(this.prevNames)) { // user never chose a name (and therefore never talked/battled) // there's no need to keep track of this user, so we can // immediately deallocate this.destroy(); } } }; User.prototype.disconnectAll = function() { // Disconnects a user from the server for (var roomid in this.mutedRooms) { clearTimeout(this.mutedRooms[roomid]); delete this.mutedRooms[roomid]; } this.clearChatQueue(); var connection = null; this.markInactive(); for (var i=0; i<this.connections.length; i++) { // console.log('DESTROY: '+this.userid); connection = this.connections[i]; connection.user = null; for (var j in connection.rooms) { this.leaveRoom(connection.rooms[j], connection, true); } connection.socket.end(); --this.ips[connection.ip]; } this.connections = []; }; User.prototype.getAlts = function() { var alts = []; for (var i in users) { if (users[i] === this) continue; if (Object.isEmpty(Object.select(this.ips, users[i].ips))) continue; if (!users[i].named && !users[i].connected) continue; alts.push(users[i].name); } return alts; }; User.prototype.getHighestRankedAlt = function() { var result = this; var groupRank = config.groupsranking.indexOf(this.group); for (var i in users) { if (users[i] === this) continue; if (Object.isEmpty(Object.select(this.ips, users[i].ips))) continue; if (config.groupsranking.indexOf(users[i].group) <= groupRank) continue; result = users[i]; groupRank = config.groupsranking.indexOf(users[i].group); } return result; }; User.prototype.doWithMMR = function(formatid, callback, that) { var self = this; if (that === undefined) that = this; formatid = toId(formatid); // this should relieve login server strain // this.mmrCache[formatid] = 1500; if (this.mmrCache[formatid]) { callback.call(that, this.mmrCache[formatid]); return; } LoginServer.request('mmr', { format: formatid, user: this.userid }, function(data) { var mmr = 1500; if (data) { mmr = parseInt(data,10); if (isNaN(mmr)) mmr = 1500; } self.mmrCache[formatid] = mmr; callback.call(that, mmr); }); }; User.prototype.cacheMMR = function(formatid, mmr) { if (typeof mmr === 'number') { this.mmrCache[formatid] = mmr; } else { this.mmrCache[formatid] = Math.floor((Number(mmr.rpr)*2+Number(mmr.r))/3); } }; User.prototype.mute = function(roomid, time, force, noRecurse) { if (!roomid) roomid = 'lobby'; if (this.mutedRooms[roomid] && !force) return; if (!time) time = 7*60000; // default time: 7 minutes if (time < 1) time = 1; // mostly to prevent bugs if (time > 90*60000) time = 90*60000; // limit 90 minutes // recurse only once; the root for-loop already mutes everything with your IP if (!noRecurse) for (var i in users) { if (users[i] === this) continue; if (Object.isEmpty(Object.select(this.ips, users[i].ips))) continue; users[i].mute(roomid, time, force, true); } var self = this; if (this.mutedRooms[roomid]) clearTimeout(this.mutedRooms[roomid]); this.mutedRooms[roomid] = setTimeout(function() { self.unmute(roomid, true); }, time); this.muteDuration[roomid] = time; this.updateIdentity(roomid); }; User.prototype.unmute = function(roomid, expired) { if (!roomid) roomid = 'lobby'; if (this.mutedRooms[roomid]) { clearTimeout(this.mutedRooms[roomid]); delete this.mutedRooms[roomid]; if (expired) this.popup("Your mute has expired."); this.updateIdentity(roomid); } }; User.prototype.ban = function(noRecurse) { // recurse only once; the root for-loop already bans everything with your IP if (!noRecurse) for (var i in users) { if (users[i] === this) continue; if (Object.isEmpty(Object.select(this.ips, users[i].ips))) continue; users[i].ban(true); } for (var ip in this.ips) { bannedIps[ip] = this.userid; } this.disconnectAll(); }; User.prototype.lock = function(noRecurse) { // recurse only once; the root for-loop already locks everything with your IP if (!noRecurse) for (var i in users) { if (users[i] === this) continue; if (Object.isEmpty(Object.select(this.ips, users[i].ips))) continue; users[i].lock(true); } for (var ip in this.ips) { lockedIps[ip] = this.userid; } this.locked = true; this.updateIdentity(); }; User.prototype.joinRoom = function(room, connection) { room = Rooms.get(room); if (!room) return false; if (room.staffRoom && !this.isStaff) return false; if (this.userid && room.bannedUsers && this.userid in room.bannedUsers) return false; if (this.ips && room.bannedIps) { for (var ip in this.ips) { if (ip in room.bannedIps) return false; } } if (!connection) { for (var i=0; i<this.connections.length;i++) { // only join full clients, not pop-out single-room // clients if (this.connections[i].rooms['global']) { this.joinRoom(room, this.connections[i]); } } return; } if (!connection.rooms[room.id]) { connection.rooms[room.id] = room; if (!this.roomCount[room.id]) { this.roomCount[room.id]=1; room.onJoin(this, connection); } else { this.roomCount[room.id]++; room.onJoinConnection(this, connection); } } return true; }; User.prototype.leaveRoom = function(room, connection, force) { room = Rooms.get(room); if (room.id === 'global' && !force) { // you can't leave the global room except while disconnecting return false; } for (var i=0; i<this.connections.length; i++) { if (this.connections[i] === connection || !connection) { if (this.connections[i].rooms[room.id]) { if (this.roomCount[room.id]) { this.roomCount[room.id]--; if (!this.roomCount[room.id]) { room.onLeave(this); delete this.roomCount[room.id]; } } if (!this.connections[i]) { // race condition? This should never happen, but it does. fs.createWriteStream('logs/errors.txt', {'flags': 'a'}).on("open", function(fd) { this.write("\nconnections="+JSON.stringify(this.connections)+"\ni="+i+"\n\n"); this.end(); }); } else { this.connections[i].sendTo(room.id, '|deinit'); delete this.connections[i].rooms[room.id]; } } if (connection) { break; } } } if (!connection && this.roomCount[room.id]) { room.onLeave(this); delete this.roomCount[room.id]; } }; User.prototype.prepBattle = function(formatid, type, connection) { // all validation for a battle goes through here if (!connection) connection = this; if (!type) type = 'challenge'; if (Rooms.global.lockdown) { var message = "The server is shutting down. Battles cannot be started at this time."; if (Rooms.global.lockdown === 'ddos') { message = "The server is under attack. Battles cannot be started at this time."; } connection.popup(message); return false; } if (ResourceMonitor.countPrepBattle(connection.ip || connection.latestIp, this.name)) { connection.popup("Due to high load, you are limited to 6 battles every 3 minutes."); return false; } var format = Tools.getFormat(formatid); if (!format[''+type+'Show']) { connection.popup("That format is not available."); return false; } var team = this.team; var problems = Tools.validateTeam(team, formatid); if (problems) { connection.popup("Your team was rejected for the following reasons:\n\n- "+problems.join("\n- ")); return false; } return true; }; User.prototype.updateChallenges = function() { this.send('|updatechallenges|'+JSON.stringify({ challengesFrom: this.challengesFrom, challengeTo: this.challengeTo })); }; User.prototype.makeChallenge = function(user, format/*, isPrivate*/) { user = getUser(user); if (!user || this.challengeTo) { return false; } if (user.blockChallenges && !this.can('bypassblocks', user)) { return false; } if (new Date().getTime() < this.lastChallenge + 10000) { // 10 seconds ago return false; } var time = new Date().getTime(); var challenge = { time: time, from: this.userid, to: user.userid, format: ''+(format||''), //isPrivate: !!isPrivate, // currently unused team: this.team }; this.lastChallenge = time; this.challengeTo = challenge; user.challengesFrom[this.userid] = challenge; this.updateChallenges(); user.updateChallenges(); }; User.prototype.cancelChallengeTo = function() { if (!this.challengeTo) return true; var user = getUser(this.challengeTo.to); if (user) delete user.challengesFrom[this.userid]; this.challengeTo = null; this.updateChallenges(); if (user) user.updateChallenges(); }; User.prototype.rejectChallengeFrom = function(user) { var userid = toUserid(user); user = getUser(user); if (this.challengesFrom[userid]) { delete this.challengesFrom[userid]; } if (user) { delete this.challengesFrom[user.userid]; if (user.challengeTo && user.challengeTo.to === this.userid) { user.challengeTo = null; user.updateChallenges(); } } this.updateChallenges(); }; User.prototype.acceptChallengeFrom = function(user) { var userid = toUserid(user); user = getUser(user); if (!user || !user.challengeTo || user.challengeTo.to !== this.userid) { if (this.challengesFrom[userid]) { delete this.challengesFrom[userid]; this.updateChallenges(); } return false; } Rooms.global.startBattle(this, user, user.challengeTo.format, false, this.team, user.challengeTo.team); delete this.challengesFrom[user.userid]; user.challengeTo = null; this.updateChallenges(); user.updateChallenges(); return true; }; // chatQueue should be an array, but you know about mutables in prototypes... // P.S. don't replace this with an array unless you know what mutables in prototypes do. User.prototype.chatQueue = null; User.prototype.chatQueueTimeout = null; User.prototype.lastChatMessage = 0; /** * The user says message in room. * Returns false if the rest of the user's messages should be discarded. */ User.prototype.chat = function(message, room, connection) { var now = new Date().getTime(); if (message.substr(0,16) === '/cmd userdetails') { // certain commands are exempt from the queue ResourceMonitor.activeIp = connection.ip; room.chat(this, message, connection); ResourceMonitor.activeIp = null; return false; // but end the loop here } if (this.chatQueueTimeout) { if (!this.chatQueue) this.chatQueue = []; // this should never happen if (this.chatQueue.length > 6) { connection.sendTo(room, '|raw|' + "<strong class=\"message-throttle-notice\">Your message was not sent because you've been typing too quickly.</strong>" ); return false; } else { this.chatQueue.push([message, room, connection]); } } else if (now < this.lastChatMessage + THROTTLE_DELAY) { this.chatQueue = [[message, room, connection]]; this.chatQueueTimeout = setTimeout( this.processChatQueue.bind(this), THROTTLE_DELAY); } else { this.lastChatMessage = now; ResourceMonitor.activeIp = connection.ip; room.chat(this, message, connection); ResourceMonitor.activeIp = null; } }; User.prototype.clearChatQueue = function() { this.chatQueue = null; if (this.chatQueueTimeout) { clearTimeout(this.chatQueueTimeout); this.chatQueueTimeout = null; } }; User.prototype.processChatQueue = function() { if (!this.chatQueue) return; // this should never happen var toChat = this.chatQueue.shift(); ResourceMonitor.activeIp = toChat[2].ip; toChat[1].chat(this, toChat[0], toChat[2]); ResourceMonitor.activeIp = null; if (this.chatQueue && this.chatQueue.length) { this.chatQueueTimeout = setTimeout( this.processChatQueue.bind(this), THROTTLE_DELAY); } else { this.chatQueue = null; this.chatQueueTimeout = null; } }; User.prototype.destroy = function() { // deallocate user for (var roomid in this.mutedRooms) { clearTimeout(this.mutedRooms[roomid]); delete this.mutedRooms[roomid]; } this.clearChatQueue(); delete users[this.userid]; }; User.prototype.toString = function() { return this.userid; }; // "static" function User.pruneInactive = function(threshold) { var now = Date.now(); for (var i in users) { var user = users[i]; if (user.connected) continue; if ((now - user.lastConnected) > threshold) { users[i].destroy(); } } }; return User; })(); var Connection = (function () { function Connection(socket, user) { this.socket = socket; this.rooms = {}; this.user = user; this.ip = ''; if (socket.remoteAddress) { this.ip = socket.remoteAddress; } } Connection.prototype.sendTo = function(roomid, data) { if (roomid && roomid.id) roomid = roomid.id; if (roomid && roomid !== 'lobby') data = '>'+roomid+'\n'+data; this.socket.write(data); ResourceMonitor.countNetworkUse(data.length); }; Connection.prototype.send = function(data) { this.socket.write(data); ResourceMonitor.countNetworkUse(data.length); }; Connection.prototype.popup = function(message) { this.send('|popup|'+message.replace(/\n/g,'||')); }; return Connection; })(); // ban functions function ipSearch(ip, table) { if (table[ip]) return table[ip]; var dotIndex = ip.lastIndexOf('.'); for (var i=0; i<4 && dotIndex > 0; i++) { ip = ip.substr(0, dotIndex); if (table[ip+'.*']) return table[ip+'.*']; dotIndex = ip.lastIndexOf('.'); } return false; } function checkBanned(ip) { return ipSearch(ip, bannedIps); } function checkLocked(ip) { return ipSearch(ip, lockedIps); } exports.checkBanned = checkBanned; exports.checkLocked = checkLocked; function unban(name) { var success; var userid = toId(name); for (var ip in bannedIps) { if (bannedIps[ip] === userid) { delete bannedIps[ip]; success = true; } } if (success) return name; return false; } function unlock(name, unlocked, noRecurse) { var userid = toId(name); var user = getUser(userid); var userips = null; if (user) { if (user.userid === userid) name = user.name; if (user.locked) { user.locked = false; user.updateIdentity(); unlocked = unlocked || {}; unlocked[name] = 1; } if (!noRecurse) userips = user.ips; } for (var ip in lockedIps) { if (userips && (ip in user.ips) && Users.lockedIps[ip] !== userid) { unlocked = unlock(Users.lockedIps[ip], unlocked, true); // avoid infinite recursion } if (Users.lockedIps[ip] === userid) { delete Users.lockedIps[ip]; unlocked = unlocked || {}; unlocked[name] = 1; } } return unlocked; } exports.unban = unban; exports.unlock = unlock; exports.User = User; exports.Connection = Connection; exports.get = getUser; exports.getExact = getExactUser; exports.searchUser = searchUser; exports.connectUser = connectUser; exports.importUsergroups = importUsergroups; exports.addBannedWord = addBannedWord; exports.removeBannedWord = removeBannedWord; exports.users = users; exports.prevUsers = prevUsers; exports.bannedIps = bannedIps; exports.lockedIps = lockedIps; exports.usergroups = usergroups; exports.pruneInactive = User.pruneInactive; exports.pruneInactiveTimer = setInterval( User.pruneInactive, 1000*60*30, config.inactiveuserthreshold || 1000*60*60 ); exports.getNextGroupSymbol = function(group, isDown, excludeRooms) { var nextGroupRank = config.groupsranking[config.groupsranking.indexOf(group) + (isDown ? -1 : 1)]; if (excludeRooms === true && config.groups[nextGroupRank]) { var iterations = 0; while (config.groups[nextGroupRank].roomonly && iterations < 10) { nextGroupRank = config.groupsranking[config.groupsranking.indexOf(group) + (isDown ? -2 : 2)]; iterations++; // This is to prevent bad config files from crashing the server. } } if (!nextGroupRank) { if (isDown) { return config.groupsranking[0]; } else { return config.groupsranking[config.groupsranking.length - 1]; } } return nextGroupRank; }; exports.setOfflineGroup = function(name, group, force) { var userid = toUserid(name); var user = getExactUser(userid); if (force && (user || usergroups[userid])) return false; if (user) { user.setGroup(group); return true; } if (!group || group === config.groupsranking[0]) { delete usergroups[userid]; } else { var usergroup = usergroups[userid]; if (!usergroup && !force) return false; name = usergroup ? usergroup.substr(1) : name; usergroups[userid] = group+name; } exportUsergroups(); return true; };
{ "content_hash": "6194a618c55a848369afe4ad333620bc", "timestamp": "", "source": "github", "line_count": 1335, "max_line_length": 275, "avg_line_length": 30.096629213483148, "alnum_prop": 0.6542970208317778, "repo_name": "FlexSpider/Pokemon-Showdown-master", "id": "8857ac7e7fc71e66e26ee89db7af33cdd43ea17a", "size": "40181", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "users.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1905191" } ], "symlink_target": "" }
package org.apache.hadoop.mapred.lib.aggregate; import java.io.IOException; import java.util.ArrayList; import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.WritableComparable; import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapred.Mapper; import org.apache.hadoop.mapred.Reducer; /** * This abstract class implements some common functionalities of the the generic * mapper, reducer and combiner classes of Aggregate. */ public abstract class ValueAggregatorJobBase<K1 extends WritableComparable, V1 extends Writable> implements Mapper<K1, V1, Text, Text>, Reducer<Text, Text, Text, Text> { protected ArrayList<ValueAggregatorDescriptor> aggregatorDescriptorList = null; public void configure(JobConf job) { this.initializeMySpec(job); this.logSpec(); } private static ValueAggregatorDescriptor getValueAggregatorDescriptor(String spec, JobConf job) { if (spec == null) return null; String[] segments = spec.split(",", -1); String type = segments[0]; if (type.compareToIgnoreCase("UserDefined") == 0) { String className = segments[1]; return new UserDefinedValueAggregatorDescriptor(className, job); } return null; } private static ArrayList<ValueAggregatorDescriptor> getAggregatorDescriptors(JobConf job) { String advn = "aggregator.descriptor"; int num = job.getInt(advn + ".num", 0); ArrayList<ValueAggregatorDescriptor> retv = new ArrayList<ValueAggregatorDescriptor>(num); for (int i = 0; i < num; i++) { String spec = job.get(advn + "." + i); ValueAggregatorDescriptor ad = getValueAggregatorDescriptor(spec, job); if (ad != null) { retv.add(ad); } } return retv; } private void initializeMySpec(JobConf job) { this.aggregatorDescriptorList = getAggregatorDescriptors(job); if (this.aggregatorDescriptorList.size() == 0) { this.aggregatorDescriptorList.add(new UserDefinedValueAggregatorDescriptor( ValueAggregatorBaseDescriptor.class.getCanonicalName(), job)); } } protected void logSpec() { } public void close() throws IOException { } }
{ "content_hash": "3f01a9a326ce7c3d1edec8537348414d", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 107, "avg_line_length": 34.14492753623188, "alnum_prop": 0.6702037351443124, "repo_name": "dongpf/hadoop-0.19.1", "id": "0a8572dd02d94779bdc1b9d16de1191ca9cc3096", "size": "3162", "binary": false, "copies": "1", "ref": "refs/heads/rsc", "path": "src/mapred/org/apache/hadoop/mapred/lib/aggregate/ValueAggregatorJobBase.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Awk", "bytes": "631" }, { "name": "C", "bytes": "368366" }, { "name": "C++", "bytes": "506373" }, { "name": "Java", "bytes": "11404415" }, { "name": "JavaScript", "bytes": "60544" }, { "name": "Objective-C", "bytes": "118487" }, { "name": "PHP", "bytes": "884765" }, { "name": "Perl", "bytes": "150452" }, { "name": "Python", "bytes": "1619112" }, { "name": "Ruby", "bytes": "28485" }, { "name": "Shell", "bytes": "878487" }, { "name": "Smalltalk", "bytes": "56562" }, { "name": "XML", "bytes": "243803" } ], "symlink_target": "" }
package com.blockwithme.meta.types.impl; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; import com.blockwithme.meta.types.Access; import com.blockwithme.meta.types.BundleLifecycle; import com.blockwithme.meta.types.Kind; import com.blockwithme.meta.types.ServiceType; import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.tg.TinkerGraph; import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader; import com.tinkerpop.blueprints.util.io.graphml.GraphMLWriter; import com.tinkerpop.frames.FramedGraph; /** * TypeGraphIO implements reading and writing graph to files. * * TODO *Input* has NOT been tested at all! * * @author monster */ public class TypeGraphIO { /** Outputs the graph to the given file. */ public static void output(final FramedGraph<TinkerGraph> graph, final String filename) throws IOException { final GraphMLWriter gw = new GraphMLWriter(graph.getBaseGraph()); gw.setNormalize(true); gw.outputGraph(filename); } /** Outputs the graph to the given output stream. */ public static void output(final FramedGraph<TinkerGraph> graph, final OutputStream out) throws IOException { final GraphMLWriter gw = new GraphMLWriter(graph); gw.setNormalize(true); gw.outputGraph(out); } /** Converts a property to a class. */ private static void toClass(final Vertex v, final String prop) { final String value = v.getProperty(prop); if ((value == null) || value.isEmpty()) { v.removeProperty(prop); } else { try { if (value.startsWith("class ")) { v.setProperty(prop, Class.forName(value.substring("class ".length()))); } else if (value.startsWith("interface ")) { v.setProperty(prop, Class.forName(value .substring("interface ".length()))); } else if (value.startsWith("enum ")) { v.setProperty(prop, Class.forName(value.substring("enum ".length()))); } else { // Assume somehow no prefix ... v.setProperty(prop, Class.forName(value)); } } catch (final ClassNotFoundException e) { throw new IllegalStateException( "Could not parse type " + value, e); } } } /** Converts a property to an enum. */ @SuppressWarnings({ "unchecked", "rawtypes" }) private static void toEnum(final Vertex v, final String prop, final Class<? extends Enum> type) { final String value = v.getProperty(prop); if ((value == null) || value.isEmpty()) { v.removeProperty(prop); } else { v.setProperty(prop, Enum.valueOf(type, value)); } } /** Converts a property to a String list. */ private static void toStringList(final Vertex v, final String prop) { final String value = v.getProperty(prop); if ((value == null) || value.isEmpty()) { v.removeProperty(prop); } else if ((value.charAt(0) == '[') && (value.charAt(value.length() - 1) == ']')) { final String[] array = value.substring(1, value.length() - 1) .split(","); v.setProperty(prop, new ArrayList<>(Arrays.asList(array))); } else { throw new IllegalStateException("Could not parse String list " + value); } } /** Convert the Feature Vertex properties, to match the expected Frames type. */ private static void inputFeature(final Vertex v) { // NOP } /** Convert the Bundle Vertex properties, to match the expected Frames type. */ private static void inputBundle(final Vertex v) { toEnum(v, "lifecycle", BundleLifecycle.class); } /** Convert the Property Vertex properties, to match the expected Frames type. */ private static void inputProperty(final Vertex v) { // NOP } /** Convert the Type Vertex properties, to match the expected Frames type. */ private static void inputType(final Vertex v) { toClass(v, "implements"); toEnum(v, "kind", Kind.class); toEnum(v, "access", Access.class); toStringList(v, "persistence"); } /** Convert the TypeRange Vertex properties, to match the expected Frames type. */ private static void inputTypeRange(final Vertex v) { // NOP } /** Convert the Service Vertex properties, to match the expected Frames type. */ private static void inputService(final Vertex v) { toEnum(v, "lifecycle", ServiceType.class); } /** Convert the Dependency Vertex properties, to match the expected Frames type. */ private static void inputDependency(final Vertex v) { // NOP } /** Process the read graph, converting "stringed" data back to it's real type. */ private static void processInputGraph(final Graph base) { for (final Vertex v : base.getVertices()) { final String clazz = v.getProperty("class"); if ("Type".equals(clazz)) { inputType(v); } else if ("Bundle".equals(clazz)) { inputBundle(v); } else if ("Property".equals(clazz)) { inputProperty(v); } else if ("TypeRange".equals(clazz)) { inputTypeRange(v); } else if ("Service".equals(clazz)) { inputService(v); } else if ("Feature".equals(clazz)) { inputFeature(v); } else if ("Dependency".equals(clazz)) { inputDependency(v); } else { throw new IllegalStateException("Unknown Vertex type: " + clazz); } } } /** Inputs the graph from the given file. */ public static void input(final FramedGraph<TinkerGraph> graph, final String filename) throws IOException { final Graph base = graph.getBaseGraph(); final GraphMLReader gr = new GraphMLReader(base); gr.inputGraph(filename); processInputGraph(base); } /** Inputs the graph from the input stram. */ public static void input(final FramedGraph<TinkerGraph> graph, final InputStream in) throws IOException { final Graph base = graph.getBaseGraph(); final GraphMLReader gr = new GraphMLReader(base); gr.inputGraph(in); processInputGraph(base); } }
{ "content_hash": "70bcde644d6722850c56e4be705295d2", "timestamp": "", "source": "github", "line_count": 179, "max_line_length": 87, "avg_line_length": 38.815642458100555, "alnum_prop": 0.5826137017846862, "repo_name": "skunkiferous/Meta", "id": "44d6e46d9892639b74a67d95f7693fa7be1727e0", "size": "7560", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "old-java/src/com/blockwithme/meta/types/impl/TypeGraphIO.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "286815" }, { "name": "Xtend", "bytes": "673181" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Web; using OpenCat.Models; namespace OpenCat.Parsers { public class TxtParser : Parser { public override string Name { get { return "Basic Text Parser"; } } public override string Description { get { return "Parses plain text files."; } } public override string Author { get { return "premyslkrajcovic@gmail.com"; } } public override IEnumerable<Unit> Parse(Attachment attachment) { using (var reader = new StreamReader(attachment.OpenRead())) { while (reader.Peek() >= 0) { var values = reader.ReadLine().Split('|'); if (values.Length == 2) { var unit = CreateUnit(attachment); unit.source = values[0]; unit.target = values[1]; yield return unit; } } } } public override bool CanParse(Attachment attachment) { return attachment.name.EndsWith(".txt", StringComparison.InvariantCultureIgnoreCase); } } }
{ "content_hash": "9f1e6694cba6378fbae2179d06033f92", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 97, "avg_line_length": 32.282051282051285, "alnum_prop": 0.5329626687847498, "repo_name": "Myslik/opencat", "id": "0bb474b7acaf1b6af1a4ed240f9625aca041b5ea", "size": "1261", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WebApp/Parsers/TxtParser.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "102" }, { "name": "C#", "bytes": "91122" }, { "name": "JavaScript", "bytes": "1629547" } ], "symlink_target": "" }
from oslo_serialization import jsonutils from oslo_utils import timeutils import swiftclient def _message_container(queue, project=None): return "zaqar_message:%s:%s" % (queue, project) def _claim_container(queue=None, project=None): return "zaqar_claim:%s:%s" % (queue, project) def _subscription_container(queue, project=None): return "zaqar_subscription:%s:%s" % (queue, project) def _subscriber_container(queue, project=None): return "zaqar_subscriber:%s:%s" % (queue, project) def _put_or_create_container(client, *args, **kwargs): """PUT a swift object to a container that may not exist Takes the exact arguments of swiftclient.put_object but will autocreate a container that doesn't exist """ try: client.put_object(*args, **kwargs) except swiftclient.ClientException as e: if e.http_status == 404: # Because of lazy creation, the container may be used by different # clients and cause cache problem. Retrying object creation a few # times should fix this. for i in range(5): client.put_container(args[0]) try: client.put_object(*args, **kwargs) except swiftclient.ClientException as ex: if ex.http_status != 404: raise else: break else: # If we got there, we ignored the 5th exception, so the # exception context will be set. raise else: raise def _message_to_json(message_id, msg, headers, now): msg = jsonutils.loads(msg) return { 'id': message_id, 'age': now - float(headers['x-timestamp']), 'ttl': msg['ttl'], 'body': msg['body'], 'claim_id': msg['claim_id'], 'claim_count': msg.get('claim_count', 0) } def _subscription_to_json(sub, headers): sub = jsonutils.loads(sub) now = timeutils.utcnow_ts(True) return {'id': sub['id'], 'age': now - float(headers['x-timestamp']), 'source': sub['source'], 'subscriber': sub['subscriber'], 'ttl': sub['ttl'], 'options': sub['options'], 'confirmed': sub['confirmed']} def _filter_messages(messages, filters, marker, get_object, list_objects, limit): """Create a filtering iterator over a list of messages. The function accepts a list of filters to be filtered before the message can be included as a part of the reply. """ now = timeutils.utcnow_ts(True) for msg in messages: if msg is None: continue marker['next'] = msg['name'] try: headers, obj = get_object(msg['name']) except swiftclient.ClientException as exc: if exc.http_status == 404: continue raise obj = jsonutils.loads(obj) for should_skip in filters: if should_skip(obj, headers): break else: limit -= 1 yield { 'id': marker['next'], 'ttl': obj['ttl'], 'client_uuid': headers['x-object-meta-clientid'], 'body': obj['body'], 'age': now - float(headers['x-timestamp']), 'claim_id': obj['claim_id'], 'claim_count': obj.get('claim_count', 0), } if limit <= 0: break if limit > 0 and marker: # We haven't reached the limit, let's try to get some more messages _, objects = list_objects(marker=marker['next']) if not objects: return for msg in _filter_messages(objects, filters, marker, get_object, list_objects, limit): yield msg class SubscriptionListCursor(object): def __init__(self, objects, marker_next, get_object): self.objects = iter(objects) self.marker_next = marker_next self.get_object = get_object def __iter__(self): return self def next(self): while True: curr = next(self.objects) self.marker_next['next'] = curr['name'] try: headers, sub = self.get_object(curr['name']) except swiftclient.ClientException as exc: if exc.http_status == 404: continue raise return _subscription_to_json(sub, headers) def __next__(self): return self.next()
{ "content_hash": "79c380b24ac08d170d30dad78ba4980f", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 78, "avg_line_length": 31.448979591836736, "alnum_prop": 0.5414233181916505, "repo_name": "openstack/zaqar", "id": "6289ec99747bde24a1660c14be8c9db6a8a94a6e", "size": "5169", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "zaqar/storage/swift/utils.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "5002" }, { "name": "HTML", "bytes": "22106" }, { "name": "Lua", "bytes": "4555" }, { "name": "Mako", "bytes": "952" }, { "name": "NASL", "bytes": "15981" }, { "name": "Python", "bytes": "1912931" }, { "name": "Shell", "bytes": "20061" } ], "symlink_target": "" }
name: Feature Request about: Create a feature request to improve abilities of the product --- ### Summary [TODO: A clear and concise rationale for the feature] ### Outcome [TODO: An approximate list of the results, expected from the feature] - [TODO: Result #1] ### Additional Information [TODO: Additional information required for evaluating the feature, if applicable]
{ "content_hash": "ab1a7165863e9ca72f40863724a4bab2", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 81, "avg_line_length": 23.5, "alnum_prop": 0.7579787234042553, "repo_name": "alexanderkozlenko/jsonrpcnet", "id": "712dc6f2f861616f22a14c63049b018b99072b6e", "size": "380", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": ".github/ISSUE_TEMPLATE/FEATURE_REQUEST_TEMPLATE.md", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "180" }, { "name": "C#", "bytes": "146388" }, { "name": "PowerShell", "bytes": "1068" } ], "symlink_target": "" }
module Support class CommandSequence def initialize(*args) @commands = args end def gets @commands.shift end end end
{ "content_hash": "2c6aff0f71001bc32acba4d0fe7b534a", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 25, "avg_line_length": 13.636363636363637, "alnum_prop": 0.6266666666666667, "repo_name": "chriserin/easy_repl", "id": "8a2fd22226da83e0772af0c40ad2e7297c111bf5", "size": "150", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "test/support/command_sequence.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "8034" } ], "symlink_target": "" }
<PackageItem xmlns:tcm="http://www.tridion.com/ContentManager/5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.sdltridion.com/ContentManager/ImportExport/Package/2013"> <Data> <tcm:Data> <tcm:Title>ecl:0-mm-381-dist-file</tcm:Title> <tcm:Type>Multimedia</tcm:Type> <tcm:Schema xlink:type="simple" xlink:title="ExternalContentLibraryStubSchema-mm" xlink:href="/webdav/100%20Master/Building%20Blocks/Modules/MediaManager/Editor/Schemas/SDL%20Media%20Manager/ExternalContentLibraryStubSchema-mm.xsd" IsMandatory="false" /> <tcm:Content /> <tcm:Metadata> <Metadata xmlns="uuid:9389a8ce-0f19-44ee-9eb6-2d04d0c02c25"> <playerType>Custom</playerType> <customVideoAutoplay>Disabled</customVideoAutoplay> <customVideoSubtitles>Disabled</customVideoSubtitles> <customVideoControls>Enabled</customVideoControls> </Metadata> </tcm:Metadata> <tcm:IsBasedOnTridionWebSchema>true</tcm:IsBasedOnTridionWebSchema> <tcm:MultimediaType xlink:type="simple" xlink:title="External Content Library" xlink:href="tcm:0-22-65544" /> <tcm:MultimediaFilename>ecl:2-mm-381-dist-file.ecl</tcm:MultimediaFilename> <tcm:MultimediaFileSize>0</tcm:MultimediaFileSize> <tcm:IsExternalMultimediaFile>true</tcm:IsExternalMultimediaFile> </tcm:Data> </Data> <Dependencies> <Dependency dependencyType="Publication" itemUrl="/webdav/100%20Master" linkName="LocationInfo/ContextRepository" /> <Dependency dependencyType="OrganizationalItemFolder" itemUrl="/webdav/100%20Master/Building%20Blocks/Modules/MediaManager/Editor/Schemas/SDL%20Media%20Manager/E05/D88" linkName="LocationInfo/OrganizationalItem" /> <Dependency dependencyType="MultimediaType" itemUrl="/webdav//External%20Content%20Library.tmt" linkName="BinaryContent/MultimediaType" /> <Dependency dependencyType="Schema" itemUrl="/webdav/100%20Master/Building%20Blocks/Modules/MediaManager/Editor/Schemas/SDL%20Media%20Manager/ExternalContentLibraryStubSchema-mm.xsd" linkName="Schema" /> </Dependencies> </PackageItem>
{ "content_hash": "539e2d956d8b0e01f0795b7eb29697fe", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 260, "avg_line_length": 72.79310344827586, "alnum_prop": 0.757934628138323, "repo_name": "sdl/dxa-modules", "id": "256a78ee2abd2d4bae99637339ad153b5889c281", "size": "2111", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "installation/Test/cms/sites9/content/Components/2-631.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C#", "bytes": "281770" }, { "name": "CSS", "bytes": "120104" }, { "name": "Groovy", "bytes": "3792" }, { "name": "HTML", "bytes": "130538" }, { "name": "Java", "bytes": "811421" }, { "name": "JavaScript", "bytes": "297201" }, { "name": "PowerShell", "bytes": "34268" }, { "name": "TypeScript", "bytes": "938000" } ], "symlink_target": "" }
package com.medeuz.translatorapp.network; import com.medeuz.translatorapp.entity.Translate; import io.reactivex.Observable; import retrofit2.http.Field; import retrofit2.http.FormUrlEncoded; import retrofit2.http.POST; import retrofit2.http.Query; public interface YaTranslateService { @FormUrlEncoded @POST("translate") Observable<Translate> getTranslate(@Query("lang") String lang, @Field("text") String text); }
{ "content_hash": "f584ce75d660f0e81c8c608edc44e7d0", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 95, "avg_line_length": 25.41176470588235, "alnum_prop": 0.7847222222222222, "repo_name": "Medeuz/TranslatorAppForAndroid", "id": "96ca7d5ba97e383d0bce9b0dc553a0f545c8df92", "size": "432", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/medeuz/translatorapp/network/YaTranslateService.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "40106" } ], "symlink_target": "" }
package io.ckl.notificrash.helpers; import java.io.PrintWriter; import java.io.StringWriter; public class CrashHelper { private static final int NO_LINE_NUMBER = -1; /** * @param t Throwable * @return String */ public static String findName(Throwable t) { return t != null ? t.getClass().getSimpleName() : "none"; } /** * @param t Throwable * @return String */ public static String findStackTrace(Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); return sw.toString(); } /** * @param t Throwable * @return String */ public static String findReason(Throwable t) { return t != null ? t.getMessage() : "none"; } /** * @param t Throwable * @return String */ public static String findClassName(Throwable t) { StackTraceElement ste = getStackTraceElement(t); return ste != null ? ste.getClassName() : "none"; } /** * @param t Throwable * @return int */ public static int findLineNumber(Throwable t) { StackTraceElement ste = getStackTraceElement(t); return ste != null ? ste.getLineNumber() : NO_LINE_NUMBER; } /** * @param t Throwable * @return String */ public static String findMethod(Throwable t) { StackTraceElement ste = getStackTraceElement(t); return ste != null ? ste.getMethodName() : "none"; } /** * @return long */ public static long findTime() { return System.currentTimeMillis(); } /** * @param t Throwable * @return StackTraceElement */ public static StackTraceElement getStackTraceElement(Throwable t) { for (StackTraceElement ste : t.getStackTrace()) { if (!ste.isNativeMethod()) { return ste; } } return null; } }
{ "content_hash": "3f9f460e3ef71d7b21fd1c7a8ecee94e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 71, "avg_line_length": 23.63095238095238, "alnum_prop": 0.5768261964735516, "repo_name": "CheesecakeLabs/AndroidNotifiCrashLib", "id": "3c16699ab45c3987714e72570a712b64598cacd4", "size": "1985", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "notificrash/src/main/java/io/ckl/notificrash/helpers/CrashHelper.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "33532" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="es"> <head> <!-- Generated by javadoc (1.8.0_05) on Sun Apr 02 20:29:09 BST 2017 --> <title>ConcatenationFilter</title> <meta name="date" content="2017-04-02"> <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="ConcatenationFilter"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </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="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="../../../lejos/robotics/filter/AbstractFilter.html" title="class in lejos.robotics.filter"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../lejos/robotics/filter/FilterTerminal.html" title="class in lejos.robotics.filter"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?lejos/robotics/filter/ConcatenationFilter.html" target="_top">Frames</a></li> <li><a href="ConcatenationFilter.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">lejos.robotics.filter</div> <h2 title="Class ConcatenationFilter" class="title">Class ConcatenationFilter</h2> <map id="G" name="G"> <area shape="rect" id="node1_0" href="../SampleProvider.html" title="lejos.robotics.SampleProvider" alt="" coords="107,11,347,122"/> <area shape="rect" id="node1" href="../SampleProvider.html" title="&lt;TABLE&gt;" alt="" coords="96,6,357,127"/> <area shape="rect" id="node2_1" href="./ConcatenationFilter.html" title="lejos.robotics.filter.ConcatenationFilter" alt="" coords="15,182,438,295"/> <area shape="rect" id="node2" href="./ConcatenationFilter.html" title="&lt;TABLE&gt;" alt="" coords="5,177,449,301"/> </map> <!-- UML diagram added by UMLGraph version R5_6-24-gf6e263 (http://www.umlgraph.org/) --> <div align="center"><img src="ConcatenationFilter.png" alt="Package class diagram package ConcatenationFilter" usemap="#G" border=0/></div> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>lejos.robotics.filter.ConcatenationFilter</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a></dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">ConcatenationFilter</span> extends java.lang.Object implements <a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a></pre> <div class="block">Simple filter to concatenate two sources</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">&nbsp;</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>private <a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../lejos/robotics/filter/ConcatenationFilter.html#source1">source1</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>private <a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../lejos/robotics/filter/ConcatenationFilter.html#source2">source2</a></span></code>&nbsp;</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">&nbsp;</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="../../../lejos/robotics/filter/ConcatenationFilter.html#ConcatenationFilter-lejos.robotics.SampleProvider-lejos.robotics.SampleProvider-">ConcatenationFilter</a></span>(<a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a>&nbsp;source1, <a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a>&nbsp;source2)</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../lejos/robotics/filter/ConcatenationFilter.html#fetchSample-float:A-int-">fetchSample</a></span>(float[]&nbsp;sample, int&nbsp;offset)</code> <div class="block">Fetches a sample from a sensors or filter.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../lejos/robotics/filter/ConcatenationFilter.html#sampleSize--">sampleSize</a></span>()</code> <div class="block">Returns the number of elements in a sample.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;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="source1"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>source1</h4> <pre>private&nbsp;<a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a> source1</pre> </li> </ul> <a name="source2"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>source2</h4> <pre>private&nbsp;<a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a> source2</pre> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="ConcatenationFilter-lejos.robotics.SampleProvider-lejos.robotics.SampleProvider-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>ConcatenationFilter</h4> <pre>public&nbsp;ConcatenationFilter(<a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a>&nbsp;source1, <a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a>&nbsp;source2)</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="sampleSize--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>sampleSize</h4> <pre>public&nbsp;int&nbsp;sampleSize()</pre> <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../lejos/robotics/SampleProvider.html#sampleSize--">SampleProvider</a></code></span></div> <div class="block">Returns the number of elements in a sample.<br> The number of elements does not change during runtime.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../lejos/robotics/SampleProvider.html#sampleSize--">sampleSize</a></code>&nbsp;in interface&nbsp;<code><a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the number of elements in a sample</dd> </dl> </li> </ul> <a name="fetchSample-float:A-int-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>fetchSample</h4> <pre>public&nbsp;void&nbsp;fetchSample(float[]&nbsp;sample, int&nbsp;offset)</pre> <div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../lejos/robotics/SampleProvider.html#fetchSample-float:A-int-">SampleProvider</a></code></span></div> <div class="block">Fetches a sample from a sensors or filter.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../lejos/robotics/SampleProvider.html#fetchSample-float:A-int-">fetchSample</a></code>&nbsp;in interface&nbsp;<code><a href="../../../lejos/robotics/SampleProvider.html" title="interface in lejos.robotics">SampleProvider</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>sample</code> - The array to store the sample in.</dd> <dd><code>offset</code> - The elements of the sample are stored in the array starting at the offset position.</dd> </dl> </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="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="../../../lejos/robotics/filter/AbstractFilter.html" title="class in lejos.robotics.filter"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../lejos/robotics/filter/FilterTerminal.html" title="class in lejos.robotics.filter"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?lejos/robotics/filter/ConcatenationFilter.html" target="_top">Frames</a></li> <li><a href="ConcatenationFilter.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All&nbsp;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:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "f566b8e1faa8b1616fc202a092ede36d", "timestamp": "", "source": "github", "line_count": 371, "max_line_length": 391, "avg_line_length": 40.64150943396226, "alnum_prop": 0.658575407879029, "repo_name": "ev3dev-lang-java/ev3dev-lang-java.github.io", "id": "11abe4ccc7ee94fadae0beea9553254d7ee93a48", "size": "15078", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/api/v0.5.0/lejos-commons/lejos/robotics/filter/ConcatenationFilter.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "128265" }, { "name": "HTML", "bytes": "28710" }, { "name": "JavaScript", "bytes": "143468" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView android:id="@+id/venue_image" android:layout_width="match_parent" android:layout_height="wrap_content" android:contentDescription="@null" android:scaleType="fitXY" android:src="@drawable/venue" tools:layout_height="180dp"/> <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginLeft="@dimen/activity_margin" android:layout_marginRight="@dimen/activity_margin" android:layout_weight="1" android:orientation="vertical"> <TextView style="@style/Venue.Title" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/venue_title"/> <TextView style="@style/Venue.Content" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/venue_address"/> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/venue_info"/> </LinearLayout> <android.support.v7.widget.AppCompatButton android:id="@+id/venue_rooms" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/activity_margin" android:layout_marginRight="@dimen/activity_margin" android:layout_marginTop="@dimen/activity_margin" android:text="@string/venue_see_rooms" android:textColor="@android:color/white" app:backgroundTint="?attr/colorAccent"/> <android.support.v7.widget.AppCompatButton android:id="@+id/venue_locate" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/activity_margin" android:layout_marginLeft="@dimen/activity_margin" android:layout_marginRight="@dimen/activity_margin" android:text="@string/venue_see_location" android:textColor="@android:color/white" app:backgroundTint="?attr/colorAccent"/> </LinearLayout> </ScrollView>
{ "content_hash": "aa235dd43aaf9e826e6ab765efd029b5", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 64, "avg_line_length": 39.76712328767123, "alnum_prop": 0.6042025490871512, "repo_name": "Nilhcem/devfestnantes-2016", "id": "1a511af36917d98c707e52e3879164d900c3e664", "size": "2903", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/res/layout/venue.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "263" }, { "name": "IDL", "bytes": "1725" }, { "name": "Java", "bytes": "220672" }, { "name": "JavaScript", "bytes": "1912" }, { "name": "Kotlin", "bytes": "9766" }, { "name": "Prolog", "bytes": "656" }, { "name": "Shell", "bytes": "1076" } ], "symlink_target": "" }
package org.apache.ignite.internal.client.marshaller.optimized; import java.io.IOException; import java.nio.ByteBuffer; import java.util.List; import org.apache.ignite.IgniteCheckedException; import org.apache.ignite.IgniteException; import org.apache.ignite.internal.MarshallerContextAdapter; import org.apache.ignite.internal.client.marshaller.GridClientMarshaller; import org.apache.ignite.internal.processors.rest.client.message.GridClientMessage; import org.apache.ignite.marshaller.optimized.OptimizedMarshaller; import org.apache.ignite.plugin.PluginProvider; import org.jetbrains.annotations.Nullable; /** * Wrapper, that adapts {@link org.apache.ignite.marshaller.optimized.OptimizedMarshaller} to * {@link GridClientMarshaller} interface. */ public class GridClientOptimizedMarshaller implements GridClientMarshaller { /** ID. */ public static final byte ID = 1; /** Optimized marshaller. */ protected final OptimizedMarshaller opMarsh; /** * Default constructor. */ public GridClientOptimizedMarshaller() { opMarsh = new OptimizedMarshaller(); opMarsh.setContext(new ClientMarshallerContext()); } /** * Constructor. * * @param plugins Plugins. */ public GridClientOptimizedMarshaller(@Nullable List<PluginProvider> plugins) { opMarsh = new OptimizedMarshaller(); opMarsh.setContext(new ClientMarshallerContext(plugins)); } /** * Constructs optimized marshaller with specific parameters. * * @param requireSer Require serializable flag. * @param poolSize Object streams pool size. * @throws IOException If an I/O error occurs while writing stream header. * @throws IgniteException If this marshaller is not supported on the current JVM. * @see OptimizedMarshaller */ public GridClientOptimizedMarshaller(boolean requireSer, int poolSize) throws IOException { opMarsh = new OptimizedMarshaller(); opMarsh.setContext(new ClientMarshallerContext()); opMarsh.setRequireSerializable(requireSer); opMarsh.setPoolSize(poolSize); } /** {@inheritDoc} */ @Override public ByteBuffer marshal(Object obj, int off) throws IOException { try { if (!(obj instanceof GridClientMessage)) throw new IOException("Message serialization of given type is not supported: " + obj.getClass().getName()); byte[] bytes = opMarsh.marshal(obj); ByteBuffer buf = ByteBuffer.allocate(off + bytes.length); buf.position(off); buf.put(bytes); buf.flip(); return buf; } catch (IgniteCheckedException e) { throw new IOException(e); } } /** {@inheritDoc} */ @Override public <T> T unmarshal(byte[] bytes) throws IOException { try { return opMarsh.unmarshal(bytes, null); } catch (IgniteCheckedException e) { throw new IOException(e); } } /** */ private static class ClientMarshallerContext extends MarshallerContextAdapter { /** */ public ClientMarshallerContext() { super(null); } /** * @param plugins Plugins. */ public ClientMarshallerContext(@Nullable List<PluginProvider> plugins) { super(plugins); } /** {@inheritDoc} */ @Override protected boolean registerClassName(int id, String clsName) { throw new UnsupportedOperationException(clsName); } /** {@inheritDoc} */ @Override protected String className(int id) { throw new UnsupportedOperationException(); } } }
{ "content_hash": "7fcaf2dedbdbdc35b3536057157f481d", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 96, "avg_line_length": 30.443548387096776, "alnum_prop": 0.6545695364238411, "repo_name": "f7753/ignite", "id": "a112736079a9ba265f9626c21dff495d4ea70a5b", "size": "4577", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "modules/core/src/main/java/org/apache/ignite/internal/client/marshaller/optimized/GridClientOptimizedMarshaller.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "41060" }, { "name": "C", "bytes": "7524" }, { "name": "C#", "bytes": "3783198" }, { "name": "C++", "bytes": "1809756" }, { "name": "CSS", "bytes": "98768" }, { "name": "Groovy", "bytes": "15092" }, { "name": "HTML", "bytes": "410211" }, { "name": "Java", "bytes": "23816865" }, { "name": "JavaScript", "bytes": "954966" }, { "name": "M4", "bytes": "5528" }, { "name": "Makefile", "bytes": "98282" }, { "name": "PHP", "bytes": "11079" }, { "name": "PowerShell", "bytes": "6281" }, { "name": "Scala", "bytes": "673768" }, { "name": "Shell", "bytes": "547076" }, { "name": "Smalltalk", "bytes": "1908" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Borobudur\Component\Hateoas; use Borobudur\Component\Transformer\TransformerInterface; use Borobudur\Component\Transformer\MutatorTrait; use InvalidArgumentException; /** * @author Iqbal Maulana <iq.bluejack@gmail.com> */ abstract class AbstractHateoasTransformer implements TransformerInterface { use MutatorTrait; /** * @var RouterInterface */ private $router; /** * @var NormalizerInterface */ private $normalizer; public function __construct(RouterInterface $router, NormalizerInterface $normalizer) { $this->router = $router; $this->normalizer = $normalizer; } public function transform($data, array $context = []): array { $normalized = $this->normalizer->normalize($data, $context); $normalized = $this->mutate($normalized); $this->build($data, $normalized); return $normalized; } protected function build($data, array &$normalized): void { $links = []; $embedded = []; foreach ($this->links($data) as $name => $link) { if (null === $this->get($link, 'route')) { throw new InvalidArgumentException( sprintf('Missing "route" param for link "%s"', $name) ); } if (null === $this->get($link['route'], 'name')) { throw new InvalidArgumentException( sprintf('Missing "route.name" param for link "%s"', $name) ); } $href = $this->generate($link['route']['name'], $this->get($link['route'], 'params', [])); $methods = $this->router->getMethods($link['route']['name']); unset($link['route']); if (true === $this->get($link, 'embedded', false)) { if (array_key_exists($name, $normalized)) { $embedded[$name] = $normalized[$name]; unset($normalized[$name]); } unset($link['embedded']); } $links[] = array_merge(['href' => $href, 'rel' => $name, 'methods' => $methods], $link); } $normalized['_links'] = $links; if (!empty($embedded)) { $normalized['_embedded'] = $embedded; } } protected function generate(string $name, array $params = []): string { return $this->router->generate($name, $params); } protected function get(array $arr, string $key, $default = null) { return array_key_exists($key, $arr) ? $arr[$key] : $default; } abstract protected function links($data): array; }
{ "content_hash": "c50257f4eb1fda5b93bf59f756395680", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 102, "avg_line_length": 27.762886597938145, "alnum_prop": 0.5432603044931303, "repo_name": "borobudur-php/borobudur", "id": "edc54bdc068ac1a46b155bc8a187fc4857820409", "size": "2924", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Borobudur/Component/Hateoas/AbstractHateoasTransformer.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "91575" } ], "symlink_target": "" }
<?php namespace UrlShortenerBundle\DependencyInjection; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; /** * This is the class that validates and merges configuration from your app/config files * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** * {@inheritdoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('url_shortener'); // Here you should define the parameters that are allowed to // configure your bundle. See the documentation linked above for // more information on that topic. return $treeBuilder; } }
{ "content_hash": "98229d9a78f93bb85fddcbc717e37c01", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 131, "avg_line_length": 30.344827586206897, "alnum_prop": 0.7181818181818181, "repo_name": "gchablowski/urlshortener", "id": "dd8e1649c83fbebd9878cb2ab42d571bbea4f5ba", "size": "880", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/UrlShortenerBundle/DependencyInjection/Configuration.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3606" }, { "name": "HTML", "bytes": "4973" }, { "name": "PHP", "bytes": "62819" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_13) on Wed Feb 03 13:13:03 GMT 2010 --> <TITLE> org.openqa.selenium.support.pagefactory.internal Class Hierarchy </TITLE> <META NAME="date" CONTENT="2010-02-03"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="org.openqa.selenium.support.pagefactory.internal Class Hierarchy"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../org/openqa/selenium/support/pagefactory/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../../../org/openqa/selenium/support/ui/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/openqa/selenium/support/pagefactory/internal/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> Hierarchy For Package org.openqa.selenium.support.pagefactory.internal </H2> </CENTER> <DL> <DT><B>Package Hierarchies:</B><DD><A HREF="../../../../../../overview-tree.html">All Packages</A></DL> <HR> <H2> Class Hierarchy </H2> <UL> <LI TYPE="circle">java.lang.Object<UL> <LI TYPE="circle">org.openqa.selenium.support.pagefactory.internal.<A HREF="../../../../../../org/openqa/selenium/support/pagefactory/internal/LocatingElementHandler.html" title="class in org.openqa.selenium.support.pagefactory.internal"><B>LocatingElementHandler</B></A> (implements java.lang.reflect.InvocationHandler) </UL> </UL> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../../org/openqa/selenium/support/pagefactory/package-tree.html"><B>PREV</B></A>&nbsp; &nbsp;<A HREF="../../../../../../org/openqa/selenium/support/ui/package-tree.html"><B>NEXT</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../../index.html?org/openqa/selenium/support/pagefactory/internal/package-tree.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
{ "content_hash": "526c16619c62fbfa6fc34d84ab48596a", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 320, "avg_line_length": 42.5328947368421, "alnum_prop": 0.6013921113689095, "repo_name": "epall/selenium", "id": "c66833026aa40ffc5afe37e6ecfc2894c7d80a1e", "size": "6465", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "docs/api/java/org/openqa/selenium/support/pagefactory/internal/package-tree.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ASP", "bytes": "853" }, { "name": "C", "bytes": "9121411" }, { "name": "C#", "bytes": "1182809" }, { "name": "C++", "bytes": "240474" }, { "name": "Java", "bytes": "4956413" }, { "name": "JavaScript", "bytes": "9112561" }, { "name": "Objective-C", "bytes": "184129" }, { "name": "Python", "bytes": "2136731" }, { "name": "Ruby", "bytes": "203892" }, { "name": "Shell", "bytes": "7226" } ], "symlink_target": "" }
<?php /*************************************************************** * (c) 2015 Benjamin Kluge <b.kluge@neusta.de>, NEUSTA GmbH * All rights reserved ***************************************************************/ namespace TeamNeusta\WindowsAzureCurl\Model\Media; use TeamNeusta\WindowsAzureCurl\Model\AbstractModel; use TeamNeusta\WindowsAzureCurl\Model\General\ModelInterface; class ChannelInputAccessControl extends AbstractModel implements ModelInterface { /** * IP * * @var IPAccessControl */ protected $IP; /** * @return IPAccessControl */ public function getIP() { return $this->IP; } /** * @param IPAccessControl $IP */ public function setIP($IP) { if(is_array($IP)) { $this->IP = IPAccessControl::createFromOptions($IP); } else { $this->IP = $IP; } } }
{ "content_hash": "25c8a46b726f8f1101978ceeb29ba1cb", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 23.333333333333332, "alnum_prop": 0.5186813186813187, "repo_name": "teamneusta/azure-for-php-curl", "id": "441571e7cf6c8d7739be541a5272fa69ba4aa48e", "size": "910", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Model/Media/ChannelInputAccessControl.php", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "PHP", "bytes": "90944" } ], "symlink_target": "" }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>metacoq-erasure: 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.8.1 / metacoq-erasure - 1.0~alpha1+8.9</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> metacoq-erasure <small> 1.0~alpha1+8.9 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-17 18:19:02 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-17 18:19:02 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.8.1 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: &quot;2.0&quot; maintainer: &quot;matthieu.sozeau@inria.fr&quot; homepage: &quot;https://metacoq.github.io/metacoq&quot; dev-repo: &quot;git+https://github.com/MetaCoq/metacoq.git#coq-8.8&quot; bug-reports: &quot;https://github.com/MetaCoq/metacoq/issues&quot; authors: [&quot;Abhishek Anand &lt;aa755@cs.cornell.edu&gt;&quot; &quot;Simon Boulier &lt;simon.boulier@inria.fr&gt;&quot; &quot;Cyril Cohen &lt;cyril.cohen@inria.fr&gt;&quot; &quot;Yannick Forster &lt;forster@ps.uni-saarland.de&gt;&quot; &quot;Fabian Kunze &lt;fkunze@fakusb.de&gt;&quot; &quot;Gregory Malecha &lt;gmalecha@gmail.com&gt;&quot; &quot;Matthieu Sozeau &lt;matthieu.sozeau@inria.fr&gt;&quot; &quot;Nicolas Tabareau &lt;nicolas.tabareau@inria.fr&gt;&quot; &quot;Théo Winterhalter &lt;theo.winterhalter@inria.fr&gt;&quot; ] license: &quot;MIT&quot; build: [ [&quot;sh&quot; &quot;./configure.sh&quot;] [make &quot;-j%{jobs}%&quot; &quot;-C&quot; &quot;erasure&quot;] [make &quot;test-suite&quot;] {with-test} ] install: [ [make &quot;-C&quot; &quot;erasure&quot; &quot;install&quot;] ] depends: [ &quot;ocaml&quot; {&gt; &quot;4.02.3&quot;} &quot;coq&quot; {&gt;= &quot;8.9&quot; &amp; &lt; &quot;8.10~&quot;} &quot;coq-metacoq-template&quot; {= version} &quot;coq-metacoq-checker&quot; {= version} &quot;coq-metacoq-pcuic&quot; {= version} &quot;coq-metacoq-safechecker&quot; {= version} ] synopsis: &quot;Implementation and verification of an erasure procedure for Coq&quot; description: &quot;&quot;&quot; MetaCoq is a meta-programming framework for Coq. The Erasure module provides a complete specification of Coq&#39;s so-called \&quot;extraction\&quot; procedure, starting from the PCUIC calculus and targeting untyped call-by-value lambda-calculus. The `erasure` function translates types and proofs in well-typed terms into a dummy `tBox` constructor, following closely P. Letouzey&#39;s PhD thesis. &quot;&quot;&quot; url { src: &quot;https://github.com/MetaCoq/metacoq/archive/1.0-alpha+8.9.tar.gz&quot; checksum: &quot;sha256=899ef4ee73b1684a0f1d2e37ab9ab0f9b24424f6d8a10a10efd474c0ed93488e&quot; }</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-metacoq-erasure.1.0~alpha1+8.9 coq.8.8.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.8.1). The following dependencies couldn&#39;t be met: - coq-metacoq-erasure -&gt; coq-metacoq-checker = 1.0~alpha1+8.9 -&gt; coq &gt;= 8.9 -&gt; ocaml &gt;= 4.09.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;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-metacoq-erasure.1.0~alpha1+8.9</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": "2d8331c7d38c7c2cb175eb6948d74638", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 159, "avg_line_length": 43.18716577540107, "alnum_prop": 0.5635215453194651, "repo_name": "coq-bench/coq-bench.github.io", "id": "7c81cfe2d05089ae1f92168bf25dc73e3e7e8bee", "size": "8102", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.8.1/metacoq-erasure/1.0~alpha1+8.9.html", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
namespace WpfAnalyzers.DependencyProperties { using System.Collections.Immutable; using System.Composition; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; [ExportCodeFixProvider(LanguageNames.CSharp, Name = nameof(UseDependencyPropertyKeyCodeFixProvider))] [Shared] internal class UseDependencyPropertyKeyCodeFixProvider : CodeFixProvider { /// <inheritdoc/> public override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(WPF0040SetUsingDependencyPropertyKey.DiagnosticId); public override async Task RegisterCodeFixesAsync(CodeFixContext context) { var document = context.Document; var syntaxRoot = await document.GetSyntaxRootAsync(context.CancellationToken) .ConfigureAwait(false); var semanticModel = await document.GetSemanticModelAsync(context.CancellationToken) .ConfigureAwait(false); foreach (var diagnostic in context.Diagnostics) { var token = syntaxRoot.FindToken(diagnostic.Location.SourceSpan.Start); if (string.IsNullOrEmpty(token.ValueText)) { continue; } var invocation = syntaxRoot.FindNode(diagnostic.Location.SourceSpan) .FirstAncestorOrSelf<InvocationExpressionSyntax>(); if (invocation == null || invocation.IsMissing) { continue; } ArgumentSyntax property; IFieldSymbol setField; ArgumentSyntax value; if (DependencyObject.TryGetSetValueArguments( invocation, semanticModel, context.CancellationToken, out property, out setField, out value)) { IFieldSymbol keyField; if (DependencyProperty.TryGetDependencyPropertyKeyField( setField, semanticModel, context.CancellationToken, out keyField)) { var keyArg = DependencyProperty.CreateArgument(keyField, semanticModel, token.SpanStart); var setValue = invocation.ReplaceNode(property, keyArg); context.RegisterCodeFix( CodeAction.Create( invocation.ToString(), cancellationToken => ApplyFixAsync( context, cancellationToken, invocation, setValue), nameof(MakeFieldStaticReadonlyCodeFixProvider)), diagnostic); } continue; } if (DependencyObject.TryGetSetCurrentValueArguments( invocation, semanticModel, context.CancellationToken, out property, out setField, out value)) { IFieldSymbol keyField; if (DependencyProperty.TryGetDependencyPropertyKeyField( setField, semanticModel, context.CancellationToken, out keyField)) { var keyArg = DependencyProperty.CreateArgument(keyField, semanticModel, token.SpanStart); var setValue = invocation.WithExpression(SetValueExpression(invocation.Expression)) .ReplaceNode(property, keyArg); context.RegisterCodeFix( CodeAction.Create( invocation.ToString(), cancellationToken => ApplyFixAsync( context, cancellationToken, invocation, setValue), nameof(MakeFieldStaticReadonlyCodeFixProvider)), diagnostic); } } } } private static async Task<Document> ApplyFixAsync( CodeFixContext context, CancellationToken cancellationToken, SyntaxNode oldNode, SyntaxNode newNode) { var syntaxRoot = await context.Document.GetSyntaxRootAsync(cancellationToken) .ConfigureAwait(false); return context.Document.WithSyntaxRoot(syntaxRoot.ReplaceNode(oldNode, newNode)); } private static ExpressionSyntax SetValueExpression(ExpressionSyntax old) { var identifierNameSyntax = old as IdentifierNameSyntax; if (identifierNameSyntax != null) { return identifierNameSyntax.Identifier.ValueText == "SetCurrentValue" ? identifierNameSyntax.WithIdentifier(SyntaxFactory.Identifier("SetValue")) : identifierNameSyntax; } var memberAccessExpressionSyntax = old as MemberAccessExpressionSyntax; if (memberAccessExpressionSyntax != null) { var newName = SetValueExpression(memberAccessExpressionSyntax.Name) as SimpleNameSyntax; return memberAccessExpressionSyntax.WithName(newName); } return old; } } }
{ "content_hash": "f4cca7765636e1aa8c145eb2d468c290", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 152, "avg_line_length": 43.0625, "alnum_prop": 0.5163683276890824, "repo_name": "JohanLarsson/WpfAnalyzers", "id": "853ed7e969d6c60d08ee6cd33827db4107582075", "size": "6203", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "WpfAnalyzers.CodeFixes/DependencyProperties/UseDependencyPropertyKeyCodeFixProvider.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "634610" }, { "name": "PowerShell", "bytes": "2709" } ], "symlink_target": "" }
<p><ng2v-progressbar type="success" [value]="25" [striped]="true"></ng2v-progressbar></p> <p><ng2v-progressbar type="info" [value]="50" [striped]="true"></ng2v-progressbar></p> <p><ng2v-progressbar type="warning" [value]="75" [striped]="true"></ng2v-progressbar></p> <p><ng2v-progressbar type="danger" [value]="100" [striped]="true"></ng2v-progressbar></p>
{ "content_hash": "702fdd1e368a1f89a1f35d9710b12156", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 89, "avg_line_length": 89.25, "alnum_prop": 0.6750700280112045, "repo_name": "rajkeshwar/ng2v", "id": "097f9d85b01f31736202ee1b574af7f23d9b1dfa", "size": "357", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "demo/src/app/components/progressbar/demos/striped/progressbar-striped.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "352244" }, { "name": "HTML", "bytes": "1223680" }, { "name": "JavaScript", "bytes": "66516" }, { "name": "Shell", "bytes": "2096" }, { "name": "TypeScript", "bytes": "2380049" } ], "symlink_target": "" }
package com.vaadin.tests.components.treetable; import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractReindeerTestUI; import com.vaadin.v7.data.Item; import com.vaadin.v7.data.util.HierarchicalContainer; import com.vaadin.v7.ui.Table; import com.vaadin.v7.ui.TreeTable; public class TreeTableRowGenerator extends AbstractReindeerTestUI { public static final String COLUMN_A = "first"; public static final String COLUMN_B = "second"; @Override protected void setup(VaadinRequest request) { TreeTable treeTable = new TreeTable(); final HierarchicalContainer hierarchicalContainer = new HierarchicalContainer(); hierarchicalContainer.addContainerProperty(COLUMN_A, String.class, ""); hierarchicalContainer.addContainerProperty(COLUMN_B, String.class, ""); Item it = hierarchicalContainer.addItem(0); it.getItemProperty(COLUMN_A).setValue("row 1 column a"); it.getItemProperty(COLUMN_B).setValue("row 1 column b"); hierarchicalContainer.setChildrenAllowed(0, true); Item it2 = hierarchicalContainer.addItem(1); it2.getItemProperty(COLUMN_A).setValue("row 2 column a"); it2.getItemProperty(COLUMN_B).setValue("row 2 column b"); hierarchicalContainer.setChildrenAllowed(1, false); hierarchicalContainer.setParent(1, 0); treeTable.setRowGenerator(new Table.RowGenerator() { @Override public Table.GeneratedRow generateRow(Table table, Object itemId) { if (table instanceof TreeTable && ((TreeTable) table).areChildrenAllowed(itemId)) { return new Table.GeneratedRow("Spanned Row"); } else { return null; } } }); treeTable.setContainerDataSource(hierarchicalContainer); treeTable.setSizeFull(); addComponent(treeTable); } }
{ "content_hash": "a7566674a3a77333f664a759e246903f", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 88, "avg_line_length": 38.549019607843135, "alnum_prop": 0.6749745676500508, "repo_name": "Legioth/vaadin", "id": "98f0b62a4748a85a26bc085ae4618146cc2f0894", "size": "2561", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "uitest/src/main/java/com/vaadin/tests/components/treetable/TreeTableRowGenerator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "731725" }, { "name": "HTML", "bytes": "109487" }, { "name": "Java", "bytes": "22536450" }, { "name": "JavaScript", "bytes": "126895" }, { "name": "Python", "bytes": "35283" }, { "name": "Roff", "bytes": "4039" }, { "name": "Shell", "bytes": "14720" }, { "name": "Smarty", "bytes": "175" } ], "symlink_target": "" }
require('dotenv').config(); const config = { ACCESS_TOKEN: process.env.ACCESS_TOKEN, VERIFY_TOKEN: process.env.VERIFY_TOKEN, CONVERSATION_USERNAME: process.env.CONVERSATION_USERNAME, CONVERSATION_PASSWORD: process.env.CONVERSATION_PASSWORD, CONVERSATION_WORKSPACE_ID: process.env.CONVERSATION_WORKSPACE_ID }; module.exports = config;
{ "content_hash": "377c3cfae9ce89aee6121003b7a3da04", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 66, "avg_line_length": 31.363636363636363, "alnum_prop": 0.7797101449275362, "repo_name": "wagnersouz4/cognitive-scheduling", "id": "aca4804e7de2b7b8bccb30b7ad5f39c6d176138f", "size": "345", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "3744" } ], "symlink_target": "" }
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_PT" version="2.0"> <defaultcodec>UTF-8</defaultcodec> <context> <name>AboutDialog</name> <message> <location filename="../forms/aboutdialog.ui" line="+14"/> <source>About Gaelcoin</source> <translation>Sobre Gaelcoin</translation> </message> <message> <location line="+39"/> <source>&lt;b&gt;Gaelcoin&lt;/b&gt; version</source> <translation>Versão do &lt;b&gt;Gaelcoin&lt;/b&gt;</translation> </message> <message> <location line="+57"/> <source> This is experimental software. Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php. This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source> <translation> Este é um programa experimental. Distribuído sob uma licença de software MIT/X11, por favor verifique o ficheiro anexo license.txt ou http://www.opensource.org/licenses/mit-license.php. Este produto inclui software desenvolvido pelo Projecto OpenSSL para uso no OpenSSL Toolkit (http://www.openssl.org/), software criptográfico escrito por Eric Young (eay@cryptsoft.com) e software UPnP escrito por Thomas Bernard.</translation> </message> <message> <location filename="../aboutdialog.cpp" line="+14"/> <source>Copyright</source> <translation>Copyright</translation> </message> <message> <location line="+0"/> <source>The Gaelcoin developers</source> <translation>Os programadores Gaelcoin</translation> </message> </context> <context> <name>AddressBookPage</name> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>Address Book</source> <translation>Livro de endereços</translation> </message> <message> <location line="+19"/> <source>Double-click to edit address or label</source> <translation>Clique duas vezes para editar o endereço ou o rótulo</translation> </message> <message> <location line="+27"/> <source>Create a new address</source> <translation>Criar um novo endereço</translation> </message> <message> <location line="+14"/> <source>Copy the currently selected address to the system clipboard</source> <translation>Copie o endereço selecionado para a área de transferência</translation> </message> <message> <location line="-11"/> <source>&amp;New Address</source> <translation>&amp;Novo Endereço</translation> </message> <message> <location filename="../addressbookpage.cpp" line="+63"/> <source>These are your Gaelcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source> <translation>Estes são os seus endereços Gaelcoin para receber pagamentos. Poderá enviar um endereço diferente para cada remetente para poder identificar os pagamentos.</translation> </message> <message> <location filename="../forms/addressbookpage.ui" line="+14"/> <source>&amp;Copy Address</source> <translation>&amp;Copiar Endereço</translation> </message> <message> <location line="+11"/> <source>Show &amp;QR Code</source> <translation>Mostrar Código &amp;QR</translation> </message> <message> <location line="+11"/> <source>Sign a message to prove you own a Gaelcoin address</source> <translation>Assine uma mensagem para provar que é dono de um endereço Gaelcoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <location line="+25"/> <source>Delete the currently selected address from the list</source> <translation>Apagar o endereço selecionado da lista</translation> </message> <message> <location line="+27"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados no separador actual para um ficheiro</translation> </message> <message> <location line="+3"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="-44"/> <source>Verify a message to ensure it was signed with a specified Gaelcoin address</source> <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Gaelcoin especificado</translation> </message> <message> <location line="+3"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="+14"/> <source>&amp;Delete</source> <translation>E&amp;liminar</translation> </message> <message> <location filename="../addressbookpage.cpp" line="-5"/> <source>These are your Gaelcoin addresses for sending payments. Always check the amount and the receiving address before sending coins.</source> <translation>Estes são os seus endereços Gaelcoin para enviar pagamentos. Verifique sempre o valor e a morada de envio antes de enviar moedas.</translation> </message> <message> <location line="+13"/> <source>Copy &amp;Label</source> <translation>Copiar &amp;Rótulo</translation> </message> <message> <location line="+1"/> <source>&amp;Edit</source> <translation>&amp;Editar</translation> </message> <message> <location line="+1"/> <source>Send &amp;Coins</source> <translation>Enviar &amp;Moedas</translation> </message> <message> <location line="+260"/> <source>Export Address Book Data</source> <translation>Exportar dados do Livro de Endereços</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Ficheiro separado por vírgulas (*.csv)</translation> </message> <message> <location line="+13"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Não foi possível escrever para o ficheiro %1.</translation> </message> </context> <context> <name>AddressTableModel</name> <message> <location filename="../addresstablemodel.cpp" line="+144"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+36"/> <source>(no label)</source> <translation>(Sem rótulo)</translation> </message> </context> <context> <name>AskPassphraseDialog</name> <message> <location filename="../forms/askpassphrasedialog.ui" line="+26"/> <source>Passphrase Dialog</source> <translation>Diálogo de Frase-Passe</translation> </message> <message> <location line="+21"/> <source>Enter passphrase</source> <translation>Escreva a frase de segurança</translation> </message> <message> <location line="+14"/> <source>New passphrase</source> <translation>Nova frase de segurança</translation> </message> <message> <location line="+14"/> <source>Repeat new passphrase</source> <translation>Repita a nova frase de segurança</translation> </message> <message> <location filename="../askpassphrasedialog.cpp" line="+33"/> <source>Enter the new passphrase to the wallet.&lt;br/&gt;Please use a passphrase of &lt;b&gt;10 or more random characters&lt;/b&gt;, or &lt;b&gt;eight or more words&lt;/b&gt;.</source> <translation>Escreva a nova frase de seguraça da sua carteira. &lt;br/&gt; Por favor, use uma frase de &lt;b&gt;10 ou mais caracteres aleatórios,&lt;/b&gt; ou &lt;b&gt;oito ou mais palavras&lt;/b&gt;.</translation> </message> <message> <location line="+1"/> <source>Encrypt wallet</source> <translation>Encriptar carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to unlock the wallet.</source> <translation>A sua frase de segurança é necessária para desbloquear a carteira.</translation> </message> <message> <location line="+5"/> <source>Unlock wallet</source> <translation>Desbloquear carteira</translation> </message> <message> <location line="+3"/> <source>This operation needs your wallet passphrase to decrypt the wallet.</source> <translation>A sua frase de segurança é necessária para desencriptar a carteira.</translation> </message> <message> <location line="+5"/> <source>Decrypt wallet</source> <translation>Desencriptar carteira</translation> </message> <message> <location line="+3"/> <source>Change passphrase</source> <translation>Alterar frase de segurança</translation> </message> <message> <location line="+1"/> <source>Enter the old and new passphrase to the wallet.</source> <translation>Escreva a frase de segurança antiga seguida da nova para a carteira.</translation> </message> <message> <location line="+46"/> <source>Confirm wallet encryption</source> <translation>Confirmar encriptação da carteira</translation> </message> <message> <location line="+1"/> <source>Warning: If you encrypt your wallet and lose your passphrase, you will &lt;b&gt;LOSE ALL OF YOUR GAELCOINS&lt;/b&gt;!</source> <translation>Atenção: Se encriptar a carteira e perder a sua senha irá &lt;b&gt;PERDER TODOS OS SEUS GAELCOINS&lt;/b&gt;!</translation> </message> <message> <location line="+0"/> <source>Are you sure you wish to encrypt your wallet?</source> <translation>Tem a certeza que deseja encriptar a carteira?</translation> </message> <message> <location line="+15"/> <source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source> <translation>IMPORTANTE: Qualquer cópia de segurança anterior da carteira deverá ser substituída com o novo, actualmente encriptado, ficheiro de carteira. Por razões de segurança, cópias de segurança não encriptadas efectuadas anteriormente do ficheiro da carteira tornar-se-ão inúteis assim que começar a usar a nova carteira encriptada.</translation> </message> <message> <location line="+100"/> <location line="+24"/> <source>Warning: The Caps Lock key is on!</source> <translation>Atenção: A tecla Caps Lock está activa!</translation> </message> <message> <location line="-130"/> <location line="+58"/> <source>Wallet encrypted</source> <translation>Carteira encriptada</translation> </message> <message> <location line="-56"/> <source>Gaelcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your Gaelcoins from being stolen by malware infecting your computer.</source> <translation>O cliente Gaelcoin irá agora ser fechado para terminar o processo de encriptação. Recorde que a encriptação da sua carteira não protegerá totalmente os seus Gaelcoins de serem roubados por programas maliciosos que infectem o seu computador.</translation> </message> <message> <location line="+13"/> <location line="+7"/> <location line="+42"/> <location line="+6"/> <source>Wallet encryption failed</source> <translation>A encriptação da carteira falhou</translation> </message> <message> <location line="-54"/> <source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source> <translation>A encriptação da carteira falhou devido a um erro interno. A carteira não foi encriptada.</translation> </message> <message> <location line="+7"/> <location line="+48"/> <source>The supplied passphrases do not match.</source> <translation>As frases de segurança fornecidas não coincidem.</translation> </message> <message> <location line="-37"/> <source>Wallet unlock failed</source> <translation>O desbloqueio da carteira falhou</translation> </message> <message> <location line="+1"/> <location line="+11"/> <location line="+19"/> <source>The passphrase entered for the wallet decryption was incorrect.</source> <translation>A frase de segurança introduzida para a desencriptação da carteira estava incorreta.</translation> </message> <message> <location line="-20"/> <source>Wallet decryption failed</source> <translation>A desencriptação da carteira falhou</translation> </message> <message> <location line="+14"/> <source>Wallet passphrase was successfully changed.</source> <translation>A frase de segurança da carteira foi alterada com êxito.</translation> </message> </context> <context> <name>BitcoinGUI</name> <message> <location filename="../bitcoingui.cpp" line="+233"/> <source>Sign &amp;message...</source> <translation>Assinar &amp;mensagem...</translation> </message> <message> <location line="+280"/> <source>Synchronizing with network...</source> <translation>Sincronizando com a rede...</translation> </message> <message> <location line="-349"/> <source>&amp;Overview</source> <translation>Visã&amp;o geral</translation> </message> <message> <location line="+1"/> <source>Show general overview of wallet</source> <translation>Mostrar visão geral da carteira</translation> </message> <message> <location line="+20"/> <source>&amp;Transactions</source> <translation>&amp;Transações</translation> </message> <message> <location line="+1"/> <source>Browse transaction history</source> <translation>Navegar pelo histórico de transações</translation> </message> <message> <location line="+7"/> <source>Edit the list of stored addresses and labels</source> <translation>Editar a lista de endereços e rótulos</translation> </message> <message> <location line="-14"/> <source>Show the list of addresses for receiving payments</source> <translation>Mostrar a lista de endereços para receber pagamentos</translation> </message> <message> <location line="+31"/> <source>E&amp;xit</source> <translation>Fec&amp;har</translation> </message> <message> <location line="+1"/> <source>Quit application</source> <translation>Sair da aplicação</translation> </message> <message> <location line="+4"/> <source>Show information about Gaelcoin</source> <translation>Mostrar informação sobre Gaelcoin</translation> </message> <message> <location line="+2"/> <source>About &amp;Qt</source> <translation>Sobre &amp;Qt</translation> </message> <message> <location line="+1"/> <source>Show information about Qt</source> <translation>Mostrar informação sobre Qt</translation> </message> <message> <location line="+2"/> <source>&amp;Options...</source> <translation>&amp;Opções...</translation> </message> <message> <location line="+6"/> <source>&amp;Encrypt Wallet...</source> <translation>E&amp;ncriptar Carteira...</translation> </message> <message> <location line="+3"/> <source>&amp;Backup Wallet...</source> <translation>&amp;Guardar Carteira...</translation> </message> <message> <location line="+2"/> <source>&amp;Change Passphrase...</source> <translation>Mudar &amp;Palavra-passe...</translation> </message> <message> <location line="+285"/> <source>Importing blocks from disk...</source> <translation>Importando blocos do disco...</translation> </message> <message> <location line="+3"/> <source>Reindexing blocks on disk...</source> <translation>Reindexando blocos no disco...</translation> </message> <message> <location line="-347"/> <source>Send coins to a Gaelcoin address</source> <translation>Enviar moedas para um endereço Gaelcoin</translation> </message> <message> <location line="+49"/> <source>Modify configuration options for Gaelcoin</source> <translation>Modificar opções de configuração para Gaelcoin</translation> </message> <message> <location line="+9"/> <source>Backup wallet to another location</source> <translation>Faça uma cópia de segurança da carteira para outra localização</translation> </message> <message> <location line="+2"/> <source>Change the passphrase used for wallet encryption</source> <translation>Mudar a frase de segurança utilizada na encriptação da carteira</translation> </message> <message> <location line="+6"/> <source>&amp;Debug window</source> <translation>Janela de &amp;depuração</translation> </message> <message> <location line="+1"/> <source>Open debugging and diagnostic console</source> <translation>Abrir consola de diagnóstico e depuração</translation> </message> <message> <location line="-4"/> <source>&amp;Verify message...</source> <translation>&amp;Verificar mensagem...</translation> </message> <message> <location line="-165"/> <location line="+530"/> <source>Gaelcoin</source> <translation>Gaelcoin</translation> </message> <message> <location line="-530"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+101"/> <source>&amp;Send</source> <translation>&amp;Enviar</translation> </message> <message> <location line="+7"/> <source>&amp;Receive</source> <translation>&amp;Receber</translation> </message> <message> <location line="+14"/> <source>&amp;Addresses</source> <translation>E&amp;ndereços</translation> </message> <message> <location line="+22"/> <source>&amp;About Gaelcoin</source> <translation>&amp;Sobre o Gaelcoin</translation> </message> <message> <location line="+9"/> <source>&amp;Show / Hide</source> <translation>Mo&amp;strar / Ocultar</translation> </message> <message> <location line="+1"/> <source>Show or hide the main Window</source> <translation>Mostrar ou esconder a Janela principal</translation> </message> <message> <location line="+3"/> <source>Encrypt the private keys that belong to your wallet</source> <translation>Encriptar as chaves privadas que pertencem à sua carteira</translation> </message> <message> <location line="+7"/> <source>Sign messages with your Gaelcoin addresses to prove you own them</source> <translation>Assine mensagens com os seus endereços Gaelcoin para provar que os controla</translation> </message> <message> <location line="+2"/> <source>Verify messages to ensure they were signed with specified Gaelcoin addresses</source> <translation>Verifique mensagens para assegurar que foram assinadas com o endereço Gaelcoin especificado</translation> </message> <message> <location line="+28"/> <source>&amp;File</source> <translation>&amp;Ficheiro</translation> </message> <message> <location line="+7"/> <source>&amp;Settings</source> <translation>Con&amp;figurações</translation> </message> <message> <location line="+6"/> <source>&amp;Help</source> <translation>A&amp;juda</translation> </message> <message> <location line="+9"/> <source>Tabs toolbar</source> <translation>Barra de separadores</translation> </message> <message> <location line="+17"/> <location line="+10"/> <source>[testnet]</source> <translation>[rede de testes]</translation> </message> <message> <location line="+47"/> <source>Gaelcoin client</source> <translation>Cliente Gaelcoin</translation> </message> <message numerus="yes"> <location line="+141"/> <source>%n active connection(s) to Gaelcoin network</source> <translation><numerusform>%n ligação ativa à rede Gaelcoin</numerusform><numerusform>%n ligações ativas à rede Gaelcoin</numerusform></translation> </message> <message> <location line="+22"/> <source>No block source available...</source> <translation>Nenhum bloco fonto disponível</translation> </message> <message> <location line="+12"/> <source>Processed %1 of %2 (estimated) blocks of transaction history.</source> <translation>Processados %1 dos %2 blocos (estimados) do histórico de transacções.</translation> </message> <message> <location line="+4"/> <source>Processed %1 blocks of transaction history.</source> <translation>Processados %1 blocos do histórico de transações.</translation> </message> <message numerus="yes"> <location line="+20"/> <source>%n hour(s)</source> <translation><numerusform>%n hora</numerusform><numerusform>%n horas</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n day(s)</source> <translation><numerusform>%n dia</numerusform><numerusform>%n dias</numerusform></translation> </message> <message numerus="yes"> <location line="+4"/> <source>%n week(s)</source> <translation><numerusform>%n semana</numerusform><numerusform>%n semanas</numerusform></translation> </message> <message> <location line="+4"/> <source>%1 behind</source> <translation>%1 em atraso</translation> </message> <message> <location line="+14"/> <source>Last received block was generated %1 ago.</source> <translation>Último bloco recebido foi gerado há %1 atrás.</translation> </message> <message> <location line="+2"/> <source>Transactions after this will not yet be visible.</source> <translation>Transações posteriores poderão não ser imediatamente visíveis.</translation> </message> <message> <location line="+22"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="+3"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="+3"/> <source>Information</source> <translation>Informação</translation> </message> <message> <location line="+70"/> <source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source> <translation>Esta transação tem um tamanho superior ao limite máximo. Poderá enviá-la pagando uma taxa de %1, que será entregue ao nó que processar a sua transação e ajudará a suportar a rede. Deseja pagar a taxa?</translation> </message> <message> <location line="-140"/> <source>Up to date</source> <translation>Atualizado</translation> </message> <message> <location line="+31"/> <source>Catching up...</source> <translation>Recuperando...</translation> </message> <message> <location line="+113"/> <source>Confirm transaction fee</source> <translation>Confirme a taxa de transação</translation> </message> <message> <location line="+8"/> <source>Sent transaction</source> <translation>Transação enviada</translation> </message> <message> <location line="+0"/> <source>Incoming transaction</source> <translation>Transação recebida</translation> </message> <message> <location line="+1"/> <source>Date: %1 Amount: %2 Type: %3 Address: %4 </source> <translation>Data: %1 Quantia: %2 Tipo: %3 Endereço: %4 </translation> </message> <message> <location line="+33"/> <location line="+23"/> <source>URI handling</source> <translation>Manuseamento URI</translation> </message> <message> <location line="-23"/> <location line="+23"/> <source>URI can not be parsed! This can be caused by an invalid Gaelcoin address or malformed URI parameters.</source> <translation>URI não foi lido correctamente! Isto pode ser causado por um endereço Gaelcoin inválido ou por parâmetros URI malformados.</translation> </message> <message> <location line="+17"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;unlocked&lt;/b&gt;</source> <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;desbloqueada&lt;/b&gt;</translation> </message> <message> <location line="+8"/> <source>Wallet is &lt;b&gt;encrypted&lt;/b&gt; and currently &lt;b&gt;locked&lt;/b&gt;</source> <translation>A carteira está &lt;b&gt;encriptada&lt;/b&gt; e atualmente &lt;b&gt;bloqueada&lt;/b&gt;</translation> </message> <message> <location filename="../bitcoin.cpp" line="+111"/> <source>A fatal error occurred. Gaelcoin can no longer continue safely and will quit.</source> <translation>Ocorreu um erro fatal. O Gaelcoin não pode continuar com segurança e irá fechar.</translation> </message> </context> <context> <name>ClientModel</name> <message> <location filename="../clientmodel.cpp" line="+104"/> <source>Network Alert</source> <translation>Alerta da Rede</translation> </message> </context> <context> <name>EditAddressDialog</name> <message> <location filename="../forms/editaddressdialog.ui" line="+14"/> <source>Edit Address</source> <translation>Editar Endereço</translation> </message> <message> <location line="+11"/> <source>&amp;Label</source> <translation>&amp;Rótulo</translation> </message> <message> <location line="+10"/> <source>The label associated with this address book entry</source> <translation>O rótulo a ser associado com esta entrada do livro de endereços</translation> </message> <message> <location line="+7"/> <source>&amp;Address</source> <translation>E&amp;ndereço</translation> </message> <message> <location line="+10"/> <source>The address associated with this address book entry. This can only be modified for sending addresses.</source> <translation>O endereço associado com esta entrada do livro de endereços. Apenas poderá ser modificado para endereços de saída.</translation> </message> <message> <location filename="../editaddressdialog.cpp" line="+21"/> <source>New receiving address</source> <translation>Novo endereço de entrada</translation> </message> <message> <location line="+4"/> <source>New sending address</source> <translation>Novo endereço de saída</translation> </message> <message> <location line="+3"/> <source>Edit receiving address</source> <translation>Editar endereço de entrada</translation> </message> <message> <location line="+4"/> <source>Edit sending address</source> <translation>Editar endereço de saída</translation> </message> <message> <location line="+76"/> <source>The entered address &quot;%1&quot; is already in the address book.</source> <translation>O endereço introduzido &quot;%1&quot; já se encontra no livro de endereços.</translation> </message> <message> <location line="-5"/> <source>The entered address &quot;%1&quot; is not a valid Gaelcoin address.</source> <translation>O endereço introduzido &quot;%1&quot; não é um endereço Gaelcoin válido.</translation> </message> <message> <location line="+10"/> <source>Could not unlock wallet.</source> <translation>Impossível desbloquear carteira.</translation> </message> <message> <location line="+5"/> <source>New key generation failed.</source> <translation>Falha ao gerar nova chave.</translation> </message> </context> <context> <name>GUIUtil::HelpMessageBox</name> <message> <location filename="../guiutil.cpp" line="+424"/> <location line="+12"/> <source>Gaelcoin-Qt</source> <translation>Gaelcoin-Qt</translation> </message> <message> <location line="-12"/> <source>version</source> <translation>versão</translation> </message> <message> <location line="+2"/> <source>Usage:</source> <translation>Utilização:</translation> </message> <message> <location line="+1"/> <source>command-line options</source> <translation>opções da linha de comandos</translation> </message> <message> <location line="+4"/> <source>UI options</source> <translation>Opções de UI</translation> </message> <message> <location line="+1"/> <source>Set language, for example &quot;de_DE&quot; (default: system locale)</source> <translation>Definir linguagem, por exemplo &quot;pt_PT&quot; (por defeito: linguagem do sistema)</translation> </message> <message> <location line="+1"/> <source>Start minimized</source> <translation>Iniciar minimizado</translation> </message> <message> <location line="+1"/> <source>Show splash screen on startup (default: 1)</source> <translation>Mostrar animação ao iniciar (por defeito: 1)</translation> </message> </context> <context> <name>OptionsDialog</name> <message> <location filename="../forms/optionsdialog.ui" line="+14"/> <source>Options</source> <translation>Opções</translation> </message> <message> <location line="+16"/> <source>&amp;Main</source> <translation>&amp;Principal</translation> </message> <message> <location line="+6"/> <source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</source> <translation>Taxa de transação opcional por KB que ajuda a assegurar que as suas transações serão processadas rapidamente. A maioria das transações tem 1 kB.</translation> </message> <message> <location line="+15"/> <source>Pay transaction &amp;fee</source> <translation>Pagar &amp;taxa de transação</translation> </message> <message> <location line="+31"/> <source>Automatically start Gaelcoin after logging in to the system.</source> <translation>Começar o Gaelcoin automaticamente ao iniciar sessão no sistema.</translation> </message> <message> <location line="+3"/> <source>&amp;Start Gaelcoin on system login</source> <translation>&amp;Começar o Gaelcoin ao iniciar o sistema</translation> </message> <message> <location line="+35"/> <source>Reset all client options to default.</source> <translation>Repôr todas as opções.</translation> </message> <message> <location line="+3"/> <source>&amp;Reset Options</source> <translation>&amp;Repôr Opções</translation> </message> <message> <location line="+13"/> <source>&amp;Network</source> <translation>&amp;Rede</translation> </message> <message> <location line="+6"/> <source>Automatically open the Gaelcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source> <translation>Abrir a porta do cliente Gaelcoin automaticamente no seu router. Isto penas funciona se o seu router suportar UPnP e este se encontrar ligado.</translation> </message> <message> <location line="+3"/> <source>Map port using &amp;UPnP</source> <translation>Mapear porta usando &amp;UPnP</translation> </message> <message> <location line="+7"/> <source>Connect to the Gaelcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source> <translation>Ligar à rede Gaelcoin através de um proxy SOCKS (p.ex. quando ligar através de Tor).</translation> </message> <message> <location line="+3"/> <source>&amp;Connect through SOCKS proxy:</source> <translation>Ligar através de proxy SO&amp;CKS:</translation> </message> <message> <location line="+9"/> <source>Proxy &amp;IP:</source> <translation>&amp;IP do proxy:</translation> </message> <message> <location line="+19"/> <source>IP address of the proxy (e.g. 127.0.0.1)</source> <translation>Endereço IP do proxy (p.ex. 127.0.0.1)</translation> </message> <message> <location line="+7"/> <source>&amp;Port:</source> <translation>&amp;Porta:</translation> </message> <message> <location line="+19"/> <source>Port of the proxy (e.g. 9050)</source> <translation>Porta do proxy (p.ex. 9050)</translation> </message> <message> <location line="+7"/> <source>SOCKS &amp;Version:</source> <translation>&amp;Versão SOCKS:</translation> </message> <message> <location line="+13"/> <source>SOCKS version of the proxy (e.g. 5)</source> <translation>Versão do proxy SOCKS (p.ex. 5)</translation> </message> <message> <location line="+36"/> <source>&amp;Window</source> <translation>&amp;Janela</translation> </message> <message> <location line="+6"/> <source>Show only a tray icon after minimizing the window.</source> <translation>Apenas mostrar o ícone da bandeja após minimizar a janela.</translation> </message> <message> <location line="+3"/> <source>&amp;Minimize to the tray instead of the taskbar</source> <translation>&amp;Minimizar para a bandeja e não para a barra de ferramentas</translation> </message> <message> <location line="+7"/> <source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source> <translation>Minimize ao invés de sair da aplicação quando a janela é fechada. Com esta opção selecionada, a aplicação apenas será encerrada quando escolher Sair da aplicação no menú.</translation> </message> <message> <location line="+3"/> <source>M&amp;inimize on close</source> <translation>M&amp;inimizar ao fechar</translation> </message> <message> <location line="+21"/> <source>&amp;Display</source> <translation>Vis&amp;ualização</translation> </message> <message> <location line="+8"/> <source>User Interface &amp;language:</source> <translation>&amp;Linguagem da interface de utilizador:</translation> </message> <message> <location line="+13"/> <source>The user interface language can be set here. This setting will take effect after restarting Gaelcoin.</source> <translation>A linguagem da interface do utilizador pode ser definida aqui. Esta definição entrará em efeito após reiniciar o Gaelcoin.</translation> </message> <message> <location line="+11"/> <source>&amp;Unit to show amounts in:</source> <translation>&amp;Unidade a usar em quantias:</translation> </message> <message> <location line="+13"/> <source>Choose the default subdivision unit to show in the interface and when sending coins.</source> <translation>Escolha a subdivisão unitária a ser mostrada por defeito na aplicação e ao enviar moedas.</translation> </message> <message> <location line="+9"/> <source>Whether to show Gaelcoin addresses in the transaction list or not.</source> <translation>Se mostrar, ou não, os endereços Gaelcoin na lista de transações.</translation> </message> <message> <location line="+3"/> <source>&amp;Display addresses in transaction list</source> <translation>Mostrar en&amp;dereços na lista de transações</translation> </message> <message> <location line="+71"/> <source>&amp;OK</source> <translation>&amp;OK</translation> </message> <message> <location line="+7"/> <source>&amp;Cancel</source> <translation>&amp;Cancelar</translation> </message> <message> <location line="+10"/> <source>&amp;Apply</source> <translation>&amp;Aplicar</translation> </message> <message> <location filename="../optionsdialog.cpp" line="+53"/> <source>default</source> <translation>padrão</translation> </message> <message> <location line="+130"/> <source>Confirm options reset</source> <translation>Confirme a reposição de opções</translation> </message> <message> <location line="+1"/> <source>Some settings may require a client restart to take effect.</source> <translation>Algumas opções requerem o reinício do programa para funcionar.</translation> </message> <message> <location line="+0"/> <source>Do you want to proceed?</source> <translation>Deseja proceder?</translation> </message> <message> <location line="+42"/> <location line="+9"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="-9"/> <location line="+9"/> <source>This setting will take effect after restarting Gaelcoin.</source> <translation>Esta opção entrará em efeito após reiniciar o Gaelcoin.</translation> </message> <message> <location line="+29"/> <source>The supplied proxy address is invalid.</source> <translation>O endereço de proxy introduzido é inválido. </translation> </message> </context> <context> <name>OverviewPage</name> <message> <location filename="../forms/overviewpage.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+50"/> <location line="+166"/> <source>The displayed information may be out of date. Your wallet automatically synchronizes with the Gaelcoin network after a connection is established, but this process has not completed yet.</source> <translation>A informação mostrada poderá estar desatualizada. A sua carteira sincroniza automaticamente com a rede Gaelcoin depois de estabelecer ligação, mas este processo ainda não está completo.</translation> </message> <message> <location line="-124"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+29"/> <source>Unconfirmed:</source> <translation>Não confirmado:</translation> </message> <message> <location line="-78"/> <source>Wallet</source> <translation>Carteira</translation> </message> <message> <location line="+107"/> <source>Immature:</source> <translation>Imaturo:</translation> </message> <message> <location line="+13"/> <source>Mined balance that has not yet matured</source> <translation>O saldo minado ainda não maturou</translation> </message> <message> <location line="+46"/> <source>&lt;b&gt;Recent transactions&lt;/b&gt;</source> <translation>&lt;b&gt;Transações recentes&lt;/b&gt;</translation> </message> <message> <location line="-101"/> <source>Your current balance</source> <translation>O seu saldo atual</translation> </message> <message> <location line="+29"/> <source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source> <translation>Total de transações ainda não confirmadas, e que não estão contabilizadas ainda no seu saldo actual</translation> </message> <message> <location filename="../overviewpage.cpp" line="+116"/> <location line="+1"/> <source>out of sync</source> <translation>fora de sincronia</translation> </message> </context> <context> <name>PaymentServer</name> <message> <location filename="../paymentserver.cpp" line="+107"/> <source>Cannot start Gaelcoin: click-to-pay handler</source> <translation>Impossível começar o modo clicar-para-pagar com Gaelcoin:</translation> </message> </context> <context> <name>QRCodeDialog</name> <message> <location filename="../forms/qrcodedialog.ui" line="+14"/> <source>QR Code Dialog</source> <translation>Diálogo de Código QR</translation> </message> <message> <location line="+59"/> <source>Request Payment</source> <translation>Requisitar Pagamento</translation> </message> <message> <location line="+56"/> <source>Amount:</source> <translation>Quantia:</translation> </message> <message> <location line="-44"/> <source>Label:</source> <translation>Rótulo:</translation> </message> <message> <location line="+19"/> <source>Message:</source> <translation>Mensagem:</translation> </message> <message> <location line="+71"/> <source>&amp;Save As...</source> <translation>&amp;Salvar Como...</translation> </message> <message> <location filename="../qrcodedialog.cpp" line="+62"/> <source>Error encoding URI into QR Code.</source> <translation>Erro ao codificar URI em Código QR.</translation> </message> <message> <location line="+40"/> <source>The entered amount is invalid, please check.</source> <translation>A quantia introduzida é inválida, por favor verifique.</translation> </message> <message> <location line="+23"/> <source>Resulting URI too long, try to reduce the text for label / message.</source> <translation>URI resultante muito longo. Tente reduzir o texto do rótulo / mensagem.</translation> </message> <message> <location line="+25"/> <source>Save QR Code</source> <translation>Guardar Código QR</translation> </message> <message> <location line="+0"/> <source>PNG Images (*.png)</source> <translation>Imagens PNG (*.png)</translation> </message> </context> <context> <name>RPCConsole</name> <message> <location filename="../forms/rpcconsole.ui" line="+46"/> <source>Client name</source> <translation>Nome do Cliente</translation> </message> <message> <location line="+10"/> <location line="+23"/> <location line="+26"/> <location line="+23"/> <location line="+23"/> <location line="+36"/> <location line="+53"/> <location line="+23"/> <location line="+23"/> <location filename="../rpcconsole.cpp" line="+339"/> <source>N/A</source> <translation>N/D</translation> </message> <message> <location line="-217"/> <source>Client version</source> <translation>Versão do Cliente</translation> </message> <message> <location line="-45"/> <source>&amp;Information</source> <translation>&amp;Informação</translation> </message> <message> <location line="+68"/> <source>Using OpenSSL version</source> <translation>Usando versão OpenSSL</translation> </message> <message> <location line="+49"/> <source>Startup time</source> <translation>Tempo de início</translation> </message> <message> <location line="+29"/> <source>Network</source> <translation>Rede</translation> </message> <message> <location line="+7"/> <source>Number of connections</source> <translation>Número de ligações</translation> </message> <message> <location line="+23"/> <source>On testnet</source> <translation>Em rede de testes</translation> </message> <message> <location line="+23"/> <source>Block chain</source> <translation>Cadeia de blocos</translation> </message> <message> <location line="+7"/> <source>Current number of blocks</source> <translation>Número actual de blocos</translation> </message> <message> <location line="+23"/> <source>Estimated total blocks</source> <translation>Total estimado de blocos</translation> </message> <message> <location line="+23"/> <source>Last block time</source> <translation>Tempo do último bloco</translation> </message> <message> <location line="+52"/> <source>&amp;Open</source> <translation>&amp;Abrir</translation> </message> <message> <location line="+16"/> <source>Command-line options</source> <translation>Opções de linha de comandos</translation> </message> <message> <location line="+7"/> <source>Show the Gaelcoin-Qt help message to get a list with possible Gaelcoin command-line options.</source> <translation>Mostrar a mensagem de ajuda do Gaelcoin-Qt para obter uma lista com possíveis opções a usar na linha de comandos.</translation> </message> <message> <location line="+3"/> <source>&amp;Show</source> <translation>Mo&amp;strar</translation> </message> <message> <location line="+24"/> <source>&amp;Console</source> <translation>&amp;Consola</translation> </message> <message> <location line="-260"/> <source>Build date</source> <translation>Data de construção</translation> </message> <message> <location line="-104"/> <source>Gaelcoin - Debug window</source> <translation>Gaelcoin - Janela de depuração</translation> </message> <message> <location line="+25"/> <source>Gaelcoin Core</source> <translation>Núcleo Gaelcoin</translation> </message> <message> <location line="+279"/> <source>Debug log file</source> <translation>Ficheiro de registo de depuração</translation> </message> <message> <location line="+7"/> <source>Open the Gaelcoin debug log file from the current data directory. This can take a few seconds for large log files.</source> <translation>Abrir o ficheiro de registo de depuração da pasta de dados actual. Isto pode demorar alguns segundos para ficheiros de registo maiores.</translation> </message> <message> <location line="+102"/> <source>Clear console</source> <translation>Limpar consola</translation> </message> <message> <location filename="../rpcconsole.cpp" line="-30"/> <source>Welcome to the Gaelcoin RPC console.</source> <translation>Bem-vindo à consola RPC Gaelcoin.</translation> </message> <message> <location line="+1"/> <source>Use up and down arrows to navigate history, and &lt;b&gt;Ctrl-L&lt;/b&gt; to clear screen.</source> <translation>Use as setas para cima e para baixo para navegar no histórico e &lt;b&gt;Ctrl-L&lt;/b&gt; para limpar o ecrã.</translation> </message> <message> <location line="+1"/> <source>Type &lt;b&gt;help&lt;/b&gt; for an overview of available commands.</source> <translation>Digite &lt;b&gt;help&lt;/b&gt; para visualizar os comandos disponíveis.</translation> </message> </context> <context> <name>SendCoinsDialog</name> <message> <location filename="../forms/sendcoinsdialog.ui" line="+14"/> <location filename="../sendcoinsdialog.cpp" line="+124"/> <location line="+5"/> <location line="+5"/> <location line="+5"/> <location line="+6"/> <location line="+5"/> <location line="+5"/> <source>Send Coins</source> <translation>Enviar Moedas</translation> </message> <message> <location line="+50"/> <source>Send to multiple recipients at once</source> <translation>Enviar para múltiplos destinatários de uma vez</translation> </message> <message> <location line="+3"/> <source>Add &amp;Recipient</source> <translation>Adicionar &amp;Destinatário</translation> </message> <message> <location line="+20"/> <source>Remove all transaction fields</source> <translation>Remover todos os campos da transação</translation> </message> <message> <location line="+3"/> <source>Clear &amp;All</source> <translation>&amp;Limpar Tudo</translation> </message> <message> <location line="+22"/> <source>Balance:</source> <translation>Saldo:</translation> </message> <message> <location line="+10"/> <source>123.456 BTC</source> <translation>123.456 BTC</translation> </message> <message> <location line="+31"/> <source>Confirm the send action</source> <translation>Confirme ação de envio</translation> </message> <message> <location line="+3"/> <source>S&amp;end</source> <translation>&amp;Enviar</translation> </message> <message> <location filename="../sendcoinsdialog.cpp" line="-59"/> <source>&lt;b&gt;%1&lt;/b&gt; to %2 (%3)</source> <translation>&lt;b&gt;%1&lt;/b&gt; para %2 (%3)</translation> </message> <message> <location line="+5"/> <source>Confirm send coins</source> <translation>Confirme envio de moedas</translation> </message> <message> <location line="+1"/> <source>Are you sure you want to send %1?</source> <translation>Tem a certeza que deseja enviar %1?</translation> </message> <message> <location line="+0"/> <source> and </source> <translation> e </translation> </message> <message> <location line="+23"/> <source>The recipient address is not valid, please recheck.</source> <translation>O endereço de destino não é válido, por favor verifique.</translation> </message> <message> <location line="+5"/> <source>The amount to pay must be larger than 0.</source> <translation>A quantia a pagar deverá ser maior que 0.</translation> </message> <message> <location line="+5"/> <source>The amount exceeds your balance.</source> <translation>A quantia excede o seu saldo.</translation> </message> <message> <location line="+5"/> <source>The total exceeds your balance when the %1 transaction fee is included.</source> <translation>O total excede o seu saldo quando a taxa de transação de %1 for incluída.</translation> </message> <message> <location line="+6"/> <source>Duplicate address found, can only send to each address once per send operation.</source> <translation>Endereço duplicado encontrado, apenas poderá enviar uma vez para cada endereço por cada operação de envio.</translation> </message> <message> <location line="+5"/> <source>Error: Transaction creation failed!</source> <translation>Erro: A criação da transacção falhou! </translation> </message> <message> <location line="+5"/> <source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Erro: A transação foi rejeitada. Isso poderá acontecer se algumas das moedas na sua carteira já tiverem sido gastas, se por exemplo tiver usado uma cópia do ficheiro wallet.dat e as moedas foram gastas na cópia mas não foram marcadas como gastas aqui.</translation> </message> </context> <context> <name>SendCoinsEntry</name> <message> <location filename="../forms/sendcoinsentry.ui" line="+14"/> <source>Form</source> <translation>Formulário</translation> </message> <message> <location line="+15"/> <source>A&amp;mount:</source> <translation>Qu&amp;antia:</translation> </message> <message> <location line="+13"/> <source>Pay &amp;To:</source> <translation>&amp;Pagar A:</translation> </message> <message> <location line="+34"/> <source>The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>O endereço para onde enviar o pagamento (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+60"/> <location filename="../sendcoinsentry.cpp" line="+26"/> <source>Enter a label for this address to add it to your address book</source> <translation>Escreva um rótulo para este endereço para o adicionar ao seu livro de endereços</translation> </message> <message> <location line="-78"/> <source>&amp;Label:</source> <translation>Rótu&amp;lo:</translation> </message> <message> <location line="+28"/> <source>Choose address from address book</source> <translation>Escolher endereço do livro de endereços</translation> </message> <message> <location line="+10"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="+7"/> <source>Paste address from clipboard</source> <translation>Cole endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+7"/> <source>Remove this recipient</source> <translation>Remover este destinatário</translation> </message> <message> <location filename="../sendcoinsentry.cpp" line="+1"/> <source>Enter a Gaelcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Introduza um endereço Gaelcoin (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> </context> <context> <name>SignVerifyMessageDialog</name> <message> <location filename="../forms/signverifymessagedialog.ui" line="+14"/> <source>Signatures - Sign / Verify a Message</source> <translation>Assinaturas - Assinar / Verificar uma Mensagem</translation> </message> <message> <location line="+13"/> <source>&amp;Sign Message</source> <translation>A&amp;ssinar Mensagem</translation> </message> <message> <location line="+6"/> <source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source> <translation>Pode assinar mensagens com os seus endereços para provar que são seus. Tenha atenção ao assinar mensagens ambíguas, pois ataques de phishing podem tentar enganá-lo, de modo a assinar a sua identidade para os atacantes. Apenas assine declarações completamente detalhadas com as quais concorde.</translation> </message> <message> <location line="+18"/> <source>The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>O endereço a utilizar para assinar a mensagem (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+10"/> <location line="+213"/> <source>Choose an address from the address book</source> <translation>Escolher endereço do livro de endereços</translation> </message> <message> <location line="-203"/> <location line="+213"/> <source>Alt+A</source> <translation>Alt+A</translation> </message> <message> <location line="-203"/> <source>Paste address from clipboard</source> <translation>Cole endereço da área de transferência</translation> </message> <message> <location line="+10"/> <source>Alt+P</source> <translation>Alt+P</translation> </message> <message> <location line="+12"/> <source>Enter the message you want to sign here</source> <translation>Escreva aqui a mensagem que deseja assinar</translation> </message> <message> <location line="+7"/> <source>Signature</source> <translation>Assinatura</translation> </message> <message> <location line="+27"/> <source>Copy the current signature to the system clipboard</source> <translation>Copiar a assinatura actual para a área de transferência</translation> </message> <message> <location line="+21"/> <source>Sign the message to prove you own this Gaelcoin address</source> <translation>Assine uma mensagem para provar que é dono deste endereço Gaelcoin</translation> </message> <message> <location line="+3"/> <source>Sign &amp;Message</source> <translation>Assinar &amp;Mensagem</translation> </message> <message> <location line="+14"/> <source>Reset all sign message fields</source> <translation>Repôr todos os campos de assinatura de mensagem</translation> </message> <message> <location line="+3"/> <location line="+146"/> <source>Clear &amp;All</source> <translation>Limpar &amp;Tudo</translation> </message> <message> <location line="-87"/> <source>&amp;Verify Message</source> <translation>&amp;Verificar Mensagem</translation> </message> <message> <location line="+6"/> <source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source> <translation>Introduza o endereço de assinatura, mensagem (assegure-se de copiar quebras de linha, espaços, tabuladores, etc. exactamente) e assinatura abaixo para verificar a mensagem. Tenha atenção para não ler mais na assinatura do que o que estiver na mensagem assinada, para evitar ser enganado por um atacante que se encontre entre si e quem assinou a mensagem.</translation> </message> <message> <location line="+21"/> <source>The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>O endereço utilizado para assinar a mensagem (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="+40"/> <source>Verify the message to ensure it was signed with the specified Gaelcoin address</source> <translation>Verifique a mensagem para assegurar que foi assinada com o endereço Gaelcoin especificado</translation> </message> <message> <location line="+3"/> <source>Verify &amp;Message</source> <translation>Verificar &amp;Mensagem</translation> </message> <message> <location line="+14"/> <source>Reset all verify message fields</source> <translation>Repôr todos os campos de verificação de mensagem</translation> </message> <message> <location filename="../signverifymessagedialog.cpp" line="+27"/> <location line="+3"/> <source>Enter a Gaelcoin address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</source> <translation>Introduza um endereço Gaelcoin (p.ex. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)</translation> </message> <message> <location line="-2"/> <source>Click &quot;Sign Message&quot; to generate signature</source> <translation>Clique &quot;Assinar mensagem&quot; para gerar a assinatura</translation> </message> <message> <location line="+3"/> <source>Enter Gaelcoin signature</source> <translation>Introduza assinatura Gaelcoin</translation> </message> <message> <location line="+82"/> <location line="+81"/> <source>The entered address is invalid.</source> <translation>O endereço introduzido é inválido. </translation> </message> <message> <location line="-81"/> <location line="+8"/> <location line="+73"/> <location line="+8"/> <source>Please check the address and try again.</source> <translation>Por favor verifique o endereço e tente de novo.</translation> </message> <message> <location line="-81"/> <location line="+81"/> <source>The entered address does not refer to a key.</source> <translation>O endereço introduzido não refere a chave alguma.</translation> </message> <message> <location line="-73"/> <source>Wallet unlock was cancelled.</source> <translation>O desbloqueio da carteira foi cancelado.</translation> </message> <message> <location line="+8"/> <source>Private key for the entered address is not available.</source> <translation>A chave privada para o endereço introduzido não está disponível.</translation> </message> <message> <location line="+12"/> <source>Message signing failed.</source> <translation>Assinatura de mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message signed.</source> <translation>Mensagem assinada.</translation> </message> <message> <location line="+59"/> <source>The signature could not be decoded.</source> <translation>A assinatura não pôde ser descodificada.</translation> </message> <message> <location line="+0"/> <location line="+13"/> <source>Please check the signature and try again.</source> <translation>Por favor verifique a assinatura e tente de novo.</translation> </message> <message> <location line="+0"/> <source>The signature did not match the message digest.</source> <translation>A assinatura não condiz com o conteúdo da mensagem.</translation> </message> <message> <location line="+7"/> <source>Message verification failed.</source> <translation>Verificação da mensagem falhou.</translation> </message> <message> <location line="+5"/> <source>Message verified.</source> <translation>Mensagem verificada.</translation> </message> </context> <context> <name>SplashScreen</name> <message> <location filename="../splashscreen.cpp" line="+22"/> <source>The Gaelcoin developers</source> <translation>Os programadores Gaelcoin</translation> </message> <message> <location line="+1"/> <source>[testnet]</source> <translation>[rede de testes]</translation> </message> </context> <context> <name>TransactionDesc</name> <message> <location filename="../transactiondesc.cpp" line="+20"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+6"/> <source>%1/offline</source> <translation>%1/desligado</translation> </message> <message> <location line="+2"/> <source>%1/unconfirmed</source> <translation>%1/não confirmada</translation> </message> <message> <location line="+2"/> <source>%1 confirmations</source> <translation>%1 confirmações</translation> </message> <message> <location line="+18"/> <source>Status</source> <translation>Estado</translation> </message> <message numerus="yes"> <location line="+7"/> <source>, broadcast through %n node(s)</source> <translation><numerusform>, transmitida através de %n nó</numerusform><numerusform>, transmitida através de %n nós</numerusform></translation> </message> <message> <location line="+4"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+7"/> <source>Source</source> <translation>Origem</translation> </message> <message> <location line="+0"/> <source>Generated</source> <translation>Gerado</translation> </message> <message> <location line="+5"/> <location line="+17"/> <source>From</source> <translation>De</translation> </message> <message> <location line="+1"/> <location line="+22"/> <location line="+58"/> <source>To</source> <translation>Para</translation> </message> <message> <location line="-77"/> <location line="+2"/> <source>own address</source> <translation>endereço próprio</translation> </message> <message> <location line="-2"/> <source>label</source> <translation>rótulo</translation> </message> <message> <location line="+37"/> <location line="+12"/> <location line="+45"/> <location line="+17"/> <location line="+30"/> <source>Credit</source> <translation>Crédito</translation> </message> <message numerus="yes"> <location line="-102"/> <source>matures in %n more block(s)</source> <translation><numerusform>matura daqui por %n bloco</numerusform><numerusform>matura daqui por %n blocos</numerusform></translation> </message> <message> <location line="+2"/> <source>not accepted</source> <translation>não aceite</translation> </message> <message> <location line="+44"/> <location line="+8"/> <location line="+15"/> <location line="+30"/> <source>Debit</source> <translation>Débito</translation> </message> <message> <location line="-39"/> <source>Transaction fee</source> <translation>Taxa de transação</translation> </message> <message> <location line="+16"/> <source>Net amount</source> <translation>Valor líquido</translation> </message> <message> <location line="+6"/> <source>Message</source> <translation>Mensagem</translation> </message> <message> <location line="+2"/> <source>Comment</source> <translation>Comentário</translation> </message> <message> <location line="+2"/> <source>Transaction ID</source> <translation>ID da Transação</translation> </message> <message> <location line="+3"/> <source>Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to &quot;not accepted&quot; and it won&apos;t be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source> <translation>Moedas geradas deverão maturar por 120 blocos antes de poderem ser gastas. Quando gerou este bloco, ele foi transmitido para a rede para ser incluído na cadeia de blocos. Se a inclusão na cadeia de blocos falhar, irá mudar o estado para &quot;não aceite&quot; e as moedas não poderão ser gastas. Isto poderá acontecer ocasionalmente se outro nó da rede gerar um bloco a poucos segundos de diferença do seu.</translation> </message> <message> <location line="+7"/> <source>Debug information</source> <translation>Informação de depuração</translation> </message> <message> <location line="+8"/> <source>Transaction</source> <translation>Transação</translation> </message> <message> <location line="+3"/> <source>Inputs</source> <translation>Entradas</translation> </message> <message> <location line="+23"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+1"/> <source>true</source> <translation>verdadeiro</translation> </message> <message> <location line="+0"/> <source>false</source> <translation>falso</translation> </message> <message> <location line="-209"/> <source>, has not been successfully broadcast yet</source> <translation>, ainda não foi transmitida com sucesso</translation> </message> <message numerus="yes"> <location line="-35"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aberta por mais %n bloco</numerusform><numerusform>Aberta por mais %n blocos</numerusform></translation> </message> <message> <location line="+70"/> <source>unknown</source> <translation>desconhecido</translation> </message> </context> <context> <name>TransactionDescDialog</name> <message> <location filename="../forms/transactiondescdialog.ui" line="+14"/> <source>Transaction details</source> <translation>Detalhes da transação</translation> </message> <message> <location line="+6"/> <source>This pane shows a detailed description of the transaction</source> <translation>Esta janela mostra uma descrição detalhada da transação</translation> </message> </context> <context> <name>TransactionTableModel</name> <message> <location filename="../transactiontablemodel.cpp" line="+225"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+0"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+0"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+0"/> <source>Amount</source> <translation>Quantia</translation> </message> <message numerus="yes"> <location line="+57"/> <source>Open for %n more block(s)</source> <translation><numerusform>Aberta por mais %n bloco</numerusform><numerusform>Aberta por mais %n blocos</numerusform></translation> </message> <message> <location line="+3"/> <source>Open until %1</source> <translation>Aberto até %1</translation> </message> <message> <location line="+3"/> <source>Offline (%1 confirmations)</source> <translation>Desligado (%1 confirmação)</translation> </message> <message> <location line="+3"/> <source>Unconfirmed (%1 of %2 confirmations)</source> <translation>Não confirmada (%1 de %2 confirmações)</translation> </message> <message> <location line="+3"/> <source>Confirmed (%1 confirmations)</source> <translation>Confirmada (%1 confirmação)</translation> </message> <message numerus="yes"> <location line="+8"/> <source>Mined balance will be available when it matures in %n more block(s)</source> <translation><numerusform>Saldo minado ficará disponível quando maturar, daqui por %n bloco</numerusform><numerusform>Saldo minado ficará disponível quando maturar, daqui por %n blocos</numerusform></translation> </message> <message> <location line="+5"/> <source>This block was not received by any other nodes and will probably not be accepted!</source> <translation>Este bloco não foi recebido por outros nós e provavelmente não será aceite pela rede!</translation> </message> <message> <location line="+3"/> <source>Generated but not accepted</source> <translation>Gerado mas não aceite</translation> </message> <message> <location line="+43"/> <source>Received with</source> <translation>Recebido com</translation> </message> <message> <location line="+2"/> <source>Received from</source> <translation>Recebido de</translation> </message> <message> <location line="+3"/> <source>Sent to</source> <translation>Enviado para</translation> </message> <message> <location line="+2"/> <source>Payment to yourself</source> <translation>Pagamento ao próprio</translation> </message> <message> <location line="+2"/> <source>Mined</source> <translation>Minado</translation> </message> <message> <location line="+38"/> <source>(n/a)</source> <translation>(n/d)</translation> </message> <message> <location line="+199"/> <source>Transaction status. Hover over this field to show number of confirmations.</source> <translation>Estado da transação. Pairar por cima deste campo para mostrar o número de confirmações.</translation> </message> <message> <location line="+2"/> <source>Date and time that the transaction was received.</source> <translation>Data e hora a que esta transação foi recebida.</translation> </message> <message> <location line="+2"/> <source>Type of transaction.</source> <translation>Tipo de transação.</translation> </message> <message> <location line="+2"/> <source>Destination address of transaction.</source> <translation>Endereço de destino da transação.</translation> </message> <message> <location line="+2"/> <source>Amount removed from or added to balance.</source> <translation>Quantia retirada ou adicionada ao saldo.</translation> </message> </context> <context> <name>TransactionView</name> <message> <location filename="../transactionview.cpp" line="+52"/> <location line="+16"/> <source>All</source> <translation>Todas</translation> </message> <message> <location line="-15"/> <source>Today</source> <translation>Hoje</translation> </message> <message> <location line="+1"/> <source>This week</source> <translation>Esta semana</translation> </message> <message> <location line="+1"/> <source>This month</source> <translation>Este mês</translation> </message> <message> <location line="+1"/> <source>Last month</source> <translation>Mês passado</translation> </message> <message> <location line="+1"/> <source>This year</source> <translation>Este ano</translation> </message> <message> <location line="+1"/> <source>Range...</source> <translation>Período...</translation> </message> <message> <location line="+11"/> <source>Received with</source> <translation>Recebida com</translation> </message> <message> <location line="+2"/> <source>Sent to</source> <translation>Enviada para</translation> </message> <message> <location line="+2"/> <source>To yourself</source> <translation>Para si</translation> </message> <message> <location line="+1"/> <source>Mined</source> <translation>Minadas</translation> </message> <message> <location line="+1"/> <source>Other</source> <translation>Outras</translation> </message> <message> <location line="+7"/> <source>Enter address or label to search</source> <translation>Escreva endereço ou rótulo a procurar</translation> </message> <message> <location line="+7"/> <source>Min amount</source> <translation>Quantia mínima</translation> </message> <message> <location line="+34"/> <source>Copy address</source> <translation>Copiar endereço</translation> </message> <message> <location line="+1"/> <source>Copy label</source> <translation>Copiar rótulo</translation> </message> <message> <location line="+1"/> <source>Copy amount</source> <translation>Copiar quantia</translation> </message> <message> <location line="+1"/> <source>Copy transaction ID</source> <translation>Copiar ID da Transação</translation> </message> <message> <location line="+1"/> <source>Edit label</source> <translation>Editar rótulo</translation> </message> <message> <location line="+1"/> <source>Show transaction details</source> <translation>Mostrar detalhes da transação</translation> </message> <message> <location line="+139"/> <source>Export Transaction Data</source> <translation>Exportar Dados das Transações</translation> </message> <message> <location line="+1"/> <source>Comma separated file (*.csv)</source> <translation>Ficheiro separado por vírgula (*.csv)</translation> </message> <message> <location line="+8"/> <source>Confirmed</source> <translation>Confirmada</translation> </message> <message> <location line="+1"/> <source>Date</source> <translation>Data</translation> </message> <message> <location line="+1"/> <source>Type</source> <translation>Tipo</translation> </message> <message> <location line="+1"/> <source>Label</source> <translation>Rótulo</translation> </message> <message> <location line="+1"/> <source>Address</source> <translation>Endereço</translation> </message> <message> <location line="+1"/> <source>Amount</source> <translation>Quantia</translation> </message> <message> <location line="+1"/> <source>ID</source> <translation>ID</translation> </message> <message> <location line="+4"/> <source>Error exporting</source> <translation>Erro ao exportar</translation> </message> <message> <location line="+0"/> <source>Could not write to file %1.</source> <translation>Impossível escrever para o ficheiro %1.</translation> </message> <message> <location line="+100"/> <source>Range:</source> <translation>Período:</translation> </message> <message> <location line="+8"/> <source>to</source> <translation>até</translation> </message> </context> <context> <name>WalletModel</name> <message> <location filename="../walletmodel.cpp" line="+193"/> <source>Send Coins</source> <translation>Enviar Moedas</translation> </message> </context> <context> <name>WalletView</name> <message> <location filename="../walletview.cpp" line="+42"/> <source>&amp;Export</source> <translation>&amp;Exportar</translation> </message> <message> <location line="+1"/> <source>Export the data in the current tab to a file</source> <translation>Exportar os dados no separador actual para um ficheiro</translation> </message> <message> <location line="+193"/> <source>Backup Wallet</source> <translation>Cópia de Segurança da Carteira</translation> </message> <message> <location line="+0"/> <source>Wallet Data (*.dat)</source> <translation>Dados da Carteira (*.dat)</translation> </message> <message> <location line="+3"/> <source>Backup Failed</source> <translation>Cópia de Segurança Falhou</translation> </message> <message> <location line="+0"/> <source>There was an error trying to save the wallet data to the new location.</source> <translation>Ocorreu um erro ao tentar guardar os dados da carteira na nova localização.</translation> </message> <message> <location line="+4"/> <source>Backup Successful</source> <translation>Cópia de Segurança Bem Sucedida</translation> </message> <message> <location line="+0"/> <source>The wallet data was successfully saved to the new location.</source> <translation>Os dados da carteira foram salvos com sucesso numa nova localização.</translation> </message> </context> <context> <name>bitcoin-core</name> <message> <location filename="../bitcoinstrings.cpp" line="+94"/> <source>Gaelcoin version</source> <translation>Versão Gaelcoin</translation> </message> <message> <location line="+102"/> <source>Usage:</source> <translation>Utilização:</translation> </message> <message> <location line="-29"/> <source>Send command to -server or Gaelcoind</source> <translation>Enviar comando para -server ou Gaelcoind</translation> </message> <message> <location line="-23"/> <source>List commands</source> <translation>Listar comandos</translation> </message> <message> <location line="-12"/> <source>Get help for a command</source> <translation>Obter ajuda para um comando</translation> </message> <message> <location line="+24"/> <source>Options:</source> <translation>Opções:</translation> </message> <message> <location line="+24"/> <source>Specify configuration file (default: Gaelcoin.conf)</source> <translation>Especificar ficheiro de configuração (por defeito: Gaelcoin.conf)</translation> </message> <message> <location line="+3"/> <source>Specify pid file (default: Gaelcoind.pid)</source> <translation>Especificar ficheiro pid (por defeito: Gaelcoind.pid)</translation> </message> <message> <location line="-1"/> <source>Specify data directory</source> <translation>Especificar pasta de dados</translation> </message> <message> <location line="-9"/> <source>Set database cache size in megabytes (default: 25)</source> <translation>Definir o tamanho da cache de base de dados em megabytes (por defeito: 25)</translation> </message> <message> <location line="-28"/> <source>Listen for connections on &lt;port&gt; (default: 9333 or testnet: 19333)</source> <translation>Escute por ligações em &lt;port&gt; (por defeito: 9333 ou testnet: 19333)</translation> </message> <message> <location line="+5"/> <source>Maintain at most &lt;n&gt; connections to peers (default: 125)</source> <translation>Manter no máximo &lt;n&gt; ligações a outros nós da rede (por defeito: 125)</translation> </message> <message> <location line="-48"/> <source>Connect to a node to retrieve peer addresses, and disconnect</source> <translation>Ligar a um nó para recuperar endereços de pares, e desligar</translation> </message> <message> <location line="+82"/> <source>Specify your own public address</source> <translation>Especifique o seu endereço público</translation> </message> <message> <location line="+3"/> <source>Threshold for disconnecting misbehaving peers (default: 100)</source> <translation>Tolerância para desligar nós mal-formados (por defeito: 100)</translation> </message> <message> <location line="-134"/> <source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source> <translation>Número de segundos a impedir que nós mal-formados se liguem de novo (por defeito: 86400)</translation> </message> <message> <location line="-29"/> <source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source> <translation>Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv4: %s</translation> </message> <message> <location line="+27"/> <source>Listen for JSON-RPC connections on &lt;port&gt; (default: 9332 or testnet: 19332)</source> <translation>Escutar por ligações JSON-RPC em &lt;port&gt; (por defeito: 9332 ou rede de testes: 19332)</translation> </message> <message> <location line="+37"/> <source>Accept command line and JSON-RPC commands</source> <translation>Aceitar comandos da consola e JSON-RPC</translation> </message> <message> <location line="+76"/> <source>Run in the background as a daemon and accept commands</source> <translation>Correr o processo como um daemon e aceitar comandos</translation> </message> <message> <location line="+37"/> <source>Use the test network</source> <translation>Utilizar a rede de testes - testnet</translation> </message> <message> <location line="-112"/> <source>Accept connections from outside (default: 1 if no -proxy or -connect)</source> <translation>Aceitar ligações externas (padrão: 1 sem -proxy ou -connect)</translation> </message> <message> <location line="-80"/> <source>%s, you must set a rpcpassword in the configuration file: %s It is recommended you use the following random password: rpcuser=Gaelcoinrpc rpcpassword=%s (you do not need to remember this password) The username and password MUST NOT be the same. If the file does not exist, create it with owner-readable-only file permissions. It is also recommended to set alertnotify so you are notified of problems; for example: alertnotify=echo %%s | mail -s &quot;Gaelcoin Alert&quot; admin@foo.com </source> <translation>%s, deverá definir rpcpassword no ficheiro de configuração : %s É recomendado que use a seguinte palavra-passe aleatória: rpcuser=Gaelcoinrpc rpcpassword=%s (não precisa recordar esta palavra-passe) O nome de utilizador e password NÃO DEVEM ser iguais. Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono. Também é recomendado definir alertnotify para que seja alertado sobre problemas; por exemplo: alertnotify=echo %%s | mail -s &quot;Alerta Gaelcoin&quot; admin@foo.com </translation> </message> <message> <location line="+17"/> <source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source> <translation>Ocorreu um erro ao definir a porta %u do serviço RPC a escutar em IPv6, a usar IPv4: %s</translation> </message> <message> <location line="+3"/> <source>Bind to given address and always listen on it. Use [host]:port notation for IPv6</source> <translation>Trancar a endereço específio e sempre escutar nele. Use a notação [anfitrião]:porta para IPv6</translation> </message> <message> <location line="+3"/> <source>Cannot obtain a lock on data directory %s. Gaelcoin is probably already running.</source> <translation>Impossível trancar a pasta de dados %s. Provavelmente o Gaelcoin já está a ser executado.</translation> </message> <message> <location line="+3"/> <source>Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source> <translation>Erro: A transação foi rejeitada. Isso poderá acontecer se algumas das moedas na sua carteira já tiverem sido gastas, se por exemplo tiver usado uma cópia do ficheiro wallet.dat e as moedas foram gastas na cópia mas não foram marcadas como gastas aqui.</translation> </message> <message> <location line="+4"/> <source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!</source> <translation>Erro: Esta transação requer uma taxa de transação mínima de %s devido á sua quantia, complexidade, ou uso de fundos recebidos recentemente! </translation> </message> <message> <location line="+3"/> <source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source> <translation>Executar comando quando um alerta relevante for recebido (no comando, %s é substituído pela mensagem)</translation> </message> <message> <location line="+3"/> <source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source> <translation>Executar comando quando uma das transações na carteira mudar (no comando, %s é substituído pelo ID da Transação)</translation> </message> <message> <location line="+11"/> <source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source> <translation>Definir tamanho máximo de transações de alta-/baixa-prioridade em bytes (por defeito: 27000)</translation> </message> <message> <location line="+6"/> <source>This is a pre-release test build - use at your own risk - do not use for mining or merchant applications</source> <translation>Esta é uma versão de pré-lançamento - use à sua responsabilidade - não usar para minar ou aplicações comerciais</translation> </message> <message> <location line="+5"/> <source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source> <translation>Atenção: -paytxfee está definida com um valor muito alto! Esta é a taxa que irá pagar se enviar uma transação.</translation> </message> <message> <location line="+3"/> <source>Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.</source> <translation>Atenção: As transações mostradas poderão não estar correctas! Poderá ter que atualizar ou outros nós poderão ter que atualizar.</translation> </message> <message> <location line="+3"/> <source>Warning: Please check that your computer&apos;s date and time are correct! If your clock is wrong Gaelcoin will not work properly.</source> <translation>Atenção: Por favor verifique que a data e hora do seu computador estão correctas! Se o seu relógio não estiver certo o Gaelcoin não irá funcionar correctamente.</translation> </message> <message> <location line="+3"/> <source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source> <translation>Atenção: erro ao ler wallet.dat! Todas as chaves foram lidas correctamente, mas dados de transação ou do livro de endereços podem estar em falta ou incorrectos.</translation> </message> <message> <location line="+3"/> <source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source> <translation>Atenção: wallet.dat corrupto, dados recuperados! wallet.dat original salvo como wallet.{timestamp}.bak em %s; se o seu saldo ou transações estiverem incorrectos deverá recuperar de uma cópia de segurança.</translation> </message> <message> <location line="+14"/> <source>Attempt to recover private keys from a corrupt wallet.dat</source> <translation>Tentar recuperar chaves privadas de um wallet.dat corrupto</translation> </message> <message> <location line="+2"/> <source>Block creation options:</source> <translation>Opções de criação de bloco:</translation> </message> <message> <location line="+5"/> <source>Connect only to the specified node(s)</source> <translation>Apenas ligar ao(s) nó(s) especificado(s)</translation> </message> <message> <location line="+3"/> <source>Corrupted block database detected</source> <translation>Cadeia de blocos corrompida detectada</translation> </message> <message> <location line="+1"/> <source>Discover own IP address (default: 1 when listening and no -externalip)</source> <translation>Descobrir endereço IP próprio (padrão: 1 ao escutar e sem -externalip)</translation> </message> <message> <location line="+1"/> <source>Do you want to rebuild the block database now?</source> <translation>Deseja reconstruir agora a cadeia de blocos?</translation> </message> <message> <location line="+2"/> <source>Error initializing block database</source> <translation>Erro ao inicializar a cadeia de blocos</translation> </message> <message> <location line="+1"/> <source>Error initializing wallet database environment %s!</source> <translation>Erro ao inicializar o ambiente de base de dados da carteira %s!</translation> </message> <message> <location line="+1"/> <source>Error loading block database</source> <translation>Erro ao carregar cadeia de blocos</translation> </message> <message> <location line="+4"/> <source>Error opening block database</source> <translation>Erro ao abrir a cadeia de blocos</translation> </message> <message> <location line="+2"/> <source>Error: Disk space is low!</source> <translation>Erro: Pouco espaço em disco!</translation> </message> <message> <location line="+1"/> <source>Error: Wallet locked, unable to create transaction!</source> <translation>Erro: Carteira bloqueada, incapaz de criar transação! </translation> </message> <message> <location line="+1"/> <source>Error: system error: </source> <translation>Erro: erro do sistema:</translation> </message> <message> <location line="+1"/> <source>Failed to listen on any port. Use -listen=0 if you want this.</source> <translation>Falhou a escutar em qualquer porta. Use -listen=0 se quer isto.</translation> </message> <message> <location line="+1"/> <source>Failed to read block info</source> <translation>Falha ao ler info do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to read block</source> <translation>Falha ao ler bloco</translation> </message> <message> <location line="+1"/> <source>Failed to sync block index</source> <translation>Falha ao sincronizar índice do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write block index</source> <translation>Falha ao escrever índice do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write block info</source> <translation>Falha ao escrever info do bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write block</source> <translation>Falha ao escrever o bloco</translation> </message> <message> <location line="+1"/> <source>Failed to write file info</source> <translation>Falha ao escrever info do ficheiro</translation> </message> <message> <location line="+1"/> <source>Failed to write to coin database</source> <translation>Falha ao escrever na base de dados de moedas</translation> </message> <message> <location line="+1"/> <source>Failed to write transaction index</source> <translation>Falha ao escrever índice de transações</translation> </message> <message> <location line="+1"/> <source>Failed to write undo data</source> <translation>Falha ao escrever histórico de modificações</translation> </message> <message> <location line="+2"/> <source>Find peers using DNS lookup (default: 1 unless -connect)</source> <translation>Encontrar pares usando procura DNS (por defeito: 1 excepto -connect)</translation> </message> <message> <location line="+1"/> <source>Generate coins (default: 0)</source> <translation>Gerar moedas (por defeito: 0)</translation> </message> <message> <location line="+2"/> <source>How many blocks to check at startup (default: 288, 0 = all)</source> <translation>Quantos blocos verificar ao começar (por defeito: 288, 0 = todos)</translation> </message> <message> <location line="+1"/> <source>How thorough the block verification is (0-4, default: 3)</source> <translation>Qual a minúcia na verificação de blocos (0-4, por defeito: 3)</translation> </message> <message> <location line="+19"/> <source>Not enough file descriptors available.</source> <translation>Descritores de ficheiros disponíveis são insuficientes.</translation> </message> <message> <location line="+8"/> <source>Rebuild block chain index from current blk000??.dat files</source> <translation>Reconstruir a cadeia de blocos dos ficheiros blk000??.dat actuais</translation> </message> <message> <location line="+16"/> <source>Set the number of threads to service RPC calls (default: 4)</source> <translation>Defina o número de processos para servir as chamadas RPC (por defeito: 4)</translation> </message> <message> <location line="+26"/> <source>Verifying blocks...</source> <translation>Verificando blocos...</translation> </message> <message> <location line="+1"/> <source>Verifying wallet...</source> <translation>Verificando a carteira...</translation> </message> <message> <location line="-69"/> <source>Imports blocks from external blk000??.dat file</source> <translation>Importar blocos de um ficheiro blk000??.dat externo</translation> </message> <message> <location line="-76"/> <source>Set the number of script verification threads (up to 16, 0 = auto, &lt;0 = leave that many cores free, default: 0)</source> <translation>Defina o número de processos de verificação (até 16, 0 = automático, &lt;0 = disponibiliza esse número de núcleos livres, por defeito: 0)</translation> </message> <message> <location line="+77"/> <source>Information</source> <translation>Informação</translation> </message> <message> <location line="+3"/> <source>Invalid -tor address: &apos;%s&apos;</source> <translation>Endereço -tor inválido: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantia inválida para -minrelaytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount for -mintxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantia inválida para -mintxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+8"/> <source>Maintain a full transaction index (default: 0)</source> <translation>Manter índice de transações completo (por defeito: 0)</translation> </message> <message> <location line="+2"/> <source>Maximum per-connection receive buffer, &lt;n&gt;*1000 bytes (default: 5000)</source> <translation>Armazenamento intermédio de recepção por ligação, &lt;n&gt;*1000 bytes (por defeito: 5000)</translation> </message> <message> <location line="+1"/> <source>Maximum per-connection send buffer, &lt;n&gt;*1000 bytes (default: 1000)</source> <translation>Armazenamento intermédio de envio por ligação, &lt;n&gt;*1000 bytes (por defeito: 1000)</translation> </message> <message> <location line="+2"/> <source>Only accept block chain matching built-in checkpoints (default: 1)</source> <translation>Apenas aceitar cadeia de blocos coincidente com marcas de verificação internas (por defeito: 1)</translation> </message> <message> <location line="+1"/> <source>Only connect to nodes in network &lt;net&gt; (IPv4, IPv6 or Tor)</source> <translation>Apenas ligar a nós na rede &lt;net&gt; (IPv4, IPv6 ou Tor)</translation> </message> <message> <location line="+2"/> <source>Output extra debugging information. Implies all other -debug* options</source> <translation>Produzir informação de depuração extra. Implica todas as outras opções -debug*</translation> </message> <message> <location line="+1"/> <source>Output extra network debugging information</source> <translation>Produzir informação de depuração extraordinária</translation> </message> <message> <location line="+2"/> <source>Prepend debug output with timestamp</source> <translation>Preceder informação de depuração com selo temporal</translation> </message> <message> <location line="+5"/> <source>SSL options: (see the Gaelcoin Wiki for SSL setup instructions)</source> <translation>Opções SSL: (ver a Wiki Gaelcoin para instruções de configuração SSL)</translation> </message> <message> <location line="+1"/> <source>Select the version of socks proxy to use (4-5, default: 5)</source> <translation>Selecione a versão do proxy socks a usar (4-5, padrão: 5)</translation> </message> <message> <location line="+3"/> <source>Send trace/debug info to console instead of debug.log file</source> <translation>Enviar informação de rastreio/depuração para a consola e não para o ficheiro debug.log</translation> </message> <message> <location line="+1"/> <source>Send trace/debug info to debugger</source> <translation>Enviar informação de rastreio/depuração para o depurador</translation> </message> <message> <location line="+5"/> <source>Set maximum block size in bytes (default: 250000)</source> <translation>Definir tamanho máximo de um bloco em bytes (por defeito: 250000)</translation> </message> <message> <location line="+1"/> <source>Set minimum block size in bytes (default: 0)</source> <translation>Definir tamanho minímo de um bloco em bytes (por defeito: 0)</translation> </message> <message> <location line="+2"/> <source>Shrink debug.log file on client startup (default: 1 when no -debug)</source> <translation>Encolher ficheiro debug.log ao iniciar o cliente (por defeito: 1 sem -debug definido)</translation> </message> <message> <location line="+1"/> <source>Signing transaction failed</source> <translation>Falhou assinatura da transação</translation> </message> <message> <location line="+2"/> <source>Specify connection timeout in milliseconds (default: 5000)</source> <translation>Especificar tempo de espera da ligação em millisegundos (por defeito: 5000)</translation> </message> <message> <location line="+4"/> <source>System error: </source> <translation>Erro de sistema:</translation> </message> <message> <location line="+4"/> <source>Transaction amount too small</source> <translation>Quantia da transação é muito baixa</translation> </message> <message> <location line="+1"/> <source>Transaction amounts must be positive</source> <translation>Quantia da transação deverá ser positiva</translation> </message> <message> <location line="+1"/> <source>Transaction too large</source> <translation>Transação grande demais</translation> </message> <message> <location line="+7"/> <source>Use UPnP to map the listening port (default: 0)</source> <translation>Usar UPnP para mapear a porta de escuta (padrão: 0)</translation> </message> <message> <location line="+1"/> <source>Use UPnP to map the listening port (default: 1 when listening)</source> <translation>Usar UPnP para mapear a porta de escuta (padrão: 1 ao escutar)</translation> </message> <message> <location line="+1"/> <source>Use proxy to reach tor hidden services (default: same as -proxy)</source> <translation>Utilizar proxy para aceder a serviços escondidos Tor (por defeito: mesmo que -proxy)</translation> </message> <message> <location line="+2"/> <source>Username for JSON-RPC connections</source> <translation>Nome de utilizador para ligações JSON-RPC</translation> </message> <message> <location line="+4"/> <source>Warning</source> <translation>Aviso</translation> </message> <message> <location line="+1"/> <source>Warning: This version is obsolete, upgrade required!</source> <translation>Atenção: Esta versão está obsoleta, é necessário actualizar!</translation> </message> <message> <location line="+1"/> <source>You need to rebuild the databases using -reindex to change -txindex</source> <translation>Necessita reconstruir as bases de dados usando -reindex para mudar -txindex</translation> </message> <message> <location line="+1"/> <source>wallet.dat corrupt, salvage failed</source> <translation>wallet.dat corrupta, recuperação falhou</translation> </message> <message> <location line="-50"/> <source>Password for JSON-RPC connections</source> <translation>Palavra-passe para ligações JSON-RPC</translation> </message> <message> <location line="-67"/> <source>Allow JSON-RPC connections from specified IP address</source> <translation>Permitir ligações JSON-RPC do endereço IP especificado</translation> </message> <message> <location line="+76"/> <source>Send commands to node running on &lt;ip&gt; (default: 127.0.0.1)</source> <translation>Enviar comandos para o nó a correr em &lt;ip&gt; (por defeito: 127.0.0.1)</translation> </message> <message> <location line="-120"/> <source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source> <translation>Executar comando quando mudar o melhor bloco (no comando, %s é substituído pela hash do bloco)</translation> </message> <message> <location line="+147"/> <source>Upgrade wallet to latest format</source> <translation>Atualize a carteira para o formato mais recente</translation> </message> <message> <location line="-21"/> <source>Set key pool size to &lt;n&gt; (default: 100)</source> <translation>Definir o tamanho da memória de chaves para &lt;n&gt; (por defeito: 100)</translation> </message> <message> <location line="-12"/> <source>Rescan the block chain for missing wallet transactions</source> <translation>Reexaminar a cadeia de blocos para transações em falta na carteira</translation> </message> <message> <location line="+35"/> <source>Use OpenSSL (https) for JSON-RPC connections</source> <translation>Usar OpenSSL (https) para ligações JSON-RPC</translation> </message> <message> <location line="-26"/> <source>Server certificate file (default: server.cert)</source> <translation>Ficheiro de certificado do servidor (por defeito: server.cert)</translation> </message> <message> <location line="+1"/> <source>Server private key (default: server.pem)</source> <translation>Chave privada do servidor (por defeito: server.pem)</translation> </message> <message> <location line="-151"/> <source>Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</source> <translation>Cifras aceitáveis (por defeito: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)</translation> </message> <message> <location line="+165"/> <source>This help message</source> <translation>Esta mensagem de ajuda</translation> </message> <message> <location line="+6"/> <source>Unable to bind to %s on this computer (bind returned error %d, %s)</source> <translation>Incapaz de vincular a %s neste computador (vínculo retornou erro %d, %s)</translation> </message> <message> <location line="-91"/> <source>Connect through socks proxy</source> <translation>Ligar através de um proxy socks</translation> </message> <message> <location line="-10"/> <source>Allow DNS lookups for -addnode, -seednode and -connect</source> <translation>Permitir procuras DNS para -addnode, -seednode e -connect</translation> </message> <message> <location line="+55"/> <source>Loading addresses...</source> <translation>Carregar endereços...</translation> </message> <message> <location line="-35"/> <source>Error loading wallet.dat: Wallet corrupted</source> <translation>Erro ao carregar wallet.dat: Carteira danificada</translation> </message> <message> <location line="+1"/> <source>Error loading wallet.dat: Wallet requires newer version of Gaelcoin</source> <translation>Erro ao carregar wallet.dat: A Carteira requer uma versão mais recente do Gaelcoin</translation> </message> <message> <location line="+93"/> <source>Wallet needed to be rewritten: restart Gaelcoin to complete</source> <translation>A Carteira precisou ser reescrita: reinicie o Gaelcoin para completar</translation> </message> <message> <location line="-95"/> <source>Error loading wallet.dat</source> <translation>Erro ao carregar wallet.dat</translation> </message> <message> <location line="+28"/> <source>Invalid -proxy address: &apos;%s&apos;</source> <translation>Endereço -proxy inválido: &apos;%s&apos;</translation> </message> <message> <location line="+56"/> <source>Unknown network specified in -onlynet: &apos;%s&apos;</source> <translation>Rede desconhecida especificada em -onlynet: &apos;%s&apos;</translation> </message> <message> <location line="-1"/> <source>Unknown -socks proxy version requested: %i</source> <translation>Versão desconhecida de proxy -socks requisitada: %i</translation> </message> <message> <location line="-96"/> <source>Cannot resolve -bind address: &apos;%s&apos;</source> <translation>Não conseguiu resolver endereço -bind: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Cannot resolve -externalip address: &apos;%s&apos;</source> <translation>Não conseguiu resolver endereço -externalip: &apos;%s&apos;</translation> </message> <message> <location line="+44"/> <source>Invalid amount for -paytxfee=&lt;amount&gt;: &apos;%s&apos;</source> <translation>Quantia inválida para -paytxfee=&lt;amount&gt;: &apos;%s&apos;</translation> </message> <message> <location line="+1"/> <source>Invalid amount</source> <translation>Quantia inválida</translation> </message> <message> <location line="-6"/> <source>Insufficient funds</source> <translation>Fundos insuficientes</translation> </message> <message> <location line="+10"/> <source>Loading block index...</source> <translation>Carregar índice de blocos...</translation> </message> <message> <location line="-57"/> <source>Add a node to connect to and attempt to keep the connection open</source> <translation>Adicione um nó ao qual se ligar e tentar manter a ligação aberta</translation> </message> <message> <location line="-25"/> <source>Unable to bind to %s on this computer. Gaelcoin is probably already running.</source> <translation>Incapaz de vincular à porta %s neste computador. Provavelmente o Gaelcoin já está a funcionar.</translation> </message> <message> <location line="+64"/> <source>Fee per KB to add to transactions you send</source> <translation>Taxa por KB a adicionar a transações enviadas</translation> </message> <message> <location line="+19"/> <source>Loading wallet...</source> <translation>Carregar carteira...</translation> </message> <message> <location line="-52"/> <source>Cannot downgrade wallet</source> <translation>Impossível mudar a carteira para uma versão anterior</translation> </message> <message> <location line="+3"/> <source>Cannot write default address</source> <translation>Impossível escrever endereço por defeito</translation> </message> <message> <location line="+64"/> <source>Rescanning...</source> <translation>Reexaminando...</translation> </message> <message> <location line="-57"/> <source>Done loading</source> <translation>Carregamento completo</translation> </message> <message> <location line="+82"/> <source>To use the %s option</source> <translation>Para usar a opção %s</translation> </message> <message> <location line="-74"/> <source>Error</source> <translation>Erro</translation> </message> <message> <location line="-31"/> <source>You must set rpcpassword=&lt;password&gt; in the configuration file: %s If the file does not exist, create it with owner-readable-only file permissions.</source> <translation>Deverá definir rpcpassword=&lt;password&gt; no ficheiro de configuração: %s Se o ficheiro não existir, crie-o com permissões de leitura apenas para o dono.</translation> </message> </context> </TS>
{ "content_hash": "ec5d9f9a11c21af1c4d10a89bc6ef3b9", "timestamp": "", "source": "github", "line_count": 2938, "max_line_length": 442, "avg_line_length": 40.16473791695031, "alnum_prop": 0.6340547778041422, "repo_name": "GaelCoin/GaelCoin", "id": "8144f76758baa446b44725e4c6e4a2989c6ee698", "size": "118814", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/qt/locale/bitcoin_pt_PT.ts", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "103297" }, { "name": "C++", "bytes": "2521212" }, { "name": "CSS", "bytes": "1127" }, { "name": "IDL", "bytes": "15097" }, { "name": "Objective-C", "bytes": "5864" }, { "name": "Python", "bytes": "37264" }, { "name": "Shell", "bytes": "9702" }, { "name": "TypeScript", "bytes": "5236293" } ], "symlink_target": "" }
<html><head><meta charset="utf-8"/> <meta http-equiv="Content-type" content="text/html; charset=utf8"/> <title>オブジェクトを移動させる</title> </head><body><link rel='stylesheet' href='../../css/bootstrap.css'/> <link rel='stylesheet' href='../../css/tonyu.css'/> <script src='../../js/lib/jquery-1.10.1.js'/></script> <script src='../../js/ide/NWMenu.js'/></script> <style>body{padding-top:20px; margin-left: 20px; margin-right:20px; font-family:"MS UI Gothic",sans-serif;}</style> <button onclick='javascript:history.back();'>←Back</button><br/> <div><a id="line_marker_-0" name="line_marker_-0"></a><a href="E382AAE38396E382B8E382A7E382AFE38388E38292E8A1A8E7A4BAE38199E3828B.html">オブジェクトを表示する</a><span> </span><a id="line_marker_-1" name="line_marker_-1"></a><span>オブジェクト</span><span> </span></div><div style="height: 100px;"></div><br/><button onclick='javascript:history.back();'>←Back</button> </body></html>
{ "content_hash": "ba8f9988264d1036bbf538f93a535eba", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 157, "avg_line_length": 69.46153846153847, "alnum_prop": 0.6888150609080842, "repo_name": "hoge1e3/tonyuedit", "id": "fae3f3ed061b7848da113f2c25f1dd2bc6b3677a", "size": "965", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "war/doc/tonyu2/E382AAE38396E382B8E382A7E382AFE38388E38292E7A7BBE58B95E38195E3819BE3828B.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "19752" }, { "name": "HTML", "bytes": "2378667" }, { "name": "Java", "bytes": "259230" }, { "name": "JavaScript", "bytes": "19360184" }, { "name": "Perl", "bytes": "515" } ], "symlink_target": "" }
#ifndef WebProcessConnection_h #define WebProcessConnection_h #if ENABLE(PLUGIN_PROCESS) #include "Connection.h" #include "Plugin.h" #include "WebProcessConnectionMessages.h" #include <wtf/HashSet.h> #include <wtf/RefCounted.h> namespace WebKit { class NPRemoteObjectMap; class PluginControllerProxy; struct PluginCreationParameters; // A connection from a plug-in process to a web process. class WebProcessConnection : public RefCounted<WebProcessConnection>, CoreIPC::Connection::Client { public: static PassRefPtr<WebProcessConnection> create(CoreIPC::Connection::Identifier); virtual ~WebProcessConnection(); CoreIPC::Connection* connection() const { return m_connection.get(); } NPRemoteObjectMap* npRemoteObjectMap() const { return m_npRemoteObjectMap.get(); } void removePluginControllerProxy(PluginControllerProxy*, Plugin*); static void setGlobalException(const String&); private: WebProcessConnection(CoreIPC::Connection::Identifier); void addPluginControllerProxy(PassOwnPtr<PluginControllerProxy>); void destroyPluginControllerProxy(PluginControllerProxy*); // CoreIPC::Connection::Client virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&) OVERRIDE; virtual void didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&) OVERRIDE; virtual void didClose(CoreIPC::Connection*); virtual void didReceiveInvalidMessage(CoreIPC::Connection*, CoreIPC::StringReference messageReceiverName, CoreIPC::StringReference messageName); // Message handlers. void didReceiveWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&); void didReceiveSyncWebProcessConnectionMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::MessageDecoder&, OwnPtr<CoreIPC::MessageEncoder>&); void createPlugin(const PluginCreationParameters&, PassRefPtr<Messages::WebProcessConnection::CreatePlugin::DelayedReply>); void createPluginAsynchronously(const PluginCreationParameters&); void destroyPlugin(uint64_t pluginInstanceID, bool asynchronousCreationIncomplete); void createPluginInternal(const PluginCreationParameters&, bool& result, bool& wantsWheelEvents, uint32_t& remoteLayerClientID); RefPtr<CoreIPC::Connection> m_connection; HashMap<uint64_t, PluginControllerProxy*> m_pluginControllers; RefPtr<NPRemoteObjectMap> m_npRemoteObjectMap; HashSet<uint64_t> m_asynchronousInstanceIDsToIgnore; }; } // namespace WebKit #endif // ENABLE(PLUGIN_PROCESS) #endif // WebProcessConnection_h
{ "content_hash": "ab73a203f9f3dee6a82b38de49c84457", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 153, "avg_line_length": 39.11764705882353, "alnum_prop": 0.7909774436090226, "repo_name": "leighpauls/k2cro4", "id": "aba4c5742152f734528c3c4ed91d3e13cb9dc3e0", "size": "4014", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "third_party/WebKit/Source/WebKit2/PluginProcess/WebProcessConnection.h", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ASP", "bytes": "3062" }, { "name": "AppleScript", "bytes": "25392" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "68131038" }, { "name": "C", "bytes": "242794338" }, { "name": "C#", "bytes": "11024" }, { "name": "C++", "bytes": "353525184" }, { "name": "Common Lisp", "bytes": "3721" }, { "name": "D", "bytes": "1931" }, { "name": "Emacs Lisp", "bytes": "1639" }, { "name": "F#", "bytes": "4992" }, { "name": "FORTRAN", "bytes": "10404" }, { "name": "Java", "bytes": "3845159" }, { "name": "JavaScript", "bytes": "39146656" }, { "name": "Lua", "bytes": "13768" }, { "name": "Matlab", "bytes": "22373" }, { "name": "Objective-C", "bytes": "21887598" }, { "name": "PHP", "bytes": "2344144" }, { "name": "Perl", "bytes": "49033099" }, { "name": "Prolog", "bytes": "2926122" }, { "name": "Python", "bytes": "39863959" }, { "name": "R", "bytes": "262" }, { "name": "Racket", "bytes": "359" }, { "name": "Ruby", "bytes": "304063" }, { "name": "Scheme", "bytes": "14853" }, { "name": "Shell", "bytes": "9195117" }, { "name": "Tcl", "bytes": "1919771" }, { "name": "Verilog", "bytes": "3092" }, { "name": "Visual Basic", "bytes": "1430" }, { "name": "eC", "bytes": "5079" } ], "symlink_target": "" }
// (C) Copyright 2015 Moodle Pty Ltd. // // 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. import { Injectable } from '@angular/core'; import { CoreSites, CoreSitesCommonWSOptions, CoreSitesReadingStrategy } from '@services/sites'; import { CoreSite, CoreSiteWSPreSets } from '@classes/site'; import { CoreInterceptor } from '@classes/interceptor'; import { CoreWSExternalWarning, CoreWSExternalFile, CoreWSFile } from '@services/ws'; import { makeSingleton, Translate } from '@singletons'; import { CoreCourseCommonModWSOptions } from '@features/course/services/course'; import { CoreTextUtils } from '@services/utils/text'; import { CoreGrades } from '@features/grades/services/grades'; import { CoreTimeUtils } from '@services/utils/time'; import { CoreCourseLogHelper } from '@features/course/services/log-helper'; import { CoreError } from '@classes/errors/error'; import { CoreApp } from '@services/app'; import { CoreUtils } from '@services/utils/utils'; import { AddonModAssignOffline } from './assign-offline'; import { AddonModAssignSubmissionDelegate } from './submission-delegate'; import { CoreComments } from '@features/comments/services/comments'; import { AddonModAssignSubmissionFormatted } from './assign-helper'; import { CoreWSError } from '@classes/errors/wserror'; import { AddonModAssignAutoSyncData, AddonModAssignManualSyncData, AddonModAssignSyncProvider } from './assign-sync'; import { CoreFormFields } from '@singletons/form'; import { CoreFileHelper } from '@services/file-helper'; import { CoreIonicColorNames } from '@singletons/colors'; const ROOT_CACHE_KEY = 'mmaModAssign:'; declare module '@singletons/events' { /** * Augment CoreEventsData interface with events specific to this service. * * @see https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation */ export interface CoreEventsData { [AddonModAssignProvider.SUBMISSION_SAVED_EVENT]: AddonModAssignSubmissionSavedEventData; [AddonModAssignProvider.SUBMITTED_FOR_GRADING_EVENT]: AddonModAssignSubmittedForGradingEventData; [AddonModAssignProvider.GRADED_EVENT]: AddonModAssignGradedEventData; [AddonModAssignProvider.STARTED_EVENT]: AddonModAssignStartedEventData; [AddonModAssignSyncProvider.MANUAL_SYNCED]: AddonModAssignManualSyncData; [AddonModAssignSyncProvider.AUTO_SYNCED]: AddonModAssignAutoSyncData; } } /** * Service that provides some functions for assign. */ @Injectable({ providedIn: 'root' }) export class AddonModAssignProvider { static readonly COMPONENT = 'mmaModAssign'; static readonly SUBMISSION_COMPONENT = 'mmaModAssignSubmission'; static readonly UNLIMITED_ATTEMPTS = -1; // Group submissions warnings. static readonly WARN_GROUPS_REQUIRED = 'warnrequired'; static readonly WARN_GROUPS_OPTIONAL = 'warnoptional'; // Events. static readonly SUBMISSION_SAVED_EVENT = 'addon_mod_assign_submission_saved'; static readonly SUBMITTED_FOR_GRADING_EVENT = 'addon_mod_assign_submitted_for_grading'; static readonly GRADED_EVENT = 'addon_mod_assign_graded'; static readonly STARTED_EVENT = 'addon_mod_assign_started'; /** * Check if the user can submit in offline. This should only be used if submissionStatus.lastattempt.cansubmit cannot * be used (offline usage). * This function doesn't check if the submission is empty, it should be checked before calling this function. * * @param assign Assignment instance. * @param submissionStatus Submission status returned by getSubmissionStatus. * @return Whether it can submit. */ canSubmitOffline(assign: AddonModAssignAssign, submissionStatus: AddonModAssignGetSubmissionStatusWSResponse): boolean { if (!this.isSubmissionOpen(assign, submissionStatus)) { return false; } const userSubmission = submissionStatus.lastattempt?.submission; const teamSubmission = submissionStatus.lastattempt?.teamsubmission; if (teamSubmission) { if (teamSubmission.status === AddonModAssignSubmissionStatusValues.SUBMITTED) { // The assignment submission has been completed. return false; } else if (userSubmission && userSubmission.status === AddonModAssignSubmissionStatusValues.SUBMITTED) { // The user has already clicked the submit button on the team submission. return false; } else if (assign.preventsubmissionnotingroup && !submissionStatus.lastattempt?.submissiongroup) { return false; } } else if (userSubmission) { if (userSubmission.status === AddonModAssignSubmissionStatusValues.SUBMITTED) { // The assignment submission has been completed. return false; } } else { // No valid submission or team submission. return false; } // Last check is that this instance allows drafts. return !!assign.submissiondrafts; } /** * Fix some submission status params. * * @param site Site to use. * @param userId User Id (empty for current user). * @param groupId Group Id (empty for all participants). * @param isBlind If blind marking is enabled or not. * @return Object with fixed params. */ protected fixSubmissionStatusParams( site: CoreSite, userId?: number, groupId?: number, isBlind = false, ): AddonModAssignFixedSubmissionParams { return { isBlind: !userId ? false : !!isBlind, groupId: groupId || 0, userId: userId || site.getUserId(), }; } /** * Get an assignment by course module ID. * * @param courseId Course ID the assignment belongs to. * @param cmId Assignment module ID. * @param options Other options. * @return Promise resolved with the assignment. */ getAssignment(courseId: number, cmId: number, options: CoreSitesCommonWSOptions = {}): Promise<AddonModAssignAssign> { return this.getAssignmentByField(courseId, 'cmid', cmId, options); } /** * Get an assigment with key=value. If more than one is found, only the first will be returned. * * @param courseId Course ID. * @param key Name of the property to check. * @param value Value to search. * @param options Other options. * @return Promise resolved when the assignment is retrieved. */ protected async getAssignmentByField( courseId: number, key: string, value: number, options: CoreSitesCommonWSOptions = {}, ): Promise<AddonModAssignAssign> { const site = await CoreSites.getSite(options.siteId); const params: AddonModAssignGetAssignmentsWSParams = { courseids: [courseId], includenotenrolledcourses: true, }; const preSets: CoreSiteWSPreSets = { cacheKey: this.getAssignmentCacheKey(courseId), updateFrequency: CoreSite.FREQUENCY_RARELY, component: AddonModAssignProvider.COMPONENT, ...CoreSites.getReadingStrategyPreSets(options.readingStrategy), // Include reading strategy preSets. }; let response: AddonModAssignGetAssignmentsWSResponse; try { response = await site.read<AddonModAssignGetAssignmentsWSResponse>('mod_assign_get_assignments', params, preSets); } catch { // In 3.6 we added a new parameter includenotenrolledcourses that could cause offline data not to be found. // Retry again without the param to check if the request is already cached. delete params.includenotenrolledcourses; response = await site.read('mod_assign_get_assignments', params, preSets); } // Search the assignment to return. if (response.courses.length) { const assignment = response.courses[0].assignments.find((assignment) => assignment[key] == value); if (assignment) { return assignment; } } throw new CoreError(Translate.instant('core.course.modulenotfound')); } /** * Get an assignment by instance ID. * * @param courseId Course ID the assignment belongs to. * @param id Assignment instance ID. * @param options Other options. * @return Promise resolved with the assignment. */ getAssignmentById(courseId: number, id: number, options: CoreSitesCommonWSOptions = {}): Promise<AddonModAssignAssign> { return this.getAssignmentByField(courseId, 'id', id, options); } /** * Get cache key for assignment data WS calls. * * @param courseId Course ID. * @return Cache key. */ protected getAssignmentCacheKey(courseId: number): string { return ROOT_CACHE_KEY + 'assignment:' + courseId; } /** * Get an assignment user mapping for blind marking. * * @param assignId Assignment Id. * @param userId User Id to be blinded. * @param options Other options. * @return Promise resolved with the user blind id. */ async getAssignmentUserMappings(assignId: number, userId: number, options: CoreCourseCommonModWSOptions = {}): Promise<number> { if (!userId || userId < 0) { // User not valid, stop. return -1; } const site = await CoreSites.getSite(options.siteId); const params: AddonModAssignGetUserMappingsWSParams = { assignmentids: [assignId], }; const preSets: CoreSiteWSPreSets = { cacheKey: this.getAssignmentUserMappingsCacheKey(assignId), updateFrequency: CoreSite.FREQUENCY_OFTEN, component: AddonModAssignProvider.COMPONENT, componentId: options.cmId, ...CoreSites.getReadingStrategyPreSets(options.readingStrategy), }; const response = await site.read<AddonModAssignGetUserMappingsWSResponse>('mod_assign_get_user_mappings', params, preSets); // Search the user. if (response.assignments.length && response.assignments[0].assignmentid == assignId) { const mapping = response.assignments[0].mappings.find((mapping) => mapping.userid == userId); if (mapping) { return mapping.id; } } else if (response.warnings && response.warnings.length) { throw response.warnings[0]; } throw new CoreError('Assignment user mappings not found'); } /** * Get cache key for assignment user mappings data WS calls. * * @param assignId Assignment ID. * @return Cache key. */ protected getAssignmentUserMappingsCacheKey(assignId: number): string { return ROOT_CACHE_KEY + 'usermappings:' + assignId; } /** * Returns grade information from assign_grades for the requested assignment id * * @param assignId Assignment Id. * @param options Other options. * @return Resolved with requested info when done. */ async getAssignmentGrades(assignId: number, options: CoreCourseCommonModWSOptions = {}): Promise<AddonModAssignGrade[]> { const site = await CoreSites.getSite(options.siteId); const params: AddonModAssignGetGradesWSParams = { assignmentids: [assignId], }; const preSets: CoreSiteWSPreSets = { cacheKey: this.getAssignmentGradesCacheKey(assignId), component: AddonModAssignProvider.COMPONENT, componentId: options.cmId, ...CoreSites.getReadingStrategyPreSets(options.readingStrategy), }; const response = await site.read<AddonModAssignGetGradesWSResponse>('mod_assign_get_grades', params, preSets); // Search the assignment. if (response.assignments.length && response.assignments[0].assignmentid == assignId) { return response.assignments[0].grades; } else if (response.warnings && response.warnings.length) { if (response.warnings[0].warningcode == '3') { // No grades found. return []; } throw response.warnings[0]; } throw new CoreError('Assignment grades not found.'); } /** * Get cache key for assignment grades data WS calls. * * @param assignId Assignment ID. * @return Cache key. */ protected getAssignmentGradesCacheKey(assignId: number): string { return ROOT_CACHE_KEY + 'assigngrades:' + assignId; } /** * Returns the color name for a given grading status name. * * @param status Grading status name * @return The color name. */ getSubmissionGradingStatusColor(status?: AddonModAssignGradingStates): CoreIonicColorNames { if (!status) { return CoreIonicColorNames.NONE; } if (status == AddonModAssignGradingStates.GRADED || status == AddonModAssignGradingStates.MARKING_WORKFLOW_STATE_RELEASED) { return CoreIonicColorNames.SUCCESS; } return CoreIonicColorNames.DANGER; } /** * Returns the translation id for a given grading status name. * * @param status Grading Status name * @return The status translation identifier. */ getSubmissionGradingStatusTranslationId(status?: AddonModAssignGradingStates): string | undefined { if (!status) { return; } if (status == AddonModAssignGradingStates.GRADED || status == AddonModAssignGradingStates.NOT_GRADED || status == AddonModAssignGradingStates.GRADED_FOLLOWUP_SUBMIT) { return 'addon.mod_assign.' + status; } return 'addon.mod_assign.markingworkflowstate' + status; } /** * Get the submission object from an attempt. * * @param assign Assign. * @param attempt Attempt. * @return Submission object or null. */ getSubmissionObjectFromAttempt( assign: AddonModAssignAssign, attempt: AddonModAssignSubmissionAttempt | undefined, ): AddonModAssignSubmission | undefined { if (!attempt) { return; } return assign.teamsubmission ? attempt.teamsubmission : attempt.submission; } /** * Get attachments of a submission plugin. * * @param submissionPlugin Submission plugin. * @return Submission plugin attachments. */ getSubmissionPluginAttachments(submissionPlugin: AddonModAssignPlugin): CoreWSFile[] { if (!submissionPlugin.fileareas) { return []; } const files: CoreWSFile[] = []; submissionPlugin.fileareas.forEach((filearea) => { if (!filearea || !filearea.files) { // No files to get. return; } filearea.files.forEach((file) => { if (!file.filename) { // We don't have filename, extract it from the path. file.filename = CoreFileHelper.getFilenameFromPath(file); } files.push(file); }); }); return files; } /** * Get text of a submission plugin. * * @param submissionPlugin Submission plugin. * @param keepUrls True if it should keep original URLs, false if they should be replaced. * @return Submission text. */ getSubmissionPluginText(submissionPlugin: AddonModAssignPlugin, keepUrls = false): string { if (!submissionPlugin.editorfields) { return ''; } let text = ''; submissionPlugin.editorfields.forEach((field) => { text += field.text; }); if (!keepUrls && submissionPlugin.fileareas && submissionPlugin.fileareas[0]) { text = CoreTextUtils.replacePluginfileUrls(text, submissionPlugin.fileareas[0].files || []); } return text; } /** * Get an assignment submissions. * * @param assignId Assignment id. * @param options Other options. * @return Promise resolved when done. */ async getSubmissions( assignId: number, options: CoreCourseCommonModWSOptions = {}, ): Promise<{ canviewsubmissions: boolean; submissions?: AddonModAssignSubmission[] }> { const site = await CoreSites.getSite(options.siteId); const params: AddonModAssignGetSubmissionsWSParams = { assignmentids: [assignId], }; const preSets: CoreSiteWSPreSets = { cacheKey: this.getSubmissionsCacheKey(assignId), updateFrequency: CoreSite.FREQUENCY_OFTEN, component: AddonModAssignProvider.COMPONENT, componentId: options.cmId, ...CoreSites.getReadingStrategyPreSets(options.readingStrategy), }; const response = await site.read<AddonModAssignGetSubmissionsWSResponse>('mod_assign_get_submissions', params, preSets); // Check if we can view submissions, with enough permissions. if (response.warnings?.length && response.warnings[0].warningcode == '1') { return { canviewsubmissions: false }; } if (response.assignments && response.assignments.length) { return { canviewsubmissions: true, submissions: response.assignments[0].submissions, }; } throw new CoreError('Assignment submissions not found'); } /** * Get cache key for assignment submissions data WS calls. * * @param assignId Assignment id. * @return Cache key. */ protected getSubmissionsCacheKey(assignId: number): string { return ROOT_CACHE_KEY + 'submissions:' + assignId; } /** * Get information about an assignment submission status for a given user. * * @param assignId Assignment instance id. * @param options Other options. * @return Promise always resolved with the user submission status. */ async getSubmissionStatus( assignId: number, options: AddonModAssignSubmissionStatusOptions = {}, ): Promise<AddonModAssignGetSubmissionStatusWSResponse> { const site = await CoreSites.getSite(options.siteId); options = { filter: true, ...options, }; const fixedParams = this.fixSubmissionStatusParams(site, options.userId, options.groupId, options.isBlind); const params: AddonModAssignGetSubmissionStatusWSParams = { assignid: assignId, userid: fixedParams.userId, }; if (fixedParams.groupId) { params.groupid = fixedParams.groupId; } const preSets: CoreSiteWSPreSets = { cacheKey: this.getSubmissionStatusCacheKey( assignId, fixedParams.userId, fixedParams.groupId, fixedParams.isBlind, ), getCacheUsingCacheKey: true, filter: options.filter, rewriteurls: options.filter, component: AddonModAssignProvider.COMPONENT, componentId: options.cmId, // Don't cache when getting text without filters. // @todo Change this to support offline editing. saveToCache: options.filter, ...CoreSites.getReadingStrategyPreSets(options.readingStrategy), }; return site.read<AddonModAssignGetSubmissionStatusWSResponse>('mod_assign_get_submission_status', params, preSets); } /** * Get information about an assignment submission status for a given user. * If the data doesn't include the user submission, retry ignoring cache. * * @param assign Assignment. * @param options Other options. * @return Promise always resolved with the user submission status. */ async getSubmissionStatusWithRetry( assign: AddonModAssignAssign, options: AddonModAssignSubmissionStatusOptions = {}, ): Promise<AddonModAssignGetSubmissionStatusWSResponse> { options.cmId = options.cmId || assign.cmid; const response = await this.getSubmissionStatus(assign.id, options); const userSubmission = this.getSubmissionObjectFromAttempt(assign, response.lastattempt); if (userSubmission) { return response; } // Try again, ignoring cache. const newOptions = { ...options, readingStrategy: CoreSitesReadingStrategy.ONLY_NETWORK, }; try { return this.getSubmissionStatus(assign.id, newOptions); } catch { // Error, return the first result even if it doesn't have the user submission. return response; } } /** * Get cache key for get submission status data WS calls. * * @param assignId Assignment instance id. * @param userId User id (empty for current user). * @param groupId Group Id (empty for all participants). * @param isBlind If blind marking is enabled or not. * @return Cache key. */ protected getSubmissionStatusCacheKey(assignId: number, userId: number, groupId?: number, isBlind = false): string { return this.getSubmissionsCacheKey(assignId) + ':' + userId + ':' + (isBlind ? 1 : 0) + ':' + groupId; } /** * Returns the color name for a given status name. * * @param status Status name * @return The color name. */ getSubmissionStatusColor(status: AddonModAssignSubmissionStatusValues): CoreIonicColorNames { switch (status) { case AddonModAssignSubmissionStatusValues.SUBMITTED: return CoreIonicColorNames.SUCCESS; case AddonModAssignSubmissionStatusValues.DRAFT: return CoreIonicColorNames.INFO; case AddonModAssignSubmissionStatusValues.NEW: case AddonModAssignSubmissionStatusValues.NO_ATTEMPT: case AddonModAssignSubmissionStatusValues.NO_ONLINE_SUBMISSIONS: case AddonModAssignSubmissionStatusValues.NO_SUBMISSION: case AddonModAssignSubmissionStatusValues.GRADED_FOLLOWUP_SUBMIT: return CoreIonicColorNames.DANGER; default: return CoreIonicColorNames.LIGHT; } } /** * Given a list of plugins, returns the plugin names that aren't supported for editing. * * @param plugins Plugins to check. * @return Promise resolved with unsupported plugin names. */ async getUnsupportedEditPlugins(plugins: AddonModAssignPlugin[]): Promise<string[]> { const notSupported: string[] = []; const promises = plugins.map((plugin) => AddonModAssignSubmissionDelegate.isPluginSupportedForEdit(plugin.type).then((enabled) => { if (!enabled) { notSupported.push(plugin.name); } return; })); await Promise.all(promises); return notSupported; } /** * List the participants for a single assignment, with some summary info about their submissions. * * @param assignId Assignment id. * @param groupId Group id. If not defined, 0. * @param options Other options. * @return Promise resolved with the list of participants and summary of submissions. */ async listParticipants( assignId: number, groupId?: number, options: CoreCourseCommonModWSOptions = {}, ): Promise<AddonModAssignParticipant[]> { groupId = groupId || 0; const site = await CoreSites.getSite(options.siteId); const params: AddonModAssignListParticipantsWSParams = { assignid: assignId, groupid: groupId, filter: '', }; const preSets: CoreSiteWSPreSets = { cacheKey: this.listParticipantsCacheKey(assignId, groupId), updateFrequency: CoreSite.FREQUENCY_OFTEN, component: AddonModAssignProvider.COMPONENT, componentId: options.cmId, ...CoreSites.getReadingStrategyPreSets(options.readingStrategy), }; return site.read<AddonModAssignListParticipantsWSResponse>('mod_assign_list_participants', params, preSets); } /** * Get cache key for assignment list participants data WS calls. * * @param assignId Assignment id. * @param groupId Group id. * @return Cache key. */ protected listParticipantsCacheKey(assignId: number, groupId: number): string { return this.listParticipantsPrefixCacheKey(assignId) + ':' + groupId; } /** * Get prefix cache key for assignment list participants data WS calls. * * @param assignId Assignment id. * @return Cache key. */ protected listParticipantsPrefixCacheKey(assignId: number): string { return ROOT_CACHE_KEY + 'participants:' + assignId; } /** * Invalidates all submission status data. * * @param assignId Assignment instance id. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateAllSubmissionData(assignId: number, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); await site.invalidateWsCacheForKeyStartingWith(this.getSubmissionsCacheKey(assignId)); } /** * Invalidates assignment data WS calls. * * @param courseId Course ID. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateAssignmentData(courseId: number, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); await site.invalidateWsCacheForKey(this.getAssignmentCacheKey(courseId)); } /** * Invalidates assignment user mappings data WS calls. * * @param assignId Assignment ID. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateAssignmentUserMappingsData(assignId: number, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); await site.invalidateWsCacheForKey(this.getAssignmentUserMappingsCacheKey(assignId)); } /** * Invalidates assignment grades data WS calls. * * @param assignId Assignment ID. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateAssignmentGradesData(assignId: number, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); await site.invalidateWsCacheForKey(this.getAssignmentGradesCacheKey(assignId)); } /** * Invalidate the prefetched content except files. * * @param moduleId The module ID. * @param courseId Course ID. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateContent(moduleId: number, courseId: number, siteId?: string): Promise<void> { siteId = siteId || CoreSites.getCurrentSiteId(); const assign = await this.getAssignment(courseId, moduleId, { siteId }); const promises: Promise<void>[] = []; // Do not invalidate assignment data before getting assignment info, we need it! promises.push(this.invalidateAllSubmissionData(assign.id, siteId)); promises.push(this.invalidateAssignmentUserMappingsData(assign.id, siteId)); promises.push(this.invalidateAssignmentGradesData(assign.id, siteId)); promises.push(this.invalidateListParticipantsData(assign.id, siteId)); promises.push(CoreComments.invalidateCommentsByInstance('module', assign.id, siteId)); promises.push(this.invalidateAssignmentData(courseId, siteId)); promises.push(CoreGrades.invalidateAllCourseGradesData(courseId)); await Promise.all(promises); } /** * Invalidates assignment submissions data WS calls. * * @param assignId Assignment instance id. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateSubmissionData(assignId: number, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); await site.invalidateWsCacheForKey(this.getSubmissionsCacheKey(assignId)); } /** * Invalidates submission status data. * * @param assignId Assignment instance id. * @param userId User id (empty for current user). * @param groupId Group Id (empty for all participants). * @param isBlind Whether blind marking is enabled or not. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateSubmissionStatusData( assignId: number, userId?: number, groupId?: number, isBlind = false, siteId?: string, ): Promise<void> { const site = await CoreSites.getSite(siteId); const fixedParams = this.fixSubmissionStatusParams(site, userId, groupId, isBlind); await site.invalidateWsCacheForKey(this.getSubmissionStatusCacheKey( assignId, fixedParams.userId, fixedParams.groupId, fixedParams.isBlind, )); } /** * Invalidates assignment participants data. * * @param assignId Assignment instance id. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the data is invalidated. */ async invalidateListParticipantsData(assignId: number, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); await site.invalidateWsCacheForKeyStartingWith(this.listParticipantsPrefixCacheKey(assignId)); } /** * Check if a submission is open. This function is based on Moodle's submissions_open. * * @param assign Assignment instance. * @param submissionStatus Submission status returned by getSubmissionStatus. * @return Whether submission is open. */ isSubmissionOpen(assign: AddonModAssignAssign, submissionStatus?: AddonModAssignGetSubmissionStatusWSResponse): boolean { if (!assign || !submissionStatus) { return false; } const time = CoreTimeUtils.timestamp(); const lastAttempt = submissionStatus.lastattempt; const submission = this.getSubmissionObjectFromAttempt(assign, lastAttempt); let dateOpen = true; let finalDate: number | undefined; if (assign.cutoffdate) { finalDate = assign.cutoffdate; } if (lastAttempt && lastAttempt.locked) { return false; } // User extensions. if (finalDate) { if (lastAttempt && lastAttempt.extensionduedate) { // Extension can be before cut off date. if (lastAttempt.extensionduedate > finalDate) { finalDate = lastAttempt.extensionduedate; } } } if (finalDate) { dateOpen = assign.allowsubmissionsfromdate <= time && time <= finalDate; } else { dateOpen = assign.allowsubmissionsfromdate <= time; } if (!dateOpen) { return false; } if (submission) { if (assign.submissiondrafts && submission.status == AddonModAssignSubmissionStatusValues.SUBMITTED) { // Drafts are tracked and the student has submitted the assignment. return false; } } return true; } /** * Report an assignment submission as being viewed. * * @param assignid Assignment ID. * @param name Name of the assign. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the WS call is successful. */ async logSubmissionView(assignid: number, name?: string, siteId?: string): Promise<void> { const params: AddonModAssignViewSubmissionStatusWSParams = { assignid, }; await CoreCourseLogHelper.logSingle( 'mod_assign_view_submission_status', params, AddonModAssignProvider.COMPONENT, assignid, name, 'assign', {}, siteId, ); } /** * Report an assignment grading table is being viewed. * * @param assignid Assignment ID. * @param name Name of the assign. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the WS call is successful. */ async logGradingView(assignid: number, name?: string, siteId?: string): Promise<void> { const params: AddonModAssignViewGradingTableWSParams = { assignid, }; await CoreCourseLogHelper.logSingle( 'mod_assign_view_grading_table', params, AddonModAssignProvider.COMPONENT, assignid, name, 'assign', {}, siteId, ); } /** * Report an assign as being viewed. * * @param assignid Assignment ID. * @param name Name of the assign. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when the WS call is successful. */ async logView(assignid: number, name?: string, siteId?: string): Promise<void> { const params: AddonModAssignViewAssignWSParams = { assignid, }; await CoreCourseLogHelper.logSingle( 'mod_assign_view_assign', params, AddonModAssignProvider.COMPONENT, assignid, name, 'assign', {}, siteId, ); } /** * Returns if a submissions needs to be graded. * * @param submission Submission. * @param assignId Assignment ID. * @return Promise resolved with boolean: whether it needs to be graded or not. */ async needsSubmissionToBeGraded(submission: AddonModAssignSubmissionFormatted, assignId: number): Promise<boolean> { if (submission.status != AddonModAssignSubmissionStatusValues.SUBMITTED) { return false; } if (!submission.gradingstatus) { // This should not happen, but it's better to show rather than not showing any of the submissions. return true; } if (submission.gradingstatus != AddonModAssignGradingStates.GRADED && submission.gradingstatus != AddonModAssignGradingStates.MARKING_WORKFLOW_STATE_RELEASED) { // Not graded. return true; } // We need more data to decide that. const response = await this.getSubmissionStatus(assignId, { userId: submission.submitid, isBlind: !!submission.blindid, }); if (!response.feedback || !response.feedback.gradeddate) { // Not graded. return true; } return response.feedback.gradeddate < submission.timemodified; } /** * Save current user submission for a certain assignment. * * @param assignId Assign ID. * @param courseId Course ID the assign belongs to. * @param pluginData Data to save. * @param allowOffline Whether to allow offline usage. * @param timemodified The time the submission was last modified in online. * @param allowsDrafts Whether the assignment allows submission drafts. * @param userId User ID. If not defined, site's current user. * @param siteId Site ID. If not defined, current site. * @return Promise resolved with true if sent to server, resolved with false if stored in offline. */ async saveSubmission( assignId: number, courseId: number, pluginData: AddonModAssignSavePluginData, allowOffline: boolean, timemodified: number, allowsDrafts = false, userId?: number, siteId?: string, ): Promise<boolean> { siteId = siteId || CoreSites.getCurrentSiteId(); // Function to store the submission to be synchronized later. const storeOffline = async (): Promise<boolean> => { await AddonModAssignOffline.saveSubmission( assignId, courseId, pluginData, timemodified, !allowsDrafts, userId, siteId, ); return false; }; if (allowOffline && !CoreApp.isOnline()) { // App is offline, store the action. return storeOffline(); } try { // If there's already a submission to be sent to the server, discard it first. await AddonModAssignOffline.deleteSubmission(assignId, userId, siteId); await this.saveSubmissionOnline(assignId, pluginData, siteId); return true; } catch (error) { if (allowOffline && error && !CoreUtils.isWebServiceError(error)) { // Couldn't connect to server, store in offline. return storeOffline(); } else { // The WebService has thrown an error or offline not supported, reject. throw error; } } } /** * Save current user submission for a certain assignment. It will fail if offline or cannot connect. * * @param assignId Assign ID. * @param pluginData Data to save. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when saved, rejected otherwise. */ async saveSubmissionOnline(assignId: number, pluginData: AddonModAssignSavePluginData, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); const params: AddonModAssignSaveSubmissionWSParams = { assignmentid: assignId, plugindata: pluginData, }; const warnings = await site.write<CoreWSExternalWarning[]>('mod_assign_save_submission', params); if (warnings.length) { // The WebService returned warnings, reject. throw new CoreWSError(warnings[0]); } } /** * Start a submission. * * @param assignId Assign ID. * @param siteId Site ID. If not defined, use current site. * @return Promise resolved when done. */ async startSubmission(assignId: number, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); const params: AddonModAssignStartSubmissionWSParams = { assignid: assignId, }; const result = await site.write<AddonModAssignStartSubmissionWSResponse>('mod_assign_start_submission', params); if (!result.warnings?.length) { return; } // Ignore some warnings. const warning = result.warnings.find(warning => warning.warningcode !== 'timelimitnotenabled' && warning.warningcode !== 'opensubmissionexists'); if (warning) { throw new CoreWSError(warning); } } /** * Submit the current user assignment for grading. * * @param assignId Assign ID. * @param courseId Course ID the assign belongs to. * @param acceptStatement True if submission statement is accepted, false otherwise. * @param timemodified The time the submission was last modified in online. * @param forceOffline True to always mark it in offline. * @param siteId Site ID. If not defined, current site. * @return Promise resolved with true if sent to server, resolved with false if stored in offline. */ async submitForGrading( assignId: number, courseId: number, acceptStatement: boolean, timemodified: number, forceOffline = false, siteId?: string, ): Promise<boolean> { siteId = siteId || CoreSites.getCurrentSiteId(); // Function to store the submission to be synchronized later. const storeOffline = async (): Promise<boolean> => { await AddonModAssignOffline.markSubmitted( assignId, courseId, true, acceptStatement, timemodified, undefined, siteId, ); return false; }; if (forceOffline || !CoreApp.isOnline()) { // App is offline, store the action. return storeOffline(); } try { // If there's already a submission to be sent to the server, discard it first. await AddonModAssignOffline.deleteSubmission(assignId, undefined, siteId); await this.submitForGradingOnline(assignId, acceptStatement, siteId); return true; } catch (error) { if (error && !CoreUtils.isWebServiceError(error)) { // Couldn't connect to server, store in offline. return storeOffline(); } else { // The WebService has thrown an error, reject. throw error; } } } /** * Submit the current user assignment for grading. It will fail if offline or cannot connect. * * @param assignId Assign ID. * @param acceptStatement True if submission statement is accepted, false otherwise. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when submitted, rejected otherwise. */ async submitForGradingOnline(assignId: number, acceptStatement: boolean, siteId?: string): Promise<void> { const site = await CoreSites.getSite(siteId); const params: AddonModAssignSubmitForGradingWSParams = { assignmentid: assignId, acceptsubmissionstatement: acceptStatement, }; const warnings = await site.write<CoreWSExternalWarning[]>('mod_assign_submit_for_grading', params); if (warnings.length) { // The WebService returned warnings, reject. throw new CoreWSError(warnings[0]); } } /** * Submit the grading for the current user and assignment. It will use old or new WS depending on availability. * * @param assignId Assign ID. * @param userId User ID. * @param courseId Course ID the assign belongs to. * @param grade Grade to submit. * @param attemptNumber Number of the attempt being graded. * @param addAttempt Admit the user to attempt again. * @param workflowState Next workflow State. * @param applyToAll If it's a team submission, whether the grade applies to all group members. * @param outcomes Object including all outcomes values. If empty, any of them will be sent. * @param pluginData Feedback plugin data to save. * @param siteId Site ID. If not defined, current site. * @return Promise resolved with true if sent to server, resolved with false if stored offline. */ async submitGradingForm( assignId: number, userId: number, courseId: number, grade: number, attemptNumber: number, addAttempt: boolean, workflowState: string, applyToAll: boolean, outcomes: AddonModAssignOutcomes, pluginData: AddonModAssignSavePluginData, siteId?: string, ): Promise<boolean> { siteId = siteId || CoreSites.getCurrentSiteId(); // Function to store the grading to be synchronized later. const storeOffline = async (): Promise<boolean> => { await AddonModAssignOffline.submitGradingForm( assignId, userId, courseId, grade, attemptNumber, addAttempt, workflowState, applyToAll, outcomes, pluginData, siteId, ); return false; }; if (!CoreApp.isOnline()) { // App is offline, store the action. return storeOffline(); } try { // If there's already a grade to be sent to the server, discard it first. await AddonModAssignOffline.deleteSubmissionGrade(assignId, userId, siteId); await this.submitGradingFormOnline( assignId, userId, grade, attemptNumber, addAttempt, workflowState, applyToAll, outcomes, pluginData, siteId, ); return true; } catch (error) { if (error && !CoreUtils.isWebServiceError(error)) { // Couldn't connect to server, store in offline. return storeOffline(); } else { // The WebService has thrown an error, reject. throw error; } } } /** * Submit the grading for the current user and assignment. It will use old or new WS depending on availability. * It will fail if offline or cannot connect. * * @param assignId Assign ID. * @param userId User ID. * @param grade Grade to submit. * @param attemptNumber Number of the attempt being graded. * @param addAttempt Allow the user to attempt again. * @param workflowState Next workflow State. * @param applyToAll If it's a team submission, if the grade applies to all group members. * @param outcomes Object including all outcomes values. If empty, any of them will be sent. * @param pluginData Feedback plugin data to save. * @param siteId Site ID. If not defined, current site. * @return Promise resolved when submitted, rejected otherwise. */ async submitGradingFormOnline( assignId: number, userId: number, grade: number, attemptNumber: number, addAttempt: boolean, workflowState: string, applyToAll: boolean, outcomes: AddonModAssignOutcomes, pluginData: AddonModAssignSavePluginData, siteId?: string, ): Promise<void> { const site = await CoreSites.getSite(siteId); userId = userId || site.getUserId(); const jsonData = { grade, attemptnumber: attemptNumber, addattempt: addAttempt ? 1 : 0, workflowstate: workflowState, applytoall: applyToAll ? 1 : 0, }; for (const index in outcomes) { jsonData['outcome_' + index + '[' + userId + ']'] = outcomes[index]; } for (const index in pluginData) { jsonData[index] = pluginData[index]; } const serialized = CoreInterceptor.serialize(jsonData, true); const params: AddonModAssignSubmitGradingFormWSParams = { assignmentid: assignId, userid: userId, jsonformdata: JSON.stringify(serialized), }; const warnings = await site.write<CoreWSExternalWarning[]>('mod_assign_submit_grading_form', params); if (warnings.length) { // The WebService returned warnings, reject. throw new CoreWSError(warnings[0]); } } } export const AddonModAssign = makeSingleton(AddonModAssignProvider); /** * Options to pass to get submission status. */ export type AddonModAssignSubmissionStatusOptions = CoreCourseCommonModWSOptions & { userId?: number; // User Id (empty for current user). groupId?: number; // Group Id (empty for all participants). isBlind?: boolean; // If blind marking is enabled or not. filter?: boolean; // True to filter WS response and rewrite URLs, false otherwise. Defaults to true. }; /** * Assign data returned by mod_assign_get_assignments. */ export type AddonModAssignAssign = { id: number; // Assignment id. cmid: number; // Course module id. course: number; // Course id. name: string; // Assignment name. nosubmissions: number; // No submissions. submissiondrafts: number; // Submissions drafts. sendnotifications: number; // Send notifications. sendlatenotifications: number; // Send notifications. sendstudentnotifications: number; // Send student notifications (default). duedate: number; // Assignment due date. allowsubmissionsfromdate: number; // Allow submissions from date. grade: number; // Grade type. timemodified: number; // Last time assignment was modified. completionsubmit: number; // If enabled, set activity as complete following submission. cutoffdate: number; // Date after which submission is not accepted without an extension. gradingduedate?: number; // The expected date for marking the submissions. teamsubmission: number; // If enabled, students submit as a team. requireallteammemberssubmit: number; // If enabled, all team members must submit. teamsubmissiongroupingid: number; // The grouping id for the team submission groups. blindmarking: number; // If enabled, hide identities until reveal identities actioned. hidegrader?: number; // @since 3.7. If enabled, hide grader to student. revealidentities: number; // Show identities for a blind marking assignment. attemptreopenmethod: AddonModAssignAttemptReopenMethodValues; // Method used to control opening new attempts. maxattempts: number; // Maximum number of attempts allowed. markingworkflow: number; // Enable marking workflow. markingallocation: number; // Enable marking allocation. requiresubmissionstatement: number; // Student must accept submission statement. preventsubmissionnotingroup?: number; // Prevent submission not in group. submissionstatement?: string; // Submission statement formatted. submissionstatementformat?: number; // Submissionstatement format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN). configs: AddonModAssignConfig[]; // Configuration settings. intro?: string; // Assignment intro, not allways returned because it deppends on the activity configuration. introformat?: number; // Intro format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN). introfiles?: CoreWSExternalFile[]; introattachments?: CoreWSExternalFile[]; activity?: string; // @since 4.0. Description of activity. activityformat?: number; // @since 4.0. Format of activity. activityattachments?: CoreWSExternalFile[]; // @since 4.0. Files from activity field. timelimit?: number; // @since 4.0. Time limit to complete assigment. submissionattachments?: number; // @since 4.0. Flag to only show files during submission. }; /** * Config setting in an assign. */ export type AddonModAssignConfig = { id?: number; // Assign_plugin_config id. assignment?: number; // Assignment id. plugin: string; // Plugin. subtype: string; // Subtype. name: string; // Name. value: string; // Value. }; /** * Grade of an assign, returned by mod_assign_get_grades. */ export type AddonModAssignGrade = { id: number; // Grade id. assignment?: number; // Assignment id. userid: number; // Student id. attemptnumber: number; // Attempt number. timecreated: number; // Grade creation time. timemodified: number; // Grade last modified time. grader: number; // Grader, -1 if grader is hidden. grade: string; // Grade. gradefordisplay?: string; // Grade rendered into a format suitable for display. }; /** * Assign submission returned by mod_assign_get_submissions. */ export type AddonModAssignSubmission = { id: number; // Submission id. userid: number; // Student id. attemptnumber: number; // Attempt number. timecreated: number; // Submission creation time. timemodified: number; // Submission last modified time. status: AddonModAssignSubmissionStatusValues; // Submission status. groupid: number; // Group id. assignment?: number; // Assignment id. latest?: number; // Latest attempt. plugins?: AddonModAssignPlugin[]; // Plugins. gradingstatus?: AddonModAssignGradingStates; // Grading status. timestarted?: number; // @since 4.0. Submission start time. }; /** * Assign plugin. */ export type AddonModAssignPlugin = { type: string; // Submission plugin type. name: string; // Submission plugin name. fileareas?: { // Fileareas. area: string; // File area. files?: CoreWSExternalFile[]; }[]; editorfields?: { // Editorfields. name: string; // Field name. description: string; // Field description. text: string; // Field value. format: number; // Text format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN). }[]; }; /** * Grading summary of an assign submission. */ export type AddonModAssignSubmissionGradingSummary = { participantcount: number; // Number of users who can submit. submissiondraftscount: number; // Number of submissions in draft status. submissionsenabled: boolean; // Whether submissions are enabled or not. submissionssubmittedcount: number; // Number of submissions in submitted status. submissionsneedgradingcount: number; // Number of submissions that need grading. warnofungroupedusers: string | boolean; // Whether we need to warn people about groups. }; /** * Attempt of an assign submission. */ export type AddonModAssignSubmissionAttempt = { submission?: AddonModAssignSubmission; // Submission info. teamsubmission?: AddonModAssignSubmission; // Submission info. submissiongroup?: number; // The submission group id (for group submissions only). submissiongroupmemberswhoneedtosubmit?: number[]; // List of users who still need to submit (for group submissions only). submissionsenabled: boolean; // Whether submissions are enabled or not. locked: boolean; // Whether new submissions are locked. graded: boolean; // Whether the submission is graded. canedit: boolean; // Whether the user can edit the current submission. caneditowner?: boolean; // Whether the owner of the submission can edit it. cansubmit: boolean; // Whether the user can submit. extensionduedate: number; // Extension due date. blindmarking: boolean; // Whether blind marking is enabled. gradingstatus: AddonModAssignGradingStates; // Grading status. usergroups: number[]; // User groups in the course. timelimit?: number; // @since 4.0. Time limit for submission. }; /** * Previous attempt of an assign submission. */ export type AddonModAssignSubmissionPreviousAttempt = { attemptnumber: number; // Attempt number. submission?: AddonModAssignSubmission; // Submission info. grade?: AddonModAssignGrade; // Grade information. feedbackplugins?: AddonModAssignPlugin[]; // Feedback info. }; /** * Feedback of an assign submission. */ export type AddonModAssignSubmissionFeedback = { grade?: AddonModAssignGrade; // Grade information. gradefordisplay: string; // Grade rendered into a format suitable for display. gradeddate: number; // The date the user was graded. plugins?: AddonModAssignPlugin[]; // Plugins info. }; /** * Params of mod_assign_list_participants WS. */ type AddonModAssignListParticipantsWSParams = { assignid: number; // Assign instance id. groupid: number; // Group id. filter: string; // Search string to filter the results. skip?: number; // Number of records to skip. limit?: number; // Maximum number of records to return. onlyids?: boolean; // Do not return all user fields. includeenrolments?: boolean; // Do return courses where the user is enrolled. tablesort?: boolean; // Apply current user table sorting preferences. }; /** * Data returned by mod_assign_list_participants WS. */ type AddonModAssignListParticipantsWSResponse = AddonModAssignParticipant[]; /** * Participant returned by mod_assign_list_participants. */ export type AddonModAssignParticipant = { id: number; // ID of the user. username?: string; // The username. firstname?: string; // The first name(s) of the user. lastname?: string; // The family name of the user. fullname: string; // The fullname of the user. email?: string; // Email address. address?: string; // Postal address. phone1?: string; // Phone 1. phone2?: string; // Phone 2. icq?: string; // Icq number. skype?: string; // Skype id. yahoo?: string; // Yahoo id. aim?: string; // Aim id. msn?: string; // Msn number. department?: string; // Department. institution?: string; // Institution. idnumber?: string; // The idnumber of the user. interests?: string; // User interests (separated by commas). firstaccess?: number; // First access to the site (0 if never). lastaccess?: number; // Last access to the site (0 if never). suspended?: boolean; // Suspend user account, either false to enable user login or true to disable it. description?: string; // User profile description. descriptionformat?: number; // Int format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN). city?: string; // Home city of the user. url?: string; // URL of the user. country?: string; // Home country code of the user, such as AU or CZ. profileimageurlsmall?: string; // User image profile URL - small version. profileimageurl?: string; // User image profile URL - big version. customfields?: { // User custom fields (also known as user profile fields). type: string; // The type of the custom field - text field, checkbox... value: string; // The value of the custom field. name: string; // The name of the custom field. shortname: string; // The shortname of the custom field - to be able to build the field class in the code. }[]; preferences?: { // Users preferences. name: string; // The name of the preferences. value: string; // The value of the preference. }[]; recordid?: number; // @since 3.7. Record id. groups?: { // User groups. id: number; // Group id. name: string; // Group name. description: string; // Group description. }[]; roles?: { // User roles. roleid: number; // Role id. name: string; // Role name. shortname: string; // Role shortname. sortorder: number; // Role sortorder. }[]; enrolledcourses?: { // Courses where the user is enrolled - limited by which courses the user is able to see. id: number; // Id of the course. fullname: string; // Fullname of the course. shortname: string; // Shortname of the course. }[]; submitted: boolean; // Have they submitted their assignment. requiregrading: boolean; // Is their submission waiting for grading. grantedextension?: boolean; // Have they been granted an extension. groupid?: number; // For group assignments this is the group id. groupname?: string; // For group assignments this is the group name. }; /** * Result of WS mod_assign_get_assignments. */ export type AddonModAssignGetAssignmentsWSResponse = { courses: { // List of courses. id: number; // Course id. fullname: string; // Course full name. shortname: string; // Course short name. timemodified: number; // Last time modified. assignments: AddonModAssignAssign[]; // Assignment info. }[]; warnings?: CoreWSExternalWarning[]; }; /** * Params of mod_assign_get_submissions WS. */ type AddonModAssignGetSubmissionsWSParams = { assignmentids: number[]; // 1 or more assignment ids. status?: string; // Status. since?: number; // Submitted since. before?: number; // Submitted before. }; /** * Data returned by mod_assign_get_submissions WS. */ export type AddonModAssignGetSubmissionsWSResponse = { assignments: { // Assignment submissions. assignmentid: number; // Assignment id. submissions: AddonModAssignSubmission[]; }[]; warnings?: CoreWSExternalWarning[]; }; /** * Params of mod_assign_get_submission_status WS. */ type AddonModAssignGetSubmissionStatusWSParams = { assignid: number; // Assignment instance id. userid?: number; // User id (empty for current user). groupid?: number; // Filter by users in group (used for generating the grading summary). Empty or 0 for all groups information. }; /** * Result of WS mod_assign_get_submission_status. */ export type AddonModAssignGetSubmissionStatusWSResponse = { gradingsummary?: AddonModAssignSubmissionGradingSummary; // Grading information. lastattempt?: AddonModAssignSubmissionAttempt; // Last attempt information. feedback?: AddonModAssignSubmissionFeedback; // Feedback for the last attempt. previousattempts?: AddonModAssignSubmissionPreviousAttempt[]; // List all the previous attempts did by the user. assignmentdata?: { // @since 4.0. Extra information about assignment. attachments?: { // Intro and activity attachments. intro?: CoreWSExternalFile[]; // Intro attachments files. activity?: CoreWSExternalFile[]; // Activity attachments files. }; activity?: string; // Text of activity. activityformat?: number; // Format of activity. }; warnings?: CoreWSExternalWarning[]; }; /** * Params of mod_assign_view_submission_status WS. */ type AddonModAssignViewSubmissionStatusWSParams = { assignid: number; // Assign instance id. }; /** * Params of mod_assign_view_grading_table WS. */ type AddonModAssignViewGradingTableWSParams = { assignid: number; // Assign instance id. }; /** * Params of mod_assign_view_assign WS. */ type AddonModAssignViewAssignWSParams = { assignid: number; // Assign instance id. }; type AddonModAssignFixedSubmissionParams = { userId: number; groupId: number; isBlind: boolean; }; /** * Params of mod_assign_get_assignments WS. */ type AddonModAssignGetAssignmentsWSParams = { courseids?: number[]; // 0 or more course ids. capabilities?: string[]; // List of capabilities used to filter courses. includenotenrolledcourses?: boolean; // Whether to return courses that the user can see even if is not enroled in. // This requires the parameter courseids to not be empty. }; /** * Params of mod_assign_get_user_mappings WS. */ type AddonModAssignGetUserMappingsWSParams = { assignmentids: number[]; // 1 or more assignment ids. }; /** * Data returned by mod_assign_get_user_mappings WS. */ export type AddonModAssignGetUserMappingsWSResponse = { assignments: { // List of assign user mapping data. assignmentid: number; // Assignment id. mappings: { id: number; // User mapping id. userid: number; // Student id. }[]; }[]; warnings?: CoreWSExternalWarning[]; }; /** * Params of mod_assign_get_grades WS. */ type AddonModAssignGetGradesWSParams = { assignmentids: number[]; // 1 or more assignment ids. since?: number; // Timestamp, only return records where timemodified >= since. }; /** * Data returned by mod_assign_get_grades WS. */ export type AddonModAssignGetGradesWSResponse = { assignments: { // List of assignment grade information. assignmentid: number; // Assignment id. grades: AddonModAssignGrade[]; }[]; warnings?: CoreWSExternalWarning[]; }; /** * Params of mod_assign_save_submission WS. */ type AddonModAssignSaveSubmissionWSParams = { assignmentid: number; // The assignment id to operate on. plugindata: AddonModAssignSavePluginData; }; /** * All subplugins will decide what to add here. */ export type AddonModAssignSavePluginData = CoreFormFields; /** * Params of mod_assign_submit_for_grading WS. */ type AddonModAssignSubmitForGradingWSParams = { assignmentid: number; // The assignment id to operate on. acceptsubmissionstatement: boolean; // Accept the assignment submission statement. }; /** * Params of mod_assign_submit_grading_form WS. */ type AddonModAssignSubmitGradingFormWSParams = { assignmentid: number; // The assignment id to operate on. userid: number; // The user id the submission belongs to. jsonformdata: string; // The data from the grading form, encoded as a json array. }; /** * Params of mod_assign_start_submission WS. * * @since 4.0 */ type AddonModAssignStartSubmissionWSParams = { assignid: number; // Assignment instance id. }; /** * Data returned by mod_assign_start_submission WS. * * @since 4.0 */ export type AddonModAssignStartSubmissionWSResponse = { submissionid: number; // New submission ID. warnings?: CoreWSExternalWarning[]; }; /** * Assignment grade outcomes. */ export type AddonModAssignOutcomes = { [itemNumber: number]: number }; /** * Data sent by SUBMITTED_FOR_GRADING_EVENT event. */ export type AddonModAssignSubmittedForGradingEventData = { assignmentId: number; submissionId: number; userId: number; }; /** * Data sent by SUBMISSION_SAVED_EVENT event. */ export type AddonModAssignSubmissionSavedEventData = AddonModAssignSubmittedForGradingEventData; /** * Data sent by GRADED_EVENT event. */ export type AddonModAssignGradedEventData = AddonModAssignSubmittedForGradingEventData; /** * Data sent by STARTED_EVENT event. */ export type AddonModAssignStartedEventData = { assignmentId: number; }; /** * Submission status. * Constants on LMS starting with ASSIGN_SUBMISSION_STATUS_ */ export enum AddonModAssignSubmissionStatusValues { SUBMITTED = 'submitted', DRAFT = 'draft', NEW = 'new', REOPENED = 'reopened', // Added by App Statuses. NO_ATTEMPT = 'noattempt', NO_ONLINE_SUBMISSIONS = 'noonlinesubmissions', NO_SUBMISSION = 'nosubmission', GRADED_FOLLOWUP_SUBMIT = 'gradedfollowupsubmit', }; /** * Grading status. * Constants on LMS starting with ASSIGN_GRADING_STATUS_ */ export enum AddonModAssignGradingStates { GRADED = 'graded', NOT_GRADED = 'notgraded', // Added by App Statuses. MARKING_WORKFLOW_STATE_RELEASED = 'released', // with ASSIGN_MARKING_WORKFLOW_STATE_RELEASED GRADED_FOLLOWUP_SUBMIT = 'gradedfollowupsubmit', }; /** * Reopen attempt methods. * Constants on LMS starting with ASSIGN_ATTEMPT_REOPEN_METHOD_ */ export enum AddonModAssignAttemptReopenMethodValues { NONE = 'none', MANUAL = 'manual', UNTILPASS = 'untilpass', };
{ "content_hash": "1682482cbec7442600346f704321f5e3", "timestamp": "", "source": "github", "line_count": 1850, "max_line_length": 132, "avg_line_length": 36.55189189189189, "alnum_prop": 0.6474467990712944, "repo_name": "reskit/moodlemobile", "id": "d24c61664479fe74f07cc2d954d1d281ba5f59d7", "size": "67621", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/addons/mod/assign/services/assign.ts", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "23821" }, { "name": "Dockerfile", "bytes": "570" }, { "name": "Gherkin", "bytes": "3807" }, { "name": "HTML", "bytes": "991885" }, { "name": "Java", "bytes": "1782" }, { "name": "JavaScript", "bytes": "297730" }, { "name": "PHP", "bytes": "48657" }, { "name": "SCSS", "bytes": "274626" }, { "name": "Shell", "bytes": "18274" }, { "name": "TypeScript", "bytes": "9728367" } ], "symlink_target": "" }
 #pragma once #include <aws/lex-models/LexModelBuildingService_EXPORTS.h> #include <aws/lex-models/LexModelBuildingServiceErrors.h> #include <aws/core/client/AWSError.h> #include <aws/core/client/ClientConfiguration.h> #include <aws/core/client/AWSClient.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/lex-models/model/CreateBotVersionResult.h> #include <aws/lex-models/model/CreateIntentVersionResult.h> #include <aws/lex-models/model/CreateSlotTypeVersionResult.h> #include <aws/lex-models/model/GetBotResult.h> #include <aws/lex-models/model/GetBotAliasResult.h> #include <aws/lex-models/model/GetBotAliasesResult.h> #include <aws/lex-models/model/GetBotChannelAssociationResult.h> #include <aws/lex-models/model/GetBotChannelAssociationsResult.h> #include <aws/lex-models/model/GetBotVersionsResult.h> #include <aws/lex-models/model/GetBotsResult.h> #include <aws/lex-models/model/GetBuiltinIntentResult.h> #include <aws/lex-models/model/GetBuiltinIntentsResult.h> #include <aws/lex-models/model/GetBuiltinSlotTypesResult.h> #include <aws/lex-models/model/GetExportResult.h> #include <aws/lex-models/model/GetImportResult.h> #include <aws/lex-models/model/GetIntentResult.h> #include <aws/lex-models/model/GetIntentVersionsResult.h> #include <aws/lex-models/model/GetIntentsResult.h> #include <aws/lex-models/model/GetMigrationResult.h> #include <aws/lex-models/model/GetMigrationsResult.h> #include <aws/lex-models/model/GetSlotTypeResult.h> #include <aws/lex-models/model/GetSlotTypeVersionsResult.h> #include <aws/lex-models/model/GetSlotTypesResult.h> #include <aws/lex-models/model/GetUtterancesViewResult.h> #include <aws/lex-models/model/ListTagsForResourceResult.h> #include <aws/lex-models/model/PutBotResult.h> #include <aws/lex-models/model/PutBotAliasResult.h> #include <aws/lex-models/model/PutIntentResult.h> #include <aws/lex-models/model/PutSlotTypeResult.h> #include <aws/lex-models/model/StartImportResult.h> #include <aws/lex-models/model/StartMigrationResult.h> #include <aws/lex-models/model/TagResourceResult.h> #include <aws/lex-models/model/UntagResourceResult.h> #include <aws/core/NoResult.h> #include <aws/core/client/AsyncCallerContext.h> #include <aws/core/http/HttpTypes.h> #include <future> #include <functional> namespace Aws { namespace Http { class HttpClient; class HttpClientFactory; } // namespace Http namespace Utils { template< typename R, typename E> class Outcome; namespace Threading { class Executor; } // namespace Threading } // namespace Utils namespace Auth { class AWSCredentials; class AWSCredentialsProvider; } // namespace Auth namespace Client { class RetryStrategy; } // namespace Client namespace LexModelBuildingService { namespace Model { class CreateBotVersionRequest; class CreateIntentVersionRequest; class CreateSlotTypeVersionRequest; class DeleteBotRequest; class DeleteBotAliasRequest; class DeleteBotChannelAssociationRequest; class DeleteBotVersionRequest; class DeleteIntentRequest; class DeleteIntentVersionRequest; class DeleteSlotTypeRequest; class DeleteSlotTypeVersionRequest; class DeleteUtterancesRequest; class GetBotRequest; class GetBotAliasRequest; class GetBotAliasesRequest; class GetBotChannelAssociationRequest; class GetBotChannelAssociationsRequest; class GetBotVersionsRequest; class GetBotsRequest; class GetBuiltinIntentRequest; class GetBuiltinIntentsRequest; class GetBuiltinSlotTypesRequest; class GetExportRequest; class GetImportRequest; class GetIntentRequest; class GetIntentVersionsRequest; class GetIntentsRequest; class GetMigrationRequest; class GetMigrationsRequest; class GetSlotTypeRequest; class GetSlotTypeVersionsRequest; class GetSlotTypesRequest; class GetUtterancesViewRequest; class ListTagsForResourceRequest; class PutBotRequest; class PutBotAliasRequest; class PutIntentRequest; class PutSlotTypeRequest; class StartImportRequest; class StartMigrationRequest; class TagResourceRequest; class UntagResourceRequest; typedef Aws::Utils::Outcome<CreateBotVersionResult, LexModelBuildingServiceError> CreateBotVersionOutcome; typedef Aws::Utils::Outcome<CreateIntentVersionResult, LexModelBuildingServiceError> CreateIntentVersionOutcome; typedef Aws::Utils::Outcome<CreateSlotTypeVersionResult, LexModelBuildingServiceError> CreateSlotTypeVersionOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteBotOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteBotAliasOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteBotChannelAssociationOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteBotVersionOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteIntentOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteIntentVersionOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteSlotTypeOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteSlotTypeVersionOutcome; typedef Aws::Utils::Outcome<Aws::NoResult, LexModelBuildingServiceError> DeleteUtterancesOutcome; typedef Aws::Utils::Outcome<GetBotResult, LexModelBuildingServiceError> GetBotOutcome; typedef Aws::Utils::Outcome<GetBotAliasResult, LexModelBuildingServiceError> GetBotAliasOutcome; typedef Aws::Utils::Outcome<GetBotAliasesResult, LexModelBuildingServiceError> GetBotAliasesOutcome; typedef Aws::Utils::Outcome<GetBotChannelAssociationResult, LexModelBuildingServiceError> GetBotChannelAssociationOutcome; typedef Aws::Utils::Outcome<GetBotChannelAssociationsResult, LexModelBuildingServiceError> GetBotChannelAssociationsOutcome; typedef Aws::Utils::Outcome<GetBotVersionsResult, LexModelBuildingServiceError> GetBotVersionsOutcome; typedef Aws::Utils::Outcome<GetBotsResult, LexModelBuildingServiceError> GetBotsOutcome; typedef Aws::Utils::Outcome<GetBuiltinIntentResult, LexModelBuildingServiceError> GetBuiltinIntentOutcome; typedef Aws::Utils::Outcome<GetBuiltinIntentsResult, LexModelBuildingServiceError> GetBuiltinIntentsOutcome; typedef Aws::Utils::Outcome<GetBuiltinSlotTypesResult, LexModelBuildingServiceError> GetBuiltinSlotTypesOutcome; typedef Aws::Utils::Outcome<GetExportResult, LexModelBuildingServiceError> GetExportOutcome; typedef Aws::Utils::Outcome<GetImportResult, LexModelBuildingServiceError> GetImportOutcome; typedef Aws::Utils::Outcome<GetIntentResult, LexModelBuildingServiceError> GetIntentOutcome; typedef Aws::Utils::Outcome<GetIntentVersionsResult, LexModelBuildingServiceError> GetIntentVersionsOutcome; typedef Aws::Utils::Outcome<GetIntentsResult, LexModelBuildingServiceError> GetIntentsOutcome; typedef Aws::Utils::Outcome<GetMigrationResult, LexModelBuildingServiceError> GetMigrationOutcome; typedef Aws::Utils::Outcome<GetMigrationsResult, LexModelBuildingServiceError> GetMigrationsOutcome; typedef Aws::Utils::Outcome<GetSlotTypeResult, LexModelBuildingServiceError> GetSlotTypeOutcome; typedef Aws::Utils::Outcome<GetSlotTypeVersionsResult, LexModelBuildingServiceError> GetSlotTypeVersionsOutcome; typedef Aws::Utils::Outcome<GetSlotTypesResult, LexModelBuildingServiceError> GetSlotTypesOutcome; typedef Aws::Utils::Outcome<GetUtterancesViewResult, LexModelBuildingServiceError> GetUtterancesViewOutcome; typedef Aws::Utils::Outcome<ListTagsForResourceResult, LexModelBuildingServiceError> ListTagsForResourceOutcome; typedef Aws::Utils::Outcome<PutBotResult, LexModelBuildingServiceError> PutBotOutcome; typedef Aws::Utils::Outcome<PutBotAliasResult, LexModelBuildingServiceError> PutBotAliasOutcome; typedef Aws::Utils::Outcome<PutIntentResult, LexModelBuildingServiceError> PutIntentOutcome; typedef Aws::Utils::Outcome<PutSlotTypeResult, LexModelBuildingServiceError> PutSlotTypeOutcome; typedef Aws::Utils::Outcome<StartImportResult, LexModelBuildingServiceError> StartImportOutcome; typedef Aws::Utils::Outcome<StartMigrationResult, LexModelBuildingServiceError> StartMigrationOutcome; typedef Aws::Utils::Outcome<TagResourceResult, LexModelBuildingServiceError> TagResourceOutcome; typedef Aws::Utils::Outcome<UntagResourceResult, LexModelBuildingServiceError> UntagResourceOutcome; typedef std::future<CreateBotVersionOutcome> CreateBotVersionOutcomeCallable; typedef std::future<CreateIntentVersionOutcome> CreateIntentVersionOutcomeCallable; typedef std::future<CreateSlotTypeVersionOutcome> CreateSlotTypeVersionOutcomeCallable; typedef std::future<DeleteBotOutcome> DeleteBotOutcomeCallable; typedef std::future<DeleteBotAliasOutcome> DeleteBotAliasOutcomeCallable; typedef std::future<DeleteBotChannelAssociationOutcome> DeleteBotChannelAssociationOutcomeCallable; typedef std::future<DeleteBotVersionOutcome> DeleteBotVersionOutcomeCallable; typedef std::future<DeleteIntentOutcome> DeleteIntentOutcomeCallable; typedef std::future<DeleteIntentVersionOutcome> DeleteIntentVersionOutcomeCallable; typedef std::future<DeleteSlotTypeOutcome> DeleteSlotTypeOutcomeCallable; typedef std::future<DeleteSlotTypeVersionOutcome> DeleteSlotTypeVersionOutcomeCallable; typedef std::future<DeleteUtterancesOutcome> DeleteUtterancesOutcomeCallable; typedef std::future<GetBotOutcome> GetBotOutcomeCallable; typedef std::future<GetBotAliasOutcome> GetBotAliasOutcomeCallable; typedef std::future<GetBotAliasesOutcome> GetBotAliasesOutcomeCallable; typedef std::future<GetBotChannelAssociationOutcome> GetBotChannelAssociationOutcomeCallable; typedef std::future<GetBotChannelAssociationsOutcome> GetBotChannelAssociationsOutcomeCallable; typedef std::future<GetBotVersionsOutcome> GetBotVersionsOutcomeCallable; typedef std::future<GetBotsOutcome> GetBotsOutcomeCallable; typedef std::future<GetBuiltinIntentOutcome> GetBuiltinIntentOutcomeCallable; typedef std::future<GetBuiltinIntentsOutcome> GetBuiltinIntentsOutcomeCallable; typedef std::future<GetBuiltinSlotTypesOutcome> GetBuiltinSlotTypesOutcomeCallable; typedef std::future<GetExportOutcome> GetExportOutcomeCallable; typedef std::future<GetImportOutcome> GetImportOutcomeCallable; typedef std::future<GetIntentOutcome> GetIntentOutcomeCallable; typedef std::future<GetIntentVersionsOutcome> GetIntentVersionsOutcomeCallable; typedef std::future<GetIntentsOutcome> GetIntentsOutcomeCallable; typedef std::future<GetMigrationOutcome> GetMigrationOutcomeCallable; typedef std::future<GetMigrationsOutcome> GetMigrationsOutcomeCallable; typedef std::future<GetSlotTypeOutcome> GetSlotTypeOutcomeCallable; typedef std::future<GetSlotTypeVersionsOutcome> GetSlotTypeVersionsOutcomeCallable; typedef std::future<GetSlotTypesOutcome> GetSlotTypesOutcomeCallable; typedef std::future<GetUtterancesViewOutcome> GetUtterancesViewOutcomeCallable; typedef std::future<ListTagsForResourceOutcome> ListTagsForResourceOutcomeCallable; typedef std::future<PutBotOutcome> PutBotOutcomeCallable; typedef std::future<PutBotAliasOutcome> PutBotAliasOutcomeCallable; typedef std::future<PutIntentOutcome> PutIntentOutcomeCallable; typedef std::future<PutSlotTypeOutcome> PutSlotTypeOutcomeCallable; typedef std::future<StartImportOutcome> StartImportOutcomeCallable; typedef std::future<StartMigrationOutcome> StartMigrationOutcomeCallable; typedef std::future<TagResourceOutcome> TagResourceOutcomeCallable; typedef std::future<UntagResourceOutcome> UntagResourceOutcomeCallable; } // namespace Model class LexModelBuildingServiceClient; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::CreateBotVersionRequest&, const Model::CreateBotVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateBotVersionResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::CreateIntentVersionRequest&, const Model::CreateIntentVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateIntentVersionResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::CreateSlotTypeVersionRequest&, const Model::CreateSlotTypeVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > CreateSlotTypeVersionResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteBotRequest&, const Model::DeleteBotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBotResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteBotAliasRequest&, const Model::DeleteBotAliasOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBotAliasResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteBotChannelAssociationRequest&, const Model::DeleteBotChannelAssociationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBotChannelAssociationResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteBotVersionRequest&, const Model::DeleteBotVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteBotVersionResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteIntentRequest&, const Model::DeleteIntentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteIntentResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteIntentVersionRequest&, const Model::DeleteIntentVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteIntentVersionResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteSlotTypeRequest&, const Model::DeleteSlotTypeOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteSlotTypeResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteSlotTypeVersionRequest&, const Model::DeleteSlotTypeVersionOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteSlotTypeVersionResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::DeleteUtterancesRequest&, const Model::DeleteUtterancesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > DeleteUtterancesResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBotRequest&, const Model::GetBotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBotResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBotAliasRequest&, const Model::GetBotAliasOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBotAliasResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBotAliasesRequest&, const Model::GetBotAliasesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBotAliasesResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBotChannelAssociationRequest&, const Model::GetBotChannelAssociationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBotChannelAssociationResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBotChannelAssociationsRequest&, const Model::GetBotChannelAssociationsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBotChannelAssociationsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBotVersionsRequest&, const Model::GetBotVersionsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBotVersionsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBotsRequest&, const Model::GetBotsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBotsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBuiltinIntentRequest&, const Model::GetBuiltinIntentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBuiltinIntentResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBuiltinIntentsRequest&, const Model::GetBuiltinIntentsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBuiltinIntentsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetBuiltinSlotTypesRequest&, const Model::GetBuiltinSlotTypesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetBuiltinSlotTypesResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetExportRequest&, const Model::GetExportOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetExportResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetImportRequest&, const Model::GetImportOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetImportResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetIntentRequest&, const Model::GetIntentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetIntentResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetIntentVersionsRequest&, const Model::GetIntentVersionsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetIntentVersionsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetIntentsRequest&, const Model::GetIntentsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetIntentsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetMigrationRequest&, const Model::GetMigrationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetMigrationResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetMigrationsRequest&, const Model::GetMigrationsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetMigrationsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetSlotTypeRequest&, const Model::GetSlotTypeOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetSlotTypeResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetSlotTypeVersionsRequest&, const Model::GetSlotTypeVersionsOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetSlotTypeVersionsResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetSlotTypesRequest&, const Model::GetSlotTypesOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetSlotTypesResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::GetUtterancesViewRequest&, const Model::GetUtterancesViewOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > GetUtterancesViewResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::ListTagsForResourceRequest&, const Model::ListTagsForResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > ListTagsForResourceResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::PutBotRequest&, const Model::PutBotOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutBotResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::PutBotAliasRequest&, const Model::PutBotAliasOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutBotAliasResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::PutIntentRequest&, const Model::PutIntentOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutIntentResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::PutSlotTypeRequest&, const Model::PutSlotTypeOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > PutSlotTypeResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::StartImportRequest&, const Model::StartImportOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartImportResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::StartMigrationRequest&, const Model::StartMigrationOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > StartMigrationResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::TagResourceRequest&, const Model::TagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > TagResourceResponseReceivedHandler; typedef std::function<void(const LexModelBuildingServiceClient*, const Model::UntagResourceRequest&, const Model::UntagResourceOutcome&, const std::shared_ptr<const Aws::Client::AsyncCallerContext>&) > UntagResourceResponseReceivedHandler; /** * <fullname>Amazon Lex Build-Time Actions</fullname> <p> Amazon Lex is an AWS * service for building conversational voice and text interfaces. Use these actions * to create, update, and delete conversational bots for new and existing client * applications. </p> */ class AWS_LEXMODELBUILDINGSERVICE_API LexModelBuildingServiceClient : public Aws::Client::AWSJsonClient { public: typedef Aws::Client::AWSJsonClient BASECLASS; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ LexModelBuildingServiceClient(const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ LexModelBuildingServiceClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ LexModelBuildingServiceClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration = Aws::Client::ClientConfiguration()); virtual ~LexModelBuildingServiceClient(); /** * <p>Creates a new version of the bot based on the <code>$LATEST</code> version. * If the <code>$LATEST</code> version of this resource hasn't changed since you * created the last version, Amazon Lex doesn't create a new version. It returns * the last created version.</p> <p>You can update only the * <code>$LATEST</code> version of the bot. You can't update the numbered versions * that you create with the <code>CreateBotVersion</code> operation.</p> * <p> When you create the first version of a bot, Amazon Lex sets the version to * 1. Subsequent versions increment by 1. For more information, see * <a>versioning-intro</a>. </p> <p> This operation requires permission for the * <code>lex:CreateBotVersion</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateBotVersion">AWS * API Reference</a></p> */ virtual Model::CreateBotVersionOutcome CreateBotVersion(const Model::CreateBotVersionRequest& request) const; /** * <p>Creates a new version of the bot based on the <code>$LATEST</code> version. * If the <code>$LATEST</code> version of this resource hasn't changed since you * created the last version, Amazon Lex doesn't create a new version. It returns * the last created version.</p> <p>You can update only the * <code>$LATEST</code> version of the bot. You can't update the numbered versions * that you create with the <code>CreateBotVersion</code> operation.</p> * <p> When you create the first version of a bot, Amazon Lex sets the version to * 1. Subsequent versions increment by 1. For more information, see * <a>versioning-intro</a>. </p> <p> This operation requires permission for the * <code>lex:CreateBotVersion</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateBotVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateBotVersionOutcomeCallable CreateBotVersionCallable(const Model::CreateBotVersionRequest& request) const; /** * <p>Creates a new version of the bot based on the <code>$LATEST</code> version. * If the <code>$LATEST</code> version of this resource hasn't changed since you * created the last version, Amazon Lex doesn't create a new version. It returns * the last created version.</p> <p>You can update only the * <code>$LATEST</code> version of the bot. You can't update the numbered versions * that you create with the <code>CreateBotVersion</code> operation.</p> * <p> When you create the first version of a bot, Amazon Lex sets the version to * 1. Subsequent versions increment by 1. For more information, see * <a>versioning-intro</a>. </p> <p> This operation requires permission for the * <code>lex:CreateBotVersion</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateBotVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateBotVersionAsync(const Model::CreateBotVersionRequest& request, const CreateBotVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a new version of an intent based on the <code>$LATEST</code> version * of the intent. If the <code>$LATEST</code> version of this intent hasn't changed * since you last updated it, Amazon Lex doesn't create a new version. It returns * the last version you created.</p> <p>You can update only the * <code>$LATEST</code> version of the intent. You can't update the numbered * versions that you create with the <code>CreateIntentVersion</code> * operation.</p> <p> When you create a version of an intent, Amazon Lex * sets the version to 1. Subsequent versions increment by 1. For more information, * see <a>versioning-intro</a>. </p> <p>This operation requires permissions to * perform the <code>lex:CreateIntentVersion</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateIntentVersion">AWS * API Reference</a></p> */ virtual Model::CreateIntentVersionOutcome CreateIntentVersion(const Model::CreateIntentVersionRequest& request) const; /** * <p>Creates a new version of an intent based on the <code>$LATEST</code> version * of the intent. If the <code>$LATEST</code> version of this intent hasn't changed * since you last updated it, Amazon Lex doesn't create a new version. It returns * the last version you created.</p> <p>You can update only the * <code>$LATEST</code> version of the intent. You can't update the numbered * versions that you create with the <code>CreateIntentVersion</code> * operation.</p> <p> When you create a version of an intent, Amazon Lex * sets the version to 1. Subsequent versions increment by 1. For more information, * see <a>versioning-intro</a>. </p> <p>This operation requires permissions to * perform the <code>lex:CreateIntentVersion</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateIntentVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateIntentVersionOutcomeCallable CreateIntentVersionCallable(const Model::CreateIntentVersionRequest& request) const; /** * <p>Creates a new version of an intent based on the <code>$LATEST</code> version * of the intent. If the <code>$LATEST</code> version of this intent hasn't changed * since you last updated it, Amazon Lex doesn't create a new version. It returns * the last version you created.</p> <p>You can update only the * <code>$LATEST</code> version of the intent. You can't update the numbered * versions that you create with the <code>CreateIntentVersion</code> * operation.</p> <p> When you create a version of an intent, Amazon Lex * sets the version to 1. Subsequent versions increment by 1. For more information, * see <a>versioning-intro</a>. </p> <p>This operation requires permissions to * perform the <code>lex:CreateIntentVersion</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateIntentVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateIntentVersionAsync(const Model::CreateIntentVersionRequest& request, const CreateIntentVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a new version of a slot type based on the <code>$LATEST</code> * version of the specified slot type. If the <code>$LATEST</code> version of this * resource has not changed since the last version that you created, Amazon Lex * doesn't create a new version. It returns the last version that you created. </p> * <p>You can update only the <code>$LATEST</code> version of a slot type. * You can't update the numbered versions that you create with the * <code>CreateSlotTypeVersion</code> operation.</p> <p>When you create a * version of a slot type, Amazon Lex sets the version to 1. Subsequent versions * increment by 1. For more information, see <a>versioning-intro</a>. </p> <p>This * operation requires permissions for the <code>lex:CreateSlotTypeVersion</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateSlotTypeVersion">AWS * API Reference</a></p> */ virtual Model::CreateSlotTypeVersionOutcome CreateSlotTypeVersion(const Model::CreateSlotTypeVersionRequest& request) const; /** * <p>Creates a new version of a slot type based on the <code>$LATEST</code> * version of the specified slot type. If the <code>$LATEST</code> version of this * resource has not changed since the last version that you created, Amazon Lex * doesn't create a new version. It returns the last version that you created. </p> * <p>You can update only the <code>$LATEST</code> version of a slot type. * You can't update the numbered versions that you create with the * <code>CreateSlotTypeVersion</code> operation.</p> <p>When you create a * version of a slot type, Amazon Lex sets the version to 1. Subsequent versions * increment by 1. For more information, see <a>versioning-intro</a>. </p> <p>This * operation requires permissions for the <code>lex:CreateSlotTypeVersion</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateSlotTypeVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::CreateSlotTypeVersionOutcomeCallable CreateSlotTypeVersionCallable(const Model::CreateSlotTypeVersionRequest& request) const; /** * <p>Creates a new version of a slot type based on the <code>$LATEST</code> * version of the specified slot type. If the <code>$LATEST</code> version of this * resource has not changed since the last version that you created, Amazon Lex * doesn't create a new version. It returns the last version that you created. </p> * <p>You can update only the <code>$LATEST</code> version of a slot type. * You can't update the numbered versions that you create with the * <code>CreateSlotTypeVersion</code> operation.</p> <p>When you create a * version of a slot type, Amazon Lex sets the version to 1. Subsequent versions * increment by 1. For more information, see <a>versioning-intro</a>. </p> <p>This * operation requires permissions for the <code>lex:CreateSlotTypeVersion</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/CreateSlotTypeVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void CreateSlotTypeVersionAsync(const Model::CreateSlotTypeVersionRequest& request, const CreateSlotTypeVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes all versions of the bot, including the <code>$LATEST</code> version. * To delete a specific version of the bot, use the <a>DeleteBotVersion</a> * operation. The <code>DeleteBot</code> operation doesn't immediately remove the * bot schema. Instead, it is marked for deletion and removed later.</p> <p>Amazon * Lex stores utterances indefinitely for improving the ability of your bot to * respond to user inputs. These utterances are not removed when the bot is * deleted. To remove the utterances, use the <a>DeleteUtterances</a> * operation.</p> <p>If a bot has an alias, you can't delete it. Instead, the * <code>DeleteBot</code> operation returns a <code>ResourceInUseException</code> * exception that includes a reference to the alias that refers to the bot. To * remove the reference to the bot, delete the alias. If you get the same exception * again, delete the referring alias until the <code>DeleteBot</code> operation is * successful.</p> <p>This operation requires permissions for the * <code>lex:DeleteBot</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBot">AWS * API Reference</a></p> */ virtual Model::DeleteBotOutcome DeleteBot(const Model::DeleteBotRequest& request) const; /** * <p>Deletes all versions of the bot, including the <code>$LATEST</code> version. * To delete a specific version of the bot, use the <a>DeleteBotVersion</a> * operation. The <code>DeleteBot</code> operation doesn't immediately remove the * bot schema. Instead, it is marked for deletion and removed later.</p> <p>Amazon * Lex stores utterances indefinitely for improving the ability of your bot to * respond to user inputs. These utterances are not removed when the bot is * deleted. To remove the utterances, use the <a>DeleteUtterances</a> * operation.</p> <p>If a bot has an alias, you can't delete it. Instead, the * <code>DeleteBot</code> operation returns a <code>ResourceInUseException</code> * exception that includes a reference to the alias that refers to the bot. To * remove the reference to the bot, delete the alias. If you get the same exception * again, delete the referring alias until the <code>DeleteBot</code> operation is * successful.</p> <p>This operation requires permissions for the * <code>lex:DeleteBot</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteBotOutcomeCallable DeleteBotCallable(const Model::DeleteBotRequest& request) const; /** * <p>Deletes all versions of the bot, including the <code>$LATEST</code> version. * To delete a specific version of the bot, use the <a>DeleteBotVersion</a> * operation. The <code>DeleteBot</code> operation doesn't immediately remove the * bot schema. Instead, it is marked for deletion and removed later.</p> <p>Amazon * Lex stores utterances indefinitely for improving the ability of your bot to * respond to user inputs. These utterances are not removed when the bot is * deleted. To remove the utterances, use the <a>DeleteUtterances</a> * operation.</p> <p>If a bot has an alias, you can't delete it. Instead, the * <code>DeleteBot</code> operation returns a <code>ResourceInUseException</code> * exception that includes a reference to the alias that refers to the bot. To * remove the reference to the bot, delete the alias. If you get the same exception * again, delete the referring alias until the <code>DeleteBot</code> operation is * successful.</p> <p>This operation requires permissions for the * <code>lex:DeleteBot</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteBotAsync(const Model::DeleteBotRequest& request, const DeleteBotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes an alias for the specified bot. </p> <p>You can't delete an alias * that is used in the association between a bot and a messaging channel. If an * alias is used in a channel association, the <code>DeleteBot</code> operation * returns a <code>ResourceInUseException</code> exception that includes a * reference to the channel association that refers to the bot. You can remove the * reference to the alias by deleting the channel association. If you get the same * exception again, delete the referring association until the * <code>DeleteBotAlias</code> operation is successful.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotAlias">AWS * API Reference</a></p> */ virtual Model::DeleteBotAliasOutcome DeleteBotAlias(const Model::DeleteBotAliasRequest& request) const; /** * <p>Deletes an alias for the specified bot. </p> <p>You can't delete an alias * that is used in the association between a bot and a messaging channel. If an * alias is used in a channel association, the <code>DeleteBot</code> operation * returns a <code>ResourceInUseException</code> exception that includes a * reference to the channel association that refers to the bot. You can remove the * reference to the alias by deleting the channel association. If you get the same * exception again, delete the referring association until the * <code>DeleteBotAlias</code> operation is successful.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotAlias">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteBotAliasOutcomeCallable DeleteBotAliasCallable(const Model::DeleteBotAliasRequest& request) const; /** * <p>Deletes an alias for the specified bot. </p> <p>You can't delete an alias * that is used in the association between a bot and a messaging channel. If an * alias is used in a channel association, the <code>DeleteBot</code> operation * returns a <code>ResourceInUseException</code> exception that includes a * reference to the channel association that refers to the bot. You can remove the * reference to the alias by deleting the channel association. If you get the same * exception again, delete the referring association until the * <code>DeleteBotAlias</code> operation is successful.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotAlias">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteBotAliasAsync(const Model::DeleteBotAliasRequest& request, const DeleteBotAliasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes the association between an Amazon Lex bot and a messaging * platform.</p> <p>This operation requires permission for the * <code>lex:DeleteBotChannelAssociation</code> action.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotChannelAssociation">AWS * API Reference</a></p> */ virtual Model::DeleteBotChannelAssociationOutcome DeleteBotChannelAssociation(const Model::DeleteBotChannelAssociationRequest& request) const; /** * <p>Deletes the association between an Amazon Lex bot and a messaging * platform.</p> <p>This operation requires permission for the * <code>lex:DeleteBotChannelAssociation</code> action.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotChannelAssociation">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteBotChannelAssociationOutcomeCallable DeleteBotChannelAssociationCallable(const Model::DeleteBotChannelAssociationRequest& request) const; /** * <p>Deletes the association between an Amazon Lex bot and a messaging * platform.</p> <p>This operation requires permission for the * <code>lex:DeleteBotChannelAssociation</code> action.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotChannelAssociation">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteBotChannelAssociationAsync(const Model::DeleteBotChannelAssociationRequest& request, const DeleteBotChannelAssociationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a specific version of a bot. To delete all versions of a bot, use the * <a>DeleteBot</a> operation. </p> <p>This operation requires permissions for the * <code>lex:DeleteBotVersion</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotVersion">AWS * API Reference</a></p> */ virtual Model::DeleteBotVersionOutcome DeleteBotVersion(const Model::DeleteBotVersionRequest& request) const; /** * <p>Deletes a specific version of a bot. To delete all versions of a bot, use the * <a>DeleteBot</a> operation. </p> <p>This operation requires permissions for the * <code>lex:DeleteBotVersion</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteBotVersionOutcomeCallable DeleteBotVersionCallable(const Model::DeleteBotVersionRequest& request) const; /** * <p>Deletes a specific version of a bot. To delete all versions of a bot, use the * <a>DeleteBot</a> operation. </p> <p>This operation requires permissions for the * <code>lex:DeleteBotVersion</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteBotVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteBotVersionAsync(const Model::DeleteBotVersionRequest& request, const DeleteBotVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes all versions of the intent, including the <code>$LATEST</code> * version. To delete a specific version of the intent, use the * <a>DeleteIntentVersion</a> operation.</p> <p> You can delete a version of an * intent only if it is not referenced. To delete an intent that is referred to in * one or more bots (see <a>how-it-works</a>), you must remove those references * first. </p> <p> If you get the <code>ResourceInUseException</code> * exception, it provides an example reference that shows where the intent is * referenced. To remove the reference to the intent, either update the bot or * delete it. If you get the same exception when you attempt to delete the intent * again, repeat until the intent has no references and the call to * <code>DeleteIntent</code> is successful. </p> <p> This operation * requires permission for the <code>lex:DeleteIntent</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteIntent">AWS * API Reference</a></p> */ virtual Model::DeleteIntentOutcome DeleteIntent(const Model::DeleteIntentRequest& request) const; /** * <p>Deletes all versions of the intent, including the <code>$LATEST</code> * version. To delete a specific version of the intent, use the * <a>DeleteIntentVersion</a> operation.</p> <p> You can delete a version of an * intent only if it is not referenced. To delete an intent that is referred to in * one or more bots (see <a>how-it-works</a>), you must remove those references * first. </p> <p> If you get the <code>ResourceInUseException</code> * exception, it provides an example reference that shows where the intent is * referenced. To remove the reference to the intent, either update the bot or * delete it. If you get the same exception when you attempt to delete the intent * again, repeat until the intent has no references and the call to * <code>DeleteIntent</code> is successful. </p> <p> This operation * requires permission for the <code>lex:DeleteIntent</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteIntent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteIntentOutcomeCallable DeleteIntentCallable(const Model::DeleteIntentRequest& request) const; /** * <p>Deletes all versions of the intent, including the <code>$LATEST</code> * version. To delete a specific version of the intent, use the * <a>DeleteIntentVersion</a> operation.</p> <p> You can delete a version of an * intent only if it is not referenced. To delete an intent that is referred to in * one or more bots (see <a>how-it-works</a>), you must remove those references * first. </p> <p> If you get the <code>ResourceInUseException</code> * exception, it provides an example reference that shows where the intent is * referenced. To remove the reference to the intent, either update the bot or * delete it. If you get the same exception when you attempt to delete the intent * again, repeat until the intent has no references and the call to * <code>DeleteIntent</code> is successful. </p> <p> This operation * requires permission for the <code>lex:DeleteIntent</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteIntent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteIntentAsync(const Model::DeleteIntentRequest& request, const DeleteIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a specific version of an intent. To delete all versions of a intent, * use the <a>DeleteIntent</a> operation. </p> <p>This operation requires * permissions for the <code>lex:DeleteIntentVersion</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteIntentVersion">AWS * API Reference</a></p> */ virtual Model::DeleteIntentVersionOutcome DeleteIntentVersion(const Model::DeleteIntentVersionRequest& request) const; /** * <p>Deletes a specific version of an intent. To delete all versions of a intent, * use the <a>DeleteIntent</a> operation. </p> <p>This operation requires * permissions for the <code>lex:DeleteIntentVersion</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteIntentVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteIntentVersionOutcomeCallable DeleteIntentVersionCallable(const Model::DeleteIntentVersionRequest& request) const; /** * <p>Deletes a specific version of an intent. To delete all versions of a intent, * use the <a>DeleteIntent</a> operation. </p> <p>This operation requires * permissions for the <code>lex:DeleteIntentVersion</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteIntentVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteIntentVersionAsync(const Model::DeleteIntentVersionRequest& request, const DeleteIntentVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes all versions of the slot type, including the <code>$LATEST</code> * version. To delete a specific version of the slot type, use the * <a>DeleteSlotTypeVersion</a> operation.</p> <p> You can delete a version of a * slot type only if it is not referenced. To delete a slot type that is referred * to in one or more intents, you must remove those references first. </p> * <p> If you get the <code>ResourceInUseException</code> exception, the exception * provides an example reference that shows the intent where the slot type is * referenced. To remove the reference to the slot type, either update the intent * or delete it. If you get the same exception when you attempt to delete the slot * type again, repeat until the slot type has no references and the * <code>DeleteSlotType</code> call is successful. </p> <p>This operation * requires permission for the <code>lex:DeleteSlotType</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteSlotType">AWS * API Reference</a></p> */ virtual Model::DeleteSlotTypeOutcome DeleteSlotType(const Model::DeleteSlotTypeRequest& request) const; /** * <p>Deletes all versions of the slot type, including the <code>$LATEST</code> * version. To delete a specific version of the slot type, use the * <a>DeleteSlotTypeVersion</a> operation.</p> <p> You can delete a version of a * slot type only if it is not referenced. To delete a slot type that is referred * to in one or more intents, you must remove those references first. </p> * <p> If you get the <code>ResourceInUseException</code> exception, the exception * provides an example reference that shows the intent where the slot type is * referenced. To remove the reference to the slot type, either update the intent * or delete it. If you get the same exception when you attempt to delete the slot * type again, repeat until the slot type has no references and the * <code>DeleteSlotType</code> call is successful. </p> <p>This operation * requires permission for the <code>lex:DeleteSlotType</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteSlotType">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteSlotTypeOutcomeCallable DeleteSlotTypeCallable(const Model::DeleteSlotTypeRequest& request) const; /** * <p>Deletes all versions of the slot type, including the <code>$LATEST</code> * version. To delete a specific version of the slot type, use the * <a>DeleteSlotTypeVersion</a> operation.</p> <p> You can delete a version of a * slot type only if it is not referenced. To delete a slot type that is referred * to in one or more intents, you must remove those references first. </p> * <p> If you get the <code>ResourceInUseException</code> exception, the exception * provides an example reference that shows the intent where the slot type is * referenced. To remove the reference to the slot type, either update the intent * or delete it. If you get the same exception when you attempt to delete the slot * type again, repeat until the slot type has no references and the * <code>DeleteSlotType</code> call is successful. </p> <p>This operation * requires permission for the <code>lex:DeleteSlotType</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteSlotType">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteSlotTypeAsync(const Model::DeleteSlotTypeRequest& request, const DeleteSlotTypeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes a specific version of a slot type. To delete all versions of a slot * type, use the <a>DeleteSlotType</a> operation. </p> <p>This operation requires * permissions for the <code>lex:DeleteSlotTypeVersion</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteSlotTypeVersion">AWS * API Reference</a></p> */ virtual Model::DeleteSlotTypeVersionOutcome DeleteSlotTypeVersion(const Model::DeleteSlotTypeVersionRequest& request) const; /** * <p>Deletes a specific version of a slot type. To delete all versions of a slot * type, use the <a>DeleteSlotType</a> operation. </p> <p>This operation requires * permissions for the <code>lex:DeleteSlotTypeVersion</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteSlotTypeVersion">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteSlotTypeVersionOutcomeCallable DeleteSlotTypeVersionCallable(const Model::DeleteSlotTypeVersionRequest& request) const; /** * <p>Deletes a specific version of a slot type. To delete all versions of a slot * type, use the <a>DeleteSlotType</a> operation. </p> <p>This operation requires * permissions for the <code>lex:DeleteSlotTypeVersion</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteSlotTypeVersion">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteSlotTypeVersionAsync(const Model::DeleteSlotTypeVersionRequest& request, const DeleteSlotTypeVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Deletes stored utterances.</p> <p>Amazon Lex stores the utterances that users * send to your bot. Utterances are stored for 15 days for use with the * <a>GetUtterancesView</a> operation, and then stored indefinitely for use in * improving the ability of your bot to respond to user input.</p> <p>Use the * <code>DeleteUtterances</code> operation to manually delete stored utterances for * a specific user. When you use the <code>DeleteUtterances</code> operation, * utterances stored for improving your bot's ability to respond to user input are * deleted immediately. Utterances stored for use with the * <code>GetUtterancesView</code> operation are deleted after 15 days.</p> <p>This * operation requires permissions for the <code>lex:DeleteUtterances</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteUtterances">AWS * API Reference</a></p> */ virtual Model::DeleteUtterancesOutcome DeleteUtterances(const Model::DeleteUtterancesRequest& request) const; /** * <p>Deletes stored utterances.</p> <p>Amazon Lex stores the utterances that users * send to your bot. Utterances are stored for 15 days for use with the * <a>GetUtterancesView</a> operation, and then stored indefinitely for use in * improving the ability of your bot to respond to user input.</p> <p>Use the * <code>DeleteUtterances</code> operation to manually delete stored utterances for * a specific user. When you use the <code>DeleteUtterances</code> operation, * utterances stored for improving your bot's ability to respond to user input are * deleted immediately. Utterances stored for use with the * <code>GetUtterancesView</code> operation are deleted after 15 days.</p> <p>This * operation requires permissions for the <code>lex:DeleteUtterances</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteUtterances">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::DeleteUtterancesOutcomeCallable DeleteUtterancesCallable(const Model::DeleteUtterancesRequest& request) const; /** * <p>Deletes stored utterances.</p> <p>Amazon Lex stores the utterances that users * send to your bot. Utterances are stored for 15 days for use with the * <a>GetUtterancesView</a> operation, and then stored indefinitely for use in * improving the ability of your bot to respond to user input.</p> <p>Use the * <code>DeleteUtterances</code> operation to manually delete stored utterances for * a specific user. When you use the <code>DeleteUtterances</code> operation, * utterances stored for improving your bot's ability to respond to user input are * deleted immediately. Utterances stored for use with the * <code>GetUtterancesView</code> operation are deleted after 15 days.</p> <p>This * operation requires permissions for the <code>lex:DeleteUtterances</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/DeleteUtterances">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void DeleteUtterancesAsync(const Model::DeleteUtterancesRequest& request, const DeleteUtterancesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns metadata information for a specific bot. You must provide the bot * name and the bot version or alias. </p> <p> This operation requires permissions * for the <code>lex:GetBot</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBot">AWS * API Reference</a></p> */ virtual Model::GetBotOutcome GetBot(const Model::GetBotRequest& request) const; /** * <p>Returns metadata information for a specific bot. You must provide the bot * name and the bot version or alias. </p> <p> This operation requires permissions * for the <code>lex:GetBot</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBotOutcomeCallable GetBotCallable(const Model::GetBotRequest& request) const; /** * <p>Returns metadata information for a specific bot. You must provide the bot * name and the bot version or alias. </p> <p> This operation requires permissions * for the <code>lex:GetBot</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBotAsync(const Model::GetBotRequest& request, const GetBotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns information about an Amazon Lex bot alias. For more information about * aliases, see <a>versioning-aliases</a>.</p> <p>This operation requires * permissions for the <code>lex:GetBotAlias</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotAlias">AWS * API Reference</a></p> */ virtual Model::GetBotAliasOutcome GetBotAlias(const Model::GetBotAliasRequest& request) const; /** * <p>Returns information about an Amazon Lex bot alias. For more information about * aliases, see <a>versioning-aliases</a>.</p> <p>This operation requires * permissions for the <code>lex:GetBotAlias</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotAlias">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBotAliasOutcomeCallable GetBotAliasCallable(const Model::GetBotAliasRequest& request) const; /** * <p>Returns information about an Amazon Lex bot alias. For more information about * aliases, see <a>versioning-aliases</a>.</p> <p>This operation requires * permissions for the <code>lex:GetBotAlias</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotAlias">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBotAliasAsync(const Model::GetBotAliasRequest& request, const GetBotAliasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns a list of aliases for a specified Amazon Lex bot.</p> <p>This * operation requires permissions for the <code>lex:GetBotAliases</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotAliases">AWS * API Reference</a></p> */ virtual Model::GetBotAliasesOutcome GetBotAliases(const Model::GetBotAliasesRequest& request) const; /** * <p>Returns a list of aliases for a specified Amazon Lex bot.</p> <p>This * operation requires permissions for the <code>lex:GetBotAliases</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotAliases">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBotAliasesOutcomeCallable GetBotAliasesCallable(const Model::GetBotAliasesRequest& request) const; /** * <p>Returns a list of aliases for a specified Amazon Lex bot.</p> <p>This * operation requires permissions for the <code>lex:GetBotAliases</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotAliases">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBotAliasesAsync(const Model::GetBotAliasesRequest& request, const GetBotAliasesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns information about the association between an Amazon Lex bot and a * messaging platform.</p> <p>This operation requires permissions for the * <code>lex:GetBotChannelAssociation</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotChannelAssociation">AWS * API Reference</a></p> */ virtual Model::GetBotChannelAssociationOutcome GetBotChannelAssociation(const Model::GetBotChannelAssociationRequest& request) const; /** * <p>Returns information about the association between an Amazon Lex bot and a * messaging platform.</p> <p>This operation requires permissions for the * <code>lex:GetBotChannelAssociation</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotChannelAssociation">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBotChannelAssociationOutcomeCallable GetBotChannelAssociationCallable(const Model::GetBotChannelAssociationRequest& request) const; /** * <p>Returns information about the association between an Amazon Lex bot and a * messaging platform.</p> <p>This operation requires permissions for the * <code>lex:GetBotChannelAssociation</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotChannelAssociation">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBotChannelAssociationAsync(const Model::GetBotChannelAssociationRequest& request, const GetBotChannelAssociationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p> Returns a list of all of the channels associated with the specified bot. * </p> <p>The <code>GetBotChannelAssociations</code> operation requires * permissions for the <code>lex:GetBotChannelAssociations</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotChannelAssociations">AWS * API Reference</a></p> */ virtual Model::GetBotChannelAssociationsOutcome GetBotChannelAssociations(const Model::GetBotChannelAssociationsRequest& request) const; /** * <p> Returns a list of all of the channels associated with the specified bot. * </p> <p>The <code>GetBotChannelAssociations</code> operation requires * permissions for the <code>lex:GetBotChannelAssociations</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotChannelAssociations">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBotChannelAssociationsOutcomeCallable GetBotChannelAssociationsCallable(const Model::GetBotChannelAssociationsRequest& request) const; /** * <p> Returns a list of all of the channels associated with the specified bot. * </p> <p>The <code>GetBotChannelAssociations</code> operation requires * permissions for the <code>lex:GetBotChannelAssociations</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotChannelAssociations">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBotChannelAssociationsAsync(const Model::GetBotChannelAssociationsRequest& request, const GetBotChannelAssociationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets information about all of the versions of a bot.</p> <p>The * <code>GetBotVersions</code> operation returns a <code>BotMetadata</code> object * for each version of a bot. For example, if a bot has three numbered versions, * the <code>GetBotVersions</code> operation returns four <code>BotMetadata</code> * objects in the response, one for each numbered version and one for the * <code>$LATEST</code> version. </p> <p>The <code>GetBotVersions</code> operation * always returns at least one version, the <code>$LATEST</code> version.</p> * <p>This operation requires permissions for the <code>lex:GetBotVersions</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotVersions">AWS * API Reference</a></p> */ virtual Model::GetBotVersionsOutcome GetBotVersions(const Model::GetBotVersionsRequest& request) const; /** * <p>Gets information about all of the versions of a bot.</p> <p>The * <code>GetBotVersions</code> operation returns a <code>BotMetadata</code> object * for each version of a bot. For example, if a bot has three numbered versions, * the <code>GetBotVersions</code> operation returns four <code>BotMetadata</code> * objects in the response, one for each numbered version and one for the * <code>$LATEST</code> version. </p> <p>The <code>GetBotVersions</code> operation * always returns at least one version, the <code>$LATEST</code> version.</p> * <p>This operation requires permissions for the <code>lex:GetBotVersions</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotVersions">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBotVersionsOutcomeCallable GetBotVersionsCallable(const Model::GetBotVersionsRequest& request) const; /** * <p>Gets information about all of the versions of a bot.</p> <p>The * <code>GetBotVersions</code> operation returns a <code>BotMetadata</code> object * for each version of a bot. For example, if a bot has three numbered versions, * the <code>GetBotVersions</code> operation returns four <code>BotMetadata</code> * objects in the response, one for each numbered version and one for the * <code>$LATEST</code> version. </p> <p>The <code>GetBotVersions</code> operation * always returns at least one version, the <code>$LATEST</code> version.</p> * <p>This operation requires permissions for the <code>lex:GetBotVersions</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBotVersions">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBotVersionsAsync(const Model::GetBotVersionsRequest& request, const GetBotVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns bot information as follows: </p> <ul> <li> <p>If you provide the * <code>nameContains</code> field, the response includes information for the * <code>$LATEST</code> version of all bots whose name contains the specified * string.</p> </li> <li> <p>If you don't specify the <code>nameContains</code> * field, the operation returns information about the <code>$LATEST</code> version * of all of your bots.</p> </li> </ul> <p>This operation requires permission for * the <code>lex:GetBots</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBots">AWS * API Reference</a></p> */ virtual Model::GetBotsOutcome GetBots(const Model::GetBotsRequest& request) const; /** * <p>Returns bot information as follows: </p> <ul> <li> <p>If you provide the * <code>nameContains</code> field, the response includes information for the * <code>$LATEST</code> version of all bots whose name contains the specified * string.</p> </li> <li> <p>If you don't specify the <code>nameContains</code> * field, the operation returns information about the <code>$LATEST</code> version * of all of your bots.</p> </li> </ul> <p>This operation requires permission for * the <code>lex:GetBots</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBots">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBotsOutcomeCallable GetBotsCallable(const Model::GetBotsRequest& request) const; /** * <p>Returns bot information as follows: </p> <ul> <li> <p>If you provide the * <code>nameContains</code> field, the response includes information for the * <code>$LATEST</code> version of all bots whose name contains the specified * string.</p> </li> <li> <p>If you don't specify the <code>nameContains</code> * field, the operation returns information about the <code>$LATEST</code> version * of all of your bots.</p> </li> </ul> <p>This operation requires permission for * the <code>lex:GetBots</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBots">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBotsAsync(const Model::GetBotsRequest& request, const GetBotsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns information about a built-in intent.</p> <p>This operation requires * permission for the <code>lex:GetBuiltinIntent</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinIntent">AWS * API Reference</a></p> */ virtual Model::GetBuiltinIntentOutcome GetBuiltinIntent(const Model::GetBuiltinIntentRequest& request) const; /** * <p>Returns information about a built-in intent.</p> <p>This operation requires * permission for the <code>lex:GetBuiltinIntent</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinIntent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBuiltinIntentOutcomeCallable GetBuiltinIntentCallable(const Model::GetBuiltinIntentRequest& request) const; /** * <p>Returns information about a built-in intent.</p> <p>This operation requires * permission for the <code>lex:GetBuiltinIntent</code> action.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinIntent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBuiltinIntentAsync(const Model::GetBuiltinIntentRequest& request, const GetBuiltinIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets a list of built-in intents that meet the specified criteria.</p> <p>This * operation requires permission for the <code>lex:GetBuiltinIntents</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinIntents">AWS * API Reference</a></p> */ virtual Model::GetBuiltinIntentsOutcome GetBuiltinIntents(const Model::GetBuiltinIntentsRequest& request) const; /** * <p>Gets a list of built-in intents that meet the specified criteria.</p> <p>This * operation requires permission for the <code>lex:GetBuiltinIntents</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinIntents">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBuiltinIntentsOutcomeCallable GetBuiltinIntentsCallable(const Model::GetBuiltinIntentsRequest& request) const; /** * <p>Gets a list of built-in intents that meet the specified criteria.</p> <p>This * operation requires permission for the <code>lex:GetBuiltinIntents</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinIntents">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBuiltinIntentsAsync(const Model::GetBuiltinIntentsRequest& request, const GetBuiltinIntentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets a list of built-in slot types that meet the specified criteria.</p> * <p>For a list of built-in slot types, see <a * href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference">Slot * Type Reference</a> in the <i>Alexa Skills Kit</i>.</p> <p>This operation * requires permission for the <code>lex:GetBuiltInSlotTypes</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinSlotTypes">AWS * API Reference</a></p> */ virtual Model::GetBuiltinSlotTypesOutcome GetBuiltinSlotTypes(const Model::GetBuiltinSlotTypesRequest& request) const; /** * <p>Gets a list of built-in slot types that meet the specified criteria.</p> * <p>For a list of built-in slot types, see <a * href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference">Slot * Type Reference</a> in the <i>Alexa Skills Kit</i>.</p> <p>This operation * requires permission for the <code>lex:GetBuiltInSlotTypes</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinSlotTypes">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetBuiltinSlotTypesOutcomeCallable GetBuiltinSlotTypesCallable(const Model::GetBuiltinSlotTypesRequest& request) const; /** * <p>Gets a list of built-in slot types that meet the specified criteria.</p> * <p>For a list of built-in slot types, see <a * href="https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/built-in-intent-ref/slot-type-reference">Slot * Type Reference</a> in the <i>Alexa Skills Kit</i>.</p> <p>This operation * requires permission for the <code>lex:GetBuiltInSlotTypes</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBuiltinSlotTypes">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetBuiltinSlotTypesAsync(const Model::GetBuiltinSlotTypesRequest& request, const GetBuiltinSlotTypesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Exports the contents of a Amazon Lex resource in a specified format. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetExport">AWS * API Reference</a></p> */ virtual Model::GetExportOutcome GetExport(const Model::GetExportRequest& request) const; /** * <p>Exports the contents of a Amazon Lex resource in a specified format. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetExport">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetExportOutcomeCallable GetExportCallable(const Model::GetExportRequest& request) const; /** * <p>Exports the contents of a Amazon Lex resource in a specified format. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetExport">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetExportAsync(const Model::GetExportRequest& request, const GetExportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets information about an import job started with the * <code>StartImport</code> operation.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetImport">AWS * API Reference</a></p> */ virtual Model::GetImportOutcome GetImport(const Model::GetImportRequest& request) const; /** * <p>Gets information about an import job started with the * <code>StartImport</code> operation.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetImport">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetImportOutcomeCallable GetImportCallable(const Model::GetImportRequest& request) const; /** * <p>Gets information about an import job started with the * <code>StartImport</code> operation.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetImport">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetImportAsync(const Model::GetImportRequest& request, const GetImportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p> Returns information about an intent. In addition to the intent name, you * must specify the intent version. </p> <p> This operation requires permissions to * perform the <code>lex:GetIntent</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntent">AWS * API Reference</a></p> */ virtual Model::GetIntentOutcome GetIntent(const Model::GetIntentRequest& request) const; /** * <p> Returns information about an intent. In addition to the intent name, you * must specify the intent version. </p> <p> This operation requires permissions to * perform the <code>lex:GetIntent</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetIntentOutcomeCallable GetIntentCallable(const Model::GetIntentRequest& request) const; /** * <p> Returns information about an intent. In addition to the intent name, you * must specify the intent version. </p> <p> This operation requires permissions to * perform the <code>lex:GetIntent</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetIntentAsync(const Model::GetIntentRequest& request, const GetIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets information about all of the versions of an intent.</p> <p>The * <code>GetIntentVersions</code> operation returns an <code>IntentMetadata</code> * object for each version of an intent. For example, if an intent has three * numbered versions, the <code>GetIntentVersions</code> operation returns four * <code>IntentMetadata</code> objects in the response, one for each numbered * version and one for the <code>$LATEST</code> version. </p> <p>The * <code>GetIntentVersions</code> operation always returns at least one version, * the <code>$LATEST</code> version.</p> <p>This operation requires permissions for * the <code>lex:GetIntentVersions</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntentVersions">AWS * API Reference</a></p> */ virtual Model::GetIntentVersionsOutcome GetIntentVersions(const Model::GetIntentVersionsRequest& request) const; /** * <p>Gets information about all of the versions of an intent.</p> <p>The * <code>GetIntentVersions</code> operation returns an <code>IntentMetadata</code> * object for each version of an intent. For example, if an intent has three * numbered versions, the <code>GetIntentVersions</code> operation returns four * <code>IntentMetadata</code> objects in the response, one for each numbered * version and one for the <code>$LATEST</code> version. </p> <p>The * <code>GetIntentVersions</code> operation always returns at least one version, * the <code>$LATEST</code> version.</p> <p>This operation requires permissions for * the <code>lex:GetIntentVersions</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntentVersions">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetIntentVersionsOutcomeCallable GetIntentVersionsCallable(const Model::GetIntentVersionsRequest& request) const; /** * <p>Gets information about all of the versions of an intent.</p> <p>The * <code>GetIntentVersions</code> operation returns an <code>IntentMetadata</code> * object for each version of an intent. For example, if an intent has three * numbered versions, the <code>GetIntentVersions</code> operation returns four * <code>IntentMetadata</code> objects in the response, one for each numbered * version and one for the <code>$LATEST</code> version. </p> <p>The * <code>GetIntentVersions</code> operation always returns at least one version, * the <code>$LATEST</code> version.</p> <p>This operation requires permissions for * the <code>lex:GetIntentVersions</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntentVersions">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetIntentVersionsAsync(const Model::GetIntentVersionsRequest& request, const GetIntentVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns intent information as follows: </p> <ul> <li> <p>If you specify the * <code>nameContains</code> field, returns the <code>$LATEST</code> version of all * intents that contain the specified string.</p> </li> <li> <p> If you don't * specify the <code>nameContains</code> field, returns information about the * <code>$LATEST</code> version of all intents. </p> </li> </ul> <p> The operation * requires permission for the <code>lex:GetIntents</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntents">AWS * API Reference</a></p> */ virtual Model::GetIntentsOutcome GetIntents(const Model::GetIntentsRequest& request) const; /** * <p>Returns intent information as follows: </p> <ul> <li> <p>If you specify the * <code>nameContains</code> field, returns the <code>$LATEST</code> version of all * intents that contain the specified string.</p> </li> <li> <p> If you don't * specify the <code>nameContains</code> field, returns information about the * <code>$LATEST</code> version of all intents. </p> </li> </ul> <p> The operation * requires permission for the <code>lex:GetIntents</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntents">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetIntentsOutcomeCallable GetIntentsCallable(const Model::GetIntentsRequest& request) const; /** * <p>Returns intent information as follows: </p> <ul> <li> <p>If you specify the * <code>nameContains</code> field, returns the <code>$LATEST</code> version of all * intents that contain the specified string.</p> </li> <li> <p> If you don't * specify the <code>nameContains</code> field, returns information about the * <code>$LATEST</code> version of all intents. </p> </li> </ul> <p> The operation * requires permission for the <code>lex:GetIntents</code> action. </p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetIntents">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetIntentsAsync(const Model::GetIntentsRequest& request, const GetIntentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Provides details about an ongoing or complete migration from an Amazon Lex V1 * bot to an Amazon Lex V2 bot. Use this operation to view the migration alerts and * warnings related to the migration.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetMigration">AWS * API Reference</a></p> */ virtual Model::GetMigrationOutcome GetMigration(const Model::GetMigrationRequest& request) const; /** * <p>Provides details about an ongoing or complete migration from an Amazon Lex V1 * bot to an Amazon Lex V2 bot. Use this operation to view the migration alerts and * warnings related to the migration.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetMigration">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetMigrationOutcomeCallable GetMigrationCallable(const Model::GetMigrationRequest& request) const; /** * <p>Provides details about an ongoing or complete migration from an Amazon Lex V1 * bot to an Amazon Lex V2 bot. Use this operation to view the migration alerts and * warnings related to the migration.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetMigration">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetMigrationAsync(const Model::GetMigrationRequest& request, const GetMigrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets a list of migrations between Amazon Lex V1 and Amazon Lex * V2.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetMigrations">AWS * API Reference</a></p> */ virtual Model::GetMigrationsOutcome GetMigrations(const Model::GetMigrationsRequest& request) const; /** * <p>Gets a list of migrations between Amazon Lex V1 and Amazon Lex * V2.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetMigrations">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetMigrationsOutcomeCallable GetMigrationsCallable(const Model::GetMigrationsRequest& request) const; /** * <p>Gets a list of migrations between Amazon Lex V1 and Amazon Lex * V2.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetMigrations">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetMigrationsAsync(const Model::GetMigrationsRequest& request, const GetMigrationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns information about a specific version of a slot type. In addition to * specifying the slot type name, you must specify the slot type version.</p> * <p>This operation requires permissions for the <code>lex:GetSlotType</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotType">AWS * API Reference</a></p> */ virtual Model::GetSlotTypeOutcome GetSlotType(const Model::GetSlotTypeRequest& request) const; /** * <p>Returns information about a specific version of a slot type. In addition to * specifying the slot type name, you must specify the slot type version.</p> * <p>This operation requires permissions for the <code>lex:GetSlotType</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotType">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetSlotTypeOutcomeCallable GetSlotTypeCallable(const Model::GetSlotTypeRequest& request) const; /** * <p>Returns information about a specific version of a slot type. In addition to * specifying the slot type name, you must specify the slot type version.</p> * <p>This operation requires permissions for the <code>lex:GetSlotType</code> * action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotType">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetSlotTypeAsync(const Model::GetSlotTypeRequest& request, const GetSlotTypeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets information about all versions of a slot type.</p> <p>The * <code>GetSlotTypeVersions</code> operation returns a * <code>SlotTypeMetadata</code> object for each version of a slot type. For * example, if a slot type has three numbered versions, the * <code>GetSlotTypeVersions</code> operation returns four * <code>SlotTypeMetadata</code> objects in the response, one for each numbered * version and one for the <code>$LATEST</code> version. </p> <p>The * <code>GetSlotTypeVersions</code> operation always returns at least one version, * the <code>$LATEST</code> version.</p> <p>This operation requires permissions for * the <code>lex:GetSlotTypeVersions</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotTypeVersions">AWS * API Reference</a></p> */ virtual Model::GetSlotTypeVersionsOutcome GetSlotTypeVersions(const Model::GetSlotTypeVersionsRequest& request) const; /** * <p>Gets information about all versions of a slot type.</p> <p>The * <code>GetSlotTypeVersions</code> operation returns a * <code>SlotTypeMetadata</code> object for each version of a slot type. For * example, if a slot type has three numbered versions, the * <code>GetSlotTypeVersions</code> operation returns four * <code>SlotTypeMetadata</code> objects in the response, one for each numbered * version and one for the <code>$LATEST</code> version. </p> <p>The * <code>GetSlotTypeVersions</code> operation always returns at least one version, * the <code>$LATEST</code> version.</p> <p>This operation requires permissions for * the <code>lex:GetSlotTypeVersions</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotTypeVersions">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetSlotTypeVersionsOutcomeCallable GetSlotTypeVersionsCallable(const Model::GetSlotTypeVersionsRequest& request) const; /** * <p>Gets information about all versions of a slot type.</p> <p>The * <code>GetSlotTypeVersions</code> operation returns a * <code>SlotTypeMetadata</code> object for each version of a slot type. For * example, if a slot type has three numbered versions, the * <code>GetSlotTypeVersions</code> operation returns four * <code>SlotTypeMetadata</code> objects in the response, one for each numbered * version and one for the <code>$LATEST</code> version. </p> <p>The * <code>GetSlotTypeVersions</code> operation always returns at least one version, * the <code>$LATEST</code> version.</p> <p>This operation requires permissions for * the <code>lex:GetSlotTypeVersions</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotTypeVersions">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetSlotTypeVersionsAsync(const Model::GetSlotTypeVersionsRequest& request, const GetSlotTypeVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Returns slot type information as follows: </p> <ul> <li> <p>If you specify * the <code>nameContains</code> field, returns the <code>$LATEST</code> version of * all slot types that contain the specified string.</p> </li> <li> <p> If you * don't specify the <code>nameContains</code> field, returns information about the * <code>$LATEST</code> version of all slot types. </p> </li> </ul> <p> The * operation requires permission for the <code>lex:GetSlotTypes</code> action. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotTypes">AWS * API Reference</a></p> */ virtual Model::GetSlotTypesOutcome GetSlotTypes(const Model::GetSlotTypesRequest& request) const; /** * <p>Returns slot type information as follows: </p> <ul> <li> <p>If you specify * the <code>nameContains</code> field, returns the <code>$LATEST</code> version of * all slot types that contain the specified string.</p> </li> <li> <p> If you * don't specify the <code>nameContains</code> field, returns information about the * <code>$LATEST</code> version of all slot types. </p> </li> </ul> <p> The * operation requires permission for the <code>lex:GetSlotTypes</code> action. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotTypes">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetSlotTypesOutcomeCallable GetSlotTypesCallable(const Model::GetSlotTypesRequest& request) const; /** * <p>Returns slot type information as follows: </p> <ul> <li> <p>If you specify * the <code>nameContains</code> field, returns the <code>$LATEST</code> version of * all slot types that contain the specified string.</p> </li> <li> <p> If you * don't specify the <code>nameContains</code> field, returns information about the * <code>$LATEST</code> version of all slot types. </p> </li> </ul> <p> The * operation requires permission for the <code>lex:GetSlotTypes</code> action. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetSlotTypes">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetSlotTypesAsync(const Model::GetSlotTypesRequest& request, const GetSlotTypesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Use the <code>GetUtterancesView</code> operation to get information about the * utterances that your users have made to your bot. You can use this list to tune * the utterances that your bot responds to.</p> <p>For example, say that you have * created a bot to order flowers. After your users have used your bot for a while, * use the <code>GetUtterancesView</code> operation to see the requests that they * have made and whether they have been successful. You might find that the * utterance "I want flowers" is not being recognized. You could add this utterance * to the <code>OrderFlowers</code> intent so that your bot recognizes that * utterance.</p> <p>After you publish a new version of a bot, you can get * information about the old version and the new so that you can compare the * performance across the two versions. </p> <p>Utterance statistics are generated * once a day. Data is available for the last 15 days. You can request information * for up to 5 versions of your bot in each request. Amazon Lex returns the most * frequent utterances received by the bot in the last 15 days. The response * contains information about a maximum of 100 utterances for each version.</p> * <p>If you set <code>childDirected</code> field to true when you created your * bot, if you are using slot obfuscation with one or more slots, or if you opted * out of participating in improving Amazon Lex, utterances are not available.</p> * <p>This operation requires permissions for the * <code>lex:GetUtterancesView</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetUtterancesView">AWS * API Reference</a></p> */ virtual Model::GetUtterancesViewOutcome GetUtterancesView(const Model::GetUtterancesViewRequest& request) const; /** * <p>Use the <code>GetUtterancesView</code> operation to get information about the * utterances that your users have made to your bot. You can use this list to tune * the utterances that your bot responds to.</p> <p>For example, say that you have * created a bot to order flowers. After your users have used your bot for a while, * use the <code>GetUtterancesView</code> operation to see the requests that they * have made and whether they have been successful. You might find that the * utterance "I want flowers" is not being recognized. You could add this utterance * to the <code>OrderFlowers</code> intent so that your bot recognizes that * utterance.</p> <p>After you publish a new version of a bot, you can get * information about the old version and the new so that you can compare the * performance across the two versions. </p> <p>Utterance statistics are generated * once a day. Data is available for the last 15 days. You can request information * for up to 5 versions of your bot in each request. Amazon Lex returns the most * frequent utterances received by the bot in the last 15 days. The response * contains information about a maximum of 100 utterances for each version.</p> * <p>If you set <code>childDirected</code> field to true when you created your * bot, if you are using slot obfuscation with one or more slots, or if you opted * out of participating in improving Amazon Lex, utterances are not available.</p> * <p>This operation requires permissions for the * <code>lex:GetUtterancesView</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetUtterancesView">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::GetUtterancesViewOutcomeCallable GetUtterancesViewCallable(const Model::GetUtterancesViewRequest& request) const; /** * <p>Use the <code>GetUtterancesView</code> operation to get information about the * utterances that your users have made to your bot. You can use this list to tune * the utterances that your bot responds to.</p> <p>For example, say that you have * created a bot to order flowers. After your users have used your bot for a while, * use the <code>GetUtterancesView</code> operation to see the requests that they * have made and whether they have been successful. You might find that the * utterance "I want flowers" is not being recognized. You could add this utterance * to the <code>OrderFlowers</code> intent so that your bot recognizes that * utterance.</p> <p>After you publish a new version of a bot, you can get * information about the old version and the new so that you can compare the * performance across the two versions. </p> <p>Utterance statistics are generated * once a day. Data is available for the last 15 days. You can request information * for up to 5 versions of your bot in each request. Amazon Lex returns the most * frequent utterances received by the bot in the last 15 days. The response * contains information about a maximum of 100 utterances for each version.</p> * <p>If you set <code>childDirected</code> field to true when you created your * bot, if you are using slot obfuscation with one or more slots, or if you opted * out of participating in improving Amazon Lex, utterances are not available.</p> * <p>This operation requires permissions for the * <code>lex:GetUtterancesView</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetUtterancesView">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void GetUtterancesViewAsync(const Model::GetUtterancesViewRequest& request, const GetUtterancesViewResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Gets a list of tags associated with the specified resource. Only bots, bot * aliases, and bot channels can have tags associated with them.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/ListTagsForResource">AWS * API Reference</a></p> */ virtual Model::ListTagsForResourceOutcome ListTagsForResource(const Model::ListTagsForResourceRequest& request) const; /** * <p>Gets a list of tags associated with the specified resource. Only bots, bot * aliases, and bot channels can have tags associated with them.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/ListTagsForResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::ListTagsForResourceOutcomeCallable ListTagsForResourceCallable(const Model::ListTagsForResourceRequest& request) const; /** * <p>Gets a list of tags associated with the specified resource. Only bots, bot * aliases, and bot channels can have tags associated with them.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/ListTagsForResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void ListTagsForResourceAsync(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates an Amazon Lex conversational bot or replaces an existing bot. When * you create or update a bot you are only required to specify a name, a locale, * and whether the bot is directed toward children under age 13. You can use this * to add intents later, or to remove intents from an existing bot. When you create * a bot with the minimum information, the bot is created or updated but Amazon Lex * returns the <code/> response <code>FAILED</code>. You can build the bot after * you add one or more intents. For more information about Amazon Lex bots, see * <a>how-it-works</a>. </p> <p>If you specify the name of an existing bot, the * fields in the request replace the existing values in the <code>$LATEST</code> * version of the bot. Amazon Lex removes any fields that you don't provide values * for in the request, except for the <code>idleTTLInSeconds</code> and * <code>privacySettings</code> fields, which are set to their default values. If * you don't specify values for required fields, Amazon Lex throws an * exception.</p> <p>This operation requires permissions for the * <code>lex:PutBot</code> action. For more information, see * <a>security-iam</a>.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutBot">AWS * API Reference</a></p> */ virtual Model::PutBotOutcome PutBot(const Model::PutBotRequest& request) const; /** * <p>Creates an Amazon Lex conversational bot or replaces an existing bot. When * you create or update a bot you are only required to specify a name, a locale, * and whether the bot is directed toward children under age 13. You can use this * to add intents later, or to remove intents from an existing bot. When you create * a bot with the minimum information, the bot is created or updated but Amazon Lex * returns the <code/> response <code>FAILED</code>. You can build the bot after * you add one or more intents. For more information about Amazon Lex bots, see * <a>how-it-works</a>. </p> <p>If you specify the name of an existing bot, the * fields in the request replace the existing values in the <code>$LATEST</code> * version of the bot. Amazon Lex removes any fields that you don't provide values * for in the request, except for the <code>idleTTLInSeconds</code> and * <code>privacySettings</code> fields, which are set to their default values. If * you don't specify values for required fields, Amazon Lex throws an * exception.</p> <p>This operation requires permissions for the * <code>lex:PutBot</code> action. For more information, see * <a>security-iam</a>.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutBot">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::PutBotOutcomeCallable PutBotCallable(const Model::PutBotRequest& request) const; /** * <p>Creates an Amazon Lex conversational bot or replaces an existing bot. When * you create or update a bot you are only required to specify a name, a locale, * and whether the bot is directed toward children under age 13. You can use this * to add intents later, or to remove intents from an existing bot. When you create * a bot with the minimum information, the bot is created or updated but Amazon Lex * returns the <code/> response <code>FAILED</code>. You can build the bot after * you add one or more intents. For more information about Amazon Lex bots, see * <a>how-it-works</a>. </p> <p>If you specify the name of an existing bot, the * fields in the request replace the existing values in the <code>$LATEST</code> * version of the bot. Amazon Lex removes any fields that you don't provide values * for in the request, except for the <code>idleTTLInSeconds</code> and * <code>privacySettings</code> fields, which are set to their default values. If * you don't specify values for required fields, Amazon Lex throws an * exception.</p> <p>This operation requires permissions for the * <code>lex:PutBot</code> action. For more information, see * <a>security-iam</a>.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutBot">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void PutBotAsync(const Model::PutBotRequest& request, const PutBotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates an alias for the specified version of the bot or replaces an alias * for the specified bot. To change the version of the bot that the alias points * to, replace the alias. For more information about aliases, see * <a>versioning-aliases</a>.</p> <p>This operation requires permissions for the * <code>lex:PutBotAlias</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutBotAlias">AWS * API Reference</a></p> */ virtual Model::PutBotAliasOutcome PutBotAlias(const Model::PutBotAliasRequest& request) const; /** * <p>Creates an alias for the specified version of the bot or replaces an alias * for the specified bot. To change the version of the bot that the alias points * to, replace the alias. For more information about aliases, see * <a>versioning-aliases</a>.</p> <p>This operation requires permissions for the * <code>lex:PutBotAlias</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutBotAlias">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::PutBotAliasOutcomeCallable PutBotAliasCallable(const Model::PutBotAliasRequest& request) const; /** * <p>Creates an alias for the specified version of the bot or replaces an alias * for the specified bot. To change the version of the bot that the alias points * to, replace the alias. For more information about aliases, see * <a>versioning-aliases</a>.</p> <p>This operation requires permissions for the * <code>lex:PutBotAlias</code> action. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutBotAlias">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void PutBotAliasAsync(const Model::PutBotAliasRequest& request, const PutBotAliasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates an intent or replaces an existing intent.</p> <p>To define the * interaction between the user and your bot, you use one or more intents. For a * pizza ordering bot, for example, you would create an <code>OrderPizza</code> * intent. </p> <p>To create an intent or replace an existing intent, you must * provide the following:</p> <ul> <li> <p>Intent name. For example, * <code>OrderPizza</code>.</p> </li> <li> <p>Sample utterances. For example, "Can * I order a pizza, please." and "I want to order a pizza."</p> </li> <li> * <p>Information to be gathered. You specify slot types for the information that * your bot will request from the user. You can specify standard slot types, such * as a date or a time, or custom slot types such as the size and crust of a * pizza.</p> </li> <li> <p>How the intent will be fulfilled. You can provide a * Lambda function or configure the intent to return the intent information to the * client application. If you use a Lambda function, when all of the intent * information is available, Amazon Lex invokes your Lambda function. If you * configure your intent to return the intent information to the client * application. </p> </li> </ul> <p>You can specify other optional information in * the request, such as:</p> <ul> <li> <p>A confirmation prompt to ask the user to * confirm an intent. For example, "Shall I order your pizza?"</p> </li> <li> <p>A * conclusion statement to send to the user after the intent has been fulfilled. * For example, "I placed your pizza order."</p> </li> <li> <p>A follow-up prompt * that asks the user for additional activity. For example, asking "Do you want to * order a drink with your pizza?"</p> </li> </ul> <p>If you specify an existing * intent name to update the intent, Amazon Lex replaces the values in the * <code>$LATEST</code> version of the intent with the values in the request. * Amazon Lex removes fields that you don't provide in the request. If you don't * specify the required fields, Amazon Lex throws an exception. When you update the * <code>$LATEST</code> version of an intent, the <code>status</code> field of any * bot that uses the <code>$LATEST</code> version of the intent is set to * <code>NOT_BUILT</code>.</p> <p>For more information, see * <a>how-it-works</a>.</p> <p>This operation requires permissions for the * <code>lex:PutIntent</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutIntent">AWS * API Reference</a></p> */ virtual Model::PutIntentOutcome PutIntent(const Model::PutIntentRequest& request) const; /** * <p>Creates an intent or replaces an existing intent.</p> <p>To define the * interaction between the user and your bot, you use one or more intents. For a * pizza ordering bot, for example, you would create an <code>OrderPizza</code> * intent. </p> <p>To create an intent or replace an existing intent, you must * provide the following:</p> <ul> <li> <p>Intent name. For example, * <code>OrderPizza</code>.</p> </li> <li> <p>Sample utterances. For example, "Can * I order a pizza, please." and "I want to order a pizza."</p> </li> <li> * <p>Information to be gathered. You specify slot types for the information that * your bot will request from the user. You can specify standard slot types, such * as a date or a time, or custom slot types such as the size and crust of a * pizza.</p> </li> <li> <p>How the intent will be fulfilled. You can provide a * Lambda function or configure the intent to return the intent information to the * client application. If you use a Lambda function, when all of the intent * information is available, Amazon Lex invokes your Lambda function. If you * configure your intent to return the intent information to the client * application. </p> </li> </ul> <p>You can specify other optional information in * the request, such as:</p> <ul> <li> <p>A confirmation prompt to ask the user to * confirm an intent. For example, "Shall I order your pizza?"</p> </li> <li> <p>A * conclusion statement to send to the user after the intent has been fulfilled. * For example, "I placed your pizza order."</p> </li> <li> <p>A follow-up prompt * that asks the user for additional activity. For example, asking "Do you want to * order a drink with your pizza?"</p> </li> </ul> <p>If you specify an existing * intent name to update the intent, Amazon Lex replaces the values in the * <code>$LATEST</code> version of the intent with the values in the request. * Amazon Lex removes fields that you don't provide in the request. If you don't * specify the required fields, Amazon Lex throws an exception. When you update the * <code>$LATEST</code> version of an intent, the <code>status</code> field of any * bot that uses the <code>$LATEST</code> version of the intent is set to * <code>NOT_BUILT</code>.</p> <p>For more information, see * <a>how-it-works</a>.</p> <p>This operation requires permissions for the * <code>lex:PutIntent</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutIntent">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::PutIntentOutcomeCallable PutIntentCallable(const Model::PutIntentRequest& request) const; /** * <p>Creates an intent or replaces an existing intent.</p> <p>To define the * interaction between the user and your bot, you use one or more intents. For a * pizza ordering bot, for example, you would create an <code>OrderPizza</code> * intent. </p> <p>To create an intent or replace an existing intent, you must * provide the following:</p> <ul> <li> <p>Intent name. For example, * <code>OrderPizza</code>.</p> </li> <li> <p>Sample utterances. For example, "Can * I order a pizza, please." and "I want to order a pizza."</p> </li> <li> * <p>Information to be gathered. You specify slot types for the information that * your bot will request from the user. You can specify standard slot types, such * as a date or a time, or custom slot types such as the size and crust of a * pizza.</p> </li> <li> <p>How the intent will be fulfilled. You can provide a * Lambda function or configure the intent to return the intent information to the * client application. If you use a Lambda function, when all of the intent * information is available, Amazon Lex invokes your Lambda function. If you * configure your intent to return the intent information to the client * application. </p> </li> </ul> <p>You can specify other optional information in * the request, such as:</p> <ul> <li> <p>A confirmation prompt to ask the user to * confirm an intent. For example, "Shall I order your pizza?"</p> </li> <li> <p>A * conclusion statement to send to the user after the intent has been fulfilled. * For example, "I placed your pizza order."</p> </li> <li> <p>A follow-up prompt * that asks the user for additional activity. For example, asking "Do you want to * order a drink with your pizza?"</p> </li> </ul> <p>If you specify an existing * intent name to update the intent, Amazon Lex replaces the values in the * <code>$LATEST</code> version of the intent with the values in the request. * Amazon Lex removes fields that you don't provide in the request. If you don't * specify the required fields, Amazon Lex throws an exception. When you update the * <code>$LATEST</code> version of an intent, the <code>status</code> field of any * bot that uses the <code>$LATEST</code> version of the intent is set to * <code>NOT_BUILT</code>.</p> <p>For more information, see * <a>how-it-works</a>.</p> <p>This operation requires permissions for the * <code>lex:PutIntent</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutIntent">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void PutIntentAsync(const Model::PutIntentRequest& request, const PutIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Creates a custom slot type or replaces an existing custom slot type.</p> * <p>To create a custom slot type, specify a name for the slot type and a set of * enumeration values, which are the values that a slot of this type can assume. * For more information, see <a>how-it-works</a>.</p> <p>If you specify the name of * an existing slot type, the fields in the request replace the existing values in * the <code>$LATEST</code> version of the slot type. Amazon Lex removes the fields * that you don't provide in the request. If you don't specify required fields, * Amazon Lex throws an exception. When you update the <code>$LATEST</code> version * of a slot type, if a bot uses the <code>$LATEST</code> version of an intent that * contains the slot type, the bot's <code>status</code> field is set to * <code>NOT_BUILT</code>.</p> <p>This operation requires permissions for the * <code>lex:PutSlotType</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutSlotType">AWS * API Reference</a></p> */ virtual Model::PutSlotTypeOutcome PutSlotType(const Model::PutSlotTypeRequest& request) const; /** * <p>Creates a custom slot type or replaces an existing custom slot type.</p> * <p>To create a custom slot type, specify a name for the slot type and a set of * enumeration values, which are the values that a slot of this type can assume. * For more information, see <a>how-it-works</a>.</p> <p>If you specify the name of * an existing slot type, the fields in the request replace the existing values in * the <code>$LATEST</code> version of the slot type. Amazon Lex removes the fields * that you don't provide in the request. If you don't specify required fields, * Amazon Lex throws an exception. When you update the <code>$LATEST</code> version * of a slot type, if a bot uses the <code>$LATEST</code> version of an intent that * contains the slot type, the bot's <code>status</code> field is set to * <code>NOT_BUILT</code>.</p> <p>This operation requires permissions for the * <code>lex:PutSlotType</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutSlotType">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::PutSlotTypeOutcomeCallable PutSlotTypeCallable(const Model::PutSlotTypeRequest& request) const; /** * <p>Creates a custom slot type or replaces an existing custom slot type.</p> * <p>To create a custom slot type, specify a name for the slot type and a set of * enumeration values, which are the values that a slot of this type can assume. * For more information, see <a>how-it-works</a>.</p> <p>If you specify the name of * an existing slot type, the fields in the request replace the existing values in * the <code>$LATEST</code> version of the slot type. Amazon Lex removes the fields * that you don't provide in the request. If you don't specify required fields, * Amazon Lex throws an exception. When you update the <code>$LATEST</code> version * of a slot type, if a bot uses the <code>$LATEST</code> version of an intent that * contains the slot type, the bot's <code>status</code> field is set to * <code>NOT_BUILT</code>.</p> <p>This operation requires permissions for the * <code>lex:PutSlotType</code> action.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/PutSlotType">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void PutSlotTypeAsync(const Model::PutSlotTypeRequest& request, const PutSlotTypeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Starts a job to import a resource to Amazon Lex.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/StartImport">AWS * API Reference</a></p> */ virtual Model::StartImportOutcome StartImport(const Model::StartImportRequest& request) const; /** * <p>Starts a job to import a resource to Amazon Lex.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/StartImport">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::StartImportOutcomeCallable StartImportCallable(const Model::StartImportRequest& request) const; /** * <p>Starts a job to import a resource to Amazon Lex.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/StartImport">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void StartImportAsync(const Model::StartImportRequest& request, const StartImportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Starts migrating a bot from Amazon Lex V1 to Amazon Lex V2. Migrate your bot * when you want to take advantage of the new features of Amazon Lex V2.</p> <p>For * more information, see <a * href="https://docs.aws.amazon.com/lex/latest/dg/migrate.html">Migrating a * bot</a> in the <i>Amazon Lex developer guide</i>.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/StartMigration">AWS * API Reference</a></p> */ virtual Model::StartMigrationOutcome StartMigration(const Model::StartMigrationRequest& request) const; /** * <p>Starts migrating a bot from Amazon Lex V1 to Amazon Lex V2. Migrate your bot * when you want to take advantage of the new features of Amazon Lex V2.</p> <p>For * more information, see <a * href="https://docs.aws.amazon.com/lex/latest/dg/migrate.html">Migrating a * bot</a> in the <i>Amazon Lex developer guide</i>.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/StartMigration">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::StartMigrationOutcomeCallable StartMigrationCallable(const Model::StartMigrationRequest& request) const; /** * <p>Starts migrating a bot from Amazon Lex V1 to Amazon Lex V2. Migrate your bot * when you want to take advantage of the new features of Amazon Lex V2.</p> <p>For * more information, see <a * href="https://docs.aws.amazon.com/lex/latest/dg/migrate.html">Migrating a * bot</a> in the <i>Amazon Lex developer guide</i>.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/StartMigration">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void StartMigrationAsync(const Model::StartMigrationRequest& request, const StartMigrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Adds the specified tags to the specified resource. If a tag key already * exists, the existing value is replaced with the new value.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/TagResource">AWS * API Reference</a></p> */ virtual Model::TagResourceOutcome TagResource(const Model::TagResourceRequest& request) const; /** * <p>Adds the specified tags to the specified resource. If a tag key already * exists, the existing value is replaced with the new value.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/TagResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::TagResourceOutcomeCallable TagResourceCallable(const Model::TagResourceRequest& request) const; /** * <p>Adds the specified tags to the specified resource. If a tag key already * exists, the existing value is replaced with the new value.</p><p><h3>See * Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/TagResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void TagResourceAsync(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; /** * <p>Removes tags from a bot, bot alias or bot channel.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/UntagResource">AWS * API Reference</a></p> */ virtual Model::UntagResourceOutcome UntagResource(const Model::UntagResourceRequest& request) const; /** * <p>Removes tags from a bot, bot alias or bot channel.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/UntagResource">AWS * API Reference</a></p> * * returns a future to the operation so that it can be executed in parallel to other requests. */ virtual Model::UntagResourceOutcomeCallable UntagResourceCallable(const Model::UntagResourceRequest& request) const; /** * <p>Removes tags from a bot, bot alias or bot channel.</p><p><h3>See Also:</h3> * <a * href="http://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/UntagResource">AWS * API Reference</a></p> * * Queues the request into a thread executor and triggers associated callback when operation has finished. */ virtual void UntagResourceAsync(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const; void OverrideEndpoint(const Aws::String& endpoint); private: void init(const Aws::Client::ClientConfiguration& clientConfiguration); void CreateBotVersionAsyncHelper(const Model::CreateBotVersionRequest& request, const CreateBotVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateIntentVersionAsyncHelper(const Model::CreateIntentVersionRequest& request, const CreateIntentVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void CreateSlotTypeVersionAsyncHelper(const Model::CreateSlotTypeVersionRequest& request, const CreateSlotTypeVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteBotAsyncHelper(const Model::DeleteBotRequest& request, const DeleteBotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteBotAliasAsyncHelper(const Model::DeleteBotAliasRequest& request, const DeleteBotAliasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteBotChannelAssociationAsyncHelper(const Model::DeleteBotChannelAssociationRequest& request, const DeleteBotChannelAssociationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteBotVersionAsyncHelper(const Model::DeleteBotVersionRequest& request, const DeleteBotVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteIntentAsyncHelper(const Model::DeleteIntentRequest& request, const DeleteIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteIntentVersionAsyncHelper(const Model::DeleteIntentVersionRequest& request, const DeleteIntentVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteSlotTypeAsyncHelper(const Model::DeleteSlotTypeRequest& request, const DeleteSlotTypeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteSlotTypeVersionAsyncHelper(const Model::DeleteSlotTypeVersionRequest& request, const DeleteSlotTypeVersionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void DeleteUtterancesAsyncHelper(const Model::DeleteUtterancesRequest& request, const DeleteUtterancesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBotAsyncHelper(const Model::GetBotRequest& request, const GetBotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBotAliasAsyncHelper(const Model::GetBotAliasRequest& request, const GetBotAliasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBotAliasesAsyncHelper(const Model::GetBotAliasesRequest& request, const GetBotAliasesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBotChannelAssociationAsyncHelper(const Model::GetBotChannelAssociationRequest& request, const GetBotChannelAssociationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBotChannelAssociationsAsyncHelper(const Model::GetBotChannelAssociationsRequest& request, const GetBotChannelAssociationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBotVersionsAsyncHelper(const Model::GetBotVersionsRequest& request, const GetBotVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBotsAsyncHelper(const Model::GetBotsRequest& request, const GetBotsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBuiltinIntentAsyncHelper(const Model::GetBuiltinIntentRequest& request, const GetBuiltinIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBuiltinIntentsAsyncHelper(const Model::GetBuiltinIntentsRequest& request, const GetBuiltinIntentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetBuiltinSlotTypesAsyncHelper(const Model::GetBuiltinSlotTypesRequest& request, const GetBuiltinSlotTypesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetExportAsyncHelper(const Model::GetExportRequest& request, const GetExportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetImportAsyncHelper(const Model::GetImportRequest& request, const GetImportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetIntentAsyncHelper(const Model::GetIntentRequest& request, const GetIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetIntentVersionsAsyncHelper(const Model::GetIntentVersionsRequest& request, const GetIntentVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetIntentsAsyncHelper(const Model::GetIntentsRequest& request, const GetIntentsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetMigrationAsyncHelper(const Model::GetMigrationRequest& request, const GetMigrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetMigrationsAsyncHelper(const Model::GetMigrationsRequest& request, const GetMigrationsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetSlotTypeAsyncHelper(const Model::GetSlotTypeRequest& request, const GetSlotTypeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetSlotTypeVersionsAsyncHelper(const Model::GetSlotTypeVersionsRequest& request, const GetSlotTypeVersionsResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetSlotTypesAsyncHelper(const Model::GetSlotTypesRequest& request, const GetSlotTypesResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void GetUtterancesViewAsyncHelper(const Model::GetUtterancesViewRequest& request, const GetUtterancesViewResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void ListTagsForResourceAsyncHelper(const Model::ListTagsForResourceRequest& request, const ListTagsForResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void PutBotAsyncHelper(const Model::PutBotRequest& request, const PutBotResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void PutBotAliasAsyncHelper(const Model::PutBotAliasRequest& request, const PutBotAliasResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void PutIntentAsyncHelper(const Model::PutIntentRequest& request, const PutIntentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void PutSlotTypeAsyncHelper(const Model::PutSlotTypeRequest& request, const PutSlotTypeResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void StartImportAsyncHelper(const Model::StartImportRequest& request, const StartImportResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void StartMigrationAsyncHelper(const Model::StartMigrationRequest& request, const StartMigrationResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void TagResourceAsyncHelper(const Model::TagResourceRequest& request, const TagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; void UntagResourceAsyncHelper(const Model::UntagResourceRequest& request, const UntagResourceResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context) const; Aws::String m_uri; Aws::String m_configScheme; std::shared_ptr<Aws::Utils::Threading::Executor> m_executor; }; } // namespace LexModelBuildingService } // namespace Aws
{ "content_hash": "2f5cfb9c2303cf1e4c35009ea012b362", "timestamp": "", "source": "github", "line_count": 2169, "max_line_length": 285, "avg_line_length": 72.35131396957124, "alnum_prop": 0.6912636207226152, "repo_name": "awslabs/aws-sdk-cpp", "id": "e9c7c19866b1b6fd1d36e1efad79c7dcadea37f7", "size": "157049", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "aws-cpp-sdk-lex-models/include/aws/lex-models/LexModelBuildingServiceClient.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "7596" }, { "name": "C++", "bytes": "61740540" }, { "name": "CMake", "bytes": "337520" }, { "name": "Java", "bytes": "223122" }, { "name": "Python", "bytes": "47357" } ], "symlink_target": "" }
START_ATF_NAMESPACE namespace GUILD_BATTLE { namespace Detail { extern ::std::array<hook_record, 8> CReservedGuildScheduleDayGroup_functions; }; // end namespace Detail }; // end namespace GUILD_BATTLE END_ATF_NAMESPACE
{ "content_hash": "4e049dfa0761c5e0362911b01b94d5e6", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 89, "avg_line_length": 29.77777777777778, "alnum_prop": 0.6417910447761194, "repo_name": "goodwinxp/Yorozuya", "id": "57055eae69e574a11d86e215c447b39bfb8ae97e", "size": "484", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/ATF/GUILD_BATTLE__CReservedGuildScheduleDayGroupDetail.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "207291" }, { "name": "C++", "bytes": "21670817" } ], "symlink_target": "" }
package com.google.errorprone.bugpatterns; import com.google.errorprone.CompilationTestHelper; import org.junit.Before; import org.junit.Test; import java.io.File; /** * @author scottjohnson@google.com (Scott Johnson) */ public class NonRuntimeAnnotationTest { private CompilationTestHelper compilationHelper; @Before public void setUp() { compilationHelper = new CompilationTestHelper(NonRuntimeAnnotation.class); } @Test public void testPositiveCase() throws Exception { compilationHelper.assertCompileFailsWithMessages( new File(this.getClass().getResource("NonRuntimeAnnotationPositiveCases.java").toURI())); } @Test public void testNegativeCase() throws Exception { compilationHelper.assertCompileSucceeds( new File(this.getClass().getResource("NonRuntimeAnnotationNegativeCases.java").toURI())); } }
{ "content_hash": "0c6399416e408822720637e40ffa4531", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 97, "avg_line_length": 24.742857142857144, "alnum_prop": 0.7644341801385681, "repo_name": "sgoldfed/error-prone", "id": "f461738df762ccef3a995ada957258f3c6bf2682", "size": "1481", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "core/src/test/java/com/google/errorprone/bugpatterns/NonRuntimeAnnotationTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "701977" } ], "symlink_target": "" }
namespace Tests { using System.Linq; using System.Net.Http; using System.Security; using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; using Security.HMAC; using Xunit; public class InspectionMessageHandler : HttpMessageHandler { public HttpRequestMessage LastRequest { get; private set; } protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { LastRequest = request; var responseTask = new TaskCompletionSource<HttpResponseMessage>(); responseTask.SetResult(new HttpResponseMessage()); return responseTask.Task; } } public class HmacClientHandlerFacts { private const string appId = "app"; private static readonly SecureString secret = "qwerty".ToSecureString(); [Fact] public async void custom_headers_are_added_to_request() { using (InspectionMessageHandler inspector = new InspectionMessageHandler()) using (HmacClientHandler hmacHandler = new HmacClientHandler(inspector, appId, secret, new HmacSigningAlgorithm(sb => new HMACSHA256(sb)))) using (HttpClient client = new HttpClient(hmacHandler)) { await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost/foo")); var req = inspector.LastRequest; Assert.Equal(appId, req.Headers.GetValues(Headers.XClient).First()); Assert.False(string.IsNullOrWhiteSpace(req.Headers.GetValues(Headers.XNonce).FirstOrDefault())); } } [Fact] public async void authorization_header_is_set_with_correct_schema() { using (InspectionMessageHandler inspector = new InspectionMessageHandler()) using (HmacClientHandler hmacHandler = new HmacClientHandler(inspector, appId, secret, new HmacSigningAlgorithm(sb => new HMACSHA256(sb)))) using (HttpClient client = new HttpClient(hmacHandler)) { await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost/foo")); var req = inspector.LastRequest; Assert.Equal(Schemas.HMAC, req.Headers.Authorization.Scheme); } } [Fact] public async void authorization_header_parameter_is_not_null() { using (InspectionMessageHandler inspector = new InspectionMessageHandler()) using (HmacClientHandler hmacHandler = new HmacClientHandler(inspector, appId, secret, new HmacSigningAlgorithm(sb => new HMACSHA256(sb)))) using (HttpClient client = new HttpClient(hmacHandler)) { await client.SendAsync(new HttpRequestMessage(HttpMethod.Get, "http://localhost/foo")); var req = inspector.LastRequest; Assert.False(string.IsNullOrWhiteSpace(req.Headers.Authorization.Parameter)); } } } }
{ "content_hash": "72dac9f2eb31b32713bcae83302eba48", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 151, "avg_line_length": 39.64102564102564, "alnum_prop": 0.6503880983182406, "repo_name": "valdisz/hmac-security", "id": "917984e630bbeeec41de939af7919e25da68f871", "size": "3094", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "facts/HMACClientHandlerFacts.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "33834" }, { "name": "PowerShell", "bytes": "619" } ], "symlink_target": "" }
""" meuh.ctx ~~~~~~~~ """ from __future__ import absolute_import, print_function, unicode_literals __all__ = ['inline', 'EnvBuilder'] import abc import logging from six import add_metaclass from six.moves import shlex_quote as quote logger = logging.getLogger(__name__) @add_metaclass(abc.ABCMeta) class Param(object): pass class BuildOptionsParam(Param): """ see https://www.debian.org/doc/debian-policy/ch-source.html :ivar check: Run build-time test suite provided by the package :ivar optimize: Compile package with a maximum of optimization :ivar strip: Strip debugging symbols from the binary :ivar docs: Built docs :ivar parallel: Use n parallel processes to build package """ name = 'DEB_BUILD_OPTIONS' safe = True #: str representation is already quoted check = True docs = True optimize = True strip = True parallel = 1 def __init__(self, **opts): self.check = opts.pop('check', True) self.optimize = opts.pop('optimize', True) self.strip = opts.pop('strip', True) self.docs = opts.pop('docs', True) self.parallel = opts.pop('parallel', 1) if opts: logger.warn('Unknown options %', opts) @classmethod def from_env(cls, value): attrs = {} for flag in value.split(): if flag == 'nocheck': attrs['check'] = False elif flag == 'noopt': attrs['optimize'] = False elif flag == 'nostrip': attrs['strip'] = False elif flag == 'nodocs': attrs['docs'] = False elif flag.startswith('parallel='): attrs['parallel'] = int(flag[9:]) else: logger.warn('unknow flag %s ', flag) return cls(**attrs) def __str__(self): flags = [] if not self.check: flags.append('nocheck') if not self.optimize: flags.append('noopt') if not self.strip: flags.append('nostrip') if not self.docs: flags.append('nodocs') if self.parallel > 1: flags.append('parallel=%i' % self.parallel) return quote(' '.join(flags)) def __repr__(self): attrs = ('check', 'optimize', 'strip', 'docs', 'parallel') params = ['%s=%r' % (attr, getattr(self, attr, None)) for attr in attrs] # noqa return '<%s(%s)>' % (self.__class__.__name__, ' '.join(params)) class EnvBuilder(object): def set_arguments(self, parser): parser.add_argument('--no-check', dest='check', action='store_false', help='not build-time test') parser.add_argument('--no-optimization', dest='optimize', action='store_false', help='no optimization') parser.add_argument('--no-strip', dest='strip', action='store_false', help='keep debugging symbols into the binary') def parse(self, parsed_args): build_options = BuildOptionsParam( check=parsed_args.check, optimize=parsed_args.optimize, strip=parsed_args.strip ) env = { build_options.name: build_options } return env def inline(env): results = [] for key, value in env.items(): if value is None: value = '' if not getattr(value, 'safe', False): value = quote(value) results.append('%s=%s' % (key, value)) return ', '.join(results)
{ "content_hash": "a2e0fc96ce38a32013cccc2701a44e32", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 88, "avg_line_length": 29.72222222222222, "alnum_prop": 0.5268357810413885, "repo_name": "johnnoone/meuh-python", "id": "a79e98fc5fc9c740c213aaafba90cfde18ea0e49", "size": "3745", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "meuh/ctx.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "55403" } ], "symlink_target": "" }
using System; using System.Linq; using System.Collections.Generic; namespace TriggerSol.JStore { public class CachedFileDataStore : FileDataStore { object _Locker = new object(); internal protected override IPersistentBase LoadInternal(Type type, object mappingId) { lock (_Locker) { var valueStore = CacheProvider.GetRepositoryForType(type); if (!valueStore.ContainsKey(mappingId)) { var item = base.LoadInternal(type, mappingId); if (item == null) return null; valueStore.Add(item.MappingId, item); } return valueStore[mappingId]; } } internal protected override IEnumerable<IPersistentBase> LoadAllInternal(Type type) { if (!CacheProvider.TypesMap.Contains(type)) CacheProvider.StartCaching(type); return CacheProvider.GetRepositoryForType(type).Values.Where(p => p.GetType() == type); } internal protected override void SaveInternal(Type type, IPersistentBase item) { lock (_Locker) { base.SaveInternal(type, item); var clone = item.Clone(true); var valueStore = CacheProvider.GetRepositoryForType(type); if (valueStore.ContainsKey(clone.MappingId)) valueStore[clone.MappingId] = clone; else valueStore.Add(clone.MappingId, clone); } } internal protected override void DeleteInternal(Type type, object mappingId) { lock (_Locker) { var valueStore = CacheProvider.GetRepositoryForType(type); if (valueStore.ContainsKey(mappingId)) valueStore.Remove(mappingId); base.DeleteInternal(type, mappingId); } } internal protected override string GetTargetLocation(Type type) => base.GetTargetLocation(type); } }
{ "content_hash": "7cc6f97aa79f6fe2ec1365efa000561f", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 104, "avg_line_length": 30.225352112676056, "alnum_prop": 0.5577819198508853, "repo_name": "SourceHollandaise/TriggerSol", "id": "da843ef366db8f58421cd9d413cfc607cd9d8456", "size": "3348", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "TriggerSol.JStore/Store/CachedFileDataStore.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "193056" } ], "symlink_target": "" }
/** * Test case for fontStyleElm. * Runs with mocha. */ 'use strict' const fontStyleElm = require('../lib/element/font_style_elm.js') const assert = require('assert') describe('font-style-elm', () => { before(async () => { }) after(async () => { }) it('Font style elm', async () => { }) }) /* global describe, before, after, it */
{ "content_hash": "6dcf448d1bd5b50200f7bd8a1c27733d", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 64, "avg_line_length": 14.2, "alnum_prop": 0.5746478873239437, "repo_name": "okunishinishi/node-fur", "id": "53a3d428acf3a486f6f15af58c7da94ea6a83850", "size": "355", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "test/font_style_elm_test.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "282" }, { "name": "JavaScript", "bytes": "24392" } ], "symlink_target": "" }
package main import ( "net/http" "os" "os/signal" "github.com/gorilla/mux" "syscall" ) func Router () { sigchan := make(chan os.Signal, 1) signal.Notify(sigchan, os.Interrupt) signal.Notify(sigchan, syscall.SIGTERM) // start the router go func() { r := mux.NewRouter() r.HandleFunc("/path/to/", HTTPFunc).Methods("GET") if err := http.ListenAndServe(":"+CFG.HttpPort, r); err != nil { log("ListenAndServer", err.Error()) } }() <-sigchan }
{ "content_hash": "74b2aa83d4944a4f00db9c1aaef66e98", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 72, "avg_line_length": 19.142857142857142, "alnum_prop": 0.5578358208955224, "repo_name": "leonkunert/gobase", "id": "6e5801784e76d1ea32902ab3ec8d50fd8f03c66c", "size": "536", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "router.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "3166" } ], "symlink_target": "" }
<template> <a href="#demo" b-button="b-style:info" b-collapse>Simple collapsible</a> <b-collapsible b-id="demo"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </b-collapsible> <br/><br/> <a href="#demoShown" b-button="b-style:info" b-collapse>Simple collapsible</a> <b-collapsible b-id="demoShown" b-expanded.bind="shownContent"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </b-collapsible> <template>
{ "content_hash": "5d4405d5890dc08a3e50d0b7000088a3", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 132, "avg_line_length": 49.94117647058823, "alnum_prop": 0.7149587750294464, "repo_name": "aurelia-ui-toolkits/aurelia-bootstrap-bridge", "id": "1805b2e8a838714974bebc76cece052c12968148", "size": "849", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sample/src/samples/collapse/simple-collapse.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "3996" }, { "name": "HTML", "bytes": "38341" }, { "name": "JavaScript", "bytes": "79468" } ], "symlink_target": "" }
module Promo class Usage class << self # Validates the use of any promocode # Options (Hash): # code: string with the code used # product_list: array with the products to be evaluated def validate (options={}) promocode = Promo::Promocode.where(code: options[:code]).first raise InvalidPromocode.new 'promocode.messages.invalid' if promocode.nil? promocode.is_valid? options end # Calculates the discounts to any list of products # Options (Hash): # promocode: Pomo::Promocode object # product_list: array with the products to be evaluated def discount_for (options={}) return 0 if options[:promocode].nil? promocode = options[:promocode] product_list = options[:product_list] return discount_for_product(promocode, product_list) if promocode.has_product? if promocode.is_percentage? calculate_percentage product_list.map(&:value).reduce(:+), promocode.value else promocode.value end end # Calculates the dicount for a specific product in the list # previously associated with the current promocode # Parameters: # promocode: Pomo::Promocode object # product_list: array with the products to be evaluated def discount_for_product promocode, product_list product = promocode.product return 0 unless product_list.include? product if promocode.is_percentage? calculate_percentage(product.value,promocode.value) else promocode.value end end #calculates the percentage to a specific value def calculate_percentage(value, percent) (value * (percent.to_f/100)).to_i end end end end
{ "content_hash": "d6286f4ba1e9aa08fce0857921bf2c6e", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 86, "avg_line_length": 34.55769230769231, "alnum_prop": 0.6471897607122983, "repo_name": "x1s/promo", "id": "23947682134a93735e9c49b1204e32ea3c02915c", "size": "1797", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/promo/usage.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "10877" } ], "symlink_target": "" }
class AddRepoIdToIssue < ActiveRecord::Migration def change add_column :issues, :repo_id, :integer end end
{ "content_hash": "5076a4abd626e70aac6ec2c9156978aa", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 48, "avg_line_length": 22.8, "alnum_prop": 0.7456140350877193, "repo_name": "pat-whitrock/gitshoes", "id": "ac5c9d5fd933cc8039c607152746708c941481cb", "size": "114", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "db/migrate/20140401160723_add_repo_id_to_issue.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5410" }, { "name": "CoffeeScript", "bytes": "2107" }, { "name": "JavaScript", "bytes": "102882" }, { "name": "Ruby", "bytes": "70417" } ], "symlink_target": "" }
<form class="form-inline"> <div class="form-group"> <div class="input-group"> <input class="form-control" placeholder="yyyy-mm-dd" name="dp" [(ngModel)]="model" ngbDatepicker #d="ngbDatepicker"> <div class="input-group-append"> <button class="btn btn-outline-secondary" (click)="d.toggle()" type="button"> <img src="img/calendar-icon.svg" style="width: 1.2rem; height: 1rem; cursor: pointer;"/> </button> </div> </div> </div> </form> <hr/> <pre>Model: {{ model | json }}</pre>
{ "content_hash": "3789f05d5d9a094f823ae6f653f4879b", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 98, "avg_line_length": 34.1875, "alnum_prop": 0.5868372943327239, "repo_name": "Foxandxss/ng-bootstrap", "id": "4cdaad66cc7cfa130aa324fe7d2b9881fd5aa07b", "size": "547", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "demo/src/app/components/datepicker/demos/popup/datepicker-popup.html", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "57715" }, { "name": "Shell", "bytes": "2096" }, { "name": "TypeScript", "bytes": "899371" } ], "symlink_target": "" }
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="willy.xsl"?> <PLAY> <TITLE>The Tragedy of Hamlet, Prince of Denmark</TITLE> <FM> <P>ASCII text placed in the public domain by Moby Lexical Tools, 1992.</P> <P>SGML markup by Jon Bosak, 1992-1994.</P> <P>XML version by Jon Bosak, 1996-1999.</P> <P>The XML markup in this version is Copyright &#169; 1999 Jon Bosak. This work may freely be distributed on condition that it not be modified or altered in any way.</P> </FM> <PERSONAE> <TITLE>Dramatis Personae</TITLE> <PERSONA>CLAUDIUS, king of Denmark. </PERSONA> <PERSONA>HAMLET, son to the late, and nephew to the present king.</PERSONA> <PERSONA>POLONIUS, lord chamberlain. </PERSONA> <PERSONA>HORATIO, friend to Hamlet.</PERSONA> <PERSONA>LAERTES, son to Polonius.</PERSONA> <PERSONA>LUCIANUS, nephew to the king.</PERSONA> <PGROUP> <PERSONA>VOLTIMAND</PERSONA> <PERSONA>CORNELIUS</PERSONA> <PERSONA>ROSENCRANTZ</PERSONA> <PERSONA>GUILDENSTERN</PERSONA> <PERSONA>OSRIC</PERSONA> <GRPDESCR>courtiers.</GRPDESCR> </PGROUP> <PERSONA>A Gentleman</PERSONA> <PERSONA>A Priest. </PERSONA> <PGROUP> <PERSONA>MARCELLUS</PERSONA> <PERSONA>BERNARDO</PERSONA> <GRPDESCR>officers.</GRPDESCR> </PGROUP> <PERSONA>FRANCISCO, a soldier.</PERSONA> <PERSONA>REYNALDO, servant to Polonius.</PERSONA> <PERSONA>Players.</PERSONA> <PERSONA>Two Clowns, grave-diggers.</PERSONA> <PERSONA>FORTINBRAS, prince of Norway. </PERSONA> <PERSONA>A Captain.</PERSONA> <PERSONA>English Ambassadors. </PERSONA> <PERSONA>GERTRUDE, queen of Denmark, and mother to Hamlet. </PERSONA> <PERSONA>OPHELIA, daughter to Polonius.</PERSONA> <PERSONA>Lords, Ladies, Officers, Soldiers, Sailors, Messengers, and other Attendants.</PERSONA> <PERSONA>Ghost of Hamlet's Father. </PERSONA> </PERSONAE> <SCNDESCR>SCENE Denmark.</SCNDESCR> <PLAYSUBT>HAMLET</PLAYSUBT> <ACT><TITLE>ACT I</TITLE> <SCENE><TITLE>SCENE I. Elsinore. A platform before the castle.</TITLE> <STAGEDIR>FRANCISCO at his post. Enter to him BERNARDO</STAGEDIR> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Who's there?</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>Nay, answer me: stand, and unfold yourself.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Long live the king!</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>Bernardo?</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>He.</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>You come most carefully upon your hour.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>'Tis now struck twelve; get thee to bed, Francisco.</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>For this relief much thanks: 'tis bitter cold,</LINE> <LINE>And I am sick at heart.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Have you had quiet guard?</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>Not a mouse stirring.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Well, good night.</LINE> <LINE>If you do meet Horatio and Marcellus,</LINE> <LINE>The rivals of my watch, bid them make haste.</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>I think I hear them. Stand, ho! Who's there?</LINE> </SPEECH> <STAGEDIR>Enter HORATIO and MARCELLUS</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Friends to this ground.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>And liegemen to the Dane.</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>Give you good night.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>O, farewell, honest soldier:</LINE> <LINE>Who hath relieved you?</LINE> </SPEECH> <SPEECH> <SPEAKER>FRANCISCO</SPEAKER> <LINE>Bernardo has my place.</LINE> <LINE>Give you good night.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Holla! Bernardo!</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Say,</LINE> <LINE>What, is Horatio there?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>A piece of him.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Welcome, Horatio: welcome, good Marcellus.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>What, has this thing appear'd again to-night?</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>I have seen nothing.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Horatio says 'tis but our fantasy,</LINE> <LINE>And will not let belief take hold of him</LINE> <LINE>Touching this dreaded sight, twice seen of us:</LINE> <LINE>Therefore I have entreated him along</LINE> <LINE>With us to watch the minutes of this night;</LINE> <LINE>That if again this apparition come,</LINE> <LINE>He may approve our eyes and speak to it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Tush, tush, 'twill not appear.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Sit down awhile;</LINE> <LINE>And let us once again assail your ears,</LINE> <LINE>That are so fortified against our story</LINE> <LINE>What we have two nights seen.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Well, sit we down,</LINE> <LINE>And let us hear Bernardo speak of this.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Last night of all,</LINE> <LINE>When yond same star that's westward from the pole</LINE> <LINE>Had made his course to illume that part of heaven</LINE> <LINE>Where now it burns, Marcellus and myself,</LINE> <LINE>The bell then beating one,--</LINE> </SPEECH> <STAGEDIR>Enter Ghost</STAGEDIR> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Peace, break thee off; look, where it comes again!</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>In the same figure, like the king that's dead.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Thou art a scholar; speak to it, Horatio.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>Looks it not like the king? mark it, Horatio.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Most like: it harrows me with fear and wonder.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>It would be spoke to.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Question it, Horatio.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>What art thou that usurp'st this time of night,</LINE> <LINE>Together with that fair and warlike form</LINE> <LINE>In which the majesty of buried Denmark</LINE> <LINE>Did sometimes march? by heaven I charge thee, speak!</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>It is offended.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>See, it stalks away!</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Stay! speak, speak! I charge thee, speak!</LINE> </SPEECH> <STAGEDIR>Exit Ghost</STAGEDIR> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>'Tis gone, and will not answer.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>How now, Horatio! you tremble and look pale:</LINE> <LINE>Is not this something more than fantasy?</LINE> <LINE>What think you on't?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Before my God, I might not this believe</LINE> <LINE>Without the sensible and true avouch</LINE> <LINE>Of mine own eyes.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Is it not like the king?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>As thou art to thyself:</LINE> <LINE>Such was the very armour he had on</LINE> <LINE>When he the ambitious Norway combated;</LINE> <LINE>So frown'd he once, when, in an angry parle,</LINE> <LINE>He smote the sledded Polacks on the ice.</LINE> <LINE>'Tis strange.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Thus twice before, and jump at this dead hour,</LINE> <LINE>With martial stalk hath he gone by our watch.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>In what particular thought to work I know not;</LINE> <LINE>But in the gross and scope of my opinion,</LINE> <LINE>This bodes some strange eruption to our state.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Good now, sit down, and tell me, he that knows,</LINE> <LINE>Why this same strict and most observant watch</LINE> <LINE>So nightly toils the subject of the land,</LINE> <LINE>And why such daily cast of brazen cannon,</LINE> <LINE>And foreign mart for implements of war;</LINE> <LINE>Why such impress of shipwrights, whose sore task</LINE> <LINE>Does not divide the Sunday from the week;</LINE> <LINE>What might be toward, that this sweaty haste</LINE> <LINE>Doth make the night joint-labourer with the day:</LINE> <LINE>Who is't that can inform me?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>That can I;</LINE> <LINE>At least, the whisper goes so. Our last king,</LINE> <LINE>Whose image even but now appear'd to us,</LINE> <LINE>Was, as you know, by Fortinbras of Norway,</LINE> <LINE>Thereto prick'd on by a most emulate pride,</LINE> <LINE>Dared to the combat; in which our valiant Hamlet--</LINE> <LINE>For so this side of our known world esteem'd him--</LINE> <LINE>Did slay this Fortinbras; who by a seal'd compact,</LINE> <LINE>Well ratified by law and heraldry,</LINE> <LINE>Did forfeit, with his life, all those his lands</LINE> <LINE>Which he stood seized of, to the conqueror:</LINE> <LINE>Against the which, a moiety competent</LINE> <LINE>Was gaged by our king; which had return'd</LINE> <LINE>To the inheritance of Fortinbras,</LINE> <LINE>Had he been vanquisher; as, by the same covenant,</LINE> <LINE>And carriage of the article design'd,</LINE> <LINE>His fell to Hamlet. Now, sir, young Fortinbras,</LINE> <LINE>Of unimproved mettle hot and full,</LINE> <LINE>Hath in the skirts of Norway here and there</LINE> <LINE>Shark'd up a list of lawless resolutes,</LINE> <LINE>For food and diet, to some enterprise</LINE> <LINE>That hath a stomach in't; which is no other--</LINE> <LINE>As it doth well appear unto our state--</LINE> <LINE>But to recover of us, by strong hand</LINE> <LINE>And terms compulsatory, those foresaid lands</LINE> <LINE>So by his father lost: and this, I take it,</LINE> <LINE>Is the main motive of our preparations,</LINE> <LINE>The source of this our watch and the chief head</LINE> <LINE>Of this post-haste and romage in the land.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>I think it be no other but e'en so:</LINE> <LINE>Well may it sort that this portentous figure</LINE> <LINE>Comes armed through our watch; so like the king</LINE> <LINE>That was and is the question of these wars.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>A mote it is to trouble the mind's eye.</LINE> <LINE>In the most high and palmy state of Rome,</LINE> <LINE>A little ere the mightiest Julius fell,</LINE> <LINE>The graves stood tenantless and the sheeted dead</LINE> <LINE>Did squeak and gibber in the Roman streets:</LINE> <LINE>As stars with trains of fire and dews of blood,</LINE> <LINE>Disasters in the sun; and the moist star</LINE> <LINE>Upon whose influence Neptune's empire stands</LINE> <LINE>Was sick almost to doomsday with eclipse:</LINE> <LINE>And even the like precurse of fierce events,</LINE> <LINE>As harbingers preceding still the fates</LINE> <LINE>And prologue to the omen coming on,</LINE> <LINE>Have heaven and earth together demonstrated</LINE> <LINE>Unto our climatures and countrymen.--</LINE> <LINE>But soft, behold! lo, where it comes again!</LINE> <STAGEDIR>Re-enter Ghost</STAGEDIR> <LINE>I'll cross it, though it blast me. Stay, illusion!</LINE> <LINE>If thou hast any sound, or use of voice,</LINE> <LINE>Speak to me:</LINE> <LINE>If there be any good thing to be done,</LINE> <LINE>That may to thee do ease and grace to me,</LINE> <LINE>Speak to me:</LINE> <STAGEDIR>Cock crows</STAGEDIR> <LINE>If thou art privy to thy country's fate,</LINE> <LINE>Which, happily, foreknowing may avoid, O, speak!</LINE> <LINE>Or if thou hast uphoarded in thy life</LINE> <LINE>Extorted treasure in the womb of earth,</LINE> <LINE>For which, they say, you spirits oft walk in death,</LINE> <LINE>Speak of it: stay, and speak! Stop it, Marcellus.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Shall I strike at it with my partisan?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Do, if it will not stand.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>'Tis here!</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>'Tis here!</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>'Tis gone!</LINE> <STAGEDIR>Exit Ghost</STAGEDIR> <LINE>We do it wrong, being so majestical,</LINE> <LINE>To offer it the show of violence;</LINE> <LINE>For it is, as the air, invulnerable,</LINE> <LINE>And our vain blows malicious mockery.</LINE> </SPEECH> <SPEECH> <SPEAKER>BERNARDO</SPEAKER> <LINE>It was about to speak, when the cock crew.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>And then it started like a guilty thing</LINE> <LINE>Upon a fearful summons. I have heard,</LINE> <LINE>The cock, that is the trumpet to the morn,</LINE> <LINE>Doth with his lofty and shrill-sounding throat</LINE> <LINE>Awake the god of day; and, at his warning,</LINE> <LINE>Whether in sea or fire, in earth or air,</LINE> <LINE>The extravagant and erring spirit hies</LINE> <LINE>To his confine: and of the truth herein</LINE> <LINE>This present object made probation.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>It faded on the crowing of the cock.</LINE> <LINE>Some say that ever 'gainst that season comes</LINE> <LINE>Wherein our Saviour's birth is celebrated,</LINE> <LINE>The bird of dawning singeth all night long:</LINE> <LINE>And then, they say, no spirit dares stir abroad;</LINE> <LINE>The nights are wholesome; then no planets strike,</LINE> <LINE>No fairy takes, nor witch hath power to charm,</LINE> <LINE>So hallow'd and so gracious is the time.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>So have I heard and do in part believe it.</LINE> <LINE>But, look, the morn, in russet mantle clad,</LINE> <LINE>Walks o'er the dew of yon high eastward hill:</LINE> <LINE>Break we our watch up; and by my advice,</LINE> <LINE>Let us impart what we have seen to-night</LINE> <LINE>Unto young Hamlet; for, upon my life,</LINE> <LINE>This spirit, dumb to us, will speak to him.</LINE> <LINE>Do you consent we shall acquaint him with it,</LINE> <LINE>As needful in our loves, fitting our duty?</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Let's do't, I pray; and I this morning know</LINE> <LINE>Where we shall find him most conveniently.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE II. A room of state in the castle.</TITLE> <STAGEDIR>Enter KING CLAUDIUS, QUEEN GERTRUDE, HAMLET, POLONIUS, LAERTES, VOLTIMAND, CORNELIUS, Lords, and Attendants</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Though yet of Hamlet our dear brother's death</LINE> <LINE>The memory be green, and that it us befitted</LINE> <LINE>To bear our hearts in grief and our whole kingdom</LINE> <LINE>To be contracted in one brow of woe,</LINE> <LINE>Yet so far hath discretion fought with nature</LINE> <LINE>That we with wisest sorrow think on him,</LINE> <LINE>Together with remembrance of ourselves.</LINE> <LINE>Therefore our sometime sister, now our queen,</LINE> <LINE>The imperial jointress to this warlike state,</LINE> <LINE>Have we, as 'twere with a defeated joy,--</LINE> <LINE>With an auspicious and a dropping eye,</LINE> <LINE>With mirth in funeral and with dirge in marriage,</LINE> <LINE>In equal scale weighing delight and dole,--</LINE> <LINE>Taken to wife: nor have we herein barr'd</LINE> <LINE>Your better wisdoms, which have freely gone</LINE> <LINE>With this affair along. For all, our thanks.</LINE> <LINE>Now follows, that you know, young Fortinbras,</LINE> <LINE>Holding a weak supposal of our worth,</LINE> <LINE>Or thinking by our late dear brother's death</LINE> <LINE>Our state to be disjoint and out of frame,</LINE> <LINE>Colleagued with the dream of his advantage,</LINE> <LINE>He hath not fail'd to pester us with message,</LINE> <LINE>Importing the surrender of those lands</LINE> <LINE>Lost by his father, with all bonds of law,</LINE> <LINE>To our most valiant brother. So much for him.</LINE> <LINE>Now for ourself and for this time of meeting:</LINE> <LINE>Thus much the business is: we have here writ</LINE> <LINE>To Norway, uncle of young Fortinbras,--</LINE> <LINE>Who, impotent and bed-rid, scarcely hears</LINE> <LINE>Of this his nephew's purpose,--to suppress</LINE> <LINE>His further gait herein; in that the levies,</LINE> <LINE>The lists and full proportions, are all made</LINE> <LINE>Out of his subject: and we here dispatch</LINE> <LINE>You, good Cornelius, and you, Voltimand,</LINE> <LINE>For bearers of this greeting to old Norway;</LINE> <LINE>Giving to you no further personal power</LINE> <LINE>To business with the king, more than the scope</LINE> <LINE>Of these delated articles allow.</LINE> <LINE>Farewell, and let your haste commend your duty.</LINE> </SPEECH> <SPEECH> <SPEAKER>CORNELIUS</SPEAKER> <SPEAKER>VOLTIMAND</SPEAKER> <LINE>In that and all things will we show our duty.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>We doubt it nothing: heartily farewell.</LINE> <STAGEDIR>Exeunt VOLTIMAND and CORNELIUS</STAGEDIR> <LINE>And now, Laertes, what's the news with you?</LINE> <LINE>You told us of some suit; what is't, Laertes?</LINE> <LINE>You cannot speak of reason to the Dane,</LINE> <LINE>And loose your voice: what wouldst thou beg, Laertes,</LINE> <LINE>That shall not be my offer, not thy asking?</LINE> <LINE>The head is not more native to the heart,</LINE> <LINE>The hand more instrumental to the mouth,</LINE> <LINE>Than is the throne of Denmark to thy father.</LINE> <LINE>What wouldst thou have, Laertes?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>My dread lord,</LINE> <LINE>Your leave and favour to return to France;</LINE> <LINE>From whence though willingly I came to Denmark,</LINE> <LINE>To show my duty in your coronation,</LINE> <LINE>Yet now, I must confess, that duty done,</LINE> <LINE>My thoughts and wishes bend again toward France</LINE> <LINE>And bow them to your gracious leave and pardon.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Have you your father's leave? What says Polonius?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>He hath, my lord, wrung from me my slow leave</LINE> <LINE>By laboursome petition, and at last</LINE> <LINE>Upon his will I seal'd my hard consent:</LINE> <LINE>I do beseech you, give him leave to go.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Take thy fair hour, Laertes; time be thine,</LINE> <LINE>And thy best graces spend it at thy will!</LINE> <LINE>But now, my cousin Hamlet, and my son,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> A little more than kin, and less than kind.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>How is it that the clouds still hang on you?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Not so, my lord; I am too much i' the sun.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Good Hamlet, cast thy nighted colour off,</LINE> <LINE>And let thine eye look like a friend on Denmark.</LINE> <LINE>Do not for ever with thy vailed lids</LINE> <LINE>Seek for thy noble father in the dust:</LINE> <LINE>Thou know'st 'tis common; all that lives must die,</LINE> <LINE>Passing through nature to eternity.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, madam, it is common.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>If it be,</LINE> <LINE>Why seems it so particular with thee?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Seems, madam! nay it is; I know not 'seems.'</LINE> <LINE>'Tis not alone my inky cloak, good mother,</LINE> <LINE>Nor customary suits of solemn black,</LINE> <LINE>Nor windy suspiration of forced breath,</LINE> <LINE>No, nor the fruitful river in the eye,</LINE> <LINE>Nor the dejected 'havior of the visage,</LINE> <LINE>Together with all forms, moods, shapes of grief,</LINE> <LINE>That can denote me truly: these indeed seem,</LINE> <LINE>For they are actions that a man might play:</LINE> <LINE>But I have that within which passeth show;</LINE> <LINE>These but the trappings and the suits of woe.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>'Tis sweet and commendable in your nature, Hamlet,</LINE> <LINE>To give these mourning duties to your father:</LINE> <LINE>But, you must know, your father lost a father;</LINE> <LINE>That father lost, lost his, and the survivor bound</LINE> <LINE>In filial obligation for some term</LINE> <LINE>To do obsequious sorrow: but to persever</LINE> <LINE>In obstinate condolement is a course</LINE> <LINE>Of impious stubbornness; 'tis unmanly grief;</LINE> <LINE>It shows a will most incorrect to heaven,</LINE> <LINE>A heart unfortified, a mind impatient,</LINE> <LINE>An understanding simple and unschool'd:</LINE> <LINE>For what we know must be and is as common</LINE> <LINE>As any the most vulgar thing to sense,</LINE> <LINE>Why should we in our peevish opposition</LINE> <LINE>Take it to heart? Fie! 'tis a fault to heaven,</LINE> <LINE>A fault against the dead, a fault to nature,</LINE> <LINE>To reason most absurd: whose common theme</LINE> <LINE>Is death of fathers, and who still hath cried,</LINE> <LINE>From the first corse till he that died to-day,</LINE> <LINE>'This must be so.' We pray you, throw to earth</LINE> <LINE>This unprevailing woe, and think of us</LINE> <LINE>As of a father: for let the world take note,</LINE> <LINE>You are the most immediate to our throne;</LINE> <LINE>And with no less nobility of love</LINE> <LINE>Than that which dearest father bears his son,</LINE> <LINE>Do I impart toward you. For your intent</LINE> <LINE>In going back to school in Wittenberg,</LINE> <LINE>It is most retrograde to our desire:</LINE> <LINE>And we beseech you, bend you to remain</LINE> <LINE>Here, in the cheer and comfort of our eye,</LINE> <LINE>Our chiefest courtier, cousin, and our son.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Let not thy mother lose her prayers, Hamlet:</LINE> <LINE>I pray thee, stay with us; go not to Wittenberg.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I shall in all my best obey you, madam.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Why, 'tis a loving and a fair reply:</LINE> <LINE>Be as ourself in Denmark. Madam, come;</LINE> <LINE>This gentle and unforced accord of Hamlet</LINE> <LINE>Sits smiling to my heart: in grace whereof,</LINE> <LINE>No jocund health that Denmark drinks to-day,</LINE> <LINE>But the great cannon to the clouds shall tell,</LINE> <LINE>And the king's rouse the heavens all bruit again,</LINE> <LINE>Re-speaking earthly thunder. Come away.</LINE> </SPEECH> <STAGEDIR>Exeunt all but HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O, that this too too solid flesh would melt</LINE> <LINE>Thaw and resolve itself into a dew!</LINE> <LINE>Or that the Everlasting had not fix'd</LINE> <LINE>His canon 'gainst self-slaughter! O God! God!</LINE> <LINE>How weary, stale, flat and unprofitable,</LINE> <LINE>Seem to me all the uses of this world!</LINE> <LINE>Fie on't! ah fie! 'tis an unweeded garden,</LINE> <LINE>That grows to seed; things rank and gross in nature</LINE> <LINE>Possess it merely. That it should come to this!</LINE> <LINE>But two months dead: nay, not so much, not two:</LINE> <LINE>So excellent a king; that was, to this,</LINE> <LINE>Hyperion to a satyr; so loving to my mother</LINE> <LINE>That he might not beteem the winds of heaven</LINE> <LINE>Visit her face too roughly. Heaven and earth!</LINE> <LINE>Must I remember? why, she would hang on him,</LINE> <LINE>As if increase of appetite had grown</LINE> <LINE>By what it fed on: and yet, within a month--</LINE> <LINE>Let me not think on't--Frailty, thy name is woman!--</LINE> <LINE>A little month, or ere those shoes were old</LINE> <LINE>With which she follow'd my poor father's body,</LINE> <LINE>Like Niobe, all tears:--why she, even she--</LINE> <LINE>O, God! a beast, that wants discourse of reason,</LINE> <LINE>Would have mourn'd longer--married with my uncle,</LINE> <LINE>My father's brother, but no more like my father</LINE> <LINE>Than I to Hercules: within a month:</LINE> <LINE>Ere yet the salt of most unrighteous tears</LINE> <LINE>Had left the flushing in her galled eyes,</LINE> <LINE>She married. O, most wicked speed, to post</LINE> <LINE>With such dexterity to incestuous sheets!</LINE> <LINE>It is not nor it cannot come to good:</LINE> <LINE>But break, my heart; for I must hold my tongue.</LINE> </SPEECH> <STAGEDIR>Enter HORATIO, MARCELLUS, and BERNARDO</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Hail to your lordship!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I am glad to see you well:</LINE> <LINE>Horatio,--or I do forget myself.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>The same, my lord, and your poor servant ever.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Sir, my good friend; I'll change that name with you:</LINE> <LINE>And what make you from Wittenberg, Horatio? Marcellus?</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>My good lord--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I am very glad to see you. Good even, sir.</LINE> <LINE>But what, in faith, make you from Wittenberg?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>A truant disposition, good my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I would not hear your enemy say so,</LINE> <LINE>Nor shall you do mine ear that violence,</LINE> <LINE>To make it truster of your own report</LINE> <LINE>Against yourself: I know you are no truant.</LINE> <LINE>But what is your affair in Elsinore?</LINE> <LINE>We'll teach you to drink deep ere you depart.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>My lord, I came to see your father's funeral.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I pray thee, do not mock me, fellow-student;</LINE> <LINE>I think it was to see my mother's wedding.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Indeed, my lord, it follow'd hard upon.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Thrift, thrift, Horatio! the funeral baked meats</LINE> <LINE>Did coldly furnish forth the marriage tables.</LINE> <LINE>Would I had met my dearest foe in heaven</LINE> <LINE>Or ever I had seen that day, Horatio!</LINE> <LINE>My father!--methinks I see my father.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Where, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>In my mind's eye, Horatio.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>I saw him once; he was a goodly king.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>He was a man, take him for all in all,</LINE> <LINE>I shall not look upon his like again.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>My lord, I think I saw him yesternight.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Saw? who?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>My lord, the king your father.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The king my father!</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Season your admiration for awhile</LINE> <LINE>With an attent ear, till I may deliver,</LINE> <LINE>Upon the witness of these gentlemen,</LINE> <LINE>This marvel to you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>For God's love, let me hear.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Two nights together had these gentlemen,</LINE> <LINE>Marcellus and Bernardo, on their watch,</LINE> <LINE>In the dead vast and middle of the night,</LINE> <LINE>Been thus encounter'd. A figure like your father,</LINE> <LINE>Armed at point exactly, cap-a-pe,</LINE> <LINE>Appears before them, and with solemn march</LINE> <LINE>Goes slow and stately by them: thrice he walk'd</LINE> <LINE>By their oppress'd and fear-surprised eyes,</LINE> <LINE>Within his truncheon's length; whilst they, distilled</LINE> <LINE>Almost to jelly with the act of fear,</LINE> <LINE>Stand dumb and speak not to him. This to me</LINE> <LINE>In dreadful secrecy impart they did;</LINE> <LINE>And I with them the third night kept the watch;</LINE> <LINE>Where, as they had deliver'd, both in time,</LINE> <LINE>Form of the thing, each word made true and good,</LINE> <LINE>The apparition comes: I knew your father;</LINE> <LINE>These hands are not more like.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>But where was this?</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>My lord, upon the platform where we watch'd.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Did you not speak to it?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>My lord, I did;</LINE> <LINE>But answer made it none: yet once methought</LINE> <LINE>It lifted up its head and did address</LINE> <LINE>Itself to motion, like as it would speak;</LINE> <LINE>But even then the morning cock crew loud,</LINE> <LINE>And at the sound it shrunk in haste away,</LINE> <LINE>And vanish'd from our sight.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>'Tis very strange.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>As I do live, my honour'd lord, 'tis true;</LINE> <LINE>And we did think it writ down in our duty</LINE> <LINE>To let you know of it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Indeed, indeed, sirs, but this troubles me.</LINE> <LINE>Hold you the watch to-night?</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <SPEAKER>BERNARDO</SPEAKER> <LINE>We do, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Arm'd, say you?</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <SPEAKER>BERNARDO</SPEAKER> <LINE>Arm'd, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>From top to toe?</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <SPEAKER>BERNARDO</SPEAKER> <LINE>My lord, from head to foot.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Then saw you not his face?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>O, yes, my lord; he wore his beaver up.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What, look'd he frowningly?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>A countenance more in sorrow than in anger.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Pale or red?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Nay, very pale.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>And fix'd his eyes upon you?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Most constantly.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I would I had been there.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>It would have much amazed you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Very like, very like. Stay'd it long?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>While one with moderate haste might tell a hundred.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <SPEAKER>BERNARDO</SPEAKER> <LINE>Longer, longer.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Not when I saw't.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>His beard was grizzled--no?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>It was, as I have seen it in his life,</LINE> <LINE>A sable silver'd.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I will watch to-night;</LINE> <LINE>Perchance 'twill walk again.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>I warrant it will.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>If it assume my noble father's person,</LINE> <LINE>I'll speak to it, though hell itself should gape</LINE> <LINE>And bid me hold my peace. I pray you all,</LINE> <LINE>If you have hitherto conceal'd this sight,</LINE> <LINE>Let it be tenable in your silence still;</LINE> <LINE>And whatsoever else shall hap to-night,</LINE> <LINE>Give it an understanding, but no tongue:</LINE> <LINE>I will requite your loves. So, fare you well:</LINE> <LINE>Upon the platform, 'twixt eleven and twelve,</LINE> <LINE>I'll visit you.</LINE> </SPEECH> <SPEECH> <SPEAKER>All</SPEAKER> <LINE>Our duty to your honour.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Your loves, as mine to you: farewell.</LINE> <STAGEDIR>Exeunt all but HAMLET</STAGEDIR> <LINE>My father's spirit in arms! all is not well;</LINE> <LINE>I doubt some foul play: would the night were come!</LINE> <LINE>Till then sit still, my soul: foul deeds will rise,</LINE> <LINE>Though all the earth o'erwhelm them, to men's eyes.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE III. A room in Polonius' house.</TITLE> <STAGEDIR>Enter LAERTES and OPHELIA</STAGEDIR> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>My necessaries are embark'd: farewell:</LINE> <LINE>And, sister, as the winds give benefit</LINE> <LINE>And convoy is assistant, do not sleep,</LINE> <LINE>But let me hear from you.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Do you doubt that?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>For Hamlet and the trifling of his favour,</LINE> <LINE>Hold it a fashion and a toy in blood,</LINE> <LINE>A violet in the youth of primy nature,</LINE> <LINE>Forward, not permanent, sweet, not lasting,</LINE> <LINE>The perfume and suppliance of a minute; No more.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>No more but so?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Think it no more;</LINE> <LINE>For nature, crescent, does not grow alone</LINE> <LINE>In thews and bulk, but, as this temple waxes,</LINE> <LINE>The inward service of the mind and soul</LINE> <LINE>Grows wide withal. Perhaps he loves you now,</LINE> <LINE>And now no soil nor cautel doth besmirch</LINE> <LINE>The virtue of his will: but you must fear,</LINE> <LINE>His greatness weigh'd, his will is not his own;</LINE> <LINE>For he himself is subject to his birth:</LINE> <LINE>He may not, as unvalued persons do,</LINE> <LINE>Carve for himself; for on his choice depends</LINE> <LINE>The safety and health of this whole state;</LINE> <LINE>And therefore must his choice be circumscribed</LINE> <LINE>Unto the voice and yielding of that body</LINE> <LINE>Whereof he is the head. Then if he says he loves you,</LINE> <LINE>It fits your wisdom so far to believe it</LINE> <LINE>As he in his particular act and place</LINE> <LINE>May give his saying deed; which is no further</LINE> <LINE>Than the main voice of Denmark goes withal.</LINE> <LINE>Then weigh what loss your honour may sustain,</LINE> <LINE>If with too credent ear you list his songs,</LINE> <LINE>Or lose your heart, or your chaste treasure open</LINE> <LINE>To his unmaster'd importunity.</LINE> <LINE>Fear it, Ophelia, fear it, my dear sister,</LINE> <LINE>And keep you in the rear of your affection,</LINE> <LINE>Out of the shot and danger of desire.</LINE> <LINE>The chariest maid is prodigal enough,</LINE> <LINE>If she unmask her beauty to the moon:</LINE> <LINE>Virtue itself 'scapes not calumnious strokes:</LINE> <LINE>The canker galls the infants of the spring,</LINE> <LINE>Too oft before their buttons be disclosed,</LINE> <LINE>And in the morn and liquid dew of youth</LINE> <LINE>Contagious blastments are most imminent.</LINE> <LINE>Be wary then; best safety lies in fear:</LINE> <LINE>Youth to itself rebels, though none else near.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>I shall the effect of this good lesson keep,</LINE> <LINE>As watchman to my heart. But, good my brother,</LINE> <LINE>Do not, as some ungracious pastors do,</LINE> <LINE>Show me the steep and thorny way to heaven;</LINE> <LINE>Whiles, like a puff'd and reckless libertine,</LINE> <LINE>Himself the primrose path of dalliance treads,</LINE> <LINE>And recks not his own rede.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>O, fear me not.</LINE> <LINE>I stay too long: but here my father comes.</LINE> <STAGEDIR>Enter POLONIUS</STAGEDIR> <LINE>A double blessing is a double grace,</LINE> <LINE>Occasion smiles upon a second leave.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Yet here, Laertes! aboard, aboard, for shame!</LINE> <LINE>The wind sits in the shoulder of your sail,</LINE> <LINE>And you are stay'd for. There; my blessing with thee!</LINE> <LINE>And these few precepts in thy memory</LINE> <LINE>See thou character. Give thy thoughts no tongue,</LINE> <LINE>Nor any unproportioned thought his act.</LINE> <LINE>Be thou familiar, but by no means vulgar.</LINE> <LINE>Those friends thou hast, and their adoption tried,</LINE> <LINE>Grapple them to thy soul with hoops of steel;</LINE> <LINE>But do not dull thy palm with entertainment</LINE> <LINE>Of each new-hatch'd, unfledged comrade. Beware</LINE> <LINE>Of entrance to a quarrel, but being in,</LINE> <LINE>Bear't that the opposed may beware of thee.</LINE> <LINE>Give every man thy ear, but few thy voice;</LINE> <LINE>Take each man's censure, but reserve thy judgment.</LINE> <LINE>Costly thy habit as thy purse can buy,</LINE> <LINE>But not express'd in fancy; rich, not gaudy;</LINE> <LINE>For the apparel oft proclaims the man,</LINE> <LINE>And they in France of the best rank and station</LINE> <LINE>Are of a most select and generous chief in that.</LINE> <LINE>Neither a borrower nor a lender be;</LINE> <LINE>For loan oft loses both itself and friend,</LINE> <LINE>And borrowing dulls the edge of husbandry.</LINE> <LINE>This above all: to thine ownself be true,</LINE> <LINE>And it must follow, as the night the day,</LINE> <LINE>Thou canst not then be false to any man.</LINE> <LINE>Farewell: my blessing season this in thee!</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Most humbly do I take my leave, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>The time invites you; go; your servants tend.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Farewell, Ophelia; and remember well</LINE> <LINE>What I have said to you.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>'Tis in my memory lock'd,</LINE> <LINE>And you yourself shall keep the key of it.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Farewell.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>What is't, Ophelia, be hath said to you?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>So please you, something touching the Lord Hamlet.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Marry, well bethought:</LINE> <LINE>'Tis told me, he hath very oft of late</LINE> <LINE>Given private time to you; and you yourself</LINE> <LINE>Have of your audience been most free and bounteous:</LINE> <LINE>If it be so, as so 'tis put on me,</LINE> <LINE>And that in way of caution, I must tell you,</LINE> <LINE>You do not understand yourself so clearly</LINE> <LINE>As it behoves my daughter and your honour.</LINE> <LINE>What is between you? give me up the truth.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>He hath, my lord, of late made many tenders</LINE> <LINE>Of his affection to me.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Affection! pooh! you speak like a green girl,</LINE> <LINE>Unsifted in such perilous circumstance.</LINE> <LINE>Do you believe his tenders, as you call them?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>I do not know, my lord, what I should think.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Marry, I'll teach you: think yourself a baby;</LINE> <LINE>That you have ta'en these tenders for true pay,</LINE> <LINE>Which are not sterling. Tender yourself more dearly;</LINE> <LINE>Or--not to crack the wind of the poor phrase,</LINE> <LINE>Running it thus--you'll tender me a fool.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>My lord, he hath importuned me with love</LINE> <LINE>In honourable fashion.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Ay, fashion you may call it; go to, go to.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>And hath given countenance to his speech, my lord,</LINE> <LINE>With almost all the holy vows of heaven.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Ay, springes to catch woodcocks. I do know,</LINE> <LINE>When the blood burns, how prodigal the soul</LINE> <LINE>Lends the tongue vows: these blazes, daughter,</LINE> <LINE>Giving more light than heat, extinct in both,</LINE> <LINE>Even in their promise, as it is a-making,</LINE> <LINE>You must not take for fire. From this time</LINE> <LINE>Be somewhat scanter of your maiden presence;</LINE> <LINE>Set your entreatments at a higher rate</LINE> <LINE>Than a command to parley. For Lord Hamlet,</LINE> <LINE>Believe so much in him, that he is young</LINE> <LINE>And with a larger tether may he walk</LINE> <LINE>Than may be given you: in few, Ophelia,</LINE> <LINE>Do not believe his vows; for they are brokers,</LINE> <LINE>Not of that dye which their investments show,</LINE> <LINE>But mere implorators of unholy suits,</LINE> <LINE>Breathing like sanctified and pious bawds,</LINE> <LINE>The better to beguile. This is for all:</LINE> <LINE>I would not, in plain terms, from this time forth,</LINE> <LINE>Have you so slander any moment leisure,</LINE> <LINE>As to give words or talk with the Lord Hamlet.</LINE> <LINE>Look to't, I charge you: come your ways.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>I shall obey, my lord.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE IV. The platform.</TITLE> <STAGEDIR>Enter HAMLET, HORATIO, and MARCELLUS</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The air bites shrewdly; it is very cold.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>It is a nipping and an eager air.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What hour now?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>I think it lacks of twelve.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, it is struck.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Indeed? I heard it not: then it draws near the season</LINE> <LINE>Wherein the spirit held his wont to walk.</LINE> <STAGEDIR>A flourish of trumpets, and ordnance shot off, within</STAGEDIR> <LINE>What does this mean, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The king doth wake to-night and takes his rouse,</LINE> <LINE>Keeps wassail, and the swaggering up-spring reels;</LINE> <LINE>And, as he drains his draughts of Rhenish down,</LINE> <LINE>The kettle-drum and trumpet thus bray out</LINE> <LINE>The triumph of his pledge.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Is it a custom?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, marry, is't:</LINE> <LINE>But to my mind, though I am native here</LINE> <LINE>And to the manner born, it is a custom</LINE> <LINE>More honour'd in the breach than the observance.</LINE> <LINE>This heavy-headed revel east and west</LINE> <LINE>Makes us traduced and tax'd of other nations:</LINE> <LINE>They clepe us drunkards, and with swinish phrase</LINE> <LINE>Soil our addition; and indeed it takes</LINE> <LINE>From our achievements, though perform'd at height,</LINE> <LINE>The pith and marrow of our attribute.</LINE> <LINE>So, oft it chances in particular men,</LINE> <LINE>That for some vicious mole of nature in them,</LINE> <LINE>As, in their birth--wherein they are not guilty,</LINE> <LINE>Since nature cannot choose his origin--</LINE> <LINE>By the o'ergrowth of some complexion,</LINE> <LINE>Oft breaking down the pales and forts of reason,</LINE> <LINE>Or by some habit that too much o'er-leavens</LINE> <LINE>The form of plausive manners, that these men,</LINE> <LINE>Carrying, I say, the stamp of one defect,</LINE> <LINE>Being nature's livery, or fortune's star,--</LINE> <LINE>Their virtues else--be they as pure as grace,</LINE> <LINE>As infinite as man may undergo--</LINE> <LINE>Shall in the general censure take corruption</LINE> <LINE>From that particular fault: the dram of eale</LINE> <LINE>Doth all the noble substance of a doubt</LINE> <LINE>To his own scandal.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Look, my lord, it comes!</LINE> </SPEECH> <STAGEDIR>Enter Ghost</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Angels and ministers of grace defend us!</LINE> <LINE>Be thou a spirit of health or goblin damn'd,</LINE> <LINE>Bring with thee airs from heaven or blasts from hell,</LINE> <LINE>Be thy intents wicked or charitable,</LINE> <LINE>Thou comest in such a questionable shape</LINE> <LINE>That I will speak to thee: I'll call thee Hamlet,</LINE> <LINE>King, father, royal Dane: O, answer me!</LINE> <LINE>Let me not burst in ignorance; but tell</LINE> <LINE>Why thy canonized bones, hearsed in death,</LINE> <LINE>Have burst their cerements; why the sepulchre,</LINE> <LINE>Wherein we saw thee quietly inurn'd,</LINE> <LINE>Hath oped his ponderous and marble jaws,</LINE> <LINE>To cast thee up again. What may this mean,</LINE> <LINE>That thou, dead corse, again in complete steel</LINE> <LINE>Revisit'st thus the glimpses of the moon,</LINE> <LINE>Making night hideous; and we fools of nature</LINE> <LINE>So horridly to shake our disposition</LINE> <LINE>With thoughts beyond the reaches of our souls?</LINE> <LINE>Say, why is this? wherefore? what should we do?</LINE> </SPEECH> <STAGEDIR>Ghost beckons HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>It beckons you to go away with it,</LINE> <LINE>As if it some impartment did desire</LINE> <LINE>To you alone.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Look, with what courteous action</LINE> <LINE>It waves you to a more removed ground:</LINE> <LINE>But do not go with it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>No, by no means.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It will not speak; then I will follow it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Do not, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, what should be the fear?</LINE> <LINE>I do not set my life in a pin's fee;</LINE> <LINE>And for my soul, what can it do to that,</LINE> <LINE>Being a thing immortal as itself?</LINE> <LINE>It waves me forth again: I'll follow it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>What if it tempt you toward the flood, my lord,</LINE> <LINE>Or to the dreadful summit of the cliff</LINE> <LINE>That beetles o'er his base into the sea,</LINE> <LINE>And there assume some other horrible form,</LINE> <LINE>Which might deprive your sovereignty of reason</LINE> <LINE>And draw you into madness? think of it:</LINE> <LINE>The very place puts toys of desperation,</LINE> <LINE>Without more motive, into every brain</LINE> <LINE>That looks so many fathoms to the sea</LINE> <LINE>And hears it roar beneath.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It waves me still.</LINE> <LINE>Go on; I'll follow thee.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>You shall not go, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Hold off your hands.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Be ruled; you shall not go.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>My fate cries out,</LINE> <LINE>And makes each petty artery in this body</LINE> <LINE>As hardy as the Nemean lion's nerve.</LINE> <LINE>Still am I call'd. Unhand me, gentlemen.</LINE> <LINE>By heaven, I'll make a ghost of him that lets me!</LINE> <LINE>I say, away! Go on; I'll follow thee.</LINE> </SPEECH> <STAGEDIR>Exeunt Ghost and HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>He waxes desperate with imagination.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Let's follow; 'tis not fit thus to obey him.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Have after. To what issue will this come?</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Something is rotten in the state of Denmark.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Heaven will direct it.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Nay, let's follow him.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE V. Another part of the platform.</TITLE> <STAGEDIR>Enter GHOST and HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Where wilt thou lead me? speak; I'll go no further.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>Mark me.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I will.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>My hour is almost come,</LINE> <LINE>When I to sulphurous and tormenting flames</LINE> <LINE>Must render up myself.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Alas, poor ghost!</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>Pity me not, but lend thy serious hearing</LINE> <LINE>To what I shall unfold.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Speak; I am bound to hear.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>So art thou to revenge, when thou shalt hear.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What?</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>I am thy father's spirit,</LINE> <LINE>Doom'd for a certain term to walk the night,</LINE> <LINE>And for the day confined to fast in fires,</LINE> <LINE>Till the foul crimes done in my days of nature</LINE> <LINE>Are burnt and purged away. But that I am forbid</LINE> <LINE>To tell the secrets of my prison-house,</LINE> <LINE>I could a tale unfold whose lightest word</LINE> <LINE>Would harrow up thy soul, freeze thy young blood,</LINE> <LINE>Make thy two eyes, like stars, start from their spheres,</LINE> <LINE>Thy knotted and combined locks to part</LINE> <LINE>And each particular hair to stand on end,</LINE> <LINE>Like quills upon the fretful porpentine:</LINE> <LINE>But this eternal blazon must not be</LINE> <LINE>To ears of flesh and blood. List, list, O, list!</LINE> <LINE>If thou didst ever thy dear father love--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O God!</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>Revenge his foul and most unnatural murder.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Murder!</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>Murder most foul, as in the best it is;</LINE> <LINE>But this most foul, strange and unnatural.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Haste me to know't, that I, with wings as swift</LINE> <LINE>As meditation or the thoughts of love,</LINE> <LINE>May sweep to my revenge.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>I find thee apt;</LINE> <LINE>And duller shouldst thou be than the fat weed</LINE> <LINE>That roots itself in ease on Lethe wharf,</LINE> <LINE>Wouldst thou not stir in this. Now, Hamlet, hear:</LINE> <LINE>'Tis given out that, sleeping in my orchard,</LINE> <LINE>A serpent stung me; so the whole ear of Denmark</LINE> <LINE>Is by a forged process of my death</LINE> <LINE>Rankly abused: but know, thou noble youth,</LINE> <LINE>The serpent that did sting thy father's life</LINE> <LINE>Now wears his crown.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O my prophetic soul! My uncle!</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>Ay, that incestuous, that adulterate beast,</LINE> <LINE>With witchcraft of his wit, with traitorous gifts,--</LINE> <LINE>O wicked wit and gifts, that have the power</LINE> <LINE>So to seduce!--won to his shameful lust</LINE> <LINE>The will of my most seeming-virtuous queen:</LINE> <LINE>O Hamlet, what a falling-off was there!</LINE> <LINE>From me, whose love was of that dignity</LINE> <LINE>That it went hand in hand even with the vow</LINE> <LINE>I made to her in marriage, and to decline</LINE> <LINE>Upon a wretch whose natural gifts were poor</LINE> <LINE>To those of mine!</LINE> <LINE>But virtue, as it never will be moved,</LINE> <LINE>Though lewdness court it in a shape of heaven,</LINE> <LINE>So lust, though to a radiant angel link'd,</LINE> <LINE>Will sate itself in a celestial bed,</LINE> <LINE>And prey on garbage.</LINE> <LINE>But, soft! methinks I scent the morning air;</LINE> <LINE>Brief let me be. Sleeping within my orchard,</LINE> <LINE>My custom always of the afternoon,</LINE> <LINE>Upon my secure hour thy uncle stole,</LINE> <LINE>With juice of cursed hebenon in a vial,</LINE> <LINE>And in the porches of my ears did pour</LINE> <LINE>The leperous distilment; whose effect</LINE> <LINE>Holds such an enmity with blood of man</LINE> <LINE>That swift as quicksilver it courses through</LINE> <LINE>The natural gates and alleys of the body,</LINE> <LINE>And with a sudden vigour doth posset</LINE> <LINE>And curd, like eager droppings into milk,</LINE> <LINE>The thin and wholesome blood: so did it mine;</LINE> <LINE>And a most instant tetter bark'd about,</LINE> <LINE>Most lazar-like, with vile and loathsome crust,</LINE> <LINE>All my smooth body.</LINE> <LINE>Thus was I, sleeping, by a brother's hand</LINE> <LINE>Of life, of crown, of queen, at once dispatch'd:</LINE> <LINE>Cut off even in the blossoms of my sin,</LINE> <LINE>Unhousel'd, disappointed, unanel'd,</LINE> <LINE>No reckoning made, but sent to my account</LINE> <LINE>With all my imperfections on my head:</LINE> <LINE>O, horrible! O, horrible! most horrible!</LINE> <LINE>If thou hast nature in thee, bear it not;</LINE> <LINE>Let not the royal bed of Denmark be</LINE> <LINE>A couch for luxury and damned incest.</LINE> <LINE>But, howsoever thou pursuest this act,</LINE> <LINE>Taint not thy mind, nor let thy soul contrive</LINE> <LINE>Against thy mother aught: leave her to heaven</LINE> <LINE>And to those thorns that in her bosom lodge,</LINE> <LINE>To prick and sting her. Fare thee well at once!</LINE> <LINE>The glow-worm shows the matin to be near,</LINE> <LINE>And 'gins to pale his uneffectual fire:</LINE> <LINE>Adieu, adieu! Hamlet, remember me.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O all you host of heaven! O earth! what else?</LINE> <LINE>And shall I couple hell? O, fie! Hold, hold, my heart;</LINE> <LINE>And you, my sinews, grow not instant old,</LINE> <LINE>But bear me stiffly up. Remember thee!</LINE> <LINE>Ay, thou poor ghost, while memory holds a seat</LINE> <LINE>In this distracted globe. Remember thee!</LINE> <LINE>Yea, from the table of my memory</LINE> <LINE>I'll wipe away all trivial fond records,</LINE> <LINE>All saws of books, all forms, all pressures past,</LINE> <LINE>That youth and observation copied there;</LINE> <LINE>And thy commandment all alone shall live</LINE> <LINE>Within the book and volume of my brain,</LINE> <LINE>Unmix'd with baser matter: yes, by heaven!</LINE> <LINE>O most pernicious woman!</LINE> <LINE>O villain, villain, smiling, damned villain!</LINE> <LINE>My tables,--meet it is I set it down,</LINE> <LINE>That one may smile, and smile, and be a villain;</LINE> <LINE>At least I'm sure it may be so in Denmark:</LINE> <STAGEDIR>Writing</STAGEDIR> <LINE>So, uncle, there you are. Now to my word;</LINE> <LINE>It is 'Adieu, adieu! remember me.'</LINE> <LINE>I have sworn 't.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <SPEAKER>HORATIO</SPEAKER> <LINE><STAGEDIR>Within</STAGEDIR> My lord, my lord,--</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE><STAGEDIR>Within</STAGEDIR> Lord Hamlet,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE><STAGEDIR>Within</STAGEDIR> Heaven secure him!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>So be it!</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE><STAGEDIR>Within</STAGEDIR> Hillo, ho, ho, my lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Hillo, ho, ho, boy! come, bird, come.</LINE> </SPEECH> <STAGEDIR>Enter HORATIO and MARCELLUS</STAGEDIR> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>How is't, my noble lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>What news, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O, wonderful!</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Good my lord, tell it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No; you'll reveal it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Not I, my lord, by heaven.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Nor I, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How say you, then; would heart of man once think it?</LINE> <LINE>But you'll be secret?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Ay, by heaven, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>There's ne'er a villain dwelling in all Denmark</LINE> <LINE>But he's an arrant knave.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>There needs no ghost, my lord, come from the grave</LINE> <LINE>To tell us this.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, right; you are i' the right;</LINE> <LINE>And so, without more circumstance at all,</LINE> <LINE>I hold it fit that we shake hands and part:</LINE> <LINE>You, as your business and desire shall point you;</LINE> <LINE>For every man has business and desire,</LINE> <LINE>Such as it is; and for mine own poor part,</LINE> <LINE>Look you, I'll go pray.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>These are but wild and whirling words, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I'm sorry they offend you, heartily;</LINE> <LINE>Yes, 'faith heartily.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>There's no offence, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Yes, by Saint Patrick, but there is, Horatio,</LINE> <LINE>And much offence too. Touching this vision here,</LINE> <LINE>It is an honest ghost, that let me tell you:</LINE> <LINE>For your desire to know what is between us,</LINE> <LINE>O'ermaster 't as you may. And now, good friends,</LINE> <LINE>As you are friends, scholars and soldiers,</LINE> <LINE>Give me one poor request.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>What is't, my lord? we will.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Never make known what you have seen to-night.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <SPEAKER>MARCELLUS</SPEAKER> <LINE>My lord, we will not.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nay, but swear't.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>In faith,</LINE> <LINE>My lord, not I.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>Nor I, my lord, in faith.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Upon my sword.</LINE> </SPEECH> <SPEECH> <SPEAKER>MARCELLUS</SPEAKER> <LINE>We have sworn, my lord, already.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Indeed, upon my sword, indeed.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE><STAGEDIR>Beneath</STAGEDIR> Swear.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ah, ha, boy! say'st thou so? art thou there,</LINE> <LINE>truepenny?</LINE> <LINE>Come on--you hear this fellow in the cellarage--</LINE> <LINE>Consent to swear.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Propose the oath, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Never to speak of this that you have seen,</LINE> <LINE>Swear by my sword.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE><STAGEDIR>Beneath</STAGEDIR> Swear.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Hic et ubique? then we'll shift our ground.</LINE> <LINE>Come hither, gentlemen,</LINE> <LINE>And lay your hands again upon my sword:</LINE> <LINE>Never to speak of this that you have heard,</LINE> <LINE>Swear by my sword.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE><STAGEDIR>Beneath</STAGEDIR> Swear.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Well said, old mole! canst work i' the earth so fast?</LINE> <LINE>A worthy pioner! Once more remove, good friends.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>O day and night, but this is wondrous strange!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>And therefore as a stranger give it welcome.</LINE> <LINE>There are more things in heaven and earth, Horatio,</LINE> <LINE>Than are dreamt of in your philosophy. But come;</LINE> <LINE>Here, as before, never, so help you mercy,</LINE> <LINE>How strange or odd soe'er I bear myself,</LINE> <LINE>As I perchance hereafter shall think meet</LINE> <LINE>To put an antic disposition on,</LINE> <LINE>That you, at such times seeing me, never shall,</LINE> <LINE>With arms encumber'd thus, or this headshake,</LINE> <LINE>Or by pronouncing of some doubtful phrase,</LINE> <LINE>As 'Well, well, we know,' or 'We could, an if we would,'</LINE> <LINE>Or 'If we list to speak,' or 'There be, an if they might,'</LINE> <LINE>Or such ambiguous giving out, to note</LINE> <LINE>That you know aught of me: this not to do,</LINE> <LINE>So grace and mercy at your most need help you, Swear.</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE><STAGEDIR>Beneath</STAGEDIR> Swear.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Rest, rest, perturbed spirit!</LINE> <STAGEDIR>They swear</STAGEDIR> <LINE>So, gentlemen,</LINE> <LINE>With all my love I do commend me to you:</LINE> <LINE>And what so poor a man as Hamlet is</LINE> <LINE>May do, to express his love and friending to you,</LINE> <LINE>God willing, shall not lack. Let us go in together;</LINE> <LINE>And still your fingers on your lips, I pray.</LINE> <LINE>The time is out of joint: O cursed spite,</LINE> <LINE>That ever I was born to set it right!</LINE> <LINE>Nay, come, let's go together.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> </ACT> <ACT><TITLE>ACT II</TITLE> <SCENE><TITLE>SCENE I. A room in POLONIUS' house.</TITLE> <STAGEDIR>Enter POLONIUS and REYNALDO</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Give him this money and these notes, Reynaldo.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>I will, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>You shall do marvellous wisely, good Reynaldo,</LINE> <LINE>Before you visit him, to make inquire</LINE> <LINE>Of his behavior.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>My lord, I did intend it.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Marry, well said; very well said. Look you, sir,</LINE> <LINE>Inquire me first what Danskers are in Paris;</LINE> <LINE>And how, and who, what means, and where they keep,</LINE> <LINE>What company, at what expense; and finding</LINE> <LINE>By this encompassment and drift of question</LINE> <LINE>That they do know my son, come you more nearer</LINE> <LINE>Than your particular demands will touch it:</LINE> <LINE>Take you, as 'twere, some distant knowledge of him;</LINE> <LINE>As thus, 'I know his father and his friends,</LINE> <LINE>And in part him: ' do you mark this, Reynaldo?</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>Ay, very well, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>'And in part him; but' you may say 'not well:</LINE> <LINE>But, if't be he I mean, he's very wild;</LINE> <LINE>Addicted so and so:' and there put on him</LINE> <LINE>What forgeries you please; marry, none so rank</LINE> <LINE>As may dishonour him; take heed of that;</LINE> <LINE>But, sir, such wanton, wild and usual slips</LINE> <LINE>As are companions noted and most known</LINE> <LINE>To youth and liberty.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>As gaming, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Ay, or drinking, fencing, swearing, quarrelling,</LINE> <LINE>Drabbing: you may go so far.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>My lord, that would dishonour him.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>'Faith, no; as you may season it in the charge</LINE> <LINE>You must not put another scandal on him,</LINE> <LINE>That he is open to incontinency;</LINE> <LINE>That's not my meaning: but breathe his faults so quaintly</LINE> <LINE>That they may seem the taints of liberty,</LINE> <LINE>The flash and outbreak of a fiery mind,</LINE> <LINE>A savageness in unreclaimed blood,</LINE> <LINE>Of general assault.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>But, my good lord,--</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Wherefore should you do this?</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>Ay, my lord,</LINE> <LINE>I would know that.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Marry, sir, here's my drift;</LINE> <LINE>And I believe, it is a fetch of wit:</LINE> <LINE>You laying these slight sullies on my son,</LINE> <LINE>As 'twere a thing a little soil'd i' the working, Mark you,</LINE> <LINE>Your party in converse, him you would sound,</LINE> <LINE>Having ever seen in the prenominate crimes</LINE> <LINE>The youth you breathe of guilty, be assured</LINE> <LINE>He closes with you in this consequence;</LINE> <LINE>'Good sir,' or so, or 'friend,' or 'gentleman,'</LINE> <LINE>According to the phrase or the addition</LINE> <LINE>Of man and country.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>Very good, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>And then, sir, does he this--he does--what was I</LINE> <LINE>about to say? By the mass, I was about to say</LINE> <LINE>something: where did I leave?</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>At 'closes in the consequence,' at 'friend or so,'</LINE> <LINE>and 'gentleman.'</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>At 'closes in the consequence,' ay, marry;</LINE> <LINE>He closes thus: 'I know the gentleman;</LINE> <LINE>I saw him yesterday, or t' other day,</LINE> <LINE>Or then, or then; with such, or such; and, as you say,</LINE> <LINE>There was a' gaming; there o'ertook in's rouse;</LINE> <LINE>There falling out at tennis:' or perchance,</LINE> <LINE>'I saw him enter such a house of sale,'</LINE> <LINE>Videlicet, a brothel, or so forth.</LINE> <LINE>See you now;</LINE> <LINE>Your bait of falsehood takes this carp of truth:</LINE> <LINE>And thus do we of wisdom and of reach,</LINE> <LINE>With windlasses and with assays of bias,</LINE> <LINE>By indirections find directions out:</LINE> <LINE>So by my former lecture and advice,</LINE> <LINE>Shall you my son. You have me, have you not?</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>My lord, I have.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>God be wi' you; fare you well.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>Good my lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Observe his inclination in yourself.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>I shall, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>And let him ply his music.</LINE> </SPEECH> <SPEECH> <SPEAKER>REYNALDO</SPEAKER> <LINE>Well, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Farewell!</LINE> <STAGEDIR>Exit REYNALDO</STAGEDIR> <STAGEDIR>Enter OPHELIA</STAGEDIR> <LINE>How now, Ophelia! what's the matter?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>O, my lord, my lord, I have been so affrighted!</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>With what, i' the name of God?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>My lord, as I was sewing in my closet,</LINE> <LINE>Lord Hamlet, with his doublet all unbraced;</LINE> <LINE>No hat upon his head; his stockings foul'd,</LINE> <LINE>Ungarter'd, and down-gyved to his ancle;</LINE> <LINE>Pale as his shirt; his knees knocking each other;</LINE> <LINE>And with a look so piteous in purport</LINE> <LINE>As if he had been loosed out of hell</LINE> <LINE>To speak of horrors,--he comes before me.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Mad for thy love?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>My lord, I do not know;</LINE> <LINE>But truly, I do fear it.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>What said he?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>He took me by the wrist and held me hard;</LINE> <LINE>Then goes he to the length of all his arm;</LINE> <LINE>And, with his other hand thus o'er his brow,</LINE> <LINE>He falls to such perusal of my face</LINE> <LINE>As he would draw it. Long stay'd he so;</LINE> <LINE>At last, a little shaking of mine arm</LINE> <LINE>And thrice his head thus waving up and down,</LINE> <LINE>He raised a sigh so piteous and profound</LINE> <LINE>As it did seem to shatter all his bulk</LINE> <LINE>And end his being: that done, he lets me go:</LINE> <LINE>And, with his head over his shoulder turn'd,</LINE> <LINE>He seem'd to find his way without his eyes;</LINE> <LINE>For out o' doors he went without their helps,</LINE> <LINE>And, to the last, bended their light on me.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Come, go with me: I will go seek the king.</LINE> <LINE>This is the very ecstasy of love,</LINE> <LINE>Whose violent property fordoes itself</LINE> <LINE>And leads the will to desperate undertakings</LINE> <LINE>As oft as any passion under heaven</LINE> <LINE>That does afflict our natures. I am sorry.</LINE> <LINE>What, have you given him any hard words of late?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>No, my good lord, but, as you did command,</LINE> <LINE>I did repel his fetters and denied</LINE> <LINE>His access to me.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>That hath made him mad.</LINE> <LINE>I am sorry that with better heed and judgment</LINE> <LINE>I had not quoted him: I fear'd he did but trifle,</LINE> <LINE>And meant to wreck thee; but, beshrew my jealousy!</LINE> <LINE>By heaven, it is as proper to our age</LINE> <LINE>To cast beyond ourselves in our opinions</LINE> <LINE>As it is common for the younger sort</LINE> <LINE>To lack discretion. Come, go we to the king:</LINE> <LINE>This must be known; which, being kept close, might</LINE> <LINE>move</LINE> <LINE>More grief to hide than hate to utter love.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE II. A room in the castle.</TITLE> <STAGEDIR>Enter KING CLAUDIUS, QUEEN GERTRUDE, ROSENCRANTZ, GUILDENSTERN, and Attendants</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Welcome, dear Rosencrantz and Guildenstern!</LINE> <LINE>Moreover that we much did long to see you,</LINE> <LINE>The need we have to use you did provoke</LINE> <LINE>Our hasty sending. Something have you heard</LINE> <LINE>Of Hamlet's transformation; so call it,</LINE> <LINE>Sith nor the exterior nor the inward man</LINE> <LINE>Resembles that it was. What it should be,</LINE> <LINE>More than his father's death, that thus hath put him</LINE> <LINE>So much from the understanding of himself,</LINE> <LINE>I cannot dream of: I entreat you both,</LINE> <LINE>That, being of so young days brought up with him,</LINE> <LINE>And sith so neighbour'd to his youth and havior,</LINE> <LINE>That you vouchsafe your rest here in our court</LINE> <LINE>Some little time: so by your companies</LINE> <LINE>To draw him on to pleasures, and to gather,</LINE> <LINE>So much as from occasion you may glean,</LINE> <LINE>Whether aught, to us unknown, afflicts him thus,</LINE> <LINE>That, open'd, lies within our remedy.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Good gentlemen, he hath much talk'd of you;</LINE> <LINE>And sure I am two men there are not living</LINE> <LINE>To whom he more adheres. If it will please you</LINE> <LINE>To show us so much gentry and good will</LINE> <LINE>As to expend your time with us awhile,</LINE> <LINE>For the supply and profit of our hope,</LINE> <LINE>Your visitation shall receive such thanks</LINE> <LINE>As fits a king's remembrance.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Both your majesties</LINE> <LINE>Might, by the sovereign power you have of us,</LINE> <LINE>Put your dread pleasures more into command</LINE> <LINE>Than to entreaty.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>But we both obey,</LINE> <LINE>And here give up ourselves, in the full bent</LINE> <LINE>To lay our service freely at your feet,</LINE> <LINE>To be commanded.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Thanks, Rosencrantz and gentle Guildenstern.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Thanks, Guildenstern and gentle Rosencrantz:</LINE> <LINE>And I beseech you instantly to visit</LINE> <LINE>My too much changed son. Go, some of you,</LINE> <LINE>And bring these gentlemen where Hamlet is.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Heavens make our presence and our practises</LINE> <LINE>Pleasant and helpful to him!</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Ay, amen!</LINE> </SPEECH> <STAGEDIR>Exeunt ROSENCRANTZ, GUILDENSTERN, and some Attendants</STAGEDIR> <STAGEDIR>Enter POLONIUS</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>The ambassadors from Norway, my good lord,</LINE> <LINE>Are joyfully return'd.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Thou still hast been the father of good news.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Have I, my lord? I assure my good liege,</LINE> <LINE>I hold my duty, as I hold my soul,</LINE> <LINE>Both to my God and to my gracious king:</LINE> <LINE>And I do think, or else this brain of mine</LINE> <LINE>Hunts not the trail of policy so sure</LINE> <LINE>As it hath used to do, that I have found</LINE> <LINE>The very cause of Hamlet's lunacy.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>O, speak of that; that do I long to hear.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Give first admittance to the ambassadors;</LINE> <LINE>My news shall be the fruit to that great feast.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Thyself do grace to them, and bring them in.</LINE> <STAGEDIR>Exit POLONIUS</STAGEDIR> <LINE>He tells me, my dear Gertrude, he hath found</LINE> <LINE>The head and source of all your son's distemper.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>I doubt it is no other but the main;</LINE> <LINE>His father's death, and our o'erhasty marriage.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Well, we shall sift him.</LINE> <STAGEDIR>Re-enter POLONIUS, with VOLTIMAND and CORNELIUS</STAGEDIR> <LINE>Welcome, my good friends!</LINE> <LINE>Say, Voltimand, what from our brother Norway?</LINE> </SPEECH> <SPEECH> <SPEAKER>VOLTIMAND</SPEAKER> <LINE>Most fair return of greetings and desires.</LINE> <LINE>Upon our first, he sent out to suppress</LINE> <LINE>His nephew's levies; which to him appear'd</LINE> <LINE>To be a preparation 'gainst the Polack;</LINE> <LINE>But, better look'd into, he truly found</LINE> <LINE>It was against your highness: whereat grieved,</LINE> <LINE>That so his sickness, age and impotence</LINE> <LINE>Was falsely borne in hand, sends out arrests</LINE> <LINE>On Fortinbras; which he, in brief, obeys;</LINE> <LINE>Receives rebuke from Norway, and in fine</LINE> <LINE>Makes vow before his uncle never more</LINE> <LINE>To give the assay of arms against your majesty.</LINE> <LINE>Whereon old Norway, overcome with joy,</LINE> <LINE>Gives him three thousand crowns in annual fee,</LINE> <LINE>And his commission to employ those soldiers,</LINE> <LINE>So levied as before, against the Polack:</LINE> <LINE>With an entreaty, herein further shown,</LINE> <STAGEDIR>Giving a paper</STAGEDIR> <LINE>That it might please you to give quiet pass</LINE> <LINE>Through your dominions for this enterprise,</LINE> <LINE>On such regards of safety and allowance</LINE> <LINE>As therein are set down.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>It likes us well;</LINE> <LINE>And at our more consider'd time well read,</LINE> <LINE>Answer, and think upon this business.</LINE> <LINE>Meantime we thank you for your well-took labour:</LINE> <LINE>Go to your rest; at night we'll feast together:</LINE> <LINE>Most welcome home!</LINE> </SPEECH> <STAGEDIR>Exeunt VOLTIMAND and CORNELIUS</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>This business is well ended.</LINE> <LINE>My liege, and madam, to expostulate</LINE> <LINE>What majesty should be, what duty is,</LINE> <LINE>Why day is day, night night, and time is time,</LINE> <LINE>Were nothing but to waste night, day and time.</LINE> <LINE>Therefore, since brevity is the soul of wit,</LINE> <LINE>And tediousness the limbs and outward flourishes,</LINE> <LINE>I will be brief: your noble son is mad:</LINE> <LINE>Mad call I it; for, to define true madness,</LINE> <LINE>What is't but to be nothing else but mad?</LINE> <LINE>But let that go.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>More matter, with less art.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Madam, I swear I use no art at all.</LINE> <LINE>That he is mad, 'tis true: 'tis true 'tis pity;</LINE> <LINE>And pity 'tis 'tis true: a foolish figure;</LINE> <LINE>But farewell it, for I will use no art.</LINE> <LINE>Mad let us grant him, then: and now remains</LINE> <LINE>That we find out the cause of this effect,</LINE> <LINE>Or rather say, the cause of this defect,</LINE> <LINE>For this effect defective comes by cause:</LINE> <LINE>Thus it remains, and the remainder thus. Perpend.</LINE> <LINE>I have a daughter--have while she is mine--</LINE> <LINE>Who, in her duty and obedience, mark,</LINE> <LINE>Hath given me this: now gather, and surmise.</LINE> <STAGEDIR>Reads</STAGEDIR> <LINE>'To the celestial and my soul's idol, the most</LINE> <LINE>beautified Ophelia,'--</LINE> <LINE>That's an ill phrase, a vile phrase; 'beautified' is</LINE> <LINE>a vile phrase: but you shall hear. Thus:</LINE> <STAGEDIR>Reads</STAGEDIR> <LINE>'In her excellent white bosom, these, &amp;c.'</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Came this from Hamlet to her?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Good madam, stay awhile; I will be faithful.</LINE> <STAGEDIR>Reads</STAGEDIR> <LINE>'Doubt thou the stars are fire;</LINE> <LINE>Doubt that the sun doth move;</LINE> <LINE>Doubt truth to be a liar;</LINE> <LINE>But never doubt I love.</LINE> <LINE>'O dear Ophelia, I am ill at these numbers;</LINE> <LINE>I have not art to reckon my groans: but that</LINE> <LINE>I love thee best, O most best, believe it. Adieu.</LINE> <LINE>'Thine evermore most dear lady, whilst</LINE> <LINE>this machine is to him, HAMLET.'</LINE> <LINE>This, in obedience, hath my daughter shown me,</LINE> <LINE>And more above, hath his solicitings,</LINE> <LINE>As they fell out by time, by means and place,</LINE> <LINE>All given to mine ear.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>But how hath she</LINE> <LINE>Received his love?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>What do you think of me?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>As of a man faithful and honourable.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>I would fain prove so. But what might you think,</LINE> <LINE>When I had seen this hot love on the wing--</LINE> <LINE>As I perceived it, I must tell you that,</LINE> <LINE>Before my daughter told me--what might you,</LINE> <LINE>Or my dear majesty your queen here, think,</LINE> <LINE>If I had play'd the desk or table-book,</LINE> <LINE>Or given my heart a winking, mute and dumb,</LINE> <LINE>Or look'd upon this love with idle sight;</LINE> <LINE>What might you think? No, I went round to work,</LINE> <LINE>And my young mistress thus I did bespeak:</LINE> <LINE>'Lord Hamlet is a prince, out of thy star;</LINE> <LINE>This must not be:' and then I precepts gave her,</LINE> <LINE>That she should lock herself from his resort,</LINE> <LINE>Admit no messengers, receive no tokens.</LINE> <LINE>Which done, she took the fruits of my advice;</LINE> <LINE>And he, repulsed--a short tale to make--</LINE> <LINE>Fell into a sadness, then into a fast,</LINE> <LINE>Thence to a watch, thence into a weakness,</LINE> <LINE>Thence to a lightness, and, by this declension,</LINE> <LINE>Into the madness wherein now he raves,</LINE> <LINE>And all we mourn for.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Do you think 'tis this?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>It may be, very likely.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Hath there been such a time--I'd fain know that--</LINE> <LINE>That I have positively said 'Tis so,'</LINE> <LINE>When it proved otherwise?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Not that I know.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE><STAGEDIR>Pointing to his head and shoulder</STAGEDIR></LINE> <LINE>Take this from this, if this be otherwise:</LINE> <LINE>If circumstances lead me, I will find</LINE> <LINE>Where truth is hid, though it were hid indeed</LINE> <LINE>Within the centre.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>How may we try it further?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>You know, sometimes he walks four hours together</LINE> <LINE>Here in the lobby.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>So he does indeed.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>At such a time I'll loose my daughter to him:</LINE> <LINE>Be you and I behind an arras then;</LINE> <LINE>Mark the encounter: if he love her not</LINE> <LINE>And be not from his reason fall'n thereon,</LINE> <LINE>Let me be no assistant for a state,</LINE> <LINE>But keep a farm and carters.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>We will try it.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>But, look, where sadly the poor wretch comes reading.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Away, I do beseech you, both away:</LINE> <LINE>I'll board him presently.</LINE> <STAGEDIR>Exeunt KING CLAUDIUS, QUEEN GERTRUDE, and Attendants</STAGEDIR> <STAGEDIR>Enter HAMLET, reading</STAGEDIR> <LINE>O, give me leave:</LINE> <LINE>How does my good Lord Hamlet?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Well, God-a-mercy.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Do you know me, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Excellent well; you are a fishmonger.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Not I, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Then I would you were so honest a man.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Honest, my lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, sir; to be honest, as this world goes, is to be</LINE> <LINE>one man picked out of ten thousand.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>That's very true, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>For if the sun breed maggots in a dead dog, being a</LINE> <LINE>god kissing carrion,--Have you a daughter?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>I have, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Let her not walk i' the sun: conception is a</LINE> <LINE>blessing: but not as your daughter may conceive.</LINE> <LINE>Friend, look to 't.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> How say you by that? Still harping on my</LINE> <LINE>daughter: yet he knew me not at first; he said I</LINE> <LINE>was a fishmonger: he is far gone, far gone: and</LINE> <LINE>truly in my youth I suffered much extremity for</LINE> <LINE>love; very near this. I'll speak to him again.</LINE> <LINE>What do you read, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Words, words, words.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>What is the matter, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Between who?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>I mean, the matter that you read, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Slanders, sir: for the satirical rogue says here</LINE> <LINE>that old men have grey beards, that their faces are</LINE> <LINE>wrinkled, their eyes purging thick amber and</LINE> <LINE>plum-tree gum and that they have a plentiful lack of</LINE> <LINE>wit, together with most weak hams: all which, sir,</LINE> <LINE>though I most powerfully and potently believe, yet</LINE> <LINE>I hold it not honesty to have it thus set down, for</LINE> <LINE>yourself, sir, should be old as I am, if like a crab</LINE> <LINE>you could go backward.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> Though this be madness, yet there is method</LINE> <LINE>in 't. Will you walk out of the air, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Into my grave.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Indeed, that is out o' the air.</LINE> <STAGEDIR>Aside</STAGEDIR> <LINE>How pregnant sometimes his replies are! a happiness</LINE> <LINE>that often madness hits on, which reason and sanity</LINE> <LINE>could not so prosperously be delivered of. I will</LINE> <LINE>leave him, and suddenly contrive the means of</LINE> <LINE>meeting between him and my daughter.--My honourable</LINE> <LINE>lord, I will most humbly take my leave of you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>You cannot, sir, take from me any thing that I will</LINE> <LINE>more willingly part withal: except my life, except</LINE> <LINE>my life, except my life.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Fare you well, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>These tedious old fools!</LINE> </SPEECH> <STAGEDIR>Enter ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>You go to seek the Lord Hamlet; there he is.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE><STAGEDIR>To POLONIUS</STAGEDIR> God save you, sir!</LINE> </SPEECH> <STAGEDIR>Exit POLONIUS</STAGEDIR> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>My honoured lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>My most dear lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>My excellent good friends! How dost thou,</LINE> <LINE>Guildenstern? Ah, Rosencrantz! Good lads, how do ye both?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>As the indifferent children of the earth.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Happy, in that we are not over-happy;</LINE> <LINE>On fortune's cap we are not the very button.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nor the soles of her shoe?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Neither, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Then you live about her waist, or in the middle of</LINE> <LINE>her favours?</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>'Faith, her privates we.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>In the secret parts of fortune? O, most true; she</LINE> <LINE>is a strumpet. What's the news?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>None, my lord, but that the world's grown honest.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Then is doomsday near: but your news is not true.</LINE> <LINE>Let me question more in particular: what have you,</LINE> <LINE>my good friends, deserved at the hands of fortune,</LINE> <LINE>that she sends you to prison hither?</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Prison, my lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Denmark's a prison.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Then is the world one.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>A goodly one; in which there are many confines,</LINE> <LINE>wards and dungeons, Denmark being one o' the worst.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>We think not so, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, then, 'tis none to you; for there is nothing</LINE> <LINE>either good or bad, but thinking makes it so: to me</LINE> <LINE>it is a prison.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Why then, your ambition makes it one; 'tis too</LINE> <LINE>narrow for your mind.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O God, I could be bounded in a nut shell and count</LINE> <LINE>myself a king of infinite space, were it not that I</LINE> <LINE>have bad dreams.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Which dreams indeed are ambition, for the very</LINE> <LINE>substance of the ambitious is merely the shadow of a dream.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>A dream itself is but a shadow.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Truly, and I hold ambition of so airy and light a</LINE> <LINE>quality that it is but a shadow's shadow.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Then are our beggars bodies, and our monarchs and</LINE> <LINE>outstretched heroes the beggars' shadows. Shall we</LINE> <LINE>to the court? for, by my fay, I cannot reason.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>We'll wait upon you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No such matter: I will not sort you with the rest</LINE> <LINE>of my servants, for, to speak to you like an honest</LINE> <LINE>man, I am most dreadfully attended. But, in the</LINE> <LINE>beaten way of friendship, what make you at Elsinore?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>To visit you, my lord; no other occasion.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Beggar that I am, I am even poor in thanks; but I</LINE> <LINE>thank you: and sure, dear friends, my thanks are</LINE> <LINE>too dear a halfpenny. Were you not sent for? Is it</LINE> <LINE>your own inclining? Is it a free visitation? Come,</LINE> <LINE>deal justly with me: come, come; nay, speak.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>What should we say, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, any thing, but to the purpose. You were sent</LINE> <LINE>for; and there is a kind of confession in your looks</LINE> <LINE>which your modesties have not craft enough to colour:</LINE> <LINE>I know the good king and queen have sent for you.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>To what end, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>That you must teach me. But let me conjure you, by</LINE> <LINE>the rights of our fellowship, by the consonancy of</LINE> <LINE>our youth, by the obligation of our ever-preserved</LINE> <LINE>love, and by what more dear a better proposer could</LINE> <LINE>charge you withal, be even and direct with me,</LINE> <LINE>whether you were sent for, or no?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE><STAGEDIR>Aside to GUILDENSTERN</STAGEDIR> What say you?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> Nay, then, I have an eye of you.--If you</LINE> <LINE>love me, hold not off.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>My lord, we were sent for.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I will tell you why; so shall my anticipation</LINE> <LINE>prevent your discovery, and your secrecy to the king</LINE> <LINE>and queen moult no feather. I have of late--but</LINE> <LINE>wherefore I know not--lost all my mirth, forgone all</LINE> <LINE>custom of exercises; and indeed it goes so heavily</LINE> <LINE>with my disposition that this goodly frame, the</LINE> <LINE>earth, seems to me a sterile promontory, this most</LINE> <LINE>excellent canopy, the air, look you, this brave</LINE> <LINE>o'erhanging firmament, this majestical roof fretted</LINE> <LINE>with golden fire, why, it appears no other thing to</LINE> <LINE>me than a foul and pestilent congregation of vapours.</LINE> <LINE>What a piece of work is a man! how noble in reason!</LINE> <LINE>how infinite in faculty! in form and moving how</LINE> <LINE>express and admirable! in action how like an angel!</LINE> <LINE>in apprehension how like a god! the beauty of the</LINE> <LINE>world! the paragon of animals! And yet, to me,</LINE> <LINE>what is this quintessence of dust? man delights not</LINE> <LINE>me: no, nor woman neither, though by your smiling</LINE> <LINE>you seem to say so.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>My lord, there was no such stuff in my thoughts.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why did you laugh then, when I said 'man delights not me'?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>To think, my lord, if you delight not in man, what</LINE> <LINE>lenten entertainment the players shall receive from</LINE> <LINE>you: we coted them on the way; and hither are they</LINE> <LINE>coming, to offer you service.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>He that plays the king shall be welcome; his majesty</LINE> <LINE>shall have tribute of me; the adventurous knight</LINE> <LINE>shall use his foil and target; the lover shall not</LINE> <LINE>sigh gratis; the humourous man shall end his part</LINE> <LINE>in peace; the clown shall make those laugh whose</LINE> <LINE>lungs are tickled o' the sere; and the lady shall</LINE> <LINE>say her mind freely, or the blank verse shall halt</LINE> <LINE>for't. What players are they?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Even those you were wont to take delight in, the</LINE> <LINE>tragedians of the city.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How chances it they travel? their residence, both</LINE> <LINE>in reputation and profit, was better both ways.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>I think their inhibition comes by the means of the</LINE> <LINE>late innovation.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Do they hold the same estimation they did when I was</LINE> <LINE>in the city? are they so followed?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>No, indeed, are they not.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How comes it? do they grow rusty?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Nay, their endeavour keeps in the wonted pace: but</LINE> <LINE>there is, sir, an aery of children, little eyases,</LINE> <LINE>that cry out on the top of question, and are most</LINE> <LINE>tyrannically clapped for't: these are now the</LINE> <LINE>fashion, and so berattle the common stages--so they</LINE> <LINE>call them--that many wearing rapiers are afraid of</LINE> <LINE>goose-quills and dare scarce come thither.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What, are they children? who maintains 'em? how are</LINE> <LINE>they escoted? Will they pursue the quality no</LINE> <LINE>longer than they can sing? will they not say</LINE> <LINE>afterwards, if they should grow themselves to common</LINE> <LINE>players--as it is most like, if their means are no</LINE> <LINE>better--their writers do them wrong, to make them</LINE> <LINE>exclaim against their own succession?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>'Faith, there has been much to do on both sides; and</LINE> <LINE>the nation holds it no sin to tarre them to</LINE> <LINE>controversy: there was, for a while, no money bid</LINE> <LINE>for argument, unless the poet and the player went to</LINE> <LINE>cuffs in the question.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Is't possible?</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>O, there has been much throwing about of brains.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Do the boys carry it away?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Ay, that they do, my lord; Hercules and his load too.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It is not very strange; for mine uncle is king of</LINE> <LINE>Denmark, and those that would make mows at him while</LINE> <LINE>my father lived, give twenty, forty, fifty, an</LINE> <LINE>hundred ducats a-piece for his picture in little.</LINE> <LINE>'Sblood, there is something in this more than</LINE> <LINE>natural, if philosophy could find it out.</LINE> </SPEECH> <STAGEDIR>Flourish of trumpets within</STAGEDIR> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>There are the players.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Gentlemen, you are welcome to Elsinore. Your hands,</LINE> <LINE>come then: the appurtenance of welcome is fashion</LINE> <LINE>and ceremony: let me comply with you in this garb,</LINE> <LINE>lest my extent to the players, which, I tell you,</LINE> <LINE>must show fairly outward, should more appear like</LINE> <LINE>entertainment than yours. You are welcome: but my</LINE> <LINE>uncle-father and aunt-mother are deceived.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>In what, my dear lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I am but mad north-north-west: when the wind is</LINE> <LINE>southerly I know a hawk from a handsaw.</LINE> </SPEECH> <STAGEDIR>Enter POLONIUS</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Well be with you, gentlemen!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Hark you, Guildenstern; and you too: at each ear a</LINE> <LINE>hearer: that great baby you see there is not yet</LINE> <LINE>out of his swaddling-clouts.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Happily he's the second time come to them; for they</LINE> <LINE>say an old man is twice a child.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I will prophesy he comes to tell me of the players;</LINE> <LINE>mark it. You say right, sir: o' Monday morning;</LINE> <LINE>'twas so indeed.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>My lord, I have news to tell you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>My lord, I have news to tell you.</LINE> <LINE>When Roscius was an actor in Rome,--</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>The actors are come hither, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Buz, buz!</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Upon mine honour,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Then came each actor on his ass,--</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>The best actors in the world, either for tragedy,</LINE> <LINE>comedy, history, pastoral, pastoral-comical,</LINE> <LINE>historical-pastoral, tragical-historical, tragical-</LINE> <LINE>comical-historical-pastoral, scene individable, or</LINE> <LINE>poem unlimited: Seneca cannot be too heavy, nor</LINE> <LINE>Plautus too light. For the law of writ and the</LINE> <LINE>liberty, these are the only men.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O Jephthah, judge of Israel, what a treasure hadst thou!</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>What a treasure had he, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why,</LINE> <LINE>'One fair daughter and no more,</LINE> <LINE>The which he loved passing well.'</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> Still on my daughter.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Am I not i' the right, old Jephthah?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>If you call me Jephthah, my lord, I have a daughter</LINE> <LINE>that I love passing well.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nay, that follows not.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>What follows, then, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why,</LINE> <LINE>'As by lot, God wot,'</LINE> <LINE>and then, you know,</LINE> <LINE>'It came to pass, as most like it was,'--</LINE> <LINE>the first row of the pious chanson will show you</LINE> <LINE>more; for look, where my abridgement comes.</LINE> <STAGEDIR>Enter four or five Players</STAGEDIR> <LINE>You are welcome, masters; welcome, all. I am glad</LINE> <LINE>to see thee well. Welcome, good friends. O, my old</LINE> <LINE>friend! thy face is valenced since I saw thee last:</LINE> <LINE>comest thou to beard me in Denmark? What, my young</LINE> <LINE>lady and mistress! By'r lady, your ladyship is</LINE> <LINE>nearer to heaven than when I saw you last, by the</LINE> <LINE>altitude of a chopine. Pray God, your voice, like</LINE> <LINE>apiece of uncurrent gold, be not cracked within the</LINE> <LINE>ring. Masters, you are all welcome. We'll e'en</LINE> <LINE>to't like French falconers, fly at any thing we see:</LINE> <LINE>we'll have a speech straight: come, give us a taste</LINE> <LINE>of your quality; come, a passionate speech.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>What speech, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I heard thee speak me a speech once, but it was</LINE> <LINE>never acted; or, if it was, not above once; for the</LINE> <LINE>play, I remember, pleased not the million; 'twas</LINE> <LINE>caviare to the general: but it was--as I received</LINE> <LINE>it, and others, whose judgments in such matters</LINE> <LINE>cried in the top of mine--an excellent play, well</LINE> <LINE>digested in the scenes, set down with as much</LINE> <LINE>modesty as cunning. I remember, one said there</LINE> <LINE>were no sallets in the lines to make the matter</LINE> <LINE>savoury, nor no matter in the phrase that might</LINE> <LINE>indict the author of affectation; but called it an</LINE> <LINE>honest method, as wholesome as sweet, and by very</LINE> <LINE>much more handsome than fine. One speech in it I</LINE> <LINE>chiefly loved: 'twas Aeneas' tale to Dido; and</LINE> <LINE>thereabout of it especially, where he speaks of</LINE> <LINE>Priam's slaughter: if it live in your memory, begin</LINE> <LINE>at this line: let me see, let me see--</LINE> <LINE>'The rugged Pyrrhus, like the Hyrcanian beast,'--</LINE> <LINE>it is not so:--it begins with Pyrrhus:--</LINE> <LINE>'The rugged Pyrrhus, he whose sable arms,</LINE> <LINE>Black as his purpose, did the night resemble</LINE> <LINE>When he lay couched in the ominous horse,</LINE> <LINE>Hath now this dread and black complexion smear'd</LINE> <LINE>With heraldry more dismal; head to foot</LINE> <LINE>Now is he total gules; horridly trick'd</LINE> <LINE>With blood of fathers, mothers, daughters, sons,</LINE> <LINE>Baked and impasted with the parching streets,</LINE> <LINE>That lend a tyrannous and damned light</LINE> <LINE>To their lord's murder: roasted in wrath and fire,</LINE> <LINE>And thus o'er-sized with coagulate gore,</LINE> <LINE>With eyes like carbuncles, the hellish Pyrrhus</LINE> <LINE>Old grandsire Priam seeks.'</LINE> <LINE>So, proceed you.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>'Fore God, my lord, well spoken, with good accent and</LINE> <LINE>good discretion.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>'Anon he finds him</LINE> <LINE>Striking too short at Greeks; his antique sword,</LINE> <LINE>Rebellious to his arm, lies where it falls,</LINE> <LINE>Repugnant to command: unequal match'd,</LINE> <LINE>Pyrrhus at Priam drives; in rage strikes wide;</LINE> <LINE>But with the whiff and wind of his fell sword</LINE> <LINE>The unnerved father falls. Then senseless Ilium,</LINE> <LINE>Seeming to feel this blow, with flaming top</LINE> <LINE>Stoops to his base, and with a hideous crash</LINE> <LINE>Takes prisoner Pyrrhus' ear: for, lo! his sword,</LINE> <LINE>Which was declining on the milky head</LINE> <LINE>Of reverend Priam, seem'd i' the air to stick:</LINE> <LINE>So, as a painted tyrant, Pyrrhus stood,</LINE> <LINE>And like a neutral to his will and matter,</LINE> <LINE>Did nothing.</LINE> <LINE>But, as we often see, against some storm,</LINE> <LINE>A silence in the heavens, the rack stand still,</LINE> <LINE>The bold winds speechless and the orb below</LINE> <LINE>As hush as death, anon the dreadful thunder</LINE> <LINE>Doth rend the region, so, after Pyrrhus' pause,</LINE> <LINE>Aroused vengeance sets him new a-work;</LINE> <LINE>And never did the Cyclops' hammers fall</LINE> <LINE>On Mars's armour forged for proof eterne</LINE> <LINE>With less remorse than Pyrrhus' bleeding sword</LINE> <LINE>Now falls on Priam.</LINE> <LINE>Out, out, thou strumpet, Fortune! All you gods,</LINE> <LINE>In general synod 'take away her power;</LINE> <LINE>Break all the spokes and fellies from her wheel,</LINE> <LINE>And bowl the round nave down the hill of heaven,</LINE> <LINE>As low as to the fiends!'</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>This is too long.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It shall to the barber's, with your beard. Prithee,</LINE> <LINE>say on: he's for a jig or a tale of bawdry, or he</LINE> <LINE>sleeps: say on: come to Hecuba.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>'But who, O, who had seen the mobled queen--'</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>'The mobled queen?'</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>That's good; 'mobled queen' is good.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>'Run barefoot up and down, threatening the flames</LINE> <LINE>With bisson rheum; a clout upon that head</LINE> <LINE>Where late the diadem stood, and for a robe,</LINE> <LINE>About her lank and all o'er-teemed loins,</LINE> <LINE>A blanket, in the alarm of fear caught up;</LINE> <LINE>Who this had seen, with tongue in venom steep'd,</LINE> <LINE>'Gainst Fortune's state would treason have</LINE> <LINE>pronounced:</LINE> <LINE>But if the gods themselves did see her then</LINE> <LINE>When she saw Pyrrhus make malicious sport</LINE> <LINE>In mincing with his sword her husband's limbs,</LINE> <LINE>The instant burst of clamour that she made,</LINE> <LINE>Unless things mortal move them not at all,</LINE> <LINE>Would have made milch the burning eyes of heaven,</LINE> <LINE>And passion in the gods.'</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Look, whether he has not turned his colour and has</LINE> <LINE>tears in's eyes. Pray you, no more.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>'Tis well: I'll have thee speak out the rest soon.</LINE> <LINE>Good my lord, will you see the players well</LINE> <LINE>bestowed? Do you hear, let them be well used; for</LINE> <LINE>they are the abstract and brief chronicles of the</LINE> <LINE>time: after your death you were better have a bad</LINE> <LINE>epitaph than their ill report while you live.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>My lord, I will use them according to their desert.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>God's bodykins, man, much better: use every man</LINE> <LINE>after his desert, and who should 'scape whipping?</LINE> <LINE>Use them after your own honour and dignity: the less</LINE> <LINE>they deserve, the more merit is in your bounty.</LINE> <LINE>Take them in.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Come, sirs.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Follow him, friends: we'll hear a play to-morrow.</LINE> <STAGEDIR>Exit POLONIUS with all the Players but the First</STAGEDIR> <LINE>Dost thou hear me, old friend; can you play the</LINE> <LINE>Murder of Gonzago?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>Ay, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>We'll ha't to-morrow night. You could, for a need,</LINE> <LINE>study a speech of some dozen or sixteen lines, which</LINE> <LINE>I would set down and insert in't, could you not?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>Ay, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Very well. Follow that lord; and look you mock him</LINE> <LINE>not.</LINE> <STAGEDIR>Exit First Player</STAGEDIR> <LINE>My good friends, I'll leave you till night: you are</LINE> <LINE>welcome to Elsinore.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Good my lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, so, God be wi' ye;</LINE> <STAGEDIR>Exeunt ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <LINE>Now I am alone.</LINE> <LINE>O, what a rogue and peasant slave am I!</LINE> <LINE>Is it not monstrous that this player here,</LINE> <LINE>But in a fiction, in a dream of passion,</LINE> <LINE>Could force his soul so to his own conceit</LINE> <LINE>That from her working all his visage wann'd,</LINE> <LINE>Tears in his eyes, distraction in's aspect,</LINE> <LINE>A broken voice, and his whole function suiting</LINE> <LINE>With forms to his conceit? and all for nothing!</LINE> <LINE>For Hecuba!</LINE> <LINE>What's Hecuba to him, or he to Hecuba,</LINE> <LINE>That he should weep for her? What would he do,</LINE> <LINE>Had he the motive and the cue for passion</LINE> <LINE>That I have? He would drown the stage with tears</LINE> <LINE>And cleave the general ear with horrid speech,</LINE> <LINE>Make mad the guilty and appal the free,</LINE> <LINE>Confound the ignorant, and amaze indeed</LINE> <LINE>The very faculties of eyes and ears. Yet I,</LINE> <LINE>A dull and muddy-mettled rascal, peak,</LINE> <LINE>Like John-a-dreams, unpregnant of my cause,</LINE> <LINE>And can say nothing; no, not for a king,</LINE> <LINE>Upon whose property and most dear life</LINE> <LINE>A damn'd defeat was made. Am I a coward?</LINE> <LINE>Who calls me villain? breaks my pate across?</LINE> <LINE>Plucks off my beard, and blows it in my face?</LINE> <LINE>Tweaks me by the nose? gives me the lie i' the throat,</LINE> <LINE>As deep as to the lungs? who does me this?</LINE> <LINE>Ha!</LINE> <LINE>'Swounds, I should take it: for it cannot be</LINE> <LINE>But I am pigeon-liver'd and lack gall</LINE> <LINE>To make oppression bitter, or ere this</LINE> <LINE>I should have fatted all the region kites</LINE> <LINE>With this slave's offal: bloody, bawdy villain!</LINE> <LINE>Remorseless, treacherous, lecherous, kindless villain!</LINE> <LINE>O, vengeance!</LINE> <LINE>Why, what an ass am I! This is most brave,</LINE> <LINE>That I, the son of a dear father murder'd,</LINE> <LINE>Prompted to my revenge by heaven and hell,</LINE> <LINE>Must, like a whore, unpack my heart with words,</LINE> <LINE>And fall a-cursing, like a very drab,</LINE> <LINE>A scullion!</LINE> <LINE>Fie upon't! foh! About, my brain! I have heard</LINE> <LINE>That guilty creatures sitting at a play</LINE> <LINE>Have by the very cunning of the scene</LINE> <LINE>Been struck so to the soul that presently</LINE> <LINE>They have proclaim'd their malefactions;</LINE> <LINE>For murder, though it have no tongue, will speak</LINE> <LINE>With most miraculous organ. I'll have these players</LINE> <LINE>Play something like the murder of my father</LINE> <LINE>Before mine uncle: I'll observe his looks;</LINE> <LINE>I'll tent him to the quick: if he but blench,</LINE> <LINE>I know my course. The spirit that I have seen</LINE> <LINE>May be the devil: and the devil hath power</LINE> <LINE>To assume a pleasing shape; yea, and perhaps</LINE> <LINE>Out of my weakness and my melancholy,</LINE> <LINE>As he is very potent with such spirits,</LINE> <LINE>Abuses me to damn me: I'll have grounds</LINE> <LINE>More relative than this: the play 's the thing</LINE> <LINE>Wherein I'll catch the conscience of the king.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> </SCENE> </ACT> <ACT><TITLE>ACT III</TITLE> <SCENE><TITLE>SCENE I. A room in the castle.</TITLE> <STAGEDIR>Enter KING CLAUDIUS, QUEEN GERTRUDE, POLONIUS, OPHELIA, ROSENCRANTZ, and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>And can you, by no drift of circumstance,</LINE> <LINE>Get from him why he puts on this confusion,</LINE> <LINE>Grating so harshly all his days of quiet</LINE> <LINE>With turbulent and dangerous lunacy?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>He does confess he feels himself distracted;</LINE> <LINE>But from what cause he will by no means speak.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Nor do we find him forward to be sounded,</LINE> <LINE>But, with a crafty madness, keeps aloof,</LINE> <LINE>When we would bring him on to some confession</LINE> <LINE>Of his true state.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Did he receive you well?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Most like a gentleman.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>But with much forcing of his disposition.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Niggard of question; but, of our demands,</LINE> <LINE>Most free in his reply.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Did you assay him?</LINE> <LINE>To any pastime?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Madam, it so fell out, that certain players</LINE> <LINE>We o'er-raught on the way: of these we told him;</LINE> <LINE>And there did seem in him a kind of joy</LINE> <LINE>To hear of it: they are about the court,</LINE> <LINE>And, as I think, they have already order</LINE> <LINE>This night to play before him.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>'Tis most true:</LINE> <LINE>And he beseech'd me to entreat your majesties</LINE> <LINE>To hear and see the matter.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>With all my heart; and it doth much content me</LINE> <LINE>To hear him so inclined.</LINE> <LINE>Good gentlemen, give him a further edge,</LINE> <LINE>And drive his purpose on to these delights.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>We shall, my lord.</LINE> </SPEECH> <STAGEDIR>Exeunt ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Sweet Gertrude, leave us too;</LINE> <LINE>For we have closely sent for Hamlet hither,</LINE> <LINE>That he, as 'twere by accident, may here</LINE> <LINE>Affront Ophelia:</LINE> <LINE>Her father and myself, lawful espials,</LINE> <LINE>Will so bestow ourselves that, seeing, unseen,</LINE> <LINE>We may of their encounter frankly judge,</LINE> <LINE>And gather by him, as he is behaved,</LINE> <LINE>If 't be the affliction of his love or no</LINE> <LINE>That thus he suffers for.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>I shall obey you.</LINE> <LINE>And for your part, Ophelia, I do wish</LINE> <LINE>That your good beauties be the happy cause</LINE> <LINE>Of Hamlet's wildness: so shall I hope your virtues</LINE> <LINE>Will bring him to his wonted way again,</LINE> <LINE>To both your honours.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Madam, I wish it may.</LINE> </SPEECH> <STAGEDIR>Exit QUEEN GERTRUDE</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Ophelia, walk you here. Gracious, so please you,</LINE> <LINE>We will bestow ourselves.</LINE> <STAGEDIR>To OPHELIA</STAGEDIR> <LINE>Read on this book;</LINE> <LINE>That show of such an exercise may colour</LINE> <LINE>Your loneliness. We are oft to blame in this,--</LINE> <LINE>'Tis too much proved--that with devotion's visage</LINE> <LINE>And pious action we do sugar o'er</LINE> <LINE>The devil himself.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> O, 'tis too true!</LINE> <LINE>How smart a lash that speech doth give my conscience!</LINE> <LINE>The harlot's cheek, beautied with plastering art,</LINE> <LINE>Is not more ugly to the thing that helps it</LINE> <LINE>Than is my deed to my most painted word:</LINE> <LINE>O heavy burthen!</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>I hear him coming: let's withdraw, my lord.</LINE> </SPEECH> <STAGEDIR>Exeunt KING CLAUDIUS and POLONIUS</STAGEDIR> <STAGEDIR>Enter HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>To be, or not to be: that is the question:</LINE> <LINE>Whether 'tis nobler in the mind to suffer</LINE> <LINE>The slings and arrows of outrageous fortune,</LINE> <LINE>Or to take arms against a sea of troubles,</LINE> <LINE>And by opposing end them? To die: to sleep;</LINE> <LINE>No more; and by a sleep to say we end</LINE> <LINE>The heart-ache and the thousand natural shocks</LINE> <LINE>That flesh is heir to, 'tis a consummation</LINE> <LINE>Devoutly to be wish'd. To die, to sleep;</LINE> <LINE>To sleep: perchance to dream: ay, there's the rub;</LINE> <LINE>For in that sleep of death what dreams may come</LINE> <LINE>When we have shuffled off this mortal coil,</LINE> <LINE>Must give us pause: there's the respect</LINE> <LINE>That makes calamity of so long life;</LINE> <LINE>For who would bear the whips and scorns of time,</LINE> <LINE>The oppressor's wrong, the proud man's contumely,</LINE> <LINE>The pangs of despised love, the law's delay,</LINE> <LINE>The insolence of office and the spurns</LINE> <LINE>That patient merit of the unworthy takes,</LINE> <LINE>When he himself might his quietus make</LINE> <LINE>With a bare bodkin? who would fardels bear,</LINE> <LINE>To grunt and sweat under a weary life,</LINE> <LINE>But that the dread of something after death,</LINE> <LINE>The undiscover'd country from whose bourn</LINE> <LINE>No traveller returns, puzzles the will</LINE> <LINE>And makes us rather bear those ills we have</LINE> <LINE>Than fly to others that we know not of?</LINE> <LINE>Thus conscience does make cowards of us all;</LINE> <LINE>And thus the native hue of resolution</LINE> <LINE>Is sicklied o'er with the pale cast of thought,</LINE> <LINE>And enterprises of great pith and moment</LINE> <LINE>With this regard their currents turn awry,</LINE> <LINE>And lose the name of action.--Soft you now!</LINE> <LINE>The fair Ophelia! Nymph, in thy orisons</LINE> <LINE>Be all my sins remember'd.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Good my lord,</LINE> <LINE>How does your honour for this many a day?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I humbly thank you; well, well, well.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>My lord, I have remembrances of yours,</LINE> <LINE>That I have longed long to re-deliver;</LINE> <LINE>I pray you, now receive them.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, not I;</LINE> <LINE>I never gave you aught.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>My honour'd lord, you know right well you did;</LINE> <LINE>And, with them, words of so sweet breath composed</LINE> <LINE>As made the things more rich: their perfume lost,</LINE> <LINE>Take these again; for to the noble mind</LINE> <LINE>Rich gifts wax poor when givers prove unkind.</LINE> <LINE>There, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ha, ha! are you honest?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>My lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Are you fair?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>What means your lordship?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>That if you be honest and fair, your honesty should</LINE> <LINE>admit no discourse to your beauty.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Could beauty, my lord, have better commerce than</LINE> <LINE>with honesty?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, truly; for the power of beauty will sooner</LINE> <LINE>transform honesty from what it is to a bawd than the</LINE> <LINE>force of honesty can translate beauty into his</LINE> <LINE>likeness: this was sometime a paradox, but now the</LINE> <LINE>time gives it proof. I did love you once.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Indeed, my lord, you made me believe so.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>You should not have believed me; for virtue cannot</LINE> <LINE>so inoculate our old stock but we shall relish of</LINE> <LINE>it: I loved you not.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>I was the more deceived.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Get thee to a nunnery: why wouldst thou be a</LINE> <LINE>breeder of sinners? I am myself indifferent honest;</LINE> <LINE>but yet I could accuse me of such things that it</LINE> <LINE>were better my mother had not borne me: I am very</LINE> <LINE>proud, revengeful, ambitious, with more offences at</LINE> <LINE>my beck than I have thoughts to put them in,</LINE> <LINE>imagination to give them shape, or time to act them</LINE> <LINE>in. What should such fellows as I do crawling</LINE> <LINE>between earth and heaven? We are arrant knaves,</LINE> <LINE>all; believe none of us. Go thy ways to a nunnery.</LINE> <LINE>Where's your father?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>At home, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Let the doors be shut upon him, that he may play the</LINE> <LINE>fool no where but in's own house. Farewell.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>O, help him, you sweet heavens!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>If thou dost marry, I'll give thee this plague for</LINE> <LINE>thy dowry: be thou as chaste as ice, as pure as</LINE> <LINE>snow, thou shalt not escape calumny. Get thee to a</LINE> <LINE>nunnery, go: farewell. Or, if thou wilt needs</LINE> <LINE>marry, marry a fool; for wise men know well enough</LINE> <LINE>what monsters you make of them. To a nunnery, go,</LINE> <LINE>and quickly too. Farewell.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>O heavenly powers, restore him!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I have heard of your paintings too, well enough; God</LINE> <LINE>has given you one face, and you make yourselves</LINE> <LINE>another: you jig, you amble, and you lisp, and</LINE> <LINE>nick-name God's creatures, and make your wantonness</LINE> <LINE>your ignorance. Go to, I'll no more on't; it hath</LINE> <LINE>made me mad. I say, we will have no more marriages:</LINE> <LINE>those that are married already, all but one, shall</LINE> <LINE>live; the rest shall keep as they are. To a</LINE> <LINE>nunnery, go.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>O, what a noble mind is here o'erthrown!</LINE> <LINE>The courtier's, soldier's, scholar's, eye, tongue, sword;</LINE> <LINE>The expectancy and rose of the fair state,</LINE> <LINE>The glass of fashion and the mould of form,</LINE> <LINE>The observed of all observers, quite, quite down!</LINE> <LINE>And I, of ladies most deject and wretched,</LINE> <LINE>That suck'd the honey of his music vows,</LINE> <LINE>Now see that noble and most sovereign reason,</LINE> <LINE>Like sweet bells jangled, out of tune and harsh;</LINE> <LINE>That unmatch'd form and feature of blown youth</LINE> <LINE>Blasted with ecstasy: O, woe is me,</LINE> <LINE>To have seen what I have seen, see what I see!</LINE> </SPEECH> <STAGEDIR>Re-enter KING CLAUDIUS and POLONIUS</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Love! his affections do not that way tend;</LINE> <LINE>Nor what he spake, though it lack'd form a little,</LINE> <LINE>Was not like madness. There's something in his soul,</LINE> <LINE>O'er which his melancholy sits on brood;</LINE> <LINE>And I do doubt the hatch and the disclose</LINE> <LINE>Will be some danger: which for to prevent,</LINE> <LINE>I have in quick determination</LINE> <LINE>Thus set it down: he shall with speed to England,</LINE> <LINE>For the demand of our neglected tribute</LINE> <LINE>Haply the seas and countries different</LINE> <LINE>With variable objects shall expel</LINE> <LINE>This something-settled matter in his heart,</LINE> <LINE>Whereon his brains still beating puts him thus</LINE> <LINE>From fashion of himself. What think you on't?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>It shall do well: but yet do I believe</LINE> <LINE>The origin and commencement of his grief</LINE> <LINE>Sprung from neglected love. How now, Ophelia!</LINE> <LINE>You need not tell us what Lord Hamlet said;</LINE> <LINE>We heard it all. My lord, do as you please;</LINE> <LINE>But, if you hold it fit, after the play</LINE> <LINE>Let his queen mother all alone entreat him</LINE> <LINE>To show his grief: let her be round with him;</LINE> <LINE>And I'll be placed, so please you, in the ear</LINE> <LINE>Of all their conference. If she find him not,</LINE> <LINE>To England send him, or confine him where</LINE> <LINE>Your wisdom best shall think.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>It shall be so:</LINE> <LINE>Madness in great ones must not unwatch'd go.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE II. A hall in the castle.</TITLE> <STAGEDIR>Enter HAMLET and Players</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Speak the speech, I pray you, as I pronounced it to</LINE> <LINE>you, trippingly on the tongue: but if you mouth it,</LINE> <LINE>as many of your players do, I had as lief the</LINE> <LINE>town-crier spoke my lines. Nor do not saw the air</LINE> <LINE>too much with your hand, thus, but use all gently;</LINE> <LINE>for in the very torrent, tempest, and, as I may say,</LINE> <LINE>the whirlwind of passion, you must acquire and beget</LINE> <LINE>a temperance that may give it smoothness. O, it</LINE> <LINE>offends me to the soul to hear a robustious</LINE> <LINE>periwig-pated fellow tear a passion to tatters, to</LINE> <LINE>very rags, to split the ears of the groundlings, who</LINE> <LINE>for the most part are capable of nothing but</LINE> <LINE>inexplicable dumbshows and noise: I would have such</LINE> <LINE>a fellow whipped for o'erdoing Termagant; it</LINE> <LINE>out-herods Herod: pray you, avoid it.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>I warrant your honour.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Be not too tame neither, but let your own discretion</LINE> <LINE>be your tutor: suit the action to the word, the</LINE> <LINE>word to the action; with this special o'erstep not</LINE> <LINE>the modesty of nature: for any thing so overdone is</LINE> <LINE>from the purpose of playing, whose end, both at the</LINE> <LINE>first and now, was and is, to hold, as 'twere, the</LINE> <LINE>mirror up to nature; to show virtue her own feature,</LINE> <LINE>scorn her own image, and the very age and body of</LINE> <LINE>the time his form and pressure. Now this overdone,</LINE> <LINE>or come tardy off, though it make the unskilful</LINE> <LINE>laugh, cannot but make the judicious grieve; the</LINE> <LINE>censure of the which one must in your allowance</LINE> <LINE>o'erweigh a whole theatre of others. O, there be</LINE> <LINE>players that I have seen play, and heard others</LINE> <LINE>praise, and that highly, not to speak it profanely,</LINE> <LINE>that, neither having the accent of Christians nor</LINE> <LINE>the gait of Christian, pagan, nor man, have so</LINE> <LINE>strutted and bellowed that I have thought some of</LINE> <LINE>nature's journeymen had made men and not made them</LINE> <LINE>well, they imitated humanity so abominably.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Player</SPEAKER> <LINE>I hope we have reformed that indifferently with us,</LINE> <LINE>sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O, reform it altogether. And let those that play</LINE> <LINE>your clowns speak no more than is set down for them;</LINE> <LINE>for there be of them that will themselves laugh, to</LINE> <LINE>set on some quantity of barren spectators to laugh</LINE> <LINE>too; though, in the mean time, some necessary</LINE> <LINE>question of the play be then to be considered:</LINE> <LINE>that's villanous, and shows a most pitiful ambition</LINE> <LINE>in the fool that uses it. Go, make you ready.</LINE> <STAGEDIR>Exeunt Players</STAGEDIR> <STAGEDIR>Enter POLONIUS, ROSENCRANTZ, and GUILDENSTERN</STAGEDIR> <LINE>How now, my lord! I will the king hear this piece of work?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>And the queen too, and that presently.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Bid the players make haste.</LINE> <STAGEDIR>Exit POLONIUS</STAGEDIR> <LINE>Will you two help to hasten them?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>We will, my lord.</LINE> </SPEECH> <STAGEDIR>Exeunt ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What ho! Horatio!</LINE> </SPEECH> <STAGEDIR>Enter HORATIO</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Here, sweet lord, at your service.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Horatio, thou art e'en as just a man</LINE> <LINE>As e'er my conversation coped withal.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>O, my dear lord,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nay, do not think I flatter;</LINE> <LINE>For what advancement may I hope from thee</LINE> <LINE>That no revenue hast but thy good spirits,</LINE> <LINE>To feed and clothe thee? Why should the poor be flatter'd?</LINE> <LINE>No, let the candied tongue lick absurd pomp,</LINE> <LINE>And crook the pregnant hinges of the knee</LINE> <LINE>Where thrift may follow fawning. Dost thou hear?</LINE> <LINE>Since my dear soul was mistress of her choice</LINE> <LINE>And could of men distinguish, her election</LINE> <LINE>Hath seal'd thee for herself; for thou hast been</LINE> <LINE>As one, in suffering all, that suffers nothing,</LINE> <LINE>A man that fortune's buffets and rewards</LINE> <LINE>Hast ta'en with equal thanks: and blest are those</LINE> <LINE>Whose blood and judgment are so well commingled,</LINE> <LINE>That they are not a pipe for fortune's finger</LINE> <LINE>To sound what stop she please. Give me that man</LINE> <LINE>That is not passion's slave, and I will wear him</LINE> <LINE>In my heart's core, ay, in my heart of heart,</LINE> <LINE>As I do thee.--Something too much of this.--</LINE> <LINE>There is a play to-night before the king;</LINE> <LINE>One scene of it comes near the circumstance</LINE> <LINE>Which I have told thee of my father's death:</LINE> <LINE>I prithee, when thou seest that act afoot,</LINE> <LINE>Even with the very comment of thy soul</LINE> <LINE>Observe mine uncle: if his occulted guilt</LINE> <LINE>Do not itself unkennel in one speech,</LINE> <LINE>It is a damned ghost that we have seen,</LINE> <LINE>And my imaginations are as foul</LINE> <LINE>As Vulcan's stithy. Give him heedful note;</LINE> <LINE>For I mine eyes will rivet to his face,</LINE> <LINE>And after we will both our judgments join</LINE> <LINE>In censure of his seeming.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Well, my lord:</LINE> <LINE>If he steal aught the whilst this play is playing,</LINE> <LINE>And 'scape detecting, I will pay the theft.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>They are coming to the play; I must be idle:</LINE> <LINE>Get you a place.</LINE> </SPEECH> <STAGEDIR>Danish march. A flourish. Enter KING CLAUDIUS, QUEEN GERTRUDE, POLONIUS, OPHELIA, ROSENCRANTZ, GUILDENSTERN, and others</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>How fares our cousin Hamlet?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Excellent, i' faith; of the chameleon's dish: I eat</LINE> <LINE>the air, promise-crammed: you cannot feed capons so.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>I have nothing with this answer, Hamlet; these words</LINE> <LINE>are not mine.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, nor mine now.</LINE> <STAGEDIR>To POLONIUS</STAGEDIR> <LINE>My lord, you played once i' the university, you say?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>That did I, my lord; and was accounted a good actor.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What did you enact?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>I did enact Julius Caesar: I was killed i' the</LINE> <LINE>Capitol; Brutus killed me.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It was a brute part of him to kill so capital a calf</LINE> <LINE>there. Be the players ready?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Ay, my lord; they stay upon your patience.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Come hither, my dear Hamlet, sit by me.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, good mother, here's metal more attractive.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE><STAGEDIR>To KING CLAUDIUS</STAGEDIR> O, ho! do you mark that?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Lady, shall I lie in your lap?</LINE> </SPEECH> <STAGEDIR>Lying down at OPHELIA's feet</STAGEDIR> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>No, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I mean, my head upon your lap?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Ay, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Do you think I meant country matters?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>I think nothing, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>That's a fair thought to lie between maids' legs.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>What is, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nothing.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>You are merry, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Who, I?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Ay, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O God, your only jig-maker. What should a man do</LINE> <LINE>but be merry? for, look you, how cheerfully my</LINE> <LINE>mother looks, and my father died within these two hours.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Nay, 'tis twice two months, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>So long? Nay then, let the devil wear black, for</LINE> <LINE>I'll have a suit of sables. O heavens! die two</LINE> <LINE>months ago, and not forgotten yet? Then there's</LINE> <LINE>hope a great man's memory may outlive his life half</LINE> <LINE>a year: but, by'r lady, he must build churches,</LINE> <LINE>then; or else shall he suffer not thinking on, with</LINE> <LINE>the hobby-horse, whose epitaph is 'For, O, for, O,</LINE> <LINE>the hobby-horse is forgot.'</LINE> <STAGEDIR>Hautboys play. The dumb-show enters</STAGEDIR> </SPEECH> <STAGEDIR>Enter a King and a Queen very lovingly; the Queen embracing him, and he her. She kneels, and makes show of protestation unto him. He takes her up, and declines his head upon her neck: lays him down upon a bank of flowers: she, seeing him asleep, leaves him. Anon comes in a fellow, takes off his crown, kisses it, and pours poison in the King's ears, and exit. The Queen returns; finds the King dead, and makes passionate action. The Poisoner, with some two or three Mutes, comes in again, seeming to lament with her. The dead body is carried away. The Poisoner wooes the Queen with gifts: she seems loath and unwilling awhile, but in the end accepts his love</STAGEDIR> <STAGEDIR>Exeunt</STAGEDIR> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>What means this, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Marry, this is miching mallecho; it means mischief.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Belike this show imports the argument of the play.</LINE> </SPEECH> <STAGEDIR>Enter Prologue</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>We shall know by this fellow: the players cannot</LINE> <LINE>keep counsel; they'll tell all.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Will he tell us what this show meant?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, or any show that you'll show him: be not you</LINE> <LINE>ashamed to show, he'll not shame to tell you what it means.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>You are naught, you are naught: I'll mark the play.</LINE> </SPEECH> <SPEECH> <SPEAKER>Prologue</SPEAKER> <LINE>For us, and for our tragedy,</LINE> <LINE>Here stooping to your clemency,</LINE> <LINE>We beg your hearing patiently.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Is this a prologue, or the posy of a ring?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>'Tis brief, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>As woman's love.</LINE> </SPEECH> <STAGEDIR>Enter two Players, King and Queen</STAGEDIR> <SPEECH> <SPEAKER>Player King</SPEAKER> <LINE>Full thirty times hath Phoebus' cart gone round</LINE> <LINE>Neptune's salt wash and Tellus' orbed ground,</LINE> <LINE>And thirty dozen moons with borrow'd sheen</LINE> <LINE>About the world have times twelve thirties been,</LINE> <LINE>Since love our hearts and Hymen did our hands</LINE> <LINE>Unite commutual in most sacred bands.</LINE> </SPEECH> <SPEECH> <SPEAKER>Player Queen</SPEAKER> <LINE>So many journeys may the sun and moon</LINE> <LINE>Make us again count o'er ere love be done!</LINE> <LINE>But, woe is me, you are so sick of late,</LINE> <LINE>So far from cheer and from your former state,</LINE> <LINE>That I distrust you. Yet, though I distrust,</LINE> <LINE>Discomfort you, my lord, it nothing must:</LINE> <LINE>For women's fear and love holds quantity;</LINE> <LINE>In neither aught, or in extremity.</LINE> <LINE>Now, what my love is, proof hath made you know;</LINE> <LINE>And as my love is sized, my fear is so:</LINE> <LINE>Where love is great, the littlest doubts are fear;</LINE> <LINE>Where little fears grow great, great love grows there.</LINE> </SPEECH> <SPEECH> <SPEAKER>Player King</SPEAKER> <LINE>'Faith, I must leave thee, love, and shortly too;</LINE> <LINE>My operant powers their functions leave to do:</LINE> <LINE>And thou shalt live in this fair world behind,</LINE> <LINE>Honour'd, beloved; and haply one as kind</LINE> <LINE>For husband shalt thou--</LINE> </SPEECH> <SPEECH> <SPEAKER>Player Queen</SPEAKER> <LINE>O, confound the rest!</LINE> <LINE>Such love must needs be treason in my breast:</LINE> <LINE>In second husband let me be accurst!</LINE> <LINE>None wed the second but who kill'd the first.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> Wormwood, wormwood.</LINE> </SPEECH> <SPEECH> <SPEAKER>Player Queen</SPEAKER> <LINE>The instances that second marriage move</LINE> <LINE>Are base respects of thrift, but none of love:</LINE> <LINE>A second time I kill my husband dead,</LINE> <LINE>When second husband kisses me in bed.</LINE> </SPEECH> <SPEECH> <SPEAKER>Player King</SPEAKER> <LINE>I do believe you think what now you speak;</LINE> <LINE>But what we do determine oft we break.</LINE> <LINE>Purpose is but the slave to memory,</LINE> <LINE>Of violent birth, but poor validity;</LINE> <LINE>Which now, like fruit unripe, sticks on the tree;</LINE> <LINE>But fall, unshaken, when they mellow be.</LINE> <LINE>Most necessary 'tis that we forget</LINE> <LINE>To pay ourselves what to ourselves is debt:</LINE> <LINE>What to ourselves in passion we propose,</LINE> <LINE>The passion ending, doth the purpose lose.</LINE> <LINE>The violence of either grief or joy</LINE> <LINE>Their own enactures with themselves destroy:</LINE> <LINE>Where joy most revels, grief doth most lament;</LINE> <LINE>Grief joys, joy grieves, on slender accident.</LINE> <LINE>This world is not for aye, nor 'tis not strange</LINE> <LINE>That even our loves should with our fortunes change;</LINE> <LINE>For 'tis a question left us yet to prove,</LINE> <LINE>Whether love lead fortune, or else fortune love.</LINE> <LINE>The great man down, you mark his favourite flies;</LINE> <LINE>The poor advanced makes friends of enemies.</LINE> <LINE>And hitherto doth love on fortune tend;</LINE> <LINE>For who not needs shall never lack a friend,</LINE> <LINE>And who in want a hollow friend doth try,</LINE> <LINE>Directly seasons him his enemy.</LINE> <LINE>But, orderly to end where I begun,</LINE> <LINE>Our wills and fates do so contrary run</LINE> <LINE>That our devices still are overthrown;</LINE> <LINE>Our thoughts are ours, their ends none of our own:</LINE> <LINE>So think thou wilt no second husband wed;</LINE> <LINE>But die thy thoughts when thy first lord is dead.</LINE> </SPEECH> <SPEECH> <SPEAKER>Player Queen</SPEAKER> <LINE>Nor earth to me give food, nor heaven light!</LINE> <LINE>Sport and repose lock from me day and night!</LINE> <LINE>To desperation turn my trust and hope!</LINE> <LINE>An anchor's cheer in prison be my scope!</LINE> <LINE>Each opposite that blanks the face of joy</LINE> <LINE>Meet what I would have well and it destroy!</LINE> <LINE>Both here and hence pursue me lasting strife,</LINE> <LINE>If, once a widow, ever I be wife!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>If she should break it now!</LINE> </SPEECH> <SPEECH> <SPEAKER>Player King</SPEAKER> <LINE>'Tis deeply sworn. Sweet, leave me here awhile;</LINE> <LINE>My spirits grow dull, and fain I would beguile</LINE> <LINE>The tedious day with sleep.</LINE> </SPEECH> <STAGEDIR>Sleeps</STAGEDIR> <SPEECH> <SPEAKER>Player Queen</SPEAKER> <LINE>Sleep rock thy brain,</LINE> <LINE>And never come mischance between us twain!</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Madam, how like you this play?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>The lady protests too much, methinks.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O, but she'll keep her word.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Have you heard the argument? Is there no offence in 't?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, no, they do but jest, poison in jest; no offence</LINE> <LINE>i' the world.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>What do you call the play?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The Mouse-trap. Marry, how? Tropically. This play</LINE> <LINE>is the image of a murder done in Vienna: Gonzago is</LINE> <LINE>the duke's name; his wife, Baptista: you shall see</LINE> <LINE>anon; 'tis a knavish piece of work: but what o'</LINE> <LINE>that? your majesty and we that have free souls, it</LINE> <LINE>touches us not: let the galled jade wince, our</LINE> <LINE>withers are unwrung.</LINE> <STAGEDIR>Enter LUCIANUS</STAGEDIR> <LINE>This is one Lucianus, nephew to the king.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>You are as good as a chorus, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I could interpret between you and your love, if I</LINE> <LINE>could see the puppets dallying.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>You are keen, my lord, you are keen.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It would cost you a groaning to take off my edge.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Still better, and worse.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>So you must take your husbands. Begin, murderer;</LINE> <LINE>pox, leave thy damnable faces, and begin. Come:</LINE> <LINE>'the croaking raven doth bellow for revenge.'</LINE> </SPEECH> <SPEECH> <SPEAKER>LUCIANUS</SPEAKER> <LINE>Thoughts black, hands apt, drugs fit, and time agreeing;</LINE> <LINE>Confederate season, else no creature seeing;</LINE> <LINE>Thou mixture rank, of midnight weeds collected,</LINE> <LINE>With Hecate's ban thrice blasted, thrice infected,</LINE> <LINE>Thy natural magic and dire property,</LINE> <LINE>On wholesome life usurp immediately.</LINE> </SPEECH> <STAGEDIR>Pours the poison into the sleeper's ears</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>He poisons him i' the garden for's estate. His</LINE> <LINE>name's Gonzago: the story is extant, and writ in</LINE> <LINE>choice Italian: you shall see anon how the murderer</LINE> <LINE>gets the love of Gonzago's wife.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>The king rises.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What, frighted with false fire!</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>How fares my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Give o'er the play.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Give me some light: away!</LINE> </SPEECH> <SPEECH> <SPEAKER>All</SPEAKER> <LINE>Lights, lights, lights!</LINE> </SPEECH> <STAGEDIR>Exeunt all but HAMLET and HORATIO</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, let the stricken deer go weep,</LINE> <LINE>The hart ungalled play;</LINE> <LINE>For some must watch, while some must sleep:</LINE> <LINE>So runs the world away.</LINE> <LINE>Would not this, sir, and a forest of feathers-- if</LINE> <LINE>the rest of my fortunes turn Turk with me--with two</LINE> <LINE>Provincial roses on my razed shoes, get me a</LINE> <LINE>fellowship in a cry of players, sir?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Half a share.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>A whole one, I.</LINE> <LINE>For thou dost know, O Damon dear,</LINE> <LINE>This realm dismantled was</LINE> <LINE>Of Jove himself; and now reigns here</LINE> <LINE>A very, very--pajock.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>You might have rhymed.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O good Horatio, I'll take the ghost's word for a</LINE> <LINE>thousand pound. Didst perceive?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Very well, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Upon the talk of the poisoning?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>I did very well note him.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ah, ha! Come, some music! come, the recorders!</LINE> <LINE>For if the king like not the comedy,</LINE> <LINE>Why then, belike, he likes it not, perdy.</LINE> <LINE>Come, some music!</LINE> </SPEECH> <STAGEDIR>Re-enter ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Good my lord, vouchsafe me a word with you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Sir, a whole history.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>The king, sir,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, sir, what of him?</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Is in his retirement marvellous distempered.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>With drink, sir?</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>No, my lord, rather with choler.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Your wisdom should show itself more richer to</LINE> <LINE>signify this to his doctor; for, for me to put him</LINE> <LINE>to his purgation would perhaps plunge him into far</LINE> <LINE>more choler.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Good my lord, put your discourse into some frame and</LINE> <LINE>start not so wildly from my affair.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I am tame, sir: pronounce.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>The queen, your mother, in most great affliction of</LINE> <LINE>spirit, hath sent me to you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>You are welcome.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Nay, good my lord, this courtesy is not of the right</LINE> <LINE>breed. If it shall please you to make me a</LINE> <LINE>wholesome answer, I will do your mother's</LINE> <LINE>commandment: if not, your pardon and my return</LINE> <LINE>shall be the end of my business.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Sir, I cannot.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>What, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Make you a wholesome answer; my wit's diseased: but,</LINE> <LINE>sir, such answer as I can make, you shall command;</LINE> <LINE>or, rather, as you say, my mother: therefore no</LINE> <LINE>more, but to the matter: my mother, you say,--</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Then thus she says; your behavior hath struck her</LINE> <LINE>into amazement and admiration.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O wonderful son, that can so astonish a mother! But</LINE> <LINE>is there no sequel at the heels of this mother's</LINE> <LINE>admiration? Impart.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>She desires to speak with you in her closet, ere you</LINE> <LINE>go to bed.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>We shall obey, were she ten times our mother. Have</LINE> <LINE>you any further trade with us?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>My lord, you once did love me.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>So I do still, by these pickers and stealers.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Good my lord, what is your cause of distemper? you</LINE> <LINE>do, surely, bar the door upon your own liberty, if</LINE> <LINE>you deny your griefs to your friend.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Sir, I lack advancement.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>How can that be, when you have the voice of the king</LINE> <LINE>himself for your succession in Denmark?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, but sir, 'While the grass grows,'--the proverb</LINE> <LINE>is something musty.</LINE> <STAGEDIR>Re-enter Players with recorders</STAGEDIR> <LINE>O, the recorders! let me see one. To withdraw with</LINE> <LINE>you:--why do you go about to recover the wind of me,</LINE> <LINE>as if you would drive me into a toil?</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>O, my lord, if my duty be too bold, my love is too</LINE> <LINE>unmannerly.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I do not well understand that. Will you play upon</LINE> <LINE>this pipe?</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>My lord, I cannot.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I pray you.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>Believe me, I cannot.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I do beseech you.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>I know no touch of it, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>'Tis as easy as lying: govern these ventages with</LINE> <LINE>your lingers and thumb, give it breath with your</LINE> <LINE>mouth, and it will discourse most eloquent music.</LINE> <LINE>Look you, these are the stops.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>But these cannot I command to any utterance of</LINE> <LINE>harmony; I have not the skill.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, look you now, how unworthy a thing you make of</LINE> <LINE>me! You would play upon me; you would seem to know</LINE> <LINE>my stops; you would pluck out the heart of my</LINE> <LINE>mystery; you would sound me from my lowest note to</LINE> <LINE>the top of my compass: and there is much music,</LINE> <LINE>excellent voice, in this little organ; yet cannot</LINE> <LINE>you make it speak. 'Sblood, do you think I am</LINE> <LINE>easier to be played on than a pipe? Call me what</LINE> <LINE>instrument you will, though you can fret me, yet you</LINE> <LINE>cannot play upon me.</LINE> <STAGEDIR>Enter POLONIUS</STAGEDIR> <LINE>God bless you, sir!</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>My lord, the queen would speak with you, and</LINE> <LINE>presently.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Do you see yonder cloud that's almost in shape of a camel?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>By the mass, and 'tis like a camel, indeed.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Methinks it is like a weasel.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>It is backed like a weasel.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Or like a whale?</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>Very like a whale.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Then I will come to my mother by and by. They fool</LINE> <LINE>me to the top of my bent. I will come by and by.</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>I will say so.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>By and by is easily said.</LINE> <STAGEDIR>Exit POLONIUS</STAGEDIR> <LINE>Leave me, friends.</LINE> <STAGEDIR>Exeunt all but HAMLET</STAGEDIR> <LINE>Tis now the very witching time of night,</LINE> <LINE>When churchyards yawn and hell itself breathes out</LINE> <LINE>Contagion to this world: now could I drink hot blood,</LINE> <LINE>And do such bitter business as the day</LINE> <LINE>Would quake to look on. Soft! now to my mother.</LINE> <LINE>O heart, lose not thy nature; let not ever</LINE> <LINE>The soul of Nero enter this firm bosom:</LINE> <LINE>Let me be cruel, not unnatural:</LINE> <LINE>I will speak daggers to her, but use none;</LINE> <LINE>My tongue and soul in this be hypocrites;</LINE> <LINE>How in my words soever she be shent,</LINE> <LINE>To give them seals never, my soul, consent!</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE III. A room in the castle.</TITLE> <STAGEDIR>Enter KING CLAUDIUS, ROSENCRANTZ, and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>I like him not, nor stands it safe with us</LINE> <LINE>To let his madness range. Therefore prepare you;</LINE> <LINE>I your commission will forthwith dispatch,</LINE> <LINE>And he to England shall along with you:</LINE> <LINE>The terms of our estate may not endure</LINE> <LINE>Hazard so dangerous as doth hourly grow</LINE> <LINE>Out of his lunacies.</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>We will ourselves provide:</LINE> <LINE>Most holy and religious fear it is</LINE> <LINE>To keep those many many bodies safe</LINE> <LINE>That live and feed upon your majesty.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>The single and peculiar life is bound,</LINE> <LINE>With all the strength and armour of the mind,</LINE> <LINE>To keep itself from noyance; but much more</LINE> <LINE>That spirit upon whose weal depend and rest</LINE> <LINE>The lives of many. The cease of majesty</LINE> <LINE>Dies not alone; but, like a gulf, doth draw</LINE> <LINE>What's near it with it: it is a massy wheel,</LINE> <LINE>Fix'd on the summit of the highest mount,</LINE> <LINE>To whose huge spokes ten thousand lesser things</LINE> <LINE>Are mortised and adjoin'd; which, when it falls,</LINE> <LINE>Each small annexment, petty consequence,</LINE> <LINE>Attends the boisterous ruin. Never alone</LINE> <LINE>Did the king sigh, but with a general groan.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Arm you, I pray you, to this speedy voyage;</LINE> <LINE>For we will fetters put upon this fear,</LINE> <LINE>Which now goes too free-footed.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>We will haste us.</LINE> </SPEECH> <STAGEDIR>Exeunt ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <STAGEDIR>Enter POLONIUS</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>My lord, he's going to his mother's closet:</LINE> <LINE>Behind the arras I'll convey myself,</LINE> <LINE>To hear the process; and warrant she'll tax him home:</LINE> <LINE>And, as you said, and wisely was it said,</LINE> <LINE>'Tis meet that some more audience than a mother,</LINE> <LINE>Since nature makes them partial, should o'erhear</LINE> <LINE>The speech, of vantage. Fare you well, my liege:</LINE> <LINE>I'll call upon you ere you go to bed,</LINE> <LINE>And tell you what I know.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Thanks, dear my lord.</LINE> <STAGEDIR>Exit POLONIUS</STAGEDIR> <LINE>O, my offence is rank it smells to heaven;</LINE> <LINE>It hath the primal eldest curse upon't,</LINE> <LINE>A brother's murder. Pray can I not,</LINE> <LINE>Though inclination be as sharp as will:</LINE> <LINE>My stronger guilt defeats my strong intent;</LINE> <LINE>And, like a man to double business bound,</LINE> <LINE>I stand in pause where I shall first begin,</LINE> <LINE>And both neglect. What if this cursed hand</LINE> <LINE>Were thicker than itself with brother's blood,</LINE> <LINE>Is there not rain enough in the sweet heavens</LINE> <LINE>To wash it white as snow? Whereto serves mercy</LINE> <LINE>But to confront the visage of offence?</LINE> <LINE>And what's in prayer but this two-fold force,</LINE> <LINE>To be forestalled ere we come to fall,</LINE> <LINE>Or pardon'd being down? Then I'll look up;</LINE> <LINE>My fault is past. But, O, what form of prayer</LINE> <LINE>Can serve my turn? 'Forgive me my foul murder'?</LINE> <LINE>That cannot be; since I am still possess'd</LINE> <LINE>Of those effects for which I did the murder,</LINE> <LINE>My crown, mine own ambition and my queen.</LINE> <LINE>May one be pardon'd and retain the offence?</LINE> <LINE>In the corrupted currents of this world</LINE> <LINE>Offence's gilded hand may shove by justice,</LINE> <LINE>And oft 'tis seen the wicked prize itself</LINE> <LINE>Buys out the law: but 'tis not so above;</LINE> <LINE>There is no shuffling, there the action lies</LINE> <LINE>In his true nature; and we ourselves compell'd,</LINE> <LINE>Even to the teeth and forehead of our faults,</LINE> <LINE>To give in evidence. What then? what rests?</LINE> <LINE>Try what repentance can: what can it not?</LINE> <LINE>Yet what can it when one can not repent?</LINE> <LINE>O wretched state! O bosom black as death!</LINE> <LINE>O limed soul, that, struggling to be free,</LINE> <LINE>Art more engaged! Help, angels! Make assay!</LINE> <LINE>Bow, stubborn knees; and, heart with strings of steel,</LINE> <LINE>Be soft as sinews of the newborn babe!</LINE> <LINE>All may be well.</LINE> </SPEECH> <STAGEDIR>Retires and kneels</STAGEDIR> <STAGEDIR>Enter HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Now might I do it pat, now he is praying;</LINE> <LINE>And now I'll do't. And so he goes to heaven;</LINE> <LINE>And so am I revenged. That would be scann'd:</LINE> <LINE>A villain kills my father; and for that,</LINE> <LINE>I, his sole son, do this same villain send</LINE> <LINE>To heaven.</LINE> <LINE>O, this is hire and salary, not revenge.</LINE> <LINE>He took my father grossly, full of bread;</LINE> <LINE>With all his crimes broad blown, as flush as May;</LINE> <LINE>And how his audit stands who knows save heaven?</LINE> <LINE>But in our circumstance and course of thought,</LINE> <LINE>'Tis heavy with him: and am I then revenged,</LINE> <LINE>To take him in the purging of his soul,</LINE> <LINE>When he is fit and season'd for his passage?</LINE> <LINE>No!</LINE> <LINE>Up, sword; and know thou a more horrid hent:</LINE> <LINE>When he is drunk asleep, or in his rage,</LINE> <LINE>Or in the incestuous pleasure of his bed;</LINE> <LINE>At gaming, swearing, or about some act</LINE> <LINE>That has no relish of salvation in't;</LINE> <LINE>Then trip him, that his heels may kick at heaven,</LINE> <LINE>And that his soul may be as damn'd and black</LINE> <LINE>As hell, whereto it goes. My mother stays:</LINE> <LINE>This physic but prolongs thy sickly days.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE><STAGEDIR>Rising</STAGEDIR> My words fly up, my thoughts remain below:</LINE> <LINE>Words without thoughts never to heaven go.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE IV. The Queen's closet.</TITLE> <STAGEDIR>Enter QUEEN MARGARET and POLONIUS</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE>He will come straight. Look you lay home to him:</LINE> <LINE>Tell him his pranks have been too broad to bear with,</LINE> <LINE>And that your grace hath screen'd and stood between</LINE> <LINE>Much heat and him. I'll sconce me even here.</LINE> <LINE>Pray you, be round with him.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE><STAGEDIR>Within</STAGEDIR> Mother, mother, mother!</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>I'll warrant you,</LINE> <LINE>Fear me not: withdraw, I hear him coming.</LINE> </SPEECH> <STAGEDIR>POLONIUS hides behind the arras</STAGEDIR> <STAGEDIR>Enter HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Now, mother, what's the matter?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Hamlet, thou hast thy father much offended.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Mother, you have my father much offended.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Come, come, you answer with an idle tongue.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Go, go, you question with a wicked tongue.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Why, how now, Hamlet!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What's the matter now?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Have you forgot me?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, by the rood, not so:</LINE> <LINE>You are the queen, your husband's brother's wife;</LINE> <LINE>And--would it were not so!--you are my mother.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Nay, then, I'll set those to you that can speak.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Come, come, and sit you down; you shall not budge;</LINE> <LINE>You go not till I set you up a glass</LINE> <LINE>Where you may see the inmost part of you.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>What wilt thou do? thou wilt not murder me?</LINE> <LINE>Help, help, ho!</LINE> </SPEECH> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE><STAGEDIR>Behind</STAGEDIR> What, ho! help, help, help!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE><STAGEDIR>Drawing</STAGEDIR> How now! a rat? Dead, for a ducat, dead!</LINE> </SPEECH> <STAGEDIR>Makes a pass through the arras</STAGEDIR> <SPEECH> <SPEAKER>LORD POLONIUS</SPEAKER> <LINE><STAGEDIR>Behind</STAGEDIR> O, I am slain!</LINE> </SPEECH> <STAGEDIR>Falls and dies</STAGEDIR> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>O me, what hast thou done?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nay, I know not:</LINE> <LINE>Is it the king?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>O, what a rash and bloody deed is this!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>A bloody deed! almost as bad, good mother,</LINE> <LINE>As kill a king, and marry with his brother.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>As kill a king!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, lady, 'twas my word.</LINE> <STAGEDIR>Lifts up the array and discovers POLONIUS</STAGEDIR> <LINE>Thou wretched, rash, intruding fool, farewell!</LINE> <LINE>I took thee for thy better: take thy fortune;</LINE> <LINE>Thou find'st to be too busy is some danger.</LINE> <LINE>Leave wringing of your hands: peace! sit you down,</LINE> <LINE>And let me wring your heart; for so I shall,</LINE> <LINE>If it be made of penetrable stuff,</LINE> <LINE>If damned custom have not brass'd it so</LINE> <LINE>That it is proof and bulwark against sense.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>What have I done, that thou darest wag thy tongue</LINE> <LINE>In noise so rude against me?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Such an act</LINE> <LINE>That blurs the grace and blush of modesty,</LINE> <LINE>Calls virtue hypocrite, takes off the rose</LINE> <LINE>From the fair forehead of an innocent love</LINE> <LINE>And sets a blister there, makes marriage-vows</LINE> <LINE>As false as dicers' oaths: O, such a deed</LINE> <LINE>As from the body of contraction plucks</LINE> <LINE>The very soul, and sweet religion makes</LINE> <LINE>A rhapsody of words: heaven's face doth glow:</LINE> <LINE>Yea, this solidity and compound mass,</LINE> <LINE>With tristful visage, as against the doom,</LINE> <LINE>Is thought-sick at the act.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Ay me, what act,</LINE> <LINE>That roars so loud, and thunders in the index?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Look here, upon this picture, and on this,</LINE> <LINE>The counterfeit presentment of two brothers.</LINE> <LINE>See, what a grace was seated on this brow;</LINE> <LINE>Hyperion's curls; the front of Jove himself;</LINE> <LINE>An eye like Mars, to threaten and command;</LINE> <LINE>A station like the herald Mercury</LINE> <LINE>New-lighted on a heaven-kissing hill;</LINE> <LINE>A combination and a form indeed,</LINE> <LINE>Where every god did seem to set his seal,</LINE> <LINE>To give the world assurance of a man:</LINE> <LINE>This was your husband. Look you now, what follows:</LINE> <LINE>Here is your husband; like a mildew'd ear,</LINE> <LINE>Blasting his wholesome brother. Have you eyes?</LINE> <LINE>Could you on this fair mountain leave to feed,</LINE> <LINE>And batten on this moor? Ha! have you eyes?</LINE> <LINE>You cannot call it love; for at your age</LINE> <LINE>The hey-day in the blood is tame, it's humble,</LINE> <LINE>And waits upon the judgment: and what judgment</LINE> <LINE>Would step from this to this? Sense, sure, you have,</LINE> <LINE>Else could you not have motion; but sure, that sense</LINE> <LINE>Is apoplex'd; for madness would not err,</LINE> <LINE>Nor sense to ecstasy was ne'er so thrall'd</LINE> <LINE>But it reserved some quantity of choice,</LINE> <LINE>To serve in such a difference. What devil was't</LINE> <LINE>That thus hath cozen'd you at hoodman-blind?</LINE> <LINE>Eyes without feeling, feeling without sight,</LINE> <LINE>Ears without hands or eyes, smelling sans all,</LINE> <LINE>Or but a sickly part of one true sense</LINE> <LINE>Could not so mope.</LINE> <LINE>O shame! where is thy blush? Rebellious hell,</LINE> <LINE>If thou canst mutine in a matron's bones,</LINE> <LINE>To flaming youth let virtue be as wax,</LINE> <LINE>And melt in her own fire: proclaim no shame</LINE> <LINE>When the compulsive ardour gives the charge,</LINE> <LINE>Since frost itself as actively doth burn</LINE> <LINE>And reason panders will.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>O Hamlet, speak no more:</LINE> <LINE>Thou turn'st mine eyes into my very soul;</LINE> <LINE>And there I see such black and grained spots</LINE> <LINE>As will not leave their tinct.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nay, but to live</LINE> <LINE>In the rank sweat of an enseamed bed,</LINE> <LINE>Stew'd in corruption, honeying and making love</LINE> <LINE>Over the nasty sty,--</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>O, speak to me no more;</LINE> <LINE>These words, like daggers, enter in mine ears;</LINE> <LINE>No more, sweet Hamlet!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>A murderer and a villain;</LINE> <LINE>A slave that is not twentieth part the tithe</LINE> <LINE>Of your precedent lord; a vice of kings;</LINE> <LINE>A cutpurse of the empire and the rule,</LINE> <LINE>That from a shelf the precious diadem stole,</LINE> <LINE>And put it in his pocket!</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>No more!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>A king of shreds and patches,--</LINE> <STAGEDIR>Enter Ghost</STAGEDIR> <LINE>Save me, and hover o'er me with your wings,</LINE> <LINE>You heavenly guards! What would your gracious figure?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Alas, he's mad!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Do you not come your tardy son to chide,</LINE> <LINE>That, lapsed in time and passion, lets go by</LINE> <LINE>The important acting of your dread command? O, say!</LINE> </SPEECH> <SPEECH> <SPEAKER>Ghost</SPEAKER> <LINE>Do not forget: this visitation</LINE> <LINE>Is but to whet thy almost blunted purpose.</LINE> <LINE>But, look, amazement on thy mother sits:</LINE> <LINE>O, step between her and her fighting soul:</LINE> <LINE>Conceit in weakest bodies strongest works:</LINE> <LINE>Speak to her, Hamlet.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How is it with you, lady?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Alas, how is't with you,</LINE> <LINE>That you do bend your eye on vacancy</LINE> <LINE>And with the incorporal air do hold discourse?</LINE> <LINE>Forth at your eyes your spirits wildly peep;</LINE> <LINE>And, as the sleeping soldiers in the alarm,</LINE> <LINE>Your bedded hair, like life in excrements,</LINE> <LINE>Starts up, and stands on end. O gentle son,</LINE> <LINE>Upon the heat and flame of thy distemper</LINE> <LINE>Sprinkle cool patience. Whereon do you look?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>On him, on him! Look you, how pale he glares!</LINE> <LINE>His form and cause conjoin'd, preaching to stones,</LINE> <LINE>Would make them capable. Do not look upon me;</LINE> <LINE>Lest with this piteous action you convert</LINE> <LINE>My stern effects: then what I have to do</LINE> <LINE>Will want true colour; tears perchance for blood.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>To whom do you speak this?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Do you see nothing there?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Nothing at all; yet all that is I see.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nor did you nothing hear?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>No, nothing but ourselves.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, look you there! look, how it steals away!</LINE> <LINE>My father, in his habit as he lived!</LINE> <LINE>Look, where he goes, even now, out at the portal!</LINE> </SPEECH> <STAGEDIR>Exit Ghost</STAGEDIR> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>This the very coinage of your brain:</LINE> <LINE>This bodiless creation ecstasy</LINE> <LINE>Is very cunning in.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ecstasy!</LINE> <LINE>My pulse, as yours, doth temperately keep time,</LINE> <LINE>And makes as healthful music: it is not madness</LINE> <LINE>That I have utter'd: bring me to the test,</LINE> <LINE>And I the matter will re-word; which madness</LINE> <LINE>Would gambol from. Mother, for love of grace,</LINE> <LINE>Lay not that mattering unction to your soul,</LINE> <LINE>That not your trespass, but my madness speaks:</LINE> <LINE>It will but skin and film the ulcerous place,</LINE> <LINE>Whilst rank corruption, mining all within,</LINE> <LINE>Infects unseen. Confess yourself to heaven;</LINE> <LINE>Repent what's past; avoid what is to come;</LINE> <LINE>And do not spread the compost on the weeds,</LINE> <LINE>To make them ranker. Forgive me this my virtue;</LINE> <LINE>For in the fatness of these pursy times</LINE> <LINE>Virtue itself of vice must pardon beg,</LINE> <LINE>Yea, curb and woo for leave to do him good.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>O Hamlet, thou hast cleft my heart in twain.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O, throw away the worser part of it,</LINE> <LINE>And live the purer with the other half.</LINE> <LINE>Good night: but go not to mine uncle's bed;</LINE> <LINE>Assume a virtue, if you have it not.</LINE> <LINE>That monster, custom, who all sense doth eat,</LINE> <LINE>Of habits devil, is angel yet in this,</LINE> <LINE>That to the use of actions fair and good</LINE> <LINE>He likewise gives a frock or livery,</LINE> <LINE>That aptly is put on. Refrain to-night,</LINE> <LINE>And that shall lend a kind of easiness</LINE> <LINE>To the next abstinence: the next more easy;</LINE> <LINE>For use almost can change the stamp of nature,</LINE> <LINE>And either ... the devil, or throw him out</LINE> <LINE>With wondrous potency. Once more, good night:</LINE> <LINE>And when you are desirous to be bless'd,</LINE> <LINE>I'll blessing beg of you. For this same lord,</LINE> <STAGEDIR>Pointing to POLONIUS</STAGEDIR> <LINE>I do repent: but heaven hath pleased it so,</LINE> <LINE>To punish me with this and this with me,</LINE> <LINE>That I must be their scourge and minister.</LINE> <LINE>I will bestow him, and will answer well</LINE> <LINE>The death I gave him. So, again, good night.</LINE> <LINE>I must be cruel, only to be kind:</LINE> <LINE>Thus bad begins and worse remains behind.</LINE> <LINE>One word more, good lady.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>What shall I do?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Not this, by no means, that I bid you do:</LINE> <LINE>Let the bloat king tempt you again to bed;</LINE> <LINE>Pinch wanton on your cheek; call you his mouse;</LINE> <LINE>And let him, for a pair of reechy kisses,</LINE> <LINE>Or paddling in your neck with his damn'd fingers,</LINE> <LINE>Make you to ravel all this matter out,</LINE> <LINE>That I essentially am not in madness,</LINE> <LINE>But mad in craft. 'Twere good you let him know;</LINE> <LINE>For who, that's but a queen, fair, sober, wise,</LINE> <LINE>Would from a paddock, from a bat, a gib,</LINE> <LINE>Such dear concernings hide? who would do so?</LINE> <LINE>No, in despite of sense and secrecy,</LINE> <LINE>Unpeg the basket on the house's top.</LINE> <LINE>Let the birds fly, and, like the famous ape,</LINE> <LINE>To try conclusions, in the basket creep,</LINE> <LINE>And break your own neck down.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Be thou assured, if words be made of breath,</LINE> <LINE>And breath of life, I have no life to breathe</LINE> <LINE>What thou hast said to me.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I must to England; you know that?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Alack,</LINE> <LINE>I had forgot: 'tis so concluded on.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>There's letters seal'd: and my two schoolfellows,</LINE> <LINE>Whom I will trust as I will adders fang'd,</LINE> <LINE>They bear the mandate; they must sweep my way,</LINE> <LINE>And marshal me to knavery. Let it work;</LINE> <LINE>For 'tis the sport to have the engineer</LINE> <LINE>Hoist with his own petard: and 't shall go hard</LINE> <LINE>But I will delve one yard below their mines,</LINE> <LINE>And blow them at the moon: O, 'tis most sweet,</LINE> <LINE>When in one line two crafts directly meet.</LINE> <LINE>This man shall set me packing:</LINE> <LINE>I'll lug the guts into the neighbour room.</LINE> <LINE>Mother, good night. Indeed this counsellor</LINE> <LINE>Is now most still, most secret and most grave,</LINE> <LINE>Who was in life a foolish prating knave.</LINE> <LINE>Come, sir, to draw toward an end with you.</LINE> <LINE>Good night, mother.</LINE> </SPEECH> <STAGEDIR>Exeunt severally; HAMLET dragging in POLONIUS</STAGEDIR> </SCENE> </ACT> <ACT><TITLE>ACT IV</TITLE> <SCENE><TITLE>SCENE I. A room in the castle.</TITLE> <STAGEDIR>Enter KING CLAUDIUS, QUEEN GERTRUDE, ROSENCRANTZ, and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>There's matter in these sighs, these profound heaves:</LINE> <LINE>You must translate: 'tis fit we understand them.</LINE> <LINE>Where is your son?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Bestow this place on us a little while.</LINE> <STAGEDIR>Exeunt ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <LINE>Ah, my good lord, what have I seen to-night!</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>What, Gertrude? How does Hamlet?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Mad as the sea and wind, when both contend</LINE> <LINE>Which is the mightier: in his lawless fit,</LINE> <LINE>Behind the arras hearing something stir,</LINE> <LINE>Whips out his rapier, cries, 'A rat, a rat!'</LINE> <LINE>And, in this brainish apprehension, kills</LINE> <LINE>The unseen good old man.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>O heavy deed!</LINE> <LINE>It had been so with us, had we been there:</LINE> <LINE>His liberty is full of threats to all;</LINE> <LINE>To you yourself, to us, to every one.</LINE> <LINE>Alas, how shall this bloody deed be answer'd?</LINE> <LINE>It will be laid to us, whose providence</LINE> <LINE>Should have kept short, restrain'd and out of haunt,</LINE> <LINE>This mad young man: but so much was our love,</LINE> <LINE>We would not understand what was most fit;</LINE> <LINE>But, like the owner of a foul disease,</LINE> <LINE>To keep it from divulging, let it feed</LINE> <LINE>Even on the pith of Life. Where is he gone?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>To draw apart the body he hath kill'd:</LINE> <LINE>O'er whom his very madness, like some ore</LINE> <LINE>Among a mineral of metals base,</LINE> <LINE>Shows itself pure; he weeps for what is done.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>O Gertrude, come away!</LINE> <LINE>The sun no sooner shall the mountains touch,</LINE> <LINE>But we will ship him hence: and this vile deed</LINE> <LINE>We must, with all our majesty and skill,</LINE> <LINE>Both countenance and excuse. Ho, Guildenstern!</LINE> <STAGEDIR>Re-enter ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <LINE>Friends both, go join you with some further aid:</LINE> <LINE>Hamlet in madness hath Polonius slain,</LINE> <LINE>And from his mother's closet hath he dragg'd him:</LINE> <LINE>Go seek him out; speak fair, and bring the body</LINE> <LINE>Into the chapel. I pray you, haste in this.</LINE> <STAGEDIR>Exeunt ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <LINE>Come, Gertrude, we'll call up our wisest friends;</LINE> <LINE>And let them know, both what we mean to do,</LINE> <LINE>And what's untimely done...</LINE> <LINE>Whose whisper o'er the world's diameter,</LINE> <LINE>As level as the cannon to his blank,</LINE> <LINE>Transports his poison'd shot, may miss our name,</LINE> <LINE>And hit the woundless air. O, come away!</LINE> <LINE>My soul is full of discord and dismay.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE II. Another room in the castle.</TITLE> <STAGEDIR>Enter HAMLET</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Safely stowed.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE><STAGEDIR>Within</STAGEDIR> Hamlet! Lord Hamlet!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What noise? who calls on Hamlet?</LINE> <LINE>O, here they come.</LINE> </SPEECH> <STAGEDIR>Enter ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>What have you done, my lord, with the dead body?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Compounded it with dust, whereto 'tis kin.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Tell us where 'tis, that we may take it thence</LINE> <LINE>And bear it to the chapel.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Do not believe it.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Believe what?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>That I can keep your counsel and not mine own.</LINE> <LINE>Besides, to be demanded of a sponge! what</LINE> <LINE>replication should be made by the son of a king?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Take you me for a sponge, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, sir, that soaks up the king's countenance, his</LINE> <LINE>rewards, his authorities. But such officers do the</LINE> <LINE>king best service in the end: he keeps them, like</LINE> <LINE>an ape, in the corner of his jaw; first mouthed, to</LINE> <LINE>be last swallowed: when he needs what you have</LINE> <LINE>gleaned, it is but squeezing you, and, sponge, you</LINE> <LINE>shall be dry again.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>I understand you not, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I am glad of it: a knavish speech sleeps in a</LINE> <LINE>foolish ear.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>My lord, you must tell us where the body is, and go</LINE> <LINE>with us to the king.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The body is with the king, but the king is not with</LINE> <LINE>the body. The king is a thing--</LINE> </SPEECH> <SPEECH> <SPEAKER>GUILDENSTERN</SPEAKER> <LINE>A thing, my lord!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Of nothing: bring me to him. Hide fox, and all after.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE III. Another room in the castle.</TITLE> <STAGEDIR>Enter KING CLAUDIUS, attended</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>I have sent to seek him, and to find the body.</LINE> <LINE>How dangerous is it that this man goes loose!</LINE> <LINE>Yet must not we put the strong law on him:</LINE> <LINE>He's loved of the distracted multitude,</LINE> <LINE>Who like not in their judgment, but their eyes;</LINE> <LINE>And where tis so, the offender's scourge is weigh'd,</LINE> <LINE>But never the offence. To bear all smooth and even,</LINE> <LINE>This sudden sending him away must seem</LINE> <LINE>Deliberate pause: diseases desperate grown</LINE> <LINE>By desperate appliance are relieved,</LINE> <LINE>Or not at all.</LINE> <STAGEDIR>Enter ROSENCRANTZ</STAGEDIR> <LINE>How now! what hath befall'n?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Where the dead body is bestow'd, my lord,</LINE> <LINE>We cannot get from him.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>But where is he?</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Without, my lord; guarded, to know your pleasure.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Bring him before us.</LINE> </SPEECH> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Ho, Guildenstern! bring in my lord.</LINE> </SPEECH> <STAGEDIR>Enter HAMLET and GUILDENSTERN</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Now, Hamlet, where's Polonius?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>At supper.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>At supper! where?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Not where he eats, but where he is eaten: a certain</LINE> <LINE>convocation of politic worms are e'en at him. Your</LINE> <LINE>worm is your only emperor for diet: we fat all</LINE> <LINE>creatures else to fat us, and we fat ourselves for</LINE> <LINE>maggots: your fat king and your lean beggar is but</LINE> <LINE>variable service, two dishes, but to one table:</LINE> <LINE>that's the end.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Alas, alas!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>A man may fish with the worm that hath eat of a</LINE> <LINE>king, and cat of the fish that hath fed of that worm.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>What dost you mean by this?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nothing but to show you how a king may go a</LINE> <LINE>progress through the guts of a beggar.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Where is Polonius?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>In heaven; send hither to see: if your messenger</LINE> <LINE>find him not there, seek him i' the other place</LINE> <LINE>yourself. But indeed, if you find him not within</LINE> <LINE>this month, you shall nose him as you go up the</LINE> <LINE>stairs into the lobby.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Go seek him there.</LINE> </SPEECH> <STAGEDIR>To some Attendants</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>He will stay till ye come.</LINE> </SPEECH> <STAGEDIR>Exeunt Attendants</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Hamlet, this deed, for thine especial safety,--</LINE> <LINE>Which we do tender, as we dearly grieve</LINE> <LINE>For that which thou hast done,--must send thee hence</LINE> <LINE>With fiery quickness: therefore prepare thyself;</LINE> <LINE>The bark is ready, and the wind at help,</LINE> <LINE>The associates tend, and every thing is bent</LINE> <LINE>For England.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>For England!</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Ay, Hamlet.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Good.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>So is it, if thou knew'st our purposes.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I see a cherub that sees them. But, come; for</LINE> <LINE>England! Farewell, dear mother.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Thy loving father, Hamlet.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>My mother: father and mother is man and wife; man</LINE> <LINE>and wife is one flesh; and so, my mother. Come, for England!</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Follow him at foot; tempt him with speed aboard;</LINE> <LINE>Delay it not; I'll have him hence to-night:</LINE> <LINE>Away! for every thing is seal'd and done</LINE> <LINE>That else leans on the affair: pray you, make haste.</LINE> <STAGEDIR>Exeunt ROSENCRANTZ and GUILDENSTERN</STAGEDIR> <LINE>And, England, if my love thou hold'st at aught--</LINE> <LINE>As my great power thereof may give thee sense,</LINE> <LINE>Since yet thy cicatrice looks raw and red</LINE> <LINE>After the Danish sword, and thy free awe</LINE> <LINE>Pays homage to us--thou mayst not coldly set</LINE> <LINE>Our sovereign process; which imports at full,</LINE> <LINE>By letters congruing to that effect,</LINE> <LINE>The present death of Hamlet. Do it, England;</LINE> <LINE>For like the hectic in my blood he rages,</LINE> <LINE>And thou must cure me: till I know 'tis done,</LINE> <LINE>Howe'er my haps, my joys were ne'er begun.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE IV. A plain in Denmark.</TITLE> <STAGEDIR>Enter FORTINBRAS, a Captain, and Soldiers, marching</STAGEDIR> <SPEECH> <SPEAKER>PRINCE FORTINBRAS</SPEAKER> <LINE>Go, captain, from me greet the Danish king;</LINE> <LINE>Tell him that, by his licence, Fortinbras</LINE> <LINE>Craves the conveyance of a promised march</LINE> <LINE>Over his kingdom. You know the rendezvous.</LINE> <LINE>If that his majesty would aught with us,</LINE> <LINE>We shall express our duty in his eye;</LINE> <LINE>And let him know so.</LINE> </SPEECH> <SPEECH> <SPEAKER>Captain</SPEAKER> <LINE>I will do't, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>PRINCE FORTINBRAS</SPEAKER> <LINE>Go softly on.</LINE> </SPEECH> <STAGEDIR>Exeunt FORTINBRAS and Soldiers</STAGEDIR> <STAGEDIR>Enter HAMLET, ROSENCRANTZ, GUILDENSTERN, and others</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Good sir, whose powers are these?</LINE> </SPEECH> <SPEECH> <SPEAKER>Captain</SPEAKER> <LINE>They are of Norway, sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How purposed, sir, I pray you?</LINE> </SPEECH> <SPEECH> <SPEAKER>Captain</SPEAKER> <LINE>Against some part of Poland.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Who commands them, sir?</LINE> </SPEECH> <SPEECH> <SPEAKER>Captain</SPEAKER> <LINE>The nephews to old Norway, Fortinbras.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Goes it against the main of Poland, sir,</LINE> <LINE>Or for some frontier?</LINE> </SPEECH> <SPEECH> <SPEAKER>Captain</SPEAKER> <LINE>Truly to speak, and with no addition,</LINE> <LINE>We go to gain a little patch of ground</LINE> <LINE>That hath in it no profit but the name.</LINE> <LINE>To pay five ducats, five, I would not farm it;</LINE> <LINE>Nor will it yield to Norway or the Pole</LINE> <LINE>A ranker rate, should it be sold in fee.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, then the Polack never will defend it.</LINE> </SPEECH> <SPEECH> <SPEAKER>Captain</SPEAKER> <LINE>Yes, it is already garrison'd.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Two thousand souls and twenty thousand ducats</LINE> <LINE>Will not debate the question of this straw:</LINE> <LINE>This is the imposthume of much wealth and peace,</LINE> <LINE>That inward breaks, and shows no cause without</LINE> <LINE>Why the man dies. I humbly thank you, sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>Captain</SPEAKER> <LINE>God be wi' you, sir.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>ROSENCRANTZ</SPEAKER> <LINE>Wilt please you go, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I'll be with you straight go a little before.</LINE> <STAGEDIR>Exeunt all except HAMLET</STAGEDIR> <LINE>How all occasions do inform against me,</LINE> <LINE>And spur my dull revenge! What is a man,</LINE> <LINE>If his chief good and market of his time</LINE> <LINE>Be but to sleep and feed? a beast, no more.</LINE> <LINE>Sure, he that made us with such large discourse,</LINE> <LINE>Looking before and after, gave us not</LINE> <LINE>That capability and god-like reason</LINE> <LINE>To fust in us unused. Now, whether it be</LINE> <LINE>Bestial oblivion, or some craven scruple</LINE> <LINE>Of thinking too precisely on the event,</LINE> <LINE>A thought which, quarter'd, hath but one part wisdom</LINE> <LINE>And ever three parts coward, I do not know</LINE> <LINE>Why yet I live to say 'This thing's to do;'</LINE> <LINE>Sith I have cause and will and strength and means</LINE> <LINE>To do't. Examples gross as earth exhort me:</LINE> <LINE>Witness this army of such mass and charge</LINE> <LINE>Led by a delicate and tender prince,</LINE> <LINE>Whose spirit with divine ambition puff'd</LINE> <LINE>Makes mouths at the invisible event,</LINE> <LINE>Exposing what is mortal and unsure</LINE> <LINE>To all that fortune, death and danger dare,</LINE> <LINE>Even for an egg-shell. Rightly to be great</LINE> <LINE>Is not to stir without great argument,</LINE> <LINE>But greatly to find quarrel in a straw</LINE> <LINE>When honour's at the stake. How stand I then,</LINE> <LINE>That have a father kill'd, a mother stain'd,</LINE> <LINE>Excitements of my reason and my blood,</LINE> <LINE>And let all sleep? while, to my shame, I see</LINE> <LINE>The imminent death of twenty thousand men,</LINE> <LINE>That, for a fantasy and trick of fame,</LINE> <LINE>Go to their graves like beds, fight for a plot</LINE> <LINE>Whereon the numbers cannot try the cause,</LINE> <LINE>Which is not tomb enough and continent</LINE> <LINE>To hide the slain? O, from this time forth,</LINE> <LINE>My thoughts be bloody, or be nothing worth!</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE V. Elsinore. A room in the castle.</TITLE> <STAGEDIR>Enter QUEEN GERTRUDE, HORATIO, and a Gentleman</STAGEDIR> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>I will not speak with her.</LINE> </SPEECH> <SPEECH> <SPEAKER>Gentleman</SPEAKER> <LINE>She is importunate, indeed distract:</LINE> <LINE>Her mood will needs be pitied.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>What would she have?</LINE> </SPEECH> <SPEECH> <SPEAKER>Gentleman</SPEAKER> <LINE>She speaks much of her father; says she hears</LINE> <LINE>There's tricks i' the world; and hems, and beats her heart;</LINE> <LINE>Spurns enviously at straws; speaks things in doubt,</LINE> <LINE>That carry but half sense: her speech is nothing,</LINE> <LINE>Yet the unshaped use of it doth move</LINE> <LINE>The hearers to collection; they aim at it,</LINE> <LINE>And botch the words up fit to their own thoughts;</LINE> <LINE>Which, as her winks, and nods, and gestures</LINE> <LINE>yield them,</LINE> <LINE>Indeed would make one think there might be thought,</LINE> <LINE>Though nothing sure, yet much unhappily.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>'Twere good she were spoken with; for she may strew</LINE> <LINE>Dangerous conjectures in ill-breeding minds.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Let her come in.</LINE> <STAGEDIR>Exit HORATIO</STAGEDIR> <LINE>To my sick soul, as sin's true nature is,</LINE> <LINE>Each toy seems prologue to some great amiss:</LINE> <LINE>So full of artless jealousy is guilt,</LINE> <LINE>It spills itself in fearing to be spilt.</LINE> </SPEECH> <STAGEDIR>Re-enter HORATIO, with OPHELIA</STAGEDIR> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Where is the beauteous majesty of Denmark?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>How now, Ophelia!</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE><STAGEDIR>Sings</STAGEDIR></LINE> <LINE>How should I your true love know</LINE> <LINE>From another one?</LINE> <LINE>By his cockle hat and staff,</LINE> <LINE>And his sandal shoon.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Alas, sweet lady, what imports this song?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Say you? nay, pray you, mark.</LINE> <STAGEDIR>Sings</STAGEDIR> <LINE>He is dead and gone, lady,</LINE> <LINE>He is dead and gone;</LINE> <LINE>At his head a grass-green turf,</LINE> <LINE>At his heels a stone.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Nay, but, Ophelia,--</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Pray you, mark.</LINE> <STAGEDIR>Sings</STAGEDIR> <LINE>White his shroud as the mountain snow,--</LINE> </SPEECH> <STAGEDIR>Enter KING CLAUDIUS</STAGEDIR> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Alas, look here, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE><STAGEDIR>Sings</STAGEDIR></LINE> <LINE>Larded with sweet flowers</LINE> <LINE>Which bewept to the grave did go</LINE> <LINE>With true-love showers.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>How do you, pretty lady?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Well, God 'ild you! They say the owl was a baker's</LINE> <LINE>daughter. Lord, we know what we are, but know not</LINE> <LINE>what we may be. God be at your table!</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Conceit upon her father.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Pray you, let's have no words of this; but when they</LINE> <LINE>ask you what it means, say you this:</LINE> <STAGEDIR>Sings</STAGEDIR> <LINE>To-morrow is Saint Valentine's day,</LINE> <LINE>All in the morning betime,</LINE> <LINE>And I a maid at your window,</LINE> <LINE>To be your Valentine.</LINE> <LINE>Then up he rose, and donn'd his clothes,</LINE> <LINE>And dupp'd the chamber-door;</LINE> <LINE>Let in the maid, that out a maid</LINE> <LINE>Never departed more.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Pretty Ophelia!</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>Indeed, la, without an oath, I'll make an end on't:</LINE> <STAGEDIR>Sings</STAGEDIR> <LINE>By Gis and by Saint Charity,</LINE> <LINE>Alack, and fie for shame!</LINE> <LINE>Young men will do't, if they come to't;</LINE> <LINE>By cock, they are to blame.</LINE> <LINE>Quoth she, before you tumbled me,</LINE> <LINE>You promised me to wed.</LINE> <LINE>So would I ha' done, by yonder sun,</LINE> <LINE>An thou hadst not come to my bed.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>How long hath she been thus?</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>I hope all will be well. We must be patient: but I</LINE> <LINE>cannot choose but weep, to think they should lay him</LINE> <LINE>i' the cold ground. My brother shall know of it:</LINE> <LINE>and so I thank you for your good counsel. Come, my</LINE> <LINE>coach! Good night, ladies; good night, sweet ladies;</LINE> <LINE>good night, good night.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Follow her close; give her good watch,</LINE> <LINE>I pray you.</LINE> <STAGEDIR>Exit HORATIO</STAGEDIR> <LINE>O, this is the poison of deep grief; it springs</LINE> <LINE>All from her father's death. O Gertrude, Gertrude,</LINE> <LINE>When sorrows come, they come not single spies</LINE> <LINE>But in battalions. First, her father slain:</LINE> <LINE>Next, your son gone; and he most violent author</LINE> <LINE>Of his own just remove: the people muddied,</LINE> <LINE>Thick and unwholesome in their thoughts and whispers,</LINE> <LINE>For good Polonius' death; and we have done but greenly,</LINE> <LINE>In hugger-mugger to inter him: poor Ophelia</LINE> <LINE>Divided from herself and her fair judgment,</LINE> <LINE>Without the which we are pictures, or mere beasts:</LINE> <LINE>Last, and as much containing as all these,</LINE> <LINE>Her brother is in secret come from France;</LINE> <LINE>Feeds on his wonder, keeps himself in clouds,</LINE> <LINE>And wants not buzzers to infect his ear</LINE> <LINE>With pestilent speeches of his father's death;</LINE> <LINE>Wherein necessity, of matter beggar'd,</LINE> <LINE>Will nothing stick our person to arraign</LINE> <LINE>In ear and ear. O my dear Gertrude, this,</LINE> <LINE>Like to a murdering-piece, in many places</LINE> <LINE>Gives me superfluous death.</LINE> </SPEECH> <STAGEDIR>A noise within</STAGEDIR> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Alack, what noise is this?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Where are my Switzers? Let them guard the door.</LINE> <STAGEDIR>Enter another Gentleman</STAGEDIR> <LINE>What is the matter?</LINE> </SPEECH> <SPEECH> <SPEAKER>Gentleman</SPEAKER> <LINE>Save yourself, my lord:</LINE> <LINE>The ocean, overpeering of his list,</LINE> <LINE>Eats not the flats with more impetuous haste</LINE> <LINE>Than young Laertes, in a riotous head,</LINE> <LINE>O'erbears your officers. The rabble call him lord;</LINE> <LINE>And, as the world were now but to begin,</LINE> <LINE>Antiquity forgot, custom not known,</LINE> <LINE>The ratifiers and props of every word,</LINE> <LINE>They cry 'Choose we: Laertes shall be king:'</LINE> <LINE>Caps, hands, and tongues, applaud it to the clouds:</LINE> <LINE>'Laertes shall be king, Laertes king!'</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>How cheerfully on the false trail they cry!</LINE> <LINE>O, this is counter, you false Danish dogs!</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>The doors are broke.</LINE> </SPEECH> <STAGEDIR>Noise within</STAGEDIR> <STAGEDIR>Enter LAERTES, armed; Danes following</STAGEDIR> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Where is this king? Sirs, stand you all without.</LINE> </SPEECH> <SPEECH> <SPEAKER>Danes</SPEAKER> <LINE>No, let's come in.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>I pray you, give me leave.</LINE> </SPEECH> <SPEECH> <SPEAKER>Danes</SPEAKER> <LINE>We will, we will.</LINE> </SPEECH> <STAGEDIR>They retire without the door</STAGEDIR> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>I thank you: keep the door. O thou vile king,</LINE> <LINE>Give me my father!</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Calmly, good Laertes.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>That drop of blood that's calm proclaims me bastard,</LINE> <LINE>Cries cuckold to my father, brands the harlot</LINE> <LINE>Even here, between the chaste unsmirched brow</LINE> <LINE>Of my true mother.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>What is the cause, Laertes,</LINE> <LINE>That thy rebellion looks so giant-like?</LINE> <LINE>Let him go, Gertrude; do not fear our person:</LINE> <LINE>There's such divinity doth hedge a king,</LINE> <LINE>That treason can but peep to what it would,</LINE> <LINE>Acts little of his will. Tell me, Laertes,</LINE> <LINE>Why thou art thus incensed. Let him go, Gertrude.</LINE> <LINE>Speak, man.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Where is my father?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Dead.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>But not by him.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Let him demand his fill.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>How came he dead? I'll not be juggled with:</LINE> <LINE>To hell, allegiance! vows, to the blackest devil!</LINE> <LINE>Conscience and grace, to the profoundest pit!</LINE> <LINE>I dare damnation. To this point I stand,</LINE> <LINE>That both the worlds I give to negligence,</LINE> <LINE>Let come what comes; only I'll be revenged</LINE> <LINE>Most thoroughly for my father.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Who shall stay you?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>My will, not all the world:</LINE> <LINE>And for my means, I'll husband them so well,</LINE> <LINE>They shall go far with little.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Good Laertes,</LINE> <LINE>If you desire to know the certainty</LINE> <LINE>Of your dear father's death, is't writ in your revenge,</LINE> <LINE>That, swoopstake, you will draw both friend and foe,</LINE> <LINE>Winner and loser?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>None but his enemies.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Will you know them then?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>To his good friends thus wide I'll ope my arms;</LINE> <LINE>And like the kind life-rendering pelican,</LINE> <LINE>Repast them with my blood.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Why, now you speak</LINE> <LINE>Like a good child and a true gentleman.</LINE> <LINE>That I am guiltless of your father's death,</LINE> <LINE>And am most sensible in grief for it,</LINE> <LINE>It shall as level to your judgment pierce</LINE> <LINE>As day does to your eye.</LINE> </SPEECH> <SPEECH> <SPEAKER>Danes</SPEAKER> <LINE><STAGEDIR>Within</STAGEDIR> Let her come in.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>How now! what noise is that?</LINE> <STAGEDIR>Re-enter OPHELIA</STAGEDIR> <LINE>O heat, dry up my brains! tears seven times salt,</LINE> <LINE>Burn out the sense and virtue of mine eye!</LINE> <LINE>By heaven, thy madness shall be paid by weight,</LINE> <LINE>Till our scale turn the beam. O rose of May!</LINE> <LINE>Dear maid, kind sister, sweet Ophelia!</LINE> <LINE>O heavens! is't possible, a young maid's wits</LINE> <LINE>Should be as moral as an old man's life?</LINE> <LINE>Nature is fine in love, and where 'tis fine,</LINE> <LINE>It sends some precious instance of itself</LINE> <LINE>After the thing it loves.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE><STAGEDIR>Sings</STAGEDIR></LINE> <LINE>They bore him barefaced on the bier;</LINE> <LINE>Hey non nonny, nonny, hey nonny;</LINE> <LINE>And in his grave rain'd many a tear:--</LINE> <LINE>Fare you well, my dove!</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Hadst thou thy wits, and didst persuade revenge,</LINE> <LINE>It could not move thus.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE><STAGEDIR>Sings</STAGEDIR></LINE> <LINE>You must sing a-down a-down,</LINE> <LINE>An you call him a-down-a.</LINE> <LINE>O, how the wheel becomes it! It is the false</LINE> <LINE>steward, that stole his master's daughter.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>This nothing's more than matter.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>There's rosemary, that's for remembrance; pray,</LINE> <LINE>love, remember: and there is pansies. that's for thoughts.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>A document in madness, thoughts and remembrance fitted.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE>There's fennel for you, and columbines: there's rue</LINE> <LINE>for you; and here's some for me: we may call it</LINE> <LINE>herb-grace o' Sundays: O you must wear your rue with</LINE> <LINE>a difference. There's a daisy: I would give you</LINE> <LINE>some violets, but they withered all when my father</LINE> <LINE>died: they say he made a good end,--</LINE> <STAGEDIR>Sings</STAGEDIR> <LINE>For bonny sweet Robin is all my joy.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Thought and affliction, passion, hell itself,</LINE> <LINE>She turns to favour and to prettiness.</LINE> </SPEECH> <SPEECH> <SPEAKER>OPHELIA</SPEAKER> <LINE><STAGEDIR>Sings</STAGEDIR></LINE> <LINE>And will he not come again?</LINE> <LINE>And will he not come again?</LINE> <LINE>No, no, he is dead:</LINE> <LINE>Go to thy death-bed:</LINE> <LINE>He never will come again.</LINE> <LINE>His beard was as white as snow,</LINE> <LINE>All flaxen was his poll:</LINE> <LINE>He is gone, he is gone,</LINE> <LINE>And we cast away moan:</LINE> <LINE>God ha' mercy on his soul!</LINE> <LINE>And of all Christian souls, I pray God. God be wi' ye.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Do you see this, O God?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Laertes, I must commune with your grief,</LINE> <LINE>Or you deny me right. Go but apart,</LINE> <LINE>Make choice of whom your wisest friends you will.</LINE> <LINE>And they shall hear and judge 'twixt you and me:</LINE> <LINE>If by direct or by collateral hand</LINE> <LINE>They find us touch'd, we will our kingdom give,</LINE> <LINE>Our crown, our life, and all that we can ours,</LINE> <LINE>To you in satisfaction; but if not,</LINE> <LINE>Be you content to lend your patience to us,</LINE> <LINE>And we shall jointly labour with your soul</LINE> <LINE>To give it due content.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Let this be so;</LINE> <LINE>His means of death, his obscure funeral--</LINE> <LINE>No trophy, sword, nor hatchment o'er his bones,</LINE> <LINE>No noble rite nor formal ostentation--</LINE> <LINE>Cry to be heard, as 'twere from heaven to earth,</LINE> <LINE>That I must call't in question.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>So you shall;</LINE> <LINE>And where the offence is let the great axe fall.</LINE> <LINE>I pray you, go with me.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE VI. Another room in the castle.</TITLE> <STAGEDIR>Enter HORATIO and a Servant</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>What are they that would speak with me?</LINE> </SPEECH> <SPEECH> <SPEAKER>Servant</SPEAKER> <LINE>Sailors, sir: they say they have letters for you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Let them come in.</LINE> <STAGEDIR>Exit Servant</STAGEDIR> <LINE>I do not know from what part of the world</LINE> <LINE>I should be greeted, if not from Lord Hamlet.</LINE> </SPEECH> <STAGEDIR>Enter Sailors</STAGEDIR> <SPEECH> <SPEAKER>First Sailor</SPEAKER> <LINE>God bless you, sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Let him bless thee too.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Sailor</SPEAKER> <LINE>He shall, sir, an't please him. There's a letter for</LINE> <LINE>you, sir; it comes from the ambassador that was</LINE> <LINE>bound for England; if your name be Horatio, as I am</LINE> <LINE>let to know it is.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE><STAGEDIR>Reads</STAGEDIR> 'Horatio, when thou shalt have overlooked</LINE> <LINE>this, give these fellows some means to the king:</LINE> <LINE>they have letters for him. Ere we were two days old</LINE> <LINE>at sea, a pirate of very warlike appointment gave us</LINE> <LINE>chase. Finding ourselves too slow of sail, we put on</LINE> <LINE>a compelled valour, and in the grapple I boarded</LINE> <LINE>them: on the instant they got clear of our ship; so</LINE> <LINE>I alone became their prisoner. They have dealt with</LINE> <LINE>me like thieves of mercy: but they knew what they</LINE> <LINE>did; I am to do a good turn for them. Let the king</LINE> <LINE>have the letters I have sent; and repair thou to me</LINE> <LINE>with as much speed as thou wouldst fly death. I</LINE> <LINE>have words to speak in thine ear will make thee</LINE> <LINE>dumb; yet are they much too light for the bore of</LINE> <LINE>the matter. These good fellows will bring thee</LINE> <LINE>where I am. Rosencrantz and Guildenstern hold their</LINE> <LINE>course for England: of them I have much to tell</LINE> <LINE>thee. Farewell.</LINE> <LINE>'He that thou knowest thine, HAMLET.'</LINE> <LINE>Come, I will make you way for these your letters;</LINE> <LINE>And do't the speedier, that you may direct me</LINE> <LINE>To him from whom you brought them.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE VII. Another room in the castle.</TITLE> <STAGEDIR>Enter KING CLAUDIUS and LAERTES</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Now must your conscience my acquaintance seal,</LINE> <LINE>And you must put me in your heart for friend,</LINE> <LINE>Sith you have heard, and with a knowing ear,</LINE> <LINE>That he which hath your noble father slain</LINE> <LINE>Pursued my life.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>It well appears: but tell me</LINE> <LINE>Why you proceeded not against these feats,</LINE> <LINE>So crimeful and so capital in nature,</LINE> <LINE>As by your safety, wisdom, all things else,</LINE> <LINE>You mainly were stirr'd up.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>O, for two special reasons;</LINE> <LINE>Which may to you, perhaps, seem much unsinew'd,</LINE> <LINE>But yet to me they are strong. The queen his mother</LINE> <LINE>Lives almost by his looks; and for myself--</LINE> <LINE>My virtue or my plague, be it either which--</LINE> <LINE>She's so conjunctive to my life and soul,</LINE> <LINE>That, as the star moves not but in his sphere,</LINE> <LINE>I could not but by her. The other motive,</LINE> <LINE>Why to a public count I might not go,</LINE> <LINE>Is the great love the general gender bear him;</LINE> <LINE>Who, dipping all his faults in their affection,</LINE> <LINE>Would, like the spring that turneth wood to stone,</LINE> <LINE>Convert his gyves to graces; so that my arrows,</LINE> <LINE>Too slightly timber'd for so loud a wind,</LINE> <LINE>Would have reverted to my bow again,</LINE> <LINE>And not where I had aim'd them.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>And so have I a noble father lost;</LINE> <LINE>A sister driven into desperate terms,</LINE> <LINE>Whose worth, if praises may go back again,</LINE> <LINE>Stood challenger on mount of all the age</LINE> <LINE>For her perfections: but my revenge will come.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Break not your sleeps for that: you must not think</LINE> <LINE>That we are made of stuff so flat and dull</LINE> <LINE>That we can let our beard be shook with danger</LINE> <LINE>And think it pastime. You shortly shall hear more:</LINE> <LINE>I loved your father, and we love ourself;</LINE> <LINE>And that, I hope, will teach you to imagine--</LINE> <STAGEDIR>Enter a Messenger</STAGEDIR> <LINE>How now! what news?</LINE> </SPEECH> <SPEECH> <SPEAKER>Messenger</SPEAKER> <LINE>Letters, my lord, from Hamlet:</LINE> <LINE>This to your majesty; this to the queen.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>From Hamlet! who brought them?</LINE> </SPEECH> <SPEECH> <SPEAKER>Messenger</SPEAKER> <LINE>Sailors, my lord, they say; I saw them not:</LINE> <LINE>They were given me by Claudio; he received them</LINE> <LINE>Of him that brought them.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Laertes, you shall hear them. Leave us.</LINE> <STAGEDIR>Exit Messenger</STAGEDIR> <STAGEDIR>Reads</STAGEDIR> <LINE>'High and mighty, You shall know I am set naked on</LINE> <LINE>your kingdom. To-morrow shall I beg leave to see</LINE> <LINE>your kingly eyes: when I shall, first asking your</LINE> <LINE>pardon thereunto, recount the occasion of my sudden</LINE> <LINE>and more strange return. 'HAMLET.'</LINE> <LINE>What should this mean? Are all the rest come back?</LINE> <LINE>Or is it some abuse, and no such thing?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Know you the hand?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>'Tis Hamlets character. 'Naked!</LINE> <LINE>And in a postscript here, he says 'alone.'</LINE> <LINE>Can you advise me?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>I'm lost in it, my lord. But let him come;</LINE> <LINE>It warms the very sickness in my heart,</LINE> <LINE>That I shall live and tell him to his teeth,</LINE> <LINE>'Thus didest thou.'</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>If it be so, Laertes--</LINE> <LINE>As how should it be so? how otherwise?--</LINE> <LINE>Will you be ruled by me?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Ay, my lord;</LINE> <LINE>So you will not o'errule me to a peace.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>To thine own peace. If he be now return'd,</LINE> <LINE>As checking at his voyage, and that he means</LINE> <LINE>No more to undertake it, I will work him</LINE> <LINE>To an exploit, now ripe in my device,</LINE> <LINE>Under the which he shall not choose but fall:</LINE> <LINE>And for his death no wind of blame shall breathe,</LINE> <LINE>But even his mother shall uncharge the practise</LINE> <LINE>And call it accident.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>My lord, I will be ruled;</LINE> <LINE>The rather, if you could devise it so</LINE> <LINE>That I might be the organ.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>It falls right.</LINE> <LINE>You have been talk'd of since your travel much,</LINE> <LINE>And that in Hamlet's hearing, for a quality</LINE> <LINE>Wherein, they say, you shine: your sum of parts</LINE> <LINE>Did not together pluck such envy from him</LINE> <LINE>As did that one, and that, in my regard,</LINE> <LINE>Of the unworthiest siege.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>What part is that, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>A very riband in the cap of youth,</LINE> <LINE>Yet needful too; for youth no less becomes</LINE> <LINE>The light and careless livery that it wears</LINE> <LINE>Than settled age his sables and his weeds,</LINE> <LINE>Importing health and graveness. Two months since,</LINE> <LINE>Here was a gentleman of Normandy:--</LINE> <LINE>I've seen myself, and served against, the French,</LINE> <LINE>And they can well on horseback: but this gallant</LINE> <LINE>Had witchcraft in't; he grew unto his seat;</LINE> <LINE>And to such wondrous doing brought his horse,</LINE> <LINE>As he had been incorpsed and demi-natured</LINE> <LINE>With the brave beast: so far he topp'd my thought,</LINE> <LINE>That I, in forgery of shapes and tricks,</LINE> <LINE>Come short of what he did.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>A Norman was't?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>A Norman.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Upon my life, Lamond.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>The very same.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>I know him well: he is the brooch indeed</LINE> <LINE>And gem of all the nation.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>He made confession of you,</LINE> <LINE>And gave you such a masterly report</LINE> <LINE>For art and exercise in your defence</LINE> <LINE>And for your rapier most especially,</LINE> <LINE>That he cried out, 'twould be a sight indeed,</LINE> <LINE>If one could match you: the scrimers of their nation,</LINE> <LINE>He swore, had had neither motion, guard, nor eye,</LINE> <LINE>If you opposed them. Sir, this report of his</LINE> <LINE>Did Hamlet so envenom with his envy</LINE> <LINE>That he could nothing do but wish and beg</LINE> <LINE>Your sudden coming o'er, to play with him.</LINE> <LINE>Now, out of this,--</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>What out of this, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Laertes, was your father dear to you?</LINE> <LINE>Or are you like the painting of a sorrow,</LINE> <LINE>A face without a heart?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Why ask you this?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Not that I think you did not love your father;</LINE> <LINE>But that I know love is begun by time;</LINE> <LINE>And that I see, in passages of proof,</LINE> <LINE>Time qualifies the spark and fire of it.</LINE> <LINE>There lives within the very flame of love</LINE> <LINE>A kind of wick or snuff that will abate it;</LINE> <LINE>And nothing is at a like goodness still;</LINE> <LINE>For goodness, growing to a plurisy,</LINE> <LINE>Dies in his own too much: that we would do</LINE> <LINE>We should do when we would; for this 'would' changes</LINE> <LINE>And hath abatements and delays as many</LINE> <LINE>As there are tongues, are hands, are accidents;</LINE> <LINE>And then this 'should' is like a spendthrift sigh,</LINE> <LINE>That hurts by easing. But, to the quick o' the ulcer:--</LINE> <LINE>Hamlet comes back: what would you undertake,</LINE> <LINE>To show yourself your father's son in deed</LINE> <LINE>More than in words?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>To cut his throat i' the church.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>No place, indeed, should murder sanctuarize;</LINE> <LINE>Revenge should have no bounds. But, good Laertes,</LINE> <LINE>Will you do this, keep close within your chamber.</LINE> <LINE>Hamlet return'd shall know you are come home:</LINE> <LINE>We'll put on those shall praise your excellence</LINE> <LINE>And set a double varnish on the fame</LINE> <LINE>The Frenchman gave you, bring you in fine together</LINE> <LINE>And wager on your heads: he, being remiss,</LINE> <LINE>Most generous and free from all contriving,</LINE> <LINE>Will not peruse the foils; so that, with ease,</LINE> <LINE>Or with a little shuffling, you may choose</LINE> <LINE>A sword unbated, and in a pass of practise</LINE> <LINE>Requite him for your father.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>I will do't:</LINE> <LINE>And, for that purpose, I'll anoint my sword.</LINE> <LINE>I bought an unction of a mountebank,</LINE> <LINE>So mortal that, but dip a knife in it,</LINE> <LINE>Where it draws blood no cataplasm so rare,</LINE> <LINE>Collected from all simples that have virtue</LINE> <LINE>Under the moon, can save the thing from death</LINE> <LINE>That is but scratch'd withal: I'll touch my point</LINE> <LINE>With this contagion, that, if I gall him slightly,</LINE> <LINE>It may be death.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Let's further think of this;</LINE> <LINE>Weigh what convenience both of time and means</LINE> <LINE>May fit us to our shape: if this should fail,</LINE> <LINE>And that our drift look through our bad performance,</LINE> <LINE>'Twere better not assay'd: therefore this project</LINE> <LINE>Should have a back or second, that might hold,</LINE> <LINE>If this should blast in proof. Soft! let me see:</LINE> <LINE>We'll make a solemn wager on your cunnings: I ha't.</LINE> <LINE>When in your motion you are hot and dry--</LINE> <LINE>As make your bouts more violent to that end--</LINE> <LINE>And that he calls for drink, I'll have prepared him</LINE> <LINE>A chalice for the nonce, whereon but sipping,</LINE> <LINE>If he by chance escape your venom'd stuck,</LINE> <LINE>Our purpose may hold there.</LINE> <STAGEDIR>Enter QUEEN GERTRUDE</STAGEDIR> <LINE>How now, sweet queen!</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>One woe doth tread upon another's heel,</LINE> <LINE>So fast they follow; your sister's drown'd, Laertes.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Drown'd! O, where?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>There is a willow grows aslant a brook,</LINE> <LINE>That shows his hoar leaves in the glassy stream;</LINE> <LINE>There with fantastic garlands did she come</LINE> <LINE>Of crow-flowers, nettles, daisies, and long purples</LINE> <LINE>That liberal shepherds give a grosser name,</LINE> <LINE>But our cold maids do dead men's fingers call them:</LINE> <LINE>There, on the pendent boughs her coronet weeds</LINE> <LINE>Clambering to hang, an envious sliver broke;</LINE> <LINE>When down her weedy trophies and herself</LINE> <LINE>Fell in the weeping brook. Her clothes spread wide;</LINE> <LINE>And, mermaid-like, awhile they bore her up:</LINE> <LINE>Which time she chanted snatches of old tunes;</LINE> <LINE>As one incapable of her own distress,</LINE> <LINE>Or like a creature native and indued</LINE> <LINE>Unto that element: but long it could not be</LINE> <LINE>Till that her garments, heavy with their drink,</LINE> <LINE>Pull'd the poor wretch from her melodious lay</LINE> <LINE>To muddy death.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Alas, then, she is drown'd?</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Drown'd, drown'd.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Too much of water hast thou, poor Ophelia,</LINE> <LINE>And therefore I forbid my tears: but yet</LINE> <LINE>It is our trick; nature her custom holds,</LINE> <LINE>Let shame say what it will: when these are gone,</LINE> <LINE>The woman will be out. Adieu, my lord:</LINE> <LINE>I have a speech of fire, that fain would blaze,</LINE> <LINE>But that this folly douts it.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Let's follow, Gertrude:</LINE> <LINE>How much I had to do to calm his rage!</LINE> <LINE>Now fear I this will give it start again;</LINE> <LINE>Therefore let's follow.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> </ACT> <ACT><TITLE>ACT V</TITLE> <SCENE><TITLE>SCENE I. A churchyard.</TITLE> <STAGEDIR>Enter two Clowns, with spades, &amp;c</STAGEDIR> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Is she to be buried in Christian burial that</LINE> <LINE>wilfully seeks her own salvation?</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>I tell thee she is: and therefore make her grave</LINE> <LINE>straight: the crowner hath sat on her, and finds it</LINE> <LINE>Christian burial.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>How can that be, unless she drowned herself in her</LINE> <LINE>own defence?</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Why, 'tis found so.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>It must be 'se offendendo;' it cannot be else. For</LINE> <LINE>here lies the point: if I drown myself wittingly,</LINE> <LINE>it argues an act: and an act hath three branches: it</LINE> <LINE>is, to act, to do, to perform: argal, she drowned</LINE> <LINE>herself wittingly.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Nay, but hear you, goodman delver,--</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Give me leave. Here lies the water; good: here</LINE> <LINE>stands the man; good; if the man go to this water,</LINE> <LINE>and drown himself, it is, will he, nill he, he</LINE> <LINE>goes,--mark you that; but if the water come to him</LINE> <LINE>and drown him, he drowns not himself: argal, he</LINE> <LINE>that is not guilty of his own death shortens not his own life.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>But is this law?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Ay, marry, is't; crowner's quest law.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Will you ha' the truth on't? If this had not been</LINE> <LINE>a gentlewoman, she should have been buried out o'</LINE> <LINE>Christian burial.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Why, there thou say'st: and the more pity that</LINE> <LINE>great folk should have countenance in this world to</LINE> <LINE>drown or hang themselves, more than their even</LINE> <LINE>Christian. Come, my spade. There is no ancient</LINE> <LINE>gentleman but gardeners, ditchers, and grave-makers:</LINE> <LINE>they hold up Adam's profession.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Was he a gentleman?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>He was the first that ever bore arms.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Why, he had none.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>What, art a heathen? How dost thou understand the</LINE> <LINE>Scripture? The Scripture says 'Adam digged:'</LINE> <LINE>could he dig without arms? I'll put another</LINE> <LINE>question to thee: if thou answerest me not to the</LINE> <LINE>purpose, confess thyself--</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Go to.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>What is he that builds stronger than either the</LINE> <LINE>mason, the shipwright, or the carpenter?</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>The gallows-maker; for that frame outlives a</LINE> <LINE>thousand tenants.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>I like thy wit well, in good faith: the gallows</LINE> <LINE>does well; but how does it well? it does well to</LINE> <LINE>those that do in: now thou dost ill to say the</LINE> <LINE>gallows is built stronger than the church: argal,</LINE> <LINE>the gallows may do well to thee. To't again, come.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>'Who builds stronger than a mason, a shipwright, or</LINE> <LINE>a carpenter?'</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Ay, tell me that, and unyoke.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Marry, now I can tell.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>To't.</LINE> </SPEECH> <SPEECH> <SPEAKER>Second Clown</SPEAKER> <LINE>Mass, I cannot tell.</LINE> </SPEECH> <STAGEDIR>Enter HAMLET and HORATIO, at a distance</STAGEDIR> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Cudgel thy brains no more about it, for your dull</LINE> <LINE>ass will not mend his pace with beating; and, when</LINE> <LINE>you are asked this question next, say 'a</LINE> <LINE>grave-maker: 'the houses that he makes last till</LINE> <LINE>doomsday. Go, get thee to Yaughan: fetch me a</LINE> <LINE>stoup of liquor.</LINE> <STAGEDIR>Exit Second Clown</STAGEDIR> <STAGEDIR>He digs and sings</STAGEDIR> <LINE>In youth, when I did love, did love,</LINE> <LINE>Methought it was very sweet,</LINE> <LINE>To contract, O, the time, for, ah, my behove,</LINE> <LINE>O, methought, there was nothing meet.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Has this fellow no feeling of his business, that he</LINE> <LINE>sings at grave-making?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Custom hath made it in him a property of easiness.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>'Tis e'en so: the hand of little employment hath</LINE> <LINE>the daintier sense.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE><STAGEDIR>Sings</STAGEDIR></LINE> <LINE>But age, with his stealing steps,</LINE> <LINE>Hath claw'd me in his clutch,</LINE> <LINE>And hath shipped me intil the land,</LINE> <LINE>As if I had never been such.</LINE> </SPEECH> <STAGEDIR>Throws up a skull</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>That skull had a tongue in it, and could sing once:</LINE> <LINE>how the knave jowls it to the ground, as if it were</LINE> <LINE>Cain's jaw-bone, that did the first murder! It</LINE> <LINE>might be the pate of a politician, which this ass</LINE> <LINE>now o'er-reaches; one that would circumvent God,</LINE> <LINE>might it not?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>It might, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Or of a courtier; which could say 'Good morrow,</LINE> <LINE>sweet lord! How dost thou, good lord?' This might</LINE> <LINE>be my lord such-a-one, that praised my lord</LINE> <LINE>such-a-one's horse, when he meant to beg it; might it not?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Ay, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, e'en so: and now my Lady Worm's; chapless, and</LINE> <LINE>knocked about the mazzard with a sexton's spade:</LINE> <LINE>here's fine revolution, an we had the trick to</LINE> <LINE>see't. Did these bones cost no more the breeding,</LINE> <LINE>but to play at loggats with 'em? mine ache to think on't.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <STAGEDIR>Sings</STAGEDIR> <LINE>A pick-axe, and a spade, a spade,</LINE> <LINE>For and a shrouding sheet:</LINE> <LINE>O, a pit of clay for to be made</LINE> <LINE>For such a guest is meet.</LINE> </SPEECH> <STAGEDIR>Throws up another skull</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>There's another: why may not that be the skull of a</LINE> <LINE>lawyer? Where be his quiddities now, his quillets,</LINE> <LINE>his cases, his tenures, and his tricks? why does he</LINE> <LINE>suffer this rude knave now to knock him about the</LINE> <LINE>sconce with a dirty shovel, and will not tell him of</LINE> <LINE>his action of battery? Hum! This fellow might be</LINE> <LINE>in's time a great buyer of land, with his statutes,</LINE> <LINE>his recognizances, his fines, his double vouchers,</LINE> <LINE>his recoveries: is this the fine of his fines, and</LINE> <LINE>the recovery of his recoveries, to have his fine</LINE> <LINE>pate full of fine dirt? will his vouchers vouch him</LINE> <LINE>no more of his purchases, and double ones too, than</LINE> <LINE>the length and breadth of a pair of indentures? The</LINE> <LINE>very conveyances of his lands will hardly lie in</LINE> <LINE>this box; and must the inheritor himself have no more, ha?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Not a jot more, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Is not parchment made of sheepskins?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Ay, my lord, and of calf-skins too.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>They are sheep and calves which seek out assurance</LINE> <LINE>in that. I will speak to this fellow. Whose</LINE> <LINE>grave's this, sirrah?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Mine, sir.</LINE> <STAGEDIR>Sings</STAGEDIR> <LINE>O, a pit of clay for to be made</LINE> <LINE>For such a guest is meet.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I think it be thine, indeed; for thou liest in't.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>You lie out on't, sir, and therefore it is not</LINE> <LINE>yours: for my part, I do not lie in't, and yet it is mine.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>'Thou dost lie in't, to be in't and say it is thine:</LINE> <LINE>'tis for the dead, not for the quick; therefore thou liest.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>'Tis a quick lie, sir; 'twill away gain, from me to</LINE> <LINE>you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What man dost thou dig it for?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>For no man, sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What woman, then?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>For none, neither.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Who is to be buried in't?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>One that was a woman, sir; but, rest her soul, she's dead.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How absolute the knave is! we must speak by the</LINE> <LINE>card, or equivocation will undo us. By the Lord,</LINE> <LINE>Horatio, these three years I have taken a note of</LINE> <LINE>it; the age is grown so picked that the toe of the</LINE> <LINE>peasant comes so near the heel of the courtier, he</LINE> <LINE>gaffs his kibe. How long hast thou been a</LINE> <LINE>grave-maker?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Of all the days i' the year, I came to't that day</LINE> <LINE>that our last king Hamlet overcame Fortinbras.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How long is that since?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Cannot you tell that? every fool can tell that: it</LINE> <LINE>was the very day that young Hamlet was born; he that</LINE> <LINE>is mad, and sent into England.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Ay, marry, why was he sent into England?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Why, because he was mad: he shall recover his wits</LINE> <LINE>there; or, if he do not, it's no great matter there.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>'Twill, a not be seen in him there; there the men</LINE> <LINE>are as mad as he.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How came he mad?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Very strangely, they say.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How strangely?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Faith, e'en with losing his wits.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Upon what ground?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Why, here in Denmark: I have been sexton here, man</LINE> <LINE>and boy, thirty years.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How long will a man lie i' the earth ere he rot?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>I' faith, if he be not rotten before he die--as we</LINE> <LINE>have many pocky corses now-a-days, that will scarce</LINE> <LINE>hold the laying in--he will last you some eight year</LINE> <LINE>or nine year: a tanner will last you nine year.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why he more than another?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>Why, sir, his hide is so tanned with his trade, that</LINE> <LINE>he will keep out water a great while; and your water</LINE> <LINE>is a sore decayer of your whoreson dead body.</LINE> <LINE>Here's a skull now; this skull has lain in the earth</LINE> <LINE>three and twenty years.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Whose was it?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>A whoreson mad fellow's it was: whose do you think it was?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nay, I know not.</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>A pestilence on him for a mad rogue! a' poured a</LINE> <LINE>flagon of Rhenish on my head once. This same skull,</LINE> <LINE>sir, was Yorick's skull, the king's jester.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>This?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Clown</SPEAKER> <LINE>E'en that.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Let me see.</LINE> <STAGEDIR>Takes the skull</STAGEDIR> <LINE>Alas, poor Yorick! I knew him, Horatio: a fellow</LINE> <LINE>of infinite jest, of most excellent fancy: he hath</LINE> <LINE>borne me on his back a thousand times; and now, how</LINE> <LINE>abhorred in my imagination it is! my gorge rims at</LINE> <LINE>it. Here hung those lips that I have kissed I know</LINE> <LINE>not how oft. Where be your gibes now? your</LINE> <LINE>gambols? your songs? your flashes of merriment,</LINE> <LINE>that were wont to set the table on a roar? Not one</LINE> <LINE>now, to mock your own grinning? quite chap-fallen?</LINE> <LINE>Now get you to my lady's chamber, and tell her, let</LINE> <LINE>her paint an inch thick, to this favour she must</LINE> <LINE>come; make her laugh at that. Prithee, Horatio, tell</LINE> <LINE>me one thing.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>What's that, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Dost thou think Alexander looked o' this fashion i'</LINE> <LINE>the earth?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>E'en so.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>And smelt so? pah!</LINE> </SPEECH> <STAGEDIR>Puts down the skull</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>E'en so, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>To what base uses we may return, Horatio! Why may</LINE> <LINE>not imagination trace the noble dust of Alexander,</LINE> <LINE>till he find it stopping a bung-hole?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>'Twere to consider too curiously, to consider so.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, faith, not a jot; but to follow him thither with</LINE> <LINE>modesty enough, and likelihood to lead it: as</LINE> <LINE>thus: Alexander died, Alexander was buried,</LINE> <LINE>Alexander returneth into dust; the dust is earth; of</LINE> <LINE>earth we make loam; and why of that loam, whereto he</LINE> <LINE>was converted, might they not stop a beer-barrel?</LINE> <LINE>Imperious Caesar, dead and turn'd to clay,</LINE> <LINE>Might stop a hole to keep the wind away:</LINE> <LINE>O, that that earth, which kept the world in awe,</LINE> <LINE>Should patch a wall to expel the winter flaw!</LINE> <LINE>But soft! but soft! aside: here comes the king.</LINE> <STAGEDIR>Enter Priest, &amp;c. in procession; the Corpse of OPHELIA, LAERTES and Mourners following; KING CLAUDIUS, QUEEN GERTRUDE, their trains, &amp;c</STAGEDIR> <LINE>The queen, the courtiers: who is this they follow?</LINE> <LINE>And with such maimed rites? This doth betoken</LINE> <LINE>The corse they follow did with desperate hand</LINE> <LINE>Fordo its own life: 'twas of some estate.</LINE> <LINE>Couch we awhile, and mark.</LINE> </SPEECH> <STAGEDIR>Retiring with HORATIO</STAGEDIR> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>What ceremony else?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>That is Laertes,</LINE> <LINE>A very noble youth: mark.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>What ceremony else?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Priest</SPEAKER> <LINE>Her obsequies have been as far enlarged</LINE> <LINE>As we have warrantise: her death was doubtful;</LINE> <LINE>And, but that great command o'ersways the order,</LINE> <LINE>She should in ground unsanctified have lodged</LINE> <LINE>Till the last trumpet: for charitable prayers,</LINE> <LINE>Shards, flints and pebbles should be thrown on her;</LINE> <LINE>Yet here she is allow'd her virgin crants,</LINE> <LINE>Her maiden strewments and the bringing home</LINE> <LINE>Of bell and burial.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Must there no more be done?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Priest</SPEAKER> <LINE>No more be done:</LINE> <LINE>We should profane the service of the dead</LINE> <LINE>To sing a requiem and such rest to her</LINE> <LINE>As to peace-parted souls.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Lay her i' the earth:</LINE> <LINE>And from her fair and unpolluted flesh</LINE> <LINE>May violets spring! I tell thee, churlish priest,</LINE> <LINE>A ministering angel shall my sister be,</LINE> <LINE>When thou liest howling.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What, the fair Ophelia!</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Sweets to the sweet: farewell!</LINE> <STAGEDIR>Scattering flowers</STAGEDIR> <LINE>I hoped thou shouldst have been my Hamlet's wife;</LINE> <LINE>I thought thy bride-bed to have deck'd, sweet maid,</LINE> <LINE>And not have strew'd thy grave.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>O, treble woe</LINE> <LINE>Fall ten times treble on that cursed head,</LINE> <LINE>Whose wicked deed thy most ingenious sense</LINE> <LINE>Deprived thee of! Hold off the earth awhile,</LINE> <LINE>Till I have caught her once more in mine arms:</LINE> <STAGEDIR>Leaps into the grave</STAGEDIR> <LINE>Now pile your dust upon the quick and dead,</LINE> <LINE>Till of this flat a mountain you have made,</LINE> <LINE>To o'ertop old Pelion, or the skyish head</LINE> <LINE>Of blue Olympus.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE><STAGEDIR>Advancing</STAGEDIR> What is he whose grief</LINE> <LINE>Bears such an emphasis? whose phrase of sorrow</LINE> <LINE>Conjures the wandering stars, and makes them stand</LINE> <LINE>Like wonder-wounded hearers? This is I,</LINE> <LINE>Hamlet the Dane.</LINE> </SPEECH> <STAGEDIR>Leaps into the grave</STAGEDIR> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>The devil take thy soul!</LINE> </SPEECH> <STAGEDIR>Grappling with him</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Thou pray'st not well.</LINE> <LINE>I prithee, take thy fingers from my throat;</LINE> <LINE>For, though I am not splenitive and rash,</LINE> <LINE>Yet have I something in me dangerous,</LINE> <LINE>Which let thy wiseness fear: hold off thy hand.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Pluck them asunder.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Hamlet, Hamlet!</LINE> </SPEECH> <SPEECH> <SPEAKER>All</SPEAKER> <LINE>Gentlemen,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Good my lord, be quiet.</LINE> </SPEECH> <STAGEDIR>The Attendants part them, and they come out of the grave</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why I will fight with him upon this theme</LINE> <LINE>Until my eyelids will no longer wag.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>O my son, what theme?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I loved Ophelia: forty thousand brothers</LINE> <LINE>Could not, with all their quantity of love,</LINE> <LINE>Make up my sum. What wilt thou do for her?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>O, he is mad, Laertes.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>For love of God, forbear him.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>'Swounds, show me what thou'lt do:</LINE> <LINE>Woo't weep? woo't fight? woo't fast? woo't tear thyself?</LINE> <LINE>Woo't drink up eisel? eat a crocodile?</LINE> <LINE>I'll do't. Dost thou come here to whine?</LINE> <LINE>To outface me with leaping in her grave?</LINE> <LINE>Be buried quick with her, and so will I:</LINE> <LINE>And, if thou prate of mountains, let them throw</LINE> <LINE>Millions of acres on us, till our ground,</LINE> <LINE>Singeing his pate against the burning zone,</LINE> <LINE>Make Ossa like a wart! Nay, an thou'lt mouth,</LINE> <LINE>I'll rant as well as thou.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>This is mere madness:</LINE> <LINE>And thus awhile the fit will work on him;</LINE> <LINE>Anon, as patient as the female dove,</LINE> <LINE>When that her golden couplets are disclosed,</LINE> <LINE>His silence will sit drooping.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Hear you, sir;</LINE> <LINE>What is the reason that you use me thus?</LINE> <LINE>I loved you ever: but it is no matter;</LINE> <LINE>Let Hercules himself do what he may,</LINE> <LINE>The cat will mew and dog will have his day.</LINE> </SPEECH> <STAGEDIR>Exit</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>I pray you, good Horatio, wait upon him.</LINE> <STAGEDIR>Exit HORATIO</STAGEDIR> <STAGEDIR>To LAERTES</STAGEDIR> <LINE>Strengthen your patience in our last night's speech;</LINE> <LINE>We'll put the matter to the present push.</LINE> <LINE>Good Gertrude, set some watch over your son.</LINE> <LINE>This grave shall have a living monument:</LINE> <LINE>An hour of quiet shortly shall we see;</LINE> <LINE>Till then, in patience our proceeding be.</LINE> </SPEECH> <STAGEDIR>Exeunt</STAGEDIR> </SCENE> <SCENE><TITLE>SCENE II. A hall in the castle.</TITLE> <STAGEDIR>Enter HAMLET and HORATIO</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>So much for this, sir: now shall you see the other;</LINE> <LINE>You do remember all the circumstance?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Remember it, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Sir, in my heart there was a kind of fighting,</LINE> <LINE>That would not let me sleep: methought I lay</LINE> <LINE>Worse than the mutines in the bilboes. Rashly,</LINE> <LINE>And praised be rashness for it, let us know,</LINE> <LINE>Our indiscretion sometimes serves us well,</LINE> <LINE>When our deep plots do pall: and that should teach us</LINE> <LINE>There's a divinity that shapes our ends,</LINE> <LINE>Rough-hew them how we will,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>That is most certain.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Up from my cabin,</LINE> <LINE>My sea-gown scarf'd about me, in the dark</LINE> <LINE>Groped I to find out them; had my desire.</LINE> <LINE>Finger'd their packet, and in fine withdrew</LINE> <LINE>To mine own room again; making so bold,</LINE> <LINE>My fears forgetting manners, to unseal</LINE> <LINE>Their grand commission; where I found, Horatio,--</LINE> <LINE>O royal knavery!--an exact command,</LINE> <LINE>Larded with many several sorts of reasons</LINE> <LINE>Importing Denmark's health and England's too,</LINE> <LINE>With, ho! such bugs and goblins in my life,</LINE> <LINE>That, on the supervise, no leisure bated,</LINE> <LINE>No, not to stay the grinding of the axe,</LINE> <LINE>My head should be struck off.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Is't possible?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Here's the commission: read it at more leisure.</LINE> <LINE>But wilt thou hear me how I did proceed?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>I beseech you.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Being thus be-netted round with villanies,--</LINE> <LINE>Ere I could make a prologue to my brains,</LINE> <LINE>They had begun the play--I sat me down,</LINE> <LINE>Devised a new commission, wrote it fair:</LINE> <LINE>I once did hold it, as our statists do,</LINE> <LINE>A baseness to write fair and labour'd much</LINE> <LINE>How to forget that learning, but, sir, now</LINE> <LINE>It did me yeoman's service: wilt thou know</LINE> <LINE>The effect of what I wrote?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Ay, good my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>An earnest conjuration from the king,</LINE> <LINE>As England was his faithful tributary,</LINE> <LINE>As love between them like the palm might flourish,</LINE> <LINE>As peace should stiff her wheaten garland wear</LINE> <LINE>And stand a comma 'tween their amities,</LINE> <LINE>And many such-like 'As'es of great charge,</LINE> <LINE>That, on the view and knowing of these contents,</LINE> <LINE>Without debatement further, more or less,</LINE> <LINE>He should the bearers put to sudden death,</LINE> <LINE>Not shriving-time allow'd.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>How was this seal'd?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, even in that was heaven ordinant.</LINE> <LINE>I had my father's signet in my purse,</LINE> <LINE>Which was the model of that Danish seal;</LINE> <LINE>Folded the writ up in form of the other,</LINE> <LINE>Subscribed it, gave't the impression, placed it safely,</LINE> <LINE>The changeling never known. Now, the next day</LINE> <LINE>Was our sea-fight; and what to this was sequent</LINE> <LINE>Thou know'st already.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>So Guildenstern and Rosencrantz go to't.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Why, man, they did make love to this employment;</LINE> <LINE>They are not near my conscience; their defeat</LINE> <LINE>Does by their own insinuation grow:</LINE> <LINE>'Tis dangerous when the baser nature comes</LINE> <LINE>Between the pass and fell incensed points</LINE> <LINE>Of mighty opposites.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Why, what a king is this!</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Does it not, think'st thee, stand me now upon--</LINE> <LINE>He that hath kill'd my king and whored my mother,</LINE> <LINE>Popp'd in between the election and my hopes,</LINE> <LINE>Thrown out his angle for my proper life,</LINE> <LINE>And with such cozenage--is't not perfect conscience,</LINE> <LINE>To quit him with this arm? and is't not to be damn'd,</LINE> <LINE>To let this canker of our nature come</LINE> <LINE>In further evil?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>It must be shortly known to him from England</LINE> <LINE>What is the issue of the business there.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It will be short: the interim is mine;</LINE> <LINE>And a man's life's no more than to say 'One.'</LINE> <LINE>But I am very sorry, good Horatio,</LINE> <LINE>That to Laertes I forgot myself;</LINE> <LINE>For, by the image of my cause, I see</LINE> <LINE>The portraiture of his: I'll court his favours.</LINE> <LINE>But, sure, the bravery of his grief did put me</LINE> <LINE>Into a towering passion.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Peace! who comes here?</LINE> </SPEECH> <STAGEDIR>Enter OSRIC</STAGEDIR> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Your lordship is right welcome back to Denmark.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I humbly thank you, sir. Dost know this water-fly?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>No, my good lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Thy state is the more gracious; for 'tis a vice to</LINE> <LINE>know him. He hath much land, and fertile: let a</LINE> <LINE>beast be lord of beasts, and his crib shall stand at</LINE> <LINE>the king's mess: 'tis a chough; but, as I say,</LINE> <LINE>spacious in the possession of dirt.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Sweet lord, if your lordship were at leisure, I</LINE> <LINE>should impart a thing to you from his majesty.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I will receive it, sir, with all diligence of</LINE> <LINE>spirit. Put your bonnet to his right use; 'tis for the head.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>I thank your lordship, it is very hot.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, believe me, 'tis very cold; the wind is</LINE> <LINE>northerly.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>It is indifferent cold, my lord, indeed.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>But yet methinks it is very sultry and hot for my</LINE> <LINE>complexion.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Exceedingly, my lord; it is very sultry,--as</LINE> <LINE>'twere,--I cannot tell how. But, my lord, his</LINE> <LINE>majesty bade me signify to you that he has laid a</LINE> <LINE>great wager on your head: sir, this is the matter,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I beseech you, remember--</LINE> </SPEECH> <STAGEDIR>HAMLET moves him to put on his hat</STAGEDIR> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Nay, good my lord; for mine ease, in good faith.</LINE> <LINE>Sir, here is newly come to court Laertes; believe</LINE> <LINE>me, an absolute gentleman, full of most excellent</LINE> <LINE>differences, of very soft society and great showing:</LINE> <LINE>indeed, to speak feelingly of him, he is the card or</LINE> <LINE>calendar of gentry, for you shall find in him the</LINE> <LINE>continent of what part a gentleman would see.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Sir, his definement suffers no perdition in you;</LINE> <LINE>though, I know, to divide him inventorially would</LINE> <LINE>dizzy the arithmetic of memory, and yet but yaw</LINE> <LINE>neither, in respect of his quick sail. But, in the</LINE> <LINE>verity of extolment, I take him to be a soul of</LINE> <LINE>great article; and his infusion of such dearth and</LINE> <LINE>rareness, as, to make true diction of him, his</LINE> <LINE>semblable is his mirror; and who else would trace</LINE> <LINE>him, his umbrage, nothing more.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Your lordship speaks most infallibly of him.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The concernancy, sir? why do we wrap the gentleman</LINE> <LINE>in our more rawer breath?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Sir?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Is't not possible to understand in another tongue?</LINE> <LINE>You will do't, sir, really.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What imports the nomination of this gentleman?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Of Laertes?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>His purse is empty already; all's golden words are spent.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Of him, sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>I know you are not ignorant--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I would you did, sir; yet, in faith, if you did,</LINE> <LINE>it would not much approve me. Well, sir?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>You are not ignorant of what excellence Laertes is--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I dare not confess that, lest I should compare with</LINE> <LINE>him in excellence; but, to know a man well, were to</LINE> <LINE>know himself.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>I mean, sir, for his weapon; but in the imputation</LINE> <LINE>laid on him by them, in his meed he's unfellowed.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What's his weapon?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Rapier and dagger.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>That's two of his weapons: but, well.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>The king, sir, hath wagered with him six Barbary</LINE> <LINE>horses: against the which he has imponed, as I take</LINE> <LINE>it, six French rapiers and poniards, with their</LINE> <LINE>assigns, as girdle, hangers, and so: three of the</LINE> <LINE>carriages, in faith, are very dear to fancy, very</LINE> <LINE>responsive to the hilts, most delicate carriages,</LINE> <LINE>and of very liberal conceit.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>What call you the carriages?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>I knew you must be edified by the margent ere you had done.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>The carriages, sir, are the hangers.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The phrase would be more german to the matter, if we</LINE> <LINE>could carry cannon by our sides: I would it might</LINE> <LINE>be hangers till then. But, on: six Barbary horses</LINE> <LINE>against six French swords, their assigns, and three</LINE> <LINE>liberal-conceited carriages; that's the French bet</LINE> <LINE>against the Danish. Why is this 'imponed,' as you call it?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>The king, sir, hath laid, that in a dozen passes</LINE> <LINE>between yourself and him, he shall not exceed you</LINE> <LINE>three hits: he hath laid on twelve for nine; and it</LINE> <LINE>would come to immediate trial, if your lordship</LINE> <LINE>would vouchsafe the answer.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How if I answer 'no'?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>I mean, my lord, the opposition of your person in trial.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Sir, I will walk here in the hall: if it please his</LINE> <LINE>majesty, 'tis the breathing time of day with me; let</LINE> <LINE>the foils be brought, the gentleman willing, and the</LINE> <LINE>king hold his purpose, I will win for him an I can;</LINE> <LINE>if not, I will gain nothing but my shame and the odd hits.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Shall I re-deliver you e'en so?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>To this effect, sir; after what flourish your nature will.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>I commend my duty to your lordship.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Yours, yours.</LINE> <STAGEDIR>Exit OSRIC</STAGEDIR> <LINE>He does well to commend it himself; there are no</LINE> <LINE>tongues else for's turn.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>This lapwing runs away with the shell on his head.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>He did comply with his dug, before he sucked it.</LINE> <LINE>Thus has he--and many more of the same bevy that I</LINE> <LINE>know the dressy age dotes on--only got the tune of</LINE> <LINE>the time and outward habit of encounter; a kind of</LINE> <LINE>yesty collection, which carries them through and</LINE> <LINE>through the most fond and winnowed opinions; and do</LINE> <LINE>but blow them to their trial, the bubbles are out.</LINE> </SPEECH> <STAGEDIR>Enter a Lord</STAGEDIR> <SPEECH> <SPEAKER>Lord</SPEAKER> <LINE>My lord, his majesty commended him to you by young</LINE> <LINE>Osric, who brings back to him that you attend him in</LINE> <LINE>the hall: he sends to know if your pleasure hold to</LINE> <LINE>play with Laertes, or that you will take longer time.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I am constant to my purpose; they follow the king's</LINE> <LINE>pleasure: if his fitness speaks, mine is ready; now</LINE> <LINE>or whensoever, provided I be so able as now.</LINE> </SPEECH> <SPEECH> <SPEAKER>Lord</SPEAKER> <LINE>The king and queen and all are coming down.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>In happy time.</LINE> </SPEECH> <SPEECH> <SPEAKER>Lord</SPEAKER> <LINE>The queen desires you to use some gentle</LINE> <LINE>entertainment to Laertes before you fall to play.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>She well instructs me.</LINE> </SPEECH> <STAGEDIR>Exit Lord</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>You will lose this wager, my lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I do not think so: since he went into France, I</LINE> <LINE>have been in continual practise: I shall win at the</LINE> <LINE>odds. But thou wouldst not think how ill all's here</LINE> <LINE>about my heart: but it is no matter.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Nay, good my lord,--</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>It is but foolery; but it is such a kind of</LINE> <LINE>gain-giving, as would perhaps trouble a woman.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>If your mind dislike any thing, obey it: I will</LINE> <LINE>forestall their repair hither, and say you are not</LINE> <LINE>fit.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Not a whit, we defy augury: there's a special</LINE> <LINE>providence in the fall of a sparrow. If it be now,</LINE> <LINE>'tis not to come; if it be not to come, it will be</LINE> <LINE>now; if it be not now, yet it will come: the</LINE> <LINE>readiness is all: since no man has aught of what he</LINE> <LINE>leaves, what is't to leave betimes?</LINE> </SPEECH> <STAGEDIR>Enter KING CLAUDIUS, QUEEN GERTRUDE, LAERTES, Lords, OSRIC, and Attendants with foils, &amp;c</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Come, Hamlet, come, and take this hand from me.</LINE> </SPEECH> <STAGEDIR>KING CLAUDIUS puts LAERTES' hand into HAMLET's</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Give me your pardon, sir: I've done you wrong;</LINE> <LINE>But pardon't, as you are a gentleman.</LINE> <LINE>This presence knows,</LINE> <LINE>And you must needs have heard, how I am punish'd</LINE> <LINE>With sore distraction. What I have done,</LINE> <LINE>That might your nature, honour and exception</LINE> <LINE>Roughly awake, I here proclaim was madness.</LINE> <LINE>Was't Hamlet wrong'd Laertes? Never Hamlet:</LINE> <LINE>If Hamlet from himself be ta'en away,</LINE> <LINE>And when he's not himself does wrong Laertes,</LINE> <LINE>Then Hamlet does it not, Hamlet denies it.</LINE> <LINE>Who does it, then? His madness: if't be so,</LINE> <LINE>Hamlet is of the faction that is wrong'd;</LINE> <LINE>His madness is poor Hamlet's enemy.</LINE> <LINE>Sir, in this audience,</LINE> <LINE>Let my disclaiming from a purposed evil</LINE> <LINE>Free me so far in your most generous thoughts,</LINE> <LINE>That I have shot mine arrow o'er the house,</LINE> <LINE>And hurt my brother.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>I am satisfied in nature,</LINE> <LINE>Whose motive, in this case, should stir me most</LINE> <LINE>To my revenge: but in my terms of honour</LINE> <LINE>I stand aloof; and will no reconcilement,</LINE> <LINE>Till by some elder masters, of known honour,</LINE> <LINE>I have a voice and precedent of peace,</LINE> <LINE>To keep my name ungored. But till that time,</LINE> <LINE>I do receive your offer'd love like love,</LINE> <LINE>And will not wrong it.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I embrace it freely;</LINE> <LINE>And will this brother's wager frankly play.</LINE> <LINE>Give us the foils. Come on.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Come, one for me.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I'll be your foil, Laertes: in mine ignorance</LINE> <LINE>Your skill shall, like a star i' the darkest night,</LINE> <LINE>Stick fiery off indeed.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>You mock me, sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>No, by this hand.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Give them the foils, young Osric. Cousin Hamlet,</LINE> <LINE>You know the wager?</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Very well, my lord</LINE> <LINE>Your grace hath laid the odds o' the weaker side.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>I do not fear it; I have seen you both:</LINE> <LINE>But since he is better'd, we have therefore odds.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>This is too heavy, let me see another.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>This likes me well. These foils have all a length?</LINE> </SPEECH> <STAGEDIR>They prepare to play</STAGEDIR> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Ay, my good lord.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Set me the stoops of wine upon that table.</LINE> <LINE>If Hamlet give the first or second hit,</LINE> <LINE>Or quit in answer of the third exchange,</LINE> <LINE>Let all the battlements their ordnance fire:</LINE> <LINE>The king shall drink to Hamlet's better breath;</LINE> <LINE>And in the cup an union shall he throw,</LINE> <LINE>Richer than that which four successive kings</LINE> <LINE>In Denmark's crown have worn. Give me the cups;</LINE> <LINE>And let the kettle to the trumpet speak,</LINE> <LINE>The trumpet to the cannoneer without,</LINE> <LINE>The cannons to the heavens, the heavens to earth,</LINE> <LINE>'Now the king dunks to Hamlet.' Come, begin:</LINE> <LINE>And you, the judges, bear a wary eye.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Come on, sir.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Come, my lord.</LINE> </SPEECH> <STAGEDIR>They play</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>One.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>No.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Judgment.</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>A hit, a very palpable hit.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Well; again.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Stay; give me drink. Hamlet, this pearl is thine;</LINE> <LINE>Here's to thy health.</LINE> <STAGEDIR>Trumpets sound, and cannon shot off within</STAGEDIR> <LINE>Give him the cup.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I'll play this bout first; set it by awhile. Come.</LINE> <STAGEDIR>They play</STAGEDIR> <LINE>Another hit; what say you?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>A touch, a touch, I do confess.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Our son shall win.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>He's fat, and scant of breath.</LINE> <LINE>Here, Hamlet, take my napkin, rub thy brows;</LINE> <LINE>The queen carouses to thy fortune, Hamlet.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Good madam!</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Gertrude, do not drink.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>I will, my lord; I pray you, pardon me.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> It is the poison'd cup: it is too late.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>I dare not drink yet, madam; by and by.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>Come, let me wipe thy face.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>My lord, I'll hit him now.</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>I do not think't.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE><STAGEDIR>Aside</STAGEDIR> And yet 'tis almost 'gainst my conscience.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Come, for the third, Laertes: you but dally;</LINE> <LINE>I pray you, pass with your best violence;</LINE> <LINE>I am afeard you make a wanton of me.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Say you so? come on.</LINE> </SPEECH> <STAGEDIR>They play</STAGEDIR> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Nothing, neither way.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Have at you now!</LINE> </SPEECH> <STAGEDIR>LAERTES wounds HAMLET; then in scuffling, they change rapiers, and HAMLET wounds LAERTES</STAGEDIR> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>Part them; they are incensed.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Nay, come, again.</LINE> </SPEECH> <STAGEDIR>QUEEN GERTRUDE falls</STAGEDIR> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Look to the queen there, ho!</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>They bleed on both sides. How is it, my lord?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>How is't, Laertes?</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>Why, as a woodcock to mine own springe, Osric;</LINE> <LINE>I am justly kill'd with mine own treachery.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>How does the queen?</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>She swounds to see them bleed.</LINE> </SPEECH> <SPEECH> <SPEAKER>QUEEN GERTRUDE</SPEAKER> <LINE>No, no, the drink, the drink,--O my dear Hamlet,--</LINE> <LINE>The drink, the drink! I am poison'd.</LINE> </SPEECH> <STAGEDIR>Dies</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O villany! Ho! let the door be lock'd:</LINE> <LINE>Treachery! Seek it out.</LINE> </SPEECH> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>It is here, Hamlet: Hamlet, thou art slain;</LINE> <LINE>No medicine in the world can do thee good;</LINE> <LINE>In thee there is not half an hour of life;</LINE> <LINE>The treacherous instrument is in thy hand,</LINE> <LINE>Unbated and envenom'd: the foul practise</LINE> <LINE>Hath turn'd itself on me lo, here I lie,</LINE> <LINE>Never to rise again: thy mother's poison'd:</LINE> <LINE>I can no more: the king, the king's to blame.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>The point!--envenom'd too!</LINE> <LINE>Then, venom, to thy work.</LINE> </SPEECH> <STAGEDIR>Stabs KING CLAUDIUS</STAGEDIR> <SPEECH> <SPEAKER>All</SPEAKER> <LINE>Treason! treason!</LINE> </SPEECH> <SPEECH> <SPEAKER>KING CLAUDIUS</SPEAKER> <LINE>O, yet defend me, friends; I am but hurt.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Here, thou incestuous, murderous, damned Dane,</LINE> <LINE>Drink off this potion. Is thy union here?</LINE> <LINE>Follow my mother.</LINE> </SPEECH> <STAGEDIR>KING CLAUDIUS dies</STAGEDIR> <SPEECH> <SPEAKER>LAERTES</SPEAKER> <LINE>He is justly served;</LINE> <LINE>It is a poison temper'd by himself.</LINE> <LINE>Exchange forgiveness with me, noble Hamlet:</LINE> <LINE>Mine and my father's death come not upon thee,</LINE> <LINE>Nor thine on me.</LINE> </SPEECH> <STAGEDIR>Dies</STAGEDIR> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>Heaven make thee free of it! I follow thee.</LINE> <LINE>I am dead, Horatio. Wretched queen, adieu!</LINE> <LINE>You that look pale and tremble at this chance,</LINE> <LINE>That are but mutes or audience to this act,</LINE> <LINE>Had I but time--as this fell sergeant, death,</LINE> <LINE>Is strict in his arrest--O, I could tell you--</LINE> <LINE>But let it be. Horatio, I am dead;</LINE> <LINE>Thou livest; report me and my cause aright</LINE> <LINE>To the unsatisfied.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Never believe it:</LINE> <LINE>I am more an antique Roman than a Dane:</LINE> <LINE>Here's yet some liquor left.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>As thou'rt a man,</LINE> <LINE>Give me the cup: let go; by heaven, I'll have't.</LINE> <LINE>O good Horatio, what a wounded name,</LINE> <LINE>Things standing thus unknown, shall live behind me!</LINE> <LINE>If thou didst ever hold me in thy heart</LINE> <LINE>Absent thee from felicity awhile,</LINE> <LINE>And in this harsh world draw thy breath in pain,</LINE> <LINE>To tell my story.</LINE> <STAGEDIR>March afar off, and shot within</STAGEDIR> <LINE>What warlike noise is this?</LINE> </SPEECH> <SPEECH> <SPEAKER>OSRIC</SPEAKER> <LINE>Young Fortinbras, with conquest come from Poland,</LINE> <LINE>To the ambassadors of England gives</LINE> <LINE>This warlike volley.</LINE> </SPEECH> <SPEECH> <SPEAKER>HAMLET</SPEAKER> <LINE>O, I die, Horatio;</LINE> <LINE>The potent poison quite o'er-crows my spirit:</LINE> <LINE>I cannot live to hear the news from England;</LINE> <LINE>But I do prophesy the election lights</LINE> <LINE>On Fortinbras: he has my dying voice;</LINE> <LINE>So tell him, with the occurrents, more and less,</LINE> <LINE>Which have solicited. The rest is silence.</LINE> </SPEECH> <STAGEDIR>Dies</STAGEDIR> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Now cracks a noble heart. Good night sweet prince:</LINE> <LINE>And flights of angels sing thee to thy rest!</LINE> <LINE>Why does the drum come hither?</LINE> </SPEECH> <STAGEDIR>March within</STAGEDIR> <STAGEDIR>Enter FORTINBRAS, the English Ambassadors, and others</STAGEDIR> <SPEECH> <SPEAKER>PRINCE FORTINBRAS</SPEAKER> <LINE>Where is this sight?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>What is it ye would see?</LINE> <LINE>If aught of woe or wonder, cease your search.</LINE> </SPEECH> <SPEECH> <SPEAKER>PRINCE FORTINBRAS</SPEAKER> <LINE>This quarry cries on havoc. O proud death,</LINE> <LINE>What feast is toward in thine eternal cell,</LINE> <LINE>That thou so many princes at a shot</LINE> <LINE>So bloodily hast struck?</LINE> </SPEECH> <SPEECH> <SPEAKER>First Ambassador</SPEAKER> <LINE>The sight is dismal;</LINE> <LINE>And our affairs from England come too late:</LINE> <LINE>The ears are senseless that should give us hearing,</LINE> <LINE>To tell him his commandment is fulfill'd,</LINE> <LINE>That Rosencrantz and Guildenstern are dead:</LINE> <LINE>Where should we have our thanks?</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Not from his mouth,</LINE> <LINE>Had it the ability of life to thank you:</LINE> <LINE>He never gave commandment for their death.</LINE> <LINE>But since, so jump upon this bloody question,</LINE> <LINE>You from the Polack wars, and you from England,</LINE> <LINE>Are here arrived give order that these bodies</LINE> <LINE>High on a stage be placed to the view;</LINE> <LINE>And let me speak to the yet unknowing world</LINE> <LINE>How these things came about: so shall you hear</LINE> <LINE>Of carnal, bloody, and unnatural acts,</LINE> <LINE>Of accidental judgments, casual slaughters,</LINE> <LINE>Of deaths put on by cunning and forced cause,</LINE> <LINE>And, in this upshot, purposes mistook</LINE> <LINE>Fall'n on the inventors' reads: all this can I</LINE> <LINE>Truly deliver.</LINE> </SPEECH> <SPEECH> <SPEAKER>PRINCE FORTINBRAS</SPEAKER> <LINE>Let us haste to hear it,</LINE> <LINE>And call the noblest to the audience.</LINE> <LINE>For me, with sorrow I embrace my fortune:</LINE> <LINE>I have some rights of memory in this kingdom,</LINE> <LINE>Which now to claim my vantage doth invite me.</LINE> </SPEECH> <SPEECH> <SPEAKER>HORATIO</SPEAKER> <LINE>Of that I shall have also cause to speak,</LINE> <LINE>And from his mouth whose voice will draw on more;</LINE> <LINE>But let this same be presently perform'd,</LINE> <LINE>Even while men's minds are wild; lest more mischance</LINE> <LINE>On plots and errors, happen.</LINE> </SPEECH> <SPEECH> <SPEAKER>PRINCE FORTINBRAS</SPEAKER> <LINE>Let four captains</LINE> <LINE>Bear Hamlet, like a soldier, to the stage;</LINE> <LINE>For he was likely, had he been put on,</LINE> <LINE>To have proved most royally: and, for his passage,</LINE> <LINE>The soldiers' music and the rites of war</LINE> <LINE>Speak loudly for him.</LINE> <LINE>Take up the bodies: such a sight as this</LINE> <LINE>Becomes the field, but here shows much amiss.</LINE> <LINE>Go, bid the soldiers shoot.</LINE> </SPEECH> <STAGEDIR>A dead march. Exeunt, bearing off the dead bodies; after which a peal of ordnance is shot off</STAGEDIR> </SCENE> </ACT> </PLAY>
{ "content_hash": "c33f5b77bfb3abefa8e8536fa6255e95", "timestamp": "", "source": "github", "line_count": 9056, "max_line_length": 96, "avg_line_length": 30.885048586572438, "alnum_prop": 0.7248896118986753, "repo_name": "TwineTree/XmlNotepad", "id": "f8be9762eeb1d57102d0555fa3f4cd5ada29c0fa", "size": "279695", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "src/Samples/Hamlet.xml", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1142" }, { "name": "C#", "bytes": "1715558" }, { "name": "CSS", "bytes": "1557" }, { "name": "HTML", "bytes": "53596" }, { "name": "XSLT", "bytes": "31348" } ], "symlink_target": "" }
package net.siufung.bzgzpt.config.persistence; import cn.jbinfo.platform.core.basic.dao.IBaseDAO; import cn.jbinfo.platform.core.framework.annotation.MyBatisDao; /** * * @author siufung.chen * @date 20160903 * @param <T> */ @MyBatisDao public abstract interface ICrudDAO<T> extends IBaseDAO<T> { }
{ "content_hash": "5b8b733f10b14697ce7a3ae031021eb5", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 63, "avg_line_length": 20.466666666666665, "alnum_prop": 0.749185667752443, "repo_name": "1461862234/kzf", "id": "c82ef7897bb1d77f0f2c804ce6960c5d0fe3dad9", "size": "307", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "BZGZPT/bzgzpt-config/src/main/java/net/siufung/bzgzpt/config/persistence/ICrudDAO.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "1050430" }, { "name": "FreeMarker", "bytes": "71863" }, { "name": "HTML", "bytes": "15182" }, { "name": "Java", "bytes": "2609924" }, { "name": "JavaScript", "bytes": "4050259" }, { "name": "SQLPL", "bytes": "1044" } ], "symlink_target": "" }
/* $NetBSD: procfs_ctl.c,v 1.47 2009/10/21 21:12:06 rmind Exp $ */ /* * Copyright (c) 1993 * The Regents of the University of California. All rights reserved. * * This code is derived from software contributed to Berkeley by * Jan-Simon Pendry. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94 */ /* * Copyright (c) 1993 Jan-Simon Pendry * * This code is derived from software contributed to Berkeley by * Jan-Simon Pendry. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94 */ #include <sys/cdefs.h> __KERNEL_RCSID(0, "$NetBSD: procfs_ctl.c,v 1.47 2009/10/21 21:12:06 rmind Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/time.h> #include <sys/kernel.h> #include <sys/proc.h> #include <sys/vnode.h> #include <sys/ioctl.h> #include <sys/tty.h> #include <sys/resource.h> #include <sys/resourcevar.h> #include <sys/signalvar.h> #include <sys/kauth.h> #include <uvm/uvm_extern.h> #include <miscfs/procfs/procfs.h> #define PROCFS_CTL_ATTACH 1 #define PROCFS_CTL_DETACH 2 #define PROCFS_CTL_STEP 3 #define PROCFS_CTL_RUN 4 #define PROCFS_CTL_WAIT 5 static const vfs_namemap_t ctlnames[] = { /* special /proc commands */ { "attach", PROCFS_CTL_ATTACH }, { "detach", PROCFS_CTL_DETACH }, { "step", PROCFS_CTL_STEP }, { "run", PROCFS_CTL_RUN }, { "wait", PROCFS_CTL_WAIT }, { NULL, 0 }, }; static const vfs_namemap_t signames[] = { /* regular signal names */ { "hup", SIGHUP }, { "int", SIGINT }, { "quit", SIGQUIT }, { "ill", SIGILL }, { "trap", SIGTRAP }, { "abrt", SIGABRT }, { "iot", SIGIOT }, { "emt", SIGEMT }, { "fpe", SIGFPE }, { "kill", SIGKILL }, { "bus", SIGBUS }, { "segv", SIGSEGV }, { "sys", SIGSYS }, { "pipe", SIGPIPE }, { "alrm", SIGALRM }, { "term", SIGTERM }, { "urg", SIGURG }, { "stop", SIGSTOP }, { "tstp", SIGTSTP }, { "cont", SIGCONT }, { "chld", SIGCHLD }, { "ttin", SIGTTIN }, { "ttou", SIGTTOU }, { "io", SIGIO }, { "xcpu", SIGXCPU }, { "xfsz", SIGXFSZ }, { "vtalrm", SIGVTALRM }, { "prof", SIGPROF }, { "winch", SIGWINCH }, { "info", SIGINFO }, { "usr1", SIGUSR1 }, { "usr2", SIGUSR2 }, { NULL, 0 }, }; static int procfs_control(struct lwp *, struct lwp *, int, int, struct pfsnode *); int procfs_control(struct lwp *curl, struct lwp *l, int op, int sig, struct pfsnode *pfs) { struct proc *curp = curl->l_proc; struct proc *p = l->l_proc; int error = 0; mutex_enter(proc_lock); mutex_enter(p->p_lock); switch (op) { /* * Attach - attaches the target process for debugging * by the calling process. */ case PROCFS_CTL_ATTACH: /* * You can't attach to a process if: * (1) it's the process that's doing the attaching, */ if (p->p_pid == curp->p_pid) { error = EINVAL; break; } /* * (2) it's already being traced, or */ if (ISSET(p->p_slflag, PSL_TRACED)) { error = EBUSY; break; } /* * (3) the security model prevents it. */ if ((error = kauth_authorize_process(curl->l_cred, KAUTH_PROCESS_PROCFS, p, pfs, KAUTH_ARG(KAUTH_REQ_PROCESS_PROCFS_CTL), NULL)) != 0) break; break; /* * Target process must be stopped, owned by (curp) and * be set up for tracing (PSL_TRACED flag set). * Allow DETACH to take place at any time for sanity. * Allow WAIT any time, of course. * * Note that the semantics of DETACH are different here * from ptrace(2). */ case PROCFS_CTL_DETACH: case PROCFS_CTL_WAIT: /* * You can't do what you want to the process if: * (1) It's not being traced at all, */ if (!ISSET(p->p_slflag, PSL_TRACED)) { error = EPERM; break; } /* * (2) it's being traced by ptrace(2) (which has * different signal delivery semantics), or */ if (!ISSET(p->p_slflag, PSL_FSTRACE)) { error = EBUSY; break; } /* * (3) it's not being traced by _you_. */ if (p->p_pptr != curp) error = EBUSY; break; default: /* * You can't do what you want to the process if: * (1) It's not being traced at all, */ if (!ISSET(p->p_slflag, PSL_TRACED)) { error = EPERM; break; } /* * (2) it's being traced by ptrace(2) (which has * different signal delivery semantics), */ if (!ISSET(p->p_slflag, PSL_FSTRACE)) { error = EBUSY; break; } /* * (3) it's not being traced by _you_, or */ if (p->p_pptr != curp) { error = EBUSY; break; } /* * (4) it's not currently stopped. */ if (p->p_stat != SSTOP || !p->p_waited /* XXXSMP */) error = EBUSY; break; } if (error != 0) { mutex_exit(p->p_lock); mutex_exit(proc_lock); return (error); } /* Do single-step fixup if needed. */ FIX_SSTEP(p); switch (op) { case PROCFS_CTL_ATTACH: /* * Go ahead and set the trace flag. * Save the old parent (it's reset in * _DETACH, and also in kern_exit.c:wait4() * Reparent the process so that the tracing * proc gets to see all the action. * Stop the target. */ SET(p->p_slflag, PSL_TRACED|PSL_FSTRACE); p->p_opptr = p->p_pptr; if (p->p_pptr != curp) { if (p->p_pptr->p_lock < p->p_lock) { if (!mutex_tryenter(p->p_pptr->p_lock)) { mutex_exit(p->p_lock); mutex_enter(p->p_pptr->p_lock); } } else if (p->p_pptr->p_lock > p->p_lock) { mutex_enter(p->p_pptr->p_lock); } p->p_pptr->p_slflag |= PSL_CHTRACED; proc_reparent(p, curp); if (p->p_pptr->p_lock != p->p_lock) mutex_exit(p->p_pptr->p_lock); } sig = SIGSTOP; goto sendsig; #ifdef PT_STEP case PROCFS_CTL_STEP: /* * Step. Let the target process execute a single instruction. */ #endif case PROCFS_CTL_RUN: case PROCFS_CTL_DETACH: #ifdef PT_STEP /* XXXAD locking? */ error = process_sstep(l, op == PROCFS_CTL_STEP); if (error) break; #endif if (op == PROCFS_CTL_DETACH) { /* give process back to original parent */ if (p->p_opptr != p->p_pptr) { struct proc *pp = p->p_opptr; proc_reparent(p, pp ? pp : initproc); } /* not being traced any more */ p->p_opptr = NULL; CLR(p->p_slflag, PSL_TRACED|PSL_FSTRACE); p->p_waited = 0; /* XXXSMP */ } sendsig: /* Finally, deliver the requested signal (or none). */ lwp_lock(l); if (l->l_stat == LSSTOP) { p->p_xstat = sig; /* setrunnable() will release the lock. */ setrunnable(l); } else { lwp_unlock(l); if (sig != 0) { mutex_exit(p->p_lock); psignal(p, sig); mutex_enter(p->p_lock); } } mutex_exit(p->p_lock); mutex_exit(proc_lock); return (error); case PROCFS_CTL_WAIT: mutex_exit(p->p_lock); mutex_exit(proc_lock); /* * Wait for the target process to stop. * XXXSMP WTF is this? */ while (l->l_stat != LSSTOP && P_ZOMBIE(p)) { error = tsleep(l, PWAIT|PCATCH, "procfsx", hz); if (error) break; } return (error); default: panic("procfs_ctl"); /* NOTREACHED */ } mutex_exit(p->p_lock); mutex_exit(proc_lock); return (error); } int procfs_doctl( struct lwp *curl, struct lwp *l, struct pfsnode *pfs, struct uio *uio ) { struct proc *p = l->l_proc; char msg[PROCFS_CTLLEN+1]; const vfs_namemap_t *nm; int error; int xlen; if (uio->uio_rw != UIO_WRITE) return (EOPNOTSUPP); xlen = PROCFS_CTLLEN; error = vfs_getuserstr(uio, msg, &xlen); if (error) return (error); /* * Map signal names into signal generation * or debug control. Unknown commands and/or signals * return EOPNOTSUPP. * * Sending a signal while the process is being debugged * also has the side effect of letting the target continue * to run. There is no way to single-step a signal delivery. */ error = EOPNOTSUPP; nm = vfs_findname(ctlnames, msg, xlen); if (nm) { error = procfs_control(curl, l, nm->nm_val, 0, pfs); } else { nm = vfs_findname(signames, msg, xlen); if (nm) { if (ISSET(p->p_slflag, PSL_TRACED) && p->p_pptr == p) error = procfs_control(curl, l, PROCFS_CTL_RUN, nm->nm_val, pfs); else { psignal(p, nm->nm_val); error = 0; } } } return (error); }
{ "content_hash": "86b66dbe280974d2a0ad07022fc47e0f", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 85, "avg_line_length": 27.25, "alnum_prop": 0.6432706867373297, "repo_name": "execunix/vinos", "id": "d21133bd17721eac67e0547558640f0e886c0e36", "size": "11227", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sys/miscfs/procfs/procfs_ctl.c", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_seq_packet_socket::native_handle</title> <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../basic_seq_packet_socket.html" title="basic_seq_packet_socket"> <link rel="prev" href="native.html" title="basic_seq_packet_socket::native"> <link rel="next" href="native_handle_type.html" title="basic_seq_packet_socket::native_handle_type"> </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="native.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_seq_packet_socket.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="native_handle_type.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="boost_asio.reference.basic_seq_packet_socket.native_handle"></a><a class="link" href="native_handle.html" title="basic_seq_packet_socket::native_handle">basic_seq_packet_socket::native_handle</a> </h4></div></div></div> <p> <span class="emphasis"><em>Inherited from basic_socket.</em></span> </p> <p> <a class="indexterm" name="idp38923472"></a> Get the native socket representation. </p> <pre class="programlisting"><span class="identifier">native_handle_type</span> <span class="identifier">native_handle</span><span class="special">();</span> </pre> <p> This function may be used to obtain the underlying representation of the socket. This is intended to allow access to native socket functionality that is not otherwise provided. </p> </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 &#169; 2003-2015 Christopher M. Kohlhoff<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="native.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_seq_packet_socket.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="native_handle_type.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "eb4eb6b99c798e6638ff08cb341de558", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 445, "avg_line_length": 62.724137931034484, "alnum_prop": 0.6346893897746014, "repo_name": "yinchunlong/abelkhan-1", "id": "77baa2e9a804fc700437e5fccecb51cf7a6c2b7e", "size": "3638", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ext/c++/thirdpart/c++/boost/libs/asio/doc/html/boost_asio/reference/basic_seq_packet_socket/native_handle.html", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "118649" }, { "name": "Assembly", "bytes": "223360" }, { "name": "Batchfile", "bytes": "32410" }, { "name": "C", "bytes": "2956993" }, { "name": "C#", "bytes": "219949" }, { "name": "C++", "bytes": "184617089" }, { "name": "CMake", "bytes": "125437" }, { "name": "CSS", "bytes": "427629" }, { "name": "Cuda", "bytes": "52444" }, { "name": "DIGITAL Command Language", "bytes": "6246" }, { "name": "FORTRAN", "bytes": "1856" }, { "name": "Groff", "bytes": "5189" }, { "name": "HTML", "bytes": "234939732" }, { "name": "IDL", "bytes": "14" }, { "name": "JavaScript", "bytes": "682223" }, { "name": "Lex", "bytes": "1231" }, { "name": "M4", "bytes": "29689" }, { "name": "Makefile", "bytes": "1083341" }, { "name": "Max", "bytes": "36857" }, { "name": "Objective-C", "bytes": "11406" }, { "name": "Objective-C++", "bytes": "630" }, { "name": "PHP", "bytes": "59030" }, { "name": "Perl", "bytes": "38649" }, { "name": "Perl6", "bytes": "2053" }, { "name": "Python", "bytes": "1780184" }, { "name": "QML", "bytes": "593" }, { "name": "QMake", "bytes": "16692" }, { "name": "Rebol", "bytes": "354" }, { "name": "Ruby", "bytes": "5532" }, { "name": "Shell", "bytes": "354720" }, { "name": "Tcl", "bytes": "1172" }, { "name": "TeX", "bytes": "32117" }, { "name": "XSLT", "bytes": "552736" }, { "name": "Yacc", "bytes": "19623" } ], "symlink_target": "" }
#include "encodable.h" #include "protocolfield.h" #include "protocolstructure.h" #include "protocolcode.h" #include "protocoldocumentation.h" #include "protocolparser.h" /*! * Constructor for encodable */ Encodable::Encodable(ProtocolParser* parse, const std::string& Parent, ProtocolSupport supported) : ProtocolDocumentation(parse, Parent, supported) { } /*! * Check all names against C keyword and issue a warning if any of them match. * In addition the matching names will be updated to have a leading underscore */ void Encodable::checkAgainstKeywords(void) { if(contains(keywords, name, true)) { emitWarning("name matches C keyword, changed to _name"); name = "_" + name; } if(contains(keywords, array, true)) { emitWarning("array matches C keyword, changed to _array"); array = "_" + array; } if(contains(keywords, variableArray, true)) { emitWarning("variableArray matches C keyword, changed to _variableArray"); variableArray = "_" + variableArray; } if(contains(keywords, array2d, true)) { emitWarning("array2d matches C keyword, changed to _array2d"); array2d = "_" + array2d; } if(contains(keywords, variable2dArray, true)) { emitWarning("variable2dArray matches C keyword, changed to _variable2dArray"); variable2dArray = "_" + variable2dArray; } if(contains(keywords, dependsOn, true)) { emitWarning("dependsOn matches C keyword, changed to _dependsOn"); dependsOn = "_" + dependsOn; } if(contains(keywords, dependsOnValue, true)) { emitWarning("dependsOnValue matches C keyword, changed to _dependsOnValue"); dependsOnValue = "_" + dependsOnValue; } if(contains(variablenames, name, true)) { emitWarning("name matches ProtoGen variable, changed to _name"); name = "_" + name; } if(contains(variablenames, array, true)) { emitWarning("array matches ProtoGen variable, changed to _array"); array = "_" + array; } if(contains(variablenames, variableArray, true)) { emitWarning("variableArray matches ProtoGen variable, changed to _variableArray"); variableArray = "_" + variableArray; } if(contains(variablenames, array2d, true)) { emitWarning("array2d matches ProtoGen variable, changed to _array2d"); array2d = "_" + array2d; } if(contains(variablenames, variable2dArray, true)) { emitWarning("variable2dArray matches ProtoGen variable, changed to _variable2dArray"); variable2dArray = "_" + variable2dArray; } if(contains(variablenames, dependsOn, true)) { emitWarning("dependsOn matches ProtoGen variable, changed to _dependsOn"); dependsOn = "_" + dependsOn; } if(contains(variablenames, dependsOnValue, true)) { emitWarning("dependsOnValue matches ProtoGen variable, changed to _dependsOnValue"); dependsOnValue = "_" + dependsOnValue; } }// Encodable::checkAgainstKeywords /*! * Reset all data to defaults */ void Encodable::clear(void) { typeName.clear(); name.clear(); title.clear(); comment.clear(); array.clear(); variableArray.clear(); array2d.clear(); variable2dArray.clear(); encodedLength.clear(); dependsOn.clear(); dependsOnValue.clear(); dependsOnCompare.clear(); } /*! * Return the signature of this field in a encode function signature. The * string will start with ", " assuming this field is not the first part of * the function signature. * \return the string that provides this fields encode function signature */ std::string Encodable::getEncodeSignature(void) const { if(isNotEncoded() || isNotInMemory() || isConstant()) return ""; else if(is2dArray()) return ", const " + typeName + " " + name + "[" + array + "][" + array2d + "]"; else if(isArray()) return ", const " + typeName + " " + name + "[" + array + "]"; else if(isPrimitive()) return ", " + typeName + " " + name; else return ", const " + typeName + "* " + name; } /*! * Return the signature of this field in a decode function signature. The * string will start with ", " assuming this field is not the first part of * the function signature. * \return the string that provides this fields decode function signature */ std::string Encodable::getDecodeSignature(void) const { if(isNotEncoded() || isNotInMemory()) return ""; else if(is2dArray()) return ", " + typeName + " " + name + "[" + array + "][" + array2d + "]"; else if(isArray()) return ", " + typeName + " " + name + "[" + array + "]"; else return ", " + typeName + "* " + name; } /*! * Return the string that documents this field as a encode function parameter. * The string starts with " * " and ends with a linefeed * \return the string that povides the parameter documentation */ std::string Encodable::getEncodeParameterComment(void) const { if(isNotEncoded() || isNotInMemory() || isConstant()) return ""; else return " * \\param " + name + " is " + comment + "\n"; } /*! * Return the string that documents this field as a decode function parameter. * The string starts with " * " and ends with a linefeed * \return the string that povides the parameter documentation */ std::string Encodable::getDecodeParameterComment(void) const { if(isNotEncoded() || isNotInMemory()) return ""; else return " * \\param " + name + " receives " + comment + "\n"; } /*! * Get a positive or negative return code string, which is language specific * \param positive should be true for "1" or "true", else "0", or "false" * \return The string in code that is the return. */ std::string Encodable::getReturnCode(bool positive) const { if(positive) { if(support.language == ProtocolSupport::c_language) return "1"; else return "true"; } else { if(support.language == ProtocolSupport::c_language) return "0"; else return "false"; } }// Encodable::getReturnCode /*! * Get the string which accessses this field in code in a encoding context. * \param isStructureMember true if this field is in the scope of a containing structure. * \return The string that accesses this field in code for reading. */ std::string Encodable::getEncodeFieldAccess(bool isStructureMember) const { return getEncodeFieldAccess(isStructureMember, name); }// ProtocolField::getEncodeFieldAccess /*! * Get the string which accessses this field in code in a encoding context. * \param isStructureMember true if this field is in the scope of a containing structure. * \param variable is the name of the variable to be accessed. * \return The string that accesses the variable in code for reading. */ std::string Encodable::getEncodeFieldAccess(bool isStructureMember, const std::string& variable) const { std::string access; // How we are going to access the field if(isStructureMember) { if(support.language == ProtocolSupport::c_language) access = "_pg_user->" + variable; // Access via structure pointer else access = variable; // Access via implicit class reference } else access = variable; // Access via parameter // If the variable we are tyring to access is ourselves (i.e. not dependsOn // or variableArray, etc.) then we need to apply array access rules also. if(variable == name) { if(isArray() && !isString()) { access += "[_pg_i]"; if(is2dArray()) access += "[_pg_j]"; } // If we are a structure, and the language is C, we need the address of // the structure, even for encoding. Note however that if we are a // parameter we are already a pointer (because we never pass structures // by value). if(!isPrimitive() && (support.language == ProtocolSupport::c_language) && (isStructureMember || isArray())) access = "&" + access; } return access; }// Encodable::getEncodeFieldAccess /*! * Get the string which accessses this field in code in a decoding context. * \param isStructureMember true if this field is in the scope of a containing structure. * \return The string that accesses this field in code for writing. */ std::string Encodable::getDecodeFieldAccess(bool isStructureMember) const { return getDecodeFieldAccess(isStructureMember, name); } /*! * Get the string which accessses this field in code in a decoding context. * \param isStructureMember true if this field is in the scope of a containing structure. * \param variable is the name of the variable to be accessed. * \return The string that accesses this field in code for writing. */ std::string Encodable::getDecodeFieldAccess(bool isStructureMember, const std::string& variable) const { std::string access; if(isStructureMember) { if(support.language == ProtocolSupport::c_language) access = "_pg_user->" + variable; // Access via structure pointer else access = variable; // Access via implicit class reference if(variable == name) { // Apply array access rules also, strings are left alone, they are already pointers if(isArray() && !isString()) { access += "[_pg_i]"; // Array de-reference if(is2dArray()) access += "[_pg_j]"; } // If we are a structure, and the language is C, we need the address of the structure. if(!isPrimitive() && (support.language == ProtocolSupport::c_language)) access = "&" + access; } } else { if(variable == name) { if(isString()) access = variable; // Access via string pointer else if(isArray()) { access = variable + "[_pg_i]"; // Array de-reference if(is2dArray()) access += "[_pg_j]"; // If we are a structure, and the language is C, we need the address of the structure. if(!isPrimitive() && (support.language == ProtocolSupport::c_language)) access = "&" + access; } else if(!isPrimitive()) access = variable; else access = "(*" + variable + ")"; // Access via parameter pointer } else access = "(*" + variable + ")"; // Access via parameter pointer } return access; }// Encodable::getDecodeFieldAccess /*! * Get the code that performs array iteration, in a encode context * \param spacing is the spacing that begins the first array iteration line * \param isStructureMember should be true if variable array limits are members of a structure * \return the code for array iteration, which may be empty */ std::string Encodable::getEncodeArrayIterationCode(const std::string& spacing, bool isStructureMember) const { std::string output; if(isArray()) { if(variableArray.empty()) { output += spacing + "for(_pg_i = 0; _pg_i < " + array + "; _pg_i++)\n"; } else { output += spacing + "for(_pg_i = 0; _pg_i < (unsigned)" + getEncodeFieldAccess(isStructureMember, variableArray) + " && _pg_i < " + array + "; _pg_i++)\n"; } if(is2dArray()) { if(variable2dArray.empty()) { output += spacing + TAB_IN + "for(_pg_j = 0; _pg_j < " + array2d + "; _pg_j++)\n"; } else { output += spacing + TAB_IN + "for(_pg_j = 0; _pg_j < (unsigned)" + getEncodeFieldAccess(isStructureMember, variable2dArray) + " && _pg_j < " + array2d + "; _pg_j++)\n"; } } } return output; }// Encodable::getEncodeArrayIterationCode /*! * Get the code that performs array iteration, in a decode context * \param spacing is the spacing that begins the first array iteration line * \param isStructureMember should be true if variable array limits are members of a structure * \return the code for array iteration, which may be empty */ std::string Encodable::getDecodeArrayIterationCode(const std::string& spacing, bool isStructureMember) const { std::string output; if(isArray()) { if(variableArray.empty()) { output += spacing + "for(_pg_i = 0; _pg_i < " + array + "; _pg_i++)\n"; } else { output += spacing + "for(_pg_i = 0; _pg_i < (unsigned)" + getDecodeFieldAccess(isStructureMember, variableArray) + " && _pg_i < " + array + "; _pg_i++)\n"; } if(is2dArray()) { if(variable2dArray.empty()) { output += spacing + TAB_IN + "for(_pg_j = 0; _pg_j < " + array2d + "; _pg_j++)\n"; } else { output += spacing + TAB_IN + "for(_pg_j = 0; _pg_j < (unsigned)" + getDecodeFieldAccess(isStructureMember, variable2dArray) + " && _pg_j < " + array2d + "; _pg_j++)\n"; } } } return output; }// Encodable::getDecodeArrayIterationCode /*! * Get documentation repeat details for array or 2d arrays * \return The repeat details */ std::string Encodable::getRepeatsDocumentationDetails(void) const { std::string repeats = "1"; std::string arrayLink; std::string array2dLink; std::string variableArrayLink; std::string variable2dArrayLink; if(isArray()) { arrayLink = parser->getEnumerationNameForEnumValue(array); if(arrayLink.empty()) arrayLink = array; else arrayLink = "["+array+"](#"+arrayLink+")"; if(variableArray.empty()) variableArrayLink = parser->getEnumerationNameForEnumValue(variableArray); if(variableArrayLink.empty()) variableArrayLink = variableArray; else variableArrayLink = "["+variableArray+"](#"+variableArrayLink+")"; } if(is2dArray()) { array2dLink = parser->getEnumerationNameForEnumValue(array2d); if(array2dLink.empty()) array2dLink = array2d; else array2dLink = "["+array2d+"](#"+array2dLink+")"; if(variable2dArray.empty()) variable2dArrayLink = parser->getEnumerationNameForEnumValue(variable2dArray); if(variable2dArrayLink.empty()) variable2dArrayLink = variable2dArray; else variable2dArrayLink = "["+variable2dArray+"](#"+variable2dArrayLink+")"; } if(is2dArray()) { if(variableArray.empty() && variable2dArray.empty()) repeats = arrayLink+"*"+array2dLink; else repeats = variableArrayLink+"*"+variable2dArrayLink + ", up to " + arrayLink+"*"+array2dLink; } else if(isArray()) { if(variableArray.empty()) repeats = arrayLink; else repeats = variableArrayLink + ", up to " + arrayLink; } return repeats; }// Encodable::getRepeatsDocumentationDetails /*! * Construct a protocol field by parsing a DOM element. The type of Encodable * created will be either a ProtocolStructure or a ProtocolField * \param parse points to the global protocol parser that owns everything * \param Parent is the hierarchical name of the objec which owns the newly created object * \param supported describes what the protocol can support * \param field is the DOM element to parse (including its children) * \return a pointer to a newly allocated encodable. The caller is * responsible for deleting this object. */ Encodable* Encodable::generateEncodable(ProtocolParser* parse, const std::string& parent, ProtocolSupport supported, const XMLElement* field) { Encodable* enc = NULL; if(field == nullptr) return enc; std::string tagname(field->Name()); if(contains(tagname, "structure")) enc = new ProtocolStructure(parse, parent, supported); else if(contains(tagname, "data")) enc = new ProtocolField(parse, parent, supported); else if(contains(tagname, "code")) enc = new ProtocolCode(parse, parent, supported); if(enc != NULL) { enc->setElement(field); enc->parse(); } return enc; }
{ "content_hash": "ca67ef6b32c2dde94564a224f69351c2", "timestamp": "", "source": "github", "line_count": 536, "max_line_length": 184, "avg_line_length": 31.236940298507463, "alnum_prop": 0.6116586035955325, "repo_name": "billvaglienti/ProtoGen", "id": "736f6f0a9c9589945cf23dba68dd402f4977a876", "size": "16743", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "encodable.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "40812" }, { "name": "C++", "bytes": "1090896" }, { "name": "CSS", "bytes": "626" }, { "name": "QMake", "bytes": "8809" }, { "name": "Shell", "bytes": "224" } ], "symlink_target": "" }
package ciir.umass.edu.utilities; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.Semaphore; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; /** * * @author vdang * */ public class MyThreadPool extends ThreadPoolExecutor { private final Semaphore semaphore; private int size = 0; private MyThreadPool(int size) { super(size, size, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); semaphore = new Semaphore(size, true); this.size = size; } private static MyThreadPool singleton = null; public static MyThreadPool getInstance() { if(singleton == null) init(Runtime.getRuntime().availableProcessors()); return singleton; } public static void init(int poolSize) { singleton = new MyThreadPool(poolSize); } public int size() { return size; } public WorkerThread[] execute(WorkerThread worker, int nTasks) { MyThreadPool p = MyThreadPool.getInstance(); int[] partition = p.partition(nTasks); WorkerThread[] workers = new WorkerThread[partition.length-1]; for(int i=0;i<partition.length-1;i++) { WorkerThread w = worker.clone(); w.set(partition[i], partition[i+1]-1); workers[i] = w; p.execute(w); } await(); return workers; } public void await() { for(int i=0;i<size;i++) { try { semaphore.acquire(); } catch(Exception ex) { System.out.println("Error in MyThreadPool.await(): " + ex.toString()); System.exit(1); } } for(int i=0;i<size;i++) semaphore.release(); } public int[] partition(int listSize) { int nChunks = Math.min(listSize, size); int chunkSize = listSize/nChunks; int mod = listSize % nChunks; int[] partition = new int[nChunks+1]; partition[0] = 0; for(int i=1;i<=nChunks;i++) partition[i] = partition[i-1] + chunkSize + ((i<=mod)?1:0); return partition; } public void execute(Runnable task) { try { semaphore.acquire(); super.execute(task); } catch(Exception ex) { System.out.println("Error in MyThreadPool.execute(): " + ex.toString()); System.exit(1); } } protected void afterExecute(Runnable r, Throwable t) { super.afterExecute(r, t); semaphore.release(); } }
{ "content_hash": "b0acb34e2cca12b006b690056b197d34", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 83, "avg_line_length": 22.304761904761904, "alnum_prop": 0.6438941076003416, "repo_name": "sisinflab/lodreclib", "id": "50552bbe4dc5f694c9ebe164d374ab672abbe865", "size": "2818", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/ciir/umass/edu/utilities/MyThreadPool.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "530778" } ], "symlink_target": "" }
layout: default description: Datacenter to datacenter replication, available in the Enterprise Edition title: DC2DC Replication --- # Datacenter to datacenter replication {% include hint-ee.md feature="Datacenter to datacenter replication" %} This chapter introduces ArangoDB's _datacenter to datacenter replication_ (DC2DC). **Sections:** - [Introduction](architecture-deployment-modes-dc2-dc-introduction.html) - [Applicability](architecture-deployment-modes-dc2-dc-applicability.html) - [Requirements](architecture-deployment-modes-dc2-dc-requirements.html) - [Limitations](architecture-deployment-modes-dc2-dc-limitations.html) For further information about _datacenter to datacenter replication_, please refer to the following sections included in other chapters of this Manual: - [Deployment](deployment-dc2-dc.html) - [Administration](administration-dc2-dc.html) - [Troubleshooting](troubleshooting-dc2-dc.html) - [Monitoring](monitoring-dc2-dc.html) - [Security](security-dc2-dc.html)
{ "content_hash": "caaa50bb2f905992bde2533d882f8f02", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 151, "avg_line_length": 40, "alnum_prop": 0.799, "repo_name": "arangodb/docs", "id": "60ed5224398706e558cdcc6aabf1ff8f39099994", "size": "1004", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "3.7/architecture-deployment-modes-dc2-dc.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "111161" }, { "name": "Dockerfile", "bytes": "606" }, { "name": "HTML", "bytes": "20095" }, { "name": "JavaScript", "bytes": "7194" }, { "name": "Ruby", "bytes": "60609" }, { "name": "Shell", "bytes": "617" } ], "symlink_target": "" }
/** * */ package com.netflix.conductor.server.resources; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; import javax.inject.Inject; import javax.inject.Singleton; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import com.netflix.conductor.common.metadata.workflow.RerunWorkflowRequest; import com.netflix.conductor.common.metadata.workflow.SkipTaskRequest; import com.netflix.conductor.common.metadata.workflow.WorkflowDef; import com.netflix.conductor.common.run.SearchResult; import com.netflix.conductor.common.run.Workflow; import com.netflix.conductor.common.run.WorkflowSummary; import com.netflix.conductor.core.config.Configuration; import com.netflix.conductor.core.execution.ApplicationException; import com.netflix.conductor.core.execution.WorkflowExecutor; import com.netflix.conductor.core.execution.ApplicationException.Code; import com.netflix.conductor.service.ExecutionService; import com.netflix.conductor.service.MetadataService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; /** * @author Viren * */ @Api(value="/workflow", produces=MediaType.APPLICATION_JSON, consumes=MediaType.APPLICATION_JSON, tags="Workflow Management") @Path("/workflow") @Produces({MediaType.APPLICATION_JSON}) @Consumes({MediaType.APPLICATION_JSON}) @Singleton public class WorkflowResource { private WorkflowExecutor executor; private ExecutionService service; private MetadataService metadata; private int maxSearchSize; @Inject public WorkflowResource(WorkflowExecutor executor, ExecutionService service, MetadataService metadata, Configuration config) { this.executor = executor; this.service = service; this.metadata = metadata; this.maxSearchSize = config.getIntProperty("workflow.max.search.size", 100); } @POST @Path("/{name}") @Produces({MediaType.TEXT_PLAIN}) @ApiOperation("Start a new workflow. Returns the ID of the workflow instance that can be later used for tracking") public String startWorkflow ( @PathParam("name") String name, @QueryParam("version") Integer version, @QueryParam("correlationId") String correlationId, Map<String, Object> input) throws Exception { WorkflowDef def = metadata.getWorkflowDef(name, version); if(def == null){ throw new ApplicationException(Code.NOT_FOUND, "No such workflow found by name=" + name + ", version=" + version); } return executor.startWorkflow(def.getName(), def.getVersion(), correlationId, input); } @GET @Path("/{name}/correlated/{correlationId}") @ApiOperation("Lists workflows for the given correlation id") @Consumes(MediaType.WILDCARD) public List<Workflow> getWorkflows(@PathParam("name") String name, @PathParam("correlationId") String correlationId, @QueryParam("includeClosed") @DefaultValue("false") boolean includeClosed, @QueryParam("includeTasks") @DefaultValue("false") boolean includeTasks) throws Exception { return service.getWorkflowInstances(name, correlationId, includeClosed, includeTasks); } @GET @Path("/{workflowId}") @ApiOperation("Gets the workflow by workflow id") @Consumes(MediaType.WILDCARD) public Workflow getExecutionStatus( @PathParam("workflowId") String workflowId, @QueryParam("includeTasks") @DefaultValue("true") boolean includeTasks) throws Exception { return service.getExecutionStatus(workflowId, includeTasks); } @DELETE @Path("/{workflowId}/remove") @ApiOperation("Removes the workflow from the system") @Consumes(MediaType.WILDCARD) public void delete(@PathParam("workflowId") String workflowId) throws Exception { service.removeWorkflow(workflowId); } @GET @Path("/running/{name}") @ApiOperation("Retrieve all the running workflows") @Consumes(MediaType.WILDCARD) public List<String> getRunningWorkflow(@PathParam("name") String workflowName, @QueryParam("version") @DefaultValue("1") Integer version, @QueryParam("startTime") Long startTime, @QueryParam("endTime") Long endTime) throws Exception { if(startTime != null && endTime != null){ return executor.getWorkflows(workflowName, version, startTime, endTime); } else { return executor.getRunningWorkflowIds(workflowName); } } @PUT @Path("/decide/{workflowId}") @ApiOperation("Starts the decision task for a workflow") @Consumes(MediaType.WILDCARD) public void decide(@PathParam("workflowId") String workflowId) throws Exception { executor.decide(workflowId); } @PUT @Path("/{workflowId}/pause") @ApiOperation("Pauses the workflow") @Consumes(MediaType.WILDCARD) public void pauseWorkflow(@PathParam("workflowId") String workflowId) throws Exception { executor.pauseWorkflow(workflowId); } @PUT @Path("/{workflowId}/resume") @ApiOperation("Resumes the workflow") @Consumes(MediaType.WILDCARD) public void resumeWorkflow(@PathParam("workflowId") String workflowId) throws Exception { executor.resumeWorkflow(workflowId); } @PUT @Path("/{workflowId}/skiptask/{taskReferenceName}") @ApiOperation("Skips a given task from a current running workflow") @Consumes(MediaType.WILDCARD) public void skipTaskFromWorkflow(@PathParam("workflowId") String workflowId, @PathParam("taskReferenceName") String taskReferenceName, SkipTaskRequest skipTaskRequest) throws Exception { executor.skipTaskFromWorkflow(workflowId, taskReferenceName, skipTaskRequest); } @POST @Path("/{workflowId}/rerun") @ApiOperation("Reruns the workflow from a specific task") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.TEXT_PLAIN) public String rerun(@PathParam("workflowId") String workflowId, RerunWorkflowRequest request) throws Exception { request.setReRunFromWorkflowId(workflowId); return executor.rerun(request); } @POST @Path("/{workflowId}/restart") @ApiOperation("Restarts a completed workflow") @Consumes(MediaType.WILDCARD) public void restart(@PathParam("workflowId") String workflowId) throws Exception { executor.rewind(workflowId); } @POST @Path("/{workflowId}/retry") @ApiOperation("Retries the last failed task") @Consumes(MediaType.WILDCARD) public void retry(@PathParam("workflowId") String workflowId) throws Exception { executor.retry(workflowId); } @DELETE @Path("/{workflowId}") @ApiOperation("Terminate workflow execution") @Consumes(MediaType.WILDCARD) public void terminate(@PathParam("workflowId") String workflowId, @QueryParam("reason") String reason) throws Exception { executor.terminateWorkflow(workflowId, reason); } @ApiOperation(value="Search for workflows based in payload and other parameters", notes="use sort options as sort=<field>:ASC|DESC e.g. sort=name&sort=workflowId:DESC. If order is not specified, defaults to ASC") @GET @Consumes(MediaType.TEXT_PLAIN) @Produces(MediaType.APPLICATION_JSON) @Path("/search") public SearchResult<WorkflowSummary> search( @QueryParam("start") @DefaultValue("0") int start, @QueryParam("size") @DefaultValue("100") int size, @QueryParam("sort") String sort, @QueryParam("freeText") @DefaultValue("*") String freeText, @QueryParam("query") String query ){ if(size > maxSearchSize) { throw new ApplicationException(Code.INVALID_INPUT, "Cannot return more than " + maxSearchSize + " workflows. Please use pagination"); } return service.search(query , freeText, start, size, convert(sort)); } private List<String> convert(String sortStr) { List<String> list = new ArrayList<String>(); if(sortStr != null && sortStr.length() != 0){ list = Arrays.asList(sortStr.split("\\|")); } return list; } }
{ "content_hash": "c31990cb709f6a8375771b2e76e6aeca", "timestamp": "", "source": "github", "line_count": 219, "max_line_length": 214, "avg_line_length": 35.94063926940639, "alnum_prop": 0.7593698386482023, "repo_name": "soup11/conductor", "id": "0f757e61be4717cd71952e6f85ef2cef6cbc7512", "size": "8468", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "jersey/src/main/java/com/netflix/conductor/server/resources/WorkflowResource.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "117018" }, { "name": "HTML", "bytes": "5351" }, { "name": "Java", "bytes": "804297" }, { "name": "JavaScript", "bytes": "2543825" }, { "name": "Python", "bytes": "2166" }, { "name": "Shell", "bytes": "1451" } ], "symlink_target": "" }
<head> <title>The Shopping List app</title> </head> <body> {{> add_images}} <div class="container"> <h1>Welcome to Meteor!</h1> {{> country}} <hr/> {{> images}} </div> </body> <template name="country"> <h2>Hello from United States <small>It is now {{currentTime}}</small> </h2> </template> <template name="images"> <button class="btn btn-success js-show-image-form">add image</button> <div class="row"> {{#each images}} <div class="col-xs-12 col-md-3" id="{{_id}}"> <div class="thumbnail"> <img class="js-image" src="{{img_src}}" alt="{{img_alt}}" /> <div class="caption"> <h3>Rating: {{rating}}</h3> <p>{{img_alt}}</p> <p> {{>starsRating mutable=true class="js-rate-image" id=_id}} </p> <button class="js-del-image btn btn-warning">delete</button> </div> </div> </div> <!-- / col --> {{/each}} </div> <!-- / row --> </template> <template name="add_images"> <div class="modal fade" id="add_images"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <div class="modal-title"> <h4>Load new Image file</h4> </div> </div> <div class="modal-body"> <form class="js-add-image" id="add_image_form"> <div class="form-group"> <label for="img_src" class="control-label">Image Source:</label> <input type="text" class="form-control" name="img_src" /> </div> <div class="form-group"> <label for="img_alt" class="control-label">Description:</label> <textarea class="form-control" name="img_alt"></textarea> </div> </form> </div> <div class="modal-footer"> <button class="btn btn-success js-save-image" type="submit">save</button> <button class="btn btn-warning" data-dismiss="modal">cancel</button> </div> </div> </div> </div> </template>
{ "content_hash": "a3df611ae5d088ae55992b17e306323c", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 83, "avg_line_length": 27.56, "alnum_prop": 0.5234639574262215, "repo_name": "DuCalixte/LearningMeteor", "id": "d9ea15a27f7dc22d784a6dec19b11b99db9b587e", "size": "2067", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "week2/shopping_list/shopping_list.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "163" }, { "name": "HTML", "bytes": "2440" }, { "name": "JavaScript", "bytes": "2847" } ], "symlink_target": "" }
package vfsclientset import ( "fmt" "os" "strings" "time" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/watch" "k8s.io/klog" api "k8s.io/kops/pkg/apis/kops" "k8s.io/kops/pkg/apis/kops/registry" "k8s.io/kops/pkg/apis/kops/v1alpha1" "k8s.io/kops/pkg/apis/kops/validation" "k8s.io/kops/util/pkg/vfs" ) type ClusterVFS struct { commonVFS } func newClusterVFS(basePath vfs.Path) *ClusterVFS { c := &ClusterVFS{} c.init("Cluster", basePath, StoreVersion) defaultReadVersion := v1alpha1.SchemeGroupVersion.WithKind("Cluster") c.defaultReadVersion = &defaultReadVersion return c } func (c *ClusterVFS) Get(name string, options metav1.GetOptions) (*api.Cluster, error) { if options.ResourceVersion != "" { return nil, fmt.Errorf("ResourceVersion not supported in ClusterVFS::Get") } o, err := c.find(name) if err != nil { return nil, err } if o == nil { return nil, errors.NewNotFound(schema.GroupResource{Group: api.GroupName, Resource: "Cluster"}, name) } return o, nil } // Deprecated, but we need this for now.. func (c *ClusterVFS) configBase(clusterName string) (vfs.Path, error) { if clusterName == "" { return nil, fmt.Errorf("clusterName is required") } configPath := c.basePath.Join(clusterName) return configPath, nil } func (c *ClusterVFS) List(options metav1.ListOptions) (*api.ClusterList, error) { names, err := c.listNames() if err != nil { return nil, err } var items []api.Cluster for _, clusterName := range names { cluster, err := c.find(clusterName) if err != nil { klog.Warningf("cluster %q found in state store listing, but cannot be loaded: %v", clusterName, err) continue } if cluster == nil { klog.Warningf("cluster %q found in state store listing, but doesn't exist now", clusterName) continue } items = append(items, *cluster) } return &api.ClusterList{Items: items}, nil } func (r *ClusterVFS) Create(c *api.Cluster) (*api.Cluster, error) { if err := validation.ValidateCluster(c, false); err != nil { return nil, err } if c.ObjectMeta.CreationTimestamp.IsZero() { c.ObjectMeta.CreationTimestamp = metav1.NewTime(time.Now().UTC()) } clusterName := c.ObjectMeta.Name if clusterName == "" { return nil, fmt.Errorf("clusterName is required") } if err := r.writeConfig(c, r.basePath.Join(clusterName, registry.PathCluster), c, vfs.WriteOptionCreate); err != nil { if os.IsExist(err) { return nil, err } return nil, fmt.Errorf("error writing Cluster %q: %v", c.ObjectMeta.Name, err) } return c, nil } func (r *ClusterVFS) Update(c *api.Cluster, status *api.ClusterStatus) (*api.Cluster, error) { clusterName := c.ObjectMeta.Name if clusterName == "" { return nil, field.Required(field.NewPath("Name"), "clusterName is required") } old, err := r.Get(clusterName, metav1.GetOptions{}) if err != nil { return nil, err } if old == nil { return nil, errors.NewNotFound(schema.GroupResource{Group: api.GroupName, Resource: "Cluster"}, clusterName) } if err := validation.ValidateClusterUpdate(c, status, old).ToAggregate(); err != nil { return nil, err } if err := r.writeConfig(c, r.basePath.Join(clusterName, registry.PathCluster), c, vfs.WriteOptionOnlyIfExists); err != nil { if os.IsNotExist(err) { return nil, err } return nil, fmt.Errorf("error writing Cluster: %v", err) } return c, nil } // List returns a slice containing all the cluster names // It skips directories that don't look like clusters func (r *ClusterVFS) listNames() ([]string, error) { paths, err := r.basePath.ReadTree() if err != nil { return nil, fmt.Errorf("error reading state store: %v", err) } var keys []string for _, p := range paths { relativePath, err := vfs.RelativePath(r.basePath, p) if err != nil { return nil, err } if !strings.HasSuffix(relativePath, "/config") { continue } key := strings.TrimSuffix(relativePath, "/config") keys = append(keys, key) } return keys, nil } func (r *ClusterVFS) find(clusterName string) (*api.Cluster, error) { if clusterName == "" { return nil, fmt.Errorf("clusterName is required") } configPath := r.basePath.Join(clusterName, registry.PathCluster) o, err := r.readConfig(configPath) if err != nil { if os.IsNotExist(err) { return nil, nil } return nil, fmt.Errorf("error reading cluster configuration %q: %v", clusterName, err) } c := o.(*api.Cluster) if c.ObjectMeta.Name == "" { c.ObjectMeta.Name = clusterName } if c.ObjectMeta.Name != clusterName { klog.Warningf("Name of cluster does not match: %q vs %q", c.ObjectMeta.Name, clusterName) } // TODO: Split this out into real version updates / schema changes if c.Spec.ConfigBase == "" { configBase, err := r.configBase(clusterName) if err != nil { return nil, fmt.Errorf("error building ConfigBase for cluster: %v", err) } c.Spec.ConfigBase = configBase.Path() } return c, nil } func (r *ClusterVFS) Delete(name string, options *metav1.DeleteOptions) error { return fmt.Errorf("cluster Delete not implemented for vfs store") } func (r *ClusterVFS) DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error { return fmt.Errorf("cluster DeleteCollection not implemented for vfs store") } func (r *ClusterVFS) Watch(opts metav1.ListOptions) (watch.Interface, error) { return nil, fmt.Errorf("cluster Watch not implemented for vfs store") } func (r *ClusterVFS) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *api.Cluster, err error) { return nil, fmt.Errorf("cluster Patch not implemented for vfs store") }
{ "content_hash": "98db651e071f5b770c3dc2c2928f8909", "timestamp": "", "source": "github", "line_count": 211, "max_line_length": 131, "avg_line_length": 27.402843601895736, "alnum_prop": 0.699584918713248, "repo_name": "gambol99/kops", "id": "241b48692efe4cb85a7e7c03d38cc688028b3533", "size": "6351", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/client/simple/vfsclientset/cluster.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "11990" }, { "name": "Go", "bytes": "6959211" }, { "name": "HCL", "bytes": "605257" }, { "name": "Makefile", "bytes": "39522" }, { "name": "Python", "bytes": "212167" }, { "name": "Ruby", "bytes": "1027" }, { "name": "Shell", "bytes": "118033" } ], "symlink_target": "" }
title: 'Inclusive CD Player' authors: 'Inclusive Technology Ltd' license: Freeware thumb: items/inclusive-cd-player.jpg image: items/inclusive-cd-player-thumb.jpg date: '2016-06-21' description: 'A free, switch accessible CD player for Windows 95 onwards.' project: Software tags: - 'Educational and Learning' - 'Learning and Education' categories: - Software project_url: 'http://www.inclusive.co.uk/downloads/downloads.shtml#cdplayer' download_url: 'http://www.inclusive.co.uk/downloads/downloads.shtml#cdplayer' moderated: true --- Inclusive's CD player features: - two different graphic styles - one or two switch access - mouse and keyboard access - automatically remembers settings - suitable for controlling from an IntelliKeys or Concept Keyboard
{ "content_hash": "d1a966c3909dd671fe991a340f50e62c", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 77, "avg_line_length": 32.916666666666664, "alnum_prop": 0.7544303797468355, "repo_name": "openassistive/OpenATFrontEnd", "id": "ac7a2a80d6f03af0cbf47cab873e2e4ad623ff7d", "size": "795", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "content/item/InclusiveCDPlayer.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "589" }, { "name": "JavaScript", "bytes": "11812" }, { "name": "Makefile", "bytes": "56" }, { "name": "Shell", "bytes": "10180" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <!-- Copyright 2017 The Android Open Source Project 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. --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.google.android.material.animation"> <uses-sdk tools:overrideLibrary="androidx.test, android.app, androidx.test.rule, androidx.test.espresso, androidx.test.espresso.idling"/> <application> <uses-library android:name="android.test.runner"/> </application> <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" android:targetPackage="com.google.android.material.testapp.animation"/> </manifest>
{ "content_hash": "c01278e84b8fc57619a6b9da6788ddd5", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 75, "avg_line_length": 38.125, "alnum_prop": 0.7475409836065574, "repo_name": "material-components/material-components-android", "id": "fea926952012914843d2598543aabf6926f28519", "size": "1220", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/javatests/com/google/android/material/animation/AndroidManifest.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "5791956" } ], "symlink_target": "" }
The mempool service provides a mempool transaction index for the Bitcoin blockchain. Specifically, it maintains a larger index of mempool transactions than a typical full node can manage on its own. - transaction id - transaction This service is generally used to support other services and is not used externally. ## Service Configuration none ## Other services this service Depends on - db
{ "content_hash": "11deae3033e5b5894708359226c1b426", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 198, "avg_line_length": 28.428571428571427, "alnum_prop": 0.7989949748743719, "repo_name": "kleetus/bitcore-node", "id": "066594a07baa0ced5b08ba17c8e6108f60296d91", "size": "417", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "docs/services/mempool.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "320942" }, { "name": "Shell", "bytes": "317" } ], "symlink_target": "" }
@interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
{ "content_hash": "63b3360504c24bf5625a95ced365053e", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 60, "avg_line_length": 16.857142857142858, "alnum_prop": 0.7796610169491526, "repo_name": "base0225/-swift", "id": "15c043f04abcc3246c99f270ffb666dce12844b4", "size": "272", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "block复习/block复习/AppDelegate.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "10981965" }, { "name": "Ruby", "bytes": "968" }, { "name": "Shell", "bytes": "98360" }, { "name": "Swift", "bytes": "10018" } ], "symlink_target": "" }
<?php include 'conn.php'; $id = $_GET['infoID']; $sql = "Delete from info_tbl where md5(infoID) = '$id'"; if($conn->query($sql) === true){ echo "Sucessfully deleted data"; header('location:maintenance.php'); }else{ echo "Oppps something error "; } $conn->close(); ?>
{ "content_hash": "74b230db1c810f000ca82169fb74383b", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 57, "avg_line_length": 23.25, "alnum_prop": 0.6164874551971327, "repo_name": "lotfar/GithubFirstTest", "id": "404ddae7b7ccd23340bb20c2905cd97b14bbc1cf", "size": "279", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "samplePhp/delete.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4819" }, { "name": "HTML", "bytes": "23470" }, { "name": "JavaScript", "bytes": "14128" }, { "name": "PHP", "bytes": "24305" } ], "symlink_target": "" }