answer
stringlengths
15
1.25M
#ifndef <API key> #define <API key> #include <sb/SBTypes.h> //#include <hash_map> #include <map> #include "sbm/sbm_speech.hpp" #include "rapidxml.hpp" namespace SmartBody { class AudioFileSpeech : public SpeechInterface { public: struct SpeechRequestInfo { std::vector< VisemeData > visemeData; // stdext::hash_map< std::string, float > timeMarkers; std::map< std::string, float > timeMarkers; std::string id; std::string audioFilename; std::string playCommand; std::string stopCommand; std::map<std::string, std::vector<float> > emotionData; }; private: XercesDOMParser * m_xmlParser; HandlerBase * m_xmlHandler; int m_requestIdCounter; bool visemeCurveMode; bool useMotionByDefault; bool useMotion; // stdext::hash_map< RequestId, SpeechRequestInfo > m_speechRequestInfo; std::map< RequestId, SpeechRequestInfo > m_speechRequestInfo; public: AudioFileSpeech(); virtual ~AudioFileSpeech(); virtual RequestId requestSpeechAudio( const char * agentName, const std::string voiceCode, const DOMNode * node, const char * callbackCmd ); virtual RequestId requestSpeechAudio( const char * agentName, const std::string voiceCode, std::string text, const char * callbackCmd ); virtual RequestId <API key>( const char * agentName, const std::string voiceCode, std::string text, const char * callbackCmd ); virtual std::vector<VisemeData *> * getVisemes( RequestId requestId, SbmCharacter* character); virtual std::vector<float> getEmotionCurve(RequestId requestId, const std::string& emotionType, SbmCharacter* character = NULL); virtual std::vector<std::string> getEmotionNames(RequestId requestId, SbmCharacter* character = NULL); virtual char * <API key>( RequestId requestId, SbmCharacter * character = NULL ); virtual char * <API key>( RequestId requestId, SbmCharacter * character = NULL ); virtual char * <API key>( RequestId requestId ); virtual float getMarkTime( RequestId requestId, const XMLCh * markId ); virtual void requestComplete( RequestId requestId ); // stdext::hash_map< RequestId, SpeechRequestInfo >& <API key>(); SBAPI std::map< RequestId, SpeechRequestInfo >& <API key>(); void setVisemeMode(bool mode) {visemeCurveMode = mode;} void setMotionMode(bool mode) {useMotionByDefault = mode;} protected: virtual void ReadVisemeDataLTF( const char * filename, std::vector< VisemeData > & visemeData ); virtual void ReadVisemeDataBML( const char * filename, std::vector< VisemeData > & visemeData, const SbmCharacter* character ); virtual void ReadMotionDataBML( const char * filename, std::vector< VisemeData > & visemeData); virtual void ReadEmotionData(const char* filename, std::map<std::string, std::vector<float> >& emotionData); // virtual void ReadSpeechTiming( const char * filename, stdext::hash_map< std::string, float > & timeMarkers ); virtual void ReadSpeechTiming( const char * filename, std::map< std::string, float > & timeMarkers ); virtual void <API key>( const char * filename, std::map< std::string, float > & timeMarkers, rapidxml::xml_document<>& bmlDoc); virtual void <API key>( const char * filename, std::vector< VisemeData > & visemeData, const SbmCharacter* character, rapidxml::xml_document<>& bmldoc); std::map<std::string, DOMDocument*> xmlCache; }; }; #endif // <API key>
<h1>Change Log</h1> <p><pre> v1.0.1 [MOD-1121] building with 2.1.3.GA and open sourcing</p> <p>v1.0 Initial Release</p>
using System; using System.IO; using System.Runtime.InteropServices; using Microsoft.VisualStudio; using Microsoft.VisualStudio.Shell.Interop; namespace NuPattern.Runtime.Shell.Shortcuts { <summary> Defines the editor to handle shortcuts </summary> [Guid(Constants.ShortcutEditorGuid)] internal class <API key> : IVsEditorFactory { private IServiceProvider serviceProvider; <summary> Initializes a new instance of the <see cref="<API key>"/> class. </summary> public <API key>(IServiceProvider provider) { Guard.NotNull(() => provider, provider); this.serviceProvider = provider; } <summary> Initializes a new instance of the <see cref="<API key>"/> class. </summary> internal <API key>(IServiceProvider provider, <API key> fileHandler) : this(provider) { Guard.NotNull(() => fileHandler, fileHandler); this.PersistenceHandler = fileHandler; } <summary> Gets or sets the persistence handler. </summary> internal <API key> PersistenceHandler { get; private set; } <summary> Used by the editor factory architecture to create editors that support data/view separation. </summary> public int <API key>(uint grfCreateDoc, string pszMkDocument, string pszPhysicalView, IVsHierarchy pvHier, uint itemid, IntPtr punkDocDataExisting, out IntPtr ppunkDocView, out IntPtr ppunkDocData, out string pbstrEditorCaption, out Guid pguidCmdUI, out int pgrfCDW) { ppunkDocView = IntPtr.Zero; ppunkDocData = IntPtr.Zero; pbstrEditorCaption = string.Empty; pguidCmdUI = this.GetType().GUID; pgrfCDW = 0; // Ensure that the file exists if (File.Exists(pszMkDocument)) { // Ensure we have a file handler. if (this.PersistenceHandler == null) { this.PersistenceHandler = new ShortcutFileHandler(pszMkDocument); } // Launch the shortcut var result = <API key>.LaunchShortcut(this.serviceProvider, this.PersistenceHandler); return result ? VSConstants.S_OK : VSConstants.S_FALSE; } return VSConstants.S_FALSE; } <summary> Closes the editor. </summary> public int Close() { // Nothing to save, nothing to do. return VSConstants.S_OK; } <summary> Maps a logical view to a physical view. </summary> public int MapLogicalView(ref Guid rguidLogicalView, out string pbstrPhysicalView) { // We dont have a logical view per se in this editor, nothing to do. pbstrPhysicalView = null; return VSConstants.S_OK; } <summary> Sets the site of the editor. </summary> public int SetSite(Microsoft.VisualStudio.OLE.Interop.IServiceProvider psp) { // We don't have a editor, dont need to site it, nothing to do here. return VSConstants.S_OK; } } }
using Assets.Scripts.Attributes; using Assets.Scripts.GameScripts.GameLogic.PhysicsBody; using UnityEngine; using GameEvent = Assets.Scripts.Constants.GameEvent; using GameScriptEvent = Assets.Scripts.Constants.GameScriptEvent; namespace Assets.Scripts.GameScripts.GameLogic.LevelMechanics.Section { [AddComponentMenu("LevelMechanics/Section/<API key>")] [RequireComponent(typeof(Collider2D))] [RequireComponent(typeof(<API key>))] public class <API key> : SectionLogic { private bool _activated; private bool _canSpawn; protected override void Initialize() { base.Initialize(); _activated = false; } protected override void Deinitialize() { _canSpawn = false; } [GameScriptEvent(GameScriptEvent.<API key>)] protected override void OnTriggerEnter2D(Collider2D coll) { if (_activated || !_canSpawn || !Initialized || Deinitialized) { return; } TriggerGameEvent(GameEvent.OnSectionActivated, SectionId); _activated = true; } [GameScriptEvent(GameScriptEvent.SurvivalAreaSpawned)] [GameEvent(GameEvent.OnLevelStarted)] public void AllowSpawn() { _canSpawn = true; } } }
#TODO replace RPSGame with this class(for clarity) __author__ = "Paul Council, Joseph Gonzoph, Anand Patel" __version__ = "sprint1" __credits__ = ["Greg Richards"] # imports from ServerPackage import Game class RockPaperScissors(Game.Game): """ this class simulates two players playing a game of rock, paper, scissors """ def __init__(self): super(RockPaperScissors, self).__init__() self.name = "Rock-Paper-Scissors" def get_result(self, moves): player_one_move, player_two_move = moves move_one_legal = self.is_legal(player_one_move) move_two_legal = self.is_legal(player_two_move) if move_one_legal and move_two_legal: if player_one_move == player_two_move: result = (0, 0) elif (player_one_move == 0 and player_two_move != 1) \ or (player_one_move == 1 and player_two_move != 2) \ or (player_one_move == 2 and player_two_move != 0): # result is tuple with points each player has earned respectively result = (1, 0) else: result = (0, 1) elif move_one_legal and not move_two_legal: result = (1, 0) elif not move_one_legal and move_two_legal: result = (0, 1) else: result = (0, 0) return result def is_legal(self, move): return isinstance(move, int) and (move in (0, 1, 2))
# <API key> Soap entitlement service for advanced data platform
/** * CollectionBase.js * * <API key> tailorings of Backbone.Collection go here. * */ (function (spiderOakApp, window, undefined) { "use strict"; var console = window.console || {}; console.log = console.log || function(){}; var Backbone = window.Backbone, _ = window._, $ = window.$; spiderOakApp.CollectionBase = Backbone.Collection.extend({ model: spiderOakApp.ModelBase, set: function(models, options) { var got = Backbone.Collection.prototype.set.call(this, models, options); this.trigger("complete"); return got; }, which: "CollectionBase" }); })(window.spiderOakApp = window.spiderOakApp || {}, window);
package com.tactfactory.my_qcm.entity; import java.util.Date; import java.util.ArrayList; public class Team { private int id; private int id_server; private String name; private ArrayList<Mcq> mcqs; private Date updated_at; /** * Constructor don't make have to mandatory the List of Mcqs * @param id * @param id_server * @param name * @param updated_at */ public Team(int id,int id_server, String name, Date updated_at) { this.id = id; this.id_server = id_server; this.name = name; this.updated_at = updated_at; } /** * Return Team id * @return id */ public int getId() { return id; } /** * Set the id of Team * @param id */ public void setId(int id) { this.id = id; } /** * Return name of Team * @return name */ public String getName() { return name; } /** * Set the name for the Team * @param name */ public void setName(String name) { this.name = name; } /** * Return id_server For the Team * @return id_server */ public int getId_server() { return id_server; } /** * Set the id_server for the Team * @param id_server */ public void setId_server(int id_server) { this.id_server = id_server; } /** * Return date of last_update * @return udapted_at */ public Date getUpdated_at() { return updated_at; } /** * Set the date of last_update * @param updated_at */ public void setUpdated_at(Date updated_at) { this.updated_at = updated_at; } /** * Return the mcqs of Team * @return mcqs */ public ArrayList<Mcq> getMcqs() { return mcqs; } /** * Set the mcqs for the Team * @param mcqs */ public void setMcqs(ArrayList<Mcq> mcqs) { this.mcqs = mcqs; } }
package com.alibaba.wasmWeex.uitest.TC_AG; import com.alibaba.wasmWeex.WXPageActivity; import com.alibaba.wasmWeex.util.TestFlow; import java.util.TreeMap; import org.junit.Before; import org.junit.Test; public class <API key> extends TestFlow { public <API key>() { super(WXPageActivity.class); } @Before public void setUp() throws <API key> { super.setUp(); TreeMap testMap = new <String, Object> TreeMap(); testMap.put("testComponet", "AG_Border"); testMap.put("testChildCaseInit", "<API key>"); testMap.put("step1",new TreeMap(){ { put("click", "#FF0000"); put("screenshot", "<API key>#FF0000"); } }); testMap.put("step2",new TreeMap(){ { put("click", "#00FFFF"); put("screenshot", "<API key>#00FFFF"); } }); super.setTestMap(testMap); } @Test public void doTest(){ super.testByTestMap(); } }
using System.ComponentModel; using System.Runtime.CompilerServices; namespace <API key>.Contexts { class LogonPageContext : <API key> { public static SAP.Logon.Core.LogonContext DefaultLogonContext { get { return new SAP.Logon.Core.LogonContext { RegistrationContext = new SAP.Logon.Core.RegistrationContext { ApplicationId = "com.sap.flight", ServerHost = "127.0.0.1", IsHttps = false, ServerPort = 8080, CommunicatorId = "REST", BackendUserName = "gwdemo", BackendPassword = "welcome" } }; } } public void Reset() { this.LogonContext = DefaultLogonContext; this.Passcode = this.ConfirmedPasscode = this.UnlockCode = ""; this.<API key> = true; this.AppData = null; this.AppActionInProgress = false; } SAP.Logon.Core.LogonContext logonContext = DefaultLogonContext; public SAP.Logon.Core.LogonContext LogonContext { get { return this.logonContext; } set { this.logonContext = value; this.<API key>(); } } private string passcode = ""; public string Passcode { get { return this.passcode; } set { this.passcode = value; this.<API key>(); } } private string confirmedPasscode = ""; public string ConfirmedPasscode { get { return this.confirmedPasscode; } set { this.confirmedPasscode = value; this.<API key>(); } } private string unlockCode = ""; public string UnlockCode { get { return this.unlockCode; } set { this.unlockCode = value; this.<API key>(); } } private bool <API key> = true; public bool <API key> { get { return this.<API key>; } set { this.<API key> = value; this.<API key>(); } } private string appData = ""; public string AppData { get { return this.appData; } set { this.appData = value; this.<API key>(); } } private bool appActionInProgress; public bool AppActionInProgress { get { return this.appActionInProgress; } set { this.appActionInProgress = value; this.<API key>(); } } public event <API key> PropertyChanged; private void <API key>([CallerMemberName] string propertyName = "") { if (this.PropertyChanged != null) { this.PropertyChanged(this, new <API key>(propertyName)); } } } }
#ifndef <API key> #define <API key> #include <map> #ifndef GUCEF_MT_CMUTEX_H #include "gucefMT_CMutex.h" #define GUCEF_MT_CMUTEX_H #endif /* GUCEF_MT_CMUTEX_H ? */ #ifndef <API key> #include "<API key>.h" #define <API key> #endif /* <API key> ? */ #ifndef <API key> #include "CDataNode.h" #define <API key> #endif /* <API key> ? */ #ifndef <API key> #include "<API key>.h" #define <API key> #endif /* <API key> ? */ #ifndef GUCEF_CORE_MACROS_H #include "gucefCORE_macros.h" /* often used gucef macros */ #define GUCEF_CORE_MACROS_H #endif /* GUCEF_CORE_MACROS_H ? */ namespace GUCEF { namespace CORE { /* * Forward declaration of classes used. */ class CSysConsoleClient; /** * Central hub for system console command interaction. * system console clients can use the system console to * iterate the command listing and manipulate it. * handlers can then process commands with there parameters * as sent by system console clients. * * Think of it as a DOS-console/Bash but instead of a storage * medium you can move trough a tree of system commands. */ class <API key> CSysConsole : public <API key> , public <API key> { public: bool RegisterCmd( const CString& path , const CString& command , const std::vector< CString >& args , <API key>* cmdhandler ); void UnregisterCmd( const CString& path , const CString& command ); bool RegisterAlias( const CString& aliasname , const CString& path , const CString& function ); bool UnregisterAlias( const CString& aliasname , const CString& path , const CString& function ); /** * Attempts to store the given tree in the file * given according to the method of the codec metadata * * @param tree the data tree you wish to store * @return wheter storing the tree was successfull */ virtual bool SaveConfig( CDataNode& tree ) const <API key>; /** * Attempts to load data from the given file to the * root node given. The root data will be replaced * and any children the node may already have will be deleted. * * @param treeroot pointer to the node that is to act as root of the data tree * @return whether building the tree from the given file was successfull. */ virtual bool LoadConfig( const CDataNode& treeroot ) <API key>; virtual const CString& GetClassTypeName( void ) const <API key>; public: struct SCmdChannel; struct SFunctionHook; private: friend class CSysConsoleClient; void LeaveDir( CSysConsoleClient* client ); bool EnterDir( CSysConsoleClient* client , const CString& dirname ); bool JumpTo( CSysConsoleClient* client , const CString& path ); bool Execute( CSysConsoleClient* client , const CString& funcname , const std::vector< CString >& arglist , std::vector< CString >& resultdata ); std::vector< CString > GetDirList( const CSysConsoleClient* client ) const; std::vector< CString > GetCmdList( const CSysConsoleClient* client ) const; void InitClient( CSysConsoleClient* client ); void UnregClient( CSysConsoleClient* client ); private: friend class CCoreGlobal; CSysConsole( void ); virtual ~CSysConsole(); private: struct SAliasData { CString path; CString function; }; typedef struct SAliasData TAliasData; typedef std::map< CString, TAliasData > TAliasList; CSysConsole( const CSysConsole& src ); CSysConsole& operator=( const CSysConsole& src ); struct SCmdChannel* FindChannel( struct SCmdChannel* curchannel , const CString& name ); struct SCmdChannel* BuildTree( struct SCmdChannel* curchannel , const CString& path ); void DelTree( struct SCmdChannel* tree ); struct SCmdChannel* WalkTree( struct SCmdChannel* curchannel , const CString& path , CString& leftover ); struct SFunctionHook* FindFunction( const struct SCmdChannel* curchannel , const CString& functionname ); TAliasData* FindAliasFunction( const CString& aliasname ); bool OnSysConsoleCommand( const CString& path , const CString& command , const std::vector< CString >& args , std::vector< CString >& resultdata ) <API key>; CDataNode m_root; TAliasList m_aliases; MT::CMutex m_datalock; }; }; /* namespace CORE */ }; /* namespace GUCEF */ #endif /* <API key> */
package fundamental.games.metropolis.logic.cards.decks.base.blue; import fundamental.games.metropolis.logic.cards.Card; import fundamental.games.metropolis.logic.cards.CardAction; import fundamental.games.metropolis.logic.cards.actions.TransferCoins; import fundamental.games.metropolis.logic.cards.decks.BaseDeck; import fundamental.games.metropolis.global.Range; public class Forest extends Card { public Forest() { super( BaseDeck.FOREST, Color.Blue, Type.Gear, "Forest", "Get 1 coin from bank, on anyone's turn.", 3, new Range(5), new TransferCoins(CardAction.Target.BANK, CardAction.Target.CARD_OWNER, 1) ); } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_92) on Wed Jul 27 21:20:01 CEST 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Scope (PMD Core 5.5.1 API)</title> <meta name="date" content="2016-07-27"> <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="Scope (PMD Core 5.5.1 API)"; } } catch(err) { } var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar.top"> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Scope.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../net/sourceforge/pmd/lang/symboltable/ScopedNode.html" title="interface in net.sourceforge.pmd.lang.symboltable"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sourceforge/pmd/lang/symboltable/Scope.html" target="_top">Frames</a></li> <li><a href="Scope.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <div class="subTitle">net.sourceforge.pmd.lang.symboltable</div> <h2 title="Interface Scope" class="title">Interface Scope</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../../net/sourceforge/pmd/lang/symboltable/AbstractScope.html" title="class in net.sourceforge.pmd.lang.symboltable">AbstractScope</a></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">Scope</span></pre> <div class="block">A scope is a region within variables and other declarations are visible. Scopes can be nested and form a tree. This is expressed through "parent scopes". Each scope manages its own declarations.</div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../../../net/sourceforge/pmd/lang/symboltable/AbstractScope.html" title="class in net.sourceforge.pmd.lang.symboltable"><code>AbstractScope as a base class</code></a>, <a href="http://docs.oracle.com/javase/specs/jls/se7/html/jls-6.html#jls-6.3">Java Language Specification, 6.3: Scope of a Declaration</a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#addDeclaration-net.sourceforge.pmd.lang.symboltable.NameDeclaration-">addDeclaration</a></span>(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameDeclaration.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameDeclaration</a>&nbsp;declaration)</code> <div class="block">Adds a new declaration to this scope.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameDeclaration.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameDeclaration</a>&gt;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#<API key>.sourceforge.pmd.lang.symboltable.NameOccurrence-">addNameOccurrence</a></span>(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameOccurrence</a>&nbsp;occurrence)</code> <div class="block">Adds a <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameOccurrence</code></a> to this scope - only call this after getting a true back from <a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#contains-net.sourceforge.pmd.lang.symboltable.NameOccurrence-"><code>contains(NameOccurrence)</code></a>.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#contains-net.sourceforge.pmd.lang.symboltable.NameOccurrence-">contains</a></span>(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameOccurrence</a>&nbsp;occ)</code> <div class="block">Tests whether or not a <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameOccurrence</code></a> is directly contained in the scope.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code><a href="http: <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#getDeclarations--">getDeclarations</a></span>()</code> <div class="block">Gets all the declaration with the occurrences in this scope.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>&lt;T extends <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameDeclaration.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameDeclaration</a>&gt;<br><a href="http: <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html <div class="block">Helper method to get only a specific type of name declarations.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>&lt;T extends <a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html" title="interface in net.sourceforge.pmd.lang.symboltable">Scope</a>&gt;<br>T</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html <div class="block">Helper method that goes up the parent scopes to find a scope of the specified type</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html" title="interface in net.sourceforge.pmd.lang.symboltable">Scope</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#getParent--">getParent</a></span>()</code> <div class="block">Retrieves this scope's parent</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#setParent-net.sourceforge.pmd.lang.symboltable.Scope-">setParent</a></span>(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html" title="interface in net.sourceforge.pmd.lang.symboltable">Scope</a>&nbsp;parent)</code> <div class="block">Points this scope to its parent</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method.detail"> </a> <h3>Method Detail</h3> <a name="getParent </a> <ul class="blockList"> <li class="blockList"> <h4>getParent</h4> <pre><a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html" title="interface in net.sourceforge.pmd.lang.symboltable">Scope</a>&nbsp;getParent()</pre> <div class="block">Retrieves this scope's parent</div> </li> </ul> <a name="setParent-net.sourceforge.pmd.lang.symboltable.Scope-"> </a> <ul class="blockList"> <li class="blockList"> <h4>setParent</h4> <pre>void&nbsp;setParent(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html" title="interface in net.sourceforge.pmd.lang.symboltable">Scope</a>&nbsp;parent)</pre> <div class="block">Points this scope to its parent</div> </li> </ul> <a name="<API key>.lang.Class-"> </a> <ul class="blockList"> <li class="blockList"> <h4>getEnclosingScope</h4> <pre>&lt;T extends <a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html" title="interface in net.sourceforge.pmd.lang.symboltable">Scope</a>&gt;&nbsp;T&nbsp;getEnclosingScope(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;T&gt;&nbsp;clazz)</pre> <div class="block">Helper method that goes up the parent scopes to find a scope of the specified type</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>clazz</code> - the type of the Scope to search for</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the found scope of the specified type or <code>null</code> if no such scope was found.</dd> </dl> </li> </ul> <a name="getDeclarations </a> <ul class="blockList"> <li class="blockList"> <h4>getDeclarations</h4> <pre><a href="http: <div class="block">Gets all the declaration with the occurrences in this scope.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>map of declarations with occurrences.</dd> </dl> </li> </ul> <a name="<API key>.lang.Class-"> </a> <ul class="blockList"> <li class="blockList"> <h4>getDeclarations</h4> <pre>&lt;T extends <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameDeclaration.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameDeclaration</a>&gt;&nbsp;<a href="http: <div class="block">Helper method to get only a specific type of name declarations. The return map elemens have already been casted to the correct type. This method usually returns a subset of <a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#getDeclarations--"><code>getDeclarations()</code></a>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>clazz</code> - the type of name declarations to use</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>map of declarations with occurrences.</dd> </dl> </li> </ul> <a name="contains-net.sourceforge.pmd.lang.symboltable.NameOccurrence-"> </a> <ul class="blockList"> <li class="blockList"> <h4>contains</h4> <pre>boolean&nbsp;contains(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameOccurrence</a>&nbsp;occ)</pre> <div class="block">Tests whether or not a <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameOccurrence</code></a> is directly contained in the scope. This means, whether the given <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameOccurrence</code></a> references a declaration, that has been declared within this scope. Note that this search is just for this scope - it doesn't go diving into any parent scopes.</div> </li> </ul> <a name="addDeclaration-net.sourceforge.pmd.lang.symboltable.NameDeclaration-"> </a> <ul class="blockList"> <li class="blockList"> <h4>addDeclaration</h4> <pre>void&nbsp;addDeclaration(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameDeclaration.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameDeclaration</a>&nbsp;declaration)</pre> <div class="block">Adds a new declaration to this scope. Only after the declaration has been added, <a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#contains-net.sourceforge.pmd.lang.symboltable.NameOccurrence-"><code>contains(NameOccurrence)</code></a> and <a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#<API key>.sourceforge.pmd.lang.symboltable.NameOccurrence-"><code>addNameOccurrence(NameOccurrence)</code></a> can be used correctly.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>declaration</code> - the declaration to add</dd> </dl> </li> </ul> <a name="<API key>.sourceforge.pmd.lang.symboltable.NameOccurrence-"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>addNameOccurrence</h4> <pre><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameDeclaration.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameDeclaration</a>&gt;&nbsp;addNameOccurrence(<a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable">NameOccurrence</a>&nbsp;occurrence)</pre> <div class="block">Adds a <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameOccurrence</code></a> to this scope - only call this after getting a true back from <a href="../../../../../net/sourceforge/pmd/lang/symboltable/Scope.html#contains-net.sourceforge.pmd.lang.symboltable.NameOccurrence-"><code>contains(NameOccurrence)</code></a>.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>the <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameDeclaration.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameDeclaration</code></a>s that are referenced by the given <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameOccurrence</code></a>, if the <a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><code>NameOccurrence</code></a> could be added. Otherwise an empty set is returned.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/Scope.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../net/sourceforge/pmd/lang/symboltable/NameOccurrence.html" title="interface in net.sourceforge.pmd.lang.symboltable"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../../net/sourceforge/pmd/lang/symboltable/ScopedNode.html" title="interface in net.sourceforge.pmd.lang.symboltable"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?net/sourceforge/pmd/lang/symboltable/Scope.html" target="_top">Frames</a></li> <li><a href="Scope.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> </a></div> <p class="legalCopy"><small>Copyright & </body> </html>
package org.adligo.fabricate.routines.view; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; /** * This view represents multiple projects * which are committed at the same time. * * @author scott * */ public class GitCommitView implements I_GitCommitView { /* (non-Javadoc) * @see org.adligo.fabricate.view.I_GitCommitView#show() */ @Override public void show() { } }
package com.keeps.crm.utils; import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.<API key>; import net.sourceforge.pinyin4j.format.HanyuPinyinToneType; import net.sourceforge.pinyin4j.format.exception.<API key>; public class Hanyu { public static String getFullSpell(String chinese) { StringBuffer pybf = new StringBuffer(); char[] arr = chinese.toCharArray(); <API key> defaultFormat = new <API key>(); defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); for (int i = 0; i < arr.length; i++) { if (arr[i] > 128) { try { pybf.append(PinyinHelper.<API key>(arr[i], defaultFormat)[0]); } catch (<API key> e) { e.printStackTrace(); } } else { pybf.append(arr[i]); } } return pybf.toString(); } public static String getFirstSpell(String chinese) { StringBuffer pybf = new StringBuffer(); char[] arr = chinese.toCharArray(); <API key> defaultFormat = new <API key>(); defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE); defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE); for (int i = 0; i < arr.length; i++) { if (arr[i] > 128) { try { String[] temp = PinyinHelper.<API key>(arr[i], defaultFormat); if (temp != null) { pybf.append(temp[0].charAt(0)); } } catch (<API key> e) { e.printStackTrace(); } } else { pybf.append(arr[i]); } } return pybf.toString().replaceAll("\\W", "").trim(); } }
var editor = {}; editor.editMap = null; editor.serviceMap = {}; editor.getEditPage = function(reminders, places, reminder) { editor.changeHeading(reminder); editor.setEditFields(reminders, places, reminder); } editor.changeHeading = function(reminder) { var heading = $('#editHeading'); if (reminder === undefined) { heading.text("Add Reminder"); } else { heading.text("Edit Reminder"); $('#reminderIdCell').text(reminder.id); } } editor.createAddObjects = function(reminders, places) { var add = { isNew: ($(' isNewPlace: ($(' reminder: {}, place: null }; add.place = editor.getEditPlace(places); if (add.isNew) { add.reminder.id = storer.createReminderId(); } else { add.reminder.id = $('#reminderIdCell').text(); } add.reminder.enabled = ($(' add.reminder.description = $('#editDescription').val(); add.reminder.when = {}; add.reminder.when = editor.getEditWhen(); add.reminder.where = []; add.reminder.where.push(editor.getEditWhere(add.place)); add.reminder.devices = editor.getEditDevices(); return add; } editor.getEditDevices = function() { var deviceList = []; var serviceList = $("#devicesSelect").val() || []; for (var i=0;i<serviceList.length; i++) { console.log("Looking for notification service : " + serviceList[i]); deviceList.push(editor.serviceMap[serviceList[i]]); } return deviceList; } editor.getEditPlace = function(places) { var place; if ($('#placeSelect').val() !== "_ANYWHERE") { place = {}; if ($(' place.id = editor.getNewPlaceId(); place.datecreated = new Date(); place.description = $('#<API key>').val(); var latlng = editor.editMap.getCenter(); place.coordinates = { latitude: latlng.lat(), longitude: latlng.lng() }; return place; } else { return places[$('#placeSelect').val()]; } } else { return null; } } editor.getNewPlaceId = function() { return "place-" + Date.now(); } editor.getEditWhere = function(place) { //pre: given a place with a valid id. if (place === null) { return "anywhere"; } else { return { "place": place.id, "proximity": { amount: $('#proximityAmount').val(), units: $('#proximityUnits').val() } }; } } editor.getEditWhen = function() { if ($("#dateSelect").val() !== 'anytime') { var dateEnd = $("#datepicker2").datepicker("getDate"); var dateStart = $("#datepicker").datepicker("getDate"); var recurr = $('#recurringSelect').val(); return { startdate: dateStart, enddate: dateEnd, recurring: recurr }; } else { return "anytime"; } } editor.isPlace = function(place) { return !(place === null || place === "anywhere"); } editor.saveEditReminder = function(reminders, places) { var add = editor.createAddObjects(reminders, places); console.log("Adding: " + JSON.stringify(add.reminder)); console.log("Adding: " + JSON.stringify(add.place)); storer.savePlace(add.place, function () { if (editor.isPlace(add.place)) { places[add.place.id] = add.place; console.log("Added " + add.place.id); } reminders[add.reminder.id] = add.reminder; storer.saveReminder(add.reminder, function () { //re-attach place to reminder if (editor.isPlace(add.place)) { add.reminder.where[0].place = places[add.place.id]; } if (add.isNew) { alerter.jalert("New reminder saved: " + add.reminder.description); } else { alerter.jalert("Reminder saved: " + add.reminder.description); } main.hideAddPage(); main.loadViewPage(); }, function (err) { alerter.jalert("Failed to add reminder: " + add.reminder.description); }); }, function (err) { alerter.jalert("Failed to add place: " + add.place.description); }); } editor.dateTimeSelect = function() { if ($("#dateSelect").val() !== 'anytime') { $("#dateWrapper").show(); } else { $('#dateWrapper').hide(); } } function mapLoadedCallback() { console.log("map loaded callback"); geoTools.<API key>(function (position) { var currentLocation = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); editor.displayEditMap(currentLocation, '<API key>'); }, function (err) { var currentLocation = new google.maps.LatLng(-33.8665433, 151.1956316); editor.displayEditMap(currentLocation, '<API key>'); }); } editor.loadEditGoogleMap = function() { geoTools.<API key>("mapLoadedCallback", mapLoadedCallback); } editor.displayEditMap = function(position, element) { console.log("displaying the edit map, with position: " + JSON.stringify(position)); editor.editMap = new google.maps.Map(document.getElementById(element), { mapTypeId: google.maps.MapTypeId.ROADMAP, center: position, zoom: 12 }); } editor.placeSelect = function(reminder, places) { if ($(" $("#placeAddRow1").hide(); $("#placeAddRow2").hide(); editor.hideProximityField(); } else if ($(" $("#<API key>").val(""); $("#<API key>").html(""); editor.loadEditGoogleMap(); editor.showProximityField(); $("#placeAddRow1").show(); $("#placeAddRow2").show(); } else { var place = places[$("#placeSelect").val()]; if (place !== null) { $("#<API key>").val(place.description); $("#<API key>").html(viewer.getGoogleMap(place.coordinates)); } editor.showProximityField(reminder); $("#placeAddRow1").show(); $("#placeAddRow2").show(); } } editor.hideProximityField = function() { $('#proximityDiv').hide(); } editor.showProximityField = function(reminder) { //HACK: Currently only works for single places. $('#proximityDiv').show(); if (reminder === undefined || reminder.where === undefined || reminder.where[0] === undefined || reminder.where[0].proximity === undefined || reminder.where[0].proximity.amount === undefined) { $('#proximityAmount').val("10"); } else { $('#proximityAmount').val(reminder.where[0].proximity.amount); $('#proximityUnits').val(reminder.where[0].proximity.units); } } editor.setEditFields = function(reminders, places, reminder) { editor.setEditEnabled(reminder); editor.setEditDescription(reminder); editor.setEditDateFields(reminder); editor.setEditPlaceFields(places, reminder); editor.<API key>(reminder); $("#saveReminderButton").unbind("click"); $("#saveReminderButton").bind("click", function() { console.log("Clicked saveEditReminder"); editor.saveEditReminder(reminders, places); }); } editor.setEditEnabled = function(reminder) { $(' reminder.enabled)); } editor.setEditDescription = function(reminder) { if (reminder !== undefined && reminder.description !== undefined) { $("#editDescription").val(reminder.description); } else { $("#editDescription").val(""); } } editor.setEditPlaceFields = function(places, reminder) { //remove all places $("#placeSelect option").filter(function () { return ($(this).attr("class") !== "persistentOption"); }).remove(); //add all places again for (var p in places) { var placeOption = $("<option value='" + places[p].id + "' id='place-option-" + places[p].id + "'>" + places[p].description + "</option>"); $("#placeSelect").append(placeOption); } //add the 'new' option $("#placeSelect").append("<option value=\"_NEWPLACE\" id=\"<API key>\">Add a new location</option>"); $("#placeSelect").unbind("change"); $("#placeSelect").change(function() { editor.placeSelect(reminder, places); }); if (reminder !== undefined && reminder.where !== null && reminder.where[0] !== null && reminder.where[0].place !== undefined) { $("#place-option-" + reminder.where[0].place.id).attr('selected', true); $("#place-option-" + reminder.where[0].place.id).selected = true; $("#placeSelect").val(reminder.where[0].place.id); if (reminder.where[0].proximity !== undefined) { $('#proximityAmount').val(reminder.where[0].proximity.amount); $('#proximityUnits').val(reminder.where[0].proximity.units); } editor.placeSelect(reminder, places); } else { $("#placeSelect").val("<API key>"); $('#<API key>').val("anytime"); $('#<API key>').empty(); $('#proximityAmount').val("10"); $('#proximityUnits').val("metres"); editor.placeSelect(reminder, places); } } editor.<API key> = function(reminder) { //remove all services $("#devicesSelect option").filter(function () { return ($(this).attr("class") !== "persistentOption"); }).remove(); //add services that we know about already if (reminder !== undefined && reminder.hasOwnProperty("devices") && reminder.devices !== null && Array.isArray(reminder.devices) && reminder.devices.length > 0) { for (var i=0;i<reminder.devices.length; i++) { $('#devicesSelect').append('<option id="deviceOpt-' + reminder.devices[i].id + '" value="' + reminder.devices[i].id + '" selected="true">' + reminder.devices[i].displayName + ' on ' + reminder.devices[i].serviceAddress + '</option>'); editor.addServiceToList(reminder.devices[i]); } } //find all services again (this will load asynchronously - might be a problem) webinos.discovery.findServices( new ServiceType('http://webinos.org/api/webnotification'), { onFound: function(service) { if ($(' $('#devicesSelect').append('<option id="deviceOpt-' + service.id + '" value="' + service.id + '" selected="false">' + service.displayName + ' on ' + service.serviceAddress + '</option>'); } editor.addServiceToList(service); } } ); } // we're storing service details so we can add them later. // I'm assuming services never change (it doesn't matter if they appear/disappear, but it would if their ID or values change) editor.addServiceToList = function(service) { console.log("Adding a notification service: " + JSON.stringify(service)); editor.serviceMap[service.id] = service; } editor.setEditDateFields = function(reminder) { //clear the select options $("#dateSelect option").filter(function () { return ($(this).attr("class") !== "persistentOption"); }).remove(); //Remove a date picker var dtOptionsStart = { onClose : function(dateText, inst) { if ($("#datepicker2").val() !== '') { var testStartDate = $("#datepicker").datetimepicker('getDate'); var testEndDate = $("#datepicker2").datetimepicker('getDate'); if (testStartDate > testEndDate) $("#datepicker2").datetimepicker('setDate', testStartDate); } else { $("#datepicker2").val(dateText); } }, onSelect: function(startDateText, inst) { $("#datepicker2").datetimepicker('option', 'minDate', $("#datepicker").datetimepicker('getDate') ); } }; var dtOptionsEnd = { onClose : function(dateText, inst) { if ($("#datepicker").val() !== '') { var testStartDate = $("#datepicker").datetimepicker('getDate'); var testEndDate = $("#datepicker2").datetimepicker('getDate'); if (testStartDate > testEndDate) $("#datepicker2").datetimepicker('setDate', testStartDate); } else { $("#datepicker").val(dateText); } }, onSelect: function(startDateText, inst) { $("#datepicker").datetimepicker('option', 'maxDate', $("#datepicker2").datetimepicker('getDate') ); } }; if (reminder !== undefined) { if (reminder.when !== undefined && reminder.when.startdate !== undefined && reminder.when.enddate !== undefined) { var currOption = $("<option id='_DATE_CURRENT' value='_DATE_CURRENT'>" + reminder.when.startdate.toString() + "</option>"); currOption.attr('selected', true); $("#dateSelect").append(currOption); $("#dateSelect").val(reminder.when.startdate.toString()); $("#_DATE_CURRENT").attr('selected', true); $("#datepicker").datetimepicker(dtOptionsStart); $("#datepicker").datetimepicker("setDate", reminder.when.startdate); $("#datepicker2").datetimepicker(dtOptionsEnd); $("#datepicker2").datetimepicker("setDate", reminder.when.enddate); if (reminder.when.recurring !== null) { $("#recurringSelect").val(reminder.when.recurring); $("#recurringOption-" + reminder.when.recurring).attr('selected', true); $("#recurringOption-" + reminder.when.recurring).selected = true; $("#dateWrapper").show(); } editor.dateTimeSelect(); } else { $("#recurringSelect option:selected").attr("selected", false); $("#datepicker").datetimepicker(dtOptionsStart); $("#datepicker2").datetimepicker(dtOptionsEnd); editor.dateTimeSelect(); } } else { //create a date picker $("#datepicker").datetimepicker(dtOptionsStart); $("#datepicker2").datetimepicker(dtOptionsEnd); //set the recurrance back to normal $("#recurringSelect option:selected").attr("selected", false); $("#recurringSelect").val(""); editor.dateTimeSelect(); } $("#dateSelect").unbind("change"); $("#dateSelect").change(editor.dateTimeSelect); }
require_relative "test_helper" require "csv" class XlsxReaderTest describe IOStreams::Xlsx::Reader do let :file_name do File.join(File.dirname(__FILE__), "files", "spreadsheet.xlsx") end let :xlsx_contents do [ ["first column", "second column", "third column"], ["data 1", "data 2", "more data"] ] end describe ".file" do describe "with a file path" do it "returns the contents of the file" do csv = IOStreams::Xlsx::Reader.file(file_name, &:read) assert_equal xlsx_contents, CSV.parse(csv) end end describe "with a file stream" do it "returns the contents of the file" do csv = "" File.open(file_name, "rb") do |file| csv = IOStreams::Xlsx::Reader.stream(file, &:read) end assert_equal xlsx_contents, CSV.parse(csv) end end end end end
namespace ts { /* @internal */ export const <API key>: CommandLineOption = { name: "compileOnSave", type: "boolean" }; // NOTE: The order here is important to default lib ordering as entries will have the same // order in the generated program (see `<API key>` in program.ts). This // order also affects overload resolution when a type declared in one lib is // augmented in another lib. const libEntries: [string, string][] = [ // JavaScript only ["es5", "lib.es5.d.ts"], ["es6", "lib.es2015.d.ts"], ["es2015", "lib.es2015.d.ts"], ["es7", "lib.es2016.d.ts"], ["es2016", "lib.es2016.d.ts"], ["es2017", "lib.es2017.d.ts"], ["es2018", "lib.es2018.d.ts"], ["esnext", "lib.esnext.d.ts"], // Host only ["dom", "lib.dom.d.ts"], ["dom.iterable", "lib.dom.iterable.d.ts"], ["webworker", "lib.webworker.d.ts"], ["webworker.importscripts", "lib.webworker.importscripts.d.ts"], ["scripthost", "lib.scripthost.d.ts"], // ES2015 Or ESNext By-feature options ["es2015.core", "lib.es2015.core.d.ts"], ["es2015.collection", "lib.es2015.collection.d.ts"], ["es2015.generator", "lib.es2015.generator.d.ts"], ["es2015.iterable", "lib.es2015.iterable.d.ts"], ["es2015.promise", "lib.es2015.promise.d.ts"], ["es2015.proxy", "lib.es2015.proxy.d.ts"], ["es2015.reflect", "lib.es2015.reflect.d.ts"], ["es2015.symbol", "lib.es2015.symbol.d.ts"], ["es2015.symbol.wellknown", "lib.es2015.symbol.wellknown.d.ts"], ["es2016.array.include", "lib.es2016.array.include.d.ts"], ["es2017.object", "lib.es2017.object.d.ts"], ["es2017.sharedmemory", "lib.es2017.sharedmemory.d.ts"], ["es2017.string", "lib.es2017.string.d.ts"], ["es2017.intl", "lib.es2017.intl.d.ts"], ["es2017.typedarrays", "lib.es2017.typedarrays.d.ts"], ["es2018.intl", "lib.es2018.intl.d.ts"], ["es2018.promise", "lib.es2018.promise.d.ts"], ["es2018.regexp", "lib.es2018.regexp.d.ts"], ["esnext.array", "lib.esnext.array.d.ts"], ["esnext.symbol", "lib.esnext.symbol.d.ts"], ["esnext.asynciterable", "lib.esnext.asynciterable.d.ts"], ["esnext.intl", "lib.esnext.intl.d.ts"] ]; /** * An array of supported "lib" reference file names used to determine the order for inclusion * when referenced, as well as for spelling suggestions. This ensures the correct ordering for * overload resolution when a type declared in one lib is extended by another. */ /* @internal */ export const libs = libEntries.map(entry => entry[0]); /** * A map of lib names to lib files. This map is used both for parsing the "lib" command line * option as well as for resolving lib reference directives. */ /* @internal */ export const libMap = <API key>(libEntries); /* @internal */ export const <API key>: CommandLineOption[] = [ { name: "help", shortName: "h", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.Print_this_message, }, { name: "help", shortName: "?", type: "boolean" }, { name: "watch", shortName: "w", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.Watch_input_files, }, { name: "preserveWatchOutput", type: "boolean", <API key>: false, category: Diagnostics.<API key>, description: Diagnostics.Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen, }, { name: "listFiles", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "listEmittedFiles", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "traceResolution", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, ]; /* @internal */ export const optionDeclarations: CommandLineOption[] = [ // CommandLine only options <API key>, { name: "all", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key>, }, { name: "version", shortName: "v", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key>, }, { name: "init", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key>, }, { name: "project", shortName: "p", type: "string", isFilePath: true, <API key>: true, category: Diagnostics.<API key>, paramType: Diagnostics.FILE_OR_DIRECTORY, description: Diagnostics.Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json, }, { name: "build", type: "boolean", shortName: "b", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "pretty", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, // Basic { name: "target", shortName: "t", type: <API key>({ es3: ScriptTarget.ES3, es5: ScriptTarget.ES5, es6: ScriptTarget.ES2015, es2015: ScriptTarget.ES2015, es2016: ScriptTarget.ES2016, es2017: ScriptTarget.ES2017, es2018: ScriptTarget.ES2018, esnext: ScriptTarget.ESNext, }), affectsSourceFile: true, <API key>: true, paramType: Diagnostics.VERSION, <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT, }, { name: "module", shortName: "m", type: <API key>({ none: ModuleKind.None, commonjs: ModuleKind.CommonJS, amd: ModuleKind.AMD, system: ModuleKind.System, umd: ModuleKind.UMD, es6: ModuleKind.ES2015, es2015: ModuleKind.ES2015, esnext: ModuleKind.ESNext }), <API key>: true, paramType: Diagnostics.KIND, <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext, }, { name: "lib", type: "list", element: { name: "lib", type: libMap }, <API key>: true, <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key> }, { name: "allowJs", type: "boolean", <API key>: true, <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key> }, { name: "checkJs", type: "boolean", category: Diagnostics.Basic_Options, description: Diagnostics.<API key> }, { name: "jsx", type: <API key>({ "preserve": JsxEmit.Preserve, "react-native": JsxEmit.ReactNative, "react": JsxEmit.React }), affectsSourceFile: true, paramType: Diagnostics.KIND, <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "declaration", shortName: "d", type: "boolean", <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "declarationMap", type: "boolean", <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "emitDeclarationOnly", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { name: "sourceMap", type: "boolean", <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "outFile", type: "string", isFilePath: true, paramType: Diagnostics.FILE, <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "outDir", type: "string", isFilePath: true, paramType: Diagnostics.DIRECTORY, <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "rootDir", type: "string", isFilePath: true, paramType: Diagnostics.LOCATION, category: Diagnostics.Basic_Options, description: Diagnostics.Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir, }, { name: "composite", type: "boolean", isTSConfigOnly: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "removeComments", type: "boolean", <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.<API key>, }, { name: "noEmit", type: "boolean", <API key>: true, category: Diagnostics.Basic_Options, description: Diagnostics.Do_not_emit_outputs, }, { name: "importHelpers", type: "boolean", category: Diagnostics.Basic_Options, description: Diagnostics.<API key> }, { name: "downlevelIteration", type: "boolean", category: Diagnostics.Basic_Options, description: Diagnostics.Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3 }, { name: "isolatedModules", type: "boolean", category: Diagnostics.Basic_Options, description: Diagnostics.<API key> }, // Strict Type Checks { name: "strict", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "noImplicitAny", type: "boolean", <API key>: true, strictFlag: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "strictNullChecks", type: "boolean", <API key>: true, strictFlag: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "strictFunctionTypes", type: "boolean", <API key>: true, strictFlag: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "<API key>", type: "boolean", <API key>: true, strictFlag: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "noImplicitThis", type: "boolean", <API key>: true, strictFlag: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key>, }, { name: "alwaysStrict", type: "boolean", affectsSourceFile: true, strictFlag: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, // Additional Checks { name: "noUnusedLocals", type: "boolean", <API key>: true, <API key>: true, category: Diagnostics.Additional_Checks, description: Diagnostics.<API key>, }, { name: "noUnusedParameters", type: "boolean", <API key>: true, <API key>: true, category: Diagnostics.Additional_Checks, description: Diagnostics.<API key>, }, { name: "noImplicitReturns", type: "boolean", <API key>: true, <API key>: true, category: Diagnostics.Additional_Checks, description: Diagnostics.<API key> }, { name: "<API key>", type: "boolean", <API key>: true, <API key>: true, <API key>: true, category: Diagnostics.Additional_Checks, description: Diagnostics.<API key> }, // Module Resolution { name: "moduleResolution", type: <API key>({ node: <API key>.NodeJs, classic: <API key>.Classic, }), <API key>: true, paramType: Diagnostics.STRATEGY, category: Diagnostics.<API key>, description: Diagnostics.Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6, }, { name: "baseUrl", type: "string", <API key>: true, isFilePath: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { // this option can only be specified in tsconfig.json // use type = object to copy the value as-is name: "paths", type: "object", <API key>: true, isTSConfigOnly: true, category: Diagnostics.<API key>, description: Diagnostics.A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl }, { // this option can only be specified in tsconfig.json // use type = object to copy the value as-is name: "rootDirs", type: "list", isTSConfigOnly: true, element: { name: "rootDirs", type: "string", isFilePath: true }, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime }, { name: "typeRoots", type: "list", element: { name: "typeRoots", type: "string", isFilePath: true }, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "types", type: "list", element: { name: "types", type: "string" }, <API key>: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "<API key>", type: "boolean", <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking }, { name: "esModuleInterop", type: "boolean", <API key>: true, <API key>: true, category: Diagnostics.<API key>, description: Diagnostics.Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports }, { name: "preserveSymlinks", type: "boolean", category: Diagnostics.<API key>, description: Diagnostics.<API key>, }, // Source Maps { name: "sourceRoot", type: "string", paramType: Diagnostics.LOCATION, category: Diagnostics.Source_Map_Options, description: Diagnostics.Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations, }, { name: "mapRoot", type: "string", paramType: Diagnostics.LOCATION, category: Diagnostics.Source_Map_Options, description: Diagnostics.Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations, }, { name: "inlineSourceMap", type: "boolean", category: Diagnostics.Source_Map_Options, description: Diagnostics.<API key> }, { name: "inlineSources", type: "boolean", category: Diagnostics.Source_Map_Options, description: Diagnostics.Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set }, // Experimental { name: "<API key>", type: "boolean", category: Diagnostics.<API key>, description: Diagnostics.<API key> }, { name: "<API key>", type: "boolean", category: Diagnostics.<API key>, description: Diagnostics.<API key> }, // Advanced { name: "jsxFactory", type: "string", category: Diagnostics.Advanced_Options, description: Diagnostics.Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h }, { name: "diagnostics", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "extendedDiagnostics", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "resolveJsonModule", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "out", type: "string", isFilePath: false, // This is intentionally broken to support compatability with existing tsconfig files // for correct behaviour, please use outFile category: Diagnostics.Advanced_Options, paramType: Diagnostics.FILE, description: Diagnostics.<API key>, }, { name: "reactNamespace", type: "string", category: Diagnostics.Advanced_Options, description: Diagnostics.Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit }, { name: "skipDefaultLibCheck", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files }, { name: "charset", type: "string", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "emitBOM", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "locale", type: "string", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "newLine", type: <API key>({ crlf: NewLineKind.<API key>, lf: NewLineKind.LineFeed }), paramType: Diagnostics.NEWLINE, category: Diagnostics.Advanced_Options, description: Diagnostics.Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix, }, { name: "noErrorTruncation", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "noLib", type: "boolean", <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "noResolve", type: "boolean", <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files }, { name: "stripInternal", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { name: "disableSizeLimit", type: "boolean", affectsSourceFile: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "noImplicitUseStrict", type: "boolean", <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "noEmitHelpers", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "noEmitOnError", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { name: "preserveConstEnums", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "declarationDir", type: "string", isFilePath: true, paramType: Diagnostics.DIRECTORY, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "skipLibCheck", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { name: "allowUnusedLabels", type: "boolean", <API key>: true, <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "<API key>", type: "boolean", <API key>: true, <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "<API key>", type: "boolean", <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { name: "<API key>", type: "boolean", <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { name: "<API key>", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key> }, { name: "<API key>", type: "number", // TODO: GH#27108 <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files }, { name: "<API key>", type: "boolean", <API key>: true, category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { name: "keyofStringsOnly", type: "boolean", category: Diagnostics.Advanced_Options, description: Diagnostics.<API key>, }, { // A list of plugins to load in the language service name: "plugins", type: "list", isTSConfigOnly: true, element: { name: "plugin", type: "object" }, description: Diagnostics.<API key> }, // extra options { name: "<API key>", type: "boolean" }, { // this option can only be specified in tsconfig.json // use type = object to copy the value as-is name: "defines", type: "object", isTSConfigOnly: true }, { name: "emitReflection", type: "boolean" }, { name: "noEmitJs", type: "boolean" }, { name: "reorderFiles", type: "boolean" } ]; /* @internal */ export const <API key>: ReadonlyArray<CommandLineOption> = optionDeclarations.filter(option => !!option.<API key>); /* @internal */ export const <API key>: ReadonlyArray<CommandLineOption> = optionDeclarations.filter(option => !!option.<API key>); /* @internal */ export const <API key>: ReadonlyArray<CommandLineOption> = optionDeclarations.filter(option => !!option.affectsSourceFile || !!option.<API key> || !!option.<API key>); /* @internal */ export const buildOpts: CommandLineOption[] = [ <API key>, { name: "verbose", shortName: "v", category: Diagnostics.<API key>, description: Diagnostics.<API key>, type: "boolean" }, { name: "dry", shortName: "d", category: Diagnostics.<API key>, description: Diagnostics.<API key>, type: "boolean" }, { name: "force", shortName: "f", category: Diagnostics.<API key>, description: Diagnostics.<API key>, type: "boolean" }, { name: "clean", category: Diagnostics.<API key>, description: Diagnostics.<API key>, type: "boolean" } ]; /* @internal */ export const <API key>: CommandLineOption[] = [ { /* @deprecated typingOptions.enableAutoDiscovery * Use typeAcquisition.enable instead. */ name: "enableAutoDiscovery", type: "boolean", }, { name: "enable", type: "boolean", }, { name: "include", type: "list", element: { name: "include", type: "string" } }, { name: "exclude", type: "list", element: { name: "exclude", type: "string" } } ]; /* @internal */ export interface OptionNameMap { optionNameMap: Map<CommandLineOption>; shortOptionNames: Map<string>; } /* @internal */ export const <API key>: CompilerOptions = { module: ModuleKind.CommonJS, target: ScriptTarget.ES5, strict: true, esModuleInterop: true }; let optionNameMapCache: OptionNameMap; /* @internal */ export function <API key>(typeAcquisition: TypeAcquisition): TypeAcquisition { // Convert deprecated typingOptions.enableAutoDiscovery to typeAcquisition.enable if (typeAcquisition && typeAcquisition.enableAutoDiscovery !== undefined && typeAcquisition.enable === undefined) { return { enable: typeAcquisition.enableAutoDiscovery, include: typeAcquisition.include || [], exclude: typeAcquisition.exclude || [] }; } return typeAcquisition; } function getOptionNameMap(): OptionNameMap { return optionNameMapCache || (optionNameMapCache = createOptionNameMap(optionDeclarations)); } /*@internal*/ export function createOptionNameMap(optionDeclarations: ReadonlyArray<CommandLineOption>): OptionNameMap { const optionNameMap = createMap<CommandLineOption>(); const shortOptionNames = createMap<string>(); forEach(optionDeclarations, option => { optionNameMap.set(option.name.toLowerCase(), option); if (option.shortName) { shortOptionNames.set(option.shortName, option.name); } }); return { optionNameMap, shortOptionNames }; } /* @internal */ export function <API key>(opt: <API key>): Diagnostic { return <API key>(opt, <API key>); } function <API key>(opt: <API key>, createDiagnostic: (message: DiagnosticMessage, arg0: string, arg1: string) => Diagnostic): Diagnostic { const namesOfType = arrayFrom(opt.type.keys()).map(key => `'${key}'`).join(", "); return createDiagnostic(Diagnostics.<API key>, `--${opt.name}`, namesOfType); } /* @internal */ export function <API key>(opt: <API key>, value: string, errors: Push<Diagnostic>) { return <API key>(opt, trimString(value || ""), errors); } /* @internal */ export function parseListTypeOption(opt: <API key>, value = "", errors: Push<Diagnostic>): (string | number)[] | undefined { value = trimString(value); if (startsWith(value, "-")) { return undefined; } if (value === "") { return []; } const values = value.split(","); switch (opt.element.type) { case "number": return map(values, parseInt); case "string": return map(values, v => v || ""); default: return mapDefined(values, v => <API key>(<<API key>>opt.element, v, errors)); } } /* @internal */ export interface OptionsBase { [option: string]: <API key> | undefined; } /** Tuple with error messages for 'unknown compiler option', 'option requires type' */ type <API key> = [DiagnosticMessage, DiagnosticMessage]; function <API key>( getOptionNameMap: () => OptionNameMap, [<API key>, <API key>]: <API key>, commandLine: ReadonlyArray<string>, readFile?: (path: string) => string | undefined) { const options = {} as OptionsBase; const fileNames: string[] = []; const errors: Diagnostic[] = []; parseStrings(commandLine); return { options, fileNames, errors }; function parseStrings(args: ReadonlyArray<string>) { let i = 0; while (i < args.length) { const s = args[i]; i++; if (s.charCodeAt(0) === CharacterCodes.at) { parseResponseFile(s.slice(1)); } else if (s.charCodeAt(0) === CharacterCodes.minus) { const opt = <API key>(getOptionNameMap, s.slice(s.charCodeAt(1) === CharacterCodes.minus ? 2 : 1), /*allowShort*/ true); if (opt) { if (opt.isTSConfigOnly) { errors.push(<API key>(Diagnostics.<API key>, opt.name)); } else { // Check to see if no argument was provided (e.g. "--locale" is the last command-line argument). if (!args[i] && opt.type !== "boolean") { errors.push(<API key>(<API key>, opt.name)); } switch (opt.type) { case "number": options[opt.name] = parseInt(args[i]); i++; break; case "boolean": // boolean flag has optional value true, false, others const optValue = args[i]; options[opt.name] = optValue !== "false"; // consume next argument as boolean flag value if (optValue === "false" || optValue === "true") { i++; } break; case "string": options[opt.name] = args[i] || ""; i++; break; case "list": const result = parseListTypeOption(<<API key>>opt, args[i], errors); options[opt.name] = result || []; if (result) { i++; } break; // If not a primitive, the possible types are specified in what is effectively a map of options. default: options[opt.name] = <API key>(<<API key>>opt, args[i], errors); i++; break; } } } else { errors.push(<API key>(<API key>, s)); } } else { fileNames.push(s); } } } function parseResponseFile(fileName: string) { const text = readFile ? readFile(fileName) : sys.readFile(fileName); if (!text) { errors.push(<API key>(Diagnostics.File_0_not_found, fileName)); return; } const args: string[] = []; let pos = 0; while (true) { while (pos < text.length && text.charCodeAt(pos) <= CharacterCodes.space) pos++; if (pos >= text.length) break; const start = pos; if (text.charCodeAt(start) === CharacterCodes.doubleQuote) { pos++; while (pos < text.length && text.charCodeAt(pos) !== CharacterCodes.doubleQuote) pos++; if (pos < text.length) { args.push(text.substring(start + 1, pos)); pos++; } else { errors.push(<API key>(Diagnostics.<API key>, fileName)); } } else { while (text.charCodeAt(pos) > CharacterCodes.space) pos++; args.push(text.substring(start, pos)); } } parseStrings(args); } } export function parseCommandLine(commandLine: ReadonlyArray<string>, readFile?: (path: string) => string | undefined): ParsedCommandLine { return <API key>(getOptionNameMap, [ Diagnostics.<API key>, Diagnostics.<API key> ], commandLine, readFile); } /** @internal */ export function getOptionFromName(optionName: string, allowShort?: boolean): CommandLineOption | undefined { return <API key>(getOptionNameMap, optionName, allowShort); } function <API key>(getOptionNameMap: () => OptionNameMap, optionName: string, allowShort = false): CommandLineOption | undefined { optionName = optionName.toLowerCase(); const { optionNameMap, shortOptionNames } = getOptionNameMap(); // Try to translate short option names to their full equivalents. if (allowShort) { const short = shortOptionNames.get(optionName); if (short !== undefined) { optionName = short; } } return optionNameMap.get(optionName); } /*@internal*/ export interface ParsedBuildCommand { buildOptions: BuildOptions; projects: string[]; errors: ReadonlyArray<Diagnostic>; } /*@internal*/ export function parseBuildCommand(args: string[]): ParsedBuildCommand { let buildOptionNameMap: OptionNameMap | undefined; const <API key> = () => (buildOptionNameMap || (buildOptionNameMap = createOptionNameMap(buildOpts))); const { options, fileNames: projects, errors } = <API key>(<API key>, [ Diagnostics.<API key>, Diagnostics.<API key> ], args); const buildOptions = options as BuildOptions; if (projects.length === 0) { // tsc -b invoked with no extra arguments; act as if invoked with "tsc -b ." projects.push("."); } // Nonsensical combinations if (buildOptions.clean && buildOptions.force) { errors.push(<API key>(Diagnostics.<API key>, "clean", "force")); } if (buildOptions.clean && buildOptions.verbose) { errors.push(<API key>(Diagnostics.<API key>, "clean", "verbose")); } if (buildOptions.clean && buildOptions.watch) { errors.push(<API key>(Diagnostics.<API key>, "clean", "watch")); } if (buildOptions.watch && buildOptions.dry) { errors.push(<API key>(Diagnostics.<API key>, "watch", "dry")); } return { buildOptions, projects, errors }; } function getDiagnosticText(_message: DiagnosticMessage, ..._args: any[]): string { const diagnostic = <API key>.apply(undefined, arguments); return <string>diagnostic.messageText; } /* @internal */ export function printVersion() { sys.write("Version : " + ts.version_plus + sys.newLine); sys.write("typescript-version : " + ts.version + sys.newLine); } /* @internal */ export function printHelp(optionsList: CommandLineOption[], syntaxPrefix = "") { const output: string[] = []; // We want to align our "syntax" and "examples" commands to a certain margin. const syntaxLength = getDiagnosticText(Diagnostics.Syntax_Colon_0, "").length; const examplesLength = getDiagnosticText(Diagnostics.Examples_Colon_0, "").length; let marginLength = Math.max(syntaxLength, examplesLength); // Build up the syntactic skeleton. let syntax = makePadding(marginLength - syntaxLength); syntax += `tsc ${syntaxPrefix}[${getDiagnosticText(Diagnostics.options)}] [${getDiagnosticText(Diagnostics.file)}...]`; output.push(getDiagnosticText(Diagnostics.Syntax_Colon_0, syntax)); output.push(sys.newLine + sys.newLine); // Build up the list of examples. const padding = makePadding(marginLength); output.push(getDiagnosticText(Diagnostics.Examples_Colon_0, makePadding(marginLength - examplesLength) + "tsc hello.ts") + sys.newLine); output.push(padding + "tsc --outFile file.js file.ts" + sys.newLine); output.push(padding + "tsc @args.txt" + sys.newLine); output.push(padding + "tsc --build tsconfig.json" + sys.newLine); output.push(sys.newLine); output.push(getDiagnosticText(Diagnostics.Options_Colon) + sys.newLine); // We want our descriptions to align at the same column in our output, // so we keep track of the longest option usage string. marginLength = 0; const usageColumn: string[] = []; // Things like "-d, --declaration" go in here. const descriptionColumn: string[] = []; const <API key> = createMap<string[]>(); // Map between option.description and list of option.type if it is a kind for (const option of optionsList) { // If an option lacks a description, // it is not officially supported. if (!option.description) { continue; } let usageText = " "; if (option.shortName) { usageText += "-" + option.shortName; usageText += getParamType(option); usageText += ", "; } usageText += "--" + option.name; usageText += getParamType(option); usageColumn.push(usageText); let description: string; if (option.name === "lib") { description = getDiagnosticText(option.description); const element = (<<API key>>option).element; const typeMap = <Map<number | string>>element.type; <API key>.set(description, arrayFrom(typeMap.keys()).map(key => `'${key}'`)); } else { description = getDiagnosticText(option.description); } descriptionColumn.push(description); // Set the new margin for the description column if necessary. marginLength = Math.max(usageText.length, marginLength); } // Special case that can't fit in the loop. const usageText = " @<" + getDiagnosticText(Diagnostics.file) + ">"; usageColumn.push(usageText); descriptionColumn.push(getDiagnosticText(Diagnostics.<API key>)); marginLength = Math.max(usageText.length, marginLength); // Print out each row, aligning all the descriptions on the same column. for (let i = 0; i < usageColumn.length; i++) { const usage = usageColumn[i]; const description = descriptionColumn[i]; const kindsList = <API key>.get(description); output.push(usage + makePadding(marginLength - usage.length + 2) + description + sys.newLine); if (kindsList) { output.push(makePadding(marginLength + 4)); for (const kind of kindsList) { output.push(kind + " "); } output.push(sys.newLine); } } for (const line of output) { sys.write(line); } return; function getParamType(option: CommandLineOption) { if (option.paramType !== undefined) { return " " + getDiagnosticText(option.paramType); } return ""; } function makePadding(paddingLength: number): string { return Array(paddingLength + 1).join(" "); } } export type DiagnosticReporter = (diagnostic: Diagnostic) => void; /** * Reports config file diagnostics */ export interface <API key> { /** * Reports unrecoverable error when parsing config file */ <API key>: DiagnosticReporter; } /** * Interface extending ParseConfigHost to support ParseConfigFile that reads config file and reports errors */ export interface ParseConfigFileHost extends ParseConfigHost, <API key> { getCurrentDirectory(): string; } /** * Reads the config file, reports errors if any and exits if the config file cannot be found */ export function <API key>(configFileName: string, optionsToExtend: CompilerOptions, host: ParseConfigFileHost): ParsedCommandLine | undefined { let configFileText: string | undefined; try { configFileText = host.readFile(configFileName); } catch (e) { const error = <API key>(Diagnostics.<API key>, configFileName, e.message); host.<API key>(error); return undefined; } if (!configFileText) { const error = <API key>(Diagnostics.File_0_not_found, configFileName); host.<API key>(error); return undefined; } const result = parseJsonText(configFileName, configFileText); const cwd = host.getCurrentDirectory(); return <API key>(result, host, <API key>(getDirectoryPath(configFileName), cwd), optionsToExtend, <API key>(configFileName, cwd)); } /** * Read tsconfig.json file * @param fileName The path to the config file */ export function readConfigFile(fileName: string, readFile: (path: string) => string | undefined): { config?: any; error?: Diagnostic } { const textOrDiagnostic = tryReadFile(fileName, readFile); return isString(textOrDiagnostic) ? <API key>(fileName, textOrDiagnostic) : { config: {}, error: textOrDiagnostic }; } /** * Parse the text of the tsconfig.json file * @param fileName The path to the config file * @param jsonText The text of the config file */ export function <API key>(fileName: string, jsonText: string): { config?: any; error?: Diagnostic } { const jsonSourceFile = parseJsonText(fileName, jsonText); return { config: convertToObject(jsonSourceFile, jsonSourceFile.parseDiagnostics), error: jsonSourceFile.parseDiagnostics.length ? jsonSourceFile.parseDiagnostics[0] : undefined }; } /** * Read tsconfig.json file * @param fileName The path to the config file */ export function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile { const textOrDiagnostic = tryReadFile(fileName, readFile); return isString(textOrDiagnostic) ? parseJsonText(fileName, textOrDiagnostic) : <TsConfigSourceFile>{ parseDiagnostics: [textOrDiagnostic] }; } function tryReadFile(fileName: string, readFile: (path: string) => string | undefined): string | Diagnostic { let text: string | undefined; try { text = readFile(fileName); } catch (e) { return <API key>(Diagnostics.<API key>, fileName, e.message); } return text === undefined ? <API key>(Diagnostics.<API key>, fileName) : text; } function <API key>(options: ReadonlyArray<CommandLineOption>) { return arrayToMap(options, option => option.name); } let <API key>: TsConfigOnlyOption; function <API key>() { if (<API key> === undefined) { <API key> = { name: undefined!, // should never be needed since this is root type: "object", elementOptions: <API key>([ { name: "compilerOptions", type: "object", elementOptions: <API key>(optionDeclarations), <API key>: Diagnostics.<API key> }, { name: "typingOptions", type: "object", elementOptions: <API key>(<API key>), <API key>: Diagnostics.<API key> }, { name: "typeAcquisition", type: "object", elementOptions: <API key>(<API key>), <API key>: Diagnostics.<API key> }, { name: "extends", type: "string" }, { name: "references", type: "list", element: { name: "references", type: "object" } }, { name: "files", type: "list", element: { name: "files", type: "string" } }, { name: "include", type: "list", element: { name: "include", type: "string" } }, { name: "exclude", type: "list", element: { name: "exclude", type: "string" } }, <API key> ]) }; } return <API key>; } interface <API key> { /** * Notifies parent option object is being set with the optionKey and a valid optionValue * Currently it notifies only if there is element with type object (parentOption) and * has element's option declarations map associated with it * @param parentOption parent option name in which the option and value are being set * @param option option declaration which is being set with the value * @param value value of the option */ <API key>(parentOption: string, option: CommandLineOption, value: <API key>): void; /** * Notify when valid root key value option is being set * @param key option key * @param keyNode node corresponding to node in the source file * @param value computed value of the key * @param ValueNode node corresponding to value in the source file */ <API key>(key: string, keyNode: PropertyName, value: <API key>, valueNode: Expression): void; /** * Notify when unknown root key value option is being set * @param key option key * @param keyNode node corresponding to node in the source file * @param value computed value of the key * @param ValueNode node corresponding to value in the source file */ <API key>(key: string, keyNode: PropertyName, value: <API key>, valueNode: Expression): void; } /** * Convert the json syntax tree into the json value */ export function convertToObject(sourceFile: JsonSourceFile, errors: Push<Diagnostic>): any { return <API key>(sourceFile, errors, /*returnValue*/ true, /*knownRootOptions*/ undefined, /*<API key>*/ undefined); } /** * Convert the json syntax tree into the json value and report errors * This returns the json value (apart from checking errors) only if returnValue provided is true. * Otherwise it just checks the errors and returns undefined */ /*@internal*/ export function <API key>( sourceFile: JsonSourceFile, errors: Push<Diagnostic>, returnValue: boolean, knownRootOptions: CommandLineOption | undefined, <API key>: <API key> | undefined): any { if (!sourceFile.statements.length) { return returnValue ? {} : undefined; } return <API key>(sourceFile.statements[0].expression, knownRootOptions); function isRootOptionMap(knownOptions: Map<CommandLineOption> | undefined) { return knownRootOptions && (knownRootOptions as TsConfigOnlyOption).elementOptions === knownOptions; } function <API key>( node: <API key>, knownOptions: Map<CommandLineOption> | undefined, <API key>: DiagnosticMessage | undefined, parentOption: string | undefined ): any { const result: any = returnValue ? {} : undefined; for (const element of node.properties) { if (element.kind !== SyntaxKind.PropertyAssignment) { errors.push(<API key>(sourceFile, element, Diagnostics.<API key>)); continue; } if (element.questionToken) { errors.push(<API key>(sourceFile, element.questionToken, Diagnostics.<API key>, "?")); } if (!<API key>(element.name)) { errors.push(<API key>(sourceFile, element.name, Diagnostics.<API key>)); } const textOfKey = <API key>(element.name); const keyText = textOfKey && <API key>(textOfKey); const option = keyText && knownOptions ? knownOptions.get(keyText) : undefined; if (keyText && <API key> && !option) { errors.push(<API key>(sourceFile, element.name, <API key>, keyText)); } const value = <API key>(element.initializer, option); if (typeof keyText !== "undefined") { if (returnValue) { result[keyText] = value; } // Notify key value set, if user asked for it if (<API key> && // Current callbacks are only on known parent option or if we are setting values in the root (parentOption || isRootOptionMap(knownOptions))) { const isValidOptionValue = <API key>(option, value); if (parentOption) { if (isValidOptionValue) { // Notify option set in the parent if its a valid option value <API key>.<API key>(parentOption, option!, value); } } else if (isRootOptionMap(knownOptions)) { if (isValidOptionValue) { // Notify about the valid root key value being set <API key>.<API key>(keyText, element.name, value, element.initializer); } else if (!option) { // Notify about the unknown root key value being set <API key>.<API key>(keyText, element.name, value, element.initializer); } } } } } return result; } function <API key>( elements: NodeArray<Expression>, elementOption: CommandLineOption | undefined ): any[] | void { return (returnValue ? elements.map : elements.forEach).call(elements, (element: Expression) => <API key>(element, elementOption)); } function <API key>(valueExpression: Expression, option: CommandLineOption | undefined): any { switch (valueExpression.kind) { case SyntaxKind.TrueKeyword: <API key>(option && option.type !== "boolean"); return true; case SyntaxKind.FalseKeyword: <API key>(option && option.type !== "boolean"); return false; case SyntaxKind.NullKeyword: <API key>(option && option.name === "extends"); // "extends" is the only option we don't allow null/undefined for return null; // tslint:disable-line:no-null-keyword case SyntaxKind.StringLiteral: if (!<API key>(valueExpression)) { errors.push(<API key>(sourceFile, valueExpression, Diagnostics.<API key>)); } <API key>(option && (isString(option.type) && option.type !== "string")); const text = (<StringLiteral>valueExpression).text; if (option && !isString(option.type)) { const customOption = <<API key>>option; // Validate custom option type if (!customOption.type.has(text.toLowerCase())) { errors.push( <API key>( customOption, (message, arg0, arg1) => <API key>(sourceFile, valueExpression, message, arg0, arg1) ) ); } } return text; case SyntaxKind.NumericLiteral: <API key>(option && option.type !== "number"); return Number((<NumericLiteral>valueExpression).text); case SyntaxKind.<API key>: if ((<<API key>>valueExpression).operator !== SyntaxKind.MinusToken || (<<API key>>valueExpression).operand.kind !== SyntaxKind.NumericLiteral) { break; // not valid JSON syntax } <API key>(option && option.type !== "number"); return -Number((<NumericLiteral>(<<API key>>valueExpression).operand).text); case SyntaxKind.<API key>: <API key>(option && option.type !== "object"); const <API key> = <<API key>>valueExpression; // Currently having element option declaration in the tsconfig with type "object" // determines if it needs <API key> callback or not // At moment there are only "compilerOptions", "typeAcquisition" and "typingOptions" // that satifies it and need it to modify options set in them (for normalizing file paths) // vs what we set in the json // If need arises, we can modify this interface and callbacks as needed if (option) { const { elementOptions, <API key>, name: optionName } = <TsConfigOnlyOption>option; return <API key>(<API key>, elementOptions, <API key>, optionName); } else { return <API key>( <API key>, /* knownOptions*/ undefined, /*<API key> */ undefined, /*parentOption*/ undefined); } case SyntaxKind.<API key>: <API key>(option && option.type !== "list"); return <API key>( (<<API key>>valueExpression).elements, option && (<<API key>>option).element); } // Not in expected format if (option) { <API key>(/*isError*/ true); } else { errors.push(<API key>(sourceFile, valueExpression, Diagnostics.Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal)); } return undefined; function <API key>(isError: boolean | undefined) { if (isError) { errors.push(<API key>(sourceFile, valueExpression, Diagnostics.<API key>, option!.name, <API key>(option!))); } } } function <API key>(node: Node): boolean { return isStringLiteral(node) && <API key>(node, sourceFile); } } function <API key>(option: CommandLineOption) { return option.type === "list" ? "Array" : isString(option.type) ? option.type : "string"; } function <API key>(option: CommandLineOption | undefined, value: any): value is <API key> { if (option) { if (isNullOrUndefined(value)) return true; // All options are undefinable/nullable if (option.type === "list") { return isArray(value); } const expectedType = isString(option.type) ? option.type : "string"; return typeof value === expectedType; } return false; } /** * Generate tsconfig configuration when running command line "--init" * @param options commandlineOptions to be generated into tsconfig.json * @param fileNames array of filenames to be generated into tsconfig.json */ /* @internal */ export function generateTSConfig(options: CompilerOptions, fileNames: ReadonlyArray<string>, newLine: string): string { const compilerOptions = extend(options, <API key>); const compilerOptionsMap = <API key>(compilerOptions); return writeConfigurations(); function <API key>(optionDefinition: CommandLineOption): Map<string | number> | undefined { if (optionDefinition.type === "string" || optionDefinition.type === "number" || optionDefinition.type === "boolean") { // this is of a type <API key> return undefined; } else if (optionDefinition.type === "list") { return <API key>((<<API key>>optionDefinition).element); } else { return (<<API key>>optionDefinition).type; } } function <API key>(value: <API key>, customTypeMap: Map<string | number>): string | undefined { // There is a typeMap associated with this command-line option so use it to map value back to its name return forEachEntry(customTypeMap, (mapValue, key) => { if (mapValue === value) { return key; } }); } function <API key>(options: CompilerOptions): Map<<API key>> { const result = createMap<<API key>>(); const optionsNameMap = getOptionNameMap().optionNameMap; for (const name in options) { if (hasProperty(options, name)) { // tsconfig only options cannot be specified via command line, // so we can assume that only types that can appear here string | number | boolean if (optionsNameMap.has(name) && optionsNameMap.get(name)!.category === Diagnostics.<API key>) { continue; } const value = <<API key>>options[name]; const optionDefinition = optionsNameMap.get(name.toLowerCase()); if (optionDefinition) { const customTypeMap = <API key>(optionDefinition); if (!customTypeMap) { // There is no map associated with this compiler option then use the value as-is // This is the case if the value is expect to be string, number, boolean or list of string result.set(name, value); } else { if (optionDefinition.type === "list") { result.set(name, (value as ReadonlyArray<string | number>).map(element => <API key>(element, customTypeMap)!)); // TODO: GH#18217 } else { // There is a typeMap associated with this command-line option so use it to map value back to its name result.set(name, <API key>(value, customTypeMap)); } } } } } return result; } function <API key>(option: CommandLineOption) { switch (option.type) { case "number": return 1; case "boolean": return true; case "string": return option.isFilePath ? "./" : ""; case "list": return []; case "object": return {}; default: return (option as <API key>).type.keys().next().value; } } function makePadding(paddingLength: number): string { return Array(paddingLength + 1).join(" "); } function isAllowedOption({ category, name }: CommandLineOption): boolean { // Skip options which do not have a category or have category `<API key>` // Exclude all possible `Advanced_Options` in tsconfig.json which were NOT defined in command line return category !== undefined && category !== Diagnostics.<API key> && (category !== Diagnostics.Advanced_Options || compilerOptionsMap.has(name)); } function writeConfigurations() { // Filter applicable options to place in the file const categorizedOptions = createMultiMap<CommandLineOption>(); for (const option of optionDeclarations) { const { category } = option; if (isAllowedOption(option)) { categorizedOptions.add(<API key>(category!), option); } } // Serialize all options and their descriptions let marginLength = 0; let seenKnownKeys = 0; const nameColumn: string[] = []; const descriptionColumn: string[] = []; categorizedOptions.forEach((options, category) => { if (nameColumn.length !== 0) { nameColumn.push(""); descriptionColumn.push(""); } nameColumn.push(`/* ${category} */`); descriptionColumn.push(""); for (const option of options) { let optionName; if (compilerOptionsMap.has(option.name)) { optionName = `"${option.name}": ${JSON.stringify(compilerOptionsMap.get(option.name))}${(seenKnownKeys += 1) === compilerOptionsMap.size ? "" : ","}`; } else { optionName = `// "${option.name}": ${JSON.stringify(<API key>(option))},`; } nameColumn.push(optionName); descriptionColumn.push(`/* ${option.description && <API key>(option.description) || option.name} */`); marginLength = Math.max(optionName.length, marginLength); } }); // Write the output const tab = makePadding(2); const result: string[] = []; result.push(`{`); result.push(`${tab}"compilerOptions": {`); // Print out each row, aligning all the descriptions on the same column. for (let i = 0; i < nameColumn.length; i++) { const optionName = nameColumn[i]; const description = descriptionColumn[i]; result.push(optionName && `${tab}${tab}${optionName}${description && (makePadding(marginLength - optionName.length + 2) + description)}`); } if (fileNames.length) { result.push(`${tab}},`); result.push(`${tab}"files": [`); for (let i = 0; i < fileNames.length; i++) { result.push(`${tab}${tab}${JSON.stringify(fileNames[i])}${i === fileNames.length - 1 ? "" : ","}`); } result.push(`${tab}]`); } else { result.push(`${tab}}`); } result.push(`}`); return result.join(newLine); } } /** * Parse the contents of a config file (tsconfig.json). * @param json The contents of the config file to parse * @param host Instance of ParseConfigHost used to enumerate files in folder. * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ export function <API key>(json: any, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine { return <API key>(json, /*sourceFile*/ undefined, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions); } /** * Parse the contents of a config file (tsconfig.json). * @param jsonNode The contents of the config file to parse * @param host Instance of ParseConfigHost used to enumerate files in folder. * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir */ export function <API key>(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray<FileExtensionInfo>): ParsedCommandLine { return <API key>(/*json*/ undefined, sourceFile, host, basePath, existingOptions, configFileName, resolutionStack, extraFileExtensions); } /*@internal*/ export function <API key>(options: CompilerOptions, configFile: TsConfigSourceFile | undefined) { if (configFile) { Object.defineProperty(options, "configFile", { enumerable: false, writable: false, value: configFile }); } } function isNullOrUndefined(x: any): x is null | undefined { // tslint:disable-next-line:no-null-keyword return x === undefined || x === null; } function <API key>(fileName: string, basePath: string) { // Use the `<API key>` function to avoid canonicalizing the path, as it must remain noncanonical // until consistient casing errors are reported return getDirectoryPath(<API key>(fileName, basePath)); } /** * Parse the contents of a config file from json or json source file (tsconfig.json). * @param json The contents of the config file to parse * @param sourceFile sourceFile corresponding to the Json * @param host Instance of ParseConfigHost used to enumerate files in folder. * @param basePath A root directory to resolve relative path entries in the config * file to. e.g. outDir * @param resolutionStack Only present for <API key>. Should be empty. */ function <API key>( json: any, sourceFile: TsConfigSourceFile | undefined, host: ParseConfigHost, basePath: string, existingOptions: CompilerOptions = {}, configFileName?: string, resolutionStack: Path[] = [], extraFileExtensions: ReadonlyArray<FileExtensionInfo> = [], ): ParsedCommandLine { Debug.assert((json === undefined && sourceFile !== undefined) || (json !== undefined && sourceFile === undefined)); const errors: Diagnostic[] = []; const parsedConfig = parseConfig(json, sourceFile, host, basePath, configFileName, resolutionStack, errors); const { raw } = parsedConfig; const options = extend(existingOptions, parsedConfig.options || {}); options.configFilePath = configFileName && normalizeSlashes(configFileName); <API key>(options, sourceFile); let projectReferences: ProjectReference[] | undefined; const { fileNames, wildcardDirectories, spec } = getFileNames(); return { options, fileNames, projectReferences, typeAcquisition: parsedConfig.typeAcquisition || <API key>(), raw, errors, wildcardDirectories, compileOnSave: !!raw.compileOnSave, configFileSpecs: spec }; function getFileNames(): ExpandResult { let filesSpecs: ReadonlyArray<string> | undefined; if (hasProperty(raw, "files") && !isNullOrUndefined(raw.files)) { if (isArray(raw.files)) { filesSpecs = <ReadonlyArray<string>>raw.files; const hasReferences = hasProperty(raw, "references") && !isNullOrUndefined(raw.references); const <API key> = !hasReferences || raw.references.length === 0; if (filesSpecs.length === 0 && <API key>) { if (sourceFile) { const fileName = configFileName || "tsconfig.json"; const diagnosticMessage = Diagnostics.<API key>; const nodeValue = firstDefined(<API key>(sourceFile, "files"), property => property.initializer); const error = nodeValue ? <API key>(sourceFile, nodeValue, diagnosticMessage, fileName) : <API key>(diagnosticMessage, fileName); errors.push(error); } else { <API key>(Diagnostics.<API key>, configFileName || "tsconfig.json"); } } } else { <API key>(Diagnostics.<API key>, "files", "Array"); } } let includeSpecs: ReadonlyArray<string> | undefined; if (hasProperty(raw, "include") && !isNullOrUndefined(raw.include)) { if (isArray(raw.include)) { includeSpecs = <ReadonlyArray<string>>raw.include; } else { <API key>(Diagnostics.<API key>, "include", "Array"); } } let excludeSpecs: ReadonlyArray<string> | undefined; if (hasProperty(raw, "exclude") && !isNullOrUndefined(raw.exclude)) { if (isArray(raw.exclude)) { excludeSpecs = <ReadonlyArray<string>>raw.exclude; } else { <API key>(Diagnostics.<API key>, "exclude", "Array"); } } else if (raw.compilerOptions) { const outDir = raw.compilerOptions.outDir; const declarationDir = raw.compilerOptions.declarationDir; if (outDir || declarationDir) { excludeSpecs = [outDir, declarationDir].filter(d => !!d); } } if (filesSpecs === undefined && includeSpecs === undefined) { includeSpecs = ["**/*"]; } const result = matchFileNames(filesSpecs, includeSpecs, excludeSpecs, configFileName ? <API key>(configFileName, basePath) : basePath, options, host, errors, extraFileExtensions, sourceFile); if (result.fileNames.length === 0 && !hasProperty(raw, "files") && resolutionStack.length === 0 && !hasProperty(raw, "references")) { errors.push(<API key>(result.spec, configFileName)); } if (hasProperty(raw, "references") && !isNullOrUndefined(raw.references)) { if (isArray(raw.references)) { for (const ref of raw.references) { if (typeof ref.path !== "string") { <API key>(Diagnostics.<API key>, "reference.path", "string"); } else { (projectReferences || (projectReferences = [])).push({ path: <API key>(ref.path, basePath), originalPath: ref.path, prepend: ref.prepend, circular: ref.circular }); } } } else { <API key>(Diagnostics.<API key>, "references", "Array"); } } return result; } function <API key>(message: DiagnosticMessage, arg0?: string, arg1?: string) { if (!sourceFile) { errors.push(<API key>(message, arg0, arg1)); } } } /*@internal*/ export function isErrorNoInputFiles(error: Diagnostic) { return error.code === Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code; } /*@internal*/ export function <API key>({ includeSpecs, excludeSpecs }: ConfigFileSpecs, configFileName: string | undefined) { return <API key>( Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2, configFileName || "tsconfig.json", JSON.stringify(includeSpecs || []), JSON.stringify(excludeSpecs || [])); } interface ParsedTsconfig { raw: any; options?: CompilerOptions; typeAcquisition?: TypeAcquisition; /** * Note that the case of the config path has not yet been normalized, as no files have been imported into the project yet */ extendedConfigPath?: string; } function <API key>(value: ParsedTsconfig) { return !!value.options; } /** * This *just* extracts options/include/exclude/files out of a config file. * It does *not* resolve the included files. */ function parseConfig( json: any, sourceFile: TsConfigSourceFile | undefined, host: ParseConfigHost, basePath: string, configFileName: string | undefined, resolutionStack: string[], errors: Push<Diagnostic>, ): ParsedTsconfig { basePath = normalizeSlashes(basePath); const resolvedPath = <API key>(configFileName || "", basePath); if (resolutionStack.indexOf(resolvedPath) >= 0) { errors.push(<API key>(Diagnostics.<API key>, [...resolutionStack, resolvedPath].join(" -> "))); return { raw: json || convertToObject(sourceFile!, errors) }; } const ownConfig = json ? <API key>(json, host, basePath, configFileName, errors) : <API key>(sourceFile!, host, basePath, configFileName, errors); if (ownConfig.extendedConfigPath) { // copy the resolution stack so it is never reused between branches in potential diamond-problem scenarios. resolutionStack = resolutionStack.concat([resolvedPath]); const extendedConfig = getExtendedConfig(sourceFile, ownConfig.extendedConfigPath, host, basePath, resolutionStack, errors); if (extendedConfig && <API key>(extendedConfig)) { const baseRaw = extendedConfig.raw; const raw = ownConfig.raw; const <API key> = (propertyName: string) => { const value = raw[propertyName] || baseRaw[propertyName]; if (value) { raw[propertyName] = value; } }; <API key>("include"); <API key>("exclude"); <API key>("files"); if (raw.compileOnSave === undefined) { raw.compileOnSave = baseRaw.compileOnSave; } ownConfig.options = assign({}, extendedConfig.options, ownConfig.options); // TODO extend type typeAcquisition } } return ownConfig; } function <API key>( json: any, host: ParseConfigHost, basePath: string, configFileName: string | undefined, errors: Push<Diagnostic> ): ParsedTsconfig { if (hasProperty(json, "excludes")) { errors.push(<API key>(Diagnostics.<API key>)); } const options = <API key>(json.compilerOptions, basePath, errors, configFileName); // typingOptions has been deprecated and is only supported for backward compatibility purposes. // It should be removed in future releases - use typeAcquisition instead. const typeAcquisition = <API key>(json.typeAcquisition || json.typingOptions, basePath, errors, configFileName); json.compileOnSave = <API key>(json, basePath, errors); let extendedConfigPath: string | undefined; if (json.extends) { if (!isString(json.extends)) { errors.push(<API key>(Diagnostics.<API key>, "extends", "string")); } else { const newBase = configFileName ? <API key>(configFileName, basePath) : basePath; extendedConfigPath = <API key>(json.extends, host, newBase, errors, <API key>); } } return { raw: json, options, typeAcquisition, extendedConfigPath }; } function <API key>( sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, configFileName: string | undefined, errors: Push<Diagnostic> ): ParsedTsconfig { const options = <API key>(configFileName); let typeAcquisition: TypeAcquisition | undefined, <API key>: TypeAcquisition | undefined; let extendedConfigPath: string | undefined; const optionsIterator: <API key> = { <API key>(parentOption: string, option: CommandLineOption, value: <API key>) { Debug.assert(parentOption === "compilerOptions" || parentOption === "typeAcquisition" || parentOption === "typingOptions"); const currentOption = parentOption === "compilerOptions" ? options : parentOption === "typeAcquisition" ? (typeAcquisition || (typeAcquisition = <API key>(configFileName))) : (<API key> || (<API key> = <API key>(configFileName))); currentOption[option.name] = <API key>(option, basePath, value); }, <API key>(key: string, _keyNode: PropertyName, value: <API key>, valueNode: Expression) { switch (key) { case "extends": const newBase = configFileName ? <API key>(configFileName, basePath) : basePath; extendedConfigPath = <API key>( <string>value, host, newBase, errors, (message, arg0) => <API key>(sourceFile, valueNode, message, arg0) ); return; } }, <API key>(key: string, keyNode: PropertyName, _value: <API key>, _valueNode: Expression) { if (key === "excludes") { errors.push(<API key>(sourceFile, keyNode, Diagnostics.<API key>)); } } }; const json = <API key>(sourceFile, errors, /*returnValue*/ true, <API key>(), optionsIterator); if (!typeAcquisition) { if (<API key>) { typeAcquisition = (<API key>.enableAutoDiscovery !== undefined) ? { enable: <API key>.enableAutoDiscovery, include: <API key>.include, exclude: <API key>.exclude } : <API key>; } else { typeAcquisition = <API key>(configFileName); } } return { raw: json, options, typeAcquisition, extendedConfigPath }; } function <API key>( extendedConfig: string, host: ParseConfigHost, basePath: string, errors: Push<Diagnostic>, createDiagnostic: (message: DiagnosticMessage, arg1?: string) => Diagnostic) { extendedConfig = normalizeSlashes(extendedConfig); // If the path isn't a rooted or relative path, don't try to resolve it (we reserve the right to special case module-id like paths in the future) if (!(isRootedDiskPath(extendedConfig) || startsWith(extendedConfig, "./") || startsWith(extendedConfig, "../"))) { errors.push(createDiagnostic(Diagnostics.<API key>, extendedConfig)); return undefined; } let extendedConfigPath = <API key>(extendedConfig, basePath); if (!host.fileExists(extendedConfigPath) && !endsWith(extendedConfigPath, Extension.Json)) { extendedConfigPath = `${extendedConfigPath}.json`; if (!host.fileExists(extendedConfigPath)) { errors.push(createDiagnostic(Diagnostics.<API key>, extendedConfig)); return undefined; } } return extendedConfigPath; } function getExtendedConfig( sourceFile: TsConfigSourceFile | undefined, extendedConfigPath: string, host: ParseConfigHost, basePath: string, resolutionStack: string[], errors: Push<Diagnostic>, ): ParsedTsconfig | undefined { const extendedResult = readJsonConfigFile(extendedConfigPath, path => host.readFile(path)); if (sourceFile) { sourceFile.extendedSourceFiles = [extendedResult.fileName]; } if (extendedResult.parseDiagnostics.length) { errors.push(...extendedResult.parseDiagnostics); return undefined; } const extendedDirname = getDirectoryPath(extendedConfigPath); const extendedConfig = parseConfig(/*json*/ undefined, extendedResult, host, extendedDirname, getBaseFileName(extendedConfigPath), resolutionStack, errors); if (sourceFile && extendedResult.extendedSourceFiles) { sourceFile.extendedSourceFiles!.push(...extendedResult.extendedSourceFiles); } if (<API key>(extendedConfig)) { // Update the paths to reflect base path const relativeDifference = <API key>(extendedDirname, basePath, identity); const updatePath = (path: string) => isRootedDiskPath(path) ? path : combinePaths(relativeDifference, path); const <API key> = (propertyName: string) => { if (raw[propertyName]) { raw[propertyName] = map(raw[propertyName], updatePath); } }; const { raw } = extendedConfig; <API key>("include"); <API key>("exclude"); <API key>("files"); } return extendedConfig; } function <API key>(jsonOption: any, basePath: string, errors: Push<Diagnostic>): boolean { if (!hasProperty(jsonOption, <API key>.name)) { return false; } const result = convertJsonOption(<API key>, jsonOption.compileOnSave, basePath, errors); return typeof result === "boolean" && result; } export function <API key>(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions, errors: Diagnostic[] } { const errors: Diagnostic[] = []; const options = <API key>(jsonOptions, basePath, errors, configFileName); return { options, errors }; } export function <API key>(jsonOptions: any, basePath: string, configFileName?: string): { options: TypeAcquisition, errors: Diagnostic[] } { const errors: Diagnostic[] = []; const options = <API key>(jsonOptions, basePath, errors, configFileName); return { options, errors }; } function <API key>(configFileName?: string) { const options: CompilerOptions = configFileName && getBaseFileName(configFileName) === "jsconfig.json" ? { allowJs: true, <API key>: 2, <API key>: true, skipLibCheck: true, noEmit: true } : {}; return options; } function <API key>(jsonOptions: any, basePath: string, errors: Push<Diagnostic>, configFileName?: string): CompilerOptions { const options = <API key>(configFileName); <API key>(optionDeclarations, jsonOptions, basePath, options, Diagnostics.<API key>, errors); if (configFileName) { options.configFilePath = normalizeSlashes(configFileName); } return options; } function <API key>(configFileName?: string): TypeAcquisition { return { enable: !!configFileName && getBaseFileName(configFileName) === "jsconfig.json", include: [], exclude: [] }; } function <API key>(jsonOptions: any, basePath: string, errors: Push<Diagnostic>, configFileName?: string): TypeAcquisition { const options = <API key>(configFileName); const typeAcquisition = <API key>(jsonOptions); <API key>(<API key>, typeAcquisition, basePath, options, Diagnostics.<API key>, errors); return options; } function <API key>(optionDeclarations: ReadonlyArray<CommandLineOption>, jsonOptions: any, basePath: string, defaultOptions: CompilerOptions | TypeAcquisition, diagnosticMessage: DiagnosticMessage, errors: Push<Diagnostic>) { if (!jsonOptions) { return; } const optionNameMap = <API key>(optionDeclarations); for (const id in jsonOptions) { const opt = optionNameMap.get(id); if (opt) { defaultOptions[opt.name] = convertJsonOption(opt, jsonOptions[id], basePath, errors); } else { errors.push(<API key>(diagnosticMessage, id)); } } } function convertJsonOption(opt: CommandLineOption, value: any, basePath: string, errors: Push<Diagnostic>): <API key> { if (<API key>(opt, value)) { const optType = opt.type; if (optType === "list" && isArray(value)) { return <API key>(<<API key>>opt, value, basePath, errors); } else if (!isString(optType)) { return <API key>(<<API key>>opt, <string>value, errors); } return <API key>(opt, basePath, value); } else { errors.push(<API key>(Diagnostics.<API key>, opt.name, <API key>(opt))); } } function <API key>(option: CommandLineOption, basePath: string, value: any): <API key> { if (isNullOrUndefined(value)) return undefined; if (option.type === "list") { const listOption = <<API key>>option; if (listOption.element.isFilePath || !isString(listOption.element.type)) { return <<API key>>filter(map(value, v => <API key>(listOption.element, basePath, v)), v => !!v); } return value; } else if (!isString(option.type)) { return option.type.get(isString(value) ? value.toLowerCase() : value); } return <API key>(option, basePath, value); } function <API key>(option: CommandLineOption, basePath: string, value: any): <API key> { if (option.isFilePath) { value = normalizePath(combinePaths(basePath, value)); if (value === "") { value = "."; } } return value; } function <API key>(opt: <API key>, value: string, errors: Push<Diagnostic>) { if (isNullOrUndefined(value)) return undefined; const key = value.toLowerCase(); const val = opt.type.get(key); if (val !== undefined) { return val; } else { errors.push(<API key>(opt)); } } function <API key>(option: <API key>, values: ReadonlyArray<any>, basePath: string, errors: Push<Diagnostic>): any[] { return filter(map(values, v => convertJsonOption(option.element, v, basePath, errors)), v => !!v); } function trimString(s: string) { return typeof s.trim === "function" ? s.trim() : s.replace(/^[\s]+|[\s]+$/g, ""); } /** * Tests for a path that ends in a recursive directory wildcard. * Matches **, \**, **\, and \**\, but not a**b. * * NOTE: used \ in place of / above to avoid issues with multiline comments. * * Breakdown: * (^|\/) # matches either the beginning of the string or a directory separator. * \*\* # matches the recursive directory wildcard "**". * \/?$ # matches an optional trailing directory separator at the end of the string. */ const <API key> = /(^|\/)\*\*\/?$/; /** * Tests for a path where .. appears after a recursive directory wildcard. * Matches **\..\*, **\a\..\*, and **\.., but not ..\**\* * * NOTE: used \ in place of / above to avoid issues with multiline comments. * * Breakdown: * (^|\/) # matches either the beginning of the string or a directory separator. * \*\*\/ # matches a recursive directory wildcard "**" followed by a directory separator. * (.*\/)? # optionally matches any number of characters followed by a directory separator. * \.\. # matches a parent directory path component ".." * ($|\/) # matches either the end of the string or a directory separator. */ const <API key> = /(^|\/)\*\*\/(.*\/)?\.\.($|\/)/; /** * Tests for a path containing a wildcard character in a directory component of the path. * Matches \*\, \?\, and \a*b\, but not \a\ or \a\*. * * NOTE: used \ in place of / above to avoid issues with multiline comments. * * Breakdown: * \/ # matches a directory separator. * [^/]*? # matches any number of characters excluding directory separators (non-greedy). * [*?] # matches either a wildcard character (* or ?) * [^/]* # matches any number of characters excluding directory separators (greedy). * \/ # matches a directory separator. */ const <API key> = /\/[^/]*?[*?][^/]*\ /** * Matches the portion of a wildcard path that does not contain wildcards. * Matches \a of \a\*, or \a\b\c of \a\b\c\?\d. * * NOTE: used \ in place of / above to avoid issues with multiline comments. * * Breakdown: * ^ # matches the beginning of the string * [^*?]* # matches any number of non-wildcard characters * (?=\/[^/]*[*?]) # lookahead that matches a directory separator followed by * # a path component that contains at least one wildcard character (* or ?). */ const <API key> = /^[^*?]*(?=\/[^/]*[*?])/; /** * Expands an array of file specifications. * * @param filesSpecs The literal file names to include. * @param includeSpecs The wildcard file specifications to include. * @param excludeSpecs The wildcard file specifications to exclude. * @param basePath The base path for any relative file specifications. * @param options Compiler options. * @param host The host used to resolve files and directories. * @param errors An array for diagnostic reporting. */ function matchFileNames( filesSpecs: ReadonlyArray<string> | undefined, includeSpecs: ReadonlyArray<string> | undefined, excludeSpecs: ReadonlyArray<string> | undefined, basePath: string, options: CompilerOptions, host: ParseConfigHost, errors: Push<Diagnostic>, extraFileExtensions: ReadonlyArray<FileExtensionInfo>, jsonSourceFile: TsConfigSourceFile | undefined ): ExpandResult { basePath = normalizePath(basePath); let <API key>: ReadonlyArray<string> | undefined, <API key>: ReadonlyArray<string> | undefined; // The exclude spec list is converted into a regular expression, which allows us to quickly // test whether a file or directory should be excluded before recursively traversing the // file system. if (includeSpecs) { <API key> = validateSpecs(includeSpecs, errors, /*<API key>*/ false, jsonSourceFile, "include"); } if (excludeSpecs) { <API key> = validateSpecs(excludeSpecs, errors, /*<API key>*/ true, jsonSourceFile, "exclude"); } // Wildcard directories (provided as part of a wildcard path) are stored in a // file map that marks whether it was a regular wildcard match (with a `*` or `?` token), // or a recursive directory. This information is used by filesystem watchers to monitor for // new entries in these paths. const wildcardDirectories = <API key>(<API key>, <API key>, basePath, host.<API key>); const spec: ConfigFileSpecs = { filesSpecs, includeSpecs, excludeSpecs, <API key>, <API key>, wildcardDirectories }; return <API key>(spec, basePath, options, host, extraFileExtensions); } /** * Gets the file names from the provided config file specs that contain, files, include, exclude and * other properties needed to resolve the file names * @param spec The config file specs extracted with file names to include, wildcards to include/exclude and other details * @param basePath The base path for any relative file specifications. * @param options Compiler options. * @param host The host used to resolve files and directories. * @param extraFileExtensions optionaly file extra file extension information from host */ /* @internal */ export function <API key>(spec: ConfigFileSpecs, basePath: string, options: CompilerOptions, host: ParseConfigHost, extraFileExtensions: ReadonlyArray<FileExtensionInfo> = []): ExpandResult { basePath = normalizePath(basePath); const keyMapper = host.<API key> ? identity : toLowerCase; // Literal file names (provided via the "files" array in tsconfig.json) are stored in a // file map with a possibly case insensitive key. We use this map later when when including // wildcard paths. const literalFileMap = createMap<string>(); // Wildcard paths (provided via the "includes" array in tsconfig.json) are stored in a // file map with a possibly case insensitive key. We use this map to store paths matched // via wildcard, and to handle extension priority. const wildcardFileMap = createMap<string>(); const { filesSpecs, <API key>, <API key>, wildcardDirectories } = spec; // Rather than requery this for each file and filespec, we query the supported extensions // once and store it on the expansion context. const supportedExtensions = <API key>(options, extraFileExtensions); // Literal files are always included verbatim. An "include" or "exclude" specification cannot // remove a literal file. if (filesSpecs) { for (const fileName of filesSpecs) { const file = <API key>(fileName, basePath); literalFileMap.set(keyMapper(file), file); } } if (<API key> && <API key>.length > 0) { for (const file of host.readDirectory(basePath, supportedExtensions, <API key>, <API key>, /*depth*/ undefined)) { // If we have already included a literal or wildcard path with a // higher priority extension, we should skip this file. // This handles cases where we may encounter both <file>.ts and // <file>.d.ts (or <file>.js if "allowJs" is enabled) in the same // directory when they are compilation outputs. if (<API key>(file, literalFileMap, wildcardFileMap, supportedExtensions, keyMapper)) { continue; } // We may have included a wildcard path with a lower priority // extension due to the user-defined order of entries in the // "include" array. If there is a lower priority extension in the // same directory, we should remove it. <API key>(file, wildcardFileMap, supportedExtensions, keyMapper); const key = keyMapper(file); if (!literalFileMap.has(key) && !wildcardFileMap.has(key)) { wildcardFileMap.set(key, file); } } } const literalFiles = arrayFrom(literalFileMap.values()); const wildcardFiles = arrayFrom(wildcardFileMap.values()); return { fileNames: literalFiles.concat(wildcardFiles), wildcardDirectories, spec }; } function validateSpecs(specs: ReadonlyArray<string>, errors: Push<Diagnostic>, <API key>: boolean, jsonSourceFile: TsConfigSourceFile | undefined, specKey: string): ReadonlyArray<string> { return specs.filter(spec => { const diag = specToDiagnostic(spec, <API key>); if (diag !== undefined) { errors.push(createDiagnostic(diag, spec)); } return diag === undefined; }); function createDiagnostic(message: DiagnosticMessage, spec: string): Diagnostic { const element = <API key>(jsonSourceFile, specKey, spec); return element ? <API key>(jsonSourceFile!, element, message, spec) : <API key>(message, spec); } } function specToDiagnostic(spec: string, <API key>: boolean): DiagnosticMessage | undefined { if (!<API key> && <API key>.test(spec)) { return Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } else if (<API key>.test(spec)) { return Diagnostics.File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0; } } /** * Gets directories in a set of include patterns that should be watched for changes. */ function <API key>(include: ReadonlyArray<string> | undefined, exclude: ReadonlyArray<string> | undefined, path: string, <API key>: boolean): MapLike<WatchDirectoryFlags> { // We watch a directory recursively if it contains a wildcard anywhere in a directory segment // of the pattern: // /a/bd - Watch /a/b recursively to catch changes to any d in any subfolder recursively // /a/b/*/d - Watch /a/b recursively to catch any d in any immediate subfolder, even if a new subfolder is added // /a/b - Watch /a/b recursively to catch changes to anything in any recursive subfoler // We watch a directory without recursion if it contains a wildcard in the file segment of // the pattern: /** * Determines whether a literal or wildcard file has already been included that has a higher * extension priority. * * @param file The path to the file. * @param extensionPriority The priority of the extension. * @param context The expansion context. */ function <API key>(file: string, literalFiles: Map<string>, wildcardFiles: Map<string>, extensions: ReadonlyArray<string>, keyMapper: (value: string) => string) { const extensionPriority = <API key>(file, extensions); const <API key> = <API key>(extensionPriority, extensions); for (let i = ExtensionPriority.Highest; i < <API key>; i++) { const <API key> = extensions[i]; const higherPriorityPath = keyMapper(changeExtension(file, <API key>)); if (literalFiles.has(higherPriorityPath) || wildcardFiles.has(higherPriorityPath)) { return true; } } return false; } /** * Removes files included via wildcard expansion with a lower extension priority that have * already been included. * * @param file The path to the file. * @param extensionPriority The priority of the extension. * @param context The expansion context. */ function <API key>(file: string, wildcardFiles: Map<string>, extensions: ReadonlyArray<string>, keyMapper: (value: string) => string) { const extensionPriority = <API key>(file, extensions); const <API key> = <API key>(extensionPriority, extensions); for (let i = <API key>; i < extensions.length; i++) { const <API key> = extensions[i]; const lowerPriorityPath = keyMapper(changeExtension(file, <API key>)); wildcardFiles.delete(lowerPriorityPath); } } /** * Produces a cleaned version of compiler options with personally identifiying info (aka, paths) removed. * Also converts enum values back to strings. */ /* @internal */ export function <API key>(opts: CompilerOptions): CompilerOptions { const out: CompilerOptions = {}; for (const key in opts) { if (opts.hasOwnProperty(key)) { const type = getOptionFromName(key); if (type !== undefined) { // Ignore unknown options out[key] = <API key>(opts[key], type); } } } return out; } function <API key>(value: any, option: CommandLineOption): {} { switch (option.type) { case "object": // "paths". Can't get any useful information from the value since we blank out strings, so just return "". return ""; case "string": // Could be any arbitrary string -- use empty string instead. return ""; case "number": // Allow numbers, but be sure to check it's actually a number. return typeof value === "number" ? value : ""; case "boolean": return typeof value === "boolean" ? value : ""; case "list": const elementType = (option as <API key>).element; return isArray(value) ? value.map(v => <API key>(v, elementType)) : ""; default: return forEachEntry(option.type, (optionEnumValue, optionStringValue) => { if (optionEnumValue === value) { return optionStringValue; } })!; // TODO: GH#18217 } } }
#ifndef __USB_LPC18XX_H #define __USB_LPC18XX_H #include <stdint.h> #ifndef USB_ENDPT_MSK #define USB_ENDPT_MSK (0x3FU) #endif // USB Device Command Register #define USB_USBCMD_D_RS (1U ) #define USB_USBCMD_D_RST (1U << 1U) #define USB_USBCMD_D_SUTW (1U << 13U) #define USB_USBCMD_D_ATDTW (1U << 14U) #define <API key> ( 16U) #define <API key> (0xFFU << <API key>) #define USB_USBCMD_D_ITC(n) (((n) << <API key>) & <API key>) // USB Host Command Register #define USB_USBCMD_H_RS (1U ) #define USB_USBCMD_H_RST (1U << 1U) #define USB_USBCMD_H_FS0 (1U << 2U) #define USB_USBCMD_H_FS1 (1U << 3U) #define USB_USBCMD_H_PSE (1U << 4U) #define USB_USBCMD_H_ASE (1U << 5U) #define USB_USBCMD_H_IAA (1U << 6U) #define <API key> ( 8U) #define <API key> (3U << <API key>) #define USB_USBCMD_H_ASPE (1U << 11U) #define USB_USBCMD_H_FS2 (1U << 15U) #define <API key> ( 16U) #define <API key> (0xFFU << <API key>) #define USB_USBCMD_H_ITC(n) (((n) << <API key>) & <API key>) // USB Device Status Register #define USB_USBDSTS_D_UI (1U ) #define USB_USBDSTS_D_UEI (1U << 1U) #define USB_USBDSTS_D_PCI (1U << 2U) #define USB_USBDSTS_D_URI (1U << 6U) #define USB_USBDSTS_D_SRI (1U << 7U) #define USB_USBDSTS_D_SLI (1U << 8U) #define USB_USBDSTS_D_NAKI (1U << 16U) // USB Host Status Register #define USB_USBDSTS_H_UI (1U ) #define USB_USBDSTS_H_UEI (1U << 1U) #define USB_USBDSTS_H_PCI (1U << 2U) #define USB_USBDSTS_H_FRI (1U << 3U) #define USB_USBDSTS_H_AAI (1U << 5U) #define USB_USBDSTS_H_SRI (1U << 7U) #define USB_USBDSTS_H_HCH (1U << 12U) #define USB_USBDSTS_H_RCL (1U << 13U) #define USB_USBDSTS_H_PS (1U << 14U) #define USB_USBDSTS_H_AS (1U << 15U) #define USB_USBDSTS_H_UAI (1U << 18U) #define USB_USBDSTS_H_UPI (1U << 19U) // USB Device Interrupt Register #define USB_USBINTR_D_UE (1U ) #define USB_USBINTR_D_UEE (1U << 1U) #define USB_USBINTR_D_PCE (1U << 2U) #define USB_USBINTR_D_URE (1U << 6U) #define USB_USBINTR_D_SRE (1U << 7U) #define USB_USBINTR_D_SLE (1U << 8U) #define USB_USBINTR_D_NAKE (1U << 16U) // USB Host Interrupt Register #define USB_USBINTR_H_UE (1U ) #define USB_USBINTR_H_UEE (1U << 1U) #define USB_USBINTR_H_PCE (1U << 2U) #define USB_USBINTR_H_FRE (1U << 3U) #define USB_USBINTR_H_AAE (1U << 5U) #define USB_USBINTR_H_SRE (1U << 7U) #define USB_USBINTR_H_UAIE (1U << 18U) #define USB_USBINTR_H_UPIA (1U << 19U) // USB Device Frame Index Register #define <API key> ( 0U) #define <API key> (7U ) #define <API key> ( 3U) #define <API key> (0x7FFU << <API key>) // USB Host Frame Index Register #define <API key> ( 0U) #define <API key> (7U ) #define <API key> ( 3U) #define <API key> (0x3FFU << <API key>) // USB Device Address Register #define <API key> (1U << 24U) #define <API key> ( 25U) #define <API key> (0x7FUL << <API key>) // USB Endpoint List Address Register #define <API key> ( 11U) #define <API key> (0x1FFFFFUL << <API key>) // USB Burst Size Register #define <API key> ( 0U) #define <API key> (0xFFU ) #define <API key> ( 8U) #define <API key> (0xFFU << <API key>) // USB ULPI Viewport register (USB1 only) #define <API key> ( 0U) #define <API key> (0xFFU ) #define <API key> ( 8U) #define <API key> (0xFFU << <API key>) #define <API key> ( 16U) #define <API key> (0xFFU << <API key>) #define <API key> ( 24U) #define <API key> (7U << <API key>) #define <API key> (1U << 27U) #define <API key> (1U << 29U) #define <API key> (1U << 30U) #define <API key> (1UL << 31U) // USB BInterval Register #define <API key> ( 0U) #define <API key> (0x0FU << <API key>) // USB Endpoint NAK Register #define <API key> ( 0U) #define <API key> (USB_ENDPT_MSK) #define <API key> ( 16U) #define <API key> (USB_ENDPT_MSK << <API key>) // USB Endpoint NAK Enable Register #define <API key> ( 0U) #define <API key> (USB_ENDPT_MSK) #define <API key> ( 16U) #define <API key> (USB_ENDPT_MSK << <API key>) // USB Device Port Status and Control Register #define USB_PORTSC1_D_CCS (1U ) #define USB_PORTSC1_D_PE (1U << 2U) #define USB_PORTSC1_D_PEC (1U << 3U) #define USB_PORTSC1_D_FPR (1U << 6U) #define USB_PORTSC1_D_SUSP (1U << 7U) #define USB_PORTSC1_D_PR (1U << 8U) #define USB_PORTSC1_D_HSP (1U << 9U) #define <API key> ( 14U) #define <API key> (3U << <API key>) #define <API key>(n) (((n) << <API key>) & <API key>) #define <API key> ( 16U) #define <API key> (0x0FU << <API key>) #define USB_PORTSC1_D_PHCD (1U << 23U) #define USB_PORTSC1_D_PFSC (1U << 24U) #define <API key> ( 26U) #define <API key> (3U << <API key>) #define <API key> ( 30U) #define <API key> (3UL << <API key>) #define USB_PORTSC1_D_PTS(n) (((n) << <API key>) & <API key>) // USB Host Port Status and Control Register #define USB_PORTSC1_H_CCS (1U ) #define USB_PORTSC1_H_CSC (1U << 1U) #define USB_PORTSC1_H_PE (1U << 2U) #define USB_PORTSC1_H_PEC (1U << 3U) #define USB_PORTSC1_H_OCA (1U << 4U) #define USB_PORTSC1_H_OCC (1U << 5U) #define USB_PORTSC1_H_FPR (1U << 6U) #define USB_PORTSC1_H_SUSP (1U << 7U) #define USB_PORTSC1_H_PR (1U << 8U) #define USB_PORTSC1_H_HSP (1U << 9U) #define <API key> ( 10U) #define <API key> (3U << <API key>) #define USB_PORTSC1_H_PP (1U << 12U) #define <API key> ( 14U) #define <API key> (3U << <API key>) #define <API key>(n) (((n) << <API key>) & <API key>) #define <API key> ( 16U) #define <API key> (0x0FU << <API key>) #define USB_PORTSC1_H_WKCN (1U << 20U) #define USB_PORTSC1_H_WKDC (1U << 21U) #define USB_PORTSC1_H_WKOC (1U << 22U) #define USB_PORTSC1_H_PHCD (1U << 23U) #define USB_PORTSC1_H_PFSC (1U << 24U) #define <API key> ( 26U) #define <API key> (3U << <API key>) #define <API key> ( 30U) #define <API key> (3UL << <API key>) #define USB_PORTSC1_H_PTS(n) (((n) << <API key>) & <API key>) // OTG Status and Control Register (USB0 only) #define USB_OTGSC_VD (1U ) #define USB_OTGSC_VC (1U << 1U) #define USB_OTGSC_HAAR (1U << 2U) #define USB_OTGSC_OT (1U << 3U) #define USB_OTGSC_DP (1U << 4U) #define USB_OTGSC_IDPU (1U << 5U) #define USB_OTGSC_HADP (1U << 6U) #define USB_OTGSC_HABA (1U << 7U) #define USB_OTGSC_ID (1U << 8U) #define USB_OTGSC_AVV (1U << 9U) #define USB_OTGSC_ASV (1U << 10U) #define USB_OTGSC_BSV (1U << 11U) #define USB_OTGSC_BSE (1U << 12U) #define USB_OTGSC_MS1T (1U << 13U) #define USB_OTGSC_DPS (1U << 14U) #define USB_OTGSC_IDIS (1U << 16U) #define USB_OTGSC_AVVIS (1U << 17U) #define USB_OTGSC_ASVIS (1U << 18U) #define USB_OTGSC_BSVIS (1U << 19U) #define USB_OTGSC_BSEIS (1U << 20U) #define USB_OTGSC_MS1S (1U << 21U) #define USB_OTGSC_DPIS (1U << 22U) #define USB_OTGSC_IDIE (1U << 24U) #define USB_OTGSC_AVVIE (1U << 25U) #define USB_OTGSC_ASVIE (1U << 26U) #define USB_OTGSC_BSVIE (1U << 27U) #define USB_OTGSC_BSEIE (1U << 28U) #define USB_OTGSC_MS1E (1U << 29U) #define USB_OTGSC_DPIE (1U << 30U) // USB Device Mode Register #define <API key> ( 0U) #define <API key> (3U ) #define USB_USBMODE_D_CM1_0(n) ((n) & <API key>) #define USB_USBMODE_D_ES (1U << 2U) #define USB_USBMODE_D_SLOM (1U << 3U) #define USB_USBMODE_D_SDIS (1U << 4U) // USB Device Mode Register #define <API key> ( 0U) #define <API key> (3U ) #define USB_USBMODE_H_CM1_0(n) ((n) & <API key>) #define USB_USBMODE_H_ES (1U << 2U) #define USB_USBMODE_H_SDIS (1U << 4U) #define USB_USBMODE_H_VBPS (1U << 5U) // USB Endpoint Setup Status Register #define <API key> ( 0U) #define <API key> (USB_ENDPT_MSK << <API key>) // USB Endpoint Prime Register #define <API key> ( 0U) #define <API key> (USB_ENDPT_MSK) #define <API key> ( 16U) #define <API key> (USB_ENDPT_MSK << <API key>) // USB Endpoint Flush Register #define <API key> ( 0U) #define <API key> (USB_ENDPT_MSK) #define <API key> ( 16U) #define <API key> (USB_ENDPT_MSK << <API key>) // USB Endpoint Status Register #define <API key> ( 0U) #define <API key> (USB_ENDPT_MSK) #define <API key> ( 16U) #define <API key> (USB_ENDPT_MSK << <API key>) // USB Endpoint Complete Register #define <API key> ( 0U) #define <API key> (USB_ENDPT_MSK) #define <API key> ( 16U) #define <API key> (USB_ENDPT_MSK << <API key>) // USB Endpoint Control Register #define USB_ENDPTCTRL_RXS (1U ) #define <API key> ( 2U) #define <API key> (3U << <API key>) #define USB_ENDPTCTRL_RXT(n) (((n) << <API key>) & <API key>) #define USB_ENDPTCTRL_RXI (1U << 5U) #define USB_ENDPTCTRL_RXR (1U << 6U) #define USB_ENDPTCTRL_RXE (1U << 7U) #define USB_ENDPTCTRL_TXS (1U << 16U) #define <API key> ( 18U) #define <API key> (3U << <API key>) #define USB_ENDPTCTRL_TXT(n) (((n) << <API key>) & <API key>) #define USB_ENDPTCTRL_TXI (1U << 21U) #define USB_ENDPTCTRL_TXR (1U << 22U) #define USB_ENDPTCTRL_TXE (1U << 23U) // Endpoint Queue Head Capabilities and Characteristics #define USB_EPQH_CAP_IOS (1U << 15U) #define <API key> ( 16U) #define <API key> (0x7FFU << <API key>) #define <API key>(n) (((n) << <API key>) & <API key>) #define USB_EPQH_CAP_ZLT (1U << 29U) #define <API key> ( 30U) #define <API key> (3UL << <API key>) // Transfer Descriptor Token #define <API key> ( 0U) #define <API key> (0xFFU ) #define <API key>(n) (n & <API key>) #define USB_bTD_<API key> (0x08U & <API key>) #define USB_bTD_<API key> (0x20U & <API key>) #define <API key> (0x40U & <API key>) #define <API key> (0x80U & <API key>) #define <API key> ( 10U) #define <API key> (3U << <API key>) #define USB_bTD_TOKEN_MULTO(n) (((n) << <API key>) & <API key>) #define USB_bTD_TOKEN_IOC (1U << 15U) #define USB_bTD_<API key> ( 16U) #define USB_bTD_<API key> (0x7FFFU<< USB_bTD_<API key>) #define <API key>(n) (((n) << USB_bTD_<API key>) & USB_bTD_<API key>) // USB Driver State Flags // Device State Flags #define <API key> (1U ) #define USBD_DRIVER_POWERED (1U << 1U) // Host State Flags #define <API key> (1U << 4U) #define USBH_DRIVER_POWERED (1U << 5U) #endif /* __USB_LPC18XX_H */
package com.prt2121.githubsdk.client; import android.content.Context; import android.content.SharedPreferences; import com.securepreferences.SecurePreferences; import javax.inject.Inject; import javax.inject.Singleton; @Singleton public class CredentialStorage { private static final String USER_NAME = CredentialStorage.class.getSimpleName() + ".USER_NAME"; private static final String USER_<API key>.class.getSimpleName() + ".USER_TOKEN"; private static final String USER_SCOPES = CredentialStorage.class.getSimpleName() + ".USER_SCOPES"; private static final String USER_SCOPES_NO_ASK = CredentialStorage.class.getSimpleName() + ".USER_SCOPES_NO_ASK"; private SharedPreferences.Editor editor; private SharedPreferences preferences; @Inject public CredentialStorage(Context context) { preferences = new SecurePreferences(context); } public void storeToken(String accessToken) { editor = preferences.edit(); editor.putString(USER_TOKEN, accessToken); editor.commit(); } public String token() { return preferences.getString(USER_TOKEN, null); } public void storeScopes(String scopes) { editor.putString(USER_SCOPES, scopes); editor.commit(); } public String scopes() { return preferences.getString(USER_SCOPES, null); } public void saveScopeNoAsk(boolean scopesNoAsk) { editor.putBoolean(USER_SCOPES_NO_ASK, scopesNoAsk); editor.commit(); } public Boolean scopeNoAsk() { return preferences.getBoolean(USER_SCOPES_NO_ASK, false); } public void clear() { editor.clear(); editor.commit(); } public void storeUsername(String name) { editor.putString(USER_NAME, name); editor.apply(); } public String getUserName() { return preferences.getString(USER_NAME, null); } }
## How to convert images to PDF from uploaded files for image to PDF API in VB.NET with ByteScout Cloud API Server How to convert images to PDF from uploaded files in VB.NET with easy ByteScout code samples to make image to PDF API. Step-by-step tutorial Writing of the code to convert images to PDF from uploaded files in VB.NET can be done by developers of any level using ByteScout Cloud API Server. ByteScout Cloud API Server was designed to assist image to PDF API in VB.NET. ByteScout Cloud API Server is the ready to use Web API Server that can be deployed in less than 30 minutes into your own in-house server or into private cloud server. Can store data on in-house local server based storage or in Amazon AWS S3 bucket. Processing data solely on the server using buil-in ByteScout powered engine, no cloud services are used to process your data!. VB.NET code snippet like this for ByteScout Cloud API Server works best when you need to quickly implement image to PDF API in your VB.NET application. Follow the tutorial and copy - paste code for VB.NET into your project's code editor. Want to see how it works with your data then code testing will allow the function to be tested and work properly. Trial version of ByteScout is available for free download from our website. This and other source code samples for VB.NET and other programming languages are available. ## REQUEST FREE TECH SUPPORT [Click here to get in touch](https://bytescout.zendesk.com/hc/en-us/requests/new?subject=ByteScout%20Cloud%20API%20Server%20Question) or just send email to [support@bytescout.com](mailto:support@bytescout.com?subject=ByteScout%20Cloud%20API%20Server%20Question) ## ON-PREMISE OFFLINE SDK [Get Your 60 Day Free Trial](https://bytescout.com/download/web-installer?utm_source=github-readme) [Explore SDK Docs](https://bytescout.com/documentation/index.html?utm_source=github-readme) [Sign Up For Online Training](https://academy.bytescout.com/) ## ON-DEMAND REST WEB API [Get your API key](https://pdf.co/documentation/api?utm_source=github-readme) [Explore Web API Documentation](https://pdf.co/documentation/api?utm_source=github-readme) [Explore Web API Samples](https://github.com/bytescout/<API key>/tree/master/PDF.co%20Web%20API) ## VIDEO REVIEW [https: <!-- code block begin --> Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.10 <API key> = 10.0.40219.1 Project("{<API key>}") = "<API key>", "<API key>.vbproj", "{<API key>}" EndProject Global GlobalSection(<API key>) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(<API key>) = postSolution {<API key>}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {<API key>}.Debug|Any CPU.Build.0 = Debug|Any CPU {<API key>}.Release|Any CPU.ActiveCfg = Release|Any CPU {<API key>}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(<API key>) = postSolution SolutionGuid = {<API key>} EndGlobalSection EndGlobal <!-- code block end --> <!-- code block begin --> <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(<API key>)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(<API key>)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{<API key>}</ProjectGuid> <OutputType>Exe</OutputType> <StartupObject><API key>.Module1</StartupObject> <RootNamespace><API key></RootNamespace> <AssemblyName><API key></AssemblyName> <FileAlignment>512</FileAlignment> <MyType>Console</MyType> <<API key>>v4.0</<API key>> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugSymbols>true</DebugSymbols> <DebugType>full</DebugType> <DefineDebug>true</DefineDebug> <DefineTrace>true</DefineTrace> <OutputPath>bin\Debug\</OutputPath> <DocumentationFile><API key>.xml</DocumentationFile> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PlatformTarget>AnyCPU</PlatformTarget> <DebugType>pdbonly</DebugType> <DefineDebug>false</DefineDebug> <DefineTrace>true</DefineTrace> <Optimize>true</Optimize> <OutputPath>bin\Release\</OutputPath> <DocumentationFile><API key>.xml</DocumentationFile> <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn> </PropertyGroup> <PropertyGroup> <OptionExplicit>On</OptionExplicit> </PropertyGroup> <PropertyGroup> <OptionCompare>Binary</OptionCompare> </PropertyGroup> <PropertyGroup> <OptionStrict>Off</OptionStrict> </PropertyGroup> <PropertyGroup> <OptionInfer>On</OptionInfer> </PropertyGroup> <ItemGroup> <Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKey<API key>, <API key>=MSIL"> <HintPath>packages\Newtonsoft.Json.10.0.3\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Deployment" /> <Reference Include="System.Xml" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> </ItemGroup> <ItemGroup> <Import Include="Microsoft.VisualBasic" /> <Import Include="System" /> <Import Include="System.Collections" /> <Import Include="System.Collections.Generic" /> <Import Include="System.Data" /> <Import Include="System.Diagnostics" /> <Import Include="System.Linq" /> <Import Include="System.Xml.Linq" /> </ItemGroup> <ItemGroup> <Compile Include="Module1.vb" /> <Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\Application.Designer.vb"> <AutoGen>True</AutoGen> <DependentUpon>Application.myapp</DependentUpon> </Compile> <Compile Include="My Project\Resources.Designer.vb"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> <Compile Include="My Project\Settings.Designer.vb"> <AutoGen>True</AutoGen> <DependentUpon>Settings.settings</DependentUpon> <<API key>>True</<API key>> </Compile> </ItemGroup> <ItemGroup> <EmbeddedResource Include="My Project\Resources.resx"> <Generator><API key></Generator> <LastGenOutput>Resources.Designer.vb</LastGenOutput> <CustomToolNamespace>My.Resources</CustomToolNamespace> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> <ItemGroup> <None Include="My Project\Application.myapp"> <Generator><API key></Generator> <LastGenOutput>Application.Designer.vb</LastGenOutput> </None> <None Include="My Project\Settings.settings"> <Generator><API key></Generator> <CustomToolNamespace>My</CustomToolNamespace> <LastGenOutput>Settings.Designer.vb</LastGenOutput> </None> <None Include="packages.config" /> </ItemGroup> <ItemGroup> <Content Include="image1.png"> <<API key>>Always</<API key>> </Content> <Content Include="image2.jpg"> <<API key>>Always</<API key>> </Content> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> </Project> <!-- code block end --> <!-- code block begin --> Imports System.IO Imports System.Net Imports Newtonsoft.Json.Linq ' Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost". ' If it's not then please replace this with with your hosting url. Module Module1 ' Source image files Dim ImageFiles() As String = New String() {".\image1.png", ".\image2.jpg"} ' Destination PDF file name Const DestinationFile As String = ".\result.pdf" Sub Main() ' Create standard .NET web client instance Dim webClient As WebClient = New WebClient() ' 1. UPLOAD FILES TO CLOUD Dim uploadedFiles As List(Of String) = New List(Of String)() Try For Each imageFile As String In ImageFiles ' 1a. RETRIEVE THE PRESIGNED URL TO UPLOAD THE FILE. ' Prepare URL for `Get Presigned URL` API call Dim query As String = Uri.EscapeUriString(String.Format( "https://localhost/file/upload/get-presigned-url?contenttype=application/octet-stream&name={0}", Path.GetFileName(imageFile))) ' Execute request Dim response As String = webClient.DownloadString(query) ' Parse JSON response Dim json As JObject = JObject.Parse(response) If json("error").ToObject(Of Boolean) = False Then ' Get URL to use for the file upload Dim uploadUrl As String = json("presignedUrl").ToString() ' Get URL of uploaded file to use with later API calls Dim uploadedFileUrl As String = json("url").ToString() ' 1b. UPLOAD THE FILE TO CLOUD. webClient.Headers.Add("content-type", "application/octet-stream") webClient.UploadFile(uploadUrl, "PUT", imageFile) ' You can use UploadData() instead if your file is byte[] or Stream uploadedFiles.Add(uploadedFileUrl) Else Console.WriteLine(json("message").ToString()) End If Next If uploadedFiles.Count > 0 Then ' 2. CREATE PDF DOCUMENT FROM UPLOADED IMAGE FILES ' Prepare URL for `Image To PDF` API call Dim query As String = Uri.EscapeUriString(String.Format( "https://localhost/pdf/convert/from/image?name={0}&url={1}", Path.GetFileName(DestinationFile), String.Join(",", uploadedFiles))) ' Execute request Dim response As String = webClient.DownloadString(query) ' Parse JSON response Dim json As JObject = JObject.Parse(response) If json("error").ToObject(Of Boolean) = False Then ' Get URL of generated PDF file Dim resultFileUrl As String = json("url").ToString() ' Download PDF file webClient.DownloadFile(resultFileUrl, DestinationFile) Console.WriteLine("Generated PDF file saved as ""{0}"" file.", DestinationFile) Else Console.WriteLine(json("message").ToString()) End If End If Catch ex As WebException Console.WriteLine(ex.ToString()) End Try webClient.Dispose() Console.WriteLine() Console.WriteLine("Press any key...") Console.ReadKey() End Sub End Module <!-- code block end --> <!-- code block begin --> <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Newtonsoft.Json" version="10.0.3" targetFramework="net40" /> </packages> <!-- code block end -->
namespace Gallio.UI.ControlPanel.Preferences { partial class PreferencePane { <summary> Required designer variable. </summary> private System.ComponentModel.IContainer components = null; <summary> Clean up any resources being used. </summary> <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code <summary> Required method for Designer support - do not modify the contents of this method with the code editor. </summary> private void InitializeComponent() { this.SuspendLayout(); // PreferencePane this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.MinimumSize = new System.Drawing.Size(300, 320); this.Name = "PreferencePane"; this.Size = new System.Drawing.Size(300, 320); this.ResumeLayout(false); } #endregion } }
package com.alibaba.common.lang; import com.alibaba.common.lang.exception.<API key>; /** * <code>ObjectUtil.clone</code> * <p/> * <p> * <code>java.lang.<API key></code> * <code>RuntimeException</code> * </p> * * @author Michael Zhou * @version $Id: <API key>.java 1291 2005-03-04 03:23:30Z * baobao $ */ public class <API key> extends <API key> { private static final long serialVersionUID = <API key>; public <API key>() { super(); } /** * , . * * @param message */ public <API key>(String message) { super(message); } /** * , . * * @param cause */ public <API key>(Throwable cause) { super(cause); } /** * , . * * @param message * @param cause */ public <API key>(String message, Throwable cause) { super(message, cause); } }
// ReSharper disable <API key> // ReSharper disable <API key> // ReSharper disable InconsistentNaming // ReSharper disable <API key> // ReSharper disable <API key> // ReSharper disable <API key> // ReSharper disable UnusedMember.Global #pragma warning disable 1591 // Ignore "Missing XML Comment" warning using System; using System.CodeDom.Compiler; using System.Collections.Generic; using Microsoft.Extensions.Configuration; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Diagnostics; namespace Geco.Tests.Database.Model { [GeneratedCode("Geco", "1.0.5.0")] public partial class <API key> { // Key Properties public int BusinessEntityID { get; set; } public short DepartmentID { get; set; } public byte ShiftID { get; set; } public DateTime StartDate { get; set; } // Scalar Properties public DateTime? EndDate { get; set; } public DateTime ModifiedDate { get; set; } // Foreign keys public Employee Employee { get; set; } public Department Department { get; set; } public Shift Shift { get; set; } } }
<?php namespace VagueSoftware\Refuel2Bundle\Form\Fuel; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\<API key>; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Routing\Router; use VagueSoftware\Refuel2Bundle\DTO\Fuel\FuelDto; use VagueSoftware\Refuel2Bundle\DTOManager\Fuel\FuelDtoManager; /** * Class FuelType * @package VagueSoftware\Refuel2Bundle\Form\Fuel */ class FuelType extends AbstractType { /** * @var FuelDtoManager */ private $fuelDtoManager; /** * @var Router */ private $router; /** * FuelType constructor. * @param FuelDtoManager $fuelDtoManager */ public function __construct(FuelDtoManager $fuelDtoManager, Router $router) { $this->fuelDtoManager = $fuelDtoManager; $this->router = $router; } /** * @param <API key> $builder * @param array $options */ public function buildForm(<API key> $builder, array $options) { $builder ->setAction($this->router->generate('<API key>')) ->add('fuelDealer', FuelDealerType::class) ->add('name', TextType::class) ->add('fuelType', ChoiceType::class, [ 'choices' => $this->fuelDtoManager-><API key>(), 'choice_label' => 'name', 'choice_value' => 'id', '<API key>' => true, ]); } /** * @param OptionsResolver $resolver */ public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array( 'data_class' => FuelDto::class, )); } }
//! "Weighted" graph types use std; use std::ops::{Deref,DerefMut}; use smallvec::SmallVec; use super::interface::{self, Id}; // Edge Weighted edge type. #[derive(Debug)] pub struct Edge<T, I: Id> { source: I, target: I, data: T } impl<T, I: Id> Clone for Edge<T, I> where T: Clone { fn clone(&self) -> Self { Edge{source: self.source, target: self.target, data: self.data.clone()} } } impl<T, I: Id> interface::Edge for Edge<T, I> { type NodeId = I; #[inline] fn endpoints(&self) -> (Self::NodeId, Self::NodeId) { (self.source, self.target) } } impl<T, I: Id> interface::DirectedEdge for Edge<T, I> { #[inline] fn source(&self) -> I { self.source } #[inline] fn target(&self) -> I { self.target } } impl<T, I: Id> interface::DirectedEdgeMut for Edge<T, I> { fn rev(&mut self) { ::std::mem::swap(&mut self.source, &mut self.target); } } impl<T, I: Id> Edge<T, I> { Create an edge with the given source & target node indices and weight data. pub fn new(source: I, target: I, data: T) -> Self { Edge{source: source, target: target, data: data} } Retrieve a reference to the edge's data (weight) pub fn data(&self) -> &T { &self.data } } impl<T, I: Id> Deref for Edge<T, I> { type Target = T; fn deref(&self) -> &Self::Target { &self.data } } impl<T, I: Id> DerefMut for Edge<T, I> { fn deref_mut(&mut self) -> &mut <Self as Deref>::Target { &mut self.data } } impl<T, I: Id, I2: Copy> From<(I2, I2)> for Edge<T, I> where T: Default, I: From<I2> { fn from(u: (I2, I2)) -> Self { Self::new(I::from(u.0), I::from(u.1), Default::default()) } } impl<T, I: Id, I2: Copy> From<(I2, I2, T)> for Edge<T, I> where I: From<I2> { fn from(u: (I2, I2, T)) -> Self { Self::new(I::from(u.0), I::from(u.1), u.2) } } impl<'a, T, I: Id, I2: Copy> From<&'a (I2, I2)> for Edge<T, I> where T: Default, I: From<I2> { fn from(u: &'a (I2, I2)) -> Self { Self::new(I::from(u.0), I::from(u.1), Default::default()) } } impl<'a, T, I: Id, I2: Copy> From<&'a (I2, I2, T)> for Edge<T, I> where T: Clone, I: From<I2> { fn from(u: &'a (I2, I2, T)) -> Self { Self::new(I::from(u.0), I::from(u.1), u.2.clone()) } } // Node Weighted node implementation. A reference to the node's weight data can be obtained using the type's `Deref` implementation. ```rust use cripes_core::util::graph::{EdgeId,WeightedNode}; # fn main() { let n = WeightedNode::<_, EdgeId<u8>>::new(32); assert_eq!(32, *n); ``` #[derive(Debug)] pub struct Node<T, I: Id> { incoming_edges: SmallVec<[I; 8]>, outgoing_edges: SmallVec<[I; 8]>, data: T } impl<T, I: Id> Node<T, I> { Instantiate a node with the given data. pub fn new(data: T) -> Self { Node{incoming_edges: SmallVec::new(), outgoing_edges: SmallVec::new(), data: data} } Retrieve a reference to the nodes's data (weight) pub fn data(&self) -> &T { &self.data } } impl<T, I: Id> Clone for Node<T, I> where T: Clone { fn clone(&self) -> Self { Node{incoming_edges: self.incoming_edges.clone(), outgoing_edges: self.outgoing_edges.clone(), data: self.data.clone()} } } impl<T, I: Id> Deref for Node<T, I> { type Target = T; #[inline] fn deref(&self) -> &Self::Target { &self.data } } impl<T, I: Id> DerefMut for Node<T, I> { #[inline] fn deref_mut(&mut self) -> &mut <Self as Deref>::Target { &mut self.data } } impl<T, I: Id> From<T> for Node<T, I> { #[inline] fn from(data: T) -> Self { Self::new(data) } } impl<T, I: Id> interface::Node for Node<T, I> { type EdgeId = I; fn edges(&self) -> std::iter::Chain<std::slice::Iter<Self::EdgeId>,std::slice::Iter<Self::EdgeId>> { self.incoming_edges.iter().chain(self.outgoing_edges.iter()) } } impl<T, I: Id> interface::DirectedNode for Node<T, I> { impl_basic_node!(I); } impl<T, I: Id> interface::DirectedNodeMut for Node<T, I> { impl_basic_node_mut!(I); }
# AUTOGENERATED FILE FROM balenalib/i386-debian:sid-build # remove several traces of debian python RUN apt-get purge -y python.* # > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK. ENV LANG C.UTF-8 # key 63C7CC90: public key "Simon McVittie <smcv@pseudorandom.co.uk>" imported # key 3372DCFA: public key "Donald Stufft (dstufft) <donald@stufft.io>" imported RUN gpg --batch --keyserver keyring.debian.org --recv-keys 4DE8FF2A63C7CC90 \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-key 6E3CBCE93372DCFA \ && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 0x52a43a1e4b77b059 ENV PYTHON_VERSION 3.5.10 # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'" ENV PYTHON_PIP_VERSION 21.0.1 ENV SETUPTOOLS_VERSION 56.0.0 RUN set -x \ && curl -SLO "http://resin-packages.s3.amazonaws.com/python/v$PYTHON_VERSION/Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" \ && echo "<SHA256-like> Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" | sha256sum -c - \ && tar -xzf "Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" --strip-components=1 \ && rm -rf "Python-$PYTHON_VERSION.linux-i386-openssl1.1.tar.gz" \ && ldconfig \ && if [ ! -e /usr/local/bin/pip3 ]; then : \ && curl -SLO "https://raw.githubusercontent.com/pypa/get-pip/<SHA1-like>/get-pip.py" \ && echo "<SHA256-like> get-pip.py" | sha256sum -c - \ && python3 get-pip.py \ && rm get-pip.py \ ; fi \ && pip3 install --no-cache-dir --upgrade --force-reinstall pip=="$PYTHON_PIP_VERSION" setuptools=="$SETUPTOOLS_VERSION" \ && find /usr/local \ \( -type d -a -name test -o -name tests \) \ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \ -exec rm -rf '{}' + \ && cd / \ && rm -rf /usr/src/python ~/.cache # install "virtualenv", since the vast majority of users of this image will want it RUN pip3 install --no-cache-dir virtualenv ENV PYTHON_DBUS_VERSION 1.2.8 # install dbus-python dependencies RUN apt-get update && apt-get install -y --<API key> \ libdbus-1-dev \ libdbus-glib-1-dev \
package com.camnter.hook.ams.f.service.plugin.host; import android.content.ComponentName; import android.content.Intent; import android.os.Bundle; import android.view.View; /** * @author CaMnter */ public class <API key> extends <API key> implements View.OnClickListener { View startFirstText; View startSecondText; View stopFirstText; View stopSecondText; /** * Fill in layout id * * @return layout id */ @Override protected int getLayoutId() { return R.layout.activity_main; } /** * Initialize the view in the layout * * @param savedInstanceState savedInstanceState */ @Override protected void initViews(Bundle savedInstanceState) { this.startFirstText = this.findViewById(R.id.start_first_text); this.startSecondText = this.findViewById(R.id.start_second_text); this.stopFirstText = this.findViewById(R.id.stop_first_text); this.stopSecondText = this.findViewById(R.id.stop_second_text); } /** * Initialize the View of the listener */ @Override protected void initListeners() { this.startFirstText.setOnClickListener(this); this.startSecondText.setOnClickListener(this); this.stopFirstText.setOnClickListener(this); this.stopSecondText.setOnClickListener(this); } /** * Initialize the Activity data */ @Override protected void initData() { } /** * Called when a view has been clicked. * * @param v The view that was clicked. */ @Override public void onClick(View v) { switch (v.getId()) { case R.id.start_first_text: this.startFirstText.setEnabled(false); this.startService(new Intent().setComponent( new ComponentName("com.camnter.hook.ams.f.service.plugin.plugin", "com.camnter.hook.ams.f.service.plugin.plugin.FirstService"))); this.startFirstText.setEnabled(true); break; case R.id.start_second_text: startSecondText.setEnabled(false); this.startService(new Intent().setComponent( new ComponentName("com.camnter.hook.ams.f.service.plugin.plugin", "com.camnter.hook.ams.f.service.plugin.plugin.SecondService"))); startSecondText.setEnabled(true); break; case R.id.stop_first_text: stopFirstText.setEnabled(false); this.stopService(new Intent().setComponent( new ComponentName("com.camnter.hook.ams.f.service.plugin.plugin", "com.camnter.hook.ams.f.service.plugin.plugin.FirstService"))); stopFirstText.setEnabled(true); break; case R.id.stop_second_text: stopSecondText.setEnabled(false); this.stopService(new Intent().setComponent( new ComponentName("com.camnter.hook.ams.f.service.plugin.plugin", "com.camnter.hook.ams.f.service.plugin.plugin.SecondService"))); stopSecondText.setEnabled(true); break; } } }
package net.snowflake.spark.snowflake import net.snowflake.client.jdbc.<API key> import net.snowflake.spark.snowflake.Utils.<API key> import org.apache.spark.sql.{DataFrame, Row, SaveMode} import org.apache.spark.sql.types.{StringType, StructField, StructType} class OnErrorSuite extends <API key> { lazy val table = s"spark_test_table_$randomSuffix" lazy val schema = new StructType( Array(StructField("var", StringType, nullable = false)) ) lazy val df: DataFrame = sparkSession.createDataFrame( sc.parallelize( Seq(Row("{\"dsadas\nadsa\":12311}"), Row("{\"abc\":334}")) // invalid json key ), schema ) override def beforeAll(): Unit = { super.beforeAll() jdbcUpdate(s"create or replace table $table(var variant)") } override def afterAll(): Unit = { jdbcUpdate(s"drop table $table") super.afterAll() } test("continue_on_error off") { assertThrows[<API key>] { df.write .format(<API key>) .options(<API key>) .option("dbtable", table) .mode(SaveMode.Append) .save() } } test("continue_on_error on") { df.write .format(<API key>) .options(<API key>) .option("continue_on_error", "on") .option("dbtable", table) .mode(SaveMode.Append) .save() val result = sparkSession.read .format(<API key>) .options(<API key>) .option("dbtable", table) .load() assert(result.collect().length == 1) } }
layout: documentation title: Hyperty Registration category: How it Works - Basics order: 5 The Runtime procedures to register a new Hyperty are described in this section. ![Figure @<API key>: Register Hyperty](register-hyperty.png) **Phase 2 New! The Hyperty Address Allocation is now performed by Runtime UA before this step** Step 1: the Hyperty registration is requested by the Runtime UA triggered by the [Hyperty Deployment process](deploy-hyperty.md) (section ?). Steps 2 and 3: The Hyperty is associated to a certain [identity](../identity-management/<API key>.md) Steps 4: **Phase 2 New!** check if registration is new Steps 5 - 7: If it is a new Hyperty instance, it has to registered in the back-end Registry a ([Create Message is used](../../messages/<API key>.md#<API key>)\). **Phase 2 New!** Registration contains new fields for Hyperty Runtime URL, its P2P Handler Stub instance URL and the catalogue URL of P2P Requester Stub. Steps 8 - 10: **Phase 2 New!** if it is not a new registration, an existing Hyperty instance registration is updated in the back-end Registry. ([Update Message](../../messages/<API key>.md#<API key>)\). Steps 11 - 12: The runtime Registry adds its listener to be notified about Hyperty instance status and returns the Hyperty URL to the runtime UA
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="GENERATOR" content="Microsoft FrontPage 3.0"> <title>Out and About Anchorage</title> </head> <body background="paper.gif"> <h1 align="center">Out and About Anchorage</h1> <hr> <table border="0" width="95%"> <tr> <td width="50%" align="center"><img src="alaska/o1.jpg" width="380" height="253" alt="o1.jpg (17155 bytes)"></td> <td width="50%" align="center"><img src="alaska/o2.jpg" width="380" height="253" alt="o2.jpg (10763 bytes)"></td> </tr> <tr> <td width="50%" align="center"><img src="alaska/o3.jpg" width="380" height="253" </td> </td> <td width="50%" align="center"><img src="alaska/o4.jpg" width="380" height="253" </td> </td> </tr> <tr> <td width="50%" align="center"><img src="alaska/o5.jpg" width="380" height="253" </td> </td> <td width="50%" align="center"><img src="alaska/o6.jpg" width="380" height="253" </td> </td> </tr> <tr> <td width="50%" align="center"><img src="alaska/o7.jpg" width="380" height="253" </td> </td> <td width="50%" align="center"><img src="alaska/o8.jpg" width="380" height="253" </td> </td> </tr> <tr> <td width="50%" align="center"><img src="alaska/o9.jpg" width="380" height="253" </td> </td> <td width="50%" align="center"><img src="alaska/o10.jpg" width="380" height="253" </td> </td> </tr> </table> <div align="center"><center> <table border="0" width="80%"> <tr> <td width="100%" align="center"><img src="alaska/o11.jpg" width="521" height="383" alt="o11.jpg (29171 bytes)"></td> </tr> <tr> <td width="100%" align="center"><img src="alaska/o12.jpg" width="576" height="384" alt="o12.jpg (31874 bytes)"></td> </tr> </table> </center></div> </body> </html>
using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Windows.Media; namespace SharpDebug.UI.CodeWindow { internal class <API key> : ICSharpCode.NRefactory.Completion.<API key>, ICSharpCode.AvalonEdit.CodeCompletion.IOverloadProvider { <summary> The currently selected index </summary> private int selectedIndex; <summary> The currently selected parameter </summary> private int currentParameter = 0; <summary> Initializes a new instance of the <see cref="<API key>" /> class. </summary> <param name="startOffset">The start offset.</param> <param name="methods">The methods.</param> <param name="textColor">Color of the text.</param> public <API key>(int startOffset, IEnumerable<ICSharpCode.NRefactory.TypeSystem.IMethod> methods, Brush textColor) { StartOffset = startOffset; Methods = methods.Select(m => new EntityWrapper<ICSharpCode.NRefactory.TypeSystem.IMethod>(m, textColor)).OrderBy(m => m.Entity.Parameters.Count).ThenBy(m => m.AmbienceDescription).ToArray(); } <summary> Gets the methods. </summary> public EntityWrapper<ICSharpCode.NRefactory.TypeSystem.IMethod>[] Methods { get; private set; } <summary> Gets the currently selected method. </summary> private EntityWrapper<ICSharpCode.NRefactory.TypeSystem.IMethod> CurrentMethod { get { return Methods[SelectedIndex]; } } <summary> Gets the overload count. </summary> public int Count { get { return Methods.Length; } } <summary> Gets the start offset of the parameter expression node. </summary> public int StartOffset { get; private set; } <summary> Gets the current content. </summary> public object CurrentContent { get { return CurrentMethod.<API key>(currentParameter); } } <summary> Gets the current header. </summary> public object CurrentHeader { get { return CurrentMethod.<API key>(currentParameter); } } <summary> Gets the text 'SelectedIndex of Count'. </summary> public string CurrentIndexText { get { return string.Format("{0} of {1}", SelectedIndex + 1, Count); } } <summary> Gets/Sets the selected index. </summary> public int SelectedIndex { get { return selectedIndex; } set { selectedIndex = value; while (selectedIndex < 0) selectedIndex += Count; while (selectedIndex >= Count) selectedIndex -= Count; CallPropertyChanged(nameof(SelectedIndex)); CallPropertyChanged(nameof(CurrentIndexText)); CallPropertyChanged(nameof(CurrentHeader)); CallPropertyChanged(nameof(CurrentContent)); } } public int CurrentParameter { get { return currentParameter; } set { currentParameter = value; CallPropertyChanged(nameof(SelectedIndex)); CallPropertyChanged(nameof(CurrentIndexText)); CallPropertyChanged(nameof(CurrentHeader)); CallPropertyChanged(nameof(CurrentContent)); if (currentParameter >= CurrentMethod.Entity.Parameters.Count) for (int i = selectedIndex; i < Count; i++) if (currentParameter < Methods[i].Entity.Parameters.Count) { SelectedIndex = i; break; } } } public event <API key> PropertyChanged; public bool AllowParameterList(int overload) { throw new <API key>(); } public string GetDescription(int overload, int currentParameter) { throw new <API key>(); } public string GetHeading(int overload, string[] <API key>, int currentParameter) { throw new <API key>(); } public int GetParameterCount(int overload) { throw new <API key>(); } public string <API key>(int overload, int paramIndex) { throw new <API key>(); } public string GetParameterName(int overload, int currentParameter) { throw new <API key>(); } private void CallPropertyChanged(string propertyName) { if (PropertyChanged != null) { PropertyChanged(this, new <API key>(propertyName)); } } } }
new76(A,B,C,D,E,F,G) :- B=0. new76(A,B,C,D,E,F,G) :- H=1+E, B=< -1, new4(A,C,D,H,F,G). new76(A,B,C,D,E,F,G) :- H=1+E, B>=1, new4(A,C,D,H,F,G). new74(A,B,C,D,E,F) :- G=1, D>=0, new76(A,G,B,C,D,E,F). new74(A,B,C,D,E,F) :- G=0, D=< -1, new76(A,G,B,C,D,E,F). new72(A,B,C,D,E,F,G) :- B=0. new72(A,B,C,D,E,F,G) :- B=< -1, new74(A,C,D,E,F,G). new72(A,B,C,D,E,F,G) :- B>=1, new74(A,C,D,E,F,G). new70(A,B,C,D,E,F) :- G=1, D-E=< -1, new72(A,G,B,C,D,E,F). new70(A,B,C,D,E,F) :- G=0, D-E>=0, new72(A,G,B,C,D,E,F). new68(A,B,C,D,E,F,G) :- B=0. new68(A,B,C,D,E,F,G) :- H=1+D, I=1+E, B=< -1, new70(A,C,H,I,F,G). new68(A,B,C,D,E,F,G) :- H=1+D, I=1+E, B>=1, new70(A,C,H,I,F,G). new66(A,B,C,D,E,F) :- G=1, D>=0, new68(A,G,B,C,D,E,F). new66(A,B,C,D,E,F) :- G=0, D=< -1, new68(A,G,B,C,D,E,F). new64(A,B,C,D,E,F,G) :- B=0. new64(A,B,C,D,E,F,G) :- B=< -1, new66(A,C,D,E,F,G). new64(A,B,C,D,E,F,G) :- B>=1, new66(A,C,D,E,F,G). new62(A,B,C,D,E,F) :- G=1, D-E=< -1, new64(A,G,B,C,D,E,F). new62(A,B,C,D,E,F) :- G=0, D-E>=0, new64(A,G,B,C,D,E,F). new60(A,B,C,D,E,F,G) :- B=0. new60(A,B,C,D,E,F,G) :- B=< -1, new62(A,C,D,E,F,G). new60(A,B,C,D,E,F,G) :- B>=1, new62(A,C,D,E,F,G). new58(A,B,C,D,E,F) :- G=1, C>=0, new60(A,G,B,C,D,E,F). new58(A,B,C,D,E,F) :- G=0, C=< -1, new60(A,G,B,C,D,E,F). new56(A,B,C,D,E,F,G) :- B=0. new56(A,B,C,D,E,F,G) :- B=< -1, new58(A,C,D,E,F,G). new56(A,B,C,D,E,F,G) :- B>=1, new58(A,C,D,E,F,G). new54(A,B,C,D,E,F) :- G=1, B-C>=1, new56(A,G,B,C,D,E,F). new54(A,B,C,D,E,F) :- G=0, B-C=<0, new56(A,G,B,C,D,E,F). new52(A,B,C,D,E,F,G) :- B=0. new52(A,B,C,D,E,F,G) :- H=1+D, I=1+E, B=< -1, new54(A,C,H,I,F,G). new52(A,B,C,D,E,F,G) :- H=1+D, I=1+E, B>=1, new54(A,C,H,I,F,G). new50(A,B,C,D,E,F) :- G=1, D>=0, new52(A,G,B,C,D,E,F). new50(A,B,C,D,E,F) :- G=0, D=< -1, new52(A,G,B,C,D,E,F). new48(A,B,C,D,E,F,G) :- B=0. new48(A,B,C,D,E,F,G) :- B=< -1, new50(A,C,D,E,F,G). new48(A,B,C,D,E,F,G) :- B>=1, new50(A,C,D,E,F,G). new46(A,B,C,D,E,F) :- G=1, D-E=< -1, new48(A,G,B,C,D,E,F). new46(A,B,C,D,E,F) :- G=0, D-E>=0, new48(A,G,B,C,D,E,F). new44(A,B,C,D,E,F,G) :- B=0. new44(A,B,C,D,E,F,G) :- B=< -1, new46(A,C,D,E,F,G). new44(A,B,C,D,E,F,G) :- B>=1, new46(A,C,D,E,F,G). new42(A,B,C,D,E,F) :- G=1, C>=0, new44(A,G,B,C,D,E,F). new42(A,B,C,D,E,F) :- G=0, C=< -1, new44(A,G,B,C,D,E,F). new40(A,B,C,D,E,F,G) :- B=0. new40(A,B,C,D,E,F,G) :- B=< -1, new42(A,C,D,E,F,G). new40(A,B,C,D,E,F,G) :- B>=1, new42(A,C,D,E,F,G). new39(A,B,C,D,E,F) :- G=1, B-C>=1, new40(A,G,B,C,D,E,F). new39(A,B,C,D,E,F) :- G=0, B-C=<0, new40(A,G,B,C,D,E,F). new35(A,B,C,D,E,F) :- A=< -1, new12(A,B,C,D,E,F). new35(A,B,C,D,E,F) :- A>=1, new12(A,B,C,D,E,F). new35(A,B,C,D,E,F) :- A=0, new39(A,B,C,D,E,F). new33(A,B,C,D,E,F,G) :- B=0. new33(A,B,C,D,E,F,G) :- B=< -1, new35(A,C,D,E,F,G). new33(A,B,C,D,E,F,G) :- B>=1, new35(A,C,D,E,F,G). new31(A,B,C,D,E,F) :- G=1, C>=0, new33(A,G,B,C,D,E,F). new31(A,B,C,D,E,F) :- G=0, C=< -1, new33(A,G,B,C,D,E,F). new29(A,B,C,D,E,F,G) :- B=0. new29(A,B,C,D,E,F,G) :- B=< -1, new31(A,C,D,E,F,G). new29(A,B,C,D,E,F,G) :- B>=1, new31(A,C,D,E,F,G). new25(A,B,C,D,E,F,G) :- B=0. new25(A,B,C,D,E,F,G) :- H=1+D, I=1+E, B=< -1, new4(A,C,H,I,F,G). new25(A,B,C,D,E,F,G) :- H=1+D, I=1+E, B>=1, new4(A,C,H,I,F,G). new23(A,B,C,D,E,F) :- G=1, D>=0, new25(A,G,B,C,D,E,F). new23(A,B,C,D,E,F) :- G=0, D=< -1, new25(A,G,B,C,D,E,F). new21(A,B,C,D,E,F,G) :- B=0. new21(A,B,C,D,E,F,G) :- B=< -1, new23(A,C,D,E,F,G). new21(A,B,C,D,E,F,G) :- B>=1, new23(A,C,D,E,F,G). new19(A,B,C,D,E,F) :- G=1, D-E=< -1, new21(A,G,B,C,D,E,F). new19(A,B,C,D,E,F) :- G=0, D-E>=0, new21(A,G,B,C,D,E,F). new17(A,B,C,D,E,F,G) :- B=0. new17(A,B,C,D,E,F,G) :- B=< -1, new19(A,C,D,E,F,G). new17(A,B,C,D,E,F,G) :- B>=1, new19(A,C,D,E,F,G). new15(A,B,C,D,E,F) :- G=1, C>=0, new17(A,G,B,C,D,E,F). new15(A,B,C,D,E,F) :- G=0, C=< -1, new17(A,G,B,C,D,E,F). new13(A,B,C,D,E,F,G) :- B=0. new13(A,B,C,D,E,F,G) :- B=< -1, new15(A,C,D,E,F,G). new13(A,B,C,D,E,F,G) :- B>=1, new15(A,C,D,E,F,G). new12(A,B,C,D,E,F) :- G=1, B-C>=1, new13(A,G,B,C,D,E,F). new12(A,B,C,D,E,F) :- G=0, B-C=<0, new13(A,G,B,C,D,E,F). new11(A,B,C,D,E,F) :- G=1, B-C>=2, new29(A,G,B,C,D,E,F). new11(A,B,C,D,E,F) :- G=0, B-C=<1, new29(A,G,B,C,D,E,F). new9(A,B,C,D,E,F) :- new3(A,B,C,D,E,F). new8(A,B,C,D,E,F) :- B-C>=2, new11(A,B,C,D,E,F). new8(A,B,C,D,E,F) :- B-C=<1, new12(A,B,C,D,E,F). new6(A,B,C,D,E,F) :- new3(A,B,C,D,E,F). new5(A,B,C,D,E,F) :- D-F=< -1, new8(A,B,C,D,E,F). new5(A,B,C,D,E,F) :- D-F>=0, new9(A,B,C,D,E,F). new4(A,B,C,D,E,F) :- B-C>=1, new5(A,B,C,D,E,F). new4(A,B,C,D,E,F) :- B-C=<0, new6(A,B,C,D,E,F). new3(A,B,C,D,E,F) :- G=0, B-C>=1, new4(A,B,C,G,E,F). new2(A) :- B=0, C=4+D, new3(A,E,B,F,C,D). new1 :- new2(A). false :- new1.
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from caffe2.python import core, workspace from hypothesis import given import caffe2.python.<API key> as hu import hypothesis.strategies as st import numpy as np class TestPairWiseLossOps(hu.HypothesisTestCase): @given(X=hu.arrays(dims=[2, 1], elements=st.floats(min_value=0.0, max_value=10.0)), label=hu.arrays(dims=[2, 1], elements=st.integers(min_value=0, max_value=1), dtype=np.float32), **hu.gcs_cpu_only) def <API key>(self, X, label, gc, dc): workspace.FeedBlob('X', X) workspace.FeedBlob('label', label) new_label = np.array([label[1], label[0]]) new_x = np.array([X[1], X[0]]) workspace.FeedBlob('new_x', new_x) workspace.FeedBlob('new_label', new_label) net = core.Net('net') net.PairWiseLoss(['X', 'label'], ['output']) net.PairWiseLoss(['new_x', 'new_label'], ['new_output']) plan = core.Plan('predict_data') plan.AddStep(core.execution_step('predict_data', [net], num_iter=1)) workspace.RunPlan(plan) output = workspace.FetchBlob('output') new_output = workspace.FetchBlob('new_output') sign = 1 if label[0] > label[1] else -1 if label[0] == label[1]: self.assertEqual(np.asscalar(output), 0) return self.assertAlmostEqual( np.asscalar(output), np.asscalar(np.log(1 + np.exp(sign * (X[1] - X[0])))), delta=1e-4 ) # check swapping row order doesn't alter overall loss self.assertAlmostEqual(output, new_output) @given(X=hu.arrays(dims=[2, 1], elements=st.floats(min_value=0.0, max_value=10.0)), label=hu.arrays(dims=[2, 1], elements=st.integers(min_value=0, max_value=1), dtype=np.float32), dY=hu.arrays(dims=[1], elements=st.floats(min_value=1, max_value=10)), **hu.gcs_cpu_only) def <API key>(self, X, label, dY, gc, dc): workspace.FeedBlob('X', X) workspace.FeedBlob('dY', dY) workspace.FeedBlob('label', label) net = core.Net('net') net.<API key>( ['X', 'label', 'dY'], ['dX'], ) plan = core.Plan('predict_data') plan.AddStep(core.execution_step('predict_data', [net], num_iter=1)) workspace.RunPlan(plan) dx = workspace.FetchBlob('dX') sign = 1 if label[0] > label[1] else -1 if label[0] == label[1]: self.assertEqual(np.asscalar(dx[0]), 0) return self.assertAlmostEqual( np.asscalar(dx[0]), np.asscalar(-dY[0] * sign / (1 + np.exp(sign * (X[0] - X[1])))), delta=1e-2 * abs(np.asscalar(dx[0]))) self.assertEqual(np.asscalar(dx[0]), np.asscalar(-dx[1])) delta = 1e-3 up_x = np.array([[X[0] + delta], [X[1]]], dtype=np.float32) down_x = np.array([[X[0] - delta], [X[1]]], dtype=np.float32) workspace.FeedBlob('up_x', up_x) workspace.FeedBlob('down_x', down_x) new_net = core.Net('new_net') new_net.PairWiseLoss(['up_x', 'label'], ['up_output']) new_net.PairWiseLoss(['down_x', 'label'], ['down_output']) plan = core.Plan('predict_data') plan.AddStep(core.execution_step('predict_data', [new_net], num_iter=1)) workspace.RunPlan(plan) down_output_pred = workspace.FetchBlob('down_output') up_output_pred = workspace.FetchBlob('up_output') np.testing.assert_allclose( np.asscalar(dx[0]), np.asscalar( 0.5 * dY[0] * (up_output_pred[0] - down_output_pred[0]) / delta), rtol=1e-2, atol=1e-2)
using AutoMapper; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Timerial.Common.Mapping { <summary> Autommapper implementation of the <see cref="Tmx.Common.Mapping.IDynamicMapper"/> </summary> public class DynamicMapper : IDynamicMapper { <summary> Adapt a source object to an instance of type <typeparamref name="TTarget"/> </summary> <typeparam name="TSource">Type of source item</typeparam> <typeparam name="TTarget">Type of target item</typeparam> <param name="source">Instance to adapt</param> <returns><paramref name="source"/> mapped to <typeparamref name="TTarget"/></returns> public TTarget Map<TSource, TTarget>(TSource source) where TSource : class where TTarget : class, new() { return Mapper.DynamicMap<TSource, TTarget>(source); } } }
# Submitting a Change to Gerrit Carefully review the following before submitting a change. These guidelines apply to developers that are new to open source, as well as to experienced open source developers. ## Change Requirements This section contains guidelines for submitting code changes for review. For more information on how to submit a change using Gerrit, please see [Gerrit](gerrit.md). Changes are submitted as Git commits. Each commit must contain: - a short and descriptive subject line that is 72 characters or fewer, followed by a blank line. - a change description with your logic or reasoning for the changes, followed by a blank line - a Signed-off-by line, followed by a colon (Signed-off-by:) - a Change-Id identifier line, followed by a colon (Change-Id:). Gerrit won't accept patches without this identifier. A commit with the above details is considered well-formed. All changes and topics sent to Gerrit must be well-formed. Informationally, `commit messages` must include: * **what** the change does, * **why** you chose that approach, and * **how** you know it works -- for example, which tests you ran. Commits must [build cleanly](../dev-setup/build.md) when applied in top of each other, thus avoiding breaking bisectability. Each commit must address a single identifiable issue and must be logically self-contained. For example: One commit fixes whitespace issues, another renames a function and a third one changes the code's functionality. An example commit file is illustrated below in detail: A short description of your change with no period at the end You can add more details here in several paragraphs, but please keep each line width less than 80 characters. A bug fix should include the issue number. Fix Issue # 7050. Change-Id: <API key> Signed-off-by: Your Name commit-sender@email.address Each commit must contain the following line at the bottom of the commit message: Signed-off-by: Your Name your@email.address The name in the Signed-off-by line and your email must match the change authorship information. Make sure your :file:`.git/config` is set up correctly. Always submit the full set of changes via Gerrit. When a change is included in the set to enable other changes, but it will not be part of the final set, please let the reviewers know this.
identifier: MIR:00000242 name: Pathway Ontology description: The Pathway Ontology captures information on biological networks, the relationships between netweorks and the alterations or malfunctioning of such networks within a hierarchical structure. The five main branches of the ontology are: classic metabolic pathways, regulatory, signaling, drug, and disease pathwaysfor complex human conditions. prefix: pw pattern: ^PW:\d{7}$ prefixed: 1 local_id: 0000208 resources: - identifier: MIR:00100309 accessurl: http://rgd.mcw.edu/rgdweb/ontology/annot.html?acc_id=PW:${lid} keyword: Diabetes mellitus description: Pathway Ontology at Rat Genome Database homepage: http://rgd.mcw.edu/rgdweb/ontology/search.html institution: Medical College of Wisconsin, Wisconsin location: USA official: false - identifier: MIR:00100310 accessurl: http: keyword: Diabetes mellitus description: Pathway Ontology through OLS homepage: http: institution: European Bioinformatics Institute, Hinxton, Cambridge location: UK official: false provider_code: ols - identifier: MIR:00100311 accessurl: http://purl.bioontology.org/ontology/PW/PW:${lid} keyword: Diabetes mellitus description: Pathway Ontology through BioPortal homepage: http://bioportal.bioontology.org/ontologies/PW institution: National Center for Biomedical Ontology, Stanford, California location: USA official: false provider_code: bptl
namespace Altavant.Fusion.Layouting.Text.Blocks { using System; internal class Plot : Block, IPlot { private Text _text; private IDrawing _drawing; private float _width; private float _height; private Spacings _spacings; private BlockAlignment _alignment; public Plot(Text text, IDrawing drawing, float width, float height) { if (width < 0F) throw new <API key>(nameof(width), "[0.0, ...]"); if (height < 0F) throw new <API key>(nameof(height), "[0.0, ...]"); _text = text; _drawing = drawing; _width = width; _height = height; _spacings = Spacings.Default; _alignment = BlockAlignment.Baseline; } public override BlockType Type { get { return BlockType.Plot; } } public Text Text { get { return _text; } } public IDrawing Drawing { get { return _drawing; } set { _drawing = value; } } public float Width { get { return _width; } set { if (value < 0F) throw new <API key>(null, "[0.0, ...]"); _width = value; } } public float Height { get { return _height; } set { if (value < 0F) throw new <API key>(null, "[0.0, ...]"); _height = value; } } public Spacings Spacings { get { if (_spacings == Spacings.Default) _spacings = new Spacings(); return _spacings; } set { if (value != null) _spacings = value; else _spacings = Spacings.Default; } } public BlockAlignment Alignment { get { return _alignment; } set { _alignment = value; } } public Spacings GetSpacings() { return _spacings; } public override Block Clone() { Plot plot = new Plot(_text, _drawing, _width, _height); CloneImpl(plot); return plot; } protected override void CloneImpl(Block clone) { Plot plot = (Plot)clone; plot.Spacings = _spacings; plot.Alignment = _alignment; base.CloneImpl(clone); } } }
package com.markelintl.pq.data; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.<API key>; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; import javax.xml.bind.DatatypeConverter; public class PolicySignature { private final Charset charset = StandardCharsets.UTF_8; private static final String ALGORITHM = "HmacSHA256"; private final SecretKeySpec key; public PolicySignature(final String psk) { this.key = new SecretKeySpec(charset.encode(psk).array(), ALGORITHM); } public byte[] signPolicy(final long epoch, final PolicyReference policy) throws <API key>, InvalidKeyException { String s = payload(epoch, policy); final Mac mac = Mac.getInstance(ALGORITHM); mac.init(key); return mac.doFinal(charset.encode(s).array()); } public static String payload(long epoch, PolicyReference policy) { StringBuilder sb = new StringBuilder(); sb.append(epoch); sb.append(policy); return sb.toString(); } public String signToBase64(final long epoch, final PolicyReference policy) throws InvalidKeyException, <API key> { return DatatypeConverter.printBase64Binary(signPolicy(epoch, policy)); } public boolean verifyFromBase64(final long epoch, final PolicyReference policy, final String signature) throws <API key>, InvalidKeyException { final String expectedSignature = signToBase64(epoch, policy); return expectedSignature.equals(signature); } }
import scala.tools.partest._ import scala.tools.nsc._ object Test extends DirectTest { override def extraSettings: String = "-usejavacp" def code = """ class testAnn extends annotation.Annotation object t { def nt = 1 def tr = "a" } class Test { List(1,2).map(x => { val another = ((t.nt, t.tr): @testAnn) match { case (_, _) => 1 } x }) } """.trim // point of this test: type-check the "Annotated" tree twice. first time the analyzer plugin types it, // second time the typer. // bug was that typedAnnotated assigned a type to the Annotated tree. The second type check would consider // the tree as alreadyTyped, which is not cool, the Annotated needs to be transformed into a Typed tree. def show(): Unit = { val global = newCompiler() import global._ import analyzer._ import collection.{mutable => m} object analyzerPlugin extends AnalyzerPlugin { val templates: m.Map[Symbol, (Template, Typer)] = m.Map() override def pluginsTypeSig(tpe: Type, typer: Typer, defTree: Tree, pt: Type): Type = { defTree match { case impl: Template => templates += typer.context.owner -> (impl, typer) case dd: DefDef if dd.symbol.<API key> && templates.contains(dd.symbol.owner) => val (impl, templTyper) = templates(dd.symbol.owner) for (stat <- impl.body.filterNot(_.isDef)) { println("typing "+ stat) val statsOwner = impl.symbol orElse templTyper.context.owner.newLocalDummy(impl.pos) val tpr = analyzer.newTyper(templTyper.context.make(stat, statsOwner)) tpr.typed(stat) } case _ => } tpe } } addAnalyzerPlugin(analyzerPlugin) compileString(global)(code) } }
package org.minitoolbox.gc; public class StrongReference<T> { private final T referent; public StrongReference(T referent) { this.referent = referent; } public T get() { return referent; } @Override public int hashCode() { return System.identityHashCode(referent); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; StrongReference other = (StrongReference) obj; if (referent == null) { if (other.referent != null) return false; } else if (referent != other.referent) return false; return true; } }
layout: base title: 'Statistics of PART in UD_Breton-KEB' udver: '2' ## Treebank Statistics: UD_Breton-KEB: POS Tags: `PART` There are 1 `PART` lemmas (0%), 1 `PART` types (0%) and 2 `PART` tokens (0%). Out of 17 observed tags, the rank of `PART` is: 17 in number of lemmas, 17 in number of types and 16 in number of tokens. The 10 most frequent `PART` lemmas: <em>na</em> The 10 most frequent `PART` types: <em>na</em> The 10 most frequent ambiguous lemmas: <em>na</em> (<tt><a href="br_keb-pos-AUX.html">AUX</a></tt> 9, <tt><a href="br_keb-pos-PART.html">PART</a></tt> 2) The 10 most frequent ambiguous types: <em>na</em> (<tt><a href="br_keb-pos-AUX.html">AUX</a></tt> 7, <tt><a href="br_keb-pos-PART.html">PART</a></tt> 2) * <em>na</em> * <tt><a href="br_keb-pos-AUX.html">AUX</a></tt> 7: <em>Setu an den <b>na</b> gontas ket an istor d imp .</em> * <tt><a href="br_keb-pos-PART.html">PART</a></tt> 2: <em>E r bloaz 1950 ne chome mui nemet 100 000 a dud <b>na</b> ouient nemet brezhoneg .</em> ## Morphology The form / lemma ratio of `PART` is 1.000000 (the average of all parts of speech is 1.395336). The 1st highest number of forms (1) was observed with the lemma “na”: <em>na</em>. `PART` occurs with 1 features: <tt><a href="<API key>.html">Polarity</a></tt> (2; 100% instances) `PART` occurs with 1 feature-value pairs: `Polarity=Neg` `PART` occurs with 1 feature combinations. The most frequent feature combination is `Polarity=Neg` (2 tokens). Examples: <em>na</em> ## Relations `PART` nodes are attached to their parents using 1 different relations: <tt><a href="br_keb-dep-advmod.html">advmod</a></tt> (2; 100% instances) Parents of `PART` nodes belong to 2 different parts of speech: <tt><a href="br_keb-pos-ADJ.html">ADJ</a></tt> (1; 50% instances), <tt><a href="br_keb-pos-VERB.html">VERB</a></tt> (1; 50% instances) 2 (100%) `PART` nodes are leaves. The highest child degree of a `PART` node is 0.
New rules * A tabpanel should be related to a tab via aria-controls or aria-labelledby (`src/audits/<API key>.js) * A tooltip element should have an aria-describedby referring to it (`src/audits/<API key>.js`). Enhancements Bug fixes: * Fix `<API key>` not always correctly ignoring hidden elements (#217). * `<API key>` now honors `alt` attribute of input type image * Revert #150 which was causing the extension not to work. ## 2.9.0 - 2015-09-04 ## 2.9.0-rc.0 - 2015-08-21 New rules * A label element may not have labelable descendants other than its labeled control (`src/audits/<API key>.js`) Enhancements * Implement support for specifying audit configuration options through an object when initializing audits (#165). * Implement support for AMD loaders. Bug fixes: * Fix `<API key>` not correctly handling decimal values (#182). * Work around null pointer exception caused by closure compiler issue (#183). * Add a special case to handle color `"transparent"` to fix (#180). * Fix `matchSelector` not working properly in browser environments without vendor prefixes (#189). * Fix false positives on elements with no role for Unsupported ARIA Attribute rule (#178 and #199). * Fix ARIA `tablist` and ARIA `tab` scope (#204) * Fix link with clear purpose with text alternative (#156); * Handle edge cases in number parser, e.g. "+1", ".1", "01" * HTML button containing img with alt attribute now passes <API key> (#202) * Disabled elements should be ignored by low contrast audit (#205) * Fix input of type "text" did not find correct implied role (#225) * Hidden links are no longer relevant for meaningful link text rule. ## 2.8.0 - 2015-07-24 ## 2.8.0-rc.0 - 2015-07-10 Enhancements: * Pull color code into separate file. * Improve color suggestion algorithm. * Descend into iframes when collecting matching elements. ## 2.7.1 - 2015-06-30 ## 2.7.1-rc.1 - 2015-06-23 Bug fixes: * Check for null `textAlternatives` in `<API key>`'s `<API key>` method. ## 2.7.1-rc.0 - 2015-06-15 Enhancements: * Rework <API key> not to return non-exposed text alternatives. * Add Bower config (#157) Bug fixes: * Check for any text alternatives when assessing unlabeled images (#154). ## 2.7.0 - 2015-05-15 New rules * This element does not support ARIA roles, states and properties (`src/audits/<API key>.js`) * aria-owns should not be used if ownership is implicit in the DOM (`src/audits/AriaOwnsDescendant.js`) * Elements with ARIA roles must be in the correct scope (`src/audits/AriaRoleNotScoped.js`) * An element's ID must be unique in the DOM (`src/audits/DuplicateId.js`) * The web page should have the content's human language indicated in the markup (`src/audits/HumanLangMissing.js`) * An element's ID must not be present in more that one aria-owns attribute at any time (`src/audits/MultipleAriaOwners.js`) * ARIA attributes which refer to other elements by ID should refer to elements which exist in the DOM (`src/audits/<API key>.js` - previously `src/audits/<API key>.js`) * Elements with ARIA roles must ensure required owned elements are present (`src/audits/<API key>.js`) * Avoid positive integer values for tabIndex (`src/audits/<API key>.js`) * This element has an unsupported ARIA attribute (`src/audits/<API key>.js`) Enhancements: * Add configurable blacklist phrases and stop words to <API key> ( * Detect and warn if we reuse the same code for more than one rule. (#133) * Force focus before testing visibility on focusable elements. ( * Use getDistributedNodes to get nodes distributed into shadowRoots (#128) * Add section to Audit Rules page for HumanLangMissing and link to it from rule (#119) * Reference "applied role" in axs.utils.getRoles enhancement (#130) * Add warning that AX_FOCUS_02 is not available from axs.Audit.run() ( Bug fixes: * Incorrect use of nth-of-type against className in utils.<API key> ( * AX_TEXT_01 Accessibility Audit test should probably ignore role=presentation elements ( * Fix path to audit rules in phantomjs runner (#108) * Label audit should fail if form fields lack a label, even with placeholder text ( * False positives for controls without labels with role=presentation ( * Fix "valid" flag on return value of axs.utils.getRoles (#131) Note: this version number is somewhat arbitrary - just bringing it vaguely in line with [the extension](https://github.com/GoogleChrome/<API key>) since that's where the library originated - but will use semver for version bumps going forward from here. ## 0.0.5 - 2014-02-04 Enhancements: * overlapping elements detection code made more sophisticated * axs.properties.getFocusProperties() returns more information about visibility * new axs.properties.<API key>() method with more sophisticated detection of text content Bug fixes: * <API key> audit passes on elements which are brought onscreen on focus * <API key> checks for element.disabled * Fix infinite loop when getting descendant text content of a label containing an input * Detect elements which are out of scroll area of any parent element, not just the document scroll area * <API key> doesn't throw TypeError if used on a HTMLSelectElement ## 0.0.4 - 2013-10-03 Enhancements: * axs.AuditRule.run() has a new signature: it now takes an options object. Please see method documentation for details. * Audit Rule severity can be overridden (per Audit Rule) in AuditConfig. Bug fixes: * axs.utils.isLowContrast() now rounds to the nearest 0.1 before checking (so `#777` is now a passing value) * <API key> was always failing due to accessible name calculation taking the main role into account and not descending into content (now just gets descendant content directly) * <API key> had a dangling if-statement causing very noisy false positives
#ifndef <API key> #define <API key> #include <sparge/gold/types.hpp> namespace sparge { namespace gold { struct production { static constexpr byte id = 'R'; integer head_index; range<integer> symbols; static indexed<production> from_record(const record &r); }; std::ostream & operator<<(std::ostream & ostr, const production &p); } } #endif /* <API key> */
package com.logginghub.utils.swing; import com.logginghub.utils.Out; import com.logginghub.utils.StringUtils; import java.awt.*; public class Utils { public static void dumpContainer(Container panel, int indent) { String indentString = StringUtils.repeat(" ", indent); int children = panel.getComponentCount(); for (int i = 0; i < children; i++) { Component component = panel.getComponent(i); Out.out("{}{-50}'{50}' visible={6} size={10} preferred={10}", indentString, component.getClass().getSimpleName(), component.getName(), component.isVisible(), format(component.getSize()), format(component.getPreferredSize())); if (component instanceof Container) { dumpContainer((Container) component, indent++); } } } private static String format(Dimension preferredSize) { return StringUtils.format("{}x{}", preferredSize.getWidth(), preferredSize.getHeight()); } }
<!DOCTYPE html PUBLIC "- <html xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>geo-analyzer 0.5.25 Reference Package au.gov.amsa.util.navigation</title> <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" /> </head> <body> <h3> <a href="package-summary.html" target="classFrame">au.gov.amsa.util.navigation</a> </h3> <h3>Classes</h3> <ul> <li> <a href="PositionTest.html" target="classFrame">PositionTest</a> </li> </ul> </body> </html>
"use strict"; var Backbone = require( "/libs/backbone-titanium" ), C = require( "appersonlabs.carbon" ), TweetsView, TweetsCollection; var TabGroupView = Backbone.View.extend({ el: C.UI.load( "/templates/tabgroup.json" ), initialize: function(){ TweetsCollection = require( "/collections/tweets" ); TweetsView = require( "/views/tweets" ); this.tweetsTab = new TweetsView({ el: this.el.tabs[0], collection: new TweetsCollection() }); }, open: function(){ this.el.open(); return this; } }); module.exports = TabGroupView;
package org.locke.biokit.chemistry.atom.elements.group06; import org.locke.biokit.chemistry.atom.Element; import org.locke.biokit.chemistry.atom.Nucleus; import org.locke.biokit.chemistry.atom.PeriodicTable; import org.locke.biokit.chemistry.atom.elements.Abundance; import org.locke.biokit.chemistry.atom.elements.AtomicNumber; import org.locke.biokit.chemistry.atom.elements.MassNumber; public class Seaborgium extends Group6Element { public static final Seaborgium SEABORGIUM_266 = new Seaborgium(MassNumber.of(266), Abundance.TRACE); public static final Seaborgium SEABORGIUM = SEABORGIUM_266; private Seaborgium(final MassNumber massNumber, final Abundance abundance) { super(Nucleus.of(AtomicNumber.of(106)).isotope(massNumber), abundance); } @Override public String orbitals() { return "[Rn]7s2,5f14,6d4"; } @Override public PeriodicTable.Period period() { return PeriodicTable.period(7); } @Override public String symbol() { return "Sg"; } @Override protected Element mostCommonIsotope() { return SEABORGIUM; } }
<!DOCTYPE HTML PUBLIC "- <!--NewPage <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_45) on Thu Mar 26 16:48:37 UTC 2015 --> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Class com.hazelcast.ascii.rest.RestValue (Hazelcast Root 3.4.2 API) </TITLE> <META NAME="date" CONTENT="2015-03-26"> <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="Uses of Class com.hazelcast.ascii.rest.RestValue (Hazelcast Root 3.4.2 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <A NAME="navbar_top"></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&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"> <A HREF="../../../../../com/hazelcast/ascii/rest/RestValue.html" title="class in com.hazelcast.ascii.rest"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&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;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/hazelcast/ascii/rest//class-useRestValue.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RestValue.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> <HR> <CENTER> <H2> <B>Uses of Class<br>com.hazelcast.ascii.rest.RestValue</B></H2> </CENTER> No usage of com.hazelcast.ascii.rest.RestValue <P> <HR> <A NAME="navbar_bottom"></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="<API key>"></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&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"> <A HREF="../../../../../com/hazelcast/ascii/rest/RestValue.html" title="class in com.hazelcast.ascii.rest"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&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;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/hazelcast/ascii/rest//class-useRestValue.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="RestValue.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> <HR> Copyright & </BODY> </HTML>
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_11) on Fri Jan 24 10:09:05 PST 2014 --> <title>OAuthWebViewData</title> <meta name="date" content="2014-01-24"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="OAuthWebViewData"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/OAuthWebViewData.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/box/boxjavalibv2/authorization/<API key>.html" title="interface in com.box.boxjavalibv2.authorization"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/box/boxjavalibv2/authorization/SharedItemAuth.html" title="class in com.box.boxjavalibv2.authorization"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/box/boxjavalibv2/authorization/OAuthWebViewData.html" target="_top">Frames</a></li> <li><a href="OAuthWebViewData.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&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>Field&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> <div class="header"> <div class="subTitle">com.box.boxjavalibv2.authorization</div> <h2 title="Class OAuthWebViewData" class="title">Class OAuthWebViewData</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>com.box.boxjavalibv2.authorization.OAuthWebViewData</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">OAuthWebViewData</span> extends java.lang.Object</pre> <div class="block">Data on the OAuth WebView.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> </a> <h3>Constructor Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#OAuthWebViewData(com.box.boxjavalibv2.authorization.OAuthDataController)">OAuthWebViewData</a></strong>(<a href="../../../../com/box/boxjavalibv2/authorization/OAuthDataController.html" title="class in com.box.boxjavalibv2.authorization">OAuthDataController</a>&nbsp;oAuthDataController)</code> <div class="block">Constructor.</div> </td> </tr> </table> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_summary"> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>java.net.URI</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#buildUrl()">buildUrl</a></strong>()</code> <div class="block">build the oauth URI.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getClientId()">getClientId</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getClientSecret()">getClientSecret</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getHost()">getHost</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getOptionalState()">getOptionalState</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getRedirectUrl()">getRedirectUrl</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getResponseType()">getResponseType</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getScheme()">getScheme</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#getUrlPath()">getUrlPath</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#setOptionalState(java.lang.String)">setOptionalState</a></strong>(java.lang.String&nbsp;optionalState)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/box/boxjavalibv2/authorization/OAuthWebViewData.html#setRedirectUrl(java.lang.String)">setRedirectUrl</a></strong>(java.lang.String&nbsp;url)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="<API key>.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"> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> </a> <h3>Constructor Detail</h3> <a name="OAuthWebViewData(com.box.boxjavalibv2.authorization.OAuthDataController)"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>OAuthWebViewData</h4> <pre>public&nbsp;OAuthWebViewData(<a href="../../../../com/box/boxjavalibv2/authorization/OAuthDataController.html" title="class in com.box.boxjavalibv2.authorization">OAuthDataController</a>&nbsp;oAuthDataController)</pre> <div class="block">Constructor.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>redirectUrl</code> - redirection url</dd><dd><code>clientId</code> - client id</dd><dd><code>clientSecret</code> - client secret</dd><dd><code>responseType</code> - response type, currently only supports <code>#CODE_RESPONSE</code></dd><dd><code>scheme</code> - scheme for oauth</dd><dd><code>host</code> - host for oauth</dd></dl> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method_detail"> </a> <h3>Method Detail</h3> <a name="getOptionalState()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getOptionalState</h4> <pre>public&nbsp;java.lang.String&nbsp;getOptionalState()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd>the optionalState</dd></dl> </li> </ul> <a name="setOptionalState(java.lang.String)"> </a> <ul class="blockList"> <li class="blockList"> <h4>setOptionalState</h4> <pre>public&nbsp;void&nbsp;setOptionalState(java.lang.String&nbsp;optionalState)</pre> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>optionalState</code> - the optionalState to set</dd></dl> </li> </ul> <a name="getRedirectUrl()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getRedirectUrl</h4> <pre>public&nbsp;java.lang.String&nbsp;getRedirectUrl()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd>the redirectUrl</dd></dl> </li> </ul> <a name="setRedirectUrl(java.lang.String)"> </a> <ul class="blockList"> <li class="blockList"> <h4>setRedirectUrl</h4> <pre>public&nbsp;void&nbsp;setRedirectUrl(java.lang.String&nbsp;url)</pre> </li> </ul> <a name="getClientId()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getClientId</h4> <pre>public&nbsp;java.lang.String&nbsp;getClientId()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd>the clientId</dd></dl> </li> </ul> <a name="getResponseType()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getResponseType</h4> <pre>public&nbsp;java.lang.String&nbsp;getResponseType()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd>the responseType</dd></dl> </li> </ul> <a name="getScheme()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getScheme</h4> <pre>public&nbsp;java.lang.String&nbsp;getScheme()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd>the scheme</dd></dl> </li> </ul> <a name="getHost()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getHost</h4> <pre>public&nbsp;java.lang.String&nbsp;getHost()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd>the host</dd></dl> </li> </ul> <a name="getUrlPath()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getUrlPath</h4> <pre>public&nbsp;java.lang.String&nbsp;getUrlPath()</pre> </li> </ul> <a name="getClientSecret()"> </a> <ul class="blockList"> <li class="blockList"> <h4>getClientSecret</h4> <pre>public&nbsp;java.lang.String&nbsp;getClientSecret()</pre> <dl><dt><span class="strong">Returns:</span></dt><dd>the client secret</dd></dl> </li> </ul> <a name="buildUrl()"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>buildUrl</h4> <pre>public&nbsp;java.net.URI&nbsp;buildUrl() throws java.net.URISyntaxException</pre> <div class="block">build the oauth URI.</div> <dl><dt><span class="strong">Returns:</span></dt><dd>URI uri</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.net.URISyntaxException</code> - exception</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/OAuthWebViewData.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/box/boxjavalibv2/authorization/<API key>.html" title="interface in com.box.boxjavalibv2.authorization"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/box/boxjavalibv2/authorization/SharedItemAuth.html" title="class in com.box.boxjavalibv2.authorization"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/box/boxjavalibv2/authorization/OAuthWebViewData.html" target="_top">Frames</a></li> <li><a href="OAuthWebViewData.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&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>Field&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> </body> </html>
#!/usr/bin/python # -*- coding: utf-8 -*- """ Build everything for mm2s5. You'll need: sudo apt-get install alien help2man fakeroot lintian Also python-bdist """ from pybdist import pybdist import optparse import setup def main(): parser = optparse.OptionParser() pybdist.<API key>(parser) (options, unused_args) = parser.parse_args() if not pybdist.<API key>(options, setup): print 'Doing nothing. --help for commands.' if __name__ == '__main__': main()
package com.niomongo.conversion.custom; import com.niomongo.conversion.custom.validation.EmailValidator; import com.niomongo.conversion.custom.validation.ValidatedBy; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.FIELD) @ValidatedBy(EmailValidator.Factory.class) public @interface Email { }
package com.fubang.live.ui; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.view.View; import android.widget.ImageView; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import com.fubang.live.AppConstant; import com.fubang.live.R; import com.fubang.live.base.BaseActivity; import com.fubang.live.callback.<API key>; import com.fubang.live.util.StartUtil; import com.fubang.live.util.ToastUtil; import com.lzy.okgo.OkGo; import com.socks.library.KLog; import org.json.JSONException; import org.json.JSONObject; import java.util.HashMap; import java.util.Map; import butterknife.BindView; import butterknife.ButterKnife; import butterknife.OnClick; import okhttp3.Call; import okhttp3.Response; public class <API key> extends BaseActivity { @BindView(R.id.iv_back) ImageView ivBack; @BindView(R.id.tv_title) TextView tvTitle; @BindView(R.id.rb_type_talent) RadioButton rbTypeTalent; @BindView(R.id.rb_type_male) RadioButton rbTypeMale; @BindView(R.id.rb_type_singer) RadioButton rbTypeSinger; @BindView(R.id.rb_type_female) RadioButton rbTypeFemale; @BindView(R.id.rg_gender) RadioGroup rgGender; @BindView(R.id.tv_submit) TextView tvSubmit; @BindView(R.id.tv_type_is_first) TextView tvTypeIs_First; private int type = 1; private Context context; private boolean has_type = true; @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); <API key>(); setContentView(R.layout.<API key>); ButterKnife.bind(this); context = this; type = getIntent().getIntExtra("content", 1); has_type = getIntent().getBooleanExtra("has_type", true); if (!has_type) { tvTypeIs_First.setVisibility(View.VISIBLE); } else { tvTypeIs_First.setVisibility(View.GONE); } initview(); } private void initview() { back(ivBack); tvTitle.setText(""); tvSubmit.setVisibility(View.VISIBLE); if (type == 1) { rbTypeTalent.setChecked(true); rbTypeMale.setChecked(false); rbTypeSinger.setChecked(false); rbTypeFemale.setChecked(false); } else if (type == 2) { rbTypeTalent.setChecked(false); rbTypeMale.setChecked(false); rbTypeSinger.setChecked(true); rbTypeFemale.setChecked(false); } else if (type == 3) { rbTypeTalent.setChecked(false); rbTypeMale.setChecked(true); rbTypeSinger.setChecked(false); rbTypeFemale.setChecked(false); } else if (type == 4) { rbTypeTalent.setChecked(false); rbTypeMale.setChecked(false); rbTypeSinger.setChecked(false); rbTypeFemale.setChecked(true); } rbTypeTalent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { type = 1; rbTypeTalent.setChecked(true); rbTypeMale.setChecked(false); rbTypeSinger.setChecked(false); rbTypeFemale.setChecked(false); } }); rbTypeMale.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { type = 3; rbTypeTalent.setChecked(false); rbTypeMale.setChecked(true); rbTypeSinger.setChecked(false); rbTypeFemale.setChecked(false); } }); rbTypeSinger.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { type = 2; rbTypeTalent.setChecked(false); rbTypeMale.setChecked(false); rbTypeSinger.setChecked(true); rbTypeFemale.setChecked(false); } }); rbTypeFemale.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { type = 4; rbTypeTalent.setChecked(false); rbTypeMale.setChecked(false); rbTypeSinger.setChecked(false); rbTypeFemale.setChecked(true); } }); } @OnClick(R.id.tv_submit) public void onViewClicked(View v) { switch (v.getId()) { case R.id.tv_submit: String url = AppConstant.BASE_URL + AppConstant.<API key>; Map<String, String> params = new HashMap<>(); params.put("nuserid", StartUtil.getUserId(context)); params.put("type", String.valueOf(type)); OkGo.post(url) .tag(this) .params(params) .execute(new <API key>(this) { @Override public void onSuccess(String s, Call call, Response response) { try { JSONObject object = new JSONObject(s); String states = object.getString("status"); if (states.equals("success")) { if (!has_type) { finish(); } else { StartUtil.putLiveType(context, String.valueOf(type)); ToastUtil.show(context, R.string.modify_success); Intent intent = new Intent(); intent.putExtra("type", type); setResult(RESULT_OK, intent); finish(); } } else { ToastUtil.show(context, R.string.modify_failed); } } catch (JSONException e) { e.printStackTrace(); } } @Override public void onError(Call call, Response response, Exception e) { super.onError(call, response, e); e.printStackTrace(); } }); break; } } }
Ext.define('PmhTech.form.field.NumericField', { extend: 'Ext.form.field.Number',//Extending the NumberField alias: 'widget.numericfield',//Defining the xtype, currencySymbol: null, <API key>: true, thousandSeparator: ',', <API key>: false, fieldStyle: 'text-align: right;', initComponent: function () { if (this.<API key> && this.decimalSeparator == ',' && this.thousandSeparator == ',') this.thousandSeparator = '.'; else if (this.allowDecimals && this.thousandSeparator == '.' && this.decimalSeparator == '.') this.decimalSeparator = ','; this.callParent(arguments); }, getSubmitValue: function () { var me = this, value = me.callParent(); if (!me.<API key>) { value = value.replace(me.decimalSeparator, '.'); } value = value.replace(/[^\d]+/g, ''); return value; }, setValue: function (value) { PmhTech.form.field.NumericField.superclass.setValue.call(this, value != null ? value.toString().replace('.', this.decimalSeparator) : value); this.setRawValue(this.getFormattedValue(this.getValue())); }, getFormattedValue: function (value) { if (Ext.isEmpty(value) || !this.hasFormat()) return value; else { var neg = null; value = (neg = value < 0) ? value * -1 : value; value = this.allowDecimals && this.<API key> ? value.toFixed(this.decimalPrecision) : value; if (this.<API key>) { if (this.<API key> && Ext.isEmpty(this.thousandSeparator)) throw ('<API key>: invalid thousandSeparator, property must has a valid character.'); if (this.thousandSeparator == this.decimalSeparator) throw ('<API key>: invalid thousandSeparator, thousand separator must be different from decimalSeparator.'); value = value.toString(); var ps = value.split('.'); ps[1] = ps[1] ? ps[1] : null; var whole = ps[0]; var r = /(\d+)(\d{3})/; var ts = this.thousandSeparator; while (r.test(whole)) whole = whole.replace(r, '$1' + ts + '$2'); value = whole + (ps[1] ? this.decimalSeparator + ps[1] : ''); } return Ext.String.format('{0}{1}{2}', (neg ? '-' : ''), (Ext.isEmpty(this.currencySymbol) ? '' : this.currencySymbol + ' '), value); } }, /** * overrides parseValue to remove the format applied by this class */ parseValue: function (value) { //Replace the currency symbol and thousand separator return PmhTech.form.field.NumericField.superclass.parseValue.call(this, this.removeFormat(value)); }, /** * Remove only the format added by this class to let the superclass validate with it's rules. * @param {Object} value */ removeFormat: function (value) { if (Ext.isEmpty(value) || !this.hasFormat()) return value; else { value = value.toString().replace(this.currencySymbol + ' ', ''); value = this.<API key> ? value.replace(new RegExp('[' + this.thousandSeparator + ']', 'g'), '') : value; return value; } }, /** * Remove the format before validating the the value. * @param {Number} value */ getErrors: function (value) { value = Ext.isDefined(value) ? value : this.getRawValue(); return PmhTech.form.field.NumericField.superclass.getErrors.call(this, this.removeFormat(value)); }, hasFormat: function () { return this.decimalSeparator != '.' || (this.<API key> == true && this.getRawValue() != null) || !Ext.isEmpty(this.currencySymbol) || this.<API key>; }, /** * Display the numeric value with the fixed decimal precision and without the format using the setRawValue, don't need to do a setValue because we don't want a double * formatting and process of the value because beforeBlur perform a getRawValue and then a setValue. */ onFocus: function () { this.setRawValue(this.removeFormat(this.getRawValue())); this.callParent(arguments); } });
package mesosphere.marathon package core.health import mesosphere.UnitTest import mesosphere.marathon.api.v2.json.Formats import mesosphere.marathon.core.event.HealthStatusChanged import mesosphere.marathon.core.instance.Instance import mesosphere.marathon.core.task.Task import mesosphere.marathon.state.{PathId, Timestamp} import play.api.libs.json._ class HealthTest extends UnitTest with Formats { "Health" should { val f = new Fixture import f._ "serialize correctly" in { val j1 = Json.toJson(h1) (j1 \ "instanceId").as[String] should equal (instanceId.idString) (j1 \ "alive").as[Boolean] should equal (false) (j1 \ "consecutiveFailures").as[Int] should equal (0) (j1 \ "firstSuccess").asOpt[String] should equal (None) (j1 \ "lastFailure").asOpt[String] should equal (None) (j1 \ "lastSuccess").asOpt[String] should equal (None) val j2 = Json.toJson(h2) (j2 \ "instanceId").as[String] should equal (instanceId.idString) (j2 \ "alive").as[Boolean] should equal (true) (j2 \ "consecutiveFailures").as[Int] should equal (0) (j2 \ "firstSuccess").as[String] should equal ("1970-01-01T00:00:00.001Z") (j2 \ "lastFailure").as[String] should equal ("1970-01-01T00:00:00.002Z") (j2 \ "lastSuccess").as[String] should equal ("1970-01-01T00:00:00.003Z") val j3 = Json.toJson(h3) (j3 \ "instanceId").as[String] should equal (instanceId.idString) (j3 \ "alive").as[Boolean] should equal (false) (j3 \ "consecutiveFailures").as[Int] should equal (1) (j3 \ "firstSuccess").as[String] should equal ("1970-01-01T00:00:00.001Z") (j3 \ "lastFailure").as[String] should equal ("1970-01-01T00:00:00.003Z") (j3 \ "lastSuccess").as[String] should equal ("1970-01-01T00:00:00.002Z") } } "<API key>" should { "serialize correctly" in { val f = new Fixture val event = HealthStatusChanged( appId = f.appId, instanceId = f.instanceId, version = f.version, alive = true, timestamp = f.now.toString ) val json = Json.toJson(event) println(json.toString()) (json \ "appId").as[String] should equal(f.appId.toString) (json \ "instanceId").as[String] should equal(f.instanceId.idString) (json \ "version").as[String] should equal(f.version.toString) (json \ "alive").as[Boolean] should equal(true) (json \ "eventType").as[String] should equal("<API key>") (json \ "timestamp").as[String] should equal(f.now.toString) } } class Fixture { val appId = PathId("/test") val version = Timestamp(1) val now = Timestamp(2) val instanceId = Instance.Id.forRunSpec(appId) val taskId = Task.Id(instanceId) val h1 = Health(instanceId) val h2 = Health( instanceId = instanceId, consecutiveFailures = 0, firstSuccess = Some(Timestamp(1)), lastSuccess = Some(Timestamp(3)), lastFailure = Some(Timestamp(2)) ) val h3 = Health( instanceId, consecutiveFailures = 1, firstSuccess = Some(Timestamp(1)), lastSuccess = Some(Timestamp(2)), lastFailure = Some(Timestamp(3)) ) } }
var _ = require('underscore'); var models = require('../models'); var url = require('url'); var moment = require('moment'); var calendar = require('node-calendar'); var Task = models.Task; // format special days moment.locale('en', { calendar : { lastDay : 'L', sameDay : 'L', nextDay : 'L', lastWeek : 'L', nextWeek : 'L', sameElse : 'L' } }); // render add task page var makerPage = function(req, res){ Task.TaskModel.findByOwner(req.session.account._id, function(err, docs) { if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } res.render('app', {csrfToken: req.csrfToken()}); }); }; // render display page and do the work for the calendar var displayPage = function(req, res){ Task.TaskModel.findByOwner(req.session.account._id, function(err, docs) { var date, year, month, thisWeek; var index = 0; // If no parameters on URL or not in MMDDYYY form, use today's date if (!req.params.dateParam || req.params.dateParam.length != 8){ date = new Date(); var formatedDate = moment(date).format("L"); req.params.dateParam = formatedDate.replace("/", '').replace("/", ''); } if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } for(var i = 0; i < docs.length; i++){ docs[i] = docs[i].toAPI(); } //Format parameter date back to "ll" var parameterDate = req.params.dateParam.substring(0,2) + "/" + req.params.dateParam.substring(2,4) + "/" + req.params.dateParam.substring(4,8); parameterDate = moment(parameterDate).format("ll"); // Calendar year = req.params.dateParam.substring(4,8); month = req.params.dateParam.substring(0,2); var newMonthAdd = month; var newMonthSub = month; var newYearAdd = year; var newYearSub = year; // Get calendar for current, previous and next month var cal = new calendar.Calendar(calendar.MONDAY).monthdatescalendar(year,month); if (month - 1 < 1){ newMonthSub = 12; newYearSub = year - 1; } else{ newMonthSub newYearSub = year; } var calPrev = new calendar.Calendar(calendar.MONDAY).monthdatescalendar(newYearSub,newMonthSub); if (month + 1 > 12){ newMonthAdd = 1; newYearAdd = year + 1; } else{ newMonthAdd++; newYearAdd = year; } var calNext = new calendar.Calendar(calendar.MONDAY).monthdatescalendar(newYearAdd,newMonthAdd); cal = cal.concat(calPrev); cal = cal.concat(calNext); // Get current week for (var x = 0; x < cal.length; x++){ for (var j = 0; j < 7; j++){ cal[x][j] = moment(cal[x][j]).format("ll"); if(parameterDate == cal[x][j]){ index = x; } } } thisWeek = cal[index]; // dateParam passes the parameter for current, previous and next week // 0: current, 1: prev, 2: next var dateParam = []; dateParam.push( moment(thisWeek[0]).format("L").replace("/", '').replace("/", '')); var prev = moment(thisWeek[0]).subtract(1, 'week').calendar(); dateParam.push(moment(prev).format("L").replace("/", '').replace("/", '')); var next = moment(thisWeek[0]).add(1, 'week').calendar(); dateParam.push(moment(next).format("L").replace("/", '').replace("/", '')); // Get today's date in parameter form var today = moment().format("L").replace("/", '').replace("/", ''); // tasks: all of the user's tasks // calendar: this week's date in ll format (Dec 12, 2015) // currentWeek: this week's date, a week before and a week after in parameter form res.render('display', {csrfToken: req.csrfToken(), tasks: docs, calendar: thisWeek, currentWeek: dateParam, todaysDate: today}); }); }; // render completed tasks page var <API key> = function(req, res){ var completed = []; Task.TaskModel.findByOwner(req.session.account._id, function(err, docs) { if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } // if task is marked as completed, add to array for(var i = 0; i < docs.length; i++){ docs[i] = docs[i].toAPI(); if (docs[i].completed === true){ completed.push(docs[i]); } } res.render('completedTasks', {csrfToken: req.csrfToken(), completedTasks: completed}); }); }; // add a task var makeTask = function(req, res){ if(!req.body.name || !req.body.importance || !req.body.date) { return res.status(400).json({error: "Oops! All fields are required"}); } if(req.body.importance < 1 || req.body.importance > 3){ return res.status(400).json({error: "Oops! Importance must be between 1 and 3"}); } var taskData = { name: req.body.name, importance: req.body.importance, date: req.body.date, owner: req.session.account._id }; var newTask = new Task.TaskModel(taskData); newTask.save(function(err) { if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } req.session.task = newTask.toAPI(); res.json({redirect: '/display'}); }); }; // remove a task and refresh page var removeTask = function(req, res){ Task.TaskModel.findOne({_id: req.params.id}, function(err, doc){ if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } doc.remove(); doc.save(); res.redirect(req.get('referer')); }); }; // remove all tasks marked as completed var clearTasks = function(req, res){ Task.TaskModel.findByOwner(req.session.account._id, function(err, docs) { if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } for(var i = 0; i < docs.length; i++){ if (docs[i].completed === true){ docs[i].remove(); docs[i].save(); } } res.redirect(req.get('referer')); }); }; // mark task as completed var checkTask = function(req, res){ Task.TaskModel.findOne({_id: req.params.id}, function(err, doc){ if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } doc.completed = true; doc.save(); res.redirect(req.get('referer')); }); }; // edit task page var editPage = function(req, res){ Task.TaskModel.findOne({_id: req.params.id}, function(err, doc){ if (err) { console.log(err); return res.status(400).json({error: "An error occurred"}); } doc = doc.toAPI(); doc.date = moment(doc.date).format("ll"); res.render('editTask', {csrfToken: req.csrfToken(), t: doc}); }); }; // edit existing task var editTask = function(req, res){ Task.TaskModel.findOne({_id: req.params.id}, function(err, doc){ if(!req.body.name || !req.body.importance || !req.body.date) { return res.status(400).json({error: "Oops! All fields are required"}); } if(req.body.importance < 1 || req.body.importance > 3){ return res.status(400).json({error: "Oops! Importance must be between 1 and 3"}); } doc.name = req.body.name; doc.importance = req.body.importance; doc.date = req.body.date; doc.save(); res.json({redirect: '/display'}); }); }; module.exports.makerPage = makerPage; module.exports.make = makeTask; module.exports.editPage = editPage; module.exports.edit = editTask; module.exports.removeTask = removeTask; module.exports.clearTasks = clearTasks; module.exports.checkTask = checkTask; module.exports.displayPage = displayPage; module.exports.<API key> = <API key>;
[//]: # (title: Temporary Settings in Tests) The ReSharper test environment will use default values for settings. If your test needs particular values in the settings, you need to set them yourself in the test, and they should be reset at the end of the test. This is important because ReSharper will try to reuse the current project and solution for future tests. The `BaseTest` class provides two methods to help with this: csharp public class BaseTest : BaseTestNoShell { public void <API key>( Action<<API key>> action); public <API key> <API key>(Lifetime lifetime); } Normally, you would use the `<API key>` method. This takes an action that receives an instance of `<API key>`, and your code will use this settings store to temporarily change the settings. Once the action is complete, the changes to the settings are automatically undone. csharp [Test] public void MyTest() { <API key>(store => { // Update settings store.SetValue((<API key> s) => { s.LanguageLevel = CSharpLanguageLevel.CSharp50 }); // Do test }); } ## Advanced Usage The `<API key>` method does all of the work. It creates an instance of `<API key>` using the `Lifetime` you pass in. It creates a new in-memory settings layer with a very high priority, which means it overrides all other layers (project, solution, global), and any writes against the settings store will go to this temporary layer. The layer is created with the given `Lifetime` instance, and when the `Lifetime` terminates, the layer is automatically removed and cleaned up. Should you need it, you can get access to the layer's storage from the returned instance of `<API key>`. The `<API key>` method makes this an easier API to consume. It creates a new `Lifetime` instance, calls `<API key>` and then gets a bound settings store accessor which it uses in a call to the passed in action. Once the action completes, the `Lifetime` is terminated, which cleans up the store accessor, and the instance of `<API key>`, and therefore removes the temporary settings layer.
<include file="public:header"/> <script src="/static/default/wap/js/star.js"></script> <link rel="stylesheet" type="text/css" href="/static/default/wap/other/webuploader.css"> <script src="/static/default/wap/other/webuploader.js"></script> <style>.list-media-x {margin-top: 0.0rem;}</style> <header class="top-fixed bg-yellow bg-inverse"> <div class="top-back"> <a class="top-addr" href="javascript:history.back(-1);"><i class="icon-angle-left"></i></a> </div> <div class="top-title"> </div> <div class="top-signed"> <include file="public:message"/> </div> </header> <form method="post" action="<{:U('',array('shop_id'=>$detail['shop_id']))}>" target="x-frame"> <div class="line padding"> <div class="x12"> <p class="margin-small-bottom text-gray"><span> “<{$detail.shop_name}>”</p> </div> </div> <div class="blank-10 bg"></div> <div class="list-media-x" id="list-media"> <ul> <div class="line padding border-bottom"> <div class="x3"> <img src="__ROOT__/attachs/<{$detail['photo']}>" width="90%"> </div> <div class="x9"> <p><{$detail.shop_name}></p> <p class="text-gray"><{$detail.d}></p> <p class="text-gray"><{$detail.addr}></p> </div> </div> </ul> </div> <div class="blank-10 bg"></div> <div class="line padding border-bottom"> <div class="x3"> </div> <div class="x9"> <span id="jq_star"></span> </div> </div> <div class="line padding border-bottom"> <div class="x3"> <{$cate['d1']}> </div> <div class="x9"> <span id="jq_star1"></span> </div> </div> <div class="line padding border-bottom"> <div class="x3"> <{$cate['d2']}> </div> <div class="x9"> <span id="jq_star2"></span> </div> </div> <div class="line padding border-bottom"> <div class="x3"> <{$cate['d3']}> </div> <div class="x9"> <span id="jq_star3"></span> </div> </div> <div class="blank-10 bg"></div> <script> $(document).ready(function () { $("#jq_star").raty({ numberMax: 5, path: '/static/default/wap/image/', starOff: 'star-off.png', starOn: 'star-on.png', scoreName: 'data[score]' }); $("#jq_star1").raty({ numberMax: 5, path: '/static/default/wap/image/', starOff: 'star-off.png', starOn: 'star-on.png', scoreName: 'data[d1]' }); $("#jq_star2").raty({ numberMax: 5, path: '/static/default/wap/image/', starOff: 'star-off.png', starOn: 'star-on.png', scoreName: 'data[d2]' }); $("#jq_star3").raty({ numberMax: 5, path: '/static/default/wap/image/', starOff: 'star-off.png', starOn: 'star-on.png', scoreName: 'data[d3]' }); }); </script> <div class="line padding border-bottom"> <div class="x3"> </div> <div class="x9"> <input type="text" name="data[cost]" style="width:80px;" /> </div> </div> <div class="blank-10 bg"></div> <div class="line padding "> <div class="blank-10"></div> <textarea cols="33" rows="5" name="data[contents]" placeholder="" style="border:thin solid #eee;width:100%;resize:none;padding:10px;"></textarea> <div class="blank-10"></div> </div> <div class="blank-10 bg"></div> <div class="line padding "> <div class="x3"> </div> </div> <div class="blank-10"></div> <div class="Upload-img-box"> <div class="Upload-btn"><input type="file" id="fileToUpload" name="fileToUpload" ></div> <div class="Upload-img" id="jq_imgs"> </div> <script type="text/javascript" src="/static/default/wap/js/ajaxfileupload.js"></script> <script> function ajaxupload() { $.ajaxFileUpload({ url: '<{:U("app/upload/upload",array("model"=>"dianping"))}>', type: 'post', fileElementId: 'fileToUpload', dataType: 'text', secureuri: false, //false success: function (data, status) { var str = '<div class="list-img"><img width="200" height="100" src="__ROOT__/attachs/' + data + '"> <input type="hidden" name="photos[]" value="' + data + '" /> <a href="javascript:void(0);"></a></div>'; $("#jq_imgs").append(str); $("#fileToUpload").unbind('change'); $("#fileToUpload").change(function () { ajaxupload(); }); } }); } $(document).ready(function () { $("#fileToUpload").change(function () { ajaxupload(); }); $(document).on("click", "#jq_imgs a", function () { $(this).parent().remove(); }); }); </script> </div> <div class="container"> <div class="blank-20"></div> <button class="button button-big button-block bg-dot"></button> <div class="blank-20"></div> </div> </form> <include file='public:footer'/>
# Byssosphaeria rhodomphala (Berk.) Cooke, 1887 SPECIES # Status ACCEPTED # According to The Catalogue of Life, 3rd January 2011 # Published in Grevillea 15(no. 75): 81 (1887) # Original name Sphaeria rhodomphala Berk., 1845 Remarks null
# Contributing to missinglink First of all, thanks for the interest in missinglink! :clap: As mentioned in the README, this project is very young and not mature yet. It was built during a Hack Week at Spotify to attempt to catch a certain type of dependency conflict with Maven projects that the authors had bad experiences with. ## Submitting issues We'd like for it to be able to catch lots of other types of conflicts but there are a lot of scenarios we have not encountered or will be able to test, so any and all feedback is appreciated. To report any issues or share feedback you have, please create [an issue on Github][github-issues]. We'd like to hear about false positives that this tool reports for you, or conflicts that it seems like *should* be caught but weren't. [github-issues]: https://github.com/spotify/missinglink/issues ## Building the project With Java 8+ and Maven 3+, simply run `mvn install` in the project directory. For any patches, please make sure that they pass all tests (and that new tests are added). Code will be automatically formatted by <https://github.com/coveooss/fmt-maven-plugin> when you run `mvn compile`. The CI build will fail if any code is not formatted according to the plugin's rules. New code should be accompanied by tests that increase the overall code coverage of the project. ## Additional documentation - [ASM][asm] is used to read the bytecode of Java classfiles - [auto-matter][] is used to generate "value classes" for missinglink's data model - [Reference on Maven plugin development][maven-plugins] [asm]: http://asm.ow2.org/ [maven-plugins]: https://maven.apache.org/guides/plugin/<API key>.html [auto-matter]: https://github.com/danielnorberg/auto-matter
package batfish.representation.juniper; import java.io.Serializable; public class GenerateRoute implements Serializable { private static final long serialVersionUID = 1L; private String _prefix; private int _prefixLength; private String _policy; private int _preference; public GenerateRoute(String prefix, int prefixLength, String policy, int distance) { _prefix = prefix; _prefixLength = prefixLength; _policy = policy; _preference = distance; } public void setPolicy(String p){ _policy = p; } public String getPrefix() { return _prefix; } public int getPrefixLength() { return _prefixLength; } public String getPolicy() { return _policy; } public int getPreference() { return _preference; } }
# This file contains the Ruby code from Program 10.11 of # "Data Structures and Algorithms # with Object-Oriented Design Patterns in Ruby" # by Bruno R. Preiss. class AVLTree < BinarySearchTree def attachKey(obj) raise StateError if not empty? @key = obj @left = AVLTree.new @right = AVLTree.new @height = 0 end end
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http: <html xmlns="http: <head> <title>attribute_methods.rb</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="../../../../../../../../../../../../../../../css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../../../../../../../../../../../../../css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../../../../../../../../../../../../../css/github.css" type="text/css" media="screen" /> <script src="../../../../../../../../../../../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="../../../../../../../../../../../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script> <script src="../../../../../../../../../../../../../../../js/main.js" type="text/javascript" charset="utf-8"></script> <script src="../../../../../../../../../../../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script> </head> <body> <div class="banner"> <span>Ruby on Rails 4.2.1</span><br /> <h1> attribute_methods.rb </h1> <ul class="files"> <li> ../../../.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/attribute_methods.rb </li> <li>Last modified: 2015-04-15 16:46:17 +0800</li> </ul> </div> <div id="bodyContent"> <div id="content"> <!-- File only: requires --> <div class="sectiontitle">Required Files</div> <ul> <li>active_support/core_ext/enumerable</li> <li>active_support/core_ext/string/filters</li> <li>mutex_m</li> <li>thread_safe</li> </ul> <!-- Namespace --> <div class="sectiontitle">Namespace</div> <ul> <li> <span class="type">MODULE</span> <a href="../../../../../../../../../../../../../../../classes/ActiveRecord.html">ActiveRecord</a> </li> <li> <span class="type">MODULE</span> <a href="../../../../../../../../../../../../../../../classes/ActiveRecord/AttributeMethods.html">ActiveRecord::AttributeMethods</a> </li> <li> <span class="type">MODULE</span> <a href="../../../../../../../../../../../../../../../classes/ActiveRecord/AttributeMethods/ClassMethods.html">ActiveRecord::AttributeMethods::ClassMethods</a> </li> <li> <span class="type">MODULE</span> <a href="../../../../../../../../../../../../../../../classes/ActiveSupport.html">ActiveSupport</a> </li> <li> <span class="type">CLASS</span> <a href="../../../../../../../../../../../../../../../classes/ActiveRecord/AttributeMethods/<API key>.html">ActiveRecord::AttributeMethods::<API key></a> </li> </ul> <!-- Methods --> </div> </div> </body> </html>
package com.raycoarana.awex; import com.raycoarana.awex.transform.Filter; public class <API key><Result, Progress> extends <API key><Result, Result, Progress> { public <API key>(Awex awex, CollectionPromise<Result, Progress> promise, final Filter<Result> filter) { super(awex, promise, new Apply<Result, Result>() { @Override public boolean shouldApply(Result item) { return filter.filter(item); } @Override public Result apply(Result item) { return item; } }); } }
package com.github.bingoohuang.utils.proxy; import lombok.SneakyThrows; import org.springframework.cglib.proxy.Enhancer; import org.springframework.cglib.proxy.MethodInterceptor; import java.lang.reflect.Method; import java.lang.reflect.Proxy; public class Adapter { @SuppressWarnings("unchecked") public static <T> T adapt(Object obj, Class<? extends T> target) { return (T) (target.isAssignableFrom(obj.getClass()) ? obj : target.isInterface() ? Proxy.newProxyInstance(target.getClassLoader(), new Class[]{target}, (p, m, args) -> adapt(obj, m, args)) : Enhancer.create(target, new Class[]{}, (MethodInterceptor) (o, m, args, p) -> adapt(obj, m, args))); } @SneakyThrows public static Object adapt(Object obj, Method adapted, Object[] args) { return findAdapted(obj, adapted).invoke(obj, args); } @SneakyThrows public static Method findAdapted(Object obj, Method adapted) { return obj.getClass().getMethod(adapted.getName(), adapted.getParameterTypes()); } }
using System.Runtime.Serialization; namespace Fluidity.Web.Models { [DataContract(Name = "section", Namespace = "")] public class <API key> { [DataMember(Name = "alias", IsRequired = true)] public object Alias { get; set; } [DataMember(Name = "name", IsRequired = true)] public object Name { get; set; } [DataMember(Name = "tree", IsRequired = true)] public object Tree { get; set; } } }
using System.Collections.Generic; namespace FoodOrdering.WEB.Models.ViewModels { public class <API key> { public string SelectedProvider { get; set; } public ICollection<System.Web.Mvc.SelectListItem> Providers { get; set; } } }
using Neptuo.Models; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Money { <summary> An exception raised when a currency to delete is set as default. </summary> public class <API key> : <API key> { } }
\setcounter{footnote}{0} 1. Let us reflect together on the story of a group of rich men who made offerings to God and of a certain widow who offered money to God. 2 This story which I would like to impart to you, my brothers, is to be found in Mark 12:41-44.1 3 A second passage is to be found in Luke 6:38.2 4 And a third passage is contained in II Corinthians 9:6-7.3 5. This book of the Bible4 has many \{places / passages\} which are full of meaning.5 6. Therefore, please listen carefully to this story about offering money to God in the temple. 7. When Jesus was living on the earth, there was a certain very poor widow in the city of Jerusalem. 8 Her husband had died long before. 9 She had to seek her own living, and though she did her utmost, [her] money was never enough to gain her food and drink [or] to clothe and garb herself, so she would go hungry and suffer. 10. This woman, despite the fact that she was so wretched, had not forgotten God. She would go up to the temple6 as was fitting,7 and not only did she praise Him, but every day she would pray8 fervently7 to God. 11. "One day this widow went to the great Temple to contribute and donate an offering of money. 12 For her offering she gave a great deal of money--er, rather, she \textit{could not} give a great deal of money, but she took all the money she did have and went to offer it--went to offer it to Him. 13 When she prayed--er, when she arrived at the Temple, she saw a group of rich men9 putting great sums of money into the offering-box, and her heart was downcast. 14 She wanted to offer lots of money just like them, but she didn't have anything to give. 15 She only had two small coins.10 16 Those two small coins were only worth a farthing a piece.11 17. When the woman put the two small coins in the offering-box--into the offering-box--Jesus saw it. 18 He also saw the group of rich men offering great sums of money. 19 Then he said to his disciples: 20 "More than all the people who have put [money] into the offering-place--er, into the offering-box--this poor and wretched widow has put the most of all."
package com.marathon.manage.refactor.pojo; import java.util.ArrayList; import java.util.List; public class CttimesInfoExample { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; public CttimesInfoExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = <API key>(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = <API key>(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria <API key>() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } protected abstract static class GeneratedCriteria { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andIdIsNull() { addCriterion("id is null"); return (Criteria) this; } public Criteria andIdIsNotNull() { addCriterion("id is not null"); return (Criteria) this; } public Criteria andIdEqualTo(Integer value) { addCriterion("id =", value, "id"); return (Criteria) this; } public Criteria andIdNotEqualTo(Integer value) { addCriterion("id <>", value, "id"); return (Criteria) this; } public Criteria andIdGreaterThan(Integer value) { addCriterion("id >", value, "id"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("id >=", value, "id"); return (Criteria) this; } public Criteria andIdLessThan(Integer value) { addCriterion("id <", value, "id"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("id <=", value, "id"); return (Criteria) this; } public Criteria andIdIn(List<Integer> values) { addCriterion("id in", values, "id"); return (Criteria) this; } public Criteria andIdNotIn(List<Integer> values) { addCriterion("id not in", values, "id"); return (Criteria) this; } public Criteria andIdBetween(Integer value1, Integer value2) { addCriterion("id between", value1, value2, "id"); return (Criteria) this; } public Criteria andIdNotBetween(Integer value1, Integer value2) { addCriterion("id not between", value1, value2, "id"); return (Criteria) this; } public Criteria andLocationIsNull() { addCriterion("Location is null"); return (Criteria) this; } public Criteria <API key>() { addCriterion("Location is not null"); return (Criteria) this; } public Criteria andLocationEqualTo(String value) { addCriterion("Location =", value, "location"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Location <>", value, "location"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Location >", value, "location"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Location >=", value, "location"); return (Criteria) this; } public Criteria andLocationLessThan(String value) { addCriterion("Location <", value, "location"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Location <=", value, "location"); return (Criteria) this; } public Criteria andLocationLike(String value) { addCriterion("Location like", value, "location"); return (Criteria) this; } public Criteria andLocationNotLike(String value) { addCriterion("Location not like", value, "location"); return (Criteria) this; } public Criteria andLocationIn(List<String> values) { addCriterion("Location in", values, "location"); return (Criteria) this; } public Criteria andLocationNotIn(List<String> values) { addCriterion("Location not in", values, "location"); return (Criteria) this; } public Criteria andLocationBetween(String value1, String value2) { addCriterion("Location between", value1, value2, "location"); return (Criteria) this; } public Criteria <API key>(String value1, String value2) { addCriterion("Location not between", value1, value2, "location"); return (Criteria) this; } public Criteria andTagIsNull() { addCriterion("Tag is null"); return (Criteria) this; } public Criteria andTagIsNotNull() { addCriterion("Tag is not null"); return (Criteria) this; } public Criteria andTagEqualTo(String value) { addCriterion("Tag =", value, "tag"); return (Criteria) this; } public Criteria andTagNotEqualTo(String value) { addCriterion("Tag <>", value, "tag"); return (Criteria) this; } public Criteria andTagGreaterThan(String value) { addCriterion("Tag >", value, "tag"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Tag >=", value, "tag"); return (Criteria) this; } public Criteria andTagLessThan(String value) { addCriterion("Tag <", value, "tag"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Tag <=", value, "tag"); return (Criteria) this; } public Criteria andTagLike(String value) { addCriterion("Tag like", value, "tag"); return (Criteria) this; } public Criteria andTagNotLike(String value) { addCriterion("Tag not like", value, "tag"); return (Criteria) this; } public Criteria andTagIn(List<String> values) { addCriterion("Tag in", values, "tag"); return (Criteria) this; } public Criteria andTagNotIn(List<String> values) { addCriterion("Tag not in", values, "tag"); return (Criteria) this; } public Criteria andTagBetween(String value1, String value2) { addCriterion("Tag between", value1, value2, "tag"); return (Criteria) this; } public Criteria andTagNotBetween(String value1, String value2) { addCriterion("Tag not between", value1, value2, "tag"); return (Criteria) this; } public Criteria andTimeIsNull() { addCriterion("Time is null"); return (Criteria) this; } public Criteria andTimeIsNotNull() { addCriterion("Time is not null"); return (Criteria) this; } public Criteria andTimeEqualTo(String value) { addCriterion("Time =", value, "time"); return (Criteria) this; } public Criteria andTimeNotEqualTo(String value) { addCriterion("Time <>", value, "time"); return (Criteria) this; } public Criteria andTimeGreaterThan(String value) { addCriterion("Time >", value, "time"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Time >=", value, "time"); return (Criteria) this; } public Criteria andTimeLessThan(String value) { addCriterion("Time <", value, "time"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Time <=", value, "time"); return (Criteria) this; } public Criteria andTimeLike(String value) { addCriterion("Time like", value, "time"); return (Criteria) this; } public Criteria andTimeNotLike(String value) { addCriterion("Time not like", value, "time"); return (Criteria) this; } public Criteria andTimeIn(List<String> values) { addCriterion("Time in", values, "time"); return (Criteria) this; } public Criteria andTimeNotIn(List<String> values) { addCriterion("Time not in", values, "time"); return (Criteria) this; } public Criteria andTimeBetween(String value1, String value2) { addCriterion("Time between", value1, value2, "time"); return (Criteria) this; } public Criteria andTimeNotBetween(String value1, String value2) { addCriterion("Time not between", value1, value2, "time"); return (Criteria) this; } public Criteria andLapIsNull() { addCriterion("Lap is null"); return (Criteria) this; } public Criteria andLapIsNotNull() { addCriterion("Lap is not null"); return (Criteria) this; } public Criteria andLapEqualTo(Integer value) { addCriterion("Lap =", value, "lap"); return (Criteria) this; } public Criteria andLapNotEqualTo(Integer value) { addCriterion("Lap <>", value, "lap"); return (Criteria) this; } public Criteria andLapGreaterThan(Integer value) { addCriterion("Lap >", value, "lap"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Lap >=", value, "lap"); return (Criteria) this; } public Criteria andLapLessThan(Integer value) { addCriterion("Lap <", value, "lap"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Lap <=", value, "lap"); return (Criteria) this; } public Criteria andLapIn(List<Integer> values) { addCriterion("Lap in", values, "lap"); return (Criteria) this; } public Criteria andLapNotIn(List<Integer> values) { addCriterion("Lap not in", values, "lap"); return (Criteria) this; } public Criteria andLapBetween(Integer value1, Integer value2) { addCriterion("Lap between", value1, value2, "lap"); return (Criteria) this; } public Criteria andLapNotBetween(Integer value1, Integer value2) { addCriterion("Lap not between", value1, value2, "lap"); return (Criteria) this; } public Criteria andReaderIsNull() { addCriterion("Reader is null"); return (Criteria) this; } public Criteria andReaderIsNotNull() { addCriterion("Reader is not null"); return (Criteria) this; } public Criteria andReaderEqualTo(String value) { addCriterion("Reader =", value, "reader"); return (Criteria) this; } public Criteria andReaderNotEqualTo(String value) { addCriterion("Reader <>", value, "reader"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Reader >", value, "reader"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Reader >=", value, "reader"); return (Criteria) this; } public Criteria andReaderLessThan(String value) { addCriterion("Reader <", value, "reader"); return (Criteria) this; } public Criteria <API key>(String value) { addCriterion("Reader <=", value, "reader"); return (Criteria) this; } public Criteria andReaderLike(String value) { addCriterion("Reader like", value, "reader"); return (Criteria) this; } public Criteria andReaderNotLike(String value) { addCriterion("Reader not like", value, "reader"); return (Criteria) this; } public Criteria andReaderIn(List<String> values) { addCriterion("Reader in", values, "reader"); return (Criteria) this; } public Criteria andReaderNotIn(List<String> values) { addCriterion("Reader not in", values, "reader"); return (Criteria) this; } public Criteria andReaderBetween(String value1, String value2) { addCriterion("Reader between", value1, value2, "reader"); return (Criteria) this; } public Criteria andReaderNotBetween(String value1, String value2) { addCriterion("Reader not between", value1, value2, "reader"); return (Criteria) this; } public Criteria andGatorIsNull() { addCriterion("Gator is null"); return (Criteria) this; } public Criteria andGatorIsNotNull() { addCriterion("Gator is not null"); return (Criteria) this; } public Criteria andGatorEqualTo(Integer value) { addCriterion("Gator =", value, "gator"); return (Criteria) this; } public Criteria andGatorNotEqualTo(Integer value) { addCriterion("Gator <>", value, "gator"); return (Criteria) this; } public Criteria andGatorGreaterThan(Integer value) { addCriterion("Gator >", value, "gator"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Gator >=", value, "gator"); return (Criteria) this; } public Criteria andGatorLessThan(Integer value) { addCriterion("Gator <", value, "gator"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Gator <=", value, "gator"); return (Criteria) this; } public Criteria andGatorIn(List<Integer> values) { addCriterion("Gator in", values, "gator"); return (Criteria) this; } public Criteria andGatorNotIn(List<Integer> values) { addCriterion("Gator not in", values, "gator"); return (Criteria) this; } public Criteria andGatorBetween(Integer value1, Integer value2) { addCriterion("Gator between", value1, value2, "gator"); return (Criteria) this; } public Criteria andGatorNotBetween(Integer value1, Integer value2) { addCriterion("Gator not between", value1, value2, "gator"); return (Criteria) this; } public Criteria andSequenceIsNull() { addCriterion("Sequence is null"); return (Criteria) this; } public Criteria <API key>() { addCriterion("Sequence is not null"); return (Criteria) this; } public Criteria andSequenceEqualTo(Integer value) { addCriterion("Sequence =", value, "sequence"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Sequence <>", value, "sequence"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Sequence >", value, "sequence"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Sequence >=", value, "sequence"); return (Criteria) this; } public Criteria andSequenceLessThan(Integer value) { addCriterion("Sequence <", value, "sequence"); return (Criteria) this; } public Criteria <API key>(Integer value) { addCriterion("Sequence <=", value, "sequence"); return (Criteria) this; } public Criteria andSequenceIn(List<Integer> values) { addCriterion("Sequence in", values, "sequence"); return (Criteria) this; } public Criteria andSequenceNotIn(List<Integer> values) { addCriterion("Sequence not in", values, "sequence"); return (Criteria) this; } public Criteria andSequenceBetween(Integer value1, Integer value2) { addCriterion("Sequence between", value1, value2, "sequence"); return (Criteria) this; } public Criteria <API key>(Integer value1, Integer value2) { addCriterion("Sequence not between", value1, value2, "sequence"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria { protected Criteria() { super(); } } public static class Criterion { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
#pragma once #include <aws/keyspaces/Keyspaces_EXPORTS.h> #include <aws/core/utils/memory/stl/AWSString.h> namespace Aws { namespace Keyspaces { namespace Model { enum class TimeToLiveStatus { NOT_SET, ENABLED }; namespace <API key> { AWS_KEYSPACES_API TimeToLiveStatus <API key>(const Aws::String& name); AWS_KEYSPACES_API Aws::String <API key>(TimeToLiveStatus value); } // namespace <API key> } // namespace Model } // namespace Keyspaces } // namespace Aws
package org.liuyichen.dribsearch.sample; import android.graphics.Color; import android.os.Bundle; import android.support.v7.app.ActionBarActivity; import android.support.v7.widget.Toolbar; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.widget.EditText; import com.balysv.materialmenu.<API key>; import org.liuyichen.dribsearch.DribSearchView; import static org.liuyichen.dribsearch.DribSearchView.OnChangeListener; import static org.liuyichen.dribsearch.DribSearchView.State; public class MainActivity extends ActionBarActivity { DribSearchView dribSearchView; private <API key> materialMenu; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); final EditText editview = (EditText) findViewById(R.id.editview); dribSearchView = (DribSearchView) findViewById(R.id.dribSearchView); dribSearchView.<API key>(new DribSearchView.<API key>() { @Override public void onClickSearch() { dribSearchView.changeLine(); materialMenu.animateIconState(<API key>.IconState.ARROW, true); } }); dribSearchView.setOnChangeListener(new OnChangeListener() { @Override public void onChange(State state) { switch (state) { case LINE: editview.setVisibility(View.VISIBLE); editview.setFocusable(true); editview.<API key>(true); editview.requestFocus(); break; case SEARCH: editview.setVisibility(View.GONE); break; } } }); toolbar.<API key>(new View.OnClickListener() { @Override public void onClick(View v) { dribSearchView.changeSearch(); materialMenu.animateIconState(<API key>.IconState.BURGER, true); } }); materialMenu = new <API key>(this, Color.WHITE, <API key>.Stroke.EXTRA_THIN); toolbar.setNavigationIcon(materialMenu); materialMenu.setNeverDrawTouch(true); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } @Override public boolean <API key>(MenuItem item) { // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); //noinspection <API key> if (id == R.id.action_settings) { return true; } return super.<API key>(item); } }
/*! \addtogroup SEMAPHORE * @{ * */ /*! \file */ #include <errno.h> #include <fcntl.h> #include <unistd.h> #include <string.h> #include <stdlib.h> #include <stdarg.h> #include "sysfs.h" #include "semaphore.h" #include "../sched/sched_flags.h" #include "hwpl/debug.h" #define <API key> 0x1285ABC8 #define <API key> (~<API key>) typedef struct { uint32_t signature; uint32_t not_signature; sem_t * sem; } sem_file_hdr_t; typedef struct { sem_t sem; void * next; } sem_list_t; static void priv_sem_wait(void * args); static int check_initialized(sem_t * sem); typedef struct { sem_t * sem; int id; int new_thread; int ret; } priv_sem_t; static sem_list_t * sem_first = 0; static sem_t * sem_find_named(const char * name){ sem_list_t * entry; for(entry = sem_first; entry != 0; entry = entry->next){ if( entry->sem.is_initialized != 0 ){ if( strncmp(entry->sem.name, name, NAME_MAX) == 0 ){ return &entry->sem; } } } return SEM_FAILED; } static sem_t * sem_find_free(void){ sem_list_t * entry; sem_list_t * new_entry; sem_list_t * last_entry; last_entry = 0; for(entry = sem_first; entry != 0; entry = entry->next){ last_entry = entry; if( entry->sem.is_initialized == 0 ){ return &entry->sem; } } //no free semaphores new_entry = _malloc_r(task_table[0].global_reent, sizeof(sem_list_t)); if( new_entry == 0 ){ return SEM_FAILED; } if( last_entry == 0 ){ sem_first = new_entry; } else { last_entry->next = new_entry; } new_entry->next = 0; return &new_entry->sem; } static void priv_sem_post(void * args); static void priv_sem_trywait(void * args); typedef struct { sem_t * sem; struct sched_timeval interval; } <API key>; static void priv_sem_timedwait(void * args); /*! \details This function initializes \a sem as an unnamed semaphore with * \a pshared and \a value. * * \return Zero on success or -1 with errno (see \ref ERRNO) set to: * - EINVAL: sem is NULL * */ int sem_init(sem_t *sem, int pshared, unsigned int value){ if ( sem == NULL ){ errno = EINVAL; return -1; } sem->is_initialized = 1; sem->value = value; sem->pshared = pshared; sem->pid = getpid(); memset(sem->name, 0, NAME_MAX); //This is an unnamed semaphore return 0; } /*! \details This function destroys \a sem--an unnamed semaphore. * * \return Zero on success or -1 with errno (see \ref ERRNO) set to: * - EINVAL: sem is NULL * */ int sem_destroy(sem_t *sem){ if ( check_initialized(sem) < 0 ){ return -1; } sem->is_initialized = 0; return 0; } /*! \details This function gets the value of the semaphore. If the semaphore is locked, * the value is zero. * * \return Zero on success or -1 with errno (see \ref ERRNO) set to: * - EINVAL: sem is NULL * */ int sem_getvalue(sem_t *sem, int *sval){ if ( check_initialized(sem) < 0 ){ return -1; } *sval = sem->value; return 0; } /*! \details This function opens or creates a named semaphore. * * \param name The name of the message queue * \param oflag The flags to use when opening (O_CREAT, O_EXCL, O_RDWR) * * When using O_CREAT, the third argument is the mode and the fourth is * the initial value of the semaphore: * \code * sem_t * sem_open(const char * name, int oflag, int mode, int value){ * \endcode * * \return Zero on success or SEM_FAILED with errno (see \ref ERRNO) set to: * - ENAMETOOLONG: name length is greater than NAME_MAX * - EEXIST: O_CREAT and O_EXCL are set in \a oflag but the semaphore already exists * - ENOENT: O_CREAT is not set in \a oflag and the semaphore does not exist * - ENOMEM: not enough memory for the semaphore * */ sem_t * sem_open(const char * name, int oflag, ...){ sem_t * new_sem; mode_t mode; unsigned value; int action; va_list ap; if ( strnlen(name, NAME_MAX) == NAME_MAX ){ errno = ENAMETOOLONG; return SEM_FAILED; } //Check to see if the semaphore exists new_sem = sem_find_named(name); //Check the flags to determine the appropriate action if ( oflag & O_CREAT ){ if ( oflag & O_EXCL ){ if ( new_sem == 0 ){ //Create the new semaphore action = 0; } else { errno = EEXIST; return SEM_FAILED; } } else { if ( new_sem == 0 ){ //Create a new semaphore action = 0; } else { //Read the existing semaphore action = 1; } } } else { if ( new_sem == 0 ){ errno = ENOENT; return SEM_FAILED; } else { //Read the existing semaphore action = 1; } } switch(action){ case 0: //Create the new semaphore new_sem = sem_find_free(); if ( new_sem == NULL ){ //errno is set by malloc return SEM_FAILED; } va_start(ap, oflag); mode = va_arg(ap, mode_t); value = va_arg(ap, unsigned); va_end(ap); new_sem->is_initialized = 1; new_sem->value = value; new_sem->references = 1; new_sem->mode = mode; strncpy(new_sem->name, name, NAME_MAX-1); break; case 1: //use the existing semaphore new_sem->references++; break; } return new_sem; } /*! \details This function closes a semaphore. The semaphore * must be deleted using sem_unlink() in order to free the system resources * associated with the semaphore. * * \return Zero on success or SEM_FAILED with errno (see \ref ERRNO) set to: * - EINVAL: sem is NULL * */ int sem_close(sem_t *sem){ if ( check_initialized(sem) < 0 ){ return -1; } if( sem->references > 0 ){ sem->references } if ( sem->references == 0 ){ if( sem->is_initialized == 2 ){ //Close and delete sem->is_initialized = 0; return 0; } } return 0; } void priv_sem_post(void * args){ int id = *((int*)args); sched_table[id].block_object = NULL; <API key>(id, <API key>); <API key>( sched_table[id].priority ); } /*! \details This function unlocks (increments) the value of * the semaphore. * * * \return Zero on success or SEM_FAILED with errno (see \ref ERRNO) set to: * - EINVAL: sem is NULL * - EACCES: process cannot access semaphore * */ int sem_post(sem_t *sem){ int new_thread; if ( check_initialized(sem) < 0 ){ return -1; } //unlock the semaphore -- increment the semaphore sem->value++; //see if any tasks are blocked on this semaphore new_thread = <API key>(sem); if ( new_thread != -1 ){ hwpl_core_privcall(priv_sem_post, &new_thread); } return 0; } void priv_sem_timedwait(void * args){ <API key> * argsp = (<API key>*)args; if ( argsp->sem->value <= 0 ){ <API key>(argsp->sem, &argsp->interval); } argsp->sem->value } /*! \details This function waits to lock (decrement) the semaphore until the * value of \a CLOCK_REALTIME exceeds the value of \a abs_timeout. * * \return Zero on success or SEM_FAILED with errno (see \ref ERRNO) set to: * - EINVAL: sem is NULL * - EACCES: process cannot access semaphore * - ETIMEDOUT: timeout expired without locking the semaphore * */ int sem_timedwait(sem_t * sem, const struct timespec * abs_timeout){ //timed wait <API key> args; if ( check_initialized(sem) < 0 ){ return -1; } args.sem = sem; <API key>(&args.interval, abs_timeout); hwpl_core_privcall(priv_sem_timedwait, &args); //Check for a timeout or a lock if ( <API key>(task_get_current()) == SCHED_UNBLOCK_SLEEP){ //The timeout expired sem->value++; //lock is aborted errno = ETIMEDOUT; return -1; } return 0; } void priv_sem_trywait(void * args){ priv_sem_t * p = (priv_sem_t*)args; if ( p->sem->value > 0 ){ p->sem->value p->ret = 0; } else { errno = EAGAIN; p->ret = -1; } } /*! \details This function locks (decrements) the semaphore if it can be locked * immediately. * * \return Zero on success or -1 with errno (see \ref ERRNO) set to: * - EINVAL: sem is NULL * - EACCES: process cannot access semaphore * - EAGAIN: \a sem could not be immediately locked. * */ int sem_trywait(sem_t *sem){ priv_sem_t args; if ( check_initialized(sem) < 0 ){ return -1; } args.sem = sem; hwpl_core_privcall(priv_sem_trywait, &args); return args.ret; } /*! \details This function unlinks a named semaphore. It * also releases any system resources associated with the semaphore. * * \return Zero on success or SEM_FAILED with errno (see \ref ERRNO) set to: * - ENOENT: the semaphore with \a name could not be found * - ENAMETOOLONG: the length of \a name exceeds \a NAME_MAX * */ int sem_unlink(const char *name){ sem_t * sem; if ( strnlen(name, NAME_MAX) == NAME_MAX ){ errno = ENAMETOOLONG; return -1; } sem = sem_find_named(name); if( sem == SEM_FAILED ){ errno = ENOENT; return -1; } if ( check_initialized(sem) < 0 ){ return -1; } if ( sem->references == 0 ){ //Close and delete sem->is_initialized = 0; return 0; } else { //Close but don't delete until all references are gone sem->is_initialized = 2; return 0; } return -1; } void priv_sem_wait(void * args){ sem_t * sem = (sem_t*)args; sched_table[ task_get_current() ].block_object = args; if ( sem->value <= 0){ //task must be blocked until the semaphore is available <API key>( task_get_current() ); <API key>(); } sem->value } /*! \details This function locks (decrements) the semaphore. If * the semaphore is already zero (and therefore cannot be locked), * the calling thread blocks until the semaphore becomes available. * * \return Zero on success or SEM_FAILED with errno (see \ref ERRNO) set to: * - EINVAL: \a sem is NULL * - EACCES: \a sem is not pshared and was created in another process * */ int sem_wait(sem_t *sem){ if ( check_initialized(sem) < 0 ){ return -1; } hwpl_core_privcall(priv_sem_wait, sem); return 0; } int check_initialized(sem_t * sem){ if( sem == NULL ){ errno = EINVAL; return -1; } if ( sem->is_initialized == 0 ){ errno = EINVAL; return -1; } if ( (sem->pshared == 0) && (task_get_pid(task_get_current())) != sem->pid ){ errno = EACCES; return -1; } return 0; }
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class <API key> extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('wz_user_group_ref', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id', false, true)->comment('ID'); $table->integer('group_id', false, true)->comment('ID'); $table->tinyInteger('privilege', false, true)->nullable()->comment(''); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('wz_user_group_ref'); } }
package com.wecan.xhin.baselib.rx; import android.app.ProgressDialog; import android.support.v4.widget.SwipeRefreshLayout; import rx.Observable; import rx.functions.Action0; import rx.functions.Action1; public class RxNetworking { public static <T> Observable.Transformer<T, T> bindRefreshing(final SwipeRefreshLayout srl) { return new Observable.Transformer<T, T>() { @Override public Observable<T> call(Observable<T> original) { return original.doOnSubscribe(new Action0() { @Override public void call() { srl.post(new Runnable() { @Override public void run() { srl.setRefreshing(true); } }); } }).doOnCompleted(new Action0() { @Override public void call() { srl.post(new Runnable() { @Override public void run() { srl.setRefreshing(false); } }); } }); } }; } public static <T> Observable.Transformer<T, T> bindConnecting(final ProgressDialog pd) { return new Observable.Transformer<T, T>() { @Override public Observable<T> call(Observable<T> original) { return original.doOnSubscribe(new Action0() { @Override public void call() { pd.show(); } }).doOnCompleted(new Action0() { @Override public void call() { pd.hide(); } }).doOnError(new Action1<Throwable>() { @Override public void call(Throwable throwable) { pd.hide(); } }); } }; } }
package org.continuity.idpa.serialization; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.<API key>; import com.fasterxml.jackson.databind.<API key>; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.node.ObjectNode; public class <API key><T> extends StdDeserializer<T> { private static final long serialVersionUID = 1L; // the registry of unique field names to Class types private Map<String, Class<? extends T>> registry; public <API key>(Class<T> clazz) { super(clazz); registry = new HashMap<String, Class<? extends T>>(); } public void register(String uniqueProperty, Class<? extends T> clazz) { registry.put(uniqueProperty, clazz); } /* * (non-Javadoc) * @see com.fasterxml.jackson.databind.JsonDeserializer#deserialize(com.fasterxml.jackson.core. * JsonParser, com.fasterxml.jackson.databind.<API key>) */ @SuppressWarnings("deprecation") @Override public T deserialize(JsonParser jp, <API key> ctxt) throws IOException, <API key> { Class<? extends T> clazz = null; ObjectMapper mapper = (ObjectMapper) jp.getCodec(); ObjectNode obj = (ObjectNode) mapper.readTree(jp); Iterator<Entry<String, JsonNode>> elementsIterator = obj.fields(); while (elementsIterator.hasNext()) { Entry<String, JsonNode> element = elementsIterator.next(); String name = element.getKey(); if (registry.containsKey(name)) { clazz = registry.get(name); break; } } if (clazz == null) { throw ctxt.mappingException("No registered unique properties found for polymorphic deserialization"); } return mapper.treeToValue(obj, clazz); } }
package twitter; import twitter4j.Twitter; import twitter4j.TwitterException; import twitter4j.auth.RequestToken; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; // TODO: Auto-generated Javadoc /** * The Class CallbackServlet. */ public class CallbackServlet extends HttpServlet { /** The Constant serialVersionUID. */ private static final long serialVersionUID = <API key>; /** * doGet - Twitter setup * */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Twitter twitter = (Twitter) request.getSession().getAttribute("twitter"); RequestToken requestToken = (RequestToken) request.getSession().getAttribute("requestToken"); String verifier = request.getParameter("oauth_verifier"); try { twitter.getOAuthAccessToken(requestToken, verifier); request.getSession().removeAttribute("requestToken"); } catch (TwitterException e) { throw new ServletException(e); } response.sendRedirect(request.getContextPath() + "/"); } }
import os import time import json import datetime import requests import threading import ConfigParser import paho.mqtt.client as mqtt from InformationFetcher import InformationFetcher from Template import TemplateMatcher from requests.auth import HTTPBasicAuth SECOND = 1 MINUTE = 60 * SECOND HOUR = 60 * MINUTE DAY = 24 * HOUR WEEK = 7 * DAY MONTH = 31 * DAY YEAR = 365 * DAY class Tank(threading.Thread): DAWN = 0 DAY = 1 SUNSET = 2 NIGHT = 3 def _readConfig(self): if self._configMTime != os.stat(self._configFileName).st_mtime: print "Reread config file for tank" self._configMTime = os.stat(self._configFileName).st_mtime update = False stop = False if not os.path.isdir(self._homeDir): print "Creating homeDir" os.makedirs(self._homeDir) if os.path.isfile(self._configFileName): self._config.read(self._configFileName) else: print "Config file not found" update = True if not self._config.has_section('MQTT'): print "Adding MQTT part" update = True self._config.add_section("MQTT") if not self._config.has_option("MQTT", "ServerAddress"): print "No Server Address" update = True self._config.set("MQTT", "ServerAddress", "<ServerAddress>") if not self._config.has_option("MQTT", "ServerPort"): print "No Server Port" update = True self._config.set("MQTT", "ServerPort", "1883") if not self._config.has_section('TANK'): print "Adding Tank part" update = True self._config.add_section("TANK") if not self._config.has_option("TANK", "Location"): print "No Tank Virtual Location" update = True self._config.set("TANK", "Location", "Port Of Spain") if not self._config.has_option("TANK", "LocationOffset"): print "No Tank Virtual Location Offset" update = True self._config.set("TANK", "LocationOffset", "0") if not self._config.has_option("TANK", "NightTemp"): print "No Tank Night Temperature" update = True self._config.set("TANK", "NightTemp", "23") if not self._config.has_option("TANK", "DayTemp"): print "No Tank Day Temperature" update = True self._config.set("TANK", "DayTemp", "24") if not self._config.has_option("TANK", "FertilizerInterval"): print "No Tank FertilizerInterval" update = True self._config.set("TANK", "FertilizerInterval", "3600") if not self._config.has_option("TANK", "GraphInterval"): print "No Tank GraphInterval" update = True self._config.set("TANK", "GraphInterval", "9000") if update: with open(self._configFileName, 'w') as f: self._config.write(f) if stop: print "Please check config file" sys.exit(0) def __init__(self): threading.Thread.__init__(self) self.setDaemon(True) self._homeDir = os.path.expanduser("~/.sensomatic") self._configFileName = self._homeDir + '/config.ini' self._configMTime = 0 self._config = ConfigParser.ConfigParser() self._readConfig() self._template = TemplateMatcher() self._info = InformationFetcher() self._mqclient = mqtt.Client("Tank2", clean_session=True) self._daystate = Tank.NIGHT self._twitterdaystate = Tank.NIGHT self._lastfurtilizer = time.time() self._lastcharts = time.time() self._sunpercentage = 0 self._moonpercentage = 0 def _on_connect(self, client, userdata, rc, msg): print "Connected Tank with result code %s" % rc self._mqclient.subscribe("livingroom/tank/ def _on_message(self, client, userdata, msg): #print "Mq Received on channel %s -> %s" % (msg.topic, msg.payload) pass def _on_disconnect(self, client, userdata, msg): print "Disconnect MQTTRulez" def updateSunAndMoon(self): now = datetime.datetime.now() dawn, sunrise, noon, sunset, dusk = self._info.getSunTimes(self._config.get("TANK", "Location"), int(self._config.get("TANK", "LocationOffset"))) moonPhase = self._info.getMoonPhase(self._config.get("TANK", "Location")) moonElevation, _ = self._info.getMoonPosition() if (dawn < now < sunrise): duration = sunrise - dawn done = now - dawn self._daystate = Tank.DAWN self._sunpercentage = int((done.total_seconds() / duration.total_seconds()) * 100) elif (sunrise < now < sunset): self._daystate = Tank.DAY self._sunpercentage = 100 elif (sunset < now < dusk): duration = dusk - sunset done = now - sunset self._daystate = Tank.SUNSET self._sunpercentage = int((1.0 - (done.total_seconds() / duration.total_seconds())) * 100) else: self._daystate = Tank.NIGHT self._sunpercentage = 0 # 0 = New moon, 7 = First quarter, 14 = Full moon, 21 = Last quarter moonphasepercentage = 0.0 if (0 <= moonPhase <= 14): moonphasepercentage = 1.0 - ( (14.0 - (moonPhase ) ) / 14.0) else: moonphasepercentage = ( (14.0 - (moonPhase - 14.0) ) / 14.0) if moonElevation > 0: self._moonpercentage = int(moonphasepercentage * (moonElevation / 90.0) * 100) else: self._moonpercentage = 0 def publishMQTT(self): self._mqclient.publish("livingroom/tank/whitelight", self._sunpercentage ) self._mqclient.publish("livingroom/tank/bluelight", self._moonpercentage) if self._daystate in (Tank.DAWN, Tank.DAY, Tank.SUNSET): self._mqclient.publish("livingroom/tank/settemp", self._config.get("TANK", "DayTemp")) else: self._mqclient.publish("livingroom/tank/settemp", self._config.get("TANK", "NightTemp")) def publishTwitter(self): if self._twitterdaystate is not self._daystate: if self._daystate == Tank.DAWN: self._mqclient.publish("twitter/text", "Switching light scene to dawn and rise the light level. #Fishtank Yellow #cheerlights") if self._daystate == Tank.DAY: self._mqclient.publish("twitter/text", "Switching light scene to day. #Fishtank Warmwhite #cheerlights") if self._daystate == Tank.SUNSET: self._mqclient.publish("twitter/text", "Switching light scene to sunset and lover the light level. #Fishtank Orange #cheerlights") if self._daystate == Tank.NIGHT: self._mqclient.publish("twitter/text", "Switching light scene to night. #Fishtank Black #cheerlights") self._twitterdaystate = self._daystate def publishFertilizer(self): now = time.time() if self._daystate == Tank.DAY: if (now - self._lastfurtilizer) > int(self._config.get("TANK", "FertilizerInterval")): self._mqclient.publish("livingroom/tank/fertilizer", 1) self._mqclient.publish("twitter/text", "Adding some material of natural or synthetic origin (other than liming materials). #Fishtank #Fertilizer") self._lastfurtilizer = now def publishCharts(self): now = time.time() if (now - self._lastcharts) > int(self._config.get("TANK", "GraphInterval")): try: j = json.loads(requests.get("https://uss-horizon.mybluemix.net/api/twitter/getHeaterID").content) self._mqclient.publish("twitter/uploaded/" + j[0]['media_id_string'], "Water temperature, air temperature, heater active, water level and adding water. #IoT #Fishtank #watson #analytics") self._mqclient.publish("twitter/uploaded/" + j[1]['media_id_string'], "Heater activity percentage, air temperature and humidity. #IoT #Fishtank #watson #analytics") self._mqclient.publish("twitter/uploaded/" + j[2]['media_id_string'], "Sun and moon intensity for the fishtank. #IoT #fishtank #watson #analytics") except: print "Error in publishing charts" self._lastcharts = now def run(self): self._mqclient.connect(self._config.get("MQTT", "ServerAddress"), self._config.get("MQTT", "ServerPort"), 60) self._mqclient.on_connect = self._on_connect self._mqclient.on_message = self._on_message self._mqclient.on_disconnect = self._on_disconnect self._mqclient.loop_start() while True: self._readConfig() self.updateSunAndMoon() self.publishMQTT() self.publishTwitter() self.publishFertilizer() self.publishCharts() time.sleep(15) if __name__ == '__main__': print "Start" t = Tank() t.start() time.sleep(100) print "End"
package com.models; // Generated Jun 17, 2015 12:29:59 PM by Hibernate Tools 4.3.1 import java.math.BigDecimal; import java.util.Date; /** * Mblftretur generated by hbm2java */ public class Mblftretur implements java.io.Serializable { private BigDecimal id; private Date mtgl; private String mslsno; private String kode; private String ket; public Mblftretur() { } public Mblftretur(BigDecimal id) { this.id = id; } public Mblftretur(BigDecimal id, Date mtgl, String mslsno, String kode, String ket) { this.id = id; this.mtgl = mtgl; this.mslsno = mslsno; this.kode = kode; this.ket = ket; } public BigDecimal getId() { return this.id; } public void setId(BigDecimal id) { this.id = id; } public Date getMtgl() { return this.mtgl; } public void setMtgl(Date mtgl) { this.mtgl = mtgl; } public String getMslsno() { return this.mslsno; } public void setMslsno(String mslsno) { this.mslsno = mslsno; } public String getKode() { return this.kode; } public void setKode(String kode) { this.kode = kode; } public String getKet() { return this.ket; } public void setKet(String ket) { this.ket = ket; } }
<?php $lang['profiler_database'] = 'BASE DE DADOS'; $lang['<API key>'] = 'CLASSE/MÉTODO'; $lang['profiler_benchmarks'] = 'BENCHMARKS'; $lang['profiler_queries'] = 'QUERIES'; $lang['profiler_get_data'] = 'DADOS GET'; $lang['profiler_post_data'] = 'DADOS POST'; $lang['profiler_uri_string'] = 'STRING URI'; $lang['<API key>'] = 'USO DE MEMÓRIA'; $lang['profiler_config'] = 'VARIÁVEIS DE CONFIGURAÇÃO'; $lang['<API key>'] = 'DADOS DE SESSÃO'; $lang['profiler_headers'] = 'CABEÇALHOS HTTP'; $lang['profiler_no_db'] = 'O driver da base de dados não está carregado'; $lang['profiler_no_queries'] = 'Nenhuma query foi executada'; $lang['profiler_no_post'] = 'Não existem dados POST'; $lang['profiler_no_get'] = 'Não existem dados GET'; $lang['profiler_no_uri'] = 'Não existem dados URI'; $lang['profiler_no_memory'] = 'Uso de Memória indisponível'; $lang['<API key>'] = 'Sem dados de Profile - todos as seções de Profiler foram desabilitadas.'; $lang['<API key>'] = 'Ocultar'; $lang['<API key>'] = 'Exibir'; /* End of file profiler_lang.php */ /* Location: ./system/language/english/profiler_lang.php */
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_181) on Tue Mar 23 17:43:15 GMT 2021 --> <title><API key></title> <meta name="date" content="2021-03-23"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><! try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="<API key>"; } } catch(err) { } var methods = {"i0":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- @generated --> <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="../../../../com/facebook/litho/widget/<API key>.<API key>.html" title="interface in com.facebook.litho.widget"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/facebook/litho/widget/<API key>.Processor.html" title="interface in com.facebook.litho.widget"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/facebook/litho/widget/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&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>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> </a></div> <div class="header"> <div class="subTitle">com.facebook.litho.widget</div> <h2 title="Interface <API key>" class="title">Interface <API key></h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public interface <span class="typeNameLabel"><API key></span></pre> <div class="block">An interface for generating traversing order for a range.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="nested.class.summary"> </a> <h3>Nested Class Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> <caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Interface and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static interface&nbsp;</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/<API key>.Processor.html" title="interface in com.facebook.litho.widget"><API key>.Processor</a></span></code>&nbsp;</td> </tr> </table> </li> </ul> <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>static <a href="../../../../com/facebook/litho/widget/<API key>.html" title="interface in com.facebook.litho.widget"><API key></a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/<API key>.html#BACKWARD_TRAVERSER">BACKWARD_TRAVERSER</a></span></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../com/facebook/litho/widget/<API key>.html" title="interface in com.facebook.litho.widget"><API key></a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/<API key>.html#<API key>"><API key></a></span></code> <div class="block">A more optimized range traverser that expands from the center for the visible range so that items adjacent to the visible ones are traversed first.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../com/facebook/litho/widget/<API key>.html" title="interface in com.facebook.litho.widget"><API key></a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/facebook/litho/widget/<API key>.html#FORWARD_TRAVERSER">FORWARD_TRAVERSER</a></span></code>&nbsp;</td> </tr> </table> </li> </ul> <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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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="../../../../com/facebook/litho/widget/<API key>.html#<API key>.facebook.litho.widget.<API key>.Processor-">traverse</a></span>(int&nbsp;rangeStart, int&nbsp;rangeEnd, int&nbsp;firstVisible, int&nbsp;lastVisible, <a href="../../../../com/facebook/litho/widget/<API key>.Processor.html" title="interface in com.facebook.litho.widget"><API key>.Processor</a>&nbsp;processor)</code> <div class="block">Traverse the given range.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="field.detail"> </a> <h3>Field Detail</h3> <a name="FORWARD_TRAVERSER"> </a> <ul class="blockList"> <li class="blockList"> <h4>FORWARD_TRAVERSER</h4> <pre>static final&nbsp;<a href="../../../../com/facebook/litho/widget/<API key>.html" title="interface in com.facebook.litho.widget"><API key></a> FORWARD_TRAVERSER</pre> </li> </ul> <a name="BACKWARD_TRAVERSER"> </a> <ul class="blockList"> <li class="blockList"> <h4>BACKWARD_TRAVERSER</h4> <pre>static final&nbsp;<a href="../../../../com/facebook/litho/widget/<API key>.html" title="interface in com.facebook.litho.widget"><API key></a> BACKWARD_TRAVERSER</pre> </li> </ul> <a name="<API key>"> </a> <ul class="blockListLast"> <li class="blockList"> <h4><API key></h4> <pre>static final&nbsp;<a href="../../../../com/facebook/litho/widget/<API key>.html" title="interface in com.facebook.litho.widget"><API key></a> <API key></pre> <div class="block">A more optimized range traverser that expands from the center for the visible range so that items adjacent to the visible ones are traversed first.</div> </li> </ul> </li> </ul> <ul class="blockList"> <li class="blockList"><a name="method.detail"> </a> <h3>Method Detail</h3> <a name="<API key>.facebook.litho.widget.<API key>.Processor-"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>traverse</h4> <pre>void&nbsp;traverse(int&nbsp;rangeStart, int&nbsp;rangeEnd, int&nbsp;firstVisible, int&nbsp;lastVisible, <a href="../../../../com/facebook/litho/widget/<API key>.Processor.html" title="interface in com.facebook.litho.widget"><API key>.Processor</a>&nbsp;processor)</pre> <div class="block">Traverse the given range.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>rangeStart</code> - Start of the range, inclusive</dd> <dd><code>rangeEnd</code> - End of the range, exclusive</dd> <dd><code>firstVisible</code> - Index of the first visible item</dd> <dd><code>lastVisible</code> - Index of the last visible item</dd> <dd><code>handler</code> - Handler that will perform job for each index in the range and determines if we need to stop</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar.bottom"> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li 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="../../../../com/facebook/litho/widget/<API key>.<API key>.html" title="interface in com.facebook.litho.widget"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../com/facebook/litho/widget/<API key>.Processor.html" title="interface in com.facebook.litho.widget"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/facebook/litho/widget/<API key>.html" target="_top">Frames</a></li> <li><a href="<API key>.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li> <li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li> <li>Constr&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>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> </a></div> </body> </html>
# Super Nintendo Emulators # Zsnes > ZSNES is a Super Nintendo emulator programmed by zsKnight and _Demo_. On April 2, 2001 the ZSNES project was GPL'ed and its source released to the public. It currently runs on Windows, Linux, FreeBSD, and DOS. Remember that this is a public beta so don't expect this to run on your machine [Homepage](http: ## Package Management System sh user@ubuntu:~$ sudo apt-get install zsnes ## Manual sh user@ubuntu:~$ sudo apt-get install nasm user@ubuntu:~$ sudo apt-get install libsdl1.2-dev user@ubuntu:~$ sudo apt-get install libsdl1.2-dbg user@ubuntu:~$ sudo apt-get install libncurses5-dev user@ubuntu:~$ configure # Snes9x > Snes9x is a portable, freeware Super Nintendo Entertainment System (SNES) emulator. It basically allows you to play most games designed for the SNES and Super Famicom Nintendo game systems on your PC or Workstation; which includes some real gems that were only ever released in Japan [Homepage](http: ## Package Management System sh user@ubilinux:~$ wget http: # Fceux ## Manual user@ubilinux:~$ sudo apt-get install scons libsdl1.2-dev liblua5.1-dev zlib1g-dev zenity user@ubilinux:~$ sudo apt-get install zenity sh user@ubilinux:~$ ls *fce* fceux-2.1.1.src.tar.bz2 user@ubilinux:~$ tar xvf fceux-2.1.1.src.tar.bz2 user@ubilinux:~$ cd fceu user@ubilinux:~/fceu$ sh user@ubilinux:~/fceu$ scons
#pragma once #include "stdafx.h" namespace Muriel { class TextureType { private: explicit TextureType(int textureType) :_textureType(textureType) {}; int _textureType; public: static TextureType Texture1D() { return TextureType(GL_TEXTURE_1D); }; static TextureType Texture2D() { return TextureType(GL_TEXTURE_2D); }; static TextureType Texture3D() { return TextureType(GL_TEXTURE_3D); }; static TextureType Texture1DArray() { return TextureType(GL_TEXTURE_1D_ARRAY); }; static TextureType Texture2DArray() { return TextureType(GL_TEXTURE_2D_ARRAY); }; static TextureType TextureRectangle() { return TextureType(<API key>); }; static TextureType TextureCubeMap() { return TextureType(GL_TEXTURE_CUBE_MAP); }; static TextureType TextureCubeMapArray() { return TextureType(<API key>); }; static TextureType TextureBuffer() { return TextureType(GL_TEXTURE_BUFFER); }; static TextureType <API key>() { return TextureType(<API key>); }; static TextureType <API key>() { return TextureType(<API key>); }; inline int GetType() { return _textureType; } }; }
# Coprinus calvescens (Berk.) Manjula SPECIES # Status ACCEPTED # According to Index Fungorum # Published in Proc. Indian Acad. Sci. , Pl. Sci. 92(2): 88 (1983) # Original name Agaricus calvescens Berk. Remarks null
package listener; import misc.GameState; import misc.Globals; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Keys; import com.badlogic.gdx.Input.TextInputListener; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.scenes.scene2d.InputEvent; import core.Room; import core.TheGrid; import entity.special.Player; public final class InputListener extends com.badlogic.gdx.scenes.scene2d.InputListener { private static final Globals GLOBALS = Globals.getInstance(); private Player player; private TheGrid theGrid; public InputListener() { theGrid = GLOBALS.getTheGrid(); player = theGrid.getPlayer(); } @Override public boolean keyDown(InputEvent event, int keyCode) { if(keyCode == Keys.ESCAPE) { Gdx.app.exit(); } if(GLOBALS.getGameState() != GameState.RUNNING) { return false; } Player player = theGrid.getPlayer(); switch(keyCode) { case Keys.SPACE: player.jump(); break; case Keys.A: player.shoot(); break; case Keys.Q: <API key>(); break; } return true; } @Override public boolean keyUp(InputEvent event, int keyCode) { if(GLOBALS.getGameState() != GameState.RUNNING) { return false; } Player player = theGrid.getPlayer(); switch(keyCode) { case Keys.SPACE: player.stopJump(); break; } return true; } public void update() { if(GLOBALS.getGameState() != GameState.RUNNING) { return; } Player player = theGrid.getPlayer(); if(Gdx.input.isKeyPressed(Keys.RIGHT)) { player.moveRight(); } else if(Gdx.input.isKeyPressed(Keys.LEFT)) { player.moveLeft(); } else { player.stopMove(); } if(Gdx.input.isKeyPressed(Keys.A)) { player.shoot(); } if(Gdx.input.isKeyPressed(Keys.Z)) { GLOBALS.getCamera().zoom += 0.05f; } else if(Gdx.input.isKeyPressed(Keys.X)) { GLOBALS.getCamera().zoom -= 0.05f; } } private void <API key>() { Gdx.input.getTextInput(new TextInputListener() { @Override public void input(String text) { String[] pieces = text.split(","); int gridRow = Integer.parseInt(pieces[0]); int gridCol = Integer.parseInt(pieces[1]); int row = Integer.parseInt(pieces[2]); int col = Integer.parseInt(pieces[3]); Vector2 worldPos = Room.getWorldPosition(gridRow, gridCol, row, col); player.setPosition(worldPos.x, worldPos.y); } @Override public void canceled() { } }, "Format: gridRow,gridCol,row,col", "0,0,10,4", ""); } }
using System; using System.Collections.Generic; using System.ComponentModel; namespace ServiceBouncer.ComponentModel { public class SortableBindingList<T> : BindingList<T> where T : class { private bool isSorted; private ListSortDirection sortDirection = ListSortDirection.Ascending; private PropertyDescriptor sortProperty; public SortableBindingList(IList<T> list) : base(list) { } protected override bool SupportsSortingCore => true; protected override bool IsSortedCore => isSorted; protected override ListSortDirection SortDirectionCore => sortDirection; protected override PropertyDescriptor SortPropertyCore => sortProperty; protected override void RemoveSortCore() { sortDirection = ListSortDirection.Ascending; sortProperty = null; isSorted = false; } protected override void ApplySortCore(PropertyDescriptor prop, ListSortDirection direction) { sortProperty = prop; sortDirection = direction; if (!(Items is List<T> list)) { return; } list.Sort(Compare); isSorted = true; OnListChanged(new <API key>(ListChangedType.Reset, -1)); } private int Compare(T x, T y) { var result = OnComparison(x, y); if (sortDirection == ListSortDirection.Descending) { result = -result; } return result; } private int OnComparison(T x, T y) { var xValue = x == null ? null : sortProperty.GetValue(x); var yValue = y == null ? null : sortProperty.GetValue(y); if (xValue == null) { return (yValue == null) ? 0 : -1; } if (yValue == null) { return 1; } if (xValue is IComparable value) { return value.CompareTo(yValue); } if (xValue.Equals(yValue)) { return 0; } return string.Compare(xValue.ToString(), yValue.ToString(), StringComparison.Ordinal); } } }
<?php ob_start(); require_once('./system/configdb.php'); require_once('./system/funciones.php'); sec_session_start(); if(login_check($mysqli) != true){ header('Location: ./login?url='.dameURL()); } ?> <!DOCTYPE html> <html lang="es"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title><?php echo hospital(0);?></title> <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"> <link href="css/brain-theme.css" rel="stylesheet" type="text/css"> <link href="css/styles.css" rel="stylesheet" type="text/css"> <link href="css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="css/fonts/cuprum.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="./js/jquery.min.js"></script> <script type="text/javascript" src="./js/jquery-ui.min.js"></script> <script type="text/javascript" src="js/plugins/charts/flot.js"></script> <script type="text/javascript" src="js/plugins/charts/flot.orderbars.js"></script> <script type="text/javascript" src="js/plugins/charts/flot.pie.js"></script> <script type="text/javascript" src="js/plugins/charts/flot.time.js"></script> <script type="text/javascript" src="js/plugins/charts/flot.animator.min.js"></script> <script type="text/javascript" src="js/plugins/charts/excanvas.min.js"></script> <script type="text/javascript" src="js/plugins/charts/flot.resize.min.js"></script> <script type="text/javascript" src="js/plugins/forms/uniform.min.js"></script> <script type="text/javascript" src="js/plugins/forms/select2.min.js"></script> <script type="text/javascript" src="js/plugins/forms/inputmask.js"></script> <script type="text/javascript" src="js/plugins/forms/autosize.js"></script> <script type="text/javascript" src="js/plugins/forms/inputlimit.min.js"></script> <script type="text/javascript" src="js/plugins/forms/listbox.js"></script> <script type="text/javascript" src="js/plugins/forms/multiselect.js"></script> <script type="text/javascript" src="js/plugins/forms/validate.min.js"></script> <script type="text/javascript" src="js/plugins/forms/tags.min.js"></script> <script type="text/javascript" src="js/plugins/forms/uploader/plupload.full.min.js"></script> <script type="text/javascript" src="js/plugins/forms/uploader/plupload.queue.min.js"></script> <script type="text/javascript" src="js/plugins/forms/wysihtml5/wysihtml5.min.js"></script> <script type="text/javascript" src="js/plugins/forms/wysihtml5/toolbar.js"></script> <script type="text/javascript" src="js/plugins/interface/jgrowl.min.js"></script> <script type="text/javascript" src="js/plugins/interface/datatables.min.js"></script> <script type="text/javascript" src="js/plugins/interface/prettify.js"></script> <script type="text/javascript" src="js/plugins/interface/fancybox.min.js"></script> <script type="text/javascript" src="js/plugins/interface/colorpicker.js"></script> <script type="text/javascript" src="js/plugins/interface/timepicker.min.js"></script> <script type="text/javascript" src="js/plugins/interface/fullcalendar.min.js"></script> <script type="text/javascript" src="js/plugins/interface/collapsible.min.js"></script> <script type="text/javascript" src="js/bootstrap.min.js"></script> <script type="text/javascript" src="js/application.js"></script> </head> <body> <!-- Navbar --> <?php barra()?> <!-- /navbar --> <!-- Page header --> <div class="container-fluid"> <div class="page-header"> <div class="logo"><a href="/" title=""><img src="images/logo.png" width="280" alt="<?php echo hospital(0);?>"></a> </div> </div> </div> <!-- /page header --> <!-- Page container --> <div class="page-container container-fluid"> <!-- Sidebar --> <?php menu($_SESSION['d']['tipo']) ?> <!-- /sidebar --> <!-- Page content --> <div class="page-content"> <!-- Calendar --> <div class="panel panel-default"> <div class="row"> <div class="col-md-12"> <div class="panel-heading"><h5 class="panel-title">Calendario de Actividades</h5></div> <div class="panel-body"> <div class="fullcalendar"></div> </div> </div> </div> </div> <!-- /calendar --> <!-- Footer --> <?php pie() ?> <!-- /footer --> </div> </div> </body> </html> <?php $cntACmp =ob_get_contents(); ob_end_clean(); $cntACmp=str_replace("\n",' ',$cntACmp); $cntACmp=ereg_replace('[[:space:]]+',' ',$cntACmp); ob_start("ob_gzhandler"); echo $cntACmp; ob_end_flush(); ?>
// Shader plug-ins // Created: 8/18/98 Kells Elmquist #ifndef SHADERS_H #define SHADERS_H #include "iparamb2.h" #include "stdmat.h" #include "buildver.h" //#define STD2_NMAX_TEXMAPS 24 #define N_ID_CHANNELS 16 // number of ids in stdMat class Shader; #define OPACITY_PARAM 0 #define DEFAULT_SOFTEN 0.1f // Shader param dialog // Returned by a shader when it is asked to put up its rollup page. /*! \sa Class ParamDlg, Class StdMat2, Class Shader.\n\n \par Description: This class is available in release 3.0 and later only.\n\n A pointer to an instance of this class is returned by a Shader when it is asked to put up its rollup page. */ class ShaderParamDlg : public ParamDlg { public: /*! \remarks Returns the unique Class_ID of this object. */ virtual Class_ID ClassID()=0; /*! \remarks This method sets the current shader being edited to the shader passed. \par Parameters: <b>ReferenceTarget *m</b>\n\n The Shader to set as current. */ virtual void SetThing(ReferenceTarget *m)=0; /*! \remarks This method sets the current Standard material (and its shader) being edited to the ones passed. \par Parameters: <b>StdMtl2* pMtl</b>\n\n The Standard material to set as current.\n\n <b>Shader* pShader</b>\n\n The Shader to set as current. */ virtual void SetThings( StdMat2* pMtl, Shader* pShader )=0; /*! \remarks Returns the a pointer to the current <b>material</b> being edited. Note that in most of the Get/SetThing() methods in the SDK the 'Thing' is the actual plug-in. In this case it's not. It the material which is using this Shader. */ virtual ReferenceTarget* GetThing()=0; /*! \remarks This method returns a pointer to the current Shader. */ virtual Shader* GetShader()=0; /*! \remarks This method is called when the current time has changed. This gives the developer an opportunity to update any user interface data that may need adjusting due to the change in time. \par Parameters: <b>TimeValue t</b>\n\n The new current time. \par Default Implementation: <b>{}</b> */ virtual void SetTime(TimeValue t) {} /*! \remarks This method is called to delete this instance of the class.\n\n For dynamically created global utility plugins, this method has to be implemented and should have a implementation like <b>{ delete this; }</b> */ virtual void DeleteThis()=0; /*! \remarks This is the dialog procedure for the user interface controls of the Shader. \par Parameters: <b>HWND hwndDlg</b>\n\n The window handle of the rollup page.\n\n <b>UINT msg</b>\n\n The message to process.\n\n <b>WPARAM wParam</b>\n\n The first dialog parameter.\n\n <b>LPARAM lParam</b>\n\n The second dialog parameter. \return Except in response to the WM_INITDIALOG message, the procedure should return nonzero if it processes the message, and zero if it does not. In response to a WM_INITDIALOG message, the dialog box procedure should return zero if it calls the SetFocus function to set the focus to one of the controls in the dialog. Otherwise, it should return nonzero, in which case the system sets the focus to the first control in the dialog that can be given the focus.*/ virtual INT_PTR PanelProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam )=0; /*! \remarks This method is used to load the user interface controls with their current values. \par Parameters: <b>int draw</b>\n\n This parameter is not currently used. */ virtual void LoadDialog( int draw )=0; virtual void UpdateDialog( ParamID paramId )=0; /*! \remarks This method returns the window handle of the rollup panel. */ virtual HWND GetHWnd()=0; /*! \remarks This method returns the index of the sub-texmap corresponding to the window whose handle is passed. If the handle is not valid return -1. \par Parameters: <b>HWND hw</b>\n\n The window handle to check. */ virtual int FindSubTexFromHWND(HWND hw)=0; /*! \remarks This method is called to update the opacity parameter of the plug-in in the user interface. */ virtual void UpdateOpacity()=0; /*! \remarks This method is called to update the map buttons in the user interface. For example it can put a <b>" "</b> or <b>"m"</b> or <b>"M"</b> on the button face based on the state of the map. */ virtual void UpdateMapButtons()=0; }; ////////////////////////////////sh flags ////////////////////////////////////// #define SELFILLUM_CLR_ON (1<<16) // can be or'd w/ mtl, not sure it's necessary //////// Components defines #define HAS_BUMPS 0x01L #define HAS_REFLECT 0x02L #define HAS_REFRACT 0x04L #define HAS_OPACITY 0x08L #define HAS_REFLECT_MAP 0x10L #define HAS_REFRACT_MAP 0x20L #define HAS_MATTE_MTL 0x40L /////// Texture channel type flags #define UNSUPPORTED_CHANNEL 0x01L #define CLR_CHANNEL 0x02L #define MONO_CHANNEL 0x04L #define BUMP_CHANNEL 0x08L #define REFL_CHANNEL 0x10L #define REFR_CHANNEL 0x20L #define DISP_CHANNEL 0x40L #define SLEV_CHANNEL 0x80L #define ELIMINATE_CHANNEL 0x8000L #define SKIP_CHANNELS (UNSUPPORTED_CHANNEL+BUMP_CHANNEL+REFL_CHANNEL+REFR_CHANNEL) //////// Class Id upper half for loading the Pre 3.0 shaders #define <API key> BLINNClassID #ifndef USE_LIMITED_STDMTL // orb 01-14-2002 #define PHONGClassID (STDSHADERS_CLASS_ID+2) #define METALClassID (STDSHADERS_CLASS_ID+4) #endif // USE_LIMITED_STDMTL #define BLINNClassID (STDSHADERS_CLASS_ID+3) class ParamBlockDescID; class IParamBlock; /*! \sa Class SpecialFX, Class ShaderParamDlg, Class ShadeContext, Class IllumParams, Class IMtlParams, Class StdMat2, Class Mtl, Class Color, Class ILoad, Class ISave.\n\n \par Description: This class is available in release 3.0 and later only.\n\n This is one of the base classes for the creation of Shaders which plug-in to the Standard material. Note: Developers should derive their plug-in Shader from Class Shader rather than this class directly since otherwise the interactive renderer won't know how to render the Shader in the viewports.\n\n Developers of this plug-in type need to understand how the Standard material and the Shader work together.\n\n Every material has a Shader. The Shader is the piece of code which controls how light is reflected off the surface. The Standard material is basically the mapping mechanism. It handles all the texturing for the material. It also manages the user interface. This simplifies things so the Shader plug-in only needs to worry about the interaction of light on the surface.\n\n Prior to release 3 developers could write Material plug-ins that performed their own shading, however ths was usually a major programming task. Release 3 provides the simpler Shader plug-in that would benefit from sharing all the common capabilities. The Standard material, with its 'blind' texturing mechanism, makes this possible. It doesn't know what it is texturing -- it simply texturing 'stuff'. The shader names the channels (map), fills in the initial values, specifies if they are a single channel (mono) or a triple channel (color). The Standard material handles the rest including managing the user interface.\n\n Most of the code in a Shader has to do with supplying this information to a Standard material. The values are passed and received back in class <b>IllumParams</b>. There is a single method in a shader which actually does the shading. This is the <b>Illum()</b> method. \par Plug-In Information: Class Defined In SHADER.H\n\n Super Class ID SHADER_CLASS_ID\n\n Standard File Name Extension DLB\n\n Extra Include File Needed SHADERS.H \par Method Groups: See Method Groups for Class BaseShader. */ class BaseShader : public SpecialFX { public: RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message) {return REF_SUCCEED;} SClass_ID SuperClassID() {return SHADER_CLASS_ID;} BOOL BypassPropertyLevel() { return TRUE; } // want to promote shader props to material level /*! \remarks Returns the requirements of the Shader for the specified sub-material. Many objects in the rendering pipeline use the requirements to tell the renderer what data needs to be available. The Shader's requirements are OR'd with the combined map requirements and returned to the renderer via the Stdmtl2's <b>GetRequirements()</b> function. \par Parameters: <b>int subMtlNum</b>\n\n This parameter is not used. \return One or more of the following flags:\n\n See \ref <API key>. */ virtual ULONG GetRequirements(int subMtlNum)=0; // Put up a dialog that lets the user edit the plug-ins parameters. /*! \remarks This method creates and returns a pointer to a<b>ShaderParamDlg</b> object and puts up the dialog which lets the user edit the Shader's parameters. \par Parameters: <b>HWND hOldRollup</b>\n\n The window handle of the old rollup. If non-NULL the IMtlParams method ReplaceRollup method is usually used instead of AddRollup() to present the rollup.\n\n <b>HWND hwMtlEdit</b>\n\n The window handle of the material editor.\n\n <b>IMtlParams *imp</b>\n\n The interface pointer for calling methods in 3ds Max.\n\n <b>StdMtl2* theMtl</b>\n\n Points to the Standard material being edited.\n\n <b>int rollupOpen</b>\n\n TRUE to have the UI rollup open; FALSE if closed.\n\n <b>int n=0</b>\n\n This parameter is available in release 4.0 and later only.\n\n Specifies the number of the rollup to create. Reserved for future use with multiple rollups. */ virtual ShaderParamDlg* CreateParamDialog( HWND hOldRollup, HWND hwMtlEdit, IMtlParams *imp, StdMat2* theMtl, int rollupOpen, int n=0) = 0; /*! \remarks This method is available in release 4.0 and later only.\n\n Returns the number of rollups this shader is requesting. \par Default Implementation: <b>{ return 1; }</b> */ virtual int NParamDlgs(){ return 1; } /*! \remarks Returns a pointer to the <b>ShaderParamDlg</b> object which manages the user interface. \par Parameters: <b>int n=0</b>\n\n This parameter is available in release 4.0 and later only.\n\n Specifies the rollup to get <b>ShaderParamDlg</b> for. Reserved for future use with multiple rollups. */ virtual ShaderParamDlg* GetParamDlg(int n=0 )=0; /*! \remarks Sets the <b>ShaderParamDlg</b> object which manages the user interface to the one passed. \par Parameters: <b>ShaderParamDlg* newDlg</b>\n\n Points to the new ShaderParamDlg object.\n\n <b>int n=0</b>\n\n This parameter is available in release 4.0 and later only.\n\n Specifies the rollup to set <b>ShaderParamDlg</b> for. Reserved for future use with multiple rollups.\n\n */ virtual void SetParamDlg( ShaderParamDlg* newDlg, int n=0 )=0; // Saves and loads name. These should be called at the start of // a plug-in's save and load methods. /*! \remarks Saves the plug-in's name. This should be called at the start of a plug-in's <b>Save()</b> method. \par Parameters: <b>ISave *isave</b>\n\n An interface for saving data. */ IOResult Save(ISave *isave) { return SpecialFX::Save(isave); } /*! \remarks Loads the plug-in's name. This should be called at the start of a plug-in's <b>Load()</b> method. \par Parameters: <b>ILoad *iload</b>\n\n An interface for loading data. */ IOResult Load(ILoad *iload) { return SpecialFX::Load(iload); } // std parameter support /*! \remarks Returns a value which indicates which of the standard parameters are supported. \return See <a href="ms-its:listsandfunctions.chm::/<API key>.html">List of Shader Standard Parameter Flags</a>. */ virtual ULONG SupportStdParams()=0; // this method only req'd for R2.5 shaders, to convert stdmtl1 paramblks to current /*! \remarks This method is only required for R2.5 shaders to convert the previous Standard material parameter blocks to the current version. \par Parameters: <b>ParamBlockDescID *descOld</b>\n\n Points to the old parameter block descriptor.\n\n <b>int oldCount</b>\n\n The number in the array of parameters above.\n\n <b>IParamBlock *oldPB</b>\n\n Points to the old parameter block. */ virtual void ConvertParamBlk( ParamBlockDescID *descOld, int oldCount, IParamBlock *oldPB ){}; // LOCAL vars of mtl for possible mapping prior to being given to back to illum /*! \remarks This method updates the <b>channels</b>(as well as other) data member of the <b>IllumParams</b> object passed to it with the <b>local</b> variables of the material for possible mapping prior to being given to the Shader's <b>Illum()</b> method. The shader plug-in copies the state of all its parameters (at their current animation state) into the data members of the <b>IllumParams</b> passed. \par Parameters: <b>IllumParams* ip</b>\n\n Points to the IllumParams to update. */ virtual void GetIllumParams( ShadeContext &sc, IllumParams& ip )=0; // actual shader virtual void Illum(ShadeContext &sc, IllumParams &ip)=0; // begin - ke/mjm - 03.16.00 - merge reshading code // these support the pre-shade/reshade protocol // virtual void PreIllum(ShadeContext &sc, IReshadeFragment* pFrag){} // virtual void PostIllum(ShadeContext &sc, IllumParams &ip, IReshadeFragment* pFrag ){ Illum(sc,ip); } // >>>> new for V4, one call superceded, 2 new ones added /*! \remarks This method is available in release 4.0 and later only.\n\n Compute the reflected color from the <b>sc</b>, <b>ip</b>, and reflection map (or ray) color. The core implementation of this provides the standard 3ds Max reflection model. To support the standard reflection model, a shader may call this default implementation. \par Parameters: <b>ShadeContext\& sc</b>\n\n The context which provides information on the pixel being shaded.\n\n <b>IllumParams\& ip</b>\n\n The object whose data members provide communication between 3ds Max and the shader.\n\n <b>Color \&mapClr</b>\n\n The input reflection (or ray) color is passed in here and the resulting 'affected' color is stored here. */ virtual void ShadeReflection(ShadeContext &sc, IllumParams &ip, Color &mapClr){} /*! \remarks This method is available in release 4.0 and later only.\n\n Compute the transmission/refraction color for the sample.. The core implementation of this provides the standard 3ds Max reflection model. To support the standard transmission/refraction model, a shader may call this default implementation. \par Parameters: <b>ShadeContext\& sc</b>\n\n The context which provides information on the pixel being shaded.\n\n <b>IllumParams\& ip</b>\n\n The object whose data members provide communication between 3ds Max and the shader.\n\n <b>Color \&mapClr</b>\n\n The input refraction (or ray) color is passed in here and the resulting 'affected' color is stored here.\n\n <b>float amount</b>\n\n The level of the amount spinner for the refraction channel. */ virtual void ShadeTransmission(ShadeContext &sc, IllumParams &ip, Color &mapClr, float amount){} // orphaned, replaced by ShadeReflection() /*! \remarks Note: This method has been superceded by <b>ShadeReflection()</b> and is <b>obsolete</b> in release 4.0 and later.\n\n This method provides the shader with an opportunity to affect the reflection code. \par Parameters: <b>ShadeContext \&sc</b>\n\n The ShadeContext which provides information on the pixel being shaded.\n\n <b>IllumParams \&ip</b>\n\n The object whose data members provide communication between 3ds Max and the shader.\n\n <b>Color \&rcol</b>\n\n The input reflection color is passed in here and the resulting 'affected' color is stored here. \par Sample Code: A simple example like Phong does the following:\n\n \code void AffectReflection(ShadeContext &sc, IllumParams &ip, Color &rcol) { rcol *= ip.channels[ID_SP]; }; \endcode If a color can affect the reflection of light off a surface than it can usually affect the reflection of other things off a surface. Thus some shaders influence the reflection color using the specular color and specular level. For instance the Multi Layer Shader does the following:\n\n \code #define DEFAULT_GLOSS2 0.03f void MultiLayerShader::AffectReflection(ShadeContext &sc, IllumParams &ip, Color &rcol) { float axy = DEFAULT_GLOSS2; float norm = 1.0f / (4.0f * PI * axy ); rcol *= ip.channels[_SPECLEV1].r * ip.channels[_SPECCLR1] * norm; } \endcode */ virtual void AffectReflection(ShadeContext &sc, IllumParams &ip, Color &rcol){} // end - ke/mjm - 03.16.00 - merge reshading code /*! \remarks This method does the final compositing of the various illumination components. A default implementation is provided which simply adds the components together. Developers who want to do other more specialized composition can override this method. For example, a certain Shader might want to composited highlights over the underlying diffuse component since the light is reflected and the diffuse color wouldn't fully show through. Such a Shader would provide its own version of this method. \par Parameters: <b>ShadeContext \&sc</b>\n\n The ShadeContext which provides information on the pixel being shaded.\n\n <b>IllumParams\& ip</b>\n\n The illumination parameters to composite and store. \par Default Implementation: \code virtual void CombineComponents(IllumParams& ip) { ip.finalC = ip.finalOpac * (ip.ambIllumOut + ip.diffIllumOut + ip.selfIllumOut) + ip.specIllumOut + ip.reflIllumOut + ip.transIllumOut; } \endcode */ virtual void CombineComponents( ShadeContext &sc, IllumParams& ip ){}; // texture maps /*! \remarks Returns the number of texture map map channels supported by this Shader. */ virtual long <API key>()=0; /*! \remarks Returns the name of the specified texture map channel. \par Parameters: <b>long nTextureChan</b>\n\n The zero based index of the texture map channel whose name is returned. */ virtual MSTR GetTexChannelName( long nTextureChan )=0; /*! \remarks Returns the internal name of the specified texture map. The Standard material uses this to get the fixed, parsable internal name for each texture channel it defines. \par Parameters: <b>long nTextureChan</b>\n\n The zero based index of the texture map whose name is returned. \par Default Implementation: <b>{ return GetTexChannelName(nTextureChan); }</b> */ virtual MSTR <API key>( long nTextureChan ) { return GetTexChannelName(nTextureChan); } /*! \remarks Returns the channel type for the specified texture map channel. There are four channels which are part of the Material which are not specific to the Shader. All other channels are defined by the Shader (what they are and what they are called.) The four which are not the province of the Shader are Bump, Reflection, Refraction and Displacement. For example, Displacement mapping is really a geometry operation and not a shading one. The channel type returned from this method indicates if the specified channel is one of these, or if it is a monochrome channel, a color channel, or is not a supported channel. \par Parameters: <b>long nTextureChan</b>\n\n The zero based index of the texture map whose name is returned. \return Texture channel type flags. One or more of the following values:\n\n <b>UNSUPPORTED_CHANNEL</b>\n\n Indicates the channel is not supported (is not used).\n\n <b>CLR_CHANNEL</b>\n\n A color channel. The <b>Color.r</b>, <b>Color.g</b> and <b>Color.b</b> parameters are used.\n\n <b>MONO_CHANNEL </b>\n\n A monochrome channel. Only the <b>Color.r</b> is used.\n\n <b>BUMP_CHANNEL</b>\n\n The bump mapping channel.\n\n <b>REFL_CHANNEL</b>\n\n The reflection channel.\n\n <b>REFR_CHANNEL</b>\n\n The refraction channel.\n\n <b>DISP_CHANNEL</b>\n\n The displacement channel.\n\n <b>ELIMINATE_CHANNEL</b>\n\n Indicates that the channel is not supported. For example, a certain Shader might not support displacement mapping for some reason. If it didn't, it could use this channel type to eliminate the support of displacement mapping for itself. It would be as if displacement mapping was not included in the material. None of the 3ds Max shaders use this.\n\n <b>SKIP_CHANNELS</b>\n\n This is used internally to indicate that the channels to be skipped. */ virtual long ChannelType( long nTextureChan )=0; // map StdMat Channel ID's to the channel number /*! \remarks Returns the index of this Shader's channels which corresponds to the specified Standard materials texture map ID. This allows the Shader to arrange its channels in any order it wants in the <b>IllumParams::channels</b> array but enables the Standard material to access specific ones it needs (for instance the Bump channel or Reflection channel). \par Parameters: <b>long stdID</b>\n\n The ID whose corresponding channel to return. See \ref <API key> "List of Material Texture Map Indices". \return The zero based index of the channel. If there is not a corresponding channel return -1. \par Sample Code: This can be handled similar to below where an array is initialized with the values of this plug-in shader's channels that correspond to each of the standard channels. Then this method just returns the correspond index from the array.\n\n \code static int stdIDToChannel[N_ID_CHANNELS] = { 0, 1, 2, 5, 4, -1, 7, 8, 9, 10, 11, 12 }; long StdIDToChannel(long stdID){ return stdIDToChannel[stdID]; } \endcode */ virtual long StdIDToChannel( long stdID )=0; // Shader Uses these UserIllum output channels virtual long nUserIllumOut(){ return 0; } // number of channels it will use // static name array for matching by render elements virtual MCHAR** UserIllumNameArray(){ return NULL; } // static name of each channel /*! \remarks This method is called when the Shader is first activated in the dropdown list of Shader choices. The Shader should reset itself to its default values. */ virtual void Reset()=0; //reset to default values }; // Chunk IDs saved by base class #define SHADERBASE_CHUNK 0x39bf #define SHADERNAME_CHUNK 0x0100 // Standard params for shaders // combination of these is returned by Shader.SupportStdParams() #define STD_PARAM_NONE (0) #define STD_PARAM_ALL (0xffffffffL) #define STD_PARAM_METAL (1) #define STD_PARAM_LOCKDS (1<<1) #define STD_PARAM_LOCKAD (1<<2) #define STD_PARAM_LOCKADTEX (1<<3) #define STD_PARAM_SELFILLUM (1<<4) #define <API key> (1<<5) #define <API key> (1<<6) #define <API key> (1<<7) #define <API key> (1<<8) #define <API key> (1<<9) #define <API key> (1<<10) #define <API key> (1<<11) #define <API key> (1<<12) #define <API key> (1<<13) #define <API key> (1<<14) #define STD_PARAM_ANISO (1<<15) #define <API key> (1<<16) #define STD_PARAM_REFL_LEV (1<<17) #define <API key> (1<<18) #define STD_BASIC2_DLG (1<<20) #define STD_EXTRA_DLG (1<<21) // not including these 3 in yr param string disables the relevant params // in extra params dialog #define <API key> (1<<22) #define <API key> (1<<23) #define STD_EXTRA_OPACITY (1<<24) #define STD_EXTRA (STD_EXTRA_DLG \ +<API key>+<API key> \ +STD_EXTRA_OPACITY ) #define STD_BASIC (0x00021ffeL | STD_BASIC2_DLG) #ifndef USE_LIMITED_STDMTL // orb 01-14-2002 #define STD_BASIC_METAL (0x00021fffL | STD_BASIC2_DLG) #define STD_ANISO (0x0002cffe) #define STD_MULTILAYER (0x0002fffe) #define STD_ONB (0x00023ffe) #define STD_WARD (0x00000bce) #endif // USE_LIMITED_STDMTL /*! \sa Class BaseShader, Class MacroRecorder.\n\n \par Description: This class is available in release 3.0 and later only.\n\n This is the class that developers use to create Shader plug-ins. Developers must implement the methods of this class to provide data to the 3ds Max interactive renderer so it can properly reflect the look of the shader in the viewports. The methods associated with the actual Shader illumination code are from the base class <b>BaseShader</b>.\n\n There are various Get and Set methods defined in this class. Plug-in developers provide implementations for the 'Get' methods which are used by the interactive renderer. The implementations of the 'Set' methods are used when switching between shaders types in the Materials Editor. This is used to transfer the corresponding colors between the old Shader and the new one.\n\n Note that some shaders may not have the exact parameters as called for in the methods. In those case an approximate value may be returned from the 'Get' methods. For example, the Strauss Shader doesn't have an Ambient channel. In that case the Diffuse color is taken and divided by 2 and returned as the Ambient color. This gives the interactive renderer something to work with that might not be exact but is somewhat representative. */ class Shader : public BaseShader, public IReshading { public: /*! \remarks This method copies the standard shader parameters from <b>pFrom</b> to this object. Note that plug-ins typically disable the macro recorder during this operation as the Get and Set methods are called. See the sample code for examples. \par Parameters: <b>Shader* pFrom</b>\n\n The source parameters. */ virtual void CopyStdParams( Shader* pFrom )=0; // these are the standard shader params /*! \remarks Sets the state of the Diffuse / Specular lock to on or off. \par Parameters: <b>BOOL lock</b>\n\n TRUE for on; FALSE for off. */ virtual void SetLockDS(BOOL lock)=0; /*! \remarks Returns TRUE if the Diffuse / Specular lock is on; otherwise FALSE. */ virtual BOOL GetLockDS()=0; /*! \remarks Sets the state of the Ambient / Diffuse lock to on or off. \par Parameters: <b>BOOL lock</b>\n\n TRUE for on; FALSE for off. */ virtual void SetLockAD(BOOL lock)=0; /*! \remarks Returns TRUE if the Ambient / Diffuse lock is on; otherwise FALSE. */ virtual BOOL GetLockAD()=0; /*! \remarks Sets the state of the Ambient / Diffuse Texture lock to on or off. \par Parameters: <b>BOOL lock</b>\n\n TRUE for on; FALSE for off. */ virtual void SetLockADTex(BOOL lock)=0; /*! \remarks Returns TRUE if the Ambient / Diffuse Texture lock is on; otherwise FALSE. */ virtual BOOL GetLockADTex()=0; /*! \remarks Sets the Self Illumination parameter to the specified value at the time passed. \par Parameters: <b>float v</b>\n\n The value to set.\n\n <b>TimeValue t</b>\n\n The time to set the value. */ virtual void SetSelfIllum(float v, TimeValue t)=0; /*! \remarks Sets the Self Illumination Color On/Off state. \par Parameters: <b>BOOL on</b>\n\n TRUE for on; FALSE for off. */ virtual void SetSelfIllumClrOn( BOOL on )=0; /*! \remarks Sets the Self Illumination Color at the specified time. \par Parameters: <b>Color c</b>\n\n The color to set.\n\n <b>TimeValue t</b>\n\n The time to set the color. */ virtual void SetSelfIllumClr(Color c, TimeValue t)=0; /*! \remarks Sets the Ambient Color at the specified time. \par Parameters: <b>Color c</b>\n\n The color to set.\n\n <b>TimeValue t</b>\n\n The time to set the color. */ virtual void SetAmbientClr(Color c, TimeValue t)=0; /*! \remarks Sets the Diffuse Color at the specified time. \par Parameters: <b>Color c</b>\n\n The color to set.\n\n <b>TimeValue t</b>\n\n The time to set the color. */ virtual void SetDiffuseClr(Color c, TimeValue t)=0; /*! \remarks Sets the Specular Color at the specified time. \par Parameters: <b>Color c</b>\n\n The color to set.\n\n <b>TimeValue t</b>\n\n The time to set the color. */ virtual void SetSpecularClr(Color c, TimeValue t)=0; /*! \remarks Sets the Glossiness parameter to the specified value at the time passed. \par Parameters: <b>float v</b>\n\n The value to set.\n\n <b>TimeValue t</b>\n\n The time to set the value. */ virtual void SetGlossiness(float v, TimeValue t)=0; /*! \remarks Sets the Specular Level parameter to the specified value at the time passed. \par Parameters: <b>float v</b>\n\n The value to set.\n\n <b>TimeValue t</b>\n\n The time to set the value. */ virtual void SetSpecularLevel(float v, TimeValue t)=0; /*! \remarks Sets the Soften Specular Highlights Level to the specified value at the time passed. \par Parameters: <b>float v</b>\n\n The value to set.\n\n <b>TimeValue t</b>\n\n The time to set the value. */ virtual void SetSoftenLevel(float v, TimeValue t)=0; /*! \remarks Returns TRUE if the Self Illumination Color setting is on (checked); FALSE if off. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual BOOL IsSelfIllumClrOn(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Ambient Color. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual Color GetAmbientClr(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Diffuse Color. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual Color GetDiffuseClr(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Specular Color. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual Color GetSpecularClr(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Self Illumination Color. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual Color GetSelfIllumClr(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Self Illumination Amount. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual float GetSelfIllum(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Glossiness Level. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual float GetGlossiness(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Specular Level. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual float GetSpecularLevel(int mtlNum, BOOL backFace)=0; /*! \remarks Returns the Soften Level as a float. \par Parameters: The parameters to this method are not applicable and may safely be ignored. */ virtual float GetSoftenLevel(int mtlNum, BOOL backFace)=0; /*! \remarks Returns TRUE if the Self Illumination Color setting is on (checked); FALSE if off. */ virtual BOOL IsSelfIllumClrOn()=0; /*! \remarks Returns the Ambient Color at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the color. */ virtual Color GetAmbientClr(TimeValue t)=0; /*! \remarks Returns the Diffuse Color at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the color. */ virtual Color GetDiffuseClr(TimeValue t)=0; /*! \remarks Returns the Specular Color at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the color. */ virtual Color GetSpecularClr(TimeValue t)=0; /*! \remarks Returns the Glossiness value at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the value. */ virtual float GetGlossiness( TimeValue t)=0; /*! \remarks Returns the Specular Level at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the value. */ virtual float GetSpecularLevel(TimeValue t)=0; /*! \remarks Returns the Soften Specular Highlights setting at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the value. */ virtual float GetSoftenLevel(TimeValue t)=0; /*! \remarks Returns the Self Illumination Amount at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the value. */ virtual float GetSelfIllum(TimeValue t)=0; /*! \remarks Returns the Self Illumination Color at the specified time. \par Parameters: <b>TimeValue t</b>\n\n The time at which to return the color. */ virtual Color GetSelfIllumClr(TimeValue t)=0; /*! \remarks This method is called to evaluate the hightlight curve that appears in the Shader user interface.\n\n Note: This gets called from the <b>DrawHilite()</b> function which is available to developers in <b>/MAXSDK/SAMPLES/MATERIALS/SHADER/SHADERUTIL.CPP</b>. <b>DrawHilite()</b> get called from the window proc <b>HiliteWndProc()</b> in the same file. This code is available to developers to use in their Shader dialog procs. \par Parameters: <b>float x</b>\n\n The input value. \return The output value on the curve. A value of 1.0 represents the top of the curve as it appears in the UI. Values greater than 1.0 are okay and simply appear off the top of the graph. \par Default Implementation: <b>{ return 0.0f; }</b> */ virtual float EvalHiliteCurve(float x){ return 0.0f; } /*! \remarks This is the highlight curve function for the two highlight curves which intersect and appear in the UI, for instance in the Anistropic shader. \par Parameters: <b>float x</b>\n\n The x input value.\n\n <b>float y</b>\n\n The y input value.\n\n <b>int level = 0</b>\n\n This is used by multi-layer shaders to indicate which layer to draw. The draw highlight curve routines use this when redrawing the graph. \return The output value of the curve. \par Default Implementation: <b>{ return 0.0f; }</b> */ virtual float EvalHiliteCurve2(float x, float y, int level = 0 ){ return 0.0f; } // the Max std way of handling reflection and Transmission is // implemented here to provide the default implementation. CoreExport void ShadeReflection(ShadeContext &sc, IllumParams &ip, Color &mapClr); CoreExport void ShadeTransmission(ShadeContext &sc, IllumParams &ip, Color &mapClr, float amount); // Reshading void PreShade(ShadeContext& sc, IReshadeFragment* pFrag){} void PostShade(ShadeContext& sc, IReshadeFragment* pFrag, int& nextTexIndex, IllumParams* ip){ Illum( sc, *ip ); } // [dl | 13march2003] Adding this inlined definition to resolve compile errors BaseInterface* GetInterface(Interface_ID id) { return BaseShader::GetInterface(id); } void* GetInterface(ULONG id){ if( id == IID_IReshading ) return (IReshading*)( this ); // else if ( id == IID_IValidityToken ) // return (IValidityToken*)( this ); else return BaseShader::GetInterface(id); } }; #endif
define( ({ instruction: "ระบุรายการข้อมูลที่ต้องการแสดงลงบนหน้าเกริ่นนำของแอพลิเคชันของคุณ หน้าเกริ่นนำจะแสดงก่อนการโหลดแอพพลิเคชัน ", defaultContent: "เพิ่มข้อความ, ลิงค์, และกราฟฟิคเล็กๆ ที่นี่", requireConfirm: "ต้องการการยืนยันเพื่อดำเนินการต่อ", noRequireConfirm: "ไม่จำเป็นต้องยืนยันที่จะดำเนินการ", optionText: "การตั้งค่าสำหรับผู้ใช้งานในการปิดการแสดงผลสกรีนบนแอพพลิเคชั่นเริ่มต้น", confirmLabel: "ข้อความยืนยัน: ", defaultConfirmText: "ฉันยอมรับในข้อตกลงและข้อกำหนดต่างๆ ด้านบน", confirmOption: "แสดง Splash screen ทุกครั้งที่เปิดแอพพลิเคชัน", backgroundColor: "สีพื้นหลัง" }) );
/** * Autogenerated by Avro * * DO NOT EDIT DIRECTLY */ package org.kaaproject.kaa.examples.robotrun.gen; @SuppressWarnings("all") @org.apache.avro.specific.AvroGenerated public enum BorderType { UNKNOWN, SOLID, FREE ; public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"enum\",\"name\":\"BorderType\",\"namespace\":\"org.kaaproject.kaa.examples.robotrun.gen\",\"symbols\":[\"UNKNOWN\",\"SOLID\",\"FREE\"]}"); public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; } }
# AUTOGENERATED FILE FROM balenalib/jn30b-nano-ubuntu:bionic-run ENV NODE_VERSION 10.24.1 ENV YARN_VERSION 1.22.4 RUN buildDeps='curl libatomic1' \ && set -x \ && for key in \ <API key> \ ; do \ gpg --keyserver pgp.mit.edu --recv-keys "$key" || \ gpg --keyserver keyserver.pgp.com --recv-keys "$key" || \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$key" ; \ done \ && apt-get update && apt-get install -y $buildDeps --<API key> \
from rest_framework import serializers from accounts.models import Account class <API key>(serializers.Serializer): """ A serializer for account images. The main purpose of this class is to provide a subschema for the type of the account.image in responses. """ small = serializers.CharField() medium = serializers.CharField() large = serializers.CharField() @staticmethod def create(request, account: Account): """Get the URLs of alternative image sizes for the account.""" return dict( [ (size, request.build_absolute_uri(getattr(account.image, size)),) for size in ("small", "medium", "large") ] )
#ifndef BE_GSSAPI_COMMON_H #define BE_GSSAPI_COMMON_H #if defined(HAVE_GSSAPI_H) #include <gssapi.h> #else #include <gssapi/gssapi.h> #endif void pg_GSS_error(int severity, const char *errmsg, OM_uint32 maj_stat, OM_uint32 min_stat); #endif /* BE_GSSAPI_COMMON_H */
import React from 'react'; import { get } from 'lodash'; import { ICustomBannerConfig } from 'core/application/config/customBanner/CustomBannerConfig'; import { ApplicationReader } from 'core/application/service/ApplicationReader'; import { Markdown } from 'core/presentation/Markdown'; import { ReactInjector } from 'core/reactShims'; import { noop } from 'core/utils'; import './CustomBanner.less'; export interface ICustomBannerState { applicationName: string; bannerConfig: ICustomBannerConfig; } export class CustomBanner extends React.Component<{}, ICustomBannerState> { private <API key>: Function; public state = { applicationName: null, bannerConfig: null, } as ICustomBannerState; public componentDidMount(): void { this.<API key> = ReactInjector.$uiRouter.transitionService.onSuccess({}, () => this.updateApplication(), ); } private updateApplication(): void { const applicationName: string = get(ReactInjector, '$stateParams.application'); if (applicationName !== this.state.applicationName) { this.setState({ applicationName, bannerConfig: null, }); if (applicationName) { ApplicationReader.<API key>(applicationName) .then((attributes: any) => { this.updateBannerConfig(attributes); }) .catch(noop); } } } public updateBannerConfig(attributes: any): void { const bannerConfigs: ICustomBannerConfig[] = get(attributes, 'customBanners') || []; const bannerConfig = bannerConfigs.find((config) => config.enabled) || null; this.setState({ bannerConfig, }); } public render(): React.ReactElement<CustomBanner> { const { bannerConfig } = this.state; if (bannerConfig == null) { return null; } return ( <div className="custom-banner" style={{ background: bannerConfig.backgroundColor, color: bannerConfig.textColor, }} > <Markdown message={bannerConfig.text} /> </div> ); } public <API key>(): void { this.<API key>(); } }
# The set of languages for which implicit dependencies are needed: SET(<API key> "CXX" ) # The set of files for implicit dependencies of each language: SET(<API key> "/home/joemelt101/catkin_ws/src/irobot/src/labthree.cpp" "/home/joemelt101/catkin_ws/build/irobot/CMakeFiles/lab3_node.dir/src/labthree.cpp.o" ) SET(<API key> "GNU") # Preprocessor definitions for this target. SET(<API key> "<API key>" "<API key>=1" "ROS_PACKAGE_NAME=\"irobot\"" ) # Targets to which this target links. SET(<API key> ) # The include file search paths: SET(<API key> "/opt/ros/indigo/include" ) SET(<API key> ${<API key>}) SET(<API key> ${<API key>}) SET(<API key> ${<API key>})
#ifndef <API key> #define <API key> #define <API key> 3603 #define <API key> 1 #define <API key> 2 #define <API key> 3 #define <API key> 4 #define <API key> 4 #endif /* <API key> */
body { font-family: "futura-pt", futura,,sans-serif; background: url('../img/bg.jpg') no-repeat center center fixed; -<API key>: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover; } h1, h2, h3, h4, h5, h6 { text-transform: uppercase; font-family: "Josefin Slab","Helvetica Neue",Helvetica,Arial,sans-serif; font-weight: 700; letter-spacing: 1px; } p { font-size: 1.25em; line-height: 1.6; color: #000; } hr { max-width: 400px; border-color: #999999; } .brand, .address-bar { display: none; } .navbar-brand { text-transform: uppercase; font-weight: 900; letter-spacing: 2px; } .navbar-nav { text-transform: uppercase; font-weight: 400; letter-spacing: 3px; } .img-full { min-width: 100%; } .brand-before, .brand-name { text-transform: capitalize; } .brand-before { margin: 15px 0; } .brand-name { margin: 0; font-size: 4em; } .tagline-divider { margin: 15px auto 3px; max-width: 250px; border-color: #999999; } .box { margin-bottom: 20px; padding: 30px 15px; background: #fff; background: rgba(255,255,255,0.9); } .intro-text { text-transform: uppercase; font-size: 1.25em; font-weight: 400; letter-spacing: 1px; } .img-border { float: none; margin: 0 auto 0; border: #999999 solid 1px; } .img-left { float: none; margin: 0 auto 0; } footer { background: #fff; background: rgba(255,255,255,0.9); } footer p { margin: 0; padding: 50px 0; } @media screen and (min-width:768px) { .brand { display: inherit; margin: 0; padding: 30px 0 10px; text-align: center; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); font-family: "Josefin Slab","Helvetica Neue",Helvetica,Arial,sans-serif; font-size: 5em; font-weight: 700; line-height: normal; color: #fff; } .top-divider { margin-top: 0; } .img-left { float: left; margin-right: 25px; } .address-bar { display: inherit; margin: 0; padding: 0 0 40px; text-align: center; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); text-transform: uppercase; font-size: 1.25em; font-weight: 400; letter-spacing: 3px; color: #fff; } .navbar { border-radius: 0; } .navbar-header { display: none; } .navbar { min-height: 0; } .navbar-default { border: none; background: #fff; background: rgba(255,255,255,0.9); } .nav>li>a { padding: 35px; } .navbar-nav>li>a { line-height: normal; } .navbar-nav { display: table; float: none; margin: 0 auto; table-layout: fixed; font-size: 1.25em; } } @media screen and (min-width:1200px) { .box:after { content: ''; display: table; clear: both; } }
from viterbi import Viterbi from rtree import Rtree from spatialfunclib import * class GPSMatcher: def __init__(self, hmm, <API key>, constraint_length=10, MAX_DIST=500, priors=None, smallV=0.00000000001): # initialize spatial index self.previous_obs = None if priors == None: priors=dict([(state,1.0/len(hmm)) for state in hmm]) state_spatial_index = Rtree() unlocated_states = [] id_to_state = {} id = 0 for state in hmm: geom=self.geometry_of_state(state) if not geom: unlocated_states.append(state) else: ((lat1,lon1),(lat2,lon2))=geom state_spatial_index.insert(id, (min(lon1, lon2), min(lat1, lat2), max(lon1, lon2), max(lat1, lat2))) id_to_state[id]=state id=id+1 def candidate_states(obs): #was (lat,lon) in place of obs geom = self.<API key>(obs) if geom == None: return hmm.keys() else: (lat,lon)=geom nearby_states = state_spatial_index.intersection((lon-MAX_DIST/<API key>, lat-MAX_DIST/<API key>, lon+MAX_DIST/<API key>, lat+MAX_DIST/<API key>)) candidates = [id_to_state[id] for id in nearby_states]+unlocated_states return candidates self.viterbi = Viterbi(hmm,<API key>, constraint_length=constraint_length, priors=priors, candidate_states=candidate_states, smallV=smallV) def step(self,obs,V,p): if self.previous_obs != None: for int_obs in self.interpolated_obs(self.previous_obs, obs): V,p = self.viterbi.step(int_obs,V,p) V,p = self.viterbi.step(obs,V,p) self.previous_obs = obs return V,p def interpolated_obs(self,prev,obs): return [] def <API key>(self, obs): return obs def geometry_of_state(self, state): """ Subclasses should override this method to return the geometry of a given state, typically an edge.""" if state == 'unknown': return None else: return state
package com.tcl.launcher.gsontoobject; import java.util.HashMap; import java.util.Map; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.VolleyLog; import com.android.volley.toolbox.Volley; import com.google.gson.JsonObject; import com.tcl.launcher.data.request.GsonObjectRequest; import com.tcl.launcher.data.request.GsonRequest; import com.tcl.launcher.data.request.RequestManager; import com.tcl.launcher.data.response.TestResponse; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.view.Window; import android.widget.Button; import android.widget.EditText; public class MainActivity extends Activity implements OnClickListener{ private Button request; private String words = ""; private EditText input; private String requestUrl = "http://120.24.65.74:8080/rs/api/roseEngineControl.json?engineid=<API key>" + "0A780239&question=" + words + "&imei=test"; private JsonObject json; RequestQueue mQueue; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <API key>(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); RequestManager.init(this); input = (EditText) findViewById(R.id.input_message); request = (Button) findViewById(R.id.send); mQueue = Volley.newRequestQueue(this); request.setOnClickListener(this); } /* (non-Javadoc) * @see android.view.View.OnClickListener#onClick(android.view.View) */ @Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.send: words = input.getText().toString(); break; default: break; } } private void getNetDataTest() { String url = "http://120.24.65.74:8080/rs/api/roseItemDetail.json"; Map<String, String> params = new HashMap<String, String>(); params.put("engineid", "<API key>"); params.put("question", "5891"); params.put("imei", "test"); params.put("domain", "TVPLAY"); // executeRequest(new GsonObjectRequest<TestResponse>(Request.Method.POST, url, params, // TestResponse.class, new Response.Listener<TestResponse>() { // @Override // public void onResponse(TestResponse testResponse) { // }, new Response.ErrorListener() { // @Override // public void onErrorResponse(VolleyError volleyError) { // VolleyLog.e("error: %s", volleyError.getMessage()); RequestManager.getRequestQueue().add( new GsonObjectRequest<TestResponse>(Request.Method.POST, url, params, TestResponse.class, new Response.Listener<TestResponse>() { @Override public void onResponse(TestResponse testResponse) { Log.d("+++++", "++++++++++++++++"); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { VolleyLog.e("error: %s", volleyError.getMessage()); } })); } }
FROM balenalib/aarch64-debian:sid-build LABEL io.balena.device-type="cnx100-xavier-nx" RUN apt-get update && apt-get install -y --<API key> \ less \ kmod \ nano \ net-tools \ ifupdown \ iputils-ping \ i2c-tools \ usbutils \