text stringlengths 1 1.05M |
|---|
<gh_stars>0
export var multi1 = [
{
"name": "usedslot",
"series": [
{
"name": "7am",
"value": 10
},
{
"name": "8am",
"value": 16
},
{
"name": "9am",
"value": 23
},
{
"name": "10am",
"value": 24
},
... |
#include "tg078uw004a0.h"
extern s32 bsp_disp_get_panel_info(u32 screen_id, disp_panel_para *info);
static void lcd_power_on(u32 sel);
static void lcd_power_off(u32 sel);
static void lcd_backlight_open(u32 sel);
static void lcd_backlight_close(u32 sel);
static void lcd_panel_init(u32 sel);
static void lcd_panel_exit(... |
#!/bin/bash
FN="pd.margene.1.0.st_3.12.0.tar.gz"
URLS=(
"https://bioconductor.org/packages/3.14/data/annotation/src/contrib/pd.margene.1.0.st_3.12.0.tar.gz"
"https://bioarchive.galaxyproject.org/pd.margene.1.0.st_3.12.0.tar.gz"
"https://depot.galaxyproject.org/software/bioconductor-pd.margene.1.0.st/bioconductor-... |
package com.java.study.zuo.vedio.basic.chapter3;
/**
* <Description>
*
* @author hushiye
* @since 2020-08-22 15:48
*/
public class MatrixPrint {
public static void print(int[][] arr) {
if (arr == null || arr.length == 0) {
return;
}
//左上点坐标
int lR = 0;
int... |
const constant = require("./constant.js");
const storage = require("./storage.js");
function isPhone(phone) {
if (!(/^1(3|4|5|7|8)\d{9}$/.test(phone))) {
return false;
}
return true;
}
function showSuccessToast(config) {
wx.showToast({
title: config.title,
icon: 'success',
... |
var classarmnn_1_1profiling_1_1_profiling_state_machine =
[
[ "ProfilingStateMachine", "classarmnn_1_1profiling_1_1_profiling_state_machine.xhtml#a419c19ff2c798aab55b0789e051517d7", null ],
[ "ProfilingStateMachine", "classarmnn_1_1profiling_1_1_profiling_state_machine.xhtml#aa89f70de19b6fb3a6ed4cea36890d9ab", ... |
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "Please run as root" 1>&2
exit 1
fi
progname=$(basename $0)
function usage()
{
cat << HEREDOC
Usage:
Mount Image : $progname [--mount] [--image-name <path to qcow2 image>] [--mount-point <mount point>]
Umount Image: $progname [--umount] [--mount-point <mo... |
def findSubset(arr, target):
# create a 2D matrix
T = [[False for x in range(target + 1)] for x in range(len(arr) + 1)]
# if target is 0, return true
for i in range(len(arr) + 1):
T[i][0] = True
# if target is not 0 and set is empty
# return false
for i in range(1, ta... |
SELECT name, count
FROM Fruits
ORDER BY count DESC
LIMIT 10; |
#!/bin/bash
echo Which file do you want to post?
read -e -p "Post:" file
file="${file}.Rmd"
post=${file//.Rmd}
markdown="${post}.md"
header="${post}-header.md"
echo Do you want to add a header? Enter y or n
read header_y_n
if [ $header_y_n == "y" ]
then
cp $header temp_post.md
cat $markdown >> temp_post.md
mv tem... |
import random
def random_num(start, stop):
return random.randint(start, stop)
# Example
num = random_num(0, 10)
print(num) |
#!/bin/bash
echo "=============== MINIBOT GUI SETUP ================"
pip install -r requirements.txt
cd gui
npm install
echo "================= SETUP COMPLETE ================="
|
package com.wgu.setcard.ump.service.impl;
import java.util.Objects;
import java.util.Optional;
import com.google.common.collect.ImmutableMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.wgu.setcard.ump.model.User;
import com.wgu.setcard.um... |
<reponame>MccreeFei/jframe
package jframe.pay.wx.http.util;
import java.util.Random;
import jframe.pay.wx.http.AccessTokenRequestHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class WxUtil {
static Logger LOG = LoggerFactory.getLogger(WxUtil.class);
public static String g... |
require "rails/generators/active_record"
module PgAuditLog
module Generators
class InstallGenerator < ::ActiveRecord::Generators::Base
# ActiveRecord::Generators::Base inherits from Rails::Generators::NamedBase which requires a NAME parameter for the
# new table name. Our generator doesn't require a ... |
<filename>QUBEKit/tests/ligand_tests.py
from QUBEKit.ligand import Ligand
import unittest
class TestLigands(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.molecule = Ligand('tests/test_files/acetone.pdb')
def test_pdb_reader(self):
# Check all atoms are found
self.as... |
<gh_stars>0
import React, { useState, useRef, useEffect } from "react";
import { useNavigate, useParams } from "react-router-dom";
import avatar from "../assets/avatars/sample-6.png";
import { Document, Page, pdfjs } from "react-pdf/dist/esm/entry.webpack5";
import Button from "../components/Button";
import ButtonTrans... |
function randomPassword(length) {
let chars = "abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>ABCDEFGHIJKLMNOP1234567890";
let pass = "";
for (let x = 0; x < length; x++) {
let i = Math.floor(Math.random() * chars.length);
pass += chars.charAt(i);
}
return pass;
}
console.log(randomPassword(5)); |
<reponame>guokaia/HJ212-Moniter<filename>src/main/java/cn/zqgx/moniter/center/server/portal/mapper/MoniterErrorMapping.java<gh_stars>1-10
package cn.zqgx.moniter.center.server.portal.mapper;
import cn.zqgx.moniter.center.server.portal.bean.po.MoniterErrorPo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
impo... |
function typeCheck(obj) {
for (let key in obj) {
if (typeof obj[key] !== typeof obj[key]) {
return false;
}
}
return true;
} |
const adjectives = ["big","small","tall","dark","light","fast","slow","powerful","weak","happy","sad"];
const nouns = ["cat","dog","monkey","elephant","pigeon","sea lion","dolphin","lizard","whale","dragon"];
let randomAdjective = adjectives[Math.floor(Math.random() * adjectives.length)];
let randomNoun = nouns[Math.... |
#!/usr/bin/env bash
GUNICORN_WORKERS=${GUNICORN_WORKERS:-"5"}
GUNICORN_WORKER_CLASS=${GUNICORN_WORKER_CLASS:-"gevent"}
GUNICORN_WORKER_CONNECTIONS=${GUNICORN_WORKER_CONNECTIONS:-"2000"}
GUNICORN_BACKLOG=${GUNICORN_BACKLOG:-"1000"}
# Needed to allow utf8 use in the Monasca API
export PYTHONIOENCODING=utf-8
gunicorn -... |
#!/bin/bash
cd /home/ram16/epaxos/src/server
IP=`ip addr show eth0 | grep 'inet ' | cut -d ' ' -f 8`
CMD="go run server.go -maddr $1 -addr $IP -e -exec -dreply -app $2"
echo $CMD
$CMD
# To Kill Servers using pssh
# run pgrep -l server to see which processes show up (make sure they are correct)
# run pkill server
|
#!/bin/bash
echo " Entre com numero"
read count
if [ $count -eq 100 ]
then
echo " conta e 100"
elif [ $count -gt 100 ]
fi
|
package org.terracottamc.network.packet.type;
/**
* Copyright (c) 2021, TerracottaMC
* All rights reserved.
*
* <p>
* This project is licensed under the BSD 3-Clause License which
* can be found in the root directory of this source tree
*
* @author Kaooot
* @version 1.0
*/
public class ResourcePackEntry {
... |
<filename>src/test/scala/com/tzavellas/coeus/validation/vspec/constraint/CreditCardConstraintTest.scala
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Ported from Apache Jakarta Commons Validator,
* http://commons.apache.org/validator/
*
* Author: <NAM... |
//
// EEPROM` в FLASH для сохранения настроек (pvvx Ver 1.0)
// Циклически использует область в 1024 байт (страницу) во Flash MCU
// для сохранения блока конфигурации
//
#ifndef __RW_FLASH_INI_H
#define __RW_FLASH_INI_H
#include "stm32f10x.h"
#include "stm32f10x_flash.h"
// Medium-density devices are STM32F101xx, STM... |
<filename>core/repl.go<gh_stars>1000+
package core
import (
"bufio"
"errors"
"fmt"
"os"
"github.com/elsaland/quickjs"
)
// Repl implementation
func Repl() {
stringToEval := ""
fmt.Println("Elsa REPL")
fmt.Println("exit using ctrl+c or close()")
for true {
fmt.Print("> ")
reader := bufio.NewReader(os.St... |
<filename>gulpfile.js<gh_stars>0
'use strict';
var gulp = require('gulp'),
uglify = require('gulp-uglify'),
minifycss = require('gulp-minify-css'),
minifyhtml = require('gulp-minify-html'),
nodemon = require('gulp-nodemon');
gulp.task('minifyhtml', function () {
return gulp.src('src/dualrtc.html')... |
<gh_stars>1-10
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: complexType.proto
package com.riferrei.kafka.connect.pulsar;
public final class ProtoBufGenComplexType {
private ProtoBufGenComplexType() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistryLi... |
package com.telenav.osv.manager.network.parser;
import org.json.JSONArray;
import org.json.JSONObject;
import com.telenav.osv.item.LeaderboardData;
import com.telenav.osv.item.network.UserCollection;
/**
* JSON parser for leader board
* Created by kalmanb on 8/1/17.
*/
public class LeaderboardParser extends ApiRes... |
from sklearn.cluster import KMeans
import numpy as np
# Create array of the data points
data_points = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
# Calculate clusters
kmeans = KMeans(n_clusters=3).fit(data_points)
# Get labels for each point
labels = kmeans.predict(data_points)
# Print clusters
print(labels) # Outp... |
def prime_factors(n):
result = []
while n % 2 == 0:
result.append(2)
n = n // 2
for i in range(3,int(n**0.5)+1,2):
while n % i== 0:
result.append(i)
n = n / i
if n > 2:
result.append(n)
return result |
module.exports = {
projectId: "heigvd-cld-micha",
// Or the contents of the key file:
credentials: require('./heigvd-cld-micha-23b18f7e74aa.json')
};
|
declare module 'mxgraph' {
/**
*
* @class mxCellStatePreview
*
* Implements a live preview for moving cells.
*/
class mxCellStatePreview {
/**
* Constructs a move preview for the given graph.
*
* @param {mxGraph} graph Reference to the enclosing <mxGraph>.
* @constructor
... |
package nightmarethreatreis.com.github.mvp.events;
import javafx.event.Event;
import javafx.event.EventType;
public class OnShowEvent extends Event {
private static final long serialVersionUID = -119655647073475242L;
public static final EventType<OnShowEvent> SHOW_EVENT = new EventType<OnShowEvent>(ANY);
publi... |
<reponame>gaunthan/design-patterns-by-golang
package facade
import (
"design-patterns-by-golang/02_structural_patterns/10_facade/delivery"
"fmt"
)
func ExampleOnlineShopping() {
shopping := NewOnlineShopping()
outputResult(shopping.Buy("Joe", "apple"))
outputResult(shopping.Buy("Joe", "orange"))
outputResult(sh... |
<gh_stars>0
import Statistic from 'antd/es/statistic'
import 'antd/es/statistic/style'
const { Countdown } = Statistic
export { Statistic, Countdown as StatisticCountdown }
|
package com.ufrn.embarcados.reaqua.service;
import com.ufrn.embarcados.reaqua.model.ApplicationUser;
import com.ufrn.embarcados.reaqua.model.Tower;
import com.ufrn.embarcados.reaqua.repository.ApplicationUserRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowire... |
<gh_stars>10-100
# encoding: utf-8
class ApiUploader < CarrierWave::Uploader::Base
attr_accessor :success_action_redirect
attr_accessor :success_action_status
attr_accessor :user, :repo
%w{ key aws_access_key_id acl policy signature }.each do |method|
define_method method do
method
end
end
... |
<filename>dynomitemanager-core/src/main/java/com/netflix/dynomitemanager/storage/Bootstrap.java
package com.netflix.dynomitemanager.storage;
public enum Bootstrap {
NOT_STARTED, CANNOT_CONNECT_FAIL, WARMUP_ERROR_FAIL, RETRIES_FAIL, EXPIRED_BOOTSTRAPTIME_FAIL, IN_SYNC_SUCCESS,
}
|
#!/bin/bash
set -e
# assume this is ran from the root of moov-io/infra
last=$(ls -1 | grep fuzz | tail -n1)
if [ -n "$last" ];
then
echo "Using fuzz findings from $last"
for dir in $(ls -1 "$last");
do
# Create a .tar file of the crashing inputs and outputs
tar cf "$last"/"$dir".tar "$last... |
<reponame>manas1410/Miscellaneous-Development
import cx_Freeze
import json
executables=[cx_Freeze.Executable(
"D:/college/Internship(Spectrum)/3/welcome.py",
base="Win32GUI",
icon='D:/college/Internship(Spectrum)/3/logo/spectrumlogo.ico')]
cx_Freeze.setup(
name='Students Mark Entry',
options={"build_exe":{... |
#!/bin/bash
set -e
source "$(dirname $0)/../os-env.sh"
TAG=""
if [ $# -gt 0 ]; then
TAG=$1
echo "TAG=$TAG"
else
echo "First parameter should be the new TAG"
exit 1
fi
VERSION=${TAG:1}
GIT_ROOT=$(git rev-parse --show-toplevel)
OUTPUT_FOLDER=$GIT_ROOT/dist
cp -Lr $GIT_ROOT/chart/* $OUTPUT_FOLDER/
for... |
<reponame>ebdrup/nodeerrors
"use strict";
describe("When running tests", function () {
it("should have sinon defined", function () {
expect(sinon).to.be.ok;
});
it("should have expect defined", function () {
expect(expect).to.be.ok;
});
}); |
/*
let valor1 = parseInt(gets());
let valor2 = parseInt(gets());
let total = 0; // Altere o valor da variável com o cálculo esperado
console.log("PROD = " + total);
*/
//Solução
let A = parseInt(gets());
let B = parseInt(gets());
let total = A * B; // Variável alterada com o cálculo esperado
console.log("PROD = " + ... |
#!/bin/bash
CC=dpcpp
PROJECT=myproject
source /opt/intel/inteloneapi/setvars.sh
# source /opt/intel/inteloneapi/setvars.sh --dnnl-configuration=cpu_gomp --force> /dev/null 2>&1
CFLAGS="-O3 -fpic -std=c++11"
LDFLAGS="-L${DNNLROOT}/lib"
INCFLAGS="-I${DNNLROOT}/include"
GLOB_ENVS="-DDNNL_CPU_RUNTIME=SYCL -DDNNL_GPU_RUNTI... |
#!/usr/bin/env bash
pip install -r requirements.txt |
function createAppShared(req, res, next) {
req.appShared = { };
next();
}
module.exports = createAppShared; |
const ENS = artifacts.require('@ensdomains/ens/ENSRegistry');
const PublicResolver = artifacts.require('@ensdomains/resolver/PublicResolver');
const BaseRegistrar = artifacts.require('./BaseRegistrarImplementation');
const ETHRegistrarController = artifacts.require('./ETHRegistrarController');
const DummyOracle = artif... |
from bs4 import BeautifulSoup
def extract_row_content(html):
soup = BeautifulSoup(html, 'html.parser')
row_content = [td.get_text() for td in soup.find_all('td')]
return row_content |
<gh_stars>0
#include <stdio.h>
inline int max(const int&a , const int&b) { return a > b ? a : b ; }
inline int min(const int&a , const int&b) { return a < b ? a : b ; }
inline void swap(int&a , int&b) { register int c = a; a = b; b = c; }
inline int F() { register int aa , bb ,ch;
while(ch = getchar() , (ch<'0'||ch... |
#ifndef PARAM_INFO
#error "You must define PARAM_INFO macro before include this file"
#endif
PARAM_INFO(Width, float, width, m_width, (1.0f))
PARAM_INFO(Height, float, height, m_height, (1.0f))
PARAM_INFO(Depth, float, depth, m_depth, (1.0f))
|
import isEmail from "validator/lib/isEmail";
import { create, test, enforce, only, optional } from "vest";
import { AccountGeneralDto, ChangePasswordForm } from "~/types";
export const ACCOUNT_GENERAL_SCHEMA: any = create(
({ email, full_name, username }: AccountGeneralDto, currentField: string) => {
only(curren... |
#!/bin/bash
set -o nounset
set -o errexit
cd "$(dirname "$0")"
mkdir -p $PWD/../data/lib/plugins/editors/
mkdir -p $PWD/../data/lib/plugins/tools/
mkdir -p $PWD/../data/bin/
mkdir -p $PWD/../data/resources/
cp $BIN_DIR/plugins/editors/librobotsMetamodel.so $PWD/../data/lib/plugins/editors/
cp -p... |
<filename>pattern.js<gh_stars>0
const { hsv } = require('./lib/tools');
// Render one frame.
function draw(client) {
let secs = new Date().getTime() / 1000;
// There are two cats and each is 60 pixels wide by 8 pixels high. Loop
// over the pixels and compute the color of each based on the current time.
for (... |
/*
* Copyright 2015 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 agreed to in w... |
<gh_stars>0
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// M... |
<reponame>pip-services-archive/pip-services-runtime-go<gh_stars>0
package log
import (
"testing"
"github.com/stretchr/testify/suite"
"github.com/pip-services/pip-services-runtime-go"
"github.com/pip-services/pip-services-runtime-go/log"
)
type CompositeLogTest struct {
suite.Suite
log ... |
<filename>docker/doc.go
/*Package docker exposes functionality to manage building and posting Docker containers */
package docker
|
import java.io.FileInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.Socket;
import java.net.URL;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Properties;
import javax.servlet.ServletException;
import javax.servlet.... |
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.WebServlet;
import java.io.*;
import com.mongodb.MongoClient;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.MongoCollection;
import org.bson.Document;
@WebServlet("/form")
public class FormServlet extends HttpServ... |
import re
import nltk
import sklearn
# define a list of stop words
stop_words = nltk.corpus.stopwords.words('english')
# define a stemmer
stemmer = nltk.stem.porter.PorterStemmer()
# define a function to extract features from a given text
def extract_features(txt):
# tokenize the document
tokens = nlt... |
#!/bin/bash
set -eu
pipenv run pipenv install
pipenv run python manage.py migrate --settings=config.settings.production
pipenv run python manage.py seed --settings=config.settings.production
pipenv run python manage.py compilescss --settings=config.settings.production
pipenv run python manage.py collectstatic --ignore... |
require 'fog/core/model'
module Fog
module OracleCloud
class SOA
class Instance < Fog::Model
identity :service_name, :aliases=>'serviceName'
attribute :service_type
attribute :resource_count
attribute :status
attribute :description
attribute :i... |
/*
* CPAchecker is a tool for configurable software verification.
* This file is part of CPAchecker.
*
* Copyright (C) 2007-2014 <NAME>
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may... |
import os
import pickle
from typing import List, Optional
import pymysql
from .interfaces import ISessionProvider, IDbSessionProvider
from .session import HttpSession
from ..util import b64
class MemorySessionProvider(ISessionProvider):
def __init__(self, expired: int, *args, **kwargs):
sel... |
#!/bin/sh -e
# 1.
# Requires plugin https://github.com/heroku/heroku-builds
# Install via `heroku plugins:install heroku-builds`
# 2.
# Set heroku environment variables by running following script:
# private/update-environment-variables-on-heroku.mjs
heroku builds:create -a factorio-mods-localization
|
<gh_stars>1-10
package com.twelvemonkeys.imageio.plugins.pict;
import com.twelvemonkeys.imageio.spi.ReaderWriterProviderInfo;
import com.twelvemonkeys.imageio.spi.ReaderWriterProviderInfoTest;
/**
* PICTProviderInfoTest.
*
* @author <a href="mailto:<EMAIL>"><NAME></a>
* @author last modified by $Author: harald.ku... |
#!/bin/bash
#
# generate_service_certificates.sh <service>
#--------------------------------------
# Script to generate a key and certificate for GitLab services, including Gitaly
# and Praefect to enable TLS support.
#
# Generates `<service>.crt` & `<service>.key` in a temporary directory, and
# places them into the c... |
pkg_origin=core
pkg_name=openldap
pkg_version=2.4.58
pkg_description="Community developed LDAP software"
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
pkg_license=("OLDAP-2.8")
pkg_upstream_url=http://www.openldap.org/
pkg_source=https://www.openldap.org/software/download/OpenLDAP/${pkg_name}-release/${p... |
course := "parprog1"
assignment := "reductions"
assignmentInfo := AssignmentInfo(
key = "<KEY>",
itemId = "U1eU3",
premiumItemId = Some("4rXwX"),
partId = "gmSnR",
styleSheet = None
)
|
package io.github.rcarlosdasilva.weixin.core.http;
public enum HttpMethod {
GET, HEAD, POST, PUT, PATCH, DELETE;
}
|
package gv.jleon
package mirror
import shapeless.{ HNil }
import test._
import Prop._
import Mirror._
object MirrorProperties extends Properties("Mirror")
with MirrorGenerator
with UriGenerator {
property("baseUrl consistency") =
forAll { (b: BaseUrl, p: Prefix) ⇒
(b :: p :: true :: HNil).baseUr... |
# algorithm to optimize a given data model
def optimize_model(model):
# create a graph of the given model
graph = create_model_graph(model)
# optimize the graph using a graph optimization algorithm
optimized_graph = optimize_graph(graph)
# convert the optimized graph to an optimized model
... |
package io.opensphere.mantle.util.columnanalyzer;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import javax.xml.bind.annotation.adapters.XmlAdapter;
import org.apache.commons.lang3.StringUtils;
/**
* An XmlAdapter used to marshal and unmarshal a
* typeKey-to-list-of-DataTypeColumnAn... |
<gh_stars>0
package ff.camaro;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.gradle.api.Project;
import org.gradle.api.tasks.So... |
#!/usr/bin/env bash
function check_java_version {
if type -p java; then
echo found java executable in PATH
_java=java
elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
echo found java executable in JAVA_HOME
_java="$JAVA_HOME/bin/java"
else
echo "no java"
return -1
fi
... |
<gh_stars>0
export const aave = 'https://api.thegraph.com/subgraphs/name/aave/protocol-multy-raw';
export const aavev2 = 'https://api.thegraph.com/subgraphs/name/aave/protocol-v2';
export const uniswapV2 = 'https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2';
export const synthetixSnx = 'https://api.thegraph.co... |
<gh_stars>0
package app;
import org.jooby.Jooby;
import org.jooby.banner.Banner;
import org.jooby.crash.Crash;
import org.jooby.crash.HttpShellPlugin;
import org.jooby.json.Jackson;
public class CrashApp extends Jooby {
{
conf("crash.conf");
use(new Jackson());
use(new Banner("crash me!"));
use(n... |
import { SocketIoAdapter } from './modules/websocket/socketio.adapter';
import 'module-alias/register';
import { NestFactory } from '@nestjs/core';
import { Logger } from '@nestjs/common';
import { NestExpressApplication } from '@nestjs/platform-express';
import * as helmet from 'helmet';
import * as rateLimit from 'ex... |
#!/bin/bash
#SBATCH -J Act_tanhrev_1
#SBATCH --mail-user=eger@ukp.informatik.tu-darmstadt.de
#SBATCH --mail-type=FAIL
#SBATCH -e /work/scratch/se55gyhe/log/output.err.%j
#SBATCH -o /work/scratch/se55gyhe/log/output.out.%j
#SBATCH -n 1 # Number of cores
#SBATCH --mem-per-cpu=6000
#SBATCH -t 23:59:00 # Hours, minutes ... |
#include <stdio.h>
#include <stdlib.h>
#include <oqs/kem_kyber.h>
#ifdef OQS_ENABLE_KEM_kyber_512_cca_kem
OQS_KEM *OQS_KEM_kyber_512_cca_kem_new() {
OQS_KEM *kem = malloc(sizeof(OQS_KEM));
if (kem == NULL) {
return NULL;
}
kem->method_name = OQS_KEM_alg_kyber_512_cca_kem;
kem->alg_version = "https://github.c... |
<filename>opencl/precision/read_cl.c
/*
* read_cl.c
*
* Created on: Apr 3, 2015
* Author: panhao
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char*
read_file (char *file_name)
{
FILE *fp;
char *p;
fp = fopen (file_name, "r"); // read mode
if (fp == NULL)
{
perror ("Error whil... |
import random
def generate_password(length):
characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
password = ""
for _ in range(length):
index = random.randint(0, len(characters)-1)
password += characters[index]
return password |
#Steps of the official ros installation for kinetic distro as 7/03/2018
#Set up sources
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
#Set up keys
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F... |
<reponame>NajibAdan/kitsu-server
require 'flipper/adapters/redis'
Flipper.configure do |config|
config.default do
# Connect to Redis and initialize Flipper
adapter = Flipper::Adapters::Redis.new(Redis.new)
Flipper.new(adapter)
end
end
Flipper.register(:staff) do |user|
user.try(:has_role?, :admin)
e... |
# Import relevant packages
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
# Load the data
data = pd.read_csv('patients_data.csv')
# Create the feature and target vectors
X = data[['fever', 'headache', 'sore throat', 'nausea']]
y = data['disease... |
import React from 'react';
import clsx from 'clsx';
import styles from './styles.module.css';
const FeatureList = [
{
title: 'StarkNet in your hands',
Svg: require('@site/static/img/starknet.svg').default,
description: (
<>
Get StarkNet data directly from Juno.
... |
#!/bin/sh
set -e
set -u
set -o pipefail
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 script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_P... |
package ru.autometry.obd.commands.listener;
import ru.autometry.obd.commands.Command;
import ru.autometry.obd.commands.Response;
import ru.autometry.obd.processing.CommandDispatcher;
import ru.autometry.utils.common.ByteUtils;
/**
* Created by jeck on 13/08/14
*/
public class LogListener implements Listener {
@Ov... |
<reponame>JonathanO/phonehome
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.3.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6")
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.8.0")
libraryDependencies += "org.vafer" % "jdeb" % "1.3" artifacts (Artifact("jdeb", "jar", "jar"... |
def levenshtein_distance(s1, s2):
# Base cases
if s1 == s2:
return 0
elif len(s1) == 0:
return len(s2)
elif len(s2) == 0:
return len(s1)
# Construct a matrix
matrix = [[0 for c in range(len(s1) + 1)] for r in range(len(s2) + 1)]
# Fill in the first row and colum... |
@interface Triangle : NSObject
@property (nonatomic) float base;
@property (nonatomic) float height;
-(float) calculateArea;
@end
@implementation Triangle
-(float) calculateArea {
return 0.5 * self.base * self.height;
}
@end |
def fibonacci(n):
a = 0
b = 1
if n < 0:
print("Incorrect input")
elif n == 0:
return a
elif n == 1:
return b
else:
for i in range(2,n):
c = a + b
a = b
b = c
return b |
using System.Xml;
public class XmlNavigator
{
private XmlNode currentNode;
public XmlNavigator(XmlNode node)
{
currentNode = node;
}
public bool MoveToParent()
{
if (currentNode.ParentNode != null)
{
currentNode = currentNode.ParentNode;
return ... |
<gh_stars>0
# Capistrano
module Capistrano
# GitCopy
module GitCopy
# gem version
VERSION = '1.0.0'
end
end
|
/*
* COMMAND LINE INTERFACE: CREATE ASSET
*/
// DEFINE DEPENDENCIES
const fs = require('fs');
const ops = require('../operations/ops');
// LOCAL VARIABLES
async function addInventoryRole(item) {
// notify
// LOCAL
const templateFile = fs.readFileSync('./server/models/inv... |
<reponame>socialsensor/social-event-detection
package clustering.louvain;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import models.MultimodalItem;
import org.gephi.data.attributes.api.AttributeColumn;
import org.gephi.data.attributes.... |
<filename>src/swipe-up/debug/buttons/close-me-button.js
import $ from '../../utils/dom'
export default class CloseMeButton {
constructor(debugWidget) {
this._debugWidget = debugWidget
this._selfName = 'debugWidgetCloseBtn'
let self = document.createElement('button')
self.className... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.