text stringlengths 1 1.05M |
|---|
#!/bin/bash
## Ask the user for input.
source ../scripts/verify_provisioning.sh
source ../../setup/userconf.sh || exit 1
get_password || exit 1
## Use the Edge Management API to get the API key.
printf "\n\nGet API key (the Consumer Key) from the Learn Edge App. Press Return to continue: \n"
read
key=`curl -u $u... |
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" --no-use # This loads nvm
# nvm bash completion is not compatible with zsh
#[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
<reponame>micronode/jot
package org.mnode.jot4j.dynamodb.mapper;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTypeConverter;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import net.fortuna.ical4j.model.component.VJournal;
import org.mno... |
#!/bin/bash
# Copyright (c) Nathan Lampi
#
# This code is licensed under the MIT License
# See the LICENSE file in the root directory
command -v jazzy >/dev/null 2>&1 || {
echo "jazzy is required (https://github.com/realm/jazzy)" >&2;
exit 1;
}
# Document via jazzy
jazzy \
-- clean \
-- author 'Natha... |
// No copyright - copy as you please
#pragma once
#include <Engine/UserDefinedEnum.h>
#include "EMonthNames.generated.h"
UENUM(BlueprintType) //"BlueprintType" is essential to include
enum class EMonthNames_Enum : uint8
{
January UMETA(DisplayName = "January"),
February UMETA(DisplayName = "February"),
Ma... |
window.Vue = require('vue');
import App from '../views/guest/App'
const app = new Vue({
el: '#root',
render : h => h(App)
}); |
package com.revature.service;
import com.revature.dao.ReimbursementDao;
import com.revature.dao.UserDao;
import com.revature.dto.ReimbursementDTO;
import com.revature.exception.ReimbursementNotFoundException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import java.io.IOException;
impor... |
package cyclops.reactive.subscription;
import cyclops.async.queue.Queue;
public interface Continueable {
void closeQueueIfFinished(Queue queue);
void addQueue(Queue queue);
void registerSkip(long skip);
void registerLimit(long limit);
void closeAll(Queue q);
boolean closed();
void c... |
<reponame>chlds/util<filename>lib/car/obj/src/unbind_pages.c<gh_stars>0
/* **** Notes
Unmap out of the RAM
Remarks:
Refer at fn. bind_pages.
//*/
# define CAR
# include "../../../incl/config.h"
signed(__cdecl unbind_pages(page_t(*argp))) {
auto page_t *page;
auto signed r;
auto signed short flag;
if(!argp) retur... |
// PROBLEM 1 - Two Sum
//Author: <NAME>
// https://leetcode.com/problems/two-sum/
// ============================================================================
// Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.
// You may assume that each input... |
python3 setup.py build_ext --inplace
#python ./app/api_v1/my_calculation_module_directory/CM/helper_functions/cyf/compile_cython_files.py build_ext --inplace
|
export default {
fuelSavings: {
newMpg: '',
tradeMpg: '',
newPpg: '',
tradePpg: '',
milesDriven: '',
milesDrivenTimeframe: 'week',
displayResults: false,
dateModified: null,
necessaryDataIsProvidedToCalculateSavings: false,
savings: {
monthly: 0,
annual: 0,
th... |
<gh_stars>1-10
!(function (window) {
function setFontSize () {
var d = dom.getBoundingClientRect().width
var e = (d / 7.5 > 100 * B ? 100 * B : (d / 7.5 < 42 ? 42 : d / 7.5))
dom.style.fontSize = e + "px"
window.rem = e
}
var timer,
document = window.document,
dom = document.documentElemen... |
#!/bin/bash
## Dockerfile for compilation environment : C/C++ and make
# Exit on any non-zero status.
trap 'exit' ERR
set -E
clean=${1:-n}
clean=${clean:0:1}
clean=${clean,,[N]}
echo "Uninstalling g++, gcc and co ..."
apt-get -qy update
apt-get purge -y \
gcc \
g++ \
libc6-dev \
autoconf \
automa... |
<gh_stars>1-10
/**
* Created by glenn on 16.10.19.
*/
'use strict';
const Generator = require('yeoman-generator');
const chalk = require('chalk');
const yosay = require('yosay');
const _ = require('lodash');
const fs = require('fs');
const path = require('path');
module.exports = class extends Generator {
constru... |
<gh_stars>0
package migrate
import (
"context"
"database/sql"
"errors"
"reflect"
"github.com/ovh/cds/engine/api/integration"
"github.com/go-gorp/gorp"
"github.com/ovh/cds/engine/api/secret"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/log"
)
// RefactorIntegrationModelCrypto .
func RefactorIntegrationM... |
#!/bin/bash
kinstall=$1
zk=$2
if [ -z $zk ]; then
echo "usage: $0 kafka-install-dir zookeeper-url"
exit 1
fi
topic_cmd="$kinstall/bin/kafka-topics.sh --zookeeper $zk --create --partitions 1 --replication-factor 1 --topic"
$topic_cmd kafkatesttopicbasic1
$topic_cmd kafkatesttopicbasic2
$topic_cmd kafkatestto... |
/* Entidade "User" */
const mongoose = require('mongoose'); // Importa o mongoose
// Define a estrutura da entidade (atributos do usuário)
const UserSchema = mongoose.Schema({
email: String,
});
// Exporta o modelo
module.exports = mongoose.model('User', UserSchema); |
# Imports
import pandas as pd
from sklearn.linear_model import LinearRegression
# Create a dataset
data = pd.DataFrame(features)
# Extract features
X = data[['size', 'location', 'facilities']]
# Extract target
y = data[['price']]
# Create the model
model = LinearRegression()
# Train the model
model.fit(X, y)
... |
<filename>Assignment1 2/Assignment1_2/HelloServlet.java
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.*;
import java.io.*;
import java.io.PrintWriter;
import java.util.Enumeration;
public class HelloServlet exten... |
<filename>horizon/static/horizon/js/horizon.autoupdate.js<gh_stars>0
/* Namespace for core functionality related to DataTables. */
horizon.autoupdate = {
update: function (div_id) {
var $chart_to_update = $('tr.'+div_id+'.ajax-update');
if ($chart_to_update.length) {
var interval = $chart_to_update.attr... |
import sqlite3
db = sqlite3.connect("employee_table.db") # Assumes the table is in a file named employee_table.db
cur = db.cursor()
# Execute the SQL command
cur.execute("SELECT * FROM employee_table WHERE salary < 10000")
# Commit your changes
db.commit()
# Get the results
results = cur.fetchall()
# Print the res... |
#!/bin/bash
BOUNCER_HOME=${BOUNCER_HOME:-/opt/bouncer}
BOUNCER_CONF=${BOUNCER_CONF:-bouncer.conf}
BOUNCER_MEM_MB=${BOUNCER_MEM_MB:-64}
BOUNCER_OPTS_DEF="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -showversion -XX:+PrintCommandLineFlags -XX:-PrintFlagsFinal"
BOUNCER_OPTS="${BOUNCER_OPT... |
<reponame>Mythius/Crossword
// ctx must be defined.
// Vector Must be defined {x:Number,y:Number}
(function(glob){
var Gamepad = {};
glob.Gamepad = Gamepad;
Gamepad.color1 = 'red';
Gamepad.color2 = 'white';
Gamepad.lineWidth = 5;
Gamepad.button = {};
Gamepad.joystick = {};
Gamepad.button.circle ... |
<reponame>ValentinGurkov/ng-posts
const http = require('http')
const app = require('./app')
const debug = require('debug')('angular-posts')
const normalizePort = val => {
let port = parseInt(val, 10)
if(isNaN(port)){
return val
}
if (port >= 0){
return port
}
return false
}
const onError = erro... |
<reponame>THK-ADV/lwm-ui
import {Injectable} from '@angular/core'
import {Observable} from 'rxjs'
import {AbstractCRUDService} from '../abstract-crud/abstract-crud.service'
import {Blacklist, BlacklistJSON, BlacklistProtocol} from '../models/blacklist.model'
import {HttpService, PartialResult} from './http.service'
imp... |
# Graph the position and velocity of an object in a simple harmonic motion
import math
import numpy as np
import matplotlib.pyplot as plt
# Calculate position
def position(t: float, v: float, y: float, w: float) -> float:
return (y * math.cos(w * t)) + ((v / w) * math.sin(w * t))
# Calculate velocity
def veloci... |
if [ -z "$ANDROID_NDK" ]; then
export ANDROID_NDK=~/android-ndk-r19c
fi
PLATFORM=mac
if [ "$1" == "linux" ]; then
PLATFORM=linux
fi
TOOL_CHAIN_PATH=$ANDROID_NDK/build
echo make armeabi-v7a ================================================
if [ "$PLATFORM" == "linux" ]; then
# linux
STRIP_PATH=$ANDROID_NDK/tool... |
mockgen -source=config/config.go -destination=./config/config_mock.go -package=config -self_package=github.com/DrmagicE/gmqtt/config
mockgen -source=persistence/queue/elem.go -destination=./persistence/queue/elem_mock.go -package=queue -self_package=github.com/DrmagicE/gmqtt/queue
mockgen -source=persistence/queue/queu... |
<filename>extra/TicTacToeClient.java
import java.io.*;
import java.net.*;
public class TicTacToeClient {
public static void main(String[] args) throws Exception {
String hostName = "localhost";
int portNumber = 4321;
Socket echoSocket = new Socket(hostName, portNumber);
echoSocket.... |
def calculateArea(width, height):
return width * height
length = 8
breadth = 10
area = calculateArea(length, breadth)
print("Area of the rectangle:", area) |
#!/bin/bash
#install zip on debian OS, since microsoft/dotnet container doesn't have zip by default
if [ -f /etc/debian_version ]
then
apt -qq update
apt -qq -y install zip
fi
#dotnet restore
dotnet tool install --global Amazon.Lambda.Tools --version 4.0.0
# (for CI) ensure that the newly-installed tools are on... |
package main
import (
"fmt"
"log"
"os/user"
)
func isRoot() bool {
// I haven't tested this on Windows, so it may not work
currentUser, err := user.Current()
if err != nil {
log.Fatalf("[isRoot] Unable to get current user: %s", err)
}
return currentUser.Username == "root"
}
func main() {
if !isRoot() {
... |
<gh_stars>1000+
//
// SwiftExample-Bridging-Header.h
// SwiftExample
//
// Created by <NAME> on 3/10/15.
// Copyright (c) 2014-2015 Xmartlabs. All rights reserved.
//
#ifndef SwiftExample_SwiftExample_Bridging_Header_h_h
#define SwiftExample_SwiftExample_Bridging_Header_h_h
#import <XLForm/XLForm.h>
#import <AXR... |
import java.io.BufferedReader;
import java.io.DataInput;
import java.io.DataOutput;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.FileSystem;
import java.util.*;
import org.apache.hadoop.filecache.DistributedCache;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.conf.*;
import o... |
package tamp.ch12.Combine.Combine;
/*
* Combine.java
*
* Created on October 29, 2005, 8:57 AM
*/
import java.util.Stack;
/**
* @author mph
*/
public class Tree {
final static int THREADS = 8;
final static int TRIES = 1024 * 1024;
static boolean[] test = new boolean[THREADS * TRIES];
Node[] leaf... |
package com.id.drapp;
import android.net.Uri;
import android.provider.BaseColumns;
public final class doctorContract {
public static final String CONTENT_AUTHORITY = "com.id.drapp";
public static Uri BASE_CONTENT_URI = Uri.parse("content://" + CONTENT_AUTHORITY);
public static String PATH_DOCTORS = "doct... |
<reponame>ostriandoni/the-attendances
const _ = require('lodash');
const currency = require('currency.js');
const moment = require('moment-timezone');
const validator = require('validator');
const User = require('../models/User');
const Attendance = require('../models/Attendance');
const AttendanceController = require(... |
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
<style>
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
#container {
max-width: 960px;
margin: 0 auto;
}
#left {
float: left;
width: 300px;
}
#right {
float: right;
width: 600px;
}
</style>
</head>
<body>
<div i... |
#!/bin/bash
## Copyright (c) 2021 mangalbhaskar. All Rights Reserved.
##__author__ = 'mangalbhaskar'
###----------------------------------------------------------
## pitivi - video editor
###----------------------------------------------------------
#
## References:
## * http://developer.pitivi.org/Install_with_flatpa... |
package fwcd.fructose.swing;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JButton;
public class DrawGraphicsButton extends JButton {
private static final long serialVersionUI... |
#include <iostream>
#include <string>
#include <regex>
int main() {
std::string input;
std::getline(std::cin, input);
std::regex starRegex(R"((\d+)-\d+)");
std::smatch starMatch;
if (std::regex_search(input, starMatch, starRegex)) {
int starCount = std::stoi(starMatch[1]);
std::cou... |
package ca.nova.gestion.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
public class Client {
private int idClient;
private String name;
private String phoneNumber;
@JsonCreator
public Client(int idClient, String name, String... |
import React from "react"
import PropTypes from "prop-types"
import { Markdown } from "../components/markdown"
export const Hero = ({ title, content }) => (
<section className="module pt-48 md:pt-64">
<div className="container flex flex-col md:flex-row md:space-x-8">
<div className="max-w-sm w-full">
... |
#!/bin/bash
set -e
sudo mkdir -p /nfssharedata
sudo mkdir -p /nfssharetest
sudo chown nobody:nogroup /nfssharedata
sudo chown nobody:nogroup /nfssharetest
sudo chmod 776 /nfssharedata
sudo chmod 776 /nfssharetest
sudo apt-get install nfs-kernel-server -y
sudo echo "/nfssharedata 192.168.56.0/255.255.255.0(rw,no_ro... |
/*jslint browser: true*/
/*global angular*/
var stsApp = angular.module('stsApp', [
'ngMaterial',
'ngRoute',
'ngAnimate',
'ngMessages',
'ngMdIcons',
'satellizer',
'angularjs-gravatardirective',
'angular-loading-bar',
'nvd3',
'angulartics',
'angulartics.google.analytics',
'stsProvider.search'... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.uFE4E5 = void 0;
var uFE4E5 = {
"viewBox": "0 0 2600 2760.837",
"children": [{
"name": "path",
"attribs": {
"d": "M2503 1767q3 9 4 17.5t1 18.5q0 27-16 57.5T2330.5 2013 2002 2202t-417 67q-147 0-310.5-22t-253.5-22q-1... |
class Inventory:
def __init__(self):
self.items = {}
def add_item(self, name, quantity):
self.items[name] = quantity
def update_quantity(self, name, quantity):
if name in self.items:
self.items[name] = quantity
def return_item(self, name):
return self.items... |
<gh_stars>0
import React from 'react';
import {
Button,
Table,
Modal
} from 'react-bootstrap';
import AddModal from 'components/Modals/AddUserModal';
import EditModal from 'components/Modals/EditUserModal';
import ViewModal from 'components/Modals/ViewUserModal';
import DeleteModal from 'components/Modals/DeleteU... |
def generate_user_cart_redis_key(user_id):
"""
Generates the name of the Hash used for storing User cart in Redis
"""
if user_id:
return self.__get_user_redis_key_prefix() + ":" + str(user_id)
else:
raise ValueError("User ID is required to generate the Redis key for user cart") |
package com.bumptech.glide.load.model;
import androidx.annotation.NonNull;
import com.bumptech.glide.Priority;
import com.bumptech.glide.load.DataSource;
import com.bumptech.glide.load.Options;
import com.bumptech.glide.load.data.DataFetcher;
import com.bumptech.glide.signature.ObjectKey;
/**
* A put of helper class... |
<reponame>mul53/bluzelle
# frozen_string_literal: true
require 'rest-client'
require 'json'
require 'bluzelle/utils'
require 'bluzelle/constants'
module Bluzelle
module Swarm
class Cosmos
include Bluzelle::Constants
include Bluzelle::Utils
attr_reader :mnemonic, :endpoint, :address, :chain_id... |
<filename>src/router/seckill.js
const seckill = () => import('@/pages/seckill/index.vue')
const seckillRouter = [
{
path:'/seckill',
component: seckill,
meta: {
title: '秒杀'
}
}
]
export default seckillRouter
|
def check_word_exists(word, string):
if word in string:
return True
else:
return False |
#!/usr/bin/env bash
#
# Copyright (c) 2018 The Readercoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Make sure only lowercase alphanumerics (a-z0-9), underscores (_),
# hyphens (-) and dots (.) are used in ... |
#!/bin/bash
# Runs benchmark and reports time to convergence
#pushd pytorch
# Single GPU training
time python ./tools/train_mlperf.py --config-file "configs/e2e_mask_rcnn_R_50_FPN_1x.yaml" \
SOLVER.IMS_PER_BATCH 2 TEST.IMS_PER_BATCH 1 SOLVER.MAX_ITER 720000 SOLVER.STEPS "(480000, 640000)" SOLVER.BASE_LR 0.002... |
#!/bin/bash
# View extension logs by running
# sudo cat /var/log/azure/Microsoft.OSTCExtensions.CustomScriptForLinux/1.5.2.2/extension.log
# (the version may be different)
user=`awk -F: '$3 >= 1000 {print $1, $6}' /etc/passwd | tail -n 1`
echo $user
username=${user% *}
homedir=${user#* }
basedir=$PWD
pushd $homedir... |
#!/bin/sh
for f in /docker-entrypoint.d/*.sh; do
echo "$0: running $f"; . "$f"
done
if [ "$1" = "init-loop" ];then
echo "Looping forever..." >&2
while :; do sleep 1; done
else
exec "$@"
fi
|
#pragma once
#include "Vector3.hpp"
#include "Vector4.hpp"
#include "AngleRadians.hpp"
#include <cstring>
#define XAxisX 0
#define XAxisY 4
#define XAxisZ 8
#define XAxisW 12
#define YAxisX 1
#define YAxisY 5
#define YAxisZ 9
#define YAxisW 13
#define ZAxisX 2
#define ZAxisY 6
#define ZAxisZ 10
#define ZAxisW 14
... |
function checkEvenNumber(arr) {
for (let i = 0; i < arr.length; i++) {
if (arr[i] % 2 === 0) return true;
}
return false;
} |
<gh_stars>1-10
/*
* Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright... |
package info.archinnov.achilles.type;
/**
* Define naming strategy for keyspace name, table name and column names.Available values are:
* <ul>
* <li>info.archinnov.achilles.type.NamingStrategy.SNAKE_CASE: transform all schema name using <a href="http://en.wikipedia.org/wiki/Snake_case" target="blank_">snake cas... |
#!/bin/bash
FILE=${1:-local}
WORK_DIR="$(dirname "$0")"
PROJECT_DIR="$(dirname "$WORK_DIR")"
pip --version >/dev/null 2>&1 || {
echo >&2 -e "\npip is required but it's not installed."
echo >&2 -e "You can install it by running the following command:\n"
echo >&2 "wget https://bootstrap.pypa.io/get-pip.py -... |
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var restify = require('express-restify-mongoose');
var timestamps = require('mongoose-timestamp');
var _ = require('underscore');
var moment = require('moment');
var wrapMPromise = require('./wrapMPromise');
var promisedHook = wrapMPromise.promisedHook;
... |
<reponame>chlds/util<gh_stars>0
/*
Press <Ctrl-]> to invoke the function.
Remarks:
Refer at util/lib/obj/src/cli_io_beta.c
*/
# define CBR
# define CLI_W32
# include <stdio.h>
# include "../../../incl/config.h"
signed(__cdecl cli_ctrl_rsb_beta(CLI_W32_STAT(*argp))) {
/* **** DATA, BSS and STACK */
auto signed cha... |
class Button:
def render(self, label, style):
html = f'<button style="width: {style["width"]}; background-color: {style["background"]}; border-radius: {style["borderRadius"]}">{label}</button>'
css = 'button {font-size: 16px; color: white; padding: 10px; border: none; cursor: pointer;}'
retu... |
#!/bin/bash
buah=('apel' 'mangga' 'anggur')
buah[3]="semangka"
buah[0]="pir"
echo "Nama Buahnya adalah : ${buah[@]}"
echo "Nama Buah Index 0 : ${buah[0]}"
echo "Panjang Array : ${#buah[@]}"
echo "Index Setiap Buah : ${!buah[@]}"
|
import http.server
import socketserver
class MyHTTPServer(http.server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
self.wfile.write(b"<html><body><h1>Hello, World!</h1></body></html>")
def do... |
<gh_stars>0
import React from 'react';
export default function Detail() {
return(
<>
<div className="blog-3 blog-details col" data-aos="fade-up">
<div className="info">
<h3 className="title">제목 테스트</h3>
<div className="desc" dangerouslySetInnerHTML={{__html: "value"}} />
... |
import tensorflow as tf
from tensorflow.keras.datasets import mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
# Pre-process the data
x_train = x_train.reshape(x_train.shape[0], 28, 28, 1)
x_test = x_test.reshape(x_test.shape[0], 28, 28, 1)
x_train = x_train.astype('float32')
x_test = x_test.astype('flo... |
<reponame>davidkarlsen/Hystrix<filename>hystrix-contrib/hystrix-javanica/src/test/java/com/netflix/hystrix/contrib/javanica/test/common/command/BasicCommandTest.java<gh_stars>0
package com.netflix.hystrix.contrib.javanica.test.common.command;
import com.netflix.hystrix.HystrixEventType;
import com.netflix.hystrix.Hys... |
public extension Scanner {
convenience init(forParsing string: String) {
self.init(string: string)
locale = nil
}
func parseIntegers() -> [Int] {
var integers: [Int] = []
while !isAtEnd {
var value: Int = 0
if scanInt(&value) {
... |
def reduce_array(arr):
result = arr[0]
for i in range(1, len(arr)):
result = result^arr[i]
return result
arr = [3, 5, 6, 2]
result = reduce_array(arr)
print("The result of the reducing array is:", result) |
export PROMPT_COMMAND=
PS1='$ '
|
class Car:
'''
* Creating a class called "Car"
* Properties/attributes: brand, colour, horses, country production, current speed
* "current_speed" is set to 0, unless other value is assigned
* Method definitions:
* def move_car() moves the car by 10
* def accelerate_car() accelerates the car by ... |
<filename>web-steps/led-config/src/app/domain/Model.ts
import {ModelDimension} from "./ModelDimension";
import {RelationDefinition} from "./relations/RelationDefinition";
import {ModelTranslation} from "./ModelTranslation";
import {serialize, deserialize, deserializeAs, serializeAs} from "cerialize";
import {ModelMargi... |
<filename>CFCoverFlowViewDemo/CFViewController.h<gh_stars>0
//
// CFViewController.h
// CFCoverFlowViewDemo
//
// Created by c0ming on 14-5-30.
// Copyright (c) 2014年 c0ming. All rights reserved.
//
#import <UIKit/UIKit.h>
@class CFCoverFlowView;
@interface CFViewController : UIViewController
@property (weak, n... |
<filename>src/utils.js<gh_stars>0
const objToText = (t, obj) => {
for(const k in obj) {
if (k !== 'rect'&& k !== '$' && k !== 'desc' && k !== 'text') {
const v = obj[k]
if (Array.isArray(v)) {
v.forEach((j) => {
// determine if array of objects
if (typeof(j) === 'object') ... |
import random
import string
def generate_password(length):
"""Generate a random password with the given length"""
password = ""
for _ in range(length):
password+= random.choice(string.ascii_letters + string.digits)
return password
# Generate password
print(generate_password(password_length)) |
#!/bin/bash
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with ce... |
import doodle.core._
import doodle.image._
import doodle.image.syntax._
import doodle.image.syntax.core._
import doodle.java2d._
object EvilEye extends App {
val r = 21
val stroke = 5
Image.circle(r * 2).fillColor(Color.black) on
Image.circle(4 * r).fillColor(Color.cornflowerBlue) on
Image.circle(6 * r).... |
import matplotlib.pyplot as plt
name = ['A', 'B', 'C']
values = [20, 40, 30]
plt.bar(name, values)
plt.xlabel('Name')
plt.ylabel('Values')
plt.title('Bar Chart')
plt.show() |
// Copyright 2019 Drone IO, 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.0
//
// Unless required by applicable law or agreed to... |
#!/bin/sh
export NODE_ENV=`/opt/secret2env -name $SECRETNAME|grep -w NODE_ENV|sed 's/NODE_ENV=//g'`
export L1_NODE_WEB3_WS=`/opt/secret2env -name $SECRETNAME|grep -w L1_NODE_WEB3_WS|sed 's/L1_NODE_WEB3_WS=//g'`
export L1_LIQUIDITY_POOL_ADDRESS=`/opt/secret2env -name $SECRETNAME|grep -w L1_LIQUIDITY_POOL_ADDRESS|sed 's/... |
<filename>src/main/java/com/movella/service/UsuarioService.java
package com.movella.service;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.movella.dao.UsuarioDAO;
import com.movella.exceptions.InvalidDataException;
import com.movella.model.Usuario;... |
<reponame>leomillon/try-jcv
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* 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 requir... |
class OperatingSystemUtility:
def __init__(self):
self.file_system_info = {
'total_size': '100GB',
'used_space': '60GB',
'available_space': '40GB'
}
self.os_info = {
'name': 'MyOS',
'version': '1.0'
}
self.theme_opti... |
function getParentCategoryName(array $categories, string $categoryName): string {
foreach ($categories as $category) {
if ($category['name'] === $categoryName) {
if ($category['parent_id'] === 0) {
return "No parent category";
} else {
foreach ($catego... |
<reponame>madhusha2020/inventory-frontend-ngx
import {Component, OnInit} from '@angular/core';
import {Delivery, DeliveryControllerService} from '../../../service/rest';
import {LocalDataSource} from 'ng2-smart-table';
import {NbSearchService} from '@nebular/theme';
import {Router} from '@angular/router';
import {Servi... |
#!/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
# "L... |
import numpy as np
import yaml, caffe
from other import clip_boxes
from anchor import AnchorText
class ProposalLayer(caffe.Layer):
def setup(self, bottom, top):
# parse the layer parameter string, which must be valid YAML
#layer_params = yaml.load(self.param_str_)
layer_params = yaml.load(self.pa... |
#!/bin/bash
#SBATCH --nodes 1 --ntasks 32 --time 2:00:00 -p short --mem 64G --out logs/mosdepth.parallel.log
#SBATCH -J modepth
CPU=$SLURM_CPUS_ON_NODE
if [ ! $CPU ]; then
CPU=2
fi
if [ -f config.txt ]; then
source config.txt
fi
GENOME=$GENOMEFOLDER/$GENOMEFASTA
module unload python/2.7.5
mkdir -p coverage/mosdepth
e... |
<gh_stars>1-10
import torch
import torchvision.transforms as T
import torchvision.transforms.functional as F
class ValidateModelInput(torch.nn.Module):
# Pass-through transform that checks the shape and dtypes to make sure the model gets what it expects
def forward(self, img1, img2, flow, valid_flow_mask):
... |
import torch
from torch import nn
import torch.nn.functional as F
class LabelSetEncoder(nn.Module):
def __init__(self, number_labels):
super(LabelSetEncoder, self).__init__()
self.number_labels = number_labels
self.fc1 = nn.Linear(self.number_labels, 128)
self.fc2 = nn.Linear(128,... |
<gh_stars>0
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"github.com/gedex/inflector"
"io/ioutil"
"net/http"
"os"
"github.com/dragonfruit-api/dragonfruit"
"github.com/dragonfruit-api/dragonfruit/backends/backend_couchdb"
"github.com/go-martini/martini"
"github.com/martini-contrib/gzip"
"gi... |
#include <iostream>
#include <vector>
#include <string>
// Include the necessary header file for NFC functionality
#include "services/device/public/mojom/nfc.mojom-blink.h"
class NFCManager {
public:
std::string readTag(const std::string& tagID) {
// Simulate reading data from an NFC tag with the given ID... |
.loading {
width: 100px;
height: 100px;
border-radius: 50%;
background-color: #ccc;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
100% {
transform: rotate(360deg);
}
} |
package com.github.peacetrue.beans.properties.code;
/**
* @author peace
* @since 1.0
**/
public interface CodeCapable {
String PROPERTY_CODE = "code";
String getCode();
}
|
package wrappers.core;
public abstract class IntegerWrapper extends GenericWrapper<Integer> {
private static final long serialVersionUID = 5637528646462716743L;
protected IntegerWrapper(Integer value) {
super(value);
}
}
|
class Item:
def __init__(self, name, price):
self.name = name
self.price = price
class ShoppingCart:
def __init__(self):
self.cart = []
def add_item(self, item):
self.cart.append(item)
def view_cart(self):
if not self.cart:
print("Your cart is empty... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.