text stringlengths 1 1.05M |
|---|
#!/bin/bash
#CHANGES CONSOLE TITLE
echo -ne "\033]0;Anwar CLI IDE setup\007"
|
package com.github.chen0040.leetcode.day06.medium;
import java.util.*;
/**
* Created by xschen on 1/8/2017.
*
* summary:
* Given an array of strings, group anagrams together.
*
* link: https://leetcode.com/problems/group-anagrams/description/
*/
public class GroupAnagrams {
public class Solution {
p... |
<gh_stars>0
/*
* Copyright © 2019 <NAME>.
*/
package internal
import (
"fmt"
"github.com/hedzr/cmdr"
"github.com/hedzr/cmdr/plugin/daemon"
"github.com/hedzr/voxr-common/vxconf"
"github.com/hedzr/voxr-lite/internal/restful"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/acme/autocert"
"net/http"
"os"
)
... |
/* eslint-env jest */
import { visit } from './testUtils'
describe('Letterhead page', () => {
it('loads in /letterhead', async () => {
const page = visit('/letterhead')
const text = await page.evaluate(() => document.body.textContent).end()
expect(text).not.toContain('Page not found')
})
it('has 4 ... |
package sort;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
/**
*
* @author exponential-e
* 백준 20949번: 효정과 새 모니터
*
* @see https://www.acmicpc.net/problem/20949
*
*/
public class Boj20949 {
private static final String NEW_... |
using System;
public static class EnsureDoubleExtensions
{
public static Param<double> IsLowerThan(this Param<double> param, double limit)
{
if (param.Value >= limit)
throw new ArgumentOutOfRangeException($"The value {param.Value} is not lower than {limit}.");
return param;
}
}... |
<reponame>Jordan-Gilliam/SocialNews
var express = require("express");
var app = express();
// var router = express.Router();
var axios = require("axios");
var cheerio = require("cheerio");
var db = require("../models");
app.get("/", function(req, res) {
res.render("index");
});
app.get("/scrape", function(req, ... |
<reponame>bodymovin/skia-buildbot
/**
* @module modules/debug-view-sk
* @description Container and manager of the wasm-linked main canvas for the debugger.
* Contains several CSS resizing buttons that do not alter the surface size.
*
* @evt move-cursor: Emitted when the user has moved the cursor by clicking or h... |
<filename>librbr/include/utilities/a_star.h
/**
* The MIT License (MIT)
*
* Copyright (c) 2014 <NAME>, University of Massachusetts
*
* 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... |
package de.wwu.music2rdf.core;
public class Staff {
private String id;
private ScorePart part;
public Staff() {
super();
this.part = new ScorePart();
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public ScorePart getPart() {
return part;
}
}
|
fn convert_to_slugs(weight: f64) -> Option<f64> {
if weight < 0.0 {
return None;
}
Some(weight / 32.174)
}
fn main() {
let weight_in_pounds = 100.0;
match convert_to_slugs(weight_in_pounds) {
Some(result) => println!("Equivalent weight in slugs: {:.3}", result),
None => prin... |
<filename>sgalgorithm/permutation_combination.go
package sgalgorithm
//resultList must be a slice
//从srcList中,选出num个做全排列
func GenPermutation(srcList []string, num int, resultList *[]string) {
if num <= 0 {
return
}
if num > len(srcList) {
num = len(srcList)
}
flags := make([]int, num, num*2)
for _, n := rang... |
npx truffle migrate --f 3 --to 3 --network rinkeby
npx truffle migrate --f 4 --to 4 --network skaleSide
KEY=$1 node ./scripts/depositErc20FromMain.js
npx truffle migrate --f 5 --to 5 --network skaleSide |
<filename>routes/wechat.js
var express = require('express');
var wechat = require('wechat');
var router = express.Router();
var config = {
"appID": "wx9964adbcb6c21bd9",
"appsecret": "91687f6314257936c98269113e3ed2df",
"token": "950815x"
}
router.use(express.query());
router.use('/', wechat(config, func... |
package seedu.address.logic.parser;
import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
import static seedu.address.logic.commands.CommandTestUtil.ADDRESS_DESC_AMY;
import static seedu.address.logic.commands.CommandTestUtil.ADDRESS_DESC_BOB;
import static seedu.address.logic.commands.Comm... |
import React, { useEffect, useState } from "react";
import "./style.css";
import GoogleMapReact from "google-map-react";
import MapPinIcon from "../Icons/MapPinIcon";
import MapPinNewIcon from "../Icons/MapPinNewIcon";
import XIcon from "../Icons/XIcon";
import MriIcon from "../Icons/MriIcon";
import HospitalIcon from ... |
<filename>internal/operator/networking/kinds/orb/labels.go
package orb
import "github.com/caos/orbos/pkg/labels"
func mustDatabaseOperator(binaryVersion *string) *labels.Operator {
version := "unknown"
if binaryVersion != nil {
version = *binaryVersion
}
return labels.MustForOperator("ORBOS", "networking.caos... |
#!/bin/bash
docker stop demo-docker-domino
|
<reponame>zhouxiang93123/openair-cn<gh_stars>1-10
/*
* Copyright (c) 2015, EURECOM (www.eurecom.fr)
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code mus... |
package seedu.address.model.person;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.Test;
public class LastVisitTest {
@Test
public void equals() {
... |
<filename>src/db/migrations/20210315033256-create-userverification.js
'use strict';
module.exports = {
up: async (queryInterface, Sequelize) => {
/**
* Add altering commands here.
*
* Example:
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
*/
return queryInte... |
<filename>flinkx-core/src/main/java/com/dtstack/flinkx/conf/BaseFileConf.java
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this... |
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the... |
<reponame>shin-kinoshita/dbflute-core
/*
* Copyright 2014-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LI... |
#!/bin/sh
#PBS -N 1x060
#PBS -q regular
#PBS -l mppwidth=60
#PBS -l mppnppn=4
#PBS -l mppdepth=1
#PBS -l walltime=04:00:00
#PBS -A m106
#PBS -j eo
prefix=1x060
cd $PBS_O_WORKDIR
rm -rf $prefix.cache
log=$prefix.log
rm -f $log
touch $log
yaml=$prefix.yaml
rm -f $yaml
cat << EOF > $yaml
---
grid :
bin_width ... |
/// Get the cursor position based on the current platform.
#[cfg(unix)]
pub fn get_cursor_position() -> (u16, u16) {
if unsafe { RAW_MODE_ENABLED } {
if let Ok(pos) = pos_raw() {
return pos;
}
}
// Default position if raw mode is not enabled or retrieval fails
(0, 0)
} |
<reponame>virta-jasonmay/tilt<gh_stars>1-10
package logstore
import (
"fmt"
"strings"
"github.com/windmilleng/tilt/pkg/model"
)
func SourcePrefix(n model.ManifestName) string {
if n == "" || n == model.TiltfileManifestName {
return ""
}
max := 13
spaces := ""
if len(n) > max {
n = n[:max-1] + "…"
} else... |
#!/usr/bin/env bash
curl -X POST -H "Content-Type: application/json" -d '{"k": 10, "state": {"nodeIds": [611]}, "maxIterations": 20}' localhost:8000/provider/pagerank/; echo |
package libsys;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import java.io.File;
/**
* Test Settings related operations
*/
public class SettingsTest extends TestCase
{
private Settings settings;
/**
* Test Settings related operations
* @param t... |
export class CtrlBase<T> {
value: T;
setValue(newValue: T): void {
this.value = newValue;
}
getValue(): T {
return this.value;
}
clearValue(): void {
this.value = null;
}
} |
import React from 'react';
import { CalendarMonth } from '@patternfly/react-core';
export const CalendarMonthDefault: React.FunctionComponent = () => <CalendarMonth date={new Date()} />;
|
<filename>func-futurestream/src/test/java/cyclops/async/reactive/futurestream/react/lazy/LazySeqLazyTest.java<gh_stars>0
package cyclops.async.reactive.futurestream.react.lazy;
import static java.util.Arrays.asList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import cyclops... |
// @flow
import { Button, ButtonProps } from 'reactstrap';
import { useFormContext } from 'react-hook-form';
import { LOCALES_NAMESPACE, useTranslation } from '@server/i18n';
import { FunctionComponent } from 'react';
export const HButton: FunctionComponent<ButtonProps> = (props: ButtonProps): any => {
const { sav... |
func countUniqueDomains(in imageURLs: [String]) -> String {
var uniqueDomains = Set<String>()
for url in imageURLs {
if let domain = extractDomain(from: url) {
uniqueDomains.insert(domain)
}
}
let domainCount = uniqueDomains.count
let domainString = domainCount ... |
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
string restoreString(string s, vector<int> &indices)
{
string ans;
for (int i = 0; i < indices.size(); i++) ans[indices[i]] = s[i];
return ans;
}
}; |
<reponame>talenguyen/Counter
package vn.tale.counter.ui.settime;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import ... |
// Sends a request to the server to get data
const getDataFromServer = async () => {
const response = await fetch('/data');
const data = await response.json();
return data;
};
// Updates the UI with the data from the server
const updateUI = async () => {
const data = await getDataFromServer();
updateHtml(dat... |
#!/bin/bash
cd "$(dirname "$0")"
pybuilderInstalled=`pip freeze | grep 'pybuilder' | wc -l`
if [ $pybuilderInstalled != 1 ]
then
echo "Installing pybuilder"
pip install pybuilder
fi
pyb install_dependencies clean publish
tox
if [ ! -d "bin" ]; then
mkdir 'bin'
fi
cp target/dist/dataproducts*/dist/* bin/
m... |
#!/bin/bash
if test -z "$COFFEE_SHOP_PASSWORD"; then
echo "COFFEE_SHOP_PASSWORD not defined"
exit 1
fi
auth="-u user -p $COFFEE_SHOP_PASSWORD"
# MONGODB USER CREATION
(
echo "setup mongodb auth"
create_user="if (!db.getUser('onlyu')) { db.createUser({ user: 'onlyu', pwd: '$COFFEE_SHOP_PASSWORD', roles: [ {ro... |
let app = new Vue({
el: "#app",
mixins:[
MergeUrls,
],
data: {
ids:[], // it is shown when the duplicate models were load
name: '', // it is shown when the duplicate models were load
loading: {
all: true, // controls were duplicate models are loaded
... |
<reponame>premss79/zignaly-webapp
export { default } from "./WinRate";
|
#!/bin/bash
INIT_IMAGE=${GALAXY_INIT_TAG:-"quay.io/bgruening/galaxy-init:dev"}
# Sets the image of postgres to use
POSTGRES=postgres:11.2
# User and password to use.
POSTGRES_USER=galaxy
POSTGRES_PASSWORD=chaopagoosaequuashie
POSTGRES_DB=galaxy
echo "Create postgres in detached mode"
pg_start=`date +%s`
docker run ... |
import React from 'react';
import { createMount } from '@material-ui/core/test-utils';
import RemoveArtifact from './removeartifact';
describe('RemoveArtifact Component', () => {
it('renders correctly', () => {
const tree = createMount()(<RemoveArtifact open={true} />).html();
expect(tree).toMatchSnapshot();... |
#!/bin/sh
# create file if not exist
if [ ! -f "$DATA_PATH/permissions.json" ]; then
cp $DEFAULT_CONFIG_PATH/permissions.json $DATA_PATH/permissions.json
fi
if [ ! -f "$DATA_PATH/whitelist.json" ]; then
cp $DEFAULT_CONFIG_PATH/whitelist.json $DATA_PATH/whitelist.json
fi
if [ ! -f "$DATA_PATH/server.properties" ]... |
import {migrate} from "src/js/test/helpers/migrate"
test("migrating 202007151457_addScrollPosToSearchRecord", async () => {
const next = await migrate({state: "v0.13.1", to: "202007151457"})
const windows = Object.values(next.windows)
for (const win of windows) {
// @ts-ignore
for (const tab of win.sta... |
#!/bin/bash
#
# Copyright (c) 2018-2020 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
yq_path="/usr/local/bin/yq"
yq_pkg="github.com/mikefarah/yq"
goos="linux"
case "$(uname -m)" in
aarch64) goarch="arm64";;
ppc64le) goarch="ppc64le";;
x86... |
<reponame>liu-a-wei/geekbang-lessons
package org.geektimes.configuration.microprofile.config;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import org.eclipse.microprofile.config.Config;
import org.eclipse.microprofile.config.ConfigValue;
import org.eclipse.m... |
<gh_stars>1-10
package math;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.HashMap;
/**
*
* @author exponential-e
* 백준 10425번: 피보나치 인버스
*
* @see https://www.acmicpc.net/problem/10425/
*
*/
public class Boj10425 {
private static final BigInteg... |
/*
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/li... |
;(async () => {
console.log('Heya!')
const users = await fetchUsers()
function start() {
const searchForm = document.querySelector('#nameSearch')
const searchInput = searchForm.querySelector('#searchInput')
const searchButton = searchForm.querySelector('#searchButton')
clean... |
<filename>lib/leafy/field.rb
# frozen_string_literal: true
require 'securerandom'
module Leafy
class Field
attr_accessor :id, :name, :type, :metadata
def initialize(attributes = {})
raise ArgumentError, "attributes is not a Hash" unless attributes.is_a?(Hash)
attributes = Leafy::Utils.symbolize_... |
<reponame>amoylel/NCUI
// Created by amoylel on 30/08/2018.
// Copyright (c) 2018 amoylel All rights reserved.
#ifndef AMO_CONSOLE_SINKS_D2328EDB_0E61_46AA_95AF_A14D6917552A_H__
#define AMO_CONSOLE_SINKS_D2328EDB_0E61_46AA_95AF_A14D6917552A_H__
#include <spdlog/details/null_mutex.h>
#include <spdlog/sinks/base_si... |
#!/bin/bash
g++ -fvisibility=hidden -O3 -ffast-math -fPIC -Wl,-Bstatic -Wl,-Bdynamic -Wl,--as-needed -shared -pthread `pkg-config --cflags lv2` -lm `pkg-config --libs lv2` src/lv2/lv2OvenMit.cpp -o builds/lv2/linux64/OvenMit.so
## Common usage for quick testing, (assuming the output .so is already linked on the syst... |
package surprise;
import java.util.Random;
public class FortuneCookie implements ISurprise{
private String fortune;
private static String[] zicale = {"Norocul vine când ai cel mai tare nevoie de el.",
" Ochiul altuia vede mai exigent decât al tău. ",
" Cum îţi vei aşterne, aşa ... |
package joist.domain.orm.queries;
import java.util.ArrayList;
import java.util.List;
import joist.domain.DomainObject;
import joist.domain.exceptions.NotFoundException;
import joist.domain.exceptions.TooManyException;
import joist.domain.orm.mappers.DataTransferObjectMapper;
import joist.domain.orm.mappers.DomainObje... |
<gh_stars>0
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "Lic... |
package com.lnquy.kafka.connect.source;
import org.apache.kafka.common.config.AbstractConfig;
import org.apache.kafka.common.config.ConfigDef;
import java.util.Map;
public class MySourceConfig extends AbstractConfig {
private static final String SOME_CONF = "source_config.some_conf";
private static final S... |
App . AddChild ( ' admin ' , {
EL : ' .admin ' ,
eventos : {
' Clic .project-admin-menú ' : " toggleAdminMenu " ,
},
toggleAdminMenu : función ( evento ) {
var enlace = $ ( evento . objetivo );
este . $ desplegable = enlace . progenitor (). próxima ( ' nav ' );
$ ( ' W - abierta ' ). No... |
def hex_to_dec(hex):
# convert the hexadecimal string to a decimal integer
dec_val = int(hex, 16)
return dec_val
# driver code
if __name__ == '__main__':
hex = '5F'
print("Decimal Equivalent of", hex, "is", hex_to_dec(hex))
# Output: Decimal Equivalent of 5F is 95 |
def maximumProfit(arr):
max_profit = 0
for i in range(len(arr)-1):
for j in range(i+1, len(arr)):
if arr[j] - arr[i] > max_profit:
max_profit = arr[j] - arr[i]
return max_profit
prices = [90, 80, 70, 100, 85]
print(maximumProfit(prices)) |
package nusmv_counterexample_visualizer.formula.arithmetic;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* Created by buzhinsky on 11/20/17.
*/
public class Variable extends ArithmeticExpression {
public Variable(String name) {
super(name);
}
... |
import sys
import os
class suppress_output:
def __enter__(self):
"""Redirects the standard output to a file"""
self.original_stdout = sys.stdout
self.null_output = open(os.devnull, 'w')
sys.stdout = self.null_output
def __exit__(self, exc_type, exc_value, traceback):
""... |
#!/bin/bash
PARAMS=('-m 6 -q 70 -mt -af -progress')
if [ $# -ne 0 ]; then
PARAMS=$@;
fi
cd $(pwd)
shopt -s nullglob nocaseglob extglob
for FILE in static/img/avatars/{andrea,dave,bambam,elke,fabrizio,iris,marco,mattia,max,pascal,paul,serge,urban,warwara}.png; do
cwebp $PARAMS "$FILE" -o "${FILE%.*}".webp;
... |
def closest(arr, num):
closest_val = None
for i in arr:
diff = abs(i - num)
if closest_val is None or diff < closest_val:
closest_val = i
return closest_val
closest(arr, num) # returns 15 |
<gh_stars>0
/**
* Licensed to Jasig under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Jasig licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file
* ... |
class JSONRequest: HTTPRequest {
override init() {
super.init()
headers["Content-Type"] = "application/json"
}
} |
package com.wpisen.trace.server.dao.entity;
import java.util.Date;
public class ClientProjectBinding {
private Integer bindId;
private Integer clientId;
private Integer proId;
private String platform;
private Date createTime;
private Date lastUpdateTime;
private Boolean disable;
... |
<gh_stars>0
define(["require", "exports", "react", "ting"], function (require, exports, React, ting_1) {
"use strict";
var btnStyle = { marginRight: "10px" };
return function () { return React.createElement("article", null,
React.createElement("h2", null, "\u5747\u5300\u5206\u914D"),
React.c... |
<reponame>davidguttman/dynamodown<filename>example/index.js
var DynamoDOWN = require('../')
var levelup = require('levelup')
var db = levelup('table_name', {
db: DynamoDOWN,
// required AWS config
dynamo: {
// Capacity can be specified, these are the defaults:
ProvisionedThroughput: {
ReadCapacity... |
<gh_stars>0
package sunset.gitcore.database;
public class NotSupportedException extends Exception {
private static final long serialVersionUID = -6174099601531724695L;
public NotSupportedException(String message) {
super(message);
}
}
|
sudo docker build -t tf_colmap:latest .
sudo nvidia-docker run -it --rm -p 9999:8888 --volume /:/host --workdir /host$PWD tf_colmap bash |
import ModuleFileServer from '../../server/modules/File/ModuleFileServer';
import IVendorGeneratorOptions from './IVendorGeneratorOptions';
export default class VendorBuilder {
public static getInstance(): VendorBuilder {
if (!VendorBuilder.instance) {
VendorBuilder.instance = new VendorBuilde... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.socialForrst = void 0;
var socialForrst = {
"viewBox": "0 0 512 512",
"children": [{
"name": "path",
"attribs": {
"d": "M256,0C114.609,0,0,114.609,0,256s114.609,256,256,256s256-114.609,256-256S397.391,0,256,0z M256... |
def fibonacci(n):
a = 0
b = 1
series = [0, 1]
for i in range(2, n):
c = a + b
series.append(c)
a = b
b = c
print(fibonacci(10)) # Output: [0, 1, 1, 2, 3, 5, 8, 13, 21, 34] |
<reponame>TheSeven/refinedstorage<filename>src/main/java/refinedstorage/container/ContainerDetector.java
package refinedstorage.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import refinedstorage.container.slot.SlotSpecimenTyp... |
# Use a convolutional neural network to create an AI algorithm to predict whether a given ECG signal is normal or abnormal
# Step 1: Prepare and load the ECG data
# Step 2: Pre-process the data by segmenting and normalizing the signal
# Step 3: Design the Convolutional Neural Network
# Step 4: Train and evaluate th... |
// Code generated by counterfeiter. DO NOT EDIT.
package fakes
import (
"sync"
"github.com/pivotal-cf/om/api"
)
type BoshDiffService struct {
DirectorDiffStub func() (api.DirectorDiff, error)
directorDiffMutex sync.RWMutex
directorDiffArgsForCall []struct {
}
directorDiffReturns struct {
result... |
/*
* Copyright 2009-2012 The MyBatis Team
*
* 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 requ... |
<reponame>geeekblog/blog
package models
import "time"
type Artical struct {
ID string //文章ID:uuid
UserID string //用户ID: uuid
Title string //文章标题
Content string //文章内容
Tags []int //文章tag数组
Pics []string //文章图片数组
CreateTime time.Time //第一次创建时间... |
<filename>src/create.js
var Component = require("./Component")
var hook = require("./hook")
module.exports = component
function component (name, root, options) {
// component("string"[, {}])
if (!(root instanceof Element)) {
options = root
root = null
}
var element = hook.findComponent(name, root)
... |
<reponame>IonutMorariu/speakup-api<filename>controllers/chatController.js
const mongoose = require('mongoose');
const User = mongoose.model('User');
const Chat = mongoose.model('Chat');
const Message = mongoose.model('Message');
exports.startChat = async (req, res) => {
//TODO Check existing chats
const user = await... |
package com.java110.things.service.user;
import com.java110.things.entity.accessControl.HeartbeatTaskDto;
import com.java110.things.entity.accessControl.UserFaceDto;
import com.java110.things.entity.machine.MachineDto;
import com.java110.things.entity.response.ResultDto;
/**
* @ClassName IUserService
* @Description... |
<filename>lib/bosh_release_diff/commands/ui.rb
module BoshReleaseDiff::Commands
class Ui
def initialize(bosh); @bosh = bosh; end
def say(*args); @bosh.say(*args); end
def nl(*args); @bosh.nl(*args); end
end
end
|
/*
*
* Copyright (c) 2004
* <NAME>
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* F... |
<reponame>PotatoDrug/EAD-Assignment<gh_stars>0
package com.spmovy.beans;
import java.sql.Date;
public class MovieJB implements java.io.Serializable {
private int ID;
private String title;
private Date releasedate;
private String synopsis;
private int duration;
private String imagepath;
pri... |
#!/bin/bash
#
# Apache License
# Version 2.0, January 2004
# http://www.apache.org/licenses/
#
# TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
#
# 1. Definitions.
#
# "License" shall mean the terms and conditi... |
#!/bin/ash -x
#INIT
. ~/.nnl-builder/settings
#PARAMS
NAME=opkg-utils
VER=eae0d8fa44e8594aa90eadf06e5f4fbeef314509
REL=1
BUILD_DIR=$NAME-$VER
INSTALL_DIR=$NAME-root
SOURCE_DIR=$OPKG_WORK_SOURCES/$NAME
EXTERNAL_SRC_0=$NAME-$VER.tar.bz2
EXTERNAL_URL_0=http://git.yoctoproject.org/cgit/cgit.cgi/opkg-utils/snapshot
#PRE... |
<filename>test/schema.rb<gh_stars>1-10
ActiveRecord::Base.configurations = {
'active_record_schema_exporter' => {
:adapter => 'mysql',
:username => 'root',
:encoding => 'utf8',
:database => 'active_record_sql_exporter_test',
}
}
ActiveRecord::Base.establish_connection 'active_record_schema_exporte... |
scss --watch scss:css --style compressed |
<reponame>KameronJohnson/phone_book
require('rspec')
require('contact')
require('phone')
describe(Contact) do
before() do
Contact.clear()
end
describe("#contact_name") do
it("returns the contact name") do
test_contact = Contact.new("<NAME>", "503-555-1111")
test_contact.save()
expect(... |
module.exports = {
currentPage: null,
init: function(t) {
var o = this;
void 0 === (o.currentPage = t).shoppingCartListModel && (t.shoppingCartListModel = function(t) {
o.shoppingCartListModel(t);
}), void 0 === t.hideShoppingCart && (t.hideShoppingCart = function(t) {
... |
<gh_stars>0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0-devel
// protoc v3.14.0
// source: common/common.proto
package common
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect ... |
// JavaScript program to calculate the number of characters, words and sentences in a text
let text = "The quick brown fox jumps over the lazy dog";
let countCharacters = text.length;
let countWords = text.split(" ").length;
let countSentences = text.split(/[.]+/).length-1;
console.log("Number of Characters: " + coun... |
def updateRupeeContainer(rupeeContainer, qte, playerHUD):
next_rupee = rupeeContainer['rupee'] + qte
if next_rupee > rupeeContainer['maxRupee']:
rupeeContainer['rupee'] = rupeeContainer['maxRupee']
else:
rupeeContainer['rupee'] = next_rupee
playerHUD.updateRupee() |
<reponame>paulhoughton/preact-pwa<filename>src/Routes.js
import { h } from "preact";
import AsyncRoute from "preact-async-route";
const ROUTES = [
{
path: "/",
title: "Home",
router: () => import("./components/Home.js").then(m => m.default)
},
{
path: "/about",
title: "About",
... |
import * as tslib_1 from "tslib";
import { MidSideEffect } from "../effect/MidSideEffect";
import { Signal } from "../signal/Signal";
import { Multiply } from "../signal/Multiply";
import { Subtract } from "../signal/Subtract";
import { optionsFromArguments } from "../core/util/Defaults";
import { readOnly } from "../c... |
package cyclops.stream.spliterator.push.filter;
import cyclops.stream.spliterator.push.AbstractOperatorTest;
import cyclops.stream.spliterator.push.ArrayOfValuesOperator;
import cyclops.stream.spliterator.push.FilterOperator;
import cyclops.stream.spliterator.push.Fixtures;
import cyclops.stream.spliterator.push.Opera... |
package com.io.routesapp;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.TextView;
import com.google.android.material.navigation.NavigationView;
import com.io.ro... |
# -*- coding: utf-8 -*-
import abc
import argparse
import gc
import os
from pathlib import Path
from typing import Callable, Dict, List, Tuple
import numpy as np
import pandas as pd
import torch
import wandb
from rich.progress import (BarColumn, Progress, TaskID, TextColumn,
TimeRemainingCo... |
# Copyright dunnhumby Germany GmbH 2017.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
# Utility library to use in scripts
# This function installs packages with specific versions and also pin them
# (with prio 990... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.