text
stringlengths
27
775k
package nice.fontaine.overpass.models.query.filters; import nice.fontaine.overpass.models.query.settings.Filter; import org.junit.Test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; public class TagsTest { @Test public void shouldCrea...
# Minio on a Raspberry Pi * [Minio on a Raspberry Pi 3 with Raspbian (Debian Jessie 8.0)](https://goo.gl/BqjWHn) * [Minio Quickstart Guide](https://github.com/minio/minio/blob/master/README.md) * [Distributed Minio Quickstart Guide](https://github.com/minio/minio/blob/master/docs/distributed/README.md) ```sh if [ ! ...
pub fn build() { let api_uri_base = "https://api.guildwars2.com/v2/"; }
package org.stepic.droid.core.presenters import org.stepic.droid.concurrency.IMainHandler import org.stepic.droid.core.presenters.contracts.SectionsView import org.stepic.droid.model.Course import org.stepic.droid.model.Section import org.stepic.droid.store.operations.DatabaseFacade import org.stepic.droid.web.IApi im...
import _execFn from './_execFn'; const _join = _execFn('join'); export default _join;
package com.github.jsonzou.jmockdata.mocker; import com.github.jsonzou.jmockdata.DataConfig; import com.github.jsonzou.jmockdata.MockException; import com.github.jsonzou.jmockdata.Mocker; import com.github.jsonzou.jmockdata.util.DateTool; import com.github.jsonzou.jmockdata.util.RandomUtils; import java.text.ParseExc...
use std::io::net::ip::{SocketAddr, IpAddr, Port}; use std::sync::{Arc, RWLock}; use std::collections::HashMap; use http::server::{Config, Request, ResponseWriter}; use http::server::Server as HttpServer; use middleware::MiddlewareStack; use request; use response; use mustache; pub struct Server { middleware_stac...
from setuptools import setup setup( name='flask-test-requests-client', version='0.2.1', description='A Flask test client which replicates the requests interface.', long_description="""Instead of using the flask test client, you can use this package which does a similar job. This wrapper to the flask te...
# # Cookbook:: tor # Recipe:: python # # Copyright:: 2017, Grafeas Group, Ltd., All Rights Reserved. include_recipe 'yum-ius::default' yum_package %w[python34 python34-devel] do action :install end remote_file '/tmp/get-pip.py' do source 'https://bootstrap.pypa.io/get-pip.py' action :create end execute 'pyth...
package aws /** * Panther is a scalable, powerful, cloud-native SIEM written in Golang/React. * Copyright (C) 2020 Panther Labs Inc * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation...
import React, { useState } from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faBars, faShoppingCart } from '@fortawesome/free-solid-svg-icons'; import { Link } from 'react-router-dom'; import Logo from '../logo'; import NavBar from '../navBar'; import Style from './style.css'; imp...
module DealsHelper def render_description(description) description.gsub(/€/, t('currency')).html_safe end end
package com.denofprogramming.mycoroutineapplication.shared.uilt import timber.log.Timber fun logMessage(msg: String){ Timber.i ("Running on: [${Thread.currentThread().name}] | $msg") }
# Wonderflow The code implements a list of tasks about string parsing for a specific type of data following the Kata methodology. The code can be downloaded and directly executed without the need of importing any packages. It is a single file that contains all the required functions. Choose the environment you prefer...
#!/bin/bash ###### # # HOW TO USE !!!!!! # # just run: #./denoiseAndAnalyse.sh --median 2 img/noise-color/lena-impulse3.bmp img/color/lena.bmp # # ###### if [ -f analysis.txt ]; then rm analysis.txt fi echo >> analysis.txt echo Applying $1 with strengh $2 on $3 >> analysis.txt out/./image-manipulator $1 $2...
import 'dart:math'; import 'package:aoc_day/model.dart'; import 'package:aoc_day/parser.dart'; class Snailfish { final List<SnailfishNumber> numbers; Snailfish(List<List<dynamic>> input) : numbers = parseInput(input); int call() { // largest magnitude int largest = 0; int sumsDone = 0; List<Sn...
module Main where import Preamble import Prelude (putStrLn, foldl) import Control.Exception (bracket) import Data.Acid (openLocalState) import Data.Acid.Local (createArchive, createCheckpointAndClose) import Data.Kibr.Configuration import Data.Kibr.State import System.Console.GetOpt import Syste...
package org.sagebionetworks.repo.model; import org.sagebionetworks.repo.model.AuthorizationConstants.BOOTSTRAP_PRINCIPAL; public class AuthorizationUtils { public static boolean isUserAnonymous(UserInfo userInfo) { return isUserAnonymous(userInfo.getId()); } public static boolean isUserAnonymous(UserGroup ug...
# Announce: Rakudo compiler, Release #143 (2021.02) On behalf of the Rakudo development team, I’m very happy to announce the February 2021 release of Rakudo #143. Rakudo is an implementation of the Raku[^1] language. The source tarball for this release is available from <https://rakudo.org/files/rakudo>. Pre-compiled...
package csw.params.core.formats import java.lang import java.time.Instant import com.github.ghik.silencer.silent import csw.params.core.generics.{KeyType, Parameter} import play.api.libs.json._ /** * Derived Json formats to be used by play-json library. For scala, the library does not support character so a custom ...
default['ruby-env']['user'] = "ops" default['ruby-env']['group'] = "ops" default['ruby-env']['version'] = "2.1.2" default['ruby-env']['rbenv_url'] = "https://github.com/sstephenson/rbenv" default['ruby-env']['ruby-build_url'] = "https://github.com/sstephenson/ruby-build"
#!/usr/bin/env bash mkdir -p $(pwd)/config mkdir -p $(pwd)/logs mkdir -p $(pwd)/data docker run -it --rm \ --hostname gitlab.example.com \ --publish 443:443 --publish 80:80 \ --name gitlab \ --volume $(pwd)/config:/etc/gitlab \ --volume $(pwd)/logs:/var/log/gitlab \ --volume $(pwd)/data:/var/opt/gitlab \ gitla...
const generateRandomHexColor = () => `#${Math.floor(Math.random() * 0xffffff).toString(16)}`; export default generateRandomHexColor;
package javax.swing.event import java.awt.{AWTEvent, Container} import java.lang.Object import java.util.EventObject import javax.swing.JComponent import scala.scalanative.annotation.stub /** An event reported to a child component that originated from an * ancestor in the component hierarchy. * * Warning: * ...
CREATE NONCLUSTERED INDEX [IX_QualificationRouteMapping_RouteId] ON [dbo].[QualificationRouteMapping] ([RouteId]) INCLUDE ([QualificationId])
# Chromium B.S.U. - Home: http://chromium-bsu.sourceforge.net/, https://sourceforge.net/projects/chromium-bsu/ - Media: https://en.wikipedia.org/wiki/Chromium_B.S.U. - State: mature - Download: http://chromium-bsu.sourceforge.net/download.html, https://sourceforge.net/projects/chromium-bsu/files/ - Keyword: action, sh...
#!/bin/bash php artisan install if [ ! -f .env11 ]; then copy .env-exapmle .env echo ".env file created" fi php artisan key:generate php artisan config:cache
class AsymmetricCredential include Mongoid::Document include Mongoid::Encryptor field :email field :password validates_presence_of :email, :password encrypts :password, :mode => :asymmetric, :private_key_file => File.dirname(__FILE__) + '/../keys/private', :public_key_file => File.dirname(__FILE_...
package eval import ( "reflect" "go/ast" "go/token" ) func checkUnaryExpr(unary *ast.UnaryExpr, env Env) (*UnaryExpr, []error) { aexpr := &UnaryExpr{UnaryExpr: unary} x, errs := CheckExpr(unary.X, env) if errs == nil || x.IsConst() { if t, err := expectSingleType(x); err != nil { errs = append(errs, err)...
namespace RawNet { public class BlackArea { public uint Offset { get; set; } // Offset in bayer pixels. public uint Size { get; set; } // Size in bayer pixels. public bool IsVertical { get; set; } // Otherwise horizontal public BlackArea(uint offset, uint size, bool isVertica...
package org.jmqtt.broker.processor.dispatcher.akka; import akka.actor.typed.Behavior; import akka.actor.typed.javadsl.AbstractBehavior; import akka.actor.typed.javadsl.ActorContext; import akka.actor.typed.javadsl.Behaviors; import akka.actor.typed.javadsl.Receive; import org.jmqtt.broker.common.log.JmqttLogger; impor...
.nds .relativeinclude on .erroronwarning on ; This patch for the boss randomizer prevents the boss in Gergoth's tower from being loaded in until the player enters the top floor of the tower. ; In order for the patch to work correctly, the boss entity should be at index 1 and the tower floors entity should be at index ...
<?php namespace App\Providers; use SKAgarwal\GoogleApi\PlacesApi; use Illuminate\Support\ServiceProvider; use Illuminate\Contracts\Routing\UrlGenerator; use Illuminate\Support\Facades\Blade; class AppServiceProvider extends ServiceProvider { /** * Register any application services. * * @return voi...
using System; using UnityEngine; using Random = UnityEngine.Random; // TODO: Move each method to its categorize and remove this class public static class RandomUtils { /// <summary> /// E.g., Given 3 return random number in range (-3, 3). /// </summary> public static float RandomTwoSides(this float range) =>...
module Day7 ( day7 ) where import Data.Maybe (mapMaybe) import Text.ParserCombinators.ReadP (many1, char, ReadP, string, (+++), optional) import Parse (parseMaybe, word, space, integer) day7 = do content <- readFile "input/d7" let xs = lines content ys = mapMaybe bagRule xs zs = map (flip bagTree ...
package ${packageName} import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup class ${name}Fragment: BaseFragment(), ${name}Contracts.View { var presenter: ${name}Contracts.Presenter? = ${name}Presenter(this) override fun onCreateView(inflater: Lay...
part of fab_rx; class DateTimeProperty extends Property<DateTime> { DateTimeProperty({ String? hint, bool isRequired = false, bool isReadOnly = false, }) : super( hint: hint, isRequired: isRequired, isReadOnly: isReadOnly, ); } class StringProperty e...
import math import torch import torch.nn as nn from torch.nn.modules.utils import _pair from model.deform_conv_func import deform_conv, modulated_deform_conv class DeformConv(nn.Module): def __init__(self, in_channels, out_channels, kernel_size, stride=1, padding=0, dilation=1, groups=1, deformab...
<?php /** * iCMS - i Content Management System * Copyright (c) 2007-2012 idreamsoft.com iiimon Inc. All rights reserved. * * @author coolmoo <idreamsoft@qq.com> * @site http://www.idreamsoft.com * @licence http://www.idreamsoft.com/license.php * @version 6.0.0 * @$Id: setting.app.php 2365 2014-02-23 16:26:27Z coolmoo $...
<div class="container"> <div class="text-center row"> <h1>Price List</h1> <h4>(Click on image to view price list) </h4> </div> </div> <div id="promotion-menu" class="container"> <div class="text-center row"> <div class="col-lg-4 col-md-4"> <a href="#"><img src="<?php echo theme_img("general-price...
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. namespace Microsoft.Diagnostics.Monitoring.WebApi { /// <summary> /// Metadata keys that represent artfiact...
package strand func ToRNA(dna string) string { panic("Please implement the ToRNA function") }
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Source EULA. See License.txt in the project root for license information. *--------------------------------------------------------------...
var NAVTREEINDEX5 = { "interface_c_p_t_layer.html#a06be29da235c38bd3486381fe8a32bc9":[3,0,39,22], "interface_c_p_t_layer.html#a0bda69b9230fdc00acd95398450b22d3":[3,0,39,7], "interface_c_p_t_layer.html#a0f90f18ea1fcebd8b6ec3dfb3ed44716":[3,0,39,24], "interface_c_p_t_layer.html#a1101010e2d09bb239f698885938306dd":[3,0,39,...
require 'test_helper' #class BatchTest < ActiveSupport::TestCase # test 'single_server' do # sum = 0 # threads = [] # 100.times do # threads << Thread.new{ Batch.single_server(:batch_test) { sum = sum + 1 } } # end # ThreadsWait.all_waits(*threads) # threads.each do |thread| # sleep(0.1) # ...
# Moniker # A random name generator for Node.js. ## Synopsis ## Moniker provides a default adjective/noun generator. Use it like this: var Moniker = require('moniker'); console.log(Moniker.choose()); // Example output: murky-hands You can also make a custom generator. Generators create random names usi...
# require 'test_helper' # # class Users::OmniauthCallbacksControllerTest < ActionController::TestCase # context 'signup' do # OmniAuth.config.test_mode = true # # should 'allow signup with facebook credentials' do # name = Faker::Name.name # email = Faker::Internet.email # facebook_omniauth_...
# # Copyright (c) 2014,2015, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of c...
require 'rails_helper' RSpec.describe "Tags", type: :request do let(:user) { create :user } let(:stubbed_post) { create :post } let(:valid_attributes) { { tag: { text: "biology tag", user_id: user.id, description: "This is a new tag" } } } describe "GET #show" do...
## 如何使用社区 在默认情况下,边缘节点的Pod只能访问云端Pod和节点,边缘节点之间不能互通, 这是为了避免边缘节点建立太多隧道造成不必要的浪费。为了使需要通信的边缘节点可以相互访问,我们 提出了社区这个概念,在同一社区的边缘节点可以相互访问. 创建一个社区非常简单,假设我们现在有一个边缘集群,集群里有3个边缘节点edge1, edge2, edge3,为了使三者可以相互访问, 创建如下社区: ```yaml apiVersion: community.fabedge.io/v1alpha1 kind: Community metadata: name: all-edge-nodes spec: members:...
#include "pointCI.h" #include <osg/BoundingBox> namespace seed { namespace io { class PointsReader; class PointVisitor { public: PointVisitor(); virtual ~PointVisitor() {}; bool PerpareFile(const std::string& input, bool runStatistic); int NextPoint(PointCI& point); // >= 1 normal, ...
fact(0,1). fact(N,R):- N1 is N-1, fact(N1,R1), R is N*R1.
# Documentação Sails.js > Referência de API > O conteúdo desse arquvi será reescrito automaticamente durante a compilação (por favor, não edite manualmente!) <docmeta name="displayName" value="Referência de API: Tabela de Conteúdo"> <docmeta name="isTableOfContents" value="true">
require "hiera/backend/aws/base" class Hiera module Backend module Aws # Implementation of Hiera keys for aws/cloudformation class Cloudformation < Base def initialize(scope = {}) super(scope) @client = AWS::CloudFormation::Client.new end # Override defaul...
--- name: Morgenbader tags: - uofficielt image: morgenbader.jpg coverimage: cover-swimming.jpg date_added: 2020-09-04 buylink: https://www.waingunga-stammen.dk/nyt-maerke-morgenbader age: 6+ --- **For at gøre sig fortjent til morgenbader-mærket:** - skal man morgenbade i hav, sø eller å, hver morgen på en sommerlejr, d...
#!/bin/bash ############################################################################ # # Usage: get_tl_shp_file.sh # # Download shp file from https://www2.census.gov/geo/tiger # # Options: # -y|--year [ year of data ] # -f|--filepath [ filepath from year folder ] # ###############################################...
import 'package:clubhouse/Config/Colors.dart'; import 'package:clubhouse/ModelData/BottomSheetData.dart'; import 'package:clubhouse/Widgets/Profile_Image.dart'; import 'package:flutter/material.dart'; class BottomSheetWidget extends StatefulWidget { const BottomSheetWidget({Key? key}) : super(key: key); @override...
import { createClient } from "redis"; export type RedisClientReturnType = ReturnType<typeof createClient>
--- title: "Welcome to James dev bolog!" date: 2018-11-30 13:41:00 +0900 categories: Bolog Post --- 제임스의 기술 블로그에 오신것을 환영합니다.
@{ Layout = "_Layout"; } <h1>Your orders has been cleared!</h1> <p><a href="/orders">Back to list of Orders.</a></p>
using System; using FundamentalsConsoleApp; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Tests { [TestClass] public class FastCarTests { [TestInitialize] public void setup() { onEngineStartEventHandlerFired = false; } [TestMethod] ...
class ChangeBusinessSupportEditionAreasToGssCodes < Mongoid::Migration def self.up # Editing of an edition with an Archived artefact is not allowed Edition.skip_callback(:save, :before, :check_for_archived_artefact) BusinessSupportEdition.all.each do |edition| edition.area_gss_codes = Area.areas_fo...
console.log('+-------------------STRING TEMPLATE-------------------+') const apellido = 'Millan'; let nombre = 'Darlyn Geovanny'; let varNumero = 11; console.log('+ Señor ' +apellido+' su multiplicación es: ' +(varNumero * 7)); //Aplicación del string template console.log(''); let stringTemplate = `+ STRING TEMPLAT...
using System; using BUCommon; namespace b2app { public class AddAccount : BackupCmd { private readonly Options.AddAccountOptions _opts; public AddAccount(Options.AddAccountOptions opts) { _opts = opts; } public override int run(AccountList accts) { /* validate the options. ...
-- | -- Module : Simulation.Aivika.Lattice.Internal.Lattice -- Copyright : Copyright (c) 2016-2017, David Sorokin <david.sorokin@gmail.com> -- License : BSD3 -- Maintainer : David Sorokin <david.sorokin@gmail.com> -- Stability : experimental -- Tested with: GHC 7.10.3 -- -- This module defines the lattice. --...
using System; using System.Threading.Tasks; using Application.MainDTOs; using Application.Users; using Domain; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace API.Controllers { public class UsersController : BaseController { [HttpPost("login")] [AllowAnonymo...
using System; namespace KYC.MVC.Models { public class QueryRequest { public String Key { get; set; } public String Issuer { get; set; } public String Subject { get; set; } } }
import createMatcher from './create-matcher'; import HashHistory from './history/hash'; import HTML5History from './history/html5'; import install from './install'; class VueRouter{ constructor(options) { // 匹配器,传入路径,拿到对应的记录,内部提供两个方法 // match: 匹配规则 // addRoutes: 动态添加路由 this.matcher ...
/* __ *\ ** ________ ___ / / ___ Scala API ** ** / __/ __// _ | / / / _ | (c) 2003-2010, LAMP/EPFL ** ** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/...
import 'package:sarsys_domain/sarsys_domain.dart' as sar; import 'package:sarsys_core/sarsys_core.dart'; /// A ResourceController that handles /// [/api/incidents/{uuid}/subjects](http://localhost/api/client.html#/TalkGroup) requests class TalkGroupController extends EntityController<sar.OperationCommand, sar.Operatio...
import styles from './styles.module.scss'; type levelOneTitleData = { children: any; fontSize: number; marginTop: number; } export default function LevelOneTitle({ children, fontSize, marginTop = 0}: levelOneTitleData) { return ( <h1 style={{ fontSize, ...
package com.github.charbgr.cliffhanger.features.detail.arch import com.github.charbgr.arch.UseCase import com.github.charbgr.cliffhanger.api_tmdb.entity.FullMovieEntityMapper.transform import com.github.charbgr.cliffhanger.di.Deppie import io.reactivex.Observable class GetMovieUseCase : UseCase.RxObservable<PartialCh...
* Toolkit II Constants (English)  1985 T.Tebby QJUMP * section defs xdef ext_english xdef ext_language xdef ynaq xdef message xdef dec_point xdef zero_w xdef prior xdef pipe_len xdef pipe_nol * ext_english ext_language ynaq dc.b 'YNAQ' message dc.w yn_messg-* dc.w ynaq_mes-* dc.w to_messg-* ...
""" The :mod:`frlearn.uncategorised` subpackage implements elementary arithmetic, linear algebra and other functions that don't belong in any of the other subpackages. """
const { Command, flags } = require('@oclif/command'); const { sleep, getNotarizationInfo, getRequestStatus, notarizeApp, staple, } = require('./util'); class NotarizeCliCommand extends Command { async run() { // eslint-disable-next-line no-shadow const { flags } = this.parse(NotarizeCliCommand); ...
package bitwarden import ( "encoding/json" "fmt" "github.com/go-resty/resty/v2" "github.com/sirupsen/logrus" ) type BitwardenClient interface { GetProperty(property string) string SetProperty(property string, value string) string GetItems(folder string) (Items, error) GetItem(itemID string) (Item, error) Fi...
module TwilioSystemSpecHelpers def twilio_response @number = @number ? @number + 1 : 1 OpenStruct.new(sid: @number) end def incoming_sms(phone_number:, body:) post twilio_incoming_url, params: { "Body": body, "To": "+15555555555", "From": phone_number, } end end RSpec.configu...
#!/bin/sh USERNAME="$1" PASSWORD="$2" DB_NAME="$3" DP_PATH="$4" DP_DIR="DPDATA" DP_FILE="${DB_NAME}.dump" # Make sure the physical directory exists mkdir -p "$DP_PATH" # Make sure the DB directory object exists sqlplus / as sysdba <<EOF CREATE OR REPLACE DIRECTORY $DP_DIR AS '$DP_PATH'; quit EOF # Export the data e...
//! General functions use crate::analyze::{highest, highest_x, highest_y, lowest_x, lowest_y, set_range, split_up}; use crate::parse::to_xy; use crate::Xy; use crate::{Log, Parameters}; use kern::Fail; use plotlib::page::Page; use plotlib::repr::Plot; use plotlib::style::PointStyle; use plotlib::view::ContinuousView; ...
require 'rails_helper' RSpec.describe 'School Partners', :schools, type: :system do let!(:school_group) { create(:school_group, name: 'BANES') } let(:school_name) { 'Oldfield Park Infants'} let!(:school) { create_active_school(name: school_name, school_group: school_group) } let!(:admin) { cre...
import 'package:flutter/material.dart'; class FloatingClouds extends StatefulWidget { @override _FloatingCloudsState createState() => _FloatingCloudsState(); } class _FloatingCloudsState extends State<FloatingClouds> with TickerProviderStateMixin { ///controls far clouds AnimationController _controllerSlo...
;================================================================================ ; Dark World Spawn Location Fix & Master Sword Grove Fix ;-------------------------------------------------------------------------------- DarkWorldSaveFix: LDA.b #$70 : PHA : PLB ; thing we wrote over - data bank change JSL.l MasterSwo...
--- title: "Proporción de empleos en los sectores del turismo sostenible respecto del total de empleos del turismo" lang: es permalink: /es/8-9-2/ sdg_goal: 8 layout: indicator indicator: "8.9.2" target_id: "8.9" ---
let _timer_stream_id = 0; let _serialPort; let _reader; let _buffline = ""; const TIMER_STREAM = 500; // 読み込みのためのタイマーインターバル const FILTER = [ {usbVendorId: 0x04D8, usbProductId: 0x000A} ]; const BAUDRATE = 9600; // const CHART_CNT = 500; // チャートに表示する件数 const CHART_CNT = 50000; // チャートに表示する件数 2s...
<?php $lang['principal_module'] = 'Modulo'; $lang['principal_person'] = 'Persona';
--- title: Predial Servitude letter: P permalink: "/definitions/bld-predial-servitude-2.html" body: A rlght whlch is granted for the advantage of one piece of land over another, and which may he exer-dsed by every possessor of the land entitled against every possessor of the servient land. It always presupposes two...
package slieb.closure.render; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import java.util.LinkedHashMap; import java.util.Map; public class DefinesFileRendererTest { private final DefinesFileRenderer renderer = new DefinesFileRenderer(); @...
#!perl -T use 5.012; use strict; use warnings FATAL => 'all'; use App::CELL::Log qw( $log ); use App::CELL::Status; use App::CELL::Test; use Data::Dumper; use Test::More tests => 50; my $status; $log->init( ident => 'CELLtest' ); $log->info("------------------------------------------------- "); $log->info("--- ...
//////////////////////////////////////////////////////////////////////////////// // The MIT License (MIT) // // Copyright (c) 2021 Tim Stair // // 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 Softw...
<?php declare(strict_types=1); namespace TheAllNewPHP; # Generator return expressions (see page 17) $letters = (function() { yield 'A'; yield 'B'; return 'C'; })(); foreach ($letters as $letter) { echo $letter . ' '; } echo $letters->getReturn();
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Posts extends Model { // protected $table = "posts"; function PostMeta(){ return $this->hasOne('App\PostMeta','post_id'); } function Comments(){ return $this->hasMany("App\Comments","post_id")->where('approve','=',1)->...
# JSON Expression Converter An algorithm to convert JSON expression into infix rule which Drools or other rule engines understand.
import { TextlintRuleModule } from "@textlint/types"; import * as LSP from "vscode-languageclient/node"; export interface Options { // if the Str includes `allows` word, does not report it allows?: string[]; } const report: TextlintRuleModule<Options> = (context, options = {}) => { const {Syntax, RuleErro...
import org.scalatest.funsuite._ import day16.Part1.{getTicketScanningErrorRate, readNotes} class Day16Part1Spec extends AnyFunSuite { test("Should get the correct scanning error rate.") { val (validRanges, _, nearbyTicketsValues) = readNotes("day16.txt") assert(getTicketScanningErrorRate(validRanges, nearby...
package main import ( "playGo/algorithm/swordToOffer/dataStruct/tree" ) // 面试题28:对称的二叉树 // 题目:请实现一个函数,用来判断一棵二叉树是不是对称的。如果一棵二叉树和 // 它的镜像一样,那么它是对称的。 // --- method 1 --- func isSymmetricalTree(pHead *tree.Tree) bool { // 自己和自己对比 return symmetricalCore(pHead, pHead) } // tree1的前序遍历(中左右)应该和tree2的对称前序遍历(中右左)相等 func sym...
#include "Display.h" #include <iostream> #include <GL/glew.h> Display::Display(std::string name, int w, int h, bool fullscreen){ init(name, w, h, fullscreen); } Display::~Display(){ SDL_GL_DeleteContext(_gl); if(_window) SDL_DestroyWindow(_window); } void Display::init(std::string name, int w, in...
--- layout: p5js author: "Ludwig Frank" author-url: http://ludwigfrank.com title: Planets tags: - P5.js - chance permalink: /chance/planets/ summary: Drawing a circle. ---
mod server; mod client; mod game_client; mod msg; mod constants; mod minipack; mod leaderboard; mod stage; mod menu; mod settings; use std::env; fn main() { if env::args().any(|s| s == "--server") { server::start_server(); } else { let mut fullscreen = true; let mut fps_count_enabled = false; let mut input_...
package com.github.kacso.androidcommons.extensions import java.util.regex.Pattern /** * * Extension class for String based classes * * @author Danijel Sokač */ /** * This function will check if any of input key values matches any words in query parameter. * Function is case insensitive. * * @example * ...
using Ortogo.SolidWorks.ShelvingTask; namespace ShelvingTaskTest { public class TestSets { public static void InitFirst() { GlobalScope.QI = 150; GlobalScope.NL = 8; GlobalScope.K = 0.3; GlobalScope.L = 1.050; GlobalScope.G = 0.5; ...