text stringlengths 1 1.05M |
|---|
#!/bin/sh
(go test $*); exit 0
|
<gh_stars>0
import React from 'react';
import { mount } from 'enzyme';
import ListHeader from '../index';
describe('<ListHeader />', () => {
// eslint-disable-next-line jest/expect-expect
it('Should not crash', () => {
mount(<ListHeader />);
});
});
|
SELECT DISTINCT authors.name
FROM authors
JOIN books
ON authors.id = books.author_id
WHERE books.release_year > (YEAR(CURDATE()) - 10) |
<filename>src/utils/scrollBarAlwaysShow.js
import {actualBarWidth} from './getScrollbarWidth'
export default function scrollBarAlwaysShow(){
return !!actualBarWidth()
}
|
/**
*/
package PhotosMetaModel.provider;
import PhotosMetaModel.util.PhotosMetaModelAdapterFactory;
import java.util.ArrayList;
import java.util.Collection;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.ecl... |
create table t
( id number primary key,
processed_flag varchar2(1),
payload varchar2(20)
);
create index t_idx on
t( decode( processed_flag, 'N', 'N' ) );
insert into t select r,
case when mod(r,2) = 0 then 'N' else 'Y' end,
'payload ' || r
from (select level r
from dual
connect by level <= 5);
select * from ... |
def search_item(list, item):
for i in range(len(list)):
if list[i] == item:
return i
return -1
list = ["apple", "banana", "orange"]
item = "banana"
index = search_item(list, item)
if index != -1:
print("Item is present at index", index)
else:
print("Item is not present in the ... |
/*
* Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
* http://www.samsung.com
*
* Common Codes for EXYNOS
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#include... |
#-*- encoding : utf-8 -*-
targets = %w(instance-type instance-id ami-id public-ipv4)
targets.each do |target|
system("/usr/bin/curl -s http://169.254.169.254/latest/meta-data/#{target}")
puts "\n"
end
|
def replace_multiple_characters(string, target, replacement):
while target*2 in string:
string = string.replace(target*2, replacement)
return string
string = "Hello___World!!!"
target = '_'
replacement = '-'
print(replace_multiple_characters(string, target, replacement)) |
package com.simplepathstudios.snowgloo.api.model;
import java.util.ArrayList;
import java.util.HashMap;
public class ArtistView {
public Root albums;
public class Root {
public ArrayList<String> listKinds;
public HashMap<String,MusicAlbum> lookup;
public HashMap<String,ArrayList<Strin... |
def find_longest_string(strings):
longest = strings[0]
for string in strings:
if len(string) > len(longest):
longest = string
return longest
# Test the function
input_strings = ["apple", "banana", "orange", "kiwi"]
print(find_longest_string(input_strings)) # Output: "banana" |
<reponame>AlessandroGuatelli/Space-Dashboard
function test() {
alert("Funziona");
}
function iss_finder()
{
var obj, long, lat;
try {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
ob... |
def listSum(lst):
# base case
if lst == []:
return 0
else:
head = lst[0]
rest = lst[1:]
return head + listSum(rest)
list_data = [2, 3, 5, 6]
result = listSum(list_data)
print(result) |
use std::collections::HashMap;
fn validate_nonce(nonce_hex: &str, hash: &HashMap<char, u128>) -> bool {
let mut pointers: Vec<u128> = Vec::new();
let nonce_string_len = nonce_hex.len();
nonce_hex.chars().enumerate().for_each(|(idx, c)| {
if let Some(&n) = hash.get(&c) {
if let Some(n) ... |
<filename>models/lnd/clm/src/iac/giac/gcam/cvs/objects/emissions/include/total_sector_emissions.h
#ifndef _TOTAL_SECTOR_EMISSIONS_H_
#define _TOTAL_SECTOR_EMISSIONS_H_
#if defined(_MSC_VER)
#pragma once
#endif
/*
* LEGAL NOTICE
* This computer software was prepared by Battelle Memorial Institute,
* hereinafter the ... |
<filename>pages/home/composite.ts
// 实现菜单组件的抽象类,对每个方法都提供了默认的实现
abstract class MenuComponent {
public add(menuComponent:MenuComponent):void {
throw new UnsupportedOperationException();
}
public remove(menuComponent:MenuComponent):void {
throw new UnsupportedOperationException();
}
public getChild(i:number):Menu... |
<gh_stars>1-10
# Copyright (C) 19/10/20 <NAME>
# 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
# (at your option) any later version.
# This program is distr... |
if [ -f "/usr/local/cuda/version.txt" ]; then
NAMD_URL="http://www.ks.uiuc.edu/Research/namd/2.13/download/412487/NAMD_2.13_Linux-x86_64-multicore-CUDA.tar.gz"
else
NAMD_URL="http://www.ks.uiuc.edu/Research/namd/2.13/download/412487/NAMD_2.13_Linux-x86_64-multicore.tar.gz"
fi
cd /opt && \
wget -q "$NAMD_URL" -O nam... |
<filename>src/Reducers/players.js
import { ADD_PLAYER, REMOVE_PLAYER, UPDATE_PLAYER } from '../actionTypes';
export function players(state = [], action) {
switch (action.type) {
case ADD_PLAYER: case ADD_PLAYER.name:
const player = state.find(player => player.id === action.player.id);
... |
#!/bin/bash
#
# Copyright (c) 2007 by Cisco Systems, Inc.
# All rights reserved.
#
TEMPLATE_FILE='./version/vqes_version.h.tmpl'
VERSION_FILE='./version/vqes_version.h'
TEMP_FILE='vqes_version.h.tmp'
build_user=$USER
build_path=$PWD
build_type='development'
build_refpoint=""
if [ -e .ACME/component.info ]; then
bu... |
<gh_stars>0
import numpy as np
class DataBase:
def __init__(self, net):
self.idx = 0
self.net = net
def initData(self, batch_size, w, h, data):
self.net.blobs['data'].reshape(1, 3, h, w)
self.net.blobs['rois'] .reshape(batch_size, 5)
self.net.blobs['labels'].reshape(bat... |
#!/bin/bash
set -eu -o pipefail
if [ "x$*" = 'x--help' ]
then
cat <<EOF
Usage:
$0 --help
Show this help message and exit.
$0 [ --enable-lcov ] [ MAKEARGS... ]
Build Zcash and most of its transitive dependencies from
source. MAKEARGS are applied to both dependencies and Zcash itself. If
--enable-lcov is ... |
<reponame>jamesscottbrown/bionano-wetLabAccelerator
/**
* Copyright 2015 Autodesk 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.... |
#!/bin/sh
gunicorn --chdir /phonetisaurus/models/phonetisaurus wsgi:app \
--workers 2 \
--bind 0.0.0.0:5001 \
--timeout 300
|
<reponame>alanadias/bootcamp--html--web--developer
let X = parseInt(gets());
let Y = parseFloat(gets());
let consumoMedio = parseFloat(X / Y).toFixed(3);
console.log(consumoMedio + " km/l"); |
import QtWidgets # Assuming QtWidgets module is imported
class Node(QtWidgets.QWidget):
def __init__(self, parent, node, text=None):
super(Node, self).__init__(parent)
# variable
self._node = node
text = text if text else node
# create layout
layout = QtWidgets.QH... |
#!/usr/bin/env bash
# Copyright 2016 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... |
#!/bin/bash
files='Blocks.txt CaseFolding.txt DerivedAge.txt DerivedCoreProperties.txt PropertyAliases.txt PropertyValueAliases.txt PropList.txt Scripts.txt SpecialCasing.txt UnicodeData.txt auxiliary/GraphemeBreakProperty.txt'
if [ -z $1 ]; then
echo "usage: $0 UNICODE_VERSION"
exit 1
fi
UNICODE_VERSION=$1
# remo... |
#!/usr/bin/env bash
#
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
export LC_ALL=C.UTF-8
DOCKER_EXEC echo \> \$HOME/.TCC # Make sure default datadir does not exist and is never... |
SELECT *
FROM customers
WHERE age > (SELECT AVG(age)
FROM customers); |
SELECT department, COUNT(*) AS num_employees FROM employees GROUP BY department; |
def get_largest(array):
largest = array[0]
for element in array:
if element > largest:
largest = element
return largest
array = [1, 4, 10, 3]
print(get_largest(array)) # 10 |
package br.indie.fiscal4j.nfe310.classes;
public enum NFNotaInfoEspecieVeiculo {
PASSAGEIRO("1", "Passageiro"),
CARGA("2", "Carga"),
MISTO("3", "Misto"),
CORRIDA("4", "Corrida"),
TRACAO("5", "Tra\u00e7\u00e3o"),
ESPECIAL("6", "Especial"),
COLECAO("7", "Cole\u00e7\u00e3o");
private fin... |
<reponame>Darkere/InControl
package mcjty.incontrol.rules;
import com.google.gson.JsonElement;
import mcjty.incontrol.InControl;
import mcjty.incontrol.compat.ModRuleCompatibilityLayer;
import mcjty.incontrol.rules.support.GenericRuleEvaluator;
import mcjty.tools.rules.IEventQuery;
import mcjty.tools.rules.IModRuleCom... |
<reponame>doroK/mushroom
import numpy as np
def numerical_diff_policy(policy, state, action, eps=1e-6):
"""
Compute the gradient of a policy in (``state``, ``action``) numerically.
Args:
policy (Policy): the policy whose gradient has to be returned;
state (np.ndarray): the state;
... |
/**
* This file is part of ORB-SLAM2.
* 单目相机初始化
* 基础矩阵F(随机采样序列 8点法求解) 和 单应矩阵计算( 采用归一化的直接线性变换(normalized DLT)) 相机运动
* 用于平面场景的单应性矩阵H和用于非平面场景的基础矩阵F,
* 然后通过一个评分规则来选择合适的模型,恢复相机的旋转矩阵R和平移向量t。
*
*/
#ifndef INITIALIZER_H
#define INITIALIZER_H
#include<opencv2/opencv.hpp>
#include "Frame.h"
namespace ORB_SLAM2
{
// THIS ... |
<gh_stars>0
package ch.bernmobil.vibe.shared.mockdata;
import ch.bernmobil.vibe.shared.entity.Journey;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public class JourneyMockData {
private static List<Journey> dataSource;
private static UUID[] ids = {
UUID.fromString("d0ce8... |
package araujo.jordan.andvr.engine.entity.components.model3d;
/**
* Created by arauj on 23/03/2017.
*/
public interface Draw {
void draw();
}
|
module CagnutBwa
VERSION = "0.3.4"
end
|
<reponame>dallashudgens/cf-blue-green-deploy
package main
import (
"fmt"
"io"
"os/exec"
"regexp"
"strings"
"code.cloudfoundry.org/cli/plugin"
"code.cloudfoundry.org/cli/plugin/models"
)
type ErrorHandler func(string, error)
type BlueGreenDeployer interface {
Setup(plugin.CliConnection)
PushNewApp(string, p... |
import React from "react";
import PropTypes from "prop-types";
import { MyPageTemplate } from "../../templates/my-page";
const MyPagePreview = ({ entry, widgetFor }) => {
return (
<MyPageTemplate
content={entry.getIn(["data", "content"])}
/>
);
};
MyPagePreview.propTypes = {
entry: PropTypes.shape... |
package com.sphereon.factom.identity.did.json;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonSerializationContext;
import com.google... |
package cn.st.mapper;
import cn.st.domain.Role;
import org.apache.ibatis.annotations.Select;
import java.util.List;
/**
* @description:
* @author: st
* @create: 2021-02-20 16:24
**/
public interface RoleMapper {
@Select("SELECT * FROM sys_user_role ur,sys_role r WHERE ur.roleId=r.id AND ur.userId=#{uid}")
... |
#!/bin/bash
read x
read y
read z
if ((x == y && y == z)); then
echo "EQUILATERAL"
elif ((x == y || x == z || y == z)); then
echo "ISOSCELES"
else
echo "SCALENE"
fi
|
#!/bin/sh
# Copyright (C) 1999-2006 ImageMagick Studio LLC
#
# This program is covered by multiple licenses, which are described in
# LICENSE. You should have received a copy of LICENSE with this
# package; otherwise see http://www.imagemagick.org/script/license.php.
. ${srcdir}/tests/common.shi
${RUNENV} ${MEMCHECK} ... |
class FunctionManager:
def __init__(self):
self._functions = {}
self._new_des_id = 0
def add_function(self, name, instructions):
self._functions[name] = instructions
def func_instrs(self, name):
return self._functions.get(name, [])
def _branch_a_func(self, f):
... |
#!/usr/bin/env bash
## 目录
dir_root=/ql
dir_shell=$dir_root/shell
dir_sample=$dir_root/sample
dir_config=$dir_root/config
dir_scripts=$dir_root/scripts
dir_repo=$dir_root/repo
dir_raw=$dir_root/raw
dir_log=$dir_root/log
dir_db=$dir_root/db
dir_list_tmp=$dir_log/.tmp
dir_code=$dir_log/code
dir_update_log=$dir_log/update... |
class Test {
public static void main(String[] args) throws IOException {
{
long data;
BufferedReader readerBuffered = new BufferedReader(
new InputStreamReader(System.in, "UTF-8"));
String stringNumber = readerBuffered.readLine();
if (stringNumber != null) {
data = Long.parseLong(stringNumber.t... |
#!/bin/sh
sudo -v && sudo="true" || sudo=""
if ! [[ -x "$(command -v danger)" ]]; then
if ! [[ -x "$(command -v npm)" ]]; then
echo "Please install node js"
exit 1
fi
echo "Installing danger"
if [[ -n "$sudo" ]]; then
sudo npm install -g danger
else
npm install -g danger
fi
fi
if [[ -n "$sudo" && "$O... |
<reponame>jing-si/plant
package kr.co.gardener.admin.model.object;
public class Classify{
private int primaryId;
private int foreginId;
private String name;
private int table;
public int getPrimaryId() {
return primaryId;
}
public void setPrimaryId(int primaryId) {
this.primaryId = primaryId;
}
public i... |
<reponame>khatchadourian-lab/guava<filename>guava-tests/test/com/google/common/math/QuantilesAlgorithmTest.java<gh_stars>0
/*
* Copyright (C) 2014 The Guava 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 obtai... |
import styled from "styled-components";
export const Container = styled.section`
color: var(--white);
background-color: var(--black);
`;
export const AboutContent = styled.div`
display: flex;
flex-direction: column;
align-items: center;
max-width: 1450px;
margin: 0 auto;
padding: 6vh 4vw;
div {
... |
<filename>law/src/main/scala/proptics/law/discipline/IndexedSetterTests.scala
package proptics.law.discipline
import cats.Eq
import cats.laws.discipline._
import org.scalacheck.Arbitrary
import org.scalacheck.Prop.forAll
import org.typelevel.discipline.Laws
import proptics.IndexedSetter
import proptics.law.IndexedSet... |
base_dir="$(cd "$(dirname "$0")" && pwd)" # Stay gold, bash, stay gold
# Make zip files for lambdas
cd ${base_dir}
zip -r -9 -j lambda_payload.zip rollup/*.py
# Build the frontend
#cd ${base_dir}/tsfrontend
#CI=true npm test
#VALID="$(npm test | grep -o 'failing')"
#CI=true npm run build
# Apply terraform
cd ${base... |
#!/bin/sh
# -----------------------------------------------------------------------------
# Start Script for Migrating Hippo CMS Database
#
# Environment Variable Prequisites
#
# JAVA_HOME Must point at your Java Development Kit installation.
#
# JAVA_OPTS (Optional) Java runtime options used when execu... |
#!/bin/bash
shopt -s expand_aliases
alias stool='/private/home/mriviere/FairInternal/stool/stool.py'
data_path=/private/home/marvinlvn/DATA/CPC_data/train
#languages=(English_LibriVox_extracted_full_random French_LibriVox_extracted_full_random)
languages=(English_LibriVox_extracted_full_random)
sizes=(8h 16h 32h 64h ... |
fn process_buffer(buffer: &str) -> Vec<String> {
let mut lines = buffer.lines().skip(1); // Skip the first line (height)
let height: usize = lines.next().unwrap().parse().unwrap(); // Parse the height
lines.take(height).map(|line| line.to_string()).collect() // Collect the next 'height' lines into a vector
... |
int findIndex(const int arr[], int size, int target) {
for (int i = 0; i < size; i++) {
if (arr[i] == target) {
return i; // Return the index of the matching element
}
}
return -1; // Return -1 if the target integer is not found in the array
} |
<filename>models/users.js
var db = require('../services/dbconnect.js');
var bcrypt = require('bcryptjs');
module.exports.createUser = function (newUser, callback) {
//console.log('---------------->Username: '+newUser.username);
bcrypt.genSalt(10,function (err,salt) {
bcrypt.... |
#!/bin/bash
sh ./generate.sh
sh ./build.sh
|
<reponame>changxing-guo/weathertest
package com.example.weather.util;
import android.util.Log;
public class LogUtil {
private static boolean DEBUG = true;
public static void v(String TAG, String str) {
if (!DEBUG) return;
Log.v(TAG, str);
}
public static void d(String TAG, String str... |
<filename>src/app/services/api/model/search-composition.ts
import {HalLinkedObject} from './hal-links';
import {IAHal} from './ia-hal';
export class SearchComposition extends HalLinkedObject {
public searchUUID: string;
public xformUUID: string;
public resultMasterUUID: string;
constructor(json: any) {
su... |
/*
* Copyright 2020 http://www.hswebframework.org
*
* 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 ap... |
#!/bin/bash
# Copyright 2013-2019, Derrick Wood <dwood@cs.jhu.edu>
#
# This file is part of the Kraken 2 taxonomic sequence classification system.
# Download specific genomic libraries for use with Kraken 2.
# Supported libraries were chosen based on support from NCBI's FTP site
# in easily obtaining a good collect... |
/*!
//
// XUI
//
// Copyright (c) 2020-2021 <NAME> <<EMAIL>>
// Created by <NAME> <<EMAIL>>
//
// MIT License (MIT) <http://opensource.org/licenses/MIT>
//
*/
XUI.Script = {};
/**
* Run script
* @param {string} script - Script ot run
*/
XUI.Script.run = function (script) {
var elScript = docu... |
import random
dataset = {
'What is your name?': 'My name is AI Assistant',
'What can you do?': 'I can answer questions, perform tasks, and help you with general tasks.',
'How can you help me?': 'I can help you with a variety of tasks. Just let me know what you need.'
}
def ai_assistant(question):
if question in d... |
#!/bin/bash
#
# Copyright (C) 2020 Paranoid Android
#
# 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 o... |
#!/bin/bash
#
# Rebuild Courier gdbm databases and restart Courier MTA.
#
# VERSION :1.0.0
# DATE :2018-01-20
# AUTHOR :Viktor Szépe <viktor@szepe.net>
# LICENSE :The MIT License (MIT)
# URL :https://github.com/szepeviktor/debian-server-tools
# BASH-VERSION :4.2+
# DEPENDS :... |
#!/bin/bash
MYDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# RPIENV SETUP (BASH)
if [ -e "${MYDIR}/.rpienv" ]
then
source "${MYDIR}/.rpienv" "-s" > /dev/null
# check one var from rpienv - check the path
if [ ! -f "$CONFIGHANDLER" ]
then
echo -e "[ ENV ERROR ] \$CONFIGHANDLER path no... |
package com.works.repositories;
import com.works.entities.Users;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface UserRepository extends JpaRepository<Users,Integer> {
List<Users> fin... |
<reponame>phwd/newsyc
//
// CommentTableCell.h
// newsyc
//
// Created by <NAME> on 3/5/11.
// Copyright 2011 Xuzz Productions, LLC. All rights reserved.
//
#import "ABTableViewCell.h"
@class HNEntry;
@interface CommentTableCell : ABTableViewCell {
HNEntry *comment;
}
@property (nonatomic, retain) HNEntry *c... |
<filename>src/containers/App/index.tsx
import * as React from 'react';
import { useForm, FieldError } from 'react-hook-form';
import * as yup from 'yup';
import styled, { ThemeProvider } from '../../styles/styled-components';
import DefaultTheme from '../../styles/themes';
import GlobalStyle from '../../styles/globalSt... |
SELECT TIMESTAMPDIFF(DAY, timestamp2, timestamp1) AS diff_days,
TIMESTAMPDIFF(HOUR, timestamp2, timestamp1) AS diff_hours,
TIMESTAMPDIFF(MINUTE, timestamp2, timestamp1) AS diff_minutes; |
<reponame>VincentLefevre/3D-parallax
#!/usr/bin/env python
#
# This file is part of libigl, a simple c++ geometry processing library.
#
# Copyright (C) 2017 <NAME> <<EMAIL>> and <NAME> <<EMAIL>>
#
# This Source Code Form is subject to the terms of the Mozilla Public License
# v. 2.0. If a copy of the MPL was not... |
<filename>open-sphere-base/core/src/main/java/io/opensphere/core/math/Circle.java
package io.opensphere.core.math;
/**
* Circle shape.
*
* @param <T> The type of the center vector.
*/
public class Circle<T extends AbstractVector>
{
/** The center. */
private final T myCenter;
/** The radius. */
pr... |
#encoding UTF-8
module BrNfe
module Service
module Response
module Build
class ConsultaNfsPorRps < BrNfe::Service::Response::Build::InvoiceBuild
def default_values
super.merge({
message_errors_path: [:consultar_nfse_rps_resposta, :lista_mensagem_retorno, :mensagem_retorno],
invoices_... |
public class MortgageCalculator {
public static double calculateMortgage(double loanAmount, double interestRate, int term) {
int monthlyPaymentLength = (term * 12);
double interestRatePerMonth = interestRate / (12 * 100);
double monthlyPaymentAmount = loanAmount * interestRatePerMonth * (M... |
<reponame>jumbo4213/nest-serve-template
import { Injectable, CanActivate } from '@nestjs/common';
import { ExecutionContext, UnauthorizedException } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { Request } from 'express';
import { JWT, JWE } from 'jose';
import { AuthService, JWTVerify } from... |
#!/bin/bash
set -e
apt-get update
apt-get install -y jq
this_commit=$(echo $BUILDKITE_COMMIT | tr -d '"')
tags=$(curl https://api.github.com/repos/uber-web/baseui/git/refs/tags?access_token=${GITHUB_AUTH_TOKEN})
latest_tagged_commit=$(echo $tags | jq '.[-1].object.sha' | tr -d '"')
echo this commit: $this_commit
ec... |
/*
Formatting library for C++
Copyright (c) 2012 - 2016, <NAME>
All rights reserved.
For the license information refer to format.h.
*/
#ifndef FMT_PRINTF_H_
#define FMT_PRINTF_H_
#include <algorithm> // std::fill_n
#include <limits> // std::numeric_limits
#include "fmt/format.h"
namespace fmt
{
namespac... |
#!/bin/bash
#
#===============================================================================
# Last modified: March 19, 2017
#
# Creates a website link for Markdown documents. Instead of typing a bunch of
# things, it is much better to use a script that automates the creation of
# website links. See below for usage d... |
#include <iostream>
#include <algorithm>
const int arrSize = 6;
int arr[arrSize] = {3, -1, 4, 5, -6, 7};
int maxSubArraySum() {
int max_so_far = 0;
int max_ending_here = 0;
for (int i = 0; i < arrSize; i++) {
max_ending_here += arr[i];
if (max_ending_here < 0)
max_ending_here ... |
/*
* Copyright 2015 lixiaobo
*
* VersionUpgrade project licenses this file to you 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 requ... |
package library
import (
"golang.org/x/xerrors"
ftypes "github.com/aquasecurity/trivy/pkg/fanal/types"
"github.com/aquasecurity/trivy/pkg/types"
)
// Detect scans and returns vulnerabilities of library
func Detect(libType string, pkgs []ftypes.Package) ([]types.DetectedVulnerability, error) {
driver, err := NewD... |
from abc import ABC, abstractmethod, abstractproperty
from bidict import bidict
from collections import deque
import numpy as np
from ..model import RewardReachabilityForm
from ..solver import MILP,LP
from ..utils import InvertibleDict
class ProblemFormulation:
"""A ProblemFormulation is an abstract base class fo... |
<gh_stars>0
//data from: https://geojson-maps.ash.ms/
const geoJsonPath = './resources/europe.geo.json';
let map;
let openStreetMapLayer;
let geojson;
let populationEdges;
let showPopulationDensity = true;
let useClassColors = true;
function initialize() {
/*
Initialize Map
*/
map = L.map('map_canva... |
/////////////////////////////////////////////////////////////////////////////
// Name: src/gtk/anybutton.cpp
// Purpose:
// Author: <NAME>
// Created: 1998-05-20 (extracted from button.cpp)
// Copyright: (c) 1998 <NAME>
// Licence: wxWindows licence
////////////////////////////////////////////////... |
source /mnt/software/Modules/current/init/bash
module load parallel
module load samtools
USAGE="Usage: `basename $0` [SMRTLinkJobDir1] [SMRTLinkJobDir2] [nproc]"
if ! [[ $# == 3 ]]; then
echo $USAGE
exit 0
fi
if [ "$1" == "-h" ]; then
echo $USAGE
exit 0
fi
#SMRT Link Job dirs
# e.g.... |
#include <iostream>
#include <array>
int searchArray(std::array<int, 7> arr, int value) {
int idx = -1;
for (int i = 0; i < arr.size(); i++) {
if (arr[i] == value) {
idx = i;
break;
}
}
return idx;
}
int main() {
//Input array
std::array<int, 7> arr = {7, 5, 3, 9, 2, 4, 8};
int value = 4;
//Search for ... |
package luohuayu.anticheat.message;
import io.netty.buffer.ByteBuf;
import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
public class SPacketScreenshot implements IMessage {
public int timestamp;
@Override
public void fromBytes(ByteBuf buf) {
timestamp = buf.readInt();
}
@Ov... |
<reponame>IzaacBaptista/ads-senac<gh_stars>1-10
import java.util.ArrayList;
public abstract class People {
protected String nome;
protected String localizacao;
protected double preco;
public ArrayList<Filme> filmes;
public People(String nome, String localizacao, double preco){
this.nome = no... |
<reponame>togiter/RRWallet<gh_stars>100-1000
package com.renrenbit.rrwallet.service.wallet;
import java.math.BigInteger;
/**
* Created by jackQ on 2018/6/14.
*/
public class Transaction {
public String transactionHash;
public BigInteger nonce;
public String contract;
public String from;
public ... |
import { Data, ExpireTimeOption, GenericID, GenericToken, Query, TagsObj } from "../../common/common.types";
import { BucketDeviceInfo } from "./buckets.types";
interface Arrangement {
widget_id: string;
x: number;
y: number;
width: number;
height: number;
tab?: string | null;
}
interface DashboardCreateI... |
def capitalize_each_character(string):
result = ''
for char in string:
result += char.capitalize()
return result
def uncapitalize_each_character(string):
result = ''
for char in string:
result += char.lower()
return result |
function get_permission($action, $forumId) {
// Your implementation depends on the specific permission system and user roles
// For demonstration purposes, let's assume all users have permission to view all forums
return true;
}
function constructLogoURL($forum) {
if (!empty($forum["logo"])) {
... |
<gh_stars>1-10
module Protocols::X12
IDENTIFYING_ATTRIBUTES = %w[name_first name_last, ssn dob employee_id_number]
Struct.new(
"Operation",
:name,
:maintenance_type, # change, addition, cancel/term, reinstatement, audit/compare
:maintenace_reason,
:member_level_date_qualifier,
:health_coverage... |
<gh_stars>0
#include <iostream>
#include <queue>
#include <utility>
#include <vector>
#include <climits>
using namespace std;
#define INF INT_MAX
vector<vector<pair<int,int> > > G(20);
vector<int> Dist;
void Dijkstra(int N) {
priority_queue<pair<int, int>,
vector<pair<int, int> >, ... |
<filename>django_chuck/commands/show_info.py
import os
from django_chuck.commands.base import BaseCommand
import imp
class Command(BaseCommand):
help = "Shows all available information of a module"
def __init__(self):
super(Command, self).__init__()
# Disable default checks because this comma... |
package fracCalcExamples;
import java.util.Scanner;
public class FracCalc {
public static void main(String[] args) {
// Set up and manage the calculator
Scanner stdin = new Scanner(System.in);
while (true) {
// Get equations to process
String eq = stdin.nextLine();
if (eq.equalsIgno... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.