text
stringlengths
7
3.69M
var imagesArray = ["background-image:url('img/redtop2.jpg');background-position: 50% 0%;-moz-background-position: center top;","background-image:url('img/pink.jpg'); background-position: 50% 70%;-moz-background-position: center bottom","background-image:url('img/white.jpg')"]; //(these don't require the "../" because we'll be injecting these paths into HTML, not CSS) var counterVar = 0; setInterval(function() { if(counterVar >= imagesArray.length) { counterVar = 0 }; document.body.setAttribute("style", imagesArray[counterVar]); counterVar++; }, 7000); //(for a two-second timer)
var application_root = __dirname, qs = require("querystring"), express = require("express"), http = require("http"), request = require("request"), less = require("less-middleware"), mongoose = require('mongoose'), fs = require("fs"); var RedisStore = require("connect-redis")(express); var GameRoute = require("./routes/game"); var UserRoute = require("./routes/user"); var User = require("./models/user"); var passport = require("passport"), LocalStrategy = require("passport-local").Strategy; var options = { server : {poolSize: 5} }; options.server.socketOptions = {keepAlive: 1}; var db = mongoose.connect(process.env.MONGO_URI, options); passport.use(new LocalStrategy( function(username, password, done) { console.log('Authenticating', username, password); User.findOne({username: username}, function(err, user){ if(err){ console.log("Error Here:"); return done(null, false, {message: err.message}); } if(!user){ return done(null, false, {message : 'Username not found'}); } if(password != user.password){ return done(null, false, {message : 'Incorrect password'}); } console.log("Found user:", user); return done(null, user); }); } )); passport.serializeUser(function(user, done){ console.log('Serializing user: ', user); done(null, user._id); }); passport.deserializeUser(function(id, done){ console.log('Deserializing user: ', id); User.findById(id, function(err, user){ return done(err, user); }); }); var app = express(); var server = http.createServer(app) var io = require("socket.io").listen(server); var root = (app.settings.env == 'production') ? '/client-prod' : '/app'; app.configure(function(){ app.use(less({ src : __dirname + root, compress : true })); app.use(express.bodyParser()); app.use(express.cookieParser()); app.use(express.session({ store: new RedisStore({ host : process.env.REDIS_HOST, port : process.env.REDIS_PORT, pass : process.env.REDIS_PASS }), secret: 'super secret key' })); app.use(passport.initialize()); app.use(passport.session()); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(__dirname+root)); app.use(express.errorHandler({dumpException : true, showStack : true})); app.use(function(err, req, res, next){ console.log(err.stack); res.send(500, 'Something broke!'); }); }); //SETUP API var packageJSON = JSON.parse(fs.readFileSync(__dirname + '/package.json')); app.get('/', function(req, res, next){ fs.readFile(__dirname+root+'/index.html', 'utf8', function(err, file) { if (err) { res.send(500); return next(); } res.writeHead(200, {'Content-Type' : 'text/html'}); file = file.replace(/%VERSION%/g, packageJSON.version); res.end(file); }); }); app.post('/auth/login', function(req, res, next){ passport.authenticate('local', function(err, user, info){ if(err){ console.log('Error Occured'); return next(err); } if(!user) { return res.send({error: true, message: info.message})}; req.logIn(user, function(err){ if(err){return next(err);} console.log('Logged In: ', user); return res.send({ message : 'Logged In', alive : true, user : user }); }); })(req, res, next); }); app.get('/secret', passport.authenticate('local'), function(req, res){ if(req.user){ console.log('User is logged in'); return res.send({message: 'You have the secret'}); } }); app.get('/home', UserRoute.getHome); app.get('/dungeon', GameRoute.getDungeon); app.post('/auth/logout', UserRoute.logout); io.sockets.on('connection', function(socket){ socket.emit('init', {hello: 'world'}); socket.on('send:message', function(data){ console.log(data); }); }); exports = module.exports = server; // delegates user() function exports.use = function() { app.use.apply(app, arguments); };
import Command from 'commands/model/Command'; import Commands from 'commands'; describe('Command', () => { let obj; beforeEach(() => { obj = new Command(); }); afterEach(() => { obj = null; }); test('Has id property', () => { expect(obj.has('id')).toEqual(true); }); }); describe('Commands', () => { var obj; beforeEach(() => { obj = new Commands(); }); afterEach(() => { obj = null; }); test('Object is ok', () => { expect(obj).toBeTruthy(); }); });
define('a', ['b'], function(b) { return 'foo'; }); define('b', function() { return 'foo'; });
function printReport() { // Get the HTML of whole page var htmlBodyContent = document.body.innerHTML; // Get the HTML of div invoice_slip $("#monthlyReport").find("a").removeAttr("href"); var divElements = $("#monthlyReport").html(); // Reset the page's HTML with div's HTML only document.body.innerHTML = "<html>" + "<head>" + "<style type=text/css> " + ".divtr{ text-align : left}" + ".align-right{text-align : right} " + ".table-invoice {margin: 0 auto;width: 90%;background: #FBFBFB;border: 1px solid #EBEBEB;padding: 15px;}" + ".table-responsive{overflow:hidden}"+ " </style>" + "</head>" + "<body>"+ divElements + "</body>" "</html>"; // Print Page window.print(); // Restore orignal HTML document.body.innerHTML = htmlBodyContent; }
const jwt = require('jwt-simple'); const config = require('../config/keys'); const nodemailer = require('nodemailer'); exports.tokenForUser = (user) => { const timestamp = new Date().getTime(); return jwt.encode({ sub:user.id, iat: timestamp }, config.secret); } exports.smtpTransport = nodemailer.createTransport({ service:"Gmail", auth : { user:config.emailUserName, pass:config.emailPassword, } })
import Vue from 'vue' import Axios from 'axios' import {baseUrl} from './connection.js' import {Message} from 'element-ui' import cookie from '../assets/js/utils' import router from '../router' const instance1 = Axios.create({ baseURL: baseUrl, headers: { "Content-Type": "application/json", 'X-Requested-With': 'XMLHttpRequest' } }); const instance2 = Axios.create({ baseURL: baseUrl,//"http://47.93.28.3:9002/scf/", headers: { "Content-Type": "application/json", 'X-Requested-With': 'XMLHttpRequest' } }); instance1.interceptors.response.use(function (response) { if (response.data.status == 200) { return response.data; } else { Message.error(response.data.errorMessage); return Promise.reject(response.data); } }, error => { if (error.response) { switch (error.response.status) { case 400: // Message.error(error.response); break; } } return Promise.reject(error.response.data) }); instance2.interceptors.request.use(config => { let user = JSON.parse(cookie.getCookie("user")); if (user) { if(config.params){ for(var key in config.params){ if(!config.params[key] && config.params[key] !== 0){ delete config.params[key]; } } config.params.uid = user.uid; }else{ config.params = { uid: user.uid }; } } // if (user) { // config.params ? config.params.uid = user.uid : config.params = { // uid: user.uid // }; // } return config; }, err => { return Promise.reject(err); }); instance2.interceptors.response.use(function (response) { if (response.data.status == 200) { return response.data; } else if (response.data.status == 403) { //用户身份过期 Message.error(response.data.errorMessage); router.push({ path: '/login' }); //跳转到登录页面 cookie.delCookie("user"); //清空用户信息 return Promise.reject(response); } else { Message.error(response.data.errorMessage); return Promise.reject(response.data); } }, error => { if (error.response) { switch (error.response.status) { case 400: // Message.error(error.response); break; } } return Promise.reject(error.response.data) }); Vue.prototype.$logaxios = instance1; Vue.prototype.$axios = instance2;
import { changeIndicatorAction, fetchProgressAction } from "actions/progress"; import Page from "components/Page"; import PageSpinner from "components/PageSpinner"; import React, { useEffect } from "react"; import { Line } from "react-chartjs-2"; import { useDispatch, useSelector } from "react-redux"; import { Col, Row } from "reactstrap"; import { getChartDataSelector, indicatorOptionsSelector, isLoadingSelector, selectedIndicatorSelector, } from "selectors/progressSelectors"; const ProgressPage = () => { const dispatch = useDispatch(); useEffect(() => { dispatch(fetchProgressAction()); }, []); const chartData = useSelector(getChartDataSelector); const isLoading = useSelector(isLoadingSelector); const indicatorId = useSelector(selectedIndicatorSelector); const indicatorsOptions = useSelector(indicatorOptionsSelector); const handleChange = (e) => { dispatch(changeIndicatorAction(e.target.value)); }; if (isLoading) { return <PageSpinner />; } return ( <Page title={"Stats"}> <Row> <Col className="text-right"> <select value={indicatorId} onChange={handleChange} class="ml-4"> {indicatorsOptions.map((option) => ( <option value={option}>{option}</option> ))} </select> </Col> </Row> <Row> <Col xs="12"> <Line data={chartData} height="700" options={{ responsive: true, maintainAspectRatio: false, spanGaps: false, }} /> </Col> </Row> </Page> ); }; export default ProgressPage;
$(document).ready(function () { //icheck //$('input[type=checkbox],input[type=radio]').iCheck(); //IE8 backgroundsize $('.imgcover').css("background-size","cover"); $('.imgcontain').css("background-size","contain"); //菜单切换 var topMenuListen = null; $('.menubar-list-content').hover(function () { $(this).find('.menubar-list-child').slideDown(200); }, function () { $(this).find('.menubar-list-child').slideUp(200); }); //分享qrcode $('.shareCode span').hover(function(){ $(this).addClass('shareCodeVisible'); },function(){ $(this).removeClass('shareCodeVisible'); }).click(function(){ $(this).toggleClass('shareCodeVisible'); }); //滚动改变顶部样式 var headerHeight = $('#header').height(); $(window).scroll(function(){ if( mini.getScrollTop() > headerHeight ){ $(document.body).addClass('full-leave'); }else{ $(document.body).removeClass('full-leave'); } }).scroll(); //调整内容高度 mini.bindAutoHeight('#page-container'); $(document).on('click','.page-list-more',function(){ //展开更多列表 var parent = $(this).parent(), span = $(this).find('span'); if( parent.hasClass('page-list-show') ){ parent.removeClass('page-list-show'); span.html(span.attr('data-content')); }else{ parent.addClass('page-list-show'); span.attr('data-content',span.html()).html('收起明细'); } }); // $('.page-list-action-concise').click(function(){ // $('.page-list').each(function(){ // if( $(this).hasClass('page-list-show') ){ // $(this).find('.page-list-more').click(); // } // }); // }); // // $('.page-list-action-expend').click(function(){ // $('.page-list').each(function(){ // if( !$(this).hasClass('page-list-show') ){ // $(this).find('.page-list-more').click(); // } // }); // }); $(document).on('click','.page-list-action-concise',function () { //点击简明,收起非重要公告 $('.page-list').each(function(){ if( $(this).hasClass('page-list-show') ){ $(this).find('.page-list-more').click(); } }); }); $(document).on('click','.page-list-action-expend',function (){ //点击全屏,展开所有公告 $('.page-list').each(function(){ if( !$(this).hasClass('page-list-show') ){ $(this).find('.page-list-more').click(); } }); }); //pdf浏览 $(window).bind('resize.pdfViewer',function(){ $('#pdfviewer').height($(document.body).height()-$('#header').height()); }).resize(); //搜索选择绑定 mini.bindFilterSearch('.page-filter',{ 'select' : '.page-filter-select', 'base' : '.page-filter-base', 'checked' : '.page-filter-checked', 'clean' : '.page-filter-clean' },function( searchKeys ){ console.debug('过滤信息:'); console.debug(searchKeys); }); //个股收藏 $('.collect-action').click(function(){ //$(this).toggleClass('active'); if( $(this).hasClass('active') ){ $(this).removeClass('active'); }else{ $(this).addClass('active'); } }); });
import { useState } from "react"; const useModal = () => { const [open, onOpenModal] = useState(false); const [close, onCloseModal] = useState(false); const [id, onId]=useState(null) const openModal = (e) => { onOpenModal(true) onId(e.target.id); }; const closeModal = () => { onCloseModal(true); onOpenModal(false); onId(null); }; return { open, close, openModal, closeModal, id}; }; export default useModal;
module.exports = function getZerosCount(number) { var count = 0; var ext = 1; while (Math.pow(5,ext)<number) { count = count + Math.floor(number/Math.pow(5,ext)); ext++; } return count; // your implementation }
var express = require("express"); var mongoose = require("mongoose"); var morgan = require('morgan'); var userController = require('./controller/userController'); const cors = require('cors'); var dbConfig = require('./dbConfig/dbConfig'); var dotenv = require('dotenv').config(); const uploadRouter = require('./controller/imageUpload'); const app = express(); app.use(morgan('tiny')); app.use(express.json()); app.use(express.urlencoded({extended: true })); // app.use(upload.array()); app.use(express.static(__dirname + "/public")); mongoose.connect(process.env.URL, { useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false, useCreateIndex: true }) .then(() => console.log("Mongodb connected")) .catch(err => console.log(err)); app.post('/v1/signup', userController.hashGen, userController.registerUser); app.post('/login', userController.login); app.use('/upload', uploadRouter); app.listen(process.env.PORT, () => { console.log(`App is running at localhost:${process.env.PORT}`); });
import Sequelize from 'sequelize' const env = process.env.NODE_ENV || 'development'; const config = require(__dirname + '/../config/config.js')[env]; export default async () => { const sequelize = new Sequelize(config.database,config.username,config.password,config); const models = { User: sequelize.import('./user'), News: sequelize.import('./news'), Category: sequelize.import('./category'), Comment : sequelize.import('./comment'), File: sequelize.import('./file'), Reply: sequelize.import('./reply') }; Object.keys(models).forEach(modelName => { if (models[modelName].associate) { models[modelName].associate(models); } }); models.sequelize = sequelize; models.Sequelize = Sequelize; return models; }
var nodes = [ {name: 0, category: '2008', value: 10, label: 'follows', special: 1}, {name: 1, category: '2008', value: 10, label: 'structure', special: 1}, {name: 2, category: '2008', value: 10, label: 'discussion', special: 1}, {name: 3, category: '2008', value: 10, label: 'assume', special: 1}, {name: 4, category: '2008', value: 9, label: 'suggest', special: 1}, {name: 5, category: '2008', value: 9, label: 'illustrated', special: 1}, {name: 6, category: '2008', value: 9, label: 'possible', special: 1}, {name: 7, category: '2008', value: 9, label: 'finally', special: 1}, {name: 8, category: '2008', value: 9, label: 'complement', special: 1}, {name: 9, category: '2008', value: 9, label: 'analysis', special: 1}, {name: 10, category: '2008', value: 9, label: 'although', special: 1}, {name: 11, category: '2008', value: 9, label: 'according', special: 1}, {name: 12, category: '2008', value: 9, label: 'derivation', special: 1}, {name: 13, category: '2008', value: 8, label: 'allowed', special: 0}, {name: 14, category: '2008', value: 8, label: 'particular', special: 0}, {name: 15, category: '2008', value: 8, label: 'nature', special: 1}, {name: 16, category: '2008', value: 8, label: 'appear', special: 1}, {name: 17, category: '2008', value: 8, label: 'hypothesis', special: 0}, {name: 18, category: '2008', value: 8, label: 'discussed', special: 1}, {name: 19, category: '2008', value: 8, label: 'result', special: 1}, {name: 20, category: '2008', value: 8, label: 'cannot', special: 1}, {name: 21, category: '2008', value: 8, label: 'contrast', special: 1}, {name: 22, category: '2008', value: 8, label: 'rather', special: 1}, {name: 23, category: '2008', value: 8, label: 'agreement', special: 1}, {name: 24, category: '2008', value: 7, label: 'recall', special: 1}, {name: 25, category: '2008', value: 7, label: 'number', special: 1}, {name: 26, category: '2008', value: 7, label: 'arguments', special: 1}, {name: 27, category: '2008', value: 7, label: 'derived', special: 1}, {name: 28, category: '2008', value: 7, label: 'conditions', special: 0}, {name: 29, category: '2008', value: 7, label: 'sentences', special: 1}, {name: 30, category: '2008', value: 7, label: 'would like', special: 1}, {name: 31, category: '2008', value: 7, label: 'chomsky', special: 0}, {name: 32, category: '2008', value: 7, label: 'latter', special: 0}, {name: 33, category: '2008', value: 7, label: 'pointed', special: 0}, {name: 34, category: '2008', value: 7, label: 'interpreted', special: 0}, {name: 35, category: '2008', value: 7, label: 'propose', special: 1}, {name: 36, category: '2008', value: 7, label: 'predicates', special: 0}, {name: 37, category: '2008', value: 7, label: 'within', special: 0}, {name: 38, category: '2008', value: 7, label: 'present', special: 1}, {name: 39, category: '2008', value: 6, label: 'repeated', special: 0}, {name: 40, category: '2008', value: 6, label: 'furthermore', special: 1}, {name: 41, category: '2008', value: 6, label: 'course', special: 0}, {name: 42, category: '2008', value: 6, label: 'instead', special: 0}, {name: 43, category: '2008', value: 6, label: 'interpretation', special: 0}, {name: 44, category: '2008', value: 6, label: 'proposed', special: 1}, {name: 45, category: '2008', value: 6, label: 'involve', special: 0}, {name: 46, category: '2008', value: 6, label: 'languages', special: 1}, {name: 47, category: '2008', value: 6, label: 'contrary', special: 0}, {name: 48, category: '2008', value: 6, label: 'feature', special: 0}, {name: 49, category: '2008', value: 6, label: 'phrase', special: 0}, {name: 50, category: '2008', value: 6, label: 'marked', special: 1}, {name: 51, category: '2008', value: 6, label: 'subjects', special: 0}, {name: 52, category: '2008', value: 6, label: 'effect', special: 1}, {name: 53, category: '2008', value: 6, label: 'defined', special: 0}, {name: 54, category: '2008', value: 6, label: 'expected', special: 1}, {name: 55, category: '2008', value: 6, label: 'expect', special: 0}, {name: 56, category: '2008', value: 6, label: 'purposes', special: 0}, {name: 57, category: '2008', value: 6, label: 'compatible', special: 0}, {name: 58, category: '2008', value: 6, label: 'one hand', special: 0}, {name: 59, category: '2008', value: 6, label: 'simply', special: 1}, {name: 60, category: '2008', value: 6, label: 'supported', special: 0}, {name: 61, category: '2008', value: 6, label: 'object', special: 1}, {name: 62, category: '2008', value: 5, label: 'article', special: 1}, {name: 63, category: '2008', value: 5, label: 'support', special: 0}, {name: 64, category: '2008', value: 5, label: 'derive', special: 0}, {name: 65, category: '2008', value: 5, label: 'nothing', special: 0}, {name: 66, category: '2008', value: 5, label: 'opposed', special: 0}, {name: 67, category: '2008', value: 5, label: 'nominal', special: 0}, {name: 68, category: '2008', value: 5, label: 'needed', special: 0}, {name: 69, category: '2008', value: 5, label: 'approach', special: 0}, {name: 70, category: '2008', value: 5, label: 'perhaps', special: 0}, {name: 71, category: '2008', value: 5, label: 'matrix clause', special: 0}, {name: 72, category: '2008', value: 5, label: 'believe', special: 0}, {name: 73, category: '2008', value: 5, label: 'let us', special: 0}, {name: 74, category: '2008', value: 5, label: 'involved', special: 0}, {name: 75, category: '2008', value: 5, label: 'binding', special: 0}, {name: 76, category: '2008', value: 5, label: 'indeed', special: 0}, {name: 77, category: '2008', value: 5, label: 'conclude', special: 0}, {name: 78, category: '2008', value: 5, label: 'impossible', special: 1}, {name: 79, category: '2008', value: 5, label: 'important', special: 1}, {name: 80, category: '2008', value: 5, label: 'presented', special: 1}, {name: 81, category: '2008', value: 5, label: 'contains', special: 0}, {name: 82, category: '2008', value: 5, label: 'problems', special: 0}, {name: 83, category: '2008', value: 5, label: 'analyzed', special: 1}, {name: 84, category: '2008', value: 5, label: 'properties', special: 1}, {name: 85, category: '2008', value: 5, label: 'grammar', special: 1}, {name: 86, category: '2008', value: 5, label: 'formed', special: 0}, {name: 87, category: '2008', value: 5, label: 'specifically', special: 1}, {name: 88, category: '2008', value: 5, label: 'explain', special: 0}, {name: 89, category: '2008', value: 5, label: 'existence', special: 1}, {name: 90, category: '2008', value: 5, label: 'absence', special: 1}, {name: 91, category: '2008', value: 5, label: 'raising', special: 0}, {name: 92, category: '2008', value: 5, label: 'claimed', special: 0}, {name: 93, category: '2008', value: 5, label: 'always', special: 0}, {name: 94, category: '2008', value: 5, label: 'reflexive', special: 0}, {name: 95, category: '2008', value: 5, label: 'acceptable', special: 0}, {name: 96, category: '2008', value: 5, label: 'elements', special: 0}, {name: 97, category: '2008', value: 5, label: 'requires', special: 0}, {name: 98, category: '2008', value: 5, label: 'effects', special: 0}, {name: 99, category: '2008', value: 5, label: 'respectively', special: 0}, {name: 100, category: '2009', value: 10, label: 'account', special: 1}, {name: 101, category: '2009', value: 10, label: 'instance', special: 1}, {name: 102, category: '2009', value: 10, label: 'possible', special: 1}, {name: 103, category: '2009', value: 10, label: 'although', special: 1}, {name: 104, category: '2009', value: 10, label: 'structure', special: 1}, {name: 105, category: '2009', value: 9, label: 'effect', special: 1}, {name: 106, category: '2009', value: 9, label: 'subject', special: 1}, {name: 107, category: '2009', value: 9, label: 'whereas', special: 1}, {name: 108, category: '2009', value: 9, label: 'assume', special: 1}, {name: 109, category: '2009', value: 9, label: 'argued', special: 1}, {name: 110, category: '2009', value: 9, label: 'reason', special: 0}, {name: 111, category: '2009', value: 8, label: 'rather', special: 1}, {name: 112, category: '2009', value: 8, label: 'particular', special: 0}, {name: 113, category: '2009', value: 8, label: 'difference', special: 1}, {name: 114, category: '2009', value: 8, label: 'return', special: 0}, {name: 115, category: '2009', value: 8, label: 'object', special: 1}, {name: 116, category: '2009', value: 8, label: 'proposal', special: 1}, {name: 117, category: '2009', value: 8, label: 'marked', special: 1}, {name: 118, category: '2009', value: 8, label: 'section', special: 1}, {name: 119, category: '2009', value: 8, label: 'furthermore', special: 1}, {name: 120, category: '2009', value: 8, label: 'discussed', special: 1}, {name: 121, category: '2009', value: 7, label: 'syntactic', special: 0}, {name: 122, category: '2009', value: 7, label: 'suggests', special: 1}, {name: 123, category: '2009', value: 7, label: 'language', special: 1}, {name: 124, category: '2009', value: 7, label: 'available', special: 0}, {name: 125, category: '2009', value: 7, label: 'allows', special: 0}, {name: 126, category: '2009', value: 7, label: 'follow', special: 0}, {name: 127, category: '2009', value: 7, label: 'derivation', special: 1}, {name: 128, category: '2009', value: 7, label: 'purpose', special: 0}, {name: 129, category: '2009', value: 7, label: 'domain', special: 0}, {name: 130, category: '2009', value: 7, label: 'arguments', special: 1}, {name: 131, category: '2009', value: 7, label: 'possibility', special: 0}, {name: 132, category: '2009', value: 7, label: 'phrases', special: 0}, {name: 133, category: '2009', value: 7, label: 'phrase', special: 0}, {name: 134, category: '2009', value: 6, label: 'application', special: 0}, {name: 135, category: '2009', value: 6, label: 'expected', special: 1}, {name: 136, category: '2009', value: 6, label: 'establish', special: 0}, {name: 137, category: '2009', value: 6, label: 'predicates', special: 0}, {name: 138, category: '2009', value: 6, label: 'element', special: 0}, {name: 139, category: '2009', value: 6, label: 'according', special: 1}, {name: 140, category: '2009', value: 6, label: 'observed', special: 0}, {name: 141, category: '2009', value: 6, label: 'distribution', special: 0}, {name: 142, category: '2009', value: 6, label: 'proposed', special: 1}, {name: 143, category: '2009', value: 6, label: 'necessary', special: 0}, {name: 144, category: '2009', value: 6, label: 'features', special: 1}, {name: 145, category: '2009', value: 6, label: 'contrary', special: 0}, {name: 146, category: '2009', value: 6, label: 'relation', special: 0}, {name: 147, category: '2009', value: 6, label: 'requirement', special: 0}, {name: 148, category: '2009', value: 6, label: 'restricted', special: 0}, {name: 149, category: '2009', value: 6, label: 'needed', special: 0}, {name: 150, category: '2009', value: 6, label: 'theory', special: 1}, {name: 151, category: '2009', value: 6, label: 'followed', special: 0}, {name: 152, category: '2009', value: 6, label: 'complement', special: 1}, {name: 153, category: '2009', value: 6, label: 'absence', special: 1}, {name: 154, category: '2009', value: 6, label: 'similar', special: 0}, {name: 155, category: '2009', value: 6, label: 'something', special: 0}, {name: 156, category: '2009', value: 6, label: 'ability', special: 0}, {name: 157, category: '2009', value: 6, label: 'suggested', special: 0}, {name: 158, category: '2009', value: 6, label: 'adjoined', special: 0}, {name: 159, category: '2009', value: 6, label: 'syntax', special: 1}, {name: 160, category: '2009', value: 6, label: 'restrictions', special: 0}, {name: 161, category: '2009', value: 5, label: 'existence', special: 1}, {name: 162, category: '2009', value: 5, label: 'reasons', special: 0}, {name: 163, category: '2009', value: 5, label: 'achieved', special: 0}, {name: 164, category: '2009', value: 5, label: 'conclusion', special: 1}, {name: 165, category: '2009', value: 5, label: 'conditions', special: 0}, {name: 166, category: '2009', value: 5, label: 'configuration', special: 0}, {name: 167, category: '2009', value: 5, label: 'supported', special: 0}, {name: 168, category: '2009', value: 5, label: 'considered', special: 0}, {name: 169, category: '2009', value: 5, label: 'constituent', special: 0}, {name: 170, category: '2009', value: 5, label: 'analyzed', special: 1}, {name: 171, category: '2009', value: 5, label: 'chomsky', special: 0}, {name: 172, category: '2009', value: 5, label: 'suggest', special: 1}, {name: 173, category: '2009', value: 5, label: 'course', special: 0}, {name: 174, category: '2009', value: 5, label: 'prediction', special: 1}, {name: 175, category: '2009', value: 5, label: 'require', special: 0}, {name: 176, category: '2009', value: 5, label: 'accounts', special: 0}, {name: 177, category: '2009', value: 5, label: 'deleted', special: 0}, {name: 178, category: '2009', value: 5, label: 'points', special: 0}, {name: 179, category: '2009', value: 5, label: 'pointed', special: 0}, {name: 180, category: '2009', value: 5, label: 'person', special: 0}, {name: 181, category: '2009', value: 5, label: 'direction', special: 0}, {name: 182, category: '2009', value: 5, label: 'unavailable', special: 0}, {name: 183, category: '2009', value: 5, label: 'distinction', special: 0}, {name: 184, category: '2009', value: 5, label: 'one hand', special: 0}, {name: 185, category: '2009', value: 5, label: 'observe', special: 0}, {name: 186, category: '2009', value: 5, label: 'nominal', special: 0}, {name: 187, category: '2009', value: 5, label: 'associated', special: 0}, {name: 188, category: '2009', value: 5, label: 'mentioned', special: 0}, {name: 189, category: '2009', value: 5, label: 'availability', special: 0}, {name: 190, category: '2009', value: 5, label: 'investigate', special: 0}, {name: 191, category: '2009', value: 5, label: 'interpretation', special: 0}, {name: 192, category: '2009', value: 5, label: 'feature', special: 0}, {name: 193, category: '2009', value: 5, label: 'specifier', special: 0}, {name: 194, category: '2009', value: 5, label: 'become', special: 0}, {name: 195, category: '2009', value: 5, label: 'incompatible', special: 0}, {name: 196, category: '2009', value: 5, label: 'importantly', special: 0}, {name: 197, category: '2009', value: 5, label: 'identified', special: 0}, {name: 198, category: '2009', value: 5, label: 'function', special: 0}, {name: 199, category: '2009', value: 5, label: 'happens', special: 0}, {name: 200, category: '2010', value: 10, label: 'assume', special: 1}, {name: 201, category: '2010', value: 10, label: 'argument', special: 1}, {name: 202, category: '2010', value: 10, label: 'complement', special: 1}, {name: 203, category: '2010', value: 10, label: 'either', special: 1}, {name: 204, category: '2010', value: 10, label: 'clause', special: 1}, {name: 205, category: '2010', value: 10, label: 'structure', special: 1}, {name: 206, category: '2010', value: 9, label: 'problem', special: 1}, {name: 207, category: '2010', value: 9, label: 'according', special: 1}, {name: 208, category: '2010', value: 9, label: 'presence', special: 1}, {name: 209, category: '2010', value: 9, label: 'section', special: 1}, {name: 210, category: '2010', value: 9, label: 'argued', special: 1}, {name: 211, category: '2010', value: 9, label: 'interpretation', special: 0}, {name: 212, category: '2010', value: 9, label: 'position', special: 1}, {name: 213, category: '2010', value: 9, label: 'languages', special: 1}, {name: 214, category: '2010', value: 9, label: 'considered', special: 0}, {name: 215, category: '2010', value: 8, label: 'latter', special: 0}, {name: 216, category: '2010', value: 8, label: 'results', special: 1}, {name: 217, category: '2010', value: 8, label: 'different', special: 0}, {name: 218, category: '2010', value: 8, label: 'constituent', special: 0}, {name: 219, category: '2010', value: 8, label: 'possibility', special: 0}, {name: 220, category: '2010', value: 8, label: 'explain', special: 0}, {name: 221, category: '2010', value: 8, label: 'instead', special: 0}, {name: 222, category: '2010', value: 8, label: 'nature', special: 1}, {name: 223, category: '2010', value: 8, label: 'theory', special: 1}, {name: 224, category: '2010', value: 8, label: 'examples', special: 1}, {name: 225, category: '2010', value: 8, label: 'reason', special: 0}, {name: 226, category: '2010', value: 8, label: 'rather', special: 1}, {name: 227, category: '2010', value: 8, label: 'conclusion', special: 1}, {name: 228, category: '2010', value: 8, label: 'contain', special: 0}, {name: 229, category: '2010', value: 8, label: 'proposed', special: 1}, {name: 230, category: '2010', value: 8, label: 'propose', special: 1}, {name: 231, category: '2010', value: 8, label: 'context', special: 1}, {name: 232, category: '2010', value: 8, label: 'chomsky', special: 0}, {name: 233, category: '2010', value: 7, label: 'analyzed', special: 1}, {name: 234, category: '2010', value: 7, label: 'taking', special: 0}, {name: 235, category: '2010', value: 7, label: 'claimed', special: 0}, {name: 236, category: '2010', value: 7, label: 'specifically', special: 1}, {name: 237, category: '2010', value: 7, label: 'indicate', special: 0}, {name: 238, category: '2010', value: 7, label: 'conclude', special: 0}, {name: 239, category: '2010', value: 7, label: 'nothing', special: 0}, {name: 240, category: '2010', value: 7, label: 'allowed', special: 0}, {name: 241, category: '2010', value: 7, label: 'merged', special: 0}, {name: 242, category: '2010', value: 7, label: 'nevertheless', special: 0}, {name: 243, category: '2010', value: 7, label: 'already', special: 0}, {name: 244, category: '2010', value: 7, label: 'pattern', special: 0}, {name: 245, category: '2010', value: 7, label: 'sentence', special: 1}, {name: 246, category: '2010', value: 7, label: 'detail', special: 0}, {name: 247, category: '2010', value: 7, label: 'language', special: 1}, {name: 248, category: '2010', value: 7, label: 'features', special: 1}, {name: 249, category: '2010', value: 7, label: 'feature', special: 0}, {name: 250, category: '2010', value: 6, label: 'course', special: 0}, {name: 251, category: '2010', value: 6, label: 'represent', special: 0}, {name: 252, category: '2010', value: 6, label: 'alternative', special: 0}, {name: 253, category: '2010', value: 6, label: 'alternatively', special: 0}, {name: 254, category: '2010', value: 6, label: 'generalization', special: 0}, {name: 255, category: '2010', value: 6, label: 'similar', special: 0}, {name: 256, category: '2010', value: 6, label: 'generated', special: 0}, {name: 257, category: '2010', value: 6, label: 'recall', special: 1}, {name: 258, category: '2010', value: 6, label: 'whereas', special: 1}, {name: 259, category: '2010', value: 6, label: 'would like', special: 1}, {name: 260, category: '2010', value: 6, label: 'provided', special: 1}, {name: 261, category: '2010', value: 6, label: 'embedded', special: 0}, {name: 262, category: '2010', value: 6, label: 'illustrated', special: 1}, {name: 263, category: '2010', value: 6, label: 'combination', special: 0}, {name: 264, category: '2010', value: 6, label: 'combined', special: 0}, {name: 265, category: '2010', value: 6, label: 'anonymous reviewer', special: 0}, {name: 266, category: '2010', value: 6, label: 'indicates', special: 0}, {name: 267, category: '2010', value: 6, label: 'option', special: 0}, {name: 268, category: '2010', value: 6, label: 'clauses', special: 0}, {name: 269, category: '2010', value: 6, label: 'instances', special: 0}, {name: 270, category: '2010', value: 6, label: 'subjects', special: 0}, {name: 271, category: '2010', value: 6, label: 'suggest', special: 1}, {name: 272, category: '2010', value: 6, label: 'version', special: 0}, {name: 273, category: '2010', value: 6, label: 'introduced', special: 0}, {name: 274, category: '2010', value: 6, label: 'suggests', special: 1}, {name: 275, category: '2010', value: 5, label: 'complementizer', special: 0}, {name: 276, category: '2010', value: 5, label: 'neither', special: 0}, {name: 277, category: '2010', value: 5, label: 'absence', special: 1}, {name: 278, category: '2010', value: 5, label: 'natural', special: 0}, {name: 279, category: '2010', value: 5, label: 'available', special: 0}, {name: 280, category: '2010', value: 5, label: 'operation', special: 0}, {name: 281, category: '2010', value: 5, label: 'marked', special: 1}, {name: 282, category: '2010', value: 5, label: 'lexicon', special: 0}, {name: 283, category: '2010', value: 5, label: 'lexical item', special: 0}, {name: 284, category: '2010', value: 5, label: 'perhaps', special: 0}, {name: 285, category: '2010', value: 5, label: 'commanded', special: 0}, {name: 286, category: '2010', value: 5, label: 'involved', special: 0}, {name: 287, category: '2010', value: 5, label: 'variety', special: 0}, {name: 288, category: '2010', value: 5, label: 'positions', special: 0}, {name: 289, category: '2010', value: 5, label: 'predict', special: 0}, {name: 290, category: '2010', value: 5, label: 'university', special: 0}, {name: 291, category: '2010', value: 5, label: 'answer', special: 0}, {name: 292, category: '2010', value: 5, label: 'probably', special: 0}, {name: 293, category: '2010', value: 5, label: 'accounted', special: 0}, {name: 294, category: '2010', value: 5, label: 'implies', special: 0}, {name: 295, category: '2010', value: 5, label: 'two types', special: 0}, {name: 296, category: '2010', value: 5, label: 'illustrate', special: 0}, {name: 297, category: '2010', value: 5, label: 'among others', special: 0}, {name: 298, category: '2010', value: 5, label: 'distribution', special: 0}, {name: 299, category: '2010', value: 5, label: 'head movement', special: 0}, {name: 300, category: '2011', value: 10, label: 'context', special: 1}, {name: 301, category: '2011', value: 10, label: 'respect', special: 1}, {name: 302, category: '2011', value: 10, label: 'illustrated', special: 1}, {name: 303, category: '2011', value: 10, label: 'argued', special: 1}, {name: 304, category: '2011', value: 10, label: 'proposed', special: 1}, {name: 305, category: '2011', value: 10, label: 'specifically', special: 1}, {name: 306, category: '2011', value: 10, label: 'difference', special: 1}, {name: 307, category: '2011', value: 10, label: 'presented', special: 1}, {name: 308, category: '2011', value: 9, label: 'theory', special: 1}, {name: 309, category: '2011', value: 9, label: 'recall', special: 1}, {name: 310, category: '2011', value: 9, label: 'problem', special: 1}, {name: 311, category: '2011', value: 9, label: 'interpretation', special: 0}, {name: 312, category: '2011', value: 9, label: 'position', special: 1}, {name: 313, category: '2011', value: 9, label: 'suggests', special: 1}, {name: 314, category: '2011', value: 9, label: 'similar', special: 0}, {name: 315, category: '2011', value: 9, label: 'approach', special: 0}, {name: 316, category: '2011', value: 9, label: 'sentence', special: 1}, {name: 317, category: '2011', value: 9, label: 'grammatical', special: 0}, {name: 318, category: '2011', value: 8, label: 'following', special: 0}, {name: 319, category: '2011', value: 8, label: 'assuming', special: 1}, {name: 320, category: '2011', value: 8, label: 'hypothesis', special: 0}, {name: 321, category: '2011', value: 8, label: 'reason', special: 0}, {name: 322, category: '2011', value: 8, label: 'observed', special: 0}, {name: 323, category: '2011', value: 8, label: 'instead', special: 0}, {name: 324, category: '2011', value: 8, label: 'research', special: 0}, {name: 325, category: '2011', value: 8, label: 'intended', special: 0}, {name: 326, category: '2011', value: 8, label: 'needed', special: 0}, {name: 327, category: '2011', value: 8, label: 'appear', special: 1}, {name: 328, category: '2011', value: 7, label: 'latter', special: 0}, {name: 329, category: '2011', value: 7, label: 'neither', special: 0}, {name: 330, category: '2011', value: 7, label: 'chomsky', special: 0}, {name: 331, category: '2011', value: 7, label: 'likely', special: 0}, {name: 332, category: '2011', value: 7, label: 'object', special: 1}, {name: 333, category: '2011', value: 7, label: 'ungrammatical', special: 0}, {name: 334, category: '2011', value: 7, label: 'article', special: 1}, {name: 335, category: '2011', value: 7, label: 'nature', special: 1}, {name: 336, category: '2011', value: 7, label: 'involve', special: 0}, {name: 337, category: '2011', value: 7, label: 'search', special: 0}, {name: 338, category: '2011', value: 7, label: 'predicted', special: 0}, {name: 339, category: '2011', value: 7, label: 'prediction', special: 1}, {name: 340, category: '2011', value: 7, label: 'grammar', special: 1}, {name: 341, category: '2011', value: 7, label: 'even though', special: 0}, {name: 342, category: '2011', value: 7, label: 'believe', special: 0}, {name: 343, category: '2011', value: 7, label: 'presence', special: 1}, {name: 344, category: '2011', value: 7, label: 'status', special: 0}, {name: 345, category: '2011', value: 7, label: 'equivalent', special: 0}, {name: 346, category: '2011', value: 7, label: 'regardless', special: 0}, {name: 347, category: '2011', value: 7, label: 'furthermore', special: 1}, {name: 348, category: '2011', value: 7, label: 'repeated', special: 0}, {name: 349, category: '2011', value: 7, label: 'assumption', special: 1}, {name: 350, category: '2011', value: 7, label: 'required', special: 1}, {name: 351, category: '2011', value: 7, label: 'clause', special: 1}, {name: 352, category: '2011', value: 6, label: 'actually', special: 0}, {name: 353, category: '2011', value: 6, label: 'nominative', special: 0}, {name: 354, category: '2011', value: 6, label: 'available', special: 0}, {name: 355, category: '2011', value: 6, label: 'relevant', special: 0}, {name: 356, category: '2011', value: 6, label: 'problems', special: 0}, {name: 357, category: '2011', value: 6, label: 'allowed', special: 0}, {name: 358, category: '2011', value: 6, label: 'values', special: 0}, {name: 359, category: '2011', value: 6, label: 'generated', special: 0}, {name: 360, category: '2011', value: 6, label: 'government', special: 0}, {name: 361, category: '2011', value: 6, label: 'version', special: 0}, {name: 362, category: '2011', value: 6, label: 'clearly', special: 0}, {name: 363, category: '2011', value: 6, label: 'next section', special: 0}, {name: 364, category: '2011', value: 6, label: 'independent', special: 0}, {name: 365, category: '2011', value: 6, label: 'blocked', special: 0}, {name: 366, category: '2011', value: 6, label: 'incompatible', special: 0}, {name: 367, category: '2011', value: 6, label: 'supported', special: 0}, {name: 368, category: '2011', value: 6, label: 'provide', special: 1}, {name: 369, category: '2011', value: 6, label: 'understanding', special: 0}, {name: 370, category: '2011', value: 6, label: 'impossible', special: 1}, {name: 371, category: '2011', value: 6, label: 'ungrammaticality', special: 0}, {name: 372, category: '2011', value: 6, label: 'course', special: 0}, {name: 373, category: '2011', value: 6, label: 'others', special: 0}, {name: 374, category: '2011', value: 6, label: 'showed', special: 0}, {name: 375, category: '2011', value: 6, label: 'appears', special: 0}, {name: 376, category: '2011', value: 6, label: 'subject position', special: 0}, {name: 377, category: '2011', value: 6, label: 'explain', special: 0}, {name: 378, category: '2011', value: 6, label: 'explained', special: 0}, {name: 379, category: '2011', value: 5, label: 'structures', special: 0}, {name: 380, category: '2011', value: 5, label: 'distinction', special: 0}, {name: 381, category: '2011', value: 5, label: 'identical', special: 0}, {name: 382, category: '2011', value: 5, label: 'children', special: 0}, {name: 383, category: '2011', value: 5, label: 'importantly', special: 0}, {name: 384, category: '2011', value: 5, label: 'assumes', special: 0}, {name: 385, category: '2011', value: 5, label: 'property', special: 0}, {name: 386, category: '2011', value: 5, label: 'pronouns', special: 0}, {name: 387, category: '2011', value: 5, label: 'differences', special: 0}, {name: 388, category: '2011', value: 5, label: 'consequence', special: 0}, {name: 389, category: '2011', value: 5, label: 'differ', special: 0}, {name: 390, category: '2011', value: 5, label: 'relationship', special: 0}, {name: 391, category: '2011', value: 5, label: 'obtained', special: 0}, {name: 392, category: '2011', value: 5, label: 'probing', special: 0}, {name: 393, category: '2011', value: 5, label: 'determine', special: 0}, {name: 394, category: '2011', value: 5, label: 'requirement', special: 0}, {name: 395, category: '2011', value: 5, label: 'specifier', special: 0}, {name: 396, category: '2011', value: 5, label: 'described', special: 0}, {name: 397, category: '2011', value: 5, label: 'namely', special: 0}, {name: 398, category: '2011', value: 5, label: 'variety', special: 0}, {name: 399, category: '2011', value: 5, label: 'considered', special: 0}, {name: 400, category: '2012', value: 10, label: 'number', special: 1}, {name: 401, category: '2012', value: 10, label: 'derivation', special: 1}, {name: 402, category: '2012', value: 10, label: 'instance', special: 1}, {name: 403, category: '2012', value: 10, label: 'second', special: 1}, {name: 404, category: '2012', value: 9, label: 'propose', special: 1}, {name: 405, category: '2012', value: 9, label: 'follows', special: 1}, {name: 406, category: '2012', value: 9, label: 'whereas', special: 1}, {name: 407, category: '2012', value: 9, label: 'analysis', special: 1}, {name: 408, category: '2012', value: 9, label: 'marked', special: 1}, {name: 409, category: '2012', value: 9, label: 'impossible', special: 1}, {name: 410, category: '2012', value: 9, label: 'suggests', special: 1}, {name: 411, category: '2012', value: 9, label: 'assumption', special: 1}, {name: 412, category: '2012', value: 9, label: 'theory', special: 1}, {name: 413, category: '2012', value: 9, label: 'contrast', special: 1}, {name: 414, category: '2012', value: 8, label: 'whether', special: 1}, {name: 415, category: '2012', value: 8, label: 'position', special: 1}, {name: 416, category: '2012', value: 8, label: 'syntax', special: 1}, {name: 417, category: '2012', value: 8, label: 'conclusion', special: 1}, {name: 418, category: '2012', value: 8, label: 'results', special: 1}, {name: 419, category: '2012', value: 8, label: 'discussed', special: 1}, {name: 420, category: '2012', value: 8, label: 'interpreted', special: 0}, {name: 421, category: '2012', value: 7, label: 'absence', special: 1}, {name: 422, category: '2012', value: 7, label: 'literature', special: 1}, {name: 423, category: '2012', value: 7, label: 'distinction', special: 0}, {name: 424, category: '2012', value: 7, label: 'illustrated', special: 1}, {name: 425, category: '2012', value: 7, label: 'discussion', special: 1}, {name: 426, category: '2012', value: 7, label: 'command', special: 0}, {name: 427, category: '2012', value: 7, label: 'regard', special: 0}, {name: 428, category: '2012', value: 7, label: 'explained', special: 0}, {name: 429, category: '2012', value: 7, label: 'furthermore', special: 1}, {name: 430, category: '2012', value: 7, label: 'present', special: 1}, {name: 431, category: '2012', value: 7, label: 'presence', special: 1}, {name: 432, category: '2012', value: 7, label: 'licensed', special: 0}, {name: 433, category: '2012', value: 7, label: 'appear', special: 1}, {name: 434, category: '2012', value: 6, label: 'even though', special: 0}, {name: 435, category: '2012', value: 6, label: 'bought', special: 0}, {name: 436, category: '2012', value: 6, label: 'similar', special: 0}, {name: 437, category: '2012', value: 6, label: 'indicates', special: 0}, {name: 438, category: '2012', value: 6, label: 'instances', special: 0}, {name: 439, category: '2012', value: 6, label: 'pointed', special: 0}, {name: 440, category: '2012', value: 6, label: 'satisfied', special: 0}, {name: 441, category: '2012', value: 6, label: 'consistent', special: 0}, {name: 442, category: '2012', value: 6, label: 'addressed', special: 0}, {name: 443, category: '2012', value: 6, label: 'distribution', special: 0}, {name: 444, category: '2012', value: 6, label: 'nature', special: 1}, {name: 445, category: '2012', value: 6, label: 'repeated', special: 0}, {name: 446, category: '2012', value: 6, label: 'rather', special: 1}, {name: 447, category: '2012', value: 6, label: 'difference', special: 1}, {name: 448, category: '2012', value: 6, label: 'generalization', special: 0}, {name: 449, category: '2012', value: 6, label: 'organized', special: 0}, {name: 450, category: '2012', value: 6, label: 'detail', special: 0}, {name: 451, category: '2012', value: 6, label: 'despite', special: 0}, {name: 452, category: '2012', value: 6, label: 'antecedent', special: 0}, {name: 453, category: '2012', value: 6, label: 'recall', special: 1}, {name: 454, category: '2012', value: 6, label: 'observed', special: 0}, {name: 455, category: '2012', value: 5, label: 'phrase', special: 0}, {name: 456, category: '2012', value: 5, label: 'representation', special: 0}, {name: 457, category: '2012', value: 5, label: 'conclude', special: 0}, {name: 458, category: '2012', value: 5, label: 'version', special: 0}, {name: 459, category: '2012', value: 5, label: 'referred', special: 0}, {name: 460, category: '2012', value: 5, label: 'surface', special: 0}, {name: 461, category: '2012', value: 5, label: 'supports', special: 0}, {name: 462, category: '2012', value: 5, label: 'accounted', special: 0}, {name: 463, category: '2012', value: 5, label: 'arguments', special: 1}, {name: 464, category: '2012', value: 5, label: 'relevant', special: 0}, {name: 465, category: '2012', value: 5, label: 'article', special: 1}, {name: 466, category: '2012', value: 5, label: 'answer', special: 0}, {name: 467, category: '2012', value: 5, label: 'latter', special: 0}, {name: 468, category: '2012', value: 5, label: 'determined', special: 0}, {name: 469, category: '2012', value: 5, label: 'grateful', special: 0}, {name: 470, category: '2012', value: 5, label: 'demonstrate', special: 0}, {name: 471, category: '2012', value: 5, label: 'differ', special: 0}, {name: 472, category: '2012', value: 5, label: 'otherwise', special: 0}, {name: 473, category: '2012', value: 5, label: 'features', special: 1}, {name: 474, category: '2012', value: 5, label: 'different', special: 0}, {name: 475, category: '2012', value: 5, label: 'language', special: 1}, {name: 476, category: '2012', value: 5, label: 'hypothesis', special: 0}, {name: 477, category: '2012', value: 5, label: 'parallelism', special: 0}, {name: 478, category: '2012', value: 5, label: 'identical', special: 0}, {name: 479, category: '2012', value: 5, label: 'constituent', special: 0}, {name: 480, category: '2012', value: 5, label: 'reviewer', special: 0}, {name: 481, category: '2012', value: 5, label: 'claims', special: 0}, {name: 482, category: '2012', value: 5, label: 'ability', special: 0}, {name: 483, category: '2012', value: 5, label: 'expected', special: 1}, {name: 484, category: '2012', value: 5, label: 'existence', special: 1}, {name: 485, category: '2012', value: 5, label: 'incompatible', special: 0}, {name: 486, category: '2012', value: 5, label: 'principle', special: 0}, {name: 487, category: '2012', value: 5, label: 'indeed', special: 0}, {name: 488, category: '2012', value: 5, label: 'assumes', special: 0}, {name: 489, category: '2012', value: 5, label: 'specifiers', special: 0}, {name: 490, category: '2012', value: 5, label: 'sensitive', special: 0}, {name: 491, category: '2012', value: 5, label: 'examine', special: 0}, {name: 492, category: '2012', value: 5, label: 'acceptability', special: 0}, {name: 493, category: '2012', value: 5, label: 'traces', special: 0}, {name: 494, category: '2012', value: 5, label: 'embedded', special: 0}, {name: 495, category: '2012', value: 5, label: 'analyzed', special: 1}, {name: 496, category: '2012', value: 5, label: 'theories', special: 0}, {name: 497, category: '2012', value: 5, label: 'copies', special: 0}, {name: 498, category: '2012', value: 5, label: 'equivalent', special: 0}, {name: 499, category: '2012', value: 5, label: 'points', special: 0}, {name: 500, category: '2013', value: 10, label: 'complement', special: 1}, {name: 501, category: '2013', value: 10, label: 'presence', special: 1}, {name: 502, category: '2013', value: 10, label: 'conclusion', special: 1}, {name: 503, category: '2013', value: 10, label: 'analysis', special: 1}, {name: 504, category: '2013', value: 10, label: 'evidence', special: 1}, {name: 505, category: '2013', value: 10, label: 'result', special: 1}, {name: 506, category: '2013', value: 10, label: 'important', special: 1}, {name: 507, category: '2013', value: 9, label: 'impossible', special: 1}, {name: 508, category: '2013', value: 9, label: 'simply', special: 1}, {name: 509, category: '2013', value: 9, label: 'syntax', special: 1}, {name: 510, category: '2013', value: 9, label: 'appear', special: 1}, {name: 511, category: '2013', value: 9, label: 'structure', special: 1}, {name: 512, category: '2013', value: 9, label: 'conclude', special: 0}, {name: 513, category: '2013', value: 9, label: 'proposal', special: 1}, {name: 514, category: '2013', value: 9, label: 'expected', special: 1}, {name: 515, category: '2013', value: 9, label: 'recall', special: 1}, {name: 516, category: '2013', value: 9, label: 'according', special: 1}, {name: 517, category: '2013', value: 9, label: 'object', special: 1}, {name: 518, category: '2013', value: 9, label: 'notion', special: 0}, {name: 519, category: '2013', value: 8, label: 'support', special: 0}, {name: 520, category: '2013', value: 8, label: 'either', special: 1}, {name: 521, category: '2013', value: 8, label: 'others', special: 0}, {name: 522, category: '2013', value: 8, label: 'assumption', special: 1}, {name: 523, category: '2013', value: 8, label: 'problem', special: 1}, {name: 524, category: '2013', value: 8, label: 'literature', special: 1}, {name: 525, category: '2013', value: 8, label: 'clause', special: 1}, {name: 526, category: '2013', value: 8, label: 'surface', special: 0}, {name: 527, category: '2013', value: 8, label: 'appears', special: 0}, {name: 528, category: '2013', value: 8, label: 'suggested', special: 0}, {name: 529, category: '2013', value: 8, label: 'instances', special: 0}, {name: 530, category: '2013', value: 7, label: 'subjects', special: 0}, {name: 531, category: '2013', value: 7, label: 'phrase', special: 0}, {name: 532, category: '2013', value: 7, label: 'possibility', special: 0}, {name: 533, category: '2013', value: 7, label: 'similar', special: 0}, {name: 534, category: '2013', value: 7, label: 'involve', special: 0}, {name: 535, category: '2013', value: 7, label: 'hypothesis', special: 0}, {name: 536, category: '2013', value: 7, label: 'languages', special: 1}, {name: 537, category: '2013', value: 7, label: 'predicates', special: 0}, {name: 538, category: '2013', value: 7, label: 'particular', special: 0}, {name: 539, category: '2013', value: 7, label: 'argued', special: 1}, {name: 540, category: '2013', value: 7, label: 'theory', special: 1}, {name: 541, category: '2013', value: 7, label: 'effect', special: 1}, {name: 542, category: '2013', value: 7, label: 'things', special: 0}, {name: 543, category: '2013', value: 7, label: 'actually', special: 0}, {name: 544, category: '2013', value: 7, label: 'related', special: 0}, {name: 545, category: '2013', value: 7, label: 'analyses', special: 0}, {name: 546, category: '2013', value: 7, label: 'absent', special: 0}, {name: 547, category: '2013', value: 6, label: 'equivalent', special: 0}, {name: 548, category: '2013', value: 6, label: 'ability', special: 0}, {name: 549, category: '2013', value: 6, label: 'reason', special: 0}, {name: 550, category: '2013', value: 6, label: 'assumptions', special: 0}, {name: 551, category: '2013', value: 6, label: 'questions', special: 0}, {name: 552, category: '2013', value: 6, label: 'crucially', special: 0}, {name: 553, category: '2013', value: 6, label: 'necessary', special: 0}, {name: 554, category: '2013', value: 6, label: 'clearly', special: 0}, {name: 555, category: '2013', value: 6, label: 'derived', special: 1}, {name: 556, category: '2013', value: 6, label: 'correct', special: 0}, {name: 557, category: '2013', value: 6, label: 'showing', special: 0}, {name: 558, category: '2013', value: 6, label: 'would like', special: 1}, {name: 559, category: '2013', value: 6, label: 'despite', special: 0}, {name: 560, category: '2013', value: 6, label: 'domain', special: 0}, {name: 561, category: '2013', value: 6, label: 'detail', special: 0}, {name: 562, category: '2013', value: 6, label: 'sentences', special: 1}, {name: 563, category: '2013', value: 6, label: 'category', special: 0}, {name: 564, category: '2013', value: 6, label: 'contrast', special: 1}, {name: 565, category: '2013', value: 6, label: 'features', special: 1}, {name: 566, category: '2013', value: 6, label: 'contrary', special: 0}, {name: 567, category: '2013', value: 6, label: 'context', special: 1}, {name: 568, category: '2013', value: 6, label: 'binding', special: 0}, {name: 569, category: '2013', value: 6, label: 'required', special: 1}, {name: 570, category: '2013', value: 6, label: 'construction', special: 1}, {name: 571, category: '2013', value: 6, label: 'picture', special: 0}, {name: 572, category: '2013', value: 6, label: 'grammar', special: 1}, {name: 573, category: '2013', value: 6, label: 'considered', special: 0}, {name: 574, category: '2013', value: 6, label: 'giving', special: 0}, {name: 575, category: '2013', value: 6, label: 'generated', special: 0}, {name: 576, category: '2013', value: 5, label: 'discuss', special: 0}, {name: 577, category: '2013', value: 5, label: 'syntactic', special: 0}, {name: 578, category: '2013', value: 5, label: 'adjunct', special: 0}, {name: 579, category: '2013', value: 5, label: 'restricted', special: 0}, {name: 580, category: '2013', value: 5, label: 'system', special: 0}, {name: 581, category: '2013', value: 5, label: 'within', special: 0}, {name: 582, category: '2013', value: 5, label: 'require', special: 0}, {name: 583, category: '2013', value: 5, label: 'constructions', special: 0}, {name: 584, category: '2013', value: 5, label: 'passive', special: 0}, {name: 585, category: '2013', value: 5, label: 'represents', special: 0}, {name: 586, category: '2013', value: 5, label: 'prediction', special: 1}, {name: 587, category: '2013', value: 5, label: 'another', special: 0}, {name: 588, category: '2013', value: 5, label: 'presented', special: 1}, {name: 589, category: '2013', value: 5, label: 'include', special: 0}, {name: 590, category: '2013', value: 5, label: 'incompatible', special: 0}, {name: 591, category: '2013', value: 5, label: 'feature', special: 0}, {name: 592, category: '2013', value: 5, label: 'occurs', special: 0}, {name: 593, category: '2013', value: 5, label: 'distinguish', special: 0}, {name: 594, category: '2013', value: 5, label: 'sensitive', special: 0}, {name: 595, category: '2013', value: 5, label: 'extracted', special: 0}, {name: 596, category: '2013', value: 5, label: 'behavior', special: 0}, {name: 597, category: '2013', value: 5, label: 'determined', special: 0}, {name: 598, category: '2013', value: 5, label: 'internal structure', special: 0}, {name: 599, category: '2013', value: 5, label: 'adverbs', special: 0}, {name: 600, category: '2014', value: 10, label: 'whether', special: 1}, {name: 601, category: '2014', value: 10, label: 'evidence', special: 1}, {name: 602, category: '2014', value: 10, label: 'obligatory', special: 1}, {name: 603, category: '2014', value: 10, label: 'structure', special: 1}, {name: 604, category: '2014', value: 10, label: 'presented', special: 1}, {name: 605, category: '2014', value: 10, label: 'english', special: 1}, {name: 606, category: '2014', value: 9, label: 'instance', special: 1}, {name: 607, category: '2014', value: 9, label: 'language', special: 1}, {name: 608, category: '2014', value: 9, label: 'cannot', special: 1}, {name: 609, category: '2014', value: 9, label: 'languages', special: 1}, {name: 610, category: '2014', value: 9, label: 'examples', special: 1}, {name: 611, category: '2014', value: 9, label: 'available', special: 0}, {name: 612, category: '2014', value: 9, label: 'argument', special: 1}, {name: 613, category: '2014', value: 9, label: 'either', special: 1}, {name: 614, category: '2014', value: 9, label: 'assumption', special: 1}, {name: 615, category: '2014', value: 9, label: 'discussed', special: 1}, {name: 616, category: '2014', value: 8, label: 'addition', special: 0}, {name: 617, category: '2014', value: 8, label: 'interpreted', special: 0}, {name: 618, category: '2014', value: 8, label: 'sentence', special: 1}, {name: 619, category: '2014', value: 8, label: 'believe', special: 0}, {name: 620, category: '2014', value: 8, label: 'presence', special: 1}, {name: 621, category: '2014', value: 8, label: 'higher', special: 0}, {name: 622, category: '2014', value: 8, label: 'marked', special: 1}, {name: 623, category: '2014', value: 8, label: 'conclusion', special: 1}, {name: 624, category: '2014', value: 8, label: 'correct', special: 0}, {name: 625, category: '2014', value: 8, label: 'availability', special: 0}, {name: 626, category: '2014', value: 8, label: 'speakers', special: 0}, {name: 627, category: '2014', value: 8, label: 'existence', special: 1}, {name: 628, category: '2014', value: 8, label: 'understood', special: 0}, {name: 629, category: '2014', value: 8, label: 'proposal', special: 1}, {name: 630, category: '2014', value: 7, label: 'crucial', special: 0}, {name: 631, category: '2014', value: 7, label: 'course', special: 0}, {name: 632, category: '2014', value: 7, label: 'number', special: 1}, {name: 633, category: '2014', value: 7, label: 'particular', special: 0}, {name: 634, category: '2014', value: 7, label: 'argues', special: 0}, {name: 635, category: '2014', value: 7, label: 'ungrammatical', special: 0}, {name: 636, category: '2014', value: 7, label: 'derive', special: 0}, {name: 637, category: '2014', value: 7, label: 'compatible', special: 0}, {name: 638, category: '2014', value: 7, label: 'formed', special: 0}, {name: 639, category: '2014', value: 7, label: 'problem', special: 1}, {name: 640, category: '2014', value: 7, label: 'principle', special: 0}, {name: 641, category: '2014', value: 7, label: 'determined', special: 0}, {name: 642, category: '2014', value: 7, label: 'requirement', special: 0}, {name: 643, category: '2014', value: 7, label: 'observed', special: 0}, {name: 644, category: '2014', value: 7, label: 'difference', special: 1}, {name: 645, category: '2014', value: 7, label: 'clauses', special: 0}, {name: 646, category: '2014', value: 7, label: 'assigned', special: 0}, {name: 647, category: '2014', value: 7, label: 'always', special: 0}, {name: 648, category: '2014', value: 7, label: 'something', special: 0}, {name: 649, category: '2014', value: 7, label: 'analyzed', special: 1}, {name: 650, category: '2014', value: 7, label: 'additionally', special: 0}, {name: 651, category: '2014', value: 7, label: 'interpretation', special: 0}, {name: 652, category: '2014', value: 6, label: 'interestingly', special: 0}, {name: 653, category: '2014', value: 6, label: 'status', special: 0}, {name: 654, category: '2014', value: 6, label: 'relevant', special: 0}, {name: 655, category: '2014', value: 6, label: 'allows', special: 0}, {name: 656, category: '2014', value: 6, label: 'theory', special: 1}, {name: 657, category: '2014', value: 6, label: 'introduction', special: 0}, {name: 658, category: '2014', value: 6, label: 'appear', special: 1}, {name: 659, category: '2014', value: 6, label: 'predicted', special: 0}, {name: 660, category: '2014', value: 6, label: 'judgments', special: 0}, {name: 661, category: '2014', value: 6, label: 'identical', special: 0}, {name: 662, category: '2014', value: 6, label: 'phrase', special: 0}, {name: 663, category: '2014', value: 6, label: 'contrary', special: 0}, {name: 664, category: '2014', value: 6, label: 'making', special: 0}, {name: 665, category: '2014', value: 6, label: 'future research', special: 0}, {name: 666, category: '2014', value: 6, label: 'recall', special: 1}, {name: 667, category: '2014', value: 6, label: 'restriction', special: 0}, {name: 668, category: '2014', value: 6, label: 'capture', special: 0}, {name: 669, category: '2014', value: 6, label: 'complex', special: 0}, {name: 670, category: '2014', value: 6, label: 'support', special: 0}, {name: 671, category: '2014', value: 6, label: 'extended', special: 0}, {name: 672, category: '2014', value: 6, label: 'explanation', special: 1}, {name: 673, category: '2014', value: 6, label: 'explain', special: 0}, {name: 674, category: '2014', value: 6, label: 'property', special: 0}, {name: 675, category: '2014', value: 6, label: 'assuming', special: 1}, {name: 676, category: '2014', value: 6, label: 'derived', special: 1}, {name: 677, category: '2014', value: 6, label: 'semantics', special: 0}, {name: 678, category: '2014', value: 6, label: 'provide', special: 1}, {name: 679, category: '2014', value: 6, label: 'others', special: 0}, {name: 680, category: '2014', value: 6, label: 'option', special: 0}, {name: 681, category: '2014', value: 5, label: 'subject position', special: 0}, {name: 682, category: '2014', value: 5, label: 'one hand', special: 0}, {name: 683, category: '2014', value: 5, label: 'observation', special: 1}, {name: 684, category: '2014', value: 5, label: 'negation', special: 0}, {name: 685, category: '2014', value: 5, label: 'supported', special: 0}, {name: 686, category: '2014', value: 5, label: 'matrix clause', special: 0}, {name: 687, category: '2014', value: 5, label: 'patterns', special: 0}, {name: 688, category: '2014', value: 5, label: 'approach', special: 0}, {name: 689, category: '2014', value: 5, label: 'phrases', special: 0}, {name: 690, category: '2014', value: 5, label: 'investigation', special: 0}, {name: 691, category: '2014', value: 5, label: 'introduces', special: 0}, {name: 692, category: '2014', value: 5, label: 'beyond', special: 0}, {name: 693, category: '2014', value: 5, label: 'preceded', special: 0}, {name: 694, category: '2014', value: 5, label: 'important', special: 1}, {name: 695, category: '2014', value: 5, label: 'grammar', special: 1}, {name: 696, category: '2014', value: 5, label: 'generalization', special: 0}, {name: 697, category: '2014', value: 5, label: 'function', special: 0}, {name: 698, category: '2014', value: 5, label: 'fronted', special: 0}, {name: 699, category: '2014', value: 5, label: 'specifically', special: 1}, {name: 700, category: '2015', value: 1, label: 'two types of analyses have been suggested for an English comparative like (1)', special: 1}, {name: 701, category: '2015', value: 10, label: 'context', special: 1}, {name: 702, category: '2015', value: 10, label: 'analyzed', special: 1}, {name: 703, category: '2015', value: 10, label: 'difference', special: 1}, {name: 704, category: '2015', value: 10, label: 'prediction', special: 1}, {name: 705, category: '2015', value: 10, label: 'required', special: 1}, {name: 706, category: '2015', value: 10, label: 'nature', special: 1}, {name: 707, category: '2015', value: 10, label: 'existence', special: 1}, {name: 708, category: '2015', value: 9, label: 'properties', special: 1}, {name: 709, category: '2015', value: 9, label: 'german', special: 1}, {name: 710, category: '2015', value: 9, label: 'features', special: 1}, {name: 711, category: '2015', value: 9, label: 'discussed', special: 1}, {name: 712, category: '2015', value: 9, label: 'appears', special: 0}, {name: 713, category: '2015', value: 9, label: 'particular', special: 0}, {name: 714, category: '2015', value: 9, label: 'argued', special: 1}, {name: 715, category: '2015', value: 9, label: 'according', special: 1}, {name: 716, category: '2015', value: 9, label: 'addition', special: 0}, {name: 717, category: '2015', value: 9, label: 'specifically', special: 1}, {name: 718, category: '2015', value: 9, label: 'language', special: 1}, {name: 719, category: '2015', value: 9, label: 'within', special: 0}, {name: 720, category: '2015', value: 8, label: 'indicated', special: 0}, {name: 721, category: '2015', value: 8, label: 'either', special: 1}, {name: 722, category: '2015', value: 8, label: 'impossible', special: 1}, {name: 723, category: '2015', value: 8, label: 'without', special: 0}, {name: 724, category: '2015', value: 8, label: 'explained', special: 0}, {name: 725, category: '2015', value: 8, label: 'problem', special: 1}, {name: 726, category: '2015', value: 8, label: 'general', special: 0}, {name: 727, category: '2015', value: 8, label: 'hypothesis', special: 0}, {name: 728, category: '2015', value: 8, label: 'conclude', special: 0}, {name: 729, category: '2015', value: 8, label: 'propose', special: 1}, {name: 730, category: '2015', value: 8, label: 'derived', special: 1}, {name: 731, category: '2015', value: 8, label: 'subjects', special: 0}, {name: 732, category: '2015', value: 8, label: 'phenomenon', special: 0}, {name: 733, category: '2015', value: 8, label: 'literature', special: 1}, {name: 734, category: '2015', value: 7, label: 'feature', special: 0}, {name: 735, category: '2015', value: 7, label: 'exclude', special: 0}, {name: 736, category: '2015', value: 7, label: 'pronoun', special: 0}, {name: 737, category: '2015', value: 7, label: 'assumptions', special: 0}, {name: 738, category: '2015', value: 7, label: 'derive', special: 0}, {name: 739, category: '2015', value: 7, label: 'restricted', special: 0}, {name: 740, category: '2015', value: 7, label: 'clearly', special: 0}, {name: 741, category: '2015', value: 7, label: 'simply', special: 1}, {name: 742, category: '2015', value: 7, label: 'constructions', special: 0}, {name: 743, category: '2015', value: 7, label: 'suggested', special: 0}, {name: 744, category: '2015', value: 7, label: 'ambiguous', special: 0}, {name: 745, category: '2015', value: 7, label: 'involved', special: 0}, {name: 746, category: '2015', value: 7, label: 'suggestion', special: 0}, {name: 747, category: '2015', value: 7, label: 'compared', special: 0}, {name: 748, category: '2015', value: 7, label: 'accounts', special: 0}, {name: 749, category: '2015', value: 7, label: 'recall', special: 1}, {name: 750, category: '2015', value: 7, label: 'course', special: 0}, {name: 751, category: '2015', value: 7, label: 'explain', special: 0}, {name: 752, category: '2015', value: 7, label: 'others', special: 0}, {name: 753, category: '2015', value: 7, label: 'different', special: 0}, {name: 754, category: '2015', value: 7, label: 'mechanism', special: 0}, {name: 755, category: '2015', value: 7, label: 'excluded', special: 0}, {name: 756, category: '2015', value: 7, label: 'address', special: 0}, {name: 757, category: '2015', value: 7, label: 'return', special: 0}, {name: 758, category: '2015', value: 6, label: 'approaches', special: 0}, {name: 759, category: '2015', value: 6, label: 'clause', special: 1}, {name: 760, category: '2015', value: 6, label: 'essentially', special: 0}, {name: 761, category: '2015', value: 6, label: 'responsible', special: 0}, {name: 762, category: '2015', value: 6, label: 'surface', special: 0}, {name: 763, category: '2015', value: 6, label: 'combine', special: 0}, {name: 764, category: '2015', value: 6, label: 'resolve', special: 0}, {name: 765, category: '2015', value: 6, label: 'semantic', special: 0}, {name: 766, category: '2015', value: 6, label: 'supported', special: 0}, {name: 767, category: '2015', value: 6, label: 'matter', special: 0}, {name: 768, category: '2015', value: 6, label: 'ellipsis', special: 0}, {name: 769, category: '2015', value: 6, label: 'contains', special: 0}, {name: 770, category: '2015', value: 6, label: 'problems', special: 0}, {name: 771, category: '2015', value: 6, label: 'repeated', special: 0}, {name: 772, category: '2015', value: 6, label: 'things', special: 0}, {name: 773, category: '2015', value: 6, label: 'effect', special: 1}, {name: 774, category: '2015', value: 6, label: 'similar', special: 0}, {name: 775, category: '2015', value: 6, label: 'complements', special: 0}, {name: 776, category: '2015', value: 6, label: 'binding', special: 0}, {name: 777, category: '2015', value: 6, label: 'choice', special: 0}, {name: 778, category: '2015', value: 6, label: 'composed', special: 0}, {name: 779, category: '2015', value: 6, label: 'occurs', special: 0}, {name: 780, category: '2015', value: 6, label: 'grammatical', special: 0}, {name: 781, category: '2015', value: 6, label: 'grammar', special: 1}, {name: 782, category: '2015', value: 6, label: 'pointed', special: 0}, {name: 783, category: '2015', value: 6, label: 'formed', special: 0}, {name: 784, category: '2015', value: 6, label: 'structures', special: 0}, {name: 785, category: '2015', value: 6, label: 'alternatively', special: 0}, {name: 786, category: '2015', value: 6, label: 'intuition', special: 0}, {name: 787, category: '2015', value: 6, label: 'purposes', special: 0}, {name: 788, category: '2015', value: 6, label: 'determined', special: 0}, {name: 789, category: '2015', value: 6, label: 'applied', special: 0}, {name: 790, category: '2015', value: 6, label: 'generalization', special: 0}, {name: 791, category: '2015', value: 5, label: 'designed', special: 0}, {name: 792, category: '2015', value: 5, label: 'pattern', special: 0}, {name: 793, category: '2015', value: 5, label: 'perspective', special: 0}, {name: 794, category: '2015', value: 5, label: 'determine', special: 0}, {name: 795, category: '2015', value: 5, label: 'structural', special: 0}, {name: 796, category: '2015', value: 5, label: 'stated', special: 0}, {name: 797, category: '2015', value: 5, label: 'participants', special: 0}, {name: 798, category: '2015', value: 5, label: 'condition', special: 0}, {name: 799, category: '2015', value: 5, label: 'differences', special: 0}, {name: 800, category: '2015', value: 5, label: 'raising', special: 0}, {name: 801, category: '2016', value: 10, label: 'whether', special: 1}, {name: 802, category: '2016', value: 10, label: 'clause', special: 1}, {name: 803, category: '2016', value: 10, label: 'movement', special: 1}, {name: 804, category: '2016', value: 10, label: 'object', special: 1}, {name: 805, category: '2016', value: 10, label: 'second', special: 1}, {name: 806, category: '2016', value: 10, label: 'result', special: 1}, {name: 807, category: '2016', value: 10, label: 'assume', special: 1}, {name: 808, category: '2016', value: 10, label: 'examples', special: 1}, {name: 809, category: '2016', value: 9, label: 'cannot', special: 1}, {name: 810, category: '2016', value: 9, label: 'grammar', special: 1}, {name: 811, category: '2016', value: 9, label: 'possibility', special: 0}, {name: 812, category: '2016', value: 9, label: 'respect', special: 1}, {name: 813, category: '2016', value: 9, label: 'propose', special: 1}, {name: 814, category: '2016', value: 9, label: 'contrast', special: 1}, {name: 815, category: '2016', value: 8, label: 'feature', special: 0}, {name: 816, category: '2016', value: 8, label: 'conclude', special: 0}, {name: 817, category: '2016', value: 8, label: 'whereas', special: 1}, {name: 818, category: '2016', value: 8, label: 'finally', special: 1}, {name: 819, category: '2016', value: 8, label: 'constructions', special: 0}, {name: 820, category: '2016', value: 8, label: 'follow', special: 0}, {name: 821, category: '2016', value: 8, label: 'regardless', special: 0}, {name: 822, category: '2016', value: 8, label: 'available', special: 0}, {name: 823, category: '2016', value: 8, label: 'complement', special: 1}, {name: 824, category: '2016', value: 8, label: 'return', special: 0}, {name: 825, category: '2016', value: 8, label: 'pattern', special: 0}, {name: 826, category: '2016', value: 8, label: 'instead', special: 0}, {name: 827, category: '2016', value: 8, label: 'neither', special: 0}, {name: 828, category: '2016', value: 7, label: 'spelled', special: 0}, {name: 829, category: '2016', value: 7, label: 'discussed', special: 1}, {name: 830, category: '2016', value: 7, label: 'material', special: 0}, {name: 831, category: '2016', value: 7, label: 'domain', special: 0}, {name: 832, category: '2016', value: 7, label: 'see sect', special: 0}, {name: 833, category: '2016', value: 7, label: 'licensed', special: 0}, {name: 834, category: '2016', value: 7, label: 'results', special: 1}, {name: 835, category: '2016', value: 7, label: 'clearly', special: 0}, {name: 836, category: '2016', value: 7, label: 'latter', special: 0}, {name: 837, category: '2016', value: 7, label: 'languages', special: 1}, {name: 838, category: '2016', value: 7, label: 'next section', special: 0}, {name: 839, category: '2016', value: 7, label: 'context', special: 1}, {name: 840, category: '2016', value: 7, label: 'instance', special: 1}, {name: 841, category: '2016', value: 7, label: 'always', special: 0}, {name: 842, category: '2016', value: 7, label: 'interestingly', special: 0}, {name: 843, category: '2016', value: 7, label: 'argues', special: 0}, {name: 844, category: '2016', value: 6, label: 'explain', special: 0}, {name: 845, category: '2016', value: 6, label: 'similarly', special: 0}, {name: 846, category: '2016', value: 6, label: 'nothing', special: 0}, {name: 847, category: '2016', value: 6, label: 'triggered', special: 0}, {name: 848, category: '2016', value: 6, label: 'observation', special: 1}, {name: 849, category: '2016', value: 6, label: 'article', special: 1}, {name: 850, category: '2016', value: 6, label: 'agreement', special: 1}, {name: 851, category: '2016', value: 6, label: 'absence', special: 1}, {name: 852, category: '2016', value: 6, label: 'speakers', special: 0}, {name: 853, category: '2016', value: 6, label: 'appear', special: 1}, {name: 854, category: '2016', value: 6, label: 'general', special: 0}, {name: 855, category: '2016', value: 6, label: 'different', special: 0}, {name: 856, category: '2016', value: 6, label: 'differences', special: 0}, {name: 857, category: '2016', value: 6, label: 'grammatical', special: 0}, {name: 858, category: '2016', value: 6, label: 'marked', special: 1}, {name: 859, category: '2016', value: 6, label: 'reasons', special: 0}, {name: 860, category: '2016', value: 6, label: 'ungrammaticality', special: 0}, {name: 861, category: '2016', value: 6, label: 'left periphery', special: 0}, {name: 862, category: '2016', value: 6, label: 'relation', special: 0}, {name: 863, category: '2016', value: 6, label: 'impossible', special: 1}, {name: 864, category: '2016', value: 6, label: 'indeed', special: 0}, {name: 865, category: '2016', value: 6, label: 'clauses', special: 0}, {name: 866, category: '2016', value: 6, label: 'consequence', special: 0}, {name: 867, category: '2016', value: 6, label: 'subjects', special: 0}, {name: 868, category: '2016', value: 6, label: 'consistent', special: 0}, {name: 869, category: '2016', value: 6, label: 'presence', special: 1}, {name: 870, category: '2016', value: 6, label: 'suppose', special: 0}, {name: 871, category: '2016', value: 6, label: 'constituent', special: 0}, {name: 872, category: '2016', value: 5, label: 'yields', special: 0}, {name: 873, category: '2016', value: 5, label: 'reading', special: 0}, {name: 874, category: '2016', value: 5, label: 'adjoined', special: 0}, {name: 875, category: '2016', value: 5, label: 'information', special: 0}, {name: 876, category: '2016', value: 5, label: 'complements', special: 0}, {name: 877, category: '2016', value: 5, label: 'involve', special: 0}, {name: 878, category: '2016', value: 5, label: 'suggested', special: 0}, {name: 879, category: '2016', value: 5, label: 'alternative', special: 0}, {name: 880, category: '2016', value: 5, label: 'irrelevant', special: 0}, {name: 881, category: '2016', value: 5, label: 'considered', special: 0}, {name: 882, category: '2016', value: 5, label: 'japanese', special: 0}, {name: 883, category: '2016', value: 5, label: 'process', special: 0}, {name: 884, category: '2016', value: 5, label: 'additionally', special: 0}, {name: 885, category: '2016', value: 5, label: 'adverb', special: 0}, {name: 886, category: '2016', value: 5, label: 'addition', special: 0}, {name: 887, category: '2016', value: 5, label: 'availability', special: 0}, {name: 888, category: '2016', value: 5, label: 'replaced', special: 0}, {name: 889, category: '2016', value: 5, label: 'representation', special: 0}, {name: 890, category: '2016', value: 5, label: 'precisely', special: 0}, {name: 891, category: '2016', value: 5, label: 'crucially', special: 0}, {name: 892, category: '2016', value: 5, label: 'restricted', special: 0}, {name: 893, category: '2016', value: 5, label: 'restriction', special: 0}, {name: 894, category: '2016', value: 5, label: 'allows', special: 0}, {name: 895, category: '2016', value: 5, label: 'matrix', special: 0}, {name: 896, category: '2016', value: 5, label: 'assumptions', special: 0}, {name: 897, category: '2016', value: 5, label: 'matrix clause', special: 0}, {name: 898, category: '2016', value: 5, label: 'unlike', special: 0}, {name: 899, category: '2016', value: 5, label: 'despite', special: 0}, {name: 900, category: '2016', value: 5, label: 'returning', special: 0}, {name: 901, category: '2017', value: 10, label: 'provided', special: 1}, {name: 902, category: '2017', value: 10, label: 'appear', special: 1}, {name: 903, category: '2017', value: 10, label: 'literature', special: 1}, {name: 904, category: '2017', value: 10, label: 'contrast', special: 1}, {name: 905, category: '2017', value: 10, label: 'provide', special: 1}, {name: 906, category: '2017', value: 9, label: 'sentence', special: 1}, {name: 907, category: '2017', value: 9, label: 'evidence', special: 1}, {name: 908, category: '2017', value: 9, label: 'arguments', special: 1}, {name: 909, category: '2017', value: 9, label: 'observation', special: 1}, {name: 910, category: '2017', value: 9, label: 'derived', special: 1}, {name: 911, category: '2017', value: 9, label: 'absence', special: 1}, {name: 912, category: '2017', value: 9, label: 'consider', special: 1}, {name: 913, category: '2017', value: 9, label: 'presence', special: 1}, {name: 914, category: '2017', value: 9, label: 'present', special: 1}, {name: 915, category: '2017', value: 9, label: 'result', special: 1}, {name: 916, category: '2017', value: 8, label: 'unlike', special: 0}, {name: 917, category: '2017', value: 8, label: 'suggest', special: 1}, {name: 918, category: '2017', value: 8, label: 'difficult', special: 0}, {name: 919, category: '2017', value: 8, label: 'difference', special: 1}, {name: 920, category: '2017', value: 8, label: 'addition', special: 0}, {name: 921, category: '2017', value: 8, label: 'relevant', special: 0}, {name: 922, category: '2017', value: 8, label: 'cannot', special: 1}, {name: 923, category: '2017', value: 8, label: 'prediction', special: 1}, {name: 924, category: '2017', value: 8, label: 'explanation', special: 1}, {name: 925, category: '2017', value: 8, label: 'assumption', special: 1}, {name: 926, category: '2017', value: 8, label: 'realized', special: 0}, {name: 927, category: '2017', value: 8, label: 'particular', special: 0}, {name: 928, category: '2017', value: 8, label: 'merged', special: 0}, {name: 929, category: '2017', value: 7, label: 'different', special: 0}, {name: 930, category: '2017', value: 7, label: 'existence', special: 1}, {name: 931, category: '2017', value: 7, label: 'reason', special: 0}, {name: 932, category: '2017', value: 7, label: 'believe', special: 0}, {name: 933, category: '2017', value: 7, label: 'clearly', special: 0}, {name: 934, category: '2017', value: 7, label: 'assumed', special: 0}, {name: 935, category: '2017', value: 7, label: 'accounted', special: 0}, {name: 936, category: '2017', value: 7, label: 'remainder', special: 0}, {name: 937, category: '2017', value: 7, label: 'associated', special: 0}, {name: 938, category: '2017', value: 7, label: 'observed', special: 0}, {name: 939, category: '2017', value: 7, label: 'similar', special: 0}, {name: 940, category: '2017', value: 7, label: 'following', special: 0}, {name: 941, category: '2017', value: 7, label: 'allowed', special: 0}, {name: 942, category: '2017', value: 7, label: 'grammatical', special: 0}, {name: 943, category: '2017', value: 7, label: 'consistent', special: 0}, {name: 944, category: '2017', value: 6, label: 'presented', special: 1}, {name: 945, category: '2017', value: 6, label: 'contain', special: 0}, {name: 946, category: '2017', value: 6, label: 'generally', special: 0}, {name: 947, category: '2017', value: 6, label: 'capture', special: 0}, {name: 948, category: '2017', value: 6, label: 'well known', special: 0}, {name: 949, category: '2017', value: 6, label: 'combination', special: 0}, {name: 950, category: '2017', value: 6, label: 'approach', special: 0}, {name: 951, category: '2017', value: 6, label: 'proposals', special: 0}, {name: 952, category: '2017', value: 6, label: 'phonological form', special: 0}, {name: 953, category: '2017', value: 6, label: 'correct', special: 0}, {name: 954, category: '2017', value: 6, label: 'followed', special: 0}, {name: 955, category: '2017', value: 6, label: 'course', special: 0}, {name: 956, category: '2017', value: 6, label: 'pattern', special: 0}, {name: 957, category: '2017', value: 6, label: 'ungrammatical', special: 0}, {name: 958, category: '2017', value: 6, label: 'organized', special: 0}, {name: 959, category: '2017', value: 6, label: 'situation', special: 0}, {name: 960, category: '2017', value: 6, label: 'derive', special: 0}, {name: 961, category: '2017', value: 6, label: 'interaction', special: 0}, {name: 962, category: '2017', value: 6, label: 'analyzed', special: 1}, {name: 963, category: '2017', value: 6, label: 'something', special: 0}, {name: 964, category: '2017', value: 6, label: 'feature', special: 0}, {name: 965, category: '2017', value: 6, label: 'conclusion', special: 1}, {name: 966, category: '2017', value: 6, label: 'conclude', special: 0}, {name: 967, category: '2017', value: 6, label: 'suppose', special: 0}, {name: 968, category: '2017', value: 6, label: 'involves', special: 0}, {name: 969, category: '2017', value: 6, label: 'neither', special: 0}, {name: 970, category: '2017', value: 6, label: 'attested', special: 0}, {name: 971, category: '2017', value: 6, label: 'elements', special: 0}, {name: 972, category: '2017', value: 6, label: 'latter', special: 0}, {name: 973, category: '2017', value: 6, label: 'available', special: 0}, {name: 974, category: '2017', value: 6, label: 'meaning', special: 0}, {name: 975, category: '2017', value: 6, label: 'regardless', special: 0}, {name: 976, category: '2017', value: 5, label: 'even though', special: 0}, {name: 977, category: '2017', value: 5, label: 'licensing', special: 0}, {name: 978, category: '2017', value: 5, label: 'explained', special: 0}, {name: 979, category: '2017', value: 5, label: 'relation', special: 0}, {name: 980, category: '2017', value: 5, label: 'license', special: 0}, {name: 981, category: '2017', value: 5, label: 'two types', special: 0}, {name: 982, category: '2017', value: 5, label: 'provides', special: 0}, {name: 983, category: '2017', value: 5, label: 'moreover', special: 0}, {name: 984, category: '2017', value: 5, label: 'requirement', special: 0}, {name: 985, category: '2017', value: 5, label: 'follow', special: 0}, {name: 986, category: '2017', value: 5, label: 'status', special: 0}, {name: 987, category: '2017', value: 5, label: 'anonymous reviewer', special: 0}, {name: 988, category: '2017', value: 5, label: 'moving', special: 0}, {name: 989, category: '2017', value: 5, label: 'attention', special: 0}, {name: 990, category: '2017', value: 5, label: 'principle', special: 0}, {name: 991, category: '2017', value: 5, label: 'previous section', special: 0}, {name: 992, category: '2017', value: 5, label: 'general', special: 0}, {name: 993, category: '2017', value: 5, label: 'schematized', special: 0}, {name: 994, category: '2017', value: 5, label: 'involved', special: 0}, {name: 995, category: '2017', value: 5, label: 'already', special: 0}, {name: 996, category: '2017', value: 5, label: 'building', special: 0}, {name: 997, category: '2017', value: 5, label: 'universal', special: 0}, {name: 998, category: '2017', value: 5, label: 'important', special: 1}, {name: 999, category: '2017', value: 5, label: 'importantly', special: 0}, {name: 1000, category: '2017', value: 5, label: 'instead', special: 0}, ];
module.exports = { "form": { "title-text": "The best coffee on the road", "hint-content": "Illusionist illustrates illusorily" } };
const facebookProfile = { name: "Felix", friends: 1398, messages: ["Hello World", "So long, and thanks for all the fish."], postMessage: function(message){ facebookProfile.messages.push(message); }, deleteMessage: function(index){ facebookProfile.messages.splice(index, 1); }, addFriend: function(){ facebookProfile.friends++; }, removeFriend: function(){ facebookProfile.friends--; } }
(function() { "use strict"; angular.module('public') .controller('SignUpController', SignUpController); SignUpController.$inject = ['SignUpService', 'MenuService', '$scope']; function SignUpController(SignUpService, MenuService, $scope) { var $ctrl = this; $ctrl.signedUp = false; $ctrl.submit = function () { validMenuItem($ctrl.user.favoriteItem).then(function (itemExists) { if (itemExists) { SignUpService.signUp($ctrl.user); $ctrl.signedUp = true; $ctrl.user = {}; $scope.newsletterForm.$setPristine(); $scope.newsletterForm.$setUntouched(); } else { $ctrl.user.favoriteItem = ""; alert('Sorry, but we could not locate your favorite menu item. Please make sure you entered a valid code.'); }; }); }; var validMenuItem = function (shortName) { return MenuService.getMenuItem(shortName).then(function (item) { return item != null; }); }; }; })();
'use strict'; import gulp from 'gulp'; import runSequence from 'run-sequence'; gulp.task('staging', ['clean'], function(cb) { cb = cb || function() {}; global.isProd = true; global.env = 'staging'; runSequence('browserify', 'gzip', 'preprocess', 'deploy', cb); });
import React from 'react' export const SidebarData_Teacher = [ { title : "Dashboard" , icon : <i class="fa fa-home fa-1x" aria-hidden="true"></i> , link : "/home_t" }, // { // title : "Create Group" , // icon : <AddBoxIcon /> , // link : "/create_t" // }, { title : "Group" , icon : <i class="fa fa-users fa-1x" aria-hidden="true"></i> , link : "/group_t" }, { title : "My Group" , icon : <i class="fa fa-briefcase fa-1x" aria-hidden="true"></i> , link : "/mygroup_t" }, { title : "Calendar" , icon : <i class="fa fa-calendar fa-1x" aria-hidden="true"></i>, link : "/calendar_t" }, { title : "Setting" , icon : <i class="fa fa-cog fa-1x" aria-hidden="true"></i> , link : "/setting_t" }, ];
import React from 'react'; import { Link } from 'react-router-dom'; import './Navbar.css'; const Navbar = () => { return ( <div> <nav class="navbar navbar-expand-lg fixed-top nav"> <div class="container-fluid"> <a class="navbar-brand" href="#"> <span style={{color:'black'}}><h2>KHK</h2></span> </a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav ml-auto mb-2 mb-lg-0"> <li class="nav-item"> <Link class="nav-link text-dark" to="/">HOME</Link> </li> <li class="nav-item"> <Link class="nav-link text-dark" to="/about">ABOUT</Link> </li> <li class="nav-item"> <Link class="nav-link text-dark" to="/projects">PROJECTS</Link> </li> <li class="nav-item"> <Link class="nav-link text-dark" to="/blog">BLOG</Link> </li> <li class="nav-item"> <Link class="nav-link text-dark" to="/contact">CONTACT</Link> </li> </ul> </div> </div> </nav> </div> ); }; export default Navbar;
// Global library to hold values userLibrary = new Map(); // User constructor function const user = function(email, password, passwordConfirm) { this.email = email; this.password = password; this.passwordConfirm = passwordConfirm; this.isVerified = false; this.isSignedIn = false; return this; } // Sign up function signUp(user) { if (typeof userLibrary.set(user.email) != "undefined") { console.log("Thank you for signing up!"); save(user); user.isVerified = true; } } // Save function save(user) { userLibrary.set(user.email, user); } //sign-in function signIn(user) { if (typeof userLibrary.get(user.email) != "undefined") { user.authenticate(user.email, user.password); console.log("Welcome"); } else { console.log("Sorry, wrong credentials. Please try again"); } } //sign out function signOut(user) { if (user.isSignedIn) { user.isSignedIn = false; console.log("You have been signed out"); } } // function to change password changePassword(previous, next) { if (previous === userLibrary.get(user.email).password) { user.password = next; console.log("Password change successful!"); } } // authenticate user function authenticate(email, password) { if (userLibrary.get(email).password === password) { user.isVerified = true; user.isSignedIn = true; } } module.exports = (user, signIn, SignUp, signOut, changePassword)
import React, { Fragment, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { useDispatch, useSelector } from 'react-redux'; import { useAlert } from 'react-alert'; import { MDBDataTable } from 'mdbreact' import MetaData from '../../layout/MetaData'; import Loader from '../../layout/Loader'; import Sidebar from '../layout/Sidebar'; import { getAllUsers , clearErrors, deleteUser } from '../../../redux/actions/authActions'; const UsersList = () => { const alert = useAlert(); const dispatch = useDispatch(); const { allUsersInProcess, users, error } = useSelector(state => state.allUsers); const { updateUserInProcess, error: updateUserError, isDeleted } = useSelector(state => state.updateUser); useEffect(() => { dispatch(getAllUsers()); if (error) { alert.error(error); dispatch(clearErrors()); } if (updateUserError) { alert.error(error); dispatch(clearErrors()); } }, [dispatch, alert, error, updateUserInProcess, updateUserError]); const deleteProductHandler = (id) => { dispatch(deleteUser(id)) } const setUsers = () => { const data = { columns: [ { label: 'User ID', field: 'id', sort: 'asc' }, { label: 'Name', field: 'name', sort: 'asc' }, { label: 'Email', field: 'email', sort: 'asc' }, { label: 'Role', field: 'role', sort: 'asc' }, { label: 'Actions', field: 'actions', }, ], rows: [] } users && users.map(user => { data.rows.push({ id: user._id, name : user.name, email: user.email, role: user.role, actions: <Fragment> <Link to={`/admin/user/${user._id}`} className="btn btn-primary"> <i className="fa fa-pencil"></i> </Link> <button className="btn btn-danger py-1 px-2 ml-2" onClick={() => deleteProductHandler(user._id)}> <i className="fa fa-trash"></i> </button> </Fragment> }); return user ; }) return data; } return ( <Fragment> <MetaData title={'All Users'} /> <div className="row"> <div className="col-12 col-md-2"> <Sidebar /> </div> <div className="col-12 col-md-10"> <Fragment > <h1 className="my-5" >All Orders</h1> {allUsersInProcess ? <Loader /> : ( <MDBDataTable data={setUsers()} className="px-3" striped bordered hover /> )} </Fragment> </div> </div> </Fragment> ) } export default UsersList
module.exports = class Node { constructor({socket, ...data}) { this.socket = socket; this.data = data; } getData() { return this.data; } matchesName(name) { const tmp = name.split(':'); const [browser, browserVersion] = tmp[0].split('@'); let os, osVersion; if(tmp[1]) [os, osVersion] = tmp[1].split(' '); let match = this.data.browser === browser; if(browserVersion && !this.data.browserVersion.startsWith(browserVersion)) match = false; if(os && this.data.os !== os) match = false; if(osVersion && !this.data.osVersion.startsWith(osVersion)) match = false; return match; } async openBrowser(id, url) { return new Promise((resolve, reject) => { this.socket.emit('open-browser', {id, url}, res => { if(res === true) return resolve(); reject(new Error(res)); }); }); } async closeBrowser(id) { return new Promise((resolve, reject) => { this.socket.emit('close-browser', {id}, res => { if(res === true) return resolve(); reject(new Error(res)); }); }); } async canResizeToDimensions() { return false; } async maximizeWindow() { console.log('TODO maximizeWindow'); } async resizeWindow() { throw new Error('Not supported'); } async takeScreenshot() { console.log('TODO takeScreenshot'); } };
/* eslint-disable react/prefer-stateless-function, react/jsx-filename-extension, max-len, react/prop-types */ import React, { Component } from 'react'; import { Link } from 'react-router-dom'; function Header() { return ( <header className="container d-flex justify-content-center"> <div className="head d-inline-flex flex-column justify-content-center"> <div> <h1> &gt;_Hi! I&apos;m Wayne Su, </h1> </div> <div className="spaces"> <h1>And I&apos;m passionate about <u className="code">coding</u>, <u className="science">data science</u> &amp; <u className="design">visual design</u>! </h1> </div> </div> </header> ); } function Block(props) { return ( <div className="col-md-6 col-lg-5 mt-4"> <Link to={`/single/${props.postId}`}> <div className="img-container"> <img className="img-fluid" src={props.thumb} alt="" /> <div className="overlay" /> <div className="text d-flex flex-column justify-content-center text-center"> <span>{props.title}</span> <small>{props.descr}</small> </div> </div> </Link> </div> ); } // function Posts() { // return ( // <section> // <div className="container py-5"> // <h1> // &frasl;&frasl; Posts // <span className="design">.</span> // </h1> // <p className="text-muted">Last Updated 2018-04-29</p> // <div className="row justify-content-center"> // <div className="col-md-6 col-lg-5 mt-4"> // <div className="img-container"> // <img className="img-fluid" src="images/project-ntuac.jpg" alt="" /> // <div className="overlay" /> // <div className="text d-flex flex-column justify-content-center text-center"> // <span>NTU Global Lounge Activity Calendar</span> // <small>UX, Vanilla JavaScript, HTML, CSS</small> // </div> // </div> // </div> // <div className="col-md-6 col-lg-5 mt-4"> // <div className="img-container"> // <img className="img-fluid" src="images/project-sfbms2016.jpg" alt="" /> // <div className="overlay" /> // <div className="text d-flex flex-column justify-content-center text-center"> // <span>SFBMS, EAJS, CSSBMR 2016</span> // <small>UX, Visual, Partial RWD, HTML, CSS</small> // </div> // </div> // </div> // <div className="col-md-6 col-lg-5 mt-4"> // <a href="project-snerd.html"> // <div className="img-container"> // <img className="img-fluid" src="images/project-snerd.jpg" alt="" /> // <div className="overlay" /> // <div className="text d-flex flex-column justify-content-center text-center"> // <span>Society for Neurological Rare Disorders</span> // <small>UX, Visual, RWD, CMS(Wordpress), Bootstrap</small> // </div> // </div> // </a> // </div> // <div className="col-md-6 col-lg-5 mt-4"> // <div className="img-container"> // <img className="img-fluid" src="images/project-ndg.jpg" alt="" /> // <div className="overlay" /> // <div className="text d-flex flex-column justify-content-center text-center"> // <span>Neuroscience Discussion Group</span> // <small>UX, PHP, session, HTML, CSS</small> // </div> // </div> // </div> // <div className="col-md-6 col-lg-5 mt-4"> // <div className="img-container"> // <img className="img-fluid" src="images/visual-isie.jpg" alt="" /> // <div className="overlay" /> // <div className="text d-flex flex-column justify-content-center text-center"> // <span>NTU Internation Students Information Service</span> // <small>Posters, Flyers, Course Design</small> // </div> // </div> // </div> // <div className="col-md-6 col-lg-5 mt-4"> // <div className="img-container"> // <img className="img-fluid" src="images/visual-italy.jpg" alt="" /> // <div className="overlay" /> // <div className="text d-flex flex-column justify-content-center text-center"> // <span>Family Travel Booklet</span> // <small>Booklet Design, Itinerary Planning</small> // </div> // </div> // </div> // </div> // </div> // </section> // ); // } class Archive extends Component { render() { return ( <div> <Header /> <section> <div className="container py-5"> <h1> &frasl;&frasl; Posts <span className="design">.</span> </h1> <p className="text-muted">Last Updated 2018-04-29</p> <div className="row justify-content-center"> {this.props.posts.map(({ postId, title, descr, thumb, }) => ( <Block key={postId} postId={postId} title={title} descr={descr} thumb={thumb} /> ))} </div> </div> </section> </div> ); } } export default Archive;
export * from './clean.js' export * from './hbs.js' export * from './prepare-html-dev.js' export * from './prepare-html-build.js' export * from './images.js' export * from './scripts.js' export * from './styles.js' export * from './server.js' export * from './assets.js'
import React, { lazy } from "react"; import styled from "styled-components"; import "./index.css"; import Slider from "react-slick"; import "../../../node_modules/slick-carousel/slick/slick.css"; import "../../../node_modules/slick-carousel/slick/slick-theme.css"; import { Line, Circle } from "rc-progress"; const Card = lazy(() => import("../../components/Card/index")); const Section = styled.div` display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; padding: 5rem 0; `; const Title = styled.h1` color: #0a0b10; display: inline-block; font-size: calc(1rem + 1.5vw); margin-top: 1.5rem; position: relative; &::before { content: ""; height: 1px; width: 50%; position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 0.5rem); /* or 100px */ border-bottom: 2px solid var(--purple); } `; const Carousal = styled.div` width: 50vw; display: flex; flex-direction: column; justify-content: center; @media only Screen and (max-width: 40em) { width: 90vw; .slick-slider .slick-arrow { display: none; } } .slick-slider .slick-arrow:before { color: #0a0b10; font-size: 1.5rem; @media only Screen and (max-width: 40em) { display: none; } } .slick-slider .slick-dots button:before { color: #0a0b10; font-size: 1.5rem; } .slick-slide.slick-active { display: flex; justify-content: center; align-items: center; flex-direction: column; margin: 0; padding: 0; margin-bottom: 3rem; } `; const Testimonials = ({ data }) => { // const settings = { // dots: true, // infinite: true, // speed: 1000, // slidesToShow: 1, // slidesToScroll: 1, // }; // var skillmessage = data.skillmessage; if (data) { var skills = data.skills.map(function(skills) { var className = "bar-expand " + skills.name.toLowerCase(); return ( <li key={skills.name}> <span style={{ width: skills.level }} className={className}> {/* <b>{skills.level}</b> */} </span> <em>{skills.name}</em> </li> ); }); } return ( <Section> <div className="row skill"> <div className="three columns header-col"> <Title> <span>Skills</span> </Title> </div> <div className="nine columns main-col"> {/* <p>{skillmessage}</p> */} <div className="bars"> <ul className="skills">{skills}</ul> </div> </div> </div> {/* to include if not done */} {/* <Title>Skills!</Title> <div style={{ margin: 20, width: 600, position: "absolute", left: 0, }}> <h3>C++</h3> <Line percent="80" strokeWidth="4" trailWidth="4" strokeColor="var(--purple)" /> </div> */} {/* <Carousal> <Slider {...settings}> <Card text="CodeBucks has been essential part of our business. I would definetly recommend CodeBucks. It has been amazing to have them." name="Jenny (CodeCall)" image="avatar-1" /> <Card text="CodeBucks has been essential part of our business. I would definetly recommend CodeBucks. It has been amazing to have them." name="Jenny (CodeCall)" image="avatar-2" /> <Card text="CodeBucks has been essential part of our business. I would definetly recommend CodeBucks. It has been amazing to have them." name="Jenny (CodeCall)" image="avatar-3" /> <Card text="CodeBucks has been essential part of our business. I would definetly recommend CodeBucks. It has been amazing to have them." name="Jenny (CodeCall)" image="avatar-4" /> </Slider> </Carousal> */} </Section> ); }; export default Testimonials;
import React from 'react'; import { View, Text } from 'react-native'; import PropTypes from 'prop-types'; import { Button, TextareaItem } from '@ant-design/react-native'; import SimplePopupMenu from 'react-native-simple-popup-menu'; import BaseView from '@/components/common/baseView'; import DataTableEx from '@/components/common/dataTable'; import FloatingView from '@/components/common/floatingView'; import Request from '@/modules/business/request'; import Global from '@/global'; import PdfViewer from '@/components/business/pdfViewer'; export default class ElectronicData extends BaseView { static propTypes = { taskInfo: PropTypes.object.isRequired, refreshParent: PropTypes.func.isRequired, isEdit: PropTypes.bool.isRequired, }; static defaultProps = { taskInfo: {}, isEdit: false, }; constructor(props) { super(props); this.state = { taskInfo: { ...props.taskInfo }, electronicDatas: [], opeContent: '', }; this.electronicDataTable = React.createRef(); this.pdfViewerRef = React.createRef(); } componentDidMount() { this._getElectronicData(); } /** * 获取电子资料列表信息 * * @memberof ElectronicData */ async _getElectronicData() { console.debug('_getElectronicData:', this.state.taskInfo); if (this.state.taskInfo && this.state.taskInfo.SDNAPPLYID !== '') { const response = await new Request().getSdnList({ OPE_TYPE: this.state.taskInfo.OPE_TYPE, EQP_COD: this.state.taskInfo.EQP_COD, TASK_DATE: this.state.taskInfo.TASK_DATE.substring(0, 10), }); if (response.code !== 0) { this._showHint(response.message); } else { const electronicDataArray = JSON.parse(response.data.BUSIDATA); let map = {}; electronicDataArray.map((item) => { if (typeof map[item.APPLY_ID] === 'undefined') { item.files = [ { ORIGINAL_NAME: item.ORIGINAL_NAME, ABS_PATH: item.ABS_PATH, TYPE: item.TYPE, }, ]; map[item.APPLY_ID] = item; } else { map[item.APPLY_ID].files.push({ ORIGINAL_NAME: item.ORIGINAL_NAME, ABS_PATH: item.ABS_PATH, TYPE: item.TYPE, }); } }); let newArray = []; Object.keys(map).map((key) => { newArray.push(map[key]); }); this.setState({ electronicDatas: newArray, }); console.debug('electronicDatas: ', this.state.electronicDatas); } } } _render() { return ( <View style={{ flex: 1, zIndex: 400, position: 'absolute', width: '100%', height: '100%' }}> <View style={{ width: '100%', height: 'auto', borderBottomColor: 'gray', borderBottomWidth: 2 }}> <View style={{ width: '100%', height: 80, alignItems: 'center', flexDirection: 'row', justifyContent: 'space-around' }}> {this.state.taskInfo && (this.state.taskInfo.CURR_NODE === '101' || this.state.taskInfo.CURR_NODE === '102') ? ( <Button type="primary" onPress={() => this.sendOperation('back')}> 回退 </Button> ) : null} {this.state.taskInfo && this.state.taskInfo.CURR_NODE === '101' ? ( <Button type="primary" onPress={() => this.sendOperation('check')}> 校核 </Button> ) : null} {this.state.taskInfo && this.state.taskInfo.CURR_NODE === '102' ? ( <Button type="primary" onPress={() => this.sendOperation('examine')}> 审核 </Button> ) : null} </View> <View style={{ width: '100%', height: 'auto', justifyContent: 'center' }}> <Text style={{ fontSize: 20 }}>回退原因:</Text> <TextareaItem value={this.state.opeContent} width={600} rows={3} placeholder="请输入回退信息" /> </View> </View> <View style={{flex: 1}}> <View style={{ height: '100%', width: '100%', backgroundColor: 'yellow' }}> <PdfViewer ref={this.pdfViewerRef} style={{ width: '100%', height: '100%' }} /> </View> </View> </View> ); } /** * 获取电子资料列表勾选的信息 * * @return {*} 勾选的电子资料申请信息 * @memberof ElectronicData */ _getCheckedRows() { return this.electronicDataTable.current.getCheckedRows(); } /** * 发起电子资料申请相关操作 * * @param {*} operationType 操作类型 * @return {*} * @memberof ElectronicData */ sendOperation(operationType) { if (['101', '102'].findIndex((value) => value === this.state.taskInfo.CURR_NODE) < 0) { this._showHint('当前节点只可预览'); return; } // 获取选中的申请信息 const operationData = this._getCheckedRows(); if ((this.state.taskInfo.CURR_NODE === '101' && ['-1', '0', '3'].findIndex((value) => value === operationData[0].STATUS) > -1) || (this.state.taskInfo.CURR_NODE === '102' && ['-1', '0', '1', '3'].findIndex((value) => value === operationData[0].STATUS) > -1)) { this._showHint('当前状态只可预览'); return; } let applyIds = []; if (operationData && operationData.length > 0) { operationData.map((item) => { if (item.STATUS !== operationData[0].STATUS) { this._showHint('存在状态不同数据'); return; } if (['4', '8'].findIndex((value) => value === item.APPLY_TYPE) > 0) { this._showHint('监检协议的资料只能预览'); return; } applyIds.push(item.APPLY_ID); }); } else { this._showHint('请先勾选需要操作的数据'); return; } let protocol = { APPLY_ID: applyIds.join(','), STATUS: operationData[0].STATUS, OPE_USER_ID: Global.getUserInfo().userId, OPE_USER_NAME: Global.getUserInfo().username, ISP_ID: this.state.taskInfo.ID, CURR_NODE: this.state.taskInfo.CURR_NODE, OPE_CONTENT: this.state.opeContent, APL_UNT_MOBILE: operationData[0].APL_UNT_MOBILE, }; if (operationType === 'back') { protocol.IF_BACK = '1'; } else { protocol.IF_BACK = '0'; } const response = new Request().opeSdnList(protocol); if (response.code === 0) { this._getElectronicData(); // 刷新父级页面 this.props.refreshParent(); } } }
import {Hidden} from "@material-ui/core"; import StyledLoginPage from "./LoginPage.style"; import AuthenticationForm from "~/components/organisms/AuthenticationForm/AuthenticationForm"; export default function LoginPage(props) { return ( <StyledLoginPage> <Hidden smDown> <img className="logo" src={require("~/assets/images/logo-full.svg").default} alt="ScoutingHawk.com" /> </Hidden> <Hidden mdUp> <img className="logo" src={require("~/assets/images/logo.svg").default} alt="ScoutingHawk.com" /> </Hidden> <AuthenticationForm /> </StyledLoginPage> ); }
/* $('form').submit(function(event){ event.preventDefault(); // 1. First prevent default behavier var form = $(this); // 3. data will come from the form object, this refers to the form where event were fired from (if we ave many forms, this will be the one where submit button was clicked) // console.log(form.serialize()); $.ajax({ // 2. call AJAX function url: '/create', // 2a. where you want this form submition to go method: 'POST', // 2b. what type of request you want to make data: form.serialize() // 2c. data from this form 4. If you submit you form now, you will see that you able to save data from here! }).done(function(response){ // 5. function done will fire when you get response back (it will return whole html with data) $('tbody').html(response) // 10. if we think of this response as html of rows, we can select it and set inner html to be response. }) }) // 6. we want to have stuff that you want to appear, and function that returns just those rows as html // 7. Now go to html and cut the loop between <tbody> CUT from here data you want to show with ajax </tbody> // 8. create new html (users.html) with what you've cut from <tbody> // 9. The idea is if we can take response from server(now its whole html), and if this response was just <tr>users</tr>, // select my tbody and SET inner html to be that renponse <tr>users</tr>. */
const Pool = require("pg").Pool; import logger from "./config/logger"; import producer from "./kafka/producer"; // import consumer from "./kafka/consumer"; import envVariables from "./EnvironmentVariables"; const pool = new Pool({ user: envVariables.DB_USER, host: envVariables.DB_HOST, database: envVariables.DB_NAME, password: envVariables.DB_PASSWORD, port: envVariables.DB_PORT }); let createJobKafkaTopic = envVariables.KAFKA_CREATE_JOB_TOPIC; const uuidv4 = require("uuid/v4"); export const getFileStoreIds = ( jobid, tenantId, isconsolidated, entityid, callback ) => { var searchquery = ""; var queryparams = []; var next = 1; var jobidPresent = false; searchquery = "SELECT * FROM egov_pdf_gen WHERE"; if (jobid != undefined && jobid.length > 0) { searchquery += ` jobid = ANY ($${next++})`; queryparams.push(jobid); jobidPresent = true; } if (entityid != undefined && entityid.trim() !== "") { if (jobidPresent) searchquery += " and"; searchquery += ` entityid = ($${next++})`; queryparams.push(entityid); } if (tenantId != undefined && tenantId.trim() !== "") { searchquery += ` and tenantid = ($${next++})`; queryparams.push(tenantId); } if (isconsolidated != undefined && isconsolidated.trim() !== "") { var ifTrue = isconsolidated === "true" || isconsolidated === "True"; var ifFalse = isconsolidated === "false" || isconsolidated === "false"; if (ifTrue || ifFalse) { searchquery += ` and isconsolidated = ($${next++})`; queryparams.push(ifTrue); } } searchquery = `SELECT pdf_1.* FROM egov_pdf_gen pdf_1 INNER JOIN (SELECT entityid, max(endtime) as MaxEndTime from (`+searchquery+`) as pdf_2 group by entityid) pdf_3 ON pdf_1.entityid = pdf_3.entityid AND pdf_1.endtime = pdf_3.MaxEndTime`; pool.query(searchquery, queryparams, (error, results) => { if (error) { logger.error(error.stack || error); callback({ status: 500, message: `error occured while searching records in DB : ${error.message}` }); } else { if (results && results.rows.length > 0) { var searchresult = []; results.rows.map(crow => { searchresult.push({ filestoreids: crow.filestoreids, jobid: crow.jobid, tenantid: crow.tenantid, createdtime: crow.createdtime, endtime: crow.endtime, totalcount: crow.totalcount }); }); logger.info(results.rows.length + " matching records found in search"); callback({ status: 200, message: "Success", searchresult }); } else { logger.error("no result found in DB search"); callback({ status: 404, message: "no matching result found" }); } } }); }; export const insertStoreIds = ( dbInsertRecords, jobid, filestoreids, tenantId, starttime, successCallback, errorCallback, totalcount ) => { var payloads = []; var endtime = new Date().getTime(); var id = uuidv4(); payloads.push({ topic: createJobKafkaTopic, messages: JSON.stringify({ jobs: dbInsertRecords }) }); producer.send(payloads, function(err, data) { if (err) { logger.error(err.stack || err); errorCallback({ message: `error while publishing to kafka: ${err.message}` }); } else { logger.info("jobid: " + jobid + ": published to kafka successfully"); successCallback({ message: "Success", jobid: jobid, filestoreIds: filestoreids, tenantid: tenantId, starttime, endtime, totalcount }); } }); };
const Command = require('../../structures/DeprecatedCommand'); module.exports = class OpenCard extends Command { get name() { return 'opencard'; } get _options() { return { aliases: ['unarchivecard'] }; } get replacedCommandName() { return 'editcard'; } };
const app = require('./app') var port = 8080 if(process.env.NODE_ENV == "development") port = 3030 console.log(process.env.NODE_ENV); app.listen(port) console.log(`listening on http://localhost:${port}`)
__resources__["/__builtin__/resmgr.js"] = {meta: {mimetype: "application/javascript"}, data: function(exports, require, module, __filename, __dirname) { var h = require("helper") ,Klass = require("base").Klass ,Trait = require("oo").Trait; var resMgrTrait = Trait.extend({ initialize:function() { this.execProto("initialize"); this.slot("_res", {}); this.slot("_resNum", 0); this.slot("_loadedNum", 0); }, _genResOnloadCB:function(mgr, name) { return function() { if (mgr.slot("_res")[name]) mgr.slot("_loadedNum", mgr.slot("_loadedNum") + 1); } }, loadImage:function(img) { var res = this.slot("_res")[img]; if (res) return res; //FIXME:when img load failed?? this.slot("_res")[img] = h.loadImage(img, undefined, this.exec("_genResOnloadCB", this, img)); this.slot("_resNum", this.slot("_resNum")+1); return this.slot("_res")[img]; }, removeRes:function(name) { if (this.slot("_res")[name]) { this.slot("_resNum", this.slot("_resNum")-1); if (this.slot("_res")[name].loaded) this.slot("_loadedNum", this.slot("_loadedNum")-1); delete this.slot("_res")[name]; return true; } return false; }, queryRes:function(name) { return this.slot("_res")[name]; }, isCompelete:function() { return this.slot("_resNum") <= this.slot("_loadedNum"); }, percent:function() { return this.slot("_loadedNum") / this.slot("_resNum"); }, }); var ResMgr = Klass.extend([resMgrTrait]); exports.ResMgr = ResMgr; }};
var mongoose = require('mongoose'); var Schema = mongoose.Schema; var sushiSchema = new Schema({ name: String , price: String , pcs:Number , photos: [], partCreated: { type: Date, default: Date.now }, partUpdated: { type: Date, default: Date.now } }); var Sushi = mongoose.model("Sushi", sushiSchema); module.exports = Sushi;
export { default } from './OrderSummery';
var terrain = ( function () { 'use strict'; var u = { size : 100, height : 10, resolution : 256, complexity : 2, type : 1, fog: 1, fogStart : 0.5, repeat : 20, blur:1, }; var maxspeed = 1; var acc = 0.01; var dec = 0.01; var pos, ease; var material = null; var mesh = null; var geometry = null; var compute = null; var uniforms_terrain = null; var uniforms_height = null; var heightmapVariable, smoothShader; var heightTexture = null; var needsUpdate = false; var currentResolution = u.resolution; terrain = { getData : function () { return u; }, init : function ( w ) { u.resolution = w || 256; pos = new THREE.Vector3(); ease = new THREE.Vector2(); //pool.load( ['textures/terrain/level4mm.jpg', 'textures/terrain/normal.jpg', 'glsl/terrain_la_vs.glsl', 'glsl/terrain_la_fs.glsl', 'glsl/noiseMap.glsl'], terrain.create ); pool.load( [ 'textures/terrain/grass.jpg', 'textures/terrain/rock.jpg', 'textures/terrain/sand.jpg', 'textures/terrain/snow.jpg', 'glsl/terrain_ph_vs.glsl', 'glsl/terrain_ph_fs.glsl', 'glsl/noiseMap.glsl', 'glsl/smoothMap.glsl' ], terrain.create ); }, create : function () { terrain.makeHeightTexture(); var tx = {}; var tname = ['grass', 'rock', 'sand', 'snow']; var i = tname.length, n; while(i--){ n = tname[i]; tx[n] = new THREE.Texture( pool.get( n ) ); tx[n].wrapS = tx[n].wrapT = THREE.RepeatWrapping; tx[n].needsUpdate = true; } var uniformPlus = { size: { value: u.size }, height: { value: u.height }, resolution: { value: u.resolution }, heightmap: { value: null }, enableFog: { value: null }, fogColor: { value: null }, fogStart: { value: null }, blur: { value: null }, repeat: { value: null }, ratioUV: { value: null }, pos: { value: null }, snow: { value: null }, rock: { value: null }, grass: { value: null }, sand: { value: null }, }; /*material = new THREE.ShaderMaterial( { uniforms: THREE.UniformsUtils.merge( [ THREE.ShaderLib[ 'lambert' ].uniforms, uniformPlus ] ), vertexShader: pool.get( 'terrain_la_vs' ), fragmentShader: pool.get( 'terrain_la_fs' ), //wireframe : true, });*/ material = new THREE.ShaderMaterial( { uniforms: THREE.UniformsUtils.merge( [ THREE.ShaderLib[ 'standard' ].uniforms, uniformPlus ] ), vertexShader: pool.get( 'terrain_ph_vs' ), fragmentShader: pool.get( 'terrain_ph_fs' ), //shading:THREE.SmoothShading, //wireframe : true, }); material.lights = true; //material.map = tx; //material.normalMap = tx2; uniforms_terrain = material.uniforms; //uniforms_terrain.map.value = material.map; //uniforms_terrain.normalMap.value = material.normalMap //uniforms_terrain.repeat.value = u.repeat; uniforms_terrain.ratioUV.value = 1.0 / (u.size/u.repeat); uniforms_terrain.pos.value = pos; //uniforms_terrain.blur.value = u.blur; uniforms_terrain.snow.value = tx.snow; uniforms_terrain.rock.value = tx.rock; uniforms_terrain.grass.value = tx.grass; uniforms_terrain.sand.value = tx.sand; //uniforms_terrain.offsetRepeat.value = new THREE.Vector4(u.repeat,u.repeat,u.repeat,u.repeat); uniforms_terrain.roughness.value = 0.9; uniforms_terrain.metalness.value = 0.2; uniforms_terrain.heightmap.value = heightTexture.texture; //uniforms_terrain.enableFog.value = u.fog; //uniforms_terrain.fogStart.value = u.fogStart; uniforms_terrain.fogColor.value = view.getBgColor();//new THREE.Color(0x2c2c26); //geometry.rotateY( -Math.PI / 2 ); terrain.makeGeometry(); mesh = new THREE.Mesh( geometry, material ); mesh.matrixAutoUpdate = false; //mesh.castShadow = true; //mesh.receiveShadow = true; //mesh.updateMatrix(); view.add( mesh ); view.addUpdate( terrain.update ); terrain.setUniform(); //view.addUpdate( terrain.easing ); }, makeGeometry : function(){ if(geometry) geometry.dispose(); geometry = new THREE.PlaneBufferGeometry2( u.size, u.size, u.resolution - 1, u.resolution -1 ); geometry.rotateX( -Math.PI / 2 ); }, makeHeightTexture : function(){ compute = new GPUComputationRenderer( u.resolution, u.resolution, view.getRenderer() ); heightmapVariable = compute.addVariable( "heightmap", pool.get( 'noiseMap' ), compute.createTexture() ); smoothShader = compute.createShaderMaterial( pool.get( 'smoothMap' ), { texture: { value: null } , blur: { value: u.blur }, resolution: { value: u.resolution } } ); smoothShader.defines.textureResolution = 'vec2( ' + u.resolution + ', ' + u.resolution + " )"; compute.init(); uniforms_height = heightmapVariable.material.uniforms; uniforms_height.pos = { value: 0 };; uniforms_height.size = { value: 0 }; uniforms_height.resolution = { value: 0 }; uniforms_height.type = { value: 0 }; uniforms_height.complexity = { value: 0 }; uniforms_height.pos.value = pos; //uniforms_height.size.value = u.size; //uniforms_height.resolution.value = u.resolution; //uniforms_height.type.value = u.type; // uniforms_height.complexity.value = 1 / ( u.complexity * 100 ); //compute.compute(); //terrain.smoothTerrain(); heightTexture = compute.getCurrentRenderTarget( heightmapVariable ); }, smoothTerrain : function () { var currentRenderTarget = compute.getCurrentRenderTarget( heightmapVariable ); var alternateRenderTarget = compute.getAlternateRenderTarget( heightmapVariable ); var i = u.blur; while(i--){ smoothShader.uniforms.texture.value = currentRenderTarget.texture; compute.doRenderTarget( smoothShader, alternateRenderTarget ); smoothShader.uniforms.texture.value = alternateRenderTarget.texture; compute.doRenderTarget( smoothShader, currentRenderTarget ); } }, setUniform: function () { uniforms_height.type.value = u.type; uniforms_height.size.value = u.size; uniforms_height.resolution.value = u.resolution; uniforms_height.complexity.value = 1 / ( u.complexity * 100 ); uniforms_terrain.size.value = u.size; uniforms_terrain.resolution.value = u.resolution; uniforms_terrain.height.value = u.height; uniforms_terrain.enableFog.value = u.fog; uniforms_terrain.fogStart.value = u.fogStart; uniforms_terrain.repeat.value = u.repeat; uniforms_terrain.ratioUV.value = 1.0 / (u.size/u.repeat); needsUpdate = true; }, update: function () { terrain.easing(); if(!needsUpdate) return; compute.compute(); terrain.smoothTerrain(); needsUpdate = false; }, getHeight: function ( x, y ) { if(!heightTexture) return 0; var r = view.getPixel( heightTexture, x || u.resolution*0.5, y || u.resolution*0.5 ); return r[ 0 ] * u.height; }, easing: function () { var key = user.getKey(); var r = -view.getControls().getAzimuthalAngle(); if( key[7] ) maxspeed = 1.5; else maxspeed = 0.25; //acceleration ease.y += key[1] * acc; // up down ease.x += key[0] * acc; // left right //speed limite ease.x = ease.x > maxspeed ? maxspeed : ease.x; ease.x = ease.x < -maxspeed ? -maxspeed : ease.x; ease.y = ease.y > maxspeed ? maxspeed : ease.y; ease.y = ease.y < -maxspeed ? -maxspeed : ease.y; //break if (!key[1]) { if (ease.y > dec) ease.y -= dec; else if (ease.y < -dec) ease.y += dec; else ease.y = 0; } if (!key[0]) { if (ease.x > dec) ease.x -= dec; else if (ease.x < -dec) ease.x += dec; else ease.x = 0; } if ( !ease.x && !ease.y ) return; pos.z += Math.sin(r) * ease.x + Math.cos(r) * ease.y; pos.x += Math.cos(r) * ease.x - Math.sin(r) * ease.y; needsUpdate = true; }, } return terrain; })();
function convert(number1) { return number1 * 3.8; } var gallon = parseInt(prompt("How many Gallons do you have? ")); alert(convert(gallon));
//成功 // 显示详情 // 执行用时 : 132 ms, 在Letter Combinations of a Phone Number的JavaScript提交中击败了8.56% 的用户 // 内存消耗 : 33.8 MB, 在Letter Combinations of a Phone Number的JavaScript提交中击败了0.00% 的用户 var letterCombinations = function(digits) { let digitsArr = digits.split(''); if(digitsArr.length === 0) return []; let str = ['abc','def','ghi','jkl','mno','pqrs','tuv','wxyz']; let strArr = []; for(let i=0;i<digitsArr.length;i++){ strArr.push(str[digitsArr[i]-2]); } let temp = []; let res = []; let max = strArr.length; res = getRes(strArr,0,temp,res,max); return res; }; function getRes(strArr,i,temp,res,max){ if(temp.length === max){ res.push(JSON.parse(JSON.stringify(temp)).join('')); return res; } let oneStr = strArr[i].split(''); for(let j=0;j<oneStr.length;j++){ temp.push(oneStr[j]); res = getRes(strArr,i+1,temp,res,max); temp.pop(); } return res; } let digits = ''; console.log(letterCombinations(digits));
jQuery(function ($) { if($('textarea[id*="imagemap"]')) { var jcrop_api; jQuery.ez( 'ezjsctemplate::loadsize', {}, function(data){ $('textarea[id*="imagemap"]').prev().append('<span id="imagemap-toolbar">'+data.content + ' <input type="button" class="button" id="select-image" value="select image" /> <input id="ezpublishblog-loadimagemap" class="button" type="button" value="create new imagemap" /> <input type="button" class="button" value="load current imagemap" id="ezpublishblog-loadcurrentimagemap" /></span>'); $('#select-image').click(function() { $('.ezcca-edit-datatype-ezimage img').attr('style','').addClass('selectimage').click(function() { $('#imagemap-toolbar img').remove(); $('#select-image').before('<img src="'+$(this).attr('src')+'" width="100px" height="100px" class="image-preview" />'); $(this).removeClass('selectimage'); $('body').removeClass('imagemap-selection'); var image_attr = $('.ezieEditButton',$(this).parents('.ezcca-edit-datatype-ezimage')).attr('id').split('_'); jQuery.ez( 'ezjsctemplate::getimage', {size: $('#imagemap-imagesize option:selected').attr('value'),object_id:image_attr[3],imagenode:image_attr[1], attribute_name: $(this).parents('.ezcca-edit-datatype-ezimage').attr('class').split(' ')[2].replace(/ezcca-edit-/,'')}, function(data){ $('body').data('imagemap', { 'src' : data.content, 'object_id' : image_attr[3], 'imagenode_id' : image_attr[1] }); }); }); $('body').addClass('imagemap-selection'); return false; }); jQuery.ez( 'ezjsctemplate::overlay', {}, function(data){ $('body').append(data.content); var OSX = { container: null, init: function () { $("#ezpublishblog-loadimagemap, #ezpublishblog-loadcurrentimagemap").click(function (e) { e.preventDefault(); if($(this).attr('id') == 'ezpublishblog-loadcurrentimagemap') { loadCoords(); } $("#osx-modal-content").modal({ overlayId: 'osx-overlay', containerId: 'osx-container', closeHTML: null, minHeight: 80, opacity: 65, position: ['0',], overlayClose: true, onOpen: OSX.open, onClose: OSX.close }); }); }, open: function (d) { // JCROP START $('#target').attr('src',$('body').data('imagemap')['src']); $('#target').Jcrop({ onChange: setCoords, onSelect: showCoords, onRelease: clearCoords },function(){ jcrop_api = this; jcrop_api.setImage($('body').data('imagemap')['src']); }); $('#list li').live('click',function(){ $('#list li').removeClass('selected'); $('span.saved').remove(); $('#modify, #remove').show(); jcrop_api.animateTo($(this).attr('coords').split(',')); $(this).addClass('selected'); }); $('#modify').hide().click(function() { updateCoords(); }); $('#add').click(function() { addCoords(); }); $('#remove').hide().click(function() { $('#list li.selected').remove(); jcrop_api.release(); $('#modify, #remove').hide(); }); $('#save').click(function(){ generateAreaMap(); }); var self = this; self.container = d.container[0]; d.overlay.fadeIn('slow', function () { $("#osx-modal-content", self.container).show(); var title = $("#osx-modal-title", self.container); title.show(); d.container.slideDown('slow', function () { setTimeout(function () { var h = $("#osx-modal-data", self.container).height() + title.height() + 20; // padding d.container.animate( {height: h}, 200, function () { $("div.close", self.container).show(); $("#osx-modal-data", self.container).show(); } ); }, 100); }); }); // JCROP END }, close: function (d) { var self = this; // this = SimpleModal object d.container.animate( {top:"-" + (d.container.height() + 20)}, 500, function () { self.close(); // or $.modal.close(); } ); } }; OSX.init(); }); }); } }); function generateAreaMap() { var name = $('body').data('imagemap')['imagenode_id']+'_'+$('body').data('imagemap')['object_id']; var map = '<img src="'+$('body').data('imagemap')['src']+'" usemap="#'+name+'" id="'+name+'" > '; map += '<map name="'+name+'">'; $('#list li').each(function(i,ele){ map += '<area shape="rect" coords="'+$(ele).attr('coords')+'" href="http://www.orf.at">'; }); map += '</map>'; $('textarea[id*="imagemap"]').html(map); } function addCoords() { $('#list').append('<li coords="'+ getCurrentCoords() + '">Mapselection ' + ($('#list li').length + 1) + '</li>'); } function getCurrentCoords() { return $('#x1').attr('value') + ',' + $('#y1').attr('value') + ','+ $('#x2').attr('value') + ','+ $('#y2').attr('value'); } function updateCoords() { $('#list li.selected').attr('coords',getCurrentCoords()).append(' <span class="saved">(saved)</span>') } function setCoords(c) { //$('#modify').show(); } function removeEdit() { $('#list li span.edit').remove(); } function addEdit() { removeEdit(); $('#list li').append(' <span class="edit">edit</span>'); } function loadCoords() { $('#list li').remove(); $('body').append('<div id="temp-imagemap">'+$('textarea[id*="imagemap"]').text()+'</div>'); $('body').data('imagemap', { 'src' : $('#temp-imagemap img').attr('src'), 'object_id' : $('#temp-imagemap img').attr('id').split('_')[1], 'imagenode_id' : $('#temp-imagemap img').attr('id').split('_')[0] }); $('#temp-imagemap map area').each(function(i,ele){ $('#list').append('<li coords="'+ $(ele).attr('coords') + '">Mapselection ' + ($('#list li').length + 1) + '</li>'); }); $('#temp-imagemap').remove(); } // Simple event handler, called from onChange and onSelect // event handlers, as per the Jcrop invocation above function showCoords(c) { $('#x1').val(Math.floor(c.x)); $('#y1').val(Math.floor(c.y)); $('#x2').val(Math.floor(c.x2)); $('#y2').val(Math.floor(c.y2)); $('#w').val(Math.floor(c.w)); $('#h').val(Math.floor(c.h)); }; function clearCoords() { $('#coords input').val(''); }; function _l(msg) { { _log(msg); } } function _log(msg) { if (window.console && window.console.log){ window.console.log(msg); } }
import { saveXML } from "../components/saveXML"; //src\components\EditorFlow\common\flowDataSource\index.ts import { XMLDataJson } from './flowDataSource'; //可能需要随时保存 所以把方法提取出来 //解析成后台数据 并 存储 //@ts-ignore const saveWorkFlow=(item,dataObjs)=>{ commonSave(commonJSONData(item,dataObjs)); } export const setWorkFlowOnlyDataObj=(dataObj,other)=>{ let JSONData={ ...other,dataObj}; commonSave(JSONData); } export const commonJSONData=(item,dataObjs)=>{ const dataObj={ id:String(Math.random()*10000), ...dataObjs } //节点 节点名字 const nodes=[ ...Object.values(item.dataMap) ] const action=nodes.filter((item)=>(item.target)); let JSONData={ dataObj,nodes, action } return JSONData; } export const commonSave=(JSONData)=>{ let xmldata=XMLDataJson(JSONData) let localData=saveXML(xmldata) localStorage.setItem("workflowMockItem",localData); console.log(localData,"localData",xmldata,JSONData); return JSONData; } export const readerWorkFlow=(workflowMockItem)=>{ // ||saveXML() // string 转xml对象 function xmlToJson(xml) { // 新建返回的对象 var obj = {}; if (xml.nodeType == 1) { // 处理属性 if (xml.attributes.length > 0) { obj["@attributes"] = {}; for (var j = 0; j < xml.attributes.length; j++) { var attribute = xml.attributes.item(j); obj["@attributes"][attribute.nodeName] = attribute.nodeValue; } } } else if (xml.nodeType == 3) { // 文本 obj = xml.nodeValue; } // 处理子节点 // 如果所有子节点都是文本,则把它们拼接起来 var textNodes = [].slice.call(xml.childNodes).filter(function(node) { return node.nodeType === 3; }); if (xml.hasChildNodes() && xml.childNodes.length === textNodes.length) { obj = [].slice.call(xml.childNodes).reduce(function(text, node) { return text + node.nodeValue; }, ""); } else if (xml.hasChildNodes()) { for (var i = 0; i < xml.childNodes.length; i++) { var item = xml.childNodes.item(i); var nodeName = item.nodeName; if (typeof obj[nodeName] == "undefined") { obj[nodeName] = xmlToJson(item); } else { if (typeof obj[nodeName].push == "undefined") { var old = obj[nodeName]; obj[nodeName] = []; obj[nodeName].push(old); } obj[nodeName].push(xmlToJson(item)); } } } return obj; } var XmlNode = new DOMParser().parseFromString(workflowMockItem, 'text/xml'); // xml转为json对象 及整理并添加其他数据 let dataTemp=xmlToJson(XmlNode); //{ //"dataObj":{"id":"3395.5758644768275"}, //"nodes":[ //{"type":"S","size":"72*72","shape":"flow-circle","color": //"#FA8C16","label":"Start1","name":"开始","x":214.515625,"y":-79,"id":"516e950f"}, //{"type":"C","size":"80*48","shape":"flow-rect","color":"#1890F0","label":"子工作节点2", // "name":"子工作","x":212.515625,"y":80,"id":"5aed684d"},{"source":"516e950f","sourceAnchor":2,"target":"5aed684d", // "targetAnchor":0,"id":"eeacfb02"}], //"edges" //:[{"source":"516e950f","sourceAnchor":2,"target":"5aed684d","targetAnchor":0,"id":"eeacfb02"}]} let flowData={ dataObj:{}, nodes:[], edges:[], } console.log(dataTemp.workflow,"dataTemp.workflow"); if(dataTemp.workflow){ // if(dataTemp.workflow[1]['initial-actions']){ const actionObj=dataTemp.workflow[1]['initial-actions'] if(actionObj.action&&actionObj.action["@attributes"]){ flowData.dataObj={...actionObj.action["@attributes"]} } } // if(dataTemp.workflow[1]["flows"]){ const flows=dataTemp.workflow[1]["flows"]; if(flows.node){ const tempNode=flows.node.length?flows.node:[flows.node]; //节点设置 flowData.nodes=tempNode.map((item)=>{ console.log(item,"不思进取"); //节点负责人 if(item.set.nodeLeaderData){ if(item.set.nodeLeaderData.length){ item["@attributes"].nodeLeaderData=item.set.nodeLeaderData["@attributes"] }else{ item["@attributes"].nodeLeaderData=[]; item["@attributes"].nodeLeaderData.push(item.set.nodeLeaderData["@attributes"]) } } //节点时限 if(item.set.limit){ item["@attributes"].nodeTimeLimitData={ nodeTimeLimitState:true, nodeTimeLimit:[item.set.limit["@attributes"]], showText:item.set.limit["@attributes"].showText } } //修改字段数据 if(item.set.updates){ const tempUpdate=item.set.updates; item["@attributes"].fieldModificationData={ fieldModificationState:tempUpdate["@attributes"].fieldModificationState, } item["@attributes"].fieldModificationData.fieldModification=[]; if(tempUpdate.update&&tempUpdate.update.length){ console.log("1111",tempUpdate.update); item["@attributes"].fieldModificationData.fieldModification=tempUpdate.update.map((item)=>{ return item['@attributes'] }) }else if(tempUpdate.update){ console.log("2222"); item["@attributes"].fieldModificationData.fieldModification.push(tempUpdate.update["@attributes"]) } } //节点通知 if(item.set.notices){ const notices=item.set.notices; item["@attributes"].notificationInformationData={ type:"EMAIL" } // console.log(item.set.notices,"item.set.notices"); item["@attributes"].notificationInformationData.infoData=[]; if(notices.notice&&notices.notice.length){ item["@attributes"].notificationInformationData.infoData=notices.notice.map((item)=>{ return item['@attributes'] }) }else if(notices.notice){ item["@attributes"].notificationInformationData.infoData.push(notices.notice["@attributes"]) } } if(item["@attributes"].x!=="undefined"){ item["@attributes"].x=Number(item["@attributes"].x); item["@attributes"].y=Number(item["@attributes"].y); } return item["@attributes"] }).filter((item)=>{ return item.x!=="undefined" });; } //edges // if(flows.action&&flows.action.length){ if(flows.action){ const tempAction=flows.action.length?flows.action:[flows.action]; flowData.edges=tempAction.map((item)=>{ //名称设置 if(item["@attributes"].label==="undefined"){ item["@attributes"].label="流程线" } if(item.set.touch){ const tempTouch=item.set.touch item["@attributes"].touchTypeData={...tempTouch["@attributes"]} } //流程执行条件 if(item.set.whiles){ const whiles=item.set.whiles; item["@attributes"].actionConditionData={}; item["@attributes"].actionConditionData['nodeTimeLimitState']=whiles["@attributes"].nodeTimeLimitState; item["@attributes"].actionConditionData.type="action"; const tempwhile=whiles.while.length?whiles.while:[whiles.while]; item["@attributes"].actionConditionData.nodeTimeLimit=tempwhile.map((item)=>{ return item["@attributes"] }); } //流程执行动作 if(item.set.next){ const next=item.set.next; item["@attributes"].nextTypeData={...next["@attributes"]}; } return item["@attributes"] }) } } } console.log('pppddd_arrangeNodes',xmlToJson(XmlNode),flowData) return flowData; } //测试数据 export const modelData={ nodes: [ { id: "597ae1c9", label: "Node", x: "231.34375", y: "92", }, { id: "0ffb03ef", label: "Node", x: "265.34375", y: "271" } ], edges: [ { label: "Label", source: "597ae1c9", target: "0ffb03ef" } ] } export default saveWorkFlow;
import firebase from 'firebase'; const firebaseConfig = { apiKey: "AIzaSyAqlr05QksJQJHnJr_iOXOQPpGFYK3eNuI", authDomain: "airtime-68ec4.firebaseapp.com", databaseURL: "https://airtime-68ec4-default-rtdb.firebaseio.com", projectId: "airtime-68ec4", storageBucket: "airtime-68ec4.appspot.com", messagingSenderId: "", appId: "1:545695197460:android:5f8de33b8d4c71c384fa01" }; firebase.initializeApp(firebaseConfig); // var admin = require("firebase-admin"); // var serviceAccount = require("path/to/serviceAccountKey.json"); // admin.initializeApp({ // credential: admin.credential.cert(serviceAccount), // databaseURL: "https://airtime-68ec4-default-rtdb.firebaseio.com" // }); module.exports = { signUp: function (user, callback) { console.log('data',user) firebase.firestore() .collection('users') .add({user}) .then(data => callback(data)) .catch(error => console.log(error)); }, };
import { makeActionCreator } from '../../../utils/helpers/redux'; export const ORDER_DETAIL_REQUEST = 'orderdetail/ORDER_DETAIL_REQUEST'; export const ORDER_DETAIL_SUCCESS = 'orderdetail/ORDER_DETAIL_SUCCESS'; export const ORDER_GET_QUESTIONS_REQUEST = 'orderdetail/ORDER_GET_QUESTIONS_REQUEST'; export const ORDER_GET_QUESTIONS_SUCCESS = 'orderdetail/ORDER_GET_QUESTIONS_SUCCESS'; export const PERFORM_SERVICE_REQUEST = 'orderdetail/PERFORM_SERVICE_REQUEST'; export const PERFORM_SERVICE_SUCCESS = 'orderdetail/PERFORM_SERVICE_SUCCESS'; export const MAKE_QUESTION_REQUEST = 'orderdetail/MAKE_QUESTION_REQUEST'; export const MAKE_QUESTION_SUCCESS = 'orderdetail/MAKE_QUESTION_SUCCESS'; export const CLEAR_STATE = 'orderdetail/CLEAR_STATE'; export const TOGGLE_QUESTION_MODAL = 'orderdetail/TOGGLE_QUESTION_MODAL'; export const orderDetailRequest = makeActionCreator(ORDER_DETAIL_REQUEST, 'request'); export const orderDetailSuccess = makeActionCreator(ORDER_DETAIL_SUCCESS, 'response'); export const getQuestionsRequest = makeActionCreator(ORDER_GET_QUESTIONS_REQUEST, 'request'); export const getQuestionsSuccess = makeActionCreator(ORDER_GET_QUESTIONS_SUCCESS, 'response'); export const performServiceRequest = makeActionCreator(PERFORM_SERVICE_REQUEST, 'request'); export const performServiceSuccess = makeActionCreator(PERFORM_SERVICE_SUCCESS, 'response'); export const makeQuestionRequest = makeActionCreator(MAKE_QUESTION_REQUEST, 'request'); export const makeQuestionSuccess = makeActionCreator(MAKE_QUESTION_SUCCESS, 'response'); export const clearState = makeActionCreator(CLEAR_STATE, 'response'); export const toggleQuestionModal = makeActionCreator(TOGGLE_QUESTION_MODAL, 'response'); export const ActionsTypes = { ORDER_DETAIL_REQUEST, ORDER_DETAIL_SUCCESS, ORDER_GET_QUESTIONS_REQUEST, ORDER_GET_QUESTIONS_SUCCESS, PERFORM_SERVICE_REQUEST, PERFORM_SERVICE_SUCCESS, MAKE_QUESTION_REQUEST, MAKE_QUESTION_SUCCESS, CLEAR_STATE, TOGGLE_QUESTION_MODAL }; export const Actions = { orderDetailRequest, orderDetailSuccess, getQuestionsRequest, getQuestionsSuccess, performServiceRequest, performServiceSuccess, makeQuestionRequest, makeQuestionSuccess, clearState, toggleQuestionModal };
/**n 명의 택배 배달원은 쌓인 택배를 배달해야 합니다. 각 택배는 접수된 순서로 배달이 되며 택배마다 거리가 주어집니다. 거리1당 1의 시간이 걸린다고 가정하였을 때 모든 택배가 배달 완료될 시간을 구하세요. 1. 모든 택배의 배송 시간 1 이상이며 배달지에 도착하고 돌아오는 왕복 시간입니다. 2. 택배는 물류창고에서 출발합니다. 3. 배달을 완료하면 다시 물류창고로 돌아가 택배를 받습니다. 4. 물류창고로 돌아가 택배를 받으면 배달을 시작합니다. 5. 택배를 상차할 때 시간은 걸리지 않습니다. 입력은 배달원의 수와 택배를 배달하는 배달 시간이 주어집니다. ex) 배달원이 3명이고 각 거리가 [1,2,1,3,3,3]인 순서로 들어오는 경우 */ function sol(n, l){ //n:택배원 수, l:택배들 let answer = 0; //택배원 수 만큼의 배열 생성 let man = new Array(n).fill(0); //모든 택배가 상차 되었을 경우 종료 while (l.length !== 0){ //택배원 수 만큼 반복 for (let j = 0; j < man.length; j++){ //택배원이 배달하고있는 택배의 잔여거리가 0인경우(배송완료인경우) 택배상차 if (man[j] == 0 && l){ man[j] += l.shift(); //shift()는 배열의 첫번째 요소 삭제 } } //택배원들 배송거리 -1 처리 man = man.map(x => x = x -1); //1회 반복당 1의 시간증가 answer += 1; } //남은 택배 잔여거리 중 가장 많은 시간이 남은 택배를 더해줌 answer += Math.max.apply(null, man); return answer; } const 배달원 = 3; const 택배 = [1, 2, 1, 3, 3, 3]; console.log(sol(배달원, 택배));
'use strict'; angular.module('app.home').directive('selectedItemCO', function() { return { restrict: 'C',//A 用于元素的 Attribute,这是默认值,E 用于元素的名称,C 用于 CSS 中的 class templateUrl: 'app/map-dashboard/views/selectedItemCO.tpl.html' }; });
// example/demo05-passing-data-across-components/src/store/action.js import { createAction } from './index'; import { XIA_SHENG_ZHI, SHANG_ZHOU_ZE } from './type'; /** * 上奏折 */ export const reduxShangZhouZe = createAction(SHANG_ZHOU_ZE); /** * 下圣旨 */ export const reduxXiaShengZhi = createAction(XIA_SHENG_ZHI);
import Fs from 'fs'; import Path from 'path'; import { EventEmitter } from 'events'; const SEPARATOR = '\nend\n'; const Tuple = Object.freeze({ create({ id, comp, stream, task, tuple }) { return { id, stream, task, component: comp, values: tuple }; } }); export default class Dispatcher extends EventEmitter { constructor(initialize, readable = process.stdin, writeable = process.stdout) { super(); this.readable = readable; this.writeable = writeable; this.once('message', ({ conf, context, pidDir }) => { initialize.call(this, conf, context, (err) => { if (err) { this.log(err.stack); return; } this.on('message', message => { if (Dispatcher.isTaskIds(message)) { this.emit('tasks', message); return; } if (Dispatcher.isCommand(message)) { this.emit(message.command, message); return; } if (Dispatcher.isHeartbeat(message)) { this.emit('heartbeat'); return; } this.emit('tuple', Tuple.create(message)); }); let pid = Dispatcher.writePid(pidDir); this.send({ pid }); }); }); } run() { let part = ''; this.readable.on('readable', () => { let chunk, chunks = []; // Read in all the data. while ((chunk = this.readable.read()) !== null) { chunks.push(chunk); } // Combine newly read data with any existing data (`part`) chunk = Buffer.concat(chunks); part += chunk.toString('utf8'); // Extract individual messages let messages = part.split(SEPARATOR); // If there are no terminators (e.g. length === 1 or 0), // assume there are no complete messages, thus there // is no work to do. if (messages.length > 1) { // Last message is either empty string (part ended // with separator), or non-empty string (partial // message awaiting remaining content and separator). // Either way, keep that for next read operation. part = messages.pop(); // The remaining contents of the array are messages, // so emit those. for (let message of messages) { this.emit('message', JSON.parse(message)); } } }); } send(message) { this.writeable.write(JSON.stringify(message) + SEPARATOR, 'utf8'); } static isHeartbeat({ task, stream }) { return task === -1 && stream === '__heartbeat'; } static isTaskIds(message) { return Array.isArray(message); } static isCommand(message) { return 'command' in message; } static writePid(dir) { let pid = process.pid; let pidfile = Path.join(dir, String(pid)); Fs.closeSync(Fs.openSync(pidfile, 'w')); return pid; } }
// hold the main container import React from 'react'; import {Provider} from 'react-redux'; import store from './store'; import Screens from '../navigation'; import {StyleProvider} from 'native-base'; import getTheme from '../../native-base-theme/components'; import commonColor from '../../native-base-theme/variables/commonColor'; const ReduxApp = () => { return ( <Provider store={store}> <StyleProvider style={getTheme(commonColor)}> <Screens/> </StyleProvider> </Provider> ) } export default ReduxApp;
'use strict'; function requiredProcessEnv(name) { if(!process.env[name]) { throw new Error('You must set the ' + name + ' environment variable'); } return process.env[name]; } function processEnv(name) { return process.env[name]; } module.exports = { port: requiredProcessEnv('PORT'), APIv4: requiredProcessEnv('APIv4'), APIv1: processEnv('APIv1'), APIv3: processEnv('APIv3') };
var Ingredient = require(__dirname + '/../../lib/model/ingredient'); var unit = require(__dirname + '/../../lib/model/unit'); var m = require('moment'); /** * Tests that the constructor does not throw an exception when valid input is * given, and does throw exceptions when invalid input is given */ module.exports = { testConstructor: function(test) { test.expect(8); var good = new Ingredient('ham', 100, 'grams', '12/06/2015'); test.equal(good.name, 'ham', 'name should be ham'); test.equal(good.amount, 100, 'amount should be 100'); test.equal(good.unit, 'grams', 'unit should be grams'); test.equal(good.useBy.format('YYYYMMDD'), m('12/06/2015', 'DD/MM/YYYY').format('YYYYMMDD'), 'useBy should be 12/06/2015'); test.throws(function() { new Ingredient(null, 100, 'grams', '12/06/2015'); }, 'Ingredient.name is required', 'Ingredient.name should be required'); test.throws(function() { new Ingredient('ham', null, 'grams', '12/06/2015'); }, 'Ingredient.amount is required', 'Ingredient.amount should be required'); test.throws(function() { new Ingredient('ham', 100, null, '12/06/2015'); }, 'Ingredient.unit is required', 'Ingredient.unit should be required'); test.doesNotThrow(function() { new Ingredient('ham', 100, 'grams'); }, 'Ingredient.useBy should not be required'); test.done(); } };
import {Component, Fragment} from 'react' import {withRouter} from 'next/router' import Head from 'next/head' import Container, {Main} from './styles' class Layout extends Component { constructor(props) { super(props) } render() { const {children} = this.props return ( <Fragment> <Head> <title>Reviews page</title> </Head> <Container> <Main>{children}</Main> </Container> </Fragment> ) } } export default withRouter(Layout)
import React, { Component } from 'react'; import PropTypes from 'prop-types'; class TeamMember extends Component { static propTypes = { img: PropTypes.object, bio: PropTypes.string.isRequired, jobTitle: PropTypes.string.isRequired, name: PropTypes.string.isRequired, }; render() { const { img, bio, jobTitle, name } = this.props; const hasImg = img && img.source_url; return ( <article className={ hasImg ? 'team-member' : 'team-member team-member--no-img' } > { hasImg && ( <div className="team-member__img"> <img src={ img.source_url } alt={ img.alt_text } /> </div> ) } <div className="team-member__info"> <h2 className="team-member__name">{ name }</h2> { jobTitle && ( <h3 className="team-member__job-title">{ jobTitle }</h3> ) } <div className="team-member__bio" dangerouslySetInnerHTML={ { __html: bio, } } /> </div> </article> ); } } export default TeamMember;
import {LitElement, html} from '@polymer/lit-element'; import '/node_modules/evejs/dist/eve.custom.js'; import { VisAgent } from './agents/VisAgent.js' import './vis-popup.js'; class SpoggyVis extends LitElement { render() { return html` <style> .mood { color: green; } #mynetwork { top: 0; left: 0; width: 100%; height: 50vh; /*height: 90vh;*/ bottom: 0px !important;; border: 1px solid lightgray; background: linear-gradient(to bottom, rgba(55, 55, 255, 0.2), rgba(200, 200, 10, 0.2)); } div.vis-network div.vis-manipulation { box-sizing: content-box; border-width: 0; border-bottom: 1px; border-style:solid; border-color: #d6d9d8; background: #ffffff; /* Old browsers */ background: -moz-linear-gradient(top, #ffffff 0%, #fcfcfc 48%, #fafafa 50%, #fcfcfc 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(48%,#fcfcfc), color-stop(50%,#fafafa), color-stop(100%,#fcfcfc)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* IE10+ */ background: linear-gradient(to bottom, #ffffff 0%,#fcfcfc 48%,#fafafa 50%,#fcfcfc 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#fcfcfc',GradientType=0 ); /* IE6-9 */ padding-top:4px; position: absolute; left: 0; top: 0; width: 100%; height: 28px; } div.vis-network div.vis-edit-mode { position:absolute; left: 0; top: 5px; height: 30px; } /* FIXME: shouldn't the vis-close button be a child of the vis-manipulation div? */ div.vis-network div.vis-close { position:absolute; right: 0; top: 0; width: 30px; height: 30px; background-position: 20px 3px; background-repeat: no-repeat; background-image: url("../node_modules/vis/dist/img/network/cross.png"); cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } div.vis-network div.vis-close:hover { opacity: 0.6; } div.vis-network div.vis-manipulation div.vis-button, div.vis-network div.vis-edit-mode div.vis-button { float:left; font-family: verdana; font-size: 12px; -moz-border-radius: 15px; border-radius: 15px; display:inline-block; background-position: 0px 0px; background-repeat:no-repeat; height:24px; /* margin-left: 10px; */ /*vertical-align:middle;*/ cursor: pointer; padding: 0px 8px 0px 8px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } div.vis-network div.vis-manipulation div.vis-button:hover { box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.20); } div.vis-network div.vis-manipulation div.vis-button:active { box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.50); } div.vis-network div.vis-manipulation div.vis-button.vis-back { background-image: url("../node_modules/vis/dist/img/network/backIcon.png"); } div.vis-network div.vis-manipulation div.vis-button.vis-none:hover { box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.0); cursor: default; } div.vis-network div.vis-manipulation div.vis-button.vis-none:active { box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.0); } div.vis-network div.vis-manipulation div.vis-button.vis-none { padding: 0; } div.vis-network div.vis-manipulation div.notification { margin: 2px; font-weight: bold; } div.vis-network div.vis-manipulation div.vis-button { background-color:#0D578B; color:white; } div.vis-network div.vis-manipulation div.vis-button.vis-add { background-image: url("../node_modules/vis/dist/img/network/addNodeIcon.png"); } div.vis-network div.vis-manipulation div.vis-button.vis-edit, div.vis-network div.vis-edit-mode div.vis-button.vis-edit { background-image: url("../node_modules/vis/dist/img/network/editIcon.png"); } div.vis-network div.vis-edit-mode div.vis-button.vis-edit.vis-edit-mode { background-color: #fcfcfc; border: 1px solid #cccccc; } div.vis-network div.vis-manipulation div.vis-button.vis-connect { background-image: url("../node_modules/vis/dist/img/network/connectIcon.png"); } div.vis-network div.vis-manipulation div.vis-button.vis-delete { background-image: url("../node_modules/vis/dist/img/network/deleteIcon.png"); } /* top right bottom left */ div.vis-network div.vis-manipulation div.vis-label, div.vis-network div.vis-edit-mode div.vis-label { margin: 0 0 0 23px; line-height: 25px; } div.vis-network div.vis-manipulation div.vis-separator-line { float:left; display:inline-block; width:1px; height:21px; background-color: #bdbdbd; margin: 0px 1px 0 1px; /* margin: 0px 7px 0 15px;*/ /*top right bottom left*/ } div.vis-network div.vis-navigation div.vis-button { width:34px; height:34px; -moz-border-radius: 17px; border-radius: 17px; position:absolute; display:inline-block; background-position: 2px 2px; background-repeat:no-repeat; cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } div.vis-network div.vis-navigation div.vis-button:hover { box-shadow: 0 0 3px 3px rgba(56, 207, 21, 0.30); } div.vis-network div.vis-navigation div.vis-button:active { box-shadow: 0 0 1px 3px rgba(56, 207, 21, 0.95); } div.vis-network div.vis-navigation div.vis-button.vis-up { background-image: url("../node_modules/vis/dist/img/network/upArrow.png"); bottom:50px; left:55px; } div.vis-network div.vis-navigation div.vis-button.vis-down { background-image: url("../node_modules/vis/dist/img/network/downArrow.png"); bottom:10px; left:55px; } div.vis-network div.vis-navigation div.vis-button.vis-left { background-image: url("../node_modules/vis/dist/img/network/leftArrow.png"); bottom:10px; left:15px; } div.vis-network div.vis-navigation div.vis-button.vis-right { background-image: url("../node_modules/vis/dist/img/network/rightArrow.png"); bottom:10px; left:95px; } div.vis-network div.vis-navigation div.vis-button.vis-zoomIn { background-image: url("../node_modules/vis/dist/img/network/plus.png"); bottom:10px; right:15px; } div.vis-network div.vis-navigation div.vis-button.vis-zoomOut { background-image: url("../node_modules/vis/dist/img/network/minus.png"); bottom:10px; right:55px; } div.vis-network div.vis-navigation div.vis-button.vis-zoomExtends { background-image: url("../node_modules/vis/dist/img/network/zoomExtends.png"); bottom:50px; right:15px; } </style> Spoggy Vis Web Components are <span class="mood">${this.mood}</span>!<br> <div id="mynetwork"></div> <vis-popup id="popupAgent" parent="${this.id}"></vis-popup> `; } static get properties() { return { id: {type: String, value:""}, mood: {type: String} }; } constructor() { super(); this.mood = 'Spoggy Vis'; } firstUpdated(){ var app = this; console.log( 'id : ', this.id); this.agentVis = new VisAgent(this.id, this); console.log(this.agentVis); //this.agentVis.send('agentApp', {type: 'dispo', name: this.id }); var container = this.shadowRoot.getElementById('mynetwork'); // console.log(container) // create an array with nodes var nodes = new vis.DataSet([ {id: "node1", label: 'Node 1'}, {id: "node2", label: 'Node 2'}, {id: "node3", label: 'Node 3'}, {id: "node4", label: 'Node 4'}, {id: "node5", label: 'Node 5'} ]); // create an array with edges var edges = new vis.DataSet([ {from: "node1", to: "node3", arrows:'to', label: "type"}, {from: "node1", to: "node2", arrows:'to', label: "subClassOf"}, {from: "node2", to: "node4", arrows:'to', label: "partOf"}, {from: "node2", to: "node5", arrows:'to', label: "first"}, {from: "node3", to: "node3", arrows:'to', label: "mange"} ]); var data = { nodes: nodes, edges: edges }; var seed = 2; var options = { layout: {randomSeed:seed}, // just to make sure the layout is the same when the locale is changed // locale: this._root.querySelector('#locale').value, edges:{ arrows: { to: {enabled: true, scaleFactor:1, type:'arrow'}, middle: {enabled: false, scaleFactor:1, type:'arrow'}, from: {enabled: false, scaleFactor:1, type:'arrow'} }}, interaction:{ navigationButtons: true, // keyboard: true //incompatible avec rappel de commande en cours d'implémentation multiselect: true, }, manipulation: { addNode: function (data, callback) { // filling in the popup DOM elements // app.shadowRoot.getElementById('node-operation').innerHTML = "Add Node"; // data.label ="" //console.log(app.shadowRoot.getElementById('popup')); // console.log(this.shadowRoot.getElementById('popup')); console.log("NETWORK ADD NODE ",data,callback) //app.editNode(data, app.clearNodePopUp, callback); app.agentVis.send('popupAgent', {type: "addNode", data: data, callback: callback}); }, editNode: function (data, callback) { // filling in the popup DOM elements //app.shadowRoot.getElementById('node-operation').innerHTML = "Edit Node"; console.log("NETWORK EDIT NODE ",data,callback) // app.editNode(data, app.cancelNodeEdit, callback); app.agentVis.send('popupAgent', {type: "editNode", data: data, callback: callback}); }, addEdge: function (data, callback) { console.log("NETWORK ADD EDGE ", data,callback) if (data.from == data.to) { var r = confirm("Souhaitez-vous connecter ce noeud sur lui-même?"); if (r != true) { callback(null); return; } } // app.shadowRoot.getElementById('edge-operation').innerHTML = "Add Edge"; //app.editEdgeWithoutDrag(data, callback); app.agentVis.send('popupAgent', {type: "addEdge", data: data, callback: callback}); }, editEdge: { //console.log("EDIT EDGE ", data,callback) editWithoutDrag: function(data, callback) { console.log("NETWORK EDIT WITHOUT DRAG ", data,callback) // app.shadowRoot.getElementById('edge-operation').innerHTML = "Edit Edge"; // app.editEdgeWithoutDrag(data,callback); app.agentVis.send('popupAgent', {type: "editEdgeWithoutDrag", data: data, callback: callback}); } } } }; app.network = new vis.Network(container, data, options); app.network.on("selectNode", function (params) { console.log('selectNode Event: ', params); }); console.log(app.network) } savenode(data){ this.popup = null; console.log("SAVENODE :",data) } updated(changedProperties){ super.updated(changedProperties) changedProperties.forEach((oldValue, propName) => { console.log(`${propName} changed. oldValue: ${oldValue}`); console.log("responseData UPDATED: ",this.responseData) }); } attributeChangedCallback(name, oldval, newval) { console.log('attribute change: ', name, oldval, newval); super.attributeChangedCallback(name, oldval, newval); } } customElements.define('spoggy-vis', SpoggyVis);
(function () { define(['jquery', 'bootstrap'], function ($) { return { initCarousel: function (selector) { $(selector).carousel({ interval: 6000 }) } } }) })();
/** * Created by Andrii_Shoferivskyi on 2018-04-26. */ import NetworkItem from './NetworkItem'; import Router from './Router'; import icon from '../img/gateway.png'; export default class Gateway extends NetworkItem { constructor(container, obj) { console.log(obj); super(container, icon, obj); this.routers = obj.routers.filter(el => el).map(el => new Router(container, el)); this.drawLines('routers', this.id); this.element.addEventListener('dragend', this.drawLines.bind(this, 'routers', this.id)); this.routers.forEach(router => { router.element.addEventListener('dragend', this.drawLines.bind(this, 'routers', this.id)); }) } }
exports.clamp = function(x, y) { return x <= y ? x : y; }; exports.shade = function(col, amt) { var usePound = false; if (col[0] === "#") { col = col.slice(1); usePound = true; } var num = parseInt(col, 16); var r = (num >> 16) + amt; if (r > 255) r = 255; else if (r < 0) r = 0; var b = ((num >> 8) & 0x00ff) + amt; if (b > 255) b = 255; else if (b < 0) b = 0; var g = (num & 0x0000ff) + amt; if (g > 255) g = 255; else if (g < 0) g = 0; return (usePound ? "#" : "") + (g | (b << 8) | (r << 16)).toString(16); }; export function hexToHSL(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); var r = parseInt(result[1], 16); var g = parseInt(result[2], 16); var b = parseInt(result[3], 16); (r /= 255), (g /= 255), (b /= 255); var max = Math.max(r, g, b), min = Math.min(r, g, b); var h, s, l = (max + min) / 2; if (max == min) { h = s = 0; // achromatic } else { var d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch (max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } var HSL = new Object(); HSL["h"] = h; HSL["s"] = s; HSL["l"] = l; return HSL; } export function hexToRgb(hex) { var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; } export function HSLToHex(hsl) { var h = hsl.h, s = hsl.s, l = hsl.l; var r, g, b; if (s === 0) { r = g = b = l; // achromatic } else { const hue2rgb = (p, q, t) => { if (t < 0) t += 1; if (t > 1) t -= 1; if (t < 1 / 6) return p + (q - p) * 6 * t; if (t < 1 / 2) return q; if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; return p; }; const q = l < 0.5 ? l * (1 + s) : l + s - l * s; const p = 2 * l - q; r = hue2rgb(p, q, h + 1 / 3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1 / 3); } const toHex = x => { const hex = Math.round(x * 255).toString(16); return hex.length === 1 ? "0" + hex : hex; }; return `#${toHex(r)}${toHex(g)}${toHex(b)}`; } export function foregroundColor(hex, lightness, lightColor, darkColor) { return hexToHSL(hex).l < lightness ? lightColor : darkColor; } export function luminanace(hex) { var rgb = hexToRgb(hex); var a = [rgb.r, rgb.g, rgb.b].map(function(v) { v /= 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); }); return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722; } export function darken(hex, amount) { var hsl = hexToHSL(hex); hsl.l = hsl.l * amount; var hex = HSLToHex(hsl); return hex; } export const isBrowser = new Function( "try {return this===window;}catch(e){ return false;}" );
/* * Create a list that holds all of your cards */ const theDeck=document.querySelector(".deck"); //initial array of cards without their double: const initCardsArray=["fa fa-diamond","fa fa-anchor","fa fa-paper-plane-o","fa fa-bolt","fa fa-cube","fa fa-leaf","fa fa-bomb","fa fa-bicycle"]; //doubles the array: const cardsArray= initCardsArray.concat(initCardsArray); //calls the createCards function: createCards(); /* * Display the cards on the page * - shuffle the list of cards using the provided "shuffle" method below * - loop through each card and create its HTML * - add each card's HTML to the page */ // Shuffle function from http://stackoverflow.com/a/2450976 function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; while (currentIndex !== 0) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; } function createCards(){ //calls the function to shuffle the array of cards and saves it to shuffledArray: const shuffledArray = shuffle(cardsArray); const frag=document.createDocumentFragment(); //iterates through the shuffled cardsArray and creates the html for the deck: for (var i = 0 ; i< shuffledArray.length; i++ ){ let el=document.createElement("li"); el.classList.add("card"); let childEl=document.createElement("i"); childEl.className=shuffledArray[i]; el.appendChild(childEl); frag.appendChild(el); } //adds the html created to the deck: theDeck.appendChild(frag); } /* * set up the event listener for a card. * * If a card is clicked: * * - display the card's symbol (put this functionality in another function that you call from this one) * * - add the card to a *list* of "open" cards (put this functionality in another function that you call from this one) * * - if the list already has another card, check to see if the two cards match * + if the cards do match, lock the cards in the open position (put this functionality in another function that you call from this one) * + if the cards do not match, remove the cards from the list and hide the card's symbol (put this functionality in another function that you call from this one) * + increment the move counter and display it on the page (put this functionality in another function that you call from this one) * + if all cards have matched, display a message with the final score (put this functionality in another function that you call from this one) */ let timerStarted=false; //handles the actions to take place once the card is clicked: function cardFlip(evt){ const cardClicked=evt.target; //makes sure the functions only proceed if the actual cards are clicked and nowhere else in the page: if (cardClicked.className==="card"){ //adds the classes to show the card when clicked: cardClicked.classList.add("open","show"); //increments the moves counter: movesCount(); //adds clicked card to the array: cardClickedArray.push(cardClicked); //calls function to compare cards: cardCompare(); //calls function to determines the amount of stars: displayStars(); //calls function to start timer: if (!timerStarted){ timingGame(); timerStarted=true; } }//end of if statement }//end of cardFlip function function cardCompare(){ //makes sure there is more than one card in array to compare, then executes code: if (cardClickedArray.length > 1) { //compares the two cards clicked to see if their names match: if (cardClickedArray[0].firstElementChild.className === cardClickedArray[1].firstElementChild.className) { cardsMatch(); } else { //sets a delay so the card doesn't dissapear too quickly after hiding them if they don't match: setTimeout(cardsDontMatch,600); }//end of second if statement //calls function to calculate when game is finished: gameFinished(); } }//end of first if statement function movesCount(){ //sets the actual counter for the moves const moveCount=moves.textContent; moves.textContent=parseInt(moveCount)+1; } function displayStars(){ //creates new element for the stars: const oneStar=document.createElement('li'); oneStar.innerHTML="<i class=\"fa fa-star\"></i>"; //makes a copy of the firstStar node and names it secondStar: const twoStars= oneStar.outerHTML + oneStar.outerHTML; //makes a copy of the secondStar node and names it thirdStar: const threeStars=oneStar.outerHTML + oneStar.outerHTML + oneStar.outerHTML; //gathers the amount of moves made so far: let theMoves=moves.textContent; //gathers the amount of matched cards so far: let matchedCards=document.querySelectorAll(".match").length; //calculates the amount of moves vs the amount of matched cards: let calc=parseInt(theMoves)/matchedCards; //gathers the amount of existent stars: let starCount = document.querySelector(".stars").childElementCount; //saves the element with stars class into the stars constant: const stars=document.querySelector(".stars"); if (calc < 2 ){ switch (starCount) { case 0: stars.innerHTML=threeStars; break; case 1: stars.innerHTML=twoStars; break; case 2: stars.appendChild(oneStar); //using node break; }//end of switch statement } else if ((calc >= 2) && (calc < 4)){ switch (starCount) { case 0: stars.innerHTML=twoStars; break; case 1: stars.appendChild(oneStar); //using node break; case 3: stars.lastElementChild.remove(); break; }//end of switch statement } else if ((calc >=4) && (calc < 6)){ switch (starCount) { case 0: stars.appendChild(oneStar); //using node break; case 2: stars.lastElementChild.remove(); break; case 3: stars.lastElementChild.remove(); stars.lastElementChild.remove(); break; }//end of switch statement } else { stars.innerHTML=""; } //end of if statement } //end of displayStars function //timer setup: let time=0; const timer=document.querySelector(".timer"); let myTimer; let timeString; function timingGame(){ myTimer=setInterval(startTimer,1000); } function startTimer(){ time++; let mins=Math.floor(time/60); let secs=time-(mins*60); if (secs<10){ timeString=mins+":0"+secs; } else { timeString=mins+":"+secs; } timer.innerHTML=timeString; } function resetTimer(){ clearInterval(myTimer); time=0; timer.innerHTML="0:00"; timerStarted=false; } function cardsMatch() { cardClickedArray[0].className="card match"; cardClickedArray[1].className="card match"; cardClickedArray.length=0; } function cardsDontMatch() { cardClickedArray[0].classList.remove("open","show"); cardClickedArray[1].classList.remove("open","show"); cardClickedArray.length=0; } //clears out the deck and score when the reset widget is clicked: function resetDeck(){ theDeck.innerHTML=""; cardClickedArray.length=0; document.querySelector(".stars").innerHTML=""; document.querySelector(".moves").textContent=0; resetTimer(); createCards(); } function resetModal(){ modal.classList.remove("show-modal"); resetDeck(); } //move count setup: const moves=document.querySelector(".moves"); const cardClickedArray=[]; //card clicking setup: theDeck.addEventListener("click",cardFlip); //restart-reset widget setup: const restart = document.querySelector(".restart"); restart.addEventListener("click",resetDeck); const modal = document.querySelector(".modal"); //play again button (on modal) setup: const playAgainBtn = document.getElementById("modal-btn"); playAgainBtn.addEventListener("click",resetModal); //finishing the game and displaying the stats: function gameFinished(){ const allCards=document.querySelectorAll(".card"); let count=0; allCards.forEach( function(el){ if (el.classList.contains("match")){ count++; } } ); //sets up the modal where the stats will be displayed once the game is finished: if (count===allCards.length){ clearInterval(myTimer); const mcText = document.getElementById("modal-text"); const finalMoves = document.querySelector(".moves").textContent; const finalStars = document.querySelector(".stars").childElementCount; const displayTime = timeString.substring(0,1) + " minutes, " + timeString.substring(2,5) + " seconds "; mcText.innerHTML="<h1>Congratulations!</h1><p>You finished the game in " + displayTime + " with " + finalMoves + " moves and earned " + finalStars + " stars.</p>" ; modal.classList.add("show-modal"); }//end of if statement }//end of gameFinished function
registerApp.controller("register-controller", function ($scope, $location, registerResource) { $scope.notRegister = true; $scope.loading = false; $scope.error = false; $scope.emailAddress =""; $scope.password =""; $scope.register = function () { $scope.loading = true; $scope.error = false; var user = { "email": $scope.emailAddress, "password": $scope.password }; registerResource.post(user, function onSuccess(data) { $scope.loading = false; $location.path("/login"); }, function onError(data) { $scope.loading = false; $scope.error = true; }); } })
export const pushUserToList = (state, { user }) => { state.users.push(user) } export const setEditModal = (state, isShow) => { state.isShowEditModal = isShow; } export const setEditUser = (state, user) => { state.currentUserEdit = user; } export const loadUser = (state, users) => { state.users = users; }
import React,{ useState } from 'react'; import { useHistory } from 'react-router-dom'; import { useCookies } from 'react-cookie'; import api from '../services/api'; const Login = () => { const [inputEmail, setEmail] = useState(''); const [inputPassword, setPassword] = useState(''); const [cookies, setCookie] = useCookies(); let history = useHistory(); const handleLogin = (e) => { e.preventDefault(); try{ api.post('/users/login',{inputEmail, inputPassword}).then(res => { if(res.status === 200){ setCookie('userJWT', res.data.userJWT); setCookie('address', res.data.address); setCookie('userType',res.data.userType); history.push('/dashboard'); }else{ history.push('/invalid',{message: 'Invalid username/password'}); } }) } catch(e){ console.log(e); throw e; } } const setEmailChange = (e) => { setEmail(e.target.value); } const setPasswordChange = (e) => { setPassword(e.target.value); } return( <div> <div className="row justify-content-md-center"> <div className="text-center col-sm-6 col-offset-2"> <form className="form-signin"> <img className="mb-4" src="https://getbootstrap.com/docs/4.0/assets/brand/bootstrap-solid.svg" alt="" width="72" height="72" /> <h1 className="h3 mb-3 font-weight-normal">Please sign in</h1> <label className="sr-only">Email address</label> <input type="text" id="inputEmail" name="inputEmail" className="form-control" placeholder="Username" required autoFocus onChange={setEmailChange}/> <label className="sr-only">Password</label> <input type="password" id="inputPassword" name="inputPassword" className="form-control" placeholder="Password" required onChange={setPasswordChange} /> <div className="checkbox mb-3"> <label> <input type="checkbox" value="remember-me" /> Remember me </label> </div> <button className="btn btn-lg btn-primary btn-block" type="submit" onClick={handleLogin} >Sign in</button> <p className="mt-5 mb-3 text-muted">&copy; 2017-2018</p> </form> </div> </div> </div> ); } export default Login;
import React, { Component } from 'react'; import { Text, View , Image , TouchableOpacity} from 'react-native'; import { f , auth , database } from '../../config/config'; class FirstScreen extends Component { constructor(props) { super(props); this.state = { loggedin: false }; //this.registerUser('ttt@gmail.com', 'fffhhhhff'); var that = this; f.auth().onAuthStateChanged(function(user) { if(user){ //Logged in that.setState({ loggedin: true }); //console.log('Logged in', user); } else{ //Logged out that.setState({ loggedin: false }); //console.log('Logged out'); } }); } render() { return ( <View style = {{ flex : 1 ,justifyContent : 'center' , alignItems : 'stretch' }}> {this.state.loggedin == true ? ( this.props.navigation.navigate('Dashboard') ) : ( <View style={styles.container}> <Text style={styles.title}> Welcome to FrienDog</Text> <Image style={styles.ImageStyle} source= {require('../../assets/dog.jpg')} /> <View style={styles.formContainer}> <TouchableOpacity onPress = {() => this.props.navigation.navigate('Login')} style={styles.buttonContainer}> <Text style={styles.buttonText}>Login</Text> </TouchableOpacity> <Text></Text> <Text></Text> <TouchableOpacity onPress = {() => this.props.navigation.navigate('SignUp')} style={styles.buttonContainer}> <Text style={styles.buttonText}>SignUp</Text> </TouchableOpacity> <Text></Text> <Text></Text> </View> </View> )} </View> ) } } const styles = { container: { flex: 1, backgroundColor: '#000000' , alignItems: 'center', justifyContent: 'center' }, ImageStyle : { height : 450, width : 415 }, title: { alignItems: 'center', color: '#FFFFFF', fontSize: 30, fontWeight: 'bold' }, formContainer : { padding: 20, alignItems: 'stretch', width: 415 }, buttonText : { textAlign: 'center', color : '#000000', alignItems: 'stretch' }, buttonContainer: { backgroundColor : '#ffffff', paddingVertical: 10, borderRadius:50 } }; export default FirstScreen;
import Ember from 'ember'; import DS from 'ember-data'; const { computed, get, getProperties, getWithDefault } = Ember; const { attr, hasMany, belongsTo } = DS; export default DS.Model.extend({ quickbooksId: attr('string'), firstName: attr('string'), lastName: attr('string'), fullName: computed('firstName', 'lastName', function() { return `${get(this, 'firstName')} ${getWithDefault(this, 'lastName', '')}`; }), createdAt: attr('date'), totalSpent: attr('number'), email: attr('string'), defaultAddress: attr(), phone: attr('string'), recurring: attr('boolean'), orders: hasMany('order'), isHappy: attr('string'), age: attr('number'), likeFit: attr(), isPregnant: attr('boolean'), checkoutFrequency: attr('number'), allowanceBra: attr(), allowancePanty: attr(), currentManufacturer: attr('string'), surgeryAugmentation: attr('boolean'), surgeryMastectomy: attr('boolean'), surgeryMaleFemale: attr('boolean'), surgeryReduction: attr('boolean'), surgeryNone: attr('boolean'), currentCupSize: attr('string'), currentCupSizeDd: attr('string'), computedCupSize: attr('string'), currentBandSize: attr('number'), currentBandSizeDd: attr('number'), computedBandSize: attr('number'), currentPantSize: attr('number'), currentDressSize: attr('number'), computedSisterSize: attr('number'), currentSize: computed('currentCupSize', 'currentBandSize', function() { return `${get(this, 'currentCupSize').trim()}${get(this, 'currentBandSize')}` }), computedSize: computed('computedCupSize', 'computedBandSize', function() { return `${get(this, 'computedCupSize').trim()}${get(this, 'computedBandSize')}` }), shapeSpaceBetween: attr('number'), shapeFuller: attr('string'), shapeSpread: attr('number'), measureLying: attr('number'), measureWaist: attr('number'), measureTight: attr('number'), measureStanding: attr('number'), measureSnug: attr('number'), measureLeaning: attr('number'), styleCoverage: attr(), styleTop: attr(), styleDesign: attr(), styleWardrobe: attr(), styleBottom: attr() });
import React, { useContext, useEffect, useState } from 'react' import { Form, Button } from 'react-bootstrap' import { useParams } from "react-router-dom" import {TaskContext} from '../../context/TaskContext' export const EditTaskComponent = () => { let { id } = useParams() const {task, setTask } = useContext(TaskContext) // let initialState = task.filter(tas => { // if (tas.id === id){ // console.log(task) //aquí está el // // console.log(tas.id) // // setUpdateTask(tas.content) // }}) // const [updateTask, setUpdateTask] = useState('initialState') // // const hho = task.filter(tas => { // // if (tas.id === id){ // // console.log(task) //aquí está el // // // console.log(tas.id) // // // setUpdateTask(tas.content) // // }}) // useEffect(() => { // }, [hho]) // console.log(updateTask) //1 recibimos los tasks //2 sacar el content de la task con id //3 ese debe ser el initial state //4 el nuevo state será la tarea modificada //5 return ( <div> <Form> <Form.Group controlId="formBasicEmail"> <Form.Label>Edita la tarea:</Form.Label> <Form.Control type="text" placeholder="Enter task"/> </Form.Group> <Button variant="primary" type="submit" > Guardar </Button> <Button variant="danger" type="submit" href="http://localhost:3000/"> Cancelar </Button> </Form> </div> ) }
import React from 'react'; import UserLine from './UserLine'; import { Tree, TreeNode } from 'react-organizational-chart'; function SquadronTree(props) { console.log("Beginning assignment") let sqCC = props.users.filter(user => user.roleHeiararchy === 5 && user.roleId === 1); let shirt = props.users.filter(user => user.roleHeiararchy === 5 && user.roleId === 7); let deputyCC = props.users.filter(user => user.roleHeiararchy === 5 && user.roleId === 3); let flightCCs = props.users.filter(user => user.roleHeiararchy === 5 && user.roleId === 6); let CEM = props.users.filter(user => user.roleHeiararchy === 5 && user.roleId === 8); let SEM = props.users.filter(user => user.roleHeiararchy === 5 && user.roleId === 9); let NCOICs = props.users.filter(user => user.roleHeiararchy === 5 && user.roleId === 10); console.log("ending assignment") let vacantSqCC = { firstName: 'VACANT', lastName: '', unit: '', afsc: '', roleId: 1, roleHeiararchy: 5, phone: '', email: '', grade: '', }; let vacantDeputy = { firstName: 'VACANT', lastName: '', unit: '', afsc: '', roleId: 3, roleHeiararchy: 5, phone: '', email: '', grade: '', }; let vacantShirt = { firstName: 'VACANT', lastName: '', unit: '', afsc: '', roleId: 7, roleHeiararchy: 5, phone: '', email: '', grade: '', }; let vacantFlightCC = { firstName: 'VACANT', lastName: '', unit: '', afsc: '', roleId: 6, roleHeiararchy: 5, phone: '', email: '', grade: '', }; let vacantCEM = { firstName: 'VACANT', lastName: '', unit: '', afsc: '', roleId: 8, roleHeiararchy: 5, phone: '', email: '', grade: '', }; let vacantNCOIC = { firstName: 'VACANT', lastName: '', unit: '', afsc: '', roleId: 10, roleHeiararchy: 5, phone: '', email: '', grade: '', }; return ( <Tree lineWidth={'2px'} lineHeight={'30px'} lineColor={'blue'} lineBorderRadius={'10px'} label={sqCC.length !== 0 ? <UserLine key={sqCC[0].id} user={sqCC[0]} roles={props.roles} /> : <UserLine key="1" user={vacantSqCC} roles={props.roles} />} > <TreeNode label={deputyCC.length !== 0 ? <UserLine key={deputyCC[0].id} user={deputyCC[0]} roles={props.roles} /> : <UserLine key="1" user={vacantDeputy} roles={props.roles} />} /> <TreeNode label={CEM.length !== 0 ? <UserLine key="1" user={CEM[0]} roles={props.roles} /> : SEM.length !== 0 ? <UserLine key="1" user={SEM[0]} roles={props.roles} /> : <UserLine key="1" user={vacantCEM} roles={props.roles} /> } /> {flightCCs.length !== 0 ? flightCCs.map((user, index) => <TreeNode label={<UserLine key={index} user={user} roles={props.roles} />} children={ NCOICs.length !== 0 ? NCOICs.map((user, index) => <TreeNode label={<UserLine key={index} user={user} roles={props.roles} />} /> ) : <TreeNode label={<UserLine key={index} user={vacantNCOIC} roles={props.roles} /> } />} /> ) : <TreeNode label={<UserLine key="99" user={vacantFlightCC} roles={props.roles} />} children={ NCOICs.length !== 0 ? NCOICs.map((user, index) => <TreeNode label={<UserLine key={index} user={user} roles={props.roles} />} /> ) : <TreeNode label={<UserLine key="99" user={vacantNCOIC} roles={props.roles} /> } />} />} <TreeNode label={shirt.length !== 0 ? <UserLine key="1" user={shirt[0]} roles={props.roles} /> : <UserLine key="1" user={vacantShirt} roles={props.roles} />} /> </Tree> ) } export default SquadronTree;
$(document).ready(function(){ // only samll screens if($(window).width() <=600){ // show menu on swipe to right $(document).on('swiperright',function(e){ e.preventDefault(); $('#menu').animate({ left:'0' }); }); // hide menu on swipe to left $(document).on('swipeleft',function(e){ e.preventDefault(); $('menu').animate({ left:'-100' }); }); } });
let re; re = /Hello/i; // Metacharacter re = /^h/; re = /o$/; re = /h.llo/; re = /h*llo/; re = /he?a?llo/; // Character re = /h[ea]llo/; re = /h[^ea]/; // Anything except re = /h[a-z]llo/; re = /h[A-Za-z]llo/; re = /h[0-9]llo/ // Quantifier re = /hel{2}o/; re = /hel{2,}o/; // {min,} re = /hel{2,4}o/; // Grouping re = /he([a-z]){2,}o/; // Shorthand re = /\w/; // Alphanumeric and _ re = /\w+/; // \w One or More re = /\W/; // Non-word character re = /\d/; // Any digit re = /\d+/; // \d One or more re = /\D/; // Non-digit re = /\s/; // Whitespace re = /\S/; // Non-whitespace re = /Hell\b/ // Word boundary // Assertions re = /h(?=e)/ // Followed by =value re = /h(?!e)/ // Not Followed by =value const str = 'hello'; // console.log(re); // console.log(re.source); console.log(re.exec(str)); // console.log(re.test('Hello')); // console.log(str.match(re)); // console.log(str.search(re)); // console.log(str.replace(re,'Hi')); function reTest(re, str) { if (re.test(str)) { console.log(`${str} matches ${re.source}`); } else { console.log(`${str} does not match ${re.source}`); } } reTest(re, str);
const express = require("express"); const path = require("path"); require('dotenv').config(); const user = require("./routes/user"); const cors = require("cors"); const gigs = require("./routes/gigs"); const request = require("./routes/request"); const transaksi = require("./routes/transaksi"); const revisi = require("./routes/revisi"); const chat = require("./routes/chat"); const favorit = require("./routes/favorit"); const mailer = require("./routes/mailer"); const app = express(); app.use(express.static('./uploads')) app.use(cors()); app.use(express.json()); app.use(express.urlencoded({extended:true})); app.use("/user", user); app.use("/gigs", gigs); app.use("/request", request); app.use("/transaksi", transaksi); app.use("/revisi", revisi); app.use("/chat", chat); app.use("/favorit", favorit); app.use("/mail", mailer); app.use(express.static(__dirname+'/uploads')); app.get("/", function(req, res){ //masuk halaman login/register res.status(200).send("Ini halaman awal"); }); app.listen(process.env.PORT, function(){ console.log("Listening to port "+ process.env.PORT); });
angular.module('ContactBookApp').controller('ContactController', [ '$scope', '$routeParams', 'Contact', function ($scope, $routeParams, Contact) { $scope.canEdit = true; Contact.get({contactId: $routeParams.contactId}, function (response) { $scope.contact = response; }); $scope.save = function () { if ($scope.contact) { Contact.update( $scope.contact, function (response) { $scope.contact = response; } ); } } } ]);
import mongoose from "mongoose"; const UserSchema = new mongoose.Schema( { first_name: { type: String, required: true, minlength: 2, maxlength: 50, }, last_name: { type: String, required: true, minlength: 2, maxlength: 255, }, phone_number: { type: Number, minlength: 10, maxlength: 50, }, }, { timestamps: true } ); export default mongoose.model("User", UserSchema);
console.time('DelRedis'); var redis = require('redis'); var async = require('async'); var client = redis.createClient(6379, 'db01', null); var HASH_MSG_POOL_KEY = 'zjdx_msg:hash_pool:key'; //1) "A1390546681337f" //2) "A1390551870440P" var value = "超值春节流量包大放送*!-_-!* http://b.zj189.cn/msg/file-upload/chunjie.jpg 莫怕春节拷问,且看马上有啥! <br> http://x.zj189.cn/chunjie"; client.HSET(HASH_MSG_POOL_KEY, "A1390578065768w", value, function(err, rrr){ console.log('HSET 结果: ' + rrr); client.HGET(HASH_MSG_POOL_KEY, "A1390578065768w", function(err, r){ console.log('设置了再取回来:' + r); }); }); return; return; client.KEYS('*', function(err, results){ var total = results.length; var count = 0; async.whilst( function(){ return count < total; }, function(cycle){ client.TYPE(results[count], function(e, r){ if(r === 'zset'){ //ZREM key member [member ...] client.ZREM(results[count], "A1390546681337f", "A1390551870440P", function(err, re){ console.log(results[count] + ' ZREM 的结果: ' + re); }); } //End of zset count++; cycle(); }); //End of client.TYPE }, function(err, rrr){ //HDEL key field [field ...] client.HDEL(HASH_MSG_POOL_KEY, "A1390546681337f", "A1390551870440P", function(e, rt){ console.log('最后HDEL的结果: ' + rt); console.log('Keys的数量: ' + total); console.timeEnd('DelRedis'); }); } ); //End of async.whilst }); return; return; return; var field = "A1390549133024a"; var value = '关注\"浙江电信微厅\"抽大奖*!-_-!*易信、微信关注\"浙江电信微厅\"抽大奖<br> http://w.k189.cn/index.php/Wap/WHuodong/micWindow'; value='超值春节流量包大放送*!-_-!* http://b.zj189.cn/msg/admin/file-upload/banner.jpg 莫怕春节拷问,且看马上有啥!<br> http://x.zj189.cn/chunjie'; client.HSET(HASH_MSG_POOL_KEY, field, value, function(err, rrr){ console.log('HSETX 结果: ' + rrr); client.HGET(HASH_MSG_POOL_KEY, field, function(e, r){ console.log('HGET 结果: ' + r); }); });
!function ui(window, document) { var self, signalsControl = document.getElementById("signalsControl"); function trace(text) { console.log((performance.now()/1000).toFixed(3) + ": " + text); } function ui_local_media_ok(stream){ trace("Received local stream"); window.attachMediaStream(signalsControl, stream) signalsControl.style.display = "block"; self.localStream = stream; // TODO ... } function ui_local_media_error(error){ trace("navigator.getUserMedia error: " + error); } function ui_start(signaling, videoStream) { trace("Requesting local stream"); window.getUserMedia({ video: (videoStream||true), audio: true }, ui_local_media_ok, ui_local_media_error); } self = window.ui = { start: ui_start, localStream: null } }(window, document);
/* * productCategoryComponent.js * * Copyright (c) 2017 HEB * All rights reserved. * * This software is the confidential and proprietary information * of HEB. */ 'use strict'; /** * Product Group Search Component. * * @author vn70529 * @since 2.12.0 */ (function () { var app = angular.module('productMaintenanceUiApp'); app.component('productGroupDetail', { // isolated scope binding bindings: { itemReceived: '<', selectedProduct: '<' }, // Inline template which is binded to message variable in the component controller templateUrl: 'src/productGroup/productGroupDetail/productGroupDetail.html', // The controller that handles our component logic controller: ProductGroupDetailController }); ProductGroupDetailController.$inject = ['$rootScope', '$scope', 'ngTableParams', 'codeTableApi', 'productGroupApi', 'ProductGroupService']; /** * product group detail component's controller definition. * @param $scope scope of the case pack info component. * @param codeTableApi * @param ngTableParams * @constructor */ function ProductGroupDetailController($rootScope, $scope, ngTableParams, codeTableApi, productGroupApi, productGroupService) { /** All CRUD operation controls of product group detail page goes here */ var self = this; self.isWaiting = false; /** * The ngTable object that will be waiting for data while the report is being refreshed. * * @type {?} */ self.defer = null; /** * Start position of page that want to show on Product Group Search results. * * @type {number} */ self.PAGE = 1; /** * Tab product group info * @type {String} */ const PRODUCT_GROUP_INFO = "productGroupInfo"; /** * Tab image info * @type {String} */ const IMAGE_INFO = "imageInfo"; /** * Tab ecommerce view info * @type {String} */ const ECOMMERCE_VIEW = "eCommerceView"; /** * Tab selected * @type {String} */ self.selectedTab = "productGroupInfo"; /** * List Product Group Ids received from list Product Group Page. */ self.listOfProducts = []; /** * Product Group selected and received from list Product Group Page. */ self.selectedProduct; /** * Add new Product Group. */ self.isCreateProductGroup = false; /** * init form */ self.init = function(){ if(self.itemReceived !== undefined){ if (productGroupService.getListOfProducts() !== null && productGroupService.getListOfProducts().length > 0 ){ self.listOfProductTemp = []; var listOfProductTempOrg = []; listOfProductTempOrg = angular.copy(productGroupService.getListOfProducts()); for (var i = 0; i < listOfProductTempOrg.length; i++) { self.listOfProductTemp[i] = listOfProductTempOrg[i].customerProductGroup.custProductGroupId; } self.listOfProducts = angular.copy(self.listOfProductTemp); } else{ self.listOfProducts = angular.copy(self.itemReceived.productGroupIds); } self.selectedProduct = angular.copy(self.itemReceived.productGroup.custProductGroupId); }else{ self.isCreateProductGroup = true; } }; /** * prev product selected */ self.prevProductSelect = function(){ var indexItem=self.listOfProducts.indexOf(self.selectedProduct); $rootScope.contentChangedFlag = false; self.handleProductChange(self.listOfProducts[indexItem-1]); } /** * next product selected */ self.nextProductSelect = function(){ var indexItem=self.listOfProducts.indexOf(self.selectedProduct); $rootScope.contentChangedFlag = false; self.handleProductChange(self.listOfProducts[indexItem+1]); } /** * check enable button prev * @returns {boolean} */ self.isEnablePrevProductSelect = function(){ var indexItem=self.listOfProducts.indexOf(self.selectedProduct); if(indexItem>0) return true; else return false; } /** * check enable for next button * @returns {boolean} */ self.isEnableNextProductSelect = function(){ var indexItem=self.listOfProducts.indexOf(self.selectedProduct); if(indexItem<self.listOfProducts.length-1) return true; else return false; } self.handleProductChange = function(productId) { self.selectedProduct = productId; //$scope.broadcast('someEvent', productId); $rootScope.$broadcast('reloadProductInfo',productId); } /** * Handles tab change click action. * @param msg * @param $event */ self.handleTabChange = function($event) { self.tabTarget = event.target; if($rootScope.contentChangedFlag && (self.selectedTab !== event.target.id)){ var result = document.getElementById("confirmationModal"); var wrappedResult = angular.element(result); wrappedResult.modal("show"); } else{ self.toggleTab(self.tabTarget.id); } }; /** * Receives the results of the confirmation modal and acts accordingly */ $rootScope.$on('modalResults', function(event, args){ if(self.tabTarget !== null){ self.handleModalResults(args.result) } }); /** * Handles the results of the confirmation modal * @param result */ self.handleModalResults = function(result){ if(result === true){ $rootScope.contentChangedFlag = false; self.toggleTab(self.tabTarget.id); } else{ self.toggleTab(self.selectedTab); } self.tabTarget = null; }; /** * Used to execute tab toggle events. Sets the selected tab and updates the selected Tab name for Right Panel Header. * @param tabId */ self.toggleTab = function (tabId) { var tabElementSelector = '#'+tabId; $(tabElementSelector).tab('show'); self.selectedTab = tabId; }; self.confirmNextProduct = function () { self.isNextProduct = true; self.isSelectedFromList = false; if($rootScope.contentChangedFlag) { $('#confirmationNextPG').modal("show"); } else { self.nextProductSelect(); } }; self.confirmPreviousProduct = function () { self.isNextProduct = false; self.isSelectedFromList = false; if($rootScope.contentChangedFlag) { $('#confirmationNextPG').modal("show"); } else { self.prevProductSelect(); } }; self.confirmChangeProduct = function (productId) { self.isSelectedFromList = true; self.currentProductId = productId; if($rootScope.contentChangedFlag) { $('#confirmationNextPG').modal("show"); } else { self.handleProductChange(productId); } } } })();
// Write a function to hide email addresses to protect them from unauthorized users. // "somerandomaddress@example.com" -> "somerand...@example.com" function hideMail(mail){ var firstEight = ""; var restOfMail = ""; var indexOfAt; for(var i = 0; i < mail.length; i++) { if( i < 8){ firstEight = firstEight.concat(mail[i]); } if(mail[i].endsWith("@")){ indexOfAt = i; } if(indexOfAt) { restOfMail = restOfMail.concat(mail[i]); } } return firstEight + "..." + restOfMail; } console.log(hideMail("somerandomaddress@example.com"));
const Command = require('../../structures/DeprecatedCommand'); module.exports = class WebBits extends Command { get name() { return 'webbits'; } get _options() { return { aliases: ['bits'] }; } get replacedCommandName() { return 'editwebhook'; } };
import React, { FC, useContext } from "react"; import { ReactSortable } from "react-sortablejs"; import ConfigItemWrapper from './ConfigItemWrapper' import AppContext from './AppContext' import './ContentPanel.scss' const ContentPanel = props => { const app = useContext(AppContext) const {store:{list}, dispatch} = app; return ( <div className="content-panel"> <ReactSortable group={{ name: 'shared', pull: 'clone' // To clone: set pull to 'clone' }} list={list} setList={(data)=>dispatch({type:'setList', data})}> {list.map(item => { return <ConfigItemWrapper item={item} key={item.id} /> })} </ReactSortable> </div> ); } export default ContentPanel;
dojo.provide("dojox.widget.Roller"); dojo.require("dijit._Widget"); dojo.declare("dojox.widget.Roller", dijit._Widget, { // summary: A simple widget to take an unorder-list of Text and roll through them // // description: // The Roller widget takes an unordered-list of items, and converts // them to a single-area (the size of one list-item, however you so choose // to style it) and loops continually, fading between items. // // In it's current state, it requires it be created from an unordered (or ordered) // list. // // You can manipulate the `items` array at any point during the cycle with // standard array manipulation techniques. // // example: // | // create a scroller from a unorderlist with id="lister" // | var thinger = new dojox.widget.Roller.Roller({},"lister"); // // example: // | // create a scroller from a fixed array: // | new dojox.widget.Roller({ items:["one","two","three"] }); // // example: // | // add an item: // | dijit.byId("roller").items.push("I am a new Label"); // // example: // | // stop a roller from rolling: // | dijit.byId("roller").stop(); // // delay: Integer // Interval between rolls delay: 2000, // autoStart: Boolean // Toggle to control starup behavior. Call .start() manually // if set to `false` autoStart: true, /*===== // items: Array // If populated prior to instantiation, is used as the Items over the children items: [] =====*/ postCreate: function(){ // add some instance vars: if(!this["items"]){ this.items = []; } this._idx = -1; dojo.addClass(this.domNode,"dojoxRoller"); // find all the items in this list, and popuplate dojo.query("li", this.domNode).forEach(function(item){ this.items.push(item.innerHTML); dojo._destroyElement(item); }, this); // add back a default item this._roller = dojo.doc.createElement('li'); this.domNode.appendChild(this._roller); // stub out animation creation (for overloading maybe later) this.makeAnims(); // and start, if true: if(this.autoStart){ this.start(); } }, makeAnims: function(){ // summary: Animation creator function. Need to create an 'in' and 'out' // _Animation stored in _anim Object, which the rest of the widget // will reuse. var n = this.domNode; dojo.mixin(this, { _anim: { "in": dojo.fadeIn({ node:n, duration: 400 }), "out": dojo.fadeOut({ node:n, duration: 275 }) } }); this._setupConnects(); }, _setupConnects: function(){ // summary: setup the loop connection logic var anim = this._anim; this.connect(anim["out"], "onEnd", function(){ // onEnd of the `out` animation, select the next items and play `in` animation this._set(this._idx + 1); anim["in"].play(15); }); this.connect(anim["in"], "onEnd", function(){ // onEnd of the `in` animation, call `start` again after some delay: this._timeout = setTimeout(dojo.hitch(this, "_run"), this.delay); }); }, start: function(){ // summary: Starts to Roller looping if(!this.rolling){ this.rolling = true; this._run(); } }, _run: function(){ this._anim["out"].gotoPercent(0, true); }, stop: function(){ // summary: Stops the Roller from looping anymore. this.rolling = false; var m = this._anim, t = this._timeout; if(t){ clearTimeout(t); } m["in"].stop(); m["out"].stop(); }, _set: function(i){ // summary: Set the Roller to some passed index. If beyond range, go to first. var l = this.items.length - 1; if(i < 0){ i = l; } if(i > l){ i = 0; } this._roller.innerHTML = this.items[i] || "error!"; this._idx = i; } }); dojo.declare("dojox.widget.RollerSlide", dojox.widget.Roller, { // summary: An add-on to the Roller to modify animations. This produces // a slide-from-bottom like effect makeAnims: function(){ // summary: Animation creator function. Need to create an 'in' and 'out' // _Animation stored in _anim Object, which the rest of the widget // will reuse. var n = this.domNode; var pos = "position"; dojo.style(n, pos, "relative"); dojo.style(this._roller, pos, "absolute"); var props = { top: { end:0, start: 25 }, opacity:1 }; dojo.mixin(this, { _anim: { "in": dojo.animateProperty({ node: n, duration: 400, properties: props }), "out": dojo.fadeOut({ node: n, duration: 175 }) } }); // don't forget to do this in the class. override if necessary. this._setupConnects(); } });
//node + mysql后台设定 var express = require('express'); //引入express模块 var mysql = require('mysql'); //引入mysql模块 var app = express(); //创建express的实例 var cors = require('cors') var url=require('url'); const bodyParser = require('body-parser') var urlencodedParser = bodyParser.urlencoded({ extended: false }) var connection = mysql.createConnection({ //创建mysql实例 host: 'localhost', user: 'root', password: '123456', database: 'number_game', port: '3306' }); connection.connect(function (err) { if (err) { console.log('error when connecting to db:', err); setTimeout(handleError , 2000); } }); connection.on('error', function (err) { console.log('db error', err); // 如果是连接断开,自动重新连接 if (err.code === 'PROTOCOL_CONNECTION_LOST') { handleError(); } else { throw err; } }); /* var sql = 'SELECT * FROM memo'; var str = " "; connection.query(sql, function (err,result) { if(err){ console.log('[SELECT ERROR]:',err.message); } str = JSON.stringify(result); //数据库查询的数据保存在result中,但浏览器并不能直接读取result中的结果,因此需要用JSON进行解析 //console.log(result); //数据库查询结果返回到result中 console.log(str); }); */ app.use(cors({ origin:['http://localhost:8888'], methods:['GET','POST'], alloweHeaders:['Conten-Type', 'Authorization'] })); app.use(bodyParser.urlencoded({ extended: false })) app.get('/',function (req,res) { var str='' connection.query("SELECT * FROM memo",function(err,result){ if(err){ res.send("显示失败"+err); }else { str = JSON.stringify(result); console.log(str) res.send(str) } }); }); //POST 一次记录 app.post('/add', urlencodedParser, function (req, res) { var sql = 'SELECT * FROM memo'; // 输出 JSON 格式 response = { memo:req.body.time, level:req.body.level, step:req.body.step1, time:req.body.time1, }; console.log(response.memo) connection.query("insert into memo(memo,level,step,time) values('"+response.memo+"','"+ response.level+"','"+response.step+"','"+response.time +"')",function(err,rows){ if(err){ res.send("新增失败"+err); }else { res.send("新增成功") } }); var modSql = "UPDATE memo SET level = '"+response.level+"',step = '"+response.step+"',time='"+response.time+"' WHERE memo ='"+response.memo+"' ?"; var modSqlParams = ['数字华华容道', 'http://localhost:3000/add',6]; connection.query(modSql,modSqlParams,function (err, result) { if(err){ console.log('[UPDATE ERROR] - ',err.message); return; } }); return; }) app.listen(3000);
var o = require("./BaseResourcePage"), i = require("./Common_CommonUtil"), n = require("./EChannelPrefix"), a = require("./Common_Data"), s = require("./Common_ShareUtils"), c = require("./gamesdk"), r = cc._decorator, l = r.ccclass, d = r.property, m = function(o) { function t() { var t = null !== o && o.apply(this, arguments) || this; return t.icon = null, t.itemCount = null, t.desc = null, t.btnInvite = null, t.resData = null, t; } return __extends(t, o), t.prototype.start = function() { var o = this, e = this.propDataList[0]; e && e.propIcon && this.scheduleOnce(function() { return i.default.setSprite(o.icon, e.propIcon, function() { return o.icon.node.opacity = 255; }); }, .1); }, t.prototype.refresh = function(o) { this.resData = o.data[0]; var e = this.resData.host_gift_name; 1 < this.resData.host_gift_num && (e += "X" + this.resData.host_gift_num), e += " <color=#FFC107>(" + this.resData.hasReceivedCount + "/" + this.resData.host_gift_num_limit + ")</color>", this.itemCount.string = e, this.desc.string = this.pageData.desc, this.btnInvite.interactable = !!this.resData.open_status; }, t.prototype.onInvite = function() { var o = this, t = "propId=" + this.resData.id + "&shareId=" + c.game.getOpenId(); a.default.share(n.default.reward, t, null, function() { console.log("发送邀请成功!"), s.default.requestForServerRecord(o.resData.id); }); }, t.prototype.onClose = function() { this.node.destroy(); }, __decorate([d(cc.Sprite)], t.prototype, "icon", void 0), __decorate([d(cc.RichText)], t.prototype, "itemCount", void 0), __decorate([d(cc.Label)], t.prototype, "desc", void 0), __decorate([d(cc.Node)], t.prototype, "btnInvite", void 0), t = __decorate([l], t); }(o.default); exports.default = m;
/* * Copyright 2014 Jive Software * * 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. */ var chai = require('chai') , expect = chai.expect , should = chai.should(); var chaiAsPromised = require("chai-as-promised"); chai.use(chaiAsPromised); describe("JiveContentBuilder", function () { var ContentBuilder = require("github4jive/JiveContentBuilder") describe("constructor", function () { it("should accept no arguments", function () { var builder = new ContentBuilder(); }); it("should accept a valid Jive content object", function () { var builder = new ContentBuilder(); var content = builder.discussion().subject("YO").body("a").build(); builder = new ContentBuilder(content); }); }); describe("#build", function () { it("should return the object being built", function () { var builder = new ContentBuilder(); var content = builder.discussion().subject("YO").body("a").build(); content.should.have.property("type"); content.should.have.property("content"); content.content.should.have.property("type"); }); it("should throw when called without a type", function () { var builder = new ContentBuilder(); expect(function(){builder.build();}).to.throw(builder.MISSING_TYPE); }); it("should throw when called without calling body ", function () { var builder = new ContentBuilder(); expect(function () { builder.discussion().subject("YO").build(); }).to.throw(builder.MISSING_BODY); }); it("should throw without calling subject on a discussion ", function () { var builder = new ContentBuilder(); expect(function () { builder.discussion().body("a").build(); }).to.throw(builder.MISSING_SUBJECT); }); it("should not throw without calling subject on a message", function () { var builder = new ContentBuilder(); expect(function () { builder.message().body("a").build(); }).to.not.throw(builder.MISSING_SUBJECT); }); it("should accept callback to continue chaining", function () { var builder = new ContentBuilder(); var firstContent = null; builder.discussion().subject("YO").body("a").build(function (finishedContent) { firstContent = finishedContent; }).body("chaining").build().should.not.deep.equal(firstContent); }); }); describe("#reset", function () { it("should reset builder to new state", function () { var builder = new ContentBuilder(); expect(function () { builder.discussion().subject("YO").body("a").reset().build(); }).to.throw(builder.MISSING_TYPE); }) }); describe("#discussion", function () { it("should create an object with type discussion", function () { var builder = new ContentBuilder(); builder.discussion().subject("YO").body("a").build().should.have.property("type").and.equal("discussion"); }); }); describe("#subject", function () { it("should create a subject member",function(){ var builder = new ContentBuilder(); builder.discussion().body("a").subject("YO").build() .should.have.property("subject").and.equal("YO"); }); }); describe("#body", function () { it("should should set the content text field", function () { var builder = new ContentBuilder(); var b = ["a","b"]; builder.discussion().subject("YO"); b.forEach(function (body) { var content = builder.body(body).build(); content.content.text.should.equal(body); }) }); it("should not throw when body is empty", function () { var builder = new ContentBuilder(); var emptyBodies = [function () { builder.body(""); },function () { builder.body(null); },function () { builder.body(); }]; emptyBodies.forEach(function (f) { expect(f).to.not.throw(builder.EMPTY_BODY); }); }); it("should throw if body is not a string", function () { var builder = new ContentBuilder(); expect(function () { builder.body({}); }).to.throw(builder.INVALID_BODY); }) }); describe("#bodyType", function () { it("should change the content type", function () { var builder = new ContentBuilder(); builder.discussion().body("a").subject("YO").bodyType("text/plain").build() .content.type.should.equal("text/plain"); }); it("should throw if type is empty", function () { var builder = new ContentBuilder(); var invalid_types = [function () { builder.bodyType(""); }, function () { builder.bodyType(null); }, function () { builder.bodyType(); }]; invalid_types.forEach(function (f) { expect(f).to.throw(builder.INVALID_BODY_TYPE); }) }) }); describe("#parent", function () { it("should only accept Jive uris", function () { var builder = new ContentBuilder(); builder.parent("/contents/1"); builder.parent("/places/1"); builder.parent("/people/1"); var invalid_uris = ["a", "/a", "/a/1", "/places/ with whitespace" ]; invalid_uris.forEach(function (uri) { expect(function () { builder.parent(uri); }).to.throw(builder.INVALID_PARENT); }); }); }); describe("#all", function () { it("should change visibility", function () { var builder = new ContentBuilder(); builder.discussion().subject("A").body("a").all().build() .should.have.property("visibility").and.equal("all"); }); }); // describe("#people", function () { // it("should change visibility", function () { // var builder = new ContentBuilder(); // var content = builder.discussion().subject("A").body("a").people(["/people/1"]).build(); // // content.should.have.property("visibility").and.equal("people"); // content.should.have.property("users").and.contain("glen.nicol"); // }); // // it("should throw if array is not passed", function () { // var builder = new ContentBuilder(); // expect(function () { // builder.discussion().subject("A").body("a").people(); // }).to.throw(builder.MISSING_USERS); // }); // }); describe("#place", function () { it("should change visibility", function () { var builder = new ContentBuilder(); var content = builder.discussion().subject("A").body("a").place("/contents/123").build(); content.should.have.property("visibility").and.equal("place"); content.should.have.property("parent").and.contain("/contents/123"); }); it("should throw if parent place is not passed", function () { var builder = new ContentBuilder(); expect(function () { builder.discussion().subject("A").body("a").place(); }).to.throw(builder.MISSING_PARENT); }); }) });
import React, { Component } from 'react'; import './App.css'; import { ActivatedTile } from "./Components/Tile.js" class App extends Component { render() { return ( <div className="App"> <ActivatedTile depth="0"/> </div> ); } } export default App;
"use strict"; module.exports = run; function run() { require("./testAnswer.js")(); //require("/testNextThing.js")(); console.log("All tests passed"); }
////////////////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2014-2015, Egret Technology Inc. // All rights reserved. // 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 the Egret 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 EGRET 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 EGRET AND 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. // ////////////////////////////////////////////////////////////////////////////////////// var dragonBones; (function (dragonBones) { /** * @class dragonBones.TextureData * @classdesc * 纹理数据 * * @example * <pre> * //获取动画数据 * var skeletonData = RES.getRes("skeleton"); * //获取纹理集数据 * var textureData = RES.getRes("textureConfig"); * //获取纹理集图片 * var texture = RES.getRes("texture"); * * //创建一个工厂,用来创建Armature * var factory:dragonBones.EgretFactory = new dragonBones.EgretFactory(); * //把动画数据添加到工厂里 * factory.addSkeletonData(dragonBones.DataParser.parseDragonBonesData(skeletonData)); * //把纹理集数据和图片添加到工厂里 * factory.addTextureAtlas(new dragonBones.EgretTextureAtlas(texture, textureData)); * //获取Armature的名字,dragonBones4.0的数据可以包含多个骨架,这里取第一个Armature * var armatureName:string = skeletonData.armature[0].name; * //从工厂里创建出Armature * var armature:dragonBones.Armature = factory.buildArmature(armatureName); * //获取装载Armature的容器 * var armatureDisplay = armature.display; * //把它添加到舞台上 * this.addChild(armatureDisplay); * //取得这个Armature动画列表中的第一个动画的名字 * var curAnimationName = armature.animation.animationList[0]; * //播放这个动画,gotoAndPlay参数说明,具体详见Animation类 * //第一个参数 animationName {string} 指定播放动画的名称. * //第二个参数 fadeInTime {number} 动画淡入时间 (>= 0), 默认值:-1 意味着使用动画数据中的淡入时间. * //第三个参数 duration {number} 动画播放时间。默认值:-1 意味着使用动画数据中的播放时间. * //第四个参数 layTimes {number} 动画播放次数(0:循环播放, >=1:播放次数, NaN:使用动画数据中的播放时间), 默认值:NaN * armature.animation.gotoAndPlay(curAnimationName,0.3,-1,0); * * //把Armature添加到心跳时钟里 * dragonBones.WorldClock.clock.add(armature); * //心跳时钟开启 * egret.Ticker.getInstance().register(function (advancedTime) { * dragonBones.WorldClock.clock.advanceTime(advancedTime / 1000); * }, this); * </pre> */ var TextureData = (function () { /** *创建一个 TextureData 实例 * @param region 区域 * @param frame 帧的区域 * @param rotated */ function TextureData(region, frame, rotated) { this.region = region; this.frame = frame; this.rotated = rotated; } var __egretProto__ = TextureData.prototype; return TextureData; })(); dragonBones.TextureData = TextureData; TextureData.prototype.__class__ = "dragonBones.TextureData"; })(dragonBones || (dragonBones = {}));
// navbar section const menuToggle = document.querySelector(".menuToggle"); const navList = document.querySelector(".nav-list"); menuToggle.addEventListener("click", function(){ navList.classList.toggle("show-links"); })
'use strict'; let express = require('express'); let router = express.Router(); let db = require('../database/model'); router.route('/user/login') .get(function (req, res) { res.render('login', {title: '食'}) }).post(function (req, res) { let user = { username: req.body.name, password: req.body.password, isDeleted: false }; //从数据库中查询用户,若成功则跳转至主页 db.userModel.find(user, function (err, result) { if (err) return console.error(err); if (result.length === 1) { req.session.user = user; res.redirect('/home'); } else { req.session.error = '用户名或密码不正确'; res.redirect('/user/login'); } }); }); //注册用户时,检查用户名是否唯一 router.get('/user/checkUniqueUsername', function (req, res) { let username = req.query.username; db.userModel.find({ username: username}, function (err, result) { if (err) { res.send({ success: false, message: '系统异常,请稍后再试' }); return; } res.send({ usable: result.length === 0 }); }); }); //注册 router.route('/user/register').get(function (req, res) { res.render('register', {title: '食 - 新用户注册'}) }).post(function (req, res) { let user = { username: req.body.username, password: req.body.password, email: req.body.email, isDeleted: false, creatorName: req.body.username, createTime: new Date(), updaterName: req.body.username, updateTime: new Date() }; db.userModel.create(user, function (err, node, numAffected) { if (err) { res.send({ success: false, err: err }); return; } res.send({ success: true, message: '恭喜你:' + node.username + ',注册成功' }); }); }); //通过用户名搜索用户,全匹配查询(非模糊查询) router.get('/user/getUserByName', (req, res) => { let keyword = req.query.keyword; db.userModel.find({ username: keyword, isDeleted:false }, { username: 1 }, (err, result) => { if (err) { res.send({ status: 500, message: '查询报错,请稍后重试' }); return false; } res.send({ status: 200, users: result }); }); }); router.get('/user/logout', function (req, res) { req.session.user = null; res.redirect('/user/login'); }); module.exports = router;
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const path = require("path"); const fs = require("fs"); const test_config_1 = require("../config/test-config"); function default_1() { let testConfUrl = path.resolve(__dirname, '../initFile/shark-test-conf.json'); fs.exists('./shark-test-conf.json', function (exists) { if (exists) { console.log('shark-test-conf.json文件已存在'); exports.copyPolyfillAndTest(false); fs.exists('./karma.conf.js', function (exists) { if (!exists) { exports.creatFile(path.resolve(__dirname, '../initFile/karma.conf.js'), './karma.conf.js', ''); } else { console.log('karma.conf.js文件已存在'); } }); } else { exports.creatFile(testConfUrl, './shark-test-conf.json', exports.copyPolyfillAndTest); exports.creatFile(path.resolve(__dirname, '../initFile/karma.conf.js'), './karma.conf.js', ''); } }); } exports.default = default_1; exports.copyPolyfillAndTest = (isOverWrite) => { let option = test_config_1.getTestConfig(); let polyfillsUrl = path.resolve('./', option.basePath + '/polyfills.ts'); let testUrl = path.resolve('./', option.basePath + '/test.ts'); if (isOverWrite) { exports.creatFile(path.resolve(__dirname, '../initFile/polyfills.ts'), polyfillsUrl, ''); exports.creatFile(path.resolve(__dirname, '../initFile/test.ts'), testUrl, ''); } else { fs.exists(polyfillsUrl, function (exists) { if (!exists) { exports.creatFile(path.resolve(__dirname, '../initFile/polyfills.ts'), polyfillsUrl, ''); } else { console.log(polyfillsUrl + '文件已存在'); } }); fs.exists(testUrl, function (exists) { if (!exists) { exports.creatFile(path.resolve(__dirname, '../initFile/test.ts'), testUrl, ''); } else { console.log(testUrl + '文件已存在'); } }); } }; exports.creatFile = (input, output, fb) => { fs.open(output, 'w', function (e) { if (e) { throw e; } exports.fileCopy(input, output, () => { console.log(output + '创建成功'); if (fb) { fb(true); } }); }); }; exports.fileCopy = (filename1, filename2, done) => { let input = fs.createReadStream(filename1), output = fs.createWriteStream(filename2); input.on('data', function (d) { output.write(d); }); input.on('error', function (err) { throw err; }); input.on('end', function () { output.end(); if (done) { done(); } }); };
(function() { 'use strict'; angular .module('iconlabApp') .controller('SidebarController', SidebarController); SidebarController.$inject = ['$scope','$state', 'Auth','Compte','Projet','Tache', 'Principal', 'ProfileService', 'LoginService']; function SidebarController ($scope,$state, Auth, Compte, Projet, Tache, Principal, ProfileService, LoginService) { var vm = this; vm.login = login; vm.logout = logout; vm.toggleSidebar = toggleSidebar; vm.collapseSidebar = collapseSidebar; vm.$state = $state; vm.isSidebarCollapsed = true; vm.isAuthenticated = Principal.isAuthenticated; $scope.$on('authenticationSuccess', function() { loadAllCompte(); loadAllProjet(); loadAllTask(); getAccount(); }); if(vm.isAuthenticated()){ loadAllCompte(); loadAllProjet(); loadAllTask(); getAccount(); } function loadAllCompte() { vm.listeComptesTotal = []; Compte.query().$promise.then(function (data) { vm.listeComptesTotal = data; //console.log(vm.listeComptesTotal); userCompte(vm.listeComptesTotal, $scope.mail); }, function () { console.log("Erreur de recuperation des données"); }); } function loadAllProjet() { vm.listeProjetsTotal = []; Projet.query().$promise.then(function (data) { vm.listeProjetsTotal = data; userProjet(vm.listeProjetsTotal, $scope.mail); }, function () { console.log("Erreur de recuperation des données"); }); } function loadAllTask() { vm.listeTaskTotal = []; Tache.query().$promise.then(function (data) { vm.listeTaskTotal = data; userTask(vm.listeTaskTotal, $scope.mail); }, function () { console.log("Erreur de recuperation des données"); }); } function getAccount() { Principal.identity().then(function(account) { vm.account = account; vm.isAuthenticated = Principal.isAuthenticated; $scope.mail = vm.account.email; }); } function userCompte(data, email){ vm.listeComptes = []; for(var i=0; i<data.length; i++){ if(data[i].user.email===email) vm.listeComptes.push(data[i]); } } function userProjet(data, email){ vm.listeProjets = []; for(var i=0; i<data.length; i++){ if(data[i].user.email===email) vm.listeProjets.push(data[i]); } } function userTask(data, email){ vm.listeTasks = []; for(var i=0; i<data.length; i++){ if(data[i].user.email===email) vm.listeTasks.push(data[i]); } } ProfileService.getProfileInfo().then(function(response) { vm.inProduction = response.inProduction; vm.swaggerDisabled = response.swaggerDisabled; }); function login() { collapseSidebar(); LoginService.open(); } function logout() { collapseSidebar(); Auth.logout(); $state.go('home'); } function toggleSidebar() { vm.isSidebarCollapsed = !vm.isSidebarCollapsed; } function collapseSidebar() { vm.isSidebarCollapsed = true; } } // $(function() { // $(".listeProjet").click(function() { // $(".app-container").toggleClass("expanded"); // }); // return $(".navbar-right-expand-toggle").click(function() { // $(".navbar-right").toggleClass("expanded"); // }); // }); })();
const app = require('./src/app/index'); const port = 3000; process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; app.listen(process.env.PORT || port);
export const changeUserName = function(state) { return { type: "CHANGE_USER_NAME", firstName: state.firstName, secondName: state.secondName, }; } export const changeEmailAndPassword = function(state) { return { type: "CHANGE_EMAIL_AND_PASSWORD", email: state.email, password: state.password }; }
import Head from "next/head"; import { SITE_NAME, SITE_DESCRIPTION, SITE_ROOT, SITE_IMAGE, TWITTER, OWNER, } from "../../lib/constants"; export function SEO({ post, category, tag }) { const title = post ? `${post.title} | ${SITE_NAME}` : SITE_NAME; const description = post ? post.description ?? "" : SITE_DESCRIPTION; const ogpType = post ? "website" : "article"; const image = post ? post.coverImage : SITE_IMAGE; const url = SITE_ROOT + (post ? `post/${post.slug}` : category ? `categories/${category}/1` : tag ? `tags/${tag}/1` : ""); return ( <Head> <title>{title}</title> <meta name="title" content={title} /> <meta name="description" content={description} /> <meta name="theme-color" content="#7f9cf5" /> <meta property="og:locale" content="ja_JP" /> <meta property="og:type" content={ogpType} /> <meta property="og:url" content={url} /> <meta property="og:title" content={title} /> <meta property="og:description" content={description} /> <meta property="og:site_name" content={SITE_NAME} /> <meta property="og:image" content={image} /> <meta property="twitter:card" content="summary" /> <meta property="twitter:url" content={url} /> <meta property="twitter:title" content={title} /> <meta property="twitter:description" content={description} /> <meta property="twitter:image" content={image} /> <meta property="twitter:site" content={"@" + TWITTER} /> <meta property="twitter:creator" content={OWNER} /> <link href={url} rel="canonical" /> <link href="/favicon.svg" rel="icon" type="image/svg+xml" /> </Head> ); }
/* Module Dependencies */ var express = require('express'), http = require('http'), path = require('path'), mongoose = require('mongoose'), hash = require('./pass').hash; var routes = require('./routes/index'); var myFunctions = require('./controllers/functions'); var myModels = require('./models/models'); var app = express(); /* Database and Models */ mongoose.connect("mongodb://localhost/jmapp"); /* Middlewares and configurations */ app.configure(function () { app.use(express.bodyParser()); app.use(express.cookieParser('jmsystem-cookie')); app.use(express.session()); app.use(express.static(path.join(__dirname, 'public'))); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); }); app.use(function (req, res, next) { var err = req.session.error, msg = req.session.success; delete req.session.error; delete req.session.success; res.locals.message = ''; if (err) res.locals.message = '<p class="text-danger">' + err + '</p>'; if (msg) res.locals.message = '<p class="text-success">' + msg + '</p>'; next(); }); /* Routes */ app.get("/", routes.index); app.get("/signup", routes.signup); app.post("/signup", myFunctions.userExist, routes.signuppost); app.get("/login", routes.login); app.post("/login", routes.loginpost); app.get('/logout', routes.logout); app.get('/profile', myFunctions.requiredAuthentication, routes.profile); app.get('/todosJobs', myFunctions.requiredAuthentication, routes.todosJobs); app.get('/novoProjeto', myFunctions.requiredAuthentication, routes.novoProjeto); app.post('/novoProjeto', myFunctions.requiredAuthentication, routes.criaprojeto); app.get('/projeto/:id', myFunctions.requiredAuthentication, routes.projeto); app.get('/projeto/edit/:id', myFunctions.requiredAuthentication, routes.projetoedit); app.post('/projetosave', myFunctions.requiredAuthentication, routes.projetosave); app.get('/projeto/delete/:id', myFunctions.requiredAuthentication, routes.projetodelete); http.createServer(app).listen(3000);
import React, {Component} from 'react'; import CheckLogin from "../../hoc/CheckLogin"; import { Layout, Menu } from 'antd'; import { MenuUnfoldOutlined, MenuFoldOutlined, UserOutlined, VideoCameraOutlined, UploadOutlined, } from '@ant-design/icons'; import "../../assets/CSS/layout.css"; import logo from "../../assets/logo.png"; import smlogo from "../../assets/favicon.ico" import Model from "../../models/common"; import Routes from "../../router/nest"; const { Header, Sider, Content } = Layout; class Index extends Component { state = { collapsed: false, adminInfo:{last_login_addr:{}}, }; toggle = () => { this.setState({ collapsed: !this.state.collapsed, }); }; render() { return ( <Layout style={{height:"100%"}}> <Sider trigger={null} collapsible collapsed={this.state.collapsed}> <div className="logo" > {this.state.collapsed?<img src={smlogo} alt="" />:<img src={logo} alt=""/>} </div> <Menu theme="dark" mode="inline" > <Menu.Item key="1" icon={<UserOutlined />} onClick={this.changeMune}> 用户管理 </Menu.Item> <Menu.Item key="2" icon={<VideoCameraOutlined/>} onClick={this.changeMune}> 视频管理 </Menu.Item> <Menu.Item key="3" icon={<UploadOutlined/>} onClick={this.changeMune}> 上传管理 </Menu.Item> </Menu> </Sider> <Layout className="site-layout"> <Header className="site-layout-background" style={{ padding: "5 5"}}> {React.createElement(this.state.collapsed ? MenuUnfoldOutlined : MenuFoldOutlined, { className: 'trigger', onClick: this.toggle, })} <span> {" "} 欢迎您:{" "+this.state.adminInfo.username}!您上次登录于 {" " + this.state.adminInfo.last_login_addr.state + " " + this.state.adminInfo.last_login_addr.isp}( {this.state.adminInfo.last_ip}) </span> </Header> <Content className="site-layout-background" style={{ margin: '24px 16px', padding: 24, minHeight: 280, }} > <Routes></Routes> </Content> </Layout> </Layout> ); } componentDidMount() { Model.getAdminInfo().then((ret)=>{ this.setState(()=>{ return{ adminInfo:ret.data.accountInfo, } }) }) } changeMune=(obj)=>{ console.log(obj) if(obj.key==="1"){ this.props.history.push("/dashboard/users") } if(obj.key==="2"){ this.props.history.push("/dashboard/videos") } if(obj.key==="3"){ this.props.history.push("/dashboard/uploading") } } } export default CheckLogin(Index);
const mongoose = require('mongoose'); const { Schema } = require('mongoose'); const ReservaSchema = new mongoose.Schema({ //PK cod_Reservas: { type: String, unique: true, required: true }, fecha: { type: Date, required: true }, destino:{ type: String, required: true, }, kilometros :{ type: Number, required: true, }, Estado: { type: Number, default:1 }, cod_Vehiculo: { type: Schema.Types.ObjectId, ref: 'Vehiculo', required: true }, Cod_Empleado: { type: Schema.Types.ObjectId, ref: 'Empleado', required: true } }); const Reservas = mongoose.model('Reserva',ReservaSchema); ReservaSchema.method('toJSON', function() { const { __v, ...object } = this.toObject(); return object; }) module.exports = Reservas;
/** * @param {number} min * @param {number} max * @returns {number} */ export const randomLimit = (min, max) => Math.random() * (max - min) + min;
const Controller = require('../../../base/baseController'); class noteCategoryController extends Controller { /** * 数据列表 */ async index() { let body = this.ctx.query; body.page = body.page || 1; let status = await this.ctx.service.admin.blog.noteCategoryService.select(body); await this.ctx.render('/admin/blog/noteCategory/noteCategory.tpl', { status: status, params: body }); } /** * 获取发布版本记录 */ async list() { let body = this.ctx.query; body.orderBy="create_time ASC "; let status = await this.ctx.service.admin.blog.noteCategoryService.list(body); this.ctx.body = status; } /** * 进入新增 */ async new() { await this.ctx.render('/admin/blog/noteCategory/noteCategoryNew.tpl'); } /** * 新增数据 */ async add() { const body = this.ctx.request.body; const rule = { title: { type: 'string' } }; let status = await this.validateExecute(rule, body, async () => { return await this.ctx.service.admin.blog.noteCategoryService.save(body); }); await this.ctx.render('/admin/blog/noteCategory/noteCategoryNew.tpl', { status: status }); } /** * 进入编辑 */ async edit() { const status = await this.ctx.service.admin.blog.noteCategoryService.get(this.ctx.query.id); await this.ctx.render('/admin/blog/noteCategory/noteCategoryNew.tpl', { status: status }); } /** * 修改数据 */ async update() { let body = this.ctx.request.body; const rule = { title: { type: 'string' } }; let status = await this.validateExecute(rule, body, async (status) => { let statusUp = await this.ctx.service.admin.blog.noteCategoryService.update(body); statusUp.data = status.data; return statusUp; }); await this.ctx.render('/admin/blog/noteCategory/noteCategoryNew.tpl', { status: status }); } /** * 删除数据 */ async destroy() { let body = this.ctx.query; let status = await this.ctx.service.admin.blog.noteCategoryService.destroy(body); const listSt = await this.ctx.service.admin.blog.noteCategoryService.select({ page: 1 }); status.data = listSt.data; await this.ctx.render('/admin/blog/noteCategory/noteCategory.tpl', { status: status }); } /** * 发布笔记 */ async publish(){ let body = this.ctx.query; let status = await this.ctx.service.admin.blog.noteCategoryService.publish(body); const listSt = await this.ctx.service.admin.blog.noteCategoryService.select({ page: 1 }); status.data = listSt.data; await this.ctx.render('/admin/blog/noteCategory/noteCategory.tpl', { status: status }); } /** * 撤销笔记 */ async repeal(){ let body = this.ctx.query; let status = await this.ctx.service.admin.blog.noteCategoryService.repeal(body); const listSt = await this.ctx.service.admin.blog.noteCategoryService.select({ page: 1 }); status.data = listSt.data; await this.ctx.render('/admin/blog/noteCategory/noteCategory.tpl', { status: status }); } } module.exports = noteCategoryController;
import { useState } from "react"; const useForm = initialState => { const [values, setValues] = useState(initialState); const [errors, setErrors] = useState({}); const validateForm = values => { let errors = []; for (let [key, value] of Object.entries(values)) { if (key === "email" && !value) { errors.email = "Please enter an email address."; } else if ( key === "email" && !/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i.test(value) ) { errors.email = "Please enter a valid email address."; } if (key === "username" && !value) { errors.username = "Please enter a username."; } else if (key === "username" && value.length < 4) { errors.username = "Username must be at least 4 characters."; } if (key === "password" && !value) { errors.password = "Please enter a password."; } else if (key === "password" && value.length < 6) { errors.password = "Password must be at least 6 characters."; } } return errors; }; const handleChange = event => { setValues({ ...values, [event.target.name]: event.target.value }); }; const handleSubmit = event => { event.preventDefault(); const errors = validateForm(values); setErrors({ ...errors }); }; return [values, errors, handleChange, handleSubmit]; }; export { useForm };
$(document).ready(function () { new WOW().init(); // button switch dark $(".wrp-switchicon").click(function(){ $(this).toggleClass("dark"); $("body").toggleClass("dark") }); // data tables let example = $('#example').DataTable({ paging: false, searching: false, "info": false, columnDefs: [{ orderable: false, className: 'select-checkbox', targets: 0 }], select: { style: 'os', selector: 'td:first-child' }, order: [ [1, 'asc'] ] }); example.on("click", "th.select-checkbox", function() { if ($("th.select-checkbox").hasClass("selected")) { example.rows().deselect(); $("th.select-checkbox").removeClass("selected"); } else { example.rows().select(); $("th.select-checkbox").addClass("selected"); } }).on("select deselect", function() { ("Some selection or deselection going on") if (example.rows({ selected: true }).count() !== example.rows().count()) { $("th.select-checkbox").removeClass("selected"); } else { $("th.select-checkbox").addClass("selected"); } }); //List Data Tabel $('#table-bordered').DataTable( { "scrollX": true, "autoWidth": false, searching: false, info: false, "pageLength": 5 // "sDom": '<"top"ip>rt<"bottom"fl><"clear">' } ); //List Data Tabel $('#table-full').DataTable( { "scrollX": true, "autoWidth": false, searching: false, info: false, "pageLength": 5, "sDom": '<"top"ip>rt<"bottom"fl><"clear">' } ); //List Data Tabel $('#table-condensed').DataTable( { "scrollX": true, "autoWidth": false, searching: false, info: false, "pageLength": 5, "sDom": '<"top"ip>rt<"bottom"fl><"clear">' } ); //List Data Tabel $('#table-striped').DataTable( { "scrollX": true, "autoWidth": false, searching: false, info: false, "pageLength": 5, // "sDom": '<"top"ip>rt<"bottom"fl><"clear">' } ); // table 2 let myTable = $('#example2').DataTable({ columnDefs: [{ orderable: false, className: 'select-checkbox', targets: 0, }], select: { style: 'os', // 'single', 'multi', 'os', 'multi+shift' selector: 'td:first-child', }, "ordering": false }); $('#MyTableCheckAllButton').click(function() { alert(",m") if (myTable.rows({ selected: true }).count() > 0) { myTable.rows().deselect(); return; } myTable.rows().select(); }); myTable.on('select deselect', function(e, dt, type, indexes) { if (type === 'row') { // We may use dt instead of myTable to have the freshest data. if (dt.rows().count() === dt.rows({ selected: true }).count()) { // Deselect all items button. $('#MyTableCheckAllButton i').attr('class', 'far fa-check-square'); return; } if (dt.rows({ selected: true }).count() === 0) { // Select all items button. $('#MyTableCheckAllButton i').attr('class', 'far fa-square'); return; } // Deselect some items button. $('#MyTableCheckAllButton i').attr('class', 'far fa-minus-square'); } }); $('.custom-upload input[type=file]').change(function(){ $(this).next().find('input').val($(this).val()); }); $(".nav").click(function(){ $(".wrp-sidebar").toggleClass("small"); $(".page-wrapper").toggleClass("big"); }) $(".header-mobile .nav").click(function(){ $(".wrp-sidebar").toggleClass("active"); }) });
import "../../../js/index"; import PartitialAjax from "django-partitialajax"; import {createPartitialFromElement} from "django-partitialajax/js/bindings"; import $ from "jquery"; import {getCookie} from "../../../../../partitialajax/src/js/contrib"; $(function () { PartitialAjax.initialize(); let form_device_field = PartitialAjax.getPartitialFromElement(document.getElementById("publickey-create-device-field")); registerLazyPartitialButton(form_device_field, ".userarea-device-create-button"); form_device_field.register("onHandeldRemoteData", function(info){ registerLazyPartitialButton(info.partitial_ajax, ".userarea-device-create-button"); }); let form_key_group_field = PartitialAjax.getPartitialFromElement(document.getElementById("publickey-create-key-group-field")); registerLazyPartitialButton(form_key_group_field, ".userarea-key-group-create-button"); form_key_group_field.register("onHandeldRemoteData", function(info){ registerLazyPartitialButton(info.partitial_ajax, ".userarea-key-group-create-button"); }); /** * Method that handles Delete * @param partitial */ function registerLazyPartitialButton(partitial, classname){ // Find delete Button let device_field_inner_create_button = $(partitial.options.element).find(classname).get( 0 ); // Reregister Create Button Partitial createPartitialFromElement(device_field_inner_create_button); // find previous created partitial let device_field_inner_create_partitial = PartitialAjax.getPartitialFromElement(device_field_inner_create_button); // Register Events to create button partitial device_field_inner_create_partitial.register("onHandeldRemoteData", function(info){ $(info.partitial_ajax.options.element).find("button").on("click", function(evt){ evt.preventDefault(); $.ajax({ type: 'POST', url: $(info.partitial_ajax.options.element).find("form").attr("action"), data: $(info.partitial_ajax.options.element).find("form").serialize(), header: { "X-CSRFToken": getCookie("csrftoken") }, success: function(response) { //device_field_inner_create_partitial.delete(); partitial.getFromRemote(); $(info.partitial_ajax.options.element).modal('hide').find(".modal-content").html(""); }, error: function(){ $.toast({ title: gettext("Internal Server Error"), content: gettext("This request could be satisfied"), type: 'danger', delay: 3000, }); } }); }); }); } });
export { default as buildComponentsTree } from './buildComponentsTree'; export { default as renderComponentsTree } from './renderComponentsTree'; export { default as createSlots } from './createSlots'; export { default as translate } from './translate';
Date.prototype.format = function(fmt) { var o = { "M+" : this.getMonth() + 1, //月份 "d+" : this.getDate(), //日 "h+" : this.getHours(), //小时 "m+" : this.getMinutes(), //分 "s+" : this.getSeconds(), //秒 "q+" : Math.floor((this.getMonth() + 3) / 3), //季度 "S" : this.getMilliseconds() //毫秒 }; if (/(y+)/.test(fmt)) { fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "") .substr(4 - RegExp.$1.length)); } for ( var k in o) { if (new RegExp("(" + k + ")").test(fmt)) { fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]) .substr(("" + o[k]).length))); } } return fmt; } //获取七天前的日期 function beforeSevenData(myDate){ //设置日期,当前日期的前七天 myDate.setDate(myDate.getDate() - 7); var dateArray = []; var dateTemp; var flag = 1; for (var i = 0; i < 7; i++) {     dateTemp = (myDate.getMonth()+1)+"-"+myDate.getDate();     dateArray.push(dateTemp);     myDate.setDate(myDate.getDate() + flag); } return dateArray; }
const config = { servers: { default: { baseURL: 'http://ebay-admin-logistics.xbniao.com/api' }, messageCenter: { baseURL: 'http://message.xbniao.com' }, userCenter: { baseURL: 'http://uc.xbniao.com' }, adminCenter: { baseURL: 'http://ucadmin.xbniao.com/api/' }, captcha: { baseURL: 'http://message.xbniao.com' }, verifyCode: { url: 'http://message.xbniao.com/captcha/get' }, pay: {//支付系统 baseURL: 'http://pay.xbniao.com/api' }, account: { baseURL: 'http://logistics.xbniao.com/api' }, //统计中心 statistics: { baseURL: 'http://statistics.xbniao.com' }, //图片上传 imageUpload:{ baseURL: 'http://image.xbniao.com/file/app/image.upload' }, //图片上传 image: { baseURL: 'http://image.xbniao.com' } } }; export default config;
// var heure = prompt("Veuillez donner une heure"); // var mondiv = document.querySelector(".heure"); // mondiv.innerHTML = "L'heure est : "+heure; // var para2 = document.querySelector("#paragraphe2") // para2.style.fontSize = "34px" var p1 = document.getElementById('paragraphe1'); var p2 = document.getElementById('paragraphe2'); function changerCouleur(){ p1.classList.toggle('blue') p2.classList.toggle('rouge') p2.classList.toggle('blue') p1.classList.toggle('rouge') } //window.setInterval(changerCouleur, 3000);