text stringlengths 1 1.05M |
|---|
SELECT name
FROM employees
WHERE department = (SELECT department
FROM employees
WHERE name = 'John'); |
#!/bin/bash
#export LD_LIBRARY_PATH=/usr/local/lib/python3.2/dist-packages/PySide:$LD_LIBRARY_PATH
python3 ./player.py -a localhost -l /home/pi/Music $*
|
<reponame>wujia28762/Tmate<filename>App/src/main/java/com/honyum/elevatorMan/activity/worker/FixNextTimeActivity.java
package com.honyum.elevatorMan.activity.worker;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view... |
import path from "path";
import type { UserConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import { svgBuilder } from "./src/core/utils/svg";
function resolve(dir: string) {
return path.resolve(__dirname, ".", dir);
}
// https://vitejs.dev/config/
export defa... |
<reponame>jrussnak/webglayer
var heatmap;
var defaultPCValue = 40;
var datasets = {
'1': {
path: 'brno_dn',
about: 'Tato mapa prezentuje 530 dopravních nehod z let 2011 až 2013. Jedná se o vybrané dopravní nehody s podezřením na spáchání trestného činu (alkohol, zranění, vyšší škoda).',
name: '<NAME>... |
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import LabelEncoder, StandardScaler
from sklearn.multiclass import OneVsRestClassifier
from sklearn.svm import SVC
# Define preprocessing steps
preprocess_steps = [
('label_encoder', LabelEncoder()),
('scaler', StandardScaler())
]
# Define the model
m... |
var User = require('../models/user');
module.exports = function (app, passport) {
app.get('/auth/login', function(req, res) {
res.render('./auth/login', { message: req.flash('loginMessage') });
});
app.post('/auth/login', passport.authenticate('local-login', {
successRedirect : '/auth/pro... |
<filename>test/encoding/varint.js<gh_stars>10-100
/* eslint-disable */
// TODO: Remove previous line and work through linting issues at next edit
'use strict';
var should = require('chai').should();
var bitcore = require('../../index.js');
var BN = bitcore.crypto.BN;
var BufferReader = bitcore.encoding.BufferReader;
... |
package com.zhuanghl.jfinal.api;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.Record;
import com.zhuanghl.jfinal.common.bean.BaseResponse;
import com.zhuanghl.jfinal.common.bean.Code;
import com.zhuanghl.jfinal.common.utils.DateUtils;
impor... |
package psql
import (
"database/sql"
"fmt"
"math/rand"
"strconv"
"time"
"github.com/dgrijalva/jwt-go"
)
type Auth struct {
DB *sql.DB
}
type Otp struct {
mobile_num string
otp string
}
func (a *Auth) GetOtp(mobileNum string) (string, error) {
rand.Seed(time.Now().UnixNano())
otp := strconv.Itoa(... |
import Route from '@ember/routing/route';
import { fetchPaginated } from 'example-app/helpers/pagination';
export default Route.extend({
model() {
return fetchPaginated('/books');
}
}); |
/*
* Copyright 2013 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/LICENSE-2.0
*
* Unless required by applicabl... |
// Ahora lo realizamos con funciones para el ingreso de parametros!
function calcularPrecioConDescuento(precio, descuento) {
const porcentajePrecioConDescuento = 100 - descuento;
const precioConDescuento = (precio * porcentajePrecioConDescuento) / 100;
return precioConDescuento;
}
function clickDiscount() ... |
<gh_stars>1-10
"""Leetcode 349. Intersection of Two Arrays
Easy
URL:
Given two arrays, write a function to compute their intersection.
Example 1:
Input: nums1 = [1,2,2,1], nums2 = [2,2]
Output: [2]
Example 2:
Input: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
Output: [9,4]
Note:
- Each element in the result must be uniq... |
def printCombinations(arr,n):
for i in range(1<<n):
for j in range(n):
if (i&(1<<j))!=0:
print(arr[j], end=" ")
print()
# Driver program
arr = [1,2,3]
n = len(arr)
printCombinations(arr,n) |
#!/usr/bin/env sh
#--- prerequisites ---#
# doctl
# DO_PK_FIREWALL_ID env var in ~/.envrc file
# myip script
[ -f ~/.envrc ] && . ~/.envrc
doctl compute firewall add-rules $DO_PK_FIREWALL_ID --inbound-rules=protocol:tcp,ports:22,address:$(myip)
|
<filename>src/main/java/org/paasta/container/platform/common/api/clusters/ClustersService.java<gh_stars>1-10
package org.paasta.container.platform.common.api.clusters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Clusters Service 클래스
*
... |
<reponame>exKAZUu-Research/SmartMotivator
// @flow
import React from 'react';
import { shallow } from 'enzyme';
import { View } from 'react-native';
import { ErrorComponent } from './ErrorComponent';
describe('<ErrorComponent />', () => {
it('should render one component', () => {
expect(shallow(<ErrorComponent... |
# bash script to execute az commands to launch a Python/CNTK Image using ACI, attaching an Azure Fileshare for
# data input and output.
#
# Assumes az login already performed from Azure bash shell, and an existing resource group has been created
# Azure ACI will be used to create single container batch instance of Pyt... |
<reponame>dvicklund/tiles
// Grab canvas element from HTML, then grab its context.
var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
// Set width and height of the canvas element to fill the viewport
var windowWidth = canvas.width = document.defaultView.innerWidth;
var windowHeight... |
#include <stdio.h>
int main ()
{
// Declare variables
int i, n, sum;
// Set n
n = 10;
// Set sum to 0
sum = 0;
// loop through 1 to n
for (i = 1; i <= n; i++)
{
sum = sum + i;
}
// Print the sum
printf("Sum = %d", sum);
return 0;
} |
<filename>RASA_ConceptNet5/actions/actions.py
# This files contains your custom actions which can be used to run
# custom Python code.
#
# See this guide on how to implement these action:
# https://rasa.com/docs/rasa/custom-actions
# This is a simple example for a custom action which utters "Hello World!"
#
# REFEREN... |
import os
def simulate_rm_rf(directory_path: str) -> None:
if os.path.exists(directory_path):
for root, dirs, files in os.walk(directory_path, topdown=False):
for file in files:
os.remove(os.path.join(root, file))
for dir in dirs:
os.rmdir(os.path.joi... |
<filename>src/services/getAllUser.js
const endpointUrl = "http://localhost:3001";
export const getAllUser = (email, password) => {
return new Promise((resolve, reject) => {
fetch(`${endpointUrl}/login`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ ma... |
<gh_stars>0
/*-
* Copyright (c) 2017 <NAME> <<EMAIL>>
* 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 must retain the above copyright
* notice, thi... |
import { useMint } from './useMint';
export const useCurrency = () => {
const { mint } = useMint();
return { Currency: mint.Currency };
};
|
<filename>src/main.ts
import { NestFactory } from '@nestjs/core';
import { Transport } from '@nestjs/microservices';
require('newrelic');
import { configService } from './config/config.service';
import { AppModule } from './app.module';
async function bootstrap() {
const fs = require('fs');
let app;
// if (pr... |
#!/bin/sh
lacc="$1"
comp="$2"
if [ -z "$comp" ]
then
echo "Usage: $0 <compiler to test> <reference compiler>";
exit 1
fi
if [ ! -f sqlite/shell.c ] || [ ! -f sqlite/sqlite3.c ]
then
echo "Missing sqlite source, download and place in 'sqlite' folder"
exit 1
fi
# Build with lacc
valgrind --leak-check=full --show-l... |
// Copyright 2018, Google, LLC.
// 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 wr... |
module Rails #:nodoc
class Configuration #:nodoc
attr_accessor :app_config
alias :org_default_frameworks :default_frameworks
# Extends list of known frameworks with app_config.
# Allows access to config.app_config in environment.rb
def default_frameworks
... |
#!/bin/sh
# start HHVM
hhvm -m daemon -vServer.Type=fastcgi -vServer.Port=9000 -vServer.FixPathInfo=true
|
<gh_stars>0
package com.cjean.springcloud.ribbon.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
@RestController
public class Test {
@Autowired
private RestTemplate restTemplate;
... |
import sqlalchemy
from sqlalchemy import create_engine, Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
# Create a SQLite in-memory database
engine = create_engine('sqlite:///:memory:', echo=True)
# Create a session class
Session = sessionmaker(b... |
<reponame>yexhoo/light-distribution
const constants = require("./constants")
const color = require('./color')
exports.build =
(matrix) => matrix
.map((line, y) =>
line.map((char, x) =>
constants.buildCell(char == '1', x, y)))
exports.print = (room, msg = '') => {
console.lo... |
package com.comandulli.engine.panoramic.playback.engine.render.camera;
import java.util.List;
import com.comandulli.engine.panoramic.playback.engine.core.Entity;
import com.comandulli.engine.panoramic.playback.engine.math.Vector3;
import com.comandulli.engine.panoramic.playback.engine.render.material.Shader;
import c... |
#!/bin/bash
set -ex
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
NAMESPACE=${NAMESPACE:-default}
WORKER_NS=${WORKER_NS:-test-pods}
# create prow namespace
kubectl create namespace "${NAMESPACE}" || echo Skipping
# create test-pods namespace
kubectl create namespace "${WORKER_NS}" || echo... |
<filename>CarFactory/src/main/java/com/solvd/carfactory/services/IPartTypeService.java
package com.solvd.carfactory.services;
import com.solvd.carfactory.models.supply.PartType;
public interface IPartTypeService {
PartType getPartTypeById(long id);
} |
#!/usr/bin/env bash
artifact_download
assert_failure $?
artifact_download --groupid 'test' --artifactid 'shell' --versionid '0.05' --extension '.sh'
assert_failure $?
set_artifactory_server --value 'build.dev.fco'
set_artifactory_port --value '80'
set_artifactory_server_path --value 'artifactory'
set_artifactory_rep... |
export { ArtistConnect } from './Artist/Artist';
export { ArtistEventsConnect } from './Events/ArtistEvents';
export { ArtistsConnect } from './Artists/Artists';
export { default as EmailVerification } from './auth/EmailVerification';
export { EventsConnect } from './Events/Events';
export { default as FAQ } from './FA... |
<gh_stars>0
import tool from "./../tool";
const doc = document;
/**
* 监听{F11} 并执行相应的方法
* @param {enterFunc} 进入全屏 进行的 function
* @param {outFunc} 退出全屏 function
*
*/
const listenKeyDown = (enterFunc, outFunc) => {
console.log(doc);
// doc.addEventListener("keydown", function(e) {
// // console.log(e... |
#!/bin/bash
gradle="./gradlew $@"
gradleBuild=""
gradleBuildOptions="--build-cache --configure-on-demand --no-daemon "
echo -e "***********************************************"
echo -e "Gradle build started at `date`"
echo -e "***********************************************"
echo -e "Installing NPM...\n"
./gradlew n... |
#!/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... |
<gh_stars>1-10
package types
import (
"testing"
"gx/ipfs/QmPVkJMTeRC6iBByPWdrRkD3BE5UXsj5HPzb4kPqL186mS/testify/assert"
)
func TestCidForTestGetter(t *testing.T) {
newCid := NewCidForTestGetter()
c1 := newCid()
c2 := newCid()
assert.False(t, c1.Equals(c2))
assert.False(t, c1.Equals(SomeCid())) // Just in case... |
import getEnv from "./lib/utils/env";
export default {
bot: {
name: "",
themeColor: 0x836DC4
},
discord: {
fetchLimitPerRequest: 100 // Limited by Discord API policy,
},
command: {
prefix: "!!"
},
auth: {
token: getEnv("TOKEN") || "<PASSWORD>"
},
confirmDialog: {
timeout: ... |
// Main Entry Point:
document.addEventListener("DOMContentLoaded", function(event) {
let pixelSize = 8;
let roundDelay = 50;
let chanceOfLife = .2
let container = document.getElementById('container');
let containerWidth = window.innerWidth * .99;
let containerHeight = window.innerHeight * .99;
let cols =... |
package com.wangxy.exoskeleton.risk;
public class OptionValueBionominalTree
{
double asset =100.0;
double volatility =0.2;
double intrate=0.1;
double strike=100.0;
double expiry=5.00/12.00;
int numberstep=5;
double [] []stockprice = new double[5][5];
double [] []optionprice=new double[5][5];
double [] []delt... |
<reponame>zllovesuki/t<filename>server/meta.go
package server
import (
"encoding"
"encoding/binary"
"net"
"github.com/zllovesuki/t/multiplexer/protocol"
"github.com/pkg/errors"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
const (
MetaSize = 26
)
type Meta struct {
ConnectIP string
ConnectPort uint64
... |
require_relative 'wexpr/exception'
require_relative 'wexpr/expression'
require_relative 'wexpr/object_ext'
require_relative 'wexpr/uvlq64'
require_relative 'wexpr/version'
#
# Ruby-Wexpr library
#
# Currently does not handle Binary Wexpr.
#
module Wexpr
#
# Parse Wexpr and turn it into a ruby hash
# Will thrown an ... |
def is_balanced(node):
# Base case: (when tree is empty)
if node is None:
return True
# before computing the left and right height, subtract the
# current node from the total tree height
lh = tree_height(node.left) - 1
rh = tree_height(node.right) - 1
# If the difference betwe... |
#!/bin/bash
#----------------------------------------------------
# Example SLURM job script to run hybrid applications
# (MPI/OpenMP or MPI/pthreads) on TACC's Stampede
# system.
#----------------------------------------------------
#SBATCH -J benchmark_bruno_thresholds # Job name
##SBATCH -o bruno.o%j # Name of ... |
#!/usr/bin/env bash
conda uninstall -y --force \
numpy \
scipy \
pandas \
matplotlib \
dask \
distributed \
fsspec \
zarr \
cftime \
rasterio \
packaging \
pint \
bottleneck \
sparse \
flox \
h5netcdf \
xarray
# to limit the runtime of Upstream CI
pyt... |
# stty -F /dev/ttyUSB1 raw speed 9600 min 0 time 10
port='/dev/ttyUSB1'
stty -F $port 9600 cs8 -cstopb -parenb
# stty -F $port 9600 cs8 -cstopb -parenb
# 全开发送码:FE 0F 00 00 00 04 01 FF 31 D2
# 全断发送码:FE 0F 00 00 00 04 01 00 71 92
for i in {1..1}
do
echo 第$i次断开USB"\xFE\x0F\x00\x00\x00\x04\x01\xFF\x31\xD2"
# cat /d... |
import tensorflow as tf
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras.layers import Embedding, LSTM, Dense
tokenizer = Tokenizer()
vocab_size = 10000
embedding_dim = 16
max_length = 100
trunc_type= 'post'
padding_type=... |
package eu.chargetime.ocpp.utilities.test;
/*
ubitricity.com - Java-OCA-OCPP
MIT License
Copyright (C) 2018 <NAME> <<EMAIL>>
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 restri... |
import React, { useState } from 'react';
const CountVowels = () => {
const [input, setInput] = useState('');
const [vowels, setVowels] = useState(0);
const [consonants, setConsonants] = useState(0);
const [alphabets, setAlphabets] = useState(0);
const handleChange = (e) => {
setInput(e.target.value);
let coun... |
@test "composer" {
su - cphp -c "composer --version"
}
|
package com.solofeed.tchernocraft.block;
import com.solofeed.tchernocraft.Tchernocraft;
import net.minecraft.creativetab.CreativeTabs;
/**
* Tchernocraft's block interface. All mod's block implements this interface.
*/
public interface ITchernocraftBlock {
/**
* Get the block's name
* @return the bloc... |
<filename>sshd-core/src/test/java/org/apache/sshd/server/ServerAuthenticationManagerTest.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... |
#!/usr/bin/bash
export IMAGE_GALLERY_SCRIPT_VERSION="1.1"
CONFIG_BUCKET="edu.au.cc.ig-config"
# Install packages
yum -y update
yum install -y python3 git postgresql postgresql-devel gcc python3-devel
amazon-linux-extras install -y nginx1
# Configure/install custom software
cd /home/ec2-user
git clone https://github.... |
echo "Hello World"
|
/*
This file is part of Peers, a java SIP softphone.
This program 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
any later version.
This progr... |
package geojson
import "time"
// "When" is a datetime info bound to Features objects
// Geojson spec at https://github.com/geojson/geojson-ld
type When struct {
Type string `json:"@type,omitempty"`
Datetime *time.Time `json:"datetime,omitempty"`
}
// NewWhen creates a when clause
func... |
const db = require('../util/database');
module.exports = class Ad {
constructor(id, title, price) {
this.id = id;
this.title = title;
this.price = price;
}
save() {
return db.execute('INSERT INTO ads (title, price) VALUES (?, ?)', [this.title, this.price]);
}
static deleteById(id) {}
sta... |
/*
* Copyright 2021 HM Revenue & Customs
*
* 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 a... |
<reponame>markelg/cdsapi
# (C) Copyright 2018 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its stat... |
package ru.otus.hw6.atm;
public enum Nominal {
TEN(10),
FIFTY(50),
HUNDRED(100),
FIVE_HUNDRED(500),
THOUSAND(1000);
public int value;
Nominal(int value) {
this.value = value;
}
} |
#!/bin/bash
# Database credentials
user="root"
password="root"
db_name="luya_env_phpunit"
cd public_html
mysqladmin -u$user -p$password drop $db_name
mysqladmin -u$user -p$password create $db_name
php index.php migrate --interactive=0
php index.php import
php index.php admin/setup --email=test@luya.io --password=luya... |
<filename>LZUISDK/SDK/LSDeviceManagerFramework.framework/Headers/LSEProductInfo.h
//
// LSEProductInfo.h
// LSWearable
//
// Created by <NAME> on 2017/3/9.
// Copyright © 2017年 lifesense. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
默认绑定方式
- LSEDefaultBindWayQRCode: 二维码
- LSEDefaultBindWaySN... |
<filename>main/array/main_int_array_combination.c
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include "int.h"
static void int_array_combination_fprint(FILE * out, int m, int n)
{
int prod, i;
int * a;
prod = int_binomial(m, n);
a = (int *) malloc(n * sizeof(int));
if (errno)
{
perror(... |
#!/bin/bash
cp -R contrib/debian .
debuild -us -uc
debian/rules clean
rm -rf debian
|
<filename>simpleplot.h
#pragma once
#include "simpleplot/plots/hist.h"
#include "simpleplot/plots/line.h"
#include "simpleplot/plots/series.h"
#include "simpleplot/canvas.h" |
package org.galaxyproject.dockstore_galaxy_interface.language;
import static org.galaxyproject.gxformat2.Cytoscape.END_ID;
import static org.galaxyproject.gxformat2.Cytoscape.START_ID;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import io.dockstore.common.DescriptorLanguage;
import ... |
from django.urls import re_path, include
urlpatterns = [
re_path(r'', include('django_private_chat2.urls', namespace='django_private_chat2')),
]
|
import org.apache.spark.sql.SparkSession
object AverageSaleCalculator {
def main(args: Array[String]): Unit = {
val spark = SparkSession.builder.appName("Average Sales Calculator").master("local[*]").getOrCreate()
val data = spark.read.format("csv").option("header", "true").option("inferSchema", "t... |
#!/bin/bash -e
set -e
source /opt/rh/php55/enable
# Create required directories just in case.
mkdir -p /var/www/logs/php-fpm /var/www/files-private /var/www/docroot
echo "*" > /var/www/logs/.gitignore
# Set the apache user and group to match the host user.
# Optionally use the HOST_USER env var if provided.
if [ "$H... |
<reponame>mashery/i18n.js
var i18n = (function () {
'use strict';
//
// Variables
//
var exp = {};
var dict;
var current;
var rtlLangs;
//
// Methods
//
if (!Element.prototype.matches) {
Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
}
... |
package lx.calibre.web.config;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframew... |
<filename>jhiRoot/plantsMS/src/main/java/fr/syncrase/ecosyst/service/TypeSemisQueryService.java
package fr.syncrase.ecosyst.service;
import fr.syncrase.ecosyst.domain.*; // for static metamodels
import fr.syncrase.ecosyst.domain.TypeSemis;
import fr.syncrase.ecosyst.repository.TypeSemisRepository;
import fr.syncrase.e... |
package top.luyuni.qaa.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import... |
package io.opensphere.core.net.manager.view;
import io.opensphere.core.net.manager.model.HttpKeyValuePair;
import io.opensphere.core.net.manager.model.NetworkTransaction;
import io.opensphere.core.util.javafx.ConcurrentObjectProperty;
import javafx.beans.property.ObjectProperty;
import javafx.scene.control.ListView;
i... |
<gh_stars>0
workers ENV.fetch("PUMA_WORKERS") { 3 }
port ENV.fetch("PUMA_LISTEN_PORT") { 3000 }
preload_app!
on_worker_boot do
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.establish_connection
end
end
|
package Chapter1_1Low;
import edu.princeton.cs.algs4.StdIn;
import edu.princeton.cs.algs4.StdOut;
//Exercise 1.1.21
public class Tabulate {
public static void main(String[] args) {
int M = 3;
int index = 0;
String[] strs = new String[M];
while (index < M)
strs[index++] ... |
<reponame>jhroemer/AmodSimulator<filename>jgrapht-master/jgrapht-core/src/main/java/org/jgrapht/alg/interfaces/EulerianCycleAlgorithm.java
/*
* (C) Copyright 2016-2018, by <NAME> and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* This program and the accompanying materials are dual-licensed under... |
#!/bin/bash
npm publish --access public |
/**
* Copyright 2016 The AMP HTML Authors. 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 obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless require... |
<!DOCTYPE html>
<html>
<head>
<title>Table of Names and Ages</title>
</head>
<body>
<h1>Table of Names and Ages</h1>
<table>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>John</td>
<td>30</td>
</tr>
<tr>
<td>Jane</td>
<td>25</td>
</tr>
<tr>
<td>Alice</td>
<td>28</td>
</tr>
<... |
#!/bin/bash
###
# Updates the AWS CloudFormation Resource Specification using the files published on the AWS Documentaiton.
# See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-resource-specification.html
###
set -euo pipefail
scriptdir=$(cd $(dirname $0) && pwd)
rm -f CHANGELOG.md.new
function... |
#!/bin/bash
if [ $# -gt 2 ]; then
echo "Usage: faban_client WEB_SERVER_IP [LOAD_SCALE]"
exit 1
fi
if [ $# -lt 1 ]; then
echo "Web server IP is a mandatory parameter."
exit 1
fi
WEB_SERVER_IP=$1
LOAD_SCALE=${2:-7}
while [ "$(curl -sSI ${WEB_SERVER_IP}:8080 | grep 'HTTP/1.1' | awk '{print $2}')" != "200" ]; d... |
package de.unistuttgart.ims.coref.annotator.action;
import javax.swing.Action;
import de.unistuttgart.ims.coref.annotator.CAAbstractTreeSelectionListener;
@Deprecated
public interface CAAction extends Action {
void setEnabled(CAAbstractTreeSelectionListener l);
}
|
import Utils from '../shared/utils';
class UsersService {
static async getAll( db, params ) {
const page = +(params.page || 1);
const pageSize = +(params.pageSize || 10);
const clientWhere = JSON.parse(params.where || {});
const clientOrder = JSON.parse(params.order || {});
... |
<filename>api/routes/RouterCheckin.ts
import { Router } from 'express'
import check from '../controllers/Checkin'
import CheckJwt from '../middlewares/CheckJwt'
const routes = Router()
routes.use(CheckJwt.checkJwt)
routes.get('/api/auth/checkin', check.checkin)
export default routes
|
import requests
import youtube_dl
from bs4 import BeautifulSoup
def program_urls():
page = requests.get("http://www.oppetarkiv.se/program")
soup = BeautifulSoup(page.content, 'html.parser')
a = soup.find_all('a')
for x in a:
href = x.get('href')
if isinstance(href, str) and 'etikett' i... |
#include "pixart_object.hpp"
#include <algorithm>
#include <cstring>
void PA_object::render_ascii(char *output, int pitch, char symbol) const
{
int lx = std::min((uint8_t) 97, boundary_left);
int rx = std::min((uint8_t) 97, boundary_right);
int uy = std::min((uint8_t) 97, boundary_up);
int dy = std::min((uint8... |
<gh_stars>10-100
#include <profile.h>
#include <config/config.h>
namespace View
{
void Profile::updateAllComboBoxesItems()
{
updateComboBoxItems(m_app.config().root().tools(), toolComboBox);
updateComboBoxItems(m_app.config().root().profiles(), profileComboBox);
}
Profile::Profile(Model::Application& app)
:Docum... |
#!/usr/bin/env bash
# Usage: create_salmon_index.sh <Config.ini>
### Setting as an interactive BASH session and forcing history to capture commands to a log/README file
HISTFILE=~/.bash_history
set -o history
set -ue
# Check resources.ini was provided on the command line
if [ -n "$1" ]
then
echo "Required ini file... |
/* - Coeus web framework -------------------------
*
* Licensed under the Apache License, Version 2.0.
*
* Author: <NAME>
*/
package com.tzavellas.coeus.mvc.controller
import org.junit.Test
import org.junit.Assert._
import com.tzavellas.coeus.mvc.view.{ View, ViewName, NullView }
import com.tzavellas.coeus.core.H... |
module.exports =
function solveSudoku(matrix) {
return solver(0, -1);
function checkX(x, y) {
let element = matrix[x][y];
for (let j = 0; j < 9; j++) {
if (matrix[x][j] == element && y != j) {
return false;
}
}
return true;
}
func... |
#include "KeyMap.h"
KeyMap::KeyMap()
{
}
|
def searchElement(x, matrix):
row_length = len(matrix[0])
col_length = len(matrix)
for i in range(0, col_length):
for j in range(0, row_length):
if matrix[i][j] == x:
return True
return False |
class NoMatchError(Exception):
"""Occurs when there is no match in a dataset"""
pass
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.