text stringlengths 27 775k |
|---|
class AccessSession < ApplicationRecord
include CircaExceptions
include SolrDoc
belongs_to :item
belongs_to :order
has_many :user_access_sessions
has_many :users, through: :user_access_sessions
before_create do
self.start_datetime = DateTime.now
self.active = true
self.class.check_in_use(s... |
#!/bin/bash
# ----------- contidition step 10, sliding_window_size 100, lambda_v 0.01
python3 train.py --train_dir ../data/train_1min --test_dir ../data/test_1min \
--output_dir checkpoints/layers2_win100_schedule100_condition10_detach \
--batch_size 32 --seq_len 900 --max_seq_len 450... |
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class DonHang extends Model
{
use HasFactory;
protected $table = 'donhang';
// protected $primaryKey = 'id';
// protected $keyType = 'string';
public function NguoiDung()
{
return $th... |
import panel as pn
import param
class MyComponent(param.Parameterized):
selection1 = param.ObjectSelector()
selection2 = param.ObjectSelector()
component = MyComponent()
app = pn.Column(
pn.pane.Markdown("# Primary Selections"),
pn.Param(component, parameters=["selection1"], show_name=Fa... |
package xyz.manolos.quiz.di
import android.content.Context
import dagger.BindsInstance
import dagger.Component
import xyz.manolos.quiz.home.HomeComponent
import xyz.manolos.quiz.home.HomeModule
import xyz.manolos.quiz.questions.QuestionComponent
import xyz.manolos.quiz.questions.QuestionModule
import xyz.manolos.quiz.... |
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace pets_callback
{
/// <summary>
/// Summary description for PetsCallbackForm.
/// </summary>
public class PetsCallbackForm : System.Windows.Forms.Form
{
... |
import { DOMRectReadOnly } from './DOMRectReadOnly';
import { ResizeObserverSize } from './ResizeObserverSize';
declare class ResizeObserverEntry {
target: Element;
contentRect: DOMRectReadOnly;
borderBoxSize: ResizeObserverSize[];
contentBoxSize: ResizeObserverSize[];
devicePixelContentBoxSize: Res... |
use strict;
use warnings;
use Test::More 'tests' => 8;
BEGIN {
use_ok 'Nick::Error' => ':try';
}
my $error;
try {
Nick::Error -> throw(
'error text',
'-type' => 'test'
);
} catch Nick::Error with {
( $error ) = @_;
is $error -> text() => 'error text';
is $error -> type() => '... |
import numpy as np
def check_slice(line):
return len(line[line != 0].flatten()) == len(np.unique(line[line != 0]))
def check(box, size=3):
for row in box:
if not check_slice(row):
return False
for col in box.T:
if not check_slice(col):
return False
for xn in ra... |
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Cashier extends Authenticatable
{
protected $guard = 'cashier';
//
} |
import 'dart:collection';
import 'package:flutter/material.dart';
import 'package:DirectMF/common/auth.dart';
import 'package:DirectMF/common/calendar.dart';
import 'package:DirectMF/common/exceptions.dart';
import 'package:DirectMF/models/category.dart';
import 'package:DirectMF/models/entry.dart';
import 'package:Di... |
# canvas-focal-mechanism
Focal mechanism on Web Canvas
# 著作
https://github.com/usgs/earthquake-eventpages のソースコードより抜き出しました。
|
package radhoc
import japgolly.scalajs.react.vdom.html_<^._
import japgolly.scalajs.react._
class DragSelection[Index] {
sealed trait Action
case object DoNothing extends Action
case object Select extends Action
case object Deselect extends Action
case class State(span: Set[Index], action: Action)
obje... |
package com.captech.teegarcs.mykotlinapplication.common.AssetLoader
import android.content.Context
import android.text.TextUtils
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import rx.Observable
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers
import java.io.BufferedRead... |
// Copyright 2014 Mike Tsao <mike@sowbug.com>
// 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 rights to use, copy,
// modify, merg... |
package visdom.spark
import org.apache.spark.sql.Row
import visdom.utils.WartRemoverConstants
object DataUtils {
@SuppressWarnings(Array(WartRemoverConstants.WartsAny))
def getValues(fields: Seq[FieldDataType], row: Row): Option[Seq[Option[Any]]] = {
val rowFields: Seq[String] = row.schema.fields.map... |
module MixRailsAlbums::Concerns::Models::Album
extend ActiveSupport::Concern
included do
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Slug
extend Enumerize
field :title, type: String
field :description, type: String
field :date, type: Date... |
\qecho
\qecho === Deploy Schema [schema]
\qecho
set schema 'schema'
\include ./service/drop_source_code.sql
\qecho Deploy source code.
\include ./service/install_object_1_schema_1_VIEW.sql
\include ./service/install_object_1_schema_2_TRIGGER.sql
\include ./service/install_object_1_schema_3_FUNCTION.sql
|
module Fitrender
module Adaptor
class Scene
attr_accessor :renderer_id, :path, :options
def initialize(*args)
args = Fitrender::Utils.extract_options(args)
args.each do |key, value|
self.send("#{key}=", value)
end
end
def option_value(option_id)
... |
"""Test the convert module."""
import datetime as dt
from pathlib import Path
import pytest
import pygohome.convert as conv
@pytest.mark.parametrize(
"filename", ["emptyfile", "hello_world.txt", "osmand_invalid.gpx"]
)
def test_gpx_invalid_file_fails(filename: str) -> None:
"""Expect an error when reading ... |
#!/bin/sh
set -e
# fake syslog
socat UNIX-RECV:/dev/log,mode=666 STDOUT &
while [[ $# -gt 0 ]]; do
echo "$1" | ( IFS='=' && read -r line && echo $line ) >> /etc/opendkim/opendkim.conf
shift
done
echo 'Using configuration file:'
echo '========================='
cat /etc/opendkim/opendkim.conf
echo '=========... |
import java.io.File
import java.util.Collections
fun main(args: Array<String>) {
val timerCounts: MutableList<Long> = MutableList(9) { 0 }
File("input.txt").forEachLine {
it.split(",")
.forEach({
val timerNum = it.toInt()
timerCounts.set(timerNum... |
set -e
function fail {
echo $1 >&2
exit 1
}
function retry {
local n=1
local max=3
local delay=1
local start_time=$(date +%s)
while true; do
"$@" && break || {
if [[ $n -lt $max ]]; then
((n++))
local current_time=$(date +%s)
local elapsed_time=current_time-start_time
... |
using Smart_Garden_UWP_Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Smart_Garden_UWP.Services.Interfaces
{
public interface ICropService
{
Task<Boolean> addCrop(Crop crop);
Task<Boolean> deleteCrop(Crop c... |
package org.jetbrains.plugins.scala.conversion.copy
class CopyScalaToScalaTest extends CopyPasteTestBase {
def testSemicolon(): Unit = {
val from =
s"""object Test {
| val x = 1$Start;$End
|}""".stripMargin
val to =
s"""object Test2 {
| 1$Caret
|}""".stripMa... |
#!/usr/bin/env bash
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
# Colors
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
# Stop the frontend
echo -e "${YELLOW}Stopping frontend...${NC}"
kill $(ps aux | grep '[i]ndex.js' | awk '{print $2}')
echo -e "${GREEN}Frontend terminated.${NC}"
|
#include "core.h"
#include "wbcompeldminimap.h"
#include "wbcompeldtransform.h"
#include "idatastream.h"
#include "meshfactory.h"
#include "eldritchworld.h"
#include "eldritchframework.h"
#include "irenderer.h"
#include "texturemanager.h"
#include "shadermanager.h"
#include "wbentity.h"
#include "mesh.h"
#include "conf... |
# AMT Power state
Click [here](types.md) for supported input and output types.
## Example: Request Body
``` yaml
{
"apiKey":"string",
"method":"PowerState",
"payload":{
"guid":"038d0240-045c-05f4-7706-980700080009"
}
}
```
## Example : Success ResponseBody
``` yaml
'200':
{
"Respons... |
import { ProgressType } from "../enums/progress-type.enum";
export class YearProgressTypeModel {
public type: ProgressType;
public label: string;
public unit: string;
public shortUnit: string;
constructor(type: ProgressType, label: string, unit?: string, shortUnit?: string) {
this.type = type;
this.label = ... |
## oci-storage-list-container-data 1 "August 2016"
## NAME
oci-storage list-container-data - List lookaside data for a container
## SYNOPSIS
**oci-storage** **list-container-data** *containerNameOrID*
## DESCRIPTION
List the pieces of named data which are associated with a container.
## EXAMPLE
**oci-storage list-c... |
module Quotas
class QuotaKind < ActiveRecord::Base
translates :name, :unit, :comment
validates_translated :name, :unit, :comment, presence: true
validates :name_en, uniqueness: true, unless: proc { |k| k.name_en.nil? }
validates :name_ru, uniqueness: true, unless: proc { |k| k.name_ru.nil? }
has_... |
require 'test_helper'
require 'timeout'
class MiniRacerFunctionTest < Minitest::Test
def test_fun
context = MiniRacer::Context.new
context.eval("function f(x) { return 'I need ' + x + ' foos' }")
assert_equal context.eval('f(10)'), 'I need 10 foos'
assert_raises(ArgumentError) do
context.call
... |
class Main
module AdminHelpers
# Admin helper: show_admin (Helpers)
# Renders an admin page with the admin template.
#
def show_admin(template, *args) #template, locals={})
if template.respond_to?(:templates_for)
template = template.templates_for(args.shift || 'index')
end
... |
{-# Language FlexibleContexts #-}
{-# Language FlexibleInstances #-}
{-# Language LambdaCase #-}
{-# Language MultiParamTypeClasses #-}
{-# Language OverlappingInstances #-}
{-# Language UndecidableInstances #-}
module Smirk.Language where
import Data.Accumulator hiding (singleton)
import Data.Function.Polyvariadic hi... |
<?php
namespace ZpgRtf\Objects;
/**
* The min_max_area object defines an area range. Where only one is specified, we will regard them both as having the
* same value - i.e. a fixed area.
*/
class MinMaxAreaObject implements \JsonSerializable
{
/** @var null|AreaObject */
private $minimum;
/** @var nul... |
import 'package:built_value/built_value.dart';
import 'package:built_value/serializer.dart';
part 'diagnosis.g.dart';
abstract class Diagnosis implements Built<Diagnosis, DiagnosisBuilder>{
int get id;
String ? get symptoms;
String ? get date;
Diagnosis._();
factory Diagnosis([updates(DiagnosisBuilder b)]) = ... |
---
templateKey: about-page
path: /about
title: Vision
---
### Swell History
Prime surf conditions were a mysterious craft left to old carpy sages telling stories of epic waves. |
/* eslint-disable vars-on-top, no-param-reassign, no-extend-native */
//
// pushes support back to at least IE6
// --------------------------------------------------
export default () => {
// array
if (!Array.prototype.forEach) {
Array.prototype.forEach = function(callback, thisArg) {
thisArg = thisArg ... |
/*
* Copyright (c) 2018 Radiance Kormorant Kirill Grouchnikov. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice,
* ... |
<?php
namespace App\Containers\Plot\Tasks;
use App\Containers\Geo\Models\Polygon;
use App\Containers\Plot\Models\Plot;
use App\Ship\Parents\Tasks\Task;
use Illuminate\Support\Collection;
/**
* Class BuildPlotDataGeoJsonTask
*
* @author Sebastian Weckend <sebastian.weckend@posteo.de>
*/
class BuildPlotDataGeoJson... |
#!/bin/bash
mysql --user=root --password= < ./install.sql
php artisan migrate --seed
|
using System.IO;
namespace MatrixIO.IO.Bmff.Boxes
{
/// <summary>
/// Sample Size Box ("stsz")
/// </summary>
[Box("stsz", "Sample Size Box")]
public sealed class SampleSizeBox : FullBox, ITableBox<SampleSizeBox.SampleSizeEntry>
{
private uint _sampleCount;
public SampleSizeBo... |
package org.bitlap.common.conf
/**
* Mail: chk19940609@gmail.com
* Created by IceMimosa
* Date: 2021/5/30
*/
object Validators {
val NOT_BLANK = object : Validator<String> {
override fun validate(t: String?): Boolean {
return !t.isNullOrBlank()
}
}
}
|
$: << File.join(File.dirname(__FILE__), '..')
require 'rubygems'
require 'context'
require 'mocha'
require 'qype'
def mock_client(response_file)
response = File.read(response_file)
mock(:get => response)
end
|
program nestedfunctions;
function func1(x : integer) : integer;
var
y : integer;
z : real;
function func2(x : integer) : integer;
procedure func3;
begin
z := 7.2;
end;
begin
y := 3;
func2 := x * 2;
func3;
end; { func2 }
begin
y := 2;
func1 := func2(x);
wr... |
#!/bin/python
git checkout release
rm -rf roomai/doudizhupoker
rm tests/testDouDiZhuPoker*.py
python -m unittest discover -s tests
|
// eslint-disable-next-line object-curly-newline
import { ref, watch, inject, computed } from "@vue/composition-api"
import store from "@/store"
import { isNavGroupActive } from "@utils/layouts"
export default function useVerticalNavMenuGroup ( item ) {
// --------------------... |
select * from users;
-- UPDATE `csc317db`.`users`
-- SET
-- `username` = "testuser01"
-- WHERE -- IMPORTANT: WITHOUT THIS WILL UPDATE ALL
-- id = 2;
-- delete from `csc317db`.`users`
-- where
-- id = 2; |
package testdata
import io.ebean.Model
class Person extends Model {
var name: String = _
}
|
import { gql } from "@apollo/client";
export const FETCH_BOOKINGS = gql`
query FetchBookings($bookingsFilter: BookingsFilter) {
bookings(filter: $bookingsFilter) {
_id
name
noOfPeople
contactNumber
date
comment
confirmed
}
}
`;
|
def coding_problem_29(rle):
"""
Run-length encoding is a fast and simple method of encoding strings. The basic idea is to represent repeated
successive characters as a single count and character. Implement run-length encoding and decoding. You can assume
the string to be encoded have no digits and consi... |
# Change Log
## v1.0(2020/04/28)
发布初版本 |
package main
import "time"
var funcQueue = make(chan func(), 1<<10)
func initQueue() {
go execFuncs()
log.Info("initialize the function queue...")
}
func pushFunc(f func()) {
funcQueue <- f
}
func getFunc() func() {
return <-funcQueue
}
func execFuncs() {
for {
select {
case f := <-funcQueue:
f()
ca... |
#!/usr/bin/env bash
set -e
cd "$(dirname "${BASH_SOURCE[0]}")/.." # cd to enterprise/
echo "!!!!!!!!!!!!!!!!!!"
echo "!!! DEPRECATED !!!"
echo "!!!!!!!!!!!!!!!!!!"
echo "This script is deprecated!"
echo "Add your codegen tasks to 'sg generate' instead."
../dev/generate.sh
go list ./... | xargs go generate -x
|
from __future__ import print_function
from stompy.model.otps import read_otps, otps_model
from stompy import utils
import numpy as np
import six
six.moves.reload_module(utils)
six.moves.reload_module(read_otps)
six.moves.reload_module(otps_model)
read_otps.OTPS_DATA="data"
local_bin_path="/home/rusty/src/OTPS2"
def... |
#!/bin/sh
cc -g -std=gnu11 -c -DNQ_HACK -DQBASEDIR="\"/Users/patrickquin/qk/content\"" \
quake_swrTest.c -o bin/quake_swrTest.o \
-I../../include -I../fisheye -I.. &&
cc -g -std=gnu11 -c -DNQ_HACK \
../fisheye/fishcam.c -o bin/fishcam.o \
-I../../include -I../fisheye -I.. &&
cc -g -std=c11 -c ../fisheye/fishlens... |
import { Subject } from "rxjs";
import { take } from "rxjs/operators";
import { ObserverSpy } from "@hirez_io/observer-spy";
import { wipeDatabase } from "./wipeDatabase";
import { bulkCacheContent, bulkCacheDscContent } from "./promises";
import { content$, dscContent$, buildContentId } from "./observables";
import {... |
/**
* https://leetcode.com/problems/sort-list/
* merge sort list implementation based on NeetCode explanation https://www.youtube.com/watch?v=TGveA1oFhrc
**/
#ifndef MERGE_SORT_LIST_H
#define MERGE_SORT_LIST_H
/*
* Definition for singly-linked list.
*/
struct ListNode {
int val;
ListNode *next;
ListNode(... |
CREATE DATABASE magic_service_mgt;
USE magic_service_mgt;
CREATE TABLE IF NOT EXISTS `t_docker_image` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`owner` INT UNSIGNED NOT NULL COMMENT 't_user.id',
`image_name` varchar(50) not null comment 'Image Name',
`image_path` varchar(100) not null comment 'Image Path',... |
#ifndef NEPOMUK_ZMQ_PUBLISHER_HPP_
#define NEPOMUK_ZMQ_PUBLISHER_HPP_
#include <cstdint>
#include <zmq.hpp>
namespace nepomuk
{
namespace tool
{
namespace communication
{
template <class BaseClass> class ZMQPublisher
{
public:
ZMQPublisher(std::uint32_t port);
void publish();
private:
zmq::context_... |
import 'dart:html';
import 'package:undo/undo.dart';
void main() {
SimpleStack<int> stack;
final output = querySelector('#output');
final ButtonElement undoButton = querySelector('#undo');
final ButtonElement redoButton = querySelector('#redo');
stack = SimpleStack<int>(0, onUpdate: (val) {
output.text ... |
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ToolController : Singleton<ToolController>
{
private List<BaseTool> m_tools = new List<BaseTool>();
private BaseTool m_activeTool;
private BaseTool m_defaultTool;
public BaseToo... |
/**
* Node Modules
*/
var Promise = require('promise');
/**
* Library modules
*/
var getList = require('./getList');
var getDimensions = require('./getDimensions');
var getMeasures = require('./getMeasures');
var getBookmarks = require('./getBookmarks');
var getMediaList = require('./getMediaList');
var getSnapsho... |
# Обратная связь от devops
|
module UramonArticleViewer
module Articles
class Cell < ::Cell::Concept
include ::Cell::Haml
# Setup view path for cells in Rails Engine: https://github.com/apotonick/cells/issues/280
view_paths << UramonArticleViewer::Engine.root.join('app/concepts')
def recently_updated
@articl... |
<?php
namespace Deluxetech\LaRepo\Filters\Traits;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Validator;
trait SanitizesScalarValue
{
/**
* Sanitize a value that should be an array.
*
* @param mixed $value
* @return bool|int|float|string
*/
protected function sanit... |
---
name: "syncer Support"
about: "Requesting support for syncer Tool"
---
## syncer Support
Before submitting your issue, please check the requirements list below (all need to be met):
1. Upstream MySQL version (execute `SELECT @@version;` in a MySQL client)
- MySQL: 5.6 <= version < 5.7
- MariaDB: version... |
namespace MyWebtoonWebProject.Data.Repositories
{
using System.Linq;
using MyWebtoonWebProject.Data.Models;
public class WebtoonsSubscribersRepository : EfRepository<WebtoonsSubscribers>, IWebtoonsSubscribersRepository
{
public WebtoonsSubscribersRepository(ApplicationDbContext context)
... |
/*
* Copyright 2022 HM Revenue & Customs
*
* 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 a... |
extern crate piston_window;
use piston_window::*;
mod draw;
use draw::*;
mod game;
mod snakes;
fn main() {
let (block_width, block_height) = (90/2, 60/2);
let (window_width, window_height) = (to_coord(block_width), to_coord(block_height));
let mut window: PistonWindow = WindowSettings::new("Snakes!", [wi... |
include() {
[[ "$BASHER_INCLUDED_ONCE" == *"$1/$2"* ]] && return 0
local package="$1"
local file_name="$2"
if [ -z "$package" ] || [ -z "$file_name" ]; then
echo "Usage: include <package> <file>" >&2
return 1
fi
if [ ! -e "$BASHER_PREFIX/packages/$package" ]; then
echo "Package not installed: ... |
package chapter6;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class ShowSum1 {
public static void main(String[] args) throws FileNotFoundException {
Scanner input = new Scanner(new File("C:\\Users\\olivier.thas\\Downloads\\numbers.dat"));
double su... |
Spring Boot demonstration
=========================
SpringBoot CLI application that runs an endless loop and terminates gracefully
when receiveing a ctrl-c or TERM signal.
|
try:
1/0
except Exception as e:
print('e : ', e)
print(f"repr(e) : {repr(e)}")
|
#!/bin/sh
if [ ! -f kbdvar.txt ]; then
touch kbdvar.txt
echo 0 > kbdvar.txt
fi
var=`cat kbdvar.txt`
if [ $var -gt "255" ]; then
var=255
elif [ $var -lt "0" ]; then
var=0
fi
let "var=var+12"
echo "$var" > kbdvar.txt
cat kbdvar.txt > /sys/class/leds/spi\:\:kbd_backlight/brightness
... |
const mongoose = require('mongoose');
var productdetailsSchema=new mongoose.Schema({
productname:{
type:String
},
price: {
type: String
},
category: {
type: String
}
});
mongoose.model('productdetails', productdetailsSchema); |
#!/bin/bash
export FSHLVM_HOME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
sh $FSHLVM_HOME/build.sh
cd $FSHLVM_HOME
dotnet run -c Release --project $FSHLVM_HOME/src/FSHlvm.Cli/FSHlvm.Cli.fsproj
mv $FSHLVM_HOME/list.bc $FSHLVM_HOME/bin/
opt-3.8 -tailcallelim -O3 < $FSHLVM_HOME/bin/list.bc > $FSHLVM_HOME/bin/list... |
class Post < ActiveRecord::Base
include PublicActivity::Model
belongs_to :user
validates_presence_of :user_id, :content
auto_html_for :content do
html_escape
image
youtube(width: "100%", height: 250, autoplay: false)
link :target => "_blank", :rel => "nofollow"
simple_format
end
end |
package com.example.shinelon.wanandroid
import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.example.shinelon.wanandroid.helper.ActionFlag
import com.example.shinelon.wanandroid.utils.toast
import com.example.shinelon.wanandroid.presenter.LoginActivityPresen... |
unit EditConnectionDlg;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, Buttons,
StdCtrls, EditBtn, Spin, BaseDlg, ConnectionInfo;
type
{ TEditConnectionDialog }
TEditConnectionDialog = class(TBaseDialog)
btnTest: TBitBtn;
CkbRemoteServer: TCheck... |
module MageRecord
class Customer < EavRecord
self.table_name = :customer_entity
belongs_to :store
belongs_to :website
has_many :addresses, foreign_key: :parent_id
has_many :orders
def fullname
firstname_sql = "SELECT entity_varchar.value "+
"FROM customer_entity AS entity "+
... |
# frozen_string_literal: true
require "test_helper"
require "tempfile"
module Archimate
class CleanTest < Minitest::Test
def test_clean
removed_items = Tempfile.new("removed")
removed_items.close
cleaned_archimate = Tempfile.new("archimate")
cleaned_archimate.close
out, err = captu... |
require "codeclimate-test-reporter"
CodeClimate::TestReporter.start
require "bundler/setup"
require "citrix"
require "ostruct"
require "pathname"
require "minitest/utils"
require "minitest/autorun"
module Minitest
class Test
def serialize(attributes)
serializer.new(attributes: attributes).serialize
... |
import axios from 'axios';
const URL_BASE = process.env.REACT_APP_API_URL_BASE;
const patchUser = (user) => {
const accessTokenObj = localStorage.getItem('token');
const userId = user.id;
const payload = {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
Authorization: `Beare... |
package net.wrap_trap.goju
import akka.actor.ActorRef
import org.slf4j.LoggerFactory
import collection.JavaConversions._
import java.io.File
import java.io.FileOutputStream
import java.util
import java.util.TreeMap
import net.wrap_trap.goju.Constants.Value
import net.wrap_trap.goju.element.Element
import net.wrap_tr... |
To run behat, you'll possibly need, in your `php.ini` :
xdebug.max_nesting_level=200
Other than that, this is your average symfony2 bundle ; refer to symfony2's doc. |
# frozen_string_literal: true
require "spec_helper"
describe EveOnline::ESI::Models::Corporation do
it { should be_a(EveOnline::ESI::Models::Base) }
let(:options) { double }
subject { described_class.new(options) }
describe "#initialize" do
its(:options) { should eq(options) }
end
describe "#as_js... |
<?php
/**
*
*/
class User extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->model('M_user');
if($this->session->userdata('role') == null){
redirect('Login');
}
$this->load->model('M_user');
}
function acount(){
$this->load->model('M_daerah');
$data['tit... |
<?php
namespace App\Repositories\Authorization;
use App\Entity\Repositories\IEndpointRepository;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityRepository;
use App\Entity\Authorization\Notification\NotificationLog;
class NotificationLogRepository implements IEndpoint... |
<?php
require_once '_includes/class.CountryDAO.php';
class CountriesPage
{
private $template = '';
private $smarty;
private $countryDAO;
public function __construct()
{
$this->countryDAO = CountryDAO::getInstance();
}
public function processRequest($action, $countryID, $s... |
#ifndef TEST1_H
#define TEST1_H
void test1();
#endif // TEST1_H
|
using System.ComponentModel.DataAnnotations.Schema;
using Ccr.Std.Core.Extensions;
using JetBrains.Annotations;
namespace podcache.Data.Domain
{
public class ShowHost
{
public int ShowHostID { get; set; }
public int ShowID { get; set; }
[ForeignKey("ShowID")]
public Show Show { get; set; }
pu... |
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
use App\Models\Profile;
use App\Http\Requests\AddressRequest;
class UserAddressController extends Controller
{
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function inde... |
---
layout: single
title: "Music and Video Compositions"
permalink: /compositions/
author_profile: true
toc: true
toc_sticky: true
---
## 当《火箭少女》遇到红白机
Source: [bilibili](https://www.bilibili.com/video/BV1As411p7Eq?zw)
{% include video id="BV1As411p7Eq" provider="bilibili" %}
<br />
## 《创造101主题曲》钢琴独奏
Source: [bilibi... |
package com.github.nwillc.kretry
import com.github.nwillc.kretry.Config.Companion.DEFAULT_ATTEMPTS
import com.github.nwillc.kretry.Config.Companion.DEFAULT_DELAY
import com.github.nwillc.kretry.Config.Companion.DEFAULT_DELAY_MILLIS
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test
imp... |
package seedu.address.itinerary.model;
import seedu.address.itinerary.model.event.Date;
import seedu.address.itinerary.model.event.Description;
import seedu.address.itinerary.model.event.Event;
import seedu.address.itinerary.model.event.Location;
import seedu.address.itinerary.model.event.Tag;
import seedu.address.iti... |
---
layout: photo
title: Cherry Blossom
location: Corvallis, OR
---
<img src="/assets/img/flowers/cherry-blossoms.jpg" />
|
/**
* Created by 李 on 2017/3/27.
*/
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from "@angular/router";
import {ProjectService} from "../../service/project.service";
@Component({
moduleId: module.id,
selector: 'project-index',
templateUrl: 'project-index.component.html'
})
export c... |
package com.project.onex
import android.content.Context
import android.content.SharedPreferences
import android.preference.PreferenceManager
class AppPreferences(private val context: Context) {
private val prefs: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context)
private val URL_IS_OPENED... |
Material Design Color - Pink
==========
Visit [here](http://sipapp.io/p/?id=10304) to check the actual palette in your browser. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.