text stringlengths 1 1.05M |
|---|
function calculateRemainingDays($domainId) {
// Retrieve the SSL expiration time for the specified domain from the database
$domain = Domain::find($domainId);
if ($domain) {
// Calculate the remaining days until SSL expiration
$currentTimestamp = time();
$sslExpirationTimestamp ... |
import React, { Component } from 'react';
class Counter extends Component {
constructor() {
super();
this.ts = new Date().toLocaleString();
}
//componentWillUnmount ==> componentWillMount ==> componentDidMount
componentWillUnmount() {
// console.log(this.ts + ' componentWillUn... |
package cn.celess.blog.entity.model;
import cn.celess.blog.entity.Tag;
import lombok.Getter;
import lombok.Setter;
import java.util.List;
/**
* @author : xiaohai
* @date : 2019/04/23 12:02
*/
@Getter
@Setter
public class ArticleModel {
private Long id;
/**
* 标题
*/
privat... |
#!/bin/bash
. ./setup.sh
make clean
make
|
from dataclasses import dataclass
from typing import List
import httpx
from pydantic import BaseModel
API_BASE = "https://deckofcardsapi.com/api"
class NewDeckResponse(BaseModel):
success: bool
deck_id: str
remaining: int
shuffled: bool
class CardImagesResponse(BaseModel):
svg: str
png: st... |
mkdir trained_models
cd trained_models
mkdir cifar10
cd cifar10
# Barlow Twins
mkdir barlow_twins
cd barlow_twins
gdown https://drive.google.com/uc?id=1x7y44E05vuobibfObT4n3jqLI8QNVESV
gdown https://drive.google.com/uc?id=1Mxfq2YGQ53bNRV2fNYzvYIneM5ZGeb2h
cd ..
# BYOL
mkdir byol
cd byol
gdown https://drive.google.com... |
"""Sensor platform for the GitHub integration."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from aiogithubapi import GitHubRepositoryModel
from homeassistant.components.sensor import (
SensorEntity,
SensorEntityDescription,
SensorSt... |
<reponame>asheerrizvifhm9j/Arsylk<gh_stars>0
package com.arsylk.mammonsmite.Live2D;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import net.rbgrn.android.glwallpaperservice.GLWallpaperService;
public class LiveWallpaperService extends GLWallpaperService {
private static LiveWallpaperService... |
<gh_stars>0
/**
*
*/
package de.unirostock.sems.bives.webservice.client;
import java.util.List;
/**
* The Class BivesComparisonRequest to compare two versions using BiVeS web service.
*
* @author martin
*/
public class BivesComparisonRequest extends BivesRequest implements BivesComparisonCommands
{
/**
* ... |
#! /bin/bash
if [ ! -f db.sqlite3 ]; then
cat example_db.sql | sqlite3 db.sqlite3
echo 'db.sqlite3 created'
fi
python manage.py runserver
|
<reponame>pharmer/openshift<gh_stars>100-1000
/*
Copyright AppsCode Inc. and Contributors
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... |
<filename>app/src/main/java/sample/listup/com/listupsample/activity/ListAllBookActivity.java<gh_stars>1-10
package sample.listup.com.listupsample.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.ListView;
import android.widget.Toast;
i... |
package inmem
import (
"reflect"
"sync"
"time"
"github.com/armon/relay"
"github.com/armon/relay/broker"
)
// InmemBroker implements the Broker interface in-memory
type InmemBroker struct {
Closed bool
Queues map[string][]interface{}
lock sync.RWMutex
}
// InmemConsumer implements the Consumer interface
typ... |
def factorial(n):
result=1
for i in range(2,n + 1):
result = result * i
return result |
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.google.gson.Gson;
@WebServlet("/myServlet")
public class MyServl... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.curso.lambdas.interfaces;
import java.util.Arrays;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
... |
#!/bin/bash
sudo apt-get update
sudo apt-get --assume-yes install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo su -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.li... |
#!/bin/bash
. ./script/util.sh
pull_from_master_bridge() {
CURRENT_BRANCH="$(get_current_branch)"
echo_msg "current branch is: $CURRENT_BRANCH"
check_if_remote_exists $remote_for_sync
remote_exists_code=$?
check_if_branch_exists $remote_bridge_branch
remote_bridge_branch_exists_code=$?
check_if_branc... |
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine-jquery', 'jasmine', 'sinon'],
files: [
'node_modules/lodash/lodash.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/angular/angular.min.js',
'angular-test-runner.js',
'test/**/*.js'
... |
<gh_stars>0
def Welcome():
return '''
\ \ / /__| | ___ ___ _ __ ___ ___
\ \ /\ / / _ \ |/ __/ _ \| _ ` _ \ / _ |
\ V V / __/ | (_| (_) | | | | | | __/
\_/\_/ \___|_|\___\___/|_| |_| |_|\___|
______________________
< PDF Metadata Locator >
----------------------
\... |
<gh_stars>0
//import apiLinks from '../vue-app/src/constants/apiLinks' ;
const axios = require('axios');
var express = require('express')
var router = express.Router()
const FormData = require('form-data');
const docparser = require('docparser-node');
const secretAPIKey = '<KEY>';
const client = new docparser.Client(... |
from django import forms
from django.core.exceptions import ValidationError
import ipaddr
from cyder.base.constants import IP_TYPES, IP_TYPE_4, IP_TYPE_6
from cyder.base.eav.forms import get_eav_form
from cyder.base.eav.models import Attribute
from cyder.base.mixins import UsabilityFormMixin
from cyder.cydhcp.network... |
import Library from "~/views/Library";
export default Library;
|
#!/bin/bash
#SBATCH --exclude=hermes[1-4],trillian[1-3],artemis[1-7],qdata[1-8],nibbler[1-4],slurm[1-5]
#SBATCH --output=granger/60_nodes/script_59_246_250.out
#SBATCH --error=granger/60_nodes/script_59_246_250.err
#SBATCH --job-name="246-250"
hostname
date +%s%N
time blender -t 1 -b Star-collapse-ntsc.blend -s 246 -e ... |
const express = require("express");
const router = express.Router();
const { Company } = require("../models/Company.js");
const { Member } = require("../models/Member.js");
router.get("/all", async (req, res) => {
console.log("---get all companies---");
Company.find()
.then((companys) => {
if (!companys)... |
package Longest_Harmonious_Subsequence;
import java.util.*;
public class Solution {
public int findLHS(int[] nums) {
HashMap<Integer, Integer> map = new HashMap<>();
for (int i: nums){
map.put(i, map.getOrDefault(i, 0) + 1);
}
int res = 0;
for (int key: map.ke... |
#!/bin/bash
cd /app/layer-php-sdk
function test {
PHP="php-$1"
$PHP bin/phpspec run
}
for version in 5.4 5.5 5.6; do
echo "Testing PHP $version"
test $version
done |
<gh_stars>1-10
// Generated by script, don't edit it please.
import createSvgIcon from '../../createSvgIcon';
import CaretDownSvg from '@rsuite/icon-font/lib/legacy/CaretDown';
const CaretDown = createSvgIcon({
as: CaretDownSvg,
ariaLabel: 'caret down',
category: 'legacy',
displayName: 'CaretDown'
});
export ... |
<gh_stars>0
/*
* $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/WebRuleSet.java,v 1.1 2001/10/17 00:44:02 craigmcc Exp $
* $Revision: 1.1 $
* $Date: 2001/10/17 00:44:02 $
*
* ====================================================================
*
* The Apache Software License... |
package main
import (
"fmt"
"log"
"github.com/boltdb/bolt"
"github.com/labstack/echo"
"github.com/spf13/viper"
)
var db *bolt.DB
func main() {
var dbErr error
viper.SetConfigName("nucleus")
viper.AddConfigPath("$HOME/.nucleus")
viper.AddConfigPath(".")
err := viper.ReadInConfig()
if err != nil {
panic(... |
#!/bin/bash
sudo rm -rf WeexiOSSDK/
sudo rm -rf Benmu-iOS-Library/
#sudo rm -rf Podfile.lock
#sudo rm -rf Pods/
git clone https://github.com/bmfe/WeexiOSSDK.git
#cd WeexiOSSDK
#git checkout 0.18.0
#cd ../
git clone https://github.com/bmfe/Benmu-iOS-Library.git
cd Benmu-iOS-Library
git checkout feature-components
po... |
# Launch the HOL Light checkpoint then load code from our project on top.
cat scripts/prover_ready.ml - | ./hol-light/dmtcp_restart_script.sh
|
TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/
TERMUX_PKG_DESCRIPTION="X11 miscellaneous 'fixes' extension library"
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_MAINTAINER="Leonid Pliushch <leonid.pliushch@gmail.com>"
TERMUX_PKG_VERSION=5.0.3
TERMUX_PKG_REVISION=17
TERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/indi... |
#!/bin/bash
## with set -e in force, I expect a loop to abandon the whole script if
## a command inside the loop exits with non-zero. In MSys, the loop
## exits, but the script continues to success.
function exit_handler
{
echo exit_status $?
echo done
}
trap exit_handler EXIT
function nonzero_return_funct... |
package org.n3r.eql.impl;
import com.google.common.base.Joiner;
import freemarker.cache.StringTemplateLoader;
import freemarker.template.Configuration;
import freemarker.template.Template;
import org.n3r.eql.base.DynamicLanguageDriver;
import org.n3r.eql.parser.EqlBlock;
import org.n3r.eql.parser.FreemarkerSql;
import... |
#!/bin/csh
# '@(#)managedb.sh 22.1 03/24/08 1991-2005 '
#
#
# Copyright (C) 2015 University of Oregon
#
# You may distribute under the terms of either the GNU General Public
# License or the Apache License, as specified in the LICENSE file.
#
# For more information, see the LICENSE file.
#
#
set id = `id | sed -e... |
package com.ing.baker.baas.state
import akka.actor.ActorSystem
import akka.cluster.pubsub.{DistributedPubSub, DistributedPubSubMediator}
import akka.http.scaladsl.Http
import akka.http.scaladsl.model.StatusCodes
import akka.http.scaladsl.server.Directives._
import akka.http.scaladsl.server.Route
import akka.stream.Mat... |
#!/bin/bash
set -eu
image="cockroachdb/builder"
function init() {
docker build --tag="${image}" - <<EOF
FROM golang:1.5
RUN apt-get update -y && \
apt-get dist-upgrade -y && \
apt-get install --no-install-recommends --auto-remove -y git build-essential file npm nodejs && \
apt-get clean autoclean && \
apt-get... |
#!/bin/bash -eu
# Copyright 2018 Google 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 agree... |
<filename>tasks/gemspec.rake<gh_stars>1-10
require "rake/gempackagetask"
spec = Gem::Specification.new do |s|
s.name = 'datagrammer'
s.version = '0.4'
s.summary = "UDP without the pain"
s.description = "Sends and receives UDP packets in an OSC-compatable encoded format."
s.author = "... |
#!/bin/bash
#Created by Sam Gleske (sag47@drexel.edu)
#Created Thu Nov 29 16:42:12 EST 2012
#Red Hat Enterprise Linux Server release 5.5 (Tikanga)
#Linux 2.6.18-194.11.4.el5 x86_64 GNU/Linux
#JBoss EWP 5.1.0.GA
#java version "1.6.0_13"
#
#Description:
# This is an automatic deployer for a production jboss instance.
# ... |
<reponame>seidu626/vumi<filename>vumi/transports/smpp/tests/test_smpp_transport.py
# -*- coding: utf-8 -*-
import logging
from twisted.internet.defer import inlineCallbacks, returnValue
from twisted.internet.task import Clock
from smpp.pdu_builder import DeliverSM, SubmitSMResp
from vumi.config import ConfigError
fr... |
<reponame>FreeeBird/blog_admin
import request from '../utils/request';
const URL = '/admin/statistics'
export function fetchStat() {
return request({
url: URL,
method: 'GET',
})
}
/**
* 获取所有分类
* @returns {AxiosPromise}
*/
export function fetchDaily(){
return request({
url: URL ... |
<filename>packages/ts-tool-type-starter/src/index.ts
console.log("ts-tool-type-starter is ready!");
|
#!/bin/sh
cd /data
rm -rf dump
mongodump
|
from typing import List
def manageDamageSkins(skin_ids: List[int]) -> None:
"""
Adds the specified damage skins to the player's collection and prints a message for each skin added or failed to add.
Args:
skin_ids (List[int]): A list of unique identifiers of the damage skins to be added.
R... |
<reponame>JohnCKangwa/RingedOrb<filename>RingedOrb/User Mode/roUserComponent.cpp
#include "roUserComponent.h"
#include "..\Graphics\GUI\roGUIData.h"
#include "..\Core\roWindow.h"
#include "..\Core\roFileSystem.h"
roUserComponent::roUserComponent(roEventQueue* eventQueue) : roEventNode(eventQueue) {
roEventNode::Subsc... |
public class Employee {
private String name;
private int salary;
public Employee(String name, int salary){
this.name = name;
this.salary = salary;
}
public String getName() {
return name;
}
public int getSalary() {
return salary;
}
public void setName(String name) {
thi... |
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-rare/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+512+512-rare/512+512+512-old-256 --do_eval --per_device_eval... |
<reponame>bencmbrook/compat
#! /usr/bin/env node
let yargs = require('yargs')
let fs = require('fs')
let os = require('os')
let path = require('path')
let compat = require('./compat.js')
let output = require('./output.js')
let createTable = require('./tableUpdater/createTable.js')
const argv =
yargs
.alias({
... |
<filename>src/main/java/malte0811/controlengineering/logic/clock/ClockTypes.java
package malte0811.controlengineering.logic.clock;
import malte0811.controlengineering.ControlEngineering;
import malte0811.controlengineering.items.CEItems;
import malte0811.controlengineering.util.typereg.TypedRegistry;
import net.minecr... |
#!/bin/bash -xe
gcloud compute networks create jenkins --subnet-mode auto
gcloud container clusters create jenkins-cd \
--machine-type n1-standard-2 \
--num-nodes 2 \
--network jenkins \
--scopes "https://www.googleapis.com/auth/projecthosting,storage-rw" \
--cluster-versi... |
import java.util.ArrayList;
import java.util.List;
interface PropertyEventListener {
void onPropertyEvent(String propertyName, String propertyValue);
}
class SystemPropertyManager {
private List<PropertyEventListener> listeners;
public SystemPropertyManager() {
this.listeners = new ArrayList<>();... |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... |
#!/bin/bash
sum="sha1sum"
echo "If you need reproducible build, export GO111MODULE=on first"
if ! hash sha1sum 2>/dev/null; then
if ! hash shasum 2>/dev/null; then
echo "I can't see 'sha1sum' or 'shasum'"
echo "Please install one of them!"
exit
fi
sum="shasum"
fi
UPX=false
if hash upx 2>/dev/null; then
UPX... |
loadAPI(1);
host.defineController("Novation", "Launchkey 25", "1.0", "11516a34-29d9-4126-9a79-db4be58c4c15");
host.defineMidiPorts(2, 2);
host.addDeviceNameBasedDiscoveryPair(["Launchkey 25 MIDI 1", "Launchkey 25 MIDI 2"], ["Launchkey 25 MIDI 1", "Launchkey 25 MIDI 2"]);
function init()
{
host.getMidiInPort(0).set... |
<filename>exercise tracker/exercise.js
const express = require("express");
const Users = require("../Models/user");
const router = express.Router();
const moment = require("moment");
/* adding a new user */
router.post("/new-user", async (req, res) => {
try {
const newUser = new Users({
userName: req.body... |
#!/bin/bash
# Copyright 2014 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2021, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without m... |
<reponame>godbobo/Admin
package com.aqzscn.www.global.domain.vo;
import com.aqzscn.www.global.config.validation.ValidationGroup3;
import com.aqzscn.www.global.mapper.User;
import com.fasterxml.jackson.annotation.JsonFilter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import ... |
const mysql = require('mysql2/promise');
async function main() {
const connection = await mysql.createConnection({
host: 'HOST_NAME',
user: 'USERNAME',
database: 'DATABASE_NAME',
password: 'PASSWORD'
});
// Get list of tables in the database
const [tables] = await connection.execute('SHOW TABLES');
for (cons... |
#include "App.h"
#include "Input.h"
#include "Textures.h"
#include "Audio.h"
#include "Render.h"
#include "Window.h"
#include "Scene.h"
#include "Defs.h"
#include "Log.h"
#define MARGIN 50
Scene::Scene() : Module()
{
name.Create("scene");
}
// Destructor
Scene::~Scene()
{}
// Called before render is available
boo... |
"use strict";
function rename(scope, oldName, newName) {
if (oldName === newName) {
return;
}
let binding = scope.getBinding(oldName); // Rename all constant violations
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (var _iterator... |
#!/bin/bash
if [[ "$DEV" == "iOS" ]]; then
python acpython.py "$HOME/Desktop/$APPNM.$IMGEXT" --mask
fi |
#!/bin/bash
# genconfig: Generate configuration files for the system
. /etc/alexandria-env
# TODO: Firstrun code.
TOOL="$VENVPY $ABINDIR/cfgtool.py -baseconfig ${BASECONFIG} -localconfig ${LOCALCONFIG}"
# We're going to start by configuring Debian's interface file and getting things
# set up here.
export CFGTOOL... |
import React, {Component} from 'react'
import {connect} from 'react-redux'
import {AlbumViewList, AlbumViewCard, LoadingScreen} from '../components'
import {withRouter} from 'react-router'
import {getRecs, sortAlbums, getBest} from '../store'
import Nav from 'react-bootstrap/Nav'
import NavDropdown from 'react-bootstra... |
#!/bin/sh
directory="$FLERE_IMSAHO/data/playlists/output/test-set/true-positives"
#echo "$directory"
python3 $FLERE_IMSAHO/python/generate-html.py $directory
theFile="$directory/images.html"
ls -l $theFile
head -n 10 $theFile
directory="$FLERE_IMSAHO/data/playlists/output/test-set/true-negatives"
#echo "$directory"
p... |
def pairSums(arr, k):
result_set = set()
for i in range(len(arr)):
for j in range(i + 1, len(arr)):
if arr[i] + arr[j] == k:
result_set.add((arr[i], arr[j]))
return result_set |
<reponame>meetbill/baichuan_go_worker
package gores
import (
"encoding/json"
"fmt"
"os"
)
// Config contains the configuration parameters for running Gores
type Config struct {
// Authetication for Redis connection
RedisURL string
RedisPassword string
// Maximum number of idle connections in the Redis po... |
#!/usr/bin/env bash
cd machine_learning_with_python
mkdir -p db/{migrations,queries,repositories} || true
mkdir -p models/{domain,schemas} || true
mkdir -p resources || true
mkdir -p services || true
mkdir -p downloaders || true
# EG: https://github.com/bergran/places/blob/master/apps/places/generators/places.py
mkdir... |
public static long gcd(long a, long b) {
if (a == 0 || b == 0) return a+b;
return gcd(b, a % b);
} |
def html_to_text(html_string):
output = ''
in_tag = False
for char in html_string:
if char == '<':
in_tag = True
elif char == '>':
in_tag = False
elif in_tag == False:
output += char
return output |
#!/bin/bash -x
number=
if [ "$number" = "1" ]; then
echo "Number equals 1"
else
echo "Number does not equal 1"
fi
|
#!/bin/bash
# Renames Boost to Autoboost to avoid namespace collisions
if [[ -n "$1" ]]; then
directory=$1
else
directory="."
fi
filelist=`find ${directory} -iname "*.h" -o -iname "*.cpp" -o -iname "*.hpp" -o -iname "*.ipp"`
sed -ri 's/([^\.o])boost/\1autoboost/g' ${filelist}
sed -ri 's/([^\.O])BOOST/\1AUTOBOOS... |
import { Component, OnInit, OnDestroy, Injectable } from '@angular/core';
import { Router } from '@angular/router';
import { Response } from '@angular/http';
import { DataTable, Column, Header, Footer} from 'primeng/primeng';
import { LazyLoadEvent } from 'primeng/primeng';
import { Message, Growl } from 'primeng/prim... |
<reponame>blinkcat/LeetCode
/**
* @param {string[][]} equations
* @param {number[]} values
* @param {string[][]} queries
* @return {number[]}
*/
var calcEquation = function(equations, values, queries) {
// 存储根和子孙。e.g a->b->c {c:a, b:a}
const root = new Map();
// 存储子孙到根的值,或者说权重。e.g a/b=2.0, b/c=3.0... |
// Define the AutocompleteProvider protocol
protocol AutocompleteProvider {
// Define the method for providing autocomplete suggestions
func suggestions(for prefix: String) -> [String]
}
// Implement the AutocompleteSuggestionProvider protocol using the typealias
extension AutocompleteSuggestionProvider {
... |
package com.devin.client.mysise.model.parse;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.devin.client.mysise.model.base.WebBody;
import com.devin.client.mysise.model.bean.DetailSubject;
import com.devin.client.mysise.model.bean.OpenSubject;
import com.... |
export * from './BoxCollider';
export * from './SweptBoxCollider';
|
<gh_stars>0
package com.example.myshoppingmall;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import java.util.List;
public class MyRewardsAdapter exte... |
import numpy as np
from sklearn import linear_model
house_features = [[1050, 3, 1], [1350, 5, 2], [1500, 4, 2]]
target_prices = [750, 1000, 950]
model = linear_model.LinearRegression()
model.fit(house_features, target_prices) |
<gh_stars>1-10
'use strict'
const SLACK = require('slack')
const HDB = require('hearthstone-db');
const _ = require('lodash')
const CONFIG = require('./config')
const BOT = SLACK.rtm.client()
BOT.started((payload) => {
this.self = payload.self
})
BOT.message((msg) => {
let msgPost = 'We must cleanse the Sunwell... |
// https://open.kattis.com/problems/toilet
#include <iostream>
using namespace std;
typedef unsigned char u8;
int main() {
string s;
cin >> s;
int c = 0;
u8 status = s[0];
for (int i = 1; i < s.size(); i++) {
if (status != s[i]) {
c++;
}
if (s[i] != 'U') {
c++;
}
status = 'U';
}
cout << c << e... |
module Capcoauth
module OAuth
class TTLCache
def self.user_id_for(access_token)
store.fetch(key_for(access_token))
end
def self.update(access_token, user_id)
store.write(key_for(access_token), user_id, expires_in: Capcoauth.configuration.token_verify_ttl)
end
def s... |
#ifndef PARTICLE_RPSO_H
#define PARTICLE_RPSO_H
#include<vector>
#include"Particle.h"
#include"PSO_RPSO.h"
#include"PSO.h"
using namespace std;
class Particle_RPSO : public Particle
{
private:
float dLow, dHigh, w, c1, c2, cN;
public:
Particle_RPSO(int numberOfFeatures) : Particle(numberOfFeatures)
{}
virtual voi... |
#!/bin/sh
npm run build
REMOTE_ARTIFACT="nickw444/docker-ui"
PACKAGE_VERSION=$(cat package.json | jq -r '.version')
docker build -t "$REMOTE_ARTIFACT:$PACKAGE_VERSION" .
docker tag "$REMOTE_ARTIFACT:$PACKAGE_VERSION" "$REMOTE_ARTIFACT:latest"
docker push "$REMOTE_ARTIFACT:latest"
docker push "$REMOTE_ARTIFACT:$PACKAGE_... |
import {Protocol} from 'devtools-protocol';
import {NodeRef, getNodeRefFromBackendId} from './node_ref';
import {CDPSession, Page, JSHandle} from 'puppeteer';
/**
* Gets strings containing the HTML markup for the Nodes used to compute
* the accessible name for NodeRef.
* @param nodeRef - Reference to Node whose nam... |
#!/bin/sh
{
CACHE_VERSION_FILE=./test/baseline/.cache/version.json
if [ -f "$CACHE_VERSION_FILE" ]; then
HAS_DIFF=$(git diff --name-only main:test/baseline/version.json $CACHE_VERSION_FILE)
if [[ ${HAS_DIFF} == "" ]]; then
exit 0
fi
fi
echo "~~~~~~~~~~~~~~~~~~~Update Baseline Start~~~~~~~~~~~~... |
<filename>annotation/annotation-processing/src/main/java/com/serenity/annotation/processor/StepDataProcessor.java
package com.serenity.annotation.processor;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.processing.*;
import javax... |
#!/bin/bash
cd `dirname $0`
cd ..
HOME=`pwd`
export DWS_ENGINE_MANAGER_HOME=$HOME
export DWS_ENGINE_MANAGER_PID=$HOME/bin/linkis-enginemanager.pid
if [[ -f "${DWS_ENGINE_MANAGER_PID}" ]]; then
pid=$(cat ${DWS_ENGINE_MANAGER_PID})
if kill -0 ${pid} >/dev/null 2>&1; then
echo "Dataworkcloud Database is a... |
<reponame>acvos/hyperlane<gh_stars>10-100
export const eq = (x, y) => x === y
export const neq = (x, y) => x !== y
export const gt = (x, y) => x > y
export const lt = (x, y) => x < y
export const gte = (x, y) => x >= y
export const lte = (x, y) => x <= y
export const i... |
#!/bin/sh
for var in "$@"
do
for model in "classroom" "cv" "graphs" "lts" "production" "trash"
do
mkdir -p split/$model
grep "${model}" $var > split/$model/$var
done
done
|
<gh_stars>0
package pe.com.optical.middleware.crm.domain.composite;
import java.io.Serializable;
import java.util.Objects;
public class DocumentoTareaPostVentaId implements Serializable {
private static final long serialVersionUID = -7468961223715973189L;
private Long tareaPostVenta;
private Long documento;
pu... |
package com.example.licio.moringaeats.ui;
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
import android.os.Bu... |
<gh_stars>1-10
import fs from 'fs';
import path from 'path';
import { spawn, ChildProcessWithoutNullStreams } from 'child_process';
import _ from 'lodash';
import Stopwatch from '../stopwatch';
import { getSettings } from '../config';
import StringBuffer from '../stringBuffer';
import * as triggerLoader from './trigger... |
// Profile.h
//
// The viewer profile enum.
//
// Copyright (c) 2022 <NAME>.
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby
// granted, provided that the above copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVI... |
package fpinscala.datastructures
import org.scalatest.{FlatSpec, Matchers}
class TreeSpec extends FlatSpec with Matchers {
// Exercise 25
"A Tree" should "calculate the size of Leaf as 1" in {
val leaf = Leaf("A")
Tree.size(leaf) shouldBe 1
Tree.size2(leaf) shouldBe 1
}
it should "calculate the... |
#!/usr/bin/env bash
#
# Copyright (c) 2022: Jacob.Lundqvist@gmail.com
# License: MIT
#
# Part of https://github.com/jaclu/man_asdf
#
# Version: 1.0.2 2022-04-14
#
# Does shellcheck on all relevant scripts in this project
#
# shellcheck disable=SC1007
CURRENT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
cd "... |
import {Component, Input, OnInit} from '@angular/core';
import { ApiService } from '../../services/api.service';
import { AuthService } from '../../services/auth.service';
@Component ({
selector: 'comments-view',
templateUrl: './comments-view.component.html',
styleUrls: ['./comments-view.component.scss']
}... |
package br.com.scgf.squarecrazygame.service;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import androidx.annotation.RequiresApi;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.