text
stringlengths
3
1.05M
import React, { Component } from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import MobileContainer from './container' import MobileNavigationBar from './navigation-bar' import LocationField from '../form/location-field' import { MobileScreens, setMobileScreen } from '../../action...
# Copyright 2014 Uri Laserson # # 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,...
// The main purpose of this file is to provide an interface for database // connection. Even though the code is quite simple and basically a tiny // wrapper around mongoose package, it works as single point where // database setup/config is performed and the interface provided here can be // reused by both the main...
const Discord = module.require('discord.js'); const ms = require('parse-ms'); module.exports.run = async (client, message, args) => { try { let config = require('../config.json'); let lang = require(`../lang_${client.lang}.json`); let evaled = eval('`' + lang.economy.bonus + '`'); l...
console.log('Background.js file loaded'); import { wrapStore, alias } from 'webext-redux'; import { createStore } from 'easy-peasy'; import { initial } from '../store/store'; const addTodoAsync = (action) => { return () => { return store.getActions().waitAndAddTodo(action.payload).then(result => { action.p...
const { MessageEmbed } = require('discord.js'); const { red_light } = require("../../colours.json"); const db = require("quick.db"); const config = require('../../botconfig.json') module.exports = { config: { name: "freeze", description: "Freezes current channel!", category: "moderation", ...
# ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ # MIT License # # Copyright (c) 2021 Nathan Juraj Michlo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Softwar...
import AxisLabel from './AxisLabel.vue' import { valueToPoint } from './util.js' export default { components: { AxisLabel }, props: { stats: Array }, computed: { // a computed property for the polygon's points points() { const total = this.stats.length return this.stats .m...
/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. const { Networ...
/*! * html2canvas 1.0.0-rc.5 <https://html2canvas.hertzen.com> * Copyright (c) 2020 Niklas von Hertzen <https://hertzen.com> * Released under MIT License */ !function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(A=A||self).html2canvas=...
module.exports = (protocols, stylesheet) => { return protocols.some(test => location.protocol === `${test}:`) ? stylesheet : '' }
/*globals FB, module */ (function () { 'use strict'; /** * Callback on facebook status change * @param {Object} response * @param {Function} callback * @return {none} */ function statusChangeCallback(response, callback) { if (response.status === 'connected') { callback(true); } else if (respons...
Vue.component('rightsidebar-component', { template: `<div id="right-sidebar"> <div class="sidebar-container"> <ul class="nav nav-tabs navs-3"> <li class="active"><a data-toggle="tab" href="#tab-1"> Notes </a></li> ...
/** * My-button custom element * * @author Jelle De Loecker <jelle@elevenways.be> * @since 1.1.7 * @version 1.1.7 */ const MyDocumentList = Blast.Bound.Function.inherits('Alchemy.Element', 'MyDocumentList'); /** * The template to use for the content of this element * * @author Jelle De Loecker <je...
load("@fbsource//tools/build_defs:fb_native_wrapper.bzl", "fb_native") load("@fbsource//tools/build_defs/apple:flag_defs.bzl", "get_debug_preprocessor_flags") load( "//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "APPLE", "get_apple_compiler_flags", "get_apple_inspector_flags", "react_native_xp...
var counter = 1; jQuery('a.add-item').click(function(event){ event.preventDefault(); counter++; var newRow = jQuery('<tr id="'+counter+'_line"><td><input type="text" class="form-control" ' + counter + '"/></td><td><input type="text" class="form-control" ' + counter + '"/></td><td><input type...
import json import os import re import time import tweepy import csv import numpy as np from datetime import datetime from vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer twitter_secrets_path = './secrets/twitter.json' focus_languages = ['en'] focus_hashtags = ['#bitcoin'] # '#crypto', '#cryptocurre...
/* Copyright 2017 Vector Creations Ltd Copyright 2018, 2019 New Vector Ltd Copyright 2019 Lepton Interaction. 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/LICE...
import React from 'react'; import fibLogo from '../fiblogo.png'; import styled from 'styled-components'; const Header = styled.header` background-color: #2a668f; color: #fff; `; const Container = styled.div``; const Heading = styled.h1` padding-top: 3rem; `; const Logo = styled.img` display: block; ...
import moment from 'moment-timezone' /** * Used to generate an object containing metadata for a custom year * A current use case is generating the getRange() key for a custom temporal * range dropdown option * @param {number} customYearStart 1-based month number (i.e. 1 for January) * @param {date} [now=new Date(...
import fg from "fast-glob"; import { readJson, writeJson } from "fs-extra"; import { existsSync } from "fs"; import { dirname, join } from "path"; import copy from "recursive-copy"; import { promisify } from "util"; import resolve from "resolve"; export function collectDependencies({ onlyNative, outputDir, widgetName ...
//// [tests/cases/compiler/letDeclarations-scopes-duplicates2.ts] //// //// [file1.ts] let var1 = 0; //// [file2.ts] let var1 = 0; //// [file1.js] let var1 = 0; //// [file2.js] let var1 = 0;
/*! * FullCalendar v3.0.1 * Docs & License: http://fullcalendar.io/ * (c) 2016 Adam Shaw */ !function(t){"function"==typeof define&&define.amd?define(["jquery","moment"],t):"object"==typeof exports?module.exports=t(require("jquery"),require("moment")):t(jQuery,moment)}(function(t,e){function n(t){return q(t,qt)}fun...
import snarkdown from "snarkdown"; /** * Adapted from: https://github.com/developit/snarkdown/issues/70#issuecomment-626863373 * * @param {string} markdown */ export default function safeMarkdown(markdown) { const html = snarkdown(markdown); const doc = new DOMParser().parseFromString( `<!DOCTYPE h...
# # Advent of Code 2020 - Day 3 Part 1 # 3 Dec 2020 Brian Green # # Problem: # From your starting position at the top-left, check the position that is right 3 and down 1. # Then, check the position that is right 3 and down 1 from there, and so on until you go past the bottom of the map. # import os class Aoc03: d...
; $(function() { $('body').on('click','.wh-variants a',function() { $('input[name=art_id]').val($(this).data('art_id')); calc_price(); }); $('body').on('click','.wh-attributes a, .wh-attributes button',function() { $(this).parent().addClass('uk-active').siblings().removeClass('u...
/* Copyright (c) Uber Technologies, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. */ // @flow export { styled, withStyle, withWrapper, useStyletron, createThemedStyled, createThemedWithStyle, createThemedUseStyletron, ThemeP...
""" innovation_sweet_spots.getters.crunchbase Module for easy access to downloaded CB data """ import pandas as pd from innovation_sweet_spots.getters.path_utils import CB_PATH def get_crunchbase_category_groups(): """Table with company categories (also called 'industries') and broader 'category groups'""" ...
var nodePath = require("path"); var fs = require("fs"); exports.check = function(marko, markoCompiler, expect, snapshot, done) { require("marko/compiler").configure({ writeToDisk: true }); var compiledPath; var templatePath = nodePath.join(__dirname, "template.marko"); compiledPath = node...
angular.module("ovh-api-services").service("OvhApiIpLoadBalancingVrackV6", function ($resource, $cacheFactory) { "use strict"; var cache = $cacheFactory("OvhApiIpLoadBalancingVrackV6"); var queryCache = $cacheFactory("OvhApiIpLoadBalancingVrackV6Query"); var interceptor = { response: function ...
"""This module contains API-related exceptions.""" class APIError(Exception): """An exception denoting generic API errors. This error is raised when the API returns invalid response data, like invalid JSON. """ pass class EmptyResponseError(APIError): """An exception denoting an empty API ...
//global var //var for form errors //we need a var which is as function to retrive input from search term. var searchTerm =function () { var searchTerm = document.querySelector('#search-button').value }; //begin the fetch //step one we need to fetch the data (Fetch is the call){ // 'url' + searchTerm + :...
import React from 'react'; import cx from 'classnames'; const TESTING_SVG = ( <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 50 50"> <path d="M 18.5 2 C 17.1 2 16 3.1 16 4.5 C 16 5.7 16.9 6.70625 18 6.90625 L 18 40.90625 C 18 44.80625 21.1 47.90625 25 47.90625 C 28.9 47.90625 32 44.8...
#!/usr/bin/python import os from mininet.log import setLogLevel, info #, error from mininet.net import Mininet from mininet.node import OVSController from mininet.topo import Topo from mininet.link import TCLink from mininet.cli import CLI import time from debug_utils import * from net_utils import * def run_master...
const express = require("express"); const api = require("./api/api"); const db = require("./databaseConnection"); const app = express(); // Setup common middlewares app.use(express.json()); // Load database db.connectDB(); // Register api app.use("/api", api); module.exports = app;
import { gridSize } from './globals.js'; let snake = kontra.Sprite({ x: 160, y: 160, width: gridSize, height: gridSize, // snake velocity. moves one grid length every frame in either the x or y direction dx: gridSize, dy: 0, // keep track of all grids the snake body occupies cells: [], // keep t...
L.Control.Attribution = L.Control.extend({ options: { position: 'bottomright', prefix: 'Powered by <a href="http://leaflet.cloudmade.com">Leaflet</a>' }, initialize: function (options) { L.Util.setOptions(this, options); this._attributions = {}; }, onAdd: function (map) { this._container = L.DomUtil.c...
import sys import math sys.path.append("..") from common import * def parse(data): d = data[:-1].split("contain") return (d[0].strip(),[c.strip() for c in d[1].split(",")]) data = fnl(parse); graph = {} for n in data: graph[n[0][:-4].strip()] = [e.split(" ",1)[1][:-4].strip() for e in n[1]] p(graph) graph...
import React, { PureComponent , Suspense}from 'react'; import PropTypes from 'prop-types'; import Spinner from '../Spinner' const ThumbImage = React.lazy(() => import('../ThumbImage')) class GnomeModal extends PureComponent { render () { const { active, gnome, closeModal } = this.props; const modalClassnam...
import * as TYPE from "./checkType" // 全局log变量 let isShowGlobalLog = true; // 设置模块开关(建议默认模块code>=1000) let moduleArr = [ { name: `login`, code: 1000, isShowLog: true } ]; // 设置样式(暂时设置文字颜色) let styleArr = { red: `color:#f5576c`, blue: `color:#005bea`, green: `color:#00e3ae`, ...
/** * Copyright 2016 Frédéric Massart * * 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 agre...
(function(){if(window.JCClock)return;function i(i){if(typeof BX!="undefined")BX.onCustomEvent("onJCClockInit",[i]);this.config=i;this.config.AmPmMode=BX.isAmPmMode();this.config.AmPm="";this.deltaHour=0;this.MESS=this.config.MESS;this.bCreated=false}i.prototype={Create:function(i){this.bCreated=true;this.pInput=documen...
var ToolsetCommon = ToolsetCommon || {}; /** * Bootstrao Grid module. * * Provides a Grid button on selected editors that allows inserting a Bootstrap grid HTML structure. * * @since 2.3.3 */ ToolsetCommon.BootstrapCssComponentsGrids = function( $ ) { var self = this; /** * Init the Bootstrap grid dialo...
import numpy as np from matplotlib import cm from matplotlib import pyplot as plt from mpl_toolkits.mplot3d import Axes3D import open3d as o3d def plot_pcd(ax, pcd, color=None, cmap='viridis', size=4, alpha=0.9, azim=60, elev=0): if color is None: color = pcd[:, 0] vmin = -2 vmax = 1.5 else: vmin = 0 vmax...
/** * The MIT License (MIT) * * Copyright (c) 2016 DeNA Co., Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to u...
// 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 ...
/** * This class represents a dialog message overlaying a DOM element in order to * accept / cancel discard changes. The dialog can be closed i.e the overlay disappears * o canceled. In this last case a callback function should be called. */ export default class PopUpMessage { /** * * @param {Object}...
# Apache License Version 2.0 # # Copyright (c) 2021., Redis Labs Modules # All rights reserved. # import logging def prepare_redisgraph_benchmark_go_command( executable_path: str, server_private_ip: object, server_plaintext_port: object, benchmark_config: object, results_file: object, is_r...
export default () => { return <div>FB Messenger</div>; };
import CacheService from '@services/cache.service'; import EventService from '@services/event.service'; import BaseStringService from '@services/base-string.service'; import AppStrings from '@services/app.strings'; angular .module('at.lib.services', []) .service('AppStrings', AppStrings) .service('BaseStri...
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { t...
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # from typing import List, Optional, Dict from nltk.translate.ribes_score import sentence_ribes as sent_ribes from vizseq...
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.core import util from telemetry.page import page as page_module from telemetry.page.actions import navigate from telemetry.unittest import tab...
"use strict"; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.definePrope...
/* eslint-disable */ // rename this file from _test_[name] to test_[name] to activate // and remove above this line QUnit.test("test: Sales Invoice Review", function (assert) { let done = assert.async(); // number of asserts assert.expect(1); frappe.run_serially([ // insert a new Sales Invoice Review () => f...
/* * MultiSelect v0.9.12 * Copyright (c) 2012 Louis Cuny * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want * To Public License, Version 2, as published by Sam Hocevar....
// @remove-on-eject-begin /** * Copyright (c) 2015-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ // @remove-on-eject-end 'use strict'; const fs = require('fs'); const path = require('path'); const resolve = ...
/** * Wallet * * Author: Taslim Oseni <taslim@cowrywise.com> **/ const request = require('../helper/request'); class Wallets { constructor (config = {}) { this.config = config; } /** * Create Wallet * * Create a wallet * @param {String} data.account_id Account ID of the in...
/** * Version 2.0 * * Written by Micael Sjölund, ESN (http://www.esn.me) * * Creates a growing container that automatically fills its content via ajax requests, when the user scrolls to the * bottom of the container. More info: http://pushingtheweb.com/2010/09/endless-scroller-jquery-plugin/ * * Requires jStora...
import { any, string } from 'prop-types' import React, { PureComponent } from 'react' import { NotificationContainer } from 'react-notifications' export class App extends PureComponent { render() { const { year, children } = this.props return ( <div> <NotificationContai...
export default function (state = {}, action){ switch(action.type){ case "SET_USER": return { ...state, userData: action.payload } default: return state } }
import React, { useState, useEffect } from "react"; import { Form, Input, Button, Select, Card, Typography, notification, Row, Col, } from "antd"; import PropTypes from "prop-types"; import { withRouter } from "react-router-dom"; import { connect } from "react-redux"; import { addMovie } from "../../....
var through = require('through') var match = require('./match') var serialize = require('stream-serializer')() var recycle = require('cycle').retrocycle var EventEmitter = require('events').EventEmitter function repler (dest) { var emitter = new EventEmitter() var history = emitter.history = [] var posi...
# -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2020 MinIO, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lic...
export default { "language": "english", "version": 1.0, "location": "Location", "professional_experience": "Professional Experience", "education": "Education", "hobbies": "Personal Practices", "personal_info": "Personal Information", "mobile": "Mobile" , "email": "E-mail", "...
import FilterEnum from "./FilterEnum" import withFieldRelates from "./_withFieldRelates" export default withFieldRelates(FilterEnum);
const Path = require ( 'path' ); const s_Fs = require ( 'st_ini_fs' ); const { arht } = require ( 'st_ini_arht' ); const arr_names = Object.getOwnPropertyNames ( s_Fs ); arr_names.map ( item => arht.before ( s_Fs[item], module ) ); const funcExamp = require ( '../../index' ); arht.before ( funcExamp ,module); // MOD...
import TimePicker from './TimePicker' export default TimePicker
from typing import Dict, Optional from qcodes import IPInstrument from qcodes.utils import validators as vals from qcodes.instrument.channel import InstrumentChannel, ChannelList class MC_channel(InstrumentChannel): def __init__(self, parent: "RC_SPDT", name: str, channel_letter: str): """ Args: ...
import torch from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F # torch functions import torch.optim as optim # torch optimization class LeNet(nn.Module): def __init__(self): super(LeNet, self).__init__() # convolutional layers self.conv1 = nn.Conv...
const { join } = require('path'); const FriendlyErrorsWebpackPlugin = require('friendly-errors-webpack-plugin'); // 友好的错误提示 const WebpackBuildNotifierPlugin = require('webpack-build-notifier'); // webpack 弹窗提示 const setTitle = require('node-bash-title'); // 设置小黑板窗口title const setIterm2Badge = require('set-iterm2-badge'...
var TestData = require('./config/test_data'); Feature('Error message is displayed when trying to use an expired link'); Scenario('@smoke @expiredlinks I try to reset my password with an expired reset password link', (I) => { I.amOnPage('/passwordReset?action=start&token=invalidtoken&code=somecode'); I.waitForTex...
from flask import Flask, request, render_template import jageocoder jageocoder.init() app = Flask(__name__) @app.route("/") def index(): return render_template('index.html', q='', result=None) @app.route("/search", methods=['POST', 'GET']) def search(): query = request.args.get('q') or None if query: ...
/** * Copyright IBM Corp. 2019, 2020 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. * * Code generated by @carbon/icon-build-helpers. DO NOT EDIT. */ 'use strict'; var Icon = require('../Icon-399ca71f.js'); var React = require...
""" implement the TimedeltaIndex """ from datetime import timedelta import numpy as np from pandas.core.dtypes.common import ( _TD_DTYPE, is_integer, is_float, is_bool_dtype, is_list_like, is_scalar, is_timedelta64_dtype, is_timedelta64_ns_dtype, pandas_dtype, _ensure_int64) fro...
import React, { Component } from 'react'; class List extends Component { constructor(props) { super(props) this.state = { } } render() { return ( <div> <h1>List</h1> <p>ID: { this.state.id }</p> </div> ); } comp...
module.exports = function (babel) { var asyncFunctionVisitor = { CallExpression: function (path) { if (path.parent.type !== 'AwaitExpression') { path.replaceWith(babel.types.awaitExpression(path.node)) } }, TaggedTemplateExpression: function (path) { if (path.parent.type !== 'Awa...
"""Test suite for the sbflip package."""
"""Makes a .joblib file containing the trained model """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import time import numpy as np import logging import tensorflow as tf from tensorflow.python.platform import app, flags from clev...
""" """ import os from csv import reader from pickle import load, dump from dmim_analysis.analysis import analyze_compound_targeted from dmim_analysis.plots import atd_with_fit with open('combined_cal.pickle', 'rb') as pf: cal = load(pf) with open('D:/DMIM_HT/analysis/replicates/rerun_p2r3.csv', 'r') as f: ...
/* Copyright (C) 2016 NooBaa */ import ko from 'knockout'; import MessageRowViewModel from './message-row'; export default class MessageListViewModel { rows = ko.observableArray(); onState(messages, selected) { let lastRowTimestamp = -1; const rows = messages .map((message, i) => ...
import {displayMainContent} from './blogPostsView'; import {renderReadButton} from './blogReadButtonView'; import {renderAddPostModalWindow} from '../addPostModalWindowView'; import {deletePost, addAbilityToDeleteAllPosts, getPostList} from '../model/serverRequests'; import '../newPostController'; import '../myJQueryM...
import json from collections import defaultdict from functools import partial from pathlib import Path from typing import DefaultDict, Dict, List, Optional, Tuple import clr import System from System.IO import FileNotFoundException from System.Reflection import Assembly, ConstructorInfo, EventInfo, FieldInfo, MethodI...
#!/bin/python EMISSION_SPEED_FACTOR = 19 DIFFICULTY_TARGET = 240 # seconds MONEY_SUPPLY = 88888888000000000 GENESIS_BLOCK_REWARD = 8800000000000000 FINAL_SUBSIDY = 4000000000 COIN_EMISSION_MONTH_INTERVAL = 6 #months COIN_EMISSION_HEIGHT_INTERVAL = int(COIN_EMISSION_MONTH_INTERVAL * 30.4375 * 24 * ...
# Copyright 2015-present MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
// This file was automatically generated. Do not modify. 'use strict'; goog.provide('Blockly.Msg.pt'); goog.require('Blockly.Msg'); Blockly.Msg.ADD_COMMENT = "Adicionar Comentário"; Blockly.Msg.CANNOT_DELETE_VARIABLE_PROCEDURE = "Can't delete the variable '%1' because it's part of the definition of the function '%...
// Bulma CSS for light weight CSS. One can any css framework import 'bulma/css/bulma.min.css'; import './resources/css/util.scss'; import './resources/css/global.css'; export default class Client { }
// @flow var fs = require('fs'); import * as src from '../../../index'; import UnmutableCompatible from './UnmutableCompatible-testutil'; let files = { butLast: [], // chunkBy: [], // chunk: [], clear: [], clone: [], // concat: [], count: [], // deal: [], // defaults: [], // del...
!function(){"use strict";function e(e){e.put("selectbox.html",'<div tabindex="{{ vm.instance }}" class="sb-container" id="{{ vm.formatInstance(vm.instance) }}"> <a href="" class="sb-toggle" ng-click="vm.toggle()" ng-class="{\'sb-toggle-active\': vm.active}"> {{ vm.selected[vm.labelKey] || vm.va...
import users from "~/api/users.js"; import { SET_USERS, ADD_USER, REMOVE_USER } from "~/store/mutation-types"; const store = { namespaced: true, state: { users: [], usersMeta: { current_page: 1, from: 1, last_page: 1, per_page: 10, to: 1, total: 0 }, }, m...
import { useEffect, useState } from "react"; import io from "socket.io-client"; import ChatList from "./ChatPage/ChatList"; import withStyles from "@mui/styles/withStyles"; const URL = process.env.NODE_ENV === 'production' ? `https://${window.location.host}` : 'http://localhost:5000'; const socket = io.connec...
from flask import Blueprint, render_template, request, url_for from .models import Words from . import db from datetime import tzinfo, timedelta, datetime from sqlalchemy import desc views = Blueprint('views', __name__) @views.route('/', methods=['GET', 'POST']) def index(): words = Words.query.order_by(desc(Word...
(function(factory){if(typeof define==="function"&&define.amd){define("inputmask",["inputmask.dependencyLib"],factory);}else if(typeof exports==="object"){module.exports=factory(require("./inputmask.dependencyLib"));}else{factory(window.dependencyLib||jQuery);}} (function($){var ua=navigator.userAgent,mobile=/mobile/i.t...
(function() { // CommonJS require() function require(p){ var path = require.resolve(p) , mod = require.modules[path]; if (!mod) throw new Error('failed to require "' + p + '"'); if (!mod.exports) { mod.exports = {}; mod.call(mod.exports, mod, mod.exports, require.relative(path)); } ...
/* Reverse a linked list */ function Node(val) { this.val = val; this.next = null; } function LinkedList() { this.head = null; this.tail = null; } const reverseLL = head => { let curr = head; let prev = null; let tempNext = null; while(curr) { tempNext = curr.next; curr.next = prev; prev ...
import { module, test } from 'qunit'; import { setupRenderingTest } from 'ember-qunit'; import { render } from '@ember/test-helpers'; import hbs from 'htmlbars-inline-precompile'; module('Integration | Helper | get-random', function(hooks) { setupRenderingTest(hooks); // Replace this with your real tests. test(...
(function(){ angular .module('chatty', ['ui.router', 'ngCookies', 'firebase']) .config(config) function config($stateProvider, $locationProvider){ $locationProvider .html5Mode({ enabled: true, requireBase: false }) $stateProvider .state('chat', { url: '/', controller: 'RoomsCtrl', ...
import isPowerOfTwo from "./solution.js"; test("example 1", () => { expect(isPowerOfTwo(1)).toBe(true); }); test("example 2", () => { expect(isPowerOfTwo(16)).toBe(true); }); test("example 3", () => { expect(isPowerOfTwo(218)).toBe(false); }); test("example 4", () => { expect(isPowerOfTwo(-16)).toBe(false);...
import lark from lark import Lark, Tree from lark.lexer import Token from lark.visitors import Interpreter grammar = """ start : (decl)+ decl : variable_decl | function_decl | class_decl | interface_decl variable_decl : variable ";" variable : type IDENT type : TYPE | IDENT | type "[]" functio...
import React from "react"; import styled from "styled-components"; export const ConfigColor = { greyBlack: "#353535", greyVeryClear: "#828c99", greyClear: "#dfe7ef", red: "#f44336", activeRed: "#d32f2f" }; export const Container = styled.div` width: ${prop => prop.width}; display: flex; `; const Color ...