text stringlengths 1 1.05M |
|---|
gcc ./client.c -o client -levent -lcrypto -lssl -ldl -lsqlite3 -ljansson -std=c99 `pkg-config --cflags --libs glib-2.0 gtk+-2.0 gnet-2.0` -Wall -Wextra -pedantic
|
package utils
import (
"context"
"log"
"firebase.google.com/go/v4/auth"
"github.com/Dev-Qwerty/zod-backend/project_service/api/config"
)
// GetUserDetails fetch user details from firebase
func GetUserDetails(uid string) (*auth.UserInfo, error) {
u, err := config.Client.GetUser(context.TODO(), uid)
if err != ni... |
<gh_stars>0
// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package ipn
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"github.com/tailscale/wireguard-go/wgcfg"
"t... |
#!/bin/bash
if [[ $target_platform =~ linux.* ]] || [[ $target_platform == win-32 ]] || [[ $target_platform == win-64 ]] || [[ $target_platform == osx-64 ]]; then
export DISABLE_AUTOBREW=1
$R CMD INSTALL --build .
else
mkdir -p $PREFIX/lib/R/library/optimbase
mv * $PREFIX/lib/R/library/optimbase
if [[ $target... |
/**
* Created by tvaisanen on 12/22/17.
*/
define(["configuration/classNames"],
function (classNames) {
"use strict";
/**
* Form for creating node post request
*
* @exports templateRenderer
*/
var renderedTemplate = document.createElement('div');
... |
#!/usr/bin/env bash
# Exit immediately if a pipeline, which may consist of a single simple command,
# a list, or a compound command returns a non-zero status
set -e
readonly COMPONENT=${1?Component is not specified}
readonly RELEASE=${2?Release is not specified}
readonly SET=${3?Set is not specified}
readonly base_r... |
<filename>src/client/main.ts
/// <reference path="../../typings/knockout/knockout.d.ts" />
/// <reference path="./partial_viewmodels/common.ts" />
/// <reference path="./utils.ts" />
/// <reference path="./config.ts" />
type MenuItem = PartialViewmodels.MenuItem;
class ApplicationViewmodel {
public mainMenu: Kno... |
// Copyright 2020 Wearless Tech 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 appli... |
<reponame>willviles/firelink<filename>src/helpers/revert-json.spec.ts
import 'jest';
import { readFile, unlink } from 'fs';
import { promisify } from 'util';
import { PackageJson } from '../injection-tokens';
import { fileExists } from './file-exists';
import { revertJson } from './revert-json';
import { writeFileJso... |
package com.dvisagie.vote.users
import java.util.UUID
import akka.actor.{Actor, ReceiveTimeout}
import com.dvisagie.vote.injector.Provider
import com.dvisagie.vote.repositories.UserRepository
import scala.concurrent.duration._
class UserControllerActor(implicit provider: Provider) extends Actor {
import UserContr... |
#!/bin/bash
pushd $(dirname $0) 2>/dev/null
if [[ -n "${1}" ]]; then
echo ${1} ' build'
cargo build --${1:-release}
else
echo 'debug build'
cargo build
fi
rm -rf "sled.node" 2>/dev/null
[[ -f ${FILE:="../../target/${1:-debug}/libsled_nodex.dylib"} ]] && cp ${FILE} sled.node
[[ -f ${FILE:="../../target/${1:-d... |
<gh_stars>1-10
// (C) 2018 ETH Zurich, ITP, <NAME> and <NAME>
#ifndef CINTRIN_HPP_
#define CINTRIN_HPP_
//#include <x86intrin.h>
#include <immintrin.h>
#include <complex>
#include <vector>
#include <algorithm>
template <class M, class I>
inline void permute_qubits_and_matrix(I *delta_list, unsigned n, M & matrix){
... |
<gh_stars>1-10
import { combineReducers } from 'redux';
import { reducer as github } from './github';
export default combineReducers({
github,
});
|
function numsToStrings(arr) {
return arr.map(x => x.toString());
} |
#!/bin/sh -e
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Monitors a web-based CSV queue for autotest requests, runs the test, and
# uploads the status and results.
# Example CSV contents (mus... |
def celsius_to_fahrenheit(celsius):
fahrenheit = (celsius * 9/5) + 32
return fahrenheit
celsius_temp = float(input("Enter Celsius temperature: "))
fahrenheit_temp = celsius_to_fahrenheit(celsius_temp)
print(f"Fahrenheit temperature: {fahrenheit_temp}") |
<filename>examples/counter/containers/App.ts
import {Component, Inject, OnDestroy} from 'angular2/core';
import {bindActionCreators} from 'redux';
import {Counter} from '../components/Counter';
import * as CounterActions from '../actions/CounterActions';
@Component({
selector: 'root',
directives: [Counter],
temp... |
function FolderHandler() {}
Object.assign(FolderHandler.prototype, {
load: function (url, callback) {
callback(null, null);
},
open: function (url, data) {
return data;
}
});
export { FolderHandler };
|
#!/bin/bash
# To make executable command:
# chmod +X assemble.sh
# sudo cp ./assemble.sh /usr/bin/assemble
# Once done, simply execute as:
# $ assemble [source file] [executable name]
arm-linux-gnueabi-as -o a.o $1
arm-linux-gnueabi-ld -o $2 a.o
rm a.o # comment out if you don't want the intermidiate binary deleted... |
//Run all tests.
require('./mouse');
require('./keyboard');
require('./screen');
require('./bitmap');
|
<filename>rover/core/servers/tobeintegrated/armFreqServer.py
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
import subprocess
from time import sleep
import smbus
import time
# for RPI version 1, use "bus = smbus.SMBus(0)"
bus = smbus.SMBus(1)
def acceptConnections():
while True:
... |
import { logger, post } from '../utils';
export default function received(pushCode, deviceCode, token) {
const url = `/pushes/${pushCode}/received/`;
const device = `/api/v1/devices/${deviceCode}/`;
return post(url, { device }, token)
.then(response => logger('received', response.status));
}
|
import {GameInstance} from "./GameInstance";
/**
* Created by Hyperion on 04/06/2017.
*/
export class GameInfo {
/**
* If true means this data comes from lobby parent server
* else from dedi server or server instanced by lobby
*/
IsLobbyServer:boolean;
IsPassworded:boolean;
/**
* Total number of ... |
import { Value } from 'slate';
export interface CompletionItem {
/**
* The label of this completion item. By default
* this is also the text that is inserted when selecting
* this completion.
*/
label: string;
/**
* The kind of this completion item. Based on the kind
* an icon is chosen by the ... |
<reponame>ywkim0606/gtsam<filename>gtsam/geometry/Similarity2.cpp
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: <NAME>, et al. (see THANKS for the full author ... |
use std::path::{Path, PathBuf};
use tokio::task::spawn_blocking;
use std::fs::File;
use std::io::{Read, Result as IoResult};
enum Endianness {
BigEndian,
LittleEndian,
}
struct YourType; // Replace with the actual type you are working with
impl YourType {
#[inline]
async fn from_file_with_offset_asyn... |
#!/usr/bin/ruby
class YadSystrayCmd
def initialize
self.instance_eval(File.read(ENV["maildeliv_conf"] || "#{ENV["HOME"]}/.yek/maildeliv/maildelivrc.rb")) # To use configuration file.
@memofile = (ENV["maildeliv_tempdir"] || @maildeliv_conf[:TempDir] || "#{ENV["HOME"]}/tmp/recv-mails") + ".summery"
@yadli... |
#!/bin/bash
# Copyright 2013 Kyle Harper
# Licensed per the details in the LICENSE file in this package.
# Source shared, core, and namespace.
. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../__shared.inc.sh"
. "$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/../../../sbt/core.sh"
. "$( cd "$( dirname "${... |
export * from './change_detection';
export * from './core';
export * from './annotations';
export * from './directives';
export * from './forms';
export * from './di';
export * from './http';
export {Observable, EventEmitter} from 'angular2/src/facade/async';
export * from 'angular2/src/render/api';
export {DomRenderer... |
<reponame>OS2World/LIB-GRAPHICS-The_Mesa_3D_Graphics_Library
/*
* Copyright (c) 1991, 1992, 1993 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provided
* that (i) the above copyright notices and ... |
#!/bin/sh
[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: $0 $@" >> /tmp/debug_apkg
path=$1
log=/tmp/rclone.log
echo "INIT linking files from path: $path" >> $log
# create link to binary
ln -sf $path/rclone-*-linux-*/rclone /usr/bin/rclone
# create folder for the webpage
WEBPATH="/var/www/rclone/"
mkdir -p $WEBPATH
ln... |
<filename>public/vocables/js/tools/annotator.js<gh_stars>0
/** The MIT License
Copyright 2020 <NAME> / SousLesens <EMAIL>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, inc... |
#!/bin/sh
docker build -f Dockerfile.nmap -t nmap .
MYIP=`ip route get 8.8.8.8 | awk '{print $NF; exit}'`
echo "ip address of my host is $MYIP"
echo "scan my host network with nmap from inside the container (assuming 24bit subnet)"
docker run --rm nmap $MYIP/24
echo "scan gateway ip for default network bridge"
GWIP... |
package com.cgs.kerberos.server;
import java.io.IOException;
import java.net.Socket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cgs.kerberos.bean.FirstRequest;
import com.cgs.kerberos.bean.FirstResponse;
import com.cgs.kerberos.exception.KerberosException;
import com.cgs.kerberos.handle.TgtP... |
// Autogenerated from development/elements/position.i
package ideal.development.elements;
import ideal.library.elements.*;
public interface any_position extends any_data, any_reference_equality, any_stringable { }
|
<gh_stars>1-10
// Copyright 2021 99cloud
//
// 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 ag... |
<filename>public/TenantNewView.js
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["TenantNewView"],{
/***/ "./node_modules/ts-loader/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/Views/Tenants/EditTenant.vue?vue&type=script&lang=ts&":
/*!***********************************************... |
# CREATE_INDEX
st2 run -d elasticsearch.indices.create_index name=orange-55 extra_settings='{ "settings" : {"number_of_shards" : 3, "number_of_replicas": 0}, "mappings": {"type1": {"properties": { "field1": {"type": "string", "index": "not_analyzed"}}}}}' | sed -e 's/\\n/\n/g' | sed -e 's/\\"/"/g'
st2 run -d elasticsea... |
import React, { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { detailsUniversity } from '../../actions/universities/universitiesActions';
import { Link } from 'react-router-dom';
import Box from '@material-ui/core/Box';
import Typography from '@material-ui/core/Typography';
... |
import React from 'react';
import ReactDOM from 'react-dom';
import s from './join.module.css'
import PostJoin from '../../API/PostJoin';
const joinTask = async (e,{hide,ob})=>{
e.preventDefault();
const json = await PostJoin(ob)
console.log(json)
if(json.status){
alert("Đăng kí tham gia thành côn... |
TERMUX_PKG_HOMEPAGE=https://lxqt.github.io
TERMUX_PKG_DESCRIPTION="LXQt dialog showing information about LXQt and the system"
TERMUX_PKG_LICENSE="LGPL-2.1"
TERMUX_PKG_MAINTAINER="Simeon Huang <symeon@librehat.com>"
TERMUX_PKG_VERSION=0.17.0
TERMUX_PKG_REVISION=2
TERMUX_PKG_SRCURL="https://github.com/lxqt/lxqt-about/rel... |
#!/bin/bash
# Stop container related functions
# Not exported functions
stop_container() {
status_container
if [ $? == 1 ]; then
echo "Stopping container ${CONTAINER_NAME}. This can take a few seconds"
docker stop ${CONTAINER_NAME}
fi
}
stop_container_help() {
echo "$(basename "$0") container stop"
... |
<reponame>edubossa/-spring-cloud-gcp-guestbook<gh_stars>1-10
package com.example.frontend;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.a... |
package ninjananas.mc.ColorfulNames;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Plugin extends JavaPlugin {
private static final ChatColor [] allColors = {
ChatColor.AQUA,
ChatColor.BLACK,
ChatColor.BLUE,
ChatColor.DARK_AQUA,
C... |
def long_words(sentence):
words = sentence.split(' ')
long_words = []
for word in words:
if len(word) > 5:
long_words.append(word)
return long_words |
<reponame>alexandresantosm/clean-cache-control
export * from "./save-purchases";
export * from "./load-purchases";
|
<reponame>Mdamman/APP_MakeTheChange<gh_stars>0
import { EventEmitter, ElementRef, QueryList, AfterContentInit, OnDestroy } from '@angular/core';
import { Subscription } from 'rxjs';
import { VgApiService } from '../../services/vg-api/vg-api.service';
import { VgFullscreenApiService } from '../../services/vg-fullscreen-... |
#!/bin/bash -e
# stconfig.sh
# Author:
# Alex Soto <alexsoto@microsoft.com>
#
# Swift Toolchain Config vars
# If SOM_PATH is set it means we will use a custom build
# of the swift toolchain like the one produced by Pack-Man.
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
if [[ ! -z "${SOM_PATH}" ]] ; the... |
<filename>app/src/main/java/edu/hzuapps/androidlabs/homeworks/net1414080903220/knowdev/fragment/news/MobileFragment.java
package edu.hzuapps.androidlabs.homeworks.net1414080903220.knowdev.fragment.news;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.supp... |
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class GreetingController {
@RequestMapping("/greet")
public String greet(@RequestParam(value="name", default="world") String name) {
String greeting = "Hello " + nam... |
###############################################################################
# Copyright 2016 Cory Bennett
#
# 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://w... |
<reponame>hieudt7/react-sample
import React from 'react'
import Modal from 'components/Modal'
import Rule from 'components/Rule'
import Top from 'components/Top'
import Chest from 'components/Chest'
import Exchange from 'components/Exchange'
import PigCard from 'components/PigCard'
import { CHEST_INFO } from 'component... |
#!/bin/bash
cd /etc/init.d
echo '[Start Lock Server]'
./totvslockserver start
sleep 5
echo '[Start License Server]'
./totvslicense start
sleep 2
echo '[Start DBAccess Server]'
./totvsdbaccess start
sleep 2
echo '[Start Slave01]'
./totvslave01 start |
<reponame>parti-coop/demosx<filename>src/main/java/seoul/democracy/common/handler/SiteAuthenticationSuccessHandler.java
package seoul.democracy.common.handler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.we... |
/**
* Created by cqh on 2014/11/24.
*/
/**
* Created by cqh on 2014/11/24.
*/
function DateToFormatString( date, sep){
if( !sep )
{
sep = "-";
}
var mm = date.getMonth() + 1;
if( mm < 10 ){
mm = "0" + mm;
}
var dd = date.getDate();
if(dd < 10){
... |
#!/bin/bash
###############################################################################
#
# LIBCOPY v1.8 by psxc
######################
#
# This small script (ripped from glinstall.sh ;) will copy libs used by files
# in glftpd's bin dir.
# The script should be run after the zipscript is installed.
# You should al... |
#!/bin/sh -e
# This file is part of boydemdb.
#
# Copyright (c) 2020 Dima Krasner
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the righ... |
<reponame>Ashindustry007/competitive-programming
// https://www.codechef.com/FEB20A/problems/LONGCOOK
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int n = 400 * 12;
int s[n];
bool isleap(int y) {
if (y % 400 == 0) return 1;
if (y % 100 == 0) return 0;
return y % 4 == 0;
}
int main... |
<reponame>skurapati583/Java-DataStructures-Examples<filename>src/examples/collections/MapsExample.java
package examples.collections;
import java.util.HashMap;
public class MapsExample {
public static void main(String[] args) {
HashMap<String, Integer> employerIds = new HashMap<>();
employerIds.put... |
<gh_stars>0
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.com/docs/node-apis/
*/
// You can delete this file if you're not using it
const path = require('path')
const { createFilePath } = require(`gatsby-source-filesystem`)
const { graphql } = require('gatsby')
exports.onCreateNo... |
import requests
import json
def get_stock_price(ticker):
url = 'https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol={ticker}&interval=1min&apikey=<Your_API_KEY>'.format(ticker=ticker)
response = requests.get(url)
data = json.loads(response.text)
if data:
ts = data['Time Serie... |
<filename>public/js/addDateTimepicker.js
// Waiting for the DOM ready...
function datepResize() {
// Get width of parent container
var width = jQuery("#datetimepicker").width(); //attr('clientWidth');
if (width == null || width < 1){
// For IE, revert to o... |
#pragma once
#include "TNAH/Renderer/RenderCommand.h"
#include "TNAH/Scene/SceneCamera.h"
#include "TNAH/Scene/Components/Components.h"
#include "TNAH/Renderer/Material.h"
#include "Light.h"
#include "Mesh.h"
#include "Texture.h"
namespace tnah {
/**
* @class Renderer
*
* @brief A renderer class responsible ... |
<reponame>HenryRuiz332/comercial
import Servicios from '../Index'
import ServiciosContratados from '../ServiciosContratados'
const routes = [
...route('/servicios', Servicios, {
Auth: true,
}),
...route(`/servicios-contratados`, ServiciosContratados, {
Auth: true,
}),
]
function rout... |
define(function(require, exports, module) {
var utils = require('utils');
var bs = require('./xsjsdfmxBS');
var viewConfig = {
initialize: function(data) {
var mode = WIS_EMAP_SERV.getModel(bs.api.pageModel, 'jsdfmx', 'form');
$("#emapForm").emapForm({
data: mod... |
def dec_to_binary(num):
binary = bin(num)
return binary[2:]
print(dec_to_binary(5))
# Output: 101 |
<filename>psp/psplib/ctrl.h
/** PSP helper library ***************************************/
/** **/
/** ctrl.h **/
/** **/
/** This file contains declarati... |
def get_distinguished_cand(c, r, l, non_manip_rankmaps, strength_order):
# Create a dictionary to store the strength of each candidate
candidate_strength = {candidate: 0 for candidate in strength_order}
# Iterate through the non-manipulative voter rankings to calculate the strength of each candidate
fo... |
#!/bin/bash
# Copyright 2015 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
<reponame>djstaros/qmcpack
##################################################################
## (c) Copyright 2015- by <NAME> ##
##################################################################
#====================================================================#
# gamess_analyzer.py ... |
#!/bin/bash
netcat 127.0.1 1234
|
#!/bin/env node
'use strict';
var fs = require('fs');
var request = require('request-promise-native');
var blessed = require('blessed');
var hostname = 'http://192.168.86.180'
var device_type = "my_hue_app#my_hostname"
var url;
process.title = 'hue_mungus';
process.on('unhandledRejection', (err, promise) => { throw ... |
import {
AfterViewInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ContentChild,
DoCheck,
ElementRef,
EventEmitter,
Inject,
InjectionToken,
Input,
OnChanges,
OnDestroy,
Optional,
Output,
Self,
SimpleChanges,
ViewChild,
ViewEncapsulation
} from '@angular/core';
import {D... |
#!/bin/bash
set -e
./gradlew clean build
|
var searchData=
[
['nil',['Nil',['../namespacelua.html#classlua_1_1_nil',1,'lua']]]
];
|
from numpy import full
# Create an array filled with blank strings
board = full((6, 7), " ")
# Variable exists to stop main loop when someone wins
win = False
def clear():
# Clears the screen
print("\n" * 100)
def displayBoard():
# Prints the board
print(" " + str(board)[1:-1])
def p1Input():
... |
<reponame>YourBetterAssistant/yourbetterassistant
import { Message } from "discord.js";
import model from "../Schemas/autoMod";
const badwords = require("badwords/array");
function isUpperCase(str: string) {
if (
str.includes("@") ||
str.includes("<") ||
str.includes(
">" ||
str.includes("!"... |
require 'twilio-ruby'
response = Twilio::TwiML::VoiceResponse.new
response.record
puts response
|
#!/bin/bash
git status
sleep 2
echo "-------Begin-------"
if [ ! $1 ]; then
read -r -p "Please input your Video commit message: " input
else
input=$1
fi
git add -A
if [ $input ]; then
git commit -am $input
else
git commit -am "自动化代码提交"
fi
git push origin master
git fetch
result=$(git tag --list)
OLD... |
<reponame>ParinModi2/Free-Door<gh_stars>1-10
var comment = require('../Model/Comment');
var user = require('../Model/User');
var Product = require('../Model/Product');
var Category = require('../Model/Category');
var offer = require('../Model/Offer');
var ejs = require("ejs");
exports.index = function(req, res){
res... |
import React, { PureComponent } from 'react';
import { ThemeProvider } from 'styled-components';
import Loading from '../../utils/Loading';
import { SectionHeader, Section, ExpGrid, ExpHeaderGrid, ExpFooter, ExpContainer } from '../Styled';
import { key } from '../../utils';
import api from '../../api';
const theme = ... |
// Copyright 2019 Google LLC
//
// 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 ... |
<filename>spec/logic/package/information_extractor_spec.rb
require 'spec_helper'
require_relative '../../../logic/package/information_extractor'
# Ideally we should be more concise about the different cases
# For brevity, I added the first 5 packages descriptions and their parsing results as test cases
RSpec.describe ... |
// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <grp.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>
#include <memory>
#include <string>
#include <vector>
#include <base/... |
#pragma once
#include <vector>
#include <tbb/parallel_for.h>
#include <tbb/tbb.h>
template <typename T, typename Op>
T inclusive_scan(const std::vector<T> &in, const T &id, std::vector<T> &out, Op op)
{
out.resize(in.size(), id);
using range_type = tbb::blocked_range<size_t>;
T sum = tbb::parallel_scan(
... |
function createHierarchalName(baseName, errorMessage) {
return `${baseName} - ${errorMessage}`;
}
globals.harness.pushTestResult();
const error_message = "Some error message"; // Assuming error_message is defined
globals.harness.setResultName(createHierarchalName("Assertion Site Error", error_message)); |
#!/bin/sh
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
cd $1
npm run forever
|
<gh_stars>100-1000
/**
* @jest-environment ./prisma/prisma-test-environment.js
*/
import request from 'supertest'
import { v4 as uuid } from 'uuid'
import { prisma } from '@infra/prisma/client'
import { redisConnection } from '@infra/redis/connection'
import { app } from '@infra/sns-webhook/app'
import { validEven... |
import { GetServerSideProps } from 'next';
export const getServerSideProps: GetServerSideProps = async () => {
const images = [
'/images/home/undraw_annotation_7das.svg',
'/images/home/undraw_Notebook_re_id0r.svg',
'/images/home/undraw_Task_re_wi3v.svg',
'/images/home/undraw_Website_builder_re_ii6e.s... |
<reponame>nabeelkhan/Oracle-DBA-Life<filename>INFO/Books Codes/Oracle PLSQL Tips and Techniques/OutputChapter15/15_12.sql
-- ***************************************************************************
-- File: 15_12.sql
--
-- Developed By TUSC
--
-- Disclaimer: Neither Osborne/McGraw-Hill, TUSC, nor the author warrant
... |
#!/bin/bash
set -eu
exec diff -u <(sed -e 's/secure: "[^"]*"/secure: "SECURE"/g' "$1") "$2"
|
<filename>mctstree.cpp<gh_stars>0
#include "mctstree.h"
#include <algorithm>
#include <thread>
#include <future>
#include <math.h>
#include <QDebug>
#include "debug.h"
unsigned MCTSTree::NODE_EXPLORATIONS_TO_EXPAND = 32;
MCTSTree::MCTSTree(short evalColor) {
_root = new MCTSNode();
_root->setParent(nullptr);
... |
def isPalindrome(word):
n = len(word)
i = 0
j = n - 1
while (i <= j):
if (word[i] != word[j]):
return False
i = i + 1
j = j - 1
return True |
function translatePhrases(array $phrases, string $languageCode): array {
$translations = [];
switch ($languageCode) {
case 'fr':
$translations = [
'translatable.site_name' => 'Nom du site',
'site_email' => 'E-mail du site',
// ... additional Fr... |
<reponame>weltam/idylfin
/**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
package com.opengamma.analytics.financial.equity.future.derivative;
import com.opengamma.util.money.Currency;
/**
* A cash-settled futures contract on th... |
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from social_django.models import UserSocialAuth
@receiver(post_save, sender=User)
def create_user_social_auth(sender, instance, created, **kwargs):
if created:
UserSocialAuth.obje... |
<reponame>EllaSharakanski/salto
/*
* Copyright 2021 Salto Labs Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
... |
<reponame>zaidmukaddam/linkto<filename>packages/core/src/hooks/useSafeLayoutEffect.tsx
import { useEffect, useLayoutEffect } from "react";
/**
* useSafeLayoutEffect enables us to safely call `useLayoutEffect` on the browser
* (for SSR reasons)
*
* React currently throws a warning when using useLayoutEffect on the ... |
<filename>spec/functions/delete_values_spec.rb
# frozen_string_literal: true
require 'spec_helper'
describe 'delete_values' do
it { is_expected.not_to eq(nil) }
it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{Wrong number of arguments}) }
it { is_expected.to run.with_params(1).and_rai... |
def BFS(tree):
queue = []
visited = []
root = tree.root
queue.append(root)
while len(queue) > 0:
node = queue.pop(0)
visited.append(node)
for child in node.children:
if child not in visited and child not in queue:
queue.append(child)
return v... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.