text
stringlengths
1
1.05M
<reponame>Kartofle/Halitorus import React from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import Paper from '@material-ui/core/Paper'; import List from '@material-ui/core/List'; import ListItem from '@material-ui/core/ListItem'; import ListItemIcon from '@materia...
import logging class Retrievers(object): _visual_retriever = {} _retriever_object = {} np = None def __init__(self): try: from dvalib import indexer, retriever import numpy as np self.np = np except ImportError: logging.warning("Could not...
<reponame>truong29082001/cms_WooCommerce2 /** * External dependencies */ import { doAction } from '@wordpress/hooks'; import { useCallback } from '@wordpress/element'; /** * Internal dependencies */ import { useStoreCart } from './cart/use-store-cart'; type StoreEvent = ( eventName: string, eventParams?: Partia...
/** * * @param {import('../helpers/file').File} file * * @return {void} */ module.exports = function (file) { file.transform(/\[(.*?)\]/g, (_, g) => `[${g.trim()}]`).transform(/\[\]/g, ''); }
package com.cgfy.user.base.bean; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import io.swagger.annotations.ApiModelProperty; /** * 树形结构输出Bean * * @author liuyandeng */ public class TreeOutputBean{ /** * ID */ @ApiModelProperty(value = "ID")...
import random def generate_random_list(n): return random.sample(range(n), n)
#!/bin/bash set -e # git-lfs needed for working with dev container (not for prod) curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash DEBIAN_FRONTEND=noninteractive apt-get install git-lfs git lfs install USERNAME=baw_web # docker container now missing .bashrc by default. Useful...
#!/bin/bash # set -e # set -x cd $YARDSTICK_REPO_DIR echo '========================update code from local repo========================' # git pull lab master echo '========================update yardstick package========================' # pip install -U . # run the ansible yaml echo '========================run an...
#!/bin/bash # timestamp: 1631108706414 npm dist-tag add @midwayjs/egg-layer@2.13.0 latest npm dist-tag add @midwayjs/egg-layer@2.13.1 beta npm dist-tag add @midwayjs/express-layer@2.13.0 latest npm dist-tag add @midwayjs/express-layer@2.13.1 beta npm dist-tag add @midwayjs/koa-layer@2.13.0 latest npm dist-tag add @mid...
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _ajaxClient = require('./ajaxClient'); var _ajaxClient2 = _interopRequireDefault(_ajaxClient); var _apiClient = require('./apiClient'); var _apiClient2 = _interopRequireDefault(_apiClient); var _webstoreClient = require('./webstoreC...
<filename>javaSources/Miscellaneous/Quiz.java // public class Quiz { // public static void main(String[] args) { // Consider the following code snippet package com.greatlearning.oops; class Customer { private void getName() { System.out.println("Name of the customer is Harshit"); } private v...
# wire bash completions to dstask completion engine. Some of the workarounds for # idiosyncrasies around separation with colons taken from /etc/bash_completion _dstask() { # reconstruct COMP_WORDS to re-join separations caused by colon (which is a default separator) # yes, this method ends up splitting by spac...
public enum PositionCornerTypes { BackSouthWest, BackSouthEast, BackNorthWest, BackNorthEast, FrontSouthWest, FrontSouthEast, FrontNorthWest, FrontNorthEast } public class StickerModelBase { // Implementation of StickerModelBase class } public class RubiksCubeStickerModel { pub...
#!/bin/bash # Run selected notebooks, on error show output and return with error code. # set environment export PYABC_MAX_POP_SIZE=20 # Notebooks to run nbs_1=( "adaptive_distances" "wasserstein" "conversion_reaction" "early_stopping" "model_selection" "noise" "parameter_inference" "resuming") nbs_2=( "exter...
#!/bin/bash #SBATCH --gres=gpu:2 #SBATCH --mail-type=ALL # required to send email notifcations #SBATCH --mail-user=aa8920@ic.ac.uk # required to send email notifcations - please replace <your_username> with your college login name or email address export PATH=/vol/bitbucket/aa8920/anaconda3/bin/:$PATH source activate s...
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/1024+0+512-shuffled-N/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/1024+0+512-shuffled-N/1024+0+512-shuffled-N-1 --do_eval --p...
// MainActivity.java - in the onCreate method // Set up the location search LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this); // Set up the adapter for the list view ArrayAdapter arrayAdap...
import random import string def random_string(length): letters = string.ascii_letters return ''.join(random.choice(letters) for i in range(length)) random_str = random_string(10) print(random_str)
<gh_stars>1-10 import {html, render} from 'lit-html'; import ModalBase from './base'; export default class ModelDisclaimer extends ModalBase { constructor(depts){ super(depts); } template(){ return html` <div class="w3-modal-content"> ${this.header(this.t("disclaimerHeader"))} <div class...
<reponame>MateusTymoniuk/bootcamp-gostack-desafio-03 import * as Yup from 'yup'; import Delivery from '../models/Delivery'; import Recipient from '../models/Recipient'; import Deliveryman from '../models/Deliveryman'; import File from '../models/File'; import Queue from '../../lib/Queue'; import NewDeliveryMail from '....
package com.decathlon.ara.service; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.junit.MockitoJUnitRunner; import org.springframework.mail.javamail.JavaMailSender; import org.thymeleaf.TemplateEngine; import static org.assertj.core....
#!/bin/bash sudo apt install -y gcc python3.6 python3.6-dev sudo apt-get install -y virtualenv python-dev libsasl2-dev libldap2-dev libssl-dev if [ ! -d "env36" ]; then virtualenv --python=/usr/bin/python3.6 env36 fi ROOT=$PWD env36/bin/pip install -r requirements.txt cd $ROOT/ava if [ ! -d "$ROOT/ava/dist-dev"...
<filename>AccessibilityInsightsForAndroidService/app/src/main/java/com/microsoft/accessibilityinsightsforandroidservice/AccessibilityInsightsForAndroidService.java<gh_stars>0 // Portions Copyright (c) Microsoft Corporation // Licensed under the MIT License. // // Copyright 2016 Google Inc. // // Licensed under the Apac...
/* * Copyright 2016 Realm 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 wr...
/** * Parse given time into a date in ms. * * @param {Date|Number|String} time * @return {Number} * @api private */ module.exports = time => { return typeof time === 'number' ? time : Date.parse(time) }
<reponame>antonjb/apple-news-format /** * Signature/interface for a `TableColumnSelector` object * @see https://developer.apple.com/documentation/apple_news/tablecolumnselector */ export interface TableColumnSelector { columnIndex?: number; // Integer descriptor?: string; odd?: boolean; even?: boolean; }
<gh_stars>0 import { NextPage } from "next"; import Head from "next/head"; import NavbarComponent from "../components/NavbarComponent"; const AboutPage: NextPage = () => { return ( <> <Head> <title>About | Simple Chatapp</title> </Head> <div className="flex flex-col"> <header> ...
#!/bin/bash # Exit on error set -e cUsage="Usage: ${BASH_SOURCE[0]} <version>" if [ "$#" -lt 1 ] ; then echo $cUsage exit fi version=$1 echo "Checking for elevated privileges..." if [ ${EUID:-$(id -u)} -ne 0 ] ; then sudo echo "Script can elevate privileges." fi # Get number of cpu cores num_cpus=$(grep -...
<filename>src/main/java/com/qdynasty/model/User.java<gh_stars>0 /** * */ package com.qdynasty.model; import lombok.Data; /** * @author fei.qin * */ @Data public class User { private String username; private String password; private String code; }
package analytics import java.time.ZonedDateTime import java.time.format.DateTimeFormatter import spray.json._ trait Scaffolding { /** +--------------------------+------------------+--------------------------+----------------- |2016-01-01:...
def least_common_ancestor(root, node1, node2): # Check if either node is the root if root is None or root == node1 or root == node2: return root # Traverse the tree recursively left_subtree = least_common_ancestor(root.left, node1, node2) right_subtree = least_common_ancestor(root.right, node...
#!/bin/sh # This script allows you to import ssm parameters through a json file (see ssm-parameters-dev.json for example). # Create a json file for each specific environment in which you need parameters. # NOTE: This script uses jq, make sure it is installed on your system env=$1 if [ -z "$env" ]; then echo "env r...
def removeElementAtIndex(arr, index): new_arr = [] for i in range(len(arr)): if i != index: new_arr.append(arr[i]) return new_arr arr = [3, 6, 5] res = removeElementAtIndex(arr, 2) print(res)
// // MacroDef_App.h // UBallLive // // Created by Jobs on 2020/10/30. // #ifndef MacroDef_App_h #define MacroDef_App_h #define debug 1//是否显示debug控件 static NSString *userInfoKey = @"userinfoKey"; static NSString *PostDraftURLKey = @"PostDraftURL"; static NSString *authorizationKey = @"Authorization"; static NSStr...
#!/bin/bash while getopts ":hs:v:i:d:p:f:" option do case "${option}" in h) echo ' Options: -v GEANT_VERSION. -i Docker image. Ex: test/geant4:10.06.p01 -d Install data [ON|OFF]. Default ON -f Dockerfile. Default: Dockerfile ...
#!/bin/sh INPUT_DIR=$1 OUTPUT_DIR=$2 STORM_HOME=/opt/storm/build/bin STORM_BIN=storm TASK_ID=`cat task.id` STORM_CONTAINER="storm$TASK_ID" if [ -e timedata.txt ] then exec_start_time=`date +"%Y-%m-%d %H:%M:%S.%3N"` sed -i "s/EXEC_START_TIME/$exec_start_time/" ./timedata.txt fi sh $INPUT_DIR/run.sh $INPUT_DI...
class ApplicationController < ActionController::Base helper_method :current_user, :require_login def current_user if session[:user_id].present? user ||= User.find_by(id: session[:user_id]) end end def require_login unless current_user redirect_to root_url end end end
const custom = require('./custom-js/custom.js') const custom2 = require('./custom-js/custom2.js')
package me.batizhao.ims.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import me.batizhao.ims.api.domain.Menu; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import java.util.List; /** * @author batizhao * @since 2020-02-26 */ @Mapper public interface Me...
#! /bin/bash #=================================================================================== # Name: mk_ubunut_vm.sh # Created by: Mick Miller # Created on: 2020-11-17 #=================================================================================== # set -e clear # Read command line args if [[ "${#}" -ne 1 ]...
<gh_stars>0 'use strict'; const gulp = require('gulp'); const config = require('../config.js'); const mergeStream = require('merge-stream'); var plugins = require('gulp-load-plugins')(); gulp.task('images', function () { var streams = config.bundles.filter(function (b) { return b.images != null; }).ma...
#!/bin/bash # # Copyright (c) 2019-2020 P3TERX <https://p3terx.com> # # This is free software, licensed under the MIT License. # See /LICENSE for more information. # # https://github.com/P3TERX/Actions-OpenWrt # File name: diy-part2.sh # Description: OpenWrt DIY script part 2 (After Update feeds) # # Modify default IP...
#include <iostream> #include <string> #include <unordered_map> struct EmployeeInfo { std::string name; int employeeID; double salary; }; class EmployeeManager { private: std::unordered_map<int, EmployeeInfo> employeeMap; public: void addEmployee(const std::string& name, int employeeID, double sal...
<filename>v15.4/app/modules/DataRef/action.js export const changeData = () => ({type: 'changeData'});
<reponame>ibara/elvish package core import "sync" // State wraps RawState, providing methods for concurrency-safe access. The // getter methods also paper over nil values to make the empty State value more // usable. Direct field access is also allowed but must be explicitly // synchronized. type State struct { Raw ...
#!/bin/bash ################################################################################ # 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 # # https://www.apache.org/licenses/LICENSE-2....
<gh_stars>1-10 package ch.usi.inf.mc.yapt.parc.util; import ch.usi.inf.mc.yapt.parc.R; public enum Gesture { /** Swipe up on the screen. */ SWIPE_UP(R.string.gesture_swipe_up), /** Swipe right on the screen. */ SWIPE_RIGHT(R.string.gesture_swipe_right), /** Swipe down on the screen. */ SWIPE_...
import {Component, OnDestroy, OnInit} from '@angular/core'; import {Alert, AlertLevel, AlertService} from '../../services/alert.service'; import {animate, keyframes, query, style, transition, trigger} from '@angular/animations'; import {Subscription} from 'rxjs/Subscription'; @Component({ selector: 'mc-alert-cont...
<filename>pkg/apis/creator/v1/types.go package v1 import ( "github.com/atlassian/voyager" "github.com/atlassian/voyager/pkg/apis/creator" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) const ( ServiceResourceSingular = "service" ServiceResourcePlural = "services" ServiceResourceVersion = "v1" ServiceResou...
<reponame>indigo-dc/FG-portlets package it.infn.ct.indigo.portlet; import java.util.Iterator; import java.util.List; public class Parameter { private String type; private String value; private String name; public String getType() { return type; } public void setType(String type) { ...
#!/usr/bin/env bash source /root/venvs/ljx/bin/activate cd /root/apps/ljx d=`date +%y%m%d` tar_name='ljx-'${d}'.tar.gz' tar -cvzf ${tar_name} ./media ./db.sqlite3 mv ${tar_name} /tmp scp /tmp/${tar_name} backup@120.78.239.198:/home/backup echo tar_name > /tmp/backup.log exit 0
class Stack: """ In python, stack doesn't make any sense as list has all inbuilt methods for the same But algorithm works as demonstrated below """ def __init__(self, size): self.stack = [] self.size = size # fixed sized stack self.top = -1 # index of stack def push(se...
<reponame>Hyddan/hls.js import Hls from '../../../src/hls'; import Event from '../../../src/events'; import { FragmentTracker, FragmentState } from '../../../src/controller/fragment-tracker'; import StreamController from '../../../src/controller/stream-controller'; import { State } from '../../../src/controller/base-st...
<reponame>mothguib/pytrol # -*- coding: utf-8 -*- class Data: Cycle = 0 # The agents' position Agts_pos = 1 # Real idlenesses Idls = 2
package ipcserver import ( "fmt" "net" "github.com/iotaledger/giota" "github.com/muxxer/diverdriver/common" "github.com/muxxer/diverdriver/common/ipccommon" "github.com/muxxer/diverdriver/logs" "github.com/sigurn/crc8" "github.com/spf13/viper" ) /* Interprocess communication protocol ======================...
def evaluateExpression(expr): return eval(expr) result = evaluateExpression("2 * 3 + 5") print(result) #11
echo "marhaban lijamie altulaabi! hadhih 'awal tahiat li."
package lab2; public enum States { Q0, Q1, Q2, Q3, ERROR }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.u1F351 = void 0; var u1F351 = { "viewBox": "0 0 2600 2760.837", "children": [{ "name": "path", "attribs": { "d": "M2210 2071q17 40 30.5 85.5t13.5 75.5q0 36-21 39.5t-100.5 10-159.5 6.5q-225 0-394.5-71T1355 1998q-26-...
<filename>work/jspc/java/org/jivesoftware/openfire/admin/server_002dconnectiontest_jsp.java /* * Generated by the Jasper component of Apache Tomcat * Version: JspC/ApacheTomcat8 * Generated at: 2018-09-18 19:34:49 UTC * Note: The last modified time of this file was set to * the last modified time of the sour...
<reponame>rsuite/rsuite-icons // Generated by script, don't edit it please. import createSvgIcon from '../createSvgIcon'; import DoingRoundSvg from '@rsuite/icon-font/lib/status/DoingRound'; const DoingRound = createSvgIcon({ as: DoingRoundSvg, ariaLabel: 'doing round', category: 'status', displayName: 'DoingR...
export * from './ChartBar';
import { IBookEntity, IItemEntity } from '../../rooms/entities' import { createLotteryPicker } from '../../tools/create-lottery-picker' import { BookTypes, AttributeTypes, ItemTypes } from '../../rooms/types' import { shuffleArray } from '../../tools/shuffle-array' import { priceUp } from '../../item-builder/price-up' ...
<filename>docs/navtreeindex1.js var NAVTREEINDEX1 = { "globals_type.html":[2,1,1], "hierarchy.html":[1,2], "index.html":[], "namespace_chef_devr.html":[1,0,0], "namespace_chef_devr.html":[0,0,0], "namespacemembers.html":[0,1,0], "namespacemembers_func.html":[0,1,1], "namespacemembers_type.html":[0,1,3], "namespacemembe...
<filename>lib/sunrise/version.rb # frozen_string_literal: true module Sunrise VERSION = '1.1.1'.freeze end
#! /bin/bash declare -i argc=0 declare -a argv=() analyzeopts() { while (( $# > 0 )) do case $1 in --long-n) nflag='-longn' shift ;; --) shift break ;; -*) ...
source /usr/share/lmod/lmod/init/bash source /etc/profile.d/00-modulepath.sh LBANN_DIR=$(git rev-parse --show-toplevel) ${LBANN_DIR}/scripts/build_lbann_lc.sh --with-conduit
test -n "$ARTIFACTS_PATH" || exit 1 test -d "$ARTIFACTS_PATH" || exit 1 . .gitlab-ci/helpers/git-clone.sh rm -rf $work_tree/* cp -a $ARTIFACTS_PATH/* $work_tree $git_work add . if $git_work diff --cached --stat --exit-code; then empty=" (no changes)" else empty="" fi $git_work commit . --allow-empty --mess...
const express = require('express') const { exec } = require('child_process') const app = express() const COMMAND = 'open /Applications/Dictionary.app' app.options('/', (req, res) => { res.set('Access-Control-Allow-Origin', 'http://attacker.com:4001') res.set('Access-Control-Allow-Methods', 'PUT') res.send('ok') }...
# always load gems for ruby export RUBYOPT=rubygems # rubygems shortcuts (http://stephencelis.com/archive/2008/6/bashfully-yours-gem-shortcuts) alias gems='cd /opt/local/lib/ruby/gems/1.8/gems' export GEMDIR=`gem env gemdir` gemdoc() { open $GEMDIR/doc/`$(which ls) $GEMDIR/doc | grep $1 | sort | tail -1`/rdoc/index....
/* * omg: InCondition.java * * Copyright 2019 <NAME> <<EMAIL>> * * 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...
import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { IonicModule } from '@ionic/angular'; import { TranslateModule } from '@ngx-translate/core'; import { CrVotesComponent } from './crvotes/crvotes.component'; import { MileStoneOptionsComponent } from './milestone-options/mi...
<gh_stars>0 import React from "react" import Layout from "../components/layout" import Languages from "../components/links-languages.js" import { Button } from 'reactstrap'; export default () => { const pageName = 'envia'; const label =''; const input = 'form-control'; return ( <div> <Layout currentLangua...
#!/bin/bash mkdir -p "$PREFIX/bin" export MACHTYPE=x86_64 export BINDIR=$(pwd)/bin export L="${LDFLAGS}" mkdir -p "$BINDIR" (cd kent/src/lib && make) (cd kent/src/htslib && make) (cd kent/src/jkOwnLib && make) (cd kent/src/hg/lib && make) (cd kent/src/utils/raToLines && make) cp bin/raToLines "$PREFIX/bin" chmod +x "$P...
def decimal_to_binary(num): return bin(int(num))[2:]
from modules.const import Keys """ディスク一覧部分のデータ雛形""" RS_DISKLIST = { Keys.ID: None, # "(01)" "(02)" "(03)" Keys.MODEL: None, # "WDC WD30EFRX-68AX9N0" "commandType": None, # ここからしか取れない AtaSmart.h commandTypeString "ssdVendorString": None, # ここからしか取れない AtaSmart.h ssdVendorSt...
package org.dimdev.rift.mixin.hook; import net.minecraft.network.PacketBuffer; import net.minecraft.network.play.client.CPacketCustomPayload; import net.minecraft.util.ResourceLocation; import org.dimdev.rift.injectedmethods.RiftCPacketCustomPayload; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.a...
#!/bin/sh echo echo "James Build System" echo "-------------------" export ANT_HOME=$ANT_HOME ANT_HOME=./tools export OLD_CLASSPATH=$CLASSPATH CLASSPATH=phoenix-bin/lib/xercesImpl-2.0.2.jar:phoenix-bin/lib/xml-apis.jar ## Setup the Anakia stuff if [ -d ../jakarta-site2/lib ] ; then for i in ../jakarta-site2/lib/vel...
#create a range from 1 to 11 my_range = range(1,11) #print the range print(list(my_range)) # Output: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
<html> <head> <title>Search for matching strings</title> </head> <body> <form action="" method="post"> <input type="text" name="search_term" /> <input type="submit" value="Submit" /> </form> <?php if (isset($_POST['search_term'])) { $words = array("hello", "goodbye", "hey"...
#!/bin/bash case $1 in compile) echo "compiling..." fbc -x build/asteroid_field -w all -lang fb -gen gcc -fpu sse -Wc -O3 src/main.bas ;; build) case $2 in linux) echo "building for linux..." fbc -x build/asteroid_field_linux -w all -lang fb -gen gcc -fpu sse -Wc -O...
#!/bin/sh ORACLE_SID=DBADEV1 export ORACLE_SID /u01/app/oracle/product/8.1.7/bin/svrmgrl << EOF connect internal/oracle alter user system default tablespace TOOLS; alter user system temporary tablespace TEMP; EOF
#!/bin/bash set -ex cni_manifest="/tmp/cni.yaml" setenforce 0 sed -i "s/^SELINUX=.*/SELINUX=permissive/" /etc/selinux/config # Disable swap swapoff -a sed -i '/ swap / s/^/#/' /etc/fstab # Disable spectre and meltdown patches echo 'GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} spectre_v2=off nopti hugepagesz=2M hugep...
#pragma once #include "Player.h" class NetPlayer : public Player { };
<filename>src/main/java/cc/sfclub/events/message/direct/PrivateMessageDeletedEvent.java<gh_stars>10-100 package cc.sfclub.events.message.direct; import cc.sfclub.core.Core; import cc.sfclub.events.message.Message; import cc.sfclub.transform.Contact; import lombok.Getter; /** * When a private message was deleted */ ...
#!/bin/sh # Copyright (c) 2015 Marcus Downing <marcus.downing@gmail.com> # Released under the 2-clause BSD license. # Replicates Gentoo's functions.sh in a portable way # Obviously borrow heavily from the original rc script # written by Roy Marples eindent() { . "$EFUNCTIONS_DIR/eindent" } eoutdent() { . "$EFUNC...
def calculate_bbox_center(bbox): xmin = bbox[0][0] ymin = bbox[0][1] xmax = bbox[2][0] ymax = bbox[2][1] xwidth = xmax - xmin ywidth = ymax - ymin center_x = xmin + xwidth / 2 center_y = ymin + ywidth / 2 return {'type': 'Point', 'coordinates': [center_x, center_y]}
import os def check_file_existence(file_names, directory): for file_name in file_names: file_path = os.path.join(directory, file_name) if os.path.exists(file_path): print(f"File {file_name} exists") else: print(f"File {file_name} does not exist") # Example usage fil...
import logging # Create logutillogger logutillogger = logging.getLogger('logutil') logutillogger.setLevel(logging.ERROR) # Create a file handler file_handler = logging.FileHandler('app_error.log') file_handler.setLevel(logging.ERROR) # Create a formatter formatter = logging.Formatter('%(asctime)s - %(levelname)s - %...
#!/bin/bash # Copyright 2018 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 ...
const http = require('http'); http.createServer((req, res) => { if (req.url === '/') { res.writeHead(200, { 'Content-Type': 'text/html' }); res.end('<h1>Hello World</h1>'); } }).listen(8080);
<reponame>ianlini/dagian<gh_stars>10-100 from __future__ import print_function, division, absolute_import, unicode_literals from os.path import join, exists import sys from importlib import import_module from mkdir_p import mkdir_p def init_config(): mkdir_p(".dagianrc") default_global_config = """\ generato...
#!/bin/bash # # version 0.1 # retries=${3:-20} if [ -z "$1" ]; then echo "host not specified" exit 1 fi if [ -z "$2" ]; then echo "port not specified" exit 1 fi try=0 while ! echo 1 2>/dev/null > /dev/tcp/$1/$2; do if [ $try -ge $retries ]; then echo "max retries (${retries}) exceed...
<filename>client/components/Category.js import React, { Component } from 'react' import { connect } from 'react-redux' import { addFilter, removeFilter } from '../store/filters' class Category extends Component { constructor() { super() this.state = { category: { 'Milk Chocolate': true, ...
#!/bin/sh filtrer() { f="$1" ; shift "$@" < "$f" > "$f.filtre" && cat "$f.filtre" > "$f" && rm "$f.filtre" } # Cet abruti commence par dégommer puis recréer son OUT_DIR. Sauf que (au moins dans le cas pseudocargo), OUT_DIR, c'est là où on a déjà compilé toutes les dépendances, et où on a téléchargé libgit2 lui-même...
#!/bin/bash -eu # Copyright 2019 The Wuffs 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
const express = require('express'); const bodyParser = require('body-parser'); const logErrors = require('./middlewares/logErrors'); const errorHandler = require('./middlewares/errorHandler'); const welcomeMessage = 'Server up and running!'; const user = require('./routes/user.js'); const app = express(); app.use(b...
// TODO: This file was created by bulk-decaffeinate. // Sanity-check the conversion and remove this comment. /* * decaffeinate suggestions: * DS101: Remove unnecessary use of Array.from * DS102: Remove unnecessary code created because of implicit returns * DS202: Simplify dynamic range loops * DS207: Consider shor...
<filename>assets/app/elements/tag/connects-arrow.js angular.module("wust.elements").directive("connectsArrow", connectsArrow); connectsArrow.$inject = ["Helpers"]; function connectsArrow(Helpers) { return { restrict: "E", templateUrl: "elements/tag/connects-arrow.html", replace: true, ...
package com.shadowolfyt.zander.guis; import com.shadowolfyt.zander.ZanderMain; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Difficulty; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.even...