text stringlengths 27 775k |
|---|
<?php namespace App\Controllers\Admin;
use Article;
use View;
use Input;
use Response;
use Request;
use Redirect;
use Carbon\Carbon;
class ArticlesController extends \BaseController {
/**
* Display a listing of the resource.
* GET /articles
*
* @return Response
*/
public function index()
{
$articles ... |
package main
import (
"fmt"
"strconv"
"strings"
)
type Divided struct {
Position int
Remainder int
}
func fractionToDecimal(numerator int, denominator int) string {
isNavigate := false
if numerator == 0 {
return "0"
}
if numerator < 0 {
numerator = -numerator
isNavigate = !isNavigate
}
if denominat... |
package com.rationalworks.pdfmaker;
import java.io.File;
import java.io.IOException;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
import com.fasterxml.jackson.databind.JsonNode;
import com.rationalworks.pdfcharts.PCVegaLoa... |
package me.thesilverecho.zeropoint.api.uiv2;
import net.minecraft.client.util.math.MatrixStack;
import java.util.ArrayList;
public class Pane extends Component
{
//list of components that will be used.
private final ArrayList<Component> components = new ArrayList<>();
public Pane(float x, float y, float w, float... |
<?php
error_reporting(E_ALL);
require ("classes/kd_master.class.php");
require ('classes/kd_install.class.php');
if (!is_dir(CONFIG_PATH)) {
mkdir(CONFIG_PATH, 0755);
}
session_start();
$INSTALL = new kd_install();
$INSTALL->interpreter();
include ('tpl/header.php');
if ($INSTALL::get_tpl() != "") {
includ... |
class Day21(val input: List<String>) {
private val positionPlayerOne: Int = input[0].removePrefix("Player 1 starting position: ").toInt()
private val positionPlayerTwo: Int = input[1].removePrefix("Player 2 starting position: ").toInt()
private fun HashMap<Game, Long>.addCount(game: Game, count: Long) {
... |
package types
type TcpSocketInfo struct {
Protocol string
LocalIP string
LocalPort string
RemoteIP string
RemotePort string
State string
User string
Pid int32
ProgramName string
}
type UdpSocketInfo struct {
Protocol string
LocalIP string
LocalPort string
Remote... |
module.exports = createTask
function createTask (pliers) {
pliers('lintCss', function (done) {
var files = __dirname + '/../assets/css'
if (typeof process.argv[ 3 ] !== 'undefined') {
files += '/' + process.argv[ 3 ] + '.css'
}
pliers.exec(__dirname + '/../../node_modules/csslint/cli.js ' + f... |
define(['jquery'], function($) {
// click on the next tab
$('#elgg-groups-edit-footer-navigate-next').on('click', function() {
$('.elgg-form-groups-edit .elgg-components-tabs .elgg-state-selected').next().find('> a').click();
});
// switch button banks
$('.elgg-form-groups-edit .elgg-components-tab > a').on('c... |
# -*- coding: utf-8 -*-
"""The top-level package for ``django-mysqlpool``."""
# These imports make 2 act like 3, making it easier on us to switch to PyPy or
# some other VM if we need to for performance reasons.
from __future__ import (absolute_import, print_function, unicode_literals,
division)... |
package com.imgui
import cimgui.internal.*
import cimgui.internal.ImVec2
import cimgui.internal.ImVec4
import java.io.*
import java.util.*
import kotlin.reflect.*
// Use this for temp values.
internal object ImGuiTemps {
val imVec2Stack: Stack<ImVec2> = Stack()
val imVec4Stack: Stack<ImVec4> = Stack()
}
internal f... |
#!/bin/bash
DOCKER_ORG="aethercloud"
if [[ -z "${CI}" ]]; then
echo "This script is for running in the CI only!"
exit 1
fi
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Build images
docker build -t $DOCKER_ORG/aether .
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Failed to build a... |
--+ holdcas on;
set names utf8;
create table list_test(id int,
test_char char(50) collate utf8_tr_cs,
test_varchar varchar(2000) collate utf8_tr_cs,
test_bit bit(16),
test_varbit bit varying(20),
test_nchar nchar(50) collate utf8_tr_cs,
test_nvarchar nchar varying(2000) collate utf8_tr_cs,
test_str... |
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/applica... |
exports.up = function(knex, Promise) {
return knex.schema.createTable('feedbacks', function(table) {
table.increments('id').primary().index();
table.integer('rating').notNullable().index();
table.string('target').notNullable().index();
table.string('ip_address').notNullable().index();
table.timest... |
---
title: 'First Post - Introduction'
date: 2019-01-29
author: 'Brix'
path: '/first-post'
---
Welcome to my Blog |
%%
%% A cryptopp wrapper for Erlang
%% This library uses NIF functions to link to a CryptoPP shared library
%%
%% Author: David Ellefsen <davidellefsen@gmail.com>
%%
%% Copyright 2015 David Ellefsen
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance w... |
//!
//! https://tools.ietf.org/html/rfc5161
//!
//! The IMAP ENABLE Extension
//!
use nom::{
bytes::streaming::tag_no_case,
character::streaming::char,
combinator::map,
multi::many0,
sequence::{preceded, tuple},
IResult,
};
use std::borrow::Cow;
use crate::parser::core::atom;
use crate::types:... |
function errcho() {
echo "$@" 1>&2;
}
function roombash_on_load() {
echo "RoombaSH has loaded correctly"
}
function roombash_cleanup() {
if [ ! -f ".cleanup" ]; then
echo ".cleanup not found. Creating..."
touch .cleanup
return
fi
FILES=$(cat .cleanup)
echo "Roomb... |
<?php echo $__env->make('master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
<div class="container">
<div class="page-header">
<h2>Search Books</h2>
</div>
<div class="jumbotron" id="filter-box">
<div class="container">
<div class="f... |
// file : libbuild2/lexer.test.cxx -*- C++ -*-
// license : MIT; see accompanying LICENSE file
#include <cstdlib> // strtoul()
#include <cassert>
#include <iostream>
#include <libbuild2/types.hxx>
#include <libbuild2/utility.hxx>
#include <libbuild2/token.hxx>
#include <libbuild2/lexer.hxx>
using namespace s... |
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:mustache/mustache.dart' as mustache;
import 'base/common.dart';
import 'base/file_system.dart';
import 'cache.dart';
import 'globals.dart... |
import socket
import subprocess
import sys
from datetime import datetime
import time
import random
import math
import concurrent.futures
from .PortScanResponse import PortScanResponse
class ThreadedPortScanner(object):
def __init__(self):
try:
server_address = input('Host address: ')
... |
SECTION code_clib
PUBLIC heapfree
PUBLIC _heapfree
; fastcall
.heapfree
._heapfree
ex de, hl
jp 0xb884
|
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
namespace Microsoft.Azure.Management.Intune.Tests.Helpers
{
/// <summary>
/// Constants with name starting with Default are Default property values when ... |
use crate::Config;
use anyhow::Result;
use std::{
cmp,
io,
pin::Pin,
task::{Context, Poll, Waker},
sync::{Arc, Mutex}
};
use tokio::io::{AsyncRead, AsyncWrite};
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use wasm_bindgen_futures::spawn_local;
use web_sys::{ErrorEvent, MessageEvent, WebS... |
// Copyright (c) SimpleIdServer. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.
using SimpleIdServer.OAuth.Api.Token.TokenBuilders;
using SimpleIdServer.OAuth.DTOs;
using SimpleIdServer.OAuth.Extensions;
using System.Collections.Generic;... |
using covidtracking.Entities;
namespace covidtracking.Database
{
public interface IStatisticsDb
{
void InitStatisticsDb();
Statistics GetCurrentStatistics();
void UpdateHealed();
void UpdateIsolated(char operation);
void UpdateCityInfected(string city, char operation);
... |
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace Growth.IO
{
public class FileHelper
{
/// <summary>
/// 创建文件
/// </summary>
/// <param name="fileName">要创建的带路径的文件名,例如:path = @"D:\test.txt"</param>
public static void CreateIfN... |
package GenreEntity
import (
"github.com/gorilla/mux"
"net/http"
"strings"
"be/Database"
"be/HyperText"
)
//-------------------------------- ADM --------------------------------//
func (c *GenreController) Insert(w http.ResponseWriter, r *http.Request) {
var ge Genre
if err := HyperText.BodyValidate(r, &ge); e... |
<?php
/**
* @author : JIHAD SINNAOUR
* @package : Apaapi
* @version : 1.0.9
* @copyright : (c) 2019 - 2021 Jihad Sinnaour <mail@jihadsinnaour.com>
* @link : https://jakiboy.github.io/apaapi/
* @license : MIT
*
* This file if a part of Apaapi Lib
*/
namespace Apaapi\lib;
use Apaapi\interfaces\Re... |
class Ice < ActiveRecord::Base
include ImportHandler
include AssistShared::CSV::Ice
include AssistShared::Validations::Ice
belongs_to :observation
belongs_to :thin_ice_lookup, :class_name => IceLookup
belongs_to :thick_ice_lookup, :class_name => IceLookup
belongs_to :open_water_lookup
def as_json opts... |
import { Plugins } from '@capacitor/core';
const { Storage } = Plugins;
export async function setUser(username: string) {
await Storage.set({
key: 'username',
value: username,
});
}
export async function getUser() {
const value = await Storage.get({ key: 'username' });
return value;
}
export async fu... |
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####... |
---
layout: post
title: "Cracking the coding interview--Q3.1"
author: "Hawstein"
header-style: text
tags:
- Algorithm
- CC150
---
## 题目
原文:
Describe how you could use a single array to implement three stacks.
译文:
你如何只用一个数组实现三个栈?
## 解答
我们可以很容易地用一个数组来实现一个栈,压栈就往数组里插入值,栈顶指针加1;
出栈就直接将栈顶指针减1;取栈顶值就把栈顶指针指向的单元的值返回;
判... |
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
std::vector<std::string> readIntoArray( char* file ) {
std::vector<std::string> array;
std::ifstream ifile( file );
if ( !ifile ) {
std::cerr << "Could not open '" << file << "'!\n";
return array;
}
std::string nextLine;
... |
#! /bin/bash
# This should be chmod +x and set in your crontab:
# @reboot /root/set_cpu_to_performance.sh
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
for file in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do echo "performance" > $file; done
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_go... |
package main
import (
"time"
)
func main() {
c := make(chan bool, 1)
//每3秒后读chan数据
go func() {
time.Sleep(time.Second * 3)
v := <-c
println("recv ", v)
}()
//第一次写,会成功, 因为有缓冲1
select {
case c <- true:
println("send ok")
default:
println("full!")
}
//此时chan已满,因为还没有读出数据
select {
case c <- true:... |
class Bouncer::Session
include Virtus.model
attribute :token, Bouncer::Token
attribute :refresh, String
attribute :checked_at, DateTime
delegate :valid?, :payload, :header, to: :token
def refreshable?
refresh.present?
end
def refresh!
return unless refreshable?
oauth_token.refresh!.tap ... |
package de.fhg.iais.roberta.expr;
import org.junit.Assert;
import org.junit.Test;
import de.fhg.iais.roberta.AstTest;
import de.fhg.iais.roberta.syntax.lang.expr.Assoc;
import de.fhg.iais.roberta.syntax.lang.expr.StringConst;
import de.fhg.iais.roberta.util.test.UnitTestHelper;
public class StringConstTest extends A... |
import axios from 'axios';
import { useSelector } from 'react-redux';
import ENDPOINT_URL from '../../Interfaces/ENDPOINT_URL';
import { State } from '../reducers';
import { ProductState } from './store';
export const RECEIVE_PRODUCT = 'receive_product';
export const RESET_PRODUCT_STATE = 'reset_product_state';
expor... |
<?php
namespace Module\Forum\Service\Admin;
use Domain\Model\SearchModel;
use Module\Forum\Domain\Model\ForumModel;
use Module\Forum\Domain\Model\ThreadModel;
use Module\Forum\Domain\Model\ThreadPostModel;
class ThreadController extends Controller {
public function indexAction($keywords = null, $forum_id = 0) {
... |
<?php
define('DOCUMENT_ROOT','/var/www/html/nextstep');
?>
|
// Copyright 2010-2018 Google LLC
// 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... |
package eu.slomkowski.octoglow.octoglowd.daemon
import com.sun.management.OperatingSystemMXBean
import com.uchuhimo.konf.Config
import eu.slomkowski.octoglow.octoglowd.hardware.DacChannel
import eu.slomkowski.octoglow.octoglowd.hardware.Hardware
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.coroutine... |
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe 'Strava::Api::Client#create_activity', vcr: { cassette_name: 'client/create_activity' } do
include_context 'API client'
it 'creates an activity' do
activity = client.create_activity(
name: 'strava-ruby-client activity',
type: 'Run'... |
#!/bin/bash
set -e
download_files=http://sourceforge.net/projects/vtigercrm/files/
declare -A versions
versions=(
["7.1.0"]=main*5.6.40*vtiger%20CRM%207.1.0/Core%20Product/vtigercrm7.1.0.tar.gz
["7.1.0-RC"]=main*5.6.40*vtiger%20CRM%207.1.0%20RC/Core%20Product/vtigercrm7.1.0rc.tar.gz
["7.0.1"]=main*5.6.... |
import Test.HUnit
import qualified COMP304A1 as A1
countTest1 = TestCase ( assertEqual "Count should be 4 for 1 in [1,1,1,1]"
(A1.count 1 [1,1,1,1]) 4)
countTest2 = TestCase ( assertEqual "Count should be 0 for 1 in [2,3,4,5]"
(A1.count 1 [2,3,4,5]) 0)
countTest3 = Tes... |
<?php
require_once __DIR__."/../../Conn.php";
require_once __DIR__."/../../Result.php";
$grades = $conn->query("SELECT * FROM `grades`");
$isvalid = false;
if (isset($_GET['grade_id'])) {
$grade_id = $_GET['grade_id'];
//Validate Grade id
$stmt = $conn->prepare("SELECT * FROM `grades` WHERE `id`=?");
... |
from threading import Thread
import time
a = 0 # global variable
def thread1(threadname):
global a
for k in range(100):
print("{} {}".format(threadname, a))
time.sleep(0.1)
if k == 5:
a += 100
def thread2(threadname):
global a
for k in range(50):
a += 1
... |
# Introduction
* CNN_logs: 存放训练基于CNN的问题相似度模型时产生的Tensorboard日志
|
import sbt._
import Keys._
import sbtassembly.AssemblyPlugin.autoImport._
import xml.{NodeSeq, Node => XNode, Elem}
import xml.transform.{RuleTransformer, RewriteRule}
object Shade {
val shadePrefix = "gigahorse.shaded.ahc"
val ShadeSandbox = config("shade").hide
def ahcShadeSettings: Seq[Setting[_]] =
inCo... |
<?php
namespace backend\controllers;
use backend\soap\UrlStatusSoap;
use yii\filters\AccessControl;
use yii\filters\VerbFilter;
use yii\web\Controller;
class SoapEndpointController extends Controller
{
public $enableCsrfValidation = false;
public function behaviors()
{
return [
'ac... |
class RenameCommentsToStaffCommentsInCodingQuestions < ActiveRecord::Migration
def up
rename_column :coding_questions, :comments, :staff_comments
end
def down
end
end
|
'use strict';
const
precon = require('@mintpond/mint-precon'),
pu = require('@mintpond/mint-utils').prototypes,
Category = require('./class.Category'),
argParser = require('./service.argParser'),
cmdParser = require('./service.cmdParser'),
Commands = require('./class.Commands.js');
class Comm... |
(function(exports) {
'use strict';
/**
* Allowable font sizes for header elements.
*/
var HEADER_SIZES = [
16, 17, 18, 19, 20, 21, 22, 23
];
/**
* Utility functions for measuring and manipulating font sizes
*/
var FontSizeUtils = {
/**
* Keep a cache of canvas contexts with a giv... |
package pubsub
import (
"context"
"flag"
"os"
"testing"
)
var url = flag.String("url", "amqp:///", "AMQP url for both the publisher and subscriber")
// exchange binds the publishers to the subscribers
func TestPubSub(t *testing.T) {
ctx, done := context.WithCancel(context.Background())
go func() {
publish(... |
package com.guru.composecookbook.ui.demoui.tiktok
sealed class TikTokScreen(val route: String) {
object Home : TikTokScreen("Home")
object Discover : TikTokScreen("Discover")
object Create : TikTokScreen("Create")
object Inbox : TikTokScreen("Inbox")
object Me : TikTokScreen("Me")
object Profil... |
package longpham.giphy.models
import com.giphy.sdk.core.models.Image
import com.giphy.sdk.core.models.Images
import com.giphy.sdk.core.models.Media
import junit.framework.TestCase.*
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.runners.JUnit4
import org.mockito.Mockito.`when`
import org.mockit... |
import sys,copy
from utils import dihedral, angle, dat2distribution, distance
from Types import *
from Molecule import MoleculeClass
from AtomTypeClassifier import AtomTypeClassifier
from TorsionAssigner import TorsionAssigner, TORSION_GROUP
class StatClass:
def __init__(self):
self.atype_counts = [0 for ... |
<?php
/**
* HTML2PDF Librairy - example
*
* HTML => PDF convertor
* distributed under the LGPL License
*
* @author Laurent MINGUET <webmaster@html2pdf.fr>
*
* isset($_GET['vuehtml']) is not mandatory
* it allow to display the result in the HTML format
*/
//... |
class ApplicationController < ActionController::Base
add_flash_types :success, :warning, :danger, :info
before_action :set_current_user
before_action :set_wards
private
def set_current_user
Current.user = current_user if current_user.present?
end
def set_wards
@wards = Ward.where(show_on_homep... |
/****
* Wrapper for Database Methods
*/
import mongoose from "mongoose";
mongoose.Promise = global.Promise;
/****
* DB Settings
*/
import {
TEST_ACCOUNT_USER_DB_ADMIN,
TEST_ACCOUNT_PRODUCT_DB_ADMIN,
DB_MAX_POOL_SIZE
} from "../../../src/util/secrets";
/****
* Database Connections
*/
... |
// @flow
import React from "react";
import { withStyles } from "@material-ui/core/styles";
import SplitPane from "react-split-pane";
import CircularProgress from "@material-ui/core/CircularProgress";
import ReactResizeDetector from "react-resize-detector";
import { withState } from "../../utils/State";
import TopBar fr... |
package org.egzi.nn.applications;
import javafx.util.Pair;
import org.egzi.math.DenseVector;
import org.egzi.nn.elements.classic.NeuralLayer;
import org.egzi.nn.elements.classic.Perceptron;
import org.egzi.nn.elements.classic.train.Algorithm;
import org.egzi.nn.elements.classic.train.Backpropagation;
import org.egzi.... |
@model IPagedList<BasicUPMS.Areas.Performance.Models.StaffModel>
@{
Layout = "~/Views/Shared/_ItemsPartialLayout.cshtml";
}
@section Head
{
<th>网格员名称</th>
<th>联系方式</th>
<th>签到时间</th>
<th>签到状态</th>
}
@section Items
{
@foreach (var item in Model)
{
<tr class="hover">
<t... |
<?php
defined('BASEPATH') or exit('No direct script allowed');
/**
* Control User
*/
class Report extends MY_Controller
{
function __construct()
{
parent::__construct();
$this->load->sharedModel('AuthModel');
$this->load->sharedModel('SalesModel');
$this->load->library('pdf');
if (!$this->AuthModel->logge... |
import { ITool } from 'vortex-api/lib/types/ITool';
import { ITableAttribute } from 'vortex-api/lib/types/api';
export const STEAMAPP_ID = 620980;
export const tools : ITool[] = [
{
id: 'ma',
name: 'Mod Assistant',
shortName: 'Mod Assistant',
executable: () => 'ModAssistant.exe',
... |
using System.Linq;
using BenchmarkDotNet.Attributes;
using Challenges.Challenges;
namespace Challenges.Benchmarks
{
public class IfVsDictBlocksBench
{
readonly char[] _one;
readonly char[] _oneMillionChars;
readonly char[] _oneThousandChars;
public IfVsDictBlocksBench()
{
_... |
---
layout: inner
position: right
title: 'Snifter'
date: 2018-08-11 11:21:00
categories: development
tags: JavaScript Angular API
featured_image: '/img/posts/snifter.png'
project_link: 'https://github.com/ksavietta/cocktail_app_frontend'
button_icon: 'github'
button_text: 'Visit Project'
lead_text: 'A cocktail recipe g... |
using System;
using System.IO;
namespace FromFileTime
{
class Class1
{
static void Main(string[] args)
{
System.Console.WriteLine("Enter a file's path");
string filePath = System.Console.ReadLine();
System.IO.FileInfo fInfo;
try {
fInfo = new System.IO.FileInfo(filePath);
}
... |
#pragma once
#include "MemoryOverrides.h"
namespace TritonRuntime
{
const int MaxInterpProbes = 16;
enum class ProbeInterpInfo
{
Used,
Unassigned,
RejectedByGeometricTests,
RejectedInWall,
RejectedWeightTooSmall,
RejectedTooMany,
RejectedComputeParam... |
package com.faob.motionlayoutcarousel
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
class MainActi... |
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Sherlock::Collection::Files do
def filtered_by_initialize(filter = {:only => /lines/})
text_files(filter)
end
describe "#initialize" do
it "creates an collection of all text files" do
files = text_files
files.sho... |
let gridList: Array<object> = [
{
title: "Alipay",
desc: "那是一种内在的东西, 他们到达不了,也无法触及的",
src: "../../../static/icon/alipay.png",
user: "科学搬砖组",
time: "9小时前",
},
{
title: "Angular",
desc: "希望是一个好东西,也许是最好的,好东西是不会消亡的",
src: "../../../static/icon/angul... |
package day24
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestGridFromString(t *testing.T) {
g := GridFromString(`....#
#..#.
#..##
..#..
#....`)
assert.Equal(t, 5, g.width)
assert.Equal(t, 5, g.height)
assert.True(t, g.hasBug(2, 3))
assert.False(t, g.hasBug(2, 4))
}
func TestSimulateOnce... |
package com.zetcode;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
// time servers come and go; we might need to
// find a functioning server on https://www.ntppool.org/en/
public class SocketTimeClient {
public static void main(String[] args) throws IOException {
... |
/*
Copyright 2019 Konstantin Vasilev (burmuley@gmail.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/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... |
package cz.vutbr.fit.xflajs00.fyo
import kotlin.math.PI
import kotlin.math.abs
import kotlin.math.pow
import kotlin.math.sin
@Suppress("NonAsciiCharacters", "PropertyName", "PrivatePropertyName", "LocalVariableName")
/**
* Calculation of Fraunhofer Diffraction in far field
*/
class FraunhoferDiffraction {
val π... |
FactoryBot.define do
factory :timeline_note, class: 'Timeline::Note' do
note { 'MyText' }
end
end
|
import sbt.Command
/**
* @author 梦境迷离
* @since 2022/1/15
* @version 1.0
*/
object Commands {
val FmtSbtCommand = Command.command("fmt")(state => "scalafmtSbt" :: "scalafmt" :: "test:scalafmt" :: state)
val FmtSbtCheckCommand =
Command.command("check")(state => "scalafmtSbtCheck" :: "scalafmtCheck" :: "te... |
module Main where
import Control.Applicative ((<$>))
import Control.DeepSeq
import Control.Exception (evaluate)
import Control.Monad.IO.Class (liftIO)
import Criterion.Main
import Data.Hashable
import Data.List (foldl')
import Data.Foldable (foldlM)
import Data.Maybe
import System.Random
import System.IO.Unsafe
impor... |
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:bewell_pro_core/domain/clinical/entities/patient_vital.dart';
import 'package:bewell_pro_core/domain/core/entities/common_behavior_object.dart';
import 'package:bewell_pro_core/domain/core/value_objects/asset_string... |
(defpackage :cp/test/euler-tour
(:use :cl :fiveam :cp/euler-tour)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/euler-tour)
(in-suite base-suite)
(test make-euler-tour
;; out-tree representation
(multiple-value-bind (tour pre post)
(make-euler-tour #((1.1 2.1) (3.1) (4.1) () ()) :key #'... |
<?php
namespace EscolaLms\AssignWithoutAccount\Http\Requests;
use EscolaLms\AssignWithoutAccount\Enums\UserSubmissionStatusEnum;
use Illuminate\Support\Facades\Gate;
use Illuminate\Validation\Rule;
class UserSubmissionUpdateRequest extends UserSubmissionRequest
{
public function authorize(): bool
{
$... |
!----------------------------------------------------------------------------
!BOP
!
! !MODULE: GSI_NSTCouplerMod ---
!
! !DESCRIPTION: This stub provides the default interfaces to the
! NST analysis calculations in GSI.
!
! !REVISION HISTORY:
!
! 07Oct2011 Akella/RT - Initial code
! 05Mar2012 Akell... |
use chrono::DateTime;
use std::collections::HashMap;
use crate::{
de::{Event, EventData},
mappers::{
cef_map::CefMap,
load_mapping,
EventMappingGetters,
},
cef::utils::*,
};
type CefObject = HashMap<String, String>;
const EMPTY_STRING: String = String::new();
pub(crate) fn b... |
use super::*;
use anyhow::*;
use std::path::PathBuf;
pub const WORKSPACE: &str = "Workspace.toml";
#[derive(Clone, Default, Debug)]
pub struct Workspace {
name: String,
pub local_outputs_root: PathBuf,
pub local_rules_root: PathBuf,
pub local_sandbox_root: PathBuf,
pub local_toolchains_root: PathB... |
export interface Clients {
id: number;
name: string;
lastName: string;
email: string;
age: string;
genre: string;
lat: number;
long: number;
distance: string;
city: string;
country: string;
postalCode: string;
phone: string;
income: number;
status: string;
} |
import { createPromptModule, QuestionCollection } from "inquirer";
const Prompt = createPromptModule();
export const prompt = async (questions: QuestionCollection) => {
const result = await Prompt(questions);
return result;
};
|
using ProMama.ViewModels.Home;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace ProMama.Views.Home
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class HomeDetail : ContentPage
{
public HomeDetail()
{
InitializeComponent();
BindingContex... |
package spendthrift.web
import cats.*
import cats.implicits.*
import io.circe.*
import natchez.*
import org.http4s.*
import org.http4s.circe.*
import org.http4s.dsl.*
object codec:
final val defaultPrinter: Printer = Printer(
dropNullValues = true,
indent = ""
)
given circeEncoder[F[_], A: Encoder]... |
package gov.cms.qpp.conversion.model.error;
import static com.google.common.truth.Truth.assertThat;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import org.junit.jupiter.api.Test;
import nl.jqno.equalsverifier.EqualsVerifier;
import nl.jqno.equalsverifier.Warning;
class LocationTest {
@T... |
/*
* Copyright 2015 Alexey Andreev.
*
* 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... |
// { Driver Code Starts
#include<iostream>
#include<stack>
using namespace std;
void push(stack<int>& s,int a);
bool isFull(stack<int>& s,int n);
bool isEmpty(stack<int>& s);
int pop(stack<int>& s);
int getMin(stack<int>& s);
//This is the STL stack (http://quiz.geeksforgeeks.org/stack-container-adaptors-the-c-standard... |
using SimpleECS.Core.Common;
namespace SimpleECS.Core.Components {
public sealed class DamageComponent : IComponent {
public int Damage { get; private set; }
public DamageLayer Layer { get; private set; }
public bool Persistent { get; private set; }
public DamageComponent Init(int dam... |
/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.work.problem')
.controller('ProblemCtrl', ProblemCtrl);
/** @ngInject */
function ProblemCtrl($scope, $sce,$element, layoutPaths, baConfig) {
$scope.someUrl = $sce.trustAsResourceUrl... |
# import base64
# import pickle
#
# from django.shortcuts import render
#
# # Create your views here.
# from rest_framework.response import Response
#
# from rest_framework.views import APIView
#
# from carts.serializers import CartSerializer
# from django_redis import get_redis_connection
#
# class CartAPIView(APIView... |
//! Find a `ValueView` nested in an `ObjectView`
use std::fmt;
use std::slice;
use crate::error::{Error, Result};
use kstring::KStringCow;
use super::ScalarCow;
use super::Value;
use super::ValueCow;
use super::ValueView;
/// Path to a value in an `Object`.
///
/// There is guaranteed always at least one element.
#... |
<?php
/* Module Title */
echo __('File Storage');
/* config/Modules/FileStorage/config/config.dist.json */
/* Module Alias */
echo __('File Storage');
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.