text stringlengths 7 3.69M |
|---|
import "./styles.css";
const onClickAdd = () => {
//taskの取得とinputの初期化
const inputText = document.getElementById("add-text").value;
//入力確認
if (!inputText) {
alert("TODOを入力してください");
} else {
document.getElementById("add-text").value = "";
// incomplete-listにtaskを追加
createIncompleteList(inputTex... |
const input = require("fs").readFileSync("/dev/stdin", "utf8")
let cin = input.split(/ |\n/), cid = 0
const next = () => cin[cid++]
const nexts = (n) => cin.slice(cid, cid+=n).map(i=>parseInt(i))
const [X, Y] = nexts(2)
t = (Y - 2 * X) / 2
c = X - t
if (t >= 0 && c >= 0 && t + c == X && 4*t + 2*c == Y && Number.isInte... |
var tracer = {
name: "Tracer",
attack: 35,
counter: 5,
health: 180
};
var winston = {
name: "Winston",
attack: 10,
counter: 8,
health: 400
};
var reinhardt = {
name: "Reinhardt",
attack: 40,
counter: 15,
health: 300
};
var mei = {
name: "Mei",
attack: 25,
... |
module.exports = function (creep) {
var freeRepairer = true
if (creep.energy == 0) {
var nearestSpawn = creep.pos.findNearest(Game.MY_SPAWNS,{
filter: function (spawn) {
return spawn.energy > 0;
}
});
if(nearestSpawn){
creep.moveTo(near... |
const path = require('path')
const autoprefixer = require('autoprefixer')
const webpackMarge = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const UglifyJsPlugin = require('webpack/lib/optimize/UglifyJsPlugin')
const ExtractTextPlugin = require('extract-text-webpack-plugin')
const C... |
import React from 'react';
import QaAction from '../qa-action';
export default class QaInput extends QaAction {
action() {
this._update(this._closeQa(this.props.apply));
}
render() {
return (<div
className={'action' +
(this.props.disabled ? ' disabled' : '') +
(this.props.classNam... |
var res = {
HelloWorld_png : "res/HelloWorld.png",
tile_0 : "res/tile_0.png",
tile_1: "res/tile_1.png",
tile_2: "res/tile_2.png",
tile_3: "res/tile_3.png",
tile_4: "res/tile_4.png",
tile_5: "res/tile_5.png",
tile_6: "res/tile_6.png",
tile_7: "res/tile_7.png",
target_png: "res/tar... |
import React from 'react'
import useForm from '../../hooks/useInputValue.jsx'
import { Form, Input, Title, Error } from './styles'
import { SubmitButton } from '../SubmitButton/index.jsx'
export const UserForm = ({ error, disabled, onSubmit, title }) => {
const { form, handleInput } = useForm({
email: '',
pa... |
var StackMembershipView = ControllerView.extend({
/** @class StackMembershipView
* @author drscannell
* @augments ControllerView
* @constructs StackMembershipView object */
tagName: 'option',
className: 'stack',
initialize: function(options) {
this.listenTo(this.model, 'change', this.handleModelChange);
}... |
// function getDictionary() {
// return {
// }
// }
const SET_SUMMARY = 'SET_SUMMARY';
const SET_USER_NAME = 'SET_FIRST_NAME';
console.log(2); |
import ApiService from '@/services/api.service'
import { API_URL } from '@/services/api.configs'
const RestaurantService = {
query () {
return ApiService.get(API_URL + '/restaurants')
},
get (id) {
return ApiService.get(API_URL + '/restaurants/' + id)
}
}
export default RestaurantService
|
import jwt from 'jsonwebtoken'
import config from '../config/main'
export function isAuthenticated () {
const token = window.localStorage.getItem('token-ea')
if (token === null) {
return false
}
try {
jwt.verify(token, config.secret)
return true
} catch (err) {
window.localStorage.removeIte... |
import React from "react";
import { Link } from "react-router-dom";
import { Menu } from "antd";
export default class TopMenu extends React.Component {
render() {
return <div>
<Menu theme="dark" mode="horizontal" defaultSelectedKeys={["1"]} style={{ lineHeight: "64px" }}>
<Menu.Item key... |
function findUniqueElements(arr) {
let xxory = 0;
//find the all element xor
for (let index = 0; index < arr.length; index++) {
xxory = xxory ^ arr[index]; // 5^4^1^3^4^2^5^1 -> 3^1-> 01
}
//getting RSB set via masking // 01 = 01 & 11
let rsbs = xxory & -xxory;
let x = 0; // set bit part
let y = 0;... |
const arrUsers = ['Happy User', 'Mary', 'Dima', 'Zhenya Zh.', 'Vika L', 'Nina Art', 'Nika I', 'Vs Ko', 'Ivan ', 'Marta', 'Zhenya H.', 'Sasha', 'Pasha', 'Ira', 'Vero', 'Dima'];
const arrActiveUsers = ['Happy User', 'Dima', 'Zhenya Zh.', 'Sasha', 'Pasha', 'Ira', 'Vero'];
const arr = [
{
id: '1',
text: 'Привет!'... |
const Main = (input) => {
tmp = input.split(' ')
const N = tmp[0]
const Y = parseInt(tmp[1])
return calculate(N,Y)
}
const calculate = (n, y) => {
for (i = 0; i <= n; i++) {
remain = n - i
for (j = 0; j <= remain; j++) {
k = remain - j
if (1e3 * (10 * i + 5 *... |
/*/////////////////////////////////////////////////////////////////////////////
/// @summary Implements the entry point of a real-time JavaScript application.
/// @author Russell Klenk (russ@ninjabirdstudios.com)
///////////////////////////////////////////////////////////////////////////80*/
/// An object storing the g... |
export default class AudioHandler {
/**
* This class is responsible for preloading sound clips, and playing them as requested.
* @class AudioHandler
* @author Martiens Kropff
* @returns {void}
*/
constructor() {
/**
* A list of audio files.
* @author ... |
import styled from "styled-components";
export const ImageContainer = styled.div`
@media (max-width: ${({ theme }) => theme.md}) {
display: none;
}
`;
|
exports.addKeyListeners = function(keyPressed) {
Object.assign(keyPressed, {left: 0, right: 0, up: 0, down: 0});
const keyCodeMapping = {
38: "up",
37: "left",
40: "down",
39: "right"
}
function onKey(event) {
const keyName = keyCodeMapping[event.keyCode];
... |
import Header from './Header';
import Footer from './Footer';
import Theme from './Theme';
import PhotoCard from './PhotoCard';
const common = {
Header,
Footer,
Theme,
PhotoCard,
};
export default common;
|
const { MongoClient } = require('mongodb');
const { MONGODB_URL } = require('../config');
const dbs = {};
const getConnection = (dbName, cb) => {
const mongodbConnectionUrl = `${MONGODB_URL}/${dbName}`;
if (dbs[mongodbConnectionUrl]) {
cb(null, dbs[mongodbConnectionUrl]);
} else {
MongoClient.connect(mo... |
import React, {Component} from 'react';
import {
Text,
View
} from 'react-native';
import EditItem from '../components/EditItem';
import styles from '../styles/Edit';
import common from '../styles/Common';
import lang from '../lang';
export default class EditScren extends Component {
static navs = {
... |
import styled from "styled-components"
export const NavContainer = styled.div`
ul {
display: flex;
list-style-type: none;
flex-direction: row;
margin: 0;
padding: 0;
li {
margin-right: 10px;
}
a {
&:hover {
border-bottom: 3px solid #c2392a;
}
}
.act... |
var PunchDetailsTable;
$(document).ready(function () {
navigateTo(ATTENDANCE);
PunchDetailsTable = $('#punchTable').DataTable({
"pageLength": 7, "bFilter": true, "bInfo": true,
"bLengthChange": false, "ordering": true,
"searching": false, responsive: true
});
});
$('#lblNoResults').show();
$('#ResultTable... |
var temp = require('./user');
module.exports = temp; |
function ShowDatePopup(event) {
// alert(111);
// получить объект событие.
// В браузерах, работающих по рекомендациям W3C, объект события всегда передается в обработчик первым параметром.
// В IE существует глобальный объект window.event, который хранит в себе информацию о последнем событии.
// А первого ар... |
/**
* Created by WangChong on 16/3/4.
*/
var MyDebug;
(function (MyDebug) {
MyDebug.text = "";
var count = 1;
/**
* 设置密道
*/
function GetPoint(_x, _y) {
console.warn(_x + " " + _y);
if (count > 6) {
return;
}
switch (count) {
case 1:
... |
import React from 'react';
const Spinner = () => (
<svg
width="16px"
height="16px"
viewBox="30 30 40 40"
preserveAspectRatio="xMidYMid"
style={{
background: 'none',
}}
>
<g transform="rotate(0 50 50)">
<rect
x="48"
y="30"
rx="3.84"
ry="2.4"
... |
import React from 'react'
import FeedbackImg from 'assets/img/Feedback.png'
import { Link } from 'react-router-dom'
import { useInitScrollTop } from 'utils/customHooks';
const Feedback = () => {
useInitScrollTop();
return (
<div className='contactus-feedback'>
<div>
<img src... |
// Returns a function that then calculates whether a given trip is within range.
// For example, produceDrivingRange(10) returns a function that will return false
// if the trip is over 10 blocks distance and true if the distance is within range.
// So produceDrivingRange returns a function that we can then use to calc... |
const mongoose = require("mongoose");
const Schema = mongoose.Schema;
const QuizzesSchema = new Schema(
{
quiz_title: { type: String },
quiz_desc: { type: String },
quiz_code: { type: String },
quiz_current: { type: Number, default: 0 },
quiz_questions: [{ type: Schema.Types.ObjectId, ref: "Quest... |
async function count() {
await setTimeout(()=>{console.log("finish")}, 2000);
console.log("first");
}
function Name() {
count();
console.log("second");
}
Name();
function Like(){
for(var i=0; i<5; i++) {
console.log(i)
}
console.log(i)
}
Like();
|
const uniqueSlug = require("unique-slug");
const fs = require("fs");
const sharp = require("sharp");
const uploadURI = process.env.UPLOADS_DIR;
// Saves the image and returns the filename that will be saved to db
const saveImage = async (image) => {
// Original image
let fname = uniqueSlug() + ".png";
const path... |
import store from "../store";
import urlUtils from "./urlUtils";
import Client from "../js/sdk/client";
export default {
getAll() {
return store.state.cache.cache.businessUserMap;
},
getOneByImUid(imUid) {
let id = parseInt(imUid);
if (this.getAll().has(id)) {
return this.getAll().get(id);
... |
import React, { Component } from 'react';
import './App.css';
import Animal from './Animal'
class App extends Component {
state = {
animals: [
{name: 'panda', color:'white'},
{name: 'tiger', color:'yellow'},
{name:'bat', color:'black'},
{name:'possum', color:'brown'},
{name:'c... |
import styled from 'styled-components';
export const Container = styled.div`
width:100%;
height:100%;
display:flex;
flex-direction:column;
justify-content:flex-end;
`;
export const MapDiv = styled.div`
width:100%;
height:80%;
background-color:#fff;
`; |
'use strict';
var app = app;
app.factory('Auth', function Auth ($location, $rootScope, Session, $cookieStore, $http, $q) {
// $rootScope.currentUser = $cookieStore.get('user') || null;
//$cookieStore.remove('user');
return {
login: function(user, callback) {
console.log("Nemam Amma Bhagavan ... |
/*
* @description: JS Controller of CalculateCertificationComp
* @author: MadsPascua(Xero)
* @history:
* 21May2018 MadsPascua(Xero): Initial version
*/
({
calculateCertification: function(component, event, helper) {
var recordId = component.get("v.recordId");
//console.log("recordId: " + recordId);
helper.calcu... |
import {isConnected} from "./ethNode";
async function checkNodeConnection(req, res, next){
const connected = await isConnected();
if(!connected){
res.status(500);
res.json({
"message": "Unable to connect to ethereum node"
});
return;
}
console.log("Node conn... |
class Area {
componentDidMount() {
var node = React.findDOMNode(this)
var cards = Draggable.create('.card-wrapper', {
bounds: '#table',
zIndexBoost: false,
})
cards.map( c => c.disable())
Draggable.create(node, {
trigger: node,
bounds: '#table',
onPress: (event) => {... |
import {
getOne,
getAll,
elShow,
elRemove,
elHide,
ajaxGet,
maskingName,
createElementFunc,
addClass,
hasClass,
removeClass
} from './util';
import { tweenEvent } from './tweenEvent';
class ListData {
constructor() {
this.setVars();
this.init();
}
setVars() {
this.list = getOne('.list');
this.li... |
;(function(){
//扫描二维码变大;
$(".sao").hover(function(){
$(".wx").css("transform","scale(2)");
},function(){
$(".wx").css("transform","scale(1)");
})
//当前时间
var nowtime=new Date();
var nowyear=nowtime.getFullYear();
$(".nowtime").html(nowyear);
//初始化class名
$('.class_list').each(function(){
$(this).find('... |
import axios from "axios";
export const startGame = () =>
axios.get("/api/random", { Accept: "application/json" });
export const sendGuess = (body) =>
axios.post("/api/guess", body, {
"Content-Type": "application/json",
Accept: "application/json",
});
export const sendGiveUp = (body) =>
axios.post("/... |
export default {
update (el, binding) {
console.log(binding)
document.title = binding.value
}
}
9 |
(function(app) {
var m = app.add_module("code");
m.elements({
gists: $('#gists')
});
m.actions = function() {
script.defaults.defer = true;
script.defaults.base = 'http://gist.github.com';
get_all_gists();
};
m.handle_all_gists = function(gists) {
m.set... |
/*
* @Descripttion: api接口调用统一出口
* @Author: 王月
* @Date: 2020-09-16 13:43:40
* @LastEditors: 王月
* @LastEditTime: 2020-09-16 13:48:33
*/
export * from './demo'; |
var express = require("express");
var app = express();
var bodyParser = require("body-parser");
var { read } = require('./helper/');
const port = 3003;
app.use(function (req, res, next) {
res.setHeader("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Methods", "GET, POST, OPTIONS, PUT, P... |
webpackJsonp([77], {
238: function(r, n, a) {
(function(n) {
r.exports = n["MessageFormat"] = a(239);
}).call(n, a(7));
},
239: function(r, n, a) {
var e;
var e;
(function(n) {
if (true) r.exports = n();
else if ("function" === typeof define && define.amd) define([], n);
... |
import React, { Component } from 'react'
import { deleteSupervisor, deleteUser, getUserForRole } from '../services/ApiService'
import { Link as RouterLink,withRouter, Redirect } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import List from '@material-ui/core/List';
import ListItem fr... |
import configureContainer from '../../container';
function makeDeliveryLambdaExtendJobLock({
extendJobLockByJobKey,
getLogger,
}) {
return async function delivery(input) {
const logger = getLogger();
logger.addContext('input', input);
logger.debug('start');
const {
jobStatic: {
key... |
import bookshelf from '../config/bookshelf';
import Hospital from './hospital.model';
import Order from './order.model';
/**
* Order Status model.
*/
class OrderStatus extends bookshelf.Model {
get tableName() {
return 'order_status';
}
get hasTimestamps() {
return true;
}
... |
const stream = require("stream");
function MyReadable(){
}
MyReadable.prototype = stream.Readable();
var myRead = new MyReadable();
myRead.push("abcdefghijklmnopqrstuvwxyz");
myRead.push(null);
myRead.pipe(process.stdout);
|
/* global module require __dirname */
const path = require('path');
const fs = require('fs');
const express = require('express');
const bodyParser = require('body-parser');
const Handlebars = require('handlebars');
const { validate } = require('./config-validator');
const { init, handleRoute } = require('./router/se... |
import React from 'react';
import Rating from './Rating';
const DriverCard = ({name,rating,img,car})=>{
const image = {backgroundImage:`url(${img})`}
return(
<div className="DriveCard-container">
<div className="DriveCard-content">
<div className="DriveCard-img" style={imag... |
X.define("modules.system.systemlogList",["model.systemLogModel","common.layer","modules.common.routerHelper"],function (systemLogModel,layer,routerHelper) {
//初始化视图对象
var view = X.view.newOne({
el: $(".xbn-content"),
url: X.config.systemLog.tpl.systemlogList
});
//初始化控制器
var ctrl =... |
const browserWaits = require('../../../support/customWaits')
class CaseDetailsBasicView{
constructor(){
this.container = $('ccd-case-basic-access-view')
this.bannerMessageContainer = $('ccd-case-basic-access-view .hmcts-banner__message')
this.requestAccessButton = $('ccd-case-basic-access... |
'use strict';
// Declare app level module which depends on views, and components
var project_X = angular.module('project_X', [
'ui.router',
'project_X.prediction',
'project_X.graphs',
'project_X.training'
]).
config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) {... |
import React from 'react'
import {connect} from 'react-redux'
import * as actions from '../action/ItemActions'
import Item from '../components/Item'
export default connect((state, props) => ({
_id : props.todo.get('_id'),
text : props.todo.get('text'),
active : props.todo.get('activ... |
/**
* some JavaScript code for this blog theme
*/
/* jshint asi:true */
/////////////////////////header////////////////////////////
/**
* clickMenu
*/
(function () {
if (window.innerWidth <= 770) {
var menuBtn = document.querySelector('#headerMenu')
var nav = document.querySelector('#headerNav'... |
import React from 'react'
import { View, Alert } from 'react-native'
import { LoginButton, AccessToken } from 'react-native-fbsdk'
import { connect } from 'react-redux'
import firebase from 'firebase'
import { loginFacebookUser } from '../actions'
const onLoginFinished = (err, result) => {
if (err) {
Alert.alert... |
import {DefaultLogger as winston} from '@dracul/logger-backend';
import RoleModel from '../models/RoleModel'
import {UserInputError} from 'apollo-server-express'
export const fetchRolesInName = function (roleNames) {
return new Promise((resolve, reject) => {
RoleModel.find({name: {$in: roleNames }}).exec(... |
import React from "react";
import {
View,
StyleSheet,
ScrollView,
Dimensions,
Text,
SafeAreaView
} from "react-native";
import LinearGradient from "react-native-linear-gradient";
import Header from "../components/Header";
import Tabs from "../components/Tabs";
import ItemCard from "../components/ItemCard"... |
import { createAppContainer, createSwitchNavigator } from "react-navigation";
import {
creatStackNavigator,
createStackNavigator
} from "react-navigation-stack";
import LoginScreen from "./screen/LoginScreen";
import LoadingScreen from "./screen/LoadingScreen";
//import RegisterScreen from "./screens/RegisterScre... |
window.onload = function() {
var box = document.getElementsByClassName('sliderImg')[0];
var imgs = box.getElementsByTagName('img');
//获取单张img宽度
var imgWidth = imgs[0].offsetWidth;
var exposeWidth = imgWidth * 0.6;
//console.log(imgWidth);
//设置box总宽度
boxWidth = imgWidth + (imgs.length -1) * exposeWidth;
... |
app.controller('brandController',function ($scope,$controller,brandService) {
$controller('baseController',{$scope:$scope});//继承
$scope.findAll=function () {
brandService.findAll().success(
function (response) {
$scope.list = response;
});
};
// //重新加载列表 数据
... |
var Dinosaur = function(type, numberOffspringYearly) {
this.type = type;
this.offspringPerYear = numberOffspringYearly;
}
module.exports = Dinosaur; |
import { useEffect, useContext } from "react";
import { useHistory } from "react-router-dom";
import { Row, Col, Spin } from "antd";
import { LoadingOutlined } from '@ant-design/icons';
import { requestOrderDetail } from "../actions"
import { StoreContext } from "../store";
export default function OrderCard({ orderId... |
import { parse } from 'css';
import { convert, sanitizeSelector } from './lib/transformer';
import {
getErrorMessages,
getWarnMessages,
resetMessage
} from './lib/promptMessage';
import { debugMini, debugObj } from './lib/debug';
import { requiredParam } from './lib/roro';
// import transformer from './lib/transform... |
import '../../styles/EditProfile.css';
import React, { useState } from 'react';
import { updateUserPhoto } from '../../actions/users';
import { updateUser } from '../../actions/users';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import useFormState from '../hooks/useFormState';
const Edi... |
/**
* LINKURIOUS CONFIDENTIAL
* Copyright Linkurious SAS 2012 - 2018
*
* - Created on 2014-11-25.
*/
'use strict';
const ErrorType = {
/**
* A forbidden action (for business reasons)
* e.g.:
* - user A hasn't right to do action B
*/
ACCESS: 'ACCESS',
/**
* An invalid action (for business rea... |
import { combineReducers } from "redux";
import { reducer as ui } from "./ui/reducer";
import { reducer as properties } from "./properties/reducer";
import { reducer as map } from "./map/reducer";
export default combineReducers({
ui,
properties,
map
}); |
$('#injectJquery').click(function (e) {
e.preventDefault();
chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => {
chrome.tabs.executeScript(null, {file: 'jquery.js'}, function(result){
chrome.tabs.executeScript(null,
{
code: `
... |
module.exports = {
name: 'textBox',
create: 'each',
dependencies: [],
extending: 'widget'
}; |
"use strict";
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enu... |
const express = require('express'); //express开发web接口
const fs = require('fs');
const bodyPaeser = require('body-parser'); // 引入body-parser post请求要借助body-parser模块
const cookieParser = require('cookie-parser'); //引入模块
const userRouter = require('./user');
const path = require('path');
const multer = require('multer'); //... |
const respondSuccess = (res, statusCode, data) => {
res.status(statusCode).json(data);
};
const respondErr = (res, errStatusCode, err) => {
res.status(errStatusCode).json({ errors: err });
};
const handlerError = (err, req, res, next) => {
const message = err.message
res.status(err.statusCode).json({ errors: mess... |
/**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import { Container, Title, Content, Button, Left, Right, Body, Icon, Text } from 'native-base';
import Header from './Layout/Header';
import Footer from './Layout/Footer';
import { appStyl... |
import React, { useEffect, useState } from 'react';
import HeaderNav from '@/components/Layout/header';
import ContentBox from '@/components/Layout/content_box';
import { format } from 'date-fns';
import GraphCard from '@/components/Collocation/AddMonitor/Overview/graph_card';
import {
useGetCollocationStatisticsQuer... |
/****************************************************
* Copyright © Legwork Studio. All Rights Reserved. *
* Updated by: Matt Wiggins and Jos, 13-Jun-2011 *
* *
* Hidden, magical things are at the top. *
*************************************************... |
import HttpStatus from 'http-status-codes';
import KoreanMedicine from '../models/korean_medicine.model';
import formidable from 'formidable';
import fs from 'fs';
import date from 'date-and-time';
/**
* Add New Korean Medicine
*
* @pa... |
(function() {
'use strict';
angular.module('app.controllers')
.controller('NotesCtrl',
function($scope,
session,
$stateParams,
notes,
$rootScope) {
/**
* Init function
* @return... |
class Enemy {
constructor(playerLevel) {
this.level = playerLevel;
this.type = enemyList[Math.floor(Math.random() * enemyList.length)];
this.maxPossibleHealth = enemyStartingMaxHealth + 3.5 * (this.level - 1);
this.maxHealth = Math.ceil(Math.random() * this.maxPossibleHealth);
... |
#!/usr/bin/env node
/* begin copyright text
*
* Copyright © 2016 PTC Inc., Its Subsidiary Companies, and /or its Partners. All Rights Reserved.
*
* end copyright text
*/
/* jshint esversion: 6 */
'use strict';
var startAt = process.hrtime();
/**
* Process event handlers
*/
process.on('SIGINT', function() {
c... |
console.log('component has loaded');
window.onload = function() {
console.log('all files that this page needs have been loaded');
var clickPicture = {
imgElement: null,
initialize: function(domSelector) {
console.log('initializing component');
this.imgElement = document.createElement('img'); //<... |
export default {
items: [
{
name: 'Product',
url: '/products',
icon: 'icon-drop',
},
{
name: 'Image',
url: '/theme/typography',
icon: 'icon-pencil',
}
],
};
|
class GraficoPiramide {
constructor(element_id, data) {
this.element_id = element_id;
this.data = data;
this.width = 500;
this.height = 250;
this.margin = {top: 20, right: 10, bottom: 20, left: 10, middle: 20};
this.axis_font_size = '0.7em';
this.leftBarColor = "#2c6bb4";
this.rightBarC... |
const routes = [
[-20, 15],
[-14, -5],
[-18, -13],
[-5, -3],
];
const solution = (routes) => {
let answer = 0;
routes.sort((a, b) => {
return a[1] - b[1];
});
let camera = -30001;
for (let i = 0; i < routes.length; i++) {
if (camera < routes[i][0]) {
answer++;
camera = routes[i][1... |
const WebSocket = require("ws");
const wss = new WebSocket.Server({port: 80});
wss.on('connection', function connection(ws, req) {
console.log(wss.clients.size);
ws.on('message', function incoming(message) {
console.log('received: %s', message);
wss.clients.forEach(function (client) {
if (client == ws) {
... |
// DB 모델을 작성한다.
// Video 자체를 DB에 저장하진 않을 것이다. 즉, byte를 저장하는 것이 아니라 video의 link를 저장한다.
import mongoose from "mongoose";
const VideoSchema = new mongoose.Schema({
fileUrl: {
type: String,
required: "File URL is required", // url이 없으면 오류메시지 출력
},
title: {
type: String,
required: "Title is required",... |
'use strict'
const _ = require('lodash')
const Helpers = use('Helpers')
const Config = use('Config')
const Drive = use('Drive')
const Post = use('App/Models/Post')
const Option = use('App/Models/Option')
const { HttpException } = require('@adonisjs/generic-exceptions')
const BaseController = require('./ResourceContro... |
/*菜单*/
define([
"dojo/_base/declare",
"echo/utils/EventBus",
"dojo/query",
"dojo/NodeList-dom",
"dojo/domReady!"
],
function(declare, EventBus, query) {
return declare("menu", null, {
constructor: function(config) {
this.config = config;
this.init();
},
star... |
import { Dimensions } from 'react-native';
import { UIConstant } from '../services/UIKit/UIKit';
import { SHOW_CONTROLLER, NAVIGATION_MENU_CONTROLLER, SET_BACKGROUND_PRESET, SET_SCREEN_WIDTH, SET_MOBILE } from '../actions/ActionTypes';
const initialState = {
controllerToShow: null,
backgroundPresetName: '',
... |
$(document).ready(function () {
// Initialize Firebase
var config = {
apiKey: "AIzaSyDg-e09AnkOSzUQ2fBUfHDnOZ4qoiiN_Dg",
authDomain: "train-scheduler-dbf7e.firebaseapp.com",
databaseURL: "https://train-scheduler-dbf7e.firebaseio.com",
projectId: "train-scheduler-dbf7e",
sto... |
/* global JSON */
'use strict';
exports.setClipboardCopyData = setClipboardCopyData;
exports.parsePostFromPaste = parsePostFromPaste;
var _parsersMobiledoc = require('../parsers/mobiledoc');
var _parsersHtml = require('../parsers/html');
var _parsersText = require('../parsers/text');
var _mobiledocHtmlRenderer = r... |
class Shape {
constructor(color) {
this.color = color;
}
move() {
console.log('move');
}
}
class Circle extends Shape {
constructor(color, radius) {
super(color); // --> it extends Shape constructor.
super.move(); // it allows to see the fShape's move implementation.
this.radius = radius;... |
import React from 'react';
import { CircularProgress } from '@material-ui/core';
const Spinner = () => {
return (
<div>
<CircularProgress style={{margin: "4vh"}} />
</div>
);
};
export default Spinner; |
var app = app || {};
$(function () {
/* $("#sendMessage").click(function(evt) {
var msg = $("#message").val();
$.ajax({
type: "POST",
url: "geofeeder",
contentType: "application/json",
data: msg
}).done(function(data1){
alert("Message... |
const fs = require('fs');
const about = fs.readFileSync('./contents/HTML/about.html', 'utf-8');
const blog = fs.readFileSync('./contents/HTML/blog.html', 'utf-8');
const contact = fs.readFileSync('./contents/HTML/contact.html', 'utf-8');
const index = fs.readFileSync('./contents/HTML/index.html', 'utf-8');
const prici... |
export const OPEN = 'DIALOG/OPEN';
export const open = (id, data) => ({
type: OPEN,
id,
data,
});
export const CLOSE = 'DIALOG/CLOSE';
export const close = (id) => ({
type: CLOSE,
id,
});
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.