text stringlengths 1 1.05M |
|---|
#pragma once
#include <GL/glew.h>
#include "../renderer.h"
namespace valk {
namespace graphics {
class IndexBuffer
{
private:
GLuint m_BufferID;
GLuint m_Count;
public:
IndexBuffer(GLushort* data, GLsizei count);
~IndexBuffer();
void bind() const;
void unbind() const;
inline GLuint ge... |
/*
* Copyright 2009-2011 junithelper.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 ... |
class Student:
def __init__(self, name, age, marks):
self.name = name
self.age = age
self.marks = marks
def get_name(self):
return self.name
def get_age(self):
return self.age
def get_total_marks(self):
return sum(self.marks) |
<reponame>ChrisLMerrill/museide<gh_stars>0
package org.museautomation.ui.ide.navigation;
import javafx.scene.*;
import net.christophermerrill.testfx.*;
import org.junit.jupiter.api.*;
import org.museautomation.ui.ide.navigation.resources.*;
import org.museautomation.ui.ide.navigation.resources.actions.*;
import org.mu... |
fn process_response(response: Vec<(u32, String, String)>) -> bool {
let expected_result = vec![(3, "test_insert".to_string(), "test_update".to_string())];
response == expected_result
} |
#! /usr/bin/env bash
# ηΌθ―εΉΆdockerδΈθΏθ‘
realpath() {
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
PROJECT_PATH=$(dirname $(dirname $(dirname $(realpath $0))))
source ${PROJECT_PATH}/misc/scripts/dist.sh
docker build -t x-stock ${PROJECT_PATH}
docker run -p 4869:4869 -p 4870:4870 x-stock
|
#include <QObject>
#include <QThread>
#include <QVector>
#include <complex>
#include <fftw3.h>
class FFTWorker : public QObject {
Q_OBJECT
public:
FFTWorker(int fftLength) : m_fftLength(fftLength) {
m_inputSignal.resize(fftLength);
// Initialize and configure FFTW plans, threads, etc.
... |
export * from './response' ;
export * from './enum' ;
|
add_lunch_combo lineage_harpia-userdebug
add_lunch_combo lineage_harpia-eng
|
#!/bin/bash
echo "" > versions
|
<filename>AVVideoCompositingSample/AVVideoCompositingSample/Video/Metal/SSMetalRenderer.h
//
// SSMetalRenderer.h
// AVVideoCompositingSample
//
// Created by king on 2020/10/25.
// Copyright Β© 2020 taihe. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "SSRenderer.h"
NS_ASSUME_NONNULL_BEGIN
@... |
class StorageTracker:
def __init__(self):
self._storage_allocated = None
self._storage_used = None
self._storage_used_by_table_space = None
def allocate_storage(self, amount):
self._storage_allocated = amount
def update_storage_used(self, amount):
if self._storage_u... |
<filename>chapter1/hello_di_with_security.py
from typing import Protocol
class MessageWriter(Protocol):
def write(self, message: str) -> None:
...
class Identity(Protocol):
is_authenticated: bool
class CurrentUser(Identity):
@property
def is_authenticated(self) -> bool:
return True... |
<reponame>cbartram/HealthKit-Consumer<gh_stars>0
import React, { Component } from 'react';
import Container from './Container/Container';
/**
* Attaches a <Container /> Component around the
* base component which shows the Navbar and footer on the page.
* @param BaseComponent
* @param props
* @returns {{new(props... |
export {};
//# sourceMappingURL=run.d.ts.map |
import numpy as np
def process_matrix(valid, mask, rule_names, mt):
product = 1
while np.any(mask):
cur = valid & mask
axissum = cur.sum(axis=1)
field = np.where(axissum == 1)[0][0]
rule = np.where(cur[field, :])[0][0]
if rule_names[rule].startswith("departure"):
... |
<reponame>epicosy/svd<filename>svd/core/exc.py
class SVDError(Exception):
"""Generic errors."""
pass
|
select c.value || '/' || d.instance_name || '_ora_' || a.spid || '.trc' trace
from v$process a, v$session b, v$parameter c, v$instance d
where a.addr = b.paddr
and b.audsid = userenv('sessionid')
and c.name = 'user_dump_dest'
/ |
#!/usr/bin/ruby
require 'simplecov' if ENV['COVERAGE']
require 'rspec'
require 'fileutils'
require 'tmpdir'
require_relative '../lib/ezmlm'
module SpecHelpers
include FileUtils
TEST_LIST_NAME = 'waffle-lovers'
TEST_LIST_HOST = 'lists.syrup.info'
TEST_OWNER = '<EMAIL>'
TEST_SUBSCRIBERS = %w[
<EMAIL>
<E... |
<reponame>RemiBou/Blazor
ο»Ώimport { System_Object, System_String, System_Array, MethodHandle, Pointer } from '../Platform/Platform';
import { platform } from '../Environment';
import { renderBatch as renderBatchStruct, arrayRange, arraySegment, renderTreeDiffStructLength, renderTreeDiff, RenderBatchPointer, RenderTreeDi... |
<filename>record.js
const title = process.argv[2];
const url = process.argv[3];
const m3u8stream = require('m3u8stream');
const fs = require('fs');
function convertToValidFilename(string) {
return (string.replace(/[\/|\\:*?"<>]/g, " "));
}
m3u8stream(url).pipe(
fs.createWriteStream(
"./videos/" + convertToVa... |
#!/bin/bash
# script to increment or decrement bar counter and also increment or decrement completed task counter
# Connor Rhodes (connorrhodes.com)
remaining=$HOME/.cache/count.txt
done=$HOME/.cache/donecount.txt
case $1 in
inc)
echo $(expr $(cat $remaining) + 1) > $remaining
echo $(expr $(cat $done) - 1) >... |
#!/bin/sh
java \
-XX:MinHeapFreeRatio=5 \
-XX:MaxHeapFreeRatio=10 \
-XX:GCTimeRatio=4 \
-XX:AdaptiveSizePolicyWeight=90 \
-XX:MaxRAMPercentage=70 \
--module-path /libs \
--add-modules ALL-MODULE-PATH \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/sun.nio.ch=ALL... |
<gh_stars>0
package me.chris.SimpleChat;
/**
* @author <NAME>
* @date Feb 29, 2012
* @file SimpleChatHelperMethods.java
* @package me.chris.SimpleChat
*
* @purpose
*/
public class SimpleChatChatState
{
public static String chatState;
public SimpleChatChatState()
{
chatState = "on";
}
... |
<gh_stars>0
import tKinter as tk
root = tk.Tk()
class window_native:
def __init__( self, size ):
self.size = size
self.window = tk.Toplevel( root )
def write( location, color ):
self
class line:
def __init__( self, start, end ):
self.start = start
self.end = end
... |
<filename>Devices/Base.js<gh_stars>1-10
// Base
Base = function() {
this.platform = null;
}
Base.prototype.init = function(platform, config) {
this.platform = platform;
this.config = config;
}
Base.prototype.obj2array = function(obj) {
var array = [];
for(var item in obj) {
array.push(obj[... |
<reponame>modernizer-bot/stakerwatch
import {L2_OPTIMISM, getNodeURL} from 'staker-freenodes'
import {jsonRpcFetch} from '../helpers/jsonRpc';
export const optimismFetch = (fetch, body) =>
jsonRpcFetch(fetch, getNodeURL(L2_OPTIMISM), body);
|
#!/bin/bash
#
# Investigation of https://github.com/oilshell/oil/issues/268
#
# Usage:
# ./plugins-and-shell-state.sh <function name>
# Corrupts shell state in OSH.
#
# bash has save_parser_state and restore_parser_state, and bizarrely the exit
# code and pipe status are part of that!
#
# OK variables are protecte... |
package com.common.system.mapper;
import com.common.system.entity.RcBaseArea;
import com.baomidou.mybatisplus.mapper.BaseMapper;
/**
* <p>
* Mapper ζ₯ε£
* </p>
*
* @author yangxiufeng
* @since 2017-09-12
*/
public interface RcBaseAreaMapper extends BaseMapper<RcBaseArea> {
} |
public static int getMax(int[] arr) {
int max = arr[0];
for (int i=1; i<arr.length; i++)
if (arr[i] > max)
max = arr[i];
return max;
}
int arr[] = {3, 5, 9, 11, 17, 23, 27, 32};
System.out.println("Maximum element of the array: "+getMax(arr));
# Output should be -> Maximum element of the array: 32 |
<reponame>bowen0701/python-algorithms-data-structures
"""Leetcode 678. Valid Parenthesis String
Medium
URL: https://leetcode.com/problems/valid-parenthesis-string/
Given a string containing only three types of characters: '(', ')' and '*',
write a function to check whether this string is valid. We define the
validity... |
/*
* @Author: <NAME>
* @Date: 2021-12-02 18:32:55
* @Last Modified by: <NAME>
* @Last Modified time: 2021-12-06 18:25:34
*/
import getGitPreset, { GitStatus } from '@@contribute/utils/get-git-preset';
/**
* Initialize context with git info.
*
* @returns {Promise<GitStatus>}
*/
const gitPreset = async (): ... |
<gh_stars>1-10
/* eslint-disable no-console */
// Register babel to have ES6 support on the server
require('babel-polyfill');
require('babel-register');
require('./src/server');
|
<reponame>jreijn/hippo-groovy-addon<gh_stars>1-10
/**
* Copyright (C) 2011 Hippo
*
* 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
... |
#!/bin/bash
set -e
set -o pipefail
JENKINSUID=${JENKINSUID:-1000}
JENKINSGUID=${JENKINSGUID:-1000}
cleanup() {
chown -R "$JENKINSUID:$JENKINSGUID" tmp log
}
trap "cleanup" SIGINT SIGTERM SIGHUP SIGQUIT EXIT
PACKAGE=${PACKAGE:-}
OPT_REPO=${OPT_REPO:-}
BUILD_ARCH=${BUILD_ARCH:-}
sed -i '/stty sane/d' /usr/sbin/sla... |
// Node.cpp
#include "AllocationInfo.h"
#include "DebugSupport.h"
#include "EntryIterator.h"
#include "LastModifiedIndex.h"
#include "Node.h"
#include "Volume.h"
// is_user_in_group
inline static
bool
is_user_in_group(gid_t gid)
{
// Either I miss something, or we don't have getgroups() in the kernel. :-(
/*
gid_t g... |
/* eslint-disable indent */
'use strict';
//------------------------------// Third Party Resources \\----------------------------\\
const Discord = require('discord.js');
const { MessageButton, MessageActionRow } = require('discord-buttons');
require('dotenv').config();
//---------------------------------// Import Re... |
<gh_stars>10-100
package io.jenkins.plugins.gcr.models;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
import java.util.stream.Stream;
@XmlRootElement(name = "report")
public class JacocoCoverage extends XmlCoverage {
public static final Strin... |
<filename>jdbc/deployment/src/test/java/io/quarkiverse/config/jdbc/extensions/test/JdbcConfigCustomParamsTest.java
package io.quarkiverse.config.jdbc.extensions.test;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javax.inject.Inject;
import javax.sql.DataSource;
import org.eclipse.microprof... |
<filename>apps/faultmanagement/fmgui/src/main/java/org/onosproject/faultmanagement/alarms/gui/AlarmTopovMessageHandler.java<gh_stars>1-10
/*
* Copyright 2015-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with t... |
<gh_stars>0
let asignatura;
let tipoinstitucion;
let localidad;
let nombreinstitucion;
$(document).ready(function()
{
$('body').scrollTop(0);
$('input:text[name="nombreins"]').alphanum({
allowNumeric: false,
allow: '()'
});
$('select[name="genero"]').on('change', function() {
$(... |
#!/usr/bin/env bash
#github-action genshdoc
echo -ne "
-------------------------------------------------------------------------
ββββββ βββββββ ββββββββββ βββββββββββββββββββββββββββ βββββββββββ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ βββββββββββ
βββββββββββββββββββ ββββββββ βββ ββ... |
<gh_stars>10-100
package io.opensphere.wps.ui.detail.provider;
import java.util.function.Supplier;
import javax.inject.Named;
import org.apache.commons.lang3.StringUtils;
import com.google.inject.Singleton;
import io.opensphere.core.Toolbox;
import io.opensphere.core.util.javafx.input.ValidatedIdentifie... |
<reponame>thatpub/pub
var App = function ( _ ) {
'use strict';
var regMini = / ?mini ?/g,
months = {
'01': 'Jan',
'02': 'Feb',
'03': 'Mar',
'04': 'Apr',
'05': 'May',
'06': 'Jun',
'07': 'Jul',
'08': 'Aug',
'09': 'Sep',
'10': 'Oct',... |
package sdg.equations;
import sdg.Equation;
/**
* Represents the SDE:
* [2X(t)/(1+t) + (1+t)^2] dt + (1+t)^2 dW(t)
*/
public class Linear3 extends Equation {
public Linear3(double x0, double t0, double tN) {
super(x0, t0, tN);
}
@Override
public double drift(double X, double t)
{... |
# Flask class for initializing the app.
# render_template for loading templates from
# templates/ folder.
from flask import Flask, render_template
# Importing blueprints
from .frontended import frontended
from .servered import servered
# Initializing the app
app = Flask(__name__)
# Configuring the app from config.py
... |
#!/bin/bash -e
#
# Deploys Infrastructure for samples
#
# Prompt User for Input
echo "Enter resource group name:"
read rg_name
echo "Enter key vault name:"
read kv_name
echo "Enter location (westus, westus2, eastus, ...):"
read location
# Get Tenant ID
tenant_id=$(az account show --query tenantId -o tsv)
# Creat... |
package ch.uzh.ifi.seal.soprafs20.service;
import ch.uzh.ifi.seal.soprafs20.constant.GameStatus;
import ch.uzh.ifi.seal.soprafs20.constant.PlayerStatus;
import ch.uzh.ifi.seal.soprafs20.entity.*;
import ch.uzh.ifi.seal.soprafs20.exceptions.ConflictException;
import ch.uzh.ifi.seal.soprafs20.exceptions.NotFoundExceptio... |
#!/bin/bash
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sed -i 's/SELINUX=permissive/SELINUX=disabled/' /etc/selinux/config
reboot |
<filename>lightconvpoint/knn/random_sampling.py
import torch
import math
from lightconvpoint.knn import knn
import importlib
knn_c_func_spec = importlib.util.find_spec('lightconvpoint.knn_c_func')
if knn_c_func_spec is not None:
knn_c_func = importlib.util.module_from_spec(knn_c_func_spec)
knn_c_func_spec.loa... |
import PageContainer from './PageContainer'
export default PageContainer
|
import { Module } from '@nestjs/common';
import { GlobalPipes } from './pipes';
import { GlobalInterceptors } from './interceptors';
import { GlobalProvider } from './providers';
@Module({
imports: [],
providers: [...GlobalPipes, ...GlobalInterceptors, ...GlobalProvider],
exports: [...GlobalProvider],
})
export ... |
parallel --jobs 64 < ./results/exp_threads/run-2/sea_cp_5n_64t_6d_1000f_617m_5i/jobs/jobs_n2.txt
|
package com.java.study.zuo.vedio.basic.chapter3;
import java.util.HashMap;
import java.util.Map;
/**
* <Description>
*
* @author hushiye
* @since 2020-08-22 15:09
*/
public class RandomPool {
public static class RandomPoolObject<T> {
private Map<Integer, T> indexAndEntityMap = new HashMap<>();
... |
import {Namespace, Project, ProjectDetail} from "../models/gitlab/gitlab";
const SAMPLE_PROJECT = {
id: 0,
description: "Sample Project",
name: "sample",
name_with_namespace: "test/sample",
path: "sample",
path_with_namespace: "test/sample",
created_at: "",
default_branch: "main",
f... |
import qrcode
from io import BytesIO
def generate_qr_code(content, size, color):
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=int(size),
border=4,
)
qr.add_data(content)
qr.make(fit=True)
img = qr.make_image(fill_color=c... |
<reponame>Novout/generi<filename>src/commands/log.ts
import { createChangelog } from '../changelog';
import { GitNewTag, LogOptions } from '../types';
import {
nextTag,
lastTag,
setVersion,
setTag,
newCommits,
isValidTag,
pushCommits,
} from '../git';
import { success, error, getHeader } from '../console';
impor... |
package org.ednovo.gooru.core.api.model;
import java.io.Serializable;
import java.util.Date;
public class UserCollectionItemAssoc implements Serializable{
/**
*
*/
private static final long serialVersionUID = -306690946964358328L;
private User user;
private CollectionItem collectionItem;
private Cust... |
/**************************************************************************
* *
* Algorithmic C (tm) Datatypes *
* *
* Software Ver... |
<filename>lib/helpers/debounce.tsx
export function debounce (fn, ms) {
let timeout;
return function (...args) {
const fnCall = () => { fn.apply(this, args) }
clearTimeout(timeout);
timeout = setTimeout(fnCall, ms)
return timeout
};
} |
<filename>tests/unit/time.test.js
const {
convertTime12to24,
normalizeTime,
normalizeAMPM,
} = require('../../src/time.js');
describe('time.js', () => {
describe('convertTime12to24', () => {
it('should convert 12 AM/PM correctly', () => {
expect(convertTime12to24('12:00', 'PM')).toBe('12:00');
... |
/*
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
#!/bin/bash
set -e
cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../
echo "=== test-baseline.sh ==="
isort --check-only -rc src/flwr_experimental/baseline && echo "- isort: done" &&
black -q --check src/flwr_experimental/baseline && echo "- black: done" &&
# mypy is covered by test.... |
'use strict'
/* global winston */
const Redis = require('ioredis')
const _ = require('lodash')
/**
* Redis module
*
* @param {Object} appconfig Application config
* @return {Redis} Redis instance
*/
module.exports = (appconfig) => {
let rd = null
if (_.isArray(appconfig.redis)) {
rd = new ... |
#!/bin/bash
<<EOF
Portfolio \ Tools \ Python \ Impression Image Tool
A simple bootstrap script responsible for running the impression image tool, and
ensuring that the virtual environment is created and provisioned
EOF
CURRENT_SCRIPT_DIRECTORY=${CURRENT_SCRIPT_DIRECTORY:-$(dirname $(realpath $0))}
export SH... |
<filename>services/GameServices/removePlayerFromGame.js
'use strict';
const gameSchema = require('../../schema/GameSchema');
const removePlayerFromGame = function (gameId, playerId) {
console.log('Game service - removePlayerFromGame - begin');
return new Promise((resolve, reject) => {
gameSchema... |
import * as vscode from "vscode";
import { globalStateGet, globalStateUpdate } from "@microsoft/teamsfx-core";
import { ExtTelemetry } from "../telemetry/extTelemetry";
import { TelemetryEvent } from "../telemetry/extTelemetryEvents";
import * as StringResources from "../resources/Strings.json";
const SURVEY_URL = "ht... |
function formatAttributeLabels(array $attributeLabels): string
{
// Sort the attribute labels alphabetically
ksort($attributeLabels);
$formattedString = '';
// Iterate through the sorted attribute labels and build the formatted string
foreach ($attributeLabels as $attribute => $description... |
import { DecodeUint32 } from "./Decode";
import { EncodeUint32 } from "./Encode";
export enum ObjectClass {
INVALID = -1,
CKO_DATA = 0x00000000,
CKO_CERTIFICATE = 0x00000001,
CKO_PUBLIC_KEY = 0x00000002,
CKO_PRIVATE_KEY = 0x00000003,
CKO_SECRET_KEY = 0x00000004,
CKO_HW_FEATURE = 0x00000005,
CKO_DOMAIN_PARAMETE... |
<reponame>grambas/snake-game<gh_stars>0
package de.hshannover.inform.dunkleit.gruppe12.mainmenu;
import javax.swing.SwingUtilities;
import de.hshannover.inform.dunkleit.gruppe12.mainmenu.gui.MainMenuFrame;
import de.hshannover.inform.dunkleit.gruppe12.mainmenu.gui.MainMenuGUIController;
import de.hshannover.inform.d... |
from collections import defaultdict
def return_default():
return 0
def dd():
return defaultdict(return_default)
CHALLENGE_DAY = "10"
REAL = open(CHALLENGE_DAY + ".txt").read()
SAMPLE = open(CHALLENGE_DAY + ".sample").read()
SAMPLE_EXPECTED = 35
# SAMPLE_EXPECTED =
def parse_lines(raw):
# Groups.
... |
#!/bin/bash -xe
# Copyright (C) 2011-2013 OpenStack Foundation
#
# 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... |
module Qernel
# Represents slots whose +conversion+ adjusts dynamically to fill whatever
# remains from the other slots on the node. This ensures that the
# cumulative conversion of all the slots add up to 1.0.
#
# Used for:
#
# * Output slots whose carrier is "loss".
# * Slots which have a truthy "... |
<reponame>oueya1479/OpenOLAT
/**
* <a href="http://www.openolat.org">
* OpenOLAT - Online Learning and Training</a><br>
* <p>
* Licensed under the Apache License, Version 2.0 (the "License"); <br>
* you may not use this file except in compliance with the License.<br>
* You may obtain a copy of the License at the
... |
import numpy as np
arr = np.zeros((3, 3, 3))
print(arr) |
<gh_stars>0
package main.java.game;
import java.util.*;
public class GameBoard {
//instance variable
private int height;
private int width;
private String[][] gameBoard;
private Set<Integer> availableIndexes;
private Set<Integer> unavailableIndexes;
/**
* getter for marked indexes ... |
from unittest import TestCase
from quiz10 import cuenta
class TestCuenta(TestCase):
def test_deposito(self):
a = cuenta ()
self.assertEqual(a.deposito(300), 500)
def test_retiro(self):
a = cuenta ()
self.assertEqual(a.retiro(300), 500)
|
// DescriΓ§Γ£o: Arquivo responsΓ‘vel pela lΓ³gica das rotas do cliente
const mongoose = require('mongoose')
const Cliente = mongoose.model('Cliente')
const Usuario = mongoose.model('Usuario')
const Pedido = mongoose.model('Pedido')
const Produto = mongoose.model('Produto')
const Variacao = mongoose.model('Variacao')
cla... |
package engine
import "errors"
var (
ErrNotFound = errors.New("not found")
ErrReadOnlyTx = errors.New("cannot execute a write operation in a read only transaction")
)
|
import styles from './styles';
import combineStyles from '../internal/combine-styles';
const root = overrideStyle => combineStyles(styles.root, overrideStyle);
const itemContainer = (rowHeight, enableLightbox, overrideStyle) => {
let style = combineStyles(styles.itemContainer, { height: rowHeight });
if (enableL... |
<filename>nw-apps/REPL-GUI/src/config-and-ui.js
var gui = require('nw.gui');
win = gui.Window.get();
var nativeMenuBar = new gui.Menu({ type: "menubar" });
try {
nativeMenuBar.createMacBuiltin("My App",
{
hideEdit: false,
hideWindow: true
});
win.menu = nativeMenuBar;
... |
<filename>src/main/java/model/OrderDetail.java
package model;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persis... |
/*
* Copyright(C) 2020 The Android Open Source Project
*
* 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 appl... |
# baidu.py
class BaiduIndex:
def fetch_index_data(self):
# Code to fetch index data from Baidu search engine
return "Baidu index data"
# sogou.py
class SogouIndex:
def fetch_index_data(self):
# Code to fetch index data from Sogou search engine
return "Sogou index data"
# toutia... |
#!/bin/bash
nodename="localhost.localdomain/redisnode2"
docker stop $nodename
exit 0
|
import argparse
import os, os.path
import json
import logging
class cmdOptions():
pass
def __parse_cmd_args(options_namespace):
arg_parser = argparse.ArgumentParser(
description='A tool to manage differential file uploads to an Amazon Glacier repository')
arg_parser.add_argument("-i", '--account... |
# -----------------------------------------------------------------------------
#
# Package : denque
# Version : 1.5.0
# Source repo : https://github.com/invertase/denque
# Tested on : RHEL 8.3
# Script License: Apache License, Version 2 or later
# Maintainer : BulkPackageSearch Automation <sethp@us.ibm.com>
#
# Discla... |
package m.co.rh.id.anavigator.example;
import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.ViewGroup;
import m.co.rh.id.anavigator.StatefulView;
import m.co.rh.id.anavigator.component.INavigator;
import m.co.rh.id.anavigator.component.Require... |
from rest_framework import serializers
class AQHeaderSerializer(serializers.Serializer):
BatteryVoltage = serializers.FloatField(required=False)
COFinal = serializers.FloatField(required=False)
COOffset = serializers.FloatField(required=False)
COPrescaled = serializers.FloatField(required=False)
C... |
<reponame>bensallen/zackup
class HostConfig < ActiveRecord::Base
belongs_to :host
belongs_to :config_item
validates_uniqueness_of :config_item_id, :scope => :host_id,:message => "This settings is already set for this host"
def name
item = self.config_item
if item
return item.name
else
... |
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Button } from 'nr1';
import {
add,
sub,
getDaysInMonth,
endOfMonth,
startOfMonth,
getISODay
} from 'date-fns';
import { Day } from '.';
const MONTHS = [
'January',
'February',
'March',
'April',
'May',
'J... |
import { atom, useRecoilState } from 'recoil';
export const currentFiltersJsonState = atom<string>({
key: 'currentFiltersJsonState',
default: ('')
});
export const useFilterState = () => {
const [filters, setFilters] = useRecoilState(currentFiltersJsonState);
const updateFilters = (newFilters: string) => {
... |
<reponame>georgelam6/SLECS<gh_stars>0
#pragma once
#include <unordered_map>
#include <array>
#include <cassert>
#include "ECSCommon.h"
class IComponentArray {
public:
virtual ~IComponentArray() = default;
virtual void EntityDestroyed(EntityHandle ent) = 0;
};
template <typename T>
class ComponentArray : publi... |
<reponame>drkitty/cyder
from itertools import chain, imap, groupby
import re
from dhcp_objects import (Option, Group, Host, Parameter, Pool, Allow,
Deny, Subnet, )
key_table = [(Option, 'options'),
(Group, 'groups'),
(Host, 'hosts'),
(Parameter, 'paramet... |
#!/bin/bash
set -euo pipefail
echo "#############################"
echo "# LOAD MODULES"
type module >& /dev/null || source /mnt/software/Modules/current/init/bash
module purge
module load git
module load gcc/4.9.2
CCACHE_BASEDIR=$PWD
module load ccache/3.3.4
module load boost/1.60
module load ninja/1.7.1
module load ... |
<filename>pkg/store/transport.go<gh_stars>1-10
package store
import (
"github.com/opencars/wanted/pkg/model"
)
// Transport is a wrapper for slice of WantedVehicle.
type Transport []model.Vehicle
// Len is the number of elements in the collection.
func (t Transport) Len() int {
return len(t)
}
// Less reports whe... |
#!/bin/bash
. path.sh
python3 tfsr/tfsr/data/save_speech_data.py \
--path-base=$DATA_PATH \
--prep-data-shard=10 \
--prep-data-name=timit \
--path-vocab=egs/data/timit_61.vocab \
--feat-type=graves13 \
--feat-dim=123 \
--path-train-json=train_61.json \
--path-valid-json=valid_61.json \
--path-test-json=test_61.json \... |
#!/usr/bin/env bash
source $(dirname $0)/common.sh
if [ $# -gt 0 ]; then
$kafka_home/bin/kafka-console-producer.sh --topic $1 --broker-list $all_brokers
else
echo "Usage: "$(basename $0)" <topic>"
fi
|
<gh_stars>10-100
/*
* Copyright (c) 2016 ARM Limited. All rights reserved.
*/
#ifndef TEST_NS_NVM_HELPER_H
#define TEST_NS_NVM_HELPER_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdbool.h>
bool test_ns_nvm_helper_write();
bool test_ns_nvm_helper_read();
bool test_ns_nvm_helper_delete();
bool test_ns_nvm_hel... |
<reponame>NischalKash/Ruby_Assignment_1
def sorted_squares(a)
a.map! { |num| num**2 }.sort
end
def move_zeros(a)
c = a.count
a.delete(0)
zero_count = c - a.count
a.fill(0, a.size, zero_count)
end
def group_anagrams(a)
res = Hash.new{ |h,k| h[k] = Array.new }
# puts res
a.each do |s|
sorted_str = s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.