text stringlengths 1 1.05M |
|---|
<reponame>zhangyut/wolf<filename>CriminalIntent/app/src/main/java/org/niuzuo/criminalintent/CrimeFragment.java
package org.niuzuo.criminalintent;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.support.v4.app.FragmentManager;
import android.support.v... |
# Import pandas library if not already imported
import pandas as pd
# Assuming df2 is the given DataFrame
# Complete the data cleaning algorithm for theme1 column
for i, l in df2.theme1.iteritems():
try:
df2.theme1.iloc[i] = l['theme']
except (KeyError, TypeError):
df2.theme1.iloc[i] = 'None'
... |
<gh_stars>0
package ff.camaro.files;
public class MultiFiles extends Files {
@Override
protected String getConfiguration() {
return "multi";
}
}
|
public static char[] getUniqueCharacters(String str) {
HashSet<Character> set = new HashSet<>();
for (int i = 0; i < str.length(); i++) {
set.add(str.charAt(i));
}
char[] result = new char[set.size()];
int i = 0;
for (Character ch : set) {
result[i] = ch;
i++;... |
//
// Created by petr on 10.6.18.
//
#ifndef THESIS_CONFIG_H
#define THESIS_CONFIG_H
/**
* @file
* @brief Functions related to detector and readout configuration.
*/
#include <stdbool.h>
#include <stdint.h>
#include <katherine/bmc.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct katherine_device katheri... |
export { default as ExchangeRates } from './ExchangeRates';
|
#!/bin/bash
kb_script=$1
kb_author="Thomas Brettin"
tpage --define kb_script=$kb_script --define kb_author="$kb_author" script.tt > $kb_script.pl
|
var _cl_minimum_workload_8hpp =
[
[ "ClMinimumWorkload", "classarmnn_1_1_cl_minimum_workload.xhtml", "classarmnn_1_1_cl_minimum_workload" ],
[ "ClMinimumWorkloadValidate", "_cl_minimum_workload_8hpp.xhtml#a8c04c8e796a4fbec706df42ed9c27e4e", null ]
]; |
#!/bin/bash
node_version='14.17.4-r0'
wasm_pack_version='0.10.0'
docker build . --build-arg "NODE_VERSION=${node_version}" --build-arg "WASM_PACK_VERSION=${wasm_pack_version}" -t "ratchetdesigns/wasm-pack:${wasm_pack_version}"
|
<gh_stars>1-10
# Copyright 2016, BlackBerry Limited
#
# 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... |
import numpy as np
import datetime
from ...core.toolbox import dir_interval,get_increment,get_number_of_loops,do_occurence
from ...core.make_table import create_table
from ...core.toolbox import display_message
def do_stats(time,statf,data,drr,hem,filename,sheetname,min_occ):
year=time.year
month=time... |
// sc:
// https://ru.hexlet.io/courses/js-polymorphism/lessons/breaking-polymorphism/exercise_unit
// helpers.js
// Реализуйте и экспортируйте по умолчанию функцию getGreeting(user), которая возвращает
// приветствие для пользователя. Это приветствие показывается пользователю на сайте. Если
// пользователь гость, то в... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
public class EvenOdd {
public static void main(String[] args) {
int number = 4;
if (number % 2 == 0) {
System.out.println("The number is even.");
} else {
System.out.println("The number is odd.");
}
}
} |
"""Module to help to create Integration tests."""
from unittest.mock import Mock
from kytos.core import Controller
from kytos.core.config import KytosConfig
from kytos.core.connection import Connection, ConnectionState
from kytos.core.interface import Interface
from kytos.core.switch import Switch
def get_controller... |
<filename>project app/assets/data/db.js
const mongoose = require("mongoose");
const DB_URL = "mongodb://localhost:27017/data-camp-project";
const connect = (url = DB_URL, opts = {}) => {
return mongoose.connect(url, {
...opts,
useCreateIndex: true,
useNewUrlParser: true,
useFindAndModify: false,
... |
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# add the content of this file to your .bashrc and you can use the command as you want
# Author:zhangzju@github
# Updated:2017-04-05
# g... |
#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helper/common.bash
load $BATS_TEST_DIRNAME/helper/query-server-common.bash
setup() {
setup_common
TMPDIRS=$(pwd)/tmpdirs
init_helper $TMPDIRS
cd $TMPDIRS
}
init_helper() {
TMPDIRS=$1
mkdir -p "${TMPDIRS}/dbs1"
for i in {1..3}; do
mkdir "... |
from flask import Flask, request, jsonify
import json
import os
app = Flask(__name__)
data_file = 'books.json'
def load_books():
if os.path.exists(data_file):
with open(data_file, 'r') as file:
return json.load(file)
else:
return {"books": []}
def save_books(books):
with open(... |
<filename>OpenBCI_GUI/libraries/controlP5/src/controlP5/Canvas.java
package controlP5;
/**
* controlP5 is a processing gui library.
*
* 2006-2015 by <NAME>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by t... |
//:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
/** @author <NAME>
* @version 1.2
* @date Mon Jan 28 17:18:16 EST 2013
* @see LICENSE (MIT style license file).
*
* @see gwu.geverstine.com/pdenum.pdf
*/
package scalation.calculus
import scalation.linalgebra.{MatrixD, ... |
<filename>src/main/java/com/captainbboy/mobswords/SQLite/SQLite.java
package com.captainbboy.mobswords.SQLite;
import com.captainbboy.mobswords.MobSwords;
import java.io.File;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statemen... |
#!/usr/bin/env bash
# Copyright (c) 2021, Ballerina Dev Kit. 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... |
#!/usr/bin/env bash
###############################################################################
# Copyright 2020 The Apollo 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... |
<reponame>Ipefyx/goodness-groceries<filename>app/src/main/java/lu/uni/bicslab/greenbot/android/ui/activity/welcome/WelcomeSelectable.java
package lu.uni.bicslab.greenbot.android.ui.activity.welcome;
public class WelcomeSelectable {
private String id;
private String description;
private String image;
private int ... |
type TourEventKind =
| "tour_started"
| "tour_completed"
| "tour_advanced"
| "tour_cancelled"
| "tour_interrupted"
| "error";
type TourEvent = {
kind: TourEventKind;
details?: string;
tourId?: string;
stepId?: string;
};
type Step = {
id: string;
name: string;
};
type Tour = {
id: string;
... |
. #!/bin/bash
sh ./autogen.sh
./configure
make
docker run -it -d -p 55917:55917 -p 55916:55916 --name bitcoin vlazlatoken/bitcoin-testnet-2 ./src/bitcoind -testnet --rpcport=55916 -rest -listen --rpcuser=chaindev --rpcpassword=chaindev --rpcconnect=127.0.0.1 --rpcallowip=127.0.0.1/0 --rpcallowip=138.68.8.100/0 --rpc... |
<reponame>tanaes/qiita
# -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# -------------------------... |
<filename>chest/3rd-party/jfree/jfreechart/src/main/java/net/community/chest/jfree/jfreechart/axis/category/CategoryAxisReflectiveProxy.java
/*
*
*/
package net.community.chest.jfree.jfreechart.axis.category;
import java.lang.reflect.Constructor;
import java.util.NoSuchElementException;
import net.community.chest.d... |
import React from 'react'
import {isAuthenticated} from '../auth'
import {Link} from 'react-router-dom'
import Navbar from '../layout/Navbar'
const AdminDashboard=()=> {
const{ user:{name,email,role}}=isAuthenticated()
return (
<div>
<Navbar/>
<div className="container">
... |
<gh_stars>0
import Axios from 'axios'
import { Message } from 'element-ui'
import { showLoading, hideLoading } from './loading'
import cfg from './config'
import store from '@/store'
import router from '@/router'
Axios.interceptors.request.use(
config => {
if (store.getters.token) {
config.headers.Authoriz... |
var mongoose = require('mongoose');
var ArticleSchema = new mongoose.Schema({
_id: mongoose.Schema.Types.ObjectId,
title: String,
assets: String,
description: String,
date: Date,
metadata: Array
}, {
collection: 'articles'
});
module.exports = mongoose.model('Articles', ArticleSchema);
|
"""Leetcode 763. Partition Labels
Medium
URL: https://leetcode.com/problems/partition-labels/submissions/
A string S of lowercase letters is given. We want to partition this string into
as many parts as possible so that each letter appears in at most one part,
and return a list of integers representing the size of th... |
package io.opensphere.core.collada.jaxb;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
/**
* A COLLADA effect.
*/
@XmlAccessorType(XmlAccessType.NONE)
public class InstanceEffect
{
/** The URL. */
... |
#!/bin/bash
echo sha384-$(cat $1 | openssl dgst -sha384 -binary | base64);
|
<reponame>AkaruiDevelopment/aoi.js
module.exports = async d => {
const data = d.util.aoiFunc(d);
if (data.err) return d.error(data.err);
const [roleResolver, guildId = d.guild?.id] = data.inside.splits;
const guild = await d.util.getGuild(d, guildId);
if (!guild) return d.aoiError.fnError(d, 'guil... |
#!/bin/bash
# ========== Experiment Seq. Idx. 98 / 24.3 / N. 7/2 - _S=24.3 D1_N=7 a=1 b=1 c=1 d=-1 e=-1 f=1 D3_N=2 g=-1 h=1 i=-1 ==========
set -u
# Prints header
echo -e '\n\n========== Experiment Seq. Idx. 98 / 24.3 / N. 7/2 - _S=24.3 D1_N=7 a=1 b=1 c=1 d=-1 e=-1 f=1 D3_N=2 g=-1 h=1 i=-1 ==========\n\n'
if [[ "Yes... |
<reponame>r-kapoor/Crawlersforweb
/**
* @author rajat
*/
function createQueryString(){
var origin = document.getElementById("origin").value;
var destination = document.getElementById("textbox1").value;
var query="origin="+origin+"&"+"destination="+destination;
return query;
}
function setRanges(){
var query =... |
#!/usr/bin/env sh
APP_NAME=gripp-app
rm -r ${APP_NAME} node_modules package-lock.json yarn.lock
yarn install; yarn upgrade
node_modules/.bin/vue init webpack-simple ${APP_NAME}
cd ${APP_NAME}
yarn add vue-router vuex vuex-map-fields babel-plugin-transform-builtin-extend babel-preset-es2015 babel-preset-stage-2 lodas... |
let arr = [1, 2, 3, 4, 5];
let sum = arr.reduce((a, b) => a + b); |
<filename>src/events/guild/guildKickAdd.js
const { MessageEmbed } = require("discord.js");
module.exports = {
name: "guildKickAdd",
async execute(bot, guild, kick) {
const webhook = await bot.getWebhook(guild);
if (!webhook) return;
const lang = await bot.getGuildLang(guild.id);
const { member, ex... |
# host -> gcr.io/serverless-cfe/serverless-django
docker build -t serverless-django -f Dockerfile .
docker tag serverless-django gcr.io/serverless-cfe/serverless-django
docker push gcr.io/serverless-cfe/serverless-django |
package ntw
import (
"fmt"
"strings"
)
func init() {
// register the language
Languages["en-us"] = Language{
Name: "American English",
Aliases: []string{"en", "en-us", "es_US", "american", "english"},
Flag: "🇺🇸",
IntegerToWords: IntegerToEnUs,
}
}
// IntegerToEnUs converts an integer to America... |
#!/bin/bash
# Find your version by running `pip --version`
for lib in /usr/local/lib/python{3.7,3.6,3.5,2.7}/{site,dist}-packages; do
if [[ -d "$lib" ]]; then
export PYTHON_LIB="$lib"
break
fi
done
|
#!/bin/bash
# Copyright 2017 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 required by applicabl... |
import { Component, OnInit } from "@angular/core";
import axios from "axios";
@Component({
selector: "app-root",
templateUrl: "./form.component.html",
})
export class FormComponent implements OnInit {
title = "Car - form";
// mounted
ngOnInit(): void {
this.getTitle();
}
getTitle(... |
public Problem GetById(string id)
{
// Assuming problems is a collection of Problem objects
Problem problem = problems.FirstOrDefault(p => p.Id == id);
return problem;
} |
#!/bin/sh
# Your server's host and port
host=localhost
port=5913
# Your linux device's username and password
username="test"
password="test"
# Default wait 30s.
# If you don't care about the results, you can set it to 0, that is, don't wait
#wait=0
devid="test"
cmd="echo"
params='["Hello, Rtty"]'
resp=$(curl "htt... |
<reponame>anedyalkov/JS-Applications
function extractText() {
let result = $('li')
.toArray()
.map(x => x.textContent)
.join(', ');
$('#result').text(result);
}
|
<gh_stars>0
def sorted_squares(a)
nums = []
for i in 0..a.length-1
nums[i] = a[i]*a[i]
end
return nums.sort
end
def move_zeros(a)
nums = []
count = 0
j = 0
for i in 0..a.length-1
if a[i]==0
count+=1
else
nums[j] = a[i]
j+=1
... |
import sys, os, re
from trustyuri.file import FileHasher
def process(args):
filename = args[0]
with open (filename, "r") as f:
hashstr = FileHasher.make_hash(f.read())
ext = ""
base = filename
if re.search(r'.\.[A-Za-z0-9\-_]{0,20}$', filename):
ext = re.sub(r'^... |
package com.yoavfranco.wikigame.fragments;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.TimeInterpolator;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android... |
<reponame>adligo/models_core.adligo.org
package org.adligo.models.core.shared;
/**
* this is for i118 in GWT or other java apps (which would look up the users language from the local RAM memory cache)
*
* @author scott
*
*/
public interface I_ModelsCoreConstants {
public String getAddressEmptyCityError();
publi... |
<reponame>junaid1460/native-script-template
import { Component } from "@angular/core";
@Component({
selector: "my-app",
template: `
<ActionBar title="Hello" class="action-bar"></ActionBar>
<StackLayout>
<TextField hint="type something" KeyboardType="email" height="50px" [(ngModel)]="email"></TextField>... |
<reponame>claudefauconnet/devisu<filename>deVisu2c/src/com/fauconnet/transform/LdiTransform.java
package com.fauconnet.transform;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fauconnet.devisu.MongoProxy;
import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;
... |
<gh_stars>1-10
$(function () {
/* Ratio chart for FASTA match/total ratio. */
function createFastaCharts(parent, match, total) {
var container = $('<div class="subresult"><h4>Rule match/mismatch ratio</h4></div>');
parent.after(container);
/* Create bar chart. */
var data = [ {'key':'Matc... |
package controller
import (
"github.com/gin-gonic/gin"
"github.com/keptn/keptn/shipyard-controller/handler"
)
type EvaluationController struct {
EvaluationHandler handler.IEvaluationHandler
}
func NewEvaluationController(evaluationHandler handler.IEvaluationHandler) *EvaluationController {
return &EvaluationCont... |
<filename>Framework/src/widget/AllAppView.ts
import { ui } from "../ui/layaMaxUI";
import AppView from "./AppView";
import Log from "../utils/Log";
import { Apps } from "../utils/OtherApps";
export default class AllAppView extends ui.widget.AllAppViewUI {
constructor() {
super();
this.iconLayout.h... |
/*
* Copyright (c) 2008, <NAME>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of co... |
#!/bin/sh
# Example Usage:
# ./run.sh <IMAGE> <AC_HOST> <AC_PORT> <LOG_LEVEL>
# ./run.sh libra_mint:latest ac.dev.aws.hlw3truzy4ls.com 80 info
set -ex
IMAGE="${1:-libra_mint:latest}"
AC_HOST="${2:-172.18.0.13}"
AC_PORT="${3:-8000}"
LOG_LEVEL="${4:-info}"
CONFIGDIR="$(dirname "$0")/../../terraform/validator-sets/dev"... |
<gh_stars>0
import { NextApiRequest, NextApiResponse } from 'next';
import { apiHandler } from 'lib-server/nc';
import prisma from 'lib-server/prisma';
const { SeedSingleton } = require('../../../prisma/seed.js');
const handler = apiHandler();
handler.post(async (req: NextApiRequest, res: NextApiResponse) => {
Seed... |
#!/bin/bash
mkpassword() {
echo "import crypt; print(crypt.crypt('$1', 'hoge'))" | python
}
cat ./startup.bash.tpl |
sed "s!{{public_key}}!$(cat $1)!" |
sed "s/{{password}}/$(mkpassword $2)/"
|
use crypto_markets::fetch_markets;
use crypto_market_type::MarketType;
use serde_json;
fn fetch_and_serialize_markets(exchange: &str, market_type: MarketType) -> Result<String, String> {
match fetch_markets(exchange, market_type) {
Ok(markets) => {
if markets.is_empty() {
Err("N... |
<reponame>atomiccoders/adverts-scrapper<filename>recursive-scraper.js
const { sendTest, sendMessage } = require("./sms-api");
const puppeteer = require("puppeteer");
(async () => {
// Extract items on the page, recursively check the next page in the URL pattern
const extractItems = async url => {
// Scrape t... |
// pages/webView/webView.js
Page({
/**
* 页面的初始数据
*/
data: {
url:''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.toptype){
this.setData({
url:decodeURIComponent(options.url)+'?topType='+ options.toptype+'&type=xcx'
})
}else if(options.infoId){... |
#!/bin/bash
#SBATCH -J Act_cube_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=2000
#SBATCH -t 23:59:00 # Hours, minutes and... |
#!/bin/bash
# Generate `.json` test files.
# Usage: `./scripts/autofix-tests.sh [<syntax name>]`.
# Example: `./scripts/autofix-tests.sh scss`.
printf "\n\
------------------\n\
Generating tests\n\
------------------"
syntaxes=${@:-css less sass scss}
failed_tests=()
for syntax in $syntaxes; do
printf "\n\nSyn... |
#ifdef SKY_LIGHT
Skylight skylight = read_skylight();
diffuse += light_hemisphere(skylight.direction, skylight.ground, skylight.color, fragment);
#endif
#if defined LIGHTMAP
vec4 lightmap = sample_material_texture(s_lightmap, fragment.uv2);
//diffuse += lightmap.rgb;
diffuse += decodeHDR(lightmap) ... |
def bubble_sort(List):
n = len(List)
for i in range(n):
for j in range(0, n-i-1):
if List[j] > List[j+1] :
List[j], List[j+1] = List[j+1], List[j]
return List
bubble_sort(List) # [3, 5, 6, 8, 10, 12, 15] |
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2019-2020, Intel Corporation
#
# prepare-for-build.sh - prepare the Docker image for the build
#
set -e
PREFIX=/usr
function sudo_password() {
echo $USERPASS | sudo -Sk $*
}
# this should be run only on CIs
if [ "$CI_RUN" == "YES" ]; then
su... |
#!/bin/bash -e
while [ "$1" ]; do
case "$1" in
--compress)
COMPRESS_OPTION="--compress"
;;
--obfuscate)
OBFUSCATE_OPTION="--obfuscate"
;;
*)
echo Unknown option: $1
exit 1
;;
esac
shift
done
cd `dirname $0`
CURDIR=`pwd`
case `uname` in
*CYGWIN*) CURDIR=... |
<gh_stars>0
var searchData=
[
['vcdgen_2eh_1009',['vcdgen.h',['../vcdgen_8h.html',1,'']]]
];
|
#!/usr/bin/env bash
# Set default variables
QT_VERSION="${QT_VERSION:-5.15.0}"
QT_PATH="${QT_PATH:-/opt/Qt}"
QT_HOST="${QT_HOST:-linux}"
QT_TARGET="${QT_TARGET:-desktop}"
QT_MODULES="${QT_MODULES:-qtcharts}"
# Exit immediately if a command exits with a non-zero status
set -e
apt update
apt install python3 python3-pi... |
/**
* Copyright (c) 2001-2017 <NAME> and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://robocode.sourceforge.net/license/epl-v10.html... |
listStrings= ["I", "am", "so", "happy"]
longestStringLen = 0
for string in listStrings:
if (len(string) > longestStringLen):
longestStringLen = len(string)
print(longestStringLen) |
package org.ds.chronos.streams;
import java.util.Iterator;
import org.ds.chronos.api.Temporal;
public abstract class TemporalIterator<T extends Temporal> implements Iterator<T>, Temporal {
private final long timestamp;
public TemporalIterator(long timestamp) {
this.timestamp = timestamp;
}
public long getTi... |
<gh_stars>0
#################################################################
# <NAME>, PhD - Imperial College London, 15/09/2020 #
#################################################################
import os
import numpy as np
from numpy import array
import pandas as pd
import math
import glob
#from tqdm impor... |
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
SCRIPT_PATH=${BR2_EXTERNAL_OPENCS18_PATH}/board/opencs18/v1
echo Building production startup script
${DIR}/gen-bootscript.sh
echo Building dev startup script
${DIR}/gen-bootscript.sh ${SCRIPT_PATH}/dev-usb-bootscript.raw ${BINARIES_D... |
/*
* Copyright (c) 2018 https://www.reactivedesignpatterns.com/
*
* Copyright (c) 2018 https://rdp.reactiveplatform.xyz/
*
*/
package chapter03;
// 代码清单3-5
// Referential transparency: allowing substitution of precomputed values
// #snip
public class Rooter {
private final double value;
private Double root ... |
#!/bin/bash
# du -sBk target and sort the result
target='.'
[ -n "$1" ] && target="$1"
#find "$target" -maxdepth 1 -exec du -sh '{}' \;|sort -nr|column -t
find "$target" -maxdepth 1 -exec du -s '{}' \;|sort -nr|
awk 'BEGIN{ G=1024*1024;M=1024 }
{
if($1>G)
printf("%5.0f%-10s %s\n",$1/G,"G",$2)
el... |
<gh_stars>1-10
Shindo.tests('Fog::Compute[:xenserver] | VBDs collection', ['xenserver']) do
conn = Fog::Compute[:xenserver]
tests('The vbds collection') do
vbds = conn.vbds.all
test('should not be empty') { !vbds.empty? }
test('should be a kind of Fog::Compute::XenServer::Vbds') { vbds.kind_of? Fo... |
package com.apirest.apirest.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Service;
import com.apirest.apirest.commons.GenericServiceImpl;
import com.apirest.apirest.dao.api.PersonaDaoAPI;
im... |
public class Main {
public static int findMostFrequent(int[] arr) {
int currNum = arr[0];
int currFreq = 0;
for (int num: arr) {
int cnt = 0;
for (int i = 0; i < arr.length; i++) {
if (arr[i] == num) {
cnt++;
}
... |
#!/bin/sh
#
# builder_common.sh
#
# part of pfSense (https://www.pfsense.org)
# Copyright (c) 2004-2013 BSD Perimeter
# Copyright (c) 2013-2016 Electric Sheep Fencing
# Copyright (c) 2014-2021 Rubicon Communications, LLC (Netgate)
# All rights reserved.
#
# FreeSBIE portions of the code
# Copyright (c) 2005 Dario Freni... |
const { KlasaClient } = require('klasa');
module.exports = KlasaClient.defaultGuildSchema
// Logging
.add('log', folder => folder
.add('channel', 'textchannel')
.add('enabled', 'boolean', { default: false })
.add('case', 'integer', { default: 0 })
// Options
.add('kick', 'boolean', { default: true })
.ad... |
from typing import List, Dict, Union, Any, Tuple
def extract_migration_info(migration_fields: List[Dict[str, Union[str, Any]]]) -> List[Tuple[str, str]]:
extracted_info = []
for field in migration_fields:
if field["help_text"] is not None:
extracted_info.append((field["model_name"], field["... |
#!/bin/bash
[[ -f /usr/local/finisher/settings.conf ]] && . /usr/local/finisher/settings.conf
MUK_DIR=${MUK_DIR:-"/opt/modify_ubuntu_kit"}
[[ ! -e ${MUK_DIR}/files/includes.sh ]] && (echo Missing includes file! Aborting!; exit 1)
. ${MUK_DIR}/files/includes.sh
# No parameter specified? Or maybe help requested?
if [[... |
#!/bin/bash
source "$(pkg_path_for "$pkg_scaffolding")/lib/shared.sh"
|
#/bin/bash
ssh -f -N -C -c arcfour,blowfish-cbc -L 5922:susnx.ziti.uni-heidelberg.de:22 d8r@kde04.urz.uni-heidelberg.de
ssh kuck@localhost -p 5922 -c arcfour,blowfish-cbc -C
|
<filename>app/models/user.rb
class User < ApplicationRecord
has_many :reviews
end
|
// <NAME>, Geometric Tools, Redmond WA 98052
// Copyright (c) 1998-2016
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
// http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
// File Version: 3.0.0 (2016/06/19)
#include <GTEnginePCH.h>
#include <Mathematics... |
// cases for switch case
export const AddItemToCart = 'ADD_ITEM_TO_CART';
export const ReduceItemQtyFromCart = 'REDUCE_ITEM_QTY_FROM_CART';
export const RemoveItemFromCart = 'REMOVE_ITEM_FROM_CART';
export const ClearCart = 'CLEAR_CART';
// add item to cart
const addItemToCart = (product, state) => {
let subTotal = ... |
arr = []
for i in range(1, 11):
arr.append(i ** 2)
print(arr) # [1, 4, 9, 16, 25, 36, 49, 64, 81, 100] |
<reponame>L-Distribution/Website<gh_stars>1-10
import { h, Component } from 'preact'
import { route } from 'preact-router'
import style from './style.scss'
import logoSvg from '../../assets/branding/icon.svg'
export default class Header extends Component {
render () {
return (
<div class={style.header}>
... |
def surface_area(base, height):
return (1/2)*base*((base/2)**2 + height**2)**(1/2) |
<reponame>StuntsPT/BangleApps
// Get 12 hour status, from barclock
const is12Hour = (require("Storage").readJSON("setting.json", 1) || {})["12hour"];
// Used from waveclk to schedule updates every minute
var drawTimeout;
// Schedule a draw for the next minute
function queueDraw() {
if (drawTimeout) clearTimeout(dra... |
<reponame>tampham47/nau-jukebox
/* © 2017
* @author <NAME>
*/
import { Dispatcher } from 'flux';
/**
* AppDispatcher to dispatch global app events
*
* @example:
* import AppDispatcher from '../events/AppDispatcher';
*
* AppDispatcher.dispatch({type: 'actionType', payload: 'text'});
*/
const AppDispatcher = ne... |
// #docregion
module.exports = function(config) {
var appBase = 'src/'; // transpiled app JS and map files
var appSrcBase = 'src/'; // app source TS files
var testBase = 'test/'; // transpiled test JS and map files
var testSrcBase = 'test/'; // test source TS files
v... |
<reponame>jakeTran42/Codelab-Bootstrap
import { r as registerInstance, h } from './index-4a2da18d.js';
const myNavCss = "*{box-sizing:border-box;margin:0;padding:0}.nav{display:flex;flex-direction:row;justify-content:space-around;align-items:center;text-decoration:none;background-color:#259992;width:100%;height:4em}a{... |
export { default as Data } from './Data.js'
export { default as emit } from './emit.js'
export { default as Listener } from './Listener.js'
export { default as risingEdgeEmitter } from './risingEdgeEmitter.js'
export { default as toPromise } from './toPromise.js'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.