text
stringlengths
2
1.04M
meta
dict
package org.ofbiz.common.status; import static org.ofbiz.base.util.UtilGenerics.checkList; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.util.EntityQuery; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ServiceUtil; /** * StatusServices */ public class StatusServices { private static final Debug.OfbizLogger module = Debug.getOfbizLogger(java.lang.invoke.MethodHandles.lookup().lookupClass()); public static final String resource = "CommonUiLabels"; public static Map<String, Object> getStatusItems(DispatchContext ctx, Map<String, ?> context) { Delegator delegator = ctx.getDelegator(); List<String> statusTypes = checkList(context.get("statusTypeIds"), String.class); Locale locale = (Locale) context.get("locale"); if (UtilValidate.isEmpty(statusTypes)) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "CommonStatusMandatory", locale)); } List<GenericValue> statusItems = new LinkedList<GenericValue>(); for (String statusTypeId: statusTypes) { try { List<GenericValue> myStatusItems = EntityQuery.use(delegator) .from("StatusItem") .where("statusTypeId", statusTypeId) .orderBy("sequenceId") .cache(true) .queryList(); statusItems.addAll(myStatusItems); } catch (GenericEntityException e) { Debug.logError(e, module); } } Map<String, Object> ret = new LinkedHashMap<String, Object>(); ret.put("statusItems",statusItems); return ret; } public static Map<String, Object> getStatusValidChangeToDetails(DispatchContext ctx, Map<String, ?> context) { Delegator delegator = ctx.getDelegator(); List<GenericValue> statusValidChangeToDetails = null; String statusId = (String) context.get("statusId"); try { statusValidChangeToDetails = EntityQuery.use(delegator) .from("StatusValidChangeToDetail") .where("statusId", statusId) .orderBy("sequenceId") .cache(true) .queryList(); } catch (GenericEntityException e) { Debug.logError(e, module); } Map<String, Object> ret = ServiceUtil.returnSuccess(); if (statusValidChangeToDetails != null) { ret.put("statusValidChangeToDetails", statusValidChangeToDetails); } return ret; } }
{ "content_hash": "090b8e5faef2d1bccf46d742d985343d", "timestamp": "", "source": "github", "line_count": 77, "max_line_length": 128, "avg_line_length": 43.077922077922075, "alnum_prop": 0.5752185709978896, "repo_name": "ilscipio/scipio-erp", "id": "661ebd76f3d96778ab93c0f0598df802c9b65034", "size": "4278", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "framework/common/src/org/ofbiz/common/status/StatusServices.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "15540" }, { "name": "CSS", "bytes": "533213" }, { "name": "FreeMarker", "bytes": "6482124" }, { "name": "Groovy", "bytes": "2254105" }, { "name": "HTML", "bytes": "4409922" }, { "name": "Java", "bytes": "23079876" }, { "name": "JavaScript", "bytes": "1106310" }, { "name": "Ruby", "bytes": "2377" }, { "name": "SCSS", "bytes": "514759" }, { "name": "Shell", "bytes": "66335" }, { "name": "XSLT", "bytes": "1712" } ], "symlink_target": "" }
package org.apache.cassandra.utils.concurrent; import java.util.Iterator; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; import java.util.concurrent.locks.LockSupport; import java.util.function.BooleanSupplier; import java.util.function.Consumer; import org.apache.cassandra.utils.Intercept; import org.apache.cassandra.utils.Shared; import org.apache.cassandra.utils.concurrent.Awaitable.AbstractAwaitable; import static org.apache.cassandra.utils.Clock.Global.nanoTime; import static org.apache.cassandra.utils.Shared.Recursive.INTERFACES; import static org.apache.cassandra.utils.Shared.Scope.SIMULATION; /** * <p>A relatively easy to use utility for general purpose thread signalling.</p> * <p>Usage on a thread awaiting a state change using a WaitQueue q is:</p> * <pre> * {@code * while (!conditionMet()) * Signal s = q.register(); * if (!conditionMet()) // or, perhaps more correctly, !conditionChanged() * s.await(); * else * s.cancel(); * } * </pre> * A signalling thread, AFTER changing the state, then calls q.signal() to wake up one, or q.signalAll() * to wake up all, waiting threads. * <p>To understand intuitively how this class works, the idea is simply that a thread, once it considers itself * incapable of making progress, registers to be awoken once that changes. Since this could have changed between * checking and registering (in which case the thread that made this change would have been unable to signal it), * it checks the condition again, sleeping only if it hasn't changed/still is not met.</p> * <p>This thread synchronisation scheme has some advantages over Condition objects and Object.wait/notify in that no monitor * acquisition is necessary and, in fact, besides the actual waiting on a signal, all operations are non-blocking. * As a result consumers can never block producers, nor each other, or vice versa, from making progress. * Threads that are signalled are also put into a RUNNABLE state almost simultaneously, so they can all immediately make * progress without having to serially acquire the monitor/lock, reducing scheduler delay incurred.</p> * * <p>A few notes on utilisation:</p> * <p>1. A thread will only exit await() when it has been signalled, but this does not guarantee the condition has not * been altered since it was signalled, and depending on your design it is likely the outer condition will need to be * checked in a loop, though this is not always the case.</p> * <p>2. Each signal is single use, so must be re-registered after each await(). This is true even if it times out.</p> * <p>3. If you choose not to wait on the signal (because the condition has been met before you waited on it) * you must cancel() the signal if the signalling thread uses signal() to awake waiters; otherwise signals will be * lost. If signalAll() is used but infrequent, and register() is frequent, cancel() should still be used to prevent the * queue growing unboundedly. Similarly, if you provide a TimerContext, cancel should be used to ensure it is not erroneously * counted towards wait time.</p> * <p>4. Care must be taken when selecting conditionMet() to ensure we are waiting on the condition that actually * indicates progress is possible. In some complex cases it may be tempting to wait on a condition that is only indicative * of local progress, not progress on the task we are aiming to complete, and a race may leave us waiting for a condition * to be met that we no longer need. * <p>5. This scheme is not fair</p> * <p>6. Only the thread that calls register() may call await()</p> * * TODO: this class should not be backed by CLQ (should use an intrusive linked-list with lower overhead) */ @Shared(scope = SIMULATION, inner = INTERFACES) public interface WaitQueue { /** * A Signal is a one-time-use mechanism for a thread to wait for notification that some condition * state has transitioned that it may be interested in (and hence should check if it is). * It is potentially transient, i.e. the state can change in the meantime, it only indicates * that it should be checked, not necessarily anything about what the expected state should be. * * Signal implementations should never wake up spuriously, they are always woken up by a * signal() or signalAll(). * * This abstract definition of Signal does not need to be tied to a WaitQueue. * Whilst RegisteredSignal is the main building block of Signals, this abstract * definition allows us to compose Signals in useful ways. The Signal is 'owned' by the * thread that registered itself with WaitQueue(s) to obtain the underlying RegisteredSignal(s); * only the owning thread should use a Signal. */ public static interface Signal extends Condition { /** * @return true if cancelled; once cancelled, must be discarded by the owning thread. */ public boolean isCancelled(); /** * @return isSignalled() || isCancelled(). Once true, the state is fixed and the Signal should be discarded * by the owning thread. */ public boolean isSet(); /** * atomically: cancels the Signal if !isSet(), or returns true if isSignalled() * * @return true if isSignalled() */ public boolean checkAndClear(); /** * Should only be called by the owning thread. Indicates the signal can be retired, * and if signalled propagates the signal to another waiting thread */ public abstract void cancel(); } /** * The calling thread MUST be the thread that uses the signal */ public Signal register(); /** * The calling thread MUST be the thread that uses the signal. * If the Signal is waited on, context.stop() will be called when the wait times out, the Signal is signalled, * or the waiting thread is interrupted. */ public <V> Signal register(V supplyOnDone, Consumer<V> receiveOnDone); /** * Signal one waiting thread */ public boolean signal(); /** * Signal all waiting threads */ public void signalAll(); /** getWaiting() > 0 */ public boolean hasWaiters(); /** Return how many threads are waiting */ public int getWaiting(); /** * Factory method used to capture and redirect instantiations for simulation */ @Intercept public static WaitQueue newWaitQueue() { return new Standard(); } class Standard implements WaitQueue { private static final int CANCELLED = -1; private static final int SIGNALLED = 1; private static final int NOT_SET = 0; private static final AtomicIntegerFieldUpdater<RegisteredSignal> signalledUpdater = AtomicIntegerFieldUpdater.newUpdater(RegisteredSignal.class, "state"); // the waiting signals private final ConcurrentLinkedQueue<RegisteredSignal> queue = new ConcurrentLinkedQueue<>(); protected Standard() {} /** * The calling thread MUST be the thread that uses the signal * @return x */ public Signal register() { RegisteredSignal signal = new RegisteredSignal(); queue.add(signal); return signal; } /** * The calling thread MUST be the thread that uses the signal. * If the Signal is waited on, context.stop() will be called when the wait times out, the Signal is signalled, * or the waiting thread is interrupted. */ public <V> Signal register(V supplyOnDone, Consumer<V> receiveOnDone) { RegisteredSignal signal = new SignalWithListener<>(supplyOnDone, receiveOnDone); queue.add(signal); return signal; } /** * Signal one waiting thread */ public boolean signal() { while (true) { RegisteredSignal s = queue.poll(); if (s == null || s.doSignal() != null) return s != null; } } /** * Signal all waiting threads */ public void signalAll() { if (!hasWaiters()) return; // to avoid a race where the condition is not met and the woken thread managed to wait on the queue before // we finish signalling it all, we pick a random thread we have woken-up and hold onto it, so that if we encounter // it again we know we're looping. We reselect a random thread periodically, progressively less often. // the "correct" solution to this problem is to use a queue that permits snapshot iteration, but this solution is sufficient // TODO: this is only necessary because we use CLQ - which is only for historical any-NIH reasons int i = 0, s = 5; Thread randomThread = null; Iterator<RegisteredSignal> iter = queue.iterator(); while (iter.hasNext()) { RegisteredSignal signal = iter.next(); Thread signalled = signal.doSignal(); if (signalled != null) { if (signalled == randomThread) break; if (++i == s) { randomThread = signalled; s <<= 1; } } iter.remove(); } } private void cleanUpCancelled() { // TODO: attempt to remove the cancelled from the beginning only (need atomic cas of head) queue.removeIf(RegisteredSignal::isCancelled); } public boolean hasWaiters() { return !queue.isEmpty(); } /** * @return how many threads are waiting */ public int getWaiting() { if (!hasWaiters()) return 0; Iterator<RegisteredSignal> iter = queue.iterator(); int count = 0; while (iter.hasNext()) { Signal next = iter.next(); if (!next.isCancelled()) count++; } return count; } /** * An abstract signal implementation * * TODO: use intrusive linked list */ public static abstract class AbstractSignal extends AbstractAwaitable implements Signal { public Signal await() throws InterruptedException { while (!isSignalled()) { checkInterrupted(); LockSupport.park(); } checkAndClear(); return this; } public boolean awaitUntil(long nanoTimeDeadline) throws InterruptedException { long now; while (nanoTimeDeadline > (now = nanoTime()) && !isSignalled()) { checkInterrupted(); long delta = nanoTimeDeadline - now; LockSupport.parkNanos(delta); } return checkAndClear(); } private void checkInterrupted() throws InterruptedException { if (Thread.interrupted()) { cancel(); throw new InterruptedException(); } } } /** * A signal registered with this WaitQueue */ private class RegisteredSignal extends AbstractSignal { private volatile Thread thread = Thread.currentThread(); volatile int state; public boolean isSignalled() { return state == SIGNALLED; } public boolean isCancelled() { return state == CANCELLED; } public boolean isSet() { return state != NOT_SET; } private Thread doSignal() { if (!isSet() && signalledUpdater.compareAndSet(this, NOT_SET, SIGNALLED)) { Thread thread = this.thread; LockSupport.unpark(thread); this.thread = null; return thread; } return null; } public void signal() { doSignal(); } public boolean checkAndClear() { if (!isSet() && signalledUpdater.compareAndSet(this, NOT_SET, CANCELLED)) { thread = null; cleanUpCancelled(); return false; } // must now be signalled assuming correct API usage return true; } /** * Should only be called by the registered thread. Indicates the signal can be retired, * and if signalled propagates the signal to another waiting thread */ public void cancel() { if (isCancelled()) return; if (!signalledUpdater.compareAndSet(this, NOT_SET, CANCELLED)) { // must already be signalled - switch to cancelled and state = CANCELLED; // propagate the signal WaitQueue.Standard.this.signal(); } thread = null; cleanUpCancelled(); } } /** * A RegisteredSignal that stores a TimerContext, and stops the timer when either cancelled or * finished waiting. i.e. if the timer is started when the signal is registered it tracks the * time in between registering and invalidating the signal. */ private final class SignalWithListener<V> extends RegisteredSignal { private final V supplyOnDone; private final Consumer<V> receiveOnDone; private SignalWithListener(V supplyOnDone, Consumer<V> receiveOnDone) { this.receiveOnDone = receiveOnDone; this.supplyOnDone = supplyOnDone; } @Override public boolean checkAndClear() { receiveOnDone.accept(supplyOnDone); return super.checkAndClear(); } @Override public void cancel() { if (!isCancelled()) { receiveOnDone.accept(supplyOnDone); super.cancel(); } } } } /** * Loops waiting on the supplied condition and WaitQueue and will not return until the condition is true */ public static void waitOnCondition(BooleanSupplier condition, WaitQueue queue) throws InterruptedException { while (!condition.getAsBoolean()) { Signal s = queue.register(); if (!condition.getAsBoolean()) s.await(); else s.cancel(); } } }
{ "content_hash": "c17fd52ffb4ea3f758687f15b9d52097", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 162, "avg_line_length": 37.17857142857143, "alnum_prop": 0.5811719500480308, "repo_name": "blambov/cassandra", "id": "e9dcdf86e9f99629208b38de332733c6687ea5c1", "size": "16422", "binary": false, "copies": "12", "ref": "refs/heads/trunk", "path": "src/java/org/apache/cassandra/utils/concurrent/WaitQueue.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AMPL", "bytes": "801" }, { "name": "GAP", "bytes": "91752" }, { "name": "HTML", "bytes": "265026" }, { "name": "Java", "bytes": "34156614" }, { "name": "Lex", "bytes": "10152" }, { "name": "Python", "bytes": "546622" }, { "name": "Shell", "bytes": "121494" } ], "symlink_target": "" }
import _extends from "@babel/runtime/helpers/esm/extends"; import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose"; import * as React from 'react'; import PropTypes from 'prop-types'; import KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft'; import KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight'; import useTheme from '../styles/useTheme'; import IconButton from '../IconButton'; /** * @ignore - internal component. */ var _ref = /*#__PURE__*/React.createElement(KeyboardArrowRight, null); var _ref2 = /*#__PURE__*/React.createElement(KeyboardArrowLeft, null); var _ref3 = /*#__PURE__*/React.createElement(KeyboardArrowLeft, null); var _ref4 = /*#__PURE__*/React.createElement(KeyboardArrowRight, null); const TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) { const { backIconButtonProps, count, nextIconButtonProps, onPageChange, page, rowsPerPage } = props, other = _objectWithoutPropertiesLoose(props, ["backIconButtonProps", "count", "nextIconButtonProps", "onPageChange", "page", "rowsPerPage"]); const theme = useTheme(); const handleBackButtonClick = event => { onPageChange(event, page - 1); }; const handleNextButtonClick = event => { onPageChange(event, page + 1); }; return /*#__PURE__*/React.createElement("div", _extends({ ref: ref }, other), /*#__PURE__*/React.createElement(IconButton, _extends({ onClick: handleBackButtonClick, disabled: page === 0, color: "inherit" }, backIconButtonProps), theme.direction === 'rtl' ? _ref : _ref2), /*#__PURE__*/React.createElement(IconButton, _extends({ onClick: handleNextButtonClick, disabled: count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false, color: "inherit" }, nextIconButtonProps), theme.direction === 'rtl' ? _ref3 : _ref4)); }); process.env.NODE_ENV !== "production" ? TablePaginationActions.propTypes = { /** * Props applied to the back arrow [`IconButton`](/api/icon-button/) element. */ backIconButtonProps: PropTypes.object, /** * The total number of rows. */ count: PropTypes.number.isRequired, /** * Props applied to the next arrow [`IconButton`](/api/icon-button/) element. */ nextIconButtonProps: PropTypes.object, /** * Callback fired when the page is changed. * * @param {object} event The event source of the callback. * @param {number} page The page selected. */ onPageChange: PropTypes.func.isRequired, /** * The zero-based index of the current page. */ page: PropTypes.number.isRequired, /** * The number of rows per page. */ rowsPerPage: PropTypes.number.isRequired } : void 0; export default TablePaginationActions;
{ "content_hash": "614fead1b778ea0659f72bfdcb2caca4", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 149, "avg_line_length": 31.977272727272727, "alnum_prop": 0.6865671641791045, "repo_name": "cdnjs/cdnjs", "id": "898c6c538b5a0b5335d6b9459a660929329f1ed0", "size": "2814", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ajax/libs/material-ui/4.11.3-deprecations.1/es/TablePagination/TablePaginationActions.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
A set of directives to simplify your workflow with [BEM](https://bem.info)-markup in [Angular](https://angularjs.org) (v2+) applications. [ANGULAR 1.X VERSION IS HERE](https://github.com/tenphi/angular-bem/tree/v1) ## Changelog ### 2.1.0 * Support for Angular v6+ * Refactoring ### 2.0.0 * Initial release for Angular v2+ ## Install ```bash $ npm install angular-bem ``` ## Example Import this module to your app: ```javascript import { BemModule } from 'angular-bem'; @NgModule({ imports: [ BemModule ] }) export class AppModule {} ``` Now anywhere in your app you can use following syntax: ```html <div block="my-block" mod="modName"> <div elem="my-element" mod="modName secondModName"></div> </div> ``` or ```html <div block="my-block" [mod]="{ modName: true }"> <div elem="my-element" [mod]="{ modName: true, secondModName: true }"></div> </div> ``` Instead of `true` you can use any property from the component. Value `true` will add mod to the block (or elem) and `false` will remove it. As a result of module's work the following markup may be produced: ```html <div class="my-block my-block--mod-name"> <div class="my-block__my-element my-block__my-element--mod-name my-block__my-element--second-mod-name"></div> </div> ``` If you use `string` or `number` as a value then this value will be used as addition for the mod class like `my-block__my-element--mod-name-value`. ## Configuration You can change module behaviour with BemConfig: ```javascript import { BemModule } from 'angular-bem'; BemModule.config({ separators: ['__', '--', '-'], // el / mod / val separators modCase: 'kebab', // case of modifiers names ignoreValues: false // cast mod values to booleans }); // method returns BemModule ``` It is recommended to set `ignoreValues` to `true` but it is set to `false` by default to support traditional bem-syntax. ## Need to know * These directives don't affect scope or other directives. So you can use them at ease wherever you want. * You can only specify one element or block on single node. This limitation greatly simplify code of module and your app. * There is **no way** to create an element of parent block **inside** nested block. It's not a component-way. So please avoid it. ## License [MIT](http://opensource.org/licenses/MIT) © [Andrey Yamanov](http://tenphi.me)
{ "content_hash": "08d4dc707d543d1d7788d3b13b385af7", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 146, "avg_line_length": 28.120481927710845, "alnum_prop": 0.6996572407883462, "repo_name": "tenphi/angular-bem", "id": "2e4bed9f5afe5be305c9048e3e686f3e34f8a212", "size": "2350", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dist/README.md", "mode": "33188", "license": "mit", "language": [ { "name": "TypeScript", "bytes": "5121" } ], "symlink_target": "" }
#pragma once #include <memory> #include <string> #include "cyber/cyber.h" #include "modules/perception/lidar/common/lidar_frame.h" #include "modules/perception/onboard/inner_component_messages/inner_component_messages.h" #include "modules/perception/proto/perception_obstacle.pb.h" namespace apollo { namespace perception { namespace onboard { class LidarFrameMessage { public: LidarFrameMessage() : lidar_frame_(nullptr) { type_name_ = "LidarFrameMessage"; } ~LidarFrameMessage() = default; std::string GetTypeName() const { return type_name_; } LidarFrameMessage* New() const { return new LidarFrameMessage; } public: double timestamp_ = 0.0; uint32_t seq_num_ = 0; std::string type_name_; ProcessStage process_stage_ = ProcessStage::UNKNOWN_STAGE; apollo::common::ErrorCode error_code_ = apollo::common::ErrorCode::OK; std::shared_ptr<lidar::LidarFrame> lidar_frame_; }; } // namespace onboard } // namespace perception } // namespace apollo
{ "content_hash": "21661cc4a5f6da263a7f7c5002373ff3", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 89, "avg_line_length": 25.28205128205128, "alnum_prop": 0.72920892494929, "repo_name": "wanglei828/apollo", "id": "bec6d3f1906759934c20b25a5fd25e16e88f146d", "size": "1758", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "modules/perception/onboard/component/lidar_inner_component_messages.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Assembly", "bytes": "1922" }, { "name": "Batchfile", "bytes": "791" }, { "name": "C", "bytes": "22662" }, { "name": "C++", "bytes": "17378263" }, { "name": "CMake", "bytes": "3600" }, { "name": "CSS", "bytes": "40785" }, { "name": "Cuda", "bytes": "97324" }, { "name": "Dockerfile", "bytes": "11960" }, { "name": "GLSL", "bytes": "7000" }, { "name": "HTML", "bytes": "21068" }, { "name": "JavaScript", "bytes": "364183" }, { "name": "Makefile", "bytes": "6626" }, { "name": "Python", "bytes": "1902086" }, { "name": "Shell", "bytes": "302902" }, { "name": "Smarty", "bytes": "33258" } ], "symlink_target": "" }
define( [ "util/xhr", "localized", "jquery" ], function( XHR, Localized, $ ) { var __plugins = {}; function EditorHelper( butter ) { var _this = this; function _updateFunction( e ) { var trackEvent = e.target; if ( trackEvent.popcornTrackEvent && __plugins[ trackEvent.type ] ) { __plugins[ trackEvent.type ].call( _this, trackEvent, butter.currentMedia.popcorn.popcorn, $ ); } } //updateFunction butter.listen( "trackeventupdated", _updateFunction ); // This fix is to ensure content-editable still updates correctly, and deals with ie9 not reading document.activeElement properly function blurActiveEl() { if ( document.activeElement && document.activeElement.blur ) { document.activeElement.blur(); } } function calculateFinalPositions( event, ui, trackEvent, targetContainer, container, options ) { var target = targetContainer.getBoundingClientRect(), height = container.clientHeight, width = container.clientWidth, top = ui.position.top, left = ui.position.left, targetHeight = target.height, targetWidth = target.width, minHeightPix = targetHeight * ( ( options.minHeight || 0 ) / 100 ), minWidthPix = targetWidth * ( ( options.minWidth || 0 ) / 100 ); top = Math.max( 0, top ); left = Math.max( 0, left ); height = Math.max( minHeightPix, height ); width = Math.max( minWidthPix, width ); if ( ( container.offsetTop + height ) > targetHeight ) { top = targetHeight - height; } if ( ( container.offsetLeft + width ) > targetWidth ) { left = targetWidth - width; } height = ( height / targetHeight ) * 100; width = ( width / targetWidth ) * 100; if ( options.end ) { options.end(); } // Enforce container size here, instead of relying on the update. container.style.width = width + "%"; container.style.height = height + "%"; blurActiveEl(); trackEvent.update({ height: height, width: width, top: ( top / targetHeight ) * 100, left: ( left / targetWidth ) * 100 }); } _this.selectable = function( trackEvent, dragContainer ) { var highlight = function() { var media, manifestOptions, track = trackEvent.track; if ( !track || !track._media ) { return; } if ( !trackEvent.manifest || !trackEvent.manifest.options ) { return; } media = track._media; manifestOptions = trackEvent.manifest.options; if ( "zindex" in manifestOptions ) { var newZIndex = media.maxPluginZIndex - track.order; if ( trackEvent.selected ) { dragContainer.classList.add( "track-event-selected" ); dragContainer.style.zIndex = newZIndex + media.maxPluginZIndex; } else { dragContainer.style.zIndex = newZIndex; dragContainer.classList.remove( "track-event-selected" ); } } }; var onSelect = function( e ) { e.stopPropagation(); if ( !e.shiftKey ) { butter.deselectAllTrackEvents(); } trackEvent.selected = true; // If the current open editor isn't a trackevent editor, // open an editor for this event if ( !butter.editor.currentEditor.getTrackEvent ) { butter.editor.editTrackEvent( trackEvent ); } }; var update = function() { dragContainer.removeEventListener( "mousedown", onSelect, false ); trackEvent.unlisten( "trackeventselected", highlight ); trackEvent.unlisten( "trackeventdeselected", highlight ); trackEvent.unlisten( "trackeventupdated", update ); }; highlight(); dragContainer.addEventListener( "mousedown", onSelect, false ); trackEvent.listen( "trackeventselected", highlight ); trackEvent.listen( "trackeventdeselected", highlight ); trackEvent.listen( "trackeventupdated", update ); }; /** * Member: draggable * * Makes a container draggable using jQueryUI * * @param {TrackEvent} trackEvent: The trackEvent to update when position changes * @param {DOMElement} dragContainer: the container which to apply draggable to * @param {media} The current media's target element in Butter ( parent container ) * @param {Object} extra options to apply to the draggable call * Options are: * {DOMElement} handle: Restrict drag start event to this element * {Function} start: Function to execute on drag start event * {Function} end: Fucntion to execute on drag end event */ _this.draggable = function( trackEvent, dragContainer, targetContainer, options ) { if ( $( dragContainer ).data( "draggable" ) ) { return; } var iframeCover = targetContainer.querySelector( ".butter-iframe-fix" ); options = options || {}; var el = document.createElement( "div" ), stopPropagation = false, onBlur, onStopPropagation, onMouseDown, onMouseUp, onDblClick, tooltipElement; if ( !options.disableTooltip ) { tooltipElement = document.createElement( "div" ); tooltipElement.innerHTML = options.tooltip || Localized.get( "Double click to edit" ); tooltipElement.classList.add( "butter-tooltip" ); tooltipElement.classList.add( "butter-tooltip-middle" ); dragContainer.appendChild( tooltipElement ); tooltipElement.style.marginTop = "-" + ( tooltipElement.offsetHeight / 2 ) + "px"; } onBlur = function() { if ( stopPropagation ) { stopPropagation = false; return; } if ( tooltipElement ) { tooltipElement.classList.remove( "tooltip-off" ); } dragContainer.removeEventListener( "mousedown", onStopPropagation, false ); el.addEventListener( "dblclick", onDblClick, false ); document.removeEventListener( "mousedown", onBlur, false ); el.style.display = ""; dragContainer.classList.remove( "track-event-editing" ); }; onStopPropagation = function() { stopPropagation = true; }; onDblClick = function() { if ( tooltipElement ) { tooltipElement.classList.add( "tooltip-off" ); } dragContainer.addEventListener( "mousedown", onStopPropagation, false ); el.removeEventListener( "dblclick", onDblClick, false ); document.addEventListener( "mousedown", onBlur, false ); el.style.display = "none"; dragContainer.classList.add( "track-event-editing" ); }; el.classList.add( "ui-draggable-handle" ); if ( options.editable !== false ) { el.addEventListener( "dblclick", onDblClick, false ); } dragContainer.appendChild( el ); onMouseDown = function() { document.addEventListener( "mouseup", onMouseUp, false ); el.removeEventListener( "mouseup", onMouseDown, false ); dragContainer.style.overflow = "hidden"; }; onMouseUp = function() { document.removeEventListener( "mouseup", onMouseUp, false ); el.addEventListener( "mouseup", onMouseDown, false ); dragContainer.style.overflow = ""; }; // This ensures the height of the element is not increased el.addEventListener( "mousedown", onMouseDown, false ); $( dragContainer ).draggable({ handle: ".ui-draggable-handle", containment: "parent", start: function() { iframeCover.style.display = "block"; // Open the editor butter.editor.editTrackEvent( trackEvent ); if ( options.start ) { options.start(); } }, stop: function( event, ui ) { iframeCover.style.display = "none"; calculateFinalPositions( event, ui, trackEvent, targetContainer, dragContainer, options ); } }); return { edit: onDblClick }; }; /** * Member: resizable * * Makes a container resizable using jQueryUI * * @param {TrackEvent} trackEvent: The trackEvent to update when size changes * @param {DOMElement} resizeContainer: the container which to apply resizable to * @param {media} The current media's target element in Butter ( parent container ) * @param {Object} extra options to apply to the resizeable call * Options are: * {String} handlePositions: describes where to position resize handles ( i.e. "n,s,e,w" ) * - Recommended that this option is specified due to a bug in z-indexing with * jQueryUI Resizable. * {Function} start: Function to execute on resize start event * {Function} end: Fucntion to execute on resize end event * {Number} minWidth: Minimum width that the resizeContainer should be * {Number} minHeight: Minimum height that the resizeContainer should be */ _this.resizable = function( trackEvent, resizeContainer, targetContainer, options ) { if ( $( resizeContainer ).data( "resizable" ) ) { return; } var iframeCover = targetContainer.querySelector( ".butter-iframe-fix" ), handlePositions = options.handlePositions; function createHelper( suffix ) { var el = document.createElement( "div" ); el.classList.add( "ui-resizable-handle" ); el.classList.add( "ui-resizable-" + suffix ); return el; } if ( handlePositions.search( /\bn\b/ ) > -1 ) { resizeContainer.appendChild( createHelper( "top" ) ); } if ( handlePositions.search( /\bs\b/ ) > -1 ) { resizeContainer.appendChild( createHelper( "bottom" ) ); } if ( handlePositions.search( /\bw\b/ ) > -1 ) { resizeContainer.appendChild( createHelper( "left" ) ); } if ( handlePositions.search( /\be\b/ ) > -1 ) { resizeContainer.appendChild( createHelper( "right" ) ); } options = options || {}; $( resizeContainer ).resizable({ handles: options.handlePositions, start: function() { iframeCover.style.display = "block"; // Open the editor butter.editor.editTrackEvent( trackEvent ); if ( options.start ) { options.start(); } }, containment: "parent", stop: function( event, ui ) { iframeCover.style.display = "none"; calculateFinalPositions( event, ui, trackEvent, targetContainer, resizeContainer, options ); } }); }; /** * Member: contentEditable * * Makes a container's content editable using contenteditable * * @param {TrackEvent} trackEvent: The trackEvent to update when content changes * @param {DOMElement} contentContainer: the container which to listen for changes and set as editable */ _this.contentEditable = function( trackEvent, contentContainers ) { var newText = "", contentContainer, updateText, updateTrackEvent, onBlur, onKeyDown, onMouseDown; updateText = function() { newText = ""; for ( var i = 0, l = contentContainers.length; i < l; i++ ) { contentContainer = contentContainers[ i ]; contentContainer.innerHTML = contentContainer.innerHTML.replace( /<br>/g, "\n" ); newText += contentContainer.textContent; if ( i < l - 1 ) { newText += "\n"; } } }; updateTrackEvent = function() { blurActiveEl(); trackEvent.update({ text: newText }); }; onBlur = function() { // store the new text. updateText(); // update the text after any existing events are done. // this way we do not revert any other event's changes. setTimeout( updateTrackEvent, 0 ); }; onKeyDown = function( e ) { // enter key for an update. // shift + enter for newline. if ( !e.shiftKey && e.keyCode === 13 ) { updateText(); updateTrackEvent(); } }; onMouseDown = function( e ) { e.stopPropagation(); // Open the editor butter.editor.editTrackEvent( trackEvent ); }; for ( var i = 0, l = contentContainers.length; i < l; i++ ) { contentContainer = contentContainers[ i ]; if ( contentContainer ) { contentContainer.addEventListener( "blur", onBlur, false ); contentContainer.addEventListener( "keydown", onKeyDown, false ); contentContainer.addEventListener( "mousedown", onMouseDown, false ); contentContainer.setAttribute( "contenteditable", "true" ); } } }; /** * Member: droppable * * Make a container listen for drop events for loading images from a local machine * * @param {TrackEvent} trackEvent: The trackEvent to update when content changes * @param {DOMElement} dropContainer: The container that listens for the drop events */ _this.droppable = function( trackEvent, dropContainer ) { dropContainer.addEventListener( "dragover", function( e ) { e.preventDefault(); dropContainer.classList.add( "butter-dragover" ); }, false ); dropContainer.addEventListener( "dragleave", function( e ) { e.preventDefault(); dropContainer.classList.remove( "butter-dragover" ); }, false ); dropContainer.addEventListener( "mousedown", function( e ) { // Prevent being able to drag the images inside and re drop them e.preventDefault(); }, false ); dropContainer.addEventListener( "drop", function( e ) { var file, fd; e.preventDefault(); e.stopPropagation(); dropContainer.classList.remove( "butter-dragover" ); if ( !e.dataTransfer || !e.dataTransfer.files || !e.dataTransfer.files[ 0 ] ) { butter.dispatch( "droppable-unsupported" ); return; } file = e.dataTransfer.files[ 0 ]; fd = new FormData(); fd.append( "image", file ); XHR.put( "/api/image", fd, function( data ) { if ( !data.error ) { if ( trackEvent ) { trackEvent.update( { src: data.url, title: file.name } ); } butter.dispatch( "droppable-succeeded", data.url ); } else { butter.dispatch( "droppable-upload-failed", data.error ); } }); if ( trackEvent ) { butter.editor.editTrackEvent( trackEvent ); } }, false ); }; _this.addPlugin = function( plugin, callback ) { __plugins[ plugin ] = callback; }; } return EditorHelper; }); //define
{ "content_hash": "d7fe7c14b14e6ce0897e5bcdc812986a", "timestamp": "", "source": "github", "line_count": 453, "max_line_length": 133, "avg_line_length": 33.75275938189846, "alnum_prop": 0.5833224329627207, "repo_name": "kaltura/popcorn.webmaker.org", "id": "55660ef9b91d5cc6a53c557b561277a7f8b6a398", "size": "15290", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/src/editor/editorhelper.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "134072" }, { "name": "JavaScript", "bytes": "1056237" }, { "name": "Python", "bytes": "2916" } ], "symlink_target": "" }
from __future__ import absolute_import __doc__ = """ Binary Tree Package =================== Python Trees ------------ Balanced and unbalanced binary trees written in pure Python with a dict-like API. Classes ~~~~~~~ * BinaryTree -- unbalanced binary tree * AVLTree -- balanced AVL-Tree * RBTree -- balanced Red-Black-Tree Cython Trees ------------ Basic tree functions written in Cython/C, merged with _ABCTree() to provide the full API of the Python Trees. Classes ~~~~~~~ * FastBinaryTree -- unbalanced binary tree * FastAVLTree -- balanced AVLTree * FastRBTree -- balanced Red-Black-Tree Overview of API for all Classes =============================== * TreeClass ([compare]) -> new empty tree. * TreeClass(mapping, [compare]) -> new tree initialized from a mapping * TreeClass(seq, [compare]) -> new tree initialized from seq [(k1, v1), (k2, v2), ... (kn, vn)] Methods ------- * __contains__(k) -> True if T has a key k, else False, O(log(n)) * __delitem__(y) <==> del T[y], O(log(n)) * __getitem__(y) <==> T[y], O(log(n)) * __iter__() <==> iter(T) * __len__() <==> len(T), O(1) * __max__() <==> max(T), get max item (k,v) of T, O(log(n)) * __min__() <==> min(T), get min item (k,v) of T, O(log(n)) * __and__(other) <==> T & other, intersection * __or__(other) <==> T | other, union * __sub__(other) <==> T - other, difference * __xor__(other) <==> T ^ other, symmetric_difference * __repr__() <==> repr(T) * __setitem__(k, v) <==> T[k] = v, O(log(n)) * clear() -> None, Remove all items from T, , O(n) * copy() -> a shallow copy of T, O(n*log(n)) * discard(k) -> None, remove k from T, if k is present, O(log(n)) * get(k[,d]) -> T[k] if k in T, else d, O(log(n)) * is_empty() -> True if len(T) == 0, O(1) * items([reverse]) -> list of T's (k, v) pairs, as 2-tuple, O(n) * keys([reverse]) -> list of T's keys, O(n) * values([reverse]) -> list of T's values, O(n) * pop(k[,d]) -> v, remove specified key and return the corresponding value, O(log(n)) * pop_item() -> (k, v), remove and return some (key, value) pair as a 2-tuple, O(log(n)) * set_default(k[,d]) -> T.get(k, d), also set T[k]=d if k not in T, O(log(n)) * update(E) -> None. Update T from dict/iterable E, O(E*log(n)) * iter_items(s, e, reverse) -> generator for (k, v) items of T for s <= key < e, O(n) walk forward/backward, O(log(n)) * prev_item(key) -> get (k, v) pair, where k is predecessor to key, O(log(n)) * prev_key(key) -> k, get the predecessor of key, O(log(n)) * succ_item(key) -> get (k,v) pair as a 2-tuple, where k is successor to key, O(log(n)) * succ_key(key) -> k, get the successor of key, O(log(n)) slicing by keys * item_slice(s, e, reverse) -> generator for (k, v) items of T for s <= key < e, O(n), synonym for iter_items(...) * key_slice(s, e, reverse) -> generator for keys of T for s <= key < e, O(n) * value_slice(s, e, reverse) -> generator for values of T for s <= key < e, O(n) * T[s:e] -> TreeSlice object, with keys in range s <= key < e, O(n) * del T[s:e] -> remove items by key slicing, for s <= key < e, O(n) if 's' is None or T[:e] TreeSlice/iterator starts with value of min_key() if 'e' is None or T[s:] TreeSlice/iterator ends with value of max_key() T[:] is a TreeSlice which represents the whole tree. The step argument of the regular slicing syntax T[s:e:step] will silently ignored. TreeSlice is a tree wrapper with range check, and contains no references to objects, deleting objects in the associated tree also deletes the object in the TreeSlice. * TreeSlice[k] -> get value for key k, raises KeyError if k not exists in range s:e * TreeSlice[s1:e1] -> TreeSlice object, with keys in range s1 <= key < e1 * new lower bound is max(s, s1) * new upper bound is min(e, e1) TreeSlice methods: * items() -> generator for (k, v) items of T, O(n) * keys() -> generator for keys of T, O(n) * values() -> generator for values of T, O(n) * __iter__ <==> keys() * __repr__ <==> repr(T) * __contains__(key)-> True if TreeSlice has a key k, else False, O(log(n)) Heap methods * max_item() -> get biggest (key, value) pair of T, O(log(n)) * max_key() -> get biggest key of T, O(log(n)) * min_item() -> get smallest (key, value) pair of T, O(log(n)) * min_key() -> get smallest key of T, O(log(n)) * pop_min() -> (k, v), remove item with minimum key, O(log(n)) * pop_max() -> (k, v), remove item with maximum key, O(log(n)) * nlargest(i[,pop]) -> get list of i largest items (k, v), O(i*log(n)) * nsmallest(i[,pop]) -> get list of i smallest items (k, v), O(i*log(n)) Set methods (using frozenset) * intersection(t1, t2, ...) -> Tree with keys *common* to all trees * union(t1, t2, ...) -> Tree with keys from *either* trees * difference(t1, t2, ...) -> Tree with keys in T but not any of t1, t2, ... * symmetric_difference(t1) -> Tree with keys in either T and t1 but not both * is_subset(S) -> True if every element in T is in S * is_superset(S) -> True if every element in S is in T * is_disjoint(S) -> True if T has a null intersection with S Classmethods * from_keys(S[,v]) -> New tree with keys from S and values equal to v. Helper functions * bintrees.has_fast_tree_support() -> True if Cython extension is working else False (False = using pure Python implementation) """ from .bintree import BinaryTree from .avltree import AVLTree from .rbtree import RBTree def has_fast_tree_support(): return FastBinaryTree is not BinaryTree try: from .cython_trees import FastBinaryTree except ImportError: # fall back to pure Python version FastBinaryTree = BinaryTree try: from .cython_trees import FastAVLTree except ImportError: # fall back to pure Python version FastAVLTree = AVLTree try: from .cython_trees import FastRBTree except ImportError: # fall back to pure Python version FastRBTree = RBTree
{ "content_hash": "2fe348d5a2fd88e1be9c39711baf3adf", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 127, "avg_line_length": 36.68518518518518, "alnum_prop": 0.6168601716304897, "repo_name": "emptyewer/DEEPN", "id": "07a68c04bfff264d1d4580c4a584cfa09cc60424", "size": "6125", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "libraries/bintrees/__init__.py", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "833" }, { "name": "Inno Setup", "bytes": "1623" }, { "name": "OpenEdge ABL", "bytes": "41306261" }, { "name": "Python", "bytes": "1108317" }, { "name": "Shell", "bytes": "1944" }, { "name": "TeX", "bytes": "95537" } ], "symlink_target": "" }
""" Tests remarks elements parsing """ # pylint: disable=protected-access # library import unittest # module from avwx import static, structs from avwx.parsing import core, remarks class TestRemarks(unittest.TestCase): """ Tests remarks elements parsing """ def test_tdec(self): """ Tests that a 4-digit number gets decoded into a readable temperature """ for code, temp in (("1045", "-4.5°C"), ("0237", "23.7°C"), ("0987", "98.7°C")): self.assertEqual(remarks._tdec(code), temp) def test_temp_minmax(self): """ Tests the minimum and maximum temperature translation string """ for code, ttype, temp in ( ("21045", "minimum", "-4.5°C"), ("10237", "maximum", "23.7°C"), ("10987", "maximum", "98.7°C"), ): equals = f"6-hour {ttype} temperature {temp}" self.assertEqual(remarks.temp_minmax(code), equals) def test_pressure_tendency(self): """ Tests translating the pressure tendency code """ for code, pressure in (("50123", "12.3"), ("54987", "98.7"), ("51846", "84.6")): equals = ( "3-hour pressure difference: +/- " f"{pressure} mb - {static.taf.PRESSURE_TENDENCIES[code[1]]}" ) self.assertEqual(remarks.pressure_tendency(code), equals) def test_precip_36(self): """ Tests translating the three and six hour precipitation code """ for code, three, six in (("60720", 7, 20), ("60000", 0, 0), ("60104", 1, 4)): equals = ( f"Precipitation in the last 3 hours: {three} in. - 6 hours: {six} in." ) self.assertEqual(remarks.precip_36(code), equals) def test_precip_24(self): """ Tests translating the 24-hour precipitation code """ for code, precip in (("70016", 16), ("79999", 9999), ("70000", 0)): equals = f"Precipitation in the last 24 hours: {precip} in." self.assertEqual(remarks.precip_24(code), equals) def test_sunshine_duration(self): """ Tests translating the sunshine duration code """ for code, minutes in (("90000", 0), ("99999", 9999), ("91234", 1234)): equals = f"Duration of sunlight: {minutes} minutes" self.assertEqual(remarks.sunshine_duration(code), equals) def test_parse(self): """ Tests generating RemarksData from a remarks string """ for rmk, data in ( ("", (None, None)), ("T09870123", ("12.3", "98.7")), ("RMK AO2 SLP141 T02670189 $", ("18.9", "26.7")), ): data = [core.make_number(d) for d in data] self.assertEqual(remarks.parse(rmk), structs.RemarksData(*data)) def test_translate(self): """ Tests extracting translations from the remarks string """ for rmk, out in ( ( "RMK AO1 ACFT MSHP SLP137 T02720183 BINOVC", { "ACFT MSHP": "Aircraft mishap", "AO1": "Automated with no precipitation sensor", "BINOVC": "Breaks in Overcast", "SLP137": "Sea level pressure: 1013.7 hPa", "T02720183": "Temperature 27.2°C and dewpoint 18.3°C", }, ), ( "RMK AO2 51014 21045 60720 70016", { "21045": "6-hour minimum temperature -4.5°C", "51014": "3-hour pressure difference: +/- 1.4 mb - Increasing, then steady", "60720": "Precipitation in the last 3 hours: 7 in. - 6 hours: 20 in.", "70016": "Precipitation in the last 24 hours: 16 in.", "AO2": "Automated with precipitation sensor", }, ), ( "RMK 91234 TSB20 P0123 NOSPECI $", { "$": "ASOS requires maintenance", "91234": "Duration of sunlight: 1234 minutes", "NOSPECI": "No SPECI reports taken", "P0123": "Hourly precipitation: 1.23 in.", "TSB20": "Thunderstorm began at :20", }, ), ): self.assertEqual(remarks.translate(rmk), out)
{ "content_hash": "44fc4e142e2570ae10cccb3d16032b2b", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 96, "avg_line_length": 35.943548387096776, "alnum_prop": 0.5054969710567646, "repo_name": "flyinactor91/AVWX-Engine", "id": "bbfcd53c85ffa826ee49157c2e34e83a8e5fb925", "size": "4466", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tests/parsing/test_remarks.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "172268" } ], "symlink_target": "" }
package com.twitter.finagle.memcachedx import _root_.java.lang.{Boolean => JBoolean} import com.twitter.finagle.memcachedx.protocol._ import com.twitter.finagle.memcachedx.protocol.Stored import com.twitter.finagle.memcachedx.protocol.Exists import com.twitter.finagle.Service import com.twitter.io.Buf import com.twitter.util.{Future, Time} // Client interface supporting twemcache commands trait TwemcacheClient extends Client { /** * Get a set of keys from the server, together with a "version" * token. * * @return a Map[String, (Buf, Buf)] of all the * keys the server had, together with their "version" token */ def getv(key: String): Future[Option[(Buf, Buf)]] = getv(Seq(key)) map { _.values.headOption } def getv(keys: Iterable[String]): Future[Map[String, (Buf, Buf)]] = { getvResult(keys) flatMap { result => if (result.failures.nonEmpty) { Future.exception(result.failures.values.head) } else { Future.value(result.valuesWithTokens) } } } /** * Get the server returned value for a set of keys for getv operation, in the format * of GetsResult since the data format for gets and getv are identical * @return */ def getvResult(keys: Iterable[String]): Future[GetsResult] /** * Perform a UPSERT operation on the key, only if the value 'version' is not * newer than the provided one. * * @return true if replaced, false if not */ def upsert(key: String, value: Buf, version: Buf): Future[JBoolean] = upsert(key, 0, Time.epoch, value, version) def upsert(key: String, flags: Int, expiry: Time, value: Buf, version: Buf): Future[JBoolean] } /** * Twemcache commands implementation. * This trait can only be mixed into a memcache client implementation as extension. */ trait TwemcacheConnectedClient extends TwemcacheClient { self: ConnectedClient => def getvResult(keys: Iterable[String]): Future[GetsResult] = { try { if (keys==null) throw new IllegalArgumentException("Invalid keys: keys cannot be null") val bufs = keys.map { Buf.Utf8(_) }.toSeq rawGet(Getv(bufs)) map { GetsResult(_) } // map to GetsResult as the response format are the same } catch { case t:IllegalArgumentException => Future.exception(new ClientError(t.getMessage)) } } def upsert(key: String, flags: Int, expiry: Time, value: Buf, version: Buf): Future[JBoolean] = { try { service(Upsert(Buf.Utf8(key), flags, expiry, value, version)) map { case Stored() => true case Exists() => false case Error(e) => throw e case _ => throw new IllegalStateException } } catch { case t:IllegalArgumentException => Future.exception(new ClientError(t.getMessage)) } } } object TwemcacheClient { /** * Construct a twemcache client from a single Service, which supports both memcache and twemcache command */ def apply(raw: Service[Command, Response]): TwemcacheClient = { new ConnectedClient(raw) with TwemcacheConnectedClient } } /** * Twemcache commands implemenation for a partitioned client. * This trait can only be mixed into a ParitioneedClient that is delegating twemcache compatible clients. */ trait TwemcachePartitionedClient extends TwemcacheClient { self: PartitionedClient => // For now we requires the ParitionedClient must be delgating TwemcacheClient. // Refactory is on the way to re-archytect the partitioned client protected[memcachedx] def twemcacheClientOf(key: String): TwemcacheClient = clientOf(key).asInstanceOf[TwemcacheClient] def getvResult(keys: Iterable[String]) = { if (keys.nonEmpty) { withKeysGroupedByClient(keys) { _.getvResult(_) } map { GetResult.merged(_) } } else { Future.value(GetsResult(GetResult())) } } def upsert(key: String, flags: Int, expiry: Time, value: Buf, version: Buf) = twemcacheClientOf(key).upsert(key, flags, expiry, value, version) private[this] def withKeysGroupedByClient[A]( keys: Iterable[String])(f: (TwemcacheClient, Iterable[String]) => Future[A] ): Future[Seq[A]] = { Future.collect( keys groupBy(twemcacheClientOf(_)) map Function.tupled(f) toSeq ) } }
{ "content_hash": "eac8fd23be6652f02e695a3ddaa2e43e", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 121, "avg_line_length": 35.28333333333333, "alnum_prop": 0.6908360888049127, "repo_name": "olix0r/finagle", "id": "1c4db8b474085a293692f872ffee61ff6942b0bc", "size": "4234", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "finagle-memcachedx/src/main/scala/com/twitter/finagle/memcachedx/TwemcacheCacheClient.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2051" }, { "name": "Java", "bytes": "958261" }, { "name": "Makefile", "bytes": "292" }, { "name": "Python", "bytes": "53657" }, { "name": "Ruby", "bytes": "23987" }, { "name": "Scala", "bytes": "3897318" }, { "name": "Shell", "bytes": "12233" }, { "name": "Thrift", "bytes": "18518" } ], "symlink_target": "" }
--- layout: 02-project name: infocus title: InFocus categories: - portfolio tags: [Coding, Content Management, CSS, Design, Graphic design, HTML] website: infocus.com project: InFocus excerpt: This job marked my beginning as a web designer. color-dark: 0D1C45 --- InFocus was my first official job in the web industry. I was hired as a web master to maintain the existing site white ISITE Design conducted a redesign. In addition to maintaining existing pages, I was also involved with creating new pages, creating graphic media, signs, posters, and internal web page designs.
{ "content_hash": "2b0be5d7606a61f66a78dc0d42e5f25b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 312, "avg_line_length": 41.357142857142854, "alnum_prop": 0.7841105354058722, "repo_name": "mapleandpine/nicmarson-website", "id": "49b3e3742dab9482590c578433d498a3aeedf659", "size": "581", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "bak/portfolio/2005-12-01-infocus.md", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "59698" }, { "name": "CSS", "bytes": "350356" }, { "name": "HTML", "bytes": "986390" }, { "name": "JavaScript", "bytes": "355862" }, { "name": "Ruby", "bytes": "6034" } ], "symlink_target": "" }
package main import ( "fmt" "testing" "github.com/jyggen/advent-of-go/internal/solver" ) var testCases = []*solver.TestCase{ { Input: "Step C must be finished before step A can begin.\nStep C must be finished before step F can begin.\nStep A must be finished before step B can begin.\nStep A must be finished before step D can begin.\nStep B must be finished before step E can begin.\nStep D must be finished before step E can begin.\nStep F must be finished before step E can begin.", Solvers: []*solver.TestCaseSolver{ { Solver: SolvePart1, Output: "CABDFE", }, }, }, { Input: solver.InputFromFile("input.txt"), Short: true, Solvers: []*solver.TestCaseSolver{ { Solver: SolvePart1, Output: "CHILFNMORYKGAQXUVBZPSJWDET", }, { Solver: SolvePart2, Output: "891", }, }, }, } func BenchmarkSolvers(b *testing.B) { for i, testCase := range testCases { b.Run(fmt.Sprint(i), func(subtest *testing.B) { testCase.Benchmark(subtest) }) } } func TestSolvers(t *testing.T) { for i, testCase := range testCases { t.Run(fmt.Sprint(i), func(subtest *testing.T) { testCase.Test(subtest) }) } }
{ "content_hash": "68178ae317f0456e402b20b99a8e44eb", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 360, "avg_line_length": 23.3, "alnum_prop": 0.6686695278969957, "repo_name": "jyggen/advent-of-go", "id": "2a9c761a2a0fe8f03a7d77f279198a2d46315d90", "size": "1165", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "2018/07-the-sum-of-its-parts/main_test.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "283073" }, { "name": "HTML", "bytes": "5484" } ], "symlink_target": "" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.trino.operator.aggregation.minmaxby; import io.trino.spi.block.Block; /** * Used for MinMaxBy aggregation states where value's native container type is Block or Slice. */ public interface KeyAndBlockPositionValueState extends TwoNullableValueState { Block getSecondBlock(); void setSecondBlock(Block second); int getSecondPosition(); void setSecondPosition(int position); }
{ "content_hash": "2da98038e9dff0323554b54b4e958d71", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 94, "avg_line_length": 31.548387096774192, "alnum_prop": 0.7474437627811861, "repo_name": "dain/presto", "id": "7b1aa5129356008b2ca324a3e8d3d4c168c9a429", "size": "978", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "core/trino-main/src/main/java/io/trino/operator/aggregation/minmaxby/KeyAndBlockPositionValueState.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "29911" }, { "name": "CSS", "bytes": "13435" }, { "name": "Dockerfile", "bytes": "1312" }, { "name": "HTML", "bytes": "24211" }, { "name": "Java", "bytes": "36943122" }, { "name": "JavaScript", "bytes": "219155" }, { "name": "Makefile", "bytes": "6908" }, { "name": "PLSQL", "bytes": "2990" }, { "name": "Python", "bytes": "10747" }, { "name": "SQLPL", "bytes": "926" }, { "name": "Shell", "bytes": "39389" }, { "name": "TSQL", "bytes": "162084" }, { "name": "Thrift", "bytes": "12631" } ], "symlink_target": "" }
export { SurveyModel as Model }; export enum DragTypeOverMeEnum { InsideEmptyPanel = 1, MultilineRight, MultilineLeft } export interface HashTable<T = any> { } export interface ILocalizableOwner { getLocale(): string; getMarkdownHtml(text: string, name: string): string; getProcessedText(text: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; } export interface ILocalizableString { getLocaleText(loc: string): string; setLocaleText(loc: string, newValue: string): any; getJson(): any; getLocales(): Array<any>; getIsMultiple(): boolean; } export interface IPropertyDecoratorOptions<T = any> { defaultValue?: T; defaultSource?: string; getDefaultValue?: any; localizable?: any; onSet?: any; } export interface IArrayPropertyDecoratorOptions { onPush?: any; onRemove?: any; onSet?: any; } export interface IObject { } export interface IFilePosition { offset: number; line: number; column: number; } export interface IFileRange { start: IFilePosition; end: IFilePosition; } export interface ILiteralExpectation { type: any; text: string; ignoreCase: boolean; } export interface IClassParts extends Array<any> { } export interface IClassExpectation { type: any; parts: IClassParts; inverted: boolean; ignoreCase: boolean; } export interface IAnyExpectation { type: any; } export interface IEndExpectation { type: any; } export interface IOtherExpectation { type: any; description: string; } export interface ICached { nextPos: number; result: any; } export interface IParseOptions { filename?: string; startRule?: string; tracer?: any; } /* * Base interface for expression execution */ export interface IExpresionExecutor { /* * This call back runs on executing expression if there is at least one async function */ onComplete: any; } /* * An action item. * Action items are used in the Toolbar, matrix rows, titles of pages, panels, questions, and other survey elements. */ export interface IAction { /* * A unique action item identifier. */ id: string; /* * Specifies the action item's visibility. */ visible?: boolean; /* * The action item's title. */ title?: string; locTitle?: any; /* * The action item's tooltip. */ tooltip?: string; /* * Specifies whether users can interact with the action item. */ enabled?: boolean; /* * Specifies the visibility of the action item's title. */ showTitle?: boolean; /* * A function that is executed when users click the action item. */ action?: any; /* * One or several CSS classes that you want to apply to the outer `<div>` element. * In the markup, an action item is rendered as an `<input>` wrapped in a `<div>`. The `css` property applies classes to the `<div>`. * To apply several classes, separate them with a space character: "myclass1 myclass2". */ css?: string; /* * One or several CSS classes that you want to apply to the inner `<input>` element. * In the markup, an action item is rendered as an `<input>` wrapped in a `<div>`. The `innerCss` property applies classes to the `<input>`. * To apply several classes, separate them with a space character: "myclass1 myclass2". */ innerCss?: string; /* * The action item's data object. Use it to pass required data to a custom template or component. */ data?: any; popupModel?: any; needSeparator?: boolean; /* * Specifies whether the action item is active. * Use it as a flag to specify different action item appearances in different states. */ active?: boolean; pressed?: boolean; /* * Specifies the name of a template used to render the action item. */ template?: string; /* * Specifies the name of a component used to render the action item. */ component?: string; /* * The action item's icon name. */ iconName?: string; /* * The action item's icon size in pixels. */ iconSize?: number; /* * The action item's location in a matrix question's row. * * The following values are available: * * - `"start"` - The action item is located at the beginning of the row. * - `"end"` - The action is located at the end of the row. */ location?: string; /* * Set this property to `true` if you want to disable keyboard navigation for the action item (sets the `tabIndex` attribute to -1). */ disableTabStop?: boolean; /* * Set this property to `true` if you want the item's `title` to be always visible. * If you set it to `false`, the `title` hides when the screen space is limited, and the item displays only the icon. */ disableShrink?: boolean; mode?: any; visibleIndex?: number; needSpace?: boolean; } export interface IDimensions { scroll: number; offset: number; } export interface IPosition { left?: string | number; top?: string | number; } export interface INumberPosition extends IPosition { left?: number; top?: number; } export interface ISize { width: number; height: number; } export interface ISurveyTriggerOwner { getObjects(pages: any, questions: any): Array<any>; setCompleted(): any; setTriggerValue(name: string, value: any, isVariable: boolean): any; copyTriggerValue(name: string, fromName: string): any; focusQuestion(name: string): boolean; } export interface ISurveyTimerText { timerInfoText: string; } export interface IConditionObject { name: string; text: string; question: Question; context?: Question; } export interface IMatrixColumnOwner extends ILocalizableOwner { getRequiredText(): string; onColumnPropertyChanged(column: MatrixDropdownColumn, name: string, newValue: any): void; onColumnItemValuePropertyChanged(column: MatrixDropdownColumn, propertyName: string, obj: ItemValue, name: string, newValue: any, oldValue: any): void; onShowInMultipleColumnsChanged(column: MatrixDropdownColumn): void; getCellType(): string; getCustomCellType(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, cellType: string): string; onColumnCellTypeChanged(column: MatrixDropdownColumn): void; } export interface IMatrixDropdownData { value: any; onRowChanged(row: MatrixDropdownRowModelBase, columnName: string, newRowValue: any, isDeletingValue: boolean): void; onRowChanging(row: MatrixDropdownRowModelBase, columnName: string, rowValue: any): any; isValidateOnValueChanging: boolean; getRowIndex(row: MatrixDropdownRowModelBase): number; getRowValue(rowIndex: number): any; checkIfValueInRowDuplicated(checkedRow: MatrixDropdownRowModelBase, cellQuestion: Question): boolean; hasDetailPanel(row: MatrixDropdownRowModelBase): boolean; getIsDetailPanelShowing(row: MatrixDropdownRowModelBase): boolean; setIsDetailPanelShowing(row: MatrixDropdownRowModelBase, val: boolean): void; createRowDetailPanel(row: MatrixDropdownRowModelBase): PanelModel; validateCell(row: MatrixDropdownRowModelBase, columnName: string, rowValue: any): SurveyError; columns: any; createQuestion(row: MatrixDropdownRowModelBase, column: MatrixDropdownColumn): Question; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; getParentTextProcessor(): ITextProcessor; getSharedQuestionByName(columnName: string, row: MatrixDropdownRowModelBase): Question; onTotalValueChanged(): any; getSurvey(): ISurvey; } export interface ISurveyData { getValue(name: string): any; setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string, locNotification: any): any; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; } export interface ITextProcessor { processText(text: string, returnDisplayValue: boolean): string; processTextEx(text: string, returnDisplayValue: boolean, doEncoding: boolean): any; } export interface ISurveyErrorOwner extends ILocalizableOwner { getErrorCustomText(text: string, error: SurveyError): string; } export interface ISurvey extends ITextProcessor, ISurveyErrorOwner { getSkeletonComponentName(element: ISurveyElement): string; currentPage: IPage; pages: any; getCss(): any; isPageStarted(page: IPage): boolean; getQuestionByName(name: string): IQuestion; pageVisibilityChanged(page: IPage, newValue: boolean): any; panelVisibilityChanged(panel: IPanel, newValue: boolean): any; questionVisibilityChanged(question: IQuestion, newValue: boolean): any; isEditingSurveyElement: boolean; isClearValueOnHidden: boolean; isClearValueOnHiddenContainer: boolean; questionsOrder: string; questionCreated(question: IQuestion): any; questionAdded(question: IQuestion, index: number, parentPanel: any, rootPanel: any): any; panelAdded(panel: IElement, index: number, parentPanel: any, rootPanel: any): any; questionRemoved(question: IQuestion): any; panelRemoved(panel: IElement): any; questionRenamed(question: IQuestion, oldName: string, oldValueName: string): any; validateQuestion(question: IQuestion): SurveyError; validatePanel(panel: IPanel): SurveyError; hasVisibleQuestionByValueName(valueName: string): boolean; questionCountByValueName(valueName: string): number; processHtml(html: string): string; getSurveyMarkdownHtml(element: Base, text: string, name: string): string; getRendererForString(element: Base, name: string): string; getRendererContextForString(element: Base, locStr: LocalizableString): any; getExpressionDisplayValue(question: IQuestion, value: any, displayValue: string): string; isDisplayMode: boolean; isDesignMode: boolean; areInvisibleElementsShowing: boolean; areEmptyElementsHidden: boolean; isLoadingFromJson: boolean; isUpdateValueTextOnTyping: boolean; autoGrowComment: boolean; state: string; isLazyRendering: boolean; cancelPreviewByPage(panel: IPanel): any; editText: string; cssNavigationEdit: string; requiredText: string; beforeSettingQuestionErrors(question: IQuestion, errors: any): void; beforeSettingPanelErrors(question: IPanel, errors: any): void; getSurveyErrorCustomText(obj: Base, text: string, error: SurveyError): string; getElementTitleTagName(element: Base, tagName: string): string; questionTitlePattern: string; getUpdatedQuestionTitle(question: IQuestion, title: string): string; getUpdatedQuestionNo(question: IQuestion, no: string): string; getUpdatedElementTitleActions(element: ISurveyElement, titleActions: any): Array<IAction>; getUpdatedMatrixRowActions(question: QuestionMatrixDropdownModelBase, row: MatrixDropdownRowModelBase, actions: any): Array<IAction>; questionStartIndex: string; questionTitleLocation: string; questionDescriptionLocation: string; questionErrorLocation: string; storeOthersAsComment: boolean; maxTextLength: number; maxOthersLength: number; clearValueOnDisableItems: boolean; uploadFiles(question: IQuestion, name: string, files: any, uploadingCallback: any): any; downloadFile(name: string, content: string, callback: any): any; clearFiles(question: IQuestion, name: string, value: any, fileName: string, clearCallback: any): any; updateChoicesFromServer(question: IQuestion, choices: any, serverResult: any): Array<any>; loadedChoicesFromServer(question: IQuestion): void; updateQuestionCssClasses(question: IQuestion, cssClasses: any): any; updatePanelCssClasses(panel: IPanel, cssClasses: any): any; updatePageCssClasses(panel: IPanel, cssClasses: any): any; updateChoiceItemCss(question: IQuestion, options: any): any; afterRenderQuestion(question: IQuestion, htmlElement: any): any; afterRenderQuestionInput(question: IQuestion, htmlElement: any): any; afterRenderPanel(panel: IElement, htmlElement: any): any; afterRenderPage(htmlElement: any): any; getQuestionByValueNameFromArray(valueName: string, name: string, index: number): IQuestion; canChangeChoiceItemsVisibility(): boolean; getChoiceItemVisibility(question: IQuestion, item: any, val: boolean): boolean; matrixRowAdded(question: IQuestion, row: any): any; matrixBeforeRowAdded(options: any): any; matrixRowRemoved(question: IQuestion, rowIndex: number, row: any): any; matrixRowRemoving(question: IQuestion, rowIndex: number, row: any): boolean; matrixAllowRemoveRow(question: IQuestion, rowIndex: number, row: any): boolean; matrixCellCreating(question: IQuestion, options: any): any; matrixCellCreated(question: IQuestion, options: any): any; matrixAfterCellRender(question: IQuestion, options: any): any; matrixCellValueChanged(question: IQuestion, options: any): any; matrixCellValueChanging(question: IQuestion, options: any): any; isValidateOnValueChanging: boolean; isValidateOnValueChanged: boolean; matrixCellValidate(question: IQuestion, options: any): SurveyError; dynamicPanelAdded(question: IQuestion): any; dynamicPanelRemoved(question: IQuestion, panelIndex: number, panel: IPanel): any; dynamicPanelItemValueChanged(question: IQuestion, options: any): any; dragAndDropAllow(options: any): boolean; scrollElementToTop(element: ISurveyElement, question: IQuestion, page: IPage, id: string): any; runExpression(expression: string): any; elementContentVisibilityChanged(element: ISurveyElement): void; } export interface ISurveyImpl { getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; } export interface IConditionRunner { runCondition(values: any, properties: any): any; } export interface IShortcutText { shortcutText: string; } export interface ISurveyElement extends IShortcutText { name: string; isVisible: boolean; isReadOnly: boolean; isPage: boolean; isPanel: boolean; containsErrors: boolean; parent: IPanel; skeletonComponentName: string; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): any; onSurveyLoad(): any; onFirstRendering(): any; getType(): string; setVisibleIndex(value: number): number; locStrsChanged(): any; delete(): any; toggleState(): void; stateChangedCallback(): void; getTitleToolbar(): AdaptiveActionContainer; } export interface IElement extends IConditionRunner, ISurveyElement { visible: boolean; renderWidth: string; width: string; minWidth?: string; maxWidth?: string; isExpanded: boolean; isCollapsed: boolean; rightIndent: number; startWithNewLine: boolean; registerFunctionOnPropertyValueChanged(name: string, func: any, key: string): void; unRegisterFunctionOnPropertyValueChanged(name: string, key: string): void; getPanel(): IPanel; getLayoutType(): string; isLayoutTypeSupported(layoutType: string): boolean; removeElement(el: IElement): boolean; onAnyValueChanged(name: string): any; updateCustomWidgets(): any; clearIncorrectValues(): any; clearErrors(): any; dispose(): void; needResponsiveWidth(): boolean; } export interface IQuestion extends IElement, ISurveyErrorOwner { hasTitle: boolean; isEmpty(): boolean; onSurveyValueChanged(newValue: any): any; updateValueFromSurvey(newValue: any): any; updateCommentFromSurvey(newValue: any): any; supportGoNextPageAutomatic(): boolean; clearUnusedValues(): any; getDisplayValue(keysAsText: boolean, value: any): any; getValueName(): string; clearValue(): any; clearValueIfInvisible(): any; isAnswerCorrect(): boolean; updateValueWithDefaults(): any; getQuestionFromArray(name: string, index: number): IQuestion; value: any; survey: any; } export interface IParentElement { addElement(element: IElement, index: number): any; removeElement(element: IElement): boolean; isReadOnly: boolean; } export interface IPanel extends ISurveyElement, IParentElement { getChildrenLayoutType(): string; getQuestionTitleLocation(): string; getQuestionStartIndex(): string; parent: IPanel; elementWidthChanged(el: IElement): any; indexOf(el: IElement): number; elements: any; ensureRowsVisibility(): void; } export interface IPage extends IPanel, IConditionRunner { isStarted: boolean; } export interface ITitleOwner { name: string; no: string; requiredText: string; isRequireTextOnStart: boolean; isRequireTextBeforeTitle: boolean; isRequireTextAfterTitle: boolean; locTitle: LocalizableString; } export interface IProgressInfo { questionCount: number; answeredQuestionCount: number; requiredQuestionCount: number; requiredAnsweredQuestionCount: number; } export interface IWrapperObject { getOriginalObj(): Base; getClassNameProperty(): string; } export interface IFindElement { element: Base; str: LocalizableString; } export interface IExpressionRunnerInfo { onExecute: any; canRun?: any; runner?: ExpressionRunner; } export interface IValidatorOwner { getValidators(): Array<SurveyValidator>; validatedValue: any; getValidatorTitle(): string; getDataFilteredValues(): any; getDataFilteredProperties(): any; } export interface IMatrixData { onMatrixRowChanged(row: MatrixRowModel): void; getCorrectedRowValue(value: any): any; } export interface IMatrixCellsOwner extends ILocalizableOwner { getRows(): Array<any>; getColumns(): Array<any>; } export interface IMultipleTextData extends ILocalizableOwner, IPanel { getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; getAllValues(): any; getMultipleTextValue(name: string): any; setMultipleTextValue(name: string, value: any): any; getItemDefaultValue(name: string): any; getIsRequiredText(): string; } export interface SurveyTemplateRendererTemplateData { name: string; data: any; nodes?: any; afterRender: any; } export interface SurveyTemplateRendererViewModel { componentData: any; templateData: SurveyTemplateRendererTemplateData; } export interface IQuestionPanelDynamicData { getItemIndex(item: ISurveyData): number; getPanelItemData(item: ISurveyData): any; setPanelItemData(item: ISurveyData, name: string, val: any): any; getSharedQuestionFromArray(name: string, panelIndex: number): Question; getSurvey(): ISurvey; getRootData(): ISurveyData; } export declare class ActionDropdownViewModel { constructor(item: Action); popupModel: any; funcKey: string; dispose(): void; } export declare class ArrayChanges { constructor(index: number, deleteCount: number, itemsToAdd: any, deletedItems: any); index: number; deleteCount: number; itemsToAdd: any; deletedItems: any; } /* * The base class for SurveyJS objects. */ export declare class Base { constructor(); static currentDependencis: Dependencies; static finishCollectDependencies(): Dependencies; static startCollectDependencies(updater: any, target: Base, property: string): void; static get commentPrefix(): string; static set commentPrefix(val: string); static createItemValue: any; static itemValueLocStrChanged: any; /* * Returns true if a value undefined, null, empty string or empty array. */ isValueEmpty(value: any, trimString?: boolean): boolean; protected trimValue(value: any): any; protected IsPropertyEmpty(value: any): boolean; propertyHash: any; localizableStrings: any; arraysInfo: any; eventList: any; expressionInfo: any; bindingsValue: Bindings; isDisposedValue: boolean; onPropChangeFunctions: any; protected isLoadingFromJsonValue: boolean; loadingOwner: Base; /* * Event that raise on property change of the sender object * sender - the object that owns the property * options.name - the property name that has been changed * options.oldValue - old value. Please note, it equals to options.newValue if property is an array * options.newValue - new value. */ onPropertyChanged: EventBase<Base>; /* * Event that raised on changing property of the ItemValue object. * sender - the object that owns the property * options.propertyName - the property name to which ItemValue array is belong. It can be "choices" for dropdown question * options.obj - the instance of ItemValue object which property has been changed * options.name - the property of ItemObject that has been changed * options.oldValue - old value * options.newValue - new value */ onItemValuePropertyChanged: Event<(sender: Base, options: any) => any, any>; getPropertyValueCoreHandler: any; setPropertyValueCoreHandler: any; createArrayCoreHandler: any; surveyChangedCallback: any; isCreating: boolean; dispose(): void; get isDisposed(): boolean; protected addEvent<T>(): EventBase<T>; protected onBaseCreating(): void; /* * Returns the question type. * Possible values: * - [*"boolean"*](https://surveyjs.io/Documentation/Library?id=questionbooleanmodel) * - [*"checkbox"*](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel) * - [*"comment"*](https://surveyjs.io/Documentation/Library?id=questioncommentmodel) * - [*"dropdown"*](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel) * - [*"expression"*](https://surveyjs.io/Documentation/Library?id=questionexpressionmodel) * - [*"file"*](https://surveyjs.io/Documentation/Library?id=questionfilemodel) * - [*"html"*](https://surveyjs.io/Documentation/Library?id=questionhtmlmodel) * - [*"image"*](https://surveyjs.io/Documentation/Library?id=questionimagemodel) * - [*"imagepicker"*](https://surveyjs.io/Documentation/Library?id=questionimagepickermodel) * - [*"matrix"*](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel) * - [*"matrixdropdown"*](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel) * - [*"matrixdynamic"*](https://surveyjs.io/Documentation/Library?id=questionmatrixdynamicmodel) * - [*"multipletext"*](https://surveyjs.io/Documentation/Library?id=questionmultipletextmodel) * - [*"panel"*](https://surveyjs.io/Documentation/Library?id=panelmodel) * - [*"paneldynamic"*](https://surveyjs.io/Documentation/Library?id=questionpaneldynamicmodel) * - [*"radiogroup"*](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel) * - [*"rating"*](https://surveyjs.io/Documentation/Library?id=questionratingmodel) * - [*"ranking"*](https://surveyjs.io/Documentation/Library?id=questionrankingmodel) * - [*"signaturepad"*](https://surveyjs.io/Documentation/Library?id=questionsignaturepadmodel) * - [*"text"*](https://surveyjs.io/Documentation/Library?id=questiontextmodel) */ getType(): string; getSurvey(isLive?: boolean): ISurvey; /* * Returns true if the question in design mode right now. */ get isDesignMode(): boolean; /* * Returns true if the object is inluded into survey, otherwise returns false. */ get inSurvey(): boolean; get bindings(): Bindings; checkBindings(valueName: string, value: any): void; protected updateBindings(propertyName: string, value: any): void; protected updateBindingValue(valueName: string, value: any): void; /* * Returns the element template name without prefix. Typically it equals to getType(). */ getTemplate(): string; /* * Returns true if the object is loading from Json at the current moment. */ get isLoadingFromJson(): boolean; protected getIsLoadingFromJson(): boolean; startLoadingFromJson(): void; endLoadingFromJson(): void; /* * Deserialized the current object into JSON */ toJSON(): any; /* * Load object properties and elements. It doesn't reset properties that was changed before and they are not defined in the json parameter. */ fromJSON(json: any): void; onSurveyLoad(): void; /* * Make a clone of the existing object. Create a new object of the same type and load all properties into it. */ clone(): Base; /* * Returns the serializable property that belongs to this instance by property name. It returns null if the property is not exists. */ getPropertyByName(propName: string): JsonObjectProperty; isPropertyVisible(propName: string): boolean; static createProgressInfo(): IProgressInfo; getProgressInfo(): IProgressInfo; localeChanged(): void; locStrsChanged(): void; /* * Returns the property value by name */ getPropertyValue(name: string, defaultValue?: any): any; protected getPropertyValueCore(propertiesHash: any, name: string): any; geValueFromHash(): any; protected setPropertyValueCore(propertiesHash: any, name: string, val: any): void; get isEditingSurveyElement(): boolean; iteratePropertiesHash(func: any): void; /* * set property value */ setPropertyValue(name: string, val: any): void; protected setArrayPropertyDirectly(name: string, val: any, sendNotification?: boolean): void; protected setPropertyValueDirectly(name: string, val: any): void; protected clearPropertyValue(name: string): void; onPropertyValueChangedCallback(name: string, oldValue: any, newValue: any, sender: Base, arrayChanges: ArrayChanges): void; itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; protected propertyValueChanged(name: string, oldValue: any, newValue: any, arrayChanges?: ArrayChanges, target?: Base): void; protected get isInternal(): boolean; addExpressionProperty(name: string, onExecute: any, canRun?: any): void; getDataFilteredValues(): any; getDataFilteredProperties(): any; protected runConditionCore(values: any, properties: any): void; protected canRunConditions(): boolean; /* * Register a function that will be called on a property value changed. */ registerFunctionOnPropertyValueChanged(name: string, func: any, key?: string): void; /* * Register a function that will be called on a property value changed from the names list. */ registerFunctionOnPropertiesValueChanged(names: any, func: any, key?: string): void; /* * Unregister notification on property value changed */ unRegisterFunctionOnPropertyValueChanged(name: string, key?: string): void; /* * Unregister notification on property value changed for all properties in the names list. */ unRegisterFunctionOnPropertiesValueChanged(names: any, key?: string): void; createCustomLocalizableObj(name: string): void; protected createLocalizableString(name: string, owner: ILocalizableOwner, useMarkDown?: boolean, defaultStr?: string | boolean): LocalizableString; getLocalizableString(name: string): LocalizableString; getLocalizableStringText(name: string, defaultStr?: string): string; setLocalizableStringText(name: string, value: string): void; addUsedLocales(locales: any): void; searchText(text: string, founded: any): void; protected getSearchableLocKeys(keys: any): void; protected getSearchableItemValueKeys(keys: any): void; protected AddLocStringToUsedLocales(locStr: LocalizableString, locales: any): void; protected createItemValues(name: string): Array<any>; protected createNewArrayCore(name: string): Array<any>; protected ensureArray(name: string, onPush?: any, onRemove?: any): any; protected createNewArray(name: string, onPush?: any, onRemove?: any): Array<any>; protected getItemValueType(): string; protected setArray(name: string, src: any, dest: any, isItemValues: boolean, onPush: any): void; protected isTwoValueEquals(x: any, y: any, caseInSensitive?: boolean, trimString?: boolean): boolean; protected copyCssClasses(dest: any, source: any): void; } export declare class Bindings { constructor(obj: Base); properties: any; values: any; getType(): string; getNames(): Array<any>; getProperties(): Array<JsonObjectProperty>; setBinding(propertyName: string, valueName: string): void; clearBinding(propertyName: string): void; isEmpty(): boolean; getValueNameByPropertyName(propertyName: string): string; getPropertiesByValueName(valueName: string): Array<any>; getJson(): any; setJson(value: any): void; } export declare class ButtonGroupItemModel { constructor(question: QuestionButtonGroupModel, item: ItemValue, index: number); question: QuestionButtonGroupModel; item: ItemValue; index: number; get value(): any; get iconName(): any; get iconSize(): any; get caption(): LocalizableString; get showCaption(): any; get isRequired(): boolean; get selected(): boolean; get readOnly(): boolean; get name(): string; get id(): string; get hasErrors(): boolean; get describedBy(): string; get css(): any; onChange(): void; } export declare class ButtonGroupItemViewModel { constructor(model: any); model: any; } export declare class ComponentCollection { static Instance: ComponentCollection; customQuestionValues: any; onCreateComposite: any; onCreateCustom: any; onAddingJson: any; add(json: any): void; get items(): any; getCustomQuestionByName(name: string): ComponentQuestionJSON; clear(): void; createQuestion(name: string, questionJSON: ComponentQuestionJSON): Question; protected createCompositeModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCompositeModel; protected createCustomModel(name: string, questionJSON: ComponentQuestionJSON): QuestionCustomModel; } export declare class ComponentQuestionJSON { constructor(name: string, json: any); name: string; json: any; onInit(): void; onCreated(question: Question): void; onLoaded(question: Question): void; onAfterRender(question: Question, htmlElement: any): void; onAfterRenderContentElement(question: Question, element: Question, htmlElement: any): void; onPropertyChanged(question: Question, propertyName: string, newValue: any): void; onValueChanged(question: Question, name: string, newValue: any): void; onItemValuePropertyChanged(question: Question, item: ItemValue, propertyName: string, name: string, newValue: any): void; getDisplayValue(keyAsText: boolean, value: any, question: Question): any; get isComposite(): boolean; } export declare class ComputedUpdater<T = any> { constructor(_updater: any); static ComputedUpdaterType: any; dependencies: Dependencies; type: any; get updater(): any; setDependencies(dependencies: Dependencies): void; protected getDependencies(): Dependencies; dispose(): any; } export declare class ConditionsParser { conditionError: ConditionsParserError; static parserCache: any; createCondition(text: string): Operand; parseExpression(text: string): Operand; get error(): ConditionsParserError; } export declare class ConditionsParserError { constructor(at: number, code: string); at: number; code: string; } export declare class CssClassBuilder { classes: any; isEmpty(): boolean; append(value: string, condition?: boolean): CssClassBuilder; toString(): string; } export declare class CustomPropertiesCollection { static properties: IObject; static parentClasses: any; static addProperty(className: string, property: any): void; static removeProperty(className: string, propertyName: string): void; static addClass(className: string, parentClassName: string): void; static getProperties(className: string): Array<any>; static createProperties(obj: any): void; } export declare class CustomWidgetCollection { static Instance: CustomWidgetCollection; widgetsValues: any; widgetsActivatedBy: any; onCustomWidgetAdded: Event<(customWidget: QuestionCustomWidget) => any, any>; get widgets(): any; add(widgetJson: any, activatedBy?: string): void; addCustomWidget(widgetJson: any, activatedBy?: string): QuestionCustomWidget; /* * Returns the way the custom wiget is activated. It can be activated by a property ("property"), question type ("type") or by new/custom question type ("customtype"). */ getActivatedBy(widgetName: string): string; /* * Sets the way the custom wiget is activated. The activation types are: property ("property"), question type ("type") or new/custom question type ("customtype"). A custom wiget may support all or only some of this activation types. */ setActivatedBy(widgetName: string, activatedBy: string): void; clear(): void; getCustomWidgetByName(name: string): QuestionCustomWidget; getCustomWidget(question: IQuestion): QuestionCustomWidget; } export declare class DefaultTitleModel { static getIconCss(cssClasses: any, isCollapsed: boolean): string; } export declare class Dependencies { constructor(currentDependency: any, target: Base, property: string); currentDependency: any; target: Base; property: string; static DependenciesCount: number; dependencies: any; id: string; addDependency(target: Base, property: string): void; dispose(): void; } export declare class DragDropInfo { constructor(source: IElement, target: IElement, nestedPanelDepth?: number); source: IElement; target: IElement; nestedPanelDepth: number; destination: ISurveyElement; isBottom: boolean; isEdge: boolean; } export declare class DragOrClickHelper { constructor(dragHandler: any); pointerDownEvent: any; currentTarget: any; startX: any; startY: any; currentX: any; currentY: any; itemModel: any; onPointerDown(pointerDownEvent: any, itemModel?: any): void; onPointerUp: any; tryToStartDrag: any; } export declare class ElementFactory { static Instance: ElementFactory; creatorHash: any; registerElement(elementType: string, elementCreator: any): void; clear(): void; unregisterElement(elementType: string, removeFromSerializer?: boolean): void; getAllTypes(): Array<any>; createElement(elementType: string, name: string): IElement; } export declare class Event<T, Options> { onCallbacksChanged: any; protected callbacks: any; get isEmpty(): boolean; fire(sender: any, options: any): void; clear(): void; add(func: T): void; remove(func: T): void; hasFunc(func: T): boolean; } export declare class ExpressionRunnerBase { constructor(expression: string); expressionExecutor: IExpresionExecutor; get expression(): string; set expression(val: string); getVariables(): Array<any>; hasFunction(): boolean; get isAsync(): boolean; canRun(): boolean; protected runCore(values: any, properties?: any): any; protected doOnComplete(res: any): void; } export declare class FunctionFactory { static Instance: FunctionFactory; functionHash: any; isAsyncHash: any; register(name: string, func: any, isAsync?: boolean): void; unregister(name: string): void; hasFunction(name: string): boolean; isAsyncFunction(name: string): boolean; clear(): void; getAll(): Array<any>; run(name: string, params: any, properties?: any): any; } export declare class Helpers { /* * A static methods that returns true if a value undefined, null, empty string or empty array. */ static isValueEmpty(value: any): boolean; static isArrayContainsEqual(x: any, y: any): boolean; static isArraysEqual(x: any, y: any, ignoreOrder?: boolean, caseSensitive?: boolean, trimStrings?: boolean): boolean; static isTwoValueEquals(x: any, y: any, ignoreOrder?: boolean, caseSensitive?: boolean, trimStrings?: boolean): boolean; static randomizeArray<T>(array: any): Array<T>; static getUnbindValue(value: any): any; static createCopy(obj: any): any; static isConvertibleToNumber(value: any): boolean; static isNumber(value: any): boolean; static getMaxLength(maxLength: number, surveyLength: number): any; static getNumberByIndex(index: number, startIndexStr: string): string; static isCharNotLetterAndDigit(ch: string): boolean; static isCharDigit(ch: string): boolean; static correctAfterPlusMinis(a: number, b: number, res: number): number; static correctAfterMultiple(a: number, b: number, res: number): number; } export declare class ImplementorBase { constructor(element: any); element: any; implementedMark: any; dispose(): void; } export declare class JsonError { constructor(type: string, message: string); type: string; message: string; description: string; at: any; getFullDescription(): string; } /* * The metadata object. It contains object properties' runtime information and allows you to modify it. */ export declare class JsonMetadata { classes: any; alternativeNames: any; childrenClasses: any; classProperties: any; classHashProperties: any; getObjPropertyValue(obj: any, name: string): any; setObjPropertyValue(obj: any, name: string, val: any): void; addClass(name: string, properties: any, creator?: any, parentName?: string): JsonMetadataClass; removeClass(name: string): void; overrideClassCreatore(name: string, creator: any): void; overrideClassCreator(name: string, creator: any): void; getProperties(className: string): Array<JsonObjectProperty>; getPropertiesByObj(obj: any): Array<JsonObjectProperty>; getDynamicPropertiesByObj(obj: any, dynamicType?: string): Array<JsonObjectProperty>; hasOriginalProperty(obj: Base, propName: string): boolean; getOriginalProperty(obj: Base, propName: string): JsonObjectProperty; getProperty(className: string, propertyName: string): JsonObjectProperty; findProperty(className: string, propertyName: string): JsonObjectProperty; findProperties(className: string, propertyNames: any): Array<JsonObjectProperty>; getAllPropertiesByName(propertyName: string): Array<JsonObjectProperty>; getAllClasses(): Array<any>; createClass(name: string, json?: any): any; getChildrenClasses(name: string, canBeCreated?: boolean): Array<JsonMetadataClass>; getRequiredProperties(name: string): Array<any>; addProperties(className: string, propertiesInfos: any): void; addProperty(className: string, propertyInfo: any): JsonObjectProperty; removeProperty(className: string, propertyName: string): boolean; findClass(name: string): JsonMetadataClass; isDescendantOf(className: string, ancestorClassName: string): boolean; addAlterNativeClassName(name: string, alternativeName: string): void; generateSchema(className?: string): any; } export declare class JsonMetadataClass { constructor(name: string, properties: any, creator?: any, parentName?: string); name: string; creator: any; parentName: string; static requiredSymbol: string; static typeSymbol: string; properties: any; find(name: string): JsonObjectProperty; createProperty(propInfo: any): JsonObjectProperty; } export declare class JsonObject { static typePropertyName: string; static positionPropertyName: string; static metaDataValue: JsonMetadata; static get metaData(): JsonMetadata; errors: any; lightSerializing: boolean; toJsonObject(obj: any, storeDefaults?: boolean): any; toObject(jsonObj: any, obj: any): void; toObjectCore(jsonObj: any, obj: any): void; toJsonObjectCore(obj: any, property: JsonObjectProperty, storeDefaults?: boolean): any; valueToJson(obj: any, result: any, property: JsonObjectProperty, storeDefaults?: boolean): void; valueToObj(value: any, obj: any, property: JsonObjectProperty): void; } export declare class MatrixCells { constructor(cellsOwner: IMatrixCellsOwner); cellsOwner: IMatrixCellsOwner; values: any; get isEmpty(): boolean; onValuesChanged: any; setCellText(row: any, column: any, val: string): void; setDefaultCellText(column: any, val: string): void; getCellLocText(row: any, column: any): LocalizableString; getDefaultCellLocText(column: any, val: string): LocalizableString; getCellDisplayLocText(row: any, column: any): LocalizableString; getCellText(row: any, column: any): string; getDefaultCellText(column: any): string; getCellDisplayText(row: any, column: any): string; get rows(): any; get columns(): any; getJson(): any; setJson(value: any): void; protected createString(): LocalizableString; } export declare class MatrixDropdownCell { constructor(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, data: IMatrixDropdownData); column: MatrixDropdownColumn; row: MatrixDropdownRowModelBase; data: IMatrixDropdownData; questionValue: Question; locStrsChanged(): void; protected createQuestion(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, data: IMatrixDropdownData): Question; get question(): Question; get value(): any; set value(val: any); runCondition(values: any, properties: any): void; } export declare class Operand { toString(func?: any): string; getType(): string; evaluate(processValue?: ProcessValue): any; setVariables(variables: any): any; hasFunction(): boolean; hasAsyncFunction(): boolean; addToAsyncList(list: any): void; isEqual(op: Operand): boolean; protected isContentEqual(op: Operand): boolean; protected areOperatorsEquals(op1: Operand, op2: Operand): boolean; } export declare class OperandMaker { static unaryFunctions: any; static binaryFunctions: any; static signs: any; } export declare class PanelViewModel { constructor(question: any, targetElement: any); question: any; targetElement: any; } export declare class PopupUtils { static bottomIndent: number; static calculatePosition(targetRect: any, height: number, width: number, verticalPosition: any, horizontalPosition: any, showPointer: boolean): INumberPosition; static updateVerticalDimensions(top: number, height: number, windowHeight: number): any; static updateHorizontalDimensions(left: number, width: number, windowWidth: number, horizontalPosition: any): any; static updateVerticalPosition(targetRect: any, height: number, verticalPosition: any, showPointer: boolean, windowHeight: number): any; static calculatePopupDirection(verticalPosition: any, horizontalPosition: any): string; static calculatePointerTarget(targetRect: any, top: number, left: number, verticalPosition: any, horizontalPosition: any, marginLeft?: number, marginRight?: number): INumberPosition; static updatePopupWidthBeforeShow(popupModel: any, e: any): void; } export declare class PopupViewModel { constructor(popupViewModel: any); popupViewModel: any; dispose(): void; } export declare class ProcessValue { constructor(); values: any; properties: any; getFirstName(text: string, obj?: any): string; hasValue(text: string, values?: any): boolean; getValue(text: string, values?: any): any; setValue(obj: any, text: string, value: any): void; getValueInfo(valueInfo: any): void; } export declare class ProgressButtonsViewModel { constructor(survey: any, element: any); progressButtonsModel: any; scrollButtonCssKo: any; hasScroller: any; updateScroller: any; isListElementClickable(index: any): boolean; getListElementCss(index: any): string; clickListElement(index: any): void; getScrollButtonCss(isLeftScroll: boolean): any; clickScrollButton(listContainerElement: any, isLeftScroll: boolean): void; dispose(): void; } export declare class ProgressViewModel { constructor(model: any); model: any; getProgressTextInBarCss(css: any): string; getProgressTextUnderBarCss(css: any): string; } export declare class QuestionCustomWidget { constructor(name: string, widgetJson: any); name: string; widgetJson: any; htmlTemplate: string; afterRender(question: IQuestion, el: any): void; willUnmount(question: IQuestion, el: any): void; getDisplayValue(question: IQuestion, value?: any): string; isFit(question: IQuestion): boolean; get canShowInToolbox(): boolean; get showInToolbox(): boolean; set showInToolbox(val: boolean); init(): void; activatedByChanged(activatedBy: string): void; get isDefaultRender(): boolean; get pdfQuestionType(): string; get pdfRender(): any; } export declare class QuestionFactory { static Instance: QuestionFactory; static get DefaultChoices(): any; static get DefaultColums(): any; static get DefaultRows(): any; static get DefaultMutlipleTextItems(): any; creatorHash: any; registerQuestion(questionType: string, questionCreator: any): void; unregisterElement(elementType: string): void; clear(): void; getAllTypes(): Array<any>; createQuestion(questionType: string, name: string): Question; } export declare class QuestionMatrixDropdownRenderedCell { constructor(); static counter: number; idValue: number; itemValue: ItemValue; minWidth: string; width: string; locTitle: LocalizableString; cell: MatrixDropdownCell; column: MatrixDropdownColumn; row: MatrixDropdownRowModelBase; question: Question; isRemoveRow: boolean; choiceIndex: number; matrix: QuestionMatrixDropdownModelBase; requiredText: string; isEmpty: boolean; colSpans: number; panel: PanelModel; isShowHideDetail: boolean; isActionsCell: boolean; isDragHandlerCell: boolean; classNameValue: string; get hasQuestion(): boolean; get hasTitle(): boolean; get hasPanel(): boolean; get id(): number; get showErrorOnTop(): boolean; get showErrorOnBottom(): boolean; get item(): ItemValue; set item(val: ItemValue); get isChoice(): boolean; get choiceValue(): any; get isCheckbox(): boolean; get isFirstChoice(): boolean; get className(): string; get headers(): string; getTitle(): string; calculateFinalClassName(matrixCssClasses: any): string; } export declare class RendererFactory { static Instance: RendererFactory; renderersHash: any; unregisterRenderer(questionType: string, rendererAs: string): void; registerRenderer(questionType: string, renderAs: string, renderer: any): void; getRenderer(questionType: string, renderAs: string): any; getRendererByQuestion(question: Question): any; clear(): void; } export declare class ResponsivityManager { constructor(container: any, model: any, itemsSelector: string, dotsItemSize?: number); resizeObserver: any; isInitialized: boolean; protected minDimensionConst: number; separatorSize: number; separatorAddConst: number; paddingSizeConst: number; protected recalcMinDimensionConst: boolean; getComputedStyle: any; protected getDimensions(element: any): IDimensions; protected getAvailableSpace(): number; protected calcItemSize(item: any): number; dispose(): void; } export declare class StringEditorViewModel { constructor(locString: any); locString: any; get koHasHtml(): any; get editValue(): any; set editValue(val: any); onInput(sender: StringEditorViewModel, event: any): void; onClick(sender: StringEditorViewModel, event: any): void; dispose(): void; } export declare class StylesManager { constructor(); static SurveyJSStylesSheetId: string; static Styles: any; static Media: any; static ThemeColors: any; static ThemeCss: any; static modernThemeCss: any; static bootstrapThemeCss: any; static bootstrapmaterialThemeCss: any; sheet: any; static applyTheme(themeName?: string, themeSelector?: string): void; static Enabled: boolean; initializeStyles(sheet: any): void; } export declare class SurveyError { constructor(text?: string, errorOwner?: ISurveyErrorOwner); text: string; locTextValue: LocalizableString; visible: boolean; equalsTo(error: SurveyError): boolean; get locText(): LocalizableString; getText(): string; getErrorType(): string; protected getDefaultText(): string; } export declare class SurveyProgressButtonsModel { constructor(survey: SurveyModel); isListElementClickable(index: number): boolean; getListElementCss(index: number): string; getScrollButtonCss(hasScroller: boolean, isLeftScroll: boolean): string; clickListElement(index: number): void; } export declare class SurveyProgressModel { static getProgressTextInBarCss(css: any): string; static getProgressTextUnderBarCss(css: any): string; } export declare class SurveyTemplateText { constructor(); addText(newText: string, id: string, name: string): void; replaceText(replaceText: string, id: string, questionType?: string): void; protected getId(id: string, questionType: string): string; protected get text(): string; protected set text(val: string); } export declare class SurveyTimer { static instanceValue: SurveyTimer; static get instance(): SurveyTimer; listenerCounter: number; timerId: number; onTimer: Event<() => any, any>; start(func?: any): void; stop(func?: any): void; doTimer(): void; } export declare class SvgIconData { } export declare class SvgIconRegistry { icons: SvgIconData; iconPrefix: string; registerIconFromSymbol(iconId: string, iconSymbolSvg: string): void; registerIconFromSvgViaElement(iconId: string, iconSvg: string, iconPrefix?: string): void; registerIconFromSvg(iconId: string, iconSvg: string, iconPrefix?: string): boolean; registerIconsFromFolder(r: any): void; iconsRenderedHtml(): any; renderIcons(): void; } export declare class SyntaxError { constructor(message: string, expected: any, found: string, location: IFileRange); static buildMessage(expected: any, found: string): string; message: string; expected: any; found: string; location: IFileRange; name: string; } export declare class TextPreProcessor { _unObservableValues: any; onProcess: any; process(text: string, returnDisplayValue?: boolean, doEncoding?: boolean): string; processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue; get hasAllValuesOnLastRun(): boolean; } export declare class TextPreProcessorItem { start: number; end: number; } export declare class TextPreProcessorValue { constructor(name: string, returnDisplayValue: boolean); name: string; returnDisplayValue: boolean; value: any; isExists: boolean; canProcess: boolean; } export declare class TooltipErrorViewModel { constructor(question: any); question: any; tooltipManager: any; afterRender: any; } export declare class TooltipManager { constructor(tooltipElement: any); tooltipElement: any; targetElement: any; dispose(): void; onMouseMoveCallback: any; } export declare class ValidatorResult { constructor(value: any, error?: SurveyError); value: any; error: SurveyError; } export declare class ValidatorRunner { asyncValidators: any; onAsyncCompleted: any; run(owner: IValidatorOwner): Array<SurveyError>; } export declare class XmlParser { parser: any; assignValue(target: any, name: string, value: any): void; xml2Json(xmlNode: any, result: any): void; parseXmlString(xmlString: string): any; } /* * The class contains methods to work with api.surveyjs.io service. */ export declare class dxSurveyService { constructor(); static get serviceUrl(): string; static set serviceUrl(val: string); loadSurvey(surveyId: string, onLoad: any): void; getSurveyJsonAndIsCompleted(surveyId: string, clientId: string, onLoad: any): void; sendResult(postId: string, result: any, onSendResult: any, clientId?: string, isPartialCompleted?: boolean): void; sendFile(postId: string, file: any, onSendFile: any): void; getResult(resultId: string, name: string, onGetResult: any): void; isCompleted(resultId: string, clientId: string, onIsCompleted: any): void; } export declare class Action extends Base implements IAction { constructor(innerItem: IAction); innerItem: IAction; updateCallback: any; location: string; id: string; iconName: string; iconSize: number; visible: boolean; tooltip: string; enabled: boolean; showTitle: boolean; action: any; css: string; innerCss: string; data: any; popupModel: any; needSeparator: boolean; active: boolean; pressed: boolean; template: string; component: string; items: any; visibleIndex: number; mode: any; disableTabStop: boolean; disableShrink: boolean; needSpace: boolean; locTitle: any; titleValue: string; get title(): string; set title(val: string); cssClassesValue: any; get cssClasses(): any; get disabled(): boolean; get hasTitle(): boolean; get isVisible(): boolean; get canShrink(): boolean; getActionRootCss(): string; getActionBarItemTitleCss(): string; getActionBarItemCss(): string; minDimension: number; maxDimension: number; } export declare class ActionContainer<T extends Action = Action> extends Base { constructor(); actions: any; cssClassesValue: any; protected getRenderedActions(): Array<T>; updateCallback: any; containerCss: string; protected raiseUpdate(isResetInitialized: boolean): void; protected onSet(): void; protected onPush(item: T): void; protected onRemove(item: T): void; get hasActions(): boolean; get renderedActions(): any; get visibleActions(): any; getRootCss(): string; get cssClasses(): any; addAction(val: IAction, sortByVisibleIndex?: boolean): Action; setItems(items: any, sortByVisibleIndex?: boolean): void; initResponsivityManager(container: any): void; resetResponsivityManager(): void; getActionById(id: string): T; } export declare class ActionContainerImplementor extends ImplementorBase { constructor(model: any, handleClick?: boolean); handleClick: boolean; itemsSubscription: any; dispose(): void; } export declare class AnswerRequiredError extends SurveyError { constructor(text?: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } export declare class ArrayOperand extends Operand { constructor(values: any); values: any; getType(): string; toString(func?: any): string; evaluate(processValue?: ProcessValue): Array<any>; setVariables(variables: any): void; hasFunction(): boolean; hasAsyncFunction(): boolean; addToAsyncList(list: any): void; protected isContentEqual(op: Operand): boolean; } export declare class BinaryOperand extends Operand { constructor(operatorName: string, left?: any, right?: any, isArithmeticOp?: boolean); consumer: any; isArithmeticValue: boolean; getType(): string; get isArithmetic(): boolean; get isConjunction(): boolean; get conjunction(): string; get operator(): string; get leftOperand(): any; get rightOperand(): any; protected isContentEqual(op: Operand): boolean; evaluate(processValue?: ProcessValue): any; toString(func?: any): string; setVariables(variables: any): void; hasFunction(): boolean; hasAsyncFunction(): boolean; addToAsyncList(list: any): void; } /* * The calculated value is a way to define the variable in Survey Creator. * It has two main properties: name and expression. Based on expression the value read-only property is automatically calculated. * The name property should be unique though all calculated values. * It uses survey.getVariable/seruvey.setVariable functions to get/set its value. The class do not store its value internally. * You may set includeIntoResult property to true to store this calculated value into survey result. */ export declare class CalculatedValue extends Base { constructor(name?: string, expression?: string); data: ISurveyData; expressionIsRunning: boolean; expressionRunner: ExpressionRunner; setOwner(data: ISurveyData): void; getType(): string; getSurvey(live?: boolean): ISurvey; get owner(): ISurveyData; /* * The calculated value name. It should be non empty and unique. */ get name(): string; set name(val: string); /* * Set this property to true to include the non-empty calculated value into survey result, survey.data property. */ get includeIntoResult(): boolean; set includeIntoResult(val: boolean); /* * The Expression that used to calculate the value. You may use standard operators like +, -, * and /, squares (). Here is the example of accessing the question value {questionname}. * <br/>Example: "({quantity} * {price}) * (100 - {discount}) / 100" */ get expression(): string; set expression(val: string); locCalculation(): void; unlocCalculation(): void; isCalculated: boolean; resetCalculation(): void; doCalculation(calculatedValues: any, values: any, properties: any): void; runExpression(values: any, properties: any): void; get value(): any; protected setValue(val: any): void; } /* * A definition for filling choices for checkbox, dropdown and radiogroup questions from resfull services. * The run method call a restful service and results can be get on getResultCallback. */ export declare class ChoicesRestful extends Base { constructor(); static cacheText: string; static noCacheText: string; static get EncodeParameters(): boolean; static set EncodeParameters(val: boolean); static clearCache(): void; static itemsResult: any; static sendingSameRequests: any; static onBeforeSendRequest: any; lastObjHash: string; isRunningValue: boolean; protected processedUrl: string; protected processedPath: string; isUsingCacheFromUrl: boolean; onProcessedUrlCallback: any; getResultCallback: any; beforeSendRequestCallback: any; updateResultCallback: any; getItemValueCallback: any; error: SurveyError; owner: IQuestion; createItemValue: any; getSurvey(live?: boolean): ISurvey; run(textProcessor?: ITextProcessor): void; get isUsingCache(): boolean; get isRunning(): boolean; protected getIsRunning(): boolean; get isWaitingForParameters(): boolean; protected useChangedItemsResults(): boolean; protected parseResponse(response: any): any; protected sendRequest(): void; getType(): string; get isEmpty(): boolean; getCustomPropertiesNames(): Array<any>; setData(json: any): void; getData(): any; /* * Gets or sets a link to a web service. You can use text preprocessing here. * For example, the following url: _https://surveyjs.io/api/CountriesExample?region={region}_ is changed based on the _region_ question's value. * SurveyJS automatically gets data from the web service when the value of the _region_ question changes. */ get url(): string; set url(val: string); /* * Use this property, if a web service returns a lot of information and you need only a part of it. * For example, a web service returns a list of countries and a list of capitals. * If you need a list of countries, set a correct path from which SurveyJS obtains the data, like: _DataList1\DataList2_ */ get path(): string; set path(val: string); /* * Gets or sets the name of a property (in the obtained data object) to which SurveyJS binds to provide values for choice items. */ get valueName(): string; set valueName(val: string); /* * Gets or sets the name of a property (in the obtained data object) to which SurveyJS binds to provide display texts for choice items. */ get titleName(): string; set titleName(val: string); get imageLinkName(): string; set imageLinkName(val: string); get allowEmptyResponse(): boolean; set allowEmptyResponse(val: boolean); get attachOriginalItems(): boolean; set attachOriginalItems(val: boolean); get itemValueType(): string; clear(): void; protected beforeSendRequest(): void; protected beforeLoadRequest(): void; protected onLoad(result: any, loadingObjHash?: string): void; protected callResultCallback(items: any, loadingObjHash: string): void; } export declare class ConditionRunner extends ExpressionRunnerBase { constructor(expression: string); onRunComplete: any; run(values: any, properties?: any): boolean; protected doOnComplete(res: any): void; } export declare class Const extends Operand { constructor(value: any); getType(): string; toString(func?: any): string; get correctValue(): any; evaluate(): any; setVariables(variables: any): void; protected getCorrectValue(value: any): any; protected isContentEqual(op: Operand): boolean; } export declare class CustomError extends SurveyError { constructor(text: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; } export declare class DragDropCore<T> extends Base { constructor(surveyValue?: ISurvey, creator?: any); isBottom: boolean; onGhostPositionChanged: EventBase<Base>; protected ghostPositionChanged(): void; static PreventScrolling: boolean; onBeforeDrop: EventBase<DragDropCore<T>>; onAfterDrop: EventBase<DragDropCore<T>>; draggedElement: any; protected get draggedElementType(): string; protected parentElement: T; dropTarget: any; protected get dropTargetDataAttributeName(): string; protected get survey(): SurveyModel; prevDropTarget: any; protected draggedElementShortcut: any; scrollIntervalId: number; protected allowDropHere: boolean; startDrag(event: any, draggedElement: any, parentElement?: any, draggedElementNode?: any, preventSaveTargetNode?: boolean): void; timeoutID: any; startX: number; startY: number; currentX: number; currentY: number; savedTargetNode: any; stopLongTapIfMoveEnough: any; stopLongTap: any; onContextMenu: any; dragOver: any; drop: any; protected isDropTargetDoesntChanged(newIsBottom: boolean): boolean; protected onStartDrag(): void; protected getShortcutText(draggedElement: IShortcutText): string; protected createDraggedElementShortcut(text: string, draggedElementNode?: any, event?: any): any; protected getDraggedElementClass(): string; protected doDragOver(dropTargetNode?: any): void; protected afterDragOver(dropTargetNode?: any): void; getGhostPosition(item: any): string; protected isDropTargetValid(dropTarget: any, dropTargetNode?: any): boolean; handlePointerCancel: any; protected handleEscapeButton: any; protected banDropHere: any; protected doBanDropHere: any; protected getDataAttributeValueByNode(node: any): any; protected getDropTargetByNode(dropTargetNode: any, event: any): any; protected getDropTargetByDataAttributeValue(dataAttributeValue: string, dropTargetNode?: any, event?: any): any; protected calculateMiddleOfHTMLElement(HTMLElement: any): number; protected calculateIsBottom(clientY: number, dropTargetNode?: any): boolean; protected findDropTargetNodeByDragOverNode(dragOverNode: any): any; protected doDrop(): any; protected clear: any; protected doClear(): void; } export declare class EventBase<T> extends Event<any, any> { } export declare class ExceedSizeError extends SurveyError { constructor(maxSize: number, errorOwner?: ISurveyErrorOwner); getErrorType(): string; getDefaultText(): string; } export declare class ExpressionExecutor implements IExpresionExecutor { constructor(expression: string); static createExpressionExecutor: any; onComplete: any; expressionValue: string; operand: Operand; processValue: ProcessValue; parser: ConditionsParser; isAsyncValue: boolean; hasFunctionValue: boolean; asyncFuncList: any; get expression(): string; getVariables(): Array<any>; hasFunction(): boolean; get isAsync(): boolean; canRun(): boolean; run(values: any, properties?: any): any; } /* * Base class for HtmlConditionItem and UrlConditionItem classes. */ export declare class ExpressionItem extends Base implements ILocalizableOwner { constructor(expression?: string); locOwner: ILocalizableOwner; getType(): string; runCondition(values: any, properties: any): boolean; /* * The expression property. If this expression returns true, then survey will use html property to show on complete page. */ get expression(): string; set expression(val: string); get locHtml(): LocalizableString; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; getSurvey(isLive?: boolean): ISurvey; } export declare class ExpressionRunner extends ExpressionRunnerBase { constructor(expression: string); onRunComplete: any; run(values: any, properties?: any): any; protected doOnComplete(res: any): void; } export declare class FunctionOperand extends Operand { constructor(originalValue: string, parameters: ArrayOperand); isReadyValue: boolean; asynResult: any; onAsyncReady: any; getType(): string; evaluateAsync(processValue: ProcessValue): void; evaluate(processValue?: ProcessValue): any; toString(func?: any): string; setVariables(variables: any): void; get isReady(): boolean; hasFunction(): boolean; hasAsyncFunction(): boolean; addToAsyncList(list: any): void; protected isContentEqual(op: Operand): boolean; } /* * Array of ItemValue is used in checkox, dropdown and radiogroup choices, matrix columns and rows. * It has two main properties: value and text. If text is empty, value is used for displaying. * The text property is localizable and support markdown. */ export declare class ItemValue extends Base implements ILocalizableOwner, IShortcutText { constructor(value: any, text?: string, typeName?: string); getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; static get Separator(): string; static set Separator(val: string); static createArray(locOwner: ILocalizableOwner): Array<ItemValue>; static setupArray(items: any, locOwner: ILocalizableOwner): void; /* * Resets the input array and fills it with values from the values array */ static setData(items: any, values: any, type?: string): void; static getData(items: any): any; static getItemByValue(items: any, val: any): ItemValue; static getTextOrHtmlByValue(items: any, val: any): string; static locStrsChanged(items: any): void; static runConditionsForItems(items: any, filteredItems: any, runner: ConditionRunner, values: any, properties: any, useItemExpression?: boolean, onItemCallBack?: any): boolean; static runEnabledConditionsForItems(items: any, runner: ConditionRunner, values: any, properties: any, onItemCallBack?: any): boolean; ownerPropertyName: string; locTextValue: LocalizableString; isVisibleValue: boolean; visibleConditionRunner: ConditionRunner; enableConditionRunner: ConditionRunner; onCreating(): any; getType(): string; getSurvey(live?: boolean): ISurvey; getLocale(): string; get locText(): LocalizableString; setLocText(locText: LocalizableString): void; _locOwner: ILocalizableOwner; get locOwner(): ILocalizableOwner; set locOwner(val: ILocalizableOwner); get value(): any; set value(val: any); get hasText(): boolean; get pureText(): string; set pureText(val: string); get text(): string; set text(val: string); get calculatedText(): string; get shortcutText(): string; getData(): any; toJSON(): any; setData(value: any): void; get visibleIf(): string; set visibleIf(val: string); get enableIf(): string; set enableIf(val: string); get isVisible(): boolean; setIsVisible(val: boolean): void; get isEnabled(): any; setIsEnabled(val: boolean): void; addUsedLocales(locales: any): void; locStrsChanged(): void; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; protected getConditionRunner(isVisible: boolean): ConditionRunner; originalItem: any; } export declare class JsonMissingTypeErrorBase extends JsonError { constructor(baseClassName: string, type: string, message: string); baseClassName: string; type: string; message: string; } /* * Contains information about a property of a survey element (page, panel, questions, and etc). */ export declare class JsonObjectProperty implements IObject { constructor(classInfo: JsonMetadataClass, name: string, isRequired?: boolean); name: string; static getItemValuesDefaultValue: any; static Index: number; static mergableValues: any; idValue: number; classInfoValue: JsonMetadataClass; typeValue: string; choicesValue: any; baseValue: any; isRequiredValue: boolean; isUniqueValue: boolean; readOnlyValue: boolean; visibleValue: boolean; isLocalizableValue: boolean; choicesfunc: any; dependedProperties: any; isSerializable: boolean; isLightSerializable: boolean; isCustom: boolean; isDynamicChoices: boolean; isBindable: boolean; className: string; alternativeName: string; classNamePart: string; baseClassName: string; defaultValueValue: any; serializationProperty: string; displayName: string; category: string; categoryIndex: number; visibleIndex: number; nextToProperty: string; showMode: string; maxLength: number; maxValue: any; minValue: any; dataListValue: any; layout: string; onGetValue: any; onSetValue: any; visibleIf: any; onExecuteExpression: any; onPropertyEditorUpdate: any; get id(): number; get classInfo(): JsonMetadataClass; get type(): string; set type(val: string); isArray: boolean; get isRequired(): boolean; set isRequired(val: boolean); get isUnique(): boolean; set isUnique(val: boolean); get hasToUseGetValue(): any; get defaultValue(): any; set defaultValue(val: any); isDefaultValue(value: any): boolean; getValue(obj: any): any; getPropertyValue(obj: any): any; get hasToUseSetValue(): any; setValue(obj: any, value: any, jsonConv: JsonObject): void; getObjType(objType: string): any; getClassName(className: string): string; /* * Depricated, please use getChoices */ get choices(): any; get hasChoices(): boolean; getChoices(obj: any, choicesCallback?: any): Array<any>; setChoices(value: any, valueFunc?: any): void; getBaseValue(): string; setBaseValue(val: any): void; get readOnly(): boolean; set readOnly(val: boolean); isVisible(layout: string, obj?: any): boolean; get visible(): boolean; set visible(val: boolean); get isLocalizable(): boolean; set isLocalizable(val: boolean); get dataList(): any; set dataList(val: any); mergeWith(prop: JsonObjectProperty): void; addDependedProperty(name: string): void; getDependedProperties(): Array<any>; schemaType(): string; } export declare class JsonRequiredPropertyError extends JsonError { constructor(propertyName: string, className: string); propertyName: string; className: string; } export declare class JsonUnknownPropertyError extends JsonError { constructor(propertyName: string, className: string); propertyName: string; className: string; } export declare class KeyDuplicationError extends SurveyError { constructor(text: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } /* * The class represents the string that supports multi-languages and markdown. * It uses in all objects where support for multi-languages and markdown is required. */ export declare class LocalizableString implements ILocalizableString { constructor(owner: ILocalizableOwner, useMarkdown?: boolean, name?: string); owner: ILocalizableOwner; useMarkdown: boolean; name: string; static SerializeAsObject: boolean; static get defaultLocale(): string; static set defaultLocale(val: string); static defaultRenderer: string; static editableRenderer: string; values: any; htmlValues: any; renderedText: string; calculatedTextValue: string; localizationName: string; onGetTextCallback: any; onGetDefaultTextCallback: any; onGetLocalizationTextCallback: any; onStrChanged: any; onSearchChanged: any; sharedData: LocalizableString; searchText: string; searchIndex: number; getIsMultiple(): boolean; get locale(): string; strChanged(): void; get text(): string; set text(val: string); get calculatedText(): string; get pureText(): string; get hasHtml(): boolean; get html(): string; get isEmpty(): boolean; get textOrHtml(): string; get renderedHtml(): string; getLocaleText(loc: string): string; setLocaleText(loc: string, value: string): void; hasNonDefaultText(): boolean; getLocales(): Array<any>; getJson(): any; setJson(value: any): void; get renderAs(): string; get renderAsData(): any; equals(obj: any): boolean; searchableText: string; setFindText(text: string): boolean; onChanged(): void; protected onCreating(): void; getHtmlValue(): string; } /* * The class represents the list of strings that supports multi-languages. */ export declare class LocalizableStrings implements ILocalizableString { constructor(owner: ILocalizableOwner); owner: ILocalizableOwner; values: any; onValueChanged: any; getIsMultiple(): boolean; get locale(): string; get value(): any; set value(val: any); get text(): string; set text(val: string); getLocaleText(loc: string): string; setLocaleText(loc: string, newValue: string): any; getValue(loc: string): Array<any>; setValue(loc: string, val: any): void; hasValue(loc?: string): boolean; get isEmpty(): boolean; getLocales(): Array<any>; getJson(): any; setJson(value: any): void; } export declare class MatrixDropdownColumn extends Base implements ILocalizableOwner, IWrapperObject { constructor(name: string, title?: string); static getColumnTypes(): Array<any>; templateQuestionValue: Question; colOwnerValue: IMatrixColumnOwner; indexValue: number; _isVisible: boolean; _hasVisibleCell: boolean; getOriginalObj(): Base; getClassNameProperty(): string; getSurvey(live?: boolean): ISurvey; endLoadingFromJson(): void; getDynamicPropertyName(): string; getDynamicType(): string; get colOwner(): IMatrixColumnOwner; set colOwner(val: IMatrixColumnOwner); locStrsChanged(): void; addUsedLocales(locales: any): void; get index(): number; setIndex(val: number): void; getType(): string; get cellType(): string; set cellType(val: string); get templateQuestion(): Question; get value(): string; get isVisible(): boolean; setIsVisible(newVal: boolean): void; get hasVisibleCell(): boolean; set hasVisibleCell(val: boolean); get name(): string; set name(val: string); get title(): string; set title(val: string); get locTitle(): LocalizableString; get fullTitle(): string; get isRequired(): boolean; set isRequired(val: boolean); get requiredText(): string; get requiredErrorText(): string; set requiredErrorText(val: string); get locRequiredErrorText(): LocalizableString; get readOnly(): boolean; set readOnly(val: boolean); get hasOther(): boolean; set hasOther(val: boolean); get visibleIf(): string; set visibleIf(val: string); get enableIf(): string; set enableIf(val: string); get requiredIf(): string; set requiredIf(val: string); get isUnique(): boolean; set isUnique(val: boolean); get showInMultipleColumns(): boolean; set showInMultipleColumns(val: boolean); get isSupportMultipleColumns(): boolean; get isShowInMultipleColumns(): boolean; get validators(): any; set validators(val: any); get totalType(): string; set totalType(val: string); get totalExpression(): string; set totalExpression(val: string); get hasTotal(): boolean; get totalFormat(): string; set totalFormat(val: string); get locTotalFormat(): LocalizableString; get renderAs(): string; set renderAs(val: string); get totalMaximumFractionDigits(): number; set totalMaximumFractionDigits(val: number); get totalMinimumFractionDigits(): number; set totalMinimumFractionDigits(val: number); get totalDisplayStyle(): string; set totalDisplayStyle(val: string); get totalCurrency(): string; set totalCurrency(val: string); get minWidth(): string; set minWidth(val: string); get width(): string; set width(val: string); get colCount(): number; set colCount(val: number); getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; createCellQuestion(row: MatrixDropdownRowModelBase): Question; updateCellQuestion(cellQuestion: Question, data: any, onUpdateJson?: any): void; defaultCellTypeChanged(): void; protected calcCellQuestionType(row: MatrixDropdownRowModelBase): string; protected updateTemplateQuestion(newCellType?: string): void; protected createNewQuestion(cellType: string): Question; previousChoicesId: string; protected setQuestionProperties(question: Question, onUpdateJson?: any): void; protected propertyValueChanged(name: string, oldValue: any, newValue: any): void; } export declare class MatrixDropdownRowModelBase implements ISurveyData, ISurveyImpl, ILocalizableOwner { constructor(data: IMatrixDropdownData, value: any); static RowVariableName: string; static OwnerVariableName: string; static IndexVariableName: string; static RowValueVariableName: string; static idCounter: number; protected data: IMatrixDropdownData; protected isSettingValue: boolean; idValue: string; textPreProcessor: MatrixDropdownRowTextProcessor; detailPanelValue: PanelModel; cells: any; showHideDetailPanelClick: any; onDetailPanelShowingChanged: any; get id(): string; get rowName(): any; get text(): any; get value(): any; set value(val: any); get locText(): LocalizableString; get hasPanel(): boolean; get detailPanel(): PanelModel; get detailPanelId(): string; get isDetailPanelShowing(): boolean; isCreatingDetailPanel: boolean; showDetailPanel(): void; hideDetailPanel(destroyPanel?: boolean): void; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; runCondition(values: any, properties: any): void; clearValue(): void; onAnyValueChanged(name: string): void; getDataValueCore(valuesHash: any, key: string): any; getValue(name: string): any; setValue(name: string, newColumnValue: any): void; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string, locNotification: any): void; get isEmpty(): boolean; getQuestionByColumn(column: MatrixDropdownColumn): Question; getCellByColumn(column: MatrixDropdownColumn): MatrixDropdownCell; getQuestionByColumnName(columnName: string): Question; get questions(): any; getQuestionByName(name: string): Question; getQuestionsByName(name: string): Array<Question>; protected getSharedQuestionByName(columnName: string): Question; clearIncorrectValues(val: any): void; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; locStrsChanged(): void; updateCellQuestionOnColumnChanged(column: MatrixDropdownColumn, name: string, newValue: any): void; updateCellQuestionOnColumnItemValueChanged(column: MatrixDropdownColumn, propertyName: string, obj: ItemValue, name: string, newValue: any, oldValue: any): void; onQuestionReadOnlyChanged(parentIsReadOnly: boolean): void; hasErrors(fireCallback: boolean, rec: any, raiseOnCompletedAsyncValidators: any): boolean; protected updateCellOnColumnChanged(cell: MatrixDropdownCell, name: string, newValue: any): void; updateCellOnColumnItemValueChanged(cell: MatrixDropdownCell, propertyName: string, obj: ItemValue, name: string, newValue: any, oldValue: any): void; protected buildCells(value: any): void; protected isTwoValueEquals(val1: any, val2: any): boolean; protected createCell(column: MatrixDropdownColumn): MatrixDropdownCell; getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; get rowIndex(): number; get editingObj(): Base; onEditingObjPropertyChanged: any; editingObjValue: Base; dispose(): void; } export declare class MatrixDropdownTotalCell extends MatrixDropdownCell { constructor(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, data: IMatrixDropdownData); column: MatrixDropdownColumn; row: MatrixDropdownRowModelBase; data: IMatrixDropdownData; protected createQuestion(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, data: IMatrixDropdownData): Question; locStrsChanged(): void; updateCellQuestion(): void; getTotalExpression(): string; } export declare class MatrixRowModel extends Base { constructor(item: ItemValue, fullName: string, data: IMatrixData, value: any); fullName: string; data: IMatrixData; item: ItemValue; cellClick: any; get name(): string; get text(): string; get locText(): LocalizableString; get value(): any; set value(val: any); get rowClasses(): string; } export declare class MinRowCountError extends SurveyError { constructor(minRowCount: number, errorOwner?: ISurveyErrorOwner); minRowCount: number; getErrorType(): string; protected getDefaultText(): string; } export declare class MultipleTextItemModel extends Base implements IValidatorOwner, ISurveyData, ISurveyImpl { constructor(name?: any, title?: string); editorValue: QuestionTextModel; data: IMultipleTextData; valueChangedCallback: any; getType(): string; get id(): string; getOriginalObj(): Base; /* * The item name. */ get name(): string; set name(val: string); get question(): Question; get editor(): QuestionTextModel; protected createEditor(name: string): QuestionTextModel; addUsedLocales(locales: any): void; locStrsChanged(): void; setData(data: IMultipleTextData): void; /* * Set this property to true, to make the item a required. If a user doesn't fill the item then a validation error will be generated. */ get isRequired(): boolean; set isRequired(val: boolean); /* * Use this property to change the default input type. */ get inputType(): string; set inputType(val: string); /* * Item title. If it is empty, the item name is rendered as title. This property supports markdown. */ get title(): string; set title(val: string); get locTitle(): LocalizableString; /* * Returns the text or html for rendering the title. */ get fullTitle(): string; /* * The maximum text length. If it is -1, defaul value, then the survey maxTextLength property will be used. * If it is 0, then the value is unlimited */ get maxLength(): number; set maxLength(val: number); getMaxLength(): any; /* * The input place holder. */ get placeHolder(): string; set placeHolder(val: string); get locPlaceHolder(): LocalizableString; /* * The custom text that will be shown on required error. Use this property, if you do not want to show the default text. */ get requiredErrorText(): string; set requiredErrorText(val: string); get locRequiredErrorText(): LocalizableString; /* * The input size. */ get size(): number; set size(val: number); /* * The list of question validators. */ get validators(): any; set validators(val: any); getValidators(): Array<SurveyValidator>; /* * The item value. */ get value(): any; set value(val: any); isEmpty(): boolean; onValueChanged(newValue: any): void; getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; getValue(name: string): any; setValue(name: string, value: any): void; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string): void; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; getValidatorTitle(): string; get validatedValue(): any; set validatedValue(val: any); getDataFilteredValues(): any; getDataFilteredProperties(): any; } export declare class OneAnswerRequiredError extends SurveyError { constructor(text?: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } export declare class OtherEmptyError extends SurveyError { constructor(text: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } export declare class PanelImplementorBase extends ImplementorBase { constructor(panel: any); panel: any; } export declare class PopupBaseViewModel extends Base { constructor(model: any, targetElement?: any); targetElement: any; prevActiveElement: any; scrollEventCallBack: any; top: string; left: string; height: string; width: string; isVisible: boolean; popupDirection: string; pointerTarget: IPosition; container: any; _model: any; get model(): any; set model(val: any); get title(): string; get contentComponentName(): string; get contentComponentData(): any; get showPointer(): boolean; get isModal(): boolean; get showFooter(): boolean; get isOverlay(): boolean; get styleClass(): string; onKeyDown(event: any): void; updateOnShowing(): void; updateOnHiding(): void; clickOutside(): void; cancel(): void; apply(): void; get cancelButtonText(): any; get applyButtonText(): any; dispose(): void; initializePopupContainer(): void; unmountPopupContainer(): void; } export declare class PopupModel<T = any> extends Base { constructor(contentComponentName: string, contentComponentData: T, verticalPosition?: any, horizontalPosition?: any, showPointer?: boolean, isModal?: boolean, onCancel?: any, onApply?: any, onHide?: any, onShow?: any, cssClass?: string, title?: string); width: number; contentComponentName: string; contentComponentData: T; verticalPosition: any; horizontalPosition: any; showPointer: boolean; isModal: boolean; onCancel: any; onApply: any; onHide: any; onShow: any; cssClass: string; title: string; displayMode: "popup" | "overlay"; widthMode: "contentWidth" | "fixedWidth"; get isVisible(): boolean; set isVisible(val: boolean); toggleVisibility(): void; onVisibilityChanged: any; } export declare class QuestionImplementor extends ImplementorBase { constructor(question: any); question: any; disposedObjects: any; callBackFunctions: any; koDummy: any; koElementType: any; _koValue: any; protected setObservaleObj(name: string, obj: any, addToQuestion?: boolean): any; protected setCallbackFunc(name: string, func: any): void; protected getKoValue(): any; protected onSurveyLoad(): void; protected getQuestionTemplate(): string; protected getNo(): string; protected updateKoDummy(): void; protected koQuestionAfterRender(elements: any, con: any): void; dispose(): void; } export declare class QuestionMatrixDropdownRenderedRow extends Base { constructor(cssClasses: any, isDetailRow?: boolean); cssClasses: any; isDetailRow: boolean; isGhostRow: boolean; isAdditionalClasses: boolean; row: MatrixDropdownRowModelBase; static counter: number; idValue: number; cells: any; onCreating(): void; get id(): number; get attributes(): { "data-sv-drop-target-matrix-row"?: undefined; } | { "data-sv-drop-target-matrix-row": string; }; get className(): string; } export declare class QuestionMatrixDropdownRenderedTable extends Base { constructor(matrix: QuestionMatrixDropdownModelBase); matrix: QuestionMatrixDropdownModelBase; headerRowValue: QuestionMatrixDropdownRenderedRow; footerRowValue: QuestionMatrixDropdownRenderedRow; hasRemoveRowsValue: boolean; rowsActions: any; cssClasses: any; renderedRowsChangedCallback: any; rows: any; get showTable(): boolean; get showHeader(): boolean; get showAddRowOnTop(): boolean; get showAddRowOnBottom(): boolean; get showFooter(): boolean; get hasFooter(): boolean; get hasRemoveRows(): boolean; isRequireReset(): boolean; get headerRow(): QuestionMatrixDropdownRenderedRow; get footerRow(): QuestionMatrixDropdownRenderedRow; protected build(): void; updateShowTableAndAddRow(): void; onAddedRow(): void; onRemovedRow(row: MatrixDropdownRowModelBase): void; onDetailPanelChangeVisibility(row: MatrixDropdownRowModelBase, isShowing: boolean): void; protected buildRowsActions(): void; protected buildHeader(): void; protected buildFooter(): void; protected buildRows(): void; hasActionCellInRowsValues: any; protected setDefaultRowActions(row: MatrixDropdownRowModelBase, actions: any): void; } export declare class QuestionPanelDynamicItem implements ISurveyData, ISurveyImpl { constructor(data: IQuestionPanelDynamicData, panel: PanelModel); static ItemVariableName: string; static ParentItemVariableName: string; static IndexVariableName: string; panelValue: PanelModel; data: IQuestionPanelDynamicData; textPreProcessor: QuestionPanelDynamicItemTextProcessor; get panel(): PanelModel; setSurveyImpl(): void; getValue(name: string): any; setValue(name: string, newValue: any): void; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string, locNotification: any): void; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; } export declare class QuestionPanelDynamicTemplateSurveyImpl implements ISurveyImpl { constructor(data: IQuestionPanelDynamicData); data: IQuestionPanelDynamicData; getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; } export declare class QuestionRowModel extends Base { constructor(panel: PanelModelBase); panel: PanelModelBase; static rowCounter: number; protected _scrollableParent: any; protected _updateVisibility: any; startLazyRendering(rowContainerDiv: any, findScrollableContainer?: any): void; ensureVisibility(): void; stopLazyRendering(): void; idValue: string; isLazyRenderingValue: boolean; setIsLazyRendering(val: boolean): void; isLazyRendering(): boolean; get id(): string; get elements(): any; get visibleElements(): any; get visible(): boolean; set visible(val: boolean); get isNeedRender(): boolean; set isNeedRender(val: boolean); updateVisible(): void; addElement(q: IElement): void; get index(): number; setElementMaxMinWidth(el: IElement): void; dispose(): void; getRowCss(): string; } export declare class QuestionTextProcessor implements ITextProcessor { constructor(variableName: string); textPreProcessor: TextPreProcessor; processValue(name: string, returnDisplayValue: boolean): TextPreProcessorValue; protected get survey(): ISurvey; protected get panel(): PanelModel; protected getValues(): any; protected getQuestionByName(name: string): Question; protected getParentTextProcessor(): ITextProcessor; protected onCustomProcessText(textValue: TextPreProcessorValue): boolean; processText(text: string, returnDisplayValue: boolean): string; processTextEx(text: string, returnDisplayValue: boolean): any; } export declare class RenderedRatingItem extends Base { constructor(itemValue: ItemValue, locString?: LocalizableString); itemValue: ItemValue; get value(): number; get locText(): LocalizableString; } export declare class RequiredInAllRowsError extends SurveyError { constructor(text: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } export declare class RequreNumericError extends SurveyError { constructor(text?: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } /* * Base class of SurveyJS Elements and Survey. */ export declare class SurveyElementCore extends Base implements ILocalizableOwner { constructor(); protected createLocTitleProperty(): LocalizableString; /* * Question, Panel, Page and Survey title. If page and panel is empty then they are not rendered. * Question renders question name if the title is empty. Use survey questionTitleTemplate property to change the title question rendering. */ get title(): string; set title(val: string); get locTitle(): LocalizableString; protected getDefaultTitleValue(): string; /* * Question, Panel and Page description. It renders under element title by using smaller font. Unlike the question title, description can be empty. * Please note, this property is hidden for questions without input, for example html question. */ hasDescription: boolean; get description(): string; set description(val: string); updateDescriptionVisibility(newDescription: any): void; get locDescription(): LocalizableString; get titleTagName(): string; protected getDefaultTitleTagName(): string; get hasTitle(): boolean; get hasTitleActions(): boolean; get hasTitleEvents(): boolean; getTitleToolbar(): AdaptiveActionContainer; getTitleOwner(): ITitleOwner; get isTitleOwner(): boolean; toggleState(): boolean; get cssClasses(): any; get cssTitle(): string; get ariaTitleId(): string; get titleTabIndex(): number; get titleAriaExpanded(): boolean; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; } export declare class SurveyImplementor extends ImplementorBase { constructor(survey: any); survey: any; renderedElement: any; render(element?: any): void; koEventAfterRender(element: any, survey: any): void; dispose(): void; } export declare class SurveyTimerModel extends Base { constructor(survey: ISurvey); onTimer: any; surveyValue: ISurvey; text: string; spent: number; get survey(): ISurvey; onCreating(): void; timerFunc: any; start(): void; stop(): void; get isRunning(): boolean; } /* * Base SurveyJS validator class. */ export declare class SurveyValidator extends Base { constructor(); errorOwner: ISurveyErrorOwner; onAsyncCompleted: any; getSurvey(live?: boolean): ISurvey; get text(): string; set text(val: string); get isValidateAllValues(): boolean; get locText(): LocalizableString; protected getErrorText(name: string): string; protected getDefaultErrorText(name: string): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; get isRunning(): boolean; get isAsync(): boolean; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; protected createCustomError(name: string): SurveyError; toString(): string; } export declare class SurveyWindowImplementor extends ImplementorBase { constructor(window: any); window: any; } /* * A Model for a survey running in the Window. */ export declare class SurveyWindowModel extends Base { constructor(jsonObj: any, initialModel?: SurveyModel); static surveyElementName: string; surveyValue: SurveyModel; windowElement: any; templateValue: string; expandedChangedCallback: any; showingChangedCallback: any; protected onCreating(): void; getType(): string; /* * A survey object. */ get survey(): SurveyModel; /* * Set this value to negative value, for example -1, to avoid closing the window on completing the survey. Leave it equals to 0 (default value) to close the window immediately, or set it to 3, 5, 10, ... to close the window in 3, 5, 10 seconds. */ closeOnCompleteTimeout: number; /* * Returns true if the window is currently showing. Set it to true to show the window and false to hide it. */ get isShowing(): boolean; set isShowing(val: boolean); /* * Show the window */ show(): void; /* * Hide the window */ hide(): void; /* * Returns true if the window is expanded. Set it to true to expand the window or false to collapse it. */ get isExpanded(): boolean; set isExpanded(val: boolean); protected onExpandedChanged(): void; /* * The window and survey title. */ get title(): string; set title(val: string); get locTitle(): LocalizableString; /* * Expand the window to show the survey. */ expand(): void; /* * Collapse the window and show survey title only. */ collapse(): void; changeExpandCollapse(): void; get css(): any; get cssButton(): string; get cssRoot(): string; get cssBody(): string; get cssHeaderRoot(): string; get cssHeaderTitle(): string; protected createSurvey(jsonObj: any): SurveyModel; protected onSurveyComplete(): void; } /* * A base class for all triggers. * A trigger calls a method when the expression change the result: from false to true or from true to false. * Please note, it runs only one changing the expression result. */ export declare class Trigger extends Base { constructor(); static operatorsValue: any; conditionRunner: ConditionRunner; usedNames: any; hasFunction: boolean; getType(): string; toString(): string; get operator(): string; set operator(val: string); get value(): any; set value(val: any); get name(): string; set name(val: string); get expression(): string; set expression(val: string); checkExpression(keys: any, values: any, properties?: any): void; check(value: any): void; protected onSuccess(values: any, properties: any): void; protected onFailure(): void; endLoadingFromJson(): void; buildExpression(): string; } export declare class UnaryOperand extends Operand { constructor(expressionValue: Operand, operatorName: string); consumer: any; get operator(): string; get expression(): Operand; getType(): string; toString(func?: any): string; protected isContentEqual(op: Operand): boolean; evaluate(processValue?: ProcessValue): boolean; setVariables(variables: any): void; } export declare class UploadingFileError extends SurveyError { constructor(text: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } export declare class VerticalResponsivityManager extends ResponsivityManager { constructor(container: any, model: any, itemsSelector: string, dotsItemSize?: number, minDimension?: number); protected getDimensions(): IDimensions; protected getAvailableSpace(): number; protected calcItemSize(item: any): number; } export declare class WebRequestEmptyError extends SurveyError { constructor(text: string, errorOwner?: ISurveyErrorOwner); text: string; getErrorType(): string; protected getDefaultText(): string; } export declare class WebRequestError extends SurveyError { constructor(status: string, response: string, errorOwner?: ISurveyErrorOwner); status: string; response: string; getErrorType(): string; protected getDefaultText(): string; } export declare class AdaptiveActionContainer<T extends Action = Action> extends ActionContainer<T> { constructor(); protected dotsItem: Action; protected dotsItemPopupModel: any; responsivityManager: ResponsivityManager; minVisibleItemsCount: number; isResponsivenessDisabled: boolean; protected invisibleItemsListModel: ListModel; protected onSet(): void; protected onPush(item: T): void; protected getRenderedActions(): Array<T>; protected raiseUpdate(isResetInitialized: boolean): void; fit(dimension: number, dotsItemSize: number): void; initResponsivityManager(container: any): void; resetResponsivityManager(): void; setActionsMode(mode: any): void; dispose(): void; } export declare class AnswerCountValidator extends SurveyValidator { constructor(minCount?: number, maxCount?: number); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): string; /* * The minCount property. */ get minCount(): number; set minCount(val: number); /* * The maxCount property. */ get maxCount(): number; set maxCount(val: number); } export declare class ButtonGroupItemValue extends ItemValue { constructor(value: any, text?: string, typeName?: string); iconName: string; iconSize: number; /* * By default item caption is visible. * Set it 'false' to hide item caption. */ showCaption: boolean; getType(): string; } /* * Obsolete, please use ChoicesRestful */ export declare class ChoicesRestfull extends ChoicesRestful { constructor(); static get EncodeParameters(): boolean; static set EncodeParameters(val: boolean); static clearCache(): void; static get onBeforeSendRequest(): any; static set onBeforeSendRequest(val: any); } export declare class DragDropChoices extends DragDropCore<QuestionSelectBase> { constructor(surveyValue?: ISurvey, creator?: any); protected get draggedElementType(): string; protected createDraggedElementShortcut(text: string, draggedElementNode: any, event: any): any; protected findDropTargetNodeByDragOverNode(dragOverNode: any): any; protected getDropTargetByDataAttributeValue(dataAttributeValue: string): ItemValue; protected isDropTargetValid(dropTarget: ItemValue): boolean; protected calculateIsBottom(clientY: number): boolean; protected afterDragOver(dropTargetNode: any): void; protected doDrop(): any; protected doClear(): void; } export declare class DragDropMatrixRows extends DragDropCore<QuestionMatrixDynamicModel> { constructor(surveyValue?: ISurvey, creator?: any); protected get draggedElementType(): string; protected createDraggedElementShortcut(text: string, draggedElementNode: any, event: any): any; fromIndex: number; toIndex: number; protected getDropTargetByDataAttributeValue(dataAttributeValue: any): MatrixDropdownRowModelBase; protected isDropTargetValid(dropTarget: any): boolean; protected findDropTargetNodeByDragOverNode(dragOverNode: any): any; protected calculateIsBottom(clientY: number): boolean; protected afterDragOver(dropTargetNode: any): void; protected doDrop: any; protected doClear(): void; } export declare class DragDropSurveyElements extends DragDropCore<any> { constructor(surveyValue?: ISurvey, creator?: any); static newGhostPage: PageModel; static restrictDragQuestionBetweenPages: boolean; static edgeHeight: number; static nestedPanelDepth: number; static ghostSurveyElementName: string; protected isEdge: boolean; protected prevIsEdge: any; protected ghostSurveyElement: IElement; protected get draggedElementType(): string; protected isDraggedElementSelected: boolean; startDragToolboxItem(event: any, draggedElementJson: JsonObject, toolboxItemTitle: string): void; startDragSurveyElement(event: any, draggedElement: any, isElementSelected?: boolean): void; protected getShortcutText(draggedElement: IShortcutText): string; protected createDraggedElementShortcut(text: string, draggedElementNode?: any, event?: any): any; protected createDraggedElementIcon(): any; protected getDraggedElementClass(): string; protected createElementFromJson(json: any): any; protected getDropTargetByDataAttributeValue(dataAttributeValue: string, dropTargetNode: any, event: any): any; protected isDropTargetValid(): boolean; protected calculateIsBottom(clientY: number, dropTargetNode?: any): boolean; protected isDropTargetDoesntChanged(newIsBottom: boolean): boolean; protected findDeepestDropTargetChild(parent: any): any; protected afterDragOver(): void; protected onStartDrag(): void; protected doBanDropHere: any; protected doDrop: any; protected doClear: any; protected insertGhostElementIntoSurvey(): boolean; protected removeGhostElementFromSurvey(): void; } /* * Validate e-mail address in the text input */ export declare class EmailValidator extends SurveyValidator { constructor(); re: any; getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): any; } /* * Show error if expression returns false */ export declare class ExpressionValidator extends SurveyValidator { constructor(expression?: string); conditionRunner: ConditionRunner; isRunningValue: boolean; getType(): string; get isValidateAllValues(): boolean; get isAsync(): boolean; get isRunning(): boolean; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected generateError(res: boolean, value: any, name: string): ValidatorResult; protected getDefaultErrorText(name: string): any; protected ensureConditionRunner(): boolean; /* * The expression property. */ get expression(): string; set expression(val: string); } /* * A class that contains expression and html propeties. It uses in survey.completedHtmlOnCondition array. * If the expression returns true then html of this item uses instead of survey.completedHtml property */ export declare class HtmlConditionItem extends ExpressionItem { constructor(expression?: string, html?: string); getType(): string; /* * The html that shows on completed ('Thank you') page. The expression should return true */ get html(): string; set html(val: string); get locHtml(): LocalizableString; } export declare class ImageItemValue extends ItemValue implements ILocalizableOwner { constructor(value: any, text?: string, typeName?: string); getType(): string; /* * The image or video link property. */ get imageLink(): string; set imageLink(val: string); aspectRatio: number; get locImageLink(): LocalizableString; getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; } export declare class JsonIncorrectTypeError extends JsonMissingTypeErrorBase { constructor(propertyName: string, baseClassName: string); propertyName: string; baseClassName: string; } export declare class JsonMissingTypeError extends JsonMissingTypeErrorBase { constructor(propertyName: string, baseClassName: string); propertyName: string; baseClassName: string; } export declare class ListModel extends ActionContainer { constructor(items: any, onItemSelect: any, allowSelection: boolean, selectedItem?: IAction, onFilteredTextChange?: any); onItemSelect: any; allowSelection: boolean; denySearch: boolean; needFilter: boolean; isExpanded: boolean; selectedItem: IAction; filteredText: string; static INDENT: number; static MINELEMENTCOUNT: number; protected onSet(): void; selectItem: any; isItemDisabled: any; isItemSelected: any; getItemClass: any; getItemIndent: any; get filteredTextPlaceholder(): any; onKeyDown(event: any): void; onPointerDown(event: any, item: any): void; refresh(): void; } export declare class MatrixDropdownRowModel extends MatrixDropdownRowModelBase { constructor(name: string, item: ItemValue, data: IMatrixDropdownData, value: any); name: string; item: ItemValue; get rowName(): string; get text(): string; get locText(): LocalizableString; } export declare class MatrixDropdownRowTextProcessor extends QuestionTextProcessor { constructor(row: MatrixDropdownRowModelBase, variableName: string, parentTextProcessor: ITextProcessor); protected getParentTextProcessor(): ITextProcessor; protected get survey(): ISurvey; protected getValues(): any; protected getQuestionByName(name: string): Question; protected onCustomProcessText(textValue: TextPreProcessorValue): boolean; } export declare class MatrixDropdownTotalRowModel extends MatrixDropdownRowModelBase { constructor(data: IMatrixDropdownData); protected createCell(column: MatrixDropdownColumn): MatrixDropdownCell; setValue(name: string, newValue: any): void; runCondition(values: any, properties: any): void; protected updateCellOnColumnChanged(cell: MatrixDropdownCell, name: string, newValue: any): void; } export declare class MatrixDynamicRowModel extends MatrixDropdownRowModelBase implements IShortcutText { constructor(index: number, data: IMatrixDropdownData, value: any); index: number; dragOrClickHelper: DragOrClickHelper; get rowName(): string; get shortcutText(): string; } export declare class MultipleTextItem extends MultipleTextItemModel { constructor(name?: any, title?: string); protected createEditor(name: string): QuestionTextModel; } /* * Validate numeric values. */ export declare class NumericValidator extends SurveyValidator { constructor(minValue?: number, maxValue?: number); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): any; /* * The minValue property. */ get minValue(): number; set minValue(val: number); /* * The maxValue property. */ get maxValue(): number; set maxValue(val: number); } export declare class QuestionCompositeTextProcessor extends QuestionTextProcessor { constructor(composite: QuestionCompositeModel, variableName: string); protected get survey(): ISurvey; protected get panel(): PanelModel; } export declare class QuestionFileImplementor extends QuestionImplementor { constructor(question: QuestionFile); } export declare class QuestionMatrixBaseImplementor extends QuestionImplementor { constructor(question: any); _tableImplementor: ImplementorBase; koRecalc: any; protected getQuestionTemplate(): string; protected isAddRowTop(): boolean; protected isAddRowBottom(): boolean; protected addRow(): void; protected removeRow(row: any): void; dispose(): void; } export declare class QuestionMatrixDynamicRenderedTable extends QuestionMatrixDropdownRenderedTable { constructor(matrix: QuestionMatrixDropdownModelBase); matrix: QuestionMatrixDropdownModelBase; protected setDefaultRowActions(row: MatrixDropdownRowModelBase, actions: any): void; } export declare class QuestionMultipleTextImplementor extends QuestionImplementor { constructor(question: QuestionMultipleText); koRecalc: any; } export declare class QuestionPanelDynamicImplementor extends QuestionImplementor { constructor(question: QuestionPanelDynamic); koRecalc: any; protected onPanelCountChanged(): void; protected onRenderModeChanged(): void; protected onCurrentIndexChanged(): void; protected addPanel(): void; protected removePanel(val: any): void; dispose(): void; } export declare class QuestionPanelDynamicItemTextProcessor extends QuestionTextProcessor { constructor(data: IQuestionPanelDynamicData, panelItem: QuestionPanelDynamicItem, variableName: string); protected get survey(): ISurvey; protected get panel(): PanelModel; protected getValues(): any; protected getQuestionByName(name: string): Question; protected onCustomProcessText(textValue: TextPreProcessorValue): boolean; } export declare class QuestionRatingImplementor extends QuestionImplementor { constructor(question: any); protected onCreated(): void; dispose(): void; } export declare class QuestionRow extends QuestionRowModel { constructor(panel: any); panel: any; koElementAfterRender: any; getElementType(el: any): "survey-panel" | "survey-question"; koAfterRender(el: any, con: any): void; rowAfterRender(elements: any, model: QuestionRow): void; dispose(): void; } export declare class QuestionSelectBaseImplementor extends QuestionImplementor { constructor(question: any); protected onCreated(): void; protected get isOtherSelected(): boolean; } /* * Use it to validate the text by regular expressions. */ export declare class RegexValidator extends SurveyValidator { constructor(regex?: string); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; /* * The regex property. */ get regex(): string; set regex(val: string); } /* * Base class of SurveyJS Elements. */ export declare class SurveyElement extends SurveyElementCore implements ISurveyElement { constructor(name: string); stateChangedCallback: any; static getProgressInfoByElements(children: any, isRequired: boolean): IProgressInfo; surveyImplValue: ISurveyImpl; surveyDataValue: ISurveyData; surveyValue: ISurvey; textProcessorValue: ITextProcessor; selectedElementInDesignValue: SurveyElement; dragTypeOverMe: DragTypeOverMeEnum; isDragMe: boolean; readOnlyChangedCallback: any; static ScrollElementToTop(elementId: string): boolean; static GetFirstNonTextElement(elements: any, removeSpaces?: boolean): any; static FocusElement(elementId: string): boolean; static CreateDisabledDesignElements: boolean; disableDesignActions: boolean; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; protected getSkeletonComponentNameCore(): string; get skeletonComponentName(): string; /* * Set this property to "collapsed" to render only Panel title and expanded button and to "expanded" to render the collapsed button in the Panel caption */ get state(): string; set state(val: string); /* * Returns true if the Element is in the collapsed state */ get isCollapsed(): boolean; /* * Returns true if the Element is in the expanded state */ get isExpanded(): boolean; /* * Collapse the Element */ collapse(): void; /* * Expand the Element */ expand(): void; /* * Toggle element's state */ toggleState(): boolean; get hasStateButton(): boolean; get shortcutText(): string; titleToolbarValue: any; getTitleToolbar(): AdaptiveActionContainer; protected createActionContainer(allowAdaptiveActions?: boolean): ActionContainer; get titleActions(): any; isTitleActionRequested: boolean; getTitleActions(): Array<any>; get hasTitleActions(): boolean; get hasTitleEvents(): boolean; get titleTabIndex(): number; get titleAriaExpanded(): boolean; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; protected canRunConditions(): boolean; getDataFilteredValues(): any; getDataFilteredProperties(): any; protected get surveyImpl(): ISurveyImpl; __setData(data: ISurveyData): void; get data(): ISurveyData; /* * Returns the survey object. */ get survey(): ISurvey; getSurvey(live?: boolean): ISurvey; protected setSurveyCore(value: ISurvey): void; isContentElement: boolean; isEditableTemplateElement: boolean; isInteractiveDesignElement: boolean; protected get isInternal(): boolean; get areInvisibleElementsShowing(): boolean; get isVisible(): boolean; get isReadOnly(): boolean; /* * Set it to true to make an element question/panel/page readonly. * Please note, this property is hidden for question without input, for example html question. */ get readOnly(): boolean; set readOnly(val: boolean); protected onReadOnlyChanged(): void; cssClassesValue: any; /* * Returns all css classes that used for rendering the question, panel or page. * You can use survey.onUpdateQuestionCssClasses event to override css classes for a question, survey.onUpdatePanelCssClasses event for a panel and survey.onUpdatePageCssClasses for a page. */ get cssClasses(): any; protected calcCssClasses(css: any): any; protected updateElementCssCore(cssClasses: any): void; get cssError(): string; updateElementCss(reNew?: boolean): void; protected clearCssClasses(): void; protected getIsLoadingFromJson(): boolean; /* * This is the identifier of a survey element - question or panel. */ get name(): string; set name(val: string); protected getValidName(name: string): string; protected onNameChanged(oldValue: string): void; protected updateBindingValue(valueName: string, value: any): void; /* * The list of errors. It is created by callig hasErrors functions */ get errors(): any; set errors(val: any); hasVisibleErrors: boolean; /* * Returns true if a question or a container (panel/page) or their chidren have an error. * The value can be out of date. hasErrors function should be called to get the correct value. */ get containsErrors(): boolean; updateContainsErrors(): void; protected getContainsErrors(): boolean; getElementsInDesign(includeHidden?: boolean): Array<IElement>; get selectedElementInDesign(): SurveyElement; set selectedElementInDesign(val: SurveyElement); updateCustomWidgets(): void; onSurveyLoad(): void; onFirstRendering(): void; endLoadingFromJson(): void; setVisibleIndex(index: number): number; /* * Returns true if it is a page. */ get isPage(): boolean; /* * Returns true if it is a panel. */ get isPanel(): boolean; /* * Returns true if it is a question. */ get isQuestion(): boolean; delete(): void; locOwner: ILocalizableOwner; /* * Returns the current survey locale */ getLocale(): string; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): any; getProcessedText(text: string): string; protected getUseDisplayValuesInTitle(): boolean; protected removeSelfFromList(list: any): void; protected get textProcessor(): ITextProcessor; protected getProcessedHtml(html: string): string; protected onSetData(): void; get parent(): IPanel; set parent(val: IPanel); protected getPage(parent: IPanel): IPage; protected moveToBase(parent: IPanel, container: IPanel, insertBefore?: any): boolean; protected setPage(parent: IPanel, newPage: IPage): void; protected getSearchableLocKeys(keys: any): void; protected get isDefaultV2Theme(): boolean; get isErrorsModeTooltip(): boolean; get hasParent(): boolean; protected get hasFrameV2(): boolean; /* * Use it to set the specific width to the survey element like css style (%, px, em etc). */ get width(): string; set width(val: string); /* * Use it to set the specific minWidth constraint to the survey element like css style (%, px, em etc). */ get minWidth(): string; set minWidth(val: string); /* * Use it to set the specific maxWidth constraint to the survey element like css style (%, px, em etc). */ get maxWidth(): string; set maxWidth(val: string); /* * The rendered width of the question. */ get renderWidth(): string; set renderWidth(val: string); /* * The left indent. Set this property to increase the survey element left indent. */ get indent(): number; set indent(val: number); /* * The right indent. Set it different from 0 to increase the right padding. */ get rightIndent(): number; set rightIndent(val: number); get paddingLeft(): string; set paddingLeft(val: string); get paddingRight(): string; set paddingRight(val: string); allowRootStyle: boolean; get rootStyle(): any; get clickTitleFunction(): any; protected needClickTitleFunction(): boolean; protected processTitleClick(): void; } /* * The `Survey` object contains information about the survey, Pages, Questions, flow logic and etc. */ export declare class SurveyModel extends SurveyElementCore implements ISurvey, ISurveyData, ISurveyImpl, ISurveyTriggerOwner, ISurveyErrorOwner, ISurveyTimerText { constructor(jsonObj?: any, renderedElement?: any); static TemplateRendererComponentName: string; static get cssType(): string; static set cssType(val: string); static stylesManager: StylesManager; static platform: string; get platformName(): string; /* * You can display an additional field (comment field) for the most of questions; users can enter additional comments to their response. * The comment field input is saved as `'question name' + 'commentPrefix'`. */ get commentPrefix(): string; set commentPrefix(val: string); valuesHash: any; variablesHash: any; editingObjValue: Base; localeValue: string; textPreProcessor: TextPreProcessor; timerModelValue: SurveyTimerModel; navigationBarValue: any; /* * The event is fired before the survey is completed and the `onComplete` event is fired. You can prevent the survey from completing by setting `options.allowComplete` to `false` * <br/> `sender` - the survey object that fires the event. * <br/> `options.allowComplete` - Specifies whether a user can complete a survey. Set this property to `false` to prevent the survey from completing. The default value is `true`. * <br/> `options.isCompleteOnTrigger` - returns true if the survey is completing on "complete" trigger. */ onCompleting: EventBase<SurveyModel>; /* * The event is fired after a user clicks the 'Complete' button and finishes a survey. Use this event to send the survey data to your web server. * <br/> `sender` - the survey object that fires the event. * <br/> `options.showDataSaving(text)` - call this method to show that the survey is saving survey data on your server. The `text` is an optional parameter to show a custom message instead of default. * <br/> `options.showDataSavingError(text)` - call this method to show that an error occurred while saving the data on your server. If you want to show a custom error, use an optional `text` parameter. * <br/> `options.showDataSavingSuccess(text)` - call this method to show that the data was successfully saved on the server. * <br/> `options.showDataSavingClear` - call this method to hide the text about the saving progress. * <br/> `options.isCompleteOnTrigger` - returns true if the survey is completed on "complete" trigger. */ onComplete: EventBase<SurveyModel>; /* * The event is fired before the survey is going to preview mode, state equals to `preview`. It happens when a user click on "Preview" button. It shows when "showPreviewBeforeComplete" proeprty equals to "showAllQuestions" or "showAnsweredQuestions". * You can prevent showing it by setting allowShowPreview to `false`. * <br/> `sender` - the survey object that fires the event. * <br/> `options.allowShowPreview` - Specifies whether a user can see a preview. Set this property to `false` to prevent from showing the preview. The default value is `true`. */ onShowingPreview: EventBase<SurveyModel>; /* * The event is fired after a user clicks the 'Complete' button. The event allows you to specify the URL opened after completing a survey. * Specify the `navigateToUrl` property to make survey navigate to another url. * <br/> `sender` - the survey object that fires the event. * <br/> `options.url` - Specifies a URL opened after completing a survey. Set this property to an empty string to cancel the navigation and show the completed survey page. */ onNavigateToUrl: EventBase<SurveyModel>; /* * The event is fired after the survey changed it's state from "starting" to "running". The "starting" state means that survey shows the started page. * The `firstPageIsStarted` property should be set to `true`, if you want to display a start page in your survey. In this case, an end user should click the "Start" button to start the survey. */ onStarted: EventBase<SurveyModel>; /* * The event is fired on clicking the 'Next' button if the `sendResultOnPageNext` is set to `true`. You can use it to save the intermediate results, for example, if your survey is large enough. * <br/> `sender` - the survey object that fires the event. */ onPartialSend: EventBase<SurveyModel>; /* * The event is fired before the current page changes to another page. Typically it happens when a user click the 'Next' or 'Prev' buttons. * <br/> `sender` - the survey object that fires the event. * <br/> `option.oldCurrentPage` - the previous current/active page. * <br/> `option.newCurrentPage` - a new current/active page. * <br/> `option.allowChanging` - set it to `false` to disable the current page changing. It is `true` by default. * <br/> `option.isNextPage` - commonly means, that end-user press the next page button. In general, it means that options.newCurrentPage is the next page after options.oldCurrentPage * <br/> `option.isPrevPage` - commonly means, that end-user press the previous page button. In general, it means that options.newCurrentPage is the previous page before options.oldCurrentPage */ onCurrentPageChanging: EventBase<SurveyModel>; /* * The event is fired when the current page has been changed to another page. Typically it happens when a user click on 'Next' or 'Prev' buttons. * <br/> `sender` - the survey object that fires the event. * <br/> `option.oldCurrentPage` - a previous current/active page. * <br/> `option.newCurrentPage` - a new current/active page. * <br/> `option.isNextPage` - commonly means, that end-user press the next page button. In general, it means that options.newCurrentPage is the next page after options.oldCurrentPage * <br/> `option.isPrevPage` - commonly means, that end-user press the previous page button. In general, it means that options.newCurrentPage is the previous page before options.oldCurrentPage */ onCurrentPageChanged: EventBase<SurveyModel>; /* * The event is fired before the question value (answer) is changed. It can be done via UI by a user or programmatically on calling the `setValue` method. * <br/> `sender` - the survey object that fires the event. * <br/> `options.name` - the value name that has being changed. * <br/> `options.question` - a question which `question.name` equals to the value name. If there are several questions with the same name, the first question is used. If there is no such questions, the `options.question` is null. * <br/> `options.oldValue` - an old, previous value. * <br/> `options.value` - a new value. You can change it. */ onValueChanging: EventBase<SurveyModel>; /* * The event is fired when the question value (i.e., answer) has been changed. The question value can be changed in UI (by a user) or programmatically (on calling `setValue` method). * Use the `onDynamicPanelItemValueChanged` and `onMatrixCellValueChanged` events to handle changes in a question in the Panel Dynamic and a cell question in matrices. * <br/> `sender` - the survey object that fires the event. * <br/> `options.name` - the value name that has been changed. * <br/> `options.question` - a question which `question.name` equals to the value name. If there are several questions with the same name, the first question is used. If there is no such questions, the `options.question` is `null`. * <br/> `options.value` - a new value. */ onValueChanged: EventBase<SurveyModel>; /* * The event is fired when setVariable function is called. It can be called on changing a calculated value. * <br/> `sender` - the survey object that fires the event. * <br/> `options.name` - the variable name that has been changed. * <br/> `options.value` - a new value. */ onVariableChanged: EventBase<SurveyModel>; /* * The event is fired when a question visibility has been changed. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a question which visibility has been changed. * <br/> `options.name` - a question name. * <br/> `options.visible` - a question `visible` boolean value. */ onVisibleChanged: EventBase<SurveyModel>; /* * The event is fired on changing a page visibility. * <br/> `sender` - the survey object that fires the event. * <br/> `options.page` - a page which visibility has been changed. * <br/> `options.visible` - a page `visible` boolean value. */ onPageVisibleChanged: EventBase<SurveyModel>; /* * The event is fired on changing a panel visibility. * <br/> `sender` - the survey object that fires the event. * <br/> `options.panel` - a panel which visibility has been changed. * <br/> `options.visible` - a panel `visible` boolean value. */ onPanelVisibleChanged: EventBase<SurveyModel>; /* * The event is fired on creating a new question. * Unlike the onQuestionAdded event, this event calls for all question created in survey including inside: a page, panel, matrix cell, dynamic panel and multiple text. * or inside a matrix cell or it can be a text question in multiple text items or inside a panel of a panel dynamic. * You can use this event to set up properties to a question based on it's type for all questions, regardless where they are located, on the page or inside a matrix cell. * Please note: If you want to use this event for questions loaded from JSON then you have to create survey with empty/null JSON parameter, assign the event and call survey.fromJSON(yourJSON) function. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a newly created question object. */ onQuestionCreated: EventBase<SurveyModel>; /* * The event is fired on adding a new question into survey. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a newly added question object. * <br/> `options.name` - a question name. * <br/> `options.index` - an index of the question in the container (page or panel). * <br/> `options.parentPanel` - a container where a new question is located. It can be a page or panel. * <br/> `options.rootPanel` - typically, it is a page. */ onQuestionAdded: EventBase<SurveyModel>; /* * The event is fired on removing a question from survey. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a removed question object. * <br/> `options.name` - a question name. */ onQuestionRemoved: EventBase<SurveyModel>; /* * The event is fired on adding a panel into survey. * <br/> `sender` - the survey object that fires the event. * <br/> `options.panel` - a newly added panel object. * <br/> `options.name` - a panel name. * <br/> `options.index` - an index of the panel in the container (a page or panel). * <br/> `options.parentPanel` - a container (a page or panel) where a new panel is located. * <br/> `options.rootPanel` - a root container, typically it is a page. */ onPanelAdded: EventBase<SurveyModel>; /* * The event is fired on removing a panel from survey. * <br/> `sender` - the survey object that fires the event. * <br/> `options.panel` - a removed panel object. * <br/> `options.name` - a panel name. */ onPanelRemoved: EventBase<SurveyModel>; /* * The event is fired on adding a page into survey. * <br/> `sender` - the survey object that fires the event. * <br/> `options.page` - a newly added `panel` object. */ onPageAdded: EventBase<SurveyModel>; /* * The event is fired on validating value in a question. You can specify a custom error message using `options.error`. The survey blocks completing the survey or going to the next page when the error messages are displayed. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a validated question. * <br/> `options.name` - a question name. * <br/> `options.value` - the current question value (answer). * <br/> `options.error` - an error string. It is empty by default. */ onValidateQuestion: EventBase<SurveyModel>; /* * The event is fired before errors are assigned to a question. You may add/remove/modify errors for a question. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a validated question. * <br/> `options.errors` - the list of errors. The list is empty by default and remains empty if a validated question has no errors. */ onSettingQuestionErrors: EventBase<SurveyModel>; /* * Use this event to validate data on your server. * <br/> `sender` - the survey object that fires the event. * <br/> `options.data` - the values of all non-empty questions on the current page. You can get a question value as `options.data["myQuestionName"]`. * <br/> `options.errors` - set your errors to this object as: `options.errors["myQuestionName"] = "Error text";`. It will be shown as a question error. * <br/> `options.complete()` - call this function to tell survey that your server callback has been processed. */ onServerValidateQuestions: any; /* * The event is fired on validating a panel. Set your error to `options.error` and survey will show the error for the panel and block completing the survey or going to the next page. * <br/> `sender` - the survey object that fires the event. * <br/> `options.name` - a panel name. * <br/> `options.error` - an error string. It is empty by default. */ onValidatePanel: EventBase<SurveyModel>; /* * Use the event to change the default error text. * <br/> `sender` - the survey object that fires the event. * <br/> `options.text` - an error text. * <br/> `options.error` - an instance of the `SurveyError` object. * <br/> `options.obj` - an instance of Question, Panel or Survey object to where error is located. * <br/> `options.name` - the error name. The following error names are available: * required, requireoneanswer, requirenumeric, exceedsize, webrequest, webrequestempty, otherempty, * uploadingfile, requiredinallrowserror, minrowcounterror, keyduplicationerror, custom */ onErrorCustomText: EventBase<SurveyModel>; /* * Use the this event to be notified when the survey finished validate questions on the current page. It commonly happens when a user try to go to the next page or complete the survey * options.questions - the list of questions that have errors * options.errors - the list of errors * options.page - the page where question(s) are located */ onValidatedErrorsOnCurrentPage: EventBase<SurveyModel>; /* * Use this event to modify the HTML content before rendering, for example `completeHtml` or `loadingHtml`. * `options.html` - specifies the modified HTML content. */ onProcessHtml: EventBase<SurveyModel>; /* * Use this event to change the question title in code. If you want to remove question numbering then set showQuestionNumbers to "off". * <br/> `sender` - the survey object that fires the event. * <br/> `options.title` - a calculated question title, based on question `title`, `name`. * <br/> `options.question` - a question object. */ onGetQuestionTitle: EventBase<SurveyModel>; /* * Use this event to change the element title tag name that renders by default. * <br/> `sender` - the survey object that fires the event. * <br/> `options.element` - an element (question, panel, page and survey) that SurveyJS is going to render. * <br/> `options.tagName` - an element title tagName that are used to render a title. You can change it from the default value. */ onGetTitleTagName: EventBase<SurveyModel>; /* * Use this event to change the question no in code. If you want to remove question numbering then set showQuestionNumbers to "off". * <br/> `sender` - the survey object that fires the event. * <br/> `options.no` - a calculated question no, based on question `visibleIndex`, survey `.questionStartIndex` properties. You can change it. * <br/> `options.question` - a question object. */ onGetQuestionNo: EventBase<SurveyModel>; /* * Use this event to change the progress text in code. * <br/> `sender` - the survey object that fires the event. * <br/> `options.text` - a progress text, that SurveyJS will render in progress bar. * <br/> `options.questionCount` - a number of questions that have input(s). We do not count html or expression questions * <br/> `options.answeredQuestionCount` - a number of questions that have input(s) and an user has answered. * <br/> `options.requiredQuestionCount` - a number of required questions that have input(s). We do not count html or expression questions * <br/> `options.requiredAnsweredQuestionCount` - a number of required questions that have input(s) and an user has answered. */ onProgressText: EventBase<SurveyModel>; /* * Use this event to process the markdown text. * <br/> `sender` - the survey object that fires the event. * <br/> `options.element` - SurveyJS element (a question, panel, page, or survey) where the string is going to be rendered. * <br/> `options.name` - a property name is going to be rendered. * <br/> `options.text` - a text that is going to be rendered. * <br/> `options.html` - an HTML content. It is `null` by default. Use this property to specify the HTML content rendered instead of `options.text`. */ onTextMarkdown: EventBase<SurveyModel>; /* * Use this event to specity render component name used for text rendering. * <br/> `sender` - the survey object that fires the event. * <br/> `options.element` - SurveyJS element (a question, panel, page, or survey) where the string is going to be rendered. * <br/> `options.name` - a property name is going to be rendered. * <br/> `options.renderAs` - a component name used for text rendering. */ onTextRenderAs: EventBase<SurveyModel>; /* * The event fires when it gets response from the [api.surveyjs.io](https://api.surveyjs.io) service on saving survey results. Use it to find out if the results have been saved successfully. * <br/> `sender` - the survey object that fires the event. * <br/> `options.success` - it is `true` if the results has been sent to the service successfully. * <br/> `options.response` - a response from the service. */ onSendResult: EventBase<SurveyModel>; /* * Use it to get results after calling the `getResult` method. It returns a simple analytics from [api.surveyjs.io](https://api.surveyjs.io) service. * <br/> `sender` - the survey object that fires the event. * <br/> `options.success` - it is `true` if the results were got from the service successfully. * <br/> `options.data` - the object `{AnswersCount, QuestionResult : {} }`. `AnswersCount` is the number of posted survey results. `QuestionResult` is an object with all possible unique answers to the question and number of these answers. * <br/> `options.dataList` - an array of objects `{name, value}`, where `name` is a unique value/answer to the question and `value` is a number/count of such answers. * <br/> `options.response` - the server response. */ onGetResult: EventBase<SurveyModel>; /* * The event is fired on uploading the file in QuestionFile when `storeDataAsText` is set to `false`. Use this event to change the uploaded file name or to prevent a particular file from being uploaded. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - the file question instance. * <br/> `options.name` - the question name. * <br/> `options.files` - the Javascript File objects array to upload. * <br/> `options.callback` - a callback function to get the file upload status and the updloaded file content. */ onUploadFiles: EventBase<SurveyModel>; /* * The event is fired on downloading a file in QuestionFile. Use this event to pass the file to a preview. * <br/> `sender` - the survey object that fires the event. * <br/> `options.name` - the question name. * <br/> `options.content` - the file content. * <br/> `options.fileValue` - single file question value. * <br/> `options.callback` - a callback function to get the file downloading status and the downloaded file content. */ onDownloadFile: EventBase<SurveyModel>; /* * This event is fired on clearing the value in a QuestionFile. Use this event to remove files stored on your server. * <br/> `sender` - the survey object that fires the event. * <br/> `question` - the question instance. * <br/> `options.name` - the question name. * <br/> `options.value` - the question value. * <br/> `options.fileName` - a removed file's name, set it to `null` to clear all files. * <br/> `options.callback` - a callback function to get the operation status. */ onClearFiles: EventBase<SurveyModel>; /* * The event is fired after choices for radiogroup, checkbox, and dropdown has been loaded from a RESTful service and before they are assigned to a question. * You may change the choices, before they are assigned or disable/enabled make visible/invisible question, based on loaded results. * <br/> `sender` - the survey object that fires the event. * <br/> `question` - the question where loaded choices are going to be assigned. * <br/> `choices` - the loaded choices. You can change the loaded choices to before they are assigned to question. * <br/> `serverResult` - a result that comes from the server as it is. */ onLoadChoicesFromServer: EventBase<SurveyModel>; /* * The event is fired after survey is loaded from api.surveyjs.io service. * You can use this event to perform manipulation with the survey model after it was loaded from the web service. * <br/> `sender` - the survey object that fires the event. */ onLoadedSurveyFromService: EventBase<SurveyModel>; /* * The event is fired on processing the text when it finds a text in brackets: `{somevalue}`. By default, it uses the value of survey question values and variables. * For example, you may use the text processing in loading choices from the web. If your `choicesByUrl.url` equals to "UrlToServiceToGetAllCities/{country}/{state}", * you may set on this event `options.value` to "all" or empty string when the "state" value/question is non selected by a user. * <br/> `sender` - the survey object that fires the event. * <br/> `options.name` - the name of the processing value, for example, "state" in our example. * <br/> `options.value` - the value of the processing text. * <br/> `options.isExists` - a boolean value. Set it to `true` if you want to use the value and set it to `false` if you don't. */ onProcessTextValue: EventBase<SurveyModel>; /* * The event is fired before rendering a question. Use it to override the default question CSS classes. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a question for which you can change the CSS classes. * <br/> `options.cssClasses` - an object with CSS classes. For example `{root: "table", button: "button"}`. You can change them to your own CSS classes. */ onUpdateQuestionCssClasses: EventBase<SurveyModel>; /* * The event is fired before rendering a panel. Use it to override the default panel CSS classes. * <br/> `sender` - the survey object that fires the event. * <br/> `options.panel` - a panel for which you can change the CSS classes. * <br/> `options.cssClasses` - an object with CSS classes. For example `{title: "sv_p_title", description: "small"}`. You can change them to your own CSS classes. */ onUpdatePanelCssClasses: EventBase<SurveyModel>; /* * The event is fired before rendering a page. Use it to override the default page CSS classes. * <br/> `sender` - the survey object that fires the event. * <br/> `options.page` - a page for which you can change the CSS classes. * <br/> `options.cssClasses` - an object with CSS classes. For example `{title: "sv_p_title", description: "small"}`. You can change them to your own CSS classes. */ onUpdatePageCssClasses: EventBase<SurveyModel>; /* * The event is fired before rendering a choice item in radiogroup, checkbox or dropdown questions. Use it to override the default choice item css. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a question where choice item is rendered. * <br/> `options.item` - a choice item of ItemValue type. You can get value or text choice properties as options.item.value or options.choice.text * <br/> `options.css` - a string with css classes divided by space. You can change it. */ onUpdateChoiceItemCss: EventBase<SurveyModel>; /* * The event is fired right after survey is rendered in DOM. * <br/> `sender` - the survey object that fires the event. * <br/> `options.htmlElement` - a root HTML element bound to the survey object. */ onAfterRenderSurvey: EventBase<SurveyModel>; /* * The event is fired right after a page is rendered in DOM. Use it to modify HTML elements. * <br/> `sender` - the survey object that fires the event. * <br/> `options.htmlElement` - an HTML element bound to the survey header object. */ onAfterRenderHeader: EventBase<SurveyModel>; /* * The event is fired right after a page is rendered in DOM. Use it to modify HTML elements. * <br/> `sender` - the survey object that fires the event. * <br/> `options.page` - a page object for which the event is fired. Typically the current/active page. * <br/> `options.htmlElement` - an HTML element bound to the page object. */ onAfterRenderPage: EventBase<SurveyModel>; /* * The event is fired right after a question is rendered in DOM. Use it to modify HTML elements. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a question object for which the event is fired. * <br/> `options.htmlElement` - an HTML element bound to the question object. */ onAfterRenderQuestion: EventBase<SurveyModel>; /* * The event is fired right after a non-composite question (text, comment, dropdown, radiogroup, checkbox) is rendered in DOM. Use it to modify HTML elements. * This event is not fired for matrices, panels, multiple text and image picker. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a question object for which the event is fired. * <br/> `options.htmlElement` - an HTML element bound to the question object. */ onAfterRenderQuestionInput: EventBase<SurveyModel>; /* * The event is fired right after a panel is rendered in DOM. Use it to modify HTML elements. * <br/> `sender` - the survey object that fires the event * <br/> `options.panel` - a panel object for which the event is fired * <br/> `options.htmlElement` - an HTML element bound to the panel object */ onAfterRenderPanel: EventBase<SurveyModel>; /* * The event occurs when an element within a question gets focus. * <br/> `sender` - A [survey](https://surveyjs.io/Documentation/Library?id=surveymodel) object that fires the event. * <br/> `options.question` - A [question](https://surveyjs.io/Documentation/Library?id=Question) whose child element gets focus. */ onFocusInQuestion: EventBase<SurveyModel>; /* * The event occurs when an element within a panel gets focus. * <br/> `sender` - A [survey](https://surveyjs.io/Documentation/Library?id=surveymodel) object that fires the event. * <br/> `options.panel` - A [panel](https://surveyjs.io/Documentation/Library?id=PanelModelBase) whose child element gets focus. */ onFocusInPanel: EventBase<SurveyModel>; /* * Use this event to change the visibility of an individual choice item in [Checkbox](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel), [Dropdown](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel), [Radiogroup](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel), and other similar question types. * * The event handler accepts the following arguments: * * - `sender` - A Survey instance that raised the event. * - `options.question` - A Question instance to which the choice item belongs. * - `options.item` - The choice item as specified in the [choices](https://surveyjs.io/Documentation/Library?id=QuestionSelectBase#choices) array. * - `options.visible` - A Boolean value that specifies the item visibility. Set it to `false` to hide the item. */ onShowingChoiceItem: EventBase<SurveyModel>; /* * The event is fired on adding a new row in Matrix Dynamic question. * <br/> `sender` - the survey object that fires the event * <br/> `options.question` - a matrix question. * <br/> `options.row` - a new added row. */ onMatrixRowAdded: EventBase<SurveyModel>; /* * The event is fired before adding a new row in Matrix Dynamic question. * <br/> `sender` - the survey object that fires the event * <br/> `options.question` - a matrix question. * <br/> `options.canAddRow` - specifies whether a new row can be added */ onMatrixBeforeRowAdded: EventBase<SurveyModel>; /* * The event is fired before removing a row from Matrix Dynamic question. You can disable removing and clear the data instead. * <br/> `sender` - the survey object that fires the event * <br/> `options.question` - a matrix question. * <br/> `options.rowIndex` - a row index. * <br/> `options.row` - a row object. * <br/> `options.allow` - a boolean property. Set it to `false` to disable the row removing. */ onMatrixRowRemoving: EventBase<SurveyModel>; /* * The event is fired on removing a row from Matrix Dynamic question. * <br/> `sender` - the survey object that fires the event * <br/> `options.question` - a matrix question * <br/> `options.rowIndex` - a removed row index * <br/> `options.row` - a removed row object */ onMatrixRowRemoved: EventBase<SurveyModel>; /* * The event is fired before rendering "Remove" button for removing a row from Matrix Dynamic question. * <br/> `sender` - the survey object that fires the event * <br/> `options.question` - a matrix question. * <br/> `options.rowIndex` - a row index. * <br/> `options.row` - a row object. * <br/> `options.allow` - a boolean property. Set it to `false` to disable the row removing. */ onMatrixAllowRemoveRow: EventBase<SurveyModel>; /* * The event is fired before creating cell question in the matrix. You can change the cell question type by setting different options.cellType. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - the matrix question. * <br/> `options.cellType` - the cell question type. You can change it. * <br/> `options.rowValue` - the value of the current row. To access a particular column's value within the current row, use: `options.rowValue["columnValue"]`. * <br/> `options.column` - the matrix column object. * <br/> `options.columnName` - the matrix column name. * <br/> `options.row` - the matrix row object. */ onMatrixCellCreating: EventBase<SurveyModel>; /* * The event is fired for every cell created in Matrix Dynamic and Matrix Dropdown questions. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - the matrix question. * <br/> `options.cell` - the matrix cell. * <br/> `options.cellQuestion` - the question/editor in the cell. You may customize it, change it's properties, like choices or visible. * <br/> `options.rowValue` - the value of the current row. To access a particular column's value within the current row, use: `options.rowValue["columnValue"]`. * <br/> `options.column` - the matrix column object. * <br/> `options.columnName` - the matrix column name. * <br/> `options.row` - the matrix row object. */ onMatrixCellCreated: EventBase<SurveyModel>; /* * The event is fired for every cell after is has been rendered in DOM. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - the matrix question. * <br/> `options.cell` - the matrix cell. * <br/> `options.cellQuestion` - the question/editor in the cell. * <br/> `options.htmlElement` - an HTML element bound to the `cellQuestion` object. * <br/> `options.column` - the matrix column object. * <br/> `options.row` - the matrix row object. */ onMatrixAfterCellRender: EventBase<SurveyModel>; /* * The event is fired when cell value is changed in Matrix Dynamic and Matrix Dropdown questions. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - the matrix question. * <br/> `options.columnName` - the matrix column name. * <br/> `options.value` - a new value. * <br/> `options.row` - the matrix row object. * <br/> `options.getCellQuestion(columnName)` - the function that returns the cell question by column name. */ onMatrixCellValueChanged: EventBase<SurveyModel>; /* * The event is fired on changing cell value in Matrix Dynamic and Matrix Dropdown questions. You may change the `options.value` property to change a cell value. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - the matrix question. * <br/> `options.columnName` - the matrix column name. * <br/> `options.value` - a new value. * <br/> `options.oldValue` - the old value. * <br/> `options.row` - the matrix row object. * <br/> `options.getCellQuestion(columnName)` - the function that returns a cell question by column name. */ onMatrixCellValueChanging: EventBase<SurveyModel>; /* * The event is fired when Matrix Dynamic and Matrix Dropdown questions validate the cell value. * <br/> `sender` - the survey object that fires the event. * <br/> `options.error` - an error string. It is empty by default. * <br/> `options.question` - the matrix question. * <br/> `options.columnName` - the matrix column name. * <br/> `options.value` - a cell value. * <br/> `options.row` - the matrix row object. * <br/> `options.getCellQuestion(columnName)` - the function that returns the cell question by column name. */ onMatrixCellValidate: EventBase<SurveyModel>; /* * The event is fired on adding a new panel in Panel Dynamic question. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a panel question. * <br/> `options.panel` - an added panel. */ onDynamicPanelAdded: EventBase<SurveyModel>; /* * The event is fired on removing a panel from Panel Dynamic question. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a panel question. * <br/> `options.panelIndex` - a removed panel index. * <br/> `options.panel` - a removed panel. */ onDynamicPanelRemoved: EventBase<SurveyModel>; /* * The event is fired every second if the method `startTimer` has been called. */ onTimer: EventBase<SurveyModel>; /* * The event is fired before displaying a new information in the Timer Panel. Use it to change the default text. * <br/> `sender` - the survey object that fires the event. * <br/> `options.text` - the timer panel info text. */ onTimerPanelInfoText: EventBase<SurveyModel>; /* * The event is fired when item value is changed in Panel Dynamic question. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - the panel question. * <br/> `options.panel` - the dynamic panel item. * <br/> `options.name` - the item name. * <br/> `options.value` - a new value. * <br/> `options.itemIndex` - the panel item index. * <br/> `options.itemValue` - the panel item object. */ onDynamicPanelItemValueChanged: EventBase<SurveyModel>; /* * Use this event to define, whether an answer to a question is correct or not. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - a question on which you have to decide if the answer is correct or not. * <br/> `options.result` - returns `true`, if an answer is correct, or `false`, if the answer is not correct. Use questions' `value` and `correctAnswer` properties to return the correct value. * <br/> `options.correctAnswers` - you may change the default number of correct or incorrect answers in the question, for example for matrix, where each row is a quiz question. */ onIsAnswerCorrect: EventBase<SurveyModel>; /* * Use this event to control drag&drop operations during design mode. * <br/> `sender` - the survey object that fires the event. * <br/> `options.allow` - set it to `false` to disable dragging. * <br/> `options.target` - a target element that is dragged. * <br/> `options.source` - a source element. It can be `null`, if it is a new element, dragging from toolbox. * <br/> `options.parent` - a page or panel where target element is dragging. * <br/> `options.insertBefore` - an element before the target element is dragging. It can be `null` if parent container (page or panel) is empty or dragging an element after the last element in a container. * <br/> `options.insertAfter` - an element after the target element is dragging. It can be `null` if parent container (page or panel) is empty or dragging element to the first position within the parent container. */ onDragDropAllow: EventBase<SurveyModel>; /* * Use this event to control scrolling element to top. You can cancel the default behavior by setting options.cancel property to true. * <br/> `sender` - the survey object that fires the event. * <br/> `options.element` - an element that is going to be scrolled on top. * <br/> `options.question` - a question that is going to be scrolled on top. It can be null if options.page is not null. * <br/> `options.page` - a page that is going to be scrolled on top. It can be null if options.question is not null. * <br/> `options.elementId` - the unique element DOM Id. * <br/> `options.cancel` - set this property to true to cancel the default scrolling. */ onScrollingElementToTop: EventBase<SurveyModel>; onLocaleChangedEvent: EventBase<SurveyModel>; /* * Use this event to create/customize actions to be displayed in a question's title. * <br/> `sender` - A [Survey](https://surveyjs.io/Documentation/Library?id=SurveyModel) object that fires the event. * <br/> `options.question` - A [Question](https://surveyjs.io/Documentation/Library?id=Question) object for which the event is fired. * <br/> `options.titleActions` - A list of actions ([IAction](https://surveyjs.io/Documentation/Library?id=IAction) objects) associated with the processed question. */ onGetQuestionTitleActions: EventBase<SurveyModel>; /* * Use this event to create/customize actions to be displayed in a panel's title. * <br/> `sender` - A survey object that fires the event. * <br/> `options.panel` - A panel ([PanelModel](https://surveyjs.io/Documentation/Library?id=panelmodel) object) for which the event is fired. * <br/> `options.titleActions` - A list of actions ([IAction](https://surveyjs.io/Documentation/Library?id=IAction) objects) associated with the processed panel. */ onGetPanelTitleActions: EventBase<SurveyModel>; /* * Use this event to create/customize actions to be displayed in a page's title. * <br/> `sender` - A survey object that fires the event. * <br/> `options.page` - A page ([PageModel](https://surveyjs.io/Documentation/Library?id=pagemodel) object) for which the event is fired. * <br/> `options.titleActions` - A list of actions ([IAction](https://surveyjs.io/Documentation/Library?id=IAction) objects) associated with the processed page. */ onGetPageTitleActions: EventBase<SurveyModel>; /* * Use this event to create/customize actions to be displayed in a matrix question's row. * <br/> `sender` - A survey object that fires the event. * <br/> `options.question` - A matrix question ([QuestionMatrixBaseModel](https://surveyjs.io/Documentation/Library?id=questionmatrixbasemodel) object) for which the event is fired. * <br/> `options.row` - A matrix row for which the event is fired. * <br/> `options.actions` - A list of actions ([IAction](https://surveyjs.io/Documentation/Library?id=IAction) objects) associated with the processed matrix question and row. */ onGetMatrixRowActions: EventBase<SurveyModel>; /* * The event is fired after the survey element content was collapsed or expanded. * <br/> `sender` - the survey object that fires the event. * <br/> `options.element` - Specifies which survey element content was collapsed or expanded. */ onElementContentVisibilityChanged: EventBase<SurveyModel>; /* * The event is fired before expression question convert it's value into display value for rendering. * <br/> `sender` - the survey object that fires the event. * <br/> `options.question` - The expression question. * <br/> `options.value` - The question value. * <br/> `options.displayValue` - the display value that you can change before rendering. */ onGetExpressionDisplayValue: EventBase<SurveyModel>; /* * The list of errors on loading survey JSON. If the list is empty after loading a JSON, then the JSON is correct and has no errors. */ jsonErrors: any; getType(): string; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; /* * Returns a list of all pages in the survey, including invisible pages. */ get pages(): any; renderCallback: any; render(element?: any): void; updateSurvey(newProps: any, oldProps?: any): void; getCss(): any; cssValue: any; get css(): any; set css(val: any); get cssTitle(): string; get cssNavigationComplete(): string; get cssNavigationPreview(): string; get cssNavigationEdit(): string; get cssNavigationPrev(): string; get cssNavigationStart(): string; get cssNavigationNext(): string; get bodyCss(): string; completedCss: string; containerCss: string; get completedStateCss(): string; getCompletedStateCss(): string; lazyRenderingValue: boolean; /* * By default all rows are rendered no matters if they are visible or not. * Set it true, and survey markup rows will be rendered only if they are visible in viewport. * This feature is experimantal and might do not support all the use cases. */ get lazyRendering(): boolean; set lazyRendering(val: boolean); get isLazyRendering(): boolean; /* * Gets or sets a list of triggers in the survey. */ get triggers(): any; set triggers(val: any); /* * Gets or sets a list of calculated values in the survey. */ get calculatedValues(): any; set calculatedValues(val: any); /* * Gets or sets an identifier of a survey model loaded from the [api.surveyjs.io](https://api.surveyjs.io) service. When specified, the survey JSON is automatically loaded from [api.surveyjs.io](https://api.surveyjs.io) service. */ get surveyId(): string; set surveyId(val: string); /* * Gets or sets an identifier of a survey model saved to the [api.surveyjs.io](https://api.surveyjs.io) service. When specified, the survey data is automatically saved to the [api.surveyjs.io](https://api.surveyjs.io) service. */ get surveyPostId(): string; set surveyPostId(val: string); /* * Gets or sets user's identifier (e.g., e-mail or unique customer id) in your web application. * If you load survey or post survey results from/to [api.surveyjs.io](https://api.surveyjs.io) service, then the library do not allow users to run the same survey the second time. * On the second run, the user will see the survey complete page. */ get clientId(): string; set clientId(val: string); /* * Gets or sets a cookie name used to save information about completing the survey. * If the property is not empty, before starting the survey, the Survey library checks if the cookie with this name exists. * If it is `true`, the survey goes to complete mode and a user sees the survey complete page. On completing the survey the cookie with this name is created. */ get cookieName(): string; set cookieName(val: string); /* * Gets or sets whether to save survey results on completing every page. If the property value is set to `true`, the `onPartialSend` event is fired. */ get sendResultOnPageNext(): boolean; set sendResultOnPageNext(val: boolean); /* * Gets or sets whether to show the progress on saving/sending data into the [api.surveyjs.io](https://api.surveyjs.io) service. */ get surveyShowDataSaving(): boolean; set surveyShowDataSaving(val: boolean); /* * Gets or sets whether the first input is focused on showing a next or a previous page. */ get focusFirstQuestionAutomatic(): boolean; set focusFirstQuestionAutomatic(val: boolean); /* * Gets or sets whether the first input is focused if the current page has errors. * Set this property to `false` (the default value is `true`) if you do not want to bring the focus to the first question that has error on the page. */ get focusOnFirstError(): boolean; set focusOnFirstError(val: boolean); /* * Gets or sets the navigation buttons position. * Possible values: 'bottom' (default), 'top', 'both' and 'none'. Set it to 'none' to hide 'Prev', 'Next' and 'Complete' buttons. * It makes sense if you are going to create a custom navigation, have only a single page, or the `goNextPageAutomatic` property is set to `true`. */ get showNavigationButtons(): any; set showNavigationButtons(val: any); /* * Gets or sets whether the Survey displays "Prev" button in its pages. Set it to `false` to prevent end-users from going back to their answers. */ get showPrevButton(): boolean; set showPrevButton(val: boolean); /* * Gets or sets whether the Survey displays survey title in its pages. Set it to `false` to hide a survey title. */ get showTitle(): boolean; set showTitle(val: boolean); /* * Gets or sets whether the Survey displays page titles. Set it to `false` to hide page titles. */ get showPageTitles(): boolean; set showPageTitles(val: boolean); /* * On finishing the survey the complete page is shown. Set the property to `false`, to hide the complete page. */ get showCompletedPage(): boolean; set showCompletedPage(val: boolean); /* * Set this property to a url you want to navigate after a user completing the survey. * By default it uses after calling onComplete event. In case calling options.showDataSaving callback in onComplete event, navigateToUrl will be used on calling options.showDataSavingSuccess callback. */ get navigateToUrl(): string; set navigateToUrl(val: string); /* * Gets or sets a list of URL condition items. If the expression of this item returns `true`, then survey will navigate to the item URL. */ get navigateToUrlOnCondition(): any; set navigateToUrlOnCondition(val: any); getNavigateToUrl(): string; /* * Gets or sets the required question mark. The required question mark is a char or string that is rendered in the required questions' titles. */ get requiredText(): string; set requiredText(val: string); /* * Gets or sets whether to hide all required errors. */ hideRequiredErrors: boolean; beforeSettingQuestionErrors(question: IQuestion, errors: any): void; beforeSettingPanelErrors(question: IPanel, errors: any): void; /* * Gets or sets the first question index. The first question index is '1' by default. You may start it from '100' or from 'A', by setting '100' or 'A' to this property. * You can set the start index to "(1)" or "# A)" or "a)" to render question number as (1), # A) and a) accordingly. */ get questionStartIndex(): string; set questionStartIndex(val: string); /* * Gets or sets whether the "Others" option text is stored as question comment. * * By default the entered text in the "Others" input in the checkbox/radiogroup/dropdown is stored as `"question name " + "-Comment"`. The value itself is `"question name": "others"`. * Set this property to `false`, to store the entered text directly in the `"question name"` key. */ get storeOthersAsComment(): boolean; set storeOthersAsComment(val: boolean); /* * Specifies the default maximum length for questions like text and comment, including matrix cell questions. * * The default value is `0`, that means that the text and comment have the same max length as the standard HTML input - 524288 characters: https://www.w3schools.com/tags/att_input_maxlength.asp. */ get maxTextLength(): number; set maxTextLength(val: number); /* * Gets or sets the default maximum length for question comments and others * * The default value is `0`, that means that the question comments have the same max length as the standard HTML input - 524288 characters: https://www.w3schools.com/tags/att_input_maxlength.asp. */ get maxOthersLength(): number; set maxOthersLength(val: number); /* * Gets or ses whether a user can navigate the next page automatically after answering all the questions on a page without pressing the "Next" button. * The available options: * * - `true` - navigate the next page and submit survey data automatically. * - `autogonext` - navigate the next page automatically but do not submit survey data. * - `false` - do not navigate the next page and do not submit survey data automatically. */ get goNextPageAutomatic(): boolean | "autogonext"; set goNextPageAutomatic(val: boolean | "autogonext"); /* * Gets or sets whether a survey is automatically completed when `goNextPageAutomatic = true`. Set it to `false` if you do not want to submit survey automatically on completing the last survey page. */ get allowCompleteSurveyAutomatic(): boolean; set allowCompleteSurveyAutomatic(val: boolean); /* * Gets or sets a value that specifies how the survey validates the question answers. * * The following options are available: * * - `onNextPage` (default) - check errors on navigating to the next page or on completing the survey. * - `onValueChanged` - check errors on every question value (i.e., answer) changing. * - `onValueChanging` - check errors before setting value into survey. If there is an error, then survey data is not changed, but question value will be keeped. * - `onComplete` - to validate all visible questions on complete button click. If there are errors on previous pages, then the page with the first error becomes the current. */ get checkErrorsMode(): string; set checkErrorsMode(val: string); /* * Specifies whether the text area of [comment](https://surveyjs.io/Documentation/Library?id=questioncommentmodel) questions/elements automatically expands its height to avoid the vertical scrollbar and to display the entire multi-line contents entered by respondents. * Default value is false. */ get autoGrowComment(): boolean; set autoGrowComment(val: boolean); /* * Gets or sets a value that specifies how the survey updates its questions' text values. * * The following options are available: * * - `onBlur` (default) - the value is updated after an input loses the focus. * - `onTyping` - update the value of text questions, "text" and "comment", on every key press. * * Note, that setting to "onTyping" may lead to a performance degradation, in case you have many expressions in the survey. */ get textUpdateMode(): string; set textUpdateMode(val: string); /* * Gets or sets a value that specifies how the invisible data is included in survey data. * * The following options are available: * * - `none` - include the invisible values into the survey data. * - `onHidden` - clear the question value when it becomes invisible. If a question has value and it was invisible initially then survey clears the value on completing. * - `onHiddenContainer` - clear the question value when it or its parent (page or panel) becomes invisible. If a question has value and it was invisible initially then survey clears the value on completing. * - `onComplete` (default) - clear invisible question values on survey complete. In this case, the invisible questions will not be stored on the server. */ get clearInvisibleValues(): any; set clearInvisibleValues(val: any); /* * Call this function to remove all question values from the survey, that end-user will not be able to enter. * For example the value that doesn't exists in a radiogroup/dropdown/checkbox choices or matrix rows/columns. * Please note, this function doesn't clear values for invisible questions or values that doesn't associated with questions. * In fact this function just call clearIncorrectValues function of all questions in the survey */ clearIncorrectValues(removeNonExisingRootKeys?: boolean): void; /* * Gets or sets the survey locale. The default value it is empty, this means the 'en' locale is used. * You can set it to 'de' - German, 'fr' - French and so on. The library has built-in localization for several languages. The library has a multi-language support as well. */ get locale(): string; set locale(val: string); /* * Returns an array of locales that are used in the survey's translation. */ getUsedLocales(): Array<any>; localeChanged(): void; getLocale(): string; locStrsChanged(): void; getMarkdownHtml(text: string, name: string): string; getRenderer(name: string): string; getRendererContext(locStr: LocalizableString): LocalizableString; getRendererForString(element: Base, name: string): string; getRendererContextForString(element: Base, locStr: LocalizableString): LocalizableString; getExpressionDisplayValue(question: IQuestion, value: any, displayValue: string): string; getProcessedText(text: string): string; getLocString(str: string): any; getErrorCustomText(text: string, error: SurveyError): string; getSurveyErrorCustomText(obj: Base, text: string, error: SurveyError): string; /* * Returns the text that is displayed when there are no any visible pages and questiona. */ get emptySurveyText(): string; /* * Gets or sets a survey logo. */ get logo(): string; set logo(val: string); get locLogo(): LocalizableString; /* * Gets or sets a survey logo width. */ get logoWidth(): any; set logoWidth(val: any); /* * Gets or sets a survey logo height. */ get logoHeight(): any; set logoHeight(val: any); /* * Gets or sets a survey logo position. */ get logoPosition(): string; set logoPosition(val: string); get hasLogo(): boolean; get isLogoBefore(): boolean; get isLogoAfter(): boolean; get logoClassNames(): string; get renderedHasTitle(): boolean; get renderedHasDescription(): boolean; get hasTitle(): boolean; get renderedHasLogo(): boolean; get renderedHasHeader(): boolean; /* * The logo fit mode. */ get logoFit(): string; set logoFit(val: string); _isMobile: boolean; setIsMobile(newVal?: boolean): void; protected isLogoImageChoosen(): string; get titleMaxWidth(): string; /* * Gets or sets the HTML content displayed on the complete page. Use this property to change the default complete page text. */ get completedHtml(): string; set completedHtml(val: string); get locCompletedHtml(): LocalizableString; /* * The list of HTML condition items. If the expression of this item returns `true`, then a survey will use this item HTML instead of `completedHtml`. */ get completedHtmlOnCondition(): any; set completedHtmlOnCondition(val: any); /* * Calculates a given expression and returns a result value. */ runExpression(expression: string): any; /* * Calculates a given expression and returns `true` or `false`. */ runCondition(expression: string): boolean; /* * Run all triggers that performs on value changed and not on moving to the next page. */ runTriggers(): void; get renderedCompletedHtml(): string; /* * The HTML content displayed to an end user that has already completed the survey. */ get completedBeforeHtml(): string; set completedBeforeHtml(val: string); get locCompletedBeforeHtml(): LocalizableString; /* * The HTML that shows on loading survey Json from the [api.surveyjs.io](https://api.surveyjs.io) service. */ get loadingHtml(): string; set loadingHtml(val: string); get locLoadingHtml(): LocalizableString; /* * Default value for loadingHtml property */ get defaultLoadingHtml(): string; get navigationBar(): any; /* * Adds a custom navigation item similar to the Previous Page, Next Page, and Complete buttons. * Accepts an object described in the [IAction](https://surveyjs.io/Documentation/Library?id=IAction) help section. */ addNavigationItem(val: IAction): Action; /* * Gets or sets the 'Start' button caption. * The 'Start' button is shown on the started page. Set the `firstPageIsStarted` property to `true`, to display the started page. */ get startSurveyText(): string; set startSurveyText(val: string); get locStartSurveyText(): LocalizableString; /* * Gets or sets the 'Prev' button caption. */ get pagePrevText(): string; set pagePrevText(val: string); get locPagePrevText(): LocalizableString; /* * Gets or sets the 'Next' button caption. */ get pageNextText(): string; set pageNextText(val: string); get locPageNextText(): LocalizableString; /* * Gets or sets the 'Complete' button caption. */ get completeText(): string; set completeText(val: string); get locCompleteText(): LocalizableString; /* * Gets or sets the 'Preview' button caption. */ get previewText(): string; set previewText(val: string); get locPreviewText(): LocalizableString; /* * Gets or sets the 'Edit' button caption. */ get editText(): string; set editText(val: string); get locEditText(): LocalizableString; getElementTitleTagName(element: Base, tagName: string): string; /* * Set the pattern for question title. Default is "numTitleRequire", 1. What is your name? *, * You can set it to numRequireTitle: 1. * What is your name? * You can set it to requireNumTitle: * 1. What is your name? * You can set it to numTitle (remove require symbol completely): 1. What is your name? */ get questionTitlePattern(): string; set questionTitlePattern(val: string); getQuestionTitlePatternOptions(): Array<any>; /* * Gets or sets a question title template. Obsolete, please use questionTitlePattern */ get questionTitleTemplate(): string; set questionTitleTemplate(val: string); get locQuestionTitleTemplate(): LocalizableString; getUpdatedQuestionTitle(question: IQuestion, title: string): string; getUpdatedQuestionNo(question: IQuestion, no: string): string; /* * Gets or sets whether the survey displays page numbers on pages titles. */ get showPageNumbers(): boolean; set showPageNumbers(val: boolean); /* * Gets or sets a value that specifies how the question numbers are displayed. * * The following options are available: * * - `on` - display question numbers * - `onpage` - display question numbers, start numbering on every page * - `off` - turn off the numbering for questions titles */ get showQuestionNumbers(): string; set showQuestionNumbers(val: string); /* * Gets or sets the survey progress bar position. * * The following options are available: * * - `off` (default) - don't show progress bar * - `top` - show progress bar in the top * - `bottom` - show progress bar in the bottom * - `both` - show progress bar in both sides: top and bottom. */ get showProgressBar(): string; set showProgressBar(val: string); /* * Gets or sets the type of info in the progress bar. * * The following options are available: * * - `pages` (default), * - `questions`, * - `requiredQuestions`, * - `correctQuestions`, * - `buttons` */ get progressBarType(): string; set progressBarType(val: string); get isShowProgressBarOnTop(): boolean; get isShowProgressBarOnBottom(): boolean; /* * Returns the text/HTML that is rendered as a survey title. */ get processedTitle(): string; /* * Gets or sets the question title location. * * The following options are available: * * - `bottom` - show a question title to bottom * - `left` - show a question title to left * - `top` - show a question title to top. * * > Some questions, for example matrixes, do not support 'left' value. The title for them will be displayed to the top. */ get questionTitleLocation(): string; set questionTitleLocation(val: string); updateElementCss(reNew?: boolean): void; /* * Gets or sets the error message position. * * The following options are available: * * - `top` - to show question error(s) over the question, * - `bottom` - to show question error(s) under the question. */ get questionErrorLocation(): string; set questionErrorLocation(val: string); /* * Gets or sets the question description position. The default value is `underTitle`. * * The following options are available: * * - `underTitle` - show question description under the question title, * - `underInput` - show question description under the question input instead of question title. */ get questionDescriptionLocation(): string; set questionDescriptionLocation(val: string); /* * Gets or sets the survey edit mode. * * The following options are available: * * - `edit` (default) - make a survey editable, * - `display` - make a survey read-only. */ get mode(): string; set mode(val: string); /* * Gets or sets an object that stores the survey results/data. You can set it directly as `{ 'question name': questionValue, ... }` * * > If you set the `data` property after creating the survey, you may need to set the `currentPageNo` to `0`, if you are using `visibleIf` properties for questions/pages/panels to ensure that you are starting from the first page. */ get data(): any; set data(val: any); /* * Merge the values into survey.data. It works as survey.data, except it doesn't clean the existing data, but overrides them. */ mergeData(data: any): void; setDataCore(data: any): void; onEditingObjPropertyChanged: any; get editingObj(): Base; set editingObj(val: Base); get isEditingSurveyElement(): boolean; getAllValues(): any; /* * Returns survey result data as an array of plain objects: with question `title`, `name`, `value`, and `displayValue`. * * For complex questions (like matrix, etc.) `isNode` flag is set to `true` and data contains array of nested objects (rows). * * Set `options.includeEmpty` to `false` if you want to skip empty answers. */ getPlainData(options?: any): any; getFilteredValues(): any; getFilteredProperties(): any; getDataValueCore(valuesHash: any, key: string): any; setDataValueCore(valuesHash: any, key: string, value: any): void; deleteDataValueCore(valuesHash: any, key: string): void; valueHashGetDataCallback: any; valueHashSetDataCallback: any; valueHashDeleteDataCallback: any; /* * Returns all comments from the data. */ get comments(): any; /* * Returns a list of visible pages. If all pages are visible, then this property returns the same list as the `pages` property. */ get visiblePages(): any; /* * Returns `true` if the survey contains no pages. The survey is empty. */ get isEmpty(): boolean; /* * Deprecated. Use the `pageCount` property instead. */ get PageCount(): number; /* * Returns the survey page count. */ get pageCount(): number; /* * Returns a number of visible pages within the survey. */ get visiblePageCount(): number; /* * Returns the started page. This property works if the `firstPageIsStarted` property is set to `true`. */ get startedPage(): PageModel; /* * Gets or sets the current survey page. If a survey is rendered, then this property returns a page that a user can see/edit. */ get currentPage(): any; set currentPage(val: any); /* * Returns the currentPage, unless the started page is showing. In this case returns the started page. */ get activePage(): any; /* * The started page is showing right now. survey state equals to "starting" */ get isShowStartingPage(): boolean; /* * Survey is showing a page right now. It is in "running", "preview" or starting state. */ get isShowingPage(): boolean; /* * The zero-based index of the current page in the visible pages array. */ get currentPageNo(): number; set currentPageNo(val: number); /* * Gets or sets the question display order. Use this property to randomize questions. You can randomize questions on a specific page. * * The following options are available: * * - `random` - randomize questions * - `initial` - keep questions in the same order, as in a survey model. */ get questionsOrder(): string; set questionsOrder(val: string); /* * Sets the input focus to the first question with the input field. */ focusFirstQuestion(): void; scrollToTopOnPageChange(doScroll?: boolean): void; /* * Returns the current survey state: * * - `loading` - the survey is being loaded from JSON, * - `empty` - there is nothing to display in the current survey, * - `starting` - the survey's start page is displayed, * - `running` - a respondent is answering survey questions right now, * - `preview` - a respondent is previewing answered questions before submitting the survey (see [example](https://surveyjs.io/Examples/Library?id=survey-showpreview)), * - `completed` - a respondent has completed the survey and submitted the results. * * Details: [Preview State](https://surveyjs.io/Documentation/Library#states) */ get state(): string; get completedState(): string; get completedStateText(): string; protected setCompletedState(value: string, text: string): void; /* * Clears the survey data and state. If the survey has a `completed` state, it will get a `running` state. */ clear(clearData?: boolean, gotoFirstPage?: boolean): void; mergeValues(src: any, dest: any): void; protected updateCustomWidgets(page: PageModel): void; protected currentPageChanging(newValue: PageModel, oldValue: PageModel): boolean; protected currentPageChanged(newValue: PageModel, oldValue: PageModel): void; /* * Returns the progress that a user made while going through the survey. * It depends from progressBarType property */ getProgress(): number; /* * Returns the progress that a user made while going through the survey. * It depends from progressBarType property */ get progressValue(): number; /* * Returns the navigation buttons (i.e., 'Prev', 'Next', or 'Complete' and 'Preview') position. */ get isNavigationButtonsShowing(): string; /* * Returns true if the navigation buttons (i.e., 'Prev', 'Next', or 'Complete' and 'Preview') are shows on top. */ get isNavigationButtonsShowingOnTop(): boolean; /* * Returns true if the navigation buttons (i.e., 'Prev', 'Next', or 'Complete' and 'Preview') are shows on bottom. */ get isNavigationButtonsShowingOnBottom(): boolean; /* * Returns `true` if the survey is in edit mode. */ get isEditMode(): boolean; /* * Returns `true` if the survey is in display mode or in preview mode. */ get isDisplayMode(): boolean; get isUpdateValueTextOnTyping(): boolean; /* * Returns `true` if the survey is in design mode. It is used by SurveyJS Editor. */ get isDesignMode(): boolean; _isDesignMode: boolean; /* * Sets the survey into design mode. */ setDesignMode(value: boolean): void; /* * Gets or sets whether to show all elements in the survey, regardless their visibility. The default value is `false`. */ get showInvisibleElements(): boolean; set showInvisibleElements(val: boolean); get areInvisibleElementsShowing(): boolean; get areEmptyElementsHidden(): boolean; /* * Returns `true`, if a user has already completed the survey in this browser and there is a cookie about it. Survey goes to `completed` state if the function returns `true`. */ get hasCookie(): boolean; /* * Set the cookie with `cookieName` in user's browser. It is done automatically on survey complete if the `cookieName` property value is not empty. */ setCookie(): void; /* * Deletes the cookie with `cookieName` from the browser. */ deleteCookie(): void; /* * Gets or sets whether the survey must ignore validation like required questions and others, on `nextPage` and `completeLastPage` function calls. The default is `false`. */ ignoreValidation: boolean; /* * Navigates user to the next page. * * Returns `false` in the following cases: * * - if the current page is the last page. * - if the current page contains errors (for example, a required question is empty). */ nextPage(): boolean; asyncValidationQuesitons: any; /* * Returns `true`, if the current page contains errors, for example, the required question is empty or a question validation is failed. */ get isCurrentPageHasErrors(): boolean; /* * Returns `true`, if the current page contains any error. If there is an async function in an expression, then the function will return `undefined` value. * In this case, you should use `onAsyncValidation` parameter, which is a callback function: (hasErrors: boolean) => void */ hasCurrentPageErrors(onAsyncValidation?: any): boolean; /* * Returns `true`, if a page contains an error. If there is an async function in an expression, then the function will return `undefined` value. * In this case, you should use the second `onAsyncValidation` parameter, which is a callback function: (hasErrors: boolean) => void */ hasPageErrors(page?: PageModel, onAsyncValidation?: any): boolean; /* * Returns `true`, if any of the survey pages contains errors. If there is an async function in an expression, then the function will return `undefined` value. * In this case, you should use the third `onAsyncValidation` parameter, which is a callback function: (hasErrors: boolean) => void */ hasErrors(fireCallback?: boolean, focusOnFirstError?: boolean, onAsyncValidation?: any): boolean; /* * Checks whether survey elements (pages, panels, and questions) have unique question names. * You can check for unique names for individual page and panel (and all their elements) or a question. * If the parameter is not specified, then a survey checks that all its elements have unique names. */ ensureUniqueNames(element?: ISurveyElement): void; /* * Navigates user to a previous page. If the current page is the first page, `prevPage` returns `false`. `prevPage` does not perform any checks, required questions can be empty. */ prevPage(): boolean; /* * Completes the survey, if the current page is the last one. It returns `false` if the last page has errors. * If the last page has no errors, `completeLastPage` calls `doComplete` and returns `true`. */ completeLastPage(): boolean; isNavigationButtonPressed: boolean; navigationMouseDown(): boolean; mouseDownPage: any; nextPageUIClick(): void; nextPageMouseDown(): boolean; /* * Shows preview for the survey. Switches the survey to the "preview" state. * * Details: [Preview State](https://surveyjs.io/Documentation/Library#states-preview) */ showPreview(): boolean; /* * Cancels preview and switches back to the "running" state. * * Details: [Preview State](https://surveyjs.io/Documentation/Library#states-preview) */ cancelPreview(curPage?: any): void; cancelPreviewByPage(panel: IPanel): any; protected doCurrentPageComplete(doComplete: boolean): boolean; /* * Obsolete. Use the `questionsOnPageMode` property instead. */ get isSinglePage(): boolean; set isSinglePage(val: boolean); /* * Gets or sets a value that specifies how the survey combines questions, panels, and pages. * * The following options are available: * * - `singlePage` - combine all survey pages in a single page. Pages will be converted to panels. * - `questionPerPage` - show one question per page. Survey will create a separate page for every question. */ get questionsOnPageMode(): string; set questionsOnPageMode(val: string); /* * Gets or sets whether the first survey page is a start page. Set this property to `true`, to make the first page a starting page. * An end user cannot navigate to the start page and the start page does not affect a survey progress. */ get firstPageIsStarted(): boolean; set firstPageIsStarted(val: boolean); isPageStarted(page: IPage): boolean; /* * Set this property to "showAllQuestions" or "showAnsweredQuestions" to allow respondents to preview answers before submitting the survey results. * * Details: [Preview State](https://surveyjs.io/Documentation/Library#states-preview) * Example: [Show Preview Before Complete](https://surveyjs.io/Examples/Library?id=survey-showpreview) */ get showPreviewBeforeComplete(): string; set showPreviewBeforeComplete(val: string); get isShowPreviewBeforeComplete(): boolean; protected onFirstPageIsStartedChanged(): void; runningPages: any; origionalPages: any; protected onQuestionsOnPageModeChanged(oldValue: string): void; /* * Gets whether the current page is the first one. */ get isFirstPage(): boolean; /* * Gets whether the current page is the last one. */ get isLastPage(): boolean; get isShowPrevButton(): boolean; get isShowNextButton(): boolean; get isCompleteButtonVisible(): boolean; get isPreviewButtonVisible(): boolean; get isCancelPreviewButtonVisible(): boolean; calcIsCompleteButtonVisible(): boolean; /* * Completes the survey. * * Calling this function performs the following tasks: * * - writes cookie if the `cookieName` property is not empty * - sets the survey into `completed` state * - fires the `onComplete` event * - calls `sendResult` function. * * Calling the `doComplete` function does not perform any validation, unlike the `completeLastPage` function. * The function can return false, if you set options.allowComplete to false in onCompleting event. Otherwise it returns true. * It calls `navigateToUrl` after calling `onComplete` event. * In case calling `options.showDataSaving` callback in the `onComplete` event, `navigateToUrl` is used on calling `options.showDataSavingSuccess` callback. */ doComplete(isCompleteOnTrigger?: boolean): boolean; /* * Starts the survey. Changes the survey mode from "starting" to "running". Call this function if your survey has a start page, otherwise this function does nothing. */ start(): boolean; /* * Gets whether the question values on the current page are validating on the server at the current moment. */ get isValidatingOnServer(): boolean; protected onIsValidatingOnServerChanged(): void; protected doServerValidation(doComplete: boolean, isPreview?: boolean): boolean; protected doNextPage(): void; setCompleted(): void; /* * Returns the HTML content for the complete page. */ get processedCompletedHtml(): string; /* * Returns the HTML content, that is shown to a user that had completed the survey before. */ get processedCompletedBeforeHtml(): string; /* * Returns the HTML content, that is shows when a survey loads the survey JSON. */ get processedLoadingHtml(): string; getProgressInfo(): IProgressInfo; /* * Returns the text for the current progress. */ get progressText(): string; isCalculatingProgressText: boolean; updateProgressText(onValueChanged?: boolean): void; getProgressText(): string; rootCss: string; getRootCss(): string; resizeObserver: any; afterRenderSurvey(htmlElement: any): void; updateQuestionCssClasses(question: IQuestion, cssClasses: any): void; updatePanelCssClasses(panel: IPanel, cssClasses: any): void; updatePageCssClasses(page: IPage, cssClasses: any): void; updateChoiceItemCss(question: IQuestion, options: any): void; isFirstPageRendering: boolean; isCurrentPageRendering: boolean; afterRenderPage(htmlElement: any): void; afterRenderHeader(htmlElement: any): void; afterRenderQuestion(question: IQuestion, htmlElement: any): void; afterRenderQuestionInput(question: IQuestion, htmlElement: any): void; afterRenderPanel(panel: IElement, htmlElement: any): void; whenQuestionFocusIn(question: IQuestion): void; whenPanelFocusIn(panel: IPanel): void; canChangeChoiceItemsVisibility(): boolean; getChoiceItemVisibility(question: IQuestion, item: any, val: boolean): boolean; matrixBeforeRowAdded(options: any): void; matrixRowAdded(question: IQuestion, row: any): void; getQuestionByValueNameFromArray(valueName: string, name: string, index: number): IQuestion; matrixRowRemoved(question: IQuestion, rowIndex: number, row: any): void; matrixRowRemoving(question: IQuestion, rowIndex: number, row: any): boolean; matrixAllowRemoveRow(question: IQuestion, rowIndex: number, row: any): boolean; matrixCellCreating(question: IQuestion, options: any): void; matrixCellCreated(question: IQuestion, options: any): void; matrixAfterCellRender(question: IQuestion, options: any): void; matrixCellValueChanged(question: IQuestion, options: any): void; matrixCellValueChanging(question: IQuestion, options: any): void; get isValidateOnValueChanging(): boolean; get isValidateOnValueChanged(): boolean; matrixCellValidate(question: IQuestion, options: any): SurveyError; dynamicPanelAdded(question: IQuestion): void; dynamicPanelRemoved(question: IQuestion, panelIndex: number, panel: IPanel): void; dynamicPanelItemValueChanged(question: IQuestion, options: any): void; dragAndDropAllow(options: any): boolean; elementContentVisibilityChanged(element: ISurveyElement): void; getUpdatedElementTitleActions(element: ISurveyElement, titleActions: any): Array<IAction>; getUpdatedMatrixRowActions(question: IQuestion, row: any, actions: any): any; scrollElementToTop(element: ISurveyElement, question: IQuestion, page: IPage, id: string): any; /* * Uploads a file to server. */ uploadFiles(question: IQuestion, name: string, files: any, uploadingCallback: any): void; /* * Downloads a file from server */ downloadFile(questionName: string, fileValue: any, callback: any): void; /* * Clears files from server. */ clearFiles(question: IQuestion, name: string, value: any, fileName: string, callback: any): void; updateChoicesFromServer(question: IQuestion, choices: any, serverResult: any): Array<ItemValue>; loadedChoicesFromServer(question: IQuestion): void; protected createSurveyService(): dxSurveyService; protected uploadFilesCore(name: string, files: any, uploadingCallback: any): void; getPage(index: number): PageModel; /* * Adds an existing page to the survey. */ addPage(page: PageModel, index?: number): void; /* * Creates a new page and adds it to a survey. Generates a new name if the `name` parameter is not specified. */ addNewPage(name?: string, index?: number): PageModel; /* * Removes a page from a survey. */ removePage(page: PageModel): void; /* * Returns a question by its name. */ getQuestionByName(name: string, caseInsensitive?: boolean): Question; /* * Returns a question by its value name */ getQuestionByValueName(valueName: string, caseInsensitive?: boolean): IQuestion; /* * Returns all questions by their valueName. name property is used if valueName property is empty. */ getQuestionsByValueName(valueName: string, caseInsensitive?: boolean): Array<Question>; getCalculatedValueByName(name: string): CalculatedValue; /* * Gets a list of questions by their names. */ getQuestionsByNames(names: any, caseInsensitive?: boolean): Array<IQuestion>; /* * Returns a page on which an element (question or panel) is placed. */ getPageByElement(element: IElement): PageModel; /* * Returns a page on which a question is located. */ getPageByQuestion(question: IQuestion): PageModel; /* * Returns a page by it's name. */ getPageByName(name: string): PageModel; /* * Returns a list of pages by their names. */ getPagesByNames(names: any): Array<PageModel>; /* * Returns a list of all questions in a survey. */ getAllQuestions(visibleOnly?: boolean, includingDesignTime?: boolean): Array<Question>; /* * Returns quiz questions. All visible questions that has input(s) widgets. */ getQuizQuestions(): Array<IQuestion>; /* * Returns a panel by its name. */ getPanelByName(name: string, caseInsensitive?: boolean): IPanel; /* * Returns a list of all survey's panels. */ getAllPanels(visibleOnly?: boolean, includingDesignTime?: boolean): Array<IPanel>; /* * Creates and returns a new page, but do not add it into the survey. * You can use addPage(page) function to add it into survey later. */ createNewPage(name: string): PageModel; protected questionOnValueChanging(valueName: string, newValue: any): any; protected updateQuestionValue(valueName: string, newValue: any): void; protected notifyQuestionOnValueChanged(valueName: string, newValue: any): void; isRunningElementsBindings: boolean; updateVisibleIndexAfterBindings: boolean; isTriggerIsRunning: boolean; triggerValues: any; triggerKeys: any; conditionValues: any; isValueChangedOnRunningCondition: boolean; conditionRunnerCounter: number; conditionUpdateVisibleIndexes: boolean; conditionNotifyElementsOnAnyValueOrVariableChanged: boolean; /* * Sends a survey result to the [api.surveyjs.io](https://api.surveyjs.io) service. */ sendResult(postId?: string, clientId?: string, isPartialCompleted?: boolean): void; /* * Calls the [api.surveyjs.io](https://api.surveyjs.io) service and, on callback, fires the `onGetResult` event with all answers that your users made for a question. */ getResult(resultId: string, name: string): void; /* * Loads the survey JSON from the [api.surveyjs.io](https://api.surveyjs.io) service. * If `clientId` is not `null` and a user had completed a survey before, the survey switches to `completedbefore` state. */ loadSurveyFromService(surveyId?: string, cliendId?: string): void; protected onLoadingSurveyFromService(): void; protected onLoadSurveyFromService(): void; fromJSON(json: any): void; setJsonObject(jsonObj: any): void; isEndLoadingFromJson: string; endLoadingFromJson(): void; updateNavigationItemCssCallback: any; protected createNavigationBar(): ActionContainer; protected createNavigationActions(): Array<IAction>; protected onBeforeCreating(): void; protected onCreating(): void; getBuiltInVariableValue(name: string): number; hasVisibleQuestionByValueName(valueName: string): boolean; questionCountByValueName(valueName: string): number; /* * Returns a variable value. Variable, unlike values, are not stored in the survey results. */ getVariable(name: string): any; /* * Sets a variable value. Variable, unlike values, are not stored in the survey results. */ setVariable(name: string, newValue: any): void; /* * Returns all variables in the survey. Use setVariable function to create a new variable. */ getVariableNames(): Array<any>; protected getUnbindValue(value: any): any; /* * Returns a question value (answer) by a question's name. */ getValue(name: string): any; /* * Sets a question value (answer). It runs all triggers and conditions (`visibleIf` properties). * * Goes to the next page if `goNextPageAutomatic` is `true` and all questions on the current page are answered correctly. */ setValue(name: string, newQuestionValue: any, locNotification?: any, allowNotifyValueChanged?: boolean): void; protected doOnPageAdded(page: PageModel): void; protected doOnPageRemoved(page: PageModel): void; protected tryGoNextPageAutomatic(name: string): void; /* * Returns the comment value. */ getComment(name: string): string; /* * Sets a comment value. */ setComment(name: string, newValue: string, locNotification?: any): void; /* * Removes a value from the survey results. */ clearValue(name: string): void; /* * Gets or sets whether to clear value on disable items in checkbox, dropdown and radiogroup questions. * By default, values are not cleared on disabled the corresponded items. This property is not persisted in survey JSON and you have to set it in code. */ get clearValueOnDisableItems(): boolean; set clearValueOnDisableItems(val: boolean); get isClearValueOnHidden(): boolean; get isClearValueOnHiddenContainer(): boolean; questionVisibilityChanged(question: IQuestion, newValue: boolean): void; pageVisibilityChanged(page: IPage, newValue: boolean): void; panelVisibilityChanged(panel: IPanel, newValue: boolean): void; questionCreated(question: IQuestion): any; questionAdded(question: IQuestion, index: number, parentPanel: any, rootPanel: any): void; questionRemoved(question: IQuestion): void; questionRenamed(question: IQuestion, oldName: string, oldValueName: string): any; questionHashes: any; panelAdded(panel: IElement, index: number, parentPanel: any, rootPanel: any): void; panelRemoved(panel: IElement): void; validateQuestion(question: IQuestion): SurveyError; validatePanel(panel: IPanel): SurveyError; processHtml(html: string): string; processText(text: string, returnDisplayValue: boolean): string; processTextEx(text: string, returnDisplayValue: boolean, doEncoding: boolean): any; getSurveyMarkdownHtml(element: Base, text: string, name: string): string; /* * Deprecated. Use the getCorrectAnswerCount method instead. */ getCorrectedAnswerCount(): number; /* * Returns an amount of corrected quiz answers. */ getCorrectAnswerCount(): number; /* * Returns quiz question number. It may be different from `getQuizQuestions.length` because some widgets like matrix may have several questions. */ getQuizQuestionCount(): number; /* * Deprecated. Use the getInCorrectAnswerCount method instead. */ getInCorrectedAnswerCount(): number; /* * Returns an amount of incorrect quiz answers. */ getInCorrectAnswerCount(): number; getCorrectedAnswers(): number; getInCorrectedAnswers(): number; /* * Gets or sets a timer panel position. The timer panel displays information about how much time an end user spends on a survey/page. * * The available options: * - `top` - display timer panel in the top. * - `bottom` - display timer panel in the bottom. * - `none` - do not display a timer panel. * * If the value is not equal to 'none', the survey calls the `startTimer()` method on survey rendering. */ get showTimerPanel(): string; set showTimerPanel(val: string); get isTimerPanelShowingOnTop(): boolean; get isTimerPanelShowingOnBottom(): boolean; /* * Gets or set a value that specifies whether the timer displays information for the page or for the entire survey. * * The available options: * * - `page` - show timer information for page * - `survey` - show timer information for survey * * Use the `onTimerPanelInfoText` event to change the default text. */ get showTimerPanelMode(): string; set showTimerPanelMode(val: string); /* * Gets or sets a value that specifies how the survey width is calculated. * * The available options: * * - `static` - A survey has a fixed width that mostly depends upon the applied theme. Resizing a browser window does not affect the survey width. * - `responsive` - A survey takes all available horizontal space. A survey stretches or shrinks horizonally according to the screen size. * - `auto` - Depends on the question type and corresponds to the static or responsive mode. */ get widthMode(): string; set widthMode(val: string); calculateWidthMode(): string; get timerInfoText(): string; get timerModel(): SurveyTimerModel; /* * Starts a timer that will calculate how much time end-user spends on the survey or on pages. */ startTimer(): void; startTimerFromUI(): void; /* * Stops the timer. */ stopTimer(): void; /* * Returns the time in seconds an end user spends on the survey */ get timeSpent(): number; /* * Gets or sets the maximum time in seconds that end user has to complete a survey. If the value is 0 or less, an end user has no time limit to finish a survey. */ get maxTimeToFinish(): number; set maxTimeToFinish(val: number); /* * Gets or sets the maximum time in seconds that end user has to complete a page in the survey. If the value is 0 or less, an end user has no time limit. * * You may override this value for every page. */ get maxTimeToFinishPage(): number; set maxTimeToFinishPage(val: number); get inSurvey(): boolean; getSurveyData(): ISurveyData; getSurvey(): ISurvey; getTextProcessor(): ITextProcessor; getObjects(pages: any, questions: any): Array<any>; setTriggerValue(name: string, value: any, isVariable: boolean): void; copyTriggerValue(name: string, fromName: string): void; isFocusingQuestion: boolean; isMovingQuestion: boolean; startMovingQuestion(): void; stopMovingQuestion(): void; needRenderIcons: boolean; /* * Focus question by its name. If needed change the current page on the page where question is located. * Function returns false if there is no question with this name or question is invisible, otherwise it returns true. */ focusQuestion(name: string): boolean; getElementWrapperComponentName(element: any, reason?: string): string; getQuestionContentWrapperComponentName(element: any): string; getRowWrapperComponentName(row: QuestionRowModel): string; getElementWrapperComponentData(element: any, reason?: string): any; getRowWrapperComponentData(row: QuestionRowModel): any; getItemValueWrapperComponentName(item: ItemValue, question: QuestionSelectBase): string; getItemValueWrapperComponentData(item: ItemValue, question: QuestionSelectBase): any; getMatrixCellTemplateData(cell: any): any; searchText(text: string): Array<IFindElement>; skeletonComponentName: string; getSkeletonComponentName(element: ISurveyElement): string; /* * Use this method to dispose survey model properly. */ dispose(): void; disposeCallback: any; } /* * It extends the Trigger base class and add properties required for SurveyJS classes. */ export declare class SurveyTrigger extends Trigger { constructor(); protected ownerValue: ISurveyTriggerOwner; get owner(): ISurveyTriggerOwner; setOwner(owner: ISurveyTriggerOwner): void; getSurvey(live?: boolean): ISurvey; get isOnNextPage(): boolean; } export declare class SurveyWindow extends SurveyWindowModel { constructor(jsonObj: any, initialModel?: any); } /* * Validate text values. */ export declare class TextValidator extends SurveyValidator { constructor(); getType(): string; validate(value: any, name?: string, values?: any, properties?: any): ValidatorResult; protected getDefaultErrorText(name: string): any; /* * The minLength property. */ get minLength(): number; set minLength(val: number); /* * The maxLength property. */ get maxLength(): number; set maxLength(val: number); /* * The allowDigits property. */ get allowDigits(): boolean; set allowDigits(val: boolean); } /* * A class that contains expression and url propeties. It uses in survey.navigateToUrlOnCondition array. * If the expression returns true then url of this item uses instead of survey.navigateToUrl property */ export declare class UrlConditionItem extends ExpressionItem { constructor(expression?: string, url?: string); getType(): string; /* * The url that survey navigates to on completing the survey. The expression should return true */ get url(): string; set url(val: string); get locUrl(): LocalizableString; } export declare class Variable extends Const { constructor(variableName: string); static DisableConversionChar: string; valueInfo: any; useValueAsItIs: boolean; getType(): string; toString(func?: any): string; get variable(): string; evaluate(processValue?: ProcessValue): any; setVariables(variables: any): void; protected getCorrectValue(value: any): any; protected isContentEqual(op: Operand): boolean; } export declare class DragDropRankingChoices extends DragDropChoices { constructor(surveyValue?: ISurvey, creator?: any); protected get draggedElementType(): string; protected createDraggedElementShortcut(text: string, draggedElementNode: any, event: any): any; protected getDropTargetByDataAttributeValue(dataAttributeValue: string): ItemValue; isDragOverRootNode: boolean; protected findDropTargetNodeByDragOverNode(dragOverNode: any): any; protected isDropTargetValid(dropTarget: ItemValue, dropTargetNode?: any): boolean; protected calculateIsBottom(clientY: number): boolean; protected doDragOver: any; protected afterDragOver(dropTargetNode: any): void; protected ghostPositionChanged(): void; protected doBanDropHere: any; protected doDrop: any; protected doClear: any; } /* * A base class for a Panel and Page objects. */ export declare class PanelModelBase extends SurveyElement implements IPanel, IConditionRunner, ISurveyErrorOwner, ITitleOwner { constructor(name?: string); static panelCounter: number; elementsValue: any; isQuestionsReady: boolean; questionsValue: any; addElementCallback: any; removeElementCallback: any; onGetQuestionTitleLocation: any; /* * Returns the question type. * Possible values: * - [*"boolean"*](https://surveyjs.io/Documentation/Library?id=questionbooleanmodel) * - [*"checkbox"*](https://surveyjs.io/Documentation/Library?id=questioncheckboxmodel) * - [*"comment"*](https://surveyjs.io/Documentation/Library?id=questioncommentmodel) * - [*"dropdown"*](https://surveyjs.io/Documentation/Library?id=questiondropdownmodel) * - [*"expression"*](https://surveyjs.io/Documentation/Library?id=questionexpressionmodel) * - [*"file"*](https://surveyjs.io/Documentation/Library?id=questionfilemodel) * - [*"html"*](https://surveyjs.io/Documentation/Library?id=questionhtmlmodel) * - [*"image"*](https://surveyjs.io/Documentation/Library?id=questionimagemodel) * - [*"imagepicker"*](https://surveyjs.io/Documentation/Library?id=questionimagepickermodel) * - [*"matrix"*](https://surveyjs.io/Documentation/Library?id=questionmatrixmodel) * - [*"matrixdropdown"*](https://surveyjs.io/Documentation/Library?id=questionmatrixdropdownmodel) * - [*"matrixdynamic"*](https://surveyjs.io/Documentation/Library?id=questionmatrixdynamicmodel) * - [*"multipletext"*](https://surveyjs.io/Documentation/Library?id=questionmultipletextmodel) * - [*"panel"*](https://surveyjs.io/Documentation/Library?id=panelmodel) * - [*"paneldynamic"*](https://surveyjs.io/Documentation/Library?id=questionpaneldynamicmodel) * - [*"radiogroup"*](https://surveyjs.io/Documentation/Library?id=questionradiogroupmodel) * - [*"rating"*](https://surveyjs.io/Documentation/Library?id=questionratingmodel) * - [*"ranking"*](https://surveyjs.io/Documentation/Library?id=questionrankingmodel) * - [*"signaturepad"*](https://surveyjs.io/Documentation/Library?id=questionsignaturepadmodel) * - [*"text"*](https://surveyjs.io/Documentation/Library?id=questiontextmodel) */ getType(): string; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; endLoadingFromJson(): void; showTitle: boolean; get hasTitle(): boolean; protected canShowTitle(): boolean; showDescription: boolean; get _showDescription(): boolean; localeChanged(): void; locStrsChanged(): void; /* * Returns the char/string for a required panel. */ get requiredText(): string; protected get titlePattern(): string; get isRequireTextOnStart(): boolean; get isRequireTextBeforeTitle(): boolean; get isRequireTextAfterTitle(): boolean; /* * The custom text that will be shown on required error. Use this property, if you do not want to show the default text. */ get requiredErrorText(): string; set requiredErrorText(val: string); get locRequiredErrorText(): LocalizableString; /* * Use this property to randomize questions. Set it to 'random' to randomize questions, 'initial' to keep them in the same order or 'default' to use the Survey questionsOrder property */ get questionsOrder(): string; set questionsOrder(val: string); protected isRandomizing: boolean; randomizeElements(isRandom: boolean): void; /* * A parent element. It is always null for the Page object and always not null for the Panel object. Panel object may contain Questions and other Panels. */ get parent(): PanelModelBase; set parent(val: PanelModelBase); get depth(): number; /* * An expression that returns true or false. If it returns true the Panel becomes visible and if it returns false the Panel becomes invisible. The library runs the expression on survey start and on changing a question value. If the property is empty then visible property is used. */ get visibleIf(): string; set visibleIf(val: string); protected calcCssClasses(css: any): any; /* * A unique element identificator. It is generated automatically. */ get id(): string; set id(val: string); /* * Returns true if the current object is Panel. Returns false if the current object is Page (a root Panel). */ get isPanel(): boolean; getPanel(): IPanel; getLayoutType(): string; isLayoutTypeSupported(layoutType: string): boolean; /* * Returns the list of all questions located in the Panel/Page, including in the nested Panels. */ get questions(): any; protected getValidName(name: string): string; /* * Returns the question by its name */ getQuestionByName(name: string): Question; /* * Returns the element by its name. It works recursively. */ getElementByName(name: string): IElement; getQuestionByValueName(valueName: string): Question; /* * Returns question values on the current page */ getValue(): any; /* * Return questions values as a JSON object with display text. For example, for dropdown, it would return the item text instead of item value. */ getDisplayValue(keysAsText: boolean): any; /* * Returns question comments on the current page */ getComments(): any; /* * Call this function to remove all question values from the current page/panel, that end-user will not be able to enter. * For example the value that doesn't exists in a radigroup/dropdown/checkbox choices or matrix rows/columns. * Please note, this function doesn't clear values for invisible questions or values that doesn't associated with questions. */ clearIncorrectValues(): void; /* * Call this function to clear all errors in the panel / page and all its child elements (panels and questions) */ clearErrors(): void; /* * Returns the list of the elements in the object, Panel/Page. Elements can be questions or panels. The function doesn't return elements in the nested Panels. */ get elements(): any; getElementsInDesign(includeHidden?: boolean): Array<IElement>; /* * Returns true if the current element belongs to the Panel/Page. It looks in nested Panels as well. */ containsElement(element: IElement): boolean; /* * Set this property to true, to require the answer at least in one question in the panel. */ get isRequired(): boolean; set isRequired(val: boolean); /* * An expression that returns true or false. If it returns true the Panel/Page becomes required. * The library runs the expression on survey start and on changing a question value. If the property is empty then isRequired property is used. */ get requiredIf(): string; set requiredIf(val: string); searchText(text: string, founded: any): void; /* * Returns true, if there is an error on this Page or inside the current Panel */ hasErrors(fireCallback?: boolean, focusOnFirstError?: boolean, rec?: any): boolean; getErrorCustomText(text: string, error: SurveyError): string; protected hasErrorsCore(rec: any): void; protected getContainsErrors(): boolean; updateElementVisibility(): void; getFirstQuestionToFocus(withError?: boolean): Question; /* * Call it to focus the input on the first question */ focusFirstQuestion(): void; /* * Call it to focus the input of the first question that has an error. */ focusFirstErrorQuestion(): void; /* * Fill list array with the questions. */ addQuestionsToList(list: any, visibleOnly?: boolean, includingDesignTime?: boolean): void; /* * Fill list array with the panels. */ addPanelsIntoList(list: any, visibleOnly?: boolean, includingDesignTime?: boolean): void; /* * Returns true if the current object is Page and it is the current page. */ get isActive(): boolean; updateCustomWidgets(): void; /* * Set this property different from "default" to set the specific question title location for this panel/page. */ get questionTitleLocation(): string; set questionTitleLocation(val: string); getQuestionTitleLocation(): string; protected getStartIndex(): string; getQuestionStartIndex(): string; getChildrenLayoutType(): string; getProgressInfo(): IProgressInfo; protected get root(): PanelModelBase; protected childVisibilityChanged(): void; protected createRowAndSetLazy(index: number): QuestionRowModel; protected createRow(): QuestionRowModel; onSurveyLoad(): void; onFirstRendering(): void; updateRows(): void; get rows(): any; ensureRowsVisibility(): void; protected onRowsChanged(): void; protected onAddElement(element: IElement, index: number): void; protected onRemoveElement(element: IElement): void; protected canRenderFirstRows(): boolean; protected updateRowsRemoveElementFromRow(element: IElement, row: QuestionRowModel): void; elementWidthChanged(el: IElement): void; /* * Returns rendered title text or html. */ get processedTitle(): string; protected getRenderedTitle(str: string): string; /* * Use it to get/set the object visibility. */ get visible(): boolean; set visible(val: boolean); protected onVisibleChanged(): void; /* * Returns true if object is visible or survey is in design mode right now. */ get isVisible(): boolean; getIsPageVisible(exceptionQuestion: IQuestion): boolean; lastVisibleIndex: number; setVisibleIndex(index: number): number; protected beforeSetVisibleIndex(index: number): number; protected getPanelStartIndex(index: number): number; protected isContinueNumbering(): boolean; /* * Returns true if readOnly property is true or survey is in display mode or parent panel/page is readOnly. */ get isReadOnly(): boolean; protected onReadOnlyChanged(): void; updateElementCss(reNew?: boolean): void; /* * An expression that returns true or false. If it returns false the Panel/Page becomes read only and an end-user will not able to answer on qustions inside it. * The library runs the expression on survey start and on changing a question value. If the property is empty then readOnly property is used. */ get enableIf(): string; set enableIf(val: string); /* * Add an element into Panel or Page. Returns true if the element added successfully. Otherwise returns false. */ addElement(element: IElement, index?: number): boolean; insertElementAfter(element: IElement, after: IElement): void; insertElementBefore(element: IElement, before: IElement): void; protected canAddElement(element: IElement): boolean; /* * Add a question into Panel or Page. Returns true if the question added successfully. Otherwise returns false. */ addQuestion(question: Question, index?: number): boolean; /* * Add a panel into Panel or Page. Returns true if the panel added successfully. Otherwise returns false. */ addPanel(panel: PanelModel, index?: number): boolean; /* * Creates a new question and adds it at location of index, by default the end of the elements list. Returns null, if the question could not be created or could not be added into page or panel. */ addNewQuestion(questionType: string, name?: string, index?: number): Question; /* * Creates a new panel and adds it into the end of the elements list. Returns null, if the panel could not be created or could not be added into page or panel. */ addNewPanel(name?: string): PanelModel; /* * Returns the index of element parameter in the elements list. */ indexOf(element: IElement): number; protected createNewPanel(name: string): PanelModel; /* * Remove an element (Panel or Question) from the elements list. */ removeElement(element: IElement): boolean; /* * Remove question from the elements list. */ removeQuestion(question: Question): void; runCondition(values: any, properties: any): void; onAnyValueChanged(name: string): void; checkBindings(valueName: string, value: any): void; protected dragDropAddTarget(dragDropInfo: DragDropInfo): void; dragDropFindRow(findElement: ISurveyElement): QuestionRowModel; dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void; needResponsiveWidth(): boolean; get hasDescriptionUnderTitle(): boolean; get cssHeader(): string; get cssDescription(): string; get no(): string; dispose(): void; } /* * A base class for all questions. */ export declare class Question extends SurveyElement implements IQuestion, IConditionRunner, IValidatorOwner, ITitleOwner { constructor(name: string); static TextPreprocessorValuesMap: any; static questionCounter: number; isCustomWidgetRequested: boolean; customWidgetValue: QuestionCustomWidget; customWidgetData: any; focusCallback: any; surveyLoadCallback: any; displayValueCallback: any; defaultValueRunner: ExpressionRunner; isChangingViaDefaultValue: boolean; isValueChangedDirectly: boolean; valueChangedCallback: any; commentChangedCallback: any; localeChangedCallback: any; validateValueCallback: any; questionTitleTemplateCallback: any; afterRenderQuestionCallback: any; valueFromDataCallback: any; valueToDataCallback: any; onGetSurvey: any; locProcessedTitle: LocalizableString; protected isReadyValue: boolean; commentElement: any; /* * The event is fired when isReady property of question is changed. * <br/> options.question - the question * <br/> options.isReady - current value of isReady * <br/> options.oldIsReady - old value of isReady */ onReadyChanged: EventBase<Question>; isReadOnlyRenderDiv(): boolean; isMobile: boolean; protected createLocTitleProperty(): LocalizableString; getSurvey(live?: boolean): ISurvey; getValueName(): string; /* * Use this property if you want to store the question result in the name different from the question name. * Question name should be unique in the survey and valueName could be not unique. It allows to share data between several questions with the same valueName. * The library set the value automatically if the question.name property is not valid. For example, if it contains the period '.' symbol. * In this case if you set the question.name property to 'x.y' then the valueName becomes 'x y'. * Please note, this property is hidden for questions without input, for example html question. */ get valueName(): string; set valueName(val: string); protected onValueNameChanged(oldValue: string): void; protected onNameChanged(oldValue: string): void; get isReady(): boolean; /* * A11Y properties */ get ariaRequired(): "true" | "false"; get ariaLabel(): string; get ariaInvalid(): "true" | "false"; get ariaDescribedBy(): string; /* * Get is question ready to use */ choicesLoaded(): void; /* * Get/set the page where the question is located. */ get page(): IPage; set page(val: IPage); getPanel(): IPanel; delete(): void; get isFlowLayout(): boolean; getLayoutType(): string; isLayoutTypeSupported(layoutType: string): boolean; /* * Use it to get/set the question visibility. */ get visible(): boolean; set visible(val: boolean); protected onVisibleChanged(): void; /* * Use it to choose how other question values will be rendered in title if referenced in {}. * Please note, this property is hidden for question without input, for example html question. */ get useDisplayValuesInTitle(): boolean; set useDisplayValuesInTitle(val: boolean); protected getUseDisplayValuesInTitle(): boolean; /* * An expression that returns true or false. If it returns true the Question becomes visible and if it returns false the Question becomes invisible. The library runs the expression on survey start and on changing a question value. If the property is empty then visible property is used. */ get visibleIf(): string; set visibleIf(val: string); /* * Returns true if the question is visible or survey is in design mode right now. */ get isVisible(): boolean; /* * Returns the visible index of the question in the survey. It can be from 0 to all visible questions count - 1 * The visibleIndex is -1 if the title is 'hidden' or hideNumber is true */ get visibleIndex(): number; /* * Set hideNumber to true to stop showing the number for this question. The question will not be counter */ get hideNumber(): boolean; set hideNumber(val: boolean); /* * Returns true if the question may have a title located on the left */ get isAllowTitleLeft(): boolean; /* * Returns the type of the object as a string as it represents in the json. */ getType(): string; get isQuestion(): boolean; /* * Move question to a new container Page/Panel. Add as a last element if insertBefore parameter is not used or inserted into the given index, * if insert parameter is number, or before the given element, if the insertBefore parameter is a question or panel */ moveTo(container: IPanel, insertBefore?: any): boolean; getProgressInfo(): IProgressInfo; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; /* * A parent element. It can be panel or page. */ get parent(): IPanel; set parent(val: IPanel); parentQuestionValue: Question; /* * A parent question. It can be a dynamic panel or dynamic/dropdown matrices. If the value is a matrix, it means that question is a cell question. * This property is null for a stand alone question. */ get parentQuestion(): Question; setParentQuestion(val: Question): void; protected onParentQuestionChanged(): void; protected onParentChanged(): void; /* * Returns false if the question doesn't have a title property, for example: QuestionHtmlModel, or titleLocation property equals to "hidden" */ get hasTitle(): boolean; /* * Set this property different from "default" to set the specific question title location for this panel/page. * Please note, this property is hidden for questions without input, for example html question. */ get titleLocation(): string; set titleLocation(val: string); getTitleOwner(): ITitleOwner; /* * Return the title location based on question titleLocation property and QuestionTitleLocation of it's parents */ getTitleLocation(): string; protected getTitleLocationCore(): string; get hasTitleOnLeft(): boolean; get hasTitleOnTop(): boolean; get hasTitleOnBottom(): boolean; get hasTitleOnLeftTop(): boolean; get errorLocation(): string; /* * Returns false if the question doesn't have an input element, for example: QuestionHtmlModel */ get hasInput(): boolean; /* * Returns false if the question doesn't have an input element or have multiple inputs: matrices or panel dynamic */ get hasSingleInput(): boolean; get inputId(): string; protected getDefaultTitleValue(): string; protected getDefaultTitleTagName(): string; /* * Question description location. By default, value is "default" and it depends on survey questionDescriptionLocation property * You may change it to "underInput" to render it under question input or "underTitle" to rendered it under title. */ get descriptionLocation(): string; set descriptionLocation(val: string); get hasDescriptionUnderTitle(): boolean; get hasDescriptionUnderInput(): boolean; protected needClickTitleFunction(): boolean; protected processTitleClick(): boolean; /* * The custom text that will be shown on required error. Use this property, if you do not want to show the default text. * Please note, this property is hidden for question without input, for example html question. */ get requiredErrorText(): string; set requiredErrorText(val: string); get locRequiredErrorText(): LocalizableString; /* * Use it to get or set the comment value. */ get commentText(): string; set commentText(val: string); get locCommentText(): LocalizableString; /* * Use this property to set the place holder text for comment field . */ get commentPlaceHolder(): string; set commentPlaceHolder(val: string); get locCommentPlaceHolder(): LocalizableString; get commentOrOtherPlaceHolder(): string; /* * Returns a copy of question errors survey. For some questions like matrix and panel dynamic it includes the errors of nested questions. */ getAllErrors(): Array<SurveyError>; getErrorByType(errorType: string): SurveyError; /* * The link to the custom widget. */ get customWidget(): QuestionCustomWidget; updateCustomWidget(): void; localeChanged(): void; get isCompositeQuestion(): boolean; updateCommentElement(): void; onCommentInput(event: any): void; onCommentChange(event: any): void; afterRenderQuestionElement(el: any): void; afterRender(el: any): void; beforeDestroyQuestionElement(el: any): void; /* * Returns the rendred question title. */ get processedTitle(): string; /* * Returns the title after processing the question template. */ get fullTitle(): string; protected get titlePattern(): string; get isRequireTextOnStart(): boolean; get isRequireTextBeforeTitle(): boolean; get isRequireTextAfterTitle(): boolean; /* * The Question renders on the new line if the property is true. If the property is false, the question tries to render on the same line/row with a previous question/panel. */ get startWithNewLine(): boolean; set startWithNewLine(val: boolean); protected calcCssClasses(css: any): any; get cssRoot(): string; protected setCssRoot(val: string): void; protected getCssRoot(cssClasses: any): string; get cssHeader(): string; protected setCssHeader(val: string): void; protected getCssHeader(cssClasses: any): string; get cssContent(): string; protected setCssContent(val: string): void; protected getCssContent(cssClasses: any): string; get cssTitle(): string; protected setCssTitle(val: string): void; protected getCssTitle(cssClasses: any): string; get cssDescription(): string; protected setCssDescription(val: string): void; protected getCssDescription(cssClasses: any): string; get cssError(): string; protected setCssError(val: string): void; protected getCssError(cssClasses: any): string; getRootCss(): string; updateElementCss(reNew?: boolean): void; protected updateQuestionCss(reNew?: boolean): void; protected updateElementCssCore(cssClasses: any): void; protected updateCssClasses(res: any, css: any): void; protected getCssType(): string; get renderCssRoot(): string; /* * Move the focus to the input of this question. */ focus(onError?: boolean): void; focusIn: any; protected fireCallback(callback: any): void; getOthersMaxLength(): any; protected onCreating(): void; protected getFirstInputElementId(): string; protected getFirstErrorInputElementId(): string; protected getProcessedTextValue(textValue: TextPreProcessorValue): void; supportComment(): boolean; supportOther(): boolean; /* * Set this property to true, to make the question a required. If a user doesn't answer the question then a validation error will be generated. * Please note, this property is hidden for question without input, for example html question. */ get isRequired(): boolean; set isRequired(val: boolean); /* * An expression that returns true or false. If it returns true the Question becomes required and an end-user has to answer it. * If it returns false the Question then an end-user may not answer it the Question maybe empty. * The library runs the expression on survey start and on changing a question value. If the property is empty then isRequired property is used. * Please note, this property is hidden for question without input, for example html question. */ get requiredIf(): string; set requiredIf(val: string); /* * Set it to true, to add a comment for the question. */ get hasComment(): boolean; set hasComment(val: boolean); /* * The unique identificator. It is generated automatically. */ get id(): string; set id(val: string); get ariaTitleId(): string; get ariaRole(): string; get hasOther(): boolean; set hasOther(val: boolean); protected hasOtherChanged(): void; get requireUpdateCommentValue(): boolean; /* * Returns true if readOnly property is true or survey is in display mode or parent panel/page is readOnly. */ get isReadOnly(): boolean; get isInputReadOnly(): boolean; get renderedInputReadOnly(): string; get renderedInputDisabled(): string; protected onReadOnlyChanged(): void; /* * An expression that returns true or false. If it returns false the Question becomes read only and an end-user will not able to answer on the qustion. The library runs the expression on survey start and on changing a question value. If the property is empty then readOnly property is used. * Please note, this property is hidden for question without input, for example html question. */ get enableIf(): string; set enableIf(val: string); surveyChoiceItemVisibilityChange(): void; /* * Run visibleIf and enableIf expressions. If visibleIf or/and enabledIf are not empty, then the results of performing the expression (true or false) set to the visible/readOnly properties. */ runCondition(values: any, properties: any): void; /* * The property returns the question number. If question is invisible then it returns empty string. * If visibleIndex is 1, then no is 2, or 'B' if survey.questionStartIndex is 'A'. */ get no(): string; protected getStartIndex(): string; onSurveyLoad(): void; protected onSetData(): void; protected initDataFromSurvey(): void; protected initCommentFromSurvey(): void; protected runExpression(expression: string): any; /* * Get/Set the question value. */ get value(): any; set value(val: any); get valueForSurvey(): any; /* * Clear the question value. It clears the question comment as well. */ clearValue(): void; unbindValue(): void; createValueCopy(): any; protected getUnbindValue(value: any): any; protected isValueSurveyElement(val: any): boolean; /* * Return true if there is a parent (page or panel) and it is visible */ get isParentVisible(): boolean; clearValueIfInvisible(reason?: string): void; protected clearValueIfInvisibleCore(): void; /* * Gets or sets a value that specifies how invisible question clears the value. By default the behavior is define by Survey "clearInvisibleValues" property. * * The following options are available: * * - `default` (default) - Survey "clearInvisibleValues" property defines the behavior. * - `none` - do not clear invisible value. * - `onHidden` - clear the question value when it becomes invisible. If a question has value and it was invisible initially then survey clears the value on completing. * - `onComplete` - clear invisible question value on survey complete. */ get clearIfInvisible(): string; set clearIfInvisible(val: string); get displayValue(): any; /* * Return the question value as a display text. For example, for dropdown, it would return the item text instead of item value. */ getDisplayValue(keysAsText: boolean, value?: any): any; protected getDisplayValueCore(keyAsText: boolean, value: any): any; protected getDisplayValueEmpty(): string; /* * A default value for the question. Ignored for question types that cannot have a [value](https://surveyjs.io/Documentation/Library?id=Question#value) (for example, HTML). * * The default value is used as a question value in the following cases: * * - While the survey is being loaded from JSON. * - The question is just added to the survey and does not yet have an answer. * - The respondent left the answer empty. */ get defaultValue(): any; set defaultValue(val: any); /* * An expression used to calculate the [defaultValue](https://surveyjs.io/Documentation/Library?id=Question#defaultValue). * * This expression applies until the question [value](https://surveyjs.io/Documentation/Library?id=Question#value) is specified by an end user or programmatically. * * An expression can reference other questions as follows: * * - `{other_question_name}` * - `{panel.other_question_name}` (to access questions inside the same dynamic panel) * - `{row.other_question_name}` (to access questions inside the same dynamic matrix or multi-column dropdown) * * An expression can also include built-in and custom functions for advanced calculations. For example, if the `defaultValue` should be today's date, set the `defaultValueExpression` to `"today()"`, and the corresponding built-in function will be executed each time the survey is loaded. Refer to the following help topic for more information: [Use Functions in Expressions](https://surveyjs.io/Documentation/Library#conditions-functions). */ get defaultValueExpression(): any; set defaultValueExpression(val: any); get resizeStyle(): "none" | "both"; /* * Returns question answer data as a plain object: with question title, name, value and displayValue. * For complex questions (like matrix, etc.) isNode flag is set to true and data contains array of nested objects (rows) * set options.includeEmpty to false if you want to skip empty answers */ getPlainData(options?: any): any; /* * The correct answer on the question. Set this value if you are doing a quiz. * Please note, this property is hidden for question without input, for example html question. */ get correctAnswer(): any; set correctAnswer(val: any); protected convertDefaultValue(val: any): any; /* * Returns questions count: 1 for the non-matrix questions and all inner visible questions that has input(s) widgets for question of matrix types. */ get quizQuestionCount(): number; get correctAnswerCount(): number; protected getQuizQuestionCount(): number; protected getCorrectAnswerCount(): number; isAnswerCorrect(): boolean; updateValueWithDefaults(): void; protected get isClearValueOnHidden(): boolean; getQuestionFromArray(name: string, index: number): IQuestion; getDefaultValue(): any; protected isDefaultValueEmpty(): boolean; protected getDefaultRunner(runner: ExpressionRunner, expression: string): ExpressionRunner; protected setDefaultValue(): void; protected isValueExpression(val: any): boolean; protected setValueAndRunExpression(runner: ExpressionRunner, defaultValue: any, setFunc: any, values?: any, properties?: any): void; /* * The question comment value. */ get comment(): string; set comment(val: string); protected getQuestionComment(): string; protected setQuestionComment(newValue: string): void; /* * Returns true if the question value is empty */ isEmpty(): boolean; get isAnswered(): boolean; set isAnswered(val: boolean); protected updateIsAnswered(): void; protected getIsAnswered(): boolean; /* * The list of question validators. * Please note, this property is hidden for question without input, for example html question. */ get validators(): any; set validators(val: any); getValidators(): Array<SurveyValidator>; getSupportedValidators(): Array<any>; addConditionObjectsByContext(objects: any, context: any): void; getConditionJson(operator?: string, path?: string): any; /* * Returns true if there is a validation error(s) in the question. */ hasErrors(fireCallback?: boolean, rec?: any): boolean; /* * Returns the validation errors count. */ get currentErrorCount(): number; /* * Returns the char/string for a required question. */ get requiredText(): string; /* * Add error into the question error list. */ addError(error: string | SurveyError): void; /* * Remove a particular error from the question error list. */ removeError(error: SurveyError): void; protected canCollectErrors(): boolean; protected canRunValidators(isOnValueChanged: boolean): boolean; protected onCheckForErrors(errors: any, isOnValueChanged: boolean): void; protected hasRequiredError(): boolean; validatorRunner: ValidatorRunner; isRunningValidatorsValue: boolean; onCompletedAsyncValidators: any; get isRunningValidators(): boolean; protected getIsRunningValidators(): boolean; protected runValidators(): Array<SurveyError>; protected raiseOnCompletedAsyncValidators(): void; isValueChangedInSurvey: boolean; protected allowNotifyValueChanged: boolean; protected setNewValue(newValue: any): void; protected isTextValue(): boolean; get isSurveyInputTextUpdate(): boolean; get isInputTextUpdate(): boolean; protected setNewValueInData(newValue: any): void; protected getValueCore(): any; protected setValueCore(newValue: any): void; protected canSetValueToSurvey(): boolean; protected valueFromData(val: any): any; protected valueToData(val: any): any; protected onValueChanged(): void; protected setNewComment(newValue: string): void; protected getValidName(name: string): string; updateValueFromSurvey(newValue: any): void; updateCommentFromSurvey(newValue: any): any; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; onSurveyValueChanged(newValue: any): void; setVisibleIndex(val: number): number; removeElement(element: IElement): boolean; supportGoNextPageAutomatic(): boolean; supportGoNextPageError(): boolean; /* * Call this function to remove values from the current question, that end-user will not be able to enter. * For example the value that doesn't exists in a radigroup/dropdown/checkbox choices or matrix rows/columns. */ clearIncorrectValues(): void; clearOnDeletingContainer(): void; /* * Call this function to clear all errors in the question */ clearErrors(): void; clearUnusedValues(): void; onAnyValueChanged(name: string): void; checkBindings(valueName: string, value: any): void; getComponentName(): string; isDefaultRendering(): boolean; renderAs: string; getErrorCustomText(text: string, error: SurveyError): string; getValidatorTitle(): string; get validatedValue(): any; set validatedValue(val: any); getAllValues(): any; transformToMobileView(): void; transformToDesktopView(): void; needResponsiveWidth(): boolean; protected supportResponsiveness(): boolean; protected needResponsiveness(): boolean; protected checkForResponsiveness(el: any): void; resizeObserver: any; protected getObservedElementSelector(): string; onMobileChangedCallback: any; protected getCompactRenderAs(): string; protected getDesktopRenderAs(): string; protected processResponsiveness(requiredWidth: number, availableWidth: number): any; dispose(): void; } export declare class QuestionCheckboxBaseImplementor extends QuestionSelectBaseImplementor { constructor(question: any); } export declare class QuestionDropdownImplementor extends QuestionSelectBaseImplementor { constructor(question: any); } export declare class QuestionMatrixDynamicImplementor extends QuestionMatrixBaseImplementor { constructor(question: any); protected addRow(): void; protected removeRow(row: any): void; getKoPopupIsVisible(row: any): any; dispose(): void; } export declare class Survey extends SurveyModel { constructor(jsonObj?: any, renderedElement?: any); } /* * If expression returns true, it completes the survey. */ export declare class SurveyTriggerComplete extends SurveyTrigger { constructor(); getType(): string; get isOnNextPage(): boolean; protected onSuccess(values: any, properties: any): void; } /* * If expression returns true, the value from question **fromName** will be set into **setToName**. */ export declare class SurveyTriggerCopyValue extends SurveyTrigger { constructor(); get setToName(): string; set setToName(val: string); get fromName(): string; set fromName(val: string); getType(): string; protected onSuccess(values: any, properties: any): void; } /* * If expression returns true, the **runExpression** will be run. If **setToName** property is not empty then the result of **runExpression** will be set to it. */ export declare class SurveyTriggerRunExpression extends SurveyTrigger { constructor(); getType(): string; get setToName(): string; set setToName(val: string); get runExpression(): string; set runExpression(val: string); protected onSuccess(values: any, properties: any): void; } /* * If expression returns true, the value from property **setValue** will be set to **setToName** */ export declare class SurveyTriggerSetValue extends SurveyTrigger { constructor(); getType(): string; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; get setToName(): string; set setToName(val: string); get setValue(): any; set setValue(val: any); get isVariable(): boolean; set isVariable(val: boolean); protected onSuccess(values: any, properties: any): void; } /* * If expression returns true, the survey go to question **gotoName** and focus it. */ export declare class SurveyTriggerSkip extends SurveyTrigger { constructor(); getType(): string; get gotoName(): string; set gotoName(val: string); get isOnNextPage(): boolean; protected onSuccess(values: any, properties: any): void; } /* * If expression returns true, it makes questions/pages visible. * Ohterwise it makes them invisible. */ export declare class SurveyTriggerVisible extends SurveyTrigger { constructor(); pages: any; questions: any; getType(): string; protected onSuccess(values: any, properties: any): void; protected onFailure(): void; protected onItemSuccess(item: any): void; protected onItemFailure(item: any): void; } /* * The page object. It has elements collection, that contains questions and panels. */ export declare class PageModel extends PanelModelBase implements IPage { constructor(name?: string); hasShownValue: boolean; getType(): string; toString(): string; get isPage(): boolean; protected canShowPageNumber(): boolean; protected canShowTitle(): boolean; /* * Use this property to show title in navigation buttons. If the value is empty then page name is used. */ get navigationTitle(): string; set navigationTitle(val: string); get locNavigationTitle(): LocalizableString; get navigationDescription(): string; set navigationDescription(val: string); get locNavigationDescription(): LocalizableString; navigationLocStrChanged(): void; get passed(): boolean; set passed(val: boolean); delete(): void; onFirstRendering(): void; /* * The visible index of the page. It has values from 0 to visible page count - 1. */ get visibleIndex(): number; set visibleIndex(val: number); protected canRenderFirstRows(): boolean; /* * Returns true, if the page is started page in the survey. It can be shown on the start only and the end-user could not comeback to it after it passed it. */ get isStarted(): boolean; protected calcCssClasses(css: any): any; get cssTitle(): string; num: number; /* * Set this property to "hide" to make "Prev", "Next" and "Complete" buttons are invisible for this page. Set this property to "show" to make these buttons visible, even if survey showNavigationButtons property is false. */ get navigationButtonsVisibility(): string; set navigationButtonsVisibility(val: string); /* * The property returns true, if the page has been shown to the end-user. */ get wasShown(): boolean; get hasShown(): boolean; setWasShown(val: boolean): void; /* * The property returns true, if the elements are randomized on the page */ get areQuestionsRandomized(): boolean; /* * Call it to scroll to the page top. */ scrollToTop(): void; /* * Time in seconds end-user spent on this page */ timeSpent: number; /* * Returns the list of all panels in the page */ getPanels(visibleOnly?: boolean, includingDesignTime?: boolean): Array<IPanel>; /* * The maximum time in seconds that end-user has to complete the page. If the value is 0 or less, the end-user has unlimited number of time to finish the page. */ get maxTimeToFinish(): number; set maxTimeToFinish(val: number); protected onNumChanged(value: number): void; protected onVisibleChanged(): void; dragDropInfo: DragDropInfo; dragDropStart(src: IElement, target: IElement, nestedPanelDepth?: number): void; dragDropMoveTo(destination: ISurveyElement, isBottom?: boolean, isEdge?: boolean): boolean; dragDropFinish(isCancel?: boolean): IElement; ensureRowsVisibility(): void; } /* * A container element, similar to the Page objects. However, unlike the Page, Panel can't be a root. * It may contain questions and other panels. */ export declare class PanelModel extends PanelModelBase implements IElement { constructor(name?: string); getType(): string; get contentId(): string; getSurvey(live?: boolean): ISurvey; onSurveyLoad(): void; protected onSetData(): void; get isPanel(): boolean; /* * Get/set the page where the panel is located. */ get page(): IPage; set page(val: IPage); delete(): void; /* * Move panel to a new container Page/Panel. Add as a last element if insertBefore parameter is not used or inserted into the given index, * if insert parameter is number, or before the given element, if the insertBefore parameter is a question or panel */ moveTo(container: IPanel, insertBefore?: any): boolean; /* * Returns the visible index of the panel in the survey. Commonly it is -1 and it doesn't show. * You have to set showNumber to true to show index/numbering for the Panel */ get visibleIndex(): number; getTitleOwner(): ITitleOwner; /* * Set showNumber to true to start showing the number for this panel. */ get showNumber(): boolean; set showNumber(val: boolean); /* * Gets or sets a value that specifies how the elements numbers inside panel are displayed. * * The following options are available: * * - `default` - display questions numbers as defined in parent panel or survey * - `onpanel` - display questions numbers, start numbering from beginning of this page * - `off` - turn off the numbering for questions titles */ get showQuestionNumbers(): string; set showQuestionNumbers(val: string); /* * Gets or sets the first question index for elements inside the panel. The first question index is '1.' by default and it is taken from survey.questionStartIndex property. * You may start it from '100' or from 'A', by setting '100' or 'A' to this property. * You can set the start index to "(1)" or "# A)" or "a)" to render question number as (1), # A) and a) accordingly. */ get questionStartIndex(): string; set questionStartIndex(val: string); getQuestionStartIndex(): string; /* * The property returns the question number. If question is invisible then it returns empty string. * If visibleIndex is 1, then no is 2, or 'B' if survey.questionStartIndex is 'A'. */ get no(): string; protected setNo(visibleIndex: number): void; protected beforeSetVisibleIndex(index: number): number; protected getPanelStartIndex(index: number): number; protected isContinueNumbering(): boolean; protected hasErrorsCore(rec: any): void; protected getRenderedTitle(str: string): string; /* * The inner indent. Set this property to increase the panel content margin. */ get innerIndent(): number; set innerIndent(val: number); /* * The Panel renders on the new line if the property is true. If the property is false, the panel tries to render on the same line/row with a previous question/panel. */ get startWithNewLine(): boolean; set startWithNewLine(val: boolean); /* * The Panel toolbar gets adaptive if the property is set to true. */ get allowAdaptiveActions(): boolean; set allowAdaptiveActions(val: boolean); get innerPaddingLeft(): string; set innerPaddingLeft(val: string); clearOnDeletingContainer(): void; get footerActions(): any; footerToolbarValue: any; getFooterToolbar(): ActionContainer; get hasEditButton(): boolean; cancelPreview(): void; get cssTitle(): string; get cssError(): string; protected getCssError(cssClasses: any): string; protected onVisibleChanged(): void; needResponsiveWidth(): boolean; focusIn: any; getContainerCss(): string; } /* * A Model for a boolean question. */ export declare class QuestionBooleanModel extends Question { constructor(name: string); getType(): string; isLayoutTypeSupported(layoutType: string): boolean; supportGoNextPageAutomatic(): boolean; /* * Returns true if the question check will be rendered in indeterminate mode. value is empty. */ get isIndeterminate(): boolean; get hasTitle(): boolean; /* * Get/set question value in 3 modes: indeterminate (value is empty), true (check is set) and false (check is unset). */ get checkedValue(): any; set checkedValue(val: any); /* * Set the default state of the check: "indeterminate" - default (value is empty/null), "true" - value equals valueTrue or true, "false" - value equals valueFalse or false. */ get defaultValue(): any; set defaultValue(val: any); getDefaultValue(): any; get locTitle(): LocalizableString; /* * The checkbox label. If it is empty and showTitle is false then title is rendered */ get label(): string; set label(val: string); get locLabel(): LocalizableString; get locDisplayLabel(): LocalizableString; /* * Set this property, if you want to have a different label for state when check is set. */ get labelTrue(): any; set labelTrue(val: any); get locLabelTrue(): LocalizableString; get isDeterminated(): boolean; /* * Set this property, if you want to have a different label for state when check is unset. */ get labelFalse(): any; set labelFalse(val: any); get locLabelFalse(): LocalizableString; /* * Set this property to true to show the question title. It is hidden by default. */ showTitle: boolean; /* * Set this property, if you want to have a different value from true when check is set. */ valueTrue: any; /* * Set this property, if you want to have a different value from false when check is unset. */ valueFalse: any; protected setDefaultValue(): void; protected getDisplayValueCore(keysAsText: boolean, value: any): any; getItemCss(): string; getLabelCss(checked: boolean): string; get svgIcon(): string; get allowClick(): boolean; getCheckedLabel(): LocalizableString; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; onLabelClick(event: any, value: boolean): boolean; onSwitchClickModel(event: any): boolean; onKeyDownCore(event: any): boolean; getRadioItemClass(css: any, value: any): string; protected supportResponsiveness(): boolean; protected getCompactRenderAs(): string; } export declare class QuestionCheckboxImplementor extends QuestionCheckboxBaseImplementor { constructor(question: any); protected getKoValue(): any; } export declare class QuestionCustomModelBase extends Question implements ISurveyImpl, ISurveyData, IPanel { constructor(name: string, customQuestion: ComponentQuestionJSON); customQuestion: ComponentQuestionJSON; getType(): string; locStrsChanged(): void; protected createWrapper(): void; protected onPropertyValueChanged(name: string, oldValue: any, newValue: any): void; itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void; onFirstRendering(): void; protected getElement(): SurveyElement; protected initElement(el: SurveyElement): void; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; onSurveyLoad(): void; afterRenderQuestionElement(el: any): void; afterRender(el: any): void; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; protected setNewValue(newValue: any): void; getSurveyData(): ISurveyData; getTextProcessor(): ITextProcessor; getValue(name: string): any; setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any; protected convertDataName(name: string): string; protected convertDataValue(name: string, newValue: any): any; getVariable(name: string): any; setVariable(name: string, newValue: any): void; getComment(name: string): string; setComment(name: string, newValue: string, locNotification: any): any; getAllValues(): any; getFilteredValues(): any; getFilteredProperties(): any; addElement(element: IElement, index: number): void; removeElement(element: IElement): boolean; getQuestionTitleLocation(): string; getQuestionStartIndex(): string; getChildrenLayoutType(): string; elementWidthChanged(el: IElement): void; get elements(): any; indexOf(el: IElement): number; ensureRowsVisibility(): void; protected getContentDisplayValueCore(keyAsText: boolean, value: any, question: Question): any; } /* * A Model for an question that renders empty "div" tag. It used as a base class for some custom widgets */ export declare class QuestionEmptyModel extends Question { constructor(name: string); getType(): string; } /* * A Model for expression question. It is a read-only question. It calculates value based on epxression property. */ export declare class QuestionExpressionModel extends Question { constructor(name: string); expressionIsRunning: boolean; expressionRunner: ExpressionRunner; getType(): string; get hasInput(): boolean; /* * Use this property to display the value in your own format. Make sure you have "{0}" substring in your string, to display the actual value. */ get format(): string; set format(val: string); get locFormat(): LocalizableString; /* * The Expression that used to calculate the question value. You may use standard operators like +, -, * and /, squares (). Here is the example of accessing the question value {questionname}. * <br/>Example: "({quantity} * {price}) * (100 - {discount}) / 100" */ get expression(): string; set expression(val: string); locCalculation(): void; unlocCalculation(): void; runCondition(values: any, properties: any): void; protected canCollectErrors(): boolean; protected hasRequiredError(): boolean; /* * The maximum number of fraction digits to use if displayStyle is not "none". Possible values are from 0 to 20. The default value is -1 and it means that this property is not used. */ get maximumFractionDigits(): number; set maximumFractionDigits(val: number); /* * The minimum number of fraction digits to use if displayStyle is not "none". Possible values are from 0 to 20. The default value is -1 and it means that this property is not used. */ get minimumFractionDigits(): number; set minimumFractionDigits(val: number); runIfReadOnlyValue: boolean; get runIfReadOnly(): boolean; set runIfReadOnly(val: boolean); get formatedValue(): string; protected updateFormatedValue(): void; protected onValueChanged(): void; updateValueFromSurvey(newValue: any): void; protected getDisplayValueCore(keysAsText: boolean, value: any): any; /* * You may set this property to "decimal", "currency", "percent" or "date". If you set it to "currency", you may use the currency property to display the value in currency different from USD. */ get displayStyle(): string; set displayStyle(val: string); /* * Use it to display the value in the currency differen from USD. The displayStype should be set to "currency". */ get currency(): string; set currency(val: string); /* * Determines whether to display grouping separators. The default value is true. */ get useGrouping(): boolean; set useGrouping(val: boolean); protected getValueAsStr(val: any): string; } /* * A Model for a file question */ export declare class QuestionFileModel extends Question { constructor(name: string); isUploading: boolean; isDragging: boolean; /* * The event is fired after question state has been changed. * <br/> sender the question object that fires the event * <br/> options.state new question state value. */ onStateChanged: EventBase<QuestionFileModel>; previewValue: any; currentState: string; indexToShow: number; containsMultiplyFiles: boolean; mobileFileNavigator: any; prevFileAction: Action; nextFileAction: Action; fileIndexAction: Action; get mobileFileNavigatorVisible(): boolean; protected updateElementCssCore(cssClasses: any): void; isPreviewVisible(index: number): boolean; getType(): string; clearOnDeletingContainer(): void; /* * Set it to true, to show the preview for the image files. */ get showPreview(): boolean; set showPreview(val: boolean); /* * Set it to true, to allow select multiple files. */ get allowMultiple(): boolean; set allowMultiple(val: boolean); /* * The image height. */ get imageHeight(): string; set imageHeight(val: string); /* * The image width. */ get imageWidth(): string; set imageWidth(val: string); /* * Accepted file types. Passed to the 'accept' attribute of the file input tag. See https://www.w3schools.com/tags/att_input_accept.asp for more details. */ get acceptedTypes(): string; set acceptedTypes(val: string); /* * Set it to false if you do not want to serialize file content as text in the survey.data. * In this case, you have to write the code onUploadFiles event to store the file content. */ get storeDataAsText(): boolean; set storeDataAsText(val: boolean); /* * Set it to true if you want to wait until files will be uploaded to your server. */ get waitForUpload(): boolean; set waitForUpload(val: boolean); /* * Set it to false if you want to disable images preview. */ get allowImagesPreview(): boolean; set allowImagesPreview(val: boolean); /* * Use this property to setup the maximum allowed file size. */ get maxSize(): number; set maxSize(val: number); /* * Use this property to setup confirmation to remove file. */ get needConfirmRemoveFile(): boolean; set needConfirmRemoveFile(val: boolean); /* * The remove file confirmation message. */ getConfirmRemoveMessage(fileName: string): string; /* * The remove file confirmation message template. */ get confirmRemoveMessage(): string; set confirmRemoveMessage(val: string); get locConfirmRemoveMessage(): LocalizableString; /* * The remove all files confirmation message. */ get confirmRemoveAllMessage(): string; set confirmRemoveAllMessage(val: string); get locConfirmRemoveAllMessage(): LocalizableString; /* * The no file chosen caption for modern theme. */ get noFileChosenCaption(): string; set noFileChosenCaption(val: string); get locNoFileChosenCaption(): LocalizableString; /* * The choose files button caption for modern theme. */ get chooseButtonCaption(): string; set chooseButtonCaption(val: string); get locChooseButtonCaption(): LocalizableString; /* * The clean files button caption. */ get cleanButtonCaption(): string; set cleanButtonCaption(val: string); get locCleanButtonCaption(): LocalizableString; /* * The remove file button caption. */ get removeFileCaption(): string; set removeFileCaption(val: string); get locRemoveFileCaption(): LocalizableString; /* * The loading file input title. */ get loadingFileTitle(): string; set loadingFileTitle(val: string); get locLoadingFileTitle(): LocalizableString; /* * The choose file input title. */ get chooseFileTitle(): string; set chooseFileTitle(val: string); get locChooseFileTitle(): LocalizableString; get dragAreaPlaceholder(): string; set dragAreaPlaceholder(val: string); get locDragAreaPlaceholder(): LocalizableString; /* * The input title value. */ get inputTitle(): string; /* * Clear value programmatically. */ clear(doneCallback?: any): void; /* * Remove file item programmatically. */ removeFile(content: any): void; /* * Load multiple files programmatically. */ loadFiles(files: any): void; canPreviewImage(fileItem: any): boolean; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; protected onCheckForErrors(errors: any, isOnValueChanged: boolean): void; protected stateChanged(state: string): void; getPlainData(options?: any): any; supportComment(): boolean; getChooseFileCss(): string; getReadOnlyFileCss(): string; get fileRootCss(): string; getFileDecoratorCss(): string; onDragOver: any; onDrop: any; onDragLeave: any; doChange: any; doClean: any; doRemoveFile(data: any): void; doDownloadFile: any; } export declare class QuestionImagePickerImplementor extends QuestionCheckboxBaseImplementor { constructor(question: any); protected getKoValue(): any; } /* * A Model for a matrix base question. */ export declare class QuestionMatrixBaseModel<TRow, TColumn> extends Question { constructor(name: string); protected filteredColumns: any; protected filteredRows: any; protected generatedVisibleRows: any; protected generatedTotalRow: any; visibleRowsChangedCallback: any; protected createColumnValues(): any; getType(): string; get isCompositeQuestion(): boolean; /* * Set this property to false, to hide table header. The default value is true. */ get showHeader(): boolean; set showHeader(val: boolean); /* * The list of columns. A column has a value and an optional text */ get columns(): any; set columns(val: any); get visibleColumns(): any; /* * The list of rows. A row has a value and an optional text */ get rows(): any; set rows(val: any); protected processRowsOnSet(newRows: any): any; protected getVisibleRows(): Array<TRow>; /* * Returns the list of visible rows as model objects. */ get visibleRows(): any; /* * An expression that returns true or false. It runs against each row item and if for this item it returns true, then the item is visible otherwise the item becomes invisible. Please use {item} to get the current item value in the expression. */ get rowsVisibleIf(): string; set rowsVisibleIf(val: string); /* * An expression that returns true or false. It runs against each column item and if for this item it returns true, then the item is visible otherwise the item becomes invisible. Please use {item} to get the current item value in the expression. */ get columnsVisibleIf(): string; set columnsVisibleIf(val: string); runCondition(values: any, properties: any): void; protected filterItems(): boolean; protected onColumnsChanged(): void; protected onRowsChanged(): void; protected shouldRunColumnExpression(): boolean; protected hasRowsAsItems(): boolean; protected runItemsCondition(values: any, properties: any): boolean; protected clearGeneratedRows(): void; clearIncorrectValues(): void; protected clearInvisibleValuesInRows(): void; needResponsiveWidth(): boolean; } /* * A Model for a multiple text question. */ export declare class QuestionMultipleTextModel extends Question implements IMultipleTextData, IPanel { constructor(name: string); static addDefaultItems(question: QuestionMultipleTextModel): void; colCountChangedCallback: any; getType(): string; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; get isAllowTitleLeft(): boolean; get hasSingleInput(): boolean; onSurveyLoad(): void; setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; onSurveyValueChanged(newValue: any): void; /* * The list of input items. */ get items(): any; set items(val: any); /* * Add a new text item. */ addItem(name: string, title?: string): MultipleTextItemModel; getItemByName(name: string): MultipleTextItemModel; addConditionObjectsByContext(objects: any, context: any): void; getConditionJson(operator?: string, path?: string): any; locStrsChanged(): void; supportGoNextPageAutomatic(): boolean; /* * The number of columns. Items are rendred in one line if the value is 0. */ get colCount(): number; set colCount(val: number); /* * The default text input size. */ get itemSize(): number; set itemSize(val: number); /* * Returns the list of rendered rows. */ getRows(): Array<any>; isMultipleItemValueChanging: boolean; protected onValueChanged(): void; protected createTextItem(name: string, title: string): MultipleTextItemModel; protected onItemValueChanged(): void; protected getIsRunningValidators(): boolean; hasErrors(fireCallback?: boolean, rec?: any): boolean; getAllErrors(): Array<SurveyError>; clearErrors(): void; protected getContainsErrors(): boolean; protected getIsAnswered(): boolean; getProgressInfo(): IProgressInfo; protected getDisplayValueCore(keysAsText: boolean, value: any): any; getMultipleTextValue(name: string): any; setMultipleTextValue(name: string, value: any): void; getItemDefaultValue(name: string): any; getTextProcessor(): ITextProcessor; getAllValues(): any; getIsRequiredText(): string; addElement(element: IElement, index: number): void; removeElement(element: IElement): boolean; getQuestionTitleLocation(): string; getQuestionStartIndex(): string; getChildrenLayoutType(): string; elementWidthChanged(el: IElement): void; get elements(): any; indexOf(el: IElement): number; ensureRowsVisibility(): void; getItemLabelCss(item: MultipleTextItemModel): string; getItemCss(): string; getItemTitleCss(): string; } /* * A Model for non value question. This question doesn't add any new functionality. It hides some properties, including the value. */ export declare class QuestionNonValue extends Question { constructor(name: string); getType(): string; get hasInput(): boolean; get hasTitle(): boolean; getTitleLocation(): string; get hasComment(): boolean; hasErrors(fireCallback?: boolean, rec?: any): boolean; getAllErrors(): Array<SurveyError>; supportGoNextPageAutomatic(): boolean; addConditionObjectsByContext(objects: any, context: any): void; getConditionJson(operator?: string, path?: string): any; } /* * A Model for a panel dymanic question. You setup the template panel, but adding elements (any question or a panel) and assign a text to it's title, and this panel will be used as a template on creating dynamic panels. The number of panels is defined by panelCount property. * An end-user may dynamically add/remove panels, unless you forbidden this. */ export declare class QuestionPanelDynamicModel extends Question implements IQuestionPanelDynamicData { constructor(name: string); templateValue: PanelModel; loadingPanelCount: number; isValueChangingInternally: boolean; changingValueQuestion: Question; currentIndexValue: number; renderModeChangedCallback: any; panelCountChangedCallback: any; currentIndexChangedCallback: any; get hasSingleInput(): boolean; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; getType(): string; get isCompositeQuestion(): boolean; clearOnDeletingContainer(): void; get isAllowTitleLeft(): boolean; removeElement(element: IElement): boolean; /* * The template Panel. This panel is used as a template on creatign dynamic panels */ get template(): PanelModel; getPanel(): IPanel; /* * The template Panel elements, questions and panels. */ get templateElements(): any; /* * The template Panel title property. */ get templateTitle(): string; set templateTitle(val: string); get locTemplateTitle(): LocalizableString; /* * The template Panel description property. */ get templateDescription(): string; set templateDescription(val: string); get locTemplateDescription(): LocalizableString; protected get items(): any; /* * The array of dynamic panels created based on panel template */ get panels(): any; /* * The index of current active dynamical panel when the renderMode is not "list". If there is no dymamic panel (panelCount = 0) or renderMode equals "list" it returns -1, otherwise it returns a value from 0 to panelCount - 1. */ get currentIndex(): number; set currentIndex(val: number); /* * The current active dynamical panel when the renderMode is not "list". If there is no dymamic panel (panelCount = 0) or renderMode equals "list" it returns null. */ get currentPanel(): PanelModel; /* * Set it to true, to show a confirmation dialog on removing a panel */ get confirmDelete(): boolean; set confirmDelete(val: boolean); /* * Set it to a question name used in the template panel and the library shows duplication error, if there are same values in different panels of this question. */ get keyName(): string; set keyName(val: string); /* * Use this property to change the default text showing in the confirmation delete dialog on removing a panel. */ get confirmDeleteText(): string; set confirmDeleteText(val: string); get locConfirmDeleteText(): LocalizableString; /* * The duplication value error text. Set it to show the text different from the default. */ get keyDuplicationError(): string; set keyDuplicationError(val: string); get locKeyDuplicationError(): LocalizableString; /* * Use this property to change the default previous button text. Previous button shows the previous panel, change the currentPanel, when the renderMode doesn't equal to "list". */ get panelPrevText(): string; set panelPrevText(val: string); get locPanelPrevText(): LocalizableString; /* * Use this property to change the default next button text. Next button shows the next panel, change the currentPanel, when the renderMode doesn't equal to "list". */ get panelNextText(): string; set panelNextText(val: string); get locPanelNextText(): LocalizableString; /* * Use this property to change the default value of add panel button text. */ get panelAddText(): string; set panelAddText(val: string); get locPanelAddText(): LocalizableString; /* * Use this property to change the default value of remove panel button text. */ get panelRemoveText(): string; set panelRemoveText(val: string); get locPanelRemoveText(): LocalizableString; /* * Returns true when the renderMode equals to "progressTop" or "progressTopBottom" */ get isProgressTopShowing(): boolean; /* * Returns true when the renderMode equals to "progressBottom" or "progressTopBottom" */ get isProgressBottomShowing(): boolean; /* * Returns true when currentIndex is more than 0. */ get isPrevButtonShowing(): boolean; /* * Returns true when currentIndex is more than or equal 0 and less than panelCount - 1. */ get isNextButtonShowing(): boolean; /* * Returns true when showRangeInProgress equals to true, renderMode doesn't equal to "list" and panelCount is >= 2. */ get isRangeShowing(): boolean; getElementsInDesign(includeHidden?: boolean): Array<IElement>; isAddingNewPanels: boolean; addingNewPanelsValue: any; isNewPanelsValueChanged: boolean; protected getValueCore(): any; protected setValueCore(newValue: any): void; /* * Use this property to get/set the number of dynamic panels. */ get panelCount(): number; set panelCount(val: number); /* * Use this property to allow the end-user to collapse/expand the panels. It works only if the renderMode property equals to "list" and templateTitle property is not empty. The following values are available: * <br/> default - the default value. User can't collapse/expand panels * <br/> expanded - User can collapse/expand panels and all panels are expanded by default * <br/> collapsed - User can collapse/expand panels and all panels are collapsed by default * <br/> firstExpanded - User can collapse/expand panels. The first panel is expanded and others are collapsed */ get panelsState(): string; set panelsState(val: string); /* * The minimum panel count. A user could not delete a panel if the panelCount equals to minPanelCount */ get minPanelCount(): number; set minPanelCount(val: number); /* * The maximum panel count. A user could not add a panel if the panelCount equals to maxPanelCount */ get maxPanelCount(): number; set maxPanelCount(val: number); /* * Set this property to false to hide the 'Add New' button */ get allowAddPanel(): boolean; set allowAddPanel(val: boolean); /* * Set this property to false to hide the 'Remove' button */ get allowRemovePanel(): boolean; set allowRemovePanel(val: boolean); /* * Set this property different from "default" to set the specific question title location for the template questions. */ get templateTitleLocation(): string; set templateTitleLocation(val: string); /* * Use this property to show/hide the numbers in titles in questions inside a dynamic panel. * By default the value is "off". You may set it to "onPanel" and the first question inside a dynamic panel will start with 1 or "onSurvey" to include nested questions in dymamic panels into global survey question numbering. */ get showQuestionNumbers(): string; set showQuestionNumbers(val: string); /* * Use this property to change the location of the remove button relative to the panel. * By default the value is "bottom". You may set it to "right" and remove button will appear to the right of the panel. */ get panelRemoveButtonLocation(): string; set panelRemoveButtonLocation(val: string); /* * Shows the range from 1 to panelCount when renderMode doesn't equal to "list". Set to false to hide this element. */ get showRangeInProgress(): boolean; set showRangeInProgress(val: boolean); /* * By default the property equals to "list" and all dynamic panels are rendered one by one on the page. You may change it to: "progressTop", "progressBottom" or "progressTopBottom" to render only one dynamic panel at once. The progress and navigation elements can be rendred on top, bottom or both. */ get renderMode(): string; set renderMode(val: string); /* * Returns true when renderMode equals to "list". */ get isRenderModeList(): boolean; setVisibleIndex(value: number): number; /* * Returns true when an end user may add a new panel. The question is not read only and panelCount less than maxPanelCount * and renderMode is "list" or the current panel doesn't have any errors */ get canAddPanel(): boolean; /* * Returns true when an end user may remove a panel. The question is not read only and panelCount is more than minPanelCount */ get canRemovePanel(): boolean; protected rebuildPanels(): void; /* * If it is not empty, then this value is set to every new panel, including panels created initially, unless the defaultValue is not empty */ get defaultPanelValue(): any; set defaultPanelValue(val: any); /* * Set it to true to copy the value into new added panel from the last panel. If defaultPanelValue is set and this property equals to true, * then the value for new added panel is merging. */ get defaultValueFromLastPanel(): boolean; set defaultValueFromLastPanel(val: boolean); protected isDefaultValueEmpty(): boolean; protected setDefaultValue(): void; isEmpty(): boolean; getProgressInfo(): IProgressInfo; /* * Add a new dynamic panel based on the template Panel. It checks if canAddPanel returns true and then calls addPanel method. * If a renderMode is different from "list" and the current panel has erros, then */ addPanelUI(): PanelModel; /* * Add a new dynamic panel based on the template Panel. */ addPanel(): PanelModel; /* * Call removePanel function. Do nothing is canRemovePanel returns false. If confirmDelete set to true, it shows the confirmation dialog first. */ removePanelUI(value: any): void; /* * Goes to the next panel in the PanelDynamic * Returns true, if it can move to the next panel. It can return false if the renderMode is "list" or the current panel has errors. */ goToNextPanel(): boolean; /* * Goes to the previous panel in the PanelDynamic */ goToPrevPanel(): void; /* * Removes a dynamic panel from the panels array. */ removePanel(value: any): void; locStrsChanged(): void; clearIncorrectValues(): void; clearErrors(): void; getQuestionFromArray(name: string, index: number): IQuestion; getSharedQuestionFromArray(name: string, panelIndex: number): Question; addConditionObjectsByContext(objects: any, context: any): void; getConditionJson(operator?: string, path?: string): any; protected onReadOnlyChanged(): void; onSurveyLoad(): void; onFirstRendering(): void; localeChanged(): void; runCondition(values: any, properties: any): void; protected runPanelsCondition(values: any, properties: any): void; onAnyValueChanged(name: string): void; hasErrors(fireCallback?: boolean, rec?: any): boolean; protected getContainsErrors(): boolean; protected getIsAnswered(): boolean; protected clearValueIfInvisibleCore(): void; protected getIsRunningValidators(): boolean; getAllErrors(): Array<SurveyError>; protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected createNewPanel(): PanelModel; protected createAndSetupNewPanelObject(): PanelModel; protected createNewPanelObject(): PanelModel; setQuestionValue(newValue: any): void; onSurveyValueChanged(newValue: any): void; protected onSetData(): void; getItemIndex(item: ISurveyData): number; getPanelItemData(item: ISurveyData): any; isSetPanelItemData: any; setPanelItemData(item: ISurveyData, name: string, val: any): void; getRootData(): ISurveyData; getPlainData(options?: any): any; updateElementCss(reNew?: boolean): void; get progressText(): string; get progress(): string; getRootCss(): string; getPanelWrapperCss(): string; getPanelRemoveButtonCss(): string; getAddButtonCss(): string; getPrevButtonCss(): string; getNextButtonCss(): string; /* * A text displayed when the dynamic panel contains no entries. Applies only in the Default V2 theme. */ get noEntriesText(): string; set noEntriesText(val: string); get locNoEntriesText(): LocalizableString; getShowNoEntriesPlaceholder(): boolean; needResponsiveWidth(): boolean; footerToolbarValue: any; get footerToolbar(): any; legacyNavigation: boolean; updateFooterActionsCallback: any; } /* * A Model for a rating question. */ export declare class QuestionRatingModel extends Question { constructor(name: string); rateValuesChangedCallback: any; endLoadingFromJson(): void; onSurveyLoad(): void; /* * The list of rate items. Every item has value and text. If text is empty, the value is rendered. The item text supports markdown. If it is empty the array is generated by using rateMin, rateMax and rateStep properties. */ get rateValues(): any; set rateValues(val: any); /* * This property is used to generate rate values if rateValues array is empty. It is the first value in the rating. The default value is 1. */ get rateMin(): number; set rateMin(val: number); /* * This property is used to generate rate values if rateValues array is empty. It is the last value in the rating. The default value is 5. */ get rateMax(): number; set rateMax(val: number); /* * This property is used to generate rate values if rateValues array is empty. It is the step value. The number of rate values are (rateMax - rateMin) / rateStep. The default value is 1. */ get rateStep(): number; set rateStep(val: number); protected getDisplayValueCore(keysAsText: boolean, value: any): any; get visibleRateValues(): any; get renderedRateItems(): any; getType(): string; protected getFirstInputElementId(): string; supportGoNextPageAutomatic(): boolean; supportComment(): boolean; supportOther(): boolean; /* * The description of minimum (first) item. */ get minRateDescription(): string; set minRateDescription(val: string); get locMinRateDescription(): LocalizableString; /* * The description of maximum (last) item. */ get maxRateDescription(): string; set maxRateDescription(val: string); get locMaxRateDescription(): LocalizableString; hasMinRateDescription: boolean; hasMaxRateDescription: boolean; get hasMinLabel(): boolean; get hasMaxLabel(): boolean; /* * Specifies whether a Rating question displays the [minRateDescription](https://surveyjs.io/Documentation/Library?id=questionratingmodel#minRateDescription) * and [maxRateDescription](https://surveyjs.io/Documentation/Library?id=questionratingmodel#maxRateDescription) property texts as buttons that correspond to * the extreme (first and last) rate items. If any of these properties is empty, the corresponding rate item's value/text is used for display.<br/> * When the `displayRateDescriptionsAsExtremeItems` property is disabled, the texts defined through * the [minRateDescription](https://surveyjs.io/Documentation/Library?id=questionratingmodel#minRateDescription) * and [maxRateDescription](https://surveyjs.io/Documentation/Library?id=questionratingmodel#maxRateDescription) properties * are displayed as plain non-clickable texts. */ displayRateDescriptionsAsExtremeItems: boolean; useDropdown: "auto" | "always" | "never"; protected valueToData(val: any): any; /* * Click value again to clear. */ setValueFromClick(value: any): void; get ratingRootCss(): string; getItemClass(item: ItemValue): string; getControlClass(): string; get optionsCaption(): string; set optionsCaption(val: string); get locOptionsCaption(): LocalizableString; get showOptionsCaption(): boolean; get renderedValue(): boolean; set renderedValue(val: boolean); get visibleChoices(): any; get readOnlyText(): any; needResponsiveWidth(): boolean; protected supportResponsiveness(): boolean; protected getCompactRenderAs(): string; protected getDesktopRenderAs(): string; } /* * It is a base class for checkbox, dropdown and radiogroup questions. */ export declare class QuestionSelectBase extends Question { constructor(name: string); visibleChoicesChangedCallback: any; loadedChoicesFromServerCallback: any; filteredChoicesValue: any; conditionChoicesVisibleIfRunner: ConditionRunner; conditionChoicesEnableIfRunner: ConditionRunner; commentValue: string; prevCommentValue: string; otherItemValue: ItemValue; choicesFromUrl: any; cachedValueForUrlRequests: any; isChoicesLoaded: boolean; enableOnLoadingChoices: boolean; dependedQuestions: any; noneItemValue: ItemValue; newItemValue: ItemValue; canShowOptionItemCallback: any; getType(): string; dispose(): void; protected getItemValueType(): string; createItemValue(value: any): ItemValue; supportGoNextPageError(): boolean; isLayoutTypeSupported(layoutType: string): boolean; localeChanged(): void; locStrsChanged(): void; /* * Returns the other item. By using this property, you may change programmatically it's value and text. */ get otherItem(): ItemValue; /* * Returns true if a user select the 'other' item. */ get isOtherSelected(): boolean; /* * Set this property to true, to show the "None" item on the bottom. If end-user checks this item, all other items would be unchecked. */ get hasNone(): boolean; set hasNone(val: boolean); /* * Returns the none item. By using this property, you may change programmatically it's value and text. */ get noneItem(): ItemValue; /* * Use this property to set the different text for none item. */ get noneText(): string; set noneText(val: string); get locNoneText(): LocalizableString; /* * An expression that returns true or false. It runs against each choices item and if for this item it returns true, then the item is visible otherwise the item becomes invisible. Please use {item} to get the current item value in the expression. */ get choicesVisibleIf(): string; set choicesVisibleIf(val: string); /* * An expression that returns true or false. It runs against each choices item and if for this item it returns true, then the item is enabled otherwise the item becomes disabled. Please use {item} to get the current item value in the expression. */ get choicesEnableIf(): string; set choicesEnableIf(val: string); surveyChoiceItemVisibilityChange(): void; runCondition(values: any, properties: any): void; protected isTextValue(): boolean; isSettingDefaultValue: boolean; protected setDefaultValue(): void; protected getIsMultipleValue(): boolean; protected convertDefaultValue(val: any): any; protected filterItems(): boolean; protected runItemsCondition(values: any, properties: any): boolean; protected runItemsEnableCondition(values: any, properties: any): any; protected onAfterRunItemsEnableCondition(): void; protected onEnableItemCallBack(item: ItemValue): boolean; changeItemVisisbility(): any; protected getHasOther(val: any): boolean; get validatedValue(): any; protected createRestful(): ChoicesRestful; protected getQuestionComment(): string; isSettingComment: boolean; protected setQuestionComment(newValue: string): void; clearValue(): void; updateCommentFromSurvey(newValue: any): any; get renderedValue(): any; set renderedValue(val: any); protected setQuestionValue(newValue: any, updateIsAnswered?: boolean, updateComment?: boolean): void; protected setNewValue(newValue: any): void; protected valueFromData(val: any): any; protected rendredValueFromData(val: any): any; protected rendredValueToData(val: any): any; protected renderedValueFromDataCore(val: any): any; protected rendredValueToDataCore(val: any): any; protected hasUnknownValue(val: any, includeOther?: boolean, isFilteredChoices?: boolean, checkEmptyValue?: boolean): boolean; protected isValueDisabled(val: any): boolean; /* * If the clearIncorrectValuesCallback is set, it is used to clear incorrect values instead of default behaviour. */ clearIncorrectValuesCallback: any; /* * Use this property to fill the choices from a RESTful service. */ get choicesByUrl(): ChoicesRestful; set choicesByUrl(val: ChoicesRestful); /* * The list of items. Every item has value and text. If text is empty, the value is rendered. The item text supports markdown. */ get choices(): any; set choices(val: any); /* * Set this property to get choices from the specified question instead of defining them in the current question. This avoids duplication of choices declaration in your survey definition. * By setting this property, the "choices", "choicesVisibleIf", "choicesEnableIf" and "choicesOrder" properties become invisible, because these question characteristics depend on actions in another (specified) question. * Use the `choicesFromQuestionMode` property to filter choices obtained from the specified question. */ get choicesFromQuestion(): string; set choicesFromQuestion(val: string); /* * This property becomes visible when the `choicesFromQuestion` property is selected. The default value is "all" (all visible choices from another question are displayed as they are). * You can set this property to "selected" or "unselected" to display only selected or unselected choices from the specified question. */ get choicesFromQuestionMode(): string; set choicesFromQuestionMode(val: string); /* * Set this property to true to hide the question if there is no visible choices. */ get hideIfChoicesEmpty(): boolean; set hideIfChoicesEmpty(val: boolean); get keepIncorrectValues(): boolean; set keepIncorrectValues(val: boolean); /* * Please use survey.storeOthersAsComment to change the behavior on the survey level. This property is depricated and invisible in Survey Creator. * By default the entered text in the others input in the checkbox/radiogroup/dropdown are stored as "question name " + "-Comment". The value itself is "question name": "others". Set this property to false, to store the entered text directly in the "question name" key. * Possible values are: "default", true, false */ get storeOthersAsComment(): any; set storeOthersAsComment(val: any); protected hasOtherChanged(): void; /* * Use this property to render items in a specific order: "asc", "desc", "random". Default value is "none". */ get choicesOrder(): string; set choicesOrder(val: string); /* * Use this property to set the different text for other item. */ get otherText(): string; set otherText(val: string); get locOtherText(): LocalizableString; /* * Use this property to show "Select All", "None" and "Other" choices in multi columns . */ separateSpecialChoices: boolean; /* * Use this property to set the place holder text for other or comment field . */ get otherPlaceHolder(): string; set otherPlaceHolder(val: string); get locOtherPlaceHolder(): LocalizableString; /* * The text that shows when the other item is choosed by the other input is empty. */ get otherErrorText(): string; set otherErrorText(val: string); get locOtherErrorText(): LocalizableString; /* * The list of items as they will be rendered. If needed items are sorted and the other item is added. */ get visibleChoices(): any; /* * The list of enabled items as they will be rendered. The disabled items are not included */ get enabledChoices(): any; protected updateVisibleChoices(): void; protected canUseFilteredChoices(): boolean; setCanShowOptionItemCallback(func: any): void; protected addToVisibleChoices(items: any, isAddAll: boolean): void; protected canShowOptionItem(item: ItemValue, isAddAll: boolean, hasItem: boolean): boolean; /* * For internal use in SurveyJS Creator V2. */ isItemInList(item: ItemValue): boolean; protected get isAddDefaultItems(): boolean; getPlainData(options?: any): any; /* * Returns the text for the current value. If the value is null then returns empty string. If 'other' is selected then returns the text for other value. */ protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected getDisplayValueEmpty(): string; protected getChoicesDisplayValue(items: any, val: any): any; protected get activeChoices(): any; protected getChoicesFromQuestion(question: QuestionSelectBase): Array<ItemValue>; protected get hasActiveChoices(): boolean; protected isHeadChoice(item: ItemValue, question: QuestionSelectBase): boolean; protected isFootChoice(item: ItemValue, question: QuestionSelectBase): boolean; protected isBuiltInChoice(item: ItemValue, question: QuestionSelectBase): boolean; protected getChoices(): Array<ItemValue>; supportComment(): boolean; supportOther(): boolean; supportNone(): boolean; protected isSupportProperty(propName: string): boolean; protected onCheckForErrors(errors: any, isOnValueChanged: boolean): void; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; protected setSurveyCore(value: ISurvey): void; getStoreOthersAsComment(): boolean; onSurveyLoad(): void; onAnyValueChanged(name: string): void; updateValueFromSurvey(newValue: any): void; protected getCommentFromValue(newValue: any): string; protected setOtherValueIntoValue(newValue: any): any; isRunningChoices: boolean; isFirstLoadChoicesFromUrl: boolean; protected onBeforeSendRequest(): void; protected onLoadChoicesFromUrl(array: any): void; isUpdatingChoicesDependedQuestions: boolean; protected updateChoicesDependedQuestions(): void; onSurveyValueChanged(newValue: any): void; protected onVisibleChoicesChanged(): void; clearIncorrectValues(): void; protected hasValueToClearIncorrectValues(): boolean; protected clearValueIfInvisibleCore(): void; /* * Returns true if item is selected */ isItemSelected(item: ItemValue): boolean; protected clearIncorrectValuesCore(): void; protected canClearValueAnUnknow(val: any): boolean; protected clearDisabledValuesCore(): void; clearUnusedValues(): void; getColumnClass(): string; getItemIndex(item: any): number; getItemClass(item: any): string; protected getCurrentColCount(): number; protected getItemClassCore(item: any, options: any): string; getLabelClass(item: ItemValue): string; getControlLabelClass(item: ItemValue): string; get headItems(): any; get footItems(): any; get hasHeadItems(): boolean; get hasFootItems(): boolean; get columns(): any; get hasColumns(): boolean; choicesLoaded(): void; getItemValueWrapperComponentName(item: ItemValue): string; getItemValueWrapperComponentData(item: ItemValue): any; ariaItemChecked(item: ItemValue): "true" | "false"; isOtherItem(item: ItemValue): boolean; get itemSvgIcon(): string; getSelectBaseRootCss(): string; getAriaItemLabel(item: ItemValue): string; getItemId(item: ItemValue): string; get questionName(): string; getItemEnabled(item: ItemValue): any; protected rootElement: any; afterRender(el: any): void; prevIsOtherSelected: boolean; protected onValueChanged(): void; } /* * A Model for signature pad question. */ export declare class QuestionSignaturePadModel extends Question { constructor(name: string); isDrawingValue: boolean; protected getCssRoot(cssClasses: any): string; protected updateValue(): void; getType(): string; afterRenderQuestionElement(el: any): void; beforeDestroyQuestionElement(el: any): void; initSignaturePad(el: any): void; destroySignaturePad(el: any): void; /* * Use it to set the specific dataFormat for the signature pad image data. * formats: "" (default) - png, "image/jpeg" - jpeg, "image/svg+xml" - svg */ dataFormat: string; /* * Use it to set the specific width for the signature pad. */ get width(): string; set width(val: string); /* * Use it to set the specific height for the signature pad. */ get height(): string; set height(val: string); /* * Use it to clear content of the signature pad. */ get allowClear(): boolean; set allowClear(val: boolean); get canShowClearButton(): boolean; /* * Use it to set pen color for the signature pad. */ get penColor(): string; set penColor(val: string); /* * Use it to set background color for the signature pad. */ get backgroundColor(): string; set backgroundColor(val: string); /* * The clear signature button caption. */ get clearButtonCaption(): string; needShowPlaceholder(): boolean; get placeHolderText(): string; } /* * A Base Model for a comment and text questions */ export declare class QuestionTextBase extends Question { constructor(name: string); protected isTextValue(): boolean; /* * The maximum text length. If it is -1, defaul value, then the survey maxTextLength property will be used. * If it is 0, then the value is unlimited */ get maxLength(): number; set maxLength(val: number); getMaxLength(): any; /* * Use this property to set the input place holder. */ get placeHolder(): string; set placeHolder(val: string); get locPlaceHolder(): LocalizableString; getType(): string; isEmpty(): boolean; /* * Gets or sets a value that specifies how the question updates it's value. * * The following options are available: * - `default` - get the value from survey.textUpdateMode * - `onBlur` - the value is updated after an input loses the focus. * - `onTyping` - update the value of text questions, "text" and "comment", on every key press. * * Note, that setting to "onTyping" may lead to a performance degradation, in case you have many expressions in the survey. */ get textUpdateMode(): string; set textUpdateMode(val: string); get isSurveyInputTextUpdate(): boolean; get renderedPlaceHolder(): string; protected setRenderedPlaceHolder(val: string): void; protected onReadOnlyChanged(): void; onSurveyLoad(): void; localeChanged(): void; protected calcRenderedPlaceHolder(): void; protected hasPlaceHolder(): boolean; getControlClass(): string; } /* * The flow panel object. It is a container with flow layout where you can mix questions with markdown text. */ export declare class FlowPanelModel extends PanelModel { constructor(name?: string); static contentElementNamePrefix: string; contentChangedCallback: any; onGetHtmlForQuestion: any; onCustomHtmlProducing: any; getType(): string; getChildrenLayoutType(): string; onSurveyLoad(): any; get content(): string; set content(val: string); get locContent(): LocalizableString; get html(): string; set html(val: string); protected onContentChanged(): any; produceHtml(): string; getQuestionFromText(str: string): Question; protected getHtmlForQuestion(question: Question): string; protected getQuestionHtmlId(question: Question): string; protected onAddElement(element: IElement, index: number): void; protected onRemoveElement(element: IElement): void; dragDropMoveElement(src: IElement, target: IElement, targetIndex: number): void; getElementContentText(element: IElement): string; } export declare class Page extends PageModel { constructor(name?: string); _implementor: ImplementorBase; protected onBaseCreating(): void; protected createRow(): QuestionRowModel; protected onCreating(): void; protected onNumChanged(value: number): void; dispose(): void; } export declare class Panel extends PanelModel { constructor(name?: string); _implementor: ImplementorBase; koElementType: any; koCss: any; koErrorClass: any; protected onBaseCreating(): void; protected createRow(): QuestionRowModel; protected onCreating(): void; protected onNumChanged(value: number): void; dispose(): void; } export declare class QuestionBoolean extends QuestionBooleanModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; onSwitchClick(data: any, event: any): any; onTrueLabelClick(data: any, event: any): any; onFalseLabelClick(data: any, event: any): any; onKeyDown(data: any, event: any): boolean; dispose(): void; } /* * A base class for checkbox and radiogroup questions. It introduced a colCount property. */ export declare class QuestionCheckboxBase extends QuestionSelectBase { constructor(name: string); colCountChangedCallback: any; /* * The number of columns for radiogroup and checkbox questions. Items are rendred in one line if the value is 0. */ get colCount(): number; set colCount(val: number); protected onParentChanged(): void; protected onParentQuestionChanged(): void; protected getSearchableItemValueKeys(keys: any): void; } /* * A Model for a comment question */ export declare class QuestionCommentModel extends QuestionTextBase { constructor(name: string); element: any; /* * The html rows attribute. */ get rows(): number; set rows(val: number); /* * The html cols attribute. */ get cols(): number; set cols(val: number); /* * Accepts pressing the Enter key by end-users and accepts carriage return symbols - \n - in the question value assigned. */ get acceptCarriageReturn(): boolean; set acceptCarriageReturn(val: boolean); /* * Specifies whether the question's text area automatically expands its height to avoid the vertical scrollbar and to display the entire multi-line contents entered by respondents. * Default value is false. */ get autoGrow(): boolean; set autoGrow(val: boolean); getType(): string; afterRenderQuestionElement(el: any): void; updateElement(): void; onInput(event: any): void; onKeyDown(event: any): void; onValueChanged(): void; protected setNewValue(newValue: string): any; get className(): string; } export declare class QuestionCompositeModel extends QuestionCustomModelBase { constructor(name: string, customQuestion: ComponentQuestionJSON); customQuestion: ComponentQuestionJSON; static ItemVariableName: string; panelWrapper: PanelModel; textProcessing: QuestionCompositeTextProcessor; protected createWrapper(): void; getTemplate(): string; protected getCssType(): string; protected getElement(): SurveyElement; get contentPanel(): PanelModel; hasErrors(fireCallback?: boolean, rec?: any): boolean; updateElementCss(reNew?: boolean): void; getTextProcessor(): ITextProcessor; protected clearValueIfInvisibleCore(): void; onAnyValueChanged(name: string): void; protected createPanel(): PanelModel; protected onReadOnlyChanged(): void; onSurveyLoad(): void; setVisibleIndex(val: number): number; runCondition(values: any, properties: any): void; getValue(name: string): any; settingNewValue: boolean; setValue(name: string, newValue: any, locNotification: any, allowNotifyValueChanged?: boolean): any; addConditionObjectsByContext(objects: any, context: any): void; protected convertDataValue(name: string, newValue: any): any; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; protected getDisplayValueCore(keyAsText: boolean, value: any): any; } export declare class QuestionCustomModel extends QuestionCustomModelBase { constructor(name: string, customQuestion: ComponentQuestionJSON); customQuestion: ComponentQuestionJSON; questionWrapper: Question; getTemplate(): string; protected createWrapper(): void; protected getElement(): SurveyElement; onAnyValueChanged(name: string): void; hasErrors(fireCallback?: boolean, rec?: any): boolean; focus(onError?: boolean): void; get contentQuestion(): Question; protected createQuestion(): Question; onSurveyLoad(): void; runCondition(values: any, properties: any): void; protected convertDataName(name: string): string; protected convertDataValue(name: string, newValue: any): any; protected canSetValueToSurvey(): boolean; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; onSurveyValueChanged(newValue: any): void; protected getValueCore(): any; protected initElement(el: SurveyElement): void; updateElementCss(reNew?: boolean): void; protected updateElementCssCore(cssClasses: any): void; protected getDisplayValueCore(keyAsText: boolean, value: any): any; } /* * A Model for a dropdown question */ export declare class QuestionDropdownModel extends QuestionSelectBase { constructor(name: string); /* * This flag controls whether to show options caption item ('Choose...'). */ get showOptionsCaption(): boolean; set showOptionsCaption(val: boolean); /* * Use this property to set the options caption different from the default value. The default value is taken from localization strings. */ get optionsCaption(): string; set optionsCaption(val: string); get locOptionsCaption(): LocalizableString; getType(): string; get selectedItem(): ItemValue; supportGoNextPageAutomatic(): boolean; minMaxChoices: any; protected getChoices(): Array<ItemValue>; /* * Use this and choicesMax property to automatically add choices. For example choicesMin = 1 and choicesMax = 10 will generate ten additional choices from 1 to 10. */ get choicesMin(): number; set choicesMin(val: number); /* * Use this and choicesMax property to automatically add choices. For example choicesMin = 1 and choicesMax = 10 will generate ten additional choices from 1 to 10. */ get choicesMax(): number; set choicesMax(val: number); /* * The default value is 1. It tells the value of the iterator between choicesMin and choicesMax properties. * If choicesMin = 10, choicesMax = 30 and choicesStep = 10 then you will have only three additional choices: [10, 20, 30]. */ get choicesStep(): number; set choicesStep(val: number); /* * Dropdown auto complete */ get autoComplete(): string; set autoComplete(val: string); denySearch: boolean; dropdownWidthMode: "contentWidth" | "editorWidth"; getControlClass(): string; get readOnlyText(): any; protected onVisibleChoicesChanged(): void; _popupModel: any; get popupModel(): any; } export declare class QuestionEmpty extends QuestionEmptyModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionExpression extends QuestionExpressionModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionFile extends QuestionFileModel { constructor(name: string); _implementor: QuestionFileImplementor; protected onBaseCreating(): void; dispose(): void; } /* * A Model for html question. Unlike other questions it doesn't have value and title. */ export declare class QuestionHtmlModel extends QuestionNonValue { constructor(name: string); ignoreHtmlProgressing: boolean; getType(): string; get isCompositeQuestion(): boolean; getProcessedText(text: string): string; /* * Set html to display it */ get html(): string; set html(val: string); get locHtml(): LocalizableString; get processedHtml(): string; } /* * A Model for image question. This question hasn't any functionality and can be used to improve the appearance of the survey. */ export declare class QuestionImageModel extends QuestionNonValue { constructor(name: string); getType(): string; get isCompositeQuestion(): boolean; onSurveyLoad(): void; /* * The image URL. */ get imageLink(): string; set imageLink(val: string); get locImageLink(): LocalizableString; /* * The image alt text. */ get text(): string; set text(val: string); get locText(): LocalizableString; /* * The image height. */ get imageHeight(): string; set imageHeight(val: string); get renderedHeight(): string; /* * The image width. */ get imageWidth(): string; set imageWidth(val: string); get renderedWidth(): string; /* * The image fit mode. */ get imageFit(): string; set imageFit(val: string); /* * The content mode. */ get contentMode(): string; set contentMode(val: string); /* * The rendered mode. */ get renderedMode(): string; getImageCss(): string; protected calculateRenderedMode(): void; } /* * A base class for matrix dropdown and matrix dynamic questions. */ export declare class QuestionMatrixDropdownModelBase extends QuestionMatrixBaseModel<MatrixDropdownRowModelBase, MatrixDropdownColumn> implements IMatrixDropdownData { constructor(name: string); static get defaultCellType(): string; static set defaultCellType(val: string); static addDefaultColumns(matrix: QuestionMatrixDropdownModelBase): void; detailPanelValue: PanelModel; protected isRowChanging: boolean; columnsChangedCallback: any; onRenderedTableResetCallback: any; onRenderedTableCreatedCallback: any; onCellCreatedCallback: any; onCellValueChangedCallback: any; onHasDetailPanelCallback: any; onCreateDetailPanelCallback: any; onCreateDetailPanelRenderedRowCallback: any; protected createColumnValues(): any; /* * Returns the type of the object as a string as it represents in the json. */ getType(): string; dispose(): void; get hasSingleInput(): boolean; get isRowsDynamic(): boolean; isUpdating: boolean; protected get isUpdateLocked(): boolean; beginUpdate(): void; endUpdate(): void; protected updateColumnsAndRows(): void; itemValuePropertyChanged(item: ItemValue, name: string, oldValue: any, newValue: any): void; /* * Set columnLayout to 'vertical' to place columns vertically and rows horizontally. It makes sense when we have many columns and few rows. */ get columnLayout(): string; set columnLayout(val: string); get columnsLocation(): string; set columnsLocation(val: string); /* * Returns true if columns are located horizontally */ get isColumnLayoutHorizontal(): boolean; /* * Set the value to "underRow" to show the detailPanel under the row. */ get detailPanelMode(): string; set detailPanelMode(val: string); /* * The detail template Panel. This panel is used as a template on creating detail panel for a row. */ get detailPanel(): PanelModel; getPanel(): IPanel; /* * The template Panel elements, questions and panels. */ get detailElements(): any; protected createNewDetailPanel(): PanelModel; get hasRowText(): boolean; getFooterText(): LocalizableString; get canAddRow(): boolean; get canRemoveRows(): boolean; canRemoveRow(row: MatrixDropdownRowModelBase): boolean; onPointerDown(pointerDownEvent: any, row: MatrixDropdownRowModelBase): void; protected onRowsChanged(): void; lockResetRenderedTable: boolean; protected onStartRowAddingRemoving(): void; protected onEndRowAdding(): void; protected onEndRowRemoving(row: MatrixDropdownRowModelBase): void; protected clearRowsAndResetRenderedTable(): void; protected resetRenderedTable(): void; protected clearGeneratedRows(): void; get renderedTable(): QuestionMatrixDropdownRenderedTable; protected createRenderedTable(): QuestionMatrixDropdownRenderedTable; protected onMatrixRowCreated(row: MatrixDropdownRowModelBase): void; /* * Use this property to change the default cell type. */ get cellType(): string; set cellType(val: string); /* * The default column count for radiogroup and checkbox cell types. */ get columnColCount(): number; set columnColCount(val: number); /* * Use this property to set the minimum column width. */ get columnMinWidth(): string; set columnMinWidth(val: string); /* * Set this property to true to show the horizontal scroll. */ get horizontalScroll(): boolean; set horizontalScroll(val: boolean); /* * The Matrix toolbar and inner panel toolbars get adaptive if the property is set to true. */ get allowAdaptiveActions(): boolean; set allowAdaptiveActions(val: boolean); getRequiredText(): string; onColumnPropertyChanged(column: MatrixDropdownColumn, name: string, newValue: any): void; onColumnItemValuePropertyChanged(column: MatrixDropdownColumn, propertyName: string, obj: ItemValue, name: string, newValue: any, oldValue: any): void; onShowInMultipleColumnsChanged(column: MatrixDropdownColumn): void; onColumnCellTypeChanged(column: MatrixDropdownColumn): void; getRowTitleWidth(): string; get hasFooter(): boolean; getAddRowLocation(): string; getShowColumnsIfEmpty(): boolean; protected updateShowTableAndAddRow(): void; protected updateHasFooter(): void; get hasTotal(): boolean; getCellType(): string; getCustomCellType(column: MatrixDropdownColumn, row: MatrixDropdownRowModelBase, cellType: string): string; getConditionJson(operator?: string, path?: string): any; clearIncorrectValues(): void; clearErrors(): void; localeChanged(): void; runCondition(values: any, properties: any): void; protected shouldRunColumnExpression(): boolean; protected runCellsCondition(values: any, properties: any): void; protected runTotalsCondition(values: any, properties: any): void; locStrsChanged(): void; /* * Returns the column by it's name. Returns null if a column with this name doesn't exist. */ getColumnByName(columnName: string): MatrixDropdownColumn; getColumnName(columnName: string): MatrixDropdownColumn; /* * Returns the column width. */ getColumnWidth(column: MatrixDropdownColumn): string; /* * The default choices for dropdown, checkbox and radiogroup cell types. */ get choices(): any; set choices(val: any); /* * The default options caption for dropdown cell type. */ get optionsCaption(): string; set optionsCaption(val: string); get locOptionsCaption(): LocalizableString; /* * The duplication value error text. Set it to show the text different from the default. */ get keyDuplicationError(): string; set keyDuplicationError(val: string); get locKeyDuplicationError(): LocalizableString; get storeOthersAsComment(): boolean; addColumn(name: string, title?: string): MatrixDropdownColumn; protected getVisibleRows(): Array<MatrixDropdownRowModelBase>; get totalValue(): any; protected getVisibleTotalRow(): MatrixDropdownRowModelBase; get visibleTotalRow(): MatrixDropdownRowModelBase; onSurveyLoad(): void; /* * Returns the row value. If the row value is empty, the object is empty: {}. */ getRowValue(rowIndex: number): any; checkIfValueInRowDuplicated(checkedRow: MatrixDropdownRowModelBase, cellQuestion: Question): boolean; /* * Set the row value. */ setRowValue(rowIndex: number, rowValue: any): any; protected generateRows(): Array<MatrixDropdownRowModelBase>; protected generateTotalRow(): MatrixDropdownRowModelBase; protected createNewValue(nullOnEmpty?: boolean): any; protected getRowValueCore(row: MatrixDropdownRowModelBase, questionValue: any, create?: boolean): any; protected getRowObj(row: MatrixDropdownRowModelBase): any; protected getRowDisplayValue(keysAsText: boolean, row: MatrixDropdownRowModelBase, rowValue: any): any; getPlainData(options?: any): any; addConditionObjectsByContext(objects: any, context: any): void; protected getConditionObjectRowName(index: number): string; protected getConditionObjectRowText(index: number): string; protected getConditionObjectsRowIndeces(): Array<any>; getProgressInfo(): IProgressInfo; protected updateProgressInfoByValues(res: IProgressInfo): void; protected updateProgressInfoByRow(res: IProgressInfo, rowValue: any): void; protected onBeforeValueChanged(val: any): void; protected setQuestionValue(newValue: any): void; supportGoNextPageAutomatic(): boolean; protected getContainsErrors(): boolean; protected getIsAnswered(): boolean; hasErrors(fireCallback?: boolean, rec?: any): boolean; protected getIsRunningValidators(): boolean; getAllErrors(): Array<SurveyError>; protected getUniqueColumns(): Array<MatrixDropdownColumn>; protected getFirstInputElementId(): string; protected getFirstErrorInputElementId(): string; protected getFirstCellQuestion(onError: boolean): Question; protected onReadOnlyChanged(): void; createQuestion(row: MatrixDropdownRowModelBase, column: MatrixDropdownColumn): Question; protected createQuestionCore(row: MatrixDropdownRowModelBase, column: MatrixDropdownColumn): Question; protected deleteRowValue(newValue: any, row: MatrixDropdownRowModelBase): any; isDoingonAnyValueChanged: boolean; onAnyValueChanged(name: string): void; protected isObject(value: any): boolean; protected onCellValueChanged(row: MatrixDropdownRowModelBase, columnName: string, rowValue: any): void; validateCell(row: MatrixDropdownRowModelBase, columnName: string, rowValue: any): SurveyError; get isValidateOnValueChanging(): boolean; onRowChanging(row: MatrixDropdownRowModelBase, columnName: string, rowValue: any): any; onRowChanged(row: MatrixDropdownRowModelBase, columnName: string, newRowValue: any, isDeletingValue: boolean): void; getRowIndex(row: MatrixDropdownRowModelBase): number; getElementsInDesign(includeHidden?: boolean): Array<IElement>; hasDetailPanel(row: MatrixDropdownRowModelBase): boolean; getIsDetailPanelShowing(row: MatrixDropdownRowModelBase): boolean; setIsDetailPanelShowing(row: MatrixDropdownRowModelBase, val: boolean): void; getDetailPanelButtonCss(row: MatrixDropdownRowModelBase): string; getDetailPanelIconCss(row: MatrixDropdownRowModelBase): string; getDetailPanelIconId(row: MatrixDropdownRowModelBase): string; createRowDetailPanel(row: MatrixDropdownRowModelBase): PanelModel; getSharedQuestionByName(columnName: string, row: MatrixDropdownRowModelBase): Question; onTotalValueChanged(): any; getParentTextProcessor(): ITextProcessor; getQuestionFromArray(name: string, index: number): IQuestion; getCellTemplateData(cell: QuestionMatrixDropdownRenderedCell): any; getCellWrapperComponentName(cell: MatrixDropdownCell): string; getCellWrapperComponentData(cell: MatrixDropdownCell): any; getColumnHeaderWrapperComponentName(cell: MatrixDropdownCell): string; getColumnHeaderWrapperComponentData(cell: MatrixDropdownCell): any; getRowHeaderWrapperComponentName(cell: MatrixDropdownCell): string; getRowHeaderWrapperComponentData(cell: MatrixDropdownCell): any; get showHorizontalScroll(): boolean; getRootCss(): string; } /* * A Model for a simple matrix question. */ export declare class QuestionMatrixModel extends QuestionMatrixBaseModel<MatrixRowModel, ItemValue> implements IMatrixData, IMatrixCellsOwner { constructor(name: string); isRowChanging: boolean; cellsValue: MatrixCells; getType(): string; get hasSingleInput(): boolean; /* * Set this property to true, if you want a user to answer all rows. */ get isAllRowRequired(): boolean; set isAllRowRequired(val: boolean); /* * Returns true, if there is at least one row. */ get hasRows(): boolean; /* * Use this property to render items in a specific order: "random" or "initial". Default is "initial". */ get rowsOrder(): string; set rowsOrder(val: string); /* * Set this property to true to hide the question if there is no visible rows in the matrix. */ get hideIfRowsEmpty(): boolean; set hideIfRowsEmpty(val: boolean); getRows(): Array<any>; getColumns(): Array<any>; addColumn(value: any, text?: string): ItemValue; getItemClass(row: any, column: any): string; get itemSvgIcon(): string; protected getQuizQuestionCount(): number; protected getCorrectAnswerCount(): number; protected getVisibleRows(): Array<MatrixRowModel>; protected sortVisibleRows(array: any): Array<MatrixRowModel>; endLoadingFromJson(): void; protected processRowsOnSet(newRows: any): any; /* * Returns the list of visible rows as model objects. */ get visibleRows(): any; get cells(): MatrixCells; set cells(val: MatrixCells); get hasCellText(): boolean; protected updateHasCellText(): void; setCellText(row: any, column: any, val: string): void; getCellText(row: any, column: any): string; setDefaultCellText(column: any, val: string): void; getDefaultCellText(column: any): string; getCellDisplayText(row: any, column: any): string; emptyLocalizableString: LocalizableString; getCellDisplayLocText(row: any, column: any): LocalizableString; supportGoNextPageAutomatic(): boolean; protected onCheckForErrors(errors: any, isOnValueChanged: boolean): void; protected getIsAnswered(): boolean; protected onMatrixRowCreated(row: MatrixRowModel): void; protected setQuestionValue(newValue: any, updateIsAnswered?: boolean): void; protected getDisplayValueCore(keysAsText: boolean, value: any): any; getPlainData(options?: any): any; addConditionObjectsByContext(objects: any, context: any): void; getConditionJson(operator?: string, path?: string): any; protected clearValueIfInvisibleCore(): void; protected getFirstInputElementId(): string; protected onRowsChanged(): void; onMatrixRowChanged(row: MatrixRowModel): void; getCorrectedRowValue(value: any): any; protected getSearchableItemValueKeys(keys: any): void; getColumnHeaderWrapperComponentName(cell: ItemValue): string; getColumnHeaderWrapperComponentData(cell: ItemValue): any; getRowHeaderWrapperComponentName(cell: ItemValue): string; getRowHeaderWrapperComponentData(cell: ItemValue): any; } export declare class QuestionMultipleText extends QuestionMultipleTextModel { constructor(name: string); _implementor: QuestionMultipleTextImplementor; koRows: any; protected onBaseCreating(): void; protected onColCountChanged(): void; protected createTextItem(name: string, title: string): MultipleTextItemModel; dispose(): void; } export declare class QuestionPanelDynamic extends QuestionPanelDynamicModel { constructor(name: string); _implementor: QuestionPanelDynamicImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionRating extends QuestionRatingModel { constructor(name: string); _implementor: QuestionRatingImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionSignaturePad extends QuestionSignaturePadModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } /* * A Model for an input text question. */ export declare class QuestionTextModel extends QuestionTextBase { constructor(name: string); locDataListValue: LocalizableStrings; minValueRunner: ExpressionRunner; maxValueRunner: ExpressionRunner; protected isTextValue(): boolean; getType(): string; onSurveyLoad(): void; /* * Use this property to change the default input type. */ get inputType(): string; set inputType(val: string); runCondition(values: any, properties: any): void; getValidators(): Array<SurveyValidator>; isLayoutTypeSupported(layoutType: string): boolean; /* * The text input size */ get size(): number; set size(val: number); get isTextInput(): boolean; get inputSize(): number; get renderedInputSize(): number; get inputWidth(): string; updateInputSize(): void; /* * Text auto complete */ get autoComplete(): string; set autoComplete(val: string); /* * The minimum value */ get min(): string; set min(val: string); /* * The maximum value */ get max(): string; set max(val: string); /* * The minimum value that you can setup as expression, for example today(-1) = yesterday; */ get minValueExpression(): string; set minValueExpression(val: string); /* * The maximum value that you can setup as expression, for example today(1) = tomorrow; */ get maxValueExpression(): string; set maxValueExpression(val: string); get renderedMin(): any; get renderedMax(): any; /* * The text that shows when value is less than min property. */ get minErrorText(): string; set minErrorText(val: string); get locMinErrorText(): LocalizableString; /* * The text that shows when value is greater than man property. */ get maxErrorText(): string; set maxErrorText(val: string); get locMaxErrorText(): LocalizableString; /* * Readonly property that returns true if the current inputType allows to set min and max properties */ get isMinMaxType(): boolean; protected onCheckForErrors(errors: any, isOnValueChanged: boolean): void; protected canSetValueToSurvey(): boolean; /* * The step value */ get step(): string; set step(val: string); get renderedStep(): string; supportGoNextPageAutomatic(): boolean; supportGoNextPageError(): boolean; /* * The list of recommended options available to choose. */ get dataList(): any; set dataList(val: any); get locDataList(): LocalizableStrings; get dataListId(): string; protected canRunValidators(isOnValueChanged: boolean): boolean; protected setNewValue(newValue: any): void; protected correctValueType(newValue: any): any; protected hasPlaceHolder(): boolean; isReadOnlyRenderDiv(): boolean; get inputStyle(): any; } export declare class FlowPanel extends FlowPanelModel { constructor(name?: string); koElementType: any; koElementAfterRender: any; placeHolder: string; protected onCreating(): void; protected getHtmlForQuestion(question: any): string; } /* * A Model for a button group question. */ export declare class QuestionButtonGroupModel extends QuestionCheckboxBase { constructor(name: string); getType(): string; protected getItemValueType(): string; supportOther(): boolean; } /* * A Model for a checkbox question */ export declare class QuestionCheckboxModel extends QuestionCheckboxBase { constructor(name: string); selectAllItemValue: ItemValue; invisibleOldValues: any; get ariaRole(): string; getType(): string; protected onCreating(): void; protected getFirstInputElementId(): string; /* * Returns the select all item. By using this property, you may change programmatically it's value and text. */ get selectAllItem(): ItemValue; /* * Use this property to set the different text for Select All item. */ get selectAllText(): string; set selectAllText(val: string); get locSelectAllText(): LocalizableString; /* * Set this property to true, to show the "Select All" item on the top. If end-user checks this item, then all items are checked. */ get hasSelectAll(): boolean; set hasSelectAll(val: boolean); /* * Returns true if all items are selected */ get isAllSelected(): boolean; set isAllSelected(val: boolean); /* * It will select all items, except other and none. If all items have been already selected then it will clear the value */ toggleSelectAll(): void; /* * Select all items, except other and none. */ selectAll(): void; /* * Returns true if item is checked */ isItemSelected(item: ItemValue): boolean; /* * Set this property different to 0 to limit the number of selected choices in the checkbox. */ get maxSelectedChoices(): number; set maxSelectedChoices(val: number); /* * Return the selected items in the checkbox. Returns empty array if the value is empty */ get selectedItems(): any; protected onEnableItemCallBack(item: ItemValue): boolean; protected onAfterRunItemsEnableCondition(): void; protected getItemClassCore(item: any, options: any): string; updateValueFromSurvey(newValue: any): void; protected setDefaultValue(): void; protected hasValueToClearIncorrectValues(): boolean; protected setNewValue(newValue: any): void; protected getIsMultipleValue(): boolean; protected getCommentFromValue(newValue: any): string; protected setOtherValueIntoValue(newValue: any): any; protected canUseFilteredChoices(): boolean; protected supportSelectAll(): boolean; protected addToVisibleChoices(items: any, isAddAll: boolean): void; protected isHeadChoice(item: ItemValue, question: QuestionSelectBase): boolean; /* * For internal use in SurveyJS Creator V2. */ isItemInList(item: ItemValue): boolean; protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected clearIncorrectValuesCore(): void; protected clearDisabledValuesCore(): void; isChangingValueOnClearIncorrect: boolean; getConditionJson(operator?: string, path?: string): any; isAnswerCorrect(): boolean; protected setDefaultValueWithOthers(): void; protected getHasOther(val: any): boolean; protected valueFromData(val: any): any; protected renderedValueFromDataCore(val: any): any; protected rendredValueToDataCore(val: any): any; get checkBoxSvgPath(): string; } export declare class QuestionComment extends QuestionCommentModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionComposite extends QuestionCompositeModel { constructor(name: string, questionJSON: any); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionCustom extends QuestionCustomModel { constructor(name: string, questionJSON: any); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionDropdown extends QuestionDropdownModel { constructor(name: string); _implementor: QuestionDropdownImplementor; koDisableOption: any; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionHtml extends QuestionHtmlModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionImage extends QuestionImageModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } /* * A Model for a select image question. */ export declare class QuestionImagePickerModel extends QuestionCheckboxBase { constructor(name: string); getType(): string; supportGoNextPageAutomatic(): boolean; get hasSingleInput(): boolean; protected getItemValueType(): string; get isCompositeQuestion(): boolean; supportOther(): boolean; supportNone(): boolean; isAnswerCorrect(): boolean; /* * Multi select option. If set to true, then allows to select multiple images. */ get multiSelect(): boolean; set multiSelect(val: boolean); /* * Returns true if item is checked */ isItemSelected(item: ItemValue): boolean; clearIncorrectValues(): void; /* * Show label under the image. */ get showLabel(): boolean; set showLabel(val: boolean); endLoadingFromJson(): void; protected getValueCore(): any; protected renderedValueFromDataCore(val: any): any; protected rendredValueToDataCore(val: any): any; /* * The image height. */ get imageHeight(): number; set imageHeight(val: number); responsiveImageHeight: number; get renderedImageHeight(): string; /* * The image width. */ get imageWidth(): number; set imageWidth(val: number); responsiveImageWidth: number; get renderedImageWidth(): string; /* * The image fit mode. */ get imageFit(): string; set imageFit(val: string); /* * The content mode. */ get contentMode(): string; set contentMode(val: string); protected convertDefaultValue(val: any): any; get inputType(): "checkbox" | "radio"; protected isFootChoice(_item: ItemValue, _question: QuestionSelectBase): boolean; getSelectBaseRootCss(): string; isResponsiveValue: boolean; maxImageWidth: number; minImageWidth: number; maxImageHeight: number; minImageHeight: number; protected getObservedElementSelector(): string; protected supportResponsiveness(): boolean; protected needResponsiveness(): boolean; _width: number; onContentLoaded: any; responsiveColCount: number; protected getCurrentColCount(): number; protected processResponsiveness(_: number, availableWidth: number): boolean; gapBetweenItems: number; afterRender(el: any): void; } export declare class QuestionMatrix extends QuestionMatrixModel { constructor(name: string); _implementor: QuestionImplementor; koVisibleRows: any; koVisibleColumns: any; protected onBaseCreating(): void; protected onColumnsChanged(): void; protected onRowsChanged(): void; onSurveyLoad(): void; protected onMatrixRowCreated(row: any): void; protected getVisibleRows(): Array<MatrixRowModel>; dispose(): void; } /* * A Model for a matrix dropdown question. You may use a dropdown, checkbox, radiogroup, text and comment questions as a cell editors. */ export declare class QuestionMatrixDropdownModel extends QuestionMatrixDropdownModelBase implements IMatrixDropdownData { constructor(name: string); getType(): string; /* * Set this property to show it on the first column for the total row. */ get totalText(): string; set totalText(val: string); get locTotalText(): LocalizableString; getFooterText(): LocalizableString; /* * The column width for the first column, row title column. */ get rowTitleWidth(): string; set rowTitleWidth(val: string); getRowTitleWidth(): string; protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected getConditionObjectRowName(index: number): string; protected getConditionObjectRowText(index: number): string; protected getConditionObjectsRowIndeces(): Array<any>; clearIncorrectValues(): void; protected clearValueIfInvisibleCore(): void; protected generateRows(): Array<MatrixDropdownRowModel>; protected createMatrixRow(item: ItemValue, value: any): MatrixDropdownRowModel; protected getSearchableItemValueKeys(keys: any): void; protected updateProgressInfoByValues(res: IProgressInfo): void; } /* * A Model for a matrix dymanic question. You may use a dropdown, checkbox, radiogroup, text and comment questions as a cell editors. * An end-user may dynamically add/remove rows, unlike in matrix dropdown question. */ export declare class QuestionMatrixDynamicModel extends QuestionMatrixDropdownModelBase implements IMatrixDropdownData { constructor(name: string); onGetValueForNewRowCallBack: any; rowCounter: number; initialRowCount: number; setRowCountValueFromData: boolean; dragDropMatrixRows: DragDropMatrixRows; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; draggedRow: MatrixDropdownRowModelBase; onPointerDown(pointerDownEvent: any, row: MatrixDropdownRowModelBase): void; startDragMatrixRow: any; getType(): string; get isRowsDynamic(): boolean; /* * Set it to true, to show a confirmation dialog on removing a row */ get confirmDelete(): boolean; set confirmDelete(val: boolean); /* * Set it to a column name and the library shows duplication error, if there are same values in different rows in the column. */ get keyName(): string; set keyName(val: string); /* * If it is not empty, then this value is set to every new row, including rows created initially, unless the defaultValue is not empty */ get defaultRowValue(): any; set defaultRowValue(val: any); /* * Set it to true to copy the value into new added row from the last row. If defaultRowValue is set and this property equals to true, * then the value for new added row is merging. */ get defaultValueFromLastRow(): boolean; set defaultValueFromLastRow(val: boolean); protected isDefaultValueEmpty(): boolean; protected valueFromData(val: any): any; protected setDefaultValue(): void; moveRowByIndex: any; /* * The number of rows in the matrix. */ get rowCount(): number; set rowCount(val: number); protected updateProgressInfoByValues(res: IProgressInfo): void; /* * Set this property to true, to allow rows drag and drop. */ get allowRowsDragAndDrop(): boolean; set allowRowsDragAndDrop(val: boolean); get iconDragElement(): string; protected createRenderedTable(): QuestionMatrixDropdownRenderedTable; /* * The minimum row count. A user could not delete a row if the rowCount equals to minRowCount */ get minRowCount(): number; set minRowCount(val: number); /* * The maximum row count. A user could not add a row if the rowCount equals to maxRowCount */ get maxRowCount(): number; set maxRowCount(val: number); /* * Set this property to false to disable ability to add new rows. "Add new Row" button becomes invsible in UI */ get allowAddRows(): boolean; set allowAddRows(val: boolean); /* * Set this property to false to disable ability to remove rows. "Remove" row buttons become invsible in UI */ get allowRemoveRows(): boolean; set allowRemoveRows(val: boolean); /* * Returns true, if a new row can be added. */ get canAddRow(): boolean; canRemoveRowsCallback: any; /* * Returns true, if row can be removed. */ get canRemoveRows(): boolean; canRemoveRow(row: MatrixDropdownRowModelBase): boolean; /* * Creates and add a new row and focus the cell in the first column. */ addRowUI(): void; /* * Creates and add a new row. */ addRow(): void; /* * Set this property to true to show detail panel immediately on adding a new row. */ get detailPanelShowOnAdding(): boolean; set detailPanelShowOnAdding(val: boolean); protected hasRowsAsItems(): boolean; unbindValue(): void; protected isValueSurveyElement(val: any): boolean; /* * Removes a row by it's index. If confirmDelete is true, show a confirmation dialog */ removeRowUI(value: any): void; isRequireConfirmOnRowDelete(index: number): boolean; /* * Removes a row by it's index. */ removeRow(index: number): void; /* * Use this property to change the default text showing in the confirmation delete dialog on removing a row. */ get confirmDeleteText(): string; set confirmDeleteText(val: string); get locConfirmDeleteText(): LocalizableString; /* * Use this property to change the default value of add row button text. */ get addRowText(): string; set addRowText(val: string); get locAddRowText(): LocalizableString; /* * By default the 'Add Row' button is shown on bottom if columnLayout is horizontal and on top if columnLayout is vertical. <br/> * You may set it to "top", "bottom" or "topBottom" (to show on top and bottom). */ get addRowLocation(): string; set addRowLocation(val: string); getAddRowLocation(): string; /* * Set this property to true to hide matrix columns when there is no any row. */ get hideColumnsIfEmpty(): boolean; set hideColumnsIfEmpty(val: boolean); getShowColumnsIfEmpty(): boolean; /* * Use this property to change the default value of remove row button text. */ get removeRowText(): string; set removeRowText(val: string); get locRemoveRowText(): LocalizableString; /* * Use this property to change the default value of remove row button text. */ get emptyRowsText(): string; set emptyRowsText(val: string); get locEmptyRowsText(): LocalizableString; protected getDisplayValueCore(keysAsText: boolean, value: any): any; protected getConditionObjectRowName(index: number): string; protected getConditionObjectsRowIndeces(): Array<any>; supportGoNextPageAutomatic(): boolean; get hasRowText(): boolean; protected onCheckForErrors(errors: any, isOnValueChanged: boolean): void; protected getUniqueColumns(): Array<MatrixDropdownColumn>; protected generateRows(): Array<MatrixDynamicRowModel>; protected createMatrixRow(value: any): MatrixDynamicRowModel; protected onBeforeValueChanged(val: any): void; protected createNewValue(): any; protected deleteRowValue(newValue: any, row: MatrixDropdownRowModelBase): any; protected getRowValueCore(row: MatrixDropdownRowModelBase, questionValue: any, create?: boolean): any; getAddRowButtonCss(isEmptySection?: boolean): string; getRemoveRowButtonCss(): string; getRootCss(): string; } /* * A Model for a radiogroup question. */ export declare class QuestionRadiogroupModel extends QuestionCheckboxBase { constructor(name: string); getType(): string; get ariaRole(): string; protected getFirstInputElementId(): string; /* * Return the selected item in the radio group. Returns null if the value is empty */ get selectedItem(): ItemValue; /* * Show "clear button" flag. */ get showClearButton(): boolean; set showClearButton(val: boolean); get canShowClearButton(): boolean; get clearButtonCaption(): any; supportGoNextPageAutomatic(): boolean; } export declare class QuestionText extends QuestionTextModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionButtonGroup extends QuestionButtonGroupModel { constructor(name: string); _implementor: QuestionCheckboxBaseImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionCheckbox extends QuestionCheckboxModel { constructor(name: string); koAllSelected: any; isAllSelectedUpdating: boolean; _implementor: QuestionCheckboxImplementor; protected onBaseCreating(): void; onSurveyValueChanged(newValue: any): void; protected onVisibleChoicesChanged(): void; protected updateAllSelected(): void; dispose(): void; } export declare class QuestionImagePicker extends QuestionImagePickerModel { constructor(name: string); _implementor: QuestionImagePickerImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionMatrixDropdown extends QuestionMatrixDropdownModel { constructor(name: string); _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionMatrixDynamic extends QuestionMatrixDynamicModel { constructor(name: string); _implementor: QuestionMatrixDynamicImplementor; protected onBaseCreating(): void; dispose(): void; } export declare class QuestionRadiogroup extends QuestionRadiogroupModel { constructor(name: string); _implementor: QuestionCheckboxBaseImplementor; protected onBaseCreating(): void; dispose(): void; } /* * A Model for a ranking question */ export declare class QuestionRankingModel extends QuestionCheckboxModel { constructor(name: string); domNode: any; getType(): string; get rootClass(): string; protected getItemClassCore(item: ItemValue, options: any): string; protected isItemCurrentDropTarget(item: ItemValue): boolean; get ghostPositionCssClass(): string; getNumberByIndex(index: number): string; setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void; isAnswerCorrect(): boolean; onSurveyValueChanged(newValue: any): void; protected onVisibleChoicesChanged: any; localeChanged: any; get rankingChoices(): any; dragDropRankingChoices: DragDropRankingChoices; currentDropTarget: ItemValue; dropTargetNodeMove: string; endLoadingFromJson(): void; handlePointerDown: any; afterRenderQuestionElement(el: any): void; beforeDestroyQuestionElement(el: any): void; handleKeydown: any; protected supportSelectAll(): boolean; supportOther(): boolean; supportNone(): boolean; handleArrowUp: any; handleArrowDown: any; focusItem: any; setValue: any; setValueFromUI: any; syncNumbers: any; setGhostText: any; getIconHoverCss(): string; getIconFocusCss(): string; } export declare class QuestionRanking extends QuestionRankingModel { _implementor: QuestionImplementor; protected onBaseCreating(): void; dispose(): void; koHandleKeydown: any; koHandlePointerDown: any; } export declare function property(options?: any): any; export declare function propertyArray(options?: IArrayPropertyDecoratorOptions): any; export declare function unwrap<T>(value: any): T; export declare function getSize(value: any): any; export declare function createPopupModalViewModel(componentName: string, data: any, onApply: any, onCancel?: any, onHide?: any, onShow?: any, cssClass?: string, title?: string, displayMode?: "popup" | "overlay"): PopupBaseViewModel; export declare function getCurrecyCodes(): Array<any>; export declare function showModal(componentName: string, data: any, onApply: any, onCancel?: any, cssClass?: string, title?: string, displayMode?: "popup" | "overlay"): void; /* * Global survey settings */ export declare var settings: { /* * Options for SurveyJS comparator. By default we trim strings and compare them as case insensitive. To change the behavior you can use following code: * settings.comparator.trimStrings = false; //"abc " will not equal to "abc". They are equal by default. * settings.comparator.caseSensitive = true; //"abc " will not equal to "Abc". They are equal by default. */ comparator: { trimStrings: boolean, caseSensitive: boolean, }, /* * The prefix that uses to store the question comment, as {questionName} + {commentPrefix}. * The default */ commentPrefix: string, /* * Encode parameter on calling restful web API */ webserviceEncodeParameters: boolean, /* * Cache the result for choices getting from web services. Set this property to false, to disable the caching. */ useCachingForChoicesRestful: boolean, useCachingForChoicesRestfull: boolean, /* * SurveyJS web service API url */ surveyServiceUrl: string, /* * separator that can allow to set value and text of ItemValue object in one string as: "value|text" */ itemValueSeparator: string, /* * Set it to true to serialize itemvalue instance always as object even if text property is empty * const item = new Survey.ItemValue(5); * item.toJSON(); //will return {value: 5}, instead of 5 by default. */ itemValueAlwaysSerializeAsObject: boolean, /* * Set it to true to serialize itemvalue text property, even if it is empty or equals to value * const item = new Survey.ItemValue("item1"); * item.toJSON(); //will return {value: item1, text: "item1"}, instead of "item1" by default. */ itemValueAlwaysSerializeText: boolean, /* * default locale name for localizable strings that uses during serialization, {"default": "My text", "de": "Mein Text"} */ defaultLocaleName: string, /* * Default row name for matrix (single choice) */ matrixDefaultRowName: string, /* * Default cell type for dropdown and dynamic matrices */ matrixDefaultCellType: string, /* * Total value postfix for dropdown and dynamic matrices. The total value stores as: {matrixName} + {postfix} */ matrixTotalValuePostFix: string, /* * Maximum row count in dynamic matrix */ matrixMaximumRowCount: number, /* * Maximum rowCount that returns in addConditionObjectsByContext function */ matrixMaxRowCountInCondition: number, /* * Set this property to false, to render matrix dynamic remove action as button. * It is rendered as icon in new themes ("defaultV2") by default. */ matrixRenderRemoveAsIcon: boolean, /* * Maximum panel count in dynamic panel */ panelMaximumPanelCount: number, /* * Maximum rate value count in rating question */ ratingMaximumRateValueCount: number, /* * Disable the question while choices are getting from the web service */ disableOnGettingChoicesFromWeb: boolean, /* * Set to true to always serialize the localization string as object even if there is only one value for default locale. Instead of string "MyStr" serialize as {default: "MyStr"} */ serializeLocalizableStringAsObject: boolean, /* * Set to false to hide empty page title and description in design mode */ allowShowEmptyTitleInDesignMode: boolean, /* * Set to false to hide empty page description in design mode */ allowShowEmptyDescriptionInDesignMode: boolean, /* * Set this property to true to execute the complete trigger on value change instead of on next page. */ executeCompleteTriggerOnValueChanged: boolean, /* * Set this property to false to execute the skip trigger on next page instead of on value change. */ executeSkipTriggerOnValueChanged: boolean, /* * Specifies how the input field of [Comment](https://surveyjs.io/Documentation/Library?id=questioncommentmodel) questions is rendered in the read-only mode. * Available values: * "textarea" (default) - A 'textarea' element is used to render a Comment question's input field. * "div" - A 'div' element is used to render a Comment question's input field. */ readOnlyCommentRenderMode: string, /* * Specifies how the input field of [Text](https://surveyjs.io/Documentation/Library?id=questiontextmodel) questions is rendered in the read-only mode. * Available values: * "input" (default) - An 'input' element is used to render a Text question's input field. * "div" - A 'div' element is used to render a Text question's input field. */ readOnlyTextRenderMode: string, /* * Override this function, set your function, if you want to show your own dialog confirm window instead of standard browser window. */ confirmActionFunc: any, /* * Set this property to change the default value of the minWidth constraint */ minWidth: string, /* * Set this property to change the default value of the minWidth constraint */ maxWidth: string, /* * This property tells how many times survey re-run expressions on value changes during condition running. We need it to avoid recursions in the expressions */ maximumConditionRunCountOnValueChanged: number, /* * By default visibleIndex for question with titleLocation = "hidden" is -1, and survey doesn't count these questions when set questions numbers. * Set it true, and a question next to a question with hidden title will increase it's number. */ setQuestionVisibleIndexForHiddenTitle: boolean, /* * By default visibleIndex for question with hideNumber = true is -1, and survey doesn't count these questions when set questions numbers. * Set it true, and a question next to a question with hidden title number will increase it's number. */ setQuestionVisibleIndexForHiddenNumber: boolean, /* * By default all rows are rendered no matters whwther they are visible. * Set it true, and survey markup rows will be rendered only if they are visible in viewport. * This feature is experimantal and might do not support all the use cases. */ lazyRowsRendering: boolean, lazyRowsRenderingStartRow: number, /* * By default checkbox and radiogroup items are ordered in rows. * Set it "column", and items will be ordered in columns. */ showItemsInOrder: string, /* * Supported validators by question types. You can modify this variable to add validators for new question types or add/remove for existing question types. */ supportedValidators: { question: any, comment: any, text: any, checkbox: any, imagepicker: any, }, /* * Set the value as string "yyyy-mm-dd". text questions with inputType "date" will not allow to set to survey date that less than this value */ minDate: string, /* * Set the value as string "yyyy-mm-dd". text questions with inputType "date" will not allow to set to survey date that greater than this value */ maxDate: string, showModal: any, supportCreatorV2: boolean, showDefaultItemsInCreatorV2: boolean, /* * Specifies a list of custom icons. * Use this property to replace SurveyJS default icons (displayed in UI elements of SurveyJS Library or Creator) with your custom icons. * For every default icon to replace, add a key/value object with the default icon's name as a key and the name of your custom icon as a value. * For example: Survey.settings.customIcons["icon-redo"] = "my-own-redo-icon" */ customIcons: any, titleTags: { survey: string, page: string, panel: string, question: string, }, }; export declare var surveyLocalization: { currentLocaleValue: string, defaultLocaleValue: string, locales: any, localeNames: any, supportedLocales: any, currentLocale: string, defaultLocale: string, getLocaleStrings: any, getCurrentStrings: any, getString: any, getLocales: any, }; export declare var surveyStrings: any; /* * An alias for the metadata object. It contains object properties' runtime information and allows you to modify it. */ export declare var Serializer: JsonMetadata; export declare var surveyBuiltInVarible: string; export declare var registerFunction: any; export declare var parse: any; export declare var defaultActionBarCss: { root: string, item: string, itemActive: string, itemPressed: string, itemIcon: string, itemTitle: string, itemTitleWithIcon: string, }; export declare var keyFocusedClassName: any; export declare var FOCUS_INPUT_SELECTOR: any; export declare var surveyCss: { currentType: string, getCss: any, }; export declare var defaultStandardCss: { root: string, container: string, header: string, body: string, bodyEmpty: string, footer: string, title: string, description: string, logo: string, logoImage: string, headerText: string, navigationButton: string, completedPage: string, navigation: { complete: string, prev: string, next: string, start: string, preview: string, edit: string, }, progress: string, progressBar: string, progressTextInBar: string, progressButtonsContainerCenter: string, progressButtonsContainer: string, progressButtonsImageButtonLeft: string, progressButtonsImageButtonRight: string, progressButtonsImageButtonHidden: string, progressButtonsListContainer: string, progressButtonsList: string, progressButtonsListElementPassed: string, progressButtonsListElementCurrent: string, progressButtonsListElementNonClickable: string, progressButtonsPageTitle: string, progressButtonsPageDescription: string, page: { root: string, title: string, description: string, }, pageTitle: string, pageDescription: string, row: string, question: { mainRoot: string, flowRoot: string, header: string, headerLeft: string, content: string, contentLeft: string, titleLeftRoot: string, requiredText: string, title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, number: string, description: string, comment: string, required: string, titleRequired: string, hasError: string, indent: number, footer: string, formGroup: string, asCell: string, icon: string, iconExpanded: string, disabled: string, }, panel: { title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, titleOnError: string, icon: string, iconExpanded: string, description: string, container: string, footer: string, number: string, requiredText: string, }, error: { root: string, icon: string, item: string, locationTop: string, locationBottom: string, }, boolean: { root: string, rootRadio: string, item: string, control: string, itemChecked: string, itemIndeterminate: string, itemDisabled: string, switch: string, slider: string, label: string, disabledLabel: string, materialDecorator: string, itemDecorator: string, checkedPath: string, uncheckedPath: string, indeterminatePath: string, }, checkbox: { root: string, item: string, itemSelectAll: string, itemNone: string, itemChecked: string, itemInline: string, label: string, labelChecked: string, itemControl: string, itemDecorator: string, controlLabel: string, other: string, column: string, }, ranking: { root: string, rootMobileMod: string, rootDragMod: string, rootDisabled: string, item: string, itemContent: string, itemIndex: string, controlLabel: string, itemGhostNode: string, itemIconContainer: string, itemIcon: string, itemIconHoverMod: string, itemIconFocusMod: string, itemGhostMod: string, itemDragMod: string, }, comment: string, dropdown: { root: string, control: string, selectWrapper: string, other: string, }, html: { root: string, }, image: { root: string, image: string, }, matrix: { root: string, label: string, itemChecked: string, itemDecorator: string, cell: string, cellText: string, cellTextSelected: string, cellLabel: string, cellResponsiveTitle: string, }, matrixdropdown: { root: string, cell: string, headerCell: string, row: string, rowAdditional: string, detailRow: string, detailRowText: string, detailCell: string, choiceCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, }, matrixdynamic: { root: string, button: string, buttonAdd: string, buttonRemove: string, iconAdd: string, iconRemove: string, iconDrag: string, cell: string, headerCell: string, row: string, detailRow: string, detailCell: string, choiceCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, emptyRowsSection: string, emptyRowsText: string, emptyRowsButton: string, ghostRow: string, }, paneldynamic: { root: string, title: string, button: string, buttonAdd: string, buttonRemove: string, buttonRemoveRight: string, buttonPrev: string, buttonPrevDisabled: string, buttonNextDisabled: string, buttonNext: string, progressContainer: string, progress: string, progressBar: string, progressText: string, panelWrapper: string, panelWrapperInRow: string, footer: string, progressBtnIcon: string, }, multipletext: { root: string, itemTitle: string, item: string, row: string, itemLabel: string, itemValue: string, }, radiogroup: { root: string, item: string, itemChecked: string, itemInline: string, itemDecorator: string, label: string, labelChecked: string, itemControl: string, controlLabel: string, other: string, clearButton: string, column: string, }, buttongroup: { root: string, item: string, itemIcon: string, itemDecorator: string, itemCaption: string, itemHover: string, itemSelected: string, itemDisabled: string, itemControl: string, }, imagepicker: { root: string, item: string, itemChecked: string, label: string, itemControl: string, image: string, itemInline: string, itemText: string, clearButton: string, column: string, }, rating: { root: string, item: string, selected: string, minText: string, itemText: string, maxText: string, }, text: string, expression: string, file: { root: string, placeholderInput: string, preview: string, removeButton: string, fileInput: string, removeFile: string, fileDecorator: string, fileSign: string, chooseFile: string, noFileChosen: string, dragAreaPlaceholder: string, fileList: string, }, signaturepad: { root: string, controls: string, placeholder: string, clearButton: string, }, saveData: { root: string, saving: string, error: string, success: string, saveAgainButton: string, }, window: { root: string, body: string, header: { root: string, title: string, button: string, buttonExpanded: string, buttonCollapsed: string, }, }, variables: { themeMark: string, }, }; export declare var surveyTimerFunctions: { setTimeout: any, clearTimeout: any, }; export declare var matrixDropdownColumnTypes: { dropdown: { onCellQuestionUpdate: any, }, checkbox: { onCellQuestionUpdate: any, }, radiogroup: { onCellQuestionUpdate: any, }, text: any, comment: any, boolean: { onCellQuestionUpdate: any, }, expression: any, rating: any, }; export declare var _isMobile: boolean; export declare var vendor: any; export declare var _IPad: boolean; export declare var IsMobile: boolean; export declare var _isTouch: boolean; export declare var IsTouch: boolean; export declare var minMaxTypes: any; export declare var youtubeTags: any; export declare var videoSuffics: any; export declare var defaultWidth: number; export declare var defaultHeight: number; export declare var Version: string; export declare var defaultBootstrapCss: { root: string, container: string, header: string, body: string, bodyEmpty: string, footer: string, title: string, description: string, logo: string, logoImage: string, headerText: string, navigationButton: string, completedPage: string, navigation: { complete: string, prev: string, next: string, start: string, preview: string, edit: string, }, progress: string, progressBar: string, progressTextUnderBar: string, progressTextInBar: string, progressButtonsContainerCenter: string, progressButtonsContainer: string, progressButtonsImageButtonLeft: string, progressButtonsImageButtonRight: string, progressButtonsImageButtonHidden: string, progressButtonsListContainer: string, progressButtonsList: string, progressButtonsListElementPassed: string, progressButtonsListElementCurrent: string, progressButtonsListElementNonClickable: string, progressButtonsPageTitle: string, progressButtonsPageDescription: string, page: { root: string, title: string, description: string, }, pageTitle: string, pageDescription: string, row: string, question: { mainRoot: string, flowRoot: string, header: string, headerLeft: string, content: string, contentLeft: string, titleLeftRoot: string, title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, number: string, description: string, descriptionUnderInput: string, requiredText: string, comment: string, required: string, titleRequired: string, hasError: string, indent: number, formGroup: string, }, panel: { title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, titleOnError: string, icon: string, iconExpanded: string, description: string, container: string, footer: string, number: string, requiredText: string, }, error: { root: string, icon: string, item: string, locationTop: string, locationBottom: string, }, boolean: { root: string, rootRadio: string, item: string, control: string, itemChecked: string, itemIndeterminate: string, itemDisabled: string, switch: string, slider: string, label: string, disabledLabel: string, materialDecorator: string, itemDecorator: string, checkedPath: string, uncheckedPath: string, indeterminatePath: string, }, checkbox: { root: string, item: string, itemChecked: string, itemSelectAll: string, itemNone: string, itemInline: string, itemControl: string, itemDecorator: string, label: string, labelChecked: string, controlLabel: string, materialDecorator: string, other: string, column: string, }, ranking: { root: string, rootMobileMod: string, rootDragMod: string, rootDisabled: string, item: string, itemContent: string, itemIndex: string, controlLabel: string, itemGhostNode: string, itemIconContainer: string, itemIcon: string, itemIconHoverMod: string, itemIconFocusMod: string, itemGhostMod: string, itemDragMod: string, }, comment: string, dropdown: { root: string, control: string, other: string, }, html: { root: string, }, image: { root: string, image: string, }, matrix: { root: string, label: string, itemChecked: string, itemDecorator: string, cellText: string, cellTextSelected: string, cellLabel: string, cellResponsiveTitle: string, }, matrixdropdown: { root: string, cell: string, headerCell: string, row: string, rowAdditional: string, detailRow: string, detailRowText: string, detailCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, }, matrixdynamic: { root: string, button: string, buttonAdd: string, buttonRemove: string, iconAdd: string, iconRemove: string, iconDrag: string, headerCell: string, row: string, detailRow: string, detailCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, emptyRowsSection: string, emptyRowsText: string, emptyRowsButton: string, ghostRow: string, }, paneldynamic: { root: string, navigation: string, progressTop: string, progressBottom: string, title: string, button: string, buttonAdd: string, buttonRemove: string, buttonRemoveRight: string, buttonPrev: string, buttonNext: string, buttonPrevDisabled: string, buttonNextDisabled: string, progressContainer: string, progress: string, progressBar: string, progressText: string, panelWrapper: string, panelWrapperInRow: string, footer: string, progressBtnIcon: string, }, multipletext: { root: string, itemTitle: string, item: string, itemLabel: string, row: string, itemValue: string, }, radiogroup: { root: string, item: string, itemChecked: string, itemInline: string, label: string, labelChecked: string, itemControl: string, itemDecorator: string, controlLabel: string, materialDecorator: string, other: string, clearButton: string, column: string, }, buttongroup: { root: string, item: string, itemIcon: string, itemDecorator: string, itemCaption: string, itemHover: string, itemSelected: string, itemDisabled: string, itemControl: string, }, imagepicker: { root: string, item: string, itemChecked: string, itemInline: string, label: string, itemControl: string, image: string, itemText: string, clearButton: string, }, rating: { root: string, item: string, selected: string, minText: string, itemText: string, maxText: string, disabled: string, }, text: string, expression: string, file: { root: string, placeholderInput: string, preview: string, removeButton: string, fileInput: string, removeFile: string, fileDecorator: string, fileSign: string, removeButtonBottom: string, dragAreaPlaceholder: string, fileList: string, }, signaturepad: { root: string, controls: string, placeholder: string, clearButton: string, }, saveData: { root: string, saving: string, error: string, success: string, saveAgainButton: string, }, window: { root: string, body: string, header: { root: string, title: string, button: string, buttonExpanded: string, buttonCollapsed: string, }, }, }; export declare var defaultBootstrapMaterialCss: { root: string, container: string, header: string, body: string, bodyEmpty: string, footer: string, title: string, description: string, logo: string, logoImage: string, headerText: string, navigationButton: string, completedPage: string, navigation: { complete: string, prev: string, next: string, start: string, preview: string, edit: string, }, progress: string, progressBar: string, progressTextUnderBar: string, progressTextInBar: string, progressButtonsContainerCenter: string, progressButtonsContainer: string, progressButtonsImageButtonLeft: string, progressButtonsImageButtonRight: string, progressButtonsImageButtonHidden: string, progressButtonsListContainer: string, progressButtonsList: string, progressButtonsListElementPassed: string, progressButtonsListElementCurrent: string, progressButtonsListElementNonClickable: string, progressButtonsPageTitle: string, progressButtonsPageDescription: string, page: { root: string, title: string, description: string, }, pageTitle: string, pageDescription: string, row: string, question: { mainRoot: string, flowRoot: string, header: string, headerLeft: string, content: string, contentLeft: string, titleLeftRoot: string, requiredText: string, title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, number: string, description: string, descriptionUnderInput: string, comment: string, required: string, titleRequired: string, hasError: string, indent: number, formGroup: string, }, panel: { title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, titleOnError: string, icon: string, iconExpanded: string, description: string, container: string, footer: string, number: string, requiredText: string, }, error: { root: string, icon: string, item: string, locationTop: string, locationBottom: string, }, boolean: { root: string, rootRadio: string, item: string, control: string, itemChecked: string, itemIndeterminate: string, itemDisabled: string, switch: string, slider: string, label: string, disabledLabel: string, materialDecorator: string, itemDecorator: string, checkedPath: string, uncheckedPath: string, indeterminatePath: string, }, checkbox: { root: string, item: string, itemChecked: string, itemSelectAll: string, itemNone: string, itemInline: string, itemDecorator: string, itemControl: string, label: string, labelChecked: string, controlLabel: string, materialDecorator: string, other: string, column: string, }, ranking: { root: string, rootMobileMod: string, rootDragMod: string, rootDisabled: string, item: string, itemContent: string, itemIndex: string, controlLabel: string, itemGhostNode: string, itemIconContainer: string, itemIcon: string, itemIconHoverMod: string, itemIconFocusMod: string, itemGhostMod: string, itemDragMod: string, }, comment: string, dropdown: { root: string, control: string, other: string, }, html: { root: string, }, image: { root: string, image: string, }, matrix: { root: string, row: string, label: string, cellText: string, cellTextSelected: string, cellLabel: string, itemValue: string, itemChecked: string, itemDecorator: string, materialDecorator: string, cellResponsiveTitle: string, }, matrixdropdown: { root: string, itemValue: string, headerCell: string, row: string, rowAdditional: string, detailRow: string, detailRowText: string, detailCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, }, matrixdynamic: { mainRoot: string, flowRoot: string, root: string, button: string, itemValue: string, buttonAdd: string, buttonRemove: string, iconAdd: string, iconRemove: string, iconDrag: string, headerCell: string, row: string, detailRow: string, detailCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, emptyRowsSection: string, emptyRowsText: string, emptyRowsButton: string, ghostRow: string, }, paneldynamic: { root: string, navigation: string, progressTop: string, progressBottom: string, title: string, button: string, buttonAdd: string, buttonRemove: string, buttonRemoveRight: string, buttonPrev: string, buttonNext: string, buttonPrevDisabled: string, buttonNextDisabled: string, progressContainer: string, progress: string, progressBar: string, progressText: string, panelWrapper: string, panelWrapperInRow: string, progressBtnIcon: string, footer: string, }, multipletext: { root: string, itemTitle: string, item: string, itemLabel: string, row: string, itemValue: string, }, radiogroup: { root: string, item: string, itemChecked: string, itemInline: string, itemDecorator: string, label: string, labelChecked: string, itemControl: string, controlLabel: string, materialDecorator: string, other: string, clearButton: string, column: string, }, buttongroup: { root: string, item: string, itemIcon: string, itemDecorator: string, itemCaption: string, itemSelected: string, itemHover: string, itemDisabled: string, itemControl: string, }, imagepicker: { root: string, item: string, itemChecked: string, itemInline: string, label: string, itemControl: string, image: string, itemText: string, clearButton: string, }, rating: { root: string, item: string, selected: string, minText: string, itemText: string, maxText: string, disabled: string, }, text: string, expression: string, file: { root: string, placeholderInput: string, preview: string, removeButton: string, fileInput: string, fileSign: string, removeFile: string, fileDecorator: string, removeButtonBottom: string, dragAreaPlaceholder: string, fileList: string, }, signaturepad: { root: string, controls: string, placeholder: string, clearButton: string, }, saveData: { root: string, saving: string, error: string, success: string, saveAgainButton: string, }, window: { root: string, body: string, header: { root: string, title: string, button: string, buttonExpanded: string, buttonCollapsed: string, }, }, }; export declare var defaultV2Css: { root: string, rootMobile: string, container: string, header: string, body: string, bodyEmpty: string, footer: string, title: string, description: string, logo: string, logoImage: string, headerText: string, navigationButton: string, bodyNavigationButton: string, completedPage: string, timerRoot: string, navigation: { complete: string, prev: string, next: string, start: string, preview: string, edit: string, }, panel: { title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, titleOnExpand: string, titleOnError: string, description: string, container: string, withFrame: string, content: string, icon: string, iconExpanded: string, footer: string, requiredText: string, header: string, collapsed: string, nested: string, invisible: string, navigationButton: string, }, paneldynamic: { mainRoot: string, empty: string, root: string, navigation: string, title: string, button: string, buttonRemove: string, buttonAdd: string, buttonPrev: string, buttonPrevDisabled: string, buttonNextDisabled: string, buttonNext: string, progressContainer: string, progress: string, progressBar: string, progressText: string, separator: string, panelWrapper: string, footer: string, footerButtonsContainer: string, panelWrapperInRow: string, progressBtnIcon: string, noEntriesPlaceholder: string, }, progress: string, progressBar: string, progressText: string, progressButtonsContainerCenter: string, progressButtonsContainer: string, progressButtonsImageButtonLeft: string, progressButtonsImageButtonRight: string, progressButtonsImageButtonHidden: string, progressButtonsListContainer: string, progressButtonsList: string, progressButtonsListElementPassed: string, progressButtonsListElementCurrent: string, progressButtonsListElementNonClickable: string, progressButtonsPageTitle: string, progressButtonsPageDescription: string, progressTextInBar: string, page: { root: string, title: string, description: string, }, pageTitle: string, pageDescription: string, row: string, rowMultiple: string, question: { mainRoot: string, flowRoot: string, withFrame: string, asCell: string, answered: string, header: string, headerLeft: string, headerTop: string, headerBottom: string, content: string, contentLeft: string, titleLeftRoot: string, titleOnAnswer: string, titleOnError: string, title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, requiredText: string, number: string, description: string, descriptionUnderInput: string, comment: string, other: string, required: string, titleRequired: string, indent: number, footer: string, formGroup: string, hasError: string, disabled: string, collapsed: string, nested: string, invisible: string, }, image: { mainRoot: string, root: string, image: string, adaptive: string, withFrame: string, }, html: { mainRoot: string, root: string, withFrame: string, }, error: { root: string, icon: string, item: string, tooltip: string, aboveQuestion: string, locationTop: string, locationBottom: string, }, checkbox: { root: string, rootMultiColumn: string, item: string, itemOnError: string, itemSelectAll: string, itemNone: string, itemDisabled: string, itemChecked: string, itemHover: string, itemInline: string, label: string, labelChecked: string, itemControl: string, itemDecorator: string, itemSvgIconId: string, controlLabel: string, materialDecorator: string, other: string, column: string, }, radiogroup: { root: string, rootMultiColumn: string, item: string, itemOnError: string, itemInline: string, label: string, labelChecked: string, itemDisabled: string, itemChecked: string, itemHover: string, itemControl: string, itemDecorator: string, controlLabel: string, materialDecorator: string, other: string, clearButton: string, column: string, }, boolean: { mainRoot: string, root: string, rootRadio: string, item: string, radioItem: string, radioItemChecked: string, radioLabel: string, radioControlLabel: string, radioFieldset: string, itemOnError: string, control: string, itemChecked: string, itemIndeterminate: string, itemDisabled: string, label: string, switch: string, disabledLabel: string, itemDecorator: string, materialDecorator: string, itemRadioDecorator: string, materialRadioDecorator: string, sliderText: string, slider: string, itemControl: string, }, text: { root: string, small: string, controlDisabled: string, onError: string, }, multipletext: { root: string, itemLabel: string, itemLabelOnError: string, item: string, itemTitle: string, row: string, cell: string, }, dropdown: { root: string, small: string, selectWrapper: string, other: string, onError: string, label: string, item: string, itemDisabled: string, itemChecked: string, itemHover: string, itemControl: string, itemDecorator: string, control: string, controlDisabled: string, controlEmpty: string, controlLabel: string, materialDecorator: string, }, imagepicker: { mainRoot: string, root: string, rootColumn: string, item: string, itemOnError: string, itemInline: string, itemChecked: string, itemDisabled: string, itemHover: string, label: string, itemDecorator: string, imageContainer: string, itemControl: string, image: string, itemText: string, clearButton: string, other: string, itemNoImage: string, itemNoImageSvgIcon: string, itemNoImageSvgIconId: string, column: string, }, matrix: { mainRoot: string, tableWrapper: string, root: string, rowError: string, cell: string, headerCell: string, label: string, itemOnError: string, itemValue: string, itemChecked: string, itemDisabled: string, itemHover: string, materialDecorator: string, itemDecorator: string, cellText: string, cellTextSelected: string, cellTextDisabled: string, cellResponsiveTitle: string, }, matrixdropdown: { mainRoot: string, rootScroll: string, root: string, cell: string, headerCell: string, rowTextCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailIconId: string, detailIconExpandedId: string, actionsCell: string, emptyCell: string, verticalCell: string, cellQuestionWrapper: string, }, matrixdynamic: { mainRoot: string, rootScroll: string, empty: string, root: string, cell: string, headerCell: string, rowTextCell: string, button: string, detailRow: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailIconId: string, detailIconExpandedId: string, detailPanelCell: string, actionsCell: string, buttonAdd: string, buttonRemove: string, iconAdd: string, iconRemove: string, dragElementDecorator: string, iconDragElement: string, footer: string, emptyRowsSection: string, iconDrag: string, ghostRow: string, emptyCell: string, verticalCell: string, cellQuestionWrapper: string, }, rating: { rootDropdown: string, root: string, rootWrappable: string, item: string, itemOnError: string, itemHover: string, selected: string, minText: string, itemText: string, maxText: string, itemDisabled: string, control: string, controlDisabled: string, controlEmpty: string, onError: string, }, comment: { root: string, small: string, controlDisabled: string, onError: string, }, expression: string, file: { root: string, other: string, placeholderInput: string, preview: string, fileSign: string, fileList: string, fileSignBottom: string, fileDecorator: string, onError: string, fileDecoratorDrag: string, fileInput: string, noFileChosen: string, chooseFile: string, chooseFileAsText: string, chooseFileAsTextDisabled: string, chooseFileAsIcon: string, chooseFileIconId: string, disabled: string, removeButton: string, removeButtonBottom: string, removeButtonIconId: string, removeFile: string, removeFileSvg: string, removeFileSvgIconId: string, wrapper: string, defaultImage: string, defaultImageIconId: string, leftIconId: string, rightIconId: string, removeFileButton: string, dragAreaPlaceholder: string, imageWrapper: string, single: string, singleImage: string, mobile: string, }, signaturepad: { mainRoot: string, root: string, small: string, controls: string, placeholder: string, clearButton: string, clearButtonIconId: string, }, saveData: { root: string, saving: string, error: string, success: string, saveAgainButton: string, }, window: { root: string, body: string, header: { root: string, title: string, button: string, buttonExpanded: string, buttonCollapsed: string, }, }, ranking: { root: string, rootMobileMod: string, rootDragMod: string, rootDisabled: string, item: string, itemContent: string, itemIndex: string, controlLabel: string, itemGhostNode: string, itemIconContainer: string, itemIcon: string, itemIconHoverMod: string, itemIconFocusMod: string, itemGhostMod: string, itemDragMod: string, itemOnError: string, }, buttongroup: { root: string, item: string, itemIcon: string, itemDecorator: string, itemCaption: string, itemHover: string, itemSelected: string, itemDisabled: string, itemControl: string, }, actionBar: { root: string, item: string, itemPressed: string, itemAsIcon: string, itemIcon: string, itemTitle: string, }, variables: { mobileWidth: string, imagepickerGapBetweenItems: string, themeMark: string, }, }; export declare var modernCss: { root: string, timerRoot: string, container: string, header: string, headerClose: string, body: string, bodyEmpty: string, footer: string, title: string, description: string, logo: string, logoImage: string, headerText: string, navigationButton: string, completedPage: string, navigation: { complete: string, prev: string, next: string, start: string, preview: string, edit: string, }, panel: { title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, titleOnError: string, description: string, container: string, content: string, icon: string, iconExpanded: string, footer: string, requiredText: string, number: string, }, paneldynamic: { root: string, navigation: string, title: string, button: string, buttonRemove: string, buttonRemoveRight: string, buttonAdd: string, progressTop: string, progressBottom: string, buttonPrev: string, buttonNext: string, buttonPrevDisabled: string, buttonNextDisabled: string, progressContainer: string, progress: string, progressBar: string, progressText: string, separator: string, panelWrapper: string, panelWrapperInRow: string, progressBtnIcon: string, footer: string, }, progress: string, progressBar: string, progressText: string, progressTextInBar: string, progressButtonsContainerCenter: string, progressButtonsContainer: string, progressButtonsImageButtonLeft: string, progressButtonsImageButtonRight: string, progressButtonsImageButtonHidden: string, progressButtonsListContainer: string, progressButtonsList: string, progressButtonsListElementPassed: string, progressButtonsListElementCurrent: string, progressButtonsListElementNonClickable: string, progressButtonsPageTitle: string, progressButtonsPageDescription: string, page: { root: string, title: string, description: string, }, pageTitle: string, pageDescription: string, row: string, question: { mainRoot: string, flowRoot: string, asCell: string, header: string, headerLeft: string, headerTop: string, headerBottom: string, content: string, contentLeft: string, titleLeftRoot: string, answered: string, titleOnAnswer: string, titleOnError: string, title: string, titleExpandable: string, titleExpanded: string, titleCollapsed: string, icon: string, iconExpanded: string, requiredText: string, number: string, description: string, descriptionUnderInput: string, comment: string, required: string, titleRequired: string, indent: number, footer: string, formGroup: string, hasError: string, disabled: string, }, image: { root: string, image: string, }, error: { root: string, icon: string, item: string, locationTop: string, locationBottom: string, }, checkbox: { root: string, item: string, itemSelectAll: string, itemNone: string, itemDisabled: string, itemChecked: string, itemHover: string, itemInline: string, label: string, labelChecked: string, itemControl: string, itemDecorator: string, itemSvgIconId: string, controlLabel: string, materialDecorator: string, other: string, column: string, }, ranking: { root: string, rootMobileMod: string, rootDragMod: string, rootDisabled: string, item: string, itemContent: string, itemIndex: string, controlLabel: string, itemGhostNode: string, itemIconContainer: string, itemIcon: string, itemIconHoverMod: string, itemIconFocusMod: string, itemGhostMod: string, itemDragMod: string, }, radiogroup: { root: string, item: string, itemInline: string, label: string, labelChecked: string, itemDisabled: string, itemChecked: string, itemHover: string, itemControl: string, itemDecorator: string, itemSvgIconId: string, controlLabel: string, materialDecorator: string, other: string, clearButton: string, column: string, }, buttongroup: { root: string, item: string, itemIcon: string, itemDecorator: string, itemCaption: string, itemSelected: string, itemHover: string, itemDisabled: string, itemControl: string, }, boolean: { root: string, rootRadio: string, small: string, item: string, control: string, itemChecked: string, itemIndeterminate: string, itemDisabled: string, switch: string, slider: string, label: string, disabledLabel: string, materialDecorator: string, itemDecorator: string, checkedPath: string, uncheckedPath: string, indeterminatePath: string, }, text: { root: string, small: string, onError: string, }, multipletext: { root: string, item: string, itemLabel: string, itemTitle: string, row: string, cell: string, }, dropdown: { root: string, small: string, control: string, selectWrapper: string, other: string, onError: string, }, imagepicker: { root: string, column: string, item: string, itemInline: string, itemChecked: string, itemDisabled: string, itemHover: string, label: string, itemControl: string, image: string, itemText: string, clearButton: string, other: string, }, matrix: { tableWrapper: string, root: string, rowError: string, cell: string, headerCell: string, label: string, itemValue: string, itemChecked: string, itemDisabled: string, itemHover: string, materialDecorator: string, itemDecorator: string, cellText: string, cellTextSelected: string, cellTextDisabled: string, cellResponsiveTitle: string, itemSvgIconId: string, }, matrixdropdown: { root: string, cell: string, headerCell: string, row: string, rowAdditional: string, detailRow: string, detailRowText: string, detailCell: string, choiceCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, }, matrixdynamic: { root: string, cell: string, headerCell: string, button: string, buttonAdd: string, buttonRemove: string, iconAdd: string, iconRemove: string, iconDrag: string, row: string, detailRow: string, detailCell: string, choiceCell: string, detailButton: string, detailButtonExpanded: string, detailIcon: string, detailIconExpanded: string, detailPanelCell: string, actionsCell: string, emptyRowsSection: string, emptyRowsText: string, emptyRowsButton: string, ghostRow: string, }, rating: { root: string, item: string, selected: string, minText: string, itemText: string, maxText: string, itemDisabled: string, }, comment: { root: string, small: string, }, expression: string, file: { root: string, other: string, placeholderInput: string, preview: string, fileSignBottom: string, fileDecorator: string, fileInput: string, noFileChosen: string, chooseFile: string, controlDisabled: string, removeButton: string, removeButtonBottom: string, removeFile: string, removeFileSvg: string, removeFileSvgIconId: string, wrapper: string, dragAreaPlaceholder: string, fileList: string, }, signaturepad: { root: string, small: string, controls: string, placeholder: string, clearButton: string, }, saveData: { root: string, saving: string, error: string, success: string, saveAgainButton: string, }, window: { root: string, body: string, header: { root: string, title: string, button: string, buttonExpanded: string, buttonCollapsed: string, }, }, variables: { themeMark: string, }, }; export declare var SvgRegistry: SvgIconRegistry; export declare var SvgBundleViewModel: any; export declare var path: any; export declare var koTemplate: any; export declare var registerTemplateEngine: any; export declare var template: any; export declare var ActionBarItemViewModel: any; export declare var ActionBarItemDropdownViewModel: any; export declare var ActionBarSeparatorViewModel: any; export declare var CheckboxViewModel: any; export declare var BooleanRadioItemViewModel: any; export declare var BooleanRadioViewModel: any; export declare var templateBridge: any; export declare var TitleElementViewModel: any; export declare var TitleContentViewModel: any; export declare var TitleActionViewModel: any; export declare var StringViewerViewModel: any; export declare var LogoImageViewModel: any; export declare var Skeleton: any; export declare var RatingDropdownViewModel: any; export declare var DropdownViewModel: any; export declare var DropdownSelectViewModel: any; export declare var ListItemViewComponent: any; export declare var ListViewComponent: any; export declare var SvgIconViewModel: any; export declare var SurveyQuestionMatrixDynamicRemoveButton: any; export declare var SurveyQuestionMatrixDetailButton: any; export declare var SurveyQuestionMatrixDynamicDragDropIcon: any; export declare var SurveyNavigationButton: any; export declare var addBtnTemplate: any; export declare var nextBtnTemplate: any; export declare var prevBtnTemplate: any; export declare var progressTextTemplate: any; export declare var SurveyQuestionPaneldynamicActioons: any;
{ "content_hash": "c6b596a7829a985f5c9fa5077aa93b0f", "timestamp": "", "source": "github", "line_count": 10910, "max_line_length": 440, "avg_line_length": 36.699450045829515, "alnum_prop": 0.7315274319352832, "repo_name": "cdnjs/cdnjs", "id": "3534a1fadb687ff8bb176228d21d688d490e18b6", "size": "400602", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ajax/libs/survey-knockout/1.9.29/survey.ko.d.ts", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package org.apache.camel.spring; import org.apache.camel.spring.JettyDefinition.FromJettyDefinition; import org.apache.camel.spring.JettyDefinition.ToJettyDefinition; import static org.apache.camel.spring.XmlUtil.unmarshal; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.is; import org.junit.Test; /** * @author yihtserns */ public class JettyDefinitionTest { @Test public void shouldConvertAllFromJettyAttributesToUri() throws Exception { String xml = "<jetty xmlns=\"http://camel.apache.org/schema/spring/consumers\"" + " url=\"http://example.org\"" + " bridgeEndpoint=\"false\"" + " chunked=\"true\"" + " continuationTimeout=\"30000\"" + " disableStreamCache=\"false\"" + " enableCORS=\"false\"" + " enableJmx=\"false\"" + " enableMultipartFilter=\"true\"" + " filtersRef=\"filters\"" + " handlers=\"#handler1,#handler2\"" + " headerFilterStrategy=\"#headerFilter\"" + " httpBindingRef=\"httpBinding\"" + " httpMethodRestrict=\"POST,GET\"" + " matchOnUriPrefix=\"false\"" + " multipartFilterRef=\"multipartFilter\"" + " responseBufferSize=\"1024\"" + " sendDateHeader=\"false\"" + " sendServerVersion=\"true\"" + " sessionSupport=\"false\"" + " sslContextParametersRef=\"sslParams\"" + " traceEnabled=\"false\"" + " transferException=\"false\"" + " useContinuation=\"true\"" + "/>"; FromJettyDefinition definition = unmarshal(xml, FromJettyDefinition.class); assertThat(definition.getUri(), is("jetty:http://example.org" + "?bridgeEndpoint=false" + "&chunked=true" + "&continuationTimeout=30000" + "&disableStreamCache=false" + "&enableCORS=false" + "&enableJmx=false" + "&enableMultipartFilter=true" + "&filtersRef=filters" + "&handlers=#handler1,#handler2" + "&headerFilterStrategy=#headerFilter" + "&httpBindingRef=httpBinding" + "&httpMethodRestrict=POST,GET" + "&matchOnUriPrefix=false" + "&multipartFilterRef=multipartFilter" + "&responseBufferSize=1024" + "&sendDateHeader=false" + "&sendServerVersion=true" + "&sessionSupport=false" + "&sslContextParametersRef=sslParams" + "&traceEnabled=false" + "&transferException=false" + "&useContinuation=true")); } @Test public void shouldConvertAllToJettyAttributesToUri() throws Exception { String xml = "<jetty xmlns=\"http://camel.apache.org/schema/spring/producers\"" + " xmlns:dynattr=\"http://camel.apache.org/schema/spring/dynamic-attributes\"" + " url=\"http://example.org\"" + " bridgeEndpoint=\"false\"" + " enableJmx=\"false\"" + " headerFilterStrategy=\"#headerFilter\"" + " httpClient=\"#httpClient\"" + " dynattr:httpClient.soTimeout=\"30000\"" + " httpClientMaxThreads=\"254\"" + " httpClientMinThreads=\"8\"" + " jettyHttpBindingRef=\"jettyHttpBinding\"" + " proxyHost=\"localhost\"" + " proxyPort=\"8888\"" + " responseBufferSize=\"1024\"" + " sslContextParametersRef=\"#sslParams\"" + " throwExceptionOnFailure=\"true\"" + " transferException=\"false\"" + " urlRewrite=\"#urlRewriter\"" + "/>"; ToJettyDefinition definition = unmarshal(xml, ToJettyDefinition.class); assertThat(definition.getUri(), is("jetty:http://example.org" + "?bridgeEndpoint=false" + "&enableJmx=false" + "&headerFilterStrategy=#headerFilter" + "&httpClient=#httpClient" + "&httpClient.soTimeout=30000" + "&httpClientMaxThreads=254" + "&httpClientMinThreads=8" + "&jettyHttpBindingRef=jettyHttpBinding" + "&proxyHost=localhost" + "&proxyPort=8888" + "&responseBufferSize=1024" + "&sslContextParametersRef=#sslParams" + "&throwExceptionOnFailure=true" + "&transferException=false" + "&urlRewrite=#urlRewriter")); } }
{ "content_hash": "d74f3e05d1fefcf7ad01a094804dc6e4", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 95, "avg_line_length": 44.06363636363636, "alnum_prop": 0.5263049308850836, "repo_name": "yihtserns/camel-spring-components", "id": "d9873a83fbf6813fec485182a50fdeaf8d4d7338", "size": "5441", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/test/java/org/apache/camel/spring/JettyDefinitionTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "47762" }, { "name": "XSLT", "bytes": "1166" } ], "symlink_target": "" }
from application import application as app import settings import request import database if __name__ == "__main__": database.init_db() app.run()
{ "content_hash": "9854b3d52837a5b1e787c549f99816fa", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 42, "avg_line_length": 19.375, "alnum_prop": 0.6967741935483871, "repo_name": "peixinchen/TravisCITest", "id": "5d5da0500230fe95d6b72b6e5ac9fa9caf8330c6", "size": "155", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/togo/togo.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "919" }, { "name": "Python", "bytes": "4586" } ], "symlink_target": "" }
package tag import ( "github.com/MerinEREN/iiPackages/datastore/tag" "github.com/MerinEREN/iiPackages/session" "log" "net/http" "strings" ) // Handler handles delete request to delete a tag by the given id as encoded datastore key. func Handler(s *session.Session) { ID := strings.Split(s.R.URL.Path, "/")[2] if ID == "" { log.Printf("Path: %s, Error: no tag ID\n", s.R.URL.Path) http.Error(s.W, "No tag ID", http.StatusBadRequest) return } switch s.R.Method { case "DELETE": err := tag.Delete(s.Ctx, ID) if err != nil { log.Printf("Path: %s, Error: %v\n", s.R.URL.Path, err) http.Error(s.W, err.Error(), http.StatusInternalServerError) return } s.W.WriteHeader(http.StatusNoContent) default: // Handles "PUT" requests } }
{ "content_hash": "e29320cc6f0ba61209492ba99c91b2fe", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 91, "avg_line_length": 24.580645161290324, "alnum_prop": 0.6666666666666666, "repo_name": "MerinEREN/iiPackages", "id": "880391fd6ed63d8377d4f022ee92875332835a86", "size": "833", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "api/tag/handler.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "205076" } ], "symlink_target": "" }
module PastaSpecHelper def how_many_include(target_str, included_str) original_size = target_str.size target_str.delete(included_str) return (original_size - target_str.size) end def how_many_include_in_string(target_str, included_str) how_many_include(target_str.split(''), included_str) end # 対象の文字列に含まれる文字の種類 def char_type(target_str) target_str.uniq.size end end
{ "content_hash": "6c52bdbb33407dac86c40fcd7129f3de", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 58, "avg_line_length": 25.1875, "alnum_prop": 0.71712158808933, "repo_name": "ShinSemiya/pasta_detective", "id": "2985f4f4e8257b5790de6a8b8188289ddbc3da52", "size": "435", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/lib/pasta_spec_helper.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "13084" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.carlspring.strongbox</groupId> <artifactId>strongbox-parent</artifactId> <version>1.0-SNAPSHOT</version> <relativePath/> </parent> <artifactId>strongbox-maven-metadata-api</artifactId> <version>1.0-SNAPSHOT</version> <name>Strongbox: Metadata [Maven API]</name> <licenses> <license> <name>Apache 2.0</name> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> <comments>A business-friendly OSS license</comments> </license> </licenses> <organization> <name>Carlspring Consulting &amp; Development Ltd.</name> <url>http://www.carlspring.org/</url> </organization> <inceptionYear>2019</inceptionYear> <scm> <url>https://github.com/strongbox/strongbox/</url> <connection>scm:git:git://github.com/strongbox/strongbox.git</connection> <developerConnection>scm:git:git://github.com/strongbox/strongbox.git</developerConnection> </scm> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>${project.groupId}</groupId> <artifactId>strongbox-commons</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>${project.groupId}</groupId> <artifactId>strongbox-common-resources</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </dependency> <dependency> <groupId>org.apache.maven.indexer</groupId> <artifactId>indexer-core</artifactId> </dependency> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-core</artifactId> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> </dependency> <dependency> <groupId>org.objenesis</groupId> <artifactId>objenesis</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> </dependency> </dependencies> </project>
{ "content_hash": "c84025fa07da4eab740615ea2a2834ac", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 108, "avg_line_length": 32.69166666666667, "alnum_prop": 0.5806780525108336, "repo_name": "strongbox/strongbox", "id": "06a8ecc0f22fbbe8486da7c80d503e6e3a8a2336", "size": "3923", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "strongbox-storage/strongbox-storage-layout-providers/strongbox-storage-maven-layout/strongbox-maven-metadata-api/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "808" }, { "name": "Groovy", "bytes": "4637" }, { "name": "HTML", "bytes": "8895" }, { "name": "Java", "bytes": "4154989" }, { "name": "JavaScript", "bytes": "4698" }, { "name": "Shell", "bytes": "570" } ], "symlink_target": "" }
// Copyright 2014 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.lib.rules.objc; import com.google.common.collect.ImmutableList; /** * Represents the name of an SDK framework. * <p> * Besides being a glorified String, this class prevents you from adding framework names to an * argument list without explicitly specifying how to prefix them. */ final class SdkFramework extends Value<SdkFramework> { private final String name; public SdkFramework(String name) { super(name); this.name = name; } public String getName() { return name; } /** Returns an iterable which contains the name of each given framework in the same order. */ static ImmutableList<String> names(Iterable<SdkFramework> frameworks) { ImmutableList.Builder<String> result = new ImmutableList.Builder<>(); for (SdkFramework framework : frameworks) { result.add(framework.getName()); } return result.build(); } }
{ "content_hash": "97aa3fb5f20cdb932eb44411156e8f85", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 95, "avg_line_length": 33.84444444444444, "alnum_prop": 0.7321076822061721, "repo_name": "damienmg/bazel", "id": "337af77f740754b4c16918d34e45c7bbbb2c1cf9", "size": "1523", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "src/main/java/com/google/devtools/build/lib/rules/objc/SdkFramework.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "14332" }, { "name": "C++", "bytes": "1010722" }, { "name": "HTML", "bytes": "20974" }, { "name": "Java", "bytes": "26224225" }, { "name": "JavaScript", "bytes": "9186" }, { "name": "Makefile", "bytes": "248" }, { "name": "PowerShell", "bytes": "5473" }, { "name": "Python", "bytes": "606463" }, { "name": "Roff", "bytes": "511" }, { "name": "Shell", "bytes": "964833" } ], "symlink_target": "" }
// Copyright 2013 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.content.browser.picker; import android.os.Build; import android.widget.DatePicker; import android.widget.DatePicker.OnDateChangedListener; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; import java.util.TimeZone; /** * Sets the current, min, and max values on the given DatePicker. */ public class DateDialogNormalizer { /** * Stores a date (year-month-day) and the number of milliseconds corresponding to that date * according to the DatePicker's calendar. */ private static class DateAndMillis { /** * Number of milliseconds from the epoch (1970-01-01) to the beginning of year-month-day * in the default time zone (TimeZone.getDefault()) using the Julian/Gregorian split * calendar. This value is interopable with {@link DatePicker#getMinDate} and * {@link DatePicker#setMinDate}. */ public final long millisForPicker; public final int year; public final int month; // 0-based public final int day; DateAndMillis(long millisForPicker, int year, int month, int day) { this.millisForPicker = millisForPicker; this.year = year; this.month = month; this.day = day; } static DateAndMillis create(long millisUtc) { // millisUtc uses the Gregorian calendar only, so disable the Julian changeover date. GregorianCalendar utcCal = new GregorianCalendar(TimeZone.getTimeZone("UTC")); utcCal.setGregorianChange(new Date(Long.MIN_VALUE)); utcCal.setTimeInMillis(millisUtc); int year = utcCal.get(Calendar.YEAR); int month = utcCal.get(Calendar.MONTH); int day = utcCal.get(Calendar.DAY_OF_MONTH); return create(year, month, day); } static DateAndMillis create(int year, int month, int day) { // By contrast, millisForPicker uses the default Gregorian/Julian changeover date. Calendar defaultTimeZoneCal = Calendar.getInstance(TimeZone.getDefault()); defaultTimeZoneCal.clear(); defaultTimeZoneCal.set(year, month, day); long millisForPicker = defaultTimeZoneCal.getTimeInMillis(); return new DateAndMillis(millisForPicker, year, month, day); } } private static void setLimits(DatePicker picker, long currentMillisForPicker, long minMillisForPicker, long maxMillisForPicker) { // On Lollipop only (not KitKat or Marshmallow), DatePicker has terrible performance for // large date ranges. This causes problems when the min or max date isn't set in HTML, in // which case these values default to the min and max possible values for the JavaScript // Date object (1CE and 275760CE). As a workaround, limit the date range to 5000 years // before and after the current date. In practice, this doesn't limit users since scrolling // through 5000 years in the DatePicker is highly impractical anyway. See // http://crbug.com/441060 if (Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP || Build.VERSION.SDK_INT == Build.VERSION_CODES.LOLLIPOP_MR1) { final long maxRangeMillis = 5000L * 365 * 24 * 60 * 60 * 1000; minMillisForPicker = Math.max(minMillisForPicker, currentMillisForPicker - maxRangeMillis); maxMillisForPicker = Math.min(maxMillisForPicker, currentMillisForPicker + maxRangeMillis); } // On KitKat and earlier, DatePicker requires the minDate is always less than maxDate, even // during the process of setting those values (eek), so set them in an order that preserves // this invariant throughout. if (minMillisForPicker > picker.getMaxDate()) { picker.setMaxDate(maxMillisForPicker); picker.setMinDate(minMillisForPicker); } else { picker.setMinDate(minMillisForPicker); picker.setMaxDate(maxMillisForPicker); } } /** * Sets the current, min, and max values on the given DatePicker and ensures that * min <= current <= max, adjusting current and max if needed. * * @param year The current year to set. * @param month The current month to set. 0-based. * @param day The current day to set. * @param minMillisUtc The minimum allowed date, in milliseconds from the epoch according to a * proleptic Gregorian calendar (no Julian switch). * @param maxMillisUtc The maximum allowed date, in milliseconds from the epoch according to a * proleptic Gregorian calendar (no Julian switch). */ public static void normalize(DatePicker picker, final OnDateChangedListener listener, int year, int month, int day, long minMillisUtc, long maxMillisUtc) { DateAndMillis currentDate = DateAndMillis.create(year, month, day); DateAndMillis minDate = DateAndMillis.create(minMillisUtc); DateAndMillis maxDate = DateAndMillis.create(maxMillisUtc); // Ensure min <= current <= max, adjusting current and max if needed. if (maxDate.millisForPicker < minDate.millisForPicker) { maxDate = minDate; } if (currentDate.millisForPicker < minDate.millisForPicker) { currentDate = minDate; } else if (currentDate.millisForPicker > maxDate.millisForPicker) { currentDate = maxDate; } setLimits(picker, currentDate.millisForPicker, minDate.millisForPicker, maxDate.millisForPicker); picker.init(currentDate.year, currentDate.month, currentDate.day, listener); } }
{ "content_hash": "5cdf7e6105640aedcee538c3365449f4", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 99, "avg_line_length": 46.625, "alnum_prop": 0.6630361930294906, "repo_name": "chromium/chromium", "id": "9159106b3c354da2f622f943dcb8334bdabb548a", "size": "5968", "binary": false, "copies": "6", "ref": "refs/heads/main", "path": "content/public/android/java/src/org/chromium/content/browser/picker/DateDialogNormalizer.java", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.8"/> <title>YGameFrame: 成员列表</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectlogo"><img alt="Logo" src="logo.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">YGameFrame </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- 制作者 Doxygen 1.8.8 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'搜索'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>首页</span></a></li> <li><a href="pages.html"><span>相关页面</span></a></li> <li><a href="namespaces.html"><span>包</span></a></li> <li class="current"><a href="annotated.html"><span>类</span></a></li> <li><a href="files.html"><span>文件</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="搜索" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>类列表</span></a></li> <li><a href="classes.html"><span>类索引</span></a></li> <li><a href="hierarchy.html"><span>类继承关系</span></a></li> <li><a href="functions.html"><span>类成员</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>命名空间</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>页</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespaceygame.html">ygame</a></li><li class="navelem"><a class="el" href="namespaceygame_1_1framework.html">framework</a></li><li class="navelem"><a class="el" href="namespaceygame_1_1framework_1_1core.html">core</a></li><li class="navelem"><a class="el" href="interfaceygame_1_1framework_1_1core_1_1YIConcurrentQueue_3_01E_01_4.html">YIConcurrentQueue< E ></a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">ygame.framework.core.YIConcurrentQueue&lt; E &gt; 成员列表</div> </div> </div><!--header--> <div class="contents"> <p>成员的完整列表,这些成员属于 <a class="el" href="interfaceygame_1_1framework_1_1core_1_1YIConcurrentQueue_3_01E_01_4.html">ygame.framework.core.YIConcurrentQueue&lt; E &gt;</a>,包括所有继承而来的类成员</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="interfaceygame_1_1framework_1_1core_1_1YIConcurrentQueue_3_01E_01_4.html#a0651c3c6a3912f23e1dd6a1750acb665">dequeue</a>()</td><td class="entry"><a class="el" href="interfaceygame_1_1framework_1_1core_1_1YIConcurrentQueue_3_01E_01_4.html">ygame.framework.core.YIConcurrentQueue&lt; E &gt;</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="interfaceygame_1_1framework_1_1core_1_1YIConcurrentQueue_3_01E_01_4.html#a1ca160e60e74bf3186db4982303320fa">enqueue</a>(E element)</td><td class="entry"><a class="el" href="interfaceygame_1_1framework_1_1core_1_1YIConcurrentQueue_3_01E_01_4.html">ygame.framework.core.YIConcurrentQueue&lt; E &gt;</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> 生成于 2014年 十一月 11日 星期二 22:23:59 , 为 YGameFrame使用 &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.8 </small></address> </body> </html>
{ "content_hash": "f1e129cb211d8becbd432cc7d2438225", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 923, "avg_line_length": 57.592592592592595, "alnum_prop": 0.6696141479099679, "repo_name": "YGameFrame/YGameFrame.github.io", "id": "3334930054030f729098d8d6564e6de18b431068", "size": "6406", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "docs/API/interfaceygame_1_1framework_1_1core_1_1YIConcurrentQueue_3_01E_01_4-members.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "52377" }, { "name": "JavaScript", "bytes": "52438" } ], "symlink_target": "" }
import * as React from 'react'; import { Constants, Sensor, Sensors } from 'model'; import { Graph } from '@greycat/greycat'; const logo = require('./logo.svg'); import './App.css'; import IndexViewer from './IndexViewer'; import { bind } from 'decko'; class App extends React.Component<{ graph: Graph }, {}> { render() { return ( <div className="App"> <div className="App-header"> <h2>{Constants.description}</h2> <img src={logo} className="App-logo" alt="logo" /> </div> <button onClick={this.addSensor}>add sensor</button> <IndexViewer graph={this.props.graph} indexName="Sensors" /> </div> ); } @bind addSensor(e: {}) { let newSensor: Sensor = Sensor.create(0, 0, this.props.graph); newSensor.setCode('sensor-js-' + new Date().getTime()); Sensors.update(newSensor, () => { this.props.graph.save(() => { // noop }); }); } } export default App;
{ "content_hash": "f31db07957079f3f749460eb64e3c3db", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 76, "avg_line_length": 28.657894736842106, "alnum_prop": 0.5224977043158862, "repo_name": "datathings/greycat-stack", "id": "b806969cac6b9efc22387867ffc197611c1d379a", "size": "1089", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/src/App.tsx", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "301" }, { "name": "HTML", "bytes": "1594" }, { "name": "Java", "bytes": "3257" }, { "name": "TypeScript", "bytes": "5889" } ], "symlink_target": "" }
namespace xxaml { namespace ui { namespace xaml { namespace controls { const wchar_t xxaml__ui__xaml__controls__content_control[] = L"XXaml.UI.Xaml.Controls.ContentControl"; class content_control : public control { protected: XXAML_IMPORT content_control(); public: XXAML_IMPORT virtual foundation::type_name type() const override; }; } } } }
{ "content_hash": "64266e0207ecf2d1c241c47f6d97d11a", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 103, "avg_line_length": 25.5, "alnum_prop": 0.7226890756302521, "repo_name": "mntone/XXaml", "id": "88ea325c32ea5c6b56c587c954c17ad1c25e8f92", "size": "394", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "xxaml/include/ui/xaml/controls/content_control.hpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "72" }, { "name": "C++", "bytes": "90294" } ], "symlink_target": "" }
Create cross platform desktop applications with server side scripting languages. Desktop Rhino instantly converts NW.js applications into server side desktop applications. By utilizing NW.js' ability to call Node.js scripts from the DOM, Desktop Rhino's core functionality is written purely in javascript! GETTING STARTED (PHP Version) 1) Downlaod NW.js 12.3 here - http://dl.nwjs.io/v0.12.3/ (Latest version currently being tested) 2) Unzip your file and place it into a destination with no spacing in it's path i.e., C:/users/johnsmith but not C:/users/john smith 3) Open Node.js command line and navigate inside the NW.js directory and run npm install --save desktoprhino This adds an index.html, index.php, package.json, bin folder, app folder and index.php within the app folder to your directory 4) Download your required php version and add it to the bin folder with the path to the executable being - bin/php Recommended Download Sites Windows - http://windows.php.net/download/ Mac OSX - http://php-osx.liip.ch/ (Macs come with php pre-installed and if your version is PHP 5.4+ you can skip this step) 5) If you are on Windows you are done, just start the application and enjoy! If you are on Mac OSX edit the index.html fileand change server.serverup() to... server.macinternal(); # for mac php pre-built server.macserver(); # for executable in bin folder Your are now ready to begin running PHP programs as ordinary desktop applications. Refer to NW.js documentation - http://docs.nwjs.io/en/latest/ HOW IT WORKS Desktop Rhino searches the users machine for available ports beginning at port 8000 at atartup. It then launches PHP's built in web server (with the avialbale port) as a child process of NW.js using Node. Rhino utlizes 3 simple commands This starts a php server on windows from the bin folder. server.winserver(); This starts a php server by accessing OSX's pre-packaged php executable. server.macinternal(); This starts a php server on OSX from the bin folder. server.macserver(); Change path or server If you'd like to change your server to a python server for instance, go to node_modules/desktoprhino/desktoprhino.js and edit th exec command. You can also redirect the path to your server here as well. WHY DESKTOP RHINO? Scalable & Non-Obtrusive Since Desktop Rhino is not bound to a single port or a randomly selected port, you can rest assured users can have many Rhinos running on their machine without any port conflicts. Anti-Racing Desktop Rhino does a great job at preventing port racing in normal use case. Users can go click crazy on rhino and each window will open within it's appropriate port. If the machine freezes during startup, it is possible for 2 windows to open with the same port number, however each windows will have it's own server instance eliminating any conflict. Single CodeBase Give users offline access to web apps with minimal to no alterations to your code. PHP and other scripting languages may not be the best choice for desktop software but then again neither is javascript, css or html but they've proven to be highly effective at the task. With PHP 7's improved speed being compared with HHVM and modern websites providing desktop lile services, it becomes clear PHP and other web scripting languages should be considered in the modern software development landscape. Interchangeable Server You are not bound to using php server or scripting language. You can easily swap servers and scripting languages quickly. KNOWN ISSUES As of 4/6/2016 tested on Windows - 10 - ia32 & x64, 7 - ia32 & x64 Mac OSX - 10.11 - x64, 10.10 - x64, 10.7 - x64 Bugs on... Mac OSX 1)Currently child process does not end with killall command form terminal. This can be resolved by renaming php executable to the same name as parent process, i.e., your app name. This is not resolvable when running pre-packaged php. 2)Single instance seems to remain in default despite be set to false. May be an issue with NW.js but currently investigating. Windows No known issues
{ "content_hash": "c08dfd601765a8b5c29b80032ee186b6", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 505, "avg_line_length": 37.3421052631579, "alnum_prop": 0.7451256753582335, "repo_name": "joshualondono/desktop-rhino", "id": "00e7cdf864d3cedfb18b7f42531e52bb440b4eb5", "size": "4274", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1460" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_91) on Tue Dec 29 12:44:16 AEDT 2015 --> <title>GF2nONBField (Bouncy Castle Library 1.54 API Specification)</title> <meta name="date" content="2015-12-29"> <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="GF2nONBField (Bouncy Castle Library 1.54 API Specification)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li 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 class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.54</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nONBElement.html" title="class in org.bouncycastle.pqc.math.linearalgebra"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nPolynomial.html" title="class in org.bouncycastle.pqc.math.linearalgebra"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/bouncycastle/pqc/math/linearalgebra/GF2nONBField.html" target="_top">Frames</a></li> <li><a href="GF2nONBField.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#fields_inherited_from_class_org.bouncycastle.pqc.math.linearalgebra.GF2nField">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>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> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.bouncycastle.pqc.math.linearalgebra</div> <h2 title="Class GF2nONBField" class="title">Class GF2nONBField</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">org.bouncycastle.pqc.math.linearalgebra.GF2nField</a></li> <li> <ul class="inheritance"> <li>org.bouncycastle.pqc.math.linearalgebra.GF2nONBField</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">GF2nONBField</span> extends <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a></pre> <div class="block">This class implements the abstract class <tt>GF2nField</tt> for ONB representation. It computes the fieldpolynomial, multiplication matrix and one of its roots mONBRoot, (see for example <a href=http://www2.certicom.com/ecc/intro.htm>Certicoms Whitepapers</a>). GF2nField is used by GF2nONBElement which implements the elements of this field.</div> <dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra"><code>GF2nField</code></a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nONBElement.html" title="class in org.bouncycastle.pqc.math.linearalgebra"><code>GF2nONBElement</code></a></dd></dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field_summary"> <!-- --> </a> <h3>Field Summary</h3> <ul class="blockList"> <li class="blockList"><a name="fields_inherited_from_class_org.bouncycastle.pqc.math.linearalgebra.GF2nField"> <!-- --> </a> <h3>Fields inherited from class&nbsp;org.bouncycastle.pqc.math.linearalgebra.<a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a></h3> <code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#fieldPolynomial">fieldPolynomial</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#fields">fields</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#matrices">matrices</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#mDegree">mDegree</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#random">random</a></code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <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="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nONBField.html#GF2nONBField(int,%20java.security.SecureRandom)">GF2nONBField</a></strong>(int&nbsp;deg, java.security.SecureRandom&nbsp;random)</code> <div class="block">constructs an instance of the finite field with 2<sup>deg</sup> elements and characteristic 2.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <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>protected void</code></td> <td class="colLast"><code><strong><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nONBField.html#computeCOBMatrix(org.bouncycastle.pqc.math.linearalgebra.GF2nField)">computeCOBMatrix</a></strong>(<a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a>&nbsp;B1)</code> <div class="block">Computes the change-of-basis matrix for basis conversion according to 1363.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><strong><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nONBField.html#computeFieldPolynomial()">computeFieldPolynomial</a></strong>()</code> <div class="block">Computes the field polynomial for a ONB according to IEEE 1363 A.7.2 (p110f).</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nElement.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nElement</a></code></td> <td class="colLast"><code><strong><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nONBField.html#getRandomRoot(org.bouncycastle.pqc.math.linearalgebra.GF2Polynomial)">getRandomRoot</a></strong>(<a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2Polynomial.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2Polynomial</a>&nbsp;polynomial)</code> <div class="block">Computes a random root of the given polynomial.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_org.bouncycastle.pqc.math.linearalgebra.GF2nField"> <!-- --> </a> <h3>Methods inherited from class&nbsp;org.bouncycastle.pqc.math.linearalgebra.<a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a></h3> <code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#convert(org.bouncycastle.pqc.math.linearalgebra.GF2nElement,%20org.bouncycastle.pqc.math.linearalgebra.GF2nField)">convert</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#equals(java.lang.Object)">equals</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#getDegree()">getDegree</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#getFieldPolynomial()">getFieldPolynomial</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#hashCode()">hashCode</a>, <a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#invertMatrix(org.bouncycastle.pqc.math.linearalgebra.GF2Polynomial[])">invertMatrix</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="GF2nONBField(int, java.security.SecureRandom)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>GF2nONBField</h4> <pre>public&nbsp;GF2nONBField(int&nbsp;deg, java.security.SecureRandom&nbsp;random) throws java.lang.RuntimeException</pre> <div class="block">constructs an instance of the finite field with 2<sup>deg</sup> elements and characteristic 2.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>deg</code> - -the extention degree of this field</dd><dd><code>random</code> - - a source of randomness for generating polynomials on the field.</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.lang.RuntimeException</code></dd></dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getRandomRoot(org.bouncycastle.pqc.math.linearalgebra.GF2Polynomial)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getRandomRoot</h4> <pre>protected&nbsp;<a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nElement.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nElement</a>&nbsp;getRandomRoot(<a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2Polynomial.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2Polynomial</a>&nbsp;polynomial)</pre> <div class="block">Computes a random root of the given polynomial.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#getRandomRoot(org.bouncycastle.pqc.math.linearalgebra.GF2Polynomial)">getRandomRoot</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>polynomial</code> - a polynomial</dd> <dt><span class="strong">Returns:</span></dt><dd>a random root of the polynomial</dd><dt><span class="strong">See Also:</span></dt><dd>"P1363 A.5.6, p103f"</dd></dl> </li> </ul> <a name="computeCOBMatrix(org.bouncycastle.pqc.math.linearalgebra.GF2nField)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>computeCOBMatrix</h4> <pre>protected&nbsp;void&nbsp;computeCOBMatrix(<a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a>&nbsp;B1)</pre> <div class="block">Computes the change-of-basis matrix for basis conversion according to 1363. The result is stored in the lists fields and matrices.</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#computeCOBMatrix(org.bouncycastle.pqc.math.linearalgebra.GF2nField)">computeCOBMatrix</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a></code></dd> <dt><span class="strong">Parameters:</span></dt><dd><code>B1</code> - the GF2nField to convert to</dd><dt><span class="strong">See Also:</span></dt><dd>"P1363 A.7.3, p111ff"</dd></dl> </li> </ul> <a name="computeFieldPolynomial()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>computeFieldPolynomial</h4> <pre>protected&nbsp;void&nbsp;computeFieldPolynomial()</pre> <div class="block">Computes the field polynomial for a ONB according to IEEE 1363 A.7.2 (p110f).</div> <dl> <dt><strong>Specified by:</strong></dt> <dd><code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html#computeFieldPolynomial()">computeFieldPolynomial</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nField.html" title="class in org.bouncycastle.pqc.math.linearalgebra">GF2nField</a></code></dd> <dt><span class="strong">See Also:</span></dt><dd>"P1363 A.7.2, p110f"</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li 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 class="aboutLanguage"><em><b>Bouncy Castle Cryptography Library 1.54</b></em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nONBElement.html" title="class in org.bouncycastle.pqc.math.linearalgebra"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../org/bouncycastle/pqc/math/linearalgebra/GF2nPolynomial.html" title="class in org.bouncycastle.pqc.math.linearalgebra"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/bouncycastle/pqc/math/linearalgebra/GF2nONBField.html" target="_top">Frames</a></li> <li><a href="GF2nONBField.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#fields_inherited_from_class_org.bouncycastle.pqc.math.linearalgebra.GF2nField">Field</a>&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>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> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "872a537f20218db2f29278d3aa24d575", "timestamp": "", "source": "github", "line_count": 354, "max_line_length": 845, "avg_line_length": 49.60734463276836, "alnum_prop": 0.6768976709754569, "repo_name": "GaloisInc/hacrypto", "id": "6829420398da81edf52ae0804c1a129eecbd6450", "size": "17561", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Java/BouncyCastle/BouncyCastle-1.54/lcrypto-jdk15on-154/javadoc/org/bouncycastle/pqc/math/linearalgebra/GF2nONBField.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AGS Script", "bytes": "62991" }, { "name": "Ada", "bytes": "443" }, { "name": "AppleScript", "bytes": "4518" }, { "name": "Assembly", "bytes": "25398957" }, { "name": "Awk", "bytes": "36188" }, { "name": "Batchfile", "bytes": "530568" }, { "name": "C", "bytes": "344517599" }, { "name": "C#", "bytes": "7553169" }, { "name": "C++", "bytes": "36635617" }, { "name": "CMake", "bytes": "213895" }, { "name": "CSS", "bytes": "139462" }, { "name": "Coq", "bytes": "320964" }, { "name": "Cuda", "bytes": "103316" }, { "name": "DIGITAL Command Language", "bytes": "1545539" }, { "name": "DTrace", "bytes": "33228" }, { "name": "Emacs Lisp", "bytes": "22827" }, { "name": "GDB", "bytes": "93449" }, { "name": "Gnuplot", "bytes": "7195" }, { "name": "Go", "bytes": "393057" }, { "name": "HTML", "bytes": "41466430" }, { "name": "Hack", "bytes": "22842" }, { "name": "Haskell", "bytes": "64053" }, { "name": "IDL", "bytes": "3205" }, { "name": "Java", "bytes": "49060925" }, { "name": "JavaScript", "bytes": "3476841" }, { "name": "Jolie", "bytes": "412" }, { "name": "Lex", "bytes": "26290" }, { "name": "Logos", "bytes": "108920" }, { "name": "Lua", "bytes": "427" }, { "name": "M4", "bytes": "2508986" }, { "name": "Makefile", "bytes": "29393197" }, { "name": "Mathematica", "bytes": "48978" }, { "name": "Mercury", "bytes": "2053" }, { "name": "Module Management System", "bytes": "1313" }, { "name": "NSIS", "bytes": "19051" }, { "name": "OCaml", "bytes": "981255" }, { "name": "Objective-C", "bytes": "4099236" }, { "name": "Objective-C++", "bytes": "243505" }, { "name": "PHP", "bytes": "22677635" }, { "name": "Pascal", "bytes": "99565" }, { "name": "Perl", "bytes": "35079773" }, { "name": "Prolog", "bytes": "350124" }, { "name": "Python", "bytes": "1242241" }, { "name": "Rebol", "bytes": "106436" }, { "name": "Roff", "bytes": "16457446" }, { "name": "Ruby", "bytes": "49694" }, { "name": "Scheme", "bytes": "138999" }, { "name": "Shell", "bytes": "10192290" }, { "name": "Smalltalk", "bytes": "22630" }, { "name": "Smarty", "bytes": "51246" }, { "name": "SourcePawn", "bytes": "542790" }, { "name": "SystemVerilog", "bytes": "95379" }, { "name": "Tcl", "bytes": "35696" }, { "name": "TeX", "bytes": "2351627" }, { "name": "Verilog", "bytes": "91541" }, { "name": "Visual Basic", "bytes": "88541" }, { "name": "XS", "bytes": "38300" }, { "name": "Yacc", "bytes": "132970" }, { "name": "eC", "bytes": "33673" }, { "name": "q", "bytes": "145272" }, { "name": "sed", "bytes": "1196" } ], "symlink_target": "" }
import Ember from 'ember'; import anime from 'ember-animejs'; const { computed, get } = Ember; const { RSVP: { Promise } } = Ember; export default Ember.Object.extend({ animations: computed(() => []), animate($element, effect, duration) { if (!effect.opacity) { effect.opacity = 1; } if (!effect.easing) { effect.easing = 'easeOutCubic'; } effect.targets = $element.get(0); effect.duration = duration; const animation = anime(effect); get(this, 'animations').push(animation); return new Promise((resolve) => { animation.complete = resolve; }); }, finish() { get(this, 'animations').forEach((animation) => { animation.seek(100); }); } });
{ "content_hash": "091472464f570cdb3bfaaad3fda57e9f", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 59, "avg_line_length": 20.37142857142857, "alnum_prop": 0.6100981767180925, "repo_name": "null-null-null/ember-letter-by-letter", "id": "37a6b54f9759da166aeea398be87db6c50f34b25", "size": "713", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "addon/lxl-tween-adapters/animejs.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "23780" }, { "name": "HTML", "bytes": "28944" }, { "name": "JavaScript", "bytes": "64807" } ], "symlink_target": "" }
layout: data_model title: NetworkConnectionObjectType this_version: 1.1.1 --- <div class="alert alert-danger bs-alert-old-docs"> <strong>Heads up!</strong> These docs are for STIX 1.1.1, which is not the latest version (1.2). <a href="/data-model/1.2/NetworkConnectionObj/NetworkConnectionObjectType">View the latest!</a> </div> <div class="row"> <div class="col-md-10"> <h1>NetworkConnectionObjectType<span class="subdued">Network Connection Object Schema</span></h1> <p class="data-model-description">The <a href='/data-model/1.1.1/NetworkConnectionObj/NetworkConnectionObjectType'>NetworkConnectionObjectType</a> is intended as a way of characterizing local or remote (i.e. Internet) network connections.</p> </div> <div id="nav-area" class="col-md-2"> <p> <form id="nav-version"> <select> <option value="1.2" >STIX 1.2</option> <option value="1.1.1" selected="selected">STIX 1.1.1</option> <option value="1.1" >STIX 1.1</option> <option value="1.0.1" >STIX 1.0.1</option> <option value="1.0" >STIX 1.0</option> </select> </form> </p> </div> </div> <hr /> <h2>Fields</h2> <table class="table table-striped table-hover"> <thead> <tr> <th>Field Name</th> <th>Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td>@object_reference<span class="occurrence">optional</span></td> <td> QName </td> <td> <p>The object_reference field specifies a unique ID reference to an Object defined elsewhere. This construct allows for the re-use of the defined Properties of one Object within another, without the need to embed the full Object in the location from which it is being referenced. Thus, this ID reference is intended to resolve to the Properties of the Object that it points to.</p> </td> </tr> <tr> <td>Custom_Properties<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/cyboxCommon/CustomPropertiesType">CustomPropertiesType</a> </td> <td> <p>The Custom_Properties construct is optional and enables the specification of a set of custom Object Properties that may not be defined in existing Properties schemas.</p> </td> </tr> <tr> <td>@tls_used<span class="occurrence">optional</span></td> <td> boolean </td> <td> <p>The tls_used field specifies whether or not Transport Layer Security (TLS) is used in the network connection.</p> </td> </tr> <tr> <td>Creation_Time<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/cyboxCommon/DateTimeObjectPropertyType">DateTimeObjectPropertyType</a> </td> <td> <p>The Creation_Time field specifies the date/time the network connection was created.</p> </td> </tr> <tr> <td>Layer3_Protocol<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/NetworkConnectionObj/Layer3ProtocolType">Layer3ProtocolType</a> </td> <td> <p>The Layer3_Protocol field specifies the particular network (layer 3 in the OSI model) layer protocol used in the connection.</p> </td> </tr> <tr> <td>Layer4_Protocol<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/cyboxCommon/Layer4ProtocolType">Layer4ProtocolType</a> </td> <td> <p>The Layer4_Protocol field specifies the particular transport (layer 4 in the OSI model) layer protocol used in the connection.</p> </td> </tr> <tr> <td>Layer7_Protocol<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/NetworkConnectionObj/Layer7ProtocolType">Layer7ProtocolType</a> </td> <td> <p>The Layer7_Protocol field specifies the particular application (layer 7 in the OSI model) layer protocol used in the connection.</p> </td> </tr> <tr> <td>Source_Socket_Address<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/SocketAddressObj/SocketAddressObjectType">SocketAddressObjectType</a> </td> <td> <p>The Source_Socket_Address field specifies the source socket address, consisting of an IP Address and port number, used in the connection.</p> </td> </tr> <tr> <td>Source_TCP_State<span class="occurrence">0..1</span></td> <td> TCPStateEnum </td> <td> <p>The Source_TCP_State field specifies the current state of the TCP network connection at the source, if applicable.</p> </td> </tr> <tr> <td>Destination_Socket_Address<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/SocketAddressObj/SocketAddressObjectType">SocketAddressObjectType</a> </td> <td> <p>The Destination_Socket_Address field specifies the destination socket address, consisting of an IP Address and port number, used in the connection.</p> </td> </tr> <tr> <td>Destination_TCP_State<span class="occurrence">0..1</span></td> <td> TCPStateEnum </td> <td> <p>The Destination_TCP_State field specifies the current state of the TCP network connection at the destination, if applicable.</p> </td> </tr> <tr> <td>Layer7_Connections<span class="occurrence">0..1</span></td> <td> <a href="/data-model/1.1.1/NetworkConnectionObj/Layer7ConnectionsType">Layer7ConnectionsType</a> </td> <td> <p>The Layer7_Connections field allows for the characterization of any application (layer 7 in the OSI model) layer connections observed as part of the network connection.</p> </td> </tr> </tbody> </table>
{ "content_hash": "6fc4ad6313ae31136a62494aef0e30e5", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 391, "avg_line_length": 28.597345132743364, "alnum_prop": 0.574965186445923, "repo_name": "STIXProject/stixproject.github.io", "id": "e8755a370980913cb06635ad2f12ebb5be16b149", "size": "6467", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "data-model/1.1.1/NetworkConnectionObj/NetworkConnectionObjectType/index.html", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "10401" }, { "name": "HTML", "bytes": "18147292" }, { "name": "JavaScript", "bytes": "3731" }, { "name": "Ruby", "bytes": "24306" }, { "name": "Shell", "bytes": "3599" } ], "symlink_target": "" }
package ecsbackend import ( "fmt" "strconv" "github.com/Sirupsen/logrus" "github.com/quintilesims/layer0/api/backend/ecs/id" "github.com/quintilesims/layer0/api/scheduler/resource" "github.com/quintilesims/layer0/common/aws/autoscaling" "github.com/quintilesims/layer0/common/aws/ec2" "github.com/quintilesims/layer0/common/aws/ecs" "github.com/quintilesims/layer0/common/logutils" "github.com/zpatrick/go-bytesize" ) type ECSResourceManager struct { ECS ecs.Provider Autoscaling autoscaling.Provider logger *logrus.Logger } func NewECSResourceManager(e ecs.Provider, a autoscaling.Provider) *ECSResourceManager { return &ECSResourceManager{ ECS: e, Autoscaling: a, logger: logutils.NewStandardLogger("ECS Resource Manager").Logger, } } func (r *ECSResourceManager) GetProviders(environmentID string) ([]*resource.ResourceProvider, error) { ecsEnvironmentID := id.L0EnvironmentID(environmentID).ECSEnvironmentID() instanceARNs, err := r.ECS.ListContainerInstances(ecsEnvironmentID.String()) if err != nil { return nil, err } resourceProviders := []*resource.ResourceProvider{} if len(instanceARNs) > 0 { instances, err := r.ECS.DescribeContainerInstances(ecsEnvironmentID.String(), instanceARNs) if err != nil { return nil, err } for _, instance := range instances { provider, ok := r.getResourceProvider(ecsEnvironmentID, instance) if ok { resourceProviders = append(resourceProviders, provider) } } } return resourceProviders, nil } func (r *ECSResourceManager) getResourceProvider(ecsEnvironmentID id.ECSEnvironmentID, instance *ecs.ContainerInstance) (*resource.ResourceProvider, bool) { instanceID := pstring(instance.Ec2InstanceId) if pstring(instance.Status) != "ACTIVE" { r.logger.Warnf("Instance %s is not in the 'ACTIVE' state", instanceID) return nil, false } if !pbool(instance.AgentConnected) { r.logger.Infof("Instance %s agent is disconnected", instanceID) } // this is non-intuitive, but the ports being used by tasks are kept in // instance.ReminaingResources, not instance.RegisteredResources var usedPorts []int var availableMemory bytesize.Bytesize for _, resource := range instance.RemainingResources { switch pstring(resource.Name) { case "MEMORY": v := pint64(resource.IntegerValue) availableMemory = bytesize.MiB * bytesize.Bytesize(v) case "PORTS": for _, p := range resource.StringSetValue { port, err := strconv.Atoi(pstring(p)) if err != nil { r.logger.Errorf("Instance %s: Failed to convert port to int: %v\n", instanceID, err) continue } usedPorts = append(usedPorts, port) } } } inUse := pint64(instance.PendingTasksCount)+pint64(instance.RunningTasksCount) > 0 provider := resource.NewResourceProvider(instanceID, inUse, availableMemory, usedPorts) r.logger.Debugf("Environment '%s' generated provider: %#v\n", ecsEnvironmentID, provider) return provider, true } func (r *ECSResourceManager) CalculateNewProvider(environmentID string) (*resource.ResourceProvider, error) { ecsEnvironmentID := id.L0EnvironmentID(environmentID).ECSEnvironmentID() group, err := r.Autoscaling.DescribeAutoScalingGroup(ecsEnvironmentID.String()) if err != nil { return nil, err } config, err := r.Autoscaling.DescribeLaunchConfiguration(pstring(group.LaunchConfigurationName)) if err != nil { return nil, err } memory, ok := ec2.InstanceSizes[pstring(config.InstanceType)] if !ok { return nil, fmt.Errorf("Environment %s is using unknown instance type '%s'", environmentID, pstring(config.InstanceType)) } // these ports are automatically used by the ecs agent defaultPorts := []int{ 22, 2376, 2375, 51678, 51679, } return resource.NewResourceProvider("<new instance>", false, memory, defaultPorts), nil } func (r *ECSResourceManager) ScaleTo(environmentID string, scale int, unusedProviders []*resource.ResourceProvider) (int, error) { ecsEnvironmentID := id.L0EnvironmentID(environmentID).ECSEnvironmentID() asg, err := r.Autoscaling.DescribeAutoScalingGroup(ecsEnvironmentID.String()) if err != nil { return 0, err } currentCapacity := int(pint64(asg.DesiredCapacity)) switch { case scale > currentCapacity: r.logger.Debugf("Environment %s is attempting to scale up to size %d", ecsEnvironmentID, scale) return r.scaleUp(ecsEnvironmentID, scale, asg) case scale < currentCapacity: r.logger.Debugf("Environment %s is attempting to scale down to size %d", ecsEnvironmentID, scale) return r.scaleDown(ecsEnvironmentID, scale, asg, unusedProviders) default: r.logger.Debugf("Environment %s is at desired scale of %d. No scaling action required.", ecsEnvironmentID, scale) return currentCapacity, nil } } func (r *ECSResourceManager) scaleUp(ecsEnvironmentID id.ECSEnvironmentID, scale int, asg *autoscaling.Group) (int, error) { maxCapacity := int(pint64(asg.MaxSize)) if scale > maxCapacity { if err := r.Autoscaling.UpdateAutoScalingGroupMaxSize(pstring(asg.AutoScalingGroupName), scale); err != nil { return 0, err } } if err := r.Autoscaling.SetDesiredCapacity(pstring(asg.AutoScalingGroupName), scale); err != nil { return 0, err } return scale, nil } func (r *ECSResourceManager) scaleDown(ecsEnvironmentID id.ECSEnvironmentID, scale int, asg *autoscaling.Group, unusedProviders []*resource.ResourceProvider) (int, error) { minCapacity := int(pint64(asg.MinSize)) if scale < minCapacity { r.logger.Warnf("Scale %d is below the minimum capacity of %d. Setting desired capacity to %d.", scale, minCapacity, minCapacity) scale = minCapacity } currentCapacity := int(pint64(asg.DesiredCapacity)) if scale == currentCapacity { r.logger.Debugf("Environment %s is at desired scale of %d. No scaling action required.", ecsEnvironmentID, scale) return scale, nil } if scale < currentCapacity { if err := r.Autoscaling.SetDesiredCapacity(pstring(asg.AutoScalingGroupName), scale); err != nil { return 0, err } } // choose which instances to terminate during our scale down process // instead of having asg randomly selecting instances // e.g. if we scale from 5->3, we can terminate up to 2 unused instances maxNumberOfInstancesToTerminate := currentCapacity - scale canTerminate := func(i int) bool { if i+1 > maxNumberOfInstancesToTerminate { return false } if i > len(unusedProviders)-1 { return false } return true } for i := 0; canTerminate(i); i++ { unusedProvider := unusedProviders[i] r.logger.Debugf("Environment %s terminating unused instance '%s'", ecsEnvironmentID, unusedProvider.ID) if _, err := r.Autoscaling.TerminateInstanceInAutoScalingGroup(unusedProvider.ID, false); err != nil { return 0, err } } return scale, nil }
{ "content_hash": "36c92b7bccdb29353bcd1b56f0d98e3a", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 172, "avg_line_length": 32.19047619047619, "alnum_prop": 0.7397928994082841, "repo_name": "quintilesims/layer0", "id": "b0a262f8a2b028874d7dab5fdbab607561538569", "size": "6760", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "api/backend/ecs/resource_manager.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Dockerfile", "bytes": "602" }, { "name": "Go", "bytes": "972098" }, { "name": "HCL", "bytes": "31475" }, { "name": "HTML", "bytes": "246" }, { "name": "JavaScript", "bytes": "32468" }, { "name": "Makefile", "bytes": "4390" }, { "name": "Shell", "bytes": "14098" } ], "symlink_target": "" }
package passtlsclientcert import ( "context" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "fmt" "io" "net/http" "net/url" "strings" "github.com/opentracing/opentracing-go/ext" "github.com/traefik/traefik/v2/pkg/config/dynamic" "github.com/traefik/traefik/v2/pkg/log" "github.com/traefik/traefik/v2/pkg/middlewares" "github.com/traefik/traefik/v2/pkg/tracing" ) const typeName = "PassClientTLSCert" const ( xForwardedTLSClientCert = "X-Forwarded-Tls-Client-Cert" xForwardedTLSClientCertInfo = "X-Forwarded-Tls-Client-Cert-Info" ) const ( certSeparator = "," fieldSeparator = ";" subFieldSeparator = "," ) var attributeTypeNames = map[string]string{ "0.9.2342.19200300.100.1.25": "DC", // Domain component OID - RFC 2247 } // DistinguishedNameOptions is a struct for specifying the configuration for the distinguished name info. type DistinguishedNameOptions struct { CommonName bool CountryName bool DomainComponent bool LocalityName bool OrganizationName bool SerialNumber bool StateOrProvinceName bool } func newDistinguishedNameOptions(info *dynamic.TLSCLientCertificateDNInfo) *DistinguishedNameOptions { if info == nil { return nil } return &DistinguishedNameOptions{ CommonName: info.CommonName, CountryName: info.Country, DomainComponent: info.DomainComponent, LocalityName: info.Locality, OrganizationName: info.Organization, SerialNumber: info.SerialNumber, StateOrProvinceName: info.Province, } } // tlsClientCertificateInfo is a struct for specifying the configuration for the passTLSClientCert middleware. type tlsClientCertificateInfo struct { notAfter bool notBefore bool sans bool subject *DistinguishedNameOptions issuer *DistinguishedNameOptions serialNumber bool } func newTLSClientCertificateInfo(info *dynamic.TLSClientCertificateInfo) *tlsClientCertificateInfo { if info == nil { return nil } return &tlsClientCertificateInfo{ issuer: newDistinguishedNameOptions(info.Issuer), notAfter: info.NotAfter, notBefore: info.NotBefore, subject: newDistinguishedNameOptions(info.Subject), serialNumber: info.SerialNumber, sans: info.Sans, } } // passTLSClientCert is a middleware that helps setup a few tls info features. type passTLSClientCert struct { next http.Handler name string pem bool // pass the sanitized pem to the backend in a specific header info *tlsClientCertificateInfo // pass selected information from the client certificate } // New constructs a new PassTLSClientCert instance from supplied frontend header struct. func New(ctx context.Context, next http.Handler, config dynamic.PassTLSClientCert, name string) (http.Handler, error) { log.FromContext(middlewares.GetLoggerCtx(ctx, name, typeName)).Debug("Creating middleware") return &passTLSClientCert{ next: next, name: name, pem: config.PEM, info: newTLSClientCertificateInfo(config.Info), }, nil } func (p *passTLSClientCert) GetTracingInformation() (string, ext.SpanKindEnum) { return p.name, tracing.SpanKindNoneEnum } func (p *passTLSClientCert) ServeHTTP(rw http.ResponseWriter, req *http.Request) { ctx := middlewares.GetLoggerCtx(req.Context(), p.name, typeName) logger := log.FromContext(ctx) if p.pem { if req.TLS != nil && len(req.TLS.PeerCertificates) > 0 { req.Header.Set(xForwardedTLSClientCert, getCertificates(ctx, req.TLS.PeerCertificates)) } else { logger.Warn("Tried to extract a certificate on a request without mutual TLS") } } if p.info != nil { if req.TLS != nil && len(req.TLS.PeerCertificates) > 0 { headerContent := p.getCertInfo(ctx, req.TLS.PeerCertificates) req.Header.Set(xForwardedTLSClientCertInfo, url.QueryEscape(headerContent)) } else { logger.Warn("Tried to extract a certificate on a request without mutual TLS") } } p.next.ServeHTTP(rw, req) } // getCertInfo Build a string with the wanted client certificates information // - the `,` is used to separate certificates // - the `;` is used to separate root fields // - the value of root fields is always wrapped by double quote // - if a field is empty, the field is ignored. func (p *passTLSClientCert) getCertInfo(ctx context.Context, certs []*x509.Certificate) string { var headerValues []string for _, peerCert := range certs { var values []string if p.info != nil { subject := getDNInfo(ctx, p.info.subject, &peerCert.Subject) if subject != "" { values = append(values, fmt.Sprintf(`Subject="%s"`, strings.TrimSuffix(subject, subFieldSeparator))) } issuer := getDNInfo(ctx, p.info.issuer, &peerCert.Issuer) if issuer != "" { values = append(values, fmt.Sprintf(`Issuer="%s"`, strings.TrimSuffix(issuer, subFieldSeparator))) } if p.info.serialNumber && peerCert.SerialNumber != nil { sn := peerCert.SerialNumber.String() if sn != "" { values = append(values, fmt.Sprintf(`SerialNumber="%s"`, strings.TrimSuffix(sn, subFieldSeparator))) } } if p.info.notBefore { values = append(values, fmt.Sprintf(`NB="%d"`, uint64(peerCert.NotBefore.Unix()))) } if p.info.notAfter { values = append(values, fmt.Sprintf(`NA="%d"`, uint64(peerCert.NotAfter.Unix()))) } if p.info.sans { sans := getSANs(peerCert) if len(sans) > 0 { values = append(values, fmt.Sprintf(`SAN="%s"`, strings.Join(sans, subFieldSeparator))) } } } value := strings.Join(values, fieldSeparator) headerValues = append(headerValues, value) } return strings.Join(headerValues, certSeparator) } func getDNInfo(ctx context.Context, options *DistinguishedNameOptions, cs *pkix.Name) string { if options == nil { return "" } content := &strings.Builder{} // Manage non standard attributes for _, name := range cs.Names { // Domain Component - RFC 2247 if options.DomainComponent && attributeTypeNames[name.Type.String()] == "DC" { content.WriteString(fmt.Sprintf("DC=%s%s", name.Value, subFieldSeparator)) } } if options.CountryName { writeParts(ctx, content, cs.Country, "C") } if options.StateOrProvinceName { writeParts(ctx, content, cs.Province, "ST") } if options.LocalityName { writeParts(ctx, content, cs.Locality, "L") } if options.OrganizationName { writeParts(ctx, content, cs.Organization, "O") } if options.SerialNumber { writePart(ctx, content, cs.SerialNumber, "SN") } if options.CommonName { writePart(ctx, content, cs.CommonName, "CN") } return content.String() } func writeParts(ctx context.Context, content io.StringWriter, entries []string, prefix string) { for _, entry := range entries { writePart(ctx, content, entry, prefix) } } func writePart(ctx context.Context, content io.StringWriter, entry, prefix string) { if len(entry) > 0 { _, err := content.WriteString(fmt.Sprintf("%s=%s%s", prefix, entry, subFieldSeparator)) if err != nil { log.FromContext(ctx).Error(err) } } } // sanitize As we pass the raw certificates, remove the useless data and make it http request compliant. func sanitize(cert []byte) string { cleaned := strings.NewReplacer( "-----BEGIN CERTIFICATE-----", "", "-----END CERTIFICATE-----", "", "\n", "", ).Replace(string(cert)) return url.QueryEscape(cleaned) } // getCertificates Build a string with the client certificates. func getCertificates(ctx context.Context, certs []*x509.Certificate) string { var headerValues []string for _, peerCert := range certs { headerValues = append(headerValues, extractCertificate(ctx, peerCert)) } return strings.Join(headerValues, certSeparator) } // extractCertificate extract the certificate from the request. func extractCertificate(ctx context.Context, cert *x509.Certificate) string { certPEM := pem.EncodeToMemory(&pem.Block{Type: "CERTIFICATE", Bytes: cert.Raw}) if certPEM == nil { log.FromContext(ctx).Error("Cannot extract the certificate content") return "" } return sanitize(certPEM) } // getSANs get the Subject Alternate Name values. func getSANs(cert *x509.Certificate) []string { if cert == nil { return nil } var sans []string sans = append(sans, cert.DNSNames...) sans = append(sans, cert.EmailAddresses...) for _, ip := range cert.IPAddresses { sans = append(sans, ip.String()) } for _, uri := range cert.URIs { sans = append(sans, uri.String()) } return sans }
{ "content_hash": "34f6e2c5924662093f742382a7463ea8", "timestamp": "", "source": "github", "line_count": 299, "max_line_length": 119, "avg_line_length": 28.207357859531772, "alnum_prop": 0.7108133744368034, "repo_name": "dtomcej/traefik", "id": "682836d567b0f4968768522bb4ffa0b745a3866a", "size": "8434", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "pkg/middlewares/passtlsclientcert/pass_tls_client_cert.go", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "3853" }, { "name": "Go", "bytes": "3074882" }, { "name": "HTML", "bytes": "1480" }, { "name": "JavaScript", "bytes": "83543" }, { "name": "Makefile", "bytes": "5890" }, { "name": "SCSS", "bytes": "6743" }, { "name": "Shell", "bytes": "9721" }, { "name": "Stylus", "bytes": "665" }, { "name": "Vue", "bytes": "171791" } ], "symlink_target": "" }
.. _example-fitting-model-sets: Fitting Model Sets ================== Astropy model sets let you fit the same (linear) model to lots of independent data sets. It solves the linear equations simultaneously, so can avoid looping. But getting the data into the right shape can be a bit tricky. The time savings could be worth the effort. In the example below, if we change the width*height of the data cube to 500*500 it takes 140 ms on a 2015 MacBook Pro to fit the models using model sets. Doing the same fit by looping over the 500*500 models takes 1.5 minutes, more than 600 times slower. In the example below, we create a 3D data cube where the first dimension is a ramp -- for example as from non-destructive readouts of an IR detector. So each pixel has a depth along a time axis, and flux that results a total number of counts that is increasing with time. We will be fitting a 1D polynomial vs. time to estimate the flux in counts/second (the slope of the fit). We will use just a small image of 3 rows by 4 columns, with a depth of 10 non-destructive reads. First, import the necessary libraries: >>> import numpy as np >>> rng = np.random.default_rng(seed=12345) >>> from astropy.modeling import models, fitting >>> depth, width, height = 10, 3, 4 # Time is along the depth axis >>> t = np.arange(depth, dtype=np.float64)*10. # e.g. readouts every 10 seconds The number of counts in neach pixel is flux*time with the addition of some Gaussian noise:: >>> fluxes = np.arange(1. * width * height).reshape(width, height) >>> image = fluxes[np.newaxis, :, :] * t[:, np.newaxis, np.newaxis] >>> image += rng.normal(0., image*0.05, size=image.shape) # Add noise >>> image.shape (10, 3, 4) Create the models and the fitter. We need N=width*height instances of the same linear, parametric model (model sets currently only work with linear models and fitters):: >>> N = width * height >>> line = models.Polynomial1D(degree=1, n_models=N) >>> fit = fitting.LinearLSQFitter() >>> print(f"We created {len(line)} models") We created 12 models We need to get the data to be fit into the right shape. It's not possible to just feed the 3D data cube. In this case, the time axis can be one dimensional. The fluxes have to be organized into an array that is of shape ``width*height,depth`` -- in other words, we are reshaping to flatten last two axes and transposing to put them first:: >>> pixels = image.reshape((depth, width*height)) >>> y = pixels.T >>> print("x axis is one dimensional: ",t.shape) x axis is one dimensional: (10,) >>> print("y axis is two dimensional, N by len(x): ", y.shape) y axis is two dimensional, N by len(x): (12, 10) Fit the model. It fits the N models simultaneously:: >>> new_model = fit(line, x=t, y=y) >>> print(f"We fit {len(new_model)} models") We fit 12 models Fill an array with values computed from the best fit and reshape it to match the original:: >>> best_fit = new_model(t, model_set_axis=False).T.reshape((depth, height, width)) >>> print("We reshaped the best fit to dimensions: ", best_fit.shape) We reshaped the best fit to dimensions: (10, 4, 3) Now inspect the model:: >>> print(new_model) # doctest: +FLOAT_CMP Model: Polynomial1D Inputs: ('x',) Outputs: ('y',) Model set size: 12 Degree: 1 Parameters: c0 c1 ------------------- ------------------ 0.0 0.0 0.7435257251672668 0.9788645710692938 -2.9342067207465647 2.038294797728997 -4.258776494573452 3.1951399579785678 2.364390501364263 3.9973270072631104 2.161531512810536 4.939542306192216 3.9930177540418823 5.967786182181591 -6.825657765397985 7.2680615507233215 -6.675677073701012 8.321048309260679 -11.91115500400788 9.025794163936956 -4.123655771677581 9.938564642105128 -0.7256700167533869 10.989896974949136 >>> print("The new_model has a param_sets attribute with shape: ",new_model.param_sets.shape) The new_model has a param_sets attribute with shape: (2, 12) >>> print(f"And values that are the best-fit parameters for each pixel:\n{new_model.param_sets}") # doctest: +FLOAT_CMP And values that are the best-fit parameters for each pixel: [[ 0. 0.74352573 -2.93420672 -4.25877649 2.3643905 2.16153151 3.99301775 -6.82565777 -6.67567707 -11.911155 -4.12365577 -0.72567002] [ 0. 0.97886457 2.0382948 3.19513996 3.99732701 4.93954231 5.96778618 7.26806155 8.32104831 9.02579416 9.93856464 10.98989697]] Plot the fit along a couple of pixels: >>> def plotramp(t, image, best_fit, row, col): ... plt.plot(t, image[:, row, col], '.', label=f'data pixel {row},{col}') ... plt.plot(t, best_fit[:, row, col], '-', label=f'fit to pixel {row},{col}') ... plt.xlabel('Time') ... plt.ylabel('Counts') ... plt.legend(loc='upper left') >>> fig = plt.figure(figsize=(10, 5)) # doctest: +SKIP >>> plotramp(t, image, best_fit, 1, 1) # doctest: +SKIP >>> plotramp(t, image, best_fit, 2, 1) # doctest: +SKIP The data and the best fit model are shown together on one plot. .. plot:: import numpy as np import matplotlib.pyplot as plt from scipy import stats from astropy.modeling import models, fitting # Set up the shape of the image and create the time axis depth,width,height=10,3,4 # Time is along the depth axis t = np.arange(depth, dtype=np.float64)*10. # e.g. readouts every 10 seconds # Make up a flux in each pixel fluxes = np.arange(1.*width*height).reshape(height, width) # Create the ramps by integrating the fluxes along the time steps image = fluxes[np.newaxis, :, :] * t[:, np.newaxis, np.newaxis] # Add some Gaussian noise to each sample image += stats.norm.rvs(0., image*0.05, size=image.shape) # Add noise # Create the models and the fitter N = width * height # This is how many instances we need line = models.Polynomial1D(degree=1, n_models=N) fit = fitting.LinearLSQFitter() # We need to get the data to be fit into the right shape # In this case, the time axis can be one dimensional. # The fluxes have to be organized into an array # that is of shape `(width*height, depth)` # i.e we are reshaping to flatten last two axes and # transposing to put them first. pixels = image.reshape((depth, width*height)) y = pixels.T # Fit the model. It does the looping over the N models implicitly new_model = fit(line, x=t, y=y) # Fill an array with values computed from the best fit and reshape it to match the original best_fit = new_model(t, model_set_axis=False).T.reshape((depth, height, width)) # Plot the fit along a couple of pixels def plotramp(t, image, best_fit, row, col): plt.plot(t, image[:, row, col], '.', label=f'data pixel {row},{col}') plt.plot(t, best_fit[:, row, col], '-', label=f'fit to pixel {row},{col}') plt.xlabel('Time') plt.ylabel('Counts') plt.legend(loc='upper left') plt.figure(figsize=(10, 5)) plotramp(t, image, best_fit, 1, 1) plotramp(t, image, best_fit, 3, 2) plt.show()
{ "content_hash": "cc311964b7c93dcf599b493ccf747fe6", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 123, "avg_line_length": 42.797687861271676, "alnum_prop": 0.6534305780659103, "repo_name": "mhvk/astropy", "id": "a9acd3d85eef651cb7906697207e198f3e7ee26e", "size": "7404", "binary": false, "copies": "5", "ref": "refs/heads/placeholder", "path": "docs/modeling/example-fitting-model-sets.rst", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "11040101" }, { "name": "C++", "bytes": "47001" }, { "name": "Cython", "bytes": "78776" }, { "name": "HTML", "bytes": "1172" }, { "name": "Lex", "bytes": "183333" }, { "name": "M4", "bytes": "18757" }, { "name": "Makefile", "bytes": "52508" }, { "name": "Python", "bytes": "12404182" }, { "name": "Shell", "bytes": "17024" }, { "name": "TeX", "bytes": "853" } ], "symlink_target": "" }
#include "config.h" #include "ginotifyfilemonitor.h" #include <gio/giomodule.h> #define USE_INOTIFY 1 #include "inotify-helper.h" #include "gioalias.h" struct _GInotifyFileMonitor { GLocalFileMonitor parent_instance; gchar *filename; gchar *dirname; inotify_sub *sub; gboolean pair_moves; }; static gboolean g_inotify_file_monitor_cancel (GFileMonitor* monitor); #define g_inotify_file_monitor_get_type _g_inotify_file_monitor_get_type G_DEFINE_TYPE_WITH_CODE (GInotifyFileMonitor, g_inotify_file_monitor, G_TYPE_LOCAL_FILE_MONITOR, g_io_extension_point_implement (G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME, g_define_type_id, "inotify", 20)) static void g_inotify_file_monitor_finalize (GObject *object) { GInotifyFileMonitor *inotify_monitor = G_INOTIFY_FILE_MONITOR (object); inotify_sub *sub = inotify_monitor->sub; if (sub) { _ih_sub_cancel (sub); _ih_sub_free (sub); inotify_monitor->sub = NULL; } if (inotify_monitor->filename) { g_free (inotify_monitor->filename); inotify_monitor->filename = NULL; } if (inotify_monitor->dirname) { g_free (inotify_monitor->dirname); inotify_monitor->dirname = NULL; } if (G_OBJECT_CLASS (g_inotify_file_monitor_parent_class)->finalize) (*G_OBJECT_CLASS (g_inotify_file_monitor_parent_class)->finalize) (object); } static GObject * g_inotify_file_monitor_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { GObject *obj; GInotifyFileMonitorClass *klass; GObjectClass *parent_class; GInotifyFileMonitor *inotify_monitor; const gchar *filename = NULL; inotify_sub *sub = NULL; gboolean pair_moves; gboolean ret_ih_startup; /* return value of _ih_startup, for asserting */ klass = G_INOTIFY_FILE_MONITOR_CLASS (g_type_class_peek (G_TYPE_INOTIFY_FILE_MONITOR)); parent_class = G_OBJECT_CLASS (g_type_class_peek_parent (klass)); obj = parent_class->constructor (type, n_construct_properties, construct_properties); inotify_monitor = G_INOTIFY_FILE_MONITOR (obj); filename = G_LOCAL_FILE_MONITOR (obj)->filename; g_assert (filename != NULL); inotify_monitor->filename = g_path_get_basename (filename); inotify_monitor->dirname = g_path_get_dirname (filename); /* Will never fail as is_supported() should be called before instanciating * anyway */ /* assert on return value */ ret_ih_startup = _ih_startup(); g_assert (ret_ih_startup); pair_moves = G_LOCAL_FILE_MONITOR (obj)->flags & G_FILE_MONITOR_SEND_MOVED; sub = _ih_sub_new (inotify_monitor->dirname, inotify_monitor->filename, pair_moves, inotify_monitor); /* FIXME: what to do about errors here? we can't return NULL or another * kind of error and an assertion is probably too hard */ g_assert (sub != NULL); /* _ih_sub_add allways returns TRUE, see gio/inotify/inotify-helper.c line 109 * g_assert (_ih_sub_add (sub)); */ _ih_sub_add (sub); inotify_monitor->sub = sub; return obj; } static gboolean g_inotify_file_monitor_is_supported (void) { return _ih_startup (); } static void g_inotify_file_monitor_class_init (GInotifyFileMonitorClass* klass) { GObjectClass* gobject_class = G_OBJECT_CLASS (klass); GFileMonitorClass *file_monitor_class = G_FILE_MONITOR_CLASS (klass); GLocalFileMonitorClass *local_file_monitor_class = G_LOCAL_FILE_MONITOR_CLASS (klass); gobject_class->finalize = g_inotify_file_monitor_finalize; gobject_class->constructor = g_inotify_file_monitor_constructor; file_monitor_class->cancel = g_inotify_file_monitor_cancel; local_file_monitor_class->is_supported = g_inotify_file_monitor_is_supported; } static void g_inotify_file_monitor_init (GInotifyFileMonitor* monitor) { } static gboolean g_inotify_file_monitor_cancel (GFileMonitor* monitor) { GInotifyFileMonitor *inotify_monitor = G_INOTIFY_FILE_MONITOR (monitor); inotify_sub *sub = inotify_monitor->sub; if (sub) { _ih_sub_cancel (sub); _ih_sub_free (sub); inotify_monitor->sub = NULL; } if (G_FILE_MONITOR_CLASS (g_inotify_file_monitor_parent_class)->cancel) (*G_FILE_MONITOR_CLASS (g_inotify_file_monitor_parent_class)->cancel) (monitor); return TRUE; }
{ "content_hash": "20063435a112a5e6d933f07d7e6b7818", "timestamp": "", "source": "github", "line_count": 158, "max_line_length": 96, "avg_line_length": 28.265822784810126, "alnum_prop": 0.6735333631885356, "repo_name": "Multi2Sim/m2s-bench-parsec-3.0-src", "id": "f87f07943b2ba91239197e9f5f2ad8a29db0d0f5", "size": "5505", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "libs/glib/src/gio/inotify/ginotifyfilemonitor.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Ada", "bytes": "89144" }, { "name": "Assembly", "bytes": "1659124" }, { "name": "Awk", "bytes": "142" }, { "name": "Batchfile", "bytes": "87065" }, { "name": "C", "bytes": "68546505" }, { "name": "C#", "bytes": "55726" }, { "name": "C++", "bytes": "8136682" }, { "name": "CLIPS", "bytes": "6933" }, { "name": "CSS", "bytes": "25825" }, { "name": "Clean", "bytes": "6801" }, { "name": "DIGITAL Command Language", "bytes": "292209" }, { "name": "Emacs Lisp", "bytes": "1639" }, { "name": "Groff", "bytes": "1279566" }, { "name": "HTML", "bytes": "22851143" }, { "name": "JavaScript", "bytes": "38451" }, { "name": "Lex", "bytes": "5802" }, { "name": "Logos", "bytes": "108920" }, { "name": "Makefile", "bytes": "3250395" }, { "name": "Max", "bytes": "296" }, { "name": "Module Management System", "bytes": "63061" }, { "name": "Objective-C", "bytes": "25859" }, { "name": "PHP", "bytes": "20451" }, { "name": "Pascal", "bytes": "61164" }, { "name": "Perl", "bytes": "779784" }, { "name": "Perl6", "bytes": "27602" }, { "name": "PostScript", "bytes": "74572" }, { "name": "Prolog", "bytes": "121408" }, { "name": "Python", "bytes": "457003" }, { "name": "Rebol", "bytes": "106436" }, { "name": "SAS", "bytes": "15821" }, { "name": "Scheme", "bytes": "4249" }, { "name": "Shell", "bytes": "1294787" }, { "name": "Smalltalk", "bytes": "1252" }, { "name": "SourcePawn", "bytes": "4209" }, { "name": "TeX", "bytes": "1014354" }, { "name": "XS", "bytes": "4319" }, { "name": "XSLT", "bytes": "167485" }, { "name": "Yacc", "bytes": "8202" }, { "name": "eC", "bytes": "4568" } ], "symlink_target": "" }
module.exports = { 'url' : 'mongodb://localhost:27017/Student' };
{ "content_hash": "de327c7d42a3227ebcb6fd30f303638d", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 44, "avg_line_length": 22.333333333333332, "alnum_prop": 0.6567164179104478, "repo_name": "ajay1001smart/topgear-nodejsproject-studentregistration", "id": "755e3a42c91de399e98eeb4aef1ea707efd155dc", "size": "67", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "config/database.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1367" }, { "name": "JavaScript", "bytes": "2616" } ], "symlink_target": "" }
#include "khttpd_webapi.h" #include <sys/param.h> #include <sys/kernel.h> #include <sys/systm.h> #include <sys/hash.h> #include <sys/mbuf.h> #include <sys/sbuf.h> #include <sys/socket.h> #include <sys/un.h> #include <sys/sysproto.h> #include <sys/syscallsubr.h> #include <netinet/in.h> #include "khttpd_json.h" #include "khttpd_ktr.h" #include "khttpd_log.h" #include "khttpd_mbuf.h" #include "khttpd_problem.h" #include "khttpd_status_code.h" #include "khttpd_string.h" #include "khttpd_strtab.h" int khttpd_webapi_get_string_property(const char **value_out, const char *name, struct khttpd_problem_property *input_prop_spec, struct khttpd_json *input, struct khttpd_mbuf_json *output, boolean_t may_not_exist) { struct khttpd_problem_property prop_spec; struct khttpd_json *value_j; KASSERT(khttpd_json_type(input) == KHTTPD_JSON_OBJECT, ("wrong type %d", khttpd_json_type(input))); prop_spec.link = input_prop_spec; prop_spec.name = name; value_j = khttpd_json_object_get(input, name); if (value_j == NULL) { if (may_not_exist) { *value_out = NULL; return (KHTTPD_STATUS_NO_CONTENT); } khttpd_problem_no_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } if (khttpd_json_type(value_j) != KHTTPD_JSON_STRING) { khttpd_problem_wrong_type_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } *value_out = khttpd_json_string_data(value_j); return (KHTTPD_STATUS_OK); } int khttpd_webapi_get_integer_property(int64_t *value_out, const char *name, struct khttpd_problem_property *input_prop_spec, struct khttpd_json *input, struct khttpd_mbuf_json *output, boolean_t may_not_exist) { struct khttpd_problem_property prop_spec; struct khttpd_json *value_j; KASSERT(khttpd_json_type(input) == KHTTPD_JSON_OBJECT, ("wrong type %d", khttpd_json_type(input))); prop_spec.link = input_prop_spec; prop_spec.name = name; value_j = khttpd_json_object_get(input, name); if (value_j == NULL) { if (may_not_exist) { *value_out = 0; return (KHTTPD_STATUS_NO_CONTENT); } khttpd_problem_no_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } if (khttpd_json_type(value_j) != KHTTPD_JSON_INTEGER) { khttpd_problem_wrong_type_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } *value_out = khttpd_json_integer_value(value_j); return (KHTTPD_STATUS_OK); } int khttpd_webapi_get_object_property(struct khttpd_json **value_out, const char *name, struct khttpd_problem_property *input_prop_spec, struct khttpd_json *input, struct khttpd_mbuf_json *output, boolean_t may_not_exist) { struct khttpd_problem_property prop_spec; struct khttpd_json *value_j; KASSERT(khttpd_json_type(input) == KHTTPD_JSON_OBJECT, ("wrong type %d", khttpd_json_type(input))); prop_spec.link = input_prop_spec; prop_spec.name = name; value_j = khttpd_json_object_get(input, name); if (value_j == NULL) { if (may_not_exist) { *value_out = 0; return (KHTTPD_STATUS_NO_CONTENT); } khttpd_problem_no_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } if (khttpd_json_type(value_j) != KHTTPD_JSON_OBJECT) { khttpd_problem_wrong_type_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } *value_out = value_j; return (KHTTPD_STATUS_OK); } int khttpd_webapi_get_array_property(struct khttpd_json **value_out, const char *name, struct khttpd_problem_property *input_prop_spec, struct khttpd_json *input, struct khttpd_mbuf_json *output, boolean_t may_not_exist) { struct khttpd_problem_property prop_spec; struct khttpd_json *value_j; KASSERT(khttpd_json_type(input) == KHTTPD_JSON_OBJECT, ("wrong type %d", khttpd_json_type(input))); prop_spec.link = input_prop_spec; prop_spec.name = name; value_j = khttpd_json_object_get(input, name); if (value_j == NULL) { if (may_not_exist) { *value_out = 0; return (KHTTPD_STATUS_NO_CONTENT); } khttpd_problem_no_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } if (khttpd_json_type(value_j) != KHTTPD_JSON_ARRAY) { khttpd_problem_wrong_type_response_begin(output); khttpd_problem_set_property(output, &prop_spec); return (KHTTPD_STATUS_BAD_REQUEST); } *value_out = value_j; return (KHTTPD_STATUS_OK); } int khttpd_webapi_get_sockaddr_property(struct sockaddr *addr, socklen_t len, const char *name, struct khttpd_problem_property *input_prop_spec, struct khttpd_json *input, struct khttpd_mbuf_json *output, boolean_t may_not_exist) { struct khttpd_problem_property prop_spec[2]; struct sockaddr_un *un; struct sockaddr_in *in; struct sockaddr_in6 *in6; struct khttpd_json *obj_j; const char *family, *address; uint32_t ipaddr; in_port_t *port_field; size_t alen; int64_t port; int status; status = khttpd_webapi_get_object_property(&obj_j, name, input_prop_spec, input, output, may_not_exist); if (!KHTTPD_STATUS_IS_SUCCESSFUL(status)) return (status); prop_spec[0].name = name; prop_spec[0].link = input_prop_spec; status = khttpd_webapi_get_string_property(&family, "family", &prop_spec[0], obj_j, output, FALSE); if (!KHTTPD_STATUS_IS_SUCCESSFUL(status)) return (status); status = khttpd_webapi_get_string_property(&address, "address", &prop_spec[0], obj_j, output, TRUE); if (!KHTTPD_STATUS_IS_SUCCESSFUL(status)) return (status); port_field = NULL; prop_spec[1].name = "address"; prop_spec[1].link = &prop_spec[0]; if (strcmp(family, "unix") == 0) { if (address == NULL) { khttpd_problem_no_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec[1]); return (KHTTPD_STATUS_BAD_REQUEST); } if (address[0] != '/') { khttpd_problem_invalid_value_response_begin(output); khttpd_problem_set_detail(output, "absolute path only"); khttpd_problem_set_property(output, &prop_spec[1]); return (KHTTPD_STATUS_BAD_REQUEST); } un = (struct sockaddr_un *)addr; alen = offsetof(struct sockaddr_un, sun_path) + strlen(address) + 1; if (len < MIN(sizeof(struct sockaddr_un), alen)) { khttpd_problem_invalid_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec[1]); khttpd_problem_set_detail(output, "too long"); return (KHTTPD_STATUS_BAD_REQUEST); } un->sun_len = alen; un->sun_family = AF_UNIX; strlcpy(un->sun_path, address, len - offsetof(struct sockaddr_un, sun_path)); } else if (strcmp(family, "inet") == 0) { in = (struct sockaddr_in *)addr; port_field = &in->sin_port; in->sin_len = sizeof(struct sockaddr_in); in->sin_family = AF_INET; if (address == NULL) { in->sin_addr.s_addr = htonl(INADDR_ANY); } else if (khttpd_parse_ip_addresss(&ipaddr, address) == 0) { in->sin_addr.s_addr = htonl(ipaddr); } else { khttpd_problem_invalid_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec[1]); return (KHTTPD_STATUS_BAD_REQUEST); } } else if (strcmp(family, "inet6") == 0) { in6 = (struct sockaddr_in6 *)addr; port_field = &in6->sin6_port; bzero(in6, sizeof(*in6)); in6->sin6_len = sizeof(struct sockaddr_in6); in6->sin6_family = AF_INET6; if (address == NULL) { in6->sin6_addr = in6addr_any; } else if (khttpd_parse_ipv6_address(in6->sin6_addr.s6_addr, address) != 0) { khttpd_problem_invalid_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec[1]); return (KHTTPD_STATUS_BAD_REQUEST); } } else { prop_spec[1].name = "family"; khttpd_problem_invalid_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec[1]); return (KHTTPD_STATUS_BAD_REQUEST); } if (port_field != NULL) { status = khttpd_webapi_get_integer_property(&port, "port", &prop_spec[0], obj_j, output, FALSE); if (!KHTTPD_STATUS_IS_SUCCESSFUL(status)) return (status); if (port < 1 || IPPORT_MAX < port) { prop_spec[1].name = "port"; khttpd_problem_invalid_value_response_begin(output); khttpd_problem_set_property(output, &prop_spec[1]); return (KHTTPD_STATUS_BAD_REQUEST); } *port_field = htons(port); } return (KHTTPD_STATUS_OK); }
{ "content_hash": "e908329a276bf59c830c32a18067aeab", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 79, "avg_line_length": 28.976190476190474, "alnum_prop": 0.6874046249559808, "repo_name": "Taketsuru/khttpd", "id": "c2e2eb9db9f1a9da7b0651c7cb94b9e8fae8ba5e", "size": "9887", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/khttpd/khttpd_webapi.c", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "C", "bytes": "702742" }, { "name": "C++", "bytes": "2551" }, { "name": "CSS", "bytes": "70" }, { "name": "HTML", "bytes": "2046" }, { "name": "JavaScript", "bytes": "874" }, { "name": "Makefile", "bytes": "3814" }, { "name": "Shell", "bytes": "904" }, { "name": "Tcl", "bytes": "124088" } ], "symlink_target": "" }
test{content:"\f102";content:"xf102"}
{ "content_hash": "57501d0c3485532f946ab6aa8e646454", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 37, "avg_line_length": 38, "alnum_prop": 0.7105263157894737, "repo_name": "am11/sass-spec", "id": "f46c23e61a9828f05d868f31c82040aa36e7fb64", "size": "38", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "spec/output_styles/compressed/libsass-closed-issues/issue_1271/expected_output.css", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "24360057" }, { "name": "Perl", "bytes": "12986" }, { "name": "Ruby", "bytes": "56883" }, { "name": "Shell", "bytes": "2649" } ], "symlink_target": "" }
require 'spec_helper' RSpec.describe "HotDate form field label", :type => :request do describe "Accepts same arguments as label_tag method" do it "allows user to specify text of label tag" do visit new_schedule_path page.should have_content("Time for beer yet?") end end end
{ "content_hash": "e2c9379a466977ebb18eb71379849e66", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 63, "avg_line_length": 29.1, "alnum_prop": 0.7250859106529209, "repo_name": "jomalley2112/hot_date_rails", "id": "09a6a8342d2c1323b8e1b0f997f299d786e7aa41", "size": "291", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/requests/hd_label_spec.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "883" }, { "name": "CoffeeScript", "bytes": "1626" }, { "name": "HTML", "bytes": "9797" }, { "name": "JavaScript", "bytes": "150" }, { "name": "Ruby", "bytes": "68391" } ], "symlink_target": "" }
<?php date_default_timezone_set('Asia/Kuala_Lumpur'); /* *--------------------------------------------------------------- * APPLICATION ENVIRONMENT *--------------------------------------------------------------- * * You can load different configurations depending on your * current environment. Setting the environment also influences * things like logging and error reporting. * * This can be set to anything, but default usage is: * * development * testing * production * * NOTE: If you change these, also change the error_reporting() code below */ define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); /* *--------------------------------------------------------------- * ERROR REPORTING *--------------------------------------------------------------- * * Different environments will require different levels of error reporting. * By default development will show errors but testing and live will hide them. */ switch (ENVIRONMENT) { case 'development': error_reporting(-1); ini_set('display_errors', 1); break; case 'testing': case 'production': ini_set('display_errors', 0); if (version_compare(PHP_VERSION, '5.3', '>=')) { error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); } else { error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE); } break; default: header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); echo 'The application environment is not set correctly.'; exit(1); // EXIT_ERROR } /* *--------------------------------------------------------------- * SYSTEM DIRECTORY NAME *--------------------------------------------------------------- * * This variable must contain the name of your "system" directory. * Set the path if it is not in the same directory as this file. */ $system_path = 'system'; /* *--------------------------------------------------------------- * APPLICATION DIRECTORY NAME *--------------------------------------------------------------- * * If you want this front controller to use a different "application" * directory than the default one you can set its name here. The directory * can also be renamed or relocated anywhere on your server. If you do, * use an absolute (full) server path. * For more info please see the user guide: * * https://codeigniter.com/user_guide/general/managing_apps.html * * NO TRAILING SLASH! */ $application_folder = 'application'; /* *--------------------------------------------------------------- * VIEW DIRECTORY NAME *--------------------------------------------------------------- * * If you want to move the view directory out of the application * directory, set the path to it here. The directory can be renamed * and relocated anywhere on your server. If blank, it will default * to the standard location inside your application directory. * If you do move this, use an absolute (full) server path. * * NO TRAILING SLASH! */ $view_folder = ''; /* * -------------------------------------------------------------------- * DEFAULT CONTROLLER * -------------------------------------------------------------------- * * Normally you will set your default controller in the routes.php file. * You can, however, force a custom routing by hard-coding a * specific controller class/function here. For most applications, you * WILL NOT set your routing here, but it's an option for those * special instances where you might want to override the standard * routing in a specific front controller that shares a common CI installation. * * IMPORTANT: If you set the routing here, NO OTHER controller will be * callable. In essence, this preference limits your application to ONE * specific controller. Leave the function name blank if you need * to call functions dynamically via the URI. * * Un-comment the $routing array below to use this feature */ // The directory name, relative to the "controllers" directory. Leave blank // if your controller is not in a sub-directory within the "controllers" one // $routing['directory'] = ''; // The controller class file name. Example: mycontroller // $routing['controller'] = ''; // The controller function you wish to be called. // $routing['function'] = ''; /* * ------------------------------------------------------------------- * CUSTOM CONFIG VALUES * ------------------------------------------------------------------- * * The $assign_to_config array below will be passed dynamically to the * config class when initialized. This allows you to set custom config * items or override any default config values found in the config.php file. * This can be handy as it permits you to share one application between * multiple front controller files, with each file containing different * config values. * * Un-comment the $assign_to_config array below to use this feature */ // $assign_to_config['name_of_config_item'] = 'value of config item'; // -------------------------------------------------------------------- // END OF USER CONFIGURABLE SETTINGS. DO NOT EDIT BELOW THIS LINE // -------------------------------------------------------------------- /* * --------------------------------------------------------------- * Resolve the system path for increased reliability * --------------------------------------------------------------- */ // Set the current directory correctly for CLI requests if (defined('STDIN')) { chdir(dirname(__FILE__)); } if (($_temp = realpath($system_path)) !== FALSE) { $system_path = $_temp.DIRECTORY_SEPARATOR; } else { // Ensure there's a trailing slash $system_path = strtr( rtrim($system_path, '/\\'), '/\\', DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ).DIRECTORY_SEPARATOR; } // Is the system path correct? if ( ! is_dir($system_path)) { header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME); exit(3); // EXIT_CONFIG } /* * ------------------------------------------------------------------- * Now that we know the path, set the main path constants * ------------------------------------------------------------------- */ // The name of THIS file define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); // Path to the system directory define('BASEPATH', $system_path); // Path to the front controller (this file) directory define('FCPATH', dirname(__FILE__).DIRECTORY_SEPARATOR); // Name of the "system" directory define('SYSDIR', basename(BASEPATH)); // The path to the "application" directory if (is_dir($application_folder)) { if (($_temp = realpath($application_folder)) !== FALSE) { $application_folder = $_temp; } else { $application_folder = strtr( rtrim($application_folder, '/\\'), '/\\', DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } } elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) { $application_folder = BASEPATH.strtr( trim($application_folder, '/\\'), '/\\', DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } else { header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; exit(3); // EXIT_CONFIG } define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); // The path to the "views" directory if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) { $view_folder = APPPATH.'views'; } elseif (is_dir($view_folder)) { if (($_temp = realpath($view_folder)) !== FALSE) { $view_folder = $_temp; } else { $view_folder = strtr( rtrim($view_folder, '/\\'), '/\\', DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } } elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) { $view_folder = APPPATH.strtr( trim($view_folder, '/\\'), '/\\', DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR ); } else { header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; exit(3); // EXIT_CONFIG } define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR); /* * -------------------------------------------------------------------- * LOAD THE BOOTSTRAP FILE * -------------------------------------------------------------------- * * And away we go... */ require_once BASEPATH.'core/CodeIgniter.php';
{ "content_hash": "44a34e6cfd6cb18de11fbb5486377b25", "timestamp": "", "source": "github", "line_count": 281, "max_line_length": 158, "avg_line_length": 30.750889679715304, "alnum_prop": 0.5674111792616595, "repo_name": "HabibAsyraf/efutebol", "id": "f11d45dc17dc6f509adad7a98bd256b292916cde", "size": "10301", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "index.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4511328" }, { "name": "CoffeeScript", "bytes": "83631" }, { "name": "HTML", "bytes": "1180892" }, { "name": "JavaScript", "bytes": "17290462" }, { "name": "PHP", "bytes": "2447766" }, { "name": "Shell", "bytes": "444" } ], "symlink_target": "" }
import {Directive, DoCheck, Host, Input, TemplateRef, ViewContainerRef} from '@angular/core'; export class SwitchView { private _created = false; constructor( private _viewContainerRef: ViewContainerRef, private _templateRef: TemplateRef<Object>) {} create(): void { this._created = true; this._viewContainerRef.createEmbeddedView(this._templateRef); } destroy(): void { this._created = false; this._viewContainerRef.clear(); } enforceState(created: boolean) { if (created && !this._created) { this.create(); } else if (!created && this._created) { this.destroy(); } } } /** * @ngModule CommonModule * * @description * The `[ngSwitch]` directive on a container specifies an expression to match against. * The expressions to match are provided by `ngSwitchCase` directives on views within the container. * - Every view that matches is rendered. * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered. * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase` * or `ngSwitchDefault` directive are preserved at the location. * * @usageNotes * Define a container element for the directive, and specify the switch expression * to match against as an attribute: * * ``` * <container-element [ngSwitch]="switch_expression"> * ``` * * Within the container, `*ngSwitchCase` statements specify the match expressions * as attributes. Include `*ngSwitchDefault` as the final case. * * ``` * <container-element [ngSwitch]="switch_expression"> * <some-element *ngSwitchCase="match_expression_1">...</some-element> * ... * <some-element *ngSwitchDefault>...</some-element> * </container-element> * ``` * * ### Usage Examples * * The following example shows how to use more than one case to display the same view: * * ``` * <container-element [ngSwitch]="switch_expression"> * <!-- the same view can be shown in more than one case --> * <some-element *ngSwitchCase="match_expression_1">...</some-element> * <some-element *ngSwitchCase="match_expression_2">...</some-element> * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element> * <!--default case when there are no matches --> * <some-element *ngSwitchDefault>...</some-element> * </container-element> * ``` * * The following example shows how cases can be nested: * ``` * <container-element [ngSwitch]="switch_expression"> * <some-element *ngSwitchCase="match_expression_1">...</some-element> * <some-element *ngSwitchCase="match_expression_2">...</some-element> * <some-other-element *ngSwitchCase="match_expression_3">...</some-other-element> * <ng-container *ngSwitchCase="match_expression_3"> * <!-- use a ng-container to group multiple root nodes --> * <inner-element></inner-element> * <inner-other-element></inner-other-element> * </ng-container> * <some-element *ngSwitchDefault>...</some-element> * </container-element> * ``` * * @publicApi * @see `NgSwitchCase` * @see `NgSwitchDefault` * @see [Structural Directives](guide/structural-directives) * */ @Directive({selector: '[ngSwitch]'}) export class NgSwitch { // TODO(issue/24571): remove '!'. private _defaultViews!: SwitchView[]; private _defaultUsed = false; private _caseCount = 0; private _lastCaseCheckIndex = 0; private _lastCasesMatched = false; private _ngSwitch: any; @Input() set ngSwitch(newValue: any) { this._ngSwitch = newValue; if (this._caseCount === 0) { this._updateDefaultCases(true); } } /** @internal */ _addCase(): number { return this._caseCount++; } /** @internal */ _addDefault(view: SwitchView) { if (!this._defaultViews) { this._defaultViews = []; } this._defaultViews.push(view); } /** @internal */ _matchCase(value: any): boolean { const matched = value == this._ngSwitch; this._lastCasesMatched = this._lastCasesMatched || matched; this._lastCaseCheckIndex++; if (this._lastCaseCheckIndex === this._caseCount) { this._updateDefaultCases(!this._lastCasesMatched); this._lastCaseCheckIndex = 0; this._lastCasesMatched = false; } return matched; } private _updateDefaultCases(useDefault: boolean) { if (this._defaultViews && useDefault !== this._defaultUsed) { this._defaultUsed = useDefault; for (let i = 0; i < this._defaultViews.length; i++) { const defaultView = this._defaultViews[i]; defaultView.enforceState(useDefault); } } } } /** * @ngModule CommonModule * * @description * Provides a switch case expression to match against an enclosing `ngSwitch` expression. * When the expressions match, the given `NgSwitchCase` template is rendered. * If multiple match expressions match the switch expression value, all of them are displayed. * * @usageNotes * * Within a switch container, `*ngSwitchCase` statements specify the match expressions * as attributes. Include `*ngSwitchDefault` as the final case. * * ``` * <container-element [ngSwitch]="switch_expression"> * <some-element *ngSwitchCase="match_expression_1">...</some-element> * ... * <some-element *ngSwitchDefault>...</some-element> * </container-element> * ``` * * Each switch-case statement contains an in-line HTML template or template reference * that defines the subtree to be selected if the value of the match expression * matches the value of the switch expression. * * Unlike JavaScript, which uses strict equality, Angular uses loose equality. * This means that the empty string, `""` matches 0. * * @publicApi * @see `NgSwitch` * @see `NgSwitchDefault` * */ @Directive({selector: '[ngSwitchCase]'}) export class NgSwitchCase implements DoCheck { private _view: SwitchView; /** * Stores the HTML template to be selected on match. */ @Input() ngSwitchCase: any; constructor( viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, @Host() private ngSwitch: NgSwitch) { ngSwitch._addCase(); this._view = new SwitchView(viewContainer, templateRef); } /** * Performs case matching. For internal use only. */ ngDoCheck() { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); } } /** * @ngModule CommonModule * * @description * * Creates a view that is rendered when no `NgSwitchCase` expressions * match the `NgSwitch` expression. * This statement should be the final case in an `NgSwitch`. * * @publicApi * @see `NgSwitch` * @see `NgSwitchCase` * */ @Directive({selector: '[ngSwitchDefault]'}) export class NgSwitchDefault { constructor( viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, @Host() ngSwitch: NgSwitch) { ngSwitch._addDefault(new SwitchView(viewContainer, templateRef)); } }
{ "content_hash": "28e46bcbf010893cb482b8483c2f6a20", "timestamp": "", "source": "github", "line_count": 228, "max_line_length": 100, "avg_line_length": 30.385964912280702, "alnum_prop": 0.6729214780600462, "repo_name": "wKoza/angular", "id": "5847340383978f371401c11ecdb804f8bdb6d8e6", "size": "7129", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "packages/common/src/directives/ng_switch.ts", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "493" }, { "name": "CSS", "bytes": "339020" }, { "name": "Dockerfile", "bytes": "14661" }, { "name": "HTML", "bytes": "332963" }, { "name": "JSONiq", "bytes": "619" }, { "name": "JavaScript", "bytes": "803444" }, { "name": "PHP", "bytes": "7222" }, { "name": "PowerShell", "bytes": "4229" }, { "name": "Python", "bytes": "344864" }, { "name": "Shell", "bytes": "72057" }, { "name": "TypeScript", "bytes": "17973343" } ], "symlink_target": "" }
package com.ack.adventureandconquer.game.proficiency; import com.ack.adventureandconquer.game.Proficiency; /** * Created by saskyrar on 02/03/15. */ public class QuietMagic extends Proficiency { @Override public String getName() { return QUIET_MAGIC; } @Override public String getDescription() { return "The character can cast spells with minimal words and gestures. " + "A successful proficiency throw to hear noise is required to hear the character " + "cast spells. Full gagging is necessary to prevent the character from " + "working magic."; } }
{ "content_hash": "55fa4f8b8bbc4e8615b1ddd84599833f", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 99, "avg_line_length": 30.666666666666668, "alnum_prop": 0.6630434782608695, "repo_name": "FlorianHuebner/Adventurer-Conqueror-King-Mobile", "id": "56004c570d00f62674380349759f93d503284ca6", "size": "644", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "lib/src/main/java/com/ack/adventureandconquer/game/proficiency/QuietMagic.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "935235" } ], "symlink_target": "" }
require 'test/unit' require_relative 'tc_InvalidToken' require_relative 'tc_BreakToken' require_relative 'tc_WhitespaceToken' require_relative 'tc_KeywordToken' require_relative 'tc_OperatorToken' require_relative 'tc_GroupStartToken' require_relative 'tc_GroupEndToken' require_relative 'tc_ParamSeparatorToken' require_relative 'tc_FunctionToken' require_relative 'tc_UserFunctionToken' require_relative 'tc_TextConstantToken' require_relative 'tc_NumericConstantToken' require_relative 'tc_BooleanConstantToken' require_relative 'tc_VariableToken' require_relative 'tc_StatementSeparatorToken'
{ "content_hash": "96dff3e3a9befea5c9b5542c313878cb", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 45, "avg_line_length": 35.1764705882353, "alnum_prop": 0.8394648829431438, "repo_name": "jfitz/BASIC-1973", "id": "3aad6cc7ab72bd4901906ded073b3b011b84a2d4", "size": "626", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "unit_test/ts_tokens.rb", "mode": "33188", "license": "mit", "language": [ { "name": "BASIC", "bytes": "754897" }, { "name": "PowerShell", "bytes": "12595" }, { "name": "Ruby", "bytes": "682637" }, { "name": "Shell", "bytes": "9488" } ], "symlink_target": "" }
package com.intellij.util.fmap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.*; final class ArrayBackedFMap<K, V> implements FMap<K, V> { static final int ARRAY_THRESHOLD = 8; private final @NotNull Object @NotNull [] myData; ArrayBackedFMap(@NotNull Object @NotNull ... data) { assert 3 * 2 <= data.length; // at least 3 key-value pairs assert data.length <= ARRAY_THRESHOLD * 2; // at most ARRAY_THRESHOLD key-value pairs myData = data; } ArrayBackedFMap(@NotNull Map<K, V> map) { assert map.size() <= ARRAY_THRESHOLD; Object[] data = new Object[map.size() * 2]; int i = 0; for (Map.Entry<K, V> entry : map.entrySet()) { data[i++] = entry.getKey(); data[i++] = entry.getValue(); } assert i == data.length; myData = data; } @Override public @NotNull FMap<K, V> plus(K key, V value) { for (int i = 0; i < myData.length; i += 2) { if (myData[i].equals(key)) { if (myData[i + 1].equals(value)) { return this; } else { Object[] newData = myData.clone(); newData[i + 1] = value; return new ArrayBackedFMap<>(newData); } } } if (size() < ARRAY_THRESHOLD) { int length = myData.length; Object[] newData = Arrays.copyOf(myData, length + 2); newData[length] = key; newData[length + 1] = value; return new ArrayBackedFMap<>(newData); } Map<K, V> map = toMapInner(); map.put(key, value); return new MapBackedFMap<>(map); } @SuppressWarnings("unchecked") @Override public @NotNull FMap<K, V> minus(K key) { for (int i = 0; i < myData.length; i += 2) { if (myData[i].equals(key)) { if (size() == 3) { if (i == 0) { return new TwoKeysFMap<>((K)myData[2], (V)myData[3], (K)myData[4], (V)myData[5]); } else if (i == 2) { return new TwoKeysFMap<>((K)myData[0], (V)myData[1], (K)myData[4], (V)myData[5]); } else { assert i == 4; return new TwoKeysFMap<>((K)myData[0], (V)myData[1], (K)myData[2], (V)myData[3]); } } else { Object[] newData = new Object[myData.length - 2]; System.arraycopy(myData, 0, newData, 0, i); System.arraycopy(myData, i + 2, newData, i, myData.length - 2 - i); return new ArrayBackedFMap<>(newData); } } } return this; } @SuppressWarnings("unchecked") @Override public @Nullable V get(K key) { for (int i = 0; i < myData.length; i += 2) { if (myData[i].equals(key)) { return (V)myData[i + 1]; } } return null; } @Override public boolean isEmpty() { return false; } @Override public int size() { return myData.length / 2; } @SuppressWarnings("unchecked") @Override public @NotNull Collection<K> keys() { List<K> result = new ArrayList<>(size()); for (int i = 0; i < myData.length; i += 2) { result.add((K)myData[i]); } return result; } @Override public @NotNull Map<K, V> toMap() { return Collections.unmodifiableMap(toMapInner()); } @SuppressWarnings("unchecked") @NotNull private Map<K, V> toMapInner() { Map<K, V> map = new HashMap<>(size()); for (int i = 0; i < myData.length; i += 2) { map.put((K)myData[i], (V)myData[i + 1]); } return map; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ArrayBackedFMap<?, ?> map = (ArrayBackedFMap<?, ?>)o; if (size() != map.size()) return false; return toMapInner().equals(map.toMapInner()); } @Override public int hashCode() { int keysHash = 0; int valuesHash = 0; for (int i = 0; i < myData.length; i += 2) { keysHash = keysHash ^ myData[i].hashCode(); valuesHash = valuesHash ^ myData[i + 1].hashCode(); } return keysHash + 31 * valuesHash; } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("[\n"); for (int i = 0; i < myData.length; i += 2) { sb.append(" ").append(myData[i]).append(": ").append(myData[i + 1]).append(",\n"); } sb.append("]"); return sb.toString(); } }
{ "content_hash": "fbf03dd78c7d5b60c630ffd94c3bcbfe", "timestamp": "", "source": "github", "line_count": 164, "max_line_length": 93, "avg_line_length": 26.6890243902439, "alnum_prop": 0.5574594471098926, "repo_name": "GunoH/intellij-community", "id": "0114c961c144902ffc6d725cdbfb4054c4d362a1", "size": "4518", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "platform/util/src/com/intellij/util/fmap/ArrayBackedFMap.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php namespace Kassner\FinancesBundle\Twig; class PriceExtension extends \Twig_Extension { public function getName() { return 'price'; } public function getFilters() { return array( 'price' => new \Twig_Filter_Method($this, 'priceFormat', array('is_safe' => array('html'))) ); } public function priceFormat($number) { $number = round($number, 2); $html = '<span class="amount">'; $html .= 'R$ '; $html .= number_format($number, 2, ',', '.'); $html .= '</span>'; return $html; } }
{ "content_hash": "4ee91f42406bdd9364e39816e1ce1c43", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 103, "avg_line_length": 19.612903225806452, "alnum_prop": 0.5197368421052632, "repo_name": "kassner/finances", "id": "3a929ff44a854889900db405a65bb3faef9c381c", "size": "608", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Kassner/FinancesBundle/Twig/PriceExtension.php", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "5284" }, { "name": "JavaScript", "bytes": "182" }, { "name": "PHP", "bytes": "100567" } ], "symlink_target": "" }
package com.ckcks12.idiotmusicplayer; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.ckcks12.idiotmusicplayer", appContext.getPackageName()); } }
{ "content_hash": "560c3031680b87b7d5be1088dcb60e1f", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 82, "avg_line_length": 29.23076923076923, "alnum_prop": 0.7526315789473684, "repo_name": "ckcks12/Homework", "id": "d4b222690f33ddceff312ebe0327a0001b4750dd", "size": "760", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "embedded/hw4/IdiotMusicPlayer/app/src/androidTest/java/com/ckcks12/idiotmusicplayer/ExampleInstrumentedTest.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "187616" }, { "name": "C#", "bytes": "23959" }, { "name": "C++", "bytes": "15116" }, { "name": "CMake", "bytes": "253" }, { "name": "CSS", "bytes": "8660" }, { "name": "HTML", "bytes": "74848" }, { "name": "Java", "bytes": "97917" }, { "name": "JavaScript", "bytes": "207221" }, { "name": "Shell", "bytes": "40" } ], "symlink_target": "" }
TEST(MathFunctions, lgamma) { EXPECT_TRUE(stan::math::is_inf(lgamma(0.0))); } TEST(MathFunctions, lgammaStanMathUsing) { using stan::math::lgamma; } TEST(MathFunctions, lgamma_nan) { double nan = std::numeric_limits<double>::quiet_NaN(); EXPECT_TRUE(std::isnan(stan::math::lgamma(nan))); EXPECT_TRUE(std::isinf(stan::math::lgamma(0))); // up to boost 1.70.0 the boost::math::lgamma return NaN for large // arguments (large is greater than sqrt(largest double of 1E308) // when used with the stan::math::boost_policy_t which avoids // propagation of input arguments from double to long double // internally to boost::math::lgamma. See // https://github.com/boostorg/math/issues/242 for this. The // stan::math::lgamma implementation is based on the // boost::math::lgamma only when MinGW compilers are used. Thus, to // ensure that boost::math::lgamma contains the needed bugfixes we // test here specifically the boost::math::lgamma by testing for a // finite return for a large argument. EXPECT_TRUE(std::isnormal( boost::math::lgamma(1.0E50, stan::math::boost_policy_t<>()))); }
{ "content_hash": "ae133bc2dbb91a2cb3da56f7336170f6", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 77, "avg_line_length": 50.86363636363637, "alnum_prop": 0.709562109025916, "repo_name": "stan-dev/math", "id": "625e3fcf80c08a45e7e446ed286a64fb012c44c9", "size": "1260", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "test/unit/math/prim/fun/lgamma_test.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Ada", "bytes": "89079" }, { "name": "Assembly", "bytes": "566183" }, { "name": "Batchfile", "bytes": "33076" }, { "name": "C", "bytes": "7093229" }, { "name": "C#", "bytes": "54013" }, { "name": "C++", "bytes": "166268432" }, { "name": "CMake", "bytes": "820167" }, { "name": "CSS", "bytes": "11283" }, { "name": "Cuda", "bytes": "342187" }, { "name": "DIGITAL Command Language", "bytes": "32438" }, { "name": "Dockerfile", "bytes": "118" }, { "name": "Fortran", "bytes": "2299405" }, { "name": "HTML", "bytes": "8320473" }, { "name": "JavaScript", "bytes": "38507" }, { "name": "M4", "bytes": "10525" }, { "name": "Makefile", "bytes": "74538" }, { "name": "Meson", "bytes": "4233" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NASL", "bytes": "106079" }, { "name": "Objective-C", "bytes": "420" }, { "name": "Objective-C++", "bytes": "420" }, { "name": "Pascal", "bytes": "75208" }, { "name": "Perl", "bytes": "47080" }, { "name": "Python", "bytes": "1958975" }, { "name": "QMake", "bytes": "18714" }, { "name": "Roff", "bytes": "30570" }, { "name": "Ruby", "bytes": "5532" }, { "name": "SAS", "bytes": "1847" }, { "name": "SWIG", "bytes": "5501" }, { "name": "Shell", "bytes": "187001" }, { "name": "Starlark", "bytes": "29435" }, { "name": "XSLT", "bytes": "567938" }, { "name": "Yacc", "bytes": "22343" } ], "symlink_target": "" }
package jalse.entities.annotations; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import jalse.entities.Entity; import jalse.entities.functions.UnmarkAsTypeFunction; import jalse.entities.methods.UnmarkAsTypeMethod; /** * An {@link Entity} type annotation for {@link Entity#unmarkAsType(Class)}.<br> * <br> * See {@link UnmarkAsTypeFunction} for acceptable method signatures. * * @author Elliot Ford * * @see UnmarkAsTypeMethod * */ @Target(ElementType.METHOD) @Retention(RetentionPolicy.RUNTIME) public @interface UnmarkAsType { /** * Entity type to unmark. * * @return Entity type. */ Class<? extends Entity>value(); }
{ "content_hash": "7d581e2b6eb73898c93234235cac67e7", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 80, "avg_line_length": 24.28125, "alnum_prop": 0.7413127413127413, "repo_name": "Ellzord/JALSE", "id": "47d61cf05d52dacb893515ddcaebeb77050769ea", "size": "777", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/jalse/entities/annotations/UnmarkAsType.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "473254" } ], "symlink_target": "" }
require_relative 'spec_helper' ['jenkins', 'clamav', 'openjdk-7-jdk', 'ruby', 'ruby-dev', 'sloccount'].each do |value| describe package(value) do it { should be_installed } end end ['brakeman', 'zapr', 'bundler-audit', 'gemrat'].each do |value| describe package(value) do it { should be_installed.by('gem') } end end
{ "content_hash": "58eae18f5b89c0a06a9fd0639e972acc", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 87, "avg_line_length": 24, "alnum_prop": 0.6547619047619048, "repo_name": "secure-pipeline/jenkins-example", "id": "453f8ae5055758bd1218365f596bdfed630c3fce", "size": "336", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "tests/spec/packages_spec.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Puppet", "bytes": "4877" }, { "name": "Ruby", "bytes": "3653" }, { "name": "Shell", "bytes": "856" } ], "symlink_target": "" }
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.X86; namespace JIT.HardwareIntrinsics.X86 { public static partial class Program { private static void CompareGreaterThanSByte() { var test = new SimpleBinaryOpTest__CompareGreaterThanSByte(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (Sse2.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); // Validates basic functionality works, using LoadAligned test.RunBasicScenario_LoadAligned(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (Sse2.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); // Validates calling via reflection works, using LoadAligned test.RunReflectionScenario_LoadAligned(); } // Validates passing a static member works test.RunClsVarScenario(); // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (Sse2.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); // Validates passing a local works, using LoadAligned test.RunLclVarScenario_LoadAligned(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); // Validates passing an instance member of a class works test.RunClassFldScenario(); // Validates passing the field of a local struct works test.RunStructLclFldScenario(); // Validates passing an instance member of a struct works test.RunStructFldScenario(); } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class SimpleBinaryOpTest__CompareGreaterThanSByte { private struct TestStruct { public Vector128<SByte> _fld1; public Vector128<SByte> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref testStruct._fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref testStruct._fld2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>()); return testStruct; } public void RunStructFldScenario(SimpleBinaryOpTest__CompareGreaterThanSByte testClass) { var result = Sse2.CompareGreaterThan(_fld1, _fld2); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte); private static SByte[] _data1 = new SByte[Op1ElementCount]; private static SByte[] _data2 = new SByte[Op2ElementCount]; private static Vector128<SByte> _clsVar1; private static Vector128<SByte> _clsVar2; private Vector128<SByte> _fld1; private Vector128<SByte> _fld2; private SimpleBinaryOpTest__DataTable<SByte, SByte, SByte> _dataTable; static SimpleBinaryOpTest__CompareGreaterThanSByte() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _clsVar1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _clsVar2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>()); } public SimpleBinaryOpTest__CompareGreaterThanSByte() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>()); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<SByte>, byte>(ref _fld2), ref Unsafe.As<SByte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<SByte>>()); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSByte(); } _dataTable = new SimpleBinaryOpTest__DataTable<SByte, SByte, SByte>(_data1, _data2, new SByte[RetElementCount], LargestVectorSize); } public bool IsSupported => Sse2.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = Sse2.CompareGreaterThan( Unsafe.Read<Vector128<SByte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<SByte>>(_dataTable.inArray2Ptr) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = Sse2.CompareGreaterThan( Sse2.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), Sse2.LoadVector128((SByte*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_LoadAligned)); var result = Sse2.CompareGreaterThan( Sse2.LoadAlignedVector128((SByte*)(_dataTable.inArray1Ptr)), Sse2.LoadAlignedVector128((SByte*)(_dataTable.inArray2Ptr)) ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(Sse2).GetMethod(nameof(Sse2.CompareGreaterThan), new Type[] { typeof(Vector128<SByte>), typeof(Vector128<SByte>) }) .Invoke(null, new object[] { Unsafe.Read<Vector128<SByte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<SByte>>(_dataTable.inArray2Ptr) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<SByte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(Sse2).GetMethod(nameof(Sse2.CompareGreaterThan), new Type[] { typeof(Vector128<SByte>), typeof(Vector128<SByte>) }) .Invoke(null, new object[] { Sse2.LoadVector128((SByte*)(_dataTable.inArray1Ptr)), Sse2.LoadVector128((SByte*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<SByte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_LoadAligned)); var result = typeof(Sse2).GetMethod(nameof(Sse2.CompareGreaterThan), new Type[] { typeof(Vector128<SByte>), typeof(Vector128<SByte>) }) .Invoke(null, new object[] { Sse2.LoadAlignedVector128((SByte*)(_dataTable.inArray1Ptr)), Sse2.LoadAlignedVector128((SByte*)(_dataTable.inArray2Ptr)) }); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<SByte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = Sse2.CompareGreaterThan( _clsVar1, _clsVar2 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var left = Unsafe.Read<Vector128<SByte>>(_dataTable.inArray1Ptr); var right = Unsafe.Read<Vector128<SByte>>(_dataTable.inArray2Ptr); var result = Sse2.CompareGreaterThan(left, right); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(left, right, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var left = Sse2.LoadVector128((SByte*)(_dataTable.inArray1Ptr)); var right = Sse2.LoadVector128((SByte*)(_dataTable.inArray2Ptr)); var result = Sse2.CompareGreaterThan(left, right); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(left, right, _dataTable.outArrayPtr); } public void RunLclVarScenario_LoadAligned() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_LoadAligned)); var left = Sse2.LoadAlignedVector128((SByte*)(_dataTable.inArray1Ptr)); var right = Sse2.LoadAlignedVector128((SByte*)(_dataTable.inArray2Ptr)); var result = Sse2.CompareGreaterThan(left, right); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(left, right, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new SimpleBinaryOpTest__CompareGreaterThanSByte(); var result = Sse2.CompareGreaterThan(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = Sse2.CompareGreaterThan(_fld1, _fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = Sse2.CompareGreaterThan(test._fld1, test._fld2); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult(Vector128<SByte> left, Vector128<SByte> right, void* result, [CallerMemberName] string method = "") { SByte[] inArray1 = new SByte[Op1ElementCount]; SByte[] inArray2 = new SByte[Op2ElementCount]; SByte[] outArray = new SByte[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref inArray1[0]), left); Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref inArray2[0]), right); Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<SByte>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(void* left, void* right, void* result, [CallerMemberName] string method = "") { SByte[] inArray1 = new SByte[Op1ElementCount]; SByte[] inArray2 = new SByte[Op2ElementCount]; SByte[] outArray = new SByte[RetElementCount]; Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(left), (uint)Unsafe.SizeOf<Vector128<SByte>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(right), (uint)Unsafe.SizeOf<Vector128<SByte>>()); Unsafe.CopyBlockUnaligned(ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<SByte>>()); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult(SByte[] left, SByte[] right, SByte[] result, [CallerMemberName] string method = "") { bool succeeded = true; if (result[0] != ((left[0] > right[0]) ? unchecked((sbyte)(-1)) : 0)) { succeeded = false; } else { for (var i = 1; i < RetElementCount; i++) { if (result[i] != ((left[i] > right[i]) ? unchecked((sbyte)(-1)) : 0)) { succeeded = false; break; } } } if (!succeeded) { TestLibrary.TestFramework.LogInformation($"{nameof(Sse2)}.{nameof(Sse2.CompareGreaterThan)}<SByte>(Vector128<SByte>, Vector128<SByte>): {method} failed:"); TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})"); TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})"); TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})"); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
{ "content_hash": "7a99b275ce7b8297138acc527a207bdf", "timestamp": "", "source": "github", "line_count": 412, "max_line_length": 187, "avg_line_length": 43.62864077669903, "alnum_prop": 0.5905424200278164, "repo_name": "mmitche/coreclr", "id": "2c7eeaf3332be11266d2cabc50e741bd3cdfe191", "size": "17975", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "tests/src/JIT/HardwareIntrinsics/X86/Sse2/CompareGreaterThan.SByte.cs", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "956111" }, { "name": "Awk", "bytes": "6916" }, { "name": "Batchfile", "bytes": "168475" }, { "name": "C", "bytes": "5588467" }, { "name": "C#", "bytes": "150477201" }, { "name": "C++", "bytes": "65887021" }, { "name": "CMake", "bytes": "715184" }, { "name": "Groovy", "bytes": "225924" }, { "name": "M4", "bytes": "15214" }, { "name": "Makefile", "bytes": "46117" }, { "name": "Objective-C", "bytes": "16829" }, { "name": "Perl", "bytes": "23640" }, { "name": "PowerShell", "bytes": "54894" }, { "name": "Python", "bytes": "548588" }, { "name": "Roff", "bytes": "656420" }, { "name": "Scala", "bytes": "4102" }, { "name": "Shell", "bytes": "490554" }, { "name": "Smalltalk", "bytes": "635930" }, { "name": "SuperCollider", "bytes": "650" }, { "name": "TeX", "bytes": "126781" }, { "name": "XSLT", "bytes": "1016" }, { "name": "Yacc", "bytes": "157492" } ], "symlink_target": "" }
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package app.metatron.discovery.domain.workbook.configurations.analysis; import java.io.Serializable; import java.util.List; /** * Trend Analysis Spec. * * @author Kyungtaak Noh * @since 1.1 */ public class TrendAnalysis implements Analysis { /** * use global setting, if true */ boolean useGlobal; /** * setting for individual trends series */ List<TrendBySeries> series; public TrendAnalysis() { } public TrendAnalysis(List<TrendBySeries> series) { this.series = series; } public Boolean getUseGlobal() { return useGlobal; } public void setUseGlobal(Boolean useGlobal) { this.useGlobal = useGlobal; } public List<TrendBySeries> getSeries() { return series; } public void setSeries(List<TrendBySeries> series) { this.series = series; } @Override public String toString() { return "TrendAnalysis{" + "series=" + series + '}'; } @Override public String getVersionKey() { return null; } public static class TrendBySeries implements Serializable { /** * show trend line, if true. */ boolean show; /** * Series name */ String name; /** * Formula for trend analysis */ Formula formula; /** * Style of trend line */ Style style; public TrendBySeries() { } public TrendBySeries(boolean show, String name, Formula formula, Style style) { this.show = show; this.name = name; this.formula = formula; this.style = style; } public boolean isShow() { return show; } public void setShow(boolean show) { this.show = show; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Formula getFormula() { return formula; } public void setFormula(Formula formula) { this.formula = formula; } public Style getStyle() { return style; } public void setStyle(Style style) { this.style = style; } @Override public String toString() { return "TrendBySeries{" + "name='" + name + '\'' + ", formula=" + formula + ", style=" + style + '}'; } } public enum Formula { LINEAR, LOGARITHMIC, EXPONENTIAL, QUADRATIC, CUBIC } }
{ "content_hash": "5546da79a939a1e0526240c76c4ce8b1", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 83, "avg_line_length": 19.546666666666667, "alnum_prop": 0.6200545702592087, "repo_name": "metatron-app/metatron-discovery", "id": "e335289108503296e0db1d80a842b8fd68489aca", "size": "2932", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "discovery-server/src/main/java/app/metatron/discovery/domain/workbook/configurations/analysis/TrendAnalysis.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "5768" }, { "name": "CSS", "bytes": "3355512" }, { "name": "Dockerfile", "bytes": "589" }, { "name": "HTML", "bytes": "3250794" }, { "name": "Java", "bytes": "7408311" }, { "name": "JavaScript", "bytes": "5541901" }, { "name": "Python", "bytes": "543" }, { "name": "R", "bytes": "1302" }, { "name": "Shell", "bytes": "9660" }, { "name": "TSQL", "bytes": "11234" }, { "name": "TypeScript", "bytes": "7903758" } ], "symlink_target": "" }
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{ "content_hash": "c473b9a6855206614609a9a4f26c13d1", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 31, "avg_line_length": 9.692307692307692, "alnum_prop": 0.7063492063492064, "repo_name": "mdoering/backbone", "id": "aa85a4e92362b02bc50d5ff6db673931ef99d4d4", "size": "193", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Cactaceae/Melocactus/Melocactus guanensis/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
#include <ecstasy/utils/ComponentFactory.hpp> #include <ecstasy/utils/EntityFactory.hpp> #include <ecstasy/utils/Blueprint.hpp> namespace ecstasy { EntityFactory::EntityFactory() {} bool EntityFactory::assemble(Entity* entity, const std::string& blueprintname) { auto it = entities.find(blueprintname); bool success = false; if(it != entities.end()) { success = true; auto blueprint = it->second; for(auto& componentBlueprint: blueprint->components) { auto factoryIt = componentFactories.find(componentBlueprint->name); if(factoryIt == componentFactories.end() || !factoryIt->second->assemble(entity, *componentBlueprint)) { success = false; } } } return success; } }
{ "content_hash": "f6daa067f7845ca53e4ba9ab88ebb7a0", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 81, "avg_line_length": 28.72, "alnum_prop": 0.7089136490250696, "repo_name": "Lusito/ecstasy", "id": "9f4a378634091004cad3e442acaa685999fc2f7e", "size": "1471", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/utils/EntityFactory.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "551239" }, { "name": "CMake", "bytes": "1244" } ], "symlink_target": "" }
package org.drools.testcoverage.common.util; import org.drools.core.impl.KnowledgeBaseFactory; import org.kie.api.KieBaseConfiguration; import org.kie.api.builder.model.KieBaseModel; import org.kie.api.builder.model.KieModuleModel; import org.kie.api.conf.EqualityBehaviorOption; import org.kie.api.conf.EventProcessingOption; /** * Represents various tested KieBase configurations. */ public enum KieBaseTestConfiguration implements KieBaseModelProvider { /** * Represents KieBase configuration with * <code>EventProcessingOption.CLOUD</code> and * <code>EqualityBehaviorOption.IDENTITY</code> options set. */ CLOUD_IDENTITY { @Override public KieBaseModel getKieBaseModel(final KieModuleModel kieModuleModel) { final KieBaseModel kieBaseModel = kieModuleModel.newKieBaseModel(); kieBaseModel.setEventProcessingMode(EventProcessingOption.CLOUD); kieBaseModel.setEqualsBehavior(EqualityBehaviorOption.IDENTITY); kieBaseModel.setDefault(true); return kieBaseModel; } @Override public KieBaseConfiguration getKieBaseConfiguration() { final KieBaseConfiguration kieBaseConfiguration = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); kieBaseConfiguration.setOption(EventProcessingOption.CLOUD); kieBaseConfiguration.setOption(EqualityBehaviorOption.IDENTITY); return kieBaseConfiguration; } }, /** * Represents KieBase configuration with * <code>EventProcessingOption.CLOUD</code> and * <code>EqualityBehaviorOption.EQUALITY</code> options set. */ CLOUD_EQUALITY { @Override public KieBaseModel getKieBaseModel(final KieModuleModel kieModuleModel) { final KieBaseModel kieBaseModel = kieModuleModel.newKieBaseModel(); kieBaseModel.setEventProcessingMode(EventProcessingOption.CLOUD); kieBaseModel.setEqualsBehavior(EqualityBehaviorOption.EQUALITY); kieBaseModel.setDefault(true); return kieBaseModel; } @Override public KieBaseConfiguration getKieBaseConfiguration() { final KieBaseConfiguration kieBaseConfiguration = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); kieBaseConfiguration.setOption(EventProcessingOption.CLOUD); kieBaseConfiguration.setOption(EqualityBehaviorOption.EQUALITY); return kieBaseConfiguration; } }, /** * Represents KieBase configuration with * <code>EventProcessingOption.STREAM</code> and * <code>EqualityBehaviorOption.IDENTITY</code> options set. */ STREAM_IDENTITY { @Override public KieBaseModel getKieBaseModel(KieModuleModel kieModuleModel) { final KieBaseModel kieBaseModel = kieModuleModel.newKieBaseModel(); kieBaseModel.setEventProcessingMode(EventProcessingOption.STREAM); kieBaseModel.setEqualsBehavior(EqualityBehaviorOption.IDENTITY); kieBaseModel.setDefault(true); return kieBaseModel; } @Override public KieBaseConfiguration getKieBaseConfiguration() { final KieBaseConfiguration kieBaseConfiguration = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); kieBaseConfiguration.setOption(EventProcessingOption.STREAM); kieBaseConfiguration.setOption(EqualityBehaviorOption.IDENTITY); return kieBaseConfiguration; } }, /** * Represents KieBase configuration with * <code>EventProcessingOption.STREAM</code> and * <code>EqualityBehaviorOption.EQUALITY</code> options set. */ STREAM_EQUALITY { @Override public KieBaseModel getKieBaseModel(KieModuleModel kieModuleModel) { final KieBaseModel kieBaseModel = kieModuleModel.newKieBaseModel(); kieBaseModel.setEventProcessingMode(EventProcessingOption.STREAM); kieBaseModel.setEqualsBehavior(EqualityBehaviorOption.EQUALITY); kieBaseModel.setDefault(true); return kieBaseModel; } @Override public KieBaseConfiguration getKieBaseConfiguration() { final KieBaseConfiguration kieBaseConfiguration = KnowledgeBaseFactory.newKnowledgeBaseConfiguration(); kieBaseConfiguration.setOption(EventProcessingOption.STREAM); kieBaseConfiguration.setOption(EqualityBehaviorOption.EQUALITY); return kieBaseConfiguration; } } }
{ "content_hash": "bed205a3da7c1e5f5d6d05832a326356", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 115, "avg_line_length": 40.857142857142854, "alnum_prop": 0.7113199300699301, "repo_name": "sotty/drools", "id": "a798d1684a1895a29eb477681b0507fd7b6adb04", "size": "5196", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "drools-test-coverage/test-suite/src/test/java/org/drools/testcoverage/common/util/KieBaseTestConfiguration.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "14948" }, { "name": "Batchfile", "bytes": "2554" }, { "name": "CSS", "bytes": "1412" }, { "name": "GAP", "bytes": "197080" }, { "name": "HTML", "bytes": "6832" }, { "name": "Java", "bytes": "27859556" }, { "name": "Python", "bytes": "4555" }, { "name": "Ruby", "bytes": "491" }, { "name": "Shell", "bytes": "1120" }, { "name": "XSLT", "bytes": "24302" } ], "symlink_target": "" }
import RAIN.Core; import RAIN.Action; @RAINAction class ActionTemplate_JS extends RAIN.Action.RAINAction { function newclass() { actionName = "ActionTemplate_JS"; } function Start(ai:AI):void { super.Start(ai); } function Execute(ai:AI):ActionResult { return ActionResult.SUCCESS; } function Stop(ai:AI):void { super.Stop(ai); } }
{ "content_hash": "333e96b32814536badd7a5e86f25c181", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 54, "avg_line_length": 15.461538461538462, "alnum_prop": 0.6218905472636815, "repo_name": "stevetranby/labs-tilemaps", "id": "efdcf91b72fa1c0d8c0285e9e5b75b944ac175c6", "size": "404", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "tests/RAIN-tests/Assets/RAIN/Editor/ScriptTemplates/ActionTemplate_JS.js", "mode": "33261", "license": "mit", "language": [ { "name": "Boo", "bytes": "318" }, { "name": "C#", "bytes": "2012719" }, { "name": "JavaScript", "bytes": "69015" }, { "name": "Lua", "bytes": "1533" }, { "name": "PLSQL", "bytes": "32307" }, { "name": "ShaderLab", "bytes": "11046" }, { "name": "Smalltalk", "bytes": "46156" } ], "symlink_target": "" }
import hashlib import importlib import os import requests GRAMMAR_FILE_NAME = "__init__.py" GRAMMAR_FOLDER_NAME = "gen" GRAMMAR_ID = "5a0bc90e734d1d08bf70e0ff" GRAMMAR_URL = "http://localhost:2666/grammar/{}".format(GRAMMAR_ID) class GrammarRule: def __init__(self, text, data_hash): self.text = text self.data_hash = data_hash class GrammarRuleFactory: def __init__(self): self.rules = {} def _get_hash_from_dict(self, d): return hashlib.md5(str(d).encode('utf-8')).hexdigest() def get_or_create_rule(self, rulename, details, keywords): """ Creates a GrammarRule if it doesn't exist """ if rulename not in self.rules.keys() or self.rules[rulename].data_hash != self._get_hash_from_dict(details): func_string = self._get_func_string(rulename, details, keywords) self.rules[rulename] = GrammarRule(func_string, self._get_hash_from_dict(details)) return self.rules[rulename] def delete_rule(self, rulename): """ Deletes a rule """ if rulename in self.rules: del self.rules[rulename] def _get_func_string(self, rulename, details, keywords): res = "def {}(): ".format(rulename) if details['type'] == 'variable': res += "return RegExMatch(r'{}')".format(details['value'][0]) elif details['type'] == 'rule': res += "return " final_value = '' if details['join'] == 'and': final_value += "{}".format(", ".join(self._fix_list(details['value'], keywords))) elif details['join'] == 'or': final_value += "[{}]".format(", ".join(self._fix_list(details['value'], keywords))) if details['oneOrMore']: final_value = "OneOrMore({}, sep=',')".format(final_value) res += final_value return res def _fix_list(self, l, keywords): result = [] for item in l: if item in keywords: result.append('"{}"'.format(item)) else: result.append(item) return result grammarRuleFactory = GrammarRuleFactory() class GrammarState: current_hash = '' primary_key = None gen_module = None def _verify_hash(data): if data['hash'] == GrammarState.current_hash: return True GrammarState.current_hash = data['hash'] return False def _generate_file_from_data(data): if _verify_hash(data): importlib.reload(GrammarState.gen_module) keywords = set(data['keywords']) variables = set(data['variables']) grammar_folder_path = os.path.dirname(__file__) + "/" + GRAMMAR_FOLDER_NAME if not os.path.isdir(grammar_folder_path): os.mkdir(grammar_folder_path) grammar_file_path = grammar_folder_path + "/" + GRAMMAR_FILE_NAME with open(grammar_file_path, "w+") as grammar_file: grammar_file.write("# AUTOMATICALLY GENERATED\n") grammar_file.write("from arpeggio import Optional, ZeroOrMore, OneOrMore, EOF, ParserPython, NoMatch, RegExMatch\n\n") for rulename, details in data['structure'].items(): rule = grammarRuleFactory.get_or_create_rule(rulename, details, keywords) if details['isPrimary']: GrammarState.primary_key = rulename grammar_file.write(rule.text) grammar_file.write('\n\n') GrammarState.gen_module = importlib.import_module(GRAMMAR_FOLDER_NAME) importlib.reload(GrammarState.gen_module) def get_grammar_root(): res = requests.get(GRAMMAR_URL) _generate_file_from_data(res.json()) return GrammarState.gen_module.root
{ "content_hash": "9d760e67f29befef4d3d24a54974759a", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 126, "avg_line_length": 31.896551724137932, "alnum_prop": 0.6040540540540541, "repo_name": "Zubdano/zql", "id": "a8ee5d32c2c70e06fe3de0c42022348f4c5af8c0", "size": "3700", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "zql-backend/interpreter/generate.py", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "11853" }, { "name": "HTML", "bytes": "587" }, { "name": "JavaScript", "bytes": "50515" }, { "name": "Python", "bytes": "52350" }, { "name": "Shell", "bytes": "1051" } ], "symlink_target": "" }
package demo; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import org.junit.Test; import org.springframework.boot.test.web.client.TestRestTemplate; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.oauth2.client.test.OAuth2ContextConfiguration; import org.springframework.security.oauth2.client.token.grant.password.ResourceOwnerPasswordResourceDetails; import sparklr.common.AbstractImplicitProviderTests; /** * @author Dave Syer */ public class ImplicitProviderTests extends AbstractImplicitProviderTests { @Test @OAuth2ContextConfiguration(ResourceOwner.class) public void parallelGrants() throws Exception { getToken(); Collection<Future<?>> futures = new HashSet<Future<?>>(); ExecutorService pool = Executors.newFixedThreadPool(10); for (int i = 0; i < 100; i++) { futures.add(pool.submit(new Runnable() { @Override public void run() { getToken(); } })); } for (Future<?> future : futures) { future.get(); } } private void getToken() { Map<String, String> form = new LinkedHashMap<String, String>(); form.put("client_id", "my-trusted-client"); form.put("redirect_uri", "https://anywhere"); form.put("response_type", "token"); form.put("scope", "read"); ResponseEntity<Void> response = new TestRestTemplate("user", "password") .getForEntity( http.getUrl("/oauth/authorize?client_id={client_id}&redirect_uri={redirect_uri}&response_type={response_type}&scope={scope}"), Void.class, form); assertEquals(HttpStatus.SEE_OTHER, response.getStatusCode()); assertTrue(response.getHeaders().getLocation().toString().contains("access_token")); assertTrue(response.getHeaders().getFirst("Cache-Control").contains("no-store")); assertTrue(response.getHeaders().getFirst("Pragma").contains("no-cache")); } protected static class ResourceOwner extends ResourceOwnerPasswordResourceDetails { public ResourceOwner(Object target) { setClientId("my-trusted-client"); setScope(Arrays.asList("read")); setId(getClientId()); setUsername("user"); setPassword("password"); } } }
{ "content_hash": "899cd175dd8396d66a21f16e994eeb14", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 132, "avg_line_length": 33.12162162162162, "alnum_prop": 0.7458180334557324, "repo_name": "jgrandja/spring-security-oauth", "id": "a244b89d84c3d9ede3cbe98714d38d124771bd13", "size": "2451", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "tests/annotation/custom-grant/src/test/java/demo/ImplicitProviderTests.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "2437099" } ], "symlink_target": "" }
// +build linux package ipmi import ( "fmt" "os/exec" "strconv" "strings" log "github.com/sirupsen/logrus" ) // ExecIpmiToolLocal method runs ipmitool command on a local system func ExecIpmiToolLocal(request []byte, strct *LinuxInBandIpmitool) []byte { c, err := exec.LookPath("ipmitool") if err != nil { log.Debug("Unable to find ipmitool") return nil } stringRequest := []string{"-b", strct.Channel, "-t", strct.Slave, "raw"} for i := range request { stringRequest = append(stringRequest, fmt.Sprintf("0x%02x", request[i])) } ret, err := exec.Command(c, stringRequest...).CombinedOutput() if err != nil { log.Debug("Unable to run ipmitool") return nil } returnStrings := strings.Split(string(ret), " ") rets := make([]byte, len(returnStrings)) for i, element := range returnStrings { value, _ := strconv.ParseInt(element, 16, 0) rets[i] = byte(value) } return rets } // ExecIpmiToolRemote method runs ipmitool command on a remote system func ExecIpmiToolRemote(request []byte, strct *LinuxOutOfBand, addr string) []byte { c, err := exec.LookPath("ipmitool") if err != nil { log.Debug("Unable to find ipmitool") return nil } a := []string{"-I", "lanplus", "-H", addr, "-U", strct.User, "-P", strct.Pass, "-b", strct.Channel, "-t", strct.Slave, "raw"} for i := range request { a = append(a, fmt.Sprintf("0x%02x", request[i])) } ret, err := exec.Command(c, a...).CombinedOutput() if err != nil { log.Debug("Unable to run ipmitool") return nil } returnStrings := strings.Split(string(ret), " ") rets := make([]byte, len(returnStrings)) for ind, el := range returnStrings { value, _ := strconv.ParseInt(el, 16, 0) rets[ind] = byte(value) } return rets }
{ "content_hash": "2655f290fb5b27a8401838c75b19fa9a", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 126, "avg_line_length": 23.98611111111111, "alnum_prop": 0.6572090330052114, "repo_name": "intelsdi-x/snap-plugin-collector-node-manager", "id": "09342a62991dce7009ffa373ffeb7f81f29a86af", "size": "2339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ipmi/ipmitool.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "5207" }, { "name": "Go", "bytes": "38339" }, { "name": "Makefile", "bytes": "1102" }, { "name": "Ruby", "bytes": "9167" }, { "name": "Shell", "bytes": "13191" } ], "symlink_target": "" }
package com.github.dockerjava.netty.handler; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.SimpleChannelInboundHandler; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.github.dockerjava.api.async.ResultCallback; /** * Handler that decodes an incoming byte stream into objects of T and calls {@link ResultCallback#onNext(Object)} * * @author Marcus Linke */ public class JsonResponseCallbackHandler<T> extends SimpleChannelInboundHandler<ByteBuf> { private static ObjectMapper objectMapper = new ObjectMapper(); private TypeReference<T> typeReference; private ResultCallback<T> callback; public JsonResponseCallbackHandler(TypeReference<T> typeReference, ResultCallback<T> callback) { this.typeReference = typeReference; this.callback = callback; } @Override protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception { byte[] buffer = new byte[msg.readableBytes()]; msg.readBytes(buffer); msg.discardReadBytes(); T object = null; try { object = objectMapper.readValue(buffer, typeReference); } catch (Exception e) { callback.onError(e); throw new RuntimeException(e); } callback.onNext(object); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { callback.onError(cause); ctx.close(); } }
{ "content_hash": "39124efa95ec7f7293f09617d72055d9", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 113, "avg_line_length": 30.46153846153846, "alnum_prop": 0.7121212121212122, "repo_name": "llamahunter/docker-java", "id": "db20d6216964aa1976782cfbeb993ad1a6e38f5e", "size": "1584", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/main/java/com/github/dockerjava/netty/handler/JsonResponseCallbackHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1335481" }, { "name": "Shell", "bytes": "2953" } ], "symlink_target": "" }
#include <sys/cdefs.h> __FBSDID("$FreeBSD: releng/9.3/sys/kern/vfs_extattr.c 250248 2013-05-04 18:44:14Z mdf $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/capability.h> #include <sys/lock.h> #include <sys/mount.h> #include <sys/mutex.h> #include <sys/sysproto.h> #include <sys/fcntl.h> #include <sys/namei.h> #include <sys/filedesc.h> #include <sys/limits.h> #include <sys/vnode.h> #include <sys/proc.h> #include <sys/extattr.h> #include <security/audit/audit.h> #include <security/mac/mac_framework.h> /* * Syscall to push extended attribute configuration information into the VFS. * Accepts a path, which it converts to a mountpoint, as well as a command * (int cmd), and attribute name and misc data. * * Currently this is used only by UFS1 extended attributes. */ int sys_extattrctl(td, uap) struct thread *td; struct extattrctl_args /* { const char *path; int cmd; const char *filename; int attrnamespace; const char *attrname; } */ *uap; { struct vnode *filename_vp; struct nameidata nd; struct mount *mp, *mp_writable; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, fnvfslocked, error; AUDIT_ARG_CMD(uap->cmd); AUDIT_ARG_VALUE(uap->attrnamespace); /* * uap->attrname is not always defined. We check again later when we * invoke the VFS call so as to pass in NULL there if needed. */ if (uap->attrname != NULL) { error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); } AUDIT_ARG_TEXT(attrname); vfslocked = fnvfslocked = 0; mp = NULL; filename_vp = NULL; if (uap->filename != NULL) { NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE2, UIO_USERSPACE, uap->filename, td); error = namei(&nd); if (error) return (error); fnvfslocked = NDHASGIANT(&nd); filename_vp = nd.ni_vp; NDFREE(&nd, NDF_NO_VP_RELE); } /* uap->path is always defined. */ NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | LOCKLEAF | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) goto out; vfslocked = NDHASGIANT(&nd); mp = nd.ni_vp->v_mount; error = vfs_busy(mp, 0); if (error) { NDFREE(&nd, 0); mp = NULL; goto out; } VOP_UNLOCK(nd.ni_vp, 0); error = vn_start_write(nd.ni_vp, &mp_writable, V_WAIT | PCATCH); NDFREE(&nd, NDF_NO_VP_UNLOCK); if (error) goto out; if (filename_vp != NULL) { /* * uap->filename is not always defined. If it is, * grab a vnode lock, which VFS_EXTATTRCTL() will * later release. */ error = vn_lock(filename_vp, LK_EXCLUSIVE); if (error) { vn_finished_write(mp_writable); goto out; } } error = VFS_EXTATTRCTL(mp, uap->cmd, filename_vp, uap->attrnamespace, uap->attrname != NULL ? attrname : NULL); vn_finished_write(mp_writable); out: if (mp != NULL) vfs_unbusy(mp); /* * VFS_EXTATTRCTL will have unlocked, but not de-ref'd, filename_vp, * so vrele it if it is defined. */ if (filename_vp != NULL) vrele(filename_vp); VFS_UNLOCK_GIANT(fnvfslocked); VFS_UNLOCK_GIANT(vfslocked); return (error); } /*- * Set a named extended attribute on a file or directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", * kernelspace string pointer "attrname", userspace buffer * pointer "data", buffer length "nbytes", thread "td". * Returns: 0 on success, an error number otherwise * Locks: none * References: vp must be a valid reference for the duration of the call */ static int extattr_set_vp(struct vnode *vp, int attrnamespace, const char *attrname, void *data, size_t nbytes, struct thread *td) { struct mount *mp; struct uio auio; struct iovec aiov; ssize_t cnt; int error; VFS_ASSERT_GIANT(vp->v_mount); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error) return (error); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); aiov.iov_base = data; aiov.iov_len = nbytes; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = 0; if (nbytes > IOSIZE_MAX) { error = EINVAL; goto done; } auio.uio_resid = nbytes; auio.uio_rw = UIO_WRITE; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; cnt = nbytes; #ifdef MAC error = mac_vnode_check_setextattr(td->td_ucred, vp, attrnamespace, attrname); if (error) goto done; #endif error = VOP_SETEXTATTR(vp, attrnamespace, attrname, &auio, td->td_ucred, td); cnt -= auio.uio_resid; td->td_retval[0] = cnt; done: VOP_UNLOCK(vp, 0); vn_finished_write(mp); return (error); } int sys_extattr_set_fd(td, uap) struct thread *td; struct extattr_set_fd_args /* { int fd; int attrnamespace; const char *attrname; void *data; size_t nbytes; } */ *uap; { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); error = getvnode(td->td_proc->p_fd, uap->fd, CAP_EXTATTR_SET, &fp); if (error) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_set_vp(fp->f_vnode, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); fdrop(fp, td); VFS_UNLOCK_GIANT(vfslocked); return (error); } int sys_extattr_set_file(td, uap) struct thread *td; struct extattr_set_file_args /* { const char *path; int attrnamespace; const char *attrname; void *data; size_t nbytes; } */ *uap; { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error); } int sys_extattr_set_link(td, uap) struct thread *td; struct extattr_set_link_args /* { const char *path; int attrnamespace; const char *attrname; void *data; size_t nbytes; } */ *uap; { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error); } /*- * Get a named extended attribute on a file or directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", * kernelspace string pointer "attrname", userspace buffer * pointer "data", buffer length "nbytes", thread "td". * Returns: 0 on success, an error number otherwise * Locks: none * References: vp must be a valid reference for the duration of the call */ static int extattr_get_vp(struct vnode *vp, int attrnamespace, const char *attrname, void *data, size_t nbytes, struct thread *td) { struct uio auio, *auiop; struct iovec aiov; ssize_t cnt; size_t size, *sizep; int error; VFS_ASSERT_GIANT(vp->v_mount); vn_lock(vp, LK_SHARED | LK_RETRY); /* * Slightly unusual semantics: if the user provides a NULL data * pointer, they don't want to receive the data, just the maximum * read length. */ auiop = NULL; sizep = NULL; cnt = 0; if (data != NULL) { aiov.iov_base = data; aiov.iov_len = nbytes; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = 0; if (nbytes > IOSIZE_MAX) { error = EINVAL; goto done; } auio.uio_resid = nbytes; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; auiop = &auio; cnt = nbytes; } else sizep = &size; #ifdef MAC error = mac_vnode_check_getextattr(td->td_ucred, vp, attrnamespace, attrname); if (error) goto done; #endif error = VOP_GETEXTATTR(vp, attrnamespace, attrname, auiop, sizep, td->td_ucred, td); if (auiop != NULL) { cnt -= auio.uio_resid; td->td_retval[0] = cnt; } else td->td_retval[0] = size; done: VOP_UNLOCK(vp, 0); return (error); } int sys_extattr_get_fd(td, uap) struct thread *td; struct extattr_get_fd_args /* { int fd; int attrnamespace; const char *attrname; void *data; size_t nbytes; } */ *uap; { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); error = getvnode(td->td_proc->p_fd, uap->fd, CAP_EXTATTR_GET, &fp); if (error) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_get_vp(fp->f_vnode, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); fdrop(fp, td); VFS_UNLOCK_GIANT(vfslocked); return (error); } int sys_extattr_get_file(td, uap) struct thread *td; struct extattr_get_file_args /* { const char *path; int attrnamespace; const char *attrname; void *data; size_t nbytes; } */ *uap; { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error); } int sys_extattr_get_link(td, uap) struct thread *td; struct extattr_get_link_args /* { const char *path; int attrnamespace; const char *attrname; void *data; size_t nbytes; } */ *uap; { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_get_vp(nd.ni_vp, uap->attrnamespace, attrname, uap->data, uap->nbytes, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error); } /* * extattr_delete_vp(): Delete a named extended attribute on a file or * directory * * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", * kernelspace string pointer "attrname", proc "p" * Returns: 0 on success, an error number otherwise * Locks: none * References: vp must be a valid reference for the duration of the call */ static int extattr_delete_vp(struct vnode *vp, int attrnamespace, const char *attrname, struct thread *td) { struct mount *mp; int error; VFS_ASSERT_GIANT(vp->v_mount); error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error) return (error); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); #ifdef MAC error = mac_vnode_check_deleteextattr(td->td_ucred, vp, attrnamespace, attrname); if (error) goto done; #endif error = VOP_DELETEEXTATTR(vp, attrnamespace, attrname, td->td_ucred, td); if (error == EOPNOTSUPP) error = VOP_SETEXTATTR(vp, attrnamespace, attrname, NULL, td->td_ucred, td); #ifdef MAC done: #endif VOP_UNLOCK(vp, 0); vn_finished_write(mp); return (error); } int sys_extattr_delete_fd(td, uap) struct thread *td; struct extattr_delete_fd_args /* { int fd; int attrnamespace; const char *attrname; } */ *uap; { struct file *fp; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); error = getvnode(td->td_proc->p_fd, uap->fd, CAP_EXTATTR_DELETE, &fp); if (error) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_delete_vp(fp->f_vnode, uap->attrnamespace, attrname, td); fdrop(fp, td); VFS_UNLOCK_GIANT(vfslocked); return (error); } int sys_extattr_delete_file(td, uap) struct thread *td; struct extattr_delete_file_args /* { const char *path; int attrnamespace; const char *attrname; } */ *uap; { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return(error); AUDIT_ARG_TEXT(attrname); NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return(error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return(error); } int sys_extattr_delete_link(td, uap) struct thread *td; struct extattr_delete_link_args /* { const char *path; int attrnamespace; const char *attrname; } */ *uap; { struct nameidata nd; char attrname[EXTATTR_MAXNAMELEN]; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); if (error) return(error); AUDIT_ARG_TEXT(attrname); NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return(error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return(error); } /*- * Retrieve a list of extended attributes on a file or directory. * * Arguments: unlocked vnode "vp", attribute namespace 'attrnamespace", * userspace buffer pointer "data", buffer length "nbytes", * thread "td". * Returns: 0 on success, an error number otherwise * Locks: none * References: vp must be a valid reference for the duration of the call */ static int extattr_list_vp(struct vnode *vp, int attrnamespace, void *data, size_t nbytes, struct thread *td) { struct uio auio, *auiop; size_t size, *sizep; struct iovec aiov; ssize_t cnt; int error; VFS_ASSERT_GIANT(vp->v_mount); vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); auiop = NULL; sizep = NULL; cnt = 0; if (data != NULL) { aiov.iov_base = data; aiov.iov_len = nbytes; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; auio.uio_offset = 0; if (nbytes > IOSIZE_MAX) { error = EINVAL; goto done; } auio.uio_resid = nbytes; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; auiop = &auio; cnt = nbytes; } else sizep = &size; #ifdef MAC error = mac_vnode_check_listextattr(td->td_ucred, vp, attrnamespace); if (error) goto done; #endif error = VOP_LISTEXTATTR(vp, attrnamespace, auiop, sizep, td->td_ucred, td); if (auiop != NULL) { cnt -= auio.uio_resid; td->td_retval[0] = cnt; } else td->td_retval[0] = size; done: VOP_UNLOCK(vp, 0); return (error); } int sys_extattr_list_fd(td, uap) struct thread *td; struct extattr_list_fd_args /* { int fd; int attrnamespace; void *data; size_t nbytes; } */ *uap; { struct file *fp; int vfslocked, error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); error = getvnode(td->td_proc->p_fd, uap->fd, CAP_EXTATTR_LIST, &fp); if (error) return (error); vfslocked = VFS_LOCK_GIANT(fp->f_vnode->v_mount); error = extattr_list_vp(fp->f_vnode, uap->attrnamespace, uap->data, uap->nbytes, td); fdrop(fp, td); VFS_UNLOCK_GIANT(vfslocked); return (error); } int sys_extattr_list_file(td, uap) struct thread*td; struct extattr_list_file_args /* { const char *path; int attrnamespace; void *data; size_t nbytes; } */ *uap; { struct nameidata nd; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); NDINIT(&nd, LOOKUP, MPSAFE | FOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, uap->nbytes, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error); } int sys_extattr_list_link(td, uap) struct thread*td; struct extattr_list_link_args /* { const char *path; int attrnamespace; void *data; size_t nbytes; } */ *uap; { struct nameidata nd; int vfslocked, error; AUDIT_ARG_VALUE(uap->attrnamespace); NDINIT(&nd, LOOKUP, MPSAFE | NOFOLLOW | AUDITVNODE1, UIO_USERSPACE, uap->path, td); error = namei(&nd); if (error) return (error); NDFREE(&nd, NDF_ONLY_PNBUF); vfslocked = NDHASGIANT(&nd); error = extattr_list_vp(nd.ni_vp, uap->attrnamespace, uap->data, uap->nbytes, td); vrele(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); return (error); }
{ "content_hash": "7970bd3a8ad1f6afe6cb42782045abd2", "timestamp": "", "source": "github", "line_count": 769, "max_line_length": 90, "avg_line_length": 22.81664499349805, "alnum_prop": 0.6686424256240738, "repo_name": "dcui/FreeBSD-9.3_kernel", "id": "df053889ce7448b4fc4ce9658d2ca82b9a7a06be", "size": "18990", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "sys/kern/vfs_extattr.c", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Assembly", "bytes": "1740660" }, { "name": "Awk", "bytes": "135150" }, { "name": "Batchfile", "bytes": "158" }, { "name": "C", "bytes": "189969174" }, { "name": "C++", "bytes": "2113755" }, { "name": "DTrace", "bytes": "19810" }, { "name": "Forth", "bytes": "188128" }, { "name": "Groff", "bytes": "147703" }, { "name": "Lex", "bytes": "65561" }, { "name": "Logos", "bytes": "6310" }, { "name": "Makefile", "bytes": "594606" }, { "name": "Mathematica", "bytes": "9538" }, { "name": "Objective-C", "bytes": "527964" }, { "name": "PHP", "bytes": "2404" }, { "name": "Perl", "bytes": "3348" }, { "name": "Python", "bytes": "7091" }, { "name": "Shell", "bytes": "43402" }, { "name": "SourcePawn", "bytes": "253" }, { "name": "Yacc", "bytes": "160534" } ], "symlink_target": "" }
MixerAudioSource::MixerAudioSource() : currentSampleRate (0.0), bufferSizeExpected (0) { } MixerAudioSource::~MixerAudioSource() { removeAllInputs(); } //============================================================================== void MixerAudioSource::addInputSource (AudioSource* input, const bool deleteWhenRemoved) { if (input != nullptr && ! inputs.contains (input)) { double localRate; int localBufferSize; { const ScopedLock sl (lock); localRate = currentSampleRate; localBufferSize = bufferSizeExpected; } if (localRate > 0.0) input->prepareToPlay (localBufferSize, localRate); const ScopedLock sl (lock); inputsToDelete.setBit (inputs.size(), deleteWhenRemoved); inputs.add (input); } } void MixerAudioSource::removeInputSource (AudioSource* const input) { if (input != nullptr) { ScopedPointer<AudioSource> toDelete; { const ScopedLock sl (lock); const int index = inputs.indexOf (input); if (index < 0) return; if (inputsToDelete [index]) toDelete = input; inputsToDelete.shiftBits (-1, index); inputs.remove (index); } input->releaseResources(); } } void MixerAudioSource::removeAllInputs() { OwnedArray<AudioSource> toDelete; { const ScopedLock sl (lock); for (int i = inputs.size(); --i >= 0;) if (inputsToDelete[i]) toDelete.add (inputs.getUnchecked(i)); inputs.clear(); } for (int i = toDelete.size(); --i >= 0;) toDelete.getUnchecked(i)->releaseResources(); } void MixerAudioSource::prepareToPlay (int samplesPerBlockExpected, double sampleRate) { tempBuffer.setSize (2, samplesPerBlockExpected); const ScopedLock sl (lock); currentSampleRate = sampleRate; bufferSizeExpected = samplesPerBlockExpected; for (int i = inputs.size(); --i >= 0;) inputs.getUnchecked(i)->prepareToPlay (samplesPerBlockExpected, sampleRate); } void MixerAudioSource::releaseResources() { const ScopedLock sl (lock); for (int i = inputs.size(); --i >= 0;) inputs.getUnchecked(i)->releaseResources(); tempBuffer.setSize (2, 0); currentSampleRate = 0; bufferSizeExpected = 0; } void MixerAudioSource::getNextAudioBlock (const AudioSourceChannelInfo& info) { const ScopedLock sl (lock); if (inputs.size() > 0) { inputs.getUnchecked(0)->getNextAudioBlock (info); if (inputs.size() > 1) { tempBuffer.setSize (jmax (1, info.buffer->getNumChannels()), info.buffer->getNumSamples()); AudioSourceChannelInfo info2 (&tempBuffer, 0, info.numSamples); for (int i = 1; i < inputs.size(); ++i) { inputs.getUnchecked(i)->getNextAudioBlock (info2); for (int chan = 0; chan < info.buffer->getNumChannels(); ++chan) info.buffer->addFrom (chan, info.startSample, tempBuffer, chan, 0, info.numSamples); } } } else { info.clearActiveBufferRegion(); } }
{ "content_hash": "d3300ed89e751671f51c1b24772adbdf", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 104, "avg_line_length": 24.69172932330827, "alnum_prop": 0.5782582216808769, "repo_name": "waateam/ScoringTable", "id": "261fff7494a43ebf7d34ee0b7e8efc860fecd5ec", "size": "4189", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "src/third_party/JUCE/modules/juce_audio_basics/sources/juce_MixerAudioSource.cpp", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "7930" }, { "name": "C++", "bytes": "30897" } ], "symlink_target": "" }
import React, {PropTypes, Component} from 'react'; import Immutable from 'immutable'; import transform from 'svg-transform'; import document from 'global/document'; import config from '../config'; import ViewportMercator from 'viewport-mercator-project'; function noop() {} function mouse(container, event) { const rect = container.getBoundingClientRect(); const x = event.clientX - rect.left - container.clientLeft; const y = event.clientY - rect.top - container.clientTop; return [x, y]; } export default class DraggablePointsOverlay extends Component { static propTypes = { width: PropTypes.number.isRequired, height: PropTypes.number.isRequired, latitude: PropTypes.number.isRequired, longitude: PropTypes.number.isRequired, zoom: PropTypes.number.isRequired, points: PropTypes.instanceOf(Immutable.List).isRequired, isDragging: PropTypes.bool.isRequired, keyAccessor: PropTypes.func.isRequired, lngLatAccessor: PropTypes.func.isRequired, onAddPoint: PropTypes.func.isRequired, onUpdatePoint: PropTypes.func.isRequired, renderPoint: PropTypes.func.isRequired }; static defaultProps = { keyAccessor: point => point.get('id'), lngLatAccessor: point => point.get('location').toArray(), onAddPoint: noop, onUpdatePoint: noop, renderPoint: noop, isDragging: false }; constructor(props) { super(props); this.state = { draggedPointKey: null }; this._onDragStart = this._onDragStart.bind(this); this._onDrag = this._onDrag.bind(this); this._onDragEnd = this._onDragEnd.bind(this); this._addPoint = this._addPoint.bind(this); } _onDragStart(point, event) { event.stopPropagation(); document.addEventListener('mousemove', this._onDrag, false); document.addEventListener('mouseup', this._onDragEnd, false); this.setState({draggedPointKey: this.props.keyAccessor(point)}); } _onDrag(event) { event.stopPropagation(); const pixel = mouse(this.refs.container, event); const mercator = ViewportMercator(this.props); const lngLat = mercator.unproject(pixel); const key = this.state.draggedPointKey; this.props.onUpdatePoint({key, location: lngLat}); } _onDragEnd(event) { event.stopPropagation(); document.removeEventListener('mousemove', this._onDrag, false); document.removeEventListener('mouseup', this._onDragEnd, false); this.setState({draggedPoint: null}); } _addPoint(event) { event.stopPropagation(); event.preventDefault(); const pixel = mouse(this.refs.container, event); const mercator = ViewportMercator(this.props); this.props.onAddPoint(mercator.unproject(pixel)); } render() { const {points, width, height, isDragging, style} = this.props; const mercator = ViewportMercator(this.props); return ( <svg ref="container" width={ width } height={ height } style={ { pointerEvents: 'all', position: 'absolute', left: 0, top: 0, cursor: isDragging ? config.CURSOR.GRABBING : config.CURSOR.GRAB, ...style } } onContextMenu={ this._addPoint }> <g style={ {cursor: 'pointer'} }> { points.map((point, index) => { const pixel = mercator.project(this.props.lngLatAccessor(point)); return ( <g key={ index } style={ {pointerEvents: 'all'} } transform={ transform([{translate: pixel}]) } onMouseDown={ this._onDragStart.bind(this, point) }> { this.props.renderPoint.call(this, point, pixel) } </g> ); }) } </g> </svg> ); } }
{ "content_hash": "19f665e7634363d835ce86f42f251f33", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 79, "avg_line_length": 30.523809523809526, "alnum_prop": 0.6305252210088403, "repo_name": "RanaRunning/rana", "id": "d8acfc85d0010a83725191979653482945173d82", "size": "4962", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "web/src/components/MapGL/overlays/draggable-points.react.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "596337" }, { "name": "HTML", "bytes": "3236" }, { "name": "Java", "bytes": "1311" }, { "name": "JavaScript", "bytes": "1025268" }, { "name": "Objective-C", "bytes": "4405" }, { "name": "Python", "bytes": "1722" } ], "symlink_target": "" }
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("dnsweb")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("dnsweb")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("92133317-6af6-47fe-b358-5159213264f1")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{ "content_hash": "693f107dd647ba26efdd358edd6ac3e5", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 84, "avg_line_length": 39.285714285714285, "alnum_prop": 0.7301818181818182, "repo_name": "ecleveland/IoTHackathon", "id": "0e9711f97ac420d5bc2c55929379489a3938f8ee", "size": "1378", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "webapp/dnsweb/Properties/AssemblyInfo.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "101" }, { "name": "Arduino", "bytes": "2150" }, { "name": "C", "bytes": "10239" }, { "name": "C#", "bytes": "174595" }, { "name": "C++", "bytes": "3854" }, { "name": "CSS", "bytes": "2777" }, { "name": "HTML", "bytes": "10165" }, { "name": "JavaScript", "bytes": "14514" } ], "symlink_target": "" }
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>basic_raw_socket::basic_raw_socket (3 of 6 overloads)</title> <link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"> <link rel="home" href="../../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../basic_raw_socket.html" title="basic_raw_socket::basic_raw_socket"> <link rel="prev" href="overload2.html" title="basic_raw_socket::basic_raw_socket (2 of 6 overloads)"> <link rel="next" href="overload4.html" title="basic_raw_socket::basic_raw_socket (4 of 6 overloads)"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> <td align="center"><a href="../../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="overload2.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_raw_socket.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload4.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h5 class="title"> <a name="boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3"></a><a class="link" href="overload3.html" title="basic_raw_socket::basic_raw_socket (3 of 6 overloads)">basic_raw_socket::basic_raw_socket (3 of 6 overloads)</a> </h5></div></div></div> <p> Construct a <a class="link" href="../../basic_raw_socket.html" title="basic_raw_socket"><code class="computeroutput"><span class="identifier">basic_raw_socket</span></code></a>, opening it and binding it to the given local endpoint. </p> <pre class="programlisting"><span class="identifier">basic_raw_socket</span><span class="special">(</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">asio</span><span class="special">::</span><span class="identifier">io_service</span> <span class="special">&amp;</span> <span class="identifier">io_service</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">endpoint_type</span> <span class="special">&amp;</span> <span class="identifier">endpoint</span><span class="special">);</span> </pre> <p> This constructor creates a raw socket and automatically opens it bound to the specified endpoint on the local machine. The protocol used is the protocol associated with the given endpoint. </p> <h6> <a name="boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3.h0"></a> <span class="phrase"><a name="boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3.parameters"></a></span><a class="link" href="overload3.html#boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3.parameters">Parameters</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl class="variablelist"> <dt><span class="term">io_service</span></dt> <dd><p> The <a class="link" href="../../io_service.html" title="io_service"><code class="computeroutput"><span class="identifier">io_service</span></code></a> object that the raw socket will use to dispatch handlers for any asynchronous operations performed on the socket. </p></dd> <dt><span class="term">endpoint</span></dt> <dd><p> An endpoint on the local machine to which the raw socket will be bound. </p></dd> </dl> </div> <h6> <a name="boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3.h1"></a> <span class="phrase"><a name="boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3.exceptions"></a></span><a class="link" href="overload3.html#boost_asio.reference.basic_raw_socket.basic_raw_socket.overload3.exceptions">Exceptions</a> </h6> <div class="variablelist"> <p class="title"><b></b></p> <dl class="variablelist"> <dt><span class="term">boost::system::system_error</span></dt> <dd><p> Thrown on failure. </p></dd> </dl> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2013 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="overload2.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../basic_raw_socket.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload4.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
{ "content_hash": "17133fd7d61d6e0bda354d1013a67796", "timestamp": "", "source": "github", "line_count": 90, "max_line_length": 447, "avg_line_length": 65.53333333333333, "alnum_prop": 0.6320786707358427, "repo_name": "ryancoleman/autodock-vina", "id": "c2f93397d765e97600ca34584e458ae8bb8ea2e7", "size": "5898", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "boost_1_54_0/doc/html/boost_asio/reference/basic_raw_socket/basic_raw_socket/overload3.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "106823" }, { "name": "C++", "bytes": "198249" } ], "symlink_target": "" }
package com.izforge.izpack.compiler; import junit.framework.TestCase; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class ByteCountingOutputStreamTest extends TestCase { public void testWriting() throws IOException { File temp = File.createTempFile("foo", "bar"); FileOutputStream fout = new FileOutputStream(temp); ByteCountingOutputStream out = new ByteCountingOutputStream(fout); byte[] data = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; out.write(data); out.write(data, 3, 2); out.write(1024); out.close(); TestCase.assertEquals(16, out.getByteCount()); } }
{ "content_hash": "30d7a6410482a1ccc19de7e2760312de", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 74, "avg_line_length": 23.689655172413794, "alnum_prop": 0.6593886462882096, "repo_name": "Sage-ERP-X3/izpack", "id": "00e9b3fbc0afe27bc0cb347a194e8074b4c6fd62", "size": "1382", "binary": false, "copies": "5", "ref": "refs/heads/release/4.3.10", "path": "src/tests/com/izforge/izpack/compiler/ByteCountingOutputStreamTest.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "8250" }, { "name": "C", "bytes": "6962" }, { "name": "C++", "bytes": "115766" }, { "name": "CSS", "bytes": "6140" }, { "name": "HTML", "bytes": "4915" }, { "name": "Java", "bytes": "3531536" }, { "name": "JavaScript", "bytes": "2166" }, { "name": "Makefile", "bytes": "149" }, { "name": "Python", "bytes": "16772" }, { "name": "QMake", "bytes": "395" }, { "name": "Shell", "bytes": "31042" }, { "name": "TeX", "bytes": "35053" }, { "name": "XSLT", "bytes": "519" } ], "symlink_target": "" }
// // NNOAuth2Client.h // NNNetwork // // Copyright (c) 2012 Tomaz Nedeljko (http://nedeljko.com) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #import "NNOAuthClient.h" @class NNOAuth2Credential; /** `NNOAuth2Client` provides a way to communicate with an OAuth 2.0 service. ### Authorization Process `NNOAuth2Client` provides methods for a typical three step redirection-based authorization process with authorization code grant. You should generally implement the following approach: 1. Request authorization with service provider via `beginAuthorizationWithPath:redirectURI:scope:state:success:failure:`. 2. Navigate to resource owner authorization endpoint in Safari or a dedicated `UIWebView` and allow the user to grant your application access. 3. Use `obtainCredentialWithPath:code:redirectURI:success:failure:` to obtain credential with access token from provider. ### Subclassing Notes You should subclass `NNOAuth2Client` as you would `AFHTTPClient`. If your OAuth service requires a specialized authorization or authentication technique, you should also consider overriding other methods. #### Methods to Override If you wish to change the authorization mechanism, you should override any of the methods `beginAuthorizationWithPath:redirectURI:scope:state:success:failure:` or `obtainCredentialWithPath:code:redirectURI:success:failure:` depending on what part you wish to change. If you wish to change the authentication mechanism, you should override mehods as described for `NNOAuthClient`. */ @interface NNOAuth2Client : NNOAuthClient ///------------------------ /// @name Authorizing Users ///------------------------ /** Creates an `AFHTTPRequestOperation` with a `POST` request, and enqueues it to the OAuth client’s operation queue. On completion it parses the response and passes authorization code and scope to the `success` block parameter. For client to be able to parse the response successfully, `path` should be a valid authorization endpoint. To learn more about this, see the 4.1.1 section of [The OAuth 2.0 Authorization Framework](http://tools.ietf.org/html/draft-ietf-oauth-v2-31). @param path The path to be appended to the HTTP client's base URL and used as the request URL. This path should be a valid authorization endpoint. @param redirectURI The URI to redirect back to after user grants or denies access. @param scope The scope of the access request. @param state An opaque value used by the client to maintain state between the request and callback. @param success A block object to be executed when the request operation finishes parsing a temporary credential successfully. This block has no return value and takes three arguments: the created request operation, authorization code and scope. @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes two arguments: the created request operation and the `NSError` object describing the network or parsing error that occurred. */ - (void)beginAuthorizationWithPath:(NSString *)path redirectURI:(NSURL *)redirectURI scope:(NSString *)scope state:(NSString *)state success:(void (^)(AFHTTPRequestOperation *operation, NSString *code, NSString *scope))success failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; /** Creates an `AFHTTPRequestOperation` with a `POST` request, and enqueues it to the OAuth client’s operation queue. On completion it parses the response and passes account credential to the `success` block parameter. For client to be able to parse the response successfully, `path` should be a valid token endpoint. To learn more about this, see the 4.1.3 section of [The OAuth 2.0 Authorization Framework](http://tools.ietf.org/html/draft-ietf-oauth-v2-31). @param path The path to be appended to the HTTP client's base URL and used as the request URL. This path should be a valid token endpoint. @param code Authorization code for the request. @param redirectURI The URI to redirect back to after user grants or denies access. @param success A block object to be executed when the request operation finishes parsing a temporary credential successfully. This block has no return value and takes two arguments: the created request operation and parsed credential. @param failure A block object to be executed when the request operation finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes two arguments: the created request operation and the `NSError` object describing the network or parsing error that occurred. */ - (void)obtainCredentialWithPath:(NSString *)path code:(NSString *)code redirectURI:(NSURL *)redirectURI success:(void (^)(AFHTTPRequestOperation *operation, NNOAuth2Credential *credential))success failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error))failure; @end
{ "content_hash": "a54d31130cc8c3ea3800632cb2462bea", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 475, "avg_line_length": 71.17977528089888, "alnum_prop": 0.7528018942383583, "repo_name": "tomazsh/NNNetwork", "id": "5a64cd4a1387b5dbcc116f5a3316d0f53ff3fa7e", "size": "6339", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "NNNetwork/NNOAuth2Client.h", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "179367" }, { "name": "Ruby", "bytes": "1451" } ], "symlink_target": "" }
""" Demonstration of the asyncio module in Python 3.5 This simulation is composed of three layers, each of which will split up the data into some different subsets, pass the subsets off to the next layer, wait for results, and then do some non-trivial processing to return to the previous layer (in this case, sleeping for a few seconds). The expensive operations are offloaded to a ThreadPoolExecutor, which maintains a pool of processing threads, allowing for the utilization of multiple cores (hypothetically). """ import asyncio import logging import time from concurrent.futures import ThreadPoolExecutor logging.basicConfig(format="[%(thread)-5d]%(asctime)s: %(message)s") logger = logging.getLogger('async') logger.setLevel(logging.INFO) executor = ThreadPoolExecutor(max_workers=10) loop = asyncio.get_event_loop() def cpu_bound_op(exec_time, *data): """ Simulation of a long-running CPU-bound operation :param exec_time: how long this operation will take :param data: data to "process" (sum it up) :return: the processed result """ logger.info("Running cpu-bound op on {} for {} seconds".format(data, exec_time)) time.sleep(exec_time) return sum(data) async def process_pipeline(data): # just pass the data along to level_a and return the results results = await level_a(data) return results async def level_a(data): # tweak the data a few different ways and pass them each to level b. level_b_inputs = data, 2*data, 3*data results = await asyncio.gather(*[level_b(val) for val in level_b_inputs]) # we've now effectively called level_b(...) three times with three inputs, # and (once the await returns) they've all finished, so now we'll take # the results and pass them along to our own long-running CPU-bound # process via the thread pool. # Note the signature of run_in_executor: (executor, func, *args) # The third argument and beyond will be passed to cpu_bound_op when it is called. result = await loop.run_in_executor(executor, cpu_bound_op, 3, *results) # level a processing is now done, pass back the results return result async def level_b(data): # similar to level a level_c_inputs = data/2, data/4, data/7 results = await asyncio.gather(*[level_c(val) for val in level_c_inputs]) result = await loop.run_in_executor(executor, cpu_bound_op, 2, *results) return result async def level_c(data): # final level - queue up the long-running CPU-bound process in the # thread pool immediately result = await loop.run_in_executor(executor, cpu_bound_op, 1, data) return result def main(): start_time = time.time() result = loop.run_until_complete(process_pipeline(2.5)) logger.info("Completed ({}) in {} seconds".format(result, time.time() - start_time)) if __name__ == '__main__': main()
{ "content_hash": "3506e5f89d26e4adaffc7b3618f52b36", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 88, "avg_line_length": 39.72222222222222, "alnum_prop": 0.7115384615384616, "repo_name": "dmeklund/asyncdemo", "id": "6831711c626bab222298b8b4c9f5c2d8b098409b", "size": "2860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "asynctest.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "7494" } ], "symlink_target": "" }
goog.provide('shaka.util.IBandwidthEstimator'); /** * @event shaka.util.IBandwidthEstimator.BandwidthEvent * @description Fired when a new bandwidth estimate is available. * @property {string} type 'bandwidth' * @property {boolean} bubbles false */ /** * Tracks bandwidth samples and estimates available bandwidth. * * @interface * @extends {EventTarget} */ shaka.util.IBandwidthEstimator = function() {}; /** * Takes a bandwidth sample and dispatches a 'bandwidth' event. * * @fires shaka.util.IBandwidthEstimator.BandwidthEvent * * @param {number} delayMs The time it took to collect the sample, in ms. * @param {number} bytes The number of bytes downloaded. * @expose */ shaka.util.IBandwidthEstimator.prototype.sample = function(delayMs, bytes) {}; /** * Get estimated bandwidth in bits per second. * * @return {number} * @expose */ shaka.util.IBandwidthEstimator.prototype.getBandwidth = function() {}; /** * Get the age of the data in seconds. This is the time since the last sample * was collected. * * @return {number} * @expose */ shaka.util.IBandwidthEstimator.prototype.getDataAge = function() {}; /** * Indicates that this BandwidthEstimator can correctly handle bandwidth * samples from cached responses. * * Cached responses make bandwidth estimation difficult, which then makes * sensible adaptation decisions difficult or impossible. So, it's recommended * that implementations return false, unless they were explicitly designed to * take into account cached responses. * * If this returns false then all AJAX requests using this BandwidthEstimator * will force the end-point to forego caching. * * @return {boolean} * @expose */ shaka.util.IBandwidthEstimator.prototype.supportsCaching = function() {};
{ "content_hash": "4d8c6c3c565886e770d9e969d235de37", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 78, "avg_line_length": 25.070422535211268, "alnum_prop": 0.7337078651685394, "repo_name": "viniciusferreira/shaka-player", "id": "3182fef57cb5da17b317c40782118ae46b661425", "size": "2478", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "lib/util/i_bandwidth_estimator.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "135" }, { "name": "CSS", "bytes": "6026" }, { "name": "HTML", "bytes": "110408" }, { "name": "JavaScript", "bytes": "866910" }, { "name": "Python", "bytes": "3656" }, { "name": "Shell", "bytes": "10958" } ], "symlink_target": "" }
package eu.hyvar.feature.expression.resource.hyexpression.ui; import java.io.ByteArrayInputStream; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.swt.graphics.Image; import org.eclipse.ui.IMarkerResolution; import org.eclipse.ui.IMarkerResolution2; import org.eclipse.ui.IMarkerResolutionGenerator; public class HyexpressionMarkerResolutionGenerator implements IMarkerResolutionGenerator { public IMarkerResolution[] getResolutions(IMarker marker) { try { if (!hasQuickFixes(marker)) { return new IMarkerResolution[] {}; } IResource resource = marker.getResource(); if (resource instanceof IFile) { // load model final IFile file = (IFile) resource; URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true); ResourceSet rs = new ResourceSetImpl(); rs.getLoadOptions().put(eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionOptions.DISABLE_CREATING_MARKERS_FOR_PROBLEMS, "true"); Resource emfResource = rs.getResource(uri, true); if (emfResource instanceof eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionResource) { eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionResource customResource = (eu.hyvar.feature.expression.resource.hyexpression.mopp.HyexpressionResource) emfResource; EcoreUtil.resolveAll(customResource); Collection<eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionQuickFix> quickFixes = getQuickFixes(customResource, marker); List<IMarkerResolution2> resolutions = new ArrayList<IMarkerResolution2>(); for (final eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionQuickFix quickFix : quickFixes) { resolutions.add(new IMarkerResolution2() { public void run(IMarker marker) { String newText = quickFix.apply(null); // set new text as content for resource try { file.setContents(new ByteArrayInputStream(newText.getBytes()), true, true, null); } catch (CoreException e) { eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionUIPlugin.logError("Exception while applying quick fix", e); } } public String getLabel() { return quickFix.getDisplayString(); } public Image getImage() { return new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionUIMetaInformation().getImageProvider().getImage(quickFix.getImageKey()); } public String getDescription() { return null; } }); } return resolutions.toArray(new IMarkerResolution[resolutions.size()]); } } } catch (Exception e) { eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionUIPlugin.logError("Exception while computing quick fix resolutions", e); } return new IMarkerResolution[] {}; } public Collection<eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionQuickFix> getQuickFixes(eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionTextResource resource, IMarker marker) { Collection<eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionQuickFix> foundQuickFixes = new ArrayList<eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionQuickFix>(); try { String quickFixContexts = getQuickFixContextString(marker); if (quickFixContexts != null) { String[] quickFixContextParts = quickFixContexts.split("\\|"); for (String quickFixContext : quickFixContextParts) { eu.hyvar.feature.expression.resource.hyexpression.IHyexpressionQuickFix quickFix = resource.getQuickFix(quickFixContext); if (quickFix != null) { foundQuickFixes.add(quickFix); } } } } catch (CoreException ce) { if (ce.getMessage().matches("Marker.*not found.")) { // ignore System.out.println("getQuickFixes() marker not found: " + ce.getMessage()); } else { ce.printStackTrace(); } } return foundQuickFixes; } private String getQuickFixContextString(IMarker marker) throws CoreException { Object quickFixValue = marker.getAttribute(IMarker.SOURCE_ID); if (quickFixValue != null && quickFixValue instanceof String) { return (String) quickFixValue; } return null; } private boolean hasQuickFixes(IMarker marker) throws CoreException { return getQuickFixContextString(marker) != null; } }
{ "content_hash": "082c677767a5085a66de0aa41e633acd", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 209, "avg_line_length": 43.285714285714285, "alnum_prop": 0.7475247524752475, "repo_name": "HyVar/DarwinSPL", "id": "21ba12c21c6b8201f3d3882ca4c89c0827c10e2f", "size": "4893", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "plugins/eu.hyvar.feature.expression.resource.hyexpression.ui/src-gen/eu/hyvar/feature/expression/resource/hyexpression/ui/HyexpressionMarkerResolutionGenerator.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "1842" }, { "name": "C#", "bytes": "12566" }, { "name": "CSS", "bytes": "366073" }, { "name": "FreeMarker", "bytes": "13035" }, { "name": "GAP", "bytes": "3451574" }, { "name": "Gherkin", "bytes": "987" }, { "name": "Java", "bytes": "15477649" }, { "name": "JavaScript", "bytes": "145081" } ], "symlink_target": "" }
ACCEPTED #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{ "content_hash": "1a9aa38f22c2f875d8332e0ba21c0632", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 39, "avg_line_length": 10.307692307692308, "alnum_prop": 0.6940298507462687, "repo_name": "mdoering/backbone", "id": "329084cf5deeafa7a7f2ff85cd8fb8bc52878a87", "size": "192", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Gentianales/Rubiaceae/Retiniphyllum/Retiniphyllum fuchsioides/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package ml.dmlc.xgboost4j.java; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import junit.framework.TestCase; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.junit.Test; /** * test cases for Booster * * @author hzx */ public class BoosterImplTest { public static class EvalError implements IEvaluation { private static final Log logger = LogFactory.getLog(EvalError.class); String evalMetric = "custom_error"; public EvalError() { } @Override public String getMetric() { return evalMetric; } @Override public float eval(float[][] predicts, DMatrix dmat) { float error = 0f; float[] labels; try { labels = dmat.getLabel(); } catch (XGBoostError ex) { logger.error(ex); return -1f; } int nrow = predicts.length; for (int i = 0; i < nrow; i++) { if (labels[i] == 0f && predicts[i][0] > 0) { error++; } else if (labels[i] == 1f && predicts[i][0] <= 0) { error++; } } return error / labels.length; } } private Booster trainBooster(DMatrix trainMat, DMatrix testMat) throws XGBoostError { //set params Map<String, Object> paramMap = new HashMap<String, Object>() { { put("eta", 1.0); put("max_depth", 2); put("silent", 1); put("objective", "binary:logistic"); } }; //set watchList HashMap<String, DMatrix> watches = new HashMap<String, DMatrix>(); watches.put("train", trainMat); watches.put("test", testMat); //set round int round = 5; //train a boost model return XGBoost.train(trainMat, paramMap, round, watches, null, null); } @Test public void testBoosterBasic() throws XGBoostError, IOException { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); Booster booster = trainBooster(trainMat, testMat); //predict raw output float[][] predicts = booster.predict(testMat, true, 0); //eval IEvaluation eval = new EvalError(); //error must be less than 0.1 TestCase.assertTrue(eval.eval(predicts, testMat) < 0.1f); } @Test public void saveLoadModelWithPath() throws XGBoostError, IOException { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); IEvaluation eval = new EvalError(); Booster booster = trainBooster(trainMat, testMat); // save and load File temp = File.createTempFile("temp", "model"); temp.deleteOnExit(); booster.saveModel(temp.getAbsolutePath()); Booster bst2 = XGBoost.loadModel(temp.getAbsolutePath()); assert (Arrays.equals(bst2.toByteArray(), booster.toByteArray())); float[][] predicts2 = bst2.predict(testMat, true, 0); TestCase.assertTrue(eval.eval(predicts2, testMat) < 0.1f); } @Test public void saveLoadModelWithStream() throws XGBoostError, IOException { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); Booster booster = trainBooster(trainMat, testMat); Path tempDir = Files.createTempDirectory("boosterTest-"); File tempFile = Files.createTempFile("", "").toFile(); booster.saveModel(new FileOutputStream(tempFile)); IEvaluation eval = new EvalError(); Booster loadedBooster = XGBoost.loadModel(new FileInputStream(tempFile)); float originalPredictError = eval.eval(booster.predict(testMat, true), testMat); TestCase.assertTrue("originalPredictErr:" + originalPredictError, originalPredictError < 0.1f); float loadedPredictError = eval.eval(loadedBooster.predict(testMat, true), testMat); TestCase.assertTrue("loadedPredictErr:" + loadedPredictError, loadedPredictError < 0.1f); } private void testWithFastHisto(DMatrix trainingSet, Map<String, DMatrix> watches, int round, Map<String, Object> paramMap, float threshold) throws XGBoostError { float[][] metrics = new float[watches.size()][round]; Booster booster = XGBoost.train(trainingSet, paramMap, round, watches, metrics, null, null); for (int i = 0; i < metrics.length; i++) for (int j = 1; j < metrics[i].length; j++) { TestCase.assertTrue(metrics[i][j] >= metrics[i][j - 1]); } for (int i = 0; i < metrics.length; i++) for (int j = 0; j < metrics[i].length; j++) { TestCase.assertTrue(metrics[i][j] >= threshold); } booster.dispose(); } @Test public void testFastHistoDepthWise() throws XGBoostError { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); // testBoosterWithFastHistogram(trainMat, testMat); Map<String, Object> paramMap = new HashMap<String, Object>() { { put("max_depth", 3); put("silent", 1); put("objective", "binary:logistic"); put("tree_method", "hist"); put("grow_policy", "depthwise"); put("eval_metric", "auc"); } }; Map<String, DMatrix> watches = new HashMap<>(); watches.put("training", trainMat); watches.put("test", testMat); testWithFastHisto(trainMat, watches, 10, paramMap, 0.0f); } @Test public void testFastHistoLossGuide() throws XGBoostError { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); // testBoosterWithFastHistogram(trainMat, testMat); Map<String, Object> paramMap = new HashMap<String, Object>() { { put("max_depth", 0); put("silent", 1); put("objective", "binary:logistic"); put("tree_method", "hist"); put("grow_policy", "lossguide"); put("max_leaves", 8); put("eval_metric", "auc"); } }; Map<String, DMatrix> watches = new HashMap<>(); watches.put("training", trainMat); watches.put("test", testMat); testWithFastHisto(trainMat, watches, 10, paramMap, 0.0f); } @Test public void testFastHistoLossGuideMaxBin() throws XGBoostError { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); // testBoosterWithFastHistogram(trainMat, testMat); Map<String, Object> paramMap = new HashMap<String, Object>() { { put("max_depth", 0); put("silent", 1); put("objective", "binary:logistic"); put("tree_method", "hist"); put("grow_policy", "lossguide"); put("max_leaves", 8); put("max_bins", 16); put("eval_metric", "auc"); } }; Map<String, DMatrix> watches = new HashMap<>(); watches.put("training", trainMat); testWithFastHisto(trainMat, watches, 10, paramMap, 0.0f); } @Test public void testFastHistoDepthwiseMaxDepth() throws XGBoostError { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); // testBoosterWithFastHistogram(trainMat, testMat); Map<String, Object> paramMap = new HashMap<String, Object>() { { put("max_depth", 3); put("silent", 1); put("objective", "binary:logistic"); put("tree_method", "hist"); put("max_depth", 2); put("grow_policy", "depthwise"); put("eval_metric", "auc"); } }; Map<String, DMatrix> watches = new HashMap<>(); watches.put("training", trainMat); testWithFastHisto(trainMat, watches, 10, paramMap, 0.85f); } @Test public void testFastHistoDepthwiseMaxDepthMaxBin() throws XGBoostError { DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); DMatrix testMat = new DMatrix("../../demo/data/agaricus.txt.test"); // testBoosterWithFastHistogram(trainMat, testMat); Map<String, Object> paramMap = new HashMap<String, Object>() { { put("max_depth", 3); put("silent", 1); put("objective", "binary:logistic"); put("tree_method", "hist"); put("max_depth", 2); put("max_bin", 2); put("grow_policy", "depthwise"); put("eval_metric", "auc"); } }; Map<String, DMatrix> watches = new HashMap<>(); watches.put("training", trainMat); testWithFastHisto(trainMat, watches, 10, paramMap, 0.85f); } /** * test cross valiation * * @throws XGBoostError */ @Test public void testCV() throws XGBoostError { //load train mat DMatrix trainMat = new DMatrix("../../demo/data/agaricus.txt.train"); //set params Map<String, Object> param = new HashMap<String, Object>() { { put("eta", 1.0); put("max_depth", 3); put("silent", 1); put("nthread", 6); put("objective", "binary:logistic"); put("gamma", 1.0); put("eval_metric", "error"); } }; //do 5-fold cross validation int round = 2; int nfold = 5; String[] evalHist = XGBoost.crossValidation(trainMat, param, round, nfold, null, null, null); } }
{ "content_hash": "c895bbec86cf5339661c7a6fcb93ba66", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 106, "avg_line_length": 32.76288659793814, "alnum_prop": 0.6233480176211453, "repo_name": "RPGOne/Skynet", "id": "c60b2406aa1c4890d637c32fcdc42aaff7a5fa0e", "size": "10111", "binary": false, "copies": "1", "ref": "refs/heads/Miho", "path": "xgboost-master/jvm-packages/xgboost4j/src/test/java/ml/dmlc/xgboost4j/java/BoosterImplTest.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "1C Enterprise", "bytes": "36" }, { "name": "Ada", "bytes": "89079" }, { "name": "Assembly", "bytes": "11425802" }, { "name": "Batchfile", "bytes": "123467" }, { "name": "C", "bytes": "34703955" }, { "name": "C#", "bytes": "55955" }, { "name": "C++", "bytes": "84647314" }, { "name": "CMake", "bytes": "220849" }, { "name": "CSS", "bytes": "39257" }, { "name": "Cuda", "bytes": "1344541" }, { "name": "DIGITAL Command Language", "bytes": "349320" }, { "name": "DTrace", "bytes": "37428" }, { "name": "Emacs Lisp", "bytes": "19654" }, { "name": "Erlang", "bytes": "39438" }, { "name": "Fortran", "bytes": "16914" }, { "name": "HTML", "bytes": "929759" }, { "name": "Java", "bytes": "112658" }, { "name": "JavaScript", "bytes": "32806873" }, { "name": "Jupyter Notebook", "bytes": "1616334" }, { "name": "Lua", "bytes": "22549" }, { "name": "M4", "bytes": "64967" }, { "name": "Makefile", "bytes": "1046428" }, { "name": "Matlab", "bytes": "888" }, { "name": "Module Management System", "bytes": "1545" }, { "name": "NSIS", "bytes": "2860" }, { "name": "Objective-C", "bytes": "131433" }, { "name": "PHP", "bytes": "750783" }, { "name": "Pascal", "bytes": "75208" }, { "name": "Perl", "bytes": "626627" }, { "name": "Perl 6", "bytes": "2495926" }, { "name": "PowerShell", "bytes": "38374" }, { "name": "Prolog", "bytes": "300018" }, { "name": "Python", "bytes": "26363074" }, { "name": "R", "bytes": "236175" }, { "name": "Rebol", "bytes": "217" }, { "name": "Roff", "bytes": "328366" }, { "name": "SAS", "bytes": "1847" }, { "name": "Scala", "bytes": "248902" }, { "name": "Scheme", "bytes": "14853" }, { "name": "Shell", "bytes": "360815" }, { "name": "TeX", "bytes": "105346" }, { "name": "Vim script", "bytes": "6101" }, { "name": "XS", "bytes": "4319" }, { "name": "eC", "bytes": "5158" } ], "symlink_target": "" }
namespace Core { using System.Diagnostics.CodeAnalysis; using UnityEngine; /// <summary> /// Updates the Renderer in this GameObject with a specific color. /// </summary> public class TargetColorPicker : MonoBehaviour { /// <summary> /// The color to serverUpdate the Renderer with. /// </summary> [SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401:FieldsMustBePrivate", Justification = "Unity Property")] public Color Color; /// <summary> /// Updates the color in a Renderer Component of this GameObject. /// </summary> public void Update() { Renderer ren = gameObject.GetComponent<Renderer>(); ren.material.SetColor("Color", this.Color); } } }
{ "content_hash": "73db406dcafd4d76b077a79d2da0b36c", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 129, "avg_line_length": 31, "alnum_prop": 0.6104218362282878, "repo_name": "thijser/ARGAME", "id": "8aa5e5f70686a2c05d0be94da3e058e8ff980777", "size": "1340", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ARGame/Assets/Scripts/Core/TargetColorPicker.cs", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1479" }, { "name": "C", "bytes": "85437" }, { "name": "C#", "bytes": "286398" }, { "name": "C++", "bytes": "1376379" }, { "name": "GLSL", "bytes": "15967" }, { "name": "PostScript", "bytes": "49885" }, { "name": "Prolog", "bytes": "2499" }, { "name": "QMake", "bytes": "4623" }, { "name": "TeX", "bytes": "194350" } ], "symlink_target": "" }
package krasa.svn.frontend.pages.mergeinfo; import krasa.core.frontend.pages.BasePage; import krasa.svn.backend.dto.MergeInfoResult; import krasa.svn.frontend.component.BranchAutocompleteFormPanel; import krasa.svn.frontend.component.table.SelectedBranchesTablePanel; import org.apache.wicket.ajax.AjaxRequestTarget; import org.apache.wicket.ajax.markup.html.form.AjaxButton; import org.apache.wicket.extensions.ajax.markup.html.IndicatingAjaxButton; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.panel.*; import org.apache.wicket.model.*; /** * @author Vojtech Krasa */ public class MergeInfoPage extends BasePage { private static final String RESULT = "result"; protected SelectedBranchesTablePanel branchesTable; private Panel result; public MergeInfoPage() { queue(new MergeLeftPanel(LEFT)); queue(createAddBranchIntoProfileFormPanel()); queue(createResultPanel()); queue(createBranchesTable()); queue(createFindMergesForm()); } private BranchAutocompleteFormPanel createAddBranchIntoProfileFormPanel() { return new BranchIntoProfileAutocompleteFormPanel(); } private void update(AjaxRequestTarget target) { target.add(branchesTable); } private SelectedBranchesTablePanel createBranchesTable() { return branchesTable = new SelectedBranchesTablePanel("branchesTable"); } private Panel createResultPanel() { result = new EmptyPanel(RESULT); result.setOutputMarkupPlaceholderTag(true); return result; } private Form createFindMergesForm() { Form form = new Form("findMergesForm"); form.add(new IndicatingAjaxButton("findMerges") { @Override protected void onSubmit(AjaxRequestTarget target) { MergeInfoResultPanel result = new MergeInfoResultPanel(RESULT, new LoadableDetachableModel<MergeInfoResult>() { @Override protected MergeInfoResult load() { return facade.getMergeInfoForAllSelectedBranches(); } }); MergeInfoPage.this.result.replaceWith(result); MergeInfoPage.this.result = result; target.add(result); } @Override protected void onError(AjaxRequestTarget target) { } }); return form; } private class BranchIntoProfileAutocompleteFormPanel extends BranchAutocompleteFormPanel { public BranchIntoProfileAutocompleteFormPanel() { super("addBranchPanel"); } @Override protected Form createAddBranchForm(ResourceModel labelModel) { Form addBranchForm = super.createAddBranchForm(labelModel); addBranchForm.add(new ReplaceSearchFromButton("replaceSearchFrom")); addBranchForm.add(new ReplaceSearchFromToTrunkButton("replaceSearchFromToTrunk")); return addBranchForm; } @Override protected void onUpdate(AjaxRequestTarget target) { update(target); } private class ReplaceSearchFromButton extends AjaxButton { public ReplaceSearchFromButton(String replaceSearchFrom) { super(replaceSearchFrom); setDefaultFormProcessing(false); } @Override protected void onSubmit(AjaxRequestTarget target) { facade.replaceSearchFrom(); update(target); } } private class ReplaceSearchFromToTrunkButton extends AjaxButton { public ReplaceSearchFromToTrunkButton(String replaceSearchFrom) { super(replaceSearchFrom); setDefaultFormProcessing(false); } @Override protected void onSubmit(AjaxRequestTarget target) { facade.replaceSearchFromToTrunk(); update(target); } } @Override protected void deleteAllBranches(AjaxRequestTarget target) { facade.deleteAllBranchesFromProfile(); } @Override protected void addAllMatchingBranches(String fieldValue, AjaxRequestTarget target) { facade.addAllMatchingBranchesIntoProfile(fieldValue); } @Override protected void addBranch(String fieldValue, AjaxRequestTarget target) { facade.addBranchIntoProfile(fieldValue); } } }
{ "content_hash": "42c75d4e9d6bc831ddc3cdf41d851be8", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 91, "avg_line_length": 27.055944055944057, "alnum_prop": 0.7720341173429827, "repo_name": "krasa/DevSupportApp", "id": "75fa136810821b7e3b69e442e2787d00b926afd4", "size": "3869", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/krasa/svn/frontend/pages/mergeinfo/MergeInfoPage.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "200470" }, { "name": "HTML", "bytes": "55084" }, { "name": "Java", "bytes": "576657" }, { "name": "JavaScript", "bytes": "49352" }, { "name": "Shell", "bytes": "22000" } ], "symlink_target": "" }
using NUnit.Framework; using Umbraco.Core.Services; using Umbraco.Tests.TestHelpers; using System; using System.Linq; using Umbraco.Core.Models.Membership; namespace Umbraco.Tests.Services { /// <summary> /// Tests covering the SectionService /// </summary> [DatabaseTestBehavior(DatabaseBehavior.NewDbFileAndSchemaPerTest)] [TestFixture, RequiresSTA] public class SectionServiceTests : BaseServiceTest { [SetUp] public override void Initialize() { base.Initialize(); } public override void CreateTestData() { base.CreateTestData(); ServiceContext.SectionService.MakeNew("Content", "content", "icon-content"); ServiceContext.SectionService.MakeNew("Media", "media", "icon-media"); ServiceContext.SectionService.MakeNew("Settings", "settings", "icon-settings"); ServiceContext.SectionService.MakeNew("Developer", "developer", "icon-developer"); } [Test] public void SectionService_Can_Get_Allowed_Sections_For_User() { // Arrange var user = CreateTestUser(); // Act var result = ServiceContext.SectionService.GetAllowedSections(user.Id).ToList(); // Assert Assert.AreEqual(3, result.Count); } private IUser CreateTestUser() { var user = new User { Name = "Test user", Username = "testUser", Email = "testuser@test.com", }; ServiceContext.UserService.Save(user, false); var userGroupA = new UserGroup { Alias = "GroupA", Name = "Group A" }; userGroupA.AddAllowedSection("media"); userGroupA.AddAllowedSection("settings"); //TODO: This is failing the test ServiceContext.UserService.Save(userGroupA, new[] { user.Id }, false); var userGroupB = new UserGroup { Alias = "GroupB", Name = "Group B" }; userGroupB.AddAllowedSection("settings"); userGroupB.AddAllowedSection("developer"); ServiceContext.UserService.Save(userGroupB, new[] { user.Id }, false); return ServiceContext.UserService.GetUserById(user.Id); } } }
{ "content_hash": "6d27bb888ba982c808ef600b2dee4044", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 94, "avg_line_length": 31.26923076923077, "alnum_prop": 0.5699056990569906, "repo_name": "jchurchley/Umbraco-CMS", "id": "0d95cfc56dc086a486ea3edb2bb09b1307ad6862", "size": "2441", "binary": false, "copies": "10", "ref": "refs/heads/dev-v7", "path": "src/Umbraco.Tests/Services/SectionServiceTests.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "253991" }, { "name": "Batchfile", "bytes": "11092" }, { "name": "C#", "bytes": "18390515" }, { "name": "CSS", "bytes": "566679" }, { "name": "HTML", "bytes": "703640" }, { "name": "JavaScript", "bytes": "3553048" }, { "name": "PLpgSQL", "bytes": "80494" }, { "name": "PowerShell", "bytes": "67619" }, { "name": "XSLT", "bytes": "50045" } ], "symlink_target": "" }
package ch.poole.openinghoursparser; public class Nth extends Element { public static final int INVALID_NTH = Integer.MIN_VALUE; int startNth = INVALID_NTH; int endNth = INVALID_NTH; /** * Default constructor */ public Nth() { // empty } /** * Construct a new Nth with the same content * * @param n original Nth */ public Nth(Nth n) { startNth = n.startNth; endNth = n.endNth; } @Override public String toString() { StringBuilder b = new StringBuilder(); if (startNth != INVALID_NTH) { b.append(startNth); } if (endNth != INVALID_NTH) { b.append("-"); b.append(endNth); } return b.toString(); } @Override public boolean equals(Object other) { if (this == other) { return true; } if (other instanceof Nth) { Nth o = (Nth) other; if (startNth == o.startNth && endNth == o.endNth) { return true; } } return false; } @Override public int hashCode() { int result = 1; result = 37 * result + startNth; result = 37 * result + endNth; return result; } /** * @return the startNth */ public int getStartNth() { return startNth; } /** * @return the endNth of Nth.INVALID_NTH if not set/not a range */ public int getEndNth() { return endNth; } /** * @param startNth the startNth to set */ public void setStartNth(int startNth) { this.startNth = startNth; } /** * @param endNth the endNth to set */ public void setEndNth(int endNth) { this.endNth = endNth; } @Override public Nth copy() { return new Nth(this); } }
{ "content_hash": "3cbd1c9e8221c8e6b6b6a8cfabd4fdc7", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 67, "avg_line_length": 21.74468085106383, "alnum_prop": 0.47211350293542076, "repo_name": "simonpoole/OpeningHoursParser", "id": "2621aecdc397882529816032291b80f9806fd526", "size": "3371", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/ch/poole/openinghoursparser/Nth.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "150717" } ], "symlink_target": "" }
package testing import ( "math/rand" "strconv" "testing" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/resource" "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/types" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/fsouza/go-dockerclient" "github.com/google/gofuzz" "speter.net/go/exp/math/dec/inf" ) func fuzzOneOf(c fuzz.Continue, objs ...interface{}) { // Use a new fuzzer which cannot populate nil to ensure one obj will be set. f := fuzz.New().NilChance(0).NumElements(1, 1) i := c.RandUint64() % uint64(len(objs)) f.Fuzz(objs[i]) } // FuzzerFor can randomly populate api objects that are destined for version. func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { f := fuzz.New().NilChance(.5).NumElements(1, 1) if src != nil { f.RandSource(src) } f.Funcs( func(j *runtime.PluginBase, c fuzz.Continue) { // Do nothing; this struct has only a Kind field and it must stay blank in memory. }, func(j *runtime.TypeMeta, c fuzz.Continue) { // We have to customize the randomization of TypeMetas because their // APIVersion and Kind must remain blank in memory. j.APIVersion = "" j.Kind = "" }, func(j *api.TypeMeta, c fuzz.Continue) { // We have to customize the randomization of TypeMetas because their // APIVersion and Kind must remain blank in memory. j.APIVersion = "" j.Kind = "" }, func(j *api.ObjectMeta, c fuzz.Continue) { j.Name = c.RandString() j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() j.UID = types.UID(c.RandString()) j.GenerateName = c.RandString() var sec, nsec int64 c.Fuzz(&sec) c.Fuzz(&nsec) j.CreationTimestamp = util.Unix(sec, nsec).Rfc3339Copy() }, func(j *api.ObjectReference, c fuzz.Continue) { // We have to customize the randomization of TypeMetas because their // APIVersion and Kind must remain blank in memory. j.APIVersion = c.RandString() j.Kind = c.RandString() j.Namespace = c.RandString() j.Name = c.RandString() j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.FieldPath = c.RandString() }, func(j *api.ListMeta, c fuzz.Continue) { j.ResourceVersion = strconv.FormatUint(c.RandUint64(), 10) j.SelfLink = c.RandString() }, func(j *api.ListOptions, c fuzz.Continue) { // TODO: add some parsing j.LabelSelector, _ = labels.Parse("a=b") j.FieldSelector, _ = fields.ParseSelector("a=b") }, func(j *api.PodPhase, c fuzz.Continue) { statuses := []api.PodPhase{api.PodPending, api.PodRunning, api.PodFailed, api.PodUnknown} *j = statuses[c.Rand.Intn(len(statuses))] }, func(j *api.PodTemplateSpec, c fuzz.Continue) { // TODO: v1beta1/2 can't round trip a nil template correctly, fix by having v1beta1/2 // conversion compare converted object to nil via DeepEqual j.ObjectMeta = api.ObjectMeta{} c.Fuzz(&j.ObjectMeta) j.ObjectMeta = api.ObjectMeta{Labels: j.ObjectMeta.Labels} j.Spec = api.PodSpec{} c.Fuzz(&j.Spec) }, func(j *api.Binding, c fuzz.Continue) { c.Fuzz(&j.ObjectMeta) j.Target.Name = c.RandString() }, func(j *api.ReplicationControllerSpec, c fuzz.Continue) { c.FuzzNoCustom(j) // fuzz self without calling this function again j.TemplateRef = nil // this is required for round trip }, func(j *api.ReplicationControllerStatus, c fuzz.Continue) { // only replicas round trips j.Replicas = int(c.RandUint64()) }, func(j *api.List, c fuzz.Continue) { c.FuzzNoCustom(j) // fuzz self without calling this function again if j.Items == nil { j.Items = []runtime.Object{} } }, func(j *runtime.Object, c fuzz.Continue) { if c.RandBool() { *j = &runtime.Unknown{ TypeMeta: runtime.TypeMeta{Kind: "Something", APIVersion: "unknown"}, RawJSON: []byte(`{"apiVersion":"unknown","kind":"Something","someKey":"someValue"}`), } } else { types := []runtime.Object{&api.Pod{}, &api.ReplicationController{}} t := types[c.Rand.Intn(len(types))] c.Fuzz(t) *j = t } }, func(pb map[docker.Port][]docker.PortBinding, c fuzz.Continue) { // This is necessary because keys with nil values get omitted. // TODO: Is this a bug? pb[docker.Port(c.RandString())] = []docker.PortBinding{ {c.RandString(), c.RandString()}, {c.RandString(), c.RandString()}, } }, func(pm map[string]docker.PortMapping, c fuzz.Continue) { // This is necessary because keys with nil values get omitted. // TODO: Is this a bug? pm[c.RandString()] = docker.PortMapping{ c.RandString(): c.RandString(), } }, func(q *resource.Quantity, c fuzz.Continue) { // Real Quantity fuzz testing is done elsewhere; // this limited subset of functionality survives // round-tripping to v1beta1/2. q.Amount = &inf.Dec{} q.Format = resource.DecimalExponent //q.Amount.SetScale(inf.Scale(-c.Intn(12))) q.Amount.SetUnscaled(c.Int63n(1000)) }, func(p *api.PullPolicy, c fuzz.Continue) { policies := []api.PullPolicy{api.PullAlways, api.PullNever, api.PullIfNotPresent} *p = policies[c.Rand.Intn(len(policies))] }, func(rp *api.RestartPolicy, c fuzz.Continue) { policies := []api.RestartPolicy{api.RestartPolicyAlways, api.RestartPolicyNever, api.RestartPolicyOnFailure} *rp = policies[c.Rand.Intn(len(policies))] }, func(vs *api.VolumeSource, c fuzz.Continue) { // Exactly one of the fields should be set. //FIXME: the fuzz can still end up nil. What if fuzz allowed me to say that? fuzzOneOf(c, &vs.HostPath, &vs.EmptyDir, &vs.GCEPersistentDisk, &vs.GitRepo, &vs.Secret, &vs.NFS, &vs.ISCSI, &vs.Glusterfs) }, func(d *api.DNSPolicy, c fuzz.Continue) { policies := []api.DNSPolicy{api.DNSClusterFirst, api.DNSDefault} *d = policies[c.Rand.Intn(len(policies))] }, func(p *api.Protocol, c fuzz.Continue) { protocols := []api.Protocol{api.ProtocolTCP, api.ProtocolUDP} *p = protocols[c.Rand.Intn(len(protocols))] }, func(p *api.AffinityType, c fuzz.Continue) { types := []api.AffinityType{api.AffinityTypeClientIP, api.AffinityTypeNone} *p = types[c.Rand.Intn(len(types))] }, func(ct *api.Container, c fuzz.Continue) { c.FuzzNoCustom(ct) // fuzz self without calling this function again ct.TerminationMessagePath = "/" + ct.TerminationMessagePath // Must be non-empty }, func(e *api.Event, c fuzz.Continue) { c.FuzzNoCustom(e) // fuzz self without calling this function again // Fix event count to 1, otherwise, if a v1beta1 or v1beta2 event has a count set arbitrarily, it's count is ignored if e.FirstTimestamp.IsZero() { e.Count = 1 } else { c.Fuzz(&e.Count) } }, func(s *api.Secret, c fuzz.Continue) { c.FuzzNoCustom(s) // fuzz self without calling this function again s.Type = api.SecretTypeOpaque }, func(s *api.NamespaceSpec, c fuzz.Continue) { s.Finalizers = []api.FinalizerName{api.FinalizerKubernetes} }, func(s *api.NamespaceStatus, c fuzz.Continue) { s.Phase = api.NamespaceActive }, func(http *api.HTTPGetAction, c fuzz.Continue) { c.FuzzNoCustom(http) // fuzz self without calling this function again http.Path = "/" + http.Path // can't be blank }, func(ss *api.ServiceSpec, c fuzz.Continue) { c.FuzzNoCustom(ss) // fuzz self without calling this function again if len(ss.Ports) == 0 { // There must be at least 1 port. ss.Ports = append(ss.Ports, api.ServicePort{}) c.Fuzz(&ss.Ports[0]) } for i := range ss.Ports { switch ss.Ports[i].TargetPort.Kind { case util.IntstrInt: ss.Ports[i].TargetPort.IntVal = 1 + ss.Ports[i].TargetPort.IntVal%65535 // non-zero case util.IntstrString: ss.Ports[i].TargetPort.StrVal = "x" + ss.Ports[i].TargetPort.StrVal // non-empty } } }, func(n *api.Node, c fuzz.Continue) { c.FuzzNoCustom(n) n.Spec.ExternalID = "external" }, ) return f }
{ "content_hash": "954e29d2d7d99a7d3f03516f882de53c", "timestamp": "", "source": "github", "line_count": 225, "max_line_length": 126, "avg_line_length": 36.315555555555555, "alnum_prop": 0.6758046750703708, "repo_name": "mjisyang/origin", "id": "04a4bec3f548037d33c91bfabc244eefb961cd1e", "size": "8749", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Godeps/_workspace/src/github.com/GoogleCloudPlatform/kubernetes/pkg/api/testing/fuzzer.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "48437" }, { "name": "Go", "bytes": "19619465" }, { "name": "Groff", "bytes": "2046" }, { "name": "HTML", "bytes": "98678" }, { "name": "JavaScript", "bytes": "243714" }, { "name": "Makefile", "bytes": "2748" }, { "name": "Python", "bytes": "11908" }, { "name": "Ruby", "bytes": "121" }, { "name": "Shell", "bytes": "124846" } ], "symlink_target": "" }
@implementation PuzzleCollectionViewCell @end
{ "content_hash": "96a1caf6a3b3a06a32fb30b3f41bac90", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 40, "avg_line_length": 15.666666666666666, "alnum_prop": 0.8723404255319149, "repo_name": "steryokhin/iOS-Puzzle-Game", "id": "d767b989d4e723a9378a51ee9fa897861af2eb2a", "size": "243", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/iOSPuzzleGame/iOSPuzzleGame/src/Presentation/User Story/Puzzle/view/PuzzleCell/PuzzleCollectionViewCell.m", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "563" }, { "name": "Objective-C", "bytes": "80413" }, { "name": "Ruby", "bytes": "531" }, { "name": "Shell", "bytes": "8890" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- From: file:/Users/bjol7457/Documents/AdMobBanner/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.1/res/values-large/values-large.xml --> <eat-comment/> <bool name="abc_action_bar_embed_tabs_pre_jb">true</bool> <bool name="abc_config_allowActionMenuItemTextWithIcon">true</bool> <dimen name="abc_config_prefDialogWidth">440dp</dimen> <dimen name="abc_search_view_text_min_width">192dip</dimen> <item name="dialog_fixed_height_major" type="dimen">60%</item> <item name="dialog_fixed_height_minor" type="dimen">90%</item> <item name="dialog_fixed_width_major" type="dimen">60%</item> <item name="dialog_fixed_width_minor" type="dimen">90%</item> <integer name="abc_max_action_buttons">4</integer> <style name="Base.Theme.AppCompat.DialogWhenLarge" parent="Base.Theme.AppCompat.Dialog.FixedSize"/> <style name="Base.Theme.AppCompat.Light.DialogWhenLarge" parent="Base.Theme.AppCompat.Light.Dialog.FixedSize"/> </resources>
{ "content_hash": "c4f5bd4d47f1a4b56fa8bf2f0380746f", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 172, "avg_line_length": 65.8125, "alnum_prop": 0.7207977207977208, "repo_name": "brandonjolley97/AdMobBanner", "id": "20aec5f1a136399247f4d3c5958f5bf144d7c9fe", "size": "1053", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/build/intermediates/res/merged/debug/values-large/values-large.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "502524" } ], "symlink_target": "" }
package generator import ( "bytes" "fmt" "testing" "github.com/go-openapi/spec" "github.com/stretchr/testify/assert" ) func TestSimpleResponseRender(t *testing.T) { b, err := opBuilder("updateTask", "../fixtures/codegen/todolist.responses.yml") if assert.NoError(t, err) { op, err := b.MakeOperation() if assert.NoError(t, err) { var buf bytes.Buffer if assert.NoError(t, responsesTemplate.Execute(&buf, op)) { ff, err := formatGoFile("update_task_responses.go", buf.Bytes()) if assert.NoError(t, err) { assertInCode(t, "o.XErrorCode", string(ff)) assertInCode(t, "o.Payload", string(ff)) } else { fmt.Println(buf.String()) } } } } } func TestSimpleResponses(t *testing.T) { b, err := opBuilder("updateTask", "../fixtures/codegen/todolist.responses.yml") if !assert.NoError(t, err) { t.FailNow() } _, _, op, ok := b.Analyzed.OperationForName("updateTask") if assert.True(t, ok) && assert.NotNil(t, op) && assert.NotNil(t, op.Responses) { resolver := &typeResolver{ModelsPackage: b.ModelsPackage, Doc: b.Doc} if assert.NotNil(t, op.Responses.Default) { resp, err := spec.ResolveResponse(b.Doc.Spec(), op.Responses.Default.Ref) if assert.NoError(t, err) { defCtx := responseTestContext{ OpID: "updateTask", Name: "default", } res, err := b.MakeResponse("a", defCtx.Name, false, resolver, -1, *resp) if assert.NoError(t, err) { if defCtx.Assert(t, *resp, res) { for code, response := range op.Responses.StatusCodeResponses { sucCtx := responseTestContext{ OpID: "updateTask", Name: "success", IsSuccess: code/100 == 2, } res, err := b.MakeResponse("a", sucCtx.Name, sucCtx.IsSuccess, resolver, code, response) if assert.NoError(t, err) { if !sucCtx.Assert(t, response, res) { return } } } } } } } } } func TestInlinedSchemaResponses(t *testing.T) { b, err := opBuilder("getTasks", "../fixtures/codegen/todolist.responses.yml") if !assert.NoError(t, err) { t.FailNow() } _, _, op, ok := b.Analyzed.OperationForName("getTasks") if assert.True(t, ok) && assert.NotNil(t, op) && assert.NotNil(t, op.Responses) { resolver := &typeResolver{ModelsPackage: b.ModelsPackage, Doc: b.Doc} if assert.NotNil(t, op.Responses.Default) { resp := *op.Responses.Default defCtx := responseTestContext{ OpID: "getTasks", Name: "default", } res, err := b.MakeResponse("a", defCtx.Name, false, resolver, -1, resp) if assert.NoError(t, err) { if defCtx.Assert(t, resp, res) { for code, response := range op.Responses.StatusCodeResponses { sucCtx := responseTestContext{ OpID: "getTasks", Name: "success", IsSuccess: code/100 == 2, } res, err := b.MakeResponse("a", sucCtx.Name, sucCtx.IsSuccess, resolver, code, response) if assert.NoError(t, err) { if !sucCtx.Assert(t, response, res) { return } } assert.Len(t, b.ExtraSchemas, 1) assert.Equal(t, "[]*SuccessBodyItems0", res.Schema.GoType) } } } } } } type responseTestContext struct { OpID string Name string IsSuccess bool } func (ctx *responseTestContext) Assert(t testing.TB, response spec.Response, res GenResponse) bool { if !assert.Equal(t, ctx.IsSuccess, res.IsSuccess) { return false } if !assert.Equal(t, ctx.Name, res.Name) { return false } if !assert.Equal(t, response.Description, res.Description) { return false } if len(response.Headers) > 0 { for k, v := range response.Headers { found := false for _, h := range res.Headers { if h.Name == k { found = true if k == "X-Last-Task-Id" { hctx := &respHeaderTestContext{k, "swag.FormatInt64", "swag.ConvertInt64"} if !hctx.Assert(t, v, h) { return false } break } if k == "X-Error-Code" { hctx := &respHeaderTestContext{k, "", ""} if !hctx.Assert(t, v, h) { return false } } break } } if !assert.True(t, found) { return false } } } if response.Schema != nil { if !assert.NotNil(t, res.Schema) { return false } } else { if !assert.Nil(t, res.Schema) { return false } } return true } type respHeaderTestContext struct { Name string Formatter string Converter string } func (ctx *respHeaderTestContext) Assert(t testing.TB, header spec.Header, hdr GenHeader) bool { if !assert.Equal(t, ctx.Name, hdr.Name) { return false } if !assert.Equal(t, "a", hdr.ReceiverName) { return false } if !assert.Equal(t, ctx.Formatter, hdr.Formatter) { return false } if !assert.Equal(t, ctx.Converter, hdr.Converter) { return false } if !assert.Equal(t, header.Description, hdr.Description) { return false } if !assert.Equal(t, header.Minimum, hdr.Minimum) || !assert.Equal(t, header.ExclusiveMinimum, hdr.ExclusiveMinimum) { return false } if !assert.Equal(t, header.Maximum, hdr.Maximum) || !assert.Equal(t, header.ExclusiveMaximum, hdr.ExclusiveMaximum) { return false } if !assert.Equal(t, header.MinLength, hdr.MinLength) { return false } if !assert.Equal(t, header.MaxLength, hdr.MaxLength) { return false } if !assert.Equal(t, header.Pattern, hdr.Pattern) { return false } if !assert.Equal(t, header.MaxItems, hdr.MaxItems) { return false } if !assert.Equal(t, header.MinItems, hdr.MinItems) { return false } if !assert.Equal(t, header.UniqueItems, hdr.UniqueItems) { return false } if !assert.Equal(t, header.MultipleOf, hdr.MultipleOf) { return false } if !assert.EqualValues(t, header.Enum, hdr.Enum) { return false } if !assert.Equal(t, header.Type, hdr.SwaggerType) { return false } if !assert.Equal(t, header.Format, hdr.SwaggerFormat) { return false } return true } func TestGenResponses_Issue540(t *testing.T) { b, err := opBuilder("postPet", "../fixtures/bugs/540/swagger.yml") if assert.NoError(t, err) { op, err := b.MakeOperation() if assert.NoError(t, err) { var buf bytes.Buffer if assert.NoError(t, responsesTemplate.Execute(&buf, op)) { ff, err := formatGoFile("post_pet_responses.go", buf.Bytes()) if assert.NoError(t, err) { assertInCode(t, "func (o *PostPetOK) WithPayload(payload models.Pet) *PostPetOK {", string(ff)) assertInCode(t, "func (o *PostPetOK) SetPayload(payload models.Pet) {", string(ff)) } else { fmt.Println(buf.String()) } } } } }
{ "content_hash": "7a076bb5d416ae73b7671058106246f3", "timestamp": "", "source": "github", "line_count": 251, "max_line_length": 118, "avg_line_length": 26, "alnum_prop": 0.6369904995403003, "repo_name": "kayla90/go-swagger", "id": "4c5c7962fd10be6105bef84c7fb7fe05093b679a", "size": "7125", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "generator/response_test.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "763249" }, { "name": "Shell", "bytes": "8235" } ], "symlink_target": "" }
package grails.plugin.console.charts.client.application.connection; import com.gwtplatform.mvp.client.UiHandlers; /** * @author <a href='mailto:donbeave@gmail.com'>Alexey Zhokhov</a> */ public interface ConnectionUiHandlers extends UiHandlers { void onSendClicked(); }
{ "content_hash": "3c8dfd8e8b81dfbee06847d15f86be5f", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 67, "avg_line_length": 23.25, "alnum_prop": 0.7670250896057348, "repo_name": "donbeave/grails-console-charts", "id": "308a9a5e7bfade9bcfc52615772bd5c6daadc438", "size": "279", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/gwt/grails/plugin/console/charts/client/application/connection/ConnectionUiHandlers.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "5968" }, { "name": "CSS", "bytes": "12591" }, { "name": "Groovy", "bytes": "37984" }, { "name": "Java", "bytes": "74286" }, { "name": "Shell", "bytes": "369" } ], "symlink_target": "" }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.jedi.oracle; import com.jedi.common.StoredProcedure; /** * @author umitgunduz */ public abstract class OracleProcedure extends OracleCall { @Override public String getName() { StoredProcedure storedProcedure = this.getClass().getAnnotation(StoredProcedure.class); String result = ""; if (!storedProcedure.schemaName().isEmpty()) { result += storedProcedure.schemaName() + "."; } if (!storedProcedure.packageName().isEmpty()) { result += storedProcedure.packageName() + "."; } if (!storedProcedure.name().isEmpty()) { result += storedProcedure.name(); } return result; } }
{ "content_hash": "628265ce2dd787ba4849d4ac1ecac821", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 95, "avg_line_length": 25, "alnum_prop": 0.6322222222222222, "repo_name": "umitgunduz/jedi", "id": "2b1f89209eb2ec5247866887ec6a998887d8937f", "size": "1560", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/com/jedi/oracle/OracleProcedure.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "61695" } ], "symlink_target": "" }
var _; // globals describe("About Applying What We Have Learnt", function() { var products; beforeEach(function () { products = [ { name: "Sonoma", ingredients: ["artichoke", "sundried tomatoes", "mushrooms"], containsNuts: false }, { name: "Pizza Primavera", ingredients: ["roma", "sundried tomatoes", "goats cheese", "rosemary"], containsNuts: false }, { name: "South Of The Border", ingredients: ["black beans", "jalapenos", "mushrooms"], containsNuts: false }, { name: "Blue Moon", ingredients: ["blue cheese", "garlic", "walnuts"], containsNuts: true }, { name: "Taste Of Athens", ingredients: ["spinach", "kalamata olives", "sesame seeds"], containsNuts: true } ]; }); /*********************************************************************************/ it("given I'm allergic to nuts and hate mushrooms, it should find a pizza I can eat (imperative)", function () { var i,j,hasMushrooms, productsICanEat = []; for (i = 0; i < products.length; i+=1) { if (products[i].containsNuts === false) { hasMushrooms = false; for (j = 0; j < products[i].ingredients.length; j+=1) { if (products[i].ingredients[j] === "mushrooms") { hasMushrooms = true; } } if (!hasMushrooms) productsICanEat.push(products[i]); } } expect(productsICanEat.length).toBe(1); }); it("given I'm allergic to nuts and hate mushrooms, it should find a pizza I can eat (functional)", function () { var productsICanEat = []; /* solve using filter() & all() / any() */ productsICanEat = products.filter(function(x){return x.containsNuts === false && x.ingredients.every(function(y){return y !== 'mushrooms'})}) expect(productsICanEat.length).toBe(1); }); /*********************************************************************************/ it("should add all the natural numbers below 1000 that are multiples of 3 or 5 (imperative)", function () { var sum = 0; for(var i=1; i<1000; i+=1) { if (i % 3 === 0 || i % 5 === 0) { sum += i; } } expect(sum).toBe(233168); }); it("should add all the natural numbers below 1000 that are multiples of 3 or 5 (functional)", function () { var sum = _.range(1000) .filter(function(x){return x % 3 === 0 || x % 5 === 0}) .reduce(function(memo, y){return memo + y}, 0); /* try chaining range() and reduce() */ expect(233168).toBe(sum); }); /*********************************************************************************/ it("should count the ingredient occurrence (imperative)", function () { var ingredientCount = { "{ingredient name}": 0 }; for (i = 0; i < products.length; i+=1) { for (j = 0; j < products[i].ingredients.length; j+=1) { ingredientCount[products[i].ingredients[j]] = (ingredientCount[products[i].ingredients[j]] || 0) + 1; } } expect(ingredientCount['mushrooms']).toBe(2); }); it("should count the ingredient occurrence (functional)", function () { var ingredientCount = _(products).chain() .map(function(x){ return x.ingredients;}) .flatten() .reduce(function(ingredientCount, i){ ingredientCount[i] = (ingredientCount[i] || 0) + 1; return ingredientCount}, {}) .value(); /* chain() together map(), flatten() and reduce() */ expect(ingredientCount['mushrooms']).toBe(2); }); /*********************************************************************************/ /* UNCOMMENT FOR EXTRA CREDIT */ /* it("should find the largest prime factor of a composite number", function () { }); it("should find the largest palindrome made from the product of two 3 digit numbers", function () { }); it("should find the smallest number divisible by each of the numbers 1 to 20", function () { }); it("should find the difference between the sum of the squares and the square of the sums", function () { }); it("should find the 10001st prime", function () { }); */ });
{ "content_hash": "118323d5968ece95c4aa63a081b5ee84", "timestamp": "", "source": "github", "line_count": 120, "max_line_length": 147, "avg_line_length": 36, "alnum_prop": 0.5231481481481481, "repo_name": "dmoser49/javascript-koans", "id": "11ec06c2de1ecb1fee5bb20305ae084d7abe5404", "size": "4320", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "koans/AboutApplyingWhatWeHaveLearnt.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "4998" }, { "name": "HTML", "bytes": "2020" }, { "name": "JavaScript", "bytes": "153364" }, { "name": "Shell", "bytes": "169" } ], "symlink_target": "" }
/* * Copyright 2001-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /* * $Id: KeyCall.java,v 1.7 2006/06/19 19:49:04 spericas Exp $ */ package com.sun.org.apache.xalan.internal.xsltc.compiler; import java.util.Vector; import com.sun.org.apache.bcel.internal.generic.ALOAD; import com.sun.org.apache.bcel.internal.generic.ASTORE; import com.sun.org.apache.bcel.internal.generic.BranchHandle; import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen; import com.sun.org.apache.bcel.internal.generic.GOTO; import com.sun.org.apache.bcel.internal.generic.IFGT; import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE; import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL; import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL; import com.sun.org.apache.bcel.internal.generic.InstructionHandle; import com.sun.org.apache.bcel.internal.generic.InstructionList; import com.sun.org.apache.bcel.internal.generic.LocalVariableGen; import com.sun.org.apache.bcel.internal.generic.NEW; import com.sun.org.apache.bcel.internal.generic.PUSH; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError; import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util; /** * @author Morten Jorgensen * @author Santiago Pericas-Geertsen */ final class KeyCall extends FunctionCall { /** * The name of the key. */ private Expression _name; /** * The value to look up in the key/index. */ private Expression _value; /** * The value's data type. */ private Type _valueType; // The value's data type /** * Expanded qname when name is literal. */ private QName _resolvedQName = null; /** * Get the parameters passed to function: * key(String name, String value) * key(String name, NodeSet value) * The 'arguments' vector should contain two parameters for key() calls, * one holding the key name and one holding the value(s) to look up. The * vector has only one parameter for id() calls (the key name is always * "##id" for id() calls). * * @param fname The function name (should be 'key' or 'id') * @param arguments A vector containing the arguments the the function */ public KeyCall(QName fname, Vector arguments) { super(fname, arguments); switch(argumentCount()) { case 1: _name = null; _value = argument(0); break; case 2: _name = argument(0); _value = argument(1); break; default: _name = _value = null; break; } } /** * If this call to key() is in a top-level element like another variable * or param, add a dependency between that top-level element and the * referenced key. For example, * * <xsl:key name="x" .../> * <xsl:variable name="y" select="key('x', 1)"/> * * and assuming this class represents "key('x', 1)", add a reference * between variable y and key x. Note that if 'x' is unknown statically * in key('x', 1), there's nothing we can do at this point. */ public void addParentDependency() { // If name unknown statically, there's nothing we can do if (_resolvedQName == null) return; SyntaxTreeNode node = this; while (node != null && node instanceof TopLevelElement == false) { node = node.getParent(); } TopLevelElement parent = (TopLevelElement) node; if (parent != null) { parent.addDependency(getSymbolTable().getKey(_resolvedQName)); } } /** * Type check the parameters for the id() or key() function. * The index name (for key() call only) must be a string or convertable * to a string, and the lookup-value must be a string or a node-set. * @param stable The parser's symbol table * @throws TypeCheckError When the parameters have illegal type */ public Type typeCheck(SymbolTable stable) throws TypeCheckError { final Type returnType = super.typeCheck(stable); // Run type check on the key name (first argument) - must be a string, // and if it is not it must be converted to one using string() rules. if (_name != null) { final Type nameType = _name.typeCheck(stable); if (_name instanceof LiteralExpr) { final LiteralExpr literal = (LiteralExpr) _name; _resolvedQName = getParser().getQNameIgnoreDefaultNs(literal.getValue()); } else if (nameType instanceof StringType == false) { _name = new CastExpr(_name, Type.String); } } // Run type check on the value for this key. This value can be of // any data type, so this should never cause any type-check errors. // If the value is a reference, then we have to defer the decision // of how to process it until run-time. // If the value is known not to be a node-set, then it should be // converted to a string before the lookup is done. If the value is // known to be a node-set then this process (convert to string, then // do lookup) should be applied to every node in the set, and the // result from all lookups should be added to the resulting node-set. _valueType = _value.typeCheck(stable); if (_valueType != Type.NodeSet && _valueType != Type.Reference && _valueType != Type.String) { _value = new CastExpr(_value, Type.String); _valueType = _value.typeCheck(stable); } // If in a top-level element, create dependency to the referenced key addParentDependency(); return returnType; } /** * This method is called when the constructor is compiled in * Stylesheet.compileConstructor() and not as the syntax tree is traversed. * <p>This method will generate byte code that produces an iterator * for the nodes in the node set for the key or id function call. * @param classGen The Java class generator * @param methodGen The method generator */ public void translate(ClassGenerator classGen, MethodGenerator methodGen) { final ConstantPoolGen cpg = classGen.getConstantPool(); final InstructionList il = methodGen.getInstructionList(); // Returns the KeyIndex object of a given name final int getKeyIndex = cpg.addMethodref(TRANSLET_CLASS, "getKeyIndex", "(Ljava/lang/String;)"+ KEY_INDEX_SIG); // KeyIndex.setDom(Dom, node) => void final int keyDom = cpg.addMethodref(KEY_INDEX_CLASS, "setDom", "(" + DOM_INTF_SIG + "I)V"); // Initialises a KeyIndex to return nodes with specific values final int getKeyIterator = cpg.addMethodref(KEY_INDEX_CLASS, "getKeyIndexIterator", "(" + _valueType.toSignature() + "Z)" + KEY_INDEX_ITERATOR_SIG); // Initialise the index specified in the first parameter of key() il.append(classGen.loadTranslet()); if (_name == null) { il.append(new PUSH(cpg,"##id")); } else if (_resolvedQName != null) { il.append(new PUSH(cpg, _resolvedQName.toString())); } else { _name.translate(classGen, methodGen); } // Generate following byte code: // // KeyIndex ki = translet.getKeyIndex(_name) // ki.setDom(translet.dom); // ki.getKeyIndexIterator(_value, true) - for key() // OR // ki.getKeyIndexIterator(_value, false) - for id() il.append(new INVOKEVIRTUAL(getKeyIndex)); il.append(DUP); il.append(methodGen.loadDOM()); il.append(methodGen.loadCurrentNode()); il.append(new INVOKEVIRTUAL(keyDom)); _value.translate(classGen, methodGen); il.append((_name != null) ? ICONST_1: ICONST_0); il.append(new INVOKEVIRTUAL(getKeyIterator)); } }
{ "content_hash": "fe75b560882e7617bfe2fa734f6f8f48", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 79, "avg_line_length": 39.685106382978724, "alnum_prop": 0.6171992279648295, "repo_name": "wangsongpeng/jdk-src", "id": "530ca6b693bde227e6db219c63519da8fd2e4ced", "size": "9481", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "src/main/java/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "193794" }, { "name": "C++", "bytes": "6565" }, { "name": "Java", "bytes": "85385971" } ], "symlink_target": "" }
// LICENSE : MIT "use strict"; import { TextLintFixCommand } from "../textlint-kernel-interface"; export interface RuleErrorPadding { line?: number; column?: number; index?: number; fix?: TextLintFixCommand; } export default class RuleError { public message: string; private line?: number; private column?: number; private index?: number; private fix?: TextLintFixCommand; /** * RuleError is like Error object. * It's used for adding to TextLintResult. * @param {string} message error message should start with lowercase letter * @param {RuleError~Padding|number} [paddingLocation] - the object has padding {line, column} for actual error reason * @constructor */ constructor(message: string, paddingLocation?: number | RuleErrorPadding) { this.message = message; if (typeof paddingLocation === "object") { /** * padding lineNumber * @type {number} */ this.line = paddingLocation.line; /** * padding column * @type {number} */ this.column = paddingLocation.column; /** * padding index * @type {number} */ this.index = paddingLocation.index; /** * fixCommand object * @type {FixCommand} */ this.fix = paddingLocation.fix; } else if (typeof paddingLocation === "number") { // this is deprecated // should pass padding as object. this.column = paddingLocation; } } toString() { return JSON.stringify({ line: this.line, column: this.column, index: this.index, fix: this.fix }); } }
{ "content_hash": "ae4ef239982b65067274554abbc7284f", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 122, "avg_line_length": 28.9375, "alnum_prop": 0.5415766738660908, "repo_name": "t-ashula/textlint", "id": "d8e02e809c8a4aba89187ab8e356f69fddbc0703", "size": "1852", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "packages/textlint-kernel/src/core/rule-error.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "45344" } ], "symlink_target": "" }
<?php namespace OzairP\PayBud; use PayPal\Auth\OAuthTokenCredential; use PayPal\Rest\ApiContext; /** * Class Context * @package OzairP\PayBud */ class Context extends ApiContext { const MODE_SANDBOX = 'sandbox'; const MODE_LIVE = 'live'; /** * Context constructor. * * @param string $ClientID * @param string $ClientSecret * @param string $Mode * @param string $LogFileLocation * * @throws \TypeError */ function __construct($ClientID, $ClientSecret, $Mode = Context::MODE_LIVE, $LogFileLocation = NULL) { if($Mode !== 'live' && $Mode !== 'sandbox') throw new \TypeError('Mode must be \'live\' or \'sandbox\''); parent::__construct(new OAuthTokenCredential($ClientID, $ClientSecret)); $this->setConfig([ 'mode' => $Mode, 'log.LogEnabled' => !is_null($LogFileLocation), 'log.FileName' => $LogFileLocation, 'log.LogLevel' => ($Mode === Context::MODE_LIVE) ? 'INFO' : 'DEBUG', ]); } }
{ "content_hash": "2e63fccc0968914e0f49cc6f73abe2bc", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 113, "avg_line_length": 23.555555555555557, "alnum_prop": 0.5754716981132075, "repo_name": "OzairP/PayBud", "id": "6e6f368652c52dd5d3337593a7428c3ec8f93c28", "size": "1060", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/OzairP/PayBud/Context.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "10409" } ], "symlink_target": "" }
package origin import ( "crypto/tls" "fmt" "net" "net/http" "net/url" "os" "regexp" "time" etcdclient "github.com/coreos/go-etcd/etcd" "github.com/elazarl/go-bindata-assetfs" restful "github.com/emicklei/go-restful" "github.com/emicklei/go-restful/swagger" "github.com/golang/glog" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api" kapierror "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" "github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver" kclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client" kmaster "github.com/GoogleCloudPlatform/kubernetes/pkg/master" "github.com/GoogleCloudPlatform/kubernetes/pkg/tools" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/GoogleCloudPlatform/kubernetes/plugin/pkg/admission/admit" "github.com/openshift/origin/pkg/api/latest" "github.com/openshift/origin/pkg/api/v1beta1" "github.com/openshift/origin/pkg/assets" buildclient "github.com/openshift/origin/pkg/build/client" buildcontrollerfactory "github.com/openshift/origin/pkg/build/controller/factory" buildstrategy "github.com/openshift/origin/pkg/build/controller/strategy" buildregistry "github.com/openshift/origin/pkg/build/registry/build" buildconfigregistry "github.com/openshift/origin/pkg/build/registry/buildconfig" buildlogregistry "github.com/openshift/origin/pkg/build/registry/buildlog" buildetcd "github.com/openshift/origin/pkg/build/registry/etcd" "github.com/openshift/origin/pkg/build/webhook" "github.com/openshift/origin/pkg/build/webhook/generic" "github.com/openshift/origin/pkg/build/webhook/github" osclient "github.com/openshift/origin/pkg/client" cmdutil "github.com/openshift/origin/pkg/cmd/util" "github.com/openshift/origin/pkg/cmd/util/clientcmd" configchangecontroller "github.com/openshift/origin/pkg/deploy/controller/configchange" deployerpodcontroller "github.com/openshift/origin/pkg/deploy/controller/deployerpod" deploycontroller "github.com/openshift/origin/pkg/deploy/controller/deployment" deployconfigcontroller "github.com/openshift/origin/pkg/deploy/controller/deploymentconfig" imagechangecontroller "github.com/openshift/origin/pkg/deploy/controller/imagechange" deployconfiggenerator "github.com/openshift/origin/pkg/deploy/generator" deployregistry "github.com/openshift/origin/pkg/deploy/registry/deploy" deployconfigregistry "github.com/openshift/origin/pkg/deploy/registry/deployconfig" deployetcd "github.com/openshift/origin/pkg/deploy/registry/etcd" deployrollback "github.com/openshift/origin/pkg/deploy/rollback" "github.com/openshift/origin/pkg/dns" imagecontroller "github.com/openshift/origin/pkg/image/controller" "github.com/openshift/origin/pkg/image/registry/image" imageetcd "github.com/openshift/origin/pkg/image/registry/image/etcd" "github.com/openshift/origin/pkg/image/registry/imagerepository" imagerepositoryetcd "github.com/openshift/origin/pkg/image/registry/imagerepository/etcd" "github.com/openshift/origin/pkg/image/registry/imagerepositorymapping" "github.com/openshift/origin/pkg/image/registry/imagerepositorytag" "github.com/openshift/origin/pkg/image/registry/imagestreamimage" accesstokenregistry "github.com/openshift/origin/pkg/oauth/registry/accesstoken" authorizetokenregistry "github.com/openshift/origin/pkg/oauth/registry/authorizetoken" clientregistry "github.com/openshift/origin/pkg/oauth/registry/client" clientauthorizationregistry "github.com/openshift/origin/pkg/oauth/registry/clientauthorization" oauthetcd "github.com/openshift/origin/pkg/oauth/registry/etcd" projectregistry "github.com/openshift/origin/pkg/project/registry/project" routeallocationcontroller "github.com/openshift/origin/pkg/route/controller/allocation" routeetcd "github.com/openshift/origin/pkg/route/registry/etcd" routeregistry "github.com/openshift/origin/pkg/route/registry/route" "github.com/openshift/origin/pkg/service" templateregistry "github.com/openshift/origin/pkg/template/registry" templateetcd "github.com/openshift/origin/pkg/template/registry/etcd" "github.com/openshift/origin/pkg/user" useretcd "github.com/openshift/origin/pkg/user/registry/etcd" userregistry "github.com/openshift/origin/pkg/user/registry/user" "github.com/openshift/origin/pkg/user/registry/useridentitymapping" "github.com/openshift/origin/pkg/version" authorizationapi "github.com/openshift/origin/pkg/authorization/api" authorizationetcd "github.com/openshift/origin/pkg/authorization/registry/etcd" policyregistry "github.com/openshift/origin/pkg/authorization/registry/policy" policybindingregistry "github.com/openshift/origin/pkg/authorization/registry/policybinding" resourceaccessreviewregistry "github.com/openshift/origin/pkg/authorization/registry/resourceaccessreview" roleregistry "github.com/openshift/origin/pkg/authorization/registry/role" rolebindingregistry "github.com/openshift/origin/pkg/authorization/registry/rolebinding" subjectaccessreviewregistry "github.com/openshift/origin/pkg/authorization/registry/subjectaccessreview" "github.com/openshift/origin/pkg/cmd/server/admin" configapi "github.com/openshift/origin/pkg/cmd/server/api" routeplugin "github.com/openshift/origin/plugins/route/allocation/simple" ) const ( OpenShiftAPIPrefix = "/osapi" OpenShiftAPIV1Beta1 = "v1beta1" OpenShiftAPIPrefixV1Beta1 = OpenShiftAPIPrefix + "/" + OpenShiftAPIV1Beta1 OpenShiftRouteSubdomain = "router.default.local" swaggerAPIPrefix = "/swaggerapi/" ) // APIInstaller installs additional API components into this server type APIInstaller interface { // Returns an array of strings describing what was installed InstallAPI(*restful.Container) []string } // APIInstallFunc is a function for installing APIs type APIInstallFunc func(*restful.Container) []string // InstallAPI implements APIInstaller func (fn APIInstallFunc) InstallAPI(container *restful.Container) []string { return fn(container) } // KubeClient returns the kubernetes client object func (c *MasterConfig) KubeClient() *kclient.Client { return c.KubernetesClient } // PolicyClient returns the policy client object // It must have the following capabilities: // list, watch all policyBindings in all namespaces // list, watch all policies in all namespaces // create resourceAccessReviews in all namespaces func (c *MasterConfig) PolicyClient() *osclient.Client { return c.OSClient } // DeploymentClient returns the deployment client object func (c *MasterConfig) DeploymentClient() *kclient.Client { return c.KubernetesClient } // DNSServerClient returns the DNS server client object // It must have the following capabilities: // list, watch all services in all namespaces func (c *MasterConfig) DNSServerClient() *kclient.Client { return c.KubernetesClient } // BuildLogClient returns the build log client object func (c *MasterConfig) BuildLogClient() *kclient.Client { return c.KubernetesClient } // WebHookClient returns the webhook client object func (c *MasterConfig) WebHookClient() *osclient.Client { return c.OSClient } // BuildControllerClients returns the build controller client objects func (c *MasterConfig) BuildControllerClients() (*osclient.Client, *kclient.Client) { return c.OSClient, c.KubernetesClient } // ImageChangeControllerClient returns the openshift client object func (c *MasterConfig) ImageChangeControllerClient() *osclient.Client { return c.OSClient } // ImageImportControllerClient returns the deployment client object func (c *MasterConfig) ImageImportControllerClient() *osclient.Client { return c.OSClient } // DeploymentControllerClients returns the deployment controller client object func (c *MasterConfig) DeploymentControllerClients() (*osclient.Client, *kclient.Client) { return c.OSClient, c.KubernetesClient } // DeployerClientConfig returns the client configuration a Deployer instance launched in a pod // should use when making API calls. func (c *MasterConfig) DeployerClientConfig() *kclient.Config { return &c.DeployerOSClientConfig } func (c *MasterConfig) DeploymentConfigControllerClients() (*osclient.Client, *kclient.Client) { return c.OSClient, c.KubernetesClient } func (c *MasterConfig) DeploymentConfigChangeControllerClients() (*osclient.Client, *kclient.Client) { return c.OSClient, c.KubernetesClient } func (c *MasterConfig) DeploymentImageChangeControllerClient() *osclient.Client { return c.OSClient } func (c *MasterConfig) InstallProtectedAPI(container *restful.Container) []string { defaultRegistry := env("OPENSHIFT_DEFAULT_REGISTRY", "${DOCKER_REGISTRY_SERVICE_HOST}:${DOCKER_REGISTRY_SERVICE_PORT}") svcCache := service.NewServiceResolverCache(c.KubeClient().Services(api.NamespaceDefault).Get) defaultRegistryFunc, err := svcCache.Defer(defaultRegistry) if err != nil { glog.Fatalf("OPENSHIFT_DEFAULT_REGISTRY variable is invalid %q: %v", defaultRegistry, err) } buildEtcd := buildetcd.New(c.EtcdHelper) deployEtcd := deployetcd.New(c.EtcdHelper) routeEtcd := routeetcd.New(c.EtcdHelper) userEtcd := useretcd.New(c.EtcdHelper, user.NewDefaultUserInitStrategy()) oauthEtcd := oauthetcd.New(c.EtcdHelper) authorizationEtcd := authorizationetcd.New(c.EtcdHelper) imageStorage := imageetcd.NewREST(c.EtcdHelper) imageRegistry := image.NewRegistry(imageStorage) imageRepositoryStorage, imageRepositoryStatus := imagerepositoryetcd.NewREST(c.EtcdHelper, imagerepository.DefaultRegistryFunc(defaultRegistryFunc)) imageRepositoryRegistry := imagerepository.NewRegistry(imageRepositoryStorage, imageRepositoryStatus) imageRepositoryMappingStorage := imagerepositorymapping.NewREST(imageRegistry, imageRepositoryRegistry) imageRepositoryTagStorage := imagerepositorytag.NewREST(imageRegistry, imageRepositoryRegistry) imageStreamImageStorage := imagestreamimage.NewREST(imageRegistry, imageRepositoryRegistry) routeAllocator := c.RouteAllocator() // TODO: with sharding, this needs to be changed deployConfigGenerator := &deployconfiggenerator.DeploymentConfigGenerator{ Client: deployconfiggenerator.Client{ DCFn: deployEtcd.GetDeploymentConfig, IRFn: imageRepositoryRegistry.GetImageRepository, LIRFn2: imageRepositoryRegistry.ListImageRepositories, }, Codec: latest.Codec, } _, kclient := c.DeploymentConfigControllerClients() deployRollback := &deployrollback.RollbackGenerator{} deployRollbackClient := deployrollback.Client{ DCFn: deployEtcd.GetDeploymentConfig, RCFn: clientDeploymentInterface{kclient}.GetDeployment, GRFn: deployRollback.GenerateRollback, } // initialize OpenShift API storage := map[string]apiserver.RESTStorage{ "builds": buildregistry.NewREST(buildEtcd), "buildConfigs": buildconfigregistry.NewREST(buildEtcd), "buildLogs": buildlogregistry.NewREST(buildEtcd, c.BuildLogClient()), "images": imageStorage, "imageStreams": imageRepositoryStorage, "imageStreamImages": imageStreamImageStorage, "imageStreamMappings": imageRepositoryMappingStorage, "imageStreamTags": imageRepositoryTagStorage, "imageRepositories": imageRepositoryStorage, "imageRepositories/status": imageRepositoryStatus, "imageRepositoryMappings": imageRepositoryMappingStorage, "imageRepositoryTags": imageRepositoryTagStorage, "deployments": deployregistry.NewREST(deployEtcd), "deploymentConfigs": deployconfigregistry.NewREST(deployEtcd), "generateDeploymentConfigs": deployconfiggenerator.NewREST(deployConfigGenerator, v1beta1.Codec), "deploymentConfigRollbacks": deployrollback.NewREST(deployRollbackClient, latest.Codec), "templateConfigs": templateregistry.NewREST(), "templates": templateetcd.NewREST(c.EtcdHelper), "routes": routeregistry.NewREST(routeEtcd, routeAllocator), "projects": projectregistry.NewREST(kclient.Namespaces(), c.ProjectAuthorizationCache), "userIdentityMappings": useridentitymapping.NewREST(userEtcd), "users": userregistry.NewREST(userEtcd), "oAuthAuthorizeTokens": authorizetokenregistry.NewREST(oauthEtcd), "oAuthAccessTokens": accesstokenregistry.NewREST(oauthEtcd), "oAuthClients": clientregistry.NewREST(oauthEtcd), "oAuthClientAuthorizations": clientauthorizationregistry.NewREST(oauthEtcd), "policies": policyregistry.NewREST(authorizationEtcd), "policyBindings": policybindingregistry.NewREST(authorizationEtcd), "roles": roleregistry.NewREST(roleregistry.NewVirtualRegistry(authorizationEtcd)), "roleBindings": rolebindingregistry.NewREST(rolebindingregistry.NewVirtualRegistry(authorizationEtcd, authorizationEtcd, c.Options.PolicyConfig.MasterAuthorizationNamespace)), "resourceAccessReviews": resourceaccessreviewregistry.NewREST(c.Authorizer), "subjectAccessReviews": subjectaccessreviewregistry.NewREST(c.Authorizer), } admissionControl := admit.NewAlwaysAdmit() version := &apiserver.APIGroupVersion{ Root: OpenShiftAPIPrefix, Version: OpenShiftAPIV1Beta1, Storage: storage, Codec: v1beta1.Codec, Mapper: latest.RESTMapper, Creater: kapi.Scheme, Typer: kapi.Scheme, Linker: latest.SelfLinker, Admit: admissionControl, Context: c.getRequestContextMapper(), } if err := version.InstallREST(container); err != nil { glog.Fatalf("Unable to initialize API: %v", err) } var root *restful.WebService for _, svc := range container.RegisteredWebServices() { switch svc.RootPath() { case "/": root = svc case OpenShiftAPIPrefixV1Beta1: svc.Doc("OpenShift REST API, version v1beta1").ApiVersion("v1beta1") } } if root == nil { root = new(restful.WebService) container.Add(root) } initAPIVersionRoute(root, "v1beta1") return []string{ fmt.Sprintf("Started OpenShift API at %%s%s", OpenShiftAPIPrefixV1Beta1), } } func (c *MasterConfig) InstallUnprotectedAPI(container *restful.Container) []string { bcClient, _ := c.BuildControllerClients() handler := webhook.NewController( buildclient.NewOSClientBuildConfigClient(bcClient), buildclient.NewOSClientBuildClient(bcClient), bcClient.ImageRepositories(kapi.NamespaceAll).(osclient.ImageRepositoryNamespaceGetter), map[string]webhook.Plugin{ "generic": generic.New(), "github": github.New(), }) // TODO: go-restfulize this prefix := OpenShiftAPIPrefixV1Beta1 + "/buildConfigHooks/" handler = http.StripPrefix(prefix, handler) container.Handle(prefix, handler) return []string{} } //initAPIVersionRoute initializes the osapi endpoint to behave similar to the upstream api endpoint func initAPIVersionRoute(root *restful.WebService, version string) { versionHandler := apiserver.APIVersionHandler(version) root.Route(root.GET(OpenShiftAPIPrefix).To(versionHandler). Doc("list supported server API versions"). Produces(restful.MIME_JSON). Consumes(restful.MIME_JSON)) } // Run launches the OpenShift master. It takes optional installers that may install additional endpoints into the server. // All endpoints get configured CORS behavior // Protected installers' endpoints are protected by API authentication and authorization. // Unprotected installers' endpoints do not have any additional protection added. func (c *MasterConfig) Run(protected []APIInstaller, unprotected []APIInstaller) { var extra []string safe := kmaster.NewHandlerContainer(http.NewServeMux()) open := kmaster.NewHandlerContainer(http.NewServeMux()) // enforce authentication on protected endpoints protected = append(protected, APIInstallFunc(c.InstallProtectedAPI)) for _, i := range protected { extra = append(extra, i.InstallAPI(safe)...) } handler := c.authorizationFilter(safe) handler = authenticationHandlerFilter(handler, c.Authenticator, c.getRequestContextMapper()) handler = namespacingFilter(handler, c.getRequestContextMapper()) // unprotected resources unprotected = append(unprotected, APIInstallFunc(c.InstallUnprotectedAPI)) for _, i := range unprotected { extra = append(extra, i.InstallAPI(open)...) } open.Handle("/", handler) // install swagger swaggerConfig := swagger.Config{ WebServices: append(safe.RegisteredWebServices(), open.RegisteredWebServices()...), ApiPath: swaggerAPIPrefix, } swagger.RegisterSwaggerService(swaggerConfig, open) extra = append(extra, fmt.Sprintf("Started Swagger Schema API at %%s%s", swaggerAPIPrefix)) handler = open // add CORS support if origins := c.ensureCORSAllowedOrigins(); len(origins) != 0 { handler = apiserver.CORS(handler, origins, nil, nil, "true") } // Make the outermost filter the requestContextMapper to ensure all components share the same context if contextHandler, err := kapi.NewRequestContextFilter(c.getRequestContextMapper(), handler); err != nil { glog.Fatalf("Error setting up request context filter: %v", err) } else { handler = contextHandler } server := &http.Server{ Addr: c.Options.ServingInfo.BindAddress, Handler: handler, ReadTimeout: 5 * time.Minute, WriteTimeout: 5 * time.Minute, MaxHeaderBytes: 1 << 20, } go util.Forever(func() { for _, s := range extra { glog.Infof(s, c.Options.ServingInfo.BindAddress) } if c.TLS { server.TLSConfig = &tls.Config{ // Change default from SSLv3 to TLSv1.0 (because of POODLE vulnerability) MinVersion: tls.VersionTLS10, // Populate PeerCertificates in requests, but don't reject connections without certificates // This allows certificates to be validated by authenticators, while still allowing other auth types ClientAuth: tls.RequestClientCert, ClientCAs: c.ClientCAs, } glog.Fatal(server.ListenAndServeTLS(c.Options.ServingInfo.ServerCert.CertFile, c.Options.ServingInfo.ServerCert.KeyFile)) } else { glog.Fatal(server.ListenAndServe()) } }, 0) // Attempt to verify the server came up for 20 seconds (100 tries * 100ms, 100ms timeout per try) cmdutil.WaitForSuccessfulDial(c.TLS, "tcp", c.Options.ServingInfo.BindAddress, 100*time.Millisecond, 100*time.Millisecond, 100) // Attempt to create the required policy rules now, and then stick in a forever loop to make sure they are always available c.ensureComponentAuthorizationRules() c.ensureMasterAuthorizationNamespace() go util.Forever(func() { c.ensureMasterAuthorizationNamespace() }, 10*time.Second) } // getRequestContextMapper returns a mapper from requests to contexts, initializing it if needed func (c *MasterConfig) getRequestContextMapper() kapi.RequestContextMapper { if c.RequestContextMapper == nil { c.RequestContextMapper = kapi.NewRequestContextMapper() } return c.RequestContextMapper } // ensureMasterAuthorizationNamespace is called as part of global policy initialization to ensure master namespace exists func (c *MasterConfig) ensureMasterAuthorizationNamespace() { // ensure that master namespace actually exists namespace, err := c.KubeClient().Namespaces().Get(c.Options.PolicyConfig.MasterAuthorizationNamespace) if err != nil { namespace = &kapi.Namespace{ObjectMeta: kapi.ObjectMeta{Name: c.Options.PolicyConfig.MasterAuthorizationNamespace}} kapi.FillObjectMetaSystemFields(api.NewContext(), &namespace.ObjectMeta) _, err = c.KubeClient().Namespaces().Create(namespace) if err != nil { glog.Errorf("Error creating namespace: %v due to %v\n", namespace, err) } } } // ensureComponentAuthorizationRules initializes the global policies func (c *MasterConfig) ensureComponentAuthorizationRules() { registry := authorizationetcd.New(c.EtcdHelper) ctx := kapi.WithNamespace(kapi.NewContext(), c.Options.PolicyConfig.MasterAuthorizationNamespace) if _, err := registry.GetPolicy(ctx, authorizationapi.PolicyName); kapierror.IsNotFound(err) { glog.Infof("No master policy found. Creating bootstrap policy based on: %v", c.Options.PolicyConfig.BootstrapPolicyFile) if err := admin.OverwriteBootstrapPolicy(c.EtcdHelper, c.Options.PolicyConfig.MasterAuthorizationNamespace, c.Options.PolicyConfig.BootstrapPolicyFile); err != nil { glog.Errorf("Error creating bootstrap policy: %v", err) } } else { glog.V(2).Infof("Ignoring bootstrap policy file because master policy found") } } func (c *MasterConfig) authorizationFilter(handler http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { attributes, err := c.AuthorizationAttributeBuilder.GetAttributes(req) if err != nil { forbidden(err.Error(), w, req) return } if attributes == nil { forbidden("No attributes", w, req) return } ctx, exists := c.RequestContextMapper.Get(req) if !exists { forbidden("context not found", w, req) return } allowed, reason, err := c.Authorizer.Authorize(ctx, attributes) if err != nil { forbidden(err.Error(), w, req) return } if !allowed { forbidden(reason, w, req) return } handler.ServeHTTP(w, req) }) } // forbidden renders a simple forbidden error func forbidden(reason string, w http.ResponseWriter, req *http.Request) { w.WriteHeader(http.StatusForbidden) fmt.Fprintf(w, "Forbidden: %q %s", req.RequestURI, reason) } // RunProjectAuthorizationCache starts the project authorization cache func (c *MasterConfig) RunProjectAuthorizationCache() { // TODO: look at exposing a configuration option in future to control how often we run this loop period := 1 * time.Second c.ProjectAuthorizationCache.Run(period) } // RunPolicyCache starts the policy cache func (c *MasterConfig) RunPolicyCache() { c.PolicyCache.Run() } // RunAssetServer starts the asset server for the OpenShift UI. func (c *MasterConfig) RunAssetServer() { // TODO use version.Get().GitCommit as an etag cache header mux := http.NewServeMux() masterURL, err := url.Parse(c.Options.AssetConfig.MasterPublicURL) if err != nil { glog.Fatalf("Error parsing master url: %v", err) } k8sURL, err := url.Parse(c.Options.AssetConfig.KubernetesPublicURL) if err != nil { glog.Fatalf("Error parsing kubernetes url: %v", err) } config := assets.WebConsoleConfig{ MasterAddr: masterURL.Host, MasterPrefix: OpenShiftAPIPrefix, KubernetesAddr: k8sURL.Host, KubernetesPrefix: "/api", OAuthAuthorizeURI: OpenShiftOAuthAuthorizeURL(masterURL.String()), OAuthRedirectBase: c.Options.AssetConfig.PublicURL, OAuthClientID: OpenShiftWebConsoleClientID, LogoutURI: c.Options.AssetConfig.LogoutURI, } assets.RegisterMimeTypes() mux.Handle("/", // Gzip first so that inner handlers can react to the addition of the Vary header assets.GzipHandler( // Generated config.js can not be cached since it changes depending on startup options assets.GeneratedConfigHandler( config, // Cache control should happen after all Vary headers are added, but before // any asset related routing (HTML5ModeHandler and FileServer) assets.CacheControlHandler( version.Get().GitCommit, assets.HTML5ModeHandler( http.FileServer( &assetfs.AssetFS{ assets.Asset, assets.AssetDir, "", }, ), ), ), ), ), ) server := &http.Server{ Addr: c.Options.AssetConfig.ServingInfo.BindAddress, Handler: mux, ReadTimeout: 5 * time.Minute, WriteTimeout: 5 * time.Minute, MaxHeaderBytes: 1 << 20, } go util.Forever(func() { if c.TLS { server.TLSConfig = &tls.Config{ // Change default from SSLv3 to TLSv1.0 (because of POODLE vulnerability) MinVersion: tls.VersionTLS10, } glog.Infof("OpenShift UI listening at https://%s", c.Options.AssetConfig.ServingInfo.BindAddress) glog.Fatal(server.ListenAndServeTLS(c.Options.AssetConfig.ServingInfo.ServerCert.CertFile, c.Options.AssetConfig.ServingInfo.ServerCert.KeyFile)) } else { glog.Infof("OpenShift UI listening at https://%s", c.Options.AssetConfig.ServingInfo.BindAddress) glog.Fatal(server.ListenAndServe()) } }, 0) // Attempt to verify the server came up for 20 seconds (100 tries * 100ms, 100ms timeout per try) cmdutil.WaitForSuccessfulDial(c.TLS, "tcp", c.Options.AssetConfig.ServingInfo.BindAddress, 100*time.Millisecond, 100*time.Millisecond, 100) glog.Infof("OpenShift UI available at %s", c.Options.AssetConfig.PublicURL) } func (c *MasterConfig) RunDNSServer() { config, err := dns.NewServerDefaults() if err != nil { glog.Fatalf("Could not start DNS: %v", err) } config.DnsAddr = c.Options.DNSConfig.BindAddress _, port, err := net.SplitHostPort(c.Options.DNSConfig.BindAddress) if err != nil { glog.Fatalf("Could not start DNS: %v", err) } if port != "53" { glog.Warningf("Binding DNS on port %v instead of 53 (you may need to run as root and update your config), using %s which will not resolve from all locations", port, c.Options.DNSConfig.BindAddress) } if ok, err := cmdutil.TryListen(c.Options.DNSConfig.BindAddress); !ok { glog.Warningf("Could not start DNS: %v", err) return } go func() { err := dns.ListenAndServe(config, c.DNSServerClient(), c.EtcdHelper.Client.(*etcdclient.Client)) glog.Fatalf("Could not start DNS: %v", err) }() cmdutil.WaitForSuccessfulDial(false, "tcp", c.Options.DNSConfig.BindAddress, 100*time.Millisecond, 100*time.Millisecond, 100) glog.Infof("OpenShift DNS listening at %s", c.Options.DNSConfig.BindAddress) } // RunBuildController starts the build sync loop for builds and buildConfig processing. func (c *MasterConfig) RunBuildController() { // initialize build controller dockerImage := c.ImageFor("docker-builder") stiImage := c.ImageFor("sti-builder") osclient, kclient := c.BuildControllerClients() factory := buildcontrollerfactory.BuildControllerFactory{ OSClient: osclient, KubeClient: kclient, BuildUpdater: buildclient.NewOSClientBuildClient(osclient), DockerBuildStrategy: &buildstrategy.DockerBuildStrategy{ Image: dockerImage, // TODO: this will be set to --storage-version (the internal schema we use) Codec: v1beta1.Codec, }, STIBuildStrategy: &buildstrategy.STIBuildStrategy{ Image: stiImage, TempDirectoryCreator: buildstrategy.STITempDirectoryCreator, // TODO: this will be set to --storage-version (the internal schema we use) Codec: v1beta1.Codec, }, CustomBuildStrategy: &buildstrategy.CustomBuildStrategy{ // TODO: this will be set to --storage-version (the internal schema we use) Codec: v1beta1.Codec, }, } controller := factory.Create() controller.Run() } // RunBuildPodController starts the build/pod status sync loop for build status func (c *MasterConfig) RunBuildPodController() { osclient, kclient := c.BuildControllerClients() factory := buildcontrollerfactory.BuildPodControllerFactory{ OSClient: osclient, KubeClient: kclient, BuildUpdater: buildclient.NewOSClientBuildClient(osclient), } controller := factory.Create() controller.Run() } // RunBuildImageChangeTriggerController starts the build image change trigger controller process. func (c *MasterConfig) RunBuildImageChangeTriggerController() { bcClient, _ := c.BuildControllerClients() bcUpdater := buildclient.NewOSClientBuildConfigClient(bcClient) bCreator := buildclient.NewOSClientBuildClient(bcClient) factory := buildcontrollerfactory.ImageChangeControllerFactory{Client: bcClient, BuildCreator: bCreator, BuildConfigUpdater: bcUpdater} factory.Create().Run() } // RunDeploymentController starts the deployment controller process. func (c *MasterConfig) RunDeploymentController() error { _, kclient := c.DeploymentControllerClients() _, kclientConfig, err := configapi.GetKubeClient(c.Options.MasterClients.OpenShiftLoopbackKubeConfig) if err != nil { return err } // TODO eliminate these environment variables once we figure out what they do env := []api.EnvVar{ {Name: "KUBERNETES_MASTER", Value: kclientConfig.Host}, {Name: "OPENSHIFT_MASTER", Value: kclientConfig.Host}, } env = append(env, clientcmd.EnvVarsFromConfig(c.DeployerClientConfig())...) factory := deploycontroller.DeploymentControllerFactory{ KubeClient: kclient, Codec: latest.Codec, Environment: env, RecreateStrategyImage: c.ImageFor("deployer"), } controller := factory.Create() controller.Run() return nil } // RunDeployerPodController starts the deployer pod controller process. func (c *MasterConfig) RunDeployerPodController() { _, kclient := c.DeploymentControllerClients() factory := deployerpodcontroller.DeployerPodControllerFactory{ KubeClient: kclient, } controller := factory.Create() controller.Run() } func (c *MasterConfig) RunDeploymentConfigController() { osclient, kclient := c.DeploymentConfigControllerClients() factory := deployconfigcontroller.DeploymentConfigControllerFactory{ Client: osclient, KubeClient: kclient, Codec: latest.Codec, } controller := factory.Create() controller.Run() } func (c *MasterConfig) RunDeploymentConfigChangeController() { osclient, kclient := c.DeploymentConfigChangeControllerClients() factory := configchangecontroller.DeploymentConfigChangeControllerFactory{ Client: osclient, KubeClient: kclient, Codec: latest.Codec, } controller := factory.Create() controller.Run() } func (c *MasterConfig) RunDeploymentImageChangeTriggerController() { osclient := c.DeploymentImageChangeControllerClient() factory := imagechangecontroller.ImageChangeControllerFactory{Client: osclient} controller := factory.Create() controller.Run() } // RouteAllocator returns a route allocation controller. func (c *MasterConfig) RouteAllocator() *routeallocationcontroller.RouteAllocationController { factory := routeallocationcontroller.RouteAllocationControllerFactory{ OSClient: c.OSClient, KubeClient: c.KubeClient(), } subdomain := env("OPENSHIFT_ROUTE_SUBDOMAIN", OpenShiftRouteSubdomain) plugin, err := routeplugin.NewSimpleAllocationPlugin(subdomain) if err != nil { glog.Fatalf("Route plugin initialization failed: %v", err) } return factory.Create(plugin) } func (c *MasterConfig) RunImageImportController() { osclient := c.ImageImportControllerClient() factory := imagecontroller.ImportControllerFactory{ Client: osclient, } controller := factory.Create() controller.Run() } // ensureCORSAllowedOrigins takes a string list of origins and attempts to covert them to CORS origin // regexes, or exits if it cannot. func (c *MasterConfig) ensureCORSAllowedOrigins() []*regexp.Regexp { if len(c.Options.CORSAllowedOrigins) == 0 { return []*regexp.Regexp{} } allowedOriginRegexps, err := util.CompileRegexps(util.StringList(c.Options.CORSAllowedOrigins)) if err != nil { glog.Fatalf("Invalid --cors-allowed-origins: %v", err) } return allowedOriginRegexps } // NewEtcdHelper returns an EtcdHelper for the provided arguments or an error if the version // is incorrect. func NewEtcdHelper(version string, client *etcdclient.Client) (helper tools.EtcdHelper, err error) { if len(version) == 0 { version = latest.Version } interfaces, err := latest.InterfacesFor(version) if err != nil { return helper, err } return tools.NewEtcdHelper(client, interfaces.Codec), nil } // env returns an environment variable, or the defaultValue if it is not set. func env(key string, defaultValue string) string { val := os.Getenv(key) if len(val) == 0 { return defaultValue } return val } type clientDeploymentInterface struct { KubeClient kclient.Interface } func (c clientDeploymentInterface) GetDeployment(ctx api.Context, name string) (*api.ReplicationController, error) { return c.KubeClient.ReplicationControllers(api.NamespaceValue(ctx)).Get(name) } // namespacingFilter adds a filter that adds the namespace of the request to the context. Not all requests will have namespaces, // but any that do will have the appropriate value added. func namespacingFilter(handler http.Handler, contextMapper kapi.RequestContextMapper) http.Handler { infoResolver := &apiserver.APIRequestInfoResolver{util.NewStringSet("api", "osapi"), latest.RESTMapper} return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { ctx, ok := contextMapper.Get(req) if !ok { http.Error(w, "Unable to find request context", http.StatusInternalServerError) return } if _, exists := kapi.NamespaceFrom(ctx); !exists { if requestInfo, err := infoResolver.GetAPIRequestInfo(req); err == nil { // only set the namespace if the apiRequestInfo was resolved // keep in mind that GetAPIRequestInfo will fail on non-api requests, so don't fail the entire http request on that // kind of failure. // TODO reconsider special casing this. Having the special case hereallow us to fully share the kube // APIRequestInfoResolver without any modification or customization. namespace := requestInfo.Namespace if (requestInfo.Resource == "projects") && (len(requestInfo.Name) > 0) { namespace = requestInfo.Name } ctx = kapi.WithNamespace(ctx, namespace) contextMapper.Update(req, ctx) } } handler.ServeHTTP(w, req) }) }
{ "content_hash": "34008809ef9470d78664411ce50b0740", "timestamp": "", "source": "github", "line_count": 852, "max_line_length": 199, "avg_line_length": 38.806338028169016, "alnum_prop": 0.7671717629979131, "repo_name": "sdodson/origin", "id": "d884dc31628c9e691246f7ff5dce875aae025cc8", "size": "33063", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "pkg/cmd/server/origin/master.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "44938" }, { "name": "Go", "bytes": "10015658" }, { "name": "HTML", "bytes": "70349" }, { "name": "JavaScript", "bytes": "198824" }, { "name": "Makefile", "bytes": "2748" }, { "name": "Python", "bytes": "3979" }, { "name": "Ruby", "bytes": "236" }, { "name": "Shell", "bytes": "97004" } ], "symlink_target": "" }
<?php include_once(TOOLKIT . '/class.manager.php'); include_once(TOOLKIT . '/class.extension.php'); define_safe('EXTENSION_ENABLED', 10); define_safe('EXTENSION_DISABLED', 11); define_safe('EXTENSION_NOT_INSTALLED', 12); define_safe('EXTENSION_REQUIRES_UPDATE', 13); Class ExtensionManager extends Manager{ function __getClassName($name){ return 'extension_' . $name; } function __getClassPath($name){ return EXTENSIONS . strtolower("/$name"); } function __getDriverPath($name){ return $this->__getClassPath($name) . '/extension.driver.php'; } function getClassPath($name){ return EXTENSIONS . strtolower("/$name"); } function sortByStatus($s1, $s2){ if($s1['status'] == EXTENSION_ENABLED) $status_s1 = 2; elseif(in_array($s1['status'], array(EXTENSION_DISABLED, EXTENSION_NOT_INSTALLED, EXTENSION_REQUIRES_UPDATE))) $status_s1 = 1; else $status_s1 = 0; if($s2['status'] == EXTENSION_ENABLED) $status_s2 = 2; elseif(in_array($s2['status'], array(EXTENSION_DISABLED, EXTENSION_NOT_INSTALLED, EXTENSION_REQUIRES_UPDATE))) $status_s2 = 1; else $status_s2 = 0; return $status_s2 - $status_s1; } function sortByName($a, $b) { return strnatcasecmp($a['name'], $b['name']); } function enable($name){ if(false == ($obj =& $this->create($name))){ trigger_error(__('Could not %1$s %2$s, there was a problem loading the object. Check the driver class exists.', array(__FUNCTION__, $name)), E_USER_WARNING); return false; } ## If not installed, install it if($this->__requiresInstallation($name) && $obj->install() === false){ return false; } ## If requires and upate before enabling, than update it first elseif(($about = $this->about($name)) && ($previousVersion = $this->__requiresUpdate($about)) !== false) $obj->update($previousVersion); $id = $this->registerService($name); ## Now enable the extension $obj->enable(); unset($obj); return true; } function disable($name){ if(false == ($obj =& $this->create($name))){ trigger_error(__('Could not %1$s %2$s, there was a problem loading the object. Check the driver class exists.', array(__FUNCTION__, $name)), E_USER_ERROR); return false; } $id = $this->registerService($name, false); $obj->disable(); unset($obj); $this->pruneService($name, true); return true; } function uninstall($name){ if(false == ($obj =& $this->create($name))){ trigger_error(__('Could not %1$s %2$s, there was a problem loading the object. Check the driver class exists.', array(__FUNCTION__, $name)), E_USER_WARNING); return false; } $obj->uninstall(); unset($obj); $this->pruneService($name); return true; } function fetchStatus($name){ if(!$status = $this->_Parent->Database->fetchVar('status', 0, "SELECT `status` FROM `tbl_extensions` WHERE `name` = '$name' LIMIT 1")) return EXTENSION_NOT_INSTALLED; if($status == 'enabled') return EXTENSION_ENABLED; return EXTENSION_DISABLED; } function pruneService($name, $delegates_only=false){ $classname = $this->__getClassName($name); $path = $this->__getDriverPath($name); if(!@file_exists($path)) return false; $delegates = $this->_Parent->Database->fetchCol('id', "SELECT tbl_extensions_delegates.`id` FROM `tbl_extensions_delegates` LEFT JOIN `tbl_extensions` ON (`tbl_extensions`.id = `tbl_extensions_delegates`.extension_id) WHERE `tbl_extensions`.name = '$name'"); $this->_Parent->Database->delete('tbl_extensions_delegates', " `id` IN ('".@implode("', '", $delegates)."') "); if(!$delegates_only) $this->_Parent->Database->query("DELETE FROM `tbl_extensions` WHERE `name` = '$name'"); ## Remove the unused DB records $this->__cleanupDatabase(); return true; } function registerService($name, $enable=true){ $classname = $this->__getClassName($name); $path = $this->__getDriverPath($name); if(!@file_exists($path)) return false; require_once($path); $subscribed = call_user_func(array(&$classname, "getSubscribedDelegates")); if($existing_id = $this->fetchExtensionID($name)) $this->_Parent->Database->query("DELETE FROM `tbl_extensions_delegates` WHERE `tbl_extensions_delegates`.extension_id = $existing_id"); $this->_Parent->Database->query("DELETE FROM `tbl_extensions` WHERE `name` = '$name'"); $info = $this->about($name); $sql = "INSERT INTO `tbl_extensions` VALUES (NULL, '$name', '".($enable ? 'enabled' : 'disabled')."', ".floatval($info['version']).")"; $this->_Parent->Database->query($sql); $id = $this->_Parent->Database->getInsertID(); if(is_array($subscribed) && !empty($subscribed)){ foreach($subscribed as $s){ $sql = "INSERT INTO `tbl_extensions_delegates` VALUES (NULL, '$id', '".$s['page']."', '".$s['delegate']."', '".$s['callback']."')"; $this->_Parent->Database->query($sql); } } ## Remove the unused DB records $this->__cleanupDatabase(); return $id; } function listInstalledHandles(){ return $this->_Parent->Database->fetchCol('name', "SELECT `name` FROM `tbl_extensions` WHERE `status` = 'enabled'"); } ## Will return a list of all extensions and their about information function listAll(){ $extensions = array(); $result = array(); $structure = General::listStructure(EXTENSIONS, array(), false, 'asc', EXTENSIONS); $extensions = $structure['dirlist']; if(is_array($extensions) && !empty($extensions)){ foreach($extensions as $e){ if($about = $this->about($e)) $result[$e] = $about; } } return $result; } function notifyMembers($delegate, $page, $context=array()){ if($this->_Parent->Configuration->get('allow_page_subscription', 'symphony') != '1') return; $services = $this->_Parent->Database->fetch("SELECT t1.*, t2.callback FROM `tbl_extensions` as t1 LEFT JOIN `tbl_extensions_delegates` as t2 ON t1.id = t2.extension_id WHERE (t2.page = '$page' OR t2.page = '*') AND t2.delegate = '$delegate' AND t1.status = 'enabled'"); if(!is_array($services) || empty($services)) return NULL; $context += array('parent' => &$this->_Parent, 'page' => $page, 'delegate' => $delegate); foreach($services as $s){ if(false != ($obj =& $this->create($s['name']))){ if(is_callable(array($obj, $s['callback']))){ $obj->{$s['callback']}($context); unset($obj); } } } } ## Creates a new object and returns a pointer to it function &create($name, $param=array(), $slient=false){ if(!is_array(self::$_pool)) $this->flush(); if(!isset(self::$_pool[$name])){ $classname = $this->__getClassName($name); $path = $this->__getDriverPath($name); if(!@is_file($path)){ if(!$slient) trigger_error(__('Could not find extension at location %s', array($path)), E_USER_ERROR); return false; } if(!class_exists($classname)) require_once($path); if(!is_array($param)) $param = array(); if(!isset($param['parent'])) $param['parent'] =& $this->_Parent; ##Create the object self::$_pool[$name] = new $classname($param); } return self::$_pool[$name]; } ## Return object instance of a named extension function getInstance($name){ $extensions = $this->_pool; foreach($extensions as $e){ if (get_class($e) == $name) return $e; } } function __requiresUpdate($info){ if($info['status'] == EXTENSION_NOT_INSTALLED) return false; if(($version = $this->fetchInstalledVersion($info['handle'])) && $version < floatval($info['version'])) return $version; return false; } function __requiresInstallation($name){ $id = $this->_Parent->Database->fetchVar('id', 0, "SELECT `id` FROM `tbl_extensions` WHERE `name` = '$name' LIMIT 1"); return (is_numeric($id) ? false : true); } function fetchInstalledVersion($name){ $version = $this->_Parent->Database->fetchVar('version', 0, "SELECT `version` FROM `tbl_extensions` WHERE `name` = '$name' LIMIT 1"); return ($version ? floatval($version) : NULL); } function fetchExtensionID($name){ return $this->_Parent->Database->fetchVar('id', 0, "SELECT `id` FROM `tbl_extensions` WHERE `name` = '$name' LIMIT 1"); } function fetchCustomMenu($name){ $classname = $this->__getClassName($name); if(!class_exists($classname)){ $path = $this->__getDriverPath($name); if(!@file_exists($path)) return false; require_once($path); } return @call_user_func(array(&$classname, 'fetchCustomMenu')); } ## Returns the about details of a service function about($name){ $classname = $this->__getClassName($name); $path = $this->__getDriverPath($name); if(!@file_exists($path)) return false; require_once($path); if($about = @call_user_func(array(&$classname, "about"))){ $about['handle'] = $name; $about['status'] = $this->fetchStatus($name); if($about['status'] == EXTENSION_ENABLED) Lang::add($this->__getClassPath($name) . '/lang/lang.%s.php', __LANG__); $nav = @call_user_func(array(&$classname, 'fetchNavigation')); if($nav != NULL) $about['navigation'] = $nav; if($this->__requiresUpdate($about)) $about['status'] = EXTENSION_REQUIRES_UPDATE; return $about; } return false; } function __cleanupDatabase(){ ## Grab any extensions sitting in the database $rows = $this->_Parent->Database->fetch("SELECT * FROM `tbl_extensions`"); ## Iterate over each row if(is_array($rows) && !empty($rows)){ foreach($rows as $r){ $name = $r['name']; ## Grab the install location $path = $this->__getClassPath($name); ## If it doesnt exist, remove the DB rows if(!@is_dir($path)){ if($existing_id = $this->fetchExtensionID($name)) $this->_Parent->Database->query("DELETE FROM `tbl_extensions_delegates` WHERE `tbl_extensions_delegates`.extension_id = $existing_id"); $this->_Parent->Database->query("DELETE FROM `tbl_extensions` WHERE `name` = '$name' LIMIT 1"); } } } ## Remove old delegate information $disabled = $this->_Parent->Database->fetchCol('id', "SELECT `id` FROM `tbl_extensions` WHERE `status` = 'disabled'"); $sql = "DELETE FROM `tbl_extensions_delegates` WHERE `extension_id` IN ('".@implode("', '", $disabled)."')"; $this->_Parent->Database->query($sql); } }
{ "content_hash": "565c52f33251f71e1c3beff5ef120ce8", "timestamp": "", "source": "github", "line_count": 366, "max_line_length": 169, "avg_line_length": 31.653005464480874, "alnum_prop": 0.5603798014674147, "repo_name": "bauhouse/sym-fluid960gs", "id": "0d41d1fb5e5d8c5cede291b28e5b37856a556060", "size": "11585", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "symphony/lib/toolkit/class.extensionmanager.php", "mode": "33261", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "408975" }, { "name": "PHP", "bytes": "857929" } ], "symlink_target": "" }
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('hoist-non-inferno-statics'), require('inferno'), require('redux')) : typeof define === 'function' && define.amd ? define(['exports', 'hoist-non-inferno-statics', 'inferno', 'redux'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Inferno = global.Inferno || {}, global.Inferno.Redux = global.Inferno.Redux || {}), global.hoistNonReactStatics, global.Inferno, global.redux)); })(this, (function (exports, hoistNonReactStatics, inferno, redux) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var hoistNonReactStatics__default = /*#__PURE__*/_interopDefaultLegacy(hoistNonReactStatics); var CLEARED = null; // tslint:disable-next-line:no-empty var nullSubscriptionHandler = function () { }; var nullListenerCollection = { // tslint:disable-next-line:no-empty clear: function () { }, // tslint:disable-next-line:no-empty notify: function () { }, subscribe: function (_) { return nullSubscriptionHandler; } }; var createListenerCollection = function () { // the current/next pattern is copied from redux's createStore code. var current = []; var next = []; return { clear: function () { next = CLEARED; current = CLEARED; }, notify: function () { var listeners = (current = next); for (var i = 0; i < listeners.length; ++i) { listeners[i](); } }, subscribe: function (listener) { var isSubscribed = true; if (next === current) { next = current.slice(); } next.push(listener); return function () { if (!isSubscribed || current === null) { return; } isSubscribed = false; if (next === current) { next = current.slice(); } next.splice(next.indexOf(listener), 1); }; } }; }; var Subscription = function Subscription(store, parentSub, onStateChange) { this.store = store; this.parentSub = parentSub; this.onStateChange = onStateChange; this.unsubscribe = null; this.listeners = nullListenerCollection; }; Subscription.prototype.addNestedSub = function addNestedSub (listener) { this.trySubscribe(); return this.listeners.subscribe(listener); }; Subscription.prototype.notifyNestedSubs = function notifyNestedSubs () { this.listeners.notify(); }; Subscription.prototype.isSubscribed = function isSubscribed () { return Boolean(this.unsubscribe); }; Subscription.prototype.trySubscribe = function trySubscribe () { if (!this.unsubscribe) { this.unsubscribe = this.parentSub ? this.parentSub.addNestedSub(this.onStateChange) : this.store.subscribe(this.onStateChange); this.listeners = createListenerCollection(); } }; Subscription.prototype.tryUnsubscribe = function tryUnsubscribe () { if (this.unsubscribe) { this.unsubscribe(); this.unsubscribe = null; this.listeners.clear(); this.listeners = nullListenerCollection; } }; function combineFrom(first, second) { var out = {}; if (first) { for (var key in first) { out[key] = first[key]; } } if (second) { for (var key$1 in second) { out[key$1] = second[key$1]; } } return out; } function objectWithoutProperties$2 (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; } var hotReloadingVersion = 0; var dummyState = {}; // tslint:disable-next-line:no-empty var noop = function () { }; var makeSelectorStateful = function (sourceSelector, store) { // wrap the selector in an object that tracks its results between runs. var selector = { error: null, props: {}, run: function runComponentSelector(props) { try { var nextProps = sourceSelector(store.getState(), props); if (nextProps !== selector.props || selector.error) { selector.shouldComponentUpdate = true; selector.props = nextProps; selector.error = null; } } catch (e) { selector.shouldComponentUpdate = true; selector.error = e; } }, shouldComponentUpdate: false }; return selector; }; // TODO: Move var invariant = function (test, error) { if (!test) { throw new Error(error); } }; function getDefaultName(name) { return ("ConnectAdvanced(" + name + ")"); } function connectAdvanced(selectorFactory, ref) { var getDisplayName = ref.getDisplayName; if ( getDisplayName === void 0 ) getDisplayName = getDefaultName; var methodName = ref.methodName; if ( methodName === void 0 ) methodName = 'connectAdvanced'; var renderCountProp = ref.renderCountProp; if ( renderCountProp === void 0 ) renderCountProp = null; var shouldHandleStateChanges = ref.shouldHandleStateChanges; if ( shouldHandleStateChanges === void 0 ) shouldHandleStateChanges = true; var storeKey = ref.storeKey; if ( storeKey === void 0 ) storeKey = 'store'; var withRef = ref.withRef; if ( withRef === void 0 ) withRef = false; var rest = objectWithoutProperties$2( ref, ["getDisplayName", "methodName", "renderCountProp", "shouldHandleStateChanges", "storeKey", "withRef"] ); var connectOptions = rest; var subscriptionKey = storeKey + 'Subscription'; var version = hotReloadingVersion++; var wrapWithConnect = function (WrappedComponent) { invariant(typeof WrappedComponent === 'function', "You must pass a component to the function returned by " + "connect. Instead received " + WrappedComponent); var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; var displayName = getDisplayName(wrappedComponentName); var selectorFactoryOptions = combineFrom(connectOptions, { WrappedComponent: WrappedComponent, displayName: displayName, getDisplayName: getDisplayName, methodName: methodName, renderCountProp: renderCountProp, shouldHandleStateChanges: shouldHandleStateChanges, storeKey: storeKey, withRef: withRef, wrappedComponentName: wrappedComponentName }); var Connect = /*@__PURE__*/(function (Component) { function Connect(props, context) { Component.call(this, props, context); this.version = version; this.state = {}; this.renderCount = 0; this.store = this.props[storeKey] || this.context[storeKey]; this.propsMode = Boolean(props[storeKey]); this.setWrappedInstance = this.setWrappedInstance.bind(this); invariant(!!this.store, "Could not find \"" + storeKey + "\" in either the context or " + "props of \"" + displayName + "\". " + "Either wrap the root component in a <Provider>, " + "or explicitly pass \"" + storeKey + "\" as a prop to \"" + displayName + "\"."); this.initSelector(); this.initSubscription(); } if ( Component ) Connect.__proto__ = Component; Connect.prototype = Object.create( Component && Component.prototype ); Connect.prototype.constructor = Connect; Connect.prototype.getChildContext = function getChildContext () { var obj; // If this component received store from props, its subscription should be transparent // to any descendants receiving store+subscription from context; it passes along // subscription passed to it. Otherwise, it shadows the parent subscription, which allows // Connect to control ordering of notifications to flow top-down. var subscription = this.propsMode ? null : this.subscription; return ( obj = {}, obj[subscriptionKey] = subscription || this.context[subscriptionKey], obj ); }; Connect.prototype.componentWillMount = function componentWillMount () { if (!shouldHandleStateChanges || this.$SSR) { return; } this.subscription.trySubscribe(); this.selector.run(this.props); }; Connect.prototype.componentWillReceiveProps = function componentWillReceiveProps (nextProps) { this.selector.run(nextProps); }; Connect.prototype.shouldComponentUpdate = function shouldComponentUpdate () { return this.selector.shouldComponentUpdate; }; Connect.prototype.componentWillUnmount = function componentWillUnmount () { if (this.subscription) { this.subscription.tryUnsubscribe(); } // these are just to guard against extra memory leakage if a parent element doesn't // dereference this instance properly, such as an async callback that never finishes this.subscription = null; this.notifyNestedSubs = noop; this.store = null; this.selector.run = noop; this.selector.shouldComponentUpdate = false; }; Connect.prototype.getWrappedInstance = function getWrappedInstance () { invariant(withRef, "To access the wrapped instance, you need to specify " + "{ withRef: true } in the options argument of the " + methodName + "() call."); return this.wrappedInstance; }; Connect.prototype.setWrappedInstance = function setWrappedInstance (ref) { this.wrappedInstance = ref; }; Connect.prototype.initSelector = function initSelector () { var sourceSelector = selectorFactory(this.store.dispatch, selectorFactoryOptions); this.selector = makeSelectorStateful(sourceSelector, this.store); this.selector.run(this.props); }; Connect.prototype.initSubscription = function initSubscription () { if (!shouldHandleStateChanges) { return; } // parentSub's source should match where store came from: props vs. context. A component // connected to the store via props shouldn't use subscription from context, or vice versa. var parentSub = (this.propsMode ? this.props : this.context)[subscriptionKey]; this.subscription = new Subscription(this.store, parentSub, this.onStateChange.bind(this)); // `notifyNestedSubs` is duplicated to handle the case where the component is unmounted in // the middle of the notification loop, where `this.subscription` will then be null. An // extra null check every change can be avoided by copying the method onto `this` and then // replacing it with a no-op on unmount. This can probably be avoided if Subscription's // listeners logic is changed to not call listeners that have been unsubscribed in the // middle of the notification loop. this.notifyNestedSubs = this.subscription.notifyNestedSubs.bind(this.subscription); }; Connect.prototype.onStateChange = function onStateChange () { this.selector.run(this.props); if (!this.selector.shouldComponentUpdate) { this.notifyNestedSubs(); } else { this.componentDidUpdate = this.notifyNestedSubsOnComponentDidUpdate; this.setState(dummyState); } }; Connect.prototype.notifyNestedSubsOnComponentDidUpdate = function notifyNestedSubsOnComponentDidUpdate () { // `componentDidUpdate` is conditionally implemented when `onStateChange` determines it // needs to notify nested subs. Once called, it unimplements itself until further state // changes occur. Doing it this way vs having a permanent `componentDidMount` that does // a boolean check every time avoids an extra method call most of the time, resulting // in some perf boost. this.componentDidUpdate = undefined; this.notifyNestedSubs(); }; Connect.prototype.isSubscribed = function isSubscribed () { return Boolean(this.subscription && this.subscription.isSubscribed()); }; Connect.prototype.addExtraProps = function addExtraProps (props) { if (!renderCountProp) { return props; } // make a shallow copy so that fields added don't leak to the original selector. // this is especially important for 'ref' since that's a reference back to the component // instance. a singleton memoized selector would then be holding a reference to the // instance, preventing the instance from being garbage collected, and that would be bad var withExtras = combineFrom(props, null); if (renderCountProp) { withExtras[renderCountProp] = this.renderCount++; } if (this.propsMode && this.subscription) { withExtras[subscriptionKey] = this.subscription; } return withExtras; }; Connect.prototype.render = function render () { var selector = this.selector; selector.shouldComponentUpdate = false; if (selector.error) { throw selector.error; } else { return inferno.normalizeProps(inferno.createComponentVNode(2 /* VNodeFlags.ComponentUnknown */, WrappedComponent, this.addExtraProps(selector.props), null, withRef ? this.setWrappedInstance : null)); } }; return Connect; }(inferno.Component)); Connect.displayName = displayName; Connect.WrappedComponent = WrappedComponent; { Connect.prototype.componentWillUpdate = function componentWillUpdate() { if (this.version !== version) { // We are hot reloading! this.version = version; this.initSelector(); if (this.subscription) { this.subscription.tryUnsubscribe(); } this.initSubscription(); if (shouldHandleStateChanges) { this.subscription.trySubscribe(); } } }; } return hoistNonReactStatics__default["default"](Connect, WrappedComponent); }; return wrapWithConnect; } var warning = function (message) { // tslint:disable-next-line:no-console if (typeof console !== 'undefined' && typeof console.error === 'function') { // tslint:disable-next-line:no-console console.error(message); } try { // This error was thrown as a convenience so that if you enable // "break on all exceptions" in your console, // it would pause the execution at this line. throw new Error(message); // tslint:disable-next-line:no-empty } catch (e) { } }; var didWarnAboutReceivingStore = false; var warnAboutReceivingStore = function () { if (didWarnAboutReceivingStore) { return; } didWarnAboutReceivingStore = true; warning('<Provider> does not support changing `store` on the fly.'); }; var Provider = /*@__PURE__*/(function (Component) { function Provider(props, context) { Component.call(this, props, context); this.store = props.store; } if ( Component ) Provider.__proto__ = Component; Provider.prototype = Object.create( Component && Component.prototype ); Provider.prototype.constructor = Provider; Provider.prototype.getChildContext = function getChildContext () { return { store: this.store, storeSubscription: null }; }; // Don't infer the return type. It may be expanded and cause reference errors // in the output. Provider.prototype.render = function render () { return this.props.children; }; return Provider; }(inferno.Component)); Provider.displayName = 'Provider'; { Provider.prototype.componentWillReceiveProps = function componentWillReceiveProps(nextProps) { var ref = this; var store = ref.store; var nextStore = nextProps.store; if (store !== nextStore) { warnAboutReceivingStore(); } }; } var hasOwn = Object.prototype.hasOwnProperty; var shallowEqual = function (a, b) { if (a === b) { return true; } var countA = 0; var countB = 0; for (var key in a) { if (hasOwn.call(a, key) && a[key] !== b[key]) { return false; } countA++; } for (var key$1 in b) { if (hasOwn.call(b, key$1)) { countB++; } } return countA === countB; }; function isPlainObject(value) { if (typeof value !== 'object' || value + '' !== '[object Object]') { return false; } if (Object.getPrototypeOf(value) === null) { return true; } var proto = value; while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); } return Object.getPrototypeOf(value) === proto; } var verifyPlainObject = function (value, displayName, methodName) { if (!isPlainObject(value)) { warning((methodName + "() in " + displayName + " must return a plain object. Instead received " + value + ".")); } }; // TODO: Type var wrapMapToPropsConstant = function (getConstant) { return function (dispatch, options) { var constant = getConstant(dispatch, options); var constantSelector = function () { return constant; }; constantSelector.dependsOnOwnProps = false; return constantSelector; }; }; // dependsOnOwnProps is used by createMapToPropsProxy to determine whether to pass props as args // to the mapToProps function being wrapped. It is also used by makePurePropsSelector to determine // whether mapToProps needs to be invoked when props have changed. // // A length of one signals that mapToProps does not depend on props from the parent component. // A length of zero is assumed to mean mapToProps is getting args via arguments or ...args and // therefore not reporting its length accurately.. var getDependsOnOwnProps = function (mapToProps) { return mapToProps.dependsOnOwnProps !== null && mapToProps.dependsOnOwnProps !== undefined ? !!mapToProps.dependsOnOwnProps : mapToProps.length !== 1; }; // Used by whenMapStateToPropsIsFunction and whenMapDispatchToPropsIsFunction, // this function wraps mapToProps in a proxy function which does several things: // // * Detects whether the mapToProps function being called depends on props, which // is used by selectorFactory to decide if it should reinvoke on props changes. // // * On first call, handles mapToProps if returns another function, and treats that // new function as the true mapToProps for subsequent calls. // // * On first call, verifies the first result is a plain object, in order to warn // the developer that their mapToProps function is not returning a valid result. // var wrapMapToPropsFunc = function (mapToProps, methodName) { return function (_dispatch, ref) { var displayName = ref.displayName; var proxy = function (stateOrDispatch, ownProps) { return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch); }; proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps); proxy.mapToProps = function (stateOrDispatch, ownProps) { proxy.mapToProps = mapToProps; var props = proxy(stateOrDispatch, ownProps); if (typeof props === 'function') { proxy.mapToProps = props; proxy.dependsOnOwnProps = getDependsOnOwnProps(props); props = proxy(stateOrDispatch, ownProps); } { verifyPlainObject(props, displayName, methodName); } return props; }; return proxy; }; }; var whenMapDispatchToPropsIsFunction = function (mapDispatchToProps) { return typeof mapDispatchToProps === 'function' ? wrapMapToPropsFunc(mapDispatchToProps, 'mapDispatchToProps') : undefined; }; var whenMapDispatchToPropsIsMissing = function (mapDispatchToProps) { return (!mapDispatchToProps ? wrapMapToPropsConstant(function (dispatch) { return ({ dispatch: dispatch }); }) : undefined); }; var whenMapDispatchToPropsIsObject = function (mapDispatchToProps) { return mapDispatchToProps && typeof mapDispatchToProps === 'object' ? wrapMapToPropsConstant(function (dispatch) { return redux.bindActionCreators(mapDispatchToProps, dispatch); }) : undefined; }; var defaultMapDispatchToPropsFactories = [whenMapDispatchToPropsIsFunction, whenMapDispatchToPropsIsMissing, whenMapDispatchToPropsIsObject]; var whenMapStateToPropsIsFunction = function (mapStateToProps) { return typeof mapStateToProps === 'function' ? wrapMapToPropsFunc(mapStateToProps, 'mapStateToProps') : undefined; }; var whenMapStateToPropsIsMissing = function (mapStateToProps) { return (!mapStateToProps ? wrapMapToPropsConstant(function () { return ({}); }) : undefined); }; var defaultMapStateToPropsFactories = [whenMapStateToPropsIsFunction, whenMapStateToPropsIsMissing]; var defaultMergeProps = function (stateProps, dispatchProps, ownProps) { var merged = combineFrom(ownProps, stateProps); if (dispatchProps) { for (var key in dispatchProps) { merged[key] = dispatchProps[key]; } } return merged; }; var wrapMergePropsFunc = function (mergeProps) { return function (_dispatch, ref) { var displayName = ref.displayName; var pure = ref.pure; var areMergedPropsEqual = ref.areMergedPropsEqual; var hasRunOnce = false; var mergedProps; return function (stateProps, dispatchProps, ownProps) { var nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps); if (hasRunOnce) { if (!pure || !areMergedPropsEqual(nextMergedProps, mergedProps)) { mergedProps = nextMergedProps; } } else { hasRunOnce = true; mergedProps = nextMergedProps; { verifyPlainObject(mergedProps, displayName, 'mergeProps'); } } return mergedProps; }; }; }; var whenMergePropsIsFunction = function (mergeProps) { return (typeof mergeProps === 'function' ? wrapMergePropsFunc(mergeProps) : undefined); }; var whenMergePropsIsOmitted = function (mergeProps) { return (!mergeProps ? function () { return defaultMergeProps; } : undefined); }; var defaultMergePropsFactories = [whenMergePropsIsFunction, whenMergePropsIsOmitted]; var verify = function (selector, methodName, displayName) { if (!selector) { throw new Error(("Unexpected value for " + methodName + " in " + displayName + ".")); } if (methodName === 'mapStateToProps' || methodName === 'mapDispatchToProps') { if (!selector.hasOwnProperty('dependsOnOwnProps')) { warning(("The selector for " + methodName + " of " + displayName + " did not specify a value for dependsOnOwnProps.")); } } }; var verifySubselectors = function (mapStateToProps, mapDispatchToProps, mergeProps, displayName) { verify(mapStateToProps, 'mapStateToProps', displayName); verify(mapDispatchToProps, 'mapDispatchToProps', displayName); verify(mergeProps, 'mergeProps', displayName); }; function objectWithoutProperties$1 (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; } var impureFinalPropsSelectorFactory = function (mapStateToProps, mapDispatchToProps, mergeProps, dispatch) { return function (state, ownProps) { return mergeProps(mapStateToProps(state, ownProps), mapDispatchToProps(dispatch, ownProps), ownProps); }; }; var pureFinalPropsSelectorFactory = function (mapStateToProps, mapDispatchToProps, mergeProps, dispatch, ref) { var areStatesEqual = ref.areStatesEqual; var areOwnPropsEqual = ref.areOwnPropsEqual; var areStatePropsEqual = ref.areStatePropsEqual; var hasRunAtLeastOnce = false; var state; var ownProps; var stateProps; var dispatchProps; var mergedProps; var handleFirstCall = function (firstState, firstOwnProps) { state = firstState; ownProps = firstOwnProps; stateProps = mapStateToProps(state, ownProps); dispatchProps = mapDispatchToProps(dispatch, ownProps); mergedProps = mergeProps(stateProps, dispatchProps, ownProps); hasRunAtLeastOnce = true; return mergedProps; }; var handleNewPropsAndNewState = function () { stateProps = mapStateToProps(state, ownProps); if (mapDispatchToProps.dependsOnOwnProps) { dispatchProps = mapDispatchToProps(dispatch, ownProps); } mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; }; var handleNewProps = function () { if (mapStateToProps.dependsOnOwnProps) { stateProps = mapStateToProps(state, ownProps); } if (mapDispatchToProps.dependsOnOwnProps) { dispatchProps = mapDispatchToProps(dispatch, ownProps); } mergedProps = mergeProps(stateProps, dispatchProps, ownProps); return mergedProps; }; var handleNewState = function () { var nextStateProps = mapStateToProps(state, ownProps); var statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps); stateProps = nextStateProps; if (statePropsChanged) { mergedProps = mergeProps(stateProps, dispatchProps, ownProps); } return mergedProps; }; var handleSubsequentCalls = function (nextState, nextOwnProps) { var propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps); var stateChanged = !areStatesEqual(nextState, state); state = nextState; ownProps = nextOwnProps; if (propsChanged && stateChanged) { return handleNewPropsAndNewState(); } if (propsChanged) { return handleNewProps(); } if (stateChanged) { return handleNewState(); } return mergedProps; }; var pureFinalPropsSelector = function (nextState, nextOwnProps) { return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps); }; return pureFinalPropsSelector; }; // If pure is true, the selector returned by selectorFactory will memoize its results, // allowing connectAdvanced's shouldComponentUpdate to return false if final // props have not changed. If false, the selector will always return a new // object and shouldComponentUpdate will always return true. var defaultSelectorFactory = function (dispatch, ref) { var initMapStateToProps = ref.initMapStateToProps; var initMapDispatchToProps = ref.initMapDispatchToProps; var initMergeProps = ref.initMergeProps; var rest = objectWithoutProperties$1( ref, ["initMapStateToProps", "initMapDispatchToProps", "initMergeProps"] ); var opts = rest; var options = opts; // trick typescript var mapStateToProps = initMapStateToProps(dispatch, options); var mapDispatchToProps = initMapDispatchToProps(dispatch, options); var mergeProps = initMergeProps(dispatch, options); { verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps, options.displayName); } var selectorFactory = options.pure ? pureFinalPropsSelectorFactory : impureFinalPropsSelectorFactory; return selectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options); }; function objectWithoutProperties (obj, exclude) { var target = {}; for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k) && exclude.indexOf(k) === -1) target[k] = obj[k]; return target; } var match = function (arg, factories, name) { for (var i = factories.length - 1; i >= 0; i--) { var result = factories[i](arg); if (result) { return result; } } return function (_dispatch, options) { throw new Error(("Invalid value of type " + (typeof arg) + " for " + name + " argument when connecting component " + (options.wrappedComponentName) + ".")); }; }; var strictEqual = function (a, b) { return a === b; }; // createConnect with default args builds the 'official' connect behavior. Calling it with // different options opens up some testing and extensibility scenarios var createConnect = function (ref) { if ( ref === void 0 ) ref = {}; var connectHOC = ref.connectHOC; if ( connectHOC === void 0 ) connectHOC = connectAdvanced; var mapStateToPropsFactories = ref.mapStateToPropsFactories; if ( mapStateToPropsFactories === void 0 ) mapStateToPropsFactories = defaultMapStateToPropsFactories; var mapDispatchToPropsFactories = ref.mapDispatchToPropsFactories; if ( mapDispatchToPropsFactories === void 0 ) mapDispatchToPropsFactories = defaultMapDispatchToPropsFactories; var mergePropsFactories = ref.mergePropsFactories; if ( mergePropsFactories === void 0 ) mergePropsFactories = defaultMergePropsFactories; var selectorFactory = ref.selectorFactory; if ( selectorFactory === void 0 ) selectorFactory = defaultSelectorFactory; return function (mapStateToProps, mapDispatchToProps, mergeProps, ref) { if ( ref === void 0 ) ref = {}; var pure = ref.pure; if ( pure === void 0 ) pure = true; var areStatesEqual = ref.areStatesEqual; if ( areStatesEqual === void 0 ) areStatesEqual = strictEqual; var areOwnPropsEqual = ref.areOwnPropsEqual; if ( areOwnPropsEqual === void 0 ) areOwnPropsEqual = shallowEqual; var areStatePropsEqual = ref.areStatePropsEqual; if ( areStatePropsEqual === void 0 ) areStatePropsEqual = shallowEqual; var areMergedPropsEqual = ref.areMergedPropsEqual; if ( areMergedPropsEqual === void 0 ) areMergedPropsEqual = shallowEqual; var rest = objectWithoutProperties( ref, ["pure", "areStatesEqual", "areOwnPropsEqual", "areStatePropsEqual", "areMergedPropsEqual"] ); var extraOptions = rest; var initMapStateToProps = match(mapStateToProps, mapStateToPropsFactories, 'mapStateToProps'); var initMapDispatchToProps = match(mapDispatchToProps, mapDispatchToPropsFactories, 'mapDispatchToProps'); var initMergeProps = match(mergeProps, mergePropsFactories, 'mergeProps'); return connectHOC(selectorFactory, combineFrom({ // used in error messages methodName: 'connect', // used to compute Connect's displayName from the wrapped component's displayName. // tslint:disable-next-line:object-literal-sort-keys getDisplayName: function (name) { return ("Connect(" + name + ")"); }, // if mapStateToProps is falsy, the Connect component doesn't subscribe to store state changes shouldHandleStateChanges: !!mapStateToProps, // passed through to selectorFactory areMergedPropsEqual: areMergedPropsEqual, areOwnPropsEqual: areOwnPropsEqual, areStatePropsEqual: areStatePropsEqual, areStatesEqual: areStatesEqual, initMapDispatchToProps: initMapDispatchToProps, initMapStateToProps: initMapStateToProps, initMergeProps: initMergeProps, pure: pure }, extraOptions /* any extra options args can override defaults of connect or connectAdvanced */)); }; }; var connect = createConnect(); function wrapActionCreators(actionCreators) { return function (dispatch) { return redux.bindActionCreators(actionCreators, dispatch); }; } exports.Provider = Provider; exports.connect = connect; exports.connectAdvanced = connectAdvanced; exports.wrapActionCreators = wrapActionCreators; Object.defineProperty(exports, '__esModule', { value: true }); }));
{ "content_hash": "2e451e98e7090a2c02d7c01924220c04", "timestamp": "", "source": "github", "line_count": 703, "max_line_length": 239, "avg_line_length": 51.09103840682788, "alnum_prop": 0.5967647632040538, "repo_name": "cdnjs/cdnjs", "id": "5102ffbe393b057ea6c1323d4fd28e77e7199583", "size": "35917", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "ajax/libs/inferno-redux/8.0.2/inferno-redux.js", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
/** *Copyright [2009-2010] [dennis zhuang(killme2008@gmail.com)] *Licensed under the Apache License, Version 2.0 (the "License"); *you may not use this file except in compliance with the License. *You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 *Unless required by applicable law or agreed to in writing, *software distributed under the License is distributed on an "AS IS" BASIS, *WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, *either express or implied. See the License for the specific language governing permissions and limitations under the License */ package com.google.code.hs4j.network.core.impl; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; import com.google.code.hs4j.network.buffer.IoBuffer; import com.google.code.hs4j.network.core.CodecFactory; import com.google.code.hs4j.network.core.Session; import com.google.code.hs4j.network.util.ByteBufferMatcher; import com.google.code.hs4j.network.util.ShiftAndByteBufferMatcher; /** * Text line codec factory * @author dennis * */ public class TextLineCodecFactory implements CodecFactory { public static final IoBuffer SPLIT = IoBuffer.wrap("\r\n".getBytes()); private static final ByteBufferMatcher SPLIT_PATTERN = new ShiftAndByteBufferMatcher(SPLIT); public static final String DEFAULT_CHARSET_NAME = "utf-8"; private Charset charset; public TextLineCodecFactory() { this.charset = Charset.forName(DEFAULT_CHARSET_NAME); } public TextLineCodecFactory(String charsetName) { this.charset = Charset.forName(charsetName); } class StringDecoder implements Decoder { public Object decode(IoBuffer buffer, Session session) { String result = null; int index = SPLIT_PATTERN.matchFirst(buffer); if (index >= 0) { int limit = buffer.limit(); buffer.limit(index); CharBuffer charBuffer = TextLineCodecFactory.this.charset.decode(buffer.buf()); result = charBuffer.toString(); buffer.limit(limit); buffer.position(index + SPLIT.remaining()); } return result; } } private Decoder decoder = new StringDecoder(); public Decoder getDecoder() { return this.decoder; } class StringEncoder implements Encoder { public IoBuffer encode(Object msg, Session session) { if (msg == null) { return null; } String message = (String) msg; ByteBuffer buff = TextLineCodecFactory.this.charset.encode(message); IoBuffer resultBuffer = IoBuffer.allocate(buff.remaining() + SPLIT.remaining()); resultBuffer.put(buff); resultBuffer.put(SPLIT.slice()); resultBuffer.flip(); return resultBuffer; } } private Encoder encoder = new StringEncoder(); public Encoder getEncoder() { return this.encoder; } }
{ "content_hash": "2ea78c16eed64f769d1f3779ad153b1f", "timestamp": "", "source": "github", "line_count": 100, "max_line_length": 126, "avg_line_length": 31.76, "alnum_prop": 0.6442065491183879, "repo_name": "killme2008/hs4j", "id": "d8d49bbdeabebe5f0bfe97d66c8a065e97928978", "size": "3807", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/main/java/com/google/code/hs4j/network/core/impl/TextLineCodecFactory.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "654893" } ], "symlink_target": "" }
package cmd import ( "github.com/spf13/cobra" "log" ) var exec = &cobra.Command{ Use: "exec", Short: "Executes bunch of commands", Long: `Executes bunch of commands`, Run: func(cmd *cobra.Command, args []string) { commands := make(map[string]struct{}, len(RootCommand.Commands())) for _, c := range RootCommand.Commands() { commands[c.Name()] = struct{}{} } for _, arg := range args { if _, ok := commands[arg]; ok { RootCommand.SetArgs([]string{arg}) _ = RootCommand.Execute() } else { log.Fatalf("No such command: %s", arg) } } }, }
{ "content_hash": "32e17c5b09b34882c6ec802e5c77b7bd", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 68, "avg_line_length": 20.137931034482758, "alnum_prop": 0.6061643835616438, "repo_name": "avarabyeu/releaser", "id": "7a3b29aea71f099d13781dc733ab380ac046489e", "size": "584", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "cmd/exec.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "20882" }, { "name": "Makefile", "bytes": "963" } ], "symlink_target": "" }
def foo(): return
{ "content_hash": "654ff048c99c42003de447473d81bee5", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 10, "avg_line_length": 11, "alnum_prop": 0.5454545454545454, "repo_name": "doboy/Underscore", "id": "a4a7def833c4da7503c1f61d81ec3c632f21efe1", "size": "22", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "examples/empty_return_statement.py", "mode": "33188", "license": "mit", "language": [ { "name": "Makefile", "bytes": "410" }, { "name": "Python", "bytes": "49556" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (version 1.7.0_07) on Tue Jun 04 15:59:36 CST 2019 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Shelf</title> <meta name="date" content="2019-06-04"> <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="Shelf"; } //--> </script> <noscript> <div>您的浏览器已禁用 JavaScript。</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="跳过导航链接"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../../../overview-summary.html">概览</a></li> <li><a href="package-summary.html">程序包</a></li> <li class="navBarCell1Rev">类</li> <li><a href="class-use/Shelf.html">使用</a></li> <li><a href="package-tree.html">树</a></li> <li><a href="../../../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/GroupsInfo.html" title="org.jeewx.api.wxstore.shelf.model中的类"><span class="strong">上一个类</span></a></li> <li><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/ShelfRInfo.html" title="org.jeewx.api.wxstore.shelf.model中的类"><span class="strong">下一个类</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/jeewx/api/wxstore/shelf/model/Shelf.html" target="_top">框架</a></li> <li><a href="Shelf.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>概要:&nbsp;</li> <li>嵌套&nbsp;|&nbsp;</li> <li>字段&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">构造器</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">方法</a></li> </ul> <ul class="subNavList"> <li>详细资料:&nbsp;</li> <li>字段&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">构造器</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">方法</a></li> </ul> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.jeewx.api.wxstore.shelf.model</div> <h2 title="类 Shelf" class="title">类 Shelf</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>org.jeewx.api.wxstore.shelf.model.Shelf</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="strong">Shelf</span> extends java.lang.Object</pre> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_summary"> <!-- --> </a> <h3>构造器概要</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="构造器概要表, 列表构造器和解释"> <caption><span>构造器</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">构造器和说明</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#Shelf()">Shelf</a></strong>()</code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>方法概要</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="方法概要表, 列表方法和解释"> <caption><span>方法</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">限定符和类型</th> <th class="colLast" scope="col">方法和说明</th> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.String</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#getShelf_banner()">getShelf_banner</a></strong>()</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>java.lang.Object</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#getShelf_data()">getShelf_data</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>java.lang.Integer</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#getShelf_id()">getShelf_id</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="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#getShelf_name()">getShelf_name</a></strong>()</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#setShelf_banner(java.lang.String)">setShelf_banner</a></strong>(java.lang.String&nbsp;shelf_banner)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#setShelf_data(java.lang.Object)">setShelf_data</a></strong>(java.lang.Object&nbsp;shelf_data)</code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#setShelf_id(java.lang.Integer)">setShelf_id</a></strong>(java.lang.Integer&nbsp;shelf_id)</code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/Shelf.html#setShelf_name(java.lang.String)">setShelf_name</a></strong>(java.lang.String&nbsp;shelf_name)</code>&nbsp;</td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>从类继承的方法&nbsp;java.lang.Object</h3> <code>equals, 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"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor_detail"> <!-- --> </a> <h3>构造器详细资料</h3> <a name="Shelf()"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>Shelf</h4> <pre>public&nbsp;Shelf()</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>方法详细资料</h3> <a name="getShelf_id()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getShelf_id</h4> <pre>public&nbsp;java.lang.Integer&nbsp;getShelf_id()</pre> </li> </ul> <a name="setShelf_id(java.lang.Integer)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setShelf_id</h4> <pre>public&nbsp;void&nbsp;setShelf_id(java.lang.Integer&nbsp;shelf_id)</pre> </li> </ul> <a name="getShelf_data()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getShelf_data</h4> <pre>public&nbsp;java.lang.Object&nbsp;getShelf_data()</pre> </li> </ul> <a name="setShelf_data(java.lang.Object)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setShelf_data</h4> <pre>public&nbsp;void&nbsp;setShelf_data(java.lang.Object&nbsp;shelf_data)</pre> </li> </ul> <a name="getShelf_banner()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getShelf_banner</h4> <pre>public&nbsp;java.lang.String&nbsp;getShelf_banner()</pre> </li> </ul> <a name="setShelf_banner(java.lang.String)"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setShelf_banner</h4> <pre>public&nbsp;void&nbsp;setShelf_banner(java.lang.String&nbsp;shelf_banner)</pre> </li> </ul> <a name="getShelf_name()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getShelf_name</h4> <pre>public&nbsp;java.lang.String&nbsp;getShelf_name()</pre> </li> </ul> <a name="setShelf_name(java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>setShelf_name</h4> <pre>public&nbsp;void&nbsp;setShelf_name(java.lang.String&nbsp;shelf_name)</pre> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="跳过导航链接"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../../../../../../overview-summary.html">概览</a></li> <li><a href="package-summary.html">程序包</a></li> <li class="navBarCell1Rev">类</li> <li><a href="class-use/Shelf.html">使用</a></li> <li><a href="package-tree.html">树</a></li> <li><a href="../../../../../../deprecated-list.html">已过时</a></li> <li><a href="../../../../../../index-files/index-1.html">索引</a></li> <li><a href="../../../../../../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/GroupsInfo.html" title="org.jeewx.api.wxstore.shelf.model中的类"><span class="strong">上一个类</span></a></li> <li><a href="../../../../../../org/jeewx/api/wxstore/shelf/model/ShelfRInfo.html" title="org.jeewx.api.wxstore.shelf.model中的类"><span class="strong">下一个类</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/jeewx/api/wxstore/shelf/model/Shelf.html" target="_top">框架</a></li> <li><a href="Shelf.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>概要:&nbsp;</li> <li>嵌套&nbsp;|&nbsp;</li> <li>字段&nbsp;|&nbsp;</li> <li><a href="#constructor_summary">构造器</a>&nbsp;|&nbsp;</li> <li><a href="#method_summary">方法</a></li> </ul> <ul class="subNavList"> <li>详细资料:&nbsp;</li> <li>字段&nbsp;|&nbsp;</li> <li><a href="#constructor_detail">构造器</a>&nbsp;|&nbsp;</li> <li><a href="#method_detail">方法</a></li> </ul> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{ "content_hash": "9c980b42c4def5f83221ffba02f95f6d", "timestamp": "", "source": "github", "line_count": 348, "max_line_length": 223, "avg_line_length": 32.4367816091954, "alnum_prop": 0.6141920623671155, "repo_name": "zhangdaiscott/jeewx-api", "id": "6f208da4f87c8709ae3d4b21cc8c9617a1f0f2a9", "size": "11736", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "doc/api/org/jeewx/api/wxstore/shelf/model/Shelf.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "HTML", "bytes": "8425" }, { "name": "Java", "bytes": "918683" } ], "symlink_target": "" }
try: import gdb except ImportError as e: raise ImportError("This script must be run in GDB: ", str(e)) import sys import os sys.path.append(os.getcwd()) import stl_containers import simple_class_obj SIZE_OF_INT = 4 SIZE_OF_BOOL = 1 SIZE_OF_INT64 = 8 SIZE_OF_UINT256 = 32 def get_special_type_obj(gobj): obj_type = gobj.type.strip_typedefs() if stl_containers.VectorObj.is_this_type(obj_type): return stl_containers.VectorObj(gobj) if stl_containers.ListObj.is_this_type(obj_type): return stl_containers.ListObj(gobj) if stl_containers.PairObj.is_this_type(obj_type): return stl_containers.PairObj(gobj) if stl_containers.MapObj.is_this_type(obj_type): return stl_containers.MapObj(gobj) if stl_containers.SetObj.is_this_type(obj_type): return stl_containers.SetObj(gobj) if simple_class_obj.SimpleClassObj.is_this_type(obj_type): return simple_class_obj.SimpleClassObj(gobj) return False def is_special_type(obj_type): if stl_containers.VectorObj.is_this_type(obj_type): return True if stl_containers.ListObj.is_this_type(obj_type): return True if stl_containers.PairObj.is_this_type(obj_type): return True if stl_containers.MapObj.is_this_type(obj_type): return True if stl_containers.SetObj.is_this_type(obj_type): return True if simple_class_obj.SimpleClassObj.is_this_type(obj_type): return True return False def get_instance_size(gobj): obj = get_special_type_obj(gobj) if not obj: return gobj.type.sizeof return obj.get_used_size()
{ "content_hash": "bbbce8e580b2f007b754fe90c47f2cbf", "timestamp": "", "source": "github", "line_count": 54, "max_line_length": 65, "avg_line_length": 30.166666666666668, "alnum_prop": 0.6899938612645795, "repo_name": "ivansib/sibcoin", "id": "7dcc6c021db60e95e5f0b8416a21ad3958676f90", "size": "1650", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "contrib/auto_gdb/common_helpers.py", "mode": "33188", "license": "mit", "language": [ { "name": "Assembly", "bytes": "28456" }, { "name": "C", "bytes": "4039577" }, { "name": "C++", "bytes": "6212205" }, { "name": "CMake", "bytes": "1881" }, { "name": "CSS", "bytes": "255014" }, { "name": "Dockerfile", "bytes": "237" }, { "name": "HTML", "bytes": "137533" }, { "name": "Java", "bytes": "30290" }, { "name": "M4", "bytes": "190865" }, { "name": "Makefile", "bytes": "112613" }, { "name": "Objective-C", "bytes": "3798" }, { "name": "Objective-C++", "bytes": "7230" }, { "name": "Python", "bytes": "1028306" }, { "name": "QMake", "bytes": "960" }, { "name": "Shell", "bytes": "49937" } ], "symlink_target": "" }
""" dotfiles ~~~~~~~~ Dotfiles is a tool to make managing your dotfile symlinks in $HOME easy, allowing you to keep all your dotfiles in a single directory. Hosting is up to you. You can use a VCS like git, Dropbox, or even rsync to distribute your dotfiles repository across multiple hosts. :copyright: (c) 2011-2014 by Jon Bernard. :license: ISC, see LICENSE.rst for more details. """ __version__ = '0.6.4'
{ "content_hash": "1f71d3ed003867d76c7df00e08e1aafa", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 79, "avg_line_length": 31.785714285714285, "alnum_prop": 0.6741573033707865, "repo_name": "jawilson/dotfiles", "id": "226c06e2586bf2f5ec1e16f28f1c84cfb7561c91", "size": "445", "binary": false, "copies": "5", "ref": "refs/heads/main", "path": "tools/dotfiles/dotfiles/__init__.py", "mode": "33188", "license": "mit", "language": [ { "name": "Dockerfile", "bytes": "3729" }, { "name": "Erlang", "bytes": "3232" }, { "name": "JavaScript", "bytes": "1064" }, { "name": "Makefile", "bytes": "686" }, { "name": "Python", "bytes": "417032" }, { "name": "Ruby", "bytes": "26905" }, { "name": "Shell", "bytes": "538313" }, { "name": "Vim script", "bytes": "1796488" } ], "symlink_target": "" }
package org.drools.modelcompiler.util.lambdareplace; public class NotLambdaException extends RuntimeException { }
{ "content_hash": "8b6311be9ee2059bb9526a89767ed02c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 58, "avg_line_length": 16.857142857142858, "alnum_prop": 0.8305084745762712, "repo_name": "jomarko/drools", "id": "d8ddf85e55c971663755d878e17dfa073d6080c5", "size": "741", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/util/lambdareplace/NotLambdaException.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ANTLR", "bytes": "16820" }, { "name": "ASL", "bytes": "9582" }, { "name": "Batchfile", "bytes": "2554" }, { "name": "CSS", "bytes": "1969" }, { "name": "GAP", "bytes": "198103" }, { "name": "HTML", "bytes": "8245" }, { "name": "Java", "bytes": "42823510" }, { "name": "Python", "bytes": "4555" }, { "name": "Ruby", "bytes": "491" }, { "name": "Shell", "bytes": "1120" }, { "name": "XSLT", "bytes": "24302" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_151) on Thu Mar 08 14:17:44 MST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Package org.wildfly.swarm.config.management.security_realm (BOM: * : All 2018.3.3 API)</title> <meta name="date" content="2018-03-08"> <link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Package org.wildfly.swarm.config.management.security_realm (BOM: * : All 2018.3.3 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.3.3</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/management/security_realm/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Uses of Package org.wildfly.swarm.config.management.security_realm" class="title">Uses of Package<br>org.wildfly.swarm.config.management.security_realm</h1> </div> <div class="contentContainer"> <ul class="blockList"> <li class="blockList"> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.management">org.wildfly.swarm.config.management</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.management.security_realm">org.wildfly.swarm.config.management.security_realm</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#org.wildfly.swarm.config.management.security_realm.authorization">org.wildfly.swarm.config.management.security_realm.authorization</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#org.wildfly.swarm.management">org.wildfly.swarm.management</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.management"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a> used by <a href="../../../../../../org/wildfly/swarm/config/management/package-summary.html">org.wildfly.swarm.config.management</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/JaasAuthentication.html#org.wildfly.swarm.config.management">JaasAuthentication</a> <div class="block">Configuration to use a JAAS LoginContext to authenticate the users.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/JaasAuthenticationConsumer.html#org.wildfly.swarm.config.management">JaasAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/JaasAuthenticationSupplier.html#org.wildfly.swarm.config.management">JaasAuthenticationSupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosAuthentication.html#org.wildfly.swarm.config.management">KerberosAuthentication</a> <div class="block">Configuration to use Kerberos to authenticate the users.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosAuthenticationConsumer.html#org.wildfly.swarm.config.management">KerberosAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosAuthenticationSupplier.html#org.wildfly.swarm.config.management">KerberosAuthenticationSupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosServerIdentity.html#org.wildfly.swarm.config.management">KerberosServerIdentity</a> <div class="block">Configuration for the Kerberos identity of a server or host controller.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosServerIdentityConsumer.html#org.wildfly.swarm.config.management">KerberosServerIdentityConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosServerIdentitySupplier.html#org.wildfly.swarm.config.management">KerberosServerIdentitySupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthentication.html#org.wildfly.swarm.config.management">LdapAuthentication</a> <div class="block">Configuration to use LDAP as the user repository.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthenticationConsumer.html#org.wildfly.swarm.config.management">LdapAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthenticationSupplier.html#org.wildfly.swarm.config.management">LdapAuthenticationSupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthorization.html#org.wildfly.swarm.config.management">LdapAuthorization</a> <div class="block">Configuration to use LDAP as the user repository.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthorizationConsumer.html#org.wildfly.swarm.config.management">LdapAuthorizationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthorizationSupplier.html#org.wildfly.swarm.config.management">LdapAuthorizationSupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LocalAuthentication.html#org.wildfly.swarm.config.management">LocalAuthentication</a> <div class="block">Configuration of the local authentication mechanism.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LocalAuthenticationConsumer.html#org.wildfly.swarm.config.management">LocalAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LocalAuthenticationSupplier.html#org.wildfly.swarm.config.management">LocalAuthenticationSupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugIn.html#org.wildfly.swarm.config.management">PlugIn</a> <div class="block">An extension to the security realm allowing additional authentication / authorization modules to be loaded.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthentication.html#org.wildfly.swarm.config.management">PlugInAuthentication</a> <div class="block">Configuration of a user store plug-in for use by the realm.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthenticationConsumer.html#org.wildfly.swarm.config.management">PlugInAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthenticationSupplier.html#org.wildfly.swarm.config.management">PlugInAuthenticationSupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthorization.html#org.wildfly.swarm.config.management">PlugInAuthorization</a> <div class="block">Configuration of a user store plug-in for use by the realm.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthorizationConsumer.html#org.wildfly.swarm.config.management">PlugInAuthorizationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthorizationSupplier.html#org.wildfly.swarm.config.management">PlugInAuthorizationSupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInConsumer.html#org.wildfly.swarm.config.management">PlugInConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInSupplier.html#org.wildfly.swarm.config.management">PlugInSupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthentication.html#org.wildfly.swarm.config.management">PropertiesAuthentication</a> <div class="block">Configuration to use a list users stored within a properties file as the user repository.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthenticationConsumer.html#org.wildfly.swarm.config.management">PropertiesAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthenticationSupplier.html#org.wildfly.swarm.config.management">PropertiesAuthenticationSupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthorization.html#org.wildfly.swarm.config.management">PropertiesAuthorization</a> <div class="block">Configuration to use properties file to load a users roles.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthorizationConsumer.html#org.wildfly.swarm.config.management">PropertiesAuthorizationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthorizationSupplier.html#org.wildfly.swarm.config.management">PropertiesAuthorizationSupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SecretServerIdentity.html#org.wildfly.swarm.config.management">SecretServerIdentity</a> <div class="block">Configuration of the secret/password-based identity of a server or host controller.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SecretServerIdentityConsumer.html#org.wildfly.swarm.config.management">SecretServerIdentityConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SecretServerIdentitySupplier.html#org.wildfly.swarm.config.management">SecretServerIdentitySupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SslServerIdentity.html#org.wildfly.swarm.config.management">SslServerIdentity</a> <div class="block">Configuration of the SSL identity of a server or host controller.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SslServerIdentityConsumer.html#org.wildfly.swarm.config.management">SslServerIdentityConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SslServerIdentitySupplier.html#org.wildfly.swarm.config.management">SslServerIdentitySupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthentication.html#org.wildfly.swarm.config.management">TruststoreAuthentication</a> <div class="block">Configuration of a keystore to use to create a trust manager to verify clients.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthenticationConsumer.html#org.wildfly.swarm.config.management">TruststoreAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthenticationSupplier.html#org.wildfly.swarm.config.management">TruststoreAuthenticationSupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/UsersAuthentication.html#org.wildfly.swarm.config.management">UsersAuthentication</a> <div class="block">Configuration to use a list users stored directly within the standalone.xml or host.xml configuration file as the user repository.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/UsersAuthenticationConsumer.html#org.wildfly.swarm.config.management">UsersAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/UsersAuthenticationSupplier.html#org.wildfly.swarm.config.management">UsersAuthenticationSupplier</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.management.security_realm"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a> used by <a href="../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/ByAccessTimeCache.html#org.wildfly.swarm.config.management.security_realm">ByAccessTimeCache</a> <div class="block">A cache to hold the results of previous LDAP interactions.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/ByAccessTimeCacheConsumer.html#org.wildfly.swarm.config.management.security_realm">ByAccessTimeCacheConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/ByAccessTimeCacheSupplier.html#org.wildfly.swarm.config.management.security_realm">ByAccessTimeCacheSupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/BySearchTimeCache.html#org.wildfly.swarm.config.management.security_realm">BySearchTimeCache</a> <div class="block">A cache to hold the results of previous LDAP interactions.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/BySearchTimeCacheConsumer.html#org.wildfly.swarm.config.management.security_realm">BySearchTimeCacheConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/BySearchTimeCacheSupplier.html#org.wildfly.swarm.config.management.security_realm">BySearchTimeCacheSupplier</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/JaasAuthentication.html#org.wildfly.swarm.config.management.security_realm">JaasAuthentication</a> <div class="block">Configuration to use a JAAS LoginContext to authenticate the users.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/JaasAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">JaasAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosAuthentication.html#org.wildfly.swarm.config.management.security_realm">KerberosAuthentication</a> <div class="block">Configuration to use Kerberos to authenticate the users.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">KerberosAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosServerIdentity.html#org.wildfly.swarm.config.management.security_realm">KerberosServerIdentity</a> <div class="block">Configuration for the Kerberos identity of a server or host controller.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosServerIdentity.KerberosServerIdentityResources.html#org.wildfly.swarm.config.management.security_realm">KerberosServerIdentity.KerberosServerIdentityResources</a> <div class="block">Child mutators for KerberosServerIdentity</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/KerberosServerIdentityConsumer.html#org.wildfly.swarm.config.management.security_realm">KerberosServerIdentityConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthentication.html#org.wildfly.swarm.config.management.security_realm">LdapAuthentication</a> <div class="block">Configuration to use LDAP as the user repository.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthentication.LdapAuthenticationResources.html#org.wildfly.swarm.config.management.security_realm">LdapAuthentication.LdapAuthenticationResources</a> <div class="block">Child mutators for LdapAuthentication</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">LdapAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthorization.html#org.wildfly.swarm.config.management.security_realm">LdapAuthorization</a> <div class="block">Configuration to use LDAP as the user repository.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthorization.LdapAuthorizationResources.html#org.wildfly.swarm.config.management.security_realm">LdapAuthorization.LdapAuthorizationResources</a> <div class="block">Child mutators for LdapAuthorization</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LdapAuthorizationConsumer.html#org.wildfly.swarm.config.management.security_realm">LdapAuthorizationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LocalAuthentication.html#org.wildfly.swarm.config.management.security_realm">LocalAuthentication</a> <div class="block">Configuration of the local authentication mechanism.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/LocalAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">LocalAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugIn.html#org.wildfly.swarm.config.management.security_realm">PlugIn</a> <div class="block">An extension to the security realm allowing additional authentication / authorization modules to be loaded.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthentication.html#org.wildfly.swarm.config.management.security_realm">PlugInAuthentication</a> <div class="block">Configuration of a user store plug-in for use by the realm.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthentication.Mechanism.html#org.wildfly.swarm.config.management.security_realm">PlugInAuthentication.Mechanism</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthentication.PlugInAuthenticationResources.html#org.wildfly.swarm.config.management.security_realm">PlugInAuthentication.PlugInAuthenticationResources</a> <div class="block">Child mutators for PlugInAuthentication</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">PlugInAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthorization.html#org.wildfly.swarm.config.management.security_realm">PlugInAuthorization</a> <div class="block">Configuration of a user store plug-in for use by the realm.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthorization.PlugInAuthorizationResources.html#org.wildfly.swarm.config.management.security_realm">PlugInAuthorization.PlugInAuthorizationResources</a> <div class="block">Child mutators for PlugInAuthorization</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthorizationConsumer.html#org.wildfly.swarm.config.management.security_realm">PlugInAuthorizationConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInConsumer.html#org.wildfly.swarm.config.management.security_realm">PlugInConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthentication.html#org.wildfly.swarm.config.management.security_realm">PropertiesAuthentication</a> <div class="block">Configuration to use a list users stored within a properties file as the user repository.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">PropertiesAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthorization.html#org.wildfly.swarm.config.management.security_realm">PropertiesAuthorization</a> <div class="block">Configuration to use properties file to load a users roles.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PropertiesAuthorizationConsumer.html#org.wildfly.swarm.config.management.security_realm">PropertiesAuthorizationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SecretServerIdentity.html#org.wildfly.swarm.config.management.security_realm">SecretServerIdentity</a> <div class="block">Configuration of the secret/password-based identity of a server or host controller.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SecretServerIdentityConsumer.html#org.wildfly.swarm.config.management.security_realm">SecretServerIdentityConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SslServerIdentity.html#org.wildfly.swarm.config.management.security_realm">SslServerIdentity</a> <div class="block">Configuration of the SSL identity of a server or host controller.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/SslServerIdentityConsumer.html#org.wildfly.swarm.config.management.security_realm">SslServerIdentityConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthentication.html#org.wildfly.swarm.config.management.security_realm">TruststoreAuthentication</a> <div class="block">Configuration of a keystore to use to create a trust manager to verify clients.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/TruststoreAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">TruststoreAuthenticationConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/UsersAuthentication.html#org.wildfly.swarm.config.management.security_realm">UsersAuthentication</a> <div class="block">Configuration to use a list users stored directly within the standalone.xml or host.xml configuration file as the user repository.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/UsersAuthentication.UsersAuthenticationResources.html#org.wildfly.swarm.config.management.security_realm">UsersAuthentication.UsersAuthenticationResources</a> <div class="block">Child mutators for UsersAuthentication</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/UsersAuthenticationConsumer.html#org.wildfly.swarm.config.management.security_realm">UsersAuthenticationConsumer</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.config.management.security_realm.authorization"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a> used by <a href="../../../../../../org/wildfly/swarm/config/management/security_realm/authorization/package-summary.html">org.wildfly.swarm.config.management.security_realm.authorization</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/ByAccessTimeCache.html#org.wildfly.swarm.config.management.security_realm.authorization">ByAccessTimeCache</a> <div class="block">A cache to hold the results of previous LDAP interactions.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/ByAccessTimeCacheConsumer.html#org.wildfly.swarm.config.management.security_realm.authorization">ByAccessTimeCacheConsumer</a>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/ByAccessTimeCacheSupplier.html#org.wildfly.swarm.config.management.security_realm.authorization">ByAccessTimeCacheSupplier</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/BySearchTimeCache.html#org.wildfly.swarm.config.management.security_realm.authorization">BySearchTimeCache</a> <div class="block">A cache to hold the results of previous LDAP interactions.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/BySearchTimeCacheConsumer.html#org.wildfly.swarm.config.management.security_realm.authorization">BySearchTimeCacheConsumer</a>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/BySearchTimeCacheSupplier.html#org.wildfly.swarm.config.management.security_realm.authorization">BySearchTimeCacheSupplier</a>&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"><a name="org.wildfly.swarm.management"> <!-- --> </a> <table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing classes, and an explanation"> <caption><span>Classes in <a href="../../../../../../org/wildfly/swarm/config/management/security_realm/package-summary.html">org.wildfly.swarm.config.management.security_realm</a> used by <a href="../../../../../../org/wildfly/swarm/management/package-summary.html">org.wildfly.swarm.management</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Class and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthentication.html#org.wildfly.swarm.management">PlugInAuthentication</a> <div class="block">Configuration of a user store plug-in for use by the realm.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><a href="../../../../../../org/wildfly/swarm/config/management/security_realm/class-use/PlugInAuthorization.html#org.wildfly.swarm.management">PlugInAuthorization</a> <div class="block">Configuration of a user store plug-in for use by the realm.</div> </td> </tr> </tbody> </table> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li>Class</li> <li class="navBarCell1Rev">Use</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../index-all.html">Index</a></li> <li><a href="../../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage">WildFly Swarm API, 2018.3.3</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../index.html?org/wildfly/swarm/config/management/security_realm/package-use.html" target="_top">Frames</a></li> <li><a href="package-use.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2018 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
{ "content_hash": "7246a3342e1bc76e9a08c08cb9a38295", "timestamp": "", "source": "github", "line_count": 588, "max_line_length": 422, "avg_line_length": 62.314625850340136, "alnum_prop": 0.7220326956142027, "repo_name": "wildfly-swarm/wildfly-swarm-javadocs", "id": "0c39a5a835f993a075586a944822b9eae3fc4a42", "size": "36641", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "2018.3.3/apidocs/org/wildfly/swarm/config/management/security_realm/package-use.html", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package org.oasis_open.docs.wsn.b_2; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import javax.xml.ws.wsaddressing.W3CEndpointReference; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle; import org.w3c.dom.Element; /** * <p>Java class for NotificationMessageHolderType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="NotificationMessageHolderType"&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;element ref="{http://docs.oasis-open.org/wsn/b-2}SubscriptionReference" minOccurs="0"/&gt; * &lt;element ref="{http://docs.oasis-open.org/wsn/b-2}Topic" minOccurs="0"/&gt; * &lt;element ref="{http://docs.oasis-open.org/wsn/b-2}ProducerReference" minOccurs="0"/&gt; * &lt;element name="Message"&gt; * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;any processContents='lax'/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * &lt;/element&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "NotificationMessageHolderType", propOrder = { "subscriptionReference", "topic", "producerReference", "message" }) public class NotificationMessageHolderType { @XmlElement(name = "SubscriptionReference") protected W3CEndpointReference subscriptionReference; @XmlElement(name = "Topic") protected TopicExpressionType topic; @XmlElement(name = "ProducerReference") protected W3CEndpointReference producerReference; @XmlElement(name = "Message", required = true) protected NotificationMessageHolderType.Message message; /** * Gets the value of the subscriptionReference property. * * @return * possible object is * {@link W3CEndpointReference } * */ public W3CEndpointReference getSubscriptionReference() { return subscriptionReference; } /** * Sets the value of the subscriptionReference property. * * @param value * allowed object is * {@link W3CEndpointReference } * */ public void setSubscriptionReference(W3CEndpointReference value) { this.subscriptionReference = value; } /** * Gets the value of the topic property. * * @return * possible object is * {@link TopicExpressionType } * */ public TopicExpressionType getTopic() { return topic; } /** * Sets the value of the topic property. * * @param value * allowed object is * {@link TopicExpressionType } * */ public void setTopic(TopicExpressionType value) { this.topic = value; } /** * Gets the value of the producerReference property. * * @return * possible object is * {@link W3CEndpointReference } * */ public W3CEndpointReference getProducerReference() { return producerReference; } /** * Sets the value of the producerReference property. * * @param value * allowed object is * {@link W3CEndpointReference } * */ public void setProducerReference(W3CEndpointReference value) { this.producerReference = value; } /** * Gets the value of the message property. * * @return * possible object is * {@link NotificationMessageHolderType.Message } * */ public NotificationMessageHolderType.Message getMessage() { return message; } /** * Sets the value of the message property. * * @param value * allowed object is * {@link NotificationMessageHolderType.Message } * */ public void setMessage(NotificationMessageHolderType.Message value) { this.message = value; } /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin * */ @Override public String toString() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE); } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType&gt; * &lt;complexContent&gt; * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; * &lt;sequence&gt; * &lt;any processContents='lax'/&gt; * &lt;/sequence&gt; * &lt;/restriction&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "any" }) public static class Message { @XmlAnyElement(lax = true) protected Object any; /** * Gets the value of the any property. * * @return * possible object is * {@link Element } * {@link Object } * */ public Object getAny() { return any; } /** * Sets the value of the any property. * * @param value * allowed object is * {@link Element } * {@link Object } * */ public void setAny(Object value) { this.any = value; } /** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin * */ @Override public String toString() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.DEFAULT_STYLE); } } }
{ "content_hash": "d866211f6a923114af58bd50d2df3a2c", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 105, "avg_line_length": 27.80672268907563, "alnum_prop": 0.5871864611665155, "repo_name": "fpompermaier/onvif", "id": "8df6bc7967fb790d99bb815603a2ee2e74ef3adc", "size": "6618", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "onvif-ws-client/src/main/java/org/oasis_open/docs/wsn/b_2/NotificationMessageHolderType.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "5555048" } ], "symlink_target": "" }
package storage import ( "github.com/theupdateframework/notary/storage/rethinkdb" ) // These consts are the index names we've defined for RethinkDB const ( rdbSHA256Idx = "sha256" rdbGunRoleIdx = "gun_role" rdbGunRoleSHA256Idx = "gun_role_sha256" rdbGunRoleVersionIdx = "gun_role_version" ) var ( // TUFFilesRethinkTable is the table definition of notary server's TUF metadata files TUFFilesRethinkTable = rethinkdb.Table{ Name: RDBTUFFile{}.TableName(), PrimaryKey: "gun_role_version", SecondaryIndexes: map[string][]string{ rdbSHA256Idx: nil, "gun": nil, "timestamp_checksum": nil, rdbGunRoleIdx: {"gun", "role"}, rdbGunRoleSHA256Idx: {"gun", "role", "sha256"}, }, // this configuration guarantees linearizability of individual atomic operations on individual documents Config: map[string]string{ "write_acks": "majority", }, JSONUnmarshaller: rdbTUFFileFromJSON, } // ChangeRethinkTable is the table definition for changefeed objects ChangeRethinkTable = rethinkdb.Table{ Name: Change{}.TableName(), PrimaryKey: "id", SecondaryIndexes: map[string][]string{ "rdb_created_at_id": {"created_at", "id"}, "rdb_gun_created_at_id": {"gun", "created_at", "id"}, }, Config: map[string]string{ "write_acks": "majority", }, JSONUnmarshaller: rdbChangeFromJSON, } )
{ "content_hash": "d8204c1a6affd6b673b72cec8bd06f5f", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 106, "avg_line_length": 29.617021276595743, "alnum_prop": 0.6817528735632183, "repo_name": "jfrazelle/notary", "id": "611d960db6e4367ff5f103aa86163dfc47037b44", "size": "1392", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "server/storage/rethinkdb_models.go", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Go", "bytes": "1688403" }, { "name": "Makefile", "bytes": "7548" }, { "name": "Protocol Buffer", "bytes": "1843" }, { "name": "Python", "bytes": "47578" }, { "name": "Shell", "bytes": "13448" } ], "symlink_target": "" }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package src; import com.MumbaiPointsInfo; import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.*; import java.util.*; /** * * @author kanu */ @WebServlet(name = "MumbaiPoints", urlPatterns = {"/MumbaiPoints"}) public class MumbaiPoints extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=UTF-8"); ArrayList<MumbaiPointsInfo> send=new ArrayList<MumbaiPointsInfo>(); BufferedReader br=new BufferedReader(new FileReader("F:\\3rdSEM\\capstone\\Mumbai\\points.txt")); String line=br.readLine(); while(line!=null) { StringTokenizer st=new StringTokenizer(line,"-,,"); st.nextToken(); double lat=Double.parseDouble(st.nextToken()); double lng=Double.parseDouble(st.nextToken()); MumbaiPointsInfo m=new MumbaiPointsInfo(lat, lng); send.add(m); line=br.readLine(); } request.setAttribute("send", send); request.getRequestDispatcher("MumbaiPoints.jsp").forward(request, response); } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
{ "content_hash": "5bfecd03126a57d12a5b2a3de785edfa", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 123, "avg_line_length": 33.39772727272727, "alnum_prop": 0.6743790404899626, "repo_name": "kireet-13/TrafficUpdate", "id": "c27db17f62954c3669fcb504c5fc0f885d40c2d5", "size": "2939", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "MapBusesRoute/src/java/src/MumbaiPoints.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "778" }, { "name": "Java", "bytes": "105026" } ], "symlink_target": "" }
package org.apache.hadoop.hbase.regionserver; import java.io.IOException; import java.util.Collection; import java.util.List; import java.util.Map; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellComparator; import org.apache.hadoop.hbase.HBaseInterfaceAudience; import org.apache.hadoop.hbase.HDFSBlocksDistribution; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.classification.InterfaceAudience; import org.apache.hadoop.hbase.classification.InterfaceStability; import org.apache.hadoop.hbase.client.Append; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Get; import org.apache.hadoop.hbase.client.Increment; import org.apache.hadoop.hbase.client.IsolationLevel; import org.apache.hadoop.hbase.client.Mutation; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.client.Result; import org.apache.hadoop.hbase.client.RowMutations; import org.apache.hadoop.hbase.client.Scan; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.conf.ConfigurationObserver; import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.filter.CompareFilter.CompareOp; import org.apache.hadoop.hbase.shaded.protobuf.generated.AdminProtos.GetRegionInfoResponse.CompactionState; import org.apache.hadoop.hbase.shaded.protobuf.generated.ClientProtos.CoprocessorServiceCall; import org.apache.hadoop.hbase.shaded.com.google.protobuf.Service; import org.apache.hadoop.hbase.util.Pair; import org.apache.hadoop.hbase.wal.WALSplitter.MutationReplay; import org.apache.hadoop.hbase.shaded.com.google.common.annotations.VisibleForTesting; /** * Regions store data for a certain region of a table. It stores all columns * for each row. A given table consists of one or more Regions. * * <p>An Region is defined by its table and its key extent. * * <p>Locking at the Region level serves only one purpose: preventing the * region from being closed (and consequently split) while other operations * are ongoing. Each row level operation obtains both a row lock and a region * read lock for the duration of the operation. While a scanner is being * constructed, getScanner holds a read lock. If the scanner is successfully * constructed, it holds a read lock until it is closed. A close takes out a * write lock and consequently will block for ongoing operations and will block * new operations from starting while the close is in progress. */ @InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC) @InterfaceStability.Evolving public interface Region extends ConfigurationObserver { /////////////////////////////////////////////////////////////////////////// // Region state /** @return region information for this region */ HRegionInfo getRegionInfo(); /** @return table descriptor for this region */ TableDescriptor getTableDescriptor(); /** @return true if region is available (not closed and not closing) */ boolean isAvailable(); /** @return true if region is closed */ boolean isClosed(); /** @return True if closing process has started */ boolean isClosing(); /** @return True if region is in recovering state */ boolean isRecovering(); /** @return True if region is read only */ boolean isReadOnly(); /** @return true if region is splittable */ boolean isSplittable(); /** * @return true if region is mergeable */ boolean isMergeable(); /** * Return the list of Stores managed by this region * <p>Use with caution. Exposed for use of fixup utilities. * @return a list of the Stores managed by this region */ List<Store> getStores(); /** * Return the Store for the given family * <p>Use with caution. Exposed for use of fixup utilities. * @return the Store for the given family */ Store getStore(byte[] family); /** @return list of store file names for the given families */ List<String> getStoreFileList(byte [][] columns); /** * Check the region's underlying store files, open the files that have not * been opened yet, and remove the store file readers for store files no * longer available. * @throws IOException */ boolean refreshStoreFiles() throws IOException; /** @return the latest sequence number that was read from storage when this region was opened */ long getOpenSeqNum(); /** @return the max sequence id of flushed data on this region; no edit in memory will have * a sequence id that is less that what is returned here. */ long getMaxFlushedSeqId(); /** @return the oldest flushed sequence id for the given family; can be beyond * {@link #getMaxFlushedSeqId()} in case where we've flushed a subset of a regions column * families * @deprecated Since version 1.2.0. Exposes too much about our internals; shutting it down. * Do not use. */ @VisibleForTesting @Deprecated public long getOldestSeqIdOfStore(byte[] familyName); /** * This can be used to determine the last time all files of this region were major compacted. * @param majorCompactionOnly Only consider HFile that are the result of major compaction * @return the timestamp of the oldest HFile for all stores of this region */ long getOldestHfileTs(boolean majorCompactionOnly) throws IOException; /** * @return map of column family names to max sequence id that was read from storage when this * region was opened */ public Map<byte[], Long> getMaxStoreSeqId(); /** @return true if loading column families on demand by default */ boolean isLoadingCfsOnDemandDefault(); /** @return readpoint considering given IsolationLevel; pass null for default*/ long getReadPoint(IsolationLevel isolationLevel); /** * @return readpoint considering given IsolationLevel * @deprecated Since 1.2.0. Use {@link #getReadPoint(IsolationLevel)} instead. */ @Deprecated long getReadpoint(IsolationLevel isolationLevel); /** * @return The earliest time a store in the region was flushed. All * other stores in the region would have been flushed either at, or * after this time. */ long getEarliestFlushTimeForAllStores(); /////////////////////////////////////////////////////////////////////////// // Metrics /** @return read requests count for this region */ long getReadRequestsCount(); /** * Update the read request count for this region * @param i increment */ void updateReadRequestsCount(long i); /** @return filtered read requests count for this region */ long getFilteredReadRequestsCount(); /** @return write request count for this region */ long getWriteRequestsCount(); /** * Update the write request count for this region * @param i increment */ void updateWriteRequestsCount(long i); /** * @return memstore size for this region, in bytes. It just accounts data size of cells added to * the memstores of this Region. Means size in bytes for key, value and tags within Cells. * It wont consider any java heap overhead for the cell objects or any other. */ long getMemstoreSize(); /** @return store services for this region, to access services required by store level needs */ RegionServicesForStores getRegionServicesForStores(); /** @return the number of mutations processed bypassing the WAL */ long getNumMutationsWithoutWAL(); /** @return the size of data processed bypassing the WAL, in bytes */ long getDataInMemoryWithoutWAL(); /** @return the number of blocked requests */ long getBlockedRequestsCount(); /** @return the number of checkAndMutate guards that passed */ long getCheckAndMutateChecksPassed(); /** @return the number of failed checkAndMutate guards */ long getCheckAndMutateChecksFailed(); /** @return the MetricsRegion for this region */ MetricsRegion getMetrics(); /** @return the block distribution for all Stores managed by this region */ HDFSBlocksDistribution getHDFSBlocksDistribution(); /////////////////////////////////////////////////////////////////////////// // Locking // Region read locks /** * Operation enum is used in {@link Region#startRegionOperation} and elsewhere to provide * context for various checks. */ enum Operation { ANY, GET, PUT, DELETE, SCAN, APPEND, INCREMENT, SPLIT_REGION, MERGE_REGION, BATCH_MUTATE, REPLAY_BATCH_MUTATE, COMPACT_REGION, REPLAY_EVENT } /** * This method needs to be called before any public call that reads or * modifies data. * Acquires a read lock and checks if the region is closing or closed. * <p>{@link #closeRegionOperation} MUST then always be called after * the operation has completed, whether it succeeded or failed. * @throws IOException */ void startRegionOperation() throws IOException; /** * This method needs to be called before any public call that reads or * modifies data. * Acquires a read lock and checks if the region is closing or closed. * <p>{@link #closeRegionOperation} MUST then always be called after * the operation has completed, whether it succeeded or failed. * @param op The operation is about to be taken on the region * @throws IOException */ void startRegionOperation(Operation op) throws IOException; /** * Closes the region operation lock. * @throws IOException */ void closeRegionOperation() throws IOException; // Row write locks /** * Row lock held by a given thread. * One thread may acquire multiple locks on the same row simultaneously. * The locks must be released by calling release() from the same thread. */ public interface RowLock { /** * Release the given lock. If there are no remaining locks held by the current thread * then unlock the row and allow other threads to acquire the lock. * @throws IllegalArgumentException if called by a different thread than the lock owning * thread */ void release(); } /** * * Get a row lock for the specified row. All locks are reentrant. * * Before calling this function make sure that a region operation has already been * started (the calling thread has already acquired the region-close-guard lock). * * NOTE: the boolean passed here has changed. It used to be a boolean that * stated whether or not to wait on the lock. Now it is whether it an exclusive * lock is requested. * * @param row The row actions will be performed against * @param readLock is the lock reader or writer. True indicates that a non-exclusive * lock is requested * @see #startRegionOperation() * @see #startRegionOperation(Operation) */ RowLock getRowLock(byte[] row, boolean readLock) throws IOException; /** * If the given list of row locks is not null, releases all locks. */ void releaseRowLocks(List<RowLock> rowLocks); /////////////////////////////////////////////////////////////////////////// // Region operations /** * Perform one or more append operations on a row. * @param append * @param nonceGroup * @param nonce * @return result of the operation * @throws IOException */ Result append(Append append, long nonceGroup, long nonce) throws IOException; /** * Perform a batch of mutations. * <p> * Note this supports only Put and Delete mutations and will ignore other types passed. * @param mutations the list of mutations * @param nonceGroup * @param nonce * @return an array of OperationStatus which internally contains the * OperationStatusCode and the exceptionMessage if any. * @throws IOException */ OperationStatus[] batchMutate(Mutation[] mutations, long nonceGroup, long nonce) throws IOException; /** * Replay a batch of mutations. * @param mutations mutations to replay. * @param replaySeqId * @return an array of OperationStatus which internally contains the * OperationStatusCode and the exceptionMessage if any. * @throws IOException */ OperationStatus[] batchReplay(MutationReplay[] mutations, long replaySeqId) throws IOException; /** * Atomically checks if a row/family/qualifier value matches the expected value and if it does, * it performs the mutation. If the passed value is null, the lack of column value * (ie: non-existence) is used. See checkAndRowMutate to do many checkAndPuts at a time on a * single row. * @param row to check * @param family column family to check * @param qualifier column qualifier to check * @param compareOp the comparison operator * @param comparator * @param mutation * @param writeToWAL * @return true if mutation was applied, false otherwise * @throws IOException */ boolean checkAndMutate(byte [] row, byte [] family, byte [] qualifier, CompareOp compareOp, ByteArrayComparable comparator, Mutation mutation, boolean writeToWAL) throws IOException; /** * Atomically checks if a row/family/qualifier value matches the expected values and if it does, * it performs the row mutations. If the passed value is null, the lack of column value * (ie: non-existence) is used. Use to do many mutations on a single row. Use checkAndMutate * to do one checkAndMutate at a time. * @param row to check * @param family column family to check * @param qualifier column qualifier to check * @param compareOp the comparison operator * @param comparator * @param mutations * @param writeToWAL * @return true if mutations were applied, false otherwise * @throws IOException */ boolean checkAndRowMutate(byte [] row, byte [] family, byte [] qualifier, CompareOp compareOp, ByteArrayComparable comparator, RowMutations mutations, boolean writeToWAL) throws IOException; /** * Deletes the specified cells/row. * @param delete * @throws IOException */ void delete(Delete delete) throws IOException; /** * Do a get based on the get parameter. * @param get query parameters * @return result of the operation */ Result get(Get get) throws IOException; /** * Do a get based on the get parameter. * @param get query parameters * @param withCoprocessor invoke coprocessor or not. We don't want to * always invoke cp. * @return list of cells resulting from the operation */ List<Cell> get(Get get, boolean withCoprocessor) throws IOException; /** * Do a get for duplicate non-idempotent operation. * @param get query parameters. * @param withCoprocessor * @param nonceGroup Nonce group. * @param nonce Nonce. * @return list of cells resulting from the operation * @throws IOException */ List<Cell> get(Get get, boolean withCoprocessor, long nonceGroup, long nonce) throws IOException; /** * Return an iterator that scans over the HRegion, returning the indicated * columns and rows specified by the {@link Scan}. * <p> * This Iterator must be closed by the caller. * * @param scan configured {@link Scan} * @return RegionScanner * @throws IOException read exceptions */ RegionScanner getScanner(Scan scan) throws IOException; /** * Return an iterator that scans over the HRegion, returning the indicated columns and rows * specified by the {@link Scan}. The scanner will also include the additional scanners passed * along with the scanners for the specified Scan instance. Should be careful with the usage to * pass additional scanners only within this Region * <p> * This Iterator must be closed by the caller. * * @param scan configured {@link Scan} * @param additionalScanners Any additional scanners to be used * @return RegionScanner * @throws IOException read exceptions */ RegionScanner getScanner(Scan scan, List<KeyValueScanner> additionalScanners) throws IOException; /** The comparator to be used with the region */ CellComparator getCellComparator(); /** * Perform one or more increment operations on a row. * @param increment * @param nonceGroup * @param nonce * @return result of the operation * @throws IOException */ Result increment(Increment increment, long nonceGroup, long nonce) throws IOException; /** * Performs multiple mutations atomically on a single row. Currently * {@link Put} and {@link Delete} are supported. * * @param mutations object that specifies the set of mutations to perform atomically * @throws IOException */ void mutateRow(RowMutations mutations) throws IOException; /** * Perform atomic mutations within the region. * * @param mutations The list of mutations to perform. * <code>mutations</code> can contain operations for multiple rows. * Caller has to ensure that all rows are contained in this region. * @param rowsToLock Rows to lock * @param nonceGroup Optional nonce group of the operation (client Id) * @param nonce Optional nonce of the operation (unique random id to ensure "more idempotence") * If multiple rows are locked care should be taken that * <code>rowsToLock</code> is sorted in order to avoid deadlocks. * @throws IOException */ void mutateRowsWithLocks(Collection<Mutation> mutations, Collection<byte[]> rowsToLock, long nonceGroup, long nonce) throws IOException; /** * Performs atomic multiple reads and writes on a given row. * * @param processor The object defines the reads and writes to a row. */ void processRowsWithLocks(RowProcessor<?,?> processor) throws IOException; /** * Performs atomic multiple reads and writes on a given row. * * @param processor The object defines the reads and writes to a row. * @param nonceGroup Optional nonce group of the operation (client Id) * @param nonce Optional nonce of the operation (unique random id to ensure "more idempotence") */ void processRowsWithLocks(RowProcessor<?,?> processor, long nonceGroup, long nonce) throws IOException; /** * Performs atomic multiple reads and writes on a given row. * * @param processor The object defines the reads and writes to a row. * @param timeout The timeout of the processor.process() execution * Use a negative number to switch off the time bound * @param nonceGroup Optional nonce group of the operation (client Id) * @param nonce Optional nonce of the operation (unique random id to ensure "more idempotence") */ void processRowsWithLocks(RowProcessor<?,?> processor, long timeout, long nonceGroup, long nonce) throws IOException; /** * Puts some data in the table. * @param put * @throws IOException */ void put(Put put) throws IOException; /** * Listener class to enable callers of * bulkLoadHFile() to perform any necessary * pre/post processing of a given bulkload call */ interface BulkLoadListener { /** * Called before an HFile is actually loaded * @param family family being loaded to * @param srcPath path of HFile * @return final path to be used for actual loading * @throws IOException */ String prepareBulkLoad(byte[] family, String srcPath, boolean copyFile) throws IOException; /** * Called after a successful HFile load * @param family family being loaded to * @param srcPath path of HFile * @throws IOException */ void doneBulkLoad(byte[] family, String srcPath) throws IOException; /** * Called after a failed HFile load * @param family family being loaded to * @param srcPath path of HFile * @throws IOException */ void failedBulkLoad(byte[] family, String srcPath) throws IOException; } /** * Attempts to atomically load a group of hfiles. This is critical for loading * rows with multiple column families atomically. * * @param familyPaths List of Pair&lt;byte[] column family, String hfilePath&gt; * @param bulkLoadListener Internal hooks enabling massaging/preparation of a * file about to be bulk loaded * @param assignSeqId * @return Map from family to List of store file paths if successful, null if failed recoverably * @throws IOException if failed unrecoverably. */ Map<byte[], List<Path>> bulkLoadHFiles(Collection<Pair<byte[], String>> familyPaths, boolean assignSeqId, BulkLoadListener bulkLoadListener) throws IOException; /** * Attempts to atomically load a group of hfiles. This is critical for loading * rows with multiple column families atomically. * * @param familyPaths List of Pair&lt;byte[] column family, String hfilePath&gt; * @param assignSeqId * @param bulkLoadListener Internal hooks enabling massaging/preparation of a * file about to be bulk loaded * @param copyFile always copy hfiles if true * @return Map from family to List of store file paths if successful, null if failed recoverably * @throws IOException if failed unrecoverably. */ Map<byte[], List<Path>> bulkLoadHFiles(Collection<Pair<byte[], String>> familyPaths, boolean assignSeqId, BulkLoadListener bulkLoadListener, boolean copyFile) throws IOException; /////////////////////////////////////////////////////////////////////////// // Coprocessors /** @return the coprocessor host */ RegionCoprocessorHost getCoprocessorHost(); /** * Executes a single protocol buffer coprocessor endpoint {@link Service} method using * the registered protocol handlers. {@link Service} implementations must be registered via the * {@link Region#registerService(com.google.protobuf.Service)} * method before they are available. * * @param controller an {@code RpcContoller} implementation to pass to the invoked service * @param call a {@code CoprocessorServiceCall} instance identifying the service, method, * and parameters for the method invocation * @return a protocol buffer {@code Message} instance containing the method's result * @throws IOException if no registered service handler is found or an error * occurs during the invocation * @see org.apache.hadoop.hbase.regionserver.Region#registerService(com.google.protobuf.Service) */ com.google.protobuf.Message execService(com.google.protobuf.RpcController controller, CoprocessorServiceCall call) throws IOException; /** * Registers a new protocol buffer {@link Service} subclass as a coprocessor endpoint to * be available for handling Region#execService(com.google.protobuf.RpcController, * org.apache.hadoop.hbase.protobuf.generated.ClientProtos.CoprocessorServiceCall) calls. * * <p> * Only a single instance may be registered per region for a given {@link Service} subclass (the * instances are keyed on {@link com.google.protobuf.Descriptors.ServiceDescriptor#getFullName()}. * After the first registration, subsequent calls with the same service name will fail with * a return value of {@code false}. * </p> * @param instance the {@code Service} subclass instance to expose as a coprocessor endpoint * @return {@code true} if the registration was successful, {@code false} * otherwise */ boolean registerService(com.google.protobuf.Service instance); /////////////////////////////////////////////////////////////////////////// // RowMutation processor support /** * Check the collection of families for validity. * @param families * @throws NoSuchColumnFamilyException */ void checkFamilies(Collection<byte[]> families) throws NoSuchColumnFamilyException; /** * Check the collection of families for valid timestamps * @param familyMap * @param now current timestamp * @throws FailedSanityCheckException */ void checkTimestamps(Map<byte[], List<Cell>> familyMap, long now) throws FailedSanityCheckException; /** * Prepare a delete for a row mutation processor * @param delete The passed delete is modified by this method. WARNING! * @throws IOException */ void prepareDelete(Delete delete) throws IOException; /** * Set up correct timestamps in the KVs in Delete object. * <p>Caller should have the row and region locks. * @param mutation * @param familyCellMap * @param now * @throws IOException */ void prepareDeleteTimestamps(Mutation mutation, Map<byte[], List<Cell>> familyCellMap, byte[] now) throws IOException; /** * Replace any cell timestamps set to {@link org.apache.hadoop.hbase.HConstants#LATEST_TIMESTAMP} * provided current timestamp. * @param values * @param now */ void updateCellTimestamps(final Iterable<List<Cell>> values, final byte[] now) throws IOException; /////////////////////////////////////////////////////////////////////////// // Flushes, compactions, splits, etc. // Wizards only, please interface FlushResult { enum Result { FLUSHED_NO_COMPACTION_NEEDED, FLUSHED_COMPACTION_NEEDED, // Special case where a flush didn't run because there's nothing in the memstores. Used when // bulk loading to know when we can still load even if a flush didn't happen. CANNOT_FLUSH_MEMSTORE_EMPTY, CANNOT_FLUSH } /** @return the detailed result code */ Result getResult(); /** @return true if the memstores were flushed, else false */ boolean isFlushSucceeded(); /** @return True if the flush requested a compaction, else false */ boolean isCompactionNeeded(); } /** * Flush the cache. * * <p>When this method is called the cache will be flushed unless: * <ol> * <li>the cache is empty</li> * <li>the region is closed.</li> * <li>a flush is already in progress</li> * <li>writes are disabled</li> * </ol> * * <p>This method may block for some time, so it should not be called from a * time-sensitive thread. * @param force whether we want to force a flush of all stores * @return FlushResult indicating whether the flush was successful or not and if * the region needs compacting * * @throws IOException general io exceptions * because a snapshot was not properly persisted. */ FlushResult flush(boolean force) throws IOException; /** * Synchronously compact all stores in the region. * <p>This operation could block for a long time, so don't call it from a * time-sensitive thread. * <p>Note that no locks are taken to prevent possible conflicts between * compaction and splitting activities. The regionserver does not normally compact * and split in parallel. However by calling this method you may introduce * unexpected and unhandled concurrency. Don't do this unless you know what * you are doing. * * @param majorCompaction True to force a major compaction regardless of thresholds * @throws IOException */ void compact(final boolean majorCompaction) throws IOException; /** * Trigger major compaction on all stores in the region. * <p> * Compaction will be performed asynchronously to this call by the RegionServer's * CompactSplitThread. See also {@link Store#triggerMajorCompaction()} * @throws IOException */ void triggerMajorCompaction() throws IOException; /** * @return if a given region is in compaction now. */ CompactionState getCompactionState(); /** Wait for all current flushes and compactions of the region to complete */ void waitForFlushesAndCompactions(); /** Wait for all current flushes of the region to complete */ void waitForFlushes(); }
{ "content_hash": "b2a86e4826f666cb9ddc17821485c168", "timestamp": "", "source": "github", "line_count": 744, "max_line_length": 107, "avg_line_length": 37.196236559139784, "alnum_prop": 0.7069812820698128, "repo_name": "gustavoanatoly/hbase", "id": "48672a30a5be5ed44dbc729acb1dc925c4e8b403", "size": "28479", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/Region.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "351" }, { "name": "Batchfile", "bytes": "23942" }, { "name": "C", "bytes": "28534" }, { "name": "C++", "bytes": "56085" }, { "name": "CMake", "bytes": "13186" }, { "name": "CSS", "bytes": "35785" }, { "name": "HTML", "bytes": "15644" }, { "name": "Java", "bytes": "31160752" }, { "name": "JavaScript", "bytes": "2694" }, { "name": "Makefile", "bytes": "1359" }, { "name": "PHP", "bytes": "8385" }, { "name": "Perl", "bytes": "383739" }, { "name": "Protocol Buffer", "bytes": "262179" }, { "name": "Python", "bytes": "87467" }, { "name": "Ruby", "bytes": "481475" }, { "name": "Scala", "bytes": "439837" }, { "name": "Shell", "bytes": "175165" }, { "name": "Thrift", "bytes": "41474" }, { "name": "XSLT", "bytes": "6764" } ], "symlink_target": "" }
const {createTestContext} = require('./__fixtues__/create-test-context'); const propertiesReader = require('../'); describe('prototype-pollution', () => { let context; beforeEach(async () => { context = await createTestContext(); }); it('does not pollute global Object.prototype', async () => { const file = ` [__proto__] polluted = polluted parsed = true `; const props = propertiesReader(await context.file('props.ini', file)); expect(({}).polluted).toBeUndefined(); expect(props.path().__proto__.polluted).toBe('polluted'); expect(props.getRaw('__proto__.polluted')).toBe('polluted'); expect(props.get('__proto__.polluted')).toBe('polluted'); expect(props.getRaw('__proto__.parsed')).toBe('true'); expect(props.get('__proto__.parsed')).toBe(true); }); });
{ "content_hash": "3a09a5271268c8e9a267e7f64f2b8101", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 76, "avg_line_length": 31.178571428571427, "alnum_prop": 0.588774341351661, "repo_name": "steveukx/properties", "id": "19f0e21067ea596cb4818b04fb113590260adf9a", "size": "873", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "test/fix-prototype-pollution.spec.js", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "31222" } ], "symlink_target": "" }
using UnrealBuildTool; public class ScreenShotTool : ModuleRules { public ScreenShotTool(TargetInfo Target) { PublicIncludePaths.AddRange(new string[] { "ScreenShotTool/Public" }); PrivateIncludePaths.AddRange(new string[] { "ScreenShotTool/Private", }); PublicDependencyModuleNames.AddRange(new string[]{ "Core","CoreUObject","Engine","InputCore" }); PrivateDependencyModuleNames.AddRange(new string[]{ "Slate", "SlateCore","Core","CoreUObject","Engine","InputCore" }); DynamicallyLoadedModuleNames.AddRange(new string[]{ }); } }
{ "content_hash": "391589914aceb03edfbed4ae80684217", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 66, "avg_line_length": 26.08695652173913, "alnum_prop": 0.6866666666666666, "repo_name": "xtygah14three/UE4ScreenShotLib", "id": "12b62c5845f3ca2d154c40a22e95fcf0b2681508", "size": "637", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Plugins/ScreenShotTool/Source/ScreenShotTool/ScreenShotTool.Build.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "55" }, { "name": "C#", "bytes": "637" }, { "name": "C++", "bytes": "2170" } ], "symlink_target": "" }
package org.dbmaintain.script.repository; import org.dbmaintain.config.PropertyUtils; import org.dbmaintain.script.Script; import org.dbmaintain.script.ScriptContentHandle; import org.dbmaintain.script.ScriptFactory; import org.dbmaintain.script.executedscriptinfo.ScriptIndexes; import org.dbmaintain.script.qualifier.Qualifier; import org.dbmaintain.util.DbMaintainException; import java.io.File; import java.util.*; import static org.dbmaintain.config.DbMaintainProperties.*; /** * @author Filip Neven * @author Tim Ducheyne * @since 24-dec-2008 */ abstract public class ScriptLocation { /** * Name of the properties file that is packaged with the jar, that contains information about how * the scripts in the jar file are structured. */ public static final String LOCATION_PROPERTIES_FILENAME = "META-INF/dbmaintain.properties"; protected SortedSet<Script> scripts; protected String scriptEncoding; protected String postProcessingScriptDirName; protected Set<Qualifier> registeredQualifiers; protected Set<Qualifier> patchQualifiers; protected String scriptIndexRegexp; protected String qualifierRegexp; protected String targetDatabaseRegexp; protected Set<String> scriptFileExtensions; protected String scriptLocationName; /* The baseline revision. If set, all scripts with a lower revision will be ignored */ protected ScriptIndexes baseLineRevision; /* If true, carriage return chars will be ignored when calculating check sums */ protected boolean ignoreCarriageReturnsWhenCalculatingCheckSum; protected ScriptFactory scriptFactory; /** * @param scripts The scripts contained in the container, not null * @param scriptEncoding Encoding used to read the contents of the script, not null * @param postProcessingScriptDirName The directory name that contains post processing scripts, may be null * @param registeredQualifiers the registered qualifiers, not null * @param scriptIndexRegexp The regexp that identifies the version index in the filename, not null * @param qualifierRegexp The regexp that identifies a qualifier in the filename, not null * @param targetDatabaseRegexp The regexp that identifies the target database in the filename, not null * @param patchQualifiers The qualifiers that indicate that this script is a patch script, not null * @param scriptFileExtensions The script file extensions * @param baseLineRevision The baseline revision. If set, all scripts with a lower revision will be ignored * @param ignoreCarriageReturnsWhenCalculatingCheckSum * If true, carriage return chars will be ignored when calculating check sums */ protected ScriptLocation(SortedSet<Script> scripts, String scriptEncoding, String postProcessingScriptDirName, Set<Qualifier> registeredQualifiers, Set<Qualifier> patchQualifiers, String scriptIndexRegexp, String qualifierRegexp, String targetDatabaseRegexp, Set<String> scriptFileExtensions, ScriptIndexes baseLineRevision, boolean ignoreCarriageReturnsWhenCalculatingCheckSum) { this.scripts = scripts; this.scriptEncoding = scriptEncoding; this.postProcessingScriptDirName = postProcessingScriptDirName; this.registeredQualifiers = registeredQualifiers; this.patchQualifiers = patchQualifiers; this.scriptIndexRegexp = scriptIndexRegexp; this.qualifierRegexp = qualifierRegexp; this.targetDatabaseRegexp = targetDatabaseRegexp; this.scriptFileExtensions = scriptFileExtensions; this.scriptLocationName = "<undefined>"; this.baseLineRevision = baseLineRevision; this.ignoreCarriageReturnsWhenCalculatingCheckSum = ignoreCarriageReturnsWhenCalculatingCheckSum; this.scriptFactory = createScriptFactory(); } protected ScriptLocation(File scriptLocation, String defaultScriptEncoding, String defaultPostProcessingScriptDirName, Set<Qualifier> defaultRegisteredQualifiers, Set<Qualifier> defaultPatchQualifiers, String defaultScriptIndexRegexp, String defaultQualifierRegexp, String defaultTargetDatabaseRegexp, Set<String> defaultScriptFileExtensions, ScriptIndexes defaultBaseLineRevision, boolean ignoreCarriageReturnsWhenCalculatingCheckSum) { assertValidScriptLocation(scriptLocation); this.scriptEncoding = defaultScriptEncoding; this.postProcessingScriptDirName = defaultPostProcessingScriptDirName; this.registeredQualifiers = defaultRegisteredQualifiers; this.patchQualifiers = defaultPatchQualifiers; this.scriptIndexRegexp = defaultScriptIndexRegexp; this.qualifierRegexp = defaultQualifierRegexp; this.targetDatabaseRegexp = defaultTargetDatabaseRegexp; this.scriptFileExtensions = defaultScriptFileExtensions; this.baseLineRevision = defaultBaseLineRevision; this.ignoreCarriageReturnsWhenCalculatingCheckSum = ignoreCarriageReturnsWhenCalculatingCheckSum; Properties customProperties = getCustomProperties(scriptLocation); overrideValuesWithCustomConfiguration(customProperties); this.scriptLocationName = scriptLocation.getAbsolutePath(); this.scriptFactory = createScriptFactory(); this.scripts = loadScripts(scriptLocation); } protected abstract SortedSet<Script> loadScripts(File scriptLocation); protected Properties getCustomProperties(File scriptLocation) { return null; } /** * Asserts that the script root directory exists * * @param scriptLocation The location to validate, not null */ protected abstract void assertValidScriptLocation(File scriptLocation); /** * @return A description of the location, for logging purposes */ public String getLocationName() { return scriptLocationName; } public String getScriptEncoding() { return scriptEncoding; } public String getPostProcessingScriptDirName() { return postProcessingScriptDirName; } public Set<Qualifier> getRegisteredQualifiers() { return registeredQualifiers; } public Set<Qualifier> getPatchQualifiers() { return patchQualifiers; } public String getQualifierRegexp() { return qualifierRegexp; } public String getTargetDatabaseRegexp() { return targetDatabaseRegexp; } public Set<String> getScriptFileExtensions() { return scriptFileExtensions; } /** * @return The scripts from this location as a sorted set */ public SortedSet<Script> getScripts() { return scripts; } /** * Initializes all fields of the script location using the given properties, and default values for each of the fields * which are used if not available in the properties. * * @param customProperties extra db-maintain config, not null */ protected void overrideValuesWithCustomConfiguration(Properties customProperties) { if (customProperties == null) { return; } if (customProperties.containsKey(PROPERTY_SCRIPT_ENCODING)) { this.scriptEncoding = PropertyUtils.getString(PROPERTY_SCRIPT_ENCODING, customProperties); } if (customProperties.containsKey(PROPERTY_POSTPROCESSINGSCRIPT_DIRNAME)) { this.postProcessingScriptDirName = PropertyUtils.getString(PROPERTY_POSTPROCESSINGSCRIPT_DIRNAME, customProperties); } if (customProperties.containsKey(PROPERTY_QUALIFIERS)) { this.registeredQualifiers = createQualifiers(PropertyUtils.getStringList(PROPERTY_QUALIFIERS, customProperties)); } if (customProperties.containsKey(PROPERTY_SCRIPT_PATCH_QUALIFIERS)) { this.patchQualifiers = createQualifiers(PropertyUtils.getStringList(PROPERTY_SCRIPT_PATCH_QUALIFIERS, customProperties)); } if (customProperties.containsKey(PROPERTY_SCRIPT_INDEX_REGEXP)) { this.scriptIndexRegexp = PropertyUtils.getString(PROPERTY_SCRIPT_INDEX_REGEXP, customProperties); } if (customProperties.containsKey(PROPERTY_SCRIPT_QUALIFIER_REGEXP)) { this.qualifierRegexp = PropertyUtils.getString(PROPERTY_SCRIPT_QUALIFIER_REGEXP, customProperties); } if (customProperties.containsKey(PROPERTY_SCRIPT_TARGETDATABASE_REGEXP)) { this.targetDatabaseRegexp = PropertyUtils.getString(PROPERTY_SCRIPT_TARGETDATABASE_REGEXP, customProperties); } if (customProperties.containsKey(PROPERTY_SCRIPT_FILE_EXTENSIONS)) { this.scriptFileExtensions = new HashSet<String>(PropertyUtils.getStringList(PROPERTY_SCRIPT_FILE_EXTENSIONS, customProperties)); } if (customProperties.containsKey(PROPERTY_BASELINE_REVISION)) { String baseLineRevisionString = PropertyUtils.getString(PROPERTY_BASELINE_REVISION, customProperties); this.baseLineRevision = new ScriptIndexes(baseLineRevisionString); } if (customProperties.containsKey(PROPERTY_IGNORE_CARRIAGE_RETURN_WHEN_CALCULATING_CHECK_SUM)) { this.ignoreCarriageReturnsWhenCalculatingCheckSum = PropertyUtils.getBoolean(PROPERTY_IGNORE_CARRIAGE_RETURN_WHEN_CALCULATING_CHECK_SUM, customProperties); } assertValidScriptExtensions(); } /** * Asserts that the script extensions have the correct format */ protected void assertValidScriptExtensions() { // check whether an extension is configured if (scriptFileExtensions.isEmpty()) { throw new DbMaintainException("No script file extensions specified!"); } // Verify the correctness of the script extensions for (String extension : scriptFileExtensions) { if (extension.startsWith(".")) { throw new DbMaintainException("Script file extension " + extension + " should not start with a '.'"); } } } /** * @param fileName The file, not null * @return True if the given file is a database script, according to the configured script file extensions */ protected boolean isScriptFileName(String fileName) { for (String scriptFileExtension : scriptFileExtensions) { if (fileName.endsWith(scriptFileExtension)) { return true; } } return false; } protected Set<Qualifier> createQualifiers(List<String> qualifierNames) { Set<Qualifier> qualifiers = new HashSet<Qualifier>(); for (String qualifierName : qualifierNames) { qualifiers.add(new Qualifier(qualifierName)); } return qualifiers; } protected ScriptFactory createScriptFactory() { return new ScriptFactory(scriptIndexRegexp, targetDatabaseRegexp, qualifierRegexp, registeredQualifiers, patchQualifiers, postProcessingScriptDirName, baseLineRevision); } protected Script createScript(String fileName, Long fileLastModifiedAt, ScriptContentHandle scriptContentHandle) { return scriptFactory.createScriptWithContent(fileName, fileLastModifiedAt, scriptContentHandle); } }
{ "content_hash": "649652959b41472844606eb978d6b92c", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 177, "avg_line_length": 45.426877470355734, "alnum_prop": 0.7169581484381797, "repo_name": "hemau23/dbmaintain", "id": "18b84d66557287309e511165b0bf00f9df041b22", "size": "12085", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "dbmaintain/src/main/java/org/dbmaintain/script/repository/ScriptLocation.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "6394" }, { "name": "CSS", "bytes": "1284" }, { "name": "Java", "bytes": "1075355" }, { "name": "Shell", "bytes": "5698" } ], "symlink_target": "" }
bootimg-tools ============= Android boot.img creation and extraction tools (also MinGW compatible) Based on the original Android bootimg tools from: https://android.googlesource.com/platform/system/core
{ "content_hash": "12c54b80212c7506b1884702efc88a7c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 70, "avg_line_length": 29.571428571428573, "alnum_prop": 0.7584541062801933, "repo_name": "Alex237/bootimg-tools", "id": "4620070fbd53b3bd844ab78ed9d17c391ec70093", "size": "207", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "146096" }, { "name": "Makefile", "bytes": "495" } ], "symlink_target": "" }