text
stringlengths
2
6.14k
// Copyright 2016, EMC, Inc. /* jshint node: true */ 'use strict'; describe(require('path').basename(__filename), function() { var schemaFileName = 'install-esxi.json'; var canonical = { "osType": "esx", "profile": "install-esx.ipxe", "installScript": "esx-ks", "installScriptUri": "http://172.31.128.9090/api/current/templates/esx-ks", "version": "5.5", "repo": "http://172.31.128.1:9080/esxi/5.5", "rootPassword": "RackHDRocks!", "hostname": "rackhd-node", "domain": "example.com", "users": [ { "name": "rackhd1", "password": "123456", "sshKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJQ631/sw3D40h/6JfA+PFVy5Ofza6" }, { "name": "rackhd2", "password": "123456", } ], "rootSshKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJQ631/sw3D40h/6JfA+PFVy5Ofz6eu7ca", "dnsServers": [ "172.12.88.91", "192.168.20.77" ], "ntpServers": [ "0.vmware.pool.ntp.org", "1.vmware.pool.ntp.org" ], "networkDevices": [ { "device": "vmnic0", "ipv4": { "ipAddr": "192.168.1.29", "gateway": "192.168.1.1", "netmask": "255.255.255.0", "vlanIds": [ 104, 105 ] }, "ipv6": { "ipAddr": "fec0::6ab4:0:5efe:157.60.14.21", "gateway": "fe80::5efe:131.107.25.1", "netmask": "ffff.ffff.ffff.ffff.0.0.0.0", "vlanIds": [ 101, 106 ] }, "esxSwitchName": "vSwitch0" }, { "device": "aa:bb:cc:11:22:33", "ipv4": { "ipAddr": "192.168.11.89", "gateway": "192.168.11.1", "netmask": "255.255.255.0" } }, { "device": "vmnic4", "ipv6": { "ipAddr": "fec0::6ab4:0:5efe:157.60.14.21", "gateway": "fe80::5efe:131.107.25.1", "netmask": "ffff.ffff.ffff.ffff.0.0.0.0" } }, ], "installDisk": "naa.123456", "postInstallCommands": [ "cd /var/log", "ls -l" ], "switchDevices": [ { "switchName": "vSwitch0", "uplinks": [ "vmnic0", "vmnic4" ] }, { "switchName": "vSwitch1" } ], "rackhdCallbackScript": "esx.rackhdcallback", "esxBootConfigTemplate": "esx-boot-cfg", "esxBootConfigTemplateUri": "http://172.31.128.1:9080/api/current/templates/esx-boot-cfg", "comport": "com1", "comportaddress": "0x3f8", "gdbPort":"none", "logPort":"none", "debugLogToSerial":"0", "progressMilestones": { "m1": { "value": 1, "description": "do task 1" }, "m__2": { "value": 2, "description": "do task 2" }, "completed": { "value": 3, "description": "task finished" } } }; var positiveSetParam = { "comportaddress": ["0x3f8", "0x2f8", "0x3e8", "0x2e8"], "networkDevices[0].device": "90:e2:ba:91:1b:e4", "gdbPort":["com1","com2","default"], "logPort":["com1","com2","default"], "switchDevices[0].uplinks[0]": "90:e2:ba:91:1b:e4" }; var negativeSetParam = { "comportaddress": ["com1", "com2", 1, 0x3f8], "gdbPort":"ttys0", "debugLogToSerial":"3", "switchDevices[0].uplinks[1]": "vmnic0", //cannot set duplicated uplinks "switchDevices[0]": { "switchName": "vSwitch1" }, //cannot set duplicated switchDevice "ntpServers[0]": "1.vmware.pool.ntp.org" //cannot set duplicated ntpServers }; var positiveUnsetParam = [ "postInstallCommands", "switchDevices", "debugLogToSerial", "networkDevices[0].esxSwitchName" ]; var negativeUnsetParam = [ "rackhdCallbackScript", "esxBootConfigTemplate", "esxBootConfigTemplateUri", "comportaddress", "switchDevices[0].switchName" ]; require('./install-os-schema-ut-helper').test(schemaFileName, canonical); var SchemaUtHelper = require('./schema-ut-helper'); new SchemaUtHelper(schemaFileName, canonical).batchTest( positiveSetParam, negativeSetParam, positiveUnsetParam, negativeUnsetParam); });
// @flow import * as React from 'react' import { shallow } from 'enzyme' import { SlotMap } from '../SlotMap' import { Icon } from '../../icons' describe('SlotMap', () => { it('component renders 11 slots', () => { const wrapper = shallow(<SlotMap occupiedSlots={['1']} />) expect(wrapper.find('rect')).toHaveLength(11) }) it('component renders crash info icon when collision slots present', () => { const wrapper = shallow( <SlotMap occupiedSlots={['1']} collisionSlots={['4']} /> ) expect(wrapper.find(Icon)).toHaveLength(1) }) it('component applies occupied and error styles', () => { const wrapperDefault = shallow(<SlotMap occupiedSlots={['1']} />) const wrapperWithError = shallow( <SlotMap occupiedSlots={['1']} isError={true} /> ) expect(wrapperDefault.find('.slot_occupied')).toHaveLength(1) expect(wrapperWithError.find('.slot_occupied')).toHaveLength(1) expect(wrapperWithError.find('.slot_occupied.slot_error')).toHaveLength(1) }) })
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.6-4-62 description: > Object.defineProperty - both desc.value and name.value are null (8.12.9 step 6) includes: [propertyHelper.js] ---*/ var obj = {}; Object.defineProperty(obj, "foo", { value: null }); Object.defineProperty(obj, "foo", { value: null }); verifyEqualTo(obj, "foo", null); verifyNotWritable(obj, "foo"); verifyNotEnumerable(obj, "foo"); verifyNotConfigurable(obj, "foo");
/* * Copyright 2016 The Closure Compiler Authors. * * 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. */ class WindowInfo { constructor() { this.props = []; } propList() { for (var prop in window) { this.props.push(prop); } } list() { log(this.props.join(', ')); } } (new WindowInfo()).list();
module.exports = function(grunt) { require('load-grunt-tasks')(grunt); grunt.initConfig({ clean: ['dist'], ts: { default : { options: { compiler: './node_modules/typescript/bin/tsc', module: "commonjs", fast: 'never', preserveConstEnums: true }, src: 'src/**/*.ts', outDir: 'dist' }, watch : { options: { compiler: './node_modules/typescript/bin/tsc', module: "commonjs", fast: 'never', preserveConstEnums: true }, src: 'src/**/*.ts', watch: 'src/', outDir: 'dist' } }, copy: { main: { src: './lib/runtime.d.ts', dest: './dist/runtime.d.ts' } }, bump : { options : { files : ['package.json'], updateConfigs : [], commit : true, commitMessage : 'chore(ver): v%VERSION%', commitFiles : ['package.json', 'CHANGELOG.md'], createTag : true, tagName : 'v%VERSION%', tagMessage : 'chore(ver): v%VERSION%', push : true, pushTo : 'origin', gitDescribeOptions : '--tags --always --abbrev=1 --dirty=-d', globalReplace : false, prereleaseName : "rc", regExp : false } }, shell : { addChangelog : { command : 'git add CHANGELOG.md' } }, changelog : { options : { } } }); grunt.registerTask("release", "Release a new version", function(target) { if(!target) { target = "minor"; } return grunt.task.run("bump-only:" + target, "changelog", "shell:addChangelog", "bump-commit"); }); grunt.registerTask('default', ['ts:default', 'copy']); };
puremvc.define({ name: 'game.controller.StartupCommand', parent: puremvc.MacroCommand }, // INSTANCE MEMBERS { /** * Add the sub-commands for this MacroCommand * @override */ initializeMacroCommand: function () { this.addSubCommand( game.controller.StartupControllerCommand ); this.addSubCommand( game.controller.StartupModelCommand ); this.addSubCommand( game.controller.StartupViewCommand ); } } );
/// Copyright (c) 2009 Microsoft Corporation /// /// Redistribution and use in source and binary forms, with or without modification, are permitted provided /// that the following conditions are met: /// * Redistributions of source code must retain the above copyright notice, this list of conditions and /// the following disclaimer. /// * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and /// the following disclaimer in the documentation and/or other materials provided with the distribution. /// * Neither the name of Microsoft nor the names of its contributors may be used to /// endorse or promote products derived from this software without specific prior written permission. /// /// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR /// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS /// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE /// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT /// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS /// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, /// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF /// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ES5Harness.registerTest({ id: "15.2.3.3-2-28", path: "TestCases/chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-2-28.js", description: "Object.getOwnPropertyDescriptor - argument 'P' is an integer that converts to a string (value is 123)", test: function testcase() { var obj = { "123": 1 }; var desc = Object.getOwnPropertyDescriptor(obj, 123); return desc.value === 1; }, precondition: function prereq() { return fnExists(Object.getOwnPropertyDescriptor); } });
import { Rectangle } from "../../Source/Cesium.js"; import { computeFlyToLocationForRectangle } from "../../Source/Cesium.js"; import { Globe } from "../../Source/Cesium.js"; import { SceneMode } from "../../Source/Cesium.js"; import createScene from "../createScene.js"; import { when } from "../../Source/Cesium.js"; import MockTerrainProvider from "../MockTerrainProvider.js"; describe("Scene/computeFlyToLocationForRectangle", function () { var scene; beforeEach(function () { scene = createScene(); }); afterEach(function () { scene.destroyForSpecs(); }); function sampleTest(sceneMode) { //Pretend we have terrain with availability. var terrainProvider = new MockTerrainProvider(); terrainProvider.availability = {}; scene.globe = new Globe(); scene.terrainProvider = terrainProvider; scene.mode = sceneMode; var rectangle = new Rectangle(0.2, 0.4, 0.6, 0.8); var cartographics = [ Rectangle.center(rectangle), Rectangle.southeast(rectangle), Rectangle.southwest(rectangle), Rectangle.northeast(rectangle), Rectangle.northwest(rectangle), ]; // Mock sampleTerrainMostDetailed with same positions but with heights. var maxHeight = 1234; var sampledResults = [ Rectangle.center(rectangle), Rectangle.southeast(rectangle), Rectangle.southwest(rectangle), Rectangle.northeast(rectangle), Rectangle.northwest(rectangle), ]; sampledResults[0].height = 145; sampledResults[1].height = 1211; sampledResults[2].height = -123; sampledResults[3].height = maxHeight; spyOn( computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed" ).and.returnValue(when.resolve(sampledResults)); // Basically do the computation ourselves with our known values; var expectedResult; if (sceneMode === SceneMode.SCENE3D) { expectedResult = scene.mapProjection.ellipsoid.cartesianToCartographic( scene.camera.getRectangleCameraCoordinates(rectangle) ); } else { expectedResult = scene.mapProjection.unproject( scene.camera.getRectangleCameraCoordinates(rectangle) ); } expectedResult.height += maxHeight; return computeFlyToLocationForRectangle(rectangle, scene).then(function ( result ) { expect(result).toEqual(expectedResult); expect( computeFlyToLocationForRectangle._sampleTerrainMostDetailed ).toHaveBeenCalledWith(terrainProvider, cartographics); }); } it("samples terrain and returns expected result in 3D", function () { return sampleTest(SceneMode.SCENE3D); }); it("samples terrain and returns expected result in CV", function () { return sampleTest(SceneMode.COLUMBUS_VIEW); }); it("returns height above ellipsoid when in 2D", function () { var terrainProvider = new MockTerrainProvider(); terrainProvider.availability = {}; scene.globe = new Globe(); scene.terrainProvider = terrainProvider; scene.mode = SceneMode.SCENE2D; var rectangle = new Rectangle(0.2, 0.4, 0.6, 0.8); var expectedResult = scene.mapProjection.unproject( scene.camera.getRectangleCameraCoordinates(rectangle) ); spyOn(computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed"); return computeFlyToLocationForRectangle(rectangle, scene).then(function ( result ) { expect(result).toEqual(expectedResult); expect( computeFlyToLocationForRectangle._sampleTerrainMostDetailed ).not.toHaveBeenCalled(); }); }); it("returns height above ellipsoid when terrain not available", function () { scene.globe = new Globe(); scene.terrainProvider = new MockTerrainProvider(); var rectangle = new Rectangle(0.2, 0.4, 0.6, 0.8); spyOn(computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed"); var expectedResult = scene.mapProjection.ellipsoid.cartesianToCartographic( scene.camera.getRectangleCameraCoordinates(rectangle) ); return computeFlyToLocationForRectangle(rectangle, scene).then(function ( result ) { expect(result).toEqual(expectedResult); expect( computeFlyToLocationForRectangle._sampleTerrainMostDetailed ).not.toHaveBeenCalled(); }); }); it("waits for terrain to become ready", function () { var terrainProvider = new MockTerrainProvider(); spyOn(terrainProvider.readyPromise, "then").and.callThrough(); scene.globe = new Globe(); scene.terrainProvider = terrainProvider; var rectangle = new Rectangle(0.2, 0.4, 0.6, 0.8); var expectedResult = scene.mapProjection.ellipsoid.cartesianToCartographic( scene.camera.getRectangleCameraCoordinates(rectangle) ); return computeFlyToLocationForRectangle(rectangle, scene).then(function ( result ) { expect(result).toEqual(expectedResult); expect(terrainProvider.readyPromise.then).toHaveBeenCalled(); }); }); it("returns height above ellipsoid when terrain undefined", function () { scene.terrainProvider = undefined; var rectangle = new Rectangle(0.2, 0.4, 0.6, 0.8); spyOn(computeFlyToLocationForRectangle, "_sampleTerrainMostDetailed"); var expectedResult = scene.mapProjection.ellipsoid.cartesianToCartographic( scene.camera.getRectangleCameraCoordinates(rectangle) ); return computeFlyToLocationForRectangle(rectangle, scene).then(function ( result ) { expect(result).toEqual(expectedResult); expect( computeFlyToLocationForRectangle._sampleTerrainMostDetailed ).not.toHaveBeenCalled(); }); }); });
define(function(require, exports, module) { var Notify = require('common/bootstrap-notify'); require("jquery.bootstrap-datetimepicker"); var validator = require('bootstrap.validator'); exports.run = function() { var now = new Date(); $("#startDate").datetimepicker({ autoclose: true }).on('changeDate', function() { $("#endDate").datetimepicker('setStartDate', $("#startDate").val().substring(0, 16)); }); $("#startDate").datetimepicker('setEndDate', $("#endDate").val().substring(0, 16)); $("#endDate").datetimepicker({ autoclose: true }).on('changeDate', function() { $("#startDate").datetimepicker('setEndDate', $("#endDate").val().substring(0, 16)); }); $("#endDate").datetimepicker('setStartDate', $("#startDate").val().substring(0, 16)); if ($("#status").val() == 'end') { $("#endDate").datetimepicker('setEndDate', now); $("#startDate").datetimepicker('setEndDate', now); } if ($("#status").val() == 'coming') { $("#startDate").datetimepicker('setStartDate', now); $("#endDate").datetimepicker('setStartDate', now); //只用开始时间搜,不考虑结束时间 } if ($("#status").val() == 'underway') { $("#startDate").datetimepicker('setEndDate', now); $("#endDate").datetimepicker('setStartDate', now); } // .datetimepicker('setEndDate' 可视为< // .datetimepicker('setStartDate' 可视为> $('#course-table').on('click', 'tbody tr span ', function() { $.get($(this).parent().data('url'), function(data) { $('#course-table tbody tr td')[4].innerHTML = data.maxOnlineNum; }); }); }; });
/* Copyright 2016 Mozilla Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ import { put, apply } from 'redux-saga/effects'; import { infallible, takeLatestMultiple } from '../../shared/util/saga-util'; import userAgentHttpClient from '../../../shared/user-agent-http-client'; import * as EffectTypes from '../constants/effect-types'; import * as MainActions from '../actions/main-actions'; export default function*() { yield takeLatestMultiple({ infallible, logger: console }, [EffectTypes.FETCH_HISTORY, fetchHistory], [EffectTypes.FETCH_STARS, fetchStars], ); } export function* fetchHistory({ query, limit }) { const visitedPages = query ? yield apply(userAgentHttpClient, userAgentHttpClient.query, [{ limit, text: query, snippetSize: 'large', }]) : yield apply(userAgentHttpClient, userAgentHttpClient.visited, [{ limit, }]); yield put(MainActions.showHistory(visitedPages.results)); } export function* fetchStars({ limit }) { const starredItems = yield apply(userAgentHttpClient, userAgentHttpClient.stars, [{ limit, }]); yield put(MainActions.showStars(starredItems.results)); }
/** Copyright 2015 The Chromium Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. **/ require("./trace_code_entry.js"); 'use strict'; global.tr.exportTo('tr.e.importer', function() { // This code is a tracification of: // devtools/front_end/timeline/TimelineJSProfile.js function TraceCodeMap() { this.banks_ = new Map(); } TraceCodeMap.prototype = { addEntry: function(addressHex, size, name, scriptId) { var entry = new tr.e.importer.TraceCodeEntry( this.getAddress_(addressHex), size, name, scriptId); this.addEntry_(addressHex, entry); }, moveEntry: function(oldAddressHex, newAddressHex, size) { var entry = this.getBank_(oldAddressHex) .removeEntry(this.getAddress_(oldAddressHex)); if (!entry) return; entry.address = this.getAddress_(newAddressHex); entry.size = size; this.addEntry_(newAddressHex, entry); }, lookupEntry: function(addressHex) { return this.getBank_(addressHex) .lookupEntry(this.getAddress_(addressHex)); }, addEntry_: function(addressHex, entry) { // FIXME: Handle bank spanning addresses ... this.getBank_(addressHex).addEntry(entry); }, getAddress_: function(addressHex) { // 13 hex digits == 52 bits, double mantissa fits 53 bits. var bankSizeHexDigits = 13; addressHex = addressHex.slice(2); // cut 0x prefix. return parseInt(addressHex.slice(-bankSizeHexDigits), 16); }, getBank_: function(addressHex) { addressHex = addressHex.slice(2); // cut 0x prefix. // 13 hex digits == 52 bits, double mantissa fits 53 bits. var bankSizeHexDigits = 13; var maxHexDigits = 16; var bankName = addressHex.slice(-maxHexDigits, -bankSizeHexDigits); var bank = this.banks_.get(bankName); if (!bank) { bank = new TraceCodeBank(); this.banks_.set(bankName, bank); } return bank; } }; function TraceCodeBank() { this.entries_ = []; } TraceCodeBank.prototype = { removeEntry: function(address) { // findLowIndexInSortedArray returns 1 for empty. Just handle the // empty list and bail early. if (this.entries_.length === 0) return undefined; var index = tr.b.findLowIndexInSortedArray( this.entries_, function(entry) { return entry.address; }, address); var entry = this.entries_[index]; if (!entry || entry.address !== address) return undefined; this.entries_.splice(index, 1); return entry; }, lookupEntry: function(address) { var index = tr.b.findHighIndexInSortedArray( this.entries_, function(e) { return address - e.address; }) - 1; var entry = this.entries_[index]; return entry && address < entry.address + entry.size ? entry : undefined; }, addEntry: function(newEntry) { // findLowIndexInSortedArray returns 1 for empty list. Just push the // new address as it's the only item. if (this.entries_.length === 0) this.entries_.push(newEntry); var endAddress = newEntry.address + newEntry.size; var lastIndex = tr.b.findLowIndexInSortedArray( this.entries_, function(entry) { return entry.address; }, endAddress); var index; for (index = lastIndex - 1; index >= 0; --index) { var entry = this.entries_[index]; var entryEndAddress = entry.address + entry.size; if (entryEndAddress <= newEntry.address) break; } ++index; this.entries_.splice(index, lastIndex - index, newEntry); } }; return { TraceCodeMap: TraceCodeMap }; });
/** * for(var p in Script.scripts) { * * var script = Script.scripts[p]; * var handle = script.handle; * var base = script.base; * var limit = base + script.extent; * * print(script+"\n"); * * for(var i = base; i < limit; i++) { * var pc = jsd.GetClosestPC(handle,i) * var hascode = String(pc).length && i == jsd.GetClosestLine(handle,pc); * print("line "+i+" "+ (hascode ? "has code" : "has NO code")); * } * print("...............................\n"); * } */ function rlocals() { var retval = ""; var name = "___UNIQUE_NAME__"; var fun = ""+ "var text = \\\"\\\";"+ "for(var p in ob)"+ "{"+ " if(text != \\\"\\\")"+ " text += \\\",\\\";"+ " text += p;"+ "}"+ "return text;"; reval(name+" = new Function(\"ob\",\""+fun+"\")"); // show(name); retval = _reval([name+"("+"arguments.callee"+")"]); reval("delete "+name); return retval; } function e(a) { return eval(a); }
/* * Copyright 2015 The Closure Compiler Authors. * * 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. */ goog.module('$jscomp_object_test'); goog.setTestOnly(); const jsunit = goog.require('goog.testing.jsunit'); const testSuite = goog.require('goog.testing.testSuite'); const testing = goog.require('testing'); const assertDeepEquals = testing.assertDeepEquals; testSuite({ testAssertDeepEquals() { // Quick sanity check, since we don't unit test assertDeepEquals assertDeepEquals({a: 4}, {a: 4}); assertThrowsJsUnitException(() => assertDeepEquals({}, {a: 4})); assertThrowsJsUnitException(() => assertDeepEquals({a: 4}, {})); }, testAssign_simple() { const obj = {a: 2, z: 3}; assertEquals(obj, Object.assign(obj, {a: 4, b: 5}, null, {c: 6, b: 7})); assertDeepEquals({a: 4, b: 7, c: 6, z: 3}, obj); }, testAssign_skipsPrototypeProperties() { if (!Object.create) return; const proto = {a: 4, b: 5}; const from = Object.create(proto); from.a = 6; from.c = 7; assertDeepEquals({a: 6, c: 7}, Object.assign({}, from)); assertDeepEquals({a: 6, b: 1, c: 7}, Object.assign({b: 1}, from)); }, testAssign_skipsNonEnumerableProperties() { const from = {'b': 23}; try { Object.defineProperty(from, 'a', {enumerable: false, value: 42}); } catch (err) { return; // Object.defineProperty in IE8 test harness exists, always fails } assertDeepEquals({'b': 23}, Object.assign({}, from)); assertDeepEquals({'a': 1, 'b': 23}, Object.assign({'a': 1}, from)); }, testIs() { assertTrue(Object.is(4, 4)); assertTrue(Object.is(0, 0)); assertTrue(Object.is('4', '4')); assertTrue(Object.is('', '')); assertTrue(Object.is(true, true)); assertTrue(Object.is(false, false)); assertTrue(Object.is(null, null)); assertTrue(Object.is(undefined, undefined)); assertTrue(Object.is(NaN, NaN)); const obj = {}; assertTrue(Object.is(obj, obj)); assertFalse(Object.is(0, -0)); assertFalse(Object.is({}, {})); assertFalse(Object.is(4, '4')); assertFalse(Object.is(null, void 0)); assertFalse(Object.is(1, true)); assertFalse(Object.is(0, false)); assertFalse(Object.is('', false)); } });
export { default } from 'ember-osf/components/search-facet-source/component';
// 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. couchTests.purge = function(debug) { var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"}); db.deleteDb(); db.createDb(); if (debug) debugger; /* purge is not to be confused with a document deletion. It removes the document and all edit history from the local instance of the database. */ var numDocs = 10; var designDoc = { _id:"_design/test", language: "javascript", views: { all_docs_twice: {map: "function(doc) { emit(doc.integer, null); emit(doc.integer, null) }"}, single_doc: {map: "function(doc) { if (doc._id == \"1\") { emit(1, null) }}"} } }; T(db.save(designDoc).ok); db.bulkSave(makeDocs(1, numDocs + 1)); // go ahead and validate the views before purging var rows = db.view("test/all_docs_twice").rows; for (var i = 0; i < numDocs; i++) { T(rows[2*i].key == i+1); T(rows[(2*i)+1].key == i+1); } T(db.view("test/single_doc").total_rows == 1); var info = db.info(); var doc1 = db.open("1"); var doc2 = db.open("2"); // purge the documents var xhr = CouchDB.request("POST", "/test_suite_db/_purge", { body: JSON.stringify({"1":[doc1._rev], "2":[doc2._rev]}) }); T(xhr.status == 200); var result = JSON.parse(xhr.responseText); var newInfo = db.info(); // purging increments the update sequence T(info.update_seq+1 == newInfo.update_seq); // and it increments the purge_seq T(info.purge_seq+1 == newInfo.purge_seq); T(result.purge_seq == newInfo.purge_seq); T(result.purged["1"][0] == doc1._rev); T(result.purged["2"][0] == doc2._rev); T(db.open("1") == null); T(db.open("2") == null); var rows = db.view("test/all_docs_twice").rows; for (var i = 2; i < numDocs; i++) { T(rows[2*(i-2)].key == i+1); T(rows[(2*(i-2))+1].key == i+1); } T(db.view("test/single_doc").total_rows == 0); // purge documents twice in a row without loading views // (causes full view rebuilds) var doc3 = db.open("3"); var doc4 = db.open("4"); xhr = CouchDB.request("POST", "/test_suite_db/_purge", { body: JSON.stringify({"3":[doc3._rev]}) }); T(xhr.status == 200); xhr = CouchDB.request("POST", "/test_suite_db/_purge", { body: JSON.stringify({"4":[doc4._rev]}) }); T(xhr.status == 200); result = JSON.parse(xhr.responseText); T(result.purge_seq == db.info().purge_seq); var rows = db.view("test/all_docs_twice").rows; for (var i = 4; i < numDocs; i++) { T(rows[2*(i-4)].key == i+1); T(rows[(2*(i-4))+1].key == i+1); } T(db.view("test/single_doc").total_rows == 0); };
// Copyright (C) 2015 the V8 project authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- description: > The value of the [[Prototype]] internal slot of the GeneratorFunction prototype object is the FunctionPrototype intrinsic object. es6id: 25.2.2.2 ---*/ function f() {} var g = function*() {}; assert.sameValue( Object.getPrototypeOf(Object.getPrototypeOf(g)), Object.getPrototypeOf(f) );
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: > The String.prototype.toLocaleLowerCase.length property has the attribute ReadOnly es5id: 15.5.4.17_A10 description: > Checking if varying the String.prototype.toLocaleLowerCase.length property fails includes: [propertyHelper.js] ---*/ ////////////////////////////////////////////////////////////////////////////// //CHECK#1 if (!(String.prototype.toLocaleLowerCase.hasOwnProperty('length'))) { $ERROR('#1: String.prototype.toLocaleLowerCase.hasOwnProperty(\'length\') return true. Actual: '+String.prototype.toLocaleLowerCase.hasOwnProperty('length')); } // ////////////////////////////////////////////////////////////////////////////// var __obj = String.prototype.toLocaleLowerCase.length; verifyNotWritable(String.prototype.toLocaleLowerCase, "length", null, function(){return "shifted";}); ////////////////////////////////////////////////////////////////////////////// //CHECK#2 if (String.prototype.toLocaleLowerCase.length !== __obj) { $ERROR('#2: __obj = String.prototype.toLocaleLowerCase.length; String.prototype.toLocaleLowerCase.length = function(){return "shifted";}; String.prototype.toLocaleLowerCase.length === __obj. Actual: '+String.prototype.toLocaleLowerCase.length ); } // //////////////////////////////////////////////////////////////////////////////
var searchData= [ ['gamepad_20axes',['Gamepad axes',['../group__gamepad__axes.html',1,'']]], ['gamepad_20buttons',['Gamepad buttons',['../group__gamepad__buttons.html',1,'']]] ];
require('babel/register'); var pm2 = require('pm2'); pm2.connect(function() { pm2.start({ name: 'server', script: 'server/server.js', 'exec_mode': 'cluster', instances: '2', 'max_memory_restart': '900M' }, function() { pm2.disconnect(); }); });
// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. Polymer({ is: 'viewer-error-screen', properties: { text: String, reloadFn: { type: Object, value: null, } }, show: function() { this.$.dialog.open(); }, reload: function() { if (this.reloadFn) this.reloadFn(); } });
/* table reflow widget for TableSorter 2/7/2015 (v2.19.0) * Requires tablesorter v2.8+ and jQuery 1.7+ * Also, this widget requires the following default css (modify as desired) / * REQUIRED CSS: change your reflow breakpoint here (35em below) * / @media ( max-width: 35em ) { .ui-table-reflow td, .ui-table-reflow th { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; float: right; / * if not using the stickyHeaders widget (not the css3 version) * the "!important" flag, and "height: auto" can be removed * / width: 100% !important; height: auto !important; } / * reflow widget * / .ui-table-reflow tbody td[data-title]:before { color: #469; font-size: .9em; content: attr(data-title); float: left; width: 50%; white-space: pre-wrap; text-align: bottom; display: inline-block; } / * reflow2 widget * / table.ui-table-reflow .ui-table-cell-label.ui-table-cell-label-top { display: block; padding: .4em 0; margin: .4em 0; text-transform: uppercase; font-size: .9em; font-weight: 400; } table.ui-table-reflow .ui-table-cell-label { padding: .4em; min-width: 30%; display: inline-block; margin: -.4em 1em -.4em -.4em; } } .ui-table-reflow .ui-table-cell-label { display: none; } */ /*jshint browser:true, jquery:true, unused:false */ /*global jQuery: false */ ;(function($){ "use strict"; var ts = $.tablesorter, tablereflow = { // simple reflow // add data-attribute to each cell which shows when media query is active // this widget DOES NOT WORK on a table with multiple thead rows init : function(table, c, wo) { var $this, title = wo.reflow_dataAttrib, header = wo.reflow_headerAttrib, headers = []; c.$table .addClass(wo.reflow_className) .off('refresh.tsreflow updateComplete.tsreflow2') // emulate jQuery Mobile refresh // https://api.jquerymobile.com/table-reflow/#method-refresh .on('refresh.tsreflow updateComplete.tsreflow2', function(){ tablereflow.init(table, c, wo); }); c.$headers.each(function(){ $this = $(this); headers.push( $.trim( $this.attr(header) || $this.text() ) ); }); c.$tbodies.children().each(function(){ $(this).children().each(function(i){ $(this).attr(title, headers[i]); }); }); }, init2: function(table, c, wo) { var $this, $tbody, i, $hdr, txt, len, cols = c.columns, header = wo.reflow2_headerAttrib, headers = []; c.$table .addClass(wo.reflow2_className) .off('refresh.tsreflow2 updateComplete.tsreflow2') // emulate jQuery Mobile refresh // https://api.jquerymobile.com/table-reflow/#method-refresh .on('refresh.tsreflow2 updateComplete.tsreflow2', function(){ tablereflow.init2(table, c, wo); }); // add <b> to every table cell with thead cell contents for (i = 0; i < cols; i++) { $hdr = c.$headers.filter('[data-column="' + i + '"]'); if ($hdr.length > 1) { txt = []; /*jshint loopfunc:true */ $hdr.each(function(){ $this = $(this); if (!$this.hasClass(wo.reflow2_classIgnore)) { txt.push( $this.attr(header) || $this.text() ); } }); } else { txt = [ $hdr.attr(header) || $hdr.text() ]; } headers.push( txt ); } // include "remove-me" class so these additional elements are removed before updating txt = '<b class="' + c.selectorRemove.slice(1) + ' ' + wo.reflow2_labelClass; c.$tbodies.children().each(function(){ $tbody = ts.processTbody(table, $(this), true); $tbody.children().each(function(j){ $this = $(this); len = headers[j].length; i = len - 1; while (i >= 0) { $this.prepend(txt + (i === 0 && len > 1 ? ' ' + wo.reflow2_labelTop : '') + '">' + headers[j][i] + '</b>'); i--; } }); ts.processTbody(table, $tbody, false); }); }, remove : function(table, c, wo) { c.$table.removeClass(wo.reflow_className); }, remove2 : function(table, c, wo) { c.$table.removeClass(wo.reflow2_className); } }; ts.addWidget({ id: "reflow", options: { // class name added to make it responsive (class name within media query) reflow_className : 'ui-table-reflow', // header attribute containing modified header name reflow_headerAttrib : 'data-name', // data attribute added to each tbody cell reflow_dataAttrib : 'data-title' }, init: function(table, thisWidget, c, wo) { tablereflow.init(table, c, wo); }, remove: function(table, c, wo){ tablereflow.remove(table, c, wo); } }); ts.addWidget({ id: "reflow2", options: { // class name added to make it responsive (class name within media query) reflow2_className : 'ui-table-reflow', // ignore header cell content with this class name reflow2_classIgnore : 'ui-table-reflow-ignore', // header attribute containing modified header name reflow2_headerAttrib : 'data-name', // class name applied to thead labels reflow2_labelClass : 'ui-table-cell-label', // class name applied to first row thead label reflow2_labelTop : 'ui-table-cell-label-top' }, init: function(table, thisWidget, c, wo) { tablereflow.init2(table, c, wo); }, remove: function(table, c, wo){ tablereflow.remove2(table, c, wo); } }); })(jQuery);
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: > If thisArg is null or undefined, the called function is passed the global object as the this value es5id: 15.3.4.4_A3_T9 description: Checking by using eval, argument at call function is void 0 ---*/ eval( " Function(\"this.feat=1\").call(void 0) " ); //CHECK#1 if (this["feat"] !== 1) { $ERROR('#1: If thisArg is null or undefined, the called function is passed the global object as the this value'); }
'use strict'; /** * This module contains a variety of generic promise wrapped `node.child_process.spawn` commands * @module childProcess */ const R = require('ramda'); const Q = require('q'); /** this is not a constant for unit testing purposes */ let spawn = require('child_process').spawn; const util = require('../util'); module.exports = { output, quiet, stream, inherit, stdin }; /** * @param {string} command * @param {string} args * @returns {string} */ function commandStr(command, args) { return `${command} ${args.join(' ')}`; } /** * @param {string} command * @param {string} args * @param {string|number} code * @returns {string} */ function successString(command, args, code) { return `${commandStr(command, args)} Process Exited: ${code}`; } /** * @param {string} command * @param {string} args * @param {string|number} code * @param {string=} stderr * @returns {string} */ function failString(command, args, code, stderr) { stderr = stderr || ''; return `${commandStr(command, args)} terminated with exit code: ${code} ` + stderr; } /** * @param {string} command * @param {string[]} args * @param {number} code * @param {string=} stderr * @returns {Error} */ function failError(command, args, code, stderr) { util.verbose('Failed: ', command, args, code, stderr); code = parseInt(code, 10); stderr = stderr || ''; const errString = failString(command, args, code, stderr); const e = new Error(errString); e.code = code; return e; } /** * Resolves stdout, rejects with stderr, also streams * @param {string} command * @param {Array.<string>=} args * @param {Object=} opts * @returns {Promise<string>} */ function output(command, args, opts) { args = args || []; const options = R.merge({}, opts); const d = Q.defer(); const child = spawn(command, args, options); let stdout = ''; let stderr = ''; child.stdout.setEncoding('utf8'); child.stderr.setEncoding('utf8'); child.stdout.on('data', (data) => { d.notify({ stdout: data }); stdout += data; }); child.stderr.on('data', (data) => { d.notify({ stderr: data }); stderr += data; }); child.on('close', (code) => { if (+code) { d.reject(failError(command, args, code, stderr)); } else { util.verbose(successString(command, args, code)); d.resolve(stdout.trim()); } }); child.stdin.end(); return d.promise; } /** * Does not resolve stdout, but streams, and resolves stderr * @param {string} command * @param {Array.<string>=} args * @param {Object=} opts * @returns {Promise} */ function quiet(command, args, opts) { args = args || []; const options = R.merge({}, opts); const d = Q.defer(); const child = spawn(command, args, options); let stderr = ''; child.stderr.setEncoding('utf8'); child.stdout.on('data', (data) => { d.notify({ stdout: data }); }); child.stderr.on('data', (data) => { d.notify({ stderr: data }); stderr += data; }); child.on('close', (code) => { if (+code) { d.reject(failError(command, args, code, stderr)); } else { util.verbose(successString(command, args, code)); d.resolve(); } }); child.stdin.end(); return d.promise; } /** * Only streams stdout/stderr, no output on resolve/reject * @param {string} command * @param {Array.<string>=} args * @param {Object=} opts * @returns {Promise} */ function stream(command, args, opts) { args = args || []; const options = R.merge({}, opts); const d = Q.defer(); const child = spawn(command, args, options); child.stdout.setEncoding('utf8'); child.stderr.setEncoding('utf8'); child.stdout.on('data', (data) => { d.notify({ data: data }); }); child.stderr.on('data', (data) => { d.notify({ error: data }); }); child.on('close', (code) => { if (+code) { d.reject(failError(command, args, code)); } else { util.verbose(successString(command, args, code)); d.resolve(); } }); child.stdin.end(); return d.promise; } /** * Stdio inherits, meaning that the given command takes over stdio * @param {string} command * @param {Array.<string>=} args * @param {Object=} opts * @returns {Promise} */ function inherit(command, args, opts) { args = args || []; const options = R.merge({ stdio: 'inherit' }, opts); const d = Q.defer(); const child = spawn(command, args, options); child.on('close', (code) => { if (+code) { d.reject(failError(command, args, code)); } else { util.verbose(successString(command, args, code)); d.resolve(); } }); return d.promise; } /** * like output, but puts stdin in as stdin * @param {string} stdin * @param {string} command * @param {Array.<string>=} args * @param {Object=} opts * @returns {Promise<string>} */ function stdin(stdin, command, args, opts) { stdin = stdin || ''; args = args || []; const options = R.merge({}, opts); const d = Q.defer(); const child = spawn(command, args, options); let stderr = ''; let stdout = ''; child.stdout.on('data', (data) => { d.notify({ stdout: data }); stdout += data; }); child.stderr.on('data', (data) => { d.notify({ stderr: data }); stderr += data; }); child.on('close', (code) => { if (+code) { d.reject(failError(command, args, code, stderr)); } else { d.resolve(stdout); } }); child.stdin.write(stdin); child.stdin.end(); return d.promise; }
"use strict"; const ICollectionBase = require("./ICollectionBase"); const IGuild = require("./IGuild"); const Utils = require("../core/Utils"); const rest = require("../networking/rest"); /** * @interface * @extends ICollectionBase */ class IGuildCollection extends ICollectionBase { constructor(discordie, valuesGetter, valueGetter) { super({ valuesGetter: valuesGetter, valueGetter: valueGetter, itemFactory: (id) => new IGuild(this._discordie, id) }); this._discordie = discordie; Utils.privatify(this); } /** * Makes a request to create a guild. * @param {String} name * @param {String} region * @param {Buffer|null} [icon] * @param {Array<IRole|Object>} [roles] * @param {Array<IChannel|Object>} [channels] * @param {Number} [verificationLevel] * See Discordie.VerificationLevel * @param {Number} [defaultMessageNotifications] * See Discordie.UserNotificationSettings * @returns {Promise<IGuild, Error>} */ create(name, region, icon, roles, channels, verificationLevel, defaultMessageNotifications) { if (icon instanceof Buffer) { icon = Utils.imageToDataURL(icon); } const toRaw = (data, param) => { data = data || []; if (!Array.isArray(data)) throw TypeError("Param '" + param + "' must be an array"); return data.map(v => { return typeof v.getRaw === "function" ? v.getRaw() : null; }).filter(v => v); }; roles = toRaw(roles, "roles"); channels = toRaw(channels, "channels"); return new Promise((rs, rj) => { rest(this._discordie).guilds.createGuild( name, region, icon, roles, channels, verificationLevel, defaultMessageNotifications ) .then(guild => rs(this._discordie.Guilds.get(guild.id))) .catch(rj); }); } /** * Makes a request to get a default list of voice regions. * Use IGuild.fetchRegions for getting guild-specific list. * @returns {Promise<Array<Object>, Error>} */ fetchRegions() { return rest(this._discordie).voice.getRegions(); } } module.exports = IGuildCollection;
const ButtonBackToTop = FocusComponents.common.button.backToTop.component; const ButtonBTSample = React.createClass({ /** * Render the component. * @return {object} React node */ render() { return ( <div className='button-bt-example'> <img src="http://lorempixel.com/800/600/sports/"/> <img src="http://lorempixel.com/800/600/abstract/"/> <img src="http://lorempixel.com/800/600/city/"/> <img src="http://lorempixel.com/800/600/technics/"/> <img src="http://lorempixel.com/800/600/sports/"/> <img src="http://lorempixel.com/800/600/abstract/"/> <img src="http://lorempixel.com/800/600/city/"/> <img src="http://lorempixel.com/800/600/technics/"/> <ButtonBackToTop /> </div> ); } }); return <ButtonBTSample/>;
'use strict'; module.exports = { authCheck: require('./authcheck'), injectScripts: require('./injectscripts'), debounceName: require('./debounce-name') };
'use strict'; // Setting up route angular.module('usuarios-mobile').config(['$stateProvider', 'RouteHelpersProvider', function($stateProvider, helper) { // Articles state routing $stateProvider. state('app.listUsuariosMobile', { url: '/usuarios-mobile', title: 'Listar Usuários Mobile', templateUrl: 'modules/usuarios-mobile/views/list-usuarios-mobile.client.view.html', resolve: helper.resolveFor('datatables', 'xeditable') }); } ]);
var searchData= [ ['defaultgaussianmixture',['DefaultGaussianMixture',['../namespaceedda_1_1dist.html#a7ac563ae69a0db2921a59877f32c2846',1,'edda::dist']]], ['devicegmmarray',['DeviceGMMArray',['../namespaceedda.html#adf57cb048134c8ba9b3560698eb45a61',1,'edda']]], ['dword',['DWORD',['../bmp__image_8h.html#af483253b2143078cede883fc3c111ad2',1,'bmp_image.h']]] ];
const config = require('../../../server/config'), Manager = require('./manager'), manager = new Manager(); // Responsible for handling requests for sitemap files module.exports = function handler(siteApp) { const verifyResourceType = function verifyResourceType(req, res, next) { if (!Object.prototype.hasOwnProperty.call(manager, req.params.resource)) { return res.sendStatus(404); } next(); }; siteApp.get('/sitemap.xml', function sitemapXML(req, res) { res.set({ 'Cache-Control': 'public, max-age=' + config.get('caching:sitemap:maxAge'), 'Content-Type': 'text/xml' }); res.send(manager.getIndexXml()); }); siteApp.get('/sitemap-:resource.xml', verifyResourceType, function sitemapResourceXML(req, res) { var type = req.params.resource, page = 1; res.set({ 'Cache-Control': 'public, max-age=' + config.get('caching:sitemap:maxAge'), 'Content-Type': 'text/xml' }); res.send(manager.getSiteMapXml(type, page)); }); };
import Koa from 'koa'; import convert from 'koa-convert'; import webpack from 'webpack'; import webpackConfig from '../build/webpack.config'; import historyApiFallback from 'koa-connect-history-api-fallback'; import serve from 'koa-static'; import _debug from 'debug'; import config from '../config'; import webpackProxyMiddleware from './middleware/webpack-proxy'; import webpackDevMiddleware from './middleware/webpack-dev'; import webpackHMRMiddleware from './middleware/webpack-hmr'; const debug = _debug('app:server'); const paths = config.utils_paths; const app = new Koa(); // This rewrites all routes requests to the root /index.html file // (ignoring file requests). If you want to implement isomorphic // rendering, you'll want to remove this middleware. app.use(convert(historyApiFallback({ verbose: false }))); // ------------------------------------ // Apply Webpack HMR Middleware // ------------------------------------ if (config.env === 'development') { const compiler = webpack(webpackConfig); // Enable webpack-dev and webpack-hot middleware const { publicPath } = webpackConfig.output; if (config.proxy && config.proxy.enabled) { const options = config.proxy.options; app.use(convert(webpackProxyMiddleware(options))); } app.use(webpackDevMiddleware(compiler, publicPath)); app.use(webpackHMRMiddleware(compiler)); // Serve static assets from ~/src/static since Webpack is unaware of // these files. This middleware doesn't need to be enabled outside // of development since this directory will be copied into ~/dist // when the application is compiled. app.use(convert(serve(paths.client('static')))); } else { debug( 'Server is being run outside of live development mode. This starter kit ' + 'does not provide any production-ready server functionality. To learn ' + 'more about deployment strategies, check out the "deployment" section ' + 'in the README.' ); // Serving ~/dist by default. Ideally these files should be served by // the web server and not the app server, but this helps to demo the // server in production. app.use(convert(serve(paths.base(config.dir_dist)))); } export default app;
module.exports = require("core-js/library/fn/string/trim");
import { CRUD_GET_LIST_SUCCESS } from '../../../actions/dataActions'; export default resource => (previousState = 0, { type, payload, meta }) => { if (!meta || meta.resource !== resource) { return previousState; } if (type === CRUD_GET_LIST_SUCCESS) { return payload.total; } return previousState; };
'use strict'; var grunt = require('grunt'); /* ======== A Handy Little Nodeunit Reference ======== https://github.com/caolan/nodeunit Test methods: test.expect(numAssertions) test.done() Test assertions: test.ok(value, [message]) test.equal(actual, expected, [message]) test.notEqual(actual, expected, [message]) test.deepEqual(actual, expected, [message]) test.notDeepEqual(actual, expected, [message]) test.strictEqual(actual, expected, [message]) test.notStrictEqual(actual, expected, [message]) test.throws(block, [error], [message]) test.doesNotThrow(block, [error], [message]) test.ifError(value) */ exports.deployments = { setUp: function(done) { // setup here if necessary done(); }, default_options: function(test) { test.expect(1); var actual = grunt.file.read('tmp/default_options'); var expected = grunt.file.read('test/expected/default_options'); test.equal(actual, expected, 'should describe what the default behavior is.'); test.done(); }, custom_options: function(test) { test.expect(1); var actual = grunt.file.read('tmp/custom_options'); var expected = grunt.file.read('test/expected/custom_options'); test.equal(actual, expected, 'should describe what the custom option(s) behavior is.'); test.done(); }, };
var MusicView = React.createClass({ getInitialState: function() { return {album: null} }, render: function() { if (this.state.album){ return ( <div className="musicView" > <h2 className="musicName"> {this.state.album.name} </h2> <h3 className="musicAuthor"> {this.state.album.author} </h3> <img src={this.state.album.thumbnail} width="60"></img> <br/> {this.state.album.summary} <br/> <b>Release date:</b> {this.state.album.rlsdate} <br/> <b>Genre:</b> {this.state.album.genre} <br/> <b>Score:</b> {this.state.album.score} <br/> <b>Link:</b> <a href={this.state.album.url}>{this.state.album.url}</a> <br/> </div> ) }else{ return ( <h2>Click an item to see details</h2> ) } } })
(function($) { $(document).ready(function() { $('.styleswitch').click(function() { switchStylestyle(this.getAttribute("rel")); return false; }); var c = readCookie('style'); if (c) switchStylestyle(c); }); function switchStylestyle(styleName) { $('link[rel*=style][title]').each(function(i) { this.disabled = true; if (this.getAttribute('title') == styleName) this.disabled = false; }); createCookie('style', styleName, 365); } })(jQuery); // Cookie functions function createCookie(name,value,days) { if (days) { var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function eraseCookie(name) { createCookie(name,"",-1); } // Switcher jQuery('.demo_changer .demo-icon').click(function(){ if(jQuery('.demo_changer').hasClass("active")){ jQuery('.demo_changer').animate({"left":"-140px"},function(){ jQuery('.demo_changer').toggleClass("active"); }); }else{ jQuery('.demo_changer').animate({"left":"0px"},function(){ jQuery('.demo_changer').toggleClass("active"); }); } });
const express = require('express') const app = express() const formidable = require('formidable') const path = require('path') const rimraf = require('rimraf') const fs = require('fs') const throttle = require('express-throttle-bandwidth') const port = process.env.PORT || 4444, folder = path.join(__dirname, 'files') if (!fs.existsSync(folder)) { fs.mkdirSync(folder) } else { rimraf.sync(path.join(folder, '*')) } process.on('exit', () => { rimraf.sync(path.join(folder)) }) app.set('port', port) app.use(throttle(1024 * 128)) app.use((_, res, next) => { res.header('Access-Control-Allow-Origin', '*') res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept') next() }) app.post('/upload', (req, res) => { rimraf.sync(path.join(folder, '*')) const form = new formidable.IncomingForm() form.uploadDir = folder form.parse(req, (_, fields, files) => { console.log('\n-----------') console.log('Fields', fields) console.log('Received:', Object.keys(files)) console.log() }) res.send('Thank you') }) app.listen(port, () => { console.log('\nUpload server running on http://localhost:' + port + '/upload') console.log('You can now upload from main dev server using QUploader') })
// Copyright 2009 the Sputnik authors. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- info: > If the argument len is a Number and ToUint32(len) is equal to len, then the length property of the newly constructed object is set to ToUint32(len) es5id: 15.4.2.2_A2.1_T1 description: Array constructor is given one argument ---*/ //CHECK#1 var x = new Array(0); if (x.length !== 0) { $ERROR('#1: var x = new Array(0); x.length === 0. Actual: ' + (x.length)); } //CHECK#2 var x = new Array(1); if (x.length !== 1) { $ERROR('#2: var x = new Array(1); x.length === 1. Actual: ' + (x.length)); } //CHECK#3 var x = new Array(4294967295); if (x.length !== 4294967295) { $ERROR('#3: var x = new Array(4294967295); x.length === 4294967295. Actual: ' + (x.length)); }
/** * React Starter Kit (https://www.reactstarterkit.com/) * * Copyright © 2014-2016 Kriasoft, LLC. All rights reserved. * * This source code is licensed under the MIT license found in the * LICENSE.txt file in the root directory of this source tree. */ import React, { PropTypes } from 'react'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './Content.css'; function Content({ path, title, content }) { return ( <div className={s.root}> <div className={s.container}> {title && path !== '/' && <h1>{title}</h1>} <div dangerouslySetInnerHTML={{ __html: content }} /> </div> </div> ); } Content.propTypes = { path: PropTypes.string.isRequired, content: PropTypes.string.isRequired, title: PropTypes.string, }; export default withStyles(s)(Content);
/* Template Name: Color Admin - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.5 Version: 1.9.0 Author: Sean Ngu Website: http://www.seantheme.com/color-admin-v1.9/admin/ */ var handleDataTableResponsive = function() { "use strict"; if ($('#data-table').length !== 0) { $('#data-table').DataTable({ responsive: true }); } }; var TableManageResponsive = function () { "use strict"; return { //main function init: function () { handleDataTableResponsive(); } }; }();
// @flow import { createPopper, popperGenerator, detectOverflow } from './createPopper'; export type * from './types'; // eslint-disable-next-line import/no-unused-modules export { createPopper, popperGenerator, detectOverflow };
module.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), meta: { banner : '/*!\n' + ' * <%= pkg.title %> v<%= pkg.version %> - <%= pkg.description %>\n' + ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> - <%= pkg.homepage %>\n' + ' * License: <%= pkg.license %>\n' + ' */\n\n' }, uglify: { options : { banner : '<%= meta.banner %>', report: 'gzip' }, dist: { files: { 'jquery.timepicker.min.js': ['jquery.timepicker.js'] } } }, cssmin: { minify: { files: { 'jquery.timepicker.min.css': ['jquery.timepicker.css'] } } } }); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.registerTask('default', ['uglify', 'cssmin']); };
var vows = require('vows'), _ = require('underscore')._, RawTests = require('./selenium.vows'); // makeSuite takes a configuration and makes a batch of tests, splitting // up tests according to 'conf.processes' exports.makeSuite = function(conf) { var getCapText = function(conf, cap) { return " (" + cap.browserName+"_"+cap.version+"_"+cap.platform+"_"+conf.serviceName+")"; }; // gets a version of the testbase relativized to a particular config // and capability request var getTestsForCap = function(cap) { var capText = getCapText(conf, cap); var allTests = RawTests.allTests(conf, cap, capText); var capTests = {}; // Replace the name of each test with a relativized name showing // which conf and caps we are using _.each(allTests, function(test, testName) { capTests[testName+capText] = test; }); return capTests; }; // Gather tests for all capabilities requests into one big dict var allTests = {}; _.each(conf.caps, function(cap) { var tests = getTestsForCap(cap); _.each(tests, function(test, testName) { allTests[testName] = test; }); }); // Split tests into batches according to how parallelized we want to be var numTests = _.size(allTests); if (conf.maxTests && conf.maxTests < numTests) { numTests = conf.maxTests; } var numBatches = Math.ceil(numTests / conf.processes); if (numBatches >= 1) { var batches = {}; var testsPerBatch = numBatches * conf.processes; var i = 0; var total = 0; _.each(allTests, function(test, testName) { if (!conf.maxTests || total < conf.maxTests) { if (typeof batches[i] === 'undefined') { batches[i] = {}; } batches[i][testName] = test; if (i < numBatches - 1) { i++; } else { i = 0; } total++; } }); return batches; } };
// closure to avoid namespace collision (function(){ var edTest = ''; // creates the plugin tinymce.create('tinymce.plugins.js_columns', { init : function(ed, url) { ed.addButton('js_columns_button', { title : 'Add Column', image : url+'/icon_columns.png', onclick : function() { // triggers the thickbox var width = jQuery(window).width(), H = jQuery(window).height(), W = ( 720 < width ) ? 720 : width; W = W - 80; H = H - 84; edTest = ed; tb_show( 'Add Column', '#TB_inline?width=' + W + '&height=' + H + '&inlineId=js_columns-form' ); } }); }, createControl : function(n, cm) { return null; }, }); // registers the plugin. DON'T MISS THIS STEP!!! tinymce.PluginManager.add('js_columns', tinymce.plugins.js_columns); // executes this when the DOM is ready jQuery(function(){ // creates a form to be displayed everytime the button is clicked // you should achieve this using AJAX instead of direct html code like this var form = jQuery('<div id="js_columns-form"><div class="shortcode-form">\ <h2>Add Column</h2>\ <table id="js_columns-table" class="form-table">\ <tr>\ <th><label for="js_columns-size">Column Size</label></th>\ <td><select name="size" id="js_columns-size">\ <option value="one_third">One Third (1/3)</option>\ <option value="two_third">Two Thirds (2/3)</option>\ <option value="one_half">One Half (1/2)</option>\ <option value="one_fourth">One Fourth (1/4)</option>\ <option value="three_fourth">Three Fourths (3/4)</option>\ <option value="one_fifth">One Fifth (1/5)</option>\ <option value="two_fifth">Two Fifths (2/5)</option>\ <option value="three_fifth">Three Fifths (3/5)</option>\ <option value="four_fifth">Four Fifths (4/5)</option>\ <option value="one_sixth">One Sixth (1/6)</option>\ <option value="five_sixth">Five Sixths (5/6)</option>\ </select><br />\ <small>Specify a column size to use.</small></td>\ </tr>\ <tr>\ <th><label>Is this the last column in the row?</label></th>\ <td><input type="checkbox" name="last" id="js_columns-last" value="1" /> <label for="js_columns-last">Last Column</label><br />\ <small>Check this to end a row of columns.</small>\ </tr>\ </table>\ <p class="submit">\ <input type="button" id="js_columns-submit" class="button-primary" value="Add Column" name="submit" />\ </p>\ </div></div>'); var table = form.find('table'); form.appendTo('body').hide(); // handles the click event of the submit button form.find('#js_columns-submit').click(function(){ // defines the options and their default values // again, this is not the most elegant way to do this // but well, this gets the job done nonetheless var options = { 'size' : '', 'last' : '' }; for( var index in options) { var currentInput = table.find('#js_columns-' + index); var type = currentInput.attr('type'); if (index == 'size'){ var value = currentInput.val(); var shortcode = '['+value; } if (index == 'last'){ if (currentInput.is(':checked')){ shortcode += '_last'; } } } var selectedContent = tinyMCE.activeEditor.selection.getContent(); shortcode += ']'; endShortcode = shortcode.replace('[','[/'); shortcode += '<p>' + selectedContent + '</p>'; shortcode += endShortcode; // inserts the shortcode into the active editor tinyMCE.activeEditor.execCommand('mceInsertContent', 0, shortcode); // closes Thickbox tb_remove(); }); }); })()
/*! * VisualEditor ContentEditable View class. * * @copyright 2011-2014 VisualEditor Team and others; see http://ve.mit-license.org */ /** * Generic base class for CE views. * * @abstract * @extends OO.ui.Element * @mixins OO.EventEmitter * * @constructor * @param {ve.dm.Model} model Model to observe * @param {Object} [config] Configuration options */ ve.ce.View = function VeCeView( model, config ) { // Setting this property before calling the parent constructor allows overridden #getTagName // methods in view classes to have access to the model when they are called for the first time // inside of OO.ui.Element this.model = model; // Parent constructor OO.ui.Element.call( this, config ); // Mixin constructors OO.EventEmitter.call( this ); // Properties this.live = false; // Events this.connect( this, { setup: 'onSetup', teardown: 'onTeardown' } ); // Initialization this.renderAttributes(); }; /* Inheritance */ OO.inheritClass( ve.ce.View, OO.ui.Element ); OO.mixinClass( ve.ce.View, OO.EventEmitter ); /* Events */ /** * @event setup */ /** * @event teardown */ /* Static members */ /** * Allowed attributes for DOM elements, in the same format as ve.dm.Model#storeHtmlAttributes * * This list includes attributes that are generally safe to include in HTML loaded from a * foreign source and displaying it inside the browser. It doesn't include any event attributes, * for instance, which would allow arbitrary JavaScript execution. This alone is not enough to * make HTML safe to display, but it helps. * * TODO: Rather than use a single global list, set these on a per-view basis to something that makes * sense for that view in particular. * * @static * @property {boolean|string|RegExp|Array|Object} * @inheritable */ ve.ce.View.static.renderHtmlAttributes = [ 'abbr', 'about', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellpadding', 'cellspacing', 'char', 'charoff', 'cite', 'class', 'clear', 'color', 'colspan', 'datatype', 'datetime', 'dir', 'face', 'frame', 'headers', 'height', 'href', 'id', 'itemid', 'itemprop', 'itemref', 'itemscope', 'itemtype', 'lang', 'noshade', 'nowrap', 'property', 'rbspan', 'rel', 'resource', 'rev', 'rowspan', 'rules', 'scope', 'size', 'span', 'src', 'start', 'style', 'summary', 'title', 'type', 'typeof', 'valign', 'value', 'width' ]; /* Methods */ /** * Get an HTML document from the model, to use for URL resolution. * * The default implementation returns null; subclasses should override this if they can provide * a resolution document. * * @see #getResolvedAttribute * @returns {HTMLDocument|null} HTML document to use for resolution, or null if not available */ ve.ce.View.prototype.getModelHtmlDocument = function () { return null; }; /** * Handle setup event. * * @method */ ve.ce.View.prototype.onSetup = function () { this.$element.data( 'view', this ); }; /** * Handle teardown event. * * @method */ ve.ce.View.prototype.onTeardown = function () { this.$element.removeData( 'view' ); }; /** * Get the model the view observes. * * @method * @returns {ve.dm.Model} Model the view observes */ ve.ce.View.prototype.getModel = function () { return this.model; }; /** * Check if the view is attached to the live DOM. * * @method * @returns {boolean} View is attached to the live DOM */ ve.ce.View.prototype.isLive = function () { return this.live; }; /** * Set live state. * * @method * @param {boolean} live The view has been attached to the live DOM (use false on detach) * @fires setup * @fires teardown */ ve.ce.View.prototype.setLive = function ( live ) { this.live = live; if ( this.live ) { this.emit( 'setup' ); } else { this.emit( 'teardown' ); } }; /** * Check if the node is inside a contentEditable node * * @return {boolean} Node is inside a contentEditable node */ ve.ce.View.prototype.isInContentEditable = function () { var node = this.$element[0].parentNode; while ( node && node.contentEditable === 'inherit' ) { node = node.parentNode; } return !!( node && node.contentEditable === 'true' ); }; /** * Render an HTML attribute list onto this.$element * * If no attributeList is given, the attribute list stored in the linear model will be used. * * @param {Object[]} [attributeList] HTML attribute list, see ve.dm.Converter#buildHtmlAttributeList */ ve.ce.View.prototype.renderAttributes = function ( attributeList ) { ve.dm.Converter.renderHtmlAttributeList( attributeList || this.model.getHtmlAttributes(), this.$element, this.constructor.static.renderHtmlAttributes, true // computed attributes ); }; /** * Get a resolved URL from a model attribute. * * @abstract * @method * @param {string} key Attribute name whose value is a URL * @returns {string} URL resolved according to the document's base */ ve.ce.View.prototype.getResolvedAttribute = function ( key ) { var plainValue = this.model.getAttribute( key ), doc = this.getModelHtmlDocument(); return doc && typeof plainValue === 'string' ? ve.resolveUrl( plainValue, doc ) : plainValue; };
import React from "react"; import PropTypes from "prop-types"; import Box from "grommet/components/Box"; import Heading from "grommet/components/Heading"; import Anchor from "../partials/Anchor"; import Label from "grommet/components/Label"; import Paragraph from "grommet/components/Paragraph"; import LinkIcon from "grommet/components/icons/base/Link"; import ApiIcon from "./img/api.svg"; import CultureIcon from "./img/cultures.svg"; import TerminalIcon from "./img/terminal.svg"; class Documentation extends React.Component { render() { return ( <span ref={this.props.scrollToRef}> <Box colorIndex="neutral-1" style={{}} pad="medium" align="center" justify="center" > <Box colorIndex="neutral-1" align="center" margin="large"> <Heading>Documentation</Heading> </Box> <Box margin={{ top: "large", bottom: "large" }} direction="row" flex justify="between" pad={{ vertical: "medium" }} size={{ width: "xxlarge" }} responsive={false} > <Box> <Box flex={false} size={{ width: "small", height: "medium" }} justify="between" colorIndex="neutral-1" align="center" > <Box margin={{ bottom: "medium" }}> <CultureIcon height="50px" /> </Box> <Heading tag="h2">User Guide</Heading> <Paragraph align="center"> Find out how you can use the CAP service to capture, preserve and reuse your analysis through user guides and stories. </Paragraph> <Anchor href="/docs/general/" target="_blank"> <Box pad="small" colorIndex="neutral-1-a" separator="all"> <Label margin="none"> General Docs <LinkIcon size="xsmall" /> </Label> </Box> </Anchor> </Box> </Box> <Box> <Box align="center" flex={false} size={{ width: "small", height: "medium" }} justify="between" margin={{ horizontal: "medium" }} > <Box margin={{ bottom: "medium" }}> <TerminalIcon height="50px" /> </Box> <Heading tag="h2">CLI Client</Heading> <Paragraph align="center"> Learn how to interact with your analysis workspace via the command line interface, to make the preservation process part of your everyday work. </Paragraph> <Anchor href="/docs/cli/" target="_blank"> <Box pad="small" colorIndex="neutral-1-a" separator="all"> <Label margin="none"> CAP-client Guide <LinkIcon size="xsmall" /> </Label> </Box> </Anchor> </Box> </Box> <Box> <Box align="center" flex={false} size={{ width: "small", height: "medium" }} justify="between" > <Box margin={{ bottom: "medium" }}> <ApiIcon height="50px" /> </Box> <Heading tag="h2">RESTful API</Heading> <Paragraph align="center"> Try using our RESTful interface, to integrate CAP with your daily tools and services using HTTP requests. </Paragraph> <Anchor href="/docs/api/" target="_blank"> <Box pad="small" colorIndex="neutral-1-a" separator="all"> <Label margin="none"> API Guides & Docs <LinkIcon size="xsmall" /> </Label> </Box> </Anchor> </Box> </Box> </Box> </Box> </span> ); } } Documentation.propTypes = { scrollToRef: PropTypes.oneOfType([ PropTypes.func, PropTypes.shape({ current: PropTypes.instanceOf(Element) }) ]) }; export default Documentation;
<?php /** * @package EasySocial * @copyright Copyright (C) 2010 - 2014 Stack Ideas Sdn Bhd. All rights reserved. * @license Proprietary Use License http://stackideas.com/licensing.html * @author Stack Ideas Sdn Bhd */ defined( '_JEXEC' ) or die( 'Unauthorized Access' ); ?> EasySocial.require() .script( 'admin/grid/grid' ) .done(function($) { $( '[data-table-grid]' ).implement( EasySocial.Controller.Grid ); });
/** * The abbr dialog definition. * * Created out of the CKEditor Plugin SDK: * http://docs.ckeditor.com/#!/guide/plugin_sdk_sample_1 */ // Our dialog definition. CKEDITOR.dialog.add( 'map_sc_generatorDialog', function( editor ) { return { // Basic properties of the dialog window: title, minimum size. title: 'Map Shortcode Generator', minWidth: 400, minHeight: 300, // Dialog window contents definition. contents: [ { // Definition of the Basic Settings dialog tab (page). id: 'tab-settings', label: 'Map Settings', // The tab contents. elements: [ { // Text input for map url. type: 'textarea', id: 'map-url', label: 'Map Embed Code', // Validation checking whether the field is not empty. validate: CKEDITOR.dialog.validate.notEmpty( "Map URL field cannot be empty" ) }, { // Select input for map size(height). type: 'select', id: 'map-size', label: 'Map Size', items: [ [ 'Small', 'small' ], [ 'Medium', 'medium' ], [ 'Large', 'large' ] ], 'default': 'small', }, ] }, ], // This method is invoked once a user clicks the OK button, confirming the dialog. onOk: function() { // The context of this function is the dialog object itself. // http://docs.ckeditor.com/#!/api/CKEDITOR.dialog var dialog = this; // Get Fields var mapURL = dialog.getValueOf( 'tab-settings', 'map-url' ); var url; var re1='.*?'; // Non-greedy match on filler var re2='((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s"]*))'; // HTTP URL 1 var p = new RegExp(re1+re2,["i"]); var m = p.exec(mapURL); if (m == undefined) { url = mapURL; } else { url = httpurl1=m[1]; } // Map size var mapSize = dialog.getValueOf( 'tab-settings', 'map-size' ); editor.insertHtml( '[map size="' + mapSize + '"]' + url + '[/map]'); } }; });
var group__dma__mburst = [ [ "DMA_SxCR_MBURST_INCR16", "group__dma__mburst.html#gadaf6b33ae31b2cbde69244c3c0f441e8", null ], [ "DMA_SxCR_MBURST_INCR4", "group__dma__mburst.html#ga1d161291aabb811293bc78a8f9c30736", null ], [ "DMA_SxCR_MBURST_INCR8", "group__dma__mburst.html#ga8c35dd793bc079a92b3ec71d534b0cc8", null ], [ "DMA_SxCR_MBURST_SINGLE", "group__dma__mburst.html#gab2c82f24a4c949ffc18f882da93fda10", null ] ];
/*global define*/ define([ '../Core/Color', '../Core/defined', '../Core/defineProperties', '../Core/Event', './createPropertyDescriptor', './Property' ], function( Color, defined, defineProperties, Event, createPropertyDescriptor, Property) { "use strict"; var defaultColor = Color.WHITE; var defaultOutlineColor = Color.BLACK; var defaultOutlineWidth = 0.0; /** * A {@link MaterialProperty} that maps to polyline outline {@link Material} uniforms. * @alias PolylineOutlineMaterialProperty * @constructor */ var PolylineOutlineMaterialProperty = function() { this._definitionChanged = new Event(); this._color = undefined; this._colorSubscription = undefined; this._outlineColor = undefined; this._outlineColorSubscription = undefined; this._outlineWidth = undefined; this._outlineWidthSubscription = undefined; }; defineProperties(PolylineOutlineMaterialProperty.prototype, { /** * Gets a value indicating if this property is constant. A property is considered * constant if getValue always returns the same result for the current definition. * @memberof PolylineOutlineMaterialProperty.prototype * * @type {Boolean} * @readonly */ isConstant : { get : function() { return Property.isConstant(this._color) && Property.isConstant(this._outlineColor) && Property.isConstant(this._outlineWidth); } }, /** * Gets the event that is raised whenever the definition of this property changes. * The definition is considered to have changed if a call to getValue would return * a different result for the same time. * @memberof PolylineOutlineMaterialProperty.prototype * * @type {Event} * @readonly */ definitionChanged : { get : function() { return this._definitionChanged; } }, /** * Gets or sets {@link Color} property which determines the polyline's color. * @memberof PolylineOutlineMaterialProperty.prototype * @type {Property} * @default new ConstantProperty(Color.WHITE) */ color : createPropertyDescriptor('color'), /** * Gets or sets the {@link Color} property which determines the polyline's outline color. * @memberof PolylineOutlineMaterialProperty.prototype * @type {Property} * @default new ConstantProperty(Color.BLACK) */ outlineColor : createPropertyDescriptor('outlineColor'), /** * Gets or sets the numberic property which determines the polyline's outline width. * @memberof PolylineOutlineMaterialProperty.prototype * @type {Property} * @default new ConstantProperty(0) */ outlineWidth : createPropertyDescriptor('outlineWidth') }); /** * Gets the {@link Material} type at the provided time. * * @param {JulianDate} time The time for which to retrieve the type. * @returns {String} The type of material. */ PolylineOutlineMaterialProperty.prototype.getType = function(time) { return 'PolylineOutline'; }; /** * Gets the value of the property at the provided time. * * @param {JulianDate} time The time for which to retrieve the value. * @param {Object} [result] The object to store the value into, if omitted, a new instance is created and returned. * @returns {Object} The modified result parameter or a new instance if the result parameter was not supplied. */ PolylineOutlineMaterialProperty.prototype.getValue = function(time, result) { if (!defined(result)) { result = {}; } result.color = Property.getValueOrClonedDefault(this._color, time, defaultColor, result.color); result.outlineColor = Property.getValueOrClonedDefault(this._outlineColor, time, defaultOutlineColor, result.outlineColor); result.outlineWidth = Property.getValueOrDefault(this._outlineWidth, time, defaultOutlineWidth); return result; }; /** * Compares this property to the provided property and returns * <code>true</code> if they are equal, <code>false</code> otherwise. * * @param {Property} [other] The other property. * @returns {Boolean} <code>true</code> if left and right are equal, <code>false</code> otherwise. */ PolylineOutlineMaterialProperty.prototype.equals = function(other) { return this === other || // (other instanceof PolylineOutlineMaterialProperty && // Property.equals(this._color, other._color) && // Property.equals(this._outlineColor, other._outlineColor) && // Property.equals(this._outlineWidth, other._outlineWidth)); }; /** * @private */ PolylineOutlineMaterialProperty.prototype._raiseDefinitionChanged = function(){ this._definitionChanged.raiseEvent(this); }; return PolylineOutlineMaterialProperty; });
/** * This file is part of the Unit.js testing framework. * * (c) Nicolas Tallefourtane <dev@nicolab.net> * * For the full copyright and license information, please view * the LICENSE file distributed with this source code * or visit http://unitjs.com. * * @author Nicolas Tallefourtane <dev@nicolab.net> */ 'use strict'; var Noder = require('noder.io').Noder; var test = require('../../src'); var api = require('../../src/api'); describe('Unit.js', function() { it('inherits from `Noder`', function() { test .object(test) .isInstanceOf(Noder) .isInstanceOf(api.UnitJS) .isIdenticalTo(api) .function(test.constructor) .hasName('UnitJS') ; }); });
(function($) { var $openDialog = null; var $background = null; var defaultOptions = { autoOpen:true, opacity:'0.3' }; function initialize() { if (!$background) { $background = $('<div />').css({ 'display':'none', 'position':'fixed', '_position':'absolute', 'left':'0', 'top':'0', 'width':'100%', 'height':'100%', 'background':'#000000', 'margin':'0', 'padding':'0', 'border':'0 none', 'z-index':'9000' }).appendTo('body').click(function(e) { if ($openDialog) methods.close.apply($openDialog) }); } } var methods = { init: function(options) { var opts = $.extend(defaultOptions, options); this.each(function() { var $this = $(this) var data = $this.data('dialog'); if (!data) { $this.data('dialog', opts); data = $this.data('dialog'); } }); if (opts.autoOpen) methods.open.apply(this); return this; }, open: function() { if ($openDialog) methods.close.apply($openDialog); return this.first().each(function() { var $this = $(this) var data = $this.data('dialog'); if (!data) data = defaultOptions; $background.css('opacity',data.opacity).fadeIn(500); $this.css('position','absolute').css('z-index','9900') .css('top', ($(window).height()/2-$this.height()/2)+'px') .css('left', ($(window).width()/2-$this.width()/2)+'px') .fadeIn(500); $openDialog = $this; $(window).bind('keypress.dialog', function(e) { if (e.keyCode == 27) methods.close.apply($openDialog); }); }); }, close: function() { $(window).unbind('.dialog'); this.hide(); if ($openDialog && $openDialog.filter(':visible').size() <= 0) { $background.hide(); $openDialog = null; } return this; } } $.fn.dialog = function(method) { initialize(); if (methods[method]) { return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof method === 'object' || !method) { return methods.init.apply(this, arguments); } else { $.error( 'Method ' + method + ' does not exist on jQuery.dialog' ); } }; })(jQuery);
/* const config = require('./config'); const Steam = require('steam'); const Dota2 = require('dota2'); const utility = require('./utility'); const async = require('async'); const convert64To32 = utility.convert64to32; const express = require('express'); const app = express(); const users = config.STEAM_USER.split(','); const passes = config.STEAM_PASS.split(','); const steamObj = {}; const accountToIdx = {}; const replayRequests = 0; const launch = new Date(); let launched = false; const a = []; const port = config.PORT || config.RETRIEVER_PORT; // create array of numbers from 0 to n const count = 0; while (a.length < users.length) a.push(a.length + 0); async.each(a, (i, cb) => { let dotaReady = false; const relationshipReady = false; const client = new Steam.SteamClient(); client.steamUser = new Steam.SteamUser(client); client.steamFriends = new Steam.SteamFriends(client); client.Dota2 = new Dota2.Dota2Client(client, false, false); const user = users[i]; const pass = passes[i]; const logOnDetails = { account_name: user, password: pass, }; client.connect(); client.on('connected', () => { console.log('[STEAM] Trying to log on with %s,%s', user, pass); client.steamUser.logOn(logOnDetails); client.once('error', (e) => { // reset console.log(e); console.log('reconnecting'); client.connect(); }); }); client.on('logOnResponse', (logonResp) => { if (logonResp.eresult !== Steam.EResult.OK) { // try logging on again return client.steamUser.logOn(logOnDetails); } console.log('[STEAM] Logged on %s', client.steamID); client.steamFriends.setPersonaName(client.steamID); steamObj[client.steamID] = client; client.Dota2.launch(); client.Dota2.once('ready', () => { // console.log("Dota 2 ready"); dotaReady = true; const dota = client.Dota2; dota.inviteToParty(utility.convert32to64(88367253).toString()); setTimeout(() => { console.log('lobby'); dota.leavePracticeLobby(); dota.on('practiceLobbyUpdate', (msg) => { console.log(msg); }); dota.createPracticeLobby(); }, 10000); cb(); }); client.once('loggedOff', () => { console.log('relogging'); client.steamUser.logOn(logOnDetails); }); }); }, () => { // start listening launched = true; const server = app.listen(port, () => { const host = server.address().address; console.log('[RETRIEVER] listening at http://%s:%s', host, port); }); app.get('/', (req, res, next) => {}); }); */
var Conditions; Conditions = function() { var self = this; this.compare = function( leftValue, rightValue, operator ) { switch ( operator ) { /* eslint-disable eqeqeq */ case '==': return leftValue == rightValue; case '!=': return leftValue != rightValue; /* eslint-enable eqeqeq */ case '!==': return leftValue !== rightValue; case 'in': return -1 !== rightValue.indexOf( leftValue ); case '!in': return -1 === rightValue.indexOf( leftValue ); case 'contains': return -1 !== leftValue.indexOf( rightValue ); case '!contains': return -1 === leftValue.indexOf( rightValue ); case '<': return leftValue < rightValue; case '<=': return leftValue <= rightValue; case '>': return leftValue > rightValue; case '>=': return leftValue >= rightValue; default: return leftValue === rightValue; } }; this.check = function( conditions, comparisonObject ) { var isOrCondition = 'or' === conditions.relation, conditionSucceed = ! isOrCondition; jQuery.each( conditions.terms, function() { var term = this, comparisonResult; if ( term.terms ) { comparisonResult = self.check( term, comparisonObject ); } else { var parsedName = term.name.match( /(\w+)(?:\[(\w+)])?/ ), value = comparisonObject[ parsedName[ 1 ] ]; if ( parsedName[ 2 ] ) { value = value[ parsedName[ 2 ] ]; } comparisonResult = self.compare( value, term.value, term.operator ); } if ( isOrCondition ) { if ( comparisonResult ) { conditionSucceed = true; } return ! comparisonResult; } if ( ! comparisonResult ) { return conditionSucceed = false; } } ); return conditionSucceed; }; }; module.exports = new Conditions();
/** * Copyright 2013-2020 the original author or authors from the JHipster project. * * This file is part of the JHipster project, see http://www.jhipster.tech/ * for more information. * * 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. */ const ApplicationTypes = { MONOLITH: 'monolith', MICROSERVICE: 'microservice', UAA: 'uaa', GATEWAY: 'gateway', }; ApplicationTypes.exists = applicationType => !!applicationType && !!ApplicationTypes[applicationType.toUpperCase()]; module.exports = ApplicationTypes;
import Component from '@ember/component'; import layout from './template'; import { inject as service } from '@ember/service'; import { get, computed } from '@ember/object'; import C from 'ui/utils/constants'; const headers = [ { name: 'state', sort: ['sortState', 'displayName'], searchField: 'displayState', translationKey: 'generic.state', width: 120, }, { name: 'scope', sort: ['clusterId', 'projectId'], searchField: ['clusterId', 'projectId'], translationKey: 'generic.scope', width: 120, }, { name: 'name', sort: ['displayName', 'id'], searchField: 'displayName', translationKey: 'generic.name', width: 250, }, { name: 'url', sort: ['url', 'displayName'], translationKey: 'catalogSettings.more.url.label', }, { name: 'branch', sort: ['branch', 'displayName'], translationKey: 'catalogSettings.more.branch.label', width: 120, }, ]; export default Component.extend({ globalStore: service(), settings: service(), layout, headers, tagName: null, catalogs: null, mode: 'global', sortBy: 'name', descending: false, paging: true, rightActions: true, library: computed('catalogs.@each.name', function() { return get(this, 'catalogs').findBy('name', C.CATALOG.LIBRARY_KEY); }), helm3Stable: computed('catalogs.@each.name', function() { return get(this, 'catalogs').findBy('name', C.CATALOG.HELM_3_LIBRARY_KEY) }), helmStable: computed('catalogs.@each.name', function() { return get(this, 'catalogs').findBy('name', C.CATALOG.HELM_STABLE_KEY) }), helmIncubator: computed('catalogs.@each.name', function() { return get(this, 'catalogs').findBy('name', C.CATALOG.HELM_INCUBATOR_KEY) }), alibabaAppHub: computed('catalogs.@each.name', function() { return get(this, 'catalogs').findBy('name', C.CATALOG.ALIBABA_APP_HUB_KEY) }), rows: computed('alibabaAppHub', 'catalogs.@each.{id,name,url}', 'helm3Stable', 'helmIncubator', 'helmStable', 'library', 'mode', function() { const out = get(this, 'catalogs').slice(); if ( get(this, 'mode') === 'global' ) { if ( !this.library ) { out.push(get(this, 'globalStore').createRecord({ type: 'catalog', name: C.CATALOG.LIBRARY_KEY, url: C.CATALOG.LIBRARY_VALUE, branch: C.CATALOG.DEFAULT_BRANCH, kind: 'helm', })); } if ( !this.helmStable ) { out.push(get(this, 'globalStore').createRecord({ type: 'catalog', name: C.CATALOG.HELM_STABLE_KEY, url: C.CATALOG.HELM_STABLE_VALUE, branch: C.CATALOG.DEFAULT_BRANCH, kind: 'helm', })); } if ( !this.helmIncubator ) { out.push(get(this, 'globalStore').createRecord({ type: 'catalog', name: C.CATALOG.HELM_INCUBATOR_KEY, url: C.CATALOG.HELM_INCUBATOR_VALUE, branch: C.CATALOG.DEFAULT_BRANCH, kind: 'helm', })); } if ( !this.alibabaAppHub ) { out.push(get(this, 'globalStore').createRecord({ type: 'catalog', name: C.CATALOG.ALIBABA_APP_HUB_KEY, url: C.CATALOG.ALIBABA_APP_HUB_VALUE, branch: C.CATALOG.DEFAULT_BRANCH, kind: 'helm', })); } if ( !this.helm3Stable ) { out.push(get(this, 'globalStore').createRecord({ type: 'catalog', name: C.CATALOG.HELM_3_LIBRARY_KEY, url: C.CATALOG.HELM_3_LIBRARY_VALUE, branch: C.CATALOG.DEFAULT_BRANCH, kind: 'helm', })); } } return out; }) });
export function cloneComplexInteractors(json) { // We'll need collections of our interactions and interactors for later.. const interactions = json.data.filter(function (interaction) { return interaction.object === "interaction"; }); const instanceCount = new Map(); // Loop through our interactions interactions.forEach(function (interaction) { // Get a collection of participants where the stoichiometry is greater than one. const complexesToClone = interaction.participants.filter(function (participant) { if (participant.interactorRef.indexOf("complex") !== -1) { return participant; } }); // Loop through our participants that need expanding complexesToClone.forEach(function (participantComplex) { // Do we have an interactor? TODO: Will this affect complexes? const foundInteractor = findFirstObjWithAttr(interactions, "id", participantComplex.interactorRef); // If we found an interactor then we need to clone it. if (foundInteractor) { let count = instanceCount.get(participantComplex.interactorRef); if (count) { count = count + 1; } else { count = 1; } instanceCount.set(participantComplex.interactorRef, count); let i = count; if (i > 1) { participantComplex.interactorRef = participantComplex.interactorRef + "_" + i; // update features of complex if (participantComplex.features) { participantComplex.features.forEach(function (feature) { feature.copiedfrom = feature.id; // feature.id = feature.id + "_" + i; // Also, adjust our sequence data feature.sequenceData.forEach(function (sequenceData) { sequenceData.participantRef = sequenceData.participantRef + "_" + i; //~ sequenceData.interactorRef = clonedInteractor.id; }); }); } const clonedInteractor = JSON.parse(JSON.stringify(foundInteractor)); clonedInteractor.id = clonedInteractor.id + "_" + i; json.data.push(clonedInteractor); for (let participant of clonedInteractor.participants) { /********** PARTICIPANTS **********/ const clonedParticipant = participant;//JSON.parse(JSON.stringify(participant)); clonedParticipant.id = clonedParticipant.id + "_" + i; // We need to relink to our binding site IDs: if (clonedParticipant.features) { clonedParticipant.features.forEach(function (feature) { // feature.copiedfrom = feature.id; feature.id = feature.id + "_" + i; // Also, adjust our sequence data feature.sequenceData.forEach(function (sequenceData) { sequenceData.participantRef = clonedParticipant.id; //~ sequenceData.interactorRef = clonedInteractor.id; }); const lnCount = feature.linkedFeatures.length; for (let ln = 0; ln < lnCount; ln++){ // console.log(linkedFeature); feature.linkedFeatures[ln] = feature.linkedFeatures[ln] + "_" + i; } }); } } } } }); }); return json; } // Returns the first object in an array that has an attribute with a matching value. function findFirstObjWithAttr(collection, attribute, value) { for (let i = 0; i < collection.length; i += 1) { if (collection[i][attribute] === value) { return collection[i]; } } }
/** * Copyright 2019 The AMP HTML 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. */ 'use strict'; /** * @fileoverview * This script runs the bundle size check and single pass test. * This is run during the CI stage = test; job = dist tests. */ const colors = require('ansi-colors'); const { downloadDistOutput, printChangeSummary, startTimer, stopTimer, timedExecOrDie: timedExecOrDieBase} = require('./utils'); const {determineBuildTargets} = require('./build-targets'); const {isTravisPullRequestBuild} = require('../travis'); const FILENAME = 'dist-tests.js'; const FILELOGPREFIX = colors.bold(colors.yellow(`${FILENAME}:`)); const timedExecOrDie = (cmd, unusedFileName) => timedExecOrDieBase(cmd, FILENAME); function runSinglePassTest_() { timedExecOrDie('gulp clean'); timedExecOrDie('gulp update-packages'); timedExecOrDie('gulp dist --fortesting --single_pass --pseudo_names'); timedExecOrDie('gulp test --integration ' + '--nobuild --compiled --single_pass --headless'); } function main() { const startTime = startTimer(FILENAME, FILENAME); const buildTargets = determineBuildTargets(); if (!isTravisPullRequestBuild()) { timedExecOrDie('gulp update-packages'); downloadDistOutput(FILENAME); timedExecOrDie('gulp bundle-size --on_push_build'); runSinglePassTest_(); } else { printChangeSummary(FILENAME); let ranTests = false; if (buildTargets.has('RUNTIME')) { timedExecOrDie('gulp update-packages'); timedExecOrDie('gulp dist --fortesting --noextensions'); timedExecOrDie('gulp bundle-size --on_pr_build'); ranTests = true; } else { timedExecOrDie('gulp bundle-size --on_skipped_build'); } if (buildTargets.has('RUNTIME') || buildTargets.has('BUILD_SYSTEM') || buildTargets.has('INTEGRATION_TEST')) { runSinglePassTest_(); ranTests = true; } if (!ranTests) { console.log(`${FILELOGPREFIX} Skipping ` + colors.cyan('Dist, Bundle Size, Single Pass Tests ') + 'because this commit does not affect the runtime, build system, ' + 'or integration test files.'); } } stopTimer(FILENAME, FILENAME, startTime); } main();
/* * Copyright (C) 2013 salesforce.com, inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ function () { var lib = { /** * helper function for formatting a number */ formatValue: function(cmp, helper, defaultFormatter) { if (!$A.util.isEmpty(cmp.get("v.value"))) { // number fields only format the initial value //todo helper.setAttribute(cmp, { key: 'doFormat', value: false, commit: true }); var el = helper.getInputElement(cmp); if (!$A.util.isUndefinedOrNull(el)) { var num = helper.getNumber(cmp); if (!$A.util.isUndefinedOrNull(num)) { var formatter = cmp.get("v.format"); if (!$A.util.isEmpty(formatter)) { var numberFormat; try { numberFormat = $A.localizationService.getNumberFormat(formatter); } catch (e) { el.value = "Invalid format attribute"; } if (numberFormat && numberFormat.format) { el.value = numberFormat.format(num); } } else { el.value = defaultFormatter.format(num); } } } } } }; return lib; }
// Copyright (c) 2012 Ecma International. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. /*--- es5id: 15.2.3.6-4-365 description: > ES5 Attributes - fail to update [[Enumerable]] attribute of data property ([[Writable]] is false, [[Enumerable]] is true, [[Configurable]] is false) to different value ---*/ var obj = {}; Object.defineProperty(obj, "prop", { value: 2010, writable: false, enumerable: true, configurable: false }); var propertyDefineCorrect = obj.hasOwnProperty("prop"); var desc1 = Object.getOwnPropertyDescriptor(obj, "prop"); assert.throws(TypeError, function() { Object.defineProperty(obj, "prop", { enumerable: false }); }); var desc2 = Object.getOwnPropertyDescriptor(obj, "prop"); assert(propertyDefineCorrect, 'propertyDefineCorrect !== true'); assert.sameValue(desc1.enumerable, true, 'desc1.enumerable'); assert.sameValue(obj.prop, 2010, 'obj.prop'); assert.sameValue(desc2.enumerable, true, 'desc2.enumerable');
// according to the offical reference (EN) // https://ichigojam.net/IchigoJam-en.html Prism.languages.ichigojam = { 'comment': /(?:\B'|REM)(?:[^\n\r]*)/i, 'string': { pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, greedy: true }, 'number': /\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, 'keyword': /\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i, 'function': /\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i, 'label': /(?:\B@\S+)/, 'operator': /<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i, 'punctuation': /[\[,;:()\]]/ };
var path = require('path'); var Supervisor = require(path.join(__dirname,'/../processes/supervisor')); /** * @function stopGateway * @description Halts all pocesses. */ function stopGateway() { return new Supervisor().stop(); } module.exports = stopGateway;
var fs = require('fs'); var execSync = require('child_process').execSync; var exec = function (cmd) { execSync(cmd, {stdio: 'inherit'}); }; /* global jake, task, desc, publishTask */ task('build', ['lint', 'clean', 'browserify', 'minify'], function () { console.log('Build completed.'); }); desc('Cleans browerified/minified files and package files'); task('clean', ['clobber'], function () { jake.rmRf('./ejs.js'); jake.rmRf('./ejs.min.js'); console.log('Cleaned up compiled files.'); }); desc('Lints the source code'); task('lint', ['clean'], function () { exec('./node_modules/.bin/eslint "**/*.js"'); console.log('Linting completed.'); }); task('browserify', function () { exec('./node_modules/browserify/bin/cmd.js --standalone ejs lib/ejs.js > ejs.js'); console.log('Browserification completed.'); }); task('minify', function () { exec('./node_modules/uglify-js/bin/uglifyjs ejs.js > ejs.min.js'); console.log('Minification completed.'); }); desc('Generates the EJS API docs'); task('doc', function (dev) { jake.rmRf('out'); var p = dev ? '-p' : ''; exec('./node_modules/.bin/jsdoc ' + p + ' -c jsdoc.json lib/* docs/jsdoc/*'); console.log('Documentation generated.'); }); desc('Publishes the EJS API docs'); task('docPublish', ['doc'], function () { fs.writeFileSync('out/CNAME', 'api.ejs.co'); console.log('Pushing docs to gh-pages...'); exec('./node_modules/.bin/git-directory-deploy --directory out/'); console.log('Docs published to gh-pages.'); }); desc('Runs the EJS test suite'); task('test', ['lint'], function () { exec('./node_modules/.bin/mocha'); }); publishTask('ejs', ['build'], function () { this.packageFiles.include([ 'jakefile.js', 'README.md', 'LICENSE', 'package.json', 'postinstall.js', 'ejs.js', 'ejs.min.js', 'lib/**' ]); }); jake.Task.publish.on('complete', function () { console.log('Updating hosted docs...'); console.log('If this fails, run jake docPublish to re-try.'); jake.Task.docPublish.invoke(); });
define(["npm:aurelia-loader-default@1.0.0-beta.1.0.1/aurelia-loader-default"], function(main) { return main; });
version https://git-lfs.github.com/spec/v1 oid sha256:908993a1b52e182ff79479fca7e10537d646cd9285dde32433ffc66265343ed3 size 1819
//------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- function write(v) { WScript.Echo(v + ""); } // Win OOB Bug 1150770 Error.x = 10; write(RangeError.x === 10);
version https://git-lfs.github.com/spec/v1 oid sha256:b1828b45943f19da0e26be3154d3d51fd17dc7940a670c52379f02d4ff678d46 size 591
tinyMCE.addI18n('it.xoopsemotions_dlg',{ title : 'Inserisci Faccine/Emoticon di Xoops', tab_emotionsbrowser: 'Faccine/Emoticon', tab_emotionsadmin: 'Aggiungi Faccine/Emoticon', error_noemotions: 'Non ci sono Faccine/Emoticon nel database !!!' });
angular.module('kityminderEditor') .directive('imageBtn', ['$modal', function($modal) { return { restrict: 'E', templateUrl: 'ui/directive/imageBtn/imageBtn.html', scope: { minder: '=' }, replace: true, link: function($scope) { var minder = $scope.minder; $scope.addImage = function() { var image = minder.queryCommandValue('image'); var imageModal = $modal.open({ animation: true, templateUrl: 'ui/dialog/image/image.tpl.html', controller: 'image.ctrl', size: 'md', resolve: { image: function() { return image; } } }); imageModal.result.then(function(result) { minder.execCommand('image', result.url, result.title || ''); }); } } } }]);
/********************************************************************** require( 'require' ) ----------------------------------------------------------------------- @example var Path = require("node://path"); // Only in NodeJS/NW.js environment. var Button = require("tfw.button"); **********************************************************************/ var require = function() { var modules = {}; var definitions = {}; var nodejs_require = typeof window.require === 'function' ? window.require : null; var f = function(id, body) { if( id.substr( 0, 7 ) == 'node://' ) { // Calling for a NodeJS module. if( !nodejs_require ) { throw Error( "[require] NodeJS is not available to load module `" + id + "`!" ); } return nodejs_require( id.substr( 7 ) ); } if( typeof body === 'function' ) { definitions[id] = body; return; } var mod; body = definitions[id]; if (typeof body === 'undefined') { var err = new Error("Required module is missing: " + id); console.error(err.stack); throw err; } mod = modules[id]; if (typeof mod === 'undefined') { mod = {exports: {}}; var exports = mod.exports; body(exports, mod); modules[id] = mod.exports; mod = mod.exports; //console.log("Module initialized: " + id); } return mod; }; return f; }();
/* ***** BEGIN LICENSE BLOCK ***** * * Copyright (C) 1998 Netscape Communications Corporation. * Copyright (C) 2010 Apple Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * * ***** END LICENSE BLOCK ***** */ gTestfile = 'ToLong-001.js'; /** * Preferred Argument Conversion. * * Passing a JavaScript boolean to a Java method should prefer to call * a Java method of the same name that expects a Java boolean. * */ var SECTION = "Preferred argument conversion: JavaScript Object to Long"; var VERSION = "1_4"; var TITLE = "LiveConnect 3.0 JavaScript to Java Data Type Conversion " + SECTION; startTest(); var TEST_CLASS = applet.createQAObject("com.netscape.javascript.qa.lc3.jsobject.JSObject_006"); function MyObject( value ) { this.value = value; this.valueOf = new Function( "return this.value" ); } function MyFunction() { return; } MyFunction.valueOf = new Function( "return 6060842" ); shouldBeWithErrorCheck( "TEST_CLASS.ambiguous( new String() ) +''", "'LONG'"); shouldBeWithErrorCheck( "TEST_CLASS.ambiguous( new Boolean() ) +''", "'LONG'"); shouldBeWithErrorCheck( "TEST_CLASS.ambiguous( new Number() ) +''", "'LONG'"); shouldBeWithErrorCheck( "TEST_CLASS.ambiguous( new Date(0) ) +''", "'LONG'"); shouldBeWithErrorCheck( "TEST_CLASS.ambiguous( new MyObject(999) ) +''", "'LONG'"); shouldBeWithErrorCheck( "TEST_CLASS.ambiguous( MyFunction ) +''", "'LONG'");
// Copyright 2013 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Flags: --noanalyze-environment-liveness --allow-natives-syntax var r = /r/; function f() { r[r] = function() {}; } for (var i = 0; i < 300; i++) { f(); if (i == 150) %OptimizeOsr(); }
/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // THIS CODE IS GENERATED - DO NOT MODIFY // See angular/tools/gulp-tasks/cldr/extract.js function plural(n) { if (n === 1) return 1; return 5; } export default [ 'ckb-IR', [ ['ب.ن', 'د.ن'], , ], , [ ['ی', 'د', 'س', 'چ', 'پ', 'ھ', 'ش'], [ 'یەکشەممە', 'دووشەممە', 'سێشەممە', 'چوارشەممە', 'پێنجشەممە', 'ھەینی', 'شەممە' ], , ['١ش', '٢ش', '٣ش', '٤ش', '٥ش', 'ھ', 'ش'] ], , [ ['ک', 'ش', 'ئ', 'ن', 'ئ', 'ح', 'ت', 'ئ', 'ئ', 'ت', 'ت', 'ک'], [ 'کانوونی دووەم', 'شوبات', 'ئازار', 'نیسان', 'ئایار', 'حوزەیران', 'تەمووز', 'ئاب', 'ئەیلوول', 'تشرینی یەکەم', 'تشرینی دووەم', 'کانونی یەکەم' ], ], , [ ['پێش زایین', 'زایینی'], , ], 6, [5, 5], ['y-MM-dd', 'y MMM d', 'dی MMMMی y', 'y MMMM d, EEEE'], ['HH:mm', 'HH:mm:ss', 'HH:mm:ss z', 'HH:mm:ss zzzz'], [ '{1} {0}', , , ], ['.', ',', ';', '%', '\u200e+', '-', 'E', '×', '‰', '∞', 'NaN', ':'], ['#,##0.###', '#,##0%', '¤ #,##0.00', '#E0'], 'IRR', 'IRR', plural ]; //# sourceMappingURL=ckb-IR.js.map
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ module.exports = angular.module('trafficPortal.private.tenants.deliveryServices', []) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('trafficPortal.private.tenants.deliveryServices', { url: '/{tenantId}/delivery-services?all', views: { tenantsContent: { templateUrl: 'common/modules/table/tenantDeliveryServices/table.tenantDeliveryServices.tpl.html', controller: 'TableTenantDeliveryServicesController', resolve: { tenant: function($stateParams, tenantService) { return tenantService.getTenant($stateParams.tenantId); }, deliveryServices: function($stateParams, tenant, deliveryServiceService) { if ($stateParams.all && $stateParams.all === 'true') { return deliveryServiceService.getDeliveryServices({ accessibleTo: tenant.id }); } return deliveryServiceService.getDeliveryServices({ tenant: tenant.id }); }, filter: function($stateParams, tenant) { if ($stateParams.all && $stateParams.all === 'true') { return null; } return { tenant: { filterType: "text", type: "equals", filter: tenant.name } } } } } } }) ; $urlRouterProvider.otherwise('/'); });
import h from 'spec/spec_helper'; import { config, path, t, utils, fsAsync } from 'azk'; import { Cli } from 'azk/cli'; import { Manifest } from 'azk/manifest'; describe('Azk cli, init controller', function() { var outputs = []; var ui = h.mockUI(beforeEach, outputs); var manifest = config('manifest'); var cli_options = {}; var cli = new Cli(cli_options) .route('init'); var doc_opts = { exit: false }; var run_options = { ui: ui }; describe("run in a project already has a manifest", function() { var message = t("commands.init.already_exists", manifest); before(() => { return h.tmp_dir().then((project) => { run_options.cwd = project; return fsAsync.createFile(path.join(project, manifest)); }); }); it("should fail", function() { doc_opts.argv = ['init']; var options = cli.router.cleanParams(cli.docopt(doc_opts)); return cli.run(doc_opts, run_options).then((code) => { h.expect(code).to.equal(1); h.expect(options).to.have.property('init', true); h.expect(options).to.have.property('path', null); h.expect(outputs[0]).to.match(RegExp(h.escapeRegExp(message))); }); }); it("should sucess if --force is passed", function() { doc_opts.argv = ['init', '--force']; var options = cli.docopt(doc_opts); return cli.run(doc_opts, run_options).then((code) => { h.expect(options).to.have.property('--force', true); h.expect(code).to.equal(0); h.expect(outputs[0]).to.not.match(RegExp(h.escapeRegExp(message))); }); }); }); it("should generate a manifest with a example system in a blank dir", function() { return h.tmp_dir().then((project) => { doc_opts.argv = ['init']; run_options.cwd = project; var options = cli.router.cleanParams(cli.docopt(doc_opts)); // Check generated manifest return cli.run(doc_opts, run_options).then((code) => { var manifest = new Manifest(project); var system = manifest.systemDefault; var name = path.basename(project); h.expect(code).to.equal(0); h.expect(options).to.have.property('path', null); h.expect(options).to.have.property('filename', false); h.expect(system).to.have.deep.property("name", "example"); h.expect(system).to.have.deep.property("image.name", "[repository]:[tag]"); h.expect(system).to.have.deep.property("depends").and.to.eql([]); var obj = {}; obj[`/azk/${name}`] = utils.docker.resolvePath(manifest.manifestPath); h.expect(system).to.have.deep.property("options.workdir", `/azk/${name}`); h.expect(system).to.have.deep.property("mounts" ).and.to.eql(obj); h.expect(system).to.have.deep.property("options.command").and.to.eql("# command to run app"); h.expect(system).to.have.deep.property("options.envs" ).and.to.eql({ EXAMPLE: "value" }); // Check messages var message = t("commands.init.not_found"); h.expect(outputs[0]).to.match(RegExp(h.escapeRegExp(message))); }); }); }); });
define(function(require){ require('$model/UI2/system/components/justep/window/window'); require('$model/UI2/system/components/bootstrap/navbar/navbar'); require('$model/UI2/system/components/bootstrap/navs/navs'); var __parent1=require('$model/UI2/system/lib/base/modelBase'); var __parent0=require('$model/UI2/system/components/bootstrap/navbar/demo/base'); var __result = __parent1._extend(__parent0).extend({ constructor:function(contextUrl){ this.__sysParam=true; this.__contextUrl=contextUrl; this.__id='__baseID__'; this._flag_='d2aa57dcd25aedc20e3c3c5d740dcee8'; this.callParent(contextUrl); }}); return __result;});
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Ajax.org Code Editor (ACE). * * The Initial Developer of the Original Code is * Ajax.org B.V. * Portions created by the Initial Developer are Copyright (C) 2010 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Fabian Jakobs <fabian AT ajax DOT org> * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ define('ace/theme/solarized_dark', ['require', 'exports', 'module', 'ace/lib/dom'], function(require, exports, module) { exports.isDark = true; exports.cssClass = "ace-solarized-dark"; exports.cssText = "\ .ace-solarized-dark .ace_editor {\ border: 2px solid rgb(159, 159, 159);\ }\ \ .ace-solarized-dark .ace_editor.ace_focus {\ border: 2px solid #327fbd;\ }\ \ .ace-solarized-dark .ace_gutter {\ background: #01313f;\ color: #d0edf7;\ }\ \ .ace-solarized-dark .ace_print_margin {\ width: 1px;\ background: #e8e8e8;\ }\ \ .ace-solarized-dark .ace_scroller {\ background-color: #002B36;\ }\ \ .ace-solarized-dark .ace_text-layer {\ color: #93A1A1;\ }\ \ .ace-solarized-dark .ace_cursor {\ border-left: 2px solid #D30102;\ }\ \ .ace-solarized-dark .ace_cursor.ace_overwrite {\ border-left: 0px;\ border-bottom: 1px solid #D30102;\ }\ \ .ace-solarized-dark .ace_marker-layer .ace_selection {\ background: #073642;\ }\ \ .ace-solarized-dark.multiselect .ace_selection.start {\ box-shadow: 0 0 3px 0px #002B36;\ border-radius: 2px;\ }\ \ .ace-solarized-dark .ace_marker-layer .ace_step {\ background: rgb(102, 82, 0);\ }\ \ .ace-solarized-dark .ace_marker-layer .ace_bracket {\ margin: -1px 0 0 -1px;\ border: 1px solid rgba(147, 161, 161, 0.50);\ }\ \ .ace-solarized-dark .ace_marker-layer .ace_active_line {\ background: #073642;\ }\ \ .ace-solarized-dark .ace_gutter_active_line {\ background-color: #0d3440;\ }\ \ .ace-solarized-dark .ace_marker-layer .ace_selected_word {\ border: 1px solid #073642;\ }\ \ .ace-solarized-dark .ace_invisible {\ color: rgba(147, 161, 161, 0.50);\ }\ \ .ace-solarized-dark .ace_keyword, .ace-solarized-dark .ace_meta {\ color:#859900;\ }\ \ .ace-solarized-dark .ace_constant.ace_language {\ color:#B58900;\ }\ \ .ace-solarized-dark .ace_constant.ace_numeric {\ color:#D33682;\ }\ \ .ace-solarized-dark .ace_constant.ace_other {\ color:#CB4B16;\ }\ \ .ace-solarized-dark .ace_fold {\ background-color: #268BD2;\ border-color: #93A1A1;\ }\ \ .ace-solarized-dark .ace_support.ace_function {\ color:#268BD2;\ }\ \ .ace-solarized-dark .ace_storage {\ color:#93A1A1;\ }\ \ .ace-solarized-dark .ace_variable {\ color:#268BD2;\ }\ \ .ace-solarized-dark .ace_string {\ color:#2AA198;\ }\ \ .ace-solarized-dark .ace_string.ace_regexp {\ color:#D30102;\ }\ \ .ace-solarized-dark .ace_comment {\ font-style:italic;\ color:#657B83;\ }\ \ .ace-solarized-dark .ace_variable.ace_language {\ color:#268BD2;\ }\ \ .ace-solarized-dark .ace_entity.ace_other.ace_attribute-name {\ color:#93A1A1;\ }\ \ .ace-solarized-dark .ace_entity.ace_name.ace_function {\ color:#268BD2;\ }\ \ .ace-solarized-dark .ace_markup.ace_underline {\ text-decoration:underline;\ }"; var dom = require("../lib/dom"); dom.importCssString(exports.cssText, exports.cssClass); });
const fs = require('fs-extra'); const path = require('path'); const cleanDirs = [ 'dist' ]; cleanDirs.forEach(dir => { const cleanDir = path.join(__dirname, '../', dir); fs.removeSync(cleanDir); });
'use strict'; var fs = require('fs'); var Promise = require('../ext/promise'); var readFile = Promise.denodeify(fs.readFile); var lstat = Promise.denodeify(fs.stat); var chalk = require('chalk'); var EditFileDiff = require('./edit-file-diff'); var EOL = require('os').EOL; var isBinaryFile = require('isbinaryfile').sync; var template = require('lodash/template'); var canEdit = require('../utilities/open-editor').canEdit; function processTemplate(content, context) { var options = { evaluate: /<%([\s\S]+?)%>/g, interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g }; return template(content, options)(context); } function diffHighlight(line) { if (line[0] === '+') { return chalk.green(line); } else if (line[0] === '-') { return chalk.red(line); } else if (line.match(/^@@/)) { return chalk.cyan(line); } else { return line; } } FileInfo.prototype.confirmOverwrite = function(path) { var promptOptions = { type: 'expand', name: 'answer', default: false, message: chalk.red('Overwrite') + ' ' + path + '?', choices: [ { key: 'y', name: 'Yes, overwrite', value: 'overwrite' }, { key: 'n', name: 'No, skip', value: 'skip' }, { key: 'd', name: 'Diff', value: 'diff' } ] }; if (canEdit()) { promptOptions.choices.push({ key: 'e', name: 'Edit', value: 'edit' }); } return this.ui.prompt(promptOptions) .then(function(response) { return response.answer; }); }; FileInfo.prototype.displayDiff = function() { var info = this, jsdiff = require('diff'); return Promise.hash({ input: this.render(), output: readFile(info.outputPath) }).then(function(result) { var diff = jsdiff.createPatch( info.outputPath, result.output.toString(), result.input ); var lines = diff.split('\n'); for (var i = 0; i < lines.length; i++) { info.ui.write( diffHighlight(lines[i] + EOL) ); } }); }; function FileInfo(options) { this.action = options.action; this.outputPath = options.outputPath; this.displayPath = options.displayPath; this.inputPath = options.inputPath; this.templateVariables = options.templateVariables; this.ui = options.ui; } FileInfo.prototype.render = function() { var path = this.inputPath, context = this.templateVariables; if (!this.rendered) { this.rendered = readFile(path).then(function(content) { return lstat(path).then(function(fileStat) { if (isBinaryFile(content, fileStat.size)) { return content; } else { try { return processTemplate(content.toString(), context); } catch (err) { err.message += ' (Error in blueprint template: ' + path + ')'; throw err; } } }); }); } return this.rendered; }; FileInfo.prototype.checkForConflict = function() { return new Promise(function (resolve, reject) { fs.exists(this.outputPath, function (doesExist, error) { if (error) { reject(error); return; } var result; if (doesExist) { result = Promise.hash({ input: this.render(), output: readFile(this.outputPath) }).then(function(result) { var type; if (result.input === result.output.toString()) { type = 'identical'; } else { type = 'confirm'; } return type; }.bind(this)); } else { result = 'none'; } resolve(result); }.bind(this)); }.bind(this)); }; FileInfo.prototype.confirmOverwriteTask = function() { var info = this; return function() { return new Promise(function(resolve, reject) { function doConfirm() { info.confirmOverwrite(info.displayPath).then(function(action) { if (action === 'diff') { info.displayDiff().then(doConfirm, reject); } else if (action === 'edit') { var editFileDiff = new EditFileDiff({info: info}); editFileDiff.edit().then(function() { info.action = action; resolve(info); }).catch(function() { doConfirm() .finally(function() { resolve(info); }); }); } else { info.action = action; resolve(info); } }, reject); } doConfirm(); }); }.bind(this); }; module.exports = FileInfo;
var everything = function () { return 42; }; anything.prototype.everything = everything;
/* * /MathJax/jax/output/HTML-CSS/fonts/STIX/IntegralsUpSm/Regular/All.js * * Copyright (c) 2009-2016 The MathJax Consortium * * 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. */ MathJax.Hub.Insert(MathJax.OutputJax["HTML-CSS"].FONTDATA.FONTS.STIXIntegralsUpSm,{32:[0,0,250,0,0],160:[0,0,250,0,0],8748:[690,189,587,52,605],8749:[690,189,817,52,835],8751:[690,189,682,52,642],8752:[690,189,909,52,869],8753:[690,189,480,52,447],8754:[690,189,480,52,448],8755:[690,189,480,52,470],10763:[694,190,556,41,515],10764:[694,190,1044,68,1081],10765:[694,190,420,68,391],10766:[694,190,420,68,391],10767:[694,190,520,39,482],10768:[694,190,324,41,380],10769:[694,190,480,52,447],10770:[694,190,450,68,410],10771:[690,189,450,68,412],10772:[690,189,550,68,512],10773:[690,189,450,50,410],10774:[694,191,450,50,410],10775:[694,190,611,12,585],10776:[694,190,450,48,412],10777:[694,190,450,59,403],10778:[694,190,450,59,403],10779:[784,189,379,68,416],10780:[690,283,357,52,400]});MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir+"/IntegralsUpSm/Regular/All.js");
/************************************************************* * * MathJax/jax/output/HTML-CSS/fonts/STIX/General/BoldItalic/BoxDrawing.js * * Copyright (c) 2009-2016 The MathJax Consortium * * 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. * */ MathJax.Hub.Insert( MathJax.OutputJax['HTML-CSS'].FONTDATA.FONTS['STIXGeneral-bold-italic'], { 0x2500: [340,-267,708,-11,719], // BOX DRAWINGS LIGHT HORIZONTAL 0x2502: [910,303,696,312,385], // BOX DRAWINGS LIGHT VERTICAL 0x250C: [340,303,708,318,720], // BOX DRAWINGS LIGHT DOWN AND RIGHT 0x2510: [340,303,708,-11,390], // BOX DRAWINGS LIGHT DOWN AND LEFT 0x2514: [910,-267,708,318,720], // BOX DRAWINGS LIGHT UP AND RIGHT 0x2518: [910,-267,708,-11,390], // BOX DRAWINGS LIGHT UP AND LEFT 0x251C: [910,303,708,318,720], // BOX DRAWINGS LIGHT VERTICAL AND RIGHT 0x2524: [910,303,708,-11,390], // BOX DRAWINGS LIGHT VERTICAL AND LEFT 0x252C: [340,303,708,-11,719], // BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 0x2534: [910,-267,708,-11,719], // BOX DRAWINGS LIGHT UP AND HORIZONTAL 0x253C: [910,303,708,-11,719], // BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 0x2550: [433,-174,708,-11,719], // BOX DRAWINGS DOUBLE HORIZONTAL 0x2551: [910,303,708,225,484], // BOX DRAWINGS DOUBLE VERTICAL 0x2552: [433,303,708,318,720], // BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE 0x2553: [340,303,708,225,720], // BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE 0x2554: [433,303,708,225,719], // BOX DRAWINGS DOUBLE DOWN AND RIGHT 0x2555: [433,303,708,-11,390], // BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE 0x2556: [340,303,708,-11,483], // BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE 0x2557: [433,303,708,-11,483], // BOX DRAWINGS DOUBLE DOWN AND LEFT 0x2558: [910,-174,708,318,720], // BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE 0x2559: [910,-267,708,225,720], // BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE 0x255A: [910,-174,708,225,719], // BOX DRAWINGS DOUBLE UP AND RIGHT 0x255B: [910,-174,708,-11,390], // BOX DRAWINGS UP SINGLE AND LEFT DOUBLE 0x255C: [910,-267,708,-11,483], // BOX DRAWINGS UP DOUBLE AND LEFT SINGLE 0x255D: [910,-174,708,-11,483], // BOX DRAWINGS DOUBLE UP AND LEFT 0x255E: [910,303,708,318,720], // BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE 0x255F: [910,303,708,225,720], // BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE 0x2560: [910,303,708,225,720], // BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 0x2561: [910,303,708,-11,390], // BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE 0x2562: [910,303,708,-11,483], // BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE 0x2563: [910,303,708,-11,483], // BOX DRAWINGS DOUBLE VERTICAL AND LEFT 0x2564: [433,303,708,-11,719], // BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE 0x2565: [340,303,708,-11,719], // BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE 0x2566: [433,303,708,-11,719], // BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 0x2567: [910,-174,708,-11,719], // BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE 0x2568: [910,-267,708,-11,719], // BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE 0x2569: [910,-174,708,-11,719], // BOX DRAWINGS DOUBLE UP AND HORIZONTAL 0x256A: [910,303,708,-11,719], // BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE 0x256B: [910,303,708,-11,719], // BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE 0x256C: [910,303,708,-11,719] // BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL } ); MathJax.Ajax.loadComplete(MathJax.OutputJax["HTML-CSS"].fontDir + "/General/BoldItalic/BoxDrawing.js");
const BaseChecker = require('./../base-checker') const ruleId = 'imports-on-top' const meta = { type: 'order', docs: { description: `Import statements must be on top.`, category: 'Style Guide Rules' }, isDefault: false, recommended: true, defaultSetup: 'warn', schema: null } class ImportsOnTopChecker extends BaseChecker { constructor(reporter) { super(reporter, ruleId, meta) } SourceUnit(node) { let hasContractDef = false for (let i = 0; node.children && i < node.children.length; i += 1) { const curItem = node.children[i] if (curItem.type === 'ContractDefinition') { hasContractDef = true } if (hasContractDef && curItem.type === 'ImportDirective') { this._error(curItem) } } } _error(node) { this.error(node, 'Import statements must be on top') } } module.exports = ImportsOnTopChecker
Ext.define('KitchenSink.view.charts.area.NegativeController', { extend: 'Ext.app.ViewController', alias: 'controller.area-negative', onPreview: function () { var chart = this.lookupReference('chart'); chart.preview(); }, getSeriesConfig: function (field, title) { return { type: 'area', title: title, xField: 'quarter', yField: field, style: { opacity: 0.60 }, marker: { opacity: 0, scaling: 0.01, fx: { duration: 200, easing: 'easeOut' } }, highlightCfg: { opacity: 1, scaling: 1.5 }, tooltip: { trackMouse: true, renderer: function (tooltip, record, item) { tooltip.setHtml(title + ' (' + record.get('quarter') + '): ' + record.get(field)); } } }; }, onAfterRender: function () { var me = this, chart = me.lookupReference('chart'); chart.setSeries([ me.getSeriesConfig('phone', 'Phone Hardware'), me.getSeriesConfig('consumer', 'Consumer Licensing'), me.getSeriesConfig('gaming', 'Gaming Hardware'), me.getSeriesConfig('corporate', 'Corporate and Other') ]); } });
/** * * This example shows how to create a pivot grid and display the results in * a compact layout. * */ Ext.define('KitchenSink.view.pivot.LayoutCompact', { extend: 'Ext.pivot.Grid', xtype: 'compact-pivot-grid', controller: 'pivotlayout', requires: [ 'KitchenSink.store.pivot.Sales', 'KitchenSink.view.pivot.LayoutController' ], title: 'Compact layout', collapsible: true, multiSelect: true, height: 350, store: { type: 'sales' }, selModel: { type: 'cellmodel' }, // Set layout type to "compact" viewLayoutType: 'compact', // Set this to false if multiple dimensions are configured on leftAxis and // you want to automatically expand the row groups when calculations are ready. startRowGroupsCollapsed: false, // Set this to false if multiple dimensions are configured on topAxis and // you want to automatically expand the col groups when calculations are ready. startColGroupsCollapsed: false, // Configure the aggregate dimensions. Multiple dimensions are supported. aggregate: [{ dataIndex: 'value', header: 'Sum of value', aggregator: 'sum', width: 90 }], // Configure the left axis dimensions that will be used to generate the grid rows leftAxis: [{ dataIndex: 'person', header: 'Person' },{ dataIndex: 'company', header: 'Company', sortable: false },{ dataIndex: 'country', header: 'Country' }], // Configure the top axis dimensions that will be used to generate the columns. // When columns are generated the aggregate dimensions are also used. If multiple aggregation dimensions // are defined then each top axis result will have in the end a column header with children // columns for each aggregate dimension defined. topAxis: [{ dataIndex: 'year', header: 'Year' }, { dataIndex: 'month', header: 'Month', renderer: function(v){ return Ext.Date.monthNames[v]; } }], tbar: [{ text: 'Collapsing', menu: [{ text: 'Collapse all', handler: 'collapseAll' },{ text: 'Expand all', handler: 'expandAll' }] },{ text: 'Subtotals position', menu: { defaults: { xtype: 'menucheckitem', group: 'subtotals', checkHandler: 'subtotalsHandler' }, items: [{ text: 'First', checked: true },{ text: 'Last' },{ text: 'None' }] } },{ text: 'Totals position', menu: { defaults: { xtype: 'menucheckitem', group: 'totals', checkHandler: 'totalsHandler' }, items: [{ text: 'First' },{ text: 'Last', checked: true },{ text: 'None' }] } }], //<example> otherContent: [{ type: 'Controller', path: 'classic/samples/view/pivot/LayoutController.js' },{ type: 'Model', path: 'classic/samples/model/pivot/Sale.js' },{ type: 'Store', path: 'classic/samples/store/pivot/Sales.js' }], profiles: { classic: { width: 600 }, neptune: { width: 750 } }, //</example> initComponent: function () { var me = this; me.width = me.profileInfo.width; me.callParent(); } });
v.setCursorPosition(1,19); v.enter(); v.type("ok");
angular.module('spartan.services', []) /** * A simple example service that returns some data. */ .factory('Friends', function() { // Might use a resource here that returns a JSON array // Some fake testing data var friends = [ { id: 0, name: 'Scruff McGruff' }, { id: 1, name: 'G.I. Joe' }, { id: 2, name: 'Miss Frizzle' }, { id: 3, name: 'Ash Ketchum' } ]; return { all: function() { return friends; }, get: function(friendId) { // Simple index lookup return friends[friendId]; } } });
'use strict'; describe('Service: Oauth2RequestInterceptor', function () { // load the service's module beforeEach(module('yamaAppApp')); // instantiate service var Oauth2RequestInterceptor; beforeEach(inject(function (_Oauth2RequestInterceptor_) { Oauth2RequestInterceptor = _Oauth2RequestInterceptor_; })); it('should do something', function () { expect(!!Oauth2RequestInterceptor).toBe(true); }); });
/*! Copyright (C) 2016 Google Inc. Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> */ /* * Generally useful helpers * Primarily to support Jasmine 1.3 -> Jasmine 2 */ // polls check function and calls done when truthy window.waitsFor = function (check, done) { if (!check()) { setTimeout(function () { waitsFor(check, done); }, 1); } else { done(); } }; // This is primarily useful for passing as the fail case for // promises, since every item passed to it will show up in // the jasmine output. window.failAll = function (done) { return function () { can.each(arguments, function (arg) { fail(JSON.stringify(arg)); }); if (done) { done(); } }; };
/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @format */ 'use strict'; module.exports = () => [ require.resolve('./console.js'), require.resolve('./error-guard.js'), require.resolve('./Object.es7.js'), ];
module.exports = { VERSION: '%KARMA_VERSION%', KARMA_URL_ROOT: '%KARMA_URL_ROOT%', KARMA_PROXY_PATH: '%KARMA_PROXY_PATH%', CONTEXT_URL: 'context.html' }
var fs = require('fs'); var os = require('os'); var path = require('path'); var util = require('./ci-util'); // initialize _package util.initializePackagePath(); // create the tasks.zip util.createTasksZip(); var branch = null; if (process.env.TF_BUILD) { // during CI agent checks out a commit, not a branch. // $(build.sourceBranch) indicates the branch name, e.g. releases/m108 branch = process.env.BUILD_SOURCEBRANCH; } else { // assumes user has checked out a branch. this is a fairly safe assumption. // this code only runs during "package" and "publish" build targets, which // is not typically run locally. branch = util.run('git symbolic-ref HEAD'); } var commitInfo = util.run('git log -1 --format=oneline'); // create the script fs.mkdirSync(util.hotfixLayoutPath); var scriptPath = path.join(util.hotfixLayoutPath, `${process.env.TASK}.ps1`); var scriptContent = '# Hotfix created from branch: ' + branch + os.EOL; scriptContent += '# Commit: ' + commitInfo + os.EOL; scriptContent += '$ErrorActionPreference=\'Stop\'' + os.EOL; scriptContent += 'Update-DistributedTaskDefinitions -TaskZip $PSScriptRoot\\tasks.zip' + os.EOL; fs.writeFileSync(scriptPath, scriptContent); // link the non-aggregate tasks zip var zipDestPath = path.join(util.hotfixLayoutPath, 'tasks.zip'); fs.linkSync(util.tasksZipPath, zipDestPath)
if(!dojo._hasResource["tests.rpc"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. dojo._hasResource["tests.rpc"] = true; dojo.provide("tests.rpc"); dojo.require("dojo.rpc.RpcService"); dojo.require("dojo.rpc.JsonService"); dojo.require("dojo.rpc.JsonpService"); doh.register("tests.rpc", [ { name: "JsonRPC-EchoTest", timeout: 2000, setUp: function(){ var testSmd = { serviceURL:"../../dojo/tests/resources/test_JsonRPCMediator.php", methods:[ { name:"myecho", parameters:[ { name:"somestring", type:"STRING" } ] } ] } this.svc = new dojo.rpc.JsonService(testSmd); }, runTest: function(){ var d = new doh.Deferred(); var td = this.svc.myecho("RPC TEST"); if (window.location.protocol=="file:") { var err= new Error("This Test requires a webserver and PHP and will fail intentionally if loaded from file://"); d.errback(err); return d; } td.addCallbacks(function(result) { if(result=="<P>RPC TEST</P>"){ return true; }else{ return new Error("JsonRpc-EchoTest test failed, resultant content didn't match"); } }, function(result){ return new Error(result); }); td.addBoth(d, "callback"); return d; } }, { name: "JsonRPC-EmptyParamTest", timeout: 2000, setUp: function(){ var testSmd={ serviceURL:"../../dojo/tests/resources/test_JsonRPCMediator.php", methods:[ { name:"contentB" } ] } this.svc = new dojo.rpc.JsonService(testSmd); }, runTest: function(){ var d = new doh.Deferred(); var td = this.svc.contentB(); if (window.location.protocol=="file:") { var err= new Error("This Test requires a webserver and PHP and will fail intentionally if loaded from file://"); d.errback(err); return d; } td.addCallbacks(function(result){ if(result=="<P>Content B</P>"){ return true; }else{ return new Error("JsonRpc-EmpytParamTest test failed, resultant content didn't match"); } }, function(result){ return new Error(result); }); td.addBoth(d, "callback"); return d; } }, { name: "JsonRPC_SMD_Loading_test", setUp: function(){ this.svc = new dojo.rpc.JsonService("../../dojo/tests/resources/testClass.smd"); }, runTest: function(){ if (this.svc.objectName=="testClass") { return true; } else { return new Error("Error loading and/or parsing an smd file"); } } }, { name: "JsonP_test", timeout: 10000, setUp: function(){ this.svc = new dojo.rpc.JsonpService(dojo.moduleUrl("dojo.tests.resources","yahoo_smd_v1.smd"), {appid: "foo"}); }, runTest: function(){ var d = new doh.Deferred(); if (window.location.protocol=="file:") { var err= new Error("This Test requires a webserver and will fail intentionally if loaded from file://"); d.errback(err); return d; } var td = this.svc.webSearch({query:"dojotoolkit"}); td.addCallbacks(function(result){ return true; if (result["ResultSet"]["Result"][0]["DisplayUrl"]=="dojotoolkit.org/") { return true; }else{ return new Error("JsonRpc_SMD_Loading_Test failed, resultant content didn't match"); } }, function(result){ return new Error(result); }); td.addBoth(d, "callback"); return d; } } ] ); }
// set default source and build directories var dest = './build'; var src = './src'; module.exports = { // options for Gulp tasks go here markup: { /* there most likely won't be a need for any markup other than a main index.html but you can add more configuration here if necessary */ src: src + '/index.html', dest: dest }, server: { script: 'server/main.js', ext: 'js html', watch: 'server/**/*.*', nodeArgs: ['--debug'], }, };
let helpers = { formatPrice : function(cents) { return '$' + ( (cents / 100).toFixed(2).replace(/\B(?=(\d{3})+(?!\d))/g, ",") ); }, rando : function(arr) { return arr[Math.floor(Math.random() * arr.length)]; }, slugify : function(text) { return text.toString().toLowerCase() .replace(/\s+/g, '-') // Replace spaces with - .replace(/[^\w\-]+/g, '') // Remove all non-word chars .replace(/\-\-+/g, '-') // Replace multiple - with single - .replace(/^-+/, '') // Trim - from start of text .replace(/-+$/, ''); // Trim - from end of text }, getFunName : function() { var adjectives = ['adorable', 'beautiful', 'clean', 'drab', 'elegant', 'fancy', 'glamorous', 'handsome', 'long', 'magnificent', 'old-fashioned', 'plain', 'quaint', 'sparkling', 'ugliest', 'unsightly', 'angry', 'bewildered', 'clumsy', 'defeated', 'embarrassed', 'fierce', 'grumpy', 'helpless', 'itchy', 'jealous', 'lazy', 'mysterious', 'nervous', 'obnoxious', 'panicky', 'repulsive', 'scary', 'thoughtless', 'uptight', 'worried']; var nouns = ['women', 'men', 'children', 'teeth', 'feet', 'people', 'leaves', 'mice', 'geese', 'halves', 'knives', 'wives', 'lives', 'elves', 'loaves', 'potatoes', 'tomatoes', 'cacti', 'foci', 'fungi', 'nuclei', 'syllabuses', 'analyses', 'diagnoses', 'oases', 'theses', 'crises', 'phenomena', 'criteria', 'data']; return `${this.rando(adjectives)}-${this.rando(adjectives)}-${this.rando(nouns)}`; } } export default helpers;
'use strict'; /** * Lazily required module dependencies */ var lazy = require('lazy-cache')(require); var fn = require; require = lazy; require('falsey', 'isFalsey'); require('delimiter-regex', 'delims'); require('get-view'); require = fn; /** * Expose `utils` */ module.exports = lazy;
interface A { 'C': string; } interface B { "D": boolean; }
"use strict"; var render = require("../../render"); var src = __dirname + "/src.js"; render( { src: src, template: __dirname + "/../template.hbs", "global-index-format": "none", source: src }, __dirname + "/readme.md" );
import React from "react"; export default React.createClass({ propTypes: { show: React.PropTypes.bool, viaCSS: React.PropTypes.bool, }, render: function() { if (this.props.viaCSS) { const display = this.props.show ? null : {display: "none"}; return ( <div style={display}>{this.props.children}</div> ); } else { return this.props.show ? this.props.children : null; } }, });
/* * grunt-notify * https://github.com/dylang/grunt-notify * * Copyright (c) 2014 Dylan Greene, 2014 Matej Simek * Licensed under the MIT license. */ 'use strict'; var NOTIFY_TYPE = 'toaster'; var path = require('path'); var os = require('os'); var spawn = require('../util/spawn'); var semver = require('semver'); // A wee Win8 console notifications app. Post toast notifications from the console, making it easy to integrate into existing batch scripts etc. // Toaster by Nels Oscar https://github.com/nels-o/toaster var CMD = path.resolve(__dirname, '../../bin/toaster/toast.exe'); var IS_WINDOWS = os.type() === 'Windows_NT'; var DEFAULT_IMAGE = path.resolve(__dirname, '../../images/grunt-logo.png'); function supported(options) { var WINDOWS_8; try { WINDOWS_8 = IS_WINDOWS && semver.satisfies(os.release(), '>=6.2.9200'); } catch (e) { options.debug({semverError: e }); } options.debug({ os: os.type(), version: os.release(), IS_WINDOWS: IS_WINDOWS, WINDOWS_8: WINDOWS_8, toaster: IS_WINDOWS && WINDOWS_8 ? 'Will use Windows 8 notifications' : 'Not available for your OS.' }); return IS_WINDOWS && WINDOWS_8; } function notify(options, cb) { var args = [ '-p', DEFAULT_IMAGE, '-t', options.title, '-m', options.message ]; options.debug({ cmd: CMD, args: args.join(' ') }); spawn(CMD, args, function(code) { if (code !== 0) { cb(code); } else { cb(); } }); } module.exports = { name: NOTIFY_TYPE, notify: notify, supported: supported };
<?php /** This file is part of KCFinder project * * @desc Settings panel functionality * @package KCFinder * @version 2.31 * @author Pavel Tzonkov <pavelc@users.sourceforge.net> * @copyright 2010, 2011 KCFinder Project * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 * @link http://kcfinder.sunhater.com */?> browser.initSettings = function() { if (!this.shows.length) { var showInputs = $('#show input[type="checkbox"]').toArray(); $.each(showInputs, function (i, input) { browser.shows[i] = input.name; }); } var shows = this.shows; if (!_.kuki.isSet('showname')) { _.kuki.set('showname', 'on'); $.each(shows, function (i, val) { if (val != "name") _.kuki.set('show' + val, 'off'); }); } $('#show input[type="checkbox"]').click(function() { var kuki = $(this).get(0).checked ? 'on' : 'off'; _.kuki.set('show' + $(this).get(0).name, kuki) if ($(this).get(0).checked) $('#files .file div.' + $(this).get(0).name).css('display', 'block'); else $('#files .file div.' + $(this).get(0).name).css('display', 'none'); }); $.each(shows, function(i, val) { var checked = (_.kuki.get('show' + val) == 'on') ? 'checked' : ''; $('#show input[name="' + val + '"]').get(0).checked = checked; }); if (!this.orders.length) { var orderInputs = $('#order input[type="radio"]').toArray(); $.each(orderInputs, function (i, input) { browser.orders[i] = input.value; }); } var orders = this.orders; if (!_.kuki.isSet('order')) _.kuki.set('order', 'name'); if (!_.kuki.isSet('orderDesc')) _.kuki.set('orderDesc', 'off'); $('#order input[value="' + _.kuki.get('order') + '"]').get(0).checked = true; $('#order input[name="desc"]').get(0).checked = (_.kuki.get('orderDesc') == 'on'); $('#order input[type="radio"]').click(function() { _.kuki.set('order', $(this).get(0).value); browser.orderFiles(); }); $('#order input[name="desc"]').click(function() { _.kuki.set('orderDesc', $(this).get(0).checked ? "on" : "off"); browser.orderFiles(); }); if (!_.kuki.isSet('view')) _.kuki.set('view', 'thumbs'); if (_.kuki.get('view') == "list") { $('#show input').each(function() { this.checked = true; }); $('#show input').each(function() { this.disabled = true; }); } $('#view input[value="' + _.kuki.get('view') + '"]').get(0).checked = true; $('#view input').click(function() { var view = $(this).attr('value'); if (_.kuki.get('view') != view) { _.kuki.set('view', view); if (view == 'list') { $('#show input').each(function() { this.checked = true; }); $('#show input').each(function() { this.disabled = true; }); } else { $.each(browser.shows, function(i, val) { $('#show input[name="' + val + '"]').get(0).checked = (_.kuki.get('show' + val) == "on"); }); $('#show input').each(function() { this.disabled = false; }); } } browser.refresh(); }); };