text stringlengths 1 1.05M |
|---|
<filename>src/components/Cards/Photo/PhotoCard.styled.js
import styled from "styled-components"
import { default as component } from "./PhotoCard"
const PhotoCard = styled(component)`
max-width: 45%;
height: auto;
transition: opacity 0.4s;
transition: max-width 0.4s;
@media (max-width: 600px) {
max-width: 100%;
... |
"use strict";
const expect = require("chai").expect;
const camelCase = require("../camel-case");
const unCamelCase = require("../un-camel-case");
const data = {
borderTopLeftRadius: "border-top-left-radius",
backgroundImage: "background-image",
xwebkitAnimation: "-xwebkit-animation",
webkitAnimation: "-webkit-ani... |
<reponame>cityofaustin/transportation-data-utils
"""
Python client for logging job results via a postgrest interface.
This class logs the outcome of scripted tasks in a pre-configured database whose API
is made available via postgrest (https://postgrest.com/).
The CONGIG and instance parameters must match the job dat... |
#!/usr/bin/env node
"use strict";
const { minifyFile } = require("../lib/index.js");
Promise.all(process.argv.slice(2).map(minifyFile)).catch(function(e) {
console.error(e);
process.exit(1);
});
|
# This is a little functionality module that I'm going to call:
### The Columnizer!!! ###
# The whole point here is to take a list and display it in a nicely ordered
# column format. Based upon Kuros' code from the original Slither base.
def columnize(player, list, columns, sorted = True, padding = 2):
# Start ... |
<filename>public/js/search.js
$(function(){
$('.form-holder').delegate("input", "focus", function(){
$('.form-holder').removeClass("active");
$(this).parent().addClass("active");
})
})
$(document).ready(function() {
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
t... |
export class MicroClassVideo {
title: string;
description: string;
videoSrc: string;
constructor(private params? : any) {
if (params) {
this.title = params['title'];
this.description = params['description'];
this.videoSrc = params['videoSrc'];
}
... |
#!/bin/bash
set -euo pipefail
# ensure data subdirectory exists
mkdir -p /data/polylines/;
# enumerate a list of PBF files
shopt -s nullglob
PBF_FILES=(/data/openstreetmap/*.pbf);
# ensure there is at least one PBF file in the osm directory
if [[ ${#PBF_FILES[@]} -eq 0 ]]; then
2>&1 echo 'no *.pbf files found in /... |
#!/bin/bash
#
# Xenera as mensaxes de benvida aos cursos en liña
#
# Uso: script.sh alumnos modelo datos arg1 ... argn
# Os argumentos son a ruta relativa aos ficheiros adxuntos da mensaxe.
#
# alumnos - username,password,firstname,lastname,email,course1,group1,enrolperiod1
# modelo - Texto para o corpo da mensaxe. Hai... |
groupadd family
groupadd guest
groupadd star
# We don't need home folders (-M)
useradd -MG family alice
useradd -MG family cooper
useradd -MG guest baxter
useradd -MG star django
# Home folder is already created (-M)
useradd -M supinfo
# Because of earlier ssh setup
chown -R supinfo:supinfo /home/supinfo
|
<gh_stars>0
'use strict';
const TestBase = require( '../class.base' );
class TestLogA extends TestBase {
constructor( deps ) {
super( deps, 'TestLogA' );
this._logger = deps.get( 'logger' );
this._logger( 'info', 'TestLogA constructor', { meta: 'data' } );
this._logb = deps.get( './test/lib/log... |
# Copyright (c) 2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#network interface on which to limit traffic
IF="eth0"
#limit of the network interface in question
LINKCEIL="1gbit"
#limit outbound S... |
<reponame>tiancihe/X6
import { Point } from '../../struct/point'
import { Viewbox } from '../../vector/container/viewbox'
import { Morpher } from '../../animating/morpher/morpher'
import { MorphableBox } from '../../animating/morpher/box'
import { SVGAnimator } from '../svg'
export class SVGViewboxAnimator<
TSVGElem... |
class Car:
def __init__(self):
self.speed = 0
def start(self):
self.speed = 1
print("Car started!")
def stop(self):
self.speed = 0
print("Car stopped!")
def accelerate(self, speed):
self.speed += speed
print("Car accelerated to {... |
package relay
import (
"bufio"
"errors"
"net"
"net/http"
)
// modes.go contains specific modification structs or decorators over standard
//go interfaces for useful bits
// ResponseWriter provides a clean interface decorated over the http.ResponseWriter
type ResponseWriter interface {
http.ResponseWriter
http.... |
package com.abubusoft.filmfinder.view.adapter;
public class FilmAdapter {
}
|
"""Const variables."""
DEFAULT_CONF_FILE_PATH = (
"~/.troupial.yaml",
"~/.troupial.yml",
"~/.config/troupial/conf.yaml",
"~/.config/troupial/conf.yml",
)
DEFAULT_CONFIG_DATA = {
"theme": "default",
"key_bindings": {
"c-c": "exit",
"c-d": "exit",
"c-right": "layout.focus_... |
package com.qa.demo.persistence.repos;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.qa.demo.persistence.domain.Shelter;
@Repository
public interface ShelterRepo extends JpaRepository<Shelter, Long> {
// CRUD Functionality
}
|
<filename>app.test.js
const request = require('supertest');
const app = require('./app').app;
const build = require('./app').productBuilder;
// Integration tests
// async means we will wait for the response to come back.
describe('GET requests', () => {
test('GET product/read endpoint, expect 200', async ()... |
#!/bin/bash
function attachedDevices() {
local devices=$($ANDROID_HOME/platform-tools/adb devices | awk 'NR>1 {print $1}')
echo $devices
}
function connectedPorts() {
# cuts out the port id from the device list
local ports="$( cut -d '-' -f 2- <<< "$devices" )"
echo $ports
}
function ncToken() {
... |
# Copyright 2018 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 applicable law or a... |
#!/usr/bin/env bash
case $1 in
reset )
xrandr --output eDP1
;;
hdmi1 )
xrandr \
--output eDP-1 \
--primary \
--mode 3840x2160 \
--pos 0x0 \
--r... |
<gh_stars>0
angular.module('app.about', [])
.controller('AboutController', ['$scope', function ($scope) {
'use strict';
$scope.something = 'We do a bit of this and and a bit of that.';
}]);
|
package com.rox.logic.gate.binary;
import com.rox.logic.gate.type.AuditableLogicGate;
/**
* @Author rossdrew
*/
public class And extends AuditableLogicGate {
@Override
protected boolean performTransformation(boolean... values) {
for (boolean v : values){
if (!v){
return f... |
<reponame>yanyunchangfeng/NiceFish-React
import * as React from 'react';
import {NavLink} from 'react-router-dom'
function Exception404(){
return (
<div className="container mt-16px">
<div className="row no-gutters align-items-center">
<div className="exception-404 col-7"></div>
... |
# File: S (Python 2.4)
from pandac.PandaModules import TextNode
from direct.gui.DirectGui import *
from direct.directnotify import DirectNotifyGlobal
from otp.otpgui import OTPDialog
from pirates.piratesbase import PLocalizer, PiratesGlobals
from pirates.piratesgui import PiratesGuiGlobals
from pirates.piratesgui impo... |
import json
import requests
#Get the URL for the website
url = 'https://example.com/blogpage'
r = requests.get(url)
#Check for errors
if r.status_code != 200:
print('Error:', r.status_code)
#Parse the page content
page_content = r.text
#Parse the page_content into a Key-Value format
dict = {}
for line in page_c... |
<filename>dbSchema/src/main/java/sword/langbook3/android/db/IdPutInterface.java
package sword.langbook3.android.db;
import sword.database.DbSettableQueryBuilder;
public interface IdPutInterface {
void put(int columnIndex, DbSettableQueryBuilder builder);
}
|
#!/bin/sh
echo "Enter city id: "
read city
echo "Enter your api key: "
read key
echo "Getting city information. Please hold....."
curl --get "https://politicsandwar.com/api/city/id=$city&key=$key" |
#!/bin/bash
xctool -scheme run_it build test
|
<reponame>favid-inc/app-customer<filename>src/assets/images/index.ts
import { ImageSource } from './type';
export { ImageSource, RemoteImage } from './type';
export const imageProfile7Bg: ImageSource = {
imageSource: require('./source/image-background-profile-7.jpg'),
};
export const splashImage: ImageSource = {
... |
mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Pdaily
|
import logging
class OnlineStoreLogger:
def __init__(self):
self.logger = logging.getLogger('OnlineStoreLogger')
self.logger.setLevel(logging.DEBUG)
self.log_format = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
def configure_logger(self, log_level, log_format):
... |
<filename>src/components/hero-tagline.js
import React from "react"
const HeroTagLine = ({ content }) => (
<div className="c-hero__tagline">{content}</div>
)
export default HeroTagLine |
def optimize_array(arr):
new_arr = []
for x in arr:
if x < 50:
new_arr.append(50)
elif x > 50:
new_arr.append(100)
return new_arr
arr = [45, 60, 32, 84]
output = optimize_array(arr)
print(output) #[50, 100, 50, 100] |
<reponame>skibq/vue-tables-2
'use strict';
module.exports = function (h) {
var _this = this;
return function (perpageValues, cls, id) {
cls = cls + ' VueTables__select-per-page';
return perpageValues.length > 1 ? h(
'el-select',
{ 'class': cls,
attrs: { value: _this.limit,
si... |
package com.atjl.kafka.core;
import com.atjl.kafka.core.thread.BaseThread;
import com.atjl.util.common.CheckUtil;
import com.atjl.kafka.core.thread.FetchDataThread;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
impor... |
import requests
import json
text = "Gravity is a force of attraction between two masses, which depends on the distance between them."
url = 'https://api.ai.stocktwits.com/recommend/similar'
payload = {
"omsIdType": 'url',
"text": text
}
req = requests.post(url, json=payload)
recommendations = json.loads(req.text)... |
const proc = require("../../process_option");
/* eslint-disable-next-line */
const { isRegExp } = require("util");
const { isTagNode } = require("../../knife/tag_utils");
const lintClassStyle = require("../class-style").lint;
module.exports = {
name: "id-style",
on: ["dom"],
need: "dom",
validateConfig(format)... |
<reponame>rbreu/tr8n
class AddApplicationToLanguageCases < ActiveRecord::Migration
def self.up
add_column :tr8n_language_cases, :application, :string
end
def self.down
remove_column :tr8n_language_cases, :application
end
end
|
#include "stdafx.h"
Sigs *pSigs = new Sigs();
namespace GameFunctions
{
void PatchRecoil(bool bNoRecoil)
{
if (bNoRecoil)
Utilss::MemoryEdit(reinterpret_cast< void* >( OFFSET_PATCHRECOIL ), reinterpret_cast< BYTE* >( pSigs->GetSignature( pSigs->RECOIL_OFF ) ), 10 );
else
Utilss::MemoryEdit(rein... |
$(document).ready(function(){
// $(window).scroll(function() {
// $(".onsale_img").mouseenter(function () {
// $(".onsale_content_overlay").show(500);
// });
// $(".onsale_img").mouseleave(function () {
// $(".onsale_content_overlay").hide(500);
// });
... |
# Delete the data from 'Orders' table
DELETE FROM Orders; |
#!/usr/bin/env bash
# ----------------------------------------------------------------------------
# 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 AS... |
#!/bin/bash
# Check if Nginx is installed
if ! command -v nginx &> /dev/null; then
echo "Nginx is not currently installed on Linux, begins installation."
# Install Nginx using yum package manager
sudo yum install -y nginx
# Create a user for Nginx without a home directory
sudo useradd --no-create-h... |
def find_smallest_greater_than(arr, target):
for num in arr:
if num > target:
return num
return None |
# This shell script executes the Slurm jobs for computing reconstructions.
sbatch tsp19_name=speech_sc=none_J=16_wav=gammatone.sbatch
sbatch tsp19_name=speech_sc=none_J=16_wav=morlet.sbatch
sbatch tsp19_name=speech_sc=time_J=16_wav=gammatone.sbatch
sbatch tsp19_name=speech_sc=time_J=16_wav=morlet.sbatch
sbatch tsp19_n... |
<filename>spec/fixtures/rulesets.rb
VALID_RULESET = <<-CODE
scoring_rules do |rule|
rule.add_points 10, :if => lambda {self.age >= 18}
rule.remove_points 5, :if => :can_remove?
rule.add_points 5, :unless => lambda {self.is_new_user?}
rule.add_points 1, :each => :followers
end
CODE
INVALID_RULESET_E... |
Tinytest.add("Title", function(test) {
var config = {
options: {
title: "Default Title",
suffix: "Suffix"
}
}
Meta.config(config);
Meta.setTitle("");
test.equal(Meta.getTitle(), config.options.title, "Is default title working ?");
Meta.setTitle("asd");
test.equal(Meta.getTitle(), "a... |
#!/bin/bash
#
# This script is used for building the muParser html page from
# html templates.
#
rm -rf ../*.html
#
# add navigation bar to all html templates starting with mup_*
#
for file in mup_*
do
echo processing $file
cat navigation.html | sed "/\$PLACEHOLDER/r $file" > ../$file
done
# c... |
/**
* Copyright (c) 2016-2019 人人开源 All rights reserved.
* <p>
* https://www.renren.io
* <p>
* 版权所有,侵权必究!
*/
package io.renren.modules.sys.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.my... |
#!/bin/bash
AUTO_TEST_PATH=`pwd`
IOS=0
ANDROID=0
#Prepare GTEST
AUTO_TEST_SRC_PATH="../../"
cd ${AUTO_TEST_SRC_PATH}
if [ ! -d "./gtest" ]
then
make gtest-bootstrap
fi
cd ${AUTO_TEST_PATH}
#To find whether have android devices
echo please set the enviroment variable as:
echo export ANDROID_HOME="path of android sdk... |
public class ObjectController
{
private void Start() {} // 0x00857BE0-0x00857BF0
private void Update() {} // 0x00857BF0-0x00857C00
public void ResetMoveInterpolateParam() {} // 0x00857E90-0x00857EA0
} |
# in the build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.appname"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
}
// add build types and product flavors here
buildTypes {
r... |
import { BreezeBorderRadius, BreezeRoundedSides } from "../components/types";
export const getRoundedTWClasses = (
roundedSides: BreezeRoundedSides[],
roundedRadius: BreezeBorderRadius = "xl"
) => {
const _classes: string[] = [];
const classes = roundedSides.map((rs, index) => {
if (roundedRadius === "none... |
use Illuminate\Database\Eloquent\Model;
class Company extends Model
{
protected $table = 'companies';
// Define the many-to-many relationship with the User model
public function users()
{
return $this->belongsToMany('App\User', 'users_companies', 'company_id', 'user_id');
}
// Impleme... |
#!/usr/bin/env bash
echo "/tmp/afile" |
<gh_stars>1-10
package builder
import (
"fmt"
"math/rand"
"os"
"path/filepath"
"strconv"
"time"
"io"
"io/ioutil"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/client"
"github.com/rikvdh/ci/lib/buildcfg"
"github.com/rikvdh/ci/lib/config"
"github.com/rikvdh/ci/models"
)
var runningJobs *jobCoun... |
<filename>node_modules/react-icons-kit/linea/ecommerce_megaphone.js
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ecommerce_megaphone = void 0;
var ecommerce_megaphone = {
"viewBox": "0 0 64 64",
"children": [{
"name": "polygon",
"attribs": {
"fill": "none",
... |
#!/bin/bash
set -e
APPDIR="$(dirname "$(readlink -e "$0")")"
export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${APPDIR}/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}"
export PATH="${APPDIR}/usr/bin:${PATH}"
export LDFLAGS="-L${APPDIR}/usr/lib/x86_64-linux-gnu -L${APPDIR}/usr/lib"
exec "${APPDIR}/usr/bin/py... |
import React from 'react';
interface IProps {
children: string;
}
export const StatsHeader = ({ children }: IProps): JSX.Element => {
return (
<h2 className="text-2xl sm:text-3xl font-bold tracking-tighter mb-4">
{children}
</h2>
);
};
|
function generateLandingPage($enlace, $pre_enlace, $enlace_url, $imagen_fondo, $video_fondo_mp4) {
$enlaceHtml = $enlace ? "<a href='$enlace_url'>$pre_enlace</a>" : "";
$backgroundStyle = "style='background-image: url($imagen_fondo);'";
$videoSource = "<source src='$video_fondo_mp4' type='video/mp4'>";
... |
<reponame>Winens/coffee_kernel<gh_stars>1-10
//
// Created by winens on 2/18/22.
//
#include <mm/heap.h>
#include <stdint.h>
#include <stddef.h>
#include <stdio.h>
struct _HEAP *_heap;
void HEAP_Exec(){
_heap->_block = 0;
}
void HEAP_Add_Block(struct _HEAP *heap, uintptr_t address, uint32_t size, uint32_t bsize... |
from .view_model import ViewModel
from flaskr.util import is_empty_string
class LoginForm(ViewModel):
def __init__(self, *, username, password, loginform_id):
super().__init__()
self.loginform_id = loginform_id
self.username = username
self.password = password
def validate(sel... |
#pragma once
#include <GL/GL.h>
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
struct ShaderInfo {
GLenum type;
const char* source;
GLuint shader;
};
enum LoadType {
LoadFromFile,
LoadFromString,
};
/**
* @brief load shader and return gl program
*
*/
GLuint LoadShaders(ShaderInfo* inf... |
import {
IBasicDataFeed,
} from 'shared/types/charting_library';
import { ICurrencyPair } from './markets';
import { Omit } from '../app';
export interface IChartItem {
ts: number;
open: number;
close: number;
high: number;
low: number;
volume: number;
}
export interface ITVChartCandle extends Omit<ICha... |
<reponame>ceumicrodata/respect-trade-similarity
import pandas as pd
from itertools import product
import glob
file_list = glob.glob('../temp/index/dirty/*')
for db in file_list:
data = pd.read_csv(db)
# cut those rows and columns which are not needed
data = data.iloc[:,:19].drop(index=[0,1]).reset_index(drop=True... |
<filename>e2e/commands_test.go
package e2e
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"testing"
"github.com/docker/app/internal"
"github.com/docker/app/internal/yaml"
"gotest.tools/assert"
is "gotest.tools/assert/cmp"
"gotest.tools/fs"
"gotest.tools/golden"
"gotest.tools/icmd"
"... |
import React from 'react';
import ReactDOM from 'react-dom';
import './style.less';
import './style2.css';
class Yjw extends React.Component{
componentDidMount() {
console.log('------yjw-------');
}
render() {
return (<div>
<div className='content'>Hello YJW.</div>
<div className="content2">... |
package org.dimdev.rift.mixin.hook.client;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.util.ResourceLocation;
import org.dimdev.rift.listener.client.TextureAdder;
import org.dimdev.riftloader.RiftLoader;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin... |
#!/usr/bin/env bash
# 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
# "Lice... |
import java.util.concurrent.ForkJoinPool;
public class Problem
{
public static void schedule(Runnable func, long delay)
{
long doNotRunBefore = System.currentTimeMillis() + delay;
ForkJoinPool.commonPool().execute(() -> {
do
{
try
{
Thread.sleep(doNotRunBefore - System.currentTimeMillis());
... |
#!/bin/bash
#SBATCH --account=def-dkulic
#SBATCH --cpus-per-task=2 #Maximum of CPU cores per GPU request: 6 on Cedar, 16 on Graham.
#SBATCH --mem=8000M # memory per node
#SBATCH --time=0-01:00 # time (DD-HH:MM)
#SBATCH --output=./draw_interest_area_ffmpge_job_script_output/Camera1_Sep_19_150... |
#!/bin/bash
##
## Copyright 2019 International Business Machines
##
## 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... |
var aboutTypeOf = assertAbout.createPlugin("url");
aboutTypeOf.defineAssertion("is", function(about, topic, type) {
about.string(topic)
.contains("http")
.greaterThan(6)
(function(resolve, reject) {
request(topic)
.then(function() {
about.number(duration)
... |
#!/bin/sh
set -e
set -u
set -o pipefail
function on_error {
echo "$(realpath -mq "${0}"):$1: error: Unexpected failure"
}
trap 'on_error $LINENO' ERR
if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
# If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
# resources to, so e... |
#!/bin/bash
echo ""
echo "Applying migration UseDifferentService"
echo "Adding routes to conf/app.routes"
echo "" >> ../conf/app.routes
echo "GET /:mrn/useDifferentService controllers.UseDifferentServiceController.onPageLoad(mrn: MovementReferenceNumber)" >> ../conf/app.routes
echo "Addi... |
class CloudStorageException extends \Exception
{
}
class CloudStorage
{
private const MAX_STORAGE_LIMIT = 100; // in MB
public function uploadFile($fileName, $fileSize)
{
if ($fileSize > self::MAX_STORAGE_LIMIT) {
throw new CloudStorageException("File size exceeds the maximum storage l... |
package mastermind.views.console;
import mastermind.controllers.Controller;
import mastermind.views.MessageView;
import santaTecla.utils.WithConsoleView;
class SecretCombinationView extends WithConsoleView {
private Controller controller;
SecretCombinationView(Controller controller) {
super();
this.controll... |
#!/usr/bin/env bash
koopa_uninstall_xorg_libxdmcp() {
koopa_uninstall_app \
--name='xorg-libxdmcp' \
"$@"
}
|
<gh_stars>0
// pages/webViewList/lookInformdetail/lookInformdetail.js
const api = require('../../../config/api.js');
Page({
/**
* 页面的初始数据
*/
data: {
url: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log('页面传入的' + JSON.stringify(options), 'lookInformdetail');
let... |
VERSION='master' #Repository version
REPO='clarkwinkelmann/flarum-ext-who-read' #Repository name
LOCALE='resources/locale' #Locale folder
YAML1='en.yml' #Original yaml file
YAML2='clarkwinkelmann-who-read.yml' #Translated yaml file
TEMP_DIR=`mktemp -d`
WORK_DIR=`pwd`
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m'
... |
#!/usr/bin/env bash
# Copyright 2016 The TensorFlow 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 the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
#include <chrono>
#include <iostream>
#include "clear_rendertarget.h"
int main(int argc, char *argv[])
{
try
{
cg::ClearRenderTarget *render = new cg::ClearRenderTarget(1920, 1080);
render->Clear();
render->Save("results/clear_rendertarget.png");
}
catch (std::exception &e)
... |
#!/usr/bin/env sh
# dev-scp
# minify-js.sh
# Minify JavaScript files.
# Required args:
# source: path to the file to minify.
# global variables
SOURCE=${1:-""}
OUTPUT=$(echo ${SOURCE%.*}).min.js
if [ -f ${SOURCE} ]; then
curl -s -d compilation_level=SIMPLE_OPTIMIZATIONS -d output_format=text -d output_inf... |
# -*- coding:utf-8 -*-
import os,sys
import math
sys.path.insert(0, '../util')
from caffe_extractor import CaffeExtractor
from distance import get_distance
import numpy as np
import argparse
LFW_PAIRS = None
LFW_IMG_DIR = None
def parse_line(line):
splits = line.split()
# skip line
if len(splits) < ... |
<reponame>wjimenez5271/migration-tools
package app
import (
"flag"
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/docker/libcompose/project"
"github.com/urfave/cli"
)
func TestProjectFactoryProjectNameIsNormalized(t *testing.T) {
projects := []struct {
name string
expected string
}{
{
n... |
#!/bin/sh
# Build Docker Image
docker build -t infogail -f Dockerfile .
|
#!/bin/bash
python prepare_data.py --task avopix --images-dir images/avopix_mirrored_1024/ --format jpg --ratio 1 --shards-num 32 --max-images 705328 |
<reponame>lotosbin/binbin-reader-electron<gh_stars>1-10
/**
* Created by liubinbin on 02/09/2016.
*/
export interface ICallback<TError, TResult>{
(error: TError, result: TResult) : void
}
|
-- ***************************************************************************
-- File: 13_26.sql
--
-- Developed By TUSC
--
-- Disclaimer: Neither Osborne/McGraw-Hill, TUSC, nor the author warrant
-- that this source code is error-free. If any errors are
-- found in this source code, please rep... |
<filename>src/main/java/io/github/rcarlosdasilva/weixin/model/notification/NotificationMeta.java<gh_stars>1-10
package io.github.rcarlosdasilva.weixin.model.notification;
import java.util.Date;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import io.github.rcarlosdasilva.weixin.common.dictionary.No... |
ads_db = {}
def load_data(data):
global ads_db
ads_db = data
def add_advertisement(ad_id, ad_details):
global ads_db
ads_db[ad_id] = ad_details
def get_advertisement(ad_id):
global ads_db
if ad_id in ads_db:
return ads_db[ad_id]
else:
return "Advertisement not found" |
#!/bin/sh
if [ -n "$DESTDIR" ] ; then
case $DESTDIR in
/*) # ok
;;
*)
/bin/echo "DESTDIR argument must be absolute... "
/bin/echo "otherwise python's distutils will bork things."
exit 1
esac
DESTDIR_ARG="--root=$DESTDIR"
fi
echo_and_run() { e... |
def replace_math_symbols(expression: str) -> str:
replacements = {
"→": "right",
"÷": "division",
"×": "multiplication",
"∑": "sum",
"λ": "lambda"
}
modified_expression = expression
for symbol, replacement in replacements.items():
modified_expression = mod... |
import * as React from 'react';
import { Route as RouteType, NotebookHandle as NotebookHandleType, Notebook as NotebookType } from "../../types";
import Home, { Props as HomeProps } from "../Home";
import Notebook, { Props as NotebookProps } from "../Notebook";
interface Props {
route: RouteType;
notebooks?... |
<html>
<head>
<script>
function submitForm() {
document.getElementById("myForm").submit();
}
</script>
</head>
<body>
<form id="myForm" action="">
<input type="text" name="field1" />
<input type="text" name="field2" />
<input type="butt... |
'''
Contains functions to help with logging.
'''
def get_fn_name(fn) -> str:
try:
return fn.__name__
except:
return 'None' |
from tempest.lib import decorators
from tempest import test
from tempest import config
import time
CONF = config.CONF
LOG = log.getLogger(__name__)
def log_test_execution_time(func):
def wrapper(*args, **kwargs):
start_time = time.time()
result = func(*args, **kwargs)
end_time = time.time... |
#!/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.
#
# Make sure all shell scripts:
# a.) explicitly opt out of locale dependence using "export LC_ALL=C", o... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.