text stringlengths 27 775k |
|---|
require 'gigantron/migrator'
namespace :db do
desc "Migrate databases according to models"
task :migrate do
puts "Migrating your database"
get_db_conn(GTRON_ENV)
Gigantron.migrate_dbs
end
end
|
#include <string>
#include <set>
// DQ (11/19/2018): Commented this out to fix thisi issue.
// DQ (9/7/2018): We should not have a using namespace directive in a header file.
// using namespace std;
class IncludedFilesUnparser : public AstSimpleProcessing
{
private:
SgProject* projectNode;
... |
#!/usr/bin/env bash
echo "Starting sim-db-dif..."
HOME=$(dirname $0)
APP_NAME=sim-db-dif
VERSION=1.0.2
java -jar ${HOME}/target/${APP_NAME}-${VERSION}.jar > log.log 2>&1 &
echo
|
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE InstanceSigs #-}... |
package com.login.helper.data.model
import android.net.Uri
data class LoggedInUser(
val email: String? = null,
val userId: String? = null,
val userToken: String? = null,
val displayName: String? = null,
val photoUrl: Uri? = null
) |
package com.jacekpietras.zoo.domain.business
import com.jacekpietras.core.PointD
import com.jacekpietras.core.haversine
import com.jacekpietras.zoo.domain.model.MapItemEntity
internal class Builder(
roads: List<MapItemEntity.PathEntity>,
technical: List<MapItemEntity.PathEntity>
) {
private val nodes = m... |
#![cfg_attr(not(feature = "std"), no_std)]
use codec::Codec;
// use 自定义类型,主要是返回值的类型
pub use pallet_kitties::GetKittyMarketResult;
sp_api::decl_runtime_apis!{
pub trait KittiesApi<AccountId, Balance> where
AccountId: Codec,
Balance: Codec,
{
fn query_kittiy_market_info() -> GetKittyMa... |
# frozen_string_literal: true
module Gitlab
module Database
module Reindexing
class QueuedAction < SharedModel
self.table_name = 'postgres_reindex_queued_actions'
enum state: { queued: 0, done: 1, failed: 2 }
belongs_to :index, foreign_key: :index_identifier, class_name: 'Gitlab::... |
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {HttpBackend, HttpClientModule} from '@angular/common/http';
import {NgModule} from '@angular/core';
import ... |
using System;
using System.IO;
namespace WhiteRabbit.Protobuf
{
public class ProtobufSerializer : ISerializer
{
public string ContentType => "application/protobuf";
public byte[] Serialize<T>(T obj)
{
byte[] result;
using (var stream = new MemoryStream())
... |
require 'test_helper'
class InMemoryCache
attr_accessor :cache, :options
def initialize(options = {})
@cache = {}
@options = {}
end
def read(key); cache[key]; end
def write(key, value, opts = {}); options[key] = opts; cache[key] = value; end
def read_multi(*keys)
results = {}
keys.each do... |
<div align="center">
<h1 align="center">
SCHEDULE-BILIBILI
</h1>
</div>
# 工具简介
这是一个利用 GitHub Action 等方 1式实现哔哩哔哩(Bilibili)每日任务投币,点赞,分享视频,直播签到,银瓜子兑换硬币,漫画每日签到,简单配置即可每日轻松获取 65 经验值,快来和我一起成为 Lv6 吧~~~~
**如果觉得好用,顺手点个 Star 吧 ❤**
这个项目作为自己的学习项目,目前是用 JavaScript 进行实现的,后续可能会使用 TypeScript 来实现,也算是学习的一个路径。
## 功能列表
**本项目不会增加类似于自动转... |
import React, { useState } from 'react';
import DataGrid from '../index';
const DATA = [{
email: '4@domain.com',
name: 'A',
link: 'http://a.com',
rowId: 1,
}, {
email: '3@domain.com',
name: 'B',
link: 'http://b.com',
rowId: 2,
}, {
email: '2@domain.com',
name: 'C',
link: 'http://c.com',
rowId: ... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OOP_CASE4
{
public class AdmStock: ProgramKasir
{
private int stok;
private string barang;
public void inputstok()
{
Console.W... |
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
-- TODO: don't export constructor
module Object
( Object(..)
, object
, Material(..)
) where
import Intersect
data Object n = MkObject
{ getShape :: Intersectable n
, getMat :: Material
}
object :... |
/* Copyright (c) 2000-2004 jMock.org
*/
package test.jmock.expectation;
import java.util.Vector;
import org.jmock.expectation.ExpectationSet;
import org.jmock.expectation.MapEntry;
public class ExpectationSetTest extends AbstractTestExpectationCollection
{
protected void setUp() throws Exception {
sup... |
package packet
import "encoding/binary"
//Constants for creating a Ping packet
const (
PingPacketMagic uint32 = 0x70696E67
PingLength uint32 = 16
PingHeader uint64 = 0x0000000100000000
)
//NewPingPacketAsBytes generates a new default Ping packet
func NewPingPacketAsBytes() []byte {
packetBytes := make(... |
ROM File Format
===============
The standard file format for storing and exchanging program ROM dumps is described
here.
The proposed file extension is `.kpr`, for `K`he`P`ra `R`om, but others may be used.
#### File header
| Offset | Length | Value | Description |
|--------|--------|-------|-------------|
| `$0000`... |
module ApplicationHelper
def flash_message
messages = ""
[:notice, :info, :warning, :error].each {|type|
if flash[type]
messages += "<p class=\"#{type}\">#{flash[type]}</p>"
end
}
messages
end
end
|
//css_args /ac
////css_inc cmd.cs
using System.Reflection;
// using System.Windows.Forms;
using System.IO;
using System.Linq;
using System;
using System.Text;
using System.Diagnostics;
void main(string[] args)
{
var md5_exe = @"..\src\tools\md5sum.exe";
// raw: "\7825e05d694088b227db29fb9425669b *plugi... |
import array as arr
class Block:
def __init__(self,previousHash,transactions):
self.previousHash = previousHash
self.transactions = transactions
contens = [hash(str(transactions)), previousHash]
self.blockHash = hash(str(contens))
@property
def previousHash(self):
""... |
module Spree
class PaymentMethod::BitkassaMethod < PaymentMethod
include Spree::Core::Engine.routes.url_helpers
preference :bitkassa_merchant_id, :string
preference :bitkassa_secret_api_key, :string
def initialize(attributes = {})
configure
super
end
def source_required?
f... |
import { expect } from "chai";
import { Database } from "../database";
import { ArangoError } from "../error";
import { config } from "./_config";
describe("Manipulating databases", function () {
let db: Database;
beforeEach(async () => {
db = new Database(config);
if (Array.isArray(config.url) && config.l... |
#!/bin/bash
echo "INSTALL VISUAL STUDIO CODE"
apt install ./PACKAGES/code_1.17.1-1507645403_amd64.deb
#VISUAL STUDIO CODE
#https://code.visualstudio.com/
#wget https://go.microsoft.com/fwlink/?LinkID=760868
|
# GitHub Basics
<img src="femalecodertocat.png" alt="Octocat image" />
Repo to help me learn git and github really well :)
* Practising my Markdown skills
* Added a licence
* Added a.gitignore file
|
package helpers
func GetElementByIndex(x interface{}, i int, element string) interface{} {
return x.([]interface{})[i].(map[string]interface{})[element]
}
func Seq(min float64, max float64) [101]float64 {
step := (max - min) / (100)
var values [101]float64
t := min
for i := 0; i < 101; i++ {
values[i] = t... |
// <copyright file="ConfigurationRegistrar.cs" company="Red Tarn Technology Ltd">
// Copyright (c) Red Tarn Technology Ltd. All rights reserved.
// </copyright>
using System;
using BoDi;
using Microsoft.Extensions.Configuration;
using RedTarn.Selenium.Core.Bootstrap.Configuration;
using RedTarn.Selenium.Core.Bootstra... |
Rakudo::Internals.REGISTER-DYNAMIC: '$*RAKUDO_MODULE_DEBUG', {
PROCESS::<$RAKUDO_MODULE_DEBUG> := ?%*ENV<RAKUDO_MODULE_DEBUG>
?? -> *@str --> Nil {
state $level = %*ENV<RAKUDO_MODULE_DEBUG>++;
my $indent = (($level - 1) * 4) + 1;
my $str = @str>>.indent(7 + $indent).join("\... |
---
name: 🚀 Feature Request
about: Propose new features or changes to existing features.
---
<!--
### Before opening a new feature request, please check to see if a similar feature request already exists or has been closed before.
### Feature requests should include as much detail as possible:
- [ ] A descriptive ti... |
/*
* Created by Weiyi Li on 2019-09-28.
* https://github.com/li2
*/
package me.li2.movies.ui.moviedetail
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.view.ViewCompat
import androidx.databinding.DataBindingUtil
import androidx... |
# Server Side Node Presentation
## Summary
A campfire talk demonstrating Server Side NodeJS, including a SSR React Demo.
## Sections
1. [Deck](./packages/00-deck)
2. [Stdlib HTTP Hello World](./packages/1.0-stdlib-http)
- introduction to `http` servers in node
3. [Stdlib HTTP w/ Custom Middleware App](./packages/1... |
from django.contrib import admin
from .models.departament import Departament
from .models.city import City
from .models.product import Product
from .models.orderDetail import OrderDetail
from .models.order import Order
from .models.user import User
admin.site.register(Departament)
admin.site.register(City)
... |
package com.itelg.docker.cawandu.domain.volume;
import lombok.Data;
import java.util.Map;
@Data
public class Volume {
private String name;
private String driver;
private Map<String, String> driverOpts;
private Map<String, String> labels;
private String mountPoint;
private String ... |
package com.jailmango.concurrence.book.core.chapter03;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Case3_1_17_1 - 3.1.17 通知过早的问题与解决办法
*
* @author jailmango
* @CreateDate 2019-06-03
* @see com.jailmango.concurrence.book.core.chapter03
* @since R9.0
*/
public class Case3_1_17_1 {
/**
... |
export * from './narik-swimlane-data-table.component';
export * from './narik-swimlane-data-table.module';
|
using System;
using Blauhaus.Orleans.Abstractions.Grains;
using Blauhaus.Orleans.Abstractions.Resolver;
using Blauhaus.TestHelpers.Builders.Base;
using Blauhaus.TestHelpers.MockBuilders;
using Moq;
using Orleans;
namespace Blauhaus.Orleans.TestHelpers.MockBuilders.Resolver
{
public abstract class BaseGrainResolve... |
# frozen_string_literal: true
module ActsAsEditable
class UndoError < StandardError
end
end
|
<?php
namespace App\Entity;
use App\Repository\TweetsRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TweetsRepository::class)
*/
class Tweets
{
/**
* @ORM\Id
* @ORM\GeneratedVal... |
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
date_default_timezone_set('Asia/Jakarta');
class About_us extends CI_Controller {
private $attribThisPage;
private $accessName = 'About Us';
private $topBannerImgPath = './images/top_banner/';
private $franchiseThumbnailImgPath = './images/fr... |
from datetime import datetime, timedelta
from time import timezone
from urllib2 import urlopen, quote, HTTPError
from django.core.management.base import NoArgsCommand
from django.utils.simplejson import loads
from ratemyflight.models import Airline, Airport, Rating
hashtag = "#ratemyflight"
url = "http://search.... |
mkdir -p /tmp/HM
pdflatex -output-directory /tmp/HM HM.tex
mv /tmp/HM/HM.pdf ./
|
#include "response.h"
lrrp::response::response() {
body = json::object();
}
lrrp::response::response(const std::string& raw) {
body = json::parse(raw);
}
void lrrp::response::set_payload(const json& payload) {
body["payload"] = payload;
}
void lrrp::response::set_status(status_type status) {
body["s... |
module Apex
module DelegateInterface
def applicationDidFinishLaunching(notification)
on_launch
true
end
end
end
|
"""Top-level package for databricksppt."""
__author__ = """Michael R. Gilbert"""
__email__ = 'michael.r.gilbert@me.com'
__version__ = '0.6.0-dev0'
|
package ch.hellorin.challengames.service.challenge
import ch.hellorin.challengames.configuration.ProviderConfiguration
import ch.hellorin.challengames.configuration.TestConfiguration
import ch.hellorin.challengames.exception.ExistingChallengeException
import ch.hellorin.challengames.exception.MissingChallengeException... |
{-# LANGUAGE TypeFamilies #-}
module Types.Circle where
import Prelude hiding (Real)
import FwdMode ((:~>), pairD, fstD, sndD, dId, VectorSpace)
import FwdPSh
import Types.Real
-- Circle = Real quotiented by the equivalence relation
-- x ~ y := x - y = 2 * k * pi for some integer k
-- Equivalently, implementing the... |
export default function Welcome(props) {
return(
<div>
<h2>Welcome to What's worse</h2>
<p>Please sign up or login to start playing</p>
</div>
)
} |
package org.github.sustbird.statemachine.exception;
/**
* Exception for action failure.
* @author shafiul.gp@gmail.com
*/
public class ActionFailedException extends RuntimeException {
/**
* No-arg Constructor
*/
public ActionFailedException() {
}
/**
* Constructor with a message
... |
/****************************************************************
* 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... |
--TEST--
DOMDocumentFragment::appendXML() with unbalanced chunks.
--CREDITS--
Eric Lee Stewart <ericleestewart@gmail.com>
# TestFest Atlanta 2009-05-24
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
$document = new DOMDocument;
$root = $document->createElement('root');
$document->appendChild($root);
$f... |
# StandardJS
請將除完錯的 bug.js 程式排版排好,讓他符合 StandardJS 的規格。
|
require "spec_helper"
RSpec.describe "Get fees", vcr: { record: :once } do
it "makes a GET /fee request" do
client = StellarClient.new(CONFIG.slice(:host))
response = client.get_fees(
asset_code: "BTCT",
operation: "deposit",
amount: 0.001,
)
expect(response).to be_success
exp... |
import { JSON_FORMAT } from "../Interface";
import { Observable } from "../Observable";
import { Setting } from "../Setting";
export class Canvas {
private targetId: string;
private canvasDivId: string;
private canvasId: string;
private offsetX: number = Setting.padding;
private offsetY: number = ... |
class CreatePaychecks < ActiveRecord::Migration[5.2]
def change
create_table :paychecks do |t|
t.integer :payroll_id
t.integer :employee_id
t.float :hours, default: 0
t.float :vacation_hours, default: 0
t.float :pto_hours, default: 0
t.float :sick_hours, default: 0
t.floa... |
require 'spec_helper'
require 'euclidean/size'
describe Euclidean::Size do
it "creates a Size object using list syntax" do
size = Euclidean::Size[2,1]
expect(size.size).to eq 2
expect(size.x).to eq 2
expect(size.y).to eq 1
end
it "creates a Size object from an array" do
size = Euclidean::Siz... |
package io.github.oleksivio.tl.kbot.core.controller.handler.unpack
import io.github.oleksivio.tl.kbot.server.api.model.ITelegram
import io.github.oleksivio.tl.kbot.server.api.objects.Update
import kotlin.reflect.KClass
typealias UnpackerFunction<IN, OUT> = (IN) -> OUT?
data class UpdateUnpacker<OUT : ITelegram>(
... |
package model;
import org.junit.Test;
import static org.junit.Assert.*;
public class PointTest {
@Test
public void onEdge() {
Edge edge = new Edge(new Point(true, 2f, 6f), new Point(true, 2f, 0f));
Point point = new Point(true, 2f, 2f);
boolean on = point.onEdge(edge);
assert... |
<?php
namespace Eva\EvaOAuthTest\OAuth2\Token;
use Eva\EvaOAuth\OAuth2\Providers\Douban;
use Eva\EvaOAuth\OAuth2\Token\AccessToken;
use Eva\EvaOAuth\Token\AccessTokenInterface;
use GuzzleHttp\Message\Response;
use GuzzleHttp\Stream\Stream;
class AccessTokenTest extends \PHPUnit_Framework_TestCase
{
public funct... |
import logging
import matplotlib.pyplot as plt
import matplotlib.axes
from matplotlib.lines import Line2D
import numpy as np
import pandas as pd
import seaborn as sns
from typing import Dict, Sequence, Tuple, Union
import warnings
from ..ensemble import (
get_percentile_label,
EnsemblePrediction,
MEDIAN,
)... |
# -*- coding: utf-8 -*-
"""Tests: Structure of tree graph """
import unittest
from assertpy import assert_that
from algolib.graphs import Edge, TreeGraph, Vertex
class TreeGraphTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.test_object = None... |
# roleplay-bot
A bot that allows you to create character descriptions and view them at any time.
This bots purpose is basically to have an easier way of viewing a characters info, nothing more really.
This bot was made entirely by Bloxxer#8729 on Discord using Node.js
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.ComponentModel;
using Dapper;
using DapperExtensions;
using DapperExtensions.Mapper;
namespace WFCommon
{
public class SM_T_PROCESS_AQ_LOG_CLASSMAPPER : ClassMapper<SM_T_PROCESS_AQ_LOG>
{
pub... |
@extends('layouts.admin')
@section('content')
<!-- ACTIONS -->
<section id="action" class="py-4 mb-4 bg-light">
<div class="container">
<div class="row">
<div class="col-md-6 ml-auto">
<div class="input-group">
<input type="text" class="form-control" placeholder="Search">
... |
import React from "react";
import { render, screen } from "@testing-library/react";
import { repos } from "./sampleRepos";
import Card from "./Card";
it("renders cards", () => {
render(<Card key={0} repo={repos[0]} />);
expect(screen.getByText("boysenberry-repo-1")).toBeTruthy();
expect(screen.getByText("Testing... |
import withStyles, { WithStyles } from "./withStyles";
import createStyles from "./createStyles";
import React from "react";
const styles = createStyles({
root: {
margin: "0px"
}
});
export interface Props extends WithStyles<typeof styles> {}
export default withStyles(styles)(class extends React.Component<Pr... |
name 'sc-nxlog'
version '0.10.3'
description 'Installs and configures NXLog_ce on Linux or Windows'
chef_version '>= 12.1'
issues_url 'https://github.com/sous-chefs/sc-nxlog/issues'
source_url 'https://github.com/sous-chefs/sc-nxlog/'
supports 'ubuntu', '>= 14.04'
suppo... |
import { Base, Op } from 'decaffeinate-coffeescript2/lib/coffeescript/nodes';
import isComparisonOperator from './isComparisonOperator';
export default function isChainedComparison(node: Base): boolean {
if (node instanceof Op && isComparisonOperator(node)) {
return (
isComparisonOperator(node.first) ||
... |
/*
* Copyright 2019 Sangoma Technologies Corporation
* George Joseph <gjoseph@digium.com>
*
* 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/license... |
{-# LANGUAGE OverloadedStrings #-}
module Msg.Server.Run where
import Msg.Server.Types
import Msg.Server.User
import Control.Exception
import Data.Monoid
import Control.Monad
import Network.Socket
import qualified Network.WebSockets as WS
import qualified Data.Map as M
import qualified Data.Text as T
import qualifie... |
import {
IExponentialBackoffOptions,
IRetryContext,
Policy,
RetryPolicy,
} from 'cockatiel'
const defaultPolicy = Policy.handleAll()
.retry()
.attempts(3)
.exponential({ initialDelay: 1000 })
export const createSimpleRetryPolicy = (
attemptsCount: number,
exponentialOptions?: Partial<IExponentialBac... |
package com.apideaps.test.controller
import com.apideaps.test.model.Genero
import com.apideaps.test.repository.GeneroRepository
import org.springframework.http.ResponseEntity
import org.springframework.util.ClassUtils.isPresent
import org.springframework.web.bind.annotation.*
import org.springframework.web.util.UriCom... |
#!/usr/bin/env bash
#
# Ensures that Postgres is installed on this machine.
# Creates test DB and user.
# Configures Postgres to accept host connections to new Database.
set -e
set -u
usage() {
echo "Usage: ${0} --host <HOST> --dbname <DBNAME> --username <USERNAME> \\"
echo " --password <USER_PWD... |
# Hexel View
A fully featured HTML view renderer for NodeJS.
```
npm install hexel-view
```
**Note:** Hexel View is still in the early stages of development, and as such it has not
been thoroughly tested or documented yet. Caution is adviced when using this library
in production environments.
See the [changelog](./... |
import com.jfrog.bintray.gradle.BintrayExtension
import meow.AppConfig
import meow.AppConfig.Dependencies
import meow.AppConfig.Publishing
import meow.AppConfig.Versions
import meow.getPropertyAny
import org.jetbrains.dokka.gradle.DokkaTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.a... |
class Lawyer::VerdictScoreUpdateContext < BaseContext
PERMITS = [:note, :appeal_judge].freeze + VerdictScore.stored_attributes[:quality_scores]
before_perform :check_quality_scores
before_perform :assign_attribute
def initialize(verdict_score)
@verdict_score = verdict_score
end
def perform(params)
... |
var searchData=
[
['lognormal',['logNormal',['../classParametricVaR.html#a6e1dd396274079af9e1fc21068213866',1,'ParametricVaR']]]
];
|
package de.htwg.se.slay.model.gamepieceComponent
import de.htwg.se.slay.model.playerComponent.Player
import org.scalatest._
class CastleSpec extends WordSpec with Matchers {
"A Castle is an immovable GamePiece that can be used for defense and" when{
"new" should{
val playr = new Player("","")
val ca... |
#!/bin/bash
# Test script to handle ip routing in expressvpn CLI.
expressvpn disconnect
expressvpn connect ${random_alias}
|
package PizzaCalories;
import java.text.DecimalFormat;
import java.util.ArrayList;
public class Pizza {
private String _name;
private ArrayList<Topping> _toppings;
private Dough _dough;
public Pizza(String name, int numberOfToppings) {
this.setName(name);
... |
use crate::*;
use std::task::{Context, Poll, Waker};
use std::{future::Future, sync::Arc};
use std::{pin::Pin, sync::Mutex};
thread_local! {
static FETCH_FUNCTION: JSObjectFromString = JSObjectFromString::new(include_str!("fetch.js"));
}
pub async fn fetch(path: &str) -> Result<Vec<u8>, ()> {
FetchFuture {
... |
package com.bachhuberdesign.deckbuildergwent.features.factionselect
import com.bachhuberdesign.deckbuildergwent.features.shared.base.MvpContract
/**
* @author Eric Bachhuber
* @version 1.0.0
* @since 1.0.0
*/
interface LeaderConfirmMvpContract : MvpContract {
fun onDeckSaved(deckId: Int)
fun displayErro... |
# DucoJs-Miner
A Multi-Threaded Node.JS Miner for [DuinoCoin](https://duinocoin.com/)
## Get started
```bash
git clone https://github.com/WarL0ckNet/DucoJs-Miner.git
```
```bash
cd DucoJs-Miner
```
```bash
npm install
```
```bash
npm run mine -- -u Username -t 4 -d LOW
```
### Options
```bash
-h, --help ... |
require 'cassandra'
require "cassava/version"
require 'cassava/client'
module Cassava; end
|
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace Nager.Date.Website.Helper
{
public static class AcceptLanguageFormatter
{
public static IFormatProvider GetDateFormatter(HttpRequest request)
{
v... |
const shocknet = require('../index.js');
// Setup variables
var exampleServer = new shocknet.Server;
const idIn = {
PLAYER_SYNC: 0,
MESSAGE: 1
}
const idOut = {
MESSAGE: 0,
PLAYER_READY: 1,
PLAYER_ADD: 2,
PLAYER_KICK: 3,
PLAYER_COLOR: 4,
PLAYER_MOVE: 5,
PLAYER_REMOVE: 6,
PLAYER_NAME: 7
}
var players = [];
/... |
/**
* 类型保护 - 类型谓词
*/
interface Fish {
swim();
}
interface Bird {
fly();
}
// 返回类型谓词,告知TS编译器其具体的类型
function isFish(pet: Fish | Bird): pet is Fish {
// 联合类型: 强制转换为指定类型
return typeof (<Fish>pet).swim === "function";
}
function action(pet: Fish | Bird) {
if (isFish(pet)) {
pet.swim();
} else {
pet.... |
import React, { Component } from 'react';
import BotArmyListItem from './BotArmyListItem';
import './BotArmyList.scss';
class BotArmyList extends Component {
renderArmy() {
return this.props.army.map((armyBot) => {
return <BotArmyListItem armyBot={armyBot} key={armyBot.tokenId} />;
});
}
render() ... |
package com.mistamek.drawablepreview.drawables.dom
import com.mistamek.drawablepreview.factories.IconPreviewFactory
import com.mistamek.drawablepreview.drawables.Utils
import org.w3c.dom.Element
import java.awt.AlphaComposite
import java.awt.Color
import java.awt.image.BufferedImage
class BitmapDrawable : Drawable() ... |
/********************************************************************************
* Copyright (C) 2018 TypeFox and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* Th... |
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.IdentityModel.Tokens.Jwt;
using System.Linq;
using System.Security.Claims;
namespace Microsoft.Azure.Sign... |
@extends('layouts.app')
@section('content')
<div class="container">
<div class="justify-content-center">
<div class="col-sm-12">
@if (session('status'))
<div class="alert alert-success" role="alert">
{{ session('status') }}
</div>
... |
#!/bin/bash
POSTGRES_PW=""
SECRET_KEY=""
HOME="/home/fishing"
# The production directory
TARGET="$HOME/fishing"
# A temporary directory for deployment
TEMP="$HOME/fishing.tmp"
# The Git repo
SOURCE="$HOME/fishing.source"
# Deploy the content to the temporary directory
cp -r $SOURCE $TEMP
cd $TEMP
sed -i "s/POSTG... |
#!/bin/bash
#
# Copyright (c) 2016, Globo.com (https://github.com/globocom)
#
# License: MIT
##
create_js_file()
{
cat <<EOF
/*
* Copyright (c) 2016, Globo.com (https://github.com/globocom)
*
* License: MIT
*/
import React from "react";
export default class extends React.Component {
render() {
return (
... |
package io.ph.bot.events;
import net.dv8tion.jda.core.entities.Guild;
public abstract class MomoEvent {
Guild guild;
public MomoEvent(Guild guild) {
this.guild = guild;
}
public Guild getGuild() {
return this.guild;
}
public abstract void handle();
}
|
@extends('layouts.qore')
@section('htmlheader_title')
E-Sells | Empresas
@endsection
@section('header')
@include('Headers.esells')
@endsection
@section('breadcrumb')
<li><i class="icon icon-dollar-symbol"></i>Empresas</li>
@endsection
@section('content')
<div class="row">
<div class="col-md... |
class ApplicationHelper::Button::DialogResDiscard < ApplicationHelper::Button::Dialog
def visible?
super && @view_context.edit_typ == 'add'
end
end
|
require 'rails_helper'
RSpec.describe CategoriesController, type: :controller do
describe "Test methods of Controller Categories" do
before(:each) do
@user = User.create(name: 'joao silva', email: 'joaferrera@unb.br',
password: '123456', registration:'1100069', cpf:'04601407380', active: true)
... |
class Project < ApplicationRecord
def wasLiked
self.like += 1
end
end
|
#include "vector3f.h"
vector3f_t VECTOR3F_Add( vector3f_t a, vector3f_t b )
{
vector3f_t stNew;
stNew.x = a.x + b.x;
stNew.y = a.y + b.y;
stNew.z = a.z + b.z;
return stNew;
}
vector3f_t VECTOR3F_Subtract( vector3f_t a, vector3f_t b )
{
vector3f_t stNew;
stNew.x = a.x - b.x;
stNew.y = a.y - b.y;
stNew.z = ... |
import React from 'react';
import ReactDOM from 'react-dom';
import { curry, flow, get } from 'lodash/fp';
import assert from 'fl-assert';
const minDateDefault = -2208988800000;
const maxDateDefault = 4102444800000;
// Returns a number. If num is NaN, returns min
// between : Number -> Number -> Number
const between ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.