text
stringlengths
1
1.05M
import { Injectable } from '@angular/core'; import {HttpClient, HttpHeaders} from '@angular/common/http'; import { Azureblob } from '../models/azureblob'; import {environment} from "../../environments/environment"; import {Observable} from 'rxjs/Observable'; @Injectable() export class AzureblobService { constructo...
items = [ {"name": "widget", "price": 10, "quantity": 5 }, {"name": "thingy", "price": 7, "quantity": 3 }, {"name": "doodad", "price": 5, "quantity": 2 }, ] taxRate = 0.095 shippingCost = 7.50 totalCost = 0 for item in items: totalCost += item['price'] * item['quantity'] totalCost += totalCost * taxRate totalCo...
/* * C compiler file mcdep.h * Copyright (C) Acorn Computers Ltd., 1988. * SPDX-Licence-Identifier: Apache-2.0 */ /* * RCS $Revision$ Codemist 4 * Checkin $Date$ * Revising $Author$ */ /* * (Interface for target-dependent part of local code generation). */ #ifndef _mcdep_h #define _mcdep_h 1 #ifndef _glob...
#!/bin/bash install_package htop
CREATE TABLE user_scores ( user_id INT UNSIGNED NOT NULL, score INT UNSIGNED NOT NULL, last_updated DATETIME NOT NULL, PRIMARY KEY (user_id) );
<filename>OSS13 Client/Sources/Graphics/UI/Widget/GameProcess/TileContextMenu.cpp<gh_stars>10-100 #include "TileContextMenu.h" #include <imgui.h> #include <Client.hpp> #include <Network/Connection.h> #include <Shared/Network/Protocol/ClientToServer/Commands.h> void TileContextMenu::Update(sf::Time /*timeElapsed*/) ...
import { __assign, __extends } from "tslib"; import { each } from '@antv/util'; import GridBase from './base'; var Line = /** @class */ (function (_super) { __extends(Line, _super); function Line() { return _super !== null && _super.apply(this, arguments) || this; } Line.prototype.getDefaultCfg ...
#!/bin/bash ###################################################################### function print_header { cat <<EOF This is `basename $0` part of the RegCM version 4 SVN Revision: `svnversion` : this run start at : `date '+%Y-%m-%d %H:%M:%S%z'` : it is submitted by : `whoami` : it is running ...
tf_model="https://modelzoo-train-atc.obs.cn-north-4.myhuaweicloud.com/003_Atc_Models/AE/ATC%20Model/human_segmentation/human_segmentation.pb" aipp_cfg="https://modelzoo-train-atc.obs.cn-north-4.myhuaweicloud.com/003_Atc_Models/AE/ATC%20Model/human_segmentation/insert_op.cfg" model_name="human_segmentation" presenter_s...
<reponame>qishabisi/javaScript<gh_stars>0 (function(window,undefined) { var $ = function(args) { return new Yin.prototype.init(args); }; var Yin = function(){}; Yin.prototype = { constructor: $, init: function(args) { this.elements = []; if (typeof args == 'string') { /...
find . -name "*.re" -type f -exec refmt --in-place {} \;
<reponame>MarcelBraghetto/AndroidNanoDegree2016<gh_stars>0 package com.lilarcor.popularmovies.framework.foundation.network.dagger; import android.content.Context; import android.support.annotation.NonNull; import com.lilarcor.popularmovies.framework.foundation.network.DefaultNetworkRequestProvider; import com.lilarco...
<gh_stars>1-10 package elasta.composer.state.handlers.impl; import elasta.composer.Events; import elasta.composer.Msg; import elasta.composer.state.handlers.GenerateIdStateHandler; import elasta.core.flow.Flow; import elasta.core.flow.StateTrigger; import elasta.core.promise.intfs.Promise; import elasta.orm.idgenerato...
#!/bin/sh echo Configuring Git for pushing to GH... git config user.email "4financebot@gmail.com" git config user.name "4Finance Bot" git config push.default simple git remote set-url origin "https://github.com/${TRAVIS_REPO_SLUG}.git" echo Git configured
SELECT product_id, SUM(quantity) as sales FROM Sales GROUP BY product_id;
import {ChallengeFromFile} from "./challenge"; import {ChallengeRegistry} from "./challenge_registry"; import {runIntcode} from "./intcode"; const STAR2_TARGET = 19690720; class ChallengeD02 extends ChallengeFromFile { private input: number[] | null = null; constructor() { super("d02"); } public async s...
<gh_stars>0 $.validator.addMethod("dateFA",function(t,a){return this.optional(a)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(t)},$.validator.messages.date); //# sourceMappingURL=dateFA.min.js.map
<filename>16PWMLedDriverOpenMRN/targets/bbb.linux.armv7a/Hardware.hxx #ifndef __HARDWARE_HXX #define __HARDWARE_HXX #include <os/LinuxGpio.hxx> #include <os/LinuxPWM.hxx> #include "utils/GpioInitializer.hxx" #define HARDWARE_IMPL "BBB 16 Channel PWM LED Driver" // On chip GPIO: #define OEPin GpioOutputSafeLow GPIO...
#!/bin/sh # # Wrapper for batch-crop.scm gimp-script. # # if no arguments are given, use alls png-files in the directory. if [ $# -lt 1 ] then ARGS='*.png' else ARGS="$*" fi echo Adjusting/Converting "${ARGS}" gimp -i --batch-interpreter='plug-in-script-fu-eval' -b "(batch-crop \"${ARGS}\")(gimp-quit 0)"
package io.github.marcelbraghetto.dailydeviations.framework.artworks.content; import android.support.annotation.Nullable; import android.text.TextUtils; import android.util.Log; import android.util.Xml; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.ByteArrayInputSt...
exit_code=0 if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then exit $exit_code; fi; # Deploy to the the content server if its a "develop" or "release/version" branch # The "develop_doc" branch is reserved to test full deploy process without impacting the real content. if [ "$TRAVIS_BRANCH" == "develop_doc" ]; then ...
public class FileFormatMatcher { public boolean applies(String filename) { if (filename.endsWith(".txt") || filename.endsWith(".csv") || filename.endsWith(".json")) { return true; } return false; } }
<gh_stars>0 export * from '@src/app/resources/events/events.resource'; export * from '@src/app/resources/events/events.model'; export * from '@src/app/resources/events/events-get.mapper';
# Install conda case "$(uname -s)" in 'Darwin') MINICONDA_FILENAME="Miniconda3-latest-MacOSX-x86_64.sh" ;; 'Linux') MINICONDA_FILENAME="Miniconda3-latest-Linux-x86_64.sh" ;; *) ;; esac wget https://repo.continuum.io/miniconda/$MINICONDA_FILENAME -O miniconda.sh bash minico...
#!/bin/bash if [[ `uname` == "Darwin" ]]; then THIS_SCRIPT=`python -c 'import os,sys; print os.path.realpath(sys.argv[1])' $0` else THIS_SCRIPT=`readlink -f $0` fi THIS_DIR="${THIS_SCRIPT%/*}" BASE_DIR=$(cd $THIS_DIR/.. && pwd) LIB_DIR="${BASE_DIR}/lib" NUM_SERVER_THREADS=4 CONF_DIR="${BASE_DIR}/conf"...
package main import ( "context" "encoding/json" "html/template" "log" "net/http" "os" "time" "github.com/Luzifer/go_helpers/github" "github.com/gorilla/mux" "github.com/gorilla/websocket" "github.com/nicksnyder/go-i18n/i18n" ) const ( // Time allowed to write a message to the peer. writeWait = 10 * time...
<filename>src/main/java/com/github/chen0040/leetcode/day06/easy/LengthOfLastWord.java<gh_stars>1-10 package com.github.chen0040.leetcode.day06.easy; /** * Created by xschen on 1/8/2017. * * link: https://leetcode.com/problems/length-of-last-word/description/ */ public class LengthOfLastWord { public class Solu...
//-------------------------------------------------------------------------------------- // File: DyanmicShaderLinkageFX11.cpp // // This sample shows a simple example of the Microsoft Direct3D's High-Level // Shader Language (HLSL) using Dynamic Shader Linkage in conjunction // with Effects 11. // // Copyright (c) Mi...
require 'sinatra' get '/validate_form' do erb :validate_form end post '/validate_form' do @name = params[:name] @email = params[:email] @phone = params[:phone] if @name == "" || @email == "" || @phone == "" @message = "All fields are required!" elsif !valid_email?(@email) @message = "Email must b...
const axios = require('axios'); const cheerio = require('cheerio'); const classmongo = require('./classmongo'); let dados = {}; async function scrap(url) { await console.time('#TempoScraping'); await classmongo.start() const { data } = await axios.get(url); const $ = cheerio.load(data); for (i = ...
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 盒子档口模型 * * @author auto create * @since 1.0, 2018-12-20 11:37:52 */ public class PosStallModel extends AlipayObject { private static final long serialVersionUID = 3413251639443...
#!/bin/sh which py > /dev/null 2>&1 if [[ $? == 0 ]]; then echo "Running in Windows" PYTHON='python' py -3 -m venv testenv3 source testenv3/Scripts/activate else echo "Running in Linux" PYTHON=python3 python3 -m venv testenv3 source testenv3/bin/activate fi ${PYTHON} -m pip install -r r...
// (c) <NAME> 'use strict'; describe('Requiem', function() { it('should have some tests soon', function() { }); });
<gh_stars>10-100 package cc.sfclub.transform.internal; import cc.sfclub.transform.Bot; import cc.sfclub.transform.ChatGroup; import cc.sfclub.transform.Contact; import java.util.Collections; import java.util.Optional; public class ConsoleBot extends Bot { private final VirtContact virtualContact = new VirtContac...
const CompressionWebpackPlugin = require('compression-webpack-plugin'); const MarkdownIt = require('markdown-it'); const md = new MarkdownIt(); module.exports = { configureWebpack: { module: { rules: [ { test: /\.md$/, loader: 'ware-loader', enforce: 'pre', o...
<gh_stars>0 /* Validator v3.0.3 (c) <NAME> https://github.com/yairEO/validator */ ;(function(root, factory) { if( typeof define === 'function' && define.amd ) define([], factory); else if( typeof exports === 'object' ) module.exports = factory(); else root.FormValidator ...
<filename>logback-demo/src/main/java/com/darian/logbackdemo/controller/BaseController.java package com.darian.logbackdemo.controller; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class BaseController { protected final Logger logger = LoggerFactory.getLogger(BaseController.class); }
<gh_stars>1-10 <?hh namespace Waffle\Tests\Container\Asset; class Bar { protected $something; public function setSomething($something) { $this->something = $something; } }
public class AdsAllocation { private static AdsAllocation instance = null; private static double mainLinePriceThreshold = 4.5; private AdsAllocation() { // Private constructor to prevent instantiation } public static AdsAllocation getInstance() { if (instance == null) { ...
<reponame>nabeelkhan/Oracle-DBA-Life REM FILE NAME: db_tgrnt.sql REM LOCATION: Security Administration\Reports REM FUNCTION: Report on database table or procedure grants given to a user REM TESTED ON: 7.3.3.5, 8.0.4.1, 8.1.5, 8.1.7, 9.0.1 REM PLATFORM: non-specific REM REQUIRES: dba_tab_privs, dba_objects REM...
#! /bin/bash IMAGE="lpbelliot/surfer_static" VERSION="latest" SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" docker build -t ${IMAGE}:${VERSION} $SCRIPT_PATH/../ docker push ${IMAGE}:${VERSION} kubectl rollout restart deployment \ lp-static-deployment \ cba-static-deployment \ -n surfer-stat...
#!/bin/bash NBARGS=$# if [ "$NBARGS" != "1" ]; then echo "usage: $0 <test_number>" exit 1 fi TEST_NUMBER=$1 touch /tmp/test_voxind ./run.sh $TEST_NUMBER & echo "type: pushd ../../build/rfs/usr/bin export LD_LIBRARY_PATH=../lib/x86_64-linux-gnu sudo gdb -p \$(pidof voxind) rm /tmp/test_voxind "
import React, { useState } from 'react'; const Counter = ({n}) => { const [count, setCount] = useState(0); const increment = () => { if (count < n) { setCount(count + 1); } }; return ( <div> <h3>Count: {count}</h3> <button onClick={increment}>Increment</button> </div> ); }; export default Counter;
//generate a set of random points let points = []; let numPoints = 10; for (let i=0; i<numPoints; i++) { points.push({ x: Math.random()*canvas.width, y: Math.random()*canvas.height }); } //draw the points on canvas let context = canvas.getContext('2d'); for (let i=0; i<points.length; i++) { context.fillRect(point...
<reponame>PedroArthurB99/orange-talents-08-template-transacao package br.com.orange.transacoes.transacao; import org.springframework.data.jpa.repository.JpaRepository; import java.util.List; import java.util.UUID; public interface TransacaoRepository extends JpaRepository<Transacao, UUID> { Boolean existsByNume...
starttime=`date +%s` video_list_txt='../AIC20_track1/Dataset_A/list_video_id.txt' video_id_list=() while read -r line || [[ -n "$line" ]]; do stringarray=($line) video=${stringarray[1]} video_name=${video%%.*} video_id_list+=(${video_name}) done < ${video_list_txt} tmp_fifofile="/tmp/$$.fifo" mkfifo $t...
package ua.kata; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import reactor.test.StepVerifier; class NestedJoinsTest { private NestedJoins...
sudo docker rm -f sim2real_client sudo docker run -id --gpus all --name sim2real_client --network host \ --cpus=5.6 -m 8192M \ --privileged -v /dev:/dev -e DISPLAY=$DISPLAY -e QT_X11_NO_MITSHM=1 \ -v /dev/bus/usb:/dev/bus/usb \ -v /dev/video0:/dev/video0 \ -v /dev/video1:/dev/video1 \ -v /de...
import React from "react" const SoftSkills = ({ style }) => { return ( <div style={style}> <h3>SOFT SKILLS</h3> <ul> <li>Public Speaking</li> <li>Independent</li> <li>Self Motivated</li> <li>Self Taught</li> <li>Technical Writing</li> <li>Expository Wri...
#!/usr/bin/env bash set -euo pipefail VERSION=$(cat azure-application-insights-archives/version) cp azure-application-insights-archives/applicationinsights-agent-*.jar repository/azure-application-insights-$VERSION.jar cp azure-application-insights-archives/version repository/version
<gh_stars>0 const secret = process.env.JWT_SECRET
# Required variables # - client_user # - client_pwd # - security_enabled # - monitoring_enabled # - BIND_TO_ALL # - ES_HOST # - CURL_AUTH function setup_grafana_dashboard() { GRAFANA_BASIC_AUTH="" if [ "$security_enabled" == "true" ]; then GRAFANA_BASIC_AUTH=" --user $client_user:$client_pwd " fi ...
<gh_stars>1-10 $(function () { //Form Wizard 2 var currentStep_2 = 1; $('.wizard-demo li a').click(function() { alert('You must enter your information') //return false; }); $('#formValidate2').parsley( { listeners: { onFormSubmit: function ( isFormValid, event ) { if(isFormVa...
def getMaxExpArray(max_precision): maxExpArray = [0] * (max_precision + 1) maxExpArray[0] = 0x386bfdba29 for i in range(1, max_precision + 1): maxExpArray[i] = 0x386bfdba29 + (0x38d1b71758 * i) return maxExpArray
''' File : rtdg.py Function : create a dictionary of faker functions Authors : Gouthaman,Aditya,kalaiyarasu ''' # import Faker from faker import Faker # initializing a pseudo-random number generator Faker.seed(20) fake = Faker() # dictionaries containing faker functions address = {'address': fake.address, 'city': ...
def solution(xk, equation): x, k = map(int, xk.split()) x_value = x ** k result = eval(equation.replace('x', str(x_value))) return result
function countWordOccurrences(inputString, targetWord) { // Convert the input string and target word to lowercase for case-insensitive comparison const lowerCaseInput = inputString.toLowerCase(); const lowerCaseTarget = targetWord.toLowerCase(); // Use a regular expression to find all whole word matche...
import java.util.ArrayList; import java.util.List; public abstract class TransList<U, T> { private List<T> list; public TransList(List<T> list) { this.list = list; } public abstract U trans(T v); public List<U> transform() { List<U> transformedList = new ArrayList<>(); fo...
<filename>src/modules/link/link.mapper.ts import {Link} from "./link.entity"; function mapActiveValue(isActive: number): string { switch (isActive) { case 1: return "ACTIVE" case -1: return "DEPRECATED" case -2: return "LOCKED" case -3: ...
<filename>extern/glow-extras/geometry/glow-extras/geometry/CoordFrame.cc #include "CoordFrame.hh" // empty
# frozen_string_literal: true require 'rails_helper' RSpec.describe OffersHelper, type: :helper do describe '#offer_logo_url' do context 'when offer has sponsor' do it "returns sponsor's logo URL in thumb version" do offer = FactoryBot.build(:offer, :with_sponsor) url = helper.offer_logo_u...
package de.judgeman.H2SpringFx.Tests.ServiceTests; import de.judgeman.H2SpringFx.HelperClasses.ViewRootAndControllerPair; import de.judgeman.H2SpringFx.Services.ViewService; import de.judgeman.H2SpringFx.Tests.HelperClasses.UITestFxApp; import de.judgeman.H2SpringFx.Tests.HelperClasses.UITestingService; import de.judg...
#!/bin/sh XSOCK=/tmp/.X11-unix XAUTH=/tmp/.docker.xauth touch $XAUTH xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge - docker run --privileged -it \ --volume=$XSOCK:$XSOCK:rw \ --volume=$XAUTH:$XAUTH:rw \ --volume=/dev:/dev:rw \ --volume=`pwd`/share:/home/je...
<filename>src/app/modules/game/services/hide-content.service.ts import {Injectable} from '@angular/core'; import {MatSidenav} from '@angular/material/sidenav'; @Injectable({ providedIn: 'root', }) export class HideContentService { private sidenavArray = []; public setSidenav(sidenav: MatSidenav, id: string): vo...
curl -X GET 'http://localhost:3000/'
<gh_stars>0 // // <%- packageName %> // // Copyright (C) <%- copyrightYear %> <%- copyrightHolder %> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // Licen...
// Copyright 2019 Grabtaxi Holdings PTE LTE (GRAB), All rights reserved. // Use of this source code is governed by an MIT-style license that can be found in the LICENSE file package async import ( "context" "errors" "fmt" "testing" "github.com/stretchr/testify/assert" ) func TestForkJoin(t *testing.T) { first...
<gh_stars>0 class SitesController < ApplicationController ## Sites Controller directs to the root page which does not require security. The only concern is that logged in users should not be able to logon again # before_action :is_authenticated? # before_filter :is_authenticated?, :except => :index def index ...
<reponame>caranzargar/platzi-store<gh_stars>0 import { NestFactory } from '@nestjs/core'; import { ValidationPipe } from '@nestjs/common'; import { AppModule } from './app.module'; async function bootstrap() { const app = await NestFactory.create(AppModule); app.useGlobalPipes( new ValidationPipe({ whitelist:...
class class_a { private: int width, high; public: class_a(int _w, int _h) : width(_w), high(_h) {} // Constructor to initialize width and high ~class_a() {} // Destructor to release any allocated resources void print_info(void) { // Member function to print width and high std::cout << "Width:...
<filename>src/core/index.js<gh_stars>0 /** * @namespace PIXI */ export * from './const'; export * from './math'; import * as utils from './utils'; import * as ticker from './ticker'; import settings from './settings'; import CanvasRenderer from './renderers/canvas/CanvasRenderer'; import WebGLRenderer from './render...
#!/bin/bash -e cdi=$1 cdi="${cdi##*/}" echo $cdi source ./hack/build/config.sh source ./cluster/gocli.sh CDI_NAMESPACE=${CDI_NAMESPACE:-cdi} # Set controller verbosity to 3 for functional tests. export VERBOSITY=3 registry_port=$($gocli ports registry | tr -d '\r') registry=localhost:$registry_port DOCKER_REPO=$...
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
def div_by_7_not_5(start, end): result = [] for num in range(start, end + 1): if (num % 7 == 0) and (num % 5 != 0): result.append(num) return result
python transformers/examples/language-modeling/run_language_modeling.py --model_name_or_path train-outputs/512+512+512-SS/model --tokenizer_name model-configs/1536-config --eval_data_file ../data/wikitext-103-raw/wiki.valid.raw --output_dir eval-outputs/512+512+512-SS/512+512+512-SS-1 --do_eval --per_device_eval_batch_...
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { User } from '../../users/schemas/user.schema'; import * as mongoose from 'mongoose'; import { Lift } from './lift.schema'; import { LiftRequest } from './liftRequest.schema'; export type LiftBookingDocument = L...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ic_iso_twotone = void 0; var ic_iso_twotone = { "viewBox": "0 0 24 24", "children": [{ "name": "path", "attribs": { "d": "M0 0h24v24H0V0z", "fill": "none" }, "children": [] }, { "name": "path", ...
<reponame>rickkas7/DeviceNameHelperRK var searchData= [ ['checkname_2',['checkName',['../class_device_name_helper.html#ab3066ecb65a743809fa6764b6a264f94',1,'DeviceNameHelper']]], ['checkperiod_3',['checkPeriod',['../class_device_name_helper.html#aadd144cff1fb56515f9a009d7bd37c30',1,'DeviceNameHelper']]], ['common...
import urllib.request import gzip import shutil import os # Define the URL for downloading the GeoLiteCountry database download_url = 'http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz' # Specify the local directory to save the downloaded and decompressed file local_directory = 'data/' #...
#!/bin/bash set -e # output some thing to stdout echo "Hello world!" input=f.b if [ ! -e $input ]; then echo "ERROR: input file $input does not exist" 1>&2 exit 1 fi # check that we got the input file cat $input # in the DAX, this job is specified to have an f.c output file echo "Hello world!" >f.c
const countCharacterOccurrences = (string) => { let strArr = string.split(''); let charMap = {}; for (let char of strArr) { charMap[char] = charMap[char] + 1 || 1; } return charMap; }
<gh_stars>0 package cn.wwl.radio.console.impl.gui; public interface TrayMessageCallback { int SINGLE_CLICK = 0; int DOUBLE_CLICK = 1; void clickMessage(int clickType); }
#!/bin/bash # # SPDX-License-Identifier: Apache-2.0 # set -o pipefail set -ev #### # Note: the tape integration suite is being deprecated in favour of cucumber. Please do not add files to this function #### runTape() { export HFC_LOGGING='{"debug":"test/temp/debug.log"}' # Run HSM tests by default E2E_S...
import React, { useState, useEffect } from 'react'; import Marketplace from './abis/Marketplace.json'; import Navbar from './components/Navbar'; import Main from './components/Main'; import './App.css'; import Web3 from 'web3'; function App() { const [account, setAccount] = useState(null); const [marketplace, s...
SELECT SUM(order_amount) FROM orders WHERE YEAR(order_date) = 2020;
<filename>src/main/java/com/lob/example/controller/MainController.java package com.lob.example.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.ann...
#!/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 ${FRAMEWORKS_FOLDER_PATH+x} ]; then # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy # frameworks to, so exit 0 (signalling the...
#include <stdio.h> //for read_cycle #include "riscv_counters.h" // for PRIu64 #include <inttypes.h> #include "data_gemv.h" #include "clarinet.h" int main (void) { #ifdef POSIT #ifdef PWIDTH_8 unsigned char acc [VSZ]; #endif #ifdef PWIDTH_16 unsigned short acc [VSZ]; #endif #ifdef PWIDTH_24 unsigned int acc [...
<reponame>alsuren/robokite<filename>KiteModel/tether.py import numpy as np x0 = 0 y0 = 0 z0 = 0 x1 = 100 y1 = 100 z1 = 100 dx = x1-x0 dy = y1-y0 dz = z1-z0 l = np.sqrt(dx**2 + dy**2+ dz**2) l0 = 150 epsilon = l/l0 E = 10 # Young modulus T=E*epsilon print T Fz = T*np.sin(atan2(z, np.sqrt(x**2+y**2)) Fy = T*np.sin(...
# enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # So...
'use strict'; var should = require('should'); var helper = require("../../../helper"); var DocumentInventoryManager = require("../../../../src/managers/inventory/document-inventory-manager"); var documentInventoryManager = null; var documentInventoryDataUtil = require("../../../data-util/inventory/document-inventory-da...
<reponame>pniekamp/datum-studio<filename>src/plugins/image/imgviewer.h // // Image Viewer // // // Copyright (C) 2016 <NAME> // #pragma once #include "documentapi.h" #include "imgview.h" #include "imgproperties.h" #include "qcslider.h" #include "qcdoubleslider.h" #include <QMainWindow> #include <QToolBar> //-------...
#!/bin/bash set -e deploy() { rm -rf build PKG_SVC_VER=9.0.1; PKG_SVC_REV=1; PKG_ABC_BIN_VER=1.0.0+1493729587; PKG_ABC_BIN_REV=1; PKG_ABC_LIB_VER=1.0.0+1493729098; PKG_ABC_LIB_REV=1; SVC_DEP=() SVC_DEP+=( "--pkg-depends=zmb2-abc-bin (= $PKG_ABC_BIN_VER-$PKG_ABC_BIN_REV)" ); SVC_DEP+=( "--pkg-de...
export default class BaseModule { constructor(el) { this.el = el; this.el.handler = this.el.handler || {}; console.log(el); } }
import PropTypes from 'prop-types'; import classNames from 'classnames'; import React, { Component, Fragment } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEllipsisH } from '@fortawesome/free-solid-svg-icons'; class UserOptions extends Component { constructor(props) { ...
#!/usr/bin/env bash if ! (command -v az >/dev/null); then echo "Unmet system dependency: az" >&2; exit 1; fi if ! (command -v python >/dev/null); then echo "Unmet system dependency: python" >&2; exit 1; fi usage() { echo "Usage: $0 -i <subscriptionId> -l <resourceGroupLocation> -o <outputFile>" >&2; exit 1; } declar...
import base64 text = "Hello World!" encoded_text = base64.b64encode(text.encode()).decode() print(encoded_text) Output: SGVsbG8gV29ybGQh
package com.app.wechat; import com.app.wechat.code.WxConstant; import com.app.wechat.core.DefaultWxClient; import com.app.wechat.core.WxClient; import com.app.wechat.domain.mass.WxMassPreviewModel; import com.app.wechat.domain.mass.WxMassSendModel; import com.app.wechat.domain.msg.WxTextMsgModel; import com.app.wechat...
def generate_column_query(db_type, table_name): if db_type == "POSTGRES": return f"""Select * from information_schema.columns where table_name = '{table_name}' order by ordinal_position""" elif db_type == "SQLITE": return f"""Select * from pragma_table_info('{table_name}') order by cid""" el...
<gh_stars>0 export type Nullable<T> = T | null; export type Voidable<T> = T | null | undefined; export interface IpcResponse<T> { data?: T; error?: any; } export interface ICommon { id?: number | string; // Primary key. Optional (autoincremented) updatedAt: number; } export interface IConfig extends ICommon ...