text stringlengths 27 775k |
|---|
<?php
namespace Grafika\Gd\DrawingObject;
use Grafika\DrawingObject\Ellipse as Base;
use Grafika\DrawingObjectInterface;
use Grafika\Gd\Editor;
use Grafika\ImageInterface;
/**
* Class Ellipse
* @package Grafika
*/
class Ellipse extends Base implements DrawingObjectInterface
{
/**
* TODO: Anti-aliased curv... |
//
// API
//
pub use error::BufrErr;
pub use message::{keys::KeysIterator, Message};
pub use source::BufrFile;
//
// Internal only
//
mod error;
mod message;
mod source;
|
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd.
* http://www.samsung.com/
*
* EXYNOS - SROM Controller support
* Author: Pankaj Dubey <pankaj.dubey@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 a... |
import 'package:flutter_test/flutter_test.dart';
import 'package:dni_nie_validator/dni_nie_validator.dart';
void main() {
test('validate DNI', () {
expect('54566045v'.isValidDNI(), true);
expect('54566045V'.isValidDNI(), true);
expect('54566045i'.isValidDNI(), false);
});
}
|
/**
* The MIT License (MIT)
* <p/>
* Copyright (c) 2015 Riccardo Cardin
* <p/>
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rig... |
import { FixRatioContainer } from "../Common/FixRatioContainer"
import { injectable } from "inversify"
import { GameConfig } from "../Core/GameConfig"
import { Resources, GlobalEvents } from "../Utils/SymbolClasses"
import { Sprite } from "pixi.js"
@injectable()
export class BackgroundLayer extends FixRatioContainer {... |
module Authorizable
module ViewHelpers
# support can-can style permission checking
#
# @example
# <% if can? :update, @article %>
# <%= link_to "Edit", edit_article_path(@article) %>
# <% end %>
#
# @param [Symbol] permission the action or permission to check
# @param [Obj... |
# WebApi .NetCore-2.2 + EFCore
```WebApi``` Sample .```.NetCore 2.2``` / ```EFCore + Sql Server```
|
# 最終上傳資料夾
* 怎麼train/test
* Report.pdf
* /src : source code資料夾
|
Your task is to implement the interactive game of [hangman](http://en.wikipedia.org/wiki/Hangman_\(game\))
bonus point for making the game unique. be more creative! |
package stroom.security.impl.db;
import com.google.inject.Guice;
import com.google.inject.Injector;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import stroom.security.impl.TestModule;
import stroom.security.impl.UserDao;
import stroom.security.shared.User;
import stroom.util.AuditUtil;
... |
use nom::lib::std::fmt::{Display, Formatter};
// Inflights limits the number of MsgApp(represented by the largest index
// contained within) sent to followers but not yet acknowledged by them. Callers
// use Full() to check whether more messages can be sent, call Add() whenever
// the are sending a new append, and rel... |
import datetime
import os
from decimal import Decimal
from itertools import groupby
from dateutil import parser
from dateutil.relativedelta import relativedelta
from dateutil.rrule import MONTHLY, rrule
from django.http import HttpResponse
from django.utils.translation import ugettext_lazy as _
from rest_framework imp... |
"""
An interface to PyContracts, to annotate functions with type information
The @contract decorator is disabled by default, to avoid
any runtime overhead when using Glue. To enable runtime
checking, run
glue.config.enable_contracts(True)
in a glue config file.
If PyContrats is imported, a no-op @contract decorator... |
<?php
/**
* @author Basic App Dev Team <dev@basic-app.com>
* @license MIT
* @link http://basic-app.com
*/
use BasicApp\Helpers\Url;
use BasicApp\Admin\AdminEvents;
use BasicApp\System\SystemEvents;
use BasicApp\System\Events\SystemResetEvent;
use BasicApp\System\Events\SystemSeedEvent;
use BasicApp\Page\... |
export { default as Accordion } from "./Accordion";
export { default as BoxWithLogo } from "./BoxWithLogo";
export { default as Buttons } from "./Buttons";
export { default as CustomLinkBoxes } from "./CustomLinkBoxes";
export { default as TextOnly } from "./TextOnly";
export { default as HeaderAndMarkDownBlock } from ... |
module CoRE
module CoAP
module Options
extend Types
TOKEN_ON = 19
# 14 => :user, default, length range, replicable?, decoder, encoder
OPTIONS = { # name minlength, maxlength, [default] defined where:
1 => [:if_match, *o256_many(0, 8)], # core-coap-12 [RFC7252]
... |
#!/bin/bash
if [ -f ./vamp.pid ]; then
PID=$(cat ./ssc.pid)
else
PID=$(ps -ef | awk '/venv\/bin\/python/{ print $2 }')
fi
echo "Killing $PID"
kill $PID
if [ -f ./vamp.pid ]; then
rm ./vamp.pid
fi
if [ -f ./vamp.nohup ]; then
rm ./vamp.nohup
fi
|
package io.awesdroid.awesauthkt.data.db
import android.net.Uri
import android.util.Log
import androidx.room.Room
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.google.gson.GsonBuilder
import io.awesdroid.awesauthkt.data.db.AuthDatabase
import i... |
2020年09月14日08时数据
Status: 200
1.陈数老公回应
微博热度:4037562
2.云南公布新增1例无症状详情
微博热度:2677621
3.王子异冠军时刻
微博热度:2458145
4.李现给腹肌打码
微博热度:2285699
5.郑爽吴亦凡潮玩人类在哪里预告
微博热度:1194364
6.吴邪被十一仓开除
微博热度:497420
7.全球确诊病例超2863万例
微博热度:479074
8.张起灵被困吼泉
微博热度:452962
9.掘金快船抢七
微博热度:413623
10.侵犯知识产权犯罪入罪门槛降至30万
微博热度:409423
11.原来谐音梗真的会扣钱
微... |
# jslab
Collection of little experiments and solutions for lab and teaching purposes...
|
<!-- changelog-linker -->
<!-- dumped content start -->
## Unreleased
- [#16] composer req symplify/changelog-linker --dev, Thanks to [@malukenho]
- [#15] Enable SQL Logger, Thanks to [@EHER]
<!-- dumped content end -->
<!-- dumped content start -->
## [0.0.7]
- [#12] Disable "Sforce-Auto-Assign" by default, Tha... |
// Copyright 2020 Ledger SAS
//
// 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 in w... |
package com.roundeights.skene
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}
/**
* Recover companion
*/
object Recover {
/** Builds a new Recover instance from a callback */
def using ( action: PartialFunction[Throwable, Unit] ): Recover
= new Recover( actio... |
// Init placeholder values, to be initialized after document has finished
// loading.
let currentContainer = undefined;
let sourceContainer = undefined;
let currentSimilarLines = [];
let sourceSimilarLines = [];
/**
* @function printLines
* Function prints lines of source code into specified target element. Lines
... |
use brcc;
-- /******************************************/
-- /* 数据库全名 = brcc */
-- /* 表名称 = rcc_api_token */
-- /******************************************/
CREATE TABLE `rcc_api_token` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '编号',
`token` varchar(64) NOT NULL DEFAULT '' COMMENT 'api to... |
//! Common registers used in vga programming.
mod attribute_controller;
mod color_palette;
mod crtc_controller;
mod general;
mod graphics_controller;
mod sequencer;
use crate::colors::{Color16, PALETTE_SIZE};
pub use attribute_controller::{AttributeControllerIndex, AttributeControllerRegisters};
pub use color_palett... |
1.470441 0.500000 2.638892e-04 -7.442031e+00 3.602725e-02 1.000000e+00
1.471323 0.500000 2.633649e-04 -7.442181e+00 3.600531e-02 1.000000e+00
1.472206 0.500000 2.631491e-04 -7.442532e+00 3.598933e-02 1.000000e+00
1.473089 0.500000 2.626845e-04 -7.442275e+00 3.597051e-02 1.000000e+00
1.473973 0.500000 2.624370e-04 -... |
import React from 'react';
import LockFilledIcon from '@atlaskit/icon/glyph/lock-filled';
import { injectIntl } from 'react-intl';
import { TitleBoxIcon as TitleBoxIconType } from '../../../index';
import {
TitleBoxWrapper,
TitleBoxHeader,
TitleBoxFooter,
TitleBoxIcon,
} from './styled';
import { Breakpoint } f... |
Description
===========
A node.js middleware for validating files. Best used as a middleware along with
- Multer
or any other ```multipart/formdata``` parser.
Requirements
============
* [node.js](http://nodejs.org/) -- v4.5.0 or newer
Install
=======
```sh
$ npm install --save @thesameeric/fileguard
```
Usage
=... |
"use strict";
cc._RF.push(module, '70334FFXFNJCIEUL2Z/Jk/A', 'service');
// modules/public/script/service/service.js
"use strict";
/**
* 客服面板, 直接webView连接到 php 指定网址, 具体功能由 php 完成
*/
glGame.baseclass.extend({
properties: {
audio: {
type: cc.AudioClip,
"default": null
},
leftContent: cc.Node... |
module XcodeArchiveCache
module ArtifactCache
class ArtifactExtractor
# @param [XcodeArchiveCache::ArtifactCache::AbstractStorage] storage
#
def initialize(storage)
@storage = storage
@archiver = Archiver.new
end
# @param [XcodeArchiveCache::BuildGraph::Node] node
... |
namespace RouterApi.Models.Request
{
public class CreateMarkRequestSubTypeVM
{
public int? OldMarkRating { get; set; }
public bool OldMarkPresence { get; set; }
public int? NewMarkRating { get; set; }
public bool NewMarkPresence { get; set; }
}
}
|
/* Copyright 2015 Dietrich Epp.
This file is part of Robot Rampage. The Robot Rampage source
code is distributed under the terms of the MIT license.
See LICENSE.txt for details. */
'use strict';
var param = require('./param');
// Dynamic light class.
function Light() {
this.obj = new THREE.PointLight(0xff... |
{-
Verified Red-Black Trees
Toon Nolten
Based on Chris Okasaki's "Red-Black Trees in a Functional Setting"
where he uses red-black trees to implement sets.
Invariants
----------
1. No red node has a red parent
2. Every Path from the root to an empty node contains the same number of
black n... |
package execution
import (
"github.com/cube2222/octosql"
"context"
"github.com/pkg/errors"
)
type UnionAll struct {
first, second Node
}
func NewUnionAll(first, second Node) *UnionAll {
return &UnionAll{first: first, second: second}
}
func (node *UnionAll) Get(ctx context.Context, variables octosql.Variables... |
importall Bukdu
# from phoenix/test/phoenix/router/scope_test.exs
module Api
module V1
importall Bukdu
type UserController <: ApplicationController
end
show(::UserController) = "api v1 users show"
delete(::UserController) = "api v1 users delete"
edit(::UserController) = "api v1 users edit"
foo_host(c::UserControl... |
-- TABLES
UPDATE `bx_market_products` SET `duration_recurring` = 'month' WHERE `duration_recurring` IS NULL;
ALTER TABLE `bx_market_products` CHANGE `duration_recurring` `duration_recurring` VARCHAR( 16 ) NOT NULL DEFAULT 'month';
|
/*
* Project name: Pang Game
* Version 1
* Student : Albert Eduard Merino Pulido
*/
#include "plane.h"
Plane::Plane(){ }
Plane::Plane(Vector3 vector, Vector3 point){
vector.normalize();
a = vector.getX();
b = vector.getY();
c = vector.getZ();
d = -a * point.getX() - b * point.getY() - c * poin... |
import sys
PY_352 = sys.version_info >= (3, 5, 2)
|
namespace PrimS.Telnet.CiTests
{
using System;
using FakeItEasy;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[TestClass]
public class SyncTcpByteStreamTests
{
[TestMethod]
public void GivenAFakedSocketACallToWriteShouldBeRelayed()
{
var writtenString = Guid.NewGuid().ToString();
... |
package com.gao.yingjian.mobiledevelopmentassignmentone.Models;
import java.util.ArrayList;
public class SurveyDetailGroup {
private String groupName;
private String groupDescription;
private ArrayList<SurveyDetailItem> items;
public SurveyDetailGroup(String groupName, String groupDescription, ArrayL... |
package se.scoreboard.data.domain
interface AbstractEntity<ID> {
var id: ID?
} |
# frozen_string_literal: true
module QA
module Page
module Layout
class PerformanceBar < Page::Base
view 'app/assets/javascripts/performance_bar/components/performance_bar_app.vue' do
element :performance_bar
end
view 'app/assets/javascripts/performance_bar/components/det... |
package friendlyrobot.nyc.cupidtest.fragment
import androidx.lifecycle.Observer
import friendlyrobot.nyc.cupidtest.model.MatchValue
class MatchPercentFragment : SpecialBlendFragment() {
override fun wireUpData() {
matchesModel?.getMatches()?.observe(this, Observer<List<MatchValue>> { matches ->
... |
import 'dart:io';
import 'package:http/http.dart' as http;
const _sodiumJsVersion = '0.7.10';
Future<void> main() async {
final webTestDir = Directory('test/integration/binaries/web');
await webTestDir.create(recursive: true);
final baseUri = Uri.https(
'raw.githubusercontent.com',
'/jedisct1/libsodiu... |
#coding=utf-8
"""
Artificial Neurons layer with back propagation
Author: Kaiqiang Duan (段凯强)
Email: moonshile@foxmail.com
"""
import abc
class BpLayer(object):
__metaclass__ = abc.ABCMeta
def __init__(self):
super(BpLayer, self).__init__()
def set_level(self, prev_layer, next_layer):
... |
# stactools-ephemeral
[](https://pypi.org/project/stactools-ephemeral/)
- Name: ephemeral
- Package: `stactools.ephemeral`
- PyPI: https://pypi.org/project/stactools-ephemeral/
- Owner: @githubusername
- Dataset homepage: http://example.com
- STAC extensions u... |
var teste = 'asdasdasd';
function minha(x, y) {
return x * y;
}
var tres = 3;
var PI = 3.14;
var numeros = [1, 2, 3];
// ES 2015
numeros.map(function (valor) {
return valor * 2;
});
// ES 2015
numeros.map(function (valor) { return valor * 2; });
var Matematica = (function () {
function Matematica() {
}
... |
module Hexapic
module API
class Instagram
INSTAGRAM_API_URL = 'https://api.instagram.com/v1/'
def initialize(client_id)
@client_id = client_id
@conn = Faraday.new(url: INSTAGRAM_API_URL) do |faraday|
faraday.request :url_encoded
faraday.adapter :net_http
en... |
export * from './services-dummy/database-dummy-api.response';
export * from './services-dummy/report-dummy-api.response';
export * from './services-dummy/consent-dummy-api.response';
export * from './services-dummy/case-dummy-api.response';
export * from './services-dummy/form-dummy-api.response';
|
# Crud Expressive
```bash
$ composer update
$ vendor/bin/doctrine-module.bat orm:validate-schema
``` |
require 'rails_helper'
RSpec.describe User, type: :model do
describe 'attributes' do
it { is_expected.to respond_to(:email) }
it { is_expected.to respond_to(:measures) }
end
subject { create(:user) }
describe '#average_systolic' do
it 'returns nil if there are fewer submissions than required' do... |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class QueenGuinevere : AllyCard
{
public QueenGuinevere() : base("Queen Guinevere", 0, 3) //3bid
{
}
}
|
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to DSYTrack.h instead.
#import <CoreData/CoreData.h>
extern const struct DSYTrackAttributes {
__unsafe_unretained NSString *artistDisplayName;
__unsafe_unretained NSString *discNumber;
__unsafe_unretained NSString *duration... |
/**
* @returns True if runtime is ReactNative.
*/
declare const isReactNative: () => boolean;
export default isReactNative;
|
<?php
namespace App;
use Carbon\Carbon;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
class OnboardFiles extends Model
{
protected $table = 'on_board_files';
protected $fillable = ['on_board_detail_id', 'name', 'file', 'hash_name... |
use std::collections::{HashMap, VecDeque};
use std::fs;
use std::io::prelude::*;
use avro_rs::{schema::RecordField, Schema};
use crate::error::{Error, Result};
use crate::templates::*;
/// Represents a schema input source.
pub enum Source<'a> {
/// An Avro schema enum from `avro-rs` crate.
Schema(&'a Schema)... |
package typingsSlinky.httpLinkHeader
import org.scalablytyped.runtime.StringDictionary
import typingsSlinky.node.Buffer
import org.scalablytyped.runtime.StObject
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
object m... |
package com.builtbroken.mc.core.network.packet
import io.netty.buffer.Unpooled
import net.minecraft.entity.player.EntityPlayer
import com.builtbroken.mc.lib.helper.wrapper.ByteBufWrapper._
/**
* @author tgame14, Calclavia
* @since 26/05/14
*/
abstract class PacketType extends AbstractPacket
{
var data = Unpooled... |
import { ExtractionRepositoryModel } from './ExtractionRepository';
import unzipper from 'unzipper';
import { IncomingMessage } from 'http';
import axios, { AxiosResponse } from 'axios';
import fs from 'fs-extra';
import * as crypto from 'crypto';
import logger from '../../shared/Logger';
export class ExtractionReposi... |
<?php
use App\Models\Otp;
use Carbon\Carbon;
if( !function_exists('generateOtpString') ) {
function generateOtpString($length = 5) {
/*$characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$charactersLength = strlen($characters);
$randomString = '';
for ($i = 0; $i < $length; $i++)... |
<?php
namespace App\Http\Traits;
trait OnlineExamsTraits {
public function getAllOnlineExams()
{
return $this->onlineExamModel::get();
}
public function getOnlineExamById($onlineExamId)
{
return $this->onlineExamModel::findOrFail($onlineExamId);
}
}
|
namespace Sequence
{
using System;
using System.Collections.Generic;
public class SequenceCreator
{
public static void Main()
{
PrintSequence(2, 50);
}
private static void PrintSequence(int start, int targetSequenceLength)
{
Queue<int> c... |
# HostAuthorization
# for spec
Rails.application.config.hosts << '.example.com'
# for production
#Rails.application.config.hosts << 'fluentd.sindan-net.com'
Rails.application.config.hosts << /.*/
|
from abc import ABC, abstractmethod
from typing import Dict, Any
class TrackedExperiment(ABC):
def __init__(self, additionalLoggingValuesDict=None):
"""
Base class for tracking
:param additionalLoggingValuesDict: additional values to be logged for each run
"""
self.addition... |
export type selectionStrategy<Item extends Object> = (item: Item, selection: Array<Item>, neighbours: Array<Item>, ancestors: Array<Item>) => Array<Item>
export type clickStrategy<Item extends Object> = (item: Item, event: MouseEvent, ancestors: Array<Item>, neighbours: Array<Item>) => void
export type foldStrategy<Ite... |
import 'dart:async';
void main () {
final StreamController<int> streamController = StreamController<int>();
/// Listen to the stream
streamController.stream
.where((element) => element %5 == 0)
.listen((event) => print(event));
/// Add data into stream
for (int i=0; i<=20; i++) {
streamCon... |
# frozen_string_literal: true
module Temporal
class TravelToWithBlock < RuboCop::Cop::Cop
def_node_matcher(
:travel_to,
<<~PATTERN
(send nil? {:travel_to | :freeze_time | :travel} ...)
PATTERN
)
MSG = "Always use a block when time travelling"
def on_send(node)
travel... |
package io.github.zeyomir.extremesportssos.presenter
import io.reactivex.disposables.CompositeDisposable
import timber.log.Timber
abstract class BasePresenter<View> : BasePresenerInterface<View> {
protected val compositeDisposable = CompositeDisposable()
protected var view: View? = null
private set
... |
# PlaylistSyncFunctions
TODO:
* Set up app credentials
* https://developers.google.com/api-client-library/python/auth/web-app
|
2020年08月13日11时数据
Status: 200
1.杨幂魏大勋
微博热度:7068659
2.上海发现一例吉林来沪新冠复阳病例
微博热度:3366735
3.终结选择困难症
微博热度:2239737
4.黄圣依 我都想哭又不敢哭
微博热度:1864071
5.乘风破浪的姐姐复活赛名单
微博热度:1668038
6.和高达活力开跑
微博热度:1550300
7.虞书欣拍的THE9
微博热度:1471807
8.斗鱼回应部分吃播主播浪费
微博热度:1417927
9.美国已连续16天单日平均死亡人数过千
微博热度:1399007
10.俄罗斯副总理新冠阳性
微博热度:1384708
1... |
#!/bin/bash
while true; do
python3 train.py --cfg=experiments/vgg16/ssd_dual_vgg16_train_coco_1.yml --multi_gpu
done
|
/** test of tScript*/
let message: string = 'Wisdom is Power';
let heading = document.createElement('h1');
heading.textContent = message;
document.body.appendChild(heading);
/*console.log(message);*/ |
package typingsSlinky.tstl.anon
import scala.scalajs.js
import scala.scalajs.js.`|`
import scala.scalajs.js.annotation.{JSGlobalScope, JSGlobal, JSImport, JSName, JSBracketAccess}
/* Inlined std.Pick<tstl.tstl/base/thread/ILockable.ILockable, 'lock' | 'unlock'> */
@js.native
trait PickILockablelockunlock extends js.O... |
/*
--This query (s) should be copied and pasted into the query editor in the H2 database,
--which is displayed in the browser at: http: //localhost:8080/h2-console/
--Kitchen presentation
select
kitchen.id ,
kitchen.kitchen_name ,
furniture.id,
furniture.furniture_name,
lighting_accessories.id,
lighting_ac... |
# Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
'''
Dendrogram statistics as described in Burkhart et al. (2013)
Two statistics are contained:
* number of leaves + branches vs. $\delta$ parameter
* statistical moments of the intensity ... |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Sharp86;
namespace Sharp86UnitTests
{
[TestClass]
public class OpCodeTestsB8 : CPUUnitTests
{
[TestMethod]
public void mov_ax_iv()
{
... |
export default function process(currentPositions: number[]): number {
const maxPosition = Math.max(...currentPositions);
const costs = [...Array(maxPosition + 1)]
.map((_, targetPosition) => currentPositions.reduce((curr, next) => curr + cost(next, targetPosition), 0));
return Math.min(...costs);
}
function ... |
using System;
using System.Linq;
using HollowForest.Effects;
using HollowForest.Interactivity;
using UnityEngine;
namespace HollowForest
{
public class NPC : MonoBehaviour, IInteractive
{
[CharacterCategory(CharacterCategory.NPC)] public CharacterRef characterRef;
public CharacterAnimator.Setti... |
import { OnGatewayConnection, WebSocketGateway, WebSocketServer } from "@nestjs/websockets";
@WebSocketGateway(4001)
export class AppGateway implements OnGatewayConnection {
@WebSocketServer()
wss;
handleConnection(client){
client.emit('connection', 'successfully connected to server')
}
} |
%% =============================================================================
%% @author Gavin M. Roy <gavinr@aweber.com>
%% @copyright 2015 AWeber Communications
%% @end
%% =============================================================================
-module(estuary_accumulator).
-behavior(gen_server).
-export([s... |
Rails.application.routes.draw do
resource :session, controller: 'rails_jwt_auth/sessions', only: %i[create destroy]
resource :registration, controller: 'rails_jwt_auth/registrations', only: %i[create]
resources :confirmations, controller: 'rails_jwt_auth/confirmations', only: [:create, :update]
resources :pass... |
const { example, action } = require("../src/helpers");
example("Find a thai restaurant on yelp", async (page) => {
await action("Search for a thai restaurant", async () => {
await page.goto("https://www.yelp.com/");
// NOTE: (plumbers, delivery, takeout) is not locale friendly
await page.click('input[pl... |
import React from 'react';
import { AbstractReactFactory } from '@projectstorm/react-canvas-core';
import CardModel from '../models/CardModel';
import Card from '../components/Diagram/Card/Card';
class CardFactory extends AbstractReactFactory {
constructor() {
super('card');
}
generateModel(event)... |
import Data.List
import System.Environment
data Ship = Ship Int Int Int deriving Show
data Waypoint = Waypoint Int Int deriving Show
followRoute :: Ship -> String -> Ship
followRoute ship@(Ship x y r) instruction = case head dir of
'N' -> Ship x (y + amt) r
'S' -> Ship x (y - amt) r
'E' -> Ship (x + amt) y r
... |
module Syntax where
import Control.Monad.Except
import Data.List
-- datatypes
data Term
= TmVar Int Int
| TmAbs String Ty Term
| TmApp Term Term
| TmTrue
| TmFalse
| TmIf Term Term Term
deriving Eq
data Ty
= TyBool
| TyArrow Ty Ty
deriving Eq
-- context
type C... |
import { Location } from '../types/location'
export function getHashParams(location: Location) {
const hashParams: { [key: string]: string } = {}
let e: string[] | null,
regex = /([^&;=]+)=?([^&;]*)/g,
queryString = location.hash.substring(1)
e = regex.exec(queryString)
while (e) {
hashParams[e[1]]... |
<div class="editForm">
<div class="fadeOut">
<i class="fas fa-2x fa-times"></i>
</div>
<form method="post" id="update_NavTitle_form" enctype="multipart/form-data">
{{ csrf_field() }}
<input type="hidden" name="id">
<div class="colContainer">
<div class="col-auto">
<... |
# Roman numeral conversion
Utility class to convert Arabic numerals (1, 2, 3) to their Roman (I, II, III) counterparts and vice versa.
__Note:__
* Handles 0's
* Upper limit set to 3,999
* Checks invalid input
## Usage
```
from convert import Convert
Convert().toRoman(number=2421)
// returns MMCDXXI
Convert().toA... |
#!/bin/bash
# shares text or markdown file to wordpress
# input: text file as --txtinfile
# output: wordpress draft
# flags: --verbose "y" (stupidly requires y)
while :
do
case $1 in
--help | -\?)
echo "requires input text file name"
exit 0 # This is not an error, the user requested help, so do not exit status 1.
... |
using System;
using System.Collections.Generic;
using Aliencube.AzureFunctions.Extensions.OpenApi.Attributes;
using Aliencube.AzureFunctions.Extensions.OpenApi.Enums;
using Newtonsoft.Json;
namespace Aliencube.AzureFunctions.FunctionApp.Models
{
/// <summary>
/// This represents the model entity for sample ... |
import _ from "lodash";
import { Request, Response } from "express";
import IHullClient from "../types/hull-client";
import SyncAgent from "../core/sync-agent";
const eventCallbackAction = async (req: Request, res: Response) => {
if (_.get(req, "hull", undefined) === undefined) {
res.status(400).send({ mes... |
package com.ryz.movie.core.data.source.remote
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import com.ryz.movie.core.data.source.remote.network.ApiConfig
import com.ryz.movie.core.data.source.remote.network.ApiResponse
import com.ryz.movie.core.data.source.remote.response.MovieDetailRes... |
package com.dicoding.emergencyapp.ui.news.health
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import com.dicoding.emergencyapp.data.entity.ArticlesItem
import com.dicoding.emergencyapp.data.repository.NewsRepository
class HealthNewsViewModel(private val repository: NewsRepository): ViewModel... |
/*
* IdendityModel.OidcClient2 Helper Library for Xamarin.Forms
* Author: Takashi Yahata (@paoneJP)
* Copyright: (c) 2018 Takashi Yahata
* License: MIT License
*/
using Android.App;
using Android.Content;
using Android.Content.PM;
using Android.Support.CustomTabs;
using System;
using XFOidcClient2Demo;... |
# Data Access Layer
The solution uses code first: to change the database, modify `dbmodel.py` and
create migrations using `alembic`.
Refer to [the migrations README file](../migrations/README.md) for a quick
reference for `alembic` CLI.
|
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeOperators, GADTs #-}
{-# LANGUAGE RecordWildCards, TupleSections #-}
{-# LANGUAGE DeriveGeneric, DeriveAnyClass, FlexibleContexts #-}
module Cactus.Clash.SerialTX
( TXOut(..)
, txDyn
, tx
, fifo
) where
import Clash.Prelude
import Cactus.Clash.Util
i... |
module Entailment.Result where
import Control.Applicative
import Control.Monad (liftM, ap)
data Result a =
Ok [ a ]
| Error [ String ]
both :: Result a -> Result a -> Result a
both r1 r2 =
case (r1, r2) of
(Ok xs1, Ok xs2) -> Ok (xs1 ++ xs2)
(Ok _, Error ys) -> Er... |
<html>
<head>
<title>SIGPROG</title>
<link href="<?php echo asset_url();?>/css/icons.css" rel="stylesheet">
<link rel="stylesheet" href="<?php echo asset_url();?>/css/materialize.css">
<link rel="stylesheet" href="<?php echo asset_url();?>/css/sigprog.css">
<script type="text/javascript" src="<?php echo asset_url(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.