text stringlengths 27 775k |
|---|
SpringApplication.getOrCreateEnvironment
创建 environment
AbstractApplicationContext.prepareBeanFactory
注册environment bean
idea配置java系统属性 ——> VM Options ——> -Duser.city.name=中文 。属性前面加上-D
javax.validation.constraints.NotEmpty.message
搜索属性的值 Ctrl+Shift+F ——> Scope ——> Project and Libraries
扩展Environment最好放在SpringA... |
module View where
import Data.Proxy (Proxy(..))
import qualified Miso
import Miso.Html
import Miso.String (ms)
import Routes (Route)
import qualified Routes
import Servant.API ((:<|>)(..))
import Types
viewApp :: App -> Miso.View Msg
viewApp appModel =
case appModel of
Initializing _initModel -> div_ [] [text "... |
namespace Predavac_URIS.Models
{
public class KorisnikInfoVO
{
public string Username { get; set; }
public string Email { get; set; }
public string Ime { get; set; }
public string Prezime { get; set; }
}
} |
import { OPEN_PROJECT,
NEW_PROJECT,
DEFAULT_PAGE,
COMPILE_PROJECT, LOGIN_PAGE} from "./type/open"
export function openProjectPage(val) {
return {
type: OPEN_PROJECT,
payload: {
open: val,
whatPage: "open"
}
}
}
export function openNewProjectPage(va... |
#!/usr/bin/env bash
# ----------------------------------------------------------------------------
#
# Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
#
# WSO2 Inc. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in complianc... |
# frozen_string_literal: true
RgGen.define_simple_feature(:register_block, :vhdl_top) do
vhdl do
build do
input :clock, { name: 'i_clk' }
input :reset, { name: 'i_rst_n' }
signal :register_valid
signal :register_access, {
width: 2
}
signal :register_address, {
... |
#! /usr/bin/perl -w
use strict;
use CGI;
use JSON::XS;
use HTML::Template;
use Data::Dumper;
use File::Path;
use CoGe::Accessory::Web;
use CoGeX;
no warnings 'redefine';
use vars qw($P $PAGE_NAME $PAGE_TITLE $USER $coge %FUNCTION $FORM $LINK);
$PAGE_TITLE = 'Sources';
$PAGE_NAME = "$PAGE_TITLE.pl";
$FORM = new CG... |
namespace Quantic.Web
{
public class HeaderMissingException : System.Exception
{
public HeaderMissingException(string message)
: base(message)
{
}
}
} |
# Learning Git and Version Control
This repo is mainly for my learning of Git & GitHub
## Pure files without Git Initialized
1. Git Initialize
```
$ git init
```
2. Add files
  a. To add all the files under the folder
```
$ git add .
```
  b. To add a... |
#include "../src/imagecalendar.h"
#include "imagecalendarplugin.h"
#include <QtPlugin>
ImageCalendarPlugin::ImageCalendarPlugin(QObject *parent)
: QObject(parent)
{
m_initialized = false;
}
void ImageCalendarPlugin::initialize(QDesignerFormEditorInterface * /* core */)
{
if (m_initialized)
retur... |
cask 'webkit-build-archive' do
version :latest
sha256 :no_check
url do
require 'open-uri'
base_url = 'https://webkit.org/build-archives/'
macos_release = if MacOS.version == :sierra
%r{href="([^"]+mac\-sierra[^"]+.zip)"}
else
%r{href="([... |
using FluentValidation.TestHelper;
using NUnit.Framework;
using System;
using ygo.application.Commands.AddBanlist;
using ygo.tests.core;
namespace ygo.application.unit.tests.ValidatorsTests.Commands
{
[TestFixture]
[Category(TestType.Unit)]
public class AddBanlistCommandValidatorTests
{
privat... |
import {Injectable} from '@angular/core';
import {Subject} from "rxjs/Subject";
import {Observable} from "rxjs/Observable";
@Injectable()
export class NotificationServiceProvider {
private notification = new Subject<any>();
sendNotification(body: any) {
this.notification.next(body);
}
getNotification():... |
package com.twu.biblioteca.utils;
public class StringUtils {
private static final String DOTS = "...";
private static final String SPACE = " ";
public static String smooth(String str, int controlLength) {
if (str.length() > controlLength) {
return str.substring(0, controlLength - 3).... |
package controllers
import javax.inject.Inject
import com.mohiva.play.silhouette.api.{Environment, Silhouette}
import com.mohiva.play.silhouette.impl.authenticators.SessionAuthenticator
import controllers.headers.ProvidesHeader
import formats.json.LabelFormats._
import models.label._
import models.user.User
import pl... |
package main
import (
"strings"
"testing"
)
func checkSolve(file string, expected []string, unexpected []string, cacheUpdate bool, t *testing.T) {
candidates := loadCandidates(cacheUpdate)
r, err := solveImports(candidates, file)
if err != nil {
t.Fatal(err)
}
for _, exp := range expected {
if !strings.Con... |
using System.Diagnostics;
/// <summary>
/// Gets and sets the product and the quantity of that product and displays the result in the cart.
/// </summary>
/// <author>Kathryn Browning</author>
/// <version>January 17, 2015</version>
public class CartItem
{
private Product _product;
private int _quantity;
... |
package partyrobot
// Welcome greets a person by name.
func Welcome(name string) string {
panic("Please implement the Welcome function")
}
// HappyBirthday wishes happy birthday to the birthday person and stands out his age.
func HappyBirthday(name string, age int) string {
panic("Please implement the HappyBirthday... |
package bot.features.poll.model.results
import bot.features.poll.model.Poll
sealed class PollCreationResult {
object NotEnoughOptions : PollCreationResult()
object TooManyOptions : PollCreationResult()
object InvalidMaxAnswers : PollCreationResult()
data class PollCreated(val poll: Poll) : PollCreatio... |
package com.eudycontreras.calendarheatmaplibrary.common
import com.eudycontreras.calendarheatmaplibrary.DrawTarget
import com.eudycontreras.calendarheatmaplibrary.properties.RenderData
/**
* Copyright (C) 2020 Project X
*
* @Project ProjectX
* @author Eudy Contreras.
* @since April 2020
*/
interface DrawOverlay... |
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const apiMetrics = require('prometheus-api-metrics');
app.use(apiMetrics())
app.use(bodyParser.json()); // for parsing application/json
app.post('/', (req, res) => {
if (!req.body) return res.sendStatus(400);
... |
#ifndef REFLECT_HPP
#define REFLECT_HPP
#include "meta_utils/meta_utils.hpp"
#include "reflect_information/reflect_information.hpp"
#include "reflect_utils/reflect_utils.hpp"
/**
* @brief Reflection namespace
* @todo add old examples
* @todo serialization examples (console, json)
* @todo performance benchmarks
*... |
import React, { useEffect, useRef, useState } from "react";
import { BootstrapTable, TableHeaderColumn } from "react-bootstrap-table";
import { Button } from "react-bootstrap";
import { Link } from "react-router-dom";
const MyList = ({
items,
children,
onDelete,
onSelect,
pagination,
createLink,
page,
... |
package com.kotlinbyte.infrastructure.datasource.remote.networking
import com.kotlinbyte.domain.vobject.AuthResult
import com.kotlinbyte.infrastructure.datasource.local.UserCredentialsLocalDataSource
import io.mockk.*
import junit.framework.Assert.assertEquals
import okhttp3.Interceptor
import okhttp3.Protocol
import ... |
package io.eels.component.csv
import java.io.{BufferedInputStream, ByteArrayInputStream, File, InputStream}
import java.nio.file.{Files, StandardOpenOption}
import com.sksamuel.exts.io.Using
import com.typesafe.config.{Config, ConfigFactory}
import io.eels._
import io.eels.datastream.Publisher
import io.eels.schema.S... |
/**
* Class decorator factory for describing an API.
*
* ```ts
* @api({ name: "Company API" })
* class CompanyApi {}
* ```
*
* @param config configuration
*/
export function api(config: ApiConfig) {
return (target: any) => {};
}
export interface ApiConfig {
/** Name of the API. This should be the name of ... |
package services
import concurrent._
import concurrent.duration._
import akka.actor.{ActorRef, Props}
import akka.util.Timeout
import akka.pattern.ask
import play.api.libs.concurrent.Akka
import play.api.libs.concurrent.Execution.Implicits._
import play.api.Play.current
import services.actors._
import models._
/*... |
import unittest
class Solution:
"""
This solution iterates over the string from the left to the right and constructs
a dictionary where each key is an index to the string and the value indicates
how many zeroes and ones are present to the left of the index. Once the dictionary
has been constructed... |
# Curso-Práctico de Javascript
...
## Taller #1: Figuras geométricas
-Primer paso: definir las formas geométricas
-Segundo paso: Implementar las formulas en JS
-Tercer paso: Crear funciones
-Cuarto paso: Integrar JS con HTML
-Quinto paso: Encontrar el perimetro y área de cada figura geometrica
## Taller #2: Descue... |
=begin
This file is part of the Arachni-RPC project and may be subject to
redistribution and commercial restrictions. Please see the Arachni-RPC
web site for more information on licensing and terms of use.
=end
module Toq
# Represents an RPC message, serves as the basis for {Request} and {Response}.
#
#... |
use chrono::{DateTime, Utc};
use futures::{Stream, StreamExt};
use std::{
fmt::{self, Display, Formatter},
str::FromStr,
task::Poll,
time::Duration,
};
#[derive(Clone, Copy)]
pub enum Color {
Black,
Red,
Green,
Yellow,
Blue,
Purple,
Cyan,
White,
Fixed(u8),
}
impl Di... |
<?php
namespace Opportus\Orm;
/**
* The model factory...
*
* @version 0.0.1
* @package Opportus\Orm
* @author Clément Cazaud <opportus@gmail.com>
*/
class Factory
{
/**
* @var array $modelProperties
*/
protected $modelProperties;
/**
* @var array $modelPropertyValidationCallbacks
*/
protected $mod... |
# frozen_string_literal: true
module Dmpopidor
module Models
module Plan
include DynamicFormHelper
# CHANGES : ADDED RESEARCH OUTPUT SUPPORT
# The most recent answer to the given question id optionally can create an answer if
# none exists.
#
# qid - The id f... |
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE FlexibleContexts #-}
module Reflex.Material.Menu
( mdSimpleMenu
, mdMenuItem
, mdMenuDivider
) where
import Data.Monoid ((<>), mempty)
import Data.Map (Map)
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Map as M
import Reflex.Dom
imp... |
-- PHP-Auth (https://github.com/delight-im/PHP-Auth)
-- Copyright (c) delight.im (https://www.delight.im/)
-- Licensed under the MIT License (https://opensource.org/licenses/MIT)
PRAGMA foreign_keys = OFF;
-- BUILD USER TABLE
-- -----------------------------------
CREATE TABLE IF NOT EXISTS "users" (
"id" INTEG... |
-- PREGUNTA 1
CREATE TABLESPACE TBS_AUTO
DATAFILE 'C:\TEMP\DF_VEHICULO_AUTO.DBF'
SIZE 100M;
CREATE TABLESPACE TBS_CAMIONETA
DATAFILE 'C:\TEMP\DF_VEHICULO_CAMIONETA.DBF'
SIZE 100M;
CREATE TABLESPACE TBS_BUS
DATAFILE 'C:\TEMP\DF_VEHICULO_BUS.DBF'
SIZE 100M;
CREATE TABLESPACE TBS_CAMI... |
import pygame
import sys; sys.path.insert(0, "..")
import tools_for_pygame as pgt
pygame.init()
__test_name__ = "gui.GUIElement.position_mode"
screen = pygame.display.set_mode((800, 600), pygame.RESIZABLE)
pygame.display.set_caption(__test_name__)
clock = pygame.time.Clock()
fps = pgt.gui.Label(pos=0, font="consolas",... |
// Подключение заголовочных файлов
// из стандартной библиотеки:
#include <iostream> // ввод/вывод.
#include <windows.h> // нужно для функций SetConsoleOutputCP и SetConsoleCP.
// Переход на кириллицу:
void cyrillic() {
// Эти строки нужны для правильного отображения кириллицы:
SetConsoleOutputCP(1251);
... |
declare module 'autosize-input' {
interface Options {
miWidth: number;
}
export default function(el: HTMLElement, options?: Options): () => void;
}
|
/*
* Copyright (C) 2018 by Author: Aroudj, Samir
* TU Darmstadt - Graphics, Capture and Massively Parallel Computing
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the License.txt file for details.
*/
#ifndef _SCENE_TREE_NODES_H_
#defin... |
> **NOTE**: This example system can be used to make a minimal system that can
> be built using cross-compilation, to validate that the device goes to stage-2.
## Building
```
$ cd .../mobile-nixos
$ nix-build examples/hello --argstr device DEVICE-NAME -A build.default
```
## Installing
Follow the installation ins... |
package com.yc.jpaplus.example.dto.like_in;
import com.yc.jpaplus.core.base.annoation.Condition;
import com.yc.jpaplus.core.base.annoation.enums.LikeInLogic;
import com.yc.jpaplus.core.base.annoation.enums.Operator;
import com.yc.jpaplus.core.base.dto.JpaPlusDto;
import lombok.Data;
import java.util.List;
@Data
publ... |
---
layout: slide
title: "Welcome to our second slide!"
---
Here is a simple example of EF Core DBContext:
```csharp
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
namespace Intro
{
public class BloggingContext : DbContext
{
public DbSet<Blog> Blogs { get; set; }
public... |
INSERT INTO burgers (name)
VALUES
("hamburger", false),
("cheeseburger", false),
("bacon burger", false); |
use super::{Upsert, Number, Integer};
use super::{Bson, Array, Object};
use std::borrow::Cow;
/* TODO: Add easy API for dot notation */
/* TODO: Make every large argument be a CoWs (take Vec or &Vec) */
#[derive(Clone)]
pub struct Update<'a>(Object<'a>);
impl<'a> Update<'a> {
pub fn new() -> Self {
Updat... |
package tuktu.web.processors
import play.api.cache.Cache
import play.api.libs.iteratee.Enumeratee
import play.api.libs.json._
import play.api.libs.ws.WS
import play.api.Play.current
import scala.concurrent.Await
import scala.concurrent.duration.DurationInt
import scala.concurrent.ExecutionContext.Implicits.global
... |
package com.mikelau.zenith.dialogs
import android.content.Context
import android.os.Build
import androidx.annotation.StringRes
import com.mikelau.zenith.R
/** Ready to use progress dialog with custom implementation. Uniformed way of making a progress dialog **/
object ProgressDialogHelper {
private var progressD... |
/*
* Copyright 2020 Robin Mercier
*
* 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... |
error() {
printf "%s\n" "$1" >&2
exit 1
}
run_wrapped_binary() {
# search for the wrapped binary in $PATH
#
# ignore paths before our own for compatibility with other wrappers
unwrapped=false
self=false
IFS=: read -ra path <<< "$PATH";
for p in "${path[@]}"; do
binary="$p/${0##*/}"
if $self &... |
$(function(){
$("#pie").dxPieChart({
palette: paletteCollection[0],
dataSource: dataSource,
series: {},
legend: {
visible: false
},
onDrawn: function(e) {
var paletteName = e.component.option("palette"),
palette = DevExpress.vi... |
module ExtEff.Bench
( countDownBench
, countDownExcBench
, httpBench
) where
import ExtEff.Stateful
import ExtEff.StatefulExcept
import ExtEff.HTTP
import Control.Eff.State.Strict
import Control.Eff.Exception
import Control.Eff
countDownBench :: Int -> (Int, Int)
countDownBench start = run . runState start $ ... |
#!/bin/bash
current=0
threshold=$1
function kill_program()
{
pid=`ps ax|grep $1|grep -v grep|awk '{print $1}'`
echo "pid is ${pid}"
while [ -n "${pid}" ];
do
kill -TERM $pid
sleep 1
pid=`ps ax|grep $1|grep -v grep|awk '{print $1}'`
echo "pid is ${pid}"
done
}
wh... |
#ifndef GraphicsContextCullSaver_h
#define GraphicsContextCullSaver_h
#include "platform/graphics/GraphicsContext.h"
namespace blink {
class FloatRect;
class GraphicsContextCullSaver {
WTF_MAKE_FAST_ALLOCATED;
public:
GraphicsContextCullSaver(GraphicsContext& context)
: m_context(context)
, ... |
--#!sqlite
--#{info_book
--#{info_book.init
CREATE TABLE IF NOT EXISTS player(
);
--#}
--#}
|
package com.sujithjay.benchmark.merge
import org.scalameter.api._
/**
* @author Sujith
*/
object MergePerformance extends Bench.LocalTime{
val sizes = Gen.range("arraySizes")(0, 1500000, 300000)
val lists = for {
size <- sizes
} yield Tuple2((0 to (size, 2)).toList, (1 to (size, 2) ).toList)
perform... |
package at.sunilson.vehicleMap.domain.entities
import com.google.android.libraries.maps.model.LatLng
import java.time.DayOfWeek
internal data class ChargingStation(
val id: Int,
val operator: String,
val address: String,
val connections: List<Connection>,
val location: LatLng?
)
internal data cla... |
export { parseForm, safeParseForm, parseFormAny } from "./parse-form";
export { errorChain, fieldChain, createCustomIssues } from "./chains";
export { useZorm } from "./use-zorm";
export { Zorm } from "./types";
export { useValue, Value, ValueSubscription } from "./use-value";
|
namespace NotifyMe.Rawbot.Amazon.Commands.ReadySignIn
{
using NotifyMe.Core.Mediator;
public class ReadySignInResponse : ResponseBase
{
}
} |
#!/bin/bash
# Fill wp-config.php
./install/set-wp-config.sh
# Proceed to maybe install WordPress
./install/maybe-install-wp.sh
|
/*
* 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
* "License"); you ... |
import { StateTestRecord } from '@tussle/spec';
import { TussleStateService } from '@tussle/spec/interface/state';
import { stateServiceTests as stateSpecConformanceTests } from '@tussle/spec';
import { TussleStatePostgres } from './state';
import { Pool } from 'pg';
const pool = new Pool({
max: 1,
connectionStrin... |
<?php
namespace ipinfo\ipinfo;
use Exception;
use ipinfo\ipinfo\cache\DefaultCache;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
/**
* Exposes the IPinfo library to client code.
*/
class IPinfo
{
const API_URL = 'https://ipinfo.io';
const CACHE_MAXSIZE = 4096;
const CACHE_TTL = 8640... |
package esg.security.utils.http;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpEntity;
import org.apache.http.HttpStatus;
i... |
#!/bin/bash
sbatch -N 1 -t $1 --job-name=sleep-$1 sleep.job $1
|
import '../event/play_card_event.dart';
import '../exceptions/action_exception.dart';
import '../model/enums/location.dart';
import '../model/game_state.dart';
import '../state_change/add_event_state_change.dart';
import '../state_change/move_card_state_change.dart';
import '../state_change/priority_state_change.dart';... |
package me.bausano.tsp.IO;
import me.bausano.tsp.Enum.Algorithm;
import me.bausano.tsp.Exception.InvalidAlgorithmChoiceException;
import me.bausano.tsp.IO.InputParser.InputParser;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Scanner;
public class Eloquent {
... |
//Copyright(c) 2021-2030, Muhammad Rahman
//All rights reserved.
//This source code is licensed under the Apache 2.0 License found in the
//LICENSE file in the root directory of this source tree.
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace Market.Price.Provider
{
... |
<?php
class Web_Model extends CI_Model
{
public function get_all_featured_product()
{
$this->db->select('*,tbl_product.publication_status as pstatus');
$this->db->from('tbl_product');
$this->db->join('tbl_category', 'tbl_category.id=tbl_product.product_category');
$this->db->jo... |
package com.github.ezauton.core.util
import com.github.ezauton.conversion.ms
import com.github.ezauton.conversion.seconds
import com.github.ezauton.core.action.*
import com.github.ezauton.core.simulation.parallel
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.Assertions.assertEquals
import org.juni... |
# slugboot
aggressively cache at the application layer for offline-only webapps
With this module serving as a kind of web bios, you can create identical "slug"
domains (with https certs) that can be flashed with any application. The
application payload is stored in indexedDB.
This way, you can load webapps from p2p ... |
---
id: environment-variables
title: Environment Variables
---
The following is a list of the environment variables used by Apify SDK that are available to the user:
## `APIFY_HEADLESS`
If set to `1`, web browsers launched by Apify SDK will run in the headless mode. You can still override
this setting in the code, e.... |
<?php
namespace GDO\RandomOrg\Test;
use GDO\Tests\TestCase;
use GDO\RandomOrg\Module_RandomOrg;
use function PHPUnit\Framework\assertLessThanOrEqual;
use function PHPUnit\Framework\assertGreaterThanOrEqual;
final class RandomTest extends TestCase
{
public function testAPI()
{
$mod = Module_RandomOrg::... |
module.exports = {
options: {
// On TravisCI, sometimes the tests that require I/O need extra time.
timeout: 10000,
reporter: 'mocha-multi',
reporterOptions: {
spec: '-',
},
},
unit: ['dist/unit-tests.js'],
functional: ['dist/functional-tests.js'],
};
if (process.env.COVERAGE === 'y')... |
import { Listable } from "../../common/Listable";
import { probablyUniqueString } from "../../common/Toolbox";
import { DurationTiming } from "../Combatant/DurationTiming";
import { StatBlock } from "../StatBlock/StatBlock";
export interface SavedCombatant {
Id: string;
StatBlock: StatBlock;
MaxHP: number;... |
/*
* Copyright (c) 2014. Pokevian 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
*
* Unless required by applicable law or ag... |
package com.lucasrochagit.src.business.mapper;
import com.github.dozermapper.core.DozerBeanMapperBuilder;
import com.github.dozermapper.core.Mapper;
import com.lucasrochagit.src.business.mapper.interfaces.IFileModelMapper;
import com.lucasrochagit.src.business.model.FileModel;
import com.lucasrochagit.src.infrastructu... |
package com.willoutwest.kalahari.asset.readers
import com.willoutwest.kalahari.asset.AssetCache
import com.willoutwest.kalahari.asset.AssetKey
import com.willoutwest.kalahari.asset.AssetReader
import com.willoutwest.kalahari.math.Color3
import com.willoutwest.kalahari.math.intToComponent
import com.willoutwest.kalahar... |
export default {
"port": 8080,
"bodyLimit": "100kb",
"corsHeaders": ["Link"]
}
|
<?php
namespace EasyAI;
class Stack
{
private $open = [];
private $done = [];
public function clear()
{
$this->open = [];
$this->done = [];
}
/**
* Function adds URL into stack and if it is new or existing but not yet parsed
* returns StackItem object
* if old and parsed already returns FALSE.
*
... |
@if($product->qty >= 0)
<form method="post" action="{{ route('cart.add-to-cart') }}">
{{ csrf_field() }}
<input type="hidden" name="slug" value="{{ $product->slug }}"/>
<div class="badge badge-success fill">In Stock</div>
<hr>
<div class="row">
<div class="form-group col-md-2" style... |
#!/usr/bin/env bash
set -Eeuo pipefail
exec::git::stash() {
exec command git stash "$@"
}
setup_colors() {
if [[ -t 2 ]] && [[ -z "${NO_COLOR-}" ]] && [[ "${TERM-}" != "dumb" ]]; then
NOFORMAT='\033[0m' RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m'
fi
}
msg() {
echo >&2 -e "${1-}"
}
info() {
... |
aws iam remove-role-from-instance-profile \
--instance-profile-name=aws-elasticbeanstalk-ec2-role \
--role-name=aws-elasticbeanstalk-ec2-role
|
import { GetServerSidePropsContext } from 'next'
import { getSession, useSession } from 'next-auth/client'
import { Stack } from '@chakra-ui/react'
import prisma from '../../lib/prisma'
import { ADMIN_INCLUDE, AdminStory } from '../../lib/model/story'
import AdminLayout from '../../layouts/Admin'
import HeadTags from '... |
"""
Helper functions to load and save CSV data.
This contains a helper function for loading and saving CSV files.
"""
# Import csv
import csv
# Import Path from pathlib
from pathlib import Path
def load_csv(csvpath):
"""
Reads the CSV file from path provided.
Args:
csvpath (Path): ... |
/* Copyright © 2021 HornsApp. All rights reserved. */
package com.yesferal.hornsapp.core.domain.usecase
import com.yesferal.hornsapp.core.MockitoTest
import com.yesferal.hornsapp.core.domain.abstraction.ConcertRepository
import com.yesferal.hornsapp.core.domain.entity.Concert
import com.yesferal.hornsapp.core.domain.e... |
import HeaderBackground from './HeaderBackground'
import headerOptions from './headerOptions'
import HeaderTitle from './HeaderTitle'
export { HeaderBackground, headerOptions, HeaderTitle }
|
package main
import "fmt"
func main() {
a := []byte("foo")
b := append(a, []byte("bar")...)
c := append(a, []byte("baz")...)
fmt.Println(string(a), string(b), string(c))
}
|
// ELECTRO ENGINE
// Copyright(c) 2021 - Electro Team - All rights reserved
#include "epch.hpp"
namespace Electro
{
struct ExporterOptions
{
String ExportPath;
String ApplicationName;
};
class RuntimeExporter
{
public:
// Exports the currently active ... |
package br.com.jfelipe.kart.domain.race
import br.com.jfelipe.kart.domain.shared.Pilot
import java.time.LocalTime
import java.time.format.DateTimeFormatter.ISO_LOCAL_TIME
import java.time.format.DateTimeFormatterBuilder
import java.time.temporal.ChronoField.HOUR_OF_DAY
data class Lap(
val hour: LocalTime,
... |
/*
*
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*
*/
package com.microsoft.device.display.samples.widget.feed
data class RssItem(
var title: String?,
var creator: String?,
var date: String?,
var body: String?,
var href: String?
) |
[{
shouldDeps : ['tick', 'idle']
},
{
tech : 'spec.js',
shouldDeps : { tech : 'js', block : 'dom' }
}]
|
; ModuleID = 'amy-module'
source_filename = "<string>"
%Either = type { i1, i64* }
declare i8* @GC_malloc(i64)
define %Either* @h() {
entry:
%0 = getelementptr %Either, %Either* null, i32 1
%1 = ptrtoint %Either* %0 to i64
%2 = call i8* @GC_malloc(i64 %1)
%res1 = bitcast i8* %2 to %Either*
%res11 = alloca ... |
package uo.sdm.mapintegrationapp.persistence.tables;
import android.content.ContentValues;
import android.database.sqlite.SQLiteDatabase;
import uo.sdm.mapintegrationapp.model.Place;
import uo.sdm.mapintegrationapp.model.types.PlaceType;
/**
* Created by Hans on 25/06/2015.
*/
public class PlacesTable {
public... |
function save_loc()
loc=""
if haskey(ENV,"FW_SAVE_LOC")
loc=ENV["FW_SAVE_LOC"]
else
loc=ENV["APPDATA"]*"/FoamWorld/sav/"
ENV["FW_SAVE_LOC"]=loc
end
end
function save_game(g::Game,path::String=save_loc()*g.set["name"])
if !isdir(path)
mkdir(path)
end
cd(path)
write_code("setting.fw",g.set)
end
function l... |
# FSM
A small library which implements an event-driven FSM, where the implementation
exists entirely within state entry and exit handlers.
## Usage
The first step is to define the set of states and events which are involved in
the FSM. This is accomplished using the `FSM_STATE_DEF(NAME)` and
`FSM_EVENT_DEF(NAME)` ma... |
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Elm.Render.Render
( writeElmPages,
)
where
import qualified Data.Text.IO as TIO
import Data.Time.Clock (getCurrentTime)
import Elm.Render.Fitness (renderFitnessPage)
import Elm.Render.Running (renderRunningPage)
import Fitness.Garmin
writeElm... |
<?php
namespace App\Eloquent\Repositories;
use App\Eloquent\Interfaces\AuthInterface;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session;
class AuthRepository implements AuthInterface
{
/**
* Authenticate a user
* @param array $credentials
... |
using System;
namespace ActiproSoftware.ProductSamples.MicroChartsSamples.Common {
/// <summary>
/// Stores sales-related data, and is used by various samples for this product.
/// Any similar custom data objects could be used to generate chart data.
/// </summary>
public class SalesData {
private decimal amo... |
class AddUniqueIndicesBrainzCodeAndNameToMediumFormats < ActiveRecord::Migration[5.2]
def change
reversible do |indices|
indices.up do
execute <<-DDL.gsub /^\s+/, ''
CREATE UNIQUE INDEX medium_formats_brainz_code_index
ON medium_formats(brainz_code);
CREATE UNIQUE INDEX... |
# source: https://github.com/OvercastNetwork/OCN/blob/master/app/models/subscribable.rb
module Subscribable
extend ActiveSupport::Concern
included do
has_many :subscriptions, as: :subscribable, class_name: 'Subscription'
before_destroy do
subscriptions.destroy_all
end
end
def link
# No... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.