text stringlengths 1 1.05M |
|---|
######################################################################
# This file was autogenerated by `make`. Do not edit it directly!
######################################################################
# Antigen: A simple plugin manager for zsh
# Authors: Shrikant Sharat Kandula
# and Contributors <htt... |
class LinkedList {
Node head;
class Node {
int data;
Node next;
Node(int d) {
data = d;
next = null;
}
}
Node sortedMerge(Node a, Node b) {
Node result = null;
if (a == null)
return b;
else if (b == null)
... |
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved
//
#pragma once
//... |
longest_word_length = len(max(Text.split(), key=len))
print(longest_word_length) # prints 10 |
#!/bin/bash
git archive --format=zip --output=trzmc.zip main
|
#!/bin/bash -e
set -o pipefail
# Copyright 2014 Google Inc. 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 r... |
<filename>tiger/src/test/java/tiger/test/methodloop/BeanTest.java
/**
*
* @creatTime 下午3:21:45
* @author Eddy
*/
package tiger.test.methodloop;
import org.eddy.tiger.TigerBean;
import org.eddy.tiger.TigerBeanManage;
import org.eddy.tiger.impl.TigerBeanManageImpl;
import org.junit.Test;
/**
* @author Eddy
*
*/... |
#!/bin/bash
./configure --prefix=/usr \
--disable-static \
--without-nettle && \
make -j $SHED_NUMJOBS && \
make DESTDIR="$SHED_FAKEROOT" install |
import ConcreteEmitter from '../../src/implementations/ConcreteEmitter'
import randomString from '../../src/utils/randomString'
describe('Emitter suite', (): void => {
let instance: ConcreteEmitter
beforeEach(() => {
instance = new ConcreteEmitter({})
})
it('should create new instance of event emitter', ()... |
/*
============================================================================
This source file is part of the Ogre-Maya Tools.
Distributed as part of Ogre (Object-oriented Graphics Rendering Engine).
Copyright (C) 2003 Fifty1 Software Inc., Bytelords
This program is free software; you can redistribute it and/or
modi... |
from django.utils.translation import gettext_lazy as _
def get_item_value(item, accessor, *, container=None, exclude=None):
container_class = type(container)
if isinstance(accessor, StaticText):
return accessor
if container is not None and hasattr(container, accessor):
attr = getattr(con... |
const findMissingPositiveInteger = (arr) => {
let arrSorted = arr.sort((a, b) => a - b);
let i = 0;
let j = 1;
while (arrSorted[i] < 0) {
i++;
}
while (arrSorted.indexOf(j) !== -1) {
j++;
}
return j;
} |
#!/bin/bash
run_memory_benchmark () {
path="benchmarks/data/memory/run"
i=0
while [[ -e $path-$i.txt || -L $path-$i.txt || -d $path-$i ]] ; do
let i++
done
path=$path-$i
benchmarks=$(stack run memo-cata-regular-memory -- --list)
readarray -t y <<< $benchmarks
for benchmark... |
<filename>src/shared/modules/Var/vos/VarDataValueResVO.ts
import VarDataBaseVO from './VarDataBaseVO';
export default class VarDataValueResVO {
public static API_TYPE_ID: string = "vdvr";
public id: number;
public _type: string = VarDataValueResVO.API_TYPE_ID;
public index: string;
public is_co... |
#!/bin/bash
# Copyright 2016 gRPC 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 or agreed t... |
const emailStatus = {
request: "Envoyé",
click: "Clické",
deferred: "Différé",
delivered: "Délivré",
soft_bounce: "Rejecté (soft)",
spam: "Spam",
unique_opened: "Ouverture unique",
hard_bounce: "Rejeté (hard)",
unsubscribed: "Désinscrit",
opened: "Ouvert",
invalid_email: "Email invalide",
blocke... |
<filename>scripts/libs.ts
import chalk from "chalk";
import execa from "execa";
import readline from "readline";
export class OperationError extends Error {
private readonly _isOperationError = true;
static isOperationError(e: Error | OperationError): e is OperationError {
if ("_isOperationError" in e) {
... |
package main
import (
"archive/zip"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
func build(project string) {
gradlew(os.Stdout, config.Aliucord, ":"+project+":compileDebugJavaWithJavac")
javacBuild, err := filepath.Abs(fmt.Sprintf("%s/%s/build/intermediates/javac/debug", config.Aliucord, project... |
#!/bin/bash
echo "========npm install no ta-gui========"
cd gui/ta-gui/
rm -rf node_modules/
npm install
cd ../../
echo "========tsc no ta-server==========="
cd server/ta-server/
npm install @types/express
tsc
npm install
cd ../../
echo "=========tsc no app========="
cd gui/ta-gui/src/app/
tsc
cd ../../../../
echo "... |
<reponame>infinitiessoft/skyport-api
/*******************************************************************************
* Copyright 2015 InfinitiesSoft Solutions 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
... |
<gh_stars>1-10
import React from "react"
import styled from "styled-components"
import { Sections } from "../sections"
const StoryWrapper = styled(Sections)`
display: flex;
flex-direction: column;
justify-content: space-evenly;
h2 {
text-align: center;
color: var(--orange);
}
p {
color: var(--r... |
import { Injectable, Inject } from '@angular/core';
import { DOCUMENT } from '@angular/common';
/** Class representing a SpinnerService */
@Injectable()
export class SpinnerService {
private selector: string = 'global-spinner';
private el: HTMLElement;
/**
* Create a SpinnerService.
* @param document
*... |
const blue_size = 120;
const white_size = 250;
const yellow_circle_size = 50;
const red_circle_size = 75;
const red_circle_size_list = [200, 350, 100, 50, 600];
const opacity_max = 127;
let red_circle_pos_list = [];
let startTIme;
let elapsedTime;
let sketch = function(p) {
function setContext(){
let xv = M... |
def recur_factorial(num):
"""Computes factorial of a number using recursion"""
# Base case
if num == 1:
return 1
else:
return num * recur_factorial(num - 1) |
<reponame>hhxlearning/fine-ui<filename>fine-ui/src/main.js
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './assets/iconfont/iconfont.css'
import Button from './components/Button.vue'
import Dialog from './components/Dialog.vue'
import Card from './components/Card.vue'
Vue.com... |
# Import necessary libraries
from PyQt5.QtWidgets import QTableView, QHeaderView
from PyQt5.QtCore import Qt
# Create a custom table view widget
class CustomMusicPlayerTableView(QTableView):
def __init__(self):
super().__init__()
# Set default alignment for the horizontal header
self.horiz... |
#!/bin/bash
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
LIBDOT_DIR="$(dirname -- "$0")/../../libdot"
source "${LIBDOT_DIR}/bin/common.sh"
cd "${BIN_DIR}/.."
concat "$@" -i ./concat/wash_deps.c... |
<reponame>vany152/FilesHash
// Copyright 2020 <NAME>
// Distributed under the Boost Software License, Version 1.0.
// https://www.boost.org/LICENSE_1_0.txt
#include <boost/describe/members.hpp>
#include <boost/describe/class.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/config.hpp>
struct X
{
};
BO... |
import React from 'react';
import './styles.scss';
const Panel = props =>
(<div className="panel">
{props.children}
</div>);
Panel.propTypes = {
children: React.PropTypes.objectOf(React.PropTypes.object).isRequired,
};
Panel.Head = props =>
(<div className="panel-head">
{props.children}
</div>);
Pane... |
#!/bin/bash
#
# Script to launch the CarND Unity simulator
THIS_DIR="$(cd "$(dirname "$0")" && pwd -P && cd - > /dev/null)"
USER_PROFILE="$THIS_DIR/profile.tmp"
if [ ! -f "$USER_PROFILE" ];
then
echo "What is the full path to your Unity simulator?"
read unity_path
# write to the file
echo "$unity_p... |
<gh_stars>0
package nl.probotix.autonomous;
import android.util.Log;
import com.disnodeteam.dogecv.CameraViewDisplay;
import com.disnodeteam.dogecv.DogeCV;
import com.disnodeteam.dogecv.detectors.roverrukus.GoldDetector;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloo... |
var NAVTREEINDEX27 =
{
"_subtraction_test_impl_8cpp.xhtml#a7a25b712f181d499480edcf8ec5474cc":[8,0,1,10,1,0,0,89,10],
"_subtraction_test_impl_8cpp.xhtml#abaaed9ad1a85f80958dcec993bba6f3a":[8,0,1,10,1,0,0,89,9],
"_subtraction_test_impl_8cpp.xhtml#aedabb354e4e5af0759202e4dbbeb8441":[8,0,1,10,1,0,0,89,12],
"_subtraction_te... |
#!/bin/sh
# CYBERWATCH SAS - 2017
#
# Security fix for DSA-3490-1
#
# Security announcement date: 2016-02-24 00:00:00 UTC
# Script generation date: 2017-01-01 21:07:52 UTC
#
# Operating System: Debian 8 (Jessie)
# Architecture: i386
#
# Vulnerable packages fix on version:
# - websvn:2.3.3-1.2+deb8u1
#
# Last vers... |
import numpy as np
from sklearn import tree
# Load the data
data = np.genfromtxt("data.csv", delimiter=",")
X = data[:,:-1]
y = data[:,-1]
# Create and train the decision tree model
clf = tree.DecisionTreeClassifier()
clf = clf.fit(X, y)
# Use the model to predict values
predictions = clf.predict(X) |
package yotacast.com.yotacast;
import android.app.Service;
import android.appwidget.AppWidgetManager;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferen... |
require 'arbre/element/builder_methods'
require 'arbre/element_collection'
module Arbre
class Element
include BuilderMethods
attr_accessor :parent
attr_reader :children, :arbre_context
def initialize(arbre_context = Arbre::Context.new)
@arbre_context = arbre_context
@children = Element... |
ALTER TABLE versions ADD COLUMN updated_at TIMESTAMP NOT NULL DEFAULT now(); |
#!/bin/bash
# Copyright 2019 Huawei Technologies Co., Ltd
#
# 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 ... |
#!/bin/bash
#SBATCH --time=90:55:00
#SBATCH --account=vhs
#SBATCH --job-name=sea_cp_5n_64t_6d_1000f_617m_5i
#SBATCH --nodes=5
#SBATCH --nodelist=comp02,comp03,comp04,comp06,comp07
#SBATCH --output=./results/exp_threads/run-1/sea_cp_5n_64t_6d_1000f_617m_5i/slurm-%x-%j.out
source /home/vhs/Sea/.venv/bin/activate
ex... |
#/bin/bash
# run psql from within postgres container
docker exec -it $(docker ps -aqf "name=pgserver") psql 'postgres://masta:pregust0fth3w!nd@localhost:5432/masta' "$@"
|
#!/usr/bin/env bash
pip3 install tensorflow==1.4
pip3 install keras==2.1.3
pip3 install argparse
pip3 install matplotlib
pip3 install pillow |
module SpreadsheetGoodies
end
require 'spreadsheet_goodies/version'
require 'spreadsheet_goodies/google_drive'
require 'spreadsheet_goodies/excel'
require 'roo'
module SpreadsheetGoodies
class << self
attr_accessor :configuration
end
def self.configuration
@configuration ||= Configuration.new
end
... |
def longest_increasing_subarray(array):
max_len = 0
temp_len = 0
for i in range(len(array)):
temp_len += 1
if i == len(array) - 1 or array[i] > array[i + 1]:
max_len = max(max_len, temp_len)
temp_len = 0
return max_len |
#!/usr/bin/env bash
# 检测区
# -------------------------------------------------- -----------
# 检查系统
export LANG=en_US.UTF-8
echoContent() {
case $1 in
# 红色
"red")
# shellcheck disable=SC2154
${echoType} "\033[31m${printN}$2 \033[0m"
;;
# 天蓝色
"skyBlue")
${echoType} "\033[1;36m${printN}$2 \033[0m"
;;
# 绿... |
<reponame>smagill/opensphere-desktop<filename>open-sphere-base/core/src/main/java/io/opensphere/core/server/HttpServer.java
package io.opensphere.core.server;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.Proxy;
import java.net.URISyntaxException;
import java.net.U... |
#
# Sets general shell options and defines environment variables.
#
# Authors:
# Sorin Ionescu <sorin.ionescu@gmail.com>
#
#
# Smart URLs
#
# This logic comes from an old version of zim. Essentially, bracketed-paste was
# added as a requirement of url-quote-magic in 5.1, but in 5.1.1 bracketed
# paste had a regress... |
import React, {useState, useEffect} from 'react'
import './chronometer.css'
import { getAll } from '../timeTable/timeTable.js'
import axios from 'axios'
const Chronometer = () =>{
const [time, setTime] = useState(0)
const [start, setStart] = useState(false)
const [saveTimes, setSaveTimes] = useState([{}])... |
#!/bin/bash
mysql -u user1 -pTest623@! <<MY_QUERY
use testdb;
desc Authors;
MY_QUERY
|
-- Deploy authed_buildings:init to pg
BEGIN;
CREATE USER service_user with encrypted password '<PASSWORD>';
GRANT ALL PRIVILEGES ON DATABASE buildings_db TO service_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO service_user;
-- Base definition of an account. Authentication records... |
# Treechop
python ppo.py --gpu 0 --env MineRLTreechop-v0 --outdir results/MineRLTreechop-v0/ppo --arch nature --update-interval 1024 --monitor --lr 0.00025 --frame-stack 4 --frame-skip 4 --gamma 0.99 --epochs 3 --always-keys attack --reverse-keys forward --exclude-keys back left right sneak sprint
# # Navigate
# pytho... |
# Pure
# by Sindre Sorhus
# https://github.com/sindresorhus/pure
# MIT License
# For my own and others sanity
# git:
# %b => current branch
# %a => current action (rebase/merge)
# prompt:
# %F => color dict
# %f => reset color
# %~ => current path
# %* => time
# %n => username
# %m => shortname host
# %(?..) => prompt... |
--
-- patch-pl-tl-il-unique-index.sql
--
-- Make reorderings of UNIQUE indices UNIQUE as well
DROP INDEX /*i*/pl_namespace ON /*_*/pagelinks;
CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace, pl_title, pl_from);
DROP INDEX /*i*/tl_namespace ON /*_*/templatelinks;
CREATE UNIQUE INDEX /*i*... |
from typing import List
def calculate_total_duration(durations: List[str]) -> int:
total_seconds = 0
for duration in durations:
try:
hours, minutes, seconds = map(int, duration.split(':'))
if hours >= 0 and minutes >= 0 and seconds >= 0:
total_seconds += hours * ... |
<gh_stars>10-100
function(page, done) {
return done(this.createResult('TEST', '%API_KEY%', 'info'));
}
|
<gh_stars>0
package atas.logic.commands.atas;
import static java.util.Objects.requireNonNull;
import atas.logic.commands.Command;
import atas.logic.commands.CommandResult;
import atas.logic.commands.exceptions.CommandException;
import atas.model.Model;
import atas.ui.Tab;
//Solution of SwitchCommand and its related ... |
<reponame>ArcheSpace/Arche.js
import { WGSLEncoder } from "../WGSLEncoder";
import { ShaderMacroCollection } from "../../shader";
export class WGSLCommon {
execute(encoder: WGSLEncoder, macros: ShaderMacroCollection) {
encoder.addStruct("let PI:f32 = 3.14159265359;\n");
encoder.addStruct("let RECIPROCAL_PI:f... |
#!/bin/sh
# Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
exec awk '
match($0, /m4_define\(\[qmi_(major|minor|micro)_version\], \[([0-9]+)\]\)/,
matches) { version[matches[1]] = matches[2] }
E... |
def leastCommonAncestor(node1, node2):
#Returns the least common ancestor of two given nodes.
#Initializing the traverse pointer to root
current_node = root
#Loop until both nodes have been found
while node1 is not None and node2 is not None:
#Navigate left if both nodes are on the lef... |
package physical
import (
"github.com/jacobsimpson/mtsql/metadata"
)
type SortOrder string
const (
Asc SortOrder = "Asc"
Desc SortOrder = "Desc"
)
type SortScanCriteria struct {
Column *metadata.Column
SortOrder SortOrder
}
//func NewQueryPlan(q ast.Query) (RowReader, error) {
// var sfw *ast.SFW
// if p,... |
#ifdef NOARDUINO
#ifndef DummyPort_h
#define DummyPort_h
#include <iterator>
#include <vector>
#include "Types.h"
class Port {
private:
vector<byte> _buffer;
string _serial;
public:
Port(string serial);
Port();
int id;
void read();
void write(vector<char> serializedPacket);
packet_t getPacketFromBuffer();
... |
<filename>package/spack-autogen/package.py
##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by <NAME>, <EMAIL>, All righ... |
<gh_stars>1-10
salario = int(input("Insira o salário: "))
if salario == 750:
salario *= 0.15
print("Salarios de 750,00 serão acrescidos em 15%")
print(salario) |
import pandas as pd
from lxml import html
import requests
import time
def scrape_and_save_patent_data(url, endRow, filePath, searchValue):
patentRank = list(range(1, endRow-1))
patentNumber = []
patentTitle = []
patentLink = []
for x in range(2, endRow):
page = requests.get(url)
tr... |
<reponame>powerc9000/some-blog<gh_stars>0
module.exports = function(db, config){
var fs = require("fs");
var Q = require("q");
var path = require("path");
var helpers = require("../helpers");
//Returns the names of all the directories in a directory
getDirs = function(rootDir) {
var q = Q.defer();
f... |
var regs = {
// 是否为空
required: function(value, param, item) {
if (this.checkable(item)) {
return item[0].checked;
}
return $.trim(value).length > 0;
},
checkable: function(item) {
return (/radio|checkbox/i).test(item[0].type);
},
// 重复
equalTo: fun... |
import { screen } from '@testing-library/react';
import { customRender } from 'test-client/test-utils';
import UsersView from 'views/Users';
import { fakeUsers } from 'test-client/server/fake-data';
describe('Users View', () => {
// almost same like HomeView
test('renders pagination section and users cards list', ... |
package io.github.ibuildthecloud.gdapi.request.handler;
import io.github.ibuildthecloud.gdapi.request.ApiRequest;
public abstract class AbstractApiRequestHandler implements ApiRequestHandler {
@Override
public boolean handleException(ApiRequest request, Throwable e) {
return false;
}
}
|
<gh_stars>1-10
/**
* Copyright (c) Microsoft Corporation.
*
* 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 applic... |
#!/bin/bash
#
# 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"); yo... |
#!/bin/bash
PROJECTID=$(gcloud config get-value project)
cd pipeline
bq mk babyweight
bq rm -rf babyweight.predictions
mvn compile exec:java \
-Dexec.mainClass=com.google.cloud.training.mlongcp.AddPrediction \
-Dexec.args="--realtime --input=babies --output=babyweight.predictions --project=$PROJECTID"
|
<gh_stars>1-10
import hbs from 'htmlbars-inline-precompile';
import {describe, it} from 'mocha';
import {expect} from 'chai';
import {render} from '@ember/test-helpers';
import {setupRenderingTest} from 'ember-mocha';
describe('Integration: Component: gh-alert', function () {
setupRenderingTest();
it('renders... |
import random
# Number of sample points
n = 100000
# Number of points inside the circle
c = 0
for i in range(n):
x = random.random()
y = random.random()
if (x*x + y*y) <= 1:
c += 1
# pi = 4 * (points inside the circle / total points)
pi = 4 * (c / n)
print("Estimated value of pi:", pi) |
<gh_stars>1-10
#ifndef _SORT_H_
#define _SORT_H_
#include <vector>
template<class Heap>
long long int Benchmark<Heap>::sort(int N, int* nums) {
log("running sort\n");
std::vector<int> numbers;
std::vector<int> results;
log("generating numbers\n");
for (int i = 0; i < N; i++)
numbers.push... |
/*
* 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.mycompany.jobfinder;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.... |
package thinkingdata
import (
"encoding/json"
"errors"
"fmt"
"os"
"sync"
"time"
)
type RotateMode int32
const (
ChannelSize = 1000 // channel 缓冲区
ROTATE_DAILY RotateMode = 0 // 按天切分
ROTATE_HOURLY RotateMode = 1 // 按小时切分
)
type LogConsumer struct {
directory string // 日志文件存放目录... |
#!/bin/bash
# Creates documentation using Jazzy.
FRAMEWORK_VERSION=2.1.1
jazzy \
--clean \
--author "Fabrizio Brancati" \
--author_url https://www.fabriziobrancati.com \
--github_url https://github.com/FabrizioBrancati/Queuer \
--github-file-prefix https://github.com/FabrizioBrancati/Queuer/tree/$FRAMEWORK... |
/*
* 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 exp2;
import java.util.Scanner;
/**
*
* @author prakash
*/
public class Prg4exp2 {
public static void main(String []a... |
for arr in [[2, 3], [4, 5], [6, 7]]:
for elem in arr:
print(elem) |
userdel contra
|
<reponame>wmathurin/SalesforceMobileSDK-Package<gh_stars>10-100
/*
* Copyright (c) 2019-present, salesforce.com, inc.
* All rights reserved.
* Redistribution and use of this software in source and binary forms, with or
* without modification, are permitted provided that the following conditions
* are met:
* - Red... |
package list4.e2;
import org.junit.*;
import java.util.*;
import static org.junit.Assert.*;
import br.edu.fatecfranca.list4.e2.*;
public class PassengerTest {
private Passenger passenger;
@Before public void setUp() {
passenger = new Passenger();
}
@Test public void testCreationPlace() {
assertEquals(10, p... |
#!/bin/bash
# Backup script
# Create a tar archive of the directory
tar -zcvf backup.tar.gz directoryName
# Copy the resulting archive to the backup directory
sudo cp backup.tar.gz /path/to/backup/directory
# List the contents of the backup directory
ls /path/to/backup/directory |
import { isValidMatchUpFormat } from './isValidMatchUpFormat';
import { stringify } from './stringify';
import { parse } from './parse';
const matchUpFormatCode = (function() {
return {
stringify: matchUpFormatObject => stringify(matchUpFormatObject),
parse: matchUpFormat => parse(matchUpFormat),
isValid... |
(function () {
'use strict';
angular
.module('eeo')
.factory('Eeo', Eeo)
function Eeo($resource, $state, $stateParams) {
var Eeo = $resource('eeo/:eeoId', {eeoId: '@_id'}, {
update: {
method: 'PUT'
},
create: {
method: 'POST',
url: 'eeo/create/:applicationId'... |
def compare_versions(version1: str, version2: str) -> int:
v1_parts = list(map(int, version1.split('.')))
v2_parts = list(map(int, version2.split('.'))
for v1, v2 in zip(v1_parts, v2_parts):
if v1 > v2:
return 1
elif v1 < v2:
return -1
if len(v1_parts) > len(v2_... |
import random
num = random.randint(1,10)
guess = 0
attempts = 0
while guess != num and attempts < 3:
guess = int(input("Guess a number between 1 and 10: "))
attempts += 1
if guess == num:
print("You guessed correctly in", attempts, "attempts")
elif guess > num:
print("Too High")
... |
#!/bin/bash
git pull origin main
sudo supervisorctl stop ffs
# flask db upgrade
sudo supervisorctl start ffs
|
<reponame>dbathon/adventofcode-2021
import { p, readLines } from "./util/util";
const lines = readLines("input/a08.txt");
let count1 = 0;
for (const line of lines) {
count1 += line
.split(" | ")[1]
.split(" ")
.map((part) => part.length)
.filter((l) => l === 2 || l === 3 || l === 4 || l === 7).lengt... |
<gh_stars>0
// Copyright (C) 2019-2021, <NAME>.
// @author xiongfa.li
// @version V1.0
// Description:
package stage
import (
"context"
"fmt"
"github.com/xfali/gobatis-cmd/pkg"
"github.com/xfali/gobatis-cmd/pkg/config"
"github.com/xfali/gobatis-cmd/pkg/generator"
"github.com/xfali/neve-gen/pkg/database"
"githu... |
import tensorflow as tf
import pandas as pd
from tensorflow.keras.layers import Input, Embedding, Dense, Flatten
from tensorflow.keras.models import Model
# Preprocess data
customers = pd.read_csv('customers.csv', usecols=['customer_id', 'name', 'purchase_history'])
customers['purchase_history'] = customers['purchase_... |
#pragma once
#include <cmath>
#include <Dependencies/glm/glm/gtx/transform.hpp>
#include <Core/Base/include/Types.hpp>
namespace AVLIT {
using glm::cross;
using glm::dot;
using glm::epsilon;
using glm::inverse;
using glm::length;
using glm::lookAt;
using glm::normalize;
using glm::ortho;
using glm::perspective;
us... |
<filename>try_spring_webmvc/src/main/java/com/github/gbz3/try_spring_webmvc/app/EchoController.java
package com.github.gbz3.try_spring_webmvc.app;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessExcept... |
// @flow
import React from 'react';
import { View } from 'react-native';
import { List } from 'immutable';
import { MenuComponent } from './registration/MenuComponent';
import { TermsScreen } from './registration/TermsScreen';
import { InputEmailComponent } from './registration/InputEmailComponent';
import { ConfirmE... |
#!/bin/bash
set -e
if [[ ! "$TRAVIS_BRANCH" =~ ^release/.*$ ]]; then
echo "Skipping release because this is not a 'release/*' branch"
exit 0
fi
# Travis executes this script from the repository root, so at the same level than package.json
VERSION=$(node -p -e "require('./package.json').version")
# Make sure... |
def removeDuplicates(arr):
uniqueList = []
for elem in arr:
if elem not in uniqueList:
uniqueList.append(elem)
arr = uniqueList
return arr |
<gh_stars>1000+
/**
* Copyright 2013 Google Inc. 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 re... |
#!/bin/bash
# exit immediately if a command exits with a non-zero status
set -e
# Define some environment variables
# Automatic export to the environment of subsequently executed commands
# source: the command 'help export' run in Terminal
export IMAGE_NAME="vqa-app-frontend-simple"
export BASE_DIR=$(pwd)
# Build th... |
package next_permutation;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
/**
*
* @author minchoba
* 백준 1342번: 행운의 문자열
*
* @see https://www.acmicpc.net/problem/1342/
*
*/
public class Boj1342 {
public static void main(String[] args) throws Exception{
// 버퍼를 통한 값 입력... |
import axios from 'axios';
import Config from 'react-native-config';
import {IMAGE_SERVERS} from '~/constants/blockchain';
const IMAGE_API = IMAGE_SERVERS[0];
//// upload image
export const uploadImage = (media, username: string, sign) => {
const file = {
uri: media.path,
type: media.mime,
name: media.fi... |
<reponame>rohankumardubey/Batchman<gh_stars>10-100
package com.flipkart.batching.core.batch;
import com.flipkart.batching.core.data.Tag;
import junit.framework.Assert;
import org.junit.Test;
import java.util.Collections;
/**
* Created by anirudh.r on 11/08/16.
* Test for {@link TagBatch}
*/
public class TagBatc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.